From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.help Subject: Re: Printing from WindowXP version of emacs Date: Fri, 23 Dec 2005 10:41:19 +0200 Message-ID: References: <1134660719.186074.250590@z14g2000cwz.googlegroups.com> NNTP-Posting-Host: main.gmane.org X-Trace: sea.gmane.org 1135327611 24260 80.91.229.2 (23 Dec 2005 08:46:51 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Fri, 23 Dec 2005 08:46:51 +0000 (UTC) Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Fri Dec 23 09:46:49 2005 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1EpiZb-0007aT-6o for geh-help-gnu-emacs@m.gmane.org; Fri, 23 Dec 2005 09:46:47 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Epiad-000056-Gi for geh-help-gnu-emacs@m.gmane.org; Fri, 23 Dec 2005 03:47:51 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1EpiYr-0008Lj-OH for help-gnu-emacs@gnu.org; Fri, 23 Dec 2005 03:46:02 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1EpiYk-0008Kn-8z for help-gnu-emacs@gnu.org; Fri, 23 Dec 2005 03:45:55 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1EpiWz-00080O-LZ for help-gnu-emacs@gnu.org; Fri, 23 Dec 2005 03:44:06 -0500 Original-Received: from [192.114.186.17] (helo=gandalf.inter.net.il) by monty-python.gnu.org with esmtp (Exim 4.34) id 1EpiWF-0008MB-Lq for help-gnu-emacs@gnu.org; Fri, 23 Dec 2005 03:43:19 -0500 Original-Received: from nitzan.inter.net.il (nitzan.inter.net.il [192.114.186.20]) by gandalf.inter.net.il (MOS 3.7.1-GA) with ESMTP id HIR43000; Fri, 23 Dec 2005 10:41:21 +0200 (IST) Original-Received: from HOME-C4E4A596F7 (IGLD-80-230-58-219.inter.net.il [80.230.58.219]) by nitzan.inter.net.il (MOS 3.7.2-GA) with ESMTP id CGV02560 (AUTH halo1); Fri, 23 Dec 2005 10:41:17 +0200 (IST) Original-To: help-gnu-emacs@gnu.org In-reply-to: (message from Ilya Zakharevich on Thu, 22 Dec 2005 23:11:24 +0000 (UTC)) X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:32184 Archived-At: > From: Ilya Zakharevich > Date: Thu, 22 Dec 2005 23:11:24 +0000 (UTC) > Bcc: ilya@gnu.org > Originator: ilya@powdermilk.math.berkeley.edu > > > Yes. If it's encoding you were asking about, then I don't know how > > this works in general for non-ASCII files on Windows. I guess it's > > similar to the way Windows uses the codepage that depends on the > > current language environment, but that's a guess. > > Easy to check. Make some file with bytes in the rage 160..255, then > do > > chcp 1252 > copy this-file LPT1 > chcp 1251 > copy this-file LPT1 > chcp 866 > copy this-file LPT1 Yes, easy. > > In any case, I don't think encoding is the issue in this thread, which > > is about how to print from Emacs. People who say it doesn't work for > > them cannot print even simple ASCII text, where encoding is not an > > issue. > > Maybe. But what I was reacting on was your initial claim similar to > "ALL one needs for printing under Win* is to know a name of a pipe". > In my book, "printing ASCII" is hardly equivalent to "printing". I didn't realize I was talking to lawyers, so forgive me if my wording was not rigorous enough. > > > > > Are long lines wrapped or lost? What is the page size in lines of > > > > > input? Should line be terminated by CRLF, CR, or LF? > > > > > Can't say, it depends on the printer's setup, its driver software, and > > > > any other software that sits in between the application that sent the > > > > text and the wire. > > > > I'm puzzled again: if you can't say, how can you claim you know how to > > > print? > > > Because an application that prints doesn't care about these intimate > > details of the printer. > > ??? IIRC, now we are discussing not the printer, but the pipe... > Anyway, consider these questions as concerning a pipe. If you send text to the pipe (using COPY or file I/O, like Emacs does), you don't need to be bothered by these details (with the exception of the EOLs, which I think must be CRLF). They are taken care of by the machinery that takes over once the text winds up in the pipe. > (Yet another question is how to *force* a sequence of bytes to be > recognized as TEXT [as opposed to MetaFile or > RAW_PRINTER_COMMANDS].) I think the COPY method cannot send RAW commands or EMF. I think to send RAW and EMF one needs to use suitable functions of the Windows API, not simple file I/O. > > > My expectation is that you are wrong. I expect that the following is > > > true on "modern Win* systems" too: you can print an arbitrary stuff > > > "to a file" (as opposed "to a printer"); then sending this file (with > > > printer commands, or MetaFile info - I do not know) to LPT1 will > > > produce not the text representation of bytes in the file, but the > > > initial (graphical) print job. > > > Well, you are wrong, because you assume that LPT1 goes directly to the > > printer, but it's not. > > According to the MS links you posted, I'm right; this pipes accepts > RAW_PRINTER_COMMANDS. How it distinguishes it from "plain text" > (which it supports "too", whatever it means) is not documented... I think it distinguishes given the API calls you use to send the stuff. > Only if you print ASCII only you can forget about encodings I think this is also true if you use the encoding native to the current locale, since the printer most probably supports that by default.