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 ms9.migadu.com with LMTPS id sCVeF6ZNpWQ09gAASxT56A (envelope-from ) for ; Wed, 05 Jul 2023 13:01:58 +0200 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 mABQF6ZNpWQgfwAA9RJhRA (envelope-from ) for ; Wed, 05 Jul 2023 13:01:58 +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 0AB6511FEA for ; Wed, 5 Jul 2023 13:01:58 +0200 (CEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qH0Fl-0005IT-Vz; Wed, 05 Jul 2023 07:00:58 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qH0Fj-0005GV-H9 for emacs-orgmode@gnu.org; Wed, 05 Jul 2023 07:00:55 -0400 Received: from mout02.posteo.de ([185.67.36.66]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qH0Fg-0000Vb-70 for emacs-orgmode@gnu.org; Wed, 05 Jul 2023 07:00:55 -0400 Received: from submission (posteo.de [185.67.36.169]) by mout02.posteo.de (Postfix) with ESMTPS id F220D240104 for ; Wed, 5 Jul 2023 13:00:49 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1688554850; bh=8iWAISrSSJItOn18qTeqiZm7gabA/BWGoBJAcixyUwY=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version:From; b=qd6rZqZC6N6AF+47zn5s8PeDpWY2mhvZOFuaTFgWeXzc8bK/KRcozkRr40fmTd5I8 A3aXj1YC8R8er8V3B4JgIfs4gfbSnVUlreEVqi2Mf01R4Y+woX6Ht0lpuXkdJvq623 PWbHOEih9R/FeCEDfC1jYfUVDE9Pn9iezIm61iHMHKjF3F3Oe1TV4oWat1AbzOF+ix 3xWvNuhNpn+emgfu0tn+ZpJxLZH25r+c4nVDQbMl7//vQScGdVEfeH1ZB2IEeoalZS Odaxg0ojo/px6CzuprnwJYHsb5lXm5rZuEvxHrv1/xqRPEbXC+AxKCrUuPjLKo74v/ sXJBf5peVCYKw== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4QwxXd0NPnz9rxR; Wed, 5 Jul 2023 13:00:48 +0200 (CEST) From: Ihor Radchenko To: Samuel Wales Cc: Max Nikulin , emacs-orgmode@gnu.org Subject: Re: org-insert-link completion by description (Re: what is the purpose of "This link has already been stored"?) In-Reply-To: References: <87cz18f2g1.fsf@localhost> Date: Wed, 05 Jul 2023 11:00:46 +0000 Message-ID: <871qhmaaht.fsf@localhost> MIME-Version: 1.0 Content-Type: text/plain Received-SPF: pass client-ip=185.67.36.66; envelope-from=yantar92@posteo.net; helo=mout02.posteo.de X-Spam_score_int: -43 X-Spam_score: -4.4 X-Spam_bar: ---- X-Spam_report: (-4.4 / 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, RCVD_IN_DNSWL_MED=-2.3, RCVD_IN_MSPIKE_H5=0.001, RCVD_IN_MSPIKE_WL=0.001, 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-bounces+larch=yhetil.org@gnu.org X-Migadu-Country: US X-Migadu-Flow: FLOW_IN ARC-Seal: i=1; s=key1; d=yhetil.org; t=1688554918; a=rsa-sha256; cv=none; b=GQxc5L85OEZw45IwNeby59sJJBbP7Mthp6p9e8xzzL4jtIkSw2f5+VGjM3k9OjKv1Jzicr 5nLI4rpTL2aj55WpanUMXnzrfLgTTaI1C+s7+eqnMUGNOMpsyo7sels+QzNNjd5CghQYxA j10fxym6IrC/H1XzikrCs6FzhOF9JfO38o2Z9oboxzsCBjDy/oAtbPhjHTHX4KOuKdZGPE /xwHrMfSXjQFEOx6W09492wLZqtlq34LWdD4pu3e6antWpEkuLNGnOWcUuKt3br9KtPWsV ap67c1mFIdi8oG4gtwa/DqSngikLugzxixg1k1dfZJJSHUgfRmUuwtosa+Uxjg== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=posteo.net header.s=2017 header.b=qd6rZqZC; dmarc=pass (policy=none) header.from=posteo.net; 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" ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1688554918; 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:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=d1bALcalqmnnISY61ihWI66ygL2YbdkxaBKBJW5KD0Y=; b=N5Daw5gx1SGXGr9nw7rDki5C2g4M6B1Uim5TIfNRUBLNnz6n97RhTlJlfNZpTJaTxuh/Eg oBJ/G4Kstvw9efgCArkXSguHgP0siecTYMFpS1kBytk0ngONa5z8S5v2qpMNBbko+qHNMq 1Whokyp4+rKowZ5D/t4lAQSA/2bTAriv4m9krDXoV1adtOlXLEES+ZJm8xkGyOU1DIIGhD u7f/WkHjx3jXa5n1geMusOK/BrbQkA2xafFcSvdkA1ZumApmd+FlQMX282Fyy6lxD81nFg BUQg8voHezRtDE4A0yReMfZiHR46L4vdbIZGnOWIOf+bknbxCL0FNQoJmgzxzg== Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=posteo.net header.s=2017 header.b=qd6rZqZC; dmarc=pass (policy=none) header.from=posteo.net; 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-Scanner: scn0.migadu.com X-Migadu-Spam-Score: -11.24 X-Spam-Score: -11.24 X-Migadu-Queue-Id: 0AB6511FEA X-TUID: Z5Frojv9whN/ Samuel Wales writes: >>> this buffer contains nothing useful and shortens the above buffer. >> >> This is fine. I assume that you can simply hide it away using >> `display-buffer-alist'. > > i have struggled with this in a wider context and gotten nowhere for years. (add-to-list 'display-buffer-alist `("*Org Links*" display-buffer-no-window (allow-no-window . t))) You may also find https://www.masteringemacs.org/article/demystifying-emacs-window-manager and https://www.gnu.org/software/emacs/manual/html_node/elisp/The-Zen-of-Buffer-Display.html useful. >> Org shows link prefixes, stored links, and link description in the >> completion. The relevant code in `org-insert-link' is: > > what is the purpose of the prefixes? When inserting a link, you do not always need to insert a stored link. Various link types can have completion function specific to a link type. For example, I arranged my id: links to use org-ql for completion. That way I can insert id: links searching across all the agenda files via org-ql. > where is the description in this case? was it a bare link? that is > unusual for an id link. >> (org-completing-read >> "Link: " >> (append >> (mapcar (lambda (x) (concat x ":")) all-prefixes) The above corresponds to link prefixes. >> (mapcar #'car org-stored-links) Each element of `org-stored-links' is (path description). car in org-stored-links elements are bare links (link path). >> ;; Allow description completion. Avoid "nil" option >> ;; in the case of `completing-read-default' and >> ;; an error in `ido-completing-read' when some links >> ;; have no description. >> (delq nil (mapcar 'cadr org-stored-links))) cadr in org-stored-links elements are descriptions. So, the completion should offer (1) all the link types; (2) all the link paths; (3) all the link descriptions. You can try to run this code manually to see. You can also remove different parts in the (append ...) to experiment. >> Completing descriptions feature has been added by Max 10 months ago - it >> is a fairly recent addition: > > please note that it is of course not my intention to criticize anybody > or anybody's code. merely saying what i need. max is trying to be > helpful. iu am not even sure how we got on this topic as my original > report was the already stored bug. That's not a problem. We already changed the subject of this spin-off thread. The original bug report is separate. > in the context of mindless store/insert, which is what i do most > frequently, if the most recently stored is set to the completion > default, this topic is moot as presumably others agree this is > desirable. in the context of choosing a different link from the > default, the short url-like prefixes being there in front of specific > links confuses me. So, your suggestion is to move link descriptions and paths before the link types in the completion list? > then there is the more fancy question of grabbing random links from > all over your org files in order to paste them all in one place which > i will not cover here. I hope that M-x org-insert-all-links caters this need. >> This commit is a part of Org 9.6. >> May it be that you are using older Org version? > > 9.6.7, most recent bugfix. comments apply to vanilla. May you please elaborate what you mean by "comments apply to vanilla"? -- Ihor Radchenko // yantar92, Org mode contributor, Learn more about Org mode at . Support Org development at , or support my work at