GNU bug report logs - #57752
28.1.91; emacsclient-mail.desktop doesn't work for me

Previous Next

Package: emacs;

Reported by: Damien Cassou <damien <at> cassou.me>

Date: Mon, 12 Sep 2022 18:32:01 UTC

Severity: normal

Merged with 59743

Found in version 28.1.91

Full log


Message #107 received at 57752 <at> debbugs.gnu.org (full text, mbox):

From: Gregory Heytings <gregory <at> heytings.org>
To: Lars Ingebrigtsen <larsi <at> gnus.org>
Cc: Damien Cassou <damien <at> cassou.me>, Jim Porter <jporterbugs <at> gmail.com>,
 Eli Zaretskii <eliz <at> gnu.org>, git <at> mavit.org.uk, 57752 <at> debbugs.gnu.org
Subject: Re: bug#57752: 28.1.91; emacsclient-mail.desktop doesn't work for me
Date: Mon, 19 Sep 2022 08:56:13 +0000
>> emacs --apply func arg1 arg2
>
> Yes, that sounds good.
>

Hmm...  I did not see the --apply proposal earlier, it's nice and lispy 
indeed.

I think I would prefer to separate the two concerns (stuffing argument 
strings into the Lisp environment on the one hand, and forms on the other 
hand), but it seems good enough, and perhaps it's the best compromise.

One disadvantage I see is that it becomes a bit more complex to write 
function calls with arguments that are not strings.  E.g. to call

(some-func 1 "arg" t)

one would have to do something like

--eval '(defun tmp-func (arg) (some-func 1 arg t))' --apply tmp-func arg

instead of something like

--set args arg -- --eval '(some-func 1 (car args) t)'

Likewise, if we want to use the arguments in multiple --eval forms, 
something like

--eval '(defun setarg1 (arg) (setq arg1 arg))' --apply setarg1 arg -- --eval '(... arg1 ...)' --eval '(... arg1 ...)'

will be necessary.  Yet another example is that to loop over all 
arguments, one would have to do something like

--eval '(defun loop-fun (args) (dolist (arg args) ...))' --apply loop-fun args

instead of something like

--set args arg -- --eval '(dolist (arg args) ...)'

One case in which --apply is better is when the function is already 
defined by Emacs, e.g. (with the .desktop example mentioned upthread, and 
assuming that find-many-files is defined by Emacs)

--apply find-many-files %F

is probably clearer than

--set files %F -- --eval '(find-many-files files)'

>
> (But we'd still need "--" to say that the arguments have ended.)
>

Except for the last argument(s), of course.  IOW, except if there are no 
arguments that must not be passed to the function after the function 
arguments.




This bug report was last modified 1 year and 283 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.