unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: "Drew Adams" <drew.adams@oracle.com>
Cc: Luc Teirlinck <teirllm@dms.auburn.edu>, emacs-devel@gnu.org
Subject: RE: when to bind *down-mouse* vs *mouse*?
Date: Mon, 6 Dec 2004 11:16:20 -0800	[thread overview]
Message-ID: <FDELKNEBLPKKDCEBEJCBMEEHCKAA.drew.adams@oracle.com> (raw)
In-Reply-To: <874qj23pxi.fsf@confusibombus.emacswiki.org>

    When the action creates a popup menu, I think we want to bind it to
    the mouse-down event.  I seem to situations where the menu would
    disappear as soon as you released the mouse.  If you released the
    mouse on a menu item, that menu item has been "chosen" by the user.

It's not clear to me what you're saying here. I think you're suggesting,
first, that binding to down-mouse lets the mouse-up event choose the menu
item, and if the menu were bound to just mouse (mouse-up), then you would
need to first click to bring up the menu, and then click again to choose the
menu item. Is that what you mean?

Are you also saying that there was (is?) a bug that caused the popup menu to
disappear on mouse-up? Was that with the menu bound to down-mouse or just
mouse (-up)?

When I look at other applications running on Windows - that's all I have
available right now -, they generally bring up a popup menu on mouse-up, not
on mouse-down. That includes most popup menus in Microsoft applications
(including Word, Outlook, Internet Explorer, Windows Explorer, Windows Media
Player, and Windows XP dialog boxes), but also WinZIP, Framemaker,
DreamWeaver, HomeSite, WS_FTP, SmartFTP, TextPad, TopStyle, and Irfanview.
(There are some exceptions, notably Netscape, Acrobat, and MS Excel.)

And these applications nevertheless let you keep the button pressed and
release it on a menu item to choose the item. And they let you,
alternatively, use separate clicks: one to bring up the menu, one to choose
each submenu (if any), and one to choose a menu item.

So, I would say that it is not clear that popup menus should be opened on
down-mouse - the reasons given so far aren't convincing. I'm not saying that
Emacs should necessarily behave like Windows apps; I'm just asking why it is
a good idea to bind popup menu opening to down-mouse, rather than mouse
(mouse-up).

The question of S-down-mouse-1 on Windows is a separate issue. On platforms
besides Windows, or if `w32-use-w32-font-dialog' is nil, a popup menu is
displayed. But on Windows with `w32-use-w32-font-dialog' non-nil (default
value), this just opens a dialog box. I see no reason to bind down-mouse
instead of mouse (-up), just to bring up a dialog box.

    Similary, when the action involves a position, we want to use
    mouse-down.  One example is yanking with the mouse.  We want to yank
    where the user clicked the mouse button (down), not where the user
    released it.

    Conversely, when the action is triggered by clicking into some
    sensitive area (eg. buttons, links), then we should use mouse-up, so
    that the user can change his mind after mouse-down and move away from
    the button or link in order to cancel.

These makes sense. Perhaps similar guidance should be in the Emacs (or
Elisp) manual - especially the second paragraph, which is less obvious than
the first. If so, the text should point out that the second criterion
overrides the first (a button or link also "involves a position").

Thanks,

  Drew

  parent reply	other threads:[~2004-12-06 19:16 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-12-02 22:28 when to bind *down-mouse* vs *mouse*? Drew Adams
2004-12-03  1:10 ` Andreas Schwab
2004-12-03  1:26   ` Drew Adams
2004-12-03 10:08     ` Andreas Schwab
2004-12-03 17:22       ` Drew Adams
2004-12-03 21:22         ` Andreas Schwab
2004-12-05 14:37         ` Richard Stallman
2004-12-03  2:00 ` Luc Teirlinck
2004-12-03 17:22   ` Drew Adams
2004-12-03 18:53     ` Luc Teirlinck
2004-12-04 10:19     ` Jason Rumney
2004-12-04 17:59     ` Alex Schroeder
2004-12-04 19:06       ` Lennart Borgman
2004-12-04 21:42         ` Jan D.
2004-12-05  0:10         ` Luc Teirlinck
2004-12-07 13:20           ` Jan D.
2004-12-06 19:16       ` Drew Adams [this message]
2004-12-06 20:10         ` Stefan Monnier
2004-12-08  1:38         ` Alex Schroeder
2004-12-08 19:06           ` Drew Adams
2004-12-08 19:45             ` Stefan Monnier
2004-12-08 20:42               ` Drew Adams
2004-12-09  4:42             ` Richard Stallman

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=FDELKNEBLPKKDCEBEJCBMEEHCKAA.drew.adams@oracle.com \
    --to=drew.adams@oracle.com \
    --cc=emacs-devel@gnu.org \
    --cc=teirllm@dms.auburn.edu \
    /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).