[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: org-ctags land grab
Re: org-ctags land grab
Thu, 23 Mar 2023 10:49:13 +0000
Nick Dokos <firstname.lastname@example.org> writes:
>> It is off by default.
> It is off until org-ctags is loaded. *When* it is loaded, it runs
> `(org-ctags-enable)' and the behavior changes.
Sure. This is not by itself a big deal. A number of Elisp libraries,
including built-in Emacs libraries are loaded with side effects.
> Now I'm not loading it explicitly, but nevertheless, *somebody* does
> because it goes ahead and mucks with my `org-open-link-functions'.
If somebody is loading org-ctags explicitly, it is their choice to use
this library. Instructions how to modify its behaviour are in the top
comment, including instructions how to deal with modified link opening.
> Debugger entered--setting org-open-link-functions to (org-ctags-find-tag):
> debug--implement-debug-watch(org-open-link-functions (org-ctags-find-tag)
> set nil)
> set-default(org-open-link-functions (org-ctags-find-tag))
> add-hook(org-open-link-functions org-ctags-find-tag t)
> byte-code("\300 \210\301\302!\207" [org-ctags-enable provide org-ctags] 2)
> load("org-ctags" noerror nomessage)
> help--load-prefixes((("org-" "ox-latex" "ox" "org-src" "org-refile"
> "org-protocol" "org-plot" "org-pcomplete" "org-mouse" "org-macs" "org-list"
> "org-keys" "org-habit" "org-faces" "org-ctags" ...
> As you see, `help--load-prefixes' loads `org-ctags'. If you look at
> the `help-definition-prefixes' radix tree, `org-ctags' is subsumed
> under the `org-' prefix, so any lookup with that prefix will end up
> loading it (and therefore enabling it). The reason it does not happen
> in 28.2 is that it is only under the `org-ctags` prefix.
This sounds like Emacs bug.
Note that you can disable this behaviour by setting
`help-enable-completion-autoload' and/or `help-enable-autoload'.
> It seems to me that `org-ctags' should be registered under the
> `org-ctags' prefix only, just like in 28.2 (the registration is in
> `org-loaddefs.el' but I don't know how it ends up there. I guess
> `org-fixup.el' is doing it, but I didn't chase it any further).
We did nothing to change how autoloads are being generated. However,
newer Emacs uses a different autoloading system.
> I also think that loading `org-ctags' should not automatically enable
> it: it should require the user to explicitly run `org-ctags-enable' to
> do that. That way, if there is a mechanism that loads it
> surreptitiously, it wouldn't cause the confusion that it causes
> now. That would require documentation changes, but it would avoid
> unpleasant surprises, and preserve some toes even if users load it
> accidentally. Eventually, it might be nice to provide a disabling
> function as well, although the workaround in the SE post works well
> enough for now. Maybe the thing to do is to turn it into a proper
> minor mode.
Yes and no. It will indeed avoid this unpleasant surprise, but it will
create an unpleasant surprise for users who do use org-ctags, which is
Note that we discussed loading side effects in
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at <https://orgmode.org/>.
Support Org development at <https://liberapay.com/org-mode>,
or support my work at <https://liberapay.com/yantar92>