summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard M. Stallman <rms@gnu.org>1994-02-24 22:34:24 +0000
committerRichard M. Stallman <rms@gnu.org>1994-02-24 22:34:24 +0000
commitbd133320961b10e7abda6ffa86b3cc3fe78f981f (patch)
tree7c8e6ff84209a496fc05b30d8e791f5bbe2d6b96
parent080d8166d8834cf2eb260b7e9bbfd5f95b8ecfaf (diff)
downloademacs-bd133320961b10e7abda6ffa86b3cc3fe78f981f.tar.gz
emacs-bd133320961b10e7abda6ffa86b3cc3fe78f981f.tar.bz2
emacs-bd133320961b10e7abda6ffa86b3cc3fe78f981f.zip
(c-mode): Set outline-regexp and outline-level.
(c-outline-level): New function.
-rw-r--r--lisp/progmodes/c-mode.el9
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."
(setq indent-region-function 'c-indent-region)
(make-local-variable 'require-final-newline)
(setq require-final-newline t)
+ (make-local-variable 'outline-regexp)
+ (setq outline-regexp "[^#\n\^M]")
+ (make-local-variable 'outline-level)
+ (setq outline-level 'c-outline-level)
(make-local-variable 'comment-start)
(setq comment-start "/* ")
(make-local-variable 'comment-end)
@@ -243,6 +247,11 @@ if that value is non-nil."
(make-local-variable 'parse-sexp-ignore-comments)
(setq parse-sexp-ignore-comments t)
(run-hooks 'c-mode-hook))
+
+(defun c-outline-level ()
+ (save-excursion
+ (skip-chars-forward "\t ")
+ (current-column)))
;; This is used by indent-for-comment
;; to decide how much to indent a comment in C code