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 aPGMCklaNWagBgEAqHPOHw:P1 (envelope-from ) for ; Fri, 03 May 2024 23:42:33 +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 aPGMCklaNWagBgEAqHPOHw (envelope-from ) for ; Fri, 03 May 2024 23:42:33 +0200 X-Envelope-To: larch@yhetil.org Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20230601 header.b=NXsNcm0p; 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=1714772553; 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=QQhRsnXFxQmR/0sARRR6M2iPyTgK00db8aAIG46IpH0=; b=g1rBuDYErfmUgXjaOF7ck2nHEtW9+GWwLtJFvxN8nekNLWv9mPkfNA6tZ78UuPgipx1FSl VK+7XYfmqCW7ImU5SmdyzSqfORzFROa5OxxoZ5Hb7XD45/TF6JsGGCicM3nekcW58+qGJt rZMfSXimRL/MTlq8bzwVTdlyUaoDGA8zD7ekuIS390CkN13+elM8cNwrMdiiWflaxU8yZ9 7UTHmgu1DlFYGD1LcIvTUzInr2N8DKQlHYndGCcs0IR+iHApKDBdSE2teCHR2OPeUzNwAe lJviGIedOO5h+u4hAj5IoXMu8wjbPtmUCtj2NgVvxYswMyebT0CdTxFRO+P3Xg== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1714772553; a=rsa-sha256; cv=none; b=WdescpMDtdf+evVmMe71dFfROB1zCed0IHG1r9kdqkK+5KvzaWrLOt+XFCyl19gCQUGbmb bGJ223h5iW7qz1vE2DwV6Dh1B82QUcmaSQnk93vaR3UVB87LlXSmPpvDST8mA3v7w61Se6 JlL66WQDTDXvO2z/V3wQbOENkTPOB+P+q/oLp7iP0PxtReqD8amTP0VkP603qx79tm08fB +2O1y7jrxtwxtRYdIwaRM3UdfImpVA1rVrjYcOF2SudrOFDSr0mHMNKAKqRb2xkY4asZQg knfuCoQpQ/+TlV+4BwPb5DoHJGdipPww6XcZP6jjcfUQOieMSynNwT8qo7pGGg== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20230601 header.b=NXsNcm0p; 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 0273CC4D6 for ; Fri, 03 May 2024 23:42:32 +0200 (CEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1s30eo-0006ja-7B; Fri, 03 May 2024 17:41:30 -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 1s30em-0006iI-Cf for emacs-orgmode@gnu.org; Fri, 03 May 2024 17:41:28 -0400 Received: from mail-il1-x135.google.com ([2607:f8b0:4864:20::135]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1s30ek-000196-QI for emacs-orgmode@gnu.org; Fri, 03 May 2024 17:41:28 -0400 Received: by mail-il1-x135.google.com with SMTP id e9e14a558f8ab-36c703d13e6so718595ab.3 for ; Fri, 03 May 2024 14:41:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1714772483; x=1715377283; 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=QQhRsnXFxQmR/0sARRR6M2iPyTgK00db8aAIG46IpH0=; b=NXsNcm0p86/NAeBIWc9voDsVwVcb5j8CnDTW7ku/f3pC4DCRrkpGZaODvA7gIfKgYX 2qEosSLxAWF/LuDfc2JDSPidys79WBORmw7JRo2Z8LHjgRYJnfsosid9Tqw1O3P8C5k4 0McTYl+cv7O4SokHvtjgd0ubVSsBYZmwf1dkeBimPeg7yITIKMhvz9ZSp+z1S0oMzyHI uZhDNDRsEuQnU6Tzzuso0ZXfSmpjrp2Vkzc0CyisAzBEgVIGS2OEzmiQtsmyrJTb05DZ 7kME//JGJnBw4w3JGZfMkK3ibwtdHcp6NxWXxI7ytzKgRuLejpvMhXJBAEmKDFUsp4i4 +S8g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1714772483; x=1715377283; 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=QQhRsnXFxQmR/0sARRR6M2iPyTgK00db8aAIG46IpH0=; b=JRXbPMt89c/i7A3TxghHjbJnIp24NtQdUZwaObpdi3SjORaAbTF/U+5PhQyCsnfO+j RBm4XcofHn6D90yZAZN4+FIm4z38cGct8B+7dBFQE2pwt8XcD+a8N+PJlcTRkxgJ31kx XLP+Bl1kqHt8KImYC3ZQbbn8OXjWeEMVFfGXSPJmCiUkudx7htP24SUVOsLEj2M9X/Q1 J5gxTfjw9LqKs0AoaDMV2F4GnuWOjgjwR6A1LlmVEBtenSfOanbvvQruYbAtdZLqh33z hhYLEoYHTcJxc3gn57ZtDQTyYjGiFJ4PItaSxpHBVk91WO4qJ0x9nQEtwZ9CqR7wlIhf cxag== X-Gm-Message-State: AOJu0Ywr/kUJqYHAthR6Chk5mITKNx4tzL7IcmTrggftbXXpFH03CfTN 79M84p4I4LaNCA4JCX619BfXk03ukxFgVt95a3rr0bZgQ+/SuSxMhdcSwA== X-Google-Smtp-Source: AGHT+IFESPkINyjRl1m8RDDR/dbmFHoi8cf+5UqQpFc71GtDrNBy8Cvlz31VZq4MRv6IAAX5NHUuXA== X-Received: by 2002:a05:6e02:1749:b0:36c:85c:9800 with SMTP id y9-20020a056e02174900b0036c085c9800mr4773159ill.29.1714772483513; Fri, 03 May 2024 14:41:23 -0700 (PDT) Received: from storimasta ([2804:14c:5bb1:5200::3186]) by smtp.gmail.com with ESMTPSA id h11-20020a63df4b000000b005f807af5156sm3643395pgj.41.2024.05.03.14.41.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 03 May 2024 14:41:22 -0700 (PDT) From: Bruno Cardoso To: Max Nikulin Cc: emacs-orgmode@gnu.org Subject: Re: [PATCH] Add support for shortdoc link type In-Reply-To: <4b69d3b8-cfe7-4ba2-b9b5-872bcaeb6fe6@gmail.com> 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> Date: Fri, 03 May 2024 18:41:18 -0300 Message-ID: <87v83uefpd.fsf@gmail.com> MIME-Version: 1.0 Content-Type: text/plain Received-SPF: pass client-ip=2607:f8b0:4864:20::135; envelope-from=cardoso.bc@gmail.com; helo=mail-il1-x135.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.71 X-Spam-Score: -6.71 X-Migadu-Queue-Id: 0273CC4D6 X-Migadu-Scanner: mx11.migadu.com X-TUID: raZzmhgzs8/Q On 2024-05-02, 17:41 +0700, Max Nikulin wrote: > `condition-case' may help to avoid the internal `shortdoc--groups' > variable here. As to completion, it is better to ask for public API. > However emacs developers likely will decline such request. > > Consider the following just as ideas. > > - Support of search options. Buttons in help pages move point to > specific functions. > > > > - At first I considered adding shortdoc to help links that may call > either `describe-function' or `describe-variable', but it is unlikely > possible. Hi Max, Thanks for your suggestions. Indeed `condition-case' might be better there. I implemented the search option by borrowing the regexp from `ol-info': (defun org-link--open-shortdoc (path _) "Open a \"shortdoc\" type link. PATH is a group name or \"group::#function\"." (string-match "\\`\\([^#:]*\\)\\(?:[#:]:?\\(.*\\)\\)?\\'" path) (let ((group (match-string 1 path)) (fn (match-string 2 path))) (condition-case nil (progn (shortdoc-display-group group) (when fn (re-search-forward (concat "^(" (string-remove-prefix "#" fn)) nil t) (beginning-of-line))) (error (message "Unknown shortdoc group: %s" group))))) It works, but I'm not quite sure if this is the best approach. It curently matches all the cases below, as I got confused about the correct link syntax: shortdoc:text-properties:get-pos-property shortdoc:text-properties::get-pos-property shortdoc:text-properties#get-pos-property shortdoc:text-properties:#get-pos-property shortdoc:text-properties::#get-pos-property Best, Bruno.