[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/undo-tree 98170c6 075/195: Added additional check to mo
From: |
Stefan Monnier |
Subject: |
[elpa] externals/undo-tree 98170c6 075/195: Added additional check to more reliably identify marker undo elements. |
Date: |
Sat, 28 Nov 2020 13:41:25 -0500 (EST) |
branch: externals/undo-tree
commit 98170c66a7cc844b433e8dae7e8e0ff4f0a2af03
Author: Toby S. Cubitt <toby-undo-tree@dr-qubit.org>
Commit: Toby S. Cubitt <toby-undo-tree@dr-qubit.org>
Added additional check to more reliably identify marker undo elements.
Recent bzr Emacs builds seem to add a new (and currently undocumented)
buffer
modification undo element format: (t . -1) which appears to be used for the
initial modification entry for new files. This was getting incorrectly
identified as a marker undo entry, and deleted by undo-list-clean-GCd-elts,
preventing the buffer modification state from being restored correctly on
undoing.
The additional check in undo-list-GCd-marker-elt-p, on the symbol name in
the
car of the undo element, fixes this.
---
undo-tree.el | 18 ++++++++++++++++--
1 file changed, 16 insertions(+), 2 deletions(-)
diff --git a/undo-tree.el b/undo-tree.el
index 869e567..4a3b780 100644
--- a/undo-tree.el
+++ b/undo-tree.el
@@ -4,7 +4,7 @@
;; Copyright (C) 2009-2011 Toby Cubitt
;; Author: Toby Cubitt <toby-undo-tree@dr-qubit.org>
-;; Version: 0.3.1
+;; Version: 0.3.2
;; Keywords: convenience, files, undo, redo, history, tree
;; URL: http://www.dr-qubit.org/emacs.php
;; Git Repository: http://www.dr-qubit.org/git/undo-tree.git
@@ -605,6 +605,10 @@
;;; Change Log:
;;
+;; Version 0.3.2
+;; * added additional check in `undo-list-GCd-marker-elt-p' to guard against
+;; undo elements being mis-identified as marker elements.
+;;
;; Version 0.3.1
;; * use `get-buffer-create' when creating the visualizer buffer in
;; `undo-tree-visualize', to fix bug caused by `global-undo-tree-mode' being
@@ -1288,7 +1292,17 @@ Comparison is done with `eq'."
`(markerp (car-safe ,elt)))
(defmacro undo-list-GCd-marker-elt-p (elt)
- `(and (symbolp (car-safe ,elt)) (numberp (cdr-safe ,elt))))
+ ;; Return t if ELT is a marker element whose marker has been moved to the
+ ;; object-pool, so may potentially have been garbage-collected.
+ ;; Note: Valid marker undo elements should be uniquely identified as cons
+ ;; cells with a symbol in the car (replacing the marker), and a number in
+ ;; the cdr. However, to guard against future changes to undo element
+ ;; formats, we perform an additional redundant check on the symbol name.
+ `(and (symbolp (car-safe ,elt))
+ (let ((str (symbol-name (car ,elt))))
+ (and (> (length str) 12)
+ (string= (substring str 0 12) "undo-tree-id")))
+ (numberp (cdr-safe ,elt))))
(defun undo-tree-move-GC-elts-to-pool (elt)
- [elpa] externals/undo-tree 2bfab98 079/195: Bumped copyright year for new release., (continued)
- [elpa] externals/undo-tree 2bfab98 079/195: Bumped copyright year for new release., Stefan Monnier, 2020/11/28
- [elpa] externals/undo-tree a93e78f 071/195: Discard position entries from changesets created by undoing or redoing., Stefan Monnier, 2020/11/28
- [elpa] externals/undo-tree 45380b2 087/195: Suppress branch point messages when undo/redoing from undo-tree-set., Stefan Monnier, 2020/11/28
- [elpa] externals/undo-tree db55cea 068/195: Bumped compyright year and corrected license wording., Stefan Monnier, 2020/11/28
- [elpa] externals/undo-tree 3255044 065/195: Fixed bugs in undo-list-transfer-to-tree and undo-list-rebuild-from-tree, Stefan Monnier, 2020/11/28
- [elpa] externals/undo-tree 07e934a 080/195: Added term-mode to undo-tree-incompatible-major-modes., Stefan Monnier, 2020/11/28
- [elpa] externals/undo-tree acd7549 070/195: Prevent global-undo-tree-mode being enabled in incompatible major-modes., Stefan Monnier, 2020/11/28
- [elpa] externals/undo-tree 79b382b 083/195: Fixed bug in undo-list-pop-changeset when called with non-null DISCARD-POS., Stefan Monnier, 2020/11/28
- [elpa] externals/undo-tree 6680aab 086/195: Create proper registerv structure when storing undo state in register., Stefan Monnier, 2020/11/28
- [elpa] externals/undo-tree cd06456 073/195: Modified slightly misleading message in turn-on-undo-tree-mode., Stefan Monnier, 2020/11/28
- [elpa] externals/undo-tree 98170c6 075/195: Added additional check to more reliably identify marker undo elements.,
Stefan Monnier <=
- [elpa] externals/undo-tree 89bf725 081/195: Prevent undo history being discarded on major-mode switch, Stefan Monnier, 2020/11/28
- [elpa] externals/undo-tree 2b0395a 096/195: Added called-interactively-p compatibility hack for Emacs <= 23.1, Stefan Monnier, 2020/11/28
- [elpa] externals/undo-tree b42fe10 076/195: Fixed bug in undo-list-transfer-to-tree., Stefan Monnier, 2020/11/28
- [elpa] externals/undo-tree 897f2ff 089/195: Let-bind inhibit-read-only instead of setting and restoring buffer-read-only., Stefan Monnier, 2020/11/28
- [elpa] externals/undo-tree adca566 094/195: Allow undo-tree-visualizer-diff variable to be customized., Stefan Monnier, 2020/11/28
- [elpa] externals/undo-tree da54994 117/195: When discarding root, erase previous link of new root., Stefan Monnier, 2020/11/28
- [elpa] externals/undo-tree 4c6280b 101/195: Fixed bug preventing registers being displayed in visualizer., Stefan Monnier, 2020/11/28
- [elpa] externals/undo-tree 3ab4581 107/195: Avoid error if point was moved manually in visualizer selection mode, Stefan Monnier, 2020/11/28
- [elpa] externals/undo-tree 824b904 129/195: Preparatory changes for lazy tree drawing., Stefan Monnier, 2020/11/28
- [elpa] externals/undo-tree 40c7065 108/195: Added undo-tree-visualizer-abort command, Stefan Monnier, 2020/11/28