From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: Towards a cleaner build Date: Fri, 17 May 2019 11:31:52 +0300 Message-ID: <83sgtdbhxj.fsf@gnu.org> References: Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="227122"; mail-complaints-to="usenet@blaine.gmane.org" Cc: emacs-devel@gnu.org To: Lars Ingebrigtsen Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri May 17 10:32:11 2019 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hRYHj-000wwz-EV for ged-emacs-devel@m.gmane.org; Fri, 17 May 2019 10:32:11 +0200 Original-Received: from localhost ([127.0.0.1]:44421 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hRYHh-00020y-RN for ged-emacs-devel@m.gmane.org; Fri, 17 May 2019 04:32:09 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:57714) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hRYHZ-0001zk-87 for emacs-devel@gnu.org; Fri, 17 May 2019 04:32:02 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:38163) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hRYHZ-0002M5-1n; Fri, 17 May 2019 04:32:01 -0400 Original-Received: from [176.228.60.248] (port=4199 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1hRYHY-0006eY-GH; Fri, 17 May 2019 04:32:00 -0400 In-reply-to: (message from Lars Ingebrigtsen on Fri, 17 May 2019 05:51:37 +0200) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:236632 Archived-At: > From: Lars Ingebrigtsen > Date: Fri, 17 May 2019 05:51:37 +0200 > > In ps-begin-job: > ps-print.el:5773:17:Warning: ‘string-as-unibyte’ is an obsolete function (as > of 26.1); use ‘encode-coding-string’. > ps-print.el:5775:17:Warning: ‘string-as-unibyte’ is an obsolete function (as > of 26.1); use ‘encode-coding-string’. > > Here's the code: > > (cond ((eq ps-print-control-characters '8-bit) > (string-as-unibyte "[\000-\037\177-\377]")) > ((eq ps-print-control-characters 'control-8-bit) > (string-as-unibyte "[\000-\037\177-\237]")) > ((eq ps-print-control-characters 'control) > "[\000-\037\177]") > (t "[\t\n\f]")) > > But... aren't both those strings unibyte already? The question is not whether the original strings are unibyte, the question is does (setq foo "[\000-\037\177-\377]") produce a unibyte or a multibyte string, including after processing by the Lisp reader (and when this file is byte-compiled). E.g., \377 is above decimal 127, so it could, in principle, be interpreted as the corresponding Unicode codepoint of a Latin character. If you verified that removing string-as-unibyte here produces a unibyte string in ps-control-or-escape-regexp, including after byte-compilation, then yes, we can remove that function call here. But for making this future-proof, I'd add an assertion there, or maybe add a test to verify this stays that way, come what may. Thanks.