Bladeren bron

Merge branch 'maint'

Nicolas Goaziou 8 jaren geleden
bovenliggende
commit
ad766435dc
2 gewijzigde bestanden met toevoegingen van 21 en 16 verwijderingen
  1. 2 2
      doc/org.texi
  2. 19 14
      lisp/org-capture.el

+ 2 - 2
doc/org.texi

@@ -7206,8 +7206,8 @@ A function to find the right location in the file.
 File to the entry that is currently being clocked.
 File to the entry that is currently being clocked.
 
 
 @item (function function-finding-location)
 @item (function function-finding-location)
-Most general way, write your own function to find both
-file and location.
+Most general way: write your own function which both visits
+the file and moves point to the right location.
 @end table
 @end table
 
 
 @item template
 @item template

+ 19 - 14
lisp/org-capture.el

@@ -166,8 +166,8 @@ target       Specification of where the captured item should be placed.
                 File to the entry that is currently being clocked
                 File to the entry that is currently being clocked
 
 
              (function function-finding-location)
              (function function-finding-location)
-                Most general way, write your own function to find both
-                file and location
+                Most general way: write your own function which both visits
+                the file and moves point to the right location
 
 
 template     The template for creating the capture item.  If you leave this
 template     The template for creating the capture item.  If you leave this
              empty, an appropriate default template will be used.  See below
              empty, an appropriate default template will be used.  See below
@@ -299,7 +299,12 @@ you can escape ambiguous cases with a backward slash, e.g., \\%i."
   :group 'org-capture
   :group 'org-capture
   :version "24.1"
   :version "24.1"
   :type
   :type
-  '(repeat
+  (let ((file-variants '(choice :tag "Filename       "
+				(file :tag "Literal")
+				(function :tag "Function")
+				(variable :tag "Variable")
+				(sexp :tag "Form"))))
+  `(repeat
     (choice :value ("" "" entry (file "~/org/notes.org") "")
     (choice :value ("" "" entry (file "~/org/notes.org") "")
 	    (list :tag "Multikey description"
 	    (list :tag "Multikey description"
 		  (string :tag "Keys       ")
 		  (string :tag "Keys       ")
@@ -316,45 +321,45 @@ you can escape ambiguous cases with a backward slash, e.g., \\%i."
 		  (choice :tag "Target location"
 		  (choice :tag "Target location"
 			  (list :tag "File"
 			  (list :tag "File"
 				(const :format "" file)
 				(const :format "" file)
-				(file :tag "  File"))
+				,file-variants)
 			  (list :tag "ID"
 			  (list :tag "ID"
 				(const :format "" id)
 				(const :format "" id)
 				(string :tag "  ID"))
 				(string :tag "  ID"))
 			  (list :tag "File & Headline"
 			  (list :tag "File & Headline"
 				(const :format "" file+headline)
 				(const :format "" file+headline)
-				(file   :tag "  File    ")
+				,file-variants
 				(string :tag "  Headline"))
 				(string :tag "  Headline"))
 			  (list :tag "File & Outline path"
 			  (list :tag "File & Outline path"
 				(const :format "" file+olp)
 				(const :format "" file+olp)
-				(file   :tag "  File    ")
+				,file-variants
 				(repeat :tag "Outline path" :inline t
 				(repeat :tag "Outline path" :inline t
 					(string :tag "Headline")))
 					(string :tag "Headline")))
 			  (list :tag "File & Regexp"
 			  (list :tag "File & Regexp"
 				(const :format "" file+regexp)
 				(const :format "" file+regexp)
-				(file   :tag "  File  ")
+				,file-variants
 				(regexp :tag "  Regexp"))
 				(regexp :tag "  Regexp"))
 			  (list :tag "File & Date tree"
 			  (list :tag "File & Date tree"
 				(const :format "" file+datetree)
 				(const :format "" file+datetree)
-				(file :tag "  File"))
+				,file-variants)
 			  (list :tag "File & Date tree, prompt for date"
 			  (list :tag "File & Date tree, prompt for date"
 				(const :format "" file+datetree+prompt)
 				(const :format "" file+datetree+prompt)
-				(file :tag "  File"))
+				,file-variants)
 			  (list :tag "File & Week tree"
 			  (list :tag "File & Week tree"
 				(const :format "" file+weektree)
 				(const :format "" file+weektree)
-				(file :tag "  File"))
+				,file-variants)
 			  (list :tag "File & Week tree, prompt for date"
 			  (list :tag "File & Week tree, prompt for date"
 				(const :format "" file+weektree+prompt)
 				(const :format "" file+weektree+prompt)
-				(file :tag "  File"))
+				,file-variants)
 			  (list :tag "File & function"
 			  (list :tag "File & function"
 				(const :format "" file+function)
 				(const :format "" file+function)
-				(file :tag "  File    ")
+				,file-variants
 				(sexp :tag "  Function"))
 				(sexp :tag "  Function"))
 			  (list :tag "Current clocking task"
 			  (list :tag "Current clocking task"
 				(const :format "" clock))
 				(const :format "" clock))
 			  (list :tag "Function"
 			  (list :tag "Function"
 				(const :format "" function)
 				(const :format "" function)
 				(sexp :tag "  Function")))
 				(sexp :tag "  Function")))
-		  (choice :tag "Template"
+		  (choice :tag "Template       "
 			  (string)
 			  (string)
 			  (list :tag "File"
 			  (list :tag "File"
 				(const :format "" file)
 				(const :format "" file)
@@ -375,7 +380,7 @@ you can escape ambiguous cases with a backward slash, e.g., \\%i."
 				   ((const :format "%v " :clock-resume) (const t))
 				   ((const :format "%v " :clock-resume) (const t))
 				   ((const :format "%v " :unnarrowed) (const t))
 				   ((const :format "%v " :unnarrowed) (const t))
 				   ((const :format "%v " :table-line-pos) (const t))
 				   ((const :format "%v " :table-line-pos) (const t))
-				   ((const :format "%v " :kill-buffer) (const t))))))))
+				   ((const :format "%v " :kill-buffer) (const t)))))))))
 
 
 (defcustom org-capture-before-finalize-hook nil
 (defcustom org-capture-before-finalize-hook nil
   "Hook that is run right before a capture process is finalized.
   "Hook that is run right before a capture process is finalized.