GNU bug report logs - #15910
24.3.50; [PATCH] eww: Current URL is not entered automatically, after eww starts.

Previous Next

Package: emacs;

Reported by: Kenjiro NAKAYAMA <nakayamakenjiro <at> gmail.com>

Date: Sat, 16 Nov 2013 11:04:02 UTC

Severity: wishlist

Tags: patch

Found in version 24.3.50

Done: Ted Zlatanov <tzz <at> lifelogs.com>

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 15910 in the body.
You can then email your comments to 15910 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#15910; Package emacs. (Sat, 16 Nov 2013 11:04:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Kenjiro NAKAYAMA <nakayamakenjiro <at> gmail.com>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Sat, 16 Nov 2013 11:04:02 GMT) Full text and rfc822 format available.

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

From: Kenjiro NAKAYAMA <nakayamakenjiro <at> gmail.com>
To: bug-gnu-emacs <at> gnu.org
Subject: 24.3.50;
 [PATCH] eww: Current URL is not entered automatically, after eww
 starts.
Date: Sat, 16 Nov 2013 20:03:11 +0900
After the start of eww, if I try to jump to another URL (by M-x eww again), eww asks to enter the URL entirely again.
If eww enters the current URL automatically, it is very useful.
And if the current URL is not necessary, it is easy to delete the URL.

Signed-off-by: Kenjiro Nakayama <nakayamakenjiro <at> gmail.com>
---
 lisp/net/eww.el | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lisp/net/eww.el b/lisp/net/eww.el
index 573715e..d835560 100644
--- a/lisp/net/eww.el
+++ b/lisp/net/eww.el
@@ -106,7 +106,7 @@
   "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 "sEnter URL or keywords: ")
