keyswap.el 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. ;;; keyswap.el --- swap BS and DEL keys -*- no-byte-compile: t -*-
  2. ;; Copyright (C) 1992, 2001-2012 Free Software Foundation, Inc.
  3. ;; Author: Eric S. Raymond <esr@snark.thyrsus.com>
  4. ;; Keywords: terminals
  5. ;; Obsolete-since: 22.1
  6. ;; This file is part of GNU Emacs.
  7. ;; GNU Emacs is free software: you can redistribute it and/or modify
  8. ;; it under the terms of the GNU General Public License as published by
  9. ;; the Free Software Foundation, either version 3 of the License, or
  10. ;; (at your option) any later version.
  11. ;; GNU Emacs is distributed in the hope that it will be useful,
  12. ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  14. ;; GNU General Public License for more details.
  15. ;; You should have received a copy of the GNU General Public License
  16. ;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
  17. ;;; Commentary:
  18. ;; This package is meant to be called by other terminal packages.
  19. ;;; Code:
  20. (let ((the-table (make-string 128 0)))
  21. (let ((i 0))
  22. (while (< i 128)
  23. (aset the-table i i)
  24. (setq i (1+ i))))
  25. ;; Swap ^H and DEL
  26. (aset the-table ?\177 ?\^h)
  27. (aset the-table ?\^h ?\177)
  28. (setq keyboard-translate-table the-table))
  29. ;;; keyswap.el ends here