From: g0dil Date: Tue, 12 May 2009 07:14:59 +0000 (+0000) Subject: Emacs/cc-ide: Port to Emacs 22 X-Git-Url: http://g0dil.de/git?p=emacsstuff.git;a=commitdiff_plain;h=45f054c3a75f37491c072d6941cbb891776a7afe Emacs/cc-ide: Port to Emacs 22 --- diff --git a/cc-ide/cc-engine-2.el b/cc-ide/cc-engine-2.el index 4a5a972..46d7847 100644 --- a/cc-ide/cc-engine-2.el +++ b/cc-ide/cc-engine-2.el @@ -318,7 +318,7 @@ (let ((point (point)) beg) (c-beginning-of-statement-1) (setq beg (point)) - (c-end-of-statement-1) + (c-end-of-statement) (if (> (point) point) (goto-char beg) (goto-char point)) @@ -347,7 +347,7 @@ (while (and (< (point) point) (or (c-crosses-statement-barrier-p (point) point) (not (equal (c-parse-state) state)))) - (c-end-of-statement-1)) + (c-end-of-statement)) (c-forward-syntactic-ws) (while (looking-at c-any-key) (if (looking-at c-blocking-key) @@ -649,7 +649,7 @@ (progn (setq initializers (point)) (while (not (or (memq (following-char) '(?{ ?\;)) - (c-crosses-statement-barrier-p modifiers (point)))) + (c-crosses-statement-barrier-p initializers (point)))) (c-forward-extended-sexp) (c-forward-syntactic-ws)))) (if (eq (following-char) ?{) @@ -797,7 +797,7 @@ (c-forward-sexp) (setq end (point))) (forward-char 1) - (while (progn (c-end-of-statement-1) + (while (progn (c-end-of-statement) (< (point) end)) (let ((bc (char-before)) (this (point))) @@ -840,7 +840,7 @@ members))) (save-excursion (goto-char this) - (c-end-of-statement-1) + (c-end-of-statement) (setq this (point))) (setq members (cons (cons (if decl 'combo 'variable) beg) @@ -877,7 +877,7 @@ ;; return list of names of all variables of CLASS (save-excursion (loop for (type . pos) in (aref class 4) - for end = (progn (goto-char pos) (c-end-of-statement-1) (1- (point))) + for end = (progn (goto-char pos) (c-end-of-statement) (1- (point))) if (or (eq type 'variable) (eq type 'combo)) collect (c-get-template-argument-name pos end)))) @@ -885,7 +885,7 @@ ;; return list of conses of (name . type) of all variables of CLASS (save-excursion (loop for (type . pos) in (aref class 4) - for end = (progn (goto-char pos) (c-end-of-statement-1) (1- (point))) + for end = (progn (goto-char pos) (c-end-of-statement) (1- (point))) if (eq type 'variable) collect (c-get-variable-with-type pos end)))) diff --git a/cc-ide/cc-helper.el b/cc-ide/cc-helper.el index dfec932..66e32dc 100644 --- a/cc-ide/cc-helper.el +++ b/cc-ide/cc-helper.el @@ -85,6 +85,7 @@ p1 p2 p3 c maxc fname) (set-buffer tbuf) (erase-buffer) + (c++-mode) (c-build-template-specs (aref state 0) cbuf) (if (aref state 1) (progn diff --git a/cc-ide/cc-ide.el b/cc-ide/cc-ide.el index 208c254..958eeae 100644 --- a/cc-ide/cc-ide.el +++ b/cc-ide/cc-ide.el @@ -478,7 +478,7 @@ correctly included.") (forward-line 1)))))))))) (defun ccide-auto-decorate-new-files () - (if (= (point-min) (point-max)) + (if (and (buffer-file-name) (= (point-min) (point-max))) (let ((status (buffer-modified-p))) (ccide-file-comment) (set-buffer-modified-p status)))) @@ -1507,10 +1507,11 @@ instatiations at point." (ccide-auto-decorate-new-files)) (defun ccide-project-load-config () - (let ((conf (ccide-project-search-upwards "project.el" (file-name-directory (buffer-file-name))))) - (when conf - (set (make-local-variable 'ccide-project-root) (file-name-directory conf)) - (load-file conf)))) + (if (buffer-file-name) + (let ((conf (ccide-project-search-upwards "project.el" (file-name-directory (buffer-file-name))))) + (when conf + (set (make-local-variable 'ccide-project-root) (file-name-directory conf)) + (load-file conf))))) (defun ccide-project-search-upwards (file &optional dir) "Search for FILE in all directories starting at DIR and going up the directory hierarchy.