From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Masatake YAMATO Newsgroups: gmane.emacs.devel Subject: Re: Some problems in `add-log-current-defun' Date: Wed, 27 Dec 2006 22:46:07 +0900 (JST) Message-ID: <20061227.224607.31863929.jet@gyve.org> References: <86lkktsjlw.fsf@lola.quinscape.zz> <20061227.204846.128191466.jet@gyve.org> <8664bxsf4b.fsf@lola.quinscape.zz> NNTP-Posting-Host: dough.gmane.org Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Trace: sea.gmane.org 1167227273 17115 80.91.229.10 (27 Dec 2006 13:47:53 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Wed, 27 Dec 2006 13:47:53 +0000 (UTC) Cc: herberteuler@hotmail.com, emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Dec 27 14:47:50 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 1GzZ8G-0003Hz-7W for ged-emacs-devel@m.gmane.org; Wed, 27 Dec 2006 14:47:48 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1GzZ8F-0005yM-Oj for ged-emacs-devel@m.gmane.org; Wed, 27 Dec 2006 08:47:47 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1GzZ7y-0005xN-VP for emacs-devel@gnu.org; Wed, 27 Dec 2006 08:47:31 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1GzZ7x-0005vk-0I for emacs-devel@gnu.org; Wed, 27 Dec 2006 08:47:30 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1GzZ7w-0005vb-O7 for emacs-devel@gnu.org; Wed, 27 Dec 2006 08:47:28 -0500 Original-Received: from [66.187.233.31] (helo=mx1.redhat.com) by monty-python.gnu.org with esmtp (Exim 4.52) id 1GzZ7u-0000Do-Gs; Wed, 27 Dec 2006 08:47:26 -0500 Original-Received: from int-mx1.corp.redhat.com (int-mx1.corp.redhat.com [172.16.52.254]) by mx1.redhat.com (8.12.11.20060308/8.12.11) with ESMTP id kBRDlPUC004638; Wed, 27 Dec 2006 08:47:25 -0500 Original-Received: from pobox.tokyo.redhat.com (pobox.tokyo.redhat.com [172.16.33.225]) by int-mx1.corp.redhat.com (8.13.1/8.13.1) with ESMTP id kBRDlOhg014410; Wed, 27 Dec 2006 08:47:25 -0500 Original-Received: from localhost (dhcp92.tokyo.redhat.com [172.16.33.92]) by pobox.tokyo.redhat.com (8.12.8/8.12.8) with ESMTP id kBRDlIvT020446; Wed, 27 Dec 2006 22:47:21 +0900 Original-To: dak@gnu.org In-Reply-To: <8664bxsf4b.fsf@lola.quinscape.zz> X-Mailer: Mew version 4.2.53 on Emacs 22.0.51 / Mule 5.0 (SAKAKI) 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:64345 Archived-At: > >> Please note that we are talking about implementing editor support, not > >> a C++ parser. It is not our task to handle all C++ constructs > >> perfectly. Instead, it is our task to handle reasonably formatted C++ > >> code. Code like the above may _intentionally_ be formatted in this > >> manner in order to persuade the editor to interpret things > >> differently. > > > > Just a question. > > > > Here do you think Emacs's C code is reasonably formatted? > > I can't parse your message; maybe it is not reasonably formatted... I'm very sorry. What I'd like to write: Do you think that Emacs's C code is reasonably formatted? > The examples were C++ code mostly. So what is "here" and "Emacs' C > code" supposed to be? Some code from the previous mail, or code from > within Emacs? An actual quote might be helpful. C source within Emacs. Here I quote the related statements: > II. On the change of `beginning-of-defun' in CC mode > > When the point is in the docstring of Emacs C source code, the > following forms are evaluated. > > (let (maybe-beg) > ;; Try to find the containing defun. > (beginning-of-defun) > (end-of-defun) > > But I found the result is wrong with the newest CC mode. Consider the > following Emacs C source code: > > DEFUN ("catch", Fcatch, Scatch, 1, UNEVALLED, 0, > doc: /* Eval BODY allowing nonlocal exits using `throw'. > TAG is evalled to get the tag to use; it must not be nil. > > Then the BODY is executed. > Within BODY, a call to `throw' with the same TAG exits BODY and this > `catch'. > If no throw happens, `catch' returns the value of the last BODY form. > If a throw happens, it specifies the value to return from `catch'. > usage: (catch TAG BODY...) */) > > Now suppose the point is at the beginning of the second paragarph, > i.e. before ``Then''. This is where the point will be before > evaluating the forms given above if one invokes > `add-log-current-defun' when the point is in the first paragraph of > the docstring. 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, so that > `beginning-of-defun' will move point to the beginning of the > arguments, i.e. between the space that is after ``DEFUN'' and the left > paren before ``"catch"''. As a result, one cannot produce correct > change log entry when point is in the first paragraph of this > function, for example, when point is between ``Eval'' and ``BODY'' in > the first paragraph. Masatake YAMATO