| 1 |
This is ../info/efaq, produced by makeinfo version 4.2 from faq.texi. |
|---|
| 2 |
|
|---|
| 3 |
INFO-DIR-SECTION Emacs |
|---|
| 4 |
START-INFO-DIR-ENTRY |
|---|
| 5 |
* Emacs FAQ: (efaq). Frequently Asked Questions about Emacs. |
|---|
| 6 |
END-INFO-DIR-ENTRY |
|---|
| 7 |
|
|---|
| 8 |
Copyright 1994,1995,1996,1997,1998,1999,2000 Reuven M. Lerner |
|---|
| 9 |
Copyright 1992,1993 Steven Byrnes |
|---|
| 10 |
Copyright 1990,1991,1992 Joseph Brian Wells |
|---|
| 11 |
This list of frequently asked questions about GNU Emacs with answers |
|---|
| 12 |
("FAQ") may be translated into other languages, transformed into other |
|---|
| 13 |
formats (e.g. Texinfo, Info, WWW, WAIS), and updated with new |
|---|
| 14 |
information. |
|---|
| 15 |
|
|---|
| 16 |
The same conditions apply to any derivative of the FAQ as apply to |
|---|
| 17 |
the FAQ itself. Every copy of the FAQ must include this notice or an |
|---|
| 18 |
approved translation, information on who is currently maintaining the |
|---|
| 19 |
FAQ and how to contact them (including their e-mail address), and |
|---|
| 20 |
information on where the latest version of the FAQ is archived |
|---|
| 21 |
(including FTP information). |
|---|
| 22 |
|
|---|
| 23 |
The FAQ may be copied and redistributed under these conditions, |
|---|
| 24 |
except that the FAQ may not be embedded in a larger literary work |
|---|
| 25 |
unless that work itself allows free copying and redistribution. |
|---|
| 26 |
|
|---|
| 27 |
[This version has been somewhat edited from the last-posted version |
|---|
| 28 |
(as of August 1999) for inclusion in the Emacs distribution.] |
|---|
| 29 |
|
|---|
| 30 |
|
|---|
| 31 |
File: efaq, Node: Terminal setup code works after Emacs has begun, Next: Using function keys under X, Prev: Invalid prefix characters, Up: Key bindings |
|---|
| 32 |
|
|---|
| 33 |
Why doesn't this [terminal or window-system setup] code work in my `.emacs' file, but it works just fine after Emacs starts up? |
|---|
| 34 |
=============================================================================================================================== |
|---|
| 35 |
|
|---|
| 36 |
During startup, Emacs initializes itself according to a given |
|---|
| 37 |
code/file order. If some of the code executed in your `.emacs' file |
|---|
| 38 |
needs to be postponed until the initial terminal or window-system setup |
|---|
| 39 |
code has been executed but is not, then you will experience this |
|---|
| 40 |
problem (this code/file execution order is not enforced after startup). |
|---|
| 41 |
|
|---|
| 42 |
To postpone the execution of Emacs Lisp code until after terminal or |
|---|
| 43 |
window-system setup, treat the code as a "lambda list" and set the |
|---|
| 44 |
value of either the `term-setup-hook' or `window-setup-hook' variable |
|---|
| 45 |
to this lambda function. For example, |
|---|
| 46 |
|
|---|
| 47 |
(add-hook 'term-setup-hook |
|---|
| 48 |
(lambda () |
|---|
| 49 |
(when (string-match "\\`vt220" (or (getenv "TERM") "")) |
|---|
| 50 |
;; Make vt220's "Do" key behave like M-x: |
|---|
| 51 |
(global-set-key [do] 'execute-extended-command)))) |
|---|
| 52 |
|
|---|
| 53 |
For information on what Emacs does every time it is started, see the |
|---|
| 54 |
`lisp/startup.el' file. |
|---|
| 55 |
|
|---|
| 56 |
|
|---|
| 57 |
File: efaq, Node: Using function keys under X, Next: Working with function and arrow keys, Prev: Terminal setup code works after Emacs has begun, Up: Key bindings |
|---|
| 58 |
|
|---|
| 59 |
How do I use function keys under X? |
|---|
| 60 |
=================================== |
|---|
| 61 |
|
|---|
| 62 |
With Emacs 19, functions keys under X are bound like any other key. |
|---|
| 63 |
*Note Binding keys to commands::, for details. |
|---|
| 64 |
|
|---|
| 65 |
|
|---|
| 66 |
File: efaq, Node: Working with function and arrow keys, Next: X key translations for Emacs, Prev: Using function keys under X, Up: Key bindings |
|---|
| 67 |
|
|---|
| 68 |
How do I tell what characters or symbols my function or arrow keys emit? |
|---|
| 69 |
======================================================================== |
|---|
| 70 |
|
|---|
| 71 |
Type `C-h c' then the function or arrow keys. The command will |
|---|
| 72 |
return either a function key symbol or character sequence (see the |
|---|
| 73 |
Emacs on-line documentation for an explanation). This works for other |
|---|
| 74 |
keys as well. |
|---|
| 75 |
|
|---|
| 76 |
|
|---|
| 77 |
File: efaq, Node: X key translations for Emacs, Next: Handling C-s and C-q with flow control, Prev: Working with function and arrow keys, Up: Key bindings |
|---|
| 78 |
|
|---|
| 79 |
How do I set the X key "translations" for Emacs? |
|---|
| 80 |
================================================ |
|---|
| 81 |
|
|---|
| 82 |
Emacs is not written using the Xt library by default, so there are no |
|---|
| 83 |
"translations" to be set. (We aren't sure how to set such translations |
|---|
| 84 |
if you do build Emacs with Xt; please let us know if you've done this!) |
|---|
| 85 |
|
|---|
| 86 |
The only way to affect the behavior of keys within Emacs is through |
|---|
| 87 |
`xmodmap' (outside Emacs) or `define-key' (inside Emacs). The |
|---|
| 88 |
`define-key' command should be used in conjunction with the |
|---|
| 89 |
`function-key-map' map. For instance, |
|---|
| 90 |
|
|---|
| 91 |
(define-key function-key-map [M-<TAB>] [?\M-\t]) |
|---|
| 92 |
|
|---|
| 93 |
defines the `M-<TAB>' key sequence. |
|---|
| 94 |
|
|---|
| 95 |
|
|---|
| 96 |
File: efaq, Node: Handling C-s and C-q with flow control, Next: Binding C-s and C-q, Prev: X key translations for Emacs, Up: Key bindings |
|---|
| 97 |
|
|---|
| 98 |
How do I handle `C-s' and `C-q' being used for flow control? |
|---|
| 99 |
============================================================ |
|---|
| 100 |
|
|---|
| 101 |
`C-s' and `C-q' are used in the XON/XOFF flow control protocol. |
|---|
| 102 |
This messes things up when you're using Emacs over a serial line, |
|---|
| 103 |
because Emacs binds these keys to commands by default. Because Emacs |
|---|
| 104 |
won't honor them as flow control characters, too many of these |
|---|
| 105 |
characters are not passed on and overwhelm output buffers. Sometimes, |
|---|
| 106 |
intermediate software using XON/XOFF flow control will prevent Emacs |
|---|
| 107 |
from ever seeing `C-s' and `C-q'. |
|---|
| 108 |
|
|---|
| 109 |
Possible solutions: |
|---|
| 110 |
|
|---|
| 111 |
* Disable the use of `C-s' and `C-q' for flow control. |
|---|
| 112 |
|
|---|
| 113 |
You need to determine the cause of the flow control. |
|---|
| 114 |
|
|---|
| 115 |
- your terminal |
|---|
| 116 |
|
|---|
| 117 |
Your terminal may use XON/XOFF flow control to have time to |
|---|
| 118 |
display all the characters it receives. For example, VT |
|---|
| 119 |
series terminals do this. It may be possible to turn this |
|---|
| 120 |
off from a setup menu. For example, on a VT220 you may |
|---|
| 121 |
select "No XOFF" in the setup menu. This is also true for |
|---|
| 122 |
some terminal emulation programs on PCs. |
|---|
| 123 |
|
|---|
| 124 |
When you turn off flow control at the terminal, you will also |
|---|
| 125 |
need to turn it off at the other end, which might be at the |
|---|
| 126 |
computer you are logged in to or at some terminal server in |
|---|
| 127 |
between. |
|---|
| 128 |
|
|---|
| 129 |
If you turn off flow control, characters may be lost; using a |
|---|
| 130 |
printer connected to the terminal may fail. You may be able |
|---|
| 131 |
to get around this problem by modifying the `termcap' entry |
|---|
| 132 |
for your terminal to include extra NUL padding characters. |
|---|
| 133 |
|
|---|
| 134 |
- a modem |
|---|
| 135 |
|
|---|
| 136 |
If you are using a dialup connection, the modems may be using |
|---|
| 137 |
XON/XOFF flow control. It's not clear how to get around this. |
|---|
| 138 |
|
|---|
| 139 |
- a router or terminal server |
|---|
| 140 |
|
|---|
| 141 |
Some network box between the terminal and your computer may |
|---|
| 142 |
be using XON/XOFF flow control. It may be possible to make |
|---|
| 143 |
it use some other kind of flow control. You will probably |
|---|
| 144 |
have to ask your local network experts for help with this. |
|---|
| 145 |
|
|---|
| 146 |
- `tty' and/or `pty' devices |
|---|
| 147 |
|
|---|
| 148 |
If your connection to Emacs goes through multiple `tty' and/or |
|---|
| 149 |
`pty' devices, they may be using XON/XOFF flow control even |
|---|
| 150 |
when it is not necessary. |
|---|
| 151 |
|
|---|
| 152 |
Eirik Fuller <eirik@theory.tn.cornell.edu> writes: |
|---|
| 153 |
|
|---|
| 154 |
Some versions of `rlogin' (and possibly `telnet') do not |
|---|
| 155 |
pass flow control characters to the remote system to |
|---|
| 156 |
which they connect. On such systems, Emacs on the |
|---|
| 157 |
remote system cannot disable flow control on the local |
|---|
| 158 |
system. Sometimes `rlogin -8' will avoid this problem. |
|---|
| 159 |
|
|---|
| 160 |
One way to cure this is to disable flow control on the |
|---|
| 161 |
local host (the one running `rlogin', not the one |
|---|
| 162 |
running `rlogind') using the `stty' command, before |
|---|
| 163 |
starting the `rlogin' process. On many systems, `stty |
|---|
| 164 |
start u stop u' will do this. |
|---|
| 165 |
|
|---|
| 166 |
Some versions of `tcsh' will prevent even this from |
|---|
| 167 |
working. One way around this is to start another shell |
|---|
| 168 |
before starting rlogin, and issue the `stty' command to |
|---|
| 169 |
disable flow control from that shell. |
|---|
| 170 |
|
|---|
| 171 |
Use `stty -ixon' instead of `stty start u stop u' on some |
|---|
| 172 |
systems. |
|---|
| 173 |
|
|---|
| 174 |
|
|---|
| 175 |
* Make Emacs speak the XON/XOFF flow control protocol. |
|---|
| 176 |
|
|---|
| 177 |
You can make Emacs treat `C-s' and `C-q' as flow control |
|---|
| 178 |
characters by evaluating the form |
|---|
| 179 |
|
|---|
| 180 |
(enable-flow-control) |
|---|
| 181 |
|
|---|
| 182 |
to unconditionally enable flow control or |
|---|
| 183 |
|
|---|
| 184 |
(enable-flow-control-on "vt100" "h19") |
|---|
| 185 |
|
|---|
| 186 |
(using your terminal names instead of `vt100' or `h19') to enable |
|---|
| 187 |
selectively. These commands will automatically swap `C-s' and |
|---|
| 188 |
`C-q' to `C-\' and `C-^'. Variables can be used to change the |
|---|
| 189 |
default swap keys (`flow-control-c-s-replacement' and |
|---|
| 190 |
`flow-control-c-q-replacement'). |
|---|
| 191 |
|
|---|
| 192 |
If you are fixing this for yourself, simply put the form in your |
|---|
| 193 |
`.emacs' file. If you are fixing this for your entire site, the |
|---|
| 194 |
best place to put it is in the `site-lisp/site-start.el' file. |
|---|
| 195 |
(Here `site-lisp' is actually a subdirectory of your Emacs |
|---|
| 196 |
installation directory, typically `/usr/local/share/emacs'.) |
|---|
| 197 |
Putting this form in `site-lisp/default.el' has the problem that |
|---|
| 198 |
if the user's `.emacs' file has an error, this will prevent |
|---|
| 199 |
`default.el' from being loaded and Emacs may be unusable for the |
|---|
| 200 |
user, even for correcting their `.emacs' file (unless they're |
|---|
| 201 |
smart enough to move it to another name). |
|---|
| 202 |
|
|---|
| 203 |
`enable-flow-control' can be invoked interactively as well: `M-x |
|---|
| 204 |
enable-flow-control <RET>'. |
|---|
| 205 |
|
|---|
| 206 |
|
|---|
| 207 |
For further discussion of this issue, read the file `etc/PROBLEMS' |
|---|
| 208 |
(in the Emacs source directory when you unpack the Emacs distribution). |
|---|
| 209 |
|
|---|
| 210 |
|
|---|
| 211 |
File: efaq, Node: Binding C-s and C-q, Next: Backspace invokes help, Prev: Handling C-s and C-q with flow control, Up: Key bindings |
|---|
| 212 |
|
|---|
| 213 |
How do I bind `C-s' and `C-q' (or any key) if these keys are filtered out? |
|---|
| 214 |
========================================================================== |
|---|
| 215 |
|
|---|
| 216 |
To bind `C-s' and `C-q', use either `enable-flow-control' or |
|---|
| 217 |
`enable-flow-control-on'. *Note Handling C-s and C-q with flow |
|---|
| 218 |
control::, for usage and implementation details. |
|---|
| 219 |
|
|---|
| 220 |
To bind other keys, use `keyboard-translate'. *Note Swapping |
|---|
| 221 |
keys::, for usage details. To do this for an entire site, you should |
|---|
| 222 |
swap the keys in `site-lisp/site-start.el'. *Note Handling C-s and C-q |
|---|
| 223 |
with flow control::, for an explanation of why `site-lisp/default.el' |
|---|
| 224 |
should not be used. |
|---|
| 225 |
|
|---|
| 226 |
* If you do this for an entire site, the users will be confused by |
|---|
| 227 |
the disparity between what the documentation says and how Emacs |
|---|
| 228 |
actually behaves. |
|---|
| 229 |
|
|---|
| 230 |
|
|---|
| 231 |
|
|---|
| 232 |
File: efaq, Node: Backspace invokes help, Next: stty and Backspace key, Prev: Binding C-s and C-q, Up: Key bindings |
|---|
| 233 |
|
|---|
| 234 |
Why does the <Backspace> key invoke help? |
|---|
| 235 |
========================================= |
|---|
| 236 |
|
|---|
| 237 |
The <Backspace> key (on most keyboards) generates ASCII code 8. |
|---|
| 238 |
`C-h' sends the same code. In Emacs by default `C-h' invokes |
|---|
| 239 |
help-command. This is intended to be easy to remember since the first |
|---|
| 240 |
letter of `help' is `h'. The easiest solution to this problem is to |
|---|
| 241 |
use `C-h' (and <Backspace>) for help and <DEL> (the <Delete> key) for |
|---|
| 242 |
deleting the previous character. |
|---|
| 243 |
|
|---|
| 244 |
For many people this solution may be problematic: |
|---|
| 245 |
|
|---|
| 246 |
* They normally use <Backspace> outside of Emacs for deleting the |
|---|
| 247 |
previous character. This can be solved by making <DEL> the command |
|---|
| 248 |
for deleting the previous character outside of Emacs. On many Unix |
|---|
| 249 |
systems, this command will remap <DEL>: |
|---|
| 250 |
|
|---|
| 251 |
stty erase `^?' |
|---|
| 252 |
|
|---|
| 253 |
* The user may prefer the <Backspace> key for deleting the previous |
|---|
| 254 |
character because it is more conveniently located on their |
|---|
| 255 |
keyboard or because they don't even have a separate <Delete> key. |
|---|
| 256 |
In this case, the <Backspace> key should be made to behave like |
|---|
| 257 |
<Delete>. There are several methods. |
|---|
| 258 |
|
|---|
| 259 |
- Some terminals (e.g., VT3## terminals) and terminal emulators |
|---|
| 260 |
(e.g., TeraTerm) allow the character generated by the |
|---|
| 261 |
<Backspace> key to be changed from a setup menu. |
|---|
| 262 |
|
|---|
| 263 |
- You may be able to get a keyboard that is completely |
|---|
| 264 |
programmable, or a terminal emulator that supports remapping |
|---|
| 265 |
of any key to any other key. |
|---|
| 266 |
|
|---|
| 267 |
- With Emacs 21.1 and later, you can control the effect of the |
|---|
| 268 |
<Backspace> and <Delete> keys, on both dumb terminals and a |
|---|
| 269 |
windowed displays, by customizing the option |
|---|
| 270 |
`normal-erase-is-backspace-mode', or by invoking `M-x |
|---|
| 271 |
normal-erase-is-backspace'. See the documentation of these |
|---|
| 272 |
symbols (*note Emacs Lisp documentation::) for more info. |
|---|
| 273 |
|
|---|
| 274 |
- It is possible to swap the <Backspace> and <DEL> keys inside |
|---|
| 275 |
Emacs: |
|---|
| 276 |
|
|---|
| 277 |
(keyboard-translate ?\C-h ?\C-?) |
|---|
| 278 |
|
|---|
| 279 |
This is the recommended method of forcing <Backspace> to act |
|---|
| 280 |
as <DEL>, because it works even in modes which bind <DEL> to |
|---|
| 281 |
something other than `delete-backward-char'. |
|---|
| 282 |
|
|---|
| 283 |
Similarly, you could remap <DEL> to act as `C-d', which by |
|---|
| 284 |
default deletes forward: |
|---|
| 285 |
|
|---|
| 286 |
(keyboard-translate ?\C-? ?\C-d) |
|---|
| 287 |
|
|---|
| 288 |
*Note Swapping keys::, for further details about |
|---|
| 289 |
`keyboard-translate'. |
|---|
| 290 |
|
|---|
| 291 |
- Another approach is to switch key bindings and put help on |
|---|
| 292 |
`C-x h' instead: |
|---|
| 293 |
|
|---|
| 294 |
(global-set-key "\C-h" 'delete-backward-char) |
|---|
| 295 |
|
|---|
| 296 |
;;; overrides mark-whole-buffer |
|---|
| 297 |
(global-set-key "\C-xh" 'help-command) |
|---|
| 298 |
|
|---|
| 299 |
This method is not recommended, though: it only solves the |
|---|
| 300 |
problem for those modes which bind <DEL> to |
|---|
| 301 |
`delete-backward-char'. Modes which bind <DEL> to something |
|---|
| 302 |
else, such as `view-mode', will not work as you expect when |
|---|
| 303 |
you press the <Backspace> key. For this reason, we recommend |
|---|
| 304 |
the the `keyboard-translate' method, shown above. |
|---|
| 305 |
|
|---|
| 306 |
Other popular key bindings for help are `M-?' and `C-x ?'. |
|---|
| 307 |
|
|---|
| 308 |
Don't try to bind <DEL> to `help-command', because there are many |
|---|
| 309 |
modes that have local bindings of <DEL> that will interfere. |
|---|
| 310 |
|
|---|
| 311 |
|
|---|
| 312 |
When Emacs 21 or later runs on a windowed display, it binds the |
|---|
| 313 |
<Delete> key to a command which deletes the character at point, to make |
|---|
| 314 |
Emacs more consistent with keyboard operation on these systems. |
|---|
| 315 |
|
|---|
| 316 |
For more information about troubleshooting this problem, see *Note |
|---|
| 317 |
If <DEL> Fails to Delete: (emacs)DEL Does Not Delete. |
|---|
| 318 |
|
|---|
| 319 |
|
|---|
| 320 |
File: efaq, Node: stty and Backspace key, Next: Swapping keys, Prev: Backspace invokes help, Up: Key bindings |
|---|
| 321 |
|
|---|
| 322 |
Why doesn't Emacs look at the `stty' settings for <Backspace> vs. <Delete>? |
|---|
| 323 |
=========================================================================== |
|---|
| 324 |
|
|---|
| 325 |
Good question! |
|---|
| 326 |
|
|---|
| 327 |
|
|---|
| 328 |
File: efaq, Node: Swapping keys, Next: Producing C-XXX with the keyboard, Prev: stty and Backspace key, Up: Key bindings |
|---|
| 329 |
|
|---|
| 330 |
How do I swap two keys? |
|---|
| 331 |
======================= |
|---|
| 332 |
|
|---|
| 333 |
In Emacs 19, you can swap two keys (or key sequences) by using the |
|---|
| 334 |
`keyboard-translate' function. For example, to turn `C-h' into <DEL> |
|---|
| 335 |
and <DEL> to `C-h', use |
|---|
| 336 |
|
|---|
| 337 |
(keyboard-translate ?\C-h ?\C-?) ; translate `C-h' to DEL |
|---|
| 338 |
(keyboard-translate ?\C-? ?\C-h) ; translate DEL to `C-h'. |
|---|
| 339 |
|
|---|
| 340 |
The first key sequence of the pair after the function identifies what is |
|---|
| 341 |
produced by the keyboard; the second, what is matched for in the |
|---|
| 342 |
keymaps. |
|---|
| 343 |
|
|---|
| 344 |
Keyboard translations are not the same as key bindings in keymaps. |
|---|
| 345 |
Emacs contains numerous keymaps that apply in different situations, but |
|---|
| 346 |
there is only one set of keyboard translations, and it applies to every |
|---|
| 347 |
character that Emacs reads from the terminal. Keyboard translations |
|---|
| 348 |
take place at the lowest level of input processing; the keys that are |
|---|
| 349 |
looked up in keymaps contain the characters that result from keyboard |
|---|
| 350 |
translation. |
|---|
| 351 |
|
|---|
| 352 |
*note Keyboard Translations: (emacs)Keyboard Translations. |
|---|
| 353 |
|
|---|
| 354 |
|
|---|
| 355 |
File: efaq, Node: Producing C-XXX with the keyboard, Next: No Meta key, Prev: Swapping keys, Up: Key bindings |
|---|
| 356 |
|
|---|
| 357 |
How do I produce C-XXX with my keyboard? |
|---|
| 358 |
======================================== |
|---|
| 359 |
|
|---|
| 360 |
On terminals (but not under X), some common "aliases" are: |
|---|
| 361 |
|
|---|
| 362 |
`C-2' or `C-<SPC>' |
|---|
| 363 |
`C-@' |
|---|
| 364 |
|
|---|
| 365 |
`C-6' |
|---|
| 366 |
`C-^' |
|---|
| 367 |
|
|---|
| 368 |
`C-7' or `C-S--' |
|---|
| 369 |
`C-_' |
|---|
| 370 |
|
|---|
| 371 |
`C-4' |
|---|
| 372 |
`C-\' |
|---|
| 373 |
|
|---|
| 374 |
`C-5' |
|---|
| 375 |
`C-]' |
|---|
| 376 |
|
|---|
| 377 |
`C-/' |
|---|
| 378 |
`C-?' |
|---|
| 379 |
|
|---|
| 380 |
Often other aliases exist; use the `C-h c' command and try <CTRL> |
|---|
| 381 |
with all of the digits on your keyboard to see what gets generated. |
|---|
| 382 |
You can also try the `C-h w' command if you know the name of the |
|---|
| 383 |
command. |
|---|
| 384 |
|
|---|
| 385 |
|
|---|
| 386 |
File: efaq, Node: No Meta key, Next: No Escape key, Prev: Producing C-XXX with the keyboard, Up: Key bindings |
|---|
| 387 |
|
|---|
| 388 |
What if I don't have a <Meta> key? |
|---|
| 389 |
================================== |
|---|
| 390 |
|
|---|
| 391 |
On many keyboards, the <Alt> key acts as <Meta>, so try it. |
|---|
| 392 |
|
|---|
| 393 |
Instead of typing `M-a', you can type `<ESC> a'. In fact, Emacs |
|---|
| 394 |
converts `M-a' internally into `<ESC> a' anyway (depending on the value |
|---|
| 395 |
of `meta-prefix-char'). Note that you press <Meta> and <a> together, |
|---|
| 396 |
but with <ESC>, you press <ESC>, release it, and then press <a>. |
|---|
| 397 |
|
|---|
| 398 |
|
|---|
| 399 |
File: efaq, Node: No Escape key, Next: Compose Character, Prev: No Meta key, Up: Key bindings |
|---|
| 400 |
|
|---|
| 401 |
What if I don't have an <Escape> key? |
|---|
| 402 |
===================================== |
|---|
| 403 |
|
|---|
| 404 |
Type `C-[' instead. This should send ASCII code 27 just like an |
|---|
| 405 |
Escape key would. `C-3' may also work on some terminal (but not under |
|---|
| 406 |
X). For many terminals (notably DEC terminals) <F11> generates <ESC>. |
|---|
| 407 |
If not, the following form can be used to bind it: |
|---|
| 408 |
|
|---|
| 409 |
;;; F11 is the documented ESC replacement on DEC terminals. |
|---|
| 410 |
(define-key function-key-map [f11] [?\e]) |
|---|
| 411 |
|
|---|
| 412 |
|
|---|
| 413 |
File: efaq, Node: Compose Character, Next: Binding combinations of modifiers and function keys, Prev: No Escape key, Up: Key bindings |
|---|
| 414 |
|
|---|
| 415 |
Can I make my <Compose Character> key behave like a <Meta> key? |
|---|
| 416 |
=============================================================== |
|---|
| 417 |
|
|---|
| 418 |
On a dumb terminal such as a VT220, no. It is rumored that certain |
|---|
| 419 |
VT220 clones could have their <Compose> key configured this way. If |
|---|
| 420 |
you're using X, you might be able to do this with the `xmodmap' command. |
|---|
| 421 |
|
|---|
| 422 |
|
|---|
| 423 |
File: efaq, Node: Binding combinations of modifiers and function keys, Next: Meta key does not work in xterm, Prev: Compose Character, Up: Key bindings |
|---|
| 424 |
|
|---|
| 425 |
How do I bind a combination of modifier key and function key? |
|---|
| 426 |
============================================================= |
|---|
| 427 |
|
|---|
| 428 |
With Emacs 19 and later, you can represent modified function keys in |
|---|
| 429 |
vector format by adding prefixes to the function key symbol. For |
|---|
| 430 |
example (from the on-line documentation): |
|---|
| 431 |
|
|---|
| 432 |
(global-set-key [?\C-x right] 'forward-page) |
|---|
| 433 |
|
|---|
| 434 |
where `?\C-x' is the Lisp character constant for the character `C-x'. |
|---|
| 435 |
|
|---|
| 436 |
You can use the modifier keys <Control>, <Meta>, <Hyper>, <Super>, |
|---|
| 437 |
<Alt>, and <Shift> with function keys. To represent these modifiers, |
|---|
| 438 |
prepend the strings `C-', `M-', `H-', `s-', `A-', and `S-' to the |
|---|
| 439 |
symbol name. Here is how to make `H-M-RIGHT' move forward a word: |
|---|
| 440 |
|
|---|
| 441 |
(global-set-key [H-M-right] 'forward-word) |
|---|
| 442 |
|
|---|
| 443 |
* Not all modifiers are permitted in all situations. <Hyper>, |
|---|
| 444 |
<Super>, and <Alt> are not available on Unix character terminals. |
|---|
| 445 |
Non-ASCII keys and mouse events (e.g. `C-=' and `Mouse-1') also |
|---|
| 446 |
fall under this category. |
|---|
| 447 |
|
|---|
| 448 |
|
|---|
| 449 |
*Note Binding keys to commands::, for general key binding |
|---|
| 450 |
instructions. |
|---|
| 451 |
|
|---|
| 452 |
|
|---|
| 453 |
File: efaq, Node: Meta key does not work in xterm, Next: ExtendChar key does not work as Meta, Prev: Binding combinations of modifiers and function keys, Up: Key bindings |
|---|
| 454 |
|
|---|
| 455 |
Why doesn't my <Meta> key work in an `xterm' window? |
|---|
| 456 |
==================================================== |
|---|
| 457 |
|
|---|
| 458 |
*note Single-Byte Character Set Support: (emacs)Single-Byte |
|---|
| 459 |
Character Support. |
|---|
| 460 |
|
|---|
| 461 |
If the advice in the Emacs manual fails, try all of these methods |
|---|
| 462 |
before asking for further help: |
|---|
| 463 |
|
|---|
| 464 |
* You may have big problems using `mwm' as your window manager. |
|---|
| 465 |
(Does anyone know a good generic solution to allow the use of the |
|---|
| 466 |
<Meta> key in Emacs with `mwm'?) |
|---|
| 467 |
|
|---|
| 468 |
* For X11: Make sure it really is a <Meta> key. Use `xev' to find |
|---|
| 469 |
out what keysym your <Meta> key generates. It should be either |
|---|
| 470 |
`Meta_L' or `Meta_R'. If it isn't, use `xmodmap' to fix the |
|---|
| 471 |
situation. If <Meta> does generate `Meta_L' or `Meta_R', but |
|---|
| 472 |
`M-x' produces a non-ASCII character, put this in your |
|---|
| 473 |
`~/.Xdefaults' file: |
|---|
| 474 |
|
|---|
| 475 |
XTerm*eightBitInput: false |
|---|
| 476 |
XTerm*eightBitOutput: true |
|---|
| 477 |
|
|---|
| 478 |
* Make sure the `pty' the `xterm' is using is passing 8 bit |
|---|
| 479 |
characters. `stty -a' (or `stty everything') should show `cs8' |
|---|
| 480 |
somewhere. If it shows `cs7' instead, use `stty cs8 -istrip' (or |
|---|
| 481 |
`stty pass8') to fix it. |
|---|
| 482 |
|
|---|
| 483 |
* If there is an `rlogin' connection between `xterm' and Emacs, the |
|---|
| 484 |
`-8' argument may need to be given to rlogin to make it pass all 8 |
|---|
| 485 |
bits of every character. |
|---|
| 486 |
|
|---|
| 487 |
* If Emacs is running on Ultrix, it is reported that evaluating |
|---|
| 488 |
`(set-input-mode t nil)' helps. |
|---|
| 489 |
|
|---|
| 490 |
* If all else fails, you can make `xterm' generate `<ESC> W' when |
|---|
| 491 |
you type `M-W', which is the same conversion Emacs would make if it |
|---|
| 492 |
got the `M-W' anyway. In X11R4, the following resource |
|---|
| 493 |
specification will do this: |
|---|
| 494 |
|
|---|
| 495 |
XTerm.VT100.EightBitInput: false |
|---|
| 496 |
|
|---|
| 497 |
(This changes the behavior of the `insert-eight-bit' action.) |
|---|
| 498 |
|
|---|
| 499 |
With older `xterm's, you can specify this behavior with a |
|---|
| 500 |
translation: |
|---|
| 501 |
|
|---|
| 502 |
XTerm.VT100.Translations: #override \ |
|---|
| 503 |
Meta<KeyPress>: string(0x1b) insert() |
|---|
| 504 |
|
|---|
| 505 |
You might have to replace `Meta' with `Alt'. |
|---|
| 506 |
|
|---|
| 507 |
|
|---|
| 508 |
|
|---|
| 509 |
File: efaq, Node: ExtendChar key does not work as Meta, Prev: Meta key does not work in xterm, Up: Key bindings |
|---|
| 510 |
|
|---|
| 511 |
Why doesn't my <ExtendChar> key work as a <Meta> key under HP-UX 8.0 and 9.x? |
|---|
| 512 |
============================================================================= |
|---|
| 513 |
|
|---|
| 514 |
This is a result of an internationalization extension in X11R4 and |
|---|
| 515 |
the fact that HP is now using this extension. Emacs assumes that the |
|---|
| 516 |
`XLookupString' function returns the same result regardless of the |
|---|
| 517 |
<Meta> key state which is no longer necessarily true. Until Emacs is |
|---|
| 518 |
fixed, the temporary kludge is to run this command after each time the |
|---|
| 519 |
X server is started but preferably before any xterm clients are: |
|---|
| 520 |
|
|---|
| 521 |
xmodmap -e 'remove mod1 = Mode_switch' |
|---|
| 522 |
|
|---|
| 523 |
This will disable the use of the extra keysyms systemwide, which may |
|---|
| 524 |
be undesirable if you actually intend to use them. |
|---|
| 525 |
|
|---|
| 526 |
|
|---|
| 527 |
File: efaq, Node: Alternate character sets, Next: Mail and news, Prev: Key bindings, Up: Top |
|---|
| 528 |
|
|---|
| 529 |
Alternate character sets |
|---|
| 530 |
************************ |
|---|
| 531 |
|
|---|
| 532 |
* Menu: |
|---|
| 533 |
|
|---|
| 534 |
* Emacs does not display 8-bit characters:: |
|---|
| 535 |
* Inputting eight-bit characters:: |
|---|
| 536 |
* Kanji and Chinese characters:: |
|---|
| 537 |
* Right-to-left alphabets:: |
|---|
| 538 |
|
|---|
| 539 |
|
|---|
| 540 |
File: efaq, Node: Emacs does not display 8-bit characters, Next: Inputting eight-bit characters, Prev: Alternate character sets, Up: Alternate character sets |
|---|
| 541 |
|
|---|
| 542 |
How do I make Emacs display 8-bit characters? |
|---|
| 543 |
============================================= |
|---|
| 544 |
|
|---|
| 545 |
*note Single-byte Character Set Support: (emacs)Single-Byte |
|---|
| 546 |
Character Support. On a Unix, when Emacs runs on a text-only terminal |
|---|
| 547 |
display or is invoked with `emacs -nw', you typically need to use |
|---|
| 548 |
`set-terminal-coding-system' to tell Emacs what the terminal can |
|---|
| 549 |
display, even after setting the language environment; otherwise |
|---|
| 550 |
non-ASCII characters will display as `?'. On other operating systems, |
|---|
| 551 |
such as MS-DOS and MS-Windows, Emacs queries the OS about the character |
|---|
| 552 |
set supported by the display, and sets up the required terminal coding |
|---|
| 553 |
system automatically. |
|---|
| 554 |
|
|---|
| 555 |
|
|---|
| 556 |
File: efaq, Node: Inputting eight-bit characters, Next: Kanji and Chinese characters, Prev: Emacs does not display 8-bit characters, Up: Alternate character sets |
|---|
| 557 |
|
|---|
| 558 |
How do I input eight-bit characters? |
|---|
| 559 |
==================================== |
|---|
| 560 |
|
|---|
| 561 |
Various methods are available for input of eight-bit characters. See |
|---|
| 562 |
*note Single-byte Character Set Support: (emacs)Single-Byte Character |
|---|
| 563 |
Support. For more sophisticated methods, *note Input Methods: |
|---|
| 564 |
(emacs)Input Methods. |
|---|
| 565 |
|
|---|
| 566 |
|
|---|
| 567 |
File: efaq, Node: Kanji and Chinese characters, Next: Right-to-left alphabets, Prev: Inputting eight-bit characters, Up: Alternate character sets |
|---|
| 568 |
|
|---|
| 569 |
Where can I get an Emacs that handles kanji, Chinese, or other Far-Eastern character sets? |
|---|
| 570 |
========================================================================================== |
|---|
| 571 |
|
|---|
| 572 |
Emacs 20 and later includes many of the features of MULE, the |
|---|
| 573 |
MULtilingual Enhancement to Emacs. *Note Installing Emacs::, for |
|---|
| 574 |
information on where to find and download the latest version of Emacs. |
|---|
| 575 |
|
|---|
| 576 |
|
|---|
| 577 |
File: efaq, Node: Right-to-left alphabets, Prev: Kanji and Chinese characters, Up: Alternate character sets |
|---|
| 578 |
|
|---|
| 579 |
Where is an Emacs that can handle Semitic (right-to-left) alphabets? |
|---|
| 580 |
==================================================================== |
|---|
| 581 |
|
|---|
| 582 |
Emacs 20 and later supports Hebrew characters (ISO 8859-8), but does |
|---|
| 583 |
not yet support right-to-left character entry and display. |
|---|
| 584 |
|
|---|
| 585 |
Joel M. Hoffman <joel@exc.com> has written a Lisp package called |
|---|
| 586 |
`hebrew.el' that allows right-to-left editing of Hebrew. It reportedly |
|---|
| 587 |
works out of the box with Emacs 19, but requires patches for Emacs 18. |
|---|
| 588 |
Write to Joel if you want the patches or package. |
|---|
| 589 |
|
|---|
| 590 |
`hebrew.el' requires a Hebrew screen font, but no other hardware |
|---|
| 591 |
support. Joel has a screen font for PCs running MS-DOS or GNU/Linux. |
|---|
| 592 |
|
|---|
| 593 |
You might also try to query archie for files named with `hebrew'; |
|---|
| 594 |
several ftp sites in Israel may also have the necessary files. |
|---|
| 595 |
|
|---|
| 596 |
|
|---|
| 597 |
File: efaq, Node: Mail and news, Next: Concept index, Prev: Alternate character sets, Up: Top |
|---|
| 598 |
|
|---|
| 599 |
Mail and news |
|---|
| 600 |
************* |
|---|
| 601 |
|
|---|
| 602 |
* Menu: |
|---|
| 603 |
|
|---|
| 604 |
* Changing the included text prefix:: |
|---|
| 605 |
* Saving a copy of outgoing mail:: |
|---|
| 606 |
* Expanding aliases when sending mail:: |
|---|
| 607 |
* Rmail thinks all messages are one big one:: |
|---|
| 608 |
* Sorting the messages in an Rmail folder:: |
|---|
| 609 |
* Rmail writes to /usr/spool/mail:: |
|---|
| 610 |
* Recovering mail files when Rmail munges them:: |
|---|
| 611 |
* Replying to the sender of a message:: |
|---|
| 612 |
* MIME with Emacs mail packages:: |
|---|
| 613 |
* Automatically starting a mail or news reader:: |
|---|
| 614 |
* Reading news with Emacs:: |
|---|
| 615 |
* Gnus does not work with NNTP:: |
|---|
| 616 |
* Viewing articles with embedded underlining:: |
|---|
| 617 |
* Saving a multi-part Gnus posting:: |
|---|
| 618 |
* Starting Gnus faster:: |
|---|
| 619 |
* Catching up in all newsgroups:: |
|---|
| 620 |
* Killing based on nonstandard headers:: |
|---|
| 621 |
* Removing flashing messages:: |
|---|
| 622 |
* Catch-up is slow in Gnus:: |
|---|
| 623 |
* Gnus hangs for a long time:: |
|---|
| 624 |
* Learning more about Gnus:: |
|---|
| 625 |
|
|---|
| 626 |
|
|---|
| 627 |
File: efaq, Node: Changing the included text prefix, Next: Saving a copy of outgoing mail, Prev: Mail and news, Up: Mail and news |
|---|
| 628 |
|
|---|
| 629 |
How do I change the included text prefix in mail/news followups? |
|---|
| 630 |
================================================================ |
|---|
| 631 |
|
|---|
| 632 |
If you read mail with Rmail or news with Gnus, set the variable |
|---|
| 633 |
`mail-yank-prefix'. For VM, set `vm-included-text-prefix'. For mh-e, |
|---|
| 634 |
set `mh-ins-buf-prefix'. |
|---|
| 635 |
|
|---|
| 636 |
For fancier control of citations, use Supercite. *Note Supercite::. |
|---|
| 637 |
|
|---|
| 638 |
To prevent Emacs from including various headers of the replied-to |
|---|
| 639 |
message, set the value of `mail-yank-ignored-headers' to an appropriate |
|---|
| 640 |
regexp. |
|---|
| 641 |
|
|---|
| 642 |
|
|---|
| 643 |
File: efaq, Node: Saving a copy of outgoing mail, Next: Expanding aliases when sending mail, Prev: Changing the included text prefix, Up: Mail and news |
|---|
| 644 |
|
|---|
| 645 |
How do I save a copy of outgoing mail? |
|---|
| 646 |
====================================== |
|---|
| 647 |
|
|---|
| 648 |
You can either mail yourself a copy by including a `BCC' header in |
|---|
| 649 |
the mail message, or store a copy of the message directly to a file by |
|---|
| 650 |
including an `FCC' header. |
|---|
| 651 |
|
|---|
| 652 |
If you use standard mail, you can automatically create a `BCC' to |
|---|
| 653 |
yourself by putting |
|---|
| 654 |
|
|---|
| 655 |
(setq mail-self-blind t) |
|---|
| 656 |
|
|---|
| 657 |
in your `.emacs' file. You can automatically include an `FCC' field by |
|---|
| 658 |
putting something like the following in your `.emacs' file: |
|---|
| 659 |
|
|---|
| 660 |
(setq mail-archive-file-name (expand-file-name "~/outgoing")) |
|---|
| 661 |
|
|---|
| 662 |
The output file will be in Unix mail format, which can be read |
|---|
| 663 |
directly by VM, but not always by Rmail. *Note Learning how to do |
|---|
| 664 |
something::. |
|---|
| 665 |
|
|---|
| 666 |
If you use `mh-e', add an `FCC' or `BCC' field to your components |
|---|
| 667 |
file. |
|---|
| 668 |
|
|---|
| 669 |
It does not work to put `set record filename' in the `.mailrc' file. |
|---|
| 670 |
|
|---|
| 671 |
|
|---|
| 672 |
File: efaq, Node: Expanding aliases when sending mail, Next: Rmail thinks all messages are one big one, Prev: Saving a copy of outgoing mail, Up: Mail and news |
|---|
| 673 |
|
|---|
| 674 |
Why doesn't Emacs expand my aliases when sending mail? |
|---|
| 675 |
====================================================== |
|---|
| 676 |
|
|---|
| 677 |
* You must separate multiple addresses in the headers of the mail |
|---|
| 678 |
buffer with commas. This is because Emacs supports RFC822 |
|---|
| 679 |
standard addresses like this one: |
|---|
| 680 |
|
|---|
| 681 |
To: Willy Smith <wks@xpnsv.lwyrs.com> |
|---|
| 682 |
|
|---|
| 683 |
However, you do not need to--and probably should not, unless your |
|---|
| 684 |
system's version of `/usr/ucb/mail' (a.k.a. `mailx') supports |
|---|
| 685 |
RFC822--separate addresses with commas in your `~/.mailrc' file. |
|---|
| 686 |
|
|---|
| 687 |
* Emacs normally only reads the `.mailrc' file once per session, |
|---|
| 688 |
when you start to compose your first mail message. If you edit |
|---|
| 689 |
`.mailrc', you can type `M-x rebuild-mail-abbrevs <RET>' to make |
|---|
| 690 |
Emacs reread `~/.mailrc'. |
|---|
| 691 |
|
|---|
| 692 |
* If you like, you can expand mail aliases as abbrevs, as soon as you |
|---|
| 693 |
type them in. To enable this feature, execute the following: |
|---|
| 694 |
|
|---|
| 695 |
(add-hook 'mail-mode-hook 'mail-abbrevs-setup) |
|---|
| 696 |
|
|---|
| 697 |
Note that the aliases are expanded automatically only after you |
|---|
| 698 |
type <RET> or a punctuation character (e.g. `,'). You can force |
|---|
| 699 |
their expansion by moving point to the end of the alias and typing |
|---|
| 700 |
`C-x a e' (`M-x expand-abbrev'). |
|---|
| 701 |
|
|---|
| 702 |
|
|---|
| 703 |
File: efaq, Node: Rmail thinks all messages are one big one, Next: Sorting the messages in an Rmail folder, Prev: Expanding aliases when sending mail, Up: Mail and news |
|---|
| 704 |
|
|---|
| 705 |
Why does Rmail think all my saved messages are one big message? |
|---|
| 706 |
=============================================================== |
|---|
| 707 |
|
|---|
| 708 |
A file created through the `FCC' field in a message is in Unix mail |
|---|
| 709 |
format, not the format that Rmail uses (BABYL format). Rmail will try |
|---|
| 710 |
to convert a Unix mail file into BABYL format on input, but sometimes it |
|---|
| 711 |
makes errors. For guaranteed safety, you can make the `saved-messages' |
|---|
| 712 |
file be an inbox for your Rmail file by using the function |
|---|
| 713 |
`set-rmail-inbox-list'. |
|---|
| 714 |
|
|---|
| 715 |
|
|---|
| 716 |
File: efaq, Node: Sorting the messages in an Rmail folder, Next: Rmail writes to /usr/spool/mail, Prev: Rmail thinks all messages are one big one, Up: Mail and news |
|---|
| 717 |
|
|---|
| 718 |
How can I sort the messages in my Rmail folder? |
|---|
| 719 |
=============================================== |
|---|
| 720 |
|
|---|
| 721 |
In Rmail, type `C-c C-s C-h' to get a list of sorting functions and |
|---|
| 722 |
their key bindings. |
|---|
| 723 |
|
|---|
| 724 |
|
|---|
| 725 |
File: efaq, Node: Rmail writes to /usr/spool/mail, Next: Recovering mail files when Rmail munges them, Prev: Sorting the messages in an Rmail folder, Up: Mail and news |
|---|
| 726 |
|
|---|
| 727 |
Why does Rmail need to write to `/usr/spool/mail'? |
|---|
| 728 |
================================================== |
|---|
| 729 |
|
|---|
| 730 |
This is the behavior of the `movemail' program which Rmail uses. |
|---|
| 731 |
This indicates that `movemail' is configured to use lock files. |
|---|
| 732 |
|
|---|
| 733 |
RMS writes: |
|---|
| 734 |
|
|---|
| 735 |
Certain systems require lock files to interlock access to mail |
|---|
| 736 |
files. On these systems, `movemail' must write lock files, or you |
|---|
| 737 |
risk losing mail. You simply must arrange to let `movemail' write |
|---|
| 738 |
them. |
|---|
| 739 |
|
|---|
| 740 |
Other systems use the `flock' system call to interlock access. On |
|---|
| 741 |
these systems, you should configure `movemail' to use `flock'. |
|---|
| 742 |
|
|---|
| 743 |
|
|---|
| 744 |
File: efaq, Node: Recovering mail files when Rmail munges them, Next: Replying to the sender of a message, Prev: Rmail writes to /usr/spool/mail, Up: Mail and news |
|---|
| 745 |
|
|---|
| 746 |
How do I recover my mail files after Rmail munges their format? |
|---|
| 747 |
=============================================================== |
|---|
| 748 |
|
|---|
| 749 |
If you have just done `M-x rmail-input' on a file and you don't want |
|---|
| 750 |
to save it in Rmail's format (called BABYL), just kill the buffer (with |
|---|
| 751 |
`C-x k'). |
|---|
| 752 |
|
|---|
| 753 |
If you typed `M-x rmail' and it read some messages out of your inbox |
|---|
| 754 |
and you want to put them in a Unix mail file, use `C-o' on each message. |
|---|
| 755 |
|
|---|
| 756 |
If you want to convert an existing file from BABYL format to Unix |
|---|
| 757 |
mail format, use the command `M-x unrmail': it will prompt you for the |
|---|
| 758 |
input and output file names. |
|---|
| 759 |
|
|---|
| 760 |
Alternatively, you could use the `b2m' program supplied with Emacs. |
|---|
| 761 |
`b2m' is a filter, and is used like this: |
|---|
| 762 |
|
|---|
| 763 |
b2m < BABYL-FILE > MBOX-FILE |
|---|
| 764 |
|
|---|
| 765 |
where BABYL-FILE is the name of the BABYL file, and MBOX-FILE is the |
|---|
| 766 |
name of the file where the converted mail will be written. |
|---|
| 767 |
|
|---|
| 768 |
|
|---|
| 769 |
File: efaq, Node: Replying to the sender of a message, Next: MIME with Emacs mail packages, Prev: Recovering mail files when Rmail munges them, Up: Mail and news |
|---|
| 770 |
|
|---|
| 771 |
How can I force Rmail to reply to the sender of a message, but not the other recipients? |
|---|
| 772 |
======================================================================================== |
|---|
| 773 |
|
|---|
| 774 |
Ron Isaacson <isaacson@seas.upenn.edu> says: When you hit <r> to |
|---|
| 775 |
reply in Rmail, by default it CCs all of the original recipients |
|---|
| 776 |
(everyone on the original `To' and `CC' lists). With a prefix argument |
|---|
| 777 |
(i.e., typing `C-u' before <r>), it replies only to the sender. |
|---|
| 778 |
However, going through the whole `C-u' business every time you want to |
|---|
| 779 |
reply is a pain. This is the best fix I've been able to come up with: |
|---|
| 780 |
|
|---|
| 781 |
(defun rmail-reply-t () |
|---|
| 782 |
"Reply only to the sender of the current message. (See rmail-reply.)" |
|---|
| 783 |
(interactive) |
|---|
| 784 |
(rmail-reply t)) |
|---|
| 785 |
|
|---|
| 786 |
(add-hook 'rmail-mode-hook |
|---|
| 787 |
(lambda () |
|---|
| 788 |
(define-key rmail-mode-map "r" 'rmail-reply-t) |
|---|
| 789 |
(define-key rmail-mode-map "R" 'rmail-reply))) |
|---|
| 790 |
|
|---|
| 791 |
|
|---|
| 792 |
File: efaq, Node: MIME with Emacs mail packages, Next: Automatically starting a mail or news reader, Prev: Replying to the sender of a message, Up: Mail and news |
|---|
| 793 |
|
|---|
| 794 |
How can I get my favorite Emacs mail package to support MIME? |
|---|
| 795 |
============================================================= |
|---|
| 796 |
|
|---|
| 797 |
Read the Emacs MIME FAQ, maintained by MacDonald Hall Jackson |
|---|
| 798 |
<trey@cs.berkeley.edu> at |
|---|
| 799 |
|
|---|
| 800 |
`http://bmrc.berkeley.edu/~trey/emacs/mime.html' |
|---|
| 801 |
|
|---|
| 802 |
Version 6.x of VM supports MIME. *Note VM::. Gnus supports MIME in |
|---|
| 803 |
mail and news messages as of version 5.8.1 (Pterodactyl). Rmail has |
|---|
| 804 |
limited support for single-part MIME messages beginning with Emacs 20.3. |
|---|
| 805 |
|
|---|
| 806 |
|
|---|
| 807 |
File: efaq, Node: Automatically starting a mail or news reader, Next: Reading news with Emacs, Prev: MIME with Emacs mail packages, Up: Mail and news |
|---|
| 808 |
|
|---|
| 809 |
How do I make Emacs automatically start my mail/news reader? |
|---|
| 810 |
============================================================ |
|---|
| 811 |
|
|---|
| 812 |
To start Emacs in Gnus: |
|---|
| 813 |
|
|---|
| 814 |
emacs -f gnus |
|---|
| 815 |
|
|---|
| 816 |
in Rmail: |
|---|
| 817 |
|
|---|
| 818 |
emacs -f rmail |
|---|
| 819 |
|
|---|
| 820 |
A more convenient way to start with Gnus: |
|---|
| 821 |
|
|---|
| 822 |
alias gnus 'emacs -f gnus' |
|---|
| 823 |
gnus |
|---|
| 824 |
|
|---|
| 825 |
It is probably unwise to automatically start your mail or news reader |
|---|
| 826 |
from your `.emacs' file. This would cause problems if you needed to run |
|---|
| 827 |
two copies of Emacs at the same time. Also, this would make it |
|---|
| 828 |
difficult for you to start Emacs quickly when you needed to. |
|---|
| 829 |
|
|---|
| 830 |
|
|---|
| 831 |
File: efaq, Node: Reading news with Emacs, Next: Gnus does not work with NNTP, Prev: Automatically starting a mail or news reader, Up: Mail and news |
|---|
| 832 |
|
|---|
| 833 |
How do I read news under Emacs? |
|---|
| 834 |
=============================== |
|---|
| 835 |
|
|---|
| 836 |
Use `M-x gnus'. It is documented in Info (*note Learning how to do |
|---|
| 837 |
something::). |
|---|
| 838 |
|
|---|
| 839 |
|
|---|
| 840 |
File: efaq, Node: Gnus does not work with NNTP, Next: Viewing articles with embedded underlining, Prev: Reading news with Emacs, Up: Mail and news |
|---|
| 841 |
|
|---|
| 842 |
Why doesn't Gnus work via NNTP? |
|---|
| 843 |
=============================== |
|---|
| 844 |
|
|---|
| 845 |
There is a bug in NNTP version 1.5.10, such that when multiple |
|---|
| 846 |
requests are sent to the NNTP server, the server only handles the first |
|---|
| 847 |
one before blocking waiting for more input which never comes. NNTP |
|---|
| 848 |
version 1.5.11 claims to fix this. |
|---|
| 849 |
|
|---|
| 850 |
You can work around the bug inside Emacs like this: |
|---|
| 851 |
|
|---|
| 852 |
(setq nntp-maximum-request 1) |
|---|
| 853 |
|
|---|
| 854 |
You can find out what version of NNTP your news server is running by |
|---|
| 855 |
telnetting to the NNTP port (usually 119) on the news server machine |
|---|
| 856 |
(i.e., `telnet server-machine 119'). The server should give its |
|---|
| 857 |
version number in the welcome message. Type `quit' to get out. |
|---|
| 858 |
|
|---|
| 859 |
*Note Spontaneous entry into isearch-mode::, for some additional |
|---|
| 860 |
ideas. |
|---|
| 861 |
|
|---|
| 862 |
|
|---|
| 863 |
File: efaq, Node: Viewing articles with embedded underlining, Next: Saving a multi-part Gnus posting, Prev: Gnus does not work with NNTP, Up: Mail and news |
|---|
| 864 |
|
|---|
| 865 |
How do I view news articles with embedded underlining (e.g., ClariNews)? |
|---|
| 866 |
======================================================================== |
|---|
| 867 |
|
|---|
| 868 |
Underlining appears like this: |
|---|
| 869 |
|
|---|
| 870 |
_^Hu_^Hn_^Hd_^He_^Hr_^Hl_^Hi_^Hn_^Hi_^Hn_^Hg |
|---|
| 871 |
|
|---|
| 872 |
Per Abrahamsen <abraham@dina.kvl.dk> suggests using the following |
|---|
| 873 |
code, which uses the underline face to turn such text into true |
|---|
| 874 |
underlining, inconjunction with Gnus: |
|---|
| 875 |
|
|---|
| 876 |
(defun gnus-article-prepare-overstrike () |
|---|
| 877 |
;; Prepare article for overstrike commands. |
|---|
| 878 |
(save-excursion |
|---|
| 879 |
(set-buffer gnus-article-buffer) |
|---|
| 880 |
(let ((buffer-read-only nil)) |
|---|
| 881 |
(goto-char (point-min)) |
|---|
| 882 |
(while (search-forward "\b" nil t) |
|---|
| 883 |
(let ((next (following-char)) |
|---|
| 884 |
(previous (char-after (- (point) 2)))) |
|---|
| 885 |
(cond ((eq next previous) |
|---|
| 886 |
(delete-region (- (point) 2) (point)) |
|---|
| 887 |
(put-text-property (point) (1+ (point)) |
|---|
| 888 |
'face 'bold)) |
|---|
| 889 |
((eq next ?_) |
|---|
| 890 |
(delete-region (1- (point)) (1+ (point))) |
|---|
| 891 |
(put-text-property (1- (point)) (point) |
|---|
| 892 |
'face 'underline)) |
|---|
| 893 |
((eq previous ?_) |
|---|
| 894 |
(delete-region (- (point) 2) (point)) |
|---|
| 895 |
(put-text-property (point) (1+ (point)) |
|---|
| 896 |
'face 'underline)))))))) |
|---|
| 897 |
|
|---|
| 898 |
(add-hook 'gnus-article-prepare-hook 'gnus-article-prepare-overstrike) |
|---|
| 899 |
|
|---|
| 900 |
Latest versions of Gnus do such a conversion automatically. |
|---|
| 901 |
|
|---|
| 902 |
If you prefer to do away with underlining altogether, you can |
|---|
| 903 |
destructively remove it with `M-x ununderline-region'; do this |
|---|
| 904 |
automatically via |
|---|
| 905 |
|
|---|
| 906 |
(add-hook 'gnus-article-prepare-hook |
|---|
| 907 |
(lambda () (ununderline-region (point-min) (point-max)))) |
|---|
| 908 |
|
|---|
| 909 |
|
|---|
| 910 |
File: efaq, Node: Saving a multi-part Gnus posting, Next: Starting Gnus faster, Prev: Viewing articles with embedded underlining, Up: Mail and news |
|---|
| 911 |
|
|---|
| 912 |
How do I save all the items of a multi-part posting in Gnus? |
|---|
| 913 |
============================================================ |
|---|
| 914 |
|
|---|
| 915 |
Use `gnus-uu'. Type `C-c C-v C-h' in the Gnus summary buffer to see |
|---|
| 916 |
a list of available commands. |
|---|
| 917 |
|
|---|
| 918 |
|
|---|
| 919 |
File: efaq, Node: Starting Gnus faster, Next: Catching up in all newsgroups, Prev: Saving a multi-part Gnus posting, Up: Mail and news |
|---|
| 920 |
|
|---|
| 921 |
How do I make Gnus start up faster? |
|---|
| 922 |
=================================== |
|---|
| 923 |
|
|---|
| 924 |
From the Gnus FAQ (*note Learning more about Gnus::): |
|---|
| 925 |
|
|---|
| 926 |
Pranav Kumar Tiwari <pktiwari@eos.ncsu.edu> writes: I posted the |
|---|
| 927 |
same query recently and I got an answer to it. I am going to |
|---|
| 928 |
repeat the answer. What you need is a newer version of gnus, |
|---|
| 929 |
version 5.0.4+. I am using 5.0.12 and it works fine with me with |
|---|
| 930 |
the following settings: |
|---|
| 931 |
|
|---|
| 932 |
(setq gnus-check-new-newsgroups nil |
|---|
| 933 |
gnus-read-active-file 'some |
|---|
| 934 |
gnus-nov-is-evil nil |
|---|
| 935 |
gnus-select-method '(nntp gnus-nntp-server)) |
|---|
| 936 |
|
|---|
| 937 |
|
|---|
| 938 |
File: efaq, Node: Catching up in all newsgroups, Next: Killing based on nonstandard headers, Prev: Starting Gnus faster, Up: Mail and news |
|---|
| 939 |
|
|---|
| 940 |
How do I catch up all newsgroups in Gnus? |
|---|
| 941 |
========================================= |
|---|
| 942 |
|
|---|
| 943 |
In the `*Newsgroup*' buffer, type `M-< C-x ( c y C-x ) M-0 C-x e' |
|---|
| 944 |
|
|---|
| 945 |
Leave off the initial `M-<' if you only want to catch up from point |
|---|
| 946 |
to the end of the `*Newsgroup*' buffer. |
|---|
| 947 |
|
|---|
| 948 |
|
|---|
| 949 |
File: efaq, Node: Killing based on nonstandard headers, Next: Removing flashing messages, Prev: Catching up in all newsgroups, Up: Mail and news |
|---|
| 950 |
|
|---|
| 951 |
Why can't I kill in Gnus based on the Newsgroups/Keywords/Control headers? |
|---|
| 952 |
========================================================================== |
|---|
| 953 |
|
|---|
| 954 |
Gnus will complain that the `Newsgroups', `Keywords', and `Control' |
|---|
| 955 |
headers are "Unknown header" fields. |
|---|
| 956 |
|
|---|
| 957 |
For the `Newsgroups' header, there is an easy workaround: kill on the |
|---|
| 958 |
`Xref' header instead, which will be present on any cross-posted article |
|---|
| 959 |
(as long as your site carries the cross-post group). |
|---|
| 960 |
|
|---|
| 961 |
If you really want to kill on one of these headers, you can do it |
|---|
| 962 |
like this: |
|---|
| 963 |
|
|---|
| 964 |
(gnus-kill nil "^Newsgroups: .*\\(bad\\.group\\|worse\\.group\\)") |
|---|
| 965 |
|
|---|
| 966 |
|
|---|
| 967 |
File: efaq, Node: Removing flashing messages, Next: Catch-up is slow in Gnus, Prev: Killing based on nonstandard headers, Up: Mail and news |
|---|
| 968 |
|
|---|
| 969 |
How do I get rid of flashing messages in Gnus for slow connections? |
|---|
| 970 |
=================================================================== |
|---|
| 971 |
|
|---|
| 972 |
Set `nntp-debug-read' to `nil'. |
|---|
| 973 |
|
|---|
| 974 |
|
|---|
| 975 |
File: efaq, Node: Catch-up is slow in Gnus, Next: Gnus hangs for a long time, Prev: Removing flashing messages, Up: Mail and news |
|---|
| 976 |
|
|---|
| 977 |
Why is catch up slow in Gnus? |
|---|
| 978 |
============================= |
|---|
| 979 |
|
|---|
| 980 |
Because Gnus is marking crosspostings read. You can control this |
|---|
| 981 |
with the variable `gnus-use-cross-reference'. |
|---|
| 982 |
|
|---|
| 983 |
|
|---|
| 984 |
File: efaq, Node: Gnus hangs for a long time, Next: Learning more about Gnus, Prev: Catch-up is slow in Gnus, Up: Mail and news |
|---|
| 985 |
|
|---|
| 986 |
Why does Gnus hang for a long time when posting? |
|---|
| 987 |
================================================ |
|---|
| 988 |
|
|---|
| 989 |
David Lawrence <tale@uunet.uu.net> explains: |
|---|
| 990 |
|
|---|
| 991 |
The problem is almost always interaction between NNTP and C News. |
|---|
| 992 |
NNTP POST asks C News's `inews' to not background itself but |
|---|
| 993 |
rather hang around and give its exit status so it knows whether |
|---|
| 994 |
the post was successful. (That wait will on some systems not |
|---|
| 995 |
return the exit status of the waited for job is a different sort |
|---|
| 996 |
of problem.) It ends up taking a long time because `inews' is |
|---|
| 997 |
calling `relaynews', which often waits for another `relaynews' to |
|---|
| 998 |
free the lock on the news system so it can file the article. |
|---|
| 999 |
|
|---|
| 1000 |
My preferred solution is to change `inews' to not call |
|---|
| 1001 |
`relaynews', but rather use `newsspool'. This loses some |
|---|
| 1002 |
error-catching functionality, but is for the most part safe as |
|---|
| 1003 |
`inews' will detect a lot of the errors on its own. The C News |
|---|
| 1004 |
folks have sped up `inews', too, so speed should look better to |
|---|
| 1005 |
most folks as that update propagates around. |
|---|
| 1006 |
|
|---|
| 1007 |
|
|---|
| 1008 |
File: efaq, Node: Learning more about Gnus, Prev: Gnus hangs for a long time, Up: Mail and news |
|---|
| 1009 |
|
|---|
| 1010 |
Where can I find out more about Gnus? |
|---|
| 1011 |
===================================== |
|---|
| 1012 |
|
|---|
| 1013 |
Look for the Gnus FAQ, available at |
|---|
| 1014 |
|
|---|
| 1015 |
`http://www.ccs.neu.edu/software/contrib/gnus/' |
|---|
| 1016 |
|
|---|