the following alias in the aliases file doesn't work in eshell 2.4.2, emacs 24.4.1

alias ff 'find-file $1'

error message as is is given below

find-file $1: command not found

Any ideas what is going wrong?

  • If eshell aliases are anything like real aliases, they won't have support for arguments...
    – wasamasa
    Sep 3 '15 at 14:33

You shouldn't quote name of command together with its argument. As written, the code creates an alias for command named find-file $1 which doesn't exist, of course.

You need to remove the quotes:

alias ff find-file $1
  • In the code to eshell-maybe-replace-by-alias which takes command and args as two its arguments in em-alias.el I see no use of its second argument, which seems the problem to me
    – Sum Proxy
    Sep 3 '15 at 16:19
  • Yet it seems to work, thanks. Although most of the info on the web says it should be quoted, see e.g. emacswiki.org/emacs/EshellAlias
    – Sum Proxy
    Sep 3 '15 at 16:35
  • 1
    @SumProxy, these examples show how you create new alias from within the Emacs shell. This will add corresponding line into alias file. It will be there unquoted. If you want to write aliases directly in the file, you should not quote this stuff. Sep 3 '15 at 17:17
  • @Mark thanks again for proper clarification
    – Sum Proxy
    Sep 3 '15 at 17:32

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.