瀏覽代碼

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")
 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")
 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.
              In Org-mode files, targets usually define a node.  Entries will
              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:
 
              (file \"path/to/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\")
                  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)
 	(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)
 	(let ((loc (org-id-find (nth 1 target))))
 	  (if (not loc)