nano-devel
[Top][All Lists]
Advanced

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

Re: Possible new feature: use 'openfile' to open new buffer


From: Benno Schulenberg
Subject: Re: Possible new feature: use 'openfile' to open new buffer
Date: Tue, 19 May 2020 14:40:25 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.7.0

Op 17-05-2020 om 04:57 schreef Marco Diego Aurélio Mesquita:
> On 5/15/20, Benno Schulenberg <address@hidden> wrote:
>> Yes, it would have been better if M-F (and M-N) were one-time toggles,
>> having effect only during the current invocation of ^R and forgotten
>> the next time -- just like M-B is in the ^W menu.  Maybe they should
>> be made to work that way?
> 
> This goes against the way I use nano. It is very common for me to
> start nano with some files loaded and, after a few edits, open other
> files. Having to re-set the open on new buffer flag every time I want
> to load a file would be awkward.

That's not what I meant, because then --multibuffer and 'set multibuffer'
would be no-ops.

No, what I meant is: when --multibuffer and 'set multibuffer' are not
used, then every invocation of ^R ('insert') will insert the read file
into the current buffer, *even* when on the previous invocation M-F was
toggled on.  And inversely, when --multibuffer or 'set multibuffer' ARE
used, then every invocation of ^R will read a file into a new buffer,
even when on the previous invocation M-F was toggled OFF.  This would
achieve what you want (a predictable state of the multibuffer flag)
while one still can choose what ^R should do by default, AND without
requiring a new bindable function.

> Sorry. I shouldn't have said "consider applying it". It is actually
> more a proof of concept than something in a finished state.

Don't waste my time with proofs of concept.  If you are serious about
a feature, take the time to polish your patch, sit on it, revisit it,
make it better again and again, before you send it.  Don't exasperate
me with a messy patch.

> Also, I added the new option to the end of the main menu. I wouldn't
> like to see two so similar functions so close on the main menu.

The thing is, your new function does exactly the same what ^R does
by default (with zero configuration).  When the ability for multiple
buffers was added (in 2001), the choice was made to add a toggle to
the ^R menu (and also, strangely, to the main menu) -- a toggle to
switch from inserting to opening a new buffer.  They could also have
decided to add a new function, say 'openfile', but... there were no
keystrokes left.  If it had been up to me, I would have discarded the
M-O toggle and would have used M-O to open a new buffer.

In other words: *if* a new bindable function is to be added, it will
have to be 'openfile', one that does something different from 'insert'
by default.  It will have to be unbound by default, and it should be
placed directly after 'savefile' in the main menu.

Benno

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

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