comparison lisp/modes/fortran.el @ 134:34a5b81f86ba r20-2b1

Import from CVS: tag r20-2b1
author cvs
date Mon, 13 Aug 2007 09:30:11 +0200
parents c0c698873ce1
children 59463afc5666
comparison
equal deleted inserted replaced
133:b27e67717092 134:34a5b81f86ba
2 2
3 ;; Copyright (c) 1986, 1993, 1994, 1995 Free Software Foundation, Inc. 3 ;; Copyright (c) 1986, 1993, 1994, 1995 Free Software Foundation, Inc.
4 4
5 ;; Author: Michael D. Prange <prange@erl.mit.edu> 5 ;; Author: Michael D. Prange <prange@erl.mit.edu>
6 ;; Maintainer: bug-fortran-mode@erl.mit.edu 6 ;; Maintainer: bug-fortran-mode@erl.mit.edu
7 ;; Version 1.30.6 (July 27, 1995) 7 ;; Version 1.30.6-x (July 27, 1995)
8 ;; Keywords: languages 8 ;; Keywords: languages
9 9
10 ;; This file is part of XEmacs. 10 ;; This file is part of XEmacs.
11 11
12 ;; XEmacs is free software; you can redistribute it and/or modify it 12 ;; XEmacs is free software; you can redistribute it and/or modify it
49 49
50 ;; Bugs to bug-fortran-mode@erl.mit.edu 50 ;; Bugs to bug-fortran-mode@erl.mit.edu
51 51
52 ;;; Code: 52 ;;; Code:
53 53
54 (defconst fortran-mode-version "version 1.30.6") 54 (defconst fortran-mode-version "version 1.30.6-x")
55
56 (defgroup fortran nil
57 "Fortran mode for Emacs"
58 :group 'languages)
59
60 (defgroup fortran-indent nil
61 "Indentation variables in Fortran mode"
62 :prefix "fortran-"
63 :group 'fortran)
64
65 (defgroup fortran-comment nil
66 "Comment-handling variables in Fortran mode"
67 :prefix "fortran-"
68 :group 'fortran)
69
55 70
56 ;;;###autoload 71 ;;;###autoload
57 (defvar fortran-tab-mode-default nil 72 (defcustom fortran-tab-mode-default nil
58 "*Default tabbing/carriage control style for empty files in Fortran mode. 73 "*Default tabbing/carriage control style for empty files in Fortran mode.
59 A value of t specifies tab-digit style of continuation control. 74 A value of t specifies tab-digit style of continuation control.
60 A value of nil specifies that continuation lines are marked 75 A value of nil specifies that continuation lines are marked
61 with a character in column 6.") 76 with a character in column 6."
77 :type 'boolean
78 :group 'fortran-indent)
62 79
63 ;; Buffer local, used to display mode line. 80 ;; Buffer local, used to display mode line.
64 (defvar fortran-tab-mode-string nil 81 (defcustom fortran-tab-mode-string nil
65 "String to appear in mode line when TAB format mode is on.") 82 "String to appear in mode line when TAB format mode is on."
66 83 :type '(choice (const nil) string)
67 (defvar fortran-do-indent 3 84 :group 'fortran-indent)
68 "*Extra indentation applied to DO blocks.") 85
69 86 (defcustom fortran-do-indent 3
70 (defvar fortran-if-indent 3 87 "*Extra indentation applied to DO blocks."
71 "*Extra indentation applied to IF blocks.") 88 :type 'integer
72 89 :group 'fortran-indent)
73 (defvar fortran-structure-indent 3 90
74 "*Extra indentation applied to STRUCTURE, UNION, MAP and INTERFACE blocks.") 91 (defcustom fortran-if-indent 3
75 92 "*Extra indentation applied to IF blocks."
76 (defvar fortran-continuation-indent 5 93 :type 'integer
77 "*Extra indentation applied to Fortran continuation lines.") 94 :group 'fortran-indent)
78 95
79 (defvar fortran-comment-indent-style 'fixed 96 (defcustom fortran-structure-indent 3
97 "*Extra indentation applied to STRUCTURE, UNION, MAP and INTERFACE blocks."
98 :type 'integer
99 :group 'fortran-indent)
100
101 (defcustom fortran-continuation-indent 5
102 "*Extra indentation applied to Fortran continuation lines."
103 :type 'integer
104 :group 'fortran-indent)
105
106 (defcustom fortran-comment-indent-style 'fixed
80 "*nil forces comment lines not to be touched, 107 "*nil forces comment lines not to be touched,
81 'fixed makes fixed comment indentation to `fortran-comment-line-extra-indent' 108 'fixed makes fixed comment indentation to `fortran-comment-line-extra-indent'
82 columns beyond `fortran-minimum-statement-indent-fixed' (for 109 columns beyond `fortran-minimum-statement-indent-fixed' (for
83 `indent-tabs-mode' of nil) or `fortran-minimum-statement-indent-tab' (for 110 `indent-tabs-mode' of nil) or `fortran-minimum-statement-indent-tab' (for
84 `indent-tabs-mode' of t), and 'relative indents to current 111 `indent-tabs-mode' of t), and 'relative indents to current
85 Fortran indentation plus `fortran-comment-line-extra-indent'.") 112 Fortran indentation plus `fortran-comment-line-extra-indent'."
86 113 :type '(radio (const nil) (const fixed) (const relative))
87 (defvar fortran-comment-line-extra-indent 0 114 :group 'fortran-indent)
88 "*Amount of extra indentation for text within full-line comments.") 115
89 116 (defcustom fortran-comment-line-extra-indent 0
90 (defvar comment-line-start nil 117 "*Amount of extra indentation for text within full-line comments."
91 "*Delimiter inserted to start new full-line comment.") 118 :type 'integer
92 119 :group 'fortran-indent
93 (defvar comment-line-start-skip nil 120 :group 'fortran-comment)
94 "*Regexp to match the start of a full-line comment.") 121
95 122 (defcustom comment-line-start nil
96 (defvar fortran-minimum-statement-indent-fixed 6 123 "*Delimiter inserted to start new full-line comment."
97 "*Minimum statement indentation for fixed format continuation style.") 124 :type '(choice string (const nil))
98 125 :group 'fortran-comment)
99 (defvar fortran-minimum-statement-indent-tab (max tab-width 6) 126
100 "*Minimum statement indentation for TAB format continuation style.") 127 (defcustom comment-line-start-skip nil
128 "*Regexp to match the start of a full-line comment."
129 :type '(choice string (const nil))
130 :group 'fortran-comment)
131
132 (defcustom fortran-minimum-statement-indent-fixed 6
133 "*Minimum statement indentation for fixed format continuation style."
134 :type 'integer
135 :group 'fortran-indent)
136
137 (defcustom fortran-minimum-statement-indent-tab (max tab-width 6)
138 "*Minimum statement indentation for TAB format continuation style."
139 :type 'integer
140 :group 'fortran-indent)
101 141
102 ;; Note that this is documented in the v18 manuals as being a string 142 ;; Note that this is documented in the v18 manuals as being a string
103 ;; of length one rather than a single character. 143 ;; of length one rather than a single character.
104 ;; The code in this file accepts either format for compatibility. 144 ;; The code in this file accepts either format for compatibility.
105 (defvar fortran-comment-indent-char " " 145 (defcustom fortran-comment-indent-char " "
106 "*Single-character string inserted for Fortran comment indentation. 146 "*Single-character string inserted for Fortran comment indentation.
107 Normally a space.") 147 Normally a space."
108 148 :type 'string
109 (defvar fortran-line-number-indent 1 149 :group 'fortran-comment)
150
151 (defcustom fortran-line-number-indent 1
110 "*Maximum indentation for Fortran line numbers. 152 "*Maximum indentation for Fortran line numbers.
111 5 means right-justify them within their five-column field.") 153 5 means right-justify them within their five-column field."
112 154 :type 'integer
113 (defvar fortran-check-all-num-for-matching-do nil 155 :group 'fortran-indent)
114 "*Non-nil causes all numbered lines to be treated as possible DO loop ends.") 156
115 157 (defcustom fortran-check-all-num-for-matching-do nil
116 (defvar fortran-blink-matching-if nil 158 "*Non-nil causes all numbered lines to be treated as possible DO loop ends."
159 :type 'boolean
160 :group 'fortran)
161
162 (defcustom fortran-blink-matching-if nil
117 "*Non-nil causes \\[fortran-indent-line] on ENDIF statement to blink on matching IF. 163 "*Non-nil causes \\[fortran-indent-line] on ENDIF statement to blink on matching IF.
118 Also, from an ENDDO statement blink on matching DO [WHILE] statement.") 164 Also, from an ENDDO statement blink on matching DO [WHILE] statement."
119 165 :type 'boolean
120 (defvar fortran-continuation-string "$" 166 :group 'fortran)
167
168 (defcustom fortran-continuation-string "$"
121 "*Single-character string used for Fortran continuation lines. 169 "*Single-character string used for Fortran continuation lines.
122 In fixed format continuation style, this character is inserted in 170 In fixed format continuation style, this character is inserted in
123 column 6 by \\[fortran-split-line] to begin a continuation line. 171 column 6 by \\[fortran-split-line] to begin a continuation line.
124 Also, if \\[fortran-indent-line] finds this at the beginning of a line, it will 172 Also, if \\[fortran-indent-line] finds this at the beginning of a line, it will
125 convert the line into a continuation line of the appropriate style. 173 convert the line into a continuation line of the appropriate style.
126 Normally $.") 174 Normally $."
127 175 :type 'string
128 (defvar fortran-comment-region "c$$$" 176 :group 'fortran)
177
178 (defcustom fortran-comment-region "c$$$"
129 "*String inserted by \\[fortran-comment-region]\ 179 "*String inserted by \\[fortran-comment-region]\
130 at start of each line in region.") 180 at start of each line in region."
131 181 :type 'string
132 (defvar fortran-electric-line-number t 182 :group 'fortran-comment)
183
184 (defcustom fortran-electric-line-number t
133 "*Non-nil causes line number digits to be moved to the correct column as\ 185 "*Non-nil causes line number digits to be moved to the correct column as\
134 typed.") 186 typed."
135 187 :type 'boolean
136 (defvar fortran-startup-message t 188 :group 'fortran)
137 "*Non-nil displays a startup message when Fortran mode is first called.") 189
190 (defcustom fortran-startup-message t
191 "*Non-nil displays a startup message when Fortran mode is first called."
192 :type 'boolean
193 :group 'fortran)
138 194
139 (defvar fortran-column-ruler-fixed 195 (defvar fortran-column-ruler-fixed
140 "0 4 6 10 20 30 40 5\ 196 "0 4 6 10 20 30 40 5\
141 \0 60 70\n\ 197 \0 60 70\n\
142 \[ ]|{ | | | | | | | | \ 198 \[ ]|{ | | | | | | | | \
160 216
161 (defvar fortran-analyze-depth 100 217 (defvar fortran-analyze-depth 100
162 "Number of lines to scan to determine whether to use fixed or TAB format\ 218 "Number of lines to scan to determine whether to use fixed or TAB format\
163 style.") 219 style.")
164 220
165 (defvar fortran-break-before-delimiters t 221 (defcustom fortran-break-before-delimiters t
166 "*Non-nil causes `fortran-fill' to break lines before delimiters.") 222 "*Non-nil causes `fortran-fill' to break lines before delimiters."
223 :type 'boolean
224 :group 'fortran)
167 225
168 (if fortran-mode-syntax-table 226 (if fortran-mode-syntax-table
169 () 227 ()
170 (setq fortran-mode-syntax-table (make-syntax-table)) 228 (setq fortran-mode-syntax-table (make-syntax-table))
171 (modify-syntax-entry ?\; "w" fortran-mode-syntax-table) 229 (modify-syntax-entry ?\; "w" fortran-mode-syntax-table)