emacs-devel
[Top][All Lists]
Advanced

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

C++'s class::method in add-log.el


From: Masatake YAMATO
Subject: C++'s class::method in add-log.el
Date: Wed, 09 Nov 2005 18:57:54 +0900 (JST)

Hi,

When I do C-x 4 a in following C++ code:

    public void
    SKKAutomaton::remove_table (ConvRule *table)
    {
        for (unsigned int i = 0; i < m_tables.size (); i++) {
            if (m_tables[i] == table)
                m_tables.erase(m_tables.begin() + i);
        }
    }

I got following ChangeLog entry:

    2005-11-09  Masatake YAMATO  <address@hidden>

            * src/scim_skk_automaton.cpp (remove_table): 

However, I guess C++ programmers may want to get following entry:

    2005-11-09  Masatake YAMATO  <address@hidden>

            * src/scim_skk_automaton.cpp (SKKAutomaton::remove_table): 

So even if methods which have the same name are in single source file, 
people who reads ChangeLog can distinguish one from the others.


2005-11-09  Masatake YAMATO  <address@hidden>

        * add-log.el: (add-log-current-defun): Handle 
        class::method notation of c++.

--- add-log.el  25 10月 2005 00:26:18 +0900      1.170
+++ add-log.el  09 11月 2005 17:12:36 +0900      
@@ -901,6 +901,13 @@
                               ;; precede the name.
                               (setq middle (point))
                               (forward-word -1)
+                              ;; Is this C++ method?   
+                              (when (and (< 2 middle)
+                                         (string= (buffer-substring (- middle 
2)
+                                                                    middle)
+                                                  "::"))
+                                ;; Include "classname::".
+                                (setq middle (point)))
                               ;; Ignore these subparts of a class decl
                               ;; and move back to the class name itself.
                               (while (looking-at "public \\|private ")




reply via email to

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