Function: vhdl-set-style

vhdl-set-style is an interactive and byte-compiled function defined in vhdl-mode.el.gz.

Signature

(vhdl-set-style STYLE &optional LOCAL)

Documentation

Set vhdl-mode variables to use one of several different indentation styles.

STYLE is a string representing the desired style and optional LOCAL is a flag which, if non-nil, means to make the style variables being changed buffer local, instead of the default, which is to set the global variables. Interactively, the flag comes from the prefix argument. The styles are chosen from the vhdl-style-alist variable.

Key Bindings

Source Code

;; Defined in /usr/src/emacs/lisp/progmodes/vhdl-mode.el.gz
(defun vhdl-set-style (style &optional local)
  "Set `vhdl-mode' variables to use one of several different indentation styles.
STYLE is a string representing the desired style and optional LOCAL is
a flag which, if non-nil, means to make the style variables being
changed buffer local, instead of the default, which is to set the
global variables.  Interactively, the flag comes from the prefix
argument.  The styles are chosen from the `vhdl-style-alist' variable."
  (interactive (list (completing-read "Use which VHDL indentation style? "
				      vhdl-style-alist nil t)
		     current-prefix-arg))
  (let ((vars (cdr (assoc style vhdl-style-alist))))
    (or vars
	(error "ERROR:  Invalid VHDL indentation style `%s'" style))
    ;; set all the variables
    (mapc
     (lambda (varentry)
       (let ((var (car varentry))
             (val (cdr varentry)))
         ;; special case for vhdl-offsets-alist
         (if (not (eq var 'vhdl-offsets-alist))
             (set (if local (make-local-variable var) var) val)
           ;; reset vhdl-offsets-alist to the default value first
           (set (if local (make-local-variable var) var)
                (copy-alist vhdl-offsets-alist-default))
           ;; now set the langelems that are different
           (mapcar
            (lambda (langentry)
              (let ((langelem (car langentry))
                    (offset (cdr langentry)))
                (vhdl-set-offset langelem offset)
                ))
            val))
         ))
     vars))
  (vhdl-keep-region-active))