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#52295: 28.0.90; Killing text results in coding system complaint Date: Mon, 06 Dec 2021 14:33:45 +0200 Message-ID: <83a6hd3oba.fsf@gnu.org> References: <875ys3sgfv.fsf.ref@yahoo.com> <875ys3sgfv.fsf@yahoo.com> <83k0gj4ezx.fsf@gnu.org> <87sfv7qvgs.fsf@yahoo.com> <83ee6r4dq5.fsf@gnu.org> <87ee6rqu6k.fsf@yahoo.com> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="16435"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 52295@debbugs.gnu.org To: Po Lu Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Mon Dec 06 13:34:10 2021 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 1muDC5-00047K-F1 for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 06 Dec 2021 13:34:09 +0100 Original-Received: from localhost ([::1]:48134 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1muDC4-0000bN-2W for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 06 Dec 2021 07:34:08 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:48880) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1muDBy-0000ad-3r for bug-gnu-emacs@gnu.org; Mon, 06 Dec 2021 07:34:02 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:49181) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1muDBx-0002e9-RH for bug-gnu-emacs@gnu.org; Mon, 06 Dec 2021 07:34:01 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1muDBx-0004hQ-Ol for bug-gnu-emacs@gnu.org; Mon, 06 Dec 2021 07:34:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 06 Dec 2021 12:34:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 52295 X-GNU-PR-Package: emacs Original-Received: via spool by 52295-submit@debbugs.gnu.org id=B52295.163879403618048 (code B ref 52295); Mon, 06 Dec 2021 12:34:01 +0000 Original-Received: (at 52295) by debbugs.gnu.org; 6 Dec 2021 12:33:56 +0000 Original-Received: from localhost ([127.0.0.1]:60725 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1muDBs-0004h2-4x for submit@debbugs.gnu.org; Mon, 06 Dec 2021 07:33:56 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:48024) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1muDBq-0004gl-6Y for 52295@debbugs.gnu.org; Mon, 06 Dec 2021 07:33:54 -0500 Original-Received: from [2001:470:142:3::e] (port=48926 helo=fencepost.gnu.org) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1muDBk-0002bx-Ug; Mon, 06 Dec 2021 07:33:48 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=g8VHDQQpSGIPhpyTiaeKBi3U6+yNxXU/r9f5lMLz2Js=; b=qX/kTuTF9Evz E9Z/x2v7s9kv+0/gi9cJwEdiZ0zI014FbcECukrd2UHAbTlkY52e+xCIf29LPmzPHbucU296fOMi/ jkAVA33ZY4wCP5G8FxdkNefmvf6JtZm+Bv8sJoIBU1eblDwJ0uarq+grKq3TkuZIzMfbvlRBaTiVQ oLvx/koHLEnXBQ81LF9toeuBhT2BbUTkLI07Du7mwc5c8e4+PeFxwK1CC2dfJwG6wEcK1j7xAAs5X ll/r6+YEZYtMZaha/3FCESVpHozIHAG2bF3egcn2Nf4GiZebgKxREpBR3HEWQPcsJuNnn+wl7L7ed R+Hm65tdYnuu2/m/nRsAIg==; Original-Received: from [87.69.77.57] (port=4413 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 1muDBk-0007Ur-GL; Mon, 06 Dec 2021 07:33:49 -0500 In-Reply-To: <87ee6rqu6k.fsf@yahoo.com> (message from Po Lu on Sun, 05 Dec 2021 17:26:11 +0800) 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" Xref: news.gmane.io gmane.emacs.bugs:221738 Archived-At: > From: Po Lu > Cc: 52295@debbugs.gnu.org > Date: Sun, 05 Dec 2021 17:26:11 +0800 > > >> > selection-coding-system > >> > next-selection-coding-system > >> > >> Both variables are nil. > > > > That's the problem. But I don't understand why is that so. The value > > of selection-coding-system is set in globals_of_w32select, which is > > called during startup, and where we have this code: > > > > ANSICP = GetACP (); > > OEMCP = GetOEMCP (); > > > > QANSICP = coding_from_cp (ANSICP); > > QOEMCP = coding_from_cp (OEMCP); > > > > if (os_subtype == OS_SUBTYPE_NT) > > Vselection_coding_system = Qutf_16le_dos; > > else if (inhibit_window_system) > > Vselection_coding_system = QOEMCP; > > else > > Vselection_coding_system = QANSICP; > > > > On Windows 9X, this should assign the ANSI codepage to > > selection-coding-system. Since your codepage seems to be 1252, it > > should assign the symbol 'cp1252-dos' to selection-coding-system, see > > coding_from_cp. > > > > Why doesn't this happen in your case? > > Maybe that variable is dumped during the build process, with a value > appropriate for NT, and when Emacs starts on a 9X system some other code > sees that it is invalid and sets it to nil? No, the code above is run in the dumped Emacs, when it starts, not in temacs. So the values should reflect what happens when you start Emacs on the Windows 9X system. Could you perhaps add some printf's there to see what actually happens? It almost looks like that code doesn't get called (which would be strange by itself), since coding_from_cp cannot possibly return nil. Or maybe the initial assignment does work, but then some code resets the variable back to nil?