From 668205f7693e028f15240ffc043e037b411daf81 Mon Sep 17 00:00:00 2001 From: Stefan Monnier Date: Fri, 4 Feb 2022 19:39:53 -0500 Subject: [PATCH] Backport commit d52c929e3 from Emacs * lisp/org-refile.el (org-refile): * lisp/org-capture.el (org-capture-store-last-position): Pass `format` arg to `with-demoted-errors`. (with-demoted-errors): Warn on missing `format` arg d52c929e31f60ff0462371bfe27ebd479e3e82bd Stefan Monnier Fri Feb 4 19:39:53 2022 -0500 [km] with-demoted-errors has had a format argument since Emacs 24.4. Passing it avoids an error when compiling with Emacs's current master (bug#54225). Once that bug is resolved, it will prevent a warning. --- lisp/org-capture.el | 3 ++- lisp/org-refile.el | 8 ++++---- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/lisp/org-capture.el b/lisp/org-capture.el index 945ea5298..bfead3aa5 100644 --- a/lisp/org-capture.el +++ b/lisp/org-capture.el @@ -1453,7 +1453,8 @@ 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 bookmark))))) + (when bookmark (with-demoted-errors "Bookmark set error: %S" + (bookmark-set bookmark))))) (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 5dfffe785..5ad73422e 100644 --- a/lisp/org-refile.el +++ b/lisp/org-refile.el @@ -566,16 +566,16 @@ 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 bookmark-name)))) + (with-demoted-errors "Bookmark set error: %S" + (bookmark-set bookmark-name)))) ;; 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 bookmark-name)))) + (with-demoted-errors "Bookmark set error: %S" + (bookmark-set bookmark-name)))) (move-marker org-capture-last-stored-marker (point))) (when (fboundp 'deactivate-mark) (deactivate-mark)) (run-hooks 'org-after-refile-insert-hook)))