org-map-entries: Fix org-agenda-prepare-buffers call
* lisp/org.el (org-map-entries): Check that buffer-file-name is non-nil
before passing to org-agenda-prepare-buffers.
Like 11e8749
, this surfaced as an error when 05efa7a ("Backport commit
3a5f751 from Emacs master branch", 2015-08-08) replaced a
'(while (setq VAR (pop LIST)) BODY)' with '(dolist (VAR LIST) BODY)',
resulting in the body being executed when '(nil)' was passed to
org-agenda-prepare-buffers.
Reported-by: Robert Klein <roklein@roklein.de>
<http://permalink.gmane.org/gmane.emacs.orgmode/99779>
This commit is contained in:
parent
07a2d3d6f5
commit
44c8cd7136
|
@ -15490,7 +15490,7 @@ a *different* entry, you cannot use these techniques."
|
||||||
(if (not scope)
|
(if (not scope)
|
||||||
(progn
|
(progn
|
||||||
(org-agenda-prepare-buffers
|
(org-agenda-prepare-buffers
|
||||||
(list (buffer-file-name (current-buffer))))
|
(and buffer-file-name (list buffer-file-name)))
|
||||||
(setq res (org-scan-tags func matcher todo-only start-level)))
|
(setq res (org-scan-tags func matcher todo-only start-level)))
|
||||||
;; Get the right scope
|
;; Get the right scope
|
||||||
(cond
|
(cond
|
||||||
|
@ -15502,7 +15502,7 @@ a *different* entry, you cannot use these techniques."
|
||||||
(setq scope (org-agenda-files t))
|
(setq scope (org-agenda-files t))
|
||||||
(setq scope (org-add-archive-files scope)))
|
(setq scope (org-add-archive-files scope)))
|
||||||
((eq scope 'file)
|
((eq scope 'file)
|
||||||
(setq scope (list (buffer-file-name))))
|
(setq scope (and buffer-file-name (list buffer-file-name))))
|
||||||
((eq scope 'file-with-archives)
|
((eq scope 'file-with-archives)
|
||||||
(setq scope (org-add-archive-files (list (buffer-file-name))))))
|
(setq scope (org-add-archive-files (list (buffer-file-name))))))
|
||||||
(org-agenda-prepare-buffers scope)
|
(org-agenda-prepare-buffers scope)
|
||||||
|
|
Loading…
Reference in New Issue