branch: externals/org
commit aa3724dbde66c7a9438a82de83f8f5799f6f1304
Author: Ihor Radchenko <yanta...@posteo.net>
Commit: Ihor Radchenko <yanta...@posteo.net>

    org-capture: Obsolete `org-capture-bookmark' in favor of 
`org-bookmark-names-plist'
    
    * lisp/org-capture.el (org-capture-bookmark):
    * lisp/org-compat.el (org-capture-bookmark): Mark obsolete.
    * lisp/org-capture.el (org-capture-store-last-position): Add comment
    about obsoletion.
    * doc/org-manual.org (Using capture): Mention
    `org-bookmark-names-plist' instead of `org-capture-bookmark'.
    
    Reported-by: Tim Wichmann <schw...@arcor.de>
    Link: https://orgmode.org/list/87bk8r2ig1.fsf@localhost
---
 doc/org-manual.org  |  4 ++--
 lisp/org-capture.el | 10 +++-------
 lisp/org-compat.el  | 10 ++++++++++
 3 files changed, 15 insertions(+), 9 deletions(-)

diff --git a/doc/org-manual.org b/doc/org-manual.org
index 1a025a1396..1aaab27e9f 100644
--- a/doc/org-manual.org
+++ b/doc/org-manual.org
@@ -7822,10 +7822,10 @@ with prefix commands:
 
   Visit the last stored capture item in its buffer.
 
-#+vindex: org-capture-bookmark
+#+vindex: org-bookmark-names-plist
 #+vindex: org-capture-last-stored
 You can also jump to the bookmark ~org-capture-last-stored~, which is
-automatically created unless you set ~org-capture-bookmark~ to ~nil~.
+automatically created unless you customize ~org-bookmark-names-plist~.
 
 To insert the capture at point in an Org buffer, call ~org-capture~
 with a {{{kbd(C-0)}}} prefix argument.
diff --git a/lisp/org-capture.el b/lisp/org-capture.el
index c2a157780a..c95ce7c728 100644
--- a/lisp/org-capture.el
+++ b/lisp/org-capture.el
@@ -501,12 +501,6 @@ The capture buffer is current and still narrowed."
   :version "24.1"
   :type 'hook)
 
-(defcustom org-capture-bookmark t
-  "When non-nil, add bookmark pointing at the last stored position when 
capturing."
-  :group 'org-capture
-  :version "24.3"
-  :type 'boolean)
-
 ;;; The property list for keeping information about the capture process
 
 (defvar org-capture-plist nil
@@ -1506,7 +1500,9 @@ Of course, if exact position has been required, just put 
it there."
                  (point))))))
     (with-current-buffer (buffer-base-buffer (current-buffer))
       (org-with-point-at pos
-       (when org-capture-bookmark
+        ;; FIXME: `org-capture-bookmark' is obsolete.  To be removed
+        ;; in future Org releases.
+       (when (with-no-warnings org-capture-bookmark)
          (let ((bookmark (plist-get org-bookmark-names-plist :last-capture)))
            (when bookmark
               (condition-case err
diff --git a/lisp/org-compat.el b/lisp/org-compat.el
index 9bd4370a9a..a16d732add 100644
--- a/lisp/org-compat.el
+++ b/lisp/org-compat.el
@@ -776,6 +776,16 @@ See `org-link-parameters' for documentation on the other 
parameters."
   (org-unbracket-string "<" ">" s))
 (make-obsolete 'org-remove-angle-brackets 'org-unbracket-string "9.0")
 
+(defcustom org-capture-bookmark t
+  "When non-nil, add bookmark pointing at the last stored position when 
capturing."
+  :group 'org-capture
+  :version "24.3"
+  :type 'boolean)
+(make-obsolete-variable
+ 'org-capture-bookmark
+ "use `org-bookmark-names-plist' instead."
+ "9.7")
+
 (defcustom org-publish-sitemap-file-entry-format "%t"
   "Format string for site-map file entry.
 You could use brackets to delimit on what part the link will be.

Reply via email to