aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGlenn Morris2013-08-27 00:57:39 -0700
committerGlenn Morris2013-08-27 00:57:39 -0700
commit1857cd3f9ef1103d5ea2fcecbb7b2a6a9d6b2aef (patch)
tree92b9a5563ab6e4a0aa3e530bee29ef98d532c1da
parent61ac6b9f821504ce12e0797a1fcf403e951d193b (diff)
downloademacs-1857cd3f9ef1103d5ea2fcecbb7b2a6a9d6b2aef.tar.gz
emacs-1857cd3f9ef1103d5ea2fcecbb7b2a6a9d6b2aef.zip
Move source for Emacs on MS Windows FAQ here from Emacs webpages repository
* Makefile.in (mostlyclean, clean, distclean, bootstrap-clean) (maintainer-clean, check-declare): Remove pointless subshells. Check cd return value. * configure.ac (DOCMISC_DVI_W32, DOCMISC_HTML_W32, DOCMISC_INFO_W32) (DOCMISC_PDF_W32, DOCMISC_PS_W32): New output variables. * Makefile.in (check-info-dir): Ignore efaq-w32. * admin/admin.el (manual-misc-manuals): Use INFO_COMMON rather than INFO_TARGETS. * doc/misc/efaq-w32.texi: Move here from the web-pages repository. * doc/misc/Makefile.in (DOCMISC_DVI_W32, DOCMISC_HTML_W32, DOCMISC_INFO_W32) (DOCMISC_PDF_W32, DOCMISC_PS_W32): New configure output variables. (INFO_COMMON, INFO_INSTALL): New derivations of INFO_TARGETS. (DVI_TARGETS, HTML_TARGETS, PDF_TARGETS, PS_TARGETS): Add DOCMISC_*_W32 variables. (echo-info): Use INFO_INSTALL rather than INFO_TARGETS. (efaq_w32_deps): New variable. (efaq-w32, $(buildinfodir)/efaq-w32$(INFO_EXT), efaq-w32.dvi) (efaq-w32.pdf, efaq-w32.html): New rules. (clean): Remove efaq-w32 products.
-rw-r--r--ChangeLog4
-rw-r--r--Makefile.in4
-rw-r--r--admin/ChangeLog5
-rw-r--r--admin/admin.el16
-rw-r--r--configure.ac21
-rw-r--r--doc/misc/ChangeLog14
-rw-r--r--doc/misc/Makefile.in41
-rw-r--r--doc/misc/efaq-w32.texi2364
8 files changed, 2455 insertions, 14 deletions
diff --git a/ChangeLog b/ChangeLog
index d7c30e1872f..c4595a4f2d7 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,9 @@
12013-08-27 Glenn Morris <rgm@gnu.org> 12013-08-27 Glenn Morris <rgm@gnu.org>
2 2
3 * configure.ac (DOCMISC_DVI_W32, DOCMISC_HTML_W32, DOCMISC_INFO_W32)
4 (DOCMISC_PDF_W32, DOCMISC_PS_W32): New output variables.
5 * Makefile.in (check-info-dir): Ignore efaq-w32.
6
3 * Makefile.in (mostlyclean, clean, distclean, bootstrap-clean) 7 * Makefile.in (mostlyclean, clean, distclean, bootstrap-clean)
4 (maintainer-clean, check-declare): Remove pointless subshells. 8 (maintainer-clean, check-declare): Remove pointless subshells.
5 Check cd return value. 9 Check cd return value.
diff --git a/Makefile.in b/Makefile.in
index e4b5ef3d07c..d5cd6bd8d20 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -1026,13 +1026,15 @@ info: force-info
1026 fi 1026 fi
1027 1027
1028# The info/dir file must be updated by hand when new manuals are added. 1028# The info/dir file must be updated by hand when new manuals are added.
1029# Cannot add an info/dir entry for efaq-w32 since it is not installed
1030# on all platforms.
1029check-info-dir: info 1031check-info-dir: info
1030 cd info ; \ 1032 cd info ; \
1031 missing= ; \ 1033 missing= ; \
1032 for file in *; do \ 1034 for file in *; do \
1033 test -f "$${file}" || continue ; \ 1035 test -f "$${file}" || continue ; \
1034 case $${file} in \ 1036 case $${file} in \
1035 *-[0-9]*|COPYING|dir) continue ;; \ 1037 *-[0-9]*|COPYING|dir|efaq-w32*) continue ;; \
1036 esac ; \ 1038 esac ; \
1037 file=`echo $${file} | sed 's/\.info//'` ; \ 1039 file=`echo $${file} | sed 's/\.info//'` ; \
1038 grep -q -F ": ($${file})." dir || missing="$${missing} $${file}" ; \ 1040 grep -q -F ": ($${file})." dir || missing="$${missing} $${file}" ; \
diff --git a/admin/ChangeLog b/admin/ChangeLog
index e9c6c74e163..f92fa8930b5 100644
--- a/admin/ChangeLog
+++ b/admin/ChangeLog
@@ -1,3 +1,8 @@
12013-08-27 Glenn Morris <rgm@gnu.org>
2
3 * admin.el (manual-misc-manuals): Use INFO_COMMON rather than
4 INFO_TARGETS.
5
12013-08-15 Glenn Morris <rgm@gnu.org> 62013-08-15 Glenn Morris <rgm@gnu.org>
2 7
3 * make-tarball.txt: Mention generating pdfs in etc/refcards. 8 * make-tarball.txt: Mention generating pdfs in etc/refcards.
diff --git a/admin/admin.el b/admin/admin.el
index 9c0015fc413..875db2948e5 100644
--- a/admin/admin.el
+++ b/admin/admin.el
@@ -195,19 +195,21 @@ Root must be the root of an Emacs source tree."
195 195
196(defun manual-misc-manuals (root) 196(defun manual-misc-manuals (root)
197 "Return doc/misc manuals as list of strings." 197 "Return doc/misc manuals as list of strings."
198 ;; Like `make -C doc/misc echo-info', but works if unconfigured. 198 ;; Similar to `make -C doc/misc echo-info', but works if unconfigured,
199 ;; and for INFO_TARGETS rather than INFO_INSTALL.
199 (with-temp-buffer 200 (with-temp-buffer
200 (insert-file-contents (expand-file-name "doc/misc/Makefile.in" root)) 201 (insert-file-contents (expand-file-name "doc/misc/Makefile.in" root))
201 (search-forward "INFO_TARGETS = ") 202 ;; Should really use expanded value of INFO_TARGETS.
202 (let ((start (point)) 203 (search-forward "INFO_COMMON = ")
203 res) 204 (let ((start (point)))
204 (end-of-line) 205 (end-of-line)
205 (while (and (looking-back "\\\\") 206 (while (and (looking-back "\\\\")
206 (zerop (forward-line 1))) 207 (zerop (forward-line 1)))
207 (end-of-line)) 208 (end-of-line))
208 (split-string (replace-regexp-in-string 209 (append (split-string (replace-regexp-in-string
209 "\\(\\\\\\|\\.info\\)" "" 210 "\\(\\\\\\|\\.info\\)" ""
210 (buffer-substring start (point))))))) 211 (buffer-substring start (point))))
212 '("efaq-w32")))))
211 213
212(defun make-manuals (root &optional type) 214(defun make-manuals (root &optional type)
213 "Generate the web manuals for the Emacs webpage. 215 "Generate the web manuals for the Emacs webpage.
diff --git a/configure.ac b/configure.ac
index 5737ec20abf..55194f5b822 100644
--- a/configure.ac
+++ b/configure.ac
@@ -997,6 +997,27 @@ INFO_OPTS=--no-split
997AC_SUBST(INFO_EXT) 997AC_SUBST(INFO_EXT)
998AC_SUBST(INFO_OPTS) 998AC_SUBST(INFO_OPTS)
999 999
1000
1001if test $opsys = mingw32; then
1002 DOCMISC_DVI_W32 = efaq-w32.dvi
1003 DOCMISC_HTML_W32 = efaq-w32.html
1004 DOCMISC_INFO_W32 = efaq-w32.info
1005 DOCMISC_PDF_W32 = efaq-w32.pdf
1006 DOCMISC_PS_W32 = efaq-w32.ps
1007else
1008 DOCMISC_DVI_W32 =
1009 DOCMISC_HTML_W32 =
1010 DOCMISC_INFO_W32 =
1011 DOCMISC_PDF_W32 =
1012 DOCMISC_PS_W32 =
1013fi
1014AC_SUBST(DOCMISC_DVI_W32)
1015AC_SUBST(DOCMISC_HTML_W32)
1016AC_SUBST(DOCMISC_INFO_W32)
1017AC_SUBST(DOCMISC_PDF_W32)
1018AC_SUBST(DOCMISC_PS_W32)
1019
1020
1000dnl Add our options to ac_link now, after it is set up. 1021dnl Add our options to ac_link now, after it is set up.
1001 1022
1002if test x$GCC = xyes; then 1023if test x$GCC = xyes; then
diff --git a/doc/misc/ChangeLog b/doc/misc/ChangeLog
index 554580c769a..b0a2b4cf526 100644
--- a/doc/misc/ChangeLog
+++ b/doc/misc/ChangeLog
@@ -1,3 +1,17 @@
12013-08-27 Glenn Morris <rgm@gnu.org>
2
3 * efaq-w32.texi: Move here from the web-pages repository.
4 * Makefile.in (DOCMISC_DVI_W32, DOCMISC_HTML_W32, DOCMISC_INFO_W32)
5 (DOCMISC_PDF_W32, DOCMISC_PS_W32): New configure output variables.
6 (INFO_COMMON, INFO_INSTALL): New derivations of INFO_TARGETS.
7 (DVI_TARGETS, HTML_TARGETS, PDF_TARGETS, PS_TARGETS):
8 Add DOCMISC_*_W32 variables.
9 (echo-info): Use INFO_INSTALL rather than INFO_TARGETS.
10 (efaq_w32_deps): New variable.
11 (efaq-w32, $(buildinfodir)/efaq-w32$(INFO_EXT), efaq-w32.dvi)
12 (efaq-w32.pdf, efaq-w32.html): New rules.
13 (clean): Remove efaq-w32 products.
14
12013-08-19 Katsumi Yamaoka <yamaoka@jpl.org> 152013-08-19 Katsumi Yamaoka <yamaoka@jpl.org>
2 16
3 * emacs-mime.texi (Encoding Customization): Exclude iso-2022-jp-2 and 17 * emacs-mime.texi (Encoding Customization): Exclude iso-2022-jp-2 and
diff --git a/doc/misc/Makefile.in b/doc/misc/Makefile.in
index 6618e125d7c..bf9daf4d966 100644
--- a/doc/misc/Makefile.in
+++ b/doc/misc/Makefile.in
@@ -59,7 +59,15 @@ INSTALL_DATA = @INSTALL_DATA@
59MAKEINFO = @MAKEINFO@ 59MAKEINFO = @MAKEINFO@
60MAKEINFO_OPTS = --force -I$(emacsdir) 60MAKEINFO_OPTS = --force -I$(emacsdir)
61 61
62INFO_TARGETS = ada-mode auth autotype bovine calc ccmode cl \ 62## On MS Windows, efaq-w32; otherwise blank.
63DOCMISC_DVI_W32 = @DOCMISC_DVI_W32@
64DOCMISC_HTML_W32 = @DOCMISC_HTML_W32@
65DOCMISC_INFO_W32 = @DOCMISC_INFO_W32@
66DOCMISC_PDF_W32 = @DOCMISC_PDF_W32@
67DOCMISC_PS_W32 = @DOCMISC_PS_W32@
68
69## Info files to build and install on all platforms.
70INFO_COMMON = ada-mode auth autotype bovine calc ccmode cl \
63 dbus dired-x ebrowse ede ediff edt eieio \ 71 dbus dired-x ebrowse ede ediff edt eieio \
64 emacs-mime epa erc ert eshell eudc efaq \ 72 emacs-mime epa erc ert eshell eudc efaq \
65 flymake forms gnus emacs-gnutls htmlfontify idlwave ido info.info \ 73 flymake forms gnus emacs-gnutls htmlfontify idlwave ido info.info \
@@ -68,7 +76,15 @@ INFO_TARGETS = ada-mode auth autotype bovine calc ccmode cl \
68 sc semantic ses sieve smtpmail speedbar srecode todo-mode tramp \ 76 sc semantic ses sieve smtpmail speedbar srecode todo-mode tramp \
69 url vip viper widget wisent woman 77 url vip viper widget wisent woman
70 78
71DVI_TARGETS = \ 79## Info files to install on current platform.
80INFO_INSTALL = $(INFO_COMMON) $(DOCMISC_INFO_W32)
81
82## Info files to build on current platform.
83## This is all of them, even though they might not all get installed,
84## because the info files are pre-built in release tarfiles.
85INFO_TARGETS = $(INFO_COMMON) efaq-w32
86
87DVI_TARGETS = $(DOCMISC_DVI_W32) \
72 ada-mode.dvi \ 88 ada-mode.dvi \
73 auth.dvi \ 89 auth.dvi \
74 autotype.dvi \ 90 autotype.dvi \
@@ -126,7 +142,7 @@ DVI_TARGETS = \
126 wisent.dvi \ 142 wisent.dvi \
127 woman.dvi 143 woman.dvi
128 144
129HTML_TARGETS = \ 145HTML_TARGETS = $(DOCMISC_HTML_W32) \
130 ada-mode.html \ 146 ada-mode.html \
131 auth.html \ 147 auth.html \
132 autotype.html \ 148 autotype.html \
@@ -184,7 +200,7 @@ HTML_TARGETS = \
184 wisent.html \ 200 wisent.html \
185 woman.html 201 woman.html
186 202
187PDF_TARGETS = \ 203PDF_TARGETS = $(DOCMISC_PDF_W32) \
188 ada-mode.pdf \ 204 ada-mode.pdf \
189 auth.pdf \ 205 auth.pdf \
190 autotype.pdf \ 206 autotype.pdf \
@@ -242,7 +258,7 @@ PDF_TARGETS = \
242 wisent.pdf \ 258 wisent.pdf \
243 woman.pdf 259 woman.pdf
244 260
245PS_TARGETS = \ 261PS_TARGETS = $(DOCMISC_PS_W32) \
246 ada-mode.ps \ 262 ada-mode.ps \
247 auth.ps \ 263 auth.ps \
248 autotype.ps \ 264 autotype.ps \
@@ -326,7 +342,7 @@ info: $(INFO_TARGETS)
326## Used by top-level Makefile. 342## Used by top-level Makefile.
327## Base file names of output info files. 343## Base file names of output info files.
328echo-info: 344echo-info:
329 @echo "$(INFO_TARGETS) " | \ 345 @echo "$(INFO_INSTALL) " | \
330 sed -e 's|[^ ]*/||g' -e 's/\.info//g' -e "s/ */$(INFO_EXT) /g" 346 sed -e 's|[^ ]*/||g' -e 's/\.info//g' -e "s/ */$(INFO_EXT) /g"
331 347
332# please modify this for all the web manual targets 348# please modify this for all the web manual targets
@@ -612,6 +628,18 @@ faq.pdf: $(faq_deps)
612faq.html: $(faq_deps) 628faq.html: $(faq_deps)
613 $(MAKEINFO) $(MAKEINFO_OPTS) $(HTML_OPTS) -o $@ ${srcdir}/faq.texi 629 $(MAKEINFO) $(MAKEINFO_OPTS) $(HTML_OPTS) -o $@ ${srcdir}/faq.texi
614 630
631efaq_w32_deps = ${srcdir}/efaq-w32.texi $(emacsdir)/emacsver.texi
632efaq-w32 : $(buildinfodir)/efaq-w32$(INFO_EXT)
633$(buildinfodir)/efaq-w32$(INFO_EXT): $(efaq_w32_deps)
634 $(mkinfodir)
635 $(MAKEINFO) $(MAKEINFO_OPTS) $(INFO_OPTS) -o $@ ${srcdir}/efaq-w32.texi
636efaq-w32.dvi: $(efaq_w32_deps)
637 $(ENVADD) $(TEXI2DVI) ${srcdir}/efaq-w32.texi
638efaq-w32.pdf: $(efaq_w32_deps)
639 $(ENVADD) $(TEXI2PDF) ${srcdir}/efaq-w32.texi
640efaq-w32.html: $(efaq_w32_deps)
641 $(MAKEINFO) $(MAKEINFO_OPTS) $(HTML_OPTS) -o $@ ${srcdir}/efaq-w32.texi
642
615flymake_deps = ${srcdir}/flymake.texi ${gfdl} 643flymake_deps = ${srcdir}/flymake.texi ${gfdl}
616flymake : $(buildinfodir)/flymake$(INFO_EXT) 644flymake : $(buildinfodir)/flymake$(INFO_EXT)
617$(buildinfodir)/flymake$(INFO_EXT): $(flymake_deps) 645$(buildinfodir)/flymake$(INFO_EXT): $(flymake_deps)
@@ -1040,6 +1068,7 @@ mostlyclean:
1040 1068
1041clean: mostlyclean 1069clean: mostlyclean
1042 rm -f $(DVI_TARGETS) $(HTML_TARGETS) $(PDF_TARGETS) $(PS_TARGETS) 1070 rm -f $(DVI_TARGETS) $(HTML_TARGETS) $(PDF_TARGETS) $(PS_TARGETS)
1071 rm -f efaq-w32.dvi efaq-w32.html efaq-w32.pdf efaq-w32.ps
1043 rm -f emacs-misc-${version}.tar* 1072 rm -f emacs-misc-${version}.tar*
1044 1073
1045distclean: clean 1074distclean: clean
diff --git a/doc/misc/efaq-w32.texi b/doc/misc/efaq-w32.texi
new file mode 100644
index 00000000000..480d7d2a175
--- /dev/null
+++ b/doc/misc/efaq-w32.texi
@@ -0,0 +1,2364 @@
1\input texinfo @c -*-coding:utf-8 -*-
2@setfilename efaq-w32
3@settitle GNU Emacs FAQ For MS Windows
4@setchapternewpage odd
5@syncodeindex pg cp
6@syncodeindex ky cp
7@syncodeindex tp cp
8@syncodeindex vr fn
9
10@documentdescription
11Answers to Frequently asked Questions about using Emacs on Microsoft Windows.
12@end documentdescription
13
14@set EMACSVER 24.3
15
16@documentencoding utf-8
17@documentlanguage en
18
19@copying
20Copyright @copyright{} 2008, 2010-2013 Free Software Foundation, Inc.
21
22@quotation
23This list of frequently asked questions about GNU Emacs on MS Windows
24with answers (``FAQ'') may be translated into other languages,
25transformed into other formats (e.g. Texinfo, Info, WWW), and updated
26with new information.
27
28The same conditions apply to any derivative of the FAQ as apply to the FAQ
29itself. Every copy of the FAQ must include this notice or an approved
30translation, information on who is currently maintaining the FAQ and how to
31contact them (including their e-mail address), and information on where the
32latest version of the FAQ is archived (including FTP information).
33
34The FAQ may be copied and redistributed under these conditions, except that
35the FAQ may not be embedded in a larger literary work unless that work
36itself allows free copying and redistribution.
37@end quotation
38@end copying
39
40@dircategory Emacs
41@direntry
42* Emacs W32 FAQ: (efaq-w32). FAQs about Emacs on MS Windows.
43@end direntry
44
45@c The @titlepage stuff only appears in the printed version
46@titlepage
47@sp 10
48@center @titlefont{GNU Emacs FAQ for MS Windows}
49
50@c The following two commands start the copyright page.
51@page
52@vskip 0pt plus 1filll
53@insertcopying
54@end titlepage
55
56@footnotestyle end
57
58@node Top
59@top GNU Emacs FAQ for MS Windows
60
61This is the GNU Emacs FAQ for MS Windows.
62
63This FAQ is maintained by the developers and users of Emacs on MS Windows.
64If you find any errors, or have any suggestions, please send them to
65the @url{http://lists.gnu.org/mailman/listinfo/help-emacs-windows,
66help-emacs-windows} mailing list.
67
68At time of writing, the latest version of GNU Emacs is version @value{EMACSVER}.
69
70@c Links to ftp.gnu.org are given as http links, since Windows ftp clients
71@c are notoriously bad at handling firewalls etc.
72
73@contents
74
75@menu
76* Introduction::
77* Getting Emacs::
78* Installing Emacs::
79* Display Settings::
80* Fonts and text translation::
81* Printing::
82* Sub-processes::
83* Network access::
84* Text and Utility modes::
85* Developing with Emacs::
86* Other useful ports::
87* Further information::
88* Indexes::
89@end menu
90
91@c ------------------------------------------------------------
92@node Introduction
93@chapter Introduction
94@cindex scope of FAQ
95
96This FAQ covers questions that are specific to running GNU Emacs on Windows.
97For more general information, see the other Emacs manuals.
98@xref{Further information}.
99
100@menu
101* Why Emacs on Windows::
102* Which versions of Windows::
103* Other versions of Emacs::
104@end menu
105
106@node Why Emacs on Windows
107@section Why support GNU Emacs on Windows?
108@cindex Why Windows
109
110It is not our goal to ``help Windows users'' by making text editing
111on Windows more convenient. We aim to replace proprietary software,
112not to enhance it. So why support GNU Emacs on Windows?
113
114We hope that the experience of using GNU Emacs on Windows will give
115programmers a taste of freedom, and that this will later inspire them
116to move to a free operating system such as GNU/Linux. That is the
117main valid reason to support free applications on nonfree operating
118systems.
119
120@node Which versions of Windows
121@section Which versions of Windows are supported?
122@cindex Windows, versions
123@cindex supported versions of Windows
124
125Emacs @value{EMACSVER} is known to run on all versions of Windows from
126@c FIXME does it really still support Windows 98? Does it matter?
127Windows 98 and Windows NT 4.0 through to Windows 7. The Windows port is
128built using the Win32 API and supports most features of the X version,
129including variable width fonts, images and tooltips.
130
131@node Other versions of Emacs
132@section What other versions of Emacs run on Windows?
133@cindex other ports of Emacs
134
135@xref{Cygwin}.
136
137@cindex DOS port
138@cindex Windows 3.11 port
139Emacs can also be compiled for MSDOS. When run on recent MS Windows,
140it supports long file names, and uses the Windows clipboard.
141See the @file{msdos} directory in the Emacs sources for building
142instructions (requires DJGPP).
143
144@c ------------------------------------------------------------
145@node Getting Emacs
146@chapter Getting Emacs
147
148@menu
149* Downloading::
150* Compiling::
151* Debugging::
152@end menu
153
154@node Downloading
155@section Where can I download Emacs?
156
157@cindex precompiled binaries
158@cindex where to get Emacs binaries
159Pre-compiled versions are distributed from
160@uref{http://ftpmirror.gnu.org/emacs/windows/, ftp.gnu.org mirrors}.
161Emacs binaries are distributed as zip files, digitally
162signed by the developer who built them. Generally most users will
163want the file @file{emacs-@value{EMACSVER}-bin-i386.zip}, which
164contains everything you need to get started.
165
166@cindex where to get sources
167@cindex Emacs source code
168@cindex source for Emacs
169The latest source is available from
170@uref{http://ftpmirror.gnu.org/emacs/, ftp.gnu.org mirrors}. It is
171distributed as a compressed tar file, digitally signed by the maintainer
172who made the release.
173
174@cindex Bzr, getting Emacs
175@cindex latest development version of Emacs
176@cindex Emacs Development
177The development version of Emacs is available from
178@uref{http://savannah.gnu.org/projects/emacs, Savannah}, the GNU
179development site.
180
181@node Compiling
182@section How can I compile Emacs myself?
183@cindex compiling Emacs
184
185To compile Emacs on Windows, you will need the MingW or Cygwin port of
186GCC with MingW make, or a Microsoft C compiler with nmake and the
187single threaded C runtime library. Recent versions of Microsoft
188Visual Studio no longer come with the single threaded C runtime
189library, which is required for certain POSIX compatibility, so MingW
190is usually the best choice. Image support requires external
191libraries, the headers and import libraries for which will need to be
192installed where your compiler can find them. You will also need ports
193of GNU @command{rm} and @command{cp}, as the Windows native
194equivalents are not consistent between versions. GNU texinfo will be
195required to build the manuals. @xref{Other useful ports}.
196
197After unpacking the source, or checking out of Bzr, be sure to read the
198instructions in @file{nt/README} and @file{nt/INSTALL}.
199
200@node Debugging
201@section How do I use a debugger on Emacs?
202@cindex debugging Emacs
203@cindex bugs in Emacs, how to debug
204@cindex Emacs debugging
205
206By default, Emacs is compiled with debugging on, and optimizations enabled.
207The optimizations may interfere with some types of debugging; the debugger
208may not show clearly where it is, or may not be able to inspect certain
209variables. If this is the case, reconfigure with @option{--no-opt}.
210
211The file @file{etc/DEBUG} contains general debugging hints, as well as
212specific notes about debugging Emacs with both gdb and Microsoft debuggers.
213
214@menu
215* GDB::
216* Microsoft Developer Studio::
217@end menu
218
219@node GDB
220@subsection GDB
221@cindex GDB, debugging Emacs with
222@cindex debugging Emacs with GDB
223
224GDB is the GNU debugger, which can be used to debug Emacs when it has
225been compiled with GCC. The best results will be obtained if you
226start gdb from the @file{src} directory as @samp{gdb oo/i386/emacs.exe}.
227This will load the init file @file{.gdbinit} in that directory, to
228define some extra commands for working with lisp while debugging, and
229set up breakpoints to catch abnormal aborts.
230
231@node Microsoft Developer Studio
232@subsection Microsoft Developer Studio
233@cindex MSVC++, debugging Emacs with
234@cindex DevStudio, debugging Emacs with
235@cindex debugging Emacs with MS DevStudio
236
237MS DevStudio can be used to debug Emacs when it has been compiled with
238a Microsoft compiler. To view lisp variables, you can call the
239function @code{debug_print} from the Quickwatch window. Some
240@uref{http://www.gnu.org/software/emacs/windows/ntemacs/discuss/debug.txt,
241old tips} are probably still valid.
242
243@c ------------------------------------------------------------
244@node Installing Emacs
245@chapter Installing Emacs
246
247@menu
248* Unpacking::
249* Installing::
250* Image support::
251* Init file::
252* Location of init file::
253* Troubleshooting init file::
254* Associate files with Emacs::
255* Find-file and the Desktop::
256* Make Windows more like X::
257* Make Emacs like a Windows app::
258* Window operations::
259* Uninstall::
260* Does not run::
261* Virus::
262* Anti-virus::
263@end menu
264
265@node Unpacking
266@section How do I unpack the distributions?
267@cindex unpacking Emacs distribution
268@cindex extracting Emacs distribution
269@cindex unzipping Emacs distribution
270@cindex untarring Emacs distribution
271@cindex zip files, how to unpack Emacs binaries
272@cindex tar.gz files, how to unpack Emacs sources
273
274The binary distributions are distributed as zip files, which are handled
275natively by Windows XP and later. For earlier versions, there are many
276tools that can handle the zip format, from InfoZip's command line unzip
277tool, to 7zip's multi-format graphical archive explorer. Although
278popular, WinZip has caused problems with line-ends in the past, and is not
279Free software, so we do not recommend it.
280
281Source distributions are distributed as gzipped tar files. 7zip and
282similar multi-format graphical tools can handle these, or you can get
283Windows ports of the command line gzip and tar tools from multiple sources.
284@xref{Other useful ports}.
285
286The command to unpack a source distribution from the command line is:
287@example
288tar xzf emacs-@value{EMACSVER}.tar.gz
289@end example
290
291If this does not work with the versions of tar and gzip that you have,
292you may need to try a two step process:
293@example
294gzip -dc emacs-@value{EMACSVER}.tar.gz | tar xvf -
295@end example
296
297You may see many messages from tar complaining about being unable to change
298the modification time on directories, and from gzip complaining about a
299broken pipe. These messages are usually harmless, caused by incomplete ports
300that are not fully aware of the limitations of Windows.
301
302@node Installing
303@section How do I install Emacs after unpacking?
304@cindex installing Emacs
305@pindex addpm
306@cindex Start Menu, creating icons for Emacs
307
308You can run Emacs without any extra steps, but if you want icons in your
309Start Menu, or for Emacs to detect the image libraries that are already
310installed on your system as part of GTK, then you should run the program
311@file{emacs-@value{EMACSVER}\bin\addpm.exe}.
312
313@node Image support
314@section How do I get image support?
315@cindex images, installing libraries for
316@cindex jpeg, installing image support in Emacs
317@cindex png, installing image support in Emacs
318@cindex gif, installing image support in Emacs
319@cindex tiff, installing image support in Emacs
320@cindex xpm, installing image support in Emacs
321@cindex toolbar, installing color icons in
322@cindex color images, installing support for images in Emacs
323@cindex monochrome images, getting color images in Emacs
324@cindex black and white images, getting color images in Emacs
325
326Emacs has built in support for XBM and PBM/PGM/PPM images. This is
327sufficient to see the monochrome splash screen and tool-bar icons.
328Since 22.2, the official precompiled binaries for Windows have bundled
329libXpm, which is required to display the color versions of those images.
330
331Emacs is compiled to recognize JPEG, PNG, GIF and TIFF images also,
332but displaying these image types require external DLLs which are not
333bundled with Emacs. @xref{Other useful ports}.
334
335@node Init file
336@section What is my init file?
337@cindex .emacs
338@cindex init file
339
340When Emacs starts up, it attempts to load and execute the contents of
341a file commonly called @file{.emacs} (though it may have other names,
342@pxref{Installing Emacs,,Where do I put my init file?}) which contains any
343customizations you have made. You can manually add lisp code to your
344.emacs, or you can use the Customization interface accessible from the
345@emph{Options} menu. If the file does not exist, Emacs will start
346with the default settings.
347
348@node Location of init file
349@section Where do I put my init file?
350@cindex HOME directory
351@cindex .emacs.d
352@cindex _emacs
353@cindex init.el
354@cindex registry, setting the HOME directory in
355
356On Windows, the .emacs file may be called _emacs for backward
357compatibility with DOS and FAT filesystems where filenames could not
358start with a dot. Some users prefer to continue using such a name,
359because Explorer cannot create a file with a name starting with a dot,
360even though the filesystem and most other programs can handle it.
361In Emacs 22 and later, the init file may also be called
362@file{.emacs.d/init.el}. Many of the other files that are created
363by lisp packages are now stored in the @file{.emacs.d} directory too,
364so this keeps all your Emacs related files in one place.
365
366All the files mentioned above should go in your @env{HOME} directory.
367The @env{HOME} directory is determined by following the steps below:
368
369@enumerate
370@item
371If the environment variable @env{HOME} is set, use the directory it indicates.
372@item
373If the registry entry @code{HKCU\SOFTWARE\GNU\Emacs\HOME} is set, use the
374directory it indicates.
375@item
376If the registry entry @code{HKLM\SOFTWARE\GNU\Emacs\HOME} is set, use the
377directory it indicates. Not recommended, as it results in users sharing
378the same HOME directory.
379@item
380If @file{C:\.emacs} exists, then use @file{C:/}. This is for
381backward compatibility, as previous versions defaulted to @file{C:/}
382if @env{HOME} was not set.
383@item
384Use the user's AppData directory, usually a directory called
385@file{Application Data} under the user's profile directory, the location
386of which varies according to Windows version and whether the computer is
387part of a domain.
388@end enumerate
389
390Within Emacs, @key{~} at the beginning of a file name is expanded to your
391@env{HOME} directory, so you can always find your .emacs file with
392@kbd{C-x C-f ~/.emacs}.
393
394@node Troubleshooting init file
395@section Troubleshooting init file problems
396@cindex troubleshooting init problems
397@cindex debugging init problems
398@cindex checking that HOME is set correctly
399
400If you've set @env{HOME} to a directory using one of the above
401methods, and Emacs still doesn't load your init file, the first
402thing you should do is check to see what Emacs thinks @env{HOME} is set
403to. You can do this by evaluating the following expression in the
404@file{*scratch*} buffer using @kbd{C-x C-e}:
405
406@example
407(insert (getenv "HOME"))
408@end example
409
410Look carefully at what is printed and make sure the value is
411valid. For example, if the value has trailing whitespace, Emacs won't
412be able to find the directory. Also, be sure that the value isn't a
413relative drive letter (e.g., @file{d:} without a backslash); if it is,
414then @env{HOME} is going to be whatever the current directory on that
415drive is, which is likely not what you want to happen.
416
417@node Associate files with Emacs
418@section How do I associate files with Emacs?
419@cindex Explorer, associating Emacs with files in
420@cindex emacsclient, associating files with
421@cindex file associations
422@cindex associating files with Emacs
423@cindex ALTERNATE_EDITOR
424@findex server-start
425
426The recommended way to associate files is to associate them with
427@command{emacsclientw.exe}. In order for this to work when Emacs is
428not yet started, you will also need to set the environment variable
429@env{ALTERNATE_EDITOR} to @command{runemacs.exe}. To open files
430in a running instance of Emacs, you will need to add the following
431to your init file:
432@example
433(server-start)
434@end example
435
436@menu
437* Using with Explorer::
438@end menu
439
440@node Using with Explorer
441@subsection For use with Internet Explorer
442@cindex Internet Explorer, view source in Emacs
443@cindex mailto urls, associating with Emacs
444@cindex news urls, associating with Emacs
445@cindex URLs, associating mail and news URLs with Emacs
446
447You can use Emacs as the editor for composing mail for
448@indicateurl{mailto:} links, reading usenet for @indicateurl{news:}
449links, and viewing source. The following registry entries control
450this:
451
452@itemize @w{}
453@item
454Mail
455@itemize
456@item @strong{Key:} HKCR\mailto\shell\open\command\(Default)
457@item @strong{Value:} emacsclientw -e "(message-mail (substring \"%1\" 7))"
458@end itemize
459
460@item
461News
462@itemize
463@item @strong{Key:} HKCR\news\shell\open\command\(Default)
464@item @strong{Value:} emacsclientw -e "(gnus-fetch-group (substring \"%1\" 5)"
465@end itemize
466
467@item
468View Source
469@itemize
470@item @strong{Key:} HKCR\htmlfile\shell\edit\command\(Default)
471@item @strong{Value:} emacsclientw "%1"
472@end itemize
473
474@end itemize
475
476Thanks to Jason Rumney and Sigbjorn Finne for these tips.
477
478@node Find-file and the Desktop
479@section How do I use find-file to open files that are on the Desktop?
480@cindex Desktop, finding where it is
481@cindex finding the Desktop
482@cindex locating files on the Desktop
483
484The location of the Desktop varies between different versions of
485Windows, and in a corporate environment can be moved around by the
486network administrator. On NT derivatives, you can use the value of
487the @env{USERPROFILE} environment variable to find where the desktop
488might be:
489
490@example
491@kbd{C-x C-f $USERPROFILE/Desktop}
492@end example
493
494If this doesn't work, then you probably have to forgo the keyboard
495just this once, and either drag a file onto the Emacs frame from the
496desktop, or use the file dialog (displayed when you use the toolbar or
497menu by default). Once you have a file from the Desktop inside Emacs,
498@kbd{C-x C-f} will quickly reveal where your desktop is kept.
499
500@node Make Windows more like X
501@section How can I modify Windows to act more like X?
502@cindex X, making Windows behave like
503
504@menu
505* Focus follows mouse::
506* Swap CapsLock and Control::
507@end menu
508
509@node Focus follows mouse
510@subsection How do it make the active window follow the mouse?
511@vindex focus-follows-mouse
512@cindex point to focus
513@cindex mouse over to focus
514
515Customize the variables @code{focus-follows-mouse} and
516@code{mouse-autoselect-window}. The former can be used to mislead
517Emacs into giving focus to other frames when the mouse is over them,
518even though Windows has a click to focus policy by default (there is
519software available to change that though). The latter can be used to
520make Emacs use a focus-follow-mouse policy within its own frames.
521
522@node Swap CapsLock and Control
523@subsection How do I swap CapsLock and Control?
524@cindex scan codes, modifying
525@cindex key layout, customizing
526@cindex caps-lock, swapping with control key
527@cindex control key, swapping with caps-lock
528@cindex windows key, use as alt
529@cindex alt key, using windows keys as additional
530
531This cannot be done within Emacs, but you can modify the scan code
532mappings in the registry or define a new keyboard layout to swap the
533keys on a system wide basis.
534
535@menu
536* Swap Caps NT::
537* Swap Caps 98::
538@end menu
539
540@node Swap Caps NT
541@subsubsection Windows NT/2000/XP/Vista?
542
543@itemize
544@item
545From Chris McMahon. To make CapsLock a Control key (leaving your
546original control keys as they were), use this registry file:
547@example
548REGEDIT4
549
550[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Keyboard Layout]
551"Scancode Map"=hex:00,00,00,00,00,00,00,00,02,00,00,00,1d,00,3a,00,00,00,00,00
552@end example
553To swap CapsLock and the left Control key, use:
554@example
555REGEDIT4
556
557[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Keyboard Layout]
558"Scancode Map"=hex:00,00,00,00,00,00,00,00,03,00,00,00,1d,00,3a,00,3a,00,1d,00,00,00,00,00
559@end example
560Save these as files with a @file{.reg} extension, and double-click on
561them in Explorer, or ``run'' them from a command prompt to have them
562update your registry (you may need to reboot).
563@item
564Shane Holder gives some background on how "Scancode Map" is used
565by the system:
566@ignore
567http://ftp.gnu.org/old-gnu/emacs/windows/docs/ntemacs/contrib/caps-ctrl-registry.txt
568From: Shane Holder <holder@@mordor.rsn.hp.com>
569To: ntemacs-users@@cs.washington.edu
570Date: 04 Dec 1996 14:36:21 -0600
571Message-ID: <fawg21mm4hm.fsf@@mordor.rsn.hp.com>
572Subject: Re: Re[2]: problem with caps/ctrl swap on NT 4.0
573@end ignore
574@example
575It's a binary value that lets you map keystrokes in the low-level keyboard
576drivers in NT. As a result you don't have to worry about applications
577bypassing mappings that you've done at a higher level (i.e. it just works).
578
579Here's the format of the value:
580
581 DWORD: 0x00000000 header
582 DWORD: 0x00000000 header
583 DWORD: length (in DWORDs) of remaining data, including terminating DWORD
584 DWORD: mapping 1
585 ...
586 DWORD: mapping n
587 DWORD: 0x00000000 terminating null DWORD
588
589Each mapping DWORD has two parts: the input scancode, and an output
590scancode. To map scancode 0x1d (left control) to scancode 0x3a (caps
591lock), you want a value of 0x003a001d. Note that this does not swap the
592keys. Using just this mapping value, both the left control and the caps
593lock key will behave as caps-lock. To swap, you also need to map 0x3a to
5940x1d, using 0x001d003a.
595
596This registry value is system wide, and can't be made user-specific. It
597also only takes affect on reboot.
598@end example
599@item
600Ulfar Erlingsson has provided a registry file that sets the CapsLock key
601to be a Control key and the Windows key to be an Alt key:
602@example
603REGEDIT4
604
605[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Keyboard Layout]
606"Scancode Map"=hex:00,00,00,00,00,00,00,00,03,00,00,00,1d,00,3a,00,38,00,5b,e0,00,00,00,00
607@end example
608@end itemize
609
610@node Swap Caps 98
611@subsubsection Windows 95/98/ME
612
613Microsoft has a tool called keyremap that is part of their Kernel Toys add ons
614for Windows 95. The tool has also been confirmed to work on Windows 98.
615
616@node Make Emacs like a Windows app
617@section How can I modify Emacs to act more like a Windows app?
618@cindex Windows, making Emacs act more like
619@cindex UI, making Emacs more like other Windows apps
620
621Many beginning users find Emacs difficult to use because its user
622interface is different in many ways. Emacs predates most UI
623standards, and experienced Emacs users are used to the way things are,
624so changing the defaults is difficult. Most of the ``standard''
625behavior can be approximated in Emacs after some configuring though.
626
627@menu
628* Highlight selection::
629* CUA::
630@end menu
631
632@node Highlight selection
633@subsection Highlighting the selection
634@cindex transient-mark-mode
635@cindex selection, highlighting
636@cindex region, highlighting
637@cindex highlighting the selected region
638@cindex marked region, highlighting
639@cindex point and mark, highlighting the region between
640@cindex delete-selection-mode
641@cindex overwriting the selected region
642
643Emacs has a concept of a mark and point that is similar to selections
644in other programs. But the mark in Emacs is used for more than just
645defining the selected region, it lives on while you continue to edit
646and move around the buffer so it can also be a kind of bookmark. The
647history of marks is saved so you can pop previous marks back to the
648top of the stack to go back to somewhere you were some time ago.
649Because of this dual purpose, the region between mark and point is not
650highlighted by default unless you select a region by clicking and
651dragging the mouse.
652
653The minor mode @code{transient-mark-mode} changes the behavior of
654the mark in two ways. First, it distinguishes between an active mark
655that has just been defined or reactivated, and an inactive mark. When
656the mark is active, some commands that normally act on lines, words,
657buffers etc. will instead act on the region. An inactive mark needs
658to be reactivated to operate on it, unless @code{mark-even-if-inactive}
659is set. Secondly, @code{transient-mark-mode} also highlights the
660region when it is active, providing the same visual clue that you get
661in other programs.
662
663In addition to seeing the highlighting, new Emacs users often expect
664editing commands to replace the region when it is active. This behavior
665can be obtained with @code{delete-selection-mode}, but see the following
666question also.
667
668@node CUA
669@subsection Standard Windows key bindings
670@findex cua-mode
671@cindex CUA keybindings
672@cindex shift key, selecting with
673@cindex standard Windows keybindings
674@cindex paste with C-v
675@cindex cut with C-x
676@cindex copy with C-c
677@cindex C-c to copy
678@cindex C-x to cut
679@cindex C-v to paste
680
681The keybindings of Emacs predate modern GUIs, and the keys that were
682chosen by later GUIs for cut and copy were given important functions
683as extended keymaps in Emacs. CUA mode attempts to let both bindings
684co-exist by defining C-x and C-c as @code{kill-region} and
685@code{copy-region-as-kill} when the region is active, and letting
686them have their normal Emacs bindings when the region is not active.
687Many people find this to be an acceptable compromise. CUA mode also
688defines a number of other keys (C-v, Shift selection), and can be turned
689on from the @emph{Options} menu.
690
691@node Window operations
692@section Window operations
693@cindex maximize frames from lisp
694@cindex minimize frames from lisp
695@cindex WM_SYSCOMMAND, sending system commands from lisp
696@cindex system menu, simulating from lisp
697
698The function @code{w32-send-sys-command} can be used to simulate
699choosing commands from the system menu (in the top left corner of the
700Window) and a few other system wide functions. It takes an integer
701argument, the value of which should be a valid @code{WM_SYSCOMMAND}
702message as documented in Microsoft's API documentation.
703
704@node Uninstall
705@section How do I uninstall Emacs?
706@cindex uninstall Emacs
707@cindex remove Emacs
708@cindex clean Emacs registry settings
709@cindex registry, cleaning the Emacs settings
710@cindex Start Menu, removing Emacs from
711@cindex upgrading Emacs
712@cindex delete Emacs directory
713
714Emacs does not come with an uninstall program. No files are installed
715outside of the Emacs base directory, so deleting that directory is
716sufficient to clean away the files. If you ran @command{addpm},
717you'll need to delete the Start Menu group too. The registry entries
718inserted by @command{addpm} will not cause any problems if you leave
719them there, but for the sake of completeness, you can use @command{regedit}
720to remove the keys under @code{HKEY_LOCAL_MACHINE} orx
721@code{HKEY_CURRENT_USER}: @code{SOFTWARE\GNU\Emacs}, and the key
722@code{HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\emacs.exe} if it exists.
723
724@node Does not run
725@section When I run Emacs nothing happens
726@cindex troubleshooting installation problems
727@cindex window not appearing, Emacs
728@cindex failure to run, Emacs
729@cindex 8.3 filenames, problems caused
730
731Emacs could have failed to run for a number of reasons. The most
732common symptom is that, when Emacs is started, the cursor changes for
733a second but nothing happens. If this happens to you, it is quite
734likely that the distribution was unpacked incorrectly.
735
736Check for the following to see if there was a problem during unpacking:
737@enumerate
738@item
739Be sure to disable the CR/LF translation or the executables will be
740unusable. Older versions of WinZipNT would enable this translation by
741default. If you are using WinZipNT, disable it.
742@item
743Check that filenames were not truncated to 8.3. For example, there
744should be a file CONTRIBUTE in the top level directory; if this has
745been truncated to CONTRIBU or CONTRI~1, your distribution has been
746corrupted while unpacking and Emacs will not start.
747@end enumerate
748
749If it is still not working, send mail to the list, describing what
750you've done, and what you are seeing. (The more information you send
751the more likely it is that you'll receive a helpful response..
752
753@node Virus
754@section Does Emacs contain a virus?
755@cindex virus reported in Emacs
756@cindex anti-virus software reporting a virus in Emacs
757
758There have been reports in the past that some virus scanners claim
759that the Emacs distribution has a virus. This is extremely unlikely if
760you have downloaded Emacs from the GNU FTP site or one of its mirrors
761and the GPG signature for it is valid and listed in the GNU keyring,
762unless perhaps it is a new release made in the last few days, in which
763case you should exercise more caution and report the problem. Past
764problems seem to have been caused by virus checkers running into a
765buffer size limit when unpacking large tar.gz files for scanning, and
766reporting the failure as an ``unknown virus''.
767
768@node Anti-virus
769@section What known problems are there with anti-virus software?
770@cindex anti-virus software, bad interaction with
771@cindex virus software, bad interaction with
772@cindex firewall, bad interaction with
773@cindex scan all files, anti-virus option causing problems
774@cindex auto protect, anti-virus option causing problems
775@cindex shell, interacting badly with anti-virus
776@cindex subprocesses, interacting badly with anti-virus
777
778Anti-virus and firewall software can block Emacs from starting subprocesses
779and opening network connections. Most such products have an Advanced
780mode where they will prompt you rather than silently blocking. In some cases
781the ``scan all files'' or ``auto protect'' option of anti-virus programs
782has caused failures running shell related commands within Emacs.
783@xref{Sub-processes,,Why is nothing happening when I enter shell commands?}.
784
785@c ------------------------------------------------------------
786@node Display Settings
787@chapter Display Settings
788
789@menu
790* Console window size::
791* Mouse trouble::
792* Cut and paste NUL::
793* Garbled clipboard::
794* Beep sound::
795@end menu
796
797@node Console window size
798@section Emacs in console mode goes beyond the window size
799@cindex console, window size
800@cindex telnet, display size problems running emacs over
801@cindex -nw, window size
802@vindex w32-use-full-screen-buffer
803
804The variable @code{w32-use-full-screen-buffer} controls whether Emacs uses
805the window size or buffer size to determine the number of lines on screen.
806Normally the window size is correct, but when running Emacs over some
807telnet servers, the buffer size needs to be used. Emacs tries to guess
808the correct value at startup, but if it guesses wrong, you can customize
809that variable yourself.
810
811@node Mouse trouble
812@section What do I do if I have problems with my mouse buttons?
813@cindex mouse buttons, problems with
814@cindex 2 button mouse
815@cindex two button mouse
816@cindex third mouse button, simulating
817@cindex middle mouse button, simulating
818@cindex simulating three button mouse with two buttons
819@cindex swap right and middle mouse buttons
820@cindex exchange mouse-2 and mouse-3 buttons
821@vindex w32-mouse-button-tolerance
822@vindex w32-num-mouse-buttons
823@vindex w32-swap-mouse-buttons
824
825Emacs assigns bindings assuming a three button mouse. On Windows, if
826a two button mouse is detected, a hack is enabled which lets you
827simulate the third button by pressing both mouse buttons
828simultaneously. @code{w32-mouse-button-tolerance} defines the timeout
829for what is considered ``simultaneous''. You can check how many
830buttons Emacs thinks your mouse has with @kbd{C-h v}
831@code{w32-num-mouse-buttons}.
832
833If you find yourself needing the mouse-3 bindings more often than mouse-2,
834you can swap the buttons with the following code in your init file:
835@example
836(setq w32-swap-mouse-buttons t)
837@end example
838
839@node Cut and paste NUL
840@section How do I cut and paste text with NUL characters?
841@cindex clipboard, NUL characters
842
843If you attempt to cut and paste text with NUL characters embedded in it,
844then the text will be truncated at the first NUL character. This is a
845limitation of the Windows clipboard, and does not affect killing and yanking
846from the kill-ring within Emacs.
847
848@node Garbled clipboard
849@section How can I fix garbled text yanked from the clipboard?
850@cindex clipboard, corruption of
851@cindex garbage on the clipboard
852@cindex clipboard encoding
853@cindex encoding, clipboard
854@findex set-selection-coding-system
855
856You can try @code{set-selection-coding-system}, but generally such
857corruption is a thing of the past, as Emacs uses Unicode for the clipboard
858by default now.
859
860@node Beep sound
861@section How do I change the sound of the Emacs beep?
862@cindex beep, changing the sound
863@cindex sound, changing the beep
864@findex set-message-beep
865
866You can use the function @code{set-message-beep} to change the sound
867that Emacs uses for its beep. This affects both console and GUI frames.
868The doc string contains a list of the system sounds you can use.
869
870@c ------------------------------------------------------------
871@node Fonts and text translation
872@chapter Fonts and text translation
873
874@menu
875* Font names::
876* Bold and italic::
877* Multilingual fonts::
878* BDF fonts::
879* Font menu::
880* Line ends::
881@end menu
882
883@node Font names
884@section Font names
885@cindex XLFD font names
886@cindex font XLFD name format
887@cindex fontconfig font names in Emacs 23
888@cindex font dialog, using to find font names
889@findex w32-select-font
890@findex x-list-fonts
891
892Fonts in Emacs 22 and earlier are named using the X Logical Font
893Description (XLFD) format. Emacs on Windows ignores many of the
894fields, and populates them with * when listing fonts. Former
895maintainer Andrew Innes wrote
896@uref{http://www.gnu.org/software/emacs/windows/ntemacs/discuss/x-font-details,
897this explanation} of what each field in the font string means and how
898Emacs treated them back in 19.34. Since then, multilingual support and
899a redisplay overhaul to support variable width fonts have changed things
900slightly; more character sets are recognized (and the old pseudo character
901sets are deprecated), and the resolution fields are used to calculate the
902difference between point and pixel sizes, but normally you should leave
903these at the system default. The foundry field is also populated with
904an indication of whether the font is outline (.TTF, .ATM) or raster (.FON)
905based when fonts are listed, which may let you differentiate between two
906fonts with the same name and different technologies.
907
908From Emacs 23, the preferred font name format will be moving to the simpler
909and more flexible fontconfig format. XLFD names will continue to be
910supported for backward compatibility.
911
912@example
913XLFD: -*-Courier New-normal-r-*-*-13-*-*-*-c-*-iso8859-1
914Fontconfig: Courier New-13
915@end example
916
917To find the XFLD name for a font, you can execute the following in the
918@file{*scratch*} buffer by pressing C-j at the end of the line:
919@example
920(w32-select-font nil t)
921@end example
922
923To see a complete list of fonts, execute the following in the
924@file{*scratch*} buffer by pressing C-x C-e at the end of the line:
925@example
926(insert (prin1-to-string (x-list-fonts "*")))
927@end example
928
929The command line options and frame-parameters for changing the default font
930in Emacs are documented in the manual. Fonts can also be used when defining
931faces, though family and size are generally specified individually there.
932In addition, Emacs on Windows reads the registry to find X Resources. This
933is also documented in the manual.
934
935@node Bold and italic
936@section How can I get bold and italic fonts to work?
937@cindex italic fonts
938@cindex synthesized italic and bold fonts
939@cindex bold fonts, synthesized
940@findex set-face-font
941@vindex w32-enable-synthesized-fonts
942
943Emacs will only use the italic (and bold) versions of a font automatically
944if it has the same width as the normal version. Many fonts have italic
945and bold versions that are slightly wider. It will also only use real
946bold and italic fonts by default, where other applications may use
947synthesized variations that are derived from the normal font. To enable
948more italic and bold fonts to be displayed, you can enable synthesized fonts
949and manually set the font for italic, bold and bold-italic as follows:
950
951@example
952(setq w32-enable-synthesized-fonts t)
953(set-face-font 'italic "-*-Courier New-normal-i-*-*-11-*-*-*-c-*-iso8859-1")
954(set-face-font 'bold-italic "-*-Courier New-bold-i-*-*-11-*-*-*-c-*-iso8859-1")
955@end example
956
957@node Multilingual fonts
958@section Multilingual font support
959@cindex multilingual display, fonts
960@cindex MULE, fonts
961
962@menu
963* Language display::
964* Non-latin display::
965* International fonts::
966* Third-party multibyte::
967* Localized fonts::
968@end menu
969
970@node Language display
971@subsection Is it possible to display all the supported languages?
972@cindex HELLO file, displaying all
973@cindex language support, fonts
974@cindex GNU intlfonts, for displaying all languages
975@cindex intlfonts, for displaying all languages
976
977To display all the languages that Emacs is capable of displaying, you will
978require the BDF fonts from the GNU intlfonts package.
979@xref{Fonts and text translation,,How do I use bdf fonts with Emacs?}.
980
981For many languages, native truetype fonts are sufficient, and in Emacs
98223 the need for BDF fonts will disappear for almost all languages. At
983the time of writing, some Arabic characters in the HELLO file still do
984not display with native fonts, because they are pre-composed characters
985from MULE character sets rather than standard Unicode Arabic, but all
986other characters are able to be displayed with appropriate truetype or
987opentype fonts.
988
989@node Non-latin display
990@subsection How do I get Emacs to display non-latin characters?
991@cindex fontsets, defining
992@cindex language support, forcing Emacs to use specific fonts
993@cindex MULE, fontsets
994@cindex multilingual display, fontsets
995@findex create-fontset-from-ascii-font
996@findex create-fontset-from-fontset-spec
997
998Recent versions of Emacs display a large range of characters out of
999the box, but if you are having problems with a particular character
1000set which you know you have fonts for, you can try defining a
1001new fontset with @code{create-fontset-from-ascii-font} or
1002@code{create-fontset-from-fontset-spec}.
1003
1004@example
1005(create-fontset-from-fontset-spec
1006 "-*-Courier New-normal-r-*-*-12-*-*-*-c-*-fontset-most,
1007 latin-iso8859-2:-*-Courier New-normal-r-*-*-12-*-*-*-c-*-iso8859-2,
1008 latin-iso8859-3:-*-Courier New-normal-r-*-*-12-*-*-*-c-*-iso8859-3,
1009 latin-iso8859-4:-*-Courier New-normal-r-*-*-12-*-*-*-c-*-iso8859-4,
1010 cyrillic-iso8859-5:-*-Courier New-normal-r-*-*-12-*-*-*-c-*-iso8859-5,
1011 greek-iso8859-7:-*-Courier New-normal-r-*-*-12-*-*-*-c-*-iso8859-7,
1012 latin-iso8859-9:-*-Courier New-normal-r-*-*-12-*-*-*-c-*-iso8859-9,
1013 japanese-jisx0208:-*-MS Gothic-normal-r-*-*-12-*-*-*-c-*-jisx0208-sjis,
1014 katakana-jisx0201:-*-MS Gothic-normal-r-*-*-12-*-*-*-c-*-jisx0208-sjis,
1015 latin-jisx0201:-*-MS Gothic-normal-r-*-*-12-*-*-*-c-*-jisx0208-sjis,
1016 japanese-jisx0208-1978:-*-MS Gothic-normal-r-*-*-12-*-*-*-c-*-jisx0208-sjis,
1017 korean-ksc5601:-*-Gulim-normal-r-*-*-12-*-*-*-c-*-ksc5601-*,
1018 chinese-gb2312:-*-MS Song-normal-r-*-*-12-*-*-*-c-*-gb2312-*,
1019 chinese-big5-1:-*-MingLiU-normal-r-*-*-12-*-*-*-c-*-big5-*,
1020 chinese-big5-2:-*-MingLiU-normal-r-*-*-12-*-*-*-c-*-big5-*" t)
1021@end example
1022
1023@node International fonts
1024@subsection Where can I find fonts for other languages?
1025@cindex language support, finding fonts
1026@cindex fonts, where to find
1027@cindex MULE, finding fonts
1028@cindex multilingual display, finding fonts
1029@cindex GNU intlfonts, where to get
1030@cindex intlfonts, where to get
1031
1032In addition to the wide range of fonts that come with the language
1033support packages of various components of Windows itself, GNU/Linux
1034distributions these days come with a number of Free truetype fonts
1035that cover a wide range of languages. The GNU intlfonts source
1036distribution contains BDF fonts covering all of the languages that can
1037be displayed by Emacs 22, and can be downloaded from
1038@uref{http://ftpmirror.gnu.org/intlfonts, ftp.gnu.org mirrors}.
1039
1040@node Third-party multibyte
1041@subsection How do I use third party programs to display multibyte characters?
1042@cindex multilingual display, third party programs on Windows 9x/ME
1043@cindex language support, third party programs on Windows 9x/ME
1044@vindex w32-enable-unicode-output
1045
1046You probably only need to do this on the non-Unicode versions of Windows
1047(95, 98 and ME), and even then, various Windows and Internet Explorer
1048updates have made third party software unnecessary in most cases.
1049If you are having trouble displaying text, try defining a fontset
1050with the font for the languages that the third party software handles
1051set to what that software expects (which may not be an appropriate font
1052for that language, but the third party software is intercepting it
1053and using a different font behind the scenes).
1054@xref{Non-latin display}.
1055
1056In addition to defining a fontset with the expected font, you may also need
1057to disable unicode output with:
1058@example
1059(setq w32-enable-unicode-output nil)
1060@end example
1061
1062@node Localized fonts
1063@subsection Can I use a font with a name in my language?
1064@cindex fonts, localized font names
1065@vindex locale-coding-system
1066
1067Normally Emacs should initialize @code{locale-coding-system} appropriately
1068based on your locale, which will let Emacs use font names in your local
1069language successfully.
1070
1071@node BDF fonts
1072@section How do I use bdf fonts with Emacs?
1073@cindex BDF fonts, using
1074@cindex GNU intlfonts, using
1075@cindex intlfonts, using
1076@vindex w32-bdf-filename-alist
1077@vindex bdf-directory-alist
1078@vindex font-encoding-alist
1079@findex w32-find-bdf-fonts
1080@findex set-frame-font
1081
1082To use bdf fonts with Emacs, you need to tell Emacs where the fonts
1083are located, create fontsets for them, and then use them. We'll use
1084the 16 dot international fonts from @uref{http://ftpmirror.gnu.org/intlfonts,
1085ftp.gnu.org/gnu/intlfonts} as an
1086example put together by Jason Rumney.
1087
1088Download @file{16dots.tar.gz} and unpack it; I'll assume that they are in
1089@file{c:\intlfonts}. Then set @code{w32-bdf-filename-alist} to the list of
1090fonts returned by using @code{w32-find-bdf-fonts} to enumerate all of
1091the font files. It is a good idea to set the variable
1092@code{bdf-directory-list} at the same time so @code{ps-print} knows where
1093to find the fonts:
1094@example
1095(setq bdf-directory-list
1096 '("c:/intlfonts/Asian" "c:/intlfonts/Chinese"
1097 "c:/intlfonts/Chinese-X" "c:/intlfonts/Ethiopic"
1098 "c:/intlfonts/European" "c:/intlfonts/Japanese"
1099 "c:/intlfonts/Japanese-X" "c:/intlfonts/Korean-X"
1100 "c:/intlfonts/Misc/"))
1101
1102(setq w32-bdf-filename-alist (w32-find-bdf-fonts bdf-directory-list))
1103@end example
1104
1105Then create fontsets for the BDF fonts:
1106
1107@example
1108(create-fontset-from-fontset-spec
1109 "-*-fixed-medium-r-normal-*-16-*-*-*-c-*-fontset-bdf,
1110japanese-jisx0208:-*-*-medium-r-normal-*-16-*-*-*-c-*-jisx0208.1983-*,
1111katakana-jisx0201:-*-*-medium-r-normal-*-16-*-*-*-c-*-jisx0201*-*,
1112latin-jisx0201:-*-*-medium-r-normal-*-16-*-*-*-c-*-jisx0201*-*,
1113japanese-jisx0208-1978:-*-*-medium-r-normal-*-16-*-*-*-c-*-jisx0208.1978-*,
1114thai-tis620:-misc-fixed-medium-r-normal--16-160-72-72-m-80-tis620.2529-1,
1115lao:-misc-fixed-medium-r-normal--16-160-72-72-m-80-MuleLao-1,
1116tibetan-1-column:-TibMdXA-fixed-medium-r-normal--16-160-72-72-m-80-MuleTibetan-1,
1117ethiopic:-Admas-Ethiomx16f-Medium-R-Normal--16-150-100-100-M-160-Ethiopic-Unicode,
1118tibetan:-TibMdXA-fixed-medium-r-normal--16-160-72-72-m-160-MuleTibetan-0")
1119@end example
1120
1121Many of the international bdf fonts from gnu.org are type 0, and therefore
1122need to be added to font-encoding-alist:
1123
1124@example
1125;; Need to add some fonts to font-encoding-alist since the bdf fonts
1126;; are type 0 not the default type 1.
1127(setq font-encoding-alist
1128 (append '(("MuleTibetan-0" (tibetan . 0))
1129 ("GB2312" (chinese-gb2312 . 0))
1130 ("JISX0208" (japanese-jisx0208 . 0))
1131 ("JISX0212" (japanese-jisx0212 . 0))
1132 ("VISCII" (vietnamese-viscii-lower . 0))
1133 ("KSC5601" (korean-ksc5601 . 0))
1134 ("MuleArabic-0" (arabic-digit . 0))
1135 ("MuleArabic-1" (arabic-1-column . 0))
1136 ("MuleArabic-2" (arabic-2-column . 0))) font-encoding-alist))
1137@end example
1138
1139You can now use the Emacs font menu (@pxref{Fonts and text
1140translation,,How can I have Emacs use a font menu like on X?}) to
1141select the @emph{bdf: 16-dot medium} fontset, or you can select it by
1142setting the default font:
1143
1144@example
1145 (set-frame-font "fontset-bdf")
1146@end example
1147
1148Try loading the file @file{etc/HELLO}, and you should be able to see the
1149various international fonts displayed (except for Hindi, which is not
1150included in the 16-dot font distribution).
1151
1152@node Font menu
1153@section How can I have Emacs use a font menu like on X?
1154@cindex fonts, displaying a menu
1155@cindex fontsets, displaying a menu
1156@cindex font dialog, using a menu instead
1157@vindex w32-use-w32-font-dialog
1158
1159Place the following in your init file:
1160
1161@example
1162(setq w32-use-w32-font-dialog nil)
1163@end example
1164
1165@menu
1166* Add fonts to menu::
1167@end menu
1168
1169@node Add fonts to menu
1170@subsection How can I add my font to the font menu?
1171@cindex font menu, adding fonts
1172@vindex w32-fixed-font-alist
1173
1174If you have set w32-use-w32-font-dialog to nil, you can add fonts to
1175the font menu by changing `w32-fixed-font-alist'. For example:
1176
1177@example
1178(setq w32-fixed-font-alist
1179 (append w32-fixed-font-alist
1180 '(("Monotype.com"
1181 ("8" "-*-Monotype.com-normal-r-*-*-11-*-*-*-c-iso8859-1")
1182 ("9" "-*-Monotype.com-normal-r-*-*-12-*-*-*-c-iso8859-1")
1183 ("10" "-*-Monotype.com-normal-r-*-*-13-*-*-*-c-iso8859-1")
1184 ("11" "-*-Monotype.com-normal-r-*-*-15-*-*-*-c-iso8859-1")))))
1185@end example
1186
1187@node Line ends
1188@section How can I control CR/LF translation?
1189@cindex DOS line ends
1190@cindex Unix line ends
1191@cindex Mac line ends
1192
1193There are a number of methods by which you can control automatic CR/LF
1194translation in Emacs, a situation that reflects the fact that the
1195default support was not very robust in the past. For a discussion of
1196this issue, take a look at
1197@uref{http://www.gnu.org/software/emacs/windows/ntemacs/todo/translate,
1198this collection of email messages} on the topic.
1199
1200@menu
1201* Automatic line ends::
1202* Line ends by filename::
1203* Line ends by file system::
1204@end menu
1205
1206@node Automatic line ends
1207@subsection Automatic CR/LF translation
1208@cindex line ends, automatic detection
1209
1210For existing files, Emacs scans the file to determine the line ending
1211convention as part of the same scan it does to determine the file
1212encoding. Embedded Ctrl-M (ASCII 13) characters and inconsistent line
1213ends can confuse the automatic scanning, and Emacs will present the
1214file in Unix (LF) mode with the Ctrl-M characters displayed as @samp{^M}.
1215It does this to be safe, as no data loss will occur if the file is really
1216binary and the Ctrl-M characters are significant.
1217
1218@node Line ends by filename
1219@subsection CR/LF translation by file extension
1220@cindex line ends, determining by filename
1221@cindex binary files, determining by file name
1222@vindex file-name-buffer-file-type-alist
1223
1224The variable @code{file-name-buffer-file-type-alist} holds a list of
1225filename patterns and their associated type; binary or text. Files marked
1226as binary will not have line-end detection performed on them, and instead
1227will always be displayed as is. With auto-detection in recent versions of
1228Emacs, this is seldom useful for existing files, but can still be used
1229to influence the choice of line ends for newly created files.
1230
1231@node Line ends by file system
1232@subsection CR/LF translation by file system
1233@cindex line ends, determining by filesystem
1234@cindex binary files, determining by filesystem
1235@vindex untranslated-filesystem-list
1236@findex add-untranslated-filesystem
1237@findex remove-untranslated-filesystem
1238
1239The variable @code{untranslated-filesystem-list} defines whole
1240directory trees that should not have CR/LF autodetection performed on
1241them. The list can be manipulated with the functions
1242@code{add-untranslated-filesystem} and
1243@code{remove-untranslated-filesystem}. With auto-detection in
1244recent versions of Emacs, this is seldom useful for existing files,
1245but can still be used to influence the choice of line ends for newly
1246created files.
1247
1248@c ------------------------------------------------------------
1249@node Printing
1250@chapter Printing
1251@cindex printing
1252
1253A lot of effort has gone into making it easier to print from Emacs on
1254MS Windows, but this has still been insufficient to keep up with
1255changes in printing technology from text and postscript based printers
1256connected via ports that can be accessed directly, to graphical
1257printers that are only accessible via USB. For details, see
1258@uref{http://www.emacswiki.org/cgi-bin/wiki/PrintingFromEmacs, Emacs
1259Wiki}.
1260
1261@c ------------------------------------------------------------
1262@node Sub-processes
1263@chapter Subprocesses
1264@cindex subprocesses
1265
1266@menu
1267* Quoting issues::
1268* Subprocess hang::
1269* Subprocess buffering::
1270* Subprocesses and floppy drive::
1271* Killing subprocesses::
1272* Subprocess EOF::
1273* Using shell::
1274* Cygwin paths::
1275* Dired ls::
1276* Shell echo::
1277* Shell completion forward slash::
1278* Incorrect DOS version::
1279* Shell commands do nothing::
1280@end menu
1281
1282@node Quoting issues
1283@section Quoting issues
1284@cindex quoting arguments to subprocesses
1285@cindex sub-processes, quoting arguments to
1286@cindex cygwin, quoting arguments
1287
1288The quoting rules for native Windows shells and Cygwin shells have
1289some subtle differences. When Emacs spawns subprocesses, it tries to
1290determine whether the process is a Cygwin program and changes its
1291quoting mechanism appropriately. See this
1292@uref{http://www.gnu.org/software/emacs/windows/ntemacs/discuss/shell-quoting,
1293previous discussion} for details.
1294
1295@node Subprocess hang
1296@section Programs reading input hang
1297@cindex subprocesses, hanging when reading input
1298@cindex full-screen console programs, as subprocesses
1299@cindex ftp, client hanging
1300@findex ftp
1301
1302Programs that explicitly use a handle to the console (@file{CON} or
1303@file{CON:}) instead of stdin and stdout cannot be used as
1304subprocesses to Emacs, and they will also not work in shell-mode. The
1305default ftp client on Windows is an example of such a program - this
1306ftp program is mostly fine for use with @code{ange-ftp} or
1307@code{tramp}, but not for @kbd{M-x ftp} (@pxref{Network access,,How do
1308I use FTP within Emacs}). There is no convenient way for either Emacs
1309or any shell used in @code{shell-mode} to redirect the input and
1310output of such processes from the console to input and output pipes.
1311The only workaround is to use a different implementation of the
1312program that does not use the console directly. Microsoft's new
1313PowerShell appears to be another such program, so that cannot be used
1314as a replacement shell for Emacs.
1315
1316@node Subprocess buffering
1317@section Buffering in shells and subprocesses
1318@cindex subprocesses, buffering output
1319@cindex output not displaying, subprocesses
1320@cindex SQL subprocess hanging
1321@cindex cvs hanging when login needed
1322@cindex ssh, password prompt not appearing when using with cvs
1323@findex sql-mode
1324@findex shell-mode
1325@cindex setbuf, using in subprocesses to prevent buffering
1326@cindex setvbuf, using in subprocesses to prevent buffering
1327
1328You may notice that some programs, when run in a shell in
1329@code{shell-mode},
1330have their output buffered (e.g., people have found this happening to
1331them with @code{sql-mode}). When the program has a lot of output, it
1332overflows the buffering and gets printed to the shell buffer; however,
1333if the program only outputs a small amount of text, it will remain
1334buffered and won't appear in the shell buffer. The same can happen
1335in other subprocesses that themselves run other programs as
1336subprocesses, for example when using @command{cvs} from Emacs, which
1337is itself configured to use @command{ssh}, password prompts fail to
1338appear when expected, and @command{cvs} appears to hang.
1339
1340Although it may at first seem like the shell is buffering the output
1341from the program, it is actually the program that is buffering
1342output. The C runtime typically decides how to buffer output based
1343upon whether stdout is bound to a handle to a console window or
1344not. If bound to a console window, output is buffered line by line; if
1345bound to a block device, such as a file, output is buffered block by
1346block.
1347
1348In a shell buffer, stdout is a pipe handle and so is buffered in
1349blocks. If you would like the buffering behavior of your program to
1350behave differently, the program itself is going to have to be changed;
1351you can use @code{setbuf} and @code{setvbuf} to manipulate
1352the buffering semantics.
1353
1354Some programs handle this by having an explicit flag to control their
1355buffering behaviour, typically @option{-i} for interactive. Other
1356programs manage to detect that they are running under Emacs, by
1357using @samp{getenv("emacs")} internally.
1358
1359@menu
1360* Perl script buffering::
1361@end menu
1362
1363@node Perl script buffering
1364@subsection Perl script buffering
1365@cindex perl, avoiding buffering when used as a subprocess of Emacs
1366
1367A handy solution for Perl scripts to the above problem is to use:
1368
1369@example
1370# Turn all buffering off.
1371select((select(STDOUT), $| = 1)[0]);
1372select((select(STDERR), $| = 1)[0]);
1373select((select(STDIN), $| = 1)[0]);
1374@end example
1375
1376@node Subprocesses and floppy drive
1377@section 16-bit subprocesses accessing the floppy drive
1378@cindex floppy drive, access when subprocesses started
1379@cindex subprocess starting causes floppy drive access
1380
1381If you are finding the 16 bit DOS subprocesses cause your A: drive to
1382be accessed, hanging Emacs until the read times out if there is no
1383floppy in the drive, check to see if your virus software is causing
1384the problem.
1385
1386@node Killing subprocesses
1387@section Killing subprocesses on Windows 95/98/Me
1388@cindex subprocess, killing on Windows 95/98/ME
1389@cindex killing subprocesses, Windows 95/98/ME
1390@cindex shutdown, complaints about cmdproxy.exe running
1391
1392Emacs cannot guarantee that a subprocess gets killed on Windows 95 and
1393its descendants, and it is a difficult limitation to work around. To
1394avoid problems on these systems, you should let subprocesses run to
1395completion including explicitly exiting shells before killing the
1396associated buffer.
1397
1398If you find that while shutting down, Windows complains that there is
1399a running @command{cmdproxy.exe} even though you carefully exited all
1400shells and none were showing in Task Manager before the shutdown, this
1401could be due to buggy interaction with your virus scanner.
1402
1403@node Subprocess EOF
1404@section Sending EOF to subprocesses
1405@cindex EOF, sending to subprocesses
1406@cindex shell terminates when EOF sent to subprocess
1407@findex process-send-eof
1408
1409When an EOF is sent to a subprocess running in an interactive shell
1410with @code{process-send-eof}, the shell terminates unexpectedly as
1411if its input was closed. This affects the use of @kbd{C-c C-d} in
1412shell buffers. See
1413@uref{http://www.gnu.org/software/emacs/windows/ntemacs/todo/shell-ctrl-d,
1414this discussion} for more details.
1415
1416@node Using shell
1417@section How do I use a shell in Emacs?
1418@cindex interactive shell, using
1419@cindex shell within emacs, using
1420@findex shell
1421@findex shell-command
1422@vindex shell-file-name
1423@vindex explicit-shell-file-name
1424
1425You can start an interactive shell in Emacs by typing @kbd{M-x shell}.
1426Emacs uses the @env{SHELL} environment variable to determine which
1427program to use as the shell. To instruct Emacs to use a non-default
1428shell, you can either set this environment variable, or customize
1429@code{explicit-shell-file-name}. You can also customize
1430@code{shell-file-name} to change the shell that will be used by
1431subprocesses that are started with @code{shell-command} and
1432related non-interactive shell commands.
1433
1434@menu
1435* Bash::
1436@end menu
1437
1438@node Bash
1439@subsection bash
1440@cindex cygwin bash as shell within Emacs
1441@cindex shell, using cygwin bash within Emacs
1442@cindex bash, using cygwin shell within Emacs
1443@vindex comint-scroll-show-maximum-output
1444@vindex comint-completion-addsuffix
1445@vindex comint-eol-on-send
1446@vindex w32-quote-process-args
1447@vindex shell-mode-hook
1448
1449Cygwin bash is a popular shell for use with Emacs. To use bash as the
1450default shell in Emacs, you can place the following in your init file:
1451
1452@example
1453(defun my-shell-setup ()
1454 "For Cygwin bash under Emacs 20"
1455 (setq comint-scroll-show-maximum-output 'this)
1456 (make-variable-buffer-local 'comint-completion-addsuffix))
1457 (setq comint-completion-addsuffix t)
1458 ;; (setq comint-process-echoes t) ;; reported that this is no longer needed
1459 (setq comint-eol-on-send t)
1460 (setq w32-quote-process-args ?\")
1461
1462(setq shell-mode-hook 'my-shell-setup)
1463@end example
1464
1465If you find that you are having trouble with Emacs tracking drive
1466changes with bash, see Mike Fabian's
1467@uref{http://www.gnu.org/software/emacs/windows/ntemacs/discuss/drive-tracking,
1468note}.
1469
1470WARNING: Some versions of bash set and use the environment variable
1471PID. For some as yet unknown reason, if @env{PID} is set and Emacs
1472passes it on to bash subshells, bash dies (Emacs can inherit the
1473@env{PID} variable if it's started from a bash shell). If you clear
1474the @env{PID} variable in your init file, you should be able to
1475continue to use bash as your subshell:
1476@example
1477 (setenv "PID" nil)
1478@end example
1479
1480@node Cygwin paths
1481@section How do I use Cygwin style paths in Emacs?
1482@cindex cygwin paths, using within Emacs
1483@cindex mount points, cygwin
1484@cindex cygwin mount points, using within Emacs
1485
1486The package
1487@uref{http://www.emacswiki.org/cgi-bin/wiki/cygwin-mount.el,
1488cygwin-mount.el} teaches Emacs about Cygwin mount points.
1489
1490@node Dired ls
1491@section How do I make dired use my ls program?
1492@cindex dired, using an external ls program
1493@cindex dired, interpreting symlinks the same way as cygwin
1494@cindex symlinks in dired, interpreting the same way as cygwin
1495@cindex cygwin symlinks in dired
1496@vindex ls-lisp-use-insert-directory-program
1497@vindex insert-directory-program
1498
1499Dired uses an internal lisp implementation of @command{ls} by default
1500on Windows. For consistent display of symbolic links and other
1501information with other programs (eg Cygwin) and performance reasons,
1502you may want to use a Windows port of @command{ls} instead.
1503
1504@example
1505(setq ls-lisp-use-insert-directory-program t) ;; use external ls
1506(setq insert-directory-program "c:/cygwin/bin/ls") ;; ls program name
1507@end example
1508
1509@node Shell echo
1510@section How do I prevent shell commands from being echoed?
1511@cindex echo, suppressing for shell input
1512@cindex shell commands, suppressing echo
1513@vindex comint-process-echoes
1514@vindex comint-mode-hook
1515@vindex explicit-cmd.exe-args
1516@vindex explicit-cmdproxy.exe-args
1517@vindex explicit-bash.exe-args
1518@vindex explicit-bash-args
1519@cindex shell specific arguments
1520
1521Some shells echo the commands that you send to them, and the echoed
1522commands appear in the output buffer. In particular, the default
1523shells, @command{command.com} and @command{cmd.exe}, have this behavior.
1524
1525To prevent echoed commands from being printed, you can place the
1526following in your init file:
1527
1528@example
1529 (defun my-comint-init ()
1530 (setq comint-process-echoes t))
1531 (add-hook 'comint-mode-hook 'my-comint-init)
1532@end example
1533
1534If @code{shell-mode} still is not stripping echoed commands, then
1535you'll have to explicitly tell the shell to not echo commands. You can
1536do this by setting the @code{explicit-@var{SHELL}-args} variable
1537appropriately; where @var{SHELL} is the value of your @env{SHELL}
1538environment variable (do a @kbd{M-: (getenv "SHELL")} to see what it
1539is currently set to). Assuming that you are on NT and that your
1540@env{SHELL} environment variable is set to @command{cmd.exe},
1541then placing the following in your init file will tell
1542@command{cmd.exe} to not echo commands:
1543
1544@example
1545 (setq explicit-cmd.exe-args '("/q"))
1546@end example
1547
1548The comint package will use the value of this variable as an argument
1549to @command{cmd.exe} every time it starts up a new shell; the
1550@option{/q} is the argument to @command{cmd.exe} that stops the
1551echoing (invoking @samp{cmd /?} in a shell will show you all of the
1552command line arguments to @command{cmd.exe}).
1553
1554Note that this variable is case sensitive; if the value of your
1555@env{SHELL} environment variable is @command{CMD.EXE} instead, then
1556this variable needs to be named @code{explicit-CMD.EXE-args} instead.
1557
1558@node Shell completion forward slash
1559@section How can I make shell completion use forward slashes?
1560@cindex completion, using forward slashes in shell buffers
1561@cindex forward slashes for completion in shell buffers
1562@vindex comint-completion-addsuffix
1563
1564The character appended to directory names when completing in a shell
1565buffer is controlled by the variable @code{comint-completion-addsuffix}.
1566See its documentation (with @kbd{C-h v}) for details.
1567
1568@node Incorrect DOS version
1569@section Why do I get incorrect DOS version messages?
1570@cindex nmake, Incorrect DOS version messages
1571@cindex shell, Incorrect DOS version messages
1572@cindex COMSPEC, effect on subprocesses of subprocesses
1573
1574This might happen if, for example, you invoke @command{nmake} in a
1575shell and it tries to create sub-shells. The problem happens because
1576when the shell is initially created, the first argument to the shell
1577is not the directory in which the shell program resides. When this
1578happens, @command{command.com} fabricates a value for its
1579@env{COMSPEC} environment variable that is incorrect. Then, when
1580other programs go to use @env{COMSPEC} to find the shell, they are
1581given the wrong value.
1582
1583The fix for this is to either prevent any arguments from being sent to
1584the shell when it starts up (in which case @command{command.com} will
1585use a default, and correct, value for @env{COMSPEC}), or to have the
1586first argument be the directory in which the shell executable resides.
1587
1588@node Shell commands do nothing
1589@section Why is nothing happening when I enter shell commands?
1590@cindex shell commands not working
1591@cindex anti-virus software, bad interaction with
1592@cindex virus software, bad interaction with
1593@cindex firewall, bad interaction with
1594@cindex scan all files, anti-virus option causing problems
1595@cindex auto protect, anti-virus option causing problems
1596@cindex shell, interacting badly with anti-virus
1597
1598Some anti-virus software has been reported to cause problems with
1599shells in the past. Try turning off options such as ``Scan all
1600files''. @xref{Installing Emacs,,What known problems are there with anti-virus software?}.
1601
1602@c ------------------------------------------------------------
1603@node Network access
1604@chapter Network access
1605
1606@menu
1607* Mail::
1608* Attachments with Gnus::
1609* Using FTP::
1610* Tramp ssh::
1611* telnet::
1612@end menu
1613
1614@node Mail
1615@section How do I use mail in Emacs?
1616
1617Emacs comes with several options for reading and writing mail. These
1618are documented in the manual, and the choice of which method to use
1619depends on personal taste. There are some issues specific to Windows
1620however, related to the fact that Windows machines do not have the
1621mail infrastructure that is commonly installed on other platforms, so
1622mail will not work without some configuration.
1623
1624@menu
1625* Outgoing mail::
1626* Incoming mail with Rmail::
1627* Incoming mail with Gnus::
1628* Incoming mail other::
1629@end menu
1630
1631@node Outgoing mail
1632@subsection Outgoing mail
1633@cindex mail, outgoing
1634@cindex smtp server
1635@vindex user-full-name
1636@vindex user-mail-address
1637@vindex smtpmail-default-smtp-server
1638@vindex smtpmail-smtp-server
1639@vindex send-mail-command
1640@vindex message-send-mail-function
1641@findex smtpmail-send-it
1642@vindex smtpmail-debug-info
1643
1644For outgoing mail, you will need to use @file{smtpmail.el} which
1645allows Emacs to talk directly to SMTP mail servers. This is included
1646with Emacs, and can be set up as follows:
1647
1648@example
1649(setq user-full-name "@var{Your full name}")
1650(setq user-mail-address "@var{Your@@email.address}")
1651(setq smtpmail-default-smtp-server "@var{domain.name.of.your.smtp.server}")
1652
1653(setq send-mail-command 'smtpmail-send-it) ; For mail-mode (Rmail)
1654(setq message-send-mail-function 'smtpmail-send-it) ; For message-mode (Gnus)
1655@end example
1656
1657Note that if you want to change the name of the SMTP server after
1658smtpmail is loaded, then you'll need to change
1659@code{smtpmail-smtp-server}.
1660
1661If you are experiencing problems with sending large messages, check
1662the value of the variable @code{smtpmail-debug-info}. If it is non-nil, you
1663should set it to @code{nil}:
1664
1665@node Incoming mail with Rmail
1666@subsection Incoming mail with Rmail and POP3
1667@cindex mail, incoming with rmail
1668@cindex pop3, using rmail
1669@cindex rmail, mail client
1670@cindex movemail, using pop3
1671@cindex MAILHOST
1672@vindex rmail-primary-inbox-list
1673@vindex rmail-pop-password-required
1674
1675For incoming mail using the Rmail package and a POP3 server, you will
1676need the following configuration:
1677
1678@example
1679(setenv "MAILHOST" "@var{domain.name.of.your.pop3.server}")
1680(setq rmail-primary-inbox-list '("po:@var{your logon id}"))
1681(setq rmail-pop-password-required t)
1682@end example
1683
1684@node Incoming mail with Gnus
1685@subsection Incoming mail with Gnus
1686@cindex mail, incoming with Gnus
1687@cindex pop3, using Gnus
1688@cindex imap, using Gnus
1689@cindex gnus, mail and news client
1690
1691Although Gnus started life as a Usenet news reader, it also makes a
1692good mail reader, particularly if you subscribe to a lot of mailing
1693lists, or you want to use IMAP rather than POP3, which is not
1694supported by Rmail. @xref{Top,The Gnus manual,,gnus, The Gnus manual}.
1695
1696@node Incoming mail other
1697@subsection Other incoming mail options
1698@cindex mail, other options
1699@cindex wanderlust, mail and news client
1700@cindex vm, mail client
1701@cindex mh-e, mail client
1702
1703Other options for reading mail in Emacs include VM, MH-E and Wanderlust.
1704MH-E is included with Emacs. The others require lisp or executable code
1705that does not come with Emacs, so you should seek help where you
1706obtained the packages from if you want to use them.
1707
1708@node Attachments with Gnus
1709@section How do I open attachments in Gnus?
1710@cindex gnus, attachments
1711@cindex attachments, in gnus
1712@cindex mail, attachments in gnus
1713@cindex .mailcap
1714@cindex MIME, configuration for Gnus
1715
1716In your @env{HOME} directory create a file called @file{.mailcap},
1717with contents like the following:
1718@example
1719application/zip "C:/Program Files/7-Zip/7zFM.exe"
1720video/* "C:/Program Files/VideoLAN/VLC/vlc.exe"
1721@end example
1722
1723@strong{Warning:} Associating MIME types with @command{start} or other
1724generic Windows commands to open arbitrary files might seem like a
1725good idea, but it leaves your system as open to attack as Outlook
1726Express was at its worst. Especially dangerous is associating
1727application/* or */* in this way.
1728
1729@node Using FTP
1730@section How do I use FTP within Emacs?
1731@cindex ftp, using within Emacs
1732@cindex ange-ftp
1733@cindex tramp, ftp
1734@cindex remote hosts via ftp
1735@vindex ange-ftp-ftp-program-name
1736
1737Windows built in FTP client can be used with ange-ftp. Ange-ftp is
1738the Emacs package that provides FTP connectivity to tramp, a
1739multi-protocol remote file access package for Emacs that is enabled by
1740default.
1741
1742The Windows FTP client does have problems with some firewalls, due to
1743lack of passive mode support, so you may want to try an alternative
1744ftp client instead. Make sure that the client you are trying is in
1745your @env{PATH} before the default Windows client, or rename the
1746default Windows client to avoid it getting in the way. Alternatively
1747you can customize @code{ange-ftp-ftp-program-name} to the full path to
1748the version you are trying. @xref{Other useful ports}.
1749
1750@node Tramp ssh
1751@section How do I use Tramp to work in Emacs via SSH?
1752@cindex tramp, ssh
1753@cindex ssh, accessing remote hosts within Emacs
1754@cindex remote hosts via ssh
1755@cindex openssh
1756@cindex PuTTY
1757@cindex plink
1758@vindex tramp-default-method
1759@vindex tramp-default-method-alist
1760
1761Tramp can use a number of protocols to connect to remote machines to
1762read files and even run commands on those files remotely. A popular
1763one is ssh. As well as Cygwin versions of openssh, you can use
1764PuTTY's command line plink program as the ssh client. The relevant
1765methods to use in @code{tramp-default-method} or
1766@code{tramp-default-method-alist} for these options are:
1767@itemize @w{}
1768@item
1769openssh
1770@itemize
1771@item @code{scp} Uses scp for copying, ssh for shell operations.
1772@item @code{scp1} scp with forced SSH protocol version 1
1773@item @code{scp2} scp with forced SSH protocol version 2
1774@item @code{ssh} Uses ssh with encoding on stdin/stdout for file transfer.
1775@item @code{ssh1} ssh with forced SSH protocol version 1
1776@item @code{ssh2} ssh with forced SSH protocol version 2
1777@end itemize
1778
1779@item
1780PuTTY
1781@itemize
1782@item @code{pscp} Uses pscp for copying, plink for shell operations.
1783@item @code{pscp1} pscp, with forced SSH protocol version 1
1784@item @code{pscp2} pscp, with forced SSH protocol version 2
1785@item @code{plink} Uses plink with encoding on stdin/stdout for file transfer.
1786@item @code{plink1} plink with forced SSH protocol version 1
1787@item @code{plink2} plink with forced SSH protocol version 2
1788@end itemize
1789@end itemize
1790
1791@node telnet
1792@section How do I use telnet with Emacs?
1793@cindex telnet, in Emacs
1794@findex telnet
1795@cindex telnet client, that works with Emacs
1796
1797To use telnet-mode on Windows, you need a telnet client that uses
1798stdin and stdout for input and output. The default Windows client is
1799a Windows application, and will not work as a subprocess. Several
1800options exist, but information that was formerly in this FAQ is out of
1801date now, so no concrete pointers are available.
1802
1803@c ------------------------------------------------------------
1804@node Text and Utility modes
1805@chapter Text and Utility modes
1806
1807@menu
1808* TeX::
1809* Spell check::
1810* Encryption::
1811* Mouse wheel::
1812* Grep::
1813@end menu
1814
1815@node TeX
1816@section How do I use TeX with Emacs?
1817@cindex tex
1818@cindex typesetting
1819
1820You will need an implementation of TeX for Windows.
1821A number of implementations are listed on the
1822@uref{http://www.tug.org/interest.html#free, TeX Users Group} website.
1823
1824@menu
1825* AUCTeX::
1826@end menu
1827
1828@node AUCTeX
1829@subsection AUCTeX
1830@cindex auctex, precompiled for Windows
1831@cindex latex
1832@cindex preview-latex
1833
1834AUCTeX is an Emacs package for writing LaTeX files, which also
1835includes preview-latex, an Emacs mode for previewing the formatted
1836contents of LaTeX documents. Pre-compiled versions for Windows are
1837available from
1838@uref{http://www.gnu.org/software/auctex/download-for-windows.html, the
1839AUCTeX site}.
1840
1841@node Spell check
1842@section How do I perform spell checks?
1843@cindex spell checking
1844@cindex ispell
1845@cindex aspell
1846@cindex flyspell
1847@vindex ispell-program-name
1848@findex flyspell-mode
1849
1850Emacs has support for spell checking on demand (@code{ispell}) and as
1851your type (@code{flyspell}). Both packages depend on a copy of
1852@command{ispell} 3.2 or a compatible spell-checking program.
1853GNU Aspell is a popular choice these days, Windows installers are
1854available from the @uref{http://aspell.net/win32/, official site}.
1855
1856Once installed, you will need to configure @code{ispell-program-name}
1857to tell ispell and flyspell to use @command{aspell} as a replacement for
1858ispell. You can include the full path to the @file{aspell} binary, which
1859means you do not need to add its installation directory to the @env{PATH}.
1860
1861@node Encryption
1862@section Emacs and encryption
1863@cindex encryption
1864@cindex gpg, Windows binaries
1865@cindex pgp encryption, with GNU Privacy Guard
1866@cindex signatures on Emacs distribution, checking
1867@cindex Emacs distribution, checking digital signatures
1868
1869GNU Privacy Guard is a Free replacement for PGP, with Windows binaries
1870available. See @uref{http://www.gnupg.org/}.
1871
1872@node Mouse wheel
1873@section Why doesn't my wheel mouse work in Emacs?
1874@cindex mouse wheel
1875@cindex wheel mouse
1876@cindex middle button, on wheel mouse
1877@cindex scrolling, with mouse wheel
1878
1879Some wheel mice ship with default settings that do not send the
1880standard wheel events to programs, but instead try to simulate scroll
1881bar events. Usually this is configurable from the hardware specific
1882pages on the mouse control panel. The middle button is often mapped
1883in the same settings to have some functionality other than sending
1884middle mouse button events. In some cases, uninstalling the
1885manufacturer's drivers and telling Windows to use the generic USB or
1886PS/2 drivers is the only way to make the mouse work properly.
1887
1888@node Grep
1889@section How do I use grep with Emacs?
1890@cindex searching through files with grep
1891@cindex grep
1892@cindex findstr
1893@findex grep
1894
1895The best way to use @kbd{M-x grep} with Emacs is to download a port of
1896GNU @command{grep}. @xref{Other useful ports}.
1897
1898If you want a quick solution without installing extra tools, a poor
1899substitute that works for simple text searches is to specify the built
1900in Windows command @command{findstr} as the command to run at the
1901@kbd{M-x grep} prompt. Normally you will want to use the @option{/n}
1902argument to @command{findstr}.
1903
1904@menu
1905* Recursive grep::
1906@end menu
1907
1908@node Recursive grep
1909@subsection How do I do a recursive grep?
1910@cindex recursive searching with grep
1911@cindex grep, recursive through subdirectories
1912@cindex findstr, recursive
1913@cindex find, using with grep
1914@cindex find, the POSIX command
1915@findex rgrep
1916@findex grep-find
1917@findex find-grep-dired
1918@vindex find-program
1919@vindex grep-find-command
1920
1921The Emacs commands @code{rgrep}, @code{grep-find}
1922and @code{find-grep-dired} are all different interfaces for
1923grepping recursively into subdirectories. By default, they use the
1924command @command{find} to determine which files to work on, and either
1925run @command{grep} directly from find, or use @command{xargs} to batch
1926up files and reduce the number of invocations of @command{grep}.
1927
1928Windows also comes with a @command{find} command, but it is not in any
1929way compatible with the POSIX @command{find} that Emacs tries to use.
1930Emacs expects a @command{find} compatible with GNU findutils.
1931@xref{Other useful ports}. After you have installed it, you will need
1932to make sure that Emacs finds this version, not the standard Windows
1933@command{find} command. You can do this by either renaming the
1934Windows command, changing your @env{PATH} to ensure that the directory
1935containing the findutils @file{bin} directory comes before the Windows
1936system directory, or set the variable @code{find-program} to the full
1937path to the findutils @command{find} command.
1938
1939An alternative if you have a recent version of grep is to customize
1940@code{grep-find-command} to use @samp{grep -r} instead of both find
1941and grep. Another alternative if you don't need the full capabilities
1942of grep is to use @samp{findstr /n /r}.
1943
1944@c ------------------------------------------------------------
1945@node Developing with Emacs
1946@chapter Developing with Emacs
1947
1948@menu
1949* MSVC::
1950* Borland C++ Builder::
1951* Version control::
1952* Perldb::
1953@end menu
1954
1955@node MSVC
1956@section How do I use Emacs with Microsoft Visual C++
1957
1958There are two ways you can use Emacs in conjunction with MSVC. You
1959can use Emacs as the editor, and do everything else in the DevStudio
1960IDE. Or you can use Emacs as an IDE, calling the MSVC command line
1961tools to build your project.
1962
1963@menu
1964* DevStudio::
1965* MSVC command line::
1966@end menu
1967
1968@node DevStudio
1969@subsection Emacs as the text editor for DevStudio
1970@cindex DevStudio, using Emacs as editor in
1971@cindex MSVC++, using Emacs as editor with
1972@cindex Visual Studio, using Emacs as editor in
1973@cindex VisEmacs, add in for MS Developer Studio
1974
1975Christopher Payne wrote a Visual Studio add-in that makes Emacs the
1976default text editor, this has now been taken over by Jeff Paquette.
1977See the following two URLS for details:
1978@itemize
1979@item @uref{http://sourceforge.net/projects/visemacs/} for the latest version.
1980@item @uref{http://www.smathers.net/VisEmacs.htm} for notes on usage.
1981@end itemize
1982
1983@node MSVC command line
1984@subsection Using MSVC command line tools from Emacs
1985@cindex MSVC++, compiling within Emacs
1986@findex compile
1987
1988This is an app note on how to use Microsoft Visual C++ with Emacs. The
1989experiments done below were done with Emacs 19.34.1 on Windows 95,
1990using Visual C++ 4.0 Standard Edition. Your mileage may vary.
1991
1992This writeup assumes minimal knowledge of Emacs hacking on the part of
1993the reader.
1994
1995@menu
1996* VC++ environment::
1997* Default compile command::
1998* Reverting buffers::
1999* Edit MSVC::
2000@end menu
2001
2002@node VC++ environment
2003@subsubsection VC++ Environment Variables
2004@cindex vcvars32.bat
2005@cindex MSVC++, environment variables
2006
2007There is a batch file in your VC++ installation's bin directory called
2008@file{vcvars32.bat}, which sets up the environment variables needed to
2009run the VC++ command line tools. Arrange for those same environment
2010variables to be set in your Emacs session. You can do this on Windows
20119x by calling the @file{vcvars32.bat} script from @file{autoexec.bat}.
2012On other versions of Windows you can set the environment variables
2013globally using the System control panel.
2014
2015For all versions of Windows you can alternatively set the variables
2016just inside Emacs by using @code{setenv} calls in your init file.
2017@xref{Installing Emacs,,Where do I put my init file?}.
2018
2019You should now be able to compile from Emacs. Load a source file from
2020a VC++ project. Type @kbd{M-x compile}. Replace the proposed command line
2021with:
2022@example
2023nmake -f @var{ProjectName}.mak
2024@end example
2025
2026You will find that this defaults to a debug build. You can change it
2027to a release build with:
2028@example
2029nmake -f @var{ProjectName}.mak CFG="@var{ProjectName} - Win32 Release"
2030@end example
2031
2032@node Default compile command
2033@subsubsection Setting the default compile command
2034@cindex compile, setting default command
2035@cindex nmake, as default compile command
2036@vindex compile-command
2037
2038Now set the default value for the compile command line. Add the
2039following to your init file:
2040
2041@example
2042;; Set up for Visual C++ compiling
2043(setq compile-command "nmake -f ")
2044@end example
2045
2046If you work on the same project long term, you can add the project
2047makefile to the string.
2048
2049David Biesack suggests that perhaps it's
2050easy to write a @file{Makefile} in the project directory which does
2051
2052@example
2053PROJECT=MyProject
2054all: debug
2055debug: FORCE
2056 nmake /f $(PROJECT).mak CFG="$(PROJECT) - Win32 Debug"
2057release: FORCE
2058 nmake /f $(PROJECT).mak CFG="$(PROJECT) - Win32 Release"
2059FORCE:
2060@end example
2061
2062and then you can simply change compile-command to @command{nmake}.
2063
2064Caleb T. Deupree reports that on VC++
20655.0 and up, "You can also set an option in Options/Build to export a
2066makefile every time the project is saved, which you can then use to
2067compile with @samp{nmake -f project.mak}." VC++ 4.0 builds the make file
2068every time, and there is no option.
2069
2070@node Reverting buffers
2071@subsubsection Reverting Buffers
2072@cindex DevStudio, keeping source in sync
2073@cindex Visual Studio, keeping source in sync
2074@cindex MSVC++, keeping source in sync
2075@findex auto-revert-mode
2076@findex global-auto-revert-mode
2077
2078It is recommended that you use @code{auto-revert-mode} in buffers
2079that you have open in both Emacs and MSVC++ at the same time. Then if
2080you mistakenly edit the file in MSVC++, Emacs will pick up your
2081changes immediately, rather than after you have written lots more code
2082and attempt to save.
2083
2084@node Edit MSVC
2085@subsubsection Edit with Emacs function for MSVC
2086@cindex DevStudio, load in Emacs command
2087@cindex Visual Studio, load in Emacs command
2088@cindex MSVC++, load in Emacs command
2089@cindex emacsclient, calling from Visual Studio
2090
2091You can also set up VC++ to import a file into Emacs for you, all
2092ready for editing. In VC++, go to the @code{Tools} pull-down menu, and
2093click on @code{Customize...}. In the @code{Tools} tab, click on
2094@code{Add}. Use @code{Browse} to locate the
2095@file{emacsclientw.exe} file in your Emacs bin directory, and
2096select it. For arguments, use @option{+$(CurLine)}
2097@option{"$(FilePath)"} and for the directory use the @code{$(WkspDir)}
2098(the quotes around FilePath handle paths with spaces in them). Set the
2099Menu Text to say "Em&acs". The @option{+$(CurLine)} will set point in
2100Emacs to the same line as the cursor position in VC++. The ampersand
2101in the word @code{Em&acs} allows you to select emacs from the keyboard. (E
2102is already used for the OLE control test container.)
2103
2104You should now be able to go to any source file in your project. Then,
2105use the pull-down menu @code{Tools->Emacs}. The active file in your
2106VC++ IDE should now be front and center in Emacs, all ready to edit as
2107you wish. If you use keystrokes to work the menus, try @kbd{Alt-T A} to
2108move the file into Emacs. Binding this tool to a keystroke will be
2109left as an exercise for the student.
2110
2111If you have the option of saving files before running tools, make sure
2112this option is set. (I don't see it on VC++ 4.0.)
2113
2114@node Borland C++ Builder
2115@section Emacs and Borland C++ Builder
2116@cindex Borland C++, integration with Emacs
2117
2118Jonathan Arnold has written an
2119@uref{http://www.buddydog.org/C++Builder/c++builder.html, EmacsEdit
2120``expert''} for interfacing C++ Builder and Emacs.
2121
2122@node Version control
2123@section Is there a version of my VC software I can use with Emacs?
2124@cindex version control, integration with Emacs
2125@cindex revision control, integration with Emacs
2126@cindex source control, integration with Emacs
2127@cindex cvs, version control integration with Emacs
2128@cindex rcs, version control integration with Emacs
2129@cindex svn, version control integration with Emacs
2130@cindex git, version control integration with Emacs
2131@cindex bzr, version control integration with Emacs
2132@cindex arch, version control integration with Emacs
2133@cindex mercurial, version control integration with Emacs
2134@cindex hg, version control integration with Emacs
2135@cindex monotone, version control integration with Emacs
2136@cindex mcvs, version control integration with Emacs
2137
2138If you are using a graphical revision control tool already, check if
2139it comes with command-line tools. Many such GUI tools are just
2140wrappers for the same command line tools that Emacs requires for its
2141VC integration. Most of the supported VC systems have well supported
2142Free native Windows binaries. For those that don't Cygwin may be an option.
2143@xref{Other useful ports}.
2144
2145@node Perldb
2146@section How do I use the Perl debugger with Emacs?
2147@cindex perl, debugging within Emacs
2148@cindex perldb, using with Emacs
2149
2150From Jay Rogers:
2151
2152Some versions of the perl debugger itself need to be patched to work
2153with emacs. They are perl versions 5.001 and less, and version
21545.004_01. To fix, locate and change the code similar to the following
2155code in lib/perl5db.pl
2156@example
2157 if (-e "/dev/tty") @{
2158 $console = "/dev/tty";
2159 $rcfile=".perldb";
2160 @}
2161 elsif (-e "con") @{
2162 $console = ""; <---- change "con" to ""
2163 $rcfile="perldb.ini";
2164 @}
2165 else @{
2166 $console = "sys\$command";
2167 $rcfile="perldb.ini";
2168 @}
2169@end example
2170
2171Doug Campbell also has some
2172@uref{http://www.gnu.org/software/emacs/windows/ntemacs/discuss/perldb,
2173suggestions} for improving the interaction of perldb and Emacs.
2174
2175@c ------------------------------------------------------------
2176@node Other useful ports
2177@chapter Other useful ports
2178@cindex useful tools
2179@cindex subprocesses, useful tools
2180
2181@menu
2182* Cygwin::
2183* MinGW::
2184* UWIN::
2185* GnuWin32::
2186* GTK::
2187* Read man pages::
2188@end menu
2189
2190@node Cygwin
2191@section Cygwin
2192@cindex cygwin environment
2193@cindex cygwin, library conflicts
2194@cindex library conflicts with cygwin
2195@cindex interoperability with cygwin
2196@cindex subprocesses, cygwin tools
2197@vindex exec-path
2198
2199@uref{http://www.cygwin.com/}.
2200
2201Cygwin is a popular complete POSIX emulation environment for Windows.
2202Most of its tools can be used with Emacs, and it covers a wide range
2203of ported software. The main shell used by Cygwin is GNU
2204@command{bash}, but other shells are also available. Some Cygwin
2205tools may not interoperate well with Emacs or other native Windows
2206tools, due to the total immersion aspect of Cygwin, including its
2207non-native filesystem mapping.
2208
2209If you choose to use Cygwin, then its tools will probably be all that
2210you need, but you will need to get image libraries from elsewhere, as
2211the Cygwin ones are not compatible with non-Cygwin software. In fact,
2212if Cygwin is on your PATH when you run Emacs, and Emacs does not find
2213other versions of the image libraries first, then the Cygwin ones can
2214cause problems. Cygwin developers recommend that you do not put
2215Cygwin on your system @env{PATH} for this reason. Instead you can
2216make the Cygwin tools available within Emacs by setting @code{exec-path}
2217in your init file.
2218
2219@node MinGW
2220@section MinGW and MSYS
2221@cindex mingw tools
2222@cindex msys environment
2223@cindex subprocesses, mingw and msys
2224
2225@uref{http://www.mingw.org/}
2226
2227MinGW is a set of development tools that produce native Windows
2228executables, not dependent on Cygwin's POSIX emulation DLLs.
2229
2230MSYS is a POSIX shell and minimal set of tools that are commonly used in
2231configure scripts. Like Cygwin, this environment uses a non-native
2232filesystem mapping to appear more POSIX like to the scripts that it
2233runs. This is intended to complement the MinGW tools to make it easier
2234to port software to Windows.
2235
2236@node UWIN
2237@section UWIN
2238@cindex uwin environment
2239@cindex subprocesses, uwin
2240
2241@uref{http://www.research.att.com/sw/tools/uwin/}
2242
2243UWIN is another POSIX emulation environment, like Cygwin and MSYS,
2244that provides a large number of ported tools. The shell used by UWIN
2245is @command{ksh}, the Korn shell.
2246
2247@node GnuWin32
2248@section GnuWin32
2249@cindex gnuwin32 tools
2250@cindex subprocesses, gnuwin32
2251@cindex image libraries, gnuwin32
2252@cindex image libraries, development
2253
2254@uref{http://gnuwin32.sourceforge.net/}
2255
2256GnuWin32 provides precompiled native Windows ports of a wide selection
2257of Free software and libraries. Tools available here that are useful
2258for Emacs include:
2259
2260@itemize
2261@item Arc - used by @code{archive-mode} to edit .arc files.
2262@item Bzip2 - used by Emacs to automatically decompress .bz2 files.
2263@item CompFace - used by @code{gnus} to display XFace headers in messages.
2264@item CoreUtils - GNU file, shell and text utilities (also in MSYS)
2265@item DiffUtils - for @code{ediff} and producing patches
2266@item FindUtils - for @code{grep-find} and other file searches.
2267@item GifLib - library to support GIF images.
2268@item Grep - for searching through files with @code{grep}.
2269@item Gzip - used by Emacs to automatically decompress .gz files.
2270@item Jpeg - library to support JPEG images (also in GTK).
2271@item Lha - used by @code{archive-mode} to edit .lzh files.
2272@item LibPng - library to support PNG images (also in GTK).
2273@item LibTiff - library to support TIFF images (also in GTK).
2274@item Make - used by @code{compile} for building projects (also in MinGW)
2275@item OpenSSL - used by @code{gnus} to talk to servers over SSL.
2276@item Patch - used by @code{ediff-patch-file} and others to apply patches.
2277@item Tar - used by @code{tar-mode} to edit tar files.
2278@item TexInfo - used to build Emacs' manuals.
2279@item Unzip - used by @code{archive-mode} for extracting zip files.
2280@item Xpm - library to support XPM images (bundled with Emacs binaries)
2281@item Zip - used by @code{archive-mode} for editing zip files.
2282@item Zlib - required by LibPng (also in GTK).
2283@end itemize
2284
2285@node GTK
2286@section GTK
2287@cindex GTK image libraries
2288@cindex image libraries, GTK
2289@cindex addpm, using GTK image libraries
2290
2291GTK is a potential source for some of the image libraries that Emacs
2292requires. GTK is installed along with other ports of GUI software,
2293such as the GIMP image editor, and Pidgin instant messenger client.
2294If GTK is installed when you run @command{addpm}, Emacs will use the
2295image libraries that it provides, even if they are not on the
2296@env{PATH}. GTK ships with JPEG, PNG and TIFF support.
2297
2298@node Read man pages
2299@section How do I read man pages?
2300@cindex man pages
2301@findex woman
2302@findex man
2303
2304Man pages for Emacs and other ported programs that you have can be
2305read using Emacs' built-in manual reader @code{woman}. This
2306requires no external programs, but if you do have a port of
2307@command{man}, there is also an Emacs wrapper @code{man} that
2308which may be slightly faster.
2309
2310@c ------------------------------------------------------------
2311@node Further information
2312@chapter Further information
2313
2314@menu
2315* More information::
2316* Mailing lists::
2317@end menu
2318
2319@node More information
2320@section Where can I get more information about Emacs?
2321@cindex other sources of information
2322@cindex faqs, general
2323@cindex faqs, old
2324@cindex help, manuals and other sources
2325@cindex manuals
2326@cindex wiki
2327
2328If you have general questions about Emacs, the best places to start
2329looking are @ref{Top,,, emacs, The GNU Emacs Manual}, and
2330@ref{Top,,, efaq, the standard Emacs FAQ}.
2331In Emacs, you can browse the manual using Info by typing @kbd{C-h r},
2332and you can view the FAQ by typing @kbd{C-h C-f}. Other resources include:
2333
2334@itemize
2335@item @uref{http://www.gnu.org/software/emacs/, The Emacs homepage}
2336@item @uref{http://www.gnu.org/software/emacs/manual/, Other Emacs manuals}
2337@item @uref{http://www.emacswiki.org/, Emacs Wiki}
2338@end itemize
2339
2340@node Mailing lists
2341@section What mailing lists are there for discussing Emacs on Windows?
2342@cindex mailing lists
2343@cindex help, mailing lists
2344
2345The official mailing list for Windows specific help and discussion is
2346@url{http://lists.gnu.org/mailman/listinfo/help-emacs-windows,
2347help-emacs-windows}. See that link for information on how to subscribe
2348or unsubscribe. The
2349@uref{http://lists.gnu.org/archive/html/help-emacs-windows/, list archives}
2350are available online.
2351
2352@c ------------------------------------------------------------
2353@node Indexes
2354@unnumbered Indexes
2355
2356@unnumberedsec Function and Variable Index
2357
2358@printindex fn
2359
2360@unnumberedsec Concept Index
2361
2362@printindex cp
2363
2364@bye