On Debian Wheezy, Emacs 23.3.1, running ediff-files with a file that is missing a newline at the end results in the error \ No newline at end of file (I hope that’s the correct translation; it’s German \ Kein Zeilenumbruch am Dateiende. on my computer.)
Is it possible to have just a warning instead, so that I can see the diff and work on it (and fix the missing newline)? It’s just a bit tedious to first have ediff fail, then open the file, add the newline, ediff again.
Try changing the value of the variable
ediff-diff-ok-lines-regexpto include the German text (“Kein Zeilenumbruch am Dateiende”):(setq ediff-diff-ok-lines-regexp (concat "^\\(" "[0-9,]+[acd][0-9,]+\C-m?$" "\\|[] " "\\|---" "\\|.*Warning *:" "\\|.*No +newline" "\\|.*missing +newline" "\\|.*Kein +Zeilenumbruch +am +Dateiende" "\\|^\C-m?$" "\\)"))Update: Looking at the source code, it does seem that Ediff doesn’t make any attempt to deal with the issue of localization of messages from
diff. It should also be possible to work around this by wrappingdiffin a shell script, e.g:..then customising the
ediff-diff-programto call the wrapper instead:Other code in the Emacs source directory lisp/vc does seem to handle this, for example
vc-hg-state:(defun vc-hg-state (file) "Hg-specific version of `vc-state'." ... (with-output-to-string (with-current-buffer standard-output (setq status (condition-case nil ;; Ignore all errors. (let ((process-environment ;; Avoid localization of messages so we ;; can parse the output. (append (list "TERM=dumb" "LANGUAGE=C") process-environment))) ...It seems a bit strange that Ediff doesn’t also do this, but perhaps I’m missing something.