STYLE: Removed trailing whitespace.
This commit is contained in:
parent
ddd3190387
commit
458fed969f
|
@ -9,8 +9,8 @@
|
||||||
; Copyright (c) 2002 Kitware, Inc., Insight Consortium. All rights reserved.
|
; Copyright (c) 2002 Kitware, Inc., Insight Consortium. All rights reserved.
|
||||||
; See Copyright.txt or http://www.cmake.org/HTML/Copyright.html for details.
|
; See Copyright.txt or http://www.cmake.org/HTML/Copyright.html for details.
|
||||||
;
|
;
|
||||||
; This software is distributed WITHOUT ANY WARRANTY; without even
|
; This software is distributed WITHOUT ANY WARRANTY; without even
|
||||||
; the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
|
; the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
|
||||||
; PURPOSE. See the above copyright notices for more information.
|
; PURPOSE. See the above copyright notices for more information.
|
||||||
;
|
;
|
||||||
;=============================================================================
|
;=============================================================================
|
||||||
|
@ -55,12 +55,12 @@
|
||||||
; Line indentation function.
|
; Line indentation function.
|
||||||
(defun cmake-indent ()
|
(defun cmake-indent ()
|
||||||
"Indent current line as CMAKE code."
|
"Indent current line as CMAKE code."
|
||||||
(interactive)
|
(interactive)
|
||||||
(beginning-of-line)
|
(beginning-of-line)
|
||||||
(if (bobp)
|
(if (bobp)
|
||||||
(indent-line-to 0)
|
(indent-line-to 0)
|
||||||
(let (cur-indent)
|
(let (cur-indent)
|
||||||
|
|
||||||
; Search back for previous non-blank line.
|
; Search back for previous non-blank line.
|
||||||
(save-excursion
|
(save-excursion
|
||||||
(forward-line -1)
|
(forward-line -1)
|
||||||
|
@ -70,7 +70,7 @@
|
||||||
|
|
||||||
; Start with previous non-blank line's indentation.
|
; Start with previous non-blank line's indentation.
|
||||||
(setq cur-indent (current-indentation))
|
(setq cur-indent (current-indentation))
|
||||||
|
|
||||||
; If previous line is a comment line, just use its
|
; If previous line is a comment line, just use its
|
||||||
; indentation. Otherwise, adjust indentation based on the
|
; indentation. Otherwise, adjust indentation based on the
|
||||||
; line's contents.
|
; line's contents.
|
||||||
|
@ -80,13 +80,13 @@
|
||||||
(if (looking-at cmake-indent-begin-regex)
|
(if (looking-at cmake-indent-begin-regex)
|
||||||
(setq cur-indent (+ cur-indent cmake-tab-width))
|
(setq cur-indent (+ cur-indent cmake-tab-width))
|
||||||
)
|
)
|
||||||
|
|
||||||
; If previous line opens a command invocation, we indent
|
; If previous line opens a command invocation, we indent
|
||||||
; this line.
|
; this line.
|
||||||
(if (looking-at cmake-indent-open-regex)
|
(if (looking-at cmake-indent-open-regex)
|
||||||
(setq cur-indent (+ cur-indent cmake-tab-width))
|
(setq cur-indent (+ cur-indent cmake-tab-width))
|
||||||
)
|
)
|
||||||
|
|
||||||
; If previous line closes a command invocation, we unindent
|
; If previous line closes a command invocation, we unindent
|
||||||
; this line.
|
; this line.
|
||||||
(if (looking-at cmake-indent-close-regex)
|
(if (looking-at cmake-indent-close-regex)
|
||||||
|
@ -96,12 +96,12 @@
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
; If this line ends a block, we unindent it.
|
; If this line ends a block, we unindent it.
|
||||||
(if (looking-at cmake-indent-end-regex)
|
(if (looking-at cmake-indent-end-regex)
|
||||||
(setq cur-indent (- cur-indent cmake-tab-width))
|
(setq cur-indent (- cur-indent cmake-tab-width))
|
||||||
)
|
)
|
||||||
|
|
||||||
; Indent this line by the amount selected.
|
; Indent this line by the amount selected.
|
||||||
(if (< cur-indent 0)
|
(if (< cur-indent 0)
|
||||||
(indent-line-to 0)
|
(indent-line-to 0)
|
||||||
|
@ -140,7 +140,7 @@
|
||||||
(setq major-mode 'cmake-mode)
|
(setq major-mode 'cmake-mode)
|
||||||
(setq mode-name "CMAKE")
|
(setq mode-name "CMAKE")
|
||||||
|
|
||||||
; Create the syntax table
|
; Create the syntax table
|
||||||
(setq cmake-mode-syntax-table (make-syntax-table))
|
(setq cmake-mode-syntax-table (make-syntax-table))
|
||||||
(set-syntax-table cmake-mode-syntax-table)
|
(set-syntax-table cmake-mode-syntax-table)
|
||||||
(modify-syntax-entry ?_ "w" cmake-mode-syntax-table)
|
(modify-syntax-entry ?_ "w" cmake-mode-syntax-table)
|
||||||
|
@ -148,19 +148,19 @@
|
||||||
(modify-syntax-entry ?\) ")(" cmake-mode-syntax-table)
|
(modify-syntax-entry ?\) ")(" cmake-mode-syntax-table)
|
||||||
(modify-syntax-entry ?# "<" cmake-mode-syntax-table)
|
(modify-syntax-entry ?# "<" cmake-mode-syntax-table)
|
||||||
(modify-syntax-entry ?\n ">" cmake-mode-syntax-table)
|
(modify-syntax-entry ?\n ">" cmake-mode-syntax-table)
|
||||||
|
|
||||||
; Setup font-lock mode.
|
; Setup font-lock mode.
|
||||||
(make-local-variable 'font-lock-defaults)
|
(make-local-variable 'font-lock-defaults)
|
||||||
(setq font-lock-defaults '(cmake-font-lock-defaults))
|
(setq font-lock-defaults '(cmake-font-lock-defaults))
|
||||||
|
|
||||||
; Setup indentation function.
|
; Setup indentation function.
|
||||||
(make-local-variable 'indent-line-function)
|
(make-local-variable 'indent-line-function)
|
||||||
(setq indent-line-function 'cmake-indent)
|
(setq indent-line-function 'cmake-indent)
|
||||||
|
|
||||||
; Setup comment syntax.
|
; Setup comment syntax.
|
||||||
(make-local-variable 'comment-start)
|
(make-local-variable 'comment-start)
|
||||||
(setq comment-start "#")
|
(setq comment-start "#")
|
||||||
|
|
||||||
(run-hooks 'cmake-mode-hook))
|
(run-hooks 'cmake-mode-hook))
|
||||||
|
|
||||||
; This file provides cmake-mode.
|
; This file provides cmake-mode.
|
||||||
|
|
Loading…
Reference in New Issue