emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Patch: perform autoloading when docs is missing from autoload object


From: Arthur Miller
Subject: Re: Patch: perform autoloading when docs is missing from autoload object
Date: Fri, 17 Sep 2021 17:04:56 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)

Lars Ingebrigtsen <larsi@gnus.org> writes:

> Arthur Miller <arthur.miller@live.com> writes:
>
>>> In which cases will this make a difference when displaying the *Help*
>>> buffer for the symbol?
>>
>> In case where the symbol is not loaded, and there is no doc entry in autoload
>> object.
>
> Oh, right --- I was thinking about ;;;###autoload, where the doc string
> is available always, not
>
> (autoload 'foo "foo")
>
> Yes, in those cases it would indeed be helpful if the help machinery
> just went ahead and loaded the library.  However, there are some
> instances where loading a library has unexpected side effects, like
> enabling new modes and keymaps.  Doing so is frowned upon (loading a
> library shouldn't do those things), but it happens.
>
> If this is a concern, then we could perhaps add a button to *Help* to do
> the loading instead of loading automatically?
It would be one option. The other one would be to warn about possible
unwanting side-effects in docs.

I wanted to later switch to just fetch the docs instead of performing
load. Loading docs can be done without evaluating the code. It might be a
better solution anyway?

By the way, I had thoughts about loading the library vs just docs. I reason,
that, if I look at some symbol docs via describe-* functions, I am
probably already using that library/package, or am about to use it, so it
probably is going to be loaded anyway. At least in many cases, not always of
course.

> But perhaps just loading the file automatically would be fine anyway --
> it's a bug for libraries to side-effect to an annoying degree upon load.

Helpful does it and a lot of people seems to be happy with it, but it does not
mean it is the correct thing to do, just often acceptable, or overlooked.

Built-in help does it too in some cases too, I think just for keymaps, I am not
sure there.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]