Can I change the location of the file emacs writes to in the process of printing?

1.1k Views Asked by At

Our network system is set up such that we can not write directly to the root directory (C:) so I get the following error when attempting to print.

Spooling with options (page headers are not supported)...
direct-print-region-helper: Opening output file: permission denied, c:/IP_139.222.92.102

If I could somehow change the location that emacs is attempting to write to (anywhere else) it would likely work.

GNU emacs 24.3.1 running on MS Win 7

2

There are 2 best solutions below

8
Chris On

Adjust pr-temp-dir, e.g.:

(setq pr-temp-dir "c:/some/other/location")

After requiring 'printing, C-h v pr-temp-dir on my Linux system gives:

pr-temp-dir is a variable defined in `printing.el'.
Its value is "/tmp/"

Documentation:
Specify a directory for temporary files during printing.

See also `pr-ps-temp-file' and `pr-file-modes'.

You can customize this variable.

You may have to play with quoting or escaping a Windows-style path.

0
A. Sarma On

I tried various solutions given in this thread and others with no success. I saw someone has commented about quoting the slashes. So, I entered

(setq printer-name "\\\\MyComputer\\HP8600")

(setq ps-printer-name "\\\\MyComputer\\HP8600")

in the .emacs file, and SUCCESS. Obviously you will have to change the names "MyComputer" to match your computer and HP8600 to your printer name (both available via Control Panel).