Ihor Radchenko writes: > Evgenii Klimov writes: > [...] >> - (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. I added `link-original' variable to keep it intact until we want to remove the link from `org-stored-links'.