]> git.eshelyaron.com Git - emacs.git/commitdiff
term.el (term-send-raw-meta): Make C-M-<char> keys work (Bug#8172).
authorChong Yidong <cyd@gnu.org>
Wed, 20 Jun 2012 16:21:57 +0000 (12:21 -0400)
committerChong Yidong <cyd@gnu.org>
Wed, 20 Jun 2012 16:21:57 +0000 (12:21 -0400)
-------------- This lime and the following will be ignored --------------

modified:
  lisp/ChangeLog
  lisp/term.el

lisp/ChangeLog
lisp/term.el

index 882754ecf65b275acd4195c246242e552ed3233a..d7716f5fa1a7910ec37dc750cee0088fda72b2b6 100644 (file)
@@ -1,3 +1,7 @@
+2012-06-20  Chong Yidong  <cyd@gnu.org>
+
+       * term.el (term-send-raw-meta): Make C-M-<char> keys work (Bug#8172).
+
 2012-06-20  David Röthlisberger  <david@rothlis.net>  (tiny change)
 
        * ido.el (ido-switch-buffer, ido-find-file): Fix up doc of C-j
index 0dc843c5df7694c9605bee76ef12a138cf57ee4e..7461d7443c893ffe7dd2bcf866c1c5ad6e139b15 100644 (file)
@@ -1174,21 +1174,21 @@ without any interpretation."
 (defun term-send-raw-meta ()
   (interactive)
   (let ((char last-input-event))
-    (when (symbolp last-input-event)
+    (when (symbolp char)
       ;; Convert `return' to C-m, etc.
       (let ((tmp (get char 'event-symbol-elements)))
-       (when tmp
-         (setq char (car tmp)))
-       (when (symbolp char)
-         (setq tmp (get char 'ascii-character))
-         (when tmp
-           (setq char tmp)))))
-    (setq char (event-basic-type char))
-    (term-send-raw-string (if (and (numberp char)
-                                  (> char 127)
-                                  (< char 256))
-                             (make-string 1 char)
-                           (format "\e%c" char)))))
+       (if tmp (setq char (car tmp)))
+       (and (symbolp char)
+            (setq tmp (get char 'ascii-character))
+            (setq char tmp))))
+    (when (numberp char)
+      (let ((base (event-basic-type char))
+           (mods (delq 'meta (event-modifiers char))))
+       (if (memq 'control mods)
+           (setq mods (delq 'shift mods)))
+       (term-send-raw-string
+        (format "\e%c"
+                (event-convert-list (append mods (list base)))))))))
 
 (defun term-mouse-paste (click)
   "Insert the primary selection at the position clicked on."