bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Bug#142608: emacs21: please apply flyspell patch from preview-latex


From: Rob Browning
Subject: Re: Bug#142608: emacs21: please apply flyspell patch from preview-latex package
Date: Sat, 13 Apr 2002 23:15:33 -0500
User-agent: Gnus/5.090006 (Oort Gnus v0.06) Emacs/21.2 (i386-debian-linux-gnu)

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 <agthorr@barsoom.org> 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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]