summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSamuel W. Flint <swflint@flintfam.org>2020-09-14 09:07:07 -0500
committerBastien <bzg@gnu.org>2020-09-23 10:57:49 +0200
commitd06aa486d6c3163b6ef6e9ab665117bd93dff34a (patch)
tree729c177164a4d5f184985e89b73969e6d14b46f7
parent6c75b002172b26b5592a3076ef0bd3e9a37e73ce (diff)
downloadorg-mode-d06aa486d6c3163b6ef6e9ab665117bd93dff34a.tar.gz
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
-rw-r--r--doc/org-manual.org4
-rw-r--r--lisp/org-capture.el7
2 files changed, 10 insertions, 1 deletions
diff --git a/doc/org-manual.org b/doc/org-manual.org
index 7ab7d1c..229575b 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 d73e927..2ef55cd 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)