GNU bug report logs -
#19902
25.0.50; [PATCH] Make eww entry point more info-like
Previous Next
Reported by: Mark Oteiza <mvoteiza <at> udel.edu>
Date: Thu, 19 Feb 2015 15:05:01 UTC
Severity: wishlist
Tags: fixed, patch
Found in version 25.0.50
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 19902 in the body.
You can then email your comments to 19902 AT debbugs.gnu.org in the normal way.
Toggle the display of automated, internal messages from the tracker.
Report forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#19902
; Package
emacs
.
(Thu, 19 Feb 2015 15:05:02 GMT)
Full text and
rfc822 format available.
Acknowledgement sent
to
Mark Oteiza <mvoteiza <at> udel.edu>
:
New bug report received and forwarded. Copy sent to
bug-gnu-emacs <at> gnu.org
.
(Thu, 19 Feb 2015 15:05:02 GMT)
Full text and
rfc822 format available.
Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):
---
eww already has some info-like behaviour, and I think this is a good
thing. An example is isearch in eww.
It's weird how M-x eww will always just reset the whole eww session
instead of going back to a buried eww buffer. Also, now that eww has a
nice way to select instances with S, there should be an easy way to
duplicate eww buffers. The way info does this is with clone-buffer, and
it makes sense for eww to do the same.
With these changes, one can keep eww sessions around without clobbering
them every time M-x eww is invoked. Now, one can have multiple eww's,
and to get to one of them, either:
M-x eww RET S
M-N eww RET
where M-N is the numeric prefix N. Aside from eww's `S' command for
switching sessions, this is very much like how one uses info, and usage
feels much smoother and familiar for an Emacs interface.
P.S. This (or some other patches I have sitting on the ML) puts my
contributions over 15 lines. Paperwork is currently a WIP.
lisp/ChangeLog | 6 ++++++
lisp/net/eww.el | 25 ++++++++++++++++++++-----
2 files changed, 26 insertions(+), 5 deletions(-)
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 933e5bb..f12889a 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,9 @@
+2015-02-19 Mark Oteiza <mvoteiza <at> udel.edu>
+
+ * net/eww.el (eww): Behave more like `info' entry point
+ (eww-fetch): Replaces prior eww function.
+ (eww-mode-map): More Info-like `M-n' for `clone-buffer'
+
2015-02-19 Stefan Monnier <monnier <at> iro.umontreal.ca>
* emacs-lisp/smie.el (smie-prec2->grammar): Fix corner case problem.
diff --git a/lisp/net/eww.el b/lisp/net/eww.el
index b7ee065..ad322ed 100644
--- a/lisp/net/eww.el
+++ b/lisp/net/eww.el
@@ -239,8 +239,7 @@ This list can be customized via `eww-suggest-uris'."
(push uri uris)))))
(nreverse uris)))
-;;;###autoload
-(defun eww (url)
+(defun eww-fetch (url)
"Fetch URL and render the page.
If the input doesn't look like an URL or a domain name, the
word(s) will be searched for via `eww-search-prefix'."
@@ -288,6 +287,23 @@ word(s) will be searched for via `eww-search-prefix'."
(url-retrieve url 'eww-render
(list url nil (current-buffer))))
+;;;###autoload
+(defun eww (&optional url buffer)
+ "Enter eww, the Emacs Web Wowser.
+Optional argument URL specifies the target to navigate;
+the default is `eww-search-prefix'.
+
+In interactive use, a numeric prefix argument of N selects an eww
+buffer named \"*eww*<N>\"."
+ (interactive
+ (let ((buf (get-buffer (if (numberp current-prefix-arg)
+ (format "*eww*<%s>" current-prefix-arg)
+ "*eww*"))))
+ (list (unless buf (read-string "Enter URL or keywords: "))
+ buf)))
+ (if buffer (pop-to-buffer-same-window buffer)
+ (eww-fetch url)))
+
;;;###autoload (defalias 'browse-web 'eww)
;;;###autoload
@@ -624,7 +640,7 @@ the like."
(let ((map (make-sparse-keymap)))
(set-keymap-parent map special-mode-map)
(define-key map "g" 'eww-reload) ;FIXME: revert-buffer-function instead!
- (define-key map "G" 'eww)
+ (define-key map "G" 'eww-fetch)
(define-key map [?\t] 'shr-next-link)
(define-key map [?\M-\t] 'shr-previous-link)
(define-key map [backtab] 'shr-previous-link)
@@ -648,8 +664,7 @@ the like."
(define-key map "b" 'eww-add-bookmark)
(define-key map "B" 'eww-list-bookmarks)
- (define-key map [(meta n)] 'eww-next-bookmark)
- (define-key map [(meta p)] 'eww-previous-bookmark)
+ (define-key map [(meta n)] 'clone-buffer)
(easy-menu-define nil map ""
'("Eww"
--
2.3.0
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#19902
; Package
emacs
.
(Thu, 19 Feb 2015 15:07:02 GMT)
Full text and
rfc822 format available.
Message #8 received at submit <at> debbugs.gnu.org (full text, mbox):
On 19/02/15 at 10:03am, Mark Oteiza wrote:
> M-N eww RET
M-N M-x eww RET
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#19902
; Package
emacs
.
(Thu, 19 Feb 2015 15:33:01 GMT)
Full text and
rfc822 format available.
Message #11 received at 19902 <at> debbugs.gnu.org (full text, mbox):
> From: Mark Oteiza <mvoteiza <at> udel.edu>
> Date: Thu, 19 Feb 2015 10:03:50 -0500
>
> With these changes, one can keep eww sessions around without clobbering
> them every time M-x eww is invoked. Now, one can have multiple eww's,
> and to get to one of them, either:
>
> M-x eww RET S
> M-N eww RET
>
> where M-N is the numeric prefix N. Aside from eww's `S' command for
> switching sessions, this is very much like how one uses info, and usage
> feels much smoother and familiar for an Emacs interface.
Thanks.
> +2015-02-19 Mark Oteiza <mvoteiza <at> udel.edu>
> +
> + * net/eww.el (eww): Behave more like `info' entry point
> + (eww-fetch): Replaces prior eww function.
> + (eww-mode-map): More Info-like `M-n' for `clone-buffer'
Please describe the changes themselves (i.e. the new behavior), not
what the behavior is similar to. The ChangeLog entries are supposed
to be self-contained in their descriptions.
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#19902
; Package
emacs
.
(Thu, 19 Feb 2015 15:36:02 GMT)
Full text and
rfc822 format available.
Message #14 received at 19902 <at> debbugs.gnu.org (full text, mbox):
>>>>> Mark Oteiza <mvoteiza <at> udel.edu> writes:
[…]
> * net/eww.el (eww): Behave more like `info' entry point
> (eww-fetch): Replaces prior eww function.
> (eww-mode-map): More Info-like `M-n' for `clone-buffer'
Looks good to me, although I tend to prefer non-numeric suffixes
(like <w:en>, <w:eo>, <w:ru> for the Wikipedias, <gbts> for the
GNU debbugs, etc. FWIW, it makes it pretty easy to complete.)
[…]
> + (interactive
> + (let ((buf (get-buffer (if (numberp current-prefix-arg)
> + (format "*eww*<%s>" current-prefix-arg)
> + "*eww*"))))
> + (list (unless buf (read-string "Enter URL or keywords: "))
> + buf)))
… Except for this part, which essentially reintroduces #19106;
see [1]. I presume that for this reason, the new ‘eww’ command
should call ‘eww-suggested-uris’ just like the old one does.
[1] http://debbugs.gnu.org/cgi/bugreport.cgi?bug=19106#msg8
[…]
--
FSF associate member #7257 http://boycottsystemd.org/ … 3013 B6A0 230E 334A
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#19902
; Package
emacs
.
(Thu, 19 Feb 2015 15:52:01 GMT)
Full text and
rfc822 format available.
Message #17 received at submit <at> debbugs.gnu.org (full text, mbox):
Ivan Shmakov <ivan <at> siamics.net> writes:
>>>>>> Mark Oteiza <mvoteiza <at> udel.edu> writes:
> > + (interactive
> > + (let ((buf (get-buffer (if (numberp current-prefix-arg)
> > + (format "*eww*<%s>" current-prefix-arg)
> > + "*eww*"))))
> > + (list (unless buf (read-string "Enter URL or keywords: "))
> > + buf)))
>
> … Except for this part, which essentially reintroduces #19106;
> see [1]. I presume that for this reason, the new ‘eww’ command
> should call ‘eww-suggested-uris’ just like the old one does.
>
> [1] http://debbugs.gnu.org/cgi/bugreport.cgi?bug=19106#msg8
Hm, good catch. I'm not sure how this should fit in. Perhaps
`eww-suggested-uris' should be the behaviour behind the non-numeric
prefix (C-u)?
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#19902
; Package
emacs
.
(Thu, 19 Feb 2015 15:53:01 GMT)
Full text and
rfc822 format available.
Message #20 received at submit <at> debbugs.gnu.org (full text, mbox):
Eli Zaretskii <eliz <at> gnu.org> writes:
>> +2015-02-19 Mark Oteiza <mvoteiza <at> udel.edu>
>> +
>> + * net/eww.el (eww): Behave more like `info' entry point
>> + (eww-fetch): Replaces prior eww function.
>> + (eww-mode-map): More Info-like `M-n' for `clone-buffer'
>
> Please describe the changes themselves (i.e. the new behavior), not
> what the behavior is similar to. The ChangeLog entries are supposed
> to be self-contained in their descriptions.
Thanks, I'll attend to that
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#19902
; Package
emacs
.
(Thu, 19 Feb 2015 17:33:02 GMT)
Full text and
rfc822 format available.
Message #23 received at 19902 <at> debbugs.gnu.org (full text, mbox):
>>>>> Mark Oteiza <mvoteiza <at> udel.edu> writes:
>>>>> Ivan Shmakov <ivan <at> siamics.net> writes:
>>>>> Mark Oteiza <mvoteiza <at> udel.edu> writes:
>>> (eww-mode-map): More Info-like `M-n' for `clone-buffer'
On a second thought, it may still be worth preserving the
(M-n, M-p) pair for some kind of navigation (whether bookmark or
something else; FWIW, I don’t use EWW bookmarks personally.)
It may even make sense to bind clone-buffer to a different key
sequence in Info-mode-map (in addition to the current binding.)
>>> + (interactive
>>> + (let ((buf (get-buffer (if (numberp current-prefix-arg)
>>> + (format "*eww*<%s>" current-prefix-arg)
>>> + "*eww*"))))
>>> + (list (unless buf (read-string "Enter URL or keywords: "))
>>> + buf)))
>> … Except for this part, which essentially reintroduces #19106; see
>> [1]. I presume that for this reason, the new ‘eww’ command should
>> call ‘eww-suggested-uris’ just like the old one does.
>> [1] http://debbugs.gnu.org/cgi/bugreport.cgi?bug=19106#msg8
> Hm, good catch. I'm not sure how this should fit in. Perhaps
> `eww-suggested-uris' should be the behaviour behind the non-numeric
> prefix (C-u)?
The list of defaults returned by ‘eww-suggested-uris’ is only
meaningful for the ‘read-string’ code path, which implies that
either no prefix argument is given, /or/ the prefix given does
not refer to an existing *eww* buffer.
--
FSF associate member #7257 http://boycottsystemd.org/ … 3013 B6A0 230E 334A
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#19902
; Package
emacs
.
(Thu, 19 Feb 2015 18:34:01 GMT)
Full text and
rfc822 format available.
Message #26 received at 19902 <at> debbugs.gnu.org (full text, mbox):
> On a second thought, it may still be worth preserving the
> (M-n, M-p) pair for some kind of navigation (whether bookmark or
> something else; FWIW, I don’t use EWW bookmarks personally.)
> It may even make sense to bind clone-buffer to a different key
> sequence in Info-mode-map (in addition to the current binding.)
Indeed, the M-n/M-p pair can be useful for other things.
I chose M-n in Info-mode because that's what came up first in my mind
("n" is for "new"), but we could use something else just as well.
Stefan
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#19902
; Package
emacs
.
(Thu, 19 Feb 2015 19:20:04 GMT)
Full text and
rfc822 format available.
Message #29 received at 19902 <at> debbugs.gnu.org (full text, mbox):
> -(defun eww (url)
> +(defun eww-fetch (url)
> "Fetch URL and render the page.
The corresponding Info command is named `Info-goto-node',
so a better name would be `eww-goto-url' because
it not only fetches URL, but also renders the page.
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#19902
; Package
emacs
.
(Thu, 19 Feb 2015 22:57:01 GMT)
Full text and
rfc822 format available.
Message #32 received at submit <at> debbugs.gnu.org (full text, mbox):
---
Both `C-u M-x eww RET' and `G' (eww-goto-url) in eww prompt for URL
using `eww-suggest-uris'.
A little argument shuffling had to happen. I think I properly handled
the possible uses of `eww' and `eww-goto-url' interactively and in lisp.
Regarding the bookmark/info binding, the whole inspiration to this
change is to make the eww interface more info-like. Info is a
good manual browser, and eww benefits from assimilating features from
info to be a good web browser.
Between the familiar M-n, eww's "S" command, and the new behavior of
`M-x eww', eww's flow has improved. Eww is now a nice tabbed web
browser, where each tab's history doesn't get clobbered every time M-x
eww is invoked, and one doesn't have to switch-buffer or similar to find an
existing eww session.
I also have never felt compelled to cycle through my bookmarks, so I am
not troubled by losing the bookmark bindings.
lisp/ChangeLog | 13 +++++++++++++
lisp/net/eww.el | 47 +++++++++++++++++++++++++++++++++++------------
2 files changed, 48 insertions(+), 12 deletions(-)
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 3d15b40..fa2f252 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,16 @@
+2015-02-19 Mark Oteiza <mvoteiza <at> udel.edu>
+
+ * net/eww.el (eww): New behavior. Pops to an existing buffer,
+ otherwise creates a new one. The buffer name is controlled by
+ numeric prefix. A non-numeric prefix always prompts for a URL.
+ (eww-goto-url): New function. Assumes the previous role of `eww',
+ now accepting an optional `buffer' argument
+ (eww-read-string): New function. Wrapper for `read-string'
+ used by `eww' and `eww-goto-url'.
+ (eww-setup-buffer): Accept `buffer' argument.
+ (eww-mode-map): Replace existing bindings for M-n and M-p with
+ a binding of M-n to `clone-buffer'.
+
2015-02-19 Dima Kogan <dima <at> secretsauce.net>
* autorevert.el (auto-revert-buffers-counter)
diff --git a/lisp/net/eww.el b/lisp/net/eww.el
index b7ee065..37df68e 100644
--- a/lisp/net/eww.el
+++ b/lisp/net/eww.el
@@ -239,17 +239,41 @@ This list can be customized via `eww-suggest-uris'."
(push uri uris)))))
(nreverse uris)))
+(defun eww-read-string ()
+ (let* ((uris (eww-suggested-uris))
+ (prompt (concat "Enter URL or keywords"
+ (if uris (format " (default %s)" (car uris)))
+ ": ")))
+ (read-string prompt nil nil uris)))
+
;;;###autoload
-(defun eww (url)
+(defun eww (&optional url buffer)
+ "Enter eww, the Emacs Web Wowser.
+Optional argument URL specifies the target to navigate;
+the default is `eww-search-prefix'.
+
+In interactive use, a non-numeric prefix argument directs
+this command to read URL from the minibuffer.
+
+A numeric prefix argument of N selects an eww buffer named \"*eww*<N>\"."
+ (interactive
+ (let ((name (if (numberp current-prefix-arg)
+ (format "*eww*<%s>" current-prefix-arg)
+ "*eww*")))
+ (list (if (or (not (get-buffer name))
+ (and current-prefix-arg (not (numberp current-prefix-arg))))
+ (eww-read-string))
+ name)))
+ (if (and (get-buffer buffer) (or (not current-prefix-arg) (numberp current-prefix-arg)))
+ (pop-to-buffer-same-window (or buffer "*eww*"))
+ (eww-goto-url url (or buffer "*eww*"))))
+
+(defun eww-goto-url (url &optional buffer)
"Fetch URL and render the page.
If the input doesn't look like an URL or a domain name, the
word(s) will be searched for via `eww-search-prefix'."
(interactive
- (let* ((uris (eww-suggested-uris))
- (prompt (concat "Enter URL or keywords"
- (if uris (format " (default %s)" (car uris)) "")
- ": ")))
- (list (read-string prompt nil nil uris))))
+ (list (eww-read-string)))
(setq url (string-trim url))
(cond ((string-match-p "\\`file:/" url))
;; Don't mangle file: URLs at all.
@@ -278,7 +302,7 @@ word(s) will be searched for via `eww-search-prefix'."
(when (or (plist-get eww-data :url)
(plist-get eww-data :dom))
(eww-save-history))
- (eww-setup-buffer)
+ (eww-setup-buffer buffer)
(plist-put eww-data :url url)
(plist-put eww-data :title "")
(eww-update-header-line-format)
@@ -531,8 +555,8 @@ See the `eww-search-prefix' variable for the search engine used."
(mailcap-view-mime "application/pdf")))
(goto-char (point-min)))
-(defun eww-setup-buffer ()
- (switch-to-buffer (get-buffer-create "*eww*"))
+(defun eww-setup-buffer (buffer)
+ (switch-to-buffer (get-buffer-create (or buffer "*eww*")))
(let ((inhibit-read-only t))
(remove-overlays)
(erase-buffer))
@@ -624,7 +648,7 @@ the like."
(let ((map (make-sparse-keymap)))
(set-keymap-parent map special-mode-map)
(define-key map "g" 'eww-reload) ;FIXME: revert-buffer-function instead!
- (define-key map "G" 'eww)
+ (define-key map "G" 'eww-goto-url)
(define-key map [?\t] 'shr-next-link)
(define-key map [?\M-\t] 'shr-previous-link)
(define-key map [backtab] 'shr-previous-link)
@@ -648,8 +672,7 @@ the like."
(define-key map "b" 'eww-add-bookmark)
(define-key map "B" 'eww-list-bookmarks)
- (define-key map [(meta n)] 'eww-next-bookmark)
- (define-key map [(meta p)] 'eww-previous-bookmark)
+ (define-key map [(meta n)] 'clone-buffer)
(easy-menu-define nil map ""
'("Eww"
--
2.3.0
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#19902
; Package
emacs
.
(Fri, 20 Feb 2015 23:35:01 GMT)
Full text and
rfc822 format available.
Message #35 received at submit <at> debbugs.gnu.org (full text, mbox):
On 19/02/15 at 05:55pm, Mark Oteiza wrote:
> + (if (and (get-buffer buffer) (or (not current-prefix-arg) (numberp current-prefix-arg)))
> + (pop-to-buffer-same-window (or buffer "*eww*"))
> + (eww-goto-url url (or buffer "*eww*"))))
`buffer' has to be non-nil, so the first predicate should instead be
(and buffer (get-buffer buffer)
(or (not current-prefix-arg (numberp current-prefix-arg))))
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#19902
; Package
emacs
.
(Sat, 21 Feb 2015 10:38:02 GMT)
Full text and
rfc822 format available.
Message #38 received at 19902 <at> debbugs.gnu.org (full text, mbox):
>>>>> Mark Oteiza <mvoteiza <at> udel.edu> writes:
>>>>> On 19/02/15 at 05:55pm, Mark Oteiza wrote:
>> + (if (and (get-buffer buffer) (or (not current-prefix-arg) (numberp current-prefix-arg)))
>> + (pop-to-buffer-same-window (or buffer "*eww*"))
>> + (eww-goto-url url (or buffer "*eww*"))))
> `buffer' has to be non-nil, so the first predicate should instead be
> (and buffer (get-buffer buffer)
> (or (not current-prefix-arg (numberp current-prefix-arg))))
… And thus (or buffer …) is the same as simply ‘buffer’ in the
“true” branch.
(if (and buffer (get-buffer buffer)
(or (not current-prefix-arg) (numberp current-prefix-arg)))
(pop-to-buffer-same-window buffer)
(eww-goto-url url (or buffer "*eww*")))
--
FSF associate member #7257 np. Vivo duras sed vi molas — Martin & La Talpoj
e
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#19902
; Package
emacs
.
(Mon, 23 Feb 2015 19:42:02 GMT)
Full text and
rfc822 format available.
Message #41 received at 19902 <at> debbugs.gnu.org (full text, mbox):
> Regarding the bookmark/info binding, the whole inspiration to this
> change is to make the eww interface more info-like. Info is a
> good manual browser, and eww benefits from assimilating features from
> info to be a good web browser.
Both info and eww could share a better keybinding. What comes to mind is
`C-x 4 c' globally bound to clone-indirect-buffer-other-window.
Could it be used in eww?
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#19902
; Package
emacs
.
(Wed, 04 Mar 2015 18:53:01 GMT)
Full text and
rfc822 format available.
Message #44 received at submit <at> debbugs.gnu.org (full text, mbox):
---
Ivan Shmakov <ivan <at> siamics.net> writes:
> … And thus (or buffer …) is the same as simply ‘buffer’ in the
> “true” branch.
>
> (if (and buffer (get-buffer buffer)
> (or (not current-prefix-arg) (numberp current-prefix-arg)))
> (pop-to-buffer-same-window buffer)
> (eww-goto-url url (or buffer "*eww*")))
Thanks, change made
lisp/ChangeLog | 13 +++++++++++++
lisp/net/eww.el | 48 ++++++++++++++++++++++++++++++++++++------------
2 files changed, 49 insertions(+), 12 deletions(-)
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index cdd4bf8..9fe4d50 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,16 @@
+2015-03-04 Mark Oteiza <mvoteiza <at> udel.edu>
+
+ * net/eww.el (eww): New behavior. Pops to an existing buffer,
+ otherwise creates a new one. The buffer name is controlled by
+ numeric prefix. A non-numeric prefix always prompts for a URL.
+ (eww-goto-url): New function. Assumes the previous role of `eww',
+ now accepting an optional `buffer' argument
+ (eww-read-string): New function. Wrapper for `read-string'
+ used by `eww' and `eww-goto-url'.
+ (eww-setup-buffer): Accept `buffer' argument.
+ (eww-mode-map): Replace existing bindings for M-n and M-p with
+ a binding of M-n to `clone-buffer'.
+
2015-03-04 Filipp Gunbin <fgunbin <at> fastmail.fm>
* autorevert.el (auto-revert-notify-add-watch):
diff --git a/lisp/net/eww.el b/lisp/net/eww.el
index 577cd41..4b696f7 100644
--- a/lisp/net/eww.el
+++ b/lisp/net/eww.el
@@ -239,17 +239,42 @@ This list can be customized via `eww-suggest-uris'."
(push uri uris)))))
(nreverse uris)))
+(defun eww-read-string ()
+ (let* ((uris (eww-suggested-uris))
+ (prompt (concat "Enter URL or keywords"
+ (if uris (format " (default %s)" (car uris)))
+ ": ")))
+ (read-string prompt nil nil uris)))
+
;;;###autoload
-(defun eww (url)
+(defun eww (&optional url buffer)
+ "Enter eww, the Emacs Web Wowser.
+Optional argument URL specifies the target to navigate;
+the default is `eww-search-prefix'.
+
+In interactive use, a non-numeric prefix argument directs
+this command to read URL from the minibuffer.
+
+A numeric prefix argument of N selects an eww buffer named \"*eww*<N>\"."
+ (interactive
+ (let ((name (if (numberp current-prefix-arg)
+ (format "*eww*<%s>" current-prefix-arg)
+ "*eww*")))
+ (list (if (or (not (get-buffer name))
+ (and current-prefix-arg (not (numberp current-prefix-arg))))
+ (eww-read-string))
+ name)))
+ (if (and buffer (get-buffer buffer)
+ (or (not current-prefix-arg) (numberp current-prefix-arg)))
+ (pop-to-buffer-same-window buffer)
+ (eww-goto-url url (or buffer "*eww*"))))
+
+(defun eww-goto-url (url &optional buffer)
"Fetch URL and render the page.
If the input doesn't look like an URL or a domain name, the
word(s) will be searched for via `eww-search-prefix'."
(interactive
- (let* ((uris (eww-suggested-uris))
- (prompt (concat "Enter URL or keywords"
- (if uris (format " (default %s)" (car uris)) "")
- ": ")))
- (list (read-string prompt nil nil uris))))
+ (list (eww-read-string)))
(setq url (string-trim url))
(cond ((string-match-p "\\`file:/" url))
;; Don't mangle file: URLs at all.
@@ -278,7 +303,7 @@ word(s) will be searched for via `eww-search-prefix'."
(when (or (plist-get eww-data :url)
(plist-get eww-data :dom))
(eww-save-history))
- (eww-setup-buffer)
+ (eww-setup-buffer buffer)
(plist-put eww-data :url url)
(plist-put eww-data :title "")
(eww-update-header-line-format)
@@ -531,8 +556,8 @@ See the `eww-search-prefix' variable for the search engine used."
(mailcap-view-mime "application/pdf")))
(goto-char (point-min)))
-(defun eww-setup-buffer ()
- (switch-to-buffer (get-buffer-create "*eww*"))
+(defun eww-setup-buffer (buffer)
+ (switch-to-buffer (get-buffer-create (or buffer "*eww*")))
(let ((inhibit-read-only t))
(remove-overlays)
(erase-buffer))
@@ -624,7 +649,7 @@ the like."
(let ((map (make-sparse-keymap)))
(set-keymap-parent map special-mode-map)
(define-key map "g" 'eww-reload) ;FIXME: revert-buffer-function instead!
- (define-key map "G" 'eww)
+ (define-key map "G" 'eww-goto-url)
(define-key map [?\t] 'shr-next-link)
(define-key map [?\M-\t] 'shr-previous-link)
(define-key map [backtab] 'shr-previous-link)
@@ -648,8 +673,7 @@ the like."
(define-key map "b" 'eww-add-bookmark)
(define-key map "B" 'eww-list-bookmarks)
- (define-key map [(meta n)] 'eww-next-bookmark)
- (define-key map [(meta p)] 'eww-previous-bookmark)
+ (define-key map [(meta n)] 'clone-buffer)
(easy-menu-define nil map ""
'("Eww"
--
2.3.1
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#19902
; Package
emacs
.
(Wed, 04 Mar 2015 19:03:01 GMT)
Full text and
rfc822 format available.
Message #47 received at submit <at> debbugs.gnu.org (full text, mbox):
Juri Linkov <juri <at> linkov.net> writes:
>> Regarding the bookmark/info binding, the whole inspiration to this
>> change is to make the eww interface more info-like. Info is a
>> good manual browser, and eww benefits from assimilating features from
>> info to be a good web browser.
>
> Both info and eww could share a better keybinding. What comes to mind is
> `C-x 4 c' globally bound to clone-indirect-buffer-other-window.
> Could it be used in eww?
Shadowing a global binding seems weird. Also, it does not do the same
thing as clone-buffer and is disabled in Info.
Because of the incumbence, the mnemonic nature, and the brevity of M-n,
I'm hard pressed to think of a better binding.
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#19902
; Package
emacs
.
(Thu, 05 Mar 2015 12:53:01 GMT)
Full text and
rfc822 format available.
Message #50 received at 19902 <at> debbugs.gnu.org (full text, mbox):
Mark Oteiza <mvoteiza <at> udel.edu> writes:
> +Optional argument URL specifies the target to navigate;
> +the default is `eww-search-prefix'.
> +
> +In interactive use, a non-numeric prefix argument directs
> +this command to read URL from the minibuffer.
> +
> +A numeric prefix argument of N selects an eww buffer named \"*eww*<N>\"."
This all seems too complicated.
`M-x eww RET' should allow people to just paste in URLs or whatever.
--
(domestic pets only, the antidote for overdose, milk.)
bloggy blog: http://lars.ingebrigtsen.no
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#19902
; Package
emacs
.
(Thu, 05 Mar 2015 15:07:02 GMT)
Full text and
rfc822 format available.
Message #53 received at submit <at> debbugs.gnu.org (full text, mbox):
Lars Magne Ingebrigtsen <larsi <at> gnus.org> writes:
> Mark Oteiza <mvoteiza <at> udel.edu> writes:
>
>> +Optional argument URL specifies the target to navigate;
>> +the default is `eww-search-prefix'.
>> +
>> +In interactive use, a non-numeric prefix argument directs
>> +this command to read URL from the minibuffer.
>> +
>> +A numeric prefix argument of N selects an eww buffer named \"*eww*<N>\"."
>
> This all seems too complicated.
>
> `M-x eww RET' should allow people to just paste in URLs or whatever.
Which it does, unless *eww* already exists, in which case it switches to
the buffer. Then one can kit a key 'G' and paste a URL. Alternatively,
one can just do C-u M-x eww RET.
It works like info, and info works nicely. It gives people the choice
either to enter a URL, switch to any existing eww session, or create a
new one.
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#19902
; Package
emacs
.
(Thu, 05 Mar 2015 22:22:02 GMT)
Full text and
rfc822 format available.
Message #56 received at 19902 <at> debbugs.gnu.org (full text, mbox):
Mark Oteiza <mvoteiza <at> udel.edu> writes:
> Which it does, unless *eww* already exists, in which case it switches to
> the buffer. Then one can kit a key 'G' and paste a URL. Alternatively,
> one can just do C-u M-x eww RET.
I think that's way too confusing.
--
(domestic pets only, the antidote for overdose, milk.)
bloggy blog: http://lars.ingebrigtsen.no
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#19902
; Package
emacs
.
(Thu, 05 Mar 2015 23:26:01 GMT)
Full text and
rfc822 format available.
Message #59 received at submit <at> debbugs.gnu.org (full text, mbox):
Lars Magne Ingebrigtsen <larsi <at> gnus.org> writes:
> Mark Oteiza <mvoteiza <at> udel.edu> writes:
>
>> Which it does, unless *eww* already exists, in which case it switches to
>> the buffer. Then one can kit a key 'G' and paste a URL. Alternatively,
>> one can just do C-u M-x eww RET.
>
> I think that's way too confusing.
Thanks for the constructive feedback.
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#19902
; Package
emacs
.
(Fri, 06 Mar 2015 00:18:02 GMT)
Full text and
rfc822 format available.
Message #62 received at 19902 <at> debbugs.gnu.org (full text, mbox):
Mark Oteiza <mvoteiza <at> udel.edu> writes:
> Lars Magne Ingebrigtsen <larsi <at> gnus.org> writes:
>
>> Mark Oteiza <mvoteiza <at> udel.edu> writes:
>>
>>> Which it does, unless *eww* already exists, in which case it switches to
>>> the buffer. Then one can kit a key 'G' and paste a URL. Alternatively,
>>> one can just do C-u M-x eww RET.
>>
>> I think that's way too confusing.
>
> Thanks for the constructive feedback.
Your patch changes what happens when the user types `M-x eww' depending
on whether an unseen buffer exists or not. This makes the command
inconsistent, and therefore confusing.
You're 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#19902
; Package
emacs
.
(Fri, 25 Dec 2015 06:40:02 GMT)
Full text and
rfc822 format available.
Message #65 received at 19902 <at> debbugs.gnu.org (full text, mbox):
Lars Magne Ingebrigtsen <larsi <at> gnus.org> writes:
> Mark Oteiza <mvoteiza <at> udel.edu> writes:
>
>> Lars Magne Ingebrigtsen <larsi <at> gnus.org> writes:
>>
>>> Mark Oteiza <mvoteiza <at> udel.edu> writes:
>>>
>>>> Which it does, unless *eww* already exists, in which case it switches to
>>>> the buffer. Then one can kit a key 'G' and paste a URL. Alternatively,
>>>> one can just do C-u M-x eww RET.
>>>
>>> I think that's way too confusing.
>>
>> Thanks for the constructive feedback.
>
> Your patch changes what happens when the user types `M-x eww' depending
> on whether an unseen buffer exists or not. This makes the command
> inconsistent, and therefore confusing.
>
> You're welcome.
I'm still of the opinion that this feature is too confusing, so I'm
closing this bug report.
--
(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
.
(Fri, 25 Dec 2015 06:40:02 GMT)
Full text and
rfc822 format available.
bug closed, send any further explanations to
19902 <at> debbugs.gnu.org and Mark Oteiza <mvoteiza <at> udel.edu>
Request was from
Lars Ingebrigtsen <larsi <at> gnus.org>
to
control <at> debbugs.gnu.org
.
(Fri, 25 Dec 2015 06:40:02 GMT)
Full text and
rfc822 format available.
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#19902
; Package
emacs
.
(Fri, 25 Dec 2015 16:36:01 GMT)
Full text and
rfc822 format available.
Message #72 received at 19902 <at> debbugs.gnu.org (full text, mbox):
On 25/12/15 at 07:38am, Lars Ingebrigtsen wrote:
> Lars Magne Ingebrigtsen <larsi <at> gnus.org> writes:
>
> > Mark Oteiza <mvoteiza <at> udel.edu> writes:
> >
> >> Lars Magne Ingebrigtsen <larsi <at> gnus.org> writes:
> >>
> >>> Mark Oteiza <mvoteiza <at> udel.edu> writes:
> >>>
> >>>> Which it does, unless *eww* already exists, in which case it switches to
> >>>> the buffer. Then one can kit a key 'G' and paste a URL. Alternatively,
> >>>> one can just do C-u M-x eww RET.
> >>>
> >>> I think that's way too confusing.
> >>
> >> Thanks for the constructive feedback.
> >
> > Your patch changes what happens when the user types `M-x eww' depending
> > on whether an unseen buffer exists or not. This makes the command
> > inconsistent, and therefore confusing.
> >
> > You're welcome.
>
> I'm still of the opinion that this feature is too confusing, so I'm
> closing this bug report.
I had the idea of hiding this behind a defcustom to the effect of
`eww-always-prompt` (which would be t so the default behavior is
unchanged) but I still am at a loss to how you think this is confusing.
It's almost exactly how M-x info works.
If there was some simplification to which you would be amenable, I think
the bare minimum from this patch would be just switching to *eww* if it
exists already.
IIRC doing M-x eww RET some-url RET destroys the history of an existing
*eww* buffer, which is another annoying problem that the current M-x eww
"workflow" exacerbates. But I already mentioned that when I first
submitted the patch.
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#19902
; Package
emacs
.
(Fri, 25 Dec 2015 16:38:01 GMT)
Full text and
rfc822 format available.
Message #75 received at 19902 <at> debbugs.gnu.org (full text, mbox):
Mark Oteiza <mvoteiza <at> udel.edu> writes:
> IIRC doing M-x eww RET some-url RET destroys the history of an existing
> *eww* buffer, which is another annoying problem that the current M-x eww
> "workflow" exacerbates.
That bug has been fixed now.
--
(domestic pets only, the antidote for overdose, milk.)
bloggy blog: http://lars.ingebrigtsen.no
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#19902
; Package
emacs
.
(Fri, 25 Dec 2015 18:00:02 GMT)
Full text and
rfc822 format available.
Message #78 received at 19902 <at> debbugs.gnu.org (full text, mbox):
On 25/12/15 at 05:37pm, Lars Ingebrigtsen wrote:
> Mark Oteiza <mvoteiza <at> udel.edu> writes:
>
> > IIRC doing M-x eww RET some-url RET destroys the history of an existing
> > *eww* buffer, which is another annoying problem that the current M-x eww
> > "workflow" exacerbates.
>
> That bug has been fixed now.
Thanks (for all those fixes, for that matter).
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#19902
; Package
emacs
.
(Fri, 25 Dec 2015 18:01:02 GMT)
Full text and
rfc822 format available.
Message #81 received at 19902 <at> debbugs.gnu.org (full text, mbox):
On 25/12/15 at 07:38am, Lars Ingebrigtsen wrote:
> Lars Magne Ingebrigtsen <larsi <at> gnus.org> writes:
>
> > Mark Oteiza <mvoteiza <at> udel.edu> writes:
> >
> >> Lars Magne Ingebrigtsen <larsi <at> gnus.org> writes:
> >>
> >>> Mark Oteiza <mvoteiza <at> udel.edu> writes:
> >>>
> >>>> Which it does, unless *eww* already exists, in which case it switches to
> >>>> the buffer. Then one can kit a key 'G' and paste a URL. Alternatively,
> >>>> one can just do C-u M-x eww RET.
> >>>
> >>> I think that's way too confusing.
> >>
> >> Thanks for the constructive feedback.
> >
> > Your patch changes what happens when the user types `M-x eww' depending
> > on whether an unseen buffer exists or not. This makes the command
> > inconsistent, and therefore confusing.
> >
> > You're welcome.
>
> I'm still of the opinion that this feature is too confusing, so I'm
> closing this bug report.
OK, I'll continue on e-d then.
bug archived.
Request was from
Debbugs Internal Request <help-debbugs <at> gnu.org>
to
internal_control <at> debbugs.gnu.org
.
(Sat, 23 Jan 2016 12:24:04 GMT)
Full text and
rfc822 format available.
This bug report was last modified 9 years and 150 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.