]> git.eshelyaron.com Git - emacs.git/commitdiff
(comint-insert-input): Be careful to only set point if we
authorStefan Monnier <monnier@iro.umontreal.ca>
Sun, 30 Aug 2009 05:10:22 +0000 (05:10 +0000)
committerStefan Monnier <monnier@iro.umontreal.ca>
Sun, 30 Aug 2009 05:10:22 +0000 (05:10 +0000)
don't delegate to some other command.

lisp/ChangeLog
lisp/comint.el

index c67c63953f5ed5547b6943b0cacb60b3758488df..8bfd1dfa019a3aecab9503ec05afdbf13fccacfd 100644 (file)
@@ -1,5 +1,8 @@
 2009-08-30  Stefan Monnier  <monnier@iro.umontreal.ca>
 
+       * comint.el (comint-insert-input): Be careful to only set point if we
+       don't delegate to some other command.
+
        * proced.el (proced-signal-list): Make it an alist.
        (proced-grammar-alist): Capitalize names.
        (proced-send-signal): Use a non-hidden buffer (since it's displayed).
index 4fa9f7c3ced84ecc914b09aaf83ccd1fa5d08ecf..69fd32d9b3bfd766a9aec70b3924fbe8f1413346 100644 (file)
@@ -816,7 +816,9 @@ buffer.  The hook `comint-exec-hook' is run after each exec."
 If there is no previous input at point, run the command specified
 by the global keymap (usually `mouse-yank-at-click')."
   (interactive "e")
-  (mouse-set-point event)
+  ;; Don't set the mouse here, since it may otherwise change the behavior
+  ;; of the command on which we fallback if there's no field at point.
+  ;; (mouse-set-point event)
   (let ((pos (posn-point (event-end event)))
        field input)
     (with-selected-window (posn-window (event-end event))
@@ -833,15 +835,16 @@ by the global keymap (usually `mouse-yank-at-click')."
               (fun (and last-key (lookup-key global-map (vector last-key)))))
          (and fun (not (eq fun 'comint-insert-input))
               (call-interactively fun)))
-      ;; Otherwise, insert the previous input.
-      (goto-char (point-max))
-      ;; First delete any old unsent input at the end
-      (delete-region
-       (or (marker-position comint-accum-marker)
-          (process-mark (get-buffer-process (current-buffer))))
-       (point))
-      ;; Insert the input at point
-      (insert input))))
+      (with-selected-window (posn-window (event-end event))
+        ;; Otherwise, insert the previous input.
+        (goto-char (point-max))
+        ;; First delete any old unsent input at the end
+        (delete-region
+         (or (marker-position comint-accum-marker)
+             (process-mark (get-buffer-process (current-buffer))))
+         (point))
+        ;; Insert the input at point
+        (insert input)))))
 \f
 ;; Input history processing in a buffer
 ;; ===========================================================================