[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Nano-devel] [PATCH] options: new --nofilename/-f command line optio
Re: [Nano-devel] [PATCH] options: new --nofilename/-f command line option added
Thu, 19 Apr 2018 20:32:31 +0200
Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.7.0
Op 18-04-18 om 22:31 schreef Piotr H. Dabrowski:
> ^S is not enabled by default in most distributions.
Not yet. But it will be in the upcoming Ubuntu Bionic and Fedora 28,
and anything that is derived from them. And it already is in Arch and
Gentoo and Suse Tumbleweed and some of the BSDs, and their derivatives.
> I haven't even known about it until now,
One should read the NEWS file now and then. :) Or at least the
> ^S is also often captured by terminal emulators for software flow control
Can you give an example of a terminal emulator that captures ^S and ^Q?
I have not encountered any.
> And finally ^S must be bound manually in the nanorc config file, right?
Not any more since 2.9.0 -- it is bound by default.
> It would be nice to have something that works out of the box on every machine
> randomly use.
Anything we add now will take longer to propagate to the random boxes
that you use than ^S, which has already started to spread.
>> But... to add an extra option just for that?
> The reason for all this is using nano as an editor for git:
> "editor = nano -f"
Side note: when using nano to edit commit messages, you may want
to add "+1" at the end of nano's arguments, to put the cursor
always in the top-left corner.
$ env | grep EDITOR
EDITOR=nano -w +1
> But I guess modifying the --tempfile behavior now isn't the best idea?
Correct. But... if enough people say they want the saner behavior,
it can be changed. (We already changed the ^O behavior for --tempfile;
it now differs from how Pico behaves. So, we could change it again.)
>> I think the extra <Enter> is not too much to ask
> In some cases it is. I use multilingual environment. In English binding for
> is Y, in Polish it is T.
Ah. The Polish translator failed to honor the translator hint
for "Yy", "Nn" and "Aa". I've had a patch for that (and other
languages), but was reluctant to override the translators.
> So now I often tend to quickly press: <^X><Y><T><Enter> or <^X><T><Y><Enter>.
> Ending up with "y" or "t" (depending on my current LANG) appended to my
You acquired a bad habit. :) It would have been better to report
a bug to nano: that it should *always* accept "y" and "Y" and "n"
and "N", no matter what the locale. How about the attached patch?
> It would be nice to have a "discard-and-exit" command available for binding as
> well. Alongside current "exit" and "writeout". What do you think?
I would never want a single discard-and-exit command -- too much danger
to hit it accidentally. Discarding a buffer should be a two-step process,
as it is now: ^O ^Q.
(For that to work in the absence of --tempfile, do:
bind ^Q discardbuffer writeout
Or if you want a quick ^O^O to discard a buffer:
bind ^O discardbuffer writeout
And if you really want a single keystroke for discarding a buffer,
you can do additionally: bind M-9 "^O^Q".)
Description: Text Data
Description: OpenPGP digital signature