aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGlenn Morris2009-09-10 06:19:53 +0000
committerGlenn Morris2009-09-10 06:19:53 +0000
commit2fa207112ce592bf2ac3601f67c6c08d342120de (patch)
treeda2bdfba2be9a25feefef9701d5d20c94fdd4fae
parent6c82bad2322ba59dd3f40df299ddaa8408b3243b (diff)
downloademacs-2fa207112ce592bf2ac3601f67c6c08d342120de.tar.gz
emacs-2fa207112ce592bf2ac3601f67c6c08d342120de.zip
Move all safe and risky properties into the defcustoms.
-rw-r--r--lisp/progmodes/fortran.el57
1 files changed, 26 insertions, 31 deletions
diff --git a/lisp/progmodes/fortran.el b/lisp/progmodes/fortran.el
index ebe6598c5b4..71913d0eca0 100644
--- a/lisp/progmodes/fortran.el
+++ b/lisp/progmodes/fortran.el
@@ -83,8 +83,8 @@ A non-nil value specifies tab-digit style of continuation control.
83A value of nil specifies that continuation lines are marked 83A value of nil specifies that continuation lines are marked
84with a character in column 6." 84with a character in column 6."
85 :type 'boolean 85 :type 'boolean
86 :safe 'booleanp
86 :group 'fortran-indent) 87 :group 'fortran-indent)
87(put 'fortran-tab-mode-default 'safe-local-variable 'booleanp)
88 88
89;; TODO add more detail of what tab mode is to doc string. 89;; TODO add more detail of what tab mode is to doc string.
90(defcustom fortran-tab-mode-string 90(defcustom fortran-tab-mode-string
@@ -99,32 +99,32 @@ with a character in column 6."
99 "String to appear in mode line in TAB format buffers. 99 "String to appear in mode line in TAB format buffers.
100See Info node `(emacs)ForIndent Cont'." 100See Info node `(emacs)ForIndent Cont'."
101 :type 'string 101 :type 'string
102 :risky t
102 :group 'fortran-indent) 103 :group 'fortran-indent)
103(put 'fortran-tab-mode-string 'risky-local-variable t)
104 104
105(defcustom fortran-do-indent 3 105(defcustom fortran-do-indent 3
106 "Extra indentation applied to DO blocks." 106 "Extra indentation applied to DO blocks."
107 :type 'integer 107 :type 'integer
108 :safe 'integerp
108 :group 'fortran-indent) 109 :group 'fortran-indent)
109(put 'fortran-do-indent 'safe-local-variable 'integerp)
110 110
111(defcustom fortran-if-indent 3 111(defcustom fortran-if-indent 3
112 "Extra indentation applied to IF, SELECT CASE and WHERE blocks." 112 "Extra indentation applied to IF, SELECT CASE and WHERE blocks."
113 :type 'integer 113 :type 'integer
114 :safe 'integerp
114 :group 'fortran-indent) 115 :group 'fortran-indent)
115(put 'fortran-if-indent 'safe-local-variable 'integerp)
116 116
117(defcustom fortran-structure-indent 3 117(defcustom fortran-structure-indent 3
118 "Extra indentation applied to STRUCTURE, UNION, MAP and INTERFACE blocks." 118 "Extra indentation applied to STRUCTURE, UNION, MAP and INTERFACE blocks."
119 :type 'integer 119 :type 'integer
120 :safe 'integerp
120 :group 'fortran-indent) 121 :group 'fortran-indent)
121(put 'fortran-structure-indent 'safe-local-variable 'integerp)
122 122
123(defcustom fortran-continuation-indent 5 123(defcustom fortran-continuation-indent 5
124 "Extra indentation applied to continuation lines." 124 "Extra indentation applied to continuation lines."
125 :type 'integer 125 :type 'integer
126 :safe 'integerp
126 :group 'fortran-indent) 127 :group 'fortran-indent)
127(put 'fortran-continuation-indent 'safe-local-variable 'integerp)
128 128
129(defcustom fortran-comment-indent-style 'fixed 129(defcustom fortran-comment-indent-style 'fixed
130 "How to indent comments. 130 "How to indent comments.
@@ -135,16 +135,15 @@ nil forces comment lines not to be touched;
135`relative' indents to current Fortran indentation plus 135`relative' indents to current Fortran indentation plus
136 `fortran-comment-line-extra-indent'." 136 `fortran-comment-line-extra-indent'."
137 :type '(radio (const :tag "Untouched" nil) (const fixed) (const relative)) 137 :type '(radio (const :tag "Untouched" nil) (const fixed) (const relative))
138 :safe (lambda (value) (memq value '(nil fixed relative)))
138 :group 'fortran-indent) 139 :group 'fortran-indent)
139(put 'fortran-comment-indent 'safe-local-variable
140 (lambda (value) (memq value '(nil fixed relative))))
141 140
142(defcustom fortran-comment-line-extra-indent 0 141(defcustom fortran-comment-line-extra-indent 0
143 "Amount of extra indentation for text within full-line comments." 142 "Amount of extra indentation for text within full-line comments."
144 :type 'integer 143 :type 'integer
144 :safe 'integerp
145 :group 'fortran-indent 145 :group 'fortran-indent
146 :group 'fortran-comment) 146 :group 'fortran-comment)
147(put 'fortran-comment-line-extra-indent 'safe-local-variable 'integerp)
148 147
149(defcustom fortran-comment-line-start "C" 148(defcustom fortran-comment-line-start "C"
150 "Delimiter inserted to start new full-line comment. 149 "Delimiter inserted to start new full-line comment.
@@ -152,8 +151,8 @@ You might want to change this to \"*\", for instance; or \"!\" to
152allow trailing comments on a line." 151allow trailing comments on a line."
153 :version "21.1" 152 :version "21.1"
154 :type 'string 153 :type 'string
154 :safe 'stringp
155 :group 'fortran-comment) 155 :group 'fortran-comment)
156(put 'fortran-comment-line-start 'safe-local-variable 'stringp)
157 156
158;; This used to match preprocessor lines too, but that messes up 157;; This used to match preprocessor lines too, but that messes up
159;; filling and doesn't seem to be necessary. 158;; filling and doesn't seem to be necessary.
@@ -162,8 +161,8 @@ allow trailing comments on a line."
162 "Regexp to match the start of a full-line comment." 161 "Regexp to match the start of a full-line comment."
163 :version "21.1" 162 :version "21.1"
164 :type 'regexp 163 :type 'regexp
164 :safe 'stringp
165 :group 'fortran-comment) 165 :group 'fortran-comment)
166(put 'fortran-comment-line-start-skip 'safe-local-variable 'stringp)
167 166
168(defcustom fortran-directive-re 167(defcustom fortran-directive-re
169 "^[ \t]*#.*" 168 "^[ \t]*#.*"
@@ -172,20 +171,20 @@ The matching text will be fontified with `font-lock-keyword-face'.
172The matching line will be given zero indentation." 171The matching line will be given zero indentation."
173 :version "22.1" 172 :version "22.1"
174 :type 'regexp 173 :type 'regexp
174 :safe 'stringp
175 :group 'fortran-indent) 175 :group 'fortran-indent)
176(put 'fortran-directive-re 'safe-local-variable 'stringp)
177 176
178(defcustom fortran-minimum-statement-indent-fixed 6 177(defcustom fortran-minimum-statement-indent-fixed 6
179 "Minimum statement indentation for fixed format continuation style." 178 "Minimum statement indentation for fixed format continuation style."
180 :type 'integer 179 :type 'integer
180 :safe 'integerp
181 :group 'fortran-indent) 181 :group 'fortran-indent)
182(put 'fortran-minimum-statement-indent-fixed 'safe-local-variable 'integerp)
183 182
184(defcustom fortran-minimum-statement-indent-tab (max tab-width 6) 183(defcustom fortran-minimum-statement-indent-tab (max tab-width 6)
185 "Minimum statement indentation for TAB format continuation style." 184 "Minimum statement indentation for TAB format continuation style."
186 :type 'integer 185 :type 'integer
186 :safe 'integerp
187 :group 'fortran-indent) 187 :group 'fortran-indent)
188(put 'fortran-minimum-statement-indent-tab 'safe-local-variable 'integerp)
189 188
190;; Note that this is documented in the v18 manuals as being a string 189;; Note that this is documented in the v18 manuals as being a string
191;; of length one rather than a single character. 190;; of length one rather than a single character.
@@ -194,31 +193,29 @@ The matching line will be given zero indentation."
194 "Single-character string inserted for Fortran comment indentation. 193 "Single-character string inserted for Fortran comment indentation.
195Normally a space." 194Normally a space."
196 :type 'string 195 :type 'string
196 :safe (lambda (value) (or (characterp value)
197 (and (stringp value) (= (length value) 1))))
197 :group 'fortran-comment) 198 :group 'fortran-comment)
198(put 'fortran-comment-indent-char 'safe-local-variable
199 (lambda (value) (or (characterp value)
200 (and (stringp value)
201 (= (length value) 1)))))
202 199
203(defcustom fortran-line-number-indent 1 200(defcustom fortran-line-number-indent 1
204 "Maximum indentation for Fortran line numbers. 201 "Maximum indentation for Fortran line numbers.
2055 means right-justify them within their five-column field." 2025 means right-justify them within their five-column field."
206 :type 'integer 203 :type 'integer
204 :safe 'integerp
207 :group 'fortran-indent) 205 :group 'fortran-indent)
208(put 'fortran-line-number-indent 'safe-local-variable 'integerp)
209 206
210(defcustom fortran-check-all-num-for-matching-do nil 207(defcustom fortran-check-all-num-for-matching-do nil
211 "Non-nil causes all numbered lines to be treated as possible DO loop ends." 208 "Non-nil causes all numbered lines to be treated as possible DO loop ends."
212 :type 'boolean 209 :type 'boolean
210 :safe 'booleanp
213 :group 'fortran) 211 :group 'fortran)
214(put 'fortran-check-all-num-for-matching-do 'safe-local-variable 'booleanp)
215 212
216(defcustom fortran-blink-matching-if nil 213(defcustom fortran-blink-matching-if nil
217 "Non-nil causes \\[fortran-indent-line] on ENDIF to blink on matching IF. 214 "Non-nil causes \\[fortran-indent-line] on ENDIF to blink on matching IF.
218Also, from an ENDDO statement blink on matching DO [WHILE] statement." 215Also, from an ENDDO statement blink on matching DO [WHILE] statement."
219 :type 'boolean 216 :type 'boolean
217 :safe 'booleanp
220 :group 'fortran) 218 :group 'fortran)
221(put 'fortran-blink-matching-if 'safe-local-variable 'booleanp)
222 219
223(defcustom fortran-continuation-string "$" 220(defcustom fortran-continuation-string "$"
224 "Single-character string used for Fortran continuation lines. 221 "Single-character string used for Fortran continuation lines.
@@ -228,23 +225,21 @@ Also, if \\[fortran-indent-line] finds this at the beginning of a
228line, it will convert the line into a continuation line of the 225line, it will convert the line into a continuation line of the
229appropriate style. Normally \"$\"." 226appropriate style. Normally \"$\"."
230 :type 'string 227 :type 'string
228 :safe (lambda (value) (and (stringp value) (= (length value) 1)))
231 :group 'fortran) 229 :group 'fortran)
232(put 'fortran-continuation-string 'safe-local-variable
233 (lambda (value) (and (stringp value)
234 (= (length value) 1))))
235 230
236(defcustom fortran-comment-region "c$$$" 231(defcustom fortran-comment-region "c$$$"
237 "String inserted by \\[fortran-comment-region] at start of each \ 232 "String inserted by \\[fortran-comment-region] at start of each \
238line in region." 233line in region."
239 :type 'string 234 :type 'string
235 :safe 'stringp
240 :group 'fortran-comment) 236 :group 'fortran-comment)
241(put 'fortran-comment-region 'safe-local-variable 'stringp)
242 237
243(defcustom fortran-electric-line-number t 238(defcustom fortran-electric-line-number t
244 "Non-nil causes line numbers to be moved to the correct column as typed." 239 "Non-nil causes line numbers to be moved to the correct column as typed."
245 :type 'boolean 240 :type 'boolean
241 :safe 'booleanp
246 :group 'fortran) 242 :group 'fortran)
247(put 'fortran-electric-line-number 'safe-local-variable 'booleanp)
248 243
249;; TODO use fortran-line-length, somehow. 244;; TODO use fortran-line-length, somehow.
250(defcustom fortran-column-ruler-fixed 245(defcustom fortran-column-ruler-fixed
@@ -256,8 +251,8 @@ line in region."
256This variable is used in fixed format mode. 251This variable is used in fixed format mode.
257See the variable `fortran-column-ruler-tab' for TAB format mode." 252See the variable `fortran-column-ruler-tab' for TAB format mode."
258 :type 'string 253 :type 'string
254 :safe 'stringp
259 :group 'fortran) 255 :group 'fortran)
260(put 'fortran-column-ruler-fixed 'safe-local-variable 'stringp)
261 256
262;; TODO use fortran-line-length, somehow. 257;; TODO use fortran-line-length, somehow.
263(defcustom fortran-column-ruler-tab 258(defcustom fortran-column-ruler-tab
@@ -269,21 +264,21 @@ See the variable `fortran-column-ruler-tab' for TAB format mode."
269This variable is used in TAB format mode. 264This variable is used in TAB format mode.
270See the variable `fortran-column-ruler-fixed' for fixed format mode." 265See the variable `fortran-column-ruler-fixed' for fixed format mode."
271 :type 'string 266 :type 'string
267 :safe 'stringp
272 :group 'fortran) 268 :group 'fortran)
273(put 'fortran-column-ruler-tab 'safe-local-variable 'stringp)
274 269
275(defcustom fortran-analyze-depth 100 270(defcustom fortran-analyze-depth 100
276 "Number of lines to scan to identify fixed or TAB format style." 271 "Number of lines to scan to identify fixed or TAB format style."
277 :type 'integer 272 :type 'integer
273 :safe 'integerp
278 :group 'fortran) 274 :group 'fortran)
279(put 'fortran-analyze-depth 'safe-local-variable 'integerp)
280 275
281(defcustom fortran-break-before-delimiters t 276(defcustom fortran-break-before-delimiters t
282 "Non-nil causes filling to break lines before delimiters. 277 "Non-nil causes filling to break lines before delimiters.
283Delimiters are characters matching the regexp `fortran-break-delimiters-re'." 278Delimiters are characters matching the regexp `fortran-break-delimiters-re'."
284 :type 'boolean 279 :type 'boolean
280 :safe 'booleanp
285 :group 'fortran) 281 :group 'fortran)
286(put 'fortran-break-before-delimiters 'safe-local-variable 'booleanp)
287 282
288;; TODO 0 as no-limit, as per g77. 283;; TODO 0 as no-limit, as per g77.
289(defcustom fortran-line-length 72 284(defcustom fortran-line-length 72
@@ -296,6 +291,7 @@ buffers and the default) or the function
296buffer). This corresponds to the g77 compiler option 291buffer). This corresponds to the g77 compiler option
297`-ffixed-line-length-N'." 292`-ffixed-line-length-N'."
298 :type 'integer 293 :type 'integer
294 :safe 'integerp
299 :initialize 'custom-initialize-default 295 :initialize 'custom-initialize-default
300 :set (lambda (symbol value) 296 :set (lambda (symbol value)
301 ;; Do all fortran buffers, and the default. 297 ;; Do all fortran buffers, and the default.
@@ -303,7 +299,6 @@ buffer). This corresponds to the g77 compiler option
303 :version "23.1" 299 :version "23.1"
304 :group 'fortran) 300 :group 'fortran)
305 301
306(put 'fortran-line-length 'safe-local-variable 'integerp)
307(make-variable-buffer-local 'fortran-line-length) 302(make-variable-buffer-local 'fortran-line-length)
308 303
309(defcustom fortran-mode-hook nil 304(defcustom fortran-mode-hook nil