From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#63644: 29.0.91; Coding system detection defect in html Date: Mon, 22 May 2023 19:04:02 +0300 Message-ID: <83mt1wpd3h.fsf@gnu.org> References: <82357.1684763963@localhost> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-2022-jp Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="29478"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 63644@debbugs.gnu.org To: Ikumi Keita Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Mon May 22 18:04:31 2023 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1q181O-0007SG-Px for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 22 May 2023 18:04:30 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1q181B-0003Kb-QO; Mon, 22 May 2023 12:04:22 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1q180w-0003KC-PI for bug-gnu-emacs@gnu.org; Mon, 22 May 2023 12:04:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1q180w-0000X0-H8 for bug-gnu-emacs@gnu.org; Mon, 22 May 2023 12:04:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1q180v-0005ys-LP for bug-gnu-emacs@gnu.org; Mon, 22 May 2023 12:04:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 22 May 2023 16:04:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 63644 X-GNU-PR-Package: emacs Original-Received: via spool by 63644-submit@debbugs.gnu.org id=B63644.168477143522976 (code B ref 63644); Mon, 22 May 2023 16:04:01 +0000 Original-Received: (at 63644) by debbugs.gnu.org; 22 May 2023 16:03:55 +0000 Original-Received: from localhost ([127.0.0.1]:36034 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1q180p-0005yV-D9 for submit@debbugs.gnu.org; Mon, 22 May 2023 12:03:55 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:53460) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1q180l-0005yH-GH for 63644@debbugs.gnu.org; Mon, 22 May 2023 12:03:53 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1q180e-0000Rw-D8; Mon, 22 May 2023 12:03:44 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-version:References:Subject:In-Reply-To:To:From: Date; bh=Jv7GhAGeFqndBI2GvXmbvXe5m599h0ZuCNT4uBVV7UU=; b=Tr0AwEqQZAEz/BhZJ3BQ rs3MoQE+n1jg8BmF2pAf5pOPy3z5feQt6loD672OFCIS8nuM/8FnaUpD3gtd1tXlmr0tBpw52ArdM Bm6nQT5pbO8mcaf5xNuiGySpUFdNVgrcrFiIPVmJYJ96H34OykoKG3yq4Fxl2lFbho9eHfV+DkDT2 WAsxjmAFERvA+p5vunQXjmsnX3k6GcrVdQj95HqfiQx2SA7UvmY0huYiwg2MoZmv+OBtYeV4Kw3LG UW+lgZtei8jEMKPye+OBghWHsWcDIb7pVDk2NJ890sIEDQ+kAjsZixPsHng0D9nk6g3OP83EC8wbK 5XMj1QG2zFzTbw==; Original-Received: from [87.69.77.57] (helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1q180a-0003lo-QJ; Mon, 22 May 2023 12:03:42 -0400 In-Reply-To: <82357.1684763963@localhost> (message from Ikumi Keita on Mon, 22 May 2023 22:59:23 +0900) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:262167 Archived-At: > From: Ikumi Keita > Date: Mon, 22 May 2023 22:59:23 +0900 > > 0. Save the following file as /tmp/foo.html with the coding system `euc-jp': > ---------------------------------------------------------------------- > > > > > dummy > > > あいうえお > > ---------------------------------------------------------------------- > 1. emacs -Q > 2. C-x C-f /tmp/foo.html RET > 3. M-: (sgml-html-meta-auto-coding-function 1000) RET > 4. Then emacs signals error with the following backtrace: > Debugger entered--Lisp error: (coding-system-error iso-2022) > coding-system-plist(iso-2022) > coding-system-equal(utf-8 iso-2022) > sgml-html-meta-auto-coding-function(1000) > eval((sgml-html-meta-auto-coding-function 1000) t) > eval-expression((sgml-html-meta-auto-coding-function 1000) nil nil 127) > funcall-interactively(eval-expression (sgml-html-meta-auto-coding-function 1000) nil nil 127) > call-interactively(eval-expression nil nil) > command-execute(eval-expression) Thanks. Does the patch below give good results? diff --git a/lisp/international/mule.el b/lisp/international/mule.el index 25b90b4..2b44a2e 100644 --- a/lisp/international/mule.el +++ b/lisp/international/mule.el @@ -2484,10 +2484,12 @@ sgml-xml-auto-coding-function ;; called as part of visiting a file, as opposed ;; to when saving a buffer to a file. (if (and enable-multibyte-characters - ;; 'charset' will signal an error in - ;; coding-system-equal, since it isn't a - ;; coding-system. So test that up front. + ;; 'charset' and 'iso-2022' will signal + ;; an error in coding-system-equal, since + ;; they aren't coding-systems. So test + ;; that up front. (not (equal sym-type 'charset)) + (not (equal sym-type 'iso-2022)) (coding-system-equal 'utf-8 sym-type) (coding-system-equal 'utf-8 bfcs-type)) buffer-file-coding-system @@ -2540,11 +2542,13 @@ sgml-html-meta-auto-coding-function (bfcs-type (coding-system-type buffer-file-coding-system))) (if (and enable-multibyte-characters - ;; 'charset' will signal an error in - ;; coding-system-equal, since it isn't a - ;; coding-system. So test that up front. + ;; 'charset' and 'iso-2022' will signal an error + ;; in coding-system-equal, since they aren't + ;; coding-systems. So test that up front. (not (equal sym-type 'charset)) (not (equal bfcs-type 'charset)) + (not (equal sym-type 'iso-2022)) + (not (equal bfcs-type 'iso-2022)) (coding-system-equal 'utf-8 sym-type) (coding-system-equal 'utf-8 bfcs-type)) buffer-file-coding-system