unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* [drew.adams@oracle.com: mouse-2 on menu item yanks into current buffer]
@ 2006-03-06  0:51 Richard Stallman
  2006-03-06  9:16 ` Kim F. Storm
  2006-03-11 13:55 ` Eli Zaretskii
  0 siblings, 2 replies; 7+ messages in thread
From: Richard Stallman @ 2006-03-06  0:51 UTC (permalink / raw)


This does not happen on GNU/Linux, so I think it is a Windows-only bug.

------- Start of forwarded message -------
From: "Drew Adams" <drew.adams@oracle.com>
To: "Emacs-Pretest-Bug" <emacs-pretest-bug@gnu.org>
Date: Fri, 3 Mar 2006 20:56:47 -0800
MIME-Version: 1.0
Content-Type: text/plain;
	charset="iso-8859-1"
Subject: mouse-2 on menu item yanks into current buffer

emacs -q

select some text, so it can be yanked

open a menu-bar menu, and click mouse-2, instead of mouse-1, on any menu
item

The mouse-2 command is executed in the current buffer. In a text
buffer, the copied text is yanked. In dired, the file on the curren
line is opened.

This is a pernicious bug because:

1. It is easy to fall into, especially for newbies.

2. It is easy not to recognize that it has occurred - you must either
   watch the buffer-modified flag in the mode line or the region
   yanked must be big enough to be obvious.

This bug is apparently old - it occurs in Emacs 20 also.


In GNU Emacs 22.0.50.1 (i386-mingw-nt5.1.2600)
 of 2005-06-26 on NONIQPC
X server distributor `Microsoft Corp.', version 5.1.2600
configured using `configure --with-gcc
(3.3) --cflags -I../../jpeg-6b-3/include -I../../libpng-1.2.8/include -I../.
./tiff-3.6.1-2/include -I../../xpm-nox-4.2.0/include -I../../zlib-1.2.2/incl
ude'



_______________________________________________
emacs-pretest-bug mailing list
emacs-pretest-bug@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-pretest-bug
------- End of forwarded message -------

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

* Re: [drew.adams@oracle.com: mouse-2 on menu item yanks into current buffer]
  2006-03-06  0:51 [drew.adams@oracle.com: mouse-2 on menu item yanks into current buffer] Richard Stallman
@ 2006-03-06  9:16 ` Kim F. Storm
  2006-03-06 16:21   ` Drew Adams
  2006-03-11 13:55 ` Eli Zaretskii
  1 sibling, 1 reply; 7+ messages in thread
From: Kim F. Storm @ 2006-03-06  9:16 UTC (permalink / raw)
  Cc: emacs-devel

Richard Stallman <rms@gnu.org> writes:

> This does not happen on GNU/Linux, so I think it is a Windows-only bug.

Or it is because Drew continues to use an 8 months old build.

I don't claim that the bug has been fixed, but who knows?

> In GNU Emacs 22.0.50.1 (i386-mingw-nt5.1.2600)
>  of 2005-06-26 on NONIQPC

Come on, Drew.  It's time to upgrade before you report more bugs!


-- 
Kim F. Storm <storm@cua.dk> http://www.cua.dk

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

* RE: [drew.adams@oracle.com: mouse-2 on menu item yanks into current buffer]
  2006-03-06  9:16 ` Kim F. Storm
@ 2006-03-06 16:21   ` Drew Adams
  0 siblings, 0 replies; 7+ messages in thread
From: Drew Adams @ 2006-03-06 16:21 UTC (permalink / raw)


    > This does not happen on GNU/Linux, so I think it is a
    > Windows-only bug.

    Or it is because Drew continues to use an 8 months old build.
    I don't claim that the bug has been fixed, but who knows?

Who knows, indeed? How to find out?

In this case, trying the reproduce-bug recipe should take less than 2
seconds for someone on Windows - certainly less time than to send an email
saying "who knows?".

    > In GNU Emacs 22.0.50.1 (i386-mingw-nt5.1.2600)
    >  of 2005-06-26 on NONIQPC

    Come on, Drew.  It's time to upgrade before you report more bugs!

I think you'll find that the great majority of bugs I've reported had not
already been fixed. But I recognize that it is a nuisance to track down a
bug report for something that is already fixed.

I don't use an old binary on purpose, just to frustrate you and hassle with
more bugs myself. If someone points me to a more recent Windows binary that
is vanilla Emacs (and that I can get to by http), I'll grab it and use it in
a heartbeat. This is the most recent binary I have found.

How about a release ;-)?

If you like, I can stop reporting bugs until I have a release to report on.
Or I can report what I happen to see now, and you can ignore the reports
until you get a confirming report from a more recent build.

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

* Re: [drew.adams@oracle.com: mouse-2 on menu item yanks into current buffer]
  2006-03-06  0:51 [drew.adams@oracle.com: mouse-2 on menu item yanks into current buffer] Richard Stallman
  2006-03-06  9:16 ` Kim F. Storm
