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

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

[elpa] externals/org 94c2c8d929 1/2: Inhibit error when saving bookmarks


From: ELPA Syncer
Subject: [elpa] externals/org 94c2c8d929 1/2: Inhibit error when saving bookmarks with `debug-on-error' set to non-nil
Date: Sat, 24 Jun 2023 09:58:32 -0400 (EDT)

branch: externals/org
commit 94c2c8d9298b9e268ac7bd3d885faf7114c8f324
Author: Ihor Radchenko <yantar92@posteo.net>
Commit: Ihor Radchenko <yantar92@posteo.net>

    Inhibit error when saving bookmarks with `debug-on-error' set to non-nil
    
    * lisp/org-capture.el (org-capture-store-last-position):
    * lisp/org-refile.el (org-refile): Use `condition-case' instead of
    `with-demoted-errors' when saving bookmarks.  We intent to suppress
    errors completely here (116c09053), even when `debug-on-error' is set.
    `with-demoted-errors' does trigger error in such scenario, unlike
    explicit `condition-case' clause.
    
    Reported-by: No Wayman <iarchivedmywholelife@gmail.com>
    Link: https://orgmode.org/list/875y7d7jlr.fsf@gmail.com
---
 lisp/org-capture.el |  7 +++++--
 lisp/org-refile.el  | 12 ++++++++----
 2 files changed, 13 insertions(+), 6 deletions(-)

diff --git a/lisp/org-capture.el b/lisp/org-capture.el
index 40a7f78f17..252527574c 100644
--- a/lisp/org-capture.el
+++ b/lisp/org-capture.el
@@ -1504,8 +1504,11 @@ Of course, if exact position has been required, just put 
it there."
       (org-with-point-at pos
        (when org-capture-bookmark
          (let ((bookmark (plist-get org-bookmark-names-plist :last-capture)))
-           (when bookmark (with-demoted-errors "Bookmark set error: %S"
-                            (bookmark-set bookmark)))))
+           (when bookmark
+              (condition-case err
+                 (bookmark-set bookmark)
+                (error
+                 (message (format "Bookmark set error: %S" err)))))))
        (move-marker org-capture-last-stored-marker (point))))))
 
 (defun org-capture-narrow (beg end)
diff --git a/lisp/org-refile.el b/lisp/org-refile.el
index 600953fd6b..30480e5da0 100644
--- a/lisp/org-refile.el
+++ b/lisp/org-refile.el
@@ -589,16 +589,20 @@ prefix argument (`C-u C-u C-u C-c C-w')."
                 (let ((bookmark-name (plist-get org-bookmark-names-plist
                                                 :last-refile)))
                   (when bookmark-name
-                    (with-demoted-errors "Bookmark set error: %S"
-                      (bookmark-set bookmark-name))))
+                     (condition-case err
+                        (bookmark-set bookmark)
+                       (error
+                        (message (format "Bookmark set error: %S" err))))))
                 ;; If we are refiling for capture, make sure that the
                 ;; last-capture pointers point here
                 (when (bound-and-true-p org-capture-is-refiling)
                   (let ((bookmark-name (plist-get org-bookmark-names-plist
                                                   :last-capture-marker)))
                     (when bookmark-name
-                      (with-demoted-errors "Bookmark set error: %S"
-                        (bookmark-set bookmark-name))))
+                       (condition-case err
+                          (bookmark-set bookmark)
+                         (error
+                          (message (format "Bookmark set error: %S" err))))))
                   (move-marker org-capture-last-stored-marker (point)))
                  (deactivate-mark)
                 (run-hooks 'org-after-refile-insert-hook)))



reply via email to

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