view lisp/w3/FAQ @ 142:1856695b1fa9 r20-2b5

Import from CVS: tag r20-2b5
author cvs
date Mon, 13 Aug 2007 09:33:18 +0200
parents 6608ceec7cf8
children 318232e2a3f0
line wrap: on
line source

Q: Options menu is ugly under Emacs 19
A: Wait for 19.35 - this is because of a 'feature lack' in easymenu.el

Q: Animated GIFs cause XEmacs 19.14 or 20.0 to crash
A: There was a bug in the GIF decoding routines in XEmacs 19.14 - please 
   upgrade to XEmacs 19.15 or later.

Q: I get an error when starting up:
   Symbol's function definition is void: custom-declare-group
A: This usually means you compiled W3 in an emacs that could not find
   the 'custom' package (or found an old version), but are running W3
   in an emacs that find the new one.  This is usually the case if you
   have a recent version of GNUS installed in a non-standard place.

   Make sure that you can load the custom library when compiling
   emacs.  Set the environment variable WIDGETDIR to where your custom
   library lives (ie: ~/lisp/gnus/lisp)

Q: I like being warned about invalid HTML on my own pages, but how can
   I make Emacs/W3 stop telling me almost everything on the Web is
   invalid?
A: You can use the 'file preparation hook', which is run before any
   parsing is done.

   (defun my-w3-file-prepare-hook ()
     (setq w3-debug-html
         (if (or (string= (url-type url-current-object) "file")
                 (string-match ".*\\.some\\.domain\\.name"
                               (or (url-host url-current-object) "")))
             'style
           nil)))
   (add-hook 'w3-file-prepare-hook 'my-w3-file-prepare-hook)

   This will turn on stylistic warnings for any local HTML files or
   files loaded from the `*.some.domain.name' domain.

Q: How do I make emacs scroll the window horizontally when tabbing
   through links?
A: XEmacs:
   (add-hook 'w3-mode-hook '(lambda () (auto-show-mode 1)))

   Emacs (if you have hscroll.el from ftp:// ?????):
   (autoload 'turn-on-hscroll "hscroll" nil t)
   (add-hook 'w3-mode-hook 'turn-on-hscroll)

Courtesy of greg stark <gsstark@mit.edu>
Q: How do i get Shift-Tab to go backwards on a text terminal or XTerm?
aka: I hate the new text widgets, I can't go through the links with n and b
     I can go forward using TAB but how do i go backward on a terminal? 

A: Not all terminals can distinguish between a shifted tab and an unshifted
tab at all. Tab is indicated on a text terminal by a control-i. There is no
such thing as capital control characters, so if the terminal is going to
indicate a shift-tab somehow it has to be completely differently. The most
appropriate thing to use is probably "backtab" which on old text terminals was
sometimes a separate key and Emacs is already set up to recognize
automatically if it exists.

Making "backtab" work involves several steps. First you have to make sure your
console generates some character sequence to indicate the key you want to
generate a "backtab". Then you have to configure termcap or terminfo to
recognize that key sequence. Then you may have to make your programs do useful
things when they get a "backtab", Emacs for example will recognize it
automatically but except for the Widget and W3 commands nothing is ever bound
it it.

Step 1 On An XTerm: XTerm obeys standard X Toolkit translations which you can
use to specify what character sequence Shift-Tab generates. The following X
Resources will cause Shift-Tab and Meta-Shift-Tab to generate reasonable
character sequences. You can either put this in your .Xresources or .Xdefaults
file, or you can put it in /usr/lib/X11/app-defaults/XTerm to make it a
site-wide default. (On Debian systems you should put it in
/etc/X11/Xresources, not the app-defaults files):

XTerm*VT100.translations: #override \
   ~Meta Shift<Key>Tab: string(\033[Z) \n\
    Meta Shift<Key>Tab: string(\033\033[Z) \n

I recommend these sequences, they are based on what seems to be a more or less
standard sequence ^[[Z for backtab.

Step 1 On Rxvt: By default Rxvt sends ^[[Z for Shift-Tab. 
However, if Shift-Tab generates another keysym, like for example in XFree86
3.2 where it's bound to ISO_Left_Tab then Rxvt will just ignore it. You would
need to defeat this feature to make rxvt work again by doing something like:

xmodmap -e 'keysym Tab = Tab'

or adding that command to some global X configuration file (On Debian systems
adding ``Keysym Tab = Tab'' to /etc/X11/Xmodmap or ~/.Xmodmap is sufficient)

Step 1 On A Linux Virtual Console: on a Linux virtual console you can
configure what character sequences are generated by which keys using the
loadkeys command. Many systems are set up to run loadkeys automatically on
startup with some keymap file. On Debian systems this is true, the keymap file
is specified in /etc/kbd/config and usually lives in the
/usr/lib/kbd/keytables directory. You want to put something like the following
in your keytable file:

keycode  15 = Tab   F91
	alt     keycode  15 = Meta_Tab        
	shift   alt     keycode  15 = F92

where keycode 15 is Tab on my keyboard (and probably any keyboard). This
defines Tab and Alt-Tab normally, and also defines Shift-Tab to be F91 and
Shift-Alt-Tab to be F92.

Then put something like this:
# backtab and M-backtab
string F91 = "\033[Z"
string F92 = "\033\033[Z"

later in the file. This defines what character sequence F91 (Shift-Tab) and
F92 (Alt-Shift-Tab) should generate. I recommend these sequences, they are
based on what seems to be a more or less standard sequence ^[[Z for backtab.

Step 2 On A Termcap System:

The termcap capability is kB, i'm not familiar with termcap tools, i think you
just need to add it to the /etc/termcap file for the terminal you're concerned
with as kB=\E[Z.

Step 2 On A Terminfo System:

The terminfo capability is kcbt (the long name is key_btab). You want to run
infocmp to generate an edittable copy of the terminal info. Add the
capability, then use tic to compile that information. Something like this:

infocmp $TERM > info
emacs info & # add kcbt=\E[Z, to the file
tic info

If you do this as root it should add the new definition to the system wide
terminfo database. If you do it as a normal user it should create a
~/.terminfo database with a local terminfo info definition for that terminal.

Step 3 On Emacs:

The standard terminal initialization should recognize the backtab capability
automatically. To test it try C-h c Shift-Tab and see what it calls the key.
To bind commands to it just use [backtab] in local-set-key or global-set-key
as in:

(local-set-key [backtab] 'hippie-expand)
or
(global-set-key [backtab] 'hippie-expand)

In the interest of maintaining a single consistent set of key bindings between
X and tty emacsen you may want to make equivalent X keystroke generate
"backtab" as well, you can do this by doing this:

(define-key function-key-map [S-tab] [backtab])
or
(define-key function-key-map [iso-lefttab] [backtab])

To make S-tab or whatever keystroke you made generate backtab on a terminal
be recognized as backtab under X11 as well. You can check how Emacs recognizes
this keystroke currently by doing C-h c <keystroke>.