@ 2006-03-11 13:55 ` Eli Zaretskii
  2006-03-11 14:43   ` Jason Rumney
  1 sibling, 1 reply; 7+ messages in thread
From: Eli Zaretskii @ 2006-03-11 13:55 UTC (permalink / raw)
  Cc: jasonr, emacs-devel

> From: Richard Stallman <rms@gnu.org>
> Date: Sun, 05 Mar 2006 19:51:18 -0500
> 
> This does not happen on GNU/Linux, so I think it is a Windows-only bug.
> 
> ------- Start of forwarded message -------
> From: "Drew Adams" <drew.adams@oracle.com>
> To: "Emacs-Pretest-Bug" <emacs-pretest-bug@gnu.org>
> Date: Fri, 3 Mar 2006 20:56:47 -0800
> MIME-Version: 1.0
> Content-Type: text/plain;
> 	charset="iso-8859-1"
> Subject: mouse-2 on menu item yanks into current buffer
> 
> emacs -q
> 
> select some text, so it can be yanked
> 
> open a menu-bar menu, and click mouse-2, instead of mouse-1, on any menu
> item
> 
> The mouse-2 command is executed in the current buffer. In a text
> buffer, the copied text is yanked. In dired, the file on the curren
> line is opened.
> 
> This is a pernicious bug because:
> 
> 1. It is easy to fall into, especially for newbies.
> 
> 2. It is easy not to recognize that it has occurred - you must either
>    watch the buffer-modified flag in the mode line or the region
>    yanked must be big enough to be obvious.
> 
> This bug is apparently old - it occurs in Emacs 20 also.

Would Windows GUI gurus please look at the patch below and tell if
it's the right one?  It does seem to fix the problem for me (on
Windows XP):

Index: src/w32fns.c
===================================================================
RCS file: /cvsroot/emacs/emacs/src/w32fns.c,v
retrieving revision 1.262
diff -u -p -r1.262 w32fns.c
--- src/w32fns.c	6 Feb 2006 15:23:22 -0000	1.262
+++ src/w32fns.c	11 Mar 2006 13:52:50 -0000
@@ -3127,8 +3127,13 @@ w32_wnd_proc (hwnd, msg, wParam, lParam)
 
       /* Simulate middle mouse button events when left and right buttons
 	 are used together, but only if user has two button mouse. */
-    case WM_LBUTTONDOWN:
     case WM_RBUTTONDOWN:
+      /* Ignore right button as long as the menu is active.  */
+      f = x_window_to_frame (dpyinfo, hwnd);
+      if (f && f->output_data.w32->menubar_active)
+	return 0;
+      /* FALLTHROUGH */
+    case WM_LBUTTONDOWN:
       if (w32_num_mouse_buttons > 2)
 	goto handle_plain_button;
 
@@ -3190,8 +3195,13 @@ w32_wnd_proc (hwnd, msg, wParam, lParam)
       }
       return 0;
 
-    case WM_LBUTTONUP:
     case WM_RBUTTONUP:
+      /* Ignore right button as long as the menu is active.  */
+      f = x_window_to_frame (dpyinfo, hwnd);
+      if (f && f->output_data.w32->menubar_active)
+	return 0;
+      /* FALLTHROUGH */
+    case WM_LBUTTONUP:
       if (w32_num_mouse_buttons > 2)
 	goto handle_plain_button;
 
@@ -3250,6 +3260,11 @@ w32_wnd_proc (hwnd, msg, wParam, lParam)
 	BOOL up;
 	int button;
 
