30d7beb277
Create new layers: - spacemacs-navigation: contains packages whose principal goal is navigation - spacemacs-modeline: contains packages about mode line Merge spacemacs-ui and spacemacs-ui-visual into layer spacemacs-visual.
53 lines
1.9 KiB
EmacsLisp
53 lines
1.9 KiB
EmacsLisp
;;; funcs.el --- Spacemacs Mode-line Layer functions File
|
||
;;
|
||
;; Copyright (c) 2012-2017 Sylvain Benner & Contributors
|
||
;;
|
||
;; Author: Sylvain Benner <sylvain.benner@gmail.com>
|
||
;; URL: https://github.com/syl20bnr/spacemacs
|
||
;;
|
||
;; This file is not part of GNU Emacs.
|
||
;;
|
||
;;; License: GPLv3
|
||
|
||
|
||
;; spaceline
|
||
|
||
(defun spacemacs/customize-powerline-faces ()
|
||
"Alter powerline face to make them work with more themes."
|
||
(when (boundp 'powerline-inactive2)
|
||
(set-face-attribute 'powerline-inactive2 nil
|
||
:inherit 'font-lock-comment-face)))
|
||
|
||
(defun spacemacs//evil-state-face ()
|
||
(let ((state (if (eq 'operator evil-state) evil-previous-state evil-state)))
|
||
(intern (format "spacemacs-%S-face" state))))
|
||
|
||
(defun spacemacs//restore-powerline (buffer)
|
||
"Restore the powerline in buffer"
|
||
(with-current-buffer buffer
|
||
(setq-local mode-line-format (default-value 'mode-line-format))
|
||
(powerline-set-selected-window)
|
||
(powerline-reset)))
|
||
|
||
(defun spacemacs//set-powerline-for-startup-buffers ()
|
||
"Set the powerline for buffers created when Emacs starts."
|
||
(dolist (buffer '("*Messages*" "*spacemacs*" "*Compile-Log*"))
|
||
(when (and (get-buffer buffer)
|
||
(configuration-layer/package-usedp 'spaceline))
|
||
(spacemacs//restore-powerline buffer))))
|
||
|
||
(defun spacemacs//prepare-diminish ()
|
||
(when spaceline-minor-modes-p
|
||
(let ((unicodep (dotspacemacs|symbol-value
|
||
dotspacemacs-mode-line-unicode-symbols)))
|
||
(setq spaceline-minor-modes-separator
|
||
(if unicodep (if (display-graphic-p) "" " ") "|"))
|
||
(dolist (mm spacemacs--diminished-minor-modes)
|
||
(let ((mode (car mm)))
|
||
(when (and (boundp mode) (symbol-value mode))
|
||
(let* ((unicode (cadr mm))
|
||
(ascii (caddr mm))
|
||
(dim (if unicodep
|
||
unicode
|
||
(if ascii ascii unicode))))
|
||
(diminish mode dim))))))))
|