unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* Re: Bug#142608: emacs21: please apply flyspell patch from preview-latex package
       [not found] <E16wEb6-0005Op-00@volition>
@ 2002-04-14  4:15 ` Rob Browning
  2002-04-14 10:28   ` David Kastrup
  0 siblings, 1 reply; 2+ messages in thread
From: Rob Browning @ 2002-04-14  4:15 UTC (permalink / raw)
  Cc: 142608-forwarded, Agthorr


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

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Bug#142608: emacs21: please apply flyspell patch from preview-latex package
  2002-04-14  4:15 ` Bug#142608: emacs21: please apply flyspell patch from preview-latex package Rob Browning
@ 2002-04-14 10:28   ` David Kastrup
  0 siblings, 0 replies; 2+ messages in thread
From: David Kastrup @ 2002-04-14 10:28 UTC (permalink / raw)


I have now checked the patch from Emacs-21.1 to Emacs-21.2.  The fixes
are not contained in Emacs-21.2, so it seems they would have been
judged not important enough for the bug fix release 21.2, which I find
unfortunate.  The bugs are not present in the current CVS version,
however, so it may be hoped that they will not make it into 21.3.  As
the main author of preview-latex, and the author of these patches, I
would recommend applying them at the very least when you are
installing preview-latex.  They are rather certainly not causing more
trouble than the original behavior.  They have been tested, and either
they. or equivalent changes, have been put into the current Emacs
sources long ago.

The bugs will affect every package using overlays with keymaps of
their own, not just preview-latex.  I don't know, however, whether
there are packages around where the impact is as annoying as here.

rlb@defaultvalue.org (Rob Browning) writes:

> 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.

I will update preview-latex documentation to state that those bugs
remain in Emacs-21.2.  Pity.

-- 
David Kastrup, Kriemhildstr. 15, 44793 Bochum
Email: David.Kastrup@t-online.de

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2002-04-14 10:28 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <E16wEb6-0005Op-00@volition>
2002-04-14  4:15 ` Bug#142608: emacs21: please apply flyspell patch from preview-latex package Rob Browning
2002-04-14 10:28   ` David Kastrup

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).