GNU bug report logs - #37257
failure of emacsclient ... --alternate-editor="emacs --eval"

Previous Next

Package: emacs;

Reported by: Campbell Barton <ideasman42 <at> gmail.com>

Date: Sun, 1 Sep 2019 16:23:02 UTC

Severity: normal

Tags: fixed

Found in version 27.0.50

Fixed in version 27.1

Done: Lars Ingebrigtsen <larsi <at> gnus.org>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 37257 in the body.
You can then email your comments to 37257 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#37257; Package emacs. (Sun, 01 Sep 2019 16:23:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Campbell Barton <ideasman42 <at> gmail.com>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Sun, 01 Sep 2019 16:23:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Campbell Barton <ideasman42 <at> gmail.com>
To: bug-gnu-emacs <at> gnu.org
Subject: 27.0.50;
Date: Mon, 2 Sep 2019 02:21:51 +1000
Running emacsclient with alternate editor no longer works as it did.

This command for example:

emacsclient --eval '(progn (find-file "some_file.txt") (goto-line 1)
(back-to-indentation) (recenter) "")' --no-wait
--alternate-editor="emacs --eval"

Works in 26.3 - running the command in an existing emacs instance.

In 27.0.50 it reports that "emacs --eval" fails.

The issue can be traced back to this change:
6fe661342a24edcaea255c3ba9a37613031554da

In GNU Emacs 27.0.50 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.10)
 of 2019-09-02 built on austpc
Repository revision: a7d47e64aaf438feaa8cbe4d40acb7bae0eab059
Repository branch: master
Windowing system distributor 'The X.Org Foundation', version 11.0.12005000
System Description: Arch Linux

Recent messages:
~/.emacs.d/local
Loading /home/ideasman42/.emacs.d/custom.el (source)...done
Loading server...done

Configured using:
 'configure --prefix=/opt/emacs --with-sound=no --disable-acl
 --with-file-notification=no --without-xpm --without-jpeg --without-tiff
 --without-gif --without-png --without-rsvg --without-lcms2
 --without-libsystemd --without-gsettings --without-harfbuzz
 --without-m17n-flt --without-libotf --without-gpm --without-dbus
 --without-gsettings --without-gconf --without-selinux --without-gnutls
 --without-zlib --without-makeinfo --without-libgmp --with-zlib
 --with-compress-install --with-threads --with-x
 --without-toolkit-scroll-bars --with-x-toolkit=gtk3 --with-xft
 --with-modules 'CFLAGS=-O2 -mtune=native -march=native -pipe
 -fomit-frame-pointer''

Configured features:
GLIB LIBXML2 FREETYPE XFT ZLIB GTK3 X11 XDBE XIM MODULES THREADS JSON
PDUMPER

Important settings:
  value of $LC_CTYPE: en_US.UTF-8
  value of $LANG: C
  locale-coding-system: utf-8-unix

Major mode: Lisp Interaction

Minor modes in effect:
  display-fill-column-indicator-mode: t
  wcheck-mode: t
  visual-indentation-mode: t
  highlight-numbers-mode: t
  evil-leader-mode: t
  global-evil-surround-mode: t
  evil-surround-mode: t
  shell-dirtrack-mode: t
  evil-mode: t
  evil-local-mode: t
  default-text-scale-mode: t
  global-git-gutter-mode: t
  show-paren-mode: t
  savehist-mode: t
  override-global-mode: t
  tooltip-mode: t
  eldoc-mode: t
  electric-indent-mode: t
  mouse-wheel-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t
  column-number-mode: t
  line-number-mode: t
  transient-mark-mode: t

Load-path shadows:
None found.

