* [herberteuler@hotmail.com: C++ name and add-log-current-defun]
@ 2006-09-21 20:15 Richard Stallman
0 siblings, 0 replies; only message in thread
From: Richard Stallman @ 2006-09-21 20:15 UTC (permalink / raw)
Would someone please DTRT and ack?
------- Start of forwarded message -------
From: "Herbert Euler" <herberteuler@hotmail.com>
To: emacs-devel@gnu.org
Bcc:
Date: Thu, 21 Sep 2006 20:39:37 +0800
Mime-Version: 1.0
Content-Type: text/plain; format=flowed
Subject: C++ name and add-log-current-defun
X-Spam-Status: No, score=0.0 required=5.0 tests=MSGID_FROM_MTA_HEADER
autolearn=failed version=3.0.4
add-log-current-defun cannot handle C++ names well. For
example, the current function:
int some_class::some_method(int arg)
{
// ...
}
If one invoke add-change-log-entry-other-window when point
is in this function, one would get
* some_file.cpp (class::some_method):
rather than
* some_file.cpp (some_class::some_method):
This is because add-log-current-defun in add-log.el calculates
the function name wrong. Below is the code:
;; Now find the right beginning of the name.
;; Include certain keywords if they
;; precede the name.
(setq middle (point))
(forward-word -1)
;; Is this C++ method?
;; ...
(forward-word -1) wouldn't put point before `some_class',
but puts point before `c' in `some_class'.
How about changing it to like this?
(while (not (looking-back "\\(^\\|[ \t]\\)"))
(backward-word 1))
Regards,
Guanpeng Xu
_________________________________________________________________
Express yourself instantly with MSN Messenger! Download today it's FREE!
http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/
_______________________________________________
Emacs-devel mailing list
Emacs-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-devel
------- End of forwarded message -------
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2006-09-21 20:15 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-09-21 20:15 [herberteuler@hotmail.com: C++ name and add-log-current-defun] Richard Stallman
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).