2021-12-11 14:56:57 +00:00
|
|
|
;;; FG42 --- The mighty editor for the emacsians -*- lexical-binding: t; -*-
|
|
|
|
;;
|
|
|
|
;; Copyright (c) 2010-2022 Sameer Rahmani <lxsameer@gnu.org>
|
|
|
|
;;
|
|
|
|
;; Author: Sameer Rahmani <lxsameer@gnu.org>
|
|
|
|
;; URL: https://gitlab.com/FG42/FG42
|
|
|
|
;; Version: 3.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:
|
|
|
|
;;; Code:
|
|
|
|
|
|
|
|
(defvar fg42/modeline-setter #'fg42/default-mode-line-setter)
|
2021-12-11 18:35:15 +00:00
|
|
|
|
2021-12-11 14:56:57 +00:00
|
|
|
|
2021-12-12 19:51:09 +00:00
|
|
|
(defmacro defmode-line (name &rest body)
|
|
|
|
`(defun ,name () ,@body))
|
2021-12-11 14:56:57 +00:00
|
|
|
|
2021-12-12 19:51:09 +00:00
|
|
|
|
|
|
|
;; The default modeline has to be nil to let the
|
|
|
|
;; modeline setters know that they can use their
|
|
|
|
;; default modeline
|
|
|
|
(defmode-line fg42/default-modeline)
|
|
|
|
|
|
|
|
|
|
|
|
(defun fg42/default-mode-line-setter (def)
|
2021-12-11 14:56:57 +00:00
|
|
|
"Set the modeline definition in X to the `fg42-modeline'."
|
2021-12-12 19:51:09 +00:00
|
|
|
(unless (null def)
|
|
|
|
(setq mode-line-format (plist-get def :brief))
|
|
|
|
(setq mode-line-format (plist-get (fg42/default-modeline) :brief))))
|
2021-12-11 14:56:57 +00:00
|
|
|
|
|
|
|
|
|
|
|
(defun fg42/setup-modeline-format (definition)
|
|
|
|
"Setup the modeline by calling the setter function and passing the DEFINITION."
|
|
|
|
(funcall fg42/modeline-setter definition))
|
|
|
|
|
|
|
|
|
|
|
|
(provide 'fg42/modeline)
|
|
|
|
;;; modeline.el ends here
|