Subject: bug#65346: 30.0.50; *lisp/net/eww.el: new function 'eww-open-in-new-buffer-background'

From: Juri Linkov <[email-masked]>
Date: Sun, 20 Aug 2023 19:44:03 +0300

> +(defun eww-open-in-new-buffer (&optional no-select url)
> +  "Fetch URL in a new EWW buffer.
> +
> +If the NO-SELECT is not `nil', the forcus will stay on current buffer.
> +
> +If the URL is `nil', it will try `eww-suggested-uris' under current cursor."
> +  (interactive "P")
> +  (if-let ((url (or url (eww-suggested-uris))))
> +      (if (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)
> +            (eww--open-url-in-new-buffer url)
> +            (when no-select
> +              (tab-bar-switch-to-prev-tab)))

tab-bar-switch-to-prev-tab is a wrong function, please use
tab-bar-switch-to-recent-tab instead.

Also please add a new command to open a tab in background.
Then new command could be bound to the standard RET modifier
used in all web browsers to open a tab in background.