+  (interactive (list (read-string "sEnter URL or keywords: " eww-current-url)))
   (if (and (= (length (split-string url)) 1)
            (> (length (split-string url "\\.")) 1))
       (progn
-- 
1.8.3.1




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#15910; Package emacs. (Thu, 21 Nov 2013 16:47:02 GMT) Full text and rfc822 format available.

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

From: Ted Zlatanov <tzz <at> lifelogs.com>
To: Kenjiro NAKAYAMA <nakayamakenjiro <at> gmail.com>
Cc: 15910 <at> debbugs.gnu.org
Subject: Re: bug#15910: 24.3.50;
 [PATCH] eww: Current URL is not entered automatically, after eww
 starts.
Date: Thu, 21 Nov 2013 11:47:25 -0500
On Sat, 16 Nov 2013 20:03:11 +0900 Kenjiro NAKAYAMA <nakayamakenjiro <at> gmail.com> wrote: 

KN> After the start of eww, if I try to jump to another URL (by M-x eww again), eww asks to enter the URL entirely again.
KN> If eww enters the current URL automatically, it is very useful.
KN> And if the current URL is not necessary, it is easy to delete the URL.

I like the idea.  But I'm not sure it's necessary, since simply `up' or
`M-p' will normally bring up the input history.  I'll take any
opinions...

Thanks
Ted




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#15910; Package emacs. (Fri, 22 Nov 2013 03:28:02 GMT) Full text and rfc822 format available.

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

From: Masatake YAMATO <yamato <at> redhat.com>
To: 15910 <at> debbugs.gnu.org
Subject: Re: 24.3.50; [PATCH] eww: Current URL is not entered
 automatically, after eww starts.
Date: Fri, 22 Nov 2013 12:26:59 +0900 (JST)
eww() takes URL only. So I think eww should have its own
history stack. However, if the current page is opened via
non-interactive call of emm(), the url for the page will
not be stored to history stack. As the result the user cannot
retrieve the url via \M-p.

So I think both the initial value, which Kenjiro proposed, and emm own
history stack are needed in read-string.

BTW, I recommend you to put ChangeLog entry to the report when
you propose a patch.

Masatake YAMATO




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#15910; Package emacs. (Fri, 22 Nov 2013 16:15:02 GMT) Full text and rfc822 format available.

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

From: Ted Zlatanov <tzz <at> lifelogs.com>
To: Masatake YAMATO <yamato <at> redhat.com>
Cc: 15910 <at> debbugs.gnu.org
Subject: Re: bug#15910: 24.3.50;
 [PATCH] eww: Current URL is not entered automatically, after eww
 starts.
Date: Fri, 22 Nov 2013 11:15:16 -0500
On Fri, 22 Nov 2013 12:26:59 +0900 (JST) Masatake YAMATO <yamato <at> redhat.com> wrote: 

MY> eww() takes URL only. So I think eww should have its own
MY> history stack. However, if the current page is opened via
MY> non-interactive call of emm(), the url for the page will
MY> not be stored to history stack. As the result the user cannot
MY> retrieve the url via \M-p.

Good point.  s/emm/eww/.

MY> So I think both the initial value, which Kenjiro proposed, and emm own
MY> history stack are needed in read-string.

Yes.  Furthermore, followed links within `eww' should be added to the
history stack.  That would be valuable.

MY> BTW, I recommend you to put ChangeLog entry to the report when
MY> you propose a patch.

Yes, please :)

Ted




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#15910; Package emacs. (Sun, 24 Nov 2013 15:58:01 GMT) Full text and rfc822 format available.

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

From: Kenjiro NAKAYAMA <nakayamakenjiro <at> gmail.com>
To: 15910 <at> debbugs.gnu.org
Subject: Re: bug#15910: 24.3.50;
 [PATCH] eww: Current URL is not entered automatically, after
 ewwstarts.s.
Date: Mon, 25 Nov 2013 00:57:33 +0900
Thank you for your review, Ted, Masatake.

OK, I try to revise the patch to add eww own history stack.
And I put ChangeLog entry to my report next time.

Kenjiro




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#15910; Package emacs. (Mon, 25 Nov 2013 14:54:01 GMT) Full text and rfc822 format available.

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

From: Ted Zlatanov <tzz <at> lifelogs.com>
To: Kenjiro NAKAYAMA <knakayam <at> redhat.com>
Cc: 15910 <at> debbugs.gnu.org, Kenjiro NAKAYAMA <nakayamakenjiro <at> gmail.com>,
 15966 <at> debbugs.gnu.org, 15967 <at> debbugs.gnu.org, 15965 <at> debbugs.gnu.org
Subject: Re: bug#15967: 24.3.50;
 [PATCH] eww: use eww-browse-url, when url in bookmark list is opened,
 bug#15966: 24.3.50;
 [PATCH] eww: ask confirmation when add bookmarks, bug#15965: 24.3.50;
 [PATCH] eww: ask confirmation before quitting, bug#15910: 24.3.50;
 [PATCH] eww: Current URL is not entered automatically, after ewwstarts.s.
Date: Mon, 25 Nov 2013 09:54:32 -0500
Thank you for the patches.  All of them are OK to go in IMO (and tiny
changes).  Could you consolidate them in a single patch with a ChangeLog
please?  It can wait for your eww history stack changes or can be
submitted sooner.

Thanks
Ted

On Mon, 25 Nov 2013 00:15:52 +0900 Kenjiro NAKAYAMA <knakayam <at> redhat.com> wrote: 

KN> Since eww-bookmark-browse doesn't use eww-browse-url to open its url, it
KN> doesn't save current URL in eww-history.

KN> Signed-off-by: Kenjiro NAKAYAMA <knakayam <at> redhat.com>

KN>         * net/eww.el (eww-bookmark-browse): Use 'eww-browse-url'.

On Sun, 24 Nov 2013 23:41:44 +0900 Kenjiro NAKAYAMA <knakayam <at> redhat.com> wrote: 

KN> eww should ask "yes or no" when add current page to bookmarks, since
KN> only "b" key to add bookmarks is easy to mistake.
KN> (My bookmarklist has amazingly increased.)

KN> Signed-off-by: Kenjiro NAKAYAMA <knakayam <at> redhat.com>

KN>         * net/eww.el (eww-add-bookmark): ask confirmation when add to bookmarks

On Sun, 24 Nov 2013 23:12:47 +0900 Kenjiro NAKAYAMA <knakayam <at> redhat.com> wrote: 

KN> eww should ask "yes or no" before quitting, since only "q" key to quit is
KN> easy to mistake.

KN> Signed-off-by: Kenjiro NAKAYAMA <knakayam <at> redhat.com>

KN>         * net/eww.el (eww-quit): ask confirmation before quitting eww

On Mon, 25 Nov 2013 00:57:33 +0900 Kenjiro NAKAYAMA <nakayamakenjiro <at> gmail.com> wrote: 

KN> Thank you for your review, Ted, Masatake.

KN> OK, I try to revise the patch to add eww own history stack.
KN> And I put ChangeLog entry to my report next time.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#15910; Package emacs. (Tue, 26 Nov 2013 11:53:01 GMT) Full text and rfc822 format available.

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

From: Kenjiro NAKAYAMA <knakayam <at> redhat.com>
To: Ted Zlatanov <tzz <at> lifelogs.com>
Cc: Kenjiro NAKAYAMA <nakayamakenjiro <at> gmail.com>, 15966 <at> debbugs.gnu.org,
 15967 <at> debbugs.gnu.org, 15965 <at> debbugs.gnu.org, 15910 <at> debbugs.gnu.org,
 Kenjiro NAKAYAMA <knakayam <at> redhat.com>
Subject: Re: bug#15967: 24.3.50;
 [PATCH] eww: use eww-browse-url, when url in bookmark list is opened,
 bug#15966: 24.3.50;
 [PATCH] eww: ask confirmation when add bookmarks, bug#15965: 24.3.50;
 [PATCH] eww: ask confirmation before quitting, bug#15910: 24.3.50;
 [PATCH] eww: Current URL is not entered automatically, after ewwstarts.s.
Date: Tue, 26 Nov 2013 20:51:49 +0900
Thanks, Ted.
I consolidated the patches, please include the patch if appreciated.


Signed-off-by: Kenjiro NAKAYAMA <knakayam <at> redhat.com> 

        * net/eww.el (eww-bookmark-browse): Use 'eww-browse-url'.
        (eww-add-bookmark): ask confirmation when add to bookmarks
        (eww-quit): ask confirmation before quitting eww

---
 lisp/net/eww.el | 26 +++++++++++++++-----------
 1 file changed, 15 insertions(+), 11 deletions(-)

diff --git a/lisp/net/eww.el b/lisp/net/eww.el
index 86e0977..4b8b067 100644
--- a/lisp/net/eww.el
+++ b/lisp/net/eww.el
@@ -403,8 +403,10 @@ word(s) will be searched for via `eww-search-prefix'."
 (defun eww-quit ()
   "Exit the Emacs Web Wowser."
   (interactive)
-  (setq eww-history nil)
-  (kill-buffer (current-buffer)))
+  (if (y-or-n-p "quit eww? ")
+      (progn
+	(setq eww-history nil)
+	(kill-buffer (current-buffer)))))
 
 (defun eww-back-url ()
   "Go to the previously displayed page."
@@ -964,14 +966,16 @@ The browser to used is specified by the `shr-external-browser' variable."
     (when (equal eww-current-url
 		 (plist-get bookmark :url))
       (error "Already bookmarked")))
-  (let ((title (replace-regexp-in-string "[\n\t\r]" " " eww-current-title)))
-    (setq title (replace-regexp-in-string "\\` +\\| +\\'" "" title))
-    (push (list :url eww-current-url
-		:title title
-		:time (current-time-string))
-	  eww-bookmarks))
-  (eww-write-bookmarks)
-  (message "Bookmarked %s (%s)" eww-current-url eww-current-title))
+  (if (y-or-n-p "add bookmark this page? ")
+      (progn
+	(let ((title (replace-regexp-in-string "[\n\t\r]" " " eww-current-title)))
+	  (setq title (replace-regexp-in-string "\\` +\\| +\\'" "" title))
+	  (push (list :url eww-current-url
+		      :title title
+		      :time (current-time-string))
+		eww-bookmarks))
+	(eww-write-bookmarks)
+	(message "Bookmarked %s (%s)" eww-current-url eww-current-title))))
 
 (defun eww-write-bookmarks ()
   (with-temp-file (expand-file-name "eww-bookmarks" user-emacs-directory)
@@ -1063,7 +1067,7 @@ The browser to used is specified by the `shr-external-browser' variable."
     ;; just let it remain.
     (ignore-errors
       (delete-window))
-    (eww (plist-get bookmark :url))))
+    (eww-browse-url (plist-get bookmark :url))))
 
 (defun eww-next-bookmark ()
   "Go to the next bookmark in the list."
-- 
1.8.3.1

Thanks,

Kenjiro Nakayama

        

tzz <at> lifelogs.com writes:

> Thank you for the patches.  All of them are OK to go in IMO (and tiny
> changes).  Could you consolidate them in a single patch with a ChangeLog
> please?  It can wait for your eww history stack changes or can be
> submitted sooner.
>
> Thanks
> Ted
>
> On Mon, 25 Nov 2013 00:15:52 +0900 Kenjiro NAKAYAMA <knakayam <at> redhat.com> wrote: 
>
> KN> Since eww-bookmark-browse doesn't use eww-browse-url to open its url, it
> KN> doesn't save current URL in eww-history.
>
> KN> Signed-off-by: Kenjiro NAKAYAMA <knakayam <at> redhat.com>
>
> KN>         * net/eww.el (eww-bookmark-browse): Use 'eww-browse-url'.
>
> On Sun, 24 Nov 2013 23:41:44 +0900 Kenjiro NAKAYAMA <knakayam <at> redhat.com> wrote: 
>
> KN> eww should ask "yes or no" when add current page to bookmarks, since
> KN> only "b" key to add bookmarks is easy to mistake.
> KN> (My bookmarklist has amazingly increased.)
>
> KN> Signed-off-by: Kenjiro NAKAYAMA <knakayam <at> redhat.com>
>
> KN>         * net/eww.el (eww-add-bookmark): ask confirmation when add to bookmarks
>
> On Sun, 24 Nov 2013 23:12:47 +0900 Kenjiro NAKAYAMA <knakayam <at> redhat.com> wrote: 
>
> KN> eww should ask "yes or no" before quitting, since only "q" key to quit is
> KN> easy to mistake.
>
> KN> Signed-off-by: Kenjiro NAKAYAMA <knakayam <at> redhat.com>
>
> KN>         * net/eww.el (eww-quit): ask confirmation before quitting eww
>
> On Mon, 25 Nov 2013 00:57:33 +0900 Kenjiro NAKAYAMA <nakayamakenjiro <at> gmail.com> wrote: 
>
> KN> Thank you for your review, Ted, Masatake.
>
> KN> OK, I try to revise the patch to add eww own history stack.
> KN> And I put ChangeLog entry to my report next time.





Reply sent to Ted Zlatanov <tzz <at> lifelogs.com>:
You have taken responsibility. (Tue, 26 Nov 2013 20:10:01 GMT) Full text and rfc822 format available.

Notification sent to Kenjiro NAKAYAMA <nakayamakenjiro <at> gmail.com>:
bug acknowledged by developer. (Tue, 26 Nov 2013 20:10:02 GMT) Full text and rfc822 format available.

Message #28 received at 15910-done <at> debbugs.gnu.org (full text, mbox):

From: Ted Zlatanov <tzz <at> lifelogs.com>
To: Kenjiro NAKAYAMA <knakayam <at> redhat.com>
Cc: 15965-done <at> debbugs.gnu.org, Kenjiro NAKAYAMA <nakayamakenjiro <at> gmail.com>,
 15966-done <at> debbugs.gnu.org, 15910-done <at> debbugs.gnu.org,
 15967-done <at> debbugs.gnu.org
Subject: Re: bug#15966: bug#15967: 24.3.50;
 [PATCH] eww: use eww-browse-url, when url in bookmark list is opened,
 bug#15966: 24.3.50;
 [PATCH] eww: ask confirmation when add bookmarks, bug#15965: 24.3.50;
 [PATCH] eww: ask confirmation before quitting, bug#15910: 24.3.50;
 [PATCH] eww: Current URL is not entered automatically, after ewwstarts.s.
Date: Tue, 26 Nov 2013 15:10:31 -0500
On Tue, 26 Nov 2013 20:51:49 +0900 Kenjiro NAKAYAMA <knakayam <at> redhat.com> wrote: 

KN> I consolidated the patches, please include the patch if appreciated.

OK; done.  I changed "add bookmark this page?" to "bookmark this page?"
but otherwise had no issues.

Thanks!
Ted




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Wed, 25 Dec 2013 12:24:03 GMT) Full text and rfc822 format available.

This bug report was last modified 11 years and 237 days ago.

Previous Next


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