aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStefan Monnier2006-10-07 15:57:36 +0000
committerStefan Monnier2006-10-07 15:57:36 +0000
commit612f91f027769219cc008abec1a8be3bb0c1b668 (patch)
tree5c708ef4f62edf1067bb30301403db56ff85bc6f
parent0736daff192c99532171587b6f81ee0304a9e06b (diff)
downloademacs-612f91f027769219cc008abec1a8be3bb0c1b668.tar.gz
emacs-612f91f027769219cc008abec1a8be3bb0c1b668.zip
(add-completions-from-c-buffer):
Don't presume an error's second element is a string. Use looking-at rather than buffer-substring + member.
-rw-r--r--lisp/ChangeLog10
-rw-r--r--lisp/completion.el11
2 files changed, 13 insertions, 8 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 1360dc3617c..db715a29906 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,9 @@
12006-10-07 Stefan Monnier <monnier@iro.umontreal.ca>
2
3 * completion.el (add-completions-from-c-buffer):
4 Don't presume an error's second element is a string.
5 Use looking-at rather than buffer-substring + member.
6
12006-10-07 Eli Zaretskii <eliz@gnu.org> 72006-10-07 Eli Zaretskii <eliz@gnu.org>
2 8
3 * mail/rmail.el (rmail-redecode-body): If the old encoding is 9 * mail/rmail.el (rmail-redecode-body): If the old encoding is
@@ -19,8 +25,8 @@
19 25
202006-10-07 Johan Bockg,be(Brd <bojohan@dd.chalmers.se> 262006-10-07 Johan Bockg,be(Brd <bojohan@dd.chalmers.se>
21 27
22 * mouse-sel.el (mouse-insert-selection-internal): Use 28 * mouse-sel.el (mouse-insert-selection-internal):
23 insert-for-yank, so that yank handlers are run. 29 Use insert-for-yank, so that yank handlers are run.
24 30
252006-10-07 Kim F. Storm <storm@cua.dk> 312006-10-07 Kim F. Storm <storm@cua.dk>
26 32
diff --git a/lisp/completion.el b/lisp/completion.el
index 64bf8026e9d..53dfd7521a5 100644
--- a/lisp/completion.el
+++ b/lisp/completion.el
@@ -1885,7 +1885,7 @@ Prefix args ::
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.)
@@ -1895,8 +1895,7 @@ Prefix args ::
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)
@@ -1944,9 +1943,9 @@ Prefix args ::
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)