From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Bob Nnamtrop Newsgroups: gmane.emacs.devel Subject: mouse-yank-at-point in Comint modes Date: Thu, 14 May 2009 17:59:45 -0600 Message-ID: <99750f710905141659j7b4e30e6idbceb8dab8bd9ab7@mail.gmail.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=00163630e99f532f060469e81f78 X-Trace: ger.gmane.org 1242362065 17699 80.91.229.12 (15 May 2009 04:34:25 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 15 May 2009 04:34:25 +0000 (UTC) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri May 15 06:34:18 2009 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 1M4p7d-00071J-HV for ged-emacs-devel@m.gmane.org; Fri, 15 May 2009 06:34:13 +0200 Original-Received: from localhost ([127.0.0.1]:55320 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1M4p7d-00028C-4z for ged-emacs-devel@m.gmane.org; Fri, 15 May 2009 00:34:13 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1M4kq3-0001lY-QE for emacs-devel@gnu.org; Thu, 14 May 2009 19:59:47 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1M4kq3-0001lL-Ai for emacs-devel@gnu.org; Thu, 14 May 2009 19:59:47 -0400 Original-Received: from [199.232.76.173] (port=44870 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1M4kq3-0001lH-4t for emacs-devel@gnu.org; Thu, 14 May 2009 19:59:47 -0400 Original-Received: from yx-out-1718.google.com ([74.125.44.153]:33089) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1M4kq2-0006US-Mv for emacs-devel@gnu.org; Thu, 14 May 2009 19:59:46 -0400 Original-Received: by yx-out-1718.google.com with SMTP id 3so894919yxi.66 for ; Thu, 14 May 2009 16:59:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:date:message-id:subject :from:to:content-type; bh=SqWEuGVRYGBQOgJoiInZ/Tbi3q4FA50EdXbW9B7fvq8=; b=X12oWUTKoH5Q66OqOjo45hlq2Gg15/IsovDQuKYWdDurg8vvhhTNVdOabz0ysTw5f8 FSRtLewM2wDr6MqLULpdUoRDQ95BjzkeOeGmvZ2wTdvI/awx5artLsPgHSvr2ZSk3dR2 LlokoMqVZbEltQ3uYSPxJ2WYj2rQuoeNNJ3uo= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type; b=qDkloiWnHlaJBylQglTUx5rSguJ7cgfqxpKifHHznPnvU4zCH3iLWMda5m0gOYU9Of 4vRXT+LpqqGT/LGVqBbMMvBohNXtZBq0eFFI/nfeFG7xvdZo2ly9O8jW+9SKXH0w21Dg k5OF+ltKN6ctpzaT4DYCpBB0CuYJn0MyduSiE= Original-Received: by 10.90.25.11 with SMTP id 11mr2272467agy.2.1242345585716; Thu, 14 May 2009 16:59:45 -0700 (PDT) X-detected-operating-system: by monty-python.gnu.org: Genre and OS details not recognized. X-Mailman-Approved-At: Fri, 15 May 2009 00:34:02 -0400 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:110883 Archived-At: --00163630e99f532f060469e81f78 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Comint mode does not honor mouse-yank-at-point. This has been mentioned in 2006 and 2008 in these posts: http://www.nabble.com/mouse-yank-at-point-in-Comint-modes-to19445336.html http://www.nabble.com/mouse-yank-at-point-in-Comint-modes-to7731895.html Here is an updated patch of the simple one-line fix (which works great in my usage). Could it get applied before the release? --- emacs-23.0.93/lisp/comint.el 2009-01-06 13:29:03.000000000 -0700 +++ emacs/lisp/comint.el 2009-05-14 17:31:05.000000000 -0600 @@ -816,7 +816,7 @@ If there is no previous input at point, run the command specified by the global keymap (usually `mouse-yank-at-point')." (interactive "e") - (mouse-set-point event) + (unless mouse-yank-at-point (mouse-set-point event)) (let ((pos (posn-point (event-end event))) field input) (with-selected-window (posn-window (event-end event)) Here is another simple patch which fixes another annoyance. When the mouse is over an old input in comint mode, that input is highlighted and a mouse-2 click will yank it to the command line. This is fine except that it still happens if the mouse is beyond the end of the old input and the old input is not highlighted. This simple patch fixes this. Could it also get applied before the release? diff -r -u emacs-23.0.93/lisp/subr.el emacs/lisp/subr.el --- emacs-23.0.93/lisp/subr.el 2009-04-28 22:45:17.000000000 -0600 +++ emacs/lisp/subr.el 2009-05-14 17:52:33.000000000 -0600 @@ -2319,10 +2319,11 @@ (defun field-at-pos (pos) "Return the field at position POS, taking stickiness etc into account." - (let ((raw-field (get-char-property (field-beginning pos) 'field))) - (if (eq raw-field 'boundary) - (get-char-property (1- (field-end pos)) 'field) - raw-field))) + (if (< pos (field-end pos)) + (let ((raw-field (get-char-property (field-beginning pos) 'field))) + (if (eq raw-field 'boundary) + (get-char-property (1- (field-end pos)) 'field) + raw-field)))) ;;;; Support for yanking and text properties. --00163630e99f532f060469e81f78 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Comint mode does not honor mouse-yank-at-point.=A0 This has been mentioned = in 2006 and 2008 in these posts:

http://www.nabble.com/mo= use-yank-at-point-in-Comint-modes-to19445336.html

http://www.nabble.com/mouse-yank-at-point-in-Comint-modes-to7= 731895.html

Here is an updated patch of the simple one-line fix = (which works great in my usage).=A0 Could it get applied before the release= ?

--- emacs-23.0.93/lisp/comint.el=A0=A0=A0 2009-01-06 13:29:03.000000000= -0700
+++ emacs/lisp/comint.el=A0=A0=A0 2009-05-14 17:31:05.000000000 -= 0600
@@ -816,7 +816,7 @@
=A0If there is no previous input at point, r= un the command specified
=A0by the global keymap (usually `mouse-yank-at-point')."
=A0= =A0 (interactive "e")
-=A0 (mouse-set-point event)
+=A0 (un= less mouse-yank-at-point (mouse-set-point event))
=A0=A0 (let ((pos (pos= n-point (event-end event)))
=A0=A0=A0=A0 field input)
=A0=A0=A0=A0 (with-selected-window (posn-windo= w (event-end event))

Here= is another simple patch which fixes another annoyance.=A0 When the mouse i= s over an old input in comint mode, that input is highlighted and a mouse-2= click will yank it to the command line.=A0 This is fine except that it sti= ll happens if the mouse is beyond the end of the old input and the old inpu= t is not highlighted.=A0 This simple patch fixes this.=A0 Could it also get= applied before the release?

diff -r -u emacs-23.0.93/lisp/subr.el emacs/lisp/subr.el
--- emacs-2= 3.0.93/lisp/subr.el=A0=A0=A0 2009-04-28 22:45:17.000000000 -0600
+++ ema= cs/lisp/subr.el=A0=A0=A0 2009-05-14 17:52:33.000000000 -0600
@@ -2319,10= +2319,11 @@
=A0
=A0(defun field-at-pos (pos)
=A0=A0 "Return the field at pos= ition POS, taking stickiness etc into account."
-=A0 (let ((raw-fie= ld (get-char-property (field-beginning pos) 'field)))
-=A0=A0=A0 (if= (eq raw-field 'boundary)
-=A0=A0=A0 (get-char-property (1- (field-end pos)) 'field)
-=A0=A0= =A0=A0=A0 raw-field)))
+=A0 (if (< pos (field-end pos))
+=A0=A0=A0= =A0=A0 (let ((raw-field (get-char-property (field-beginning pos) 'field= )))
+=A0=A0=A0=A0=A0=A0=A0 (if (eq raw-field 'boundary)
+=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 (get-char-property (1- (field-end pos)) = 'field)
+=A0=A0=A0=A0=A0=A0=A0=A0=A0 raw-field))))
=A0
=A0
=
=A0;;;; Support for yanking and text properties.

--00163630e99f532f060469e81f78--