changeset 50647:5773e914b2ed

(f90-font-lock-keywords-2): Use override for font-lock-variable-name-face in declarations (so that strings in declarations are over-ridden). Highlight continuation characters. (f90-indent-new-line): Remove direct call to f90-indent-line-no, f90-update-line, since f90-indent-line calls these. (f90-abbrev-start): Fix XEmacs compatibility.
author Glenn Morris <rgm@gnu.org>
date Sun, 20 Apr 2003 13:01:32 +0000
parents 1ce282fd32cf
children 5b37299dac0a
files lisp/progmodes/f90.el
diffstat 1 files changed, 25 insertions(+), 16 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/progmodes/f90.el	Sun Apr 20 00:02:37 2003 +0000
+++ b/lisp/progmodes/f90.el	Sun Apr 20 13:01:32 2003 +0000
@@ -363,8 +363,8 @@
    (list
     ;; Variable declarations (avoid the real function call).
     '("^[ \t0-9]*\\(real\\|integer\\|c\\(haracter\\|omplex\\)\\|\
-logical\\|type[ \t]*(\\sw+)\\)\\(.*::\\|[ \t]*(.*)\\)?\\([^!\n]*\\)"
-      (1 font-lock-type-face t) (4 font-lock-variable-name-face))
+logical\\|type[ \t]*(\\sw+)\\)\\(.*::\\|[ \t]*(.*)\\)?\\([^&!\n]*\\)"
+      (1 font-lock-type-face t) (4 font-lock-variable-name-face t))
     ;; do, if, select, where, and forall constructs.
     '("\\<\\(end[ \t]*\\(do\\|if\\|select\\|forall\\|where\\)\\)\\>\
 \\([ \t]+\\(\\sw+\\)\\)?"
@@ -379,6 +379,7 @@
     '("\\<\\(namelist\\|common\\)[ \t]*\/\\(\\sw+\\)?\/"
       (1 font-lock-keyword-face) (2 font-lock-constant-face nil t))
     "\\<else\\([ \t]*if\\|where\\)?\\>"
+    '("\\(&\\)[ \t]*\\(!\\|$\\)"  (1 font-lock-keyword-face))
     "\\<\\(then\\|continue\\|format\\|include\\|stop\\|return\\)\\>"
     '("\\<\\(exit\\|cycle\\)[ \t]*\\(\\sw+\\)?\\>"
       (1 font-lock-keyword-face) (2 font-lock-constant-face nil t))
@@ -819,6 +820,11 @@
 ;; GM this is not right, eg a continuation line starting with a number.
 ;; Need f90-code-start-position function.
 ;; And yet, things seems to work with this...
+;; cf f90-indent-line
+;;     (beginning-of-line)           ; digits after & \n are not line-nos
+;;     (if (not (save-excursion (and (f90-previous-statement)
+;;                                   (f90-line-continued))))
+;;         (f90-indent-line-no)
 (defsubst f90-current-indentation ()
   "Return indentation of current line.
 Line-numbers are considered whitespace characters."
@@ -1134,7 +1140,9 @@
   "Move point to the end of the current subprogram.
 Return (TYPE NAME), or nil if not found."
   (interactive)
-  (let ((count 1) (case-fold-search t) matching-end)
+  (let ((case-fold-search t)
+        (count 1) 
+        matching-end)
     (end-of-line)
     (while (and (> count 0)
 		(re-search-forward f90-program-block-re nil 'move))
@@ -1350,7 +1358,8 @@
     (and (< (point) pos)
          (goto-char pos))
     (if auto-fill-function
-        (f90-do-auto-fill)              ; also updates line
+        ;; GM NO-UPDATE not honoured, since this calls f90-update-line.
+        (f90-do-auto-fill)
       (or no-update (f90-update-line)))
     (set-marker pos nil)))
 
@@ -1361,17 +1370,15 @@
   (interactive "*")
   (if abbrev-mode (expand-abbrev))
   (beginning-of-line)             ; reindent where likely to be needed
-  (f90-indent-line-no)
-  (f90-indent-line 'no-update)
+  (f90-indent-line)                ; calls indent-line-no, update-line
   (end-of-line)
   (delete-horizontal-space)		; destroy trailing whitespace
   (let ((string (f90-in-string))
         (cont (f90-line-continued)))
     (and string (not cont) (insert "&"))
-    (f90-update-line)
     (newline)
     (if (or string (and cont f90-beginning-ampersand)) (insert "&")))
-  (f90-indent-line 'no-update))
+  (f90-indent-line 'no-update))         ; nothing to update
 
 
 (defun f90-indent-region (beg-region end-region)
@@ -1684,16 +1691,18 @@
 (defun f90-abbrev-start ()
   "Typing `\\[help-command] or `? lists all the F90 abbrevs.
 Any other key combination is executed normally."
-  (interactive)
-  (let (c)
-    (insert last-command-char)
-    (setq c (if (fboundp 'next-command-event) ; XEmacs
-                (event-to-character (next-command-event))
-              (read-event)))
+  (interactive "*")
+  (insert last-command-char)
+  (let (char event)
+    (if (fboundp 'next-command-event) ; XEmacs
+        (setq event (next-command-event)
+              char (event-to-character event))
+      (setq event (read-event)
+            char event))
     ;; Insert char if not equal to `?', or if abbrev-mode is off.
-    (if (and abbrev-mode (or (eq c ??) (eq c help-char)))
+    (if (and abbrev-mode (or (eq char ??) (eq char help-char)))
 	(f90-abbrev-help)
-      (setq unread-command-events (list c)))))
+      (setq unread-command-events (list event)))))
 
 (defun f90-abbrev-help ()
   "List the currently defined abbrevs in F90 mode."