emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Emacs contributions, C and Lisp


From: Tom
Subject: Re: Emacs contributions, C and Lisp
Date: Sat, 1 Mar 2014 17:03:55 +0000 (UTC)
User-agent: Loom/3.14 (http://gmane.org/)

David Engster <deng <at> randomsample.de> writes:

> 
> Eli Zaretskii writes:
> > Isn't it true that all the packages that use clang for completion save
> > the buffer whenever completion is required?  At least the one I tried
> > did just that, which sounds an awful design decision to me.
> 
> Weirdly enough, while clang compiles from stdin without problems, it
> needs a file to perform completions (last I checked). So you either save
> the current file, which I agree is a no-no, or you save the current
> buffer into a temporary file (which is what semantic-clang does, which
> only exists in CEDET upstream).

This saving to file thing always bothered me, so I searched for it and 
found this in the clang api:

http://clang.llvm.org/doxygen/
group__CINDEX__TRANSLATION__UNIT.html#ga2baf83f8c3299788234c8bce55e4472e

According to this the clang_parseTranslationUnit function has an 
unsaved_files parameter and if you click its type then it says it
provides the contents of a file that has not yet been saved to disk:

http://clang.llvm.org/doxygen/structCXUnsavedFile.html


So it looks like clang has an explicit way for working with unsaved
source files which I guess was added to handle this situation in
editors.








reply via email to

[Prev in Thread] Current Thread [Next in Thread]