http:^^www.cs.washington.edu^homes^voelker^ntemacs.html
来自「This data set contains WWW-pages collect」· HTML 代码 · 共 1,495 行 · 第 1/5 页
HTML
1,495 行
for your RMAIL frame). <p></dl><p><li><a name="windows-color"><b>C<font size=-1>OLORS</font></b><p>As with other windowing attributes, Emacs uses the X Windows colornames for specifying colors on the command line and in elisp. One setof these names is a set of abstract color names, e.g., <b>red</b>,<b>green</b>, and <b>blue</b>. These names are the ones you willtypically use as arguments on the command line or in elisp functions.Emacs also supports the use of numeric color names; see the <!WA104><!WA104><!WA104><ahref="http://www.x.org/consortium/R6doc/man/X/X">COLOR NAMESsection</a> of the X man page for complete details on how to specifynumeric color names and their color spaces. <p>To see the abstract color names that Emacs understands and the colorsthat they map to, use the menu command <b>Edit</b>-><b>TextProperties</b>-><b>Display Colors</b>, or invoke the<tt>list-colors-display</tt> function in the *scratch* buffer: <p><blockquote><tt>(list-colors-display)</tt></blockquote>If you would like to change the mapping of color names to RGB values,or to add new color names to Emacs, then you will want to modify thealist <b>win32-color-map</b>. To make changes, you can simply consnew mappings onto the head of the alist: <p><blockquote><tt>(setq win32-color-map (cons '("snow" . 16448255) win32-color-map))</tt></blockquote>The number in the element is the logical OR of three values for thered, green, and blue components: (B << 16 | G << 8 | R). Inthe example above, red is 255, green is 250, and blue is 250. At somepoint there will be support for reading in files with color mappingsto make this process a little easier. <p><dl><dt><b>User Interface</b><dd>To change the foreground or background color in Emacs through thewindowing interface, you can use the menu commands <b>ForegroundColor</b>-><b>Other</b> and <b>Background Color</b>-><b>Other</b> inthe <b>Edit</b>-><b>Text Properties</b> menu. <p><dt><b>Command Line</b><dd>To change the foreground or background color in Emacs onthe command line, you can use the <b>-fg</b> and <b>-bg</b>command line arguments. For example, to start Emacs with yellowtext on a black background, invoke Emacs using: <p><blockquote><tt>emacs -fg yellow -bg black</tt></blockquote><dt><b>Emacs Lisp</b><dd>You can use elisp functions to change the colors of any of theEmacs faces. For example, to change the foreground or backgroundcolor of Emacs, you can use the <tt>set-foreground-color</tt> and<tt>set-background-color</tt> functions. To change the color of anarbitrary face, use the <tt>set-face-foreground</tt> and<tt>set-face-background</tt> functions. To change the color of thecursor, use the <tt>set-cursor-color</tt> function.<p>The following elisp changes the background color to black: <p><blockquote><tt>(set-background-color "black")</tt></blockquote>The following elisp changes the mode line foreground to firebrick: <p><blockquote><tt>(set-face-foreground 'modeline "firebrick")</tt></blockquote>The following elisp changes the cursor color to purple: <p><blockquote><tt>(set-cursor-color "purple")</tt></blockquote></dl><p><li><a name="windows-frames"><b>F<font size=-1>RAMES</font></b><p>Emacs uses two alists to determine the default appearances of frames,<tt>default-frame-alist</tt> and <tt>initial-frame-alist</tt>. The<tt>default-frame-alist</tt> variable sets the basic defaults of allframes. Since it is a common Emacs usage to have the initial framehave slightly different properties than other frames (e.g., itsposition), you can use the <tt>initial-frame-alist</tt> variable tooverride properties in <tt>default-frame-alist</tt> specially for theinitial frame. You should definitely read the help text for thesevariables (C-h v) for more details on the differences between the twovariables and how they interact with each other. <p>Below is an example of using <tt>default-frame-alist</tt> and<tt>initial-frame-alist</tt> to configure the appearances of theinitial frame and all other frames (you would place this code in your<!WA105><!WA105><!WA105><a href="#startup">startup file</a>). With<tt>default-frame-alist</tt>, we set the top left corner of new framesto be at pixel offset +200+400, the width and height to be 80x40, thecursor to be white, the foreground to be yellow, the background to beblack, and the font to be Courier 10. With<tt>initial-frame-alist</tt>, we override the top left corner of theinitial frame to be at pixel offset +10+30, and inherit the remainingproperties for the initial frame from<tt>default-frame-alist</tt>. <p><blockquote><pre>(setq default-frame-alist '((top . 200) (left . 400) (width . 80) (height . 40) (cursor-color . "white") (foreground-color . "yellow") (background-color . "black") (font . "-*-Courier-normal-r-*-*-13-97-*-*-c-*-*-ansi-")))(setq initial-frame-alist '((top . 10) (left . 30)))</pre></blockquote><p><li><a name="windows-italics"><b>I<font size=-1>TALICS</font></b><p>Emacs currently requires that italic versions of fonts have the samewidth as the normal version of the font. However, most of the defaultfonts have italic and italic bold versions whose character widths arelarger than the normal version (the only default font that appears tohave viable italic and bold versions is Courier New). Because ofthis, Emacs by default disables the use of italic faces. <p>You can still enable the use of italic faces with Emacs by setting thevariable <tt>win32-enable-italics</tt> to <tt>t</tt> in your startupfile:<blockquote><pre>(setq win32-enable-italics t) ; This must be done before font settings!(set-face-font 'italic "-*-Courier New-normal-i-*-*-11-82-c-*-*-ansi-")(set-face-font 'bold-italic "-*-Courier New-bold-i-*-*-11-82-c-*-*-ansi-")</pre></blockquote>Although this works best with Courier New, there is still one minorglitch: the italics versions are one pixel higher than the otherversions, so the line spacing is increased by a pixel when italics areenabled. <p><center><h3><a name="console-attributes">Console Interface</h3></center>Emacs can also run inside a console window. Simply invoke Emacs withthe -nw command line option to do so. Although you cannot change thesize, font, or color of the window from within Emacs, you can use thewindow's menu to do so. (If no icon has been created to invoke theEmacs batch file, then you'll have to create one to change theseattributes.) <p><li><a name="console-size"><b>S<font size=-1>IZE</font></b><p>Under NT, go to the upper left hand corner and open the "-" menu ofthe console window. Select "Screen Size and Position...", and use thedialog to set the window to the size you want. Be sure to check the"Save Window Size and Position" checkbox so that future invocationswill retain the new window size. After closing the dialog box, resizethe window itself by dragging on the edges.<p>Under Win95, click on the properties icon in the icontoolbar at the top of the window. Go to the "Screen" tab and selectthe desired window size in the "Usage" panel. Click on "OK". <p><li><a name="console-position"><b>P<font size=-1>OSITION</font></b><p>To reposition Emacs, click on the title bar of the console windowand drag it. <p><li><a name="console-font"><b>F<font size=-1>ONT</font></b><p>Under NT, open the "-" menu. Select "Fonts...", and usethe dialog to set the window font to the one you want. Be sure tocheck the "Save Configuration" checkbox so that your font change willbe used in future invocations. Click on "OK", and the window will getresized. <p>.Under Win95, simply use the popup font menu in the upperleft-hand corner of the window. Or click on the font icon in the icontoolbar. Or click on the properties icon in the icon toolbar and goto the "Font" tab and choose the font that you want to use. <p><li><a name="console-color"><b>C<font size=-1>OLOR</font></b><p>Under the NT interface, open the "-" menu. Select "Screen Colors...",and use the dialog to choose the colors you want to use for thewindow. Be sure to check the "Save Configuration" checkbox so thatthe colors are used in future invocations. Click on "OK".Unfortunately, the colors are not immediately used, but the changeshave been made. To use the new colors, simply close the window anduse the icon to start Emacs again. Emacs will then come up using thecolors you chose before. <p>I'm not exactly sure how to change the colors on a per-console-windowbasis under Win95. <p></ul><hr><h3><a name="startup">Where do I put my .emacs (or _emacs) file?</h3>Your startup file can be named either _emacs or .emacs, and should beplaced in your "home" directory. If you have both files in your homedirectory, Emacs will load the .emacs file and ignore _emacs. Also,if you have a version of Emacs older than 19.31, Emacs will onlyrecognized _emacs as the startup file. <p>Your home directory is where the HOME configuration variable tellsEmacs it is. As with the other Emacs configuration variables, HOMEcan be set in a number of ways:<ul><li><b>Environment variable:</b> Emacs will always first check to seeif you have an environment variable named HOME set and use that valueas your home directory. Under Win95, you can set the HOME environmentvariable in your autoexec.bat file; under NT, you can set the HOMEenvironment variable in the System panel of the Control Panel. (Notethat if you set HOME as an environment variable in the System panel itwill only take effect in new processes.) <p><li><b>Registry:</b> If Emacs doesn't find an environment variablenamed HOME, it will check the registry for a value named HOME and usethat value as your home directory. Emacs first checks the key"HKEY_CURRENT_USER\\SOFTWARE\\GNU\\Emacs", and then the key"HKEY_LOCAL_MACHINE\\SOFTWARE\\GNU\\Emacs" (although the use of thelatter key is discouraged since HOME should be set on a per-userbasis, not on a per-machine basis). Note that the value of HOME is<i>not</i> set by the addpm.exe program that initializes the registrywith the other Emacs configuration variables. <p></ul>If Emacs cannot find HOME set in any of the above locations, it willassume your HOME directory is "C:\". <p>The directory specified by HOME is also the directory substituted fortildes (~) in file names (so, by definition, your startup file will bein the directory "~\"). <p><hr><h3><a name="capscontrol">How do I swap CapsLock and Control?</h3>CapsLock and Control cannot be swapped from within Emacs, and Windowsdoes not have a convenient mechanism like xmodmap to change virtualkey bindings. Instead, new keyboard layouts or device drivers need tobe installed to swap the two keys. <p><b>W<font size=-1>ARNING</font>:</b> If you use a new keyboard layoutto switch CapsLock and Control, beware of the option to use hotkeysequences to switch keyboard layouts. This option is in ControlPanel->Keyboard under the Language (Win95) or Input Locales (NT) tabs;the sequences themselves are "Left Alt+Control" and "Ctrl+Shift". Ifyou enable one of these options, then you will likely at some pointswitch keyboard layouts while trying to use an Emacs keycombination. <p><b>NT 4.0:</b> For NT 4.0, check out <!WA106><!WA106><!WA106><a href="http://bmrc.berkeley.edu/people/chaffee/winntutil.html">swapcapslock.zip</a>. <p><b>NT 3.5, 3.51:</b> James Kittock has provided a program for NT thatinstalls a new keyboard layout with the two keys swapped. Onceinstalled, you can then select it using the "International" controlpanel applet. <p><ul><li><!WA107><!WA107><!WA107><a href="http://www.cs.washington.edu/homes/voelker/ntemacs/contrib/README.keyswap.txt">README</a><li><!WA108><!WA108><!WA108><a href="http://www.cs.washington.edu/homes/voelker/ntemacs/contrib/keyswap.tar">keyswap.tar</a></ul><b>Win95:</b> Microsoft has placed a keyboard remapping program forWin95 on their ftp site. For more info, take a look at their <!WA109><!WA109><!WA109><ahref="http://www.microsoft.com/windows/software/krnltoy.htm">KernelToys</a> page. <p>Mark Russinovich has also written a freeware VxD that swaps CapsLockand Control under Windows 95. (I've been told that you might have tohit the real Control key once after installing the VxD to jumpstartthe mapping.)<ul><li><!WA110><!WA110><!WA110><a href="http://www.cs.washington.edu/homes/voelker/ntemacs/contrib/ctrl2cap.doc">README</a><li><!WA111><!WA111><!WA111><a href="http://www.cs.washington.edu/homes/voelker/ntemacs/contrib/ctrl2cap.txt">source</a><li><!WA112><!WA112><!WA112><a href="http://www.cs.washington.edu/homes/voelker/ntemacs/contrib/ctrl2cap.vxd.tar">ctrl2cap.vxd.tar</a></ul>
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?