X-Git-Url: https://git.hcoop.net/bpt/emacs.git/blobdiff_plain/ba69b876ac836a88877dab99e6fc2352dd36c855..a3269bc45f343c405986126c842361db10589476:/lisp/eshell/esh-mode.el diff --git a/lisp/eshell/esh-mode.el b/lisp/eshell/esh-mode.el index b8f88981b0..b30c1a8053 100644 --- a/lisp/eshell/esh-mode.el +++ b/lisp/eshell/esh-mode.el @@ -222,11 +222,6 @@ This is used by `eshell-watch-for-password-prompt'." (define-abbrev-table 'eshell-mode-abbrev-table ()) -(eval-when-compile - (unless (eshell-under-xemacs-p) - (defalias 'characterp 'ignore) - (defalias 'char-int 'ignore))) - (if (not eshell-mode-syntax-table) (let ((i 0)) (setq eshell-mode-syntax-table (make-syntax-table)) @@ -269,7 +264,7 @@ This is used by `eshell-watch-for-password-prompt'." (modify-syntax-entry ?\[ "(] " eshell-mode-syntax-table) (modify-syntax-entry ?\] ")[ " eshell-mode-syntax-table) ;; All non-word multibyte characters should be `symbol'. - (if (eshell-under-xemacs-p) + (if (featurep 'xemacs) (map-char-table (function (lambda (key val) @@ -467,7 +462,7 @@ This is used by `eshell-watch-for-password-prompt'." (eshell-deftest mode command-running-p "Modeline shows no command running" - (or (eshell-under-xemacs-p) + (or (featurep 'xemacs) (not eshell-status-in-modeline) (and (memq 'eshell-command-running-string mode-line-format) (equal eshell-command-running-string "--")))) @@ -775,38 +770,36 @@ This is done after all necessary filtering has been done." (setq string (funcall (car functions) string)) (setq functions (cdr functions)))) (if (and string oprocbuf (buffer-name oprocbuf)) - (let ((obuf (current-buffer)) - opoint obeg oend) - (set-buffer oprocbuf) - (setq opoint (point)) - (setq obeg (point-min)) - (setq oend (point-max)) - (let ((buffer-read-only nil) - (nchars (length string)) - (ostart nil)) - (widen) - (goto-char eshell-last-output-end) - (setq ostart (point)) - (if (<= (point) opoint) - (setq opoint (+ opoint nchars))) - (if (< (point) obeg) - (setq obeg (+ obeg nchars))) - (if (<= (point) oend) - (setq oend (+ oend nchars))) - (insert-before-markers string) - (if (= (window-start (selected-window)) (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)) - (narrow-to-region obeg oend) - (goto-char opoint) - (eshell-run-output-filters) - (set-buffer obuf))))) + (let (opoint obeg oend) + (with-current-buffer oprocbuf + (setq opoint (point)) + (setq obeg (point-min)) + (setq oend (point-max)) + (let ((buffer-read-only nil) + (nchars (length string)) + (ostart nil)) + (widen) + (goto-char eshell-last-output-end) + (setq ostart (point)) + (if (<= (point) opoint) + (setq opoint (+ opoint nchars))) + (if (< (point) obeg) + (setq obeg (+ obeg nchars))) + (if (<= (point) oend) + (setq oend (+ oend nchars))) + (insert-before-markers string) + (if (= (window-start (selected-window)) (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)) + (narrow-to-region obeg oend) + (goto-char opoint) + (eshell-run-output-filters)))))) (defun eshell-run-output-filters () "Run the `eshell-output-filter-functions' on the current output."