emacs-pretest-bug
[Top][All Lists]
Advanced

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

Re: TRAMP copies binary files incorrectly


From: Katsumi Yamaoka
Subject: Re: TRAMP copies binary files incorrectly
Date: Wed, 24 Jan 2007 17:18:37 +0900
User-agent: Gnus/5.110006 (No Gnus v0.6) Emacs/22.0.93 (gnu/linux)

>>>>> In <address@hidden> Kenichi Handa wrote:

> In article <address@hidden>, Chris Moore <address@hidden> writes:

>> Stefan Monnier <address@hidden> writes:
>>>> Which function is it?
>>>
>>> I believe the function "at fault" is uudecode-decode-region

>> Yes, it's uudecode-decode-region.

> Ok, I've just installed a fix to make it work on a multibyte
> buffer.

I'm sorry for the late response but I noticed that uudecode.el
bundled with Gnus now doesn't work with Emacs 21 and XEmacs
because of `string-to-multibyte'.  Since Gnus still supports
those versions of Emacsen, we have the emulating function for it
in mm-util.el as follows:

--8<---------------cut here---------------start------------->8---
(defalias 'mm-string-to-multibyte
  (cond
   ((featurep 'xemacs)
    'identity)
   ((fboundp 'string-to-multibyte)
    'string-to-multibyte)
   (t
    (lambda (string)
      "Return a multibyte string with the same individual chars as string."
      (mapconcat
       (lambda (ch) (mm-string-as-multibyte (char-to-string ch)))
       string "")))))
--8<---------------cut here---------------end--------------->8---

Is it possible to add a similar one to uudecode.el?  I've tested
the attached patch with Gnus v5.10.8 (aka v5.11).

Thanks in advance.

--8<---------------cut here---------------start------------->8---
*** uudecode.el~        Sun Jan 21 21:53:53 2007
--- uudecode.el Wed Jan 24 08:15:57 2007
***************
*** 128,133 ****
--- 128,147 ----
          (message "Can not uudecode")))
        (ignore-errors (or file-name (delete-file tempfile))))))
  
+ (eval-and-compile
+   (defalias 'uudecode-string-to-multibyte
+     (cond
+      ((featurep 'xemacs)
+       'identity)
+      ((fboundp 'string-to-multibyte)
+       'string-to-multibyte)
+      (t
+       (lambda (string)
+       "Return a multibyte string with the same individual chars as string."
+       (mapconcat
+        (lambda (ch) (string-as-multibyte (char-to-string ch)))
+        string ""))))))
+ 
  ;;;###autoload
  (defun uudecode-decode-region-internal (start end &optional file-name)
    "Uudecode region between START and END without using an external program.
***************
*** 206,212 ****
          (or (markerp end) (setq end (set-marker (make-marker) end)))
          (goto-char start)
          (if enable-multibyte-characters
!             (mapc #'(lambda (x) (insert (string-to-multibyte x)))
                    (nreverse result))
            (insert (apply 'concat (nreverse result))))
          (delete-region (point) end))))))
--- 220,226 ----
          (or (markerp end) (setq end (set-marker (make-marker) end)))
          (goto-char start)
          (if enable-multibyte-characters
!             (mapc #'(lambda (x) (insert (uudecode-string-to-multibyte x)))
                    (nreverse result))
            (insert (apply 'concat (nreverse result))))
          (delete-region (point) end))))))
--8<---------------cut here---------------end--------------->8---




reply via email to

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