annotate lisp/modes/fortran-misc.el @ 153:25f70ba0133c r20-3b3

Import from CVS: tag r20-3b3
author cvs
date Mon, 13 Aug 2007 09:38:25 +0200
parents 376386a54a3c
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1 ;;; fortran-misc.el --- Routines than can be used with fortran mode.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3 ;;; Copyright (c) 1992 Free Software Foundation, Inc.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
5 ;; Author: Various authors.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
6 ;; Maintainer:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
7 ;; Version
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
8 ;; Keywords: languages
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
9
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
10 ;; This file is not part of GNU Emacs.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
11
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
12 ;; GNU Emacs is free software; you can redistribute it and/or modify
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
13 ;; it under the terms of the GNU General Public License as published by
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
14 ;; the Free Software Foundation; either version 2, or (at your option)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
15 ;; any later version.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
16
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
17 ;; GNU Emacs is distributed in the hope that it will be useful,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
18 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
19 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
20 ;; GNU General Public License for more details.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
21
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
22 ;; You should have received a copy of the GNU General Public License
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
23 ;; along with GNU Emacs; see the file COPYING. If not, write to
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
24 ;; the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
25
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
26 ;;; Commentary:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
27
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
28 ;;; This file contains various routines that may be useful with GNU emacs
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
29 ;;; fortran mode, but just don't seem to fit in.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
30
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
31 (defun fortran-fill-statement ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
32 "Fill a fortran statement up to `fill-column'."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
33 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
34 (if (save-excursion
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
35 (beginning-of-line)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
36 (or (looking-at "[ \t]*$")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
37 (looking-at comment-line-start-skip)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
38 (and comment-start-skip
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
39 (looking-at (concat "[ \t]*" comment-start-skip)))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
40 (fortran-indent-line)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
41 (let ((opos (point)) (beg) (cfi))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
42 (save-excursion
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
43 (fortran-next-statement)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
44 (fortran-previous-statement)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
45 (setq cfi (calculate-fortran-indent))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
46 (setq beg (point)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
47 (save-excursion
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
48 (goto-char beg)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
49 (save-excursion
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
50 ;;(beginning-of-line)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
51 (if (or (not (= cfi (fortran-current-line-indentation)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
52 (and (re-search-forward "^[ \t]*[0-9]+" (+ (point) 4) t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
53 (not (fortran-line-number-indented-correctly-p))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
54 (fortran-indent-to-column cfi)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
55 (while (progn
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
56 (forward-line 1)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
57 (or (looking-at " [^ 0\n]")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
58 (looking-at "\t[1-9]")))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
59 (delete-indentation)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
60 (delete-char 2)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
61 (delete-horizontal-space))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
62 (fortran-previous-statement)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
63 (if (> (save-excursion (end-of-line) (current-column)) fill-column)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
64 (fortran-do-auto-fill)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
65 (if (< (point) opos) (goto-char opos))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
66 (let ((cfi (calculate-fortran-indent)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
67 (if (< (current-column) cfi)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
68 (move-to-column cfi))))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
69
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
70 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
71 ;;; The upcase/downcase and beautifier code is originally from Ralph Finch
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
72 ;;; (rfinch@water.ca.gov).
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
73 ;;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
74 (defun fortran-downcase-subprogram ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
75 "Properly downcases the Fortran subprogram which contains point."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
76 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
77 (save-excursion
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
78 (mark-fortran-subprogram)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
79 (message "Downcasing subprogram...")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
80 (fortran-downcase-region (point) (mark)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
81 (message "Downcasing subprogram...done."))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
82
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
83 (defun fortran-downcase-region (start end)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
84 "Downcase region, excluding comment lines and anything
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
85 between quote marks."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
86 (interactive "r")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
87 (fortran-case-region start end nil))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
88
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
89 (defun fortran-upcase-region (start end)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
90 "Upcase region, excluding comment lines and anything
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
91 between quote marks."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
92 (interactive "r")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
93 (fortran-case-region start end t))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
94
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
95 (defun fortran-upcase-subprogram ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
96 "Properly upcases the Fortran subprogram which contains point."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
97 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
98 (save-excursion
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
99 (mark-fortran-subprogram)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
100 (message "Upcasing subprogram...")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
101 (fortran-upcase-region (point) (mark)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
102 (message "Upcasing subprogram...done."))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
103
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
104 (defun fortran-case-region (start end up)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
105 "Upcase region if UP is t, downcase, if UP downcase region,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
106 excluding comment lines and anything between quote marks."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
107 (let* ((start-re-comment "^[cC*#]")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
108 (end-re-comment "$")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
109 (start-re-quote "'")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
110 (end-re-quote "\\('\\|$\\)")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
111 (start-re-dquote (char-to-string ?\"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
112 (end-re-dquote (concat "\\(" start-re-dquote "\\|$\\)"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
113 (strt) (fin))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
114 (save-excursion
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
115 (save-restriction
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
116 (narrow-to-region start end)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
117 (goto-char (point-min))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
118 (if (inside-re start-re-comment end-re-comment)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
119 (re-search-forward end-re-comment end 0))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
120 (if (inside-re start-re-quote end-re-quote)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
121 (re-search-forward end-re-quote end 0))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
122 (if (inside-re start-re-dquote end-re-dquote)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
123 (re-search-forward end-re-dquote end 0))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
124 (setq strt (point))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
125 (while (< (point) (point-max))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
126 (re-search-forward
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
127 (concat "\\(" start-re-comment "\\|"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
128 start-re-quote "\\|" start-re-dquote "\\)") end 0)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
129 (setq fin (point))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
130 (if up
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
131 (upcase-region strt fin)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
132 (downcase-region strt fin))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
133 (if (inside-re start-re-comment end-re-comment)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
134 (re-search-forward end-re-comment end 0))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
135 (if (inside-re start-re-quote end-re-quote)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
136 (re-search-forward end-re-quote end 0))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
137 (if (inside-re start-re-dquote end-re-dquote)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
138 (re-search-forward end-re-dquote end 0))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
139 (setq strt (point)))))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
140
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
141 (defun inside-re (start-re end-re)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
142 "Returns t if inside a starting regexp and an ending regexp
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
143 on the same line."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
144 (interactive "s")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
145 (let ((start-line) (end-line))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
146 (save-excursion
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
147 (setq start-line (progn (beginning-of-line) (point)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
148 (setq end-line (progn (end-of-line) (point))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
149 (if (and (save-excursion
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
150 (re-search-backward start-re start-line t))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
151 (save-excursion
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
152 (re-search-forward end-re end-line t)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
153 t
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
154 nil)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
155
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
156 ;;; Note: Just as with some other routines, fortran-beautify-line
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
157 ;;; assumes trailing blanks are not significant. Code may need
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
158 ;;; to be adjusted to comply with this.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
159
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
160
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
161 (defun fortran-beautify-subprogram (&optional downit)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
162 "Beautify Fortran subprogram:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
163 1) Remove trailing blanks.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
164 2) Replace all continuation characters with fortran-continuation-char.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
165 3) Replace all empty comment lines with blank lines.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
166 4) Replace all multiple blank lines with one blank line.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
167 5) Indent.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
168 6) With prefix arg, downcase the subprogram, avoiding comments and
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
169 quoted strings."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
170 (interactive "P")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
171 (save-excursion
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
172 (mark-fortran-subprogram)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
173 (message "Beautifying subprogram...")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
174 (fortran-beautify-region (point) (mark) downit))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
175 (message "Beautify subprogram...done."))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
176
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
177 (defun fortran-beautify-region (start end &optional downit)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
178 "Beautify region in a Fortran program:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
179 1) Remove trailing blanks.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
180 2) Replace all continuation characters with fortran-continuation-char.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
181 3) Replace all empty comment lines with blank lines.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
182 4) Replace all multiple blank lines with one blank line.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
183 5) Indent.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
184 6) With prefix arg, downcase the region, avoiding comments and
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
185 quoted strings."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
186 (interactive "r\nP")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
187 (save-excursion
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
188 (save-restriction
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
189 (let ((m1 (make-marker))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
190 (m2 (make-marker)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
191 (set-marker m1 start)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
192 (set-marker m2 end)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
193 (indent-region start end nil)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
194 (narrow-to-region m1 m2)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
195 (goto-char (point-min)) ; trailing blanks
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
196 (perform-replace "[ \t]+$" "" nil t nil)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
197 (goto-char (point-min)) ; continuation characters
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
198 (perform-replace (concat "^ [^ " fortran-continuation-string
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
199 "]" )
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
200 (concat " " fortran-continuation-string)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
201 nil t nil)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
202 (goto-char (point-min)) ; empty comments
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
203 (perform-replace "^[cC][ \t]*$" "" nil t nil)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
204 (goto-char (point-min)) ; multiple blank lines
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
205 (perform-replace "\n\n\n+" "\n\n" nil t nil)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
206 (if downit
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
207 (fortran-downcase-region (point-min) (point-max)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
208 )))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
209
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
210 )