This is Info file ../info/xemacs-faq.info, produced by Makeinfo-1.63
from the input file xemacs-faq.texi.


File: xemacs-faq.info,  Node: 10. The mouse; cutting and pasting,  Next: 11. Highlighting,  Prev: 9. The cursor,  Up: Top

10. The mouse; cutting and pasting
**********************************

* Menu:

* 10.1.::          10.1. I keep hitting the middle mouse button by accident and getting stuff pasted into my buffer so how can I turn this off?
* 10.2.::          10.2. How do I set control/meta/etc modifiers on mouse buttons?
* 10.3.::          10.3. I do "^x ^b" to get a list of buffers and the entries get highlighted when I move the mouse over them but clicking the left mouse does not do anything.
* 10.4.::          10.4. How can I get a list of buffers to popup when I hit button 3 on the mouse?
* 10.5.::          10.5. Why does cut-and-paste not work between XEmacs and a cmdtool?
* 10.6.::          10.6. How I can set XEmacs up so that it pastes where the cursor is _not_ where the pointer lies?
* 10.7.::          10.7. How do I select a rectangular region?
* 10.8.::          10.8. Why does M-w take so long?


File: xemacs-faq.info,  Node: 10.1.,  Next: 10.2.,  Up: 10. The mouse; cutting and pasting

10.1. I keep hitting the middle mouse button by accident and getting stuff pasted into my buffer so how can I turn this off?
============================================================================================================================

   Here is an alternative binding, whereby the middle mouse button
selects (but does not cut) the expression under the mouse. Clicking
middle on a left or right paren will select to the matching one.  Note
that you can use `define-key' or `global-set-key'.

     (defun Mouse-Set-Point-and-Select (event)
       "Sets the point at the mouse location, then marks following form"
       (interactive "@e")
       (mouse-set-point event)
       (mark-sexp 1)
       )
     (define-key global-map 'button2 'Mouse-Set-Point-and-Select)

   (Editor's Note - there is a problem with texinfo/text/html
conversion, so the double at-sign should only be a single, above.  I'll
fix it one of these days - AJR)


File: xemacs-faq.info,  Node: 10.2.,  Next: 10.3.,  Prev: 10.1.,  Up: 10. The mouse; cutting and pasting

10.2. How do I set control/meta/etc modifiers on mouse buttons?
===============================================================

   Use, for instance, `[(meta button1)]'. For example, here is a common
setting for Common Lisp programmers who use the bundled ilisp package,
whereby meta-button1 on a function name will find the file where the
function name was defined, and put you at that location in the source
file.

   [Inside a function that gets called by the lisp-mode-hook and
ilisp-mode-hook]
     (local-set-key [(meta button1)] 'edit-definitions-lisp)


File: xemacs-faq.info,  Node: 10.3.,  Next: 10.4.,  Prev: 10.2.,  Up: 10. The mouse; cutting and pasting

10.3. I do "^x ^b" to get a list of buffers and the entries get highlighted when I move the mouse over them but clicking the left mouse does not do anything.
=============================================================================================================================================================

   Use the middle mouse button.


File: xemacs-faq.info,  Node: 10.4.,  Next: 10.5.,  Prev: 10.3.,  Up: 10. The mouse; cutting and pasting

10.4. How can I get a list of buffers to popup when I hit button 3 on the mouse?
================================================================================

   The following code will actually replace the default popup on
button3:

     (defun cw-build-buffers ()
       "Popup buffer menu."
       (interactive "@")
       (run-hooks 'activate-menubar-hook)
       (popup-menu (car (find-menu-item current-menubar '("Buffers")))))
     
     (define-key global-map [(button3)] 'cw-build-buffers)

   (Editor's Note - there is a problem with texinfo/text/html
conversion, so the double at-sign should only be a single, above.  I'll
fix it one of these days - AJR)


File: xemacs-faq.info,  Node: 10.5.,  Next: 10.6.,  Prev: 10.4.,  Up: 10. The mouse; cutting and pasting

10.5. Why does cut-and-paste not work between XEmacs and a cmdtool?
===================================================================

   We don't know.  It's a bug.  There does seem to be a work-around,
however.  Try running xclipboard first.  It appears to fix the problem
even if you exit it.  (This should be mostly fixed in 19.13, but we
haven't yet verified that).


File: xemacs-faq.info,  Node: 10.6.,  Next: 10.7.,  Prev: 10.5.,  Up: 10. The mouse; cutting and pasting

10.6.  How I can set XEmacs up so that it pastes where the cursor is _not_ where the pointer lies?
==================================================================================================

   Try adding the following to your `.emacs':

     (define-key global-map 'button2 'x-insert-selection)

   This comes from the `sample.emacs' file in `etc/', which has lots of
goodies.


File: xemacs-faq.info,  Node: 10.7.,  Next: 10.8.,  Prev: 10.6.,  Up: 10. The mouse; cutting and pasting

10.7. How do I select a rectangular region?
===========================================

   Just select the region normally, then use the rectangle commands
