From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs,gmane.emacs.pretest.bugs Subject: bug#1051: 23.0.60; rmail decoding bug Date: Tue, 30 Sep 2008 15:00:31 +0300 Message-ID: References: Reply-To: Eli Zaretskii , 1051@emacsbugs.donarmstrong.com NNTP-Posting-Host: lo.gmane.org X-Trace: ger.gmane.org 1222778035 23768 80.91.229.12 (30 Sep 2008 12:33:55 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 30 Sep 2008 12:33:55 +0000 (UTC) Cc: emacs-pretest-bug@gnu.org, bug-gnu-emacs@gnu.org, 1051@emacsbugs.donarmstrong.com, rms@gnu.org To: Kenichi Handa Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Tue Sep 30 14:34:52 2008 connect(): Connection refused Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1KkeRH-00056V-HA for geb-bug-gnu-emacs@m.gmane.org; Tue, 30 Sep 2008 14:34:51 +0200 Original-Received: from localhost ([127.0.0.1]:34016 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KkeQE-0008OC-3l for geb-bug-gnu-emacs@m.gmane.org; Tue, 30 Sep 2008 08:33:46 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1KkeMa-0005JL-W0 for bug-gnu-emacs@gnu.org; Tue, 30 Sep 2008 08:30:01 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1KkeMZ-0005Hz-Vt for bug-gnu-emacs@gnu.org; Tue, 30 Sep 2008 08:30:00 -0400 Original-Received: from [199.232.76.173] (port=41607 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KkeMZ-0005Hr-Oj for bug-gnu-emacs@gnu.org; Tue, 30 Sep 2008 08:29:59 -0400 Original-Received: from rzlab.ucr.edu ([138.23.92.77]:44922) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1KkeMY-0006gj-3P for bug-gnu-emacs@gnu.org; Tue, 30 Sep 2008 08:29:58 -0400 Original-Received: from rzlab.ucr.edu (rzlab.ucr.edu [127.0.0.1]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id m8UCTtLa013002; Tue, 30 Sep 2008 05:29:56 -0700 Original-Received: (from debbugs@localhost) by rzlab.ucr.edu (8.13.8/8.13.8/Submit) id m8UCF4sa009595; Tue, 30 Sep 2008 05:15:04 -0700 X-Loop: don@donarmstrong.com Resent-From: Eli Zaretskii Resent-To: bug-submit-list@donarmstrong.com Resent-CC: Emacs Bugs Resent-Date: Tue, 30 Sep 2008 12:15:04 +0000 Resent-Message-ID: Resent-Sender: don@donarmstrong.com X-Emacs-PR-Message: report 1051 X-Emacs-PR-Package: emacs X-Emacs-PR-Keywords: Original-Received: via spool by submit@emacsbugs.donarmstrong.com id=B.12227764758270 (code B ref -1); Tue, 30 Sep 2008 12:15:04 +0000 Original-Received: (at submit) by emacsbugs.donarmstrong.com; 30 Sep 2008 12:07:55 +0000 Original-Received: from lists.gnu.org (lists.gnu.org [199.232.76.165]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id m8UC7lCG008264 for ; Tue, 30 Sep 2008 05:07:49 -0700 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Kke15-0007sw-5d for bug-gnu-emacs@gnu.org; Tue, 30 Sep 2008 08:07:47 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Kke13-0007rR-6q for bug-gnu-emacs@gnu.org; Tue, 30 Sep 2008 08:07:46 -0400 Original-Received: from [199.232.76.173] (port=36842 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Kke13-0007rO-4E for bug-gnu-emacs@gnu.org; Tue, 30 Sep 2008 08:07:45 -0400 Original-Received: from mtaout1.012.net.il ([84.95.2.1]:35674) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1Kkdu8-0005yB-Nh; Tue, 30 Sep 2008 08:00:37 -0400 Original-Received: from HOME-C4E4A596F7 ([77.127.170.116]) by i-mtaout1.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0K80005XLC2MUXD0@i-mtaout1.012.net.il>; Tue, 30 Sep 2008 15:01:35 +0300 (IDT) In-reply-to: X-012-Sender: halo1@inter.net.il X-detected-operating-system: by monty-python.gnu.org: Solaris 9.1 X-CrossAssassin-Score: 3 X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 3) Resent-Date: Tue, 30 Sep 2008 08:30:00 -0400 X-BeenThere: bug-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:20903 gmane.emacs.pretest.bugs:23120 Archived-At: > From: Kenichi Handa > 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 , Eli Zaretskii 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 * 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))