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.4, Next: Q3.0.5, Prev: Q3.0.3, Up: Customization
12 Q3.0.4: How can I add directories to the `load-path'?
13 -----------------------------------------------------
15 Here are two ways to do that, one that puts your directories at the
16 front of the load-path, the other at the end:
18 ;;; Add things at the beginning of the load-path, do not add
19 ;;; duplicate directories:
20 (pushnew "bar" load-path :test 'equal)
22 (pushnew "foo" load-path :test 'equal)
24 ;;; Add things at the end, unconditionally
25 (setq load-path (nconc load-path '("foo" "bar")))
27 keith (k.p.) hanlan <keithh@nortel.ca> writes:
29 To add directories using Unix shell metacharacters use
30 `expand-file-name' like this:
32 (push (expand-file-name "~keithh/.emacsdir") load-path)
35 File: xemacs-faq.info, Node: Q3.0.5, Next: Q3.0.6, Prev: Q3.0.4, Up: Customization
37 Q3.0.5: How to check if a lisp function is defined?
38 ---------------------------------------------------
40 Use the following elisp:
44 It's almost always a mistake to test `emacs-version' or any similar
47 Instead, use feature-tests, such as `featurep', `boundp', `fboundp',
48 or even simple behavioral tests, eg.:
50 (defvar foo-old-losing-code-p
51 (condition-case nil (progn (losing-code t) nil)
52 (wrong-number-of-arguments t)))
54 There is an incredible amount of broken code out there which could
55 work much better more often in more places if it did the above instead
56 of trying to divine its environment from the value of one variable.
59 File: xemacs-faq.info, Node: Q3.0.6, Next: Q3.0.7, Prev: Q3.0.5, Up: Customization
61 Q3.0.6: Can I force the output of `(face-list)' to a buffer?
62 ------------------------------------------------------------
64 It would be good having it in a buffer, as the output of
65 `(face-list)' is too wide to fit to a minibuffer.
67 Evaluate the expression in the `*scratch*' buffer with point after
68 the rightmost paren and typing `C-j'.
70 If the minibuffer smallness is the only problem you encounter, you
71 can simply press `C-h l' to get the former minibuffer contents in a
75 File: xemacs-faq.info, Node: Q3.0.7, Next: Q3.0.8, Prev: Q3.0.6, Up: Customization
77 Q3.0.7: Font selections in don't get saved after `Save Options'.
78 ----------------------------------------------------------------
80 For XEmacs 19.14 and previous:
82 John Mann <mannj@ll.mit.edu> writes:
84 You have to go to Options->Frame Appearance and unselect
85 `Frame-Local Font Menu'. If this option is selected, font changes
86 are only applied to the _current_ frame and do _not_ get saved
87 when you save options.
89 For XEmacs 19.15 and later:
91 Implement the above as well as set the following in your `.emacs'
93 (setq options-save-faces t)
96 File: xemacs-faq.info, Node: Q3.0.8, Next: Q3.0.9, Prev: Q3.0.7, Up: Customization
98 Q3.0.8: How do I get a single minibuffer frame?
99 -----------------------------------------------
101 Vin Shelton <acs@acm.org> writes:
103 (setq initial-frame-plist '(minibuffer nil))
104 (setq default-frame-plist '(minibuffer nil))
105 (setq default-minibuffer-frame
110 menubar-visible-p nil
111 default-toolbar-visible-p nil
115 has-modeline-p nil)))
116 (frame-notice-user-settings)
118 *Please note:* The single minibuffer frame may not be to everyone's
119 taste, and there any number of other XEmacs options settings that may
120 make it difficult or inconvenient to use.
123 File: xemacs-faq.info, Node: Q3.0.9, Next: Q3.1.1, Prev: Q3.0.8, Up: Customization
125 Q3.0.9: What is `Customize'?
126 ----------------------------
128 Starting with XEmacs 20.2 there is new system 'Customize' for
129 customizing XEmacs options.
131 You can access `Customize' from the `Options' menu or invoking one
132 of customize commands by typing eg. `M-x customize', `M-x
133 customize-face', `M-x customize-variable' or `M-x customize-apropos'.
135 Starting with XEmacs 20.3 there is also new `browser' mode for
136 Customize. Try it out with `M-x customize-browse'
139 File: xemacs-faq.info, Node: Q3.1.1, Next: Q3.1.2, Prev: Q3.0.9, Up: Customization
141 3.1: X Window System & Resources
142 ================================
144 Q3.1.1: Where is a list of X resources?
145 ---------------------------------------
147 Search through the `NEWS' file for `X Resources'. A fairly
148 comprehensive list is given after it.
150 In addition, an `app-defaults' file is supplied, `etc/Emacs.ad'
151 listing the defaults. The file `etc/sample.Xdefaults' gives a set of
152 defaults that you might consider. It is essentially the same as
153 `etc/Emacs.ad' but some entries are slightly altered. Be careful about
154 installing the contents of this file into your `.Xdefaults' or
155 `.Xresources' file if you use GNU Emacs under X11 as well.
158 File: xemacs-faq.info, Node: Q3.1.2, Next: Q3.1.3, Prev: Q3.1.1, Up: Customization
160 Q3.1.2: How can I detect a color display?
161 -----------------------------------------
163 You can test the return value of the function `(device-class)', as
166 (when (eq (device-class) 'color)
167 (set-face-foreground 'font-lock-comment-face "Grey")
168 (set-face-foreground 'font-lock-string-face "Red")
173 File: xemacs-faq.info, Node: Q3.1.3, Next: Q3.1.4, Prev: Q3.1.2, Up: Customization
175 Q3.1.3: [This question intentionally left blank]
176 ------------------------------------------------
179 File: xemacs-faq.info, Node: Q3.1.4, Next: Q3.1.5, Prev: Q3.1.3, Up: Customization
181 Q3.1.4: [This question intentionally left blank]
182 ------------------------------------------------
185 File: xemacs-faq.info, Node: Q3.1.5, Next: Q3.1.6, Prev: Q3.1.4, Up: Customization
187 Q3.1.5: How can I get the icon to just say `XEmacs'?
188 ----------------------------------------------------
190 I'd like the icon to just say `XEmacs', and not include the name of
191 the current file in it.
193 Add the following line to your `.emacs':
195 (setq frame-icon-title-format "XEmacs")
198 File: xemacs-faq.info, Node: Q3.1.6, Next: Q3.1.7, Prev: Q3.1.5, Up: Customization
200 Q3.1.6: How can I have the window title area display the full path?
201 -------------------------------------------------------------------
203 I'd like to have the window title area display the full
204 directory/name of the current buffer file and not just the name.
206 Add the following line to your `.emacs':
208 (setq frame-title-format "%S: %f")
210 A more sophisticated title might be:
212 (setq frame-title-format
213 '("%S: " (buffer-file-name "%f"
214 (dired-directory dired-directory "%b"))))
216 That is, use the file name, or the dired-directory, or the buffer
220 File: xemacs-faq.info, Node: Q3.1.7, Next: Q3.1.8, Prev: Q3.1.6, Up: Customization
222 Q3.1.7: `xemacs -name junk' doesn't work?
223 -----------------------------------------
225 When I run `xterm -name junk', I get an xterm whose class name
226 according to xprop, is `junk'. This is the way it's supposed to work,
227 I think. When I run `xemacs -name junk' the class name is not set to
228 `junk'. It's still `emacs'. What does `xemacs -name' really do? The
229 reason I ask is that my window manager (fvwm) will make a window sticky
230 and I use XEmacs to read my mail. I want that XEmacs window to be
231 sticky, without having to use the window manager's function to set the
232 window sticky. What gives?
234 `xemacs -name' sets the application name for the program (that is,
235 the thing which normally comes from `argv[0]'). Using `-name' is the
236 same as making a copy of the executable with that new name. The
237 `WM_CLASS' property on each frame is set to the frame-name, and the
238 application-class. So, if you did `xemacs -name FOO' and then created
239 a frame named BAR, you'd get an X window with WM_CLASS = `( "BAR",
240 "Emacs")'. However, the resource hierarchy for this widget would be:
242 Name: FOO .shell .container .BAR
243 Class: Emacs .TopLevelEmacsShell.EmacsManager.EmacsFrame
245 instead of the default
247 Name: xemacs.shell .container .emacs
248 Class: Emacs .TopLevelEmacsShell.EmacsManager.EmacsFrame
250 It is arguable that the first element of WM_CLASS should be set to
251 the application-name instead of the frame-name, but I think that's less
252 flexible, since it does not give you the ability to have multiple frames
253 with different WM_CLASS properties. Another possibility would be for
254 the default frame name to come from the application name instead of
255 simply being `emacs'. However, at this point, making that change would
256 be troublesome: it would mean that many users would have to make yet
257 another change to their resource files (since the default frame name
258 would suddenly change from `emacs' to `xemacs', or whatever the
259 executable happened to be named), so we'd rather avoid it.
261 To make a frame with a particular name use:
263 (make-frame '((name . "the-name")))
266 File: xemacs-faq.info, Node: Q3.1.8, Next: Q3.2.1, Prev: Q3.1.7, Up: Customization
268 Q3.1.8: `-iconic' doesn't work.
269 -------------------------------
271 When I start up XEmacs using `-iconic' it doesn't work right. Using
272 `-unmapped' on the command line, and setting the `initiallyUnmapped' X
273 Resource don't seem to help much either...
275 Ben Wing <ben@xemacs.org> writes:
277 Ugh, this stuff is such an incredible mess that I've about given up
278 getting it to work. The principal problem is numerous
279 window-manager bugs...
282 File: xemacs-faq.info, Node: Q3.2.1, Next: Q3.2.2, Prev: Q3.1.8, Up: Customization
284 3.2: Textual Fonts & Colors
285 ===========================
287 Q3.2.1: How can I set color options from `.emacs'?
288 --------------------------------------------------
290 How can I set the most commonly used color options from my `.emacs'
291 instead of from my `.Xdefaults'?
295 (set-face-background 'default "bisque") ; frame background
296 (set-face-foreground 'default "black") ; normal text
297 (set-face-background 'zmacs-region "red") ; When selecting w/
299 (set-face-foreground 'zmacs-region "yellow")
300 (set-face-font 'default "*courier-bold-r*120-100-100*")
301 (set-face-background 'highlight "blue") ; Ie when selecting
303 (set-face-foreground 'highlight "yellow")
304 (set-face-background 'modeline "blue") ; Line at bottom
306 (set-face-foreground 'modeline "white")
307 (set-face-font 'modeline "*bold-r-normal*140-100-100*")
308 (set-face-background 'isearch "yellow") ; When highlighting
310 (set-face-foreground 'isearch "red")
311 (setq x-pointer-foreground-color "black") ; Adds to bg color,
313 (setq x-pointer-background-color "blue") ; This is color
318 File: xemacs-faq.info, Node: Q3.2.2, Next: Q3.2.3, Prev: Q3.2.1, Up: Customization
320 Q3.2.2: How do I set the text, menu and modeline fonts?
321 -------------------------------------------------------
323 Note that you should use `Emacs.' and not `Emacs*' when setting face
328 Emacs.default.attributeFont: -*-*-medium-r-*-*-*-120-*-*-m-*-*-*
329 Emacs*menubar*font: fixed
330 Emacs.modeline.attributeFont: fixed
332 This is confusing because modeline is a face, and can be found listed
333 with all faces in the current mode by using `M-x set-face-font (enter)
334 ?'. It uses the face specification of `attributeFont', while menubar
335 is a normal X thing that uses the specification `font'. With Motif it
336 may be necessary to use `fontList' instead of `font'.
339 File: xemacs-faq.info, Node: Q3.2.3, Next: Q3.2.4, Prev: Q3.2.2, Up: Customization
341 Q3.2.3: How can I set the colors when highlighting a region?
342 ------------------------------------------------------------
344 How can I set the background/foreground colors when highlighting a
347 You can change the face `zmacs-region' either in your `.Xdefaults':
349 Emacs.zmacs-region.attributeForeground: firebrick
350 Emacs.zmacs-region.attributeBackground: lightseagreen
354 (set-face-background 'zmacs-region "red")
355 (set-face-foreground 'zmacs-region "yellow")
358 File: xemacs-faq.info, Node: Q3.2.4, Next: Q3.2.5, Prev: Q3.2.3, Up: Customization
360 Q3.2.4: How can I limit color map usage?
361 ----------------------------------------
363 I'm using Netscape (or another color grabber like XEmacs); is there
364 anyway to limit the number of available colors in the color map?
366 XEmacs 19.13 didn't have such a mechanism (unlike netscape, or other
367 color-hogs). One solution is to start XEmacs prior to netscape, since
368 this will prevent Netscape from grabbing all colors (but Netscape will
369 complain). You can use the flags for Netscape, like -mono, -ncols <#>
370 or -install (for mono, limiting to <#> colors, or for using a private
371 color map). Since Netscape will take the entire colormap and never
372 release it, the only reasonable way to run it is with `-install'.
374 If you have the money, another solution would be to use a truecolor
375 or direct color video.
377 Starting with XEmacs 19.14, XEmacs uses the closest available color
378 if the colormap is full, so it's O.K. now to start Netscape first.
381 File: xemacs-faq.info, Node: Q3.2.5, Next: Q3.2.6, Prev: Q3.2.4, Up: Customization
383 Q3.2.5: My tty supports color, but XEmacs doesn't use them.
384 -----------------------------------------------------------
386 XEmacs tries to automatically determine whether your tty supports
387 color, but sometimes guesses wrong. In that case, you can make XEmacs
388 Do The Right Thing using this Lisp code:
390 (if (eq 'tty (device-type))
391 (set-device-class nil 'color))
394 File: xemacs-faq.info, Node: Q3.2.6, Next: Q3.3.1, Prev: Q3.2.5, Up: Customization
396 Q3.2.6: Can I have pixmap backgrounds in XEmacs?
397 ------------------------------------------------
399 Juan Villacis <jvillaci@wahnsinnig.extreme.indiana.edu> writes:
401 There are several ways to do it. For example, you could specify a
402 default pixmap image to use in your `~/.Xresources', e.g.,
404 Emacs*EmacsFrame.default.attributeBackgroundPixmap: /path/to/image.xpm
406 and then reload ~/.Xresources and restart XEmacs. Alternatively,
407 since each face can have its own pixmap background, a better way
408 would be to set a face's pixmap within your XEmacs init file, e.g.,
410 (set-face-background-pixmap 'default "/path/to/image.xpm")
411 (set-face-background-pixmap 'bold "/path/to/another_image.xpm")
413 and so on. You can also do this interactively via `M-x
418 File: xemacs-faq.info, Node: Q3.3.1, Next: Q3.3.2, Prev: Q3.2.6, Up: Customization
423 Q3.3.1: How can I make the modeline go away?
424 --------------------------------------------
426 (set-specifier has-modeline-p nil)
428 Starting with XEmacs 19.14 the modeline responds to mouse clicks, so
429 if you haven't liked or used the modeline in the past, you might want to
430 try the new version out.
433 File: xemacs-faq.info, Node: Q3.3.2, Next: Q3.3.3, Prev: Q3.3.1, Up: Customization
435 Q3.3.2: How do you have XEmacs display the line number in the modeline?
436 -----------------------------------------------------------------------
438 Add the following line to your `.emacs' file to display the line
443 Use the following to display the column number:
445 (column-number-mode 1)
447 Or select from the `Options' menu
448 `Customize->Emacs->Editing->Basics->Line Number Mode' and/or
449 `Customize->Emacs->Editing->Basics->Column Number Mode'
451 Or type `M-x customize <RET> editing-basics <RET>'.
454 File: xemacs-faq.info, Node: Q3.3.3, Next: Q3.3.4, Prev: Q3.3.2, Up: Customization
456 Q3.3.3: How do I get XEmacs to put the time of day on the modeline?
457 -------------------------------------------------------------------
459 Add the following line to your `.emacs' file to display the time:
463 See `Customize' from the `Options' menu for customization.
466 File: xemacs-faq.info, Node: Q3.3.4, Next: Q3.3.5, Prev: Q3.3.3, Up: Customization
468 Q3.3.4: How do I turn off current chapter from AUC TeX modeline?
469 ----------------------------------------------------------------
471 With AUC TeX, fast typing is hard because the current chapter,
472 section etc. are given in the modeline. How can I turn this off?
474 It's not AUC TeX, it comes from `func-menu' in `func-menu.el'. Add
475 this code to your `.emacs' to turn it off:
477 (setq fume-display-in-modeline-p nil)
479 Or just add a hook to `TeX-mode-hook' to turn it off only for TeX
482 (add-hook 'TeX-mode-hook
483 '(lambda () (setq fume-display-in-modeline-p nil)))
485 David Hughes <dhughes@origin-at.co.uk> writes:
487 If you have 19.14 or later, try this instead; you'll still get the
488 function name displayed in the modeline, but it won't attempt to
489 keep track when you modify the file. To refresh when it gets out
490 of synch, you simply need click on the `Rescan Buffer' option in
493 (setq-default fume-auto-rescan-buffer-p nil)
496 File: xemacs-faq.info, Node: Q3.3.5, Next: Q3.4.1, Prev: Q3.3.4, Up: Customization
498 Q3.3.5: How can one change the modeline color based on the mode used?
499 ---------------------------------------------------------------------
501 You can use something like the following:
503 (add-hook 'lisp-mode-hook
505 (set-face-background 'modeline "red" (current-buffer))))
507 Then, when editing a Lisp file (i.e. when in Lisp mode), the modeline
508 colors change from the default set in your `.emacs'. The change will
509 only be made in the buffer you just entered (which contains the Lisp
510 file you are editing) and will not affect the modeline colors anywhere
515 * The hook is the mode name plus `-hook'. eg. c-mode-hook,
516 c++-mode-hook, emacs-lisp-mode-hook (used for your `.emacs' or a
517 `xx.el' file), lisp-interaction-mode-hook (the `*scratch*'
518 buffer), text-mode-hook, etc.
520 * Be sure to use `add-hook', not `(setq c-mode-hook xxxx)',
521 otherwise you will erase anything that anybody has already put on
524 * You can also do `(set-face-font 'modeline FONT)', eg.
525 `(set-face-font 'modeline "*bold-r-normal*140-100-100*"
526 (current-buffer))' if you wish the modeline font to vary based on
529 This works in 19.15 as well, but there are additional modeline faces,
530 `modeline-buffer-id', `modeline-mousable', and
531 `modeline-mousable-minor-mode', which you may want to customize.
534 File: xemacs-faq.info, Node: Q3.4.1, Next: Q3.4.2, Prev: Q3.3.5, Up: Customization
536 3.4: Multiple Device Support
537 ============================
539 Q3.4.1: How do I open a frame on another screen of my multi-headed display?
540 ---------------------------------------------------------------------------
542 The support for this was revamped for 19.14. Use the command `M-x
543 make-frame-on-display'. This command is also on the File menu in the
546 XEmacs 19.14 and later also have the command `make-frame-on-tty'
547 which will establish a connection to any tty-like device. Opening the
548 TTY devices should be left to `gnuclient', though.
551 File: xemacs-faq.info, Node: Q3.4.2, Next: Q3.5.1, Prev: Q3.4.1, Up: Customization
553 Q3.4.2: Can I really connect to a running XEmacs after calling up over a modem? How?
554 -------------------------------------------------------------------------------------
556 If you're not running at least XEmacs 19.14, you can't. Otherwise
557 check out the `gnuattach' program supplied with XEmacs. Starting with
558 XEmacs 20.3, `gnuattach' and `gnudoit' functionality is provided by
561 Also *Note Q5.0.12::.
564 File: xemacs-faq.info, Node: Q3.5.1, Next: Q3.5.2, Prev: Q3.4.2, Up: Customization
569 Q3.5.1: How can I bind complex functions (or macros) to keys?
570 -------------------------------------------------------------
572 As an example, say you want the `paste' key on a Sun keyboard to
573 insert the current Primary X selection at point. You can accomplish this
576 (define-key global-map [f18] 'x-insert-selection)
578 However, this only works if there is a current X selection (the
579 selection will be highlighted). The functionality I like is for the
580 `paste' key to insert the current X selection if there is one,
581 otherwise insert the contents of the clipboard. To do this you need to
582 pass arguments to `x-insert-selection'. This is done by wrapping the
583 call in a 'lambda form:
585 (global-set-key [f18]
586 (lambda () (interactive) (x-insert-selection t nil)))
588 This binds the f18 key to a "generic" functional object. The
589 interactive spec is required because only interactive functions can be
592 For the FAQ example you could use:
594 (global-set-key [(control ?.)]
595 (lambda () (interactive) (scroll-up 1)))
596 (global-set-key [(control ?;)]
597 (lambda () (interactive) (scroll-up -1)))
599 This is fine if you only need a few functions within the lambda body.
600 If you're doing more it's cleaner to define a separate function as in
601 question 3.5.3 (*note Q3.5.3::).
604 File: xemacs-faq.info, Node: Q3.5.2, Next: Q3.5.3, Prev: Q3.5.1, Up: Customization
606 Q3.5.2: How can I stop down-arrow from adding empty lines to the bottom of my buffers?
607 --------------------------------------------------------------------------------------
609 Add the following line to your `.emacs' file:
611 (setq next-line-add-newlines nil)
613 This has been the default setting in XEmacs for some time.
616 File: xemacs-faq.info, Node: Q3.5.3, Next: Q3.5.4, Prev: Q3.5.2, Up: Customization
618 Q3.5.3: How do I bind C-. and C-; to scroll one line up and down?
619 -----------------------------------------------------------------
621 Add the following (Thanks to Richard Mlynarik <mly@adoc.xerox.com>
622 and Wayne Newberry <wayne@zen.cac.stratus.com>) to `.emacs':
624 (defun scroll-up-one-line ()
628 (defun scroll-down-one-line ()
632 (global-set-key [(control ?.)] 'scroll-up-one-line) ; C-.
633 (global-set-key [(control ?;)] 'scroll-down-one-line) ; C-;
635 The key point is that you can only bind simple functions to keys; you
636 can not bind a key to a function that you're also passing arguments to.
637 (*note Q3.5.1:: for a better answer).
640 File: xemacs-faq.info, Node: Q3.5.4, Next: Q3.5.5, Prev: Q3.5.3, Up: Customization
642 Q3.5.4: Globally binding `Delete'?
643 ----------------------------------
645 I cannot manage to globally bind my `Delete' key to something other
646 than the default. How does one do this?
650 (message "You hit DELETE"))
652 (global-set-key 'delete 'foo)
654 However, some modes explicitly bind `Delete', so you would need to
655 add a hook that does `local-set-key' for them. If what you want to do
656 is make the Backspace and Delete keys work more PC/Motif-like, then
657 take a look at the `delbs.el' package.
659 New in XEmacs 19.14 is a variable called `key-translation-map' which
660 makes it easier to bind `Delete'. `delbs.el' is a good example of how
661 to do this correctly.
663 Also *Note Q3.5.10::.
666 File: xemacs-faq.info, Node: Q3.5.5, Next: Q3.5.6, Prev: Q3.5.4, Up: Customization
668 Q3.5.5: Scrolling one line at a time.
669 -------------------------------------
671 Can the cursor keys scroll the screen a line at a time, rather than
672 the default half page jump? I tend it to find it disorienting.
676 (defun scroll-one-line-up (&optional arg)
677 "Scroll the selected window up (forward in the text) one line (or N lines)."
679 (scroll-up (or arg 1)))
681 (defun scroll-one-line-down (&optional arg)
682 "Scroll the selected window down (backward in the text) one line (or N)."
684 (scroll-down (or arg 1)))
686 (global-set-key [up] 'scroll-one-line-up)
687 (global-set-key [down] 'scroll-one-line-down)
689 The following will also work but will affect more than just the
690 cursor keys (i.e. `C-n' and `C-p'):
694 Starting with XEmacs-20.3 you can also change this with Customize.
695 Select from the `Options' menu
696 `Customize->Emacs->Environment->Windows->Scroll Step...' or type `M-x
697 customize <RET> windows <RET>'.
700 File: xemacs-faq.info, Node: Q3.5.6, Next: Q3.5.7, Prev: Q3.5.5, Up: Customization
702 Q3.5.6: How to map `Help' key alone on Sun type4 keyboard?
703 ----------------------------------------------------------
705 The following works in GNU Emacs 19:
707 (global-set-key [help] 'help-command);; Help
709 The following works in XEmacs 19.15 with the addition of shift:
711 (global-set-key [(shift help)] 'help-command);; Help
713 But it doesn't work alone. This is in the file `PROBLEMS' which
714 should have come with your XEmacs installation: _Emacs ignores the
715 `help' key when running OLWM_.
717 OLWM grabs the `help' key, and retransmits it to the appropriate
718 client using `XSendEvent'. Allowing Emacs to react to synthetic events
719 is a security hole, so this is turned off by default. You can enable
720 it by setting the variable `x-allow-sendevents' to t. You can also
721 cause fix this by telling OLWM to not grab the help key, with the null
722 binding `OpenWindows.KeyboardCommand.Help:'.
725 File: xemacs-faq.info, Node: Q3.5.7, Next: Q3.5.8, Prev: Q3.5.6, Up: Customization
727 Q3.5.7: How can you type in special characters in XEmacs?
728 ---------------------------------------------------------
730 One way is to use the package `x-compose'. Then you can use
731 sequences like `Compose " a' to get ä, etc.
733 Another way is to use the `iso-insert' package, provided in XEmacs
734 19.15 and later. Then you can use sequences like `C-x 8 " a' to get ä,
737 Glynn Clements <glynn@sensei.co.uk> writes:
739 It depends upon your X server.
741 Generally, the simplest way is to define a key as Multi_key with
743 xmodmap -e 'keycode 0xff20 = Multi_key'
745 You will need to pick an appropriate keycode. Use xev to find out
746 the keycodes for each key.
748 [NB: On a `Windows' keyboard, recent versions of XFree86
749 automatically define the right `Windows' key as Multi_key'.]
751 Once you have Multi_key defined, you can use e.g.
758 Also, recent versions of XFree86 define various AltGr-<key>
759 combinations as dead keys, i.e.
760 AltGr [ => dead_diaeresis
761 AltGr ] => dead_tilde
762 AltGr ; => dead_acute
765 Running `xmodmap -pk' will list all of the defined keysyms.
768 File: xemacs-faq.info, Node: Q3.5.8, Next: Q3.5.9, Prev: Q3.5.7, Up: Customization
770 Q3.5.8: Why does `(global-set-key [delete-forward] 'delete-char)' complain?
771 ---------------------------------------------------------------------------
773 Why does `(define-key global-map [ delete-forward ] 'delete-char)'
774 complain of not being able to bind an unknown key?
778 (define-key global-map [delete_forward] 'delete-char)
782 What you are seeing above is a bug due to code that is trying to
783 check for GNU Emacs syntax like:
785 (define-key global-map [C-M-a] 'delete-char)
787 which otherwise would cause no errors but would not result in the
790 This bug has been fixed in 19.14.
793 File: xemacs-faq.info, Node: Q3.5.9, Next: Q3.5.10, Prev: Q3.5.8, Up: Customization
795 Q3.5.9: How do I make the Delete key delete forward?
796 ----------------------------------------------------
798 With XEmacs-20.2 use the `delbs' package:
802 This will give you the functions `delbs-enable-delete-forward' to
803 set things up, and `delbs-disable-delete-forward' to revert to "normal"
804 behavior. Note that `delbackspace' package is obsolete.
806 Starting with XEmacs-20.3 better solution is to set variable
807 `delete-key-deletes-forward' to t. You can also change this with
808 Customize. Select from the `Options' menu
809 `Customize->Emacs->Editing->Basics->Delete Key Deletes Forward' or type
810 `M-x customize <RET> editing-basics <RET>'.
815 File: xemacs-faq.info, Node: Q3.5.10, Next: Q3.5.11, Prev: Q3.5.9, Up: Customization
817 Q3.5.10: Can I turn on "sticky" modifier keys?
818 ----------------------------------------------
820 Yes, with `(setq modifier-keys-are-sticky t)'. This will give the
821 effect of being able to press and release Shift and have the next
822 character typed come out in upper case. This will affect all the other
823 modifier keys like Control and Meta as well.
825 Ben Wing <ben@xemacs.org> writes:
827 One thing about the sticky modifiers is that if you move the mouse
828 out of the frame and back in, it cancels all currently "stuck"
832 File: xemacs-faq.info, Node: Q3.5.11, Next: Q3.6.1, Prev: Q3.5.10, Up: Customization
834 Q3.5.11: How do I map the arrow keys?
835 -------------------------------------
837 Say you want to map `C-<right>' to forward-word:
839 Sam Steingold <sds@usa.net> writes:
841 ; both XEmacs and Emacs
842 (define-key global-map [(control right)] 'forward-word)
845 (define-key global-map [C-right] 'forward-word)
848 (define-key global-map (kbd "C-<right>") 'forward-word)
851 File: xemacs-faq.info, Node: Q3.6.1, Next: Q3.6.2, Prev: Q3.5.11, Up: Customization
856 Q3.6.1: Is there a way to make the bar cursor thicker?
857 ------------------------------------------------------
859 I'd like to have the bar cursor a little thicker, as I tend to
862 For a 1 pixel bar cursor, use:
866 For a 2 pixel bar cursor, use:
868 (setq bar-cursor 'anything-else)
870 Starting with XEmacs-20.3 you can also change these with Customize.
871 Select from the `Options' menu
872 `Customize->Emacs->Environment->Display->Bar Cursor...' or type `M-x
873 customize <RET> display <RET>'.
875 You can use a color to make it stand out better:
877 Emacs*cursorColor: Red
880 File: xemacs-faq.info, Node: Q3.6.2, Next: Q3.6.3, Prev: Q3.6.1, Up: Customization
882 Q3.6.2: Is there a way to get back the block cursor?
883 ----------------------------------------------------
885 (setq bar-cursor nil)
887 Starting with XEmacs-20.3 you can also change this with Customize.
888 Select from the `Options' menu
889 `Customize->Emacs->Environment->Display->Bar Cursor...' or type `M-x
890 customize <RET> display <RET>'.
893 File: xemacs-faq.info, Node: Q3.6.3, Next: Q3.7.1, Prev: Q3.6.2, Up: Customization
895 Q3.6.3: Can I make the cursor blink?
896 ------------------------------------
898 If you are running a version of XEmacs older than 19.14, no.
899 Otherwise you can do the following:
903 This function toggles between a steady cursor and a blinking cursor.
904 You may also set this mode from the menu bar by selecting `Options =>
905 Frame Appearance => Blinking Cursor'. Remember to save options.
908 File: xemacs-faq.info, Node: Q3.7.1, Next: Q3.7.2, Prev: Q3.6.3, Up: Customization
910 3.7: The Mouse and Highlighting
911 ===============================
913 Q3.7.1: How can I turn off Mouse pasting?
914 -----------------------------------------
916 I keep hitting the middle mouse button by accident and getting stuff
917 pasted into my buffer so how can I turn this off?
919 Here is an alternative binding, whereby the middle mouse button
920 selects (but does not cut) the expression under the mouse. Clicking
921 middle on a left or right paren will select to the matching one. Note
922 that you can use `define-key' or `global-set-key'.
924 (defun mouse-set-point-and-select (event)
925 "Sets the point at the mouse location, then marks following form"
927 (mouse-set-point event)
929 (define-key global-map [button2] 'mouse-set-point-and-select)
932 File: xemacs-faq.info, Node: Q3.7.2, Next: Q3.7.3, Prev: Q3.7.1, Up: Customization
934 Q3.7.2: How do I set control/meta/etc modifiers on mouse buttons?
935 -----------------------------------------------------------------
937 Use, for instance, `[(meta button1)]'. For example, here is a common
938 setting for Common Lisp programmers who use the bundled `ilisp'
939 package, whereby meta-button1 on a function name will find the file
940 where the function name was defined, and put you at that location in
943 [Inside a function that gets called by the lisp-mode-hook and
946 (local-set-key [(meta button1)] 'edit-definitions-lisp)
949 File: xemacs-faq.info, Node: Q3.7.3, Next: Q3.7.4, Prev: Q3.7.2, Up: Customization
951 Q3.7.3: Clicking the left button does not do anything in buffer list.
952 ---------------------------------------------------------------------
954 I do `C-x C-b' to get a list of buffers and the entries get
955 highlighted when I move the mouse over them but clicking the left mouse
956 does not do anything.
958 Use the middle mouse button.
961 File: xemacs-faq.info, Node: Q3.7.4, Next: Q3.7.5, Prev: Q3.7.3, Up: Customization
963 Q3.7.4: How can I get a list of buffers when I hit mouse button 3?
964 ------------------------------------------------------------------
966 The following code will replace the default popup on button3:
968 (global-set-key [button3] 'popup-buffer-menu)
971 File: xemacs-faq.info, Node: Q3.7.5, Next: Q3.7.6, Prev: Q3.7.4, Up: Customization
973 Q3.7.5: Why does cut-and-paste not work between XEmacs and a cmdtool?
974 ---------------------------------------------------------------------
976 We don't know. It's a bug. There does seem to be a work-around,
977 however. Try running xclipboard first. It appears to fix the problem
978 even if you exit it. (This should be mostly fixed in 19.13, but we
979 haven't yet verified that).
982 File: xemacs-faq.info, Node: Q3.7.6, Next: Q3.7.7, Prev: Q3.7.5, Up: Customization
984 Q3.7.6: How I can set XEmacs up so that it pastes where the text cursor is?
985 ---------------------------------------------------------------------------
987 By default XEmacs pastes X selections where the mouse pointer is.
988 How do I disable this?
990 Examine the function `mouse-yank', by typing `C-h f mouse-yank
993 To get XEmacs to paste at the text cursor, add this your `.emacs':
995 (setq mouse-yank-at-point t)
997 Starting with XEmacs-20.2 you can also change this with Customize.
998 Select from the `Options' menu `Customize->Emacs->Editing->Mouse->Yank
999 At Point...' or type `M-x customize <RET> mouse <RET>'.
1002 File: xemacs-faq.info, Node: Q3.7.7, Next: Q3.7.8, Prev: Q3.7.6, Up: Customization
1004 Q3.7.7: How do I select a rectangular region?
1005 ---------------------------------------------
1007 Just select the region normally, then use the rectangle commands
1008 (e.g. `kill-rectangle' on it. The region does not highlight as a
1009 rectangle, but the commands work just fine.
1011 To actually sweep out rectangular regions with the mouse you can use
1012 `mouse-track-do-rectangle' which is assigned to `M-button1'. Then use
1015 You can also do the following to change default behavior to sweep out
1016 rectangular regions:
1018 (setq mouse-track-rectangle-p t)
1020 Starting with XEmacs-20.2 you can also change this with Customize.
1021 Select from the `Options' menu `Customize->Emacs->Editing->Mouse->Track
1022 Rectangle...' or type `M-x customize <RET> mouse <RET>'.
1024 mouse-track-do-rectangle: (event)
1025 -- an interactive compiled Lisp function.
1026 Like `mouse-track' but selects rectangles instead of regions.
1029 File: xemacs-faq.info, Node: Q3.7.8, Next: Q3.8.1, Prev: Q3.7.7, Up: Customization
1031 Q3.7.8: Why does `M-w' take so long?
1032 ------------------------------------
1034 It actually doesn't. It leaves the region visible for a second so
1035 that you can see what area is being yanked. If you start working,
1036 though, it will immediately complete its operation. In other words, it
1037 will only delay for a second if you let it.
1040 File: xemacs-faq.info, Node: Q3.8.1, Next: Q3.8.2, Prev: Q3.7.8, Up: Customization
1042 3.8: The Menubar and Toolbar
1043 ============================
1045 Q3.8.1: How do I get rid of the menu (or menubar)?
1046 --------------------------------------------------
1048 If you are running XEmacs 19.13 and earlier, add this command to your
1053 Starting with XEmacs 19.14 the preferred method is:
1055 (set-specifier menubar-visible-p nil)
1058 File: xemacs-faq.info, Node: Q3.8.2, Next: Q3.8.3, Prev: Q3.8.1, Up: Customization
1060 Q3.8.2: Can I customize the basic menubar?
1061 ------------------------------------------
1063 For an extensive menubar, add this line to your `.emacs':
1065 (load "big-menubar")
1067 If you'd like to write your own, this file provides as good a set of
1068 examples as any to start from. The file is located in
1069 `lisp/packages/big-menubar.el' in the XEmacs installation directory.
1072 File: xemacs-faq.info, Node: Q3.8.3, Next: Q3.8.4, Prev: Q3.8.2, Up: Customization
1074 Q3.8.3: How do I control how many buffers are listed in the menu `Buffers List'?
1075 --------------------------------------------------------------------------------
1077 Add the following to your `.emacs' (suit to fit):
1079 (setq buffers-menu-max-size 20)
1081 For no limit, use an argument of `nil'.
1083 Starting with XEmacs-20.3 you can also change this with Customize.
1084 Select from the `Options' menu
1085 `Customize->Emacs->Environment->Menu->Buffers Menu->Max Size...' or
1086 type `M-x customize <RET> buffers-menu <RET>'.
1089 File: xemacs-faq.info, Node: Q3.8.4, Next: Q3.8.5, Prev: Q3.8.3, Up: Customization
1091 Q3.8.4: Resources like `Emacs*menubar*font' are not working?
1092 ------------------------------------------------------------
1094 I am trying to use a resource like `Emacs*menubar*font' to set the
1095 font of the menubar but it's not working.
1097 If you are using the real Motif menubar, this resource is not
1098 recognized; you have to say:
1100 Emacs*menubar*fontList: FONT
1102 If you are using the Lucid menubar, the former resource will be
1103 recognized only if the latter resource is unset. This means that the
1110 Emacs*menubar*font: FONT
1112 even though the latter is more specific.
1115 File: xemacs-faq.info, Node: Q3.8.5, Next: Q3.9.1, Prev: Q3.8.4, Up: Customization
1117 Q3.8.5: How can I bind a key to a function to toggle the toolbar?
1118 -----------------------------------------------------------------
1122 (defun my-toggle-toolbar ()
1124 (set-specifier default-toolbar-visible-p
1125 (not (specifier-instance default-toolbar-visible-p))))
1126 (global-set-key "\C-xT" 'my-toggle-toolbar)
1128 There are redisplay bugs in 19.14 that may make the preceding result
1129 in a messed-up display, especially for frames with multiple windows.
1130 You may need to resize the frame before XEmacs completely realizes the
1131 toolbar is really gone.
1133 Thanks to Martin Buchholz <martin@xemacs.org> for the correct code.
1136 File: xemacs-faq.info, Node: Q3.9.1, Next: Q3.9.2, Prev: Q3.8.5, Up: Customization
1141 Q3.9.1: How can I disable the scrollbar?
1142 ----------------------------------------
1144 To disable them for all frames, add the following line to your
1147 Emacs.scrollBarWidth: 0
1149 Or select from the `Options' menu `Frame Appearance->Scrollbars'.
1150 Remember to save options.
1152 To turn the scrollbar off on a per-frame basis, use the following
1155 (set-specifier scrollbar-width 0 (selected-frame))
1157 You can actually turn the scrollbars on at any level you want by
1158 substituting for (selected-frame) in the above command. For example, to
1159 turn the scrollbars off only in a single buffer:
1161 (set-specifier scrollbar-width 0 (current-buffer))
1163 In XEmacs versions prior to 19.14, you had to use the hairier
1166 (set-specifier scrollbar-width (cons (selected-frame) 0))
1169 File: xemacs-faq.info, Node: Q3.9.2, Next: Q3.9.3, Prev: Q3.9.1, Up: Customization
1171 Q3.9.2: How can one use resources to change scrollbar colors?
1172 -------------------------------------------------------------
1174 Here's a recap of how to use resources to change your scrollbar
1179 Emacs*XmScrollBar.Background: skyblue
1180 Emacs*XmScrollBar.troughColor: lightgray
1184 Emacs*Scrollbar.Foreground: skyblue
1185 Emacs*Scrollbar.Background: lightgray
1187 Note the capitalization of `Scrollbar' for the Athena widget.
1190 File: xemacs-faq.info, Node: Q3.9.3, Next: Q3.9.4, Prev: Q3.9.2, Up: Customization
1192 Q3.9.3: Moving the scrollbar can move the point; can I disable this?
1193 --------------------------------------------------------------------
1195 When I move the scrollbar in an XEmacs window, it moves the point as
1196 well, which should not be the default behavior. Is this a bug or a
1197 feature? Can I disable it?
1199 The current behavior is a feature, not a bug. Point remains at the
1200 same buffer position as long as that position does not scroll off the
1201 screen. In that event, point will end up in either the upper-left or
1202 lower-left hand corner.
1204 This cannot be changed.
1207 File: xemacs-faq.info, Node: Q3.9.4, Next: Q3.10.1, Prev: Q3.9.3, Up: Customization
1209 Q3.9.4: How can I get automatic horizontal scrolling?
1210 -----------------------------------------------------
1212 By the same token, how can I turn it off in specific modes?
1214 To do this, add to your `.emacs' file:
1216 (require 'auto-show)
1218 Then do `(setq truncate-lines t)' in the mode-hooks for any modes in
1219 which you want lines truncated.
1221 More precisely: If `truncate-lines' is nil, horizontal scrollbars
1222 will never appear. Otherwise, they will appear only if the value of
1223 `scrollbar-height' for that buffer/window/etc. is non-zero. If you do
1225 (set-specifier scrollbar-height 0)
1227 then horizontal scrollbars will not appear in truncated buffers
1228 unless the package specifically asked for them.
1230 Automatic horizontal scrolling is now standard, starting with 19.14.
1233 File: xemacs-faq.info, Node: Q3.10.1, Next: Q3.10.2, Prev: Q3.9.4, Up: Customization
1235 3.10: Text Selections
1236 =====================
1238 Q3.10.1: How can I turn off or change highlighted selections?
1239 -------------------------------------------------------------
1241 The `zmacs' mode allows for what some might call gratuitous
1242 highlighting for selected regions (either by setting mark or by using
1243 the mouse). This is the default behavior. To turn off, add the
1244 following line to your `.emacs' file:
1246 (setq zmacs-regions nil)
1248 Starting with XEmacs-20.2 you can also change this with Customize.
1249 Select from the `Options' menu `Customize->Emacs->Editing->Basics->Zmacs
1250 Regions' or type `M-x customize <RET> editing-basics <RET>'.
1252 To change the face for selection, look at `Options->Customize' on
1256 File: xemacs-faq.info, Node: Q3.10.2, Next: Q3.10.3, Prev: Q3.10.1, Up: Customization
1258 Q3.10.2: How do I get that typing on an active region removes it?
1259 -----------------------------------------------------------------
1261 I want to change things so that if I select some text and start
1262 typing, the typed text replaces the selected text, similar to Motif.
1264 You want to use something called "pending delete". Pending delete
1265 is what happens when you select a region (with the mouse or keyboard)
1266 and you press a key to replace the selected region by the key you typed.
1267 Usually backspace kills the selected region.
1269 To get this behavior, add the following lines to your `.emacs':
1272 ((fboundp 'turn-on-pending-delete)
1273 (turn-on-pending-delete))
1274 ((fboundp 'pending-delete-on)
1275 (pending-delete-on t)))
1277 Note that this will work with both Backspace and Delete. This code
1278 is a tad more complicated than it has to be for XEmacs in order to make
1282 File: xemacs-faq.info, Node: Q3.10.3, Next: Q3.10.4, Prev: Q3.10.2, Up: Customization
1284 Q3.10.3: Can I turn off the highlight during isearch?
1285 -----------------------------------------------------
1287 I do not like my text highlighted while I am doing isearch as I am
1288 not able to see what's underneath. How do I turn it off?
1290 Put the following in your `.emacs':
1292 (setq isearch-highlight nil)
1294 Starting with XEmacs-20.2 you can also change this with Customize.
1295 Type `M-x customize-variable <RET> isearch-highlight <RET>'.
1297 Note also that isearch-highlight affects query-replace and ispell.
1298 Instead of disabling isearch-highlight you may find that a better
1299 solution consists of customizing the `isearch' face.
1302 File: xemacs-faq.info, Node: Q3.10.4, Next: Q3.10.5, Prev: Q3.10.3, Up: Customization
1304 Q3.10.4: How do I turn off highlighting after `C-x C-p' (mark-page)?
1305 --------------------------------------------------------------------
1307 Put this in your `.emacs':
1309 (setq zmacs-regions nil)
1311 *Warning: This command turns off all region highlighting.*
1313 Also *Note Q3.10.1::.
1316 File: xemacs-faq.info, Node: Q3.10.5, Prev: Q3.10.4, Up: Customization
1318 Q3.10.5: The region disappears when I hit the end of buffer while scrolling.
1319 ----------------------------------------------------------------------------
1321 This has been fixed by default starting with XEmacs-20.3.
1323 With older versions you can turn this feature (if it indeed is a
1324 feature) off like this:
1326 (defadvice scroll-up (around scroll-up freeze)
1328 (let ((zmacs-region-stays t))
1332 (end-of-buffer (goto-char (point-max))))
1335 (defadvice scroll-down (around scroll-down freeze)
1337 (let ((zmacs-region-stays t))
1341 (beginning-of-buffer (goto-char (point-min))))
1344 Thanks to T. V. Raman <raman@adobe.com> for assistance in deriving
1348 File: xemacs-faq.info, Node: Subsystems, Next: Miscellaneous, Prev: Customization, Up: Top
1353 This is part 4 of the XEmacs Frequently Asked Questions list. This
1354 section is devoted to major XEmacs subsystems.
1358 Reading Mail with VM:
1359 * Q4.0.1:: How do I set up VM to retrieve remote mail using POP?
1360 * Q4.0.2:: How do I get VM to filter mail for me?
1361 * Q4.0.3:: How can I get VM to automatically check for new mail?
1362 * Q4.0.4:: [This question intentionally left blank]
1363 * Q4.0.5:: How do I get my outgoing mail archived?
1364 * 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"?
1365 * Q4.0.7:: Is there a mailing list or FAQ for VM?
1366 * Q4.0.8:: Remote mail reading with VM.
1367 * Q4.0.9:: rmail or VM gets an error incorporating new mail.
1368 * Q4.0.10:: How do I make VM stay in a single frame?
1369 * Q4.0.11:: How do I make VM or mh-e display graphical smilies?
1370 * Q4.0.12:: Customization of VM not covered in the manual or here.
1372 Web browsing with W3:
1373 * Q4.1.1:: What is W3?
1374 * Q4.1.2:: How do I run W3 from behind a firewall?
1375 * Q4.1.3:: Is it true that W3 supports style sheets and tables?
1377 Reading Netnews and Mail with Gnus:
1378 * Q4.2.1:: GNUS, (ding) Gnus, Gnus 5, September Gnus, Red Gnus,argh!
1379 * Q4.2.2:: [This question intentionally left blank]
1380 * Q4.2.3:: How do I make Gnus stay within a single frame?
1381 * Q4.2.4:: How do I customize the From: line?
1384 * Q4.3.1:: How can I read and/or compose MIME messages?
1385 * Q4.3.2:: What is TM and where do I get it?
1386 * Q4.3.3:: Why isn't this `movemail' program working?
1387 * Q4.3.4:: Movemail is also distributed by Netscape? Can that cause problems?
1388 * Q4.3.5:: Where do I find pstogif (required by tm)?
1390 Sparcworks, EOS, and WorkShop:
1391 * Q4.4.1:: What is SPARCworks, EOS, and WorkShop
1392 * Q4.4.2:: How do I start the Sun Workshop support in XEmacs 21?
1395 * Q4.5.1:: What is/was Energize?
1398 * Q4.6.1:: What is Infodock?
1400 Other Unbundled Packages:
1401 * Q4.7.1:: What is AUC TeX? Where do you get it?
1402 * Q4.7.2:: Are there any Emacs Lisp Spreadsheets?
1403 * Q4.7.3:: [This question intentionally left blank]
1404 * Q4.7.4:: Problems installing AUC TeX
1405 * Q4.7.5:: Is there a reason for an Emacs package not to be included in XEmacs?
1406 * Q4.7.6:: Is there a MatLab mode?
1409 File: xemacs-faq.info, Node: Q4.0.1, Next: Q4.0.2, Prev: Subsystems, Up: Subsystems
1411 4.0: Reading Mail with VM
1412 =========================
1414 Q4.0.1: How do I set up VM to retrieve mail from a remote site using POP?
1415 -------------------------------------------------------------------------
1417 Use `vm-spool-files', like this for example:
1419 (setq vm-spool-files '("/var/spool/mail/wing"
1420 "netcom23.netcom.com:110:pass:wing:MYPASS"))
1422 Of course substitute your actual password for MYPASS.