1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283 |
- (require 'ede)
- (declare-function comint-send-input "comint")
- (defmethod ede-shell-run-something ((target ede-target) command)
- "Create a shell to run stuff for TARGET.
- COMMAND is a text string representing the thing to be run."
- (let* ((buff (ede-shell-buffer target))
- (cp (ede-target-parent target))
- (dd (oref cp :directory)))
-
- (when (not (get-buffer-window buff))
- (switch-to-buffer-other-window buff t))
-
- (shell buff)
- (while (eq (point-min) (point))
- (accept-process-output))
-
- (if (not (string= (file-name-as-directory (expand-file-name default-directory))
- (file-name-as-directory (expand-file-name dd))))
-
- (setq command (concat (concat "cd " dd ";" command))))
-
- (ede-shell-run-command command)
- ))
- (defun ede-shell-run-command (command)
- "Run the COMMAND in the current shell-buffer."
- (require 'comint)
-
- (goto-char (point-max))
-
- (goto-char (point-max))
- (insert command)
-
- (comint-send-input)
- )
- (defmethod ede-shell-buffer ((target ede-target))
- "Get the buffer for running shell commands for TARGET."
- (let ((name (ede-name target)))
- (get-buffer-create (format "*EDE Shell %s*" name))))
- (provide 'ede/shell)
|