comparison lisp/completion.el @ 90614:8dd8c8286063

Merge from emacs--devo--0 Patches applied: * emacs--devo--0 (patch 460-475) - Update from CVS - Merge from gnus--rel--5.10 * gnus--rel--5.10 (patch 145-152) - Merge from emacs--devo--0 - Update from CVS Revision: emacs@sv.gnu.org/emacs--unicode--0--patch-118
author Miles Bader <miles@gnu.org>
date Sun, 15 Oct 2006 02:54:13 +0000
parents c5406394f567 8eaa51e867d9
children f1d13e615070
comparison
equal deleted inserted replaced
90613:7a2fdfcc7f71 90614:8dd8c8286063
1883 1883
1884 (let (string next-point char) 1884 (let (string next-point char)
1885 (save-excursion 1885 (save-excursion
1886 (goto-char (point-min)) 1886 (goto-char (point-min))
1887 (catch 'finish-add-completions 1887 (catch 'finish-add-completions
1888 (with-syntax-table completion-c-def-syntax-table 1888 (with-syntax-table completion-c-def-syntax-table
1889 (while t 1889 (while t
1890 ;; we loop here only when scan-sexps fails 1890 ;; we loop here only when scan-sexps fails
1891 ;; (i.e. unbalance exps.) 1891 ;; (i.e. unbalance exps.)
1892 (condition-case e 1892 (condition-case e
1893 (while t 1893 (while t
1894 (re-search-forward *c-def-regexp*) 1894 (re-search-forward *c-def-regexp*)
1895 (cond 1895 (cond
1896 ((= (preceding-char) ?#) 1896 ((= (preceding-char) ?#)
1897 ;; preprocessor macro, see if it's one we handle 1897 ;; preprocessor macro, see if it's one we handle
1898 (setq string (buffer-substring (point) (+ (point) 6))) 1898 (cond ((looking-at "\\(define\\|ifdef\\)\\>")
1899 (cond ((member string '("define" "ifdef "))
1900 ;; skip forward over definition symbol 1899 ;; skip forward over definition symbol
1901 ;; and add it to database 1900 ;; and add it to database
1902 (and (forward-word 2) 1901 (and (forward-word 2)
1903 (setq string (symbol-before-point)) 1902 (setq string (symbol-before-point))
1904 ;;(push string foo) 1903 ;;(push string foo)
1942 (setq next-point nil))))))) 1941 (setq next-point nil)))))))
1943 (search-failed ;;done 1942 (search-failed ;;done
1944 (throw 'finish-add-completions t)) 1943 (throw 'finish-add-completions t))
1945 (error 1944 (error
1946 ;; Check for failure in scan-sexps 1945 ;; Check for failure in scan-sexps
1947 (if (or (string-equal (nth 1 e) 1946 (if (member (nth 1 e)
1948 "Containing expression ends prematurely") 1947 '("Containing expression ends prematurely"
1949 (string-equal (nth 1 e) "Unbalanced parentheses")) 1948 "Unbalanced parentheses"))
1950 ;; unbalanced paren., keep going 1949 ;; unbalanced paren., keep going
1951 ;;(ding) 1950 ;;(ding)
1952 (forward-line 1) 1951 (forward-line 1)
1953 (message "Error parsing C buffer for completions--please send bug report") 1952 (message "Error parsing C buffer for completions--please send bug report")
1954 (throw 'finish-add-completions t)))))))))) 1953 (throw 'finish-add-completions t))))))))))