From 5f2d3a3953fec19ee34bd47e98df69e0a3b9fb41 Mon Sep 17 00:00:00 2001 From: Kévin Le Gouguec Date: Thu, 6 Dec 2018 19:22:36 +0100 Subject: Tweak Emacs frames title This is somewhat more informative for me. --- .emacs | 11 +++++++++++ 1 file changed, 11 insertions(+) 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) -- cgit v1.2.3