[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/annotate 6ceeb44774 133/372: - removed check for buffer fi
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/annotate 6ceeb44774 133/372: - removed check for buffer file name in funcion called just before a |
Date: |
Fri, 4 Feb 2022 16:58:34 -0500 (EST) |
branch: elpa/annotate
commit 6ceeb44774d721f2c75da3c2a2221027bd17e36b
Author: cage <cage-invalid@invalid>
Commit: cage <cage-invalid@invalid>
- removed check for buffer file name in funcion called just before a
buffer is going to change;
- added check in 'annotate--remove-annotation-property' to test if a
buffer is empty, if it does skip the rest of that function's code.
---
annotate.el | 73 +++++++++++++++++++++++++++++++------------------------------
1 file changed, 37 insertions(+), 36 deletions(-)
diff --git a/annotate.el b/annotate.el
index 4a8af5659a..fa8f1432ec 100644
--- a/annotate.el
+++ b/annotate.el
@@ -228,24 +228,23 @@ it is called any time the buffer content is changed (so,
for
example, text is added or deleted). In particular, it will
rearrange the overlays bounds when an annotated text is
modified (for example a newline is inserted)."
- (when (buffer-file-name)
- (annotate-with-inhibit-modification-hooks
- (save-excursion
- (let* ((bol (annotate-beginning-of-line-pos))
- (eol (annotate-end-of-line-pos))
- (ov (cl-remove-if-not 'annotationp
- (overlays-in bol eol))))
- (dolist (overlay ov)
- (annotate--remove-annotation-property (overlay-start overlay)
- (overlay-end overlay))
- ;; move the overlay if we are breaking it
- (when (<= (overlay-start overlay)
- a
- (overlay-end overlay))
- (move-overlay overlay (overlay-start overlay) a)
- ;; delete overlay if there is no more annotated text
- (when (annotate-annotated-text-empty-p overlay)
- (delete-overlay overlay)))))))))
+ (annotate-with-inhibit-modification-hooks
+ (save-excursion
+ (let* ((bol (annotate-beginning-of-line-pos))
+ (eol (annotate-end-of-line-pos))
+ (ov (cl-remove-if-not 'annotationp
+ (overlays-in bol eol))))
+ (dolist (overlay ov)
+ (annotate--remove-annotation-property (overlay-start overlay)
+ (overlay-end overlay))
+ ;; move the overlay if we are breaking it
+ (when (<= (overlay-start overlay)
+ a
+ (overlay-end overlay))
+ (move-overlay overlay (overlay-start overlay) a)
+ ;; delete overlay if there is no more annotated text
+ (when (annotate-annotated-text-empty-p overlay)
+ (delete-overlay overlay))))))))
(defun annotate-info-select-fn ()
(annotate-clear-annotations)
@@ -816,24 +815,26 @@ to 'maximum-width'."
(defun annotate--remove-annotation-property (begin end)
"Cleans up annotation properties associated with a region."
- ;; inhibit infinite loop
- (setq inhibit-modification-hooks t)
- ;; 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)))
+ (when (> (buffer-size)
+ 0)
+ ;; inhibit infinite loop
+ (setq inhibit-modification-hooks t)
+ ;; 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 519aab08ba 100/372: - added a better handling of characters with width > 1., (continued)
- [nongnu] elpa/annotate 519aab08ba 100/372: - added a better handling of characters with width > 1., ELPA Syncer, 2022/02/04
- [nongnu] elpa/annotate d07e406251 097/372: - changed prefix for annotation in summary window., ELPA Syncer, 2022/02/04
- [nongnu] elpa/annotate cf76d79c00 074/372: - fixed docstring., ELPA Syncer, 2022/02/04
- [nongnu] elpa/annotate 3341c23e5f 038/372: don't annotate or save empty regions, ELPA Syncer, 2022/02/04
- [nongnu] elpa/annotate 242104e55a 108/372: - changed functions name, ELPA Syncer, 2022/02/04
- [nongnu] elpa/annotate 55e318b172 124/372: - fixed reference to a non-existent variable in the procedure that, ELPA Syncer, 2022/02/04
- [nongnu] elpa/annotate 08f520f09a 119/372: - try to elaborate more a function goal., ELPA Syncer, 2022/02/04
- [nongnu] elpa/annotate 354653496d 115/372: - added a bit of (very simple) heuristic to place annotation in the, ELPA Syncer, 2022/02/04
- [nongnu] elpa/annotate a1be01d886 134/372: - try to guess the actual file name of an info document when showing, ELPA Syncer, 2022/02/04
- [nongnu] elpa/annotate 16e0346481 128/372: - prevent showing of summary window if metadata contains no annotations at all., ELPA Syncer, 2022/02/04
- [nongnu] elpa/annotate 6ceeb44774 133/372: - removed check for buffer file name in funcion called just before a,
ELPA Syncer <=
- [nongnu] elpa/annotate db9e064342 132/372: - added features: annotate info documents., ELPA Syncer, 2022/02/04
- [nongnu] elpa/annotate 4bcecdc875 156/372: - replaced 'splitted-annotation' with 'multiline-annotation'., ELPA Syncer, 2022/02/04
- [nongnu] elpa/annotate 4fde80fe79 168/372: - updated software version number in the comment on top of the source code;, ELPA Syncer, 2022/02/04
- [nongnu] elpa/annotate 696f4ee0cd 167/372: Merge pull request #55 from cage2/update-doc, ELPA Syncer, 2022/02/04
- [nongnu] elpa/annotate a59cc2c6b2 172/372: - when 'delete' button from a summary window is activated redraw and, ELPA Syncer, 2022/02/04
- [nongnu] elpa/annotate 412053cefc 173/372: - [bugfix] When a window is resized ensure that the sizes are, ELPA Syncer, 2022/02/04
- [nongnu] elpa/annotate 41e85c8435 176/372: - increased version number;, ELPA Syncer, 2022/02/04
- [nongnu] elpa/annotate cc4292cce4 181/372: - moved the test for 'limit' up in the lambda of the filtering, ELPA Syncer, 2022/02/04
- [nongnu] elpa/annotate f4cc83ec84 189/372: Merge branch 'master' into org-mode-fix, ELPA Syncer, 2022/02/04
- [nongnu] elpa/annotate bcffdb9f24 202/372: - added some missing docstrings., ELPA Syncer, 2022/02/04