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: [bportmann@yahoo.com: Re: mouse-yank-at-point in Comint modes] Date: 29 Jan 2007 10:44:03 -0500 Message-ID: References: <87tzya8swa.fsf@stupidchicken.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: sea.gmane.org 1170085464 17377 80.91.229.12 (29 Jan 2007 15:44:24 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Mon, 29 Jan 2007 15:44:24 +0000 (UTC) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Jan 29 16:44:21 2007 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1HBYg7-0003pi-OW for ged-emacs-devel@m.gmane.org; Mon, 29 Jan 2007 16:44:20 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1HBYg7-0006eQ-6i for ged-emacs-devel@m.gmane.org; Mon, 29 Jan 2007 10:44:19 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1HBYfu-0006cb-QO for emacs-devel@gnu.org; Mon, 29 Jan 2007 10:44:06 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1HBYfu-0006cB-C6 for emacs-devel@gnu.org; Mon, 29 Jan 2007 10:44:06 -0500 Original-Received: from biscayne-one-station.mit.edu ([18.7.7.80]) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA:32) (Exim 4.52) id 1HBYfu-00041b-0B for emacs-devel@gnu.org; Mon, 29 Jan 2007 10:44:06 -0500 Original-Received: from outgoing.mit.edu (OUTGOING-AUTH.MIT.EDU [18.7.22.103]) by biscayne-one-station.mit.edu (8.13.6/8.9.2) with ESMTP id l0TFi47Y000119 for ; Mon, 29 Jan 2007 10:44:04 -0500 (EST) Original-Received: from all-night-tool.mit.edu (ALL-NIGHT-TOOL.MIT.EDU [18.7.18.66]) (authenticated bits=56) (User authenticated as cyd@ATHENA.MIT.EDU) by outgoing.mit.edu (8.13.6/8.12.4) with ESMTP id l0TFi3CZ002368 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT) for ; Mon, 29 Jan 2007 10:44:04 -0500 (EST) Original-Received: (from cyd@localhost) by all-night-tool.mit.edu (8.12.9.20060308) id l0TFi3he023789; Mon, 29 Jan 2007 10:44:03 -0500 (EST) In-Reply-To: Original-Lines: 36 User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.4 X-Scanned-By: MIMEDefang 2.42 X-Spam-Score: 0.00 X-detected-kernel: Solaris 9.1 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:65593 Archived-At: bojohan+news@dd.chalmers.se (Johan Bockg=E5rd) writes: > is this the correct thing to do when > mouse-yank-at-point is nil?: >=20 > + ;; Fall back to the global definition if (i) the selected > + ;; buffer is not a comint buffer (which can happen if a > + ;; non-comint window was selected and we clicked in a comint > + ;; window) [...] >=20 > Shouldn't the binding be looked up where you click in this case? That is tricky to implement, because looking up the key binding of a mouse event automagically uses the keymaps of the clicked window, which may not be the selected window (see the definition of Fkey_binding), so we are back where we started. Also, there are situations where the alternative you suggest is undesirable; if the selected buffer is in some other mode where mouse-2 is not bound to mouse-yank-at-click and you click on a comint buffer in another window, the value of mouse-yank-at-point is irrelevant, so we should use the global binding! The current solution seems to be good enough for all realistic situations. > Btw, the manual's description of what effect mouse-yank-at-point > is supposed to have is confused: >=20 > (info "(emacs)Secondary Selection") >=20 > If `mouse-yank-at-point' is non-`nil', `M-Mouse-2' yanks at point. > Then it does not matter precisely where you click; ALL THAT MATTERS > IS WHICH WINDOW YOU CLICK ON. This is indeed incorrect; I'll fix it.