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?
Asked
Active
Viewed 541 times
1 Answers
2
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
- 10,285
- 4
- 34
- 40
-
My shell-file-name is "bin/bash" but I'm still not sure how to interpret these instructions...? – hatmatrix Sep 06 '10 at 11:25
-
man bash to know exactly what is done when bash process starts. – Jérôme Radix Sep 06 '10 at 15:09
-
Thanks - I created a link file so that /bin/bash can use it. – hatmatrix Sep 09 '10 at 13:42
-
Can you clarify the /bin/bash case? Pointing to man bash isn't too helpful. – Clément Oct 20 '16 at 04:38
-
1Answer here: http://stackoverflow.com/questions/12224909/is-there-a-way-to-get-my-emacs-to-recognize-my-bash-aliases-and-custom-functions – Clément Oct 20 '16 at 04:40