GNU bug report logs - #77016
[PATCH] Use region as suggested URI in eww by default

Previous Next

Package: emacs;

Reported by: Manuel Giraud <manuel <at> ledu-giraud.fr>

Date: Fri, 14 Mar 2025 17:14:02 UTC

Severity: wishlist

Tags: patch

To reply to this bug, email your comments to 77016 AT debbugs.gnu.org.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to larsi <at> gnus.org, bug-gnu-emacs <at> gnu.org:
bug#77016; Package emacs. (Fri, 14 Mar 2025 17:14:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Manuel Giraud <manuel <at> ledu-giraud.fr>:
New bug report received and forwarded. Copy sent to larsi <at> gnus.org, bug-gnu-emacs <at> gnu.org. (Fri, 14 Mar 2025 17:14:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Manuel Giraud <manuel <at> ledu-giraud.fr>
To: bug-gnu-emacs <at> gnu.org
Subject: [PATCH] Use region as suggested URI in eww by default
Date: Fri, 14 Mar 2025 18:13:18 +0100
[Message part 1 (text/plain, inline)]
Tags: patch

Hi,

Here is a patch for eww.  It adds the current region on top of the
suggested URI.  This way when reading a page in eww, one can select a
region and hit "M-RET" to open a new window (or tab) with a web search
for this selection.  WDYT?


In GNU Emacs 31.0.50 (build 38, x86_64-unknown-openbsd7.7, X toolkit) of
 2025-03-14 built on computer
Repository revision: 1437fc2bca2e42cd2a28754bbb4d9ac1403b87b7
Repository branch: master
Windowing system distributor 'The X.Org Foundation', version 11.0.12101016
System Description: OpenBSD computer 7.7 GENERIC.MP#593 amd64

Configured using:
 'configure CC=egcc CPPFLAGS=-I/usr/local/include
 LDFLAGS=-L/usr/local/lib MAKEINFO=gmakeinfo --prefix=/home/manuel/emacs
 --bindir=/home/manuel/bin --with-x-toolkit=lucid
 --with-toolkit-scroll-bars=no --without-cairo
 --without-compress-install'

[0001-Use-region-as-suggested-URI-in-eww-by-default.patch (text/patch, attachment)]
[Message part 3 (text/plain, inline)]
-- 
Manuel Giraud

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#77016; Package emacs. (Fri, 14 Mar 2025 19:05:02 GMT) Full text and rfc822 format available.

Message #8 received at 77016 <at> debbugs.gnu.org (full text, mbox):

From: Stefan Kangas <stefankangas <at> gmail.com>
To: Manuel Giraud <manuel <at> ledu-giraud.fr>, 77016 <at> debbugs.gnu.org
Cc: Lars Magne Ingebrigtsen <larsi <at> gnus.org>
Subject: Re: bug#77016: [PATCH] Use region as suggested URI in eww by default
Date: Fri, 14 Mar 2025 12:04:42 -0700
Manuel Giraud <manuel <at> ledu-giraud.fr> writes:

> Here is a patch for eww.  It adds the current region on top of the
> suggested URI.  This way when reading a page in eww, one can select a
> region and hit "M-RET" to open a new window (or tab) with a web search
> for this selection.  WDYT?

This is a change in behavior, and I can see that it would be useful to
some users.  However, there are many reasons why one would _not_ want
this behavior by default, and it feels risky to have this level of DWIM
by default.

I think it should be optional and/or behind a prompt.

This should be documented in NEWS.




Severity set to 'wishlist' from 'normal' Request was from Stefan Kangas <stefankangas <at> gmail.com> to control <at> debbugs.gnu.org. (Sat, 15 Mar 2025 12:03:03 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#77016; Package emacs. (Sat, 15 Mar 2025 14:56:02 GMT) Full text and rfc822 format available.

Message #13 received at 77016 <at> debbugs.gnu.org (full text, mbox):

From: Manuel Giraud <manuel <at> ledu-giraud.fr>
To: Stefan Kangas <stefankangas <at> gmail.com>
Cc: 77016 <at> debbugs.gnu.org, Lars Magne Ingebrigtsen <larsi <at> gnus.org>
Subject: Re: bug#77016: [PATCH] Use region as suggested URI in eww by default
Date: Sat, 15 Mar 2025 15:55:42 +0100
[Message part 1 (text/plain, inline)]
Stefan Kangas <stefankangas <at> gmail.com> writes:

> Manuel Giraud <manuel <at> ledu-giraud.fr> writes:
>
>> Here is a patch for eww.  It adds the current region on top of the
>> suggested URI.  This way when reading a page in eww, one can select a
>> region and hit "M-RET" to open a new window (or tab) with a web search
>> for this selection.  WDYT?
>
> This is a change in behavior, and I can see that it would be useful to
> some users.  However, there are many reasons why one would _not_ want
> this behavior by default, and it feels risky to have this level of DWIM
> by default.
>
> I think it should be optional and/or behind a prompt.
>
> This should be documented in NEWS.

Thanks for your review.  What about this new one?  I'm not quite sure
about the 'deactivate-mark' (and its place) but if I don't do this a
"wrong" region is active in the new "web search" buffer.

[0001-Use-region-as-suggested-URI-in-EWW.patch (text/x-patch, attachment)]
[Message part 3 (text/plain, inline)]
-- 
Manuel Giraud

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#77016; Package emacs. (Sat, 15 Mar 2025 18:42:02 GMT) Full text and rfc822 format available.

Message #16 received at 77016 <at> debbugs.gnu.org (full text, mbox):

From: Juri Linkov <juri <at> linkov.net>
To: Manuel Giraud <manuel <at> ledu-giraud.fr>
Cc: 77016 <at> debbugs.gnu.org, Stefan Kangas <stefankangas <at> gmail.com>
Subject: Re: bug#77016: [PATCH] Use region as suggested URI in eww by default
Date: Sat, 15 Mar 2025 20:33:34 +0200
> +(defcustom eww-dwim-region nil
> +  "When non-nil, the current region is used by `eww' as the default
> +suggested URI.  This allows to trigger a web search on the user
> +selection."
> +  :version "31.1"
> +  :group 'eww
> +  :type 'boolean)
> +
>  ;;;###autoload
>  (defcustom eww-suggest-uris
> -  '(eww-links-at-point
> +  '(eww-current-region
> +    eww-links-at-point
>      thing-at-point-url-at-point
>      eww-current-url
>      eww-bookmark-urls)

If we don't want to enable this by default then better to add
'eww-current-region' to :options of the existing user option
than to create a duplicating option.




This bug report was last modified 93 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.