emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: C++ name and add-log-current-defun


From: Herbert Euler
Subject: Re: C++ name and add-log-current-defun
Date: Sat, 23 Dec 2006 11:27:03 +0800

Hmmm, I think the choice of ``skip-syntax-backward'' or
``forward-sexp'' is not more important than adding a
``while'' form; both the two functions work, but without
a ``while'' form, there is a bug.

Regards,
Guanpeng Xu


From: Kevin Rodgers <address@hidden>
To: address@hidden
Subject: Re: C++ name and add-log-current-defun
Date: Fri, 22 Dec 2006 13:50:53 -0700

Herbert Euler wrote:
I found this not complete yet, since only going back one sexp
sometimes cannot reach the beginning of a name.  Please take
``class_1::sub_class_2::method'' as an example.  A complete
solution could be

*** add-log.el.~1.146.2.22.~    Mon Nov 13 10:58:16 2006
--- add-log.el  Wed Dec 20 10:13:47 2006
*************** (defun add-log-current-defun ()
*** 916,922 ****
                              ;; Include certain keywords if they
                              ;; precede the name.
                              (setq middle (point))
!                              (forward-sexp -1)
                              ;; Is this C++ method?
                              (when (and (< 2 middle)
(string= (buffer-substring (- middle 2)
--- 916,923 ----
                              ;; Include certain keywords if they
                              ;; precede the name.
                              (setq middle (point))
! (while (not (looking-back "\\(^\\| \\|\t\\)"))
!                                (forward-sexp -1))
                              ;; Is this C++ method?
                              (when (and (< 2 middle)
(string= (buffer-substring (- middle 2)

Once again, I propose:

(skip-syntax-backward "w_") ; word and symbol characters

--
Kevin



_______________________________________________
Emacs-devel mailing list
address@hidden
http://lists.gnu.org/mailman/listinfo/emacs-devel

_________________________________________________________________
Express yourself instantly with MSN Messenger! Download today it's FREE! http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/





reply via email to

[Prev in Thread] Current Thread [Next in Thread]