(comint-insert-input): Ignore clicks to the right of
authorStefan Monnier <monnier@iro.umontreal.ca>
Tue, 1 Dec 2009 20:31:57 +0000 (20:31 +0000)
committerStefan Monnier <monnier@iro.umontreal.ca>
Tue, 1 Dec 2009 20:31:57 +0000 (20:31 +0000)
the field.  Reported by Bob Nnamtrop <bobnnamtrop@gmail.com>.

lisp/ChangeLog
lisp/comint.el

index b59cfde..93634ce 100644 (file)
@@ -1,5 +1,8 @@
 2009-12-01  Stefan Monnier  <monnier@iro.umontreal.ca>
 
+       * comint.el (comint-insert-input): Ignore clicks to the right of
+       the field.  Reported by Bob Nnamtrop <bobnnamtrop@gmail.com>.
+
        * vc.el (vc-print-log-internal): Don't wait for the prcess to
        terminate before setting up the major mode.
 
index 4dbd581..92bfe24 100644 (file)
@@ -828,7 +828,10 @@ by the global keymap (usually `mouse-yank-at-click')."
   (let ((pos (posn-point (event-end event)))
        field input)
     (with-selected-window (posn-window (event-end event))
-      (and (setq field (field-at-pos pos))
+      ;; If pos is at the very end of a field, the mouse-click was
+      ;; probably outside (to the right) of the field.
+      (and (< pos (field-end pos))
+           (setq field (field-at-pos pos))
           (setq input (field-string-no-properties pos))))
     (if (or (null comint-accum-marker)
            (not (eq field 'input)))