            (regexp (nth 0 params))
            (pt (point))
            (for-star (save-excursion (backward-char 2) (looking-at "\\.\\*")))
-	   (indent-pt (save-excursion (verilog-backward-open-paren)
-				      (1+ (current-column))))
-	   (verilog-auto-inst-column (max verilog-auto-inst-column
-					  (+ 16 (* 8 (/ (+ indent-pt 7) 8)))))
+           (indent-pt (save-excursion (verilog-backward-open-paren)
+                                      (1+ (current-column))))
+           (verilog-auto-inst-column (max verilog-auto-inst-column
+                                          (+ 16 (* 8 (/ (+ indent-pt 7) 8)))))
            (verilog-auto-inst-first-any t)
-	   (modi (verilog-modi-current))
-	   (moddecls (verilog-modi-get-decls modi))
-	   submod submodi submoddecls
+           (modi (verilog-modi-current))
+           (moddecls (verilog-modi-get-decls modi))
+           submod submodi submoddecls
            inst skip-pins tpl-list tpl-num par-values)
 
       ;; Find module name that is instantiated
       (setq submod  (verilog-read-inst-module)
-	    inst (verilog-read-inst-name)
-	    vl-cell-type submod
-	    vl-cell-name inst
-	    skip-pins (aref (verilog-read-inst-pins) 0))
+            inst (verilog-read-inst-name)
+            vl-cell-type submod
+            vl-cell-name inst
+            skip-pins (aref (verilog-read-inst-pins) 0))
 
       ;; Parse any AUTO_LISP() before here
       (verilog-read-auto-lisp (point-min) pt)
 
       ;; Read parameters (after AUTO_LISP)
       (setq par-values (and verilog-auto-inst-param-value
-			    (verilog-read-inst-param-value)))
+                            (verilog-read-inst-param-value)))
 
       ;; Lookup position, etc of submodule
       ;; Note this may raise an error
       (when (and (not (member submod verilog-gate-keywords))
-		 (setq submodi (verilog-modi-lookup submod t)))
-	(setq submoddecls (verilog-modi-get-decls submodi))
-	;; If there's a number in the instantiation, it may be an argument to the
-	;; automatic variable instantiation program.
-	(let* ((tpl-info (verilog-read-auto-template submod))
-	       (tpl-regexp (aref tpl-info 0)))
-	  (setq tpl-num (if (verilog-string-match-fold tpl-regexp inst)
-			    (match-string 1 inst)
-			  "")
-		tpl-list (aref tpl-info 1)))
-	;; Find submodule's signals and dump
-	(let ((sig-list (and (equal (verilog-modi-get-type submodi) "interface")
-			     (verilog-signals-not-in
-			      (verilog-decls-get-vars submoddecls)
-			      skip-pins)))
-	      (vl-dir "interfaced"))
+                 (setq submodi (verilog-modi-lookup submod t)))
+        (setq submoddecls (verilog-modi-get-decls submodi))
+        ;; If there's a number in the instantiation, it may be an argument to the
+        ;; automatic variable instantiation program.
+        (let* ((tpl-info (verilog-read-auto-template submod))
+               (tpl-regexp (aref tpl-info 0)))
+          (setq tpl-num (if (verilog-string-match-fold tpl-regexp inst)
+                            (match-string 1 inst)
+                          "")
+                tpl-list (aref tpl-info 1)))
+        ;; Find submodule's signals and dump
+        (let ((sig-list (and (equal (verilog-modi-get-type submodi) "interface")
+                             (verilog-signals-not-in
+                              (verilog-decls-get-vars submoddecls)
+                              skip-pins)))
+              (vl-dir "interfaced"))
           (when regexp
             (setq sig-list (verilog-signals-matching-regexp sig-list regexp)))
-	  (when (and sig-list
-		     verilog-auto-inst-interfaced-ports)
+          (when (and sig-list
+                     verilog-auto-inst-interfaced-ports)
             ;; Note these are searched for in verilog-read-sub-decls.
             (verilog-auto-inst-port-list "// Interfaced\n"
                                          sig-list indent-pt moddecls
-					 tpl-list tpl-num for-star par-values)))
-	(let ((sig-list (verilog-signals-not-in
-			 (verilog-decls-get-interfaces submoddecls)
-			 skip-pins))
-	      (vl-dir "interface"))
+                                         tpl-list tpl-num for-star par-values)))
+        (let ((sig-list (verilog-signals-not-in
+                         (verilog-decls-get-interfaces submoddecls)
+                         skip-pins))
+              (vl-dir "interface"))
           (when regexp
             (setq sig-list (verilog-signals-matching-regexp sig-list regexp)))
-	  (when sig-list
+          (when sig-list
             ;; Note these are searched for in verilog-read-sub-decls.
             (verilog-auto-inst-port-list "// Interfaces\n"
                                          sig-list indent-pt moddecls
                                          tpl-list tpl-num for-star par-values)))
-	(let ((sig-list (verilog-signals-not-in
-			 (verilog-decls-get-outputs submoddecls)
-			 skip-pins))
-	      (vl-dir "output"))
+        (let ((sig-list (verilog-signals-not-in
+                         (verilog-decls-get-outputs submoddecls)
+                         skip-pins))
+              (vl-dir "output"))
           (when regexp
             (setq sig-list (verilog-signals-matching-regexp sig-list regexp)))
-	  (when sig-list
+          (when sig-list
             (verilog-auto-inst-port-list "// Outputs\n"
                                          sig-list indent-pt moddecls
-					 tpl-list tpl-num for-star par-values)))
-	(let ((sig-list (verilog-signals-not-in
-			 (verilog-decls-get-inouts submoddecls)
-			 skip-pins))
-	      (vl-dir "inout"))
+                                         tpl-list tpl-num for-star par-values)))
+        (let ((sig-list (verilog-signals-not-in
+                         (verilog-decls-get-inouts submoddecls)
+                         skip-pins))
+              (vl-dir "inout"))
           (when regexp
             (setq sig-list (verilog-signals-matching-regexp sig-list regexp)))
-	  (when sig-list
+          (when sig-list
             (verilog-auto-inst-port-list "// Inouts\n"
                                          sig-list indent-pt moddecls
-					 tpl-list tpl-num for-star par-values)))
-	(let ((sig-list (verilog-signals-not-in
-			 (verilog-decls-get-inputs submoddecls)
-			 skip-pins))
-	      (vl-dir "input"))
+                                         tpl-list tpl-num for-star par-values)))
+        (let ((sig-list (verilog-signals-not-in
+                         (verilog-decls-get-inputs submoddecls)
+                         skip-pins))
+              (vl-dir "input"))
           (when regexp
             (setq sig-list (verilog-signals-matching-regexp sig-list regexp)))
-	  (when sig-list
+          (when sig-list
             (verilog-auto-inst-port-list "// Inputs\n"
                                          sig-list indent-pt moddecls
-					 tpl-list tpl-num for-star par-values)))
-	;; Kill extra semi
-	(save-excursion
+                                         tpl-list tpl-num for-star par-values)))
+        ;; Kill extra semi
+        (save-excursion
           (cond ((not verilog-auto-inst-first-any)
-		 (re-search-backward "," pt t)
-		 (delete-char 1)
+                 (re-search-backward "," pt t)
+                 (delete-char 1)
                  (when (looking-at "  ")
                    (delete-char 1))  ; so we can align // Templated comments
                  (insert ");")
                  (search-forward "\n")  ; Added by inst-port
-		 (delete-char -1)
+                 (delete-char -1)
                  (if (search-forward ")" nil t)  ; From user, moved up a line
-		     (delete-char -1))
+                     (delete-char -1))
                  (if (search-forward ";" nil t)  ; Don't error if user had syntax error and forgot it
-		     (delete-char -1)))))))))
+                     (delete-char -1)))))))))
 
 (defun verilog-auto-inst-param ()
   "Expand AUTOINSTPARAM statements, as part of \\[verilog-auto].

    (while (re-search-forward "^\\s-*`include\\s-+\\([^ \t\n\f]+\\)" nil t)
      (let ((inc (verilog-substitute-include-name
                  (match-string-no-properties 1))))
	(verilog-read-defines inc nil t)))))

(defun verilog-read-signals (&optional start end)
  "Return a simple list of all possible signals in the file.

find the errors."
      (interactive)
      (if (boundp 'compilation-error-regexp-systems-alist)
          (if (and
               (not (equal compilation-error-regexp-systems-list 'all))
               (not (member 'verilog compilation-error-regexp-systems-list)))
              (push 'verilog compilation-error-regexp-systems-list)))
      (if (boundp 'compilation-error-regexp-alist-alist)
          (if (not (assoc 'verilog compilation-error-regexp-alist-alist))
              (setcdr compilation-error-regexp-alist-alist
                      (cons verilog-error-regexp-xemacs-alist
                            (cdr compilation-error-regexp-alist-alist)))))
      (if (boundp 'compilation-font-lock-keywords)
          (progn
            (set (make-local-variable 'compilation-font-lock-keywords)
                 verilog-error-font-lock-keywords)
            (font-lock-set-defaults)))
      ;; Need to re-run compilation-error-regexp builder
      (if (fboundp 'compilation-build-compilation-error-regexp-alist)
          (compilation-build-compilation-error-regexp-alist))
      )))

;; Following code only gets called from compilation-mode-hook on Emacs to add error handling.
