From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Miguel Frasson Newsgroups: gmane.emacs.help Subject: Re: automate Emacs beautifyer ? Date: 24 Aug 2004 12:15:16 +0200 Organization: Universiteit Leiden Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Message-ID: References: NNTP-Posting-Host: deer.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1093342590 25926 80.91.224.253 (24 Aug 2004 10:16:30 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Tue, 24 Aug 2004 10:16:30 +0000 (UTC) Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Tue Aug 24 12:16:20 2004 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1BzYLk-0003QY-00 for ; Tue, 24 Aug 2004 12:16:20 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.33) id 1BzYQE-0006OJ-Sq for geh-help-gnu-emacs@m.gmane.org; Tue, 24 Aug 2004 06:20:59 -0400 Original-Path: shelby.stanford.edu!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!newsfeed.icl.net!newsfeed00.sul.t-online.de!t-online.de!news.zanker.org!humbolt.nl.linux.org!news.nl.linux.org!surfnet.nl!leidenuniv.nl!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 69 Original-NNTP-Posting-Host: 84e5e602.math.leidenuniv.nl Original-X-Trace: mercury.leidenuniv.nl 1093342517 2725 132.229.230.2 (24 Aug 2004 10:15:17 GMT) Original-X-Complaints-To: usenet@mercury.leidenuniv.nl Original-NNTP-Posting-Date: Tue, 24 Aug 2004 10:15:17 +0000 (UTC) User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.3 Original-Xref: shelby.stanford.edu gnu.emacs.help:124903 Original-To: help-gnu-emacs@gnu.org 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: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: main.gmane.org gmane.emacs.help:20252 X-Report-Spam: http://spam.gmane.org/gmane.emacs.help:20252 Bert Cuzeau <_no_spa_m_info_no_underscore_@alse-fr___.com> writes: > Hello, > > Under Windows (or Unix), is there a way to automate Emacs doing > only : > - open file > - VHDL - beautify - Buffer (C-c C-b) > - save file > - exit > > We have hundreds of files to "beautify" with VHDL-mode and it is > a chore doing this by hand. > Ideally, emacs with command line parameters would suit me great... > (I would add a Tcl script for getting the files names and running > emacs). > > Thanks in advance for any suggestions, I often make keyboard macros for thiese situations. * make a file, say "foofiles" with one filename (full path is more general) per line and open it in emacs. * put the point in the first file name at the beginning of line * start a keyborad macro with C-x ( * set mark with C-space * goto EOL with C-e * kill region with C-w * press right to move the point to the next begin of line * open file with C-x C-f (if you are usin full path, we have to delete suggestion on finding file) * mark with C-space * begin of line C-a * delete (not kill) region with M-x delete-region RET * yank filename with C-y * RET to open file * C-c C-b to beutify * Save with C-x C-s (you returned to the initial situation) * close keyboard macro with C-x ) Now repeat the keyboard macro one to see it it works and if it is OK, then C-u 2 0 0 C-x e to repeat the keyboard macro 200 times. Adapt the keybard macro for your needs. Miguel. -- Miguel Vinicius Santini Frasson http://www.math.leidenuniv.nl/~frasson