From ed3954445045aca3cdc60dbd6b75a3a55470e28b Mon Sep 17 00:00:00 2001 From: Stefan Kangas Date: Sat, 5 Aug 2023 14:56:27 +0200 Subject: [PATCH] Make eshell-redisplay into alias for redisplay * lisp/eshell/esh-util.el (eshell-redisplay): Make into obsolete function alias for 'redisplay'. This removes a workaround for some obscure bug apparently found in Emacs 21. Update all callers. --- lisp/eshell/em-hist.el | 2 +- lisp/eshell/em-smart.el | 4 ++-- lisp/eshell/esh-util.el | 12 ++---------- 3 files changed, 5 insertions(+), 13 deletions(-) diff --git a/lisp/eshell/em-hist.el b/lisp/eshell/em-hist.el index 2c199ec160f..79232d8e9b5 100644 --- a/lisp/eshell/em-hist.el +++ b/lisp/eshell/em-hist.el @@ -534,7 +534,7 @@ See also `eshell-read-history'." (forward-line 3) (while (search-backward "completion" nil 'move) (replace-match "history reference"))) - (eshell-redisplay) + (redisplay) (message "Hit space to flush") (let ((ch (read-event))) (if (eq ch ?\ ) diff --git a/lisp/eshell/em-smart.el b/lisp/eshell/em-smart.el index d8b7fadc2c2..d5002a59d14 100644 --- a/lisp/eshell/em-smart.el +++ b/lisp/eshell/em-smart.el @@ -214,7 +214,7 @@ The options are `begin', `after' or `end'." 0 frame) (if affected (let (window-scroll-functions) ;;FIXME: Why? - (eshell-redisplay))))) + (redisplay))))) (defun eshell-smart-display-setup () "Set the point to somewhere in the beginning of the last command." @@ -261,7 +261,7 @@ and the end of the buffer are still visible." (recenter -1) ;; trigger the redisplay now, so that we catch any attempted ;; point motion; this is to cover for a redisplay bug - (eshell-redisplay)) + (redisplay)) (let ((top-point (point))) (and (memq 'eshell-smart-display-move pre-command-hook) (>= (point) eshell-last-input-start) diff --git a/lisp/eshell/esh-util.el b/lisp/eshell/esh-util.el index 6353e3d4aae..87cd1f5dcb2 100644 --- a/lisp/eshell/esh-util.el +++ b/lisp/eshell/esh-util.el @@ -476,16 +476,6 @@ list." (cadr flist) (cdr flist)))) -(defsubst eshell-redisplay () - "Allow Emacs to redisplay buffers." - ;; for some strange reason, Emacs 21 is prone to trigger an - ;; "args out of range" error in `sit-for', if this function - ;; runs while point is in the minibuffer and the users attempt - ;; to use completion. Don't ask me. - (condition-case nil - (sit-for 0) - (error nil))) - (defun eshell-user-login-name () "Return the connection-aware value of the user's login name. See also `user-login-name'." @@ -795,6 +785,8 @@ If N or M is nil, it means the end of the list." (declare (obsolete seq-subseq "28.1")) (seq-subseq l n (1+ m))) +(define-obsolete-function-alias 'eshell-redisplay #'redisplay "30.1") + (provide 'esh-util) ;;; esh-util.el ends here -- 2.39.2