@c This is part of the Emacs manual.
-@c Copyright (C) 1985, 1986, 1987, 1993, 1994, 1995, 1997, 2000, 2001,
-@c 2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
+@c Copyright (C) 1985-1987, 1993-1995, 1997, 2000-2011
+@c Free Software Foundation, Inc.
@c See file emacs.texi for copying conditions.
-@node Microsoft Windows, Manifesto, Mac OS, Top
+@node Microsoft Windows, Manifesto, Mac OS / GNUstep, Top
@appendix Emacs and Microsoft Windows/MS-DOS
@cindex Microsoft Windows
@cindex MS-Windows, Emacs peculiarities
here.
@menu
+* Windows Startup:: How to start Emacs on Windows.
* Text and Binary:: Text files use CRLF to terminate lines.
* Windows Files:: File-name conventions on Windows.
* ls in Lisp:: Emulation of @code{ls} for Dired.
-* Windows HOME:: Where Emacs looks for your @file{.emacs}.
+* Windows HOME:: Where Emacs looks for your @file{.emacs} and
+ where it starts up.
* Windows Keyboard:: Windows-specific keyboard features.
* Windows Mouse:: Windows-specific mouse features.
* Windows Processes:: Running subprocesses on Windows.
* Windows Printing:: How to specify the printer on MS-Windows.
+* Windows Fonts:: Specifying fonts on MS-Windows.
* Windows Misc:: Miscellaneous Windows features.
@ifnottex
* MS-DOS:: Using Emacs on MS-DOS (otherwise known as @dfn{MS-DOG}).
@end ifnottex
@end menu
+@node Windows Startup
+@section How to Start Emacs on MS-Windows
+@cindex starting Emacs on MS-Windows
+
+ There are several ways of starting Emacs on MS-Windows:
+
+@enumerate
+@item
+@pindex runemacs.exe
+@cindex desktop shortcut, MS-Windows
+@cindex start directory, MS-Windows
+@cindex directory where Emacs starts on MS-Windows
+From the desktop shortcut icon: either double-click the left mouse
+button on the icon, or click once, then press @key{RET}. The desktop
+shortcut should specify as its ``Target'' (in the ``Properties'' of
+the shortcut) the full absolute file name of @file{runemacs.exe},
+@emph{not} of @file{emacs.exe}. This is because @file{runemacs.exe}
+hides the console window that would have been created if the target of
+the shortcut were @file{emacs.exe} (which is a console program, as far
+as Windows is concerned). If you use this method, Emacs starts in the
+directory specified by the shortcut. To control where that is,
+right-click on the shortcut, select ``Properties'', and in the
+``Shortcut'' tab modify the ``Start in'' field to your liking.
+
+@item
+From the Command Prompt window, by typing @kbd{emacs @key{RET}} at the
+prompt. The Command Prompt window where you did that will not be
+available for invoking other commands until Emacs exits. In this
+case, Emacs will start in the current directory of the Windows shell.
+
+@item
+From the Command Prompt window, by typing @kbd{runemacs @key{RET}} at
+the prompt. The Command Prompt window where you did that will be
+immediately available for invoking other commands. In this case,
+Emacs will start in the current directory of the Windows shell.
+
+@item
+@cindex invoking Emacs from Windows Explorer
+@pindex emacsclient.exe
+@pindex emacsclientw.exe
+Via the Emacs client program, @file{emacsclient.exe} or
+@file{emacsclientw.exe}. This allows to invoke Emacs from other
+programs, and to reuse a running Emacs process for serving editing
+jobs required by other programs. @xref{Emacs Server}. The difference
+between @file{emacsclient.exe} and @file{emacsclientw.exe} is that the
+former is a console program, while the latter is a Windows GUI
+program. Both programs wait for Emacs to signal that the editing job
+is finished, before they exit and return control to the program that
+invoked them. Which one of them to use in each case depends on the
+expectations of the program that needs editing services. If that
+program is itself a console (text-mode) program, you should use
+@file{emacsclient.exe}, so that any of its messages and prompts appear
+in the same command window as those of the invoking program. By
+contrast, if the invoking program is a GUI program, you will be better
+off using @file{emacsclientw.exe}, because @file{emacsclient.exe} will
+pop up a command window if it is invoked from a GUI program. A
+notable situation where you would want @file{emacsclientw.exe} is when
+you right-click on a file in the Windows Explorer and select ``Open
+With'' from the pop-up menu. Use the @samp{--alternate-editor=} or
+@samp{-a} options if Emacs might not be running (or not running as a
+server) when @command{emacsclient} is invoked---that will always give
+you an editor. When invoked via @command{emacsclient}, Emacs will
+start in the current directory of the program that invoked
+@command{emacsclient}.
+@end enumerate
+
@node Text and Binary
@section Text Files and Binary Files
@cindex text and binary files on MS-DOS/MS-Windows
default ignores letter-case in file names during completion.
@vindex w32-get-true-file-attributes
- If the variable @code{w32-get-true-file-attributes} is
-non-@code{nil} (the default), Emacs tries to determine the accurate
-link counts for files. This option is only useful on NTFS volumes,
-and it considerably slows down Dired and other features, so use it
-only on fast machines.
+ The variable @code{w32-get-true-file-attributes} controls whether
+Emacs should issue additional system calls to determine more
+accurately file attributes in primitives like @code{file-attributes}
+and @code{directory-files-and-attributes}. These additional calls are
+needed to report correct file ownership, link counts and file types
+for special files such as pipes. Without these system calls, file
+ownership will be attributed to the current user, link counts will be
+always reported as 1, and special files will be reported as regular
+files.
+
+ If the value of this variable is @code{local} (the default), Emacs
+will issue these additional system calls only for files on local fixed
+drives. Any other non-@code{nil} value means do this even for
+removable and remote volumes, where this could potentially slow down
+Dired and other related features. The value of @code{nil} means never
+issue those system calls. Non-@code{nil} values are more useful on
+NTFS volumes, which support hard links and file security, than on FAT,
+FAT32, and XFAT volumes.
@node ls in Lisp
@section Emulation of @code{ls} on MS-Windows
@end table
@noindent
-Any other value of @code{ls-lisp-emulation} means the same as
-@code{GNU}. Note that this option needs to be set @emph{before}
-@file{ls-lisp.el} is loaded, which means that on MS-Windows and MS-DOS
-you will have to set the value from your @file{.emacs} file and then
-restart Emacs, since @file{ls-lisp.el} is preloaded.
+Any other value of @code{ls-lisp-emulation} means the same as @code{GNU}.
+Customizing this option calls the function @code{ls-lisp-set-options} to
+update the 3 dependent options as needed. If you change the value of
+this variable without using customize after @file{ls-lisp.el} is loaded
+(note that it is preloaded on MS-Windows and MS-DOS), you can call that
+function manually for the same result.
@vindex ls-lisp-support-shell-wildcards
The variable @code{ls-lisp-support-shell-wildcards} controls how
@end ifnottex
@node Windows HOME
-@section HOME Directory on MS-Windows
+@section HOME and Startup Directories on MS-Windows
@cindex @code{HOME} directory on MS-Windows
The Windows equivalent of the @code{HOME} directory is the
or @file{C:\WINDOWS\Profiles\@var{username}\Application Data} on the
older Windows 9X/ME systems.
+ @code{HOME} can also be set in the system registry, for details see
+@ref{MS-Windows Registry}.
+
@cindex init file @file{.emacs} on MS-Windows
The home directory is where your init file @file{.emacs} is stored.
When Emacs starts, it first checks whether the environment variable
directory pointed by @env{HOME}. If @env{HOME} is not defined, Emacs
checks for an existing @file{.emacs} file in @file{C:\}, the root
directory of drive @file{C:}@footnote{
-The check in @file{C:\} is in preference to the application data
-directory for compatibility with older versions of Emacs, which didn't
-check the application data directory.
+The check in @file{C:\} is for compatibility with older versions of Emacs,
+which didn't check the application data directory.
}. If there's no such file in @file{C:\}, Emacs next uses the Windows
system calls to find out the exact location of your application data
-directory. If that fails as well, Emacs falls back to @file{C:\}.
+directory. If that system call fails, Emacs falls back to @file{C:\}.
Whatever the final place is, Emacs sets the value of the @env{HOME}
environment variable to point to it, and it will use that location for
key. If you wish it to produce the @code{Alt} modifier instead, set
the variable @code{w32-alt-is-meta} to a @code{nil} value.
+@findex w32-register-hot-key
+@findex w32-unregister-hot-key
+ MS-Windows reserves certain key combinations, such as
+@kbd{Alt-@key{TAB}}, for its own use. These key combinations are
+intercepted by the system before Emacs can see them. You can use the
+@code{w32-register-hot-key} function to allow a key sequence to be
+seen by Emacs instead of being grabbed by Windows. This functions
+registers a key sequence as a @dfn{hot key}, overriding the special
+meaning of that key sequence for Windows. (MS-Windows is told that
+the key sequence is a hot key only when one of the Emacs windows has
+focus, so that the special keys still have their usual meaning for
+other Windows applications.)
+
+ The argument to @code{w32-register-hot-key} must be a single key,
+with or without modifiers, in vector form that would be acceptable to
+@code{define-key}. The meta modifier is interpreted as the @key{ALT}
+key if @code{w32-alt-is-meta} is @code{t} (the default), and the hyper
+modifier is always interpreted as the Windows key (usually labeled
+with @key{start} and the Windows logo). If the function succeeds in
+registering the key sequence, it returns the hotkey ID, a number;
+otherwise it returns @code{nil}.
+
+@kindex M-TAB@r{, (MS-Windows)}
+@cindex @kbd{M-@key{TAB}} vs @kbd{Alt-@key{TAB}} (MS-Windows)
+@cindex @kbd{Alt-@key{TAB}} vs @kbd{M-@key{TAB}} (MS-Windows)
+ For example, @code{(w32-register-hot-key [M-tab])} lets you use
+@kbd{M-TAB} normally in Emacs, for instance, to complete the word or
+symbol at point at top level, or to complete the current search string
+against previously sought strings during incremental search.
+
+ The function @code{w32-unregister-hot-key} reverses the effect of
+@code{w32-register-hot-key} for its argument key sequence.
+
@vindex w32-capslock-is-shiftlock
By default, the @key{CapsLock} key only affects normal character
keys (it converts lower-case characters to their upper-case
different default values on MS-DOS and MS-Windows.
Emacs on Windows automatically determines your default printer and
-sets the variable @var{printer-name} to that printer's name. But in
+sets the variable @code{printer-name} to that printer's name. But in
some rare cases this can fail, or you may wish to use a different
printer from within Emacs. The rest of this section explains how to
tell Emacs which printer to use.
-@vindex printer-name@r{, (MS-DOS/MW-Windows)}
+@vindex printer-name@r{, (MS-DOS/MS-Windows)}
If you want to use your local printer, then set the Lisp variable
@code{lpr-command} to @code{""} (its default value on Windows) and
@code{printer-name} to the name of the printer port---for example,
variables in case you have two printers attached to two different
ports, and only one of them is a PostScript printer.)
+@cindex Ghostscript, use for PostScript printing
The default value of the variable @code{ps-lpr-command} is @code{""},
which causes PostScript output to be sent to the printer port specified
by @code{ps-printer-name}, but @code{ps-lpr-command} can also be set to
(setq ps-printer-name t)
(setq ps-lpr-command "D:/gs6.01/bin/gswin32c.exe")
(setq ps-lpr-switches '("-q" "-dNOPAUSE" "-dBATCH"
- "-sDEVICE=mswinpr2"
- "-sPAPERSIZE=a4"))
+ "-sDEVICE=mswinpr2"
+ "-sPAPERSIZE=a4"))
@end example
@noindent
(This assumes that Ghostscript is installed in the
@file{D:/gs6.01} directory.)
+@node Windows Fonts
+@section Specifying Fonts on MS-Windows
+@cindex font specification (MS Windows)
+
+ Starting with Emacs 23, fonts are specified by their name, size
+and optional properties. The format for specifying fonts comes from the
+fontconfig library used in modern Free desktops:
+
+@example
+ [Family[-PointSize]][:Option1=Value1[:Option2=Value2[...]]]
+@end example
+
+ The old XLFD based format is also supported for backwards compatibility.
+
+ Emacs 23 supports a number of backends. Currently, the @code{gdi}
+and @code{uniscribe} font backends are supported on Windows. The
+@code{gdi} font backend is available on all versions of Windows, and
+supports all fonts that are natively supported by Windows. The
+@code{uniscribe} font backend is available on Windows 2000 and later,
+and supports Truetype and Opentype fonts. Some languages requiring
+complex layout can only be properly supported by the uniscribe
+backend. By default, both backends are enabled if supported, with
+@code{uniscribe} taking priority over @code{gdi}.
+
+@cindex font properties (MS Windows)
+@noindent
+Optional properties common to all font backends on MS-Windows are:
+
+@table @code
+
+@vindex font-weight-table @r{(MS-Windows)}
+@item weight
+Specifies the weight of the font. Special values @code{light},
+@code{medium}, @code{demibold}, @code{bold}, and @code{black} can be specified
+without @code{weight=} (e.g., @kbd{Courier New-12:bold}). Otherwise,
+the weight should be a numeric value between 100 and 900, or one of the
+named weights in @code{font-weight-table}. If unspecified, a regular font
+is assumed.
+
+@vindex font-slant-table @r{(MS-Windows)}
+@item slant
+Specifies whether the font is italic. Special values
+@code{roman}, @code{italic} and @code{oblique} can be specified
+without @code{slant=} (e.g., @kbd{Courier New-12:italic}).
+Otherwise, the slant should be a numeric value, or one of the named
+slants in @code{font-slant-table}. On Windows, any slant above 150 is
+treated as italics, and anything below as roman.
+
+@item family
+Specifies the font family, but normally this will be specified
+at the start of the font name.
+
+@item pixelsize
+Specifies the font size in pixels. This can be used instead
+of the point size specified after the family name.
+
+@item adstyle
+Specifies additional style information for the font.
+On MS-Windows, the values @code{mono}, @code{sans}, @code{serif},
+@code{script} and @code{decorative} are recognized. These are most useful
+as a fallback with the font family left unspecified.
+
+@vindex w32-charset-info-alist
+@item registry
+Specifies the character set registry that the font is
+expected to cover. Most Truetype and Opentype fonts will be unicode fonts
+that cover several national character sets, but you can narrow down the
+selection of fonts to those that support a particular character set by
+using a specific registry from @code{w32-charset-info-alist} here.
+
+@item spacing
+Specifies how the font is spaced. The @code{p} spacing specifies
+a proportional font, and @code{m} or @code{c} specify a monospaced font.
+
+@item foundry
+Not used on Windows, but for informational purposes and to
+prevent problems with code that expects it to be set, is set internally to
+@code{raster} for bitmapped fonts, @code{outline} for scalable fonts,
+or @code{unknown} if the type cannot be determined as one of those.
+@end table
+
+@cindex font properties (MS Windows gdi backend)
+Options specific to @code{GDI} fonts:
+
+@table @code
+
+@cindex font scripts (MS Windows)
+@cindex font unicode subranges (MS Windows)
+@item script
+Specifies a unicode subrange the font should support.
+
+The following scripts are recognized on Windows: @code{latin}, @code{greek},
+@code{coptic}, @code{cyrillic}, @code{armenian}, @code{hebrew}, @code{arabic},
+@code{syriac}, @code{nko}, @code{thaana}, @code{devanagari}, @code{bengali},
+@code{gurmukhi}, @code{gujarati}, @code{oriya}, @code{tamil}, @code{telugu},
+@code{kannada}, @code{malayam}, @code{sinhala}, @code{thai}, @code{lao},
+@code{tibetan}, @code{myanmar}, @code{georgian}, @code{hangul},
+@code{ethiopic}, @code{cherokee}, @code{canadian-aboriginal}, @code{ogham},
+@code{runic}, @code{khmer}, @code{mongolian}, @code{symbol}, @code{braille},
+@code{han}, @code{ideographic-description}, @code{cjk-misc}, @code{kana},
+@code{bopomofo}, @code{kanbun}, @code{yi}, @code{byzantine-musical-symbol},
+@code{musical-symbol}, and @code{mathematical}.
+
+@cindex font antialiasing (MS Windows)
+@item antialias
+Specifies the antialiasing to use for the font. The value @code{none}
+means no antialiasing, @code{standard} means use standard antialiasing,
+@code{subpixel} means use subpixel antialiasing (known as Cleartype on Windows),
+and @code{natural} means use subpixel antialiasing with adjusted spacing between
+letters. If unspecified, the font will use the system default antialiasing.
+@end table
+
@node Windows Misc
@section Miscellaneous Windows-specific features
@vindex w32-use-visible-system-caret
@cindex screen reader software, MS-Windows
The variable @code{w32-use-visible-system-caret} is a flag that
-determines whether to make the system caret visible. The default is
-@code{nil}, which means Emacs draws its own cursor to indicate the
-position of point. A non-@code{nil} value means Emacs will indicate
-point location by the system caret; this facilitates use of screen
-reader software. When this variable is non-@code{nil}, other
-variables affecting the cursor display have no effect.
+determines whether to make the system caret visible. The default when
+no screen reader software is in use is @code{nil}, which means Emacs
+draws its own cursor to indicate the position of point. A
+non-@code{nil} value means Emacs will indicate point location by the
+system caret; this facilitates use of screen reader software, and is
+the default when such software is detected when running Emacs.
+When this variable is non-@code{nil}, other variables affecting the
+cursor display have no effect.
@iftex
@inforef{Windows Misc, , emacs}, for information about additional
non-@code{nil} value causes a frame to grab focus when it is raised.
The default is @code{t}, which fits well with the Windows default
click-to-focus policy.
-
-@vindex w32-list-proportional-fonts
- The variable @code{w32-list-proportional-fonts} controls whether
-proportional fonts are included in the font selection dialog. If its
-value is non-@code{nil}, these fonts will be included. The default is
-@code{nil}.
@end ifnottex
@ifnottex
@include msdog-xtra.texi
@end ifnottex
-
-@ignore
- arch-tag: f39d2590-5dcc-4318-88d9-0eb73ca10fa2
-@end ignore