[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#1051: 23.0.60; rmail decoding bug
From: |
Eli Zaretskii |
Subject: |
bug#1051: 23.0.60; rmail decoding bug |
Date: |
Tue, 30 Sep 2008 15:00:31 +0300 |
> From: Kenichi Handa <handa@m17n.org>
> CC: 1051@emacsbugs.donarmstrong.com, rms@gnu.org, emacs-pretest-bug@gnu.org,
> bug-gnu-emacs@gnu.org
> Date: Tue, 30 Sep 2008 19:59:08 +0900
>
> In article <uljxajac7.fsf@gnu.org>, Eli Zaretskii <eliz@gnu.org> writes:
>
> > The problem is within mail-unquote-printable-region: it relies on
> > insert-char to insert a unibyte character, even if the target buffer
> > is a multibyte buffer. In Emacs 22.x this works, but not in Emacs 23.
>
> > Perhaps Handa-san can suggest what is the best way of inserting
> > unibyte characters into a multibyte buffer in Emacs 23. Obviously,
> > insert-file-contents does that when coding-system-for-read is bound to
> > no-conversion.
>
> The Lisp API for that is insert-byte.
Thanks, this indeed fixes the problem.
Richard, please see if the patch below fixes the problem for you as
well.
> It may be good to provide byte-after, following-byte, and
> preceding-byte (all signal an error if the character is not
> an ASCII nor eight-bit character). What do you think?
I agree that it would be nice to have such a feature, but perhaps a
single API
(get-byte POS)
would be enough? This could default to point if POS is nil or
omitted, and could even read from a string if POS is a string.
2008-09-30 Eli Zaretskii <eliz@gnu.org>
* mail/mail-utils.el (mail-unquote-printable-region): Use
insert-byte instead of insert-char, when the UNIBYTE arg is
non-nil.
Index: lisp/mail/mail-utils.el
===================================================================
RCS file: /cvsroot/emacs/emacs/lisp/mail/mail-utils.el,v
retrieving revision 1.65
retrieving revision 1.66
diff -c -r1.65 -r1.66
*** lisp/mail/mail-utils.el 6 May 2008 07:22:25 -0000 1.65
--- lisp/mail/mail-utils.el 30 Sep 2008 11:53:21 -0000 1.66
***************
*** 141,148 ****
(if unibyte
(progn
(replace-match "")
! ;; insert-char will insert this as unibyte,
! (insert-char char 1))
(replace-match (make-string 1 char) t t))))
(noerror
(setq failed t))
--- 141,149 ----
(if unibyte
(progn
(replace-match "")
! ;; insert-byte will insert this as a
! ;; corresponding eight-bit character.
! (insert-byte char 1))
(replace-match (make-string 1 char) t t))))
(noerror
(setq failed t))
- bug#1051: 23.0.60; rmail decoding bug, Richard M. Stallman, 2008/09/29
- bug#1051: 23.0.60; rmail decoding bug, Eli Zaretskii, 2008/09/29
- bug#1051: 23.0.60; rmail decoding bug, Richard M. Stallman, 2008/09/30
- bug#1051: 23.0.60; rmail decoding bug, Eli Zaretskii, 2008/09/30
- bug#1051: 23.0.60; rmail decoding bug, Eli Zaretskii, 2008/09/30
- bug#1051: 23.0.60; rmail decoding bug, Kenichi Handa, 2008/09/30
- bug#1051: 23.0.60; rmail decoding bug,
Eli Zaretskii <=
- bug#1051: 23.0.60; rmail decoding bug, Richard M. Stallman, 2008/09/30
- bug#1051: 23.0.60; rmail decoding bug, Kenichi Handa, 2008/09/30