diff options
author | Mattias EngdegÄrd <mattiase@acm.org> | 2019-10-31 10:31:27 +0100 |
---|---|---|
committer | Mattias EngdegÄrd <mattiase@acm.org> | 2019-10-31 17:41:29 +0100 |
commit | d75794fd5c168fb76406b88e231d8749160f934a (patch) | |
tree | f2ca99dbdca855ddc4d182658fda10233c44cac3 /doc/lispref | |
parent | 111a95fe6d209aff6e7f26cb6777fbdf02aae15d (diff) | |
download | emacs-d75794fd5c168fb76406b88e231d8749160f934a.tar.gz |
Inhibit undo-in-region for mouse-drag-region (bug#37700)
'mouse-drag-region' leaves the region active around the dragged text,
so a straight undo did not revert the entire operation. To remedy
this, inhibit undo-in-region when the last command was
mouse-drag-region. (Method suggested by Stefan Monnier.)
* lisp/mouse.el (undo-drag-region): Set the undo-inhibit-region property.
* lisp/simple.el (undo): Inhibit undo-in-region if the last command
had the undo-inhibit-region property set.
* doc/lispref/symbols.texi (Standard Properties):
* doc/lispref/text.texi (Undo): Document undo-inhibit-region.
* etc/NEWS: Announce the property.
Diffstat (limited to 'doc/lispref')
-rw-r--r-- | doc/lispref/symbols.texi | 5 | ||||
-rw-r--r-- | doc/lispref/text.texi | 6 |
2 files changed, 11 insertions, 0 deletions
diff --git a/doc/lispref/symbols.texi b/doc/lispref/symbols.texi index 5d71fb39a25..936bda9b36e 100644 --- a/doc/lispref/symbols.texi +++ b/doc/lispref/symbols.texi @@ -590,6 +590,11 @@ ignore a call whose value is unused. If the property's value is calls. In addition to byte compiler optimizations, this property is also used for determining function safety (@pxref{Function Safety}). +@item undo-inhibit-region +If non-@code{nil}, the named function prevents the @code{undo} operation +from being restricted to the active region, if @code{undo} is invoked +immediately after the function. @xref{Undo}. + @item variable-documentation If non-@code{nil}, this specifies the named variable's documentation string. This is set automatically by @code{defvar} and related diff --git a/doc/lispref/text.texi b/doc/lispref/text.texi index ac444f6afeb..9bc6213f3ac 100644 --- a/doc/lispref/text.texi +++ b/doc/lispref/text.texi @@ -1451,6 +1451,12 @@ continuing to undo. This function does not bind @code{undo-in-progress}. @end defun +Some commands leave the region active after execution in such a way that +it interferes with selective undo of that command. To make @code{undo} +ignore the active region when invoked immediately after such a command, +set the property @code{undo-inhibit-region} of the command's function +symbol to a non-nil value. @xref{Standard Properties}. + @node Maintaining Undo @section Maintaining Undo Lists |