[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
RE: Using Emacs as PS converter
From: |
Doug Lewan |
Subject: |
RE: Using Emacs as PS converter |
Date: |
Mon, 1 Dec 2014 17:16:51 +0000 |
First, note the following in the documentation for ps-spool-buffer-with-faces:
This command works only if you are using
a window system, so it has a way to determine color values.
If you use --batch or run on a terminal, then there isn't a window system
available as far as emacs can tell. Try "emacs --batch --eval='(message
window-system)'" to see.
Next, emacs does a *lot* of things to start up, and the environment might not
always be good for doing programming kinds of things on the command line.
For example, it's only in step 23 that a buffer is guaranteed to be selected,
and that is /after/ it has handled the command line arguments (step 21). See
the info for '(elisp) Startup Summary'.
To do anything sophisticated, you should probably really be doing it in lisp
where you have real control. Even using --eval '(sample code)' on the command
line would probably be more reliable. If you want to use emacs to support shell
programming, then maybe starting it --daemon and using emacsclient is the way
to go. (On the other hand, you would then affect your whole environment and
that might complicate other things.)
--
,Doug
Douglas Lewan
Shubert Ticketing
(201) 489-8600 ext 224 or ext 4335
"This is a slow pup," he said continuing his ascent.
> -----Original Message-----
> Behalf Of Angelo Graziosi
> Sent: Monday, 2014 December 01 10:05
> Subject: Using Emacs as PS converter
>
> 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
> 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.