help-gnu-emacs
[Top][All Lists]
Advanced

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

RE: Overriding self-insert-command doesn't work


From: Drew Adams
Subject: RE: Overriding self-insert-command doesn't work
Date: Mon, 12 Mar 2007 19:04:41 -0700

> > if you know ways other than advising to change the definition
> > of self-insert-command transpararently then I'm all ears.
> 
> (define-key map [remap self-insert-command] #'my-version-of-self-insert)
> 
> or add some function to `after-change-functions'.  The first one
> requires emacs 22 (AFAIK).

I use this, which works for various Emacs versions:

(if (fboundp 'command-remapping)
    (define-key map (vector 'remap old) new)
  (substitute-key-definition old new map)))





reply via email to

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