aboutsummaryrefslogtreecommitdiffstats
path: root/lisp
diff options
context:
space:
mode:
authorMark Oteiza2016-02-04 18:00:37 +1100
committerLars Ingebrigtsen2016-02-04 18:00:51 +1100
commit535e2bef6dd7b9abe2567f865c8b24a06a555178 (patch)
tree95bc7781ab27b049c3db9e7b127cfad300fb9244 /lisp
parent8b35b109dd00e42a06f1031c49c471882460184f (diff)
downloademacs-535e2bef6dd7b9abe2567f865c8b24a06a555178.tar.gz
emacs-535e2bef6dd7b9abe2567f865c8b24a06a555178.zip
Add a new command to switch between erc buffers
* doc/misc/eww.texi: Document eww-switch-to-buffer and its keybinding * etc/NEWS: Mention new command * lisp/net/eww.el (eww-mode-map): Bind eww-switch-to-buffer to "s" (eww-mode-map): Add menu item (eww-switch-to-buffer): New command
Diffstat (limited to 'lisp')
-rw-r--r--lisp/net/eww.el20
1 files changed, 20 insertions, 0 deletions
diff --git a/lisp/net/eww.el b/lisp/net/eww.el
index 503651c9a38..bc74a0d31d2 100644
--- a/lisp/net/eww.el
+++ b/lisp/net/eww.el
@@ -689,6 +689,7 @@ the like."
689 (define-key map "R" 'eww-readable) 689 (define-key map "R" 'eww-readable)
690 (define-key map "H" 'eww-list-histories) 690 (define-key map "H" 'eww-list-histories)
691 (define-key map "E" 'eww-set-character-encoding) 691 (define-key map "E" 'eww-set-character-encoding)
692 (define-key map "s" 'eww-switch-to-buffer)
692 (define-key map "S" 'eww-list-buffers) 693 (define-key map "S" 'eww-list-buffers)
693 (define-key map "F" 'eww-toggle-fonts) 694 (define-key map "F" 'eww-toggle-fonts)
694 (define-key map [(meta C)] 'eww-toggle-colors) 695 (define-key map [(meta C)] 'eww-toggle-colors)
@@ -712,6 +713,7 @@ the like."
712 ["View page source" eww-view-source] 713 ["View page source" eww-view-source]
713 ["Copy page URL" eww-copy-page-url t] 714 ["Copy page URL" eww-copy-page-url t]
714 ["List histories" eww-list-histories t] 715 ["List histories" eww-list-histories t]
716 ["Switch to buffer" eww-switch-to-buffer t]
715 ["List buffers" eww-list-buffers t] 717 ["List buffers" eww-list-buffers t]
716 ["Add bookmark" eww-add-bookmark t] 718 ["Add bookmark" eww-add-bookmark t]
717 ["List bookmarks" eww-list-bookmarks t] 719 ["List bookmarks" eww-list-bookmarks t]
@@ -1498,6 +1500,24 @@ If CHARSET is nil then use UTF-8."
1498 (eww-reload nil 'utf-8) 1500 (eww-reload nil 'utf-8)
1499 (eww-reload nil charset))) 1501 (eww-reload nil charset)))
1500 1502
1503(defun eww-switch-to-buffer ()
1504 "Prompt for an EWW buffer to display in the selected window."
1505 (interactive)
1506 (let ((completion-extra-properties
1507 '(:annotation-function (lambda (buf)
1508 (with-current-buffer buf
1509 (format " %s" (eww-current-url)))))))
1510 (switch-to-buffer
1511 (read-buffer "Switch to EWW buffer: "
1512 (cl-loop for buf in (nreverse (buffer-list))
1513 if (with-current-buffer buf (derived-mode-p 'eww-mode))
1514 return buf)
1515 t
1516 (lambda (bufn)
1517 (with-current-buffer
1518 (if (consp bufn) (cdr bufn) (get-buffer bufn))
1519 (derived-mode-p 'eww-mode)))))))
1520
1501(defun eww-toggle-fonts () 1521(defun eww-toggle-fonts ()
1502 "Toggle whether to use monospaced or font-enabled layouts." 1522 "Toggle whether to use monospaced or font-enabled layouts."
1503 (interactive) 1523 (interactive)