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-desc

I 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.


Reply via email to