Hello wizards, I've got a weird one today.
I'm trying to write a small package which re-defines `eshell/cat`. I'm doing this with
(defun eshell/cat (&rest args)
"doc string"
(do-various-things-to args))
Before loading this file, `which cat` returns "eshell/cat is a byte-compiled Lisp function in 'em-unix.el'."
But after loading the file, `which cat` returns "/usr/bin/cat".
Now I can manually invoke my new function with `eshell/cat`, but it _should_ be callable as just `cat`. Everything I've seen online indicates that defining `eshell/<cmd>` exposes `<cmd>` as an eshell command, as does the built-in Info manual.
This issue occurs whenever I start eshell _and then_ load the file. When I load the file first, eshell's init sequence clobbers it and restores the definition from `em-unix.el`.
What is the correct way to do this?
EDIT:
I ended up just defining a function called `eshell/dat` and aliasing that to Cat. Will keep poking this problem and hopefully update again.