emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] Changes to emacs/lisp/progmodes/idlw-shell.el


From: Juanma Barranquero
Subject: [Emacs-diffs] Changes to emacs/lisp/progmodes/idlw-shell.el
Date: Thu, 17 Oct 2002 11:41:26 -0400

Index: emacs/lisp/progmodes/idlw-shell.el
diff -c emacs/lisp/progmodes/idlw-shell.el:3.21 
emacs/lisp/progmodes/idlw-shell.el:3.22
*** emacs/lisp/progmodes/idlw-shell.el:3.21     Fri Sep 13 02:18:53 2002
--- emacs/lisp/progmodes/idlw-shell.el  Thu Oct 17 11:41:01 2002
***************
*** 5,11 ****
  ;;         Chris Chase <address@hidden>
  ;; Maintainer: J.D. Smith <address@hidden>
  ;; Version: 4.15
! ;; Date: $Date: 2002/09/13 06:18:53 $
  ;; Keywords: processes
  
  ;; This file is part of GNU Emacs.
--- 5,11 ----
  ;;         Chris Chase <address@hidden>
  ;; Maintainer: J.D. Smith <address@hidden>
  ;; Version: 4.15
! ;; Date: $Date: 2002/10/17 15:41:01 $
  ;; Keywords: processes
  
  ;; This file is part of GNU Emacs.
***************
*** 45,51 ****
  ;;
  ;; INSTALLATION:
  ;; =============
! ;; 
  ;; Follow the instructions in the INSTALL file of the distribution.
  ;; In short, put this file on your load path and add the following
  ;; lines to your .emacs file:
--- 45,51 ----
  ;;
  ;; INSTALLATION:
  ;; =============
! ;;
  ;; Follow the instructions in the INSTALL file of the distribution.
  ;; In short, put this file on your load path and add the following
  ;; lines to your .emacs file:
***************
*** 58,66 ****
  ;;
  ;;   The newest version of this file can be found on the maintainers
  ;;   web site.
! ;; 
  ;;     http://idlwave.org
! ;; 
  ;; DOCUMENTATION
  ;; =============
  ;;
--- 58,66 ----
  ;;
  ;;   The newest version of this file can be found on the maintainers
  ;;   web site.
! ;;
  ;;     http://idlwave.org
! ;;
  ;; DOCUMENTATION
  ;; =============
  ;;
***************
*** 77,83 ****
  ;; it is a bug in XEmacs.
  ;; The Debug menu in source buffers *does* display the bindings correctly.
  ;;
! ;; 
  ;; CUSTOMIZATION VARIABLES
  ;; =======================
  ;;
--- 77,83 ----
  ;; it is a bug in XEmacs.
  ;; The Debug menu in source buffers *does* display the bindings correctly.
  ;;
! ;;
  ;; CUSTOMIZATION VARIABLES
  ;; =======================
  ;;
***************
*** 101,112 ****
    (condition-case () (require 'custom) (error nil))
    (if (and (featurep 'custom)
           (fboundp 'custom-declare-variable)
!          (fboundp 'defface))     
        ;; We've got what we needed
        (setq idlwave-shell-have-new-custom t)
      ;; We have the old or no custom-library, hack around it!
      (defmacro defgroup (&rest args) nil)
!     (defmacro defcustom (var value doc &rest args) 
        `(defvar ,var ,value ,doc))))
  
  ;;; Customizations: idlwave-shell group
--- 101,112 ----
    (condition-case () (require 'custom) (error nil))
    (if (and (featurep 'custom)
           (fboundp 'custom-declare-variable)
!          (fboundp 'defface))
        ;; We've got what we needed
        (setq idlwave-shell-have-new-custom t)
      ;; We have the old or no custom-library, hack around it!
      (defmacro defgroup (&rest args) nil)
!     (defmacro defcustom (var value doc &rest args)
        `(defvar ,var ,value ,doc))))
  
  ;;; Customizations: idlwave-shell group
***************
*** 118,127 ****
    :group 'idlwave)
  
  (defcustom idlwave-shell-prompt-pattern "^ ?IDL> "
!   "*Regexp to match IDL prompt at beginning of a line. 
! For example, \"^IDL> \" or \"^WAVE> \". 
  The \"^\" means beginning of line.
! This variable is used to initialise `comint-prompt-regexp' in the 
  process buffer.
  
  This is a fine thing to set in your `.emacs' file."
--- 118,127 ----
    :group 'idlwave)
  
  (defcustom idlwave-shell-prompt-pattern "^ ?IDL> "
!   "*Regexp to match IDL prompt at beginning of a line.
! For example, \"^IDL> \" or \"^WAVE> \".
  The \"^\" means beginning of line.
! This variable is used to initialise `comint-prompt-regexp' in the
  process buffer.
  
  This is a fine thing to set in your `.emacs' file."
***************
*** 276,285 ****
  is non-nil."
    :group 'idlwave-shell-command-setup
    :type 'file)
!   
  (defcustom idlwave-shell-show-commands
    '(run misc breakpoint)
!   "*A list of command types to show output from in the shell.  
  Possibilities are 'run, 'debug, 'breakpoint, and 'misc .  Unlisted
  types are not displayed in the shell.  The single type 'everything
  causes all the copious shell traffic to be displayed."
--- 276,285 ----
  is non-nil."
    :group 'idlwave-shell-command-setup
    :type 'file)
! 
  (defcustom idlwave-shell-show-commands
    '(run misc breakpoint)
!   "*A list of command types to show output from in the shell.
  Possibilities are 'run, 'debug, 'breakpoint, and 'misc .  Unlisted
  types are not displayed in the shell.  The single type 'everything
  causes all the copious shell traffic to be displayed."
***************
*** 292,298 ****
               (const :tag "All debug and stepping commands" debug)
               (const :tag "Return, close, etc. commands"    misc))))
  
! (defcustom idlwave-shell-examine-alist 
    '(("Print"                  . "print,___")
      ("Help"                   . "help,___")
      ("Structure Help"         . "help,___,/STRUCTURE")
--- 292,298 ----
               (const :tag "All debug and stepping commands" debug)
               (const :tag "Return, close, etc. commands"    misc))))
  
! (defcustom idlwave-shell-examine-alist
    '(("Print"                  . "print,___")
      ("Help"                   . "help,___")
      ("Structure Help"         . "help,___,/STRUCTURE")
***************
*** 303,316 ****
      ("Ptr Valid"              . "print,ptr_valid(___)")
      ("Widget Valid"     . "print,widget_info(___,/VALID)")
      ("Widget Geometry"  . "help,widget_info(___,/GEOMETRY)"))
!   "Alist of special examine commands for popup selection.  
  The keys are used in the selection popup created by
  `idlwave-shell-examine-select', and the corresponding value is sent as
  a command to the shell, with special sequence `___' replaced by the
  expression being examined."
    :group 'idlwave-shell-command-setup
    :type '(repeat
!         (cons 
           (string :tag "Label  ")
           (string :tag "Command"))))
  
--- 303,316 ----
      ("Ptr Valid"              . "print,ptr_valid(___)")
      ("Widget Valid"     . "print,widget_info(___,/VALID)")
      ("Widget Geometry"  . "help,widget_info(___,/GEOMETRY)"))
!   "Alist of special examine commands for popup selection.
  The keys are used in the selection popup created by
  `idlwave-shell-examine-select', and the corresponding value is sent as
  a command to the shell, with special sequence `___' replaced by the
  expression being examined."
    :group 'idlwave-shell-command-setup
    :type '(repeat
!         (cons
           (string :tag "Label  ")
           (string :tag "Command"))))
  
***************
*** 321,327 ****
    "*Non-nil mean, put output of examine commands in their own buffer."
    :group 'idlwave-shell-command-setup
    :type 'boolean)
