emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[nongnu] elpa/dracula-theme fcb9add 122/187: Merge branch 'ed-test-term-


From: ELPA Syncer
Subject: [nongnu] elpa/dracula-theme fcb9add 122/187: Merge branch 'ed-test-term-colors'
Date: Thu, 21 Oct 2021 18:05:07 -0400 (EDT)

branch: elpa/dracula-theme
commit fcb9adde6a7dc0588340e0009e4202e7e7776899
Merge: f7cf1b2 3a8a6f0
Author: Étienne Deparis <etienne@depar.is>
Commit: Étienne Deparis <etienne@depar.is>

    Merge branch 'ed-test-term-colors'
    
    Fix: https://github.com/dracula/emacs/issues/32
---
 README.md           | 23 ++++++++++++++++++--
 dracula-theme.el    | 62 +++++++++++++++++++++++++++--------------------------
 start_emacs_test.sh | 20 +++++++++++++++++
 test-profile.el     |  4 ++++
 4 files changed, 77 insertions(+), 32 deletions(-)

diff --git a/README.md b/README.md
index f7d4ef0..ca784bd 100644
--- a/README.md
+++ b/README.md
@@ -6,11 +6,30 @@
 
 ## Install
 
-All instructions can be found at 
[draculatheme.com/emacs](https://draculatheme.com/emacs).
+All instructions can be found at
+[draculatheme.com/emacs](https://draculatheme.com/emacs).
+
+## Test
+
+This repository contains a small script named `start_emacs_test.sh`,
+which helps you to test this color theme in various environment
+(graphical, 256+ colors terminals, 16 colors terminals).
+
+    # Graphical test
+    ./start_emacs_test.sh
+
+    # Full color terminal
+    ./start_emacs_test.sh -nw 256
+
+    # TTY like env
+    ./start_emacs_test.sh -nw 16
+
+This script requires the xterm terminfo files.
 
 ## Team
 
-This theme is maintained by the following person(s) and a bunch of [awesome 
contributors](https://github.com/dracula/emacs/graphs/contributors).
+This theme is maintained by the following person(s) and a bunch of
+[awesome contributors](https://github.com/dracula/emacs/graphs/contributors).
 
 [![Garrett 
T](https://avatars3.githubusercontent.com/u/1043908?v=3&s=70)](https://github.com/film42)
 | [![Étienne 
D](https://avatars3.githubusercontent.com/u/349239?v=3&s=70)](https://github.com/milouse)
 |
 --- | --- |
diff --git a/dracula-theme.el b/dracula-theme.el
index a5a71e9..9b39be1 100644
--- a/dracula-theme.el
+++ b/dracula-theme.el
@@ -19,25 +19,25 @@
 
 ;; Assigment form: VARIABLE COLOR [TTY-COLOR]
 (let ((colors '(;; Upstream theme color
-                (dracula-bg      "#282a36" nil) ; official background
-                (dracula-current "#44475a") ; official current-line/selection
-                (dracula-fg      "#f8f8f2") ; official foreground
-                (dracula-comment "#6272a4") ; official comment
-                (dracula-cyan    "#8be9fd") ; official cyan
-                (dracula-green   "#50fa7b") ; official green
-                (dracula-orange  "#ffb86c") ; official orange
-                (dracula-pink    "#ff79c6") ; official pink
-                (dracula-purple  "#bd93f9") ; official purple
-                (dracula-red     "#ff5555") ; official red
-                (dracula-yellow  "#f1fa8c") ; official yellow
+                (dracula-bg      "#282a36" "#262626" nil) ; official background
+                (dracula-fg      "#f8f8f2" "#ffffff" "brightwhite") ; official 
foreground
+                (dracula-current "#44475a" "#262626" "brightblack") ; official 
current-line/selection
+                (dracula-comment "#6272a4" "#7a7a7a" "blue")        ; official 
comment
+                (dracula-cyan    "#8be9fd" "#88eeff" "brightcyan")  ; official 
cyan
+                (dracula-green   "#50fa7b" "#55ff77" "green")       ; official 
green
+                (dracula-orange  "#ffb86c" "#ffbb66" "brightred")   ; official 
orange
+                (dracula-pink    "#ff79c6" "#ff77cc" "magenta")     ; official 
pink
+                (dracula-purple  "#bd93f9" "#bb99ff" "brightmagenta") ; 
official purple
+                (dracula-red     "#ff5555" "#ff6655" "red")         ; official 
red
+                (dracula-yellow  "#f1fa8c" "#ffff88" "yellow")      ; official 
yellow
                 ;; Other colors
-                (bg2             "#373844")
-                (bg3             "#464752")
-                (bg4             "#565761")
-                (fg2             "#e2e2dc")
-                (fg3             "#ccccc7")
-                (fg4             "#b6b6b2")
-                (other-blue      "#0189cc")))
+                (bg2             "#373844" "#2e2e2e" "brightblack")
+                (bg3             "#464752" "#262626" "brightblack")
+                (bg4             "#565761" "#3f3f3f" "brightblack")
+                (fg2             "#e2e2dc" "#bfbfbf" "brightwhite")
+                (fg3             "#ccccc7" "#cccccc" "white")
+                (fg4             "#b6b6b2" "#bbbbbb" "white")
+                (other-blue      "#0189cc" "#0088cc" "brightblue")))
       (faces '(;; default
                (cursor :background ,fg3)
                (default :background ,dracula-bg :foreground ,dracula-fg)
@@ -48,7 +48,7 @@
                (hl-line :background ,dracula-current :extend t)
                (info-quoted-name :foreground ,dracula-orange)
                (info-string :foreground ,dracula-yellow)
-               (lazy-highlight :foreground ,fg2 :background ,bg3)
+               (lazy-highlight :foreground ,fg2 :background ,bg2)
                (link :foreground ,dracula-cyan :underline t)
                (linum :slant italic :foreground ,bg4 :background ,dracula-bg)
                (line-number :slant italic :foreground ,bg4 :background 
,dracula-bg)
@@ -511,17 +511,19 @@
          'dracula
          (let ((color-names (mapcar #'car colors))
                (graphic-colors (mapcar #'cadr colors))
-               (tty-colors (mapcar #'car (mapcar #'last colors))))
-           (cl-flet* ((expand-for-tty (spec) (cl-progv color-names tty-colors
-                                               (eval `(backquote ,spec))))
-                      (expand-for-graphic (spec) (cl-progv color-names 
graphic-colors
-                                                   (eval `(backquote ,spec)))))
-             (cl-loop for (face . spec) in faces
-                      collect `(,face
-                                ((((min-colors 16777216))
-                                  ,(expand-for-graphic spec))
-                                 (t
-                                  ,(expand-for-tty spec)))))))))
+               (term-colors (mapcar #'car (mapcar #'cddr colors)))
+               (tty-colors (mapcar #'car (mapcar #'last colors)))
+               (expand-for-kind (lambda (kind spec)
+                                  (cl-progv color-names kind
+                                    (eval `(backquote ,spec))))))
+           (cl-loop for (face . spec) in faces
+                    collect `(,face
+                              ((((min-colors 16777216)) ; fully graphical envs
+                                ,(funcall expand-for-kind graphic-colors spec))
+                               (((min-colors 256))      ; terminal withs 256 
colors
+                                ,(funcall expand-for-kind term-colors spec))
+                               (t                       ; should be only 
tty-like envs
+                                ,(funcall expand-for-kind tty-colors 
spec))))))))
 
 ;;;###autoload
 (when load-file-name
diff --git a/start_emacs_test.sh b/start_emacs_test.sh
new file mode 100755
index 0000000..2e87fcd
--- /dev/null
+++ b/start_emacs_test.sh
@@ -0,0 +1,20 @@
+#!/usr/bin/env sh
+
+ARGS=
+TERM_TEST=no
+COLOR=256color
+
+for arg in $*; do
+    case $arg in
+       256) COLOR=256color ;;
+       88) COLOR=88color ;;
+       16) COLOR=16color ;;
+       *)
+        [ "$arg" = '-nw' ] && TERM_TEST=yes
+        ARGS="$ARGS $arg"
+        ;;
+    esac
+done
+
+[ "$TERM_TEST" = 'yes' ] && export TERM=xterm-$COLOR
+emacs -Q --debug-init -l test-profile.el $ARGS
diff --git a/test-profile.el b/test-profile.el
new file mode 100644
index 0000000..a5822f9
--- /dev/null
+++ b/test-profile.el
@@ -0,0 +1,4 @@
+(advice-add #'x-apply-session-resources :override #'ignore)
+
+(load-file "dracula-theme.el")
+(load-theme 'dracula t)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]