From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Richard Stallman Newsgroups: gmane.emacs.devel Subject: Re: [jdsmith@as.arizona.edu: mouse-yank-at-point in Comint modes] Date: Sat, 09 Dec 2006 13:26:24 -0500 Message-ID: References: <87ac1x2ubx.fsf@pacem.orebokech.com> <87y7ph1a09.fsf@pacem.orebokech.com> Reply-To: rms@gnu.org NNTP-Posting-Host: dough.gmane.org Content-Type: text/plain; charset=ISO-8859-15 X-Trace: sea.gmane.org 1165689000 23372 80.91.229.10 (9 Dec 2006 18:30:00 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Sat, 9 Dec 2006 18:30:00 +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:29:56 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 1Gt6xO-0004Mn-RA for ged-emacs-devel@m.gmane.org; Sat, 09 Dec 2006 19:29:55 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Gt6xN-0007w7-OJ for ged-emacs-devel@m.gmane.org; Sat, 09 Dec 2006 13:29:54 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Gt6u2-0005sN-VA for emacs-devel@gnu.org; Sat, 09 Dec 2006 13:26:26 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Gt6u2-0005rl-Br for emacs-devel@gnu.org; Sat, 09 Dec 2006 13:26:26 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Gt6u2-0005re-50 for emacs-devel@gnu.org; Sat, 09 Dec 2006 13:26:26 -0500 Original-Received: from [199.232.76.164] (helo=fencepost.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.52) id 1Gt6u1-0005Mi-UB for emacs-devel@gnu.org; Sat, 09 Dec 2006 13:26:26 -0500 Original-Received: from rms by fencepost.gnu.org with local (Exim 4.52) id 1Gt6u0-0006dz-UX; Sat, 09 Dec 2006 13:26:25 -0500 Original-To: Romain Francoise In-reply-to: <87y7ph1a09.fsf@pacem.orebokech.com> (message from Romain Francoise on Sat, 09 Dec 2006 14:20:22 +0100) 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:63523 Archived-At: Ah, right. It seems that trying to handle this case is hopeless because when `mouse-yank-at-point' is t, yanking will always try to yank in the wrong buffer if the target buffer is not current when Emacs receives the event (since `mouse-yank-at-click' skips the `mouse-set-point' call in that case). When `mouse-yank-at-point' is t, the right thing to do is look up the binding in the selected window (if it is different from the one clicked on) and run that binding. Both `mouse-yank-at-click' and `comint-insert-input' should do that. That way, if a comint buffer is selected, and you click in another window, `comint-insert-input' will do its thing. We need to prevent this from recurring more than once. So if the function looks up the binding and sees "it's me" it should proceed to do its real job.