From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: David Kastrup Newsgroups: gmane.emacs.devel Subject: Re: Some problems in `add-log-current-defun' Date: Wed, 27 Dec 2006 11:45:15 +0100 Message-ID: <86lkktsjlw.fsf@lola.quinscape.zz> References: NNTP-Posting-Host: dough.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1167216346 20704 80.91.229.10 (27 Dec 2006 10:45:46 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Wed, 27 Dec 2006 10:45:46 +0000 (UTC) Cc: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Dec 27 11:45:42 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 1GzWHw-0000Ej-Ax for ged-emacs-devel@m.gmane.org; Wed, 27 Dec 2006 11:45:36 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1GzWHv-000478-VI for ged-emacs-devel@m.gmane.org; Wed, 27 Dec 2006 05:45:35 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1GzWHk-00046f-81 for emacs-devel@gnu.org; Wed, 27 Dec 2006 05:45:24 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1GzWHi-000464-BF for emacs-devel@gnu.org; Wed, 27 Dec 2006 05:45:23 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1GzWHi-00045y-40 for emacs-devel@gnu.org; Wed, 27 Dec 2006 05:45:22 -0500 Original-Received: from [62.67.228.11] (helo=pc3.berlin.powerweb.de) by monty-python.gnu.org with esmtp (Exim 4.52) id 1GzWHh-0002DC-Im for emacs-devel@gnu.org; Wed, 27 Dec 2006 05:45:21 -0500 Original-Received: from quinscape.de (pd95b0fdb.dip0.t-ipconnect.de [217.91.15.219]) by pc3.berlin.powerweb.de (8.9.3p3/8.9.3) with ESMTP id LAA12867 for ; Wed, 27 Dec 2006 11:45:15 +0100 X-Delivered-To: Original-Received: (qmail 21502 invoked from network); 27 Dec 2006 10:45:18 -0000 Original-Received: from unknown (HELO lola.quinscape.zz) ([10.0.3.43]) (envelope-sender ) by ns.quinscape.de (qmail-ldap-1.03) with SMTP for ; 27 Dec 2006 10:45:18 -0000 Original-Received: by lola.quinscape.zz (Postfix, from userid 1001) id E2A46C18B5; Wed, 27 Dec 2006 11:45:15 +0100 (CET) Original-To: "Herbert Euler" In-Reply-To: (Herbert Euler's message of "Wed\, 27 Dec 2006 18\:32\:58 +0800") User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (gnu/linux) 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:64329 Archived-At: "Herbert Euler" writes: > I encountered a problem in add-log.el, and solved it somehow (see > http://lists.gnu.org/archive/html/emacs-devel/2006-09/msg00869.html). > However, after re-reading the implementation of > `add-log-current-defun', I found there are still many problems (bugs) > in `add-log-current-defun' for the C like languages. [...] > IV. On the C++ names > > And what I tried to fix is not general too. My fix is > > (while (not (looking-back "\\(^\\|[ \t]\\)")) > (forward-sexp -1)) > > 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. 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. -- David Kastrup