unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* Re: master 118e05f570 2/2: New user option browse-url-guess-default-scheme
@ 2022-07-10 16:21 Eli Zaretskii
  2022-07-10 16:33 ` Bob Rogers
  2022-07-10 16:59 ` Stefan Kangas
  0 siblings, 2 replies; 6+ messages in thread
From: Eli Zaretskii @ 2022-07-10 16:21 UTC (permalink / raw)
  To: Stefan Kangas; +Cc: emacs-devel

> +(defcustom browse-url-guess-default-scheme "http"
> +  "URL scheme to use when `browse-url' (and related commands) has to guess.
> +
> +For example, when point is on an URL fragment like
> +\"www.example.org\", `browse-url' will assume that this is an
> +\"http\" URL by default (i.e. \"http://www.example.org\").
> +
> +Note that if you set this to \"https\", websites that do not yet
> +support HTTPS may not load correctly in your web browser.  Such
> +websites are increasingly rare, but they do still exist."
> +  :type 'string
> +  :version "29.1")
> +
>  (defun browse-url-url-at-point ()
>    (or (thing-at-point 'url t)
>        ;; assume that the user is pointing at something like gnu.org/gnu
>        (let ((f (thing-at-point 'filename t)))
> -        (and f (concat "http://" f)))))
> +        (and f (concat browse-url-guess-default-scheme "://" f)))))

I think browse-url-guess-default-scheme is not the best name, given
how the value is used.  The "guess" part has no place there: it's just
the default protocol to use when browse-url is _unable_ to guess.  The
doc string is misleading for the same reason: it talks about "having
to guess", but there's no guessing here.  What actually happens is
that when a URL has no scheme, browse-url uses the value as the
default scheme.

So I think the option should be renamed browse-url-default-scheme, and
the doc string amended to not mention any guessing.

Thanks.



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: master 118e05f570 2/2: New user option browse-url-guess-default-scheme
  2022-07-10 16:21 master 118e05f570 2/2: New user option browse-url-guess-default-scheme Eli Zaretskii
@ 2022-07-10 16:33 ` Bob Rogers
  2022-07-10 16:59   ` Stefan Kangas
  2022-07-10 16:59 ` Stefan Kangas
  1 sibling, 1 reply; 6+ messages in thread
From: Bob Rogers @ 2022-07-10 16:33 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: Stefan Kangas, emacs-devel

   From: Eli Zaretskii <eliz@gnu.org>
   Date: Sun, 10 Jul 2022 19:21:08 +0300

   . . .

   I think browse-url-guess-default-scheme is not the best name, given
   how the value is used . . .

   So I think the option should be renamed browse-url-default-scheme, and
   the doc string amended to not mention any guessing.

   Thanks.

Seems to me we should push the guessing off onto the browser if
possible?

					-- Bob Rogers
					   http://www.rgrjr.com/



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: master 118e05f570 2/2: New user option browse-url-guess-default-scheme
  2022-07-10 16:21 master 118e05f570 2/2: New user option browse-url-guess-default-scheme Eli Zaretskii
  2022-07-10 16:33 ` Bob Rogers
@ 2022-07-10 16:59 ` Stefan Kangas
  1 sibling, 0 replies; 6+ messages in thread
From: Stefan Kangas @ 2022-07-10 16:59 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: emacs-devel

Eli Zaretskii <eliz@gnu.org> writes:

> So I think the option should be renamed browse-url-default-scheme, and
> the doc string amended to not mention any guessing.

Thanks, done.



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: master 118e05f570 2/2: New user option browse-url-guess-default-scheme
  2022-07-10 16:33 ` Bob Rogers
@ 2022-07-10 16:59   ` Stefan Kangas
  2022-07-10 17:40     ` Bob Rogers
  0 siblings, 1 reply; 6+ messages in thread
From: Stefan Kangas @ 2022-07-10 16:59 UTC (permalink / raw)
  To: Bob Rogers, Eli Zaretskii; +Cc: emacs-devel

Bob Rogers <rogers@rgrjr.com> writes:

> Seems to me we should push the guessing off onto the browser if
> possible?

What do you mean?



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: master 118e05f570 2/2: New user option browse-url-guess-default-scheme
  2022-07-10 16:59   ` Stefan Kangas
@ 2022-07-10 17:40     ` Bob Rogers
  2022-07-10 18:15       ` Stefan Kangas
  0 siblings, 1 reply; 6+ messages in thread
From: Bob Rogers @ 2022-07-10 17:40 UTC (permalink / raw)
  To: Stefan Kangas; +Cc: Eli Zaretskii, emacs-devel

   From: Stefan Kangas <stefankangas@gmail.com>
   Date: Sun, 10 Jul 2022 09:59:40 -0700

   Bob Rogers <rogers@rgrjr.com> writes:

   > Seems to me we should push the guessing off onto the browser if
   > possible?

   What do you mean?

I mean that if given just a domain, or even a partial domain, browsers
have gotten to be pretty smart about guessing which schemes to try,
e.g. preferring HTTPS over HTTP, and whether to prefix "www." or "ftp.",
etc.  Better if emacs doesn't try to duplicate that.

   On the other hand, anyone thinks there are security problems with
guessing at this point, perhaps it is better not to do anything with
partial URLs, and leave it up to the user.

					-- Bob



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: master 118e05f570 2/2: New user option browse-url-guess-default-scheme
  2022-07-10 17:40     ` Bob Rogers
@ 2022-07-10 18:15       ` Stefan Kangas
  0 siblings, 0 replies; 6+ messages in thread
From: Stefan Kangas @ 2022-07-10 18:15 UTC (permalink / raw)
  To: Bob Rogers; +Cc: Eli Zaretskii, emacs-devel

Bob Rogers <rogers@rgrjr.com> writes:

> I mean that if given just a domain, or even a partial domain, browsers
> have gotten to be pretty smart about guessing which schemes to try,
> e.g. preferring HTTPS over HTTP, and whether to prefix "www." or "ftp.",
> etc.  Better if emacs doesn't try to duplicate that.

Indeed.  It would be nice to have built-in support for something like
HTTPS Everywhere in EWW.  Until we have that, I guess there is still
some need for this new option (at least in my own use).

>    On the other hand, anyone thinks there are security problems with
> guessing at this point, perhaps it is better not to do anything with
> partial URLs, and leave it up to the user.

Yes, well this only provides a way to customize the default for
`browse-url' et al.  So it gives the user more choice than before (which
doesn't mean that we can't do even better, of course).



^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2022-07-10 18:15 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-07-10 16:21 master 118e05f570 2/2: New user option browse-url-guess-default-scheme Eli Zaretskii
2022-07-10 16:33 ` Bob Rogers
2022-07-10 16:59   ` Stefan Kangas
2022-07-10 17:40     ` Bob Rogers
2022-07-10 18:15       ` Stefan Kangas
2022-07-10 16:59 ` Stefan Kangas

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).