Merge topic 'emacs-mode-byte-compile'

9b3876bf cmake-mode.el: Replace 'setq' with 'let' or inlining
d3db7126 cmake-mode.el: Don't assign to free variable save-point
fbc3a6f3 cmake-mode.el: Avoid using beginning-of-buffer
This commit is contained in:
Brad King 2014-01-29 10:04:59 -05:00 committed by CMake Topic Stage
commit 2816ffae90

View File

@ -79,7 +79,7 @@ set the path with these commands:
(if (save-excursion (if (save-excursion
(beginning-of-line) (beginning-of-line)
(let ((parse-end (point))) (let ((parse-end (point)))
(beginning-of-buffer) (goto-char (point-min))
(nth 3 (parse-partial-sexp (point) parse-end)) (nth 3 (parse-partial-sexp (point) parse-end))
) )
) )
@ -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)
) )
;------------------------------------------------------------------------------ ;------------------------------------------------------------------------------
@ -278,8 +276,9 @@ optional argument topic will be appended to the argument list."
(if buffer (if buffer
(display-buffer buffer 'not-this-window) (display-buffer buffer 'not-this-window)
;; Buffer doesn't exist. Create it and fill it ;; Buffer doesn't exist. Create it and fill it
(setq buffer (generate-new-buffer bufname)) (let ((buffer (generate-new-buffer bufname))
(setq command (concat cmake-mode-cmake-executable " " type " " topic)) (command (concat cmake-mode-cmake-executable " " type " " topic))
)
(message "Running %s" command) (message "Running %s" command)
;; We don't want the contents of the shell-command running to the ;; We don't want the contents of the shell-command running to the
;; minibuffer, so turn it off. A value of nil means don't automatically ;; minibuffer, so turn it off. A value of nil means don't automatically
@ -300,6 +299,7 @@ optional argument topic will be appended to the argument list."
) )
) )
) )
)
;;;###autoload ;;;###autoload
(defun cmake-help-list-commands () (defun cmake-help-list-commands ()
@ -332,9 +332,8 @@ optional argument topic will be appended to the argument list."
(defun cmake-help-command () (defun cmake-help-command ()
"Prints out the help message corresponding to the command the cursor is on." "Prints out the help message corresponding to the command the cursor is on."
(interactive) (interactive)
(setq command (cmake-get-topic "command")) (cmake-command-run "--help-command" (downcase (cmake-get-topic "command"))))
(cmake-command-run "--help-command" (downcase command))
)
;;;###autoload ;;;###autoload
(progn (progn