diff --git a/lisp/org-capture.el b/lisp/org-capture.el index c95ce7c72..cd4fcbf37 100644 --- a/lisp/org-capture.el +++ b/lisp/org-capture.el @@ -995,7 +995,7 @@ Store them in the capture property list." ((or `here `(here)) (org-capture-put :exact-position (point) :insert-here t)) - (`(file ,(and path (pred stringp))) + (`(file ,path) (set-buffer (org-capture-target-buffer path)) (org-capture-put-target-region-and-position) (widen) @@ -1008,7 +1008,7 @@ Store them in the capture property list." (org-capture-put-target-region-and-position) (goto-char position)) (_ (error "Cannot find target ID \"%s\"" id)))) - (`(file+headline ,(and path (pred stringp)) ,(and headline (pred stringp))) + (`(file+headline ,path ,(and headline (pred stringp))) (set-buffer (org-capture-target-buffer path)) ;; Org expects the target file to be in Org mode, otherwise ;; it throws an error. However, the default notes files @@ -1030,7 +1030,7 @@ Store them in the capture property list." (unless (bolp) (insert "\n")) (insert "* " headline "\n") (forward-line -1))) - (`(file+olp ,(and path (pred stringp)) . ,(and outline-path (guard outline-path))) + (`(file+olp ,path . ,(and outline-path (guard outline-path))) (let ((m (org-find-olp (cons (org-capture-expand-file path) outline-path)))) (set-buffer (marker-buffer m)) @@ -1038,7 +1038,7 @@ Store them in the capture property list." (widen) (goto-char m) (set-marker m nil))) - (`(file+regexp ,(and path (pred stringp)) ,(and regexp (pred stringp))) + (`(file+regexp ,path ,(and regexp (pred stringp))) (set-buffer (org-capture-target-buffer path)) (org-capture-put-target-region-and-position) (widen) @@ -1051,7 +1051,7 @@ Store them in the capture property list." (org-capture-put :exact-position (point)) (setq target-entry-p (and (derived-mode-p 'org-mode) (org-at-heading-p))))) - (`(file+olp+datetree ,(and path (pred stringp)) . ,outline-path) + (`(file+olp+datetree ,path . ,outline-path) (let ((m (if outline-path (org-find-olp (cons (org-capture-expand-file path) outline-path)) @@ -1106,7 +1106,7 @@ Store them in the capture property list." ;; the following is the keep-restriction argument for ;; org-datetree-find-date-create (when outline-path 'subtree-at-point)))) - (`(file+function ,(and path (pred stringp)) ,(and function (pred functionp))) + (`(file+function ,path ,(and function (pred functionp))) (set-buffer (org-capture-target-buffer path)) (org-capture-put-target-region-and-position) (widen)