From 32ac66d50b62e77a81866520a40195e3d15b90f2 Mon Sep 17 00:00:00 2001 From: William Carroll Date: Tue, 29 May 2018 16:23:24 -0400 Subject: [PATCH] Support Elisp fns for current buffer's dirname Gets the shorthand version of the buffer's current directory's name. --- emacs.d/wpc/functions.el | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/emacs.d/wpc/functions.el b/emacs.d/wpc/functions.el index f2514a1be..29886b304 100644 --- a/emacs.d/wpc/functions.el +++ b/emacs.d/wpc/functions.el @@ -223,5 +223,11 @@ (term-char-mode) (term-line-mode))) +(defun buffer-dirname () + "Return the directory name of the current buffer as a string." + (->> buffer-file-name + f-dirname + f-filename)) + (provide 'functions) ;;; functions.el ends here