From: Jim Porter Date: Fri, 10 May 2024 16:27:30 +0000 (-0700) Subject: ; Clean up some 'require' and 'declare-function' calls in Eshell X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=f99a6a1050173ce17d0b2e6e399c60f07160107e;p=emacs.git ; Clean up some 'require' and 'declare-function' calls in Eshell * lisp/eshell/em-ls.el: * lisp/eshell/esh-cmd.el: * lisp/eshell/esh-mode.el: * lisp/eshell/esh-ext.el: Remove superfluous 'declare-function' calls. * lisp/eshell/esh-proc.el (pcomplete): Require this explicitly instead of transitively. (cherry picked from commit ffc70962ca5fea86afcd984caa7770ab87a452a2) --- diff --git a/lisp/eshell/em-ls.el b/lisp/eshell/em-ls.el index fd89a9f778e..62ad7ff72a1 100644 --- a/lisp/eshell/em-ls.el +++ b/lisp/eshell/em-ls.el @@ -293,7 +293,6 @@ instead." (eshell-do-ls (nconc switches (list target))))))))) -(declare-function eshell-extended-glob "em-glob" (glob)) (declare-function dired-read-dir-and-switches "dired" (str)) (declare-function dired-goto-next-file "dired" ()) diff --git a/lisp/eshell/esh-cmd.el b/lisp/eshell/esh-cmd.el index b220855299e..b489822f188 100644 --- a/lisp/eshell/esh-cmd.el +++ b/lisp/eshell/esh-cmd.el @@ -101,20 +101,18 @@ ;;; Code: (require 'esh-util) -(require 'eldoc) (require 'esh-arg) (require 'esh-proc) (require 'esh-module) (require 'esh-io) (require 'esh-ext) + +(require 'eldoc) (require 'generator) +(require 'pcomplete) (eval-when-compile - (require 'cl-lib) - (require 'pcomplete)) - -(declare-function pcomplete--here "pcomplete" - (&optional form stub paring form-only)) + (require 'cl-lib)) (defgroup eshell-cmd nil "Executing an Eshell command is as simple as typing it in and \ diff --git a/lisp/eshell/esh-ext.el b/lisp/eshell/esh-ext.el index 44861c222b8..b4fce7a82a2 100644 --- a/lisp/eshell/esh-ext.el +++ b/lisp/eshell/esh-ext.el @@ -31,12 +31,12 @@ ;;; Code: -(require 'esh-util) - (eval-when-compile (require 'cl-lib)) (require 'esh-io) (require 'esh-arg) (require 'esh-opt) +(require 'esh-proc) +(require 'esh-util) (defgroup eshell-ext nil "External commands are invoked when operating system executables are @@ -90,10 +90,6 @@ but Eshell will be able to understand (setq list (cdr list))) file))) -;; This file provides itself then eval-when-compile loads files that require it. -;; This causes spurious "might not be defined at runtime" warnings. -(declare-function eshell-search-path "esh-ext" (name)) - (defcustom eshell-windows-shell-file (if (eshell-under-windows-p) (if (string-match "\\(cmdproxy\\|sh\\)\\.\\(com\\|exe\\)" @@ -244,8 +240,6 @@ An external command simply means external to Emacs." (cl-assert interp) (if (functionp (car interp)) (apply (car interp) (append (cdr interp) args)) - (require 'esh-proc) - (declare-function eshell-gather-process-output "esh-proc" (command args)) (eshell-gather-process-output (car interp) (append (cdr interp) args))))) diff --git a/lisp/eshell/esh-mode.el b/lisp/eshell/esh-mode.el index 5de200ce4b5..78a448a41a5 100644 --- a/lisp/eshell/esh-mode.el +++ b/lisp/eshell/esh-mode.el @@ -694,9 +694,6 @@ newline." (defun eshell-send-eof-to-process () "Send EOF to the currently-running \"head\" process." (interactive) - (require 'esh-mode) - (declare-function eshell-send-input "esh-mode" - (&optional use-region queue-p no-newline)) (eshell-send-input nil nil t) (when (eshell-head-process) (process-send-eof (eshell-head-process)))) diff --git a/lisp/eshell/esh-proc.el b/lisp/eshell/esh-proc.el index 35c81f6a4b2..34db5e1c771 100644 --- a/lisp/eshell/esh-proc.el +++ b/lisp/eshell/esh-proc.el @@ -27,6 +27,8 @@ (require 'esh-io) (require 'esh-util) +(require 'pcomplete) + (defgroup eshell-proc nil "When Eshell invokes external commands, it always does so asynchronously, so that Emacs isn't tied up waiting for the process to