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
This commit is contained in:
Madeleine Sydney
2025-02-16 18:50:00 -07:00
parent a0495c6df3
commit 6c9213d532
8 changed files with 182 additions and 44 deletions

View File

@@ -135,4 +135,15 @@ If FORCE-P, delete without confirmation."
base-file
conflict-file)))
(defun syd-split-tramp-file-name (file-name)
"Split FILE-NAME into (TRAMP-PREFIX . LOCAL-NAME). Returns (nil . FILE-NAME)
if FILE-NAME has no TRAMP prefix."
(if (tramp-tramp-file-p file-name)
(let* ((dissected (tramp-dissect-file-name file-name t))
(localname (tramp-file-name-localname dissected)))
(setf (tramp-file-name-localname dissected) nil)
(cons (tramp-make-tramp-file-name dissected)
localname))
(cons nil file-name)))
(provide 'syd-file)

View File

@@ -8,5 +8,9 @@
(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