this post was submitted on 18 Nov 2023
0 points (50.0% liked)
Emacs
313 readers
2 users here now
A community for the timeless and infinitely powerful editor. Want to see what Emacs is capable of?!
Get Emacs
Rules
- Posts should be emacs related
- Be kind please
- Yes, we already know: Google results for "emacs" and "vi" link to each other. We good.
Emacs Resources
Emacs Tutorials
- Beginner’s Guide to Emacs
- Absolute Beginner's Guide to Emacs
- How to Learn Emacs: A Hand-drawn One-pager for Beginners
Useful Emacs configuration files and distributions
Quick pain-saver tip
founded 1 year ago
MODERATORS
you are viewing a single comment's thread
view the rest of the comments
view the rest of the comments
Depends on the configured diff program and its options.
This has nothing to do with the diff program. Ediff is not able to highlight whitespace differences like it highlights non-whitespace differences. Maybe it is possible to do somehow, but by default, whitespace differences generate a diff region with no highlights (or as ediff calls it, refinements).
It is because highlights are done on word level, and whitespaces are not words.
Oh, interesting.
I see.
Just popped open the Ediff code and there is a significant amount of effort put into ignoring whitespace. Like, it's not a shortcoming per se that it can't show this content but rather a deliberate onslaught to avoid it at all costs. The author must have been really annoyed by whitespace. 😂
I mostly use
(ediff-buffers)
in my day-to-day work in Spacemacs to compare two regions that I've narrowed to indirect buffers, and, interestingly, it does show me diffs that contain whitespace-only changes and prints the following to the echo area:https://preview.redd.it/587vplu76e1c1.png?width=1896&format=png&auto=webp&s=e3d559ae695972f62865560b96f23953b4b26027
I did a quick test with other ediff functions bound in Spacemacs, and
ediff-windows-linewise
has the same behavior, butediff-windows-wordwise
does not -- it completely ignored diffs that were whitespace only and there was not even##
binding available in that ediff session.When browsing the code, I found a local variable named ediff-whitespace (which u/doolio_ has already pointed out here in reply to you, actually), which is curious:
(
\240
is Unicode symbol for nonbreakable whitespace.)I wonder whether this variable can be set to nil.
PS:
Apparently word splitting is configurable with ediff-forward-word-function ?