aboutsummaryrefslogtreecommitdiffhomepage
path: root/af2
diff options
context:
space:
mode:
authorGravatar Christophe Raffalli <christophe.raffalli@univ-savoie.fr>2000-09-15 13:08:02 +0000
committerGravatar Christophe Raffalli <christophe.raffalli@univ-savoie.fr>2000-09-15 13:08:02 +0000
commit77dcec72d70cf63030b0884a3ff3e0161a70457d (patch)
tree7b6f435f4c429fe90d459a7ce561e9495c73ef8b /af2
parented43fae19ad1792fbdc3d987a4d88a9568d1a864 (diff)
outline minior mode definitions for af2
Diffstat (limited to 'af2')
-rw-r--r--af2/af2-outline.el57
1 files changed, 57 insertions, 0 deletions
diff --git a/af2/af2-outline.el b/af2/af2-outline.el
new file mode 100644
index 00000000..e3dbf845
--- /dev/null
+++ b/af2/af2-outline.el
@@ -0,0 +1,57 @@
+;;--------------------------------------------------------------------------;;
+;;--------------------------------------------------------------------------;;
+;; PARAMÉTRAGE du MODE outline
+;;--------------------------------------------------------------------------;;
+
+
+(setq af2-outline-title-regexp "\\((\\*[ \t\n]*title =\\)")
+(setq af2-outline-section-regexp "\\((\\*\\*+\\)")
+(setq af2-outline-save-regexp "\\((\\*#\\)")
+(setq
+ af2-outline-theo-regexp
+ "\\((\\*lem\\)\\|\\((\\*prop\\)\\|\\((\\*fact\\)\\|\\((\\*theo\\)\\|\\((\\*def\\)\\|\\((\\*cst\\)")
+(setq
+ af2-outline-theo2-regexp
+ "\\(lem\\)\\|\\(prop\\)\\|\\(fact\\)\\|\\(theo\\)\\|\\(def\\)\\|\\(cst\\)\\|\\(claim\\)\\|\\(new_\\)")
+
+(setq
+ af2-outline-regexp
+ (concat
+ af2-outline-title-regexp "\\|"
+ af2-outline-section-regexp "\\|"
+ af2-outline-save-regexp "\\|"
+ af2-outline-theo-regexp "\\|"
+ af2-outline-theo2-regexp))
+
+(setq af2-outline-heading-end-regexp "\\(\\*)[ \t]*\n\\)\\|\\(\\.[ \t]*\n\\)")
+
+;(if af2-outline
+; (add-hook 'af2-mode-hook '(lambda()(outline-minor-mode 1)))
+; )
+
+(defun af2-outline-level()
+ "Find the level of current outline heading in some af2 libraries."
+ (let ((retour 0))
+ (save-excursion
+ (cond ((looking-at af2-outline-title-regexp) 1)
+ ((looking-at af2-outline-section-regexp)
+ (min 6 (- (match-end 0) (match-beginning 0)))) ; valeur maxi 6
+ ((looking-at af2-outline-theo-regexp) 7)
+ ((looking-at (concat af2-outline-save-regexp "\\|"
+ af2-outline-theo2-regexp )
+ ) 8)
+ )
+ )))
+
+(defun af2-setup-outline ()
+ "Set up local variable for outline mode"
+ (make-local-variable 'outline-heading-end-regexp)
+ (setq outline-heading-end-regexp af2-outline-heading-end-regexp)
+ (make-local-variable 'outline-regexp)
+ (setq outline-regexp af2-outline-regexp)
+ (make-local-variable 'outline-level)
+ (setq outline-level 'af2-outline-level)
+ (outline-minor-mode 1)
+)
+
+(provide 'af2-outline) \ No newline at end of file