Copy/Paste seems broken for hexl-mode, eg. M-w copies the hex tables to the clipboard, rather useless. Since hexl-mode has overwrite-mode by default, how can the following be implemented?

  • M-w should copy marked binary data to the clipboard
  • C-y should insert contents of clipboard by overwriting, starting at cursor position
  • C-w should overwrite the marked area with hexl-mode-clear-value
  • DEL should set current byte to hexl-mode-clear-value and go to previous byte

hexl-mode-clear-value should be a customisable variable defaulting to \x00.

If Emacs is not in overwrite mode, copy/paste should work like plain text files, though this seems like low priority / undesirable since skewing binary data equals data corruption in most cases.


I implemented such a variant of overwrite-mode as part of nhexl-mode-0.4 (available from GNU ELPA), which I called nhexl-overwrite-only-mode. It also works in "normal" editing modes (i.e. outside of nhexl-mode) but it won't work for hexl-mode, I'm afraid.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.