 ;; contents of the code-completion buffer with the new code-completion results
 ;; and ensures that the buffer is visible.
 (defun clang-completion-sentinel (proc event)
-  (let* ((all-lines (split-string clang-cc-result-string "\n"))
+  (let* ((all-lines (split-string clang-result-string "\n"))
          (completion-lines (filter 'is-completion-line all-lines)))
     (if (consp completion-lines)
         (progn

                (delete-process cc-proc)))

          (setq clang-completion-substring "")
          (setq clang-cc-result-string "")
          (setq clang-completion-buffer cc-buffer-name)
            
          (let ((cc-proc
                 (if (equal clang-completion-prefix-header "")
                     (start-process "Clang Code-Completion" cc-buffer-name
                                    clang-cc "-fsyntax-only" ccstring 
                                    (buffer-file-name))
                     (start-process "Clang Code-Completion" cc-buffer-name
                                    clang-cc "-fsyntax-only" ccstring 
                                    "-include-pch" 
                                    (concat clang-completion-prefix-header ".pch")
                                    (buffer-file-name)))))

;; file up to the point where the cursor is located. Therefore, Clang
;; needs all of the various compilation flags (include paths, dialect
;; options, etc.) to provide code-completion results. Currently, these
;; need to be placed into the clang-flags variable in a format
;; acceptable to clang. This is a hack: patches are welcome to
;; improve the interface between this Emacs mode and Clang! 
;;

;;; Code:
;;; The clang executable
(defcustom clang "clang"
  "The location of the Clang compiler executable"
  :type 'file
  :group 'clang-completion-mode)

;;; Extra compilation flags to pass to clang.
(defcustom clang-flags ""
  "Extra flags to pass to the Clang executable.
This variable will typically contain include paths, e.g., -I~/MyProject."
  :type 'string
