From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: C-code : printing into a buffer Date: Mon, 01 Jun 2009 10:31:57 -0400 Message-ID: References: <21709273.2012831243588416702.JavaMail.www@wwinf4622> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1243866762 27237 80.91.229.12 (1 Jun 2009 14:32:42 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 1 Jun 2009 14:32:42 +0000 (UTC) Cc: "Stephen J. Turnbull" , "Emacs Dev \[emacs-devel\]" To: alinsoar@voila.fr Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Jun 01 16:32:38 2009 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1MB8Z3-0005Na-5O for ged-emacs-devel@m.gmane.org; Mon, 01 Jun 2009 16:32:37 +0200 Original-Received: from localhost ([127.0.0.1]:45821 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MB8Z2-0002OE-Fr for ged-emacs-devel@m.gmane.org; Mon, 01 Jun 2009 10:32:36 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MB8YV-00026o-JW for emacs-devel@gnu.org; Mon, 01 Jun 2009 10:32:03 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MB8YR-00024E-OX for emacs-devel@gnu.org; Mon, 01 Jun 2009 10:32:03 -0400 Original-Received: from [199.232.76.173] (port=39862 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MB8YR-000249-HY for emacs-devel@gnu.org; Mon, 01 Jun 2009 10:31:59 -0400 Original-Received: from ironport2-out.pppoe.ca ([206.248.154.182]:51104 helo=ironport2-out.teksavvy.com) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1MB8YR-0004zY-4i for emacs-devel@gnu.org; Mon, 01 Jun 2009 10:31:59 -0400 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Ah8FAHuDI0pFpZIv/2dsb2JhbACBT8o5hAwF X-IronPort-AV: E=Sophos;i="4.41,284,1241409600"; d="scan'208";a="39401603" Original-Received: from smtp.pppoe.ca (HELO smtp.teksavvy.com) ([65.39.196.238]) by ironport2-out.teksavvy.com with ESMTP; 01 Jun 2009 10:31:58 -0400 Original-Received: from pastel.home ([69.165.146.47]) by smtp.teksavvy.com (Internet Mail Server v1.0) with ESMTP id IUJ34315; Mon, 01 Jun 2009 10:34:15 -0400 Original-Received: by pastel.home (Postfix, from userid 20848) id C88F07FB6; Mon, 1 Jun 2009 10:31:57 -0400 (EDT) In-Reply-To: <21709273.2012831243588416702.JavaMail.www@wwinf4622> (A. Soare's message of "Fri, 29 May 2009 11:13:36 +0200 (CEST)") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.94 (gnu/linux) X-detected-operating-system: by monty-python.gnu.org: Genre and OS details not recognized. X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:111249 Archived-At: > If you call printf from the C-level of the emacs-lisp evaluator, > printf does not know nothing about lisp level. So the problem would be > beyond the lisp evaluator. The problem is about the linux > system... and from the lisp code to redirect the printf output > temporary to an emacs buf. If you want to `printf' to a buffer, what I recommend is to use a trick like: - create a dummy Emacs process (start-process "lstream" "cat"). - fprintf (XPROCESS (proc)->outfd, "toto %d titi", ...); Stefan