unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
blob b2fd12fda5118bc1c8a66c0ff428dd2d8a9e759b 3014 bytes (raw)
name: lisp/modus-themes/modus-themes-core.el 	 # note: path name is non-authoritative(*)

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
 
;;; modus-themes-core.el --- Highly accessible themes (WCAG AAA) -*- lexical-binding:t -*-

;; Copyright (C) 2019-2020 Free Software Foundation, Inc.

;; Author: Protesilaos Stavrou <info@protesilaos.com>
;; URL: https://gitlab.com/protesilaos/modus-themes
;; Version: 1.0.2
;; Package-Requires: ((emacs "26.1"))
;; Keywords: faces, theme, accessibility

;; This file is part of GNU Emacs.

;; This program is free software; you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
;; the Free Software Foundation, either version 3 of the License, or (at
;; your option) any later version.
;;
;; This program is distributed in the hope that it will be useful, but
;; WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
;; General Public License for more details.
;;
;; You should have received a copy of the GNU General Public License
;; along with this program.  If not, see <https://www.gnu.org/licenses/>.

;;; Commentary:
;;
;; The Modus themes conform with the highest standard for color-contrast
;; accessibility between background and foreground values (WCAG AAA).
;; This file contains all customisation options, helper functions,
;; interactive commands, and face specifications.
;;
;; For a complete view of the project, also refer to the following files
;; (should be distributed in the same repository/directory as the
;; current item):
;;
;; - modus-themes.el            (Main code shared between the themes)
;; - modus-operandi-theme.el    (Light theme)
;; - modus-vivendi-theme.el     (Dark theme)

;;; Code:

\f

(defvar modus-themes-colors-operandi)
(defvar modus-themes-colors-vivendi)
(defvar modus-themes-faces)
(defvar modus-themes-custom-variables)

(defun modus-themes-core-theme-variables (name)
  "Return correct variable for Modus theme NAME."
  (pcase name
    (''modus-operandi modus-themes-colors-operandi)
    (''modus-vivendi modus-themes-colors-vivendi)
    (_ (user-error "<< %s >> is not a valid Modus theme" name))))

(defmacro modus-themes-core-theme (name)
  "Bind NAME's color palette around face specifications.

NAME should be the proper name of a Modus theme, either
'modus-operandi or 'modus-vivendi.

Face specifications are those passed to `custom-theme-set-faces'.
They are extracted directly from variables defined in the
`modus-themes' library.  For example, `modus-themes-faces'."
  (let ((faces modus-themes-faces)
        (cus modus-themes-custom-variables))
    `(let ((class '((class color) (min-colors 89)))
           ,@(mapcar (lambda (cons)
                       `(,(car cons) ,(cdr cons)))
                     (modus-themes-core-theme-variables name)))
       (custom-theme-set-faces
        ,name
        ,@faces)
       (custom-theme-set-variables
        ,name
        ,@cus))))

(provide 'modus-themes-core)
;;; modus-themes-core.el ends here

debug log:

solving 88279cf75a ...
found 88279cf75a in https://yhetil.org/emacs-bugs/87im9fgm27.fsf@protesilaos.com/

applying [1/1] https://yhetil.org/emacs-bugs/87im9fgm27.fsf@protesilaos.com/
diff --git a/lisp/modus-themes/modus-themes-core.el b/lisp/modus-themes/modus-themes-core.el\r
new file mode 100644\r
index 0000000000..88279cf75a\r

1:7: trailing whitespace.
;;; modus-themes-core.el --- Highly accessible themes (WCAG AAA) -*- lexical-binding:t -*-\r
1:8: trailing whitespace.
\r
1:9: trailing whitespace.
;; Copyright (C) 2019-2020 Free Software Foundation, Inc.\r
1:10: trailing whitespace.
\r
1:11: trailing whitespace.
;; Author: Protesilaos Stavrou <info@protesilaos.com>\r
Checking patch lisp/modus-themes/modus-themes-core.el...
Applied patch lisp/modus-themes/modus-themes-core.el cleanly.
warning: squelched 75 whitespace errors
warning: 80 lines add whitespace errors.

index at:
100644 b2fd12fda5118bc1c8a66c0ff428dd2d8a9e759b	lisp/modus-themes/modus-themes-core.el

(*) Git path names are given by the tree(s) the blob belongs to.
    Blobs themselves have no identifier aside from the hash of its contents.^

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).