projectile-project-root no longer returns `default-directory` if not in a project (it returns nil). As such, doom-project-* functions (and their uses) have been refactored. + doom-project-p & doom-project-root are aliases for projectile-project-p & projectile-project-root. + doom-project-{p,root,name,expand} now has a DIR argument (for consistency, since projectile-project-name and projectile-project-expand do not). + The nocache parameter is no longer necessary, as projectile's caching behavior is now more sane. + Removed some projectile advice/hacks that are no longer necessary. + Updated unit tests
18 lines
546 B
EmacsLisp
18 lines
546 B
EmacsLisp
;;; emacs/eshell/autoload/commands.el -*- lexical-binding: t; -*-
|
|
|
|
;;;###autoload
|
|
(defun eshell/cd-to-project ()
|
|
"Change to the project root of the current directory."
|
|
(eshell/cd (doom-project-root (eshell/pwd))))
|
|
|
|
;;;###autoload
|
|
(defun eshell/quit-and-close (&rest _)
|
|
"Quit the current eshell buffer and close the window it's in."
|
|
(setq-local +eshell-kill-window-on-exit t)
|
|
(throw 'eshell-terminal t))
|
|
|
|
;;;###autoload
|
|
(defun eshell/mkdir-and-cd (dir)
|
|
"Create a directory then cd into it."
|
|
(make-directory dir t)
|
|
(eshell/cd dir))
|