Refactor core-ui

+ Remove doom/switch-theme (replaced with an advice for load-theme)
+ Reorganize core-ui
+ Fix Emacs 26+ hl-line hack being applied for Emacs 25 users
+ Rename doom|show-whitespace-maybe to doom|highlight-non-default-indentation
+ Disable tool-bar, menu-bar and vertical-scroll-bars via
  default-frame-alist; this is a little faster than using the minor
  modes.
This commit is contained in:
Henrik Lissner 2018-08-31 23:38:54 +02:00
parent 4e2bd22869
commit 44e536e8e8
No known key found for this signature in database
GPG key ID: 5F6C0EA160557395
3 changed files with 73 additions and 107 deletions

View file

@ -199,18 +199,6 @@ regex PATTERN. Returns the number of killed buffers."
;; Hooks
;;
;;;###autoload
(defun doom|protect-visible-buffer ()
"Don't kill the current buffer if it is visible in another window (bury it
instead). Meant for `kill-buffer-query-functions'."
(not (and (delq (selected-window) (get-buffer-window-list nil nil t))
(not (member (substring (buffer-name) 0 1) '(" " "*"))))))
;;;###autoload
(defun doom|protect-fallback-buffer ()
"Don't kill the scratch buffer. Meant for `kill-buffer-query-functions'."
(not (eq (current-buffer) (doom-fallback-buffer))))
;;;###autoload
(defun doom|mark-buffer-as-real ()
"Hook function that marks the current buffer as real."

View file

@ -113,23 +113,6 @@ presentations."
(doom|init-theme)
(doom|init-fonts)))
;;;###autoload
(defun doom/switch-theme (theme)
"Like `load-theme', but will unload currently loaded themes before switching
to a new one."
(interactive
(list (completing-read
"Load theme: "
(mapcar #'symbol-name
(custom-available-themes)))))
(condition-case nil
(progn
(mapc #'disable-theme custom-enabled-themes)
(load-theme (intern theme) t)
(when (fboundp 'powerline-reset)
(powerline-reset)))
(error "Problem loading theme %s" x)))
;;;###autoload
(defun doom*recenter (&rest _)
(recenter))