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 ms5.migadu.com with LMTPS id iDQzAXDmHGP9CwAAbAwnHQ (envelope-from ) for ; Sat, 10 Sep 2022 21:33:04 +0200 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 2ERCAHDmHGNFsAAAG6o9tA (envelope-from ) for ; Sat, 10 Sep 2022 21:33:04 +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 8DB0C27517 for ; Sat, 10 Sep 2022 21:33:03 +0200 (CEST) Received: from localhost ([::1]:53358 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oX6Du-00030j-F1 for larch@yhetil.org; Sat, 10 Sep 2022 15:33:02 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:58526) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oX6DP-0002wT-AK for emacs-orgmode@gnu.org; Sat, 10 Sep 2022 15:32:31 -0400 Received: from mail-pf1-x42a.google.com ([2607:f8b0:4864:20::42a]:44889) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oX6DM-0005yc-1o for emacs-orgmode@gnu.org; Sat, 10 Sep 2022 15:32:31 -0400 Received: by mail-pf1-x42a.google.com with SMTP id j12so4755679pfi.11 for ; Sat, 10 Sep 2022 12:32:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:message-id:in-reply-to:date:subject:to:from:user-agent :references:from:to:cc:subject:date; bh=Bkfuj10VzLrOH7gWa8VLOgibxqW3IF1NDu9tJI8DECM=; b=kqYb9CVCLFvPJwDRle8nmJRgkywKWkBmcn8WIB7L9lUg7/sLFrEmARgpFI/awmv8dk NgFdyyng2dECE237IhSO7fI1bazjutY+Z1Jmu+secLh6kQTi0SnfNgK2UX+RCP51B/OB 6nhic6z5CkpBVDCQn1gO22Z+PGXoItLBHriG5XdtUwHEmIhfdaHLUzs6G3pkyjA390sn PqufNd9MaYUC99/1okTBcSr7j/NTGDDVlRjGc3Kz81/Z1EM8XNNHOgNl5UDd0/X7bsEV Oo5n8dIEZbwQE5rO/aQa88yaa32m1KYo0QOcGR/3Cj4xsgmPCfYxRKVFubR9cjS7G+6Y ZKPg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=mime-version:message-id:in-reply-to:date:subject:to:from:user-agent :references:x-gm-message-state:from:to:cc:subject:date; bh=Bkfuj10VzLrOH7gWa8VLOgibxqW3IF1NDu9tJI8DECM=; b=GMPKsM9WaVk88XnBWkyvxAMHPWkj5voAFbKbLh4MJ9zvUpOAngDVg40wPU17JcoEo+ CzgvhEKPxKgVZzHyBOoYTWQi+P66IqKaS07pwKG7eZOC2+GC/gXePV0etdfcNt8lebf0 QtXFr/GqvaVhNpzco8Ql9N7DNZGzGG1zBlfqm462Nqr3ORg/6AjtUzrdp0GSF5PTxlNC thpvITfJE2BnqdexWlAe5aRrkvCMfKPnrxKdaUnzMGxfHCL6ewJPWEhR2fA6JaqnFiQg qWXx3e4ZhZ/jmYpFjkfz+N8RrjV+DsCkmYxxn3UQ4uPgJVoWzvSPwBzTr4ZZJB78FLhp 75Xg== X-Gm-Message-State: ACgBeo3aLX7TrSElkJ7QyMQNql52GfGbIzDOKDdGMxkDUbx1MiMOGK5c 8tJLeQJZNjaJFZQ5dlqLYXeBtZ5lFLk= X-Google-Smtp-Source: AA6agR6dE8m6X3RbjEYtlVJIRIdQQT8aft7q4EFBG+k4cCDBdE8jEM2Vsa681uLBqNA1+ONStDrDxA== X-Received: by 2002:aa7:88d1:0:b0:53a:9088:157c with SMTP id k17-20020aa788d1000000b0053a9088157cmr20017717pff.78.1662838346131; Sat, 10 Sep 2022 12:32:26 -0700 (PDT) Received: from dingbat (2001-44b8-31f2-bb00-842a-7361-87c7-2662.static.ipv6.internode.on.net. [2001:44b8:31f2:bb00:842a:7361:87c7:2662]) by smtp.gmail.com with ESMTPSA id h15-20020a170902f54f00b00172f1d0825esm2670299plf.113.2022.09.10.12.32.24 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 10 Sep 2022 12:32:25 -0700 (PDT) References: User-agent: mu4e 1.9.0; emacs 29.0.50 From: Tim Cross To: emacs-orgmode@gnu.org Subject: Re: [PATCH] ol.el: Restore complete by description for insert link Date: Sun, 11 Sep 2022 05:19:09 +1000 In-reply-to: Message-ID: <86r10jdnzv.fsf@gmail.com> MIME-Version: 1.0 Content-Type: text/plain Received-SPF: pass client-ip=2607:f8b0:4864:20::42a; envelope-from=theophilusx@gmail.com; helo=mail-pf1-x42a.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 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, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham 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=1662838383; 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:dkim-signature; bh=Bkfuj10VzLrOH7gWa8VLOgibxqW3IF1NDu9tJI8DECM=; b=gonoGhG+TZnIJnRrKgDRfw2f8ujbhNfVYSw3OG5pPHEisE7FmPbbYN2bwAhUTk6+yU1nXG 6K71LbkfbiYvrjwn5N5Ph4LOijQyv4YrCllzYURsxhOGg1lX8LGFDiRu3yFcewfW0Cb8Cj tc3ITkrt7crZJxT0jbMY1UF0ganPfr6v3lwilP+VhpqOnGMYL1bx4CoRUn2E75RHxkuKCo lbxWGU1n4DKPUUrgDbF/AeGBANKGTL0bYgBY4uv7S7Vkuj4D31nTLHdo0AjizrZyLOBjaA 4bYdvGRST5dKYnX3yaYSUqRF5oH9sp4VaZDO/vrpnJlIWzQbMJZ2uF/icn7LEw== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1662838383; a=rsa-sha256; cv=none; b=mZgNluK+4qb+/sesUBFpxJMCKYARcC1qJsqEKVIZFCHw869zdLzdz6EyDOHcAv8zYB9mui NQ8dN2jQa719177okI2DQpbzlPUGIoFgjrdw6mYS5y55UsINls8Gxo0gVO4EyJwj1+mR0J y0sPbczTgmgDyobI2EF+qe+2wj0oAADfjHYxpiib8FHWF4Wp3UOe3ZZRh5x2fyJLWcqD3D ve7O5HUrqD2sP4uYCwlno9UskYEDH0PRvXvyI/1ecCrqXFc9EB3+hWg9Lw7PMijVNnxotX JxkO5wIIV4RYIqvFVUwU/wQslEtjhU/6O+65DbRLcbRLXJwFW8OJXKmWorETDA== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=kqYb9CVC; 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: -3.79 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=kqYb9CVC; 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: 8DB0C27517 X-Spam-Score: -3.79 X-Migadu-Scanner: scn1.migadu.com X-TUID: 0jab9jRZDO2p Max Nikulin writes: > 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 > > [2. text/x-patch; 0001-ol.el-Restore-complete-by-description-for-insert-lin.patch]... You don't appear to be getting a lot of feedback on this. However, I think it is important work your doing. I suspect the lack of feedback is partially due to Emacs' completion infrastructure being somewhat confusing, combined with references to ido, which I suspect is one of the less popular completion frameworks these days. . My take on this, which might be completely wrong, is that org-mode should not cater for or support any specific completion framework. Things like ido, icomplete, fido, vertico, corfu, et. al. are something which should be supported in a generic and abstract manner i.e. we just provide minimal necessary code to generate the candidates these systems use. From your description, I think this is what your doing. Perhaps the requirements might become clearer if you also tried other completion frameworks, like fido, icomplete and vertico. I think there has been a fair bit of work in this area in recent versions of Emacs (i.e. Emacs 28). I also quite like packages like vertico, corfu and embark because unlike other frameworks, they work hard to be based on just core Emacs features/functionality and avoid adding new libraries or re-implementing existing functionality in a new library. THis tends to make the smaller and with better core Emacs compatibility (main reason I don't like helm and to a lesser extent, ivy).