[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Adding with-editor to Emacs?

From: Eli Zaretskii
Subject: Re: Adding with-editor to Emacs?
Date: Sun, 03 Sep 2023 08:00:25 +0300

> From: Stefan Kangas <stefankangas@gmail.com>
> Date: Sat, 2 Sep 2023 12:56:32 -0700
> Cc: emacs-devel@gnu.org, rms@gnu.org
> Jonas Bernoulli <jonas@bernoul.li> writes:
> > Identifying the authors of the broken Emacs installations, contacting
> > them and explaining the issue to them, and then waiting for months/years
> > until the updates trickle down to users, was not an option.  I need a
> > solution now.  And this was such an exhausting experience, I did not
> > have the energy to *also* contact everyone who had messed up their Emacs
> > package.  And it is such a bad memory (it was the first time I got
> > massively attacked for publishing free software), that I am also not
> > volunteering to do that work now.
> Wow, what a ride.  I admire your patience, is all I can say.
> >> Do you mean that emacsclient is installed in a place that just typing
> >> "emacsclient RET" at the shell prompt fails to run it?  If so, that's
> >> a broken installation, and Emacs shouldn't really try to fix that.
> >
> > I think this is a very reasonable for Emacs.  In other words, the best
> > course of action is to just forget the suggestion that with-editor is
> > added to Emacs.  There is no real need and nobody volunteering to do the
> > work anyway.
> It sounds like with-editor for the most part contains workarounds for
> broken Emacs installations?  Is there anything in use-package that does
> not belong to that category, and that you therefore think *should*
> really be fixed in Emacs?

I was thinking about a function that would attempt to produce the best
guess for how to invoke the version of emacsclient which corresponds
to the running Emacs binary.  It is probably only important for
features like Magit, which invoke programs known to need $EDITOR.
That is quite a special case, which I think explains why no one
requested this before.  Still, it could be a useful addition.

To support the "usual" cases, Emacs running installed and uninstalled,
is easy enough.  Supporting program-name transformations specified by
the --program-prefix/suffix and --program-transform-name
configure-time option is a bit trickier, but still reasonably
straightforward, at least for some values of transformations.  The
final fallback should be just "emacsclient", to be found by the
system's program loader using its rules (which could include more than
just searching PATH).

However, to cover all the cases that with-editor supports now, we need
to understand them, because I'm not sure we want to support all of
them, or if we do, do it in the same way as with-editor does.  I
couldn't find that explanation in with-editor.el, and the code there
doesn't always explain itself, in particular where it alludes to macOS
and Debian quirks.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]