summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKévin Le Gouguec <kevin.legouguec@gmail.com>2018-12-06 19:22:36 +0100
committerKévin Le Gouguec <kevin.legouguec@gmail.com>2018-12-06 19:22:36 +0100
commit5f2d3a3953fec19ee34bd47e98df69e0a3b9fb41 (patch)
tree44918fe9740aedd806eddcc4023192af26eb080f
parentcfddc7cc625aa9db97aebbac0200c4710c0b87f6 (diff)
downloaddotfiles-5f2d3a3953fec19ee34bd47e98df69e0a3b9fb41.tar.xz
Tweak Emacs frames title
This is somewhat more informative for me.
-rw-r--r--.emacs11
1 files changed, 11 insertions, 0 deletions
diff --git a/.emacs b/.emacs
index 6a58986..486aa69 100644
--- a/.emacs
+++ b/.emacs
@@ -277,5 +277,16 @@
;; Font stuff (🤷 🤦)
(set-fontset-font "fontset-default" nil (font-spec :name "Symbola") nil 'append)
+(defun my/project-name ()
+ (when-let* ((project (project-current))
+ (root (car (project-roots project))))
+ (when (not (file-equal-p root "~"))
+ (file-name-nondirectory (string-trim-right root "/")))))
+
+(setq frame-title-format
+ '(:eval
+ (let ((project (my/project-name)))
+ (concat (when project (format "[%s] " project)) "%b"))))
+
;; TODO: fringe fun: hideshowvis, git gutter…
;; TODO: decruftify mode-line (e.g. remove superflous parens)