Skip to content

Commit

Permalink
Tidy: (org-ql-view--display) Take STRINGS instead of STRING
Browse files Browse the repository at this point in the history
No need to allocate one large string just to insert it into the
buffer.
  • Loading branch information
alphapapa committed Dec 24, 2023
1 parent 0e39372 commit a4bf5b0
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
3 changes: 1 addition & 2 deletions org-ql-search.el
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
6 changes: 4 additions & 2 deletions org-ql-view.el
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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))))))
Expand Down

0 comments on commit a4bf5b0

Please sign in to comment.