diff options
| author | Glenn Morris | 2003-04-20 13:01:32 +0000 |
|---|---|---|
| committer | Glenn Morris | 2003-04-20 13:01:32 +0000 |
| commit | 7aee804746bb816e0595c06743e16a6100e4c59d (patch) | |
| tree | a4b6fdb2bd4b5e9c17c6e17af5102e536a3de536 | |
| parent | 3928b9a693901b9f25515307d5e20a0b952f6eef (diff) | |
| download | emacs-7aee804746bb816e0595c06743e16a6100e4c59d.tar.gz emacs-7aee804746bb816e0595c06743e16a6100e4c59d.zip | |
(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.
| -rw-r--r-- | lisp/progmodes/f90.el | 41 |
1 files changed, 25 insertions, 16 deletions
diff --git a/lisp/progmodes/f90.el b/lisp/progmodes/f90.el index b0dbf9dcaea..9a94b1dfb92 100644 --- a/lisp/progmodes/f90.el +++ b/lisp/progmodes/f90.el | |||
| @@ -363,8 +363,8 @@ subroutine\\)\\|use\\|call\\)\\>[ \t]*\\(\\sw+\\)?" | |||
| 363 | (list | 363 | (list |
| 364 | ;; Variable declarations (avoid the real function call). | 364 | ;; Variable declarations (avoid the real function call). |
| 365 | '("^[ \t0-9]*\\(real\\|integer\\|c\\(haracter\\|omplex\\)\\|\ | 365 | '("^[ \t0-9]*\\(real\\|integer\\|c\\(haracter\\|omplex\\)\\|\ |
| 366 | logical\\|type[ \t]*(\\sw+)\\)\\(.*::\\|[ \t]*(.*)\\)?\\([^!\n]*\\)" | 366 | logical\\|type[ \t]*(\\sw+)\\)\\(.*::\\|[ \t]*(.*)\\)?\\([^&!\n]*\\)" |
| 367 | (1 font-lock-type-face t) (4 font-lock-variable-name-face)) | 367 | (1 font-lock-type-face t) (4 font-lock-variable-name-face t)) |
| 368 | ;; do, if, select, where, and forall constructs. | 368 | ;; do, if, select, where, and forall constructs. |
| 369 | '("\\<\\(end[ \t]*\\(do\\|if\\|select\\|forall\\|where\\)\\)\\>\ | 369 | '("\\<\\(end[ \t]*\\(do\\|if\\|select\\|forall\\|where\\)\\)\\>\ |
| 370 | \\([ \t]+\\(\\sw+\\)\\)?" | 370 | \\([ \t]+\\(\\sw+\\)\\)?" |
| @@ -379,6 +379,7 @@ do\\([ \t]*while\\)?\\|select[ \t]*case\\|where\\|forall\\)\\)\\>" | |||
| 379 | '("\\<\\(namelist\\|common\\)[ \t]*\/\\(\\sw+\\)?\/" | 379 | '("\\<\\(namelist\\|common\\)[ \t]*\/\\(\\sw+\\)?\/" |
| 380 | (1 font-lock-keyword-face) (2 font-lock-constant-face nil t)) | 380 | (1 font-lock-keyword-face) (2 font-lock-constant-face nil t)) |
| 381 | "\\<else\\([ \t]*if\\|where\\)?\\>" | 381 | "\\<else\\([ \t]*if\\|where\\)?\\>" |
| 382 | '("\\(&\\)[ \t]*\\(!\\|$\\)" (1 font-lock-keyword-face)) | ||
| 382 | "\\<\\(then\\|continue\\|format\\|include\\|stop\\|return\\)\\>" | 383 | "\\<\\(then\\|continue\\|format\\|include\\|stop\\|return\\)\\>" |
| 383 | '("\\<\\(exit\\|cycle\\)[ \t]*\\(\\sw+\\)?\\>" | 384 | '("\\<\\(exit\\|cycle\\)[ \t]*\\(\\sw+\\)?\\>" |
| 384 | (1 font-lock-keyword-face) (2 font-lock-constant-face nil t)) | 385 | (1 font-lock-keyword-face) (2 font-lock-constant-face nil t)) |
| @@ -819,6 +820,11 @@ not the last line of a continued statement." | |||
| 819 | ;; GM this is not right, eg a continuation line starting with a number. | 820 | ;; GM this is not right, eg a continuation line starting with a number. |
| 820 | ;; Need f90-code-start-position function. | 821 | ;; Need f90-code-start-position function. |
| 821 | ;; And yet, things seems to work with this... | 822 | ;; And yet, things seems to work with this... |
| 823 | ;; cf f90-indent-line | ||
| 824 | ;; (beginning-of-line) ; digits after & \n are not line-nos | ||
| 825 | ;; (if (not (save-excursion (and (f90-previous-statement) | ||
| 826 | ;; (f90-line-continued)))) | ||
| 827 | ;; (f90-indent-line-no) | ||
| 822 | (defsubst f90-current-indentation () | 828 | (defsubst f90-current-indentation () |
| 823 | "Return indentation of current line. | 829 | "Return indentation of current line. |
| 824 | Line-numbers are considered whitespace characters." | 830 | Line-numbers are considered whitespace characters." |
| @@ -1134,7 +1140,9 @@ Return (TYPE NAME), or nil if not found." | |||
| 1134 | "Move point to the end of the current subprogram. | 1140 | "Move point to the end of the current subprogram. |
| 1135 | Return (TYPE NAME), or nil if not found." | 1141 | Return (TYPE NAME), or nil if not found." |
| 1136 | (interactive) | 1142 | (interactive) |
| 1137 | (let ((count 1) (case-fold-search t) matching-end) | 1143 | (let ((case-fold-search t) |
| 1144 | (count 1) | ||
| 1145 | matching-end) | ||
| 1138 | (end-of-line) | 1146 | (end-of-line) |
| 1139 | (while (and (> count 0) | 1147 | (while (and (> count 0) |
| 1140 | (re-search-forward f90-program-block-re nil 'move)) | 1148 | (re-search-forward f90-program-block-re nil 'move)) |
| @@ -1350,7 +1358,8 @@ after indenting." | |||
| 1350 | (and (< (point) pos) | 1358 | (and (< (point) pos) |
| 1351 | (goto-char pos)) | 1359 | (goto-char pos)) |
| 1352 | (if auto-fill-function | 1360 | (if auto-fill-function |
| 1353 | (f90-do-auto-fill) ; also updates line | 1361 | ;; GM NO-UPDATE not honoured, since this calls f90-update-line. |
| 1362 | (f90-do-auto-fill) | ||
| 1354 | (or no-update (f90-update-line))) | 1363 | (or no-update (f90-update-line))) |
| 1355 | (set-marker pos nil))) | 1364 | (set-marker pos nil))) |
| 1356 | 1365 | ||
| @@ -1361,17 +1370,15 @@ If run in the middle of a line, the line is not broken." | |||
| 1361 | (interactive "*") | 1370 | (interactive "*") |
| 1362 | (if abbrev-mode (expand-abbrev)) | 1371 | (if abbrev-mode (expand-abbrev)) |
| 1363 | (beginning-of-line) ; reindent where likely to be needed | 1372 | (beginning-of-line) ; reindent where likely to be needed |
| 1364 | (f90-indent-line-no) | 1373 | (f90-indent-line) ; calls indent-line-no, update-line |
| 1365 | (f90-indent-line 'no-update) | ||
| 1366 | (end-of-line) | 1374 | (end-of-line) |
| 1367 | (delete-horizontal-space) ; destroy trailing whitespace | 1375 | (delete-horizontal-space) ; destroy trailing whitespace |
| 1368 | (let ((string (f90-in-string)) | 1376 | (let ((string (f90-in-string)) |
| 1369 | (cont (f90-line-continued))) | 1377 | (cont (f90-line-continued))) |
| 1370 | (and string (not cont) (insert "&")) | 1378 | (and string (not cont) (insert "&")) |
| 1371 | (f90-update-line) | ||
| 1372 | (newline) | 1379 | (newline) |
| 1373 | (if (or string (and cont f90-beginning-ampersand)) (insert "&"))) | 1380 | (if (or string (and cont f90-beginning-ampersand)) (insert "&"))) |
| 1374 | (f90-indent-line 'no-update)) | 1381 | (f90-indent-line 'no-update)) ; nothing to update |
| 1375 | 1382 | ||
| 1376 | 1383 | ||
| 1377 | (defun f90-indent-region (beg-region end-region) | 1384 | (defun f90-indent-region (beg-region end-region) |
| @@ -1684,16 +1691,18 @@ Leave point at the end of line." | |||
| 1684 | (defun f90-abbrev-start () | 1691 | (defun f90-abbrev-start () |
| 1685 | "Typing `\\[help-command] or `? lists all the F90 abbrevs. | 1692 | "Typing `\\[help-command] or `? lists all the F90 abbrevs. |
| 1686 | Any other key combination is executed normally." | 1693 | Any other key combination is executed normally." |
| 1687 | (interactive) | 1694 | (interactive "*") |
| 1688 | (let (c) | 1695 | (insert last-command-char) |
| 1689 | (insert last-command-char) | 1696 | (let (char event) |
| 1690 | (setq c (if (fboundp 'next-command-event) ; XEmacs | 1697 | (if (fboundp 'next-command-event) ; XEmacs |
| 1691 | (event-to-character (next-command-event)) | 1698 | (setq event (next-command-event) |
| 1692 | (read-event))) | 1699 | char (event-to-character event)) |
| 1700 | (setq event (read-event) | ||
| 1701 | char event)) | ||
| 1693 | ;; Insert char if not equal to `?', or if abbrev-mode is off. | 1702 | ;; Insert char if not equal to `?', or if abbrev-mode is off. |
| 1694 | (if (and abbrev-mode (or (eq c ??) (eq c help-char))) | 1703 | (if (and abbrev-mode (or (eq char ??) (eq char help-char))) |
| 1695 | (f90-abbrev-help) | 1704 | (f90-abbrev-help) |
| 1696 | (setq unread-command-events (list c))))) | 1705 | (setq unread-command-events (list event))))) |
| 1697 | 1706 | ||
| 1698 | (defun f90-abbrev-help () | 1707 | (defun f90-abbrev-help () |
| 1699 | "List the currently defined abbrevs in F90 mode." | 1708 | "List the currently defined abbrevs in F90 mode." |