From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp12.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id CGm8Ip1vHGOK1QAAbAwnHQ (envelope-from ) for ; Sat, 10 Sep 2022 13:06:05 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp12.migadu.com with LMTPS id EMmQIp1vHGPwEQEAauVa8A (envelope-from ) for ; Sat, 10 Sep 2022 13:06:05 +0200 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 387EA392B9 for ; Sat, 10 Sep 2022 13:06:05 +0200 (CEST) Received: from localhost ([::1]:49162 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oWyJI-0003sH-45 for larch@yhetil.org; Sat, 10 Sep 2022 07:06:04 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:52764) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oWyHq-0003rr-Gj for emacs-orgmode@gnu.org; Sat, 10 Sep 2022 07:04:34 -0400 Received: from ciao.gmane.io ([116.202.254.214]:60864) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oWyHo-0000YH-QC for emacs-orgmode@gnu.org; Sat, 10 Sep 2022 07:04:34 -0400 Received: from list by ciao.gmane.io with local (Exim 4.92) (envelope-from ) id 1oWyHk-0007IS-BU for emacs-orgmode@gnu.org; Sat, 10 Sep 2022 13:04:28 +0200 X-Injected-Via-Gmane: http://gmane.org/ To: emacs-orgmode@gnu.org From: Max Nikulin Subject: [PATCH] ol.el: Restore complete by description for insert link Date: Sat, 10 Sep 2022 18:04:20 +0700 Message-ID: References: Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="------------Od3N3LH92SjCVCLYTQxZ8fpl" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.11.0 Content-Language: en-US In-Reply-To: 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.25, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.25, 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-To: larch@yhetil.org X-Migadu-Country: US ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1662807965; 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:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post; bh=b6nEIhPL5brqDTrUVEqjhKWYCNkawxRgK1Ar/d7CEwk=; b=qlyexZDY/Dk2VJPgxkN37sWsdaUjdoebXjLEmCIB/OJWoJngzJJsr/WD5m/Uub4KRwzBPb vtWQrpJBbZGxKHA10gaqvGG44/gxEqe3IjQmzXIpT3tsF88Bzjhe6ITBm2cK+6rmKFrLmU LBUQ+bRo9ASBx+gu/hzCV2nRCHu5sdS9FN3hxIcSEb58x0RWwSPIUodgzVr7gE4Zuw6X8M FgBHrQ0BFrgMNdGNw44cfDWNI8GkCviKuia28zvd/Ap1OA4E//LSazrY/5BAcys8rVxUh/ LHa3Yut1FmHU8UuW6pU88KDFX7IIWu4lEOJ0YUDPBNUFudhTF3Nkk5ISVdQ9LA== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1662807965; a=rsa-sha256; cv=none; b=CRZ+LR5ZKXqHV+oZcYqiWqiYG893DzFSq5oKyHgia/t1pbhOA16jghgsplDtoJpOAnsu2u h6UFguVbvGFkJOcR4/8UF0tlK8SpsXxstexv9TH8VfSEZes+KqdU/Ttxx282a8z8HFEhdT wJxnwWyyhwVwKRt/BC+MYi8hhwvuegN+FX80YjWrl41E/ohKfUQWk9TIB0k7iIITBHRfug Tofs/XC++iogizBJ0AGVHm9nd50YS+gxq1EILIQGqRONAGME/6K400GWShgJSwVHUuaXLT llZ8svsba1e8AR1/pXu8rmp2ZH8raLe47ATSNXL4VCQcHDXyy9DNp3H3WzNyAA== 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: 5.01 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: 387EA392B9 X-Spam-Score: 5.01 X-Migadu-Scanner: scn0.migadu.com X-TUID: gTvlld8qYYi2 This is a multi-part message in MIME format. --------------Od3N3LH92SjCVCLYTQxZ8fpl Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 06/09/2022 21:34, Max Nikulin wrote: > > Does anyone have an idea why it was necessary to drop completion of > stored links based on their description for the sake of ido? I have no idea what is the proper way to enable ido for `org-insert-link'. Functions and variables specific to ido were removed from Org. (ido-everywhere) and (ido-mode) are not enough. I tried (setq-local completing-read-function #'ido-completing-read) and the command broke completing read completely. (add-function :override completing-read-function #'ido-completing-read) inspired by `ido-everywhere' code broke M-x, but it enabled ido for `org-insert-link'. I believe that descriptions as completion options were removed because ido signals an error when nil is passed inside completion list. I consider it as a bug in ido (at least in Emacs-27), but even when `completing-read-default' is used, it causes appearance of undesired "nil" option. No description is a frequent case for links. So I am attaching a patch to restore completion of link targets by their description, nil descriptions are filtered out. The change is caused by the auto-desc local variable in `org-insert-link', its usage is rather strange and confusing currently. Despite with this patch descriptions are restored, I believe that logic related to auto-desc should be removed, anyway it was broken for 10 years. I am unsure in which thread the next change should be discussed. > P.S. My question is related to the following threads: > - Carlos Pita. Adding target and custom id links doesn't ask for > description. Tue, 2 Aug 2022 14:44:58 -0300. > https://list.orgmode.org/D99A712C-18D1-4A4F-8093-35A0BFB469C4@gmail.com > - Max Nikulin. Re: Bug: org-store-link uses CUSTOM_ID instead of target > point. Sat, 6 Nov 2021 19:51:29 +0700. > https://list.orgmode.org/e2c807a7-1924-6f08-9e63-4f70aee9d3b5@gmail.com --------------Od3N3LH92SjCVCLYTQxZ8fpl Content-Type: text/x-patch; charset=UTF-8; name="0001-ol.el-Restore-complete-by-description-for-insert-lin.patch" Content-Disposition: attachment; filename*0="0001-ol.el-Restore-complete-by-description-for-insert-lin.pa"; filename*1="tch" Content-Transfer-Encoding: base64 RnJvbSA5MmUzNm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saW5rcykKKyAgICAgICAgICAgICAgICAgICAgOzsgQWxsb3cg ZGVzY3JpcHRpb24gY29tcGxldGlvbi4gIEF2b2lkICJuaWwiIG9wdGlvbgorICAgICAgICAg ICAgICAgICAgICA7OyBpbiB0aGUgY2FzZSBvZiBgY29tcGxldGluZy1yZWFkLWRlZmF1bHQn IGFuZAorICAgICAgICAgICAgICAgICAgICA7OyBhbiBlcnJvciBpbiBgaWRvLWNvbXBsZXRp bmctcmVhZCcgd2hlbiBzb21lIGxpbmtzCisgICAgICAgICAgICAgICAgICAgIDs7IGhhdmUg bm8gZGVzY3JpcHRpb24uCisgICAgICAgICAgICAgICAgICAgIChkZWxxIG5pbCAobWFwY2Fy ICdjYWRyIG9yZy1zdG9yZWQtbGlua3MpKSkKIAkJICAgbmlsIG5pbCBuaWwKIAkJICAgJ29y Zy1saW5rLS1oaXN0b3J5CiAJCSAgIChjYWFyIG9yZy1zdG9yZWQtbGlua3MpKSkKLS0gCjIu MjUuMQoK --------------Od3N3LH92SjCVCLYTQxZ8fpl--