changeset 6074:33f42f5f7448

(c-mode): Set outline-regexp and outline-level. (c-outline-level): New function.
author Richard M. Stallman <rms@gnu.org>
date Thu, 24 Feb 1994 22:34:24 +0000
parents 2f23436468ce
children b23452652292
files lisp/progmodes/c-mode.el
diffstat 1 files changed, 9 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/progmodes/c-mode.el	Thu Feb 24 22:00:11 1994 +0000
+++ b/lisp/progmodes/c-mode.el	Thu Feb 24 22:34:24 1994 +0000
@@ -230,6 +230,10 @@
   (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 @@
   (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