summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicolas Goaziou <n.goaziou@gmail.com>2011-07-18 17:42:01 +0200
committerNicolas Goaziou <n.goaziou@gmail.com>2011-07-19 08:56:10 +0200
commit819fbec64160c3c33884b116734c01f56be7606b (patch)
tree64a6eb8ead64f2f12481135b82ee62e651537ec9
parent08fc6384bcb3937d933f21d0b12c818603d8a279 (diff)
downloadorg-mode-819fbec64160c3c33884b116734c01f56be7606b.tar.gz
org-capture: %F is directory when capture starts in a dired buffer
* lisp/org-capture.el (org-capture): if no file is associated to current buffer, check dired buffer and try to retreive a possibly directory associated.
-rw-r--r--lisp/org-capture.el47
1 files changed, 24 insertions, 23 deletions
diff --git a/lisp/org-capture.el b/lisp/org-capture.el
index 798e9fa..d5eebea 100644
--- a/lisp/org-capture.el
+++ b/lisp/org-capture.el
@@ -212,31 +212,31 @@ Furthermore, the following %-escapes will be replaced with content:
%^{prompt} prompt the user for a string and replace this sequence with it.
A default value and a completion table ca be specified like this:
- %^{prompt|default|completion2|completion3|...}
- %t time stamp, date only
- %T time stamp with date and time
- %u, %U like the above, but inactive time stamps
+ %^{prompt|default|completion2|completion3|...}.
+ %t time stamp, date only.
+ %T time stamp with date and time.
+ %u, %U like the above, but inactive time stamps.
%^t like %t, but prompt for date. Similarly %^T, %^u, %^U.
- You may define a prompt like %^{Please specify birthday
- %<...> the result of format-time-string on the ... format specification
- %n user name (taken from `user-full-name')
- %a annotation, normally the link created with `org-store-link'
+ You may define a prompt like %^{Please specify birthday.
+ %<...> the result of format-time-string on the ... format specification.
+ %n user name (taken from `user-full-name').
+ %a annotation, normally the link created with `org-store-link'.
%i initial content, copied from the active region. If %i is
indented, the entire inserted text will be indented as well.
- %c current kill ring head
- %x content of the X clipboard
- %^C interactive selection of which kill or clip to use
- %^L like %^C, but insert as link
- %k title of currently clocked task
- %K link to currently clocked task
- %f file visited by current buffer when org-capture was called
- %F like @code{%f}, but include full path
- %^g prompt for tags, with completion on tags in target file
- %^G prompt for tags, with completion on all tags in all agenda files
- %^{prop}p prompt the user for a value for property `prop'
- %:keyword specific information for certain link types, see below
- %[pathname] insert the contents of the file given by `pathname'
- %(sexp) evaluate elisp `(sexp)' and replace with the result
+ %c current kill ring head.
+ %x content of the X clipboard.
+ %^C interactive selection of which kill or clip to use.
+ %^L like %^C, but insert as link.
+ %k title of currently clocked task.
+ %K link to currently clocked task.
+ %f file visited by current buffer when org-capture was called.
+ %F full path of the file or directory visited by current buffer.
+ %^g prompt for tags, with completion on tags in target file.
+ %^G prompt for tags, with completion on all tags in all agenda files.
+ %^{prop}p prompt the user for a value for property `prop'.
+ %:keyword specific information for certain link types, see below.
+ %[pathname] insert the contents of the file given by `pathname'.
+ %(sexp) evaluate elisp `(sexp)' and replace with the result.
%? After completing the template, position cursor here.
@@ -450,7 +450,8 @@ bypassed."
(org-capture-set-plist entry)
(org-capture-get-template)
(org-capture-put :original-buffer orig-buf
- :original-file (buffer-file-name orig-buf)
+ :original-file (or (buffer-file-name orig-buf)
+ (car (rassq orig-buf dired-buffers)))
:original-file-nondirectory
(and (buffer-file-name orig-buf)
(file-name-nondirectory