Function: idlwave-shell-display-line
idlwave-shell-display-line is a byte-compiled function defined in
idlw-shell.el.gz.
Signature
(idlwave-shell-display-line FRAME &optional COL DEBUG)
Documentation
Display frame file in other window with overlay arrow.
FRAME is a list of file name, line number, and subroutine name. If
FRAME is nil then remove overlay. If COL is set, move point to that
column in the line. If DEBUG is non-nil, enable the electric debug
mode. If it is disable, do not enable no matter what the setting of
idlwave-shell-automatic-electric-debug. If it is force, enable no
matter what the settings of that variable.
Source Code
;; Defined in /usr/src/emacs/lisp/progmodes/idlw-shell.el.gz
(defun idlwave-shell-display-line (frame &optional col debug)
"Display frame file in other window with overlay arrow.
FRAME is a list of file name, line number, and subroutine name. If
FRAME is nil then remove overlay. If COL is set, move point to that
column in the line. If DEBUG is non-nil, enable the electric debug
mode. If it is `disable', do not enable no matter what the setting of
`idlwave-shell-automatic-electric-debug'. If it is `force', enable no
matter what the settings of that variable."
(if (not frame)
;; remove stop-line overlay from old position
(progn
(setq overlay-arrow-string nil)
(setq idlwave-shell-mode-line-info nil)
(setq idlwave-shell-is-stopped nil)
(if idlwave-shell-stop-line-overlay
(delete-overlay idlwave-shell-stop-line-overlay))
;; turn off electric debug everywhere, if it's on
(idlwave-shell-electric-debug-all-off))
(if (not (idlwave-shell-valid-frame frame))
;; fixme: errors are dangerous in shell filters. but i think i
;; have never encountered this one.
(error "Invalid frame - unable to access file: %s" (car frame))
;;
;; buffer : the buffer to display a line in.
;; select-shell: current buffer is the shell.
;;
(setq idlwave-shell-mode-line-info
(if (nth 2 frame)
(format "[%d:%s]"
(- idlwave-shell-calling-stack-index)
(nth 2 frame))))
(let* ((buffer (idlwave-find-file-noselect (car frame) 'shell))
(select-shell (equal (buffer-name) (idlwave-shell-buffer)))
window pos electric)
;; first make sure the shell window is visible
(idlwave-display-buffer (idlwave-shell-buffer)
nil (idlwave-shell-shell-frame))
;; now display the buffer and remember which window it is.
(setq window (idlwave-display-buffer buffer
nil (idlwave-shell-source-frame)))
;; enter the buffer and mark the line
(with-current-buffer buffer
(save-restriction
(widen)
(goto-char (point-min))
(forward-line (1- (nth 1 frame)))
(setq pos (point))
(setq idlwave-shell-is-stopped t)
(if idlwave-shell-stop-line-overlay
(progn
;; restore face and move overlay
(overlay-put idlwave-shell-stop-line-overlay 'face
(if idlwave-shell-electric-debug-mode
idlwave-shell-electric-stop-line-face
idlwave-shell-stop-line-face))
(move-overlay idlwave-shell-stop-line-overlay
(point) (line-end-position)
(current-buffer)))
;; use the arrow instead, but only if marking is wanted.
(if idlwave-shell-mark-stop-line
(setq overlay-arrow-string idlwave-shell-overlay-arrow))
(or overlay-arrow-position ; create the marker if necessary
(setq overlay-arrow-position (make-marker)))
(set-marker overlay-arrow-position (point) buffer)))
;; if the point is outside the restriction, widen the buffer.
(if (or (< pos (point-min)) (> pos (point-max)))
(progn
(widen)
(goto-char pos)))
;; if we have the column of the error, move the cursor there.
(if col (move-to-column col))
(setq pos (point))
;; enter electric debug mode, if not prohibited and not in
;; it already
(when (and (not idlwave-shell-electric-debug-mode)
(or (eq debug 'force)
(and
(not (eq debug 'disable)) ;; explicitly disabled
(or
(eq idlwave-shell-automatic-electric-debug t)
(and
(eq idlwave-shell-automatic-electric-debug
'breakpoint)
(not (eq idlwave-shell-current-state 'error))))
(not idlwave-shell-suppress-electric-debug))))
(idlwave-shell-electric-debug-mode t))
(setq electric idlwave-shell-electric-debug-mode))
;; Make sure pos is really displayed in the window.
(set-window-point window pos)
;; If we came from the shell, go back there. Otherwise select
;; the window where the error/halt is displayed.
(if (or (and idlwave-shell-electric-zap-to-file electric)
(and (equal (buffer-name) (idlwave-shell-buffer))
(not select-shell)))
(select-window window))))))