# HG changeset patch # User Dave Love # Date 915546030 0 # Node ID bbe0c369b955a032477ae095da0997f423244206 # Parent aa6eab250ce8466b98f4afdf1b5d6d62edbb966a 1999-01-05 Dave Love * progmodes/f90.el (f90-mode): Make imenu-case-fold-search buffer-local. 1998-01-05 Torbjorn Einarsson * f90.el: Change of regular expressions for type to correct high-lighting and identation. Some small fixes for compatibility with XEmacs. diff -r aa6eab250ce8 -r bbe0c369b955 lisp/progmodes/f90.el --- a/lisp/progmodes/f90.el Tue Jan 05 09:46:03 1999 +0000 +++ b/lisp/progmodes/f90.el Tue Jan 05 14:20:30 1999 +0000 @@ -3,7 +3,7 @@ ;; Copyright (C) 1995, 1996, 1997 Free Software Foundation, Inc. ;; Author: Torbj\"orn Einarsson -;; Last Change: May 29 1997 +;; Last Change: Dec 29 1998 ;; Keywords: fortran, f90, languages ;; This file is part of GNU Emacs. @@ -367,7 +367,7 @@ ;; Highlighting patterns (defvar f90-font-lock-keywords-1 - (list ; Emacs + (list '("\\<\\(end[ \t]*\\(program\\|module\\|function\\|subroutine\\|type\\)\\)\\>[ \t]*\\(\\sw+\\)?" (1 font-lock-keyword-face) (3 font-lock-function-name-face nil t)) '("\\<\\(program\\|call\\|module\\|subroutine\\|function\\|use\\)\\>[ \t]*\\(\\sw+\\)?" @@ -375,7 +375,7 @@ ;; Special highlighting of "module procedure foo-list" '("\\<\\(module[ \t]*procedure\\)\\>" (1 font-lock-keyword-face t)) ;; Highlight definition of new type - '("\\<\\(type\\)[ \t]*\\(,.*::[ \t]*\\|[ \t]+\\)\\(\\sw+\\)" + '("\\<\\(type\\)[ \t]*\\(.*::[ \t]*\\|[ \t]+\\)\\(\\sw+\\)" (1 font-lock-keyword-face) (3 font-lock-function-name-face)) "\\<\\(\\(end[ \t]*\\)?\\(interface\\|block[ \t]*data\\)\\|contains\\)\\>") "This does fairly subdued highlighting of comments and function calls.") @@ -410,11 +410,9 @@ (list f90-keywords-level-3-re f90-operators-re - (if (string-match "XEmacs" emacs-version) - (append (list f90-procedures-re) '(1 font-lock-keyword-face t)) - (list f90-procedures-re '(1 font-lock-keyword-face t))) - "\\" ; Avoid overwriting real defs. - )) + (list f90-procedures-re '(1 font-lock-keyword-face t)) + "\\" ; Avoid overwriting real defs. + )) "Highlights all F90 keywords and intrinsic procedures.") (defvar f90-font-lock-keywords-4 @@ -658,7 +656,7 @@ (defconst f90-end-type-re "end[ \t]*\\(type\\|interface\\|block[ \t]*data\\)") (defconst f90-type-def-re - "\\<\\(type\\)[ \t]*\\(,.*::[ \t]*\\|[ \t]+\\)\\(\\sw+\\)") + "\\<\\(type\\)\\([^(\n]*\\)\\(::\\)?[ \t]*\\b\\(\\sw+\\)") (defconst f90-no-break-re "\\(\\*\\*\\|//\\|=>\\)") ;; A temporary position to make region operators faster (defvar f90-cache-position nil) @@ -865,21 +863,24 @@ (if (string-match "XEmacs" emacs-version) (progn (put 'f90-mode 'font-lock-keywords-case-fold-search t) - (if (and current-menubar + (if (and (featurep 'menubar) + current-menubar (not (assoc "F90" current-menubar))) (progn (set-buffer-menubar (copy-sequence current-menubar)) - (add-submenu nil f90-xemacs-menu))) - (make-local-variable 'font-lock-keywords) - (setq font-lock-keywords f90-font-lock-keywords)) - ;; Emacs - (make-local-variable 'font-lock-defaults) - (setq font-lock-defaults '(f90-font-lock-keywords nil t)) - - ;; Tell imenu how to handle f90. - (setq imenu-case-fold-search t) - (make-local-variable 'imenu-generic-expression) - (setq imenu-generic-expression f90-imenu-generic-expression)) + (add-submenu nil f90-xemacs-menu))))) + ;; XEmacs: (Don't need a special case, since both emacsen work alike -sb) + (make-local-variable 'font-lock-defaults) + (setq font-lock-defaults + '((f90-font-lock-keywords f90-font-lock-keywords-1 + f90-font-lock-keywords-2 + f90-font-lock-keywords-3 + f90-font-lock-keywords-4) + nil t)) + ;; Tell imenu how to handle f90. + (set (make-local-variable 'imenu-case-fold-search) t) + (make-local-variable 'imenu-generic-expression) + (setq imenu-generic-expression f90-imenu-generic-expression) (run-hooks 'f90-mode-hook) (if f90-startup-message (message "Emacs F90 mode; please report bugs to %s" bug-f90-mode)) @@ -1015,7 +1016,7 @@ Name is non-nil only for type." (cond ((looking-at f90-type-def-re) - (list (f90-match-piece 1) (f90-match-piece 3))) + (list (f90-match-piece 1) (f90-match-piece 4))) ((looking-at "\\(interface\\|block[\t]*data\\)\\>") (list (f90-match-piece 1) nil))))