[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/org-remark 754f7c1915 11/37: fix: deleted highlight ove
From: |
ELPA Syncer |
Subject: |
[elpa] externals/org-remark 754f7c1915 11/37: fix: deleted highlight overlay blocking saving multiple highlights |
Date: |
Sat, 14 Jan 2023 10:58:01 -0500 (EST) |
branch: externals/org-remark
commit 754f7c1915431b6d224d7ec972beec6676a1c444
Author: Noboru Ota <me@nobiot.com>
Commit: Noboru Ota <me@nobiot.com>
fix: deleted highlight overlay blocking saving multiple highlights
Added utility function 'org-remark-highlight-clear' to standardize the
clearing of a single highlight and the list variable
'org-remark-highlights'.
---
org-remark.el | 28 +++++++++++++++++-----------
1 file changed, 17 insertions(+), 11 deletions(-)
diff --git a/org-remark.el b/org-remark.el
index a065d5a283..9db6b5b04e 100644
--- a/org-remark.el
+++ b/org-remark.el
@@ -417,9 +417,9 @@ in the current buffer. Each highlight is an overlay."
(let* ((beg (overlay-start h))
(end (overlay-end h))
(props (overlay-properties h)))
- (org-remark-highlight-save filename beg end props)))))
- (with-current-buffer notes-buf
- (save-buffer))))
+ (org-remark-highlight-save filename beg end props))))
+ (with-current-buffer notes-buf
+ (save-buffer)))))
(defun org-remark-open (point &optional view-only)
"Open marginal notes file for highlight at POINT.
@@ -553,7 +553,7 @@ from."
(let ((new-pen (if pen pen
(intern
(completing-read "Which pen?:"
org-remark-available-pens)))))
- (delete-overlay ov)
+ (org-remark-highlight-clear ov)
(funcall new-pen beg end id :change))))
(defun org-remark-remove (point &optional delete)
@@ -571,12 +571,11 @@ and removing overlays are not part of the undo tree."
(interactive "d\nP")
(when-let ((ov (org-remark-find-overlay-at-point point))
(id (overlay-get ov 'org-remark-id)))
- ;; Remove the highlight overlay and id Where there is more than one, remove
- ;; only one It should be last-in-first-out in general but overlays
functions
- ;; don't guarantee it
- ;;(when delete (org-remark-open point :view-only))
- (delete ov org-remark-highlights)
- (delete-overlay ov)
+ ;; Remove the highlight overlay and id Where there is more than one,
+ ;; remove only one. It should be last-in-first-out in general but
+ ;; overlays functions don't guarantee it (when delete
+ ;; (org-remark-open point :view-only))
+ (org-remark-highlight-clear ov)
;; Update the notes file accordingly
(org-remark-notes-remove id delete)
(org-remark-highlights-housekeep)
@@ -933,6 +932,13 @@ Assume the current buffer is the source buffer."
(overlay-put ov '*org-remark-note-body
(plist-get props :body)))))
+(defun org-remark-highlight-clear (overlay)
+ "Clear a single highlight OVERLAY.
+It is a utility function to take care of both
+`org-remark-highlights' and a highlight overlay at the same time."
+ (setq org-remark-highlights (delete overlay org-remark-highlights))
+ (delete-overlay overlay))
+
;;;;; org-remark-notes
;; Private functions that work on marginal notes buffer (notes
@@ -1118,7 +1124,7 @@ notes file (indrect or base)."
;; be an edge case but the highlight could have moved to a
;; completely new location where the old location does not
;; overlap with the new location at all.
- (when ov (delete-overlay ov))
+ (when ov (org-remark-highlight-clear ov))
(org-remark-highlight-load highlight))))))
(defun org-remark-notes-sync-with-source ()
- [elpa] externals/org-remark updated (af99b97204 -> f603ad6769), ELPA Syncer, 2023/01/14
- [elpa] externals/org-remark 837b25d3d7 01/37: refactor: -highlight-* functions, ELPA Syncer, 2023/01/14
- [elpa] externals/org-remark 0912cbb0af 04/37: fix: incorrect beg end of a highlight, ELPA Syncer, 2023/01/14
- [elpa] externals/org-remark ac09890168 02/37: refactor -notes-* functions, ELPA Syncer, 2023/01/14
- [elpa] externals/org-remark 754f7c1915 11/37: fix: deleted highlight overlay blocking saving multiple highlights,
ELPA Syncer <=
- [elpa] externals/org-remark 75d8fd3c9d 19/37: refactor(mark): save notes buf only when create/change, ELPA Syncer, 2023/01/14
- [elpa] externals/org-remark ed5f4314e8 05/37: refactor(sync): remove org-remark-notes-setup-done, ELPA Syncer, 2023/01/14
- [elpa] externals/org-remark eb7c4ebf59 10/37: docs: doc string, ELPA Syncer, 2023/01/14
- [elpa] externals/org-remark e4ba2bbd41 18/37: chore: copyright years to 2023, ELPA Syncer, 2023/01/14
- [elpa] externals/org-remark 7367b7d056 20/37: fix: Text cut off in notes if the highlight spans across two lines #56, ELPA Syncer, 2023/01/14
- [elpa] externals/org-remark af1d4261f3 24/37: docs: update README, ELPA Syncer, 2023/01/14
- [elpa] externals/org-remark 05e18aa08c 30/37: docs: README + user manual, ELPA Syncer, 2023/01/14
- [elpa] externals/org-remark 3d4ff2e030 03/37: doc: update docstring, ELPA Syncer, 2023/01/14
- [elpa] externals/org-remark 484d36ad89 06/37: docs(sync): doc string 'org-remark-highlight-save', ELPA Syncer, 2023/01/14
- [elpa] externals/org-remark a9a3520a64 07/37: refactor(save) save notes buffer for each highlight, ELPA Syncer, 2023/01/14