aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDave Love1999-01-05 14:20:30 +0000
committerDave Love1999-01-05 14:20:30 +0000
commit45d1e4d4427045e7b8bea3035dbf1cef3be16b5c (patch)
tree9df2928a9e8bc54d9bf1c658496ede8264a1fadd
parentfd202b85297512b2b7914d44a239dd9419bfa36f (diff)
downloademacs-45d1e4d4427045e7b8bea3035dbf1cef3be16b5c.tar.gz
emacs-45d1e4d4427045e7b8bea3035dbf1cef3be16b5c.zip
1999-01-05 Dave Love <fx@gnu.org>
* progmodes/f90.el (f90-mode): Make imenu-case-fold-search buffer-local. 1998-01-05 Torbjorn Einarsson <T.Einarsson@clab.ericsson.se> * f90.el: Change of regular expressions for type to correct high-lighting and identation. Some small fixes for compatibility with XEmacs.
-rw-r--r--lisp/progmodes/f90.el45
1 files changed, 23 insertions, 22 deletions
diff --git a/lisp/progmodes/f90.el b/lisp/progmodes/f90.el
index 857fe7cfa4e..00247f27e74 100644
--- a/lisp/progmodes/f90.el
+++ b/lisp/progmodes/f90.el
@@ -3,7 +3,7 @@
3;; Copyright (C) 1995, 1996, 1997 Free Software Foundation, Inc. 3;; Copyright (C) 1995, 1996, 1997 Free Software Foundation, Inc.
4 4
5;; Author: Torbj\"orn Einarsson <T.Einarsson@clab.ericsson.se> 5;; Author: Torbj\"orn Einarsson <T.Einarsson@clab.ericsson.se>
6;; Last Change: May 29 1997 6;; Last Change: Dec 29 1998
7;; Keywords: fortran, f90, languages 7;; Keywords: fortran, f90, languages
8 8
9;; This file is part of GNU Emacs. 9;; This file is part of GNU Emacs.
@@ -367,7 +367,7 @@ whether to blink the matching beginning."
367;; Highlighting patterns 367;; Highlighting patterns
368 368
369(defvar f90-font-lock-keywords-1 369(defvar f90-font-lock-keywords-1
370 (list ; Emacs 370 (list
371 '("\\<\\(end[ \t]*\\(program\\|module\\|function\\|subroutine\\|type\\)\\)\\>[ \t]*\\(\\sw+\\)?" 371 '("\\<\\(end[ \t]*\\(program\\|module\\|function\\|subroutine\\|type\\)\\)\\>[ \t]*\\(\\sw+\\)?"
372 (1 font-lock-keyword-face) (3 font-lock-function-name-face nil t)) 372 (1 font-lock-keyword-face) (3 font-lock-function-name-face nil t))
373 '("\\<\\(program\\|call\\|module\\|subroutine\\|function\\|use\\)\\>[ \t]*\\(\\sw+\\)?" 373 '("\\<\\(program\\|call\\|module\\|subroutine\\|function\\|use\\)\\>[ \t]*\\(\\sw+\\)?"
@@ -375,7 +375,7 @@ whether to blink the matching beginning."
375 ;; Special highlighting of "module procedure foo-list" 375 ;; Special highlighting of "module procedure foo-list"
376 '("\\<\\(module[ \t]*procedure\\)\\>" (1 font-lock-keyword-face t)) 376 '("\\<\\(module[ \t]*procedure\\)\\>" (1 font-lock-keyword-face t))
377 ;; Highlight definition of new type 377 ;; Highlight definition of new type
378 '("\\<\\(type\\)[ \t]*\\(,.*::[ \t]*\\|[ \t]+\\)\\(\\sw+\\)" 378 '("\\<\\(type\\)[ \t]*\\(.*::[ \t]*\\|[ \t]+\\)\\(\\sw+\\)"
379 (1 font-lock-keyword-face) (3 font-lock-function-name-face)) 379 (1 font-lock-keyword-face) (3 font-lock-function-name-face))
380 "\\<\\(\\(end[ \t]*\\)?\\(interface\\|block[ \t]*data\\)\\|contains\\)\\>") 380 "\\<\\(\\(end[ \t]*\\)?\\(interface\\|block[ \t]*data\\)\\|contains\\)\\>")
381 "This does fairly subdued highlighting of comments and function calls.") 381 "This does fairly subdued highlighting of comments and function calls.")
@@ -410,11 +410,9 @@ whether to blink the matching beginning."
410 (list 410 (list
411 f90-keywords-level-3-re 411 f90-keywords-level-3-re
412 f90-operators-re 412 f90-operators-re
413 (if (string-match "XEmacs" emacs-version) 413 (list f90-procedures-re '(1 font-lock-keyword-face t))
414 (append (list f90-procedures-re) '(1 font-lock-keyword-face t)) 414 "\\<real\\>" ; Avoid overwriting real defs.
415 (list f90-procedures-re '(1 font-lock-keyword-face t))) 415 ))
416 "\\<real\\>" ; Avoid overwriting real defs.
417 ))
418 "Highlights all F90 keywords and intrinsic procedures.") 416 "Highlights all F90 keywords and intrinsic procedures.")
419 417
420(defvar f90-font-lock-keywords-4 418(defvar f90-font-lock-keywords-4
@@ -658,7 +656,7 @@ program\\|select\\|subroutine\\|type\\|where\\|forall\\)\\>")
658(defconst f90-end-type-re 656(defconst f90-end-type-re
659 "end[ \t]*\\(type\\|interface\\|block[ \t]*data\\)") 657 "end[ \t]*\\(type\\|interface\\|block[ \t]*data\\)")
660(defconst f90-type-def-re 658(defconst f90-type-def-re
661 "\\<\\(type\\)[ \t]*\\(,.*::[ \t]*\\|[ \t]+\\)\\(\\sw+\\)") 659 "\\<\\(type\\)\\([^(\n]*\\)\\(::\\)?[ \t]*\\b\\(\\sw+\\)")
662(defconst f90-no-break-re "\\(\\*\\*\\|//\\|=>\\)") 660(defconst f90-no-break-re "\\(\\*\\*\\|//\\|=>\\)")
663;; A temporary position to make region operators faster 661;; A temporary position to make region operators faster
664(defvar f90-cache-position nil) 662(defvar f90-cache-position nil)
@@ -865,21 +863,24 @@ with no args, if that value is non-nil."
865 (if (string-match "XEmacs" emacs-version) 863 (if (string-match "XEmacs" emacs-version)
866 (progn 864 (progn
867 (put 'f90-mode 'font-lock-keywords-case-fold-search t) 865 (put 'f90-mode 'font-lock-keywords-case-fold-search t)
868 (if (and current-menubar 866 (if (and (featurep 'menubar)
867 current-menubar
869 (not (assoc "F90" current-menubar))) 868 (not (assoc "F90" current-menubar)))
870 (progn 869 (progn
871 (set-buffer-menubar (copy-sequence current-menubar)) 870 (set-buffer-menubar (copy-sequence current-menubar))
872 (add-submenu nil f90-xemacs-menu))) 871 (add-submenu nil f90-xemacs-menu)))))
873 (make-local-variable 'font-lock-keywords) 872 ;; XEmacs: (Don't need a special case, since both emacsen work alike -sb)
874 (setq font-lock-keywords f90-font-lock-keywords)) 873 (make-local-variable 'font-lock-defaults)
875 ;; Emacs 874 (setq font-lock-defaults
876 (make-local-variable 'font-lock-defaults) 875 '((f90-font-lock-keywords f90-font-lock-keywords-1
877 (setq font-lock-defaults '(f90-font-lock-keywords nil t)) 876 f90-font-lock-keywords-2
878 877 f90-font-lock-keywords-3
879 ;; Tell imenu how to handle f90. 878 f90-font-lock-keywords-4)
880 (setq imenu-case-fold-search t) 879 nil t))
881 (make-local-variable 'imenu-generic-expression) 880 ;; Tell imenu how to handle f90.
882 (setq imenu-generic-expression f90-imenu-generic-expression)) 881 (set (make-local-variable 'imenu-case-fold-search) t)
882 (make-local-variable 'imenu-generic-expression)
883 (setq imenu-generic-expression f90-imenu-generic-expression)
883 (run-hooks 'f90-mode-hook) 884 (run-hooks 'f90-mode-hook)
884 (if f90-startup-message 885 (if f90-startup-message
885 (message "Emacs F90 mode; please report bugs to %s" bug-f90-mode)) 886 (message "Emacs F90 mode; please report bugs to %s" bug-f90-mode))
@@ -1015,7 +1016,7 @@ Name is nil if the statement has no label."
1015Name is non-nil only for type." 1016Name is non-nil only for type."
1016 (cond 1017 (cond
1017 ((looking-at f90-type-def-re) 1018 ((looking-at f90-type-def-re)
1018 (list (f90-match-piece 1) (f90-match-piece 3))) 1019 (list (f90-match-piece 1) (f90-match-piece 4)))
1019 ((looking-at "\\(interface\\|block[\t]*data\\)\\>") 1020 ((looking-at "\\(interface\\|block[\t]*data\\)\\>")
1020 (list (f90-match-piece 1) nil)))) 1021 (list (f90-match-piece 1) nil))))
1021 1022