* eww - multiple buffers
@ 2016-06-09 7:27 Andreas Röhler
2016-06-09 10:39 ` Tassilo Horn
0 siblings, 1 reply; 8+ messages in thread
From: Andreas Röhler @ 2016-06-09 7:27 UTC (permalink / raw)
To: Help Gnu Emacs mailing list
Hi,
eww comes with a command "eww-list-buffers" - however, seems to exist
only one hard-coded "*eww*" buffer at time.
Is there a way to open different "*eww MY FYLE*" buffers in parallel?
Thanks,
Andreas
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: eww - multiple buffers
2016-06-09 7:27 eww - multiple buffers Andreas Röhler
@ 2016-06-09 10:39 ` Tassilo Horn
2016-06-09 10:55 ` Rasmus
2016-06-09 14:24 ` Andreas Röhler
0 siblings, 2 replies; 8+ messages in thread
From: Tassilo Horn @ 2016-06-09 10:39 UTC (permalink / raw)
To: Andreas Röhler; +Cc: Help Gnu Emacs mailing list
Andreas Röhler <andreas.roehler@easy-emacs.de> writes:
Hi Andreas,
> eww comes with a command "eww-list-buffers" - however, seems to exist
> only one hard-coded "*eww*" buffer at time.
>
> Is there a way to open different "*eww MY FYLE*" buffers in parallel?
Well, there's
,----[ C-h f eww-browse-url RET ]
| eww-browse-url is an autoloaded compiled Lisp function in ‘eww.el’.
|
| (eww-browse-url URL &optional NEW-WINDOW)
|
| Not documented.
`----
which can open a new buffer. And that's used by
,----[ C-h f eww-follow-link RET ]
| eww-follow-link is an interactive compiled Lisp function in ‘eww.el’.
|
| (eww-follow-link &optional EXTERNAL MOUSE-EVENT)
|
| Browse the URL under point.
| If EXTERNAL is single prefix, browse the URL using ‘shr-external-browser’.
| If EXTERNAL is double prefix, browse in new buffer.
`----
So you'd usually start with one eww buffer and then follow links with
`C-u C-u RET' which would create a new buffer for the referenced link.
But you're right. It seems quite strange to me that you can't call
`eww' itself with a prefix arg to make it open a new buffer...
HTH,
Tassilo
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: eww - multiple buffers
2016-06-09 10:39 ` Tassilo Horn
@ 2016-06-09 10:55 ` Rasmus
2016-06-09 14:24 ` Andreas Röhler
1 sibling, 0 replies; 8+ messages in thread
From: Rasmus @ 2016-06-09 10:55 UTC (permalink / raw)
To: help-gnu-emacs
Tassilo Horn <tsdh@gnu.org> writes:
> Andreas Röhler <andreas.roehler@easy-emacs.de> writes:
>
> Hi Andreas,
>
>> eww comes with a command "eww-list-buffers" - however, seems to exist
>> only one hard-coded "*eww*" buffer at time.
>>
>> Is there a way to open different "*eww MY FYLE*" buffers in parallel?
>
> Well, there's
>
> ,----[ C-h f eww-browse-url RET ]
> | eww-browse-url is an autoloaded compiled Lisp function in ‘eww.el’.
> |
> | (eww-browse-url URL &optional NEW-WINDOW)
> |
> | Not documented.
> `----
>
> which can open a new buffer. And that's used by
>
> ,----[ C-h f eww-follow-link RET ]
> | eww-follow-link is an interactive compiled Lisp function in ‘eww.el’.
> |
> | (eww-follow-link &optional EXTERNAL MOUSE-EVENT)
> |
> | Browse the URL under point.
> | If EXTERNAL is single prefix, browse the URL using ‘shr-external-browser’.
> | If EXTERNAL is double prefix, browse in new buffer.
> `----
>
> So you'd usually start with one eww buffer and then follow links with
> `C-u C-u RET' which would create a new buffer for the referenced link.
>
> But you're right. It seems quite strange to me that you can't call
> `eww' itself with a prefix arg to make it open a new buffer...
Another thing, in Fx you can middle click to open in a new tab. It might
make sense to have something similar. Either with the mouse button or
C-RET for new tab and RET for current tab. It should be pretty easy to
add...
Rasmus
--
Human: An animal that complicates things more than strictly necessary
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: eww - multiple buffers
2016-06-09 10:39 ` Tassilo Horn
2016-06-09 10:55 ` Rasmus
@ 2016-06-09 14:24 ` Andreas Röhler
2016-06-09 14:31 ` Kaushal Modi
2016-06-10 14:57 ` Michael Heerdegen
1 sibling, 2 replies; 8+ messages in thread
From: Andreas Röhler @ 2016-06-09 14:24 UTC (permalink / raw)
To: Tassilo Horn; +Cc: Help Gnu Emacs mailing list
On 09.06.2016 12:39, Tassilo Horn wrote:
> Andreas Röhler <andreas.roehler@easy-emacs.de> writes:
>
> Hi Andreas,
>
>> eww comes with a command "eww-list-buffers" - however, seems to exist
>> only one hard-coded "*eww*" buffer at time.
>>
>> Is there a way to open different "*eww MY FYLE*" buffers in parallel?
> Well, there's
>
> ,----[ C-h f eww-browse-url RET ]
> | eww-browse-url is an autoloaded compiled Lisp function in ‘eww.el’.
> |
> | (eww-browse-url URL &optional NEW-WINDOW)
> |
> | Not documented.
> `----
>
> which can open a new buffer. And that's used by
>
> ,----[ C-h f eww-follow-link RET ]
> | eww-follow-link is an interactive compiled Lisp function in ‘eww.el’.
> |
> | (eww-follow-link &optional EXTERNAL MOUSE-EVENT)
> |
> | Browse the URL under point.
> | If EXTERNAL is single prefix, browse the URL using ‘shr-external-browser’.
> | If EXTERNAL is double prefix, browse in new buffer.
> `----
>
> So you'd usually start with one eww buffer and then follow links with
> `C-u C-u RET' which would create a new buffer for the referenced link.
>
> But you're right. It seems quite strange to me that you can't call
> `eww' itself with a prefix arg to make it open a new buffer...
>
> HTH,
> Tassilo
Hmm, eww-browse-url isn't designed as command.
When looking at, it seems to use the very same buffer too.
(defun eww-browse-url (url &optional new-window)
(when new-window
(pop-to-buffer-same-window (generate-new-buffer "*eww*"))
(eww-mode))
;;;
Maybe worth a feature request?
Thanks all,
Andreas
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: eww - multiple buffers
2016-06-09 14:24 ` Andreas Röhler
@ 2016-06-09 14:31 ` Kaushal Modi
2016-06-10 14:57 ` Michael Heerdegen
1 sibling, 0 replies; 8+ messages in thread
From: Kaushal Modi @ 2016-06-09 14:31 UTC (permalink / raw)
To: Andreas Röhler, Tassilo Horn; +Cc: Help Gnu Emacs mailing list
I have been using this snippet from ergoemacs,org and it has been working
great for me:
;; Auto-rename new eww buffers
;; http://ergoemacs.org/emacs/emacs_eww_web_browser.html
(defun xah-rename-eww-hook ()
"Rename eww browser's buffer so sites open in new page."
(rename-buffer "eww" t))
(add-hook 'eww-mode-hook #'xah-rename-eww-hook)
On Thu, Jun 9, 2016 at 10:22 AM Andreas Röhler <
andreas.roehler@easy-emacs.de> wrote:
>
>
> On 09.06.2016 12:39, Tassilo Horn wrote:
> > Andreas Röhler <andreas.roehler@easy-emacs.de> writes:
> >
> > Hi Andreas,
> >
> >> eww comes with a command "eww-list-buffers" - however, seems to exist
> >> only one hard-coded "*eww*" buffer at time.
> >>
> >> Is there a way to open different "*eww MY FYLE*" buffers in parallel?
> > Well, there's
> >
> > ,----[ C-h f eww-browse-url RET ]
> > | eww-browse-url is an autoloaded compiled Lisp function in ‘eww.el’.
> > |
> > | (eww-browse-url URL &optional NEW-WINDOW)
> > |
> > | Not documented.
> > `----
> >
> > which can open a new buffer. And that's used by
> >
> > ,----[ C-h f eww-follow-link RET ]
> > | eww-follow-link is an interactive compiled Lisp function in ‘eww.el’.
> > |
> > | (eww-follow-link &optional EXTERNAL MOUSE-EVENT)
> > |
> > | Browse the URL under point.
> > | If EXTERNAL is single prefix, browse the URL using
> ‘shr-external-browser’.
> > | If EXTERNAL is double prefix, browse in new buffer.
> > `----
> >
> > So you'd usually start with one eww buffer and then follow links with
> > `C-u C-u RET' which would create a new buffer for the referenced link.
> >
> > But you're right. It seems quite strange to me that you can't call
> > `eww' itself with a prefix arg to make it open a new buffer...
> >
> > HTH,
> > Tassilo
>
> Hmm, eww-browse-url isn't designed as command.
>
> When looking at, it seems to use the very same buffer too.
>
> (defun eww-browse-url (url &optional new-window)
> (when new-window
> (pop-to-buffer-same-window (generate-new-buffer "*eww*"))
> (eww-mode))
>
> ;;;
>
> Maybe worth a feature request?
>
> Thanks all,
>
> Andreas
>
>
> --
--
Kaushal Modi
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: eww - multiple buffers
2016-06-09 14:24 ` Andreas Röhler
2016-06-09 14:31 ` Kaushal Modi
@ 2016-06-10 14:57 ` Michael Heerdegen
2016-06-13 8:21 ` Andreas Röhler
2016-06-13 8:55 ` Andreas Röhler
1 sibling, 2 replies; 8+ messages in thread
From: Michael Heerdegen @ 2016-06-10 14:57 UTC (permalink / raw)
To: help-gnu-emacs
Andreas Röhler <andreas.roehler@easy-emacs.de> writes:
> When looking at, it seems to use the very same buffer too.
>
> (defun eww-browse-url (url &optional new-window)
> (when new-window
> (pop-to-buffer-same-window (generate-new-buffer "*eww*"))
> (eww-mode))
No, it doesn't, see the doc of `generate-new-buffer'.
Michael.
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: eww - multiple buffers
2016-06-10 14:57 ` Michael Heerdegen
@ 2016-06-13 8:21 ` Andreas Röhler
2016-06-13 8:55 ` Andreas Röhler
1 sibling, 0 replies; 8+ messages in thread
From: Andreas Röhler @ 2016-06-13 8:21 UTC (permalink / raw)
To: help-gnu-emacs
On 10.06.2016 16:57, Michael Heerdegen wrote:
> Andreas Röhler <andreas.roehler@easy-emacs.de> writes:
>
>> When looking at, it seems to use the very same buffer too.
>>
>> (defun eww-browse-url (url &optional new-window)
>> (when new-window
>> (pop-to-buffer-same-window (generate-new-buffer "*eww*"))
>> (eww-mode))
> No, it doesn't, see the doc of `generate-new-buffer'.
>
>
> Michael.
>
>
Right, thanks. So that way it numerates buffers given C-u:
(defun ar-eww (&optional new-buffer)
(interactive "P")
(let ((erg (read-from-minibuffer "Url: ")))
(eww-browse-url erg new-buffer)))
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: eww - multiple buffers
2016-06-10 14:57 ` Michael Heerdegen
2016-06-13 8:21 ` Andreas Röhler
@ 2016-06-13 8:55 ` Andreas Röhler
1 sibling, 0 replies; 8+ messages in thread
From: Andreas Röhler @ 2016-06-13 8:55 UTC (permalink / raw)
To: help-gnu-emacs
Here is a eww-browse-url based hack, displaying the initials of visited
URL in buffer-name
(defun ar--compose-buffer-name-initials (liste)
(let (erg)
(dolist (ele liste)
(unless (string= "" ele)
(setq erg (concat erg (char-to-string (aref ele 0))))))
erg))
(defun ar-eww-browse-url (url &optional new-window)
(when new-window
(if (stringp new-window)
(set-buffer (get-buffer-create (concat "*eww " new-window "*")))
(pop-to-buffer-same-window (generate-new-buffer "*eww*")))
(eww-mode))
(eww url))
(defun ar-eww (&optional new-buffer)
(interactive "P")
(let* ((erg (read-from-minibuffer "Url: "))
(acronym (ar--compose-buffer-name-initials (split-string
(substring erg (ignore-errors (1+ (string-match "www\\." erg))))
"[^a-z]"))))
(if (eq 4 (prefix-numeric-value new-buffer))
(ar-eww-browse-url erg acronym)
(ar-eww-browse-url erg))))
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2016-06-13 8:55 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-06-09 7:27 eww - multiple buffers Andreas Röhler
2016-06-09 10:39 ` Tassilo Horn
2016-06-09 10:55 ` Rasmus
2016-06-09 14:24 ` Andreas Röhler
2016-06-09 14:31 ` Kaushal Modi
2016-06-10 14:57 ` Michael Heerdegen
2016-06-13 8:21 ` Andreas Röhler
2016-06-13 8:55 ` Andreas Röhler
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).