;; We acknowledge many contributions and valuable suggestions by
;; Lawrence R. Dodd, Ralf Fassel, Ralph Finch, Stephen Gildea,
-;; Dr. Anil Gokhale, Ulrich Mueller, Mark Neale, Eric Prestemon,
+;; Dr. Anil Gokhale, Ulrich Mueller, Mark Neale, Eric Prestemon,
;; Gary Sabot and Richard Stallman.
;; This file may be used with GNU Emacs version 18.xx if the following
;; standard comment syntax in an Emacs syntax table (we can for VAX-style).
;; Therefore an unmatched quote in a standard comment will throw fontification
;; off on the wrong track. So we do syntactic fontification with regexps.
-
+\f
;; Regexps done by simon@gnu with help from Ulrik Dickow <dickow@nbi.dk> and
;; probably others Si's forgotten about (sorry).
(defvar fortran-font-lock-keywords fortran-font-lock-keywords-1
"Default expressions to highlight in Fortran mode.")
-
+\f
(defvar fortran-imenu-generic-expression
(list
(list
subroutine\\|entry\\|block\\s-*data\\|program\\)[ \t]+\
\\(\\sw+\\)"
3))
- "imenu generic expression for `imenu-ci-deafult-create-index-function'.")
-(setq fortran-imenu-generic-expression
- (list
- (list
- nil
- ;; Lines are: 1. leading whitespace; 2. function declaration
- ;; with optional type, e.g. `real', `double precision', [which
- ;; will be fooled by `end function' allowed by G77]; 3. untyped
- ;; declarations; 4. the variable to index.
- "^\\s-+\\(\
-\\(\\sw\\|\\s-\\)*\\<function\\|\
-subroutine\\|entry\\|block\\s-*data\\|program\\)[ \t]+\
-\\(\\sw+\\)"
- 3)))
+ "imenu generic expression for `imenu-ci-default-create-index-function'.")
-(defvar fortran-mode-map ()
+(defvar fortran-mode-map ()
"Keymap used in Fortran mode.")
(if fortran-mode-map
()
;;;###autoload
(defun fortran-mode ()
"Major mode for editing Fortran code.
-\\[fortran-indent-line] indents the current Fortran line correctly.
+\\[fortran-indent-line] indents the current Fortran line correctly.
DO statements must not share a common CONTINUE.
Type ;? or ;\\[help-command] to display a list of built-in\
fortran-check-all-num-for-matching-do
Non-nil causes all numbered lines to be treated as possible \"continue\"
statements. (default nil)
- fortran-blink-matching-if
+ fortran-blink-matching-if
Non-nil causes \\[fortran-indent-line] on an ENDIF statement to blink on
matching IF. Also, from an ENDDO statement, blink on matching DO [WHILE]
statement. (default nil)
Single-character string to be inserted in column 5 of a continuation
line. (default \"$\")
fortran-comment-region
- String inserted by \\[fortran-comment-region] at start of each line in
+ String inserted by \\[fortran-comment-region] at start of each line in
region. (default \"c$$$\")
fortran-electric-line-number
- Non-nil causes line number digits to be moved to the correct column
+ Non-nil causes line number digits to be moved to the correct column
as typed. (default t)
fortran-break-before-delimiters
Non-nil causes `fortran-fill' breaks lines before delimiters.
(defun fortran-comment-region (beg-region end-region arg)
"Comments every line in the region.
-Puts fortran-comment-region at the beginning of every line in the region.
-BEG-REGION and END-REGION are args which specify the region boundaries.
+Puts fortran-comment-region at the beginning of every line in the region.
+BEG-REGION and END-REGION are args which specify the region boundaries.
With non-nil ARG, uncomments the region."
(interactive "*r\nP")
(let ((end-region-mark (make-marker)) (save-point (point-marker)))
(set-marker save-point nil)))
\f
(defun fortran-abbrev-start ()
- "Typing ;\\[help-command] or ;? lists all the Fortran abbrevs.
+ "Typing ;\\[help-command] or ;? lists all the Fortran abbrevs.
Any other key combination is executed normally."
(interactive)
(let (c)
format mode, and `fortran-column-ruler-tab' when in TAB format mode.
The key typed is executed unless it is SPC."
(interactive)
- (momentary-string-display
+ (momentary-string-display
(if indent-tabs-mode
fortran-column-ruler-tab
fortran-column-ruler-fixed)
(save-excursion
- (beginning-of-line)
+ (beginning-of-line)
(if (eq (window-start (selected-window))
(window-point (selected-window)))
(progn (forward-line) (point))
(if (save-excursion (beginning-of-line) (looking-at comment-line-start-skip))
(insert "\n" comment-line-start " ")
(if indent-tabs-mode
- (progn
+ (progn
(insert "\n\t")
(insert-char (fortran-numerical-continuation-char) 1))
(insert "\n " fortran-continuation-string)));Space after \n important
Auto-indent does not happen if a numeric arg is used."
(interactive "P")
(if (or arg (not fortran-electric-line-number))
- (if arg
+ (if arg
(self-insert-command (prefix-numeric-value arg))
(self-insert-command 1))
(if (or (and (= 5 (current-column))
(forward-line 1)))
(defun mark-fortran-subprogram ()
- "Put mark at end of Fortran subprogram, point at beginning.
+ "Put mark at end of Fortran subprogram, point at beginning.
The marks are pushed."
(interactive)
(end-of-fortran-subprogram)
(cond ((and continue-test
(not not-first-statement))
(message "Incomplete continuation statement."))
- (continue-test
+ (continue-test
(fortran-previous-statement))
((not not-first-statement)
'first-statement))))
(goto-char enddo-point))))))
(defun fortran-mark-do ()
- "Put mark at end of Fortran DO [WHILE]-ENDDO construct, point at beginning.
+ "Put mark at end of Fortran DO [WHILE]-ENDDO construct, point at beginning.
The marks are pushed."
(interactive)
(let (enddo-point do-point)
((looking-at (regexp-quote fortran-continuation-string))
(if indent-tabs-mode
(progn
- (indent-to
+ (indent-to
(if indent-tabs-mode
fortran-minimum-statement-indent-tab
fortran-minimum-statement-indent-fixed))
(fortran-break-line))
(save-excursion
(if (> (save-excursion
- (goto-char fill-point)
+ (goto-char fill-point)
(current-column))
(+ (calculate-fortran-indent) fortran-continuation-indent))
(progn
(bol (save-excursion (beginning-of-line) (point)))
(eol (save-excursion (end-of-line) (point)))
(comment-string nil))
-
+
(save-excursion
(if (and comment-start-skip (fortran-find-comment-start-skip))
(progn