Honor restriction when it is set from inside agenda dispatcher

This commit is contained in:
Ihor Radchenko 2020-04-12 13:40:09 +08:00
parent f4d7399e67
commit 317df58d98

View file

@ -195,10 +195,9 @@ If `org-ql-block-header' is non-nil, it is used as the header
string for the block, otherwise a the header is formed
automatically from the query."
(let (narrow-p old-beg old-end)
(when-let* ((from (pcase org-agenda-overriding-restriction
(when-let* ((from (pcase org-agenda-restrict
('nil (org-agenda-files nil 'ifmode))
('file (get 'org-agenda-files 'org-restrict))
('subtree (prog1 org-agenda-restrict
(_ (prog1 org-agenda-restrict
(with-current-buffer org-agenda-restrict
;; Narrow the buffer; remember to widen it later.
(setf old-beg (point-min) old-end (point-max)