]> git.eshelyaron.com Git - emacs.git/commitdiff
(c-mode): Set outline-regexp and outline-level.
authorRichard M. Stallman <rms@gnu.org>
Thu, 24 Feb 1994 22:34:24 +0000 (22:34 +0000)
committerRichard M. Stallman <rms@gnu.org>
Thu, 24 Feb 1994 22:34:24 +0000 (22:34 +0000)
(c-outline-level): New function.

lisp/progmodes/c-mode.el

index e057a4a4ca44ac36938677b1f3c7f433364fd50e..964f566f2d9fcdcafbbcb6207dba8b30a30db211 100644 (file)
@@ -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)))
 \f
 ;; This is used by indent-for-comment
 ;; to decide how much to indent a comment in C code