From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id 2DfCLZ2KX184fAAA0tVLHw (envelope-from ) for ; Mon, 14 Sep 2020 15:22:05 +0000 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2 with LMTPS id SFE5KJ2KX18MdgAAB5/wlQ (envelope-from ) for ; Mon, 14 Sep 2020 15:22:05 +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 3C21D9408DA for ; Mon, 14 Sep 2020 15:22:04 +0000 (UTC) Received: from localhost ([::1]:37550 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kHqIr-0003ap-W9 for larch@yhetil.org; Mon, 14 Sep 2020 11:22:02 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:39570) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kHq9u-00062e-MX for emacs-orgmode@gnu.org; Mon, 14 Sep 2020 11:12:46 -0400 Received: from mx.flintfam.org ([2001:19f0:6401:1c4:5400:ff:fe4b:c898]:57739) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kHq9s-0001DX-Jk; Mon, 14 Sep 2020 11:12:46 -0400 Received: by mx.flintfam.org (Postfix, from userid 114) id 3EFB61F593; Mon, 14 Sep 2020 15:12:43 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.9.2 mx.flintfam.org 3EFB61F593 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 1DF7B1F586; Mon, 14 Sep 2020 15:12:41 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.9.2 mx.flintfam.org 1DF7B1F586 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=flintfam.org; s=mail; t=1600096361; bh=Ae3rVMmeqnJUKS9auYGjbcKe8Ev/1+/7qcFyyOtzXtI=; h=From:To:Cc:Subject:References:Date:In-Reply-To:From; b=aXmhRMICJp2f+ZYpg1wcoqAKfpde3dLAxwIHI+o+AEPQc1derP4ayGLooxDf7lZUW Mmnt9o89b/ZvRDyid30OeOChx5xQ4WjUbQ7YcHkIFn+hL5KrnG+Qf+enp0wqF1xhzL kOGqLTO3ZGxSB48pn8lopNVMXz3hSIZ++0VrEnm7/6DFaW0fipKarC8R068f7HhUZ1 6Q/6pDTrC/f74WfCqSJe1uopH3hZm890tvZ0+wnXsCNVDSWA3lomzCviBcLK++tqbu 9SZbJnXzCoeseK5Y3XRhGd+RmcNMyXszWe8pkht8dmDHRsmq7EbqMQea1Tw1X3bqsz MY1NrkiGF3I3A== 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> <87een4jtz4.fsf@flintfam.org> Date: Mon, 14 Sep 2020 10:12:40 -0500 In-Reply-To: <87een4jtz4.fsf@flintfam.org> (Samuel W. Flint's message of "Mon, 14 Sep 2020 09:47:27 -0500") Message-ID: <87y2lcie8n.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=pass header.d=flintfam.org header.s=mail header.b=aXmhRMIC; 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: -1.21 X-TUID: yOx0QZH+LsPU --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Marked as TINYCHANGE. Sam >>>>> Samuel W Flint writes: >>>>> 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? SWF> Apologies for spamming you with multiple copies Bastien. SWF> Certainly! Hopefully this looks better. I didn't see any SWF> tests for %a, %A or %l already, and I don't have time atm to SWF> write them, otherwise I'd have done so. SWF> I can mark this as TINYCHANGE, if necessary, as I don't have a SWF> copyright assignment on file, though I'm willing to do so. SWF> Thanks, SWF> Sam B> See B> B> for the format of the Changelog. B> Thanks, B> -- Bastien SWF> -- Samuel W. Flint 4096R/FA13D704 (F50D 862B 4F65 5943 A8C2 SWF> EF0E 86C9 3E7A FA13 D704) =CE=BBs.(s s) =CE=BBs.(s s) --=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. TINYCHANGE --- 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 --=-=-=--