2010-01-26 5 views
1

저는 Emacs에서 Rinari for Rails 개발을 사용하고 있습니다. M-x 셸은 내 환경 (zsh)에서 올바르게 PATH 된 새 버퍼를 엽니 다. M-x eshell은 잘못된 PATH를 모두 사용하기 때문에 아무것도 사용할 수 없었습니다.Emacs 액션이 새 버퍼에 쉘을 생성해야 할 때마다 쉘 대 셸 사용하기

편집중인 Rails 응용 프로그램의 웹 서버 인스턴스를 실행하는 Rinari의 기능이 있지만 서버 인스턴스로 여는 버퍼는 eshell입니다.

궁극적으로 어떻게 쉘을 사용하여 버퍼를 열 수 있습니까 (아니면 M-x 쉘로 열릴 것인가)?

다음은 실행하려는 명령에 대한 defun입니다.

변경할 수있는 설정이나 쉘을 열어 볼 변수가 있습니까? 이 shell 어떤 시간에 전화를 대체 할 fooby에 대한 호출 기간 동안

(defun fooby() 
    "" 
    (interactive) 
    (eshell)) 

(defadvice fooby (around fooby-replace-eshell-with-shell-around act) 
    "Substitute `shell` for `eshell` for the duration of this call" 
    (flet ((eshell() (shell))) 
    ad-do-it)) 

: 구성 아무것도 찾을 수없는 경우

(defun rinari-web-server (&optional edit-cmd-args) 
    "Run script/server. Dump output to a compilation buffer 
    allowing jumping between errors and source code. With optional 
    prefix argument allows editing of the server command arguments." 
    (interactive "P") 
    (let* ((default-directory (rinari-root)) 
     (script (concat (expand-file-name "server" 
        (file-name-as-directory 
        (expand-file-name "script" (rinari-root)))) 
     (if rinari-rails-env (concat " -e " rinari-rails-env)))) 
(command (if edit-cmd-args 
      (read-string "Run Ruby: " (concat script " ")) 
     script))) 
(ruby-compilation-run command)) (rinari-launch)) 

답변

0

Emacs를 실행하기 위해 'emacs'의 별명을 지정할 수 있었고 터미널 환경에서 Emacs가 eshell의 적절한 PATH를 전달합니다.

0

, 당신은 항상 다음과 같은 뭔가를 시도 할 수 있습니다 eshell이 호출됩니다. 조언을 가능한 한 집중적으로 다루기를 원한다. 실제로 eshell을 호출하는 함수를 찾을 수 있다면 조언 해줄 함수가 될 것이다. 물론, 파기를 생각하지 않는다면 언제든지 rinari-web-server에게 조언을 구할 수 있습니다. 당신이 결코, 이제까지 eshell를 사용하지 않으려면, 당신은 세계적으로 대체 할 fset을 사용할 수 있습니다

(fset 'eshell 'shell) 

희망을!