diff options
author | Philipp Möller <bootsarehax@googlemail.com> | 2014-01-28 17:05:21 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2014-01-28 17:44:02 (GMT) |
commit | 9b3876bfbca2354fca7386499899b8ad0b66a96d (patch) | |
tree | 9762eed8d5f8851a5e9074a0145f28ed50aed6bf /Auxiliary | |
parent | d3db7126e654ac947db7653250030c858070e746 (diff) | |
download | CMake-9b3876bfbca2354fca7386499899b8ad0b66a96d.zip CMake-9b3876bfbca2354fca7386499899b8ad0b66a96d.tar.gz CMake-9b3876bfbca2354fca7386499899b8ad0b66a96d.tar.bz2 |
cmake-mode.el: Replace 'setq' with 'let' or inlining
Diffstat (limited to 'Auxiliary')
-rw-r--r-- | Auxiliary/cmake-mode.el | 45 |
1 files changed, 23 insertions, 22 deletions
diff --git a/Auxiliary/cmake-mode.el b/Auxiliary/cmake-mode.el index eb6e84e..119168d 100644 --- a/Auxiliary/cmake-mode.el +++ b/Auxiliary/cmake-mode.el @@ -276,25 +276,27 @@ optional argument topic will be appended to the argument list." (if buffer (display-buffer buffer 'not-this-window) ;; Buffer doesn't exist. Create it and fill it - (setq buffer (generate-new-buffer bufname)) - (setq command (concat cmake-mode-cmake-executable " " type " " topic)) - (message "Running %s" command) - ;; 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 - ;; resize mini-windows. - (setq resize-mini-windows-save resize-mini-windows) - (setq resize-mini-windows nil) - (shell-command command buffer) - ;; Save the original window, so that we can come back to it later. - ;; save-excursion doesn't seem to work for this. - (setq window (selected-window)) - ;; We need to select it so that we can apply special modes to it - (select-window (display-buffer buffer 'not-this-window)) - (cmake-mode) - (toggle-read-only t) - ;; Restore the original window - (select-window window) - (setq resize-mini-windows resize-mini-windows-save) + (let ((buffer (generate-new-buffer bufname)) + (command (concat cmake-mode-cmake-executable " " type " " topic)) + ) + (message "Running %s" command) + ;; 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 + ;; resize mini-windows. + (setq resize-mini-windows-save resize-mini-windows) + (setq resize-mini-windows nil) + (shell-command command buffer) + ;; Save the original window, so that we can come back to it later. + ;; save-excursion doesn't seem to work for this. + (setq window (selected-window)) + ;; We need to select it so that we can apply special modes to it + (select-window (display-buffer buffer 'not-this-window)) + (cmake-mode) + (toggle-read-only t) + ;; Restore the original window + (select-window window) + (setq resize-mini-windows resize-mini-windows-save) + ) ) ) ) @@ -330,9 +332,8 @@ optional argument topic will be appended to the argument list." (defun cmake-help-command () "Prints out the help message corresponding to the command the cursor is on." (interactive) - (setq command (cmake-get-topic "command")) - (cmake-command-run "--help-command" (downcase command)) - ) + (cmake-command-run "--help-command" (downcase (cmake-get-topic "command")))) + ;;;###autoload (progn |