#883689 emacsclient -a incorrectly applies -nw when an emacs frame didn't exist

Package:
emacs25
Source:
emacs
Submitter:
José Luis González
Date:
2025-07-28 19:39:08 UTC
Severity:
wishlist
Tags:
#883689#5
Date:
2017-12-06 14:21:36 UTC
From:
To:
emacsclient -a always starts a daemon in console mode and opens the
file in console when no emacs server exists, even when -nw isn't
specified, which is incorrect when DISPLAY is set.

I would expect an X frame created on this case.

#883689#10
Date:
2017-12-21 02:49:52 UTC
From:
To:
I think your expectation is incorrect, and that you should add the -c argument to get a new frame.
#883689#13
Date:
2017-12-21 02:49:52 UTC
From:
To:
I think your expectation is incorrect, and that you should add the -c argument to get a new frame.
#883689#18
Date:
2018-11-11 10:37:37 UTC
From:
To:
No, that is not what I want. If I request a new frame, a new frame is
opened even when another was already opened. I just want the existing X
frame to be used, if it exists.

Just to be clear, this is what I have in ALTERNATE_EDITOR:

ALTERNATE_EDITOR=""

According to the documentation this should start an emacs --daemon if
the emacs server is not running, which is exactly what I want. The
problem is, when it does the frame is opened in the text terminal, not
in X, even when DISPLAY is set and emacs-x is available. This is, in my
opinion wrong. If it is the desired effect, the documentation should be
cleared up and a new option enabled to do what I want (which I think is
pretty reasonable). If not, it should be fixed.

Please, let me know if there is another way to do it. In any case, if
there is, it's not clear in the documentation.

P.S. Sorry for the long delay. I read your email last year and
moved it to pending state, but completely forgot about it (has been an
hectic year for me this one).

#883689#31
Date:
2025-03-20 15:36:17 UTC
From:
To:
I think https://debbugs.gnu.org/51374 "New options for emacsclient" is a
better variant. This patch added to v29.1

I have not noticed any effect from https://debbugs.gnu.org/11033
"emacsclient: create a new frame only if one doesn't exist". In bookworm
emacs-28.2 has this patch, but

emacsclient --display="$DISPLAY" -a "" /tmp/test.txt

opens the file in terminal while every invocation with -c creates a new
frame. (I added explicit --display to be on the safe side. It may matter
if emacs daemon has no GUI frames.)