summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Auxiliary/cmake-mode.el20
1 files changed, 11 insertions, 9 deletions
diff --git a/Auxiliary/cmake-mode.el b/Auxiliary/cmake-mode.el
index fe4a4c6..ea2415d 100644
--- a/Auxiliary/cmake-mode.el
+++ b/Auxiliary/cmake-mode.el
@@ -172,17 +172,19 @@ the indentation. Otherwise it retains the same position on the line"
;;
;; Helper functions for buffer
;;
-(defun unscreamify-cmake-buffer ()
+(defun cmake-unscreamify-buffer ()
"Convert all CMake commands to lowercase in buffer."
(interactive)
- (goto-char (point-min))
- (while (re-search-forward "^\\([ \t]*\\)\\(\\w+\\)\\([ \t]*(\\)" nil t)
- (replace-match
- (concat
- (match-string 1)
- (downcase (match-string 2))
- (match-string 3))
- t))
+ (save-excursion
+ (goto-char (point-min))
+ (while (re-search-forward "^\\([ \t]*\\)\\(\\w+\\)\\([ \t]*(\\)" nil t)
+ (replace-match
+ (concat
+ (match-string 1)
+ (downcase (match-string 2))
+ (match-string 3))
+ t))
+ )
)
;------------------------------------------------------------------------------