This is one very, very strange bug.
Happens on GNU Emacs 25.0.50.2 (x86_64-pc-linux-gnu, GTK+ Version 3.10.8), Mint,
but not on GNU Emacs 24.5.1 (x86_64-unknown-linux-gnu, GTK+ Version 3.16.6), Arch
I tested to get most minimal example and here it is.
- Create empty .emacs.d/
- Put init.el:
(package-initialize)
(add-hook 'before-save-hook 'delete-trailing-whitespace)
- Create .emacs.d/elpa dir and copy just haskell-mode in
(notice haskell-mode is not even required in init.el?)
- Create a .hs file with this content in
external editor
....
....redirect
....
..where
..
- Replace all dots with space in
external editor
- Open file in emacs
- Make a change and save the file
- In buffer you see just
where is gone.
This can happen in the middle of the file, at the end....
Not all content is deleted. Few lines here, few lines there.
Can anyone test and reproduce this?