all repos — nixfiles @ 1063325b18ed6d7eaa277f720dedde4690461984

System and user configuration, managed by nix and home-manager

Emacs: Simplify nix title generation
Alan Pearce alan@alanpearce.eu
Tue, 11 Jul 2017 17:10:07 +0200
commit

1063325b18ed6d7eaa277f720dedde4690461984

parent

9bc57e8f0124b1a0e553aff2384beb70f35113c1

1 files changed, 17 insertions(+), 17 deletions(-)

jump to
M emacs/.emacs.d/init.orgemacs/.emacs.d/init.org
@@ -295,23 +295,23 @@ (size-indication-mode t) 
 
 (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