emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Towards a cleaner build


From: Lars Ingebrigtsen
Subject: Re: Towards a cleaner build
Date: Fri, 17 May 2019 12:13:14 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux)

Eli Zaretskii <address@hidden> writes:

> 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).

Let's see...  I put this in ps-print.el:

(defun ps-test ()
  (let ((string1 "[\000-\037\177-\377]")
        (string2 "[\000-\037\177-\237]"))
    (message "%s %s\n%s %s"
             (multibyte-string-p string1) string1
             (multibyte-string-p string2) string2)))

(ps-test)
=> "nil address@hidden
nil address@hidden"

(load "~/src/emacs/trunk/lisp/ps-print.el")
(ps-test)
=> "nil address@hidden
nil address@hidden"

(byte-compile-file "~/src/emacs/trunk/lisp/ps-print.el")
(load "~/src/emacs/trunk/lisp/ps-print.elc")
(ps-test)
"nil address@hidden
nil address@hidden"

ps-test is a compiled Lisp function in ‘ps-print.el’.

(ps-test)

So they do seem to be unibyte no matter how I load/eval the function,
unless I did something wrong 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.

OK; I'll remove and add an assertion.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no



reply via email to

[Prev in Thread] Current Thread [Next in Thread]