home *** CD-ROM | disk | FTP | other *** search
- x-gateway: rodan.UU.NET from help-lucid-emacs to alt.lucid-emacs.help; Wed, 27 Jan 1993 17:58:11 EST
- Date: Wed, 27 Jan 1993 09:34:13 GMT
- From: djh@CIS.Prime.COM (David Hughes)
- Message-ID: <9301270934.AA05320@CIS.Prime.COM>
- Subject: Re: How to replace self-insert-command?
- References: <9301270742.AA06561@hilbert.maths.utas.edu.au>
- Newsgroups: alt.lucid-emacs.help
- Path: sparky!uunet!wendy-fate.uu.net!help-lucid-emacs
- Sender: help-lucid-emacs-request@lucid.com
- Lines: 35
-
- Excerpt of message (sent 27 January 93) by La Monte Yarroll:
- > I'd like to replace self-insert-command with my own routine.
- >
- > Under plain GNU emacs I can define a function like this:
- >
- > (defun self-insert-wrapper (arg)
- > (interactive "p")
- > (self-insert-command arg))
- >
- > and then replace every instance of 'self-insert-command in global-map
- > with 'self-insert-wrapper.
- >
- > Under Lucid emacs 19.4 this almost works, except it breaks incremental
- > searching.
- >
- > Is there a way to do this WITHOUT breaking incremental searching?
- >
-
- A much neater way of defining a wrapper which avoids having to replace every
- instance of 'self-insert-command in global-map with 'self-insert-wrapper is
- to do the folowing:
-
- ;; Store the original symbol-function
- (if (not (fboundp 'real-self-insert-command))
- (fset 'real-self-insert-command (symbol-function 'self-insert-command)))
-
- (defun self-insert-command (arg)
- (interactive "p")
- (real-self-insert-command arg))
-
- I don't know whether this will solve your problem, but I think this a better
- approach in general.
-
- --
- Regards, David
-