GNU bug report logs -
#15966
24.3.50; [PATCH] eww: ask confirmation when add bookmarks
Previous Next
Reported by: Kenjiro NAKAYAMA <knakayam <at> redhat.com>
Date: Sun, 24 Nov 2013 15:39:03 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.
Full log
View this message in rfc822 format
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.
This bug report was last modified 11 years and 235 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.