Commit ec9f4754 authored by Gerd Moellmann's avatar Gerd Moellmann
Browse files

(delete-key-deletes-forward-mode): Bind <backspace>

and <delete> via function-key-map.
parent 39f2174e
;;; simple.el --- basic editing commands for Emacs ;;; simple.el --- basic editing commands for Emacs
;; Copyright (C) 1985, 86, 87, 93, 94, 95, 96, 97, 98, 99, 2000 ;; Copyright (C) 1985, 86, 87, 93, 94, 95, 96, 97, 98, 99, 2000, 2001
;; Free Software Foundation, Inc. ;; Free Software Foundation, Inc.
;; This file is part of GNU Emacs. ;; This file is part of GNU Emacs.
...@@ -4044,14 +4044,20 @@ For more details, see `delete-key-deletes-forward'." ...@@ -4044,14 +4044,20 @@ For more details, see `delete-key-deletes-forward'."
(cond ((or (memq window-system '(x w32 mac pc)) (cond ((or (memq window-system '(x w32 mac pc))
(memq system-type '(ms-dos windows-nt))) (memq system-type '(ms-dos windows-nt)))
(let ((bindings (let ((bindings
`(([delete] [backspace] delete-char delete-backward-char) `(([C-delete] [C-backspace] kill-word backward-kill-word)
([C-delete] [C-backspace] kill-word backward-kill-word)
([M-delete] [M-backspace] kill-word backward-kill-word) ([M-delete] [M-backspace] kill-word backward-kill-word)
([C-M-delete] [C-M-backspace] kill-sexp backward-kill-sexp) ([C-M-delete] [C-M-backspace] kill-sexp backward-kill-sexp)
(,esc-map [C-delete] [C-backspace] kill-sexp (,esc-map
backward-kill-sexp) [C-delete] [C-backspace]
(,isearch-mode-map [backspace] [delete] isearch-delete-char kill-sexp backward-kill-sexp))))
isearch-other-control-char))))
(if delete-key-deletes-forward
(progn
(define-key function-key-map [delete] [?\C-d])
(define-key function-key-map [backspace] [?\C-?]))
(define-key function-key-map [delete] [?\C-?])
(define-key function-key-map [backspace] [?\C-?]))
(dolist (binding bindings) (dolist (binding bindings)
(let ((map global-map)) (let ((map global-map))
(when (keymapp (car binding)) (when (keymapp (car binding))
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment