all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Tassilo Horn <tsdh@gnu.org>
To: Stefan Monnier <monnier@iro.umontreal.ca>
Cc: emacs-devel@gnu.org
Subject: Re: bug-reference.el: Allow custom handlers for opening URLs
Date: Tue, 05 May 2020 09:06:34 +0200	[thread overview]
Message-ID: <87wo5qg8sl.fsf@gnu.org> (raw)
In-Reply-To: <jwveerz7cyj.fsf-monnier+emacs@gnu.org> (Stefan Monnier's message of "Mon, 04 May 2020 14:54:56 -0400")

Stefan Monnier <monnier@iro.umontreal.ca> writes:

>> So you mean we need to have a `browse-url-handlers' defcustom and a
>> `browse-url-handlers-default' defvar?  Maybe you are right.  On the
>> other hand, we haven't something like that for similar candidates
>> like `auto-mode-alist', too.  There, we use the "if you don't like
>> it, remove it yourself" approach.
>
> Good point.  In that case the solution is to forego the use of
> `defcustom`.  I'm fine with that.
>
> After all, the autoloads are supposed to run before the .emacs, so the
> user can `add-to-list` just fine to override whatever was added by
> autoloads.

I don't quite understand.  Let's assume debbugs would add a handler and
I wouldn't like to use it.  Isn't it correct that it would add it as
soon as it is loaded which means either where I have a (require
'debbugs) in my .emacs or call one of its autoloaded functions?

If that was true, we could document that packages should append their
entries which would give the users a chance to override those entries
because theirs would come earlier in the alist.  OTOH, when customizing
after the package has already been loaded and the entry is there, we
would have an undefined handler forever after the package was
uninstalled...

Or do you say it has an autoloaded (add-to-list ...) form?

Well, after some thinking I lean to the defvar + defcustom approach...

>> Symbol's value as variable is void: browse-url-mailto-function
>> make[2]: *** [Makefile:584: emacs.pdmp] Error 255
>> make[2]: Leaving directory '/home/horn/Repos/el/emacs/src'
>> make[1]: *** [Makefile:424: src] Error 2
>> make[1]: Leaving directory '/home/horn/Repos/el/emacs'
>> make: *** [Makefile:1119: bootstrap] Error 2
>> --8<---------------cut here---------------end--------------->8---
>>
>> When removing the autoload cookie, it builds fine.  Why is that?
>> `browse-url-mailto-function' and `browse-url-man-function' are defined
>> way before `browse-url-handlers'.
>
> But they're not autoloaded, so in the loaddefs.el file, you have
> a reference to it without the preceding definition.

I'm pretty sure I've tried adding autoload cookies to them as well and
got the same error.

> Maybe the better option is to define (and use) a new function
> `browse-url-mailto` (or some other name) which just funcalls
> `browse-url-mailto-function`.

Sounds good.  Will do.

Bye,
Tassilo



  reply	other threads:[~2020-05-05  7:06 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-03  8:50 bug-reference.el: Allow custom handlers for opening URLs Tassilo Horn
2020-05-03 14:44 ` Stefan Monnier
2020-05-03 15:24   ` Tassilo Horn
2020-05-03 20:39     ` Stefan Monnier
2020-05-04  9:41       ` Tassilo Horn
2020-05-04 15:32         ` Stefan Monnier
2020-05-04 17:09           ` Tassilo Horn
2020-05-04 18:54             ` Stefan Monnier
2020-05-05  7:06               ` Tassilo Horn [this message]
2020-05-05 13:49                 ` Stefan Monnier
2020-05-05 15:51                   ` Tassilo Horn
2020-05-05 17:44                     ` Stefan Monnier
2020-05-05 19:48                       ` browse-url.el: Custom handlers for certain URLs (was: bug-reference.el: Allow custom handlers for opening URLs) Tassilo Horn
2020-05-04  6:52     ` bug-reference.el: Allow custom handlers for opening URLs Yuri Khan
2020-05-05 19:55 ` Arash Esbati

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

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

  git send-email \
    --in-reply-to=87wo5qg8sl.fsf@gnu.org \
    --to=tsdh@gnu.org \
    --cc=emacs-devel@gnu.org \
    --cc=monnier@iro.umontreal.ca \
    /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 external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.