Subject: bug#70988: closed (Re: bug#70988: (read FUNCTION) uses Latin-1 [PATCH])

From: [email-masked] (GNU bug Tracking System)
Date: Thu, 10 Jul 2025 09:12:05 +0000

Your bug report

#70988: (read FUNCTION) uses Latin-1 [PATCH]

which was filed against the emacs package, has been closed.

The explanation is attached below, along with your original report.
If you require more details, please reply to [email-masked].

-- 
70988: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=70988
GNU Bug Tracking System
Contact [email-masked] with problems

Subject: Re: bug#70988: (read FUNCTION) uses Latin-1 [PATCH]
From: Mattias Engdegård <[email-masked]>
To: Stefan Monnier <[email-masked]>
Cc: Eli Zaretskii <[email-masked]>, [email-masked], Pip Cet <[email-masked]>
Date: Thu, 10 Jul 2025 11:11:43 +0200
List-Id: <debbugs-submit.debbugs.gnu.org>

> The speed-up patch mentioned earlier will be applied shortly as well.

That patch is now in master too, and while there is more work to be done in that regard we are long past the scope of this bug which is hereby closed.

Subject: (read FUNCTION) uses Latin-1 [PATCH]
From: Mattias Engdegård <[email-masked]>
To: Emacs Bug Report <[email-masked]>
Cc: Stefan Monnier <[email-masked]>
Date: Thu, 16 May 2024 20:13:18 +0200
List-Id: <debbugs-submit.debbugs.gnu.org>

When `read` is called with a function as stream argument, the return values of that function are often interpreted as Latin-1 characters with only the 8 low bits used. Example:

(let* ((next '(?A #x12a nil))
       (f (lambda (&rest args)
            (if args
                (push (car args) next)
              (pop next)))))
  (read f))
=> A*   ; expected: AĪ

This is a result of `readchar` setting *multibyte to 0 on this code path.

The reader is not very consistent: inside string and character literals, the code seems to work as expected.

The fix is straightforward (attached).