From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Andreas Politz Newsgroups: gmane.emacs.help Subject: Re: how to deal with comment in a new lang mode Date: Sat, 01 Nov 2008 16:24:48 +0100 Organization: FH-Trier Message-ID: <1225553160.28988@arno.fh-trier.de> References: <78961dbc-b748-4a52-bd2d-b793b61d3212@d36g2000prf.googlegroups.com> <413a22e1-3685-4b1a-97d7-cda08401b838@v22g2000pro.googlegroups.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Trace: ger.gmane.org 1225554194 17169 80.91.229.12 (1 Nov 2008 15:43:14 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 1 Nov 2008 15:43:14 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Sat Nov 01 16:44:16 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 1KwIdu-0002Wl-Ao for geh-help-gnu-emacs@m.gmane.org; Sat, 01 Nov 2008 16:44:02 +0100 Original-Received: from localhost ([127.0.0.1]:50061 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KwIco-0002v4-2J for geh-help-gnu-emacs@m.gmane.org; Sat, 01 Nov 2008 11:42:54 -0400 Original-Path: news.stanford.edu!headwall.stanford.edu!newshub.sdsu.edu!newsfeed.freenet.de!news.k-dsl.de!news.uni-stuttgart.de!news.belwue.de!news.uni-kl.de!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 67 Original-NNTP-Posting-Host: 143-93-54-11.arno.fh-trier.de Original-X-Trace: news.uni-kl.de 1225553189 17053 143.93.54.11 (1 Nov 2008 15:26:29 GMT) Original-X-Complaints-To: usenet@news.uni-kl.de Original-NNTP-Posting-Date: Sat, 1 Nov 2008 15:26:29 +0000 (UTC) User-Agent: Mozilla-Thunderbird 2.0.0.17 (X11/20081018) In-Reply-To: <413a22e1-3685-4b1a-97d7-cda08401b838@v22g2000pro.googlegroups.com> Cache-Post-Path: arno.fh-trier.de!unknown@dslb-088-069-055-165.pools.arcor-ip.net X-Cache: nntpcache 3.0.1 (see http://www.nntpcache.org/) Original-Xref: news.stanford.edu gnu.emacs.help:163995 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:59337 Archived-At: Xah wrote: > On Nov 1, 6:47 am, Kevin Rodgers wrote: >> Xah wrote: >> ... >>> (defun xlsl-uncomment-region (p1 p2) >>> "Remove “//” in the beginning of each line of selected text." >>> (interactive "r") >>> (let ((deactivate-mark nil)) >>> (save-excursion >>> (goto-char p2) >>> (while (>= (point) p1) >>> (xlsl-uncomment-current-line) >>> (previous-line) >>> ) >>> ) >>> ) >>> ) >>> ... > >>> PS is there a command to compact the ending parens? > > Kevin Rodgers wrote: >> C-M-% ) C-q C-j SPC + ) RET )) RET > > Rupert Swarbrick wrote: >> Well, I tend to go to the last one and C-a C-\ >> repeatedly. Well in fact, it's usually >> C-x C-( C-a C-\ C-x C-) C-x e e e e e .... e > > ugh! I could have counted the parens, delete, then type them faster > than these methdos. > > kinda interesting that almost 3 decades of emacs+elisp its still like > this. > > i suppose i or any could easily write up a command to compact ending > parens ... i wonder why it's not really done. I guess its because most > people type parens one by one (as opposed to pairs), so they never > ends up with hanging parens like above in the first place. > > Xah > ∑ http://xahlee.org/ > > ☄ > I think your conclusion is true, but as for the proposition (people type parens one by one), I think most people simply don't end up with this pattern of parentheses when they code lisp. Where did the newline come from anyway, especially since it is not desired ? However, I would probablly use this baby : ,----[ C-h k M-^ ] | M-^ runs the command delete-indentation | which is an interactive compiled Lisp function in `simple.el'. | It is bound to M-^. | (delete-indentation &optional ARG) | | Join this line to previous and fix up whitespace at join. | If there is a fill prefix, delete it from the beginning of this line. | With argument, join this line to following line. `---- -ap