help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: C-M-a


From: Alan Mackenzie
Subject: Re: C-M-a
Date: Mon, 28 Jan 2008 20:34:38 +0000
User-agent: Mutt/1.5.9i

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).




reply via email to

[Prev in Thread] Current Thread [Next in Thread]