Commit 3fa003a1 authored by İ. Göktuğ Kayaalp's avatar İ. Göktuğ Kayaalp Committed by Eli Zaretskii

* lisp/net/eww.el (eww): With prefix arg, open url in new buffer.

parent 0d19e08d
Pipeline #772 failed with stage
in 60 minutes and 1 second
......@@ -247,21 +247,29 @@ This list can be customized via `eww-suggest-uris'."
(nreverse uris)))
(defun eww (url)
(defun eww (url &optional arg)
"Fetch URL and render the page.
If the input doesn't look like an URL or a domain name, the
word(s) will be searched for via `eww-search-prefix'."
word(s) will be searched for via `eww-search-prefix'.
If called with a prefix ARG, use a new buffer instead of reusing
the default EWW buffer."
(let* ((uris (eww-suggested-uris))
(prompt (concat "Enter URL or keywords"
(if uris (format " (default %s)" (car uris)) "")
": ")))
(list (read-string prompt nil 'eww-prompt-history uris))))
(list (read-string prompt nil 'eww-prompt-history uris)
(prefix-numeric-value current-prefix-arg))))
(setq url (eww--dwim-expand-url url))
(if (eq major-mode 'eww-mode)
(get-buffer-create "*eww*")))
((eq arg 4)
(generate-new-buffer "*eww*"))
((eq major-mode 'eww-mode)
(get-buffer-create "*eww*"))))
;; Check whether the domain only uses "Highly Restricted" Unicode
;; IDNA characters. If not, transform to punycode to indicate that
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment