[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/org-remark 8004555a9b 16/37: fix: highlights housekeep
From: |
ELPA Syncer |
Subject: |
[elpa] externals/org-remark 8004555a9b 16/37: fix: highlights housekeep to delete notes when you want to keep |
Date: |
Sat, 14 Jan 2023 10:58:01 -0500 (EST) |
branch: externals/org-remark
commit 8004555a9bd9e6d97fe26d59a09d8af6203d6223
Author: Noboru Ota <me@nobiot.com>
Commit: Noboru Ota <me@nobiot.com>
fix: highlights housekeep to delete notes when you want to keep
In working toward supporting nov.el, it was found out that marginal
notes were removed when they should be kept intact. It was found that
'-highlights-housekeep' function was the cause. This was because nov.el
buffer becomes writable when we turn the
page:(e.g. 'nov-next-document'), erase the buffer, and then render the
new page. Housekeeping should be done to the highlights overlays from
the now-the-previous page (as they will have start/end both 1); however,
the related notes must not be removed.
This can be prevented by adding additional condition that the major mode
is derived from special mode (nov-mode is).
---
org-remark.el | 16 +++++++++++++---
1 file changed, 13 insertions(+), 3 deletions(-)
diff --git a/org-remark.el b/org-remark.el
index 2606804385..a64093ed88 100644
--- a/org-remark.el
+++ b/org-remark.el
@@ -6,7 +6,7 @@
;; URL: https://github.com/nobiot/org-remark
;; Version: 1.0.5
;; Created: 22 December 2020
-;; Last modified: 08 January 2023
+;; Last modified: 09 January 2023
;; Package-Requires: ((emacs "27.1") (org "9.4"))
;; Keywords: org-mode, annotation, note-taking, marginal-notes, wp,
@@ -872,7 +872,7 @@ buffer for automatic sync."
(org-remark-notes-setup notes-buf source-buf))
(with-current-buffer notes-buf
(when (featurep 'org-remark-convert-legacy)
(org-remark-convert-legacy-data))
- ;;`org-with-wide-buffer is a macro that should work for non-Org file'
+ ;;`org-with-wide-buffer' is a macro that should work for non-Org file
(org-with-wide-buffer
(let ((file-headline
(or (org-find-property
@@ -1319,7 +1319,17 @@ Case 2. The overlay points to no buffer
;; annotation when it is.
(when (and (overlay-buffer ov)
(= (overlay-start ov) (overlay-end ov)))
- (when (not buffer-read-only)
+ (when (and (not buffer-read-only)
+ (not (derived-mode-p 'special-mode)))
+ ;; buffer-size 0 happens for package like nov.el It
+ ;; erases the buffer (size 0) and renders a new page in
+ ;; the same buffer. In this case, buffer is writable.
+ ;; Removing the notes here is meant to be automatically remove
+ ;; notes when you delete a region that contains a higlight
+ ;; overlay.
+
+ ;; TODO Relying on the current major mode being derived from
+ ;; special-mode is not the best.
(org-remark-notes-remove (overlay-get ov 'org-remark-id)))
(delete-overlay ov))
(unless (overlay-buffer ov)
- [elpa] externals/org-remark 3d4ff2e030 03/37: doc: update docstring, (continued)
- [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
- [elpa] externals/org-remark 2f25bd97bc 15/37: refactor: change the default colors of yellow pen #52, ELPA Syncer, 2023/01/14
- [elpa] externals/org-remark f08df3f524 17/37: fix: prop name _org-remark-note-body -> *org-remark-note-body, ELPA Syncer, 2023/01/14
- [elpa] externals/org-remark f661e6c78e 21/37: docs: updated NEWS, ELPA Syncer, 2023/01/14
- [elpa] externals/org-remark 59b01a827c 27/37: docs: README, ELPA Syncer, 2023/01/14
- [elpa] externals/org-remark 6cd69b44d2 08/37: docs: corrected based on flymake and checkdoc, ELPA Syncer, 2023/01/14
- [elpa] externals/org-remark ad0c5e39c2 09/37: refactor: org-remark-notes-setup, ELPA Syncer, 2023/01/14
- [elpa] externals/org-remark a89d5a9645 13/37: fix(save): save per highlight and regession for when source = notes, ELPA Syncer, 2023/01/14
- [elpa] externals/org-remark 8004555a9b 16/37: fix: highlights housekeep to delete notes when you want to keep,
ELPA Syncer <=
- [elpa] externals/org-remark f48992594d 26/37: docs: CHANGELOG, NEWS, README, ELPA Syncer, 2023/01/14
- [elpa] externals/org-remark 4c4d729962 36/37: docs: fix formatting issue of known limitations in user manual, ELPA Syncer, 2023/01/14
- [elpa] externals/org-remark 1ec641589f 12/37: fix: undo a9a3520., ELPA Syncer, 2023/01/14
- [elpa] externals/org-remark 048a39f3f9 14/37: fix(save): modifiedp when source = notes buffer, ELPA Syncer, 2023/01/14
- [elpa] externals/org-remark dcdc39e394 22/37: fix: missing defvar org-remark-source-find-file-name-functions, ELPA Syncer, 2023/01/14
- [elpa] externals/org-remark 4e7db78df3 25/37: docs: README, ELPA Syncer, 2023/01/14
- [elpa] externals/org-remark f1f3310c11 28/37: docs: README & user manual, ELPA Syncer, 2023/01/14
- [elpa] externals/org-remark a377f92e4a 32/37: Merge branch 'dev/round-off' for v1.1.0-rc (not bumped yet), ELPA Syncer, 2023/01/14
- [elpa] externals/org-remark 2e2f979ba2 33/37: docs: fix error in make process for document generation, ELPA Syncer, 2023/01/14
- [elpa] externals/org-remark bd908a9356 34/37: docs: fix footnotes, ELPA Syncer, 2023/01/14