summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorAlan Pearce2017-07-11 17:10:07 +0200
committerAlan Pearce2017-07-11 17:10:07 +0200
commit1063325b18ed6d7eaa277f720dedde4690461984 (patch)
tree5cf91d464d325bec89dc968202f0c9bc617f2080
parent9bc57e8f0124b1a0e553aff2384beb70f35113c1 (diff)
downloadnixfiles-1063325b18ed6d7eaa277f720dedde4690461984.tar.lz
nixfiles-1063325b18ed6d7eaa277f720dedde4690461984.tar.zst
nixfiles-1063325b18ed6d7eaa277f720dedde4690461984.zip
Emacs: Simplify nix title generation
-rw-r--r--emacs/.emacs.d/init.org34
1 files changed, 17 insertions, 17 deletions
diff --git a/emacs/.emacs.d/init.org b/emacs/.emacs.d/init.org
index 4839beb6..304abc46 100644
--- a/emacs/.emacs.d/init.org
+++ b/emacs/.emacs.d/init.org
@@ -295,23 +295,23 @@ correct, at least for Liberation Mono.
 
 
 (require 'f)
-(if (f-ancestor-of? "/nix/store" invocation-directory)
-    (setq frame-title-format (list "Emacs (Nix Generation "
-                                   (cadr
-                                    (split-string (f-base
-                                                   (car
-                                                    (last (split-string
-                                                           (s-chomp (shell-command-to-string (concat "nix-store -q --roots " invocation-directory)))
-                                                           "\n"))))
-                                                  "-"))
-                                   " "
-                                   (s-left 6 (nth 3 (f-split invocation-directory)))
-                                   "..."
-                                   (s-right 6 (car (split-string (nth 3 (f-split invocation-directory)) "-")))
-                                   ")"
-                                   " — %f"
-                                   '(dired-directory dired-directory)))
-    (setq frame-title-format '("Emacs — %f" (dired-directory dired-directory))))
+(setq frame-title-format (list "Emacs"
+                               (if (f-ancestor-of? "/nix/store" invocation-directory)
+                                   (list " (Nix Generation "
+                                         (cadr
+                                          (split-string (f-base
+                                                         (car
+                                                          (last (split-string
+                                                                 (s-chomp (shell-command-to-string (concat "nix-store -q --roots " invocation-directory)))
+                                                                 "\n"))))
+                                                        "-"))
+                                         " "
+                                         (s-left 6 (nth 3 (f-split invocation-directory)))
+                                         "..."
+                                         (s-right 6 (car (split-string (nth 3 (f-split invocation-directory)) "-")))
+                                         ")"))
+                               '(buffer-file-name " — %f")
+                               '(dired-directory (" — " dired-directory)))) 
 #+END_SRC
 
 ** Chrome