emacselispeshell

I want to replace `ls` with `ls -l` in eshell


I use eshell-parse-command 'ls -l' and I got this:

(progn (eshell-trap-errors
         (eshell-named-command "ls" (list "-l"))))

Then I write a alias in my .emacs file:

(defalias 'ls
  (progn ...))

But I doesn't work. I don't know why.


Solution

  • Add following code to your configuration file.

    (require 'em-alias)
    (add-to-list 'eshell-command-aliases-list (list "ls" "ls -l"))