GNU bug report logs - #40731
[PATCH] Make emacsclient fail if --eval is used and no Emacs server connection established

Previous Next

Package: emacs;

Reported by: Ilya Ostapyshyn <ilya.ostapyshyn <at> gmail.com>

Date: Mon, 20 Apr 2020 14:55:01 UTC

Severity: normal

Tags: patch, wontfix

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 40731 in the body.
You can then email your comments to 40731 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#40731; Package emacs. (Mon, 20 Apr 2020 14:55:01 GMT) Full text and rfc822 format available.

Acknowledgement sent to Ilya Ostapyshyn <ilya.ostapyshyn <at> gmail.com>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Mon, 20 Apr 2020 14:55:01 GMT) Full text and rfc822 format available.

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

From: Ilya Ostapyshyn <ilya.ostapyshyn <at> gmail.com>
To: bug-gnu-emacs <at> gnu.org
Subject: [PATCH] Make emacsclient fail if --eval is used and no Emacs server
 connection established
Date: Mon, 20 Apr 2020 15:22:43 +0300
[Message part 1 (text/plain, inline)]
Hello,

This patch makes emacsclient quit with an error message if both --eval
and --alternate-editor were specified.

According to the current implementation, the emacsclient runs
alternate-editor, treating the eval expression as the filename, which
is IMO not very intuitive.

Kind regards,
Illia.

[0001-exit-if-no-connection-and-eval-used.patch (text/x-patch, attachment)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#40731; Package emacs. (Wed, 22 Apr 2020 09:52:02 GMT) Full text and rfc822 format available.

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

From: Ilya Ostapyshyn <ilya.ostapyshyn <at> gmail.com>
To: 40731 <at> debbugs.gnu.org
Subject: bug#40731 Followup
Date: Wed, 22 Apr 2020 10:23:43 +0300
I have found a commit ~6fe661342a24edcaea255c3ba9a37613031554da~ which
addressed the same issue but in a different way.

However, the commit was reverted
(hash ~f198a5c5144fdded1400df6e8454e4b1b912c7de~) with the following message:

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

I beg to differ. In fact, the --eval is not an optarg parameter, instead
it tells emacsclient to treat the whole FILE argument as lisp
expressions for evaluation.

Therefore, invoking
  emacsclient -a emacs -e '(emacs-version)'
just opens a file named "(emacs-version)" in a new instance of Emacs if
server is not running.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#40731; Package emacs. (Sat, 08 Aug 2020 12:40:02 GMT) Full text and rfc822 format available.

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

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Ilya Ostapyshyn <ilya.ostapyshyn <at> gmail.com>
Cc: 40731 <at> debbugs.gnu.org
Subject: Re: bug#40731: Followup
Date: Sat, 08 Aug 2020 14:39:33 +0200
Ilya Ostapyshyn <ilya.ostapyshyn <at> gmail.com> writes:

> I have found a commit ~6fe661342a24edcaea255c3ba9a37613031554da~ which
> addressed the same issue but in a different way.
>
> However, the commit was reverted
> (hash ~f198a5c5144fdded1400df6e8454e4b1b912c7de~) with the following message:
>
>> 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.
>
> I beg to differ. In fact, the --eval is not an optarg parameter, instead
> it tells emacsclient to treat the whole FILE argument as lisp
> expressions for evaluation.
>
> Therefore, invoking
>   emacsclient -a emacs -e '(emacs-version)'
> just opens a file named "(emacs-version)" in a new instance of Emacs if
> server is not running.

Hm.  Unfortunately the reverting commit doesn't refer to the test case
that somebody had for this, but there was a complaint after the change
that the change ruined their work flow.

There was a test case for this, but it wasn't included in the reversion
commit, and I don't recall what it was now...

emacsclient -a "emacs -e" -e '(emacs-version)'

or something?

In any case, we can't regress this work flow, so we can't fix this
somewhat illogical way emacsclient works, so I'm closing this bug report.

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




Added tag(s) wontfix. Request was from Lars Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Sat, 08 Aug 2020 12:40:02 GMT) Full text and rfc822 format available.

bug closed, send any further explanations to 40731 <at> debbugs.gnu.org and Ilya Ostapyshyn <ilya.ostapyshyn <at> gmail.com> Request was from Lars Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Sat, 08 Aug 2020 12:40: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. (Sun, 06 Sep 2020 11:24:05 GMT) Full text and rfc822 format available.

This bug report was last modified 3 years and 232 days ago.

Previous Next


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