|
From: | Dmitry Gutov |
Subject: | bug#61396: diff mode could distinguish changed from deleted lines |
Date: | Wed, 13 Sep 2023 01:31:21 +0300 |
User-agent: | Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.13.0 |
- First, `diff -u` (contrary to `diff -c`) does not distinguish between `removed/added` and `modified` lines. And `diff-mode` currently inherits this weakness. I think there's a good case to be made for highlighting the "truly added" and "truly removed" lines differently from those that are modified. I'd argue that a "logical" choice would be to highlight them the same way as those parts highlighted by `diff-refine-hunk` (i.e. `diff-refine-removed` and `diff-refine-added`) since that's how refinement would highlight them if we were to ask it to.The patch below does that for the case of unified diffs. I kind of like the result. It's not quite ready for prime time, but I'd be interested to hear what other people think about it.
Not quite ready indeed: the new option is unused (implied to be t, I guess).Just a single piece of feedback: I get where the idea is coming from (and it's good in theory), but I'm not loving the added bright spots of color where there previously were just toned down lighter backgrounds.
If it were indicated differently somehow (though I'm not sure how), perhaps I'd like it more. As it is, though, the added value (quite minor since it's easy to see which hunk is "pure addition" already) doesn't seem to balance out the inconvenience.
[Prev in Thread] | Current Thread | [Next in Thread] |