-
Notifications
You must be signed in to change notification settings - Fork 50
chg: Make hooks to set up extensions removable #261 #266
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
Added the following utility functions to support the move - `org-transclusion-extension-functions-add-or-remove` - `org-transclusion-extension-set-a-hook-functions` Modified function `org-transclusion-load-extensions-maybe` so that setting `org-transclusion-extensions` with the `customize` facilities will automatically activate the corresponding minor mode for each extension. Use of `customize` and `org-transclusion-extensions` is optional. Users can ignore these and use extensions by loading and activating minor modes in their init.el file. So, this below should work (each minor mode function has the autoload cookie, so the library should not have to be explicitly loaded). ``` (with-eval-after-load 'org-transclusion (org-transclusion-indent-mode +1)) ``` Adding to the list and requiring the library like this below did not use to be necessary... ``` (with-eval-after-load 'org-transclusion (add-to-list 'org-transclusion-extensions 'org-transclusion-indent-mode) (require 'org-transclusion-indent-mode)) ``` The Customizing facility would load the active extension library with `require`.... But I think this was never intuitive.
'((cons e1 e2)) is incorrect. `cons` will be part of the list.
Thank you!! A Joyous New Year to You too!! I pushed another commit to the
I suggest removing the call to Thank you! Joseph |
@josephmturner, thank you for your comment. I could not work on this thread on the weekend (I would like to sit down and take a decent amount of focus time to respond). I will come back in due course — just wanted to make a quick comment and thank you. |
Thank you for your engagement and patience—I really appreciate it. I've been reflecting on this exchange and your suggestions. I believe our discussion touches on two main points:
Point 1I'd like to take a step back and examine the reason behind the concern (1). From my understanding , this stems from this coding convention outlined in The first convention in that page states:
I agree with this convention: "Simply loading a package should not change Emacs's editing behavior." I interpret it say this:
So..., the issue arises not from loading extensions per se, but from loading them in a way that unintentionally changes a user's editing experience. I believe this interpretation aligns with the convention—would you agree? If so, it suggests that both the previous and current behaviors do not violate this principle.
The This is my view for the first point about extra extensions being loaded merely by requiring Point 2Now... maybe you don't agree with me on my interpretation of the coding convention; in this case, it may be better for me to stop here. ... but since I have got you wait for long, I will continue a little longer. I've introduced a minor mode for each extension to align with the way currently common to similar to how
This is true and I agree. I. plan to move away from this model for future extensions. This will be the last set of extensions activated via
ConclusionI think keeping I would love to hear your thoughts on my perspective. |
Thank you, @nobiot! I think the changes you propose in this PR are very good. If I understand what you're saying, some extensions (font-lock, src-lines) are considered part of the core package and should always be activated, while others (indent-mode, html, and external extensions, like hyperdrive-org-translusion) should not always be activated. I think this distinction is already covered by the defcustom Since I think we should load extensions as lazily as possible, since Can we simply remove these few lines from
That sounds good. Thank you!! Joseph |
@josephmturner
Wishing you a joyous New Year! Apologies for taking for so long to get back to you (I wanted to fix the infinite loop issue first...). I believe this is a good-enough fix. No breaking changes for users, and minor-modes can co-exist. The user manual need to be updated (especially how to use extensions -- on a separate issue, I am working on Transient-based menu UI in the background.
Your -html.el is also adjusted based on this new way. Let me know what you think.
Added the following utility functions to support the move
org-transclusion-extension-functions-add-or-remove
org-transclusion-extension-set-a-hook-functions
Modified function
org-transclusion-load-extensions-maybe
so that settingorg-transclusion-extensions
with thecustomize
facilities will automatically activate the corresponding minor mode for each extension.Use of
customize
andorg-transclusion-extensions
is optional. Users can ignore these and use extensions by loading and activating minor modes in their init.el file.So, this below should work (each minor mode function has the autoload cookie, so the library should not have to be explicitly loaded).
Adding to the list and requiring the library like this below did not use to be
necessary...
The Customizing facility would load the active extension library with
require
.... But I think this was never intuitive.