(require 'projectile) (defun iii () (interactive) (let ( (output-buffer (get-buffer-create "*Rest Output*")) (command (concat "python /home/fs/bin/easy_http.py " buffer-file-name " " (projectile-project-root))) ) (unless (get-buffer-window output-buffer) (split-window-right) (other-window 1) (switch-to-buffer output-buffer) (other-window -1) ) (with-current-buffer output-buffer (js-mode) (erase-buffer) (shell-command command output-buffer) (goto-char (point-max))) (message command) ))