From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp10.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id iKsVG4c2GmIkpwAAgWs5BA (envelope-from ) for ; Sat, 26 Feb 2022 15:17:43 +0100 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp10.migadu.com with LMTPS id kF2zE4c2GmJTEgAAG6o9tA (envelope-from ) for ; Sat, 26 Feb 2022 15:17:43 +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 DB3302C046 for ; Sat, 26 Feb 2022 15:17:42 +0100 (CET) Received: from localhost ([::1]:49088 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nNxtF-0005JF-J1 for larch@yhetil.org; Sat, 26 Feb 2022 09:17:41 -0500 Received: from eggs.gnu.org ([209.51.188.92]:57564) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nNxsY-0005J6-8I for emacs-orgmode@gnu.org; Sat, 26 Feb 2022 09:16:58 -0500 Received: from [2607:f8b0:4864:20::1042] (port=44983 helo=mail-pj1-x1042.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nNxsW-0003mH-8X for emacs-orgmode@gnu.org; Sat, 26 Feb 2022 09:16:57 -0500 Received: by mail-pj1-x1042.google.com with SMTP id cp23-20020a17090afb9700b001bbfe0fbe94so7357828pjb.3 for ; Sat, 26 Feb 2022 06:16:55 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version:content-transfer-encoding; bh=JP3JZGa1tSsyQVGCk26RupPVWZ+0TZ1U8DJo5I8sy3w=; b=Bju9tHc1KO1AAwhPVfAp4clc49WJ2GxLF5uRgc731VvRFa4tso8nRtzHbxL3Tj8MnQ uHI0v8QF5JNUWGaWa9X+YVdFKJzSbOjDJR6DAno2ZUTtVzl5fcvBjN3jhTdLe5Bi5PZ3 dtrkeXhorbdeKfC54CI69LYSlog7T5kqwLZp2TZO0P9jNDJVCjxxt/iOudtkW2+cyzSD OV8amD8bcSHudyKPNlH5xUdxhbzxg9BnTalm0/kZvusxVf7UCcICpNvP2qt6kKE7SOFF fw/TgU9Mkbku0Y+pnd5k1d7bxV6iqXBR7JqSYM7zwhFkWnJPZFEbxFzpvITw3jT1CHR/ OKFw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version:content-transfer-encoding; bh=JP3JZGa1tSsyQVGCk26RupPVWZ+0TZ1U8DJo5I8sy3w=; b=rHWnsceLkXM7O+mMT9AEqjv/g5XiIWvvVxYM0py+q5XL9oCtl0PMKJfdtCyjQgR2UG oMTTI6c5Y6jadcDn85IN77iuByGoNBbzbHpk7l3em6UyjbFlc2yI1SbU57G+IO73vmMS ACaDc3KieL9uWB7C8dCj2Sx/mgSqWuZ43BJD42dKKNhyj8EAWME8krVHLxTpZMLb90bb dNRjYdbGRj3xsTTfDBKIc3prGgEE27hAcxWrzd9qntaCKb1sBA02phMlJL/ds5tFCVW4 PI3KoaPaI8jsT9lvxeinP2Of+KRUb8dcB2sLxYfnYPjNaOOiJHZ5q9wlMLzM8/3qE6yd uaYQ== X-Gm-Message-State: AOAM530utAEpL3l6lSQ8WNpWSs2BdlJKW07u5rShCX6aVllogDawoYXB bTVpXyFJOxaibD6pM3fXyew= X-Google-Smtp-Source: ABdhPJwiRqm+AONXxtroU9QJooNQGE8oBy+qJKn/5QOPeegndtAma1xXqTL/caY3xxHaQ3WAOfdbyg== X-Received: by 2002:a17:90a:588c:b0:1b8:91a6:6cdf with SMTP id j12-20020a17090a588c00b001b891a66cdfmr8108428pji.239.1645885014879; Sat, 26 Feb 2022 06:16:54 -0800 (PST) Received: from localhost ([118.185.152.162]) by smtp.gmail.com with ESMTPSA id f3-20020a056a00238300b004e0a002ec80sm7665961pfc.10.2022.02.26.06.16.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 26 Feb 2022 06:16:54 -0800 (PST) From: Visuwesh To: Max Nikulin Subject: Re: [BUG] org-insert-link should use DEFAULT in read-string when asking for description References: <87sfs7jafo.fsf@gmail.com> Date: Sat, 26 Feb 2022 19:46:36 +0530 In-Reply-To: (Max Nikulin's message of "Sat, 26 Feb 2022 15:50:29 +0700") Message-ID: <87h78lk917.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Host-Lookup-Failed: Reverse DNS lookup failed for 2607:f8b0:4864:20::1042 (failed) Received-SPF: pass client-ip=2607:f8b0:4864:20::1042; envelope-from=visuweshm@gmail.com; helo=mail-pj1-x1042.google.com X-Spam_score_int: 27 X-Spam_score: 2.7 X-Spam_bar: ++ X-Spam_report: (2.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, PDS_HP_HELO_NORDNS=0.659, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_SBL_CSS=3.335, 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: emacs-orgmode@gnu.org 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=1645885062; 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=JP3JZGa1tSsyQVGCk26RupPVWZ+0TZ1U8DJo5I8sy3w=; b=P3cHUFsEgZIGe2N6lDhhgCvYQCsKagOHKz3v9Ro2pq3v1iyjXzOS8VfwJXIIfjWNfQwh0k R6ZbJGnDPlFpXSHs/ECKZoJpcBoGojoIDnPkHe84++s+tyrJbBLBd9FAIMUekSPH9og0lI q/opTDksV2PmlxZj0zOKnhBYIGipUc5RCUA+DBx7kvdjCOGZMNeBeRjzCCl9DEzOz0OIIo oVe2f0k2Zw3urcrq8XKGOwaaDnGCxfbhKnj1LAHeTYaE9sTmgfn9tTqi6e0LPC+H1s/XEQ PskYj7wZOdkfo4zv+YIX0gkUIVmRg9Dux2RaB/jDvJiRJEYYN/aPymCmbNWv9A== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1645885062; a=rsa-sha256; cv=none; b=WnDHAIx6yuTEUYtyB/IuuJtq3G45A+RnNiOmuOtPL4m5VWb+cyEvoNdRx2OULfDyxyAWiX i11ESKt6dQzDLnl0ZQtFC7as3u4PwudDOp3gwIGZQySxRxX+Zxqln/zmJz2gWQq0iOo6+F YDYvt6NzemarR8BgDYjjl2dMZiBr7tbdN4Q1VjXc+Byj0ti5TTtaUqbeIoTsiVOEtm/Rrg 1iaRbg8lyWDEbHfBGKmfFTYMI7EM06vo7Riv0eyKul6tT9+kwlZVuO+aCRbxNGrfxm8cGS aDaiwd3iDg85il17nl4M88uT/SzLEWwsItaBeNIobt9B6vSqw+GglcVxuFYExg== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=Bju9tHc1; dmarc=pass (policy=none) header.from=gmail.com; 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: -6.32 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=Bju9tHc1; dmarc=pass (policy=none) header.from=gmail.com; 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: DB3302C046 X-Spam-Score: -6.32 X-Migadu-Scanner: scn0.migadu.com X-TUID: JYhx0c9kG8jw [=E0=AE=9A=E0=AE=A9=E0=AE=BF, =E0=AE=AA=E0=AE=BF=E0=AE=AA=E0=AF=8D=E0=AE=B0= =E0=AE=B5=E0=AE=B0=E0=AE=BF 26 2022] Max Nikulin wrote: > On 25/02/2022 21:19, Visuwesh wrote: >> Currently, when asking the user for the description of link, >> `org-insert-link' calls `read-string' with a non-nil INITIAL-INPUT but >> this argument is discouraged and deprecated; moreover, it is unfriendly. >> `org-insert-link' should, ideally, use the DEFAULT argument. If the >> user decides that the suggested description is okay, they can type M-n. > > Due to lack of experience with emacs I can miss something. If so, > please, correct me. > > Are you suggesting replacing > (read-string "rs-initial: " "Some initial") > by > (read-string "rs-default: " nil nil "Some default") > ? Yes, exactly. > Is it possible to override provided default description by empty > string in the latter variant? Currently it is possible to erase > description using just backspace or C-S-backspace. > 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 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_. > P.S. Many GUI applications pre-select whole value when some input > field is focused, so it is possible to overwrite current value by > typing anything. It may be convenient but is not consistent with emacs > behavior. Moreover it makes uncertain if visually selected text > overwrites X PRIMARY selection. I would rather not go there. You seem to describe `delete-selection-mode' which, IMO, is also a nuisance given how mark+point is not the same as "regular selections" (even with `transient-mark-mode' turned on).