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: Fri, 22 Dec 2006 06:24:41 +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 1166740870 25002 80.91.229.10 (21 Dec 2006 22:41:10 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Thu, 21 Dec 2006 22:41:10 +0000 (UTC) Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Thu Dec 21 23:41:08 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 1GxWay-0000Jh-Bh for geh-help-gnu-emacs@m.gmane.org; Thu, 21 Dec 2006 23:41:00 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1GxWax-0005JH-TN for geh-help-gnu-emacs@m.gmane.org; Thu, 21 Dec 2006 17:40:59 -0500 Original-Path: shelby.stanford.edu!newsfeed.stanford.edu!headwall.stanford.edu!newsfeed.news2me.com!newsfeed.media.kyoto-u.ac.jp!news.cn99.com!news.yaako.com!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 30 Original-NNTP-Posting-Host: 222.125.193.25 Original-X-Trace: news.yaako.com 1166739882 15717 222.125.193.25 (21 Dec 2006 22:24:42 GMT) Original-X-Complaints-To: usenet@news.yaako.com Original-NNTP-Posting-Date: Thu, 21 Dec 2006 22:24:42 +0000 (UTC) User-Agent: Thunderbird 1.5.0.8 (X11/20061117) In-Reply-To: Original-Xref: shelby.stanford.edu gnu.emacs.help:144218 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:39821 Archived-At: Dieter Wilhelm wrote: > Ronald writes: > >> 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. > > "C-M-o" is your friend. > > (when you're--as in b.-- at the indentation, otherwise: "M-m C-M-o" or > as you probably meant: "C-j C-p TAB" ) > C-M-o is really good. Thanks.