Skip to content
Snippets Groups Projects
Commit b24b58bb authored by Jostein Kjønigsen's avatar Jostein Kjønigsen Committed by Brad King
Browse files

cmake-mode.el: Add support for prog-mode hooks (#15521)

Since version 24, Emacs supports a generic mode called prog-mode.  Like
all other modes it has its own mode-hook, prog-mode-hook.  For Emacs
users it is common to provide all your generic programming-mode related
customizations in this mode-hook.

cmake-mode is definitely a programming-mode and should support calling
this hook. There are two ways to make that happen:

* Make your major-mode a derived-mode from prog-mode.
* Manually calling the hook upon mode-activation.

Implementing a derived mode may be the most proper thing to do, but that
may require quite a few structural changes.  For now just call the hook
explicitly if it exists.  This should cover much of what users need.
parent 6ccb534d
No related branches found
No related tags found
No related merge requests found
......@@ -259,7 +259,9 @@ the indentation. Otherwise it retains the same position on the line"
(setq comment-start "#")
; Run user hooks.
(run-hooks 'cmake-mode-hook))
(if (boundp 'prog-mode-hook)
(run-hooks 'prog-mode-hook 'cmake-mode-hook)
(run-hooks 'cmake-mode-hook)))
; Help mode starts here
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment