Bastien <b...@gnu.org> writes: > Ihor Radchenko <yanta...@posteo.net> writes: > >> * lisp/ol.el (org-link-store-existing): New customization controlling >> how to deal with already stored links. >> (org-store-link): Respect the new customization, allowing duplicates >> to (1) be added anyway; (2) be ignored; (3) be moved to front of >> `org-stored-links'. The default is (3). >> * etc/ORG-NEWS (~org-store-link~ now moves an already stored link to >> front of the ~org-stored-links~): Document the breaking change. > > I'm not sure what is the real world use-case for allowing storing the > same link several times. Maybe one was provided, but I missed it.
I added it mostly because it was easy to do. Also, I thought that one might do a sequence of M-x org-store-link as one is reading things in different buffers. Later, M-x org-insert-all-links would insert the stored links from history, even if reading involved back-and-forth switching of the same buffer. This is rather imaginary use case though. > I believe the new default behavior makes a lot of sense, thanks for > implementing this. > > I'm skeptical about the need for a new dedicated option, though. > > The current single universal prefix argument seems not that useful ("A > single `C-u' negates `org-context-in-file-links' for file links or > `org-gnus-prefer-web-links' for links to Usenet articles.") and we > could use it to force storing duplicates, which is more useful. This would be yet another breaking change... > Here is the suggested new behavior, also modifying other universal > prefix args: > > - M-x org-stored-links : don't store dups, move upfront if dup > - C-u M-x org-stored-links : force storing the link, even if dup > - [2 universal prefix arg] : negates ‘org-context-in-file-links’, etc > - [3 universal prefix arg] : forces skipping storing functions > that are not part of Org core. > > The current behavior for 3 prefix args should be the default when the > region is active. > > WDYT? AFAIU, you suggest changing the meaning of C-u prefix argument and also remove the previous default behavior completely. As I said in the above, storing duplicates is rather imaginary case. I am not sure if it is strictly more useful compared to the current negation of `org-context-in-file-links'. For removing the previous default (do nothing when duplicate), Samuel previously expressed a concern: >>> if you move the recent one to top of list, that would work for my >>> mindless store/insert, but it might not work for a user who has >>> carefully cultivated a set of links that are all to be inserted, or >>> such. although idk if the mechanism supports. -- 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>