Mercurial > emacs
comparison man/emacs-xtra.texi @ 83507:81f2d90dee68
Merged from
Patches applied:
* emacs@sv.gnu.org/emacs--devo--0--patch-188
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-189
Merge from gnus--rel--5.10
* emacs@sv.gnu.org/emacs--devo--0--patch-190
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-191
Undo incorrect merge of etc/images/README from Gnus 5.10
* emacs@sv.gnu.org/emacs--devo--0--patch-192
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-193
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-194
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-195
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-196
Merge from gnus--rel--5.10
* emacs@sv.gnu.org/emacs--devo--0--patch-197
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-198
Merge from gnus--rel--5.10
* emacs@sv.gnu.org/emacs--devo--0--patch-199
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-200
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-201
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-202
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-203
Merge from gnus--rel--5.10
* emacs@sv.gnu.org/emacs--devo--0--patch-204
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-205
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-206
Update from CVS
* emacs@sv.gnu.org/gnus--rel--5.10--patch-73
Update from CVS
* emacs@sv.gnu.org/gnus--rel--5.10--patch-74
Update from CVS
* emacs@sv.gnu.org/gnus--rel--5.10--patch-75
Update from CVS
* emacs@sv.gnu.org/gnus--rel--5.10--patch-76
Update from CVS: README: Addition from 5.10.6 tar ball.
* emacs@sv.gnu.org/gnus--rel--5.10--patch-77
Update from CVS
* emacs@sv.gnu.org/gnus--rel--5.10--patch-78
Update from CVS
* emacs@sv.gnu.org/gnus--rel--5.10--patch-79
Update from CVS
* emacs@sv.gnu.org/gnus--rel--5.10--patch-80
Update from CVS
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-547
author | Karoly Lorentey <lorentey@elte.hu> |
---|---|
date | Mon, 10 Apr 2006 14:52:24 +0000 |
parents | 601830ae280c |
children | 87cbb18a44b0 |
comparison
equal
deleted
inserted
replaced
83506:9905fc171253 | 83507:81f2d90dee68 |
---|---|
62 * Emerge:: A convenient way of merging two versions | 62 * Emerge:: A convenient way of merging two versions |
63 of a program. | 63 of a program. |
64 * Picture Mode:: Editing pictures made up of characters | 64 * Picture Mode:: Editing pictures made up of characters |
65 using the quarter-plane screen model. | 65 using the quarter-plane screen model. |
66 * Fortran:: Fortran mode and its special features. | 66 * Fortran:: Fortran mode and its special features. |
67 * MS-DOG:: | |
67 * Index:: | 68 * Index:: |
68 @end menu | 69 @end menu |
69 | 70 |
70 @node Introduction | 71 @node Introduction |
71 @unnumbered Introduction | 72 @unnumbered Introduction |
2404 to @samp{continue}, provided Abbrev mode is enabled.@refill | 2405 to @samp{continue}, provided Abbrev mode is enabled.@refill |
2405 | 2406 |
2406 Type @samp{;?} or @samp{;C-h} to display a list of all the built-in | 2407 Type @samp{;?} or @samp{;C-h} to display a list of all the built-in |
2407 Fortran abbrevs and what they stand for. | 2408 Fortran abbrevs and what they stand for. |
2408 | 2409 |
2410 | |
2411 @node MS-DOG | |
2412 @chapter Emacs and MS-DOS | |
2413 @cindex MS-DOG | |
2414 @cindex MS-DOS peculiarities | |
2415 | |
2416 This section briefly describes the peculiarities of using Emacs on | |
2417 the MS-DOS ``operating system'' (also known as ``MS-DOG''). | |
2418 Information about Emacs and Microsoft's current operating system | |
2419 Windows (also known as ``Losedows) is in the main Emacs manual | |
2420 (@pxref{Emacs and Microsoft Systems,,, emacs, the Emacs Manual}). | |
2421 | |
2422 If you build Emacs for MS-DOS, the binary will also run on Windows | |
2423 3.X, Windows NT, Windows 9X/ME, Windows 2000, or OS/2 as a DOS | |
2424 application; all of this chapter applies for all of those systems, if | |
2425 you use an Emacs that was built for MS-DOS. | |
2426 | |
2427 @xref{Text and Binary,,,emacs, the Emacs Manual}, for information | |
2428 about Emacs' special handling of text files under MS-DOS (and | |
2429 Windows). | |
2430 | |
2431 @menu | |
2432 * Keyboard: MS-DOS Keyboard. Keyboard conventions on MS-DOS. | |
2433 * Mouse: MS-DOS Mouse. Mouse conventions on MS-DOS. | |
2434 * Display: MS-DOS Display. Fonts, frames and display size on MS-DOS. | |
2435 * Files: MS-DOS File Names. File name conventions on MS-DOS. | |
2436 * Printing: MS-DOS Printing. How to specify the printer on MS-DOS. | |
2437 * I18N: MS-DOS and MULE. Support for internationalization on MS-DOS. | |
2438 * Processes: MS-DOS Processes. Running subprocesses on MS-DOS. | |
2439 @end menu | |
2440 | |
2441 @node MS-DOS Keyboard | |
2442 @section Keyboard Usage on MS-DOS | |
2443 | |
2444 @kindex DEL @r{(MS-DOS)} | |
2445 @kindex BS @r{(MS-DOS)} | |
2446 The key that is called @key{DEL} in Emacs (because that's how it is | |
2447 designated on most workstations) is known as @key{BS} (backspace) on a | |
2448 PC. That is why the PC-specific terminal initialization remaps the | |
2449 @key{BS} key to act as @key{DEL}; the @key{DELETE} key is remapped to act | |
2450 as @kbd{C-d} for the same reasons. | |
2451 | |
2452 @kindex C-g @r{(MS-DOS)} | |
2453 @kindex C-BREAK @r{(MS-DOS)} | |
2454 @cindex quitting on MS-DOS | |
2455 Emacs built for MS-DOS recognizes @kbd{C-@key{BREAK}} as a quit | |
2456 character, just like @kbd{C-g}. This is because Emacs cannot detect | |
2457 that you have typed @kbd{C-g} until it is ready for more input. As a | |
2458 consequence, you cannot use @kbd{C-g} to stop a running command | |
2459 (@pxref{Quitting,,,emacs, the Emacs Manual}). By contrast, | |
2460 @kbd{C-@key{BREAK}} @emph{is} detected as soon as you type it (as | |
2461 @kbd{C-g} is on other systems), so it can be used to stop a running | |
2462 command and for emergency escape (@pxref{Emergency Escape,,,emacs, the | |
2463 Emacs Manual}). | |
2464 | |
2465 @cindex Meta (under MS-DOS) | |
2466 @cindex Hyper (under MS-DOS) | |
2467 @cindex Super (under MS-DOS) | |
2468 @vindex dos-super-key | |
2469 @vindex dos-hyper-key | |
2470 The PC keyboard maps use the left @key{ALT} key as the @key{META} key. | |
2471 You have two choices for emulating the @key{SUPER} and @key{HYPER} keys: | |
2472 choose either the right @key{CTRL} key or the right @key{ALT} key by | |
2473 setting the variables @code{dos-hyper-key} and @code{dos-super-key} to 1 | |
2474 or 2 respectively. If neither @code{dos-super-key} nor | |
2475 @code{dos-hyper-key} is 1, then by default the right @key{ALT} key is | |
2476 also mapped to the @key{META} key. However, if the MS-DOS international | |
2477 keyboard support program @file{KEYB.COM} is installed, Emacs will | |
2478 @emph{not} map the right @key{ALT} to @key{META}, since it is used for | |
2479 accessing characters like @kbd{~} and @kbd{@@} on non-US keyboard | |
2480 layouts; in this case, you may only use the left @key{ALT} as @key{META} | |
2481 key. | |
2482 | |
2483 @kindex C-j @r{(MS-DOS)} | |
2484 @vindex dos-keypad-mode | |
2485 The variable @code{dos-keypad-mode} is a flag variable that controls | |
2486 what key codes are returned by keys in the numeric keypad. You can also | |
2487 define the keypad @key{ENTER} key to act like @kbd{C-j}, by putting the | |
2488 following line into your @file{_emacs} file: | |
2489 | |
2490 @smallexample | |
2491 ;; @r{Make the @key{ENTER} key from the numeric keypad act as @kbd{C-j}.} | |
2492 (define-key function-key-map [kp-enter] [?\C-j]) | |
2493 @end smallexample | |
2494 | |
2495 @node MS-DOS Mouse | |
2496 @section Mouse Usage on MS-DOS | |
2497 | |
2498 @cindex mouse support under MS-DOS | |
2499 Emacs on MS-DOS supports a mouse (on the default terminal only). | |
2500 The mouse commands work as documented, including those that use menus | |
2501 and the menu bar (@pxref{Menu Bar,,,emacs, the Emacs Manual}). Scroll | |
2502 bars don't work in MS-DOS Emacs. PC mice usually have only two | |
2503 buttons; these act as @kbd{Mouse-1} and @kbd{Mouse-2}, but if you | |
2504 press both of them together, that has the effect of @kbd{Mouse-3}. If | |
2505 the mouse does have 3 buttons, Emacs detects that at startup, and all | |
2506 the 3 buttons function normally, as on X. | |
2507 | |
2508 Help strings for menu-bar and pop-up menus are displayed in the echo | |
2509 area when the mouse pointer moves across the menu items. Highlighting | |
2510 of mouse-sensitive text (@pxref{Mouse References,,,emacs, the Emacs | |
2511 Manual}) is also supported. | |
2512 | |
2513 @cindex mouse, set number of buttons | |
2514 @findex msdos-set-mouse-buttons | |
2515 Some versions of mouse drivers don't report the number of mouse | |
2516 buttons correctly. For example, mice with a wheel report that they | |
2517 have 3 buttons, but only 2 of them are passed to Emacs; the clicks on | |
2518 the wheel, which serves as the middle button, are not passed. In | |
2519 these cases, you can use the @kbd{M-x msdos-set-mouse-buttons} command | |
2520 to tell Emacs how many mouse buttons to expect. You could make such a | |
2521 setting permanent by adding this fragment to your @file{_emacs} init | |
2522 file: | |
2523 | |
2524 @example | |
2525 ;; @r{Treat the mouse like a 2-button mouse.} | |
2526 (msdos-set-mouse-buttons 2) | |
2527 @end example | |
2528 | |
2529 @cindex Windows clipboard support | |
2530 Emacs built for MS-DOS supports clipboard operations when it runs on | |
2531 Windows. Commands that put text on the kill ring, or yank text from | |
2532 the ring, check the Windows clipboard first, just as Emacs does on the | |
2533 X Window System (@pxref{Mouse Commands,,,emacs, the Emacs Manual}). | |
2534 Only the primary selection and the cut buffer are supported by MS-DOS | |
2535 Emacs on Windows; the secondary selection always appears as empty. | |
2536 | |
2537 Due to the way clipboard access is implemented by Windows, the | |
2538 length of text you can put into the clipboard is limited by the amount | |
2539 of free DOS memory that is available to Emacs. Usually, up to 620KB of | |
2540 text can be put into the clipboard, but this limit depends on the system | |
2541 configuration and is lower if you run Emacs as a subprocess of | |
2542 another program. If the killed text does not fit, Emacs outputs a | |
2543 message saying so, and does not put the text into the clipboard. | |
2544 | |
2545 Null characters also cannot be put into the Windows clipboard. If the | |
2546 killed text includes null characters, Emacs does not put such text into | |
2547 the clipboard, and displays in the echo area a message to that effect. | |
2548 | |
2549 @vindex dos-display-scancodes | |
2550 The variable @code{dos-display-scancodes}, when non-@code{nil}, | |
2551 directs Emacs to display the @acronym{ASCII} value and the keyboard scan code of | |
2552 each keystroke; this feature serves as a complement to the | |
2553 @code{view-lossage} command, for debugging. | |
2554 | |
2555 @node MS-DOS Display | |
2556 @section Display on MS-DOS | |
2557 @cindex faces under MS-DOS | |
2558 @cindex fonts, emulating under MS-DOS | |
2559 | |
2560 Display on MS-DOS cannot use font variants, like bold or italic, but | |
2561 it does support multiple faces, each of which can specify a foreground | |
2562 and a background color. Therefore, you can get the full functionality | |
2563 of Emacs packages that use fonts (such as @code{font-lock}, Enriched | |
2564 Text mode, and others) by defining the relevant faces to use different | |
2565 colors. Use the @code{list-colors-display} command (@pxref{Frame | |
2566 Parameters,,,emacs, the Emacs Manual}) and the | |
2567 @code{list-faces-display} command (@pxref{Faces,,,emacs, the Emacs | |
2568 Manual}) to see what colors and faces are available and what they look | |
2569 like. | |
2570 | |
2571 @xref{MS-DOS and MULE}, later in this chapter, for information on | |
2572 how Emacs displays glyphs and characters that aren't supported by the | |
2573 native font built into the DOS display. | |
2574 | |
2575 @cindex cursor shape on MS-DOS | |
2576 When Emacs starts, it changes the cursor shape to a solid box. This | |
2577 is for compatibility with other systems, where the box cursor is the | |
2578 default in Emacs. This default shape can be changed to a bar by | |
2579 specifying the @code{cursor-type} parameter in the variable | |
2580 @code{default-frame-alist} (@pxref{Creating Frames,,,emacs, the Emacs | |
2581 Manual}). The MS-DOS terminal doesn't support a vertical-bar cursor, | |
2582 so the bar cursor is horizontal, and the @code{@var{width}} parameter, | |
2583 if specified by the frame parameters, actually determines its height. | |
2584 For this reason, the @code{bar} and @code{hbar} cursor types produce | |
2585 the same effect on MS-DOS. As an extension, the bar cursor | |
2586 specification can include the starting scan line of the cursor as well | |
2587 as its width, like this: | |
2588 | |
2589 @example | |
2590 '(cursor-type bar @var{width} . @var{start}) | |
2591 @end example | |
2592 | |
2593 @noindent | |
2594 In addition, if the @var{width} parameter is negative, the cursor bar | |
2595 begins at the top of the character cell. | |
2596 | |
2597 @cindex frames on MS-DOS | |
2598 The MS-DOS terminal can only display a single frame at a time. The | |
2599 Emacs frame facilities work on MS-DOS much as they do on text-only | |
2600 terminals (@pxref{Frames,,,emacs, the Emacs Manual}). When you run | |
2601 Emacs from a DOS window on MS-Windows, you can make the visible frame | |
2602 smaller than the full screen, but Emacs still cannot display more than | |
2603 a single frame at a time. | |
2604 | |
2605 @cindex frame size under MS-DOS | |
2606 @findex mode4350 | |
2607 @findex mode25 | |
2608 The @code{mode4350} command switches the display to 43 or 50 | |
2609 lines, depending on your hardware; the @code{mode25} command switches | |
2610 to the default 80x25 screen size. | |
2611 | |
2612 By default, Emacs only knows how to set screen sizes of 80 columns by | |
2613 25, 28, 35, 40, 43 or 50 rows. However, if your video adapter has | |
2614 special video modes that will switch the display to other sizes, you can | |
2615 have Emacs support those too. When you ask Emacs to switch the frame to | |
2616 @var{n} rows by @var{m} columns dimensions, it checks if there is a | |
2617 variable called @code{screen-dimensions-@var{n}x@var{m}}, and if so, | |
2618 uses its value (which must be an integer) as the video mode to switch | |
2619 to. (Emacs switches to that video mode by calling the BIOS @code{Set | |
2620 Video Mode} function with the value of | |
2621 @code{screen-dimensions-@var{n}x@var{m}} in the @code{AL} register.) | |
2622 For example, suppose your adapter will switch to 66x80 dimensions when | |
2623 put into video mode 85. Then you can make Emacs support this screen | |
2624 size by putting the following into your @file{_emacs} file: | |
2625 | |
2626 @example | |
2627 (setq screen-dimensions-66x80 85) | |
2628 @end example | |
2629 | |
2630 Since Emacs on MS-DOS can only set the frame size to specific | |
2631 supported dimensions, it cannot honor every possible frame resizing | |
2632 request. When an unsupported size is requested, Emacs chooses the next | |
2633 larger supported size beyond the specified size. For example, if you | |
2634 ask for 36x80 frame, you will get 40x80 instead. | |
2635 | |
2636 The variables @code{screen-dimensions-@var{n}x@var{m}} are used only | |
2637 when they exactly match the specified size; the search for the next | |
2638 larger supported size ignores them. In the above example, even if your | |
2639 VGA supports 38x80 dimensions and you define a variable | |
2640 @code{screen-dimensions-38x80} with a suitable value, you will still get | |
2641 40x80 screen when you ask for a 36x80 frame. If you want to get the | |
2642 38x80 size in this case, you can do it by setting the variable named | |
2643 @code{screen-dimensions-36x80} with the same video mode value as | |
2644 @code{screen-dimensions-38x80}. | |
2645 | |
2646 Changing frame dimensions on MS-DOS has the effect of changing all the | |
2647 other frames to the new dimensions. | |
2648 | |
2649 @node MS-DOS File Names | |
2650 @section File Names on MS-DOS | |
2651 @cindex file names under MS-DOS | |
2652 @cindex init file, default name under MS-DOS | |
2653 | |
2654 MS-DOS normally uses a backslash, @samp{\}, to separate name units | |
2655 within a file name, instead of the slash used on other systems. Emacs | |
2656 on MS-DOS permits use of either slash or backslash, and also knows | |
2657 about drive letters in file names. | |
2658 | |
2659 On MS-DOS, file names are case-insensitive and limited to eight | |
2660 characters, plus optionally a period and three more characters. Emacs | |
2661 knows enough about these limitations to handle file names that were | |
2662 meant for other operating systems. For instance, leading dots | |
2663 @samp{.} in file names are invalid in MS-DOS, so Emacs transparently | |
2664 converts them to underscores @samp{_}; thus your default init file | |
2665 (@pxref{Init File,,,emacs, the Emacs Manual}) is called @file{_emacs} | |
2666 on MS-DOS. Excess characters before or after the period are generally | |
2667 ignored by MS-DOS itself; thus, if you visit the file | |
2668 @file{LongFileName.EvenLongerExtension}, you will silently get | |
2669 @file{longfile.eve}, but Emacs will still display the long file name | |
2670 on the mode line. Other than that, it's up to you to specify file | |
2671 names which are valid under MS-DOS; the transparent conversion as | |
2672 described above only works on file names built into Emacs. | |
2673 | |
2674 @cindex backup file names on MS-DOS | |
2675 The above restrictions on the file names on MS-DOS make it almost | |
2676 impossible to construct the name of a backup file (@pxref{Backup | |
2677 Names,,,emacs, the Emacs Manual}) without losing some of the original | |
2678 file name characters. For example, the name of a backup file for | |
2679 @file{docs.txt} is @file{docs.tx~} even if single backup is used. | |
2680 | |
2681 @cindex file names under Windows 95/NT | |
2682 @cindex long file names in DOS box under Windows 95/NT | |
2683 If you run Emacs as a DOS application under Windows 9X, Windows ME, or | |
2684 Windows 2000, you can turn on support for long file names. If you do | |
2685 that, Emacs doesn't truncate file names or convert them to lower case; | |
2686 instead, it uses the file names that you specify, verbatim. To enable | |
2687 long file name support, set the environment variable @env{LFN} to | |
2688 @samp{y} before starting Emacs. Unfortunately, Windows NT doesn't allow | |
2689 DOS programs to access long file names, so Emacs built for MS-DOS will | |
2690 only see their short 8+3 aliases. | |
2691 | |
2692 @cindex @env{HOME} directory under MS-DOS | |
2693 MS-DOS has no notion of home directory, so Emacs on MS-DOS pretends | |
2694 that the directory where it is installed is the value of the @env{HOME} | |
2695 environment variable. That is, if your Emacs binary, | |
2696 @file{emacs.exe}, is in the directory @file{c:/utils/emacs/bin}, then | |
2697 Emacs acts as if @env{HOME} were set to @samp{c:/utils/emacs}. In | |
2698 particular, that is where Emacs looks for the init file @file{_emacs}. | |
2699 With this in mind, you can use @samp{~} in file names as an alias for | |
2700 the home directory, as you would on GNU or Unix. You can also set | |
2701 @env{HOME} variable in the environment before starting Emacs; its | |
2702 value will then override the above default behavior. | |
2703 | |
2704 Emacs on MS-DOS handles the directory name @file{/dev} specially, | |
2705 because of a feature in the emulator libraries of DJGPP that pretends | |
2706 I/O devices have names in that directory. We recommend that you avoid | |
2707 using an actual directory named @file{/dev} on any disk. | |
2708 | |
2709 @node MS-DOS Printing | |
2710 @section Printing and MS-DOS | |
2711 | |
2712 Printing commands, such as @code{lpr-buffer} | |
2713 (@pxref{Printing,,,emacs, the Emacs Manual }) and | |
2714 @code{ps-print-buffer} (@pxref{PostScript,,,emacs, the Emacs Manual}) | |
2715 can work in MS-DOS and MS-Windows by sending the output to one of the | |
2716 printer ports, if a Posix-style @code{lpr} program is unavailable. | |
2717 The same Emacs variables control printing on all systems, but in some | |
2718 cases they have different default values on MS-DOS and MS-Windows. | |
2719 | |
2720 @vindex printer-name @r{(MS-DOS)} | |
2721 If you want to use your local printer, printing on it in the usual DOS | |
2722 manner, then set the Lisp variable @code{lpr-command} to @code{""} (its | |
2723 default value) and @code{printer-name} to the name of the printer | |
2724 port---for example, @code{"PRN"}, the usual local printer port (that's | |
2725 the default), or @code{"LPT2"}, or @code{"COM1"} for a serial printer. | |
2726 You can also set @code{printer-name} to a file name, in which case | |
2727 ``printed'' output is actually appended to that file. If you set | |
2728 @code{printer-name} to @code{"NUL"}, printed output is silently | |
2729 discarded (sent to the system null device). | |
2730 | |
2731 On MS-Windows, when the Windows network software is installed, you can | |
2732 also use a printer shared by another machine by setting | |
2733 @code{printer-name} to the UNC share name for that printer---for example, | |
2734 @code{"//joes_pc/hp4si"}. (It doesn't matter whether you use forward | |
2735 slashes or backslashes here.) To find out the names of shared printers, | |
2736 run the command @samp{net view} at a DOS command prompt to obtain a list | |
2737 of servers, and @samp{net view @var{server-name}} to see the names of printers | |
2738 (and directories) shared by that server. Alternatively, click the | |
2739 @samp{Network Neighborhood} icon on your desktop, and look for machines | |
2740 which share their printers via the network. | |
2741 | |
2742 @cindex @samp{net use}, and printing on MS-Windows | |
2743 @cindex networked printers (MS-Windows) | |
2744 If the printer doesn't appear in the output of @samp{net view}, or | |
2745 if setting @code{printer-name} to the UNC share name doesn't produce a | |
2746 hardcopy on that printer, you can use the @samp{net use} command to | |
2747 connect a local print port such as @code{"LPT2"} to the networked | |
2748 printer. For example, typing @kbd{net use LPT2: | |
2749 \\joes_pc\hp4si}@footnote{ | |
2750 Note that the @samp{net use} command requires the UNC share name to be | |
2751 typed with the Windows-style backslashes, while the value of | |
2752 @code{printer-name} can be set with either forward- or backslashes.} | |
2753 causes Windows to @dfn{capture} the LPT2 port and redirect the printed | |
2754 material to the printer connected to the machine @code{joes_pc}. | |
2755 After this command, setting @code{printer-name} to @code{"LPT2"} | |
2756 should produce the hardcopy on the networked printer. | |
2757 | |
2758 With some varieties of Windows network software, you can instruct | |
2759 Windows to capture a specific printer port such as @code{"LPT2"}, and | |
2760 redirect it to a networked printer via the @w{@code{Control | |
2761 Panel->Printers}} applet instead of @samp{net use}. | |
2762 | |
2763 Some printers expect DOS codepage encoding of non-@acronym{ASCII} text, even | |
2764 though they are connected to a Windows machine which uses a different | |
2765 encoding for the same locale. For example, in the Latin-1 locale, DOS | |
2766 uses codepage 850 whereas Windows uses codepage 1252. @xref{MS-DOS and | |
2767 MULE}. When you print to such printers from Windows, you can use the | |
2768 @kbd{C-x RET c} (@code{universal-coding-system-argument}) command before | |
2769 @kbd{M-x lpr-buffer}; Emacs will then convert the text to the DOS | |
2770 codepage that you specify. For example, @kbd{C-x RET c cp850-dos RET | |
2771 M-x lpr-region RET} will print the region while converting it to the | |
2772 codepage 850 encoding. You may need to create the @code{cp@var{nnn}} | |
2773 coding system with @kbd{M-x codepage-setup}. | |
2774 | |
2775 If you set @code{printer-name} to a file name, it's best to use an | |
2776 absolute file name. Emacs changes the working directory according to | |
2777 the default directory of the current buffer, so if the file name in | |
2778 @code{printer-name} is relative, you will end up with several such | |
2779 files, each one in the directory of the buffer from which the printing | |
2780 was done. | |
2781 | |
2782 @findex print-buffer @r{(MS-DOS)} | |
2783 @findex print-region @r{(MS-DOS)} | |
2784 @vindex lpr-headers-switches @r{(MS-DOS)} | |
2785 The commands @code{print-buffer} and @code{print-region} call the | |
2786 @code{pr} program, or use special switches to the @code{lpr} program, to | |
2787 produce headers on each printed page. MS-DOS and MS-Windows don't | |
2788 normally have these programs, so by default, the variable | |
2789 @code{lpr-headers-switches} is set so that the requests to print page | |
2790 headers are silently ignored. Thus, @code{print-buffer} and | |
2791 @code{print-region} produce the same output as @code{lpr-buffer} and | |
2792 @code{lpr-region}, respectively. If you do have a suitable @code{pr} | |
2793 program (for example, from GNU Textutils), set | |
2794 @code{lpr-headers-switches} to @code{nil}; Emacs will then call | |
2795 @code{pr} to produce the page headers, and print the resulting output as | |
2796 specified by @code{printer-name}. | |
2797 | |
2798 @vindex print-region-function @r{(MS-DOS)} | |
2799 @cindex lpr usage under MS-DOS | |
2800 @vindex lpr-command @r{(MS-DOS)} | |
2801 @vindex lpr-switches @r{(MS-DOS)} | |
2802 Finally, if you do have an @code{lpr} work-alike, you can set the | |
2803 variable @code{lpr-command} to @code{"lpr"}. Then Emacs will use | |
2804 @code{lpr} for printing, as on other systems. (If the name of the | |
2805 program isn't @code{lpr}, set @code{lpr-command} to specify where to | |
2806 find it.) The variable @code{lpr-switches} has its standard meaning | |
2807 when @code{lpr-command} is not @code{""}. If the variable | |
2808 @code{printer-name} has a string value, it is used as the value for the | |
2809 @code{-P} option to @code{lpr}, as on Unix. | |
2810 | |
2811 @findex ps-print-buffer @r{(MS-DOS)} | |
2812 @findex ps-spool-buffer @r{(MS-DOS)} | |
2813 @vindex ps-printer-name @r{(MS-DOS)} | |
2814 @vindex ps-lpr-command @r{(MS-DOS)} | |
2815 @vindex ps-lpr-switches @r{(MS-DOS)} | |
2816 A parallel set of variables, @code{ps-lpr-command}, | |
2817 @code{ps-lpr-switches}, and @code{ps-printer-name} (@pxref{PostScript | |
2818 Variables,,,emacs, the Emacs Manual}), defines how PostScript files | |
2819 should be printed. These variables are used in the same way as the | |
2820 corresponding variables described above for non-PostScript printing. | |
2821 Thus, the value of @code{ps-printer-name} is used as the name of the | |
2822 device (or file) to which PostScript output is sent, just as | |
2823 @code{printer-name} is used for non-PostScript printing. (There are | |
2824 two distinct sets of variables in case you have two printers attached | |
2825 to two different ports, and only one of them is a PostScript printer.) | |
2826 | |
2827 The default value of the variable @code{ps-lpr-command} is @code{""}, | |
2828 which causes PostScript output to be sent to the printer port specified | |
2829 by @code{ps-printer-name}, but @code{ps-lpr-command} can also be set to | |
2830 the name of a program which will accept PostScript files. Thus, if you | |
2831 have a non-PostScript printer, you can set this variable to the name of | |
2832 a PostScript interpreter program (such as Ghostscript). Any switches | |
2833 that need to be passed to the interpreter program are specified using | |
2834 @code{ps-lpr-switches}. (If the value of @code{ps-printer-name} is a | |
2835 string, it will be added to the list of switches as the value for the | |
2836 @code{-P} option. This is probably only useful if you are using | |
2837 @code{lpr}, so when using an interpreter typically you would set | |
2838 @code{ps-printer-name} to something other than a string so it is | |
2839 ignored.) | |
2840 | |
2841 For example, to use Ghostscript for printing on an Epson printer | |
2842 connected to the @samp{LPT2} port, put this in your @file{_emacs} file: | |
2843 | |
2844 @example | |
2845 (setq ps-printer-name t) ; Ghostscript doesn't understand -P | |
2846 (setq ps-lpr-command "c:/gs/gs386") | |
2847 (setq ps-lpr-switches '("-q" "-dNOPAUSE" | |
2848 "-sDEVICE=epson" | |
2849 "-r240x72" | |
2850 "-sOutputFile=LPT2" | |
2851 "-Ic:/gs")) | |
2852 @end example | |
2853 | |
2854 @noindent | |
2855 (This assumes that Ghostscript is installed in the @file{"c:/gs"} | |
2856 directory.) | |
2857 | |
2858 @vindex dos-printer | |
2859 @vindex dos-ps-printer | |
2860 For backwards compatibility, the value of @code{dos-printer} | |
2861 (@code{dos-ps-printer}), if it has a value, overrides the value of | |
2862 @code{printer-name} (@code{ps-printer-name}), on MS-DOS and MS-Windows | |
2863 only. | |
2864 | |
2865 | |
2866 @node MS-DOS and MULE | |
2867 @section International Support on MS-DOS | |
2868 @cindex international support @r{(MS-DOS)} | |
2869 | |
2870 Emacs on MS-DOS supports the same international character sets as it | |
2871 does on GNU, Unix and other platforms (@pxref{International,,,emacs, | |
2872 the Emacs Manual}), including coding systems for converting between | |
2873 the different character sets. However, due to incompatibilities | |
2874 between MS-DOS/MS-Windows and other systems, there are several | |
2875 DOS-specific aspects of this support that you should be aware of. | |
2876 This section describes these aspects. | |
2877 | |
2878 The description below is largely specific to the MS-DOS port of | |
2879 Emacs, especially where it talks about practical implications for | |
2880 Emacs users. For other operating systems, see the @file{code-pages.el} | |
2881 package, which implements support for MS-DOS- and MS-Windows-specific | |
2882 encodings for all platforms other than MS-DOS. | |
2883 | |
2884 @table @kbd | |
2885 @item M-x dos-codepage-setup | |
2886 Set up Emacs display and coding systems as appropriate for the current | |
2887 DOS codepage. | |
2888 | |
2889 @item M-x codepage-setup | |
2890 Create a coding system for a certain DOS codepage. | |
2891 @end table | |
2892 | |
2893 @cindex codepage, MS-DOS | |
2894 @cindex DOS codepages | |
2895 MS-DOS is designed to support one character set of 256 characters at | |
2896 any given time, but gives you a variety of character sets to choose | |
2897 from. The alternative character sets are known as @dfn{DOS codepages}. | |
2898 Each codepage includes all 128 @acronym{ASCII} characters, but the other 128 | |
2899 characters (codes 128 through 255) vary from one codepage to another. | |
2900 Each DOS codepage is identified by a 3-digit number, such as 850, 862, | |
2901 etc. | |
2902 | |
2903 In contrast to X, which lets you use several fonts at the same time, | |
2904 MS-DOS normally doesn't allow use of several codepages in a single | |
2905 session. MS-DOS was designed to load a single codepage at system | |
2906 startup, and require you to reboot in order to change | |
2907 it@footnote{Normally, one particular codepage is burnt into the | |
2908 display memory, while other codepages can be installed by modifying | |
2909 system configuration files, such as @file{CONFIG.SYS}, and rebooting. | |
2910 While there is third-party software that allows changing the codepage | |
2911 without rebooting, we describe here how a stock MS-DOS system | |
2912 behaves.}. Much the same limitation applies when you run DOS | |
2913 executables on other systems such as MS-Windows. | |
2914 | |
2915 @cindex unibyte operation @r{(MS-DOS)} | |
2916 If you invoke Emacs on MS-DOS with the @samp{--unibyte} option | |
2917 (@pxref{Initial Options,,,emacs, the Emacs Manual}), Emacs does not | |
2918 perform any conversion of non-@acronym{ASCII} characters. Instead, it | |
2919 reads and writes any non-@acronym{ASCII} characters verbatim, and | |
2920 sends their 8-bit codes to the display verbatim. Thus, unibyte Emacs | |
2921 on MS-DOS supports the current codepage, whatever it may be, but | |
2922 cannot even represent any other characters. | |
2923 | |
2924 @vindex dos-codepage | |
2925 For multibyte operation on MS-DOS, Emacs needs to know which | |
2926 characters the chosen DOS codepage can display. So it queries the | |
2927 system shortly after startup to get the chosen codepage number, and | |
2928 stores the number in the variable @code{dos-codepage}. Some systems | |
2929 return the default value 437 for the current codepage, even though the | |
2930 actual codepage is different. (This typically happens when you use the | |
2931 codepage built into the display hardware.) You can specify a different | |
2932 codepage for Emacs to use by setting the variable @code{dos-codepage} in | |
2933 your init file. | |
2934 | |
2935 @cindex language environment, automatic selection on @r{MS-DOS} | |
2936 Multibyte Emacs supports only certain DOS codepages: those which can | |
2937 display Far-Eastern scripts, like the Japanese codepage 932, and those | |
2938 that encode a single ISO 8859 character set. | |
2939 | |
2940 The Far-Eastern codepages can directly display one of the MULE | |
2941 character sets for these countries, so Emacs simply sets up to use the | |
2942 appropriate terminal coding system that is supported by the codepage. | |
2943 The special features described in the rest of this section mostly | |
2944 pertain to codepages that encode ISO 8859 character sets. | |
2945 | |
2946 For the codepages which correspond to one of the ISO character sets, | |
2947 Emacs knows the character set name based on the codepage number. Emacs | |
2948 automatically creates a coding system to support reading and writing | |
2949 files that use the current codepage, and uses this coding system by | |
2950 default. The name of this coding system is @code{cp@var{nnn}}, where | |
2951 @var{nnn} is the codepage number.@footnote{The standard Emacs coding | |
2952 systems for ISO 8859 are not quite right for the purpose, because | |
2953 typically the DOS codepage does not match the standard ISO character | |
2954 codes. For example, the letter @samp{@,{c}} (@samp{c} with cedilla) has | |
2955 code 231 in the standard Latin-1 character set, but the corresponding | |
2956 DOS codepage 850 uses code 135 for this glyph.} | |
2957 | |
2958 @cindex mode line @r{(MS-DOS)} | |
2959 All the @code{cp@var{nnn}} coding systems use the letter @samp{D} | |
2960 (for ``DOS'') as their mode-line mnemonic. Since both the terminal | |
2961 coding system and the default coding system for file I/O are set to | |
2962 the proper @code{cp@var{nnn}} coding system at startup, it is normal | |
2963 for the mode line on MS-DOS to begin with @samp{-DD\-}. @xref{Mode | |
2964 Line,,,emacs, the Emacs Manual}. Far-Eastern DOS terminals do not use | |
2965 the @code{cp@var{nnn}} coding systems, and thus their initial mode | |
2966 line looks like the Emacs default. | |
2967 | |
2968 Since the codepage number also indicates which script you are using, | |
2969 Emacs automatically runs @code{set-language-environment} to select the | |
2970 language environment for that script (@pxref{Language | |
2971 Environments,,,emacs, the Emacs Manual}). | |
2972 | |
2973 If a buffer contains a character belonging to some other ISO 8859 | |
2974 character set, not the one that the chosen DOS codepage supports, Emacs | |
2975 displays it using a sequence of @acronym{ASCII} characters. For example, if the | |
2976 current codepage doesn't have a glyph for the letter @samp{@`o} (small | |
2977 @samp{o} with a grave accent), it is displayed as @samp{@{`o@}}, where | |
2978 the braces serve as a visual indication that this is a single character. | |
2979 (This may look awkward for some non-Latin characters, such as those from | |
2980 Greek or Hebrew alphabets, but it is still readable by a person who | |
2981 knows the language.) Even though the character may occupy several | |
2982 columns on the screen, it is really still just a single character, and | |
2983 all Emacs commands treat it as one. | |
2984 | |
2985 @cindex IBM graphics characters (MS-DOS) | |
2986 @cindex box-drawing characters (MS-DOS) | |
2987 @cindex line-drawing characters (MS-DOS) | |
2988 Not all characters in DOS codepages correspond to ISO 8859 | |
2989 characters---some are used for other purposes, such as box-drawing | |
2990 characters and other graphics. Emacs maps these characters to two | |
2991 special character sets called @code{eight-bit-control} and | |
2992 @code{eight-bit-graphic}, and displays them as their IBM glyphs. | |
2993 However, you should be aware that other systems might display these | |
2994 characters differently, so you should avoid them in text that might be | |
2995 copied to a different operating system, or even to another DOS machine | |
2996 that uses a different codepage. | |
2997 | |
2998 @vindex dos-unsupported-character-glyph | |
2999 Emacs supports many other characters sets aside from ISO 8859, but it | |
3000 cannot display them on MS-DOS. So if one of these multibyte characters | |
3001 appears in a buffer, Emacs on MS-DOS displays them as specified by the | |
3002 @code{dos-unsupported-character-glyph} variable; by default, this glyph | |
3003 is an empty triangle. Use the @kbd{C-u C-x =} command to display the | |
3004 actual code and character set of such characters. @xref{Position | |
3005 Info,,,emacs, the Emacs Manual}. | |
3006 | |
3007 @findex codepage-setup | |
3008 By default, Emacs defines a coding system to support the current | |
3009 codepage. To define a coding system for some other codepage (e.g., to | |
3010 visit a file written on a DOS machine in another country), use the | |
3011 @kbd{M-x codepage-setup} command. It prompts for the 3-digit code of | |
3012 the codepage, with completion, then creates the coding system for the | |
3013 specified codepage. You can then use the new coding system to read and | |
3014 write files, but you must specify it explicitly for the file command | |
3015 when you want to use it (@pxref{Text Coding,,,emacs, the Emacs Manual}). | |
3016 | |
3017 These coding systems are also useful for visiting a file encoded using | |
3018 a DOS codepage, using Emacs running on some other operating system. | |
3019 | |
3020 @cindex MS-Windows codepages | |
3021 MS-Windows provides its own codepages, which are different from the | |
3022 DOS codepages for the same locale. For example, DOS codepage 850 | |
3023 supports the same character set as Windows codepage 1252; DOS codepage | |
3024 855 supports the same character set as Windows codepage 1251, etc. | |
3025 The MS-Windows version of Emacs uses the current codepage for display | |
3026 when invoked with the @samp{-nw} option. Support for codepages in the | |
3027 Windows port of Emacs is part of the @file{code-pages.el} package. | |
3028 | |
3029 @node MS-DOS Processes | |
3030 @section Subprocesses on MS-DOS | |
3031 | |
3032 @cindex compilation under MS-DOS | |
3033 @cindex inferior processes under MS-DOS | |
3034 @findex compile @r{(MS-DOS)} | |
3035 @findex grep @r{(MS-DOS)} | |
3036 Because MS-DOS is a single-process ``operating system,'' | |
3037 asynchronous subprocesses are not available. In particular, Shell | |
3038 mode and its variants do not work. Most Emacs features that use | |
3039 asynchronous subprocesses also don't work on MS-DOS, including | |
3040 Shell mode and GUD. When in doubt, try and see; commands that | |
3041 don't work output an error message saying that asynchronous processes | |
3042 aren't supported. | |
3043 | |
3044 Compilation under Emacs with @kbd{M-x compile}, searching files with | |
3045 @kbd{M-x grep} and displaying differences between files with @kbd{M-x | |
3046 diff} do work, by running the inferior processes synchronously. This | |
3047 means you cannot do any more editing until the inferior process | |
3048 finishes. | |
3049 | |
3050 Spell checking also works, by means of special support for synchronous | |
3051 invocation of the @code{ispell} program. This is slower than the | |
3052 asynchronous invocation on other platforms | |
3053 | |
3054 Instead of the Shell mode, which doesn't work on MS-DOS, you can use | |
3055 the @kbd{M-x eshell} command. This invokes the Eshell package that | |
3056 implements a Posix-like shell entirely in Emacs Lisp. | |
3057 | |
3058 By contrast, Emacs compiled as a native Windows application | |
3059 @strong{does} support asynchronous subprocesses. @xref{Windows | |
3060 Processes,,,emacs, the Emacs Manual}. | |
3061 | |
3062 @cindex printing under MS-DOS | |
3063 Printing commands, such as @code{lpr-buffer} | |
3064 (@pxref{Printing,,,emacs, the Emacs Manual}) and | |
3065 @code{ps-print-buffer} (@pxref{PostScript,,,emacs, the Emacs Manual}), | |
3066 work in MS-DOS by sending the output to one of the printer ports. | |
3067 @xref{MS-DOS Printing,,,emacs, the Emacs Manual}. | |
3068 | |
3069 When you run a subprocess synchronously on MS-DOS, make sure the | |
3070 program terminates and does not try to read keyboard input. If the | |
3071 program does not terminate on its own, you will be unable to terminate | |
3072 it, because MS-DOS provides no general way to terminate a process. | |
3073 Pressing @kbd{C-c} or @kbd{C-@key{BREAK}} might sometimes help in these | |
3074 cases. | |
3075 | |
3076 Accessing files on other machines is not supported on MS-DOS. Other | |
3077 network-oriented commands such as sending mail, Web browsing, remote | |
3078 login, etc., don't work either, unless network access is built into | |
3079 MS-DOS with some network redirector. | |
3080 | |
3081 @cindex directory listing on MS-DOS | |
3082 @vindex dired-listing-switches @r{(MS-DOS)} | |
3083 Dired on MS-DOS uses the @code{ls-lisp} package where other | |
3084 platforms use the system @code{ls} command. Therefore, Dired on | |
3085 MS-DOS supports only some of the possible options you can mention in | |
3086 the @code{dired-listing-switches} variable. The options that work are | |
3087 @samp{-A}, @samp{-a}, @samp{-c}, @samp{-i}, @samp{-r}, @samp{-S}, | |
3088 @samp{-s}, @samp{-t}, and @samp{-u}. | |
3089 | |
3090 | |
2409 @node Index | 3091 @node Index |
2410 @unnumbered Index | 3092 @unnumbered Index |
2411 | 3093 |
2412 @printindex cp | 3094 @printindex cp |
2413 | 3095 |