[Top][All Lists]

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

Re: kill-append and buffer-undo-list

From: Juri Linkov
Subject: Re: kill-append and buffer-undo-list
Date: Tue, 10 Jun 2014 01:48:39 +0300
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (x86_64-pc-linux-gnu)

> When text it killed with repeated C-k, they are appended in the
> kill-ring (as if it were done by a single C-w or C-u XXX C-k) but not in
> buffer-undo-list (i.e., an undo will reinsert just one line).
> It is not obvious to me that this is the "correct" behavior
> (although I am sure many people, myself included, rely on it).
> Any objections to making that optional?

I think better would be to make this an option of the undo feature itself.
Currently only `self-insert-command' commands are grouped into undo as a unit
of 20 consecutive self-inserting commands.  A new option would allow specifying
a command name to group, and also a number of consecutive commands to accept
as a group before adding a boundary between them.  A possible value for such
an option: (defcustom undo-group '((self-insert-command . 20) (kill-line . 20) 

Or maybe better to specify the same using symbol properties:

(put 'self-insert-command 'undo-group 20)
(put 'kill-line 'undo-group 20)

reply via email to

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