首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >当Emacs操作需要在新的缓冲区中产生shell时,使用shell与eshell

当Emacs操作需要在新的缓冲区中产生shell时,使用shell与eshell
EN

Stack Overflow用户
提问于 2010-01-26 10:59:36
回答 2查看 807关注 0票数 1

我在Emacs中使用Rinari进行Rails开发。M-x shell将打开一个新的缓冲区,它是我的环境(zsh)的正确路径。M-x eshell使用了所有不正确的路径,我还没能让它很好地处理任何事情。

Rinari有一个函数可以为我正在编辑的Rails应用程序启动一个web服务器实例,但是它与服务器实例一起打开的缓冲区是eshell。

我如何才能最终让它使用shell打开一个缓冲区(或者使用M-x shell打开什么)?

下面是我正在尝试执行的命令的defun。

有没有一个简单的设置可以更改,或者有一个变量可以查找要打开的shell?

代码语言:javascript
复制
(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))
EN

回答 2

Stack Overflow用户

回答已采纳

发布于 2010-01-28 06:08:31

我能够使用别名' Emacs‘来启动Emacs.app,在我的终端环境中这样做时,Emacs会在ESCEL中执行适当的路径。

票数 0
EN

Stack Overflow用户

发布于 2010-01-27 20:41:34

如果您找不到要配置的内容,您可以尝试执行以下操作:

代码语言:javascript
复制
(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来进行全局的替换:

代码语言:javascript
复制
(fset 'eshell 'shell)

希望这能有所帮助!

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/2137262

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档