[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: mouse-yank-at-point in Comint modes
From: |
Chong Yidong |
Subject: |
Re: mouse-yank-at-point in Comint modes |
Date: |
Sat, 09 Dec 2006 13:22:47 -0500 |
User-agent: |
Gnus/5.11 (Gnus v5.11) Emacs/22.0.91 (gnu/linux) |
JD Smith <address@hidden> writes:
> COMINT modes like shell inhibit the behavior of mouse-yank-at-point.
>
> M-x shell
> M-x set-variable [Ret] mouse-yank-at-point [Ret] t
> % echo foo [C-a]
> [Select text in another buffer and middle click into shell buffer, after
> 'foo']
>
> Text is not yanked at point. This is a new behavior of Emacs 22.
I'm a bit confused about what's going on in this part of the code.
This issue has come up before:
2005-03-24 Stefan Monnier <address@hidden>
* comint.el (comint-insert-input): Obey mouse-yank-at-point.
It's not clear to me how subsequent changes broke this. Naively, I'd
propose the following change; are there subtleties here that would
make it not work?
*** emacs/lisp/comint.el.~1.352.~ 2006-12-09 10:48:30.000000000 -0500
--- emacs/lisp/comint.el 2006-12-09 13:15:19.000000000 -0500
***************
*** 805,811 ****
(defun comint-insert-input (event)
"In a Comint buffer, set the current input to the previous input at point."
(interactive "e")
! (mouse-set-point event)
(let ((pos (point)))
(if (not (eq (field-at-pos pos) 'input))
;; No input at POS, fall back to the global definition.
--- 805,811 ----
(defun comint-insert-input (event)
"In a Comint buffer, set the current input to the previous input at point."
(interactive "e")
! (unless mouse-yank-at-point (mouse-set-point event))
(let ((pos (point)))
(if (not (eq (field-at-pos pos) 'input))
;; No input at POS, fall back to the global definition.