From 30eff3776214313d0d8840a04d498e62248f13f9 Mon Sep 17 00:00:00 2001 From: bd Date: Tue, 16 Jan 2024 23:42:58 -0700 Subject: Offloaded logic of custom display functions to `display-buffer-alist', removed function. --- .config/emacs/modules/bd--shells.el | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) (limited to '.config/emacs/modules/bd--shells.el') diff --git a/.config/emacs/modules/bd--shells.el b/.config/emacs/modules/bd--shells.el index 1ca8bb0..4396ae1 100644 --- a/.config/emacs/modules/bd--shells.el +++ b/.config/emacs/modules/bd--shells.el @@ -33,19 +33,20 @@ status, and path." ;;;; shell -(defun shell-open-buffer () - "Opens eshell in the bottom -side window." - (interactive) - (let ((curr-buffer (current-buffer)) - (shell (shell))) - (switch-to-buffer curr-buffer) - (display-buffer-in-side-window (get-buffer shell) '((side . top))) - (switch-to-buffer-other-window shell))) - - (require 'shell) -(keymap-global-set "C-z C-e" 'shell-open-buffer) +(add-to-list 'display-buffer-alist + `("\\*shell\\*" + (display-buffer-in-side-window) + (side . top) + (window-height . 20))) + +(keymap-global-set "C-z C-e" (lambda () + (interactive) + (let ((curr-buffer (current-buffer)) + (shell (shell))) + (switch-to-buffer curr-buffer) + (display-buffer (get-buffer shell)) + (switch-to-buffer-other-window shell)))) (keymap-set eshell-mode-map "C-q" 'delete-window) ; mostly for side window (keymap-set shell-mode-map "C-c C-k" #'comint-clear-buffer) (setopt shell-command-prompt-show-cwd t -- cgit v1.2.3