emacs-devel
[Top][All Lists]
Advanced

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

Re: end-of-defun acts weirdly in c-mode; also, mark-defun in c-mode


From: Alan Mackenzie
Subject: Re: end-of-defun acts weirdly in c-mode; also, mark-defun in c-mode
Date: Mon, 2 Feb 2009 20:27:03 +0000
User-agent: Mutt/1.5.9i

Hi, Miles!

On Mon, Feb 02, 2009 at 05:13:39PM +0900, Miles Bader wrote:
> Instead of moving to the end of the current function, it actually seems
> to move one line further if there's whitespace there.  This is
> inconsistent with the behavior of end-of-defun elsewhere in emacs.

In

1
2
3 (defun foo ()
4   (bar))
5
6

, C-M-e moves point to BOL 5.

In

1
2
3 int foo ()
4 {
5     return bar () ;
6 }
7
8   

, C-M-e moves pointo to BOL 7.  Honest, I've just tried it, with CVS from
a few days ago, with -Q.  That looks consistent to me.  I must have
missed something, somewhere.

Could you put some elisp and C source up with a precise description of
how they're different, please.

> Also, since "mark-defun" basically does the right thing in c-mode
> (except for slightly funny handling of whitespace due to c-mode's wacky
> end-of-defun behavior), the current c-mode specific binding of C-M-h
> (c-mark-function) should probably be removed.

`c-mark-function' will mark a construct which lacks a brace block, such
as

   int foo (int bar) ;

, whereas C-M-a and C-M-e search for outermost brace blocks ("soon" to be
enhanced to find objects inside C++ namespaces and the like).

I have no idea how useful this marking of a braceless construct is.
_Somebody_ probably uses it.  (Hi, Barry Warsaw, are you listening?)

> Thanks,

> -Miles

-- 
Alan Mackenzie (Nuremberg, Germany).




reply via email to

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