From fa7e4acaa80799055866866f1cf3f9c7b3ff55e5 Mon Sep 17 00:00:00 2001 From: Jim Porter Date: Fri, 9 Feb 2024 22:18:35 -0800 Subject: [PATCH 2/2] [DO NOT MERGE] Test commit for previous patch --- lisp/eshell/em-prompt.el | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/lisp/eshell/em-prompt.el b/lisp/eshell/em-prompt.el index 3662c1fa895..bf3a24689f8 100644 --- a/lisp/eshell/em-prompt.el +++ b/lisp/eshell/em-prompt.el @@ -107,6 +107,14 @@ eshell-prompt-repeat-map ;;; Functions: +(defun eshell-outline-search (&optional bound move backward looking-at) + "Search for outline headings. See `outline-search-function'." + ;; FIXME: This probably isn't the right way to do things. Does it + ;; work with multiline prompts? Still, it's useful for a proof of + ;; concept. + (outline-search-text-property 'field 'prompt bound move backward + looking-at)) + (define-minor-mode eshell-prompt-mode "Minor mode for eshell-prompt module. @@ -117,7 +125,11 @@ eshell-prompt-initialize "Initialize the prompting code." (unless eshell-non-interactive-p (add-hook 'eshell-post-command-hook 'eshell-emit-prompt nil t) - (eshell-prompt-mode))) + (eshell-prompt-mode) + + (setq-local outline-search-function #'eshell-outline-search + outline-level (lambda () 1) + outline-minor-mode-use-buttons 'in-margins))) (defun eshell-emit-prompt () "Emit a prompt if eshell is being used interactively." -- 2.25.1