From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Rob Browning Newsgroups: gmane.emacs.bugs Subject: Re: Bug#142608: emacs21: please apply flyspell patch from preview-latex package Date: Sat, 13 Apr 2002 23:15:33 -0500 Sender: bug-gnu-emacs-admin@gnu.org Message-ID: <871ydiq5ju.fsf@raven.i.defaultvalue.org> References: NNTP-Posting-Host: localhost.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: main.gmane.org 1018757886 22651 127.0.0.1 (14 Apr 2002 04:18:06 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Sun, 14 Apr 2002 04:18:06 +0000 (UTC) Cc: 142608-forwarded@bugs.debian.org, Agthorr Return-path: Original-Received: from fencepost.gnu.org ([199.232.76.164]) by main.gmane.org with esmtp (Exim 3.33 #1 (Debian)) id 16wbSo-0005tD-00 for ; Sun, 14 Apr 2002 06:18:06 +0200 Original-Received: from localhost ([127.0.0.1] helo=fencepost.gnu.org) by fencepost.gnu.org with esmtp (Exim 3.34 #1 (Debian)) id 16wbSq-0003fZ-00; Sun, 14 Apr 2002 00:18:08 -0400 Original-Received: from dsl-209-87-109-2.constant.com ([209.87.109.2] helo=defaultvalue.org) by fencepost.gnu.org with esmtp (Exim 3.34 #1 (Debian)) id 16wbQM-0003V7-00 for ; Sun, 14 Apr 2002 00:15:35 -0400 Original-Received: from raven.i.defaultvalue.org (raven.i.defaultvalue.org [192.168.1.7]) by defaultvalue.org (Postfix) with ESMTP id F0C1D4444; Sat, 13 Apr 2002 23:15:33 -0500 (CDT) Original-Received: by raven.i.defaultvalue.org (Postfix, from userid 1000) id 6F2002D86; Sat, 13 Apr 2002 23:15:33 -0500 (CDT) Original-To: bug-gnu-emacs@gnu.org In-Reply-To: (Agthorr's message of "Fri, 12 Apr 2002 20:53:07 -0700") Original-Lines: 125 User-Agent: Gnus/5.090006 (Oort Gnus v0.06) Emacs/21.2 (i386-debian-linux-gnu) Errors-To: bug-gnu-emacs-admin@gnu.org X-BeenThere: bug-gnu-emacs@gnu.org X-Mailman-Version: 2.0.9 Precedence: bulk List-Help: List-Post: List-Subscribe: , List-Id: Bug reports for GNU Emacs, the Swiss army knife of text editors List-Unsubscribe: , List-Archive: Xref: main.gmane.org gmane.emacs.bugs:655 X-Report-Spam: http://spam.gmane.org/gmane.emacs.bugs:655 A recent report suggests Emacs 21.2 may have a bug which interacts with the preview-latex package. I've included the two Emacs patches provided by the preview-latex source below in case you haven't received them yet through other channels. Please let me know if you'd like me to include these patches in the current Debian Emacs 21.2 package. Thanks Agthorr writes: > Package: emacs21 > Version: 21.2-1 > Severity: normal > Tags: patch > > The preview-latex package uses the middle mouse button to toggle > between previewing images and seeing the LaTeX code. However, bugs in > flyspell.el and mouse-drag.el cause the button to paste instead, if > one is also using one of those packages (and I swear by flyspell :>). > The preview-latex source package includes patches to fix these bugs. > If you could please apply them, it'd be greatly appreciated! Here are the patches from the preview-latex source (http://sourceforge.net/projects/preview-latex): Apply this patch only if middle-mouse clicks on preview-icons paste instead of toggling when using mouse-drag mode. After version 21.1 of Emacs, this should be fixed already. --- mouse-drag.el.old Mon Jan 8 20:12:12 2001 +++ mouse-drag.el Tue Nov 13 22:47:36 2001 @@ -208,7 +208,7 @@ (start-col (car (posn-col-row start-posn))) (old-selected-window (selected-window)) event end row mouse-delta scroll-delta - have-scrolled point-event-p old-binding + have-scrolled window-last-row col mouse-col-delta window-last-col (scroll-col-delta 0) @@ -261,18 +261,13 @@ (mouse-drag-safe-scroll scroll-delta scroll-col-delta) (mouse-drag-repeatedly-safe-scroll scroll-delta scroll-col-delta))))) ;xxx ;; If it was a click and not a drag, prepare to pass the event on. - ;; Note: We must determine the pass-through event before restoring - ;; the window, but invoke it after. Sigh. + ;; Is there a more correct way to reconstruct the event? (if (and (not have-scrolled) (mouse-drag-events-are-point-events-p start-posn end)) - (setq point-event-p t - old-binding (key-binding - (vector (event-basic-type start-event))))) + (push (cons (event-basic-type start-event) (cdr start-event)) + unread-command-events)) ;; Now restore the old window. - (select-window old-selected-window) - ;; For clicks, call the old function. - (if point-event-p - (call-interactively old-binding)))) + (select-window old-selected-window))) (defun mouse-drag-drag (start-event) "\"Drag\" the page according to a mouse drag. @@ -297,7 +292,7 @@ (start-col (car (posn-col-row start-posn))) (old-selected-window (selected-window)) event end row mouse-delta scroll-delta - have-scrolled point-event-p old-binding + have-scrolled window-last-row col mouse-col-delta window-last-col (scroll-col-delta 0) @@ -335,18 +330,14 @@ (setq have-scrolled t) (mouse-drag-safe-scroll scroll-delta scroll-col-delta))))))) ;; If it was a click and not a drag, prepare to pass the event on. - ;; Note: We must determine the pass-through event before restoring - ;; the window, but invoke it after. Sigh. + ;; Is there a more correct way to reconstruct the event? (if (and (not have-scrolled) (mouse-drag-events-are-point-events-p start-posn end)) - (setq point-event-p t - old-binding (key-binding - (vector (event-basic-type start-event))))) + (push (cons (event-basic-type start-event) (cdr start-event)) + unread-command-events)) ;; Now restore the old window. - (select-window old-selected-window) - ;; For clicks, call the old function. - (if point-event-p - (call-interactively old-binding)))) + (select-window old-selected-window))) + (provide 'mouse-drag) Apply this patch only if middle-mouse clicks on preview-icons paste instead of toggling when in fly-spell mode. After version 21.1 of Emacs, this should be fixed already. --- /usr/local/emacs-21/share/emacs/21.1/lisp/textmodes/flyspell.el.old Mon Jul 16 14:22:59 2001 +++ /usr/local/emacs-21/share/emacs/21.1/lisp/textmodes/flyspell.el Wed Nov 7 16:18:54 2001 @@ -378,9 +378,7 @@ (setq minor-mode-map-alist (cons (cons 'flyspell-mode flyspell-mode-map) minor-mode-map-alist))) - (define-key flyspell-mode-map "\M-\t" 'flyspell-auto-correct-word) - (define-key flyspell-mode-map [(mouse-2)] - (function flyspell-correct-word/local-keymap))) + (define-key flyspell-mode-map "\M-\t" 'flyspell-auto-correct-word)) ;; the name of the overlay property that defines the keymap -- Rob Browning rlb @defaultvalue.org, @linuxdevel.com, and @debian.org Previously @cs.utexas.edu GPG=1C58 8B2C FB5E 3F64 EA5C 64AE 78FE E5FE F0CB A0AD