Fix: (org-ql-agenda-block) Insert newline after block

Fixes #40.  Thanks to Milan Zamazal (@mz-pdm).
This commit is contained in:
Adam Porter 2019-08-25 19:59:24 -05:00
parent 68697c38a1
commit c576813fc8

View file

@ -342,7 +342,8 @@ QUERY should be an `org-ql' query form. Like other agenda block
commands, it searches files returned by function commands, it searches files returned by function
`org-agenda-files'. Intended to be used as a user-defined `org-agenda-files'. Intended to be used as a user-defined
function in `org-agenda-custom-commands'. QUERY corresponds to function in `org-agenda-custom-commands'. QUERY corresponds to
the `match' item in the custom command form." the `match' item in the custom command form. Inserts a newline
after the block."
(when-let* ((from (org-agenda-files nil 'ifmode)) (when-let* ((from (org-agenda-files nil 'ifmode))
(items (org-ql-select from (items (org-ql-select from
query :action 'element-with-markers))) query :action 'element-with-markers)))
@ -359,7 +360,8 @@ the `match' item in the custom command form."
(->> items (->> items
(-map #'org-ql-agenda--format-element) (-map #'org-ql-agenda--format-element)
org-agenda-finalize-entries org-agenda-finalize-entries
insert))) insert)
(insert "\n")))
(defalias 'org-ql-block 'org-ql-agenda-block) (defalias 'org-ql-block 'org-ql-agenda-block)