tags:

views:

46

answers:

1

Is there a way to define aliases so that shell-command can recognize them? shell recognizes those defined in .emacs.d/init_bash.sh; is it possible to make shell-command aware of these also?

+1  A: 

Read in simple.el in shell-command code :

    ;; We do not use -f for csh; we will not support broken use of
    ;; .cshrcs.  Even the BSD csh manual says to use
    ;; "if ($?prompt) exit" before things which are not useful
    ;; non-interactively.  Besides, if someone wants their other
    ;; aliases for shell commands then they can still have them.
    (call-process shell-file-name nil
          (if error-file
              (list t error-file)
            t)
          nil shell-command-switch command)

The nil after shell-file-name indicates that emacs don't send an input file to the process. Thus, you should check the value of shell-file-name to determine if it's a process that read implicit .rc files.

Jérôme Radix
My shell-file-name is "bin/bash" but I'm still not sure how to interpret these instructions...?
Stephen
man bash to know exactly what is done when bash process starts.
Jérôme Radix
Thanks - I created a link file so that /bin/bash can use it.
Stephen