about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--emacs.d/wpc/functions.el6
1 files changed, 6 insertions, 0 deletions
diff --git a/emacs.d/wpc/functions.el b/emacs.d/wpc/functions.el
index f2514a1bed85..29886b30413d 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