annotate 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
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
30
ec9a17fef872 Import from CVS: tag r19-15b98
cvs
parents:
diff changeset
1 Q: Options menu is ugly under Emacs 19
ec9a17fef872 Import from CVS: tag r19-15b98
cvs
parents:
diff changeset
2 A: Wait for 19.35 - this is because of a 'feature lack' in easymenu.el
ec9a17fef872 Import from CVS: tag r19-15b98
cvs
parents:
diff changeset
3
118
7d55a9ba150c Import from CVS: tag r20-1b11
cvs
parents: 30
diff changeset
4 Q: Animated GIFs cause XEmacs 19.14 or 20.0 to crash
7d55a9ba150c Import from CVS: tag r20-1b11
cvs
parents: 30
diff changeset
5 A: There was a bug in the GIF decoding routines in XEmacs 19.14 - please
7d55a9ba150c Import from CVS: tag r20-1b11
cvs
parents: 30
diff changeset
6 upgrade to XEmacs 19.15 or later.
7d55a9ba150c Import from CVS: tag r20-1b11
cvs
parents: 30
diff changeset
7
30
ec9a17fef872 Import from CVS: tag r19-15b98
cvs
parents:
diff changeset
8 Q: I get an error when starting up:
118
7d55a9ba150c Import from CVS: tag r20-1b11
cvs
parents: 30
diff changeset
9 Symbol's function definition is void: custom-declare-group
30
ec9a17fef872 Import from CVS: tag r19-15b98
cvs
parents:
diff changeset
10 A: This usually means you compiled W3 in an emacs that could not find
ec9a17fef872 Import from CVS: tag r19-15b98
cvs
parents:
diff changeset
11 the 'custom' package (or found an old version), but are running W3
ec9a17fef872 Import from CVS: tag r19-15b98
cvs
parents:
diff changeset
12 in an emacs that find the new one. This is usually the case if you
ec9a17fef872 Import from CVS: tag r19-15b98
cvs
parents:
diff changeset
13 have a recent version of GNUS installed in a non-standard place.
ec9a17fef872 Import from CVS: tag r19-15b98
cvs
parents:
diff changeset
14
ec9a17fef872 Import from CVS: tag r19-15b98
cvs
parents:
diff changeset
15 Make sure that you can load the custom library when compiling
ec9a17fef872 Import from CVS: tag r19-15b98
cvs
parents:
diff changeset
16 emacs. Set the environment variable WIDGETDIR to where your custom
ec9a17fef872 Import from CVS: tag r19-15b98
cvs
parents:
diff changeset
17 library lives (ie: ~/lisp/gnus/lisp)
118
7d55a9ba150c Import from CVS: tag r20-1b11
cvs
parents: 30
diff changeset
18
134
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 122
diff changeset
19 Q: I like being warned about invalid HTML on my own pages, but how can
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 122
diff changeset
20 I make Emacs/W3 stop telling me almost everything on the Web is
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 122
diff changeset
21 invalid?
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 122
diff changeset
22 A: You can use the 'file preparation hook', which is run before any
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 122
diff changeset
23 parsing is done.
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 122
diff changeset
24
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 122
diff changeset
25 (defun my-w3-file-prepare-hook ()
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 122
diff changeset
26 (setq w3-debug-html
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 122
diff changeset
27 (if (or (string= (url-type url-current-object) "file")
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 122
diff changeset
28 (string-match ".*\\.some\\.domain\\.name"
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 122
diff changeset
29 (or (url-host url-current-object) "")))
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 122
diff changeset
30 'style
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 122
diff changeset
31 nil)))
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 122
diff changeset
32 (add-hook 'w3-file-prepare-hook 'my-w3-file-prepare-hook)
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 122
diff changeset
33
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 122
diff changeset
34 This will turn on stylistic warnings for any local HTML files or
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 122
diff changeset
35 files loaded from the `*.some.domain.name' domain.
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 122
diff changeset
36
138
6608ceec7cf8 Import from CVS: tag r20-2b3
cvs
parents: 134
diff changeset
37 Q: How do I make emacs scroll the window horizontally when tabbing
6608ceec7cf8 Import from CVS: tag r20-2b3
cvs
parents: 134
diff changeset
38 through links?
6608ceec7cf8 Import from CVS: tag r20-2b3
cvs
parents: 134
diff changeset
39 A: XEmacs:
6608ceec7cf8 Import from CVS: tag r20-2b3
cvs
parents: 134
diff changeset
40 (add-hook 'w3-mode-hook '(lambda () (auto-show-mode 1)))
6608ceec7cf8 Import from CVS: tag r20-2b3
cvs
parents: 134
diff changeset
41
6608ceec7cf8 Import from CVS: tag r20-2b3
cvs
parents: 134
diff changeset
42 Emacs (if you have hscroll.el from ftp:// ?????):
6608ceec7cf8 Import from CVS: tag r20-2b3
cvs
parents: 134
diff changeset
43 (autoload 'turn-on-hscroll "hscroll" nil t)
6608ceec7cf8 Import from CVS: tag r20-2b3
cvs
parents: 134
diff changeset
44 (add-hook 'w3-mode-hook 'turn-on-hscroll)
6608ceec7cf8 Import from CVS: tag r20-2b3
cvs
parents: 134
diff changeset
45
118
7d55a9ba150c Import from CVS: tag r20-1b11
cvs
parents: 30
diff changeset
46 Courtesy of greg stark <gsstark@mit.edu>
7d55a9ba150c Import from CVS: tag r20-1b11
cvs
parents: 30
diff changeset
47 Q: How do i get Shift-Tab to go backwards on a text terminal or XTerm?
7d55a9ba150c Import from CVS: tag r20-1b11
cvs
parents: 30
diff changeset
48 aka: I hate the new text widgets, I can't go through the links with n and b
7d55a9ba150c Import from CVS: tag r20-1b11
cvs
parents: 30
diff changeset
49 I can go forward using TAB but how do i go backward on a terminal?
7d55a9ba150c Import from CVS: tag r20-1b11
cvs
parents: 30
diff changeset
50
7d55a9ba150c Import from CVS: tag r20-1b11
cvs
parents: 30
diff changeset
51 A: Not all terminals can distinguish between a shifted tab and an unshifted
7d55a9ba150c Import from CVS: tag r20-1b11
cvs
parents: 30
diff changeset
52 tab at all. Tab is indicated on a text terminal by a control-i. There is no
7d55a9ba150c Import from CVS: tag r20-1b11
cvs
parents: 30
diff changeset
53 such thing as capital control characters, so if the terminal is going to
7d55a9ba150c Import from CVS: tag r20-1b11
cvs
parents: 30
diff changeset
54 indicate a shift-tab somehow it has to be completely differently. The most
7d55a9ba150c Import from CVS: tag r20-1b11
cvs
parents: 30
diff changeset
55 appropriate thing to use is probably "backtab" which on old text terminals was
7d55a9ba150c Import from CVS: tag r20-1b11
cvs
parents: 30
diff changeset
56 sometimes a separate key and Emacs is already set up to recognize
7d55a9ba150c Import from CVS: tag r20-1b11
cvs
parents: 30
diff changeset
57 automatically if it exists.
7d55a9ba150c Import from CVS: tag r20-1b11
cvs
parents: 30
diff changeset
58
7d55a9ba150c Import from CVS: tag r20-1b11
cvs
parents: 30
diff changeset
59 Making "backtab" work involves several steps. First you have to make sure your
7d55a9ba150c Import from CVS: tag r20-1b11
cvs
parents: 30
diff changeset
60 console generates some character sequence to indicate the key you want to
7d55a9ba150c Import from CVS: tag r20-1b11
cvs
parents: 30
diff changeset
61 generate a "backtab". Then you have to configure termcap or terminfo to
7d55a9ba150c Import from CVS: tag r20-1b11
cvs
parents: 30
diff changeset
62 recognize that key sequence. Then you may have to make your programs do useful
7d55a9ba150c Import from CVS: tag r20-1b11
cvs
parents: 30
diff changeset
63 things when they get a "backtab", Emacs for example will recognize it
7d55a9ba150c Import from CVS: tag r20-1b11
cvs
parents: 30
diff changeset
64 automatically but except for the Widget and W3 commands nothing is ever bound
122
d2f30a177268 Import from CVS: tag r20-1b14
cvs
parents: 120
diff changeset
65 it it.
118
7d55a9ba150c Import from CVS: tag r20-1b11
cvs
parents: 30
diff changeset
66
7d55a9ba150c Import from CVS: tag r20-1b11
cvs
parents: 30
diff changeset
67 Step 1 On An XTerm: XTerm obeys standard X Toolkit translations which you can
7d55a9ba150c Import from CVS: tag r20-1b11
cvs
parents: 30
diff changeset
68 use to specify what character sequence Shift-Tab generates. The following X
7d55a9ba150c Import from CVS: tag r20-1b11
cvs
parents: 30
diff changeset
69 Resources will cause Shift-Tab and Meta-Shift-Tab to generate reasonable
7d55a9ba150c Import from CVS: tag r20-1b11
cvs
parents: 30
diff changeset
70 character sequences. You can either put this in your .Xresources or .Xdefaults
7d55a9ba150c Import from CVS: tag r20-1b11
cvs
parents: 30
diff changeset
71 file, or you can put it in /usr/lib/X11/app-defaults/XTerm to make it a
7d55a9ba150c Import from CVS: tag r20-1b11
cvs
parents: 30
diff changeset
72 site-wide default. (On Debian systems you should put it in
7d55a9ba150c Import from CVS: tag r20-1b11
cvs
parents: 30
diff changeset
73 /etc/X11/Xresources, not the app-defaults files):
7d55a9ba150c Import from CVS: tag r20-1b11
cvs
parents: 30
diff changeset
74
7d55a9ba150c Import from CVS: tag r20-1b11
cvs
parents: 30
diff changeset
75 XTerm*VT100.translations: #override \
7d55a9ba150c Import from CVS: tag r20-1b11
cvs
parents: 30
diff changeset
76 ~Meta Shift<Key>Tab: string(\033[Z) \n\
7d55a9ba150c Import from CVS: tag r20-1b11
cvs
parents: 30
diff changeset
77 Meta Shift<Key>Tab: string(\033\033[Z) \n
7d55a9ba150c Import from CVS: tag r20-1b11
cvs
parents: 30
diff changeset
78
7d55a9ba150c Import from CVS: tag r20-1b11
cvs
parents: 30
diff changeset
79 I recommend these sequences, they are based on what seems to be a more or less
7d55a9ba150c Import from CVS: tag r20-1b11
cvs
parents: 30
diff changeset
80 standard sequence ^[[Z for backtab.
7d55a9ba150c Import from CVS: tag r20-1b11
cvs
parents: 30
diff changeset
81
7d55a9ba150c Import from CVS: tag r20-1b11
cvs
parents: 30
diff changeset
82 Step 1 On Rxvt: By default Rxvt sends ^[[Z for Shift-Tab.
7d55a9ba150c Import from CVS: tag r20-1b11
cvs
parents: 30
diff changeset
83 However, if Shift-Tab generates another keysym, like for example in XFree86
7d55a9ba150c Import from CVS: tag r20-1b11
cvs
parents: 30
diff changeset
84 3.2 where it's bound to ISO_Left_Tab then Rxvt will just ignore it. You would
7d55a9ba150c Import from CVS: tag r20-1b11
cvs
parents: 30
diff changeset
85 need to defeat this feature to make rxvt work again by doing something like:
7d55a9ba150c Import from CVS: tag r20-1b11
cvs
parents: 30
diff changeset
86
7d55a9ba150c Import from CVS: tag r20-1b11
cvs
parents: 30
diff changeset
87 xmodmap -e 'keysym Tab = Tab'
7d55a9ba150c Import from CVS: tag r20-1b11
cvs
parents: 30
diff changeset
88
7d55a9ba150c Import from CVS: tag r20-1b11
cvs
parents: 30
diff changeset
89 or adding that command to some global X configuration file (On Debian systems
122
d2f30a177268 Import from CVS: tag r20-1b14
cvs
parents: 120
diff changeset
90 adding ``Keysym Tab = Tab'' to /etc/X11/Xmodmap or ~/.Xmodmap is sufficient)
118
7d55a9ba150c Import from CVS: tag r20-1b11
cvs
parents: 30
diff changeset
91
7d55a9ba150c Import from CVS: tag r20-1b11
cvs
parents: 30
diff changeset
92 Step 1 On A Linux Virtual Console: on a Linux virtual console you can
7d55a9ba150c Import from CVS: tag r20-1b11
cvs
parents: 30
diff changeset
93 configure what character sequences are generated by which keys using the
7d55a9ba150c Import from CVS: tag r20-1b11
cvs
parents: 30
diff changeset
94 loadkeys command. Many systems are set up to run loadkeys automatically on
7d55a9ba150c Import from CVS: tag r20-1b11
cvs
parents: 30
diff changeset
95 startup with some keymap file. On Debian systems this is true, the keymap file
7d55a9ba150c Import from CVS: tag r20-1b11
cvs
parents: 30
diff changeset
96 is specified in /etc/kbd/config and usually lives in the
7d55a9ba150c Import from CVS: tag r20-1b11
cvs
parents: 30
diff changeset
97 /usr/lib/kbd/keytables directory. You want to put something like the following
7d55a9ba150c Import from CVS: tag r20-1b11
cvs
parents: 30
diff changeset
98 in your keytable file:
7d55a9ba150c Import from CVS: tag r20-1b11
cvs
parents: 30
diff changeset
99
7d55a9ba150c Import from CVS: tag r20-1b11
cvs
parents: 30
diff changeset
100 keycode 15 = Tab F91
7d55a9ba150c Import from CVS: tag r20-1b11
cvs
parents: 30
diff changeset
101 alt keycode 15 = Meta_Tab
7d55a9ba150c Import from CVS: tag r20-1b11
cvs
parents: 30
diff changeset
102 shift alt keycode 15 = F92
7d55a9ba150c Import from CVS: tag r20-1b11
cvs
parents: 30
diff changeset
103
7d55a9ba150c Import from CVS: tag r20-1b11
cvs
parents: 30
diff changeset
104 where keycode 15 is Tab on my keyboard (and probably any keyboard). This
7d55a9ba150c Import from CVS: tag r20-1b11
cvs
parents: 30
diff changeset
105 defines Tab and Alt-Tab normally, and also defines Shift-Tab to be F91 and
7d55a9ba150c Import from CVS: tag r20-1b11
cvs
parents: 30
diff changeset
106 Shift-Alt-Tab to be F92.
7d55a9ba150c Import from CVS: tag r20-1b11
cvs
parents: 30
diff changeset
107
7d55a9ba150c Import from CVS: tag r20-1b11
cvs
parents: 30
diff changeset
108 Then put something like this:
7d55a9ba150c Import from CVS: tag r20-1b11
cvs
parents: 30
diff changeset
109 # backtab and M-backtab
7d55a9ba150c Import from CVS: tag r20-1b11
cvs
parents: 30
diff changeset
110 string F91 = "\033[Z"
7d55a9ba150c Import from CVS: tag r20-1b11
cvs
parents: 30
diff changeset
111 string F92 = "\033\033[Z"
7d55a9ba150c Import from CVS: tag r20-1b11
cvs
parents: 30
diff changeset
112
7d55a9ba150c Import from CVS: tag r20-1b11
cvs
parents: 30
diff changeset
113 later in the file. This defines what character sequence F91 (Shift-Tab) and
7d55a9ba150c Import from CVS: tag r20-1b11
cvs
parents: 30
diff changeset
114 F92 (Alt-Shift-Tab) should generate. I recommend these sequences, they are
7d55a9ba150c Import from CVS: tag r20-1b11
cvs
parents: 30
diff changeset
115 based on what seems to be a more or less standard sequence ^[[Z for backtab.
7d55a9ba150c Import from CVS: tag r20-1b11
cvs
parents: 30
diff changeset
116
7d55a9ba150c Import from CVS: tag r20-1b11
cvs
parents: 30
diff changeset
117 Step 2 On A Termcap System:
7d55a9ba150c Import from CVS: tag r20-1b11
cvs
parents: 30
diff changeset
118
7d55a9ba150c Import from CVS: tag r20-1b11
cvs
parents: 30
diff changeset
119 The termcap capability is kB, i'm not familiar with termcap tools, i think you
7d55a9ba150c Import from CVS: tag r20-1b11
cvs
parents: 30
diff changeset
120 just need to add it to the /etc/termcap file for the terminal you're concerned
7d55a9ba150c Import from CVS: tag r20-1b11
cvs
parents: 30
diff changeset
121 with as kB=\E[Z.
7d55a9ba150c Import from CVS: tag r20-1b11
cvs
parents: 30
diff changeset
122
7d55a9ba150c Import from CVS: tag r20-1b11
cvs
parents: 30
diff changeset
123 Step 2 On A Terminfo System:
7d55a9ba150c Import from CVS: tag r20-1b11
cvs
parents: 30
diff changeset
124
7d55a9ba150c Import from CVS: tag r20-1b11
cvs
parents: 30
diff changeset
125 The terminfo capability is kcbt (the long name is key_btab). You want to run
7d55a9ba150c Import from CVS: tag r20-1b11
cvs
parents: 30
diff changeset
126 infocmp to generate an edittable copy of the terminal info. Add the
7d55a9ba150c Import from CVS: tag r20-1b11
cvs
parents: 30
diff changeset
127 capability, then use tic to compile that information. Something like this:
7d55a9ba150c Import from CVS: tag r20-1b11
cvs
parents: 30
diff changeset
128
7d55a9ba150c Import from CVS: tag r20-1b11
cvs
parents: 30
diff changeset
129 infocmp $TERM > info
7d55a9ba150c Import from CVS: tag r20-1b11
cvs
parents: 30
diff changeset
130 emacs info & # add kcbt=\E[Z, to the file
7d55a9ba150c Import from CVS: tag r20-1b11
cvs
parents: 30
diff changeset
131 tic info
7d55a9ba150c Import from CVS: tag r20-1b11
cvs
parents: 30
diff changeset
132
7d55a9ba150c Import from CVS: tag r20-1b11
cvs
parents: 30
diff changeset
133 If you do this as root it should add the new definition to the system wide
7d55a9ba150c Import from CVS: tag r20-1b11
cvs
parents: 30
diff changeset
134 terminfo database. If you do it as a normal user it should create a
7d55a9ba150c Import from CVS: tag r20-1b11
cvs
parents: 30
diff changeset
135 ~/.terminfo database with a local terminfo info definition for that terminal.
7d55a9ba150c Import from CVS: tag r20-1b11
cvs
parents: 30
diff changeset
136
7d55a9ba150c Import from CVS: tag r20-1b11
cvs
parents: 30
diff changeset
137 Step 3 On Emacs:
7d55a9ba150c Import from CVS: tag r20-1b11
cvs
parents: 30
diff changeset
138
7d55a9ba150c Import from CVS: tag r20-1b11
cvs
parents: 30
diff changeset
139 The standard terminal initialization should recognize the backtab capability
7d55a9ba150c Import from CVS: tag r20-1b11
cvs
parents: 30
diff changeset
140 automatically. To test it try C-h c Shift-Tab and see what it calls the key.
7d55a9ba150c Import from CVS: tag r20-1b11
cvs
parents: 30
diff changeset
141 To bind commands to it just use [backtab] in local-set-key or global-set-key
7d55a9ba150c Import from CVS: tag r20-1b11
cvs
parents: 30
diff changeset
142 as in:
7d55a9ba150c Import from CVS: tag r20-1b11
cvs
parents: 30
diff changeset
143
7d55a9ba150c Import from CVS: tag r20-1b11
cvs
parents: 30
diff changeset
144 (local-set-key [backtab] 'hippie-expand)
7d55a9ba150c Import from CVS: tag r20-1b11
cvs
parents: 30
diff changeset
145 or
7d55a9ba150c Import from CVS: tag r20-1b11
cvs
parents: 30
diff changeset
146 (global-set-key [backtab] 'hippie-expand)
7d55a9ba150c Import from CVS: tag r20-1b11
cvs
parents: 30
diff changeset
147
7d55a9ba150c Import from CVS: tag r20-1b11
cvs
parents: 30
diff changeset
148 In the interest of maintaining a single consistent set of key bindings between
7d55a9ba150c Import from CVS: tag r20-1b11
cvs
parents: 30
diff changeset
149 X and tty emacsen you may want to make equivalent X keystroke generate
7d55a9ba150c Import from CVS: tag r20-1b11
cvs
parents: 30
diff changeset
150 "backtab" as well, you can do this by doing this:
7d55a9ba150c Import from CVS: tag r20-1b11
cvs
parents: 30
diff changeset
151
7d55a9ba150c Import from CVS: tag r20-1b11
cvs
parents: 30
diff changeset
152 (define-key function-key-map [S-tab] [backtab])
7d55a9ba150c Import from CVS: tag r20-1b11
cvs
parents: 30
diff changeset
153 or
7d55a9ba150c Import from CVS: tag r20-1b11
cvs
parents: 30
diff changeset
154 (define-key function-key-map [iso-lefttab] [backtab])
7d55a9ba150c Import from CVS: tag r20-1b11
cvs
parents: 30
diff changeset
155
7d55a9ba150c Import from CVS: tag r20-1b11
cvs
parents: 30
diff changeset
156 To make S-tab or whatever keystroke you made generate backtab on a terminal
7d55a9ba150c Import from CVS: tag r20-1b11
cvs
parents: 30
diff changeset
157 be recognized as backtab under X11 as well. You can check how Emacs recognizes
7d55a9ba150c Import from CVS: tag r20-1b11
cvs
parents: 30
diff changeset
158 this keystroke currently by doing C-h c <keystroke>.
7d55a9ba150c Import from CVS: tag r20-1b11
cvs
parents: 30
diff changeset
159
7d55a9ba150c Import from CVS: tag r20-1b11
cvs
parents: 30
diff changeset
160