[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/org-remark dc162bc8ec 172/173: fix: window management f
From: |
ELPA Syncer |
Subject: |
[elpa] externals/org-remark dc162bc8ec 172/173: fix: window management for open and remove/delete |
Date: |
Fri, 28 Jan 2022 16:58:13 -0500 (EST) |
branch: externals/org-remark
commit dc162bc8ec6fa2f99be3b8077dfeca4e34aff3e5
Author: Noboru Ota <me@nobiot.com>
Commit: Noboru Ota <me@nobiot.com>
fix: window management for open and remove/delete
open: refactor to use `pop-to-buffer` instead `display-buffer` and
`select-window`. The former has more robust control, e.g. when a new frame
is
to be used.
remove/delete:
Quit the marginal notes indirect buffer if it was not there
before the remove/delete -- go back to the original state.
---
org-remark.el | 26 ++++++++++++++------------
1 file changed, 14 insertions(+), 12 deletions(-)
diff --git a/org-remark.el b/org-remark.el
index 6ab1d09289..3a25e83fdd 100644
--- a/org-remark.el
+++ b/org-remark.el
@@ -6,7 +6,7 @@
;; URL: https://github.com/nobiot/org-remark
;; Version: 0.2.0
;; Created: 22 December 2020
-;; Last modified: 26 January 2022
+;; Last modified: 27 January 2022
;; Package-Requires: ((emacs "27.1") (org "9.4"))
;; Keywords: org-mode, annotation, writing, note-taking, marginal-notes
@@ -407,15 +407,17 @@ notes file by tracking it."
(when-let ((id (get-char-property point 'org-remark-id))
(ibuf (org-remark-notes-buffer-get-or-create))
(cbuf (current-buffer)))
- (display-buffer ibuf org-remark-notes-display-buffer-action)
- (select-window (get-buffer-window ibuf))
+ (pop-to-buffer ibuf org-remark-notes-display-buffer-action)
(widen)
(when-let (p (org-find-property org-remark-prop-id id))
;; Somehow recenter is needed when a highlight is deleted and move to a
- ;; previous. Otherwise, the cursor is too low to show the entire entry.
- ;; It looks like there is no entry.
+ ;; previous highlight. Otherwise, the cursor is too low to show the
+ ;; entire entry. It looks like there is no entry.
(goto-char p)(org-narrow-to-subtree)(org-end-of-meta-data t)(recenter))
- (when view-only (select-window (get-buffer-window cbuf)))))
+ ;; Avoid error when buffer-action is set to display a new frame
+ (when-let ((view-only view-only)
+ (window (get-buffer-window cbuf)))
+ (select-window window))))
(defun org-remark-view (point)
"View marginal notes for highlight at POINT.
@@ -832,12 +834,12 @@ Do you really want to delete the notes?"))
;; If there is no content, it's OK
t))
(delete-region (point-min)(point-max))
- (message "Deleted the marginal notes entry")
- ;; Quit the marginal notes indirect buffer if it was not there
- ;; before the delete -- go back to the original state.
- (when-let (ibuf-window (get-buffer-window ibuf))
- (unless window? (quit-window nil ibuf-window )))))))
- (when (buffer-modified-p) (save-buffer)))
+ (message "Deleted the marginal notes entry")))))
+ (when (buffer-modified-p) (save-buffer))
+ ;; Quit the marginal notes indirect buffer if it was not there
+ ;; before the remove/delete -- go back to the original state.
+ (when-let (ibuf-window (get-buffer-window ibuf))
+ (unless window? (quit-window nil ibuf-window ))))
t))
(defun org-remark-notes-buffer-get-or-create ()
- [elpa] externals/org-remark 2e14b95d65 147/173: feat: minor-mode menu & mouse context-menu (>= Emacs 28), (continued)
- [elpa] externals/org-remark 2e14b95d65 147/173: feat: minor-mode menu & mouse context-menu (>= Emacs 28), ELPA Syncer, 2022/01/28
- [elpa] externals/org-remark d9e305837b 149/173: docs: README update for ascii output used by ELPA, ELPA Syncer, 2022/01/28
- [elpa] externals/org-remark 2b4692abbf 150/173: docs: NEWS for v0.1.0, ELPA Syncer, 2022/01/28
- [elpa] externals/org-remark 41b0997c3f 151/173: fix: remove/delete remove only one highlihgt at a time, ELPA Syncer, 2022/01/28
- [elpa] externals/org-remark 84d50976df 156/173: chg: Menu label from "Remark" to "Org-remark", ELPA Syncer, 2022/01/28
- [elpa] externals/org-remark 697a990a34 158/173: revert f6c3f36 The screen jerking was not OS or version; setup issue, ELPA Syncer, 2022/01/28
- [elpa] externals/org-remark 5e55f8757d 159/173: chg: menu squence; docs: add menu and context menu to user manual, ELPA Syncer, 2022/01/28
- [elpa] externals/org-remark 0db912919a 163/173: docs: update Makefile, README and user manual, ELPA Syncer, 2022/01/28
- [elpa] externals/org-remark 82a4afbee0 169/173: add: delete with confirmation promt etc., ELPA Syncer, 2022/01/28
- [elpa] externals/org-remark a1ff9033c1 170/173: add: org-remark-delete, ELPA Syncer, 2022/01/28
- [elpa] externals/org-remark dc162bc8ec 172/173: fix: window management for open and remove/delete,
ELPA Syncer <=
- [elpa] externals/org-remark 91d7583495 065/173: add: mark deactivate-mark & set-buffer-modified-p, ELPA Syncer, 2022/01/28
- [elpa] externals/org-remark bd01afe043 068/173: add tracking: customizing subgroup, ELPA Syncer, 2022/01/28
- [elpa] externals/org-remark 0e2a215c40 079/173: readme, ELPA Syncer, 2022/01/28
- [elpa] externals/org-remark bc051adab9 022/173: doc: Add some clarification to readme, etc., ELPA Syncer, 2022/01/28
- [elpa] externals/org-remark 1878b9ddce 029/173: fix: Error narrowed source for range, ELPA Syncer, 2022/01/28
- [elpa] externals/org-remark 310b79efc5 033/173: doc: Add a limitatino of moving files, ELPA Syncer, 2022/01/28
- [elpa] externals/org-remark 6bfac5368e 036/173: intrnl: Add eval org-marginalia-mode to file var, ELPA Syncer, 2022/01/28
- [elpa] externals/org-remark 067681278f 038/173: fix: next/prev was reversed, ELPA Syncer, 2022/01/28
- [elpa] externals/org-remark b595c74a06 045/173: doc: Update docstring for the sort fn, ELPA Syncer, 2022/01/28
- [elpa] externals/org-remark 9e2341a51f 049/173: [doc] fix code example, ELPA Syncer, 2022/01/28