home *** CD-ROM | disk | FTP | other *** search
/ InfoMagic Source Code 1993 July / THE_SOURCE_CODE_CD_ROM.iso / languages / elisp / functions / enable-me.el < prev    next >
Encoding:
Text File  |  1991-03-20  |  705 b   |  21 lines

  1. ; From: roland@ai.mit.edu (Roland McGrath)
  2. ; Subject: Enable yourself, cretin!
  3. ; Date: 26 Dec 90 22:13:11 GMT
  4. ; Organization: Hackers Anonymous International, Ltd., Inc. (Applications
  5. ;     welcome)
  6. ; Recent discussion about disabled commands prompted me to write this little
  7. ; thingie for all you Emacs studs out there:
  8. ;; Enable yourself, cretin.
  9. (setq disabled-command-hook 'enable-me)
  10.  
  11. (defun enable-me (&rest args)
  12.   "Called when a disabled command is executed.
  13. Enable it and reexecute it."
  14.   (put this-command 'disabled nil)
  15.   (message "You typed %s.  %s was disabled.  It ain't no more."
  16.        (key-description (this-command-keys)) this-command)
  17.   (sit-for 0)
  18.   (call-interactively this-command))
  19.