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 #116 received at 57752 <at> debbugs.gnu.org (full text, mbox):

From: Jim Porter <jporterbugs <at> gmail.com>
To: Gregory Heytings <gregory <at> heytings.org>, Lars Ingebrigtsen <larsi <at> gnus.org>
Cc: Damien Cassou <damien <at> cassou.me>, 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 09:05:52 -0700
On 9/19/2022 1:56 AM, Gregory Heytings wrote:
> 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)'

If Emacs gained a 'set-arg' function (similar to 'setarg1' in your 
message) that does the right thing, you could say:

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

Another way would be a function that "intelligently" converts arguments 
to other types. This is similar to how Eshell command forms work: if 
you're calling a Lisp function with sh-like syntax, it will 
automatically convert arguments that look like numbers into actual 
numbers. So maybe you could do something like:

  --apply autoconvert-strings-and-apply some-func 1 arg t

That seems clumsier to me than 'set-arg', but since these could all be 
written as Lisp functions, users or package authors should be able to do 
whatever they need. Of course, core Emacs could add whichever helper 
function(s) seem generally useful.

> One case in which --apply is better is when the function is already 
> defined by Emacs...

Yeah, for more-complex forms, you'd still need to fall back to --eval or 
something similar. But a Lisp function like 'set-arg' could let us reuse 
the --apply machinery. I think it could be as simple as this:

  (defun set-arg (name &rest value)
    (set (intern name) value))

That should give us '--set', except that it's spelled '--apply set-arg'.




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.