[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
This is part 4 of the XEmacs Frequently Asked Questions list. This section is devoted to the display-related capabilities of XEmacs (fonts, colors, modeline, menubar, toolbar, scrollbar, etc.) and how to customize them.
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
#### Update me.
In 21.4 and above, you can use the ‘Options’ menu to change the font. You can also do it in your init file, e.g. like this (for MS Windows):
(set-face-font ’default "Lucida Console:Regular:10") (set-face-font ’modeline "MS Sans Serif:Regular:10") |
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
#### Update me.
Note that you should use ‘Emacs.’ and not ‘Emacs*’ when setting face values.
In ‘.Xresources’:
Emacs.default.attributeFont: -*-*-medium-r-*-*-*-120-*-*-m-*-*-* Emacs*menubar*font: fixed Emacs.modeline.attributeFont: fixed |
This is confusing because ‘default’ and ‘modeline’ are face names, and can be found listed with all faces in the current mode by using M-x set-face-font (enter) ?. They use the face-specific resource ‘attributeFont’.
On the other hand, ‘menubar’ is a normal X thing that uses the resource ‘font’. With Motif it may be necessary to use ‘fontList’ instead of ‘font’. In non-Motif configurations with Mule it is necessary to use ‘fontSet’ instead of ‘font’. (Sorry, there just is no simple recipe here.)
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
How can I set the most commonly used color options from my ‘init.el’ instead of from my ‘.Xresources’?
Like this:
(set-face-background 'default "bisque") ; frame background (set-face-foreground 'default "black") ; normal text (set-face-background 'zmacs-region "red") ; When selecting w/ ; mouse (set-face-foreground 'zmacs-region "yellow") (set-face-font 'default "*courier-bold-r*120-100-100*") (set-face-background 'highlight "blue") ; Ie when selecting ; buffers (set-face-foreground 'highlight "yellow") (set-face-background 'modeline "blue") ; Line at bottom ; of buffer (set-face-foreground 'modeline "white") (set-face-font 'modeline "*bold-r-normal*140-100-100*") (set-face-background 'isearch "yellow") ; When highlighting ; while searching (set-face-foreground 'isearch "red") (setq x-pointer-foreground-color "black") ; Adds to bg color, ; so keep black (setq x-pointer-background-color "blue") ; This is color ; you really ; want ptr/crsr |
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
How can I set the background/foreground colors when highlighting a region?
You can change the face zmacs-region
either in your
‘.Xresources’:
Emacs.zmacs-region.attributeForeground: firebrick Emacs.zmacs-region.attributeBackground: lightseagreen |
or in your ‘init.el’:
(set-face-background 'zmacs-region "red") (set-face-foreground 'zmacs-region "yellow") |
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
I’m using Netscape (or another color grabber like XEmacs); is there any way to limit the number of available colors in the color map?
Answer: No, but you can start Netscape before XEmacs, and it will use the closest available color if the colormap is full. You can also limit the number of colors Netscape uses, using the flags -mono, -ncols <#> or -install (for mono, limiting to <#> colors, or for using a private color map).
If you have the money, another solution would be to use a truecolor or direct color video.
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
XEmacs tries to automatically determine whether your tty supports color, but sometimes guesses wrong. In that case, you can make XEmacs Do The Right Thing using this Lisp code:
(if (eq 'tty (device-type)) (set-device-class nil 'color)) |
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
Juan Villacis writes:
There are several ways to do it. For example, you could specify a default pixmap image to use in your ‘~/.Xresources’, e.g.,
Emacs*EmacsFrame.default.attributeBackgroundPixmap: /path/to/image.xpmand then reload ~/.Xresources and restart XEmacs. Alternatively, since each face can have its own pixmap background, a better way would be to set a face’s pixmap within your XEmacs init file, e.g.,
(set-face-background-pixmap 'default "/path/to/image.xpm") (set-face-background-pixmap 'bold "/path/to/another_image.xpm")and so on. You can also do this interactively via M-x edit-faces.
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
If you’re using a Mule-enabled XEmacs, then display is automatic. If you’re not seeing the characters you expect, either (1) you don’t have appropriate fonts available or (2) XEmacs did not correctly detect the coding system (see (xemacs)Recognize Coding). In case (1), install fonts as is customary for your platform. In case (2), you need to tell XEmacs explicitly what coding systems you’re using. (xemacs)Specify Coding.
If your XEmacs is not Mule-enabled, and for some reason getting a Mule-enabled XEmacs seems like the wrong thing to do, all is not lost. You can arrange it by brute force. In ‘event-Xt.c’ (suppress the urge to look in this file—play Doom instead, because you’ll survive longer), it is written:
In a non-Mule world, a user can still have a multi-lingual editor, by doing
(set-face-font "-*-iso8859-2" (current-buffer))
for all their Latin-2 buffers, etc.
For the related problem of inputting non-ASCII characters in a non-Mule XEmacs, See section How can you type in special characters in XEmacs?.
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
Save Options
.John Mann writes:
You have to go to ‘Options->Menubars’ and unselect ‘Frame-Local Font Menu’. If this option is selected, font changes are only applied to the current frame and do not get saved when you save options.
Also, set the following in your ‘init.el’:
(setq options-save-faces t) |
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
For most modes, font-lock is already set up and just needs to be turned on. This can be done by adding the line:
(require 'font-lock) |
to your ‘init.el’. (You can turn it on for the current buffer and session only by M-x font-lock-mode.) See the file ‘etc/sample.init.el’ (‘etc/sample.emacs’ in XEmacs versions prior to 21.4) for more information.
See also Syntax Highlighting
from the Options
menu.
Remember to save options.
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
Use the following code in your ‘init.el’:
(setq-default font-lock-maximum-decoration t) |
See also Syntax Highlighting
from the Options
menu.
Remember to save options.
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
(set-specifier has-modeline-p nil) |
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
Add the following line to your ‘init.el’ file to display the line number:
(line-number-mode 1) |
Use the following to display the column number:
(column-number-mode 1) |
Or select from the Options
menu
Advanced (Customize)->Emacs->Editing->Basics->Line Number Mode
and/or
Advanced (Customize)->Emacs->Editing->Basics->Column Number Mode
Or type M-x customize <RET> editing-basics <RET>.
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
Add the following line to your ‘init.el’ file to display the time:
(display-time) |
See Customize
from the Options
menu for customization.
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
You can use something like the following:
(add-hook 'lisp-mode-hook (lambda () (set-face-background 'modeline "red" (current-buffer)))) |
Then, when editing a Lisp file (i.e. when in Lisp mode), the modeline colors change from the default set in your ‘init.el’. The change will only be made in the buffer you just entered (which contains the Lisp file you are editing) and will not affect the modeline colors anywhere else.
Notes:
-hook
. eg. c-mode-hook,
c++-mode-hook, emacs-lisp-mode-hook (used for your
‘init.el’ or a ‘xx.el’ file),
lisp-interaction-mode-hook (the ‘*scratch*’ buffer),
text-mode-hook, etc.
add-hook
, not (setq c-mode-hook xxxx)
,
otherwise you will erase anything that anybody has already put on the
hook.
(set-face-font 'modeline font)
,
eg. (set-face-font 'modeline "*bold-r-normal*140-100-100*"
(current-buffer))
if you wish the modeline font to vary based on the
current mode.
There are additional modeline faces, modeline-buffer-id
,
modeline-mousable
, and modeline-mousable-minor-mode
, which
you may want to customize.
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
I’d like to have the bar cursor a little thicker, as I tend to "lose" it often.
For a 1 pixel bar cursor, use:
(setq bar-cursor t) |
For a 2 pixel bar cursor, use:
(setq bar-cursor 'anything-else) |
You can also change these with Customize.
Select from the Options
menu
Advanced (Customize)->Emacs->Environment->Display->Bar Cursor...
or type
M-x customize <RET> display <RET>.
You can use a color to make it stand out better:
Emacs*cursorColor: Red |
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
(setq bar-cursor nil) |
You can also change this with Customize.
Select from the Options
menu
Advanced (Customize)->Emacs->Environment->Display->Bar Cursor...
or type
M-x customize <RET> display <RET>.
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
Yes, like this:
(blink-cursor-mode) |
This function toggles between a steady cursor and a blinking cursor. You may also set this mode from the menu bar by selecting ‘Options->Display->Blinking Cursor’. Remember to save options.
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
(set-specifier menubar-visible-p nil) |
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
For an extensive menubar, add this line to your ‘init.el’:
(load "big-menubar") |
If you’d like to write your own, this file provides as good a set of examples as any to start from. The file is located in edit-utils package.
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
#### Write me.
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
Buffers List
?Add the following to your ‘init.el’ (suit to fit):
(setq buffers-menu-max-size 20) |
For no limit, use an argument of ‘nil’.
You can also change this with Customize. Select from the
Options
menu
Advanced (Customize)->Emacs->Environment->Menu->Buffers Menu->Max Size...
or type M-x customize <RET> buffers-menu <RET>.
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
Emacs*menubar*font
are not working?I am trying to use a resource like Emacs*menubar*font
to set the
font of the menubar but it’s not working.
In Motif, the use of ‘font’ resources is obsoleted in order to support internationalization. If you are using the real Motif menubar, this resource is not recognized at all; you have to say:
Emacs*menubar*fontList: FONT |
If you are using the Lucid menubar, for backward compatibility with existing user configurations, the ‘font’ resource is recognized. Since this is not supported by Motif itself, the code is a kludge and the ‘font’ resource will be recognized only if the ‘fontList’ resource resource is unset. This means that the resource
*fontList: FONT |
will override
Emacs*menubar*font: FONT |
even though the latter is more specific.
In non-Motif configurations using ‘--with-mule’ and
‘--with-xfs’ it is necessary to use the fontSet
resource instead of the font
resource. The backward
compatibility kludge was never implemented for non-Motif builds.
Example:
*fontSet: FONT |
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
#### Write me.
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
#### Write me.
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
Try something like:
(defun my-toggle-toolbar () (interactive) (set-specifier default-toolbar-visible-p (not (specifier-instance default-toolbar-visible-p)))) (global-set-key "\C-xT" 'my-toggle-toolbar) |
Thanks to Martin Buchholz for the correct code.
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
Dr. Ram Samudrala writes:
I just installed the XEmacs (20.4-2) RPMS that I downloaded from http://www.xemacs.org/. Everything works fine, except that when I place my mouse over the toolbar, it beeps and gives me this message:
Can't instantiate image (probably cached): [xbm :mask-file "/usr/include/X11/bitmaps/leftptrmsk :mask-data (16 16 <strange control characters> ... |
Kyle Jones writes:
This is problem specific to some Chips and Technologies video chips, when running XFree86. Putting
Option "sw_cursor"
in ‘XF86Config’ gets rid of the problem.
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
To disable them for all frames, add the following line to your ‘.Xresources’:
Emacs.scrollBarWidth: 0 |
Or select ‘Options->Display->Scrollbars’. Remember to save options.
To turn the scrollbar off on a per-frame basis, use the following function:
(set-specifier scrollbar-width 0 (selected-frame)) |
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 0 (current-buffer)) |
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
#### Write me.
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
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.
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
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.
This cannot be changed.
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
Can the cursor keys scroll the screen a line at a time, rather than the default half page jump? I tend it to find it disorienting.
Use the following:
(setq scroll-step 1) |
You can also change this with Customize. Select from the
Options
menu
Advanced (Customize)->Emacs->Environment->Windows->Scroll Step...
or type M-x customize <RET> windows <RET>.
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
Do (setq truncate-lines t)
in the mode-hooks for any modes
in which you want lines truncated.
More precisely: If truncate-lines
is nil, horizontal scrollbars
will never appear. Otherwise, they will appear only if the value of
scrollbar-height
for that buffer/window/etc. is non-zero. If you
do
(set-specifier scrollbar-height 0) |
then horizontal scrollbars will not appear in truncated buffers unless the package specifically asked for them.
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
auto-show-mode
controls whether or not a horizontal scrollbar
magically appears when a line is too long to be displayed. This is
enabled by default. To turn it off, put the following in your
‘init.el’:
(setq auto-show-mode nil) (setq-default auto-show-mode nil) |
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
#### Write me.
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
#### Write me.
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
#### Write me.
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
#### Write me.
[ << ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
This document was generated by Aidan Kehoe on December 27, 2016 using texi2html 1.82.