diff options
author | Chong Yidong <cyd@gnu.org> | 2012-06-20 12:21:57 -0400 |
---|---|---|
committer | Chong Yidong <cyd@gnu.org> | 2012-06-20 12:21:57 -0400 |
commit | 297a8f1ddb946903b097fa3bbfa070fcb4a970da (patch) | |
tree | 0778568f57274d0652b0bd6612507c7257b1a71d /lisp/term.el | |
parent | d34c18b1c9854b7dcfd2cf3f7b04197c72719f90 (diff) | |
download | emacs-297a8f1ddb946903b097fa3bbfa070fcb4a970da.tar.gz |
term.el (term-send-raw-meta): Make C-M-<char> keys work (Bug#8172).
-------------- This lime and the following will be ignored --------------
modified:
lisp/ChangeLog
lisp/term.el
Diffstat (limited to 'lisp/term.el')
-rw-r--r-- | lisp/term.el | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/lisp/term.el b/lisp/term.el index 0dc843c5df7..7461d7443c8 100644 --- a/lisp/term.el +++ b/lisp/term.el @@ -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." |