我在Emacs中使用Rinari进行Rails开发。M-x shell将打开一个新的缓冲区,它是我的环境(zsh)的正确路径。M-x eshell使用了所有不正确的路径,我还没能让它很好地处理任何事情。
Rinari有一个函数可以为我正在编辑的Rails应用程序启动一个web服务器实例,但是它与服务器实例一起打开的缓冲区是eshell。
我如何才能最终让它使用shell打开一个缓冲区(或者使用M-x shell打开什么)?
下面是我正在尝试执行的命令的defun。
有没有一个简单的设置可以更改,或者有一个变量可以查找要打开的shell?
(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))发布于 2010-01-28 06:08:31
我能够使用别名' Emacs‘来启动Emacs.app,在我的终端环境中这样做时,Emacs会在ESCEL中执行适当的路径。
发布于 2010-01-27 20:41:34
如果您找不到要配置的内容,您可以尝试执行以下操作:
(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))在对fooby的调用期间,它将在任何时候调用eshell时替换为对shell的调用。您希望尽可能紧密地关注建议,因此,如果您能找到实际调用eshell的函数,那么就是要建议的函数。当然,如果你不想深入挖掘,你可以随时给rinari-web-server提建议。如果你从来没有想过要使用eshell,那么你可以使用fset来进行全局的替换:
(fset 'eshell 'shell)希望这能有所帮助!
https://stackoverflow.com/questions/2137262
复制相似问题