unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Vladimir Lomov <lomov.vl@yandex.ru>
To: Dmitry Alexandrov <dag@gnui.org>
Cc: 41719@debbugs.gnu.org
Subject: bug#41719: 28.0.50; [FR] emacsclient should provide '--name' option as emacs
Date: Sat, 6 Jun 2020 22:52:21 +0800	[thread overview]
Message-ID: <20200606145221.GC846@smoon.bkoty.ru> (raw)
In-Reply-To: <img41idl.dag@gnui.org>

[-- Attachment #1: Type: text/plain, Size: 3350 bytes --]

Hello,
** Dmitry Alexandrov <dag@gnui.org> [2020-06-06 15:36:06 +0300]:

> Vladimir Lomov <lomov.vl@yandex.ru> wrote:

>> I tried to use '-F' option of 'emacsclient' but I didn't get desire result,
>> WM_CLASS isn't changed, only WM_ICON_NAME.

> Works for me (Emacs 28, no toolkit).

Do you able to change WM_CLASS?

>> It is possible that I do things wrong,
>>
>>   $ emacsclient -s /run/user/1000/emacs-default -F '((name . "default") (title . "USER@HOST"))'

> FWIW, this command does not necessary create a _new_ frame.  Use ‘-c’,
> ‘--create-frame’ to force it.

My fault, I didn't added it in example but of course use it (without it
emacsclient doesn't create window).

Let me give more details what I did and what I get.

1. Run Emacs without parameters

$ emacs

$ xprop | grep 'WM_CLASS\|WM_NAME\|WM_ICON_NAME'

WM_CLASS(STRING) = "emacs", "Emacs"
WM_ICON_NAME(STRING) = "emacs@smoon.bkoty.ru"
_NET_WM_ICON_NAME(UTF8_STRING) = "emacs@smoon.bkoty.ru"
WM_NAME(STRING) = "emacs@smoon.bkoty.ru"
_NET_WM_NAME(UTF8_STRING) = "emacs@smoon.bkoty.ru"

2. Run Emacs with parameters

$ emacs --name default --title USER@HOST

$ xprop | grep 'WM_CLASS\|WM_NAME\|WM_ICON_NAME'

WM_CLASS(STRING) = "default", "Emacs"
WM_ICON_NAME(STRING) = "default"
_NET_WM_ICON_NAME(UTF8_STRING) = "USER@HOST"
WM_NAME(STRING) = "USER@HOST"
_NET_WM_NAME(UTF8_STRING) = "USER@HOST"

3. Run emacsclient (the socket is created by systemd, emacs started by
service)

$ emacsclient -s /run/user/1000/emacs-default -c

$ xprop | grep 'WM_CLASS\|WM_NAME\|WM_ICON_NAME'

WM_CLASS(STRING) = "emacs", "Emacs"
WM_ICON_NAME(STRING) = "*scratch*"
_NET_WM_ICON_NAME(UTF8_STRING) = "*scratch*"
WM_NAME(STRING) = "*scratch*"
_NET_WM_NAME(UTF8_STRING) = "*scratch*"

But this time I already have openned Emacs windown. If I close it (C-x 5 0)
and run emacsclient again I get

WM_CLASS(STRING) = "emacs", "Emacs"
WM_ICON_NAME(STRING) = "emacs@smoon.bkoty.ru"
_NET_WM_ICON_NAME(UTF8_STRING) = "emacs@smoon.bkoty.ru"
WM_NAME(STRING) = "emacs@smoon.bkoty.ru"
_NET_WM_NAME(UTF8_STRING) = "emacs@smoon.bkoty.ru"

4. Run emacsclient with -F

$ emacsclient -s /run/user/1000/emacs-default -c -F '((name . "default") (title . "USER@HOST"))

$ xprop | grep 'WM_CLASS\|WM_NAME\|WM_ICON_NAME'

WM_CLASS(STRING) = "emacs", "Emacs"
WM_ICON_NAME(STRING) = "default"
_NET_WM_ICON_NAME(UTF8_STRING) = "USER@HOST"
WM_NAME(STRING) = "USER@HOST"
_NET_WM_NAME(UTF8_STRING) = "USER@HOST"

This time I don't have openned Emacs window. If I run the same command when
Emacs already has window (created by emacsclient) then I get

WM_CLASS(STRING) = "emacs", "Emacs"
WM_ICON_NAME(STRING) = "default"
_NET_WM_ICON_NAME(UTF8_STRING) = "USER@HOST"
WM_NAME(STRING) = "USER@HOST"
_NET_WM_NAME(UTF8_STRING) = "USER@HOST"

As one may see only emacs allows to set 'instance' (WM_CLASS, first string)
with --name option.

>> Even if it is possible to change the 'instance' of Emacs window created by
>> 'emacsclient' using the '-F' option it would be nice to have more simple
>> way to achieve this.

> It would be nice to give some examples, how it can be useful.

---
WBR, Vladimir Lomov

-- 
If you marry a man who cheats on his wife, you'll be married to a man who
cheats on his wife.
		-- Ann Landers

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]

  reply	other threads:[~2020-06-06 14:52 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-05  3:09 bug#41719: 28.0.50; [FR] emacsclient should provide '--name' option as emacs Vladimir Lomov
2020-06-05 11:14 ` Basil L. Contovounesios
2020-06-05 16:53   ` Vladimir Lomov
2020-06-06 12:36 ` Dmitry Alexandrov
2020-06-06 14:52   ` Vladimir Lomov [this message]
2020-06-06 17:08     ` Dmitry Alexandrov
2020-06-06 18:24       ` Dmitry Alexandrov
2020-06-07 14:26         ` bug#41719: 28.0.50; emacsclient -c -F '((name . "NAME"))' is not respected --with-x-toolkit=gtk328.0.50 (Was: [FR] emacsclient should provide '--name' option as emacs) Vladimir Lomov
2020-06-07 16:15           ` bug#41719: 28.0.50; emacsclient -c -F '((name . "NAME"))' is not respected --with-x-toolkit=gtk3 Dmitry Alexandrov
2020-06-09  7:12             ` Vladimir Lomov
2022-02-10  7:17         ` Lars Ingebrigtsen
2022-03-12 22:45           ` Lars Ingebrigtsen
2022-06-11 13:00 ` bug#41719: 28.0.50; emacsclient -c -F '((name . "NAME"))' is Colin Horne
2022-06-11 13:46   ` Colin Horne
2022-06-12  5:10 ` bug#41719: 28.0.50; [FR] emacsclient should provide '--name' option as emacs Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-06-12  6:32   ` Eli Zaretskii
2022-06-12  6:40     ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-06-12  7:03       ` Eli Zaretskii
2022-06-12  7:06         ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-06-12  7:26           ` Eli Zaretskii
2022-06-12  7:52         ` Visuwesh
2022-06-12  8:00           ` Eli Zaretskii
2022-06-12  8:47             ` Visuwesh
2022-06-12  8:02           ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-06-12  8:20             ` Andreas Schwab
2022-06-12  8:49             ` Visuwesh
2022-06-12  8:27           ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-06-12  8:54             ` Visuwesh
2022-06-12  9:11               ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-06-14  3:04         ` Vladimir Lomov
2022-06-14  4:13           ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-06-14  6:00             ` Vladimir Lomov
2022-06-14  6:19               ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-06-14 11:23           ` Eli Zaretskii

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=20200606145221.GC846@smoon.bkoty.ru \
    --to=lomov.vl@yandex.ru \
    --cc=41719@debbugs.gnu.org \
    --cc=dag@gnui.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).