From f43e64e505ea82679787ec0c38facaaade84391e Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Thu, 25 Oct 2018 13:42:20 -0400 Subject: [PATCH] Add ns-auto-titlebar package for MacOS This fixes mismatching frame title and frame coloring, as well as auto-sets the ns-appearance parameter depending on your theme. --- core/core-os.el | 14 +++++++++----- core/packages.el | 3 ++- 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/core/core-os.el b/core/core-os.el index e0723f6a7..2ada973de 100644 --- a/core/core-os.el +++ b/core/core-os.el @@ -34,7 +34,15 @@ ;; Don't open files from the workspace in a new frame ns-pop-up-frames nil) + ;; Fix the clipboard in terminal or daemon Emacs (non-GUI) + (when (or (daemonp) (not (display-graphic-p))) + (add-hook 'doom-post-init-hook #'osx-clipboard-mode)) + (when (or (daemonp) (display-graphic-p)) + ;; Syncs ns frame parameters with theme (and fixes mismatching text + ;; colr in the frame title) + (require 'ns-auto-titlebar nil t) + ;; A known problem with GUI Emacs on MacOS (or daemons started via ;; launchctl or brew services): it runs in an isolated ;; environment, so envvars will be wrong. That includes the PATH @@ -48,11 +56,7 @@ exec-path-from-shell-debug doom-debug-mode exec-path-from-shell-variables (nconc exec-path-from-shell-variables '("LC_CTYPE" "LC_ALL" "LANG"))) - (exec-path-from-shell-initialize))) - - ;; Fix the clipboard in terminal or daemon Emacs (non-GUI) - (when (or (daemonp) (not (display-graphic-p))) - (add-hook 'doom-post-init-hook #'osx-clipboard-mode))) + (exec-path-from-shell-initialize)))) (IS-LINUX (setq x-gtk-use-system-tooltips nil ; native tooltips are ugly! diff --git a/core/packages.el b/core/packages.el index d49ab3d04..c41aeed79 100644 --- a/core/packages.el +++ b/core/packages.el @@ -4,7 +4,8 @@ ;; core-os.el (when IS-MAC (package! exec-path-from-shell) - (package! osx-clipboard)) + (package! osx-clipboard) + (package! ns-auto-titlebar)) ;; core-ui.el (package! all-the-icons)