Subject: Re: bug#43231: 27.1; hexl-insert-hex-char on an empty file "hexl-current-address: Point is not on a character in the file".

From: Eli Zaretskii <[email-masked]>
Date: Sun, 06 Sep 2020 17:15:57 +0300

tags 43231 notabug
thanks

> From: Igor Saprykin <[email-masked]>
> Date: Sat, 5 Sep 2020 12:22:42 -0700
> 
> hexl-mode doesn't seem to allow me to create a binary file.
> 
> Steps:
> 1. Open Emacs
> 2. Create a new file using C-x C-f /tmp/boot-sect.bin
> 3. M-x hexl-mode
> 4. M-x hexl-insert-hex-char
> 5. e
> 6. Nothing is written into the buffer and the message buffer says "Point is not on a character file".

hexl-mode doesn't support adding or deleting characters, it only
supports replacing them.  E.g., hexl-insert-hex-char _replaces_ the
character at point with what you type.  So what you see is what this
mode is supposed to do: it is based on the assumption that the size of
the file you are editing shouldn't be changed.

If you want to create a file from scratch, why do you need hexl-mode?
You can type bytes in hex or octal using C-q.