Honor restriction when it is set from inside agenda dispatcher
This commit is contained in:
parent
29090c4448
commit
0f5cf5eff3
1 changed files with 7 additions and 8 deletions
|
|
@ -233,15 +233,14 @@ If `org-ql-block-header' is non-nil, it is used as the header
|
||||||
string for the block, otherwise a the header is formed
|
string for the block, otherwise a the header is formed
|
||||||
automatically from the query."
|
automatically from the query."
|
||||||
(let (narrow-p old-beg old-end)
|
(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))
|
('nil (org-agenda-files nil 'ifmode))
|
||||||
('file (get 'org-agenda-files 'org-restrict))
|
(_ (prog1 org-agenda-restrict
|
||||||
('subtree (prog1 org-agenda-restrict
|
(with-current-buffer org-agenda-restrict
|
||||||
(with-current-buffer org-agenda-restrict
|
;; Narrow the buffer; remember to widen it later.
|
||||||
;; Narrow the buffer; remember to widen it later.
|
(setf old-beg (point-min) old-end (point-max)
|
||||||
(setf old-beg (point-min) old-end (point-max)
|
narrow-p t)
|
||||||
narrow-p t)
|
(narrow-to-region org-agenda-restrict-begin org-agenda-restrict-end))))))
|
||||||
(narrow-to-region org-agenda-restrict-begin org-agenda-restrict-end))))))
|
|
||||||
(items (org-ql-select from query
|
(items (org-ql-select from query
|
||||||
:action 'element-with-markers
|
:action 'element-with-markers
|
||||||
:narrow narrow-p)))
|
:narrow narrow-p)))
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue