[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] Changes to emacs/lisp/progmodes/idlw-shell.el
From: |
John-David T. Smith |
Subject: |
[Emacs-diffs] Changes to emacs/lisp/progmodes/idlw-shell.el |
Date: |
Thu, 12 Sep 2002 12:56:54 -0400 |
Index: emacs/lisp/progmodes/idlw-shell.el
diff -c emacs/lisp/progmodes/idlw-shell.el:3.19
emacs/lisp/progmodes/idlw-shell.el:3.20
*** emacs/lisp/progmodes/idlw-shell.el:3.19 Fri Sep 6 03:16:22 2002
--- emacs/lisp/progmodes/idlw-shell.el Thu Sep 12 12:56:54 2002
***************
*** 1,11 ****
;; idlw-shell.el --- run IDL as an inferior process of Emacs.
! ;; Copyright (c) 1999, 2000, 2001 Free Software Foundation
;; Author: Carsten Dominik <address@hidden>
;; Chris Chase <address@hidden>
;; Maintainer: J.D. Smith <address@hidden>
! ;; Version: 4.14
! ;; Date: $Date: 2002/09/06 07:16:22 $
;; Keywords: processes
;; This file is part of GNU Emacs.
--- 1,11 ----
;; idlw-shell.el --- run IDL as an inferior process of Emacs.
! ;; Copyright (c) 1999, 2000, 2001,2002 Free Software Foundation
;; Author: Carsten Dominik <address@hidden>
;; Chris Chase <address@hidden>
;; Maintainer: J.D. Smith <address@hidden>
! ;; Version: 4.15
! ;; Date: $Date: 2002/09/12 16:56:54 $
;; Keywords: processes
;; This file is part of GNU Emacs.
***************
*** 72,83 ****
;; KNOWN PROBLEMS
;; ==============
;;
- ;; I don't plan on implementing directory tracking by watching the IDL
- ;; commands entered at the prompt, since too often an IDL procedure
- ;; will change the current directory. If you want the idl process
- ;; buffer to match the IDL current working just execute `M-x
- ;; idlwave-shell-resync-dirs' (bound to "\C-c\C-d\C-w" by default.)
- ;;
;; Under XEmacs the Debug menu in the shell does not display the
;; keybindings in the prefix map. There bindings are available anyway - so
;; it is a bug in XEmacs.
--- 72,77 ----
***************
*** 117,122 ****
--- 111,117 ----
;;; Customizations: idlwave-shell group
+ ;; General/Misc. customizations
(defgroup idlwave-shell-general-setup nil
"General setup of the Shell interaction for IDLWAVE/Shell."
:prefix "idlwave-shell"
***************
*** 141,169 ****
;; (defcustom idlwave-shell-automatic-start...) See idlwave.el
- (defcustom idlwave-shell-initial-commands "!more=0"
- "Initial commands, separated by newlines, to send to IDL.
- This string is sent to the IDL process by `idlwave-shell-mode' which is
- invoked by `idlwave-shell'."
- :group 'idlwave-shell-general-setup
- :type 'string)
-
- (defcustom idlwave-shell-save-command-history t
- "Non-nil means preserve command history between sessions.
- The file `idlwave-shell-command-history-file' is used to save and restore
- the history."
- :group 'idlwave-shell-general-setup
- :type 'boolean)
-
- (defcustom idlwave-shell-command-history-file "~/.idlwhist"
- "The file in which the command history of the idlwave shell is saved.
- In order to change the size of the history, see the variable
- `comint-input-ring-size'.
- The history is only saved if the variable `idlwave-shell-save-command-history'
- is non-nil."
- :group 'idlwave-shell-general-setup
- :type 'file)
-
(defcustom idlwave-shell-use-dedicated-frame nil
"*Non-nil means, IDLWAVE should use a special frame to display shell
buffer."
:group 'idlwave-shell-general-setup
--- 136,141 ----
***************
*** 198,216 ****
(const :tag "in command line only" cmdline)))
;; FIXME: add comint-input-ring-size?
- (defcustom idlwave-shell-comint-settings
- '((comint-scroll-to-bottom-on-input . t)
- (comint-scroll-to-bottom-on-output . nil)
- (comint-scroll-show-maximum-output . t)
- )
- "Alist of special settings for the comint variables in the IDLWAVE Shell.
- Each entry is a cons cell with the name of a variable and a value.
- The function `idlwave-shell-mode' will make local variables out of each entry.
- Changes to this variable will only be active when the shell buffer is
- newly created."
- :group 'idlwave-shell-general-setup
- :type '(repeat
- (cons variable sexp)))
(defcustom idlwave-shell-use-toolbar t
"*Non-nil means, use the debugging toolbar in all IDL related buffers.
--- 170,175 ----
***************
*** 268,274 ****
:group 'idlwave-shell-general-setup
:type 'boolean)
! (defcustom idlwave-shell-file-name-chars "~/A-Za-z0-9+@:_.$#%={}\\-"
"The characters allowed in file names, as a string.
Used for file name completion. Must not contain `'', `,' and `\"'
because these are used as separators by IDL."
--- 227,233 ----
:group 'idlwave-shell-general-setup
:type 'boolean)
! (defcustom idlwave-shell-file-name-chars "~/A-Za-z0-9+:_.$#%={}\\-"
"The characters allowed in file names, as a string.
Used for file name completion. Must not contain `'', `,' and `\"'
because these are used as separators by IDL."
***************
*** 280,287 ****
:group 'idlwave-shell-general-setup
:type 'hook)
! (defvar idlwave-shell-print-expression-function nil
! "*OBSOLETE VARIABLE, is no longer used.")
(defcustom idlwave-shell-examine-alist
'(("Print" . "print,___")
--- 239,296 ----
:group 'idlwave-shell-general-setup
:type 'hook)
! (defcustom idlwave-shell-graphics-window-size '(500 400)
! "Size of IDL graphics windows popped up by special IDLWAVE command.
! The command is `C-c C-d C-f' and accepts as a prefix the window nr.
! A command like `WINDOW,N,xsize=XX,ysize=YY' is sent to IDL."
! :group 'idlwave-shell-general-setup
! :type '(list
! (integer :tag "x size")
! (integer :tag "y size")))
!
! ;; Commands Sent to Shell... etc.
! (defgroup idlwave-shell-command-setup nil
! "Setup for command parameters of the Shell interaction for IDLWAVE."
! :prefix "idlwave-shell"
! :group 'idlwave)
!
! (defcustom idlwave-shell-initial-commands "!more=0"
! "Initial commands, separated by newlines, to send to IDL.
! This string is sent to the IDL process by `idlwave-shell-mode' which is
! invoked by `idlwave-shell'."
! :group 'idlwave-shell-command-setup
! :type 'string)
!
! (defcustom idlwave-shell-save-command-history t
! "Non-nil means preserve command history between sessions.
! The file `idlwave-shell-command-history-file' is used to save and restore
! the history."
! :group 'idlwave-shell-command-setup
! :type 'boolean)
!
! (defcustom idlwave-shell-command-history-file "~/.idlwhist"
! "The file in which the command history of the idlwave shell is saved.
! In order to change the size of the history, see the variable
! `comint-input-ring-size'.
! The history is only saved if the variable `idlwave-shell-save-command-history'
! 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."
! :group 'idlwave-shell-command-setup
! :type '(choice
! (const everything)
! (set :tag "Checklist" :greedy t
! (const :tag "All .run and .compile commands" run)
! (const :tag "All breakpoint commands" breakpoint)
! (const :tag "All debug and stepping commands" debug)
! (const :tag "Return, close, etc. commands" misc))))
(defcustom idlwave-shell-examine-alist
'(("Print" . "print,___")
***************
*** 299,322 ****
`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-general-setup
:type '(repeat
(cons
(string :tag "Label ")
(string :tag "Command"))))
(defcustom idlwave-shell-separate-examine-output t
"*Non-nil mean, put output of examine commands in their own buffer."
! :group 'idlwave-shell-general-setup
:type 'boolean)
(defcustom idlwave-shell-use-input-mode-magic nil
"*Non-nil means, IDLWAVE should check for input mode spells in output.
The spells are strings printed by your IDL program and matched
by the regular expressions in `idlwave-shell-input-mode-spells'.
When these expressions match, IDLWAVE switches to character input mode and
back, respectively. See `idlwave-shell-input-mode-spells' for details."
! :group 'idlwave-shell-general-setup
:type 'boolean)
(defcustom idlwave-shell-input-mode-spells
--- 308,353 ----
`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"))))
+ (defvar idlwave-shell-print-expression-function nil
+ "*OBSOLETE VARIABLE, is no longer used.")
+
(defcustom idlwave-shell-separate-examine-output t
"*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)
+ (comint-scroll-show-maximum-output . nil))
+
+ "Alist of special settings for the comint variables in the IDLWAVE Shell.
+ Each entry is a cons cell with the name of a variable and a value.
+ The function `idlwave-shell-mode' will make local variables out of each entry.
+ Changes to this variable will only be active when the shell buffer is
+ newly created."
+ :group 'idlwave-shell-command-setup
+ :type '(repeat
+ (cons variable sexp)))
+
+ (defcustom idlwave-shell-query-for-class t
+ "*Non-nil means query the shell for object class on object completions."
+ :group 'idlwave-shell-command-setup
+ :type 'boolean)
+
(defcustom idlwave-shell-use-input-mode-magic nil
"*Non-nil means, IDLWAVE should check for input mode spells in output.
The spells are strings printed by your IDL program and matched
by the regular expressions in `idlwave-shell-input-mode-spells'.
When these expressions match, IDLWAVE switches to character input mode and
back, respectively. See `idlwave-shell-input-mode-spells' for details."
! :group 'idlwave-shell-command-setup
:type 'boolean)
(defcustom idlwave-shell-input-mode-spells
***************
*** 372,394 ****
else print,'<onechar>'
endif
end"
! :group 'idlwave-shell-general-setup
:type '(list
(regexp :tag "One-char regexp")
(regexp :tag "Char-mode regexp")
(regexp :tag "Line-mode regexp")))
- (defcustom idlwave-shell-graphics-window-size '(500 400)
- "Size of IDL graphics windows popped up by special IDLWAVE command.
- The command is `C-c C-d C-f' and accepts as a prefix the window nr.
- A command like `WINDOW,N,xsize=XX,ysize=YY' is sent to IDL."
- :group 'idlwave-shell-general-setup
- :type '(list
- (integer :tag "x size")
- (integer :tag "y size")))
-
- ;;; Breakpoint Overlays etc
(defgroup idlwave-shell-highlighting-and-faces nil
"Highlighting and Faces used by the IDLWAVE Shell mode."
:prefix "idlwave-shell"
--- 403,416 ----
else print,'<onechar>'
endif
end"
! :group 'idlwave-shell-command-setup
:type '(list
(regexp :tag "One-char regexp")
(regexp :tag "Char-mode regexp")
(regexp :tag "Line-mode regexp")))
+ ;; Breakpoint Overlays etc
(defgroup idlwave-shell-highlighting-and-faces nil
"Highlighting and Faces used by the IDLWAVE Shell mode."
:prefix "idlwave-shell"
***************
*** 540,551 ****
This is used to speed up the reloading of the routine info procedure
before use by the shell.")
! (defvar idlwave-shell-dirstack-query "printd"
"Command used by `idlwave-shell-resync-dirs' to query IDL for
the directory stack.")
- (defvar idlwave-shell-wd-is-synched nil)
-
(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.")
--- 562,571 ----
This is used to speed up the reloading of the routine info procedure
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.")
***************
*** 661,666 ****
--- 681,689 ----
(defvar idlwave-shell-ready nil
"If non-nil can send next command to IDL process.")
+ (defvar idlwave-shell-wait-for-output nil
+ "Whether to wait for output to accumulate.")
+
;;; The following are the types of messages we attempt to catch to
;;; resync our idea of where IDL execution currently is.
;;;
***************
*** 833,843 ****
--- 856,872 ----
(idlwave-shell-display-line nil)
(setq idlwave-shell-calling-stack-index 0)
+ (when idlwave-shell-query-for-class
+ (add-to-list (make-local-variable 'idlwave-determine-class-special)
+ 'idlwave-shell-get-object-class)
+ (setq idlwave-store-inquired-class t))
+
;; Make sure comint-last-input-end does not go to beginning of
;; buffer (in case there were other processes already in this buffer).
(set-marker comint-last-input-end (point))
(setq idlwave-idlwave_routine_info-compiled nil)
(setq idlwave-shell-ready nil)
+ (setq idlwave-shell-wait-for-output nil)
(setq idlwave-shell-bp-alist nil)
(idlwave-shell-update-bp-overlays) ; Throw away old overlays
(setq idlwave-shell-sources-alist nil)
***************
*** 1016,1039 ****
(idlwave-shell arg)
(select-window window)))
(defun idlwave-shell-send-command (&optional cmd pcmd hide preempt)
"Send a command to IDL process.
! \(CMD PCMD HIDE\) are placed at the end of `idlwave-shell-pending-commands'.
! If IDL is ready the first command, CMD, in
! `idlwave-shell-pending-commands' is sent to the IDL process. If optional
! second argument PCMD is non-nil it will be placed on
! `idlwave-shell-post-command-hook' when CMD is executed. If the optional
! third argument HIDE is non-nil, then hide output from CMD.
If optional fourth argument PREEMPT is non-nil CMD is put at front of
! `idlwave-shell-pending-commands'.
!
! IDL is considered ready if the prompt is present
! and if `idlwave-shell-ready' is non-nil."
!
! ;(setq hide nil) ; FIXME: turn this on for debugging only
! ; (message "SENDING %s|||%s" cmd pcmd) ;??????????????????????
! (let (buf proc)
;; Get or make the buffer and its process
(if (or (not (setq buf (get-buffer (idlwave-shell-buffer))))
(not (setq proc (get-buffer-process buf))))
--- 1045,1082 ----
(idlwave-shell arg)
(select-window window)))
+ (defun idlwave-shell-hide-p (type)
+ "Whether to hide this type of command.
+ Return either nil or 'hide."
+ (if (listp idlwave-shell-show-commands)
+ (if (not (memq type idlwave-shell-show-commands)) 'hide)))
+
(defun idlwave-shell-send-command (&optional cmd pcmd hide preempt)
"Send a command to IDL process.
! \(CMD PCMD HIDE\) are placed at the end of
! ` idlwave-shell-pending-commands'. If IDL is ready the first command,
! CMD, in `idlwave-shell-pending-commands' is sent to the IDL process.
! If optional second argument PCMD is non-nil it will be placed on
! `idlwave-shell-post-command-hook' when CMD is executed. If the
! optional third argument HIDE is non-nil, then hide output from CMD.
If optional fourth argument PREEMPT is non-nil CMD is put at front of
! `idlwave-shell-pending-commands'. If PREEMPT is 'wait, wait for all
! output to complete and the next prompt to arrive before returning
! \(useful if you need an answer now\). IDL is considered ready if the
! 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))
! buf proc)
;; Get or make the buffer and its process
(if (or (not (setq buf (get-buffer (idlwave-shell-buffer))))
(not (setq proc (get-buffer-process buf))))
***************
*** 1047,1097 ****
(not (setq proc (get-buffer-process buf))))
;; Still nothing
(error "Problem with autostarting IDL shell"))))
!
! (save-excursion
(set-buffer buf)
- (goto-char (process-mark proc))
;; To make this easy, always push CMD onto pending commands
(if cmd
! (setq idlwave-shell-pending-commands
! (if preempt
! ;; Put at front.
! (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
! (if (and idlwave-shell-ready
! ;; Check for IDL prompt
! (save-excursion
! (forward-line 0)
! ;; (beginning-of-line) ; Changed for Emacs 21
! (looking-at idlwave-shell-prompt-pattern)))
! ;; IDL ready for command
! (if idlwave-shell-pending-commands
! ;; execute command
! (let* ((lcmd (car idlwave-shell-pending-commands))
! (cmd (car lcmd))
! (pcmd (nth 1 lcmd))
! (hide (nth 2 lcmd)))
! ;; If this is an executive command, reset the stack pointer
! (if (eq (string-to-char cmd) ?.)
! (setq idlwave-shell-calling-stack-index 0))
! ;; Set post-command
! (setq idlwave-shell-post-command-hook pcmd)
! ;; Output hiding
! ;;; Debug code
! ;;; (setq idlwave-shell-hide-output nil)
! (setq idlwave-shell-hide-output hide)
! ;; Pop command
! (setq idlwave-shell-pending-commands
! (cdr idlwave-shell-pending-commands))
! ;; Send command for execution
! (set-marker comint-last-input-start (point))
! (set-marker comint-last-input-end (point))
! (comint-simple-send proc cmd)
! (setq idlwave-shell-ready nil)))))))
(defun idlwave-shell-send-char (c &optional no-error)
"Send one character to the shell, without a newline."
--- 1090,1142 ----
(not (setq proc (get-buffer-process buf))))
;; Still nothing
(error "Problem with autostarting IDL shell"))))
! (when (or cmd idlwave-shell-pending-commands)
(set-buffer buf)
;; To make this easy, always push CMD onto pending commands
(if cmd
! (setq idlwave-shell-pending-commands
! (if preempt
! ;; Put at front.
! (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)))
! (goto-char (process-mark proc))
! (if (and idlwave-shell-ready
! ;; Check for IDL prompt
! (prog2
! (forward-line 0)
! ;; (beginning-of-line) ; Changed for Emacs 21
! (looking-at idlwave-shell-prompt-pattern)
! (goto-char (process-mark proc))))
! ;; IDL ready for command, execute it
! (let* ((lcmd (car idlwave-shell-pending-commands))
! (cmd (car lcmd))
! (pcmd (nth 1 lcmd))
! (hide (nth 2 lcmd)))
! ;; If this is an executive command, reset the stack pointer
! (if (eq (string-to-char cmd) ?.)
! (setq idlwave-shell-calling-stack-index 0))
! ;; Set post-command
! (setq idlwave-shell-post-command-hook pcmd)
! ;; Output hiding
! (setq idlwave-shell-hide-output hide)
! ;; Pop command
! (setq idlwave-shell-pending-commands
! (cdr idlwave-shell-pending-commands))
! ;; Send command for execution
! (set-marker comint-last-input-start (point))
! (set-marker comint-last-input-end (point))
! (comint-simple-send proc cmd)
! (setq idlwave-shell-ready nil)
! (when (equal preempt 'wait) ; Get all the output at once
! (setq idlwave-shell-wait-for-output t)
! (accept-process-output proc))))
! (goto-char save-point))
! (set-buffer save-buffer))))
(defun idlwave-shell-send-char (c &optional no-error)
"Send one character to the shell, without a newline."
***************
*** 1172,1209 ****
(and (eq idlwave-shell-char-mode-active 'exit)
(throw 'exit "Single char loop exited"))))))))
! (defun idlwave-shell-up-or-history (&optional arg)
"When in last line of process buffer, do `comint-previous-input'.
! Otherwise just do `previous-line'."
(interactive "p")
! (if (eq t idlwave-shell-arrows-do-history) (goto-char (point-max)))
! (if (and idlwave-shell-arrows-do-history
! (>= (1+ (save-excursion (end-of-line) (point)))
! (marker-position
! (process-mark (get-buffer-process (current-buffer))))))
! (progn
! (and (not (eolp)) (kill-line nil))
! (comint-previous-input arg))
! (previous-line arg)))
(defun idlwave-shell-down-or-history (&optional arg)
! "When in last line of process buffer, do `comint-next-input'.
! Otherwise just do `next-line'."
(interactive "p")
! (if (eq t idlwave-shell-arrows-do-history) (goto-char (point-max)))
! (if (and idlwave-shell-arrows-do-history
! (>= (1+ (save-excursion (end-of-line) (point)))
! (marker-position
! (process-mark (get-buffer-process (current-buffer))))))
! (progn
! (and (not (eolp)) (kill-line nil))
! (comint-next-input arg))
! (next-line arg)))
!
! ;; There was a report that a newer version of comint.el changed the
! ;; name of comint-filter to comint-output-filter. Unfortunately, we
! ;; have yet to upgrade.
(defun idlwave-shell-comint-filter (process string) nil)
(if (fboundp 'comint-output-filter)
(fset 'idlwave-shell-comint-filter (symbol-function
'comint-output-filter))
--- 1217,1252 ----
(and (eq idlwave-shell-char-mode-active 'exit)
(throw 'exit "Single char loop exited"))))))))
! (defun idlwave-shell-move-or-history (up &optional arg)
"When in last line of process buffer, do `comint-previous-input'.
! Otherwise just move the line. Move down unless UP is non-nil."
! (let* ((proc-pos (marker-position
! (process-mark (get-buffer-process (current-buffer)))))
! (arg (or arg 1))
! (arg (if up arg (- arg))))
! (if (eq t idlwave-shell-arrows-do-history) (goto-char proc-pos))
! (if (and idlwave-shell-arrows-do-history
! (>= (1+ (save-excursion (end-of-line) (point))) proc-pos))
! (progn
! (goto-char proc-pos)
! (and (not (eolp)) (kill-line nil))
! (comint-previous-input arg))
! (previous-line arg))))
!
! (defun idlwave-shell-up-or-history (&optional arg)
! "When in last line of process buffer, move to previous input.
! Otherwise just go up one line."
(interactive "p")
! (idlwave-shell-move-or-history t arg))
(defun idlwave-shell-down-or-history (&optional arg)
! "When in last line of process buffer, move to next input.
! Otherwise just go down one line."
(interactive "p")
! (idlwave-shell-move-or-history nil arg))
+ ;; Newer versions of comint.el changed the name of comint-filter to
+ ;; comint-output-filter.
(defun idlwave-shell-comint-filter (process string) nil)
(if (fboundp 'comint-output-filter)
(fset 'idlwave-shell-comint-filter (symbol-function
'comint-output-filter))
***************
*** 1223,1229 ****
;; We no longer do the cleanup here - this is done by the process sentinel
(when (eq (process-status idlwave-shell-process-name) 'run)
;; OK, process is still running, so we can use it.
- (setq idlwave-shell-wd-is-synched nil) ;; something might have changed
cwd
(let ((data (match-data)) p)
(unwind-protect
(progn
--- 1266,1271 ----
***************
*** 1252,1258 ****
(get-buffer-create idlwave-shell-hidden-output-buffer))
(goto-char (point-max))
(insert string))
! (idlwave-shell-comint-filter proc string))
;; Watch for magic - need to accumulate the current line
;; since it may not be sent all at once.
(if (string-match "\n" string)
--- 1294,1300 ----
(get-buffer-create idlwave-shell-hidden-output-buffer))
(goto-char (point-max))
(insert string))
! (idlwave-shell-comint-filter proc string))
;; Watch for magic - need to accumulate the current line
;; since it may not be sent all at once.
(if (string-match "\n" string)
***************
*** 1266,1311 ****
(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 line
! (if (setq idlwave-shell-ready
! (string-match idlwave-shell-prompt-pattern
! idlwave-shell-accumulation))
! (progn
! (if idlwave-shell-hide-output
! (save-excursion
! (set-buffer idlwave-shell-hidden-output-buffer)
! ; (goto-char (point-min))
! ; (re-search-forward idlwave-shell-prompt-pattern nil
t)
! (goto-char (point-max))
! (re-search-backward idlwave-shell-prompt-pattern nil
t)
(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
! (save-excursion
! (set-buffer
! (process-buffer proc))
! (buffer-substring
! (progn
! (goto-char (process-mark proc))
! (beginning-of-line nil)
! (point))
! comint-last-input-end))))
;; Scan for state and do post command - bracket them
;; with idlwave-shell-ready=nil since they
;; may call idlwave-shell-send-command.
--- 1308,1351 ----
(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
! idlwave-shell-accumulation))
! (progn
! (if idlwave-shell-hide-output
! (save-excursion
! (set-buffer idlwave-shell-hidden-output-buffer)
! (goto-char (point-max))
! (re-search-backward idlwave-shell-prompt-pattern nil t)
(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)
! (buffer-substring
! (save-excursion
! (goto-char (process-mark proc))
! (beginning-of-line nil)
! (point))
! comint-last-input-end))))
!
;; Scan for state and do post command - bracket them
;; with idlwave-shell-ready=nil since they
;; may call idlwave-shell-send-command.
***************
*** 1321,1330 ****
(setq idlwave-shell-accumulation nil
idlwave-shell-command-output nil
idlwave-shell-post-command-hook nil
! idlwave-shell-hide-output nil))
;; Done with post command. Do pending command if
;; any.
! (idlwave-shell-send-command))))
(store-match-data data)))))
(defun idlwave-shell-sentinel (process event)
--- 1361,1379 ----
(setq idlwave-shell-accumulation nil
idlwave-shell-command-output nil
idlwave-shell-post-command-hook nil
! idlwave-shell-hide-output nil
! idlwave-shell-wait-for-output nil))
;; Done with post command. Do pending command if
;; any.
! (idlwave-shell-send-command))
! ;; We didn't get the prompt yet... maybe accept more output
! (when idlwave-shell-wait-for-output
! ;;; Test/Debug code
! ; (save-excursion (set-buffer
! ; (get-buffer-create "*idlwave-shell-output*"))
! ; (goto-char (point-max))
! ; (insert "\n<=== WAITING ON OUTPUT ==>\n"))
! (accept-process-output proc nil 100))))
(store-match-data data)))))
(defun idlwave-shell-sentinel (process event)
***************
*** 1367,1441 ****
For breakpoint messages process any attached count or command
parameters.
Update the windows if a message is found."
! (let (update)
! (cond
! ;; Make sure we have output
! ((not idlwave-shell-command-output))
!
! ;; 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)))
! update t))
!
! ;; Handle breakpoints separately
! ((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)))
! update t)
! ;; We used to to counting 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))
! idlwave-shell-bp-alist)))
! (if bp
! (let ((cmd (idlwave-shell-bp-get bp 'cmd)))
! (if cmd
! ;; Execute command
! (if (listp cmd)
! (eval cmd)
! (funcall cmd))))
! ;; A breakpoint that we did not know about - perhaps it was
! ;; set by the user or IDL isn't reporting breakpoints like
! ;; we expect. Lets update our list.
! (idlwave-shell-bp-query)))))
!
! ;; Handle compilation errors in addition to the above
! (if (and idlwave-shell-command-output
! (or (string-match
! idlwave-shell-syntax-error idlwave-shell-command-output)
! (string-match
! idlwave-shell-other-error idlwave-shell-command-output)))
! (progn
! (save-excursion
! (set-buffer
! (get-buffer-create idlwave-shell-error-buffer))
! (erase-buffer)
! (insert idlwave-shell-command-output)
! (goto-char (point-min))
! (setq idlwave-shell-error-last (point)))
! (idlwave-shell-goto-next-error)))
!
! ;; Do update
! (when update
! (idlwave-shell-display-line (idlwave-shell-pc-frame)))))
!
(defvar idlwave-shell-error-buffer " *idlwave-shell-errors*"
"Buffer containing syntax errors from IDL compilations.")
-
;; FIXME: the following two variables do not currently allow line breaks
;; 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.
--- 1416,1478 ----
For breakpoint messages process any attached count or command
parameters.
Update the windows if a message is found."
! (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
! (set-buffer
! (get-buffer-create idlwave-shell-error-buffer))
! (erase-buffer)
! (insert idlwave-shell-command-output)
! (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))
! idlwave-shell-bp-alist)))
! (if bp
! (let ((cmd (idlwave-shell-bp-get bp 'cmd)))
! (if cmd
! ;; Execute command
! (if (listp cmd) (eval cmd) (funcall cmd))))
! ;; A breakpoint that we did not know about - perhaps it was
! ;; set by the user or IDL isn't reporting breakpoints like
! ;; we expect. Lets update our list.
! (idlwave-shell-bp-query)))
! (idlwave-shell-display-line (idlwave-shell-pc-frame)))))
(defvar idlwave-shell-error-buffer " *idlwave-shell-errors*"
"Buffer containing syntax errors from IDL compilations.")
;; FIXME: the following two variables do not currently allow line breaks
;; 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.
***************
*** 1498,1504 ****
unlikely."
(let (number procedure file)
! (when (string-match idlwave-shell-file-line-message string)
(setq procedure (match-string 1 string)
number (match-string 3 string)
file (match-string 5 string))
--- 1535,1542 ----
unlikely."
(let (number procedure file)
! (when (and (not (string-match ":\\s-*\\$MAIN" string))
! (string-match idlwave-shell-file-line-message string))
(setq procedure (match-string 1 string)
number (match-string 3 string)
file (match-string 5 string))
***************
*** 1554,1560 ****
idlwave-shell-command-line-to-execute nil
idlwave-shell-bp-alist nil
idlwave-shell-calling-stack-index 0
! idlwave-idlwave_routine_info-compiled nil)
(idlwave-shell-delete-temp-files)
(idlwave-shell-display-line nil)
(idlwave-shell-update-bp-overlays) ; kill old overlays
--- 1592,1598 ----
idlwave-shell-command-line-to-execute nil
idlwave-shell-bp-alist nil
idlwave-shell-calling-stack-index 0
! idlwave-idlwave_routine_info-compile nil)
(idlwave-shell-delete-temp-files)
(idlwave-shell-display-line nil)
(idlwave-shell-update-bp-overlays) ; kill old overlays
***************
*** 1585,1611 ****
(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))))
(defun idlwave-shell-resync-dirs ()
! "Resync the buffer's idea of the current directory stack.
! This command queries IDL with the command bound to
! `idlwave-shell-dirstack-query' (default \"printd\"), reads the
! output for the new directory stack."
(interactive)
(idlwave-shell-send-command idlwave-shell-dirstack-query
'idlwave-shell-filter-directory
! 'hide))
(defun idlwave-shell-retall (&optional arg)
"Return from the entire calling stack."
(interactive "P")
! (idlwave-shell-send-command "retall"))
(defun idlwave-shell-closeall (&optional arg)
"Close all open files."
(interactive "P")
! (idlwave-shell-send-command "close,/all"))
(defun idlwave-shell-quit (&optional arg)
"Exit the idl process after confirmation.
--- 1623,1650 ----
(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))))
(defun idlwave-shell-resync-dirs ()
! "Resync the buffer's idea of the current directory.
! This command queries IDL with the command bound to
! `idlwave-shell-dirstack-query', reads the output for the new
! directory."
(interactive)
(idlwave-shell-send-command idlwave-shell-dirstack-query
'idlwave-shell-filter-directory
! 'hide 'wait))
(defun idlwave-shell-retall (&optional arg)
"Return from the entire calling stack."
(interactive "P")
! (idlwave-shell-send-command "retall" nil (idlwave-shell-hide-p 'misc)))
(defun idlwave-shell-closeall (&optional arg)
"Close all open files."
(interactive "P")
! (idlwave-shell-send-command "close,/all" nil (idlwave-shell-hide-p 'misc)))
(defun idlwave-shell-quit (&optional arg)
"Exit the idl process after confirmation.
***************
*** 1619,1625 ****
(error nil)))))
(defun idlwave-shell-reset (&optional hidden)
! "Reset IDL. Return to main level and destroy the leaftover variables.
This issues the following commands:
RETALL
WIDGET_CONTROL,/RESET
--- 1658,1664 ----
(error nil)))))
(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
***************
*** 1752,1771 ****
Change the default directory for the process buffer to concur."
(save-excursion
(set-buffer (idlwave-shell-buffer))
! (if (string-match "Current Directory: *\\(\\S-*\\) *$"
idlwave-shell-command-output)
(let ((dir (substring idlwave-shell-command-output
(match-beginning 1) (match-end 1))))
! (message "Setting Emacs wd to %s" dir)
(setq idlwave-shell-default-directory dir)
(setq default-directory (file-name-as-directory dir))))))
(defun idlwave-shell-complete (&optional arg)
"Do completion in the idlwave-shell buffer.
Calls `idlwave-shell-complete-filename' after some executive commands or
in strings. Otherwise, calls `idlwave-complete' to complete modules and
keywords."
- ;;FIXME: batch files?
(interactive "P")
(let (cmd)
(cond
--- 1791,1852 ----
Change the default directory for the process buffer to concur."
(save-excursion
(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)
(setq default-directory (file-name-as-directory dir))))))
+ (defvar idlwave-shell-get-object-class nil)
+ (defun idlwave-shell-get-object-class (apos)
+ "Query the shell for the class of the object before point."
+ (let ((bos (save-excursion (idlwave-start-of-substatement 'pre) (point)))
+ (bol (save-excursion (forward-line 0) (point)))
+ 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))
+ (throw 'exit (1+ (point))))))
+ apos)))
+ (when (not (string= expression ""))
+ (setq idlwave-shell-get-object-class nil)
+ (idlwave-shell-send-command
+ (concat "print,obj_class(" expression ")")
+ 'idlwave-shell-parse-object-class
+ 'hide 'wait)
+ ;; If we don't know anything about the class, update shell routines
+ (if (and idlwave-shell-get-object-class
+ (not (assoc-ignore-case idlwave-shell-get-object-class
+ (idlwave-class-alist))))
+ (idlwave-shell-maybe-update-routine-info))
+ idlwave-shell-get-object-class)))
+
+ (defun idlwave-shell-parse-object-class ()
+ "Parse the output of the obj_class command."
+ (let ((match "print,obj_class([^\n\r]+[\n\r ]+"))
+ (if (and
+ (not (string-match (concat match match "\\s-*^[\n\r]+"
+ "% Syntax error")
+ 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)))))
+
+
(defun idlwave-shell-complete (&optional arg)
"Do completion in the idlwave-shell buffer.
Calls `idlwave-shell-complete-filename' after some executive commands or
in strings. Otherwise, calls `idlwave-complete' to complete modules and
keywords."
(interactive "P")
(let (cmd)
(cond
***************
*** 1776,1788 ****
".COM" ".COMP" ".COMPI" ".COMPIL" ".COMPILE"))
;; This command expects file names
(idlwave-shell-complete-filename)))
((and (idlwave-shell-filename-string)
(save-excursion
(beginning-of-line)
(let ((case-fold-search t))
! (not (looking-at ".*obj_new"))))
! ;; In a string, could be a file name to here
! (idlwave-shell-complete-filename)))
(t
;; Default completion of modules and keywords
(idlwave-complete arg)))))
--- 1857,1873 ----
".COM" ".COMP" ".COMPI" ".COMPIL" ".COMPILE"))
;; This command expects file names
(idlwave-shell-complete-filename)))
+
+ ((idlwave-shell-batch-command)
+ (idlwave-shell-complete-filename))
+
((and (idlwave-shell-filename-string)
(save-excursion
(beginning-of-line)
(let ((case-fold-search t))
! (not (looking-at ".*obj_new")))))
! (idlwave-shell-complete-filename))
!
(t
;; Default completion of modules and keywords
(idlwave-complete arg)))))
***************
*** 1790,1825 ****
(defun idlwave-shell-complete-filename (&optional arg)
"Complete a file name at point if after a file name.
We assume that we are after a file name when completing one of the
! args of an executive .run, .rnew or .compile. Also, in a string
! constant we complete file names. Otherwise return nil, so that
! other completion functions can do their work."
! ;; Comint does something funny with the default directory,
! ;; so we set it here from out safe own variable
! (setq default-directory
! (file-name-as-directory idlwave-shell-default-directory))
! (if (not idlwave-shell-wd-is-synched)
! ;; Some IDL stuff has been executed since last update, so we need to
! ;; do it again.
! (idlwave-shell-send-command
! idlwave-shell-dirstack-query
! `(progn
! (idlwave-shell-filter-directory)
! (setq idlwave-shell-wd-is-synched t)
! (switch-to-buffer (idlwave-shell-buffer))
! (goto-char ,(point)) ;; This is necesary on Emacs, don't know why
! ;; after the update, we immediately redo the completion, so the
! ;; user will hardly notice we did the update.
! (idlwave-shell-complete-filename))
! 'hide)
! (let* ((comint-file-name-chars idlwave-shell-file-name-chars)
! (completion-ignore-case (default-value 'completion-ignore-case)))
! (comint-dynamic-complete-filename))))
(defun idlwave-shell-executive-command ()
"Return the name of the current executive command, if any."
(save-excursion
(idlwave-beginning-of-statement)
! (if (looking-at "[ \t]*\\([.][^ \t\n\r]*\\)")
(match-string 1))))
(defun idlwave-shell-filename-string ()
--- 1875,1891 ----
(defun idlwave-shell-complete-filename (&optional arg)
"Complete a file name at point if after a file name.
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)))
(defun idlwave-shell-executive-command ()
"Return the name of the current executive command, if any."
(save-excursion
(idlwave-beginning-of-statement)
! (if (looking-at "[ \t]*\\([.][^ \t\n\r]+\\)")
(match-string 1))))
(defun idlwave-shell-filename-string ()
***************
*** 1831,1836 ****
--- 1897,1911 ----
;; Check of the next char is a string delimiter
(memq (preceding-char) '(?\' ?\")))))
+ (defun idlwave-shell-batch-command ()
+ "Returns t if we're in a batch command statement like @foo"
+ (let ((limit (save-excursion (beginning-of-line) (point))))
+ (save-excursion
+ ;; Skip backwards over filename
+ (skip-chars-backward idlwave-shell-file-name-chars limit)
+ (skip-chars-backward " \t" limit)
+ (and (eq (preceding-char) ?@) (not (idlwave-in-quote))))))
+
;;;
;;; This section contains code for debugging IDL programs.
--------------------
;;;
***************
*** 2008,2014 ****
(or (not arg) (< arg 1)
(setq arg 1))
(idlwave-shell-send-command
! (concat ".s " (if (integerp arg) (int-to-string arg) arg))))
(defun idlwave-shell-stepover (arg)
"Stepover one source line.
--- 2083,2090 ----
(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.
***************
*** 2018,2026 ****
(or (not arg) (< arg 1)
(setq arg 1))
(idlwave-shell-send-command
! (concat ".so " (if (integerp arg) (int-to-string arg) arg))))
! (defun idlwave-shell-break-here (&optional count cmd)
"Set breakpoint at current line.
If Count is nil then an ordinary breakpoint is set. We treat a count
--- 2094,2103 ----
(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
***************
*** 2032,2043 ****
the breakpoint."
(interactive "P")
! (if (listp count)
! (setq count nil))
(idlwave-shell-set-bp
;; Create breakpoint
(idlwave-shell-bp (idlwave-shell-current-frame)
! (list count cmd)
(idlwave-shell-current-module))))
(defun idlwave-shell-set-bp-check (bp)
--- 2109,2122 ----
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
;; Create breakpoint
(idlwave-shell-bp (idlwave-shell-current-frame)
! (list count cmd condition)
(idlwave-shell-current-module))))
(defun idlwave-shell-set-bp-check (bp)
***************
*** 2061,2067 ****
;; Clean up before retrying
(idlwave-shell-command-failure)
(idlwave-shell-send-command
! (concat ".run " (idlwave-shell-bp-get bp 'file)) nil nil)
;; Try setting breakpoint again
(idlwave-shell-set-bp bp))
(beep)
--- 2140,2147 ----
;; 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))
(beep)
***************
*** 2084,2105 ****
(defun idlwave-shell-cont ()
"Continue executing."
(interactive)
! (idlwave-shell-send-command ".c" '(idlwave-shell-redisplay 'hide)))
(defun idlwave-shell-go ()
"Run .GO. This starts the main program of the last compiled file."
(interactive)
! (idlwave-shell-send-command ".go" '(idlwave-shell-redisplay 'hide)))
(defun idlwave-shell-return ()
"Run .RETURN (continue to next return, but stay in subprogram)."
(interactive)
! (idlwave-shell-send-command ".return" '(idlwave-shell-redisplay 'hide)))
(defun idlwave-shell-skip ()
"Run .SKIP (skip one line, then step)."
(interactive)
! (idlwave-shell-send-command ".skip" '(idlwave-shell-redisplay 'hide)))
(defun idlwave-shell-clear-bp (bp)
"Clear breakpoint BP.
--- 2164,2189 ----
(defun idlwave-shell-cont ()
"Continue executing."
(interactive)
! (idlwave-shell-send-command ".c" '(idlwave-shell-redisplay 'hide)
! (idlwave-shell-hide-p 'debug)))
(defun idlwave-shell-go ()
"Run .GO. This starts the main program of the last compiled file."
(interactive)
! (idlwave-shell-send-command ".go" '(idlwave-shell-redisplay 'hide)
! (idlwave-shell-hide-p 'debug)))
(defun idlwave-shell-return ()
"Run .RETURN (continue to next return, but stay in subprogram)."
(interactive)
! (idlwave-shell-send-command ".return" '(idlwave-shell-redisplay 'hide)
! (idlwave-shell-hide-p 'debug)))
(defun idlwave-shell-skip ()
"Run .SKIP (skip one line, then step)."
(interactive)
! (idlwave-shell-send-command ".skip" '(idlwave-shell-redisplay 'hide)
! (idlwave-shell-hide-p 'debug)))
(defun idlwave-shell-clear-bp (bp)
"Clear breakpoint BP.
***************
*** 2109,2115 ****
(progn
(idlwave-shell-send-command
(concat "breakpoint,/clear,"
! (if (integerp index) (int-to-string index) index)))
(idlwave-shell-bp-query)))))
(defun idlwave-shell-current-frame ()
--- 2193,2200 ----
(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)))))
(defun idlwave-shell-current-frame ()
***************
*** 2155,2165 ****
(beep)
(message "Cannot identify breakpoint for this line"))))))
(defun idlwave-shell-to-here ()
"Set a breakpoint with count 1 then continue."
(interactive)
(idlwave-shell-break-here 1)
! (idlwave-shell-cont))
(defun idlwave-shell-break-in (&optional module)
"Look for a module name near point and set a break point for it.
--- 2240,2264 ----
(beep)
(message "Cannot identify breakpoint for this line"))))))
+ (defun idlwave-shell-disable-all-bp (&optional enable)
+ "Disable all breakpoints we know about.
+ 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)
+ (idlwave-shell-disable-all-bp)
(idlwave-shell-break-here 1)
! (idlwave-shell-cont)
! (idlwave-shell-disable-all-bp 'enable))
(defun idlwave-shell-break-in (&optional module)
"Look for a module name near point and set a break point for it.
***************
*** 2244,2250 ****
"Attempt to run until this procedure exits.
Runs to the last statement and then steps 1 statement. Use the .out command."
(interactive)
! (idlwave-shell-send-command (concat ".o")))
(defun idlwave-shell-help-expression (arg)
"Print help on current expression. See `idlwave-shell-print'."
--- 2343,2349 ----
"Attempt to run until this procedure exits.
Runs to the last statement and then steps 1 statement. Use the .out command."
(interactive)
! (idlwave-shell-send-command ".o" nil (idlwave-shell-hide-p 'debug)))
(defun idlwave-shell-help-expression (arg)
"Print help on current expression. See `idlwave-shell-print'."
***************
*** 2336,2342 ****
(arg
(setq expr (read-string "Expression: ")))
(t
! (idlwave-with-special-syntax1
;; Move to beginning of current or previous expression
(if (looking-at "\\<\\|(")
;; At beginning of expression, don't move backwards unless
--- 2435,2441 ----
(arg
(setq expr (read-string "Expression: ")))
(t
! (idlwave-with-special-syntax
;; Move to beginning of current or previous expression
(if (looking-at "\\<\\|(")
;; At beginning of expression, don't move backwards unless
***************
*** 2683,2689 ****
(idlwave-look-at "\\<end\\>")))
(insert "\nend\n"))
(save-buffer 0)))
! (idlwave-shell-send-command (concat ".run " idlwave-shell-temp-pro-file))
(if n
(idlwave-display-buffer (idlwave-shell-buffer)
nil (idlwave-shell-shell-frame))))
--- 2782,2789 ----
(idlwave-look-at "\\<end\\>")))
(insert "\nend\n"))
(save-buffer 0)))
! (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))))
***************
*** 2715,2722 ****
(error nil))))
(defun idlwave-display-buffer (buf not-this-window-p &optional frame)
! (if (not (frame-live-p frame)) (setq frame nil))
! (display-buffer buf not-this-window-p frame))
(defvar idlwave-shell-bp-buffer " *idlwave-shell-bp*"
"Scratch buffer for parsing IDL breakpoint lists and other stuff.")
--- 2815,2841 ----
(error nil))))
(defun idlwave-display-buffer (buf not-this-window-p &optional frame)
! (if (featurep 'xemacs)
! ;; The XEmacs version enforces the frame
! (display-buffer buf not-this-window-p frame)
! ;; For Emacs, we need to force the frame ourselves.
! (let ((this-frame (selected-frame)))
! (if (frame-live-p frame)
! (select-frame frame))
! (if (eq this-frame (selected-frame))
! ;; same frame: use display buffer, to make sure the current
! ;; window stays.
! (display-buffer buf)
! ;; different frame
! (if (one-window-p)
! ;; only window: switch
! (progn
! (switch-to-buffer buf)
! (selected-window)) ; must return the window.
! ;; several windows - use display-buffer
! (display-buffer buf not-this-window-p))))))
! ; (if (not (frame-live-p frame)) (setq frame nil))
! ; (display-buffer buf not-this-window-p frame))
(defvar idlwave-shell-bp-buffer " *idlwave-shell-bp*"
"Scratch buffer for parsing IDL breakpoint lists and other stuff.")
***************
*** 2744,2749 ****
--- 2863,2869 ----
((eq item 'data) (cdr (cdr bp)))
((eq item 'count) (nth 0 (cdr (cdr bp))))
((eq item 'cmd) (nth 1 (cdr (cdr bp))))
+ ((eq item 'condition) (nth 2 (cdr (cdr bp))))
;; IDL breakpoint info
((eq item 'module) (nth 1 (car (cdr bp))))
;; index - default
***************
*** 2762,2768 ****
;; Searching the breakpoints
;; 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=\\)\\(\\S-+\\)?\\s-+\\(\\S-+\\)")
file line index module
bp-re indmap)
(setq idlwave-shell-bp-alist (list nil))
--- 2882,2888 ----
;; Searching the breakpoints
;; 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))
***************
*** 2774,2780 ****
(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 5))))
;; There seems to be a breakpoint listing here.
;; Parse breakpoint lines.
;; Breakpoints have the form
--- 2894,2900 ----
(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
***************
*** 2844,2851 ****
The breakpoint will be placed at the beginning of the statement on the
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 than used with the breakpoint
command."
;; Get and save the old breakpoints
--- 2964,2971 ----
The breakpoint will be placed at the beginning of the statement on the
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
***************
*** 2878,2883 ****
--- 2998,3006 ----
",/once")
((> 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,'"
***************
*** 2888,2895 ****
`(progn
(if (idlwave-shell-set-bp-check (quote ,bp))
(idlwave-shell-set-bp3 (quote ,bp))))
! ;; do not hide output
! nil
'preempt)))
(defun idlwave-shell-set-bp3 (bp)
--- 3011,3018 ----
`(progn
(if (idlwave-shell-set-bp-check (quote ,bp))
(idlwave-shell-set-bp3 (quote ,bp))))
! ;; hide output?
! (idlwave-shell-hide-p 'breakpoint)
'preempt)))
(defun idlwave-shell-set-bp3 (bp)
***************
*** 3075,3095 ****
(t (error "Unknown action %s" action)))
idlwave-shell-last-save-and-action-file)
'idlwave-shell-maybe-update-routine-info
! nil)
(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))))
! (defun idlwave-shell-maybe-update-routine-info ()
"Update the routine info if the shell is not stopped at an error."
(if (and (not idlwave-shell-is-stopped)
(or (eq t idlwave-auto-routine-info-updates)
(memq 'compile-buffer idlwave-auto-routine-info-updates))
idlwave-query-shell-for-routine-info
idlwave-routines)
! (idlwave-shell-update-routine-info t)))
(defvar idlwave-shell-sources-query "help,/source,/full"
"IDL command to obtain source files for compiled procedures.")
--- 3198,3218 ----
(t (error "Unknown action %s" action)))
idlwave-shell-last-save-and-action-file)
'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))))
! (defun idlwave-shell-maybe-update-routine-info (&optional wait)
"Update the routine info if the shell is not stopped at an error."
(if (and (not idlwave-shell-is-stopped)
(or (eq t idlwave-auto-routine-info-updates)
(memq 'compile-buffer idlwave-auto-routine-info-updates))
idlwave-query-shell-for-routine-info
idlwave-routines)
! (idlwave-shell-update-routine-info t nil 'wait)))
(defvar idlwave-shell-sources-query "help,/source,/full"
"IDL command to obtain source files for compiled procedures.")
***************
*** 3161,3167 ****
))))
(cdr al))))
-
(defun idlwave-shell-clear-all-bp ()
"Remove all breakpoints in IDL."
(interactive)
--- 3284,3289 ----
***************
*** 3235,3241 ****
--- 3357,3365 ----
(define-key idlwave-shell-mode-map "\M-\t" 'idlwave-shell-complete)
(define-key idlwave-shell-mode-map "\C-c\C-s" 'idlwave-shell)
(define-key idlwave-shell-mode-map "\C-c?" 'idlwave-routine-info)
+ (define-key idlwave-shell-mode-map "\C-g" 'idlwave-keyboard-quit)
(define-key idlwave-shell-mode-map "\M-?" 'idlwave-context-help)
+ (define-key idlwave-shell-mode-map [(control meta ?\?)] 'idlwave-online-help)
(define-key idlwave-shell-mode-map "\C-c\C-i" 'idlwave-update-routine-info)
(define-key idlwave-shell-mode-map "\C-c\C-y" 'idlwave-shell-char-mode-loop)
(define-key idlwave-shell-mode-map "\C-c\C-x" 'idlwave-shell-send-char)
***************
*** 3526,3530 ****
(if idlwave-shell-use-toolbar
(add-hook 'idlwave-shell-mode-hook 'idlwave-toolbar-add-everywhere))
-
;;; idlw-shell.el ends here
--- 3650,3653 ----