1
0
mirror of https://git.savannah.gnu.org/git/emacs.git synced 2024-11-22 07:09:54 +00:00

Exclude current buffer from eww-switch-to-buffer

* lisp/net/eww.el (eww-switch-to-buffer): Exclude current buffer from
the completion list to avoid an extra cycling keystroke.  (Bug#65914)
This commit is contained in:
James Thomas 2023-09-16 05:50:58 +05:30 committed by Stefan Kangas
parent 3df581972f
commit 5d9dbf17cf

View File

@ -2062,7 +2062,8 @@ If CHARSET is nil then use UTF-8."
(let ((completion-extra-properties
'(:annotation-function (lambda (buf)
(with-current-buffer buf
(format " %s" (eww-current-url)))))))
(format " %s" (eww-current-url))))))
(curbuf (current-buffer)))
(pop-to-buffer-same-window
(read-buffer "Switch to EWW buffer: "
(cl-loop for buf in (nreverse (buffer-list))
@ -2070,9 +2071,10 @@ If CHARSET is nil then use UTF-8."
return buf)
t
(lambda (bufn)
(with-current-buffer
(if (consp bufn) (cdr bufn) (get-buffer bufn))
(derived-mode-p 'eww-mode)))))))
(setq bufn (if (consp bufn) (cdr bufn) (get-buffer bufn)))
(and (with-current-buffer bufn
(derived-mode-p 'eww-mode))
(not (eq bufn curbuf))))))))
(defun eww-toggle-fonts ()
"Toggle whether to use monospaced or font-enabled layouts."