comparison lisp/progmodes/f90.el @ 85578:40360655a978

(f90-do-indent, f90-if-indent) (f90-type-indent, f90-program-indent, f90-associate-indent) (f90-continuation-indent, f90-comment-region) (f90-beginning-ampersand, f90-smart-end) (f90-break-before-delimiters, f90-auto-keyword-case) (f90-leave-line-no, f90-mode-hook): Give an appropriate safe-local-variable property.
author Glenn Morris <rgm@gnu.org>
date Tue, 23 Oct 2007 07:00:38 +0000
parents a23a7c302a2c
children 4cbfa6e02bcd
comparison
equal deleted inserted replaced
85577:bd2471d55c5b 85578:40360655a978
181 181
182 (defcustom f90-do-indent 3 182 (defcustom f90-do-indent 3
183 "Extra indentation applied to DO blocks." 183 "Extra indentation applied to DO blocks."
184 :type 'integer 184 :type 'integer
185 :group 'f90-indent) 185 :group 'f90-indent)
186 (put 'f90-do-indent 'safe-local-variable 'integerp)
186 187
187 (defcustom f90-if-indent 3 188 (defcustom f90-if-indent 3
188 "Extra indentation applied to IF, SELECT CASE, WHERE and FORALL blocks." 189 "Extra indentation applied to IF, SELECT CASE, WHERE and FORALL blocks."
189 :type 'integer 190 :type 'integer
190 :group 'f90-indent) 191 :group 'f90-indent)
192 (put 'f90-if-indent 'safe-local-variable 'integerp)
191 193
192 (defcustom f90-type-indent 3 194 (defcustom f90-type-indent 3
193 "Extra indentation applied to TYPE, ENUM, INTERFACE and BLOCK DATA blocks." 195 "Extra indentation applied to TYPE, ENUM, INTERFACE and BLOCK DATA blocks."
194 :type 'integer 196 :type 'integer
195 :group 'f90-indent) 197 :group 'f90-indent)
198 (put 'f90-type-indent 'safe-local-variable 'integerp)
196 199
197 (defcustom f90-program-indent 2 200 (defcustom f90-program-indent 2
198 "Extra indentation applied to PROGRAM, MODULE, SUBROUTINE, FUNCTION blocks." 201 "Extra indentation applied to PROGRAM, MODULE, SUBROUTINE, FUNCTION blocks."
199 :type 'integer 202 :type 'integer
200 :group 'f90-indent) 203 :group 'f90-indent)
204 (put 'f90-program-indent 'safe-local-variable 'integerp)
201 205
202 (defcustom f90-associate-indent 2 206 (defcustom f90-associate-indent 2
203 "Extra indentation applied to ASSOCIATE blocks." 207 "Extra indentation applied to ASSOCIATE blocks."
204 :type 'integer 208 :type 'integer
205 :group 'f90-indent 209 :group 'f90-indent
206 :version "23.1") 210 :version "23.1")
211 (put 'f90-associate-indent 'safe-local-variable 'integerp)
207 212
208 (defcustom f90-continuation-indent 5 213 (defcustom f90-continuation-indent 5
209 "Extra indentation applied to continuation lines." 214 "Extra indentation applied to continuation lines."
210 :type 'integer 215 :type 'integer
211 :group 'f90-indent) 216 :group 'f90-indent)
217 (put 'f90-continuation-indent 'safe-local-variable 'integerp)
212 218
213 (defcustom f90-comment-region "!!$" 219 (defcustom f90-comment-region "!!$"
214 "String inserted by \\[f90-comment-region] at start of each line in region." 220 "String inserted by \\[f90-comment-region] at start of each line in region."
215 :type 'string 221 :type 'string
216 :group 'f90-indent) 222 :group 'f90-indent)
223 (put 'f90-comment-region 'safe-local-variable 'stringp)
217 224
218 (defcustom f90-indented-comment-re "!" 225 (defcustom f90-indented-comment-re "!"
219 "Regexp matching comments to indent as code." 226 "Regexp matching comments to indent as code."
220 :type 'regexp 227 :type 'regexp
221 :group 'f90-indent) 228 :group 'f90-indent)
229 ;; FIXME are arbitrary regexps safe? Only used in looking-at.
222 230
223 (defcustom f90-directive-comment-re "!hpf\\$" 231 (defcustom f90-directive-comment-re "!hpf\\$"
224 "Regexp of comment-like directive like \"!HPF\\\\$\", not to be indented." 232 "Regexp of comment-like directive like \"!HPF\\\\$\", not to be indented."
225 :type 'regexp 233 :type 'regexp
226 :group 'f90-indent) 234 :group 'f90-indent)
235 ;; FIXME are arbitrary regexps safe? Only used in looking-at.
227 236
228 (defcustom f90-beginning-ampersand t 237 (defcustom f90-beginning-ampersand t
229 "Non-nil gives automatic insertion of \& at start of continuation line." 238 "Non-nil gives automatic insertion of \& at start of continuation line."
230 :type 'boolean 239 :type 'boolean
231 :group 'f90) 240 :group 'f90)
241 (put 'f90-beginning-ampersand 'safe-local-variable 'booleanp)
232 242
233 (defcustom f90-smart-end 'blink 243 (defcustom f90-smart-end 'blink
234 "Qualification of END statements according to the matching block start. 244 "Qualification of END statements according to the matching block start.
235 For example, the END that closes an IF block is changed to END 245 For example, the END that closes an IF block is changed to END
236 IF. If the block has a label, this is added as well. Allowed 246 IF. If the block has a label, this is added as well. Allowed
237 values are 'blink, 'no-blink, and nil. If nil, nothing is done. 247 values are 'blink, 'no-blink, and nil. If nil, nothing is done.
238 The other two settings have the same effect, but 'blink 248 The other two settings have the same effect, but 'blink
239 additionally blinks the cursor to the start of the block." 249 additionally blinks the cursor to the start of the block."
240 :type '(choice (const blink) (const no-blink) (const nil)) 250 :type '(choice (const blink) (const no-blink) (const nil))
241 :group 'f90) 251 :group 'f90)
252 (put 'f90-smart-end 'safe-local-variable
253 (lambda (value) (memq value '(blink no-blink nil))))
242 254
243 (defcustom f90-break-delimiters "[-+\\*/><=,% \t]" 255 (defcustom f90-break-delimiters "[-+\\*/><=,% \t]"
244 "Regexp matching delimiter characters at which lines may be broken. 256 "Regexp matching delimiter characters at which lines may be broken.
245 There are certain tokens comprised entirely of characters 257 There are certain tokens comprised entirely of characters
246 matching this regexp that should not be split, and these are 258 matching this regexp that should not be split, and these are
247 specified by the constant `f90-no-break-re'." 259 specified by the constant `f90-no-break-re'."
248 :type 'regexp 260 :type 'regexp
249 :group 'f90) 261 :group 'f90)
262 ;; FIXME are arbitrary regexps safe? Used in re-search-backward.
250 263
251 (defcustom f90-break-before-delimiters t 264 (defcustom f90-break-before-delimiters t
252 "Non-nil causes `f90-do-auto-fill' to break lines before delimiters." 265 "Non-nil causes `f90-do-auto-fill' to break lines before delimiters."
253 :type 'boolean 266 :type 'boolean
254 :group 'f90) 267 :group 'f90)
268 (put 'f90-break-before-delimiters 'safe-local-variable 'booleanp)
255 269
256 (defcustom f90-auto-keyword-case nil 270 (defcustom f90-auto-keyword-case nil
257 "Automatic case conversion of keywords. 271 "Automatic case conversion of keywords.
258 The options are 'downcase-word, 'upcase-word, 'capitalize-word and nil." 272 The options are 'downcase-word, 'upcase-word, 'capitalize-word and nil."
259 :type '(choice (const downcase-word) (const upcase-word) 273 :type '(choice (const downcase-word) (const upcase-word)
260 (const capitalize-word) (const nil)) 274 (const capitalize-word) (const nil))
261 :group 'f90) 275 :group 'f90)
276 (put 'f90-auto-keyword-case 'safe-local-variable
277 (lambda (value) (memq value '(downcase-word
278 capitalize-word upcase-word nil))))
262 279
263 (defcustom f90-leave-line-no nil 280 (defcustom f90-leave-line-no nil
264 "If non-nil, line numbers are not left justified." 281 "If non-nil, line numbers are not left justified."
265 :type 'boolean 282 :type 'boolean
266 :group 'f90) 283 :group 'f90)
284 (put 'f90-leave-line-no 'safe-local-variable 'booleanp)
267 285
268 (defcustom f90-mode-hook nil 286 (defcustom f90-mode-hook nil
269 "Hook run when entering F90 mode." 287 "Hook run when entering F90 mode."
270 :type 'hook 288 :type 'hook
271 :options '(f90-add-imenu-menu) 289 :options '(f90-add-imenu-menu)
272 :group 'f90) 290 :group 'f90)
291 (put 'f90-mode-hook 'safe-local-variable
292 (lambda (value) (member value '((f90-add-imenu-menu) nil))))
273 293
274 ;; User options end here. 294 ;; User options end here.
275 295
276 (defconst f90-keywords-re 296 (defconst f90-keywords-re
277 (regexp-opt '("allocatable" "allocate" "assign" "assignment" "backspace" 297 (regexp-opt '("allocatable" "allocate" "assign" "assignment" "backspace"