all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: Jonas Bernoulli <jonas@bernoul.li>
Cc: michael.albinus@gmx.de, 71971@debbugs.gnu.org
Subject: bug#71971: 31.0.50; Add user option server-window-alist
Date: Mon, 08 Jul 2024 20:56:47 +0300	[thread overview]
Message-ID: <86y16bzs0w.fsf@gnu.org> (raw)
In-Reply-To: <871q43vl1f.fsf@bernoul.li> (message from Jonas Bernoulli on Mon,  08 Jul 2024 19:41:16 +0200)

> From: Jonas Bernoulli <jonas@bernoul.li>
> Cc: michael.albinus@gmx.de, 71971@debbugs.gnu.org
> Date: Mon, 08 Jul 2024 19:41:16 +0200
> 
> Eli Zaretskii <eliz@gnu.org> writes:
> 
> >> From: Jonas Bernoulli <jonas@bernoul.li>
> >> Cc: 71971@debbugs.gnu.org
> >> Date: Sat, 06 Jul 2024 16:16:21 +0200
> >> 
> >> So in summary, it is possible for the same person to want the behavior
> >> to be different in different situations.  The fact that "committing from
> >> Emacs using Magit" involves the use of emacsclient, just like "quickly
> >> edit a file from the terminal" does, is an implementation detail, and
> >> should not make it necessary for the user to decide which use-case
> >> should be optimized to their liking, at the cost of undesirable behavior
> >> in the other case.
> >
> > That sounds to me like the value of $EDITOR should be "emacsclient -c"
> > whereas the value of $GIT_EDITOR should be just "emacsclient"?
> 
> Who would set those variables to those values?

The user, of course.  But see below.

> Where?

In the system's or shell's init files, depending on the system and the
user's needs.

> I am beginning to think that at least for Magit's needs the new
> --create-frame is sufficient.  It could just call
> 
>   EDITOR="emacsclient -c" git commit
> 
> Unfortunately that's a fairly new argument

"New"? AFAICT, it exists since Emacs 23.1, i.e. for the last 15 years.

> so with-editor will have to keep providing an alternative.  But when
> it comes to the question of whether server-window-alist should be
> added to future Emacs releases, that isn't a concern.
> 
> I understand your hesitancy to add such a variable.  I am not sure it
> is necessary anymore either.

Agreed.

> That being said, maybe adding switch-to-buffer-new-frame wouldn't be
> such a bad idea.

I'm quite sure you can have that already by using a suitable
display-buffer-alist.  All you want is to force
switch-to-buffer-other-frame always create a new frame.

> > And what will
> > they use for the REGEXP part? are they supposed to know by heart the
> > names of temporary files Git and other VCSes use for editing commit
> > messages?
> 
> Well no, Magit takes care of that, and so could VC.

Takes care how? what do you use for REGEXP?

> > One possibility would be to add a new protocol command telling
> > server.el how to create/reuse frames, and then tell users to set
> > $EDITOR and similar variables to invoke that command via the
> > emacsclient command-line arguments.  Other ideas are welcome.
> 
> I'm not sure what you mean by "protocol".  More arguments?

No, the protocol between emacsclient and the server.  So that the
client could tell the server how to create/reuse frames in a more
flexible manner than what we have now.

> You mention environment variables.  If I remember correctly, I did
> experiment with that, but ran into the problem that while it was
> possible to pass along additional environment variables when using
> "emacsclient --tty", the same was not possible when using "emacsclient
> --create-frame".

I meant to use environment variables only if the preference to reuse
an existing frame when editing commit log messages for Git is a
globally fixed preference for the user.  In any other case,
environment variables are not a good means, because they have global
effect and are by default inherited by child processes.





  reply	other threads:[~2024-07-08 17:56 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-07-06 11:06 bug#71971: 31.0.50; Add user option server-window-alist Michael Albinus via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-07-06 11:22 ` Eli Zaretskii
2024-07-06 11:58   ` Michael Albinus via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-07-06 14:16   ` Jonas Bernoulli via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-07-06 14:47     ` Eli Zaretskii
2024-07-08 17:41       ` Jonas Bernoulli via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-07-08 17:56         ` Eli Zaretskii [this message]
2024-07-09 19:05           ` Jonas Bernoulli via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-07-10 11:35             ` Eli Zaretskii
2024-07-10 16:32               ` Jonas Bernoulli via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-07-10 18:02                 ` Michael Albinus via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-07-19 16:45                   ` Michael Albinus via Bug reports for GNU Emacs, the Swiss army knife of text editors

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

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

  git send-email \
    --in-reply-to=86y16bzs0w.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=71971@debbugs.gnu.org \
    --cc=jonas@bernoul.li \
    --cc=michael.albinus@gmx.de \
    /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 external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.