unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* Re: mouse-wheel mode (and probably other stuff) broken due to use of global-map
       [not found]   ` <3C972B46.2040604@anubex.com>
@ 2002-03-21  9:03     ` Richard Stallman
  2002-03-21 11:21       ` Tim Van Holder
  0 siblings, 1 reply; 6+ messages in thread
From: Richard Stallman @ 2002-03-21  9:03 UTC (permalink / raw)
  Cc: emacs-devel

      So I modified affected packages to use
    (current-global-map) and not global-map; this complies with the
    documentation and should keep them working reliably.

Maybe we should install that change.  Which packages did you change in
this way?

_______________________________________________
Emacs-devel mailing list
Emacs-devel@gnu.org
http://mail.gnu.org/mailman/listinfo/emacs-devel


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

* Re: mouse-wheel mode (and probably other stuff) broken due to use of global-map
  2002-03-21  9:03     ` mouse-wheel mode (and probably other stuff) broken due to use of global-map Richard Stallman
@ 2002-03-21 11:21       ` Tim Van Holder
  2002-03-21 16:54         ` Stefan Monnier
  0 siblings, 1 reply; 6+ messages in thread
From: Tim Van Holder @ 2002-03-21 11:21 UTC (permalink / raw)
  Cc: emacs-devel

Richard Stallman wrote:
 > > So I modified affected packages to use (current-global-map) and not
 > > global-map; this complies with the documentation and should keep
 > > them working reliably.
 >
 > Maybe we should install that change.  Which packages did you change
 > in this way?

Turns out I only changed mwheel.el (patch below) and two site
packages that are used to set up preferred bindings for the function
keys.

Index: mwheel.el
===================================================================
RCS file: /cvsroot/emacs/emacs/lisp/mwheel.el,v
retrieving revision 1.10
diff -u -r1.10 mwheel.el
--- mwheel.el   2 Mar 2002 08:18:12 -0000       1.10
+++ mwheel.el   21 Mar 2002 11:16:24 -0000
@@ -169,9 +169,9 @@
      (condition-case ()
         (dolist (key keys)
           (cond (mouse-wheel-mode
-                (define-key global-map key 'mwheel-scroll))
-               ((eq (lookup-key global-map key) 'mwheel-scroll)
-                (define-key global-map key nil))))
+                (define-key (current-global-map) key 'mwheel-scroll))
+               ((eq (lookup-key (current-global-map) key) 'mwheel-scroll)
+                (define-key (current-global-map) key nil))))
        (error nil))))

  ;;; Compatibility entry point

-- 
Tim Van Holder <mailto:tim.vanholder@anubex.com>
Anubex         <http://www.anubex.com>
Telephone: +32 3 450 42 32              Fax: +32 3 450 42 51


_______________________________________________
Emacs-devel mailing list
Emacs-devel@gnu.org
http://mail.gnu.org/mailman/listinfo/emacs-devel


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

* Re: mouse-wheel mode (and probably other stuff) broken due to use of global-map
  2002-03-21 11:21       ` Tim Van Holder
@ 2002-03-21 16:54         ` Stefan Monnier
  2002-03-24 18:26           ` Pavel Janík
  0 siblings, 1 reply; 6+ messages in thread
From: Stefan Monnier @ 2002-03-21 16:54 UTC (permalink / raw)
  Cc: rms, emacs-devel

> -                (define-key global-map key 'mwheel-scroll))
> -               ((eq (lookup-key global-map key) 'mwheel-scroll)
> -                (define-key global-map key nil))))
> +                (define-key (current-global-map) key 'mwheel-scroll))
> +               ((eq (lookup-key (current-global-map) key) 'mwheel-scroll)
> +                (define-key (current-global-map) key nil))))
>         (error nil))))

I'd use `global-set-key' since that's what it's for after all.


	Stefan


_______________________________________________
Emacs-devel mailing list
Emacs-devel@gnu.org
http://mail.gnu.org/mailman/listinfo/emacs-devel


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

* Re: mouse-wheel mode (and probably other stuff) broken due to use of global-map
  2002-03-21 16:54         ` Stefan Monnier
@ 2002-03-24 18:26           ` Pavel Janík
  2002-03-24 21:24             ` Colin Walters
  2002-03-25 10:58             ` Tim Van Holder
  0 siblings, 2 replies; 6+ messages in thread
From: Pavel Janík @ 2002-03-24 18:26 UTC (permalink / raw)
  Cc: Tim Van Holder, rms, emacs-devel

   From: "Stefan Monnier" <monnier+gnu/emacs@RUM.cs.yale.edu>
   Date: Thu, 21 Mar 2002 11:54:23 -0500

   > > -                (define-key global-map key 'mwheel-scroll))
   > > -               ((eq (lookup-key global-map key) 'mwheel-scroll)
   > > -                (define-key global-map key nil))))
   > > +                (define-key (current-global-map) key 'mwheel-scroll))
   > > +               ((eq (lookup-key (current-global-map) key) 'mwheel-scroll)
   > > +                (define-key (current-global-map) key nil))))
   > >         (error nil))))
   > 
   > I'd use `global-set-key' since that's what it's for after all.

