Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > gnu.bash.bug > #16891

Re: edit-and-execute-command (C-xC-e) doesn't use FCEDIT env variable

X-Received by 2002:a0c:cd89:: with SMTP id v9mr17181421qvm.37.1607352336766; Mon, 07 Dec 2020 06:45:36 -0800 (PST)
X-Received by 2002:a9d:6c44:: with SMTP id g4mr12830462otq.246.1607352336402; Mon, 07 Dec 2020 06:45:36 -0800 (PST)
Path csiph.com!xmission!news.snarked.org!border2.nntp.dca1.giganews.com!nntp.giganews.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups gnu.bash.bug
Date Mon, 7 Dec 2020 06:45:36 -0800 (PST)
In-Reply-To <mailman.17361.1219445628.18990.bug-bash@gnu.org>
Complaints-To groups-abuse@google.com
Injection-Info google-groups.googlegroups.com; posting-host=93.93.135.55; posting-account=x_ZcUQoAAAC8mc8KrZMyuIZOH5cGoMxh
NNTP-Posting-Host 93.93.135.55
References <38b2ab8a0808220053u2f0d73gcfe921b06c2f4b8a@mail.gmail.com> <48AEEC10.5080809@case.edu> <38b2ab8a0808221141i99d5e5agac560aab7944df86@mail.gmail.com> <mailman.17361.1219445628.18990.bug-bash@gnu.org>
User-Agent G2/1.0
MIME-Version 1.0
Message-ID <c5a60306-4f5b-46bb-8cef-77f0acbe381an@googlegroups.com> (permalink)
Subject Re: edit-and-execute-command (C-xC-e) doesn't use FCEDIT env variable
From Andrew Stribblehill <stribb@gmail.com>
Injection-Date Mon, 07 Dec 2020 14:45:36 +0000
Content-Type text/plain; charset="UTF-8"
Lines 53
Xref csiph.com gnu.bash.bug:16891

Show key headers only | View raw


On Saturday, 23 August 2008 at 00:53:39 UTC+2, Chet Ramey wrote:
> Francis Moreau wrote:
> > On 8/22/08, Chet Ramey <chet....@case.edu> wrote:
> >> Good catch. The command executed is actually
> >>
> >> fc -e "${VISUAL:-${EDITOR:-emacs}}"
> >>
> >> It's the same command for vi and emacs editing modes, though the default
> >> for vi editing mode is `vi' instead of `emacs'. The documentation needs
> >> to be updated, and has for a while, since it's been this way since at
> >> least bash-2.05. Seven years is a long time for this to go unnoticed.
> > 
> > hmm why not fixing the command instead ?
> It's not broken.
> > VISUAL can be used to visualize a file, so can be set to 'less' for
> > example. It shouldn't be used if you wand to edit.
> That isn't the case. In fact, it's exactly the opposite.
> The historic use of VISUAL was for the user to set it to his preferred
> `visual' (screen-oriented) editor (note the similarity to `vi') while
> leaving EDITOR set to, most often, `ed'. It can be set to `less', but
> I'm not sure why you'd want to.
> These days there's no practical difference between the two.
> You might see what `man environ' on your system says. A random Ubuntu
> system I have access to reflects the usage as I've described it.
> > I think what is described in the man is fine. And I wanted to
> > customize FCEDIT to launch emacs in sh-mode, something I can't do with
> > current command setting.
> I'll consider it as an enhancement request for a future version. You
> can, of course, set `VISUAL' to a command that starts emacs in the
> desired mode.
> Chet
> -- 
> ``The lyf so short, the craft so long to lerne.'' - Chaucer
> Chet Ramey, ITS, CWRU ch...@case.edu http://cnswww.cns.cwru.edu/~chet/

[I know, some serious thread necromancy going on here...]

I too am interested in the rationale for bash's C-x C-e command invoking:
  fc -e "${VISUAL:-${EDITOR:-emacs}}"

fc itself has its own ordered list for editors, which is different fromm C-x C-e.
If nothing else, this is a mite confusing. (From "help fc": "Default is FCEDIT, 
then EDITOR, then vi").

How would you feel about either of the following:

A) a patch to remove the "-e" special casing, relying on "fc" to do its job

or

B) a patch that changed the C-x C-e ordered list to:
  $FCEDIT;$VISUAL;$EDITOR;emacs?

It goes without saying that the offer of updated documentation goes with these :)

Back to gnu.bash.bug | Previous | Next | Find similar


Thread

Re: edit-and-execute-command (C-xC-e) doesn't use FCEDIT env variable Andrew Stribblehill <stribb@gmail.com> - 2020-12-07 06:45 -0800

csiph-web