[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

delete-trailing-whitespace and binary files

From: Kim F. Storm
Subject: delete-trailing-whitespace and binary files
Date: Sun, 21 May 2006 20:46:11 +0200
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (gnu/linux)

I have delete-trailing-whitespace in before-save-hook, but that
was a real disaster editing etc/spook.lines ... as soon as
I saved the file, all the trailing NUL-characters were deleted.

What can be done about this?

1) If file is binary (how to check that?), don't delete whitespace
   when run from a hook (how to check that?).

Is there a "file-binary-p" function which tests if
a file contains any non-printable characters?

2) Don't consider NUL to be whitespace.

3) ?

Kim F. Storm <address@hidden> http://www.cua.dk

reply via email to

[Prev in Thread] Current Thread [Next in Thread]