From 4a2079f237f5d23bfa83c2481f34d3bff27dd3e8 Mon Sep 17 00:00:00 2001 Message-Id: <4a2079f237f5d23bfa83c2481f34d3bff27dd3e8.1660109574.git.yantar92@gmail.com> From: Ihor Radchenko Date: Wed, 10 Aug 2022 13:25:26 +0800 Subject: [PATCH] org-store-link: Default to empty description for target/custom-id links * lisp/ol.el (org-store-link): Use empty description by default (ask user). Fixes https://orgmode.org/list/D99A712C-18D1-4A4F-8093-35A0BFB469C4@gmail.com --- lisp/ol.el | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/lisp/ol.el b/lisp/ol.el index b7d74d0bf..29e0d3319 100644 --- a/lisp/ol.el +++ b/lisp/ol.el @@ -1577,10 +1577,8 @@ (defun org-store-link (arg &optional interactive?) t)))) (setq link (plist-get org-store-link-plist :link)) ;; If store function actually set `:description' property, use - ;; it, even if it is nil. Otherwise, fallback to link value. - (setq desc (if (plist-member org-store-link-plist :description) - (plist-get org-store-link-plist :description) - link))) + ;; it, even if it is nil. Otherwise, fallback to nil (ask user). + (setq desc (plist-get org-store-link-plist :description))) ;; Store a link from a remote editing buffer. ((org-src-edit-buffer-p) @@ -1697,9 +1695,7 @@ (defun org-store-link (arg &optional interactive?) (and org-id-link-to-org-use-id (org-entry-get nil "ID")))) (setq link (condition-case nil (prog1 (org-id-store-link) - (setq desc (or (plist-get org-store-link-plist - :description) - ""))) + (setq desc (plist-get org-store-link-plist :description))) (error ;; Probably before first headline, link only to file. (concat "file:" -- 2.35.1