Download all attached files into the same directory, then run emacs -Q -l test-insert-file-contents.el The expected result is the text of "src" in "*a buffer*". The actual result has the last line ending in "_SRE" instead of "_SRC". I see this problem in 24.5 and 25.0.94, on both Windows and GNU/Linux. Note that the test files "quote" and "src" have DOS line endings, and don't have a newline at the end of the file. This initially manifested as a yasnippet bug [1], it's easy to work around though (just use `erase-buffer' instead of passing non-nil REPLACE to `insert-file-contents'). [1]: https://github.com/joaotavora/yasnippet/issues/707