Files
sydnix/users/crumb/programs/emacs/lib/syd-project.el
Madeleine Sydney 6c9213d532 feat(emacs): Eshell stuff
- Fancify prompt
  - Shows success of last command.
  - TRAMP prefix is made distinct.
  - CWD is abbreviated.
- cd to project root (`cdp`).
- Imitate using `C-d` / send-EOF to exit.
- Opening popup shell puts user in insert state.
- Fixes TRAMP customisation.

Nicely done! }:3
2025-02-17 01:58:18 -07:00

17 lines
492 B
EmacsLisp

;;; syd-project.el -*- lexical-binding: t; -*-
(eval-when-compile (require 'cl-lib))
(require 'project)
(cl-defun syd-project-root (&key (dir default-directory))
"Return the project root of DIR, or nil if DIR belongs to no project."
(when-let* ((project (project-current nil dir)))
(project-root project)))
(defun syd-cd-project ()
"Change the working directory to the root of the current project."
(cd (syd-project-root)))
(provide 'syd-project)
;;; syd-project.el ends here