[Top][All Lists]

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

Re: elisp mouse programming problems

From: Alex Schroeder
Subject: Re: elisp mouse programming problems
Date: Thu, 21 Aug 2003 14:19:58 +0200
User-agent: Gnus/5.1003 (Gnus v5.10.3) Emacs/21.3.50 (gnu/linux)

"David Vanderschel" <address@hidden> writes:

> But why would a binding for a minor mode take precedence when I had
> attempted to bind the same event in my major mode?

I think the reasons are irrelevant, because either precedence makes
sense.  Therefore the Emacs maintainers just had to choose one and
document it.  I guess that they felt that minor modes are somewhat
"more specific" etc., but in truth, it doesn't really matter.

> How can a general purpose program like I am trying to make know, in
> general, which minor modes it must disable in order to work
> properly?  I feel that I must still be missing something here.

I think you have just discovered one of the weaker points in the Emacs
user interface design.  The problem is, nobody knows what to do about
it.  :)  People have even written code to rearrange local keymaps in
order to solve some of these problems, but those are ugly hacks, in my
humble opinion.

The only practical solution is to document it:

  "My mode uses the mouse to achieve certain things -- dragging
  objects, recognizing gestures, etc.  If you are using another minor
  mode that also uses the mouse, then you are in trouble: You will
  either have to disable that other minor mode, or you have to remap
  the conflicting keybindings of that other mode's mode-map.
  Unfortunately it is rather difficult to give better advice than
  this, unless I know exactly what other mode you want to use in
  conjunction with mine."

Something like that.

There is no substitute for experience.

reply via email to

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