+	/* Ignore middle and extra buttons as long as the menu is active.  */
+	f = x_window_to_frame (dpyinfo, hwnd);
+	if (f && f->output_data.w32->menubar_active)
+	  return 0;
+
 	if (parse_button (msg, HIWORD (wParam), &button, &up))
 	  {
 	    if (up) ReleaseCapture ();

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

* Re: [drew.adams@oracle.com: mouse-2 on menu item yanks into current buffer]
  2006-03-11 13:55 ` Eli Zaretskii
@ 2006-03-11 14:43   ` Jason Rumney
  2006-03-11 16:32     ` Eli Zaretskii
  0 siblings, 1 reply; 7+ messages in thread
From: Jason Rumney @ 2006-03-11 14:43 UTC (permalink / raw)
  Cc: rms, emacs-devel

Eli Zaretskii <eliz@gnu.org> writes:

> Would Windows GUI gurus please look at the patch below and tell if
> it's the right one?  It does seem to fix the problem for me (on
> Windows XP):

Can you try it with just the final segment of your patch. The right
button seems to already be filtered out by the system (or somewhere
else in Emacs I haven't noticed), so the code to ignore the right
button is superfluous I think.



> Index: src/w32fns.c
> ===================================================================
> RCS file: /cvsroot/emacs/emacs/src/w32fns.c,v
> retrieving revision 1.262
> diff -u -p -r1.262 w32fns.c
> --- src/w32fns.c	6 Feb 2006 15:23:22 -0000	1.262
> +++ src/w32fns.c	11 Mar 2006 13:52:50 -0000
> @@ -3250,6 +3260,11 @@ w32_wnd_proc (hwnd, msg, wParam, lParam)
>  	BOOL up;
>  	int button;
>  
> +	/* Ignore middle and extra buttons as long as the menu is active.  */
> +	f = x_window_to_frame (dpyinfo, hwnd);
> +	if (f && f->output_data.w32->menubar_active)
> +	  return 0;
> +
>  	if (parse_button (msg, HIWORD (wParam), &button, &up))
>  	  {
>  	    if (up) ReleaseCapture ();

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

* Re: [drew.adams@oracle.com: mouse-2 on menu item yanks into current buffer]
  2006-03-11 14:43   ` Jason Rumney
@ 2006-03-11 16:32     ` Eli Zaretskii
  2006-03-11 17:28       ` [drew.adams@oracle.com: mouse-2 on menu item yanks into currentbuffer] Drew Adams
  0 siblings, 1 reply; 7+ messages in thread
From: Eli Zaretskii @ 2006-03-11 16:32 UTC (permalink / raw)
  Cc: rms, emacs-devel

> Cc: rms@gnu.org, emacs-devel@gnu.org
> From: Jason Rumney <jasonr@gnu.org>
> Date: Sat, 11 Mar 2006 14:43:22 +0000
> 
> Eli Zaretskii <eliz@gnu.org> writes:
> 
> > Would Windows GUI gurus please look at the patch below and tell if
> > it's the right one?  It does seem to fix the problem for me (on
> > Windows XP):
> 
> Can you try it with just the final segment of your patch.

That last segment was enough to fix the problem, so I committed it.

Thanks.

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

* RE: [drew.adams@oracle.com: mouse-2 on menu item yanks into currentbuffer]
  2006-03-11 16:32     ` Eli Zaretskii
@ 2006-03-11 17:28       ` Drew Adams
  0 siblings, 0 replies; 7+ messages in thread
From: Drew Adams @ 2006-03-11 17:28 UTC (permalink / raw)


    That last segment was enough to fix the problem, so I committed it.
    
Thanks to all for fixing this.

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

end of thread, other threads:[~2006-03-11 17:28 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-03-06  0:51 [drew.adams@oracle.com: mouse-2 on menu item yanks into current buffer] Richard Stallman
2006-03-06  9:16 ` Kim F. Storm
2006-03-06 16:21   ` Drew Adams
2006-03-11 13:55 ` Eli Zaretskii
2006-03-11 14:43   ` Jason Rumney
2006-03-11 16:32     ` Eli Zaretskii
2006-03-11 17:28       ` [drew.adams@oracle.com: mouse-2 on menu item yanks into currentbuffer] Drew Adams

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