Emacs: Make theme modifications after a frame is made.
Some theme modifications don't work in daemon mode. I guess because the window system is not initialized. server-after-make-frame was introduced between Emacs 27 and 27.1.
This commit is contained in:
parent
62e7c61c15
commit
1d5565f46f
|
@ -1,6 +1,6 @@
|
|||
;;; appearance.el --- Configure appearance. -*- lexical-binding: t; -*-
|
||||
|
||||
;; Time-stamp: <2020-05-07T13:31:43+0200>
|
||||
;; Time-stamp: <2020-05-17T18:15:55+0200>
|
||||
|
||||
;;; Commentary:
|
||||
|
||||
|
@ -29,9 +29,8 @@
|
|||
|
||||
(tool-bar-mode -1) ; Hide toolbar.
|
||||
(menu-bar-mode -1) ; Hide menu bar.
|
||||
(when (display-graphic-p)
|
||||
(set-scroll-bar-mode 'right)
|
||||
(add-to-list 'default-frame-alist '(scroll-bar-width . 8)))
|
||||
(set-scroll-bar-mode 'right)
|
||||
(add-to-list 'default-frame-alist '(scroll-bar-width . 8))
|
||||
(my/set-default-fonts)
|
||||
(global-hl-line-mode t) ; Highlight current line.
|
||||
(show-paren-mode t) ; Visualize matching parens.
|
||||
|
@ -63,9 +62,10 @@
|
|||
(load-theme 'doom-outrun-electric t)
|
||||
(doom-themes-visual-bell-config) ; Flash modeline on error.
|
||||
(doom-themes-treemacs-config)
|
||||
;; Set colors for scroll bar.
|
||||
(set-face-background 'scroll-bar (face-background 'default))
|
||||
(set-face-foreground 'scroll-bar (face-foreground 'shadow))
|
||||
(defun my/theme-modifications-scroll-bar ()
|
||||
;; Set colors for scroll bar.
|
||||
(set-face-background 'scroll-bar (face-background 'default))
|
||||
(set-face-foreground 'scroll-bar (face-foreground 'shadow)))
|
||||
|
||||
;; Write a minimal theme to file, to load it in early-init.el.
|
||||
(unless (string= (face-background 'default) "unspecified-bg")
|
||||
|
@ -79,7 +79,8 @@
|
|||
" (tool-bar-mode -1))\n"))
|
||||
(with-temp-file (expand-file-name "early-theme.el"
|
||||
user-emacs-directory)
|
||||
(insert minimal-theme))))))
|
||||
(insert minimal-theme)))))
|
||||
:hook (server-after-make-frame . my/theme-modifications-scroll-bar))
|
||||
) ; unless slow-computer.
|
||||
|
||||
;; Neat modeline.
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
;;; common.el --- Common settings for text files. -*- lexical-binding: t; -*-
|
||||
|
||||
;; Time-stamp: <2020-05-05T17:45:23+0200>
|
||||
;; Time-stamp: <2020-05-17T18:17:00+0200>
|
||||
|
||||
;;; Commentary:
|
||||
|
||||
|
@ -40,32 +40,34 @@
|
|||
;; Ruler with fill-column marker.
|
||||
(use-package ruler-mode
|
||||
:config (progn
|
||||
(set-face-background 'ruler-mode-default
|
||||
(face-foreground 'line-number))
|
||||
(set-face-foreground 'ruler-mode-default
|
||||
(face-background 'default))
|
||||
(set-face-foreground 'ruler-mode-column-number
|
||||
(face-background 'default))
|
||||
(if (and (window-system)
|
||||
(>= emacs-major-version 27))
|
||||
(defun my/theme-modifications-ruler ()
|
||||
(set-face-background 'ruler-mode-default
|
||||
(face-foreground 'line-number))
|
||||
(set-face-foreground 'ruler-mode-default
|
||||
(face-background 'default))
|
||||
(set-face-foreground 'ruler-mode-column-number
|
||||
(face-background 'default))
|
||||
(if (and (window-system)
|
||||
(>= emacs-major-version 27))
|
||||
(set-face-foreground 'ruler-mode-fill-column
|
||||
(face-foreground 'fill-column-indicator
|
||||
nil t))
|
||||
(set-face-foreground 'ruler-mode-fill-column
|
||||
(face-foreground 'fill-column-indicator
|
||||
nil t))
|
||||
(set-face-foreground 'ruler-mode-fill-column
|
||||
(face-foreground 'shadow)))
|
||||
(set-face-foreground 'ruler-mode-comment-column
|
||||
(face-foreground 'ruler-mode-fill-column))
|
||||
(set-face-foreground 'ruler-mode-goal-column
|
||||
(face-foreground 'ruler-mode-fill-column))
|
||||
(set-face-foreground 'ruler-mode-current-column
|
||||
(face-foreground 'line-number-current-line))
|
||||
(face-foreground 'shadow)))
|
||||
(set-face-foreground 'ruler-mode-comment-column
|
||||
(face-foreground 'ruler-mode-fill-column))
|
||||
(set-face-foreground 'ruler-mode-goal-column
|
||||
(face-foreground 'ruler-mode-fill-column))
|
||||
(set-face-foreground 'ruler-mode-current-column
|
||||
(face-foreground 'line-number-current-line)))
|
||||
(defun my/ruler-on ()
|
||||
"Turn `ruler-mode' on."
|
||||
(ruler-mode 1)))
|
||||
:custom-face (ruler-mode-default ((t (:inherit·default
|
||||
:box·nil))))
|
||||
:hook ((find-file . my/ruler-on)
|
||||
(text-mode . my/ruler-on))) ; For the scratch buffer.
|
||||
(text-mode . my/ruler-on) ; For the scratch buffer.
|
||||
(server-after-make-frame . my/theme-modifications-ruler)))
|
||||
|
||||
;; Show a fill-column indicator vertically across the buffer.
|
||||
(when (>= emacs-major-version 27)
|
||||
|
|
Loading…
Reference in New Issue
Block a user