summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorAlan Pearce2013-10-07 13:12:23 +0100
committerAlan Pearce2013-10-07 13:12:23 +0100
commitc0633cd67a4a6bfd40cf3eea146cbdc5679916d3 (patch)
tree43f8f4f3ea0dd0fe49fa8698092be3500c7796d4
parentcb812e671e45bea0c33a7361f1bd7262f020c46c (diff)
downloadnixfiles-c0633cd67a4a6bfd40cf3eea146cbdc5679916d3.tar.lz
nixfiles-c0633cd67a4a6bfd40cf3eea146cbdc5679916d3.tar.zst
nixfiles-c0633cd67a4a6bfd40cf3eea146cbdc5679916d3.zip
Emacs: improve font-setting on OSX when running as a daemon
-rw-r--r--emacs/init.el24
1 files changed, 10 insertions, 14 deletions
diff --git a/emacs/init.el b/emacs/init.el
index 76a6ac90..da2ec6c9 100644
--- a/emacs/init.el
+++ b/emacs/init.el
@@ -135,23 +135,19 @@ Values: `desktop', `server', `laptop'")
                         "Consolas")))
            (variable-face "Segoe UI")
            (default-font (concat mono-face "-" (number-to-string font-size))))
-      (when mono-face
-        (set-face-font 'default default-font)
-        (set-face-font 'fixed-pitch default-font))
-      (when variable-face
-        (set-face-font 'variable-pitch (concat variable-face "-"
-                                               (number-to-string (1+ font-size)))))))
-   ((eq window-system 'ns)
+        (when mono-face
+		  (add-to-list 'default-frame-alist `(font . ,default-font))
+		  (set-face-font 'fixed-pitch default-font))
+        (when variable-face
+		  (set-face-font 'variable-pitch (concat variable-face "-"
+                                                   (number-to-string (1+ font-size)))))))
+   ((eq system-type 'darwin)
     (let* ((font-size 14)
-           (font-list (font-family-list))
-           (mono-face (cond
-                       ((member "Droid Sans Mono" font-list)
-                        "Droid Sans Mono")))
+           (mono-face "Droid Sans Mono")
            (variable-face "Helvetica Neue")
            (default-font (concat mono-face "-" (number-to-string font-size))))
-      (when mono-face
-        (set-face-font 'default default-font)
-        (set-face-font 'fixed-pitch default-font))))))
+        (when mono-face
+          (add-to-list 'default-frame-alist `(font . ,default-font)))))))
 
 (with-elapsed-timer "Setting up font styles"
   (let* ((font-height (face-attribute 'default :height))