Emacs/cc-ide: Even more emacs22 fixes
[emacsstuff.git] / cc-ide / cc-ide.el
index 958eeae..3ba3b3c 100644 (file)
@@ -191,16 +191,11 @@ correctly included.")
   (save-excursion
     (back-to-indentation)
     (let ((lit (c-in-literal)))
-      (if (cond ((eq lit 'c)
-                (goto-char (car (c-literal-limits)))
-                (looking-at "/\\*\\*<?[ \t\n\r@]"))
-               ((eq lit 'c++)
-                (goto-char (car (c-literal-limits)))
-                (looking-at "///<?[ \t\n\r@]"))
-               (t nil))
-         (progn
-           (goto-char (match-end 0))
-           (current-column))))))
+      (when (and (memq lit '(c c++))
+                (progn (goto-char (car (c-literal-limits)))
+                       (looking-at "/\\(\\*\\*\\|///\\)<?[ \t\n\r@]")))
+       (goto-char (match-end 0))
+       (current-column)))))
 
 (defun ccide-shell-command (command)
   (let ((obuf (get-buffer-create "*ccide shell command*"))
@@ -1078,10 +1073,11 @@ declaration at the top of the kill ring."
                      (if (eq (char-syntax (aref name (1- (length name)))) ?w) "\\>" "")))
          fallback rv check-state)
       (while (and (not rv) (re-search-forward re nil t))
-        (if (and (c-at-toplevel-p) 
-                 (not (c-in-literal))
-                 (setq check-state (condition-case nil (c-get-defun-state) (error nil)))
-                 (not (= (car (aref check-state 2)) skip-def)))
+        (if (c-save-buffer-state ()
+             (and (c-at-toplevel-p)
+                  (not (c-in-literal))
+                  (setq check-state (condition-case nil (c-get-defun-state) (error nil)))
+                  (not (= (car (aref check-state 2)) skip-def))))
             (if (string= scoped-name (c-defun-full-name check-state))
                 (if (and (if with-body (aref check-state 6) (not (aref check-state 6)))
                         (string= args (ccide-implementation-args check-state))