Function: verilog-diff-auto

verilog-diff-auto is an interactive and byte-compiled function defined in verilog-mode.el.gz.

Signature

(verilog-diff-auto)

Documentation

Expand AUTOs in a temporary buffer and indicate any change.

Whitespace is ignored when detecting differences, but once a difference is detected, whitespace differences may be shown.

To call this from the command line, see M-x verilog-batch-diff-auto (verilog-batch-diff-auto).

The action on differences is selected with verilog-diff-function. The default is verilog-diff-report which will report an error and run ediff in interactive mode, or diff in batch mode.

Key Bindings

Source Code

;; Defined in /usr/src/emacs/lisp/progmodes/verilog-mode.el.gz
(defun verilog-diff-auto ()
  "Expand AUTOs in a temporary buffer and indicate any change.
Whitespace is ignored when detecting differences, but once a
difference is detected, whitespace differences may be shown.

To call this from the command line, see \\[verilog-batch-diff-auto].

The action on differences is selected with
`verilog-diff-function'.  The default is `verilog-diff-report'
which will report an error and run `ediff' in interactive mode,
or `diff' in batch mode."
  (interactive)
  (let ((b1 (current-buffer)) b2 diffpt
	(name1 (buffer-file-name))
	(newname "*Verilog-Diff*"))
    (save-excursion
      (when (get-buffer newname)
	(kill-buffer newname))
      (setq b2 (let (buffer-file-name)  ; Else clone is upset
		 (clone-buffer newname)))
      (with-current-buffer b2
	;; auto requires the filename, but can't have same filename in two
	;; buffers; so override both b1 and b2's names
	(let ((buffer-file-name name1))
	  (unwind-protect
	      (progn
		(with-current-buffer b1 (setq buffer-file-name nil))
		(verilog-auto)
                (verilog-star-cleanup))
	    ;; Restore name if unwind
	    (with-current-buffer b1 (setq buffer-file-name name1)))))
      ;;
      (setq diffpt (verilog-diff-buffers-p b1 b2 t verilog-diff-ignore-regexp))
      (cond ((not diffpt)
	     (unless noninteractive (message "AUTO expansion identical"))
             (kill-buffer newname))  ; Nice to cleanup after oneself
	    (t
	     (funcall verilog-diff-function b1 b2 diffpt)))
      ;; Return result of compare
      diffpt)))