(e.g.  `kill-rectangle') on it.  The region does not highlight as a
rectangle, but the commands work just fine.

   To actually sweep out rectangular regions with the mouse do the
following:

     (setq mouse-track-rectangle-p t)


File: xemacs-faq.info,  Node: 10.8.,  Prev: 10.7.,  Up: 10. The mouse; cutting and pasting

10.8. Why does M-w take so long?
================================

   It actually doesn't.  It leaves the region visible for a second so
that you can see what area is being yanked.  If you start working,
though, it will immediately complete its operation.  In other words, it
will only delay for a second if you let it.


File: xemacs-faq.info,  Node: 11. Highlighting,  Next: 12. The menubar and toolbar,  Prev: 10. The mouse; cutting and pasting,  Up: Top

11. Highlighting
****************

* Menu:

* 11.1.::          11.1. How can I highlight selections?
* 11.2.::          11.2. How do I get a pending-delete type of behavior?
* 11.3.::          11.3. I do not like my text highlighted while I am doing isearch as I am not able to see whats underneath.  How do I turn it off?
* 11.4.::          11.4. The text gets highlighted when I do C-x C-p (mark-page).  Is there a way to turn this feature off?


File: xemacs-faq.info,  Node: 11.1.,  Next: 11.2.,  Up: 11. Highlighting

11.1. How can I highlight selections?
=====================================

   Use zmacs mode.  This mode allows for what some might call gratuitous
highlighting for selected regions (either by setting mark or by using
the mouse).  To use, add the following line to your `.emacs' file:

     (setq zmacs-regions t)

   This is the default behavior.


File: xemacs-faq.info,  Node: 11.2.,  Next: 11.3.,  Prev: 11.1.,  Up: 11. Highlighting

11.2. How do I get a pending-delete type of behavior?
=====================================================

   "Pending delete" is what happens when you select a region (with the
mouse or keyboard) and you press a key to replace the selected region by
the key you typed.  Usually backspace kills the selected region.

   To get this behavior, add the following line to your `.emacs' file:

     (require 'pending-del)


File: xemacs-faq.info,  Node: 11.3.,  Next: 11.4.,  Prev: 11.2.,  Up: 11. Highlighting

11.3. I do not like my text highlighted while I am doing isearch as I am not able to see whats underneath.  How do I turn it off?
=================================================================================================================================

     (setq isearch-highlight nil)

   Note also that isearch-highlight affects query-replace and ispell.
Instead of disabling isearch-highlight you may find that a better
solution consists of customizing the 'isearch' face.


File: xemacs-faq.info,  Node: 11.4.,  Prev: 11.3.,  Up: 11. Highlighting

11.4. The text gets highlighted when I do C-x C-p (mark-page).  Is there a way to turn this feature off?
========================================================================================================

     (setq zmacs-regions nil)


File: xemacs-faq.info,  Node: 12. The menubar and toolbar,  Next: 13. Scrollbars,  Prev: 11. Highlighting,  Up: Top

12. The menubar and toolbar
***************************

* Menu:

* 12.1.::          12.1. How do I get rid of the menu (or menubar) ?
* 12.2.::          12.2. Can I customize the basic menubar?
* 12.3.::          12.3. What controls how many buffers are listed in the menu "Buffers" list?
* 12.4.::          12.4. I am trying to use a resource like `Emacs*menubar*font' to set the font of the menubar but it's not working.


File: xemacs-faq.info,  Node: 12.1.,  Next: 12.2.,  Up: 12. The menubar and toolbar

12.1. How do I get rid of the menu (or menubar) ?
=================================================

   Answer: To get rid of the menubar, add to `.emacs':

     (set-menubar nil)


File: xemacs-faq.info,  Node: 12.2.,  Next: 12.3.,  Prev: 12.1.,  Up: 12. The menubar and toolbar

12.2. Can I customize the basic menubar?
========================================

   For an extensive menubar, add the line

     (load "big-menubar")

   to your `.emacs' file.  If you'd like to write your own, this file
provides a good set of examples to start from:

     lisp/packages/big-menubar.el

   (starting from your system XEmacs installation directory).


File: xemacs-faq.info,  Node: 12.3.,  Next: 12.4.,  Prev: 12.2.,  Up: 12. The menubar and toolbar

12.3. What controls how many buffers are listed in the menu "Buffers" list?
===========================================================================

   Add the following to your `.emacs', modified as needed:

     (setq buffers-menu-max-size 20)

   If you do not want a limit, try

     (setq buffers-menu-max-size nil)


File: xemacs-faq.info,  Node: 12.4.,  Prev: 12.3.,  Up: 12. The menubar and toolbar

12.4. I am trying to use a resource like `Emacs*menubar*font' to set the font of the menubar but it's not working.
==================================================================================================================

   If you are using the real Motif menubar, this resource is not
recognized; you have to say

     Emacs*menubar*fontList: FONT

   If you are using the Lucid menubar, the former resource will be
recognized only if the latter resource is unset.  This means that the
resource

     *fontList: FONT

   will override

     Emacs*menubar*font: FONT

   even though the latter is more specific.


File: xemacs-faq.info,  Node: 13. Scrollbars,  Next: 14. Frame Geometry,  Prev: 12. The menubar and toolbar,  Up: Top

13. Scrollbars
**************

* Menu:

* 13.1.::          13.1. How can I disable the scrollbar?
* 13.2.::          13.2. How can one use resources to change scrollbar colors?
* 13.3.::          13.3. When I move the scrollbar in an XEmacs window, it moves the point as well, which should not be the default behavior.  Is this a bug or a feature?  Can I disable it?


File: xemacs-faq.info,  Node: 13.1.,  Next: 13.2.,  Up: 13. Scrollbars

13.1. How can I disable the scrollbar?
======================================

   To turn disable them for all frames, add the following line to your
`.Xdefaults':

     Emacs.scrollBarWidth:  0

   To turn the scrollbar off on a per-frame basis, use the following
function:

     (set-specifier scrollbar-width (cons (selected-frame) 0))

   You can actually turn the scrollbars on at any level you want by
substituting for (selected-frame) in the above command.  For example, to
turn the scrollbars off only in a single buffer:

     (set-specifier scrollbar-width (cons (current-buffer) 0))


File: xemacs-faq.info,  Node: 13.2.,  Next: 13.3.,  Prev: 13.1.,  Up: 13. Scrollbars

13.2. How can one use resources to change scrollbar colors?
===========================================================

   Here's a recap of how to use resources to change your scrollbar
colors:

     ! Motif scrollbars
     
     Emacs*XmScrollBar.Background: skyblue
     Emacs*XmScrollBar.troughColor: lightgray
     
     ! Athena scrollbars
     
     Emacs*Scrollbar.Foreground: skyblue
     Emacs*Scrollbar.Background: lightgray

   Note the capitalization of `Scrollbar' for the Athena widget.


File: xemacs-faq.info,  Node: 13.3.,  Prev: 13.2.,  Up: 13. Scrollbars

13.3. When I move the scrollbar in an XEmacs window, it moves the point as well, which should not be the default behavior.  Is this a bug or a feature?  Can I disable it?
==========================================================================================================================================================================

   The current behavior is a feature, not a bug.  Point remains at the
same buffer position as long as that position does not scroll off the
screen.  In that event, point will end up in either the upper-left or
lower-left hand corner.


File: xemacs-faq.info,  Node: 14. Frame Geometry,  Next: 15. Window/icon title; window manager problems,  Prev: 13. Scrollbars,  Up: Top

14. Frame Geometry
******************

* Menu:

* 14.1.::          14.1. In Lucid Emacs 19.6 I did `(set-screen-width CHARACTERS)' and `(set-screen-height LINES)' in my `.emacs' instead of specifying `Emacs*EmacsScreen.geometry' in my `.Xdefaults' but this does not work in XEmacs 19.13.
* 14.2.::          14.2. In XEmacs 19.11 I specified `Emacs*EmacsScreen.geometry' in my `.emacs' but this does not work in XEmacs 19.13.


File: xemacs-faq.info,  Node: 14.1.,  Next: 14.2.,  Up: 14. Frame Geometry

14.1. In Lucid Emacs 19.6 I did `(set-screen-width CHARACTERS)' and `(set-screen-height LINES)' in my `.emacs' instead of specifying `Emacs*EmacsScreen.geometry' in my `.Xdefaults' but this does not work in XEmacs 19.13.
============================================================================================================================================================================================================================

   These two functions now take frame arguments:

     (set-frame-width (selected-frame) CHARACTERS)
     (set-frame-height (selected-frame) LINES)


File: xemacs-faq.info,  Node: 14.2.,  Prev: 14.1.,  Up: 14. Frame Geometry

14.2. In XEmacs 19.11 I specified `Emacs*EmacsScreen.geometry' in my `.emacs' but this does not work in XEmacs 19.13.
=====================================================================================================================

   We have switched from using the term 'screen' to using the term
'frame'.  The correct entry for your `.Xdefaults' is now:

     Emacs*EmacsFrame.geometry


File: xemacs-faq.info,  Node: 15. Window/icon title; window manager problems,  Next: 16. Editing source code (C mode; Lisp mode; etc.),  Prev: 14. Frame Geometry,  Up: Top

15. Window/icon title; window manager problems
**********************************************

* Menu:

* 15.1.::          15.1. How can I get the icon to just say `XEmacs' and not include the name of the current file in it?
* 15.2.::          15.2. How can I have the window title area display the full directory/name of the current buffer file and not just the name?
* 15.3.::          15.3. When I run `xterm -name junk' I get an xterm whose class name according to xprop, is `junk'.  This is the way it's supposed to work, I think.  When I run `xemacs -name junk' the class name is not set to `junk'.  It's still `emacs'.  What does `xemacs -name' really do?  The reason I ask is that my window manager (fvwm) will make a window sticky and I use XEmacs to read my mail.  I want that XEmacs window to be sticky, without having to use the window manager's function to set the window sticky.  What gives?


File: xemacs-faq.info,  Node: 15.1.,  Next: 15.2.,  Up: 15. Window/icon title; window manager problems

15.1. How can I get the icon to just say `XEmacs' and not include the name of the current file in it?
=====================================================================================================

   Add the following line to your `.emacs' file:

     (setq frame-icon-title-format "XEmacs")


File: xemacs-faq.info,  Node: 15.2.,  Next: 15.3.,  Prev: 15.1.,  Up: 15. Window/icon title; window manager problems

15.2. How can I have the window title area display the full directory/name of the current buffer file and not just the name?
============================================================================================================================

   Add the following line to your `.emacs' file:

     (setq frame-title-format "%S: %f")
   A more sophisticated title might be:

     (setq frame-title-format
       '("%S: " (buffer-file-name "%f" (dired-directory dired-directory "%b"))))

   That is, use the file name, or the dired-directory, or the buffer
name.


File: xemacs-faq.info,  Node: 15.3.,  Prev: 15.2.,  Up: 15. Window/icon title; window manager problems

15.3. When I run `xterm -name junk' I get an xterm whose class name according to xprop, is `junk'.  This is the way it's supposed to work, I think.  When I run `xemacs -name junk' the class name is not set to `junk'.  It's still `emacs'.  What does `xemacs -name' really do?  The reason I ask is that my window manager (fvwm) will make a window sticky and I use XEmacs to read my mail.  I want that XEmacs window to be sticky, without having to use the window manager's function to set the window sticky.  What gives?
=====================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================

   `xemacs -name' sets the application-name for the program (that is,
the thing which normally comes from `argv[0]'.)  Using `-name' is the
same as making a copy of the executable with that new name.  The
WM_CLASS property on each frame is set to the frame-name, and the
application-class.  So, if you did `xemacs -name FOO' and then created
a frame named `BAR', you'd get an X window with WM_CLASS = `( "BAR",
"Emacs")'.  However, the resource hierarchy for this widget would be

     Name:    FOO  .shell.       .pane        .BAR
     Class:   Emacs.TopLevelShell.XmMainWindow.EmacsFrame

   instead of the default

     Name:    xemacs.shell.       .pane        .emacs
     Class:   Emacs .TopLevelShell.XmMainWindow.EmacsFrame

   It is arguable that the first element of WM_CLASS should be set to
the application-name instead of the frame-name, but I think that's less
flexible, since it does not give you the ability to have multiple
frames with different WM_CLASS properties.  Another possibility would
be for the default frame name to come from the application name instead
of simply being `emacs'.  However, at this point, making that change
would be troublesome: it would mean that many users would have to make
yet another change to their resource files (since the default frame
name would suddenly change from `emacs' to `xemacs', or whatever the
executable happened to be named), so we'd rather avoid it.

   To make a frame with a particular name use:

     (make-frame '((name . "the-name")))


File: xemacs-faq.info,  Node: 16. Editing source code (C mode; Lisp mode; etc.),  Next: 17. Text mode,  Prev: 15. Window/icon title; window manager problems,  Up: Top

16. Editing source code (C mode; Lisp mode; etc.)
*************************************************

* Menu:

* 16.1.::          16.1. How can I do source code highlighting using font-lock?
* 16.2.::          16.2. How do you arrange it so that XEmacs indents all the clauses of a Common Lisp `if' the same amount instead of indenting the 3rd clause differently from the first two?
* 16.3.::          16.3. I do not like cc-mode.  How do I use the old c-mode?
* 16.4.::          16.4. When I try to edit a postscript file it gets stuck saying:  fontifying 'filename' (regexps....) and it just sits there. If I press ctrl-c in the window where XEmacs was started, it suddenly becomes alive again.
* 16.5.::          16.5.  Does anyone know how to get the "More" Syntax Highlighting on by default?


File: xemacs-faq.info,  Node: 16.1.,  Next: 16.2.,  Up: 16. Editing source code (C mode; Lisp mode; etc.)

16.1. How can I do source code highlighting using font-lock?
============================================================

   For most modes, font-lock is already set up and just needs to be
turned on.  This can be done by

     M-x font-lock-mode

   or by having XEmacs automatically start it by adding lines like

     (add-hook 'emacs-lisp-mode-hook	'turn-on-font-lock)
     (add-hook 'dired-mode-hook	'turn-on-font-lock)

   to your `.emacs'.  See the file `etc/sample.emacs' for more examples.


File: xemacs-faq.info,  Node: 16.2.,  Next: 16.3.,  Prev: 16.1.,  Up: 16. Editing source code (C mode; Lisp mode; etc.)

16.2. How do you arrange it so that XEmacs indents all the clauses of a Common Lisp `if' the same amount instead of indenting the 3rd clause differently from the first two?
============================================================================================================================================================================

   One way is to add, to `.emacs':

     (put 'if 'lisp-indent-function nil)

   However, note that the package `cl-indent.el' that comes with XEmacs
sets up this kind of indentation by default.  `cl-indent' also knows
about many other CL-specific forms.  To use `cl-indent', one can do
this:

     (load "cl-indent")
     (setq lisp-indent-function (function common-lisp-indent-function))

   One can also customize `cl-indent.el' so it mimics the default `if'
indentation (`then' indented more than the `else'). Here's how:

     (put 'if 'common-lisp-indent-function '(nil nil &body))

   Also, a new version (1.2) of `cl-indent.el' was posted to
`comp.emacs.xemacs' on 12/9/94. This version includes more
documentation than previous versions.  This may prove useful if you
need to customize any indent-functions.  The post can be retrieved by
searching the XEmacs mail archives.


File: xemacs-faq.info,  Node: 16.3.,  Next: 16.4.,  Prev: 16.2.,  Up: 16. Editing source code (C mode; Lisp mode; etc.)

16.3. I do not like cc-mode.  How do I use the old c-mode?
==========================================================

   Well, first off, consider if you really want to do this.  cc-mode is
much more powerful than the old c-mode.  But if you still insist, add
the following lines to your `.emacs':

     (fmakunbound 'c-mode)
     (makunbound 'c-mode-map)
     (fmakunbound 'c++-mode)
     (makunbound 'c++-mode-map)
     (makunbound 'c-style-alist)
     (load-library "old-c-mode")
     (load-library "old-c++-mode")

   This must be done before any other reference is made to either c-mode
or c++-mode.


File: xemacs-faq.info,  Node: 16.4.,  Next: 16.5.,  Prev: 16.3.,  Up: 16. Editing source code (C mode; Lisp mode; etc.)

16.4. When I try to edit a postscript file it gets stuck saying:  fontifying 'filename' (regexps....) and it just sits there. If I press ctrl-c in the window where XEmacs was started, it suddenly becomes alive again.
========================================================================================================================================================================================================================

   This was caused by a bug in the Postscript font-lock regular
expressions.  It should be fixed in 19.13.  For earlier versions of
XEmacs, have a look at your `.emacs' file.  You will probably have a
line like:

     (add-hook 'postscript-mode-hook	'turn-on-font-lock)

   Take it out, restart XEmacs, and it won't try to fontify your
postscript files anymore.


File: xemacs-faq.info,  Node: 16.5.,  Prev: 16.4.,  Up: 16. Editing source code (C mode; Lisp mode; etc.)

16.5.  Does anyone know how to get the "More" Syntax Highlighting on by default?
================================================================================

   For C, C++, and Lisp, you can try adding the following to your
`.emacs' file:

     (setq c-font-lock-keywords c-font-lock-keywords-2)
     (setq c++-font-lock-keywords c++-font-lock-keywords-2)
     (setq lisp-font-lock-keywords lisp-font-lock-keywords-2)


File: xemacs-faq.info,  Node: 17. Text mode,  Next: 18. Shell mode,  Prev: 16. Editing source code (C mode; Lisp mode; etc.),  Up: Top

17. Text mode
*************

* Menu:

* 17.1.::          17.1. How can I enable auto-indent?
* 17.2.::          17.2. How can I get XEmacs to come up in text mode (auto-fill) by default?


File: xemacs-faq.info,  Node: 17.1.,  Next: 17.2.,  Up: 17. Text mode

17.1. How can I enable auto-indent?
===================================

   Put the following line in your `.emacs'.

     (setq indent-line-function 'indent-relative-maybe)

   If you want to get fancy, try `filladapt' and `fa-extras', available
from the Emacs Lisp Archive at Ohio State University.

   Get them at URL:

     ftp://archive.cis.ohio-state.edu/pub/gnu/emacs/elisp-archive/packages


File: xemacs-faq.info,  Node: 17.2.,  Prev: 17.1.,  Up: 17. Text mode

17.2. How can I get XEmacs to come up in text mode (auto-fill) by default?
==========================================================================

   Try the following lisp in your `.emacs' file

     (setq default-major-mode 'text-mode)
     (setq text-mode-hook 'turn-on-auto-fill)

   WARNING: note that changing default-major-mode from fundamental-mode
can break a large amount of built-in code that expects newly created
buffers to be in fundamental-mode.  (Changing from fundamental-mode to
auto-fill text-mode might not wreak too much havoc, but changing to
something more exotic like a lisp-mode would break many Emacs packages.

   Note that Emacs defaultly starts up in buffer *scratch* in
initial-major-mode, which defaults to lisp-interaction-mode. Thus
adding the following form to your Emacs init file will cause the
initial *scratch* buffer to be put into auto-fill'ed text-mode.

     (setq initial-major-mode
           (function (lambda ()
             (text-mode)
             (turn-on-auto-fill))))

   Note that after your init file is loaded, if inhibit-startup-message
is null (the default) and the startup buffer is *scratch* then the
startup message will be inserted into *scratch*; it will be removed
after a timeout by erasing the entire *scratch* buffer. Keep in mind
this default usage of *scratch* if you desire any prior manipulation of
*scratch* from within your Emacs init file. In particular, anything you
insert into *scratch* from your init file will be later erased.  Also,
if you change the mode of *scratch* be sure that this will not
interfere with possible later insertion of the startup message (e.g. if
you put *scratch* into a nonstandard mode that has automatic font lock
rules, then the startup message might get fontified in a strange
foreign manner, e.g. as code in some programming language).


File: xemacs-faq.info,  Node: 18. Shell mode,  Next: 19. Mail; VM; GNUS; BBDB; and related,  Prev: 17. Text mode,  Up: Top

18. Shell mode
**************

* Menu:

* 18.1.::          18.1. How do I start up a second shell buffer?
* 18.2.::          18.2. I'm using the Emacs `M-x shell' function, and I would like to invoke and use a telnet session within it.  Everything works fine except that now all ^M's are filtered out by Emacs.  Fixes?
* 18.3.::          18.3. If I type a very long command line (like a compile command) into a shell buffer, the output seems to be messed up.


File: xemacs-faq.info,  Node: 18.1.,  Next: 18.2.,  Up: 18. Shell mode

18.1. How do I start up a second shell buffer?
==============================================

   In the *shell* buffer:

     M-x rename-buffer RET *shell-1* RET
     M-x shell RET

   This will then start a second shell.  The key is that no buffer named
*shell* can exist.  It might be preferable to use `M-x rename-uniquely'
to rename the *shell* buffer instead of `M-x rename-buffer'.


File: xemacs-faq.info,  Node: 18.2.,  Next: 18.3.,  Prev: 18.1.,  Up: 18. Shell mode

18.2. I'm using the Emacs `M-x shell' function, and I would like to invoke and use a telnet session within it.  Everything works fine except that now all ^M's are filtered out by Emacs.  Fixes?
=================================================================================================================================================================================================

   Use `M-x rsh' or `M-x telnet' to open remote sessions rather than
doing rsh or telnet within the local shell buffer.


File: xemacs-faq.info,  Node: 18.3.,  Prev: 18.2.,  Up: 18. Shell mode

18.3. If I type a very long command line (like a compile command) into a shell buffer, the output seems to be messed up.
========================================================================================================================

   If you see lots of ^G's in the buffer, you're using an old version of
XEmacs.  If the command line seems to be delayed or split into pieces,
you are probably using csh with the `filec' variable set.  To fix this,
add the following line to your `.cshrc', after `filec' is set:

     if ( "$TERM" == emacs || "$TERM" == unknown ) unset filec


File: xemacs-faq.info,  Node: 19. Mail; VM; GNUS; BBDB; and related,  Next: 20. Printing,  Prev: 18. Shell mode,  Up: Top

19. Mail; VM; GNUS; BBDB; and related
*************************************

* Menu:

* 19.1.::          19.1. How and where I am suppose to set the face attributes for customizing the appearance of messages (i.e. for VM)?
* 19.2.::          19.2. I seem to have heard that there's a package distributed with XEmacs which will use the echo area to notify you of incoming mail in a rather configurable way (multiple spool files, different actions for different files).  What and where is it?
* 19.3.::          19.3. Is there any way to add more faces and regexps to GNUS without hacking gnus.el?
* 19.4.::          19.4. What is BBDB?
* 19.5.::          19.5. I noticed that BBDB evokes an XEmacs bug; is there a fix?
* 19.6.::          19.6. I'm getting the error 'Wrong type argument: listp :-pos' when I try to start BBDB.  What do I do?
* 19.7.::          19.7. I'm getting the error 'movemail: Permission denied' when I try and start VM.  What do I do?


File: xemacs-faq.info,  Node: 19.1.,  Next: 19.2.,  Up: 19. Mail; VM; GNUS; BBDB; and related

19.1. How and where I am suppose to set the face attributes for customizing the appearance of messages (i.e. for VM)?
=====================================================================================================================

   Suppose you want to use:

     (set-face-font 'message-highlighted-header-contents
                    "-adobe-courier-bold-r-normal--12*")
     (set-face-foreground 'message-headers "darkslateblue")
     (set-face-foreground 'message-header-contents "brown")
     (set-face-foreground 'message-highlighted-header-contents "black")
     (set-face-foreground 'message-cited-text "darkgreen")

   Well, this should work, provided that `(require 'highlight-headers)'
is executed first.  Also, highlight-headers is self-contained and you
don't need to turn on font-lock mode.


File: xemacs-faq.info,  Node: 19.2.,  Next: 19.3.,  Prev: 19.1.,  Up: 19. Mail; VM; GNUS; BBDB; and related

19.2.  I seem to have heard that there's a package distributed with XEmacs which will use the echo area to notify you of incoming mail in a rather configurable way (multiple spool files, different actions for different files).  What and where is it?
=========================================================================================================================================================================================================================================================

   It's called reportmail.  Add the following to your `.emacs':

     (load-library "reportmail")


File: xemacs-faq.info,  Node: 19.3.,  Next: 19.4.,  Prev: 19.2.,  Up: 19. Mail; VM; GNUS; BBDB; and related

19.3.  Is there any way to add more faces and regexps to GNUS without hacking gnus.el?
======================================================================================

   You can try the folowing elisp:

     (add-hook 'gnus-startup-hook
               '(lambda ()
                   (font-lock-mode)
                   (set-face-foreground 'message-headers "red")
                   (set-face-foreground 'message-header-contents "orange")
                   (set-face-foreground 'message-cited-text "blue")))


File: xemacs-faq.info,  Node: 19.4.,  Next: 19.5.,  Prev: 19.3.,  Up: 19. Mail; VM; GNUS; BBDB; and related

19.4.  What is BBDB?
====================

   BBDB is the Big Brother Database, written by Jamie Zawinski
<jwz@netscape.com>.  It interfaces to VM, mh-e, and GNUS and
conveniently snarfs information about people and other things from
articles and messages that go by.

   BBDB is available from the elisp archive

     archive.cis.ohio-state.edu:/pub/gnu/emacs/elisp-archive

   BBDB has a mailing list devoted to it:

     info-bbdb@cs.uiuc.edu

   This mailing list is archived at

     ftp.cs.uiuc.edu:/pub/bbdb


File: xemacs-faq.info,  Node: 19.5.,  Next: 19.6.,  Prev: 19.4.,  Up: 19. Mail; VM; GNUS; BBDB; and related

19.5. I noticed that BBDB evokes an XEmacs bug; is there a fix?
===============================================================

   This worked for me:

     (setq bbdb-electric-p nil)


File: xemacs-faq.info,  Node: 19.6.,  Next: 19.7.,  Prev: 19.5.,  Up: 19. Mail; VM; GNUS; BBDB; and related

19.6. I'm getting the error 'Wrong type argument: listp :-pos' when I try to start BBDB.  What do I do?
=======================================================================================================

   Discard the copy of mail-extr.el that came with bbdb.

   XEmacs 19.12 made the change that you cannot change the value of
interned symbols whose names begin with a colon.  The mail-extr.el
that's distributed with 19.12+ is fixed to live with this restriction,
but old copies of mail-extr.el will bomb.


File: xemacs-faq.info,  Node: 19.7.,  Prev: 19.6.,  Up: 19. Mail; VM; GNUS; BBDB; and related

19.7. I'm getting the error 'movemail: Permission denied' when I try and start VM.  What do I do?
=================================================================================================

   Execute the following two commands.  movemail is normally located in
the XEmacs install tree at `.../lib/xemacs-19.13/${arch}/movemail'.

             chgrp mail movemail
             chmod 2555 movemail


File: xemacs-faq.info,  Node: 20. Printing,  Next: 21. Gnuserv,  Prev: 19. Mail; VM; GNUS; BBDB; and related,  Up: Top

20. Printing
************

* Menu:

* 20.1.::          20.1. Font-lock looks nice.  How can I print (WYSIWYG) the highlighted document?
* 20.2.::          20.2. My printer is a Postscript printer and `lpr' only works for Postscript files, so how do I get `M-x lpr-region' and `M-x lpr-buffer' to work?


File: xemacs-faq.info,  Node: 20.1.,  Next: 20.2.,  Up: 20. Printing

20.1. Font-lock looks nice.  How can I print (WYSIWYG) the highlighted document?
================================================================================

   The package ps-print.el, which is now included with XEmacs, provides
the ability to do this.  It contains complete instructions on its use:

     <xemacs_src_root>/lisp/packages/ps-print.el


File: xemacs-faq.info,  Node: 20.2.,  Prev: 20.1.,  Up: 20. Printing

20.2. My printer is a Postscript printer and `lpr' only works for Postscript files, so how do I get `M-x lpr-region' and `M-x lpr-buffer' to work?
==================================================================================================================================================

     (setq lpr-command "COMMAND TO PRINT TEXT FILES")

   Please don't forget to replace COMMAND TO PRINT TEXT FILES with the
actual command (`enscript', `nenscript', etc.)!


File: xemacs-faq.info,  Node: 21. Gnuserv,  Next: 22. Miscellaneous,  Prev: 20. Printing,  Up: Top

21. Gnuserv
***********

* Menu:

* 21.1.::          21.1. How do I disable gnuserv from opening a new frame?
* 21.2.::          21.2. What do I do to start the gnuserv server so that each subseqeuent XEmacs is a client?


File: xemacs-faq.info,  Node: 21.1.,  Next: 21.2.,  Up: 21. Gnuserv

21.1. How do I disable gnuserv from opening a new frame?
========================================================

   If you set the gnuserv-screen variable to the frame that should be
used to display buffers that are pulled up, a new frame will not be
created. For example, you could put

     (setq gnuserv-screen (selected-frame))

   early on in your `.emacs', to ensure that the first frame created is
the one used for your gnuserv buffers.


File: xemacs-faq.info,  Node: 21.2.,  Prev: 21.1.,  Up: 21. Gnuserv

21.2.  What do I do to start the gnuserv server so that each subseqeuent XEmacs is a client?
============================================================================================

   Put the following in your `.emacs' file to start the server:

     (gnuserv-start)

   Start your first XEmacs as usual.  After that, you can do

     gnuclient randomfilename

   from the command line to get your existing XEmacs process to open a
new frame and visit randomfilename in that window. When you're done
editing randomfilename, hit `C-x #' to kill the buffer and get rid of
the frame.


File: xemacs-faq.info,  Node: 22. Miscellaneous,  Prev: 21. Gnuserv,  Up: Top

22. Miscellaneous
*****************

* Menu:

* 22.1.::          22.1. How do I specify the paths that XEmacs uses for finding files?
* 22.2.::          22.2. Why does edt emulation not work?
* 22.3.::          22.3. How can I emulate VI and use it as my default mode?
* 22.4.::          22.4. Is there some way to get the behavior so that if the current buffer has a file associated with it, the current buffer will use that files name else use the buffer name?
* 22.5.::          22.5. I have no idea where this is coming from, but ever since I moved from 19.9 to 19.13 I have started seeing that all of my buffers will get a minor mode called `Omit'.  I have no idea how it got there nor do I know what it does.  What is it?
* 22.6.::          22.6. How do I turn off the sound?
* 22.7.::          22.7. Can I have the end of the buffer delimited in some way? Say, with:   [END] ?
* 22.8.::          22.8. Can I insert today's date into buffer?
* 22.9.::          22.9. Are only certain syntactic character classes available for abbrevs?  I didn't see any restrictions in the info.
* 22.10.::         22.10. Filladapt used to work after I loaded it.  Now in 19.13 it doesn't.  What gives?


File: xemacs-faq.info,  Node: 22.1.,  Next: 22.2.,  Up: 22. Miscellaneous

22.1. How do I specify the paths that XEmacs uses for finding files?
====================================================================

   You can specify what paths to use by using a number of different
flags when running configure.  See the section MAKE VARIABLES in the
top-level file INSTALL in the XEmacs distribution for a listing of
those flags.

   Most of the time, however, the simplest fix is: DO NOT specify paths
as you might for FSF GNU Emacs.  XEmacs can generally determine the
necessary paths dynamically at run time.  The only path that generally
needs to be specified is the root directory to install into.  That can
be specified by passing the `--prefix' flag to configure.  For a
description of the XEmacs install tree, please consult the NEWS file.


File: xemacs-faq.info,  Node: 22.2.,  Next: 22.3.,  Prev: 22.1.,  Up: 22. Miscellaneous

22.2. Why does edt emulation not work?
======================================

   We don't know, but you can use tpu-edt emulation instead, which
works fine and is a little fancier than the standard edt emulation.  To
do this, add the following line to your `.emacs':

     (load "tpu-edt")

   If you don't want it to replace Ctrl-h with edt-style help menu add
this as well:

     (global-set-key '(control h) 'help-for-help)


File: xemacs-faq.info,  Node: 22.3.,  Next: 22.4.,  Prev: 22.2.,  Up: 22. Miscellaneous

22.3. How can I emulate VI and use it as my default mode?
=========================================================

   Our recommended VI emulator is viper.  To put the current buffer into
viper-mode, use the command:

     M-x viper

   To make viper-mode the default, add the following lines to your
`.emacs':

     (load-library "viper")
     (setq term-setup-hook 'viper)
     (setq find-file-hooks 'viper)
     (setq find-file-not-found-hooks 'viper)


File: xemacs-faq.info,  Node: 22.4.,  Next: 22.5.,  Prev: 22.3.,  Up: 22. Miscellaneous

22.4. Is there some way to get the behavior so that if the current buffer has a file associated with it, the current buffer will use that files name else use the buffer name?
==============================================================================================================================================================================

   Just set frame-title-format from find-file-hooks.  Alternatively,
look at the answer to question 15.2.

   In addition, one could set modeline-format.


File: xemacs-faq.info,  Node: 22.5.,  Next: 22.6.,  Prev: 22.4.,  Up: 22. Miscellaneous

22.5. I have no idea where this is coming from, but ever since I moved from 19.9 to 19.13 I have started seeing that all of my buffers will get a minor mode called `Omit'.  I have no idea how it got there nor do I know what it does.  What is it?
=====================================================================================================================================================================================================================================================

   It's part of dired.  In dired, you can type M-o to get Omit mode and
that will ignore uninteresting files (checkpoint files and backups, for
example).  You get Omit in the modeline everywhere because the variable
`dired-omit-files-p' is globally set to some non-nil value.  If you
want this functionality, it's probably best to use a hook:

     (add-hook 'dired-after-readin-hook '(lambda () (dired-omit-toggle)))

   Alternatively, since  it seems odd to toggle the omit state with
every readin, since readin can happen many times in a Dired buffer, you
can try this hook to correct the "Omit" problem:

     (add-hook 'dired-mode-hook
       (function (lambda ()
           ;; `dired-omit-files-p' is made buffer-local by "dired-x.el", but
           ;; maybe not soon enough.
                 (make-local-variable 'dired-omit-files-p)
                 (setq dired-omit-files-p t))))

   This is only run once, when the Dired buffer is created.


File: xemacs-faq.info,  Node: 22.6.,  Next: 22.7.,  Prev: 22.5.,  Up: 22. Miscellaneous

22.6. How do I turn off the sound?
==================================

   Add the following line to your `.emacs' file:

     (setq bell-volume 0)
     (setq sound-alist nil)


File: xemacs-faq.info,  Node: 22.7.,  Next: 22.8.,  Prev: 22.6.,  Up: 22. Miscellaneous

22.7. Can I have the end of the buffer delimited in some way? Say, with:   [END] ?
==================================================================================

     (make-annotation "[END]" (point-max) 'text (current-buffer))

   Note that you might want to put this in a hook.

   You might also need:

     (require 'annotations)

   since `make-annotation' is not defined by default.


File: xemacs-faq.info,  Node: 22.8.,  Next: 22.9.,  Prev: 22.7.,  Up: 22. Miscellaneous

22.8. Can I insert today's date into buffer?
============================================

   Use this lisp in a function:

     (insert (current-time-string))


File: xemacs-faq.info,  Node: 22.9.,  Next: 22.10.,  Prev: 22.8.,  Up: 22. Miscellaneous

22.9. Are only certain syntactic character classes available for abbrevs?  I didn't see any restrictions in the info.
=====================================================================================================================

   Yes, abbrevs only expand word-syntax strings.  So, in c-mode if you
wanted to expand something to `define ', you would be able to expand
`xd' but not `#d'.


File: xemacs-faq.info,  Node: 22.10.,  Prev: 22.9.,  Up: 22. Miscellaneous

22.10.  Filladapt used to work after I loaded it.  Now in 19.13 it doesn't.  What gives?
========================================================================================

   Filladapt 2.x is included in 19.13+.  In it filladapt is now a minor
mode and minor modes are traditionally off by default.  The following
added to your .emacs will turn it on for all buffers:

     (setq-default filladapt-mode t)

   Use `turn-on-filladapt-mode' to turn Filladapt on in particular
major modes, like this:

     (add-hook 'text-mode-hook 'turn-on-filladapt-mode)


