Skip to main content
2 of 3
edited title
Drew
  • 79.1k
  • 10
  • 123
  • 257

How can I disable some code without commenting it out or removing it?

When I need to disable code without removing it, I comment it out. I find this clumsy, especially when the code is a function definition or some other kind of cohesive whole, such as:

(global-set-key "\C-x" 'do-stuff)
(defun do-stuff () ...)

Is there a better way? I think something like the following would be nice:

(off
   (global-set-key "\C-x" 'do-stuff)
   (defun do-stuff () ...))

I understand I can define off myself, but isn’t there a standard way to do this?