From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Pascal Bourguignon Newsgroups: gmane.emacs.help Subject: Re: How do you make code look pretty?? Date: Wed, 27 Jul 2005 19:40:21 +0200 Organization: [posted via Easynet Spain] Message-ID: <87ek9ktaey.fsf@thalassa.informatimago.com> References: NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1122486272 13137 80.91.229.2 (27 Jul 2005 17:44:32 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Wed, 27 Jul 2005 17:44:32 +0000 (UTC) Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Wed Jul 27 19:44:23 2005 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1Dxpvk-000674-Vl for geh-help-gnu-emacs@m.gmane.org; Wed, 27 Jul 2005 19:42:57 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Dxpy7-0006zc-WA for geh-help-gnu-emacs@m.gmane.org; Wed, 27 Jul 2005 13:45:24 -0400 Original-Path: shelby.stanford.edu!newsfeed.stanford.edu!news.tele.dk!news.tele.dk!small.news.tele.dk!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsfeed.stueberl.de!teaser.fr!easynet-quince!easynet.net!easynet-post2!not-for-mail Original-Newsgroups: gnu.emacs.help User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (gnu/linux) Cancel-Lock: sha1:r4gqb8/JkYlqZUCzwIDMphDQE3M= Original-Lines: 39 Original-NNTP-Posting-Host: 62.93.174.79 Original-X-Trace: DXC=40F=A5DHfHG5cdPkb:_FWKEY<>`XO4V7M>Uh 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:28226 X-Report-Spam: http://spam.gmane.org/gmane.emacs.help:28226 T Smith writes: > My question is what commands will format the code to look nice? I > know of the "indent" command but it only seems to do uniform indenting > for all the code. What I am asking for is something that does the > indenting and auto edits the code to make it look a little more > pretty. You want something specific, so you'll need to write specific emacs lisp code to implement it. > When i say "format" or "make it look pretty" I mean it does stuff > like: > Ex: Take a really long if statement expression and make it into 4 > lines instead of just one HUGE expression. > Ex: > if((expression[x][y]>work[x][y])||(expression[x+1][y]>work[x+1][y])||( > expression[x][y+1]>work[x][y+1])||(expression[x][y-1]>work[x][y-1])|| > if (( expression[x-1][y] > work[x-1][y] ) > || ( expression[x+1][y] > work[x+1][y] ) > || ( expression[x][y+1] > work[x][y+1] ) > || ( expression[x][y-1] > work[x][y-1] )) Beurk. What'd look "pretty" for me would be: if((work[x][y]