]> git.eshelyaron.com Git - emacs.git/commitdiff
Revert change to eww-suggest-uris
authorMark Oteiza <mvoteiza@udel.edu>
Wed, 2 Nov 2016 20:18:49 +0000 (16:18 -0400)
committerMark Oteiza <mvoteiza@udel.edu>
Wed, 2 Nov 2016 20:18:49 +0000 (16:18 -0400)
The introduced append is ugly and can yield '(nil); doing delq on it
would be hacks on hacks.
* lisp/net/eww.el: Require cl-lib at run time.
(eww-suggest-uris): Restore eww-current-url, reverting previous change.
(eww): Remove erroneous append.
(eww-open-in-new-buffer): Check if the return from eww-suggested-uris is
equal to eww-current-url, which is nil anyways if we are not in an EWW
buffer.

lisp/net/eww.el

index 5310a81465599b416fc8e8fa51555a5f2a26bded..a5b3ce3927eb010b74097d636159f2a1ad71ef96 100644 (file)
@@ -24,7 +24,7 @@
 
 ;;; Code:
 
-(eval-when-compile (require 'cl))
+(require 'cl-lib)
 (require 'format-spec)
 (require 'shr)
 (require 'url)
 ;;;###autoload
 (defcustom eww-suggest-uris
   '(eww-links-at-point
-    url-get-url-at-point)
+    url-get-url-at-point
+    eww-current-url)
   "List of functions called to form the list of default URIs for `eww'.
 Each of the elements is a function returning either a string or a list
 of strings.  The results will be joined into a single list with
 duplicate entries (if any) removed."
-  :version "26.1"
+  :version "25.1"
   :group 'eww
   :type 'hook
   :options '(eww-links-at-point
-            url-get-url-at-point))
+             url-get-url-at-point
+             eww-current-url))
 
 (defcustom eww-bookmarks-directory user-emacs-directory
   "Directory where bookmark files will be stored."
@@ -244,7 +246,7 @@ This list can be customized via `eww-suggest-uris'."
 If the input doesn't look like an URL or a domain name, the
 word(s) will be searched for via `eww-search-prefix'."
   (interactive
-   (let* ((uris (append (eww-suggested-uris) (list (eww-current-url))))
+   (let* ((uris (eww-suggested-uris))
          (prompt (concat "Enter URL or keywords"
                          (if uris (format " (default %s)" (car uris)) "")
                          ": ")))
@@ -322,7 +324,9 @@ See the `eww-search-prefix' variable for the search engine used."
       (with-current-buffer
           (if (eq major-mode 'eww-mode) (clone-buffer)
             (generate-new-buffer "*eww*"))
-        (eww (if (consp url) (car url) url))))))
+        (unless (equal url (eww-current-url))
+          (eww-mode)
+          (eww (if (consp url) (car url) url)))))))
 
 (defun eww-html-p (content-type)
   "Return non-nil if CONTENT-TYPE designates an HTML content type.