* Re: TRAMP copies binary files incorrectly [not found] ` <E1H5Aiw-0003hY-EH@etlken.m17n.org> @ 2007-01-24 8:18 ` Katsumi Yamaoka 2007-01-24 11:08 ` Kenichi Handa 0 siblings, 1 reply; 3+ messages in thread From: Katsumi Yamaoka @ 2007-01-24 8:18 UTC (permalink / raw) To: Kenichi Handa; +Cc: emacs-pretest-bug, Chris Moore, ding >>>>> 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--- ^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: TRAMP copies binary files incorrectly 2007-01-24 8:18 ` TRAMP copies binary files incorrectly Katsumi Yamaoka @ 2007-01-24 11:08 ` Kenichi Handa 2007-01-24 13:13 ` Katsumi Yamaoka 0 siblings, 1 reply; 3+ messages in thread From: Kenichi Handa @ 2007-01-24 11:08 UTC (permalink / raw) To: Katsumi Yamaoka; +Cc: emacs-pretest-bug, christopher.ian.moore, ding In article <b4mhcughm76.fsf@jpl.org>, Katsumi Yamaoka <yamaoka@jpl.org> writes: >>>>>> 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'. Ah! :-( > 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). Yes. Please install your change. --- Kenichi Handa handa@m17n.org > --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--- ^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: TRAMP copies binary files incorrectly 2007-01-24 11:08 ` Kenichi Handa @ 2007-01-24 13:13 ` Katsumi Yamaoka 0 siblings, 0 replies; 3+ messages in thread From: Katsumi Yamaoka @ 2007-01-24 13:13 UTC (permalink / raw) To: Kenichi Handa; +Cc: emacs-pretest-bug, christopher.ian.moore, ding >>>>> In <E1H9fzO-00073J-8M@etlken.m17n.org> Kenichi Handa wrote: > In article <b4mhcughm76.fsf@jpl.org>, Katsumi Yamaoka <yamaoka@jpl.org> writes: >> uudecode.el bundled with Gnus now doesn't work with Emacs 21 and >> XEmacs because of `string-to-multibyte'. [...] >> + (defalias 'uudecode-string-to-multibyte [...] > Yes. Please install your change. I've installed it in both the Gnus trunk and the v5-10 branch. The later will be merged into Emacs CVS soon. Regards, ^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2007-01-24 13:13 UTC | newest] Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- [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 ` TRAMP copies binary files incorrectly Katsumi Yamaoka 2007-01-24 11:08 ` Kenichi Handa 2007-01-24 13:13 ` Katsumi Yamaoka
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).