From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Eduard Wiebe Newsgroups: gmane.emacs.help Subject: Re: adding some intelligence to save Date: Tue, 15 Dec 2009 17:50:19 +0100 Message-ID: <867hso18s4.fsf@nirvana.pusto.de> References: <79c7eece-fc7d-43cf-9193-503efed915b7@s31g2000yqs.googlegroups.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1261099864 27334 80.91.229.12 (18 Dec 2009 01:31:04 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 18 Dec 2009 01:31:04 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Fri Dec 18 02:30:57 2009 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1NLRgE-0004Tq-8s for geh-help-gnu-emacs@m.gmane.org; Fri, 18 Dec 2009 02:30:54 +0100 Original-Received: from localhost ([127.0.0.1]:50379 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NLRgD-0000mQ-Tt for geh-help-gnu-emacs@m.gmane.org; Thu, 17 Dec 2009 20:30:53 -0500 Original-Path: news.stanford.edu!usenet.stanford.edu!fu-berlin.de!uni-berlin.de!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 28 Original-X-Trace: news.uni-berlin.de 3FJJey6iAXeJ2OU42fT84QqjeRZ0bE9/fCd0LktjcXQsT+TL8= Cancel-Lock: sha1:OhKz3LG6YlrDzQ7RxMofXAOUShw= User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.3 (berkeley-unix) Original-Xref: news.stanford.edu gnu.emacs.help:175588 X-Mailman-Approved-At: Thu, 17 Dec 2009 20:26:55 -0500 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:70718 Archived-At: Nigel Noldsworth 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