[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/undo-tree caa3bd0 082/195: Added new customization opti
From: |
Stefan Monnier |
Subject: |
[elpa] externals/undo-tree caa3bd0 082/195: Added new customization option to allow undo-in-region to be disabled. |
Date: |
Sat, 28 Nov 2020 13:41:26 -0500 (EST) |
branch: externals/undo-tree
commit caa3bd00d93d7ecbd52231a0185088f4a2c6f603
Author: Toby S. Cubitt <toby-undo-tree@dr-qubit.org>
Commit: Toby S. Cubitt <toby-undo-tree@dr-qubit.org>
Added new customization option to allow undo-in-region to be disabled.
---
undo-tree.el | 20 ++++++++++++++++++--
1 file changed, 18 insertions(+), 2 deletions(-)
diff --git a/undo-tree.el b/undo-tree.el
index 5151845..ffa590b 100644
--- a/undo-tree.el
+++ b/undo-tree.el
@@ -608,6 +608,8 @@
;; Version 0.3.4
;; * set `permanent-local' property on `buffer-undo-tree', to prevent history
;; being discarded when switching major-mode
+;; * added `undo-tree-enabled-undo-in-region' customization option to allow
+;; undo-in-region to be disabled.
;;
;; Version 0.3.3;
;; * added `term-mode' to `undo-tree-incompatible-major-modes'
@@ -746,6 +748,16 @@ when `undo-tree-mode' is enabled."
:group 'undo-tree
:type 'string)
+(defcustom undo-tree-enable-undo-in-region t
+ "When non-nil, enable undo-in-region.
+
+When undo-in-region is enabled, undoing or redoing when the
+region is active (in `transient-mark-mode') or with a prefix
+argument (not in `transient-mark-mode') only undoes changes
+within the current region."
+ :group 'undo-tree
+ :type 'boolean)
+
(defcustom undo-tree-incompatible-major-modes '(term-mode)
"List of major-modes in which `undo-tree-mode' should not be enabled.
\(See `turn-on-undo-tree-mode'.\)"
@@ -2354,7 +2366,9 @@ undoing."
(when (eq buffer-undo-list t) (error "No undo information in this buffer"))
(let ((undo-in-progress t)
- (undo-in-region (or (region-active-p) (and arg (not (numberp arg)))))
+ (undo-in-region (and undo-tree-enable-undo-in-region
+ (or (region-active-p)
+ (and arg (not (numberp arg))))))
pos current)
;; transfer entries accumulated in `buffer-undo-list' to
;; `buffer-undo-tree'
@@ -2451,7 +2465,9 @@ redoing."
(when (eq buffer-undo-list t) (error "No undo information in this buffer"))
(let ((undo-in-progress t)
- (redo-in-region (or (region-active-p) (and arg (not (numberp arg)))))
+ (redo-in-region (and undo-tree-enable-undo-in-region
+ (or (region-active-p)
+ (and arg (not (numberp arg))))))
pos current)
;; transfer entries accumulated in `buffer-undo-list' to
;; `buffer-undo-tree'
- [elpa] externals/undo-tree bdfd73f 132/195: Ignore bogus buffer modification entries in undo changesets., (continued)
- [elpa] externals/undo-tree bdfd73f 132/195: Ignore bogus buffer modification entries in undo changesets., Stefan Monnier, 2020/11/28
- [elpa] externals/undo-tree 6e0775d 139/195: Use define-derived-mode and define-minor-mode for undo-tree visualizer., Stefan Monnier, 2020/11/28
- [elpa] externals/undo-tree d6fa2e7 152/195: Reinstate accidentally deleted file header., Stefan Monnier, 2020/11/28
- [elpa] externals/undo-tree 8afead1 162/195: Add Maintainer line to package headers., Stefan Monnier, 2020/11/28
- [elpa] externals/undo-tree e9a9102 164/195: Throw error if interactive commands called outside undo-tree-mode., Stefan Monnier, 2020/11/28
- [elpa] externals/undo-tree ffd18cd 175/195: Refactor undo-list-transfer-to-tree again in attempt to mitigate GC races., Stefan Monnier, 2020/11/28
- [elpa] externals/undo-tree 941bfe5 190/195: Don't attempt to save undo history if history file is unwritable., Stefan Monnier, 2020/11/28
- [elpa] externals/undo-tree 5a1ba84 017/195: Added standard Elisp package headers, including an extensive Commentary., Stefan Monnier, 2020/11/28
- [elpa] externals/undo-tree 62e6097 044/195: Added undo-tree-save/restore-state-to/from-register commands and keybindings, Stefan Monnier, 2020/11/28
- [elpa] externals/undo-tree c638cbd 051/195: General code tidying and reorganisation., Stefan Monnier, 2020/11/28
- [elpa] externals/undo-tree caa3bd0 082/195: Added new customization option to allow undo-in-region to be disabled.,
Stefan Monnier <=
- [elpa] externals/undo-tree 8972e4d 069/195: Use get-buffer-create when creating the visualizer buffer in undo-tree-visualize., Stefan Monnier, 2020/11/28
- [elpa] externals/undo-tree d7c1b2c 118/195: "De-circle" undo-tree when saving to file, restore when loading., Stefan Monnier, 2020/11/28
- [elpa] externals/undo-tree 121cab9 136/195: Trivial typo fixes in comments., Stefan Monnier, 2020/11/28
- [elpa] externals/undo-tree 18754c1 114/195: Use with-temp-buffer instead of with-temp-file when saving undo history., Stefan Monnier, 2020/11/28
- [elpa] externals/undo-tree c9f78c3 137/195: Use new user-error instead of error for expected undo errors., Stefan Monnier, 2020/11/28
- [elpa] externals/undo-tree 1114679 135/195: Fix bugs in binding of undo-tree-insert-face., Stefan Monnier, 2020/11/28
- [elpa] externals/undo-tree 5d19d4e 155/195: Bump version number and copyright year., Stefan Monnier, 2020/11/28
- [elpa] externals/undo-tree ffb346a 157/195: Install undo-tree undo/redo Edit menu bar items., Stefan Monnier, 2020/11/28
- [elpa] externals/undo-tree 19baf49 158/195: Fix undo/redo-in-region tree diagrams in Commentary., Stefan Monnier, 2020/11/28
- [elpa] externals/undo-tree 22d6c01 153/195: Fix bug that cleared tree when enabling undo-tree-mode., Stefan Monnier, 2020/11/28