]> code.delx.au - gnu-emacs-elpa/blobdiff - packages/f90-interface-browser/f90-interface-browser.el
* GNUmakefile: Obey a .elpaignore file in a package's root directory.
[gnu-emacs-elpa] / packages / f90-interface-browser / f90-interface-browser.el
index c33996cc76440c414b39d81fe063897f0eca0966..8956400deb3b3a4e9244c5078bc620cc2835e9eb 100644 (file)
@@ -1,11 +1,12 @@
 ;;; f90-interface-browser.el --- Parse and browse f90 interfaces
 
-;; Copyright (C) 2011, 2012  Free Software Foundation, Inc
+;; Copyright (C) 2011, 2012, 2013  Free Software Foundation, Inc
 
 ;; Author: Lawrence Mitchell <wence@gmx.li>
 ;; Created: 2011-07-06
-;; Available-from: http://github.com/wence-/f90-iface/
+;; URL: http://github.com/wence-/f90-iface/
 ;; Version: 1.1
+;; Package-Type: simple
 
 ;; COPYRIGHT NOTICE
 
 ;;; Code:
 
 ;;; Preamble
-(eval-when-compile
-  (require 'cl))
+(eval-when-compile (require 'cl))
 (require 'thingatpt)
 (require 'f90)
 (require 'etags)
@@ -206,18 +206,6 @@ level.  For example, a LEVEL of 0 counts top-level commas."
     (when fn
       (funcall fn (f90-get-type type)))))
 
-(defun f90-lazy-completion-table ()
-  "Lazily produce a completion table of all interfaces and tag names."
-  (lexical-let ((buf (current-buffer)))
-    (lambda (string pred action)
-      (with-current-buffer buf
-        (save-excursion
-          ;; If we need to ask for the tag table, allow that.
-          (let ((enable-recursive-minibuffers t))
-            (visit-tags-table-buffer))
-          (complete-with-action action (f90-merge-into-tags-completion-table f90-all-interfaces) string pred))))))
-
-
 (defsubst f90-merge-into-tags-completion-table (ctable)
   "Merge completions in CTABLE into the tags completion table."
   (if (or tags-file-name tags-table-list)
@@ -229,6 +217,17 @@ level.  For example, a LEVEL of 0 counts top-level commas."
         table)
     ctable))
 
+(defun f90-lazy-completion-table ()
+  "Lazily produce a completion table of all interfaces and tag names."
+  (lexical-let ((buf (current-buffer)))
+    (lambda (string pred action)
+      (with-current-buffer buf
+        (save-excursion
+          ;; If we need to ask for the tag table, allow that.
+          (let ((enable-recursive-minibuffers t))
+            (visit-tags-table-buffer))
+          (complete-with-action action (f90-merge-into-tags-completion-table f90-all-interfaces) string pred))))))
+
 (defsubst f90-extract-type-name (name)
   "Return the typename from NAME.
 
@@ -594,7 +593,6 @@ first (length ARGLIST) args of SPECIALISER."
                    (<= n-passed-args n-spec-args)))
       (loop for arg in arglist
             for spec-arg in spec-arglist
-            with match = nil
             unless (or (null arg)
                        (string= (f90-get-parsed-type-typename arg)
                                 (f90-get-parsed-type-typename spec-arg)))
@@ -1030,13 +1028,12 @@ dealt with correctly."
                           (setcdr (assoc "dimension" dec)
                                   (1+ (f90-count-commas
                                        (match-string 2 name))))
-                        (add-to-list 'dec
-                                     (cons "dimension"
-                                           (1+ (f90-count-commas
-                                                (match-string 2 name))))
-                                     t))
+                        (push (cons "dimension"
+                                    (1+ (f90-count-commas
+                                         (match-string 2 name))))
+                              dec))
                       (setq name (match-string 1 name)))
-            collect (cons name dec)))))
+            collect (cons name (nreverse dec))))))
 
 (defun f90-split-declaration (dec)
   "Split and parse a type declaration DEC.