From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: mouse-yank-at-point in Comint modes Date: Tue, 01 Dec 2009 15:34:37 -0500 Message-ID: References: <99750f710905141659j7b4e30e6idbceb8dab8bd9ab7@mail.gmail.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1259699789 9891 80.91.229.12 (1 Dec 2009 20:36:29 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 1 Dec 2009 20:36:29 +0000 (UTC) Cc: emacs-devel@gnu.org To: Bob Nnamtrop Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Dec 01 21:36:22 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 1NFZSP-00061p-Ok for ged-emacs-devel@m.gmane.org; Tue, 01 Dec 2009 21:36:22 +0100 Original-Received: from localhost ([127.0.0.1]:56703 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NFZSP-0000kz-DO for ged-emacs-devel@m.gmane.org; Tue, 01 Dec 2009 15:36:21 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NFZSJ-0000kV-AB for emacs-devel@gnu.org; Tue, 01 Dec 2009 15:36:15 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1NFZSE-0000k0-QU for emacs-devel@gnu.org; Tue, 01 Dec 2009 15:36:15 -0500 Original-Received: from [199.232.76.173] (port=46268 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NFZSE-0000jr-Mo for emacs-devel@gnu.org; Tue, 01 Dec 2009 15:36:10 -0500 Original-Received: from pruche.dit.umontreal.ca ([132.204.246.22]:57667) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1NFZSE-000602-Kn for emacs-devel@gnu.org; Tue, 01 Dec 2009 15:36:10 -0500 Original-Received: from faina.iro.umontreal.ca (faina.iro.umontreal.ca [132.204.26.177]) by pruche.dit.umontreal.ca (8.14.1/8.14.1) with ESMTP id nB1KYb1V019413; Tue, 1 Dec 2009 15:34:37 -0500 Original-Received: by faina.iro.umontreal.ca (Postfix, from userid 20848) id 723883A14D; Tue, 1 Dec 2009 15:34:37 -0500 (EST) In-Reply-To: <99750f710905141659j7b4e30e6idbceb8dab8bd9ab7@mail.gmail.com> (Bob Nnamtrop's message of "Thu, 14 May 2009 17:59:45 -0600") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1.50 (gnu/linux) X-NAI-Spam-Level: X-NAI-Spam-Score: 0.5 X-NAI-Spam-Rules: 2 Rules triggered DATE_FUTURE=0.5, RV3418=0 X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 3) 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:118064 Archived-At: > --- 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)) Thanks. This has been fixed by never calling mouse-set-point here. > (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)))) I'm not sure fixing it in field-at-pos is right, so I fixed it in a similar way in cominut-insert-input. Thank you for your help, Stefan