unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Daniel Colascione <dancol@dancol.org>
To: Tassilo Horn <tsdh@gnu.org>
Cc: emacs-devel@gnu.org
Subject: Re: [PATCH] Make browser windows pop up when browsing URLs on Wayland
Date: Tue, 24 Dec 2024 01:39:37 -0500	[thread overview]
Message-ID: <E892C476-34BF-4AFB-9BF0-E8D24F8D1181@dancol.org> (raw)
In-Reply-To: <87y105ocjz.fsf@gnu.org>



On December 24, 2024 12:49:36 AM EST, Tassilo Horn <tsdh@gnu.org> wrote:
>Daniel Colascione <dancol@dancol.org> writes:
>
>Hi Daniel,
>
>> We really should consider simplifying the whole browse-url mechanism
>> by eliminating browse-url-default-browser and the distinction between
>> browse-url-handlers and browse-url-default-handlers.  Instead,
>> browse-url-handlers should have a simple list of predicated handlers
>> just like display-buffer-alist.
>
>The reason there's browse-url-default-handlers and browse-url-handlers
>is that the former is meant for Emacs itself and packages whereas the
>latter is meant for the user to customize.  IIRC, Stefan Monnier
>suggested that distinction back then when I added the handlers and I
>still don't see a better way.  If there was only the defcustom
>browse-url-handlers, either packages couldn't sensibly add to it or if
>they did, users wouldn't be sensibly able to override what packages
>added.  Or if a package added an entry which the user then saved, how
>would that be removed when the package was removed?
>
>That's different with display-buffer-alist which is nil by default and
>it's not expected that packages add rules to it.  In contrast, if I'd
>write a gemini client for emacs, it's quite obvious that I'd add an
>entry matching gemini:// urls with my hander to
>browse-url-default-handlers.
>
>Bye,
>Tassilo


You could say the same of hooks, yes? Or auto-mode-alist?

Customization could work by associating each entry with a priority --- 20, 50, 90, etc. --- and merging user-provided entries (and whiteouts to disable certain pre-existing entries) with package supplied entries. This way, we end up with a simple, single approach to finding the handler for a URL: go down the list in priority order (breaking ties arbitrarily) and use the first handler that says "yes, I handle this URL".




      reply	other threads:[~2024-12-24  6:39 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-12-23 19:23 [PATCH] Make browser windows pop up when browsing URLs on Wayland Daniel Colascione
2024-12-24  5:49 ` Tassilo Horn
2024-12-24  6:39   ` Daniel Colascione [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=E892C476-34BF-4AFB-9BF0-E8D24F8D1181@dancol.org \
    --to=dancol@dancol.org \
    --cc=emacs-devel@gnu.org \
    --cc=tsdh@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).