unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* Re: command remapping problem
       [not found] <MEEKKIABFKKDFJMPIOEBCEKECOAA.drew.adams@oracle.com>
@ 2006-01-30 18:46 ` Richard M. Stallman
  2006-01-30 18:46 ` Richard M. Stallman
  1 sibling, 0 replies; 6+ messages in thread
From: Richard M. Stallman @ 2006-01-30 18:46 UTC (permalink / raw)


    From: "Drew Adams" <drew.adams@oracle.com>
    To: "Emacs-Pretest-Bug" <emacs-pretest-bug@gnu.org>
    Date: Mon, 23 Jan 2006 09:48:13 -0800
    MIME-Version: 1.0
    Content-Type: text/plain;
	    charset="iso-8859-1"
    Subject: command remapping problem
    X-Spam-Status: No, hits=0.0 required=5.0 tests=none autolearn=no version=2.63

    1. (substitute-key-definition from to map global-map) is too slow in
       Emacs 22, at least when `from' is `self-insert-command'. It takes
       several seconds on a fast machine. In previous versions of Emacs it
       is instantaneous.

Can someone please investigate this, then ack?

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

* Re: command remapping problem
       [not found] <MEEKKIABFKKDFJMPIOEBCEKECOAA.drew.adams@oracle.com>
  2006-01-30 18:46 ` command remapping problem Richard M. Stallman
@ 2006-01-30 18:46 ` Richard M. Stallman
  2006-01-30 18:58   ` Drew Adams
  2006-01-31 13:56   ` Kim F. Storm
  1 sibling, 2 replies; 6+ messages in thread
From: Richard M. Stallman @ 2006-01-30 18:46 UTC (permalink / raw)
  Cc: emacs-devel

    (define-key my-map [remap scroll-up] my-scroll-up)

    The `scroll-up' binding for `C-v' is remapped to `my-scroll-up', but
    the `scroll-up' binding for [next] is not remapped to `my-scroll-up'.

Given that incomplete example, I cannot see why that would happen.
However, I tried an experiment,

    (define-key lisp-mode-map [remap scroll-up] 'my-scroll-up)

    (defun my-scroll-up ()
      (interactive)
      (message "Foo")
      (scroll-up))

and it seems to be true that this kind of remap only applies
to bindings in the same keymap that contains the remap.
In that example, the remapping did not apply to C-v OR to <next>.

This seems to be a bug.  The documentation in the Lisp Manual
clearly says that the remap ought to apply to any binding
that yields the command that has been remapped.

Can someone please debug this, then ack?

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

* RE: command remapping problem
  2006-01-30 18:46 ` Richard M. Stallman
@ 2006-01-30 18:58   ` Drew Adams
  2006-01-31 13:56   ` Kim F. Storm
  1 sibling, 0 replies; 6+ messages in thread
From: Drew Adams @ 2006-01-30 18:58 UTC (permalink / raw)


        (define-key my-map [remap scroll-up] my-scroll-up)

        The `scroll-up' binding for `C-v' is remapped to `my-scroll-up', but
        the `scroll-up' binding for [next] is not remapped to
        `my-scroll-up'.

    Given that incomplete example,

What is incomplete about it? Let me know, and I'll try to complete it. (But
what you wrote below indicates that you understood what I meant OK.)

    I cannot see why that would happen. However, I tried an experiment,

        (define-key lisp-mode-map [remap scroll-up] 'my-scroll-up)
        (defun my-scroll-up ()
          (interactive)(message "Foo")(scroll-up))

    and it seems to be true that this kind of remap only applies
    to bindings in the same keymap that contains the remap.
    In that example, the remapping did not apply to C-v OR to <next>.

    This seems to be a bug.  The documentation in the Lisp Manual
    clearly says that the remap ought to apply to any binding
    that yields the command that has been remapped.

Yes, that was my interpretation too.

My workaround has been to use command remapping for `self-insert-command'
(since it takes much too long to use `substitute-key-definition') and to use
`substitute-key-definition' for all other such substitutions/remappings.

    Can someone please debug this, then ack?

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

* Re: command remapping problem
  2006-01-30 18:46 ` Richard M. Stallman
  2006-01-30 18:58   ` Drew Adams
@ 2006-01-31 13:56   ` Kim F. Storm
  2006-01-31 15:40     ` Luc Teirlinck
  2006-01-31 23:11     ` Richard M. Stallman
  1 sibling, 2 replies; 6+ messages in thread
From: Kim F. Storm @ 2006-01-31 13:56 UTC (permalink / raw)
  Cc: Drew Adams, emacs-devel

"Richard M. Stallman" <rms@gnu.org> writes:

>     (define-key my-map [remap scroll-up] my-scroll-up)
>
>     The `scroll-up' binding for `C-v' is remapped to `my-scroll-up', but
>     the `scroll-up' binding for [next] is not remapped to `my-scroll-up'.
>
> Given that incomplete example, I cannot see why that would happen.
> However, I tried an experiment,
>
>     (define-key lisp-mode-map [remap scroll-up] 'my-scroll-up)
>
>     (defun my-scroll-up ()
>       (interactive)
>       (message "Foo")
>       (scroll-up))
>
> and it seems to be true that this kind of remap only applies
> to bindings in the same keymap that contains the remap.
> In that example, the remapping did not apply to C-v OR to <next>.

Are you sure you are in a buffer which uses lisp-mode-map ?

If I execute the above commands and visit simple.el, it works
for me.

>
> This seems to be a bug.  The documentation in the Lisp Manual
> clearly says that the remap ought to apply to any binding
> that yields the command that has been remapped.
>
> Can someone please debug this, then ack?

IW4M.

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

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

* Re: command remapping problem
  2006-01-31 13:56   ` Kim F. Storm
@ 2006-01-31 15:40     ` Luc Teirlinck
  2006-01-31 23:11     ` Richard M. Stallman
  1 sibling, 0 replies; 6+ messages in thread
From: Luc Teirlinck @ 2006-01-31 15:40 UTC (permalink / raw)
  Cc: rms, drew.adams, emacs-devel

Kim Storm wrote:

   Are you sure you are in a buffer which uses lisp-mode-map ?

   If I execute the above commands and visit simple.el, it works
   for me.

Note also from the original posting (in particular, the date):

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

Sincerely,

Luc.

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

* Re: command remapping problem
  2006-01-31 13:56   ` Kim F. Storm
  2006-01-31 15:40     ` Luc Teirlinck
@ 2006-01-31 23:11     ` Richard M. Stallman
  1 sibling, 0 replies; 6+ messages in thread
From: Richard M. Stallman @ 2006-01-31 23:11 UTC (permalink / raw)
  Cc: drew.adams, emacs-devel

    > and it seems to be true that this kind of remap only applies
    > to bindings in the same keymap that contains the remap.
    > In that example, the remapping did not apply to C-v OR to <next>.

    Are you sure you are in a buffer which uses lisp-mode-map ?

You're right, I wasn't.

Checking more carefully now, I don't see any bug.

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

end of thread, other threads:[~2006-01-31 23:11 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <MEEKKIABFKKDFJMPIOEBCEKECOAA.drew.adams@oracle.com>
2006-01-30 18:46 ` command remapping problem Richard M. Stallman
2006-01-30 18:46 ` Richard M. Stallman
2006-01-30 18:58   ` Drew Adams
2006-01-31 13:56   ` Kim F. Storm
2006-01-31 15:40     ` Luc Teirlinck
2006-01-31 23:11     ` Richard M. Stallman

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