aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMark Oteiza2016-11-02 16:18:49 -0400
committerMark Oteiza2016-11-02 16:18:49 -0400
commit62a6e28e0cc2f7f652f2944a78c88a07051dbeae (patch)
treee5355e3abdce0d9c499e224048f2d43c89e662e0
parentbbc218b9b06d952f0ba31f7706d88c0bf8dc41d8 (diff)
downloademacs-62a6e28e0cc2f7f652f2944a78c88a07051dbeae.tar.gz
emacs-62a6e28e0cc2f7f652f2944a78c88a07051dbeae.zip
Revert change to eww-suggest-uris
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.
-rw-r--r--lisp/net/eww.el16
1 files changed, 10 insertions, 6 deletions
diff --git a/lisp/net/eww.el b/lisp/net/eww.el
index 5310a814655..a5b3ce3927e 100644
--- a/lisp/net/eww.el
+++ b/lisp/net/eww.el
@@ -24,7 +24,7 @@
24 24
25;;; Code: 25;;; Code:
26 26
27(eval-when-compile (require 'cl)) 27(require 'cl-lib)
28(require 'format-spec) 28(require 'format-spec)
29(require 'shr) 29(require 'shr)
30(require 'url) 30(require 'url)
@@ -64,16 +64,18 @@
64;;;###autoload 64;;;###autoload
65(defcustom eww-suggest-uris 65(defcustom eww-suggest-uris
66 '(eww-links-at-point 66 '(eww-links-at-point
67 url-get-url-at-point) 67 url-get-url-at-point
68 eww-current-url)
68 "List of functions called to form the list of default URIs for `eww'. 69 "List of functions called to form the list of default URIs for `eww'.
69Each of the elements is a function returning either a string or a list 70Each of the elements is a function returning either a string or a list
70of strings. The results will be joined into a single list with 71of strings. The results will be joined into a single list with
71duplicate entries (if any) removed." 72duplicate entries (if any) removed."
72 :version "26.1" 73 :version "25.1"
73 :group 'eww 74 :group 'eww
74 :type 'hook 75 :type 'hook
75 :options '(eww-links-at-point 76 :options '(eww-links-at-point
76 url-get-url-at-point)) 77 url-get-url-at-point
78 eww-current-url))
77 79
78(defcustom eww-bookmarks-directory user-emacs-directory 80(defcustom eww-bookmarks-directory user-emacs-directory
79 "Directory where bookmark files will be stored." 81 "Directory where bookmark files will be stored."
@@ -244,7 +246,7 @@ This list can be customized via `eww-suggest-uris'."
244If the input doesn't look like an URL or a domain name, the 246If the input doesn't look like an URL or a domain name, the
245word(s) will be searched for via `eww-search-prefix'." 247word(s) will be searched for via `eww-search-prefix'."
246 (interactive 248 (interactive
247 (let* ((uris (append (eww-suggested-uris) (list (eww-current-url)))) 249 (let* ((uris (eww-suggested-uris))
248 (prompt (concat "Enter URL or keywords" 250 (prompt (concat "Enter URL or keywords"
249 (if uris (format " (default %s)" (car uris)) "") 251 (if uris (format " (default %s)" (car uris)) "")
250 ": "))) 252 ": ")))
@@ -322,7 +324,9 @@ See the `eww-search-prefix' variable for the search engine used."
322 (with-current-buffer 324 (with-current-buffer
323 (if (eq major-mode 'eww-mode) (clone-buffer) 325 (if (eq major-mode 'eww-mode) (clone-buffer)
324 (generate-new-buffer "*eww*")) 326 (generate-new-buffer "*eww*"))
325 (eww (if (consp url) (car url) url)))))) 327 (unless (equal url (eww-current-url))
328 (eww-mode)
329 (eww (if (consp url) (car url) url)))))))
326 330
327(defun eww-html-p (content-type) 331(defun eww-html-p (content-type)
328 "Return non-nil if CONTENT-TYPE designates an HTML content type. 332 "Return non-nil if CONTENT-TYPE designates an HTML content type.