Mercurial > emacs
diff lisp/progmodes/cc-mode.el @ 49496:2c05c557df6c
(c-require-final-newline): Made this variable an alist to specify a value
for each language. The default value causes `require-final-newline' to be
set to t only in languages where the standard requires a final newline.
author | Martin Stjernholm <mast@lysator.liu.se> |
---|---|
date | Tue, 28 Jan 2003 00:41:21 +0000 |
parents | 13365bab7fce |
children | b025ca405045 |
line wrap: on
line diff
--- a/lisp/progmodes/cc-mode.el Mon Jan 27 22:19:26 2003 +0000 +++ b/lisp/progmodes/cc-mode.el Tue Jan 28 00:41:21 2003 +0000 @@ -299,7 +299,6 @@ ;; these variables should always be buffer local; they do not affect ;; indentation style. - (make-local-variable 'require-final-newline) (make-local-variable 'parse-sexp-ignore-comments) (make-local-variable 'indent-line-function) (make-local-variable 'indent-region-function) @@ -326,8 +325,7 @@ 'c-indent-new-comment-line))) ;; now set their values - (setq require-final-newline c-require-final-newline - parse-sexp-ignore-comments t + (setq parse-sexp-ignore-comments t indent-line-function 'c-indent-line indent-region-function 'c-indent-region outline-regexp "[^#\n\^M]" @@ -337,6 +335,12 @@ comment-start-skip "/\\*+ *\\|//+ *" comment-multi-line t) + ;; Set `require-final-newline' only if we should. + (let ((rfn (assq mode c-require-final-newline))) + (when rfn + (make-local-variable 'require-final-newline) + (setq require-final-newline (cdr rfn)))) + ;; Fix keyword regexps. (c-init-language-vars)