From unknown Mon Aug 11 18:15:30 2025 X-Loop: help-debbugs@gnu.org Subject: bug#34374: 27.0.50; Outside an eww buffer, optionally use new buffer when calling eww instead of reusing *eww* Resent-From: =?UTF-8?Q?G=C3=B6ktu=C4=9F?= Kayaalp Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 07 Feb 2019 21:27:03 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 34374 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: 34374@debbugs.gnu.org X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.154957478811560 (code B ref -1); Thu, 07 Feb 2019 21:27:03 +0000 Received: (at submit) by debbugs.gnu.org; 7 Feb 2019 21:26:28 +0000 Received: from localhost ([127.0.0.1]:38657 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1grrBj-00030L-SU for submit@debbugs.gnu.org; Thu, 07 Feb 2019 16:26:28 -0500 Received: from eggs.gnu.org ([209.51.188.92]:60956) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1grrBh-000308-P6 for submit@debbugs.gnu.org; Thu, 07 Feb 2019 16:26:26 -0500 Received: from lists.gnu.org ([209.51.188.17]:49244) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1grrBZ-0000R1-DG for submit@debbugs.gnu.org; Thu, 07 Feb 2019 16:26:18 -0500 Received: from eggs.gnu.org ([209.51.188.92]:47088) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1grrBX-0007d0-B1 for bug-gnu-emacs@gnu.org; Thu, 07 Feb 2019 16:26:17 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=0.1 required=5.0 tests=BAYES_50,RCVD_IN_DNSWL_LOW, URIBL_BLOCKED autolearn=disabled version=3.3.2 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1grrBR-0000Io-Vn for bug-gnu-emacs@gnu.org; Thu, 07 Feb 2019 16:26:13 -0500 Received: from relay6-d.mail.gandi.net ([217.70.183.198]:60629) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1grrBR-0000Ho-5i for bug-gnu-emacs@gnu.org; Thu, 07 Feb 2019 16:26:09 -0500 X-Originating-IP: 176.218.86.160 Received: from localhost (unknown [176.218.86.160]) (Authenticated sender: self@gkayaalp.com) by relay6-d.mail.gandi.net (Postfix) with ESMTPSA id A7772C0005 for ; Thu, 7 Feb 2019 21:26:03 +0000 (UTC) From: =?UTF-8?Q?G=C3=B6ktu=C4=9F?= Kayaalp Date: Fri, 08 Feb 2019 00:19:36 +0300 Message-ID: MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 217.70.183.198 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Eww should support conveniently avoiding using the same buffer even when not in an eww buffer (M-x eww or browse-url). Currently, in an eww buffer, =E2=80=98eww-open-in-new-buffer=E2=80=99 opens the link under point= in a new buffer, and =E2=80=98eww=E2=80=99 reuses the buffer. When running =E2=80= =98eww=E2=80=99 outside an eww buffer, it reuses the =E2=80=98*eww*=E2=80=99 buffer. Attached is a patch = where by default this behaviour is retained, but when a new custom, =E2=80=98eww-reuse-buffer=E2=80=99 is truthy (defaults to nil), Eww uses a = new buffer (obtained via =E2=80=98generate-new-buffer=E2=80=99) instead, unless the cu= rrent buffer is an eww buffer. The navigation behaviour in eww buffers is retained. I have manually tested the general use of EWW with this patch applied. But I haven=E2=80=99t found a test suite for EWW; if I missed it, I can run= it, or any other suggested testing. In case the patch is good enough to apply as it is, I have my copyright stuff sorted already. All the best, -gk. In GNU Emacs 27.0.50 (build 1, x86_64-pc-linux-gnu, X toolkit, Xaw3d scroll= bars) of 2019-02-04 built on alpha Repository revision: ef17247fe9cab2d59e470daad24314c868248b0a Repository branch: master Windowing system distributor 'The X.Org Foundation', version 11.0.12003000 System Description: Debian GNU/Linux buster/sid Recent messages: Mark set [3 times] Mark saved where search started Mark set Auto-saving...done eww-reuse-buffer Quit [5 times] eww-reuse-buffer Saving file /home/g/co/External/emacs/lisp/net/eww.el... Wrote /home/g/co/External/emacs/lisp/net/eww.el Finding changes in /home/g/co/External/emacs/lisp/net/eww.el...done Quit Configured using: 'configure --prefix=3D/home/g/local/emacs --with-x-toolkit=3Dathena --with-imagemagick --with-modules --with-file-notification=3Dyes --with-gameuser=3Dno --with-mailutils' Configured features: XAW3D XPM JPEG TIFF GIF PNG RSVG IMAGEMAGICK SOUND GPM DBUS GSETTINGS GLIB NOTIFY INOTIFY ACL LIBSELINUX GNUTLS LIBXML2 FREETYPE M17N_FLT LIBOTF XFT ZLIB TOOLKIT_SCROLL_BARS LUCID X11 XDBE XIM MODULES THREADS LIBSYSTEMD JSON PDUMPER LCMS2 GMP Important settings: value of $LC_MONETARY: tr_TR.UTF-8 value of $LC_TIME: tr_TR.UTF-8 value of $LANG: en_GB.UTF-8 locale-coding-system: utf-8-unix Major mode: Diff Minor modes in effect: auto-image-file-mode: t show-paren-mode: t gk-ucins-entry-mode: t global-gk-minor-mode: t gk-minor-mode: t yas-global-mode: t yas-minor-mode: t winner-mode: t global-whitespace-mode: t whitespace-mode: t which-key-mode: t save-place-mode: t persistent-scratch-autosave-mode: t global-paren-face-mode: t magit-todos-mode: t global-magit-file-mode: t url-handler-mode: t diff-auto-refine-mode: t global-git-commit-mode: t shell-dirtrack-mode: t eval-sexp-fu-flash-mode: t auto-insert-mode: t tooltip-mode: t global-eldoc-mode: t electric-quote-mode: t mouse-wheel-mode: t menu-bar-mode: t file-name-shadow-mode: t global-font-lock-mode: t font-lock-mode: t blink-cursor-mode: t auto-composition-mode: t auto-encryption-mode: t auto-compression-mode: t buffer-read-only: t line-number-mode: t transient-mark-mode: t Load-path shadows: None found. Features: (shadow mailalias mail-extr emacsbug dired-aux misearch multi-isearch dabbrev eieio-opt speedbar sb-image ezimage dframe help-fns radix-tree network-stream url-cache vc-filewise sh-script executable vc-git org-rmail org-mhe org-irc org-info org-gnus nnir org-docview org-bibtex bibtex org-bbdb org-w3m term disp-table ehelp image-file paren init gk-feeds man emms-librefm-stream emms-librefm-scrobbler emms-playlist-limit emms-volume emms-volume-amixer emms-i18n emms-history emms-score emms-stream-info emms-metaplaylist-mode emms-bookmarks emms-cue emms-mode-line-icon emms-browser sort emms-playlist-sort emms-last-played emms-player-xine emms-player-mpd emms-playing-time emms-lyrics emms-url emms-streams emms-show-all emms-tag-editor emms-mark emms-mode-line emms-cache emms-info-opusinfo emms-info-ogginfo emms-info-mp3info emms-info later-do emms-playlist-mode emms-player-vlc emms-player-mpv emms-player-mplayer emms-player-simple emms-source-playlist emms-source-file locate ob-python ob-shell warnings ibuf-macs yasnippet elec-pair zencoding-mode winner whole-line-or-region whitespace which-key wdired vc-rcs vc-cvs vc vc-dispatcher tramp-cache tls gnutls time thinks spam spam-stat gnus-uu yenc gnus-msg gnus-art mm-uu mml2015 mm-view mml-smime smime dig solarized color smtpmail sendmail scheme saveplace rmailsum python-django tree-widget sql view python tramp-sh tramp tramp-loaddefs trampver tramp-compat hippie-exp pixel-scroll persistent-scratch perl-mode pdf-tools pdf-sync pdf-outline pdf-links pdf-isearch pdf-misc pdf-view pdf-cache pdf-util pass-listing password-store paren-face paredit ox-org ox-hugo ox-blackfriday ox-md ox-groff ox-beamer ox-odt rng-loc rng-uri rng-parse rng-match rng-dt rng-util rng-pttrn nxml-parse nxml-ns nxml-enc xmltok nxml-util ox-latex ox-icalendar ox-html table ox-ascii ox-publish ox org-variable-pitch org-protocol org-mobile org-agenda org-inlinetask org-eww org-checklist org-capture olivetti nnfolder multiple-cursors mc-hide-unmatched-lines-mode mc-separate-operations rectangular-region-mode mc-mark-pop mc-mark-more mc-cycle-cursors mc-edit-lines multiple-cursors-core mastodon mairix cus-edit cus-start cus-load magit-todos pcre2el rxt pcase re-builder hl-todo async grep magit-bookmark magit-imenu git-rebase magit-extras magit-ediff ediff-merg ediff-wind ediff-diff ediff-mult ediff-help ediff-init ediff-util ediff magit-subtree magit-submodule magit-obsolete magit-blame magit-stash magit-bisect magit-remote magit-commit magit-sequence magit-notes magit-worktree magit-tag magit-merge magit-branch magit-reset magit-collab ghub url-http url-gw nsm url-auth let-alist magit-files magit-refs magit-status magit package url-handlers magit-repos magit-apply magit-wip magit-log magit-diff smerge-mode diff-mode magit-core magit-autorevert autorevert filenotify magit-process magit-margin magit-mode ls-lisp lua-mode lorem-ipsum js sgml-mode inf-ruby ruby-mode smie inf-lisp imenu image-dired ido ibuffer-vc ibuf-ext ibuffer ibuffer-loaddefs hl-line highlight-parentheses goto-last-change gnus-sum gnus-group gnus-undo gnus-start gnus-cloud nnimap nnmail mail-source utf7 netrc nnoo parse-time gnus-spec gnus-int gnus-range gnus-win gk-unilat gk-greek quail git-commit with-editor cl-extra server magit-git magit-section magit-utils magit-popup log-edit pcvs-util add-log forecast subr-x org-element org org-macro org-footnote org-pcomplete org-list org-faces org-entities noutline outline easy-mmode org-version ob-emacs-lisp ob ob-tangle org-src ob-ref ob-lob ob-table ob-keys ob-exp ob-comint ob-core ob-eval org-compat org-macs org-loaddefs solar cal-dst ffap face-remap f eww mm-url gnus nnheader evil evil-keybindings evil-integration evil-maps evil-commands reveal flyspell ispell evil-jumps evil-command-window evil-types evil-search evil-ex shell pcomplete evil-macros evil-repeat evil-states evil-core evil-common windmove evil-digraphs evil-vars edmacro kmacro eval-sexp-fu rx highlight etags multifile xref project epa-mail emms-setup emms emms-compat elfeed-show elfeed-search wid-edit message rmc format-spec rfc822 mml mml-sec epa epg epg-config gnus-util rmail rmail-loaddefs mm-decode mm-bodies mm-encode mail-parse rfc2231 rfc2047 rfc2045 mm-util ietf-drums mail-prsvr mail-utils gmm-utils mailheader shr text-property-search puny svg dom elfeed-csv elfeed elfeed-curl url url-proxy url-privacy url-expand url-methods url-history url-cookie url-domsuf mailcap elfeed-log elfeed-db elfeed-lib url-util time-date avl-tree generator url-queue url-parse url-vars xml-query xml eimp dollar doc-view jka-compr image-mode dired-x dired-subtree dired-narrow delsel dired-hacks-utils dired dired-loaddefs diminish diff desktop frameset debug backtrace find-func dart-mode s ucs-normalize help-mode dash copyright compile comint ring cc-mode cc-fonts cc-guess cc-menus cc-cmds cc-styles cc-align cc-engine cc-vars cc-defs cal-menu calendar cal-loaddefs browse-url boxquote rect bookmark pp bibliothek derived goto-addr thingatpt pdf-info tq a bbdb-vcard bbdb-com crm mailabbrev vcard bbdb easymenu bbdb-site timezone autoinsert auth-source eieio eieio-core cl-macs eieio-loaddefs password-cache json map seq byte-opt bytecomp byte-compile cconv apropos ansi-color ace-jump-mode advice cl gv cl-seq cl-loaddefs cl-lib mule-util tooltip eldoc electric uniquify ediff-hook vc-hooks lisp-float-type mwheel term/x-win x-win term/common-win x-dnd tool-bar dnd fontset image regexp-opt fringe tabulated-list replace newcomment text-mode elisp-mode lisp-mode prog-mode register page menu-bar rfn-eshadow isearch timer select scroll-bar mouse jit-lock font-lock syntax facemenu font-core term/tty-colors frame cl-generic cham georgian utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao korean japanese eucjp-ms cp51932 hebrew greek romanian slovak czech european ethiopic indian cyrillic chinese composite charscript charprop case-table epa-hook jka-cmpr-hook help simple abbrev obarray minibuffer cl-preloaded nadvice loaddefs button faces cus-face macroexp files text-properties overlay sha1 md5 base64 format env code-pages mule custom widget hashtable-print-readable backquote threads dbusbind inotify lcms2 dynamic-setting system-font-setting font-render-setting x-toolkit x multi-tty make-network-process emacs) Memory information: ((conses 16 1132574 122251) (symbols 48 54836 160) (strings 32 248082 22021) (string-bytes 1 17577942) (vectors 16 107140) (vector-slots 8 1980171 171906) (floats 8 1038 502) (intervals 56 61571 2996) (buffers 992 40)) --=-=-= Content-Type: text/x-diff; charset=utf-8 Content-Disposition: inline; filename=0001-Support-not-reusing-eww-buffer-when-navigating-from-.patch Content-Transfer-Encoding: quoted-printable Content-Description: the patch >From dd47aa509a7f7d7548e4c048e42e7dc32a12fbe9 Mon Sep 17 00:00:00 2001 From: =3D?UTF-8?q?=3DC4=3DB0=3D2E=3D20G=3DC3=3DB6ktu=3DC4=3D9F=3D20Kayaalp?= =3D Date: Thu, 7 Feb 2019 14:33:08 +0300 Subject: [PATCH] Support not reusing *eww* buffer when navigating from a non-eww one MIME-Version: 1.0 Content-Type: text/plain; charset=3DUTF-8 Content-Transfer-Encoding: 8bit * lisp/net/eww.el (eww-reuse-buffer): New defcustom. * lisp/net/eww.el (eww): Use the above to decide whether to use =E2=80=98get-buffer-create=E2=80=99 or =E2=80=98generate-new-buffer=E2=80= =99. * doc/misc/eww.texi (Basics): * etc/NEWS: Document the new feature. --- doc/misc/eww.texi | 8 +++++++- etc/NEWS | 6 ++++++ lisp/net/eww.el | 17 +++++++++++++++-- 3 files changed, 28 insertions(+), 3 deletions(-) diff --git a/doc/misc/eww.texi b/doc/misc/eww.texi index b299ea1fb7..cc96909ab3 100644 --- a/doc/misc/eww.texi +++ b/doc/misc/eww.texi @@ -98,10 +98,16 @@ Basics (@code{eww-copy-page-url}) will copy the current URL to the kill ring. =20 @findex eww-open-in-new-buffer +@vindex eww-reuse-buffer @kindex M-RET The @kbd{M-@key{RET}} command (@code{eww-open-in-new-buffer}) opens the URL at point in a new EWW buffer, akin to opening a link in a new -``tab'' in other browsers. +``tab'' in other browsers. If you want this same behavior when +following links or running @code{eww} in a buffer that is not in +@code{eww-mode}, set @code{eww-reuse-buffer} to @code{nil}. Normal +navigation within an @code{eww-mode} buffer will not be affected, but +running @kbd{M-x eww} or following a URI with @code{browse-url} family +of functions will result in new eww buffers. =20 @findex eww-readable @kindex R diff --git a/etc/NEWS b/etc/NEWS index 72a6b385a8..5dc4c8b8b2 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -652,6 +652,12 @@ has been executed. If set, shr will not render tags with attribute 'aria-hidden=3D"true"'. This attribute is meant to tell screen readers to ignore a tag. =20 ++++ +*** New option 'eww-reuse-buffer'. +If set (default), eww will reuse the "*eww*" buffer when called from a +non-eww buffer. If not, it will generate a new buffer and use it +instead. + ** Htmlfontify =20 *** The functions 'hfy-color', 'hfy-color-vals' and diff --git a/lisp/net/eww.el b/lisp/net/eww.el index 3b7d9d5c2f..2ac4c606de 100644 --- a/lisp/net/eww.el +++ b/lisp/net/eww.el @@ -153,6 +153,12 @@ eww-form-checkbox-symbol (const "=E2=98=90") ; Unicode BALLOT BOX string)) =20 +(defcustom eww-reuse-buffer t + "Reuse the *eww* buffer when not in an `eww-mode' buffer." + :version "27.1" + :group 'eww + :type 'boolean) + (defface eww-form-submit '((((type x w32 ns) (class color)) ; Like default mode line :box (:line-width 2 :style released-button) @@ -250,7 +256,12 @@ eww-suggested-uris (defun eww (url) "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'. + +When the current buffer is not in `eww-mode', if +`eww-reuse-buffer' is non-nil, the *eww* buffer will be reused if +available, otherwise generated; if set to nil instead, a new +buffer will be used in case *eww* is already in use." (interactive (let* ((uris (eww-suggested-uris)) (prompt (concat "Enter URL or keywords" @@ -261,7 +272,9 @@ eww (pop-to-buffer-same-window (if (eq major-mode 'eww-mode) (current-buffer) - (get-buffer-create "*eww*"))) + (funcall + (if eww-reuse-buffer #'get-buffer-create #'generate-new-buffer) + "*eww*"))) (eww-setup-buffer) ;; Check whether the domain only uses "Highly Restricted" Unicode ;; IDNA characters. If not, transform to punycode to indicate that --=20 2.20.1 --=-=-=-- From unknown Mon Aug 11 18:15:30 2025 X-Loop: help-debbugs@gnu.org Subject: bug#34374: 27.0.50; Outside an eww buffer, optionally use new buffer when calling eww instead of reusing *eww* Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 08 Feb 2019 06:53:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 34374 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch To: =?UTF-8?Q?G=C3=B6ktu=C4=9F?= Kayaalp Cc: 34374@debbugs.gnu.org Received: via spool by 34374-submit@debbugs.gnu.org id=B34374.15496087598533 (code B ref 34374); Fri, 08 Feb 2019 06:53:02 +0000 Received: (at 34374) by debbugs.gnu.org; 8 Feb 2019 06:52:39 +0000 Received: from localhost ([127.0.0.1]:38823 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gs01e-0002DY-MN for submit@debbugs.gnu.org; Fri, 08 Feb 2019 01:52:38 -0500 Received: from eggs.gnu.org ([209.51.188.92]:33448) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gs01d-0002DL-9n for 34374@debbugs.gnu.org; Fri, 08 Feb 2019 01:52:37 -0500 Received: from fencepost.gnu.org ([2001:470:142:3::e]:40187) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gs01X-0007o5-C0; Fri, 08 Feb 2019 01:52:31 -0500 Received: from [176.228.60.248] (port=3437 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1gs01X-0000im-08; Fri, 08 Feb 2019 01:52:31 -0500 Date: Fri, 08 Feb 2019 08:52:28 +0200 Message-Id: <83lg2qrcur.fsf@gnu.org> From: Eli Zaretskii In-reply-to: (message from =?UTF-8?Q?G=C3=B6ktu=C4=9F?= Kayaalp on Fri, 08 Feb 2019 00:19:36 +0300) References: MIME-version: 1.0 Content-type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) > From: Göktuğ Kayaalp > Date: Fri, 08 Feb 2019 00:19:36 +0300 > > Eww should support conveniently avoiding using the same buffer even when > not in an eww buffer (M-x eww or browse-url). Currently, in an eww > buffer, ‘eww-open-in-new-buffer’ opens the link under point in a new > buffer, and ‘eww’ reuses the buffer. When running ‘eww’ outside an eww > buffer, it reuses the ‘*eww*’ buffer. Attached is a patch where by > default this behaviour is retained, but when a new custom, > ‘eww-reuse-buffer’ is truthy (defaults to nil), Eww uses a new buffer > (obtained via ‘generate-new-buffer’) instead, unless the current buffer > is an eww buffer. The navigation behaviour in eww buffers is retained. Wouldn't it be more convenient if you could invoke eww with a prefix argument for that? > I have manually tested the general use of EWW with this patch applied. > But I haven’t found a test suite for EWW; if I missed it, I can run it, > or any other suggested testing. You could start a test suite, although testing eww should ideally work even if no network connection is available. > Subject: [PATCH] Support not reusing *eww* buffer when navigating from a > non-eww one It is best to reword this header line to be positive instead of negative. > +(defcustom eww-reuse-buffer t > + "Reuse the *eww* buffer when not in an `eww-mode' buffer." For a boolean option, the first line of the doc string should say either Non-nil means reuse the *eww* buffer ... or Whether to reuse the *eww* buffer ... (the former is preferable). > +When the current buffer is not in `eww-mode', if > +`eww-reuse-buffer' is non-nil, the *eww* buffer will be reused if > +available, otherwise generated; if set to nil instead, a new > +buffer will be used in case *eww* is already in use." Once this feature exists and is used, wouldn't it be better to program it so it either reuses the current EWW buffer or creates a new one, regardless of whether the current buffer's name is "*eww*"? IOW, should we really hardcode "*eww*" in this feature? > - (get-buffer-create "*eww*"))) > + (funcall > + (if eww-reuse-buffer #'get-buffer-create #'generate-new-buffer) > + "*eww*"))) Any particular reason to use funcall here, instead of calling the functions literally? Thanks. From unknown Mon Aug 11 18:15:30 2025 X-Loop: help-debbugs@gnu.org Subject: bug#34374: 27.0.50; Outside an eww buffer, optionally use new buffer when calling eww instead of reusing *eww* References: Resent-From: =?UTF-8?Q?G=C3=B6ktu=C4=9F?= Kayaalp Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 09 Feb 2019 15:33:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 34374 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch To: Eli Zaretskii Cc: 34374@debbugs.gnu.org Received: via spool by 34374-submit@debbugs.gnu.org id=B34374.154972633516793 (code B ref 34374); Sat, 09 Feb 2019 15:33:02 +0000 Received: (at 34374) by debbugs.gnu.org; 9 Feb 2019 15:32:15 +0000 Received: from localhost ([127.0.0.1]:41435 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gsUc3-0004Mn-2y for submit@debbugs.gnu.org; Sat, 09 Feb 2019 10:32:15 -0500 Received: from relay6-d.mail.gandi.net ([217.70.183.198]:34385) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gsUbz-0004Mc-KW for 34374@debbugs.gnu.org; Sat, 09 Feb 2019 10:32:12 -0500 X-Originating-IP: 176.218.86.160 Received: from localhost (unknown [176.218.86.160]) (Authenticated sender: self@gkayaalp.com) by relay6-d.mail.gandi.net (Postfix) with ESMTPSA id AE4CEC0004; Sat, 9 Feb 2019 15:32:07 +0000 (UTC) From: =?UTF-8?Q?G=C3=B6ktu=C4=9F?= Kayaalp In-Reply-To: <83lg2qrcur.fsf@gnu.org> (message from Eli Zaretskii on Fri, 08 Feb 2019 08:52:28 +0200) Date: Sat, 09 Feb 2019 18:04:12 +0300 Message-ID: MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Spam-Score: -0.7 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 2019-02-08 08:52 +02, Eli Zaretskii wrote: > Wouldn't it be more convenient if you could invoke eww with a prefix > argument for that? Sure, appended a patch, can add docs and news modifications to it if you like it better. >> I have manually tested the general use of EWW with this patch applied. >> But I haven=E2=80=99t found a test suite for EWW; if I missed it, I can = run it, >> or any other suggested testing. > > You could start a test suite, although testing eww should ideally work > even if no network connection is available. I can try to come up with tests for the feature I=E2=80=99m adding. EWW wo= rks with file:// links, so generating a few temporary files and working with them should work alright. I=E2=80=99m not familiar enough with Emacs TDD a= nd EWW to try add something more comprehensive though. >> Subject: [PATCH] Support not reusing *eww* buffer when navigating from a >> non-eww one > > It is best to reword this header line to be positive instead of > negative. > >> +(defcustom eww-reuse-buffer t >> + "Reuse the *eww* buffer when not in an `eww-mode' buffer." > > For a boolean option, the first line of the doc string should say > either > > Non-nil means reuse the *eww* buffer ... > > or > > Whether to reuse the *eww* buffer ... > > (the former is preferable). I can apply these to the old patch if you think that approach is better than the one in the new patch (using a prefix arg), which doesn=E2=80=99t h= ave these problems. >> +When the current buffer is not in `eww-mode', if >> +`eww-reuse-buffer' is non-nil, the *eww* buffer will be reused if >> +available, otherwise generated; if set to nil instead, a new >> +buffer will be used in case *eww* is already in use." > > Once this feature exists and is used, wouldn't it be better to program > it so it either reuses the current EWW buffer or creates a new one, > regardless of whether the current buffer's name is "*eww*"? IOW, > should we really hardcode "*eww*" in this feature? Sure. The literal "*eww*" appears only in two places, and could be replaced with a defcustom and/or an extra arg to =E2=80=98eww=E2=80=99. I don=E2=80=99t think it depends on the name of the current buffer as it is, e.g. M-x eww ... RET M-x rename-buffer somebuf RET C-u M-x eww ... RET does work, resulting in buffers *eww*, somebuf, *eww*<2>, and =E2=80=98eww-list-buffers=E2=80=99 can show a user-friendly list of buffers= . Do you mean this scenario should result in somebuf<2> instead of *eww*<2>? I think that=E2=80=99d be confusing when calling M-x eww from some non-eww bu= ffer, I=E2=80=99d rather have new names be based on the default buffer name. >> - (get-buffer-create "*eww*"))) >> + (funcall >> + (if eww-reuse-buffer #'get-buffer-create #'generate-new-buffer) >> + "*eww*"))) > > Any particular reason to use funcall here, instead of calling the > functions literally? Just to not repeat the string literal. Could definitely be replaced with a let binding. --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=0001-lisp-net-eww.el-eww-With-prefix-arg-open-url-in-new-.patch >From b498bf557558fb0564cb35dc663378ead5076afd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C4=B0=2E=20G=C3=B6ktu=C4=9F=20Kayaalp?= Date: Sat, 9 Feb 2019 17:41:31 +0300 Subject: [PATCH] * lisp/net/eww.el (eww): With prefix arg, open url in new buffer --- 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 3b7d9d5c2f..65a75f8212 100644 --- a/lisp/net/eww.el +++ b/lisp/net/eww.el @@ -247,21 +247,29 @@ eww-suggested-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 -- 2.20.1 --=-=-=-- From unknown Mon Aug 11 18:15:30 2025 X-Loop: help-debbugs@gnu.org Subject: bug#34374: 27.0.50; Outside an eww buffer, optionally use new buffer when calling eww instead of reusing *eww* Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 15 Feb 2019 08:36:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 34374 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch To: =?UTF-8?Q?G=C3=B6ktu=C4=9F?= Kayaalp Cc: 34374@debbugs.gnu.org Received: via spool by 34374-submit@debbugs.gnu.org id=B34374.155021974020037 (code B ref 34374); Fri, 15 Feb 2019 08:36:02 +0000 Received: (at 34374) by debbugs.gnu.org; 15 Feb 2019 08:35:40 +0000 Received: from localhost ([127.0.0.1]:48560 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1guYyB-0005D7-UB for submit@debbugs.gnu.org; Fri, 15 Feb 2019 03:35:40 -0500 Received: from eggs.gnu.org ([209.51.188.92]:47322) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1guYy9-0005Cu-RR for 34374@debbugs.gnu.org; Fri, 15 Feb 2019 03:35:38 -0500 Received: from fencepost.gnu.org ([2001:470:142:3::e]:56707) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1guYxu-0004OT-EP; Fri, 15 Feb 2019 03:35:25 -0500 Received: from [176.228.60.248] (port=3816 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1guYxq-0008Nc-QU; Fri, 15 Feb 2019 03:35:22 -0500 Date: Fri, 15 Feb 2019 10:35:15 +0200 Message-Id: <835ztlo3ek.fsf@gnu.org> From: Eli Zaretskii In-reply-to: (message from =?UTF-8?Q?G=C3=B6ktu=C4=9F?= Kayaalp on Sat, 09 Feb 2019 18:04:12 +0300) References: MIME-version: 1.0 Content-type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) > From: Göktuğ Kayaalp > Cc: 34374@debbugs.gnu.org > Date: Sat, 09 Feb 2019 18:04:12 +0300 > > On 2019-02-08 08:52 +02, Eli Zaretskii wrote: > > Wouldn't it be more convenient if you could invoke eww with a prefix > > argument for that? > > Sure, appended a patch, can add docs and news modifications to it if you > like it better. Thanks, I pushed it to the master branch. In the future, please consider accompanying your changes with suitable changes to the documentation (manuals and NEWS). I did that for this change. From unknown Mon Aug 11 18:15:30 2025 X-Loop: help-debbugs@gnu.org Subject: bug#34374: 27.0.50; Outside an eww buffer, optionally use new buffer when calling eww instead of reusing *eww* References: Resent-From: =?UTF-8?Q?G=C3=B6ktu=C4=9F?= Kayaalp Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 16 Feb 2019 10:23:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 34374 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch To: Eli Zaretskii Cc: 34374@debbugs.gnu.org Received: via spool by 34374-submit@debbugs.gnu.org id=B34374.155031257327593 (code B ref 34374); Sat, 16 Feb 2019 10:23:02 +0000 Received: (at 34374) by debbugs.gnu.org; 16 Feb 2019 10:22:53 +0000 Received: from localhost ([127.0.0.1]:50011 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gux7U-0007Az-KN for submit@debbugs.gnu.org; Sat, 16 Feb 2019 05:22:52 -0500 Received: from relay2-d.mail.gandi.net ([217.70.183.194]:60865) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gux7R-0007Ap-Kx for 34374@debbugs.gnu.org; Sat, 16 Feb 2019 05:22:50 -0500 X-Originating-IP: 46.2.228.126 Received: from localhost (unknown [46.2.228.126]) (Authenticated sender: self@gkayaalp.com) by relay2-d.mail.gandi.net (Postfix) with ESMTPSA id C828740004; Sat, 16 Feb 2019 10:22:45 +0000 (UTC) From: =?UTF-8?Q?G=C3=B6ktu=C4=9F?= Kayaalp In-Reply-To: <835ztlo3ek.fsf@gnu.org> (message from Eli Zaretskii on Fri, 15 Feb 2019 10:35:15 +0200) Date: Sat, 16 Feb 2019 12:45:09 +0300 Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -0.7 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) On 2019-02-15 10:35 +02, Eli Zaretskii wrote: > Thanks, I pushed it to the master branch. Thanks, and you=E2=80=99re welcome! > In the future, please consider accompanying your changes with suitable > changes to the documentation (manuals and NEWS). I did that for this > change. I am sorry, I intended to write them after the patch was deemed appropriate. Thanks a lot for filling them in for me. From debbugs-submit-bounces@debbugs.gnu.org Tue Apr 09 20:24:53 2019 Received: (at control) by debbugs.gnu.org; 10 Apr 2019 00:24:54 +0000 Received: from localhost ([127.0.0.1]:52192 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hE12r-0001SV-NI for submit@debbugs.gnu.org; Tue, 09 Apr 2019 20:24:53 -0400 Received: from mail-qt1-f176.google.com ([209.85.160.176]:37417) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hE12p-0001SE-T6; Tue, 09 Apr 2019 20:24:52 -0400 Received: by mail-qt1-f176.google.com with SMTP id z16so900232qtn.4; Tue, 09 Apr 2019 17:24:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:references:date:in-reply-to:message-id:user-agent :mime-version; bh=FvV9xbhHt+X3GtEfQJ67CyoQd2H250YqLVws+QJ+py8=; b=ol6ucZZaJIxJUIdNu0riYqQlfyD7HS+G47RC1ajfSg8EprA6kwcxXlgzCiPpu1yPId hCQbROUNz1lH7ASB6I4toUEUP9NZCjv54G0lm2OKQhfDk3ZUWeCy/JOMfn4oeUZDotYZ ETwQ2saljlKEJvzwdfntTMFZK+M1WdCaeFUiXkMJ6PZOJ1y4UVCyYwE98UHc5SLRj7Rj UZWOG2ZhC0mt4+uLpme7F9/55wHLlb94UoigkkXgCi9qB2OcZ7jT9WnOj++V0AukGRmg urO+c1JJ3hHikX6DuNwBhlszEOUCYC3opfiO5xrK5AFng4Mg9WgvkOhOgZgrdVWI1ybq FiaQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:references:date:in-reply-to :message-id:user-agent:mime-version; bh=FvV9xbhHt+X3GtEfQJ67CyoQd2H250YqLVws+QJ+py8=; b=PemM/X4/DSbtWyVjMi1jjNgeTMTRvDUa6mOQHjN4w6J7qbsnPDTNr4SlzXYCNBo7CN gpcw1/QSWNHxShCt/bLJ0BQ6ZBEjiZfJztEYOgxSluFgI+zV3uHos5Eih3xt9bzvG9wV xdQ2dKULJrCUdGsx5H+pKwmUyieRPo20icaeQfb5zBye6LC9X32GDugkk2SCr8HunNue L8/lgzyuqgGmPXxmbqS64CJpY4dAKSKOdPbcBSGWVVQp8u6iccvme4818Lt9ZJNTky5o yB8GnBo32Uh9/17TfGP5sGJAdePKZiLguHeOItNNmoQBQzgTsVXFuwLFZG/13xqFs2/Y op+Q== X-Gm-Message-State: APjAAAXuMAuzfKiEDa8ZZpUEERGcoSNWlFDFuA5Opzj8YWtC9VOfCHRt AmE5hzUjWSfjkvhs4XJkcSARL0id X-Google-Smtp-Source: APXvYqwnMtA7Zms6rdYReQO2fV0N1jvHzO7PJ8f6kt6g9yJe+rBnrqNk/3EpY1eSFja9suolv8ANJg== X-Received: by 2002:a0c:89a3:: with SMTP id 32mr32328563qvr.116.1554855886167; Tue, 09 Apr 2019 17:24:46 -0700 (PDT) Received: from minid (cbl-45-2-119-34.yyz.frontiernetworks.ca. [45.2.119.34]) by smtp.googlemail.com with ESMTPSA id s66sm14713606qkd.90.2019.04.09.17.24.44 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 09 Apr 2019 17:24:45 -0700 (PDT) From: Noam Postavsky To: 34374-quiet@debbugs.gnu.org Subject: Re: bug#34374: 27.0.50; Outside an eww buffer, optionally use new buffer when calling eww instead of reusing *eww* References: <835ztlo3ek.fsf@gnu.org> Date: Tue, 09 Apr 2019 20:24:44 -0400 In-Reply-To: <835ztlo3ek.fsf@gnu.org> (Eli Zaretskii's message of "Fri, 15 Feb 2019 10:35:15 +0200") Message-ID: <877ec2btbn.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1.91 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: control X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) tags 34374 fixed close 34374 27.1 quit Eli Zaretskii writes: > Thanks, I pushed it to the master branch. > > In the future, please consider accompanying your changes with suitable > changes to the documentation (manuals and NEWS). I did that for this > change. b439b4393c 2019-02-15T10:33:01+02:00 "Add documentation for last change in eww.el" 3fa003a134 2019-02-15T10:24:14+02:00 "* lisp/net/eww.el (eww): With prefix arg, open url in new buffer."