diff options
author | David Morgan <djm_uk@protonmail.com> | 2022-08-26 16:12:57 +0100 |
---|---|---|
committer | David Morgan <djm_uk@protonmail.com> | 2022-08-26 16:12:57 +0100 |
commit | 0cab6351832d8e81ddad89bee15cf7c6d29cc1dd (patch) | |
tree | f6a8ac761355a8788554c8a3658e9373b5b22df9 /.emacs.d | |
parent | 5bfb76c9db5be3b74eec2e7a2ef6812eb3a11a71 (diff) | |
download | dotfiles-0cab6351832d8e81ddad89bee15cf7c6d29cc1dd.tar.gz |
Include more of the path in clj buffer names
Diffstat (limited to '.emacs.d')
-rw-r--r-- | .emacs.d/lisp/init-clojure.el | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/.emacs.d/lisp/init-clojure.el b/.emacs.d/lisp/init-clojure.el index a684a97..35a9605 100644 --- a/.emacs.d/lisp/init-clojure.el +++ b/.emacs.d/lisp/init-clojure.el @@ -27,7 +27,16 @@ (PATCH 2) (rfn 2) (let-routes 1) - (context 2))) + (context 2)) + + ;; Always show more of the path in clj buffer names. + ;; Using setq-local in clojure-mode-hook is not enough, as it runs too late + (defun clj-uniquify-get-proposed-name (orig base dirname &optional depth original-dirname) + (when (and (string= ".clj" (substring base -4)) + (not (string= "project.clj" base))) + (setq-local uniquify-min-dir-content 3)) + (funcall orig base dirname depth original-dirname)) + (advice-add 'uniquify-get-proposed-name :around 'clj-uniquify-get-proposed-name)) (use-package hydra) (use-package clj-refactor |