emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: master f198a5c: Revert "emacsclient: ignore --eval parameters when s


From: Sven Joachim
Subject: Re: master f198a5c: Revert "emacsclient: ignore --eval parameters when starting alternate editor"
Date: Sun, 15 Sep 2019 18:17:31 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux)

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

> branch: master
> commit f198a5c5144fdded1400df6e8454e4b1b912c7de
> Author: Lars Ingebrigtsen <address@hidden>
> Commit: Lars Ingebrigtsen <address@hidden>
>
>     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
> address@hidden
> https://lists.gnu.org/mailman/listinfo/emacs-diffs



reply via email to

[Prev in Thread] Current Thread [Next in Thread]