emacs-devel
[Top][All Lists]
Advanced

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

Re: [Emacs-diffs] trunk r117384: Optionally, undo several consequential


From: Stefan Monnier
Subject: Re: [Emacs-diffs] trunk r117384: Optionally, undo several consequential deletion in one step.
Date: Mon, 23 Jun 2014 21:36:01 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.4.50 (gnu/linux)

Hi Sam,

Thanks for your patch.  Some comments below.

> +  "Whether appending to kill ring also makes \\[undo] restore both pieces of 
> text simultaneously."

Please stick to a max of 80 columns, especially for docstrings.

> +    (when (and kill-append-merge-undo (not buffer-read-only))
> +      (let ((prev buffer-undo-list)
> +            (next (cdr buffer-undo-list)))
> +        ;; find the next undo boundary

Please capitalize and punctuate your comments.

> +        (while (car next)
> +          (pop next)
> +          (pop prev))
> +        ;; remove this undo boundary
> +        (when prev
> +          (setcdr prev (cdr next)))))))
 
I think this is a bit too aggressive.  It should have an upper bound
(e.g. 20).  It should only remove a boundary that's at the top of
buffer-undo-list.  And it should make sure it only removes
auto-added boundaries.

Maybe one way to do that is to refactor the self-insert-command so as to
export the "undo-boundary-squasher" part.


        Stefan



reply via email to

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