Function: vhdl-beautify-region

vhdl-beautify-region is an interactive and byte-compiled function defined in vhdl-mode.el.gz.

Signature

(vhdl-beautify-region BEG END)

Documentation

Beautify region by applying indentation, whitespace fixup, alignment, and case fixing to a region. Calls functions vhdl-indent-buffer, vhdl-align-buffer (option vhdl-align-groups set to non-nil), and vhdl-fix-case-buffer.

Key Bindings

Source Code

;; Defined in /usr/src/emacs/lisp/progmodes/vhdl-mode.el.gz
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Beautify

(defun vhdl-beautify-region (beg end)
  "Beautify region by applying indentation, whitespace fixup, alignment, and
case fixing to a region.  Calls functions `vhdl-indent-buffer',
`vhdl-align-buffer' (option `vhdl-align-groups' set to non-nil), and
`vhdl-fix-case-buffer'."
  (interactive "r")
  (setq end (save-excursion (goto-char end) (point-marker)))
  (save-excursion ; remove DOS EOL characters in UNIX file
    (goto-char beg)
    (while (search-forward "\r" nil t)
      (replace-match "" nil t)))
  (when (nth 0 vhdl-beautify-options) (vhdl-fixup-whitespace-region beg end t))
  (when (nth 1 vhdl-beautify-options) (vhdl-fix-statement-region beg end))
  (when (nth 2 vhdl-beautify-options) (indent-region beg end))
  (when (nth 3 vhdl-beautify-options)
    (let ((vhdl-align-groups t)) (vhdl-align-region beg end)))
  (when (nth 4 vhdl-beautify-options) (vhdl-fix-case-region beg end))
  (when (nth 0 vhdl-beautify-options)
    (vhdl-remove-trailing-spaces-region beg end)
    (if vhdl-indent-tabs-mode (tabify beg end) (untabify beg end))))