diff options
Diffstat (limited to 'lisp/+eshell.el')
-rw-r--r-- | lisp/+eshell.el | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/lisp/+eshell.el b/lisp/+eshell.el index bd92b03..1f8677c 100644 --- a/lisp/+eshell.el +++ b/lisp/+eshell.el | |||
@@ -76,5 +76,25 @@ any directory proferred by `consult-dir'." | |||
76 | (add-hook 'eshell-post-command-hook #'eshell-record-args nil t) | 76 | (add-hook 'eshell-post-command-hook #'eshell-record-args nil t) |
77 | (remove-hook 'eshell-post-command-hook #'eshell-record-args t))) | 77 | (remove-hook 'eshell-post-command-hook #'eshell-record-args t))) |
78 | 78 | ||
79 | ;;;###autoload | ||
80 | (defmacro +eshell-eval-after-load (&rest forms) | ||
81 | "Execute FORMS after Eshell is loaded. | ||
82 | If Eshell is already loaded in the session, immediately execute | ||
83 | forms. | ||
84 | |||
85 | I wrote this because Eshell doesn't properly do loading or | ||
86 | something, it's really annoying to work with." | ||
87 | (declare (indent 0)) | ||
88 | `(progn | ||
89 | (defun +eshell@setup () | ||
90 | "Setup the Eshell session." | ||
91 | ,@forms) | ||
92 | (when (featurep 'eshell) | ||
93 | `(dolist (buf (buffer-list)) | ||
94 | (with-current-buffer buf | ||
95 | (when (derived-mode-p 'eshell-mode) | ||
96 | (+eshell@setup))))) | ||
97 | '(add-hook 'eshell-mode-hook #'+eshell@setup))) | ||
98 | |||
79 | (provide '+eshell) | 99 | (provide '+eshell) |
80 | ;;; +eshell.el ends here | 100 | ;;; +eshell.el ends here |