I'm not sure what I did, but I'm trying to use M-x whitespace-cleanup in a python file and nothing happens. How do I debug this?

  • 1
    Have you tried it with no init file (emacs -Q)?
    – user12563
    Oct 28, 2018 at 18:30
  • I tried now and this seams to work. So best would be to comment everything and see what prevents it?
    – daeda
    Oct 29, 2018 at 20:50
  • You can try to bisect your init file manually or use a tool like github.com/Malabarba/elisp-bug-hunter
    – user12563
    Oct 29, 2018 at 20:59

1 Answer 1


Ok I narrowed it down to the following line

(setq whitespace-style ' (face space-mark tab-mark))

If I remove it whitespace-cleanup works. Probably I'm overwriting something that is necessary for it to work. If I change the line to

(setq-default whitespace-style ' (face tabs spaces trailing space-before-tab newline indentation empty space-after-tab space-mark tab-mark newline-mark))

everything works fine.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.