[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/annotate 01373a4420 104/372: - preventing loss of undo lis
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/annotate 01373a4420 104/372: - preventing loss of undo list |
Date: |
Fri, 4 Feb 2022 16:58:22 -0500 (EST) |
branch: elpa/annotate
commit 01373a442083b4c5fab062742ddbbdeb7006bb46
Author: cage <cage-invalid@invalid>
Commit: cage <cage-invalid@invalid>
- preventing loss of undo list
According to the documentation the function 'uffer-disable-undo'
discards all the already registered buffer's modification. This is
undesiderable, to prevent this the old buffer list is copied and
restored in 'annotate--remove-annotation-property'.
---
annotate.el | 28 ++++++++++++++++------------
1 file changed, 16 insertions(+), 12 deletions(-)
diff --git a/annotate.el b/annotate.el
index dc91676870..4a03407ec9 100644
--- a/annotate.el
+++ b/annotate.el
@@ -700,18 +700,22 @@ to 'maximum-width'."
"Cleans up annotation properties associated with a region."
;; inhibit infinite loop
(setq inhibit-modification-hooks t)
- ;; inhibit property removal to the undo list
- (buffer-disable-undo)
- (save-excursion
- (goto-char end)
- ;; go to the EOL where the
- ;; annotated newline used to be
- (end-of-line)
- ;; strip dangling display property
- (remove-text-properties
- (point) (1+ (point)) '(display nil)))
- (buffer-enable-undo)
- (setq inhibit-modification-hooks nil))
+ ;; copy undo list
+ (let ((saved-undo-list (copy-tree buffer-undo-list t)))
+ ;; inhibit property removal to the undo list (and empty it too)
+ (buffer-disable-undo)
+ (save-excursion
+ (goto-char end)
+ ;; go to the EOL where the
+ ;; annotated newline used to be
+ (end-of-line)
+ ;; strip dangling display property
+ (remove-text-properties
+ (point) (1+ (point)) '(display nil)))
+ ;; restore undo list
+ (setf buffer-undo-list saved-undo-list)
+ (buffer-enable-undo)
+ (setq inhibit-modification-hooks nil)))
(defun annotate--change-guard ()
"Returns a `facespec` with an `insert-behind-hooks` property
- [nongnu] elpa/annotate 067fe860ea 054/372: added word wrap for long annotations, (continued)
- [nongnu] elpa/annotate 067fe860ea 054/372: added word wrap for long annotations, ELPA Syncer, 2022/02/04
- [nongnu] elpa/annotate 3c4da9d71a 093/372: - renamed 'annotate-text-annotation-dump' to 'annotate-text-of-annotation'., ELPA Syncer, 2022/02/04
- [nongnu] elpa/annotate 5af5e4139b 099/372: - fixed argument of check for file format version., ELPA Syncer, 2022/02/04
- [nongnu] elpa/annotate e2840072db 032/372: undo last change, didn't fix warning, ELPA Syncer, 2022/02/04
- [nongnu] elpa/annotate e1cafc819b 101/372: - removed newlines in snippet text;, ELPA Syncer, 2022/02/04
- [nongnu] elpa/annotate 74699a2a70 102/372: - making loading multiple time this mode with no effect on the buffer, ELPA Syncer, 2022/02/04
- [nongnu] elpa/annotate d60feb9cab 106/372: Merge pull request #45 from cage2/master, ELPA Syncer, 2022/02/04
- [nongnu] elpa/annotate c5ecb3649b 127/372: - removed useless quotation mark., ELPA Syncer, 2022/02/04
- [nongnu] elpa/annotate db489ad5c0 111/372: - changed secondary color., ELPA Syncer, 2022/02/04
- [nongnu] elpa/annotate 4f9c5f6d67 125/372: - added a warning when searching for a annotated text fails., ELPA Syncer, 2022/02/04
- [nongnu] elpa/annotate 01373a4420 104/372: - preventing loss of undo list,
ELPA Syncer <=
- [nongnu] elpa/annotate 3108c44c53 123/372: - moving some args checks from 'annotate-create-annotation' to, ELPA Syncer, 2022/02/04
- [nongnu] elpa/annotate 1c64e46ad0 109/372: - changed variable name, ELPA Syncer, 2022/02/04
- [nongnu] elpa/annotate d46d5afd34 122/372: - made two arguments of annotate-create-annotation non optional;, ELPA Syncer, 2022/02/04
- [nongnu] elpa/annotate b180248ddc 113/372: - fixed bug with multiline annotation, ELPA Syncer, 2022/02/04
- [nongnu] elpa/annotate 14ef3fb140 126/372: - fixed docstring., ELPA Syncer, 2022/02/04
- [nongnu] elpa/annotate bae16321fc 117/372: - using a customizable variable for region where to look for annotated, ELPA Syncer, 2022/02/04
- [nongnu] elpa/annotate 7ff18171a6 112/372: - fixed typos., ELPA Syncer, 2022/02/04
- [nongnu] elpa/annotate 7ebddc73a0 144/372: - enabled filtering of annotation database when a summary window is shown., ELPA Syncer, 2022/02/04
- [nongnu] elpa/annotate 50ba1d719c 143/372: - used a better regex when checking if a file is in info format., ELPA Syncer, 2022/02/04
- [nongnu] elpa/annotate 50bc634f6b 140/372: - placed the cursor in the right place (on the annotated text) when an, ELPA Syncer, 2022/02/04