all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: "Lennart Borgman (gmail)" <lennart.borgman@gmail.com>
To: Jason Rumney <jasonr@gnu.org>
Cc: emacs-pretest-bug@gnu.org, Eli Zaretskii <eliz@gnu.org>
Subject: Re: 23.0.50; ps-print-buffer-with-faces hangs on w32
Date: Thu, 10 Jan 2008 17:11:36 +0100	[thread overview]
Message-ID: <478643B8.5010903@gmail.com> (raw)
In-Reply-To: <47862D83.3030709@gnu.org>

Jason Rumney wrote:
> Lennart Borgman (gmail) wrote:
>>>
>>> What exactly does this mean?
>>>
>>> Does any Emacs variable have the value "C:\\PRN"?
>>
>> The variable `printer' above.
> I don't have a variable `printer', is this from an external package you 
> have installed?

Hi Jason,

No, it is a variable in the function I mentioned in the bug report:

   Emacs hangs in direct-print-region-helper in the call to

     (write-region start end printer t 0)

   at the end of the function. Emacs is completely hanged. I have to
   kill Emacs from Windows Task Manager.

This function is in dos-w32.el.

> I do have a variable `printer-name', but it's default value on Windows 
> is the device name "PRN",

I have the same.

> not "C:\\PRN"

This is what Emacs has translated "PRN" to at the end of the function above.

>>> What is a "Windows printer"?
>>
>> I forgot what these printers are called. It seems like they are called 
>> "GDI printers" or "winprinters".
> Calling them winprinters suggests that there is something that makes 
> them a win over other more functional printers.

Maybe.

> Really the printer 
> hardware is not the issue, often the printer will be better supported by 
> Free Software like CUPS than by the manufacturers own Windows drivers, 
> so calling them Windows printers is also misleading. What you really 
> mean is that the Windows printer drivers that the manufacturer has 
> supplied are limited to supporting only GDI based printing, as they do 
> not expose a character device (and are connected via USB, so the COM or 
> PAR character devices are not automatically available)

Correct.

> that could be 
> used to print directly to the printer in text mode or whatever command 
> language(s) that the printer supports natively (eg Postscript, PCL or 
> ESC/P). This problem can often be worked around by sharing the printer 
> from Windows, and setting the printer-name within Emacs to the network 
> share path of the printer (eg "//localhost/printer").

Yes, that is perhaps a nice little trick. Though I had never had any 
reason to test it, but if you think it works then maybe this is 
something worth mentioning on (info "(emacs) Windows Printing")?

> But it is unlikely that a printer with such limited drivers supports 
> Postscript natively, so to use the ps-print commands, you'll need to set 
> up a software postscript interpreter such as Ghostscript anyway.

That is correct, but it is not the problem I am reporting. I must have 
made some bad mistake in my initial bug report since both you and Eli 
misunderstood me this way.

What I was reporting was that under certain (rather common conditions) 
Emacs can hang if a user tries to print a file. Emacs hangs very badly 
and can not be interrupted. You have to kill Emacs from outside - and 
that of course means that the user can loose data.

(It has nothing per se with ps-print-* to do, it hangs in the same way 
if one uses print-buffer. I actually did M-x ps-print-buffer just to see 
how Emacs failed.)

So my question is what we can do about this?

I doubt that there is anything we easily can do technically about it 
since I notice that in a cmd.exe console

    copy /b some-non-emtpy-file.txt PRN:

hangs the console window rather badly.

I think however that we should do something since GDI printers are 
common on w32. What we can do is to warn the user. The best way IMO 
would be to add a y/n question in the function 
direct-print-region-helper in dos-w32.el that warns the user that Emacs 
might hang. (And of course an option to bypass the question.)

  reply	other threads:[~2008-01-10 16:11 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-01-09 16:20 23.0.50; ps-print-buffer-with-faces hangs on w32 Lennart Borgman (gmail)
2008-01-09 17:09 ` Jason Rumney
2008-01-09 18:09   ` Lennart Borgman (gmail)
2008-01-09 19:12     ` Eli Zaretskii
2008-01-09 19:16       ` Lennart Borgman (gmail)
2008-01-10  4:09         ` Eli Zaretskii
2008-01-10  7:57           ` Lennart Borgman (gmail)
2008-01-09 18:24 ` Vinicius Jose Latorre
2008-01-09 18:02   ` Lennart Borgman (gmail)
2008-01-09 20:14     ` Vinicius Jose Latorre
2008-01-10 14:36     ` Jason Rumney
2008-01-10 16:11       ` Lennart Borgman (gmail) [this message]
2008-01-11 10:28         ` Eli Zaretskii
2008-01-11 10:47           ` Jason Rumney
2008-01-11 10:59             ` Eli Zaretskii
2008-01-11 11:29               ` Lennart Borgman (gmail)
2008-01-11 12:50               ` Vinicius Jose Latorre
2008-01-11 15:29                 ` Eli Zaretskii
2008-01-14 15:42                   ` Vinicius Jose Latorre
2008-01-14 20:32                     ` Eli Zaretskii

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=478643B8.5010903@gmail.com \
    --to=lennart.borgman@gmail.com \
    --cc=eliz@gnu.org \
    --cc=emacs-pretest-bug@gnu.org \
    --cc=jasonr@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.