From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id sKALFyCDX1+1fwAA0tVLHw (envelope-from ) for ; Mon, 14 Sep 2020 14:50:08 +0000 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0 with LMTPS id AItoESCDX1+lRQAA1q6Kng (envelope-from ) for ; Mon, 14 Sep 2020 14:50:08 +0000 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 BC65B94050F for ; Mon, 14 Sep 2020 14:50:06 +0000 (UTC) Received: from localhost ([::1]:36424 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kHpnx-0002Lr-FG for larch@yhetil.org; Mon, 14 Sep 2020 10:50:05 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:58432) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kHplX-0002I8-Fn for emacs-orgmode@gnu.org; Mon, 14 Sep 2020 10:47:35 -0400 Received: from mx.flintfam.org ([2001:19f0:6401:1c4:5400:ff:fe4b:c898]:57570) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kHplV-0004jb-0u; Mon, 14 Sep 2020 10:47:35 -0400 Received: by mx.flintfam.org (Postfix, from userid 114) id 868721F593; Mon, 14 Sep 2020 14:47:30 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.9.2 mx.flintfam.org 868721F593 Received: from landau.flintfam.org (162-210-5-149.lnk.ne.static.allophone.net [162.210.5.149]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx.flintfam.org (Postfix) with ESMTPSA id 66C841F576; Mon, 14 Sep 2020 14:47:28 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.9.2 mx.flintfam.org 66C841F576 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=flintfam.org; s=mail; t=1600094848; bh=i9GbftJ9/zdICdByJe02Y+SuHf2RmtbeudXstDXOgm0=; h=From:To:Cc:Subject:References:Date:In-Reply-To:From; b=g3HVqTGgo9QmjsMPPkyYSCKyvYUxl3Dcm4ZllLnRyb9iFxe4A66IYvBMYFmA3T1q3 of2VqoEkgjpJEs5a+W88uwaqE1KjHRS4zCiq3gaZ9JHSERfNWQnIRNFQDQwJcgnYuQ CH7cI7Y1mT4IDfLum4MjokLNDtTPsVQQMSoD1vNODGiM634JxMNShqF4pBiHtFIipT hTmXY2D/O6XRNItvE3R6SmvHFfVxK848WpwlBebXzGAS2ifv8IjzqsGut6HsuSXu7D ivW01NONNIxjbNERIa6w3EUW/Kq1BhbgNbozuR0lVAIZPrhC0oQqqZb9SZEJMCSavH HfDhJR7HP9iEw== From: "Samuel W. Flint" To: Bastien Subject: Re: [PATCH] Add %L (the link content *not* as a full link) to Capture expansions References: <87pn6uij4t.fsf@flintfam.org> <87mu1tifuj.fsf@gnu.org> Date: Mon, 14 Sep 2020 09:47:27 -0500 In-Reply-To: <87mu1tifuj.fsf@gnu.org> (Bastien's message of "Sun, 13 Sep 2020 22:25:40 +0200") Message-ID: <87een4jtz4.fsf@flintfam.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Received-SPF: pass client-ip=2001:19f0:6401:1c4:5400:ff:fe4b:c898; envelope-from=swflint@flintfam.org; helo=mx.flintfam.org X-detected-operating-system: by eggs.gnu.org: First seen = 2020/09/14 10:17:36 X-ACL-Warn: Detected OS = Linux 3.11 and newer 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, 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.23 Precedence: list List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Org-Mode Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org Sender: "Emacs-orgmode" X-Scanner: scn0 Authentication-Results: aspmx1.migadu.com; dkim=fail (rsa verify failed) header.d=flintfam.org header.s=mail header.b=g3HVqTGg; dmarc=none; spf=pass (aspmx1.migadu.com: domain of emacs-orgmode-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=emacs-orgmode-bounces@gnu.org X-Spam-Score: -0.01 X-TUID: mD2CBGv6CsCV --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable >>>>> Bastien writes: B> Hi Samuel, swflint@flintfam.org (Samuel W. Flint) writes: >> In an attempt at automating a part of my workflow, I found that >> org-capture's %l didn't quite fit what I needed. Normally, >> org-store-link does the right thing, but for some capture tasks, >> I want to custom generate the description, so %l doesn't work. >> I've attached a patch that adds %L, a version that doesn't add >> the link brackets. B> It looks good to me for Org 9.5. Can you add a Changelog entry B> to your patch and also patch the tests and the manual, if needed? Apologies for spamming you with multiple copies Bastien. Certainly! Hopefully this looks better. I didn't see any tests for %a, %A or %l already, and I don't have time atm to write them, otherwise I'd have done so. I can mark this as TINYCHANGE, if necessary, as I don't have a copyright assignment on file, though I'm willing to do so. Thanks, Sam B> See B> B> for the format of the Changelog. B> Thanks, B> -- Bastien --=20 Samuel W. Flint 4096R/FA13D704 (F50D 862B 4F65 5943 A8C2 EF0E 86C9 3E7A FA13 D704) =CE=BBs.(s s) =CE=BBs.(s s) --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=0001-Add-in-support-for-filling-in-the-bare-link-in-org-c.patch >From 02de43c3457419f1031f4988d6c95fac535134e7 Mon Sep 17 00:00:00 2001 From: "Samuel W. Flint" Date: Mon, 14 Sep 2020 09:07:07 -0500 Subject: [PATCH] Add in support for filling in the bare link in org capture * doc/org-manual.org: Document new %L capture template formatting directive. * lisp/org-capture.el: (org-capture-templates) Document new %L capture template formatting directive. * lisp/org-capture.el: (org-capture-fill-template) Add in support for %L, bare link formatting, in org-capture-fill-template. --- doc/org-manual.org | 4 ++++ lisp/org-capture.el | 7 ++++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/doc/org-manual.org b/doc/org-manual.org index 7ab7d1c94..229575b13 100644 --- a/doc/org-manual.org +++ b/doc/org-manual.org @@ -7799,6 +7799,10 @@ here: Like =%a=, but only insert the literal link. +- =%L= :: + + Like =%l=, but without brackets (the link content itself). + - =%c= :: Current kill ring head. diff --git a/lisp/org-capture.el b/lisp/org-capture.el index d73e927fc..2ef55cd5c 100644 --- a/lisp/org-capture.el +++ b/lisp/org-capture.el @@ -315,6 +315,7 @@ be replaced with content and expanded: %a Annotation, normally the link created with `org-store-link'. %A Like %a, but prompt for the description part. %l Like %a, but only insert the literal link. + %L Like %l, but without brackets (the link content itself). %c Current kill ring head. %x Content of the X clipboard. %k Title of currently clocked task. @@ -1592,6 +1593,9 @@ The template may still contain \"%?\" for cursor positioning." (v-l (if (and v-a (string-match l-re v-a)) (replace-match "[[\\1]]" nil nil v-a) v-a)) + (v-L (if (or v-a (string-match l-re v-a)) + (replace-match "\\1" nil nil v-a) + v-a)) (v-n user-full-name) (v-k (if (marker-buffer org-clock-marker) (org-no-properties org-clock-heading) @@ -1644,7 +1648,7 @@ The template may still contain \"%?\" for cursor positioning." ;; Mark %() embedded elisp for later evaluation. (org-capture-expand-embedded-elisp 'mark) ;; Expand non-interactive templates. - (let ((regexp "%\\(:[-A-Za-z]+\\|<\\([^>\n]+\\)>\\|[aAcfFikKlntTuUx]\\)")) + (let ((regexp "%\\(:[-A-Za-z]+\\|<\\([^>\n]+\\)>\\|[aAcfFikKlLntTuUx]\\)")) (save-excursion (while (re-search-forward regexp nil t) ;; `org-capture-escaped-%' may modify buffer and cripple @@ -1681,6 +1685,7 @@ The template may still contain \"%?\" for cursor positioning." (?k v-k) (?K v-K) (?l v-l) + (?L v-L) (?n v-n) (?t v-t) (?T v-T) -- 2.18.1 --=-=-=--