From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp12.migadu.com ([2001:41d0:403:58f0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms8.migadu.com with LMTPS id CHtUHg9JdmWwPAAAauVa8A:P1 (envelope-from ) for ; Mon, 11 Dec 2023 00:26:07 +0100 Received: from aspmx1.migadu.com ([2001:41d0:403:58f0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp12.migadu.com with LMTPS id CHtUHg9JdmWwPAAAauVa8A (envelope-from ) for ; Mon, 11 Dec 2023 00:26:07 +0100 X-Envelope-To: larch@yhetil.org Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=me.com header.s=1a1hai header.b=qHSmW+PY; 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"; dmarc=pass (policy=quarantine) header.from=me.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1702250766; 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=XIW9bV/ltvWBoTd4ydvxwm4TBYNP3yLPauRzyBAyrIM=; b=XF4w+qQmsyijHK1OmYCWofxy7x9Zaz2B7ciFfRR/qJVScxpO8X7h1VhPJyp2WcEqcim8BB 9P+H/a9VxHd7lf7lwNp5jESGHi5EerE/0XKmj4P8ERSb5b1cNhjD3i8s1gi16/WS4zV+tT bBUq8HBqsIX1+fpsnUrx7paoBQSv+9XNsX0EtDHRl7JuJepvCMzUZvm89k4oKRtu/QxRhm yKfGhbUvNuZ2rdVtCjEQzjJiJg1jUI4RSc/WomwTVupGSCfVwN9Dr5I9iV9t5rb6dk4RrK iX9znEeJJMvlLlVqernTwbJ218SoeVec7jce/RSMuKR1eZALPNOD4OkaeHS86A== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1702250766; a=rsa-sha256; cv=none; b=oOIowyq5jAm4L4Sn8n36Qz57St5lTCK8TQlnHO3dlQL0ocYAbNfaXXJjb/i6Oo23HPCoBA bMRo1sCH0/cXChypCXvAvfe4yH5pqywXVO3uhibGgNojKZkuZnXz5Ruk6LM6Ni9FT2/AfP KJldlQUMxKhVavuIee74V+Ywv4L5g4ixBRLQhVuwb/65fuO2CunjDfkpApfxSusg0k0NJZ FSm0FU8EIWIz6ubyYfsh+LDeaKum1hDX2Co4PP1LjwcTqUjFHdMT3lZ/GeyiMmXctxkB5M Q7kHShkqLkqSSFifIKM0OJnJ8BFVCORdjIBK7B2/bQ0hZ20X1pK5nOlgPRys3Q== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=me.com header.s=1a1hai header.b=qHSmW+PY; 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"; dmarc=pass (policy=quarantine) header.from=me.com 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 764263F30C for ; Mon, 11 Dec 2023 00:26:06 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rCTAb-0003RN-6B; Sun, 10 Dec 2023 18:25:09 -0500 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 1rCTAZ-0003RD-Vh for emacs-orgmode@gnu.org; Sun, 10 Dec 2023 18:25:07 -0500 Received: from mr85p00im-zteg06021601.me.com ([17.58.23.187]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rCTAY-0000N1-5u for emacs-orgmode@gnu.org; Sun, 10 Dec 2023 18:25:07 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=me.com; s=1a1hai; t=1702250704; bh=XIW9bV/ltvWBoTd4ydvxwm4TBYNP3yLPauRzyBAyrIM=; h=From:To:Subject:Date:Message-ID:MIME-Version:Content-Type; b=qHSmW+PYcjFhpedGgh9jlYMz0dj5bqwulelBYRTR/pKC1yVHcEVDc0ImwUJcbe3Zr AavOgPPxc35T2WuHw4V6D9JkJqX6C6PnZPMGIiVQ2Nt0u7NjIH1muB7FwNpTsefvdC RcHyDwB4AmcoGSEE6VOtMXEw2EWk0oZ6uu9cQGLevy3oZsEOHG9zusIEZk++jVWDEL 9IsYjbPIbf5UKjiFm5nu6FVkmEKeYuTzdpXbkAFE672UeEf/2Gtn60VkOwVKSWxBiN bDE5DIlvDHT3XK8KQfDW0pthFfp7KoyF8W8b+AFiRQ4vyGmgCVGOiEoGen9xvENFhS QC66kAcOG7Mxw== Received: from Rudolfs-MacBook-Air.local (mr38p00im-dlb-asmtp-mailmevip.me.com [17.57.152.18]) by mr85p00im-zteg06021601.me.com (Postfix) with ESMTPSA id A56D530585B0; Sun, 10 Dec 2023 23:25:03 +0000 (UTC) From: Rudolf =?utf-8?Q?Adamkovi=C4=8D?= To: Ihor Radchenko Cc: Salih Muhammed , emacs-orgmode@gnu.org Subject: Re: Consider removing newlines from org-insert-link help message In-Reply-To: <87edfuqhgt.fsf@localhost> References: <87o7gxbx66.fsf@gmx.com> <87h6mpfrk2.fsf@localhost> <87h6moncj6.fsf@gmx.com> <87fs25bhmv.fsf@localhost> <87edfuqhgt.fsf@localhost> Date: Mon, 11 Dec 2023 00:25:00 +0100 Message-ID: MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Proofpoint-ORIG-GUID: yaUgLvJxX2HmTkhWi1FHpZtmdhHv-CJg X-Proofpoint-GUID: yaUgLvJxX2HmTkhWi1FHpZtmdhHv-CJg X-Proofpoint-Virus-Version: =?UTF-8?Q?vendor=3Dfsecure_engine=3D1.1.170-22c6f66c430a71ce266a39bfe25bc?= =?UTF-8?Q?2903e8d5c8f:6.0.425,18.0.816,17.11.62.513.0000000_definitions?= =?UTF-8?Q?=3D2022-01-18=5F01:2022-01-14=5F01,2022-01-18=5F01,2021-12-02?= =?UTF-8?Q?=5F01_signatures=3D0?= X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 adultscore=0 suspectscore=0 malwarescore=0 spamscore=0 mlxlogscore=456 mlxscore=0 clxscore=1015 phishscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2308100000 definitions=main-2312100206 Received-SPF: pass client-ip=17.58.23.187; envelope-from=salutis@me.com; helo=mr85p00im-zteg06021601.me.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 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_LOW=-0.7, RCVD_IN_MSPIKE_H4=-0.01, RCVD_IN_MSPIKE_WL=-0.01, 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-Flow: FLOW_IN X-Migadu-Country: US X-Migadu-Spam-Score: -2.71 X-Spam-Score: -2.71 X-Migadu-Queue-Id: 764263F30C X-Migadu-Scanner: mx11.migadu.com X-TUID: G8MYKjhnw/4/ --=-=-= Content-Type: text/plain Ihor Radchenko writes: > You can just use `org-format-prompt'. TIL! Updated. Thank you! P.S. I have also updated the commit message. Rudy --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=0001-org-link-Improve-UX-of-org-insert-link.patch >From aa947b42186fca813d3fcc702f7f5daa554980f3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rudolf=20Adamkovi=C4=8D?= Date: Sun, 10 Dec 2023 00:51:31 +0100 Subject: [PATCH] org-link: Improve UX of 'org-insert-link' * lisp/ol.el (org-insert-link): Shorten the text in the *Org Links* buffer to avoid unnecessary line breaks, reword it to better align with the rest of Emacs, and propertize its key bindings to improve readability. Further, move the default link to the minibuffer, as seen elsewhere in Emacs, and make the *Org Links* buffer read-only. --- lisp/ol.el | 40 +++++++++++++++++++++++++++++----------- 1 file changed, 29 insertions(+), 11 deletions(-) diff --git a/lisp/ol.el b/lisp/ol.el index c38a30378..bd89415e8 100644 --- a/lisp/ol.el +++ b/lisp/ol.el @@ -1868,16 +1868,34 @@ non-interactively, don't allow to edit the default description." (org-link--fontify-links-to-this-file) (org-switch-to-buffer-other-window "*Org Links*") (with-current-buffer "*Org Links*" - (erase-buffer) - (insert "Insert a link. -Use TAB to complete link prefixes, then RET for type-specific completion support\n") - (when org-stored-links - (insert "\nStored links are available with / or M-p/n \ -\(most recent with RET):\n\n") - (insert (mapconcat #'org-link--prettify - (reverse org-stored-links) - "\n"))) - (goto-char (point-min))) + (read-only-mode 1) + (let ((inhibit-read-only t) + ;; FIXME Duplicate: Also in 'ox.el'. + (propertize-help-key + (lambda (key) + ;; Add `face' *and* `font-lock-face' to "work + ;; reliably in any buffer", per a comment in + ;; `help--key-description-fontified'. + (propertize key + 'font-lock-face 'help-key-binding + 'face 'help-key-binding)))) + (erase-buffer) + (insert + (apply 'format + (cons "Type %s to complete link type, then %s to complete destination.\n" + (mapcar propertize-help-key + (list "TAB" "RET"))))) + (when org-stored-links + (insert (apply 'format + (cons "\nStored links accessible with %s/%s or %s/%s are:\n\n" + (mapcar propertize-help-key + (list "" "" + "M-p" "M-n" + "RET"))))) + (insert (mapconcat #'org-link--prettify + (reverse org-stored-links) + "\n")))) + (goto-char (point-min))) (when (get-buffer-window "*Org Links*" 'visible) (let ((cw (selected-window))) (select-window (get-buffer-window "*Org Links*" 'visible)) @@ -1892,7 +1910,7 @@ Use TAB to complete link prefixes, then RET for type-specific completion support org-link--insert-history))) (setq link (org-completing-read - "Link: " + (org-format-prompt "Insert link" (caar org-stored-links)) (append (mapcar (lambda (x) (concat x ":")) all-prefixes) (mapcar #'car org-stored-links) -- 2.39.3 (Apple Git-145) --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable --=20 "Mathematics takes us still further from what is human into the region of absolute necessity, to which not only the actual world, but every possible world, must conform." --- Bertrand Russell, 1902 Rudolf Adamkovi=C4=8D [he/him] Studenohorsk=C3=A1 25 84103 Bratislava Slovakia --=-=-=--