Groups | Search | Server Info | Keyboard shortcuts | Login | Register


Groups > gnu.bash.bug > #16891

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

Newsgroups gnu.bash.bug
Date 2020-12-07 06:45 -0800
References <38b2ab8a0808220053u2f0d73gcfe921b06c2f4b8a@mail.gmail.com> <48AEEC10.5080809@case.edu> <38b2ab8a0808221141i99d5e5agac560aab7944df86@mail.gmail.com> <mailman.17361.1219445628.18990.bug-bash@gnu.org>
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>

Show all headers | 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