aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorİ. Göktuğ Kayaalp2019-02-09 17:41:31 +0300
committerEli Zaretskii2019-02-15 10:24:14 +0200
commit3fa003a134471940956841cbcde9501767b765d6 (patch)
tree101d6d009628e9c3abfcaa5183ace4e30660b470
parent0d19e08da647c42562428dd608e5284cf414415e (diff)
downloademacs-3fa003a134471940956841cbcde9501767b765d6.tar.gz
emacs-3fa003a134471940956841cbcde9501767b765d6.zip
* lisp/net/eww.el (eww): With prefix arg, open url in new buffer.
Bug#34374
-rw-r--r--lisp/net/eww.el20
1 files changed, 14 insertions, 6 deletions
diff --git a/lisp/net/eww.el b/lisp/net/eww.el
index 555b3bd5917..d37a48126c1 100644
--- a/lisp/net/eww.el
+++ b/lisp/net/eww.el
@@ -247,21 +247,29 @@ This list can be customized via `eww-suggest-uris'."
247 (nreverse uris))) 247 (nreverse uris)))
248 248
249;;;###autoload 249;;;###autoload
250(defun eww (url) 250(defun eww (url &optional arg)
251 "Fetch URL and render the page. 251 "Fetch URL and render the page.
252If the input doesn't look like an URL or a domain name, the 252If the input doesn't look like an URL or a domain name, the
253word(s) will be searched for via `eww-search-prefix'." 253word(s) will be searched for via `eww-search-prefix'.
254
255If called with a prefix ARG, use a new buffer instead of reusing
256the default EWW buffer."
254 (interactive 257 (interactive
255 (let* ((uris (eww-suggested-uris)) 258 (let* ((uris (eww-suggested-uris))
256 (prompt (concat "Enter URL or keywords" 259 (prompt (concat "Enter URL or keywords"
257 (if uris (format " (default %s)" (car uris)) "") 260 (if uris (format " (default %s)" (car uris)) "")
258 ": "))) 261 ": ")))
259 (list (read-string prompt nil 'eww-prompt-history uris)))) 262 (list (read-string prompt nil 'eww-prompt-history uris)
263 (prefix-numeric-value current-prefix-arg))))
260 (setq url (eww--dwim-expand-url url)) 264 (setq url (eww--dwim-expand-url url))
261 (pop-to-buffer-same-window 265 (pop-to-buffer-same-window
262 (if (eq major-mode 'eww-mode) 266 (cond
263 (current-buffer) 267 ((eq arg 4)
264 (get-buffer-create "*eww*"))) 268 (generate-new-buffer "*eww*"))
269 ((eq major-mode 'eww-mode)
270 (current-buffer))
271 (t
272 (get-buffer-create "*eww*"))))
265 (eww-setup-buffer) 273 (eww-setup-buffer)
266 ;; Check whether the domain only uses "Highly Restricted" Unicode 274 ;; Check whether the domain only uses "Highly Restricted" Unicode
267 ;; IDNA characters. If not, transform to punycode to indicate that 275 ;; IDNA characters. If not, transform to punycode to indicate that