[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    kdesdk/scripts/kde-emacs
From:       Jesper Pedersen <blackie () blackie ! dk>
Date:       2004-09-27 13:07:16
Message-ID: 20040927130716.31F7A126E0 () office ! kde ! org
[Download RAW message or body]

CVS commit by blackie: 

Fixed two bugs:
1) switching using namespaces did not work if the namespace was in the
name like: NS::CLS::FNC(..)

2) switching from functions in the header file which covered more than one
line did not work:
   int someFunctionWithLotsOfParameters( int i1, int i2, 
       int i3 );

(2) still do not work if you are not located on the first line, but
previously that did not work either.


  M +25 -7     kde-emacs-utils.el   1.54


--- kdesdk/scripts/kde-emacs/kde-emacs-utils.el  #1.53:1.54
@@ -199,5 +199,5 @@
         (class "")
         (function "")
-        (save)
+        found
         )
     (if (or (string-match "\\.cc$" n)
@@ -226,15 +226,33 @@
                 (sig "")
                 (pos 0))
-            ;(setq namespace (car mup))
+        (setq namespace (car mup))
             (setq class (car (cdr mup)))
             (setq function (cdr (cdr mup)))
             (kde-switch-cpp-h)
+
+        ;; First search with namespace prefixed
             (goto-char 0)
-            (setq sig (kde-function-impl-sig namespace class function))
+            (setq sig (agulbra-remove-newline (kde-function-impl-sig namespace class function)))
             (if (string-match "(.*" sig) ; remove args
-                (setq sig (replace-match "" nil t sig)))
-            (re-search-forward (concat "^[^()]*" sig "[ \t]*(") nil t)
-            ))
-)))
+            (setq sig (replace-match "" nil t sig)))
+            (setq found (re-search-forward (concat "^[^()]*" sig "[ \t]*(") nil t) )
+
+        (if (not found)
+            (progn
+              ; Now search without name space prefix
+
+              (goto-char 0)
+              (setq sig (agulbra-remove-newline (kde-function-impl-sig "" class function)))
+              
+              (if (string-match "(.*" sig) ; remove args
+                  (setq sig (replace-match "" nil t sig)))
+              (re-search-forward (concat "^[^()]*" sig "[ \t]*(") nil t) ) )
+            )))))
+
+(defun agulbra-remove-newline (str) 
+  (let ((res str))
+    (while (string-match "\n" res )
+    (setq res (replace-match " " nil t res)))
+  res))
 
 ; Initial implementation by Arnt Gulbransen


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic