Custom shells started automatically from .emacs

点点圈 提交于 2019-12-12 08:59:35

问题


I would like to start a few shells, and set their directories from my .emacs. Opening them is easy:

;; run a few shells.
(shell "*shell5*")
(shell "*shell6*")
(shell "*shell7*")

But I would like to specify their directory, too.


回答1:


The following works for me

(let ((default-directory "/path/to/whereever/"))
  (shell "*shell1*"))



回答2:


(shell "*shell5*")
(with-current-buffer "*shell5*"
(goto-char (point-max))
(insert "cd dir")) ;;for example
(comint-send-input nil t) ;; enter

For now I have this, its need some improvement I think. When I use in my emacs its causes an error, but does what you want. I will try to figure why.



来源:https://stackoverflow.com/questions/2288594/custom-shells-started-automatically-from-emacs

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!