(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))
(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)
(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) ?{)
(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)))
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)
;; 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))))
;; 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))))
(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))))
(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.