]> code.delx.au - gnu-emacs-elpa/commitdiff
New variable specifying what file extensions are Fortran 90 code
authorLawrence Mitchell <wence@gmx.li>
Mon, 18 Jul 2011 14:49:37 +0000 (15:49 +0100)
committerLawrence Mitchell <wence@gmx.li>
Mon, 18 Jul 2011 14:49:37 +0000 (15:49 +0100)
Rather than hardcoding the regexp for .F90, .f90 and .fpp, add a new
variable `f90-file-extensions', a list of possible extensions that
match Fortran 90 files.  While we're at it, add a customisation group
to pull user options together.

f90-interface-browser.el

index ce4c2db4457ced8024eec788d77bec649b949c6f..1ac9f17fc1efa440caa5f6c12c1a8f7174c1c7e5 100644 (file)
   (arglist "")
   location)
 
+(defgroup f90-iface nil
+  "Static parser for Fortran 90 code"
+  :prefix "f90-"
+  :group 'f90)
+
+(defcustom f90-file-extensions (list "f90" "F90" "fpp")
+  "Extensions to consider when looking for Fortran 90 files."
+  :type '(repeat string)
+  :group 'f90-iface)
+
 (defvar f90-interface-type nil)
 (make-variable-buffer-local 'f90-interface-type)
 
@@ -151,7 +161,10 @@ If NAME matches type(TYPENAME) return TYPENAME, otherwise just NAME."
 (defun f90-parse-interfaces-in-dir (dir)
   "Parse all Fortran 90 files in DIR to populate `f90-all-interfaces'."
   (interactive "DParse files in directory: ")
-  (loop for file in (directory-files dir t "\\.\\(?:[fF]90\\|fpp\\)\\'")
+  (loop for file in (directory-files dir t
+                                     (rx-to-string
+                                      `(and "." (or ,@f90-file-extensions)
+                                            eos) t))
         do (f90-parse-interfaces file f90-all-interfaces)))
 
 (defun f90-find-tag-interface (name &optional match-sublist)