   (let ((type (car indent-str))
 	(ind (car (cdr indent-str))))
     (cond
-     (; handle continued exp
-      (eq type 'cexp)
-      (let ((here (point)))
-	(verilog-backward-syntactic-ws)
-	(cond
-	 ((or
-	   (= (preceding-char) ?\,)
-	   (save-excursion
-	     (verilog-beg-of-statement-1)
-	     (looking-at verilog-declaration-re)))
-	  (let* ( fst
-		  (val
-		   (save-excursion
-		     (backward-char 1)
-		     (verilog-beg-of-statement-1)
-		     (setq fst (point))
-		     (if (looking-at verilog-declaration-re)
-			 (progn ;; we have multiple words
-			   (goto-char (match-end 0))
-			   (skip-chars-forward " \t")
-			   (cond
-			    ((and verilog-indent-declaration-macros
-				  (= (following-char) ?\`))
-			     (progn
-			       (forward-char 1)
-			       (forward-word 1)
-			       (skip-chars-forward " \t")))
-			    ((= (following-char) ?\[)
-			     (progn
-			       (forward-char 1)
-			       (verilog-backward-up-list -1)
-			       (skip-chars-forward " \t"))))
-			   (current-column))
-		       (progn
-			 (goto-char fst)
-			 (+ (current-column) verilog-cexp-indent))))))
-	    (goto-char here)
-	    (indent-line-to val)
-	    (if (and (not verilog-indent-lists)
-		     (verilog-in-paren))
-		(verilog-pretty-declarations-auto))
-	    ))
-	 ((= (preceding-char) ?\) )
-	  (goto-char here)
-	  (let ((val (eval (cdr (assoc type verilog-indent-alist)))))
-	    (indent-line-to val)))
-	 (t
-	  (goto-char here)
-	  (let ((val))
-	    (verilog-beg-of-statement-1)
-	    (if (and (< (point) here)
-		     (verilog-re-search-forward "=[ \\t]*" here 'move))
-		(setq val (current-column))
-	      (setq val (eval (cdr (assoc type verilog-indent-alist)))))
-	    (goto-char here)
-	    (indent-line-to val))))))
-
-     (; handle inside parenthetical expressions
-      (eq type 'cparenexp)
-      (let* ( here
+      (; handle continued exp
+       (eq type 'cexp)
+       (let ((here (point)))
+         (verilog-backward-syntactic-ws)
+         (cond
+           ((or
+             (= (preceding-char) ?\,)
+             (save-excursion
+               (verilog-beg-of-statement-1)
+               (looking-at verilog-declaration-re)))
+            (let* ( fst
+                   (val
+                    (save-excursion
+                      (backward-char 1)
+                      (verilog-beg-of-statement-1)
+                      (setq fst (point))
+                      (if (looking-at verilog-declaration-re)
+                          (progn ;; we have multiple words
+                            (goto-char (match-end 0))
+                            (skip-chars-forward " \t")
+                            (cond
+                              ((and verilog-indent-declaration-macros
+                                    (= (following-char) ?\`))
+                               (progn
+                                 (forward-char 1)
+                                 (forward-word 1)
+                                 (skip-chars-forward " \t")))
+                              ((= (following-char) ?\[)
+                               (progn
+                                 (forward-char 1)
+                                 (verilog-backward-up-list -1)
+                                 (skip-chars-forward " \t"))))
+                            (current-column))
+                        (progn
+                          (goto-char fst)
+                          (+ (current-column) verilog-cexp-indent))))))
+              (goto-char here)
+              (indent-line-to val)
+              (if (and (not verilog-indent-lists)
+                       (verilog-in-paren))
+                  (verilog-pretty-declarations-auto))
+              ))
+           ((= (preceding-char) ?\) )
+            (goto-char here)
+            (let ((val (eval (cdr (assoc type verilog-indent-alist)))))
+              (indent-line-to val)))
+           (t
+            (goto-char here)
+            (let ((val))
+              (verilog-beg-of-statement-1)
+              (if (and (< (point) here)
+                       (verilog-re-search-forward "=[ \\t]*" here 'move))
+                  (setq val (current-column))
+                (setq val (eval (cdr (assoc type verilog-indent-alist)))))
+              (goto-char here)
+              (indent-line-to val))))))
+
+      (; handle inside parenthetical expressions
+       (eq type 'cparenexp)
+       (let* ( here
 	      (val (save-excursion
 		     (verilog-backward-up-list 1)
 		     (forward-char 1)
-             (if verilog-indent-lists
-                 (skip-chars-forward " \t")
-               (verilog-forward-syntactic-ws))
-             (setq here (point))
-             (current-column)))
+                     (if verilog-indent-lists
+                         (skip-chars-forward " \t")
+                       (verilog-forward-syntactic-ws))
+                     (setq here (point))
+                     (current-column)))
 
 	      (decl (save-excursion
 		      (goto-char here)
 		      (verilog-forward-syntactic-ws)
 		      (setq here (point))
 		      (looking-at verilog-declaration-re))))
-        (indent-line-to val)
-        (if decl
-            (verilog-pretty-declarations-auto))))
-
-     (;-- Handle the ends
-      (or
-       (looking-at verilog-end-block-re)
-       (verilog-at-close-constraint-p)
-       (verilog-at-close-struct-p))
-      (let ((val (if (eq type 'statement)
-		     (- ind verilog-indent-level)
-		   ind)))
-	(indent-line-to val)))
-
-     (;-- Case -- maybe line 'em up
-      (and (eq type 'case) (not (looking-at "^[ \t]*$")))
-      (progn
-	(cond
-	 ((looking-at "\\<endcase\\>")
-	  (indent-line-to ind))
-	 (t
-	  (let ((val (eval (cdr (assoc type verilog-indent-alist)))))
-	    (indent-line-to val))))))
-
-     (;-- defun
-      (and (eq type 'defun)
-	   (looking-at verilog-zero-indent-re))
-      (indent-line-to 0))
-
-     (;-- declaration
-      (and (or
-	    (eq type 'defun)
-	    (eq type 'block))
-	   (looking-at verilog-declaration-re))
-      (verilog-indent-declaration ind))
-
-     (;-- form feeds - ignored as bug in indent-line-to in < 24.5
-      (looking-at "\f"))
-
-     (;-- Everything else
-      t
-      (let ((val (eval (cdr (assoc type verilog-indent-alist)))))
-	(indent-line-to val))))
+         (indent-line-to val)
+         (if decl
+             (verilog-pretty-declarations-auto))))
+
+      (;-- Handle the ends
+       (or
+        (looking-at verilog-end-block-re)
+        (verilog-at-close-constraint-p)
+        (verilog-at-close-struct-p))
+       (let ((val (if (eq type 'statement)
+                      (- ind verilog-indent-level)
+                    ind)))
+         (indent-line-to val)))
+
+      (;-- Case -- maybe line 'em up
+       (and (eq type 'case) (not (looking-at "^[ \t]*$")))
+       (progn
+         (cond
+           ((looking-at "\\<endcase\\>")
+            (indent-line-to ind))
+           (t
+            (let ((val (eval (cdr (assoc type verilog-indent-alist)))))
+              (indent-line-to val))))))
+
+      (;-- defun
+       (and (eq type 'defun)
+            (looking-at verilog-zero-indent-re))
+       (indent-line-to 0))
+
+      (;-- declaration
+       (and (or
+             (eq type 'defun)
+             (eq type 'block))
+            (looking-at verilog-declaration-re))
+       (verilog-indent-declaration ind))
+
+      (;-- form feeds - ignored as bug in indent-line-to in < 24.5
+       (looking-at "\f"))
+
+      (;-- Everything else
+       t
+       (let ((val (eval (cdr (assoc type verilog-indent-alist)))))
+         (indent-line-to val))))
 
     (if (looking-at "[ \t]+$")
 	(skip-chars-forward " \t"))


;; Following code only gets called from compilation-mode-hook on Emacs to add error handling.
(defun verilog-error-regexp-add-emacs ()
   "Tell Emacs compile that we are Verilog.
Called by `compilation-mode-hook'.  This allows \\[next-error] to
find the errors."
   (interactive)
   (if (boundp 'compilation-error-regexp-alist-alist)
       (progn
         (if (not (assoc 'verilog-xl-1 compilation-error-regexp-alist-alist))
             (mapcar
              (lambda (item)
                (push (car item) compilation-error-regexp-alist)
                (push item compilation-error-regexp-alist-alist)
                )
              verilog-error-regexp-emacs-alist)))))

(if (featurep 'xemacs) (add-hook 'compilation-mode-hook 'verilog-error-regexp-add-xemacs))
(if (featurep 'emacs) (add-hook 'compilation-mode-hook 'verilog-error-regexp-add-emacs))

	      (/= nest 0)
	      (verilog-re-search-backward "\\<\\(fork\\)\\|\\(join\\(_any\\|_none\\)?\\)\\>" lim 'move)
	      (cond
                ((match-end 1) ; fork
                 (setq nest (1- nest)))
                ((match-end 2) ; join
                 (setq nest (1+ nest)))))))
    (= nest 0) )) ; return nest

(defun verilog-backward-case-item (lim)
