emacs run multiple eshell buffers (more then one eshell)

(defun buffer-exists (bufname)   
  (not (eq nil (get-buffer bufname))))

(defun make-shell (name)
  "Create a shell buffer named NAME."
  (interactive "sName: ")
  (if (buffer-exists "*eshell*")
      (setq eshell-buffer-name name)
    (message "eshell doesnot exists, use the default name: *eshell*"))
  (eshell))


Because the eshell buffer is determined by the value of eshell-buffer-name.  You need not to rename the buffer after creating it.

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章