Features:
(shadow sort mail-extr emacsbug message rmc puny format-spec rfc822 mml
mml-sec epa derived epg epg-config gnus-util rmail rmail-loaddefs
text-property-search time-date mm-decode mm-bodies mm-encode mail-parse
rfc2231 mailabbrev gmm-utils mailheader sendmail rfc2047 rfc2045
ietf-drums mm-util mail-prsvr mail-utils counsel xdg xref project dired
dired-loaddefs compile swiper ivy delsel colir color ivy-overlay
noutline outline display-fill-column-indicator wcheck-mode whitespace
visual-indentation-mode highlight-numbers parent-mode server pcase
evil-leader evil-surround evil evil-keybindings evil-integration
undo-tree diff evil-maps evil-commands reveal flyspell ispell evil-jumps
evil-command-window evil-types evil-search evil-ex shell pcomplete
comint ansi-color evil-macros evil-repeat evil-states evil-core
evil-common windmove thingatpt rect evil-digraphs evil-vars ring edmacro
kmacro default-text-scale git-gutter advice paren savehist cl-extra
help-mode use-package use-package-ensure use-package-delight
use-package-diminish use-package-bind-key bind-key easy-mmode
use-package-core finder-inf info package easymenu browse-url
url-handlers url-parse auth-source cl-seq eieio eieio-core cl-macs
eieio-loaddefs password-cache json subr-x map url-vars seq byte-opt gv
bytecomp byte-compile cconv cl-loaddefs cl-lib tooltip eldoc electric
uniquify ediff-hook vc-hooks lisp-float-type mwheel term/x-win x-win
term/common-win x-dnd tool-bar dnd fontset image regexp-opt fringe
tabulated-list replace newcomment text-mode elisp-mode lisp-mode
prog-mode register page menu-bar rfn-eshadow isearch timer select
scroll-bar mouse jit-lock font-lock syntax facemenu font-core
term/tty-colors frame cl-generic cham georgian utf-8-lang misc-lang
vietnamese tibetan thai tai-viet lao korean japanese eucjp-ms cp51932
hebrew greek romanian slovak czech european ethiopic indian cyrillic
chinese composite charscript charprop case-table epa-hook jka-cmpr-hook
help simple abbrev obarray minibuffer cl-preloaded nadvice loaddefs
button faces cus-face macroexp files text-properties overlay sha1 md5
base64 format env code-pages mule custom widget hashtable-print-readable
backquote threads dynamic-setting font-render-setting move-toolbar gtk
x-toolkit x multi-tty make-network-process emacs)

Memory information:
((conses 16 267406 41968)
 (symbols 48 20005 1)
 (strings 32 83891 4273)
 (string-bytes 1 2328543)
 (vectors 16 28486)
 (vector-slots 8 348941 13344)
 (floats 8 205 265)
 (intervals 56 406 0)
 (buffers 992 12))




