emacs-bug-tracker
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#74378: closed ([PATCH] Allow lambdas for 'flymake-cc-command')


From: GNU bug Tracking System
Subject: bug#74378: closed ([PATCH] Allow lambdas for 'flymake-cc-command')
Date: Sat, 07 Dec 2024 12:45:02 +0000

Your message dated Sat, 07 Dec 2024 14:44:38 +0200
with message-id <86plm3irwp.fsf@gnu.org>
and subject line Re: bug#74378: [PATCH] Allow lambdas for 'flymake-cc-command'
has caused the debbugs.gnu.org bug report #74378,
regarding [PATCH] Allow lambdas for 'flymake-cc-command'
to be marked as done.

(If you believe you have received this mail in error, please contact
help-debbugs@gnu.org.)


-- 
74378: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=74378
GNU Bug Tracking System
Contact help-debbugs@gnu.org with problems
--- Begin Message --- Subject: [PATCH] Allow lambdas for 'flymake-cc-command' Date: Sat, 16 Nov 2024 11:54:19 +0800
Hello!

Currently the option 'flymake-cc-command' only takes a symbol that names
a function, instead of all callable objects. I am not sure if that is an
intentional design, but I think the alternative is more common and
semantic. So I am proposing this patch to allow setting
'flymake-cc-command' to an unnamed lambda (and other callable objects).

Thank you!

Pengji

>From 53cc56749e8b396fefb7f430a1eb9e13aa4a25ee Mon Sep 17 00:00:00 2001
From: Pengji Zhang <me@pengjiz.com>
Date: Sat, 16 Nov 2024 11:26:41 +0800
Subject: [PATCH] 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.
---
 lisp/progmodes/flymake-cc.el | 12 ++++++------
 1 file 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 @@
 
 (require 'cl-lib)
 
-(defcustom flymake-cc-command 'flymake-cc-use-special-make-target
+(defcustom flymake-cc-command #'flymake-cc-use-special-make-target
   "Command used by the `flymake-cc' backend.
-A list of strings, or a symbol naming a function that produces one
-such list when called with no arguments in the buffer where the
-variable `flymake-mode' is active.
+A list of strings, or a function that produces one such list when called
+with no arguments in the buffer where the variable `flymake-mode' is
+active.
 
 The command should invoke a GNU-style compiler that checks the
 syntax of a (Obj)C(++) program passed to it via its standard
 input and prints the result on its standard output."
   :type '(choice
-          (symbol :tag "Function")
+          (function :tag "Function")
           (repeat :tag "Command(s)" string))
   :version "27.1"
   :group 'flymake-cc)
@@ -128,7 +128,7 @@ flymake-cc
        (make-process
         :name "gcc-flymake"
         :buffer (generate-new-buffer "*gcc-flymake*")
-        :command (if (symbolp flymake-cc-command)
+        :command (if (functionp flymake-cc-command)
                      (funcall flymake-cc-command)
                    flymake-cc-command)
         :noquery t :connection-type 'pipe
-- 
2.47.0


--- End Message ---
--- Begin Message --- Subject: Re: bug#74378: [PATCH] Allow lambdas for 'flymake-cc-command' Date: Sat, 07 Dec 2024 14:44:38 +0200
> From: Spencer Baugh <sbaugh@janestreet.com>
> Cc: 74378@debbugs.gnu.org,  me@pengjiz.com
> Date: Fri, 06 Dec 2024 11:24:29 -0500
> 
> 
> Eli Zaretskii <eliz@gnu.org> writes:
> > Ping!  Spencer, please respond.
> 
> This seems like a fine change.
> 
> I assume the original motivation was that functionp is slightly
> ambiguous on lists of symbols; '(lambda) is both a list of symbols and a
> functionp.  But this defcustom is a list of strings, so it's fine.

Thanks, installed on the master branch, and closing the bug.


--- End Message ---

reply via email to

[Prev in Thread] Current Thread [Next in Thread]