This commit was generated by cvs2svn to compensate for changes in r6453,
[chise/xemacs-chise.git.1] / info / xemacs-faq.info-3
1 This is Info file ../info/xemacs-faq.info, produced by Makeinfo version
2 1.68 from the input file xemacs-faq.texi.
3
4 INFO-DIR-SECTION XEmacs Editor
5 START-INFO-DIR-ENTRY
6 * FAQ: (xemacs-faq).            XEmacs FAQ.
7 END-INFO-DIR-ENTRY
8
9 \1f
10 File: xemacs-faq.info,  Node: Customization,  Next: Subsystems,  Prev: Installation,  Up: Top
11
12 3 Customization and Options
13 ***************************
14
15    This is part 3 of the XEmacs Frequently Asked Questions list.  This
16 section is devoted to Customization and screen settings.
17
18 * Menu:
19
20 Customization--Emacs Lisp and `.emacs':
21 * Q3.0.1::      What version of Emacs am I running?
22 * Q3.0.2::      How do I evaluate Elisp expressions?
23 * Q3.0.3::      `(setq tab-width 6)' behaves oddly.
24 * Q3.0.4::      How can I add directories to the `load-path'?
25 * Q3.0.5::      How to check if a lisp function is defined?
26 * Q3.0.6::      Can I force the output of `(face-list)' to a buffer?
27 * Q3.0.7::      Font selections don't get saved after `Save Options'.
28 * Q3.0.8::      How do I make a single minibuffer frame?
29 * Q3.0.9::      What is `Customize'?
30
31 X Window System & Resources:
32 * Q3.1.1::      Where is a list of X resources?
33 * Q3.1.2::      How can I detect a color display?
34 * Q3.1.3::      `(set-screen-width)' worked in 19.6, but not in 19.13?
35 * Q3.1.4::      Specifying `Emacs*EmacsScreen.geometry' in `.emacs' does not work in 19.15?
36 * Q3.1.5::      How can I get the icon to just say `XEmacs'?
37 * Q3.1.6::      How can I have the window title area display the full path?
38 * Q3.1.7::      `xemacs -name junk' doesn't work?
39 * Q3.1.8::      `-iconic' doesn't work.
40
41 Textual Fonts & Colors:
42 * Q3.2.1::      How can I set color options from `.emacs'?
43 * Q3.2.2::      How do I set the text, menu and modeline fonts?
44 * Q3.2.3::      How can I set the colors when highlighting a region?
45 * Q3.2.4::      How can I limit color map usage?
46 * Q3.2.5::      My tty supports color, but XEmacs doesn't use them.
47 * Q3.2.6::      Can I have pixmap backgrounds in XEmacs?
48
49 The Modeline:
50 * Q3.3.1::      How can I make the modeline go away?
51 * Q3.3.2::      How do you have XEmacs display the line number in the modeline?
52 * Q3.3.3::      How do I get XEmacs to put the time of day on the modeline?
53 * Q3.3.4::      How do I turn off current chapter from AUC TeX modeline?
54 * Q3.3.5::      How can one change the modeline color based on the mode used?
55
56 3.4 Multiple Device Support:
57 * Q3.4.1::      How do I open a frame on another screen of my multi-headed display?
58 * Q3.4.2::      Can I really connect to a running XEmacs after calling up over a modem?  How?
59
60 3.5 The Keyboard:
61 * Q3.5.1::      How can I bind complex functions (or macros) to keys?
62 * Q3.5.2::      How can I stop down-arrow from adding empty lines to the bottom of my buffers?
63 * Q3.5.3::      How do I bind C-. and C-; to scroll one line up and down?
64 * Q3.5.4::      Globally binding `Delete'?
65 * Q3.5.5::      Scrolling one line at a time.
66 * Q3.5.6::      How to map `Help' key alone on Sun type4 keyboard?
67 * Q3.5.7::      How can you type in special characters in XEmacs?
68 * Q3.5.8::      Why does `(global-set-key [delete-forward] 'delete-char)' complain?
69 * Q3.5.9::      How do I make the Delete key delete forward?
70 * Q3.5.10::     Can I turn on "sticky" modifier keys?
71 * Q3.5.11::     How do I map the arrow keys?
72
73 The Cursor:
74 * Q3.6.1::      Is there a way to make the bar cursor thicker?
75 * 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?
76 * Q3.6.3::      Can I make the cursor blink?
77
78 The Mouse and Highlighting:
79 * Q3.7.1::      How can I turn off Mouse pasting?
80 * Q3.7.2::      How do I set control/meta/etc modifiers on mouse buttons?
81 * Q3.7.3::      Clicking the left button does not do anything in buffer list.
82 * Q3.7.4::      How can I get a list of buffers when I hit mouse button 3?
83 * Q3.7.5::      Why does cut-and-paste not work between XEmacs and a cmdtool?
84 * Q3.7.6::      How I can set XEmacs up so that it pastes where the text cursor is?
85 * Q3.7.7::      How do I select a rectangular region?
86 * Q3.7.8::      Why does `M-w' take so long?
87
88 The Menubar and Toolbar:
89 * Q3.8.1::      How do I get rid of the menu (or menubar)?
90 * Q3.8.2::      Can I customize the basic menubar?
91 * Q3.8.3::      How do I control how many buffers are listed in the menu `Buffers' list?
92 * Q3.8.4::      Resources like `Emacs*menubar*font' are not working?
93 * Q3.8.5::      How can I bind a key to a function to toggle the toolbar?
94
95 Scrollbars:
96 * Q3.9.1::      How can I disable the scrollbar?
97 * Q3.9.2::      How can one use resources to change scrollbar colors?
98 * Q3.9.3::      Moving the scrollbar can move the point; can I disable this?
99 * Q3.9.4::      How can I get automatic horizontal scrolling?
100
101 Text Selections:
102 * Q3.10.1::     How can I turn off or change highlighted selections?
103 * Q3.10.2::     How do I get that typing on an active region removes it?
104 * Q3.10.3::     Can I turn off the highlight during isearch?
105 * Q3.10.4::     How do I turn off highlighting after `C-x C-p' (mark-page)?
106 * Q3.10.5::     The region disappears when I hit the end of buffer while scrolling.
107
108 \1f
109 File: xemacs-faq.info,  Node: Q3.0.1,  Next: Q3.0.2,  Prev: Customization,  Up: Customization
110
111 3.0: Customization - Emacs Lisp and .emacs
112 ==========================================
113
114 Q3.0.1: What version of Emacs am I running?
115 -------------------------------------------
116
117    How can `.emacs' determine which of the family of Emacsen I am using?
118
119    To determine if you are currently running GNU Emacs 18, GNU Emacs 19,
120 XEmacs 19, XEmacs 20, or Epoch, and use appropriate code, check out the
121 example given in `etc/sample.emacs'.  There are other nifty things in
122 there as well!
123
124    For all new code, all you really need to do is:
125
126      (defvar running-xemacs (string-match "XEmacs\\|Lucid" emacs-version))
127
128 \1f
129 File: xemacs-faq.info,  Node: Q3.0.2,  Next: Q3.0.3,  Prev: Q3.0.1,  Up: Customization
130
131 Q3.0.2: How can I evaluate Emacs-Lisp expressions?
132 --------------------------------------------------
133
134    I know I can evaluate Elisp expressions from `*scratch*' buffer with
135 `C-j' after the expression.  How do I do it from another buffer?
136
137    Press `M-:' (the default binding of `eval-expression'), and enter
138 the expression to the minibuffer.  In XEmacs prior to 19.15
139 `eval-expression' used to be a disabled command by default.  If this is
140 the case, upgrade your XEmacs.
141
142 \1f
143 File: xemacs-faq.info,  Node: Q3.0.3,  Next: Q3.0.4,  Prev: Q3.0.2,  Up: Customization
144
145 Q3.0.3: `(setq tab-width 6)' behaves oddly.
146 -------------------------------------------
147
148    If you put `(setq tab-width 6)' in your `.emacs' file it does not
149 work!  Is there a reason for this?  If you do it at the EVAL prompt it
150 works fine!! How strange.
151
152    Use `setq-default' instead, since `tab-width' is all-buffer-local.
153
154 \1f
155 File: xemacs-faq.info,  Node: Q3.0.4,  Next: Q3.0.5,  Prev: Q3.0.3,  Up: Customization
156
157 Q3.0.4: How can I add directories to the `load-path'?
158 -----------------------------------------------------
159
160    Here are two ways to do that, one that puts your directories at the
161 front of the load-path, the other at the end:
162
163      ;;; Add things at the beginning of the load-path, do not add
164      ;;; duplicate directories:
165      (pushnew "bar" load-path :test 'equal)
166      
167      (pushnew "foo" load-path :test 'equal)
168      
169      ;;; Add things at the end, unconditionally
170      (setq load-path (nconc load-path '("foo" "bar")))
171
172    keith (k.p.) hanlan <keithh@nortel.ca> writes:
173
174      To add directories using Unix shell metacharacters use
175      `expand-file-name' like this:
176
177           (push (expand-file-name "~keithh/.emacsdir") load-path)
178
179 \1f
180 File: xemacs-faq.info,  Node: Q3.0.5,  Next: Q3.0.6,  Prev: Q3.0.4,  Up: Customization
181
182 Q3.0.5: How to check if a lisp function is defined?
183 ---------------------------------------------------
184
185    Use the following elisp:
186
187      (fboundp 'foo)
188
189    It's almost always a mistake to test `emacs-version' or any similar
190 variables.
191
192    Instead, use feature-tests, such as `featurep', `boundp', `fboundp',
193 or even simple behavioral tests, eg.:
194
195      (defvar foo-old-losing-code-p
196        (condition-case nil (progn (losing-code t) nil)
197          (wrong-number-of-arguments t)))
198
199    There is an incredible amount of broken code out there which could
200 work much better more often in more places if it did the above instead
201 of trying to divine its environment from the value of one variable.
202
203 \1f
204 File: xemacs-faq.info,  Node: Q3.0.6,  Next: Q3.0.7,  Prev: Q3.0.5,  Up: Customization
205
206 Q3.0.6: Can I force the output of `(face-list)' to a buffer?
207 ------------------------------------------------------------
208
209    It would be good having it in a buffer, as the output of
210 `(face-list)' is too wide to fit to a minibuffer.
211
212    Evaluate the expression in the `*scratch*' buffer with point after
213 the rightmost paren and typing `C-j'.
214
215    If the minibuffer smallness is the only problem you encounter, you
216 can simply press `C-h l' to get the former minibuffer contents in a
217 buffer.
218
219 \1f
220 File: xemacs-faq.info,  Node: Q3.0.7,  Next: Q3.0.8,  Prev: Q3.0.6,  Up: Customization
221
222 Q3.0.7: Font selections in don't get saved after `Save Options'.
223 ----------------------------------------------------------------
224
225    For XEmacs 19.14 and previous:
226
227    John Mann <mannj@ll.mit.edu> writes:
228
229      You have to go to Options->Frame Appearance and unselect
230      `Frame-Local Font Menu'.  If this option is selected, font changes
231      are only applied to the *current* frame and do *not* get saved
232      when you save options.
233
234    For XEmacs 19.15 and later:
235
236    Implement the above as well as set the following in your `.emacs'
237
238      (setq options-save-faces t)
239
240 \1f
241 File: xemacs-faq.info,  Node: Q3.0.8,  Next: Q3.0.9,  Prev: Q3.0.7,  Up: Customization
242
243 Q3.0.8: How do I get a single minibuffer frame?
244 -----------------------------------------------
245
246    Vin Shelton <acs@acm.org> writes:
247
248      (setq initial-frame-plist '(minibuffer nil))
249      (setq default-frame-plist '(minibuffer nil))
250      (setq default-minibuffer-frame
251            (make-frame
252             '(minibuffer only
253                     width 86
254                     height 1
255                     menubar-visible-p nil
256                     default-toolbar-visible-p nil
257                     name "minibuffer"
258                     top -2
259                     left -2
260                     has-modeline-p nil)))
261      (frame-notice-user-settings)
262
263    *Please note:* The single minibuffer frame may not be to everyone's
264 taste, and there any number of other XEmacs options settings that may
265 make it difficult or inconvenient to use.
266
267 \1f
268 File: xemacs-faq.info,  Node: Q3.0.9,  Next: Q3.1.1,  Prev: Q3.0.8,  Up: Customization
269
270 Q3.0.9: What is `Customize'?
271 ----------------------------
272
273    Starting with XEmacs 20.2 there is new system 'Customize' for
274 customizing XEmacs options.
275
276    You can access `Customize' from the `Options' menu or invoking one
277 of customize commands by typing eg.  `M-x customize', `M-x
278 customize-face', `M-x customize-variable' or `M-x customize-apropos'.
279
280    Starting with XEmacs 20.3 there is also new `browser' mode for
281 Customize.  Try it out with `M-x customize-browse'
282
283 \1f
284 File: xemacs-faq.info,  Node: Q3.1.1,  Next: Q3.1.2,  Prev: Q3.0.9,  Up: Customization
285
286 3.1: X Window System & Resources
287 ================================
288
289 Q3.1.1: Where is a list of X resources?
290 ---------------------------------------
291
292    Search through the `NEWS' file for `X Resources'.  A fairly
293 comprehensive list is given after it.
294
295    In addition, an `app-defaults' file is supplied, `etc/Emacs.ad'
296 listing the defaults.  The file `etc/sample.Xdefaults' gives a set of
297 defaults that you might consider.  It is essentially the same as
298 `etc/Emacs.ad' but some entries are slightly altered.  Be careful about
299 installing the contents of this file into your `.Xdefaults' or
300 `.Xresources' file if you use GNU Emacs under X11 as well.
301
302 \1f
303 File: xemacs-faq.info,  Node: Q3.1.2,  Next: Q3.1.3,  Prev: Q3.1.1,  Up: Customization
304
305 Q3.1.2: How can I detect a color display?
306 -----------------------------------------
307
308    You can test the return value of the function `(device-class)', as
309 in:
310
311      (when (eq (device-class) 'color)
312        (set-face-foreground  'font-lock-comment-face "Grey")
313        (set-face-foreground  'font-lock-string-face  "Red")
314        ....
315        )
316
317 \1f
318 File: xemacs-faq.info,  Node: Q3.1.3,  Next: Q3.1.4,  Prev: Q3.1.2,  Up: Customization
319
320 Q3.1.3: `(set-screen-width)' worked in 19.6, but not in 19.13?
321 --------------------------------------------------------------
322
323    In Lucid Emacs 19.6 I did `(set-screen-width CHARACTERS)' and
324 `(set-screen-height LINES)' in my `.emacs' instead of specifying
325 `Emacs*EmacsScreen.geometry' in my `.Xdefaults' but this does not work
326 in XEmacs 19.13.
327
328    These two functions now take frame arguments:
329
330      (set-frame-width (selected-frame) CHARACTERS)
331      (set-frame-height (selected-frame) LINES)
332
333 \1f
334 File: xemacs-faq.info,  Node: Q3.1.4,  Next: Q3.1.5,  Prev: Q3.1.3,  Up: Customization
335
336 Q3.1.4: Specifying `Emacs*EmacsScreen.geometry' in `.emacs' does not work in 19.15?
337 -----------------------------------------------------------------------------------
338
339    In XEmacs 19.11 I specified `Emacs*EmacsScreen.geometry' in my
340 `.emacs' but this does not work in XEmacs 19.15.
341
342    We have switched from using the term "screen" to using the term
343 "frame".
344
345    The correct entry for your `.Xdefaults' is now:
346
347      Emacs*EmacsFrame.geometry
348
349 \1f
350 File: xemacs-faq.info,  Node: Q3.1.5,  Next: Q3.1.6,  Prev: Q3.1.4,  Up: Customization
351
352 Q3.1.5: How can I get the icon to just say `XEmacs'?
353 ----------------------------------------------------
354
355    I'd like the icon to just say `XEmacs', and not include the name of
356 the current file in it.
357
358    Add the following line to your `.emacs':
359
360      (setq frame-icon-title-format "XEmacs")
361
362 \1f
363 File: xemacs-faq.info,  Node: Q3.1.6,  Next: Q3.1.7,  Prev: Q3.1.5,  Up: Customization
364
365 Q3.1.6: How can I have the window title area display the full path?
366 -------------------------------------------------------------------
367
368    I'd like to have the window title area display the full
369 directory/name of the current buffer file and not just the name.
370
371    Add the following line to your `.emacs':
372
373      (setq frame-title-format "%S: %f")
374
375    A more sophisticated title might be:
376
377      (setq frame-title-format
378            '("%S: " (buffer-file-name "%f"
379                                  (dired-directory dired-directory "%b"))))
380
381    That is, use the file name, or the dired-directory, or the buffer
382 name.
383
384 \1f
385 File: xemacs-faq.info,  Node: Q3.1.7,  Next: Q3.1.8,  Prev: Q3.1.6,  Up: Customization
386
387 Q3.1.7: `xemacs -name junk' doesn't work?
388 -----------------------------------------
389
390    When I run `xterm -name junk', I get an xterm whose class name
391 according to xprop, is `junk'.  This is the way it's supposed to work,
392 I think.  When I run `xemacs -name junk' the class name is not set to
393 `junk'.  It's still `emacs'.  What does `xemacs -name' really do?  The
394 reason I ask is that my window manager (fvwm) will make a window sticky
395 and I use XEmacs to read my mail.  I want that XEmacs window to be
396 sticky, without having to use the window manager's function to set the
397 window sticky.  What gives?
398
399    `xemacs -name' sets the application name for the program (that is,
400 the thing which normally comes from `argv[0]').  Using `-name' is the
401 same as making a copy of the executable with that new name.  The
402 `WM_CLASS' property on each frame is set to the frame-name, and the
403 application-class.  So, if you did `xemacs -name FOO' and then created
404 a frame named BAR, you'd get an X window with WM_CLASS = `( "BAR",
405 "Emacs")'.  However, the resource hierarchy for this widget would be:
406
407      Name:    FOO   .shell             .container   .BAR
408      Class:   Emacs .TopLevelEmacsShell.EmacsManager.EmacsFrame
409
410    instead of the default
411
412      Name:    xemacs.shell             .container   .emacs
413      Class:   Emacs .TopLevelEmacsShell.EmacsManager.EmacsFrame
414
415    It is arguable that the first element of WM_CLASS should be set to
416 the application-name instead of the frame-name, but I think that's less
417 flexible, since it does not give you the ability to have multiple frames
418 with different WM_CLASS properties.  Another possibility would be for
419 the default frame name to come from the application name instead of
420 simply being `emacs'.  However, at this point, making that change would
421 be troublesome: it would mean that many users would have to make yet
422 another change to their resource files (since the default frame name
423 would suddenly change from `emacs' to `xemacs', or whatever the
424 executable happened to be named), so we'd rather avoid it.
425
426    To make a frame with a particular name use:
427
428      (make-frame '((name . "the-name")))
429
430 \1f
431 File: xemacs-faq.info,  Node: Q3.1.8,  Next: Q3.2.1,  Prev: Q3.1.7,  Up: Customization
432
433 Q3.1.8: `-iconic' doesn't work.
434 -------------------------------
435
436    When I start up XEmacs using `-iconic' it doesn't work right.  Using
437 `-unmapped' on the command line, and setting the `initiallyUnmapped' X
438 Resource don't seem to help much either...
439
440    Ben Wing <ben@666.com> writes:
441
442      Ugh, this stuff is such an incredible mess that I've about given up
443      getting it to work.  The principal problem is numerous
444      window-manager bugs...
445
446 \1f
447 File: xemacs-faq.info,  Node: Q3.2.1,  Next: Q3.2.2,  Prev: Q3.1.8,  Up: Customization
448
449 3.2: Textual Fonts & Colors
450 ===========================
451
452 Q3.2.1: How can I set color options from `.emacs'?
453 --------------------------------------------------
454
455    How can I set the most commonly used color options from my `.emacs'
456 instead of from my `.Xdefaults'?
457
458    Like this:
459
460      (set-face-background 'default      "bisque") ; frame background
461      (set-face-foreground 'default      "black") ; normal text
462      (set-face-background 'zmacs-region "red") ; When selecting w/
463                                         ; mouse
464      (set-face-foreground 'zmacs-region "yellow")
465      (set-face-font       'default      "*courier-bold-r*120-100-100*")
466      (set-face-background 'highlight    "blue") ; Ie when selecting
467                                         ; buffers
468      (set-face-foreground 'highlight    "yellow")
469      (set-face-background 'modeline     "blue") ; Line at bottom
470                                         ; of buffer
471      (set-face-foreground 'modeline     "white")
472      (set-face-font       'modeline     "*bold-r-normal*140-100-100*")
473      (set-face-background 'isearch      "yellow") ; When highlighting
474                                         ; while searching
475      (set-face-foreground 'isearch      "red")
476      (setq x-pointer-foreground-color   "black") ; Adds to bg color,
477                                         ; so keep black
478      (setq x-pointer-background-color   "blue") ; This is color
479                                         ; you really
480                                         ; want ptr/crsr
481
482 \1f
483 File: xemacs-faq.info,  Node: Q3.2.2,  Next: Q3.2.3,  Prev: Q3.2.1,  Up: Customization
484
485 Q3.2.2: How do I set the text, menu and modeline fonts?
486 -------------------------------------------------------
487
488    Note that you should use `Emacs.' and not `Emacs*' when setting face
489 values.
490
491    In `.Xdefaults':
492
493      Emacs.default.attributeFont:  -*-*-medium-r-*-*-*-120-*-*-m-*-*-*
494      Emacs*menubar*font:           fixed
495      Emacs.modeline.attributeFont: fixed
496
497    This is confusing because modeline is a face, and can be found listed
498 with all faces in the current mode by using `M-x set-face-font (enter)
499 ?'.  It uses the face specification of `attributeFont', while menubar
500 is a normal X thing that uses the specification `font'.  With Motif it
501 may be necessary to use `fontList' instead of `font'.
502
503 \1f
504 File: xemacs-faq.info,  Node: Q3.2.3,  Next: Q3.2.4,  Prev: Q3.2.2,  Up: Customization
505
506 Q3.2.3: How can I set the colors when highlighting a region?
507 ------------------------------------------------------------
508
509    How can I set the background/foreground colors when highlighting a
510 region?
511
512    You can change the face `zmacs-region' either in your `.Xdefaults':
513
514      Emacs.zmacs-region.attributeForeground: firebrick
515      Emacs.zmacs-region.attributeBackground: lightseagreen
516
517    or in your `.emacs':
518
519      (set-face-background 'zmacs-region "red")
520      (set-face-foreground 'zmacs-region "yellow")
521
522 \1f
523 File: xemacs-faq.info,  Node: Q3.2.4,  Next: Q3.2.5,  Prev: Q3.2.3,  Up: Customization
524
525 Q3.2.4: How can I limit color map usage?
526 ----------------------------------------
527
528    I'm using Netscape (or another color grabber like XEmacs); is there
529 anyway to limit the number of available colors in the color map?
530
531    XEmacs 19.13 didn't have such a mechanism (unlike netscape, or other
532 color-hogs).  One solution is to start XEmacs prior to netscape, since
533 this will prevent Netscape from grabbing all colors (but Netscape will
534 complain).  You can use the flags for Netscape, like -mono, -ncols <#>
535 or -install (for mono, limiting to <#> colors, or for using a private
536 color map).  Since Netscape will take the entire colormap and never
537 release it, the only reasonable way to run it is with `-install'.
538
539    If you have the money, another solution would be to use a truecolor
540 or direct color video.
541
542    Starting with XEmacs 19.14, XEmacs uses the closest available color
543 if the colormap is full, so it's O.K. now to start Netscape first.
544
545 \1f
546 File: xemacs-faq.info,  Node: Q3.2.5,  Next: Q3.2.6,  Prev: Q3.2.4,  Up: Customization
547
548 Q3.2.5: My tty supports color, but XEmacs doesn't use them.
549 -----------------------------------------------------------
550
551    XEmacs tries to automatically determine whether your tty supports
552 color, but sometimes guesses wrong.  In that case, you can make XEmacs
553 Do The Right Thing using this Lisp code:
554
555      (if (eq 'tty (device-type))
556          (set-device-class nil 'color))
557
558 \1f
559 File: xemacs-faq.info,  Node: Q3.2.6,  Next: Q3.3.1,  Prev: Q3.2.5,  Up: Customization
560
561 Q3.2.6: Can I have pixmap backgrounds in XEmacs?
562 ------------------------------------------------
563
564    Juan Villacis <jvillaci@wahnsinnig.extreme.indiana.edu> writes:
565
566      There are several ways to do it.  For example, you could specify a
567      default pixmap image to use in your `~/.Xresources', e.g.,
568
569             Emacs*EmacsFrame.default.attributeBackgroundPixmap: /path/to/image.xpm
570
571      and then reload ~/.Xresources and restart XEmacs.  Alternatively,
572      since each face can have its own pixmap background, a better way
573      would be to set a face's pixmap within your XEmacs init file, e.g.,
574
575             (set-face-background-pixmap 'default "/path/to/image.xpm")
576             (set-face-background-pixmap 'bold    "/path/to/another_image.xpm")
577
578      and so on.  You can also do this interactively via `M-x
579      edit-faces'.
580
581
582 3.3: The Modeline
583 =================
584
585 \1f
586 File: xemacs-faq.info,  Node: Q3.3.1,  Next: Q3.3.2,  Prev: Q3.2.6,  Up: Customization
587
588 Q3.3.1: How can I make the modeline go away?
589 --------------------------------------------
590
591      (set-specifier has-modeline-p nil)
592
593    Starting with XEmacs 19.14 the modeline responds to mouse clicks, so
594 if you haven't liked or used the modeline in the past, you might want to
595 try the new version out.
596
597 \1f
598 File: xemacs-faq.info,  Node: Q3.3.2,  Next: Q3.3.3,  Prev: Q3.3.1,  Up: Customization
599
600 Q3.3.2: How do you have XEmacs display the line number in the modeline?
601 -----------------------------------------------------------------------
602
603    Add the following line to your `.emacs' file to display the line
604 number:
605
606      (line-number-mode 1)
607
608    Use the following to display the column number:
609
610      (column-number-mode 1)
611
612    Or select from the `Options' menu
613 `Customize->Emacs->Editing->Basics->Line Number Mode' and/or
614 `Customize->Emacs->Editing->Basics->Column Number Mode'
615
616    Or type `M-x customize <RET> editing-basics <RET>'.
617
618 \1f
619 File: xemacs-faq.info,  Node: Q3.3.3,  Next: Q3.3.4,  Prev: Q3.3.2,  Up: Customization
620
621 Q3.3.3: How do I get XEmacs to put the time of day on the modeline?
622 -------------------------------------------------------------------
623
624    Add the following line to your `.emacs' file to display the time:
625
626      (display-time)
627
628    See `Customize' from the `Options' menu for customization.
629
630 \1f
631 File: xemacs-faq.info,  Node: Q3.3.4,  Next: Q3.3.5,  Prev: Q3.3.3,  Up: Customization
632
633 Q3.3.4: How do I turn off current chapter from AUC TeX modeline?
634 ----------------------------------------------------------------
635
636    With AUC TeX, fast typing is hard because the current chapter,
637 section etc. are given in the modeline.  How can I turn this off?
638
639    It's not AUC TeX, it comes from `func-menu' in `func-menu.el'.  Add
640 this code to your `.emacs' to turn it off:
641
642      (setq fume-display-in-modeline-p nil)
643
644    Or just add a hook to `TeX-mode-hook' to turn it off only for TeX
645 mode:
646
647      (add-hook 'TeX-mode-hook
648           '(lambda () (setq fume-display-in-modeline-p nil)))
649
650    David Hughes <dhughes@origin-at.co.uk> writes:
651
652      If you have 19.14 or later, try this instead; you'll still get the
653      function name displayed in the modeline, but it won't attempt to
654      keep track when you modify the file. To refresh when it gets out
655      of synch, you simply need click on the `Rescan Buffer' option in
656      the function-menu.
657
658           (setq-default fume-auto-rescan-buffer-p nil)
659
660 \1f
661 File: xemacs-faq.info,  Node: Q3.3.5,  Next: Q3.4.1,  Prev: Q3.3.4,  Up: Customization
662
663 Q3.3.5: How can one change the modeline color based on the mode used?
664 ---------------------------------------------------------------------
665
666    You can use something like the following:
667
668      (add-hook 'lisp-mode-hook
669                (lambda ()
670                  (set-face-background 'modeline "red" (current-buffer))))
671
672    Then, when editing a Lisp file (i.e. when in Lisp mode), the modeline
673 colors change from the default set in your `.emacs'.  The change will
674 only be made in the buffer you just entered (which contains the Lisp
675 file you are editing) and will not affect the modeline colors anywhere
676 else.
677
678    Notes:
679
680    * The hook is the mode name plus `-hook'.  eg. c-mode-hook,
681      c++-mode-hook, emacs-lisp-mode-hook (used for your `.emacs' or a
682      `xx.el' file), lisp-interaction-mode-hook (the `*scratch*'
683      buffer), text-mode-hook, etc.
684
685    * Be sure to use `add-hook', not `(setq c-mode-hook xxxx)',
686      otherwise you will erase anything that anybody has already put on
687      the hook.
688
689    * You can also do `(set-face-font 'modeline FONT)', eg.
690      `(set-face-font 'modeline "*bold-r-normal*140-100-100*"
691      (current-buffer))' if you wish the modeline font to vary based on
692      the current mode.
693
694    This works in 19.15 as well, but there are additional modeline faces,
695 `modeline-buffer-id', `modeline-mousable', and
696 `modeline-mousable-minor-mode', which you may want to customize.
697
698 \1f
699 File: xemacs-faq.info,  Node: Q3.4.1,  Next: Q3.4.2,  Prev: Q3.3.5,  Up: Customization
700
701 3.4: Multiple Device Support
702 ============================
703
704 Q3.4.1: How do I open a frame on another screen of my multi-headed display?
705 ---------------------------------------------------------------------------
706
707    The support for this was revamped for 19.14.  Use the command `M-x
708 make-frame-on-display'.  This command is also on the File menu in the
709 menubar.
710
711    XEmacs 19.14 and later also have the command `make-frame-on-tty'
712 which will establish a connection to any tty-like device.  Opening the
713 TTY devices should be left to `gnuclient', though.
714
715 \1f
716 File: xemacs-faq.info,  Node: Q3.4.2,  Next: Q3.5.1,  Prev: Q3.4.1,  Up: Customization
717
718 Q3.4.2: Can I really connect to a running XEmacs after calling up over a modem?  How?
719 -------------------------------------------------------------------------------------
720
721    If you're not running at least XEmacs 19.14, you can't.  Otherwise
722 check out the `gnuattach' program supplied with XEmacs.  Starting with
723 XEmacs 20.3, `gnuattach' and `gnudoit' functionality is provided by
724 `gnuclient'.
725
726    Also *Note Q5.0.12::.
727
728 \1f
729 File: xemacs-faq.info,  Node: Q3.5.1,  Next: Q3.5.2,  Prev: Q3.4.2,  Up: Customization
730
731 3.5: The Keyboard
732 =================
733
734 Q3.5.1: How can I bind complex functions (or macros) to keys?
735 -------------------------------------------------------------
736
737    As an example, say you want the `paste' key on a Sun keyboard to
738 insert the current Primary X selection at point. You can accomplish this
739 with:
740
741      (define-key global-map [f18] 'x-insert-selection)
742
743    However, this only works if there is a current X selection (the
744 selection will be highlighted).  The functionality I like is for the
745 `paste' key to insert the current X selection if there is one,
746 otherwise insert the contents of the clipboard.  To do this you need to
747 pass arguments to `x-insert-selection'.  This is done by wrapping the
748 call in a 'lambda form:
749
750      (global-set-key [f18]
751        (lambda () (interactive) (x-insert-selection t nil)))
752
753    This binds the f18 key to a "generic" functional object.  The
754 interactive spec is required because only interactive functions can be
755 bound to keys.
756
757    For the FAQ example you could use:
758
759      (global-set-key [(control ?.)]
760        (lambda () (interactive) (scroll-up 1)))
761      (global-set-key [(control ?                ;)]
762                           (lambda () (interactive) (scroll-up -1)))
763
764    This is fine if you only need a few functions within the lambda body.
765 If you're doing more it's cleaner to define a separate function as in
766 question 3.5.3 (*note Q3.5.3::.).
767
768 \1f
769 File: xemacs-faq.info,  Node: Q3.5.2,  Next: Q3.5.3,  Prev: Q3.5.1,  Up: Customization
770
771 Q3.5.2: How can I stop down-arrow from adding empty lines to the bottom of my buffers?
772 --------------------------------------------------------------------------------------
773
774    Add the following line to your `.emacs' file:
775
776      (setq next-line-add-newlines nil)
777
778    This has been the default setting in XEmacs for some time.
779
780 \1f
781 File: xemacs-faq.info,  Node: Q3.5.3,  Next: Q3.5.4,  Prev: Q3.5.2,  Up: Customization
782
783 Q3.5.3: How do I bind C-. and C-; to scroll one line up and down?
784 -----------------------------------------------------------------
785
786    Add the following (Thanks to Richard Mlynarik <mly@adoc.xerox.com>
787 and Wayne Newberry <wayne@zen.cac.stratus.com>) to `.emacs':
788
789      (defun scroll-up-one-line ()
790        (interactive)
791        (scroll-up 1))
792      
793      (defun scroll-down-one-line ()
794        (interactive)
795        (scroll-down 1))
796      
797      (global-set-key [(control ?.)] 'scroll-up-one-line) ; C-.
798      (global-set-key [(control ?                ;)] 'scroll-down-one-line) ; C-;
799
800    The key point is that you can only bind simple functions to keys; you
801 can not bind a key to a function that you're also passing arguments to.
802 (*note Q3.5.1::. for a better answer).
803
804 \1f
805 File: xemacs-faq.info,  Node: Q3.5.4,  Next: Q3.5.5,  Prev: Q3.5.3,  Up: Customization
806
807 Q3.5.4: Globally binding `Delete'?
808 ----------------------------------
809
810    I cannot manage to globally bind my `Delete' key to something other
811 than the default.  How does one do this?
812
813      (defun foo ()
814        (interactive)
815        (message "You hit DELETE"))
816      
817      (global-set-key 'delete 'foo)
818
819    However, some modes explicitly bind `Delete', so you would need to
820 add a hook that does `local-set-key' for them.  If what you want to do
821 is make the Backspace and Delete keys work more PC/Motif-like, then
822 take a look at the `delbs.el' package.
823
824    New in XEmacs 19.14 is a variable called `key-translation-map' which
825 makes it easier to bind `Delete'.  `delbs.el' is a good example of how
826 to do this correctly.
827
828    Also *Note Q3.5.10::.
829
830 \1f
831 File: xemacs-faq.info,  Node: Q3.5.5,  Next: Q3.5.6,  Prev: Q3.5.4,  Up: Customization
832
833 Q3.5.5: Scrolling one line at a time.
834 -------------------------------------
835
836    Can the cursor keys scroll the screen a line at a time, rather than
837 the default half page jump?  I tend it to find it disorienting.
838
839    Try this:
840
841      (defun scroll-one-line-up (&optional arg)
842        "Scroll the selected window up (forward in the text) one line (or N lines)."
843        (interactive "p")
844        (scroll-up (or arg 1)))
845      
846      (defun scroll-one-line-down (&optional arg)
847        "Scroll the selected window down (backward in the text) one line (or N)."
848        (interactive "p")
849        (scroll-down (or arg 1)))
850      
851      (global-set-key [up]   'scroll-one-line-up)
852      (global-set-key [down] 'scroll-one-line-down)
853
854    The following will also work but will affect more than just the
855 cursor keys (i.e. `C-n' and `C-p'):
856
857      (setq scroll-step 1)
858
859    Starting with XEmacs-20.3 you can also change this with Customize.
860 Select from the `Options' menu
861 `Customize->Emacs->Environment->Windows->Scroll Step...' or type `M-x
862 customize <RET> windows <RET>'.
863
864 \1f
865 File: xemacs-faq.info,  Node: Q3.5.6,  Next: Q3.5.7,  Prev: Q3.5.5,  Up: Customization
866
867 Q3.5.6: How to map `Help' key alone on Sun type4 keyboard?
868 ----------------------------------------------------------
869
870    The following works in GNU Emacs 19:
871
872      (global-set-key [help] 'help-command);; Help
873
874    The following works in XEmacs 19.15 with the addition of shift:
875
876      (global-set-key [(shift help)] 'help-command);; Help
877
878    But it doesn't work alone.  This is in the file `PROBLEMS' which
879 should have come with your XEmacs installation: *Emacs ignores the
880 `help' key when running OLWM*.
881
882    OLWM grabs the `help' key, and retransmits it to the appropriate
883 client using `XSendEvent'.  Allowing Emacs to react to synthetic events
884 is a security hole, so this is turned off by default.  You can enable
885 it by setting the variable `x-allow-sendevents' to t.  You can also
886 cause fix this by telling OLWM to not grab the help key, with the null
887 binding `OpenWindows.KeyboardCommand.Help:'.
888
889 \1f
890 File: xemacs-faq.info,  Node: Q3.5.7,  Next: Q3.5.8,  Prev: Q3.5.6,  Up: Customization
891
892 Q3.5.7: How can you type in special characters in XEmacs?
893 ---------------------------------------------------------
894
895    One way is to use the package `x-compose'.  Then you can use
896 sequences like `Compose " a' to get Ã¤, etc.
897
898    Another way is to use the `iso-insert' package, provided in XEmacs
899 19.15 and later. Then you can use sequences like `C-x 8 " a' to get Ã¤,
900 etc.
901
902    Glynn Clements <glynn@sensei.co.uk> writes:
903
904      It depends upon your X server.
905
906      Generally, the simplest way is to define a key as Multi_key with
907      xmodmap, e.g.
908                 xmodmap -e 'keycode 0xff20 = Multi_key'
909
910      You will need to pick an appropriate keycode. Use xev to find out
911      the keycodes for each key.
912
913      [NB: On a `Windows' keyboard, recent versions of XFree86
914      automatically define the right `Windows' key as Multi_key'.]
915
916      Once you have Multi_key defined, you can use e.g.
917                 Multi a '       => Ã¡
918                 Multi e "       => Ã«
919                 Multi c ,       => Ã§
920
921      etc.
922
923      Also, recent versions of XFree86 define various AltGr-<key>
924      combinations as dead keys, i.e.
925                 AltGr [         => dead_diaeresis
926                 AltGr ]         => dead_tilde
927                 AltGr ;         => dead_acute
928      etc.
929
930      Running `xmodmap -pk' will list all of the defined keysyms.
931
932 \1f
933 File: xemacs-faq.info,  Node: Q3.5.8,  Next: Q3.5.9,  Prev: Q3.5.7,  Up: Customization
934
935 Q3.5.8: Why does `(global-set-key [delete-forward] 'delete-char)' complain?
936 ---------------------------------------------------------------------------
937
938    Why does `(define-key global-map [ delete-forward ] 'delete-char)'
939 complain of not being able to bind an unknown key?
940
941    Try this instead:
942
943      (define-key global-map [delete_forward] 'delete-char)
944
945    and it will work.
946
947    What you are seeing above is a bug due to code that is trying to
948 check for GNU Emacs syntax like:
949
950    (define-key global-map [C-M-a] 'delete-char)
951
952    which otherwise would cause no errors but would not result in the
953 expected behavior.
954
955    This bug has been fixed in 19.14.
956
957 \1f
958 File: xemacs-faq.info,  Node: Q3.5.9,  Next: Q3.5.10,  Prev: Q3.5.8,  Up: Customization
959
960 Q3.5.9: How do I make the Delete key delete forward?
961 ----------------------------------------------------
962
963    With XEmacs-20.2 use the `delbs' package:
964
965      (require 'delbs)
966
967    This will give you the functions `delbs-enable-delete-forward' to
968 set things up, and `delbs-disable-delete-forward' to revert to "normal"
969 behavior.  Note that `delbackspace' package is obsolete.
970
971    Starting with XEmacs-20.3 better solution is to set variable
972 `delete-key-deletes-forward' to t.  You can also change this with
973 Customize. Select from the `Options' menu
974 `Customize->Emacs->Editing->Basics->Delete Key Deletes Forward' or type
975 `M-x customize <RET> editing-basics <RET>'.
976
977    Also *Note Q3.5.4::.
978
979 \1f
980 File: xemacs-faq.info,  Node: Q3.5.10,  Next: Q3.5.11,  Prev: Q3.5.9,  Up: Customization
981
982 Q3.5.10: Can I turn on "sticky" modifier keys?
983 ----------------------------------------------
984
985    Yes, with `(setq modifier-keys-are-sticky t)'.  This will give the
986 effect of being able to press and release Shift and have the next
987 character typed come out in upper case.  This will affect all the other
988 modifier keys like Control and Meta as well.
989
990    Ben Wing <ben@666.com> writes:
991
992      One thing about the sticky modifiers is that if you move the mouse
993      out of the frame and back in, it cancels all currently "stuck"
994      modifiers.
995
996 \1f
997 File: xemacs-faq.info,  Node: Q3.5.11,  Next: Q3.6.1,  Prev: Q3.5.10,  Up: Customization
998
999 Q3.5.11: How do I map the arrow keys?
1000 -------------------------------------
1001
1002    Say you want to map `C-<right>' to forward-word:
1003
1004    Sam Steingold <sds@usa.net> writes:
1005
1006           ; both XEmacs and Emacs
1007           (define-key global-map [(control right)] 'forward-word)
1008      or
1009           ; Emacs only
1010           (define-key global-map [C-right] 'forward-word)
1011      or
1012           ; ver > 20, both
1013           (define-key global-map (kbd "C-<right>") 'forward-word)
1014
1015 \1f
1016 File: xemacs-faq.info,  Node: Q3.6.1,  Next: Q3.6.2,  Prev: Q3.5.11,  Up: Customization
1017
1018 3.6: The Cursor
1019 ===============
1020
1021 Q3.6.1: Is there a way to make the bar cursor thicker?
1022 ------------------------------------------------------
1023
1024    I'd like to have the bar cursor a little thicker, as I tend to
1025 "lose" it often.
1026
1027    For a 1 pixel bar cursor, use:
1028
1029      (setq bar-cursor t)
1030
1031    For a 2 pixel bar cursor, use:
1032
1033      (setq bar-cursor 'anything-else)
1034
1035    Starting with XEmacs-20.3 you can also change these with Customize.
1036 Select from the `Options' menu
1037 `Customize->Emacs->Environment->Display->Bar Cursor...' or type `M-x
1038 customize <RET> display <RET>'.
1039
1040    You can use a color to make it stand out better:
1041
1042      Emacs*cursorColor: Red
1043
1044 \1f
1045 File: xemacs-faq.info,  Node: Q3.6.2,  Next: Q3.6.3,  Prev: Q3.6.1,  Up: Customization
1046
1047 Q3.6.2: Is there a way to get back the block cursor?
1048 ----------------------------------------------------
1049
1050      (setq bar-cursor nil)
1051
1052    Starting with XEmacs-20.3 you can also change this with Customize.
1053 Select from the `Options' menu
1054 `Customize->Emacs->Environment->Display->Bar Cursor...' or type `M-x
1055 customize <RET> display <RET>'.
1056
1057 \1f
1058 File: xemacs-faq.info,  Node: Q3.6.3,  Next: Q3.7.1,  Prev: Q3.6.2,  Up: Customization
1059
1060 Q3.6.3: Can I make the cursor blink?
1061 ------------------------------------
1062
1063    If you are running a version of XEmacs older than 19.14, no.
1064 Otherwise you can do the following:
1065
1066      (blink-cursor-mode)
1067
1068    This function toggles between a steady cursor and a blinking cursor.
1069 You may also set this mode from the menu bar by selecting `Options =>
1070 Frame Appearance => Blinking Cursor'.  Remember to save options.
1071
1072 \1f
1073 File: xemacs-faq.info,  Node: Q3.7.1,  Next: Q3.7.2,  Prev: Q3.6.3,  Up: Customization
1074
1075 3.7: The Mouse and Highlighting
1076 ===============================
1077
1078 Q3.7.1: How can I turn off Mouse pasting?
1079 -----------------------------------------
1080
1081    I keep hitting the middle mouse button by accident and getting stuff
1082 pasted into my buffer so how can I turn this off?
1083
1084    Here is an alternative binding, whereby the middle mouse button
1085 selects (but does not cut) the expression under the mouse. Clicking
1086 middle on a left or right paren will select to the matching one.  Note
1087 that you can use `define-key' or `global-set-key'.
1088
1089      (defun mouse-set-point-and-select (event)
1090        "Sets the point at the mouse location, then marks following form"
1091        (interactive "@e")
1092        (mouse-set-point event)
1093        (mark-sexp 1))
1094      (define-key global-map [button2] 'mouse-set-point-and-select)
1095
1096 \1f
1097 File: xemacs-faq.info,  Node: Q3.7.2,  Next: Q3.7.3,  Prev: Q3.7.1,  Up: Customization
1098
1099 Q3.7.2: How do I set control/meta/etc modifiers on mouse buttons?
1100 -----------------------------------------------------------------
1101
1102    Use, for instance, `[(meta button1)]'. For example, here is a common
1103 setting for Common Lisp programmers who use the bundled `ilisp'
1104 package, whereby meta-button1 on a function name will find the file
1105 where the function name was defined, and put you at that location in
1106 the source file.
1107
1108    [Inside a function that gets called by the lisp-mode-hook and
1109 ilisp-mode-hook]
1110
1111      (local-set-key [(meta button1)] 'edit-definitions-lisp)
1112
1113 \1f
1114 File: xemacs-faq.info,  Node: Q3.7.3,  Next: Q3.7.4,  Prev: Q3.7.2,  Up: Customization
1115
1116 Q3.7.3: Clicking the left button does not do anything in buffer list.
1117 ---------------------------------------------------------------------
1118
1119    I do `C-x C-b' to get a list of buffers and the entries get
1120 highlighted when I move the mouse over them but clicking the left mouse
1121 does not do anything.
1122
1123    Use the middle mouse button.
1124
1125 \1f
1126 File: xemacs-faq.info,  Node: Q3.7.4,  Next: Q3.7.5,  Prev: Q3.7.3,  Up: Customization
1127
1128 Q3.7.4: How can I get a list of buffers when I hit mouse button 3?
1129 ------------------------------------------------------------------
1130
1131    The following code will replace the default popup on button3:
1132
1133      (global-set-key [button3] 'popup-buffer-menu)
1134
1135 \1f
1136 File: xemacs-faq.info,  Node: Q3.7.5,  Next: Q3.7.6,  Prev: Q3.7.4,  Up: Customization
1137
1138 Q3.7.5: Why does cut-and-paste not work between XEmacs and a cmdtool?
1139 ---------------------------------------------------------------------
1140
1141    We don't know.  It's a bug.  There does seem to be a work-around,
1142 however.  Try running xclipboard first.  It appears to fix the problem
1143 even if you exit it.  (This should be mostly fixed in 19.13, but we
1144 haven't yet verified that).
1145
1146 \1f
1147 File: xemacs-faq.info,  Node: Q3.7.6,  Next: Q3.7.7,  Prev: Q3.7.5,  Up: Customization
1148
1149 Q3.7.6: How I can set XEmacs up so that it pastes where the text cursor is?
1150 ---------------------------------------------------------------------------
1151
1152    By default XEmacs pastes X selections where the mouse pointer is.
1153 How do I disable this?
1154
1155    Examine the function `mouse-yank', by typing `C-h f mouse-yank
1156 <RET>'.
1157
1158    To get XEmacs to paste at the text cursor, add this your `.emacs':
1159
1160      (setq mouse-yank-at-point t)
1161
1162    Starting with XEmacs-20.2 you can also change this with Customize.
1163 Select from the `Options' menu `Customize->Emacs->Editing->Mouse->Yank
1164 At Point...' or type `M-x customize <RET> mouse <RET>'.
1165
1166 \1f
1167 File: xemacs-faq.info,  Node: Q3.7.7,  Next: Q3.7.8,  Prev: Q3.7.6,  Up: Customization
1168
1169 Q3.7.7: How do I select a rectangular region?
1170 ---------------------------------------------
1171
1172    Just select the region normally, then use the rectangle commands
1173 (e.g.  `kill-rectangle' on it.  The region does not highlight as a
1174 rectangle, but the commands work just fine.
1175
1176    To actually sweep out rectangular regions with the mouse you can use
1177 `mouse-track-do-rectangle' which is assigned to `M-button1'.  Then use
1178 rectangle commands.
1179
1180    You can also do the following to change default behavior to sweep out
1181 rectangular regions:
1182
1183      (setq mouse-track-rectangle-p t)
1184
1185    Starting with XEmacs-20.2 you can also change this with Customize.
1186 Select from the `Options' menu `Customize->Emacs->Editing->Mouse->Track
1187 Rectangle...' or type `M-x customize <RET> mouse <RET>'.
1188
1189       mouse-track-do-rectangle: (event)
1190         -- an interactive compiled Lisp function.
1191       Like `mouse-track' but selects rectangles instead of regions.
1192
1193 \1f
1194 File: xemacs-faq.info,  Node: Q3.7.8,  Next: Q3.8.1,  Prev: Q3.7.7,  Up: Customization
1195
1196 Q3.7.8: Why does `M-w' take so long?
1197 ------------------------------------
1198
1199    It actually doesn't.  It leaves the region visible for a second so
1200 that you can see what area is being yanked.  If you start working,
1201 though, it will immediately complete its operation.  In other words, it
1202 will only delay for a second if you let it.
1203
1204 \1f
1205 File: xemacs-faq.info,  Node: Q3.8.1,  Next: Q3.8.2,  Prev: Q3.7.8,  Up: Customization
1206
1207 3.8: The Menubar and Toolbar
1208 ============================
1209
1210 Q3.8.1: How do I get rid of the menu (or menubar)?
1211 --------------------------------------------------
1212
1213    If you are running XEmacs 19.13 and earlier, add this command to your
1214 `.emacs'.
1215
1216      (set-menubar nil)
1217
1218    Starting with XEmacs 19.14 the preferred method is:
1219
1220      (set-specifier menubar-visible-p nil)
1221
1222 \1f
1223 File: xemacs-faq.info,  Node: Q3.8.2,  Next: Q3.8.3,  Prev: Q3.8.1,  Up: Customization
1224
1225 Q3.8.2: Can I customize the basic menubar?
1226 ------------------------------------------
1227
1228    For an extensive menubar, add this line to your `.emacs':
1229
1230      (load "big-menubar")
1231
1232    If you'd like to write your own, this file provides as good a set of
1233 examples as any to start from.  The file is located in
1234 `lisp/packages/big-menubar.el' in the XEmacs installation directory.
1235
1236 \1f
1237 File: xemacs-faq.info,  Node: Q3.8.3,  Next: Q3.8.4,  Prev: Q3.8.2,  Up: Customization
1238
1239 Q3.8.3: How do I control how many buffers are listed in the menu `Buffers List'?
1240 --------------------------------------------------------------------------------
1241
1242    Add the following to your `.emacs' (suit to fit):
1243
1244      (setq buffers-menu-max-size 20)
1245
1246    For no limit, use an argument of `nil'.
1247
1248    Starting with XEmacs-20.3 you can also change this with Customize.
1249 Select from the `Options' menu
1250 `Customize->Emacs->Environment->Menu->Buffers Menu->Max Size...' or
1251 type `M-x customize <RET> buffers-menu <RET>'.
1252
1253 \1f
1254 File: xemacs-faq.info,  Node: Q3.8.4,  Next: Q3.8.5,  Prev: Q3.8.3,  Up: Customization
1255
1256 Q3.8.4: Resources like `Emacs*menubar*font' are not working?
1257 ------------------------------------------------------------
1258
1259    I am trying to use a resource like `Emacs*menubar*font' to set the
1260 font of the menubar but it's not working.
1261
1262    If you are using the real Motif menubar, this resource is not
1263 recognized; you have to say:
1264
1265      Emacs*menubar*fontList: FONT
1266
1267    If you are using the Lucid menubar, the former resource will be
1268 recognized only if the latter resource is unset.  This means that the
1269 resource
1270
1271      *fontList: FONT
1272
1273    will override
1274
1275      Emacs*menubar*font: FONT
1276
1277    even though the latter is more specific.
1278
1279 \1f
1280 File: xemacs-faq.info,  Node: Q3.8.5,  Next: Q3.9.1,  Prev: Q3.8.4,  Up: Customization
1281
1282 Q3.8.5: How can I bind a key to a function to toggle the toolbar?
1283 -----------------------------------------------------------------
1284
1285    Try something like:
1286
1287      (defun my-toggle-toolbar ()
1288        (interactive)
1289        (set-specifier default-toolbar-visible-p
1290                       (not (specifier-instance default-toolbar-visible-p))))
1291      (global-set-key "\C-xT" 'my-toggle-toolbar)
1292
1293    There are redisplay bugs in 19.14 that may make the preceding result
1294 in a messed-up display, especially for frames with multiple windows.
1295 You may need to resize the frame before XEmacs completely realizes the
1296 toolbar is really gone.
1297
1298    Thanks to Martin Buchholz <martin@xemacs.org> for the correct code.
1299
1300 \1f
1301 File: xemacs-faq.info,  Node: Q3.9.1,  Next: Q3.9.2,  Prev: Q3.8.5,  Up: Customization
1302
1303 3.9: Scrollbars
1304 ===============
1305
1306 Q3.9.1: How can I disable the scrollbar?
1307 ----------------------------------------
1308
1309    To disable them for all frames, add the following line to your
1310 `.Xdefaults':
1311
1312      Emacs.scrollBarWidth:  0
1313
1314    Or select from the `Options' menu `Frame Appearance->Scrollbars'.
1315 Remember to save options.
1316
1317    To turn the scrollbar off on a per-frame basis, use the following
1318 function:
1319
1320      (set-specifier scrollbar-width 0 (selected-frame))
1321
1322    You can actually turn the scrollbars on at any level you want by
1323 substituting for (selected-frame) in the above command.  For example, to
1324 turn the scrollbars off only in a single buffer:
1325
1326      (set-specifier scrollbar-width 0 (current-buffer))
1327
1328    In XEmacs versions prior to 19.14, you had to use the hairier
1329 construct:
1330
1331      (set-specifier scrollbar-width (cons (selected-frame) 0))
1332
1333 \1f
1334 File: xemacs-faq.info,  Node: Q3.9.2,  Next: Q3.9.3,  Prev: Q3.9.1,  Up: Customization
1335
1336 Q3.9.2: How can one use resources to change scrollbar colors?
1337 -------------------------------------------------------------
1338
1339    Here's a recap of how to use resources to change your scrollbar
1340 colors:
1341
1342      ! Motif scrollbars
1343      
1344      Emacs*XmScrollBar.Background: skyblue
1345      Emacs*XmScrollBar.troughColor: lightgray
1346      
1347      ! Athena scrollbars
1348      
1349      Emacs*Scrollbar.Foreground: skyblue
1350      Emacs*Scrollbar.Background: lightgray
1351
1352    Note the capitalization of `Scrollbar' for the Athena widget.
1353
1354 \1f
1355 File: xemacs-faq.info,  Node: Q3.9.3,  Next: Q3.9.4,  Prev: Q3.9.2,  Up: Customization
1356
1357 Q3.9.3: Moving the scrollbar can move the point; can I disable this?
1358 --------------------------------------------------------------------
1359
1360    When I move the scrollbar in an XEmacs window, it moves the point as
1361 well, which should not be the default behavior.  Is this a bug or a
1362 feature?  Can I disable it?
1363
1364    The current behavior is a feature, not a bug.  Point remains at the
1365 same buffer position as long as that position does not scroll off the
1366 screen.  In that event, point will end up in either the upper-left or
1367 lower-left hand corner.
1368
1369    This cannot be changed.
1370
1371 \1f
1372 File: xemacs-faq.info,  Node: Q3.9.4,  Next: Q3.10.1,  Prev: Q3.9.3,  Up: Customization
1373
1374 Q3.9.4: How can I get automatic horizontal scrolling?
1375 -----------------------------------------------------
1376
1377    By the same token, how can I turn it off in specific modes?
1378
1379    To do this, add to your `.emacs' file:
1380
1381      (require 'auto-show)
1382
1383    Then do `(setq truncate-lines t)' in the mode-hooks for any modes in
1384 which you want lines truncated.
1385
1386    More precisely: If `truncate-lines' is nil, horizontal scrollbars
1387 will never appear.  Otherwise, they will appear only if the value of
1388 `scrollbar-height' for that buffer/window/etc. is non-zero.  If you do
1389
1390      (set-specifier scrollbar-height 0)
1391
1392    then horizontal scrollbars will not appear in truncated buffers
1393 unless the package specifically asked for them.
1394
1395    Automatic horizontal scrolling is now standard, starting with 19.14.
1396