From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Alan Mackenzie Newsgroups: gmane.emacs.help Subject: Re: C-M-a Date: Mon, 28 Jan 2008 20:34:38 +0000 Message-ID: <20080128203438.GA2513@muc.de> References: <20080126132840.GA4014@muc.de> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1201551976 27789 80.91.229.12 (28 Jan 2008 20:26:16 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 28 Jan 2008 20:26:16 +0000 (UTC) Cc: help-gnu-emacs@gnu.org To: "Michael D. Vose" Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Mon Jan 28 21:26:37 2008 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 1JJaYZ-0003Iu-SD for geh-help-gnu-emacs@m.gmane.org; Mon, 28 Jan 2008 21:26:16 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JJaY8-0000DJ-TN for geh-help-gnu-emacs@m.gmane.org; Mon, 28 Jan 2008 15:25:48 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1JJaXs-0000B9-9W for help-gnu-emacs@gnu.org; Mon, 28 Jan 2008 15:25:32 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1JJaXr-00009v-Hf for help-gnu-emacs@gnu.org; Mon, 28 Jan 2008 15:25:31 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JJaXr-00009h-EK for help-gnu-emacs@gnu.org; Mon, 28 Jan 2008 15:25:31 -0500 Original-Received: from colin.muc.de ([193.149.48.1] helo=mail.muc.de) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1JJaXq-0001Fz-Sc for help-gnu-emacs@gnu.org; Mon, 28 Jan 2008 15:25:31 -0500 Original-Received: (qmail 9788 invoked by uid 3782); 28 Jan 2008 20:23:51 -0000 Original-Received: from acm.muc.de (p57AF63E7.dip.t-dialin.net [87.175.99.231]) by colin2.muc.de (tmda-ofmipd) with ESMTP; Mon, 28 Jan 2008 21:23:46 +0100 Original-Received: (qmail 3095 invoked by uid 1000); 28 Jan 2008 20:34:38 -0000 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.9i X-Delivery-Agent: TMDA/1.1.5 (Fettercairn) X-Primary-Address: acm@muc.de X-detected-kernel: by monty-python.gnu.org: FreeBSD 4.6-4.9 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:51042 Archived-At: Hi, again! On Mon, Jan 28, 2008 at 11:16:33AM -0500, Michael D. Vose wrote: > Many thanks! > I added your code -- beginning with (defun mdv-reset-c-cmae ... -- and > now all is right again! Excellent! > Michael > >As a matter of interest, why do you want C-M-a to put the cursor at > >the opening brace rather than the function header? > When C-M-a puts the cursor at the opening brace, that positions > the cursor properly for additional useful commands (like C-M-q, > C-M-f, ...). It is the function's body that is subject to > modification much more so than the functions name/signature, and > therefore moving to the beginning of that body is a more useful > thing for C-M-a to do (IMHO). Ah. OK! The reason I changed the action of C-M-a/e was because of the annoyance it sometimes causes when you do some other function-releated things which use beginning/end-of-defun-function, like C-x n d (`narrow-to-defun') when the "inside-the-braces" narrowing cut off your parameter list, and in the case of "struct { .... } foo ;", it cut off the struct's name too. The change has been popular on balance. ;-) It hadn't occurred to me that there might be positive reasons to want to move to the braces. Perhaps I could point out that in place of C-M-q (`c-indent-exp') you can use C-c C-q (`c-indent-defun') from anywhere inside the function, and instead of C-M-f, you could use C-M-e (c-end-of-defun) which takes you _almost_ to the same place. Still, it's your Emacs, and it's up to you how you set it up. ;-) Have fun with it! -- Alan Mackenzie (Nuremberg, Germany).