From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp11.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id kGPbIfxLHmL0KQEAgWs5BA (envelope-from ) for ; Tue, 01 Mar 2022 17:38:20 +0100 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp11.migadu.com with LMTPS id MEEfH/xLHmLCcAEA9RJhRA (envelope-from ) for ; Tue, 01 Mar 2022 17:38:20 +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 0F52346FE2 for ; Tue, 1 Mar 2022 17:38:20 +0100 (CET) Received: from localhost ([::1]:34830 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nP5Vy-0008HB-QC for larch@yhetil.org; Tue, 01 Mar 2022 11:38:18 -0500 Received: from eggs.gnu.org ([209.51.188.92]:57254) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nP5Tv-0006eP-4q for emacs-orgmode@gnu.org; Tue, 01 Mar 2022 11:36:11 -0500 Received: from [2a00:1450:4864:20::22e] (port=45817 helo=mail-lj1-x22e.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nP5Tt-0004ww-Jf for emacs-orgmode@gnu.org; Tue, 01 Mar 2022 11:36:10 -0500 Received: by mail-lj1-x22e.google.com with SMTP id l12so10726725ljh.12 for ; Tue, 01 Mar 2022 08:36:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=sender:message-id:date:mime-version:user-agent:subject :content-language:references:to:cc:from:in-reply-to :content-transfer-encoding; bh=bmlkLNWjwaDFh077LsrBMW7HF7xCC2dqfjtkX083SLE=; b=pzWg2kWUuuTeUMQvlMy+KmHHH2M1fOmsqK+zmhlrJsCBb9Ey57nLuZvtdH61dUnNbv 1+FgjIaHkBip9EtGC7Cb7yFXXFDirEEjaDmjIUr5y49IwfdQXCwZJTUd3wNoh0FZxz8C 6dAIdfpyKWkh8tSpvQed/L4Hp9paFufU0gD1Z0lywLZg9h+h+uzb0ApsVTn0FgeAvA/Y ozI5ip7ueEQRzP60XgCVxOnZbqP8m11K3yohzfriZG7QnMazSYAveOrwavPmYFQ4l6A8 4/vNjx7s87zr2VMskDoURvOA+j5zJ+DJmrjvMXexm9f4pDwXxXrSPgtBHuSWpzn4vNkI 2Wlg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:sender:message-id:date:mime-version:user-agent :subject:content-language:references:to:cc:from:in-reply-to :content-transfer-encoding; bh=bmlkLNWjwaDFh077LsrBMW7HF7xCC2dqfjtkX083SLE=; b=VrvEq3WqjMV2hJUDYbbnBPiGW+5mgLEdBWRqUNWCy0HfX37r7RqUR59US89zFSXDwV JteTd7Eo/TETOytEyRjHnq0fpcznqiG8nc+FlUGvx7LarjEldqNzlFwyAFTpgNJUm7JF LKHlsWRBzEGpRnFljwtymRBbTrEr17cvqPoEn4KrwDEnKZv4YDiMgn0Htsrp98/XYxDK s8TJa/1DxuPHEgL916wq8cZRLGoZJ2Dbb8MAck14NgYbaxrQ0bKWucOZqpFolq48cTVz tqNvPy8iJ8kxQlr9/mW4u4uDkyurbNr6i6u4CWoTCGf5qHNS+cN4dmuIlyu5DwrGOUN1 u52w== X-Gm-Message-State: AOAM533Sjjyc70QJelxgJ4Mzgl3BTQxeerMpNFvyLspZGNjTvZzr6FIG J4xpdVjWWwo2CCQEAktAlmvM/clCNm4= X-Google-Smtp-Source: ABdhPJz1f+zGPlcmsCv+LRzWOkYbCVr4eKrzEmqnQaPLJLPzYt2UuPjpaclYsNDLcCYwoeUaqMpU+g== X-Received: by 2002:a2e:952:0:b0:246:2f08:78c2 with SMTP id 79-20020a2e0952000000b002462f0878c2mr17704514ljj.505.1646152564203; Tue, 01 Mar 2022 08:36:04 -0800 (PST) Received: from [192.168.0.101] (nat-0-0.nsk.sibset.net. [5.44.169.188]) by smtp.googlemail.com with ESMTPSA id u28-20020ac258dc000000b00443153b415esm1565395lfo.267.2022.03.01.08.36.03 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 01 Mar 2022 08:36:03 -0800 (PST) Message-ID: Date: Tue, 1 Mar 2022 23:36:02 +0700 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.5.0 Subject: Re: [BUG] org-insert-link should use DEFAULT in read-string when asking for description Content-Language: en-US References: <87sfs7jafo.fsf@gmail.com> <87h78lk917.fsf@gmail.com> <877d9g5lq5.fsf@gmail.com> To: emacs-orgmode@gnu.org From: Max Nikulin In-Reply-To: <877d9g5lq5.fsf@gmail.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Host-Lookup-Failed: Reverse DNS lookup failed for 2a00:1450:4864:20::22e (failed) Received-SPF: pass client-ip=2a00:1450:4864:20::22e; envelope-from=manikulin@gmail.com; helo=mail-lj1-x22e.google.com X-Spam_score_int: -6 X-Spam_score: -0.7 X-Spam_bar: / X-Spam_report: (-0.7 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, NICE_REPLY_A=-0.001, PDS_HP_HELO_NORDNS=0.659, RCVD_IN_DNSWL_NONE=-0.0001, RDNS_NONE=0.793, 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: , Cc: Visuwesh 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=1646152700; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc: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:dkim-signature; bh=bmlkLNWjwaDFh077LsrBMW7HF7xCC2dqfjtkX083SLE=; b=WIl1O3DJ+V4Ip+5RDlplFsuYR3ZcYmrb4k348Oof3GkO53g/0+hNqDqSuM6VjSInPE16NM l91Ke8rcU1zY+IWAJLjffWp1l4HDCT9wlmIPd0i1gpExLiudKhpFTqU1D3kUf8FRKH185m FsfLT5meHJXpBq+8MfWPOHiCETJ+pcC3Sy2j9vx135zJazKbnfnQ81oCN5AAuadDZoZJdq QycShJYUywThGKun0ENCMgBZ/391ACBV/vNuaAxE1SHnuv9DJ3NsiOTA0FhCfNAA1B+T+x Qtd67thwS+u9jN1I70EKhsERACMhIrY0T5FXTuHQ2ZsjQzWe4W0vQrhvYP1ulQ== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1646152700; a=rsa-sha256; cv=none; b=Jth+NYI/qlX9dZ0SQnODkGGy2E/gk0I7n9DphyBzMYZ1U5YTlejLdmIrklBL1LwnQgg/Xl dCpxu5jsLSEx5kXYDHAnS73dpYGf6yGCv1YQMMFamHx1oYyqhlpATuK+0g4pivFMf+WKxx 2madKnXsDRaQV9I6RY82KWvNQAtwi9Pt4zhA2LZN01bNR+xGg6j/48bQkEi1BUCc3bOHHW xSPEoSuw4SzW1T1w0Kb6m0Yd3R8i13D3Ile/+LkFjkXeXbIoOTU5N4EjEOZgLLIPKG4rg0 7Jcf3ZMPzOe3UYpDBJHZ/f0OV2jRxDMs4WgnulQE5fHmh3BxFTeBrB6gh/SvOQ== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20210112 header.b=pzWg2kWU; dmarc=fail reason="SPF not aligned (relaxed)" 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: 5.92 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20210112 header.b=pzWg2kWU; dmarc=fail reason="SPF not aligned (relaxed)" 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: 0F52346FE2 X-Spam-Score: 5.92 X-Migadu-Scanner: scn1.migadu.com X-TUID: 2EBiy23ifub5 On 27/02/2022 23:16, Visuwesh wrote: > [ஞாயிறு, பிப்ரவரி 27 2022] Max Nikulin wrote: >> 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. > > No. It is impossible to do it using read-string, but it is possible to > do it by writing a function that calls read-from-minibuffer (and I gave > an example of a function that does this). > >>> 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 >> > 2. The reason why I cited read-shell-command does not have anything > to do with the usefulness of empty string (or shell command). I > merely wanted to point out that you can have BOTH the DEFAULT > argument (and no INITIAL), and can make the empty string a valid > output from the function (i.e., without getting substituted by > the DEFAULT argument). In my opinion deprecation of the INITIAL argument without some descent replacement was a mistake. I suspect that such statement appeared without realizing of the problem with discriminating default vs. empty value. `read-string' oversimplify it by assumption that users do not need empty values at all. Your first argument was that INITIAL is deprecated but in the next message you pointed to a function that still uses the INITIAL argument. On the other hand `read-shell-command' belongs to command for which empty return value is hardly meaningful despite it is possible. That is why I disputed that `read-shell-command' is a good example of `read-from-minibuffer' usage in the context of `org-insert-link'. > Please read the docstring of read-from-minibuffer. You would be better > served by reading it than me replicating it here. And I gave > read-shell-command as an example so others could study the function. > > In essence, you can get the old behaviour (1) but you need to type M-n > beforehand. Its one more key but it is far better than the current > behaviour since it is consistent with rest of the Emacs ecosystem (see > below also). I do not think it is a good idea to require extra M-n to keep the *current* description when a user hit C-c C-l to edit the link target with no intention to touch its description. > With every command I use, when I know that the DEFAULT argument will be > of no use, I simply start typing. However, with org-insert-link I have > to clear the input _first_ then start typing. This never happens > elsewhere, even in grep (which you cite as an example)! I agree that it is great to be able to just start typing to replace default description. Unfortunately similar to significant fraction of interfaces, `org-insert-link' behavior is a result of trade-offs and compromises. If you see a way to improve it, please, submit a patch or at least post a code that can be tried from a src block or from the *scratch* buffer to evaluate possible regressions and unaddressed use cases.