unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Rob Browning <rlb@defaultvalue.org>
Cc: 142608-forwarded@bugs.debian.org, Agthorr <agthorr@barsoom.org>
Subject: Re: Bug#142608: emacs21: please apply flyspell patch from preview-latex package
Date: Sat, 13 Apr 2002 23:15:33 -0500	[thread overview]
Message-ID: <871ydiq5ju.fsf@raven.i.defaultvalue.org> (raw)
In-Reply-To: <E16wEb6-0005Op-00@volition> (Agthorr's message of "Fri, 12 Apr 2002 20:53:07 -0700")


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	other threads:[~2002-04-14  4:15 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <E16wEb6-0005Op-00@volition>
2002-04-14  4:15 ` Rob Browning [this message]
2002-04-14 10:28   ` Bug#142608: emacs21: please apply flyspell patch from preview-latex package David Kastrup

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=871ydiq5ju.fsf@raven.i.defaultvalue.org \
    --to=rlb@defaultvalue.org \
    --cc=142608-forwarded@bugs.debian.org \
    --cc=agthorr@barsoom.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).