!   
  (defcustom idlwave-shell-comint-settings
    '((comint-scroll-to-bottom-on-input . t)
      (comint-scroll-to-bottom-on-output . t)
--- 321,327 ----
    "*Non-nil mean, put output of examine commands in their own buffer."
    :group 'idlwave-shell-command-setup
    :type 'boolean)
! 
  (defcustom idlwave-shell-comint-settings
    '((comint-scroll-to-bottom-on-input . t)
      (comint-scroll-to-bottom-on-output . t)
***************
*** 384,390 ****
    answer = GET_KBRD(1)
  
  Since the IDLWAVE shell defines the system variable `!IDLWAVE_VERSION',
! you could actually check if you are running under Emacs before printing 
  the magic strings.  Here is a procedure which uses this.
  
  Usage:
--- 384,390 ----
    answer = GET_KBRD(1)
  
  Since the IDLWAVE shell defines the system variable `!IDLWAVE_VERSION',
! you could actually check if you are running under Emacs before printing
  the magic strings.  Here is a procedure which uses this.
  
  Usage:
***************
*** 401,407 ****
        if keyword_set(on) then         print,'<chars>' $
          else if keyword_set(off) then print,'</chars>' $
          else                          print,'<onechar>'
!   endif 
  end"
    :group 'idlwave-shell-command-setup
    :type '(list
--- 401,407 ----
        if keyword_set(on) then         print,'<chars>' $
          else if keyword_set(off) then print,'</chars>' $
          else                          print,'<onechar>'
!   endif
  end"
    :group 'idlwave-shell-command-setup
    :type '(list
***************
*** 514,531 ****
  
  TYPE is either 'pro or 'rinfo, and idlwave-shell-temp-pro-file or
  idlwave-shell-temp-rinfo-save-file is set (respectively)."
!   (cond 
     ((eq type 'rinfo)
!     (or idlwave-shell-temp-rinfo-save-file 
!       (setq idlwave-shell-temp-rinfo-save-file 
              (idlwave-shell-make-temp-file idlwave-shell-temp-pro-prefix))))
     ((eq type 'pro)
      (or idlwave-shell-temp-pro-file
!       (setq idlwave-shell-temp-pro-file 
              (idlwave-shell-make-temp-file idlwave-shell-temp-pro-prefix))))
!    (t (error "Wrong argument (idlwave-shell-temp-file): %s" 
             (symbol-name type)))))
!     
  
  (defun idlwave-shell-make-temp-file (prefix)
    "Create a temporary file."
--- 514,531 ----
  
  TYPE is either 'pro or 'rinfo, and idlwave-shell-temp-pro-file or
  idlwave-shell-temp-rinfo-save-file is set (respectively)."
!   (cond
     ((eq type 'rinfo)
!     (or idlwave-shell-temp-rinfo-save-file
!       (setq idlwave-shell-temp-rinfo-save-file
              (idlwave-shell-make-temp-file idlwave-shell-temp-pro-prefix))))
     ((eq type 'pro)
      (or idlwave-shell-temp-pro-file
!       (setq idlwave-shell-temp-pro-file
              (idlwave-shell-make-temp-file idlwave-shell-temp-pro-prefix))))
!    (t (error "Wrong argument (idlwave-shell-temp-file): %s"
             (symbol-name type)))))
! 
  
  (defun idlwave-shell-make-temp-file (prefix)
    "Create a temporary file."
***************
*** 563,576 ****
  before use by the shell.")
  
  (defvar idlwave-shell-dirstack-query "cd,current=___cur & print,___cur"
!   "Command used by `idlwave-shell-resync-dirs' to query IDL for 
  the directory stack.")
  
  (defvar idlwave-shell-path-query "__pa=expand_path(!path,/array)&for 
i=0,n_elements(__pa)-1 do print,'PATH:<'+__pa[i]+'>'&print,'SYSDIR:<'+!dir+'>'"
    "The command which gets !PATH and !DIR infor from the shell.")
  
  (defvar idlwave-shell-mode-line-info nil
!   "Additional info displayed in the mode line")  
  
  (defvar idlwave-shell-default-directory nil
    "The default directory in the idlwave-shell buffer, of outside use.")
--- 563,576 ----
  before use by the shell.")
  
  (defvar idlwave-shell-dirstack-query "cd,current=___cur & print,___cur"
!   "Command used by `idlwave-shell-resync-dirs' to query IDL for
  the directory stack.")
  
  (defvar idlwave-shell-path-query "__pa=expand_path(!path,/array)&for 
i=0,n_elements(__pa)-1 do print,'PATH:<'+__pa[i]+'>'&print,'SYSDIR:<'+!dir+'>'"
    "The command which gets !PATH and !DIR infor from the shell.")
  
  (defvar idlwave-shell-mode-line-info nil
!   "Additional info displayed in the mode line")
  
  (defvar idlwave-shell-default-directory nil
    "The default directory in the idlwave-shell buffer, of outside use.")
***************
*** 621,627 ****
            window-system)                ; Window systems always
      (progn
        (setq idlwave-shell-stop-line-overlay (make-overlay 1 1))
!       (overlay-put idlwave-shell-stop-line-overlay 
                   'face idlwave-shell-stop-line-face))))
  
   (t
--- 621,627 ----
            window-system)                ; Window systems always
      (progn
        (setq idlwave-shell-stop-line-overlay (make-overlay 1 1))
!       (overlay-put idlwave-shell-stop-line-overlay
                   'face idlwave-shell-stop-line-face))))
  
   (t
***************
*** 629,635 ****
    (if window-system
        (progn
        (setq idlwave-shell-stop-line-overlay (make-overlay 1 1))
!       (overlay-put idlwave-shell-stop-line-overlay 
                     'face idlwave-shell-stop-line-face)))))
  
  ;; Now the expression and output overlays
--- 629,635 ----
    (if window-system
        (progn
        (setq idlwave-shell-stop-line-overlay (make-overlay 1 1))
!       (overlay-put idlwave-shell-stop-line-overlay
                     'face idlwave-shell-stop-line-face)))))
  
  ;; Now the expression and output overlays
***************
*** 686,692 ****
  
  ;;; The following are the types of messages we attempt to catch to
  ;;; resync our idea of where IDL execution currently is.
! ;;; 
  
  (defvar idlwave-shell-halt-frame nil
    "The frame associated with halt/breakpoint messages.")
--- 686,692 ----
  
  ;;; The following are the types of messages we attempt to catch to
  ;;; resync our idea of where IDL execution currently is.
! ;;;
  
  (defvar idlwave-shell-halt-frame nil
    "The frame associated with halt/breakpoint messages.")
***************
*** 772,789 ****
     `\\[idlwave-routine-info]' displays information about an IDL routine near 
point,
     just like in `idlwave-mode'.  The module used is the one at point or
     the one whose argument list is being edited.
!    To update IDLWAVE's knowledge about compiled or edited modules, use 
     \\[idlwave-update-routine-info].
     \\[idlwave-find-module] find the source of a module.
     \\[idlwave-resolve] tells IDL to compile an unresolved module.
     \\[idlwave-context-help] shows the online help on the item at
     point, if online help has been installed.
!   
  
  4. Debugging
     ---------
     A complete set of commands for compiling and debugging IDL programs
!    is available from the menu.  Also keybindings starting with a 
     `C-c C-d' prefix are available for most commands in the *idl* buffer
     and also in source buffers.  The best place to learn about the
     keybindings is again the menu.
--- 772,789 ----
     `\\[idlwave-routine-info]' displays information about an IDL routine near 
point,
     just like in `idlwave-mode'.  The module used is the one at point or
     the one whose argument list is being edited.
!    To update IDLWAVE's knowledge about compiled or edited modules, use
     \\[idlwave-update-routine-info].
     \\[idlwave-find-module] find the source of a module.
     \\[idlwave-resolve] tells IDL to compile an unresolved module.
     \\[idlwave-context-help] shows the online help on the item at
     point, if online help has been installed.
! 
  
  4. Debugging
     ---------
     A complete set of commands for compiling and debugging IDL programs
!    is available from the menu.  Also keybindings starting with a
     `C-c C-d' prefix are available for most commands in the *idl* buffer
     and also in source buffers.  The best place to learn about the
     keybindings is again the menu.
***************
*** 910,916 ****
    (run-hooks 'idlwave-shell-mode-hook)
    (idlwave-shell-send-command idlwave-shell-initial-commands nil 'hide)
    ;; Define a system variable which knows the version of IDLWAVE
!   (idlwave-shell-send-command 
     (format "defsysv,'!idlwave_version','%s',1" idlwave-mode-version)
     nil 'hide)
    (if (and (not idlwave-path-alist)
--- 910,916 ----
    (run-hooks 'idlwave-shell-mode-hook)
    (idlwave-shell-send-command idlwave-shell-initial-commands nil 'hide)
    ;; Define a system variable which knows the version of IDLWAVE
!   (idlwave-shell-send-command
     (format "defsysv,'!idlwave_version','%s',1" idlwave-mode-version)
     nil 'hide)
    (if (and (not idlwave-path-alist)
***************
*** 955,962 ****
                         (frame (selected-frame)))
                     (catch 'exit
                       (while flist
!                        (if (not (eq (car flist) 
!                                     idlwave-shell-idl-wframe)) 
                             (throw 'exit (car flist))
                           (setq flist (cdr flist))))))
                   (make-frame))
--- 955,962 ----
                         (frame (selected-frame)))
                     (catch 'exit
                       (while flist
!                        (if (not (eq (car flist)
!                                     idlwave-shell-idl-wframe))
                             (throw 'exit (car flist))
                           (setq flist (cdr flist))))))
                   (make-frame))
***************
*** 974,982 ****
            ;; We do not have a source frame, so we use this one.
            (setq idlwave-shell-display-wframe (selected-frame)))
        ;; Return a new frame
!       (setq idlwave-shell-idl-wframe 
              (make-frame idlwave-shell-frame-parameters)))))
!   
  ;;;###autoload
  (defun idlwave-shell (&optional arg quick)
    "Run an inferior IDL, with I/O through buffer `(idlwave-shell-buffer)'.
--- 974,982 ----
            ;; We do not have a source frame, so we use this one.
            (setq idlwave-shell-display-wframe (selected-frame)))
        ;; Return a new frame
!       (setq idlwave-shell-idl-wframe
              (make-frame idlwave-shell-frame-parameters)))))
! 
  ;;;###autoload
  (defun idlwave-shell (&optional arg quick)
    "Run an inferior IDL, with I/O through buffer `(idlwave-shell-buffer)'.
***************
*** 1003,1016 ****
          (delete-other-windows))
        (and idlwave-shell-use-dedicated-frame
             (setq idlwave-shell-idl-wframe (selected-frame)))
!       (add-hook 'idlwave-shell-sentinel-hook 
                  'save-buffers-kill-emacs t))
  
      ;; A non-nil arg means, we want a dedicated frame.  This will last
      ;; for the current editing session.
      (if arg (setq idlwave-shell-use-dedicated-frame t))
      (if (equal arg '(16)) (setq idlwave-shell-use-dedicated-frame nil))
!     
      ;; Check if the process still exists.  If not, create it.
      (unless (comint-check-proc (idlwave-shell-buffer))
        (let* ((prg (or idlwave-shell-explicit-file-name "idl"))
--- 1003,1016 ----
          (delete-other-windows))
        (and idlwave-shell-use-dedicated-frame
             (setq idlwave-shell-idl-wframe (selected-frame)))
!       (add-hook 'idlwave-shell-sentinel-hook
                  'save-buffers-kill-emacs t))
  
      ;; A non-nil arg means, we want a dedicated frame.  This will last
      ;; for the current editing session.
      (if arg (setq idlwave-shell-use-dedicated-frame t))
      (if (equal arg '(16)) (setq idlwave-shell-use-dedicated-frame nil))
! 
      ;; Check if the process still exists.  If not, create it.
      (unless (comint-check-proc (idlwave-shell-buffer))
        (let* ((prg (or idlwave-shell-explicit-file-name "idl"))
***************
*** 1067,1078 ****
  prompt is present and if `idlwave-shell-ready' is non-nil."
  
  ;  (setq hide nil)  ;  FIXME: turn this on for debugging only
! ;  (if (null cmd) 
  ;      (progn
! ;     (message "SENDING Pending commands: %s" 
  ;              (prin1-to-string idlwave-shell-pending-commands)))
  ;    (message "SENDING %s|||%s" cmd pcmd))
!   (if (and (symbolp idlwave-shell-show-commands) 
           (eq idlwave-shell-show-commands 'everything))
        (setq hide nil))
    (let ((save-buffer (current-buffer))
--- 1067,1078 ----
  prompt is present and if `idlwave-shell-ready' is non-nil."
  
  ;  (setq hide nil)  ;  FIXME: turn this on for debugging only
! ;  (if (null cmd)
  ;      (progn
! ;     (message "SENDING Pending commands: %s"
  ;              (prin1-to-string idlwave-shell-pending-commands)))
  ;    (message "SENDING %s|||%s" cmd pcmd))
!   (if (and (symbolp idlwave-shell-show-commands)
           (eq idlwave-shell-show-commands 'everything))
        (setq hide nil))
    (let ((save-buffer (current-buffer))
***************
*** 1100,1106 ****
                    (append (list (list cmd pcmd hide))
                            idlwave-shell-pending-commands)
                  ;; Put at end.
!                 (append idlwave-shell-pending-commands 
                          (list (list cmd pcmd hide))))))
        ;; Check if IDL ready
        (let ((save-point (point-marker)))
--- 1100,1106 ----
                    (append (list (list cmd pcmd hide))
                            idlwave-shell-pending-commands)
                  ;; Put at end.
!                 (append idlwave-shell-pending-commands
                          (list (list cmd pcmd hide))))))
        ;; Check if IDL ready
        (let ((save-point (point-marker)))
***************
*** 1146,1152 ****
      (if (or (not (setq buf (get-buffer (idlwave-shell-buffer))))
            (not (setq proc (get-buffer-process buf))))
        (funcall errf "Shell is not running"))
!     (if (equal c ?\C-g)       
        (funcall errf "Abort")
        (comint-send-string proc (char-to-string c)))))
  
--- 1146,1152 ----
      (if (or (not (setq buf (get-buffer (idlwave-shell-buffer))))
            (not (setq proc (get-buffer-process buf))))
        (funcall errf "Shell is not running"))
!     (if (equal c ?\C-g)
        (funcall errf "Abort")
        (comint-send-string proc (char-to-string c)))))
  
***************
*** 1187,1193 ****
      (if idlwave-shell-ready
        (funcall errf "No IDL program seems to be waiting for input"))
  
!     ;; OK, start the loop 
      (message "Character mode on:  Sending single chars (`C-g' to exit)")
      (message
       (catch 'exit
--- 1187,1193 ----
      (if idlwave-shell-ready
        (funcall errf "No IDL program seems to be waiting for input"))
  
!     ;; OK, start the loop
      (message "Character mode on:  Sending single chars (`C-g' to exit)")
      (message
       (catch 'exit
***************
*** 1258,1264 ****
  
  (defvar idlwave-shell-hidden-output-buffer " *idlwave-shell-hidden-output*"
    "Buffer containing hidden output from IDL commands.")
!   
  (defun idlwave-shell-filter (proc string)
    "Replace Carriage returns in output. Watch for prompt.
  When the IDL prompt is received executes `idlwave-shell-post-command-hook'
--- 1258,1264 ----
  
  (defvar idlwave-shell-hidden-output-buffer " *idlwave-shell-hidden-output*"
    "Buffer containing hidden output from IDL commands.")
! 
  (defun idlwave-shell-filter (proc string)
    "Replace Carriage returns in output. Watch for prompt.
  When the IDL prompt is received executes `idlwave-shell-post-command-hook'
***************
*** 1284,1290 ****
  ;           (setq idlwave-shell-command-output
  ;                 (concat idlwave-shell-command-output string))
              ;; Insert the string. Do this before getting the
!             ;; state. 
            (while (setq p (string-match "\C-G" string))
              (ding)
              (aset string p ?\C-j ))
--- 1284,1290 ----
  ;           (setq idlwave-shell-command-output
  ;                 (concat idlwave-shell-command-output string))
              ;; Insert the string. Do this before getting the
!             ;; state.
            (while (setq p (string-match "\C-G" string))
              (ding)
              (aset string p ?\C-j ))
***************
*** 1303,1321 ****
                      (idlwave-shell-input-mode-magic
                       (concat idlwave-shell-accumulation string)))
                  (setq idlwave-shell-accumulation
!                       (substring string 
                                   (progn (string-match "\\(.*\n\\)*" string)
                                          (match-end 0)))))
                (setq idlwave-shell-accumulation
                      (concat idlwave-shell-accumulation string)))
!           
!           
  ;;; Test/Debug code
  ;          (save-excursion (set-buffer
  ;                           (get-buffer-create "*idlwave-shell-output*"))
  ;                          (goto-char (point-max))
  ;                          (insert "\nSTRING===>\n" string "\n<====\n"))
!           
            ;; Check for prompt in current accumulating output
            (if (setq idlwave-shell-ready
                      (string-match idlwave-shell-prompt-pattern
--- 1303,1321 ----
                      (idlwave-shell-input-mode-magic
                       (concat idlwave-shell-accumulation string)))
                  (setq idlwave-shell-accumulation
!                       (substring string
                                   (progn (string-match "\\(.*\n\\)*" string)
                                          (match-end 0)))))
                (setq idlwave-shell-accumulation
                      (concat idlwave-shell-accumulation string)))
! 
! 
  ;;; Test/Debug code
  ;          (save-excursion (set-buffer
  ;                           (get-buffer-create "*idlwave-shell-output*"))
  ;                          (goto-char (point-max))
  ;                          (insert "\nSTRING===>\n" string "\n<====\n"))
! 
            ;; Check for prompt in current accumulating output
            (if (setq idlwave-shell-ready
                      (string-match idlwave-shell-prompt-pattern
***************
*** 1329,1341 ****
                        (goto-char (match-end 0))
                        (setq idlwave-shell-command-output
                              (buffer-substring (point-min) (point)))
!                       
  ;;; Test/Debug
  ;                      (save-excursion (set-buffer
  ;                                       (get-buffer-create 
"*idlwave-shell-output*"))
  ;                                      (goto-char (point-max))
  ;                                      (insert "\nOUPUT===>\n" 
idlwave-shell-command-output "\n<===\n"))
!                       
                        (delete-region (point-min) (point)))
                      (setq idlwave-shell-command-output
                          (with-current-buffer (process-buffer proc)
--- 1329,1341 ----
                        (goto-char (match-end 0))
                        (setq idlwave-shell-command-output
                              (buffer-substring (point-min) (point)))
! 
  ;;; Test/Debug
  ;                      (save-excursion (set-buffer
  ;                                       (get-buffer-create 
"*idlwave-shell-output*"))
  ;                                      (goto-char (point-max))
  ;                                      (insert "\nOUPUT===>\n" 
idlwave-shell-command-output "\n<===\n"))
! 
                        (delete-region (point-min) (point)))
                      (setq idlwave-shell-command-output
                          (with-current-buffer (process-buffer proc)
***************
*** 1390,1396 ****
            (condition-case nil
                (comint-write-input-ring)
              (error nil)))))
!           
      (when (and (> (length (frame-list)) 1)
               (frame-live-p idlwave-shell-idl-wframe))
        (delete-frame idlwave-shell-idl-wframe)
--- 1390,1396 ----
            (condition-case nil
                (comint-write-input-ring)
              (error nil)))))
! 
      (when (and (> (length (frame-list)) 1)
               (frame-live-p idlwave-shell-idl-wframe))
        (delete-frame idlwave-shell-idl-wframe)
***************
*** 1419,1427 ****
    (cond
     ;; Make sure we have output
     ((not idlwave-shell-command-output))
!    
     ;; First Priority: Syntax and other errors
!    ((or 
       (string-match idlwave-shell-syntax-error idlwave-shell-command-output)
       (string-match idlwave-shell-other-error idlwave-shell-command-output))
      (save-excursion
--- 1419,1427 ----
    (cond
     ;; Make sure we have output
     ((not idlwave-shell-command-output))
! 
     ;; First Priority: Syntax and other errors
!    ((or
       (string-match idlwave-shell-syntax-error idlwave-shell-command-output)
       (string-match idlwave-shell-other-error idlwave-shell-command-output))
      (save-excursion
***************
*** 1432,1460 ****
        (goto-char (point-min))
        (setq idlwave-shell-error-last (point)))
      (idlwave-shell-goto-next-error))
!    
     ;; Second Priority: Various types of HALT messages.
     ((string-match idlwave-shell-halt-messages-re
                  idlwave-shell-command-output)
      ;; Grab the file and line state info.
      (setq idlwave-shell-calling-stack-index 0)
      (setq idlwave-shell-halt-frame
!         (idlwave-shell-parse-line 
           (substring idlwave-shell-command-output (match-end 0))))
      (idlwave-shell-display-line (idlwave-shell-pc-frame)))
!    
!    ;; Last Priority: Breakpoints 
     ((string-match idlwave-shell-break-message
                  idlwave-shell-command-output)
      (setq idlwave-shell-calling-stack-index 0)
!     (setq idlwave-shell-halt-frame 
!         (idlwave-shell-parse-line 
           (substring idlwave-shell-command-output (match-end 0))))
      ;; We used to count hits on breakpoints
      ;; this is no longer supported since IDL breakpoints
      ;; have learned counting.
      ;; Do breakpoint command processing
!     (let ((bp (assoc 
               (list
                (nth 0 idlwave-shell-halt-frame)
                (nth 1 idlwave-shell-halt-frame))
--- 1432,1460 ----
        (goto-char (point-min))
        (setq idlwave-shell-error-last (point)))
      (idlwave-shell-goto-next-error))
! 
     ;; Second Priority: Various types of HALT messages.
     ((string-match idlwave-shell-halt-messages-re
                  idlwave-shell-command-output)
      ;; Grab the file and line state info.
      (setq idlwave-shell-calling-stack-index 0)
      (setq idlwave-shell-halt-frame
!         (idlwave-shell-parse-line
           (substring idlwave-shell-command-output (match-end 0))))
      (idlwave-shell-display-line (idlwave-shell-pc-frame)))
! 
!    ;; Last Priority: Breakpoints
     ((string-match idlwave-shell-break-message
                  idlwave-shell-command-output)
      (setq idlwave-shell-calling-stack-index 0)
!     (setq idlwave-shell-halt-frame
!         (idlwave-shell-parse-line
           (substring idlwave-shell-command-output (match-end 0))))
      ;; We used to count hits on breakpoints
      ;; this is no longer supported since IDL breakpoints
      ;; have learned counting.
      ;; Do breakpoint command processing
!     (let ((bp (assoc
               (list
                (nth 0 idlwave-shell-halt-frame)
                (nth 1 idlwave-shell-halt-frame))
***************
*** 1477,1483 ****
  ;; in module and file names.  I am not sure if it will be necessary to
  ;; change this.  Currently it seems to work the way it is.
  (defvar idlwave-shell-syntax-error
!   "^% Syntax error.\\s-*\n\\s-*At:\\s-*\\(.*\\),\\s-*Line\\s-*\\(.*\\)"  
    "A regular expression to match an IDL syntax error.
  The first \(..\) pair should match the file name.  The second pair
  should match the line number.")
--- 1477,1483 ----
  ;; in module and file names.  I am not sure if it will be necessary to
  ;; change this.  Currently it seems to work the way it is.
  (defvar idlwave-shell-syntax-error
!   "^% Syntax error.\\s-*\n\\s-*At:\\s-*\\(.*\\),\\s-*Line\\s-*\\(.*\\)"
    "A regular expression to match an IDL syntax error.
  The first \(..\) pair should match the file name.  The second pair
  should match the line number.")
***************
*** 1489,1495 ****
  should match the line number.")
  
  (defvar idlwave-shell-file-line-message
!   (concat 
     "\\("                                 ; program name group (1)
     "\\<[a-zA-Z][a-zA-Z0-9_$:]*"          ; start with a letter, followed by 
[..]
     "\\([ \t]*\n[ \t]*[a-zA-Z0-9_$:]+\\)*"; continuation lines program name (2)
--- 1489,1495 ----
  should match the line number.")
  
  (defvar idlwave-shell-file-line-message
!   (concat
     "\\("                                 ; program name group (1)
     "\\<[a-zA-Z][a-zA-Z0-9_$:]*"          ; start with a letter, followed by 
[..]
     "\\([ \t]*\n[ \t]*[a-zA-Z0-9_$:]+\\)*"; continuation lines program name (2)
***************
*** 1506,1512 ****
     "\\)"                                 ; end line number group (5)
     )
    "*A regular expression to parse out the file name and line number.
! The 1st group should match the subroutine name.  
  The 3rd group is the line number.
  The 5th group is the file name.
  All parts may contain linebreaks surrounded by spaces.  This is important
--- 1506,1512 ----
     "\\)"                                 ; end line number group (5)
     )
    "*A regular expression to parse out the file name and line number.
! The 1st group should match the subroutine name.
  The 3rd group is the line number.
  The 5th group is the file name.
  All parts may contain linebreaks surrounded by spaces.  This is important
***************
*** 1518,1524 ****
  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:
  
--- 1518,1524 ----
  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:
  
***************
*** 1540,1546 ****
        (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))
--- 1540,1546 ----
        (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))
***************
*** 1566,1572 ****
  file name."
    (let ((file1 "") (file2 "") (start 0))
      ;; We scan no further than to the next "^%" line
!     (if (string-match "^%" file) 
        (setq file (substring file 0 (match-beginning 0))))
      ;; Take out the line breaks
      (while (string-match "[ \t]*\n[ \t]*" file start)
--- 1566,1572 ----
  file name."
    (let ((file1 "") (file2 "") (start 0))
      ;; We scan no further than to the next "^%" line
!     (if (string-match "^%" file)
        (setq file (substring file 0 (match-beginning 0))))
      ;; Take out the line breaks
      (while (string-match "[ \t]*\n[ \t]*" file start)
***************
*** 1621,1627 ****
  The size is given by `idlwave-shell-graphics-window-size'."
    (interactive "P")
    (let ((n (if n (prefix-numeric-value n) 0)))
!     (idlwave-shell-send-command 
       (apply 'format "window,%d,xs=%d,ys=%d"
            n idlwave-shell-graphics-window-size)
       nil (idlwave-shell-hide-p 'misc))))
--- 1621,1627 ----
  The size is given by `idlwave-shell-graphics-window-size'."
    (interactive "P")
    (let ((n (if n (prefix-numeric-value n) 0)))
!     (idlwave-shell-send-command
       (apply 'format "window,%d,xs=%d,ys=%d"
            n idlwave-shell-graphics-window-size)
       nil (idlwave-shell-hide-p 'misc))))
***************
*** 1659,1665 ****
  
  (defun idlwave-shell-reset (&optional hidden)
    "Reset IDL.  Return to main level and destroy the leftover variables.
! This issues the following commands:  
  RETALL
  WIDGET_CONTROL,/RESET
  CLOSE, /ALL
--- 1659,1665 ----
  
  (defun idlwave-shell-reset (&optional hidden)
    "Reset IDL.  Return to main level and destroy the leftover variables.
! This issues the following commands:
  RETALL
  WIDGET_CONTROL,/RESET
  CLOSE, /ALL
***************
*** 1708,1718 ****
              text (substring text (match-end 0)))
        ;; Set dummy values and kill the text
        (setq sep "@" sep-re "@ *" text "")
!       (message "Routine Info warning: No match for BEGIN line in 
\n>>>>\n%s\n<<<<\n" 
               idlwave-shell-command-output))
      (if (string-match "^>>>END OF IDLWAVE ROUTINE INFO.*" text)
        (setq text (substring text 0 (match-beginning 0)))
!       (message "Routine Info warning: No match for END line in 
\n>>>>\n%s\n<<<<\n" 
               idlwave-shell-command-output))
      (if (string-match "\\S-" text)
        ;; Obviously, the pro worked.  Make a note that we have it now.
--- 1708,1718 ----
              text (substring text (match-end 0)))
        ;; Set dummy values and kill the text
        (setq sep "@" sep-re "@ *" text "")
!       (message "Routine Info warning: No match for BEGIN line in 
\n>>>>\n%s\n<<<<\n"
               idlwave-shell-command-output))
      (if (string-match "^>>>END OF IDLWAVE ROUTINE INFO.*" text)
        (setq text (substring text 0 (match-beginning 0)))
!       (message "Routine Info warning: No match for END line in 
\n>>>>\n%s\n<<<<\n"
               idlwave-shell-command-output))
      (if (string-match "\\S-" text)
        ;; Obviously, the pro worked.  Make a note that we have it now.
***************
*** 1730,1741 ****
            key (nth 4 specs)
            keys (if (and (stringp key)
                          (not (string-match "\\` *\\'" key)))
!                    (mapcar 'list 
                             (delete "" (idlwave-split-string key " +")))))
        (setq name (idlwave-sintern-routine-or-method name class t)
            class (idlwave-sintern-class class t)
            file (if (equal file "") nil file)
!           keys (mapcar (lambda (x) 
                           (list (idlwave-sintern-keyword (car x) t))) keys))
        ;; Make sure we use the same string object for the same file
        (setq file (idlwave-sintern-file file t))
--- 1730,1741 ----
            key (nth 4 specs)
            keys (if (and (stringp key)
                          (not (string-match "\\` *\\'" key)))
!                    (mapcar 'list
                             (delete "" (idlwave-split-string key " +")))))
        (setq name (idlwave-sintern-routine-or-method name class t)
            class (idlwave-sintern-class class t)
            file (if (equal file "") nil file)
!           keys (mapcar (lambda (x)
                           (list (idlwave-sintern-keyword (car x) t))) keys))
        ;; Make sure we use the same string object for the same file
        (setq file (idlwave-sintern-file file t))
***************
*** 1747,1756 ****
  
        ;; In the following ignore routines already defined in buffers,
        ;; assuming that if the buffer stuff differs, it is a "new"
!       ;; version. 
        ;; We could do the same for the library to avoid duplicates -
        ;; but I think frequently a user might have several versions of
!       ;; the same function in different programs, and in this case the 
        ;; compiled one will be the best guess of all version.
        ;; Therefore, we leave duplicates of library routines in.
  
--- 1747,1756 ----
  
        ;; In the following ignore routines already defined in buffers,
        ;; assuming that if the buffer stuff differs, it is a "new"
!       ;; version.
        ;; We could do the same for the library to avoid duplicates -
        ;; but I think frequently a user might have several versions of
!       ;; the same function in different programs, and in this case the
        ;; compiled one will be the best guess of all version.
        ;; Therefore, we leave duplicates of library routines in.
  
***************
*** 1758,1781 ****
            ((and (string= type "PRO")
                  ;; FIXME: is it OK to make the buffer routines dominate?
                  (or t (null file)
!                     (not (idlwave-rinfo-assq name 'pro class 
                                               idlwave-buffer-routines)))
                  ;; FIXME: is it OK to make the library routines dominate?
!                 ;;(not (idlwave-rinfo-assq name 'pro class 
                  ;;                       idlwave-library-routines))
                  )
             (setq entry (list name 'pro class (cons 'compiled file) cs keys))
!            (if file 
                 (push entry idlwave-compiled-routines)
               (push entry idlwave-unresolved-routines)))
!              
            ((and (string= type "FUN")
                  ;; FIXME: is it OK to make the buffer routines dominate?
                  (or t (not file)
!                     (not (idlwave-rinfo-assq name 'fun class 
                                               idlwave-buffer-routines)))
                  ;; FIXME: is it OK to make the library routines dominate?
!                 ;; (not (idlwave-rinfo-assq name 'fun class 
                  ;;                       idlwave-library-routines))
                  )
             (setq entry (list name 'fun class (cons 'compiled file) cs keys))
--- 1758,1781 ----
            ((and (string= type "PRO")
                  ;; FIXME: is it OK to make the buffer routines dominate?
                  (or t (null file)
!                     (not (idlwave-rinfo-assq name 'pro class
                                               idlwave-buffer-routines)))
                  ;; FIXME: is it OK to make the library routines dominate?
!                 ;;(not (idlwave-rinfo-assq name 'pro class
                  ;;                       idlwave-library-routines))
                  )
             (setq entry (list name 'pro class (cons 'compiled file) cs keys))
!            (if file
                 (push entry idlwave-compiled-routines)
               (push entry idlwave-unresolved-routines)))
! 
            ((and (string= type "FUN")
                  ;; FIXME: is it OK to make the buffer routines dominate?
                  (or t (not file)
!                     (not (idlwave-rinfo-assq name 'fun class
                                               idlwave-buffer-routines)))
                  ;; FIXME: is it OK to make the library routines dominate?
!                 ;; (not (idlwave-rinfo-assq name 'fun class
                  ;;                       idlwave-library-routines))
                  )
             (setq entry (list name 'fun class (cons 'compiled file) cs keys))
***************
*** 1793,1799 ****
      (set-buffer (idlwave-shell-buffer))
      (if (string-match ",___cur[\n\r]\\(\\S-*\\) *[\n\r]"
                      idlwave-shell-command-output)
!       (let ((dir (substring idlwave-shell-command-output 
                              (match-beginning 1) (match-end 1))))
  ;       (message "Setting Emacs working dir to %s" dir)
          (setq idlwave-shell-default-directory dir)
--- 1793,1799 ----
      (set-buffer (idlwave-shell-buffer))
      (if (string-match ",___cur[\n\r]\\(\\S-*\\) *[\n\r]"
                      idlwave-shell-command-output)
!       (let ((dir (substring idlwave-shell-command-output
                              (match-beginning 1) (match-end 1))))
  ;       (message "Setting Emacs working dir to %s" dir)
          (setq idlwave-shell-default-directory dir)
***************
*** 1807,1816 ****
        expression)
      (save-excursion
        (goto-char apos)
!       (setq expression (buffer-substring 
                        (catch 'exit
                          (while t
!                           (if (not (re-search-backward 
                                      "[^][.A-Za-z0-9_() ]" bos t))
                                (throw 'exit bos)) ;ran into bos
                            (if (not (idlwave-is-pointer-dereference bol))
--- 1807,1816 ----
        expression)
      (save-excursion
        (goto-char apos)
!       (setq expression (buffer-substring
                        (catch 'exit
                          (while t
!                           (if (not (re-search-backward
                                      "[^][.A-Za-z0-9_() ]" bos t))
                                (throw 'exit bos)) ;ran into bos
                            (if (not (idlwave-is-pointer-dereference bol))
***************
*** 1838,1844 ****
                            idlwave-shell-command-output))
         (string-match (concat match "\\([A-Za-z_0-9]+\\)")
                       idlwave-shell-command-output))
!       (setq idlwave-shell-get-object-class 
              (match-string 1 idlwave-shell-command-output)))))
  
  
--- 1838,1844 ----
                            idlwave-shell-command-output))
         (string-match (concat match "\\([A-Za-z_0-9]+\\)")
                       idlwave-shell-command-output))
!       (setq idlwave-shell-get-object-class
              (match-string 1 idlwave-shell-command-output)))))
  
  
***************
*** 1867,1873 ****
             (let ((case-fold-search t))
               (not (looking-at ".*obj_new")))))
        (idlwave-shell-complete-filename))
!      
       (t
        ;; Default completion of modules and keywords
        (idlwave-complete arg)))))
--- 1867,1873 ----
             (let ((case-fold-search t))
               (not (looking-at ".*obj_new")))))
        (idlwave-shell-complete-filename))
! 
       (t
        ;; Default completion of modules and keywords
        (idlwave-complete arg)))))
***************
*** 1877,1883 ****
  We assume that we are after a file name when completing one of the
  args of an executive .run, .rnew or .compile."
    ;; CWD might have changed, resync, to set default directory
!   (idlwave-shell-resync-dirs) 
    (let ((comint-file-name-chars idlwave-shell-file-name-chars))
      (comint-dynamic-complete-as-filename)))
  
--- 1877,1883 ----
  We assume that we are after a file name when completing one of the
  args of an executive .run, .rnew or .compile."
    ;; CWD might have changed, resync, to set default directory
!   (idlwave-shell-resync-dirs)
    (let ((comint-file-name-chars idlwave-shell-file-name-chars))
      (comint-dynamic-complete-as-filename)))
  
***************
*** 1912,1918 ****
  
  (defun idlwave-shell-redisplay (&optional hide)
    "Tries to resync the display with where execution has stopped.
! Issues a \"help,/trace\" command followed by a call to 
  `idlwave-shell-display-line'.  Also updates the breakpoint
  overlays."
    (interactive)
--- 1912,1918 ----
  
  (defun idlwave-shell-redisplay (&optional hide)
    "Tries to resync the display with where execution has stopped.
! Issues a \"help,/trace\" command followed by a call to
  `idlwave-shell-display-line'.  Also updates the breakpoint
  overlays."
    (interactive)
***************
*** 1925,1931 ****
    (idlwave-shell-bp-query))
  
  (defun idlwave-shell-display-level-in-calling-stack (&optional hide)
!   (idlwave-shell-send-command 
     "help,/trace"
     `(progn
        ;; scanning for the state will reset the stack level - restore it
--- 1925,1931 ----
    (idlwave-shell-bp-query))
  
  (defun idlwave-shell-display-level-in-calling-stack (&optional hide)
!   (idlwave-shell-send-command
     "help,/trace"
     `(progn
        ;; scanning for the state will reset the stack level - restore it
***************
*** 1956,1966 ****
        (setq idlwave-shell-calling-stack-index nmin
            message (format "%d is the current calling stack level - can't go 
further down"
                            (- nmin)))))
!     (setq idlwave-shell-calling-stack-routine 
          (nth 2 (nth idlwave-shell-calling-stack-index stack)))
!     (idlwave-shell-display-line 
       (nth idlwave-shell-calling-stack-index stack))
!     (message (or message 
                 (format "In routine %s (stack level %d)"
                         idlwave-shell-calling-stack-routine
                         (- idlwave-shell-calling-stack-index))))))
--- 1956,1966 ----
        (setq idlwave-shell-calling-stack-index nmin
            message (format "%d is the current calling stack level - can't go 
further down"
                            (- nmin)))))
!     (setq idlwave-shell-calling-stack-routine
          (nth 2 (nth idlwave-shell-calling-stack-index stack)))
!     (idlwave-shell-display-line
       (nth idlwave-shell-calling-stack-index stack))
!     (message (or message
                 (format "In routine %s (stack level %d)"
                         idlwave-shell-calling-stack-routine
                         (- idlwave-shell-calling-stack-index))))))
***************
*** 1991,1997 ****
  (defun idlwave-shell-pc-frame ()
    "Returns the frame for IDL execution."
    (and idlwave-shell-halt-frame
!        (list (nth 0 idlwave-shell-halt-frame) 
             (nth 1 idlwave-shell-halt-frame)
             (nth 2 idlwave-shell-halt-frame))))
  
--- 1991,1997 ----
  (defun idlwave-shell-pc-frame ()
    "Returns the frame for IDL execution."
    (and idlwave-shell-halt-frame
!        (list (nth 0 idlwave-shell-halt-frame)
             (nth 1 idlwave-shell-halt-frame)
             (nth 2 idlwave-shell-halt-frame))))
  
***************
*** 2006,2012 ****
  If FRAME is nil then remove overlay."
    (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)
--- 2006,2012 ----
  If FRAME is nil then remove overlay."
    (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)
***************
*** 2019,2028 ****
  ;;;
  ;;; 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))
--- 2019,2028 ----
  ;;;
  ;;; 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))
***************
*** 2056,2062 ****
                (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
--- 2056,2062 ----
                (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
***************
*** 2070,2078 ****
        ;; 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 is displayed.
!         (if (and (equal (buffer-name) (idlwave-shell-buffer)) 
                 (not select-shell))
              (select-window window))))))
  
--- 2070,2078 ----
        ;; 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 is displayed.
!         (if (and (equal (buffer-name) (idlwave-shell-buffer))
                 (not select-shell))
              (select-window window))))))
  
***************
*** 2082,2116 ****
    (interactive "p")
    (or (not arg) (< arg 1)
        (setq arg 1))
!   (idlwave-shell-send-command 
     (concat ".s " (if (integerp arg) (int-to-string arg) arg))
     nil (idlwave-shell-hide-p 'debug)))
  
  (defun idlwave-shell-stepover (arg)
    "Stepover one source line.
! If given prefix argument ARG, step ARG source lines. 
  Uses IDL's stepover executive command which does not enter called functions."
    (interactive "p")
    (or (not arg) (< arg 1)
        (setq arg 1))
!   (idlwave-shell-send-command 
     (concat ".so " (if (integerp arg) (int-to-string arg) arg))
     nil (idlwave-shell-hide-p 'debug)))
  
  (defun idlwave-shell-break-here (&optional count cmd condition)
!   "Set breakpoint at current line.  
  
  If Count is nil then an ordinary breakpoint is set.  We treat a count
  of 1 as a temporary breakpoint using the ONCE keyword.  Counts greater
  than 1 use the IDL AFTER=count keyword to break only after reaching
  the statement count times.
  
! Optional argument CMD is a list or function to evaluate upon reaching 
  the breakpoint."
!   
    (interactive "P")
    (when (listp count)
!     (if (equal (car count) 4) 
        (setq condition (read-string "Break Condition: ")))
      (setq count nil))
    (idlwave-shell-set-bp
--- 2082,2116 ----
    (interactive "p")
    (or (not arg) (< arg 1)
        (setq arg 1))
!   (idlwave-shell-send-command
     (concat ".s " (if (integerp arg) (int-to-string arg) arg))
     nil (idlwave-shell-hide-p 'debug)))
  
  (defun idlwave-shell-stepover (arg)
    "Stepover one source line.
! If given prefix argument ARG, step ARG source lines.
  Uses IDL's stepover executive command which does not enter called functions."
    (interactive "p")
    (or (not arg) (< arg 1)
        (setq arg 1))
!   (idlwave-shell-send-command
     (concat ".so " (if (integerp arg) (int-to-string arg) arg))
     nil (idlwave-shell-hide-p 'debug)))
  
  (defun idlwave-shell-break-here (&optional count cmd condition)
!   "Set breakpoint at current line.
  
  If Count is nil then an ordinary breakpoint is set.  We treat a count
  of 1 as a temporary breakpoint using the ONCE keyword.  Counts greater
  than 1 use the IDL AFTER=count keyword to break only after reaching
  the statement count times.
  
! Optional argument CMD is a list or function to evaluate upon reaching
  the breakpoint."
! 
    (interactive "P")
    (when (listp count)
!     (if (equal (car count) 4)
        (setq condition (read-string "Break Condition: ")))
      (setq count nil))
    (idlwave-shell-set-bp
***************
*** 2132,2138 ****
        (progn
          (if (progn
                (beep)
!               (y-or-n-p 
                 (concat "Okay to recompile file "
                         (idlwave-shell-bp-get bp 'file) " ")))
              ;; Recompile
--- 2132,2138 ----
        (progn
          (if (progn
                (beep)
!               (y-or-n-p
                 (concat "Okay to recompile file "
                         (idlwave-shell-bp-get bp 'file) " ")))
              ;; Recompile
***************
*** 2140,2146 ****
                ;; Clean up before retrying
                (idlwave-shell-command-failure)
                (idlwave-shell-send-command
!                (concat ".run " (idlwave-shell-bp-get bp 'file)) nil 
               (idlwave-shell-hide-p 'run))
                ;; Try setting breakpoint again
                (idlwave-shell-set-bp bp))
--- 2140,2146 ----
                ;; Clean up before retrying
                (idlwave-shell-command-failure)
                (idlwave-shell-send-command
!                (concat ".run " (idlwave-shell-bp-get bp 'file)) nil
               (idlwave-shell-hide-p 'run))
                ;; Try setting breakpoint again
                (idlwave-shell-set-bp bp))
***************
*** 2192,2198 ****
      (if index
          (progn
            (idlwave-shell-send-command
!            (concat "breakpoint,/clear," 
                   (if (integerp index) (int-to-string index) index))
           nil (idlwave-shell-hide-p 'breakpoint))
          (idlwave-shell-bp-query)))))
--- 2192,2198 ----
      (if index
          (progn
            (idlwave-shell-send-command
!            (concat "breakpoint,/clear,"
                   (if (integerp index) (int-to-string index) index))
           nil (idlwave-shell-hide-p 'breakpoint))
          (idlwave-shell-bp-query)))))
***************
*** 2245,2257 ****
  If ENABLE is non-nil, enable them instead."
    (let  ((bpl idlwave-shell-bp-alist))
      (while bpl
!       (idlwave-shell-send-command 
         (concat "breakpoint,"
               (if enable "/enable," "/disable," )
               (idlwave-shell-bp-get (car bpl)))
         nil (idlwave-shell-hide-p 'breakpoint))
        (setq bpl (cdr bpl)))))
!   
  (defun idlwave-shell-to-here ()
    "Set a breakpoint with count 1 then continue."
    (interactive)
--- 2245,2257 ----
  If ENABLE is non-nil, enable them instead."
    (let  ((bpl idlwave-shell-bp-alist))
      (while bpl
!       (idlwave-shell-send-command
         (concat "breakpoint,"
               (if enable "/enable," "/disable," )
               (idlwave-shell-bp-get (car bpl)))
         nil (idlwave-shell-hide-p 'breakpoint))
        (setq bpl (cdr bpl)))))
! 
  (defun idlwave-shell-to-here ()
    "Set a breakpoint with count 1 then continue."
    (interactive)
***************
*** 2282,2288 ****
  (defun idlwave-shell-set-bp-in-module (module)
    "Set breakpoint in module.  Assumes that `idlwave-shell-sources-alist'
  contains an entry for that module."
!   (let ((source-file (car-safe 
                      (cdr-safe
                       (assoc (upcase module)
                              idlwave-shell-sources-alist))))
--- 2282,2288 ----
  (defun idlwave-shell-set-bp-in-module (module)
    "Set breakpoint in module.  Assumes that `idlwave-shell-sources-alist'
  contains an entry for that module."
!   (let ((source-file (car-safe
                      (cdr-safe
                       (assoc (upcase module)
                              idlwave-shell-sources-alist))))
***************
*** 2301,2307 ****
        (save-excursion
          (goto-char (point-min))
          (let ((case-fold-search t))
!           (if (re-search-forward 
                 (concat "^[ \t]*\\(pro\\|function\\)[ \t]+"
                         (downcase module)
                         "[ \t\n,]") nil t)
--- 2301,2307 ----
        (save-excursion
          (goto-char (point-min))
          (let ((case-fold-search t))
!           (if (re-search-forward
                 (concat "^[ \t]*\\(pro\\|function\\)[ \t]+"
                         (downcase module)
                         "[ \t\n,]") nil t)
***************
*** 2357,2363 ****
       (interactive "e")
       (let ((transient-mark-mode t)
           (zmacs-regions t)
!          (tracker (if (featurep 'xemacs) 'mouse-track 
                      'mouse-drag-region)))
         (funcall tracker event)
         (idlwave-shell-print (if (idlwave-region-active-p) '(16) nil)
--- 2357,2363 ----
       (interactive "e")
       (let ((transient-mark-mode t)
           (zmacs-regions t)
!          (tracker (if (featurep 'xemacs) 'mouse-track
                      'mouse-drag-region)))
         (funcall tracker event)
         (idlwave-shell-print (if (idlwave-region-active-p) '(16) nil)
***************
*** 2393,2399 ****
    "Label to include with examine text if separate.")
  
  (defun idlwave-shell-print (arg &optional help ev)
!   "Print current expression.  
  
  With HELP non-nil, show help on expression.  If HELP is a string,
  the expression will be put in place of ___, e.g.:
--- 2393,2399 ----
    "Label to include with examine text if separate.")
  
  (defun idlwave-shell-print (arg &optional help ev)
!   "Print current expression.
  
  With HELP non-nil, show help on expression.  If HELP is a string,
  the expression will be put in place of ___, e.g.:
***************
*** 2420,2430 ****
    (save-excursion
      (let* ((process (get-buffer-process (current-buffer)))
           (process-mark (if process (process-mark process)))
!          (stack-label 
            (if (and (integerp idlwave-shell-calling-stack-index)
                     (> idlwave-shell-calling-stack-index 0))
!               (format "  [-%d:%s]" 
!                       idlwave-shell-calling-stack-index 
                        idlwave-shell-calling-stack-routine)))
           expr beg end cmd examine-hook)
        (cond
--- 2420,2430 ----
    (save-excursion
      (let* ((process (get-buffer-process (current-buffer)))
           (process-mark (if process (process-mark process)))
!          (stack-label
            (if (and (integerp idlwave-shell-calling-stack-index)
                     (> idlwave-shell-calling-stack-index 0))
!               (format "  [-%d:%s]"
!                       idlwave-shell-calling-stack-index
                        idlwave-shell-calling-stack-routine)))
           expr beg end cmd examine-hook)
        (cond
***************
*** 2454,2460 ****
           ;; an array
           (forward-sexp))
         (setq end (point)))))
!       
        ;; Get expression, but first move the begin mark if a
        ;; process-mark is inside the region, to keep the overlay from
        ;; wandering in the Shell.
--- 2454,2460 ----
           ;; an array
           (forward-sexp))
         (setq end (point)))))
! 
        ;; Get expression, but first move the begin mark if a
        ;; process-mark is inside the region, to keep the overlay from
        ;; wandering in the Shell.
***************
*** 2465,2481 ****
  
        ;; Show the overlay(s) and attach any necessary hooks and filters
        (when (and beg end idlwave-shell-expression-overlay)
!       (move-overlay idlwave-shell-expression-overlay beg end 
                      (current-buffer))
!       (add-hook 'pre-command-hook 
                  'idlwave-shell-delete-expression-overlay))
!       (setq examine-hook 
            (if idlwave-shell-separate-examine-output
                'idlwave-shell-examine-display
              'idlwave-shell-examine-highlight))
        (add-hook 'pre-command-hook
                'idlwave-shell-delete-output-overlay)
!       
        ;; Remove empty or comment-only lines
        (while (string-match "\n[ \t]*\\(;.*\\)?\r*\n" expr)
        (setq expr (replace-match "\n" t t expr)))
--- 2465,2481 ----
  
        ;; Show the overlay(s) and attach any necessary hooks and filters
        (when (and beg end idlwave-shell-expression-overlay)
!       (move-overlay idlwave-shell-expression-overlay beg end
                      (current-buffer))
!       (add-hook 'pre-command-hook
                  'idlwave-shell-delete-expression-overlay))
!       (setq examine-hook
            (if idlwave-shell-separate-examine-output
                'idlwave-shell-examine-display
              'idlwave-shell-examine-highlight))
        (add-hook 'pre-command-hook
                'idlwave-shell-delete-output-overlay)
! 
        ;; Remove empty or comment-only lines
        (while (string-match "\n[ \t]*\\(;.*\\)?\r*\n" expr)
        (setq expr (replace-match "\n" t t expr)))
***************
*** 2487,2507 ****
          (setq expr (replace-match "" t t expr)))
        ;; Pop-up the examine selection list, if appropriate
        (if (and ev idlwave-shell-examine-alist)
!         (let* ((help-cons 
!                 (assoc 
!                  (idlwave-popup-select 
                    ev (mapcar 'car idlwave-shell-examine-alist)
                    "Examine with")
                   idlwave-shell-examine-alist)))
            (setq help (cdr help-cons))
            (if idlwave-shell-separate-examine-output
!               (setq idlwave-shell-examine-label 
!                     (concat 
                       (format "==>%s<==\n%s:" expr (car help-cons))
                       stack-label "\n"))))
        (setq idlwave-shell-examine-label
              (concat
!              (format "==>%s<==\n%s:" expr 
                       (cond ((null help) "print")
                             ((stringp help) help)
                             (t (symbol-name help))))
--- 2487,2507 ----
          (setq expr (replace-match "" t t expr)))
        ;; Pop-up the examine selection list, if appropriate
        (if (and ev idlwave-shell-examine-alist)
!         (let* ((help-cons
!                 (assoc
!                  (idlwave-popup-select
                    ev (mapcar 'car idlwave-shell-examine-alist)
                    "Examine with")
                   idlwave-shell-examine-alist)))
            (setq help (cdr help-cons))
            (if idlwave-shell-separate-examine-output
!               (setq idlwave-shell-examine-label
!                     (concat
                       (format "==>%s<==\n%s:" expr (car help-cons))
                       stack-label "\n"))))
        (setq idlwave-shell-examine-label
              (concat
!              (format "==>%s<==\n%s:" expr
                       (cond ((null help) "print")
                             ((stringp help) help)
                             (t (symbol-name help))))
***************
*** 2516,2524 ****
                     help))
        (setq cmd (idlwave-shell-help-statement help expr)))
        ;(idlwave-shell-recenter-shell-window)
!       (idlwave-shell-send-command 
!        cmd 
!        examine-hook 
         (if idlwave-shell-separate-examine-output 'hide)))))
  
  (defvar idlwave-shell-examine-window-alist nil
--- 2516,2524 ----
                     help))
        (setq cmd (idlwave-shell-help-statement help expr)))
        ;(idlwave-shell-recenter-shell-window)
!       (idlwave-shell-send-command
!        cmd
!        examine-hook
         (if idlwave-shell-separate-examine-output 'hide)))))
  
  (defvar idlwave-shell-examine-window-alist nil
***************
*** 2541,2549 ****
          (let* ((end (or
                       (re-search-backward idlwave-shell-prompt-pattern nil t)
                       (point-max)))
!                (beg (progn 
                        (goto-char
!                        (or (progn (if (re-search-backward 
                                         idlwave-shell-prompt-pattern nil t)
                                        (match-end 0)))
                             (point-min)))
--- 2541,2549 ----
          (let* ((end (or
                       (re-search-backward idlwave-shell-prompt-pattern nil t)
                       (point-max)))
!                (beg (progn
                        (goto-char
!                        (or (progn (if (re-search-backward
                                         idlwave-shell-prompt-pattern nil t)
                                        (match-end 0)))
                             (point-min)))
***************
*** 2560,2580 ****
        (setq buffer-read-only t)
        (move-overlay idlwave-shell-output-overlay cur-beg cur-end
                      (current-buffer))
!       
        ;; Look for the examine buffer in all windows.  If one is
        ;; found in a frame all by itself, use that, otherwise, switch
        ;; to or create an examine window in this frame, and resize if
        ;; it's a newly created window
        (let* ((winlist (get-buffer-window-list "*Examine*" nil 'visible)))
!         (setq win (idlwave-display-buffer 
!                    "*Examine*" 
                     nil
                     (let ((list winlist) thiswin)
                       (catch 'exit
                         (save-selected-window
                           (while (setq thiswin (pop list))
                             (select-window thiswin)
!                            (if (one-window-p) 
                                 (throw 'exit (window-frame thiswin)))))))))
          (set-window-start win (point-min)) ; Ensure the point is visible.
          (save-selected-window
--- 2560,2580 ----
        (setq buffer-read-only t)
        (move-overlay idlwave-shell-output-overlay cur-beg cur-end
                      (current-buffer))
! 
        ;; Look for the examine buffer in all windows.  If one is
        ;; found in a frame all by itself, use that, otherwise, switch
        ;; to or create an examine window in this frame, and resize if
        ;; it's a newly created window
        (let* ((winlist (get-buffer-window-list "*Examine*" nil 'visible)))
!         (setq win (idlwave-display-buffer
!                    "*Examine*"
                     nil
                     (let ((list winlist) thiswin)
                       (catch 'exit
                         (save-selected-window
                           (while (setq thiswin (pop list))
                             (select-window thiswin)
!                            (if (one-window-p)
                                 (throw 'exit (window-frame thiswin)))))))))
          (set-window-start win (point-min)) ; Ensure the point is visible.
          (save-selected-window
***************
*** 2595,2601 ****
                ;; And add the new value.
                (if (setq elt (assoc win idlwave-shell-examine-window-alist))
                    (setcdr elt (window-height))
!                 (add-to-list 'idlwave-shell-examine-window-alist 
                               (cons win (window-height)))))))))
        ;; Recenter for maximum output, after widened
        (save-selected-window
--- 2595,2601 ----
                ;; And add the new value.
                (if (setq elt (assoc win idlwave-shell-examine-window-alist))
                    (setcdr elt (window-height))
!                 (add-to-list 'idlwave-shell-examine-window-alist
                               (cons win (window-height)))))))))
        ;; Recenter for maximum output, after widened
        (save-selected-window
***************
*** 2617,2623 ****
  
  (defun idlwave-shell-examine-display-clear ()
    (interactive)
!   (save-excursion 
      (let ((buf (get-buffer "*Examine*")))
        (when (bufferp buf)
        (set-buffer buf)
--- 2617,2623 ----
  
  (defun idlwave-shell-examine-display-clear ()
    (interactive)
!   (save-excursion
      (let ((buf (get-buffer "*Examine*")))
        (when (bufferp buf)
        (set-buffer buf)
***************
*** 2647,2653 ****
      ;; break.  We will look for identifiers and exclude cases where we
      ;; know it is not a variable.  To distinguish array references from
      ;; function calls, we require that arrays use [] instead of ()
!     
      (while (string-match
            
"\\(\\`\\|[^a-zA-Z0-9$_]\\)\\([a-zA-Z][a-zA-Z0-9$_]*\\)\\([^a-zA-Z0-9$_]\\|\\'\\)"
 expr start)
        (setq var (match-string 2 expr)
--- 2647,2653 ----
      ;; break.  We will look for identifiers and exclude cases where we
      ;; know it is not a variable.  To distinguish array references from
      ;; function calls, we require that arrays use [] instead of ()
! 
      (while (string-match
            
"\\(\\`\\|[^a-zA-Z0-9$_]\\)\\([a-zA-Z][a-zA-Z0-9$_]*\\)\\([^a-zA-Z0-9$_]\\|\\'\\)"
 expr start)
        (setq var (match-string 2 expr)
***************
*** 2688,2700 ****
  size(___,/DIMENSIONS)"
    (cond
     ((null help) (concat "print, " expr))
!    ((stringp help) 
      (if (string-match "\\(^\\|[^_]\\)\\(___\\)\\([^_]\\|$\\)" help)
        (concat (substring help 0 (match-beginning 2))
                expr
                (substring help (match-end 2)))))
     (t (concat "help, " expr))))
!    
  
  (defun idlwave-shell-examine-highlight ()
    "Highlight the most recent IDL output."
--- 2688,2700 ----
  size(___,/DIMENSIONS)"
    (cond
     ((null help) (concat "print, " expr))
!    ((stringp help)
      (if (string-match "\\(^\\|[^_]\\)\\(___\\)\\([^_]\\|$\\)" help)
        (concat (substring help 0 (match-beginning 2))
                expr
                (substring help (match-end 2)))))
     (t (concat "help, " expr))))
! 
  
  (defun idlwave-shell-examine-highlight ()
    "Highlight the most recent IDL output."
***************
*** 2702,2708 ****
         (process (get-buffer-process buffer))
         (process-mark (if process (process-mark process)))
         output-begin output-end)
!     (save-excursion 
        (set-buffer buffer)
        (goto-char process-mark)
        (beginning-of-line)
--- 2702,2708 ----
         (process (get-buffer-process buffer))
         (process-mark (if process (process-mark process)))
         output-begin output-end)
!     (save-excursion
        (set-buffer buffer)
        (goto-char process-mark)
        (beginning-of-line)
***************
*** 2710,2721 ****
        (re-search-backward idlwave-shell-prompt-pattern nil t)
        (beginning-of-line 2)
        (setq output-begin (point)))
!           
      ;; First make sure the shell window is visible
      (idlwave-display-buffer (idlwave-shell-buffer)
                            nil (idlwave-shell-shell-frame))
      (if (and idlwave-shell-output-overlay process-mark)
!       (move-overlay idlwave-shell-output-overlay 
                      output-begin output-end buffer))))
  
  (defun idlwave-shell-delete-output-overlay ()
--- 2710,2721 ----
        (re-search-backward idlwave-shell-prompt-pattern nil t)
        (beginning-of-line 2)
        (setq output-begin (point)))
! 
      ;; First make sure the shell window is visible
      (idlwave-display-buffer (idlwave-shell-buffer)
                            nil (idlwave-shell-shell-frame))
      (if (and idlwave-shell-output-overlay process-mark)
!       (move-overlay idlwave-shell-output-overlay
                      output-begin output-end buffer))))
  
  (defun idlwave-shell-delete-output-overlay ()
***************
*** 2726,2732 ****
            (delete-overlay idlwave-shell-output-overlay))
        (error nil))
      (remove-hook 'pre-command-hook 'idlwave-shell-delete-output-overlay)))
!   
  (defun idlwave-shell-delete-expression-overlay ()
    (if (eq this-command 'idlwave-shell-mouse-nop)
        nil
--- 2726,2732 ----
            (delete-overlay idlwave-shell-output-overlay))
        (error nil))
      (remove-hook 'pre-command-hook 'idlwave-shell-delete-output-overlay)))
! 
  (defun idlwave-shell-delete-expression-overlay ()
    (if (eq this-command 'idlwave-shell-mouse-nop)
        nil
***************
*** 2754,2760 ****
  
  count - number of times to execute breakpoint. When count reaches 0
  the breakpoint is cleared and removed from the alist.
! command - command to execute when breakpoint is reached, either a 
  lisp function to be called with `funcall' with no arguments or a
  list to be evaluated with `eval'.")
  
--- 2754,2760 ----
  
  count - number of times to execute breakpoint. When count reaches 0
  the breakpoint is cleared and removed from the alist.
! command - command to execute when breakpoint is reached, either a
  lisp function to be called with `funcall' with no arguments or a
  list to be evaluated with `eval'.")
  
***************
*** 2785,2791 ****
    (idlwave-shell-send-command (concat ".run " idlwave-shell-temp-pro-file)
                              nil (idlwave-shell-hide-p 'run))
    (if n
!       (idlwave-display-buffer (idlwave-shell-buffer) 
                              nil (idlwave-shell-shell-frame))))
  
  (defun idlwave-shell-evaluate-region (beg end &optional n)
--- 2785,2791 ----
    (idlwave-shell-send-command (concat ".run " idlwave-shell-temp-pro-file)
                              nil (idlwave-shell-hide-p 'run))
    (if n
!       (idlwave-display-buffer (idlwave-shell-buffer)
                              nil (idlwave-shell-shell-frame))))
  
  (defun idlwave-shell-evaluate-region (beg end &optional n)
***************
*** 2796,2802 ****
    (interactive "r\nP")
    (idlwave-shell-send-command (buffer-substring beg end))
    (if n
!       (idlwave-display-buffer (idlwave-shell-buffer) 
                              nil (idlwave-shell-shell-frame))))
  
  (defun idlwave-shell-delete-temp-files ()
--- 2796,2802 ----
    (interactive "r\nP")
    (idlwave-shell-send-command (buffer-substring beg end))
    (if n
!       (idlwave-display-buffer (idlwave-shell-buffer)
                              nil (idlwave-shell-shell-frame))))
  
  (defun idlwave-shell-delete-temp-files ()
***************
*** 2883,2906 ****
          ;; In IDL 5.5, the breakpoint reporting format changed.
          (bp-re54 "^[ \t]*\\([0-9]+\\)[ \t]+\\(\\S-+\\)?[ \t]+\\([0-9]+\\)[ 
\t]+\\(\\S-+\\)")
          (bp-re55 
"^\\s-*\\([0-9]+\\)\\s-+\\([0-9]+\\)\\s-+\\(Uncompiled\\|Func=\\|Pro=\\)\\([a-zA-Z][a-zA-Z0-9$_:]*\\)\\(,[^\n]*\n\\)?\\s-+\\(\\S-+\\)")
!         file line index module 
          bp-re indmap)
        (setq idlwave-shell-bp-alist (list nil))
        ;; Search for either header type, and set the correct regexp
!       (when (or 
             (if (re-search-forward "^\\s-*Index.*\n\\s-*-" nil t)
!                (setq bp-re bp-re54    ; versions <= 5.4 
                       indmap '(1 2 3 4)))
!            (if (re-search-forward 
                  "^\\s-*Index\\s-*Line\\s-*Attributes\\s-*File" nil t)
                 (setq bp-re bp-re55    ; versions >= 5.5
                       indmap '(1 4 2 6))))
        ;; There seems to be a breakpoint listing here.
        ;; Parse breakpoint lines.
!       ;; Breakpoints have the form 
          ;;    for IDL<=v5.4:
        ;;  Index Module Line File
!       ;;  All separated by whitespace. 
        ;;  Module may be missing if the file is not compiled.
          ;;    for IDL>=v5.5:
        ;;  Index Line Attributes File
--- 2883,2906 ----
          ;; In IDL 5.5, the breakpoint reporting format changed.
          (bp-re54 "^[ \t]*\\([0-9]+\\)[ \t]+\\(\\S-+\\)?[ \t]+\\([0-9]+\\)[ 
\t]+\\(\\S-+\\)")
          (bp-re55 
"^\\s-*\\([0-9]+\\)\\s-+\\([0-9]+\\)\\s-+\\(Uncompiled\\|Func=\\|Pro=\\)\\([a-zA-Z][a-zA-Z0-9$_:]*\\)\\(,[^\n]*\n\\)?\\s-+\\(\\S-+\\)")
!         file line index module
          bp-re indmap)
        (setq idlwave-shell-bp-alist (list nil))
        ;; Search for either header type, and set the correct regexp
!       (when (or
             (if (re-search-forward "^\\s-*Index.*\n\\s-*-" nil t)
!                (setq bp-re bp-re54    ; versions <= 5.4
                       indmap '(1 2 3 4)))
!            (if (re-search-forward
                  "^\\s-*Index\\s-*Line\\s-*Attributes\\s-*File" nil t)
                 (setq bp-re bp-re55    ; versions >= 5.5
                       indmap '(1 4 2 6))))
        ;; There seems to be a breakpoint listing here.
        ;; Parse breakpoint lines.
!       ;; Breakpoints have the form
          ;;    for IDL<=v5.4:
        ;;  Index Module Line File
!       ;;  All separated by whitespace.
        ;;  Module may be missing if the file is not compiled.
          ;;    for IDL>=v5.5:
        ;;  Index Line Attributes File
***************
*** 2965,2975 ****
  line specified by BP or at the next IDL statement if that line is not
  a statement.
  Determines IDL's internal representation for the breakpoint which may
! have occured at a different line then used with the breakpoint
  command."
!   
    ;; Get and save the old breakpoints
!   (idlwave-shell-send-command 
     idlwave-shell-bp-query
     '(progn
        (idlwave-shell-filter-bp)
--- 2965,2975 ----
  line specified by BP or at the next IDL statement if that line is not
  a statement.
  Determines IDL's internal representation for the breakpoint which may
! have occurred at a different line then used with the breakpoint
  command."
! 
    ;; Get and save the old breakpoints
!   (idlwave-shell-send-command
     idlwave-shell-bp-query
     '(progn
        (idlwave-shell-filter-bp)
***************
*** 2987,2993 ****
  (defun idlwave-shell-set-bp2 (bp)
    "Use results of breakpoint and sources query to set bp.
  Use the count argument with IDLs breakpoint command.
! We treat a count of 1 as a temporary breakpoint. 
  Counts greater than 1 use the IDL AFTER=count keyword to break
  only after reaching the statement count times."
    (let*
--- 2987,2993 ----
  (defun idlwave-shell-set-bp2 (bp)
    "Use results of breakpoint and sources query to set bp.
  Use the count argument with IDLs breakpoint command.
! We treat a count of 1 as a temporary breakpoint.
  Counts greater than 1 use the IDL AFTER=count keyword to break
  only after reaching the statement count times."
    (let*
***************
*** 2999,3009 ****
                ((> arg 1)
                 (format ",after=%d" arg))))
         (condition (idlwave-shell-bp-get bp 'condition))
!        (key (concat key 
                    (if condition (concat ",CONDITION=\"" condition "\""))))
         (line (idlwave-shell-bp-get bp 'line)))
      (idlwave-shell-send-command
!      (concat "breakpoint,'" 
             (idlwave-shell-sources-bp bp) "',"
             (if (integerp line) (setq line (int-to-string line)))
             key)
--- 2999,3009 ----
                ((> arg 1)
                 (format ",after=%d" arg))))
         (condition (idlwave-shell-bp-get bp 'condition))
!        (key (concat key
                    (if condition (concat ",CONDITION=\"" condition "\""))))
         (line (idlwave-shell-bp-get bp 'line)))
      (idlwave-shell-send-command
!      (concat "breakpoint,'"
             (idlwave-shell-sources-bp bp) "',"
             (if (integerp line) (setq line (int-to-string line)))
             key)
***************
*** 3088,3094 ****
      (if (featurep 'xemacs)
        ;; This is XEmacs
        (progn
!         (cond 
           ((eq (console-type) 'tty)
            ;; tty's cannot display glyphs
            (set-extent-property ov 'face idlwave-shell-breakpoint-face))
--- 3088,3094 ----
      (if (featurep 'xemacs)
        ;; This is XEmacs
        (progn
!         (cond
           ((eq (console-type) 'tty)
            ;; tty's cannot display glyphs
            (set-extent-property ov 'face idlwave-shell-breakpoint-face))
***************
*** 3099,3105 ****
           (idlwave-shell-mark-breakpoints
            ;; use the face
            (set-extent-property ov 'face idlwave-shell-breakpoint-face))
!          (t 
            ;; no marking
            nil))
          (set-extent-priority ov -1))  ; make stop line face prevail
--- 3099,3105 ----
           (idlwave-shell-mark-breakpoints
            ;; use the face
            (set-extent-property ov 'face idlwave-shell-breakpoint-face))
!          (t
            ;; no marking
            nil))
          (set-extent-priority ov -1))  ; make stop line face prevail
***************
*** 3118,3124 ****
         (idlwave-shell-mark-breakpoints
        ;; use a face
        (overlay-put ov 'face idlwave-shell-breakpoint-face))
!        (t 
        ;; No marking
        nil)))
      ov))
--- 3118,3124 ----
         (idlwave-shell-mark-breakpoints
        ;; use a face
        (overlay-put ov 'face idlwave-shell-breakpoint-face))
!        (t
        ;; No marking
        nil)))
      ov))
***************
*** 3136,3142 ****
    (interactive "P")
    (if (or (not idlwave-shell-command-line-to-execute)
          arg)
!       (setq idlwave-shell-command-line-to-execute 
            (read-string "IDL> " idlwave-shell-command-line-to-execute)))
    (idlwave-shell-reset 'hidden)
    (idlwave-shell-send-command idlwave-shell-command-line-to-execute
--- 3136,3142 ----
    (interactive "P")
    (if (or (not idlwave-shell-command-line-to-execute)
          arg)
!       (setq idlwave-shell-command-line-to-execute
            (read-string "IDL> " idlwave-shell-command-line-to-execute)))
    (idlwave-shell-reset 'hidden)
    (idlwave-shell-send-command idlwave-shell-command-line-to-execute
***************
*** 3146,3152 ****
    "Save file and run it in IDL.
  Runs `save-buffer' and sends a '.RUN' command for the associated file to IDL.
  When called from the shell buffer, re-run the file which was last handled by
! one of the save-and-.. commands."  
    (interactive)
    (idlwave-shell-save-and-action 'run))
  
--- 3146,3152 ----
    "Save file and run it in IDL.
  Runs `save-buffer' and sends a '.RUN' command for the associated file to IDL.
  When called from the shell buffer, re-run the file which was last handled by
! one of the save-and-.. commands."
    (interactive)
    (idlwave-shell-save-and-action 'run))
  
***************
*** 3162,3168 ****
    "Save file and batch it in IDL.
  Runs `save-buffer' and sends a '@file' command for the associated file to IDL.
  When called from the shell buffer, re-batch the file which was last handled by
! one of the save-and-.. commands."  
    (interactive)
    (idlwave-shell-save-and-action 'batch))
  
--- 3162,3168 ----
    "Save file and batch it in IDL.
  Runs `save-buffer' and sends a '@file' command for the associated file to IDL.
  When called from the shell buffer, re-batch the file which was last handled by
! one of the save-and-.. commands."
    (interactive)
    (idlwave-shell-save-and-action 'batch))
  
***************
*** 3200,3206 ****
         'idlwave-shell-maybe-update-routine-info
         (idlwave-shell-hide-p 'run))
        (idlwave-shell-bp-query))
!     (let ((msg (format "No such file %s" 
                       idlwave-shell-last-save-and-action-file)))
        (setq idlwave-shell-last-save-and-action-file nil)
        (error msg))))
--- 3200,3206 ----
         'idlwave-shell-maybe-update-routine-info
         (idlwave-shell-hide-p 'run))
        (idlwave-shell-bp-query))
!     (let ((msg (format "No such file %s"
                       idlwave-shell-last-save-and-action-file)))
        (setq idlwave-shell-last-save-and-action-file nil)
        (error msg))))
***************
*** 3233,3239 ****
  
  (defun idlwave-shell-sources-filter ()
    "Get source files from `idlwave-shell-sources-query' output.
! Create `idlwave-shell-sources-alist' consisting of 
  list elements of the form:
   (module name . (source-file-truename idlwave-internal-filename))."
    (save-excursion
--- 3233,3239 ----
  
  (defun idlwave-shell-sources-filter ()
    "Get source files from `idlwave-shell-sources-query' output.
! Create `idlwave-shell-sources-alist' consisting of
  list elements of the form:
   (module name . (source-file-truename idlwave-internal-filename))."
    (save-excursion
***************
*** 3375,3387 ****
  
  ;; The mouse bindings for PRINT and HELP
  (idlwave-shell-define-key-both
!  (if (featurep 'xemacs) 
!      [(shift button2)] 
     [(shift down-mouse-2)])
   'idlwave-shell-mouse-print)
  (idlwave-shell-define-key-both
!  (if (featurep 'xemacs) 
!      [(control meta button2)] 
     [(control meta down-mouse-2)])
    'idlwave-shell-mouse-help)
  (idlwave-shell-define-key-both
--- 3375,3387 ----
  
  ;; The mouse bindings for PRINT and HELP
  (idlwave-shell-define-key-both
!  (if (featurep 'xemacs)
!      [(shift button2)]
     [(shift down-mouse-2)])
   'idlwave-shell-mouse-print)
  (idlwave-shell-define-key-both
!  (if (featurep 'xemacs)
!      [(control meta button2)]
     [(control meta down-mouse-2)])
    'idlwave-shell-mouse-help)
  (idlwave-shell-define-key-both
***************
*** 3390,3403 ****
     [(control shift down-mouse-2)])
   'idlwave-shell-examine-select)
  ;; Add this one from the idlwave-mode-map
! (define-key idlwave-shell-mode-map 
    (if (featurep 'xemacs)
        [(shift button3)]
      [(shift mouse-3)])
    'idlwave-mouse-context-help)
  
  ;; For Emacs, we need to turn off the button release events.
! (defun idlwave-shell-mouse-nop (event) 
    (interactive "e"))
  (unless (featurep 'xemacs)
    (idlwave-shell-define-key-both
--- 3390,3403 ----
     [(control shift down-mouse-2)])
   'idlwave-shell-examine-select)
  ;; Add this one from the idlwave-mode-map
! (define-key idlwave-shell-mode-map
    (if (featurep 'xemacs)
        [(shift button3)]
      [(shift mouse-3)])
    'idlwave-mouse-context-help)
  
  ;; For Emacs, we need to turn off the button release events.
! (defun idlwave-shell-mouse-nop (event)
    (interactive "e"))
  (unless (featurep 'xemacs)
    (idlwave-shell-define-key-both
***************
*** 3407,3422 ****
    (idlwave-shell-define-key-both
     [(control meta mouse-2)] 'idlwave-shell-mouse-nop))
  
!   
  ;; The following set of bindings is used to bind the debugging keys.
  ;; If `idlwave-shell-activate-prefix-keybindings' is non-nil, the first key
  ;; in the list gets bound the C-c C-d prefix map.
  ;; If `idlwave-shell-debug-modifiers' is non-nil, the second key
! ;; in the list gets bound with the specified modifiers in both 
  ;; `idlwave-mode-map' and `idlwave-shell-mode-map'.
  
! ;; Used keys:   abcdef hi klmnopqrs u wxyz 
! ;; Unused keys:       g  j         t v  
  (let* ((specs
        '(([(control ?b)]   ?b   idlwave-shell-break-here)
          ([(control ?i)]   ?i   idlwave-shell-break-in)
--- 3407,3422 ----
    (idlwave-shell-define-key-both
     [(control meta mouse-2)] 'idlwave-shell-mouse-nop))
  
! 
  ;; The following set of bindings is used to bind the debugging keys.
  ;; If `idlwave-shell-activate-prefix-keybindings' is non-nil, the first key
  ;; in the list gets bound the C-c C-d prefix map.
  ;; If `idlwave-shell-debug-modifiers' is non-nil, the second key
! ;; in the list gets bound with the specified modifiers in both
  ;; `idlwave-mode-map' and `idlwave-shell-mode-map'.
  
! ;; Used keys:   abcdef hi klmnopqrs u wxyz
! ;; Unused keys:       g  j         t v
  (let* ((specs
        '(([(control ?b)]   ?b   idlwave-shell-break-here)
          ([(control ?i)]   ?i   idlwave-shell-break-in)
***************
*** 3510,3516 ****
      "--"
      ["Print expression" idlwave-shell-print t]
      ["Help on expression" idlwave-shell-help-expression t]
!     ["Evaluate Region" idlwave-shell-evaluate-region 
       (eq major-mode 'idlwave-mode)]
      ["Run Region" idlwave-shell-run-region (eq major-mode 'idlwave-mode)]
      "--"
--- 3510,3516 ----
      "--"
      ["Print expression" idlwave-shell-print t]
      ["Help on expression" idlwave-shell-help-expression t]
!     ["Evaluate Region" idlwave-shell-evaluate-region
       (eq major-mode 'idlwave-mode)]
      ["Run Region" idlwave-shell-run-region (eq major-mode 'idlwave-mode)]
      "--"
***************
*** 3562,3568 ****
      ("Print Expression"
       ["Print expression" idlwave-shell-print t]
       ["Help on expression" idlwave-shell-help-expression t]
!      ["Evaluate Region" idlwave-shell-evaluate-region 
        (eq major-mode 'idlwave-mode)]
       "--"
       ["Redisplay" idlwave-shell-redisplay t]
--- 3562,3568 ----
      ("Print Expression"
       ["Print expression" idlwave-shell-print t]
       ["Help on expression" idlwave-shell-help-expression t]
!      ["Evaluate Region" idlwave-shell-evaluate-region
        (eq major-mode 'idlwave-mode)]
       "--"
       ["Redisplay" idlwave-shell-redisplay t]
***************
*** 3588,3594 ****
        (easy-menu-define
         idlwave-shell-mode-menu idlwave-shell-mode-map "IDL shell menus"
         idlwave-shell-menu-def)
!       (easy-menu-define 
         idlwave-mode-debug-menu idlwave-mode-map "IDL debugging menus"
         idlwave-shell-menu-def)
        (save-excursion
--- 3588,3594 ----
        (easy-menu-define
         idlwave-shell-mode-menu idlwave-shell-mode-map "IDL shell menus"
         idlwave-shell-menu-def)
!       (easy-menu-define
         idlwave-mode-debug-menu idlwave-mode-map "IDL debugging menus"
         idlwave-shell-menu-def)
        (save-excursion
***************
*** 3623,3629 ****
  \"    RRRR      \",
  \"              \",
  \"              \"};"))
!       
    (setq idlwave-shell-bp-glyph
        (cond ((and (featurep 'xemacs)
                    (featurep 'xpm))
--- 3623,3629 ----
  \"    RRRR      \",
  \"              \",
  \"              \"};"))
! 
    (setq idlwave-shell-bp-glyph
        (cond ((and (featurep 'xemacs)
                    (featurep 'xpm))
***************
*** 3639,3645 ****
  
  ;;; Load the toolbar when wanted by the user.
  
! (autoload 'idlwave-toolbar-toggle "idlw-toolbar" 
    "Toggle the IDLWAVE toolbar")
  (autoload 'idlwave-toolbar-add-everywhere "idlw-toolbar"
    "Add IDLWAVE toolbar")
--- 3639,3645 ----
  
  ;;; Load the toolbar when wanted by the user.
  
! (autoload 'idlwave-toolbar-toggle "idlw-toolbar"
    "Toggle the IDLWAVE toolbar")
  (autoload 'idlwave-toolbar-add-everywhere "idlw-toolbar"
    "Add IDLWAVE toolbar")




reply via email to

[Prev in Thread] Current Thread [Next in Thread]