]> code.delx.au - gnu-emacs/blobdiff - lisp/completion.el
*** empty log message ***
[gnu-emacs] / lisp / completion.el
index 64bf8026e9d2c13de100d91108eef4efee49fff8..25b9585253601205bb25520e6dee95eccf201b6b 100644 (file)
@@ -1,7 +1,7 @@
 ;;; completion.el --- dynamic word-completion code
 
-;; Copyright (C) 1990, 1993, 1995, 1997, 2002, 2003, 2004,
-;;   2005, 2006 Free Software Foundation, Inc.
+;; Copyright (C) 1990, 1993, 1995, 1997, 2001, 2002, 2003, 2004,
+;;   2005, 2006, 2007 Free Software Foundation, Inc.
 
 ;; Maintainer: FSF
 ;; Keywords: abbrev convenience
@@ -1885,7 +1885,7 @@ Prefix args ::
     (save-excursion
       (goto-char (point-min))
       (catch 'finish-add-completions
-       (with-syntax-table completion-c-def-syntax-table
+        (with-syntax-table completion-c-def-syntax-table
           (while t
             ;; we loop here only when scan-sexps fails
             ;; (i.e. unbalance exps.)
@@ -1895,8 +1895,7 @@ Prefix args ::
                   (cond
                    ((= (preceding-char) ?#)
                     ;; preprocessor macro, see if it's one we handle
-                    (setq string (buffer-substring (point) (+ (point) 6)))
-                    (cond ((member string '("define" "ifdef "))
+                    (cond ((looking-at "\\(define\\|ifdef\\)\\>")
                            ;; skip forward over definition symbol
                            ;; and add it to database
                            (and (forward-word 2)
@@ -1944,9 +1943,9 @@ Prefix args ::
                (throw 'finish-add-completions t))
               (error
                ;; Check for failure in scan-sexps
-               (if (or (string-equal (nth 1 e)
-                                     "Containing expression ends prematurely")
-                       (string-equal (nth 1 e) "Unbalanced parentheses"))
+               (if (member (nth 1 e)
+                           '("Containing expression ends prematurely"
+                             "Unbalanced parentheses"))
                    ;; unbalanced paren., keep going
                    ;;(ding)
                    (forward-line 1)