Changed bug title to 'failure of emacsclient ... --alternate-editor="emacs --eval"' from '27.0.50;' Request was from Paul Eggert <eggert <at> cs.ucla.edu> to control <at> debbugs.gnu.org. (Sun, 01 Sep 2019 17:06:01 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#37257; Package emacs. (Thu, 05 Sep 2019 21:53:02 GMT) Full text and rfc822 format available.

Message #10 received at 37257 <at> debbugs.gnu.org (full text, mbox):

From: Paul Eggert <eggert <at> cs.ucla.edu>
To: Lars Ingebrigtsen <larsi <at> gnus.org>
Cc: Campbell Barton <ideasman42 <at> gmail.com>, 37257 <at> debbugs.gnu.org
Subject: Re: Bug#37257: failure of emacsclient ... --alternate-editor="emacs
 --eval"
Date: Thu, 5 Sep 2019 14:52:51 -0700
Lars, the commit in question is the following, so could you please look 
into Bug#37257? Thanks.

commit 6fe661342a24edcaea255c3ba9a37613031554da
Author: Lars Ingebrigtsen <larsi <at> gnus.org>
Date:   Thu Jun 27 20:59:50 2019 +0200

    emacsclient: ignore --eval parameters when starting alternate editor

    * lib-src/emacsclient.c (fail): If the user said --eval, don't
    pass those arguments to the alternate editor as file names.
    Suggested by a patch from Scott Turner (bug#11474).




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#37257; Package emacs. (Sat, 14 Sep 2019 12:16:01 GMT) Full text and rfc822 format available.

Message #13 received at 37257 <at> debbugs.gnu.org (full text, mbox):

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Paul Eggert <eggert <at> cs.ucla.edu>
Cc: Campbell Barton <ideasman42 <at> gmail.com>, 37257 <at> debbugs.gnu.org
Subject: Re: bug#37257: failure of emacsclient ... --alternate-editor="emacs
 --eval"
Date: Sat, 14 Sep 2019 14:15:37 +0200
Paul Eggert <eggert <at> cs.ucla.edu> writes:

> Lars, the commit in question is the following, so could you please
> look into Bug#37257? Thanks.
>
> commit 6fe661342a24edcaea255c3ba9a37613031554da
> Author: Lars Ingebrigtsen <larsi <at> gnus.org>
> Date:   Thu Jun 27 20:59:50 2019 +0200
>
>     emacsclient: ignore --eval parameters when starting alternate editor
>
>     * lib-src/emacsclient.c (fail): If the user said --eval, don't
>     pass those arguments to the alternate editor as file names.
>     Suggested by a patch from Scott Turner (bug#11474).

The test case here is:

emacsclient --eval '(progn (find-file "some_file.txt") (goto-line 1)
(back-to-indentation) (recenter) "")' --no-wait
--alternate-editor="emacs --eval"

So the alternate editor is Emacs itself.

Hm.  I guess just reverting the change in question would fix this
regressions, but this is a rather strange use case.  What's the point of
specifying Emacs as the alternate editor?

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




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#37257; Package emacs. (Sat, 14 Sep 2019 18:02:02 GMT) Full text and rfc822 format available.

Message #16 received at 37257 <at> debbugs.gnu.org (full text, mbox):

From: Paul Eggert <eggert <at> cs.ucla.edu>
To: Lars Ingebrigtsen <larsi <at> gnus.org>
Cc: Campbell Barton <ideasman42 <at> gmail.com>, 37257 <at> debbugs.gnu.org
Subject: Re: bug#37257: failure of emacsclient ... --alternate-editor="emacs
 --eval"
Date: Sat, 14 Sep 2019 11:01:16 -0700
On 9/14/19 5:15 AM, Lars Ingebrigtsen wrote:
> I guess just reverting the change in question would fix this
> regressions, but this is a rather strange use case.  What's the point of
> specifying Emacs as the alternate editor?

Presumably, because someone mistakenly started emacsclient even though no Emacs 
server is running.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#37257; Package emacs. (Sat, 14 Sep 2019 20:35:01 GMT) Full text and rfc822 format available.

Message #19 received at 37257 <at> debbugs.gnu.org (full text, mbox):

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Paul Eggert <eggert <at> cs.ucla.edu>
Cc: Campbell Barton <ideasman42 <at> gmail.com>, 37257 <at> debbugs.gnu.org
Subject: Re: bug#37257: failure of emacsclient ... --alternate-editor="emacs
 --eval"
Date: Sat, 14 Sep 2019 22:34:33 +0200
Paul Eggert <eggert <at> cs.ucla.edu> writes:

> On 9/14/19 5:15 AM, Lars Ingebrigtsen wrote:
>> I guess just reverting the change in question would fix this
>> regressions, but this is a rather strange use case.  What's the point of
>> specifying Emacs as the alternate editor?
>
> Presumably, because someone mistakenly started emacsclient even though
> no Emacs server is running.

Oh, right.  Yes, that seems like a useful use case.

Hm, I guess we should just revert the patch -- I don't see any obvious
way to determine whether --alternate-editor is Emacs (which will then
understand the rest of the parameters) or something else (which will
then not).  So leaving it the way it was is best.

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




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#37257; Package emacs. (Sat, 14 Sep 2019 20:46:02 GMT) Full text and rfc822 format available.

Message #22 received at 37257 <at> debbugs.gnu.org (full text, mbox):

From: Cambell Barton <ideasman42 <at> gmail.com>
Cc: 37257 <at> debbugs.gnu.org
Subject: Re: bug#37257: failure of emacsclient ... --alternate-editor="emacs
 --eval"
Date: Sun, 15 Sep 2019 06:45:46 +1000
[Message part 1 (text/plain, inline)]
On 2019-09-15 06:34, Lars Ingebrigtsen wrote:
> , I guess we should just revert the patch -- I don't see any obvious
> way to determine whether --alternate-editor is Emacs (which will then
> understand the rest of the parameters) or something else (which will
> then not).  So leaving it the way it was is best.

I'm not sure what the best solution is here, it's just I had something 
that worked and now I can't get emacs27 to work usefully in the same way.

It should be possible to run the code in the client or a new instance, 
but I didn't manage to get this working.

CODE='(progn (message "HELLO WOLD"))'
emacsclient --eval "$CODE" --alternate-editor  "emacs --eval '$CODE'"

Instead of starting a new emacs and printing HELLO WOLD,
it reports:

emacsclient: error executing alternate editor "emacs --eval '(progn 
(message "HELLO WORLD"))'"
[emacsclient_or_emacs_with_file.sh (application/x-shellscript, attachment)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#37257; Package emacs. (Sun, 15 Sep 2019 12:14:01 GMT) Full text and rfc822 format available.

Message #25 received at 37257 <at> debbugs.gnu.org (full text, mbox):

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Cambell Barton <ideasman42 <at> gmail.com>
Cc: 37257 <at> debbugs.gnu.org
Subject: Re: bug#37257: failure of emacsclient ... --alternate-editor="emacs
 --eval"
Date: Sun, 15 Sep 2019 14:13:37 +0200
Cambell Barton <ideasman42 <at> gmail.com> writes:

> I'm not sure what the best solution is here, it's just I had something
> that worked and now I can't get emacs27 to work usefully in the same
> way.

Yes, we'll fix it so that the regression you're seeing goes away, but
we're just discussing whether it's possible to do so without reverting
the change that fixed another bug.

I think it's unlikely that it's possible, so I've reverted the change,
which should make things work again for you.  Can you check?

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




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#37257; Package emacs. (Sun, 15 Sep 2019 17:53:02 GMT) Full text and rfc822 format available.

Message #28 received at 37257 <at> debbugs.gnu.org (full text, mbox):

From: Cambell Barton <ideasman42 <at> gmail.com>
Cc: 37257 <at> debbugs.gnu.org
Subject: Re: bug#37257: failure of emacsclient ... --alternate-editor="emacs
 --eval"
Date: Mon, 16 Sep 2019 03:52:30 +1000
On 2019-09-15 22:13, Lars Ingebrigtsen wrote:
> Cambell Barton <ideasman42 <at> gmail.com> writes:
> 
>> I'm not sure what the best solution is here, it's just I had something
>> that worked and now I can't get emacs27 to work usefully in the same
>> way.
> 
> Yes, we'll fix it so that the regression you're seeing goes away, but
> we're just discussing whether it's possible to do so without reverting
> the change that fixed another bug.
> 
> I think it's unlikely that it's possible, so I've reverted the change,
> which should make things work again for you.  Can you check?
> Checked 6d3cb263f941545c09acb7fb86b8336ad130aa8e, this is working now.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#37257; Package emacs. (Mon, 16 Sep 2019 12:34:01 GMT) Full text and rfc822 format available.

Message #31 received at 37257 <at> debbugs.gnu.org (full text, mbox):

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Cambell Barton <ideasman42 <at> gmail.com>
Cc: 37257 <at> debbugs.gnu.org
Subject: Re: bug#37257: failure of emacsclient ... --alternate-editor="emacs
 --eval"
Date: Mon, 16 Sep 2019 14:33:51 +0200
Cambell Barton <ideasman42 <at> gmail.com> writes:

>> Checked 6d3cb263f941545c09acb7fb86b8336ad130aa8e, this is working now.

Thanks for checking; closing this bug report.

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




Added tag(s) fixed. Request was from Lars Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Mon, 16 Sep 2019 12:35:02 GMT) Full text and rfc822 format available.

bug marked as fixed in version 27.1, send any further explanations to 37257 <at> debbugs.gnu.org and Campbell Barton <ideasman42 <at> gmail.com> Request was from Lars Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Mon, 16 Sep 2019 12:35:02 GMT) Full text and rfc822 format available.

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Tue, 15 Oct 2019 11:24:06 GMT) Full text and rfc822 format available.

This bug report was last modified 4 years and 185 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.