comparison lisp/progmodes/f90.el @ 15244:be4d30237fe6

Delete the hilit19 support--it doesn't work. (f90-face-*, f90-auto-hilit19, f90-hilit-patterns): Vars deleted. (f90-mode, f90-update-line): Delete the hilit19 support code.
author Karl Heuer <kwzh@gnu.org>
date Fri, 17 May 1996 21:02:41 +0000
parents 5be55ce2c9fa
children f11b2bfc1275
comparison
equal deleted inserted replaced
15243:c024dca549c5 15244:be4d30237fe6
186 "*Non-nil causes `f90-do-auto-fill' to break lines before delimiters.") 186 "*Non-nil causes `f90-do-auto-fill' to break lines before delimiters.")
187 187
188 (defvar f90-auto-keyword-case nil 188 (defvar f90-auto-keyword-case nil
189 "*Automatic case conversion of keywords. 189 "*Automatic case conversion of keywords.
190 The options are 'downcase-word, 'upcase-word, 'capitalize-word and nil") 190 The options are 'downcase-word, 'upcase-word, 'capitalize-word and nil")
191
192 (defvar f90-auto-hilit19 t
193 "*Automatic highlight of line at every indent or newline (for hilit19).")
194 191
195 (defvar f90-leave-line-no nil 192 (defvar f90-leave-line-no nil
196 "*If nil, left-justify linenumbers.") 193 "*If nil, left-justify linenumbers.")
197 194
198 (defvar f90-startup-message t 195 (defvar f90-startup-message t
438 "Highlights all F90 and HPF keywords.") 435 "Highlights all F90 and HPF keywords.")
439 436
440 (defvar f90-font-lock-keywords 437 (defvar f90-font-lock-keywords
441 f90-font-lock-keywords-2 438 f90-font-lock-keywords-2
442 "*Default expressions to highlight in F90 mode.") 439 "*Default expressions to highlight in F90 mode.")
443
444 ;; hilit19 customization and expressions
445 (defvar f90-face-string 'named-param "*Face for strings.")
446 (defvar f90-face-comment 'comment "*Face for comments.")
447 (defvar f90-face-decl 'include "*Face for declarations.")
448 (defvar f90-face-prog 'defun "*Face for program blocks.")
449 (defvar f90-face-label 'Tomato-bold "*Face for labels.")
450 (defvar f90-face-type 'defun "*Face for type blocks.")
451 (defvar f90-face-interface 'defun "*Face for interface blocks.")
452 (defvar f90-face-contains 'defun "*Face for contains statement.")
453 (defvar f90-face-do 'SteelBlue-bold "*Face for do-structure.")
454 (defvar f90-face-if 'define "*Face for if-structure.")
455 (defvar f90-face-select 'define "*Face for select-case structure.")
456 (defvar f90-face-stop 'defun "*Face for stop and return.")
457 (defvar f90-face-exit 'SteelBlue-bold "*Face for exit and cycle.")
458 (defvar f90-face-keyword 'struct "*Face for keywords.")
459 (defvar f90-face-intrinsics 'struct "*Face for intrinsic procedures.")
460 ;; Highlighting for HPF (High-Peformance Fortran)
461 (defvar f90-face-hpf-procedures 'struct "*Face for hpf procedures.")
462 (defvar f90-face-hpf-directives 'struct "*Face for hpf directives.")
463 (defvar f90-face-hpf-keywords 'struct "*Face for hpf keywords.")
464
465 (defvar f90-hilit-patterns
466 (list
467 ;; Allow for strings delimited by ' and by " and for multirow strings.
468 ;; A multi-row string includes &\n& (+ possible whitespace and comments)
469 (list (concat
470 "\\(\"[^\"\n]*\\(&[ \t]*\\(![^\n]*\\)?\n[ \t]*&[^\"\n]*\\)*\""
471 "\\|'[^'\n]*\\(&[ \t]*\\(![^\n]*\\)?\n[ \t]*&[^'\n]*\\)*'\\)")
472 nil f90-face-string)
473 (list "!" "$" f90-face-comment)
474 (list "\\(\\(real\\|integer\\|character\\|complex\\|logical\
475 \\|type[ \t]*(\\sw+)\\).*\\)::" 1 f90-face-decl)
476 (list "implicit[ \t]*none" nil f90-face-decl)
477 (list "^[ \t]*\\(program\\|module\\)[ \t]+\\sw+" 1 f90-face-prog)
478 (list "^[ \t]*\\(program\\|module\\)[ \t]+\\(\\sw+\\)" 2 f90-face-label)
479 (list "\\(^.*\\(function\\|subroutine\\)\\)[ \t]+\\sw+" 1
480 f90-face-prog)
481 (list "^.*\\(function\\|subroutine\\)[ \t]+\\(\\sw+\\)" 2
482 f90-face-label)
483 (list "^[ \t]*end[ \t]*\\(program\\|module\\|function\
484 \\|subroutine\\|type\\)" nil f90-face-prog)
485 (list (concat "^[ \t]*end[ \t]*\\(program\\|module\\|function\\|"
486 "subroutine\\|type\\)[ \t]+\\(\\sw+\\)") 2 f90-face-label)
487 (list "^[ \t]*\\(type\\)[ \t]+\\sw+" 1 f90-face-type)
488 (list "^[ \t]*type[ \t]+\\(\\sw+\\)" 1 f90-face-label)
489 (list "^[ \t]*\\(type[ \t]*,[ \t]*\\(private\\|public\\)\\)[ \t]*::[ \t]*\\(\\sw+\\)" 1 f90-face-type)
490 (list "^[ \t]*\\(type[ \t]*,[ \t]*\\(private\\|public\\)\\)[ \t]*::[ \t]*\\(\\sw+\\)" 3 f90-face-label)
491 (list "^[ \t]*\\(end[ \t]*\\)?interface\\>" nil f90-face-interface)
492 (list "^[ \t]*contains\\>" nil f90-face-contains)
493 (list "^[ \t]*\\(\\sw+[ \t]*:[ \t]*\\)?\\(do\\([ \t]*while\\)?\\)\\>"
494 2 f90-face-do)
495 (list "^[ \t]*\\(\\sw+\\)[ \t]*:[ \t]*\\(do\\([ \t]*while\\)?\\)\\>" 1
496 f90-face-label)
497 (list "^[ \t]*\\(end[ \t]*do\\)\\>" 1 f90-face-do)
498 (list "^[ \t]*end[ \t]*do[ \t]+\\(\\sw+\\)" 1 f90-face-label)
499 (list "^[ \t]*\\(\\sw+[ \t]*:[ \t]*\\)?\\(if\\)\\>" 2 f90-face-if)
500 (list "^[ \t]*\\(\\sw+\\)[ \t]*:[ \t]*if\\>" 1 f90-face-label)
501 (list "^[ \t]*\\(end[ \t]*if\\)\\>" 1 f90-face-if)
502 (list "^[ \t]*end[ \t]*if[ \t]+\\(\\sw+\\)" 1 f90-face-label)
503 (list "^[ \t]*\\(\\sw+[ \t]*:[ \t]*\\)?\\(select[ \t]*case\\)\\>" 2
504 f90-face-select)
505 (list "^[ \t]*\\(\\sw+\\)[ \t]*:[ \t]*\\(select[ \t]*case\\)\\>" 1
506 f90-face-label)
507 (list "^[ \t]*end[ \t]*select\\>" nil f90-face-select)
508 (list "^[ \t]*end[ \t]*select\\>[ \t]+\\(\\sw+\\)" 1 f90-face-label)
509 (list "\\(where\\|forall\\)[ \t]*(" 1 f90-face-if)
510 (list "\\<\\(elsewhere\\|else\\|else[ \t]*if\\)\\>" nil f90-face-if)
511 (list "\\<end[ \t]*\\(where\\|forall\\)\\>" nil f90-face-if)
512 (list "\\<then\\>" nil f90-face-if)
513 (list "\\<\\(exit\\|cycle\\)\\>" nil f90-face-exit)
514 (list "\\<\\(exit\\|cycle\\)[ \t]*\\sw+\\>" nil f90-face-label)
515 (list "\\<\\(stop\\|return\\)\\>" nil f90-face-stop)
516 (list "^[ \t]*\\(case\\)[ \t]*\\((\\|default\\)" 1 f90-face-select)
517 (list (concat "\\<\\("(mapconcat 'identity f90-keywords-re "\\|")
518 "\\)\\>") nil f90-face-keyword)
519 (list (concat "\\<\\("(mapconcat 'identity f90-procedures-re "\\|")
520 "\\)\\>") nil f90-face-intrinsics)
521 ;;; (list (concat "\\<\\("(mapconcat 'identity f90-hpf-procedures "\\|")
522 ;;; "\\)\\>") nil f90-face-hpf-procedures)
523 ;;; (list (concat "\\<\\("(mapconcat 'identity f90-hpf-directives "\\|")
524 ;;; "\\)\\>") nil f90-face-hpf-directives)
525 (list (concat "\\<\\("(mapconcat 'identity f90-hpf-keywords-re "\\|")
526 "\\)\\>") nil f90-face-hpf-keywords)))
527 440
528 ;; syntax table 441 ;; syntax table
529 (defvar f90-mode-syntax-table nil 442 (defvar f90-mode-syntax-table nil
530 "Syntax table in use in F90 mode buffers.") 443 "Syntax table in use in F90 mode buffers.")
531 444
829 (make-local-variable 'comment-indent-function) 742 (make-local-variable 'comment-indent-function)
830 (setq comment-indent-function 'f90-comment-indent) 743 (setq comment-indent-function 'f90-comment-indent)
831 (make-local-variable 'abbrev-all-caps) 744 (make-local-variable 'abbrev-all-caps)
832 (setq abbrev-all-caps t) 745 (setq abbrev-all-caps t)
833 (setq indent-tabs-mode nil) 746 (setq indent-tabs-mode nil)
834
835 (if (fboundp 'hilit-set-mode-patterns)
836 (hilit-set-mode-patterns
837 'f90-mode f90-hilit-patterns nil 'case-insensitive))
838 ;; Setting up things for font-lock 747 ;; Setting up things for font-lock
839 (if (string-match "Xemacs" emacs-version) 748 (if (string-match "Xemacs" emacs-version)
840 (progn 749 (progn
841 (put 'f90-mode 'font-lock-keywords-case-fold-search t) 750 (put 'f90-mode 'font-lock-keywords-case-fold-search t)
842 (if (and current-menubar 751 (if (and current-menubar
1065 (let (bol eol) 974 (let (bol eol)
1066 (if f90-auto-keyword-case 975 (if f90-auto-keyword-case
1067 (progn (setq bol (f90-get-beg-of-line) 976 (progn (setq bol (f90-get-beg-of-line)
1068 eol (f90-get-end-of-line)) 977 eol (f90-get-end-of-line))
1069 (if f90-auto-keyword-case 978 (if f90-auto-keyword-case
1070 (f90-change-keywords f90-auto-keyword-case bol eol) 979 (f90-change-keywords f90-auto-keyword-case bol eol))))))
1071 (if (and f90-auto-hilit19 (fboundp 'hilit-rehighlight-region))
1072 (hilit-rehighlight-region bol eol t)))))))
1073 980
1074 (defun f90-get-correct-indent () 981 (defun f90-get-correct-indent ()
1075 "Get correct indent for a line starting with line number. 982 "Get correct indent for a line starting with line number.
1076 Does not check type and subprogram indentation." 983 Does not check type and subprogram indentation."
1077 (let ((epnt (f90-get-end-of-line)) icol cont) 984 (let ((epnt (f90-get-end-of-line)) icol cont)
1516 1423
1517 (defun f90-fill-region (beg-region end-region) 1424 (defun f90-fill-region (beg-region end-region)
1518 "Fill every line in region by forward parsing. Join lines if possible." 1425 "Fill every line in region by forward parsing. Join lines if possible."
1519 (interactive "*r") 1426 (interactive "*r")
1520 (let ((end-region-mark (make-marker)) 1427 (let ((end-region-mark (make-marker))
1521 (f90-auto-hilit19 nil)
1522 (f90-smart-end nil) (f90-auto-keyword-case nil) indent (go-on t) 1428 (f90-smart-end nil) (f90-auto-keyword-case nil) indent (go-on t)
1523 (af-function auto-fill-function) (auto-fill-function nil)) 1429 (af-function auto-fill-function) (auto-fill-function nil))
1524 (set-marker end-region-mark end-region) 1430 (set-marker end-region-mark end-region)
1525 (goto-char beg-region) 1431 (goto-char beg-region)
1526 (while go-on 1432 (while go-on