Fix support for fancy frame title

This commit is contained in:
syl20bnr 2017-04-28 23:39:41 -04:00
parent 9b922957ef
commit 8db21403d7
2 changed files with 6 additions and 6 deletions

View File

@ -606,7 +606,6 @@ If ARG is non nil then Ask questions to the user before installing the dotfile."
(dotspacemacs/safe-load)))))
(defun spacemacs/title-prepare (title-format)
>>>>>>> ca96a88b... Add support for fancy frame title
"A string is printed verbatim except for %-constructs.
%a -- prints the `abbreviated-file-name', or `buffer-name'
%t -- prints `projectile-project-name'
@ -625,8 +624,11 @@ If ARG is non nil then Ask questions to the user before installing the dotfile."
%z -- prints mnemonics of buffer, terminal, and keyboard coding systems
%Z -- like %z, but including the end-of-line format"
(let* ((fs (format-spec-make
?a (abbreviate-file-name (or (buffer-file-name) (buffer-name)))
?t (if (boundp 'projectile-mode) (projectile-project-name) "-")
?a (abbreviate-file-name (or (buffer-file-name)
(buffer-name)))
?t (if (fboundp 'projectile-project-name)
(projectile-project-name)
"-")
?S system-name
?I invocation-name
?U (or (getenv "USER") "")

View File

@ -106,15 +106,13 @@ the final step of executing code in `emacs-startup-hook'.")
(configuration-layer/initialize)
;; frame title init
(when (and (display-graphic-p) dotspacemacs-frame-title-format)
(require 'format-spec)
(setq frame-title-format '((:eval (spacemacs/title-prepare dotspacemacs-frame-title-format))))
(if dotspacemacs-icon-title-format
(setq icon-title-format '((:eval (spacemacs/title-prepare dotspacemacs-icon-title-format))))
(setq icon-title-format frame-title-format)))
;; theme
(spacemacs/load-default-theme spacemacs--fallback-theme)
;; frame title init
(when (and (display-graphic-p) dotspacemacs-frame-title-format)
(setq frame-title-format '((:eval (spacemacs/frame-title-prepare)))))
;; font
(spacemacs|do-after-display-system-init
;; If you are thinking to remove this call to `message', think twice. You'll