cmake-mode.el: Don't assign to free variable save-point
Drop use of the free variable from unscreamify-cmake-buffer. The proper way to do this would be defvar or let, but it is more sensible to drop the feature completely: replace-match will shift the point and the saved-point will be invalid. More careful coding could avoid this, but seems overkill.
This commit is contained in:
parent
fbc3a6f33e
commit
d3db7126e6
|
@ -186,7 +186,6 @@ the indentation. Otherwise it retains the same position on the line"
|
||||||
(defun unscreamify-cmake-buffer ()
|
(defun unscreamify-cmake-buffer ()
|
||||||
"Convert all CMake commands to lowercase in buffer."
|
"Convert all CMake commands to lowercase in buffer."
|
||||||
(interactive)
|
(interactive)
|
||||||
(setq save-point (point))
|
|
||||||
(goto-char (point-min))
|
(goto-char (point-min))
|
||||||
(while (re-search-forward "^\\([ \t]*\\)\\(\\w+\\)\\([ \t]*(\\)" nil t)
|
(while (re-search-forward "^\\([ \t]*\\)\\(\\w+\\)\\([ \t]*(\\)" nil t)
|
||||||
(replace-match
|
(replace-match
|
||||||
|
@ -195,7 +194,6 @@ the indentation. Otherwise it retains the same position on the line"
|
||||||
(downcase (match-string 2))
|
(downcase (match-string 2))
|
||||||
(match-string 3))
|
(match-string 3))
|
||||||
t))
|
t))
|
||||||
(goto-char save-point)
|
|
||||||
)
|
)
|
||||||
|
|
||||||
;------------------------------------------------------------------------------
|
;------------------------------------------------------------------------------
|
||||||
|
|
Loading…
Reference in New Issue