[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/org-remark f6c3f36ded 157/173: fix: jerking buffer move
From: |
ELPA Syncer |
Subject: |
[elpa] externals/org-remark f6c3f36ded 157/173: fix: jerking buffer movement for cerain version/OS |
Date: |
Fri, 28 Jan 2022 16:58:10 -0500 (EST) |
branch: externals/org-remark
commit f6c3f36ded3ebf42d439d85b1c07bd407875021f
Author: Noboru Ota <me@nobiot.com>
Commit: Noboru Ota <me@nobiot.com>
fix: jerking buffer movement for cerain version/OS
Emacs 27.2 on Windows has this problem -- delete a side-window and then
display
an new one appears to be quickly moving the buffers -- it's a bit dizzying
when
moving from one highlight to another via view-next/prev.
---
org-remark.el | 38 +++++++++++++++++++++++++-------------
1 file changed, 25 insertions(+), 13 deletions(-)
diff --git a/org-remark.el b/org-remark.el
index 86a88d4d16..ba7eb3bdd8 100644
--- a/org-remark.el
+++ b/org-remark.el
@@ -71,8 +71,7 @@ file."
(defcustom org-remark-notes-display-buffer-action
`((display-buffer-in-side-window)
(side . left)
- (slot . 1)
- (dedicated . t))
+ (slot . 1))
"Define how Org-remark opens the notes buffer.
The default is to use a dedicated side-window on the left. It is
an action list for `display-buffer'. Refer to its documentation
@@ -409,18 +408,31 @@ current buffer.
This function ensures that there is only one cloned buffer for
notes file by tracking it."
(interactive "d\nP")
- (when (buffer-live-p org-remark-last-notes-buffer)
- (kill-buffer org-remark-last-notes-buffer))
- (when-let ((id (get-char-property point 'org-remark-id))
- (ibuf (make-indirect-buffer
- (find-file-noselect org-remark-notes-file-path)
- org-remark-notes-buffer-name 'clone)))
- (setq org-remark-last-notes-buffer ibuf)
- (with-current-buffer ibuf
+ ;; Check if the current point is at a org-remark highlight overlay.
+ (when-let ((id (get-char-property point 'org-remark-id)))
+ ;; If the base-bufffer of the marginal notes buffer has not changed from
the
+ ;; previous, don't kill it If it's different or new, kill the last marginal
+ ;; notes buffer and create a new clone indrect buffer. We want only one of
+ ;; the clone indirect buffer for the Emacs session at a time.
+ (unless (buffer-live-p org-remark-last-notes-buffer)
+ (setq org-remark-last-notes-buffer nil))
+ (let ((ibuf org-remark-last-notes-buffer)
+ (notes-buf (find-file-noselect org-remark-notes-file-path))
+ (cbuf (current-buffer)))
+ (when (buffer-base-buffer ibuf) notes-buf
+ ;; killed buffer is not nil
+ (kill-buffer ibuf) (setq ibuf nil))
+ ;; ibuf (marignal notes buffer) does not exist or exist but it's not for
+ ;; the current main note. Clone a new indirect buffer.
+ (unless ibuf
+ (setq ibuf (make-indirect-buffer
+ notes-buf org-remark-notes-buffer-name :clone)))
+ (display-buffer ibuf org-remark-notes-display-buffer-action)
+ (set-buffer ibuf)(widen)
(when-let (p (org-find-property org-remark-prop-id id))
- (widen)(goto-char p)(org-narrow-to-subtree)))
- (display-buffer ibuf org-remark-notes-display-buffer-action)
- (unless view-only (select-window (get-buffer-window ibuf)))))
+ (goto-char p)(org-narrow-to-subtree))
+ (setq org-remark-last-notes-buffer ibuf)
+ (unless view-only (select-window (get-buffer-window ibuf))))))
(defun org-remark-view (point)
"View marginal notes for highlight at POINT.
- [elpa] externals/org-remark e3dd998e6b 130/173: add: register the default pen function for change, (continued)
- [elpa] externals/org-remark e3dd998e6b 130/173: add: register the default pen function for change, ELPA Syncer, 2022/01/28
- [elpa] externals/org-remark 9f492e184e 111/173: fix side-window, ELPA Syncer, 2022/01/28
- [elpa] externals/org-remark 238a023021 141/173: docs: gh-html error, ELPA Syncer, 2022/01/28
- [elpa] externals/org-remark bbd5c4795e 144/173: docs: user manual, ELPA Syncer, 2022/01/28
- [elpa] externals/org-remark c6dccc3878 161/173: intrnl:create macro: check label to be a string, ELPA Syncer, 2022/01/28
- [elpa] externals/org-remark a55d0b7717 165/173: docs: README and user manaul, ELPA Syncer, 2022/01/28
- [elpa] externals/org-remark 74c6756d72 109/173: keep default marginalia.org, ELPA Syncer, 2022/01/28
- [elpa] externals/org-remark 6583adaca1 134/173: intrnl: single-highlight-mark is back, ELPA Syncer, 2022/01/28
- [elpa] externals/org-remark c6ddf2fdfc 138/173: docs: user manual -- remove "incomplete", ELPA Syncer, 2022/01/28
- [elpa] externals/org-remark 937111e175 135/173: intrnl: refactor more, ELPA Syncer, 2022/01/28
- [elpa] externals/org-remark f6c3f36ded 157/173: fix: jerking buffer movement for cerain version/OS,
ELPA Syncer <=
- [elpa] externals/org-remark bb6d48c61c 160/173: docs: Update screen shots and README, ELPA Syncer, 2022/01/28
- [elpa] externals/org-remark a097fb473a 164/173: docs: fix Makefile for GH. README minor update, ELPA Syncer, 2022/01/28
- [elpa] externals/org-remark 28be5fcea9 162/173: docs: remove the note saying screen shots are from org-marginalia, ELPA Syncer, 2022/01/28
- [elpa] externals/org-remark f6fe2ad221 166/173: docs: add missing user option to variable index, ELPA Syncer, 2022/01/28
- [elpa] externals/org-remark 95b408ff39 167/173: docs: add video link; fix Contributing section with Org-remark, ELPA Syncer, 2022/01/28
- [elpa] externals/org-remark 266da621be 117/173: add: Legacy data facility with org-remark-tracking - main part, ELPA Syncer, 2022/01/28