1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2025-12-15 10:30:25 -08:00

(eww-switch-to-buffer): Prefer seq- functions to cl-

* lisp/net/eww.el (eww-switch-to-buffer): Don't reverse the list
of buffers since it doesn't do what we want any way (bug#79084).
This commit is contained in:
James Thomas 2025-07-22 08:28:58 +05:30 committed by Stefan Monnier
parent 83b623ea3a
commit 7cdaab61c4

View file

@ -2420,23 +2420,23 @@ If CHARSET is nil then use UTF-8."
"Prompt for an EWW buffer to display in the selected window.
If no such buffer exist, fallback to calling `eww'."
(interactive nil eww-mode)
(let ((list (cl-loop for buf in (nreverse (buffer-list))
if (and (eww--buffer-p buf)
(not (eq buf (current-buffer))))
collect (buffer-name buf))))
(let ((list (seq-filter
(lambda (buf)
(and (eww--buffer-p buf) (not (eq buf (current-buffer)))))
(buffer-list))))
(if list
(pop-to-buffer-same-window
(if (length= list 1)
(car list)
(completing-read "Switch to EWW buffer: "
(completion-table-with-metadata
list
(mapcar #'buffer-name list)
`((category . buffer)
(annotation-function
. ,(lambda (buf)
(with-current-buffer buf
(format " %s" (eww-current-url)))))))
nil t)))
nil t nil nil (car-safe list))))
(call-interactively #'eww))))
(defun eww-toggle-fonts ()