[cfe-commits] r93299 - /cfe/trunk/utils/clang-completion-mode.el
John McCall
rjmccall at apple.com
Tue Jan 12 22:44:51 PST 2010
Author: rjmccall
Date: Wed Jan 13 00:44:51 2010
New Revision: 93299
URL: http://llvm.org/viewvc/llvm-project?rev=93299&view=rev
Log:
Insert clang-flags into the clang command. Currently it needs to be a list;
future work should permit strings (by splitting them into a list o' strings).
Modified:
cfe/trunk/utils/clang-completion-mode.el
Modified: cfe/trunk/utils/clang-completion-mode.el
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/utils/clang-completion-mode.el?rev=93299&r1=93298&r2=93299&view=diff
==============================================================================
--- cfe/trunk/utils/clang-completion-mode.el (original)
+++ cfe/trunk/utils/clang-completion-mode.el Wed Jan 13 00:44:51 2010
@@ -144,12 +144,21 @@
))))
(defun clang-complete ()
- (let ((ccstring (concat (buffer-file-name)
- ":"
- (number-to-string (+ 1 (current-line)))
- ":"
- (number-to-string (+ 1 (current-column)))))
- (cc-buffer-name (concat "*Clang Completion for " (buffer-name) "*")))
+ (let* ((cc-point (concat (buffer-file-name)
+ ":"
+ (number-to-string (+ 1 (current-line)))
+ ":"
+ (number-to-string (+ 1 (current-column)))))
+ (cc-pch (if (equal clang-completion-prefix-header "") nil
+ (list "-include-pch"
+ (concat clang-completion-prefix-header ".pch"))))
+ (cc-flags (if (listp clang-flags) clang-flags nil))
+ (cc-command (append `(,clang "-cc1" "-fsyntax-only")
+ cc-flags
+ cc-pch
+ `("-code-completion-at" ,cc-point)
+ (list (buffer-file-name))))
+ (cc-buffer-name (concat "*Clang Completion for " (buffer-name) "*")))
;; Start the code-completion process
(if (buffer-file-name)
(progn
@@ -162,18 +171,9 @@
(setq clang-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 "-cc1" "-fsyntax-only"
- "-code-completion-at" ccstring
- (buffer-file-name))
- (start-process "Clang Code-Completion" cc-buffer-name
- clang "-cc1" "-fsyntax-only"
- "-code-completion-at" ccstring
- "-include-pch"
- (concat clang-completion-prefix-header ".pch")
- (buffer-file-name)))))
+ (let ((cc-proc (apply 'start-process
+ (append (list "Clang Code-Completion" cc-buffer-name)
+ cc-command))))
(set-process-filter cc-proc 'clang-completion-stash-filter)
(set-process-sentinel cc-proc 'clang-completion-sentinel)
)))))
More information about the cfe-commits
mailing list