unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* delete-trailing-whitespace and binary files
@ 2006-05-21 18:46 Kim F. Storm
  2006-05-21 18:50 ` Eli Zaretskii
  2006-05-22 15:11 ` Richard Stallman
  0 siblings, 2 replies; 15+ messages in thread
From: Kim F. Storm @ 2006-05-21 18:46 UTC (permalink / raw)



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 <storm@cua.dk> http://www.cua.dk

^ permalink raw reply	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2006-06-07  2:20 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-05-21 18:46 delete-trailing-whitespace and binary files Kim F. Storm
2006-05-21 18:50 ` Eli Zaretskii
2006-05-22 15:11 ` Richard Stallman
2006-05-26 22:31   ` Kim F. Storm
2006-05-27  3:20     ` Stefan Monnier
2006-05-30 20:10       ` Kevin Rodgers
2006-06-01 14:23         ` Kim F. Storm
2006-06-02  3:13           ` Richard Stallman
2006-06-02  8:28             ` David Kastrup
2006-06-02 22:39               ` Richard Stallman
2006-06-02 22:45                 ` David Kastrup
2006-06-04  2:24                   ` Richard Stallman
2006-06-06 20:25                     ` Stuart D. Herring
2006-06-06 21:16                       ` Stuart D. Herring
2006-06-07  2:20                         ` Richard Stallman

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).