home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #3 / NN_1993_3.iso / spool / alt / lucidem / help / 954 < prev    next >
Encoding:
Text File  |  1993-01-27  |  1.5 KB  |  47 lines

  1. x-gateway: rodan.UU.NET from help-lucid-emacs to alt.lucid-emacs.help; Wed, 27 Jan 1993 17:58:11 EST
  2. Date: Wed, 27 Jan 1993 09:34:13 GMT
  3. From: djh@CIS.Prime.COM (David Hughes)
  4. Message-ID: <9301270934.AA05320@CIS.Prime.COM>
  5. Subject: Re: How to replace self-insert-command?
  6. References: <9301270742.AA06561@hilbert.maths.utas.edu.au>
  7. Newsgroups: alt.lucid-emacs.help
  8. Path: sparky!uunet!wendy-fate.uu.net!help-lucid-emacs
  9. Sender: help-lucid-emacs-request@lucid.com
  10. Lines: 35
  11.  
  12. Excerpt of message (sent 27 January 93) by La Monte Yarroll:
  13. > I'd like to replace self-insert-command with my own routine.
  14. > Under plain GNU emacs I can define a function like this:
  15. > (defun self-insert-wrapper (arg)
  16. >   (interactive "p")
  17. >   (self-insert-command arg))
  18. > and then replace every instance of 'self-insert-command in global-map
  19. > with 'self-insert-wrapper.
  20. > Under Lucid emacs 19.4 this almost works, except it breaks incremental
  21. > searching.
  22. > Is there a way to do this WITHOUT breaking incremental searching?
  23.  
  24. A much neater way of defining a wrapper which avoids having to replace every
  25. instance of 'self-insert-command in global-map with 'self-insert-wrapper is
  26. to do the folowing:
  27.  
  28. ;; Store the original symbol-function
  29. (if (not (fboundp 'real-self-insert-command))
  30.     (fset 'real-self-insert-command (symbol-function 'self-insert-command)))
  31.  
  32. (defun self-insert-command (arg)
  33.   (interactive "p")
  34.   (real-self-insert-command arg))
  35.  
  36. I don't know whether this will solve your problem, but I think this a better
  37. approach in general.
  38.  
  39. --
  40. Regards, David
  41.