unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* C-M-a
@ 2008-01-25 21:13 Michael D. Vose
  2008-01-26 13:28 ` C-M-a Alan Mackenzie
  0 siblings, 1 reply; 4+ messages in thread
From: Michael D. Vose @ 2008-01-25 21:13 UTC (permalink / raw)
  To: help-gnu-emacs


Before upgrading to GNU Emacs 22.1.1 (sorry I don't know what my old
version was), C-M-a would behave in c-mode like it did and currently
does in fundamental mode... specifically: if the cursor was below the
closing brace of the body of main (see code below), then C-M-a would
move the position of the cursor to the opening brace of the body of
main

int main(int argc, char *argv[])
{
  short a,b,bit,i;  short mask = 0x80;

  a = atoi(argv[1]); 
  b = atoi(argv[2]);

  printf("a = %d, b = %d, a|b = %d, a&b = %d\n",a,b,a|b,a&b);

  return 0;
}

However now (in c-mode using GNU Emacs 22.1.1) C-M-a positions the
cursor at the beginning of "int main(int argc, char *argv[])".  I have
tried to change this new behavior back to the old behavior described
above -- I WANT THE CURSOR AT THE OPENING BRACE just where C-M-a puts
it in fundamental mode -- by putting the following into my .emacs file

(add-hook 'c-mode-hook
               '(lambda ()
                  (defvar beginning-of-defun-function nil)
                  (defvar defun-prompt-regexp         nil)
                  (local-set-key  [?\M-\C-a] 'beginning-of-defun)))

Unfortunately, that does not work.  What motivated the above attempt
at restoring desired behavior was the fact when in fundamental mode
M-x find-function-on-key reports that C-M-a invokes beginning-of-defun.

What can I do to make C-M-a behave in c-mode like it does in
fundamental mode?

Thanks.

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2008-01-28 20:34 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-01-25 21:13 C-M-a Michael D. Vose
2008-01-26 13:28 ` C-M-a Alan Mackenzie
2008-01-28 16:16   ` C-M-a Michael D. Vose
2008-01-28 20:34     ` C-M-a Alan Mackenzie

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).