Skip to main content
edited tags
Link
Drew
  • 79.1k
  • 10
  • 123
  • 257
edited title
Link
Drew
  • 79.1k
  • 10
  • 123
  • 257

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

Source Link

Best way to disable code

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?