From: g0dil Date: Fri, 15 May 2009 22:47:25 +0000 (+0000) Subject: Emacs/cc-ide: Even more emacs22 fixes X-Git-Url: http://g0dil.de/git?a=commitdiff_plain;h=9aa8fc2a3fb4b9562618d0e2f81edc92fe8afd33;p=emacsstuff.git Emacs/cc-ide: Even more emacs22 fixes --- diff --git a/cc-ide/cc-engine-2.el b/cc-ide/cc-engine-2.el index 1247e55..5933977 100644 --- a/cc-ide/cc-engine-2.el +++ b/cc-ide/cc-engine-2.el @@ -312,22 +312,23 @@ (defun c-beginning-of-defun-or-decl () (if (c-in-literal) (goto-char (car (c-literal-limits)))) - (while (and (not (c-at-toplevel-p)) - (c-save-uplist -1))) - (c-move-to-start-of-defun) - (let ((point (point)) - (flag (c-beginning-of-statement-1)) - beg) - (cond ((eq flag 'label) - (c-forward-label)) - ((eq flag 'previous) - (goto-char point))) + (c-save-buffer-state () + (while (and (not (c-at-toplevel-p)) + (c-save-uplist -1))) + (c-move-to-start-of-defun) + (let ((point (point)) + (flag (c-beginning-of-statement-1)) + beg) + (cond ((eq flag 'label) + (c-forward-label)) + ((eq flag 'previous) + (goto-char point))) ;(setq beg (point)) ;(c-end-of-statement) ;(if (> (point) point) ;(goto-char beg) ;(goto-char point)) - (c-forward-syntactic-ws))) + (c-forward-syntactic-ws)))) (defun c-forward-out-of-comment () (while (memq (c-in-literal) '(c c++)) @@ -373,7 +374,7 @@ (loop for state = (c-parse-state) while state thereis (loop for substate on state - thereis (c-search-uplist-for-classkey substate)) + thereis (c-save-buffer-state () (c-search-uplist-for-classkey substate))) for elt = (car (last state)) do (goto-char (if (consp elt) (car elt) elt)))))) diff --git a/cc-ide/cc-ide.el b/cc-ide/cc-ide.el index 958eeae..3ba3b3c 100644 --- a/cc-ide/cc-ide.el +++ b/cc-ide/cc-ide.el @@ -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 "/\\*\\*" ""))) 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))