From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Colin S. Miller" Newsgroups: gmane.emacs.help Subject: Re: indenting automatically after pasting in c-mode Date: Wed, 12 Aug 2009 16:08:37 +0100 Organization: SunSITE.dk - Supporting Open source Message-ID: <4a82dac3$0$306$14726298@news.sunsite.dk> References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1250091807 26376 80.91.229.12 (12 Aug 2009 15:43:27 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 12 Aug 2009 15:43:27 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Wed Aug 12 17:43:20 2009 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 1MbFyx-0003tY-CE for geh-help-gnu-emacs@m.gmane.org; Wed, 12 Aug 2009 17:43:19 +0200 Original-Received: from localhost ([127.0.0.1]:60565 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MbFyv-0003eA-7b for geh-help-gnu-emacs@m.gmane.org; Wed, 12 Aug 2009 11:43:17 -0400 Original-Path: news.stanford.edu!newsfeed.stanford.edu!goblin2!goblin.stu.neva.ru!news.net.uni-c.dk!dotsrc.org!filter.dotsrc.org!news.dotsrc.org!not-for-mail User-Agent: Mozilla-Thunderbird 2.0.0.22 (X11/20090706) Original-Newsgroups: gnu.emacs.help In-Reply-To: Original-Lines: 29 Original-NNTP-Posting-Host: 62.56.63.167 Original-X-Trace: news.sunsite.dk DXC=M[`e6mGD6N0oDTKD0DTdP>YSB=nbEKnk; 5UL[Ua4lH9:5fdD?L8VmB8OOn[7LY1L_5QScK68eBi57; QNS\SSPXn7=`B>8HMEID8DSoLZ59a5J3I@0<0KAB\m? Original-X-Complaints-To: staff@sunsite.dk Original-Xref: news.stanford.edu gnu.emacs.help:171914 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:67091 Archived-At: Dirk80 wrote: > Hi, > > I use emacs mainly to write c-code. > > For example I paste 10 lines of code into a function. Now this 10 lines of > code are just inserted into the buffer as they are and not indented. I have > to mark these 10 lines, and then pressing TAB (indent-for-tab-command) and > everything is fine. > > It would be great if the 10 lines would be intended automatically (without > marking the 10 lines and then pressing tab) when I paste them. > > How could I solve this? Do I have to write an own elisp-function which is > doing the job and then binding it in c-mode to C-y. Or is this behaviour > already implemented? > > Thanks for your answers. > Dirk Not sure if it help much, but ident-region will reindent a block of text correctly. HTH, Colin S. Miller -- Replace the obvious in my email address with the first three letters of the hostname to reply.