0

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

legoscia
  • 39,593
  • 22
  • 116
  • 167
Jim Maas
  • 1,481
  • 2
  • 16
  • 36

2 Answers2

1

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).

A. Sarma
  • 11
  • 2
0

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.

ChrisGPT was on strike
  • 127,765
  • 105
  • 273
  • 257
  • I'm still getting this: Opening output file: permission denied, c:/IP_139.222.92.102 and when I check the value of pr-temp-dir it appears to be redirected correctly ... pr-temp-dir's value is "x:/emacs" Documentation: Not documented as a variable. – Jim Maas Feb 11 '14 at 12:10
  • @user207146, that's strange. Try changing it via Customize: `M-x customize-group RET printing RET`, navigate to *Pr Temp Dir*, expand it with `RET` on the arrow, modify, tab to the *State* button, `RET`, and choose how to save it from the menu. Two questions about this process: (1) Before changing, is it set to `c:/`? (2) After saving, does your system print properly? – ChrisGPT was on strike Feb 11 '14 at 12:48
  • Thanks for patience! No didn't work. Got to the customize setting and it was set to x:\emacs but it said "saved outside customize" but when I went to the state button and saved it said it had been saved within customize. Saved it all, shut emacs down, restarted, tried to print and got same error Send current buffer to default printer? y Spooling with options (page headers are not supported)... direct-print-region-helper: Opening output file: permission denied, c:/IP_139.222.92.102 .............. so answer to questions 1) it had been changed already, and 2) still not saving file – Jim Maas Feb 11 '14 at 13:13
  • @user207146, this might not be a temporary file. Emacs might literally be trying to spool the print job there, thinking it's your network printer. Could you add your full printing settings to your question? – ChrisGPT was on strike Feb 11 '14 at 13:26
  • Happy too but I don't know how, is it complicated? – Jim Maas Feb 11 '14 at 13:48
  • @user207146, well, what did you put into your configuration to set up printing in the first place? Emacs needed to learn about your network printer somehow... – ChrisGPT was on strike Feb 11 '14 at 13:50
  • Nothing, just expected to use "default" printer, do I need to specify it explicitly? – Jim Maas Feb 11 '14 at 14:22
  • let us [continue this discussion in chat](http://chat.stackoverflow.com/rooms/47243/discussion-between-chris-and-user207146) – ChrisGPT was on strike Feb 11 '14 at 14:29