> I have used edebug and error-on-quit to trace the culprit and find a > reproducible recipe. It turns out it has nothing to do with whitespace. > > 1. emacs -q > 2. M-x which-func-mode > 3. C-x C-f emacs-gnus-ticked-doc.patch > [...] > In my experience, I have found which-func-mode to be intrusive and > unreliable. So I guess I will have to disable it to avoid further > trouble. Looks to me like a bug in `diff-sanity-check-hunk' which fails to make the hunk well-formed. However, I think `diff-find-source-location' shouldn't do any sanity checks in the first place when called with a non-nil NOPROMPT argument. So could you try whether the attached patch solves your problem? Thanks, martin.