Function: idlwave-shell-run-region

idlwave-shell-run-region is an autoloaded, interactive and byte-compiled function defined in idlw-shell.el.gz.

Signature

(idlwave-shell-run-region BEG END &optional N)

Documentation

Compile and run the region using the IDL process.

Copies the region to a temporary file idlwave-shell-temp-pro-file and issues the IDL .run command for the file. Because the region is compiled and run as a main program there is no problem with begin-end blocks extending over multiple lines - which would be a problem if idlwave-shell-evaluate-region was used. An END statement is appended to the region if necessary.

If there is a prefix argument, display IDL process.

Key Bindings

Source Code

;; Defined in /usr/src/emacs/lisp/obsolete/idlw-shell.el.gz
(defun idlwave-shell-run-region (beg end &optional n)
  "Compile and run the region using the IDL process.
Copies the region to a temporary file `idlwave-shell-temp-pro-file'
and issues the IDL .run command for the file.  Because the region
is compiled and run as a main program there is no problem with
begin-end blocks extending over multiple lines - which would be
a problem if `idlwave-shell-evaluate-region' was used.
An END statement is appended to the region if necessary.

If there is a prefix argument, display IDL process."
  (interactive "r\nP")
  (let ((oldbuf (current-buffer)))
    (with-current-buffer (idlwave-find-file-noselect
                          (idlwave-shell-temp-file 'pro) 'tmp)
      (set (make-local-variable 'comment-start-skip) ";+[ \t]*")
      (set (make-local-variable 'comment-start) ";")
      (erase-buffer)
      (insert-buffer-substring oldbuf beg end)
      (if (not (save-excursion
                 (idlwave-previous-statement)
                 (idlwave-look-at "\\<end\\>")))
          (insert "\nend\n"))
      (save-buffer 0)))
  (idlwave-shell-send-command (concat ".run \""
				      idlwave-shell-temp-pro-file "\"")
			      nil
			      (if (idlwave-shell-hide-p 'run) 'mostly)
			      nil t)
  (if n
      (idlwave-display-buffer (idlwave-shell-buffer)
			      nil (idlwave-shell-shell-frame))))