[Top][All Lists]

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

Re: Towards a cleaner build: hexl

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

In hexl-insert-multibyte-char:
hexl.el:881:29:Warning: ‘string-as-unibyte’ is an obsolete function (as of
    26.1); use ‘encode-coding-string’.

This is the code...

           (let ((encoded (encode-coding-char ch coding))
                 (internal (string-as-unibyte (char-to-string ch)))
             ;; 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)))


(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]