aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPengji Zhang2024-11-16 11:26:41 +0800
committerEli Zaretskii2024-12-07 14:37:36 +0200
commitbf976ca7436b620ac33f00fa12317038ab387e00 (patch)
tree8b45bcea135f7feaee69a5e35ec4a7c46b1f4bba
parentd84c5c24b58b124f79b2a61e58e46c501d8ec52a (diff)
downloademacs-bf976ca7436b620ac33f00fa12317038ab387e00.tar.gz
emacs-bf976ca7436b620ac33f00fa12317038ab387e00.zip
Allow lambdas for 'flymake-cc-command'
* lisp/progmodes/flymake-cc.el (flymake-cc-command): Use customization type 'function' instead of 'symbol' to allow other callable objects in addition to named functions, and update the doc string accordingly. (flymake-cc): Use 'functionp' to check if 'flymake-cc-command' is callable. (Bug#74378)
-rw-r--r--lisp/progmodes/flymake-cc.el12
1 files changed, 6 insertions, 6 deletions
diff --git a/lisp/progmodes/flymake-cc.el b/lisp/progmodes/flymake-cc.el
index 60e7da5d617..79557c9fbe4 100644
--- a/lisp/progmodes/flymake-cc.el
+++ b/lisp/progmodes/flymake-cc.el
@@ -28,17 +28,17 @@
28 28
29(require 'cl-lib) 29(require 'cl-lib)
30 30
31(defcustom flymake-cc-command 'flymake-cc-use-special-make-target 31(defcustom flymake-cc-command #'flymake-cc-use-special-make-target
32 "Command used by the `flymake-cc' backend. 32 "Command used by the `flymake-cc' backend.
33A list of strings, or a symbol naming a function that produces one 33A list of strings, or a function that produces one such list when called
34such list when called with no arguments in the buffer where the 34with no arguments in the buffer where the variable `flymake-mode' is
35variable `flymake-mode' is active. 35active.
36 36
37The command should invoke a GNU-style compiler that checks the 37The command should invoke a GNU-style compiler that checks the
38syntax of a (Obj)C(++) program passed to it via its standard 38syntax of a (Obj)C(++) program passed to it via its standard
39input and prints the result on its standard output." 39input and prints the result on its standard output."
40 :type '(choice 40 :type '(choice
41 (symbol :tag "Function") 41 (function :tag "Function")
42 (repeat :tag "Command(s)" string)) 42 (repeat :tag "Command(s)" string))
43 :version "27.1" 43 :version "27.1"
44 :group 'flymake-cc) 44 :group 'flymake-cc)
@@ -128,7 +128,7 @@ REPORT-FN is Flymake's callback."
128 (make-process 128 (make-process
129 :name "gcc-flymake" 129 :name "gcc-flymake"
130 :buffer (generate-new-buffer "*gcc-flymake*") 130 :buffer (generate-new-buffer "*gcc-flymake*")
131 :command (if (symbolp flymake-cc-command) 131 :command (if (functionp flymake-cc-command)
132 (funcall flymake-cc-command) 132 (funcall flymake-cc-command)
133 flymake-cc-command) 133 flymake-cc-command)
134 :noquery t :connection-type 'pipe 134 :noquery t :connection-type 'pipe