summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicolas Goaziou <n.goaziou@gmail.com>2011-07-19 17:49:37 +0200
committerNicolas Goaziou <n.goaziou@gmail.com>2011-07-19 17:49:37 +0200
commitd883d0b01d872091391f80d0416952b70a743ee7 (patch)
tree067611e99cbef858c6fa617c4f96e2319587517d
parent8d27bf40d399241914f27bcb7c3c24ed2dc72199 (diff)
downloadorg-mode-d883d0b01d872091391f80d0416952b70a743ee7.tar.gz
org-capture: fix error with %F and dired not loaded
* lisp/org-capture.el (org-capture): if dired isn't loaded, `dired-buffers' isn't defined, and %F will fail. Thanks to Puneeth Chaganti for reporting this.
-rw-r--r--lisp/org-capture.el5
1 files changed, 4 insertions, 1 deletions
diff --git a/lisp/org-capture.el b/lisp/org-capture.el
index d5eebea..d80bddc 100644
--- a/lisp/org-capture.el
+++ b/lisp/org-capture.el
@@ -63,6 +63,7 @@
(defvar org-remember-default-headline)
(defvar org-remember-templates)
(defvar org-table-hlines)
+(defvar dired-buffers)
(defvar org-capture-clock-was-started nil
"Internal flag, noting if the clock was started.")
@@ -451,7 +452,9 @@ bypassed."
(org-capture-get-template)
(org-capture-put :original-buffer orig-buf
:original-file (or (buffer-file-name orig-buf)
- (car (rassq orig-buf dired-buffers)))
+ (and (featurep 'dired)
+ (car (rassq orig-buf
+ dired-buffers))))
:original-file-nondirectory
(and (buffer-file-name orig-buf)
(file-name-nondirectory