Mercurial > emacs
annotate lisp/progmodes/idlwave-shell.el @ 26995:85c7cda1975f
(CHAR_BYTES): Use ((1 << CHARACTERBITS) - 1) instead
of GLYPH_MASK_CHAR.
author | Kenichi Handa <handa@m17n.org> |
---|---|
date | Mon, 27 Dec 1999 05:04:23 +0000 |
parents | 35105166b1c9 |
children |
rev | line source |
---|---|
26958
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1 ;;; idlwave-shell.el --- Run IDL or WAVE as an inferior process of Emacs. |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
2 ;; Copyright (c) 1994-1996 Chris Chase |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
3 ;; Copyright (c) 1999 Carsten Dominik |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
4 ;; Copyright (c) 1999 Free Software Foundation |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
5 |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
6 ;; Author: Chris Chase <chase@att.com> |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
7 ;; Maintainer: Carsten Dominik <dominik@strw.leidenuniv.nl> |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
8 ;; Version: 3.11 |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
9 ;; Date: $Date: 1999/12/06 08:13:16 $ |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
10 ;; Keywords: processes |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
11 |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
12 ;; This file is part of GNU Emacs. |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
13 |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
14 ;; GNU Emacs is free software; you can redistribute it and/or modify |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
15 ;; it under the terms of the GNU General Public License as published by |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
16 ;; the Free Software Foundation; either version 2, or (at your option) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
17 ;; any later version. |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
18 |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
19 ;; GNU Emacs is distributed in the hope that it will be useful, |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
20 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
21 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
22 ;; GNU General Public License for more details. |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
23 |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
24 ;; You should have received a copy of the GNU General Public License |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
25 ;; along with GNU Emacs; see the file COPYING. If not, write to the |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
26 ;; Free Software Foundation, Inc., 59 Temple Place - Suite 330, |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
27 ;; Boston, MA 02111-1307, USA. |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
28 |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
29 ;;; Commentary: |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
30 |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
31 ;; This mode is for IDL version 4 or later. It should work on Emacs |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
32 ;; or XEmacs version 19 or later. |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
33 |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
34 ;; Runs IDL as an inferior process of Emacs, much like the emacs |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
35 ;; `shell' or `telnet' commands. Provides command history and |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
36 ;; searching. Provides debugging commands available in buffers |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
37 ;; visiting IDL procedure files, e.g., breakpoint setting, stepping, |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
38 ;; execution until a certain line, printing expressions under point, |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
39 ;; visual line pointer for current execution line, etc. |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
40 ;; |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
41 ;; Documentation should be available online with `M-x idlwave-info'. |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
42 |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
43 ;; INSTALLATION: |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
44 ;; ============= |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
45 ;; |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
46 ;; Follow the instructions in the INSTALL file of the distribution. |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
47 ;; In short, put this file on your load path and add the following |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
48 ;; lines to your .emacs file: |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
49 ;; |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
50 ;; (autoload 'idlwave-shell "idlwave-shell" "IDLWAVE Shell" t) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
51 ;; |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
52 ;; |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
53 ;; SOURCE |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
54 ;; ====== |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
55 ;; |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
56 ;; The newest version of this file can be found on the maintainers |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
57 ;; web site. |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
58 ;; |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
59 ;; http://www.strw.leidenuniv.el/~dominik/Tools/idlwave |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
60 ;; |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
61 ;; DOCUMENTATION |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
62 ;; ============= |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
63 ;; |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
64 ;; IDLWAVE is documented online in info format. |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
65 ;; A printable version of the documentation is available from the |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
66 ;; maintainers webpage (see under SOURCE) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
67 ;; |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
68 ;; |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
69 ;; KNOWN PROBLEMS |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
70 ;; ============== |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
71 ;; |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
72 ;; The idlwave-shell buffer seems to occasionally lose output from the IDL |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
73 ;; process. I have not been able to consistently observe this. I |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
74 ;; do not know if it is a problem with idlwave-shell, comint, or Emacs |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
75 ;; handling of subprocesses. |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
76 ;; |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
77 ;; I don't plan on implementing directory tracking by watching the IDL |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
78 ;; commands entered at the prompt, since too often an IDL procedure |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
79 ;; will change the current directory. If you want the the idl process |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
80 ;; buffer to match the IDL current working just execute `M-x |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
81 ;; idlwave-shell-resync-dirs' (bound to "\C-c\C-d\C-w" by default.) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
82 ;; |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
83 ;; The stack motion commands `idlwave-shell-stack-up' and |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
84 ;; `idlwave-shell-stack-down' only display the calling frame but |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
85 ;; cannot show the values of variables in higher frames correctly. I |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
86 ;; just don't know how to get these values from IDL. Anyone knows the |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
87 ;; magic word to do this? |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
88 ;; Also, the stack pointer stays at the level where is was and is not |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
89 ;; reset correctly when you type executive commands in the shell buffer |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
90 ;; yourself. However, using the executive commands bound to key sequences |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
91 ;; does the reset correctly. As a workaround, just jump down when needed. |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
92 ;; |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
93 ;; Under XEmacs the Debug menu in the shell does not display the |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
94 ;; keybindings in the prefix map. There bindings are available anyway - so |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
95 ;; it is a bug in XEmacs. |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
96 ;; The Debug menu in source buffers does display the bindings correctly. |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
97 ;; |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
98 ;; |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
99 ;; CUSTOMIZATION VARIABLES |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
100 ;; ======================= |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
101 ;; |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
102 ;; IDLWAVE has customize support - so if you want to learn about |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
103 ;; the variables which control the behavior of the mode, use |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
104 ;; `M-x idlwave-customize'. |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
105 ;; |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
106 ;;-------------------------------------------------------------------------- |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
107 ;; |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
108 ;; |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
109 |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
110 ;;; Code: |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
111 |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
112 (require 'comint) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
113 (require 'idlwave) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
114 |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
115 (eval-when-compile (require 'cl)) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
116 |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
117 (defvar idlwave-shell-have-new-custom nil) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
118 (eval-and-compile |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
119 ;; Kludge to allow `defcustom' for Emacs 19. |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
120 (condition-case () (require 'custom) (error nil)) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
121 (if (and (featurep 'custom) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
122 (fboundp 'custom-declare-variable) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
123 (fboundp 'defface)) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
124 ;; We've got what we needed |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
125 (setq idlwave-shell-have-new-custom t) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
126 ;; We have the old or no custom-library, hack around it! |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
127 (defmacro defgroup (&rest args) nil) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
128 (defmacro defcustom (var value doc &rest args) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
129 (` (defvar (, var) (, value) (, doc)))))) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
130 |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
131 ;;; Customizations: idlwave-shell group |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
132 |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
133 (defgroup idlwave-shell-general-setup nil |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
134 "Indentation options for IDL/WAVE mode." |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
135 :prefix "idlwave" |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
136 :group 'idlwave) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
137 |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
138 (defcustom idlwave-shell-prompt-pattern "^ ?IDL> " |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
139 "*Regexp to match IDL prompt at beginning of a line. |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
140 For example, \"^IDL> \" or \"^WAVE> \". |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
141 The \"^\" means beginning of line. |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
142 This variable is used to initialise `comint-prompt-regexp' in the |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
143 process buffer. |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
144 |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
145 This is a fine thing to set in your `.emacs' file." |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
146 :group 'idlwave-shell-general-setup |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
147 :type 'regexp) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
148 |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
149 (defcustom idlwave-shell-process-name "idl" |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
150 "*Name to be associated with the IDL process. The buffer for the |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
151 process output is made by surrounding this name with `*'s." |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
152 :group 'idlwave-shell-general-setup |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
153 :type 'string) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
154 |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
155 (defcustom idlwave-shell-automatic-start nil |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
156 "*If non-nil attempt invoke idlwave-shell if not already running. |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
157 This is checked when an attempt to send a command to an |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
158 IDL process is made." |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
159 :group 'idlwave-shell-general-setup |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
160 :type 'boolean) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
161 |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
162 (defcustom idlwave-shell-initial-commands "!more=0" |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
163 "Initial commands, separated by newlines, to send to IDL. |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
164 This string is sent to the IDL process by `idlwave-shell-mode' which is |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
165 invoked by `idlwave-shell'." |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
166 :group 'idlwave-shell-initial-commands |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
167 :type 'string) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
168 |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
169 (defcustom idlwave-shell-use-dedicated-frame nil |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
170 "*Non-nil means, IDLWAVE should use a special frame to display shell buffer." |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
171 :group 'idlwave-shell-general-setup |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
172 :type 'boolean) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
173 |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
174 (defcustom idlwave-shell-frame-parameters |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
175 '((height . 30) (unsplittable . nil)) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
176 "The frame parameters for a dedicated idlwave-shell frame. |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
177 See also `idlwave-shell-use-dedicated-frame'. |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
178 The default makes the frame splittable, so that completion works correctly." |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
179 :group 'idlwave-shell-general-setup |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
180 :type '(repeat |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
181 (cons symbol sexp))) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
182 |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
183 (defcustom idlwave-shell-use-toolbar t |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
184 "Non-nil means, use the debugging toolbar in all IDL related buffers. |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
185 Available on XEmacs and on Emacs 21.x or later. |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
186 Needs to be set at load-time, so don't try to do this in the hook." |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
187 :group 'idlwave-shell-general-setup |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
188 :type 'boolean) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
189 |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
190 (defcustom idlwave-shell-temp-pro-prefix "/tmp/idltemp" |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
191 "*The prefix for temporary IDL files used when compiling regions. |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
192 It should be an absolute pathname. |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
193 The full temporary file name is obtained by to using `make-temp-name' |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
194 so that the name will be unique among multiple Emacs processes." |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
195 :group 'idlwave-shell-general-setup |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
196 :type 'string) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
197 |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
198 (defvar idlwave-shell-fix-inserted-breaks nil |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
199 "*OBSOLETE VARIABLE, is no longer used. |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
200 |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
201 The documentation of this variable used to be: |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
202 If non-nil then run `idlwave-shell-remove-breaks' to clean up IDL messages.") |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
203 |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
204 (defcustom idlwave-shell-prefix-key "\C-c\C-d" |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
205 "*The prefix key for the debugging map `idlwave-shell-mode-prefix-map'. |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
206 This variable must already be set when idlwave-shell.el is loaded. |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
207 Seting it in the mode-hook is too late." |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
208 :group 'idlwave-shell-general-setup |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
209 :type 'string) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
210 |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
211 (defcustom idlwave-shell-activate-prefix-keybindings t |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
212 "Non-nil means, the debug commands will be bound to the prefix key. |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
213 The prefix key itself is given in the option `idlwave-shell-prefix-key'. |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
214 So by default setting a breakpoint will be on C-c C-d C-b." |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
215 :group 'idlwave-shell-general-setup |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
216 :type 'boolean) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
217 |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
218 (defcustom idlwave-shell-activate-alt-keybindings nil |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
219 "Non-nil means, the debug commands will be bound to alternate keys. |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
220 So for example setting a breakpoint will be on A-b." |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
221 :group 'idlwave-shell-general-setup |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
222 :type 'boolean) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
223 |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
224 (defcustom idlwave-shell-use-truename nil |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
225 "*Non-nil means, use use `file-truename' when looking for buffers. |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
226 If this variable is non-nil, Emacs will use the function `file-truename' to |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
227 resolve symbolic links in the file paths printed by e.g., STOP commands. |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
228 This means, unvisited files will be loaded under their truename. |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
229 However, when a file is already visited under a deffernet name, IDLWAVE will |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
230 reuse that buffer. |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
231 This option was once introduced in order to avoid multiple buffers visiting |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
232 the same file. However, IDLWAVE no longer makes this mistake, so it is safe |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
233 to set this option to nil." |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
234 :group 'idlwave-shell-general-setup |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
235 :type 'boolean) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
236 |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
237 (defcustom idlwave-shell-file-name-chars "~/A-Za-z0-9+@:_.$#%={}-" |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
238 "The characters allowed in file names, as a string. |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
239 Used for file name completion. Must not contain `'', `,' and `\"' |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
240 because these are used as separators by IDL." |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
241 :group 'idlwave-shell-general-setup |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
242 :type 'string) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
243 |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
244 (defcustom idlwave-shell-mode-hook '() |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
245 "*Hook for customising `idlwave-shell-mode'." |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
246 :group 'idlwave-shell-general-setup |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
247 :type 'hook) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
248 |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
249 ;;; Breakpoint Overlays etc |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
250 |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
251 (defgroup idlwave-shell-highlighting-and-faces nil |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
252 "Indentation options for IDL/WAVE mode." |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
253 :prefix "idlwave" |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
254 :group 'idlwave) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
255 |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
256 (defcustom idlwave-shell-mark-stop-line t |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
257 "*Non-nil means, mark the source code line where IDL is currently stopped. |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
258 Value decides about the method which is used to mark the line. Legal values |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
259 are: |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
260 |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
261 nil Do not mark the line |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
262 'arrow Use the overlay arrow |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
263 'face Use `idlwave-shell-stop-line-face' to highlight the line. |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
264 t Use what IDLWAVE things is best. Will be a face where possible, |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
265 otherwise the overlay arrow. |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
266 The overlay-arrow has the disadvantage to hide the first chars of a line. |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
267 Since many people do not have the main block of IDL programs indented, |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
268 a face highlighting may be better. |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
269 On Emacs 21, the overlay arrow is displayed in a special area and never |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
270 hides any code, so setting this to 'arrow on Emacs 21 sounds like a good idea." |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
271 :group 'idlwave-shell-highlighting-and-faces |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
272 :type '(choice |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
273 (const :tag "No marking" nil) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
274 (const :tag "Use overlay arrow" arrow) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
275 (const :tag "Highlight with face" face) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
276 (const :tag "Face or arrow." t))) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
277 |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
278 (defcustom idlwave-shell-overlay-arrow ">" |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
279 "*The overlay arrow to display at source lines where execution halts. |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
280 We use a single character by default, since the main block of IDL procedures |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
281 often has no indentation. Where possible, IDLWAVE will use overlays to |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
282 display the stop-lines. The arrow is only used on character-based terminals. |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
283 See also `idlwave-shell-use-overlay-arrow'." |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
284 :group 'idlwave-shell-highlighting-and-faces |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
285 :type 'string) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
286 |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
287 (defcustom idlwave-shell-stop-line-face 'highlight |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
288 "*The face for `idlwave-shell-stop-line-overlay'. |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
289 Allows you to choose the font, color and other properties for |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
290 line where IDL is stopped. See also `idlwave-shell-mark-stop-line'." |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
291 :group 'idlwave-shell-highlighting-and-faces |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
292 :type 'symbol) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
293 |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
294 (defcustom idlwave-shell-expression-face 'secondary-selection |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
295 "*The face for `idlwave-shell-expression-overlay'. |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
296 Allows you to choose the font, color and other properties for |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
297 the expression printed by IDL." |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
298 :group 'idlwave-shell-highlighting-and-faces |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
299 :type 'symbol) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
300 |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
301 (defcustom idlwave-shell-mark-breakpoints t |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
302 "*Non-nil means, mark breakpoints in the source files. |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
303 Legal values are: |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
304 nil Do not mark breakpoints. |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
305 'face Highlight line with `idlwave-shell-breakpoint-face'. |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
306 'glyph Red dot at the beginning of line. If the display does not |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
307 support glyphs, will use 'face instead. |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
308 t Glyph when possible, otherwise face (same effect as 'glyph)." |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
309 :group 'idlwave-shell-highlighting-and-faces |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
310 :type '(choice |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
311 (const :tag "No marking" nil) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
312 (const :tag "Highlight with face" face) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
313 (const :tag "Display glyph (red dot)" glyph) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
314 (const :tag "Glyph or face." t))) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
315 |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
316 (defvar idlwave-shell-use-breakpoint-glyph t |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
317 "Obsolete variable. See `idlwave-shell-mark-breakpoints.") |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
318 |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
319 (defcustom idlwave-shell-breakpoint-face 'idlwave-shell-bp-face |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
320 "*The face for breakpoint lines in the source code. |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
321 Allows you to choose the font, color and other properties for |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
322 lines which have a breakpoint. See also `idlwave-shell-mark-breakpoints'." |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
323 :group 'idlwave-shell-highlighting-and-faces |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
324 :type 'symbol) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
325 |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
326 (if idlwave-shell-have-new-custom |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
327 ;; We have the new customize - use it to define a customizable face |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
328 (defface idlwave-shell-bp-face |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
329 '((((class color)) (:foreground "Black" :background "Pink")) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
330 (t (:underline t))) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
331 "Face for highlighting lines-with-breakpoints." |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
332 :group 'idlwave-shell-highlighting-and-faces) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
333 ;; Just copy the underline face to be on the safe side. |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
334 (copy-face 'underline 'idlwave-shell-bp-face)) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
335 |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
336 ;;; End user customization variables |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
337 |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
338 ;;; External variables |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
339 (defvar comint-last-input-start) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
340 (defvar comint-last-input-end) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
341 |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
342 ;; Other variables |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
343 |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
344 (defvar idlwave-shell-temp-pro-file nil |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
345 "Absolute pathname for temporary IDL file for compiling regions") |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
346 |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
347 (defvar idlwave-shell-dirstack-query "printd" |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
348 "Command used by `idlwave-shell-resync-dirs' to query IDL for |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
349 the directory stack.") |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
350 |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
351 (defvar idlwave-shell-default-directory nil |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
352 "The default directory in the idlwave-shell buffer, of outside use.") |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
353 |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
354 (defvar idlwave-shell-last-save-and-action-file nil |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
355 "The last file which was compiled with `idlwave-shell-save-and-...'.") |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
356 |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
357 ;; Highlighting uses overlays. When necessary, require the emulation. |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
358 (if (not (fboundp 'make-overlay)) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
359 (condition-case nil |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
360 (require 'overlay) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
361 (error nil))) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
362 |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
363 (defvar idlwave-shell-stop-line-overlay nil |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
364 "The overlay for where IDL is currently stopped.") |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
365 (defvar idlwave-shell-expression-overlay nil |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
366 "The overlay for where IDL is currently stopped.") |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
367 ;; If these were already overlays, delete them. This probably means that we |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
368 ;; are reloading this file. |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
369 (if (overlayp idlwave-shell-stop-line-overlay) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
370 (delete-overlay idlwave-shell-stop-line-overlay)) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
371 (if (overlayp idlwave-shell-expression-overlay) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
372 (delete-overlay idlwave-shell-expression-overlay)) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
373 ;; Set to nil initially |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
374 (setq idlwave-shell-stop-line-overlay nil |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
375 idlwave-shell-expression-overlay nil) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
376 |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
377 ;; Define the shell stop overlay. When left nil, the arrow will be used. |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
378 (cond |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
379 ((or (null idlwave-shell-mark-stop-line) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
380 (eq idlwave-shell-mark-stop-line 'arrow)) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
381 ;; Leave the overlay nil |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
382 nil) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
383 |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
384 ((eq idlwave-shell-mark-stop-line 'face) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
385 ;; Try to use a face. If not possible, arrow will be used anyway |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
386 ;; So who can display faces? |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
387 (when (or (featurep 'xemacs) ; XEmacs can do also ttys |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
388 (fboundp 'tty-defined-colors) ; Emacs 21 as well |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
389 window-system) ; Window systems always |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
390 (progn |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
391 (setq idlwave-shell-stop-line-overlay (make-overlay 1 1)) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
392 (overlay-put idlwave-shell-stop-line-overlay |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
393 'face idlwave-shell-stop-line-face)))) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
394 |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
395 (t |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
396 ;; IDLWAVE may decide. Will use a face on window systems, arrow elsewhere |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
397 (if window-system |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
398 (progn |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
399 (setq idlwave-shell-stop-line-overlay (make-overlay 1 1)) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
400 (overlay-put idlwave-shell-stop-line-overlay |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
401 'face idlwave-shell-stop-line-face))))) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
402 |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
403 ;; Now the expression overlay |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
404 (setq idlwave-shell-expression-overlay (make-overlay 1 1)) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
405 (overlay-put idlwave-shell-expression-overlay |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
406 'face idlwave-shell-expression-face) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
407 |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
408 (defvar idlwave-shell-bp-query "help,/breakpoints" |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
409 "Command to obtain list of breakpoints") |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
410 |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
411 (defvar idlwave-shell-command-output nil |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
412 "String for accumulating current command output.") |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
413 |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
414 (defvar idlwave-shell-post-command-hook nil |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
415 "Lisp list expression or function to run when an IDL command is finished. |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
416 The current command is finished when the IDL prompt is displayed. |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
417 This is evaluated if it is a list or called with funcall.") |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
418 |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
419 (defvar idlwave-shell-hide-output nil |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
420 "If non-nil the process output is not inserted into the output |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
421 buffer.") |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
422 |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
423 (defvar idlwave-shell-accumulation nil |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
424 "Accumulate last line of output.") |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
425 |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
426 (defvar idlwave-shell-command-line-to-execute nil) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
427 (defvar idlwave-shell-cleanup-hook nil |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
428 "List of functions to do cleanup when the shell exits.") |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
429 |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
430 (defvar idlwave-shell-pending-commands nil |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
431 "List of commands to be sent to IDL. |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
432 Each element of the list is list of \(CMD PCMD HIDE\), where CMD is a |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
433 string to be sent to IDL and PCMD is a post-command to be placed on |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
434 `idlwave-shell-post-command-hook'. If HIDE is non-nil, hide the output |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
435 from command CMD. PCMD and HIDE are optional.") |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
436 |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
437 (defun idlwave-shell-buffer () |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
438 "Name of buffer associated with IDL process. |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
439 The name of the buffer is made by surrounding `idlwave-shell-process-name |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
440 with `*'s." |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
441 (concat "*" idlwave-shell-process-name "*")) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
442 |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
443 (defvar idlwave-shell-ready nil |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
444 "If non-nil can send next command to IDL process.") |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
445 |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
446 ;;; The following are the types of messages we attempt to catch to |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
447 ;;; resync our idea of where IDL execution currently is. |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
448 ;;; |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
449 |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
450 (defvar idlwave-shell-halt-frame nil |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
451 "The frame associated with halt/breakpoint messages.") |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
452 |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
453 (defvar idlwave-shell-step-frame nil |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
454 "The frame associated with step messages.") |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
455 |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
456 (defvar idlwave-shell-trace-frame nil |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
457 "The frame associated with trace messages.") |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
458 |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
459 (defconst idlwave-shell-halt-messages |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
460 '("^% Execution halted at" |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
461 "^% Interrupted at:" |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
462 "^% Stepped to:" |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
463 "^% At " |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
464 "^% Stop encountered:" |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
465 ) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
466 "*A list of regular expressions matching IDL messages. |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
467 These are the messages containing file and line information where |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
468 IDL is currently stopped.") |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
469 |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
470 (defconst idlwave-shell-halt-messages-re |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
471 (mapconcat 'identity idlwave-shell-halt-messages "\\|") |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
472 "The regular expression computed from idlwave-shell-halt-messages") |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
473 |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
474 (defconst idlwave-shell-trace-messages |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
475 '("^% At " ;; First line of a trace message |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
476 ) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
477 "*A list of regular expressions matching IDL trace messages. |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
478 These are the messages containing file and line information where |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
479 IDL will begin looking for the next statement to execute.") |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
480 |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
481 (defconst idlwave-shell-step-messages |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
482 '("^% Stepped to:" |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
483 ) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
484 "*A list of regular expressions matching stepped execution messages. |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
485 These are IDL messages containing file and line information where |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
486 IDL has currently stepped.") |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
487 |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
488 (defvar idlwave-shell-break-message "^% Breakpoint at:" |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
489 "*Regular expression matching an IDL breakpoint message line.") |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
490 |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
491 |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
492 (defvar idlwave-shell-bp-alist) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
493 ;(defvar idlwave-shell-post-command-output) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
494 (defvar idlwave-shell-sources-alist) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
495 (defvar idlwave-shell-menu-def) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
496 (defvar idlwave-shell-mode-menu) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
497 (defvar idlwave-shell-initial-commands) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
498 (defvar idlwave-shell-syntax-error) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
499 (defvar idlwave-shell-other-error) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
500 (defvar idlwave-shell-error-buffer) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
501 (defvar idlwave-shell-error-last) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
502 (defvar idlwave-shell-bp-buffer) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
503 (defvar idlwave-shell-sources-query) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
504 (defvar idlwave-shell-mode-map) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
505 |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
506 (defun idlwave-shell-mode () |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
507 "Major mode for interacting with an inferior IDL process. |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
508 |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
509 1. Shell Interaction |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
510 ----------------- |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
511 RET after the end of the process' output sends the text from the |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
512 end of process to the end of the current line. RET before end of |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
513 process output copies the current line (except for the prompt) to the |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
514 end of the buffer. |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
515 |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
516 Command history, searching of previous commands, command line |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
517 editing are available via the comint-mode key bindings, by default |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
518 mostly on the key `C-c'. |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
519 |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
520 2. Completion |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
521 ---------- |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
522 |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
523 TAB and M-TAB do completion of IDL routines and keywords - similar |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
524 to M-TAB in `idlwave-mode'. In executive commands and strings, |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
525 it completes file names. |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
526 |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
527 3. Routine Info |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
528 ------------ |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
529 `\\[idlwave-routine-info]' displays information about an IDL routine near point, |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
530 just like in `idlwave-mode'. The module used is the one at point or |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
531 the one whose argument list is being edited. |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
532 To update IDLWAVE's knowledge about compiled or edited modules, use |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
533 \\[idlwave-update-routine-info]. |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
534 \\[idlwave-find-module] find the source of a module. |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
535 \\[idlwave-resolve] tells IDL to compile an unresolved module. |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
536 |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
537 4. Debugging |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
538 --------- |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
539 A complete set of commands for compiling and debugging IDL programs |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
540 is available from the menu. Also keybindings starting with a |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
541 `C-c C-d' prefix are available for most commands in the *idl* buffer |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
542 and also in source buffers. The best place to learn about the |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
543 keybindings is again the menu. |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
544 |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
545 On Emacs versions where this is possible, a debugging toolbar is |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
546 installed. |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
547 |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
548 When IDL is halted in the middle of a procedure, the corresponding |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
549 line of that procedure file is displayed with an overlay in another |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
550 window. Breakpoints are also highlighted in the source. |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
551 |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
552 \\[idlwave-shell-resync-dirs] queries IDL in order to change Emacs current directory |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
553 to correspond to the IDL process current directory. |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
554 |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
555 5. Hooks |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
556 ----- |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
557 Turning on `idlwave-shell-mode' runs `comint-mode-hook' and |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
558 `idlwave-shell-mode-hook' (in that order). |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
559 |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
560 6. Documentation and Customization |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
561 ------------------------------- |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
562 Info documentation for this package is available. Use \\[idlwave-info] |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
563 to display (complain to your sysadmin if that does not work). |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
564 For Postscript and HTML versions of the documentation, check IDLWAVE's |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
565 homepage at `http://www.strw.leidenuniv.nl/~dominik/Tools/idlwave'. |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
566 IDLWAVE has customize support - see the group `idlwave'. |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
567 |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
568 7. Keybindings |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
569 ----------- |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
570 \\{idlwave-shell-mode-map}" |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
571 |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
572 (interactive) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
573 (setq comint-prompt-regexp idlwave-shell-prompt-pattern) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
574 (setq comint-process-echoes t) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
575 ;; Can not use history expansion because "!" is used for system variables. |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
576 (setq comint-input-autoexpand nil) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
577 (setq comint-input-ring-size 64) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
578 (make-local-variable 'comint-completion-addsuffix) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
579 (set (make-local-variable 'completion-ignore-case) t) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
580 (setq comint-completion-addsuffix '("/" . "")) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
581 (setq comint-input-ignoredups t) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
582 (setq major-mode 'idlwave-shell-mode) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
583 (setq mode-name "IDL-Shell") |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
584 ;; (make-local-variable 'idlwave-shell-bp-alist) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
585 (setq idlwave-shell-halt-frame nil |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
586 idlwave-shell-trace-frame nil |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
587 idlwave-shell-command-output nil |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
588 idlwave-shell-step-frame nil) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
589 (idlwave-shell-display-line nil) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
590 ;; Make sure comint-last-input-end does not go to beginning of |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
591 ;; buffer (in case there were other processes already in this buffer). |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
592 (set-marker comint-last-input-end (point)) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
593 (setq idlwave-shell-ready nil) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
594 (setq idlwave-shell-bp-alist nil) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
595 (idlwave-shell-update-bp-overlays) ; Throw away old overlays |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
596 (setq idlwave-shell-sources-alist nil) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
597 (setq idlwave-shell-default-directory default-directory) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
598 ;; (make-local-variable 'idlwave-shell-temp-pro-file) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
599 (setq idlwave-shell-hide-output nil |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
600 idlwave-shell-temp-pro-file |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
601 (concat (make-temp-name idlwave-shell-temp-pro-prefix) ".pro")) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
602 (make-local-hook 'kill-buffer-hook) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
603 (add-hook 'kill-buffer-hook 'idlwave-shell-kill-shell-buffer-confirm |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
604 nil 'local) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
605 (use-local-map idlwave-shell-mode-map) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
606 (easy-menu-add idlwave-shell-mode-menu idlwave-shell-mode-map) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
607 (run-hooks 'idlwave-shell-mode-hook) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
608 (idlwave-shell-send-command idlwave-shell-initial-commands nil 'hide) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
609 ) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
610 |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
611 (if (not (fboundp 'idl-shell)) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
612 (fset 'idl-shell 'idlwave-shell)) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
613 |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
614 (defvar idlwave-shell-idl-wframe nil |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
615 "Frame for displaying the idl shell window.") |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
616 (defvar idlwave-shell-display-wframe nil |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
617 "Frame for displaying the idl source files.") |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
618 |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
619 (defvar idlwave-shell-last-calling-stack nil |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
620 "Caches the last calling stack, so that we can compare.") |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
621 (defvar idlwave-shell-calling-stack-index 0) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
622 |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
623 (defun idlwave-shell-source-frame () |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
624 "Return the frame to be used for source display." |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
625 (if idlwave-shell-use-dedicated-frame |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
626 ;; We want separate frames for source and shell |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
627 (if (frame-live-p idlwave-shell-display-wframe) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
628 ;; The frame exists, so we use it. |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
629 idlwave-shell-display-wframe |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
630 ;; The frame does not exist. We use the current frame. |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
631 ;; However, if the current is the shell frame, we make a new frame. |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
632 (setq idlwave-shell-display-wframe |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
633 (if (eq (selected-frame) idlwave-shell-idl-wframe) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
634 (make-frame) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
635 (selected-frame)))))) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
636 |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
637 (defun idlwave-shell-shell-frame () |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
638 "Return the frame to be used for the shell buffer." |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
639 (if idlwave-shell-use-dedicated-frame |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
640 ;; We want a dedicated frame |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
641 (if (frame-live-p idlwave-shell-idl-wframe) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
642 ;; It does exist, so we use it. |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
643 idlwave-shell-idl-wframe |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
644 ;; It does not exist. Check if we have a source frame. |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
645 (if (not (frame-live-p idlwave-shell-display-wframe)) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
646 ;; We do not have a source frame, so we use this one. |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
647 (setq idlwave-shell-display-wframe (selected-frame))) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
648 ;; Return a new frame |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
649 (setq idlwave-shell-idl-wframe |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
650 (make-frame idlwave-shell-frame-parameters))))) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
651 |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
652 ;;;###autoload |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
653 (defun idlwave-shell (&optional arg) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
654 "Run an inferior IDL, with I/O through buffer `(idlwave-shell-buffer)'. |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
655 If buffer exists but shell process is not running, start new IDL. |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
656 If buffer exists and shell process is running, just switch to the buffer. |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
657 |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
658 When called with a prefix ARG, or when `idlwave-shell-use-dedicated-frame' |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
659 is non-nil, the shell buffer and the source buffers will be in |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
660 separate frames. |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
661 |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
662 The command to run comes from variable `idlwave-shell-explicit-file-name'. |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
663 |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
664 The buffer is put in `idlwave-shell-mode', providing commands for sending |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
665 input and controlling the IDL job. See help on `idlwave-shell-mode'. |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
666 See also the variable `idlwave-shell-prompt-pattern'. |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
667 |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
668 \(Type \\[describe-mode] in the shell buffer for a list of commands.)" |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
669 (interactive "P") |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
670 |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
671 ;; A non-nil arg means, we want a dedicated frame. This will last |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
672 ;; for the current editing session. |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
673 (if arg (setq idlwave-shell-use-dedicated-frame t)) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
674 (if (equal arg '(16)) (setq idlwave-shell-use-dedicated-frame nil)) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
675 |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
676 ;; Check if the process still exists. If not, create it. |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
677 (unless (comint-check-proc (idlwave-shell-buffer)) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
678 (let* ((prg (or idlwave-shell-explicit-file-name "idl")) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
679 (buf (apply 'make-comint |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
680 idlwave-shell-process-name prg nil |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
681 idlwave-shell-command-line-options)) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
682 ;; FIXME: the next line can go? |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
683 ;(buf (make-comint idlwave-shell-process-name prg)) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
684 (process (get-buffer-process buf))) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
685 (set-process-filter process 'idlwave-shell-filter) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
686 (set-process-sentinel process 'idlwave-shell-sentinel) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
687 (set-buffer buf) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
688 (idlwave-shell-mode))) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
689 (let ((window (idlwave-display-buffer (idlwave-shell-buffer) nil |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
690 (idlwave-shell-shell-frame))) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
691 (current-window (selected-window))) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
692 (select-window window) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
693 (goto-char (point-max)) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
694 (select-window current-window) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
695 (raise-frame (window-frame window)) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
696 (if (eq (selected-frame) (window-frame window)) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
697 (select-window window)) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
698 )) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
699 |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
700 (defun idlwave-shell-recenter-shell-window (&optional arg) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
701 "Run `idlwave-shell', but make sure the current window stays selected." |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
702 (interactive "P") |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
703 (let ((window (selected-window))) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
704 (idlwave-shell arg) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
705 (select-window window))) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
706 |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
707 (defun idlwave-shell-send-command (&optional cmd pcmd hide preempt) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
708 "Send a command to IDL process. |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
709 |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
710 \(CMD PCMD HIDE\) are placed at the end of `idlwave-shell-pending-commands'. |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
711 If IDL is ready the first command, CMD, in |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
712 `idlwave-shell-pending-commands' is sent to the IDL process. If optional |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
713 second argument PCMD is non-nil it will be placed on |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
714 `idlwave-shell-post-command-hook' when CMD is executed. If the optional |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
715 third argument HIDE is non-nil, then hide output from CMD. |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
716 If optional fourth argument PREEMPT is non-nil CMD is put at front of |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
717 `idlwave-shell-pending-commands'. |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
718 |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
719 IDL is considered ready if the prompt is present |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
720 and if `idlwave-shell-ready' is non-nil." |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
721 |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
722 ;(setq hide nil) ; FIXME: turn this on for debugging only |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
723 (let (buf proc) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
724 ;; Get or make the buffer and its process |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
725 (if (or (not (setq buf (get-buffer (idlwave-shell-buffer)))) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
726 (not (setq proc (get-buffer-process buf)))) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
727 (if (not idlwave-shell-automatic-start) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
728 (error |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
729 (substitute-command-keys |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
730 "You need to first start an IDL shell with \\[idlwave-shell]")) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
731 (idlwave-shell-recenter-shell-window) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
732 (setq buf (get-buffer (idlwave-shell-buffer))) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
733 (if (or (not (setq buf (get-buffer (idlwave-shell-buffer)))) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
734 (not (setq proc (get-buffer-process buf)))) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
735 ;; Still nothing |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
736 (error "Problem with autostarting IDL shell")))) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
737 |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
738 (save-excursion |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
739 (set-buffer buf) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
740 (goto-char (process-mark proc)) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
741 ;; To make this easy, always push CMD onto pending commands |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
742 (if cmd |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
743 (setq idlwave-shell-pending-commands |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
744 (if preempt |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
745 ;; Put at front. |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
746 (append (list (list cmd pcmd hide)) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
747 idlwave-shell-pending-commands) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
748 ;; Put at end. |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
749 (append idlwave-shell-pending-commands |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
750 (list (list cmd pcmd hide)))))) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
751 ;; Check if IDL ready |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
752 (if (and idlwave-shell-ready |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
753 ;; Check for IDL prompt |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
754 (save-excursion |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
755 (beginning-of-line) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
756 (looking-at idlwave-shell-prompt-pattern))) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
757 ;; IDL ready for command |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
758 (if idlwave-shell-pending-commands |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
759 ;; execute command |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
760 (let* ((lcmd (car idlwave-shell-pending-commands)) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
761 (cmd (car lcmd)) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
762 (pcmd (nth 1 lcmd)) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
763 (hide (nth 2 lcmd))) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
764 ;; If this is an executive command, reset the stack pointer |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
765 (if (eq (string-to-char cmd) ?.) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
766 (setq idlwave-shell-calling-stack-index 0)) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
767 ;; Set post-command |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
768 (setq idlwave-shell-post-command-hook pcmd) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
769 ;; Output hiding |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
770 ;;; Debug code |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
771 ;;; (setq idlwave-shell-hide-output nil) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
772 (setq idlwave-shell-hide-output hide) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
773 ;; Pop command |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
774 (setq idlwave-shell-pending-commands |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
775 (cdr idlwave-shell-pending-commands)) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
776 ;; Send command for execution |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
777 (set-marker comint-last-input-start (point)) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
778 (set-marker comint-last-input-end (point)) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
779 (comint-simple-send proc cmd) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
780 (setq idlwave-shell-ready nil))))))) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
781 |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
782 ;; There was a report that a newer version of comint.el changed the |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
783 ;; name of comint-filter to comint-output-filter. Unfortunately, we |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
784 ;; have yet to upgrade. |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
785 |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
786 (defun idlwave-shell-comint-filter (process string) nil) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
787 (if (fboundp 'comint-output-filter) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
788 (fset 'idlwave-shell-comint-filter (symbol-function 'comint-output-filter)) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
789 (fset 'idlwave-shell-comint-filter (symbol-function 'comint-filter))) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
790 |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
791 (defun idlwave-shell-is-running () |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
792 "Return t if the shell process is running." |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
793 (eq (process-status idlwave-shell-process-name) 'run)) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
794 |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
795 (defun idlwave-shell-filter (proc string) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
796 "Replace Carriage returns in output. Watch for prompt. |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
797 When the IDL prompt is received executes `idlwave-shell-post-command-hook' |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
798 and then calls `idlwave-shell-send-command' for any pending commands." |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
799 ;; We no longer do the cleanup here - this is done by the process sentinel |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
800 (when (eq (process-status idlwave-shell-process-name) 'run) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
801 ;; OK, process is still running, so we can use it. |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
802 (let ((data (match-data))) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
803 (unwind-protect |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
804 (progn |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
805 ;; May change the original match data. |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
806 (let (p) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
807 (while (setq p (string-match "\C-M" string)) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
808 (aset string p ? ))) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
809 ;;; Test/Debug code |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
810 ;; (save-excursion (set-buffer (get-buffer-create "*test*")) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
811 ;; (goto-char (point-max)) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
812 ;; (insert "%%%" string)) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
813 ;; |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
814 ;; Keep output |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
815 |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
816 ; Should not keep output because the concat is costly. If hidden put |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
817 ; the output in a hide-buffer. Then when the output is needed in post |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
818 ; processing can access either the hide buffer or the idlwave-shell |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
819 ; buffer. Then watching for the prompt is easier. Furthermore, if it |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
820 ; is hidden and there is no post command, could throw away output. |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
821 ; (setq idlwave-shell-command-output |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
822 ; (concat idlwave-shell-command-output string)) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
823 ;; Insert the string. Do this before getting the |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
824 ;; state. |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
825 (if idlwave-shell-hide-output |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
826 (save-excursion |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
827 (set-buffer |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
828 (get-buffer-create "*idlwave-shell-hidden-output*")) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
829 (goto-char (point-max)) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
830 (insert string)) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
831 (idlwave-shell-comint-filter proc string)) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
832 ;; Watch for prompt - need to accumulate the current line |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
833 ;; since it may not be sent all at once. |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
834 (if (string-match "\n" string) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
835 (setq idlwave-shell-accumulation |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
836 (substring string |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
837 (progn (string-match "\\(.*\n\\)*" string) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
838 (match-end 0)))) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
839 (setq idlwave-shell-accumulation |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
840 (concat idlwave-shell-accumulation string))) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
841 ;; Check for prompt in current line |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
842 (if (setq idlwave-shell-ready |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
843 (string-match idlwave-shell-prompt-pattern |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
844 idlwave-shell-accumulation)) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
845 (progn |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
846 (if idlwave-shell-hide-output |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
847 (save-excursion |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
848 (set-buffer "*idlwave-shell-hidden-output*") |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
849 (goto-char (point-min)) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
850 (re-search-forward idlwave-shell-prompt-pattern nil t) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
851 (setq idlwave-shell-command-output |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
852 (buffer-substring (point-min) (point))) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
853 (delete-region (point-min) (point))) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
854 (setq idlwave-shell-command-output |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
855 (save-excursion |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
856 (set-buffer |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
857 (process-buffer proc)) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
858 (buffer-substring |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
859 (progn |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
860 (goto-char (process-mark proc)) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
861 (beginning-of-line nil) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
862 (point)) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
863 comint-last-input-end)))) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
864 ;;; Test/Debug code |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
865 ;; (save-excursion (set-buffer |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
866 ;; (get-buffer-create "*idlwave-shell-output*")) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
867 ;; (goto-char (point-max)) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
868 ;; (insert "%%%" string)) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
869 ;; Scan for state and do post command - bracket them |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
870 ;; with idlwave-shell-ready=nil since they |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
871 ;; may call idlwave-shell-send-command. |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
872 (let ((idlwave-shell-ready nil)) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
873 (idlwave-shell-scan-for-state) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
874 ;; Unset idlwave-shell-ready to prevent sending |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
875 ;; commands to IDL while running hook. |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
876 (if (listp idlwave-shell-post-command-hook) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
877 (eval idlwave-shell-post-command-hook) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
878 (funcall idlwave-shell-post-command-hook)) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
879 ;; Reset to default state for next command. |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
880 ;; Also we do not want to find this prompt again. |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
881 (setq idlwave-shell-accumulation nil |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
882 idlwave-shell-command-output nil |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
883 idlwave-shell-post-command-hook nil |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
884 idlwave-shell-hide-output nil)) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
885 ;; Done with post command. Do pending command if |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
886 ;; any. |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
887 (idlwave-shell-send-command)))) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
888 (store-match-data data))))) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
889 |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
890 (defun idlwave-shell-sentinel (process event) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
891 "The sentinel function for the IDLWAVE shell process." |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
892 (let* ((buf (idlwave-shell-buffer)) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
893 (win (get-buffer-window buf))) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
894 (when (get-buffer buf) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
895 (save-excursion |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
896 (set-buffer (idlwave-shell-buffer)) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
897 (goto-char (point-max)) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
898 (insert (format "\n\n Process %s %s" process event)))) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
899 (when (and (> (length (frame-list)) 1) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
900 (frame-live-p idlwave-shell-idl-wframe)) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
901 (delete-frame idlwave-shell-idl-wframe) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
902 (setq idlwave-shell-idl-wframe nil |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
903 idlwave-shell-display-wframe nil)) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
904 (when (window-live-p win) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
905 (delete-window win)) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
906 (idlwave-shell-cleanup))) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
907 |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
908 (defun idlwave-shell-scan-for-state () |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
909 "Scan for state info. |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
910 Looks for messages in output from last IDL command indicating where |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
911 IDL has stopped. The types of messages we are interested in are |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
912 execution halted, stepped, breakpoint, interrupted at and trace |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
913 messages. We ignore error messages otherwise. |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
914 For breakpoint messages process any attached count or command |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
915 parameters. |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
916 Update the windows if a message is found." |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
917 (let (update) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
918 (cond |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
919 ;; Make sure we have output |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
920 ((not idlwave-shell-command-output)) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
921 |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
922 ;; Various types of HALT messages. |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
923 ((string-match idlwave-shell-halt-messages-re |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
924 idlwave-shell-command-output) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
925 ;; Grab the file and line state info. |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
926 (setq idlwave-shell-halt-frame |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
927 (idlwave-shell-parse-line |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
928 (substring idlwave-shell-command-output (match-end 0))) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
929 update t)) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
930 |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
931 ;; Handle breakpoints separately |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
932 ((string-match idlwave-shell-break-message |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
933 idlwave-shell-command-output) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
934 (setq idlwave-shell-halt-frame |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
935 (idlwave-shell-parse-line |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
936 (substring idlwave-shell-command-output (match-end 0))) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
937 update t) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
938 ;; We used to to counting hits on breakpoints |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
939 ;; this is no longer supported since IDL breakpoints |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
940 ;; have learned counting. |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
941 ;; Do breakpoint command processing |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
942 (let ((bp (assoc |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
943 (list |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
944 (nth 0 idlwave-shell-halt-frame) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
945 (nth 1 idlwave-shell-halt-frame)) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
946 idlwave-shell-bp-alist))) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
947 (if bp |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
948 (let ((cmd (idlwave-shell-bp-get bp 'cmd))) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
949 (if cmd |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
950 ;; Execute command |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
951 (if (listp cmd) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
952 (eval cmd) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
953 (funcall cmd)))) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
954 ;; A breakpoint that we did not know about - perhaps it was |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
955 ;; set by the user or IDL isn't reporting breakpoints like |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
956 ;; we expect. Lets update our list. |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
957 (idlwave-shell-bp-query))))) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
958 |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
959 ;; Handle compilation errors in addition to the above |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
960 (if (and idlwave-shell-command-output |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
961 (or (string-match |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
962 idlwave-shell-syntax-error idlwave-shell-command-output) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
963 (string-match |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
964 idlwave-shell-other-error idlwave-shell-command-output))) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
965 (progn |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
966 (save-excursion |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
967 (set-buffer |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
968 (get-buffer-create idlwave-shell-error-buffer)) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
969 (erase-buffer) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
970 (insert idlwave-shell-command-output) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
971 (goto-char (point-min)) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
972 (setq idlwave-shell-error-last (point))) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
973 (idlwave-shell-goto-next-error))) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
974 |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
975 ;; Do update |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
976 (when update |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
977 (idlwave-shell-display-line (idlwave-shell-pc-frame))))) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
978 |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
979 |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
980 (defvar idlwave-shell-error-buffer |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
981 "*idlwave-shell-errors*" |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
982 "Buffer containing syntax errors from IDL compilations.") |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
983 |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
984 ;; FIXME: the following two variables do not currently allow line breaks |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
985 ;; in module and file names. I am not sure if it will be necessary to |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
986 ;; change this. Currently it seems to work the way it is. |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
987 (defvar idlwave-shell-syntax-error |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
988 "^% Syntax error.\\s-*\n\\s-*At:\\s-*\\(.*\\),\\s-*Line\\s-*\\(.*\\)" |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
989 "A regular expression to match an IDL syntax error. |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
990 The first \(..\) pair should match the file name. The second pair |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
991 should match the line number.") |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
992 |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
993 (defvar idlwave-shell-other-error |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
994 "^% .*\n\\s-*At:\\s-*\\(.*\\),\\s-*Line\\s-*\\(.*\\)" |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
995 "A regular expression to match any IDL error. |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
996 The first \(..\) pair should match the file name. The second pair |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
997 should match the line number.") |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
998 |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
999 (defvar idlwave-shell-file-line-message |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1000 (concat |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1001 "\\(" ; program name group (1) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1002 "\\<[a-zA-Z][a-zA-Z0-9_$:]*" ; start with a letter, followed by [..] |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1003 "\\([ \t]*\n[ \t]*[a-zA-Z0-9_$:]+\\)*"; continuation lines program name (2) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1004 "\\)" ; end program name group (1) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1005 "[ \t\n]+" ; white space |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1006 "\\(" ; line number group (3) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1007 "[0-9]+" ; the line number (the fix point) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1008 "\\([ \t]*\n[ \t]*[0-9]+\\)*" ; continuation lines number (4) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1009 "\\)" ; end line number group (3) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1010 "[ \t\n]+" ; white space |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1011 "\\(" ; file name group (5) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1012 "[^ \t\n]+" ; file names can contain any non-white |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1013 "\\([ \t]*\n[ \t]*[^ \t\n]+\\)*" ; continuation lines file name (6) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1014 "\\)" ; end line number group (5) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1015 ) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1016 "*A regular expression to parse out the file name and line number. |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1017 The 1st group should match the subroutine name. |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1018 The 3rd group is the line number. |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1019 The 5th group is the file name. |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1020 All parts may contain linebreaks surrounded by spaces. This is important |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1021 in IDL5 which inserts random linebreaks in long module and file names.") |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1022 |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1023 (defun idlwave-shell-parse-line (string) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1024 "Parse IDL message for the subroutine, file name and line number. |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1025 We need to work hard here to remove the stupid line breaks inserted by |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1026 IDL5. These line breaks can be right in the middle of procedure |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1027 or file names. |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1028 It is very difficult to come up with a robust solution. This one seems |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1029 to be pretty good though. |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1030 |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1031 Here is in what ways it improves over the previous solution: |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1032 |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1033 1. The procedure name can be split and will be restored. |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1034 2. The number can be split. I have never seen this, but who knows. |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1035 3. We do not require the `.pro' extension for files. |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1036 |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1037 This function can still break when the file name ends on a end line |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1038 and the message line contains an additional line with garbage. Then |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1039 the first part of that garbage will be added to the file name. |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1040 However, the function checks the existence of the files with and |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1041 without this last part - thus the function only breaks if file name |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1042 plus garbage match an existing regular file. This is hopefully very |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1043 unlikely." |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1044 |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1045 (let (number procedure file) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1046 (when (string-match idlwave-shell-file-line-message string) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1047 (setq procedure (match-string 1 string) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1048 number (match-string 3 string) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1049 file (match-string 5 string)) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1050 |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1051 ;; Repair the strings |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1052 (setq procedure (idlwave-shell-repair-string procedure)) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1053 (setq number (idlwave-shell-repair-string number)) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1054 (setq file (idlwave-shell-repair-file-name file)) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1055 |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1056 ;; If we have a file, return the frame list |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1057 (if file |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1058 (list (idlwave-shell-file-name file) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1059 (string-to-int number) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1060 procedure) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1061 ;; No success finding a file |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1062 nil)))) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1063 |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1064 (defun idlwave-shell-repair-string (string) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1065 "Repair a string by taking out all linebreaks. This is destructive!" |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1066 (while (string-match "[ \t]*\n[ \t]*" string) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1067 (setq string (replace-match "" t t string))) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1068 string) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1069 |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1070 (defun idlwave-shell-repair-file-name (file) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1071 "Repair a file name string by taking out all linebreaks. |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1072 The last line of STRING may be garbage - we check which one makes a valid |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1073 file name." |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1074 (let ((file1 "") (file2 "") (start 0)) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1075 ;; We scan no further than to the next "^%" line |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1076 (if (string-match "^%" file) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1077 (setq file (substring file 0 (match-beginning 0)))) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1078 ;; Take out the line breaks |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1079 (while (string-match "[ \t]*\n[ \t]*" file start) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1080 (setq file1 (concat file1 (substring file start (match-beginning 0))) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1081 start (match-end 0))) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1082 (setq file2 (concat file1 (substring file start))) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1083 (cond |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1084 ((file-regular-p file2) file2) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1085 ((file-regular-p file1) file1) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1086 ;; If we cannot veryfy the existence of the file, we return the shorter |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1087 ;; name. The idea behind this is that this may be a relative file name |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1088 ;; and our idea about the current working directory may be wrong. |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1089 ;; If it is a relative file name, it hopefully is short. |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1090 ((not (string= "" file1)) file1) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1091 ((not (string= "" file2)) file2) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1092 (t nil)))) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1093 |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1094 (defun idlwave-shell-cleanup () |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1095 "Do necessary cleanup for a terminated IDL process." |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1096 (setq idlwave-shell-step-frame nil |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1097 idlwave-shell-halt-frame nil |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1098 idlwave-shell-pending-commands nil |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1099 idlwave-shell-command-line-to-execute nil |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1100 idlwave-shell-bp-alist nil |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1101 idlwave-shell-calling-stack-index 0) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1102 (idlwave-shell-display-line nil) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1103 (idlwave-shell-update-bp-overlays) ; kill old overlays |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1104 (idlwave-shell-kill-buffer "*idlwave-shell-hidden-output*") |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1105 (idlwave-shell-kill-buffer idlwave-shell-bp-buffer) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1106 (idlwave-shell-kill-buffer idlwave-shell-error-buffer) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1107 ;; (idlwave-shell-kill-buffer (idlwave-shell-buffer)) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1108 (and (get-buffer (idlwave-shell-buffer)) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1109 (bury-buffer (get-buffer (idlwave-shell-buffer)))) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1110 (run-hooks 'idlwave-shell-cleanup-hook)) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1111 |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1112 (defun idlwave-shell-kill-buffer (buf) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1113 "Kill buffer BUF if it exists." |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1114 (if (setq buf (get-buffer buf)) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1115 (kill-buffer buf))) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1116 |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1117 (defun idlwave-shell-kill-shell-buffer-confirm () |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1118 (when (idlwave-shell-is-running) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1119 (ding) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1120 (unless (y-or-n-p "IDL shell is running. Are you sure you want to kill the buffer? ") |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1121 (error "Abort")) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1122 (message "Killing buffer *idl* and the associated process"))) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1123 |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1124 (defun idlwave-shell-resync-dirs () |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1125 "Resync the buffer's idea of the current directory stack. |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1126 This command queries IDL with the command bound to |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1127 `idlwave-shell-dirstack-query' (default \"printd\"), reads the |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1128 output for the new directory stack." |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1129 (interactive) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1130 (idlwave-shell-send-command idlwave-shell-dirstack-query |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1131 'idlwave-shell-filter-directory |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1132 'hide)) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1133 |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1134 (defun idlwave-shell-retall (&optional arg) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1135 "Return from the entire calling stack." |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1136 (interactive "P") |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1137 (idlwave-shell-send-command "retall")) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1138 |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1139 (defun idlwave-shell-closeall (&optional arg) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1140 "Close all open files." |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1141 (interactive "P") |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1142 (idlwave-shell-send-command "close,/all")) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1143 |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1144 (defun idlwave-shell-quit (&optional arg) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1145 "Exit the idl process after confirmation. |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1146 With prefix ARG, exit without confirmation." |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1147 (interactive "P") |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1148 (if (not (idlwave-shell-is-running)) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1149 (error "Shell is not running") |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1150 (if (or arg (y-or-n-p "Exit the IDLWAVE Shell? ")) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1151 (condition-case nil |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1152 (idlwave-shell-send-command "exit") |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1153 (error nil))))) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1154 |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1155 (defun idlwave-shell-reset (&optional visible) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1156 "Reset IDL. Return to main level and destroy the leaftover variables. |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1157 This issues the following commands: |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1158 RETALL |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1159 WIDGET_CONTROL,/RESET |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1160 CLOSE, /ALL |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1161 HEAP_GC, /VERBOSE" |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1162 ;; OBJ_DESTROY, OBJ_VALID() FIXME: should this be added? |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1163 (interactive "P") |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1164 (message "Resetting IDL") |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1165 (idlwave-shell-send-command "retall" nil (not visible)) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1166 (idlwave-shell-send-command "widget_control,/reset" nil (not visible)) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1167 (idlwave-shell-send-command "close,/all" nil (not visible)) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1168 ;; (idlwave-shell-send-command "obj_destroy, obj_valid()" nil (not visible)) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1169 (idlwave-shell-send-command "heap_gc,/verbose" nil (not visible)) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1170 (setq idlwave-shell-calling-stack-index 0)) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1171 |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1172 (defun idlwave-shell-filter-directory () |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1173 "Get the current directory from `idlwave-shell-command-output'. |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1174 Change the default directory for the process buffer to concur." |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1175 (save-excursion |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1176 (set-buffer (idlwave-shell-buffer)) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1177 (if (string-match "Current Directory: *\\(\\S-*\\) *$" |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1178 idlwave-shell-command-output) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1179 (let ((dir (substring idlwave-shell-command-output |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1180 (match-beginning 1) (match-end 1)))) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1181 (message "Setting Emacs wd to %s" dir) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1182 (setq idlwave-shell-default-directory dir) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1183 (setq default-directory (file-name-as-directory dir)))))) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1184 |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1185 (defun idlwave-shell-complete (&optional arg) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1186 "Do completion in the idlwave-shell buffer. |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1187 Calls `idlwave-shell-complete-filename' after some executive commands or |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1188 in strings. Otherwise, calls `idlwave-complete' to complete modules and |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1189 keywords." |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1190 ;;FIXME: batch files? |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1191 (interactive "P") |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1192 (let (cmd) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1193 (cond |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1194 ((setq cmd (idlwave-shell-executive-command)) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1195 ;; We are in a command line with an executive command |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1196 (if (member (upcase cmd) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1197 '(".R" ".RU" ".RUN" ".RN" ".RNE" ".RNEW" |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1198 ".COM" ".COMP" ".COMPI" ".COMPIL" ".COMPILE")) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1199 ;; This command expects file names |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1200 (idlwave-shell-complete-filename))) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1201 ((idlwave-shell-filename-string) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1202 ;; In a string, could be a file name to here |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1203 (idlwave-shell-complete-filename)) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1204 (t |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1205 ;; Default completion of modules and keywords |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1206 (idlwave-complete))))) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1207 |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1208 (defun idlwave-shell-complete-filename (&optional arg) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1209 "Complete a file name at point if after a file name. |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1210 We assume that we are after a file name when completing one of the |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1211 args of an executive .run, .rnew or .compile. Also, in a string |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1212 constant we complete file names. Otherwise return nil, so that |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1213 other completion functions can do thier work." |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1214 (let* ((comint-file-name-chars idlwave-shell-file-name-chars) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1215 (completion-ignore-case (default-value 'completion-ignore-case))) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1216 (comint-dynamic-complete-filename))) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1217 |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1218 (defun idlwave-shell-executive-command () |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1219 "Return the name of the current executive command, if any." |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1220 (save-excursion |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1221 (idlwave-beginning-of-statement) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1222 (if (looking-at "[ \t]*\\([.][^ \t\n\r]*\\)") |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1223 (match-string 1)))) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1224 |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1225 (defun idlwave-shell-filename-string () |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1226 "Return t if in a string and after what could be a file name." |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1227 (let ((limit (save-excursion (beginning-of-line) (point)))) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1228 (save-excursion |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1229 ;; Skip backwards over file name chars |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1230 (skip-chars-backward idlwave-shell-file-name-chars limit) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1231 ;; Check of the next char is a string delimiter |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1232 (memq (preceding-char) '(?\' ?\"))))) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1233 |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1234 ;;; |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1235 ;;; This section contains code for debugging IDL programs. -------------------- |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1236 ;;; |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1237 |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1238 (defun idlwave-shell-redisplay (&optional hide) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1239 "Tries to resync the display with where execution has stopped. |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1240 Issues a \"help,/trace\" command followed by a call to |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1241 `idlwave-shell-display-line'. Also updates the breakpoint |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1242 overlays." |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1243 (interactive) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1244 (idlwave-shell-send-command |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1245 "help,/trace" |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1246 '(idlwave-shell-display-line |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1247 (idlwave-shell-pc-frame)) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1248 hide) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1249 (idlwave-shell-bp-query)) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1250 |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1251 (defun idlwave-shell-display-level-in-calling-stack (&optional hide) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1252 (idlwave-shell-send-command |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1253 "help,/trace" |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1254 'idlwave-shell-parse-stack-and-display |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1255 hide)) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1256 |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1257 (defun idlwave-shell-parse-stack-and-display () |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1258 (let* ((lines (delete "" (idlwave-split-string |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1259 idlwave-shell-command-output "^%"))) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1260 (stack (delq nil (mapcar 'idlwave-shell-parse-line lines))) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1261 (nmax (1- (length stack))) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1262 (nmin 0) message) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1263 ; ;; Reset the stack to zero if it is a new stack. |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1264 ; (if (not (equal stack idlwave-shell-last-calling-stack)) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1265 ; (setq idlwave-shell-calling-stack-index 0)) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1266 ; (setq idlwave-shell-last-calling-stack stack) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1267 (cond |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1268 ((< nmax nmin) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1269 (setq idlwave-shell-calling-stack-index 0) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1270 (error "Problem with calling stack")) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1271 ((> idlwave-shell-calling-stack-index nmax) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1272 (setq idlwave-shell-calling-stack-index nmax |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1273 message (format "%d is the highest level on the calling stack" |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1274 nmax))) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1275 ((< idlwave-shell-calling-stack-index nmin) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1276 (setq idlwave-shell-calling-stack-index nmin |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1277 message (format "%d is the lowest level on the calling stack" |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1278 nmin)))) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1279 (idlwave-shell-display-line |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1280 (nth idlwave-shell-calling-stack-index stack)) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1281 (message (or message |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1282 (format "On stack level %d" |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1283 idlwave-shell-calling-stack-index))))) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1284 |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1285 (defun idlwave-shell-stack-up () |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1286 "Display the source code one step up the calling stack." |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1287 (interactive) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1288 (incf idlwave-shell-calling-stack-index) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1289 (idlwave-shell-display-level-in-calling-stack 'hide)) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1290 (defun idlwave-shell-stack-down () |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1291 "Display the source code one step down the calling stack." |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1292 (interactive) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1293 (decf idlwave-shell-calling-stack-index) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1294 (idlwave-shell-display-level-in-calling-stack 'hide)) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1295 |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1296 (defun idlwave-shell-goto-frame (&optional frame) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1297 "Set buffer to FRAME with point at the frame line. |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1298 If the optional argument FRAME is nil then idlwave-shell-pc-frame is |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1299 used. Does nothing if the resulting frame is nil." |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1300 (if frame () |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1301 (setq frame (idlwave-shell-pc-frame))) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1302 (cond |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1303 (frame |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1304 (set-buffer (idlwave-find-file-noselect (car frame))) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1305 (widen) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1306 (goto-line (nth 1 frame))))) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1307 |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1308 (defun idlwave-shell-pc-frame () |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1309 "Returns the frame for IDL execution." |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1310 (and idlwave-shell-halt-frame |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1311 (list (nth 0 idlwave-shell-halt-frame) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1312 (nth 1 idlwave-shell-halt-frame)))) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1313 |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1314 (defun idlwave-shell-valid-frame (frame) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1315 "Check that frame is for an existing file." |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1316 (file-readable-p (car frame))) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1317 |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1318 (defun idlwave-shell-display-line (frame &optional col) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1319 "Display FRAME file in other window with overlay arrow. |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1320 |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1321 FRAME is a list of file name, line number, and subroutine name. |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1322 If FRAME is nil then remove overlay." |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1323 (if (not frame) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1324 ;; Remove stop-line overlay from old position |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1325 (progn |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1326 (setq overlay-arrow-string nil) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1327 (if idlwave-shell-stop-line-overlay |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1328 (delete-overlay idlwave-shell-stop-line-overlay))) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1329 (if (not (idlwave-shell-valid-frame frame)) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1330 (error (concat "Invalid frame - unable to access file: " (car frame))) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1331 ;;; |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1332 ;;; buffer : the buffer to display a line in. |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1333 ;;; select-shell: current buffer is the shell. |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1334 ;;; |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1335 (let* ((buffer (idlwave-find-file-noselect (car frame))) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1336 (select-shell (equal (buffer-name) (idlwave-shell-buffer))) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1337 window pos) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1338 |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1339 ;; First make sure the shell window is visible |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1340 (idlwave-display-buffer (idlwave-shell-buffer) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1341 nil (idlwave-shell-shell-frame)) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1342 |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1343 ;; Now display the buffer and remember which window it is. |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1344 (setq window (idlwave-display-buffer buffer |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1345 nil (idlwave-shell-source-frame))) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1346 |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1347 ;; Enter the buffer and mark the line |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1348 (save-excursion |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1349 (set-buffer buffer) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1350 (save-restriction |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1351 (widen) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1352 (goto-line (nth 1 frame)) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1353 (setq pos (point)) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1354 (if idlwave-shell-stop-line-overlay |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1355 ;; Move overlay |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1356 (move-overlay idlwave-shell-stop-line-overlay |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1357 (point) (save-excursion (end-of-line) (point)) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1358 (current-buffer)) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1359 ;; Use the arrow instead, but only if marking is wanted. |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1360 (if idlwave-shell-mark-stop-line |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1361 (setq overlay-arrow-string idlwave-shell-overlay-arrow)) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1362 (or overlay-arrow-position ; create the marker if necessary |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1363 (setq overlay-arrow-position (make-marker))) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1364 (set-marker overlay-arrow-position (point) buffer))) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1365 |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1366 ;; If the point is outside the restriction, widen the buffer. |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1367 (if (or (< pos (point-min)) (> pos (point-max))) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1368 (progn |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1369 (widen) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1370 (goto-char pos))) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1371 |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1372 ;; If we have the column of the error, move the cursor there. |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1373 (if col (move-to-column col)) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1374 (setq pos (point))) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1375 |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1376 ;; Make sure pos is really displayed in the window. |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1377 (set-window-point window pos) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1378 |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1379 ;; FIXME: the following frame redraw was taken out because it |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1380 ;; flashes. I think it is not needed. The code is left here in |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1381 ;; case we have to put it back in. |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1382 ;; (redraw-frame (window-frame window)) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1383 |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1384 ;; If we came from the shell, go back there. Otherwise select |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1385 ;; the window where the error is displayed. |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1386 (if (and (equal (buffer-name) (idlwave-shell-buffer)) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1387 (not select-shell)) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1388 (select-window window)))))) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1389 |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1390 |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1391 (defun idlwave-shell-step (arg) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1392 "Step one source line. If given prefix argument ARG, step ARG source lines." |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1393 (interactive "p") |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1394 (or (not arg) (< arg 1) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1395 (setq arg 1)) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1396 (idlwave-shell-send-command |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1397 (concat ".s " (if (integerp arg) (int-to-string arg) arg)))) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1398 |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1399 (defun idlwave-shell-stepover (arg) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1400 "Stepover one source line. |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1401 If given prefix argument ARG, step ARG source lines. |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1402 Uses IDL's stepover executive command which does not enter called functions." |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1403 (interactive "p") |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1404 (or (not arg) (< arg 1) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1405 (setq arg 1)) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1406 (idlwave-shell-send-command |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1407 (concat ".so " (if (integerp arg) (int-to-string arg) arg)))) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1408 |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1409 (defun idlwave-shell-break-here (&optional count cmd) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1410 "Set breakpoint at current line. |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1411 |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1412 If Count is nil then an ordinary breakpoint is set. We treat a count |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1413 of 1 as a temporary breakpoint using the ONCE keyword. Counts greater |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1414 than 1 use the IDL AFTER=count keyword to break only after reaching |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1415 the statement count times. |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1416 |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1417 Optional argument CMD is a list or function to evaluate upon reaching |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1418 the breakpoint." |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1419 |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1420 (interactive "P") |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1421 (if (listp count) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1422 (setq count nil)) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1423 (idlwave-shell-set-bp |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1424 ;; Create breakpoint |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1425 (idlwave-shell-bp (idlwave-shell-current-frame) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1426 (list count cmd) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1427 (idlwave-shell-current-module)))) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1428 |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1429 (defun idlwave-shell-set-bp-check (bp) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1430 "Check for failure to set breakpoint. |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1431 This is run on `idlwave-shell-post-command-hook'. |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1432 Offers to recompile the procedure if we failed. This usually fixes |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1433 the problem with not being able to set the breakpoint." |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1434 ;; Scan for message |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1435 (if (and idlwave-shell-command-output |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1436 (string-match "% BREAKPOINT: *Unable to find code" |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1437 idlwave-shell-command-output)) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1438 ;; Offer to recompile |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1439 (progn |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1440 (if (progn |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1441 (beep) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1442 (y-or-n-p |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1443 (concat "Okay to recompile file " |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1444 (idlwave-shell-bp-get bp 'file) " "))) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1445 ;; Recompile |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1446 (progn |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1447 ;; Clean up before retrying |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1448 (idlwave-shell-command-failure) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1449 (idlwave-shell-send-command |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1450 (concat ".run " (idlwave-shell-bp-get bp 'file)) nil nil) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1451 ;; Try setting breakpoint again |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1452 (idlwave-shell-set-bp bp)) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1453 (beep) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1454 (message "Unable to set breakpoint.") |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1455 (idlwave-shell-command-failure) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1456 ) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1457 ;; return non-nil if no error found |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1458 nil) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1459 'okay)) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1460 |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1461 (defun idlwave-shell-command-failure () |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1462 "Do any necessary clean up when an IDL command fails. |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1463 Call this from a function attached to `idlwave-shell-post-command-hook' |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1464 that detects the failure of a command. |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1465 For example, this is called from `idlwave-shell-set-bp-check' when a |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1466 breakpoint can not be set." |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1467 ;; Clear pending commands |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1468 (setq idlwave-shell-pending-commands nil)) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1469 |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1470 (defun idlwave-shell-cont () |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1471 "Continue executing." |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1472 (interactive) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1473 (idlwave-shell-send-command ".c" '(idlwave-shell-redisplay 'hide))) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1474 |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1475 (defun idlwave-shell-go () |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1476 "Run .GO. This starts the main program of the last compiled file." |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1477 (interactive) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1478 (idlwave-shell-send-command ".go" '(idlwave-shell-redisplay 'hide))) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1479 |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1480 (defun idlwave-shell-return () |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1481 "Run .RETURN (continue to next return, but stay in subprogram)." |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1482 (interactive) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1483 (idlwave-shell-send-command ".return" '(idlwave-shell-redisplay 'hide))) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1484 |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1485 (defun idlwave-shell-skip () |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1486 "Run .SKIP (skip one line, then step)." |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1487 (interactive) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1488 (idlwave-shell-send-command ".skip" '(idlwave-shell-redisplay 'hide))) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1489 |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1490 (defun idlwave-shell-clear-bp (bp) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1491 "Clear breakpoint BP. |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1492 Clears in IDL and in `idlwave-shell-bp-alist'." |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1493 (let ((index (idlwave-shell-bp-get bp))) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1494 (if index |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1495 (progn |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1496 (idlwave-shell-send-command |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1497 (concat "breakpoint,/clear," |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1498 (if (integerp index) (int-to-string index) index))) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1499 (idlwave-shell-bp-query))))) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1500 |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1501 (defun idlwave-shell-current-frame () |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1502 "Return a list containing the current file name and line point is in. |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1503 If in the IDL shell buffer, returns `idlwave-shell-pc-frame'." |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1504 (if (eq (current-buffer) (get-buffer (idlwave-shell-buffer))) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1505 ;; In IDL shell |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1506 (idlwave-shell-pc-frame) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1507 ;; In source |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1508 (list (idlwave-shell-file-name (buffer-file-name)) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1509 (save-restriction |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1510 (widen) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1511 (save-excursion |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1512 (beginning-of-line) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1513 (1+ (count-lines 1 (point)))))))) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1514 |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1515 (defun idlwave-shell-current-module () |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1516 "Return the name of the module for the current file. |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1517 Returns nil if unable to obtain a module name." |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1518 (if (eq (current-buffer) (get-buffer (idlwave-shell-buffer))) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1519 ;; In IDL shell |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1520 (nth 2 idlwave-shell-halt-frame) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1521 ;; In pro file |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1522 (save-restriction |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1523 (widen) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1524 (save-excursion |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1525 (if (idlwave-prev-index-position) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1526 (upcase (idlwave-unit-name))))))) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1527 |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1528 (defun idlwave-shell-clear-current-bp () |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1529 "Remove breakpoint at current line. |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1530 This command can be called from the shell buffer if IDL is currently stopped |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1531 at a breakpoint." |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1532 (interactive) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1533 (let ((bp (idlwave-shell-find-bp (idlwave-shell-current-frame)))) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1534 (if bp (idlwave-shell-clear-bp bp) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1535 ;; Try moving to beginning of statement |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1536 (save-excursion |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1537 (idlwave-shell-goto-frame) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1538 (idlwave-beginning-of-statement) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1539 (setq bp (idlwave-shell-find-bp (idlwave-shell-current-frame))) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1540 (if bp (idlwave-shell-clear-bp bp) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1541 (beep) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1542 (message "Cannot identify breakpoint for this line")))))) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1543 |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1544 (defun idlwave-shell-to-here () |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1545 "Set a breakpoint with count 1 then continue." |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1546 (interactive) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1547 (idlwave-shell-break-here 1) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1548 (idlwave-shell-cont)) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1549 |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1550 (defun idlwave-shell-break-in (&optional module) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1551 "Look for a module name near point and set a break point for it. |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1552 The command looks for an identifier near point and sets a breakpoint |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1553 for the first line of the corresponding module." |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1554 (interactive) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1555 ;; get the identifier |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1556 (let (module) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1557 (save-excursion |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1558 (skip-chars-backward "a-zA-Z0-9_$") |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1559 (if (looking-at idlwave-identifier) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1560 (setq module (match-string 0)) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1561 (error "No identifier at point"))) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1562 (idlwave-shell-send-command |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1563 idlwave-shell-sources-query |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1564 `(progn |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1565 (idlwave-shell-sources-filter) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1566 (idlwave-shell-set-bp-in-module ,module)) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1567 'hide))) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1568 |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1569 (defun idlwave-shell-set-bp-in-module (module) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1570 "Set breakpoint in module. Assumes that `idlwave-shell-sources-alist' |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1571 contains an entry for that module." |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1572 (let ((source-file (car-safe |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1573 (cdr-safe |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1574 (assoc (upcase module) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1575 idlwave-shell-sources-alist)))) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1576 buf) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1577 (if (or (not source-file) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1578 (not (file-regular-p source-file)) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1579 (not (setq buf |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1580 (or (idlwave-get-buffer-visiting source-file) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1581 (find-file-noselect source-file))))) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1582 (progn |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1583 (message "The source file for module %s is probably not compiled" |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1584 module) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1585 (beep)) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1586 (save-excursion |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1587 (set-buffer buf) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1588 (save-excursion |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1589 (goto-char (point-min)) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1590 (let ((case-fold-search t)) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1591 (if (re-search-forward |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1592 (concat "^[ \t]*\\(pro\\|function\\)[ \t]+" |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1593 (downcase module) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1594 "[ \t\n,]") nil t) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1595 (progn |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1596 (goto-char (match-beginning 1)) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1597 (message "Setting breakpoint for module %s" module) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1598 (idlwave-shell-break-here)) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1599 (message "Cannot find module %s in file %s" module source-file) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1600 (beep)))))))) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1601 |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1602 (defun idlwave-shell-up () |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1603 "Run to end of current block. |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1604 Sets a breakpoint with count 1 at end of block, then continues." |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1605 (interactive) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1606 (if (idlwave-shell-pc-frame) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1607 (save-excursion |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1608 (idlwave-shell-goto-frame) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1609 ;; find end of subprogram |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1610 (let ((eos (save-excursion |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1611 (idlwave-beginning-of-subprogram) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1612 (idlwave-forward-block) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1613 (point)))) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1614 (idlwave-backward-up-block -1) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1615 ;; move beyond end block line - IDL will not break there. |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1616 ;; That is, you can put a breakpoint there but when IDL does |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1617 ;; break it will report that it is at the next line. |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1618 (idlwave-next-statement) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1619 (idlwave-end-of-statement) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1620 ;; Make sure we are not beyond subprogram |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1621 (if (< (point) eos) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1622 ;; okay |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1623 () |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1624 ;; Move back inside subprogram |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1625 (goto-char eos) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1626 (idlwave-previous-statement)) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1627 (idlwave-shell-to-here))))) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1628 |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1629 (defun idlwave-shell-out () |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1630 "Attempt to run until this procedure exits. |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1631 Runs to the last statement and then steps 1 statement. Use the .out command." |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1632 (interactive) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1633 (idlwave-shell-send-command (concat ".o"))) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1634 |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1635 (defun idlwave-shell-help-expression () |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1636 "Print help on current expression. See `idlwave-shell-print'." |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1637 (interactive) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1638 (idlwave-shell-print 'help)) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1639 |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1640 (defun idlwave-shell-mouse-print (event) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1641 "Call `idlwave-shell-print' at the mouse position." |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1642 (interactive "e") |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1643 (mouse-set-point event) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1644 (idlwave-shell-print)) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1645 |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1646 (defun idlwave-shell-mouse-help (event) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1647 "Call `idlwave-shell-print' at the mouse position." |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1648 (interactive "e") |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1649 (mouse-set-point event) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1650 (idlwave-shell-help-expression)) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1651 |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1652 (defun idlwave-shell-print (&optional help special) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1653 "Print current expression. With are HELP, show help on expression. |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1654 An expression is an identifier plus 1 pair of matched parentheses |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1655 directly following the identifier - an array or function |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1656 call. Alternatively, an expression is the contents of any matched |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1657 parentheses when the open parentheses is not directly preceded by an |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1658 identifier. If point is at the beginning or within an expression |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1659 return the inner-most containing expression, otherwise, return the |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1660 preceding expression." |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1661 (interactive "P") |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1662 (save-excursion |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1663 (let (beg end) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1664 ;; Move to beginning of current or previous expression |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1665 (if (looking-at "\\<\\|(") |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1666 ;; At beginning of expression, don't move backwards unless |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1667 ;; this is at the end of an indentifier. |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1668 (if (looking-at "\\>") |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1669 (backward-sexp)) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1670 (backward-sexp)) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1671 (if (looking-at "\\>") |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1672 ;; Move to beginning of identifier - must be an array or |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1673 ;; function expression. |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1674 (backward-sexp)) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1675 ;; Move to end of expression |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1676 (setq beg (point)) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1677 (forward-sexp) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1678 (while (looking-at "\\>(\\|\\.") |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1679 ;; an array |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1680 (forward-sexp)) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1681 (setq end (point)) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1682 (when idlwave-shell-expression-overlay |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1683 (move-overlay idlwave-shell-expression-overlay beg end) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1684 (add-hook 'pre-command-hook 'idlwave-shell-delete-expression-overlay)) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1685 (if special |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1686 (idlwave-shell-send-command |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1687 (concat (if help "help," "print,") (buffer-substring beg end)) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1688 `(idlwave-shell-process-print-output ,(buffer-substring beg end) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1689 idlwave-shell-command-output |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1690 ,special) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1691 'hide) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1692 (idlwave-shell-recenter-shell-window) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1693 (idlwave-shell-send-command |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1694 (concat (if help "help," "print,") (buffer-substring beg end))))))) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1695 |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1696 (defun idlwave-shell-delete-expression-overlay () |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1697 (condition-case nil |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1698 (if idlwave-shell-expression-overlay |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1699 (delete-overlay idlwave-shell-expression-overlay)) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1700 (error nil)) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1701 (remove-hook 'pre-command-hook 'idlwave-shell-delete-expression-overlay)) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1702 |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1703 (defvar idlwave-shell-bp-alist nil |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1704 "Alist of breakpoints. |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1705 A breakpoint is a cons cell \(\(file line\) . \(\(index module\) data\)\) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1706 |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1707 The car is the frame for the breakpoint: |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1708 file - full path file name. |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1709 line - line number of breakpoint - integer. |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1710 |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1711 The first element of the cdr is a list of internal IDL data: |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1712 index - the index number of the breakpoint internal to IDL. |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1713 module - the module for breakpoint internal to IDL. |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1714 |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1715 Remaining elements of the cdr: |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1716 data - Data associated with the breakpoint by idlwave-shell currently |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1717 contains two items: |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1718 |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1719 count - number of times to execute breakpoint. When count reaches 0 |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1720 the breakpoint is cleared and removed from the alist. |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1721 command - command to execute when breakpoint is reached, either a |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1722 lisp function to be called with `funcall' with no arguments or a |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1723 list to be evaluated with `eval'.") |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1724 |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1725 (defun idlwave-shell-run-region (beg end &optional n) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1726 "Compile and run the region using the IDL process. |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1727 Copies the region to a temporary file `idlwave-shell-temp-pro-file' |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1728 and issues the IDL .run command for the file. Because the |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1729 region is compiled and run as a main program there is no |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1730 problem with begin-end blocks extending over multiple |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1731 lines - which would be a problem if `idlwave-shell-evaluate-region' |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1732 was used. An END statement is appended to the region if necessary. |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1733 |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1734 If there is a prefix argument, display IDL process." |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1735 (interactive "r\nP") |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1736 (let ((oldbuf (current-buffer))) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1737 (save-excursion |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1738 (set-buffer (idlwave-find-file-noselect |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1739 idlwave-shell-temp-pro-file)) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1740 (erase-buffer) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1741 (insert-buffer-substring oldbuf beg end) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1742 (if (not (save-excursion |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1743 (idlwave-previous-statement) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1744 (idlwave-look-at "\\<end\\>"))) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1745 (insert "\nend\n")) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1746 (save-buffer 0))) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1747 (idlwave-shell-send-command (concat ".run " idlwave-shell-temp-pro-file)) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1748 (if n |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1749 (idlwave-display-buffer (idlwave-shell-buffer) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1750 nil (idlwave-shell-shell-frame)))) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1751 |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1752 (defun idlwave-shell-evaluate-region (beg end &optional n) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1753 "Send region to the IDL process. |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1754 If there is a prefix argument, display IDL process. |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1755 Does not work for a region with multiline blocks - use |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1756 `idlwave-shell-run-region' for this." |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1757 (interactive "r\nP") |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1758 (idlwave-shell-send-command (buffer-substring beg end)) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1759 (if n |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1760 (idlwave-display-buffer (idlwave-shell-buffer) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1761 nil (idlwave-shell-shell-frame)))) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1762 |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1763 (defun idlwave-display-buffer (buf not-this-window-p &optional frame) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1764 (if (or (< emacs-major-version 20) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1765 (and (= emacs-major-version 20) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1766 (< emacs-minor-version 3))) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1767 ;; Only two args. |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1768 (display-buffer buf not-this-window-p) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1769 ;; Three ares possible. |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1770 (display-buffer buf not-this-window-p frame))) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1771 |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1772 (defvar idlwave-shell-bp-buffer "*idlwave-shell-bp*" |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1773 "Scratch buffer for parsing IDL breakpoint lists and other stuff.") |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1774 |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1775 (defun idlwave-shell-bp-query () |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1776 "Reconcile idlwave-shell's breakpoint list with IDL's. |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1777 Queries IDL using the string in `idlwave-shell-bp-query'." |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1778 (interactive) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1779 (idlwave-shell-send-command idlwave-shell-bp-query |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1780 'idlwave-shell-filter-bp |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1781 'hide)) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1782 |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1783 (defun idlwave-shell-bp-get (bp &optional item) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1784 "Get a value for a breakpoint. |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1785 BP has the form of elements in idlwave-shell-bp-alist. |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1786 Optional second arg ITEM is the particular value to retrieve. |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1787 ITEM can be 'file, 'line, 'index, 'module, 'count, 'cmd, or 'data. |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1788 'data returns a list of 'count and 'cmd. |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1789 Defaults to 'index." |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1790 (cond |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1791 ;; Frame |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1792 ((eq item 'line) (nth 1 (car bp))) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1793 ((eq item 'file) (nth 0 (car bp))) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1794 ;; idlwave-shell breakpoint data |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1795 ((eq item 'data) (cdr (cdr bp))) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1796 ((eq item 'count) (nth 0 (cdr (cdr bp)))) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1797 ((eq item 'cmd) (nth 1 (cdr (cdr bp)))) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1798 ;; IDL breakpoint info |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1799 ((eq item 'module) (nth 1 (car (cdr bp)))) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1800 ;; index - default |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1801 (t (nth 0 (car (cdr bp)))))) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1802 |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1803 (defun idlwave-shell-filter-bp () |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1804 "Get the breakpoints from `idlwave-shell-command-output'. |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1805 Create `idlwave-shell-bp-alist' updating breakpoint count and command data |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1806 from previous breakpoint list." |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1807 (save-excursion |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1808 (set-buffer (get-buffer-create idlwave-shell-bp-buffer)) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1809 (erase-buffer) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1810 (insert idlwave-shell-command-output) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1811 (goto-char (point-min)) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1812 (let ((old-bp-alist idlwave-shell-bp-alist)) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1813 (setq idlwave-shell-bp-alist (list nil)) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1814 (if (re-search-forward "^\\s-*Index.*\n\\s-*-" nil t) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1815 (while (and |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1816 (not (progn (forward-line) (eobp))) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1817 ;; Parse breakpoint line. |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1818 ;; Breakpoints have the form: |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1819 ;; Index Module Line File |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1820 ;; All seperated by whitespace. |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1821 ;; |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1822 ;; Add the breakpoint info to the list |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1823 (re-search-forward |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1824 "\\s-*\\(\\S-+\\)\\s-+\\(\\S-+\\)\\s-+\\(\\S-+\\)\\s-+\\(\\S-+\\)" nil t)) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1825 (nconc idlwave-shell-bp-alist |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1826 (list |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1827 (cons |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1828 (list |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1829 (save-match-data |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1830 (idlwave-shell-file-name |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1831 (buffer-substring ; file |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1832 (match-beginning 4) (match-end 4)))) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1833 (string-to-int ; line |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1834 (buffer-substring |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1835 (match-beginning 3) (match-end 3)))) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1836 (list |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1837 (list |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1838 (buffer-substring ; index |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1839 (match-beginning 1) (match-end 1)) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1840 (buffer-substring ; module |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1841 (match-beginning 2) (match-end 2))) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1842 ;; idlwave-shell data: count, command |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1843 nil nil)))))) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1844 (setq idlwave-shell-bp-alist (cdr idlwave-shell-bp-alist)) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1845 ;; Update count, commands of breakpoints |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1846 (mapcar 'idlwave-shell-update-bp old-bp-alist))) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1847 ;; Update the breakpoint overlays |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1848 (idlwave-shell-update-bp-overlays) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1849 ;; Return the new list |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1850 idlwave-shell-bp-alist) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1851 |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1852 (defun idlwave-shell-update-bp (bp) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1853 "Update BP data in breakpoint list. |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1854 If BP frame is in `idlwave-shell-bp-alist' updates the breakpoint data." |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1855 (let ((match (assoc (car bp) idlwave-shell-bp-alist))) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1856 (if match (setcdr (cdr match) (cdr (cdr bp)))))) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1857 |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1858 (defun idlwave-shell-set-bp-data (bp data) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1859 "Set the data of BP to DATA." |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1860 (setcdr (cdr bp) data)) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1861 |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1862 (defun idlwave-shell-bp (frame &optional data module) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1863 "Create a breakpoint structure containing FRAME and DATA. Second |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1864 and third args, DATA and MODULE, are optional. Returns a breakpoint |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1865 of the format used in `idlwave-shell-bp-alist'. Can be used in commands |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1866 attempting match a breakpoint in `idlwave-shell-bp-alist'." |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1867 (cons frame (cons (list nil module) data))) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1868 |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1869 (defvar idlwave-shell-old-bp nil |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1870 "List of breakpoints previous to setting a new breakpoint.") |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1871 |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1872 (defun idlwave-shell-sources-bp (bp) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1873 "Check `idlwave-shell-sources-alist' for source of breakpoint using BP. |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1874 If an equivalency is found, return the IDL internal source name. |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1875 Otherwise return the filename in bp." |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1876 (let* |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1877 ((bp-file (idlwave-shell-bp-get bp 'file)) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1878 (bp-module (idlwave-shell-bp-get bp 'module)) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1879 (internal-file-list (cdr (assoc bp-module idlwave-shell-sources-alist)))) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1880 (if (and internal-file-list |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1881 (equal bp-file (nth 0 internal-file-list))) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1882 (nth 1 internal-file-list) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1883 bp-file))) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1884 |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1885 (defun idlwave-shell-set-bp (bp) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1886 "Try to set a breakpoint BP. |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1887 |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1888 The breakpoint will be placed at the beginning of the statement on the |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1889 line specified by BP or at the next IDL statement if that line is not |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1890 a statement. |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1891 Determines IDL's internal representation for the breakpoint which may |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1892 have occured at a different line then used with the breakpoint |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1893 command." |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1894 |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1895 ;; Get and save the old breakpoints |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1896 (idlwave-shell-send-command |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1897 idlwave-shell-bp-query |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1898 '(progn |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1899 (idlwave-shell-filter-bp) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1900 (setq idlwave-shell-old-bp idlwave-shell-bp-alist)) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1901 'hide) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1902 ;; Get sources for IDL compiled procedures followed by setting |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1903 ;; breakpoint. |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1904 (idlwave-shell-send-command |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1905 idlwave-shell-sources-query |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1906 (` (progn |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1907 (idlwave-shell-sources-filter) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1908 (idlwave-shell-set-bp2 (quote (, bp))))) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1909 'hide)) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1910 |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1911 (defun idlwave-shell-set-bp2 (bp) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1912 "Use results of breakpoint and sources query to set bp. |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1913 Use the count argument with IDLs breakpoint command. |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1914 We treat a count of 1 as a temporary breakpoint. |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1915 Counts greater than 1 use the IDL AFTER=count keyword to break |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1916 only after reaching the statement count times." |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1917 (let* |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1918 ((arg (idlwave-shell-bp-get bp 'count)) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1919 (key (cond |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1920 ((not (and arg (numberp arg))) "") |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1921 ((= arg 1) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1922 ",/once") |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1923 ((> arg 1) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1924 (format ",after=%d" arg)))) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1925 (line (idlwave-shell-bp-get bp 'line))) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1926 (idlwave-shell-send-command |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1927 (concat "breakpoint,'" |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1928 (idlwave-shell-sources-bp bp) "'," |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1929 (if (integerp line) (setq line (int-to-string line))) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1930 key) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1931 ;; Check for failure and look for breakpoint in IDL's list |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1932 (` (progn |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1933 (if (idlwave-shell-set-bp-check (quote (, bp))) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1934 (idlwave-shell-set-bp3 (quote (, bp))))) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1935 ) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1936 ;; do not hide output |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1937 nil |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1938 'preempt))) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1939 |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1940 (defun idlwave-shell-set-bp3 (bp) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1941 "Find the breakpoint in IDL's internal list of breakpoints." |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1942 (idlwave-shell-send-command idlwave-shell-bp-query |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1943 (` (progn |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1944 (idlwave-shell-filter-bp) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1945 (idlwave-shell-new-bp (quote (, bp))))) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1946 'hide |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1947 'preempt)) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1948 |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1949 (defun idlwave-shell-find-bp (frame) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1950 "Return breakpoint from `idlwave-shell-bp-alist' for frame. |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1951 Returns nil if frame not found." |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1952 (assoc frame idlwave-shell-bp-alist)) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1953 |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1954 (defun idlwave-shell-new-bp (bp) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1955 "Find the new breakpoint in IDL's list and update with DATA. |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1956 The actual line number for a breakpoint in IDL may be different than |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1957 the line number used with the IDL breakpoint command. |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1958 Looks for a new breakpoint index number in the list. This is |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1959 considered the new breakpoint if the file name of frame matches." |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1960 (let ((obp-index (mapcar 'idlwave-shell-bp-get idlwave-shell-old-bp)) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1961 (bpl idlwave-shell-bp-alist)) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1962 (while (and (member (idlwave-shell-bp-get (car bpl)) obp-index) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1963 (setq bpl (cdr bpl)))) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1964 (if (and |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1965 (not bpl) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1966 ;; No additional breakpoint. |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1967 ;; Need to check if we are just replacing a breakpoint. |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1968 (setq bpl (assoc (car bp) idlwave-shell-bp-alist))) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1969 (setq bpl (list bpl))) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1970 (if (and bpl |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1971 (equal (idlwave-shell-bp-get (setq bpl (car bpl)) 'file) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1972 (idlwave-shell-bp-get bp 'file))) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1973 ;; Got the breakpoint - add count, command to it. |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1974 ;; This updates `idlwave-shell-bp-alist' because a deep copy was |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1975 ;; not done for bpl. |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1976 (idlwave-shell-set-bp-data bpl (idlwave-shell-bp-get bp 'data)) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1977 (beep) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1978 (message "Failed to identify breakpoint in IDL")))) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1979 |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1980 (defvar idlwave-shell-bp-overlays nil |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1981 "List of overlays marking breakpoints") |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1982 |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1983 (defun idlwave-shell-update-bp-overlays () |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1984 "Update the overlays which mark breakpoints in the source code. |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1985 Existing overlays are recycled, in order to minimize consumption." |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1986 ;; FIXME: we could cache them all, but that would be more work. |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1987 (when idlwave-shell-mark-breakpoints |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1988 (let ((bp-list idlwave-shell-bp-alist) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1989 (ov-list idlwave-shell-bp-overlays) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1990 ov bp) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1991 ;; Delete the old overlays from their buffers |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1992 (while (setq ov (pop ov-list)) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1993 (delete-overlay ov)) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1994 (setq ov-list idlwave-shell-bp-overlays |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1995 idlwave-shell-bp-overlays nil) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1996 (while (setq bp (pop bp-list)) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1997 (save-excursion |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1998 (idlwave-shell-goto-frame (car bp)) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
1999 (let* ((end (progn (end-of-line 1) (point))) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
2000 (beg (progn (beginning-of-line 1) (point))) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
2001 (ov (or (pop ov-list) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
2002 (idlwave-shell-make-new-bp-overlay)))) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
2003 (move-overlay ov beg end) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
2004 (push ov idlwave-shell-bp-overlays))))))) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
2005 |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
2006 (defvar idlwave-shell-bp-glyph) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
2007 (defun idlwave-shell-make-new-bp-overlay () |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
2008 "Make a new overlay for highlighting breakpoints. |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
2009 This stuff is stringly dependant upon the version of Emacs." |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
2010 (let ((ov (make-overlay 1 1))) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
2011 (if (featurep 'xemacs) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
2012 ;; This is XEmacs |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
2013 (progn |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
2014 (cond |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
2015 ((eq (console-type) 'tty) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
2016 ;; tty's cannot display glyphs |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
2017 (set-extent-property ov 'face 'idlwave-shell-bp-face)) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
2018 ((and (memq idlwave-shell-mark-breakpoints '(t glyph)) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
2019 idlwave-shell-bp-glyph) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
2020 ;; use the glyph |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
2021 (set-extent-property ov 'begin-glyph idlwave-shell-bp-glyph)) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
2022 (idlwave-shell-mark-breakpoints |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
2023 ;; use the face |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
2024 (set-extent-property ov 'face 'idlwave-shell-bp-face)) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
2025 (t |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
2026 ;; no marking |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
2027 nil)) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
2028 (set-extent-priority ov -1)) ; make stop line face prevail |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
2029 ;; This is Emacs |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
2030 (cond |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
2031 (window-system |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
2032 (if (and (memq idlwave-shell-mark-breakpoints '(t glyph)) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
2033 idlwave-shell-bp-glyph) ; this var knows if glyph's possible |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
2034 ;; use a glyph |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
2035 (let ((string "@")) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
2036 (put-text-property 0 1 |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
2037 'display (cons nil idlwave-shell-bp-glyph) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
2038 string) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
2039 (overlay-put ov 'before-string string)) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
2040 (overlay-put ov 'face 'idlwave-shell-bp-face))) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
2041 (idlwave-shell-mark-breakpoints |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
2042 ;; use a face |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
2043 (overlay-put ov 'face 'idlwave-shell-bp-face)) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
2044 (t |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
2045 ;; No marking |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
2046 nil))) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
2047 ov)) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
2048 |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
2049 (defun idlwave-shell-edit-default-command-line (arg) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
2050 "Edit the current execute command." |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
2051 (interactive "P") |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
2052 (setq idlwave-shell-command-line-to-execute |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
2053 (read-string "IDL> " idlwave-shell-command-line-to-execute))) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
2054 |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
2055 (defun idlwave-shell-execute-default-command-line (arg) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
2056 "Execute a command line. On first use, ask for the command. |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
2057 Also with prefix arg, ask for the command. You can also uase the command |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
2058 `idlwave-shell-edit-default-command-line' to edit the line." |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
2059 (interactive "P") |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
2060 (if (or (not idlwave-shell-command-line-to-execute) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
2061 arg) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
2062 (setq idlwave-shell-command-line-to-execute |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
2063 (read-string "IDL> " idlwave-shell-command-line-to-execute))) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
2064 (idlwave-shell-reset nil) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
2065 (idlwave-shell-send-command idlwave-shell-command-line-to-execute |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
2066 '(idlwave-shell-redisplay 'hide))) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
2067 |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
2068 (defun idlwave-shell-save-and-run () |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
2069 "Save file and run it in IDL. |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
2070 Runs `save-buffer' and sends a '.RUN' command for the associated file to IDL. |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
2071 When called from the shell buffer, re-run the file which was last handled by |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
2072 one of the save-and-.. commands." |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
2073 (interactive) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
2074 (idlwave-shell-save-and-action 'run)) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
2075 |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
2076 (defun idlwave-shell-save-and-compile () |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
2077 "Save file and run it in IDL. |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
2078 Runs `save-buffer' and sends '.COMPILE' command for the associated file to IDL. |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
2079 When called from the shell buffer, re-compile the file which was last handled by |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
2080 one of the save-and-.. commands." |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
2081 (interactive) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
2082 (idlwave-shell-save-and-action 'compile)) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
2083 |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
2084 (defun idlwave-shell-save-and-batch () |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
2085 "Save file and batch it in IDL. |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
2086 Runs `save-buffer' and sends a '@file' command for the associated file to IDL. |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
2087 When called from the shell buffer, re-batch the file which was last handled by |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
2088 one of the save-and-.. commands." |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
2089 (interactive) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
2090 (idlwave-shell-save-and-action 'batch)) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
2091 |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
2092 (defun idlwave-shell-save-and-action (action) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
2093 "Save file and compile it in IDL. |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
2094 Runs `save-buffer' and sends a '.RUN' command for the associated file to IDL. |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
2095 When called from the shell buffer, re-compile the file which was last |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
2096 handled by this command." |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
2097 ;; Remove the stop overlay. |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
2098 (if idlwave-shell-stop-line-overlay |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
2099 (delete-overlay idlwave-shell-stop-line-overlay)) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
2100 (setq overlay-arrow-string nil) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
2101 (let (buf) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
2102 (cond |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
2103 ((eq major-mode 'idlwave-mode) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
2104 (save-buffer) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
2105 (setq idlwave-shell-last-save-and-action-file (buffer-file-name))) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
2106 (idlwave-shell-last-save-and-action-file |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
2107 (if (setq buf (idlwave-get-buffer-visiting |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
2108 idlwave-shell-last-save-and-action-file)) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
2109 (save-excursion |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
2110 (set-buffer buf) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
2111 (save-buffer)))) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
2112 (t (setq idlwave-shell-last-save-and-action-file |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
2113 (read-file-name "File: "))))) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
2114 (if (file-regular-p idlwave-shell-last-save-and-action-file) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
2115 (progn |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
2116 (idlwave-shell-send-command |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
2117 (concat (cond ((eq action 'run) ".run ") |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
2118 ((eq action 'compile) ".compile ") |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
2119 ((eq action 'batch) "@") |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
2120 (t (error "Unknown action %s" action))) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
2121 idlwave-shell-last-save-and-action-file) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
2122 nil nil) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
2123 (idlwave-shell-bp-query)) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
2124 (let ((msg (format "No such file %s" |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
2125 idlwave-shell-last-save-and-action-file))) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
2126 (setq idlwave-shell-last-save-and-action-file nil) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
2127 (error msg)))) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
2128 |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
2129 (defvar idlwave-shell-sources-query "help,/source" |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
2130 "IDL command to obtain source files for compiled procedures.") |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
2131 |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
2132 (defvar idlwave-shell-sources-alist nil |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
2133 "Alist of IDL procedure names and compiled source files. |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
2134 Elements of the alist have the form: |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
2135 |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
2136 (module name . (source-file-truename idlwave-internal-filename)).") |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
2137 |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
2138 (defun idlwave-shell-sources-query () |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
2139 "Determine source files for IDL compiled procedures. |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
2140 Queries IDL using the string in `idlwave-shell-sources-query'." |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
2141 (interactive) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
2142 (idlwave-shell-send-command idlwave-shell-sources-query |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
2143 'idlwave-shell-sources-filter |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
2144 'hide)) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
2145 |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
2146 (defun idlwave-shell-sources-filter () |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
2147 "Get source files from `idlwave-shell-sources-query' output. |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
2148 Create `idlwave-shell-sources-alist' consisting of |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
2149 list elements of the form: |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
2150 (module name . (source-file-truename idlwave-internal-filename))." |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
2151 (save-excursion |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
2152 (set-buffer (get-buffer-create idlwave-shell-bp-buffer)) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
2153 (erase-buffer) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
2154 (insert idlwave-shell-command-output) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
2155 (goto-char (point-min)) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
2156 (let (cpro cfun) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
2157 (if (re-search-forward "Compiled Procedures:" nil t) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
2158 (progn |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
2159 (forward-line) ; Skip $MAIN$ |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
2160 (setq cpro (point)))) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
2161 (if (re-search-forward "Compiled Functions:" nil t) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
2162 (progn |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
2163 (setq cfun (point)) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
2164 (setq idlwave-shell-sources-alist |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
2165 (append |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
2166 ;; compiled procedures |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
2167 (progn |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
2168 (beginning-of-line) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
2169 (narrow-to-region cpro (point)) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
2170 (goto-char (point-min)) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
2171 (idlwave-shell-sources-grep)) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
2172 ;; compiled functions |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
2173 (progn |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
2174 (widen) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
2175 (goto-char cfun) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
2176 (idlwave-shell-sources-grep))))))))) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
2177 |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
2178 (defun idlwave-shell-sources-grep () |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
2179 (save-excursion |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
2180 (let ((al (list nil))) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
2181 (while (and |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
2182 (not (progn (forward-line) (eobp))) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
2183 (re-search-forward |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
2184 "\\s-*\\(\\S-+\\)\\s-+\\(\\S-+\\)" nil t)) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
2185 (nconc al |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
2186 (list |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
2187 (cons |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
2188 (buffer-substring ; name |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
2189 (match-beginning 1) (match-end 1)) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
2190 (let ((internal-filename |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
2191 (buffer-substring ; source |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
2192 (match-beginning 2) (match-end 2)))) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
2193 (list |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
2194 (idlwave-shell-file-name internal-filename) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
2195 internal-filename)) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
2196 )))) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
2197 (cdr al)))) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
2198 |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
2199 |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
2200 (defun idlwave-shell-clear-all-bp () |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
2201 "Remove all breakpoints in IDL." |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
2202 (interactive) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
2203 (idlwave-shell-send-command |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
2204 idlwave-shell-bp-query |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
2205 '(progn |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
2206 (idlwave-shell-filter-bp) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
2207 (mapcar 'idlwave-shell-clear-bp idlwave-shell-bp-alist)) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
2208 'hide)) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
2209 |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
2210 (defun idlwave-shell-list-all-bp () |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
2211 "List all breakpoints in IDL." |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
2212 (interactive) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
2213 (idlwave-shell-send-command |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
2214 idlwave-shell-bp-query)) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
2215 |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
2216 (defvar idlwave-shell-error-last 0 |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
2217 "Position of last syntax error in `idlwave-shell-error-buffer'.") |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
2218 |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
2219 (defun idlwave-shell-goto-next-error () |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
2220 "Move point to next IDL syntax error." |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
2221 (interactive) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
2222 (let (frame col) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
2223 (save-excursion |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
2224 (set-buffer idlwave-shell-error-buffer) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
2225 (goto-char idlwave-shell-error-last) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
2226 (if (or (re-search-forward idlwave-shell-syntax-error nil t) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
2227 (re-search-forward idlwave-shell-other-error nil t)) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
2228 (progn |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
2229 (setq frame |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
2230 (list |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
2231 (save-match-data |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
2232 (idlwave-shell-file-name |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
2233 (buffer-substring (match-beginning 1) (match-end 1)))) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
2234 (string-to-int |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
2235 (buffer-substring (match-beginning 2) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
2236 (match-end 2))))) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
2237 ;; Try to find the column of the error |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
2238 (save-excursion |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
2239 (setq col |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
2240 (if (re-search-backward "\\^" nil t) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
2241 (current-column) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
2242 0))))) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
2243 (setq idlwave-shell-error-last (point))) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
2244 (if frame |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
2245 (progn |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
2246 (idlwave-shell-display-line frame col)) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
2247 (beep) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
2248 (message "No more errors.")))) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
2249 |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
2250 (defun idlwave-shell-file-name (name) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
2251 "If idlwave-shell-use-truename is non-nil, convert file name to true name. |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
2252 Otherwise, just expand the file name." |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
2253 (let ((def-dir (if (eq major-mode 'idlwave-shell-mode) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
2254 default-directory |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
2255 idlwave-shell-default-directory))) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
2256 (if idlwave-shell-use-truename |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
2257 (file-truename name def-dir) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
2258 (expand-file-name name def-dir)))) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
2259 |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
2260 |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
2261 ;; Keybindings -------------------------------------------------------------- |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
2262 |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
2263 (defvar idlwave-shell-mode-map (copy-keymap comint-mode-map) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
2264 "Keymap for idlwave-mode.") |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
2265 (defvar idlwave-shell-mode-prefix-map (make-sparse-keymap)) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
2266 (fset 'idlwave-shell-mode-prefix-map idlwave-shell-mode-prefix-map) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
2267 |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
2268 ;(define-key idlwave-shell-mode-map "\M-?" 'comint-dynamic-list-completions) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
2269 ;(define-key idlwave-shell-mode-map "\t" 'comint-dynamic-complete) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
2270 (define-key idlwave-shell-mode-map "\t" 'idlwave-shell-complete) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
2271 (define-key idlwave-shell-mode-map "\M-\t" 'idlwave-shell-complete) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
2272 (define-key idlwave-shell-mode-map "\C-c\C-s" 'idlwave-shell) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
2273 (define-key idlwave-shell-mode-map "\C-c?" 'idlwave-routine-info) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
2274 (define-key idlwave-shell-mode-map "\C-c\C-i" 'idlwave-update-routine-info) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
2275 (define-key idlwave-shell-mode-map "\C-c=" 'idlwave-resolve) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
2276 (define-key idlwave-shell-mode-map "\C-c\C-v" 'idlwave-find-module) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
2277 (define-key idlwave-shell-mode-map idlwave-shell-prefix-key |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
2278 'idlwave-shell-debug-map) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
2279 |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
2280 ;; The following set of bindings is used to bind the debugging keys. |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
2281 ;; If `idlwave-shell-activate-prefix-keybindings' is non-nil, the first key |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
2282 ;; in the list gets bound the C-c C-d prefix map. |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
2283 ;; If `idlwave-shell-activate-alt-keybindings' is non-nil, the second key |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
2284 ;; in the list gets bound directly in both idlwave-mode-map and |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
2285 ;; idlwave-shell-mode-map. |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
2286 |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
2287 ;; Used keys: abcde hi klmnopqrs u wxyz |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
2288 ;; Unused keys: fg j t v |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
2289 (let ((specs |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
2290 '(([(control ?b)] [(alt ?b)] idlwave-shell-break-here) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
2291 ([(control ?i)] [(alt ?i)] idlwave-shell-break-in) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
2292 ([(control ?d)] [(alt ?d)] idlwave-shell-clear-current-bp) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
2293 ([(control ?a)] [(alt ?a)] idlwave-shell-clear-all-bp) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
2294 ([(control ?s)] [(alt ?s)] idlwave-shell-step) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
2295 ([(control ?n)] [(alt ?n)] idlwave-shell-stepover) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
2296 ([(control ?k)] [(alt ?k)] idlwave-shell-skip) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
2297 ([(control ?u)] [(alt ?u)] idlwave-shell-up) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
2298 ([(control ?o)] [(alt ?o)] idlwave-shell-out) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
2299 ([(control ?m)] [(alt ?m)] idlwave-shell-return) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
2300 ([(control ?h)] [(alt ?h)] idlwave-shell-to-here) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
2301 ([(control ?r)] [(alt ?r)] idlwave-shell-cont) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
2302 ([(control ?y)] [(alt ?y)] idlwave-shell-execute-default-command-line) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
2303 ([(control ?z)] [(alt ?z)] idlwave-shell-reset) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
2304 ([(control ?q)] [(alt ?q)] idlwave-shell-quit) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
2305 ([(control ?p)] [(alt ?p)] idlwave-shell-print) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
2306 ([(??)] [(alt ??)] idlwave-shell-help-expression) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
2307 ([(control ?c)] [(alt ?c)] idlwave-shell-save-and-run) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
2308 ([( ?@)] [(alt ?@)] idlwave-shell-save-and-batch) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
2309 ([(control ?x)] [(alt ?x)] idlwave-shell-goto-next-error) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
2310 ([(control ?e)] [(alt ?e)] idlwave-shell-run-region) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
2311 ([(control ?w)] [(alt ?w)] idlwave-shell-resync-dirs) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
2312 ([(control ?l)] [(alt ?l)] idlwave-shell-redisplay) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
2313 ([(control ?t)] [(alt ?t)] idlwave-shell-toggle-toolbar) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
2314 ([(control up)] [(alt up)] idlwave-shell-stack-up) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
2315 ([(control down)] [(alt down)] idlwave-shell-stack-down))) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
2316 s k1 k2 cmd) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
2317 (while (setq s (pop specs)) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
2318 (setq k1 (nth 0 s) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
2319 k2 (nth 1 s) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
2320 cmd (nth 2 s)) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
2321 (when idlwave-shell-activate-prefix-keybindings |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
2322 (and k1 (define-key idlwave-shell-mode-prefix-map k1 cmd))) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
2323 (when idlwave-shell-activate-alt-keybindings |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
2324 (and k2 (define-key idlwave-mode-map k2 cmd)) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
2325 (and k2 (define-key idlwave-shell-mode-map k2 cmd))))) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
2326 |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
2327 ;; Enter the prefix map at the two places. |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
2328 (fset 'idlwave-debug-map idlwave-shell-mode-prefix-map) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
2329 (fset 'idlwave-shell-debug-map idlwave-shell-mode-prefix-map) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
2330 |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
2331 ;; The Menus -------------------------------------------------------------- |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
2332 |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
2333 (defvar idlwave-shell-menu-def |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
2334 '("Debug" |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
2335 ["Save and .RUN" idlwave-shell-save-and-run |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
2336 (or (eq major-mode 'idlwave-mode) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
2337 idlwave-shell-last-save-and-action-file)] |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
2338 ["Save and .COMPILE" idlwave-shell-save-and-compile |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
2339 (or (eq major-mode 'idlwave-mode) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
2340 idlwave-shell-last-save-and-action-file)] |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
2341 ["Save and @Batch" idlwave-shell-save-and-batch |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
2342 (or (eq major-mode 'idlwave-mode) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
2343 idlwave-shell-last-save-and-action-file)] |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
2344 ["Goto Next Error" idlwave-shell-goto-next-error t] |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
2345 "--" |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
2346 ["Execute Default Cmd" idlwave-shell-execute-default-command-line t] |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
2347 ["Edit Default Cmd" idlwave-shell-edit-default-command-line t] |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
2348 "--" |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
2349 ["Set Breakpoint" idlwave-shell-break-here |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
2350 (eq major-mode 'idlwave-mode)] |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
2351 ["Break in Module" idlwave-shell-break-in t] |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
2352 ["Clear Breakpoint" idlwave-shell-clear-current-bp t] |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
2353 ["Clear All Breakpoints" idlwave-shell-clear-all-bp t] |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
2354 ["List All Breakpoints" idlwave-shell-list-all-bp t] |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
2355 "--" |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
2356 ["Step (into)" idlwave-shell-step t] |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
2357 ["Step (over)" idlwave-shell-stepover t] |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
2358 ["Skip One Statement" idlwave-shell-skip t] |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
2359 ["Continue" idlwave-shell-cont t] |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
2360 ("Continue to" |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
2361 ["End of Block" idlwave-shell-up t] |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
2362 ["End of Subprog" idlwave-shell-return t] |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
2363 ["End of Subprog+1" idlwave-shell-out t] |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
2364 ["Here (Cursor Line)" idlwave-shell-to-here |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
2365 (eq major-mode 'idlwave-mode)]) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
2366 "--" |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
2367 ["Print expression" idlwave-shell-print t] |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
2368 ["Help on expression" idlwave-shell-help-expression t] |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
2369 ["Evaluate Region" idlwave-shell-evaluate-region |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
2370 (eq major-mode 'idlwave-mode)] |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
2371 ["Run Region" idlwave-shell-run-region (eq major-mode 'idlwave-mode)] |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
2372 "--" |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
2373 ["Redisplay" idlwave-shell-redisplay t] |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
2374 ["Stack Up" idlwave-shell-stack-up t] |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
2375 ["Stack Down" idlwave-shell-stack-down t] |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
2376 "--" |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
2377 ["Update Working Dir" idlwave-shell-resync-dirs t] |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
2378 ["Reset IDL" idlwave-shell-reset t] |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
2379 "--" |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
2380 ["Toggle Toolbar" idlwave-shell-toggle-toolbar t] |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
2381 ["Exit IDL" idlwave-shell-quit t])) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
2382 |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
2383 (if (or (featurep 'easymenu) (load "easymenu" t)) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
2384 (progn |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
2385 (easy-menu-define |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
2386 idlwave-shell-mode-menu idlwave-shell-mode-map "IDL shell menus" |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
2387 idlwave-shell-menu-def) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
2388 (easy-menu-define |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
2389 idlwave-mode-debug-menu idlwave-mode-map "IDL debugging menus" |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
2390 idlwave-shell-menu-def) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
2391 (save-excursion |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
2392 (mapcar (lambda (buf) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
2393 (set-buffer buf) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
2394 (if (eq major-mode 'idlwave-mode) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
2395 (progn |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
2396 (easy-menu-remove idlwave-mode-debug-menu) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
2397 (easy-menu-add idlwave-mode-debug-menu)))) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
2398 (buffer-list))))) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
2399 |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
2400 ;; The Breakpoint Glyph ------------------------------------------------------- |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
2401 |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
2402 (defvar idlwave-shell-bp-glyph nil |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
2403 "The glyph to mark breakpoint lines in the source code.") |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
2404 |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
2405 (let ((image-string "/* XPM */ |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
2406 static char * file[] = { |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
2407 \"14 12 3 1\", |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
2408 \" c #FFFFFFFFFFFF s backgroundColor\", |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
2409 \". c #4B4B4B4B4B4B\", |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
2410 \"R c #FFFF00000000\", |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
2411 \" \", |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
2412 \" \", |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
2413 \" RRRR \", |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
2414 \" RRRRRR \", |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
2415 \" RRRRRRRR \", |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
2416 \" RRRRRRRR \", |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
2417 \" RRRRRRRR \", |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
2418 \" RRRRRRRR \", |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
2419 \" RRRRRR \", |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
2420 \" RRRR \", |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
2421 \" \", |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
2422 \" \"};")) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
2423 |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
2424 (setq idlwave-shell-bp-glyph |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
2425 (cond ((and (featurep 'xemacs) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
2426 (featurep 'xpm)) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
2427 (make-glyph image-string)) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
2428 ((and (not (featurep 'xemacs)) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
2429 (fboundp 'image-type-available-p) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
2430 (image-type-available-p 'xpm)) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
2431 (list 'image :type 'xpm :data image-string)) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
2432 (t nil)))) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
2433 |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
2434 (provide 'idlwave-shell) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
2435 |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
2436 ;;; Load the toolbar when wanted by the user. |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
2437 |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
2438 (defun idlwave-shell-toggle-toolbar () |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
2439 "Toggle the display of the debugging toolbar." |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
2440 (interactive) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
2441 (if (featurep 'idlwave-toolbar) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
2442 (idlwave-toolbar-toggle) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
2443 (require 'idlwave-toolbar) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
2444 (idlwave-toolbar-toggle))) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
2445 |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
2446 |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
2447 (when idlwave-shell-use-toolbar |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
2448 (or (load "idlwave-toolbar" t) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
2449 (message |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
2450 "Tried to load file `idlwave-toolbar.el', but file does not exist"))) |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
2451 |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
2452 ;;; idlwave-shell.el ends here |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
2453 |
35105166b1c9
Shell mode for interaction with the idl program (idl = Interactive
Carsten Dominik <dominik@science.uva.nl>
parents:
diff
changeset
|
2454 |