help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Using PrintFile to substitute print commands in the menu in Windows


From: Eli Zaretskii
Subject: Re: Using PrintFile to substitute print commands in the menu in Windows XP
Date: Fri, 11 May 2007 21:34:50 +0300

> From: rajeshthomas@gmail.com
> Date: 10 May 2007 06:16:19 -0700
> 
> how can i use the PrintFile utility to print from emacs. i am
> running emacs version 22 on Windows XP. i have installed
> the PrintFile program and now i want to get the print-buffer and
> print-region commands to work with the PrintFile utility.

Do you really need PrintFile?  Usually, Emacs 22 on Windows prints to
the right printer by default.  Did you try that, and if you did, what
happened?

> i downloaded the below lisp code that i got through google, and it
> works
> fine, but it doesn't substitute the print-region and print-buffer
> commands.
> (defun jjprintfile ()
>   "Print _from disk_ the file named the same as the current buffer
> using the great PrintFile freeware program.  Be sure to save the file
> first to print with the latest changes."
>   (interactive)
>   (shell-command (format "PRFILE32.EXE %s"
>                          (buffer-file-name))))

You don't need this.  All you need is to customize the name of the
print command and tell it to use the /q switch, like this:

 (setq printer-name nil)
 (setq lpr-command "C:/Program Files/PrintFile/prfile32.exe")
 (setq lpr-switches '("/q"))
 (setq ps-lpr-command "C:/Program Files/PrintFile/prfile32.exe")
 (setq ps-lpr-switches '("/q"))

This sets up both regular and PostScript printing commands to use
PrintFile (assuming your printer supports PostScript).




reply via email to

[Prev in Thread] Current Thread [Next in Thread]