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.
This commit is contained in:
Bastien Guerry 2011-03-06 17:31:56 +01:00
parent d2fb95dd4e
commit 030960559e
2 changed files with 6 additions and 17 deletions

View File

@ -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.

View File

@ -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)