From 3cda385ffd292ade869abf7e39cbb45ca10349fb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miha=20Rihtar=C5=A1i=C4=8D?= Date: Mon, 25 Oct 2021 14:09:30 +0200 Subject: [PATCH] Avoid insert-before-markers in eshell * lisp/eshell/esh-mode.el (eshell-mode): Make window point advance on insertion. (eshell-output-filter): Don't use insert-before-markers. --- lisp/eshell/esh-mode.el | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/lisp/eshell/esh-mode.el b/lisp/eshell/esh-mode.el index 579b01f4d1..2b5a4647e0 100644 --- a/lisp/eshell/esh-mode.el +++ b/lisp/eshell/esh-mode.el @@ -315,6 +315,8 @@ eshell-mode (setq-local bookmark-make-record-function #'eshell-bookmark-make-record) (setq local-abbrev-table eshell-mode-abbrev-table) + (setq-local window-point-insertion-type t) + (setq-local list-buffers-directory (expand-file-name default-directory)) ;; always set the tab width to 8 in Eshell buffers, since external @@ -696,13 +698,10 @@ eshell-output-filter (setq oend (+ oend nchars))) ;; Let the ansi-color overlay hooks run. (let ((inhibit-modification-hooks nil)) - (insert-before-markers string)) + (insert string)) (if (= (window-start) (point)) (set-window-start (selected-window) (- (point) nchars))) - (if (= (point) eshell-last-input-end) - (set-marker eshell-last-input-end - (- eshell-last-input-end nchars))) (set-marker eshell-last-output-start ostart) (set-marker eshell-last-output-end (point)) (force-mode-line-update)) -- 2.33.0