emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Max Nikulin <manikulin@gmail.com>
To: emacs-orgmode@gnu.org
Subject: Re: [BUG] org-insert-link should use DEFAULT in read-string when asking for description
Date: Sun, 27 Feb 2022 17:48:45 +0700	[thread overview]
Message-ID: <svfkuf$17i5$1@ciao.gmane.io> (raw)
In-Reply-To: <87h78lk917.fsf@gmail.com>

On 26/02/2022 21:16, Visuwesh wrote:
> [சனி, பிப்ரவரி 26 2022] Max Nikulin wrote:
>> Are you suggesting replacing
>>      (read-string "rs-initial: " "Some initial")
>> by
>>      (read-string "rs-default: " nil nil "Some default")
>> ?
> Yes, exactly.

However you agreed that it would be regression since empty description 
use case would be impossible.

> I admit that I forgot about this but Emacs can be made to not translate
> empty string to the default argument if you DTRT when calling
> `read-from-minibuffer' (and `read-shell-command' does this).  If writing
> a new function just to get this functionality is too much, then I guess

`read-shell-command' still has INITIAL argument and it is used by 
various callers (vc, grep). In addition, unlike for link description, I 
do not see any point in empty shell command (e.g. in vim :! allows to 
see output of previous shell command). So `read-shell-command' may 
behave quite differently.

Current way to ask for link description has the following properties:
- Almost no action (just RET) if the user happy with suggested 
description. Default description is provided with hope that it is the 
most convenient option.
- It is possible to erase everything and to get a link with no description.
- The user is free to replace default description with arbitrary 
alternative text.

It is unclear for me how to tame `read-from-minibuffer' to get equally 
convenient behavior using DEFAULT argument instead of formally 
deprecated INITIAL one.

> I can live with the current behaviour, but this inconsistency is an
> annoyance since I end up with garbled link names, which I only notice
> _afterwards_.

Sorry, but I have not figured out what particular problem you met.

  reply	other threads:[~2022-02-27 10:49 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-02-25 14:19 [BUG] org-insert-link should use DEFAULT in read-string when asking for description Visuwesh
2022-02-26  8:50 ` Max Nikulin
2022-02-26 14:16   ` Visuwesh
2022-02-27 10:48     ` Max Nikulin [this message]
2022-02-27 16:16       ` Visuwesh
2022-03-01 16:36         ` Max Nikulin

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:

  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='svfkuf$17i5$1@ciao.gmane.io' \
    --to=manikulin@gmail.com \
    --cc=emacs-orgmode@gnu.org \


* 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).