jasonm23 / autothemer Goto Github PK
View Code? Open in Web Editor NEWConveniently create Emacs themes - watch Autothemer used by System Crafters https://www.youtube.com/watch?v=kCCIudu53Zg
License: GNU General Public License v3.0
Conveniently create Emacs themes - watch Autothemer used by System Crafters https://www.youtube.com/watch?v=kCCIudu53Zg
License: GNU General Public License v3.0
autothemer currently uses RGB differences as a measure of color similarity, but there are probably perceptual color measures out there that yield better / more intuitive results
I recently took my config from emacs 26.3 to emacs 27. In the process I noticed that calling eval-defun
on the autothemer-deftheme
block no longer changes any of the faces. I am not sure what has changed or how to address it.
Hi @jasonm23, I'm tried your package but something goes wrong. Below, I provide a sample code to reproduce the error step by step. Can you help with this?
I write the sample code in the file minimal.el
. Then, I loaded the file in emacs using emacs -q -l ~/minimal.el
. I have changed the colors yellowish
and reddish
from the example code in your README.
;; minimal.el
;; run with `emacs -q -l /path/to/minimal.el'
(require 'package)
(setq package-archives '(("melpa" . "https://melpa.org/packages/")
("elpa" . "https://elpa.gnu.org/packages/")))
(package-initialize)
(unless package-archive-contents
(package-refresh-contents))
;; Initialize use-package on non-Linux platforms
(unless (package-installed-p 'use-package)
(package-install 'use-package))
;; activate use-package
(require 'use-package)
(use-package autothemer)
(autothemer-deftheme example-name "Autothemer example..."
;; Specify the color classes used by the theme
((((class color) (min-colors #xFFFFFF))
((class color) (min-colors #xFF)))
;; Specify the color palette for each of the classes above.
(example-red "#781210" "#FF0000")
(example-green "#22881F" "#00D700")
(example-blue "#212288" "#0000FF")
(example-purple "#812FFF" "#Af00FF")
(example-yellow "#EFFE00" "#FFFF00")
(example-orange "#E06500" "#FF6600")
(example-cyan "#22DDFF" "#00FFFF"))
;; specifications for Emacs faces.
((button (:underline t :weight 'bold :foreground example-yellow))
(error (:foreground example-red)))
;; Forms after the face specifications are evaluated.
;; (palette vars can be used, read below for details.)
(custom-theme-set-variables 'example-name
`(ansi-color-names-vector [,example-red
,example-green
,example-blue
,example-purple
,example-yellow
,example-orange
,example-cyan])))
I turned on toggle-debug-on-error
, evaluated the (autothemer-deftheme ...
, then I run M-x autothemer-generate-templates
, and I received the following message:
Debugger entered--Lisp error: (wrong-type-argument symbolp (1 . -1))
boundp((1 . -1))
#f(compiled-function (it) #<bytecode -0x443ba3bfbd9c438>)((1 . -1))
-tree-map(#f(compiled-function (it) #<bytecode -0x443ba3bfbd9c438>) (1 . -1))
#f(compiled-function (x) #<bytecode 0x84d6d9bc17bf44a>)((1 . -1))
mapcar(#f(compiled-function (x) #<bytecode 0x84d6d9bc17bf44a>) (:line-width (1 . -1) :color "grey35"))
-tree-map(#f(compiled-function (it) #<bytecode -0x443ba3bfbd9c438>) (:line-width (1 . -1) :color "grey35"))
#f(compiled-function (x) #<bytecode 0x84d6d9bc17bf44a>)((:line-width (1 . -1) :color "grey35"))
mapcar(#f(compiled-function (x) #<bytecode 0x84d6d9bc17bf44a>) (:box (:line-width (1 . -1) :color "grey35") :foreground "LightBlue" :background "grey19"))
-tree-map(#f(compiled-function (it) #<bytecode -0x443ba3bfbd9c438>) (:box (:line-width (1 . -1) :color "grey35") :foreground "LightBlue" :background "grey19"))
#f(compiled-function (x) #<bytecode 0x84d6d9bc17bf44a>)((:box (:line-width (1 . -1) :color "grey35") :foreground "LightBlue" :background "grey19"))
mapcar(#f(compiled-function (x) #<bytecode 0x84d6d9bc17bf44a>) ((:box (:line-width (1 . -1) :color "grey35") :foreground "LightBlue" :background "grey19")))
-tree-map(#f(compiled-function (it) #<bytecode -0x443ba3bfbd9c438>) ((:box (:line-width (1 . -1) :color "grey35") :foreground "LightBlue" :background "grey19")))
autothemer--approximate-spec((help-key-binding (:box (:line-width (1 . -1) :color "grey35") :foreground "LightBlue" :background "grey19")) #s(autothemer--theme :colors (#s(autothemer--color :name example-red :value "#781210") #s(autothemer--color :name example-green :value "#22881F") #s(autothemer--color :name example-blue :value "#212288") #s(autothemer--color :name example-purple :value "#812FFF") #s(autothemer--color :name example-yellow :value "#EFFE00") #s(autothemer--color :name example-orange :value "#E06500") #s(autothemer--color :name example-cyan :value "#22DDFF")) :defined-faces (button error)))
#f(compiled-function (it) #<bytecode 0xa45ecd4abb6b7>)(help-key-binding)
mapcar(#f(compiled-function (it) #<bytecode 0xa45ecd4abb6b7>) (diff-refine-added diff-refine-removed diff-refine-changed diff-error diff-nonexistent diff-context diff-function diff-indicator-changed diff-indicator-added diff-indicator-removed diff-changed diff-added diff-removed diff-hunk-header diff-index diff-file-header diff-header Info-quoted info-index-match info-header-node info-header-xref info-xref-visited info-xref info-menu-star info-menu-header info-title-4 info-title-3 info-title-2 info-title-1 info-node package-status-avail-obso package-status-incompat package-status-unsigned package-status-dependency package-status-installed package-status-disabled package-status-held package-status-new package-status-available package-status-external package-status-built-in package-description package-name package-help-section-name browse-url-button tooltip eldoc-highlight-function-argument vc-edited-state vc-missing-state vc-removed-state ...))
autothemer-generate-templates()
funcall-interactively(autothemer-generate-templates)
call-interactively(autothemer-generate-templates record nil)
command-execute(autothemer-generate-templates record)
execute-extended-command(nil "autothemer-generate-templates" nil)
funcall-interactively(execute-extended-command nil "autothemer-generate-templates" nil)
call-interactively(execute-extended-command nil nil)
command-execute(execute-extended-command)
I'm on Arch Linux using the Emacs 28.0.50 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.29, cairo version 1.17.4) of 2021-06-06.
Thanks in advance for any help.
Is there a way to do so? Suppose I have background color like #1e2528 in GUI or anything else, which 256 terminal doesn't support by default, so I want to use terminal background instead. Obviously I can achieve that through faces with condition, but it's a bit annoying in my opinion.
I was hoping to use a conditional in the theme but it doesn't seem to load properly. Is this expected? Here's an example of what I mean:
(when set-bespoke-header-line
(header-line (:foreground bespoke-light
:background bespoke-header
:box (:line-width 6 :color bespoke-header :height 150)
:overline nil
:underline nil
:height 150))
(mode-line (:height 10
:underline bespoke-subtle
:overline nil
:box nil)))
@sebastiansturm - I'm finally going to start experimenting with Autothemer and I've suggested it's use to @mekeor as the preferred route for developing Gruvbox.
If you haven't added anything to MELPA before let me know and I'll assist.
We've had a few updates but the version numbers have remained at 0.2.
When patches are made, the patch version should be bumped.
0.2.1
, 0.2.3
, 0.2.10
, 0.2.11
etc.
To push a release to MELPA stable, it's necessary to use tags. These should match the canonical package version number.
For more info on semantic versioning see http://semver.org/
I have autothemer.el
on my load-path, but when I run M-x autothemer-generate-templates
I get wrong type argument : arrayp, nil
. I'm new to emacs, so apologies if I'm confusing some concepts here.
See greduan/emacs-theme-gruvbox#133:
When an undefined face is passed as reduces-specs
argument into autothemer-deftheme
, the theme becomes unusable.
Edit: Deleted wrong suggestion
wrong type argument: stringp, :foreground
A few things that I think need including in the readme.
See greduan/emacs-theme-gruvbox#195
Emacs >= v29 warns that nil
is an invalid value for :background
Investigation pending, which Emacs commit(s) implement this, what is its scope?
Maybe this is out of scope for autothemer, but it'd be nice if the color palette faces were also accessible as variables so they could be used outside of the theme file. It'd be nice to be able to e.g. propertize text using my theme's color palette without having to copy paste the colors every time or define my own faces.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.