From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1.migadu.com ([2001:41d0:303:e224::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms1.migadu.com with LMTPS id IJ/zM41zMmZ7nwAA62LTzQ:P1 (envelope-from ) for ; Wed, 01 May 2024 18:53:33 +0200 Received: from aspmx1.migadu.com ([2001:41d0:303:e224::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp1.migadu.com with LMTPS id IJ/zM41zMmZ7nwAA62LTzQ (envelope-from ) for ; Wed, 01 May 2024 18:53:33 +0200 X-Envelope-To: larch@yhetil.org Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20230601 header.b=hE5ifzEm; 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" ARC-Seal: i=1; s=key1; d=yhetil.org; t=1714582413; a=rsa-sha256; cv=none; b=OEv93c1QPPkYYv3EfipzL8h9i5O6zLxRvkN/mn5YhiLI9M8tC/8zdSxBeUHx5ErnYTHlpu Y5bRdAQA4Zs405wnr6LAq7He03GM0kylXNmyIfEMBav9qcekdIYqNMgdcsXDv6UsUMe0L0 6ryXtDfzAfxqiXNppPYKiKd9G0g3bA2T0ue4eZ1Ll75F9UUuBGnbBb5QloX5nvqnW1MW2T x4djWr/FFozBLqytdS1qBzkzt5kSKpKtAqyjfHdVn/sY5lr1KqOFoJDkr+hGPoCPrbm0Fz 9H48GjTYHYzACRC3z4su5imwGVW+7eDHwUgcmlQRV4ymMDTQqjiMrRlWRZksxg== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20230601 header.b=hE5ifzEm; 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" ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1714582413; 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=k/F3kWCGrIowVhBB7Y92ifChSb0BvhU7mhS50gaMRDM=; b=eeC4qQiMrFSz3HBUZS45dNuZ+9YxDGWs/rgIfaYl+fukhhlQgjkJfTTyO7mLM6om8TzyLL 7u33T9gXwmxUjQ6KHXzR6LzDraVoiwB+EFHP+OAqaKytzTRpcLINzuyF1cUgFK+P2SMkkA L7dlklhNXNUGzM9ZrYtJHceDNBQwudvmhwHPxNxBiarxmYPsOfKnr2VwEZWZ7J/c9chtoL AOf8vohVjkxbjkl8GSTFxWP6K+ybDNcOLj9xJebMo/R+QFte+5odzM7PrUDZnygm2rJWBR KRMtTCC68d33uDUzVyFXIrdizMa5KybRo70QaKQXfPePC3lJkomjF7vwkNlMiw== 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 61FCB358A5 for ; Wed, 1 May 2024 18:53:32 +0200 (CEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1s2DCS-0007gT-7g; Wed, 01 May 2024 12:52:56 -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 1s2DCQ-0007d4-6L for emacs-orgmode@gnu.org; Wed, 01 May 2024 12:52:54 -0400 Received: from mail-pg1-x52a.google.com ([2607:f8b0:4864:20::52a]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1s2DCO-0003gE-7A for emacs-orgmode@gnu.org; Wed, 01 May 2024 12:52:53 -0400 Received: by mail-pg1-x52a.google.com with SMTP id 41be03b00d2f7-6123726725eso2884744a12.3 for ; Wed, 01 May 2024 09:52:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1714582370; x=1715187170; darn=gnu.org; h=mime-version:message-id:date:references:in-reply-to:subject:cc:to :from:from:to:cc:subject:date:message-id:reply-to; bh=k/F3kWCGrIowVhBB7Y92ifChSb0BvhU7mhS50gaMRDM=; b=hE5ifzEmxkaOuS5jf70JXxXkYsULTEmUDLoZLhJm4DRZyB1kP1EMxdDl3eP/NjYWNB wumgrHhWvvz6z7D6/JbhyF2rOpY7WjSFJwCMVs9D0kNFv/yqsuzAg6CyB3a59AlME8kd 9QT0eJ41e71//vofZ2p7df9aktBYKTIHjhF+12pqkjIfd6zQtdBODduYqD7WwkN+T66/ DiieqvgnKU0HIgoLTBxHWAWH3xUoSXpjUUVV/0Wj2WMuN+bubptACCzhrGoHGaDx2pdK 6+oD61iSaU51XuMfReDC1XPcGGXdYfvwfQjHCRrdyEu2HCWiYlRerBfBIBFjzp6JVZfX 2f5w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1714582370; x=1715187170; h=mime-version:message-id:date:references:in-reply-to:subject:cc:to :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=k/F3kWCGrIowVhBB7Y92ifChSb0BvhU7mhS50gaMRDM=; b=KTPbSUFQdESQGM/tLJhspkBm0rA/sGwUMJzMrtW/x7z53MuoE1dmWaKiN5f2x6v5I8 uY5rcBtxdtYJx8mKW+1qqkmPxHhKQRFuNvP3DMUrGqTJkK5CZJ3CSiztcsMP9uchBPxS FDMQRHwEEBy6YagNaITGGnTtz3yXyDy0yKRB8uK+hTwGT09dfJQPjJS2tyjMVZoRQ0qF IW8tSc2KjhdlaeS7GFuDuca+6BLqilfbNeCwNvb8AXgJEn2/rbA5n3Tsd73gVXmyWCAF L0hU8mfm/vlF2ts4wjQ+DPrjV3QjL4BKuWB5EqyCUg4W/au8lO2JiPabMq6dpUvD5FJ0 TgmQ== X-Gm-Message-State: AOJu0YylPOdNzSOVKD8nlodWqFSA5Yx524BkDmLW4O7gunV+wBMChzKH GKgx5nH+Ophdttr2yyXBCsPx6Ok7mWzluw/19H6OuU3z1TU5TH/nhvfOWA== X-Google-Smtp-Source: AGHT+IGc7PZA7KsAaQBOYgWCf6Y+u1/m+iUUpuW2hemkov0PCaKKzk5nZYyBTGjT1URbcZxt19oftA== X-Received: by 2002:a05:6a21:8196:b0:1aa:59ff:5902 with SMTP id pd22-20020a056a21819600b001aa59ff5902mr3526492pzb.9.1714582370106; Wed, 01 May 2024 09:52:50 -0700 (PDT) Received: from storimasta ([2804:14c:5bb1:5200::3186]) by smtp.gmail.com with ESMTPSA id c22-20020aa78816000000b006f3f9e4dfd4sm6508472pfo.60.2024.05.01.09.52.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 01 May 2024 09:52:49 -0700 (PDT) From: Bruno Cardoso To: Ihor Radchenko Cc: emacs-orgmode@gnu.org Subject: Re: [PATCH] Add support for shortdoc link type In-Reply-To: <87v83xer0d.fsf@localhost> References: <87zftatdkr.fsf@gmail.com> <87v83xer0d.fsf@localhost> Date: Wed, 01 May 2024 13:52:46 -0300 Message-ID: <87wmodtqxt.fsf@gmail.com> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Received-SPF: pass client-ip=2607:f8b0:4864:20::52a; envelope-from=cardoso.bc@gmail.com; helo=mail-pg1-x52a.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 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 X-Migadu-Queue-Id: 61FCB358A5 X-Migadu-Scanner: mx12.migadu.com X-Migadu-Spam-Score: -9.71 X-Spam-Score: -9.71 X-TUID: W/q/Z7eUp7UC --=-=-= Content-Type: text/plain Hi Ihor, Thanks for your comments. See attached the updated patch. --=-=-= Content-Type: text/x-patch Content-Disposition: inline; filename=0001-ol-support-for-shortdoc-link-type.patch diff --git a/doc/org-manual.org b/doc/org-manual.org index d66d95a22..c9e307c94 100644 --- a/doc/org-manual.org +++ b/doc/org-manual.org @@ -3372,6 +3372,10 @@ Here is the full set of built-in link types: Execute a shell command upon activation. +- =shortdoc= :: + + Link to short documentation summary for a function group. + For =file:= and =id:= links, you can additionally specify a line number, or a text search string, separated by =::=. In Org files, you @@ -3413,6 +3417,7 @@ options: | irc | =irc:/irc.com/#emacs/bob= | | help | =help:org-store-link= | | info | =info:org#External links= | +| shortdoc | =shortdoc:text-properties= | | shell | =shell:ls *.org= | | elisp | =elisp:(find-file "Elisp.org")= (Elisp form to evaluate) | | | =elisp:org-agenda= (interactive Elisp command) | diff --git a/etc/ORG-NEWS b/etc/ORG-NEWS index 8dbc3292d..cfe894448 100644 --- a/etc/ORG-NEWS +++ b/etc/ORG-NEWS @@ -1357,6 +1357,10 @@ place the entry in the ~Misc~ category if ~TEXINFO_DIR_CATEGORY~ is missing. =TEXINFO_DIR_TITLE= is renamed to =TEXINFO_DIR_NAME=. The old name is obsolete. +*** =ol.el=: Support for ~shortdoc~ link type + +Add support for storing and inserting links to ~shortdoc~ groups. + ** New functions and changes in function arguments *** New optional argument =UPDATE-HEADING= for ~org-bibtex-yank~ diff --git a/lisp/ol.el b/lisp/ol.el index f6d656982..b7b988581 100644 --- a/lisp/ol.el +++ b/lisp/ol.el @@ -1598,6 +1598,30 @@ PATH is a symbol name, as a string." :follow #'org-link--open-help :store #'org-link--store-help) +;;;; "shortdoc" link type + +(when (version< "27" emacs-version) + (defun org-link--open-shortdoc (group _) + "Open a \"shortdoc\" type link. +GROUP is a symbol name." + (if (assoc (intern group) shortdoc--groups) + (shortdoc-display-group group) + (user-error "Unknown shortdoc group: %s" group))) + + (defun org-link--store-shortdoc (&optional _interactive?) + (when (eq major-mode 'shortdoc-mode) + (let* ((buffer (buffer-name)) + (group (when (string-match "*Shortdoc \\(.*\\)\\*" buffer) + (match-string 1 buffer)))) + (when (assoc (intern group) shortdoc--groups) + (org-link-store-props :type "shortdoc" + :link (format "shortdoc:%s" group) + :description nil))))) + + (org-link-set-parameters "shortdoc" + :follow #'org-link--open-shortdoc + :store #'org-link--store-shortdoc)) + ;;;; "http", "https", "mailto", "ftp", and "news" link types (dolist (scheme '("ftp" "http" "https" "mailto" "news")) (org-link-set-parameters scheme --=-=-= Content-Type: text/plain On 2024-05-01, 11:00 +0000, Ihor Radchenko wrote: > Bruno Cardoso writes: > >> This patch adds support for "shortdoc:" links. > > Thanks! > >> --- a/etc/ORG-NEWS >> +++ b/etc/ORG-NEWS > > You also need to document the new built-in link type in the manual. > >> +(defun org-link--open-shortdoc (group _) >> + "Open a \"shortdoc\" type link. >> +GROUP is a symbol name." >> + (if (assoc (intern group) shortdoc--groups) >> + (shortdoc group) >> + (user-error "Unknown shortdoc group: %s" group))) > > `shortdoc' function was only introduced in Emacs 29. > In Emacs 28, there is only `shortdoc-display-group'. > Please use the latter function, when `shortdoc' is not available. > > In Emacs 27, shortdoc library is not yet present. So, please avoid > defining shortdoc: link type in Emacs <28. > > -- > Ihor Radchenko // yantar92, > Org mode contributor, > Learn more about Org mode at . > Support Org development at , > or support my work at --=-=-=--