emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] /srv/bzr/emacs/emacs-23 r100311: * emulation/edt-mapper.el


From: Chong Yidong
Subject: [Emacs-diffs] /srv/bzr/emacs/emacs-23 r100311: * emulation/edt-mapper.el: Override mapping of function keys
Date: Wed, 15 Dec 2010 09:26:56 +0800
User-agent: Bazaar (2.0.3)

------------------------------------------------------------
revno: 100311
author: Kevin Gallagher <address@hidden>
committer: Chong Yidong <address@hidden>
branch nick: emacs-23
timestamp: Wed 2010-12-15 09:26:56 +0800
message:
  * emulation/edt-mapper.el: Override mapping of function keys
  so that the later call to read-key-sequence works.
modified:
  lisp/ChangeLog
  lisp/emulation/edt-mapper.el
=== modified file 'lisp/ChangeLog'
--- a/lisp/ChangeLog    2010-12-13 15:12:01 +0000
+++ b/lisp/ChangeLog    2010-12-15 01:26:56 +0000
@@ -1,3 +1,8 @@
+2010-12-15  Kevin Gallagher  <address@hidden>
+
+       * emulation/edt-mapper.el: Override mapping of function keys so
+       that the later call to read-key-sequence works.
+
 2010-12-13  Eli Zaretskii  <address@hidden>
 
        * mail/smtpmail.el (smtpmail-send-it): Write queued mail body with

=== modified file 'lisp/emulation/edt-mapper.el'
--- a/lisp/emulation/edt-mapper.el      2010-01-13 08:35:10 +0000
+++ b/lisp/emulation/edt-mapper.el      2010-12-15 01:26:56 +0000
@@ -141,6 +141,47 @@
   (setq edt-term (getenv "TERM")))
 
 ;;;
+;;; Implements a workaround for a feature that was added to simple.el.
+;;;
+;;; Many function keys have no Emacs functions assigned to them by
+;;; default. A subset of these are typically assigned functions in the
+;;; EDT emulation. This includes all the keypad keys and a some others
+;;; like Delete.
+;;;
+;;; Logic in simple.el maps some of these unassigned function keys to
+;;; ordinary typing keys.  Where this is the case, a call to
+;;; read-key-sequence, below, does not return the name of the function
+;;; key pressd by the user but, instead, it returns the name of the
+;;; key to which it has been mapped.  It needs to know the name of the
+;;; key pressed by the user. As a workaround, we assign a function to
+;;; each of the unassigned function keys of interest, here.  These
+;;; assignments override the mapping to other keys and are only
+;;; temporary since, when edt-mapper is finished executing, it causes
+;;; Emacs to exit.
+;;;
+
+(mapc
+ (lambda (function-key)
+      (if (not (lookup-key (current-global-map) function-key))
+               (define-key (current-global-map) function-key 'forward-char)))
+ '([kp-0] [kp-1] [kp-2] [kp-3] [kp-4]
+   [kp-5] [kp-6] [kp-7] [kp-8] [kp-9]
+   [kp-
+   [kp-enter]
+   [kp-multiply]
+   [kp-add]
+   [kp-separator]
+   [kp-subtract]
+   [kp-decimal]
+   [kp-divide]
+   [kp-equal]
+   [backspace]
+   [delete]
+   [tab]
+   [linefeed]
+   [clear]))
+
+;;;
 ;;;  Make sure the window is big enough to display the instructions,
 ;;;  except where window cannot be re-sized.
 ;;;


reply via email to

[Prev in Thread] Current Thread [Next in Thread]