2010-09-05 72 views
2

有沒有辦法定義別名,以便shell-command可以識別它們? shell識別在.emacs.d/init_bash.sh中定義的那些;是否有可能讓shell-command知道這些呢?爲shell命令定義別名?

回答

2

讀入simple.elshell-command代碼:

;; 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) 

nilshell-file-name表示emacs的不發送的輸入文件的過程。因此,您應檢查shell-file-name的值以確定它是否爲讀取隱式.rc文件的進程。

+0

我的shell文件名是「bin/bash」,但我仍然不確定如何解釋這些指令......? – hatmatrix 2010-09-06 11:25:37

+0

bash過程開始時,bash會準確知道做了什麼。 – 2010-09-06 15:09:34

+0

謝謝 - 我創建了一個鏈接文件,以便/ bin/bash可以使用它。 – hatmatrix 2010-09-09 13:42:01