changeset 36695:8e8c4af5a4ae

(comint-insert-clicked-input): Use the last key from this-command-keys to lookup the global key definition.
author Gerd Moellmann <gerd@gnu.org>
date Fri, 09 Mar 2001 14:20:59 +0000
parents c7ec74e4f2de
children ba2a7a0cfb84
files lisp/comint.el
diffstat 1 files changed, 5 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/comint.el	Fri Mar 09 12:40:47 2001 +0000
+++ b/lisp/comint.el	Fri Mar 09 14:20:59 2001 +0000
@@ -784,7 +784,7 @@
 		(dolist (ov (overlays-at (posn-point (event-end event))))
 		  (when (eq (overlay-get ov 'field) 'input)
 		    (throw 'found ov))))))
-    ;; do we have input in this area?
+    ;; Do we have input in this area?
     (if over
 	(let ((input-str (buffer-substring (overlay-start over)
 					   (overlay-end over))))
@@ -794,9 +794,10 @@
 		(process-mark (get-buffer-process (current-buffer))))
 	   (point))
 	  (insert input-str))
-      ;; fall back to the user's previous definition if we aren't
-      ;; on previous input region.
-      (let ((fun (lookup-key global-map (this-command-keys))))
+      ;; Fall back to the global definition.
+      (let* ((keys (this-command-keys))
+	     (last-key (and (vectorp keys) (aref keys (1- (length keys)))))
+	     (fun (and last-key (lookup-key global-map (vector last-key)))))
 	(if fun (call-interactively fun))))))