unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* Re: master f198a5c: Revert "emacsclient: ignore --eval parameters when starting alternate editor"
       [not found] ` <20190915121332.E09E720BC2@vcs0.savannah.gnu.org>
@ 2019-09-15 16:17   ` Sven Joachim
  2019-09-16 12:32     ` Lars Ingebrigtsen
  0 siblings, 1 reply; 9+ messages in thread
From: Sven Joachim @ 2019-09-15 16:17 UTC (permalink / raw)
  To: Lars Ingebrigtsen, emacs-devel

On 2019-09-15 08:13 -0400, Lars Ingebrigtsen wrote:

> branch: master
> commit f198a5c5144fdded1400df6e8454e4b1b912c7de
> Author: Lars Ingebrigtsen <larsi@gnus.org>
> Commit: Lars Ingebrigtsen <larsi@gnus.org>
>
>     Revert "emacsclient: ignore --eval parameters when starting alternate editor"
>
>     This reverts commit 6fe661342a24edcaea255c3ba9a37613031554da.
>
>     The alternate editor may be Emacs, which is useful when you want to eval something in an existing Emacs (if it exists), or in a new Emacs if there's no server running.

But if there is no server running, the new Emacs instance does not
actually eval the expression.  This is mentioned in the NEWS file:

,----
| *** emacsclient no longer passes '--eval' arguments to an alternate editor.
| Previously, '--eval' arguments were passed as file names to any
| alternate editor started by '--alternate-editor'.
`----

For that reason, --eval is useless if emacsclient cannot find the server
in Emacs.

Cheers,
       Sven