Yes. Can anyone test the following change?

--- mwheel.el.~1.11.~	Sun Mar 24 15:52:02 2002
+++ mwheel.el	Sun Mar 24 19:25:25 2002
@@ -169,9 +169,9 @@
     (condition-case ()
 	(dolist (key keys)
 	  (cond (mouse-wheel-mode
-		 (define-key (current-global-map) key 'mwheel-scroll))
+		 (global-set-key key 'mwheel-scroll))
 		((eq (lookup-key (current-global-map) key) 'mwheel-scroll)
-		 (define-key (current-global-map) key nil))))
+		 (global-unset-key key))))
       (error nil))))
 
 ;;; Compatibility entry point

-- 
Pavel Janík

That's the problem: pretesters aren't finding many more bugs nowadays,
so it'll probably take until 2005 to find and fix enough bugs that we
can comfortably announce the code stable.
                  -- Stefan Monnier in comp.emacs

_______________________________________________
Emacs-devel mailing list
Emacs-devel@gnu.org
http://mail.gnu.org/mailman/listinfo/emacs-devel


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

* Re: mouse-wheel mode (and probably other stuff) broken due to use of global-map
  2002-03-24 18:26           ` Pavel Janík
@ 2002-03-24 21:24             ` Colin Walters
  2002-03-25 10:58             ` Tim Van Holder
  1 sibling, 0 replies; 6+ messages in thread
From: Colin Walters @ 2002-03-24 21:24 UTC (permalink / raw)


On Sun, 2002-03-24 at 13:26, Pavel Janík wrote:

> -		 (define-key (current-global-map) key 'mwheel-scroll))
> +		 (global-set-key key 'mwheel-scroll))
>  		((eq (lookup-key (current-global-map) key) 'mwheel-scroll)
> -		 (define-key (current-global-map) key nil))))
> +		 (global-unset-key key))))

Seems to work for me.

_______________________________________________
Emacs-devel mailing list
Emacs-devel@gnu.org
http://mail.gnu.org/mailman/listinfo/emacs-devel


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

* Re: mouse-wheel mode (and probably other stuff) broken due to use of global-map
  2002-03-24 18:26           ` Pavel Janík
  2002-03-24 21:24             ` Colin Walters
@ 2002-03-25 10:58             ` Tim Van Holder
  1 sibling, 0 replies; 6+ messages in thread
From: Tim Van Holder @ 2002-03-25 10:58 UTC (permalink / raw)
  Cc: Stefan Monnier, rms, emacs-devel

Pavel Janík wrote:
>    > 
>    > I'd use `global-set-key' since that's what it's for after all.
> 
> Yes. Can anyone test the following change?
> 
> --- mwheel.el.~1.11.~	Sun Mar 24 15:52:02 2002
> +++ mwheel.el	Sun Mar 24 19:25:25 2002
> @@ -169,9 +169,9 @@
>      (condition-case ()
>  	(dolist (key keys)
>  	  (cond (mouse-wheel-mode
> -		 (define-key (current-global-map) key 'mwheel-scroll))
> +		 (global-set-key key 'mwheel-scroll))
>  		((eq (lookup-key (current-global-map) key) 'mwheel-scroll)
> -		 (define-key (current-global-map) key nil))))
> +		 (global-unset-key key))))
>        (error nil))))
>  

Seems to work fine (that is, the mouse wheel does what it's supposed to do).

-- 
Tim Van Holder <mailto:tim.vanholder@anubex.com>
Anubex         <http://www.anubex.com>
Telephone: +32 3 450 42 32              Fax: +32 3 450 42 51


_______________________________________________
Emacs-devel mailing list
Emacs-devel@gnu.org
http://mail.gnu.org/mailman/listinfo/emacs-devel


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

end of thread, other threads:[~2002-03-25 10:58 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <m3wuxbrvgl.fsf@bender.falconsoft.be>
     [not found] ` <200203160639.g2G6dVk07398@wijiji.santafe.edu>
     [not found]   ` <3C972B46.2040604@anubex.com>
2002-03-21  9:03     ` mouse-wheel mode (and probably other stuff) broken due to use of global-map Richard Stallman
2002-03-21 11:21       ` Tim Van Holder
2002-03-21 16:54         ` Stefan Monnier
2002-03-24 18:26           ` Pavel Janík
2002-03-24 21:24             ` Colin Walters
2002-03-25 10:58             ` Tim Van Holder

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