all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Gregory Heytings <gregory@heytings.org>
To: Lars Ingebrigtsen <larsi@gnus.org>
Cc: Damien Cassou <damien@cassou.me>,
	Jim Porter <jporterbugs@gmail.com>, Eli Zaretskii <eliz@gnu.org>,
	git@mavit.org.uk, 57752@debbugs.gnu.org
Subject: bug#57752: 28.1.91; emacsclient-mail.desktop doesn't work for me
Date: Mon, 19 Sep 2022 08:56:13 +0000	[thread overview]
Message-ID: <a2d812f2ba10bfb33325@heytings.org> (raw)
In-Reply-To: <87zgex56bw.fsf@gnus.org>


>> 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.





  parent reply	other threads:[~2022-09-19  8:56 UTC|newest]

Thread overview: 42+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-09-12 18:31 bug#57752: 28.1.91; emacsclient-mail.desktop doesn't work for me Damien Cassou
2022-09-13 12:19 ` Lars Ingebrigtsen
2022-09-13 13:29   ` Damien Cassou
2022-09-13 13:41     ` Eli Zaretskii
2022-09-13 13:58       ` Damien Cassou
2022-09-13 14:57         ` Robert Pluim
2022-09-13 15:32           ` Damien Cassou
2022-09-15 18:30         ` Jim Porter
2022-09-16  9:54           ` Lars Ingebrigtsen
2022-09-16 10:09             ` Robert Pluim
2022-09-16 10:14               ` Lars Ingebrigtsen
2022-09-16 14:18                 ` Robert Pluim
2022-09-16 15:21                   ` Jim Porter
2022-09-16 12:38               ` Damien Cassou
2022-09-16 12:50                 ` Gregory Heytings
2022-09-16 14:46                   ` Damien Cassou
2022-09-16 15:07                     ` Gregory Heytings
2022-09-16 16:18                       ` Peter Oliver
2022-09-16 16:42                         ` Gregory Heytings
2022-09-16 17:21                           ` Jim Porter
2022-09-16 18:26                             ` Gregory Heytings
2022-09-16 19:33                               ` Jim Porter
2022-09-16 20:04                                 ` Gregory Heytings
2022-09-18 13:58                                   ` Robert Pluim
2022-09-16 14:19                 ` Robert Pluim
2022-09-16 14:47                   ` Damien Cassou
2022-09-16 15:17             ` Jim Porter
2022-09-18 10:23               ` Lars Ingebrigtsen
2022-09-18 14:46                 ` Robert Pluim
2022-09-19  8:09                   ` Lars Ingebrigtsen
2022-09-18 18:31                 ` Jim Porter
2022-09-19  8:12                   ` Lars Ingebrigtsen
2022-09-19 15:48                     ` Jim Porter
2022-09-19 18:45                       ` Lars Ingebrigtsen
2022-09-19  8:56                 ` Gregory Heytings [this message]
2022-09-19 12:00                   ` Lars Ingebrigtsen
2022-09-19 16:05                   ` Jim Porter
2022-09-19 17:01                     ` Gregory Heytings
2022-12-02 14:52     ` Max Nikulin
2023-07-26  5:14       ` Max Nikulin
2022-09-16 19:42   ` Jim Porter
2022-09-18 10:26     ` Lars Ingebrigtsen

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

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

  git send-email \
    --in-reply-to=a2d812f2ba10bfb33325@heytings.org \
    --to=gregory@heytings.org \
    --cc=57752@debbugs.gnu.org \
    --cc=damien@cassou.me \
    --cc=eliz@gnu.org \
    --cc=git@mavit.org.uk \
    --cc=jporterbugs@gmail.com \
    --cc=larsi@gnus.org \
    /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 external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.