From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Ronald Newsgroups: gmane.emacs.help Subject: Re: Can emacs open a new line below or above the current line? Date: Thu, 21 Dec 2006 17:47:57 +0800 Organization: Bentium Ltd. (CN99) Message-ID: References: NNTP-Posting-Host: dough.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Trace: sea.gmane.org 1166697652 32609 80.91.229.10 (21 Dec 2006 10:40:52 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Thu, 21 Dec 2006 10:40:52 +0000 (UTC) Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Thu Dec 21 11:40:50 2006 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by dough.gmane.org with esmtp (Exim 4.50) id 1GxLM0-0000Ie-LU for geh-help-gnu-emacs@m.gmane.org; Thu, 21 Dec 2006 11:40:48 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1GxLM0-000188-3e for geh-help-gnu-emacs@m.gmane.org; Thu, 21 Dec 2006 05:40:48 -0500 Original-Path: shelby.stanford.edu!newsfeed.stanford.edu!newsfeed.news.ucla.edu!newsfeed.media.kyoto-u.ac.jp!news.cn99.com!news.yaako.com!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 33 Original-NNTP-Posting-Host: 222.125.193.25 Original-X-Trace: news.yaako.com 1166694478 7655 222.125.193.25 (21 Dec 2006 09:47:58 GMT) Original-X-Complaints-To: usenet@news.yaako.com Original-NNTP-Posting-Date: Thu, 21 Dec 2006 09:47:58 +0000 (UTC) User-Agent: Thunderbird 1.5.0.8 (X11/20061117) In-Reply-To: Original-Xref: shelby.stanford.edu gnu.emacs.help:144200 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: , 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:39803 Archived-At: David Hansen wrote: > On Thu, 21 Dec 2006 15:45:30 +0800 Ronald wrote: > >> Better if it can be indented automatically (for example in cc mode). >> >> I get a habit that code the main ones first, and then add on >> the trivialities. For example: >> >> if((n=write(fd,line,n))!=n){ >> perror("write error\n"); //second >> exit(-1); //first >> } >> >> This may also applies when I type: >> >> a. >> if(){} >> b. >> if(){ >> |} //`|' as the cursor >> c. >> Then I'd like to open a line above indented automatically. >> It normally would be C-j C-p tab. Just too many key strokes. > > Not sure though if i understand you right but the electric > features of cc-mode may be interesting for you. In Emacs 22 > you can toggle that behavior with C-c C-a. > > David > > > Nope