GNU bug report logs - #22244
25.0.50; Make eww use display-buffer to display eww buffer

Previous Next

Package: emacs;

Reported by: Michael Heerdegen <michael_heerdegen <at> web.de>

Date: Sat, 26 Dec 2015 16:56:01 UTC

Severity: wishlist

Tags: fixed

Found in version 25.0.50

Fixed in versions 25.1, 25.2

Done: Lars Ingebrigtsen <larsi <at> gnus.org>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 22244 in the body.
You can then email your comments to 22244 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#22244; Package emacs. (Sat, 26 Dec 2015 16:56:01 GMT) Full text and rfc822 format available.

Acknowledgement sent to Michael Heerdegen <michael_heerdegen <at> web.de>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Sat, 26 Dec 2015 16:56:01 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Michael Heerdegen <michael_heerdegen <at> web.de>
To: bug-gnu-emacs <at> gnu.org
Cc: Lars Ingebrigtsen <larsi <at> gnus.org>
Subject: 25.0.50; Make eww use display-buffer to display eww buffer
Date: Sat, 26 Dec 2015 17:54:57 +0100
Hello,

this has been discussed several times, but since Lars is here now, an
official request:

Wouldn't it be better to let eww use display-buffer instead of
switch-to-buffer in several places (at least, when calling eww and
eww-browse-url, probably some more)?  display-buffer's behavior can be
controlled via binding variables, while display-buffer makes the same a
horror.

For example, when I'm reading newspaper feeds from Gnus and want to open
a link with eww in a new pop up frame, I have to use this ugly hack,
ugh:

