From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.help Subject: Re: Using Emacs as PS converter Date: Mon, 01 Dec 2014 19:52:44 +0200 Message-ID: <83vblv6yvn.fsf@gnu.org> References: <547C83B8.4050005@alice.it> NNTP-Posting-Host: plane.gmane.org X-Trace: ger.gmane.org 1417456390 12466 80.91.229.3 (1 Dec 2014 17:53:10 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 1 Dec 2014 17:53:10 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Mon Dec 01 18:53:04 2014 Return-path: Envelope-to: geh-help-gnu-emacs@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 1XvV9k-0002gT-9s for geh-help-gnu-emacs@m.gmane.org; Mon, 01 Dec 2014 18:53:04 +0100 Original-Received: from localhost ([::1]:33004 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XvV9k-0003rk-0C for geh-help-gnu-emacs@m.gmane.org; Mon, 01 Dec 2014 12:53:04 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:44247) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XvV9R-0003rW-R1 for help-gnu-emacs@gnu.org; Mon, 01 Dec 2014 12:52:51 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XvV9M-00045u-0o for help-gnu-emacs@gnu.org; Mon, 01 Dec 2014 12:52:45 -0500 Original-Received: from mtaout28.012.net.il ([80.179.55.184]:52380) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XvV9L-00045d-PY for help-gnu-emacs@gnu.org; Mon, 01 Dec 2014 12:52:39 -0500 Original-Received: from conversion-daemon.mtaout28.012.net.il by mtaout28.012.net.il (HyperSendmail v2007.08) id <0NFW00F00ZYQGA00@mtaout28.012.net.il> for help-gnu-emacs@gnu.org; Mon, 01 Dec 2014 19:50:11 +0200 (IST) Original-Received: from HOME-C4E4A596F7 ([87.69.4.28]) by mtaout28.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0NFX00CUU07NA030@mtaout28.012.net.il> for help-gnu-emacs@gnu.org; Mon, 01 Dec 2014 19:50:11 +0200 (IST) In-reply-to: <547C83B8.4050005@alice.it> X-012-Sender: halo1@inter.net.il X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 80.179.55.184 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:101353 Archived-At: > Date: Mon, 01 Dec 2014 16:05:28 +0100 > From: Angelo Graziosi > > Out of curiosity, I wonder if one can use Emacs as a postscript > converter.. Suppose I have a file foo.txt. If I visit it and the > > M-x ps-spool-buffer-with-faces > > the result is in a *PostScript* buffer that I can save as foo.ps. > > But what if one wants use that from command line o shell script? > > I have tried this: > > $ emacs --batch foo.txt -f ps-spool-buffer-with-faces --visit > \*PostScript\* -f save-buffer > > Formatting... 0% > Collecting face information... > Formatting...100% > Formatting...done > Wrote /home/angelo/work/*PostScript* > > > but '*PostScript*' is saved empty... > > $ ls -lrt > ... > ... 0 1 dic 15.54 *PostScript* > > > Where is the error? > > TIA, > Angelo. > > I don't know, but this minor variation works for me: emacs -batch foo.c -f ps-spool-buffer-with-faces --eval "(progn (switch-to-buffer \"*PostScript*\") (write-file \"foo.ps\"))"