Monday, March 10, 2014

dshell


emacs でカレントディレクトリでシェルを起動する。
個人的にはemacsをシェルとして使っていてこれが多分いちばんemacsで利用する機能。emacs 依存。

(defun dshell (my-default-directory)
  "run shell in current directory.

Uses MY-DEFAULT-DIRECTORY as the current directory, and uses that
as the buffer name."
  (interactive (list default-directory))
  (let* ((default-directory (expand-file-name my-default-directory))
;;(explicit-shell-file-name "/bin/dash")
(shell-buffer-name
 (concat "*shell*"
 default-directory)))
    (shell shell-buffer-name)))