emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Patch org-capure-fill-template
@ 2014-10-29 17:46 Roberto Huelga
  2014-10-30 15:48 ` Nicolas Goaziou
  0 siblings, 1 reply; 6+ messages in thread
From: Roberto Huelga @ 2014-10-29 17:46 UTC (permalink / raw)
  To: emacs-orgmode


[-- Attachment #1.1: Type: text/plain, Size: 72 bytes --]

Patch proposal fro org-capture-fill-template

Hope it's useful.
Thanks.

[-- Attachment #1.2: Type: text/html, Size: 140 bytes --]

[-- Attachment #2: 0001-org-capture.el-Fix-expand-template-order.patch --]
[-- Type: application/octet-stream, Size: 1503 bytes --]

From 3298e255aa8cc0c0bb5367a469d578fc8ed45600 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Roberto=20Huelga=20D=C3=ADaz?= <rhuelga@gmail.com>
Date: Wed, 29 Oct 2014 18:29:11 +0100
Subject: [PATCH] org-capture.el: Fix expand template order

* lisp/org-capture.el (org-capture-fill-template): expand %(sexp) after
  %:keywords

When a template is expanded first the simple %-escapes, %:keywords and
after that the %(sexp).

Patch proposal by Roberto Huelga Díaz.

TINYCHANGE
---
 lisp/org-capture.el |    6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/lisp/org-capture.el b/lisp/org-capture.el
index 9f8107e..65de098 100644
--- a/lisp/org-capture.el
+++ b/lisp/org-capture.el
@@ -1608,8 +1608,6 @@ The template may still contain \"%?\" for cursor positioning."
 		(insert-file-contents filename)
 	      (error (insert (format "%%![Couldn't insert %s: %s]"
 				     filename error)))))))
-      ;; %() embedded elisp
-      (org-capture-expand-embedded-elisp)

       ;; The current time
       (goto-char (point-min))
@@ -1639,6 +1637,10 @@ The template may still contain \"%?\" for cursor positioning."
 					(intern (match-string 1))) ""))
 		 (replace-match x t t)))))

+      ;; %() embedded elisp
+      (goto-char (point-min))
+      (org-capture-expand-embedded-elisp)
+
       ;; Turn on org-mode in temp buffer, set local variables
       ;; This is to support completion in interactive prompts
       (let ((org-inhibit-startup t)) (org-mode))
--
1.7.10.2 (Apple Git-33)

^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2014-11-02 21:40 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-10-29 17:46 Patch org-capure-fill-template Roberto Huelga
2014-10-30 15:48 ` Nicolas Goaziou
2014-10-30 16:21   ` Roberto Huelga
2014-11-02  9:44     ` Nicolas Goaziou
2014-11-02 19:59       ` Roberto Huelga
2014-11-02 21:41         ` Nicolas Goaziou

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).