From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp12.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id aJmNLztXG2J+tQAAgWs5BA (envelope-from ) for ; Sun, 27 Feb 2022 11:49:31 +0100 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp12.migadu.com with LMTPS id 0E77KztXG2ITgAEAauVa8A (envelope-from ) for ; Sun, 27 Feb 2022 11:49:31 +0100 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 90D4435202 for ; Sun, 27 Feb 2022 11:49:31 +0100 (CET) Received: from localhost ([::1]:58026 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nOH7K-0005vm-Nh for larch@yhetil.org; Sun, 27 Feb 2022 05:49:30 -0500 Received: from eggs.gnu.org ([209.51.188.92]:43588) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nOH6m-0005ve-OG for emacs-orgmode@gnu.org; Sun, 27 Feb 2022 05:48:56 -0500 Received: from ciao.gmane.io ([116.202.254.214]:51004) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nOH6l-0008P6-AL for emacs-orgmode@gnu.org; Sun, 27 Feb 2022 05:48:56 -0500 Received: from list by ciao.gmane.io with local (Exim 4.92) (envelope-from ) id 1nOH6j-00005S-A1 for emacs-orgmode@gnu.org; Sun, 27 Feb 2022 11:48:53 +0100 X-Injected-Via-Gmane: http://gmane.org/ To: emacs-orgmode@gnu.org From: Max Nikulin 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 Message-ID: References: <87sfs7jafo.fsf@gmail.com> <87h78lk917.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.5.0 Content-Language: en-US In-Reply-To: <87h78lk917.fsf@gmail.com> Received-SPF: pass client-ip=116.202.254.214; envelope-from=geo-emacs-orgmode@m.gmane-mx.org; helo=ciao.gmane.io X-Spam_score_int: 28 X-Spam_score: 2.8 X-Spam_bar: ++ X-Spam_report: (2.8 / 5.0 requ) BAYES_00=-1.9, DKIM_ADSP_CUSTOM_MED=0.001, FORGED_GMAIL_RCVD=1, FORGED_MUA_MOZILLA=2.309, FREEMAIL_FORGED_FROMDOMAIN=0.249, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.249, NICE_REPLY_A=-0.001, NML_ADSP_CUSTOM_MED=0.9, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-orgmode@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org Sender: "Emacs-orgmode" X-Migadu-Flow: FLOW_IN X-Migadu-Country: US ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1645958971; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=5UuD2sDXf5LeoB7r16Fy1eYnAZoGy33HzqhZ/ClFNq8=; b=gJ/eF/ICd7wTeZiOLxWIxYXGJqqKgIphkTWaprfsuxUUxUQdF4vM0EbIpgsX2A90MzQERz /8xbUZ2sADZbpMfYrc+sx0u8iNJWMo7IgBHMhDGE/OuT6YJsBIDYS2e+onZnP16VSUSxYN bUjYQ6LNIC4g3gW3WwodaM4NGJ7v5AueQxslg7cKQBKS7Z0YQNflEfVNkqljqvmgGiHi5B +xfQgoR7i9vXb2j27tfFblkLZRLSMw8VgwcWRZc16u9O021NxhsKXX6A7jE0r+/Ght6k8x LnyykGbfiPlQOViacfxf+1mQY6cLixMbF6zuCP8AiL8mlkjRZJRp4bVx6UEcyA== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1645958971; a=rsa-sha256; cv=none; b=oR4l4PUsiZl5wMKZYmC33s3f/0oQkn+Dr4M1NnuADdYIv3dp1GlC3rfKupB10NTHM8ixHq i3II+T2ZodltdSbtK7Bi517SLWsPoCqqbqLkqX0Wrvilx4ZMvwZ/NnQcedvBdHE+3hkl7R IAk5mqw3jdIpXuadjFkybrH3YO/AG1jE/6BlNhJLpXeuEqKd01BkCqCezQn7KKu4RcG2P+ NpWDQTbMNQzYf0wCxc4v2iKA1R5d32nWfKmsug7PcrdGTUURf0dbgJ1LVt2eC/Wkrad/qi o3gQEbuIo6yZannbS2de3SH/cycaT6kWf9RgBH1oExy/vb57+NP7QgkTkW0AZA== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=none; dmarc=fail reason="SPF not aligned (relaxed), No valid DKIM" header.from=gmail.com (policy=none); spf=pass (aspmx1.migadu.com: domain of "emacs-orgmode-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="emacs-orgmode-bounces+larch=yhetil.org@gnu.org" X-Migadu-Spam-Score: 1.89 Authentication-Results: aspmx1.migadu.com; dkim=none; dmarc=fail reason="SPF not aligned (relaxed), No valid DKIM" header.from=gmail.com (policy=none); spf=pass (aspmx1.migadu.com: domain of "emacs-orgmode-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="emacs-orgmode-bounces+larch=yhetil.org@gnu.org" X-Migadu-Queue-Id: 90D4435202 X-Spam-Score: 1.89 X-Migadu-Scanner: scn0.migadu.com X-TUID: LzMVu/rMX2Wv 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.