aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChong Yidong2012-06-20 12:21:57 -0400
committerChong Yidong2012-06-20 12:21:57 -0400
commit297a8f1ddb946903b097fa3bbfa070fcb4a970da (patch)
tree0778568f57274d0652b0bd6612507c7257b1a71d
parentd34c18b1c9854b7dcfd2cf3f7b04197c72719f90 (diff)
downloademacs-297a8f1ddb946903b097fa3bbfa070fcb4a970da.tar.gz
emacs-297a8f1ddb946903b097fa3bbfa070fcb4a970da.zip
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
-rw-r--r--lisp/ChangeLog4
-rw-r--r--lisp/term.el26
2 files changed, 17 insertions, 13 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 882754ecf65..d7716f5fa1a 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,7 @@
12012-06-20 Chong Yidong <cyd@gnu.org>
2
3 * term.el (term-send-raw-meta): Make C-M-<char> keys work (Bug#8172).
4
12012-06-20 David Röthlisberger <david@rothlis.net> (tiny change) 52012-06-20 David Röthlisberger <david@rothlis.net> (tiny change)
2 6
3 * ido.el (ido-switch-buffer, ido-find-file): Fix up doc of C-j 7 * ido.el (ido-switch-buffer, ido-find-file): Fix up doc of C-j
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."
1174(defun term-send-raw-meta () 1174(defun term-send-raw-meta ()
1175 (interactive) 1175 (interactive)
1176 (let ((char last-input-event)) 1176 (let ((char last-input-event))
1177 (when (symbolp last-input-event) 1177 (when (symbolp char)
1178 ;; Convert `return' to C-m, etc. 1178 ;; Convert `return' to C-m, etc.
1179 (let ((tmp (get char 'event-symbol-elements))) 1179 (let ((tmp (get char 'event-symbol-elements)))
1180 (when tmp 1180 (if tmp (setq char (car tmp)))
1181 (setq char (car tmp))) 1181 (and (symbolp char)
1182 (when (symbolp char) 1182 (setq tmp (get char 'ascii-character))
1183 (setq tmp (get char 'ascii-character)) 1183 (setq char tmp))))
1184 (when tmp 1184 (when (numberp char)
1185 (setq char tmp))))) 1185 (let ((base (event-basic-type char))
1186 (setq char (event-basic-type char)) 1186 (mods (delq 'meta (event-modifiers char))))
1187 (term-send-raw-string (if (and (numberp char) 1187 (if (memq 'control mods)
1188 (> char 127) 1188 (setq mods (delq 'shift mods)))
1189 (< char 256)) 1189 (term-send-raw-string
1190 (make-string 1 char) 1190 (format "\e%c"
1191 (format "\e%c" char))))) 1191 (event-convert-list (append mods (list base)))))))))
1192 1192
1193(defun term-mouse-paste (click) 1193(defun term-mouse-paste (click)
1194 "Insert the primary selection at the position clicked on." 1194 "Insert the primary selection at the position clicked on."