|
From: | Max Nikulin |
Subject: | Re: [PATCH v2] Re: Adding target and custom id links doesn't ask for description |
Date: | Sun, 14 Aug 2022 16:53:50 +0700 |
User-agent: | Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.11.0 |
On 13/08/2022 12:01, Ihor Radchenko wrote:
See the updated version of the patch attached. It works on my side. --- 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)))
I can not say that I understand design of `org-store-link` and `org-insert-link' pair, but I suspect that you might try to fix the issue in a wrong place.
It seems the same :link and :description value were set for purpose, see `org-insert-link' code:
(dolist (l org-stored-links) (when (equal link (cadr l)) (setq link (car l)) (setq auto-desc t))) However I am puzzled by (unless auto-descI would say that namely the same :link and :description should cause query to default description and user prompt.
I may be wrong. Maybe the protocol of communication between these functions may be documented with more details.
[Prev in Thread] | Current Thread | [Next in Thread] |