diff --git a/source/buffer.lisp b/source/buffer.lisp index dcd4f641836..383e62a2152 100644 --- a/source/buffer.lisp +++ b/source/buffer.lisp @@ -1079,16 +1079,6 @@ This is a low-level function. See `buffer-delete' for the high-level version." (buffers-delete (id buffer)) (add-to-recent-buffers buffer))) -(export-always 'internal-buffers) -(defun internal-buffers () - ;; Note that the `buffers' slot only keeps track of "main" buffers. - (append (sera:filter #'internal-url-p (buffer-list)) - (alex:flatten (loop for window in (window-list) - collect (active-prompt-buffers window) - collect (panel-buffers window) - collect (status-buffer window) - collect (message-buffer window))))) - (export-always 'buffer-list) (defun buffer-list () "Order is stable." @@ -1096,6 +1086,17 @@ This is a low-level function. See `buffer-delete' for the high-level version." #'> :key #'id)) +(export-always 'internal-buffers) +(defun internal-buffer-list (&key (all nil)) + ;; Note that the `buffers' slot only keeps track of "main" buffers. + (append (sera:filter #'internal-url-p (buffer-list)) + (when all + (alex:flatten (loop for window in (window-list) + collect (active-prompt-buffers window) + collect (panel-buffers window) + collect (status-buffer window) + collect (message-buffer window)))))) + (defun buffers-get (id) "Get the `buffer' with the corresponding ID." (gethash id (slot-value *browser* 'buffers))) diff --git a/source/status.lisp b/source/status.lisp index b3df5f535aa..686d6bc818d 100644 --- a/source/status.lisp +++ b/source/status.lisp @@ -350,7 +350,7 @@ Augment this with `style' of STATUS, if necessary." (loop for url in domain-deduplicated-urls collect ;; FIXME: Removing NIL buffers here too, the same reason as above. - (let* ((internal-buffers (remove-if-not #'internal-url-p buffers :key #'url)) + (let* ((internal-buffers (internal-buffer-list)) (domain (quri:uri-domain url)) (tab-display-text (if (internal-url-p url) "internal" diff --git a/source/urls.lisp b/source/urls.lisp index 30685a90767..f09cffa11f6 100644 --- a/source/urls.lisp +++ b/source/urls.lisp @@ -386,7 +386,9 @@ TITLE is purely informative." (query (quri:uri-query-params %url)) (title (alex:assoc-value query "title" :test 'equal)) (buffer-id (alex:assoc-value query "buffer" :test 'equal)) - (buffer (find (read-from-string buffer-id) (internal-buffers) :key 'id))) + (buffer (find (read-from-string buffer-id) + (internal-buffer-list :all t) + :key 'id))) (log:debug "Evaluate Lisp callback ~a in buffer ~a: ~a" request-id buffer title) (values (alex:if-let ((callback (sera:synchronized ((lisp-url-callbacks buffer))