From c9b76bde56d574f893c5fa4805eed0534b4d5db9 Mon Sep 17 00:00:00 2001 From: Romain Goffe Date: Sun, 26 Feb 2012 13:48:07 +0100 Subject: [PATCH] indentation --- tex/crepbook.cls | 6 +++--- utils/emacs-format-file.el | 9 ++++----- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/tex/crepbook.cls b/tex/crepbook.cls index 33d3bb10..f6ad4f85 100644 --- a/tex/crepbook.cls +++ b/tex/crepbook.cls @@ -402,15 +402,15 @@ \IfStrEq{\@lang}{french}{refrain}{} } \newcommand{\Verse}{ - \IfStrEq{\@lang}{english}{verse}{} + \IfStrEq{\@lang}{english}{verse}{} \IfStrEq{\@lang}{french}{couplet}{} } \newcommand{\Solo}{ - \IfStrEq{\@lang}{english}{solo}{} + \IfStrEq{\@lang}{english}{solo}{} \IfStrEq{\@lang}{french}{solo}{} } \newcommand{\Pattern}{ - \IfStrEq{\@lang}{english}{pattern}{} + \IfStrEq{\@lang}{english}{pattern}{} \IfStrEq{\@lang}{french}{motif}{} } diff --git a/utils/emacs-format-file.el b/utils/emacs-format-file.el index 95daab43..b5571c46 100644 --- a/utils/emacs-format-file.el +++ b/utils/emacs-format-file.el @@ -11,7 +11,7 @@ (if (bobp) (indent-line-to 0) ; First line is always non-indented (let ((not-indented t) cur-indent) - (if (looking-at "^[ \t]*\\(\\\\end\\(song\\|verse\\|chorus\\)\\)") ; If the line we are looking at is the end of a block, then decrease the indentation + (if (looking-at "^[ \t]*\\(\\\\end\\)") ; If the line we are looking at is the end of a block, then decrease the indentation (progn (save-excursion (forward-line -1) @@ -21,11 +21,11 @@ (save-excursion (while not-indented ; Iterate backwards until we find an indentation hint (forward-line -1) - (if (looking-at "^[ \t]*\\(\\\\end\\(song\\|verse\\|chorus\\)\\)") ; This hint indicates that we need to indent at the level of the END_ token + (if (looking-at "^[ \t]*\\(\\\\end\\)") ; This hint indicates that we need to indent at the level of the END_ token (progn (setq cur-indent (current-indentation)) (setq not-indented nil)) - (if (looking-at "^[ \t]*\\(\\\\begin\\(song\\|verse\\|chorus\\)\\)") ; This hint indicates that we need to indent an extra level + (if (looking-at "^[ \t]*\\(\\\\begin\\)") ; This hint indicates that we need to indent an extra level (progn (setq cur-indent (+ (current-indentation) 2)) ; Do the actual indenting (setq not-indented nil)) @@ -33,8 +33,7 @@ (setq not-indented nil))))))) (if cur-indent (indent-line-to cur-indent) - (indent-line-to 0)))) ; If we didn't see an indentation hint, then allow no indentation - ) + (indent-line-to 0))))) ; If we didn't see an indentation hint, then allow no indentation (defun emacs-format-function () "Format the whole buffer."