home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #20 / NN_1992_20.iso / spool / gnu / emacs / help / 4007 < prev    next >
Encoding:
Text File  |  1992-09-07  |  1.1 KB  |  31 lines

  1. Newsgroups: gnu.emacs.help
  2. Path: sparky!uunet!caen!hellgate.utah.edu!eeide
  3. From: eeide%asylum.cs.utah.edu@cs.utah.edu (Eric Eide)
  4. Subject: Re: How do I subvert a function?
  5. Message-ID: <EEIDE.92Sep4175544@asylum.cs.utah.edu>
  6. In-reply-to: kevin@edscom.demon.co.uk's message of Fri, 4 Sep 1992 10:01:46 GMT
  7. Organization: University of Utah Department of Computer Science
  8. References: <KEVIN.92Sep4100146@runningbear.edscom.demon.co.uk>
  9. Distribution: gnu
  10. Date: 4 Sep 92 17:55:44
  11. Lines: 18
  12.  
  13. Kevin Broadey writes:
  14.  
  15. >I'd like to be able to replace an elisp function with one I've written myself
  16. >while keeping hold of the original.  [...] I tried doing this:-
  17. >
  18. >(fset 'old-original 'original)
  19. >
  20. >(defun original ()
  21. >  (old-original)
  22. >  ;; modify behaviour here
  23. >  ...)
  24.  
  25. Close.  Try (fset 'old-original (symbol-function 'original)) instead.  Eric.
  26.  
  27. --
  28. -------------------------------------------------------------------------------
  29. Eric Eide          |          University of Utah Department of Computer Science
  30. eeide@cs.utah.edu  | Buddhist to hot dog vendor: "Make me one with everything."
  31.