emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Ihor Radchenko <yantar92@posteo.net>
To: Bastien <bzg@gnu.org>
Cc: Anthony Carrico <acarrico@memebeam.org>, emacs-orgmode@gnu.org
Subject: Re: [PATCH] Re: what is the purpose of "This link has already been stored"?
Date: Tue, 08 Aug 2023 09:04:33 +0000	[thread overview]
Message-ID: <87leelrjku.fsf@localhost> (raw)
In-Reply-To: <874jlcovnw.fsf@gnu.org>

Bastien <bzg@gnu.org> writes:

> Ihor Radchenko <yantar92@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>


  parent reply	other threads:[~2023-08-08  9:05 UTC|newest]

Thread overview: 52+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-06-28  1:35 what is the purpose of "This link has already been stored"? Samuel Wales
2023-06-28  9:32 ` Ihor Radchenko
2023-06-28 16:19   ` Anthony Carrico
2023-06-28 16:48     ` Ihor Radchenko
2023-06-28 23:59   ` Samuel Wales
2023-06-29  0:04     ` Samuel Wales
2023-06-29  0:07       ` Samuel Wales
2023-06-29 10:28         ` Ihor Radchenko
2023-06-29 13:02           ` Anthony Carrico
2023-06-29 13:09             ` Ihor Radchenko
2023-06-30  3:00               ` Samuel Wales
2023-06-30  3:26                 ` Samuel Wales
2023-07-05 10:19               ` [PATCH] " Ihor Radchenko
2023-07-06  0:28                 ` Samuel Wales
2023-07-15 12:35                 ` Ihor Radchenko
2023-07-21  4:13                   ` Samuel Wales
2023-07-21  7:46                     ` Ihor Radchenko
2023-08-06 18:47                 ` Bastien
2023-08-06 20:53                   ` Samuel Wales
2023-08-08  9:08                     ` Ihor Radchenko
2023-08-08  9:04                   ` Ihor Radchenko [this message]
2023-08-08 13:37                     ` Bastien Guerry
2023-08-11  9:31                       ` Ihor Radchenko
2023-08-13  9:34                         ` Bastien Guerry
2023-08-13 10:32                           ` Ihor Radchenko
2023-08-14  0:36                             ` Samuel Wales
2023-08-14 10:19                               ` Ihor Radchenko
2023-08-14 10:51                           ` Ihor Radchenko
2023-08-14 16:29                             ` Bastien Guerry
2023-08-15 10:55                               ` Ihor Radchenko
2023-08-16 13:20                                 ` Bastien Guerry
2023-07-01  4:48 ` org-insert-link completion by description (Re: what is the purpose of "This link has already been stored"?) Max Nikulin
2023-07-01  5:15   ` Samuel Wales
2023-07-01  5:26     ` Samuel Wales
2023-07-01  6:12     ` Max Nikulin
2023-07-02  3:29       ` Max Nikulin
2023-07-02  5:02         ` Samuel Wales
2023-07-02  5:52           ` Max Nikulin
2023-07-02  6:03             ` Samuel Wales
2023-07-03 14:56               ` Max Nikulin
2023-07-03 23:28                 ` Samuel Wales
2023-07-03 23:42                   ` Samuel Wales
2023-07-03 23:48                   ` Samuel Wales
2023-07-03 23:49                     ` Samuel Wales
2023-07-03 23:50                       ` Samuel Wales
2023-07-04  0:27                         ` Samuel Wales
2023-07-04  0:28                           ` Samuel Wales
2023-07-04  1:45                             ` Max Nikulin
2023-07-04  2:29                               ` Samuel Wales
2023-07-04  9:31                                 ` Ihor Radchenko
2023-07-05  0:10                                   ` Samuel Wales
2023-07-05 11:00                                     ` Ihor Radchenko

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87leelrjku.fsf@localhost \
    --to=yantar92@posteo.net \
    --cc=acarrico@memebeam.org \
    --cc=bzg@gnu.org \
    --cc=emacs-orgmode@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).