From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Tom Newsgroups: gmane.emacs.devel Subject: Re: Emacs contributions, C and Lisp Date: Sat, 1 Mar 2014 17:03:55 +0000 (UTC) Message-ID: References: <87zjlf6tdx.fsf@fencepost.gnu.org> <83sir7yue7.fsf@gnu.org> <8761o3dlak.fsf@wanadoo.es> <83bnxuzyl4.fsf@gnu.org> <871tyqes5q.fsf@wanadoo.es> <834n3lzux6.fsf@gnu.org> <87ppm9d3y4.fsf@wanadoo.es> <83ob1ty4qr.fsf@gnu.org> <87ha7lcxki.fsf@wanadoo.es> <83ios0xwcv.fsf@gnu.org> <87bnxscr0x.fsf@wanadoo.es> <83eh2oxpnw.fsf@gnu.org> <877g8gcl52.fsf@wanadoo.es> <871tyn4n1l.fsf@fencepost.gnu.org> <531054E2.6040200@dancol.org> <87k3cf3601.fsf@fencepost.gnu.org> <531060AA.8040103@dancol.org> <838usvw9zm.fsf@gnu.org> <531104D9.4050601@dancol.org> <83ob1quz4n.fsf@gnu.org> <87d2i6cniv.fsf@engster.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1393693467 26697 80.91.229.3 (1 Mar 2014 17:04:27 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 1 Mar 2014 17:04:27 +0000 (UTC) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat Mar 01 18:04:36 2014 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1WJnL1-0004Ft-7b for ged-emacs-devel@m.gmane.org; Sat, 01 Mar 2014 18:04:35 +0100 Original-Received: from localhost ([::1]:60328 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WJnL0-0005Pk-Or for ged-emacs-devel@m.gmane.org; Sat, 01 Mar 2014 12:04:34 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:58391) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WJnKt-0005P7-86 for emacs-devel@gnu.org; Sat, 01 Mar 2014 12:04:32 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WJnKn-0008I3-Rp for emacs-devel@gnu.org; Sat, 01 Mar 2014 12:04:27 -0500 Original-Received: from plane.gmane.org ([80.91.229.3]:43038) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WJnKn-0008Hr-Ku for emacs-devel@gnu.org; Sat, 01 Mar 2014 12:04:21 -0500 Original-Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1WJnKk-0004AX-OC for emacs-devel@gnu.org; Sat, 01 Mar 2014 18:04:18 +0100 Original-Received: from 195-38-103-171.pool.digikabel.hu ([195.38.103.171]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sat, 01 Mar 2014 18:04:18 +0100 Original-Received: from adatgyujto by 195-38-103-171.pool.digikabel.hu with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sat, 01 Mar 2014 18:04:18 +0100 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 34 Original-X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: sea.gmane.org User-Agent: Loom/3.14 (http://gmane.org/) X-Loom-IP: 195.38.103.171 (Opera/9.80 (Windows NT 6.1) Presto/2.12.388 Version/12.16) X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 80.91.229.3 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:170004 Archived-At: David Engster 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.