--8<---------------cut here---------------start------------->8---
(defun my-eww-browse-url-pop-up-frame (url &optional _)
  "My private version of `eww-browse-url', creating a new frame."
  (let ((frame (make-frame '()))
        (buffer (generate-new-buffer "*eww*"))
        win)
    (with-current-buffer buffer
      (eww-mode)
      (eww url))
    (select-frame-set-input-focus frame)
    (setq win (frame-root-window frame))
    (set-window-buffer win buffer)
    frame))
--8<---------------cut here---------------end--------------->8---


Thanks,

Michael.




In GNU Emacs 25.0.50.8 (x86_64-pc-linux-gnu, GTK+ Version 3.18.5)
 of 2015-12-23
Repository revision: 09053075225fec8a6cf7a72017a6dfc1ec6b6f0c
Windowing system distributor 'The X.Org Foundation', version 11.0.11703000
System Description:	Debian GNU/Linux testing (stretch)

Configured features:
XPM JPEG TIFF GIF PNG RSVG IMAGEMAGICK SOUND DBUS GSETTINGS NOTIFY
LIBXML2 FREETYPE XFT ZLIB TOOLKIT_SCROLL_BARS GTK3 X11

Important settings:
  value of $LC_ALL: de_DE.utf8
  value of $LC_COLLATE: C
  value of $LC_TIME: C
  value of $LANG: de_DE.utf8
  locale-coding-system: utf-8-unix





Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#22244; Package emacs. (Sat, 26 Dec 2015 17:04:01 GMT) Full text and rfc822 format available.

Message #8 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Michael Heerdegen <michael_heerdegen <at> web.de>
Cc: bug-gnu-emacs <at> gnu.org
Subject: Re: 25.0.50; Make eww use display-buffer to display eww buffer
Date: Sat, 26 Dec 2015 18:02:42 +0100
Michael Heerdegen <michael_heerdegen <at> web.de> writes:

> Wouldn't it be better to let eww use display-buffer instead of
> switch-to-buffer in several places (at least, when calling eww and
> eww-browse-url, probably some more)?  display-buffer's behavior can be
> controlled via binding variables, while display-buffer makes the same a
> horror.

I'm not familiar with display-buffer, but by default it seems to work
like pop-to-buffer?  
-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#22244; Package emacs. (Sat, 26 Dec 2015 17:30:02 GMT) Full text and rfc822 format available.

Message #11 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Michael Heerdegen <michael_heerdegen <at> web.de>
To: Lars Ingebrigtsen <larsi <at> gnus.org>
Cc: bug-gnu-emacs <at> gnu.org
Subject: Re: 25.0.50; Make eww use display-buffer to display eww buffer
Date: Sat, 26 Dec 2015 18:29:12 +0100
Lars Ingebrigtsen <larsi <at> gnus.org> writes:

> I'm not familiar with display-buffer, but by default it seems to work
> like pop-to-buffer?  

I wouldn't say so.  Today, pop-to-buffer is defined in terms of
display-buffer (it calls it).

The semantics of display-buffer are a bit complicated (it's documented
in the manual, but you'll need some minutes to understand the concept) -
but it is highly customizable via user options.  display-buffer can be
controlled on a finer level that in the old days (with variables like
same-window-buffer-names etc.).  AFAIK it's the standard way today to
display a buffer.

User preferences can be overridden/modified/refined at run-time when
calling display-buffer via the optional args.

The default behavior of display-buffer depends on the user options

display-buffer-overriding-action
display-buffer-base-action
display-buffer-fallback-action

With the default values, these functions are tried in order (that's the
default value of `display-buffer-fallback-action'):

(display-buffer--maybe-same-window
 display-buffer-reuse-window
 display-buffer--maybe-pop-up-frame-or-window
 display-buffer-in-previous-window
 display-buffer-use-some-window
 display-buffer-pop-up-frame)

So, in the unconfigured case, the buffer is just displayed in the
selected window.


Regards,

Michael.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#22244; Package emacs. (Sat, 26 Dec 2015 17:47:01 GMT) Full text and rfc822 format available.

Message #14 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Michael Heerdegen <michael_heerdegen <at> web.de>
Cc: bug-gnu-emacs <at> gnu.org
Subject: Re: 25.0.50; Make eww use display-buffer to display eww buffer
Date: Sat, 26 Dec 2015 18:45:43 +0100
Michael Heerdegen <michael_heerdegen <at> web.de> writes:

> With the default values, these functions are tried in order (that's the
> default value of `display-buffer-fallback-action'):
>
> (display-buffer--maybe-same-window
>  display-buffer-reuse-window
>  display-buffer--maybe-pop-up-frame-or-window
>  display-buffer-in-previous-window
>  display-buffer-use-some-window
>  display-buffer-pop-up-frame)
>
> So, in the unconfigured case, the buffer is just displayed in the
> selected window.

That's not what I get if I eval

(display-buffer (get-buffer-create "foo"))

in a frame with a single window, where "foo" doesn't exist before.  It
pops the buffer up in a new window...

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#22244; Package emacs. (Sat, 26 Dec 2015 18:10:02 GMT) Full text and rfc822 format available.

Message #17 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Michael Heerdegen <michael_heerdegen <at> web.de>
To: Lars Ingebrigtsen <larsi <at> gnus.org>
Cc: bug-gnu-emacs <at> gnu.org
Subject: Re: 25.0.50; Make eww use display-buffer to display eww buffer
Date: Sat, 26 Dec 2015 19:09:33 +0100
Lars Ingebrigtsen <larsi <at> gnus.org> writes:

> That's not what I get if I eval
>
> (display-buffer (get-buffer-create "foo"))
>
> in a frame with a single window, where "foo" doesn't exist before.  It
> pops the buffer up in a new window...

Indeed, I was to fast.  The first action that succeeds by default is
`display-buffer-use-some-window'.

Anyway, you can specify a default action in your `display-buffer' call
so that the thing behaves by default as it does now, and the user can
modify this behavior if he wants by customizing or binding
display-buffer-alist.


Michael.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#22244; Package emacs. (Sat, 26 Dec 2015 18:20:02 GMT) Full text and rfc822 format available.

Message #20 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Michael Heerdegen <michael_heerdegen <at> web.de>
Cc: bug-gnu-emacs <at> gnu.org
Subject: Re: 25.0.50; Make eww use display-buffer to display eww buffer
Date: Sat, 26 Dec 2015 19:19:14 +0100
Michael Heerdegen <michael_heerdegen <at> web.de> writes:

> Anyway, you can specify a default action in your `display-buffer' call
> so that the thing behaves by default as it does now, and the user can
> modify this behavior if he wants by customizing or binding
> display-buffer-alist.

Right.  Patches are welcome.  :-)

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#22244; Package emacs. (Sat, 26 Dec 2015 23:20:02 GMT) Full text and rfc822 format available.

Message #23 received at 22244 <at> debbugs.gnu.org (full text, mbox):

From: Michael Heerdegen <michael_heerdegen <at> web.de>
To: Lars Ingebrigtsen <larsi <at> gnus.org>
Cc: 22244 <at> debbugs.gnu.org
Subject: Re: bug#22244: 25.0.50;
 Make eww use display-buffer to display eww buffer
Date: Sun, 27 Dec 2015 00:19:28 +0100
Lars Ingebrigtsen <larsi <at> gnus.org> writes:

> Right.  Patches are welcome.  :-)

Ok, I'll give it a try.  Shouldn't be hard, but I want to be sure I do
the right thing, and have a look how this is done at other places in the
code etc.

How long are you available here, Lars?


Michael.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#22244; Package emacs. (Sat, 26 Dec 2015 23:29:02 GMT) Full text and rfc822 format available.

Message #26 received at 22244 <at> debbugs.gnu.org (full text, mbox):

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Michael Heerdegen <michael_heerdegen <at> web.de>
Cc: 22244 <at> debbugs.gnu.org
Subject: Re: bug#22244: 25.0.50;
 Make eww use display-buffer to display eww buffer
Date: Sun, 27 Dec 2015 00:28:05 +0100
Michael Heerdegen <michael_heerdegen <at> web.de> writes:

> Ok, I'll give it a try.  Shouldn't be hard, but I want to be sure I do
> the right thing, and have a look how this is done at other places in the
> code etc.
>
> How long are you available here, Lars?

For a couple more days, and then most of February, I think.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#22244; Package emacs. (Sat, 09 Jan 2016 06:03:01 GMT) Full text and rfc822 format available.

Message #29 received at 22244 <at> debbugs.gnu.org (full text, mbox):

From: Michael Heerdegen <michael_heerdegen <at> web.de>
To: Lars Ingebrigtsen <larsi <at> gnus.org>
Cc: 22244 <at> debbugs.gnu.org
Subject: Re: bug#22244: 25.0.50;
 Make eww use display-buffer to display eww buffer
Date: Sat, 09 Jan 2016 07:01:53 +0100
Lars Ingebrigtsen <larsi <at> gnus.org> writes:

> For a couple more days, and then most of February, I think.

pop-to-buffer-same-window is the function we could use.

But this issue is not as easy as it seemed.  The whole code must be
reworked to work with multiple eww buffers.  E.g.

(defun eww-browse-url (url &optional new-window)
  (cond (new-window
	 (switch-to-buffer (generate-new-buffer "*eww*"))
         (eww-mode)))
  (eww url))

creates a new buffer when new-window is non-nil, but eww calls
eww-setup-buffer, which unconditionally goes back to a hardcoded "*eww*"
named buffer again.

I don't know the code well and would prefer if you could had a look.  I
dunno in which direction we want to go (tabs, some day, maybe?).


Regards,

Michael.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#22244; Package emacs. (Tue, 02 Feb 2016 04:56:01 GMT) Full text and rfc822 format available.

Message #32 received at 22244 <at> debbugs.gnu.org (full text, mbox):

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Michael Heerdegen <michael_heerdegen <at> web.de>
Cc: 22244 <at> debbugs.gnu.org
Subject: Re: bug#22244: 25.0.50;
 Make eww use display-buffer to display eww buffer
Date: Tue, 02 Feb 2016 15:55:29 +1100
Michael Heerdegen <michael_heerdegen <at> web.de> writes:

> But this issue is not as easy as it seemed.  The whole code must be
> reworked to work with multiple eww buffers.  E.g.
>
> (defun eww-browse-url (url &optional new-window)
>   (cond (new-window
> 	 (switch-to-buffer (generate-new-buffer "*eww*"))
>          (eww-mode)))
>   (eww url))
>
> creates a new buffer when new-window is non-nil, but eww calls
> eww-setup-buffer, which unconditionally goes back to a hardcoded "*eww*"
> named buffer again.

Yeah, that doesn't work very well.  I've now fiddled with it a bit more,
and new-window now does what it's supposed to do.

> I don't know the code well and would prefer if you could had a look.  I
> dunno in which direction we want to go (tabs, some day, maybe?).

Hm...  I don't quite see it.  Switching between buffers now is so...
standard.  Would tabs be something other than buffers?

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#22244; Package emacs. (Tue, 02 Feb 2016 04:59:02 GMT) Full text and rfc822 format available.

Message #35 received at 22244 <at> debbugs.gnu.org (full text, mbox):

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Michael Heerdegen <michael_heerdegen <at> web.de>
Cc: 22244 <at> debbugs.gnu.org
Subject: Re: bug#22244: 25.0.50;
 Make eww use display-buffer to display eww buffer
Date: Tue, 02 Feb 2016 15:58:13 +1100
Michael Heerdegen <michael_heerdegen <at> web.de> writes:

> Lars Ingebrigtsen <larsi <at> gnus.org> writes:
>
>> For a couple more days, and then most of February, I think.
>
> pop-to-buffer-same-window is the function we could use.

Yeah, that seems to do the trick.  Committed and pushed.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




Added tag(s) fixed. Request was from Lars Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Tue, 02 Feb 2016 04:59:02 GMT) Full text and rfc822 format available.

bug marked as fixed in version 25.1, send any further explanations to 22244 <at> debbugs.gnu.org and Michael Heerdegen <michael_heerdegen <at> web.de> Request was from Lars Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Tue, 02 Feb 2016 04:59:02 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#22244; Package emacs. (Tue, 02 Feb 2016 14:20:02 GMT) Full text and rfc822 format available.

Message #42 received at 22244 <at> debbugs.gnu.org (full text, mbox):

From: Michael Heerdegen <michael_heerdegen <at> web.de>
To: Lars Ingebrigtsen <larsi <at> gnus.org>
Cc: 22244 <at> debbugs.gnu.org
Subject: Re: bug#22244: 25.0.50;
 Make eww use display-buffer to display eww buffer
Date: Tue, 02 Feb 2016 15:19:07 +0100
Lars Ingebrigtsen <larsi <at> gnus.org> writes:

> > pop-to-buffer-same-window is the function we could use.
>
> Yeah, that seems to do the trick.  Committed and pushed.

Thanks so far.

Do we need to do the same at other positions where `switch-to-buffer' is
used?

I think it is needed at least for `eww-browse-url'.


Regards,

Michael.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#22244; Package emacs. (Tue, 02 Feb 2016 15:25:02 GMT) Full text and rfc822 format available.

Message #45 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Mark Oteiza <mvoteiza <at> udel.edu>
To: bug-gnu-emacs <at> gnu.org
Subject: Re: bug#22244: 25.0.50;
 Make eww use display-buffer to display eww buffer
Date: Tue, 02 Feb 2016 10:24:05 -0500
Lars Ingebrigtsen <larsi <at> gnus.org> writes:

> Michael Heerdegen <michael_heerdegen <at> web.de> writes:
>> I don't know the code well and would prefer if you could had a look.  I
>> dunno in which direction we want to go (tabs, some day, maybe?).
>
> Hm...  I don't quite see it.  Switching between buffers now is so...
> standard.  Would tabs be something other than buffers?

Just an idle though: something like erc's erc-switch-to-buffer could be
a step above standard buffer switching.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#22244; Package emacs. (Wed, 03 Feb 2016 02:00:03 GMT) Full text and rfc822 format available.

Message #48 received at 22244 <at> debbugs.gnu.org (full text, mbox):

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Mark Oteiza <mvoteiza <at> udel.edu>
Cc: 22244 <at> debbugs.gnu.org
Subject: Re: bug#22244: 25.0.50;
 Make eww use display-buffer to display eww buffer
Date: Wed, 03 Feb 2016 12:59:32 +1100
Mark Oteiza <mvoteiza <at> udel.edu> writes:

> Just an idle though: something like erc's erc-switch-to-buffer could be
> a step above standard buffer switching.

I use ido mode, and that's as convenient, I find...

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#22244; Package emacs. (Wed, 03 Feb 2016 02:37:01 GMT) Full text and rfc822 format available.

Message #51 received at 22244 <at> debbugs.gnu.org (full text, mbox):

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Michael Heerdegen <michael_heerdegen <at> web.de>
Cc: 22244 <at> debbugs.gnu.org
Subject: Re: bug#22244: 25.0.50;
 Make eww use display-buffer to display eww buffer
Date: Wed, 03 Feb 2016 13:35:49 +1100
Michael Heerdegen <michael_heerdegen <at> web.de> writes:

> Do we need to do the same at other positions where `switch-to-buffer' is
> used?

I've now done so.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#22244; Package emacs. (Wed, 03 Feb 2016 02:58:02 GMT) Full text and rfc822 format available.

Message #54 received at 22244 <at> debbugs.gnu.org (full text, mbox):

From: Mark Oteiza <mvoteiza <at> udel.edu>
To: Lars Ingebrigtsen <larsi <at> gnus.org>
Cc: 22244 <at> debbugs.gnu.org
Subject: Re: bug#22244: 25.0.50; Make eww use display-buffer to display eww
 buffer
Date: Tue, 2 Feb 2016 21:57:11 -0500
On 03/02/16 at 12:59pm, Lars Ingebrigtsen wrote:
> Mark Oteiza <mvoteiza <at> udel.edu> writes:
> 
> > Just an idle though: something like erc's erc-switch-to-buffer could be
> > a step above standard buffer switching.
> 
> I use ido mode, and that's as convenient, I find...

I don't, but I was thinking more like "S but in the minibuffer". Where the
buffer names in erc are meaningful, in eww they are not so much (at
least in my case where I'm usually using clone-buffer to make more eww
buffers). So the completion candidates might be the buffer urls, titles, or
instead just showing annotations like so:

(defun eww-switch-to-buffer ()
  "Prompt for an EWW buffer to switch to."
  (interactive)
  (let ((completion-extra-properties
         '(:annotation-function
           (lambda (bufn)
             (with-current-buffer bufn
               (format " %s" (eww-current-url)))))))
    (switch-to-buffer
     (read-buffer "Switch to EWW buffer: "
                  (cl-loop for buf in (nreverse (buffer-list))
                           if (with-current-buffer buf (derived-mode-p 'eww-mode))
                           return buf)
                  t
                  (lambda (bufn)
                    (let ((buf (if (consp bufn) (cdr bufn) (get-buffer bufn))))
                      (with-current-buffer buf
                        (derived-mode-p 'eww-mode))))))))




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#22244; Package emacs. (Thu, 04 Feb 2016 02:20:01 GMT) Full text and rfc822 format available.

Message #57 received at 22244 <at> debbugs.gnu.org (full text, mbox):

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Mark Oteiza <mvoteiza <at> udel.edu>
Cc: 22244 <at> debbugs.gnu.org
Subject: Re: bug#22244: 25.0.50;
 Make eww use display-buffer to display eww buffer
Date: Thu, 04 Feb 2016 13:18:47 +1100
Mark Oteiza <mvoteiza <at> udel.edu> writes:

> I don't, but I was thinking more like "S but in the minibuffer". Where the
> buffer names in erc are meaningful, in eww they are not so much (at
> least in my case where I'm usually using clone-buffer to make more eww
> buffers). So the completion candidates might be the buffer urls, titles, or
> instead just showing annotations like so:

That sounds pretty cool...  Alternatively we could give the eww buffers
better names (based on URLs or titles).  That may be a handful, though.

Could you send a patch for this new command against the trunk (including
documentation)?

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#22244; Package emacs. (Thu, 04 Feb 2016 06:32:02 GMT) Full text and rfc822 format available.

Message #60 received at 22244 <at> debbugs.gnu.org (full text, mbox):

From: Mark Oteiza <mvoteiza <at> udel.edu>
To: Lars Ingebrigtsen <larsi <at> gnus.org>
Cc: 22244 <at> debbugs.gnu.org
Subject: [PATCH] New command eww-switch-to-buffer
Date: Thu, 4 Feb 2016 01:31:43 -0500
* 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
---
On 04/02/16 at 01:18pm, Lars Ingebrigtsen wrote:
> Mark Oteiza <mvoteiza <at> udel.edu> writes:
> 
> > I don't, but I was thinking more like "S but in the minibuffer". Where the
> > buffer names in erc are meaningful, in eww they are not so much (at
> > least in my case where I'm usually using clone-buffer to make more eww
> > buffers). So the completion candidates might be the buffer urls, titles, or
> > instead just showing annotations like so:
> 
> That sounds pretty cool...  Alternatively we could give the eww buffers
> better names (based on URLs or titles).  That may be a handful, though.
> 
> Could you send a patch for this new command against the trunk (including
> documentation)?

Hopefully covered everything. "s" seemed a sensible bind.

 doc/misc/eww.texi |  6 +++++-
 etc/NEWS          |  5 +++++
 lisp/net/eww.el   | 20 ++++++++++++++++++++
 3 files changed, 30 insertions(+), 1 deletion(-)

diff --git a/doc/misc/eww.texi b/doc/misc/eww.texi
index 0e9bedb..afb1caf 100644
--- a/doc/misc/eww.texi
+++ b/doc/misc/eww.texi
@@ -164,12 +164,16 @@ You can view stored bookmarks with @kbd{B}
 (@code{eww-list-bookmarks}).  This will open the bookmark buffer
 @file{*eww bookmarks*}.
 
+@findex eww-switch-to-buffer
 @findex eww-list-buffers
+@kindex s
 @kindex S
 @cindex Multiple Buffers
   To get summary of currently opened EWW buffers, press @kbd{S}
 (@code{eww-list-buffers}).  The @file{*eww buffers*} buffer allows you
-to quickly kill, flip through and switch to specific EWW buffer.
+to quickly kill, flip through and switch to specific EWW buffer.  To
+switch EWW buffers through a minibuffer prompt, press @kbd{s}
+(@code{eww-switch-to-buffer}).
 
 @findex eww-browse-with-external-browser
 @vindex shr-external-browser
diff --git a/etc/NEWS b/etc/NEWS
index 3150432..faf49b0 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -52,6 +52,11 @@ in these situations.
 
 * Changes in Specialized Modes and Packages in Emacs 25.2
 
+** eww
+
++++
+*** A new `s' command for switching to another eww buffer via the minibuffer.
+
 +++
 ** The commands that add ChangeLog entries now prefer a VCS root directory
 for the ChangeLog file, if none already exists.  Customize
diff --git a/lisp/net/eww.el b/lisp/net/eww.el
index cb23127..5a50877 100644
--- a/lisp/net/eww.el
+++ b/lisp/net/eww.el
@@ -689,6 +689,7 @@ the like."
     (define-key map "R" 'eww-readable)
     (define-key map "H" 'eww-list-histories)
     (define-key map "E" 'eww-set-character-encoding)
+    (define-key map "s" 'eww-switch-to-buffer)
     (define-key map "S" 'eww-list-buffers)
     (define-key map "F" 'eww-toggle-fonts)
     (define-key map [(meta C)] 'eww-toggle-colors)
@@ -712,6 +713,7 @@ the like."
 	["View page source" eww-view-source]
 	["Copy page URL" eww-copy-page-url t]
 	["List histories" eww-list-histories t]
+	["Switch to buffer" eww-switch-to-buffer t]
 	["List buffers" eww-list-buffers t]
 	["Add bookmark" eww-add-bookmark t]
 	["List bookmarks" eww-list-bookmarks t]
@@ -1498,6 +1500,24 @@ If CHARSET is nil then use UTF-8."
       (eww-reload nil 'utf-8)
     (eww-reload nil charset)))
 
+(defun eww-switch-to-buffer ()
+  "Prompt for an EWW buffer to display in the selected window."
+  (interactive)
+  (let ((completion-extra-properties
+         '(:annotation-function (lambda (buf)
+                                  (with-current-buffer buf
+                                    (format " %s" (eww-current-url)))))))
+    (switch-to-buffer
+     (read-buffer "Switch to EWW buffer: "
+                  (cl-loop for buf in (nreverse (buffer-list))
+                           if (with-current-buffer buf (derived-mode-p 'eww-mode))
+                           return buf)
+                  t
+                  (lambda (bufn)
+                    (with-current-buffer
+                        (if (consp bufn) (cdr bufn) (get-buffer bufn))
+                      (derived-mode-p 'eww-mode)))))))
+
 (defun eww-toggle-fonts ()
   "Toggle whether to use monospaced or font-enabled layouts."
   (interactive)
-- 
2.7.0





Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#22244; Package emacs. (Thu, 04 Feb 2016 07:03:02 GMT) Full text and rfc822 format available.

Message #63 received at 22244 <at> debbugs.gnu.org (full text, mbox):

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Mark Oteiza <mvoteiza <at> udel.edu>
Cc: 22244 <at> debbugs.gnu.org
Subject: Re: bug#22244: [PATCH] New command eww-switch-to-buffer
Date: Thu, 04 Feb 2016 18:02:03 +1100
Mark Oteiza <mvoteiza <at> udel.edu> writes:

> Hopefully covered everything. "s" seemed a sensible bind.

Thanks; applied to the trunk.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




bug marked as fixed in version 25.2, send any further explanations to 22244 <at> debbugs.gnu.org and Michael Heerdegen <michael_heerdegen <at> web.de> Request was from Lars Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Thu, 04 Feb 2016 07:03:02 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#22244; Package emacs. (Thu, 04 Feb 2016 13:11:01 GMT) Full text and rfc822 format available.

Message #68 received at 22244 <at> debbugs.gnu.org (full text, mbox):

From: Michael Heerdegen <michael_heerdegen <at> web.de>
To: Lars Ingebrigtsen <larsi <at> gnus.org>
Cc: Mark Oteiza <mvoteiza <at> udel.edu>, 22244 <at> debbugs.gnu.org
Subject: Re: bug#22244: [PATCH] New command eww-switch-to-buffer
Date: Thu, 04 Feb 2016 14:10:36 +0100
Lars Ingebrigtsen <larsi <at> gnus.org> writes:

> Thanks; applied to the trunk.

Could we again not use `switch-to-buffer'?


Thanks,

Michael




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#22244; Package emacs. (Thu, 04 Feb 2016 16:48:01 GMT) Full text and rfc822 format available.

Message #71 received at 22244 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Mark Oteiza <mvoteiza <at> udel.edu>
Cc: 22244 <at> debbugs.gnu.org, larsi <at> gnus.org
Subject: Re: bug#22244: [PATCH] New command eww-switch-to-buffer
Date: Thu, 04 Feb 2016 18:46:38 +0200
> Date: Thu, 4 Feb 2016 01:31:43 -0500
> From: Mark Oteiza <mvoteiza <at> udel.edu>
> Cc: 22244 <at> debbugs.gnu.org
> 
> * 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

Thanks a lot for making the effort of including the documentation in
the patch.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#22244; Package emacs. (Thu, 04 Feb 2016 17:49:01 GMT) Full text and rfc822 format available.

Message #74 received at 22244 <at> debbugs.gnu.org (full text, mbox):

From: Mark Oteiza <mvoteiza <at> udel.edu>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 22244 <at> debbugs.gnu.org, larsi <at> gnus.org
Subject: Re: bug#22244: [PATCH] New command eww-switch-to-buffer
Date: Thu, 4 Feb 2016 12:48:19 -0500
On 04/02/16 at 06:46pm, Eli Zaretskii wrote:
> > Date: Thu, 4 Feb 2016 01:31:43 -0500
> > From: Mark Oteiza <mvoteiza <at> udel.edu>
> > Cc: 22244 <at> debbugs.gnu.org
> > 
> > * 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
> 
> Thanks a lot for making the effort of including the documentation in
> the patch.

You're welcome




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#22244; Package emacs. (Thu, 04 Feb 2016 17:50:02 GMT) Full text and rfc822 format available.

Message #77 received at 22244 <at> debbugs.gnu.org (full text, mbox):

From: Mark Oteiza <mvoteiza <at> udel.edu>
To: Michael Heerdegen <michael_heerdegen <at> web.de>
Cc: 22244 <at> debbugs.gnu.org, Lars Ingebrigtsen <larsi <at> gnus.org>
Subject: Re: bug#22244: [PATCH] New command eww-switch-to-buffer
Date: Thu, 4 Feb 2016 12:49:19 -0500
On 04/02/16 at 02:10pm, Michael Heerdegen wrote:
> Lars Ingebrigtsen <larsi <at> gnus.org> writes:
> 
> > Thanks; applied to the trunk.
> 
> Could we again not use `switch-to-buffer'?

Done.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#22244; Package emacs. (Thu, 04 Feb 2016 19:11:01 GMT) Full text and rfc822 format available.

Message #80 received at 22244 <at> debbugs.gnu.org (full text, mbox):

From: Michael Heerdegen <michael_heerdegen <at> web.de>
To: Mark Oteiza <mvoteiza <at> udel.edu>
Cc: 22244 <at> debbugs.gnu.org, Lars Ingebrigtsen <larsi <at> gnus.org>
Subject: Re: bug#22244: [PATCH] New command eww-switch-to-buffer
Date: Thu, 04 Feb 2016 20:09:59 +0100
Mark Oteiza <mvoteiza <at> udel.edu> writes:

> > > Thanks; applied to the trunk.
> > 
> > Could we again not use `switch-to-buffer'?
>
> Done.

Thanks!


Michael.




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Fri, 04 Mar 2016 12:24:04 GMT) Full text and rfc822 format available.

This bug report was last modified 9 years and 107 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.