XEmacs 21.2.25 "Hephaestus".
[chise/xemacs-chise.git.1] / man / xemacs-faq.texi
1 \input texinfo.tex      @c -*-texinfo-*-
2 @c %**start of header
3 @setfilename ../info/xemacs-faq.info
4 @settitle Frequently asked questions about XEmacs
5 @setchapternewpage off
6 @c %**end of header
7 @finalout
8 @titlepage
9 @title XEmacs FAQ
10 @subtitle Frequently asked questions about XEmacs @* Last Modified: $Date: 1999/12/23 01:50:47 $
11 @sp 1
12 @author Tony Rossini <rossini@@biostat.washington.edu>
13 @author Ben Wing <ben@@xemacs.org>
14 @author Chuck Thompson <cthomp@@xemacs.org>
15 @author Steve Baur <steve@@xemacs.org>
16 @author Andreas Kaempf <andreas@@sccon.com>
17 @author Christian Nyb@o{} <chr@@mediascience.no>
18 @author Sandra Wambold <wambold@@xemacs.org>
19 @page
20 @end titlepage
21
22 @ifinfo
23 @dircategory XEmacs Editor
24 @direntry
25 * FAQ: (xemacs-faq).            XEmacs FAQ.
26 @end direntry
27 @end ifinfo
28
29 @node Top, Introduction, (dir), (dir)
30 @top XEmacs FAQ
31 @unnumbered Introduction
32
33 This is the guide to the XEmacs Frequently Asked Questions list---a
34 compendium of questions and answers pertaining to one of the finest
35 programs ever written.  It is much more than just a Text Editor.
36
37 This FAQ is freely redistributable.  I take no liability for the
38 correctness and safety of any procedures or advice given here.  This
39 FAQ is distributed in the hope that it will be useful, but WITHOUT ANY
40 WARRANTY; without even the implied warranty of MERCHANTABILITY or
41 FITNESS FOR A PARTICULAR PURPOSE.
42
43 If you have a Web browser, the official hypertext version is at
44 @iftex
45 @*
46 @end iftex
47 @uref{http://www.xemacs.org/faq/xemacs-faq.html}.
48
49 This version is somewhat nicer than the unofficial hypertext versions
50 that are archived at Utrecht, Oxford, Smart Pages, and other FAQ
51 archives.
52
53 @ifset CANONICAL
54 @html
55 This document is available in several different formats:
56 @itemize @bullet
57 @item
58 @uref{xemacs-faq.txt, As a single ASCII file}, produced by
59 @code{makeinfo --no-headers}
60 @item
61 @uref{xemacs-faq.dvi, As a .dvi file}, as used with
62 @uref{http://www.tug.org, TeX.}
63 @item
64 As a PostScript file @uref{xemacs-faq-a4.ps, in A4 format},
65 as well as in @uref{xemacs-faq-letter.ps, letter format}
66 @item
67 In html format, @uref{xemacs-faq_1.html, split by chapter}, or in
68 @uref{xemacs-faq.html, one monolithic} document.
69 @item
70 The canonical version of the FAQ is the texinfo document
71 @uref{xemacs-faq.texi, man/xemacs-faq.texi}.
72 @item
73 If you do not have makeinfo installed, you may @uref{xemacs-faq.info,
74 download the faq} in info format, and install it in @file{<XEmacs
75 library directory>/info/}. For example in
76 @file{/usr/local/lib/xemacs-20.4/info/}.
77
78 @end itemize
79
80 @end html
81
82 @end ifset
83
84 @c end ifset points to CANONICAL
85
86 @menu
87 * Introduction::        Introduction, Policy, Credits.
88 * Installation::        Installation and Trouble Shooting.
89 * Customization::       Customization and Options.
90 * Subsystems::          Major Subsystems.
91 * Miscellaneous::       The Miscellaneous Stuff.
92 * MS Windows::          XEmacs on Microsoft Windows.
93 * Current Events::      What the Future Holds.
94
95 @detailmenu
96
97  --- The Detailed Node Listing ---
98
99 Introduction, Policy, Credits
100
101 * Q1.0.1::      What is XEmacs?
102 * Q1.0.2::      What is the current version of XEmacs?
103 * Q1.0.3::      Where can I find it?
104 * Q1.0.4::      Why Another Version of Emacs?
105 * Q1.0.5::      Why Haven't XEmacs and GNU Emacs Merged?
106 * Q1.0.6::      Where can I get help?
107 * Q1.0.7::      Where is the mailing list archived?
108 * Q1.0.8::      How do you pronounce XEmacs?
109 * Q1.0.9::      What does XEmacs look like?
110 * Q1.0.10::     Is there a port of XEmacs to Microsoft ('95 or NT)?
111 * Q1.0.11::     Is there a port of XEmacs to the Macintosh?
112 * Q1.0.12::     Is there a port of XEmacs to NextStep?
113 * Q1.0.13::     Is there a port of XEmacs to OS/2?
114 * Q1.0.14::     Where can I get a printed copy of the XEmacs users manual?
115
116 Policies:
117 * Q1.1.1::      What is the FAQ editorial policy?
118 * Q1.1.2::      How do I become a Beta Tester?
119 * Q1.1.3::      How do I contribute to XEmacs itself?
120
121 Credits:
122 * Q1.2.1::      Who wrote XEmacs?
123 * Q1.2.2::      Who contributed to this version of the FAQ?
124 * Q1.2.3::      Who contributed to the FAQ in the past?
125
126 Internationalization:
127 * Q1.3.1::      What is the status of XEmacs v20?
128 * Q1.3.2::      What is the status of Asian-language support, aka @var{mule}?
129 * Q1.3.3::      How do I type non-ASCII characters?
130 * Q1.3.4::      Can XEmacs messages come out in a different language?
131 * Q1.3.5::      Please explain the various input methods in MULE/XEmacs 20.0
132 * Q1.3.6::      How do I portably code for MULE/XEmacs 20.0?
133 * Q1.3.7::      How about Cyrillic Modes?
134
135 Getting Started:
136 * Q1.4.1::      What is a @file{.emacs} and is there a sample one?
137 * Q1.4.2::      Can I use the same @file{.emacs} with the other Emacs?
138 * Q1.4.3::      Any good XEmacs tutorials around?
139 * Q1.4.4::      May I see an example of a useful XEmacs Lisp function?
140 * Q1.4.5::      And how do I bind it to a key?
141 * Q1.4.6::      What's the difference between a macro and a function?
142 * Q1.4.7::      Why options saved with 19.13 don't work with 19.14 or later?
143
144 Installation and Trouble Shooting
145
146 * Q2.0.1::      Running XEmacs without installing.
147 * Q2.0.2::      XEmacs is too big.
148 * Q2.0.3::      Compiling XEmacs with Netaudio.
149 * Q2.0.4::      Problems with Linux and ncurses.
150 * Q2.0.5::      Do I need X11 to run XEmacs?
151 * Q2.0.6::      I'm having strange crashes.  What do I do?
152 * Q2.0.7::      Libraries in non-standard locations.
153 * Q2.0.8::      can't resolve symbol _h_errno
154 * Q2.0.9::      Where do I find external libraries?
155 * Q2.0.10::     After I run configure I find a coredump, is something wrong?
156 * Q2.0.11::     XEmacs can't resolve host names.
157 * Q2.0.12::     Why can't I strip XEmacs?
158 * Q2.0.13::     Can't link XEmacs on Solaris with Gcc.
159 * Q2.0.14::     Make on HP/UX 9 fails after linking temacs
160
161 Trouble Shooting:
162 * Q2.1.1::      XEmacs just crashed on me!
163 * Q2.1.2::      Cryptic Minibuffer messages.
164 * Q2.1.3::      Translation Table Syntax messages at Startup.
165 * Q2.1.4::      Startup warnings about deducing proper fonts?
166 * Q2.1.5::      XEmacs cannot connect to my X Terminal.
167 * Q2.1.6::      XEmacs just locked up my Linux X server.
168 * Q2.1.7::      HP Alt key as Meta.
169 * Q2.1.8::      got (wrong-type-argument color-instance-p nil)!
170 * Q2.1.9::      XEmacs causes my OpenWindows 3.0 server to crash.
171 * Q2.1.10::     Warnings from incorrect key modifiers.
172 * Q2.1.11::     Can't instantiate image error... in toolbar
173 * Q2.1.12::     Regular Expression Problems on DEC OSF1.
174 * Q2.1.13::     HP/UX 10.10 and @code{create_process} failure
175 * Q2.1.14::     @kbd{C-g} doesn't work for me.  Is it broken?
176 * Q2.1.15::     How to debug an XEmacs problem with a debugger.
177 * Q2.1.16::     XEmacs crashes in @code{strcat} on HP/UX 10.
178 * Q2.1.17::     @samp{Marker does not point anywhere}.
179 * Q2.1.18::     19.14 hangs on HP/UX 10.10.
180 * Q2.1.19::     XEmacs does not follow the local timezone.
181 * Q2.1.20::     @samp{Symbol's function definition is void: hkey-help-show.}
182 * Q2.1.21::     Every so often the XEmacs frame freezes.
183 * Q2.1.22::     XEmacs seems to take a really long time to do some things.
184 * Q2.1.23::     Movemail on Linux does not work for XEmacs 19.15 and later.
185 * Q2.1.24::     XEmacs won't start without network. (NEW)
186
187 Customization and Options
188
189 * Q3.0.1::      What version of Emacs am I running?
190 * Q3.0.2::      How do I evaluate Elisp expressions?
191 * Q3.0.3::      @code{(setq tab-width 6)} behaves oddly.
192 * Q3.0.4::      How can I add directories to the @code{load-path}?
193 * Q3.0.5::      How to check if a lisp function is defined?
194 * Q3.0.6::      Can I force the output of @code{(face-list)} to a buffer?
195 * Q3.0.7::      Font selections don't get saved after @code{Save Options}.
196 * Q3.0.8::      How do I make a single minibuffer frame?
197 * Q3.0.9::      What is @code{Customize}?
198
199 X Window System & Resources:
200 * Q3.1.1::      Where is a list of X resources?
201 * Q3.1.2::      How can I detect a color display?
202 * Q3.1.3::      @code{(set-screen-width)} worked in 19.6, but not in 19.13?
203 * Q3.1.4::      Specifying @code{Emacs*EmacsScreen.geometry} in @file{.emacs} does not work in 19.15?
204 * Q3.1.5::      How can I get the icon to just say @samp{XEmacs}?
205 * Q3.1.6::      How can I have the window title area display the full path?
206 * Q3.1.7::      @samp{xemacs -name junk} doesn't work?
207 * Q3.1.8::      @samp{-iconic} doesn't work.
208
209 Textual Fonts & Colors:
210 * Q3.2.1::      How can I set color options from @file{.emacs}?
211 * Q3.2.2::      How do I set the text, menu and modeline fonts?
212 * Q3.2.3::      How can I set the colors when highlighting a region?
213 * Q3.2.4::      How can I limit color map usage?
214 * Q3.2.5::      My tty supports color, but XEmacs doesn't use them.
215 * Q3.2.6::      Can I have pixmap backgrounds in XEmacs?
216
217 The Modeline:
218 * Q3.3.1::      How can I make the modeline go away?
219 * Q3.3.2::      How do you have XEmacs display the line number in the modeline?
220 * Q3.3.3::      How do I get XEmacs to put the time of day on the modeline?
221 * Q3.3.4::      How do I turn off current chapter from AUC TeX modeline?
222 * Q3.3.5::      How can one change the modeline color based on the mode used?
223
224 Multiple Device Support:
225 * Q3.4.1::      How do I open a frame on another screen of my multi-headed display?
226 * Q3.4.2::      Can I really connect to a running XEmacs after calling up over a modem?  How?
227
228 The Keyboard:
229 * Q3.5.1::      How can I bind complex functions (or macros) to keys?
230 * Q3.5.2::      How can I stop down-arrow from adding empty lines to the bottom of my buffers?
231 * Q3.5.3::      How do I bind C-. and C-; to scroll one line up and down?
232 * Q3.5.4::      Globally binding @kbd{Delete}?
233 * Q3.5.5::      Scrolling one line at a time.
234 * Q3.5.6::      How to map @kbd{Help} key alone on Sun type4 keyboard?
235 * Q3.5.7::      How can you type in special characters in XEmacs?
236 * Q3.5.8::      Why does @code{(global-set-key [delete-forward] 'delete-char)} complain?
237 * Q3.5.9::      How do I make the Delete key delete forward?
238 * Q3.5.10::     Can I turn on @dfn{sticky} modifier keys?
239 * Q3.5.11::     How do I map the arrow keys?
240
241 The Cursor:
242 * Q3.6.1::      Is there a way to make the bar cursor thicker?
243 * Q3.6.2::      Is there a way to get back the old block cursor where the cursor covers the character in front of the point?
244 * Q3.6.3::      Can I make the cursor blink?
245
246 The Mouse and Highlighting:
247 * Q3.7.1::      How can I turn off Mouse pasting?
248 * Q3.7.2::      How do I set control/meta/etc modifiers on mouse buttons?
249 * Q3.7.3::      Clicking the left button does not do anything in buffer list.
250 * Q3.7.4::      How can I get a list of buffers when I hit mouse button 3?
251 * Q3.7.5::      Why does cut-and-paste not work between XEmacs and a cmdtool?
252 * Q3.7.6::      How I can set XEmacs up so that it pastes where the text cursor is?
253 * Q3.7.7::      How do I select a rectangular region?
254 * Q3.7.8::      Why does @kbd{M-w} take so long?
255
256 The Menubar and Toolbar:
257 * Q3.8.1::      How do I get rid of the menu (or menubar)?
258 * Q3.8.2::      Can I customize the basic menubar?
259 * Q3.8.3::      How do I control how many buffers are listed in the menu @code{Buffers} list?
260 * Q3.8.4::      Resources like @code{Emacs*menubar*font} are not working?
261 * Q3.8.5::      How can I bind a key to a function to toggle the toolbar?
262
263 Scrollbars:
264 * Q3.9.1::      How can I disable the scrollbar?
265 * Q3.9.2::      How can one use resources to change scrollbar colors?
266 * Q3.9.3::      Moving the scrollbar can move the point; can I disable this?
267 * Q3.9.4::      How can I get automatic horizontal scrolling?
268
269 Text Selections:
270 * Q3.10.1::     How can I turn off or change highlighted selections?
271 * Q3.10.2::     How do I get that typing on an active region removes it?
272 * Q3.10.3::     Can I turn off the highlight during isearch?
273 * Q3.10.4::     How do I turn off highlighting after @kbd{C-x C-p} (mark-page)?
274 * Q3.10.5::     The region disappears when I hit the end of buffer while scrolling.
275
276 Major Subsystems
277
278 * Q4.0.1::      How do I set up VM to retrieve remote mail using POP?
279 * Q4.0.2::      How do I get VM to filter mail for me?
280 * Q4.0.3::      How can I get VM to automatically check for new mail?
281 * Q4.0.4::      [This question intentionally left blank]
282 * Q4.0.5::      How do I get my outgoing mail archived?
283 * Q4.0.6::      I have various addresses at which I receive mail.  How can I tell VM to ignore them when doing a "reply-all"?
284 * Q4.0.7::      Is there a mailing list or FAQ for VM?
285 * Q4.0.8::      Remote mail reading with VM.
286 * Q4.0.9::      rmail or VM gets an error incorporating new mail.
287 * Q4.0.10::     How do I make VM stay in a single frame?
288 * Q4.0.11::     How do I make VM or mh-e display graphical smilies?
289 * Q4.0.12::     Customization of VM not covered in the manual or here.
290
291 Web browsing with W3:
292 * Q4.1.1::      What is W3?
293 * Q4.1.2::      How do I run W3 from behind a firewall?
294 * Q4.1.3::      Is it true that W3 supports style sheets and tables?
295
296 Reading Netnews and Mail with Gnus:
297 * Q4.2.1::      GNUS, (ding) Gnus, Gnus 5, September Gnus, Red Gnus, Quassia Gnus, argh!
298 * Q4.2.2::      [This question intentionally left blank]
299 * Q4.2.3::      How do I make Gnus stay within a single frame?
300 * Q4.2.4::      How do I customize the From: line?
301
302 Other Mail & News:
303 * Q4.3.1::      How can I read and/or compose MIME messages?
304 * Q4.3.2::      What is TM and where do I get it?
305 * Q4.3.3::      Why isn't this @code{movemail} program working?
306 * Q4.3.4::      Movemail is also distributed by Netscape?  Can that cause problems?
307 * Q4.3.5::      Where do I find pstogif (required by tm)?
308
309 Sparcworks, EOS, and WorkShop:
310 * Q4.4.1::      What is SPARCworks, EOS, and WorkShop
311 * Q4.4.2::      How do I start the Sun Workshop support in XEmacs 21?
312
313 Energize:
314 * Q4.5.1::      What is/was Energize?
315
316 Infodock:
317 * Q4.6.1::      What is Infodock?
318
319 Other Unbundled Packages:
320 * Q4.7.1::      What is AUC TeX?  Where do you get it?
321 * Q4.7.2::      Are there any Emacs Lisp Spreadsheets?
322 * Q4.7.3::      Byte compiling AUC TeX on XEmacs 19.14
323 * Q4.7.4::      Problems installing AUC TeX
324 * Q4.7.5::      Is there a reason for an Emacs package not to be included in XEmacs?
325 * Q4.7.6::      Is there a MatLab mode?
326
327 The Miscellaneous Stuff
328
329 * Q5.0.1::      How can I do source code highlighting using font-lock?
330 * Q5.0.2::      I do not like cc-mode.  How do I use the old c-mode?
331 * Q5.0.3::      How do I get @samp{More} Syntax Highlighting on by default?
332 * Q5.0.4::      How can I enable auto-indent?
333 * Q5.0.5::      How can I get XEmacs to come up in text/auto-fill mode by default?
334 * Q5.0.6::      How do I start up a second shell buffer?
335 * Q5.0.7::      Telnet from shell filters too much.
336 * Q5.0.8::      Why does edt emulation not work?
337 * Q5.0.9::      How can I emulate VI and use it as my default mode?
338 * Q5.0.10::     [This question intentionally left blank]
339 * Q5.0.11::     Filladapt doesn't work in 19.15?
340 * Q5.0.12::     How do I disable gnuserv from opening a new frame?
341 * Q5.0.13::     How do I start gnuserv so that each subsequent XEmacs is a client?
342 * Q5.0.14::     Strange things are happening in Shell Mode.
343 * Q5.0.15::     Where do I get the latest CC Mode?
344 * Q5.0.16::     I find auto-show-mode disconcerting.  How do I turn it off?
345 * Q5.0.17::     How can I get two instances of info?
346 * Q5.0.18::     I upgraded to XEmacs 19.14 and gnuserv stopped working
347 * Q5.0.19::     Is there something better than LaTeX mode?
348 * Q5.0.20::     Is there a way to start a new XEmacs if there's no gnuserv running, and otherwise use gnuclient?
349
350 Emacs Lisp Programming Techniques:
351 * Q5.1.1::      The difference in key sequences between XEmacs and GNU Emacs?
352 * Q5.1.2::      Can I generate "fake" keyboard events?
353 * Q5.1.3::      Could you explain @code{read-kbd-macro} in more detail?
354 * Q5.1.4::      What is the performance hit of @code{let}?
355 * Q5.1.5::      What is the recommended use of @code{setq}?
356 * Q5.1.6::      What is the typical misuse of @code{setq} ?
357 * Q5.1.7::      I like the the @code{do} form of cl, does it slow things down?
358 * Q5.1.8::      I like recursion, does it slow things down?
359 * Q5.1.9::      How do I put a glyph as annotation in a buffer?
360 * Q5.1.10::     @code{map-extents} won't traverse all of my extents!
361 * Q5.1.11::     My elisp program is horribly slow.  Is there an easy way to find out where it spends time?
362
363 Sound:
364 * Q5.2.1::      How do I turn off the sound?
365 * Q5.2.2::      How do I get funky sounds instead of a boring beep?
366 * Q5.2.3::      What's NAS, how do I get it?
367 * Q5.2.4::      Sunsite sounds don't play.
368
369 Miscellaneous:
370 * Q5.3.1::      How do you make XEmacs indent CL if-clauses correctly?
371 * Q5.3.2::      Fontifying hangs when editing a postscript file.
372 * Q5.3.3::      How can I print WYSIWYG a font-locked buffer?
373 * Q5.3.4::      Getting @kbd{M-x lpr} to work with postscript printer.
374 * Q5.3.5::      How do I specify the paths that XEmacs uses for finding files?
375 * Q5.3.6::      [This question intentionally left blank]
376 * Q5.3.7::      Can I have the end of the buffer delimited in some way?
377 * Q5.3.8::      How do I insert today's date into a buffer?
378 * Q5.3.9::      Are only certain syntactic character classes available for abbrevs?
379 * Q5.3.10::     How can I get those oh-so-neat X-Face lines?
380 * Q5.3.11::     How do I add new Info directories?
381 * Q5.3.12::     What do I need to change to make printing work?
382
383 XEmacs on MS Windows
384
385 General Info:
386 * Q6.0.1::      What is the status of the XEmacs port to Windows?
387 * Q6.0.2::      What flavors of MS Windows are supported?
388 * Q6.0.3::      Are binary kits available?
389 * Q6.0.4::      Does XEmacs on MS Windows require an X server to run?
390
391 Building XEmacs on MS Windows:
392 * Q6.1.1::      I decided to run with X.  Where do I get an X server?
393 * Q6.1.2::      What compiler do I need to compile XEmacs?
394 * Q6.1.3::      How do I compile for the native port?
395 * Q6.1.4::      How do I compile for the X port?
396 * Q6.1.5::      How do I compile for Cygnus' Cygwin?
397 * Q6.1.6::      What do I need for Cygwin?
398
399 Customization and User Interface:
400 * Q6.2.1::      How will the port cope with differences in the Windows user interface?
401 * Q6.2.2::      How do I change fonts in XEmacs on MS Windows?
402 * Q6.2.3::      Where do I put my @file{.emacs} file?
403
404 Miscellaneous:
405 * Q6.3.1::      Will XEmacs rename all the win32-* symbols to w32-*?
406 * Q6.3.2::      What are the differences between the various MS Windows emacsen?
407 * Q6.3.3::      What is the porting team doing at the moment?
408
409 Current Events:
410
411 * Q7.0.1::      What is new in 20.2?
412 * Q7.0.2::      What is new in 20.3?
413 * Q7.0.3::      What is new in 20.4?
414 * Q7.0.4::      Procedural changes in XEmacs development.
415 @end detailmenu
416 @end menu
417
418 @node Introduction, Installation, Top, Top
419 @unnumbered 1 Introduction, Policy, Credits
420
421 Learning XEmacs is a lifelong activity.  Even people who have used Emacs
422 for years keep discovering new features.  Therefore this document cannot
423 be complete.  Instead it is aimed at the person who is either
424 considering XEmacs for their own use, or has just obtained it and is
425 wondering what to do next.  It is also useful as a reference to
426 available resources.
427
428 The previous maintainer of the FAQ was @email{rossini@@biostat.washington.edu,
429 Anthony Rossini}, who started it, after getting tired of hearing JWZ
430 complain about repeatedly having to answer questions.
431 @email{ben@@xemacs.org, Ben Wing} and @email{cthomp@@xemacs.org, Chuck
432 Thompson}, the principal authors of XEmacs, then took over and Ben did
433 a massive update reorganizing the whole thing.  At which point Anthony
434 took back over, but then had to give it up again.  Some of the other
435 contributors to this FAQ are listed later in this document.
436
437 The previous version was converted to hypertext format, and edited by
438 @email{steve@@xemacs.org, Steven L. Baur}.  It was converted back to
439 texinfo by @email{hniksic@@xemacs.org, Hrvoje Niksic}.  The FAQ was then
440 maintained by @email{andreas@@sccon.com, Andreas Kaempf}, who passed it
441 on to ChristianNyb@o{}.
442
443 If you notice any errors or items which should be added or amended to
444 this FAQ please send email to @email{faq@@xemacs.org, Sandra
445 Wambold}.  Include @samp{XEmacs FAQ} on the Subject: line.
446
447 @menu
448 Introduction:
449 * Q1.0.1::      What is XEmacs?
450 * Q1.0.2::      What is the current version of XEmacs?
451 * Q1.0.3::      Where can I find it?
452 * Q1.0.4::      Why Another Version of Emacs?
453 * Q1.0.5::      Why Haven't XEmacs and GNU Emacs Merged?
454 * Q1.0.6::      Where can I get help?
455 * Q1.0.7::      Where is the mailing list archived?
456 * Q1.0.8::      How do you pronounce XEmacs?
457 * Q1.0.9::      What does XEmacs look like?
458 * Q1.0.10::     Is there a port of XEmacs to Microsoft ('95 or NT)?
459 * Q1.0.11::     Is there a port of XEmacs to the Macintosh?
460 * Q1.0.12::     Is there a port of XEmacs to NextStep?
461 * Q1.0.13::     Is there a port of XEmacs to OS/2?
462 * Q1.0.14::     Where can I get a printed copy of the XEmacs users manual?
463
464 Policies:
465 * Q1.1.1::      What is the FAQ editorial policy?
466 * Q1.1.2::      How do I become a Beta Tester?
467 * Q1.1.3::      How do I contribute to XEmacs itself?
468
469 Credits:
470 * Q1.2.1::      Who wrote XEmacs?
471 * Q1.2.2::      Who contributed to this version of the FAQ?
472 * Q1.2.3::      Who contributed to the FAQ in the past?
473
474 Internationalization:
475 * Q1.3.1::      What is the status of XEmacs v20?
476 * Q1.3.2::      What is the status of Asian-language support, aka @var{mule}?
477 * Q1.3.3::      How do I type non-ASCII characters?
478 * Q1.3.4::      Can XEmacs messages come out in a different language?
479 * Q1.3.5::      Please explain the various input methods in MULE/XEmacs 20.0
480 * Q1.3.6::      How do I portably code for MULE/XEmacs 20.0?
481 * Q1.3.7::      How about Cyrillic Modes?
482
483 Getting Started:
484 * Q1.4.1::      What is a @file{.emacs} and is there a sample one?
485 * Q1.4.2::      Can I use the same @file{.emacs} with the other Emacs?
486 * Q1.4.3::      Any good XEmacs tutorials around?
487 * Q1.4.4::      May I see an example of a useful XEmacs Lisp function?
488 * Q1.4.5::      And how do I bind it to a key?
489 * Q1.4.6::      What's the difference between a macro and a function?
490 * Q1.4.7::      Why options saved with 19.13 don't work with 19.14 or later?
491 @end menu
492
493 @node Q1.0.1, Q1.0.2, Introduction, Introduction
494 @unnumberedsec 1.0: Introduction
495 @unnumberedsubsec Q1.0.1: What is XEmacs?
496
497
498 An alternative to GNU Emacs, originally based on an early alpha version
499 of FSF's version 19, and has diverged quite a bit since then.  XEmacs
500 was known as Lucid Emacs through version 19.10.  Almost all features of
501 GNU Emacs are supported in XEmacs.  The maintainers of XEmacs actively
502 track changes to GNU Emacs while also working to add new features.
503
504 @node Q1.0.2, Q1.0.3, Q1.0.1, Introduction
505 @unnumberedsubsec Q1.0.2: What is the current version of XEmacs?
506
507 XEmacs 21.1.8 is the current stable version of XEmacs.
508
509 XEmacs 20.4 is a minor upgrade from 20.3, containing many bugfixes. It
510 was released in February 1998.
511
512 XEmacs 19.16 was the last release of v19, released in November, 1997,
513 which was also the last version without international language support.
514
515 @node Q1.0.3, Q1.0.4, Q1.0.2, Introduction
516 @unnumberedsubsec Q1.0.3: Where can I find it?
517
518 The canonical source and binaries can be found via anonymous FTP at:
519
520 @example
521 @uref{ftp://ftp.xemacs.org/pub/xemacs/}
522 @end example
523
524 @node Q1.0.4, Q1.0.5, Q1.0.3, Introduction
525 @unnumberedsubsec Q1.0.4: Why Another Version of Emacs?
526
527 For a detailed description of the differences between GNU Emacs and
528 XEmacs and a detailed history of XEmacs, check out the
529 @example
530 @uref{http://www.xemacs.org/About/XEmacsVsGNUemacs.html, NEWS file}
531 @end example
532
533 However, here is a list of some of the reasons why we think you might
534 consider using it:
535
536 @itemize @bullet
537 @item
538 It looks nicer.
539
540 @item
541 The XEmacs maintainers are generally more receptive to suggestions than
542 the GNU Emacs maintainers.
543
544 @item
545 Many more bundled packages than GNU Emacs
546
547 @item
548 Binaries are available for many common operating systems.
549
550 @item
551 Face support on TTY's.
552
553 @item
554 A built-in toolbar.
555
556 @item
557 Better Motif compliance.
558
559 @item
560 Some internationalization support (including full MULE support, if
561 compiled with it.)
562
563 @item
564 Variable-width fonts.
565
566 @item
567 Variable-height lines.
568
569 @item
570 Marginal annotations.
571
572 @item
573 ToolTalk support.
574
575 @item
576 XEmacs can be used as an Xt widget, and can be embedded within another
577 application.
578
579 @item
580 Horizontal and vertical scrollbars (using real toolkit scrollbars).
581
582 @item
583 Better APIs (and performance) for attaching fonts, colors, and other
584 properties to text.
585
586 @item
587 The ability to embed arbitrary graphics in a buffer.
588
589 @item
590 Completely compatible (at the C level) with the Xt-based toolkits.
591
592 @item
593 First production Web Browser supporting Style Sheets.
594 @end itemize
595
596 @node Q1.0.5, Q1.0.6, Q1.0.4, Introduction
597 @unnumberedsubsec Q1.0.5: Why Haven't XEmacs and GNU Emacs Merged?
598
599 There are currently irreconcilable differences in the views about
600 technical, programming, design and organizational matters between RMS
601 and the XEmacs development team which provide little hope for a merge to
602 take place in the short-term future.
603
604 If you have a comment to add regarding the merge, it is a good idea to
605 avoid posting to the newsgroups,  because of the very heated flamewars
606 that often result.  Mail your questions to @email{xemacs-beta@@xemacs.org} and
607 @email{bug-gnu-emacs@@prep.ai.mit.edu}.
608
609 @node Q1.0.6, Q1.0.7, Q1.0.5, Introduction
610 @unnumberedsubsec Q1.0.6: Where can I get help?
611
612 Probably the easiest way, if everything is installed, is to use Info, by
613 pressing @kbd{C-h i}, or selecting @code{Manuals->Info} from the
614 Help Menu.  @kbd{M-x apropos} can be used to look for particular commands.
615
616 For items not found in the manual, try reading this FAQ
617 @comment , examining the regular GNU Emacs FAQ (which can be
618 @comment found with the Emacs 19 distribution) as well as at
619 @comment @uref{http://www.eecs.nwu.edu/emacs/faq/}
620 and reading the Usenet group comp.emacs.xemacs.
621
622 If you choose to post to a newsgroup, @strong{please use
623 comp.emacs.xemacs}.  Please do not post XEmacs related questions to
624 gnu.emacs.help.
625
626 If you cannot post or read Usenet news, there is a corresponding mailing
627 list which is available.  It can be subscribed to by sending a message
628 to @email{xemacs-request@@xemacs.org} with @samp{subscribe} in the
629 body of the message.  Send to the list at @email{xemacs@@xemacs.org}.
630 list.  To cancel a subscription, you @strong{must} use the
631 xemacs-request address.  Send a message with a subject of
632 @samp{unsubscribe} to be removed.
633
634 @node Q1.0.7, Q1.0.8, Q1.0.6, Introduction
635 @unnumberedsubsec Q1.0.7: Where is the mailing list archived?
636
637 The archives can be found at @uref{http://www.xemacs.org/Lists/Archive}
638
639 @node Q1.0.8, Q1.0.9, Q1.0.7, Introduction
640 @unnumberedsubsec Q1.0.8: How do you pronounce XEmacs?
641
642 The most common pronounciation is @samp{Eks eemax}.
643
644 @node Q1.0.9, Q1.0.10, Q1.0.8, Introduction
645 @unnumberedsubsec Q1.0.9: What does XEmacs look like?
646
647 Screen snapshots are available in the WWW version of the FAQ.
648 @example
649 @uref{http://www.xemacs.org/faq/xemacs-faq.html}
650 @end example
651
652 @node Q1.0.10, Q1.0.11, Q1.0.9, Introduction
653 @unnumberedsubsec Q1.0.10: Is there a port of XEmacs to Microsoft ('95 or NT)?
654
655 Yes, @xref{MS Windows}.
656
657 @comment Thanks to efforts of many people, coordinated by
658 @comment @email{davidh@@wr.com.au, David Hobley} and @email{marcpa@@cam.org, Marc
659 @comment Paquette}, beta versions of XEmacs now run on 32-bit Windows platforms
660 @comment (NT and 95).  The current betas require having an X server to run
661 @comment XEmacs; however, a native NT/95 port is in alpha, thanks to
662 @comment @email{jhar@@tardis.ed.ac.uk, Jonathan Harris}.
663 @comment 
664 @comment Although some features are still unimplemented, XEmacs 21.0 will support
665 @comment MS-Windows.
666 @comment 
667 @comment The NT development is now coordinated by a mailing list at
668 @comment @email{xemacs-nt@@xemacs.org}.
669 @comment 
670 @comment If you are willing to contribute or want to follow the progress, mail to
671 @comment @iftex
672 @comment @*
673 @comment @end iftex
674 @comment @email{xemacs-nt-request@@xemacs.org} to subscribe.
675 @comment 
676 @comment Furthermore, Altrasoft is seeking corporate and government sponsors to
677 @comment help fund a fully native port of XEmacs to Windows 95 and NT using
678 @comment full-time, senior-level staff working under a professionally managed
679 @comment project structure.  See @uref{http://www.altrasoft.com/, the Altrasoft
680 @comment web site} for more details
681 @comment or contact Altrasoft directly at 1-888-ALTSOFT.
682 @comment 
683 @comment 
684 @comment The closest existing port is @dfn{Win-Emacs}, which is based on Lucid
685 @comment Emacs 19.6.  Available from @uref{http://www.pearlsoft.com/}.
686 @comment 
687 @comment There's a port of GNU Emacs (not XEmacs) at
688 @comment @example
689 @comment @uref{http://www.cs.washington.edu/homes/voelker/ntemacs.html}.
690 @comment @end example
691
692 @node Q1.0.11, Q1.0.12, Q1.0.10, Introduction
693 @unnumberedsubsec Q1.0.11: Is there a port of XEmacs to the Macintosh?
694 @c changed
695
696 There has been a port to the MachTen environment of XEmacs 19.13, but no
697 patches have been submitted to the maintainers to get this in the
698 mainstream distribution.
699
700 For the MacOS, there is a port of
701 @uref{ftp://ftp.cs.cornell.edu/pub/parmet/, Emacs 18.59}.
702
703 @node Q1.0.12, Q1.0.13, Q1.0.11, Introduction
704 @unnumberedsubsec Q1.0.12: Is there a port of XEmacs to NextStep?
705
706 Carl Edman, apparently no longer at @email{cedman@@princeton.edu}, did
707 the port of GNU Emacs to NeXTstep and expressed interest in doing the
708 XEmacs port, but never went any farther.
709
710 @node Q1.0.13, Q1.0.14, Q1.0.12, Introduction
711 @unnumberedsubsec Q1.0.13: Is there a port of XEmacs to OS/2?
712
713 No, and there is no news of anyone working on it.
714
715 @node Q1.0.14, Q1.1.1, Q1.0.13, Introduction
716 @unnumberedsubsec Q1.0.14: Where can I obtain a printed copy of the XEmacs users manual?
717
718 Pre-printed manuals are not available.  If you are familiar with 
719 TeX, you can generate your own manual from the XEmacs sources.
720
721 HTML and Postscript versions of XEmacs manuals may be available from the
722 XEmacs web site in the future.
723
724
725 @node Q1.1.1, Q1.1.2, Q1.0.14, Introduction
726 @unnumberedsec 1.1: Policies
727 @unnumberedsubsec Q1.1.1: What is the FAQ editorial policy?
728
729 The FAQ is actively maintained and modified regularly.  All links should
730 be up to date.  Unfortunately, some of the information is out of date --
731 a situation which the FAQ maintainer is working on.  All submissions are
732 welcome, please e-mail submissions to @email{faq@@xemacs.org, XEmacs FAQ
733 maintainers}.
734
735 Please make sure that @samp{XEmacs FAQ} appears on the Subject: line.
736 If you think you have a better way of answering a question, or think a
737 question should be included, we'd like to hear about it.  Questions and
738 answers included into the FAQ will be edited for spelling and grammar,
739 and will be attributed.  Answers appearing without attribution are
740 either from versions of the FAQ dated before May 1996, or are from one
741 of the four people listed at the top of this document.  Answers quoted
742 from Usenet news articles will always be attributed, regardless of the
743 author.
744
745 @node Q1.1.2, Q1.1.3, Q1.1.1, Introduction
746 @unnumberedsubsec Q1.1.2: How do I become a Beta Tester?
747
748 Send an email message to @email{xemacs-beta-request@@xemacs.org} with
749 the line @samp{subscribe} in the body of the message.
750
751 Be prepared to get your hands dirty, as beta testers are expected to
752 identify problems as best they can.
753
754 @node Q1.1.3, Q1.2.1, Q1.1.2, Introduction
755 @unnumberedsubsec Q1.1.3: How do I contribute to XEmacs itself?
756
757 Ben Wing @email{ben@@xemacs.org} writes:
758
759 @quotation
760 BTW if you have a wish list of things that you want added, you have to
761 speak up about it!  More specifically, you can do the following if you
762 want a feature added (in increasing order of usefulness):
763
764 @itemize @bullet
765 @item
766 Make a posting about a feature you want added.
767
768 @item
769 Become a beta tester and make more postings about those same features.
770
771 @item
772 Convince us that you're going to use the features in some cool and
773 useful way.
774
775 @item
776 Come up with a clear and well-thought-out API concerning the features.
777
778 @item
779 Write the code to implement a feature and send us a patch.
780 @end itemize
781
782 (not that we're necessarily requiring you to write the code, but we can
783 always hope :)
784 @end quotation
785
786 @node Q1.2.1, Q1.2.2, Q1.1.3, Introduction
787 @unnumberedsec 1.2: Credits
788 @unnumberedsubsec Q1.2.1: Who wrote XEmacs?
789
790 XEmacs is the result of the time and effort of many people.  The
791 developers responsible for the 19.16/20.x releases are:
792
793 @itemize @bullet
794 @item @email{martin@@xemacs.org, Martin Buchholz}
795 @ifhtml
796 <br><img src="mrb.jpeg" alt="Portrait of Martin Buchholz"><br>
797 @end ifhtml
798
799
800 @item @email{steve@@xemacs.org, Steve Baur}
801
802 @ifhtml
803 <br><img src="steve.gif" alt="Portrait of Steve Baur"><br>
804 @end ifhtml
805
806
807 @item @email{hniksic@@xemacs.org, Hrvoje Niksic}
808
809 @ifhtml
810 <br><img src="hniksic.jpeg" alt="Portrait of Hrvoje Niksic"><br>
811 @end ifhtml
812
813 @end itemize
814
815 The developers responsible for the 19.14 release are:
816
817 @itemize @bullet
818 @item @email{cthomp@@xemacs.org, Chuck Thompson}
819 @ifhtml
820 <br><img src="cthomp.jpeg" alt="Portrait of Chuck Thompson"><br>
821 @end ifhtml
822
823 Chuck was Mr. XEmacs from 19.11 through 19.14, and is responsible
824 for XEmacs becoming a widely distributed program over the Internet.
825
826 @item @email{ben@@xemacs.org, Ben Wing}
827 @ifhtml
828 <br><img src="wing.gif" alt="Portrait of Ben Wing"><br>
829 @end ifhtml
830
831 @end itemize
832
833
834 @itemize @bullet
835 @item @email{jwz@@jwz.org, Jamie Zawinski}
836 @ifhtml
837 <br><img src="jwz.gif" alt="Portrait of Jamie Zawinski"><br>
838 @end ifhtml
839
840 Jamie Zawinski was Mr. Lucid Emacs from 19.0 through 19.10, the last
841 release actually named Lucid Emacs.  Richard Mlynarik was crucial to
842 most of those releases.
843
844 @item @email{mly@@adoc.xerox.com, Richard Mlynarik}
845 @end itemize
846
847 Along with many other contributors, partially enumerated in the
848 @samp{About XEmacs} option in the Help menu.
849
850 @node Q1.2.2, Q1.2.3, Q1.2.1, Introduction
851 @unnumberedsubsec Q1.2.2: Who contributed to this version of the FAQ?
852
853 The following people contributed valuable suggestions to building this
854 version of the FAQ (listed in alphabetical order):
855
856 @itemize @bullet
857 @item @email{steve@@xemacs.org, SL Baur}
858
859 @item @email{hniksic@@xemacs.org, Hrvoje Niksic}
860
861 @item @email{Aki.Vehtari@@hut.fi, Aki Vehtari}
862
863 @end itemize
864
865 @node Q1.2.3, Q1.3.1, Q1.2.2, Introduction
866 @unnumberedsubsec Q1.2.3: Who contributed to the FAQ in the past?
867
868 This is only a partial list, as many names were lost in a hard disk
869 crash some time ago.
870
871 @itemize @bullet
872 @item @email{binge@@aloft.att.com, Curtis.N.Bingham}
873
874 @item @email{rjc@@cogsci.ed.ac.uk, Richard Caley}
875
876 @item @email{cognot@@ensg.u-nancy.fr, Richard Cognot}
877
878 @item @email{wgd@@martigny.ai.mit.edu, William G. Dubuque}
879
880 @item @email{eeide@@cs.utah.edu, Eric Eide}
881
882 @item @email{cflatter@@nrao.edu, Chris Flatters}
883
884 @item @email{ginsparg@@adra.com, Evelyn Ginsparg}
885
886 @item @email{hall@@aplcenmp.apl.jhu.edu, Marty Hall}
887
888 @item @email{dkindred@@cmu.edu, Darrell Kindred}
889
890 @item @email{dmoore@@ucsd.edu, David Moore}
891
892 @item @email{arup+@@cmu.edu, Arup Mukherjee}
893
894 @item @email{nickel@@prz.tu-berlin.de, Juergen Nickelsen}
895
896 @item @email{powell@@csl.ncsa.uiuc.edu, Kevin R. Powell}
897
898 @item @email{dworkin@@ccs.neu.edu, Justin Sheehy}
899
900 @item @email{stig@@hackvan.com, Stig}
901
902 @item @email{Aki.Vehtari@@hut.fi, Aki Vehtari}
903 @end itemize
904
905 @node Q1.3.1, Q1.3.2, Q1.2.3, Introduction
906 @unnumberedsec 1.3: Internationalization
907 @unnumberedsubsec Q1.3.1: What is the status of XEmacs v20?
908
909 XEmacs v20 is the version of XEmacs that includes MULE (Asian-language)
910 support.  XEmacs 20.0 was released in February 1997, followed by XEmacs
911 20.2 in May, XEmacs 20.3 in November and XEmacs 20.4 in February 1998.  When compiled without MULE
912 support, 20.4 is approximately as stable as 19.16, and probably faster
913 (due to additional optimization work.)
914
915 As of XEmacs 20.3, version 20 is @emph{the} supported version of
916 XEmacs.  This means that 19.16 will optionally receive stability fixes
917 (if any), but that all the real development work will be done on the v20
918 tree.
919
920 The incompatible changes in XEmacs 20 include the additional byte-codes,
921 new primitive data types (@code{character}, @code{char-table}, and
922 @code{range-table}).  This means that the character-integer equivalence
923 inherent to all the previous Emacs and XEmacs releases no longer
924 applies.
925
926 However, to avoid breaking old code, many functions that should normally
927 accept characters work with integers, and vice versa.  For more
928 information, see the Lisp reference manual.  Here is a relevant excerpt,
929 for your convenience.
930
931 @quotation
932   In XEmacs version 19, and in all versions of FSF GNU Emacs, a
933 @dfn{character} in XEmacs Lisp is nothing more than an integer.
934 This is yet another holdover from XEmacs Lisp's derivation from
935 vintage-1980 Lisps; modern versions of Lisp consider this equivalence
936 a bad idea, and have separate character types.  In XEmacs version 20,
937 the modern convention is followed, and characters are their own
938 primitive types. (This change was necessary in order for @sc{mule},
939 i.e. Asian-language, support to be correctly implemented.)
940
941   Even in XEmacs version 20, remnants of the equivalence between
942 characters and integers still exist; this is termed the @dfn{char-int
943 confoundance disease}.  In particular, many functions such as @code{eq},
944 @code{equal}, and @code{memq} have equivalent functions (@code{old-eq},
945 @code{old-equal}, @code{old-memq}, etc.) that pretend like characters
946 are integers are the same.  Byte code compiled under any version 19
947 Emacs will have all such functions mapped to their @code{old-} equivalents
948 when the byte code is read into XEmacs 20.  This is to preserve
949 compatibility -- Emacs 19 converts all constant characters to the equivalent
950 integer during byte-compilation, and thus there is no other way to preserve
951 byte-code compatibility even if the code has specifically been written
952 with the distinction between characters and integers in mind.
953
954   Every character has an equivalent integer, called the @dfn{character
955 code}.  For example, the character @kbd{A} is represented as the
956 @w{integer 65}, following the standard @sc{ascii} representation of
957 characters.  If XEmacs was not compiled with @sc{mule} support, the
958 range of this integer will always be 0 to 255 -- eight bits, or one
959 byte. (Integers outside this range are accepted but silently truncated;
960 however, you should most decidedly @emph{not} rely on this, because it
961 will not work under XEmacs with @sc{mule} support.)  When @sc{mule}
962 support is present, the range of character codes is much
963 larger. (Currently, 19 bits are used.)
964
965   FSF GNU Emacs uses kludgy character codes above 255 to represent
966 keyboard input of @sc{ascii} characters in combination with certain
967 modifiers.  XEmacs does not use this (a more general mechanism is
968 used that does not distinguish between @sc{ascii} keys and other
969 keys), so you will never find character codes above 255 in a
970 non-@sc{mule} XEmacs.
971
972   Individual characters are not often used in programs.  It is far more
973 common to work with @emph{strings}, which are sequences composed of
974 characters.
975 @end quotation
976
977 @node Q1.3.2, Q1.3.3, Q1.3.1, Introduction
978 @unnumberedsubsec Q1.3.2: What is the status of Asian-language support, aka MULE?
979
980 MULE support is now available for UNIX versions of XEmacs.  
981
982 If you would like to help, you may want to join the
983 @email{xemacs-mule@@xemacs.org} mailing list.  Especially needed are
984 people who speak/write languages other than English, who are willing to
985 use XEmacs/MULE regularly, and have some experience with Elisp.
986
987 @xref{Q1.1.2}.
988
989 @node Q1.3.3, Q1.3.4, Q1.3.2, Introduction
990 @unnumberedsubsec Q1.3.3: How do I type non-ASCII characters?
991
992 See question 3.5.7 (@pxref{Q3.5.7}) in part 3 of this FAQ.
993
994 @node Q1.3.4, Q1.3.5, Q1.3.3, Introduction
995 @unnumberedsubsec Q1.3.4: Can XEmacs messages come out in a different language?
996
997 The message-catalog support has mostly been written but doesn't
998 currently work.  The first release of XEmacs 20 will @emph{not} support
999 it.  However, menubar localization @emph{does} work, even in 19.14.  To
1000 enable it, add to your @file{Emacs} file entries like this:
1001
1002 @example
1003 Emacs*XlwMenu.resourceLabels:                   True
1004 Emacs*XlwMenu.file.labelString:                 Fichier
1005 Emacs*XlwMenu.openInOtherWindow.labelString:    In anderem Fenster offnen
1006 @end example
1007
1008 The name of the resource is derived from the non-localized entry by
1009 removing punctuation and capitalizing as above.
1010
1011 @node Q1.3.5, Q1.3.6, Q1.3.4, Introduction
1012 @unnumberedsubsec Q1.3.5: Please explain the various input methods in MULE/XEmacs 20.0
1013
1014 @email{morioka@@jaist.ac.jp, MORIOKA Tomohiko} writes:
1015
1016 @quotation
1017 Original Mule supports the following input methods: Wnn4, Wnn6, Canna, SJ3
1018 and XIM. Interfaces for Wnn and SJ3 uses the @code{egg} user
1019 interface. Interface for Canna does not use @samp{egg}. I don't know
1020 about XIM. It is to support ATOK, of course, it may work for another
1021 servers.
1022
1023 Wnn supports Japanese, Chinese and Korean. It is made by OMRON and Kyôto
1024 university. It is a powerful and complex system.  Wnn4 is free and Wnn6
1025 is not free.
1026
1027 Canna supports only Japanese. It is made by NEC. It is a simple and
1028 powerful system. Canna uses only grammar (Wnn uses grammar and
1029 probability between words), so I think Wnn is cleverer than Canna,
1030 however Canna users made a good grammar and dictionary.  So for standard
1031 modern Japanese, Canna seems cleverer than Wnn4. In addition, the UNIX
1032 version of Canna is free (now there is a Microsoft Windows version).
1033
1034 SJ3 supports only Japanese. It is made by Sony.  XIM supports was made
1035 to use ATOK (a major input method in personal computer world).  XIM is
1036 the standard for accessing input methods bundled in Japanese versions of
1037 Solaris.  (XEmacs 20 will support XIM input).
1038
1039 Egg consists of following parts:
1040
1041 @enumerate
1042 @item
1043 Input character Translation System (ITS) layer.
1044 It translates ASCII inputs to Kana/PinYin/Hangul characters.
1045
1046 @item
1047 Kana/PinYin/Hangul to Kanji transfer layer.
1048 It is interface layer for network Kana-Kanji server (Wnn and Sj3).
1049 @end enumerate
1050
1051 These input methods are modal, namely there are mode, alphabet mode and
1052 Kana-Kanji transfer mode.  However there are mode-less input methods for
1053 Egg and Canna.  @samp{Boiled-egg} is a mode-less input method running on
1054 Egg.  For Canna, @samp{canna.el} has a tiny boiled-egg like command,
1055 @code{(canna-boil)}, and there are some boiled-egg like utilities.  In
1056 addition, it was planned to make an abstraction for all transfer type
1057 input methods.  However authors of input methods are busy, so maybe this
1058 plan is stopped.  Perhaps after Mule merged GNU Emacs will be released,
1059 it will be continued.
1060 @end quotation
1061
1062 @node Q1.3.6, Q1.3.7, Q1.3.5, Introduction
1063 @unnumberedsubsec Q1.3.6: How do I portably code for MULE/XEmacs 20?
1064
1065 @email{morioka@@jaist.ac.jp, MORIOKA Tomohiko} writes:
1066
1067 @quotation
1068 MULE and XEmacs are quite different. So the application
1069 implementor must write separate code for these mule variants.
1070
1071 MULE and the next version of Emacs are similar but the symbols are very
1072 different---requiring separate code as well.
1073
1074 Namely we must support 3 kinds of mule variants and 4 or 5 or 6 kinds of
1075 emacs variants... (;_;) I'm shocked, so I wrote a wrapper package called
1076 @code{emu} to provide a common interface.
1077
1078 I have the following suggestions about dealing with mule variants:
1079
1080 @itemize @bullet
1081 @item
1082 @code{(featurep 'mule)} @code{t} on all mule variants
1083
1084 @item
1085 @code{(boundp 'MULE)} is @code{t} on only MULE.  Maybe the next version
1086 of Emacs will not have this symbol.
1087
1088 @item
1089 MULE has a variable @code{mule-version}.  Perhaps the next version of
1090 Emacs will have this variable as well.
1091 @end itemize
1092
1093 Following is a sample to distinguish mule variants:
1094
1095 @lisp
1096 (if (featurep 'mule)
1097     (cond ((boundp 'MULE)
1098            ;; for original Mule
1099            )
1100           ((string-match "XEmacs" emacs-version)
1101            ;; for XEmacs with Mule
1102            )
1103           (t
1104            ;; for next version of Emacs
1105            ))
1106   ;; for old emacs variants
1107   )
1108 @end lisp
1109 @end quotation
1110
1111 @node Q1.3.7, Q1.4.1, Q1.3.6, Introduction
1112 @unnumberedsubsec Q1.3.7: How about Cyrillic Modes?
1113
1114 @email{ilya@@math.ohio-state.edu, Ilya Zakharevich} writes:
1115
1116 @quotation
1117 There is a cyrillic mode in the file @file{mysetup.zip} in
1118 @iftex
1119 @*
1120 @end iftex
1121 @uref{ftp://ftp.math.ohio-state.edu/pub/users/ilya/emacs/}.  This is a
1122 modification to @email{ava@@math.jhu.ed, Valery Alexeev's} @file{russian.el}
1123 which can be obtained from
1124 @end quotation
1125
1126 @uref{http://ftpsearch.ntnu.no/?query=russian.el.Z}.
1127 @c dead link above
1128
1129 @email{d.barsky@@ee.surrey.ac.uk, Dima Barsky} writes:
1130
1131 @quotation
1132 There is another cyrillic mode for both GNU Emacs and XEmacs by
1133 @email{manin@@camelot.mssm.edu, Dmitrii
1134 (Mitya) Manin} at
1135 @iftex
1136
1137 @end iftex
1138 @uref{http://kulichki-lat.rambler.ru/centrolit/manin/cyr.el}.
1139 @c Link above, <URL:http://camelot.mssm.edu/~manin/cyr.el> was dead.
1140 @c Changed to russian host instead
1141 @end quotation
1142
1143 @email{rebecca.ore@@op.net, Rebecca Ore} writes:
1144
1145 @quotation
1146 The fullest resource I found on Russian language use (in and out of
1147 XEmacs) is @uref{http://sunsite.oit.unc.edu/sergei/Software/Software.html}
1148 @end quotation
1149
1150 @node Q1.4.1, Q1.4.2, Q1.3.7, Introduction
1151 @unnumberedsec 1.4: Getting Started, Backing up & Recovery
1152 @unnumberedsubsec Q1.4.1: What is a @file{.emacs} and is there a sample one?
1153
1154 The @file{.emacs} file is used to customize XEmacs to your tastes.  No
1155 two are alike, nor are they expected to be alike, but that's the point.
1156 The XEmacs distribution contains an excellent starter example in the etc
1157 directory called @file{sample.emacs}.  Copy this file from there to your
1158 home directory and rename it @file{.emacs}.  Then edit it to suit.
1159
1160 Starting with 19.14, you may bring the @file{sample.emacs} into an
1161 XEmacs buffer by selecting @samp{Help->Sample .emacs} from the menubar.
1162 To determine the location of the @file{etc} directory type the command
1163 @kbd{C-h v data-directory @key{RET}}.
1164
1165 @node Q1.4.2, Q1.4.3, Q1.4.1, Introduction
1166 @unnumberedsubsec Q1.4.2: Can I use the same @file{.emacs} with the other Emacs?
1167
1168 Yes.  The sample @file{.emacs} included in the XEmacs distribution will
1169 show you how to handle different versions and flavors of Emacs.
1170
1171 @node Q1.4.3, Q1.4.4, Q1.4.2, Introduction
1172 @unnumberedsubsec Q1.4.3: Any good tutorials around?
1173
1174 There's the XEmacs tutorial available from the Help Menu under
1175 @samp{Basics->Tutorials}, or by typing @kbd{C-h t}. To check whether
1176 it's available in a non-english language, type @kbd{C-u C-h t TAB}, type
1177 the first letters of your preferred language, then type @key{RET}.
1178
1179 @comment There's an Emacs Lisp tutorial at
1180 @comment 
1181 @comment @example
1182 @comment @uref{ftp://prep.ai.mit.edu/pub/gnu/emacs-lisp-intro-1.04.tar.gz}.
1183 @comment @end example
1184 @comment 
1185 @comment @email{erik@@petaxp.rug.ac.be, Erik Sundermann} has made a tutorial web
1186 @comment page at
1187 @comment @iftex
1188 @comment @*
1189 @comment @end iftex
1190 @comment @uref{http://petaxp.rug.ac.be/~erik/xemacs/}.
1191
1192 @node Q1.4.4, Q1.4.5, Q1.4.3, Introduction
1193 @unnumberedsubsec Q1.4.4: May I see an example of a useful XEmacs Lisp function?
1194
1195 The following function does a little bit of everything useful.  It does
1196 something with the prefix argument, it examines the text around the
1197 cursor, and it's interactive so it may be bound to a key.  It inserts
1198 copies of the current word the cursor is sitting on at the cursor.  If
1199 you give it a prefix argument: @kbd{C-u 3 M-x double-word} then it will
1200 insert 3 copies.
1201
1202 @lisp
1203 (defun double-word (count)
1204   "Insert a copy of the current word underneath the cursor"
1205   (interactive "*p")
1206   (let (here there string)
1207     (save-excursion
1208       (forward-word -1)
1209       (setq here (point))
1210       (forward-word 1)
1211       (setq there (point))
1212       (setq string (buffer-substring here there)))
1213     (while (>= count 1)
1214       (insert string)
1215       (decf count))))
1216 @end lisp
1217
1218 The best way to see what is going on here is to let XEmacs tell you.
1219 Put the code into an XEmacs buffer, and do a @kbd{C-h f} with the cursor
1220 sitting just to the right of the function you want explained.  Eg.  move
1221 the cursor to the SPACE between @code{interactive} and @samp{"*p"} and
1222 hit @kbd{C-h f} to see what the function @code{interactive} does.  Doing
1223 this will tell you that the @code{*} requires a writable buffer, and
1224 @code{p} converts the prefix argument to a number, and
1225 @code{interactive} allows you to execute the command with @kbd{M-x}.
1226
1227 @node Q1.4.5, Q1.4.6, Q1.4.4, Introduction
1228 @unnumberedsubsec Q1.4.5: And how do I bind it to a key?
1229
1230 To bind to a key do:
1231
1232 @lisp
1233 (global-set-key "\C-cd" 'double-word)
1234 @end lisp
1235
1236 Or interactively, @kbd{M-x global-set-key} and follow the prompts.
1237
1238 @node Q1.4.6, Q1.4.7, Q1.4.5, Introduction
1239 @unnumberedsubsec Q1.4.6: What's the difference between a macro and a function?
1240
1241 Quoting from the Lisp Reference (a.k.a @dfn{Lispref}) Manual:
1242
1243 @dfn{Macros} enable you to define new control constructs and other
1244 language features.  A macro is defined much like a function, but instead
1245 of telling how to compute a value, it tells how to compute another Lisp
1246 expression which will in turn compute the value.  We call this
1247 expression the @dfn{expansion} of the macro.
1248
1249 Macros can do this because they operate on the unevaluated expressions
1250 for the arguments, not on the argument values as functions do.  They can
1251 therefore construct an expansion containing these argument expressions
1252 or parts of them.
1253
1254 Do not confuse the two terms with @dfn{keyboard macros}, which are
1255 another matter, entirely.  A keyboard macro is a key bound to several
1256 other keys.  Refer to manual for details.
1257
1258 @node Q1.4.7, , Q1.4.6, Introduction
1259 @unnumberedsubsec Q1.4.7: How come options saved with 19.13 don't work with 19.14 or later?
1260
1261 There's a problem with options of the form:
1262
1263 @lisp
1264 (add-spec-list-to-specifier (face-property 'searchm-field 'font)
1265                             '((global (nil))))
1266 @end lisp
1267
1268 saved by a 19.13 XEmacs that causes a 19.14 XEmacs grief.  You must
1269 delete these options.  XEmacs 19.14 and later no longer write the
1270 options directly to @file{.emacs} which should allow us to deal with
1271 version incompatibilities better in the future.
1272
1273 Options saved under XEmacs 19.13 are protected by code that specifically
1274 requires a version 19 XEmacs.  This won't be a problem unless you're
1275 using XEmacs v20.  You should consider changing the code to read:
1276
1277 @lisp
1278 (cond
1279  ((and (string-match "XEmacs" emacs-version)
1280        (boundp 'emacs-major-version)
1281        (or (and (= emacs-major-version 19)
1282                 (>= emacs-minor-version 12))
1283            (>= emacs-major-version 20)))
1284   ...
1285   ))
1286 @end lisp
1287
1288 @node Installation, Customization, Introduction, Top
1289 @unnumbered 2 Installation and Trouble Shooting
1290
1291 This is part 2 of the XEmacs Frequently Asked Questions list.  This
1292 section is devoted to Installation, Maintenance and Trouble Shooting.
1293
1294 @menu
1295 Installation:
1296 * Q2.0.1::      Running XEmacs without installing.
1297 * Q2.0.2::      XEmacs is too big.
1298 * Q2.0.3::      Compiling XEmacs with Netaudio.
1299 * Q2.0.4::      Problems with Linux and ncurses.
1300 * Q2.0.5::      Do I need X11 to run XEmacs?
1301 * Q2.0.6::      I'm having strange crashes.  What do I do?
1302 * Q2.0.7::      Libraries in non-standard locations.
1303 * Q2.0.8::      can't resolve symbol _h_errno
1304 * Q2.0.9::      Where do I find external libraries?
1305 * Q2.0.10::     After I run configure I find a coredump, is something wrong?
1306 * Q2.0.11::     XEmacs can't resolve host names.
1307 * Q2.0.12::     Why can't I strip XEmacs?
1308 * Q2.0.13::     Can't link XEmacs on Solaris with Gcc.
1309 * Q2.0.14::     Make on HP/UX 9 fails after linking temacs
1310
1311 Trouble Shooting:
1312 * Q2.1.1::      XEmacs just crashed on me!
1313 * Q2.1.2::      Cryptic Minibuffer messages.
1314 * Q2.1.3::      Translation Table Syntax messages at Startup.
1315 * Q2.1.4::      Startup warnings about deducing proper fonts?
1316 * Q2.1.5::      XEmacs cannot connect to my X Terminal.
1317 * Q2.1.6::      XEmacs just locked up my Linux X server.
1318 * Q2.1.7::      HP Alt key as Meta.
1319 * Q2.1.8::      got (wrong-type-argument color-instance-p nil)!
1320 * Q2.1.9::      XEmacs causes my OpenWindows 3.0 server to crash.
1321 * Q2.1.10::     Warnings from incorrect key modifiers.
1322 * Q2.1.11::     Can't instantiate image error... in toolbar
1323 * Q2.1.12::     Regular Expression Problems on DEC OSF1.
1324 * Q2.1.13::     HP/UX 10.10 and @code{create_process} failure
1325 * Q2.1.14::     @kbd{C-g} doesn't work for me.  Is it broken?
1326 * Q2.1.15::     How to debug an XEmacs problem with a debugger.
1327 * Q2.1.16::     XEmacs crashes in @code{strcat} on HP/UX 10.
1328 * Q2.1.17::     @samp{Marker does not point anywhere}.
1329 * Q2.1.18::     19.14 hangs on HP/UX 10.10.
1330 * Q2.1.19::     XEmacs does not follow the local timezone.
1331 * Q2.1.20::     @samp{Symbol's function definition is void: hkey-help-show.}
1332 * Q2.1.21::     Every so often the XEmacs frame freezes.
1333 * Q2.1.22::     XEmacs seems to take a really long time to do some things.
1334 * Q2.1.23::     Movemail on Linux does not work for XEmacs 19.15 and later.
1335 * Q2.1.24::     XEmacs won't start without network. (NEW)
1336 @end menu
1337
1338 @node Q2.0.1, Q2.0.2, Installation, Installation
1339 @unnumberedsec 2.0: Installation
1340 @unnumberedsubsec Q2.0.1: Running XEmacs without installing
1341 The @file{INSTALL} file says that up to 108 MB of space is needed
1342 temporarily during installation!  How can I just try it out?
1343
1344 XEmacs will run in place without requiring installation and copying of
1345 the Lisp directories, and without having to specify a special build-time
1346 flag.  It's the copying of the Lisp directories that requires so much
1347 space.  XEmacs is largely written in Lisp.
1348
1349 A good method is to make a shell alias for xemacs:
1350
1351 @example
1352 alias xemacs=/i/xemacs-20.2/src/xemacs
1353 @end example
1354
1355 (You will obviously use whatever directory you downloaded the source
1356 tree to instead of @file{/i/xemacs-20.2}).
1357
1358 This will let you run XEmacs without massive copying.
1359
1360 @node Q2.0.2, Q2.0.3, Q2.0.1, Installation
1361 @unnumberedsubsec Q2.0.2: XEmacs is too big
1362
1363 Although this entry has been written for XEmacs 19.13, most of it still
1364 stands true.
1365
1366 @email{steve@@xemacs.org, Steve Baur} writes:
1367
1368 @quotation
1369 The 45MB of space required by the installation directories can be
1370 reduced dramatically if desired.  Gzip all the .el files.  Remove all
1371 the packages you'll never want to use (or even ones you do like the two
1372 obsolete mailcrypts and Gnus 4 in 19.13).  Remove the TexInfo manuals.
1373 Remove the Info (and use just hardcopy versions of the manual).  Remove
1374 most of the stuff in etc.  Remove or gzip all the source code.  Gzip or
1375 remove the C source code.  Configure it so that copies are not made of
1376 the support lisp.  I'm not advocating any of these things, just pointing
1377 out ways to reduce the disk requirements if desired.
1378
1379 Now examine the space used by directory:
1380
1381 @format
1382 0       /usr/local/bin/xemacs
1383 2048    /usr/local/bin/xemacs-19.13
1384
1385 1546    /usr/local/lib/xemacs-19.13/i486-miranova-sco3.2v4.2
1386 1158    /usr/local/lib/xemacs-19.13/i486-unknown-linux1.2.13
1387 @end format
1388
1389 You need to keep these.  XEmacs isn't stripped by default in
1390 installation, you should consider stripping.  That will save you about
1391 5MB right there.
1392
1393 @format
1394 207     /usr/local/lib/xemacs-19.13/etc/w3
1395 122     /usr/local/lib/xemacs-19.13/etc/sounds
1396 18      /usr/local/lib/xemacs-19.13/etc/sparcworks
1397 159     /usr/local/lib/xemacs-19.13/etc/vm
1398 6       /usr/local/lib/xemacs-19.13/etc/e
1399 21      /usr/local/lib/xemacs-19.13/etc/eos
1400 172     /usr/local/lib/xemacs-19.13/etc/toolbar
1401 61      /usr/local/lib/xemacs-19.13/etc/ns
1402 43      /usr/local/lib/xemacs-19.13/etc/gnus
1403 @end format
1404
1405 These are support directories for various packages.  In general they
1406 match a directory under ./xemacs-19.13/lib/xemacs-19.13/lisp/.  If you
1407 do not require the package, you may delete or gzip the support too.
1408
1409 @format
1410 1959    /usr/local/lib/xemacs-19.13/etc
1411 175     /usr/local/lib/xemacs-19.13/lisp/bytecomp
1412 340     /usr/local/lib/xemacs-19.13/lisp/calendar
1413 342     /usr/local/lib/xemacs-19.13/lisp/comint
1414 517     /usr/local/lib/xemacs-19.13/lisp/dired
1415 42      /usr/local/lib/xemacs-19.13/lisp/electric
1416 212     /usr/local/lib/xemacs-19.13/lisp/emulators
1417 238     /usr/local/lib/xemacs-19.13/lisp/energize
1418 289     /usr/local/lib/xemacs-19.13/lisp/gnus
1419 457     /usr/local/lib/xemacs-19.13/lisp/ilisp
1420 1439    /usr/local/lib/xemacs-19.13/lisp/modes
1421 2276    /usr/local/lib/xemacs-19.13/lisp/packages
1422 1040    /usr/local/lib/xemacs-19.13/lisp/prim
1423 176     /usr/local/lib/xemacs-19.13/lisp/pcl-cvs
1424 154     /usr/local/lib/xemacs-19.13/lisp/rmail
1425 3       /usr/local/lib/xemacs-19.13/lisp/epoch
1426 45      /usr/local/lib/xemacs-19.13/lisp/term
1427 860     /usr/local/lib/xemacs-19.13/lisp/utils
1428 851     /usr/local/lib/xemacs-19.13/lisp/vm
1429 13      /usr/local/lib/xemacs-19.13/lisp/vms
1430 157     /usr/local/lib/xemacs-19.13/lisp/x11
1431 19      /usr/local/lib/xemacs-19.13/lisp/tooltalk
1432 14      /usr/local/lib/xemacs-19.13/lisp/sunpro
1433 291     /usr/local/lib/xemacs-19.13/lisp/games
1434 198     /usr/local/lib/xemacs-19.13/lisp/edebug
1435 619     /usr/local/lib/xemacs-19.13/lisp/w3
1436 229     /usr/local/lib/xemacs-19.13/lisp/eos
1437 55      /usr/local/lib/xemacs-19.13/lisp/iso
1438 59      /usr/local/lib/xemacs-19.13/lisp/mailcrypt
1439 187     /usr/local/lib/xemacs-19.13/lisp/eterm
1440 356     /usr/local/lib/xemacs-19.13/lisp/ediff
1441 408     /usr/local/lib/xemacs-19.13/lisp/hyperbole/kotl
1442 1262    /usr/local/lib/xemacs-19.13/lisp/hyperbole
1443 247     /usr/local/lib/xemacs-19.13/lisp/hm--html-menus
1444 161     /usr/local/lib/xemacs-19.13/lisp/mh-e
1445 299     /usr/local/lib/xemacs-19.13/lisp/viper
1446 53      /usr/local/lib/xemacs-19.13/lisp/oobr/tree-x
1447 4       /usr/local/lib/xemacs-19.13/lisp/oobr/tree-nx/English.lproj/DocWindow.nib
1448 3       /usr/local/lib/xemacs-19.13/lisp/oobr/tree-nx/English.lproj/InfoPanel.nib
1449 3       /usr/local/lib/xemacs-19.13/lisp/oobr/tree-nx/English.lproj/TreeView.nib
1450 11      /usr/local/lib/xemacs-19.13/lisp/oobr/tree-nx/English.lproj
1451 53      /usr/local/lib/xemacs-19.13/lisp/oobr/tree-nx
1452 466     /usr/local/lib/xemacs-19.13/lisp/oobr
1453 14142   /usr/local/lib/xemacs-19.13/lisp
1454 @end format
1455
1456 These are all Emacs Lisp source code and bytecompiled object code.  You
1457 may safely gzip everything named *.el here.  You may remove any package
1458 you don't use.  @emph{Nothing bad will happen if you delete a package
1459 that you do not use}.  You must be sure you do not use it though, so be
1460 conservative at first.
1461
1462 Possible candidates for deletion include w3 (newer versions exist, or
1463 you may just use Lynx or Netscape for web browsing), games, hyperbole,
1464 mh-e, hm--html-menus (better packages exist), vm, viper, oobr, gnus (new
1465 versions exist), etc.  Ask yourself, @emph{Do I ever want to use this
1466 package?}  If the answer is no, then it is a candidate for removal.
1467
1468 First, gzip all the .el files.  Then go about package by package and
1469 start gzipping the .elc files.  Then run XEmacs and do whatever it is
1470 you normally do.  If nothing bad happens, then delete the directory.  Be
1471 conservative about deleting directories, and it would be handy to have a
1472 backup tape around in case you get too zealous.
1473
1474 @file{prim}, @file{modes}, @file{packages}, and @file{utils} are four
1475 directories you definitely do @strong{not} want to delete, although
1476 certain packages can be removed from them if you do not use them.
1477
1478 @example
1479 1972    /usr/local/lib/xemacs-19.13/info
1480 @end example
1481
1482 These are online texinfo sources.  You may either gzip them or remove
1483 them.  In either case, @kbd{C-h i} (info mode) will no longer work.
1484
1485 @example
1486 20778   /usr/local/lib/xemacs-19.13
1487 @end example
1488
1489 The 20MB achieved is less than half of what the full distribution takes up,
1490 @strong{and} can be achieved without deleting a single file.
1491 @end quotation
1492
1493 @email{boffi@@hp735.stru.polimi.it, Giacomo Boffi} provides this procedure:
1494
1495 @quotation
1496 Substitute @file{/usr/local/lib/} with the path where the xemacs tree is
1497 rooted, then use this script:
1498
1499 @example
1500 #!/bin/sh
1501
1502 r=/usr/local/lib/xemacs-19.13/lisp
1503
1504 cd $r ; rm -f cmpr ; touch cmpr
1505
1506 du -s .
1507
1508 for d in * ; do
1509   if test -d $d ; then
1510     cd $d
1511     for f in *.el ; do
1512 #     compress (remove) only (ONLY) the sources that have a
1513 #     corresponding compiled file --- do not (DO NOT)
1514 #     touch other sources
1515       if test -f $@{f@}c ; then gzip -v9 $f >> $r/cmpr ; fi
1516     done
1517     cd ..
1518   fi
1519 done
1520
1521 du -s .
1522 @end example
1523
1524 A step beyond would be substituting @samp{rm -f} for @samp{gzip -v9},
1525 but you have to be desperate for removing the sources (remember that
1526 emacs can access compressed files transparently).
1527
1528 Also, a good megabyte could easily be trimmed from the $r/../etc
1529 directory, e.g., the termcap files, some O+NEWS, others that I don't
1530 remember as well.
1531 @end quotation
1532
1533 @quotation
1534 XEmacs 21.0 will unbundle the lisp hierarchy and allow the installer
1535 to choose exactly how much support code gets installed.
1536 @end quotation
1537
1538 @node Q2.0.3, Q2.0.4, Q2.0.2, Installation
1539 @unnumberedsubsec Q2.0.3: Compiling XEmacs with Netaudio.
1540
1541 What is the best way to compile XEmacs with the netaudio system, since I
1542 have got the netaudio system compiled but installed at a weird place, I
1543 am not root.  Also in the READMEs it does not say anything about
1544 compiling with the audioserver?
1545
1546 You should only need to add some stuff to the configure command line.
1547 To tell it to compile in netaudio support: @samp{--with-sound=both}, or
1548 @samp{--with-sound=nas} if you don't want native sound support for some
1549 reason.) To tell it where to find the netaudio includes and libraries:
1550
1551 @example
1552 --site-libraries=WHATEVER
1553 --site-includes=WHATEVER
1554 @end example
1555
1556 Then (fingers crossed) it should compile and it will use netaudio if you
1557 have a server running corresponding to the X server. The netaudio server
1558 has to be there when XEmacs starts. If the netaudio server goes away and
1559 another is run, XEmacs should cope (fingers crossed, error handling in
1560 netaudio isn't perfect).
1561
1562 BTW, netaudio has been renamed as it has a name clash with something
1563 else, so if you see references to NAS or Network Audio System, it's the
1564 same thing.  It also might be found at
1565 @uref{ftp://ftp.x.org/contrib/audio/nas/}.
1566
1567 @node Q2.0.4, Q2.0.5, Q2.0.3, Installation
1568 @unnumberedsubsec Q2.0.4: Problems with Linux and ncurses.
1569
1570 On Linux 1.3.98 with termcap 2.0.8 and the ncurses that came with libc
1571 5.2.18, XEmacs 20.0b20 is unable to open a tty device:
1572
1573 @example
1574 src/xemacs -nw -q
1575 Initialization error:
1576 @iftex
1577 @*
1578 @end iftex
1579 Terminal type `xterm' undefined (or can't access database?)
1580 @end example
1581
1582 @email{ben@@xemacs.org, Ben Wing} writes:
1583
1584 @quotation
1585 Your ncurses configuration is messed up.  Your /usr/lib/terminfo is a
1586 bad pointer, perhaps to a CD-ROM that is not inserted.
1587 @end quotation
1588
1589 @node Q2.0.5, Q2.0.6, Q2.0.4, Installation
1590 @unnumberedsubsec Q2.0.5: Do I need X11 to run XEmacs?
1591
1592 No.  The name @dfn{XEmacs} is unfortunate in the sense that it is
1593 @strong{not} an X Window System-only version of Emacs.  Starting with
1594 19.14 XEmacs has full color support on a color-capable character
1595 terminal.
1596
1597 @node Q2.0.6, Q2.0.7, Q2.0.5, Installation
1598 @unnumberedsubsec Q2.0.6: I'm having strange crashes.  What do I do?
1599
1600 There have been a variety of reports of crashes due to compilers with
1601 buggy optimizers.  Please see the @file{PROBLEMS} file that comes with
1602 XEmacs to read what it says about your platform.
1603
1604 @node Q2.0.7, Q2.0.8, Q2.0.6, Installation
1605 @unnumberedsubsec Q2.0.7: Libraries in non-standard locations
1606
1607 I have x-faces, jpeg, xpm etc. all in different places.  I've tried
1608 space-separated, comma-separated, several --site-libraries, all to no
1609 avail.
1610
1611 @example
1612 --site-libraries='/path/one /path/two /path/etc'
1613 @end example
1614
1615 @node Q2.0.8, Q2.0.9, Q2.0.7, Installation
1616 @unnumberedsubsec Q2.0.8: can't resolve symbol _h_errno
1617
1618 You are using the Linux/ELF distribution of XEmacs 19.14, and your ELF
1619 libraries are out of date.  You have the following options:
1620
1621 @enumerate
1622 @item
1623 Upgrade your libc to at least 5.2.16 (better is 5.2.18, 5.3.12, or
1624 5.4.10).
1625
1626 @item
1627 Patch the XEmacs binary by replacing all occurrences of
1628 @samp{_h_errno^@@} with
1629 @iftex
1630 @*
1631 @end iftex
1632 @samp{h_errno^@@^@@}.  Any version of Emacs will
1633 suffice.  If you don't understand how to do this, don't do it.
1634
1635 @item
1636 Rebuild XEmacs yourself -- any working ELF version of libc should be
1637 O.K.
1638 @end enumerate
1639
1640 @email{hniksic@@xemacs.org, Hrvoje Niksic} writes:
1641
1642 @quotation
1643 Why not use a Perl one-liner for No. 2?
1644
1645 @example
1646 perl -pi -e 's/_h_errno\0/h_errno\0\0/g' \
1647 /usr/local/bin/xemacs-19.14
1648 @end example
1649
1650 NB: You @emph{must} patch @file{/usr/local/bin/xemacs-19.14}, and not
1651 @file{xemacs} because @file{xemacs} is a link to @file{xemacs-19.14};
1652 the Perl @samp{-i} option will cause unwanted side-effects if applied to
1653 a symbolic link.
1654 @end quotation
1655
1656 @email{steve@@xemacs.org, SL Baur} writes:
1657
1658 @quotation
1659 If you build against a recent libc-5.4 (late enough to have caused
1660 problems earlier in the beta cycle) and then run with an earlier version
1661 of libc, you get a
1662
1663 @example
1664 $ xemacs
1665 xemacs: can't resolve symbol '__malloc_hook'
1666 zsh: 7942 segmentation fault (core dumped)  xemacs
1667 @end example
1668
1669 (Example binary compiled against libc-5.4.23 and run with libc-5.4.16).
1670
1671 The solution is to upgrade to at least libc-5.4.23.  Sigh.  Drat.
1672 @end quotation
1673
1674 @node Q2.0.9, Q2.0.10, Q2.0.8, Installation
1675 @unnumberedsubsec Q2.0.9: Where do I find external libraries?
1676
1677 All external libraries used by XEmacs can be found at the XEmacs FTP
1678 site
1679 @iftex
1680 @*
1681 @end iftex
1682 @uref{ftp://ftp.xemacs.org/pub/xemacs/aux/}.
1683
1684 @c Changed June Link above, <URL:ftp://ftp.xemacs.org/pub/aux/> was dead.
1685 @c This list is a pain in the you-know-what to keep in synch with the
1686 @c world.
1687 The canonical locations (at the time of this writing) are as follows:
1688
1689 @table @asis
1690 @item JPEG
1691 @uref{ftp://ftp.uu.net/graphics/jpeg/}.  Version 6a is current.
1692 @c Check from host with legal IP address
1693 @item XPM
1694 @uref{ftp://ftp.x.org/contrib/libraries/}.  Version 3.4j is current.
1695 Older versions of this package are known to cause XEmacs crashes.
1696
1697 @item TIFF
1698 @uref{ftp://ftp.sgi.com/graphics/tiff/}.  v3.4 is current.  The latest
1699 beta is v3.4b035.  There is a HOWTO here.
1700
1701 @item PNG
1702 @uref{ftp://ftp.uu.net/graphics/png/}.  0.89c is current.  XEmacs
1703 requires a fairly recent version to avoid using temporary files.
1704 @c Check from host with legal IP address
1705
1706 @uref{ftp://swrinde.nde.swri.edu/pub/png/src/}
1707
1708 @item Compface
1709 @uref{ftp://ftp.cs.indiana.edu/pub/faces/compface/}.  This library has
1710 been frozen for about 6 years, and is distributed without version
1711 numbers.  @emph{It should be compiled with the same options that X11 was
1712 compiled with on your system}.  The version of this library at
1713 XEmacs.org includes the @file{xbm2xface.pl} script, written by
1714 @email{stig@@hackvan.com}, which may be useful when generating your own xface.
1715
1716 @item NAS
1717 @uref{ftp://ftp.x.org/contrib/audio/nas/}.
1718 Version 1.2p5 is current.  There is a FAQ here.
1719 @end table
1720
1721 @node Q2.0.10, Q2.0.11, Q2.0.9, Installation
1722 @unnumberedsubsec Q2.0.10: After I run configure I find a core dump, is something wrong?
1723
1724 Not necessarily.  If you have GNU sed 3.0 you should downgrade it to
1725 2.05.  From the @file{README} at prep.ai.mit.edu:
1726
1727 @quotation
1728 sed 3.0 has been withdrawn from distribution.  It has major revisions,
1729 which mostly seem to be improvements; but it turns out to have bugs too
1730 which cause trouble in some common cases.
1731
1732 Tom Lord won't be able to work fixing the bugs until May.  So in the
1733 mean time, we've decided to withdraw sed 3.0 from distribution and make
1734 version 2.05 once again the recommended version.
1735 @end quotation
1736
1737 It has also been observed that the vfork test on Solaris will leave a
1738 core dump.
1739
1740 @node Q2.0.11, Q2.0.12, Q2.0.10, Installation
1741 @unnumberedsubsec Q2.0.11: XEmacs doesn't resolve hostnames.
1742
1743 This is the result of a long-standing problem with SunOS and the fact
1744 that stock SunOS systems do not ship with DNS resolver code in libc.
1745
1746 @email{ckd@@loiosh.kei.com, Christopher Davis} writes:
1747
1748 @quotation
1749 That's correct [The SunOS 4.1.3 precompiled binaries don't do name
1750 lookup].  Since Sun figured that everyone used NIS to do name lookups
1751 (that DNS thing was apparently only a passing fad, right?), the stock
1752 SunOS 4.x systems don't have DNS-based name lookups in libc.
1753
1754 This is also why Netscape ships two binaries for SunOS 4.1.x.
1755
1756 The best solution is to compile it yourself; the configure script will
1757 check to see if you've put DNS in the shared libc and will then proceed
1758 to link against the DNS resolver library code.
1759 @end quotation
1760
1761 @node Q2.0.12, Q2.0.13, Q2.0.11, Installation
1762 @unnumberedsubsec Q2.0.12: Why can't I strip XEmacs?
1763
1764 @email{cognot@@fronsac.ensg.u-nancy.fr, Richard Cognot} writes:
1765
1766 @quotation
1767 Because of the way XEmacs (and every other Emacsen, AFAIK) is built. The
1768 link gives you a bare-boned emacs (called temacs). temacs is then run,
1769 preloading some of the lisp files. The result is then dumped into a new
1770 executable, named xemacs, which will contain all of the preloaded lisp
1771 functions and data.
1772
1773 Now, during the dump itself, the executable (code+data+symbols) is
1774 written on disk using a special unexec() function. This function is
1775 obviously heavily system dependent. And on some systems, it leads to an
1776 executable which, although valid, cannot be stripped without damage. If
1777 memory serves, this is especially the case for AIX binaries. On other
1778 architecture it might work OK.
1779
1780 The Right Way to strip the emacs binary is to strip temacs prior to
1781 dumping xemacs. This will always work, although you can do that only if
1782 you install from sources (as temacs is @file{not} part of the binary
1783 kits).
1784 @end quotation
1785
1786 @email{nat@@nataa.fr.eu.org, Nat Makarevitch} writes:
1787
1788 @quotation
1789 Here is the trick:
1790
1791 @enumerate
1792 @item
1793 [ ./configure; make ]
1794
1795 @item
1796 rm src/xemacs
1797
1798 @item
1799 strip src/temacs
1800
1801 @item
1802 make
1803
1804 @item
1805 cp src/xemacs /usr/local/bin/xemacs
1806
1807 @item
1808 cp lib-src/DOC-19.16-XEmacs
1809 @iftex
1810 \ @*
1811 @end iftex
1812 /usr/local/lib/xemacs-19.16/i586-unknown-linuxaout
1813 @end enumerate
1814 @end quotation
1815
1816 @node Q2.0.13, Q2.0.14, Q2.0.12, Installation
1817 @unnumberedsubsec Q2.0.13: Problems linking with Gcc on Solaris
1818
1819 There are known difficulties linking with Gnu ld on Solaris.  A typical
1820 error message might look like:
1821
1822 @example
1823 unexec(): dlopen(../dynodump/dynodump.so): ld.so.1: ./temacs:
1824 fatal: relocation error:
1825 symbol not found: main: referenced in ../dynodump/dynodump.so
1826 @end example
1827
1828 @email{martin@@xemacs.org, Martin Buchholz} writes:
1829
1830 @quotation
1831 You need to specify @samp{-fno-gnu-linker} as part of your flags to pass
1832 to ld.  Future releases of XEmacs will try to do this automatically.
1833 @end quotation
1834
1835 @node Q2.0.14, Q2.1.1, Q2.0.13, Installation
1836 @unnumberedsubsec Q2.0.14: Make on HP/UX 9 fails after linking temacs
1837
1838 Problem when building xemacs-19.16 on hpux 9:
1839
1840 @email{cognot@@ensg.u-nancy.fr, Richard Cognot} writes:
1841
1842 @quotation
1843 make on hpux fails after linking temacs with a message:
1844
1845 @example
1846 "make: don't know how to make .y."
1847 @end example
1848
1849 Solution: This is a problem with HP make revision 70.X.  Either use GNU
1850 make, or install PHCO_6552, which will bring make to revision
1851 72.24.1.17.
1852 @end quotation
1853
1854
1855 @node Q2.1.1, Q2.1.2, Q2.0.14, Installation
1856 @unnumberedsec 2.1: Trouble Shooting
1857 @unnumberedsubsec Q2.1.1: Help!  XEmacs just crashed on me!
1858
1859 First of all, don't panic.  Whenever XEmacs crashes, it tries extremely
1860 hard to auto-save all of your files before dying.  (The main time that
1861 this will not happen is if the machine physically lost power or if you
1862 killed the XEmacs process using @code{kill -9}).  The next time you try
1863 to edit those files, you will be informed that a more recent auto-save
1864 file exists.  You can use @kbd{M-x recover-file} to retrieve the
1865 auto-saved version of the file.
1866
1867 Starting with 19.14, you may use the command @kbd{M-x recover-session}
1868 after a crash to pick up where you left off.
1869
1870 Now, XEmacs is not perfect, and there may occasionally be times, or
1871 particular sequences of actions, that cause it to crash.  If you can
1872 come up with a reproducible way of doing this (or even if you have a
1873 pretty good memory of exactly what you were doing at the time), the
1874 maintainers would be very interested in knowing about it.  Post a
1875 message to comp.emacs.xemacs or send mail to @email{crashes@@xemacs.org}.
1876 Please note that the @samp{crashes} address is exclusively for crash
1877 reports.
1878
1879 If at all possible, include a stack backtrace of the core dump that was
1880 produced.  This shows where exactly things went wrong, and makes it much
1881 easier to diagnose problems.  To do this, you need to locate the core
1882 file (it's called @file{core}, and is usually sitting in the directory
1883 that you started XEmacs from, or your home directory if that other
1884 directory was not writable).  Then, go to that directory and execute a
1885 command like:
1886
1887 @example
1888 gdb `which xemacs` core
1889 @end example
1890
1891 and then issue the command @samp{where} to get the stack backtrace.  You
1892 might have to use @code{dbx} or some similar debugger in place of
1893 @code{gdb}.  If you don't have any such debugger available, complain to
1894 your system administrator.
1895
1896 It's possible that a core file didn't get produced, in which case you're
1897 out of luck.  Go complain to your system administrator and tell him not
1898 to disable core files by default.  Also @xref{Q2.1.15}, for tips and
1899 techniques for dealing with a debugger.
1900
1901 When making a problem report make sure that:
1902
1903 @enumerate
1904 @item
1905 Report @strong{all} of the information output by XEmacs during the
1906 crash.
1907
1908 @item
1909 You mention what O/S & Hardware you are running XEmacs on.
1910
1911 @item
1912 What version of XEmacs you are running.
1913
1914 @item
1915 What build options you are using.
1916
1917 @item
1918 If the problem is related to graphics, we will also need to know what
1919 version of the X Window System you are running, and what window manager
1920 you are using.
1921
1922 @item
1923 If the problem happened on a tty, please include the terminal type.
1924 @end enumerate
1925
1926 @node Q2.1.2, Q2.1.3, Q2.1.1, Installation
1927 @unnumberedsubsec Q2.1.2: Cryptic Minibuffer messages.
1928
1929 When I try to use some particular option of some particular package, I
1930 get a cryptic error in the minibuffer.
1931
1932 If you can't figure out what's going on, select Options/General
1933 Options/Debug on Error from the Menubar and then try and make the error
1934 happen again.  This will give you a backtrace that may be enlightening.
1935 If not, try reading through this FAQ; if that fails, you could try
1936 posting to comp.emacs.xemacs (making sure to include the backtrace) and
1937 someone may be able to help.  If you can identify which Emacs lisp
1938 source file the error is coming from you can get a more detailed stack
1939 backtrace by doing the following:
1940
1941 @enumerate
1942 @item
1943 Visit the .el file in an XEmacs buffer.
1944
1945 @item
1946 Issue the command @kbd{M-x eval-current-buffer}.
1947
1948 @item
1949 Reproduce the error.
1950 @end enumerate
1951
1952 Depending on the version of XEmacs, you may either select Edit->Show
1953 Messages (19.13 and earlier) or Help->Recent Keystrokes/Messages (19.14
1954 and later) from the menubar to see the most recent messages.  This
1955 command is bound to @kbd{C-h l} by default.
1956
1957 @node Q2.1.3, Q2.1.4, Q2.1.2, Installation
1958 @unnumberedsubsec Q2.1.3: Translation Table Syntax messages at Startup
1959
1960 I get tons of translation table syntax error messages during startup.
1961 How do I get rid of them?
1962
1963 There are two causes of this problem.  The first usually only strikes
1964 people using the prebuilt binaries.  The culprit in both cases is the
1965 file @file{XKeysymDB}.
1966
1967 @itemize @bullet
1968 @item
1969 The binary cannot find the @file{XKeysymDB} file.  The location is
1970 hardcoded at compile time so if the system the binary was built on puts
1971 it a different place than your system does, you have problems.  To fix,
1972 set the environment variable @var{XKEYSYMDB} to the location of the
1973 @file{XKeysymDB} file on your system or to the location of the one
1974 included with XEmacs which should be at
1975 @iftex
1976 @*
1977 @end iftex
1978 @file{<xemacs_root_directory>/lib/xemacs-19.16/etc/XKeysymDB}.
1979
1980 @item
1981 The binary is finding the XKeysymDB but it is out-of-date on your system
1982 and does not contain the necessary lines.  Either ask your system
1983 administrator to replace it with the one which comes with XEmacs (which
1984 is the stock R6 version and is backwards compatible) or set your
1985 @var{XKEYSYMDB} variable to the location of XEmacs's described above.
1986 @end itemize
1987
1988 @node Q2.1.4, Q2.1.5, Q2.1.3, Installation
1989 @unnumberedsubsec Q2.1.4: Startup warnings about deducing proper fonts?
1990
1991 How can I avoid the startup warnings about deducing proper fonts?
1992
1993 This is highly dependent on your installation, but try with the
1994 following font as your base font for XEmacs and see what it does:
1995
1996 @format
1997 -adobe-courier-medium-r-*-*-*-120-*-*-*-*-iso8859-1
1998 @end format
1999
2000 More precisely, do the following in your resource file:
2001
2002 @format
2003 Emacs.default.attributeFont: \
2004 -adobe-courier-medium-r-*-*-*-120-*-*-*-*-iso8859-1
2005 @end format
2006
2007 If you just don't want to see the @samp{*Warnings*} buffer at startup
2008 time, you can set this:
2009
2010 @lisp
2011 (setq display-warning-minimum-level 'error)
2012 @end lisp
2013
2014 The buffer still exists; it just isn't in your face.
2015
2016 @node Q2.1.5, Q2.1.6, Q2.1.4, Installation
2017 @unnumberedsubsec Q2.1.5: XEmacs cannot connect to my X Terminal!
2018
2019 Help!  I can not get XEmacs to display on my Envizex X-terminal!
2020
2021 Try setting the @var{DISPLAY} variable using the numeric IP address of
2022 the host you are running XEmacs from.
2023
2024 @node Q2.1.6, Q2.1.7, Q2.1.5, Installation
2025 @unnumberedsubsec Q2.1.6: XEmacs just locked up my Linux X server!
2026
2027 There have been several reports of the X server locking up under Linux.
2028 In all reported cases removing speedo and scaled fonts from the font
2029 path corrected the problem.  This can be done with the command
2030 @code{xset}.
2031
2032 It is possible that using a font server may also solve the problem.
2033
2034 @node Q2.1.7, Q2.1.8, Q2.1.6, Installation
2035 @unnumberedsubsec Q2.1.7: HP Alt key as Meta.
2036
2037 How can I make XEmacs recognize the Alt key of my HP workstation as a
2038 Meta key?
2039
2040 Put the following line into a file and load it with xmodmap(1) before
2041 starting XEmacs:
2042
2043 @example
2044 remove Mod1 = Mode_switch
2045 @end example
2046
2047 @node Q2.1.8, Q2.1.9, Q2.1.7, Installation
2048 @unnumberedsubsec Q2.1.8: got (wrong-type-argument color-instance-p nil)
2049
2050 @email{nataliek@@rd.scitec.com.au, Natalie Kershaw} writes:
2051
2052 @quotation
2053 I am trying to run xemacs 19.13 under X11R4. Whenever I move the mouse I
2054 get the following error. Has anyone seen anything like this? This
2055 doesn't occur on X11R5.
2056
2057 @lisp
2058 Signalling:
2059 (error "got (wrong-type-argument color-instance-p nil)
2060 and I don't know why!")
2061 @end lisp
2062 @end quotation
2063
2064 @email{map01kd@@gold.ac.uk, dinos} writes:
2065
2066 @quotation
2067 I think this is due to undefined resources; You need to define color
2068 backgrounds and foregrounds into your @file{.../app-defaults/Emacs}
2069 like:
2070
2071 @example
2072 *Foreground:    Black   ;everything will be of black on grey95,
2073 *Background:    Grey95  ;unless otherwise specified.
2074 *cursorColor:   Red3    ;red3 cursor with grey95 border.
2075 *pointerColor:  Red3    ;red3 pointer with grey95 border.
2076 @end example
2077 @end quotation
2078
2079 Natalie Kershaw adds:
2080
2081 @quotation
2082 What fixed the problem was adding some more colors to the X color
2083 database (copying the X11R5 colors over), and also defining the
2084 following resources:
2085
2086 @example
2087 xemacs*cursorColor:    black
2088 xemacs*pointerColor:   black
2089 @end example
2090
2091 With the new colors installed the problem still occurs if the above
2092 resources are not defined.
2093
2094 If the new colors are not present then an additional error occurs on
2095 XEmacs startup, which says @samp{Color Red3} not defined.
2096 @end quotation
2097
2098 @node Q2.1.9, Q2.1.10, Q2.1.8, Installation
2099 @unnumberedsubsec Q2.1.9: XEmacs causes my OpenWindows 3.0 server to crash.
2100
2101 The OpenWindows 3.0 server is incredibly buggy.  Your best bet is to
2102 replace it with one from the generic MIT X11 release.  You might also
2103 try disabling parts of your @file{.emacs}, like enabling background
2104 pixmaps.
2105
2106 @node Q2.1.10, Q2.1.11, Q2.1.9, Installation
2107 @unnumberedsubsec Q2.1.10: Warnings from incorrect key modifiers.
2108
2109 The following information comes from the @file{PROBLEMS} file that comes
2110 with XEmacs.
2111
2112 If you're having troubles with HP/UX it is because HP/UX defines the
2113 modifiers wrong in X.  Here is a shell script to fix the problem; be
2114 sure that it is run after VUE configures the X server.
2115
2116 @example
2117 #! /bin/sh
2118 xmodmap 2> /dev/null - << EOF
2119 keysym Alt_L = Meta_L
2120 keysym Alt_R = Meta_R
2121 EOF
2122
2123 xmodmap - << EOF
2124 clear mod1
2125 keysym Mode_switch = NoSymbol
2126 add mod1 = Meta_L
2127 keysym Meta_R = Mode_switch
2128 add mod2 = Mode_switch
2129 EOF
2130 @end example
2131
2132 @node Q2.1.11, Q2.1.12, Q2.1.10, Installation
2133 @unnumberedsubsec Q2.1.11: @samp{Can't instantiate image error...} in toolbar
2134 @c New
2135
2136 @email{expt@@alanine.ram.org, Dr. Ram Samudrala} writes:
2137
2138 I just installed the XEmacs (20.4-2) RPMS that I downloaded from
2139 @uref{http://www.xemacs.org/}.  Everything works fine, except that when
2140 I place my mouse over the toolbar, it beeps and gives me this message:
2141
2142 @example
2143  Can't instantiate image (probably cached):
2144  [xbm :mask-file "/usr/include/X11/bitmaps/leftptrmsk :mask-data
2145  (16 16 <strange control characters> ...
2146 @end example
2147
2148 @email{kyle_jones@@wonderworks.com, Kyle Jones} writes:
2149 @quotation
2150 This is problem specific to some Chips and Technologies video
2151 chips, when running XFree86.  Putting
2152
2153 @code{Option "sw_cursor"}
2154
2155 in @file{XF86Config} gets rid of the problem.
2156 @end quotation
2157
2158 @node Q2.1.12, Q2.1.13, Q2.1.11, Installation
2159 @unnumberedsubsec Q2.1.12: Problems with Regular Expressions on DEC OSF1.
2160
2161 I have xemacs 19.13 running on an alpha running OSF1 V3.2 148 and ispell
2162 would not run because it claimed the version number was incorrect
2163 although it was indeed OK. I traced the problem to the regular
2164 expression handler.
2165
2166 @email{douglask@@dstc.edu.au, Douglas Kosovic} writes:
2167
2168 @quotation
2169 Actually it's a DEC cc optimization bug that screws up the regexp
2170 handling in XEmacs.
2171
2172 Rebuilding using the @samp{-migrate} switch for DEC cc (which uses a
2173 different sort of optimization) works fine.
2174 @end quotation
2175
2176 See @file{xemacs-19_13-dunix-3_2c.patch} at the following URL on how to
2177 build with the @samp{-migrate} flag:
2178
2179 @example
2180 @uref{http://www-digital.cern.ch/carney/emacs/emacs.html}
2181 @c Link above, <URL:http://www-digital.cern.ch/carney/emacs/emacs.html> is
2182 @c dead. And the directory `carney' is empty.
2183
2184
2185
2186 @end example
2187
2188 NOTE: There have been a variety of other problems reported that are
2189 fixed in this fashion.
2190
2191 @node Q2.1.13, Q2.1.14, Q2.1.12, Installation
2192 @unnumberedsubsec Q2.1.13: HP/UX 10.10 and @code{create_process} failure.
2193
2194 @email{Dave.Carrigan@@ipl.ca, Dave Carrigan} writes:
2195
2196 @quotation
2197 With XEmacs 19.13 and HP/UX 10.10, anything that relies on the
2198 @code{create_process} function fails. This breaks a lot of things
2199 (shell-mode, compile, ange-ftp, to name a few).
2200 @end quotation
2201
2202 @email{johnson@@dtc.hp.com, Phil Johnson} writes:
2203
2204 @quotation
2205 This is a problem specific to HP-UX 10.10.  It only occurs when XEmacs
2206 is compiled for shared libraries (the default), so you can work around
2207 it by compiling a statically-linked binary (run configure with
2208 @samp{--dynamic=no}).
2209
2210 I'm not sure whether the problem is with a particular shared library or
2211 if it's a kernel problem which crept into 10.10.
2212 @end quotation
2213
2214 @email{cognot@@ensg.u-nancy.fr, Richard Cognot} writes:
2215
2216 @quotation
2217 I had a few problems with 10.10. Apparently, some of them were solved by
2218 forcing a static link of libc (manually).
2219 @end quotation
2220
2221 @node Q2.1.14, Q2.1.15, Q2.1.13, Installation
2222 @unnumberedsubsec Q2.1.14: @kbd{C-g} doesn't work for me.  Is it broken?
2223
2224 @email{ben@@xemacs.org, Ben Wing} writes:
2225
2226 @quotation
2227 @kbd{C-g} does work for most people in most circumstances.  If it
2228 doesn't, there are only two explanations:
2229
2230 @enumerate
2231 @item
2232 The code is wrapped with a binding of @code{inhibit-quit} to
2233 @code{t}.  @kbd{Ctrl-Shift-G} should still work, I think.
2234
2235 @item
2236 SIGIO is broken on your system, but BROKEN_SIGIO isn't defined.
2237 @end enumerate
2238
2239 To test #2, try executing @code{(while t)} from the @samp{*scratch*}
2240 buffer.  If @kbd{C-g} doesn't interrupt, then you're seeing #2.
2241 @end quotation
2242
2243 @email{terra@@diku.dk, Morten Welinder} writes:
2244
2245 @quotation
2246 On some (but @emph{not} all) machines a hung XEmacs can be revived by
2247 @code{kill -FPE <pid>}.  This is a hack, of course, not a solution.
2248 This technique works on a Sun4 running 4.1.3_U1.  To see if it works for
2249 you, start another XEmacs and test with that first.  If you get a core
2250 dump the method doesn't work and if you get @samp{Arithmetic error} then
2251 it does.
2252 @end quotation
2253
2254 @node Q2.1.15, Q2.1.16, Q2.1.14, Installation
2255 @unnumberedsubsec Q2.1.15: How to Debug an XEmacs problem with a debugger
2256
2257 If XEmacs does crash on you, one of the most productive things you can
2258 do to help get the bug fixed is to poke around a bit with the debugger.
2259 Here are some hints:
2260
2261 @itemize @bullet
2262 @item
2263 First of all, if the crash is at all reproducible, consider very
2264 strongly recompiling your XEmacs with debugging symbols, with no
2265 optimization, and with the configure options @samp{--debug=yes} and
2266 @samp{--error-checking=all}.  This will make your XEmacs run somewhat
2267 slower but make it a lot more likely to catch the problem earlier
2268 (closer to its source), and a lot easier to determine what's going on
2269 with a debugger.
2270
2271 @item
2272 If you're able to run XEmacs under a debugger and reproduce the crash
2273 (if it's inconvenient to do this because XEmacs is already running or is
2274 running in batch mode as part of a bunch of scripts, consider attaching
2275 to the existing process with your debugger; most debuggers let you do
2276 this by substituting the process ID for the core file when you invoke
2277 the debugger from the command line, or by using the @code{attach}
2278 command or something similar), here are some things you can do:
2279
2280 @item
2281 If XEmacs is hitting an assertion failure, put a breakpoint on
2282 @code{assert_failed()}.
2283
2284 @item
2285 If XEmacs is hitting some weird Lisp error that's causing it to crash
2286 (e.g. during startup), put a breakpoint on @code{signal_1()}---this is
2287 declared static in eval.c.
2288
2289 @item
2290 Internally, you will probably see lots of variables that hold objects of
2291 type @code{Lisp_Object}.  These are exactly what they appear to be,
2292 i.e. references to Lisp objects.  Printing them out with the debugger
2293 probably won't be too useful---you'll likely just see a number.  To
2294 decode them, do this:
2295
2296 @example
2297 call debug_print (OBJECT)
2298 @end example
2299
2300 where @var{OBJECT} is whatever you want to decode (it can be a variable,
2301 a function call, etc.).  This will print out a readable representation
2302 on the TTY from which the xemacs process was invoked.
2303
2304 @item
2305 If you want to get a Lisp backtrace showing the Lisp call
2306 stack, do this:
2307
2308 @example
2309 call debug_backtrace ()
2310 @end example
2311
2312 @item
2313 Using @code{debug_print} and @code{debug_backtrace} has two
2314 disadvantages - it can only be used with a running xemacs process, and
2315 it cannot display the internal C structure of a Lisp Object.  Even if
2316 all you've got is a core dump, all is not lost.
2317
2318 If you're using GDB, there are some macros in the file
2319 @file{src/gdbinit} in the XEmacs source distribution that should make it
2320 easier for you to decode Lisp objects.  Copy this file to
2321 @file{~/.gdbinit}, or @code{source} it from @file{~/.gdbinit}, and use
2322 the macros defined therein.  In particular, use the @code{pobj} macro to
2323 print the internal C representation of a lisp object.  This will work
2324 with a core file or not-yet-run executable.  The aliases @code{ldp} and
2325 @code{lbt} are provided for conveniently calling @code{debug_print} and
2326 @code{debug_backtrace}.
2327
2328 If you are using Sun's @file{dbx} debugger, there is an equivalent file
2329 @file{src/dbxrc} to copy to or source from @file{~/.dbxrc}.
2330
2331 @item
2332 If you're using a debugger to get a C stack backtrace and you're seeing
2333 stack traces with some of the innermost frames mangled, it may be due to
2334 dynamic linking. (This happens especially under Linux.) Consider
2335 reconfiguring with @samp{--dynamic=no}.  Also, sometimes (again under
2336 Linux), stack backtraces of core dumps will have the frame where the
2337 fatal signal occurred mangled; if you can obtain a stack trace while
2338 running the XEmacs process under a debugger, the stack trace should be
2339 clean.
2340
2341 @email{1CMC3466@@ibm.mtsac.edu, Curtiss} suggests upgrading to ld.so version 1.8
2342 if dynamic linking and debugging is a problem on Linux.
2343
2344 @item
2345 If you're using a debugger to get a C stack backtrace and you're
2346 getting a completely mangled and bogus stack trace, it's probably due to
2347 one of the following:
2348
2349 @enumerate a
2350 @item
2351 Your executable has been stripped.  Bad news.  Tell your sysadmin not to
2352 do this---it doesn't accomplish anything except to save a bit of disk
2353 space, and makes debugging much much harder.
2354
2355 @item
2356 Your stack is getting trashed.  Debugging this is hard; you have to do a
2357 binary-search type of narrowing down where the crash occurs, until you
2358 figure out exactly which line is causing the problem.  Of course, this
2359 only works if the bug is highly reproducible.
2360
2361 @item
2362 If your stack trace has exactly one frame in it, with address 0x0, this
2363 could simply mean that XEmacs attempted to execute code at that address,
2364 e.g. through jumping to a null function pointer.  Unfortunately, under
2365 those circumstances, GDB under Linux doesn't know how to get a stack
2366 trace. (Yes, this is the third Linux-related problem I've mentioned.  I
2367 have no idea why GDB under Linux is so bogus.  Complain to the GDB
2368 authors, or to comp.os.linux.development.system).  Again, you'll have to
2369 use the narrowing-down process described above.
2370
2371 @item
2372 If you compiled 19.14 with @samp{--debug} (or by default in later
2373 versions), you will get a Lisp backtrace output when XEmacs crashes, so
2374 you'll have something useful.
2375
2376 @end enumerate
2377
2378 @item
2379 If you compile with the newer gcc variants gcc-2.8 or egcs, you will
2380 also need gdb 4.17.  Earlier releases of gdb can't handle the debug
2381 information generated by the newer compilers.
2382
2383 @item
2384 The above information on using @file{src/gdbinit} works for XEmacs-21.0
2385 and above.  For older versions of XEmacs, there are different
2386 @file{gdbinit} files provided in the @file{src} directory.  Use the one
2387 corresponding to the configure options used when building XEmacs.
2388
2389 @end itemize
2390
2391 @node Q2.1.16, Q2.1.17, Q2.1.15, Installation
2392 @unnumberedsubsec Q2.1.16: XEmacs crashes in @code{strcat} on HP/UX 10
2393
2394 From the problems database (through
2395 the former address http://support.mayfield.hp.com/):
2396
2397 @example
2398 Problem Report: 5003302299
2399 Status:         Open
2400
2401 System/Model:   9000/700
2402 Product Name:   HPUX S800 10.0X
2403 Product Vers:   9245XB.10.00
2404
2405 Description: strcat(3C) may read beyond
2406 end of source string, can cause SIGSEGV
2407
2408
2409 *** PROBLEM TEXT ***
2410 strcat(3C) may read beyond the source string onto an unmapped page,
2411 causing a segmentation violation.
2412 @end example
2413
2414 @node Q2.1.17, Q2.1.18, Q2.1.16, Installation
2415 @unnumberedsubsec Q2.1.17: @samp{Marker does not point anywhere}
2416
2417 As with other errors, set @code{debug-on-error} to @code{t} to get the
2418 backtrace when the error occurs.  Specifically, two problems have been
2419 reported (and fixed).
2420
2421 @enumerate
2422 @item
2423 A problem with line-number-mode in XEmacs 19.14 affected a large number
2424 of other packages.  If you see this error message, turn off
2425 line-number-mode.
2426
2427 @item
2428 A problem with some early versions of Gnus 5.4 caused this error.
2429 Upgrade your Gnus.
2430 @end enumerate
2431
2432 @node Q2.1.18, Q2.1.19, Q2.1.17, Installation
2433 @unnumberedsubsec Q2.1.18: 19.14 hangs on HP/UX 10.10.
2434
2435 @email{cognot@@ensg.u-nancy.fr, Richard Cognot} writes:
2436
2437 @quotation
2438 For the record, compiling on hpux 10.10 leads to a hang in Gnus when
2439 compiled with optimization on.
2440
2441 I've just discovered that my hpux 10.01 binary was working less well
2442 than expected. In fact, on a 10.10 system, @code{(while t)} was not
2443 interrupted by @kbd{C-g}. I defined @code{BROKEN_SIGIO} and recompiled on
2444 10.10, and... the hang is now gone.
2445
2446 As far as configure goes, this will be a bit tricky: @code{BROKEN_SIGIO}
2447 is needed on 10.10, but @strong{not} on 10.01: if I run my 10.01 binary
2448 on a 10.01 machine, without @code{BROKEN_SIGIO} being defined, @kbd{C-g}
2449 works as expected.
2450 @end quotation
2451
2452 @email{cognot@@ensg.u-nancy.fr, Richard Cognot} adds:
2453
2454 @quotation
2455 Apparently somebody has found the reason why there is this
2456 @iftex
2457 @*
2458 @end iftex
2459 @samp{poll:
2460 interrupted...} message for each event.  For some reason, libcurses
2461 reimplements a @code{select()} system call, in a highly broken fashion.
2462 The fix is to add a -lc to the link line @emph{before} the
2463 -lxcurses. XEmacs will then use the right version of @code{select()}.
2464 @end quotation
2465
2466
2467 @email{af@@biomath.jussieu.fr, Alain Fauconnet} writes:
2468
2469 @quotation
2470 The @emph{real} solution is to @emph{not} link -lcurses in!  I just
2471 changed -lcurses to -ltermcap in the Makefile and it fixed:
2472
2473 @enumerate
2474 @item
2475 The @samp{poll: interrupted system call} message.
2476
2477 @item
2478 A more serious problem I had discovered in the meantime, that is the
2479 fact that subprocess handling was seriously broken: subprocesses
2480 e.g. started by AUC TeX for TeX compilation of a buffer would
2481 @emph{hang}.  Actually they would wait forever for emacs to read the
2482 socket which connects stdout...
2483 @end enumerate
2484 @end quotation
2485
2486 @node Q2.1.19, Q2.1.20, Q2.1.18, Installation
2487 @unnumberedsubsec Q2.1.19: XEmacs does not follow the local timezone.
2488
2489 When using one of the prebuilt binaries many users have observed that
2490 XEmacs uses the timezone under which it was built, but not the timezone
2491 under which it is running.  The solution is to add:
2492
2493 @lisp
2494 (set-time-zone-rule "MET")
2495 @end lisp
2496
2497 to your @file{.emacs} or the @file{site-start.el} file if you can.
2498 Replace @code{MET} with your local timezone.
2499
2500 @node Q2.1.20, Q2.1.21, Q2.1.19, Installation
2501 @unnumberedsubsec Q2.1.20: @samp{Symbol's function definition is void: hkey-help-show.}
2502
2503 This is a problem with a partially loaded hyperbole.  Try adding:
2504
2505 @lisp
2506 (require 'hmouse-drv)
2507 @end lisp
2508
2509 where you load hyperbole and the problem should go away.
2510
2511 @node Q2.1.21, Q2.1.22, Q2.1.20, Installation
2512 @unnumberedsubsec Q2.1.21: Every so often the XEmacs frame freezes
2513
2514 This problem has been fixed in 19.15, and was due to a not easily
2515 reproducible race condition.
2516
2517 @node Q2.1.22, Q2.1.23, Q2.1.21, Installation
2518 @unnumberedsubsec Q2.1.22: XEmacs seems to take a really long time to do some things
2519
2520 @email{dmoore@@ucsd.edu, David Moore} writes:
2521
2522 @quotation
2523 Two things you can do:
2524
2525 1) C level:
2526
2527 When you see it going mad like this, you might want to use gdb from an
2528 'xterm' to attach to the running process and get a stack trace.  To do
2529 this just run:
2530
2531 @example
2532 gdb /path/to/xemacs/xemacs ####
2533 @end example
2534
2535 Where @code{####} is the process id of your xemacs, instead of
2536 specifying the core.  When gdb attaches, the xemacs will stop [1] and
2537 you can type `where' in gdb to get a stack trace as usual.  To get
2538 things moving again, you can just type `quit' in gdb.  It'll tell you
2539 the program is running and ask if you want to quit anyways.  Say 'y' and
2540 it'll quit and have your emacs continue from where it was at.
2541
2542 2) Lisp level:
2543
2544 Turn on debug-on-quit early on.  When you think things are going slow
2545 hit C-g and it may pop you in the debugger so you can see what routine
2546 is running.  Press `c' to get going again.
2547
2548 debug-on-quit doesn't work if something's turned on inhibit-quit or in
2549 some other strange cases.
2550 @end quotation
2551
2552 @node Q2.1.23, Q2.1.24, Q2.1.22, Installation
2553 @unnumberedsubsec Q2.1.23:  Movemail on Linux does not work for XEmacs 19.15 and later.
2554
2555 Movemail used to work fine in 19.14 but has stopped working in 19.15
2556 and 20.x.  I am using Linux.
2557
2558 @email{steve@@xemacs.org, SL Baur} writes:
2559
2560 @quotation
2561 Movemail on Linux used to default to using flock file locking.  With
2562 19.15 and later versions it now defaults to using @code{.lock} file
2563 locking.  If this is not appropriate for your system, edit src/s/linux.h
2564 and uncomment the line that reads:
2565
2566 @example
2567 #define MAIL_USE_FLOCK
2568 @end example
2569 @end quotation
2570
2571 @node Q2.1.24,  , Q2.1.23, Installation
2572 @unnumberedsubsec Q2.1.24:  XEmacs won't start without network. (NEW)
2573 Q2.1.23:  Movemail on Linux does not work for XEmacs 19.15 and later.
2574
2575 If XEmacs starts when you're on the network, but fails when you're not
2576 on the network, you may be missing a "localhost" entry in your
2577 @file{/etc/hosts} file.  The file should contain an entry like:
2578
2579 @example
2580 127.0.0.1        localhost
2581 @end example
2582
2583 Add that line, and XEmacs will be happy.
2584
2585 @node Customization, Subsystems, Installation, Top
2586 @unnumbered 3 Customization and Options
2587
2588 This is part 3 of the XEmacs Frequently Asked Questions list.  This
2589 section is devoted to Customization and screen settings.
2590
2591 @menu
2592 Customization---Emacs Lisp and @file{.emacs}:
2593 * Q3.0.1::      What version of Emacs am I running?
2594 * Q3.0.2::      How do I evaluate Elisp expressions?
2595 * Q3.0.3::      @code{(setq tab-width 6)} behaves oddly.
2596 * Q3.0.4::      How can I add directories to the @code{load-path}?
2597 * Q3.0.5::      How to check if a lisp function is defined?
2598 * Q3.0.6::      Can I force the output of @code{(face-list)} to a buffer?
2599 * Q3.0.7::      Font selections don't get saved after @code{Save Options}.
2600 * Q3.0.8::      How do I make a single minibuffer frame?
2601 * Q3.0.9::      What is @code{Customize}?
2602
2603 X Window System & Resources:
2604 * Q3.1.1::      Where is a list of X resources?
2605 * Q3.1.2::      How can I detect a color display?
2606 * Q3.1.3::      @code{(set-screen-width)} worked in 19.6, but not in 19.13?
2607 * Q3.1.4::      Specifying @code{Emacs*EmacsScreen.geometry} in @file{.emacs} does not work in 19.15?
2608 * Q3.1.5::      How can I get the icon to just say @samp{XEmacs}?
2609 * Q3.1.6::      How can I have the window title area display the full path?
2610 * Q3.1.7::      @samp{xemacs -name junk} doesn't work?
2611 * Q3.1.8::      @samp{-iconic} doesn't work.
2612
2613 Textual Fonts & Colors:
2614 * Q3.2.1::      How can I set color options from @file{.emacs}?
2615 * Q3.2.2::      How do I set the text, menu and modeline fonts?
2616 * Q3.2.3::      How can I set the colors when highlighting a region?
2617 * Q3.2.4::      How can I limit color map usage?
2618 * Q3.2.5::      My tty supports color, but XEmacs doesn't use them.
2619 * Q3.2.6::      Can I have pixmap backgrounds in XEmacs?
2620
2621 The Modeline:
2622 * Q3.3.1::      How can I make the modeline go away?
2623 * Q3.3.2::      How do you have XEmacs display the line number in the modeline?
2624 * Q3.3.3::      How do I get XEmacs to put the time of day on the modeline?
2625 * Q3.3.4::      How do I turn off current chapter from AUC TeX modeline?
2626 * Q3.3.5::      How can one change the modeline color based on the mode used?
2627
2628 3.4 Multiple Device Support:
2629 * Q3.4.1::      How do I open a frame on another screen of my multi-headed display?
2630 * Q3.4.2::      Can I really connect to a running XEmacs after calling up over a modem?  How?
2631
2632 3.5 The Keyboard:
2633 * Q3.5.1::      How can I bind complex functions (or macros) to keys?
2634 * Q3.5.2::      How can I stop down-arrow from adding empty lines to the bottom of my buffers?
2635 * Q3.5.3::      How do I bind C-. and C-; to scroll one line up and down?
2636 * Q3.5.4::      Globally binding @kbd{Delete}?
2637 * Q3.5.5::      Scrolling one line at a time.
2638 * Q3.5.6::      How to map @kbd{Help} key alone on Sun type4 keyboard?
2639 * Q3.5.7::      How can you type in special characters in XEmacs?
2640 * Q3.5.8::      Why does @code{(global-set-key [delete-forward] 'delete-char)} complain?
2641 * Q3.5.9::      How do I make the Delete key delete forward?
2642 * Q3.5.10::     Can I turn on @dfn{sticky} modifier keys?
2643 * Q3.5.11::     How do I map the arrow keys?
2644
2645 The Cursor:
2646 * Q3.6.1::      Is there a way to make the bar cursor thicker?
2647 * Q3.6.2::      Is there a way to get back the old block cursor where the cursor covers the character in front of the point?
2648 * Q3.6.3::      Can I make the cursor blink?
2649
2650 The Mouse and Highlighting:
2651 * Q3.7.1::      How can I turn off Mouse pasting?
2652 * Q3.7.2::      How do I set control/meta/etc modifiers on mouse buttons?
2653 * Q3.7.3::      Clicking the left button does not do anything in buffer list.
2654 * Q3.7.4::      How can I get a list of buffers when I hit mouse button 3?
2655 * Q3.7.5::      Why does cut-and-paste not work between XEmacs and a cmdtool?
2656 * Q3.7.6::      How I can set XEmacs up so that it pastes where the text cursor is?
2657 * Q3.7.7::      How do I select a rectangular region?
2658 * Q3.7.8::      Why does @kbd{M-w} take so long?
2659
2660 The Menubar and Toolbar:
2661 * Q3.8.1::      How do I get rid of the menu (or menubar)?
2662 * Q3.8.2::      Can I customize the basic menubar?
2663 * Q3.8.3::      How do I control how many buffers are listed in the menu @code{Buffers} list?
2664 * Q3.8.4::      Resources like @code{Emacs*menubar*font} are not working?
2665 * Q3.8.5::      How can I bind a key to a function to toggle the toolbar?
2666
2667 Scrollbars:
2668 * Q3.9.1::      How can I disable the scrollbar?
2669 * Q3.9.2::      How can one use resources to change scrollbar colors?
2670 * Q3.9.3::      Moving the scrollbar can move the point; can I disable this?
2671 * Q3.9.4::      How can I get automatic horizontal scrolling?
2672
2673 Text Selections:
2674 * Q3.10.1::     How can I turn off or change highlighted selections?
2675 * Q3.10.2::     How do I get that typing on an active region removes it?
2676 * Q3.10.3::     Can I turn off the highlight during isearch?
2677 * Q3.10.4::     How do I turn off highlighting after @kbd{C-x C-p} (mark-page)?
2678 * Q3.10.5::     The region disappears when I hit the end of buffer while scrolling.
2679 @end menu
2680
2681 @node Q3.0.1, Q3.0.2, Customization, Customization
2682 @unnumberedsec 3.0: Customization -- Emacs Lisp and .emacs
2683 @unnumberedsubsec Q3.0.1: What version of Emacs am I running?
2684
2685 How can @file{.emacs} determine which of the family of Emacsen I am
2686 using?
2687
2688 To determine if you are currently running GNU Emacs 18, GNU Emacs 19,
2689 XEmacs 19, XEmacs 20, or Epoch, and use appropriate code, check out the
2690 example given in @file{etc/sample.emacs}.  There are other nifty things
2691 in there as well!
2692
2693 For all new code, all you really need to do is:
2694
2695 @lisp
2696 (defvar running-xemacs (string-match "XEmacs\\|Lucid" emacs-version))
2697 @end lisp
2698
2699 @node Q3.0.2, Q3.0.3, Q3.0.1, Customization
2700 @unnumberedsubsec Q3.0.2: How can I evaluate Emacs-Lisp expressions?
2701
2702 I know I can evaluate Elisp expressions from @code{*scratch*} buffer
2703 with @kbd{C-j} after the expression.  How do I do it from another
2704 buffer?
2705
2706 Press @kbd{M-:} (the default binding of @code{eval-expression}), and
2707 enter the expression to the minibuffer.  In XEmacs prior to 19.15
2708 @code{eval-expression} used to be a disabled command by default.  If
2709 this is the case, upgrade your XEmacs.
2710
2711 @node Q3.0.3, Q3.0.4, Q3.0.2, Customization
2712 @unnumberedsubsec Q3.0.3: @code{(setq tab-width 6)} behaves oddly.
2713
2714 If you put @code{(setq tab-width 6)} in your @file{.emacs} file it does
2715 not work!  Is there a reason for this?  If you do it at the EVAL prompt
2716 it works fine!! How strange.
2717
2718 Use @code{setq-default} instead, since @code{tab-width} is
2719 all-buffer-local.
2720
2721 @node Q3.0.4, Q3.0.5, Q3.0.3, Customization
2722 @unnumberedsubsec Q3.0.4: How can I add directories to the @code{load-path}?
2723
2724 Here are two ways to do that, one that puts your directories at the
2725 front of the load-path, the other at the end:
2726
2727 @lisp
2728 ;;; Add things at the beginning of the load-path, do not add
2729 ;;; duplicate directories:
2730 (pushnew "bar" load-path :test 'equal)
2731
2732 (pushnew "foo" load-path :test 'equal)
2733
2734 ;;; Add things at the end, unconditionally
2735 (setq load-path (nconc load-path '("foo" "bar")))
2736 @end lisp
2737
2738 @email{keithh@@nortel.ca, keith (k.p.) hanlan} writes:
2739
2740 @quotation
2741 To add directories using Unix shell metacharacters use
2742 @file{expand-file-name} like this:
2743
2744 @lisp
2745 (push (expand-file-name "~keithh/.emacsdir") load-path)
2746 @end lisp
2747 @end quotation
2748
2749 @node Q3.0.5, Q3.0.6, Q3.0.4, Customization
2750 @unnumberedsubsec Q3.0.5: How to check if a lisp function is defined?
2751
2752 Use the following elisp:
2753
2754 @lisp
2755 (fboundp 'foo)
2756 @end lisp
2757
2758 It's almost always a mistake to test @code{emacs-version} or any similar
2759 variables.
2760
2761 Instead, use feature-tests, such as @code{featurep}, @code{boundp},
2762 @code{fboundp}, or even simple behavioral tests, eg.:
2763
2764 @lisp
2765 (defvar foo-old-losing-code-p
2766   (condition-case nil (progn (losing-code t) nil)
2767     (wrong-number-of-arguments t)))
2768 @end lisp
2769
2770 There is an incredible amount of broken code out there which could work
2771 much better more often in more places if it did the above instead of
2772 trying to divine its environment from the value of one variable.
2773
2774 @node Q3.0.6, Q3.0.7, Q3.0.5, Customization
2775 @unnumberedsubsec Q3.0.6: Can I force the output of @code{(face-list)} to a buffer?
2776
2777 It would be good having it in a buffer, as the output of
2778 @code{(face-list)} is too wide to fit to a minibuffer.
2779
2780 Evaluate the expression in the @samp{*scratch*} buffer with point after
2781 the rightmost paren and typing @kbd{C-j}.
2782
2783 If the minibuffer smallness is the only problem you encounter, you can
2784 simply press @kbd{C-h l} to get the former minibuffer contents in a
2785 buffer.
2786
2787 @node Q3.0.7, Q3.0.8, Q3.0.6, Customization
2788 @unnumberedsubsec Q3.0.7: Font selections in don't get saved after @code{Save Options}.
2789
2790 For XEmacs 19.14 and previous:
2791
2792 @email{mannj@@ll.mit.edu, John Mann} writes:
2793
2794 @quotation
2795 You have to go to Options->Frame Appearance and unselect
2796 @samp{Frame-Local Font Menu}.  If this option is selected, font changes
2797 are only applied to the @emph{current} frame and do @emph{not} get saved
2798 when you save options.
2799 @end quotation
2800
2801 For XEmacs 19.15 and later:
2802
2803 Implement the above as well as set the following in your @file{.emacs}
2804
2805 @lisp
2806 (setq options-save-faces t)
2807 @end lisp
2808
2809 @node Q3.0.8, Q3.0.9, Q3.0.7, Customization
2810 @unnumberedsubsec Q3.0.8: How do I get a single minibuffer frame?
2811
2812 @email{acs@@acm.org, Vin Shelton} writes:
2813
2814 @lisp
2815 (setq initial-frame-plist '(minibuffer nil))
2816 (setq default-frame-plist '(minibuffer nil))
2817 (setq default-minibuffer-frame
2818       (make-frame
2819        '(minibuffer only
2820                     width 86
2821                     height 1
2822                     menubar-visible-p nil
2823                     default-toolbar-visible-p nil
2824                     name "minibuffer"
2825                     top -2
2826                     left -2
2827                     has-modeline-p nil)))
2828 (frame-notice-user-settings)
2829 @end lisp
2830
2831 @strong{Please note:} The single minibuffer frame may not be to everyone's
2832 taste, and there any number of other XEmacs options settings that may
2833 make it difficult or inconvenient to use.
2834
2835 @node Q3.0.9, Q3.1.1, Q3.0.8, Customization
2836 @unnumberedsubsec Q3.0.9: What is @code{Customize}?
2837
2838 Starting with XEmacs 20.2 there is new system 'Customize' for customizing
2839 XEmacs options.
2840
2841 You can access @code{Customize} from the @code{Options} menu
2842 or invoking one of customize commands by typing eg.
2843 @kbd{M-x customize}, @kbd{M-x customize-face},
2844 @kbd{M-x customize-variable} or @kbd{M-x customize-apropos}.
2845
2846 Starting with XEmacs 20.3 there is also new `browser' mode for Customize.
2847 Try it out with @kbd{M-x customize-browse}
2848
2849 @node Q3.1.1, Q3.1.2, Q3.0.9, Customization
2850 @unnumberedsec 3.1: X Window System & Resources
2851 @unnumberedsubsec Q3.1.1: Where is a list of X resources?
2852
2853 Search through the @file{NEWS} file for @samp{X Resources}.  A fairly
2854 comprehensive list is given after it.
2855
2856 In addition, an @file{app-defaults} file is supplied,
2857 @file{etc/Emacs.ad} listing the defaults.  The file
2858 @file{etc/sample.Xdefaults} gives a set of defaults that you might
2859 consider.  It is essentially the same as @file{etc/Emacs.ad} but some
2860 entries are slightly altered.  Be careful about installing the contents
2861 of this file into your @file{.Xdefaults} or @file{.Xresources} file if
2862 you use GNU Emacs under X11 as well.
2863
2864 @node Q3.1.2, Q3.1.3, Q3.1.1, Customization
2865 @unnumberedsubsec Q3.1.2: How can I detect a color display?
2866
2867 You can test the return value of the function @code{(device-class)}, as
2868 in:
2869
2870 @lisp
2871 (when (eq (device-class) 'color)
2872   (set-face-foreground  'font-lock-comment-face "Grey")
2873   (set-face-foreground  'font-lock-string-face  "Red")
2874   ....
2875   )
2876 @end lisp
2877
2878 @node Q3.1.3, Q3.1.4, Q3.1.2, Customization
2879 @unnumberedsubsec Q3.1.3: @code{(set-screen-width)} worked in 19.6, but not in 19.13?
2880
2881 In Lucid Emacs 19.6 I did @code{(set-screen-width @var{characters})} and
2882 @code{(set-screen-height @var{lines})} in my @file{.emacs} instead of
2883 specifying @code{Emacs*EmacsScreen.geometry} in my
2884 @iftex
2885 @*
2886 @end iftex
2887 @file{.Xdefaults} but
2888 this does not work in XEmacs 19.13.
2889
2890 These two functions now take frame arguments:
2891
2892 @lisp
2893 (set-frame-width (selected-frame) @var{characters})
2894 (set-frame-height (selected-frame) @var{lines})
2895 @end lisp
2896
2897 @node Q3.1.4, Q3.1.5, Q3.1.3, Customization
2898 @unnumberedsubsec Q3.1.4: Specifying @code{Emacs*EmacsScreen.geometry} in @file{.emacs} does not work in 19.15?
2899
2900 In XEmacs 19.11 I specified @code{Emacs*EmacsScreen.geometry} in
2901 my @file{.emacs} but this does not work in XEmacs 19.15.
2902
2903 We have switched from using the term @dfn{screen} to using the term
2904 @dfn{frame}.
2905
2906 The correct entry for your @file{.Xdefaults} is now:
2907
2908 @example
2909 Emacs*EmacsFrame.geometry
2910 @end example
2911
2912 @node Q3.1.5, Q3.1.6, Q3.1.4, Customization
2913 @unnumberedsubsec Q3.1.5: How can I get the icon to just say @samp{XEmacs}?
2914
2915 I'd like the icon to just say @samp{XEmacs}, and not include the name of
2916 the current file in it.
2917
2918 Add the following line to your @file{.emacs}:
2919
2920 @lisp
2921 (setq frame-icon-title-format "XEmacs")
2922 @end lisp
2923
2924 @node Q3.1.6, Q3.1.7, Q3.1.5, Customization
2925 @unnumberedsubsec Q3.1.6: How can I have the window title area display the full path?
2926
2927 I'd like to have the window title area display the full directory/name
2928 of the current buffer file and not just the name.
2929
2930 Add the following line to your @file{.emacs}:
2931
2932 @lisp
2933 (setq frame-title-format "%S: %f")
2934 @end lisp
2935
2936 A more sophisticated title might be:
2937
2938 @lisp
2939 (setq frame-title-format
2940       '("%S: " (buffer-file-name "%f"
2941                                  (dired-directory dired-directory "%b"))))
2942 @end lisp
2943
2944 That is, use the file name, or the dired-directory, or the buffer name.
2945
2946 @node Q3.1.7, Q3.1.8, Q3.1.6, Customization
2947 @unnumberedsubsec Q3.1.7: @samp{xemacs -name junk} doesn't work?
2948
2949 When I run @samp{xterm -name junk}, I get an xterm whose class name
2950 according to xprop, is @samp{junk}.  This is the way it's supposed to
2951 work, I think.  When I run @samp{xemacs -name junk} the class name is
2952 not set to @samp{junk}.  It's still @samp{emacs}.  What does
2953 @samp{xemacs -name} really do?  The reason I ask is that my window
2954 manager (fvwm) will make a window sticky and I use XEmacs to read my
2955 mail.  I want that XEmacs window to be sticky, without having to use the
2956 window manager's function to set the window sticky.  What gives?
2957
2958 @samp{xemacs -name} sets the application name for the program (that is,
2959 the thing which normally comes from @samp{argv[0]}).  Using @samp{-name}
2960 is the same as making a copy of the executable with that new name.  The
2961 @code{WM_CLASS} property on each frame is set to the frame-name, and the
2962 application-class.  So, if you did @samp{xemacs -name FOO} and then
2963 created a frame named @var{BAR}, you'd get an X window with WM_CLASS =
2964 @code{( "BAR", "Emacs")}.  However, the resource hierarchy for this
2965 widget would be:
2966
2967 @example
2968 Name:    FOO   .shell             .container   .BAR
2969 Class:   Emacs .TopLevelEmacsShell.EmacsManager.EmacsFrame
2970 @end example
2971
2972 instead of the default
2973
2974 @example
2975 Name:    xemacs.shell             .container   .emacs
2976 Class:   Emacs .TopLevelEmacsShell.EmacsManager.EmacsFrame
2977 @end example
2978
2979
2980 It is arguable that the first element of WM_CLASS should be set to the
2981 application-name instead of the frame-name, but I think that's less
2982 flexible, since it does not give you the ability to have multiple frames
2983 with different WM_CLASS properties.  Another possibility would be for
2984 the default frame name to come from the application name instead of
2985 simply being @samp{emacs}.  However, at this point, making that change
2986 would be troublesome: it would mean that many users would have to make
2987 yet another change to their resource files (since the default frame name
2988 would suddenly change from @samp{emacs} to @samp{xemacs}, or whatever
2989 the executable happened to be named), so we'd rather avoid it.
2990
2991 To make a frame with a particular name use:
2992
2993 @lisp
2994 (make-frame '((name . "the-name")))
2995 @end lisp
2996
2997 @node Q3.1.8, Q3.2.1, Q3.1.7, Customization
2998 @unnumberedsubsec Q3.1.8: @samp{-iconic} doesn't work.
2999
3000 When I start up XEmacs using @samp{-iconic} it doesn't work right.
3001 Using @samp{-unmapped} on the command line, and setting the
3002 @code{initiallyUnmapped} X Resource don't seem to help much either...
3003
3004 @email{ben@@xemacs.org, Ben Wing} writes:
3005
3006 @quotation
3007 Ugh, this stuff is such an incredible mess that I've about given up
3008 getting it to work.  The principal problem is numerous window-manager
3009 bugs...
3010 @end quotation
3011
3012 @node Q3.2.1, Q3.2.2, Q3.1.8, Customization
3013 @unnumberedsec 3.2: Textual Fonts & Colors
3014 @unnumberedsubsec Q3.2.1: How can I set color options from @file{.emacs}?
3015
3016 How can I set the most commonly used color options from my @file{.emacs}
3017 instead of from my @file{.Xdefaults}?
3018
3019 Like this:
3020
3021 @lisp
3022 (set-face-background 'default      "bisque") ; frame background
3023 (set-face-foreground 'default      "black") ; normal text
3024 (set-face-background 'zmacs-region "red") ; When selecting w/
3025                                         ; mouse
3026 (set-face-foreground 'zmacs-region "yellow")
3027 (set-face-font       'default      "*courier-bold-r*120-100-100*")
3028 (set-face-background 'highlight    "blue") ; Ie when selecting
3029                                         ; buffers
3030 (set-face-foreground 'highlight    "yellow")
3031 (set-face-background 'modeline     "blue") ; Line at bottom
3032                                         ; of buffer
3033 (set-face-foreground 'modeline     "white")
3034 (set-face-font       'modeline     "*bold-r-normal*140-100-100*")
3035 (set-face-background 'isearch      "yellow") ; When highlighting
3036                                         ; while searching
3037 (set-face-foreground 'isearch      "red")
3038 (setq x-pointer-foreground-color   "black") ; Adds to bg color,
3039                                         ; so keep black
3040 (setq x-pointer-background-color   "blue") ; This is color
3041                                         ; you really
3042                                         ; want ptr/crsr
3043 @end lisp
3044
3045 @node Q3.2.2, Q3.2.3, Q3.2.1, Customization
3046 @unnumberedsubsec Q3.2.2: How do I set the text, menu and modeline fonts?
3047
3048 Note that you should use @samp{Emacs.} and not @samp{Emacs*} when
3049 setting face values.
3050
3051 In @file{.Xdefaults}:
3052
3053 @example
3054 Emacs.default.attributeFont:  -*-*-medium-r-*-*-*-120-*-*-m-*-*-*
3055 Emacs*menubar*font:           fixed
3056 Emacs.modeline.attributeFont: fixed
3057 @end example
3058
3059 This is confusing because modeline is a face, and can be found listed
3060 with all faces in the current mode by using @kbd{M-x set-face-font
3061 (enter) ?}.  It uses the face specification of @code{attributeFont},
3062 while menubar is a normal X thing that uses the specification
3063 @code{font}.  With Motif it may be necessary to use @code{fontList}
3064 instead of @code{font}.
3065
3066 @node Q3.2.3, Q3.2.4, Q3.2.2, Customization
3067 @unnumberedsubsec Q3.2.3: How can I set the colors when highlighting a region?
3068
3069 How can I set the background/foreground colors when highlighting a
3070 region?
3071
3072 You can change the face @code{zmacs-region} either in your
3073 @file{.Xdefaults}:
3074
3075 @example
3076 Emacs.zmacs-region.attributeForeground: firebrick
3077 Emacs.zmacs-region.attributeBackground: lightseagreen
3078 @end example
3079
3080 or in your @file{.emacs}:
3081
3082 @lisp
3083 (set-face-background 'zmacs-region "red")
3084 (set-face-foreground 'zmacs-region "yellow")
3085 @end lisp
3086
3087 @node Q3.2.4, Q3.2.5, Q3.2.3, Customization
3088 @unnumberedsubsec Q3.2.4: How can I limit color map usage?
3089
3090 I'm using Netscape (or another color grabber like XEmacs);
3091 is there anyway to limit the number of available colors in the color map?
3092
3093 XEmacs 19.13 didn't have such a mechanism (unlike netscape, or other
3094 color-hogs).  One solution is to start XEmacs prior to netscape, since
3095 this will prevent Netscape from grabbing all colors (but Netscape will
3096 complain).  You can use the flags for Netscape, like -mono, -ncols <#>
3097 or -install (for mono, limiting to <#> colors, or for using a private
3098 color map).  Since Netscape will take the entire colormap and never
3099 release it, the only reasonable way to run it is with @samp{-install}.
3100
3101 If you have the money, another solution would be to use a truecolor or
3102 direct color video.
3103
3104 Starting with XEmacs 19.14, XEmacs uses the closest available color if
3105 the colormap is full, so it's O.K. now to start Netscape first.
3106
3107 @node Q3.2.5, Q3.2.6, Q3.2.4, Customization
3108 @unnumberedsubsec Q3.2.5: My tty supports color, but XEmacs doesn't use them.
3109
3110 XEmacs tries to automatically determine whether your tty supports color,
3111 but sometimes guesses wrong.  In that case, you can make XEmacs Do The
3112 Right Thing using this Lisp code:
3113
3114 @lisp
3115 (if (eq 'tty (device-type))
3116     (set-device-class nil 'color))
3117 @end lisp
3118
3119 @node Q3.2.6, Q3.3.1, Q3.2.5, Customization
3120 @unnumberedsubsec Q3.2.6: Can I have pixmap backgrounds in XEmacs?
3121 @c New
3122 @email{jvillaci@@wahnsinnig.extreme.indiana.edu, Juan Villacis} writes:
3123
3124 @quotation
3125 There are several ways to do it.  For example, you could specify a
3126 default pixmap image to use in your @file{~/.Xresources}, e.g.,
3127
3128
3129 @example
3130   Emacs*EmacsFrame.default.attributeBackgroundPixmap: /path/to/image.xpm
3131 @end example
3132
3133
3134 and then reload ~/.Xresources and restart XEmacs.  Alternatively,
3135 since each face can have its own pixmap background, a better way
3136 would be to set a face's pixmap within your XEmacs init file, e.g.,
3137
3138 @lisp
3139   (set-face-background-pixmap 'default "/path/to/image.xpm")
3140   (set-face-background-pixmap 'bold    "/path/to/another_image.xpm")
3141 @end lisp
3142
3143 and so on.  You can also do this interactively via @kbd{M-x edit-faces}.
3144
3145 @end quotation
3146
3147 @unnumberedsec 3.3: The Modeline
3148 @node Q3.3.1, Q3.3.2, Q3.2.6, Customization
3149 @unnumberedsubsec Q3.3.1: How can I make the modeline go away?
3150
3151 @lisp
3152 (set-specifier has-modeline-p nil)
3153 @end lisp
3154
3155 Starting with XEmacs 19.14 the modeline responds to mouse clicks, so if
3156 you haven't liked or used the modeline in the past, you might want to
3157 try the new version out.
3158
3159 @node Q3.3.2, Q3.3.3, Q3.3.1, Customization
3160 @unnumberedsubsec Q3.3.2: How do you have XEmacs display the line number in the modeline?
3161
3162 Add the following line to your @file{.emacs} file to display the
3163 line number:
3164
3165 @lisp
3166 (line-number-mode 1)
3167 @end lisp
3168
3169 Use the following to display the column number:
3170
3171 @lisp
3172 (column-number-mode 1)
3173 @end lisp
3174
3175 Or select from the @code{Options} menu
3176 @iftex
3177 @*
3178 @end iftex
3179 @code{Customize->Emacs->Editing->Basics->Line Number Mode}
3180 and/or
3181 @iftex
3182 @*
3183 @end iftex
3184 @code{Customize->Emacs->Editing->Basics->Column Number Mode}
3185
3186 Or type @kbd{M-x customize @key{RET} editing-basics @key{RET}}.
3187
3188 @node Q3.3.3, Q3.3.4, Q3.3.2, Customization
3189 @unnumberedsubsec Q3.3.3: How do I get XEmacs to put the time of day on the modeline?
3190
3191 Add the following line to your @file{.emacs} file to display the
3192 time:
3193
3194 @lisp
3195 (display-time)
3196 @end lisp
3197
3198 See @code{Customize} from the @code{Options} menu for customization.
3199
3200 @node Q3.3.4, Q3.3.5, Q3.3.3, Customization
3201 @unnumberedsubsec Q3.3.4: How do I turn off current chapter from AUC TeX modeline?
3202
3203 With AUC TeX, fast typing is hard because the current chapter, section
3204 etc. are given in the modeline.  How can I turn this off?
3205
3206 It's not AUC TeX, it comes from @code{func-menu} in @file{func-menu.el}.
3207 Add this code to your @file{.emacs} to turn it off:
3208
3209 @lisp
3210 (setq fume-display-in-modeline-p nil)
3211 @end lisp
3212
3213 Or just add a hook to @code{TeX-mode-hook} to turn it off only for TeX
3214 mode:
3215
3216 @lisp
3217 (add-hook 'TeX-mode-hook
3218           '(lambda () (setq fume-display-in-modeline-p nil)))
3219 @end lisp
3220
3221 @email{dhughes@@origin-at.co.uk, David Hughes} writes:
3222
3223 @quotation
3224 If you have 19.14 or later, try this instead; you'll still get the
3225 function name displayed in the modeline, but it won't attempt to keep
3226 track when you modify the file. To refresh when it gets out of synch,
3227 you simply need click on the @samp{Rescan Buffer} option in the
3228 function-menu.
3229
3230 @lisp
3231 (setq-default fume-auto-rescan-buffer-p nil)
3232 @end lisp
3233 @end quotation
3234
3235 @node Q3.3.5, Q3.4.1, Q3.3.4, Customization
3236 @unnumberedsubsec Q3.3.5: How can one change the modeline color based on the mode used?
3237
3238 You can use something like the following:
3239
3240 @lisp
3241 (add-hook 'lisp-mode-hook
3242           (lambda ()
3243             (set-face-background 'modeline "red" (current-buffer))))
3244 @end lisp
3245
3246 Then, when editing a Lisp file (i.e. when in Lisp mode), the modeline
3247 colors change from the default set in your @file{.emacs}.  The change
3248 will only be made in the buffer you just entered (which contains the
3249 Lisp file you are editing) and will not affect the modeline colors
3250 anywhere else.
3251
3252 Notes:
3253
3254 @itemize @bullet
3255
3256 @item
3257 The hook is the mode name plus @code{-hook}.  eg. c-mode-hook,
3258 c++-mode-hook, emacs-lisp-mode-hook (used for your @file{.emacs} or a
3259 @file{xx.el} file), lisp-interaction-mode-hook (the @samp{*scratch*}
3260 buffer), text-mode-hook, etc.
3261
3262 @item
3263 Be sure to use @code{add-hook}, not @code{(setq c-mode-hook xxxx)},
3264 otherwise you will erase anything that anybody has already put on the
3265 hook.
3266
3267 @item
3268 You can also do @code{(set-face-font 'modeline @var{font})},
3269 eg. @code{(set-face-font 'modeline "*bold-r-normal*140-100-100*"
3270 (current-buffer))} if you wish the modeline font to vary based on the
3271 current mode.
3272 @end itemize
3273
3274 This works in 19.15 as well, but there are additional modeline faces,
3275 @code{modeline-buffer-id}, @code{modeline-mousable}, and
3276 @code{modeline-mousable-minor-mode}, which you may want to customize.
3277
3278 @node Q3.4.1, Q3.4.2, Q3.3.5, Customization
3279 @unnumberedsec 3.4: Multiple Device Support
3280 @unnumberedsubsec Q3.4.1: How do I open a frame on another screen of my multi-headed display?
3281
3282 The support for this was revamped for 19.14.  Use the command
3283 @kbd{M-x make-frame-on-display}.  This command is also on the File menu
3284 in the menubar.
3285
3286 XEmacs 19.14 and later also have the command @code{make-frame-on-tty}
3287 which will establish a connection to any tty-like device.  Opening the
3288 TTY devices should be left to @code{gnuclient}, though.
3289
3290 @node Q3.4.2, Q3.5.1, Q3.4.1, Customization
3291 @unnumberedsubsec Q3.4.2: Can I really connect to a running XEmacs after calling up over a modem?  How?
3292
3293 If you're not running at least XEmacs 19.14, you can't.  Otherwise check
3294 out the @code{gnuattach} program supplied with XEmacs.  Starting with
3295 XEmacs 20.3, @code{gnuattach} and @code{gnudoit} functionality is
3296 provided by @code{gnuclient}.
3297
3298 Also @xref{Q5.0.12}.
3299
3300 @node Q3.5.1, Q3.5.2, Q3.4.2, Customization
3301 @unnumberedsec 3.5: The Keyboard
3302 @unnumberedsubsec Q3.5.1: How can I bind complex functions (or macros) to keys?
3303
3304 As an example, say you want the @kbd{paste} key on a Sun keyboard to
3305 insert the current Primary X selection at point. You can accomplish this
3306 with:
3307
3308 @lisp
3309 (define-key global-map [f18] 'x-insert-selection)
3310 @end lisp
3311
3312 However, this only works if there is a current X selection (the
3313 selection will be highlighted).  The functionality I like is for the
3314 @kbd{paste} key to insert the current X selection if there is one,
3315 otherwise insert the contents of the clipboard.  To do this you need to
3316 pass arguments to @code{x-insert-selection}.  This is done by wrapping
3317 the call in a 'lambda form:
3318
3319 @lisp
3320 (global-set-key [f18]
3321   (lambda () (interactive) (x-insert-selection t nil)))
3322 @end lisp
3323
3324 This binds the f18 key to a @dfn{generic} functional object.  The
3325 interactive spec is required because only interactive functions can be
3326 bound to keys.
3327
3328 For the FAQ example you could use:
3329
3330 @lisp
3331 (global-set-key [(control ?.)]
3332   (lambda () (interactive) (scroll-up 1)))
3333 (global-set-key [(control ?             ;)]
3334                           (lambda () (interactive) (scroll-up -1)))
3335 @end lisp
3336
3337 This is fine if you only need a few functions within the lambda body.
3338 If you're doing more it's cleaner to define a separate function as in
3339 question 3.5.3 (@pxref{Q3.5.3}).
3340
3341 @node Q3.5.2, Q3.5.3, Q3.5.1, Customization
3342 @unnumberedsubsec Q3.5.2: How can I stop down-arrow from adding empty lines to the bottom of my buffers?
3343
3344 Add the following line to your @file{.emacs} file:
3345
3346 @lisp
3347 (setq next-line-add-newlines nil)
3348 @end lisp
3349
3350 This has been the default setting in XEmacs for some time.
3351
3352 @node Q3.5.3, Q3.5.4, Q3.5.2, Customization
3353 @unnumberedsubsec Q3.5.3: How do I bind C-. and C-; to scroll one line up and down?
3354
3355 Add the following (Thanks to @email{mly@@adoc.xerox.com, Richard Mlynarik} and
3356 @email{wayne@@zen.cac.stratus.com, Wayne Newberry}) to @file{.emacs}:
3357
3358 @lisp
3359 (defun scroll-up-one-line ()
3360   (interactive)
3361   (scroll-up 1))
3362
3363 (defun scroll-down-one-line ()
3364   (interactive)
3365   (scroll-down 1))
3366
3367 (global-set-key [(control ?.)] 'scroll-up-one-line) ; C-.
3368 (global-set-key [(control ?             ;)] 'scroll-down-one-line) ; C-;
3369 @end lisp
3370
3371 The key point is that you can only bind simple functions to keys; you
3372 can not bind a key to a function that you're also passing arguments to.
3373 (@pxref{Q3.5.1} for a better answer).
3374
3375 @node Q3.5.4, Q3.5.5, Q3.5.3, Customization
3376 @unnumberedsubsec Q3.5.4: Globally binding @kbd{Delete}?
3377
3378 I cannot manage to globally bind my @kbd{Delete} key to something other
3379 than the default.  How does one do this?
3380
3381 @lisp
3382 (defun foo ()
3383   (interactive)
3384   (message "You hit DELETE"))
3385
3386 (global-set-key 'delete 'foo)
3387 @end lisp
3388
3389 However, some modes explicitly bind @kbd{Delete}, so you would need to
3390 add a hook that does @code{local-set-key} for them.  If what you want to
3391 do is make the Backspace and Delete keys work more PC/Motif-like, then
3392 take a look at the @file{delbs.el} package.
3393
3394 New in XEmacs 19.14 is a variable called @code{key-translation-map}
3395 which makes it easier to bind @kbd{Delete}.  @file{delbs.el} is a
3396 good example of how to do this correctly.
3397
3398 Also @xref{Q3.5.10}.
3399
3400 @node Q3.5.5, Q3.5.6, Q3.5.4, Customization
3401 @unnumberedsubsec Q3.5.5: Scrolling one line at a time.
3402
3403 Can the cursor keys scroll the screen a line at a time, rather than the
3404 default half page jump?  I tend it to find it disorienting.
3405
3406 Try this:
3407
3408 @lisp
3409 (defun scroll-one-line-up (&optional arg)
3410   "Scroll the selected window up (forward in the text) one line (or N lines)."
3411   (interactive "p")
3412   (scroll-up (or arg 1)))
3413
3414 (defun scroll-one-line-down (&optional arg)
3415   "Scroll the selected window down (backward in the text) one line (or N)."
3416   (interactive "p")
3417   (scroll-down (or arg 1)))
3418
3419 (global-set-key [up]   'scroll-one-line-up)
3420 (global-set-key [down] 'scroll-one-line-down)
3421 @end lisp
3422
3423 The following will also work but will affect more than just the cursor
3424 keys (i.e. @kbd{C-n} and @kbd{C-p}):
3425
3426 @lisp
3427 (setq scroll-step 1)
3428 @end lisp
3429
3430 Starting with XEmacs-20.3 you can also change this with Customize.
3431 Select from the @code{Options} menu
3432 @code{Customize->Emacs->Environment->Windows->Scroll Step...} or type
3433 @kbd{M-x customize @key{RET} windows @key{RET}}.
3434
3435 @node Q3.5.6, Q3.5.7, Q3.5.5, Customization
3436 @unnumberedsubsec Q3.5.6: How to map @kbd{Help} key alone on Sun type4 keyboard?
3437
3438 The following works in GNU Emacs 19:
3439
3440 @lisp
3441 (global-set-key [help] 'help-command);; Help
3442 @end lisp
3443
3444 The following works in XEmacs 19.15 with the addition of shift:
3445
3446 @lisp
3447 (global-set-key [(shift help)] 'help-command);; Help
3448 @end lisp
3449
3450 But it doesn't work alone.  This is in the file @file{PROBLEMS} which
3451 should have come with your XEmacs installation: @emph{Emacs ignores the
3452 @kbd{help} key when running OLWM}.
3453
3454 OLWM grabs the @kbd{help} key, and retransmits it to the appropriate
3455 client using
3456 @iftex
3457 @*
3458 @end iftex
3459 @code{XSendEvent}.  Allowing Emacs to react to synthetic
3460 events is a security hole, so this is turned off by default.  You can
3461 enable it by setting the variable @code{x-allow-sendevents} to t.  You
3462 can also cause fix this by telling OLWM to not grab the help key, with
3463 the null binding @code{OpenWindows.KeyboardCommand.Help:}.
3464
3465 @node Q3.5.7, Q3.5.8, Q3.5.6, Customization
3466 @unnumberedsubsec Q3.5.7: How can you type in special characters in XEmacs?
3467 @c Changed
3468 One way is to use the package @code{x-compose}.  Then you can use
3469 sequences like @kbd{Compose " a} to get Ã¤, etc.
3470
3471 Another way is to use the @code{iso-insert} package, provided in XEmacs
3472 19.15 and later. Then you can use sequences like @kbd{C-x 8 " a} to get
3473 ä, etc.
3474
3475 @email{glynn@@sensei.co.uk, Glynn Clements} writes:
3476
3477 @quotation
3478 It depends upon your X server.
3479
3480 Generally, the simplest way is to define a key as Multi_key with
3481 xmodmap, e.g.
3482 @c hey, show some respect, willya -- there's xkeycaps, isn't there? --
3483 @c chr ;)
3484 @example
3485         xmodmap -e 'keycode 0xff20 = Multi_key'
3486 @end example
3487
3488 You will need to pick an appropriate keycode. Use xev to find out the
3489 keycodes for each key.
3490
3491 [NB: On a `Windows' keyboard, recent versions of XFree86 automatically
3492 define the right `Windows' key as Multi_key'.]
3493
3494 Once you have Multi_key defined, you can use e.g.
3495 @example
3496         Multi a '       => Ã¡
3497         Multi e "       => Ã«
3498         Multi c ,       => Ã§
3499 @end example
3500
3501 etc.
3502
3503 Also, recent versions of XFree86 define various AltGr-<key>
3504 combinations as dead keys, i.e.
3505 @example
3506         AltGr [         => dead_diaeresis
3507         AltGr ]         => dead_tilde
3508         AltGr ;         => dead_acute
3509 @end example
3510 etc.
3511
3512 Running @samp{xmodmap -pk} will list all of the defined keysyms.
3513 @end quotation
3514
3515 @node Q3.5.8, Q3.5.9, Q3.5.7, Customization
3516 @unnumberedsubsec Q3.5.8: Why does @code{(global-set-key [delete-forward] 'delete-char)} complain?
3517
3518 Why does @code{(define-key global-map [ delete-forward ] 'delete-char)}
3519 complain of not being able to bind an unknown key?
3520
3521 Try this instead:
3522
3523 @lisp
3524 (define-key global-map [delete_forward] 'delete-char)
3525 @end lisp
3526
3527 and it will work.
3528
3529 What you are seeing above is a bug due to code that is trying to check
3530 for GNU Emacs syntax like:
3531
3532 (define-key global-map [C-M-a] 'delete-char)
3533
3534 which otherwise would cause no errors but would not result in the
3535 expected behavior.
3536
3537 This bug has been fixed in 19.14.
3538
3539 @node Q3.5.9, Q3.5.10, Q3.5.8, Customization
3540 @unnumberedsubsec Q3.5.9: How do I make the Delete key delete forward?
3541
3542 With XEmacs-20.2 use the @code{delbs} package:
3543
3544 @lisp
3545 (require 'delbs)
3546 @end lisp
3547
3548 This will give you the functions @code{delbs-enable-delete-forward} to
3549 set things up, and @code{delbs-disable-delete-forward} to revert to
3550 ``normal'' behavior.  Note that @code{delbackspace} package is obsolete.
3551
3552 Starting with XEmacs-20.3 better solution is to set variable
3553 @code{delete-key-deletes-forward} to t.  You can also change this with
3554 Customize. Select from the @code{Options} menu
3555 @code{Customize->Emacs->Editing->Basics->Delete Key Deletes Forward} or
3556 type @kbd{M-x customize @key{RET} editing-basics @key{RET}}.
3557
3558 Also @xref{Q3.5.4}.
3559
3560 @node Q3.5.10, Q3.5.11, Q3.5.9, Customization
3561 @unnumberedsubsec Q3.5.10: Can I turn on @dfn{sticky} modifier keys?
3562
3563 Yes, with @code{(setq modifier-keys-are-sticky t)}.  This will give the
3564 effect of being able to press and release Shift and have the next
3565 character typed come out in upper case.  This will affect all the other
3566 modifier keys like Control and Meta as well.
3567
3568 @email{ben@@xemacs.org, Ben Wing} writes:
3569
3570 @quotation
3571 One thing about the sticky modifiers is that if you move the mouse out
3572 of the frame and back in, it cancels all currently ``stuck'' modifiers.
3573 @end quotation
3574
3575 @node Q3.5.11, Q3.6.1, Q3.5.10, Customization
3576 @unnumberedsubsec Q3.5.11: How do I map the arrow keys?
3577 @c New
3578 Say you want to map @kbd{C-@key{right}} to forward-word:
3579
3580 @email{sds@@usa.net, Sam Steingold} writes:
3581
3582 @quotation
3583 @lisp
3584 ; both XEmacs and Emacs
3585 (define-key global-map [(control right)] 'forward-word)
3586 @end lisp
3587 or
3588 @lisp
3589 ; Emacs only
3590 (define-key global-map [C-right] 'forward-word)
3591 @end lisp
3592 or
3593 @lisp
3594 ; ver > 20, both
3595 (define-key global-map (kbd "C-<right>") 'forward-word)
3596 @end lisp
3597 @end quotation
3598
3599
3600
3601 @node Q3.6.1, Q3.6.2, Q3.5.11, Customization
3602 @unnumberedsec 3.6: The Cursor
3603 @unnumberedsubsec Q3.6.1: Is there a way to make the bar cursor thicker?
3604
3605 I'd like to have the bar cursor a little thicker, as I tend to "lose" it
3606 often.
3607
3608 For a 1 pixel bar cursor, use:
3609
3610 @lisp
3611 (setq bar-cursor t)
3612 @end lisp
3613
3614 For a 2 pixel bar cursor, use:
3615
3616 @lisp
3617 (setq bar-cursor 'anything-else)
3618 @end lisp
3619
3620 Starting with XEmacs-20.3 you can also change these with Customize.
3621 Select from the @code{Options} menu
3622 @code{Customize->Emacs->Environment->Display->Bar Cursor...} or type
3623 @kbd{M-x customize @key{RET} display @key{RET}}.
3624
3625 You can use a color to make it stand out better:
3626
3627 @example
3628 Emacs*cursorColor:      Red
3629 @end example
3630
3631 @node Q3.6.2, Q3.6.3, Q3.6.1, Customization
3632 @unnumberedsubsec Q3.6.2: Is there a way to get back the block cursor?
3633
3634 @lisp
3635 (setq bar-cursor nil)
3636 @end lisp
3637
3638 Starting with XEmacs-20.3 you can also change this with Customize.
3639 Select from the @code{Options} menu
3640 @code{Customize->Emacs->Environment->Display->Bar Cursor...} or type
3641 @kbd{M-x customize @key{RET} display @key{RET}}.
3642
3643 @node Q3.6.3, Q3.7.1, Q3.6.2, Customization
3644 @unnumberedsubsec Q3.6.3: Can I make the cursor blink?
3645
3646 If you are running a version of XEmacs older than 19.14, no.  Otherwise
3647 you can do the following:
3648
3649 @lisp
3650 (blink-cursor-mode)
3651 @end lisp
3652
3653 This function toggles between a steady cursor and a blinking cursor.
3654 You may also set this mode from the menu bar by selecting @samp{Options
3655 => Frame Appearance => Blinking Cursor}.  Remember to save options.
3656
3657 @node Q3.7.1, Q3.7.2, Q3.6.3, Customization
3658 @unnumberedsec 3.7: The Mouse and Highlighting
3659 @unnumberedsubsec Q3.7.1: How can I turn off Mouse pasting?
3660
3661 I keep hitting the middle mouse button by accident and getting stuff
3662 pasted into my buffer so how can I turn this off?
3663
3664 Here is an alternative binding, whereby the middle mouse button selects
3665 (but does not cut) the expression under the mouse. Clicking middle on a
3666 left or right paren will select to the matching one.  Note that you can
3667 use @code{define-key} or @code{global-set-key}.
3668
3669 @lisp
3670 (defun mouse-set-point-and-select (event)
3671   "Sets the point at the mouse location, then marks following form"
3672   (interactive "@@e")
3673   (mouse-set-point event)
3674   (mark-sexp 1))
3675 (define-key global-map [button2] 'mouse-set-point-and-select)
3676 @end lisp
3677
3678 @node Q3.7.2, Q3.7.3, Q3.7.1, Customization
3679 @unnumberedsubsec Q3.7.2: How do I set control/meta/etc modifiers on mouse buttons?
3680
3681 Use, for instance, @code{[(meta button1)]}. For example, here is a common
3682 setting for Common Lisp programmers who use the bundled @code{ilisp}
3683 package, whereby meta-button1 on a function name will find the file where
3684 the function name was defined, and put you at that location in the source
3685 file.
3686
3687 [Inside a function that gets called by the lisp-mode-hook and
3688 ilisp-mode-hook]
3689
3690 @lisp
3691 (local-set-key [(meta button1)] 'edit-definitions-lisp)
3692 @end lisp
3693
3694 @node Q3.7.3, Q3.7.4, Q3.7.2, Customization
3695 @unnumberedsubsec Q3.7.3: Clicking the left button does not do anything in buffer list.
3696
3697 I do @kbd{C-x C-b} to get a list of buffers and the entries get
3698 highlighted when I move the mouse over them but clicking the left mouse
3699 does not do anything.
3700
3701 Use the middle mouse button.
3702
3703 @node Q3.7.4, Q3.7.5, Q3.7.3, Customization
3704 @unnumberedsubsec Q3.7.4: How can I get a list of buffers when I hit mouse button 3?
3705
3706 The following code will replace the default popup on button3:
3707
3708 @lisp
3709 (global-set-key [button3] 'popup-buffer-menu)
3710 @end lisp
3711
3712 @node Q3.7.5, Q3.7.6, Q3.7.4, Customization
3713 @unnumberedsubsec Q3.7.5: Why does cut-and-paste not work between XEmacs and a cmdtool?
3714
3715 We don't know.  It's a bug.  There does seem to be a work-around,
3716 however.  Try running xclipboard first.  It appears to fix the problem
3717 even if you exit it.  (This should be mostly fixed in 19.13, but we
3718 haven't yet verified that).
3719
3720 @node Q3.7.6, Q3.7.7, Q3.7.5, Customization
3721 @unnumberedsubsec Q3.7.6: How I can set XEmacs up so that it pastes where the text cursor is?
3722
3723 By default XEmacs pastes X selections where the mouse pointer is.  How
3724 do I disable this?
3725
3726 Examine the function @code{mouse-yank}, by typing @kbd{C-h f mouse-yank
3727 @key{RET}}.
3728
3729 To get XEmacs to paste at the text cursor, add this your @file{.emacs}:
3730
3731 @lisp
3732 (setq mouse-yank-at-point t)
3733 @end lisp
3734
3735 Starting with XEmacs-20.2 you can also change this with Customize.
3736 Select from the @code{Options} menu
3737 @code{Customize->Emacs->Editing->Mouse->Yank At Point...} or type
3738 @kbd{M-x customize @key{RET} mouse @key{RET}}.
3739
3740 @node Q3.7.7, Q3.7.8, Q3.7.6, Customization
3741 @unnumberedsubsec Q3.7.7: How do I select a rectangular region?
3742
3743 Just select the region normally, then use the rectangle commands (e.g.
3744 @code{kill-rectangle} on it.  The region does not highlight as a
3745 rectangle, but the commands work just fine.
3746
3747 To actually sweep out rectangular regions with the mouse you can use
3748 @code{mouse-track-do-rectangle} which is assigned to @kbd{M-button1}.
3749 Then use rectangle commands.
3750
3751 You can also do the following to change default behavior to sweep out
3752 rectangular regions:
3753
3754 @lisp
3755 (setq mouse-track-rectangle-p t)
3756 @end lisp
3757
3758 Starting with XEmacs-20.2 you can also change this with Customize.
3759 Select from the @code{Options} menu
3760 @code{Customize->Emacs->Editing->Mouse->Track Rectangle...} or type
3761 @kbd{M-x customize @key{RET} mouse @key{RET}}.
3762
3763
3764 @example
3765  mouse-track-do-rectangle: (event)
3766    -- an interactive compiled Lisp function.
3767  Like `mouse-track' but selects rectangles instead of regions.
3768 @end example
3769
3770 @node Q3.7.8, Q3.8.1, Q3.7.7, Customization
3771 @unnumberedsubsec Q3.7.8: Why does @kbd{M-w} take so long?
3772
3773 It actually doesn't.  It leaves the region visible for a second so that
3774 you can see what area is being yanked.  If you start working, though, it
3775 will immediately complete its operation.  In other words, it will only
3776 delay for a second if you let it.
3777
3778 @node Q3.8.1, Q3.8.2, Q3.7.8, Customization
3779 @unnumberedsec 3.8: The Menubar and Toolbar
3780 @unnumberedsubsec Q3.8.1: How do I get rid of the menu (or menubar)?
3781
3782 If you are running XEmacs 19.13 and earlier, add this command to your
3783 @file{.emacs}.
3784
3785 @lisp
3786 (set-menubar nil)
3787 @end lisp
3788
3789 Starting with XEmacs 19.14 the preferred method is:
3790
3791 @lisp
3792 (set-specifier menubar-visible-p nil)
3793 @end lisp
3794
3795 @node Q3.8.2, Q3.8.3, Q3.8.1, Customization
3796 @unnumberedsubsec Q3.8.2: Can I customize the basic menubar?
3797
3798 For an extensive menubar, add this line to your @file{.emacs}:
3799
3800 @lisp
3801 (load "big-menubar")
3802 @end lisp
3803
3804 If you'd like to write your own, this file provides as good a set of
3805 examples as any to start from.  The file is located in
3806 @file{lisp/packages/big-menubar.el} in the XEmacs installation
3807 directory.
3808
3809 @node Q3.8.3, Q3.8.4, Q3.8.2, Customization
3810 @unnumberedsubsec Q3.8.3: How do I control how many buffers are listed in the menu @code{Buffers List}?
3811
3812 Add the following to your @file{.emacs} (suit to fit):
3813
3814 @lisp
3815 (setq buffers-menu-max-size 20)
3816 @end lisp
3817
3818 For no limit, use an argument of @samp{nil}.
3819
3820 Starting with XEmacs-20.3 you can also change this with Customize.
3821 Select from the @code{Options} menu
3822 @code{Customize->Emacs->Environment->Menu->Buffers Menu->Max Size...} or
3823 type @kbd{M-x customize @key{RET} buffers-menu @key{RET}}.
3824
3825 @node Q3.8.4, Q3.8.5, Q3.8.3, Customization
3826 @unnumberedsubsec Q3.8.4: Resources like @code{Emacs*menubar*font} are not working?
3827
3828 I am trying to use a resource like @code{Emacs*menubar*font} to set the
3829 font of the menubar but it's not working.
3830
3831 If you are using the real Motif menubar, this resource is not
3832 recognized; you have to say:
3833
3834 @example
3835 Emacs*menubar*fontList: FONT
3836 @end example
3837
3838 If you are using the Lucid menubar, the former resource will be
3839 recognized only if the latter resource is unset.  This means that the
3840 resource
3841
3842 @example
3843 *fontList: FONT
3844 @end example
3845
3846 will override
3847
3848 @example
3849 Emacs*menubar*font: FONT
3850 @end example
3851
3852 even though the latter is more specific.
3853
3854 @node Q3.8.5, Q3.9.1, Q3.8.4, Customization
3855 @unnumberedsubsec Q3.8.5: How can I bind a key to a function to toggle the toolbar?
3856
3857 Try something like:
3858
3859 @lisp
3860 (defun my-toggle-toolbar ()
3861   (interactive)
3862   (set-specifier default-toolbar-visible-p
3863                  (not (specifier-instance default-toolbar-visible-p))))
3864 (global-set-key "\C-xT" 'my-toggle-toolbar)
3865 @end lisp
3866
3867 There are redisplay bugs in 19.14 that may make the preceding result in
3868 a messed-up display, especially for frames with multiple windows.  You
3869 may need to resize the frame before XEmacs completely realizes the
3870 toolbar is really gone.
3871
3872 Thanks to @email{martin@@xemacs.org, Martin Buchholz} for the correct
3873 code.
3874
3875 @node Q3.9.1, Q3.9.2, Q3.8.5, Customization
3876 @unnumberedsec 3.9: Scrollbars
3877 @unnumberedsubsec Q3.9.1: How can I disable the scrollbar?
3878
3879 To disable them for all frames, add the following line to
3880 your @file{.Xdefaults}:
3881
3882 @example
3883 Emacs.scrollBarWidth:  0
3884 @end example
3885
3886 Or select from the @code{Options} menu @code{Frame Appearance->Scrollbars}.
3887 Remember to save options.
3888
3889 To turn the scrollbar off on a per-frame basis, use the following
3890 function:
3891
3892 @lisp
3893 (set-specifier scrollbar-width 0 (selected-frame))
3894 @end lisp
3895
3896 You can actually turn the scrollbars on at any level you want by
3897 substituting for (selected-frame) in the above command.  For example, to
3898 turn the scrollbars off only in a single buffer:
3899
3900 @lisp
3901 (set-specifier scrollbar-width 0 (current-buffer))
3902 @end lisp
3903
3904 In XEmacs versions prior to 19.14, you had to use the hairier construct:
3905
3906 @lisp
3907 (set-specifier scrollbar-width (cons (selected-frame) 0))
3908 @end lisp
3909
3910 @node Q3.9.2, Q3.9.3, Q3.9.1, Customization
3911 @unnumberedsubsec Q3.9.2: How can one use resources to change scrollbar colors?
3912
3913 Here's a recap of how to use resources to change your scrollbar colors:
3914
3915 @example
3916 ! Motif scrollbars
3917
3918 Emacs*XmScrollBar.Background: skyblue
3919 Emacs*XmScrollBar.troughColor: lightgray
3920
3921 ! Athena scrollbars
3922
3923 Emacs*Scrollbar.Foreground: skyblue
3924 Emacs*Scrollbar.Background: lightgray
3925 @end example
3926
3927 Note the capitalization of @code{Scrollbar} for the Athena widget.
3928
3929 @node Q3.9.3, Q3.9.4, Q3.9.2, Customization
3930 @unnumberedsubsec Q3.9.3: Moving the scrollbar can move the point; can I disable this?
3931
3932 When I move the scrollbar in an XEmacs window, it moves the point as
3933 well, which should not be the default behavior.  Is this a bug or a
3934 feature?  Can I disable it?
3935
3936 The current behavior is a feature, not a bug.  Point remains at the same
3937 buffer position as long as that position does not scroll off the screen.
3938 In that event, point will end up in either the upper-left or lower-left
3939 hand corner.
3940
3941 This cannot be changed.
3942
3943 @node Q3.9.4, Q3.10.1, Q3.9.3, Customization
3944 @unnumberedsubsec Q3.9.4: How can I get automatic horizontal scrolling?
3945
3946 By the same token, how can I turn it off in specific modes?
3947
3948 To do this, add to your @file{.emacs} file:
3949
3950 @lisp
3951 (require 'auto-show)
3952 @end lisp
3953
3954 Then do @code{(setq truncate-lines t)} in the mode-hooks for any modes
3955 in which you want lines truncated.
3956
3957 More precisely: If @code{truncate-lines} is nil, horizontal scrollbars
3958 will never appear.  Otherwise, they will appear only if the value of
3959 @code{scrollbar-height} for that buffer/window/etc. is non-zero.  If you
3960 do
3961
3962 @lisp
3963 (set-specifier scrollbar-height 0)
3964 @end lisp
3965
3966 then horizontal scrollbars will not appear in truncated buffers unless
3967 the package specifically asked for them.
3968
3969 Automatic horizontal scrolling is now standard, starting with 19.14.
3970
3971 @node Q3.10.1, Q3.10.2, Q3.9.4, Customization
3972 @unnumberedsec 3.10: Text Selections
3973 @unnumberedsubsec Q3.10.1: How can I turn off or change highlighted selections?
3974
3975 The @code{zmacs} mode allows for what some might call gratuitous
3976 highlighting for selected regions (either by setting mark or by using
3977 the mouse).  This is the default behavior.  To turn off, add the
3978 following line to your @file{.emacs} file:
3979
3980 @lisp
3981 (setq zmacs-regions nil)
3982 @end lisp
3983
3984 Starting with XEmacs-20.2 you can also change this with Customize. Select
3985 from the @code{Options} menu @code{Customize->Emacs->Editing->Basics->Zmacs
3986 Regions} or type @kbd{M-x customize @key{RET} editing-basics @key{RET}}.
3987
3988 To change the face for selection, look at @code{Options->Customize} on
3989 the menubar.
3990
3991 @node Q3.10.2, Q3.10.3, Q3.10.1, Customization
3992 @unnumberedsubsec Q3.10.2: How do I get that typing on an active region removes it?
3993
3994 I want to change things so that if I select some text and start typing,
3995 the typed text replaces the selected text, similar to Motif.
3996
3997 You want to use something called @dfn{pending delete}.  Pending delete
3998 is what happens when you select a region (with the mouse or keyboard)
3999 and you press a key to replace the selected region by the key you typed.
4000 Usually backspace kills the selected region.
4001
4002 To get this behavior, add the following line to your @file{.emacs}:
4003
4004 @lisp
4005 (turn-on-pending-delete)
4006 @end lisp
4007
4008 Note that this will work with both Backspace and Delete.
4009
4010 @node Q3.10.3, Q3.10.4, Q3.10.2, Customization
4011 @unnumberedsubsec Q3.10.3: Can I turn off the highlight during isearch?
4012
4013 I do not like my text highlighted while I am doing isearch as I am not
4014 able to see what's underneath.  How do I turn it off?
4015
4016 Put the following in your @file{.emacs}:
4017
4018 @lisp
4019 (setq isearch-highlight nil)
4020 @end lisp
4021
4022 Starting with XEmacs-20.2 you can also change this with Customize. Type
4023 @kbd{M-x customize-variable @key{RET} isearch-highlight @key{RET}}.
4024
4025 Note also that isearch-highlight affects query-replace and ispell.
4026 Instead of disabling isearch-highlight you may find that a better
4027 solution consists of customizing the @code{isearch} face.
4028
4029 @node Q3.10.4, Q3.10.5, Q3.10.3, Customization
4030 @unnumberedsubsec Q3.10.4: How do I turn off highlighting after @kbd{C-x C-p} (mark-page)?
4031
4032 Put this in your @code{.emacs}:
4033
4034 @lisp
4035 (setq zmacs-regions nil)
4036 @end lisp
4037
4038 @strong{Warning: This command turns off all region highlighting.}
4039
4040 Also @xref{Q3.10.1}.
4041
4042 @node Q3.10.5,  , Q3.10.4, Customization
4043 @unnumberedsubsec Q3.10.5: The region disappears when I hit the end of buffer while scrolling.
4044
4045 This has been fixed by default starting with XEmacs-20.3.
4046
4047 With older versions you can turn this feature (if it indeed is a feature)
4048 off like this:
4049
4050 @lisp
4051 (defadvice scroll-up (around scroll-up freeze)
4052   (interactive "_P")
4053   (let ((zmacs-region-stays t))
4054     (if (interactive-p)
4055         (condition-case nil
4056             ad-do-it
4057           (end-of-buffer (goto-char (point-max))))
4058       ad-do-it)))
4059
4060 (defadvice scroll-down (around scroll-down freeze)
4061   (interactive "_P")
4062   (let ((zmacs-region-stays t))
4063     (if (interactive-p)
4064         (condition-case nil
4065             ad-do-it
4066           (beginning-of-buffer (goto-char (point-min))))
4067       ad-do-it)))
4068 @end lisp
4069
4070 Thanks to @email{raman@@adobe.com, T. V. Raman} for assistance in deriving this
4071 answer.
4072
4073 @node Subsystems, Miscellaneous, Customization, Top
4074 @unnumbered 4 Major Subsystems
4075
4076 This is part 4 of the XEmacs Frequently Asked Questions list.  This
4077 section is devoted to major XEmacs subsystems.
4078
4079 @menu
4080 Reading Mail with VM:
4081 * Q4.0.1::      How do I set up VM to retrieve remote mail using POP?
4082 * Q4.0.2::      How do I get VM to filter mail for me?
4083 * Q4.0.3::      How can I get VM to automatically check for new mail?
4084 * Q4.0.4::      [This question intentionally left blank]
4085 * Q4.0.5::      How do I get my outgoing mail archived?
4086 * Q4.0.6::      I have various addresses at which I receive mail.  How can I tell VM to ignore them when doing a "reply-all"?
4087 * Q4.0.7::      Is there a mailing list or FAQ for VM?
4088 * Q4.0.8::      Remote mail reading with VM.
4089 * Q4.0.9::      rmail or VM gets an error incorporating new mail.
4090 * Q4.0.10::     How do I make VM stay in a single frame?
4091 * Q4.0.11::     How do I make VM or mh-e display graphical smilies?
4092 * Q4.0.12::     Customization of VM not covered in the manual or here.
4093
4094 Web browsing with W3:
4095 * Q4.1.1::      What is W3?
4096 * Q4.1.2::      How do I run W3 from behind a firewall?
4097 * Q4.1.3::      Is it true that W3 supports style sheets and tables?
4098
4099 Reading Netnews and Mail with Gnus:
4100 * Q4.2.1::      GNUS, (ding) Gnus, Gnus 5, September Gnus, Red Gnus,argh!
4101 * Q4.2.2::      [This question intentionally left blank]
4102 * Q4.2.3::      How do I make Gnus stay within a single frame?
4103 * Q4.2.4::      How do I customize the From: line?
4104
4105 Other Mail & News:
4106 * Q4.3.1::      How can I read and/or compose MIME messages?
4107 * Q4.3.2::      What is TM and where do I get it?
4108 * Q4.3.3::      Why isn't this @code{movemail} program working?
4109 * Q4.3.4::      Movemail is also distributed by Netscape?  Can that cause problems?
4110 * Q4.3.5::      Where do I find pstogif (required by tm)?
4111
4112 Sparcworks, EOS, and WorkShop:
4113 * Q4.4.1::      What is SPARCworks, EOS, and WorkShop
4114 * Q4.4.2::      How do I start the Sun Workshop support in XEmacs 21?
4115
4116 Energize:
4117 * Q4.5.1::      What is/was Energize?
4118
4119 Infodock:
4120 * Q4.6.1::      What is Infodock?
4121
4122 Other Unbundled Packages:
4123 * Q4.7.1::      What is AUC TeX?  Where do you get it?
4124 * Q4.7.2::      Are there any Emacs Lisp Spreadsheets?
4125 * Q4.7.3::      Byte compiling AUC TeX on XEmacs 19.14
4126 * Q4.7.4::      Problems installing AUC TeX
4127 * Q4.7.5::      Is there a reason for an Emacs package not to be included in XEmacs?
4128 * Q4.7.6::      Is there a MatLab mode?
4129 @end menu
4130
4131 @node Q4.0.1, Q4.0.2, Subsystems, Subsystems
4132 @unnumberedsec 4.0: Reading Mail with VM
4133 @unnumberedsubsec Q4.0.1: How do I set up VM to retrieve mail from a remote site using POP?
4134
4135 Use @code{vm-spool-files}, like this for example:
4136
4137 @lisp
4138 (setq vm-spool-files '("/var/spool/mail/wing"
4139                        "netcom23.netcom.com:110:pass:wing:MYPASS"))
4140 @end lisp
4141
4142 Of course substitute your actual password for MYPASS.
4143
4144 @node Q4.0.2, Q4.0.3, Q4.0.1, Subsystems
4145 @unnumberedsubsec Q4.0.2: How do I get VM to filter mail for me?
4146
4147 One possibility is to use procmail to split your mail before it gets to
4148 VM.  I prefer this personally, since there are many strange and
4149 wonderful things one can do with procmail.  Procmail may be found at
4150 @uref{ftp://ftp.informatik.rwth-aachen.de/pub/packages/procmail/}.
4151
4152 Also see the Mail Filtering FAQ at:
4153 @iftex
4154 @*
4155 @end iftex
4156 @uref{ftp://rtfm.mit.edu/pub/usenet/news.answers/mail/filtering-faq}.
4157 @c Link above,
4158 @c <URL:http://www.cis.ohio-state.edu/hypertext/faq/usenet/mail/filtering-faq/faq.html>
4159 @c was dead.
4160
4161 @node Q4.0.3, Q4.0.4, Q4.0.2, Subsystems
4162 @unnumberedsubsec Q4.0.3: How can I get VM to automatically check for new mail?
4163
4164 @email{turner@@lanl.gov, John Turner} writes:
4165
4166 @quotation
4167 Use the following:
4168
4169 @lisp
4170 (setq vm-auto-get-new-mail 60)
4171 @end lisp
4172 @end quotation
4173
4174 @node Q4.0.4, Q4.0.5, Q4.0.3, Subsystems
4175 @unnumberedsubsec Q4.0.4: [This question intentionally left blank]
4176
4177 Obsolete question, left blank to avoid renumbering.
4178
4179 @node Q4.0.5, Q4.0.6, Q4.0.4, Subsystems
4180 @unnumberedsubsec Q4.0.5: How do I get my outgoing mail archived?
4181
4182 @lisp
4183 (setq mail-archive-file-name "~/outbox")
4184 @end lisp
4185
4186 @node Q4.0.6, Q4.0.7, Q4.0.5, Subsystems
4187 @unnumberedsubsec Q4.0.6: I have various addresses at which I receive mail.  How can I tell VM to ignore them when doing a "reply-all"?
4188
4189 Set @code{vm-reply-ignored-addresses} to a list, like
4190
4191 @lisp
4192 (setq vm-reply-ignored-addresses
4193       '("wing@@nuspl@@nvwls.cc.purdue.edu,netcom[0-9]*.netcom.com"
4194         "wing@@netcom.com" "wing@@xemacs.org"))
4195 @end lisp
4196
4197 Note that each string is a regular expression.
4198
4199 @node Q4.0.7, Q4.0.8, Q4.0.6, Subsystems
4200 @unnumberedsubsec Q4.0.7: Is there a mailing list or FAQ for VM?
4201
4202 A FAQ for VM exists at @uref{http://www.cyberpass.net/~gorkab/vmfaq.htm}.
4203
4204 VM has its own newsgroups gnu.emacs.vm.info and gnu.emacs.vm.bug.
4205
4206 @node Q4.0.8, Q4.0.9, Q4.0.7,  Subsystems
4207 @unnumberedsubsec Q4.0.8: Remote mail reading with VM.
4208
4209 My mailbox lives at the office on a big honkin server.  My regular INBOX
4210 lives on my honkin desktop machine.  I now can PPP to the office from
4211 home which is far from honking...  I'd like to be able to read mail at
4212 home without storing it here and I'd like to use xemacs and VM at
4213 home...  Is there a recommended setup?
4214
4215 @email{nuspl@@nvwls.cc.purdue.edu, Joseph J. Nuspl Jr.} writes:
4216
4217 @quotation
4218 There are several ways to do this.
4219
4220 @enumerate
4221 @item
4222 Set your display to your home machine and run dxpc or one of the other X
4223 compressors.
4224
4225 @item
4226 NFS mount your desktop machine on your home machine and modify your pop
4227 command on your home machine to rsh to your desktop machine and actually
4228 do the pop get's.
4229
4230 @item
4231 Run a POP server on your desktop machine as well and do a sort of two
4232 tiered POP get.
4233 @end enumerate
4234 @end quotation
4235
4236         @email{wmperry@@monolith.spry.com, William Perry} adds:
4237
4238 @quotation
4239 Or you could run a pop script periodically on your desktop machine, and
4240 just use ange-ftp or NFS to get to your mailbox.  I used to do this all
4241 the time back at IU.
4242 @end quotation
4243
4244 @node Q4.0.9, Q4.0.10, Q4.0.8, Subsystems
4245 @unnumberedsubsec Q4.0.9: rmail or VM gets an error incorporating new mail.
4246
4247 Quoting the XEmacs PROBLEMS file:
4248
4249 @quotation
4250 rmail and VM get new mail from @file{/usr/spool/mail/$USER} using a
4251 program called @code{movemail}.  This program interlocks with
4252 @code{/bin/mail} using the protocol defined by @code{/bin/mail}.
4253
4254 There are two different protocols in general use.  One of them uses the
4255 @code{flock} system call.  The other involves creating a lock file;
4256 @code{movemail} must be able to write in @file{/usr/spool/mail} in order
4257 to do this.  You control which one is used by defining, or not defining,
4258 the macro @code{MAIL_USE_FLOCK} in @file{config.h} or the m- or s- file
4259 it includes.
4260
4261 @strong{IF YOU DON'T USE THE FORM OF INTERLOCKING THAT IS NORMAL ON YOUR
4262 SYSTEM, YOU CAN LOSE MAIL!}
4263
4264 If your system uses the lock file protocol, and fascist restrictions
4265 prevent ordinary users from writing the lock files in
4266 @file{/usr/spool/mail}, you may need to make @code{movemail} setgid to a
4267 suitable group such as @samp{mail}.  You can use these commands (as
4268 root):
4269
4270 @example
4271 chgrp mail movemail
4272 chmod 2755 movemail
4273 @end example
4274
4275 If your system uses the lock file protocol, and fascist restrictions
4276 prevent ordinary users from writing the lock files in
4277 @file{/usr/spool/mail}, you may need to make @code{movemail} setgid to a
4278 suitable group such as @code{mail}.  To do this, use the following
4279 commands (as root) after doing the make install.
4280
4281 @example
4282 chgrp mail movemail
4283 chmod 2755 movemail
4284 @end example
4285
4286 Installation normally copies movemail from the build directory to an
4287 installation directory which is usually under @file{/usr/local/lib}.
4288 The installed copy of @code{movemail} is usually in the directory
4289 @file{/usr/local/lib/emacs/VERSION/TARGET}.  You must change the group
4290 and mode of the installed copy; changing the group and mode of the build
4291 directory copy is ineffective.
4292 @end quotation
4293
4294 @node Q4.0.10, Q4.0.11, Q4.0.9, Subsystems
4295 @unnumberedsubsec Q4.0.10: How do I make VM stay in a single frame?
4296
4297 John.@email{Cooper@@Eng.Sun.COM, John S Cooper} writes:
4298
4299 @quotation
4300 @lisp
4301                                         ; Don't use multiple frames
4302 (setq vm-frame-per-composition nil)
4303 (setq vm-frame-per-folder nil)
4304 (setq vm-frame-per-edit nil)
4305 (setq vm-frame-per-summary nil)
4306 @end lisp
4307 @end quotation
4308
4309 @node Q4.0.11, Q4.0.12, Q4.0.10, Subsystems
4310 @unnumberedsubsec Q4.0.11: How do I make VM or mh-e display graphical smilies?
4311 @c Changed June
4312 For mh-e use the following:
4313
4314 @lisp
4315 (add-hook 'mh-show-mode-hook '(lambda ()
4316                                 (smiley-region (point-min)
4317                                                (point-max))))
4318 @end lisp
4319
4320 @email{bill@@carpenter.ORG, WJCarpenter} writes:
4321 For VM use the following:
4322 @lisp
4323        (autoload 'smiley-region "smiley" nil t)
4324        (add-hook 'vm-select-message-hook
4325                  '(lambda ()
4326                     (smiley-region (point-min)
4327                                    (point-max))))
4328 @end lisp
4329
4330 For tm use the following:
4331 @lisp
4332 (autoload 'smiley-buffer "smiley" nil t)
4333 (add-hook 'mime-viewer/plain-text-preview-hook 'smiley-buffer)
4334 @end lisp
4335
4336 @node Q4.0.12, Q4.1.1, Q4.0.11, Subsystems
4337 @unnumberedsubsec Q4.0.12: Customization of VM not covered in the manual, or here.
4338
4339 @email{boffi@@hp735.stru.polimi.it, giacomo boffi} writes:
4340
4341 @quotation
4342 The meta-answer is to look into the file @file{vm-vars.el}, in the vm
4343 directory of the lisp library.
4344
4345 @file{vm-vars.el} contains, initializes and carefully describes, with
4346 examples of usage, the plethora of user options that @emph{fully}
4347 control VM's behavior.
4348
4349 Enter vm-vars, @code{forward-search} for toolbar, find the variables
4350 that control the toolbar placement, appearance, existence, copy to your
4351 @file{.emacs} or @file{.vm} and modify according to the detailed
4352 instructions.
4353
4354 The above also applies to all the various features of VM: search for
4355 some keywords, maybe the first you conjure isn't appropriate, find the
4356 appropriate variables, copy and experiment.
4357 @end quotation
4358
4359 @node Q4.1.1, Q4.1.2, Q4.0.12, Subsystems
4360 @unnumberedsec 4.1: Web browsing with W3
4361 @unnumberedsubsec Q4.1.1: What is W3?
4362
4363 W3 is an advanced graphical browser written in Emacs lisp that runs on
4364 XEmacs.  It has full support for cascaded style sheets, and more...
4365
4366 It has a home web page at
4367 @uref{http://www.cs.indiana.edu/elisp/w3/docs.html}.
4368
4369 @node Q4.1.2, Q4.1.3, Q4.1.1, Subsystems
4370 @unnumberedsubsec Q4.1.2: How do I run W3 from behind a firewall?
4371
4372 There is a long, well-written, detailed section in the W3 manual that
4373 describes how to do this.  Look in the section entitled "Firewalls".
4374
4375 @node Q4.1.3, Q4.2.1, Q4.1.2, Subsystems
4376 @unnumberedsubsec Q4.1.3: Is it true that W3 supports style sheets and tables?
4377
4378 Yes, and much more.  W3, as distributed with the latest XEmacs is a
4379 full-featured web browser.
4380
4381 @node Q4.2.1, Q4.2.2, Q4.1.3, Subsystems
4382 @unnumberedsec 4.2: Reading Netnews and Mail with Gnus
4383 @unnumberedsubsec Q4.2.1: GNUS, (ding) Gnus, Gnus 5, September Gnus, Red Gnus, Quassia Gnus, argh!
4384
4385 The Gnus numbering issues are not meant for mere mortals to know them.
4386 If you feel you @emph{must} enter the muddy waters of Gnus, visit the
4387 excellent FAQ, maintained by Justin Sheehy, at:
4388
4389 @example
4390 @uref{http://www.ccs.neu.edu/software/contrib/gnus/}
4391 @end example
4392
4393 See also Gnus home page
4394 @example
4395 @uref{http://www.gnus.org/}
4396 @end example
4397
4398 @node Q4.2.2, Q4.2.3, Q4.2.1, Subsystems
4399 @unnumberedsubsec Q4.2.2: This question intentionally left blank.
4400
4401 Obsolete question, left blank to avoid renumbering.
4402
4403 @node Q4.2.3, Q4.2.4, Q4.2.2, Subsystems
4404 @unnumberedsubsec Q4.2.3: How do I make Gnus stay within a single frame?
4405
4406 The toolbar code to start Gnus opens the new frame---and it's a feature
4407 rather than a bug.  If you don't like it, but would still like to click
4408 on the seemly icon, use the following code:
4409
4410 @lisp
4411 (defun toolbar-news ()
4412   (gnus))
4413 @end lisp
4414
4415 It will redefine the callback function of the icon to just call
4416 @code{gnus}, without all the fancy frame stuff.
4417
4418 @node Q4.2.4, Q4.3.1, Q4.2.3, Subsystems
4419 @unnumberedsubsec Q4.2.4: How do I customize the From: line?
4420
4421 How do I change the @code{From:} line?  I have set gnus-user-from-line
4422 to
4423 @example
4424 Gail Gurman <gail.gurman@@sybase.com>
4425 @end example
4426 @noindent , but XEmacs Gnus doesn't use
4427 it. Instead it uses
4428 @example
4429 Gail Mara Gurman @email{gailg@@deall}
4430 @end example
4431 @noindent and then complains
4432 that it's incorrect. Also, as you perhaps can see, my Message-ID is
4433 screwy. How can I change that?
4434
4435 @email{larsi@@ifi.uio.no, Lars Magne Ingebrigtsen} writes:
4436
4437 @quotation
4438 Set @code{user-mail-address} to @samp{gail.gurman@@sybase.com} or
4439 @code{mail-host-address} to @samp{sybase.com}.
4440 @end quotation
4441
4442 @node Q4.3.1, Q4.3.2, Q4.2.4, Subsystems
4443 @unnumberedsec 4.3: Other Mail & News
4444 @unnumberedsubsec Q4.3.1: How can I read and/or compose MIME messages?
4445 @c Changed June
4446
4447 VM supports MIME natively.
4448
4449 You probably want to use the Tools for MIME (tm).  @xref{Q4.3.2}, for
4450 details.
4451
4452 @email{trey@@cs.berkeley.edu, Trey Jackson} has an Emacs & MIME web page at
4453 @iftex
4454 @*
4455 @end iftex
4456 @uref{http://bmrc.berkeley.edu/~trey/emacs/mime.html}.
4457
4458
4459 Another possibility is RMIME.  You may find RMIME at
4460 @iftex
4461 @*
4462 @end iftex
4463 @uref{http://www.cinti.net/~rmoody/rmime/index.html}.
4464
4465
4466 @node Q4.3.2, Q4.3.3, Q4.3.1, Subsystems
4467 @unnumberedsubsec Q4.3.2: What is TM and where do I get it?
4468
4469 TM stands for @dfn{Tools for MIME} and not Tiny MIME.  TM integrates
4470 with all major XEmacs packages like Gnus (all flavors), VM, MH-E, and
4471 mailcrypt.  It provides totally transparent and trouble-free MIME
4472 support.  When appropriate a message will be decoded in place in an
4473 XEmacs buffer.
4474
4475 TM now comes as a package with XEmacs 19.16 and XEmacs 20.2.
4476
4477 TM was written by @email{morioka@@jaist.ac.jp, MORIOKA Tomohiko} and
4478 @email{shuhei-k@@jaist.ac.jp, KOBAYASHI
4479 Shuhei}.
4480
4481 It is based on the work of @email{umerin@@mse.kyutech.ac.jp, UMEDA
4482 Masanobu}, the original writer of GNUS.
4483
4484 The following information is from the @file{README}:
4485
4486 @dfn{tm} is a MIME package for GNU Emacs.
4487 tm has following functions:
4488
4489 @itemize @bullet
4490 @item MIME style multilingual header.
4491 @item MIME message viewer (mime/viewer-mode).
4492 @item MIME message composer (mime/editor-mode).
4493 @item MIME extenders for mh-e, GNUS, RMAIL and VM.
4494 @end itemize
4495
4496 tm is available from following anonymous ftp sites:
4497 @itemize @bullet
4498 @comment @item @uref{ftp://ftp.jaist.ac.jp/pub/GNU/elisp/mime/} (Japan).
4499 @comment @item @uref{ftp://ftp.nis.co.jp/pub/gnu/emacs-lisp/tm/} (Japan).
4500 @comment @c The host above is unknown.
4501 @comment @item @uref{ftp://ftp.nisiq.net/pub/gnu/emacs-lisp/tm/} (US).
4502 @comment @item @uref{ftp://ftp.miranova.com/pub/gnus/jaist.ac.jp/} (US).
4503 @item @uref{ftp://ftp.unicamp.br/pub/mail/mime/tm/} (Brasil).
4504 @item @uref{ftp://ftp.th-darmstadt.de/pub/editors/GNU-Emacs/lisp/mime/} (Germany).
4505 @item @uref{ftp://ftp.tnt.uni-hannover.de/pub/editors/xemacs/contrib/} (Germany).
4506 @end itemize
4507
4508 Don't let the installation procedure & instructions stop you from trying
4509 this package out---it's much simpler than it looks, and once installed,
4510 trivial to use.
4511
4512 @node Q4.3.3, Q4.3.4, Q4.3.2, Subsystems
4513 @unnumberedsubsec Q4.3.3: Why isn't this @code{movemail} program working?
4514
4515 Ben Wing @email{ben@@xemacs.org} writes:
4516
4517 @quotation
4518 It wasn't chown'ed/chmod'd correctly.
4519 @end quotation
4520
4521 @node Q4.3.4, Q4.3.5, Q4.3.3, Subsystems
4522 @unnumberedsubsec Q4.3.4: Movemail is also distributed by Netscape?  Can that cause problems?
4523
4524 @email{steve@@xemacs.org, Steve Baur} writes:
4525
4526 @quotation
4527 Yes.  Always use the movemail installed with your XEmacs.  Failure to do
4528 so can result in lost mail.
4529 @end quotation
4530
4531 Please refer to @email{jwz@@jwz.org, Jamie Zawinski's} notes at
4532 @iftex
4533 @*
4534 @end iftex
4535 @uref{http://home.netscape.com/eng/mozilla/2.0/relnotes/demo/movemail.html}.
4536 In particular, this document will show you how to make Netscape use the
4537 version of movemail configured for your system by the person who built
4538 XEmacs.
4539
4540 @node Q4.3.5, Q4.4.1, Q4.3.4, Subsystems
4541 @unnumberedsubsec Q4.3.5: Where do I find pstogif (required by tm)?
4542
4543 pstogif is part of the latex2html package.
4544
4545 @email{vroonhof@@math.ethz.ch, Jan Vroonhof} writes:
4546
4547 latex2html is best found at the CTAN hosts and their mirrors
4548 in
4549 @iftex
4550 @*
4551 @end iftex
4552 @file{tex-archive/support/latex2html}.
4553
4554 CTAN hosts are:
4555
4556 @itemize @bullet
4557 @item @uref{ftp://ftp.tex.ac.uk/tex-archive/support/latex2html/}.
4558 @item @uref{ftp://ftp.dante.de/tex-archive/support/latex2html/}.
4559 @end itemize
4560
4561 There is a good mirror at ftp.cdrom.com;
4562 @iftex
4563 @*
4564 @end iftex
4565 @uref{ftp://ftp.cdrom.com/pub/tex/ctan/support/latex2html/}.
4566
4567 @node Q4.4.1, Q4.4.2, Q4.3.5, Subsystems
4568 @unnumberedsec 4.4: Sparcworks, EOS, and WorkShop
4569 @unnumberedsubsec Q4.4.1: What is SPARCworks, EOS, and WorkShop?
4570
4571 @email{turner@@lanl.gov, John Turner} writes:
4572
4573 @quotation
4574 SPARCworks is SunSoft's development environment, comprising compilers
4575 (C, C++, FORTRAN 77, Fortran 90, Ada, and Pascal), a debugger, and other
4576 tools such as TeamWare (for configuration management), MakeTool, etc.
4577 @end quotation
4578
4579 See @uref{http://www.sun.com/software/Developer-products/}
4580 for more info.
4581
4582 EOS stands for "Era on SPARCworks", but I don't know what Era stands
4583 for.
4584
4585 EOS is the integration of XEmacs with the SPARCworks debugger.  It
4586 allows one to use an XEmacs frame to view code (complete with
4587 fontification, etc.), set breakpoints, print variables, etc., while
4588 using the SPARCworks debugger.  It works very well and I use it all the
4589 time.
4590
4591 @email{cthomp@@xemacs.org, Chuck Thompson} writes:
4592
4593 @quotation
4594 Era stood for "Emacs Rewritten Again".  It was what we were calling the
4595 modified version of Lucid Emacs for Sun when I was dragged, er, allowed
4596 to work on this wonderful editor.
4597 @end quotation
4598
4599 @email{martin@@xemacs.org, Martin Buchholz} writes:
4600
4601 @quotation
4602 EOS is being replaced with a new graphical development environment
4603 called Sun WorkShop, which is currently (07/96) in Alpha Test.  For more
4604 details, check out
4605 @iftex
4606 @*
4607 @end iftex
4608 @uref{http://www.sun.com/software/Products/Developer-products}.
4609 @end quotation
4610
4611 @node Q4.4.2, Q4.5.1, Q4.4.1, Subsystems
4612 @unnumberedsubsec Q4.4.2: How do I start the Sun Workshop support in XEmacs 21?
4613
4614 Add the switch ---with-workshop to the configure command when building
4615 XEmacs and put the following in one of your startup files
4616 (e.g. site-start.el or .emacs):
4617
4618 @lisp
4619 (when (featurep 'tooltalk)
4620   (load "tooltalk-macros")
4621   (load "tooltalk-util")
4622   (load "tooltalk-init"))
4623 (when (featurep 'sparcworks)
4624   (load "sunpro-init")
4625   (load "ring")
4626   (load "comint")
4627   (load "annotations")
4628   (sunpro-startup))
4629 @end lisp
4630
4631 If you are not using the latest Workshop (5.0) you have to apply the
4632 following patch:
4633
4634 @format
4635 --- /opt/SUNWspro/lib/eserve.el.ORIG    Fri May 14 15:23:26 1999
4636 +++ /opt/SUNWspro/lib/eserve.el Fri May 14 15:24:54 1999
4637 @@@@ -42,7 +42,7 @@@@
4638  (defvar running-xemacs nil "t if we're running XEmacs")
4639  (defvar running-emacs  nil "t if we're running GNU Emacs 19")
4640  
4641 -(if (string-match "^\\(19\\|20\\)\..*\\(XEmacs\\|Lucid\\)" emacs-version)
4642 +(if (string-match "\\(XEmacs\\|Lucid\\)" emacs-version)
4643      (setq running-xemacs t)
4644      (setq running-emacs  t))
4645 @end format 
4646
4647
4648
4649 @node Q4.5.1, Q4.6.1, Q4.4.2, Subsystems
4650 @unnumberedsec 4.5: Energize
4651 @unnumberedsubsec Q4.5.1: What is/was Energize?
4652
4653 @email{gray@@meteor.harlequin.com, David N Gray} writes:
4654 @quotation
4655 The files in @file{lisp/energize} are to enable Emacs to interface with
4656 the "Energize Programming System", a C and C++ development environment,
4657 which was a product of Lucid, Inc.  Tragically, Lucid went out of
4658 business in 1994, so although Energize is still a great system, if you
4659 don't already have it, there isn't any way to get it now.  (Unless you
4660 happen to be in Japan; INS Engineering may still be selling it there.
4661 Tartan bought the rights to sell it in the rest of the world, but never
4662 did so.)
4663 @end quotation
4664
4665 @node Q4.6.1, Q4.7.1, Q4.5.1, Subsystems
4666 @unnumberedsec 4.6: Infodock
4667 @unnumberedsubsec Q4.6.1: What is Infodock?
4668
4669 InfoDock is an integrated productivity toolset, mainly aimed at
4670 technical people.  It is developed and supported by InfoDock
4671 Associates, a firm that offers custom support and development
4672 for InfoDock, XEmacs and GNU Emacs.  ( @uref{http://www.infodock.com},
4673 @email{info@@infodock.com}, +1 408 243 3300).
4674
4675 InfoDock is built atop the XEmacs variant of GNU Emacs and so has all of
4676 the power of Emacs, but with an easier to use and more comprehensive
4677 menu-based user interface.  The bottom portion of this text describes
4678 how it differs from XEmacs and GNU Emacs from the Free Software
4679 Foundation.
4680
4681 InfoDock is aimed at people who want a free, turn-key productivity
4682 environment.  Although InfoDock is customizable, it is not intended for
4683 people who like basic versions of Emacs which need to be customized
4684 extensively for local use; standard Emacs distributions are better for
4685 such uses.  InfoDock is for those people who want a complete,
4686 pre-customized environment in one package, which they need not touch
4687 more than once or twice a year to update to new revisions.
4688
4689 InfoDock is pre-built for SPARC SunOS/Solaris systems, PA-RISC HP-UX,
4690 and Intel Linux systems.  It is intended for use on a color display,
4691 although most features will work on monochrome monitors.  Simply unpack
4692 InfoDock according to the instructions in the ID-INSTALL file and you
4693 are ready to run.
4694
4695 The InfoDock Manual is concise, yet sufficient as a user guide for users
4696 who have never used an Emacs-type editor before.  For users who are
4697 already familiar with Emacs, it supplements the information in the GNU
4698 Emacs Manual.
4699
4700 InfoDock menus are much more extensive and more mature than standard
4701 Emacs menus.  Each menu offers a @samp{Manual} item which displays
4702 documentation associated with the menu's functions.
4703
4704 @noindent
4705 Four types of menubars are provided:
4706 @enumerate
4707 @item
4708 An extensive menubar providing access to global InfoDock commands.
4709 @item
4710 Mode-specific menubars tailored to the current major mode.
4711 @item
4712 A simple menubar for basic editing to help novices get started with InfoDock.
4713 @item
4714 The standard XEmacs menubar.
4715 @end enumerate
4716
4717 Most modes also include mode-specific popup menus.  Additionally, region and
4718 rectangle popup menus are included.
4719
4720 @samp{Hyperbole}, the everyday information manager, is a core part of
4721 InfoDock.  This provides context-sensitive mouse keys, a rolodex-type
4722 contact manager, programmable hypertext buttons, and an autonumbered
4723 outliner with embedded hyperlink anchors.
4724
4725 The @samp{OO-Browser}, a multi-language object-oriented code browser, is a
4726 standard part of InfoDock.
4727
4728 InfoDock saves a more extensive set of user options than other Emacs
4729 versions.
4730
4731 InfoDock inserts a useful file header in many file types, showing the
4732 author, summary, and last modification time of each file.  A summary
4733 program can then be used to summarize all of the files in a directory,
4734 for easy MANIFEST file creation.
4735
4736 Your working set of buffers is automatically saved and restored (if you
4737 answer yes to a prompt) between InfoDock sessions.
4738
4739 Refined color choices for code highlighting are provided for both dark and
4740 light background display frames.
4741
4742 The @kbd{C-z} key prefix performs frame-based commands which parallel the
4743 @kbd{C-x} key prefix for window-based commands.
4744
4745 The Smart Menu system is included for producing command menus on dumb
4746 terminals.
4747
4748 Lisp libraries are better categorized according to function.
4749
4750 Extensions and improvements to many areas of Emacs are included, such as:
4751 paragraph filling, mail reading with Rmail, shell handling, outlining, code
4752 highlighting and browsing, and man page browsing.
4753
4754 InfoDock questions, answers and discussion should go to the mail list
4755 @iftex
4756 @*
4757 @end iftex
4758 @email{infodock@@infodock.com}.  Use
4759 @email{infodock-request@@infodock.com} to be added or removed from the
4760 list.  Always include your InfoDock version number when sending help
4761 requests.
4762
4763 InfoDock is available across the Internet via anonymous FTP.  To get
4764 it, first move to a directory into which you want the InfoDock archive
4765 files placed.  We will call this <DIST-DIR>.
4766
4767 @example
4768    cd <DIST-DIR>
4769 @end example
4770
4771 Ftp to ftp.xemacs.org  (Internet Host ID = 128.174.252.16):
4772
4773 @example
4774    prompt> ftp ftp.xemacs.org
4775 @end example
4776
4777 Login as @samp{anonymous} with your own <user-id>@@<site-name> as a password.
4778
4779 @example
4780    Name (ftp.xemacs.org): anonymous
4781    331 Guest login ok, send your complete e-mail address as password.
4782    Password: -<your-user-id>@@<your-domain>
4783    230 Guest login ok, access restrictions apply.
4784 @end example
4785
4786 Move to the location of the InfoDock archives:
4787
4788 @example
4789    ftp> cd pub/infodock
4790 @end example
4791
4792 Set your transfer mode to binary:
4793
4794 @example
4795    ftp> bin
4796    200 Type set to I.
4797 @end example
4798
4799 Turn off prompting:
4800
4801 @example
4802    ftp> prompt
4803    Interactive mode off.
4804 @end example
4805
4806 Retrieve the InfoDock archives that you want, either by using a
4807 @samp{get <file>} for each file you want or by using the following to
4808 get a complete distribution, including all binaries:
4809
4810 @example
4811    ftp> mget ID-INSTALL
4812    ftp> mget id-*
4813 @end example
4814
4815 Close the FTP connection:
4816
4817 @example
4818    ftp> quit
4819    221 Goodbye.
4820 @end example
4821
4822 Read the @file{ID-INSTALL} file which you just retrieved for
4823 step-by-step installation instructions.
4824
4825 @node Q4.7.1, Q4.7.2, Q4.6.1, Subsystems
4826 @unnumberedsec 4.7: Other Unbundled Packages
4827 @unnumberedsubsec Q4.7.1: What is AUC TeX?  Where do you get it?
4828
4829 AUC TeX is a package written by @email{abraham@@dina.kvl.dk, Per Abrahamsen}.
4830 Starting with XEmacs 19.16, AUC TeX is bundled with XEmacs.  The
4831 following information is from the @file{README} and website.
4832
4833 AUC TeX is an extensible package that supports writing and formatting
4834 TeX files for most variants of GNU Emacs. Many different macro packages
4835 are supported, including AMS TeX, LaTeX, and TeXinfo.
4836
4837 The most recent version is always available by ftp at
4838 @iftex
4839 @*
4840 @end iftex
4841 @uref{ftp://sunsite.auc.dk/packages/auctex/auctex.tar.gz}.
4842
4843 In case you don't have access to anonymous ftp, you can get it by an
4844 email request to @email{ftpmail@@decwrl.dec.com}.
4845
4846 WWW users may want to check out the AUC TeX page at
4847 @iftex
4848 @*
4849 @end iftex
4850 @uref{http://sunsite.auc.dk/auctex/}.
4851
4852 @node Q4.7.2, Q4.7.3, Q4.7.1, Subsystems
4853 @unnumberedsubsec Q4.7.2: Are there any Emacs Lisp Spreadsheets?
4854
4855 Yes.  Check out @dfn{dismal} (which stands for Dis' Mode Ain't Lotus) at
4856 @iftex
4857 @*
4858 @end iftex
4859 @uref{ftp://cs.nyu.edu/pub/local/fox/dismal/}.
4860
4861 @node Q4.7.3, Q4.7.4, Q4.7.2, Subsystems
4862 @unnumberedsubsec Q4.7.3: Byte compiling AUC TeX on XEmacs 19.14.
4863
4864 @email{bruncott@@dormeur.inria.fr, Georges Brun-Cottan} writes:
4865
4866 @quotation
4867 When byte compiling auctex-9.4g, you must use the command:
4868
4869 @example
4870 xemacs -batch -l lpath.el
4871 @end example
4872 @end quotation
4873
4874 @node Q4.7.4, Q4.7.5, Q4.7.3, Subsystems
4875 @unnumberedsubsec Q4.7.4: Problems installing AUC TeX.
4876
4877 @email{vroonhof@@math.ethz.ch, Jan Vroonhof} writes:
4878
4879 @quotation
4880 AUC TeX works fine on both stock Emacs and XEmacs has been doing so for
4881 a very very long time. This is mostly due to the work of
4882 @email{abraham@@dina.kvl.dk, Per Abrahamsen} (clap clap) in particular his @file{easymenu}
4883 package.  Which leads to what is probably the problem...
4884 @end quotation
4885
4886 Most problems with AUC TeX are one of two things:
4887
4888 @itemize @bullet
4889 @item
4890 The TeX-lisp-directory in @file{tex-site.el} and the makefile don't
4891 match.
4892
4893 Fix: make sure you configure AUC TeX properly @strong{before} installing.
4894
4895 @item
4896 You have an old version of easymenu.el in your path.
4897
4898 Fix: use @code{locate-library} and remove old versions to make sure it
4899 @strong{only} finds the one that came with XEmacs.
4900 @end itemize
4901
4902
4903 @node Q4.7.5, Q4.7.6, Q4.7.4, Subsystems
4904 @unnumberedsubsec Q4.7.5: Is there a reason for an Emacs package not to be included in XEmacs?
4905
4906 The reason for an Emacs package not to be included in XEmacs is
4907 usually one or more of the following:
4908
4909 @enumerate
4910 @item
4911 The package has not been ported to XEmacs.  This will typically happen
4912 when it uses GNU-Emacs-specific features, which make it fail under
4913 XEmacs.
4914
4915 Porting a package to XEmacs can range from a trivial amount of change to
4916 a partial or full rewrite.  Fortunately, the authors of modern packages
4917 usually choose to support both Emacsen themselves.
4918
4919 @item
4920 The package has been decided not to be appropriate for XEmacs.  It may
4921 have an equivalent or better replacement within XEmacs, in which case
4922 the developers may choose not to burden themselves with supporting an
4923 additional package.
4924
4925 Each package bundled with XEmacs means more work for the maintainers,
4926 whether they want it or not.  If you are ready to take over the
4927 maintenance responsibilities for the package you port, be sure to say
4928 so -- we will more likely include it.
4929
4930 @item
4931 The package simply hasn't been noted by the XEmacs development.  If
4932 that's the case, the messages like yours are very useful for attracting
4933 our attention.
4934
4935 @item
4936 The package was noted by the developers, but they simply haven't yet
4937 gotten around to including/porting it.  Wait for the next release or,
4938 even better, offer your help.  It will be gladly accepted and
4939 appreciated.
4940 @end enumerate
4941
4942 @node Q4.7.6,  , Q4.7.5, Subsystems
4943 @unnumberedsubsec Q4.7.5: Is there a MatLab mode?
4944
4945 Yes, a matlab mode and other items are available at the
4946 @uref{ftp://ftp.mathworks.com/pub/contrib/emacs_add_ons,
4947 MathWorks' emacs_add_ons ftp directory}.
4948
4949 @node Miscellaneous, MS Windows, Subsystems, Top
4950 @unnumbered 5 The Miscellaneous Stuff
4951
4952 This is part 5 of the XEmacs Frequently Asked Questions list.  This
4953 section is devoted to anything that doesn't fit neatly into the other
4954 sections.
4955
4956 @menu
4957 Major & Minor Modes:
4958 * Q5.0.1::      How can I do source code highlighting using font-lock?
4959 * Q5.0.2::      I do not like cc-mode.  How do I use the old c-mode?
4960 * Q5.0.3::      How do I get @samp{More} Syntax Highlighting on by default?
4961 * Q5.0.4::      How can I enable auto-indent?
4962 * Q5.0.5::      How can I get XEmacs to come up in text/auto-fill mode by default?
4963 * Q5.0.6::      How do I start up a second shell buffer?
4964 * Q5.0.7::      Telnet from shell filters too much.
4965 * Q5.0.8::      Why does edt emulation not work?
4966 * Q5.0.9::      How can I emulate VI and use it as my default mode?
4967 * Q5.0.10::     [This question intentionally left blank]
4968 * Q5.0.11::     Filladapt doesn't work in 19.15?
4969 * Q5.0.12::     How do I disable gnuserv from opening a new frame?
4970 * Q5.0.13::     How do I start gnuserv so that each subsequent XEmacs is a client?
4971 * Q5.0.14::     Strange things are happening in Shell Mode.
4972 * Q5.0.15::     Where do I get the latest CC Mode?
4973 * Q5.0.16::     I find auto-show-mode disconcerting.  How do I turn it off?
4974 * Q5.0.17::     How can I get two instances of info?
4975 * Q5.0.18::     I upgraded to XEmacs 19.14 and gnuserv stopped working
4976 * Q5.0.19::     Is there something better than LaTeX mode?
4977 * Q5.0.20::     Is there a way to start a new XEmacs if there's no gnuserv running, and otherwise use gnuclient?
4978
4979 Emacs Lisp Programming Techniques:
4980 * Q5.1.1::      The difference in key sequences between XEmacs and GNU Emacs?
4981 * Q5.1.2::      Can I generate "fake" keyboard events?
4982 * Q5.1.3::      Could you explain @code{read-kbd-macro} in more detail?
4983 * Q5.1.4::      What is the performance hit of @code{let}?
4984 * Q5.1.5::      What is the recommended use of @code{setq}?
4985 * Q5.1.6::      What is the typical misuse of @code{setq}?
4986 * Q5.1.7::      I like the the @code{do} form of cl, does it slow things down?
4987 * Q5.1.8::      I like recursion, does it slow things down?
4988 * Q5.1.9::      How do I put a glyph as annotation in a buffer?
4989 * Q5.1.10::     @code{map-extents} won't traverse all of my extents!
4990 * Q5.1.11::     My elisp program is horribly slow.  Is there an easy way to find out where it spends time?
4991
4992 Sound:
4993 * Q5.2.1::      How do I turn off the sound?
4994 * Q5.2.2::      How do I get funky sounds instead of a boring beep?
4995 * Q5.2.3::      What's NAS, how do I get it?
4996 * Q5.2.4::      Sunsite sounds don't play.
4997
4998 Miscellaneous:
4999 * Q5.3.1::      How do you make XEmacs indent CL if-clauses correctly?
5000 * Q5.3.2::      Fontifying hangs when editing a postscript file.
5001 * Q5.3.3::      How can I print WYSIWYG a font-locked buffer?
5002 * Q5.3.4::      Getting @kbd{M-x lpr} to work with postscript printer.
5003 * Q5.3.5::      How do I specify the paths that XEmacs uses for finding files?
5004 * Q5.3.6::      [This question intentionally left blank]
5005 * Q5.3.7::      Can I have the end of the buffer delimited in some way?
5006 * Q5.3.8::      How do I insert today's date into a buffer?
5007 * Q5.3.9::      Are only certain syntactic character classes available for abbrevs?
5008 * Q5.3.10::     How can I get those oh-so-neat X-Face lines?
5009 * Q5.3.11::     How do I add new Info directories?
5010 * Q5.3.12::     What do I need to change to make printing work?
5011 @end menu
5012
5013 @node Q5.0.1, Q5.0.2, Miscellaneous, Miscellaneous
5014 @unnumberedsec 5.0: Major & Minor Modes
5015 @unnumberedsubsec Q5.0.1: How can I do source code highlighting using font-lock?
5016
5017 For most modes, font-lock is already set up and just needs to be turned
5018 on.  This can be done by @kbd{M-x font-lock-mode}, or by having XEmacs
5019 automatically start it by adding lines like:
5020
5021 @lisp
5022 (add-hook 'emacs-lisp-mode-hook 'turn-on-font-lock)
5023 (add-hook 'dired-mode-hook      'turn-on-font-lock)
5024 @end lisp
5025
5026 to your @file{.emacs}.  See the file @file{etc/sample.emacs} for more
5027 examples.
5028
5029 See also @code{Syntax Highlighting} from the @code{Options} menu.
5030 Remember to save options.
5031
5032 @node Q5.0.2, Q5.0.3, Q5.0.1, Miscellaneous
5033 @unnumberedsubsec Q5.0.2: I do not like cc-mode.  How do I use the old c-mode?
5034
5035 Well, first off, consider if you really want to do this.  cc-mode is
5036 much more powerful than the old c-mode.  If you're having trouble
5037 getting your old offsets to work, try using @code{c-set-offset} instead.
5038 You might also consider using the package @code{cc-compat}.
5039
5040 But, if you still insist, add the following lines to your @file{.emacs}:
5041
5042 @lisp
5043 (fmakunbound 'c-mode)
5044 (makunbound 'c-mode-map)
5045 (fmakunbound 'c++-mode)
5046 (makunbound 'c++-mode-map)
5047 (makunbound 'c-style-alist)
5048 (load-library "old-c-mode")
5049 (load-library "old-c++-mode")
5050 @end lisp
5051
5052 This must be done before any other reference is made to either c-mode or
5053 c++-mode.
5054
5055 @node Q5.0.3, Q5.0.4, Q5.0.2, Miscellaneous
5056 @unnumberedsubsec Q5.0.3: How do I get @samp{More} Syntax Highlighting on by default?
5057
5058 Use the following code in your @file{.emacs}:
5059
5060 @lisp
5061 (setq-default font-lock-maximum-decoration t)
5062 @end lisp
5063
5064 In versions of XEmacs prior to 19.14, you had to use a kludgy solution
5065 like this:
5066
5067 @lisp
5068 (setq c-font-lock-keywords c-font-lock-keywords-2
5069       c++-font-lock-keywords c++-font-lock-keywords-2
5070       lisp-font-lock-keywords lisp-font-lock-keywords-2)
5071 @end lisp
5072
5073 It will work for C, C++ and Lisp.
5074
5075 See also @code{Syntax Highlighting} from the @code{Options} menu.
5076 Remember to save options.
5077
5078 @node Q5.0.4, Q5.0.5, Q5.0.3, Miscellaneous
5079 @unnumberedsubsec Q5.0.4: How can I enable auto-indent?
5080
5081 Put the following line in your @file{.emacs}:
5082
5083 @lisp
5084 (setq indent-line-function 'indent-relative-maybe)
5085 @end lisp
5086
5087 If you want to get fancy, try the @code{filladapt} package available
5088 standard with XEmacs.  Put this into your @file{.emacs}:
5089
5090 @lisp
5091 (require 'filladapt)
5092 (add-hook 'text-mode-hook    'turn-on-filladapt-mode)
5093 ;;; and others ...
5094 @end lisp
5095
5096 You can customize filling and adaptive filling with Customize.
5097 Select from the @code{Options} menu
5098 @code{Customize->Emacs->->Editing->Fill->Fill...}
5099 or type @kbd{M-x customize @key{RET} fill @key{RET}}.
5100
5101 Note that well-behaving text-lookalike modes will run
5102 @code{text-mode-hook} by default (e.g. that's what Message does).  For
5103 the nasty ones, you'll have to provide the @code{add-hook}s yourself.
5104
5105 Please note that the @code{fa-extras} package is no longer useful.
5106
5107 @node Q5.0.5, Q5.0.6, Q5.0.4, Miscellaneous
5108 @unnumberedsubsec Q5.0.5: How can I get XEmacs to come up in text/auto-fill mode by default?
5109
5110 Try the following lisp in your @file{.emacs}:
5111
5112 @lisp
5113 (setq default-major-mode 'text-mode)
5114 (setq text-mode-hook 'turn-on-auto-fill)
5115 @end lisp
5116
5117 @strong{WARNING}: note that changing the value of
5118 @code{default-major-mode} from @code{fundamental-mode} can break a large
5119 amount of built-in code that expects newly created buffers to be in
5120 @code{fundamental-mode}.  (Changing from @code{fundamental-mode} to
5121 @code{text-mode} might not wreak too much havoc, but changing to
5122 something more exotic like a lisp-mode would break many Emacs packages).
5123
5124 Note that Emacs by default starts up in buffer @code{*scratch*} in
5125 @code{initial-major-mode}, which defaults to
5126 @code{lisp-interaction-mode}. Thus adding the following form to your
5127 Emacs init file will cause the initial @code{*scratch*} buffer to be put
5128 into auto-fill'ed @code{text-mode}:
5129
5130 @lisp
5131 (setq initial-major-mode
5132       (lambda ()
5133         (text-mode)
5134         (turn-on-auto-fill)))
5135 @end lisp
5136
5137 Note that after your init file is loaded, if
5138 @code{inhibit-startup-message} is @code{nil} (the default) and the
5139 startup buffer is @code{*scratch*} then the startup message will be
5140 inserted into @code{*scratch*}; it will be removed after a timeout by
5141 erasing the entire @code{*scratch*} buffer.  Keep in mind this default
5142 usage of @code{*scratch*} if you desire any prior manipulation of
5143 @code{*scratch*} from within your Emacs init file. In particular,
5144 anything you insert into @code{*scratch*} from your init file will be
5145 later erased. Also, if you change the mode of the @code{*scratch*}
5146 buffer, be sure that this will not interfere with possible later
5147 insertion of the startup message (e.g. if you put @code{*scratch*} into
5148 a nonstandard mode that has automatic font lock rules, then the startup
5149 message might get fontified in a strange foreign manner, e.g. as code in
5150 some programming language).
5151
5152 @node Q5.0.6, Q5.0.7, Q5.0.5, Miscellaneous
5153 @unnumberedsubsec Q5.0.6: How do I start up a second shell buffer?
5154
5155 In the @code{*shell*} buffer:
5156
5157 @lisp
5158 M-x rename-buffer @key{RET} *shell-1* @key{RET}
5159 M-x shell RET
5160 @end lisp
5161
5162 This will then start a second shell.  The key is that no buffer named
5163 @samp{*shell*} can exist.  It might be preferable to use @kbd{M-x
5164 rename-uniquely} to rename the @code{*shell*} buffer instead of @kbd{M-x
5165 rename-buffer}.
5166
5167 Alternately, you can set the variable @code{shell-multiple-shells}.
5168 If the value of this variable is non-nil, each time shell mode is invoked, 
5169 a new shell is made
5170
5171 @node Q5.0.7, Q5.0.8, Q5.0.6, Miscellaneous
5172 @unnumberedsubsec Q5.0.7: Telnet from shell filters too much
5173
5174 I'm using the Emacs @kbd{M-x shell} function, and I would like to invoke
5175 and use a telnet session within it.  Everything works fine except that
5176 now all @samp{^M}'s are filtered out by Emacs.  Fixes?
5177
5178 Use @kbd{M-x rsh} or @kbd{M-x telnet} to open remote sessions rather
5179 than doing rsh or telnet within the local shell buffer.  Starting with
5180 XEmacs-20.3 you can also use @kbd{M-x ssh} to open secure remote session
5181 if you have @code{ssh} installed.
5182
5183 @node Q5.0.8, Q5.0.9, Q5.0.7, Miscellaneous
5184 @unnumberedsubsec Q5.0.8: Why does edt emulation not work?
5185
5186 We don't know, but you can use tpu-edt emulation instead, which works
5187 fine and is a little fancier than the standard edt emulation.  To do
5188 this, add the following line to your @file{.emacs}:
5189
5190 @lisp
5191 (tpu-edt)
5192 @end lisp
5193
5194 If you don't want it to replace @kbd{C-h} with an edt-style help menu
5195 add this as well:
5196
5197 @lisp
5198 (global-set-key [(control h)] 'help-for-help)
5199 @end lisp
5200
5201 @node Q5.0.9, Q5.0.10, Q5.0.8, Miscellaneous
5202 @unnumberedsubsec Q5.0.9: How can I emulate VI and use it as my default mode?
5203
5204 Our recommended VI emulator is viper. To make viper-mode the default,
5205 add this to your @file{.emacs}:
5206
5207 @lisp
5208 (viper-mode)
5209 @end lisp
5210
5211 @email{kifer@@CS.SunySB.EDU, Michael Kifer} writes:
5212
5213 @quotation
5214 This should be added as close to the top of @file{.emacs} as you can get
5215 it, otherwise some minor modes may not get viper-ized.
5216 @end quotation
5217
5218 @node Q5.0.10, Q5.0.11, Q5.0.9, Miscellaneous
5219 @unnumberedsubsec Q5.0.10: [This question intentionally left blank]
5220
5221 Obsolete question, left blank to avoid renumbering
5222
5223 @node Q5.0.11, Q5.0.12, Q5.0.10, Miscellaneous
5224 @unnumberedsubsec Q5.0.11: Filladapt doesn't work in 19.15
5225
5226 Filladapt 2.x is included in 19.15.  In it filladapt is now a minor
5227 mode and minor modes are traditionally off by default.  The following
5228 added to your @file{.emacs} will turn it on for all buffers:
5229
5230 @lisp
5231 (setq-default filladapt-mode t)
5232 @end lisp
5233
5234 Use @code{turn-on-filladapt-mode} to turn Filladapt on in particular
5235 major modes, like this:
5236
5237 @lisp
5238 (add-hook 'text-mode-hook 'turn-on-filladapt-mode)
5239 @end lisp
5240
5241 @node Q5.0.12, Q5.0.13, Q5.0.11, Miscellaneous
5242 @unnumberedsubsec Q5.0.12: How do I disable gnuserv from opening a new frame?
5243
5244 If you set the @code{gnuserv-frame} variable to the frame that should be
5245 used to display buffers that are pulled up, a new frame will not be
5246 created. For example, you could put
5247
5248 @lisp
5249 (setq gnuserv-frame (selected-frame))
5250 @end lisp
5251
5252 early on in your @file{.emacs}, to ensure that the first frame created
5253 is the one used for your gnuserv buffers.
5254
5255 Starting in 19.15, there is an option to set the gnuserv target to
5256 the current frame.  See
5257 @code{Options->"Other Window" Location->Make current frame gnuserv target}
5258
5259 Starting with XEmacs-20.3 you can also change this with Customize.
5260 Select from the @code{Options} menu
5261 @code{Customize->Emacs->Environment->Gnuserv->Gnuserv Frame...} or type
5262 @kbd{M-x customize @key{RET} gnuserv @key{RET}}.
5263
5264
5265 @node Q5.0.13, Q5.0.14, Q5.0.12, Miscellaneous
5266 @unnumberedsubsec Q5.0.13: How do I start gnuserv so that each subsequent XEmacs is a client?
5267
5268 Put the following in your @file{.emacs} file to start the server:
5269
5270 @lisp
5271 (gnuserv-start)
5272 @end lisp
5273
5274 Start your first XEmacs as usual.  After that, you can do:
5275
5276 @example
5277 gnuclient randomfilename
5278 @end example
5279
5280 from the command line to get your existing XEmacs process to open a new
5281 frame and visit randomfilename in that window. When you're done editing
5282 randomfilename, hit @kbd{C-x #} to kill the buffer and get rid of the
5283 frame.
5284
5285 See also man page of gnuclient.
5286
5287 @node Q5.0.14, Q5.0.15, Q5.0.13, Miscellaneous
5288 @unnumberedsubsec Q5.0.14: Strange things are happening in Shell Mode.
5289
5290 Sometimes (i.e. it's not repeatable, and I can't work out why it
5291 happens) when I'm typing into shell mode, I hit return and only a
5292 portion of the command is given to the shell, and a blank prompt is
5293 returned.  If I hit return again, the rest of the previous command is
5294 given to the shell.
5295
5296 @email{martin@@xemacs.org, Martin Buchholz} writes:
5297
5298 @quotation
5299 There is a known problem with interaction between @code{csh} and the
5300 @code{filec} option and XEmacs.  You should add the following to your
5301 @file{.cshrc}:
5302
5303 @example
5304 if ( "$TERM" == emacs || "$TERM" == unknown ) unset filec
5305 @end example
5306 @end quotation
5307
5308 @node Q5.0.15, Q5.0.16, Q5.0.14, Miscellaneous
5309 @unnumberedsubsec Q5.0.15: Where do I get the latest CC Mode?
5310
5311 @email{bwarsaw@@cnri.reston.va.us, Barry A. Warsaw} writes:
5312
5313 @quotation
5314 This can be had from @uref{http://www.python.org/emacs/}.
5315 @end quotation
5316
5317 @node Q5.0.16, Q5.0.17, Q5.0.15, Miscellaneous
5318 @unnumberedsubsec Q5.0.16: I find auto-show-mode disconcerting.  How do I turn it off?
5319
5320 @code{auto-show-mode} controls whether or not a horizontal scrollbar
5321 magically appears when a line is too long to be displayed.  This is
5322 enabled by default.  To turn it off, put the following in your
5323 @file{.emacs}:
5324
5325 @lisp
5326 (setq auto-show-mode nil)
5327 (setq-default auto-show-mode nil)
5328 @end lisp
5329
5330 @node Q5.0.17, Q5.0.18, Q5.0.16, Miscellaneous
5331 @unnumberedsubsec Q5.0.17: How can I get two instances of info?
5332
5333 You can't.  The @code{info} package does not provide for multiple info buffers.
5334
5335 @node Q5.0.18, Q5.0.19, Q5.0.17, Miscellaneous
5336 @unnumberedsubsec Q5.0.18: I upgraded to XEmacs 19.14 and gnuserv stopped working.
5337
5338 @email{daku@@nortel.ca, Mark Daku} writes:
5339
5340 @quotation
5341 It turns out I was using an older version of gnuserv.  The installation
5342 didn't put the binary into the public bin directory.  It put it in
5343 @iftex
5344 @*
5345 @end iftex
5346 @file{lib/xemacs-19.14/hppa1.1-hp-hpux9.05/gnuserv}.  Shouldn't it have
5347 been put in @file{bin/hppa1.1-hp-hpux9.0}?
5348 @end quotation
5349
5350 @node Q5.0.19, Q5.0.20, Q5.0.18, Miscellaneous
5351 @unnumberedsubsec Q5.0.19: Is there something better than LaTeX mode?
5352
5353 @email{dak@@fsnif.neuroinformatik.ruhr-uni-bochum.de, David Kastrup} writes:
5354
5355 @quotation
5356 The standard TeX modes leave much to be desired, and are somewhat
5357 leniently maintained.  Serious TeX users use AUC TeX (@pxref{Q4.7.1}).
5358 @end quotation
5359
5360 @node Q5.0.20, Q5.1.1, Q5.0.19, Miscellaneous
5361 @unnumberedsubsec Q5.0.20: Is there a way to start a new XEmacs if there's no gnuserv running, and otherwise use gnuclient?
5362
5363 @email{vroonhof@@math.ethz.ch, Jan Vroonhof} writes:
5364 @quotation
5365 Here is one of the solutions, we have this in a script called
5366 @file{etc/editclient.sh}.
5367 @example
5368  #!/bin/sh
5369  if gnuclient -batch -eval t >/dev/null 2>&1
5370  then
5371    exec gnuclient $@{1+"$@@"@}
5372  else
5373    xemacs -unmapped -f gnuserv-start &
5374    until gnuclient -batch -eval t >/dev/null 2>&1
5375    do
5376       sleep 1
5377    done
5378    exec gnuclient $@{1+"$@@"@}
5379  fi
5380 @end example
5381
5382 Note that there is a known problem when running XEmacs and 'gnuclient
5383 -nw' on the same TTY.
5384 @end quotation
5385
5386 @node Q5.1.1, Q5.1.2, Q5.0.20, Miscellaneous
5387 @unnumberedsec 5.1: Emacs Lisp Programming Techniques
5388 @unnumberedsubsec Q5.1.1: What is the difference in key sequences between XEmacs and GNU Emacs?
5389
5390 @email{clerik@@naggum.no, Erik Naggum} writes;
5391
5392 @quotation
5393 Emacs has a legacy of keyboards that produced characters with modifier
5394 bits, and therefore map a variety of input systems into this scheme even
5395 today.  XEmacs is instead optimized for X events.  This causes an
5396 incompatibility in the way key sequences are specified, but both Emacs
5397 and XEmacs will accept a key sequence as a vector of lists of modifiers
5398 that ends with a key, e.g., to bind @kbd{M-C-a}, you would say
5399 @code{[(meta control a)]} in both Emacsen.  XEmacs has an abbreviated
5400 form for a single key, just (meta control a).  Emacs has an abbreviated
5401 form for the Control and the Meta modifiers to string-characters (the
5402 ASCII characters), as in @samp{\M-\C-a}.  XEmacs users need to be aware
5403 that the abbreviated form works only for one-character key sequences,
5404 while Emacs users need to be aware that the string-character is rather
5405 limited.  Specifically, the string-character can accommodate only 256
5406 different values, 128 of which have the Meta modifier and 128 of which
5407 have not.  In each of these blocks, only 32 characters have the Control
5408 modifier.  Whereas @code{[(meta control A)]} differs from @code{[(meta
5409 control a)]} because the case differs, @samp{\M-\C-a} and @samp{\M-\C-A}
5410 do not.  Programmers are advised to use the full common form, both
5411 because it is more readable and less error-prone, and because it is
5412 supported by both Emacsen.
5413 @end quotation
5414
5415 Another (even safer) way to be sure of the key-sequences is to use the
5416 @code{read-kbd-macro} function, which takes a string like @samp{C-c
5417 <up>}, and converts it to the internal key representation of the Emacs
5418 you use.  The function is available both on XEmacs and GNU Emacs.
5419
5420 @node Q5.1.2, Q5.1.3, Q5.1.1, Miscellaneous
5421 @unnumberedsubsec Q5.1.2: Can I generate "fake" keyboard events?
5422
5423 I wonder if there is an interactive function that can generate
5424 @dfn{fake} keyboard events.  This way, I could simply map them inside
5425 XEmacs.
5426
5427 This seems to work:
5428
5429 @lisp
5430 (defun cg--generate-char-event (ch)
5431   "Generate an event, as if ch has been typed"
5432   (dispatch-event (character-to-event ch)))
5433
5434 ;;  Backspace and Delete stuff
5435 (global-set-key [backspace]
5436   (lambda () (interactive) (cg--generate-char-event 127)))
5437 (global-set-key [unknown_keysym_0x4]
5438   (lambda () (interactive) (cg--generate-char-event 4)))
5439 @end lisp
5440
5441 @node Q5.1.3, Q5.1.4, Q5.1.2, Miscellaneous
5442 @unnumberedsubsec Q5.1.3: Could you explain @code{read-kbd-macro} in more detail?
5443
5444 The @code{read-kbd-macro} function returns the internal Emacs
5445 representation of a human-readable string (which is its argument).
5446 Thus:
5447
5448 @lisp
5449 (read-kbd-macro "C-c C-a")
5450 @result{} [(control ?c) (control ?a)]
5451
5452 (read-kbd-macro "C-c C-. <up>")
5453 @result{} [(control ?c) (control ?.) up]
5454 @end lisp
5455
5456 In GNU Emacs the same forms will be evaluated to what GNU Emacs
5457 understands internally---the sequences @code{"\C-x\C-c"} and @code{[3
5458 67108910 up]}, respectively.
5459
5460 The exact @dfn{human-readable} syntax is defined in the docstring of
5461 @code{edmacro-mode}.  I'll repeat it here, for completeness.
5462
5463 @quotation
5464 Format of keyboard macros during editing:
5465
5466 Text is divided into @dfn{words} separated by whitespace.  Except for
5467 the words described below, the characters of each word go directly as
5468 characters of the macro.  The whitespace that separates words is
5469 ignored.  Whitespace in the macro must be written explicitly, as in
5470 @kbd{foo @key{SPC} bar @key{RET}}.
5471
5472 @itemize @bullet
5473 @item
5474 The special words @kbd{RET}, @kbd{SPC}, @kbd{TAB}, @kbd{DEL}, @kbd{LFD},
5475 @kbd{ESC}, and @kbd{NUL} represent special control characters.  The
5476 words must be written in uppercase.
5477
5478 @item
5479 A word in angle brackets, e.g., @code{<return>}, @code{<down>}, or
5480 @code{<f1>}, represents a function key.  (Note that in the standard
5481 configuration, the function key @code{<return>} and the control key
5482 @key{RET} are synonymous.)  You can use angle brackets on the words
5483 @key{RET}, @key{SPC}, etc., but they are not required there.
5484
5485 @item
5486 Keys can be written by their @sc{ascii} code, using a backslash followed
5487 by up to six octal digits.  This is the only way to represent keys with
5488 codes above \377.
5489
5490 @item
5491 One or more prefixes @kbd{M-} (meta), @kbd{C-} (control), @kbd{S-}
5492 (shift), @kbd{A-} (alt), @kbd{H-} (hyper), and @kbd{s-} (super) may
5493 precede a character or key notation.  For function keys, the prefixes
5494 may go inside or outside of the brackets: @code{C-<down>} @equiv{}
5495 @code{<C-down>}.  The prefixes may be written in any order: @kbd{M-C-x}
5496 @equiv{} @kbd{C-M-x}.
5497
5498 Prefixes are not allowed on multi-key words, e.g., @kbd{C-abc}, except
5499 that the Meta prefix is allowed on a sequence of digits and optional
5500 minus sign: @kbd{M--123} @equiv{} @kbd{M-- M-1 M-2 M-3}.
5501
5502 @item
5503 The @code{^} notation for control characters also works: @kbd{^M}
5504 @equiv{} @kbd{C-m}.
5505
5506 @item
5507 Double angle brackets enclose command names: @code{<<next-line>>} is
5508 shorthand for @kbd{M-x next-line @key{RET}}.
5509
5510 @item
5511 Finally, @code{REM} or @code{;;} causes the rest of the line to be
5512 ignored as a comment.
5513 @end itemize
5514
5515 Any word may be prefixed by a multiplier in the form of a decimal number
5516 and @code{*}: @code{3*<right>} @equiv{} @code{<right> <right> <right>},
5517 and @code{10*foo} @equiv{}
5518 @iftex
5519 @*
5520 @end iftex
5521 @code{foofoofoofoofoofoofoofoofoofoo}.
5522
5523 Multiple text keys can normally be strung together to form a word, but
5524 you may need to add whitespace if the word would look like one of the
5525 above notations: @code{; ; ;} is a keyboard macro with three semicolons,
5526 but @code{;;;} is a comment.  Likewise, @code{\ 1 2 3} is four keys but
5527 @code{\123} is a single key written in octal, and @code{< right >} is
5528 seven keys but @code{<right>} is a single function key.  When in doubt,
5529 use whitespace.
5530 @end quotation
5531
5532 @node Q5.1.4, Q5.1.5, Q5.1.3, Miscellaneous
5533 @unnumberedsubsec Q5.1.4: What is the performance hit of @code{let}?
5534
5535 In most cases, not noticeable.  Besides, there's no avoiding
5536 @code{let}---you have to bind your local variables, after all.  Some
5537 pose a question whether to nest @code{let}s, or use one @code{let} per
5538 function.  I think because of clarity and maintenance (and possible
5539 future implementation), @code{let}-s should be used (nested) in a way to
5540 provide the clearest code.
5541
5542 @node Q5.1.5, Q5.1.6, Q5.1.4, Miscellaneous
5543 @unnumberedsubsec Q5.1.5: What is the recommended use of @code{setq}?
5544
5545 @itemize @bullet
5546 @item Global variables
5547
5548 You will typically @code{defvar} your global variable to a default
5549 value, and use @code{setq} to set it later.
5550
5551 It is never a good practice to @code{setq} user variables (like
5552 @code{case-fold-search}, etc.), as it ignores the user's choice
5553 unconditionally.  Note that @code{defvar} doesn't change the value of a
5554 variable if it was bound previously.  If you wish to change a
5555 user-variable temporarily, use @code{let}:
5556
5557 @lisp
5558 (let ((case-fold-search nil))
5559   ...                                   ; code with searches that must be case-sensitive
5560   ...)
5561 @end lisp
5562
5563 You will notice the user-variables by their docstrings beginning with an
5564 asterisk (a convention).
5565
5566 @item Local variables
5567
5568 Bind them with @code{let}, which will unbind them (or restore their
5569 previous value, if they were bound) after exiting from the @code{let}
5570 form.  Change the value of local variables with @code{setq} or whatever
5571 you like (e.g. @code{incf}, @code{setf} and such).  The @code{let} form
5572 can even return one of its local variables.
5573
5574 Typical usage:
5575
5576 @lisp
5577 ;; iterate through the elements of the list returned by
5578 ;; `hairy-function-that-returns-list'
5579 (let ((l (hairy-function-that-returns-list)))
5580   (while l
5581     ... do something with (car l) ...
5582     (setq l (cdr l))))
5583 @end lisp
5584
5585 Another typical usage includes building a value simply to work with it.
5586
5587 @lisp
5588 ;; Build the mode keymap out of the key-translation-alist
5589 (let ((inbox (file-truename (expand-file-name box)))
5590       (i 0))
5591   ... code dealing with inbox ...
5592   inbox)
5593 @end lisp
5594
5595 This piece of code uses the local variable @code{inbox}, which becomes
5596 unbound (or regains old value) after exiting the form.  The form also
5597 returns the value of @code{inbox}, which can be reused, for instance:
5598
5599 @lisp
5600 (setq foo-processed-inbox
5601       (let .....))
5602 @end lisp
5603 @end itemize
5604
5605 @node Q5.1.6, Q5.1.7, Q5.1.5, Miscellaneous
5606 @unnumberedsubsec Q5.1.6: What is the typical misuse of @code{setq} ?
5607
5608 A typical misuse is probably @code{setq}ing a variable that was meant to
5609 be local.  Such a variable will remain bound forever, never to be
5610 garbage-collected.  For example, the code doing:
5611
5612 @lisp
5613 (defun my-function (whatever)
5614   (setq a nil)
5615   ... build a large list ...
5616   ... and exit ...)
5617 @end lisp
5618
5619 does a bad thing, as @code{a} will keep consuming memory, never to be
5620 unbound.  The correct thing is to do it like this:
5621
5622 @lisp
5623 (defun my-function (whatever)
5624   (let (a)                              ; default initialization is to nil
5625     ... build a large list ...
5626     ... and exit, unbinding `a' in the process  ...)
5627 @end lisp
5628
5629 Not only is this prettier syntactically, but it makes it possible for
5630 Emacs to garbage-collect the objects which @code{a} used to reference.
5631
5632 Note that even global variables should not be @code{setq}ed without
5633 @code{defvar}ing them first, because the byte-compiler issues warnings.
5634 The reason for the warning is the following:
5635
5636 @lisp
5637 (defun flurgoze nil)                    ; ok, global internal variable
5638 ...
5639
5640 (setq flurghoze t)                      ; ops!  a typo, but semantically correct.
5641                                         ; however, the byte-compiler warns.
5642
5643 While compiling toplevel forms:
5644 ** assignment to free variable flurghoze
5645 @end lisp
5646
5647 @node Q5.1.7, Q5.1.8, Q5.1.6, Miscellaneous
5648 @unnumberedsubsec Q5.1.7: I like the the @code{do} form of cl, does it slow things down?
5649
5650 It shouldn't.  Here is what Dave Gillespie has to say about cl.el
5651 performance:
5652
5653 @quotation
5654 Many of the advanced features of this package, such as @code{defun*},
5655 @code{loop}, and @code{setf}, are implemented as Lisp macros.  In
5656 byte-compiled code, these complex notations will be expanded into
5657 equivalent Lisp code which is simple and efficient.  For example, the
5658 forms
5659
5660 @lisp
5661 (incf i n)
5662 (push x (car p))
5663 @end lisp
5664
5665 are expanded at compile-time to the Lisp forms
5666
5667 @lisp
5668 (setq i (+ i n))
5669 (setcar p (cons x (car p)))
5670 @end lisp
5671
5672 which are the most efficient ways of doing these respective operations
5673 in Lisp.  Thus, there is no performance penalty for using the more
5674 readable @code{incf} and @code{push} forms in your compiled code.
5675
5676 @emph{Interpreted} code, on the other hand, must expand these macros
5677 every time they are executed.  For this reason it is strongly
5678 recommended that code making heavy use of macros be compiled.  (The
5679 features labelled @dfn{Special Form} instead of @dfn{Function} in this
5680 manual are macros.)  A loop using @code{incf} a hundred times will
5681 execute considerably faster if compiled, and will also garbage-collect
5682 less because the macro expansion will not have to be generated, used,
5683 and thrown away a hundred times.
5684
5685 You can find out how a macro expands by using the @code{cl-prettyexpand}
5686 function.
5687 @end quotation
5688
5689 @node Q5.1.8, Q5.1.9, Q5.1.7, Miscellaneous
5690 @unnumberedsubsec Q5.1.8: I like recursion, does it slow things down?
5691
5692 Yes.  Emacs byte-compiler cannot do much to optimize recursion.  But
5693 think well whether this is a real concern in Emacs.  Much of the Emacs
5694 slowness comes from internal mechanisms such as redisplay, or from the
5695 fact that it is an interpreter.
5696
5697 Please try not to make your code much uglier to gain a very small speed
5698 gain.  It's not usually worth it.
5699
5700 @node Q5.1.9, Q5.1.10, Q5.1.8, Miscellaneous
5701 @unnumberedsubsec Q5.1.9: How do I put a glyph as annotation in a buffer?
5702
5703 Here is a solution that will insert the glyph annotation at the
5704 beginning of buffer:
5705
5706 @lisp
5707 (make-annotation (make-glyph '([FORMAT :file FILE]
5708                                [string :data "fallback-text"]))
5709                  (point-min)
5710                  'text
5711                  (current-buffer))
5712 @end lisp
5713
5714 Replace @samp{FORMAT} with an unquoted symbol representing the format of
5715 the image (e.g. @code{xpm}, @code{xbm}, @code{gif}, @code{jpeg}, etc.)
5716 Instead of @samp{FILE}, use the image file name
5717 (e.g.
5718 @iftex
5719 @*
5720 @end iftex
5721 @file{/usr/local/lib/xemacs-20.2/etc/recycle.xpm}).
5722
5723 You can turn this to a function (that optionally prompts you for a file
5724 name), and inserts the glyph at @code{(point)} instead of
5725 @code{(point-min)}.
5726
5727 @node Q5.1.10, Q5.1.11, Q5.1.9, Miscellaneous
5728 @unnumberedsubsec Q5.1.10: @code{map-extents} won't traverse all of my extents!
5729
5730 I tried to use @code{map-extents} to do an operation on all the extents
5731 in a region.  However, it seems to quit after processing a random number
5732 of extents.  Is it buggy?
5733
5734 No.  The documentation of @code{map-extents} states that it will iterate
5735 across the extents as long as @var{function} returns @code{nil}.
5736 Unexperienced programmers often forget to return @code{nil} explicitly,
5737 which results in buggy code.  For instance, the following code is
5738 supposed to delete all the extents in a buffer, and issue as many
5739 @samp{fubar!} messages.
5740
5741 @lisp
5742 (map-extents (lambda (ext ignore)
5743                (delete-extent ext)
5744                (message "fubar!")))
5745 @end lisp
5746
5747 Instead, it will delete only the first extent, and stop right there --
5748 because @code{message} will return a non-nil value.  The correct code
5749 is:
5750
5751 @lisp
5752 (map-extents (lambda (ext ignore)
5753                (delete-extent ext)
5754                (message "fubar!")
5755                nil))
5756 @end lisp
5757
5758 @node Q5.1.11, Q5.2.1, Q5.1.10, Miscellaneous
5759 @unnumberedsubsec Q5.1.11: My elisp program is horribly slow.  Is there
5760 an easy way to find out where it spends time?
5761 @c New
5762
5763 z@email{hniksic@@xemacs.org, Hrvoje Niksic} writes:
5764 @quotation
5765 Under XEmacs 20.4 and later  you can use @kbd{M-x profile-key-sequence}, press a key
5766 (say @key{RET} in the Gnus Group buffer), and get the results using
5767 @kbd{M-x profile-results}.  It should give you an idea of where the time
5768 is being spent.
5769 @end quotation
5770
5771 @node Q5.2.1, Q5.2.2, Q5.1.11, Miscellaneous
5772 @unnumberedsubsec Q5.2.1: How do I turn off the sound?
5773
5774 Add the following line to your @file{.emacs}:
5775
5776 @lisp
5777 (setq bell-volume 0)
5778 (setq sound-alist nil)
5779 @end lisp
5780
5781 That will make your XEmacs totally silent -- even the default ding sound
5782 (TTY beep on TTY-s) will be gone.
5783
5784 Starting with XEmacs-20.2 you can also change these with Customize.
5785 Select from the @code{Options} menu
5786 @code{Customize->Emacs->Environment->Sound->Sound...} or type
5787 @kbd{M-x customize @key{RET} sound @key{RET}}.
5788
5789
5790 @node Q5.2.2, Q5.2.3, Q5.2.1, Miscellaneous
5791 @unnumberedsubsec Q5.2.2: How do I get funky sounds instead of a boring beep?
5792
5793 Make sure your XEmacs was compiled with sound support, and then put this
5794 in your @file{.emacs}:
5795
5796 @lisp
5797 (load-default-sounds)
5798 @end lisp
5799
5800 The sound support in XEmacs 19.14 was greatly improved over previous
5801 versions.
5802
5803 @node Q5.2.3, Q5.2.4, Q5.2.2, Miscellaneous
5804 @unnumberedsubsec Q5.2.3: What's NAS, how do I get it?
5805
5806 @xref{Q2.0.3}, for an explanation of the @dfn{Network Audio System}.
5807
5808 @node Q5.2.4, Q5.3.1, Q5.2.3, Miscellaneous
5809 @unnumberedsubsec Q5.2.4: Sunsite sounds don't play.
5810
5811 I'm having some trouble with sounds I've downloaded from sunsite.  They
5812 play when I run them through @code{showaudio} or cat them directly to
5813 @file{/dev/audio}, but XEmacs refuses to play them.
5814
5815 @email{gutschk@@uni-muenster.de, Markus Gutschke} writes:
5816
5817 @quotation
5818 [Many of] These files have an (erroneous) 24byte header that tells about
5819 the format that they have been recorded in. If you cat them to
5820 @file{/dev/audio}, the header will be ignored and the default behavior
5821 for /dev/audio will be used. This happens to be 8kHz uLaw. It is
5822 probably possible to fix the header by piping through @code{sox} and
5823 passing explicit parameters for specifying the sampling format; you then
5824 need to perform a 'null' conversion from SunAudio to SunAudio.
5825 @end quotation
5826
5827 @node Q5.3.1, Q5.3.2, Q5.2.4, Miscellaneous
5828 @unnumberedsec 5.3: Miscellaneous
5829 @unnumberedsubsec Q5.3.1: How do you make XEmacs indent CL if-clauses correctly?
5830
5831 I'd like XEmacs to indent all the clauses of a Common Lisp @code{if} the
5832 same amount instead of indenting the 3rd clause differently from the
5833 first two.
5834
5835 One way is to add, to @file{.emacs}:
5836
5837 @lisp
5838 (put 'if 'lisp-indent-function nil)
5839 @end lisp
5840
5841 However, note that the package @code{cl-indent} that comes with
5842 XEmacs sets up this kind of indentation by default.  @code{cl-indent}
5843 also knows about many other CL-specific forms.  To use @code{cl-indent},
5844 one can do this:
5845
5846 @lisp
5847 (load "cl-indent")
5848 (setq lisp-indent-function (function common-lisp-indent-function))
5849 @end lisp
5850
5851 One can also customize @file{cl-indent.el} so it mimics the default
5852 @code{if} indentation @code{then} indented more than the @code{else}.
5853 Here's how:
5854
5855 @lisp
5856 (put 'if 'common-lisp-indent-function '(nil nil &body))
5857 @end lisp
5858
5859 Also, a new version (1.2) of @file{cl-indent.el} was posted to
5860 comp.emacs.xemacs on 12/9/94.  This version includes more documentation
5861 than previous versions.  This may prove useful if you need to customize
5862 any indent-functions.
5863
5864 @node Q5.3.2, Q5.3.3, Q5.3.1, Miscellaneous
5865 @unnumberedsubsec Q5.3.2: Fontifying hang when editing a postscript file.
5866
5867 When I try to edit a postscript file it gets stuck saying:
5868 @samp{fontifying 'filename' (regexps....)} and it just sits there.  If I
5869 press @kbd{C-c} in the window where XEmacs was started, it suddenly
5870 becomes alive again.
5871
5872 This was caused by a bug in the Postscript font-lock regular
5873 expressions.  It was fixed in 19.13.  For earlier versions of XEmacs,
5874 have a look at your @file{.emacs} file.  You will probably have a line
5875 like:
5876
5877 @lisp
5878 (add-hook 'postscript-mode-hook 'turn-on-font-lock)
5879 @end lisp
5880
5881 Take it out, restart XEmacs, and it won't try to fontify your postscript
5882 files anymore.
5883
5884 @node Q5.3.3, Q5.3.4, Q5.3.2, Miscellaneous
5885 @unnumberedsubsec Q5.3.3: How can I print WYSIWYG a font-locked buffer?
5886
5887 Font-lock looks nice.  How can I print (WYSIWYG) the highlighted
5888 document?
5889
5890 The package @code{ps-print}, which is now included with XEmacs, provides
5891 the ability to do this.  The source code contains complete instructions
5892 on its use, in @file{<xemacs_src_root>/lisp/packages/ps-print.el}.
5893
5894 @node Q5.3.4, Q5.3.5, Q5.3.3, Miscellaneous
5895 @unnumberedsubsec Q5.3.4: Getting @kbd{M-x lpr} to work with postscript printer.
5896
5897 My printer is a Postscript printer and @code{lpr} only works for
5898 Postscript files, so how do I get @kbd{M-x lpr-region} and @kbd{M-x
5899 lpr-buffer} to work?
5900
5901 Put something like this in your @file{.emacs}:
5902
5903 @lisp
5904 (setq lpr-command "a2ps")
5905 (setq lpr-switches '("-p" "-1"))
5906 @end lisp
5907
5908 If you don't use a2ps to convert ASCII to postscript (why not, it's
5909 free?), replace with the command you do use.  Note also that some
5910 versions of a2ps require a @samp{-Pprinter} to ensure spooling.
5911
5912 @node Q5.3.5, Q5.3.6, Q5.3.4, Miscellaneous
5913 @unnumberedsubsec Q5.3.5: How do I specify the paths that XEmacs uses for finding files?
5914
5915 You can specify what paths to use by using a number of different flags
5916 when running configure.  See the section MAKE VARIABLES in the top-level
5917 file INSTALL in the XEmacs distribution for a listing of those flags.
5918
5919 Most of the time, however, the simplest fix is: @strong{do not} specify
5920 paths as you might for GNU Emacs.  XEmacs can generally determine the
5921 necessary paths dynamically at run time.  The only path that generally
5922 needs to be specified is the root directory to install into.  That can
5923 be specified by passing the @code{--prefix} flag to configure.  For a
5924 description of the XEmacs install tree, please consult the @file{NEWS}
5925 file.
5926
5927 @node Q5.3.6, Q5.3.7, Q5.3.5, Miscellaneous
5928 @unnumberedsubsec Q5.3.6: [This question intentionally left blank]
5929
5930 Obsolete question, left blank to avoid renumbering.
5931
5932 @node Q5.3.7, Q5.3.8, Q5.3.6, Miscellaneous
5933 @unnumberedsubsec Q5.3.7: Can I have the end of the buffer delimited in some way?
5934
5935 Say, with: @samp{[END]}?
5936
5937 Try this:
5938
5939 @lisp
5940 (let ((ext (make-extent (point-min) (point-max))))
5941   (set-extent-property ext 'start-closed t)
5942   (set-extent-property ext 'end-closed t)
5943   (set-extent-property ext 'detachable nil)
5944   (set-extent-end-glyph ext (make-glyph [string :data "[END]"])))
5945 @end lisp
5946
5947 Since this is XEmacs, you can specify an icon to be shown on
5948 window-system devices.  To do so, change the @code{make-glyph} call to
5949 something like this:
5950
5951 @lisp
5952 (make-glyph '([xpm :file "~/something.xpm"]
5953               [string :data "[END]"]))
5954 @end lisp
5955
5956 You can inline the @sc{xpm} definition yourself by specifying
5957 @code{:data} instead of @code{:file}.  Here is such a full-featured
5958 version that works on both X and TTY devices:
5959
5960 @lisp
5961 (let ((ext (make-extent (point-min) (point-max))))
5962   (set-extent-property ext 'start-closed t)
5963   (set-extent-property ext 'end-closed t)
5964   (set-extent-property ext 'detachable nil)
5965   (set-extent-end-glyph ext (make-glyph '([xpm :data "\
5966 /* XPM */
5967 static char* eye = @{
5968 \"20 11 7 2\",
5969 \"__ c None\"
5970 \"_` c #7f7f7f\",
5971 \"_a c #fefefe\",
5972 \"_b c #7f0000\",
5973 \"_c c #fefe00\",
5974 \"_d c #fe0000\",
5975 \"_e c #bfbfbf\",
5976 \"___________`_`_`___b_b_b_b_________`____\",
5977 \"_________`_`_`___b_c_c_c_b_b____________\",
5978 \"_____`_`_`_e___b_b_c_c_c___b___b_______`\",
5979 \"___`_`_e_a___b_b_d___b___b___b___b______\",
5980 \"_`_`_e_a_e___b_b_d_b___b___b___b___b____\",
5981 \"_`_`_a_e_a___b_b_d___b___b___b___b___b__\",
5982 \"_`_`_e_a_e___b_b_d_b___b___b___b___b_b__\",
5983 \"___`_`_e_a___b_b_b_d_c___b___b___d_b____\",
5984 \"_____`_`_e_e___b_b_b_d_c___b_b_d_b______\",
5985 \"_`_____`_`_`_`___b_b_b_d_d_d_d_b________\",
5986 \"___`_____`_`_`_`___b_b_b_b_b_b__________\",
5987 @} ;"]
5988                                           [string :data "[END]"]))))
5989 @end lisp
5990
5991 Note that you might want to make this a function, and put it to a hook.
5992 We leave that as an exercise for the reader.
5993
5994 @node Q5.3.8, Q5.3.9, Q5.3.7, Miscellaneous
5995 @unnumberedsubsec Q5.3.8: How do I insert today's date into a buffer?
5996
5997 Like this:
5998
5999 @lisp
6000 (insert (current-time-string))
6001 @end lisp
6002
6003 @node Q5.3.9, Q5.3.10, Q5.3.8, Miscellaneous
6004 @unnumberedsubsec Q5.3.9: Are only certain syntactic character classes available for abbrevs?
6005
6006 @email{gutschk@@uni-muenster.de, Markus Gutschke} writes:
6007
6008 @quotation
6009 Yes, abbrevs only expands word-syntax strings. While XEmacs does not
6010 prevent you from defining (e.g. with @kbd{C-x a g} or @kbd{C-x a l})
6011 abbrevs that contain special characters, it will refuse to expand
6012 them. So you need to ensure, that the abbreviation contains letters and
6013 digits only. This means that @samp{xd}, @samp{d5}, and @samp{5d} are
6014 valid abbrevs, but @samp{&d}, and @samp{x d} are not.
6015
6016 If this sounds confusing to you, (re-)read the online documentation for
6017 abbrevs (@kbd{C-h i m XEmacs @key{RET} m Abbrevs @key{RET}}), and then come back and
6018 read this question/answer again.
6019 @end quotation
6020
6021 Starting with XEmacs 20.3 this restriction has been lifted.
6022
6023 @node Q5.3.10, Q5.3.11, Q5.3.9, Miscellaneous
6024 @unnumberedsubsec Q5.3.10: How can I get those oh-so-neat X-Face lines?
6025
6026 Firstly there is an ftp site which describes X-faces and has the
6027 associated tools mentioned below, at
6028 @uref{ftp://ftp.cs.indiana.edu:/pub/faces/}.
6029
6030 Then the steps are
6031
6032 @enumerate
6033 @item
6034 Create 48x48x1 bitmap with your favorite tool
6035
6036 @item
6037 Convert to "icon" format using one of xbm2ikon, pbmtoicon, etc.,
6038 and then compile the face.
6039
6040 @item
6041 @example
6042 cat file.xbm | xbm2ikon |compface > file.face
6043 @end example
6044
6045 @item
6046 Then be sure to quote things that are necessary for emacs strings:
6047
6048 @example
6049 cat ./file.face | sed 's/\\/\\\\/g'
6050 @iftex
6051 \ @*
6052 @end iftex
6053 | sed 's/\"/\\\"/g' > ./file.face.quoted
6054 @end example
6055
6056 @item
6057 Then set up emacs to include the file as a mail header - there were a
6058 couple of suggestions here---either something like:
6059
6060 @lisp
6061 (setq  mail-default-headers
6062        "X-Face:  @email{Ugly looking text string here}")
6063 @end lisp
6064
6065 Or, alternatively, as:
6066
6067 @lisp
6068 (defun mail-insert-x-face ()
6069   (save-excursion
6070     (goto-char (point-min))
6071     (search-forward mail-header-separator)
6072     (beginning-of-line)
6073     (insert "X-Face:")
6074     (insert-file-contents "~/.face")))
6075
6076 (add-hook 'mail-setup-hook 'mail-insert-x-face)
6077 @end lisp
6078 @end enumerate
6079
6080 However, 2 things might be wrong:
6081
6082 Some versions of pbmtoicon produces some header lines that is not
6083 expected by the version of compface that I grabbed. So I found I had to
6084 include a @code{tail +3} in the pipeline like this:
6085
6086 @example
6087 cat file.xbm | xbm2ikon | tail +3 |compface > file.face
6088 @end example
6089
6090 Some people have also found that if one uses the @code{(insert-file)}
6091 method, one should NOT quote the face string using the sed script .
6092
6093 It might also be helpful to use @email{stig@@hackvan.com, Stig's} script
6094 (included in the compface distribution at XEmacs.org) to do the
6095 conversion.
6096 @comment For convenience xbm2xface is available for anonymous FTP at
6097 @comment @uref{ftp://ftp.miranova.com/pub/xemacs/xbm2xface.pl}.
6098
6099 Contributors for this item:
6100
6101 Paul Emsley,
6102 Ricardo Marek,
6103 Amir J. Katz,
6104 Glen McCort,
6105 Heinz Uphoff,
6106 Peter Arius,
6107 Paul Harrison, and
6108 Vegard Vesterheim
6109
6110 @node Q5.3.11, Q5.3.12, Q5.3.10, Miscellaneous
6111 @unnumberedsubsec Q5.3.11: How do I add new Info directories?
6112
6113 You use something like:
6114
6115 @lisp
6116 (setq Info-directory-list (cons
6117                            (expand-file-name "~/info")
6118                            Info-default-directory-list))
6119 @end lisp
6120
6121 @email{davidm@@prism.kla.com, David Masterson} writes:
6122
6123 @quotation
6124 Emacs Info and XEmacs Info do many things differently.  If you're trying to
6125 support a number of versions of Emacs, here are some notes to remember:
6126
6127 @enumerate
6128 @item
6129 Emacs Info scans @code{Info-directory-list} from right-to-left while
6130 XEmacs Info reads it from left-to-right, so append to the @emph{correct}
6131 end of the list.
6132
6133 @item
6134 Use @code{Info-default-directory-list} to initialize
6135 @code{Info-directory-list} @emph{if} it is available at startup, but not
6136 all Emacsen define it.
6137
6138 @item
6139 Emacs Info looks for a standard @file{dir} file in each of the
6140 directories scanned from #1 and magically concatenates them together.
6141
6142 @item
6143 XEmacs Info looks for a @file{localdir} file (which consists of just the
6144 menu entries from a @file{dir} file) in each of the directories scanned
6145 from #1 (except the first), does a simple concatenation of them, and
6146 magically attaches the resulting list to the end of the menu in the
6147 @file{dir} file in the first directory.
6148 @end enumerate
6149
6150 Another alternative is to convert the documentation to HTML with
6151 texi2html and read it from a web browser like Lynx or W3.
6152 @end quotation
6153
6154 @node Q5.3.12,  , Q5.3.11, Miscellaneous
6155 @unnumberedsubsec Q5.3.12: What do I need to change to make printing work?
6156
6157 For regular printing there are two variables that can be customized.
6158
6159 @table @code
6160 @item lpr-command
6161 This should be set to a command that takes standard input and sends
6162 it to a printer.  Something like:
6163
6164 @lisp
6165 (setq lpr-command "lp")
6166 @end lisp
6167
6168 @item lpr-switches
6169 This should be set to a list that contains whatever the print command
6170 requires to do its job.  Something like:
6171
6172 @lisp
6173 (setq lpr-switches '("-depson"))
6174 @end lisp
6175 @end table
6176
6177 For postscript printing there are three analogous variables to
6178 customize.
6179
6180 @table @code
6181 @item ps-lpr-command
6182 This should be set to a command that takes postscript on standard input
6183 and directs it to a postscript printer.
6184
6185 @item ps-lpr-switches
6186 This should be set to a list of switches required for
6187 @code{ps-lpr-command} to do its job.
6188
6189 @item ps-print-color-p
6190 This boolean variable should be set @code{t} if printing will be done in
6191 color, otherwise it should be set to @code{nil}.
6192 @end table
6193
6194 NOTE: It is an undocumented limitation in XEmacs that postscript
6195 printing (the @code{Pretty Print Buffer} menu item) @strong{requires} a
6196 window system environment.  It cannot be used outside of X11.
6197
6198 @node MS Windows, Current Events, Miscellaneous, Top
6199 @unnumbered 6 XEmacs on MS Windows
6200
6201 This is part 6 of the XEmacs Frequently Asked Questions list, written by
6202 Hrvoje Niksic and others.  This section is devoted to the MS Windows
6203 port of XEmacs.
6204
6205 @menu
6206
6207 General Info
6208 * Q6.0.1::      What is the status of the XEmacs port to Windows?
6209 * Q6.0.2::      What flavors of MS Windows are supported?  
6210 * Q6.0.3::      Where are the XEmacs on MS Windows binaries?
6211 * Q6.0.4::      Does XEmacs on MS Windows require an X server to run?
6212
6213 Building XEmacs on MS Windows
6214 * Q6.1.1::      I decided to run with X.  Where do I get an X server?
6215 * Q6.1.2::      What compiler do I need to compile XEmacs?
6216 * Q6.1.3::      How do I compile for the native port?
6217 * Q6.1.4::      How do I compile for the X port?
6218 * Q6.1.5::      How do I compile for Cygnus' Cygwin?
6219 * Q6.1.6::      What do I need for Cygwin?
6220
6221 Customization and User Interface
6222 * Q6.2.1::      How will the port cope with differences in the Windows user interface?
6223 * Q6.2.2::      How do I change fonts in XEmacs on MS Windows?
6224 * Q6.2.3::      Where do I put my @file{.emacs} file?
6225
6226 Miscellaneous
6227 * Q6.3.1::      Will XEmacs rename all the win32-* symbols to w32-*?
6228 * Q6.3.2::      What are the differences between the various MS Windows emacsen?
6229 * Q6.3.3::      What is the porting team doing at the moment?
6230
6231 @end menu
6232
6233 @node Q6.0.1, Q6.0.2, MS Windows, MS Windows
6234 @unnumberedsec 6.0: General Info
6235 @unnumberedsubsec Q6.0.1: What is the status of the XEmacs port to Windows?
6236
6237 Is XEmacs really getting ported to MS Windows?  What is the status of the port?
6238
6239 Yes, a group of volunteers actively works on making XEmacs code base
6240 cleanly compile and run on MS Windows operating systems.  The mailing
6241 list at @email{xemacs-nt@@xemacs.org} is dedicated to that effort (please use
6242 the -request address to subscribe).
6243
6244 At this time, XEmacs on MS Windows is usable, but lacks some of the
6245 features of XEmacs on UNIX and UNIX-like systems.  Notably,
6246 internationalization does not work.
6247
6248 @node Q6.0.2, Q6.0.3, Q6.0.1, MS Windows
6249 @unnumberedsubsec Q6.0.2: What flavors of MS Windows are supported?  The list name implies NT only.
6250
6251 The list name is misleading, as XEmacs will support both Windows 95,
6252 Windows 98 and Windows NT.  The MS Windows-specific code is based on
6253 Microsoft Win32 API, and will not work on MS Windows 3.x or on MS-DOS.
6254
6255
6256 @node Q6.0.3, Q6.0.4, Q6.0.2, MS Windows
6257 @unnumberedsubsec Q6.0.3: Are binary kits available?
6258
6259 Binary kits are available at
6260 @uref{ftp://ftp.xemacs.org/pub/xemacs/binary-kits/win32/} for the
6261 "plain" MS Windows version.
6262
6263 @node Q6.0.4, Q6.1.1, Q6.0.3, MS Windows
6264 @unnumberedsubsec Q6.0.4: Does XEmacs on MS Windows require an X server to run?
6265
6266 Short answer: No.
6267
6268 Long answer: XEmacs can be built in several ways in the MS Windows
6269 environment, some of them requiring an X server and some not.
6270
6271 One is what we call the "X" port -- it requires X libraries to build
6272 and an X server to run.  Internally it uses the Xt event loop and
6273 makes use of X toolkits.  Its look is quite un-Windowsy, but it works
6274 reliably and supports all of the graphical features of Unix XEmacs.
6275
6276 The other is what we call the "native" port.  It uses the Win32 API
6277 and does not require X libraries to build, nor does it require an X to
6278 run.  In fact, it has no connection with X whatsoever.  At this time,
6279 the native port obsoletes the X port, providing almost all of its
6280 features, including support for menus, scrollbars, toolbars, embedded
6281 images and background pixmaps, frame pointers, etc.  Most of the
6282 future work will be based on the native port.
6283
6284 There is also a third special case, the Cygwin port.  It takes
6285 advantage of Cygnus emulation library under Win32, which enables it to
6286 reuse much of the Unix XEmacs code base, such as processes and network
6287 support, or internal select() mechanisms.
6288
6289 Cygwin port supports all display types -- TTY, X & MS gui, and can be
6290 built with support for all three.  If you build with ms gui support
6291 then the Cygwin version uses the majority of the msw code, which is
6292 mostly related to display.  If you want to build with X support you
6293 need X libraries.  If you want to build with tty support you need
6294 ncurses.  MS gui requires no additional libraries.
6295
6296 Some of the advantages of the Cygwin version are that it:
6297
6298 @itemize @bullet
6299
6300 @item integrates well with Cygwin environment for existing Cygwin users;
6301 @item uses configure so building with different features is very easy;
6302 @item has process support in X & tty.
6303
6304 @end itemize
6305
6306 The disadvantage is that it requires several Unix utilities and the
6307 whole Cygwin environment, whereas the native port requires only a
6308 suitable MS Windows compiler.  Also, it follows the Unix filesystem and
6309 process model very closely (some will undoubtedly view this as an
6310 advantage).
6311
6312 @node Q6.1.1, Q6.1.2, Q6.0.4, MS Windows
6313 @unnumberedsec 6.1: Building XEmacs on MS Windows
6314 @unnumberedsubsec Q6.1.1: I decided to run with X.  Where do I get an X server?
6315
6316 Pointers to X servers can be found at
6317 @iftex
6318 @*
6319 @end iftex
6320 @uref{http://dao.gsfc.nasa.gov/software/grads/win32/X11R6.3/}; 
6321
6322 look for "Where to get an X server".  Also note that, although the above
6323 page talks about Cygnus gnu-win32 (Cygwin), the information on X servers
6324 is Cygwin-independent.  You don't have to be running/using Cygwin to use
6325 these X servers, and you don't have to compile XEmacs under Cygwin to
6326 use XEmacs with these X servers.  An "X port" XEmacs compiled under
6327 Visual C++ will work with these X servers (as will XEmacs running on a
6328 Unix box, redirected to the server running on your PC).
6329
6330
6331 @node Q6.1.2, Q6.1.3, Q6.1.1, MS Windows
6332 @unnumberedsubsec Q6.1.2: What compiler do I need to compile XEmacs?
6333
6334 You need Visual C++ 4.2 or 5.0, with the exception of the Cygwin port,
6335 which uses Gcc.
6336
6337
6338 @node Q6.1.3, Q6.1.4, Q6.1.2, MS Windows
6339 @unnumberedsubsec Q6.1.3: How do I compile for the native port?
6340
6341 Please read the file @file{nt/README} in the XEmacs distribution, which
6342 contains the full description.
6343
6344
6345 @node Q6.1.4, Q6.1.5, Q6.1.3, MS Windows
6346 @unnumberedsubsec Q6.1.4: How do I compile for the X port?
6347
6348 Again, it is described in @file{nt/README} in some detail.  Basically, you
6349 need to get X11 libraries from ftp.x.org, and compile them.  If the
6350 precompiled versions are available somewhere, I don't know of it.
6351
6352
6353 @node Q6.1.5, Q6.1.6, Q6.1.4, MS Windows
6354 @unnumberedsubsec Q6.1.5: How do I compile for Cygnus' Cygwin?
6355
6356 Similar as on Unix; use the usual `configure' and `make' process.
6357 Some problems to watch out for:
6358
6359 @itemize @bullet
6360 @item
6361 make sure HOME is set. This controls where you @file{.emacs} file comes
6362 from;
6363
6364 @item
6365 CYGWIN32 needs to be set to tty for process support
6366 work. e.g. CYGWIN32=tty;
6367
6368 @item
6369 picking up some other grep or other unix like tools can kill configure;
6370
6371 @item
6372 static heap too small, adjust src/sheap-adjust.h to a more positive
6373 number;
6374
6375 @item
6376 The Cygwin version doesn't understand @file{//machine/path} type paths so you
6377 will need to manually mount a directory of this form under a unix style
6378 directory for a build to work on the directory.
6379
6380 @end itemize
6381
6382 @node Q6.1.6, Q6.2.1, Q6.1.5, MS Windows
6383 @unnumberedsubsec Q6.1.6: What do I need for Cygwin?
6384
6385 You can find the Cygwin tools and compiler at:
6386
6387 @uref{http://sourceware.cygnus.com/cygwin/}
6388
6389 You will need version b19 or later.
6390
6391 You will also need the X libraries.  There are libraries at
6392 @iftex
6393 @*
6394 @end iftex
6395 @uref{http://dao.gsfc.nasa.gov/software/grads/win32/X11R6.3/}, but
6396 these are not b19 compatible.  You can get b19 X11R6.3 binaries, as
6397 well as pre-built ncurses and graphic libraries, from:
6398
6399 @uref{ftp://ftp.parallax.co.uk/pub/andyp/}.
6400
6401
6402 @node Q6.2.1, Q6.2.2, Q6.1.6, MS Windows
6403 @unnumberedsec 6.2: Customization and User Interface
6404 @unnumberedsubsec Q6.2.1: How will the port cope with differences in the Windows user interface?
6405
6406 XEmacs (and Emacs in general) UI is pretty 
6407 different from what is expected of a typical MS Windows program.  How will
6408 the MS Windows port cope with it?
6409
6410 Fortunately, Emacs is also one of the most configurable editor beasts
6411 in the world.  The MS Windows "look and feel" (mark via shift-arrow,
6412 self-inserting deletes region, etc.) can be easily configured via
6413 various packages distributed with XEmacs.  The `pending-delete'
6414 package is an example of such a utility.
6415
6416 In future versions, some of these packages might be turned on by
6417 default in the MS Windows environment.
6418
6419
6420 @node Q6.2.2, Q6.2.3, Q6.2.1, MS Windows
6421 @unnumberedsubsec Q6.2.2: How do I change fonts in XEmacs on MS Windows?
6422
6423 You can change font manually, but not from the menubar, yet. For
6424 example:
6425
6426 @display
6427     (set-face-font 'default "Lucida Console:Regular:10")
6428     (set-face-font 'modeline "MS Sans Serif:Regular:10")
6429 @end display
6430
6431
6432 @node Q6.2.3, Q6.3.1, Q6.2.2, MS Windows
6433 @unnumberedsubsec Q6.2.3: Where do I put my @file{.emacs} file?
6434
6435 If the HOME environment variable is set, @file{.emacs} will be looked for
6436 there.  Else the directory defaults to `c:\'.
6437
6438 @node Q6.3.1, Q6.3.2, Q6.2.3, MS Windows
6439 @unnumberedsec 6.3: Miscellaneous
6440 @unnumberedsubsec Q6.3.1: Will XEmacs rename all the win32-* symbols to w32-*?
6441
6442 In his flavor of Emacs 20, Richard Stallman has renamed all the win32-*
6443 symbols to w32-*.  Will XEmacs do the same?
6444
6445 We consider such a move counter-productive, thus we will not use the
6446 `w32' prefix.  However, we do recognize that Win32 name is little more
6447 than a marketing buzzword (will it be Win64 in the next release?), so
6448 we decided not to use it.  Using `windows-' would be wrong because the
6449 term is too generic, which is why we settled on a compromise
6450 `mswindows' term.
6451
6452 Thus all the XEmacs variables and functions directly related to Win32
6453 are prefixed `mswindows-'.  The user-variables shared with NT Emacs
6454 will be provided as compatibility aliases.
6455
6456 Architectural note: We believe that there should be a very small
6457 number of window-systems-specific variables, and will try to provide
6458 generic interfaces whenever possible.
6459
6460
6461 @node Q6.3.2, Q6.3.3, Q6.3.1, MS Windows
6462 @unnumberedsubsec Q6.3.2: What are the differences between the various MS Windows emacsen?
6463
6464 XEmacs, Win-Emacs, DOS Emacs, NT Emacs, this is all very confusing.
6465 Could you briefly explain the differences between them?
6466
6467 Here is a recount of various Emacs versions running on MS Windows:
6468
6469 @itemize @bullet
6470
6471 @item 
6472 Win-Emacs
6473
6474 @itemize @minus
6475
6476 @item
6477 Win-Emacs is a port of Lucid Emacs 19.6 to MS Windows using X
6478 compatibility libraries.  Win-Emacs has been written by Ben Wing.  The
6479 MS Windows code has not made it back to Lucid Emacs, which left Win-Emacs
6480 pretty much dead for our purposes.  Win-Emacs used to be available at
6481 Pearlsoft, but not anymore, since Pearlsoft went out of business.
6482 @end itemize
6483
6484 @item
6485 GNU Emacs for DOS
6486
6487 @itemize @minus  
6488
6489 @item
6490 GNU Emacs features support for MS-DOS and DJGPP (D.J. Delorie's DOS
6491 port of Gcc).  Such an Emacs is heavily underfeatured, because it does
6492 not supports long file names, lacks proper subprocesses support, and
6493 is far too big compared to typical DOS editors.
6494 @end itemize
6495
6496 @item
6497 GNU Emacs compiled with Win32
6498
6499 @itemize @minus  
6500
6501 @item
6502 Starting with version 19.30, it has been possible to compile GNU Emacs
6503 under MS Windows using the DJGPP compiler and X libraries.  The result
6504 is is very similar to GNU Emacs compiled under MS DOS, only it
6505 supports longer file names, etc.  This "port" is similar to the "X"
6506 flavor of XEmacs on MS Windows.
6507 @end itemize
6508
6509 @item
6510 NT Emacs
6511
6512 @itemize @minus  
6513
6514 @item
6515 NT Emacs is a version of GNU Emacs modified to compile and run under
6516 MS MS Windows 95 and NT using the native Win32 API.  As such, it is close
6517 in spirit to the XEmacs "native" port.
6518
6519 @item
6520 NT Emacs has been written by Geoff Voelker, and more information can be
6521 found at 
6522 @iftex
6523 @*
6524 @end iftex
6525 @uref{http://www.cs.washington.edu/homes/voelker/ntemacs.html}.
6526
6527 @end itemize
6528
6529 @item
6530 XEmacs
6531
6532 @itemize @minus  
6533
6534 @item
6535 Beginning with XEmacs 19.12, XEmacs' architecture has been redesigned
6536 in such a way to allow clean support of multiple window systems.  At
6537 this time the TTY support was added, making X and TTY the first two
6538 "window systems" XEmacs supported.  The 19.12 design is the basis for
6539 the current native MS Windows code.
6540
6541 @item
6542 Some time during 1997, David Hobley (soon joined by Marc Paquette)
6543 imported some of the NT-specific portions of GNU Emacs, making XEmacs
6544 with X support compile under Windows NT, and creating the "X" port.
6545
6546 @item
6547 Several months later, Jonathan Harris sent out initial patches to use
6548 the Win32 API, thus creating the native port.  Since then, various
6549 people have contributed, including Kirill M. Katsnelson (contributed
6550 support for menubars, subprocesses and network, as well as loads of
6551 other code), Andy Piper (ported XEmacs to Cygwin environment,
6552 contributed Windows unexec, Windows-specific glyphs and toolbars code,
6553 and more), Jeff Sparkes (contributed scrollbars support) and many
6554 others.
6555
6556 @end itemize
6557
6558 @end itemize
6559
6560
6561 @node Q6.3.3, , Q6.3.2, MS Windows
6562 @unnumberedsubsec Q6.3.3: What is the porting team doing at the moment?
6563
6564 The porting team is continuing work on the MS Windows-specific code.
6565
6566
6567 @node Current Events,  , MS Windows, Top
6568 @unnumbered 7 What the Future Holds
6569
6570 This is part 7 of the XEmacs Frequently Asked Questions list.  This
6571 section will change monthly, and contains any interesting items that have
6572 transpired over the previous month.  If you are reading this from the
6573 XEmacs distribution, please see the version on the Web or archived at the
6574 various FAQ FTP sites, as this file is surely out of date.
6575
6576 @menu
6577 * Q7.0.1::      What is new in 20.2?
6578 * Q7.0.2::      What is new in 20.3?
6579 * Q7.0.3::      What is new in 20.4?
6580 * Q7.0.4::      Procedural changes in XEmacs development.
6581 @end menu
6582
6583 @node Q7.0.1, Q7.0.2, Current Events, Current Events
6584 @unnumberedsec 7.0: Changes
6585 @unnumberedsubsec Q7.0.1: What is new in 20.2?
6586
6587 The biggest changes in 20.2 include integration of EFS (the next
6588 generation of ange-ftp) and AUC Tex (the Emacs subsystem that includes a
6589 major mode for editing Tex and LaTeX, and a lot of other stuff).  Many
6590 bugs from 20.0 have been fixed for this release.  20.2 also contains a
6591 new system for customizing XEmacs options, invoked via @kbd{M-x
6592 customize}.
6593
6594 XEmacs 20.2 is the development release (20.0 was beta), and is no longer
6595 considered unstable.
6596
6597 @node Q7.0.2, Q7.0.3, Q7.0.1, Current Events
6598 @unnumberedsubsec Q7.0.2: What is new in 20.3?
6599
6600 XEmacs 20.3 was released in November 1997. It contains many bugfixes,
6601 and a number of new features, including Autoconf 2 based configuration,
6602 additional support for Mule (Multi-language extensions to Emacs), many
6603 more customizations, multiple frames on TTY-s, support for multiple info
6604 directories, an enhanced gnuclient, improvements to regexp matching,
6605 increased MIME support, and many, many synches with GNU Emacs 20.
6606
6607 The XEmacs/Mule support has been only seriously tested in a Japanese
6608 locale, and no doubt many problems still remain.  The support for
6609 ISO-Latin-1 and Japanese is fairly strong.  MULE support comes at a
6610 price -- about a 30% slowdown from 19.16.  We're making progress on
6611 improving performance and XEmacs 20.3 compiled without Mule (which is
6612 the default) is definitely faster than XEmacs 19.16.
6613
6614 XEmacs 20.3 is the first non-beta v20 release, and will be the
6615 basis for all further development.
6616
6617 @node Q7.0.3, Q7.0.4, Q7.0.2, Current Events
6618 @unnumberedsubsec Q7.0.3: What's new in XEmacs 20.4?
6619
6620 XEmacs 20.4 is a bugfix release with no user-visible changes.
6621 @c Filled in from NEWS file of 20.5-b33
6622
6623
6624 @node Q7.0.4,  , Q7.0.3, Current Events
6625 @unnumberedsubsec Q7.0.4: Procedural changes in XEmacs development.
6626
6627 @enumerate
6628 @item
6629 Discussion about the development of XEmacs occurs on the xemacs-beta
6630 mailing list.  Subscriptions to this list will now be fully automated
6631 instead of being handled by hand.  Send a mail message to
6632 @email{xemacs-beta-request@@xemacs.org} with @samp{subscribe} as the
6633 BODY of the message to join the list.  Please note this is a developers
6634 mailing list for people who have an active interest in the development
6635 process.
6636
6637 The discussion of NT XEmacs development is taking place on a separate
6638 mailing list.  Send mail to
6639 @iftex
6640 @*
6641 @end iftex
6642 @email{xemacs-nt-request@@xemacs.org} to
6643 subscribe.
6644
6645 @item
6646 Due to the long development cycle in between releases, it has been
6647 decided that intermediate versions will be made available in source only
6648 form for the truly interested.
6649
6650 XEmacs 19.16 was the last 19 release, basically consisting of 19.15 plus
6651 the collected bugfixes.
6652
6653 @item
6654 As of December 1996, @email{steve@@xemacs.org, Steve Baur} has become
6655 the lead maintainer of XEmacs.
6656 @end enumerate
6657
6658 @bye