Re: [POLL] Should we accept breaking changes to get rid of Org libraries that perform side effects when loading? (was: org-ctags land grab)

2023-03-28 Thread Ihor Radchenko
"Dr. Arne Babenhauserheide"  writes:

>> This is convincing.
>> I am then CCing Bastien, as, despite the Elisp convention, following it
>> will break https://bzg.fr/en/the-software-maintainers-pledge/
>
> Isn’t the problem that the behavior changed — so that org-ctags gets
> loaded in Emacs 30 but not in Emacs 28 is already an incompatible
> change?

It is a secondary problem.
In earlier Emacs you would get the same side effects if, for example,
you try C-h f org-ctags- .
`help-enable-autoload' is there since Emacs 24.

The root cause of this and similar reported issues (like with org-mouse,
see https://orgmode.org/list/87iliie0j1.fsf@localhost) is optional Org
modules having side effects when loaded.

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at .
Support Org development at ,
or support my work at 



Re: [POLL] Should we accept breaking changes to get rid of Org libraries that perform side effects when loading? (was: org-ctags land grab)

2023-03-27 Thread Dr. Arne Babenhauserheide

Ihor Radchenko  writes:

> Max Nikulin  writes:
>
>>> Sure. This is not by itself a big deal. A number of Elisp libraries,
>>> including built-in Emacs libraries are loaded with side effects.
>>
>> It is still violation of conventions:
>>
>> (info "(elisp) Coding Conventions")
>> https://www.gnu.org/software/emacs/manual/html_node/elisp/Coding-Conventions.html
>>> D.1 Emacs Lisp Coding Conventions
>>> 
>>> Simply loading a package should not change Emacs’s editing behavior.
>>> Include a command or commands to enable and disable the feature, or to
>>> invoke it.
>>> 
>>> This convention is mandatory for any file that includes custom
>>> definitions. If fixing such a file to follow this convention requires an
>>> incompatible change, go ahead and make the incompatible change; don’t
>>> postpone it.
>
> This is convincing.
> I am then CCing Bastien, as, despite the Elisp convention, following it
> will break https://bzg.fr/en/the-software-maintainers-pledge/

Isn’t the problem that the behavior changed — so that org-ctags gets
loaded in Emacs 30 but not in Emacs 28 is already an incompatible
change?

Best wishes,
Arne
-- 
Unpolitisch sein
heißt politisch sein,
ohne es zu merken.
draketo.de


signature.asc
Description: PGP signature


[POLL] Should we accept breaking changes to get rid of Org libraries that perform side effects when loading? (was: org-ctags land grab)

2023-03-25 Thread Ihor Radchenko
Max Nikulin  writes:

>> Sure. This is not by itself a big deal. A number of Elisp libraries,
>> including built-in Emacs libraries are loaded with side effects.
>
> It is still violation of conventions:
>
> (info "(elisp) Coding Conventions")
> https://www.gnu.org/software/emacs/manual/html_node/elisp/Coding-Conventions.html
>> D.1 Emacs Lisp Coding Conventions
>> 
>> Simply loading a package should not change Emacs’s editing behavior.
>> Include a command or commands to enable and disable the feature, or to
>> invoke it.
>> 
>> This convention is mandatory for any file that includes custom
>> definitions. If fixing such a file to follow this convention requires an
>> incompatible change, go ahead and make the incompatible change; don’t
>> postpone it.

This is convincing.
I am then CCing Bastien, as, despite the Elisp convention, following it
will break https://bzg.fr/en/the-software-maintainers-pledge/

>> Note that we discussed loading side effects in
>> https://list.orgmode.org/orgmode/tn4ql0$bu2$1...@ciao.gmane.io/
>
> I have not responded to that thread. My opinion is that besides 
> functions that just loads files and packages there should be 
> counterparts that loads and activates libraries. A proof of concept may 
> be implemented for Org and in the case of success it may be proposed for 
> inclusion into Emacs core.

Maybe. We can do something similar to `unload-feature'. However, it will
still require users to adapt.

Tentative implementation:

(defun enable-feature (feature  filename noerror)
  "Load and enable FEATURE.
FILENAME and NOERROR arguments are the same as in `require'."
  (when (require feature filename noerror)
(let ((enabler-cmd (intern (format "%s-enable-function" feature
  (and (fboundp enabler-cmd) (funcall enabler-cmd)

(defun disable-feature (feature)
  "Disable FEATURE."
  (let ((disabler-cmd (intern (format "%s-disable-function" feature
(and (fboundp disabler-cmd) (funcall disabler-cmd

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at .
Support Org development at ,
or support my work at