aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEli Zaretskii2001-09-30 07:00:25 +0000
committerEli Zaretskii2001-09-30 07:00:25 +0000
commit76b47cc36e158e891d184975808947869f9ba9f2 (patch)
tree5b5351f6c6fa133b56570598d4cead25633e4aec
parentd0100d57b4bf5dbeb35e9b04731d4ed38764d60b (diff)
downloademacs-76b47cc36e158e891d184975808947869f9ba9f2.tar.gz
emacs-76b47cc36e158e891d184975808947869f9ba9f2.zip
(Backspace invokes help): Clarify that keyboard-translate is better
than global-set-key. Add reference to the manual's section about DEL vs BS. Mention normal-erase-is-backspace.
-rw-r--r--man/faq.texi49
1 files changed, 43 insertions, 6 deletions
diff --git a/man/faq.texi b/man/faq.texi
index 55278bdc887..d9b57f32d82 100644
--- a/man/faq.texi
+++ b/man/faq.texi
@@ -4631,6 +4631,7 @@ actually behaves.
4631@section Why does the @key{Backspace} key invoke help? 4631@section Why does the @key{Backspace} key invoke help?
4632@cindex Backspace key invokes help 4632@cindex Backspace key invokes help
4633@cindex Help invoked by Backspace 4633@cindex Help invoked by Backspace
4634@cindex DEL key does not delete
4634 4635
4635The @key{Backspace} key (on most keyboards) generates ASCII code 8. 4636The @key{Backspace} key (on most keyboards) generates ASCII code 8.
4636@kbd{C-h} sends the same code. In Emacs by default @kbd{C-h} invokes 4637@kbd{C-h} sends the same code. In Emacs by default @kbd{C-h} invokes
@@ -4660,22 +4661,45 @@ keyboard or because they don't even have a separate @key{Delete} key.
4660In this case, the @key{Backspace} key should be made to behave like 4661In this case, the @key{Backspace} key should be made to behave like
4661@key{Delete}. There are several methods. 4662@key{Delete}. There are several methods.
4662 4663
4664@itemize @minus
4665@item
4666Some terminals (e.g., VT3## terminals) and terminal emulators (e.g.,
4667TeraTerm) allow the character generated by the @key{Backspace} key to be
4668changed from a setup menu.
4669
4663@item 4670@item
4664Some terminals (e.g., VT3## terminals) allow the character generated 4671You may be able to get a keyboard that is completely programmable, or a
4665by the @key{Backspace} key to be changed from a setup menu. 4672terminal emulator that supports remapping of any key to any other key.
4666 4673
4667@item 4674@item
4668You may be able to get a keyboard that is completely programmable. 4675With Emacs 21.1 and later, you can control the effect of the
4676@key{Backspace} and @key{Delete} keys, on both dumb terminals and a
4677windowed displays, by customizing the option
4678@code{normal-erase-is-backspace-mode}, or by invoking @kbd{M-x
4679normal-erase-is-backspace}. See the documentation of these symbols
4680(@pxref{Emacs Lisp documentation}) for more info.
4669 4681
4670@item 4682@item
4671Under X or on a dumb terminal, it is possible to swap the 4683It is possible to swap the @key{Backspace} and @key{DEL} keys inside
4672@key{Backspace} and @key{Delete} keys inside Emacs: 4684Emacs:
4673 4685
4674@lisp 4686@lisp
4675(keyboard-translate ?\C-h ?\C-?) 4687(keyboard-translate ?\C-h ?\C-?)
4676@end lisp 4688@end lisp
4677 4689
4678@xref{Swapping keys}, for further details of "keyboard-translate". 4690@noindent
4691This is the recommended method of forcing @key{Backspace} to act as
4692@key{DEL}, because it works even in modes which bind @key{DEL} to
4693something other than @code{delete-backward-char}.
4694
4695Similarly, you could remap @key{DEL} to act as @kbd{C-d}, which by
4696default deletes forward:
4697
4698@lisp
4699(keyboard-translate ?\C-? ?\C-d)
4700@end lisp
4701
4702@xref{Swapping keys}, for further details about @code{keyboard-translate}.
4679 4703
4680@item 4704@item
4681Another approach is to switch key bindings and put help on @kbd{C-x h} 4705Another approach is to switch key bindings and put help on @kbd{C-x h}
@@ -4688,7 +4712,16 @@ instead:
4688(global-set-key "\C-xh" 'help-command) 4712(global-set-key "\C-xh" 'help-command)
4689@end lisp 4713@end lisp
4690 4714
4715@noindent
4716This method is not recommended, though: it only solves the problem for
4717those modes which bind @key{DEL} to @code{delete-backward-char}. Modes
4718which bind @key{DEL} to something else, such as @code{view-mode}, will
4719not work as you expect when you press the @key{Backspace} key. For this
4720reason, we recommend the the @code{keyboard-translate} method, shown
4721above.
4722
4691Other popular key bindings for help are @kbd{M-?} and @kbd{C-x ?}. 4723Other popular key bindings for help are @kbd{M-?} and @kbd{C-x ?}.
4724@end itemize
4692 4725
4693Don't try to bind @key{DEL} to @code{help-command}, because there are 4726Don't try to bind @key{DEL} to @code{help-command}, because there are
4694many modes that have local bindings of @key{DEL} that will interfere. 4727many modes that have local bindings of @key{DEL} that will interfere.
@@ -4699,6 +4732,10 @@ When Emacs 21 or later runs on a windowed display, it binds the
4699@key{Delete} key to a command which deletes the character at point, to 4732@key{Delete} key to a command which deletes the character at point, to
4700make Emacs more consistent with keyboard operation on these systems. 4733make Emacs more consistent with keyboard operation on these systems.
4701 4734
4735For more information about troubleshooting this problem, see @ref{DEL
4736Does Not Delete, , If @key{DEL} Fails to Delete, emacs, The GNU Emacs
4737Manual}.
4738
4702@node stty and Backspace key, Swapping keys, Backspace invokes help, Key bindings 4739@node stty and Backspace key, Swapping keys, Backspace invokes help, Key bindings
4703@section Why doesn't Emacs look at the @file{stty} settings for @key{Backspace} vs. @key{Delete}? 4740@section Why doesn't Emacs look at the @file{stty} settings for @key{Backspace} vs. @key{Delete}?
4704@cindex @file{stty} and Emacs 4741@cindex @file{stty} and Emacs