Skip to content

If only certain buffers could be so grossly incandescent.

License

Notifications You must be signed in to change notification settings

yshui/emacs-solaire-mode

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

52 Commits
 
 
 
 
 
 

Repository files navigation

Release tag MIT MELPA

Solaire mode

If only certain buffers could be so grossly incandescent.

solaire-mode is an aesthetic plugin that helps visually distinguish file-visiting windows from other types of windows (like popups or sidebars) by giving them a slightly different -- often brighter -- background.

Praise the sun.

Note:

  • Uses face-remapping-alist, which other plugins may overwrite.
  • Tested mainly on Emacs 25.1+
  • This was once a part of doom-themes as doom-buffer-mode
  • Try jumping.

Screenshot

solaire-mode at work

Install

M-x package-install RET solaire-mode

(require 'solaire-mode)

;; Enable solaire-mode anywhere it can be enabled
(solaire-global-mode +1)
;; To enable solaire-mode unconditionally for certain modes:
(add-hook 'ediff-prepare-buffer-hook #'solaire-mode)

;; ...if you use auto-revert-mode, this prevents solaire-mode from turning
;; itself off every time Emacs reverts the file
(add-hook 'after-revert-hook #'turn-on-solaire-mode)

;; highlight the minibuffer when it is activated:
(add-hook 'minibuffer-setup-hook #'solaire-mode-in-minibuffer)

;; if the bright and dark background colors are the wrong way around, use this
;; to switch the backgrounds of the `default` and `solaire-default-face` faces.
;; This should be used *after* you load the active theme!
;;
;; NOTE: This is necessary for themes in the doom-themes package!
(solaire-mode-swap-bg)

;; An alternative for `use-package' users:
(use-package solaire-mode
  :hook ((change-major-mode after-revert ediff-prepare-buffer) . turn-on-solaire-mode)
  :config
  (add-hook 'minibuffer-setup-hook #'solaire-mode-in-minibuffer)
  (solaire-mode-swap-bg))

Configuration

  • By default, solaire-mode's effects will be invisible. Its faces must be defined:

    • solaire-default-face
    • solaire-minibuffer-face
    • solaire-line-number-face
    • solaire-hl-line-face
    • solaire-org-hide-face
    • solaire-mode-line-face
    • solaire-mode-line-inactive-face

    The only theme(s) that supports this, that I know of, is doom-themes.

  • What faces get remapped is controlled by solaire-mode-remap-faces and solaire-mode-remap-modeline.

    By default, these faces are affected:

    • default
    • hl-line
    • linum
    • org-hide
    • mode-line
    • mode-line-inactive
  • The function in solaire-mode-real-buffer-fn determines if a buffer should be brightened or not.

Jolly cooperation with other plugins

  • By default, solaire-mode remaps the mode-line faces. This interferes with certain mode-line packages like telephone-line or powerline. You can undo this with:

    (setq solaire-mode-remap-modeline nil)
  • When persp-mode loads a perspective from file, it doesn't restore solaire-mode. The function solaire-mode-restore-persp-mode-buffers is available for this:

    (advice-add #'persp-load-state-from-file :after #'solaire-mode-restore-persp-mode-buffers)
  • Don't trust Patches!

About

If only certain buffers could be so grossly incandescent.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Emacs Lisp 100.0%