[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Some problems in `add-log-current-defun'
From: |
David Kastrup |
Subject: |
Re: Some problems in `add-log-current-defun' |
Date: |
Wed, 27 Dec 2006 11:45:15 +0100 |
User-agent: |
Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (gnu/linux) |
"Herbert Euler" <address@hidden> 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