From: Eli Zaretskii Date: Wed, 4 Apr 2001 14:07:13 +0000 (+0000) Subject: (normal-erase-is-backspace): Rename from X-Git-Tag: emacs-pretest-21.0.101~6 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=7f62656ba4eff26c2dd002dd11fecf4098df56c0;p=emacs.git (normal-erase-is-backspace): Rename from delete-key-deletes-forward. Doc fix. (normal-erase-is-backspace-mode): Rename from delete-key-deletes-forward-mode. Doc fix. Run normal-erase-is-backspace-hook. --- diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 8bfbd354d79..d2671d2458a 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,5 +1,17 @@ 2001-04-04 Eli Zaretskii + * cus-load.el (normal-erase-is-backspace): Use it instead of + delete-key-deletes-forward. + + * startup.el (command-line): Use normal-erase-is-backspace and + normal-erase-is-backspace-mode. + + * simple.el (normal-erase-is-backspace): Rename from + delete-key-deletes-forward. Doc fix. + (normal-erase-is-backspace-mode): Rename from + delete-key-deletes-forward-mode. Doc fix. Run + normal-erase-is-backspace-hook. + * dired.el (dired-move-to-filename-regexp): Support file sizes in ``human-readable'' format produced by GNU `ls'. (dired-move-to-filename-regexp): Recognize ISO format dates. From diff --git a/lisp/simple.el b/lisp/simple.el index e4f5108c356..6f270128ce1 100644 --- a/lisp/simple.el +++ b/lisp/simple.el @@ -4044,16 +4044,16 @@ DESCRIPTION is the descriptive string for the syntax.") ;;; Handling of Backspace and Delete keys. -(defcustom delete-key-deletes-forward nil - "Whether the Delete key should delete forward or not. +(defcustom normal-erase-is-backspace nil + "If non-nil, Delete key deletes forward and Backspace key deletes backward. On window systems, the default value of this option is chosen according to the keyboard used. If the keyboard has both a Backspace key and a Delete key, and both are mapped to their usual meanings, the option's default value is set to t, so that Backspace can be used to -delete backward, and Delete can be used used to delete forward +delete backward, and Delete can be used to delete forward. -If not running under a window system, setting this option accomplishes +If not running under a window system, customizing this option accomplishes a similar effect by mapping C-h, which is usually generated by the Backspace key, to DEL, and by mapping DEL to C-d via `keyboard-translate'. The former functionality of C-h is available on @@ -4061,31 +4061,57 @@ the F1 key. You should probably not use this setting if you don't have both Backspace, Delete and F1 keys. Setting this variable with setq doesn't take effect. Programmatically, -call `delete-key-deleted-forward-mode' instead." +call `normal-erase-is-backspace-mode' (which see) instead." :type 'boolean :group 'editing-basics :version "21.1" :set (lambda (symbol value) ;; The fboundp is because of a problem with :set when ;; dumping Emacs. It doesn't really matter. - (if (fboundp 'delete-key-deletes-forward-mode) - (delete-key-deletes-forward-mode (or value 0)) + (if (fboundp 'normal-erase-is-backspace-mode) + (normal-erase-is-backspace-mode (or value 0)) (set-default symbol value)))) -(defun delete-key-deletes-forward-mode (&optional arg) - "Toggle Delete key deleting forward or backward. -With numeric arg, turn the mode on if and only iff ARG is positive. -For more details, see `delete-key-deletes-forward'." +(defun normal-erase-is-backspace-mode (&optional arg) + "Toggle the Erase and Delete mode of the Backspace and Delete keys. + +With numeric arg, turn the mode on if and only ARG is positive. + +On window systems, when this mode is on, Delete is mapped to C-d and +Backspace is mapped to DEL; when this mode is off, both Delete and +Backspace are mapped to DEL. (The remapping goes via +`function-key-map', so binding Delete or Backspace in the global or +local keymap will override that.) + +In addition, on window systems, the bindings of C-Delete, M-Delete, +C-M-Delete, C-Backspace, M-Backspace, and C-M-Backspace are changed in +the global keymap in accordance with the functionality of Delete and +Backspace. For example, if Delete is remapped to C-d, which deletes +forward, C-Delete is bound to `kill-word', but if Delete is remapped +to DEL, which deletes backward, C-Delete is bound to +`backward-kill-word'. + +If not running on a window system, a similar effect is accomplished by +remapping C-h (normally produced by the Backspace key) and DEL via +`keyboard-translate': if this mode is on, C-h is mapped to DEL and DEL +to C-d; if it's off, the keys are not remapped. + +When not running on a window system, and this mode is turned on, the +former functionality of C-h is available on the F1 key. You should +probably not turn on this mode on a text-only terminal if you don't +have both Backspace, Delete and F1 keys. + +See also `normal-erase-is-backspace'." (interactive "P") - (setq delete-key-deletes-forward + (setq normal-erase-is-backspace (if arg (> (prefix-numeric-value arg) 0) - (not delete-key-deletes-forward))) + (not normal-erase-is-backspace))) (cond ((or (memq window-system '(x w32 mac pc)) (memq system-type '(ms-dos windows-nt))) - (let ((bindings + (let ((bindings `(([C-delete] [C-backspace]) ([M-delete] [M-backspace]) ([C-M-delete] [C-M-backspace]) @@ -4093,7 +4119,7 @@ For more details, see `delete-key-deletes-forward'." [C-delete] [C-backspace]))) (old-state (lookup-key function-key-map [delete]))) - (if delete-key-deletes-forward + (if normal-erase-is-backspace (progn (define-key function-key-map [delete] [?\C-d]) (define-key function-key-map [kp-delete] [?\C-d]) @@ -4115,19 +4141,19 @@ For more details, see `delete-key-deletes-forward'." (define-key map key1 binding2) (define-key map key2 binding1))))))) (t - (if delete-key-deletes-forward + (if normal-erase-is-backspace (progn (keyboard-translate ?\C-h ?\C-?) (keyboard-translate ?\C-? ?\C-d)) (keyboard-translate ?\C-h ?\C-h) (keyboard-translate ?\C-? ?\C-?)))) - (run-hooks 'delete-key-deletes-forward-hook) + (run-hooks 'normal-erase-is-backspace-hook) (if (interactive-p) - (message "Delete key deletes %s" - (if delete-key-deletes-forward "forward" "backward")))) + (message "Delete key deletes %s" + (if normal-erase-is-backspace "forward" "backward")))) + - ;;; Misc (defun byte-compiling-files-p ()