GNU bug report logs -
#65346
30.0.50; *lisp/net/eww.el: new function 'eww-open-in-new-buffer-background'
Previous Next
Reported by: Lin Sun <sunlin7 <at> yahoo.com>
Date: Wed, 16 Aug 2023 19:41:01 UTC
Severity: normal
Found in version 30.0.50
Done: Eli Zaretskii <eliz <at> gnu.org>
Bug is archived. No further changes may be made.
Full log
Message #17 received at 65346 <at> debbugs.gnu.org (full text, mbox):
> From: Lin Sun <sunlin7 <at> yahoo.com>
> Date: Thu, 17 Aug 2023 22:51:04 +0000
> Cc: 65346 <at> debbugs.gnu.org
>
> Thank you for the comment, and agree with you, so I rewrote the
> function `eww-open-in-new-buffer' with "C-u" support (also with an
> optional argument "url"), then there is no "background" description.
>
> I also tested the new patch with tab-bar-mode on and off, it works for
> both scenarios.
>
> Please help review again. Thanks.
Thanks. However, the way you implemented my suggestion is not what I
had in mind.
> -(defun eww-open-in-new-buffer ()
> - "Fetch link at point in a new EWW buffer."
> - (interactive)
> - (let ((url (eww-suggested-uris)))
> - (if (null url) (user-error "No link at point")
> - (when (or (eq eww-browse-url-new-window-is-tab t)
> - (and (eq eww-browse-url-new-window-is-tab 'tab-bar)
> - tab-bar-mode))
> - (let ((tab-bar-new-tab-choice t))
> - (tab-new)))
> - ;; clone useful to keep history, but
> - ;; should not clone from non-eww buffer
> - (with-current-buffer
> - (if (eq major-mode 'eww-mode) (clone-buffer)
> - (generate-new-buffer "*eww*"))
> - (unless (equal url (eww-current-url))
> - (eww-mode)
> - (eww (if (consp url) (car url) url)))))))
> +(defun eww--open-url-in-new-buffer (url)
> + "Open the URL in a new EWW buffer."
> + ;; clone useful to keep history, but
> + ;; should not clone from non-eww buffer
> + (with-current-buffer
> + (if (eq major-mode 'eww-mode) (clone-buffer)
> + (generate-new-buffer "*eww*"))
> + (unless (equal url (eww-current-url))
> + (eww-mode)
> + (eww (if (consp url) (car url) url)))))
> +
> +(defun eww-open-in-new-buffer (stay &optional url)
> + "Fetch URL in a new EWW buffer.
This changes the API of a public function in incompatible ways, which
we try very hard not to do. Instead, the signature or
eww-open-in-new-buffer should be like this:
(defun eww-open-in-new-buffer (&optional no-select)
and the new NO-SELECT argument should be set non-nil by C-u.
> + (user-error "No avaliable link")))
This also changes the text of the error message in this case. Was
that really necessary? The original text was more accurate, I think.
Also, this new feature needs a NEWS entry and a suitable addition to
the EWW manual.
Thanks.
This bug report was last modified 1 year and 270 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.