I see

;; Local Variables:
;; mangle-whitespace: t
;; End:

in many Elisp source files by various experienced Emacs programmers.

But when I describe-variable, Emacs 24.3 says no variable mangle-whitespace is defined.

Is mangle-whitespace provided by Emacs 24.4? Or by some popular package? (I don't see any on MELPA named "mangle".)

What does mangle-whitespace do?

Note: I searched for this both here and on SO under the emacs tag. I also tried both DuckDuckGo and Google, and the search results are just more examples of .el files using this. Ergo asking here.

  • 1
    I agree -- nothing pops up on Google except setting file-local variable that is illusive.
    – lawlist
    Feb 22, 2015 at 3:51
  • 3
    No matches grepping the source code for the in-development Emacs 25.1. Also no matches grepping the ancient Emacs 22.1.
    – PythonNut
    Feb 22, 2015 at 4:18

1 Answer 1


I've grepped my ~/.emacs.d/elpa for mangle-whitespace and noticed it's used in a few packages which are all written by Roland Walker. Then I proceeded downloading the tarballs for Emacs 22.1 to Emacs 24.4 (because these are the Emacs version Roland Walker supports with his packages) and grepped them for this variable, but without any luck.

That's why I've opened an issue to find out the reasons for it. I'll update this answer as soon as there is a response.

edit: The author of these packages confirmed that it's a variable respected by his own Emacs config which instructs it to unconditionally require a final newline. He also expressed interest in turning it into a directory-local variable to avoid pushing it to Github.

  • So, to clarify, it's not part of Emacs, and it's not part of a third-party package, but rather it's someone's personal customization, correct?
    – Dan
    Feb 23, 2015 at 15:58
  • This was an impressive amount of sleuthing, by the way.
    – Dan
    Feb 23, 2015 at 15:59
  • Well, this is the case for all packages exhibiting this fairly unique file-local variable written by Roland Walker. If you find any by other authors, please tell me.
    – wasamasa
    Feb 23, 2015 at 16:02
  • 2
    On a side-note. This variable could be replaced with ;; require-final-newline: t. This should provide a similar result with a built-in variable. Feb 23, 2015 at 16:19
  • @wasamasa Other examples: exec-path-from-shell and magit-find-file. Feb 23, 2015 at 17:12

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.