cmake-mode.el: Rename function to be consistent

unscreamify-cmake-buffer => cmake-unscreamify-buffer

While at it, wrap the operation in (save-excursion).
This commit is contained in:
Roy Crihfield 2015-03-06 15:08:12 -05:00 committed by Brad King
parent 63de609ef1
commit 7987d9857e
1 changed files with 11 additions and 9 deletions

View File

@ -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))
)
)
;------------------------------------------------------------------------------