Skip to content

Conversation

@nverno
Copy link

@nverno nverno commented Apr 18, 2024

Gives hook function a name for easier removal.

@Lindydancer
Copy link
Owner

Lindydancer commented Apr 18, 2024 via email

@nverno nverno force-pushed the fix/name-hook-function branch from 1df2da0 to 97c3462 Compare April 18, 2024 13:22
@nverno
Copy link
Author

nverno commented Apr 18, 2024

Unfortunately, the documentation of defalias states that "The return
value is undefined.

Good catch - I hadn't noticed that. defalias does return the created symbol in emacs v30, but I see in the source that it used to return the definition - hence the 'undefined' claim in the docs.

Updated it with your suggestions.

Another would be to define cmake-font-lock-maybe-activate as a plain
function in a ###autoload clause and use the name in the add-hook
construct.

I think the defun needs to be wrapped in a progn to avoid loading the package when
it's called from the hook.

@nverno
Copy link
Author

nverno commented Apr 18, 2024

It would be nice if the addition to the change-major-mode-after-body-hook was
customizable as well. I say this because cmake-ts-mode now adds cmake-mode
as a derived parent - and font-locking from this mode can override the tree-sitter
font-locking which confused me for a while.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants