emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] externals/org-remark 4b5d9c3fda 171/173: fix:delete quit window i


From: ELPA Syncer
Subject: [elpa] externals/org-remark 4b5d9c3fda 171/173: fix:delete quit window if it did not exist on calling delete
Date: Fri, 28 Jan 2022 16:58:13 -0500 (EST)

branch: externals/org-remark
commit 4b5d9c3fda624c73aef7bd557be17b989d06db59
Author: Noboru Ota <me@nobiot.com>
Commit: Noboru Ota <me@nobiot.com>

    fix:delete quit window if it did not exist on calling delete
---
 org-remark.el | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/org-remark.el b/org-remark.el
index 313eb85cc9..6ab1d09289 100644
--- a/org-remark.el
+++ b/org-remark.el
@@ -807,7 +807,7 @@ notes of the entry.
 
 Return t if an entry is removed or deleted."
   (let* ((ibuf (org-remark-notes-buffer-get-or-create))
-         (ibuf-window (get-buffer-window ibuf)))
+         (window? (get-buffer-window ibuf)))
     (with-current-buffer ibuf
       (org-with-wide-buffer
        (when-let ((id-headline (org-find-property org-remark-prop-id id)))
@@ -832,10 +832,11 @@ 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")))))
+             (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.
-             ;;(unless ibuf-window (quit-window nil (get-buffer-window 
ibuf)))))))
+             (when-let (ibuf-window (get-buffer-window ibuf))
+               (unless window? (quit-window nil ibuf-window )))))))
       (when (buffer-modified-p) (save-buffer)))
     t))
 



reply via email to

[Prev in Thread] Current Thread [Next in Thread]