From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: "David Vanderschel" Newsgroups: gmane.emacs.help Subject: elisp mouse programming problems Date: Tue, 19 Aug 2003 22:17:22 -0500 Organization: hardly ever ;-) Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Message-ID: NNTP-Posting-Host: deer.gmane.org X-Trace: sea.gmane.org 1061369601 20215 80.91.224.253 (20 Aug 2003 08:53:21 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Wed, 20 Aug 2003 08:53:21 +0000 (UTC) Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Wed Aug 20 10:53:20 2003 Return-path: Original-Received: from monty-python.gnu.org ([199.232.76.173]) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 19pOiW-0005TH-00 for ; Wed, 20 Aug 2003 10:53:20 +0200 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.20) id 19pJhS-0001zZ-C9 for geh-help-gnu-emacs@m.gmane.org; Tue, 19 Aug 2003 23:31:54 -0400 Original-Path: shelby.stanford.edu!newsfeed.stanford.edu!nntp.cs.ubc.ca!logbridge.uoregon.edu!arclight.uoregon.edu!wn13feed!wn11feed!worldnet.att.net!216.166.71.14!border3.nntp.aus1.giganews.com!intern1.nntp.aus1.giganews.com!nntp.giganews.com!nntp.texas.net!news.texas.net.POSTED!not-for-mail Original-NNTP-Posting-Date: Tue, 19 Aug 2003 22:17:23 -0500 Original-Newsgroups: gnu.emacs.help X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2800.1158 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165 Original-Lines: 68 Original-X-Trace: sv3-HFgBysPDLdPUhxVdDOtbPuSv23StQPqSZQvpbmZgesP/kBh81hfRpycRK3u2LQqg4xYVPgLhAScTQCf!wXfYSdX/FV6+uHmS3dPZW4esXhc6R8CjopqIltez3AWwFN2cApEcsVEerdut Original-X-Complaints-To: abuse@texas.net X-DMCA-Complaints-To: abuse@texas.net X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly X-Postfilter: 1.1 Original-Xref: shelby.stanford.edu gnu.emacs.help:116012 Original-To: help-gnu-emacs@gnu.org X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.2 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: main.gmane.org gmane.emacs.help:11926 X-Report-Spam: http://spam.gmane.org/gmane.emacs.help:11926 I am having a problem with overriding the global map for some mouse events. For example, I can bind C-mouse-1 in a major mode mode-map for a major mode I created. Yet when that mode is in effect, such a mouse click still goes to mouse-select-buffer (as it is correctly bound globally) and never reaches the function I bound to the key for the mode. I do not have this problem with all mouse events, and I cannot figure out what is going wrong. I am consistently successful in overriding the global binding of ordinary key sequences (as opposed to mouse events) in this manner. Extra details appended. Also, in testing such things, I am confused by the fact that I cannot seem to redefine the bindings of a mode-map by simply setting it to nil and rerunning the (modified) code which builds the mode-map. The old bindings seem to remain in effect. If I kill emacs and restart it, the changed bindings do take effect. Not even killing the buffer with the new mode, reloading the file which defines the program, and rerunning the program which creates the special mode buffer helps. What is it that I do not understand here? If it matters (which I doubt), I am still running 20.7.3 (on Windows 98). Thanks for any pointers, David V. ______________________________________________________________________ More details: I have the following code I have been fooling with: (when (null Hube-mode-map) (let ( (m (make-sparse-keymap)) ) (suppress-keymap m t) (define-key m [double-mouse-1] 'Hube-double-mouse-1) (define-key m [drag-mouse-1] 'Hube-mouse-1-up) (define-key m [drag-mouse-2] 'Hube-mouse-2-up-test) (define-key m [C-S-mouse-1] 'Hube-control-mouse-1) (define-key m [C-mouse-1] 'Hube-control-mouse-1) (define-key m [down-mouse-1] 'Hube-mouse-1-down) (define-key m [mouse-1] 'Hube-mouse-1-up) (define-key m [mouse-2] 'Hube-mouse-2) (define-key m [(control n)] 'dv-test2) (setq Hube-mode-map m) )) The bindings which fail to work are those for C-mouse-1 and drag-mouse-2. They keep getting handled by the functions which are bound to them globally. All the others do work as I expect - and note that many of them are things which do have standard global bindings in emacs. In my initialization, I have explicitly bound drag-mouse-2 globally to mouse-drag-throw in mouse-extras.el. (Used that for years!) C-mouse-1 is bound by the msb package which I use. I introduced the C-n just to demonstrate that a "control" modifier was not the source of my apparent problem. I also tried to rebind S-mouse-1 and it persisted in invoking mouse-set-font. Hube-mode does not use any other modes.