summaryrefslogtreecommitdiffstats
path: root/Auxiliary
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2024-01-26 15:13:32 (GMT)
committerKitware Robot <kwrobot@kitware.com>2024-01-26 15:13:42 (GMT)
commit409ab01039dd3c8f5ae0df48a1ee1c356132a9bf (patch)
tree399f88d16c95f5ea0ef21d0f7304c2b0163c045c /Auxiliary
parent37a7eed1548325a1e60a562aef3997bbf53bb270 (diff)
parent91336c74698b09afe272f8dc044b84ecf71d0904 (diff)
downloadCMake-409ab01039dd3c8f5ae0df48a1ee1c356132a9bf.zip
CMake-409ab01039dd3c8f5ae0df48a1ee1c356132a9bf.tar.gz
CMake-409ab01039dd3c8f5ae0df48a1ee1c356132a9bf.tar.bz2
Merge topic 'simplify-emacs-cmake-mode'
91336c7469 cmake-mode.el: Simplify jumping to begin/end of functions/macros Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !9185
Diffstat (limited to 'Auxiliary')
-rw-r--r--Auxiliary/cmake-mode.el18
1 files changed, 4 insertions, 14 deletions
diff --git a/Auxiliary/cmake-mode.el b/Auxiliary/cmake-mode.el
index 6bd23bf..b5e5ff4 100644
--- a/Auxiliary/cmake-mode.el
+++ b/Auxiliary/cmake-mode.el
@@ -258,15 +258,6 @@ Return t unless search stops due to end of buffer."
(forward-line)
t)))
-(defun cmake-mark-defun ()
- "Mark the current CMake function or macro.
-
-This puts the mark at the end, and point at the beginning."
- (interactive)
- (cmake-end-of-defun)
- (push-mark nil :nomsg :activate)
- (cmake-beginning-of-defun))
-
;------------------------------------------------------------------------------
@@ -346,6 +337,10 @@ This puts the mark at the end, and point at the beginning."
(define-derived-mode cmake-mode prog-mode "CMake"
"Major mode for editing CMake source files."
+ ;; Setup jumping to beginning/end of a CMake function/macro.
+ (set (make-local-variable 'beginning-of-defun-function) #'cmake-beginning-of-defun)
+ (set (make-local-variable 'end-of-defun-function) #'cmake-end-of-defun)
+
; Setup font-lock mode.
(set (make-local-variable 'font-lock-defaults) '(cmake-font-lock-keywords))
; Setup indentation function.
@@ -356,11 +351,6 @@ This puts the mark at the end, and point at the beginning."
(set (make-local-variable 'syntax-propertize-function) cmake--syntax-propertize-function)
(add-hook 'syntax-propertize-extend-region-functions #'syntax-propertize-multiline nil t))
-;; Default cmake-mode key bindings
-(define-key cmake-mode-map "\e\C-a" #'cmake-beginning-of-defun)
-(define-key cmake-mode-map "\e\C-e" #'cmake-end-of-defun)
-(define-key cmake-mode-map "\e\C-h" #'cmake-mark-defun)
-
; Help mode starts here