reddit / emacs

How to troubleshoot problem with M-x diff-buffers

MaherVelousSc2 · 2022-06-29 00:51
Hello, I'm having a problem with M-x diff-buffers, in that I have two buffers which are definitely different, and calling diff-buffers on the two of them returns that they are identical. How should I go about troubleshooting this issue? It seems like it's writing the contents to two temp files and then diffing these two files, and I'm not familiar with debugging elisp at all [tracing functions? inspecting stuff that's running?]. Is there a way to get to the bottom of this which doesn't involve learning how to debug elisp and debugging `diff`? Thanks in advance, sorry if the problem is badly posed.
redguardtoo · 2022-06-29 04:07
Make sure the cli program `diff` exists and is added into the OS envrionment variable `PATH` (see https://duckduckgo.com/?q=environment+variable+path&atb=v320-1&ia=web). You might need install diff and setup `PATH` if you are using Windows. If the issue is still not resolved, - `M-x togggle-debug-on-error` and reproduce the issue - report the bug to the emacs core team, `M-x report-emacs-bug` Besides, https://github.com/redguardtoo/diff-lisp provides a pure Emacs Lisp solution which needs no setup. You can use its region comparing command as a fallback.
samsjj · 2022-06-29 06:27
Try ediff
Phil-Hudson · 2022-06-29 07:23
This. Usually the better solution IME.
wargxs · 2022-07-01 06:48
Can you do diff buffer with file for both of them? And if different, save them? or ediff :-)