Evgenii Klimov <eugene....@lipklim.org> writes:

> * lisp/ol.el (org-insert-link): Keep the link in `org-stored-links' if
> the command was interrupted by the user during the reading of a
> description from the minibuffer.
> ---
> Currently the link is lost if the user chooses the link but cancells
> the comand while writing the description.

Thanks!
This makes sense, but the patch may break removing stored link in
certain scenarios.

> -    (when (funcall (if (equal complete-file '(64)) 'not 'identity)
> -                (not org-link-keep-stored-after-insertion))
> -      (setq org-stored-links (delq (assoc link org-stored-links)
> -                                org-stored-links)))
> -
>      (when (and (string-match org-link-plain-re link)
>              (not (string-match org-ts-regexp link)))
>        ;; URL-like link, normalize the use of angular brackets.
> @@ -1995,6 +1990,10 @@ Use TAB to complete link prefixes, then RET for 
> type-specific completion support
>                       (read-string "Description: " initial-input)
>                     initial-input)))

The code below the removed form can modify `link' variable. If such
modification does happen, your patch will fail to remove the link from
`org-stored-links' - (assoc link org-stored-links) will no longer return
non-nil.
 

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at <https://orgmode.org/>.
Support Org development at <https://liberapay.com/org-mode>,
or support my work at <https://liberapay.com/yantar92>

Reply via email to