Copyright (C) 2000-2012 |
GNU Info (ccmode)Hungry-deletion of WhitespaceHungry-deletion of Whitespace ============================= Hungry deletion of whitespace, or as it more commonly called, "hungry-delete mode", is a simple feature that some people find extremely useful. In fact, you might find yourself wanting hungry-delete in *all* your editing modes! In a nutshell, when hungry-delete mode is enabled, hitting the <Backspace> key(1) will consume all preceding whitespace, including newlines and tabs. This can really cut down on the number of <Backspace>'s you have to type if, for example you made a mistake on the preceding line. By default, when you hit the <Backspace> key CC Mode runs the command `c-electric-backspace', which deletes text in the backwards direction. When deleting a single character, or when <Backspace> is hit in a literal (Note: Auto-newline Insertion), or when hungry-delete mode is disabled, the function contained in the `c-backspace-function' variable is called with one argument (the number of characters to delete). This variable is set to `backward-delete-char-untabify' by default. The default behavior of the <Delete> key depends on the flavor of Emacs you are using. By default in XEmacs 20.3 and beyond, the <Delete> key is bound to `c-electric-delete'. You control the direction that the <Delete> key deletes by setting the variable `delete-key-deletes-forward', a standard XEmacs variable. When this variable is non-`nil' and hungry-delete mode is enabled, `c-electric-delete' will consume all whitespace _following_ point. When `delete-key-deletes-forward' is `nil', it deletes all whitespace _preceding_ point(2) When deleting a single character, or if <Delete> is hit in a literal, or hungry-delete mode is disabled, the function contained in `c-delete-function' is called with one argument: the number of characters to delete. This variable is set to `delete-char' by default. In Emacs 19 or Emacs 20, both the <Delete> and <Backspace> keys are bound to `c-electric-backspace', however you can change this by explicitly binding `[delete]'(3). XEmacsen older than 20.3 behave similar to Emacs 19 and Emacs 20. ---------- Footnotes ---------- (1) I say "hit the <Backspace> key" but what I really mean is "when Emacs receives the `BackSpace' key event." The difference usually isn't significant to most users, but advanced users will realize that under window systems such as X, any physical key (keycap) on the keyboard can be configured to generate any keysym, and thus any Emacs key event. Also, the use of Emacs on TTYs will affect which keycap generates which key event. From a pedantic point of view, here we are only concerned with the key event that Emacs receives. (2) i.e. it literally calls `c-electric-backspace'. (3) E.g. to `c-electric-delete' in your `.emacs' file. Note however, that Emacs 20 does not have a standard variable such as `delete-key-deletes-forward'. automatically generated by info2www version 1.2.2.9 |