aboutsummaryrefslogtreecommitdiff
path: root/common/.config/emacs/init.el.org
diff options
context:
space:
mode:
authorjjanzen <jjanzen@jjanzen.ca>2025-03-14 10:30:32 -0500
committerjjanzen <jjanzen@jjanzen.ca>2025-03-14 10:30:32 -0500
commitc586e740f13bbde3c388ae3a2639daf597213fe2 (patch)
treebf404744628e839227b645cf01d5ef455fcc5e86 /common/.config/emacs/init.el.org
parentf4166d184894e4892cadc3a0a8ca75d3d52d531c (diff)
system changes
Diffstat (limited to 'common/.config/emacs/init.el.org')
-rw-r--r--common/.config/emacs/init.el.org53
1 files changed, 26 insertions, 27 deletions
diff --git a/common/.config/emacs/init.el.org b/common/.config/emacs/init.el.org
index 38bc60d..32c060c 100644
--- a/common/.config/emacs/init.el.org
+++ b/common/.config/emacs/init.el.org
@@ -312,37 +312,36 @@ Install a better PDF viewer than =DocView=.
Install and configure =eat= as a terminal emulator in Emacs with =eshell= as a shell.
#+begin_src emacs-lisp
- (require 'em-prompt)
- :init
- ;; Overwrite a default function that makes the prompt editable for some reason
- (defun eshell-emit-prompt ()
- "Emit a prompt if eshell is being used interactively."
- (when (boundp 'ansi-color-context-region)
- (setq ansi-color-context-region nil))
- (run-hooks 'eshell-before-prompt-hook)
- (if (not eshell-prompt-function)
- (set-marker eshell-last-output-end (point))
- (let ((prompt (funcall eshell-prompt-function)))
- (add-text-properties
- 0 (length prompt)
- (if eshell-highlight-prompt
- '( read-only t
- field prompt
- font-lock-face eshell-prompt
- front-sticky (read-only field font-lock-face)
- rear-nonsticky (read-only field font-lock-face))
- '( read-only t
- field prompt
- front-sticky (read-only field font-lock-face)
- rear-nonsticky (read-only field font-lock-face)))
- prompt)
- (eshell-interactive-filter nil prompt)))
- (run-hooks 'eshell-after-prompt-hook))
-
(use-package eat
:init
(setopt eat-kill-buffer-on-exit t)
(eat-eshell-mode)
+ (add-hook 'eshell-mode-hook (lambda ()
+ (require 'em-prompt)
+ ;; Overwrite a default function that makes the prompt editable for some reason
+ (defun eshell-emit-prompt ()
+ "Emit a prompt if eshell is being used interactively."
+ (when (boundp 'ansi-color-context-region)
+ (setq ansi-color-context-region nil))
+ (run-hooks 'eshell-before-prompt-hook)
+ (if (not eshell-prompt-function)
+ (set-marker eshell-last-output-end (point))
+ (let ((prompt (funcall eshell-prompt-function)))
+ (add-text-properties
+ 0 (length prompt)
+ (if eshell-highlight-prompt
+ '( read-only t
+ field prompt
+ font-lock-face eshell-prompt
+ front-sticky (read-only field font-lock-face)
+ rear-nonsticky (read-only field font-lock-face))
+ '( read-only t
+ field prompt
+ front-sticky (read-only field font-lock-face)
+ rear-nonsticky (read-only field font-lock-face)))
+ prompt)
+ (eshell-interactive-filter nil prompt)))
+ (run-hooks 'eshell-after-prompt-hook))))
(defun jj/shorten-path-str (path)
(let* ((components (split-string (replace-regexp-in-string (getenv "HOME") "~" path) "/"))