.emacs.d

the most bloated Emacs config on this planet
git clone https://git.trogloxene.org/.emacs.d.git
Log | Files | Refs

commit 967efdbf3bc6b035ae5a3f8a3c22500c0e469a8c
parent 229f446b2b35ee70ff48173353dc47f3cf3517b2
Author: andsy10 <andsy1016@gmail.com>
Date:   Sun, 11 Oct 2026 20:23:59 +0800

Set pager environment variables in shell buffer

Diffstat:
Mlisp/init-base.el | 5-----
Mlisp/init-package.el | 28++++++++++++++++++++++++++++
Mlisp/init-prog.el | 6++++++
3 files changed, 34 insertions(+), 5 deletions(-)

diff --git a/lisp/init-base.el b/lisp/init-base.el @@ -365,10 +365,5 @@ (add-hook 'lazy-count-update-hook #'force-mode-line-update)) -;; environment sync -(my-use-package exec-path-from-shell - :init - (exec-path-from-shell-initialize)) - (provide 'init-base) ;;; init-base.el ends here diff --git a/lisp/init-package.el b/lisp/init-package.el @@ -56,12 +56,40 @@ Like normal Emacs `C-k'. Kill to end of line and put content in kill-ring." :host github :repo "dakra/ghostel")) +;; shell +(my-use-package shell + :straight nil + :config + (defun my-setenv-local (var val buffer) + (with-current-buffer buffer + (unless (local-variable-p 'process-environment) + (setq-local process-environment (copy-sequence process-environment))) + (setenv var val))) + + (defvar my-shell-setenv + '(("PAGER" . "cat") + ("GIT_PAGER" . "cat") + ("MANPAGER" . "cat") + ("SYSTEMD_PAGER" . "cat") + ("APT_PAGER" . "cat"))) + + (defun my-shell-setenv (buffer name &rest _) + (when (string= name "shell") + (dolist (pair my-shell-setenv) + (my-setenv-local (car pair) (cdr pair) buffer)))) + (advice-add #'comint-exec :before #'my-shell-setenv)) + ;; eshell-syntax-highlighting (my-use-package eshell-syntax-highlighting :hook (eshell-mode . eshell-syntax-highlighting-global-mode) (eshell-mode . (lambda () (setenv "TERM" "xterm-256color")))) +;; environment sync +(my-use-package exec-path-from-shell + :init + (exec-path-from-shell-initialize)) + ;; workspace (my-use-package perspective :hook diff --git a/lisp/init-prog.el b/lisp/init-prog.el @@ -57,6 +57,12 @@ (funcall my-repl-switch-function my-repl-original-buffer) (error "No original buffer")))) +;; comint +(my-use-package comint + :straight nil + :config + (setq comint-prompt-read-only t)) + ;; hideshow (my-use-package hideshow :straight nil