unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Sven Joachim <svenjoac@gmx.de>
To: Lars Ingebrigtsen <larsi@gnus.org>, emacs-devel@gnu.org
Subject: Re: master f198a5c: Revert "emacsclient: ignore --eval parameters when starting alternate editor"
Date: Sun, 15 Sep 2019 18:17:31 +0200	[thread overview]
Message-ID: <87sgoxlejo.fsf@turtle.gmx.de> (raw)
In-Reply-To: <20190915121332.E09E720BC2@vcs0.savannah.gnu.org> (Lars Ingebrigtsen's message of "Sun, 15 Sep 2019 08:13:32 -0400 (EDT)")

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



       reply	other threads:[~2019-09-15 16:17 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20190915121331.17901.64590@vcs0.savannah.gnu.org>
     [not found] ` <20190915121332.E09E720BC2@vcs0.savannah.gnu.org>
2019-09-15 16:17   ` Sven Joachim [this message]
2019-09-16 12:32     ` master f198a5c: Revert "emacsclient: ignore --eval parameters when starting alternate editor" 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

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

  List information: https://www.gnu.org/software/emacs/

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

  git send-email \
    --in-reply-to=87sgoxlejo.fsf@turtle.gmx.de \
    --to=svenjoac@gmx.de \
    --cc=emacs-devel@gnu.org \
    --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 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).