(uncompface): Make sure the eol conversion doesn't take place when
authorKatsumi Yamaoka <yamaoka@jpl.org>
Wed, 9 Aug 2006 10:50:46 +0000 (10:50 +0000)
committerKatsumi Yamaoka <yamaoka@jpl.org>
Wed, 9 Aug 2006 10:50:46 +0000 (10:50 +0000)
 communicating with the external programs.  Reported by ARISAWA Akihiro.

contrib/ChangeLog
contrib/compface.el

index 4141c03..a30e77b 100644 (file)
@@ -1,3 +1,9 @@
+2006-08-09  Katsumi Yamaoka  <yamaoka@jpl.org>
+
+       * compface.el (uncompface): Make sure the eol conversion doesn't take
+       place when communicating with the external programs.  Reported by
+       ARISAWA Akihiro <ari@mbf.ocn.ne.jp>.
+
 2006-07-17  Sascha Wilde  <wilde@sha-bang.de>
 
        * nnir.el: Removed support for non free backends glimpse and excite.
index 942eb16..83d6f9a 100644 (file)
@@ -81,24 +81,28 @@ or `libgr-progs', for instance."
        ((eq uncompface-use-external t)
         (with-temp-buffer
           (insert face)
-          (and (eq 0 (apply 'call-process-region (point-min) (point-max)
-                            "uncompface"
-                            'delete '(t nil) nil))
-               (progn
-                 (goto-char (point-min))
-                 (insert "/* Width=48, Height=48 */\n")
-                 ;; I just can't get "icontopbm" to work correctly on its
-                 ;; own in XEmacs.  And Emacs doesn't understand un-raw pbm
-                 ;; files.
-                 (if (not (featurep 'xemacs))
-                     (eq 0 (call-process-region (point-min) (point-max)
-                                                "icontopbm"
-                                                'delete '(t nil)))
-                   (shell-command-on-region (point-min) (point-max)
-                                            "icontopbm | pnmnoraw"
-                                            (current-buffer) t)
-                   t))
-               (buffer-string))))
+          (let ((coding-system-for-read 'raw-text)
+                ;; At least "icontopbm" doesn't work with Windows because
+                ;; the line-break code is converted into CRLF by default.
+                (coding-system-for-write 'raw-text-unix))
+            (and (eq 0 (apply 'call-process-region (point-min) (point-max)
+                              "uncompface"
+                              'delete '(t nil) nil))
+                 (progn
+                   (goto-char (point-min))
+                   (insert "/* Width=48, Height=48 */\n")
+                   ;; I just can't get "icontopbm" to work correctly on its
+                   ;; own in XEmacs.  And Emacs doesn't understand un-raw pbm
+                   ;; files.
+                   (if (not (featurep 'xemacs))
+                       (eq 0 (call-process-region (point-min) (point-max)
+                                                  "icontopbm"
+                                                  'delete '(t nil)))
+                     (shell-command-on-region (point-min) (point-max)
+                                              "icontopbm | pnmnoraw"
+                                              (current-buffer) t)
+                     t))
+                 (buffer-string)))))
        (t
         (let* ((gc-cons-threshold (eval '(lsh -1 -1)))
                (start (current-time)))