Re: [PATCH] possible new feature: cutbuffer history

Benno Schulenberg <[email protected]> Tue, 17 Mar 2026 17:35:41 +0100
Newsgroups gmane.editors.nano.devel
Message-ID <[email protected]>
Op 17-03-2026 om 02:43 schreef Xylia Allegretta:
> When working on a project, it sometimes becomes necessary to temporarily
> remove some text for testing, with the intention of adding it back later. If
> multi-line comments are not available or are already being used,

In which type of file are comments not available?  (Multiline does
not seem relevant to me: M-3 will comment out all marked lines.)
And what do you mean with "already being used"?  Can't one use
comments temporarily for two purposes?

> doing this
> normally require creating a temporary file and using multi-buffer mode to
> copy the text over to it,

I don't get it.  Either I would select the relevant text and ^O it
to a file called 'frag' (that is my go-to name) and then ^K it.  OR
I would ^K the selected text, open a new buffer (^R M-F <Enter>) and
paste it there.  The latter is more clumsy, I think -- I've never
worked that way.

But what one also might do is: ^K the selected text, save the buffer
with ^S, put nano to sleep with ^T^Z, try things out with the file
as it currently is, foreground nano with `fg`, and type M-U.

> But and then doing the reverse later to move the text
> back, before finally deleting the temporarily file. As this is somewhat
> tedious when it is repeatedly necessarily to do this (e.g. comparing behaviour
> with and without a change), this patch adds an option to automatically save
> and load the previous cutbuffer, so that the text can be easily added and
> removed across sessions without temporary files.

So this option makes the cutbuffer persistent across sessions.  It
doesn't retain a history of the last hundred or two hundred contents
of the cutbuffer -- as the name "cutbuffer history" seemed to imply.

Anyway, not going to do that.  Not a persistent cutbuffer, nor a
cutbuffer history.  The user has several options to temporarily
delete and still retain a piece text.  The method with ^O is what
I have used, and it is more versatile than a persistent cutbuffer
because one can save several fragments: frag1, frag2, ...

Another method is: ^K the selected text, ^S, switch to a different
terminal, do the testing there, switch back to the terminal with
nano, M-U.  Then repeat the cycle with a different selection.


Benno
OpenPGP_signature.asc (application/pgp-signature, 840 B)
-----BEGIN PGP SIGNATURE-----

wsF5BAABCAAjFiEEFo5vQpe/16ea/USWUUu+Lrjhlh8FAmm5gt0FAwAAAAAACgkQUUu+Lrjhlh++
TA/8CbIhIT6zJw1+hJzjJWWAPV73eSenjnM7LDPjEth1z5Cvr8180OMI8h+ism+G/F37CFywESfU
90jUrNTSwXcQ3Dcu7QR3MpdqoJvHqRQk61JNJ7S5XVvf/Wc6fZXsOrwK+be3JOlTpO+zkRrZPdqd
NPF5dGxTC2DsjNBlLG0yurNahcqpxq5beqhm6fGM7u27eGLeH4Geq/tqnu4sK21f6V38UrWnI3k5
l6J7XTL9A3qSW7gVp9oX1AK8fQ9ssXyZ1C0dXBI1iHEOklWCinNpqYpDOo0aa2SJsaqEQsu9yBbE
jDnnQqEAyp7BmSOhzn/yDWciR164hzZzU5aLBg52agKxHNLdUtUqGL3O2pdIm8jFRgmWD/hSLgTx
X4jGq4lMInSqaTbiMTnIrATFxGKbF4cTH5YHJEJM3z5SWyeJ3GWCS0VlUNw8BsP3uDkX/1nRXHB3
AKrDSfi94RBiuEHA/rRB7NmRuyCR0y0i4vV1Lhu6uJvqI8IlA9anHpAyCRPB6p82ibaIIKyksuD+
2WATSX+XSAY+UByTahQH6aoxczBmZtxqIxnbQsbaIhER4zWGq8W7YIM99/OlfNl6mPhBupOJkgEv
NHsc4sEuFbwRo+I1XwYwchtQVAd/KmSgDKbgUqWOeFh4dDtTCv65C5UShPrATRiFYySWS4mCe5LR
HxU=
=KN4l
-----END PGP SIGNATURE-----