Ediff uses the same color-coding as ordinary diffs in diff-mode
, Magit,
etc. (Option for diff buffer looks). This is consistent with the
principle of least surprise.
Users may, however, prefer to treat Ediff differently on the premise that it does not need any particular color-coding to show added or removed lines/words: it does not use the ‘+’ or ‘-’ markers, after all.
This can be achieved by customizing the Ediff faces with color
combinations that do not carry the same connotations as those of diffs.
Consider this example, which leverages the modus-themes-with-colors
macro (Face specs at scale using the themes’ palette):
(defun my-modus-themes-custom-faces () (modus-themes-with-colors (custom-set-faces `(ediff-current-diff-A ((,class :inherit unspecified :background ,bg-special-faint-cold :foreground ,fg-special-cold))) `(ediff-current-diff-B ((,class :inherit unspecified :background ,bg-special-faint-warm :foreground ,fg-special-warm))) `(ediff-current-diff-C ((,class :inherit unspecified :background ,bg-special-faint-calm :foreground ,fg-special-calm))) `(ediff-fine-diff-A ((,class :inherit unspecified :background ,bg-special-cold :foreground ,fg-special-cold))) `(ediff-fine-diff-B ((,class :inherit unspecified :background ,bg-special-warm :foreground ,fg-special-warm))) `(ediff-fine-diff-C ((,class :inherit unspecified :background ,bg-special-calm :foreground ,fg-special-calm)))))) ;; This is so that the changes persist when switching between ;; `modus-operandi' and `modus-vivendi'. (add-hook 'modus-themes-after-load-theme-hook #'my-modus-themes-custom-faces)
Remove the ‘:foreground’ and its value to preserve the underlying coloration.