From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0.migadu.com ([2001:41d0:403:58f0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms1.migadu.com with LMTPS id aObkDfGjP2Zt2gAAqHPOHw:P1 (envelope-from ) for ; Sat, 11 May 2024 18:59:29 +0200 Received: from aspmx1.migadu.com ([2001:41d0:403:58f0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0.migadu.com with LMTPS id aObkDfGjP2Zt2gAAqHPOHw (envelope-from ) for ; Sat, 11 May 2024 18:59:29 +0200 X-Envelope-To: larch@yhetil.org Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20230601 header.b=k56Q8STj; 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=1715446769; 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=JvHRjl+ITrpAtrZojWEzrfHBfg/ohLIF7GwNhXc/XrA=; b=Ji7ACTwtVUodV4IRTiOPi1godHoUHKN/PhvqBPk/riAMCmwNkKKwTXBQafhIH+9SuuO8mv 1FWs6gkn2HW7J+PKFIbQ4uhxL5HH+FKetUIDVZelZmwYVAWJsoISl67riotAfLap1HXm1O iWYsckGY+qhyk1VAJOSLi76Kx3kty/t7gxZ9Vpyypd58EcTxxuprqYjnkAFJx58pJ7XWyX dA+B2wehp73LMGSw0O1arVpkzzBijcvL81wVBpUBldXZ2maO30XDfcgzXNyLDaJ9JYko1P ALwcS9u+kyY9hbDG5cNlrW/ilYMrpTJMWezhM1/Ue71ieD+tS1nZqi0lx2CTuw== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1715446769; a=rsa-sha256; cv=none; b=fyz96GLMHyZOvJI2dKKvEyIhS1IuWHEYLScI4AVWKKU/cExLKEpObcjrMQsHUzo9losA/R XEch9AQc8WQDGoVrmmCMc55kaX0sttu39kSgo29R4nNlt9KZFbE61D62CDJtYRo/nW7Zh4 4ubvCBDBn/RRVrTFokhp453PQJLx62D2cxQ43lOsw2w8et/GCYDfLuLkMYnwOB1La4S6Pm x2elL+AtY3tWMm2MivProL+TIxqNfgUdmeAhdbzKwnFRfK0KnrwaLEsRsNKhgO2VbL6xN4 AFnsJmhsozkYbiSEDBuOUaNKbbLZ6/CCMmW7UCKVYCdWmxQ1z5dJBgoU/2xOkg== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20230601 header.b=k56Q8STj; 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" 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 E43283ED63 for ; Sat, 11 May 2024 18:59:28 +0200 (CEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1s5q3o-0002Fu-Bi; Sat, 11 May 2024 12:59:01 -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 1s5q3e-0002Av-Ay for emacs-orgmode@gnu.org; Sat, 11 May 2024 12:58:52 -0400 Received: from mail-oo1-xc2d.google.com ([2607:f8b0:4864:20::c2d]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1s5q3b-0003H3-TW for emacs-orgmode@gnu.org; Sat, 11 May 2024 12:58:50 -0400 Received: by mail-oo1-xc2d.google.com with SMTP id 006d021491bc7-5b290669b0fso838343eaf.2 for ; Sat, 11 May 2024 09:58:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1715446725; x=1716051525; darn=gnu.org; h=mime-version:message-id:date:references:in-reply-to:subject:to:from :from:to:cc:subject:date:message-id:reply-to; bh=JvHRjl+ITrpAtrZojWEzrfHBfg/ohLIF7GwNhXc/XrA=; b=k56Q8STj59Q1Y0e2hjoHu9dNN+0YhUlOgilQ+gN6yKgAqxOvkRzhIVx7KDAbLTNPi4 JdpUrlFvK+iGqP0p8nEC7hOC5nm4iyr+IwUzw8Uz3quZyKxJPc+JwU9FEzlc5PFGPn/9 YVVGwvztqm8WtZvwJ6Kn6o5FtzcfYypGRoF9csVxAWQmqapL1fX909r4w9BGZVFvMg63 JbbDux7RmZxLM3eLaGZWAMaaTf375V95d+jx4cTQdVR8Sj/KmXW4+qNDj+0VzF2o/pxZ ltuNyw+okDVJIie6Iho1cQoJll7Hs6pXhxQY0x7uCd0XRZOOcnacKMdp7jXLVGFEP79a 852w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1715446725; x=1716051525; h=mime-version:message-id:date:references:in-reply-to:subject:to:from :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=JvHRjl+ITrpAtrZojWEzrfHBfg/ohLIF7GwNhXc/XrA=; b=MUQRJ4ojZPUAM424iSdJ52SW+iBJuTH9EWsQG2O6P/G2O50XdCizCwbHtePDIDdtRC vIAiixz6UGUHceaj/NJ821WF5bdmG5OT5E5Rzx7Un2TjRHJ6Je1jyihvz5l9R+RyGSO6 aorcsOOcdM1KOJpWQ/VNm9L9J/Xxko5SX2MBoiDeSliNc52e3KGjGFfLNkYBkkGqJrEN XqLJZARrVlU0QkbL7VLnREp8OL1sbktsXofaNPRIDS4xKeH38EDt6jgJv0d5SeAHV0vX +15xfEPScn5POo7/ilNQa8QKqDB8CbAPqaqg+yGvBw2rKmDYi30pS14LiqPw/e3BF0/D dQNg== X-Forwarded-Encrypted: i=1; AJvYcCWIoA8tdxS377nOgvkhi4nlr50cblNpEQdyKsVaFvSKeGu2cEBByORMDKgzuNj6tdYfRY0H5s6pyNK4ZycisTQo1gLUeCE= X-Gm-Message-State: AOJu0YzqS5oerFyRnBJfVvhdrFZVy6JbNixXyaH9tvZeiZFMVnVijdA1 76mgxAz9xumbDoE4mhehCeUkk2qcGpwvH4e4YrM5WDp/E8TdvGa1XwtuhA== X-Google-Smtp-Source: AGHT+IHUnemuJomdU34mfo7fZhRfKa/eei2mYW4maFbzPLGfMDOERScpc9FQXhbCdK6TRA70sbACsg== X-Received: by 2002:a05:6358:5203:b0:18d:7755:8214 with SMTP id e5c5f4694b2df-193bd001894mr664904955d.28.1715446725480; Sat, 11 May 2024 09:58:45 -0700 (PDT) Received: from storimasta ([2804:14c:5bb1:5200::3186]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-2b62886cf36sm6976178a91.30.2024.05.11.09.58.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 11 May 2024 09:58:44 -0700 (PDT) From: Bruno Cardoso To: Max Nikulin , emacs-orgmode@gnu.org Subject: Re: [PATCH] Add support for shortdoc link type In-Reply-To: References: <87zftatdkr.fsf@gmail.com> <87v83xer0d.fsf@localhost> <87wmodtqxt.fsf@gmail.com> <875xvxs9hi.fsf@localhost> <87ttjhtjx1.fsf@gmail.com> <4b69d3b8-cfe7-4ba2-b9b5-872bcaeb6fe6@gmail.com> <87v83uefpd.fsf@gmail.com> <87h6fdeb3i.fsf@gmail.com> <9f6bbe0f-7cc2-4d55-a77d-331c8f71bb2c@gmail.com> <87y18ondrt.fsf@gmail.com> <938098de-6933-4668-85b0-fbfbc02dd949@gmail.com> <87v83pnm56.fsf@gmail.com> <87seysnggb.fsf@gmail.com> Date: Sat, 11 May 2024 13:58:41 -0300 Message-ID: <87ttj4i8u6.fsf@gmail.com> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Received-SPF: pass client-ip=2607:f8b0:4864:20::c2d; envelope-from=cardoso.bc@gmail.com; helo=mail-oo1-xc2d.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-Flow: FLOW_IN X-Migadu-Country: US X-Migadu-Spam-Score: -6.70 X-Spam-Score: -6.70 X-Migadu-Queue-Id: E43283ED63 X-Migadu-Scanner: mx11.migadu.com X-TUID: wMaCrQ+jbi5C --=-=-= Content-Type: text/plain On 2024-05-10, 18:09 +0700, Max Nikulin wrote: > Thank you for the explanation. Reading "lists all" I expected something > like list of all info manuals in the case of M-x info RET when there are > no info buffers yet. I see. I replaced the term "lists all" with "shows all" to avoid this confusion. > The following garbage in - garbage out case is a bit confusing: > > => "No such documentation group " Fixed the error handling and the error message. > Bruno, has you signed the copyright form? This patch is above the > TINYCHANGE limit. > I haven't yet. Will be glad to. > It will be a bit less work for the maintainer if you attach result of > "git format-patch" command. It adds email-like headers allowing to > properly set commit author. The attached patch is now in this format. --=-=-= Content-Type: text/x-patch Content-Disposition: inline; filename=0001-ol-support-for-shortdoc-link-type.patch >From 57ab6be64e227fcab24ad4c5b84873ed4e946cff Mon Sep 17 00:00:00 2001 From: Bruno Cardoso Date: Sat, 11 May 2024 13:42:56 -0300 Subject: [PATCH] Add support for shortdoc link type ol.el: Add support for `shortdoc' link type * lisp/ol.el (org-link--open-shortdoc org-link--store-shortdoc) (org-link--complete-shortdoc): Add support for storing and inserting links to `shortdoc' documentation groups for Emacs Lisp functions. * doc/org-manual.org (External Links): Add shortdoc link type documentation. * etc/ORG-NEWS (=ol.el=: Support for =shortdoc= link type): Document the new feature. --- doc/org-manual.org | 11 +++++++++++ etc/ORG-NEWS | 5 +++++ lisp/ol.el | 41 +++++++++++++++++++++++++++++++++++++++++ 3 files changed, 57 insertions(+) diff --git a/doc/org-manual.org b/doc/org-manual.org index f9d4c9a3f..8e99652b5 100644 --- a/doc/org-manual.org +++ b/doc/org-manual.org @@ -3382,6 +3382,15 @@ Here is the full set of built-in link types: Execute a shell command upon activation. +- =shortdoc= :: + + Link to short documentation summary for an Emacs Lisp function group. + Since Emacs 28, user command ~shortdoc-display-group~ shows all known + documentation groups. + + For more information, see [[info:emacs#Name Help][Name Help]] + and [[info:elisp#Documentation Groups][Documentation Groups]]. + For =file:= and =id:= links, you can additionally specify a line number, or a text search string, separated by =::=. In Org files, you @@ -3423,6 +3432,8 @@ options: | irc | =irc:/irc.com/#emacs/bob= | | help | =help:org-store-link= | | info | =info:org#External links= | +| shortdoc | =shortdoc:text-properties= | +| | =shortdoc:text-properties::#get-pos-property= | | 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 36eeddda1..9b7ba96ba 100644 --- a/etc/ORG-NEWS +++ b/etc/ORG-NEWS @@ -1428,6 +1428,11 @@ 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= documentation +groups for Emacs Lisp functions. + ** 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 3d64b41b0..6b84957f4 100644 --- a/lisp/ol.el +++ b/lisp/ol.el @@ -1582,7 +1582,47 @@ PATH is a symbol name, as a string." :follow #'org-link--open-help :store #'org-link--store-help) +;;;; "shortdoc" link type +(when (version<= "28.0.90" emacs-version) + (defun org-link--open-shortdoc (path _) + "Open a \"shortdoc\" type link. +PATH is a group name, \"group::#function\" or \"group::search string\"." + (string-match "\\`\\([^:]*\\)\\(?:::\\(.*\\)\\'\\)?" path) + (let* ((group (match-string 1 path)) + (str (match-string 2 path)) + (fn (and str + (eq ?# (string-to-char str)) + (intern-soft (substring str 1))))) + (condition-case nil + (progn + (shortdoc-display-group group fn) + (and str (not fn) (search-forward str nil t))) + (error (message "Unknown shortdoc group or malformed link: `%s'" + path))))) + + (defun org-link--store-shortdoc (&optional _interactive?) + "Store \"shortdoc\" type link." + (when (eq major-mode 'shortdoc-mode) + (let* ((buffer (buffer-name)) + (group (when (string-match "*Shortdoc \\(.*\\)\\*" buffer) + (match-string 1 buffer)))) + (if (and group (assoc (intern-soft group) shortdoc--groups)) + (org-link-store-props :type "shortdoc" + :link (format "shortdoc:%s" group) + :description nil) + (user-error "Unknown shortdoc group: %s" group))))) + + (defun org-link--complete-shortdoc () + "Create a \"shortdoc\" link using completion." + (concat "shortdoc:" + (completing-read "Shortdoc summary for functions in: " + (mapcar #'car shortdoc--groups)))) + + (org-link-set-parameters "shortdoc" + :follow #'org-link--open-shortdoc + :store #'org-link--store-shortdoc + :complete #'org-link--complete-shortdoc)) + ;;;; "http", "https", "mailto", "ftp", and "news" link types (dolist (scheme '("ftp" "http" "https" "mailto" "news")) (org-link-set-parameters scheme -- 2.45.0 --=-=-=--