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
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
|
;;; soria-theme.el --- A xoria256 theme with some colors from openSUSE.
;; Copyright (C) 2016 Miquel Sabaté Solà <mikisabate@gmail.com>
;;
;; 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 <http://www.gnu.org/licenses/>.
;; Author: Miquel Sabaté Solà <mikisabate@gmail.com>
;; Version: 0.1
;; Keywords: color theme
;; URL: https://github.com/mssola/soria
;;; Commentary:
;;
;; This is a color theme based on xoria256 (vim.org #2140) but with some
;; modifications here and there with colors from openSUSE's guidelines
;; (http://opensuse.github.io/branding-guidelines/).
;;; Credits:
;;
;; FEI Hao for the xoria256 port (https://github.com/suxue/xoria256-emacs).
;; This theme is *largely* based on this port.
;;
;; Kelvin Smith for the port of the Monokai theme to Emacs
;; (https://github.com/oneKelvinSmith/monokai-emacs). I've taken a *lot* of
;; inspiration from its source code.
;;
;; I've adapted some of the color IDs with this gist:
;; https://gist.github.com/MicahElliott/719710
;;; Code:
;; Defining the theme and its configuration group.
(unless (>= emacs-major-version 24)
(error "The soria theme requires Emacs 24 or later!"))
(deftheme soria "A xoria256 theme with some colors from openSUSE")
(defgroup soria nil
"Soria theme options.
The theme has to be reloaded after changing anything in this group."
:group 'faces)
(defcustom soria-hide-helm-header t
"Hide the Helm header."
:type 'boolean
:group 'soria)
;; First of all, let's create our own font-lock for numbers.
(make-face 'font-lock-number-face)
(set-face-attribute 'font-lock-number-face nil :inherit font-lock-constant-face)
(setq font-lock-number-face 'font-lock-number-face)
(defun add-font-lock-numbers ()
"Add to the list of keywords numeric formats.
It adds to font-lock-number-face decimal, octal, hex and bin formats."
(defvar font-lock-number "[0-9]+\\([eE][+-]?[0-9]*\\)?")
(defvar font-lock-hexnumber "0[xX][0-9a-fA-F]+")
(defvar font-lock-binnumber "0[bB][01]+")
(font-lock-add-keywords nil (list
(list (concat "\\<\\(" font-lock-number "\\)\\>" )
0 font-lock-number-face)
(list (concat "\\<\\(" font-lock-hexnumber "\\)\\>" )
0 font-lock-number-face)
(list (concat "\\<\\(" font-lock-binnumber "\\)\\>" )
0 font-lock-number-face)))
)
;; The color theme itself.
(let*
((class '((class color) (min-colors 89)))
(soria-purple "#dfafdf")
(soria-darkpurple "#875f87")
(soria-white "#d0d0d0")
(soria-darkgray "#1c1c1c")
(soria-brightgreen "#81c13b")
(soria-green "#b9dc92")
(soria-darkgreen "#2f5361")
(soria-gray "#808080")
(soria-linegray "#3a3a3a")
(soria-statusgray "#4e4e4e")
(soria-statusncgray "#b2b2b2")
(soria-black "#000000")
(soria-whitest "#eeeeee")
(soria-yellow "#ffffaf")
(soria-orange "#d7af87")
(soria-redpastel "#d78787")
(soria-blue "#87afd7"))
(custom-theme-set-faces
'soria
;; General coloring.
`(default (
(((class color) (min-colors 256))
(:foreground ,soria-white
:background ,soria-darkgray))))
`(mouse
((,class (:foreground ,soria-darkgray
:background ,soria-white
:inverse-video t))))
`(cursor
((,class (:foreground ,soria-darkgray
:background ,soria-white
:inverse-video t))))
`(shadow
((,class (:foreground ,soria-gray))))
`(link
((,class (:foreground ,soria-blue
:underline t
:weight normal))))
`(match
((,class (:background ,soria-orange
:foreground ,soria-darkgray
:weight bold))))
`(link-visited
((,class (:inherit link))))
`(minibuffer-prompt
((,class (:foreground ,soria-white))))
`(escape-glyph
((,class (:foreground ,soria-redpastel))))
`(escape-glyph-face
((,class (:foreground ,soria-redpastel))))
`(error
((,class (:foreground ,soria-white))))
`(warning
((,class (:foreground ,soria-orange))))
`(success
((,class (:foreground ,soria-blue))))
`(highlight
((,class (:background ,soria-darkpurple
:foreground ,soria-white))))
`(region
((,class (:inherit highlight))))
`(lazy-highlight
((,class (:inherit highlight))))
`(isearch
((,class (:background ,soria-green
:foreground ,soria-black))))
`(trailing-whitespace
((,class (:background ,soria-brightgreen))))
`(hl-line
((,class (:background ,soria-linegray))))
`(linum-highlight-face
((,class (:background ,soria-darkgray
:foreground ,soria-yellow))))
`(show-paren-match
((,class (:background ,soria-brightgreen
:foreground ,soria-darkgreen))))
`(vertical-border
((,class (:foreground ,soria-statusgray))))
;; Font lock faces
`(font-lock-builtin-face
((,class (:foreground ,soria-blue))))
`(font-lock-comment-face
((,class (:foreground ,soria-gray))))
`(font-lock-comment-delimiter-face
((,class (:inherit font-lock-comment-face))))
`(font-lock-doc-face
((,class (:inherit font-lock-comment-face))))
`(font-lock-function-name-face
((,class (:foreground ,soria-white))))
`(font-lock-variable-name-face
((,class (:foreground ,soria-white))))
`(font-lock-preprocessor-face
((,class (:foreground ,soria-green))))
`(font-lock-constant-face
((,class (:foreground ,soria-yellow))))
`(font-lock-keyword-face
((,class (:foreground ,soria-blue))))
`(font-lock-string-face
((,class (:foreground ,soria-yellow))))
`(font-lock-type-face
((,class (:foreground ,soria-blue))))
`(font-lock-number-face
((,class (:foreground ,soria-orange))))
`(font-lock-negation-char-face
((,class (:inherit default))))
`(font-lock-warning-face
((,class (:foreground ,soria-green))))
;; Search
`(isearch
((,class (:inherit default))))
`(isearch-fail
((,class (:foreground ,soria-redpastel
:background ,soria-darkgray))))
;; Mode line faces
`(mode-line
((,class
(:box (:line-width -1 :style released-button)
:background ,soria-statusgray
:foreground ,soria-white))))
`(mode-line-inactive
((,class
(:box (:line-width -1 :style released-button)
:background ,soria-linegray
:foreground ,soria-statusncgray))))
`(compilation-mode-line-fail
((,class (:foreground ,soria-redpastel))))
`(compilation-mode-line-run
((,class (:foreground ,soria-yellow))))
`(compilation-mode-line-exit
((,class (:foreground ,soria-brightgreen))))
;; Custom
`(custom-face-tag
((,class (:foreground ,soria-purple))))
`(custom-variable-tag
((,class (:inherit custom-face-tag))))
`(custom-comment-tag
((,class (:foreground ,soria-yellow))))
`(custom-group-tag
((,class (:foreground ,soria-blue))))
`(custom-group-tag-1
((,class (:foreground ,soria-purple))))
`(custom-state
((,class (:foreground ,soria-yellow))))
;; Helm
`(helm-buffer-file
((,class (:foreground ,soria-white))))
`(helm-buffer-file
((,class (:foreground ,soria-blue))))
`(helm-buffer-process
((,class (:foreground ,soria-statusgray))))
`(helm-buffer-saved-out
((,class (:foreground ,soria-white
:background ,soria-darkgray))))
`(helm-buffer-size
((,class (:background ,soria-statusgray))))
`(helm-candidate-number
((,class (:background ,soria-statusgray
:foreground ,soria-white))))
`(helm-ff-directory
((,class (:foreground ,soria-blue))))
`(helm-ff-dotted-directory
((,class (:inherit helm-ff-directory))))
`(helm-ff-symlink
((,class (:foreground ,soria-brightgreen))))
`(helm-ff-dotted-symlink-directory
((,class (:inherit helm-ff-symlink))))
`(helm-ff-executable
((,class (:foreground ,soria-white))))
`(helm-ff-file
((,class (:foreground ,soria-white))))
`(helm-ff-invalid-symlink
((,class (:foreground ,soria-white))))
`(helm-ff-prefix
((,class (:foreground ,soria-white))))
`(helm-grep-finish
((,class (:foreground ,soria-green))))
`(helm-grep-lineno
((,class (:foreground ,soria-orange))))
`(helm-grep-match
((,class (:foreground ,soria-white :inherit bold))))
`(helm-grep-running
((,class (:foreground ,soria-redpastel))))
`(helm-match
((,class (:foreground ,soria-white :inherit bold))))
`(helm-match-item
((,class (:inherit helm-match))))
`(helm-moccur-buffer
((,class (:foreground ,soria-blue :underline nil))))
`(helm-selection
((,class (:background ,soria-linegray,
:underline nil))))
`(helm-selection-line
((,class (:background ,soria-linegray
:foreground ,soria-white
:underline nil))))
`(helm-separator
((,class (:foreground ,soria-gray))))
; The Helm header might be hidden if the user decides so (true by default).
(if soria-hide-helm-header
`(helm-source-header
((,class (:background ,soria-darkgray
:foreground ,soria-darkgray
:underline nil))))
`(helm-source-header
((,class (:background ,soria-linegray
:foreground ,soria-white
:underline nil)))))
; ansi color names
(custom-theme-set-variables
'soria
`(ansi-color-names-vector [,soria-darkgray ,soria-redpastel ,soria-green
,soria-yellow ,soria-blue ,soria-darkpurple
,soria-purple ,soria-white]))
;; Flycheck
`(flycheck-error
((,(append '((supports :underline (:style wave))) class)
(:underline (:style wave :color ,soria-redpastel) :inherit unspecified))))
`(flycheck-warning
((,(append '((supports :underline (:style wave))) class)
(:underline (:style wave :color ,soria-orange) :inherit unspecified))))
`(flycheck-info
((,(append '((supports :underline (:style wave))) class)
(:underline (:style wave :color ,soria-blue) :inherit unspecified))))
`(flycheck-fringe-error
((,(append '((supports :underline (:style wave))) class)
(:underline (:style wave :color ,soria-redpastel) :inherit unspecified))))
`(flycheck-fringe-warning
((,(append '((supports :underline (:style wave))) class)
(:underline (:style wave :color ,soria-orange) :inherit unspecified))))
`(flycheck-fringe-info
((,(append '((supports :underline (:style wave))) class)
(:underline (:style wave :color ,soria-blue) :inherit unspecified))))
;; Flyspell
`(flyspell-duplicate
((,(append '((supports :underline (:style wave))) class)
(:underline (:style wave :color ,soria-orange) :inherit unspecified))))
`(flyspell-incorrect
((,(append '((supports :underline (:style wave))) class)
(:underline (:style wave :color ,soria-redpastel) :inherit unspecified))))
;; eldoc
`(eldoc-highlight-function-argument
((,class (:foreground ,soria-green
:underline nil))))
;; eshell
`(eshell-prompt
((,class (:inherit default))))
`(eshell-ls-archive
((,class (:inherit default))))
`(eshell-ls-backup
((,class (:inherit default))))
`(eshell-ls-clutter
((,class (:inherit default))))
`(eshell-ls-unreadable
((,class (:inherit default))))
`(eshell-ls-product
((,class (:inherit default))))
`(eshell-ls-special
((,class (:inherit default))))
`(eshell-ls-directory
((,class (:foreground ,soria-blue))))
`(eshell-ls-executable
((,class (:foreground ,soria-yellow))))
`(eshell-ls-missing
((,class (:foreground ,soria-redpastel))))
`(eshell-ls-symlink
((,class (:foreground ,soria-darkpurple))))
;; rainbow-delimiters
`(rainbow-delimiters-depth-1-face
((,class (:foreground ,soria-brightgreen))))
`(rainbow-delimiters-depth-2-face
((,class (:foreground ,soria-redpastel))))
`(rainbow-delimiters-depth-3-face
((,class (:foreground ,soria-orange))))
`(rainbow-delimiters-depth-4-face
((,class (:foreground ,soria-blue))))
`(rainbow-delimiters-depth-5-face
((,class (:foreground ,soria-white))))
`(rainbow-delimiters-depth-6-face
((,class (:foreground ,soria-white))))
`(rainbow-delimiters-depth-7-face
((,class (:foreground ,soria-white))))
`(rainbow-delimiters-depth-8-face
((,class (:foreground ,soria-white))))
`(rainbow-delimiters-depth-9-face
((,class (:foreground ,soria-white))))
`(rainbow-delimiters-unmatched-face
((,class (:foreground ,soria-purple :bold t))))
`(rainbow-delimiters-missmatched-face
((,class (:foreground ,soria-purple :bold t))))
;; diff
`(diff-added
((,class (:background ,soria-darkgreen :foreground ,soria-whitest))))
`(diff-changed
((,class (:background ,soria-darkpurple :foreground ,soria-whitest))))
`(diff-removed
((,class (:background ,soria-redpastel :foreground ,soria-whitest))))
`(diff-header
((,class (:background ,soria-darkgray :foreground ,soria-white))))
`(diff-file-header
((,class (:background ,soria-darkgray :foreground ,soria-white))))
`(diff-refine-added
((,class (:background ,soria-darkgreen :foreground ,soria-darkgray))))
`(diff-refine-change
((,class (:background ,soria-darkpurple :foreground ,soria-darkgray))))
`(diff-refine-removed
((,class (:background ,soria-redpastel :foreground ,soria-darkgray))))
;; diff-hl
`(diff-hl-change
((,class (:background ,soria-darkpurple :foreground ,soria-whitest))))
`(diff-hl-delete
((,class (:background ,soria-redpastel :foreground ,soria-whitest))))
`(diff-hl-insert
((,class (:background ,soria-darkgreen :foreground ,soria-whitest))))
`(diff-hl-unknown
((,class (:background ,soria-darkpurple :foreground ,soria-whitest))))
;; sh-mode
`(sh-heredoc
((,class (:foreground ,soria-yellow :weight normal))))
`(sh-quoted-exec
((,class (:foreground ,soria-redpastel :weight normal))))
`(sh-escaped-newline
((,class (:foreground ,soria-redpastel :weight normal))))
;; message-mode
`(message-cited-text
((,class (:foreground ,soria-gray :weight normal))))
`(message-header-name
((,class (:foreground ,soria-gray :weight normal))))
`(message-header-other
((,class (:foreground ,soria-white :weight normal))))
`(message-header-to
((,class (:foreground ,soria-white :weight normal))))
`(message-header-cc
((,class (:foreground ,soria-white :weight normal))))
`(message-header-newsgroups
((,class (:foreground ,soria-yellow :weight normal))))
`(message-header-subject
((,class (:foreground ,soria-blue :weight normal))))
`(message-header-xheader
((,class (:foreground ,soria-blue :weight normal))))
`(message-mml
((,class (:foreground ,soria-yellow :weight normal))))
`(message-separator
((,class (:foreground ,soria-gray :slant italic))))
;; Evil mode
`(evil-ex-info
((,class (:foreground ,soria-redpastel :inherit normal))))
`(evil-ex-substitute-matches
((,class (:foreground ,soria-redpastel :inherit normal))))
`(evil-ex-substitute-replacement
((,class (:foreground ,soria-brightgreen :inherit normal))))
`(evil-search-highlight-persist-highlight-face
((,class (:inherit region))))
;; mu4e
;; TODO
;; - Color of headers' headers list
;; - Polish main and headers
;; - Go for view mode
;;
`(mu4e-cited-1-face
((,class (:foreground ,soria-gray :slant italic :weight normal))))
`(mu4e-cited-2-face
((,class (:foreground ,soria-gray :slant italic :weight normal))))
`(mu4e-cited-3-face
((,class (:foreground ,soria-gray :slant italic :weight normal))))
`(mu4e-cited-4-face
((,class (:foreground ,soria-gray :slant italic :weight normal))))
`(mu4e-cited-5-face
((,class (:foreground ,soria-gray :slant italic :weight normal))))
`(mu4e-cited-6-face
((,class (:foreground ,soria-gray :slant italic :weight normal))))
`(mu4e-cited-7-face
((,class (:foreground ,soria-gray :slant italic :weight normal))))
`(mu4e-flagged-face
((,class (:foreground ,soria-darkpurple :weight normal))))
`(mu4e-view-url-number-face
((,class (:foreground ,soria-yellow :weight normal))))
`(mu4e-warning-face
((,class (:foreground ,soria-redpastel :slant normal :weight normal))))
`(mu4e-highlight-face
((,class (:inherit unspecified
:foreground ,soria-blue
:weight normal))))
`(mu4e-header-highlight-face
((,class (:inherit unspecified
:foreground ,soria-white
:background ,soria-statusgray
:weight normal))))
`(mu4e-draft-face
((,class (:inherit font-lock-string-face))))
`(mu4e-footer-face
((,class (:inherit font-lock-comment-face))))
`(mu4e-forwarded-face
((,class (:inherit font-lock-builtin-face :weight normal))))
`(mu4e-header-face
((,class (:inherit font-lock-comment-face))))
`(mu4e-header-marks-face
((,class (:inherit font-lock-preprocessor-face))))
`(mu4e-header-title-face
((,class (:inherit font-lock-type-face))))
`(mu4e-highlight-face
((,class (:inherit font-lock-pseudo-keyword-face :weight normal))))
`(mu4e-moved-face
((,class (:inherit font-lock-comment-face :slant italic))))
`(mu4e-ok-face
((,class (:inherit font-lock-comment-face :slant normal :weight normal))))
`(mu4e-replied-face
((,class (:inherit font-lock-builtin-face :weight normal))))
`(mu4e-system-face
((,class (:inherit font-lock-comment-face :slant italic))))
`(mu4e-title-face
((,class (:inherit custom-face-tag :weight normal))))
`(mu4e-trashed-face
((,class (:inherit font-lock-comment-face :strike-through t))))
`(mu4e-unread-face
((,class (:foreground ,soria-white :weight normal))))
`(mu4e-header-key-face
((,class (:foreground ,soria-yellow :weight normal))))
`(mu4e-view-attach-number-face
((,class (:inherit font-lock-variable-name-face :weight normal))))
`(mu4e-view-contact-face
((,class (:foreground ,soria-white :weight normal))))
`(mu4e-view-header-key-face
((,class (:inherit message-header-name :weight normal))))
`(mu4e-view-header-value-face
((,class (:foreground ,soria-blue :weight normal :slant normal))))
`(mu4e-view-link-face
((,class (:inherit link))))
`(mu4e-view-special-header-value-face
((,class (:foreground ,soria-blue :weight normal :underline nil))))))
;; And finally hook the defined font locks and call provide-theme.
(add-hook 'prog-mode-hook 'add-font-lock-numbers)
(defun soria-purple-identifiers ()
"Make function identifiers purple.
This function might be used as a hook for modes that prefer having purple
function identifiers instead of the default white. This might seem hackish,
but it tries to workaround discrepencies between Vim and Emacs in terms of
identifiers"
(let ((soria-purple "#dfafdf"))
(set (make-local-variable 'face-remapping-alist)
`((font-lock-function-name-face :foreground ,soria-purple)))))
(provide-theme 'soria)
;; Local Variables:
;; no-byte-compile: t
;; End:
;;; soria-theme.el ends here
|