unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: sbaugh@janestreet.com
Cc: 74378@debbugs.gnu.org, me@pengjiz.com
Subject: bug#74378: [PATCH] Allow lambdas for 'flymake-cc-command'
Date: Sat, 30 Nov 2024 11:55:26 +0200	[thread overview]
Message-ID: <86y11182r5.fsf@gnu.org> (raw)
In-Reply-To: <861pzbgsjo.fsf@gnu.org> (message from Eli Zaretskii on Sat, 16 Nov 2024 16:30:19 +0200)

Ping!  Spencer, please respond.

> Cc: 74378@debbugs.gnu.org
> Date: Sat, 16 Nov 2024 16:30:19 +0200
> From: Eli Zaretskii <eliz@gnu.org>
> 
> > From: Pengji Zhang <me@pengjiz.com>
> > Date: Sat, 16 Nov 2024 11:54:19 +0800
> > 
> > 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!
> 
> Spencer, any comments?
> 
> > >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
> > 
> 
> 
> 
> 





  reply	other threads:[~2024-11-30  9:55 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-11-16  3:54 bug#74378: [PATCH] Allow lambdas for 'flymake-cc-command' Pengji Zhang
2024-11-16 14:30 ` Eli Zaretskii
2024-11-30  9:55   ` Eli Zaretskii [this message]
2024-12-06 16:24     ` Spencer Baugh via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-12-07 12:44       ` Eli Zaretskii

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=86y11182r5.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=74378@debbugs.gnu.org \
    --cc=me@pengjiz.com \
    --cc=sbaugh@janestreet.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).