70 lines
2.3 KiB
EmacsLisp
70 lines
2.3 KiB
EmacsLisp
;;; Themes --- Theme library of FG42 -*- lexical-binding: t; -*-
|
|
;;
|
|
;; Copyright (c) 2010-2024 Sameer Rahmani & Contributors
|
|
;;
|
|
;; Author: Sameer Rahmani <lxsameer@gnu.org>
|
|
;; URL: https://devheroes.codes/FG42/FG42
|
|
;; Version: 4.0.0
|
|
;;
|
|
;; 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/>.
|
|
;;
|
|
;;; Commentary:
|
|
;; Cubes are the building blocks of any `FG42' editor. Each `cube' is a
|
|
;; unit which defines different abilities in a deterministic and idempotent
|
|
;; way. Cubes are composable and a composition of cubes creates an editor.
|
|
;;
|
|
;;; Code:
|
|
(eval-when-compile
|
|
(require 'fpkg)
|
|
(require 'fg42/build-config))
|
|
|
|
(require 'fg42/utils)
|
|
|
|
(defvar fg42/ui-hook ()
|
|
"A hook that cubes can use via :ui-hook property.
|
|
It executes way before the rest of the cubes.")
|
|
|
|
(defvar fg42/before-initializing-theme-hook ()
|
|
"The hook to plug any configuration to before initialize event of themes.")
|
|
|
|
(defvar fg42/after-initializing-theme-hook ()
|
|
"The hook to plug any configuration to after initialize event of themes.")
|
|
|
|
|
|
(defmacro fg42/setup-theme! (&rest body)
|
|
"Grab the them provided by `fg42/theme' and load it.
|
|
|
|
Load the theme via `use!' and pass the BODY to the `use!' macroro.
|
|
If the theme name and the theme package name are different the package
|
|
name can be set via `fg42/theme-package'".
|
|
|
|
(declare (indent defun))
|
|
(let ((pkg (if (not (null fg42/theme-package))
|
|
fg42/theme-package
|
|
fg42/theme)))
|
|
`(use! ,pkg
|
|
"Setting up the ,pkg package."
|
|
:config
|
|
(load-theme fg42/theme t)
|
|
,@body)))
|
|
|
|
;; (use! base16-theme
|
|
;; "Load base16 based themes in FG42."
|
|
;; :config
|
|
;; (load-theme 'base16-eighties t))
|
|
|
|
|
|
(provide 'fg42/themes)
|
|
;;; themes.el ends here
|