4.2 Permanent Indentation

To make this change permanent, you need to add some lisp code to your .emacs file. VHDL Mode provides a vhdl-mode-hook that you can use to customize your language editing styles. This hook gets run as the last thing when you enter VHDL Mode.

Here’s a simplified example of what you can add to your .emacs file to make the changes described in the previous section (Interactive Customization) more permanent. See the Emacs manuals for more information on customizing Emacs via hooks. See Sample Init File, for a more complete sample .emacs file.


(defun my-vhdl-mode-hook ()
  ;; my customizations for all of vhdl-mode
  (vhdl-set-offset 'statement-block-intro '++)
  ;; other customizations can go here
  )
(add-hook 'vhdl-mode-hook 'my-vhdl-mode-hook)

For complex customizations, you will probably want to set up a style that groups all your customizations under a single name. See Styles.

The offset value can also be a function, and this is how power users gain enormous flexibility in customizing indentation. See Advanced Customizations.