Pretty-Printing with XEmacs under FC12

This post was written by eli on May 19, 2012
Posted Under: Linux,Software

Yet another thing that should have been so simple, but required hacking. Using (Beta) Xemacs 21.5.29, it didn’t have a menu item for pretty printing. Nor was there a clear way to connect with CUPS.

First thing first, make sure to have a nice popup for printing. If not for any other reason, it gives me a chance to abort printing resulting from accidentally pressing the “Print” toolbar button.

# yum install gtklp

Then type “gtklp” at command prompt to set up things. In particular, go to Output > Sheet Usage and change “Sheets per page” to 1 if it happened to be 9 (making very tiny printouts). After making sure gtklp remembers that setting, uncheck GtkLP > Save all preferences on exit (it’s a bad thing, I think).

For the record, gtklp expects postscript in its standard input, so it’s perfect for working with XEmacs.

In XEmacs, choose Options > Edit init file, and add the following (in the end of the file, I guess)

 '(ps-paper-type (quote a4))
 '(lpr-command "gtklp"))

(easy-menu-add-item nil '("file") ["Pretty-print this buffer" ps-print-buffer-with-faces ] "Page Setup...")

(setq-default toolbar-print-function 'ps-print-buffer-with-faces)

This adds a not-so-elegant (but working) pretty-print menu item in the file menu. But the last command does something much better: It turns the “print” icon into pretty-print.

Add a Comment

required, use real name
required, will not be published
optional, your blog address