comparison 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
comparison
equal deleted inserted replaced
49495:c6abb7476297 49496:2c05c557df6c
297 ;; Common initializations for all modes. 297 ;; Common initializations for all modes.
298 (setq c-buffer-is-cc-mode mode) 298 (setq c-buffer-is-cc-mode mode)
299 299
300 ;; these variables should always be buffer local; they do not affect 300 ;; these variables should always be buffer local; they do not affect
301 ;; indentation style. 301 ;; indentation style.
302 (make-local-variable 'require-final-newline)
303 (make-local-variable 'parse-sexp-ignore-comments) 302 (make-local-variable 'parse-sexp-ignore-comments)
304 (make-local-variable 'indent-line-function) 303 (make-local-variable 'indent-line-function)
305 (make-local-variable 'indent-region-function) 304 (make-local-variable 'indent-region-function)
306 (make-local-variable 'outline-regexp) 305 (make-local-variable 'outline-regexp)
307 (make-local-variable 'outline-level) 306 (make-local-variable 'outline-level)
324 (make-local-variable 'comment-line-break-function) 323 (make-local-variable 'comment-line-break-function)
325 (setq comment-line-break-function 324 (setq comment-line-break-function
326 'c-indent-new-comment-line))) 325 'c-indent-new-comment-line)))
327 326
328 ;; now set their values 327 ;; now set their values
329 (setq require-final-newline c-require-final-newline 328 (setq parse-sexp-ignore-comments t
330 parse-sexp-ignore-comments t
331 indent-line-function 'c-indent-line 329 indent-line-function 'c-indent-line
332 indent-region-function 'c-indent-region 330 indent-region-function 'c-indent-region
333 outline-regexp "[^#\n\^M]" 331 outline-regexp "[^#\n\^M]"
334 outline-level 'c-outline-level 332 outline-level 'c-outline-level
335 normal-auto-fill-function 'c-do-auto-fill 333 normal-auto-fill-function 'c-do-auto-fill
336 comment-column 32 334 comment-column 32
337 comment-start-skip "/\\*+ *\\|//+ *" 335 comment-start-skip "/\\*+ *\\|//+ *"
338 comment-multi-line t) 336 comment-multi-line t)
337
338 ;; Set `require-final-newline' only if we should.
339 (let ((rfn (assq mode c-require-final-newline)))
340 (when rfn
341 (make-local-variable 'require-final-newline)
342 (setq require-final-newline (cdr rfn))))
339 343
340 ;; Fix keyword regexps. 344 ;; Fix keyword regexps.
341 (c-init-language-vars) 345 (c-init-language-vars)
342 346
343 ;; now set the mode style based on c-default-style 347 ;; now set the mode style based on c-default-style