1

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?

Sum Proxy
  • 43
  • 6

1 Answers1

3

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
Mark Karpov
  • 4,893
  • 1
  • 24
  • 53
  • 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 03 '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. http://www.emacswiki.org/emacs/EshellAlias – Sum Proxy Sep 03 '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. – Mark Karpov Sep 03 '15 at 17:17
  • [@Mark](http://emacs.stackexchange.com/users/2487/mark) thanks again for proper clarification – Sum Proxy Sep 03 '15 at 17:32