From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Seweryn Kokot Newsgroups: gmane.emacs.help Subject: Re: how to deal with comment in a new lang mode Date: Mon, 03 Nov 2008 16:02:17 +0100 Message-ID: <878ws097k6.fsf@poczta.po.opole.pl> References: <78961dbc-b748-4a52-bd2d-b793b61d3212@d36g2000prf.googlegroups.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=shift_jis Content-Transfer-Encoding: 8bit X-Trace: ger.gmane.org 1225724382 20156 80.91.229.12 (3 Nov 2008 14:59:42 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 3 Nov 2008 14:59:42 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Mon Nov 03 16:00:41 2008 connect(): Connection refused 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 1Kx0uw-0005TN-FR for geh-help-gnu-emacs@m.gmane.org; Mon, 03 Nov 2008 16:00:34 +0100 Original-Received: from localhost ([127.0.0.1]:45991 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Kx0tp-0007di-Pd for geh-help-gnu-emacs@m.gmane.org; Mon, 03 Nov 2008 09:59:25 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Kx0tU-0007a0-AJ for help-gnu-emacs@gnu.org; Mon, 03 Nov 2008 09:59:04 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Kx0tR-0007ZT-W8 for help-gnu-emacs@gnu.org; Mon, 03 Nov 2008 09:59:03 -0500 Original-Received: from [199.232.76.173] (port=43475 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Kx0tR-0007ZQ-Tr for help-gnu-emacs@gnu.org; Mon, 03 Nov 2008 09:59:01 -0500 Original-Received: from main.gmane.org ([80.91.229.2]:33142 helo=ciao.gmane.org) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1Kx0tR-0001wk-5K for help-gnu-emacs@gnu.org; Mon, 03 Nov 2008 09:59:01 -0500 Original-Received: from list by ciao.gmane.org with local (Exim 4.43) id 1Kx0tP-0005QL-4S for help-gnu-emacs@gnu.org; Mon, 03 Nov 2008 14:58:59 +0000 Original-Received: from nat-warynskiego.po.opole.pl ([217.173.199.132]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 03 Nov 2008 14:58:59 +0000 Original-Received: from sewkokot by nat-warynskiego.po.opole.pl with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 03 Nov 2008 14:58:59 +0000 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 40 Original-X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: nat-warynskiego.po.opole.pl X-Operating-System: Debian GNU/Linux User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.2 (gnu/linux) Cancel-Lock: sha1:sq6iculRRV6GoNOXv6mW+UXjpM8= X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6, seldom 2.4 (older, 4) 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:59387 Archived-At: rgb writes: >> PS is there a command to compact the ending parens? >> >> Xah >> ‡”http://xahlee.org/ >> > When I work on code I like the closing parens to line up below the > matching open paren. > So I wrote a patch to calculate-lisp-indent that puts a closing paren > in the 'correct' column. > > Then, because most people don't like all those closing parens on lines > by themselves, I wrote 2 other functions. > > expand-trailing-parens & collect-trailing-parens > > I think you want the collect-trailing-parens function but you might > like the expand function sometimes too. > > There are no interdependencies so just grab whichever you like from my > wikki page. > These are about half way down the page. > > http://www.emacswiki.org/cgi-bin/wiki/Rick_Bielawski Thanks for these useful functions. In Emacs 22 `etp' function works only when removing t argument: (newline-and-indent t) --> (newline-and-indent) Also it's better to add 2 optional arguments in to avoid unwanted messages (while (re-search-forward "^\\s *)" nil t) ; ctp fun (while (re-search-forward ")" nil t) ; etp fun -- regards, Seweryn