dracula / emacs

🧛🏻‍♂️ Dark theme for Emacs
https://draculatheme.com/emacs
MIT License
330 stars 87 forks source link

Support diff mode #71

Closed andreineculau closed 1 year ago

andreineculau commented 4 years ago

I don't know if it's only me, but this is how opening a .patch file (a diff) shows up with the dracula-theme in Emacs 26.3 (in iTerm2 with dracula-theme as well but that doesn't matter).

Screenshot 2020-09-08 at 15 00 02

Is it only me? For the time being, I resorted to overloading some settings but I'm sure there's a better way.

      (set-face-background 'diff-added "green" (selected-frame))
      (set-face-background 'diff-changed "yellow" (selected-frame))
      (set-face-background 'diff-removed "red" (selected-frame))

      (set-face-foreground 'diff-added "black" (selected-frame))
      (set-face-foreground 'diff-changed "black" (selected-frame))
      (set-face-foreground 'diff-file-header "black" (selected-frame))
      (set-face-foreground 'diff-header "black" (selected-frame))
      (set-face-foreground 'diff-removed "black" (selected-frame))

Example file:

--- Formula/patch-src/awscli.original.rb
+++ Formula/patch-src/awscli.rb
@@ -44,7 +44,9 @@
       }
     EOS

-    system libexec/"bin/python3", "scripts/gen-ac-index", "--include-builtin-index"
+    unless ENV.CI?
+      system libexec/"bin/python3", "scripts/gen-ac-index", "--include-builtin-index"
+    end
   end

   def caveats
milouse commented 4 years ago

Hi, sorry for the delay, I was in holiday.

I don’t have the same display (I use simpleterm on linux, with dracula color in term too).

Capture du 2020-09-14 16-39-59

As you can see, the used colors are not very good too, but at least they are readable.

Any way, I know the diff part has not been heavily tested/integrated. For the most part of it, as it’s not integrated, it use the default emacs color (you can see it by yourself in your test file, by entering M-x describe-face on any colored line).

In your case, the color in your screenshot seem really really bright. I wonder if there isn’t another clash with another mode, custom color parameter or terminal colors?

andreineculau commented 4 years ago

Hi, sorry for the delay, I was in holiday.

Don't be sorry. Hope you enjoyed it 🏖️

For starters, I actually checked the st colors, which are a bit different in simpleterm, but not enough to make a change. I actually tried other colors in iTerm, and the only thing that can change in the emacs-diff view is the foreground and background color. The rest are fixed.

FWIW, this is how my emacs faces look like for "removed" content. Basically vanilla colors. Are yours the same?

Face: diff-indicator-removed (sample) (customize this face)

Documentation:
‘diff-mode’ face used to highlight indicator of removed lines (-, <).

Defined in ‘diff-mode.el’.

           Family: unspecified
          Foundry: unspecified
            Width: unspecified
           Height: unspecified
           Weight: unspecified
            Slant: unspecified
       Foreground: #aa2222
DistantForeground: unspecified
       Background: unspecified
        Underline: unspecified
         Overline: unspecified
   Strike-through: unspecified
              Box: unspecified
          Inverse: unspecified
          Stipple: unspecified
             Font: unspecified
          Fontset: unspecified
           Extend: unspecified
          Inherit: diff-removed

This face was introduced, or its default value was changed, in
version 22.1 of Emacs.
Face: diff-removed (sample) (customize this face)

Documentation:
‘diff-mode’ face used to highlight removed lines.

Defined in ‘diff-mode.el’.

           Family: unspecified
          Foundry: unspecified
            Width: unspecified
           Height: unspecified
           Weight: unspecified
            Slant: unspecified
       Foreground: unspecified
DistantForeground: unspecified
       Background: #ffdddd
        Underline: unspecified
         Overline: unspecified
   Strike-through: unspecified
              Box: unspecified
          Inverse: unspecified
          Stipple: unspecified
             Font: unspecified
          Fontset: unspecified
           Extend: t
          Inherit: diff-changed

[back]
Face: diff-changed (sample) (customize this face)

Documentation:
‘diff-mode’ face used to highlight changed lines.

Defined in ‘diff-mode.el’.

           Family: unspecified
          Foundry: unspecified
            Width: unspecified
           Height: unspecified
           Weight: unspecified
            Slant: unspecified
       Foreground: unspecified
DistantForeground: unspecified
       Background: unspecified
        Underline: unspecified
         Overline: unspecified
   Strike-through: unspecified
              Box: unspecified
          Inverse: unspecified
          Stipple: unspecified
             Font: unspecified
          Fontset: unspecified
           Extend: unspecified
          Inherit: unspecified

This face was introduced, or its default value was changed, in
version 25.1 of Emacs.

[back]
abouvier commented 3 years ago

You can use 24-bit direct color mode with TERM=iterm2-direct. Here is Konsole with TERM=konsole-direct and emacs version 27.2:

Screenshot_20210905_054149

milouse commented 1 year ago

Should have been fixed with 54c26402555ab5b8b7cfd8ee2488c57b2fa5d32a