From: Kyle Meyer <email@example.com>
To: John Kitchin <firstname.lastname@example.org>
Cc: org-mode-email <email@example.com>
Subject: [PATCH] ol: Avoid initial input when completing function for storing link
Date: Sat, 02 Jan 2021 22:13:58 GMT [thread overview]
Message-ID: <firstname.lastname@example.org> (raw)
John Kitchin writes:
> Recently I have had an issue where multiple functions may store a link,
> e.g. to a bibtex entry.
> In this case, org-mode seems to prompt me to ask which function to store
> the link with, with an initial input of the first function, which masks all
> the options that are available. This happens inside org-store-link in ol.el
> at line 1495 for me. in
> (apply #'org-link-store-props
> (cdr (assoc-string
> "Which function for creating the link? "
> (mapcar #'car results-alist)
> nil t (symbol-name name))
> because of the (symbol-name name).
> Is there an easy way to avoid this, or to modify the order of the functions
> used? I want to see all the options for storing, or better, to just store
> them all and let me choose later when I use org-insert-link.
The "or better" sounds reasonable. Perhaps someone will attempt that,
but in the meantime I think just avoiding the discouraged/mostly
deprecated INITIAL-INPUT argument would be a good improvement.
-- >8 --
Subject: [PATCH] ol: Avoid initial input when completing function for storing
* lisp/ol.el (org-store-link): Use completing-read's DEF argument
rather than INITIAL-INPUT, which is discouraged (see Elisp manual) and
may hide the other choices depending on the completion framework.
Reported-by: John Kitchin <email@example.com>
lisp/ol.el | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/lisp/ol.el b/lisp/ol.el
index 5ba813142..cf105786f 100644
@@ -1496,9 +1496,9 @@ (defun org-store-link (arg &optional interactive?)
- "Which function for creating the link? "
- (mapcar #'car results-alist)
- nil t (symbol-name name))
+ (format "Store link with (default %s): " name)
+ (mapcar #'car results-alist)
+ nil t nil nil (symbol-name name))
(setq link (plist-get org-store-link-plist :link))
next prev parent reply other threads:[~2021-01-02 22:14 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-01-02 13:49 what do do when multiple functions store a link John Kitchin
2021-01-02 14:37 ` Daniele Nicolodi
2021-01-02 14:55 ` John Kitchin
2021-01-02 22:13 ` Kyle Meyer [this message]
2021-01-05 5:16 ` [PATCH] ol: Avoid initial input when completing function for storing link Kyle Meyer
2021-04-25 3:38 ` Timothy
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:
List information: https://www.orgmode.org/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
* 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
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).