|
|
|
@@ -512,7 +512,7 @@
|
|
|
|
"\\*Flycheck errors\\*"
|
|
|
|
"\\*Flycheck errors\\*"
|
|
|
|
help-mode
|
|
|
|
help-mode
|
|
|
|
compilation-mode
|
|
|
|
compilation-mode
|
|
|
|
"\\*eshell.*\\*" eshell-mode))
|
|
|
|
"\\*eshell-popup\\*" eshell-mode))
|
|
|
|
|
|
|
|
|
|
|
|
(defun my/popper-window-height (window)
|
|
|
|
(defun my/popper-window-height (window)
|
|
|
|
"Make eshell popups take half the frame height, otherwise defer to popper--fit-window-height"
|
|
|
|
"Make eshell popups take half the frame height, otherwise defer to popper--fit-window-height"
|
|
|
|
@@ -922,6 +922,13 @@
|
|
|
|
(global-set-key (kbd "C-c a") 'aider-transient-menu))
|
|
|
|
(global-set-key (kbd "C-c a") 'aider-transient-menu))
|
|
|
|
;;; Eshell
|
|
|
|
;;; Eshell
|
|
|
|
;;;; Eshell
|
|
|
|
;;;; Eshell
|
|
|
|
|
|
|
|
(require 'cl-lib)
|
|
|
|
|
|
|
|
(defun find-window-matching (regexp)
|
|
|
|
|
|
|
|
"Find a visible window displaying a buffer whose name matches REGEXP."
|
|
|
|
|
|
|
|
(cl-loop for window in (window-list)
|
|
|
|
|
|
|
|
when (string-match regexp (buffer-name (window-buffer window)))
|
|
|
|
|
|
|
|
thereis window))
|
|
|
|
|
|
|
|
|
|
|
|
(use-package eshell
|
|
|
|
(use-package eshell
|
|
|
|
:bind (("M-`" . my/eshell-toggle))
|
|
|
|
:bind (("M-`" . my/eshell-toggle))
|
|
|
|
:config
|
|
|
|
:config
|
|
|
|
@@ -938,11 +945,24 @@ If in eshell, call `popper-toggle`.
|
|
|
|
If not in eshell but in a project, call `project-eshell`.
|
|
|
|
If not in eshell but in a project, call `project-eshell`.
|
|
|
|
Otherwise, call `eshell`."
|
|
|
|
Otherwise, call `eshell`."
|
|
|
|
(interactive)
|
|
|
|
(interactive)
|
|
|
|
(if (derived-mode-p 'eshell-mode)
|
|
|
|
(if (find-window-matching "\\*.*eshell-popup\\*$")
|
|
|
|
(popper-toggle)
|
|
|
|
(popper-toggle)
|
|
|
|
(if (project-current)
|
|
|
|
(if (project-current)
|
|
|
|
(project-eshell)
|
|
|
|
(my/project-eshell-popup)
|
|
|
|
(eshell))))
|
|
|
|
(my/eshell-popup default-directory "*eshell-popup*"))))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
(defun my/eshell-popup (directory name)
|
|
|
|
|
|
|
|
(defvar eshell-buffer-name)
|
|
|
|
|
|
|
|
(let* ((default-directory directory)
|
|
|
|
|
|
|
|
(eshell-buffer-name name)
|
|
|
|
|
|
|
|
(eshell-buffer (get-buffer eshell-buffer-name)))
|
|
|
|
|
|
|
|
(if eshell-buffer
|
|
|
|
|
|
|
|
(pop-to-buffer eshell-buffer (bound-and-true-p display-comint-buffer-action))
|
|
|
|
|
|
|
|
(eshell t))))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
(defun my/project-eshell-popup ()
|
|
|
|
|
|
|
|
(my/eshell-popup (project-root (project-current t))
|
|
|
|
|
|
|
|
(project-prefixed-buffer-name "eshell-popup")))
|
|
|
|
|
|
|
|
|
|
|
|
(defun eshell/ec (&rest args)
|
|
|
|
(defun eshell/ec (&rest args)
|
|
|
|
"Substitute for emacsclient alias from inside eshell"
|
|
|
|
"Substitute for emacsclient alias from inside eshell"
|
|
|
|
|