
(perhaps an extra state of 'jka-compr-really-do-compress') This could conflict with other compression modes with optional magic numbers.Since is the first filetype with the same extension for both formats, it may be easier to just extend the previous hint than to generalize jka-compr. One could modify jka-compr to check files before uncompressing, and accordingly set a flag to recompress on write. Thus there is no way to use it as is to discriminate between original-xml and original-binary plists. "bplist") when saving a file to see if it has already been compressed.

It appears jka-compr only uses magic numbers (ie. The file will be updated and remain in binary format. plist files.(if (null (require 'jka-compr nil t)) (message "Warning: jka-compr not found.") (auto-compression-mode 0) (add-to-list 'jka-compr-compression-info-list ) (auto-compression-mode 1)Restart Emacs and open up a binary. (I tried piping to using plutil /dev/stdin, but got errors.)Īfter creating the file, make it executable with this command (replacing /path/to/scriptfile with the actual path to your script): chmod a+x /path/to/scriptfileFinally, add this to your. This step is necessary because Emacs's auto-compression-mode uses standard output and standard input to pipe data, but plutil only acts on a physical file. Here's the contents: #!/bin/shtempfile=/tmp/`basename $0`.$$touch $tempfiledd $tempfileplutil $* $tempfile dd &1All the script does is take data passed to it via standard input and save it to a temporary file, convert the temporary file with the plutil commmand, and write the contents of the file to standard output. I put mine in ~/bin, but you can put it wherever you prefer. This version will also save them as binary files again, transparently.įirst, we need to create a wrapper script for plutil. This is an alternative method for this hint, which will allow you to edit binary.
