From 7cdaab61c4be9f143d0ba98a9339586bb010df4f Mon Sep 17 00:00:00 2001 From: James Thomas Date: Tue, 22 Jul 2025 08:28:58 +0530 Subject: [PATCH] (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). --- lisp/net/eww.el | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/lisp/net/eww.el b/lisp/net/eww.el index 6f06302cb3f..666a5025c2c 100644 --- a/lisp/net/eww.el +++ b/lisp/net/eww.el @@ -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 ()