emacs-bug-tracker
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[debbugs-tracker] bug#15966: closed (24.3.50; [PATCH] eww: ask confirmat


From: GNU bug Tracking System
Subject: [debbugs-tracker] bug#15966: closed (24.3.50; [PATCH] eww: ask confirmation when add bookmarks)
Date: Tue, 26 Nov 2013 20:10:06 +0000

Your message dated Tue, 26 Nov 2013 15:10:31 -0500
with message-id <address@hidden>
and subject line 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.
has caused the debbugs.gnu.org bug report #15966,
regarding 24.3.50; [PATCH] eww: ask confirmation when add bookmarks
to be marked as done.

(If you believe you have received this mail in error, please contact
address@hidden)


-- 
15966: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=15966
GNU Bug Tracking System
Contact address@hidden with problems
--- Begin Message --- Subject: 24.3.50; [PATCH] eww: ask confirmation when add bookmarks Date: Sun, 24 Nov 2013 23:41:44 +0900 User-agent: mu4e 0.9.9.6pre2; emacs 24.3.50.2
eww should ask "yes or no" when add current page to bookmarks, since
only "b" key to add bookmarks is easy to mistake.
(My bookmarklist has amazingly increased.)

Signed-off-by: Kenjiro NAKAYAMA <address@hidden>

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

---
 lisp/net/eww.el | 18 ++++++++++--------
 1 file changed, 10 insertions(+), 8 deletions(-)

diff --git a/lisp/net/eww.el b/lisp/net/eww.el
index 86e0977..6f09d86 100644
--- a/lisp/net/eww.el
+++ b/lisp/net/eww.el
@@ -964,14 +964,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)
-- 
1.8.3.1



--- End Message ---
--- Begin Message --- 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 User-agent: Gnus/5.130008 (Ma Gnus v0.8) Emacs/24.3.50 (gnu/linux)
On Tue, 26 Nov 2013 20:51:49 +0900 Kenjiro NAKAYAMA <address@hidden> 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


--- End Message ---

reply via email to

[Prev in Thread] Current Thread [Next in Thread]