[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] master 3fa003a: * lisp/net/eww.el (eww): With prefix arg,
From: |
Eli Zaretskii |
Subject: |
[Emacs-diffs] master 3fa003a: * lisp/net/eww.el (eww): With prefix arg, open url in new buffer. |
Date: |
Fri, 15 Feb 2019 03:25:08 -0500 (EST) |
branch: master
commit 3fa003a134471940956841cbcde9501767b765d6
Author: İ. Göktuğ Kayaalp <address@hidden>
Commit: Eli Zaretskii <address@hidden>
* lisp/net/eww.el (eww): With prefix arg, open url in new buffer.
Bug#34374
---
lisp/net/eww.el | 20 ++++++++++++++------
1 file changed, 14 insertions(+), 6 deletions(-)
diff --git a/lisp/net/eww.el b/lisp/net/eww.el
index 555b3bd..d37a481 100644
--- a/lisp/net/eww.el
+++ b/lisp/net/eww.el
@@ -247,21 +247,29 @@ This list can be customized via `eww-suggest-uris'."
(nreverse uris)))
;;;###autoload
-(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."
(interactive
(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))
(pop-to-buffer-same-window
- (if (eq major-mode 'eww-mode)
- (current-buffer)
- (get-buffer-create "*eww*")))
+ (cond
+ ((eq arg 4)
+ (generate-new-buffer "*eww*"))
+ ((eq major-mode 'eww-mode)
+ (current-buffer))
+ (t
+ (get-buffer-create "*eww*"))))
(eww-setup-buffer)
;; Check whether the domain only uses "Highly Restricted" Unicode
;; IDNA characters. If not, transform to punycode to indicate that
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Emacs-diffs] master 3fa003a: * lisp/net/eww.el (eww): With prefix arg, open url in new buffer.,
Eli Zaretskii <=