> ---
>  lib-src/emacsclient.c | 6 +-----
>  1 file changed, 1 insertion(+), 5 deletions(-)
>
> diff --git a/lib-src/emacsclient.c b/lib-src/emacsclient.c
> index e9469f7..65effc6 100644
> --- a/lib-src/emacsclient.c
> +++ b/lib-src/emacsclient.c
> @@ -700,11 +700,7 @@ fail (void)
>  {
>    if (alternate_editor)
>      {
> -      /* If the user has said --eval, then those aren't file name
> -	 parameters, so don't put them on the alternate_editor command
> -	 line. */
> -      size_t extra_args_size =
> -	(eval? 0: (main_argc - optind + 1) * sizeof (char *));
> +      size_t extra_args_size = (main_argc - optind + 1) * sizeof (char *);
>        size_t new_argv_size = extra_args_size;
>        char **new_argv = xmalloc (new_argv_size);
>        char *s = xstrdup (alternate_editor);
>
> _______________________________________________
> Emacs-diffs mailing list
> Emacs-diffs@gnu.org
> https://lists.gnu.org/mailman/listinfo/emacs-diffs



^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: master f198a5c: Revert "emacsclient: ignore --eval parameters when starting alternate editor"
  2019-09-15 16:17   ` master f198a5c: Revert "emacsclient: ignore --eval parameters when starting alternate editor" Sven Joachim
@ 2019-09-16 12:32     ` Lars Ingebrigtsen
  2019-09-16 14:18       ` Sven Joachim
  0 siblings, 1 reply; 9+ messages in thread
From: Lars Ingebrigtsen @ 2019-09-16 12:32 UTC (permalink / raw)
  To: Sven Joachim; +Cc: emacs-devel

Sven Joachim <svenjoac@gmx.de> writes:

> But if there is no server running, the new Emacs instance does not
> actually eval the expression.  This is mentioned in the NEWS file:
>
> ,----
> | *** emacsclient no longer passes '--eval' arguments to an alternate editor.
> | Previously, '--eval' arguments were passed as file names to any
> | alternate editor started by '--alternate-editor'.
> `----

This is the entry in the NEWS file that describes the patch that was
reverted, but the NEWS entry was left behind.  I've now removed it.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no



^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: master f198a5c: Revert "emacsclient: ignore --eval parameters when starting alternate editor"
  2019-09-16 12:32     ` Lars Ingebrigtsen
@ 2019-09-16 14:18       ` Sven Joachim
  2019-09-16 15:36         ` Benjamin Riefenstahl
  2019-09-16 15:41         ` Lars Ingebrigtsen
  0 siblings, 2 replies; 9+ messages in thread
From: Sven Joachim @ 2019-09-16 14:18 UTC (permalink / raw)
  To: Lars Ingebrigtsen; +Cc: emacs-devel

On 2019-09-16 14:32 +0200, Lars Ingebrigtsen wrote:

> Sven Joachim <svenjoac@gmx.de> writes:
>
>> But if there is no server running, the new Emacs instance does not
>> actually eval the expression.  This is mentioned in the NEWS file:
>>
>> ,----
>> | *** emacsclient no longer passes '--eval' arguments to an alternate editor.
>> | Previously, '--eval' arguments were passed as file names to any
>> | alternate editor started by '--alternate-editor'.
>> `----
>
> This is the entry in the NEWS file that describes the patch that was
> reverted, but the NEWS entry was left behind.  I've now removed it.

So, in what way is --eval useful without an Emacs already running?

,----
| $ lib-src/emacsclient -a emacs --eval '(+ 2 2)'
| 4
| $ lib-src/emacsclient -a emacs --eval '(server-force-delete)'
| "Connection file \"/run/user/1000/emacs/server\" deleted"
| $ lib-src/emacsclient -a emacs --eval '(+ 2 2)'
| lib-src/emacsclient: can't find socket; have you started the server?
| lib-src/emacsclient: To start the server in Emacs, type "M-x server-start".
`----

And I have a new Emacs instance running with a buffer named (+ 2 2) and
(New file) printed in the echo area.

Cheers,
       Sven



^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: master f198a5c: Revert "emacsclient: ignore --eval parameters when starting alternate editor"
  2019-09-16 14:18       ` Sven Joachim
@ 2019-09-16 15:36         ` Benjamin Riefenstahl
  2019-09-16 15:41         ` Lars Ingebrigtsen
  1 sibling, 0 replies; 9+ messages in thread
From: Benjamin Riefenstahl @ 2019-09-16 15:36 UTC (permalink / raw)
  To: Sven Joachim; +Cc: emacs-devel

Hi,

Sven Joachim writes:
> So, in what way is --eval useful without an Emacs already running?

When I am not in my office, I read my mail by running SSH into my
desktop machine and starting "emacsclient -nw -a '' -e '(gnus)'".
Usually this starts an Emacs server, but if Emacs is already running,
this will just bring it to the foreground.  In both cases it will
immediately update my Gnus instance.

benny



^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: master f198a5c: Revert "emacsclient: ignore --eval parameters when starting alternate editor"
  2019-09-16 14:18       ` Sven Joachim
  2019-09-16 15:36         ` Benjamin Riefenstahl
@ 2019-09-16 15:41         ` Lars Ingebrigtsen
  2019-09-16 19:18           ` Andreas Schwab
  1 sibling, 1 reply; 9+ messages in thread
From: Lars Ingebrigtsen @ 2019-09-16 15:41 UTC (permalink / raw)
  To: Sven Joachim; +Cc: emacs-devel

Sven Joachim <svenjoac@gmx.de> writes:

> | $ lib-src/emacsclient -a emacs --eval '(server-force-delete)'

If you read the bug report, the use case is -a "emacs --eval".

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no



^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: master f198a5c: Revert "emacsclient: ignore --eval parameters when starting alternate editor"
  2019-09-16 15:41         ` Lars Ingebrigtsen
@ 2019-09-16 19:18           ` Andreas Schwab
  2019-09-16 19:24             ` Lars Ingebrigtsen
  0 siblings, 1 reply; 9+ messages in thread
From: Andreas Schwab @ 2019-09-16 19:18 UTC (permalink / raw)
  To: Lars Ingebrigtsen; +Cc: Sven Joachim, emacs-devel

On Sep 16 2019, Lars Ingebrigtsen <larsi@gnus.org> wrote:

> Sven Joachim <svenjoac@gmx.de> writes:
>
>> | $ lib-src/emacsclient -a emacs --eval '(server-force-delete)'
>
> If you read the bug report, the use case is -a "emacs --eval".

That doesn't make sense, --eval requires an argument.

Andreas.

-- 
Andreas Schwab, schwab@linux-m68k.org
GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510  2552 DF73 E780 A9DA AEC1
"And now for something completely different."



^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: master f198a5c: Revert "emacsclient: ignore --eval parameters when starting alternate editor"
  2019-09-16 19:18           ` Andreas Schwab
@ 2019-09-16 19:24             ` Lars Ingebrigtsen
  2019-09-16 20:24               ` Andreas Schwab
  0 siblings, 1 reply; 9+ messages in thread
From: Lars Ingebrigtsen @ 2019-09-16 19:24 UTC (permalink / raw)
  To: Andreas Schwab; +Cc: Sven Joachim, emacs-devel

Andreas Schwab <schwab@linux-m68k.org> writes:

> On Sep 16 2019, Lars Ingebrigtsen <larsi@gnus.org> wrote:
>
>> Sven Joachim <svenjoac@gmx.de> writes:
>>
>>> | $ lib-src/emacsclient -a emacs --eval '(server-force-delete)'
>>
>> If you read the bug report, the use case is -a "emacs --eval".
>
> That doesn't make sense, --eval requires an argument.

The argument is what comes after --eval in the emacsclient command line.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no



^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: master f198a5c: Revert "emacsclient: ignore --eval parameters when starting alternate editor"
  2019-09-16 19:24             ` Lars Ingebrigtsen
@ 2019-09-16 20:24               ` Andreas Schwab
  2019-09-16 20:33                 ` Lars Ingebrigtsen
  0 siblings, 1 reply; 9+ messages in thread
From: Andreas Schwab @ 2019-09-16 20:24 UTC (permalink / raw)
  To: Lars Ingebrigtsen; +Cc: Sven Joachim, emacs-devel

On Sep 16 2019, Lars Ingebrigtsen <larsi@gnus.org> wrote:

> Andreas Schwab <schwab@linux-m68k.org> writes:
>
>> On Sep 16 2019, Lars Ingebrigtsen <larsi@gnus.org> wrote:
>>
>>> Sven Joachim <svenjoac@gmx.de> writes:
>>>
>>>> | $ lib-src/emacsclient -a emacs --eval '(server-force-delete)'
>>>
>>> If you read the bug report, the use case is -a "emacs --eval".
>>
>> That doesn't make sense, --eval requires an argument.
>
> The argument is what comes after --eval in the emacsclient command line.

emacsclient should pass --eval through to the alternate editor.

Andreas.

-- 
Andreas Schwab, schwab@linux-m68k.org
GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510  2552 DF73 E780 A9DA AEC1
"And now for something completely different."



^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: master f198a5c: Revert "emacsclient: ignore --eval parameters when starting alternate editor"
  2019-09-16 20:24               ` Andreas Schwab
@ 2019-09-16 20:33                 ` Lars Ingebrigtsen
  0 siblings, 0 replies; 9+ messages in thread
From: Lars Ingebrigtsen @ 2019-09-16 20:33 UTC (permalink / raw)
  To: Andreas Schwab; +Cc: Sven Joachim, emacs-devel

Andreas Schwab <schwab@linux-m68k.org> writes:

> emacsclient should pass --eval through to the alternate editor.

That would be a better design, but that would also be a regression.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no



^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2019-09-16 20:33 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <20190915121331.17901.64590@vcs0.savannah.gnu.org>
     [not found] ` <20190915121332.E09E720BC2@vcs0.savannah.gnu.org>
2019-09-15 16:17   ` master f198a5c: Revert "emacsclient: ignore --eval parameters when starting alternate editor" Sven Joachim
2019-09-16 12:32     ` Lars Ingebrigtsen
2019-09-16 14:18       ` Sven Joachim
2019-09-16 15:36         ` Benjamin Riefenstahl
2019-09-16 15:41         ` Lars Ingebrigtsen
2019-09-16 19:18           ` Andreas Schwab
2019-09-16 19:24             ` Lars Ingebrigtsen
2019-09-16 20:24               ` Andreas Schwab
2019-09-16 20:33                 ` Lars Ingebrigtsen

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