From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2.migadu.com ([2001:41d0:303:e16b::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms1.migadu.com with LMTPS id UFBpCly3MWaOiAAAe85BDQ:P1 (envelope-from ) for ; Wed, 01 May 2024 05:30:36 +0200 Received: from aspmx1.migadu.com ([2001:41d0:303:e16b::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2.migadu.com with LMTPS id UFBpCly3MWaOiAAAe85BDQ (envelope-from ) for ; Wed, 01 May 2024 05:30:36 +0200 X-Envelope-To: larch@yhetil.org Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20230601 header.b=mJb3CHMI; 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=none) header.from=gmail.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1714534236; 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:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=7gIe6/BAbYElWijNh+GTFAczuIrSOu0GLmDqEovpeuQ=; b=t6vu4a7Ckr1AdbPzIajVOl/0+C5smvZlihyGxRkMyhYumbLACrAUimYcaK2zoh8bGWeK2n ZW9bteIkRJRR6xwveoeP9yy14G4lg6GgvQswz8boxtzvlIBZv8Pu22FqU2agtqfPHPKXWN js/LFAXLLQiLRVzCHCFOVFqlx0elWBaya9sBAIOdehJBT2OuZiUs8I6r68J5rlOrzeYU2n 0RSfXggcieUS04qGHMdxk70XG+irGZe+NpXe+Dr1C5yqkUjhDe7kjiuwOxByK0g5cSvx6Y Xq2XdURgUWilpseudf/yIFu+DONzQW6gv30L6iOtTHxD7f7tfT1aqzd+61V3lQ== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20230601 header.b=mJb3CHMI; 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=none) header.from=gmail.com ARC-Seal: i=1; s=key1; d=yhetil.org; t=1714534236; a=rsa-sha256; cv=none; b=B+Pmz9FPvjIzmfApsAZqYdJ6xkqT3cAHtPYxx28bB0Bbg8toFw9L5Bvg7BEOip148oF9D9 YcpbsrH+zGNUmWO5kDOUIjjR3KbHEUdT3aql1K1oa3YPeEKNJlrXLmNCgfSHNvnZI6mfwA jCfAbdJ/7haD27JmEN6nXOhzKCaWDjhIJfYXl0/ix1H65Uh7VEhADnD+619UDF2wTKlCHe 6hst3xq9vUBrvfTDMYt5QaHlMp2xczoctFvIQw1ffZM8Kf7z4xqTFr8/ilq+sTyTMC5PQB r0B0FOik/+a4C615xK2JnMvIpSl6ka6V9DqgPPCpVWKv9NzA3ArBgtFYGFI3NQ== 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 E29ED60E1B for ; Wed, 1 May 2024 05:30:35 +0200 (CEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1s20es-0000yJ-8I; Tue, 30 Apr 2024 23:29:26 -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 1s20eo-0000xl-6B for emacs-orgmode@gnu.org; Tue, 30 Apr 2024 23:29:22 -0400 Received: from mail-oa1-x30.google.com ([2001:4860:4864:20::30]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1s20ek-0007bH-Tf for emacs-orgmode@gnu.org; Tue, 30 Apr 2024 23:29:21 -0400 Received: by mail-oa1-x30.google.com with SMTP id 586e51a60fabf-23d38cd0df6so630217fac.2 for ; Tue, 30 Apr 2024 20:29:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1714534152; x=1715138952; darn=gnu.org; h=mime-version:message-id:date:subject:to:from:from:to:cc:subject :date:message-id:reply-to; bh=7gIe6/BAbYElWijNh+GTFAczuIrSOu0GLmDqEovpeuQ=; b=mJb3CHMInkHeFgqWnRRnWsPsUNru0Os0j7CtLkMiNScSxqBLio5WC1+iw61K2jWsd5 0JXl++XvyI2xo5X4bCXD5yh1dDn7ou7/DCHelkZ6LBnBWKJ5w3ZK4fezQvM/Av95TNWm GIWzDQ4WotpEmiQYbtnQlswC296x7yBN/nMsROEdJl1d0xHzIDeWPGBjww6n0vBQZhS0 nSFf7C3Eo9E6KxpKzmQuKcvokyyptEjVFIhYPRiGGmYwQv7FM8BDQSrC/esJ+LDvtjKU 0oRFz9t9ULyAXZMihV4yWt4SU9OoipGLQk+rqdSCiwsWO2/XYWybBestjLBtK3aYF+0a FG3Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1714534152; x=1715138952; h=mime-version:message-id:date:subject:to:from:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=7gIe6/BAbYElWijNh+GTFAczuIrSOu0GLmDqEovpeuQ=; b=AcFoCAMnR7pE1tVxyhpsiOEgEuW0/LJdid3haH4q4fwvTDxz5f2nS0BTq8liVdNHkr Zw6XBuz4RzEYginmEeiUpOjz3mofuUGax4TBDQgRmJxWozeEvbqVm+hS9nEOhizoSKLm XOpvKZnGOr1/2ebc4GjcnZBudHCLPnHSCEC7O/RFlUKE/fS1zZ0SOHNo01+r16AHjxcv d16AJXziQudqKtejpAi5ZBofdV+3yTSsojaPkOgOMksUPIDkhYfQAaTk0F2FdGc7UY/m De8kRvZc5y+sj1ExwSZ/8163XTJMp9uQM//48mkdQpNtyYPgoU8GQmOyfdxuKMxpBxUg fOCQ== X-Gm-Message-State: AOJu0YwbXP5enkkRmyLpyp6qx2rAxprpfvKB2LRAfkOdRb4VPe4RGcvK VTgv2YKVw0uIIgBKlbnehe70Hi/fPhtdKYk6KRIzp8hcxIkyaxhBOuJVJQ== X-Google-Smtp-Source: AGHT+IEiUZs/8xihRix5L+XkmiRLnjm9nr35LFqg8KccTmTKnYBpkYgwuIPcl7AECSqaZhtUiNPzeA== X-Received: by 2002:a05:6870:1215:b0:22e:a686:a943 with SMTP id 21-20020a056870121500b0022ea686a943mr1184698oan.31.1714534152212; Tue, 30 Apr 2024 20:29:12 -0700 (PDT) Received: from storimasta ([2804:14c:5bb1:5200::3186]) by smtp.gmail.com with ESMTPSA id g22-20020a056a000b9600b006edf7be92c2sm21731037pfj.72.2024.04.30.20.29.10 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 30 Apr 2024 20:29:11 -0700 (PDT) From: Bruno Cardoso To: emacs-orgmode@gnu.org Subject: [PATCH] Add support for shortdoc link type Date: Wed, 01 May 2024 00:29:08 -0300 Message-ID: <87zftatdkr.fsf@gmail.com> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Received-SPF: pass client-ip=2001:4860:4864:20::30; envelope-from=cardoso.bc@gmail.com; helo=mail-oa1-x30.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: -9.71 X-Spam-Score: -9.71 X-Migadu-Queue-Id: E29ED60E1B X-Migadu-Scanner: mx13.migadu.com X-TUID: HSe+6ntXC/Co --=-=-= Content-Type: text/plain Hi all, This patch adds support for "shortdoc:" links. Best, Bruno. --=-=-= Content-Type: text/x-patch Content-Disposition: inline; filename=0001-ol-support-for-shortdoc-link-type.patch 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..f0088ae5f 100644 --- a/lisp/ol.el +++ b/lisp/ol.el @@ -1598,6 +1598,29 @@ PATH is a symbol name, as a string." :follow #'org-link--open-help :store #'org-link--store-help) +;;;; "shortdoc" link type + +(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))) + +(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 --=-=-=--