Function: ede-shell-run-something
ede-shell-run-something is a byte-compiled function defined in
shell.el.gz.
Signature
(ede-shell-run-something ARG &rest ARGS)
Implementations
(ede-shell-run-something (TARGET ede-target) COMMAND) in `ede/shell.el'.
Create a shell to run stuff for TARGET. COMMAND is a text string representing the thing to be run.
Source Code
;; Defined in /usr/src/emacs/lisp/cedet/ede/shell.el.gz
(cl-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)))
;; Show the new buffer.
(when (not (get-buffer-window buff))
(switch-to-buffer-other-window buff t))
;; Force a shell into the buffer, but only if the buffer
;; doesn't already have a shell in it.
;; Newer versions of `shell' pop the window forward.
(set-buffer buff)
(when (not (eq major-mode 'shell-mode))
(shell buff)
;; Make sure the shell has started.
(while (eq (point-min) (point))
(accept-process-output)))
;; Change the default directory
(if (not (string= (file-name-as-directory (expand-file-name default-directory))
(file-name-as-directory (expand-file-name dd))))
;; Go there.
(setq command (concat (concat "cd " dd ";" command))))
;; Run the command itself.
(ede-shell-run-command command)
))