From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Chong Yidong Newsgroups: gmane.emacs.devel Subject: Re: mouse-yank-at-point in Comint modes Date: Sat, 09 Dec 2006 13:22:47 -0500 Message-ID: <87r6v9szd4.fsf@stupidchicken.com> References: NNTP-Posting-Host: dough.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1165688600 22373 80.91.229.10 (9 Dec 2006 18:23:20 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Sat, 9 Dec 2006 18:23:20 +0000 (UTC) Cc: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat Dec 09 19:23:19 2006 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by dough.gmane.org with esmtp (Exim 4.50) id 1Gt6qz-0003ic-BZ for ged-emacs-devel@m.gmane.org; Sat, 09 Dec 2006 19:23:17 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Gt6qy-0003tj-Ij for ged-emacs-devel@m.gmane.org; Sat, 09 Dec 2006 13:23:16 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Gt6qS-0003hc-5X for emacs-devel@gnu.org; Sat, 09 Dec 2006 13:22:44 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Gt6qQ-0003ge-H1 for emacs-devel@gnu.org; Sat, 09 Dec 2006 13:22:42 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Gt6qQ-0003gU-Ak for emacs-devel@gnu.org; Sat, 09 Dec 2006 13:22:42 -0500 Original-Received: from [18.19.1.138] (helo=cyd.mit.edu) by monty-python.gnu.org with esmtp (Exim 4.52) id 1Gt6qQ-0004cB-2u for emacs-devel@gnu.org; Sat, 09 Dec 2006 13:22:42 -0500 Original-Received: by cyd.mit.edu (Postfix, from userid 1000) id D47FE4E458; Sat, 9 Dec 2006 13:22:47 -0500 (EST) Original-To: JD Smith In-Reply-To: (JD Smith's message of "Wed\, 06 Dec 2006 18\:16\:10 -0700") User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.91 (gnu/linux) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:63516 Archived-At: JD Smith 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 * 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.