Commit e47112ee authored by Ted Zlatanov's avatar Ted Zlatanov
Browse files

eww usability improvements

* 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
parent 0e2c793f
2013-11-26 Kenjiro NAKAYAMA <knakayam@redhat.com> (tiny change)
* 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
2013-11-26 Eli Zaretskii <eliz@gnu.org>
* vc/vc.el (vc-diff-internal): Use *-dos coding-system when
......
......@@ -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 "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."
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment