From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Herbert Euler" Newsgroups: gmane.emacs.devel Subject: Re: Some problems in `add-log-current-defun' Date: Thu, 28 Dec 2006 20:47:23 +0800 Message-ID: References: NNTP-Posting-Host: dough.gmane.org Mime-Version: 1.0 Content-Type: text/plain; format=flowed X-Trace: sea.gmane.org 1167310077 23679 80.91.229.10 (28 Dec 2006 12:47:57 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Thu, 28 Dec 2006 12:47:57 +0000 (UTC) Cc: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Dec 28 13:47:55 2006 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by dough.gmane.org with esmtp (Exim 4.50) id 1Gzufp-0002A0-D3 for ged-emacs-devel@m.gmane.org; Thu, 28 Dec 2006 13:47:53 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Gzufo-0004a0-Vd for ged-emacs-devel@m.gmane.org; Thu, 28 Dec 2006 07:47:53 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1GzufY-0004UV-BP for emacs-devel@gnu.org; Thu, 28 Dec 2006 07:47:36 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1GzufV-0004Oz-Qt for emacs-devel@gnu.org; Thu, 28 Dec 2006 07:47:34 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1GzufT-0004OB-W2 for emacs-devel@gnu.org; Thu, 28 Dec 2006 07:47:32 -0500 Original-Received: from [65.54.246.234] (helo=bay0-omc3-s34.bay0.hotmail.com) by monty-python.gnu.org with esmtp (Exim 4.52) id 1GzufR-0000TG-FI; Thu, 28 Dec 2006 07:47:29 -0500 Original-Received: from hotmail.com ([64.4.26.18]) by bay0-omc3-s34.bay0.hotmail.com with Microsoft SMTPSVC(6.0.3790.2668); Thu, 28 Dec 2006 04:47:28 -0800 Original-Received: from mail pickup service by hotmail.com with Microsoft SMTPSVC; Thu, 28 Dec 2006 04:47:27 -0800 Original-Received: from 64.4.26.200 by by112fd.bay112.hotmail.msn.com with HTTP; Thu, 28 Dec 2006 12:47:23 GMT X-Originating-IP: [221.220.17.140] X-Originating-Email: [herberteuler@hotmail.com] X-Sender: herberteuler@hotmail.com In-Reply-To: Original-To: rms@gnu.org X-OriginalArrivalTime: 28 Dec 2006 12:47:27.0856 (UTC) FILETIME=[54B23700:01C72A7E] X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:64393 Archived-At: I have solved I and IV, more or less. But because of the earthquake in Taiwan my network status is poor so that I'm not able to post the patch. Let me try it later... Regards, Guanpeng Xu >From: Richard Stallman >Reply-To: rms@gnu.org >To: "Herbert Euler" >CC: emacs-devel@gnu.org >Subject: Re: Some problems in `add-log-current-defun' >Date: Wed, 27 Dec 2006 16:17:18 -0500 > > But this is not reliable. If someone forgets to put a newline after a > function, `add-log-current-defun' will report wrong name. Please > consider the following example: > > int > f1 () > { > /* If point is here `add-log-current-defun' gets wrong result. */ > } > int > f2 () > { > /* ... */ > } > > When the point is inside the body of `f1', invoking > `add-log-current-defun' will get `f2', rather than `f1'. > >That bug is worth fixing. > > In the past, CC mode does not consider the arguments > of DEFUN as a defun, so `beginning-of-defun' will move point to the > beginning of the function that appear before this DEFUN. With the > forms in `add-log-current-defun', the result is correct. But I found > in the newest CC mode considers the arguments (starting with > ``("catch"'', ending with ``*/)'') as a defun, > >That change in CC mode would clearly be a change for the better, but >it doesn't work for me. > >I updated my sources yesterday around noon EST. >I find that `beginning-of-defun' when given inside the DEFUN args >of Fcatch moves back to the { at the start of the body of Fmacroexpand. > >I also find that C-M-a is bound to `beginning-of-defun' in C mode. >Wasn't it supposed to be `c-beginning-of-defun' nowadays? > >What is wrong here? > >In any case, it would be good to change `add-log-current-defun' >to correspond to the new improved behavior of CC mode. > > void ssort(void * base, size_t n, size_t sz, CFT cmp) > /* > Sort the "n" elements of vector "base" into increasing order > using the comparison function pointed to by "cmp". > The elements are of size "sz". > > Shell sort (Knuth, Vol3, pg84) > */ > { > /* ... */ > } > >That seems like common usage -- not weird. It would be nice to handle >that usage correctly. However, if we have never handled it in the >past, I think it is not urgent to fix it now. > >Masatake YAMATO thinks that code is badly formatted. >Masatake, why do you think so? > > This is not general too: C++ permits the nested name to be put in many > lines. For example, the following name is valid: > > void > class_1 > :: > sub_class_2 > :: > method_3 () > { > /* ... */ > } > > The current implementation cannot handle this name correctly. > >I'd say don't bother with that. At least not now. > > >_______________________________________________ >Emacs-devel mailing list >Emacs-devel@gnu.org >http://lists.gnu.org/mailman/listinfo/emacs-devel _________________________________________________________________ Don't just search. Find. Check out the new MSN Search! http://search.msn.click-url.com/go/onm00200636ave/direct/01/