comparison man/msdog.texi @ 24096:083c21910c49

(MS-DOS Printing): Rewrite section.
author Andrew Innes <andrewi@gnu.org>
date Sun, 17 Jan 1999 19:08:32 +0000
parents 8983dda2d520
children fd1968847853
comparison
equal deleted inserted replaced
24095:8983dda2d520 24096:083c21910c49
351 351
352 @node MS-DOS Printing 352 @node MS-DOS Printing
353 @section Printing and MS-DOS 353 @section Printing and MS-DOS
354 354
355 Printing commands, such as @code{lpr-buffer} (@pxref{Hardcopy}) and 355 Printing commands, such as @code{lpr-buffer} (@pxref{Hardcopy}) and
356 @code{ps-print-buffer} (@pxref{Postscript}) can work in MS-DOS by 356 @code{ps-print-buffer} (@pxref{Postscript}) can work in MS-DOS and
357 sending the output to one of the printer ports, if a Unix-style @code{lpr} 357 MS-Windows by sending the output to one of the printer ports, if a
358 program is unavailable. A few DOS-specific variables control how this 358 Unix-style @code{lpr} program is unavailable. This behaviour is
359 works. 359 controlled by the same variables that control printing with @code{lpr}
360 360 on Unix (@pxref{Hardcopy}, @pxref{Postscript Variables}), but the
361 @vindex dos-printer 361 defaults for these variables on MS-DOS and MS-Windows are not the same
362 as the defaults on Unix.
363
364 @vindex printer-name
362 If you want to use your local printer, printing on it in the usual DOS 365 If you want to use your local printer, printing on it in the usual DOS
363 manner, then set the Lisp variable @code{dos-printer} to the name of the 366 manner, then set the Lisp variable @code{lpr-command} to @code{""} (its
364 printer port---for example, @code{"PRN"}, the usual local printer port 367 default value) and @code{printer-name} to the name of the printer
365 (that's the default), or @code{"LPT2"} or @code{"COM1"} for a serial 368 port---for example, @code{"PRN"}, the usual local printer port (that's
366 printer. You can also set @code{dos-printer} to a file name, in which 369 the default), or @code{"LPT2"}, or @code{"COM1"} for a serial printer.
367 case ``printed'' output is actually appended to that file. If you set 370 You can also set @code{printer-name} to a file name, in which case
368 @code{dos-printer} to @code{"NUL"}, printed output is silently 371 ``printed'' output is actually appended to that file. If you set
372 @code{printer-name} to @code{"NUL"}, printed output is silently
369 discarded (sent to the system null device). 373 discarded (sent to the system null device).
370 374
371 If you set @code{dos-printer} to a file name, it's best to use an 375 On MS-Windows, when the Windows network software is installed, you can
376 also use a printer shared by another machine by setting
377 @code{printer-name} to the UNC share name for that printer--for example,
378 @code{"//joes_pc/hp4si"}. (It doesn't matter whether you use forward
379 slashes or backslashes here.) To find out the names of shared printers,
380 run the command @samp{net view} at a DOS command prompt to obtain a list
381 of servers, and @samp{net view server-name} to see the names of printers
382 (and directories) shared by that server.
383
384 If you set @code{printer-name} to a file name, it's best to use an
372 absolute file name. Emacs changes the working directory according to 385 absolute file name. Emacs changes the working directory according to
373 the default directory of the current buffer, so if the file name in 386 the default directory of the current buffer, so if the file name in
374 @code{dos-printer} is relative, you will end up with several such files, 387 @code{printer-name} is relative, you will end up with several such
375 each one in the directory of the buffer from which the printing was 388 files, each one in the directory of the buffer from which the printing
376 done. 389 was done.
377 390
378 @findex print-buffer @r{(MS-DOS)} 391 @findex print-buffer @r{(MS-DOS)}
379 @findex print-region @r{(MS-DOS)} 392 @findex print-region @r{(MS-DOS)}
380 @vindex lpr-headers-switches @r{(MS-DOS)} 393 @vindex lpr-headers-switches @r{(MS-DOS)}
381 The commands @code{print-buffer} and @code{print-region} call the 394 The commands @code{print-buffer} and @code{print-region} call the
382 @code{pr} program, or use special switches to the @code{lpr} program, to 395 @code{pr} program, or use special switches to the @code{lpr} program, to
383 produce headers on each printed page. MS-DOS doesn't normally have 396 produce headers on each printed page. MS-DOS and MS-Windows don't
384 these programs, so by default, the variable @code{lpr-headers-switches} 397 normally have these programs, so by default, the variable
385 is set so that the requests to print page headers are silently ignored. 398 @code{lpr-headers-switches} is set so that the requests to print page
386 Thus, @code{print-buffer} and @code{print-region} produce the same 399 headers are silently ignored. Thus, @code{print-buffer} and
387 output as @code{lpr-buffer} and @code{lpr-region}, respectively. If you 400 @code{print-region} produce the same output as @code{lpr-buffer} and
388 do have a suitable @code{pr} program (for example, from GNU Textutils), 401 @code{lpr-region}, respectively. If you do have a suitable @code{pr}
389 set @code{lpr-headers-switches} to @code{nil}; Emacs will then call 402 program (for example, from GNU Textutils), set
403 @code{lpr-headers-switches} to @code{nil}; Emacs will then call
390 @code{pr} to produce the page headers, and print the resulting output as 404 @code{pr} to produce the page headers, and print the resulting output as
391 specified by @code{dos-printer}. 405 specified by @code{printer-name}.
392 406
393 @vindex print-region-function @r{(MS-DOS)} 407 @vindex print-region-function @r{(MS-DOS)}
394 @cindex lpr usage under MS-DOS 408 @cindex lpr usage under MS-DOS
395 @vindex lpr-command @r{(MS-DOS)} 409 @vindex lpr-command @r{(MS-DOS)}
396 @vindex lpr-switches @r{(MS-DOS)} 410 @vindex lpr-switches @r{(MS-DOS)}
397 Finally, if you do have an @code{lpr} work-alike, you can set 411 Finally, if you do have an @code{lpr} work-alike, you can set the
398 @code{print-region-function} to @code{nil}. Then Emacs uses @code{lpr} 412 variable @code{lpr-command} to @code{"lpr"}. Then Emacs will use
399 for printing, as on other systems. (If the name of the program isn't 413 @code{lpr} for printing, as on other systems. (If the name of the
400 @code{lpr}, set the @code{lpr-command} variable to specify where to find 414 program isn't @code{lpr}, set @code{lpr-command} to specify where to
401 it.) 415 find it.) The variable @code{lpr-switches} has its standard meaning
416 when @code{lpr-command} is not @code{""}. If the variable
417 @code{printer-name} has a string value, it is used as the value for the
418 @code{-P} option to @code{lpr}, as on Unix.
402 419
403 @findex ps-print-buffer @r{(MS-DOS)} 420 @findex ps-print-buffer @r{(MS-DOS)}
404 @findex ps-spool-buffer @r{(MS-DOS)} 421 @findex ps-spool-buffer @r{(MS-DOS)}
405 @vindex dos-ps-printer 422 @vindex ps-printer-name
406 @vindex ps-lpr-command @r{(MS-DOS)} 423 @vindex ps-lpr-command @r{(MS-DOS)}
407 @vindex ps-lpr-switches @r{(MS-DOS)} 424 @vindex ps-lpr-switches @r{(MS-DOS)}
408 A separate variable, @code{dos-ps-printer}, defines how PostScript 425 A parallel set of variables, @code{ps-lpr-command},
409 files should be printed. If its value is a string, it is used as the 426 @code{ps-lpr-switches}, and @code{ps-printer-name} (@pxref{Postscript
410 name of the device (or file) to which PostScript output is sent, just as 427 variables}), defines how PostScript files should be printed. These
411 @code{dos-printer} is used for non-PostScript printing. (These are two 428 variables are used in the same way as the corresponding variables
412 distinct variables in case you have two printers attached to two 429 described above for non-PostScript printing. Thus, the value of
413 different ports, and only one of them is a PostScript printer.) If the 430 @code{ps-printer-name} is used as the name of the device (or file) to
414 value of @code{dos-ps-printer} is not a string, then the variables 431 which PostScript output is sent, just as @code{printer-name} is used for
415 @code{ps-lpr-command} and @code{ps-lpr-switches} (@pxref{Postscript}) 432 non-PostScript printing. (There are two distinct sets of variables in
416 control how to print PostScript files. Thus, if you have a 433 case you have two printers attached to two different ports, and only one
417 non-PostScript printer, you can set these variables to the name and the 434 of them is a PostScript printer.)
418 switches appropriate for a PostScript interpreter program (such as 435
419 Ghostscript). 436 The default value of the variable @code{ps-lpr-command} is @code{""},
437 which causes PostScript output to be sent to the printer port specified
438 by @code{ps-printer-name}, but @code{ps-lpr-command} can also be set to
439 the name of a program which will accept PostScript files. Thus, if you
440 have a non-PostScript printer, you can set this variable to the name of
441 a PostScript interpreter program (such as Ghostscript). Any switches
442 that need to be passed to the interpreter program are specified using
443 @code{ps-lpr-switches}. (If the value of @code{ps-printer-name} is a
444 string, it will be added to the list of switches as the value for the
445 @code{-P} option. This is probably only useful if you are using
446 @code{lpr}, so when using an interpreter typically you would set
447 @code{ps-printer-name} to something other than a string so it is
448 ignored.)
420 449
421 For example, to use Ghostscript for printing on an Epson printer 450 For example, to use Ghostscript for printing on an Epson printer
422 connected to @samp{LPT2} port, put this on your @file{.emacs} file: 451 connected to @samp{LPT2} port, put this on your @file{.emacs} file:
423 452
424 @example 453 @example
425 (setq dos-ps-printer t) ; @r{Anything but a string.} 454 (setq ps-printer-name t) ; Ghostscript doesn't understand -P
426 (setq ps-lpr-command "c:/gs/gs386") 455 (setq ps-lpr-command "c:/gs/gs386")
427 (setq ps-lpr-switches '("-q" "-dNOPAUSE" 456 (setq ps-lpr-switches '("-q" "-dNOPAUSE"
428 "-sDEVICE=epson" 457 "-sDEVICE=epson"
429 "-r240x72" 458 "-r240x72"
430 "-sOutputFile=LPT2" 459 "-sOutputFile=LPT2"
431 "-Ic:/gs" 460 "-Ic:/gs"))
432 "-"))
433 @end example 461 @end example
434 462
435 @noindent 463 @noindent
436 (This assumes that Ghostscript is installed in the @file{"c:/gs"} 464 (This assumes that Ghostscript is installed in the @file{"c:/gs"}
437 directory.) 465 directory.)
466
467 @vindex dos-printer
468 @vindex dos-ps-printer
469 For backwards compatibility, the value of @code{dos-printer}
470 (@code{dos-ps-printer}), if it has a value, overrides the value of
471 @code{printer-name} (@code{ps-printer-name}), on MS-DOS and MS-Windows
472 only.
473
438 474
439 @node MS-DOS and MULE 475 @node MS-DOS and MULE
440 @section International Support on MS-DOS 476 @section International Support on MS-DOS
441 @cindex international support @r{(MS-DOS)} 477 @cindex international support @r{(MS-DOS)}
442 478