[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: adding some intelligence to save
From: |
Eduard Wiebe |
Subject: |
Re: adding some intelligence to save |
Date: |
Tue, 15 Dec 2009 17:50:19 +0100 |
User-agent: |
Gnus/5.11 (Gnus v5.11) Emacs/22.3 (berkeley-unix) |
Nigel Noldsworth <noldsworth@googlemail.com> writes:
> Hello there,
>
> I use emacs for hardware design. Everytime, before I save my work with
> Ctrl-x-s I do :
> * beautify the vhdl code with ( Ctrl-c Ctrl-b)
> * highlight the text in the buffer ( Ctrl-x-h)
> * untabify it
>
> Can anyone tell me how I can automate this into "Ctrl-x-s" please,
Put following lines in your .emacs file:
(defun my-vhdl-write-file-hook ()
(interactive)
(when (eq major-mode 'vhdl-mode)
(vhdl-beautify-buffer)
(untabify (point-min) (point-max))))
(add-hook 'before-save-hook 'my-vhdl-write-file-hook)
> I'm not a software engineer .
Nobody is perfect. ;-)
--
Eduard Wiebe