      "\\(?:"
      (verilog-regexp-words
       '("`__FILE__"
-	"`__LINE__"
-	"`celldefine"
-	"`else"
-	"`end_keywords"
-	"`endcelldefine"
-	"`endif"
-	"`nounconnected_drive"
-	"`resetall"
-	"`unconnected_drive"
-	"`undefineall"))
+        "`__LINE__"
+        "`celldefine"
+        "`else"
+        "`end_keywords"
+        "`endcelldefine"
+        "`endif"
+        "`nounconnected_drive"
+        "`resetall"
+        "`unconnected_drive"
+        "`undefineall"))
      "\\)\\|\\(?:"
      ;; two words: i.e. `ifdef DEFINE
      "\\<\\(`elsif\\|`ifn?def\\|`undef\\|`default_nettype\\|`begin_keywords\\)\\>\\s-"

      (verilog-backward-open-paren)  ; Inst start
      (cond
       ((= (preceding-char) ?\#)  ; #(...) parameter section, not pin.  Skip.
	(forward-char 1)
        (verilog-forward-close-paren))  ; Parameters done
       (t
	(forward-char 1)
	(let ((indent-pt (+ (current-column)))
	      (end-pt (save-excursion (verilog-forward-close-paren) (point))))
	  (cond ((verilog-re-search-forward-quick "\\(/\\*AUTOINST\\((.*?)\\)?\\*/\\|\\.\\*\\)" end-pt t)
                 (goto-char end-pt))  ; Already there, continue search with next instance
		(t
		 ;; Delete identical interconnect
                 (let ((case-fold-search nil))  ; So we don't convert upper-to-lower, etc
		   (while (verilog-re-search-forward-quick "\\.\\s *\\([a-zA-Z0-9`_$]+\\)\\s *(\\s *\\1\\s *)\\s *" end-pt t)
		     (delete-region (match-beginning 0) (match-end 0))
                     (setq end-pt (- end-pt (- (match-end 0) (match-beginning 0))))  ; Keep it correct
		     (while (or (looking-at "[ \t\n\f,]+")
				(looking-at "//[^\n]*"))
		       (delete-region (match-beginning 0) (match-end 0))
		       (setq end-pt (- end-pt (- (match-end 0) (match-beginning 0)))))))
		 (verilog-forward-close-paren)
		 (backward-char 1)
		 ;; Not verilog-re-search, as we don't want to strip comments
		 (while (re-search-backward "[ \t\n\f]+" (- (point) 1) t)
		   (delete-region (match-beginning 0) (match-end 0)))
		 (verilog-insert "\n")
		 (verilog-insert-indent "/*AUTOINST*/")))))))))

;;
;; Auto diff:

  ;; `ind' is used in expressions stored in `verilog-indent-alist'.
  (verilog--suppressed-warnings ((lexical ind)) (defvar ind))
  (let ((pos (point-marker))
        (lim (save-excursion
               ;; (verilog-re-search-backward verilog-declaration-opener nil 'move)
               (verilog-re-search-backward "\\(\\<begin\\>\\)\\|\\(\\<\\(connect\\)?module\\>\\)\\|\\(\\<task\\>\\)" nil 'move)
               (point)))
        (ind)
        (val)
        (m1 (make-marker)))
    (setq val
          (+ baseind (eval (cdr (assoc 'declaration verilog-indent-alist)))))
    (indent-line-to val)

    ;; Use previous declaration (in this module) as template.
    (if (or (eq 'all verilog-auto-lineup)
            (eq 'declarations verilog-auto-lineup))
        (if (verilog-re-search-backward
             (or (and verilog-indent-declaration-macros
                      verilog-declaration-re-1-macro)
                 verilog-declaration-re-1-no-macro)
             lim t)
            (progn
              (goto-char (match-end 0))
              (skip-chars-forward " \t")
              (setq ind (current-column))
              (goto-char pos)
              (setq val
                    (+ baseind
                       (eval (cdr (assoc 'declaration verilog-indent-alist)))))
              (indent-line-to val)
              (if (and verilog-indent-declaration-macros
                       (looking-at verilog-declaration-re-2-macro))
                  (let ((p (match-end 0)))
                    (set-marker m1 p)
                    (if (verilog-re-search-forward "[[#`]" p 'move)
                        (progn
                          (forward-char -1)
                          (just-one-space)
                          (goto-char (marker-position m1))
                          (delete-horizontal-space)
                          (indent-to ind 1))
                      (delete-horizontal-space)
                      (indent-to ind 1)))
                (if (looking-at verilog-declaration-re-2-no-macro)
                    (let ((p (match-end 0)))
                      (set-marker m1 p)
                      (if (verilog-re-search-forward "[[`#]" p 'move)
                          (progn
                            (forward-char -1)
                            (just-one-space)
                            (goto-char (marker-position m1))
                            (delete-horizontal-space)
                            (indent-to ind 1))
                        (delete-horizontal-space)
