all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Eduard Wiebe <usenet@pusto.de>
To: help-gnu-emacs@gnu.org
Subject: Re: adding some intelligence to save
Date: Tue, 15 Dec 2009 17:50:19 +0100	[thread overview]
Message-ID: <867hso18s4.fsf@nirvana.pusto.de> (raw)
In-Reply-To: 79c7eece-fc7d-43cf-9193-503efed915b7@s31g2000yqs.googlegroups.com

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


      reply	other threads:[~2009-12-15 16:50 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-12-15 14:20 adding some intelligence to save Nigel Noldsworth
2009-12-15 16:50 ` Eduard Wiebe [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=867hso18s4.fsf@nirvana.pusto.de \
    --to=usenet@pusto.de \
    --cc=help-gnu-emacs@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.