mirror of
https://git.savannah.gnu.org/git/emacs/org-mode.git
synced 2024-08-25 00:32:54 +00:00
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
This commit is contained in:
parent
5b3a1a634c
commit
94c2c8d929
|
@ -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)
|
||||
|
|
|
@ -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)))
|
||||
|
|
Loading…
Reference in a new issue