summaryrefslogtreecommitdiff
path: root/lisp
diff options
context:
space:
mode:
Diffstat (limited to 'lisp')
-rw-r--r--lisp/ChangeLog5
-rw-r--r--lisp/net/eww.el25
2 files changed, 17 insertions, 13 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 70293af2725..044c2999396 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,8 @@
+2015-01-26 Lars Ingebrigtsen <larsi@gnus.org>
+
+ * net/eww.el (eww-add-bookmark): Fix prompt and clean up the code
+ slightly.
+
2015-01-25 Stefan Monnier <monnier@iro.umontreal.ca>
* emacs-lisp/cl-generic.el (cl--generic-no-next-method-function): New fun.
diff --git a/lisp/net/eww.el b/lisp/net/eww.el
index 879eb53115e..ec7a0baacf6 100644
--- a/lisp/net/eww.el
+++ b/lisp/net/eww.el
@@ -1430,24 +1430,23 @@ Differences in #targets are ignored."
(defvar eww-bookmarks nil)
(defun eww-add-bookmark ()
- "Add the current page to the bookmarks."
+ "Bookmark the current page."
(interactive)
(eww-read-bookmarks)
(dolist (bookmark eww-bookmarks)
(when (equal (plist-get eww-data :url) (plist-get bookmark :url))
(user-error "Already bookmarked")))
- (if (y-or-n-p "bookmark this page? ")
- (progn
- (let ((title (replace-regexp-in-string "[\n\t\r]" " "
- (plist-get eww-data :title))))
- (setq title (replace-regexp-in-string "\\` +\\| +\\'" "" title))
- (push (list :url (plist-get eww-data :url)
- :title title
- :time (current-time-string))
- eww-bookmarks))
- (eww-write-bookmarks)
- (message "Bookmarked %s (%s)" (plist-get eww-data :url)
- (plist-get eww-data :title)))))
+ (when (y-or-n-p "Bookmark this page?")
+ (let ((title (replace-regexp-in-string "[\n\t\r]" " "
+ (plist-get eww-data :title))))
+ (setq title (replace-regexp-in-string "\\` +\\| +\\'" "" title))
+ (push (list :url (plist-get eww-data :url)
+ :title title
+ :time (current-time-string))
+ eww-bookmarks))
+ (eww-write-bookmarks)
+ (message "Bookmarked %s (%s)" (plist-get eww-data :url)
+ (plist-get eww-data :title))))
(defun eww-write-bookmarks ()
(with-temp-file (expand-file-name "eww-bookmarks" eww-bookmarks-directory)