diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 8666f603a..34d94a344 100755 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,8 @@ +2010-02-01 Carsten Dominik + + * org-remember.el (org-remember-apply-template): Do file insertion + first. + 2010-01-31 Carsten Dominik * org-habit.el (org-habit-insert-consistency-graphs): Fix a diff --git a/lisp/org-remember.el b/lisp/org-remember.el index 4a1799429..c2299461c 100644 --- a/lisp/org-remember.el +++ b/lisp/org-remember.el @@ -488,21 +488,6 @@ to be run from that hook to function properly." (or (cdr org-remember-previous-location) "???") (if org-remember-store-without-prompt "C-1 C-c C-c" " C-c C-c")))) (insert tpl) - (goto-char (point-min)) - - ;; Simple %-escapes - (while (re-search-forward "%\\([tTuUaiAcxkKI]\\)" nil t) - (unless (org-remember-escaped-%) - (when (and initial (equal (match-string 0) "%i")) - (save-match-data - (let* ((lead (buffer-substring - (point-at-bol) (match-beginning 0)))) - (setq v-i (mapconcat 'identity - (org-split-string initial "\n") - (concat "\n" lead)))))) - (replace-match - (or (eval (intern (concat "v-" (match-string 1)))) "") - t t))) ;; %[] Insert contents of a file. (goto-char (point-min)) @@ -517,6 +502,21 @@ to be run from that hook to function properly." (insert-file-contents filename) (error (insert (format "%%![Couldn't insert %s: %s]" filename error))))))) + ;; Simple %-escapes + (goto-char (point-min)) + (while (re-search-forward "%\\([tTuUaiAcxkKI]\\)" nil t) + (unless (org-remember-escaped-%) + (when (and initial (equal (match-string 0) "%i")) + (save-match-data + (let* ((lead (buffer-substring + (point-at-bol) (match-beginning 0)))) + (setq v-i (mapconcat 'identity + (org-split-string initial "\n") + (concat "\n" lead)))))) + (replace-match + (or (eval (intern (concat "v-" (match-string 1)))) "") + t t))) + ;; %() embedded elisp (goto-char (point-min)) (while (re-search-forward "%\\((.+)\\)" nil t)