diff options
| author | Eli Zaretskii | 2001-09-30 07:00:25 +0000 |
|---|---|---|
| committer | Eli Zaretskii | 2001-09-30 07:00:25 +0000 |
| commit | 76b47cc36e158e891d184975808947869f9ba9f2 (patch) | |
| tree | 5b5351f6c6fa133b56570598d4cead25633e4aec | |
| parent | d0100d57b4bf5dbeb35e9b04731d4ed38764d60b (diff) | |
| download | emacs-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.texi | 49 |
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 | ||
| 4635 | The @key{Backspace} key (on most keyboards) generates ASCII code 8. | 4636 | The @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. | |||
| 4660 | In this case, the @key{Backspace} key should be made to behave like | 4661 | In 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 | ||
| 4666 | Some terminals (e.g., VT3## terminals) and terminal emulators (e.g., | ||
| 4667 | TeraTerm) allow the character generated by the @key{Backspace} key to be | ||
| 4668 | changed from a setup menu. | ||
| 4669 | |||
| 4663 | @item | 4670 | @item |
| 4664 | Some terminals (e.g., VT3## terminals) allow the character generated | 4671 | You may be able to get a keyboard that is completely programmable, or a |
| 4665 | by the @key{Backspace} key to be changed from a setup menu. | 4672 | terminal emulator that supports remapping of any key to any other key. |
| 4666 | 4673 | ||
| 4667 | @item | 4674 | @item |
| 4668 | You may be able to get a keyboard that is completely programmable. | 4675 | With 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 | ||
| 4677 | windowed displays, by customizing the option | ||
| 4678 | @code{normal-erase-is-backspace-mode}, or by invoking @kbd{M-x | ||
| 4679 | normal-erase-is-backspace}. See the documentation of these symbols | ||
| 4680 | (@pxref{Emacs Lisp documentation}) for more info. | ||
| 4669 | 4681 | ||
| 4670 | @item | 4682 | @item |
| 4671 | Under X or on a dumb terminal, it is possible to swap the | 4683 | It is possible to swap the @key{Backspace} and @key{DEL} keys inside |
| 4672 | @key{Backspace} and @key{Delete} keys inside Emacs: | 4684 | Emacs: |
| 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 |
| 4691 | This 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 | ||
| 4693 | something other than @code{delete-backward-char}. | ||
| 4694 | |||
| 4695 | Similarly, you could remap @key{DEL} to act as @kbd{C-d}, which by | ||
| 4696 | default 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 |
| 4681 | Another approach is to switch key bindings and put help on @kbd{C-x h} | 4705 | Another 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 | ||
| 4716 | This method is not recommended, though: it only solves the problem for | ||
| 4717 | those modes which bind @key{DEL} to @code{delete-backward-char}. Modes | ||
| 4718 | which bind @key{DEL} to something else, such as @code{view-mode}, will | ||
| 4719 | not work as you expect when you press the @key{Backspace} key. For this | ||
| 4720 | reason, we recommend the the @code{keyboard-translate} method, shown | ||
| 4721 | above. | ||
| 4722 | |||
| 4691 | Other popular key bindings for help are @kbd{M-?} and @kbd{C-x ?}. | 4723 | Other popular key bindings for help are @kbd{M-?} and @kbd{C-x ?}. |
| 4724 | @end itemize | ||
| 4692 | 4725 | ||
| 4693 | Don't try to bind @key{DEL} to @code{help-command}, because there are | 4726 | Don't try to bind @key{DEL} to @code{help-command}, because there are |
| 4694 | many modes that have local bindings of @key{DEL} that will interfere. | 4727 | many 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 |
| 4700 | make Emacs more consistent with keyboard operation on these systems. | 4733 | make Emacs more consistent with keyboard operation on these systems. |
| 4701 | 4734 | ||
| 4735 | For more information about troubleshooting this problem, see @ref{DEL | ||
| 4736 | Does Not Delete, , If @key{DEL} Fails to Delete, emacs, The GNU Emacs | ||
| 4737 | Manual}. | ||
| 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 |