emacs-devel
[Top][All Lists]
Advanced

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

Re: Towards a cleaner build: hexl


From: Stefan Monnier
Subject: Re: Towards a cleaner build: hexl
Date: Fri, 17 May 2019 12:23:13 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux)

>          (let ((encoded (encode-coding-char ch coding))
>                (internal (string-as-unibyte (char-to-string ch)))
>                internal-hex)
>            ;; If encode-coding-char returns nil, it means our character
>            ;; cannot be safely encoded with buffer-file-coding-system.
>            ;; In that case, we offer to insert the internal representation
>            ;; of that character, byte by byte.
>
> And here we really, really want the internal byte representation of the
> multibyte string, so I think the code is correct and just needs a
> with-no-warnings?  I mean,
>
>   (with-suppressed-warnings ((obsolete string-as-unibyte))
>     (string-as-unibyte (char-to-string ch)))

FWIW, this fallback behavior is a misfeature.
We should rather signal an error.

But I also consider hexl-mode as obsoleted by nhexl-mode, so my opinion
is probably not terribly relevant,


        Stefan




reply via email to

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