Skip to content

cmake-mode.el: Simplify jumping to begin/end of functions/macros

Jörg Bornemann requested to merge jobor/cmake:simplify-emacs-cmake-mode into master

This change was spawned by the desire to use narrow-to-defun in CMake files. However, there was no "CMake version" of that function, and it turns out that we don't need one if we make beginning-of-defun and end-of-defun work in cmake-mode.

In the setup code of cmake-mode we now set the local variables beginning-of-defun-function and end-of-defun-function. This makes beginning-of-defun and end-of-defun work as expected.

Functions that use this facility also work now: mark-defun and narrow-to-defun and possibly others.

We remove cmake-mark-defun since it's superfluous now.

We remove the defun-related key bindings since the standard functions that are bound globally work fine with this patch.

Edited by Brad King

Merge request reports