all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* adding some intelligence to save
@ 2009-12-15 14:20 Nigel Noldsworth
  2009-12-15 16:50 ` Eduard Wiebe
  0 siblings, 1 reply; 2+ messages in thread
From: Nigel Noldsworth @ 2009-12-15 14:20 UTC (permalink / raw
  To: help-gnu-emacs

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, I'm
not a software engineer .

Thanks


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: adding some intelligence to save
  2009-12-15 14:20 adding some intelligence to save Nigel Noldsworth
@ 2009-12-15 16:50 ` Eduard Wiebe
  0 siblings, 0 replies; 2+ messages in thread
From: Eduard Wiebe @ 2009-12-15 16:50 UTC (permalink / raw
  To: help-gnu-emacs

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


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2009-12-15 16:50 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-12-15 14:20 adding some intelligence to save Nigel Noldsworth
2009-12-15 16:50 ` Eduard Wiebe

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.