]> git.eshelyaron.com Git - emacs.git/commit
Fix Hexl handling of coding-systems with BOM
authorEli Zaretskii <eliz@gnu.org>
Tue, 11 May 2021 11:55:29 +0000 (14:55 +0300)
committerEli Zaretskii <eliz@gnu.org>
Tue, 11 May 2021 11:55:29 +0000 (14:55 +0300)
commitf3f1947e5b5beeef9c004cfa2bf591dc0c0331b8
treefdf6f32813a364554bdd8b824403bf5af4b8b9f0
parent6d24a8e626f1c7553c90b579c399aeae8c82dd8c
Fix Hexl handling of coding-systems with BOM

* lisp/international/mule-cmds.el (encode-coding-char): If
CODING-SYSTEM produces BOM, remove the BOM bytes from the produced
byte sequence.  (Bug#48324)

* lisp/hexl.el (hexl-mode): Use bufferpos-to-filepos to convert
point to offset into the original file.
(hexl-mode-exit, hexl-maybe-dehexlify-buffer): Use
filepos-to-bufferpos to restore point in the original buffer.
(hexl-mode, hexl-insert-multibyte-char)
(hexl-self-insert-command, hexl-insert-hex-char)
(hexl-insert-decimal-char, hexl-insert-octal-char)
(hexl-find-file): Enhance the doc strings, mainly explaining the
complications of inserting multibyte characters.
(hexl-insert-multibyte-char): Don't treat CH as unibyte if the
coding-system isn't ASCII-compatible.  Don't treat null bytes as
multibyte.
lisp/hexl.el
lisp/international/mule-cmds.el