From a4bf5b0a92e47fb4ea0c5e4e5462a71b1c9b20a9 Mon Sep 17 00:00:00 2001 From: Adam Porter Date: Sun, 24 Dec 2023 01:10:27 -0600 Subject: [PATCH] Tidy: (org-ql-view--display) Take STRINGS instead of STRING No need to allocate one large string just to insert it into the buffer. --- org-ql-search.el | 3 +-- org-ql-view.el | 6 ++++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/org-ql-search.el b/org-ql-search.el index 57215f89..d08397ad 100644 --- a/org-ql-search.el +++ b/org-ql-search.el @@ -220,8 +220,7 @@ necessary." (symbol (symbol-value super-groups)) (list super-groups)))) (setf strings (org-super-agenda--group-items strings)))) - (org-ql-view--display :buffer buffer :header header - :string (s-join "\n" strings))))) + (org-ql-view--display :buffer buffer :header header :strings strings)))) ;;;###autoload (defun org-ql-search-block (query) diff --git a/org-ql-view.el b/org-ql-view.el index 5d452de9..e13cfaa6 100644 --- a/org-ql-view.el +++ b/org-ql-view.el @@ -408,7 +408,7 @@ update search arguments." (defvar bookmark-make-record-function) -(cl-defun org-ql-view--display (&key (buffer org-ql-view-buffer) header string) +(cl-defun org-ql-view--display (&key (buffer org-ql-view-buffer) header strings) "Display STRING in `org-ql-view' BUFFER. BUFFER may be a buffer, or a string naming a buffer, which is @@ -446,7 +446,9 @@ subsequent refreshing of the buffer: `org-ql-view-buffers-files', ;; Clear buffer, insert entries, etc. (let ((inhibit-read-only t)) (erase-buffer) - (insert string "\n") + (dolist (string strings) + (insert string "\n")) + (insert "\n") (pop-to-buffer (current-buffer) org-ql-view-display-buffer-action) (org-agenda-finalize) (goto-char (point-min))))))