all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Re: Using Emacs as PS converter
@ 2014-12-01 21:05 Angelo Graziosi
  2014-12-02  3:32 ` Eli Zaretskii
  0 siblings, 1 reply; 8+ messages in thread
From: Angelo Graziosi @ 2014-12-01 21:05 UTC (permalink / raw)
  To: help-gnu-emacs@gnu.org

Eli Zaretskii wrote:
> You need to define the ps-print faces, I think.  I have something like
> this in my .emacs, which works well with black-and-white PS printers:
 > [...]
> See the section "How Ps-Print Deals With Faces" in the ps-print.el
> commentary for more about setting up faces for ps-print.

Hmm.. but when I use "M-x ps-spool-buffer-with-faces" from Emacs, the 
postscript file *has* the syntax colors!

In other words:

$ emacs -Q
$ C-x C-f foo.c

foo.c has the syntax with colors (font-lock ON by default, right?)

After loading foo.c, do

   M-x ps-spool-buffer-with-faces

and *PostScript* buffer is created. Switching to it (menu Buffers and 
clicking on the item '*PostScript*'):

   C-x C-w  foo.ps


foo.ps has the syntax colors as foo.c when visited by Emacs.


Now if from command line I do:

emacs [-Q] -batch foo.c -f ps-spool-buffer-with-faces --eval "(progn 
(switch-to-buffer \"*PostScript*\") (write-file \"foo.ps\"))"

(with or without the option -Q) it produces foo.ps in BW, *not* with 
syntax colors.


Does it mean that one, to have foo.ps with syntax colors, when produced 
from command lone as above, should setup .emacs as you suggested?

As profane, I would expect that *also* the above command line produces 
foo.ps with syntax colors... Why not? After all, that command line 
summarize in a single command all the steps I described above after 
launching "emacs -Q"... or not?


Ciao,
  Angelo.



^ permalink raw reply	[flat|nested] 8+ messages in thread
* Using Emacs as PS converter
@ 2014-12-01 15:05 Angelo Graziosi
  2014-12-01 17:16 ` Doug Lewan
  2014-12-01 17:52 ` Eli Zaretskii
  0 siblings, 2 replies; 8+ messages in thread
From: Angelo Graziosi @ 2014-12-01 15:05 UTC (permalink / raw)
  To: help-gnu-emacs

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.



^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2014-12-02  3:32 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-12-01 21:05 Using Emacs as PS converter Angelo Graziosi
2014-12-02  3:32 ` Eli Zaretskii
  -- strict thread matches above, loose matches on Subject: below --
2014-12-01 15:05 Angelo Graziosi
2014-12-01 17:16 ` Doug Lewan
2014-12-01 17:34   ` Angelo Graziosi
2014-12-01 19:58   ` Angelo Graziosi
2014-12-01 20:09     ` Eli Zaretskii
2014-12-01 17:52 ` Eli Zaretskii

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.