cl-seq.el
contains cl-find
. The cl.el
library contains a dolist
with a bunch of names and a defalias
for the list -- one of the entries is find: (dolist (fun '(. . . find-if-not find-if find nsubstitute-if-not . . .)) (let ((new (if (consp fun) (prog1 (cdr fun) (setq fun (car fun))) (intern (format "cl-%s" fun))))) (defalias fun new)))
Here are two examples to illustrate whether the eshell
library is working behind the scenes running elisp
code when a user types either find
or which
at the command prompt in an *eshell*
buffer. To experiment with these examples it is necessary to first ensure the eshell
and cl
libraries are loaded:
(progn
(require 'eshell)
(require 'cl))
The first example tests the find command and the code being evaluated will return nil
because there is no built-in elisp
function that is specially called by default when a user types find in an *eshell*
buffer at the command prompt:
(eshell-invoke-directly
'(eshell-commands
(progn
(run-hooks (quote eshell-pre-command-hook))
(catch
(quote top-level)
(progn
(eshell-trap-errors
(eshell-named-command "find"))))
(run-hooks (quote eshell-post-command-hook)))))
The second example tests the which command and the code being evaluated will return t
because there is a built-in elisp
function that is specially called by default when a user types which in an *eshell*
buffer at the command prompt:
(eshell-invoke-directly
'(eshell-commands
(progn
(run-hooks (quote eshell-pre-command-hook))
(catch
(quote top-level)
(progn
(eshell-trap-errors
(eshell-named-command "which"))))
(run-hooks (quote eshell-post-command-hook)))))
The following is a list of some built-in elisp
functions that are called when a user types just the suffix (i.e., the word after the forward-slash of the name of the function) at the command prompt in an *eshell*
buffer -- this list was obtained using describe-function
and the tab completion buffer:
eshell/.
eshell/addpath
eshell/agrep
eshell/alias
eshell/basename
eshell/cat
eshell/cd
eshell/clear
eshell/clear-scrollback
eshell/cp
eshell/date
eshell/define
eshell/diff
eshell/dirname
eshell/dirs
eshell/du
eshell/echo
eshell/egrep
eshell/env
eshell/eshell-debug
eshell/exit
eshell/export
eshell/fgrep
eshell/glimpse
eshell/grep
eshell/history
eshell/info
eshell/jobs
eshell/kill
eshell/listify
eshell/ln
eshell/locate
eshell/ls
eshell/make
eshell/man
eshell/mkdir
eshell/mv
eshell/occur
eshell/popd
eshell/printnl
eshell/pushd
eshell/pwd
eshell/rm
eshell/rmdir
eshell/setq
eshell/source
eshell/time
eshell/umask
eshell/unset
eshell/wait
eshell/which
eshell/whoami
See also the variable eshell-complex-commands
, whose default value is '("ls")
-- the doc-string for said variable is as follows:
"A list of commands names or functions, that determine complexity.
That is, if a command is defined by a function named eshell/NAME,
and NAME is part of this list, it is invoked as a complex command.
Complex commands are always correct, but run much slower. If a
command works fine without being part of this list, then it doesn't
need to be.
If an entry is a function, it will be called with the name, and should
return non-nil if the command is complex."