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 KL1LCy9gO2ZxRQAAqHPOHw:P1 (envelope-from ) for ; Wed, 08 May 2024 13:21:19 +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 KL1LCy9gO2ZxRQAAqHPOHw (envelope-from ) for ; Wed, 08 May 2024 13:21:19 +0200 X-Envelope-To: larch@yhetil.org Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20230601 header.b="WXBP3k/B"; dmarc=fail reason="SPF not aligned (relaxed)" header.from=gmail.com (policy=none); 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=1715167279; 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: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post:dkim-signature; bh=Xznmb6sXSJmA9IQl7cT2cpABjqVDPf8jwXu8/XLvZbQ=; b=kdsMVDpLYauiLnc4yKFS9kBDUyK9dWxOw30P2EuWHw0QW2sGBANcK+BRzRrp8OCfWwRoih W0y+iFyLINCHOfFEDaXEHz5dpSyh7PWbGygje6kr+kw6yZSPSZiYj3T9lYCddMcArwTHto uKLNSBGWPNucfDB8uP/16OncS4IEHZYAzJJQcx1HJwXUtpTTbiclhxoVk0Rc2fjVIlJ5Ad Z4nUIJufHMvR8RbM7BsFNZM3Mgtk63zZ0SIk6JVNaitEZmOsNndKesPYAppvI5V7DC2vyG pyLoafpqfRD8TV2gA3KJJeBkTruDKPBzhUFBc2f3K5+wyPtWk1kTfkTaeFsOBA== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1715167279; a=rsa-sha256; cv=none; b=NsvDGccljb+7BbQI0IO3Z3USgWLLGNEA9zEm7bMdly5MjKfXvCIMCXXRW8Dxyq0AGu6mHZ Q9+5V4HFVqBifcHfPFaCn0JIZeYLz28cXV4HItcFA01BuhQha6+B3hNkn9yC9h+OO3Zx75 idjJUjOaO8oU7BRtKGIoYi0PHRP9NKzNzo4LNRF5xZKrf+DXxYbmhCHft6N6z3Aea0WamG 1Er9rogox0OI64DDM59OtZYub6vsoQ/n55SrYxABwRIn7T2ghSsTvG1DZ4bDYF137Wxip4 xm64nEVm1+2B6Xrld8hdmriRoVpq8sOM5J27Z/Hnbag1TNoUJWi2PuJZPE8vNw== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20230601 header.b="WXBP3k/B"; dmarc=fail reason="SPF not aligned (relaxed)" header.from=gmail.com (policy=none); 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 C48FC7948 for ; Wed, 08 May 2024 13:21:18 +0200 (CEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1s4fLX-0004pE-2s; Wed, 08 May 2024 07:20:28 -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 1s4fLM-0004hq-Ke for emacs-orgmode@gnu.org; Wed, 08 May 2024 07:20:17 -0400 Received: from mail-lf1-x12a.google.com ([2a00:1450:4864:20::12a]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1s4fLG-0003ib-6Q for emacs-orgmode@gnu.org; Wed, 08 May 2024 07:20:15 -0400 Received: by mail-lf1-x12a.google.com with SMTP id 2adb3069b0e04-51f45104ef0so4602274e87.3 for ; Wed, 08 May 2024 04:20:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1715167208; x=1715772008; darn=gnu.org; h=content-transfer-encoding:in-reply-to:mail-followup-to:from :content-language:references:to:subject:user-agent:mime-version:date :message-id:sender:from:to:cc:subject:date:message-id:reply-to; bh=Xznmb6sXSJmA9IQl7cT2cpABjqVDPf8jwXu8/XLvZbQ=; b=WXBP3k/BeAPKwyYmSh5sPLm1XnSC4ImZaqrUa3nWoTs9Vt8mVPNeQR2qxHxVdhmxM+ QnBYyr5QnunLChweY8n+ORUPoNWu2mW3dzLpsa+NgAFvnt5oVgXdixJynLF8PouJwVJm 7cEWr3BqzmbxjoT60ibjRW3zr+t+BnCOAUWKuLks5A8QsUViLWl7LOT4cNe0U6zlfcO5 SGmqpSqsc1rwmDgwGVN18fBcxNnRVl5x5R47jVfE0JpsEeuPanT/oR5RxYqfXN+TSalo wf7jYk7Ab1uXguHk/X3kbYOXjC3JH+gFF5QMncrYDN9wWOpbW4PRjKK2J/fHaOygKDo3 1jvw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1715167208; x=1715772008; h=content-transfer-encoding:in-reply-to:mail-followup-to:from :content-language:references:to:subject:user-agent:mime-version:date :message-id:sender:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=Xznmb6sXSJmA9IQl7cT2cpABjqVDPf8jwXu8/XLvZbQ=; b=uosCoS6EjDgUSl3YB77ZMDIvqjyL2EIchnTdRfyaFSkGBHPq08qITxhSda1ASF9Apy jCt5AMD6J61TD6lo2tlGQmeXO8zaiibkGQUGTWT/TEHPvabOOKXxsIAc8oGc/5T56PQZ ZEoBvXxpbi6rIAj4NFPgT4ibEci6rCL/QgIYRPHG4d1/POtaTVx7AGg+JUCN8PqvFB2w 1HRpnHJ3NddWCdMUH9ENS+Jp3cfCXqwNVnTH4vUad03FMo7pf+IZPSf6YQy9MdVeK/Nv iAtf94794mwLvIZKaVUHWdHU6GO1tBVpsJi0KvGbhx+nyG0SJw/0wfLUaKvsLLtRwkRO mlEg== X-Forwarded-Encrypted: i=1; AJvYcCWnAqBHQw/V889WQmpy6gjmwtbmE/i3BkMQ+VPmScPVTwtug0rBYi0kRMWuwsO5m9dE+NKKQmFArZahC0lJ6CmqdKlXOqE= X-Gm-Message-State: AOJu0Yyc7qyk3mYFCp/34KzZFiLeF+5K2glztc4gtZ1Am1b9zm4LYlZX ePxOyb7OYAODERgh7tAmqUQV7K8GL8URSscIxUXQFcrvZNBNz/NKqs18qA== X-Google-Smtp-Source: AGHT+IFjAkoVHb2u2Ej2dsw8e8C2CD22G4BGgiNIQ2N7wNhOKxCXea0Dqz5/x7D5i9mlzkvgPVjVLA== X-Received: by 2002:ac2:4a62:0:b0:51d:9ce:c282 with SMTP id 2adb3069b0e04-5217cc45567mr1431805e87.46.1715167207496; Wed, 08 May 2024 04:20:07 -0700 (PDT) Received: from [192.168.0.102] (nat-0-0.nsk.sibset.net. [5.44.169.188]) by smtp.googlemail.com with ESMTPSA id n14-20020a0565120ace00b0051eeb558175sm2482481lfu.90.2024.05.08.04.20.06 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 08 May 2024 04:20:07 -0700 (PDT) Message-ID: Date: Wed, 8 May 2024 18:20:05 +0700 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH] Add support for shortdoc link type To: Bruno Cardoso , emacs-orgmode@gnu.org 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> Content-Language: en-US, ru-RU From: Max Nikulin Mail-Followup-To: Bruno Cardoso , emacs-orgmode@gnu.org In-Reply-To: <87v83pnm56.fsf@gmail.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Received-SPF: pass client-ip=2a00:1450:4864:20::12a; envelope-from=manikulin@gmail.com; helo=mail-lf1-x12a.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, T_SPF_TEMPERROR=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.28 X-Spam-Score: -2.28 X-Migadu-Queue-Id: C48FC7948 X-Migadu-Scanner: mx11.migadu.com X-TUID: RuRkjeuqeH4X On 08/05/2024 08:11, Bruno Cardoso wrote: > > The following now work as expected: > > - [[shortdoc:string]] > - [[shortdoc:string::#try-completion]] > - [[shortdoc:string::identical contents]] Thanks. Bruno, the patch should have proper commit message, see Some minor notes: > +++ 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~ lists all known > + documentation groups. I have not managed to get all known groups with `shortdoc-display-group' in Emacs-28. Is it a feature of `shortdoc' in Emacs-29? > + (string-match "\\`\\([^:]*\\)\\(?:::\\(.*\\).*\\'\\)?" path) My bad. In "\\`\\([^:]*\\)\\(?:::#\\(.*\\).*\\'\\)?" second .* was unnecessary, it survived from an earlier variant with \\| and \\' outside of the regex group. Likely it is better to not allow empty group or function, so "+" instead of "*" "\\`\\([^:]+\\)\\(?:::\\(.+\\)\\'\\)?" since is hardly a valid link. However it might be search text link in the list of all groups (Emacs-29+ only?). It is related to corner cases, so I do not insist. > + (let* ((group (match-string 1 path)) > + (str (match-string 2 path)) > + (fn (when (and str (string-match "^#" str)) > + (intern-soft (string-remove-prefix "#" str))))) Nitpick, feel free to ignore: - `when' is redundant here due to `and' inside its condition. - `string-patch-p' would not affect match groups, so it is a bit cheaper. - Since it is already known that first character is "#", `substring' instead of `string-remove-prefix' is an extra step in microoptimization Untested: (fn (and str (eq ?# (string-to-char str)) (substring str 1)))