(eww-browse-url): Don't push stuff onto history if there's nothing to push.
authorLars Magne Ingebrigtsen <larsi@gnus.org>
Wed, 19 Jun 2013 07:31:57 +0000 (09:31 +0200)
committerLars Magne Ingebrigtsen <larsi@gnus.org>
Wed, 19 Jun 2013 07:31:57 +0000 (09:31 +0200)
lisp/ChangeLog
lisp/eww.el

index bca2770..fd7ef21 100644 (file)
@@ -1,5 +1,8 @@
 2013-06-19  Lars Magne Ingebrigtsen  <larsi@gnus.org>
 
+       * eww.el (eww-browse-url): Don't push stuff onto history if there's
+       nothing to push.
+
        * shr.el (shr-map): Bind [down-mouse-1] to browse URLs.
 
 2013-06-18  Teodor Zlatanov  <tzz@lifelogs.com>
index 66180d9..a76cd16 100644 (file)
   (set (make-local-variable 'browse-url-browser-function) 'eww-browse-url))
 
 (defun eww-browse-url (url &optional new-window)
-  (push (list eww-current-url (point))
-       eww-history)
+  (when (and (equal major-mode 'eww-mode)
+            eww-current-url)
+    (push (list eww-current-url (point))
+         eww-history))
   (eww url))
 
 (defun eww-quit ()