aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMark Oteiza2016-02-04 18:00:37 +1100
committerLars Ingebrigtsen2016-02-04 18:00:51 +1100
commit535e2bef6dd7b9abe2567f865c8b24a06a555178 (patch)
tree95bc7781ab27b049c3db9e7b127cfad300fb9244
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
-rw-r--r--doc/misc/eww.texi6
-rw-r--r--etc/NEWS5
-rw-r--r--lisp/net/eww.el20
3 files changed, 30 insertions, 1 deletions
diff --git a/doc/misc/eww.texi b/doc/misc/eww.texi
index 0e9bedbe1d0..afb1cafb744 100644
--- a/doc/misc/eww.texi
+++ b/doc/misc/eww.texi
@@ -164,12 +164,16 @@ You can view stored bookmarks with @kbd{B}
164(@code{eww-list-bookmarks}). This will open the bookmark buffer 164(@code{eww-list-bookmarks}). This will open the bookmark buffer
165@file{*eww bookmarks*}. 165@file{*eww bookmarks*}.
166 166
167@findex eww-switch-to-buffer
167@findex eww-list-buffers 168@findex eww-list-buffers
169@kindex s
168@kindex S 170@kindex S
169@cindex Multiple Buffers 171@cindex Multiple Buffers
170 To get summary of currently opened EWW buffers, press @kbd{S} 172 To get summary of currently opened EWW buffers, press @kbd{S}
171(@code{eww-list-buffers}). The @file{*eww buffers*} buffer allows you 173(@code{eww-list-buffers}). The @file{*eww buffers*} buffer allows you
172to quickly kill, flip through and switch to specific EWW buffer. 174to quickly kill, flip through and switch to specific EWW buffer. To
175switch EWW buffers through a minibuffer prompt, press @kbd{s}
176(@code{eww-switch-to-buffer}).
173 177
174@findex eww-browse-with-external-browser 178@findex eww-browse-with-external-browser
175@vindex shr-external-browser 179@vindex shr-external-browser
diff --git a/etc/NEWS b/etc/NEWS
index 31504325587..faf49b0b335 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -52,6 +52,11 @@ in these situations.
52 52
53* Changes in Specialized Modes and Packages in Emacs 25.2 53* Changes in Specialized Modes and Packages in Emacs 25.2
54 54
55** eww
56
57+++
58*** A new `s' command for switching to another eww buffer via the minibuffer.
59
55+++ 60+++
56** The commands that add ChangeLog entries now prefer a VCS root directory 61** The commands that add ChangeLog entries now prefer a VCS root directory
57for the ChangeLog file, if none already exists. Customize 62for the ChangeLog file, if none already exists. Customize
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)