Function: idlwave-shell-parse-line
idlwave-shell-parse-line is a byte-compiled function defined in
idlw-shell.el.gz.
Signature
(idlwave-shell-parse-line STRING &optional SKIP-MAIN)
Documentation
Parse IDL message for the subroutine, file name and line number.
Source Code
;; Defined in /usr/src/emacs/lisp/obsolete/idlw-shell.el.gz
(defun idlwave-shell-parse-line (string &optional skip-main)
"Parse IDL message for the subroutine, file name and line number."
;We need to work hard here to remove the stupid line breaks inserted by
;IDL5. These line breaks can be right in the middle of procedure
;or file names.
;It is very difficult to come up with a robust solution. This one seems
;to be pretty good though.
;
;Here is in what ways it improves over the previous solution:
;
;1. The procedure name can be split and will be restored.
;2. The number can be split. I have never seen this, but who knows.
;3. We do not require the `.pro' extension for files.
;
;This function can still break when the file name ends on an end line
;and the message line contains an additional line with garbage. Then
;the first part of that garbage will be added to the file name.
;However, the function checks the existence of the files with and
;without this last part - thus the function only breaks if file name
;plus garbage match an existing regular file. This is hopefully very
;unlikely.
;
;If optional arg SKIP-MAIN is non-nil, don't parse $MAIN$ routine stop
;statements.
(let (number procedure file)
(when (and (not (if skip-main (string-match ":\\s-*\\$MAIN" string)))
(string-match idlwave-shell-file-line-message string))
(setq procedure (match-string 1 string)
number (match-string 3 string)
file (match-string 5 string))
;; Repair the strings
(setq procedure (idlwave-shell-repair-string procedure))
(setq number (idlwave-shell-repair-string number))
(setq file (idlwave-shell-repair-file-name file))
;; If we have a file, return the frame list
(if file
(list (idlwave-shell-file-name file)
(string-to-number number)
procedure)
;; No success finding a file
nil))))