From: Katsumi Yamaoka <yamaoka@jpl.org>
To: Kenichi Handa <handa@m17n.org>
Cc: emacs-pretest-bug@gnu.org,
Chris Moore <christopher.ian.moore@gmail.com>,
ding@gnus.org
Subject: Re: TRAMP copies binary files incorrectly
Date: Wed, 24 Jan 2007 17:18:37 +0900 [thread overview]
Message-ID: <b4mhcughm76.fsf@jpl.org> (raw)
In-Reply-To: <E1H5Aiw-0003hY-EH@etlken.m17n.org>
>>>>> In <E1H5Aiw-0003hY-EH@etlken.m17n.org> Kenichi Handa wrote:
> In article <m264bdpygh.fsf@gmail.com>, Chris Moore <christopher.ian.moore@gmail.com> writes:
>> Stefan Monnier <monnier@iro.umontreal.ca> 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---
next parent reply other threads:[~2007-01-24 8:18 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <m2k5zuir7g.fsf@gmail.com>
[not found] ` <umz4qh9uc.fsf@gnu.org>
[not found] ` <m2r6u2mmwt.fsf@gmail.com>
[not found] ` <E1H4rWZ-0005Ce-TW@etlken.m17n.org>
[not found] ` <jwvvejegn3l.fsf-monnier+emacs@gnu.org>
[not found] ` <m264bdpygh.fsf@gmail.com>
[not found] ` <E1H5Aiw-0003hY-EH@etlken.m17n.org>
2007-01-24 8:18 ` Katsumi Yamaoka [this message]
2007-01-24 11:08 ` Kenichi Handa
2007-01-24 13:13 ` Katsumi Yamaoka
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=b4mhcughm76.fsf@jpl.org \
--to=yamaoka@jpl.org \
--cc=christopher.ian.moore@gmail.com \
--cc=ding@gnus.org \
--cc=emacs-pretest-bug@gnu.org \
--cc=handa@m17n.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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 NNTP newsgroup(s).