[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/beardbolt 9e38f2238b 135/323: Add support for functions
From: |
ELPA Syncer |
Subject: |
[elpa] externals/beardbolt 9e38f2238b 135/323: Add support for functions as arguments to :compile-cmd |
Date: |
Thu, 9 Mar 2023 10:58:24 -0500 (EST) |
branch: externals/beardbolt
commit 9e38f2238bdb72cb857d974644d55c0aa9c2e466
Author: Jay Kamat <jaygkamat@gmail.com>
Commit: Jay Kamat <jaygkamat@gmail.com>
Add support for functions as arguments to :compile-cmd
---
rmsbolt.el | 15 +++++++++++++--
1 file changed, 13 insertions(+), 2 deletions(-)
diff --git a/rmsbolt.el b/rmsbolt.el
index 220786f891..2cbb53f38d 100644
--- a/rmsbolt.el
+++ b/rmsbolt.el
@@ -295,7 +295,8 @@ This function does NOT quote the return value for use in
inferior shells."
(compile-cmd
nil
:type 'string
- :documentation "Default compilation command to use if none is provided.")
+ :documentation "Default compilation command to use if none is provided.
+If provided a function, call that function with the source buffer to determine
the compile command.")
(compile-cmd-function
nil
:type 'function
@@ -325,6 +326,8 @@ Return value is quoted for passing to the shell."
(rmsbolt-output-filename ,src-buffer))))
,@body))
+;;;; Compile Commands
+
(cl-defun rmsbolt--c-compile-cmd (&key src-buffer)
"Process a compile command for gcc/clang."
(rmsbolt--with-files
@@ -509,6 +512,9 @@ Return value is quoted for passing to the shell."
(rmsbolt--disassemble-file file-name (current-buffer))
(rmsbolt--handle-finish-compile src-buffer nil :override-buffer
(current-buffer)))))
+
+;;;; Hidden Function Definitions
+
(defvar rmsbolt--hidden-func-c
(rx bol (or (and "__" (0+ any))
(and "_" (or "init" "start" "fini"))
@@ -1019,6 +1025,7 @@ Argument OVERRIDE-BUFFER use this buffer instead of
reading from the output file
"Helper function to get lang def for LANGUAGE."
(or rmsbolt-language-descriptor
(cdr-safe (assoc major-mode rmsbolt-languages))))
+
(defun rmsbolt--parse-options ()
"Parse RMS options from file."
(hack-local-variables)
@@ -1028,7 +1035,11 @@ Argument OVERRIDE-BUFFER use this buffer instead of
reading from the output file
(force-disass (not (rmsbolt-l-supports-asm lang)))
(force-asm (not (rmsbolt-l-supports-disass lang))))
(when (not cmd)
- (setq-local rmsbolt-command (rmsbolt-l-compile-cmd lang)))
+ (setq-local rmsbolt-command
+ (let ((new-cmd (rmsbolt-l-compile-cmd lang)))
+ (pcase new-cmd
+ ((pred functionp) (funcall new-cmd src-buffer))
+ (_ new-cmd)))))
(when (and force-disass force-asm)
(error "No disassemble method found for this langauge, please double
check spec"))
(when force-disass
- [elpa] externals/beardbolt 060f170a61 085/323: Clear overlays upon exiting rmsbolt mode, (continued)
- [elpa] externals/beardbolt 060f170a61 085/323: Clear overlays upon exiting rmsbolt mode, ELPA Syncer, 2023/03/09
- [elpa] externals/beardbolt 47e9fa1f59 112/323: Update README, ELPA Syncer, 2023/03/09
- [elpa] externals/beardbolt c6831044c6 092/323: Update README, ELPA Syncer, 2023/03/09
- [elpa] externals/beardbolt 5c5e0e35db 115/323: Add prototype support for emacs lisp bytecode, ELPA Syncer, 2023/03/09
- [elpa] externals/beardbolt 032b3d8eef 107/323: Add melpa badge, ELPA Syncer, 2023/03/09
- [elpa] externals/beardbolt d1b0f7c2ba 118/323: Fix compilation warnings, ELPA Syncer, 2023/03/09
- [elpa] externals/beardbolt 0ed6a01cd1 119/323: Fix initial run of emacs-lisp disassembler, ELPA Syncer, 2023/03/09
- [elpa] externals/beardbolt 77842a5f78 126/323: Add elisp support to docs, ELPA Syncer, 2023/03/09
- [elpa] externals/beardbolt c00d09a850 122/323: Use hashtables instead of lists as sets for labels used, ELPA Syncer, 2023/03/09
- [elpa] externals/beardbolt c009c2df44 130/323: Trim left side of strings to activate 'starting with period' opt, ELPA Syncer, 2023/03/09
- [elpa] externals/beardbolt 9e38f2238b 135/323: Add support for functions as arguments to :compile-cmd,
ELPA Syncer <=
- [elpa] externals/beardbolt 1cc069a121 132/323: Quote filenames before passing them as shell arguments, ELPA Syncer, 2023/03/09
- [elpa] externals/beardbolt 495d481a94 136/323: Move rmsbolt-command initialization to end, ELPA Syncer, 2023/03/09
- [elpa] externals/beardbolt 39055a3dc4 133/323: Fix disassembly of partial files in C/C++, ELPA Syncer, 2023/03/09
- [elpa] externals/beardbolt 27e7bb714f 139/323: Add suppport for PHP, ELPA Syncer, 2023/03/09
- [elpa] externals/beardbolt 4b6abc5ef8 129/323: Optimize rmsbolt-process-src-asm-lines, ELPA Syncer, 2023/03/09
- [elpa] externals/beardbolt 67238e0272 138/323: Add rmsbolt-default-directory customization, ELPA Syncer, 2023/03/09
- [elpa] externals/beardbolt 9b2c85397c 149/323: Add texinfo version of docs, ELPA Syncer, 2023/03/09
- [elpa] externals/beardbolt ec99a1aa31 146/323: Attempt to fix whitespace clearing on hot recompiles, ELPA Syncer, 2023/03/09
- [elpa] externals/beardbolt 5e389a88d9 152/323: Add rmsbolt splitter for splitting and mutating commands, ELPA Syncer, 2023/03/09
- [elpa] externals/beardbolt 0fbc3d3f09 153/323: Enable compile_commands.json parsing for c/cpp, ELPA Syncer, 2023/03/09