Function: vhdl-align-region-1

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

Signature

(vhdl-align-region-1 BEGIN END &optional SPACING ALIGNMENT-LIST INDENT)

Documentation

Attempt to align a range of lines based on the content of the lines.

The definition of alignment-list determines the matching order and the manner in which the lines are aligned. If ALIGNMENT-LIST is not specified vhdl-align-alist is used. If INDENT is non-nil, indentation is done before aligning.

Key Bindings

Source Code

;; Defined in /usr/src/emacs/lisp/progmodes/vhdl-mode.el.gz
(defun vhdl-align-region-1 (begin end &optional spacing alignment-list _indent)
  "Attempt to align a range of lines based on the content of the lines.
The definition of `alignment-list' determines the matching order
and the manner in which the lines are aligned.  If ALIGNMENT-LIST
is not specified `vhdl-align-alist' is used.  If INDENT is
non-nil, indentation is done before aligning."
  (interactive "r\np")
  (setq alignment-list (or alignment-list vhdl-align-alist))
  (setq spacing (or spacing 1))
  (save-excursion
    (let (bol) ;; indent
      (goto-char end)
      (setq end (point-marker))
      (goto-char begin)
      (setq bol (setq begin (progn (beginning-of-line) (point))))
      ;; FIXME: The `indent' arg is not used, and I think it's because
      ;; the let binding commented out above `indent' was hiding it, so
      ;; the test below should maybe still test `indent'?
      (when nil ;; indent
	(indent-region bol end nil))))
  (let ((copy (copy-alist alignment-list)))
    (vhdl-prepare-search-2
     (while copy
       (save-excursion
	 (goto-char begin)
	 (let (element
	       (eol (point-at-eol)))
	   (setq element (nth 0 copy))
	   (when (and (or (and (listp (car element))
			       (memq major-mode (car element)))
			  (eq major-mode (car element)))
		      (or vhdl-align-try-all-clauses
			  (re-search-forward (car (cdr element)) eol t)))
	     (vhdl-align-region-2 begin end (car (cdr (cdr element)))
				  (car (cdr (cdr (cdr element)))) spacing))
	   (setq copy (cdr copy))))))))