فهرست منبع

org-capture.el: remove (currentfile) as a file specification in templates.

You can already use a function like (buffer-file-name) to get the currently
visited file.  So (currentfile) is not necessary.
Bastien Guerry 14 سال پیش
والد
کامیت
030960559e
2فایلهای تغییر یافته به همراه6 افزوده شده و 17 حذف شده
  1. 0 4
      doc/org.texi
  2. 6 13
      lisp/org-capture.el

+ 0 - 4
doc/org.texi

@@ -6359,10 +6359,6 @@ Valid values are:
 @item (file "path/to/file")
 @item (file "path/to/file")
 Text will be placed at the beginning or end of that file.
 Text will be placed at the beginning or end of that file.
 
 
-@item (currentfile)
-Text will be placed at the beginning or end of the file 
-@code{org-capture} is called from.
-
 @item (id "id of existing org entry")
 @item (id "id of existing org entry")
 Filing as child of this entry, or in the body of the entry.
 Filing as child of this entry, or in the body of the entry.
 
 

+ 6 - 13
lisp/org-capture.el

@@ -113,17 +113,18 @@ type         The type of entry.  Valid types are:
 target       Specification of where the captured item should be placed.
 target       Specification of where the captured item should be placed.
              In Org-mode files, targets usually define a node.  Entries will
              In Org-mode files, targets usually define a node.  Entries will
              become children of this node, other types will be added to the
              become children of this node, other types will be added to the
-             table or list in the body of this node.
+             table or list in the body of this node.  
+
+             Most target specifications contain a file name.  If that file 
+             name is the empty string, it defaults to `org-default-notes-file'.  
+             A file can also be given as a variable, function, or Emacs Lisp 
+             form.
 
 
              Valid values are:
              Valid values are:
 
 
              (file \"path/to/file\")
              (file \"path/to/file\")
                  Text will be placed at the beginning or end of that file
                  Text will be placed at the beginning or end of that file
 
 
-             (currentfile)
-                 Text will be placed at the beginning or end of the file
-                 org-capture is called from
-
              (id \"id of existing org entry\")
              (id \"id of existing org entry\")
                  File as child of this entry, or in the body of the entry
                  File as child of this entry, or in the body of the entry
 
 
@@ -676,14 +677,6 @@ already gone.  Any prefix argument will be passed to the refile command."
 	(widen)
 	(widen)
 	(setq target-entry-p nil))
 	(setq target-entry-p nil))
 
 
-       ((eq (car target) 'currentfile)
-	(if (not (and (buffer-file-name) (org-mode-p)))
-	    (error "Cannot call this capture template outside of an Org buffer")
-	  (set-buffer (org-capture-target-buffer (buffer-file-name)))
-	  (org-capture-put-target-region-and-position)
-	  (widen)
-	  (setq target-entry-p nil)))
-
        ((eq (car target) 'id)
        ((eq (car target) 'id)
 	(let ((loc (org-id-find (nth 1 target))))
 	(let ((loc (org-id-find (nth 1 target))))
 	  (if (not loc)
 	  (if (not loc)