Browse Source

org-capture.el (org-capture-import-remember-templates): Take care of adding :jump-to-captured option if needed

* org-capture.el (org-capture-import-remember-templates): Take
care of adding :jump-to-captured option if needed.
Bastien Guerry 7 years ago
parent
commit
2c41456b1d
1 changed files with 6 additions and 2 deletions
  1. 6 2
      lisp/org-capture.el

+ 6 - 2
lisp/org-capture.el

@@ -1786,7 +1786,7 @@ Such keywords are prefixed with \"%:\".  See
 		   (position (or (nth 4 entry) org-remember-default-headline))
 		   (type 'entry)
 		   (prepend org-reverse-note-order)
-		   immediate target)
+		   immediate target jump-to-captured)
 	       (cond
 		((member position '(top bottom))
 		 (setq target (list 'file file)
@@ -1800,9 +1800,13 @@ Such keywords are prefixed with \"%:\".  See
 		 (setq template (replace-match "" t t template)
 		       immediate t))
 
+	       (when (string-match "%&" template)
+		 (setq jump-to-captured t))
+
 	       (append (list key desc type target template)
 		       (if prepend '(:prepend t))
-		       (if immediate '(:immediate-finish t)))))
+		       (if immediate '(:immediate-finish t))
+		       (if jump-to-captured '(:jump-to-captured t)))))
 
 	   org-remember-templates))))