Function: electric-verilog-tab
electric-verilog-tab is an interactive and byte-compiled function
defined in verilog-mode.el.gz.
Signature
(electric-verilog-tab)
Documentation
Function called when TAB is pressed in Verilog mode.
Key Bindings
Source Code
;; Defined in /usr/src/emacs/lisp/progmodes/verilog-mode.el.gz
(defun electric-verilog-tab ()
"Function called when TAB is pressed in Verilog mode."
(interactive)
;; If verilog-tab-always-indent, indent the beginning of the line.
(cond
;; The region is active, indent it.
((and (region-active-p)
(not (eq (region-beginning) (region-end))))
(indent-region (region-beginning) (region-end) nil))
((or verilog-tab-always-indent
(save-excursion
(skip-chars-backward " \t")
(bolp)))
(let* ((oldpnt (point))
(boi-point
(save-excursion
(beginning-of-line)
(skip-chars-forward " \t")
(verilog-indent-line)
(back-to-indentation)
(point))))
(if (< (point) boi-point)
(back-to-indentation)
(cond ((not verilog-tab-to-comment))
((not (eolp))
(end-of-line))
(t
(indent-for-comment)
(when (and (eolp) (= oldpnt (point)))
;; kill existing comment
(beginning-of-line)
(re-search-forward comment-start-skip oldpnt 'move)
(goto-char (match-beginning 0))
(skip-chars-backward " \t")
(kill-region (point) oldpnt)))))))
(t (progn (insert "\t")))))