summaryrefslogtreecommitdiff
path: root/lisp/terminal.el
diff options
context:
space:
mode:
authorKarl Heuer <kwzh@gnu.org>1995-09-21 20:54:35 +0000
committerKarl Heuer <kwzh@gnu.org>1995-09-21 20:54:35 +0000
commit09dfcb8c4485db27734ecd5add6d563758102f74 (patch)
treecaf930535512ae137510f94e2f23432747eace65 /lisp/terminal.el
parentc57446068a932dbe89d0d3572f3a77fa7599aebf (diff)
downloademacs-09dfcb8c4485db27734ecd5add6d563758102f74.tar.gz
(te-escape, te-escape-help): Handle non-ASCII events.
Diffstat (limited to 'lisp/terminal.el')
-rw-r--r--lisp/terminal.el45
1 files changed, 29 insertions, 16 deletions
diff --git a/lisp/terminal.el b/lisp/terminal.el
index 6dbd10a2a85..07baabddaa4 100644
--- a/lisp/terminal.el
+++ b/lisp/terminal.el
@@ -168,26 +168,39 @@ performance.")
(defun te-escape ()
(interactive)
(let (s
- (local (current-local-map))
- (global (current-global-map)))
+ (local ((defun te-escape ()
+ (interactive)
+ (let (s
+ (local (current-local-map))
+ (global (current-global-map)))
(unwind-protect
- (progn
- (use-global-map terminal-escape-map)
- (use-local-map terminal-escape-map)
- (setq s (read-key-sequence
- (if current-prefix-arg
- (format "Emacs Terminal escape> %d "
- (prefix-numeric-value current-prefix-arg))
- "Emacs Terminal escape> "))))
+ (progn
+ (use-global-map terminal-escape-map)
+ (use-local-map terminal-escape-map)
+ (setq s (read-key-sequence
+ (if current-prefix-arg
+ (format "Emacs Terminal escape> %d "
+ (prefix-numeric-value current-prefix-arg))
+ "Emacs Terminal escape> "))))
(use-global-map global)
(use-local-map local))
+
(message "")
- (cond ((string= s (make-string 1 terminal-escape-char))
- (setq last-command-char terminal-escape-char)
- (let ((terminal-escape-char -259))
- (te-pass-through)))
- ((setq s (lookup-key terminal-escape-map s))
- (call-interactively s)))))
+
+ (cond
+ ;; Certain keys give vector notation, like [escape] when
+ ;; you hit esc key...
+ ((and (stringp s)
+ (string= s (make-string 1 terminal-escape-char)))
+ (setq last-command-char terminal-escape-char)
+ (let ((terminal-escape-char -259))
+ (te-pass-through)))
+
+ ((setq s (lookup-key terminal-escape-map s))
+ (call-interactively s)))
+
+ ))
+
(defun te-escape-help ()
"Provide help on commands available after terminal-escape-char is typed."