diff options
| author | Richard M. Stallman | 1994-02-24 22:34:24 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 1994-02-24 22:34:24 +0000 |
| commit | bd133320961b10e7abda6ffa86b3cc3fe78f981f (patch) | |
| tree | 7c8e6ff84209a496fc05b30d8e791f5bbe2d6b96 | |
| parent | 080d8166d8834cf2eb260b7e9bbfd5f95b8ecfaf (diff) | |
| download | emacs-bd133320961b10e7abda6ffa86b3cc3fe78f981f.tar.gz emacs-bd133320961b10e7abda6ffa86b3cc3fe78f981f.zip | |
(c-mode): Set outline-regexp and outline-level.
(c-outline-level): New function.
| -rw-r--r-- | lisp/progmodes/c-mode.el | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/lisp/progmodes/c-mode.el b/lisp/progmodes/c-mode.el index e057a4a4ca4..964f566f2d9 100644 --- a/lisp/progmodes/c-mode.el +++ b/lisp/progmodes/c-mode.el | |||
| @@ -230,6 +230,10 @@ if that value is non-nil." | |||
| 230 | (setq indent-region-function 'c-indent-region) | 230 | (setq indent-region-function 'c-indent-region) |
| 231 | (make-local-variable 'require-final-newline) | 231 | (make-local-variable 'require-final-newline) |
| 232 | (setq require-final-newline t) | 232 | (setq require-final-newline t) |
| 233 | (make-local-variable 'outline-regexp) | ||
| 234 | (setq outline-regexp "[^#\n\^M]") | ||
| 235 | (make-local-variable 'outline-level) | ||
| 236 | (setq outline-level 'c-outline-level) | ||
| 233 | (make-local-variable 'comment-start) | 237 | (make-local-variable 'comment-start) |
| 234 | (setq comment-start "/* ") | 238 | (setq comment-start "/* ") |
| 235 | (make-local-variable 'comment-end) | 239 | (make-local-variable 'comment-end) |
| @@ -243,6 +247,11 @@ if that value is non-nil." | |||
| 243 | (make-local-variable 'parse-sexp-ignore-comments) | 247 | (make-local-variable 'parse-sexp-ignore-comments) |
| 244 | (setq parse-sexp-ignore-comments t) | 248 | (setq parse-sexp-ignore-comments t) |
| 245 | (run-hooks 'c-mode-hook)) | 249 | (run-hooks 'c-mode-hook)) |
| 250 | |||
| 251 | (defun c-outline-level () | ||
| 252 | (save-excursion | ||
| 253 | (skip-chars-forward "\t ") | ||
| 254 | (current-column))) | ||
| 246 | 255 | ||
| 247 | ;; This is used by indent-for-comment | 256 | ;; This is used by indent-for-comment |
| 248 | ;; to decide how much to indent a comment in C code | 257 | ;; to decide how much to indent a comment in C code |