1 This is ../info/xemacs-faq.info, produced by makeinfo version 4.0 from
4 INFO-DIR-SECTION XEmacs Editor
6 * FAQ: (xemacs-faq). XEmacs FAQ.
10 File: xemacs-faq.info, Node: Q3.0.5, Next: Q3.0.6, Prev: Q3.0.4, Up: Customization
12 Q3.0.5: How to check if a lisp function is defined?
13 ---------------------------------------------------
15 Use the following elisp:
19 It's almost always a mistake to test `emacs-version' or any similar
22 Instead, use feature-tests, such as `featurep', `boundp', `fboundp',
23 or even simple behavioral tests, eg.:
25 (defvar foo-old-losing-code-p
26 (condition-case nil (progn (losing-code t) nil)
27 (wrong-number-of-arguments t)))
29 There is an incredible amount of broken code out there which could
30 work much better more often in more places if it did the above instead
31 of trying to divine its environment from the value of one variable.
34 File: xemacs-faq.info, Node: Q3.0.6, Next: Q3.0.7, Prev: Q3.0.5, Up: Customization
36 Q3.0.6: Can I force the output of `(face-list)' to a buffer?
37 ------------------------------------------------------------
39 It would be good having it in a buffer, as the output of
40 `(face-list)' is too wide to fit to a minibuffer.
42 Evaluate the expression in the `*scratch*' buffer with point after
43 the rightmost paren and typing `C-j'.
45 If the minibuffer smallness is the only problem you encounter, you
46 can simply press `C-h l' to get the former minibuffer contents in a
50 File: xemacs-faq.info, Node: Q3.0.7, Next: Q3.0.8, Prev: Q3.0.6, Up: Customization
52 Q3.0.7: Font selections in don't get saved after `Save Options'.
53 ----------------------------------------------------------------
55 For XEmacs 19.14 and previous:
57 John Mann <mannj@ll.mit.edu> writes:
59 You have to go to Options->Frame Appearance and unselect
60 `Frame-Local Font Menu'. If this option is selected, font changes
61 are only applied to the _current_ frame and do _not_ get saved
62 when you save options.
64 For XEmacs 19.15 and later:
66 Implement the above as well as set the following in your `.emacs'
68 (setq options-save-faces t)
71 File: xemacs-faq.info, Node: Q3.0.8, Next: Q3.0.9, Prev: Q3.0.7, Up: Customization
73 Q3.0.8: How do I get a single minibuffer frame?
74 -----------------------------------------------
76 Vin Shelton <acs@acm.org> writes:
78 (setq initial-frame-plist '(minibuffer nil))
79 (setq default-frame-plist '(minibuffer nil))
80 (setq default-minibuffer-frame
86 default-toolbar-visible-p nil
91 (frame-notice-user-settings)
93 *Please note:* The single minibuffer frame may not be to everyone's
94 taste, and there any number of other XEmacs options settings that may
95 make it difficult or inconvenient to use.
98 File: xemacs-faq.info, Node: Q3.0.9, Next: Q3.1.1, Prev: Q3.0.8, Up: Customization
100 Q3.0.9: What is `Customize'?
101 ----------------------------
103 Starting with XEmacs 20.2 there is new system 'Customize' for
104 customizing XEmacs options.
106 You can access `Customize' from the `Options' menu or invoking one
107 of customize commands by typing eg. `M-x customize', `M-x
108 customize-face', `M-x customize-variable' or `M-x customize-apropos'.
110 Starting with XEmacs 20.3 there is also new `browser' mode for
111 Customize. Try it out with `M-x customize-browse'
114 File: xemacs-faq.info, Node: Q3.1.1, Next: Q3.1.2, Prev: Q3.0.9, Up: Customization
116 3.1: X Window System & Resources
117 ================================
119 Q3.1.1: Where is a list of X resources?
120 ---------------------------------------
122 Search through the `NEWS' file for `X Resources'. A fairly
123 comprehensive list is given after it.
125 In addition, an `app-defaults' file is supplied, `etc/Emacs.ad'
126 listing the defaults. The file `etc/sample.Xdefaults' gives a set of
127 defaults that you might consider. It is essentially the same as
128 `etc/Emacs.ad' but some entries are slightly altered. Be careful about
129 installing the contents of this file into your `.Xdefaults' or
130 `.Xresources' file if you use GNU Emacs under X11 as well.
133 File: xemacs-faq.info, Node: Q3.1.2, Next: Q3.1.3, Prev: Q3.1.1, Up: Customization
135 Q3.1.2: How can I detect a color display?
136 -----------------------------------------
138 You can test the return value of the function `(device-class)', as
141 (when (eq (device-class) 'color)
142 (set-face-foreground 'font-lock-comment-face "Grey")
143 (set-face-foreground 'font-lock-string-face "Red")
148 File: xemacs-faq.info, Node: Q3.1.3, Next: Q3.1.4, Prev: Q3.1.2, Up: Customization
150 Q3.1.3: [This question intentionally left blank]
151 ------------------------------------------------
154 File: xemacs-faq.info, Node: Q3.1.4, Next: Q3.1.5, Prev: Q3.1.3, Up: Customization
156 Q3.1.4: [This question intentionally left blank]
157 ------------------------------------------------
160 File: xemacs-faq.info, Node: Q3.1.5, Next: Q3.1.6, Prev: Q3.1.4, Up: Customization
162 Q3.1.5: How can I get the icon to just say `XEmacs'?
163 ----------------------------------------------------
165 I'd like the icon to just say `XEmacs', and not include the name of
166 the current file in it.
168 Add the following line to your `.emacs':
170 (setq frame-icon-title-format "XEmacs")
173 File: xemacs-faq.info, Node: Q3.1.6, Next: Q3.1.7, Prev: Q3.1.5, Up: Customization
175 Q3.1.6: How can I have the window title area display the full path?
176 -------------------------------------------------------------------
178 I'd like to have the window title area display the full
179 directory/name of the current buffer file and not just the name.
181 Add the following line to your `.emacs':
183 (setq frame-title-format "%S: %f")
185 A more sophisticated title might be:
187 (setq frame-title-format
188 '("%S: " (buffer-file-name "%f"
189 (dired-directory dired-directory "%b"))))
191 That is, use the file name, or the dired-directory, or the buffer
195 File: xemacs-faq.info, Node: Q3.1.7, Next: Q3.1.8, Prev: Q3.1.6, Up: Customization
197 Q3.1.7: `xemacs -name junk' doesn't work?
198 -----------------------------------------
200 When I run `xterm -name junk', I get an xterm whose class name
201 according to xprop, is `junk'. This is the way it's supposed to work,
202 I think. When I run `xemacs -name junk' the class name is not set to
203 `junk'. It's still `emacs'. What does `xemacs -name' really do? The
204 reason I ask is that my window manager (fvwm) will make a window sticky
205 and I use XEmacs to read my mail. I want that XEmacs window to be
206 sticky, without having to use the window manager's function to set the
207 window sticky. What gives?
209 `xemacs -name' sets the application name for the program (that is,
210 the thing which normally comes from `argv[0]'). Using `-name' is the
211 same as making a copy of the executable with that new name. The
212 `WM_CLASS' property on each frame is set to the frame-name, and the
213 application-class. So, if you did `xemacs -name FOO' and then created
214 a frame named BAR, you'd get an X window with WM_CLASS = `( "BAR",
215 "Emacs")'. However, the resource hierarchy for this widget would be:
217 Name: FOO .shell .container .BAR
218 Class: Emacs .TopLevelEmacsShell.EmacsManager.EmacsFrame
220 instead of the default
222 Name: xemacs.shell .container .emacs
223 Class: Emacs .TopLevelEmacsShell.EmacsManager.EmacsFrame
225 It is arguable that the first element of WM_CLASS should be set to
226 the application-name instead of the frame-name, but I think that's less
227 flexible, since it does not give you the ability to have multiple frames
228 with different WM_CLASS properties. Another possibility would be for
229 the default frame name to come from the application name instead of
230 simply being `emacs'. However, at this point, making that change would
231 be troublesome: it would mean that many users would have to make yet
232 another change to their resource files (since the default frame name
233 would suddenly change from `emacs' to `xemacs', or whatever the
234 executable happened to be named), so we'd rather avoid it.
236 To make a frame with a particular name use:
238 (make-frame '((name . "the-name")))
241 File: xemacs-faq.info, Node: Q3.1.8, Next: Q3.2.1, Prev: Q3.1.7, Up: Customization
243 Q3.1.8: `-iconic' doesn't work.
244 -------------------------------
246 When I start up XEmacs using `-iconic' it doesn't work right. Using
247 `-unmapped' on the command line, and setting the `initiallyUnmapped' X
248 Resource don't seem to help much either...
250 Ben Wing <ben@xemacs.org> writes:
252 Ugh, this stuff is such an incredible mess that I've about given up
253 getting it to work. The principal problem is numerous
254 window-manager bugs...
257 File: xemacs-faq.info, Node: Q3.2.1, Next: Q3.2.2, Prev: Q3.1.8, Up: Customization
259 3.2: Textual Fonts & Colors
260 ===========================
262 Q3.2.1: How can I set color options from `.emacs'?
263 --------------------------------------------------
265 How can I set the most commonly used color options from my `.emacs'
266 instead of from my `.Xdefaults'?
270 (set-face-background 'default "bisque") ; frame background
271 (set-face-foreground 'default "black") ; normal text
272 (set-face-background 'zmacs-region "red") ; When selecting w/
274 (set-face-foreground 'zmacs-region "yellow")
275 (set-face-font 'default "*courier-bold-r*120-100-100*")
276 (set-face-background 'highlight "blue") ; Ie when selecting
278 (set-face-foreground 'highlight "yellow")
279 (set-face-background 'modeline "blue") ; Line at bottom
281 (set-face-foreground 'modeline "white")
282 (set-face-font 'modeline "*bold-r-normal*140-100-100*")
283 (set-face-background 'isearch "yellow") ; When highlighting
285 (set-face-foreground 'isearch "red")
286 (setq x-pointer-foreground-color "black") ; Adds to bg color,
288 (setq x-pointer-background-color "blue") ; This is color
293 File: xemacs-faq.info, Node: Q3.2.2, Next: Q3.2.3, Prev: Q3.2.1, Up: Customization
295 Q3.2.2: How do I set the text, menu and modeline fonts?
296 -------------------------------------------------------
298 Note that you should use `Emacs.' and not `Emacs*' when setting face
303 Emacs.default.attributeFont: -*-*-medium-r-*-*-*-120-*-*-m-*-*-*
304 Emacs*menubar*font: fixed
305 Emacs.modeline.attributeFont: fixed
307 This is confusing because modeline is a face, and can be found listed
308 with all faces in the current mode by using `M-x set-face-font (enter)
309 ?'. It uses the face specification of `attributeFont', while menubar
310 is a normal X thing that uses the specification `font'. With Motif it
311 may be necessary to use `fontList' instead of `font'.
314 File: xemacs-faq.info, Node: Q3.2.3, Next: Q3.2.4, Prev: Q3.2.2, Up: Customization
316 Q3.2.3: How can I set the colors when highlighting a region?
317 ------------------------------------------------------------
319 How can I set the background/foreground colors when highlighting a
322 You can change the face `zmacs-region' either in your `.Xdefaults':
324 Emacs.zmacs-region.attributeForeground: firebrick
325 Emacs.zmacs-region.attributeBackground: lightseagreen
329 (set-face-background 'zmacs-region "red")
330 (set-face-foreground 'zmacs-region "yellow")
333 File: xemacs-faq.info, Node: Q3.2.4, Next: Q3.2.5, Prev: Q3.2.3, Up: Customization
335 Q3.2.4: How can I limit color map usage?
336 ----------------------------------------
338 I'm using Netscape (or another color grabber like XEmacs); is there
339 anyway to limit the number of available colors in the color map?
341 XEmacs 19.13 didn't have such a mechanism (unlike netscape, or other
342 color-hogs). One solution is to start XEmacs prior to netscape, since
343 this will prevent Netscape from grabbing all colors (but Netscape will
344 complain). You can use the flags for Netscape, like -mono, -ncols <#>
345 or -install (for mono, limiting to <#> colors, or for using a private
346 color map). Since Netscape will take the entire colormap and never
347 release it, the only reasonable way to run it is with `-install'.
349 If you have the money, another solution would be to use a truecolor
350 or direct color video.
352 Starting with XEmacs 19.14, XEmacs uses the closest available color
353 if the colormap is full, so it's O.K. now to start Netscape first.
356 File: xemacs-faq.info, Node: Q3.2.5, Next: Q3.2.6, Prev: Q3.2.4, Up: Customization
358 Q3.2.5: My tty supports color, but XEmacs doesn't use them.
359 -----------------------------------------------------------
361 XEmacs tries to automatically determine whether your tty supports
362 color, but sometimes guesses wrong. In that case, you can make XEmacs
363 Do The Right Thing using this Lisp code:
365 (if (eq 'tty (device-type))
366 (set-device-class nil 'color))
369 File: xemacs-faq.info, Node: Q3.2.6, Next: Q3.3.1, Prev: Q3.2.5, Up: Customization
371 Q3.2.6: Can I have pixmap backgrounds in XEmacs?
372 ------------------------------------------------
374 Juan Villacis <jvillaci@wahnsinnig.extreme.indiana.edu> writes:
376 There are several ways to do it. For example, you could specify a
377 default pixmap image to use in your `~/.Xresources', e.g.,
379 Emacs*EmacsFrame.default.attributeBackgroundPixmap: /path/to/image.xpm
381 and then reload ~/.Xresources and restart XEmacs. Alternatively,
382 since each face can have its own pixmap background, a better way
383 would be to set a face's pixmap within your XEmacs init file, e.g.,
385 (set-face-background-pixmap 'default "/path/to/image.xpm")
386 (set-face-background-pixmap 'bold "/path/to/another_image.xpm")
388 and so on. You can also do this interactively via `M-x
396 File: xemacs-faq.info, Node: Q3.3.1, Next: Q3.3.2, Prev: Q3.2.6, Up: Customization
398 Q3.3.1: How can I make the modeline go away?
399 --------------------------------------------
401 (set-specifier has-modeline-p nil)
403 Starting with XEmacs 19.14 the modeline responds to mouse clicks, so
404 if you haven't liked or used the modeline in the past, you might want to
405 try the new version out.
408 File: xemacs-faq.info, Node: Q3.3.2, Next: Q3.3.3, Prev: Q3.3.1, Up: Customization
410 Q3.3.2: How do you have XEmacs display the line number in the modeline?
411 -----------------------------------------------------------------------
413 Add the following line to your `.emacs' file to display the line
418 Use the following to display the column number:
420 (column-number-mode 1)
422 Or select from the `Options' menu
423 `Customize->Emacs->Editing->Basics->Line Number Mode' and/or
424 `Customize->Emacs->Editing->Basics->Column Number Mode'
426 Or type `M-x customize <RET> editing-basics <RET>'.
429 File: xemacs-faq.info, Node: Q3.3.3, Next: Q3.3.4, Prev: Q3.3.2, Up: Customization
431 Q3.3.3: How do I get XEmacs to put the time of day on the modeline?
432 -------------------------------------------------------------------
434 Add the following line to your `.emacs' file to display the time:
438 See `Customize' from the `Options' menu for customization.
441 File: xemacs-faq.info, Node: Q3.3.4, Next: Q3.3.5, Prev: Q3.3.3, Up: Customization
443 Q3.3.4: How do I turn off current chapter from AUC TeX modeline?
444 ----------------------------------------------------------------
446 With AUC TeX, fast typing is hard because the current chapter,
447 section etc. are given in the modeline. How can I turn this off?
449 It's not AUC TeX, it comes from `func-menu' in `func-menu.el'. Add
450 this code to your `.emacs' to turn it off:
452 (setq fume-display-in-modeline-p nil)
454 Or just add a hook to `TeX-mode-hook' to turn it off only for TeX
457 (add-hook 'TeX-mode-hook
458 '(lambda () (setq fume-display-in-modeline-p nil)))
460 David Hughes <dhughes@origin-at.co.uk> writes:
462 If you have 19.14 or later, try this instead; you'll still get the
463 function name displayed in the modeline, but it won't attempt to
464 keep track when you modify the file. To refresh when it gets out
465 of synch, you simply need click on the `Rescan Buffer' option in
468 (setq-default fume-auto-rescan-buffer-p nil)
471 File: xemacs-faq.info, Node: Q3.3.5, Next: Q3.4.1, Prev: Q3.3.4, Up: Customization
473 Q3.3.5: How can one change the modeline color based on the mode used?
474 ---------------------------------------------------------------------
476 You can use something like the following:
478 (add-hook 'lisp-mode-hook
480 (set-face-background 'modeline "red" (current-buffer))))
482 Then, when editing a Lisp file (i.e. when in Lisp mode), the modeline
483 colors change from the default set in your `.emacs'. The change will
484 only be made in the buffer you just entered (which contains the Lisp
485 file you are editing) and will not affect the modeline colors anywhere
490 * The hook is the mode name plus `-hook'. eg. c-mode-hook,
491 c++-mode-hook, emacs-lisp-mode-hook (used for your `.emacs' or a
492 `xx.el' file), lisp-interaction-mode-hook (the `*scratch*'
493 buffer), text-mode-hook, etc.
495 * Be sure to use `add-hook', not `(setq c-mode-hook xxxx)',
496 otherwise you will erase anything that anybody has already put on
499 * You can also do `(set-face-font 'modeline FONT)', eg.
500 `(set-face-font 'modeline "*bold-r-normal*140-100-100*"
501 (current-buffer))' if you wish the modeline font to vary based on
504 This works in 19.15 as well, but there are additional modeline faces,
505 `modeline-buffer-id', `modeline-mousable', and
506 `modeline-mousable-minor-mode', which you may want to customize.
509 File: xemacs-faq.info, Node: Q3.4.1, Next: Q3.4.2, Prev: Q3.3.5, Up: Customization
511 3.4: Multiple Device Support
512 ============================
514 Q3.4.1: How do I open a frame on another screen of my multi-headed display?
515 ---------------------------------------------------------------------------
517 The support for this was revamped for 19.14. Use the command `M-x
518 make-frame-on-display'. This command is also on the File menu in the
521 XEmacs 19.14 and later also have the command `make-frame-on-tty'
522 which will establish a connection to any tty-like device. Opening the
523 TTY devices should be left to `gnuclient', though.
526 File: xemacs-faq.info, Node: Q3.4.2, Next: Q3.5.1, Prev: Q3.4.1, Up: Customization
528 Q3.4.2: Can I really connect to a running XEmacs after calling up over a modem? How?
529 -------------------------------------------------------------------------------------
531 If you're not running at least XEmacs 19.14, you can't. Otherwise
532 check out the `gnuattach' program supplied with XEmacs. Starting with
533 XEmacs 20.3, `gnuattach' and `gnudoit' functionality is provided by
536 Also *Note Q5.0.12::.
539 File: xemacs-faq.info, Node: Q3.5.1, Next: Q3.5.2, Prev: Q3.4.2, Up: Customization
544 Q3.5.1: How can I bind complex functions (or macros) to keys?
545 -------------------------------------------------------------
547 As an example, say you want the `paste' key on a Sun keyboard to
548 insert the current Primary X selection at point. You can accomplish this
551 (define-key global-map [f18] 'x-insert-selection)
553 However, this only works if there is a current X selection (the
554 selection will be highlighted). The functionality I like is for the
555 `paste' key to insert the current X selection if there is one,
556 otherwise insert the contents of the clipboard. To do this you need to
557 pass arguments to `x-insert-selection'. This is done by wrapping the
558 call in a 'lambda form:
560 (global-set-key [f18]
561 (lambda () (interactive) (x-insert-selection t nil)))
563 This binds the f18 key to a "generic" functional object. The
564 interactive spec is required because only interactive functions can be
567 For the FAQ example you could use:
569 (global-set-key [(control ?.)]
570 (lambda () (interactive) (scroll-up 1)))
571 (global-set-key [(control ? ;)]
572 (lambda () (interactive) (scroll-up -1)))
574 This is fine if you only need a few functions within the lambda body.
575 If you're doing more it's cleaner to define a separate function as in
576 question 3.5.3 (*note Q3.5.3::).
579 File: xemacs-faq.info, Node: Q3.5.2, Next: Q3.5.3, Prev: Q3.5.1, Up: Customization
581 Q3.5.2: How can I stop down-arrow from adding empty lines to the bottom of my buffers?
582 --------------------------------------------------------------------------------------
584 Add the following line to your `.emacs' file:
586 (setq next-line-add-newlines nil)
588 This has been the default setting in XEmacs for some time.
591 File: xemacs-faq.info, Node: Q3.5.3, Next: Q3.5.4, Prev: Q3.5.2, Up: Customization
593 Q3.5.3: How do I bind C-. and C-; to scroll one line up and down?
594 -----------------------------------------------------------------
596 Add the following (Thanks to Richard Mlynarik <mly@adoc.xerox.com>
597 and Wayne Newberry <wayne@zen.cac.stratus.com>) to `.emacs':
599 (defun scroll-up-one-line ()
603 (defun scroll-down-one-line ()
607 (global-set-key [(control ?.)] 'scroll-up-one-line) ; C-.
608 (global-set-key [(control ? ;)] 'scroll-down-one-line) ; C-;
610 The key point is that you can only bind simple functions to keys; you
611 can not bind a key to a function that you're also passing arguments to.
612 (*note Q3.5.1:: for a better answer).
615 File: xemacs-faq.info, Node: Q3.5.4, Next: Q3.5.5, Prev: Q3.5.3, Up: Customization
617 Q3.5.4: Globally binding `Delete'?
618 ----------------------------------
620 I cannot manage to globally bind my `Delete' key to something other
621 than the default. How does one do this?
625 (message "You hit DELETE"))
627 (global-set-key 'delete 'foo)
629 However, some modes explicitly bind `Delete', so you would need to
630 add a hook that does `local-set-key' for them. If what you want to do
631 is make the Backspace and Delete keys work more PC/Motif-like, then
632 take a look at the `delbs.el' package.
634 New in XEmacs 19.14 is a variable called `key-translation-map' which
635 makes it easier to bind `Delete'. `delbs.el' is a good example of how
636 to do this correctly.
638 Also *Note Q3.5.10::.
641 File: xemacs-faq.info, Node: Q3.5.5, Next: Q3.5.6, Prev: Q3.5.4, Up: Customization
643 Q3.5.5: Scrolling one line at a time.
644 -------------------------------------
646 Can the cursor keys scroll the screen a line at a time, rather than
647 the default half page jump? I tend it to find it disorienting.
651 (defun scroll-one-line-up (&optional arg)
652 "Scroll the selected window up (forward in the text) one line (or N lines)."
654 (scroll-up (or arg 1)))
656 (defun scroll-one-line-down (&optional arg)
657 "Scroll the selected window down (backward in the text) one line (or N)."
659 (scroll-down (or arg 1)))
661 (global-set-key [up] 'scroll-one-line-up)
662 (global-set-key [down] 'scroll-one-line-down)
664 The following will also work but will affect more than just the
665 cursor keys (i.e. `C-n' and `C-p'):
669 Starting with XEmacs-20.3 you can also change this with Customize.
670 Select from the `Options' menu
671 `Customize->Emacs->Environment->Windows->Scroll Step...' or type `M-x
672 customize <RET> windows <RET>'.
675 File: xemacs-faq.info, Node: Q3.5.6, Next: Q3.5.7, Prev: Q3.5.5, Up: Customization
677 Q3.5.6: How to map `Help' key alone on Sun type4 keyboard?
678 ----------------------------------------------------------
680 The following works in GNU Emacs 19:
682 (global-set-key [help] 'help-command);; Help
684 The following works in XEmacs 19.15 with the addition of shift:
686 (global-set-key [(shift help)] 'help-command);; Help
688 But it doesn't work alone. This is in the file `PROBLEMS' which
689 should have come with your XEmacs installation: _Emacs ignores the
690 `help' key when running OLWM_.
692 OLWM grabs the `help' key, and retransmits it to the appropriate
693 client using `XSendEvent'. Allowing Emacs to react to synthetic events
694 is a security hole, so this is turned off by default. You can enable
695 it by setting the variable `x-allow-sendevents' to t. You can also
696 cause fix this by telling OLWM to not grab the help key, with the null
697 binding `OpenWindows.KeyboardCommand.Help:'.
700 File: xemacs-faq.info, Node: Q3.5.7, Next: Q3.5.8, Prev: Q3.5.6, Up: Customization
702 Q3.5.7: How can you type in special characters in XEmacs?
703 ---------------------------------------------------------
705 One way is to use the package `x-compose'. Then you can use
706 sequences like `Compose " a' to get ä, etc.
708 Another way is to use the `iso-insert' package, provided in XEmacs
709 19.15 and later. Then you can use sequences like `C-x 8 " a' to get ä,
712 Glynn Clements <glynn@sensei.co.uk> writes:
714 It depends upon your X server.
716 Generally, the simplest way is to define a key as Multi_key with
718 xmodmap -e 'keycode 0xff20 = Multi_key'
720 You will need to pick an appropriate keycode. Use xev to find out
721 the keycodes for each key.
723 [NB: On a `Windows' keyboard, recent versions of XFree86
724 automatically define the right `Windows' key as Multi_key'.]
726 Once you have Multi_key defined, you can use e.g.
733 Also, recent versions of XFree86 define various AltGr-<key>
734 combinations as dead keys, i.e.
735 AltGr [ => dead_diaeresis
736 AltGr ] => dead_tilde
737 AltGr ; => dead_acute
740 Running `xmodmap -pk' will list all of the defined keysyms.
743 File: xemacs-faq.info, Node: Q3.5.8, Next: Q3.5.9, Prev: Q3.5.7, Up: Customization
745 Q3.5.8: Why does `(global-set-key [delete-forward] 'delete-char)' complain?
746 ---------------------------------------------------------------------------
748 Why does `(define-key global-map [ delete-forward ] 'delete-char)'
749 complain of not being able to bind an unknown key?
753 (define-key global-map [delete_forward] 'delete-char)
757 What you are seeing above is a bug due to code that is trying to
758 check for GNU Emacs syntax like:
760 (define-key global-map [C-M-a] 'delete-char)
762 which otherwise would cause no errors but would not result in the
765 This bug has been fixed in 19.14.
768 File: xemacs-faq.info, Node: Q3.5.9, Next: Q3.5.10, Prev: Q3.5.8, Up: Customization
770 Q3.5.9: How do I make the Delete key delete forward?
771 ----------------------------------------------------
773 With XEmacs-20.2 use the `delbs' package:
777 This will give you the functions `delbs-enable-delete-forward' to
778 set things up, and `delbs-disable-delete-forward' to revert to "normal"
779 behavior. Note that `delbackspace' package is obsolete.
781 Starting with XEmacs-20.3 better solution is to set variable
782 `delete-key-deletes-forward' to t. You can also change this with
783 Customize. Select from the `Options' menu
784 `Customize->Emacs->Editing->Basics->Delete Key Deletes Forward' or type
785 `M-x customize <RET> editing-basics <RET>'.
790 File: xemacs-faq.info, Node: Q3.5.10, Next: Q3.5.11, Prev: Q3.5.9, Up: Customization
792 Q3.5.10: Can I turn on "sticky" modifier keys?
793 ----------------------------------------------
795 Yes, with `(setq modifier-keys-are-sticky t)'. This will give the
796 effect of being able to press and release Shift and have the next
797 character typed come out in upper case. This will affect all the other
798 modifier keys like Control and Meta as well.
800 Ben Wing <ben@xemacs.org> writes:
802 One thing about the sticky modifiers is that if you move the mouse
803 out of the frame and back in, it cancels all currently "stuck"
807 File: xemacs-faq.info, Node: Q3.5.11, Next: Q3.6.1, Prev: Q3.5.10, Up: Customization
809 Q3.5.11: How do I map the arrow keys?
810 -------------------------------------
812 Say you want to map `C-<right>' to forward-word:
814 Sam Steingold <sds@usa.net> writes:
816 ; both XEmacs and Emacs
817 (define-key global-map [(control right)] 'forward-word)
820 (define-key global-map [C-right] 'forward-word)
823 (define-key global-map (kbd "C-<right>") 'forward-word)
826 File: xemacs-faq.info, Node: Q3.6.1, Next: Q3.6.2, Prev: Q3.5.11, Up: Customization
831 Q3.6.1: Is there a way to make the bar cursor thicker?
832 ------------------------------------------------------
834 I'd like to have the bar cursor a little thicker, as I tend to
837 For a 1 pixel bar cursor, use:
841 For a 2 pixel bar cursor, use:
843 (setq bar-cursor 'anything-else)
845 Starting with XEmacs-20.3 you can also change these with Customize.
846 Select from the `Options' menu
847 `Customize->Emacs->Environment->Display->Bar Cursor...' or type `M-x
848 customize <RET> display <RET>'.
850 You can use a color to make it stand out better:
852 Emacs*cursorColor: Red
855 File: xemacs-faq.info, Node: Q3.6.2, Next: Q3.6.3, Prev: Q3.6.1, Up: Customization
857 Q3.6.2: Is there a way to get back the block cursor?
858 ----------------------------------------------------
860 (setq bar-cursor nil)
862 Starting with XEmacs-20.3 you can also change this with Customize.
863 Select from the `Options' menu
864 `Customize->Emacs->Environment->Display->Bar Cursor...' or type `M-x
865 customize <RET> display <RET>'.
868 File: xemacs-faq.info, Node: Q3.6.3, Next: Q3.7.1, Prev: Q3.6.2, Up: Customization
870 Q3.6.3: Can I make the cursor blink?
871 ------------------------------------
873 If you are running a version of XEmacs older than 19.14, no.
874 Otherwise you can do the following:
878 This function toggles between a steady cursor and a blinking cursor.
879 You may also set this mode from the menu bar by selecting `Options =>
880 Frame Appearance => Blinking Cursor'. Remember to save options.
883 File: xemacs-faq.info, Node: Q3.7.1, Next: Q3.7.2, Prev: Q3.6.3, Up: Customization
885 3.7: The Mouse and Highlighting
886 ===============================
888 Q3.7.1: How can I turn off Mouse pasting?
889 -----------------------------------------
891 I keep hitting the middle mouse button by accident and getting stuff
892 pasted into my buffer so how can I turn this off?
894 Here is an alternative binding, whereby the middle mouse button
895 selects (but does not cut) the expression under the mouse. Clicking
896 middle on a left or right paren will select to the matching one. Note
897 that you can use `define-key' or `global-set-key'.
899 (defun mouse-set-point-and-select (event)
900 "Sets the point at the mouse location, then marks following form"
902 (mouse-set-point event)
904 (define-key global-map [button2] 'mouse-set-point-and-select)
907 File: xemacs-faq.info, Node: Q3.7.2, Next: Q3.7.3, Prev: Q3.7.1, Up: Customization
909 Q3.7.2: How do I set control/meta/etc modifiers on mouse buttons?
910 -----------------------------------------------------------------
912 Use, for instance, `[(meta button1)]'. For example, here is a common
913 setting for Common Lisp programmers who use the bundled `ilisp'
914 package, whereby meta-button1 on a function name will find the file
915 where the function name was defined, and put you at that location in
918 [Inside a function that gets called by the lisp-mode-hook and
921 (local-set-key [(meta button1)] 'edit-definitions-lisp)
924 File: xemacs-faq.info, Node: Q3.7.3, Next: Q3.7.4, Prev: Q3.7.2, Up: Customization
926 Q3.7.3: Clicking the left button does not do anything in buffer list.
927 ---------------------------------------------------------------------
929 I do `C-x C-b' to get a list of buffers and the entries get
930 highlighted when I move the mouse over them but clicking the left mouse
931 does not do anything.
933 Use the middle mouse button.
936 File: xemacs-faq.info, Node: Q3.7.4, Next: Q3.7.5, Prev: Q3.7.3, Up: Customization
938 Q3.7.4: How can I get a list of buffers when I hit mouse button 3?
939 ------------------------------------------------------------------
941 The following code will replace the default popup on button3:
943 (global-set-key [button3] 'popup-buffer-menu)
946 File: xemacs-faq.info, Node: Q3.7.5, Next: Q3.7.6, Prev: Q3.7.4, Up: Customization
948 Q3.7.5: Why does cut-and-paste not work between XEmacs and a cmdtool?
949 ---------------------------------------------------------------------
951 We don't know. It's a bug. There does seem to be a work-around,
952 however. Try running xclipboard first. It appears to fix the problem
953 even if you exit it. (This should be mostly fixed in 19.13, but we
954 haven't yet verified that).
957 File: xemacs-faq.info, Node: Q3.7.6, Next: Q3.7.7, Prev: Q3.7.5, Up: Customization
959 Q3.7.6: How I can set XEmacs up so that it pastes where the text cursor is?
960 ---------------------------------------------------------------------------
962 By default XEmacs pastes X selections where the mouse pointer is.
963 How do I disable this?
965 Examine the function `mouse-yank', by typing `C-h f mouse-yank
968 To get XEmacs to paste at the text cursor, add this your `.emacs':
970 (setq mouse-yank-at-point t)
972 Starting with XEmacs-20.2 you can also change this with Customize.
973 Select from the `Options' menu `Customize->Emacs->Editing->Mouse->Yank
974 At Point...' or type `M-x customize <RET> mouse <RET>'.
977 File: xemacs-faq.info, Node: Q3.7.7, Next: Q3.7.8, Prev: Q3.7.6, Up: Customization
979 Q3.7.7: How do I select a rectangular region?
980 ---------------------------------------------
982 Just select the region normally, then use the rectangle commands
983 (e.g. `kill-rectangle' on it. The region does not highlight as a
984 rectangle, but the commands work just fine.
986 To actually sweep out rectangular regions with the mouse you can use
987 `mouse-track-do-rectangle' which is assigned to `M-button1'. Then use
990 You can also do the following to change default behavior to sweep out
993 (setq mouse-track-rectangle-p t)
995 Starting with XEmacs-20.2 you can also change this with Customize.
996 Select from the `Options' menu `Customize->Emacs->Editing->Mouse->Track
997 Rectangle...' or type `M-x customize <RET> mouse <RET>'.
999 mouse-track-do-rectangle: (event)
1000 -- an interactive compiled Lisp function.
1001 Like `mouse-track' but selects rectangles instead of regions.
1004 File: xemacs-faq.info, Node: Q3.7.8, Next: Q3.8.1, Prev: Q3.7.7, Up: Customization
1006 Q3.7.8: Why does `M-w' take so long?
1007 ------------------------------------
1009 It actually doesn't. It leaves the region visible for a second so
1010 that you can see what area is being yanked. If you start working,
1011 though, it will immediately complete its operation. In other words, it
1012 will only delay for a second if you let it.
1015 File: xemacs-faq.info, Node: Q3.8.1, Next: Q3.8.2, Prev: Q3.7.8, Up: Customization
1017 3.8: The Menubar and Toolbar
1018 ============================
1020 Q3.8.1: How do I get rid of the menu (or menubar)?
1021 --------------------------------------------------
1023 If you are running XEmacs 19.13 and earlier, add this command to your
1028 Starting with XEmacs 19.14 the preferred method is:
1030 (set-specifier menubar-visible-p nil)
1033 File: xemacs-faq.info, Node: Q3.8.2, Next: Q3.8.3, Prev: Q3.8.1, Up: Customization
1035 Q3.8.2: Can I customize the basic menubar?
1036 ------------------------------------------
1038 For an extensive menubar, add this line to your `.emacs':
1040 (load "big-menubar")
1042 If you'd like to write your own, this file provides as good a set of
1043 examples as any to start from. The file is located in
1044 `lisp/packages/big-menubar.el' in the XEmacs installation directory.
1047 File: xemacs-faq.info, Node: Q3.8.3, Next: Q3.8.4, Prev: Q3.8.2, Up: Customization
1049 Q3.8.3: How do I control how many buffers are listed in the menu `Buffers List'?
1050 --------------------------------------------------------------------------------
1052 Add the following to your `.emacs' (suit to fit):
1054 (setq buffers-menu-max-size 20)
1056 For no limit, use an argument of `nil'.
1058 Starting with XEmacs-20.3 you can also change this with Customize.
1059 Select from the `Options' menu
1060 `Customize->Emacs->Environment->Menu->Buffers Menu->Max Size...' or
1061 type `M-x customize <RET> buffers-menu <RET>'.
1064 File: xemacs-faq.info, Node: Q3.8.4, Next: Q3.8.5, Prev: Q3.8.3, Up: Customization
1066 Q3.8.4: Resources like `Emacs*menubar*font' are not working?
1067 ------------------------------------------------------------
1069 I am trying to use a resource like `Emacs*menubar*font' to set the
1070 font of the menubar but it's not working.
1072 If you are using the real Motif menubar, this resource is not
1073 recognized; you have to say:
1075 Emacs*menubar*fontList: FONT
1077 If you are using the Lucid menubar, the former resource will be
1078 recognized only if the latter resource is unset. This means that the
1085 Emacs*menubar*font: FONT
1087 even though the latter is more specific.
1090 File: xemacs-faq.info, Node: Q3.8.5, Next: Q3.9.1, Prev: Q3.8.4, Up: Customization
1092 Q3.8.5: How can I bind a key to a function to toggle the toolbar?
1093 -----------------------------------------------------------------
1097 (defun my-toggle-toolbar ()
1099 (set-specifier default-toolbar-visible-p
1100 (not (specifier-instance default-toolbar-visible-p))))
1101 (global-set-key "\C-xT" 'my-toggle-toolbar)
1103 There are redisplay bugs in 19.14 that may make the preceding result
1104 in a messed-up display, especially for frames with multiple windows.
1105 You may need to resize the frame before XEmacs completely realizes the
1106 toolbar is really gone.
1108 Thanks to Martin Buchholz <martin@xemacs.org> for the correct code.
1111 File: xemacs-faq.info, Node: Q3.9.1, Next: Q3.9.2, Prev: Q3.8.5, Up: Customization
1116 Q3.9.1: How can I disable the scrollbar?
1117 ----------------------------------------
1119 To disable them for all frames, add the following line to your
1122 Emacs.scrollBarWidth: 0
1124 Or select from the `Options' menu `Frame Appearance->Scrollbars'.
1125 Remember to save options.
1127 To turn the scrollbar off on a per-frame basis, use the following
1130 (set-specifier scrollbar-width 0 (selected-frame))
1132 You can actually turn the scrollbars on at any level you want by
1133 substituting for (selected-frame) in the above command. For example, to
1134 turn the scrollbars off only in a single buffer:
1136 (set-specifier scrollbar-width 0 (current-buffer))
1138 In XEmacs versions prior to 19.14, you had to use the hairier
1141 (set-specifier scrollbar-width (cons (selected-frame) 0))
1144 File: xemacs-faq.info, Node: Q3.9.2, Next: Q3.9.3, Prev: Q3.9.1, Up: Customization
1146 Q3.9.2: How can one use resources to change scrollbar colors?
1147 -------------------------------------------------------------
1149 Here's a recap of how to use resources to change your scrollbar
1154 Emacs*XmScrollBar.Background: skyblue
1155 Emacs*XmScrollBar.troughColor: lightgray
1159 Emacs*Scrollbar.Foreground: skyblue
1160 Emacs*Scrollbar.Background: lightgray
1162 Note the capitalization of `Scrollbar' for the Athena widget.
1165 File: xemacs-faq.info, Node: Q3.9.3, Next: Q3.9.4, Prev: Q3.9.2, Up: Customization
1167 Q3.9.3: Moving the scrollbar can move the point; can I disable this?
1168 --------------------------------------------------------------------
1170 When I move the scrollbar in an XEmacs window, it moves the point as
1171 well, which should not be the default behavior. Is this a bug or a
1172 feature? Can I disable it?
1174 The current behavior is a feature, not a bug. Point remains at the
1175 same buffer position as long as that position does not scroll off the
1176 screen. In that event, point will end up in either the upper-left or
1177 lower-left hand corner.
1179 This cannot be changed.
1182 File: xemacs-faq.info, Node: Q3.9.4, Next: Q3.10.1, Prev: Q3.9.3, Up: Customization
1184 Q3.9.4: How can I get automatic horizontal scrolling?
1185 -----------------------------------------------------
1187 By the same token, how can I turn it off in specific modes?
1189 To do this, add to your `.emacs' file:
1191 (require 'auto-show)
1193 Then do `(setq truncate-lines t)' in the mode-hooks for any modes in
1194 which you want lines truncated.
1196 More precisely: If `truncate-lines' is nil, horizontal scrollbars
1197 will never appear. Otherwise, they will appear only if the value of
1198 `scrollbar-height' for that buffer/window/etc. is non-zero. If you do
1200 (set-specifier scrollbar-height 0)
1202 then horizontal scrollbars will not appear in truncated buffers
1203 unless the package specifically asked for them.
1205 Automatic horizontal scrolling is now standard, starting with 19.14.
1208 File: xemacs-faq.info, Node: Q3.10.1, Next: Q3.10.2, Prev: Q3.9.4, Up: Customization
1210 3.10: Text Selections
1211 =====================
1213 Q3.10.1: How can I turn off or change highlighted selections?
1214 -------------------------------------------------------------
1216 The `zmacs' mode allows for what some might call gratuitous
1217 highlighting for selected regions (either by setting mark or by using
1218 the mouse). This is the default behavior. To turn off, add the
1219 following line to your `.emacs' file:
1221 (setq zmacs-regions nil)
1223 Starting with XEmacs-20.2 you can also change this with Customize.
1224 Select from the `Options' menu `Customize->Emacs->Editing->Basics->Zmacs
1225 Regions' or type `M-x customize <RET> editing-basics <RET>'.
1227 To change the face for selection, look at `Options->Customize' on
1231 File: xemacs-faq.info, Node: Q3.10.2, Next: Q3.10.3, Prev: Q3.10.1, Up: Customization
1233 Q3.10.2: How do I get that typing on an active region removes it?
1234 -----------------------------------------------------------------
1236 I want to change things so that if I select some text and start
1237 typing, the typed text replaces the selected text, similar to Motif.
1239 You want to use something called "pending delete". Pending delete
1240 is what happens when you select a region (with the mouse or keyboard)
1241 and you press a key to replace the selected region by the key you typed.
1242 Usually backspace kills the selected region.
1244 To get this behavior, add the following lines to your `.emacs':
1247 ((fboundp 'turn-on-pending-delete)
1248 (turn-on-pending-delete))
1249 ((fboundp 'pending-delete-on)
1250 (pending-delete-on t)))
1252 Note that this will work with both Backspace and Delete. This code
1253 is a tad more complicated than it has to be for XEmacs in order to make
1257 File: xemacs-faq.info, Node: Q3.10.3, Next: Q3.10.4, Prev: Q3.10.2, Up: Customization
1259 Q3.10.3: Can I turn off the highlight during isearch?
1260 -----------------------------------------------------
1262 I do not like my text highlighted while I am doing isearch as I am
1263 not able to see what's underneath. How do I turn it off?
1265 Put the following in your `.emacs':
1267 (setq isearch-highlight nil)
1269 Starting with XEmacs-20.2 you can also change this with Customize.
1270 Type `M-x customize-variable <RET> isearch-highlight <RET>'.
1272 Note also that isearch-highlight affects query-replace and ispell.
1273 Instead of disabling isearch-highlight you may find that a better
1274 solution consists of customizing the `isearch' face.
1277 File: xemacs-faq.info, Node: Q3.10.4, Next: Q3.10.5, Prev: Q3.10.3, Up: Customization
1279 Q3.10.4: How do I turn off highlighting after `C-x C-p' (mark-page)?
1280 --------------------------------------------------------------------
1282 Put this in your `.emacs':
1284 (setq zmacs-regions nil)
1286 *Warning: This command turns off all region highlighting.*
1288 Also *Note Q3.10.1::.
1291 File: xemacs-faq.info, Node: Q3.10.5, Prev: Q3.10.4, Up: Customization
1293 Q3.10.5: The region disappears when I hit the end of buffer while scrolling.
1294 ----------------------------------------------------------------------------
1296 This has been fixed by default starting with XEmacs-20.3.
1298 With older versions you can turn this feature (if it indeed is a
1299 feature) off like this:
1301 (defadvice scroll-up (around scroll-up freeze)
1303 (let ((zmacs-region-stays t))
1307 (end-of-buffer (goto-char (point-max))))
1310 (defadvice scroll-down (around scroll-down freeze)
1312 (let ((zmacs-region-stays t))
1316 (beginning-of-buffer (goto-char (point-min))))
1319 Thanks to T. V. Raman <raman@adobe.com> for assistance in deriving
1323 File: xemacs-faq.info, Node: Subsystems, Next: Miscellaneous, Prev: Customization, Up: Top
1328 This is part 4 of the XEmacs Frequently Asked Questions list. This
1329 section is devoted to major XEmacs subsystems.
1333 Reading Mail with VM:
1334 * Q4.0.1:: How do I set up VM to retrieve remote mail using POP?
1335 * Q4.0.2:: How do I get VM to filter mail for me?
1336 * Q4.0.3:: How can I get VM to automatically check for new mail?
1337 * Q4.0.4:: [This question intentionally left blank]
1338 * Q4.0.5:: How do I get my outgoing mail archived?
1339 * 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"?
1340 * Q4.0.7:: Is there a mailing list or FAQ for VM?
1341 * Q4.0.8:: Remote mail reading with VM.
1342 * Q4.0.9:: rmail or VM gets an error incorporating new mail.
1343 * Q4.0.10:: How do I make VM stay in a single frame?
1344 * Q4.0.11:: How do I make VM or mh-e display graphical smilies?
1345 * Q4.0.12:: Customization of VM not covered in the manual or here.
1347 Web browsing with W3:
1348 * Q4.1.1:: What is W3?
1349 * Q4.1.2:: How do I run W3 from behind a firewall?
1350 * Q4.1.3:: Is it true that W3 supports style sheets and tables?
1352 Reading Netnews and Mail with Gnus:
1353 * Q4.2.1:: GNUS, (ding) Gnus, Gnus 5, September Gnus, Red Gnus,argh!
1354 * Q4.2.2:: [This question intentionally left blank]
1355 * Q4.2.3:: How do I make Gnus stay within a single frame?
1356 * Q4.2.4:: How do I customize the From: line?
1359 * Q4.3.1:: How can I read and/or compose MIME messages?
1360 * Q4.3.2:: What is TM and where do I get it?
1361 * Q4.3.3:: Why isn't this `movemail' program working?
1362 * Q4.3.4:: Movemail is also distributed by Netscape? Can that cause problems?
1363 * Q4.3.5:: Where do I find pstogif (required by tm)?
1365 Sparcworks, EOS, and WorkShop:
1366 * Q4.4.1:: What is SPARCworks, EOS, and WorkShop
1367 * Q4.4.2:: How do I start the Sun Workshop support in XEmacs 21?
1370 * Q4.5.1:: What is/was Energize?
1373 * Q4.6.1:: What is Infodock?
1375 Other Unbundled Packages:
1376 * Q4.7.1:: What is AUC TeX? Where do you get it?
1377 * Q4.7.2:: Are there any Emacs Lisp Spreadsheets?
1378 * Q4.7.3:: [This question intentionally left blank]
1379 * Q4.7.4:: Problems installing AUC TeX
1380 * Q4.7.5:: Is there a reason for an Emacs package not to be included in XEmacs?
1381 * Q4.7.6:: Is there a MatLab mode?
1384 File: xemacs-faq.info, Node: Q4.0.1, Next: Q4.0.2, Prev: Subsystems, Up: Subsystems
1386 4.0: Reading Mail with VM
1387 =========================
1389 Q4.0.1: How do I set up VM to retrieve mail from a remote site using POP?
1390 -------------------------------------------------------------------------
1392 Use `vm-spool-files', like this for example:
1394 (setq vm-spool-files '("/var/spool/mail/wing"
1395 "netcom23.netcom.com:110:pass:wing:MYPASS"))
1397 Of course substitute your actual password for MYPASS.
1400 File: xemacs-faq.info, Node: Q4.0.2, Next: Q4.0.3, Prev: Q4.0.1, Up: Subsystems
1402 Q4.0.2: How do I get VM to filter mail for me?
1403 ----------------------------------------------
1405 One possibility is to use procmail to split your mail before it gets
1406 to VM. I prefer this personally, since there are many strange and
1407 wonderful things one can do with procmail. Procmail may be found at
1408 `ftp://ftp.informatik.rwth-aachen.de/pub/packages/procmail/'.
1410 Also see the Mail Filtering FAQ at:
1411 `ftp://rtfm.mit.edu/pub/usenet/news.answers/mail/filtering-faq'.
1414 File: xemacs-faq.info, Node: Q4.0.3, Next: Q4.0.4, Prev: Q4.0.2, Up: Subsystems
1416 Q4.0.3: How can I get VM to automatically check for new mail?
1417 -------------------------------------------------------------
1419 John Turner <turner@lanl.gov> writes:
1423 (setq vm-auto-get-new-mail 60)
1426 File: xemacs-faq.info, Node: Q4.0.4, Next: Q4.0.5, Prev: Q4.0.3, Up: Subsystems
1428 Q4.0.4: [This question intentionally left blank]
1429 ------------------------------------------------
1431 Obsolete question, left blank to avoid renumbering.
1434 File: xemacs-faq.info, Node: Q4.0.5, Next: Q4.0.6, Prev: Q4.0.4, Up: Subsystems
1436 Q4.0.5: How do I get my outgoing mail archived?
1437 -----------------------------------------------
1439 (setq mail-archive-file-name "~/outbox")