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: Re: mouse-yank-at-point in Comint modes Date: Tue, 1 Dec 2009 17:30:42 -0700 Message-ID: <99750f710912011630t7a6e5edaifc980498d2ddaaca@mail.gmail.com> References: <99750f710905141659j7b4e30e6idbceb8dab8bd9ab7@mail.gmail.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=0016e6d9a3ac18457b0479b3fce0 X-Trace: ger.gmane.org 1259713869 22056 80.91.229.12 (2 Dec 2009 00:31:09 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 2 Dec 2009 00:31:09 +0000 (UTC) Cc: emacs-devel@gnu.org To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Dec 02 01:31:01 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 1NFd7P-0000Zg-Nf for ged-emacs-devel@m.gmane.org; Wed, 02 Dec 2009 01:30:56 +0100 Original-Received: from localhost ([127.0.0.1]:39865 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NFd7P-0007Hw-FX for ged-emacs-devel@m.gmane.org; Tue, 01 Dec 2009 19:30:55 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NFd7K-0007HY-5c for emacs-devel@gnu.org; Tue, 01 Dec 2009 19:30:50 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1NFd7F-0007H5-0t for emacs-devel@gnu.org; Tue, 01 Dec 2009 19:30:49 -0500 Original-Received: from [199.232.76.173] (port=49206 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NFd7E-0007H2-SE for emacs-devel@gnu.org; Tue, 01 Dec 2009 19:30:44 -0500 Original-Received: from mail-ew0-f224.google.com ([209.85.219.224]:34238) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1NFd7E-0003rm-Gg for emacs-devel@gnu.org; Tue, 01 Dec 2009 19:30:44 -0500 Original-Received: by ewy24 with SMTP id 24so6040821ewy.26 for ; Tue, 01 Dec 2009 16:30:42 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:cc:content-type; bh=eW1u5hMCTWxE0dizhjs/fWVdPgRvTrANB+jqEvnfSS0=; b=lHdxXZkeW7cD8EPjzYvGvavwpvTqC6RWQ8JD1a3/qtsecYNYyT5fhyPnJ//5w7UuhH LjHdMMHY7rcW+DzIuhigaDcLp2FYhvdU9OX/WqAwq3IFmxy4dWWXM7EuqdmC5Lkihb1B NAgEY36jycPZFxnKDWzuBHzTDa08ZT6n8Yq8o= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; b=ornlxNI3vkSq+FMg2G7e+mFC0FwiLkfd6WQD/zZZwZ/4LwgBNn3AgnKs/+pIevzxt1 yi64/+DGAcAi50ZKAuleOGK/SSft5296vHreba64JJtFKmIfSuMhVgwMfuyRiTgThsf9 rukg9RQ48LCn/R1nM6qCUFuFZMVQxJespHALk= Original-Received: by 10.216.89.194 with SMTP id c44mr2029569wef.199.1259713842398; Tue, 01 Dec 2009 16:30:42 -0800 (PST) In-Reply-To: X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 2) 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:118090 Archived-At: --0016e6d9a3ac18457b0479b3fce0 Content-Type: text/plain; charset=ISO-8859-1 On Tue, Dec 1, 2009 at 1:34 PM, Stefan Monnier wrote: > > --- 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, > > Thanks for the fixes. I just tried them and they work fine. Bob --0016e6d9a3ac18457b0479b3fce0 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable On Tue, Dec 1, 2009 at 1:34 PM, Stefan Monnier <monnier@iro.umontreal.ca> wrote:
> --- emacs-23.0.93/lisp/comint.el =A0 =A02009-01-06 1= 3:29:03.000000000 -0700
> +++ emacs/lisp/comint.el =A0 =A02009-05-14 17:31:05.000000000 -0600 > @@ -816,7 +816,7 @@
> =A0If there is no previous input at point, run the command specified > =A0by the global keymap (usually `mouse-yank-at-point')."
> =A0 =A0(interactive "e")
> - =A0(mouse-set-point event)
> + =A0(unless mouse-yank-at-point (mouse-set-point event))
> =A0 =A0(let ((pos (posn-point (event-end event)))
> =A0 =A0 =A0field input)
> =A0 =A0 =A0(with-selected-window (posn-window (event-end event))

Thanks. =A0This has been fixed by never calling mouse-set-point here.=

> =A0(defun field-at-pos (pos)
> =A0 =A0"Return the field at position POS, taking stickiness etc i= nto account."
> - =A0(let ((raw-field (get-char-property (field-beginning pos) 'fi= eld)))
> - =A0 =A0(if (eq raw-field 'boundary)
> - =A0 =A0(get-char-property (1- (field-end pos)) 'field)
> - =A0 =A0 =A0raw-field)))
> + =A0(if (< pos (field-end pos))
> + =A0 =A0 =A0(let ((raw-field (get-char-property (field-beginning pos)= 'field)))
> + =A0 =A0 =A0 =A0(if (eq raw-field 'boundary)
> + =A0 =A0 =A0 =A0 =A0 =A0(get-char-property (1- (field-end pos)) '= field)
> + =A0 =A0 =A0 =A0 =A0raw-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. =A0Thank you for your help,


Thanks for the fix= es.=A0 I just tried them and they work fine.=A0

Bob
--0016e6d9a3ac18457b0479b3fce0--