annotate lisp/progmodes/idlw-shell.el @ 29345:a4d9a2ab3c73

(newline): Don't bind before-change-function, after-change-function.
author Dave Love <fx@gnu.org>
date Wed, 31 May 2000 22:50:41 +0000
parents 527d42ebb15e
children 8eff9cc9cbae
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
27107
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1 ;;; idlw-shell.el --- Run IDL or WAVE as an inferior process of Emacs.
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2 ;; Copyright (c) 1994-1996 Chris Chase
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
3 ;; Copyright (c) 1999 Carsten Dominik
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
4 ;; Copyright (c) 1999 Free Software Foundation
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
5
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
6 ;; Author: Chris Chase <chase@att.com>
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
7 ;; Maintainer: Carsten Dominik <dominik@strw.leidenuniv.nl>
27607
527d42ebb15e (idlwave-shell-print): Fixed bug with
Carsten Dominik <dominik@science.uva.nl>
parents: 27185
diff changeset
8 ;; Version: 3.15
527d42ebb15e (idlwave-shell-print): Fixed bug with
Carsten Dominik <dominik@science.uva.nl>
parents: 27185
diff changeset
9 ;; Date: $Date: 2000/02/04 09:20:21 $
27107
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
10 ;; Keywords: processes
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
11
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
12 ;; This file is part of GNU Emacs.
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
13
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
14 ;; GNU Emacs is free software; you can redistribute it and/or modify
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
15 ;; it under the terms of the GNU General Public License as published by
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
16 ;; the Free Software Foundation; either version 2, or (at your option)
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
17 ;; any later version.
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
18
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
19 ;; GNU Emacs is distributed in the hope that it will be useful,
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
20 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
21 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
22 ;; GNU General Public License for more details.
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
23
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
24 ;; You should have received a copy of the GNU General Public License
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
25 ;; along with GNU Emacs; see the file COPYING. If not, write to the
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
26 ;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
27 ;; Boston, MA 02111-1307, USA.
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
28
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
29 ;;; Commentary:
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
30
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
31 ;; This mode is for IDL version 4 or later. It should work on Emacs
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
32 ;; or XEmacs version 19 or later.
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
33
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
34 ;; Runs IDL as an inferior process of Emacs, much like the emacs
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
35 ;; `shell' or `telnet' commands. Provides command history and
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
36 ;; searching. Provides debugging commands available in buffers
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
37 ;; visiting IDL procedure files, e.g., breakpoint setting, stepping,
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
38 ;; execution until a certain line, printing expressions under point,
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
39 ;; visual line pointer for current execution line, etc.
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
40 ;;
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
41 ;; Documentation should be available online with `M-x idlwave-info'.
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
42
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
43 ;; INSTALLATION:
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
44 ;; =============
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
45 ;;
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
46 ;; Follow the instructions in the INSTALL file of the distribution.
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
47 ;; In short, put this file on your load path and add the following
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
48 ;; lines to your .emacs file:
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
49 ;;
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
50 ;; (autoload 'idlwave-shell "idlw-shell" "IDLWAVE Shell" t)
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
51 ;;
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
52 ;;
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
53 ;; SOURCE
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
54 ;; ======
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
55 ;;
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
56 ;; The newest version of this file can be found on the maintainers
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
57 ;; web site.
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
58 ;;
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
59 ;; http://www.strw.leidenuniv.el/~dominik/Tools/idlwave
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
60 ;;
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
61 ;; DOCUMENTATION
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
62 ;; =============
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
63 ;;
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
64 ;; IDLWAVE is documented online in info format.
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
65 ;; A printable version of the documentation is available from the
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
66 ;; maintainers webpage (see under SOURCE)
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
67 ;;
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
68 ;;
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
69 ;; KNOWN PROBLEMS
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
70 ;; ==============
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
71 ;;
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
72 ;; I don't plan on implementing directory tracking by watching the IDL
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
73 ;; commands entered at the prompt, since too often an IDL procedure
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
74 ;; will change the current directory. If you want the the idl process
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
75 ;; buffer to match the IDL current working just execute `M-x
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
76 ;; idlwave-shell-resync-dirs' (bound to "\C-c\C-d\C-w" by default.)
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
77 ;;
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
78 ;; Under XEmacs the Debug menu in the shell does not display the
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
79 ;; keybindings in the prefix map. There bindings are available anyway - so
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
80 ;; it is a bug in XEmacs.
27607
527d42ebb15e (idlwave-shell-print): Fixed bug with
Carsten Dominik <dominik@science.uva.nl>
parents: 27185
diff changeset
81 ;; The Debug menu in source buffers *does* display the bindings correctly.
27107
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
82 ;;
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
83 ;;
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
84 ;; CUSTOMIZATION VARIABLES
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
85 ;; =======================
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
86 ;;
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
87 ;; IDLWAVE has customize support - so if you want to learn about
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
88 ;; the variables which control the behavior of the mode, use
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
89 ;; `M-x idlwave-customize'.
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
90 ;;
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
91 ;;--------------------------------------------------------------------------
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
92 ;;
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
93 ;;
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
94
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
95 ;;; Code:
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
96
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
97 (require 'comint)
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
98 (require 'idlwave)
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
99
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
100 (eval-when-compile (require 'cl))
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
101
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
102 (defvar idlwave-shell-have-new-custom nil)
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
103 (eval-and-compile
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
104 ;; Kludge to allow `defcustom' for Emacs 19.
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
105 (condition-case () (require 'custom) (error nil))
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
106 (if (and (featurep 'custom)
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
107 (fboundp 'custom-declare-variable)
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
108 (fboundp 'defface))
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
109 ;; We've got what we needed
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
110 (setq idlwave-shell-have-new-custom t)
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
111 ;; We have the old or no custom-library, hack around it!
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
112 (defmacro defgroup (&rest args) nil)
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
113 (defmacro defcustom (var value doc &rest args)
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
114 (` (defvar (, var) (, value) (, doc))))))
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
115
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
116 ;;; Customizations: idlwave-shell group
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
117
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
118 (defgroup idlwave-shell-general-setup nil
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
119 "Indentation options for IDL/WAVE mode."
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
120 :prefix "idlwave"
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
121 :group 'idlwave)
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
122
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
123 (defcustom idlwave-shell-prompt-pattern "^ ?IDL> "
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
124 "*Regexp to match IDL prompt at beginning of a line.
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
125 For example, \"^IDL> \" or \"^WAVE> \".
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
126 The \"^\" means beginning of line.
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
127 This variable is used to initialise `comint-prompt-regexp' in the
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
128 process buffer.
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
129
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
130 This is a fine thing to set in your `.emacs' file."
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
131 :group 'idlwave-shell-general-setup
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
132 :type 'regexp)
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
133
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
134 (defcustom idlwave-shell-process-name "idl"
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
135 "*Name to be associated with the IDL process. The buffer for the
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
136 process output is made by surrounding this name with `*'s."
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
137 :group 'idlwave-shell-general-setup
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
138 :type 'string)
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
139
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
140 (defcustom idlwave-shell-automatic-start nil
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
141 "*If non-nil attempt invoke idlwave-shell if not already running.
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
142 This is checked when an attempt to send a command to an
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
143 IDL process is made."
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
144 :group 'idlwave-shell-general-setup
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
145 :type 'boolean)
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
146
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
147 (defcustom idlwave-shell-initial-commands "!more=0"
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
148 "Initial commands, separated by newlines, to send to IDL.
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
149 This string is sent to the IDL process by `idlwave-shell-mode' which is
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
150 invoked by `idlwave-shell'."
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
151 :group 'idlwave-shell-initial-commands
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
152 :type 'string)
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
153
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
154 (defcustom idlwave-shell-use-dedicated-frame nil
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
155 "*Non-nil means, IDLWAVE should use a special frame to display shell buffer."
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
156 :group 'idlwave-shell-general-setup
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
157 :type 'boolean)
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
158
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
159 (defcustom idlwave-shell-frame-parameters
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
160 '((height . 30) (unsplittable . nil))
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
161 "The frame parameters for a dedicated idlwave-shell frame.
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
162 See also `idlwave-shell-use-dedicated-frame'.
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
163 The default makes the frame splittable, so that completion works correctly."
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
164 :group 'idlwave-shell-general-setup
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
165 :type '(repeat
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
166 (cons symbol sexp)))
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
167
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
168 (defcustom idlwave-shell-use-toolbar t
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
169 "Non-nil means, use the debugging toolbar in all IDL related buffers.
27607
527d42ebb15e (idlwave-shell-print): Fixed bug with
Carsten Dominik <dominik@science.uva.nl>
parents: 27185
diff changeset
170 Starting the shell will then add the toolbar to all idlwave-mode buffers.
527d42ebb15e (idlwave-shell-print): Fixed bug with
Carsten Dominik <dominik@science.uva.nl>
parents: 27185
diff changeset
171 Exiting the shell will removed everywhere.
27107
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
172 Available on XEmacs and on Emacs 21.x or later.
27607
527d42ebb15e (idlwave-shell-print): Fixed bug with
Carsten Dominik <dominik@science.uva.nl>
parents: 27185
diff changeset
173 At any time you can toggle the display of the toolbar with
527d42ebb15e (idlwave-shell-print): Fixed bug with
Carsten Dominik <dominik@science.uva.nl>
parents: 27185
diff changeset
174 `C-c C-d C-t' (`idlwave-shell-toggle-toolbar')."
27107
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
175 :group 'idlwave-shell-general-setup
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
176 :type 'boolean)
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
177
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
178 (defcustom idlwave-shell-temp-pro-prefix "/tmp/idltemp"
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
179 "*The prefix for temporary IDL files used when compiling regions.
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
180 It should be an absolute pathname.
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
181 The full temporary file name is obtained by to using `make-temp-name'
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
182 so that the name will be unique among multiple Emacs processes."
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
183 :group 'idlwave-shell-general-setup
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
184 :type 'string)
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
185
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
186 (defvar idlwave-shell-fix-inserted-breaks nil
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
187 "*OBSOLETE VARIABLE, is no longer used.
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
188
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
189 The documentation of this variable used to be:
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
190 If non-nil then run `idlwave-shell-remove-breaks' to clean up IDL messages.")
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
191
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
192 (defcustom idlwave-shell-prefix-key "\C-c\C-d"
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
193 "*The prefix key for the debugging map `idlwave-shell-mode-prefix-map'.
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
194 This variable must already be set when idlwave-shell.el is loaded.
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
195 Seting it in the mode-hook is too late."
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
196 :group 'idlwave-shell-general-setup
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
197 :type 'string)
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
198
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
199 (defcustom idlwave-shell-activate-prefix-keybindings t
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
200 "Non-nil means, the debug commands will be bound to the prefix key.
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
201 The prefix key itself is given in the option `idlwave-shell-prefix-key'.
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
202 So by default setting a breakpoint will be on C-c C-d C-b."
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
203 :group 'idlwave-shell-general-setup
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
204 :type 'boolean)
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
205
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
206 (defcustom idlwave-shell-activate-alt-keybindings nil
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
207 "Non-nil means, the debug commands will be bound to alternate keys.
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
208 So for example setting a breakpoint will be on A-b."
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
209 :group 'idlwave-shell-general-setup
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
210 :type 'boolean)
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
211
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
212 (defcustom idlwave-shell-use-truename nil
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
213 "*Non-nil means, use use `file-truename' when looking for buffers.
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
214 If this variable is non-nil, Emacs will use the function `file-truename' to
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
215 resolve symbolic links in the file paths printed by e.g., STOP commands.
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
216 This means, unvisited files will be loaded under their truename.
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
217 However, when a file is already visited under a deffernet name, IDLWAVE will
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
218 reuse that buffer.
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
219 This option was once introduced in order to avoid multiple buffers visiting
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
220 the same file. However, IDLWAVE no longer makes this mistake, so it is safe
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
221 to set this option to nil."
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
222 :group 'idlwave-shell-general-setup
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
223 :type 'boolean)
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
224
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
225 (defcustom idlwave-shell-file-name-chars "~/A-Za-z0-9+@:_.$#%={}-"
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
226 "The characters allowed in file names, as a string.
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
227 Used for file name completion. Must not contain `'', `,' and `\"'
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
228 because these are used as separators by IDL."
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
229 :group 'idlwave-shell-general-setup
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
230 :type 'string)
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
231
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
232 (defcustom idlwave-shell-mode-hook '()
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
233 "*Hook for customising `idlwave-shell-mode'."
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
234 :group 'idlwave-shell-general-setup
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
235 :type 'hook)
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
236
27607
527d42ebb15e (idlwave-shell-print): Fixed bug with
Carsten Dominik <dominik@science.uva.nl>
parents: 27185
diff changeset
237 (defcustom idlwave-shell-print-expression-function nil
527d42ebb15e (idlwave-shell-print): Fixed bug with
Carsten Dominik <dominik@science.uva.nl>
parents: 27185
diff changeset
238 "When non-nil, a function to handle display of evaluated expressions.
527d42ebb15e (idlwave-shell-print): Fixed bug with
Carsten Dominik <dominik@science.uva.nl>
parents: 27185
diff changeset
239 This can be used to arrange for displaying the value of an expression
527d42ebb15e (idlwave-shell-print): Fixed bug with
Carsten Dominik <dominik@science.uva.nl>
parents: 27185
diff changeset
240 in (e.g.) a special frame. The function must accept one argument:
527d42ebb15e (idlwave-shell-print): Fixed bug with
Carsten Dominik <dominik@science.uva.nl>
parents: 27185
diff changeset
241 the expression which was evaluated. The output from IDL will be
527d42ebb15e (idlwave-shell-print): Fixed bug with
Carsten Dominik <dominik@science.uva.nl>
parents: 27185
diff changeset
242 available in the variable `idlwave-shell-command-output'."
527d42ebb15e (idlwave-shell-print): Fixed bug with
Carsten Dominik <dominik@science.uva.nl>
parents: 27185
diff changeset
243 :group 'idlwave-shell-highlighting-and-faces
527d42ebb15e (idlwave-shell-print): Fixed bug with
Carsten Dominik <dominik@science.uva.nl>
parents: 27185
diff changeset
244 :type 'symbol)
527d42ebb15e (idlwave-shell-print): Fixed bug with
Carsten Dominik <dominik@science.uva.nl>
parents: 27185
diff changeset
245
27107
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
246 ;;; Breakpoint Overlays etc
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
247
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
248 (defgroup idlwave-shell-highlighting-and-faces nil
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
249 "Indentation options for IDL/WAVE mode."
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
250 :prefix "idlwave"
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
251 :group 'idlwave)
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
252
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
253 (defcustom idlwave-shell-mark-stop-line t
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
254 "*Non-nil means, mark the source code line where IDL is currently stopped.
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
255 Value decides about the method which is used to mark the line. Legal values
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
256 are:
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
257
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
258 nil Do not mark the line
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
259 'arrow Use the overlay arrow
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
260 'face Use `idlwave-shell-stop-line-face' to highlight the line.
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
261 t Use what IDLWAVE things is best. Will be a face where possible,
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
262 otherwise the overlay arrow.
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
263 The overlay-arrow has the disadvantage to hide the first chars of a line.
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
264 Since many people do not have the main block of IDL programs indented,
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
265 a face highlighting may be better.
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
266 On Emacs 21, the overlay arrow is displayed in a special area and never
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
267 hides any code, so setting this to 'arrow on Emacs 21 sounds like a good idea."
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
268 :group 'idlwave-shell-highlighting-and-faces
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
269 :type '(choice
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
270 (const :tag "No marking" nil)
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
271 (const :tag "Use overlay arrow" arrow)
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
272 (const :tag "Highlight with face" face)
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
273 (const :tag "Face or arrow." t)))
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
274
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
275 (defcustom idlwave-shell-overlay-arrow ">"
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
276 "*The overlay arrow to display at source lines where execution halts.
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
277 We use a single character by default, since the main block of IDL procedures
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
278 often has no indentation. Where possible, IDLWAVE will use overlays to
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
279 display the stop-lines. The arrow is only used on character-based terminals.
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
280 See also `idlwave-shell-use-overlay-arrow'."
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
281 :group 'idlwave-shell-highlighting-and-faces
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
282 :type 'string)
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
283
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
284 (defcustom idlwave-shell-stop-line-face 'highlight
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
285 "*The face for `idlwave-shell-stop-line-overlay'.
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
286 Allows you to choose the font, color and other properties for
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
287 line where IDL is stopped. See also `idlwave-shell-mark-stop-line'."
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
288 :group 'idlwave-shell-highlighting-and-faces
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
289 :type 'symbol)
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
290
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
291 (defcustom idlwave-shell-mark-breakpoints t
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
292 "*Non-nil means, mark breakpoints in the source files.
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
293 Legal values are:
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
294 nil Do not mark breakpoints.
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
295 'face Highlight line with `idlwave-shell-breakpoint-face'.
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
296 'glyph Red dot at the beginning of line. If the display does not
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
297 support glyphs, will use 'face instead.
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
298 t Glyph when possible, otherwise face (same effect as 'glyph)."
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
299 :group 'idlwave-shell-highlighting-and-faces
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
300 :type '(choice
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
301 (const :tag "No marking" nil)
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
302 (const :tag "Highlight with face" face)
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
303 (const :tag "Display glyph (red dot)" glyph)
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
304 (const :tag "Glyph or face." t)))
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
305
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
306 (defvar idlwave-shell-use-breakpoint-glyph t
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
307 "Obsolete variable. See `idlwave-shell-mark-breakpoints.")
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
308
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
309 (defcustom idlwave-shell-breakpoint-face 'idlwave-shell-bp-face
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
310 "*The face for breakpoint lines in the source code.
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
311 Allows you to choose the font, color and other properties for
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
312 lines which have a breakpoint. See also `idlwave-shell-mark-breakpoints'."
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
313 :group 'idlwave-shell-highlighting-and-faces
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
314 :type 'symbol)
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
315
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
316 (if idlwave-shell-have-new-custom
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
317 ;; We have the new customize - use it to define a customizable face
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
318 (defface idlwave-shell-bp-face
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
319 '((((class color)) (:foreground "Black" :background "Pink"))
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
320 (t (:underline t)))
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
321 "Face for highlighting lines-with-breakpoints."
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
322 :group 'idlwave-shell-highlighting-and-faces)
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
323 ;; Just copy the underline face to be on the safe side.
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
324 (copy-face 'underline 'idlwave-shell-bp-face))
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
325
27607
527d42ebb15e (idlwave-shell-print): Fixed bug with
Carsten Dominik <dominik@science.uva.nl>
parents: 27185
diff changeset
326 (defcustom idlwave-shell-expression-face 'secondary-selection
527d42ebb15e (idlwave-shell-print): Fixed bug with
Carsten Dominik <dominik@science.uva.nl>
parents: 27185
diff changeset
327 "*The face for `idlwave-shell-expression-overlay'.
527d42ebb15e (idlwave-shell-print): Fixed bug with
Carsten Dominik <dominik@science.uva.nl>
parents: 27185
diff changeset
328 Allows you to choose the font, color and other properties for
527d42ebb15e (idlwave-shell-print): Fixed bug with
Carsten Dominik <dominik@science.uva.nl>
parents: 27185
diff changeset
329 the expression printed by IDL."
527d42ebb15e (idlwave-shell-print): Fixed bug with
Carsten Dominik <dominik@science.uva.nl>
parents: 27185
diff changeset
330 :group 'idlwave-shell-highlighting-and-faces
527d42ebb15e (idlwave-shell-print): Fixed bug with
Carsten Dominik <dominik@science.uva.nl>
parents: 27185
diff changeset
331 :type 'symbol)
527d42ebb15e (idlwave-shell-print): Fixed bug with
Carsten Dominik <dominik@science.uva.nl>
parents: 27185
diff changeset
332
27107
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
333 ;;; End user customization variables
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
334
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
335 ;;; External variables
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
336 (defvar comint-last-input-start)
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
337 (defvar comint-last-input-end)
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
338
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
339 ;; Other variables
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
340
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
341 (defvar idlwave-shell-temp-pro-file nil
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
342 "Absolute pathname for temporary IDL file for compiling regions")
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
343
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
344 (defvar idlwave-shell-dirstack-query "printd"
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
345 "Command used by `idlwave-shell-resync-dirs' to query IDL for
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
346 the directory stack.")
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
347
27607
527d42ebb15e (idlwave-shell-print): Fixed bug with
Carsten Dominik <dominik@science.uva.nl>
parents: 27185
diff changeset
348 (defvar idlwave-shell-mode-line-info nil
527d42ebb15e (idlwave-shell-print): Fixed bug with
Carsten Dominik <dominik@science.uva.nl>
parents: 27185
diff changeset
349 "Additional info displayed in the mode line")
527d42ebb15e (idlwave-shell-print): Fixed bug with
Carsten Dominik <dominik@science.uva.nl>
parents: 27185
diff changeset
350
27107
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
351 (defvar idlwave-shell-default-directory nil
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
352 "The default directory in the idlwave-shell buffer, of outside use.")
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
353
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
354 (defvar idlwave-shell-last-save-and-action-file nil
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
355 "The last file which was compiled with `idlwave-shell-save-and-...'.")
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
356
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
357 ;; Highlighting uses overlays. When necessary, require the emulation.
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
358 (if (not (fboundp 'make-overlay))
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
359 (condition-case nil
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
360 (require 'overlay)
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
361 (error nil)))
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
362
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
363 (defvar idlwave-shell-stop-line-overlay nil
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
364 "The overlay for where IDL is currently stopped.")
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
365 (defvar idlwave-shell-expression-overlay nil
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
366 "The overlay for where IDL is currently stopped.")
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
367 ;; If these were already overlays, delete them. This probably means that we
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
368 ;; are reloading this file.
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
369 (if (overlayp idlwave-shell-stop-line-overlay)
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
370 (delete-overlay idlwave-shell-stop-line-overlay))
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
371 (if (overlayp idlwave-shell-expression-overlay)
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
372 (delete-overlay idlwave-shell-expression-overlay))
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
373 ;; Set to nil initially
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
374 (setq idlwave-shell-stop-line-overlay nil
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
375 idlwave-shell-expression-overlay nil)
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
376
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
377 ;; Define the shell stop overlay. When left nil, the arrow will be used.
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
378 (cond
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
379 ((or (null idlwave-shell-mark-stop-line)
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
380 (eq idlwave-shell-mark-stop-line 'arrow))
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
381 ;; Leave the overlay nil
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
382 nil)
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
383
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
384 ((eq idlwave-shell-mark-stop-line 'face)
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
385 ;; Try to use a face. If not possible, arrow will be used anyway
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
386 ;; So who can display faces?
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
387 (when (or (featurep 'xemacs) ; XEmacs can do also ttys
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
388 (fboundp 'tty-defined-colors) ; Emacs 21 as well
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
389 window-system) ; Window systems always
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
390 (progn
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
391 (setq idlwave-shell-stop-line-overlay (make-overlay 1 1))
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
392 (overlay-put idlwave-shell-stop-line-overlay
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
393 'face idlwave-shell-stop-line-face))))
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
394
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
395 (t
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
396 ;; IDLWAVE may decide. Will use a face on window systems, arrow elsewhere
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
397 (if window-system
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
398 (progn
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
399 (setq idlwave-shell-stop-line-overlay (make-overlay 1 1))
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
400 (overlay-put idlwave-shell-stop-line-overlay
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
401 'face idlwave-shell-stop-line-face)))))
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
402
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
403 ;; Now the expression overlay
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
404 (setq idlwave-shell-expression-overlay (make-overlay 1 1))
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
405 (overlay-put idlwave-shell-expression-overlay
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
406 'face idlwave-shell-expression-face)
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
407 (defvar idlwave-shell-bp-query "help,/breakpoints"
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
408 "Command to obtain list of breakpoints")
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
409
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
410 (defvar idlwave-shell-command-output nil
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
411 "String for accumulating current command output.")
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
412
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
413 (defvar idlwave-shell-post-command-hook nil
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
414 "Lisp list expression or function to run when an IDL command is finished.
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
415 The current command is finished when the IDL prompt is displayed.
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
416 This is evaluated if it is a list or called with funcall.")
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
417
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
418 (defvar idlwave-shell-hide-output nil
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
419 "If non-nil the process output is not inserted into the output
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
420 buffer.")
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
421
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
422 (defvar idlwave-shell-accumulation nil
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
423 "Accumulate last line of output.")
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
424
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
425 (defvar idlwave-shell-command-line-to-execute nil)
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
426 (defvar idlwave-shell-cleanup-hook nil
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
427 "List of functions to do cleanup when the shell exits.")
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
428
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
429 (defvar idlwave-shell-pending-commands nil
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
430 "List of commands to be sent to IDL.
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
431 Each element of the list is list of \(CMD PCMD HIDE\), where CMD is a
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
432 string to be sent to IDL and PCMD is a post-command to be placed on
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
433 `idlwave-shell-post-command-hook'. If HIDE is non-nil, hide the output
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
434 from command CMD. PCMD and HIDE are optional.")
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
435
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
436 (defun idlwave-shell-buffer ()
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
437 "Name of buffer associated with IDL process.
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
438 The name of the buffer is made by surrounding `idlwave-shell-process-name
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
439 with `*'s."
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
440 (concat "*" idlwave-shell-process-name "*"))
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
441
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
442 (defvar idlwave-shell-ready nil
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
443 "If non-nil can send next command to IDL process.")
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
444
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
445 ;;; The following are the types of messages we attempt to catch to
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
446 ;;; resync our idea of where IDL execution currently is.
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
447 ;;;
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
448
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
449 (defvar idlwave-shell-halt-frame nil
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
450 "The frame associated with halt/breakpoint messages.")
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
451
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
452 (defvar idlwave-shell-step-frame nil
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
453 "The frame associated with step messages.")
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
454
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
455 (defvar idlwave-shell-trace-frame nil
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
456 "The frame associated with trace messages.")
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
457
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
458 (defconst idlwave-shell-halt-messages
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
459 '("^% Execution halted at"
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
460 "^% Interrupted at:"
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
461 "^% Stepped to:"
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
462 "^% At "
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
463 "^% Stop encountered:"
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
464 )
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
465 "*A list of regular expressions matching IDL messages.
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
466 These are the messages containing file and line information where
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
467 IDL is currently stopped.")
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
468
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
469 (defconst idlwave-shell-halt-messages-re
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
470 (mapconcat 'identity idlwave-shell-halt-messages "\\|")
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
471 "The regular expression computed from idlwave-shell-halt-messages")
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
472
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
473 (defconst idlwave-shell-trace-messages
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
474 '("^% At " ;; First line of a trace message
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
475 )
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
476 "*A list of regular expressions matching IDL trace messages.
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
477 These are the messages containing file and line information where
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
478 IDL will begin looking for the next statement to execute.")
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
479
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
480 (defconst idlwave-shell-step-messages
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
481 '("^% Stepped to:"
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
482 )
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
483 "*A list of regular expressions matching stepped execution messages.
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
484 These are IDL messages containing file and line information where
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
485 IDL has currently stepped.")
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
486
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
487 (defvar idlwave-shell-break-message "^% Breakpoint at:"
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
488 "*Regular expression matching an IDL breakpoint message line.")
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
489
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
490
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
491 (defvar idlwave-shell-bp-alist)
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
492 ;(defvar idlwave-shell-post-command-output)
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
493 (defvar idlwave-shell-sources-alist)
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
494 (defvar idlwave-shell-menu-def)
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
495 (defvar idlwave-shell-mode-menu)
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
496 (defvar idlwave-shell-initial-commands)
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
497 (defvar idlwave-shell-syntax-error)
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
498 (defvar idlwave-shell-other-error)
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
499 (defvar idlwave-shell-error-buffer)
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
500 (defvar idlwave-shell-error-last)
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
501 (defvar idlwave-shell-bp-buffer)
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
502 (defvar idlwave-shell-sources-query)
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
503 (defvar idlwave-shell-mode-map)
27607
527d42ebb15e (idlwave-shell-print): Fixed bug with
Carsten Dominik <dominik@science.uva.nl>
parents: 27185
diff changeset
504 (defvar idlwave-shell-calling-stack-index)
27107
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
505
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
506 (defun idlwave-shell-mode ()
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
507 "Major mode for interacting with an inferior IDL process.
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
508
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
509 1. Shell Interaction
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
510 -----------------
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
511 RET after the end of the process' output sends the text from the
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
512 end of process to the end of the current line. RET before end of
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
513 process output copies the current line (except for the prompt) to the
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
514 end of the buffer.
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
515
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
516 Command history, searching of previous commands, command line
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
517 editing are available via the comint-mode key bindings, by default
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
518 mostly on the key `C-c'.
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
519
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
520 2. Completion
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
521 ----------
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
522
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
523 TAB and M-TAB do completion of IDL routines and keywords - similar
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
524 to M-TAB in `idlwave-mode'. In executive commands and strings,
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
525 it completes file names.
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
526
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
527 3. Routine Info
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
528 ------------
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
529 `\\[idlwave-routine-info]' displays information about an IDL routine near point,
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
530 just like in `idlwave-mode'. The module used is the one at point or
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
531 the one whose argument list is being edited.
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
532 To update IDLWAVE's knowledge about compiled or edited modules, use
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
533 \\[idlwave-update-routine-info].
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
534 \\[idlwave-find-module] find the source of a module.
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
535 \\[idlwave-resolve] tells IDL to compile an unresolved module.
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
536
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
537 4. Debugging
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
538 ---------
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
539 A complete set of commands for compiling and debugging IDL programs
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
540 is available from the menu. Also keybindings starting with a
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
541 `C-c C-d' prefix are available for most commands in the *idl* buffer
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
542 and also in source buffers. The best place to learn about the
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
543 keybindings is again the menu.
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
544
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
545 On Emacs versions where this is possible, a debugging toolbar is
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
546 installed.
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
547
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
548 When IDL is halted in the middle of a procedure, the corresponding
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
549 line of that procedure file is displayed with an overlay in another
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
550 window. Breakpoints are also highlighted in the source.
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
551
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
552 \\[idlwave-shell-resync-dirs] queries IDL in order to change Emacs current directory
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
553 to correspond to the IDL process current directory.
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
554
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
555 5. Hooks
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
556 -----
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
557 Turning on `idlwave-shell-mode' runs `comint-mode-hook' and
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
558 `idlwave-shell-mode-hook' (in that order).
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
559
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
560 6. Documentation and Customization
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
561 -------------------------------
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
562 Info documentation for this package is available. Use \\[idlwave-info]
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
563 to display (complain to your sysadmin if that does not work).
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
564 For Postscript and HTML versions of the documentation, check IDLWAVE's
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
565 homepage at `http://www.strw.leidenuniv.nl/~dominik/Tools/idlwave'.
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
566 IDLWAVE has customize support - see the group `idlwave'.
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
567
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
568 7. Keybindings
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
569 -----------
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
570 \\{idlwave-shell-mode-map}"
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
571
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
572 (interactive)
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
573 (setq comint-prompt-regexp idlwave-shell-prompt-pattern)
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
574 (setq comint-process-echoes t)
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
575 ;; Can not use history expansion because "!" is used for system variables.
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
576 (setq comint-input-autoexpand nil)
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
577 (setq comint-input-ring-size 64)
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
578 (make-local-variable 'comint-completion-addsuffix)
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
579 (set (make-local-variable 'completion-ignore-case) t)
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
580 (setq comint-completion-addsuffix '("/" . ""))
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
581 (setq comint-input-ignoredups t)
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
582 (setq major-mode 'idlwave-shell-mode)
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
583 (setq mode-name "IDL-Shell")
27607
527d42ebb15e (idlwave-shell-print): Fixed bug with
Carsten Dominik <dominik@science.uva.nl>
parents: 27185
diff changeset
584 (setq idlwave-shell-mode-line-info nil)
527d42ebb15e (idlwave-shell-print): Fixed bug with
Carsten Dominik <dominik@science.uva.nl>
parents: 27185
diff changeset
585 (setq mode-line-format
527d42ebb15e (idlwave-shell-print): Fixed bug with
Carsten Dominik <dominik@science.uva.nl>
parents: 27185
diff changeset
586 '(""
527d42ebb15e (idlwave-shell-print): Fixed bug with
Carsten Dominik <dominik@science.uva.nl>
parents: 27185
diff changeset
587 mode-line-modified
527d42ebb15e (idlwave-shell-print): Fixed bug with
Carsten Dominik <dominik@science.uva.nl>
parents: 27185
diff changeset
588 mode-line-buffer-identification
527d42ebb15e (idlwave-shell-print): Fixed bug with
Carsten Dominik <dominik@science.uva.nl>
parents: 27185
diff changeset
589 " "
527d42ebb15e (idlwave-shell-print): Fixed bug with
Carsten Dominik <dominik@science.uva.nl>
parents: 27185
diff changeset
590 global-mode-string
527d42ebb15e (idlwave-shell-print): Fixed bug with
Carsten Dominik <dominik@science.uva.nl>
parents: 27185
diff changeset
591 " %[("
527d42ebb15e (idlwave-shell-print): Fixed bug with
Carsten Dominik <dominik@science.uva.nl>
parents: 27185
diff changeset
592 mode-name
527d42ebb15e (idlwave-shell-print): Fixed bug with
Carsten Dominik <dominik@science.uva.nl>
parents: 27185
diff changeset
593 mode-line-process
527d42ebb15e (idlwave-shell-print): Fixed bug with
Carsten Dominik <dominik@science.uva.nl>
parents: 27185
diff changeset
594 minor-mode-alist
527d42ebb15e (idlwave-shell-print): Fixed bug with
Carsten Dominik <dominik@science.uva.nl>
parents: 27185
diff changeset
595 "%n"
527d42ebb15e (idlwave-shell-print): Fixed bug with
Carsten Dominik <dominik@science.uva.nl>
parents: 27185
diff changeset
596 ")%]-"
527d42ebb15e (idlwave-shell-print): Fixed bug with
Carsten Dominik <dominik@science.uva.nl>
parents: 27185
diff changeset
597 idlwave-shell-mode-line-info
527d42ebb15e (idlwave-shell-print): Fixed bug with
Carsten Dominik <dominik@science.uva.nl>
parents: 27185
diff changeset
598 "---"
527d42ebb15e (idlwave-shell-print): Fixed bug with
Carsten Dominik <dominik@science.uva.nl>
parents: 27185
diff changeset
599 (line-number-mode "L%l--")
527d42ebb15e (idlwave-shell-print): Fixed bug with
Carsten Dominik <dominik@science.uva.nl>
parents: 27185
diff changeset
600 (column-number-mode "C%c--")
527d42ebb15e (idlwave-shell-print): Fixed bug with
Carsten Dominik <dominik@science.uva.nl>
parents: 27185
diff changeset
601 (-3 . "%p")
527d42ebb15e (idlwave-shell-print): Fixed bug with
Carsten Dominik <dominik@science.uva.nl>
parents: 27185
diff changeset
602 "-%-"))
27107
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
603 ;; (make-local-variable 'idlwave-shell-bp-alist)
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
604 (setq idlwave-shell-halt-frame nil
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
605 idlwave-shell-trace-frame nil
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
606 idlwave-shell-command-output nil
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
607 idlwave-shell-step-frame nil)
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
608 (idlwave-shell-display-line nil)
27607
527d42ebb15e (idlwave-shell-print): Fixed bug with
Carsten Dominik <dominik@science.uva.nl>
parents: 27185
diff changeset
609 (setq idlwave-shell-calling-stack-index 0)
27107
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
610 ;; Make sure comint-last-input-end does not go to beginning of
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
611 ;; buffer (in case there were other processes already in this buffer).
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
612 (set-marker comint-last-input-end (point))
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
613 (setq idlwave-shell-ready nil)
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
614 (setq idlwave-shell-bp-alist nil)
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
615 (idlwave-shell-update-bp-overlays) ; Throw away old overlays
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
616 (setq idlwave-shell-sources-alist nil)
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
617 (setq idlwave-shell-default-directory default-directory)
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
618 ;; (make-local-variable 'idlwave-shell-temp-pro-file)
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
619 (setq idlwave-shell-hide-output nil
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
620 idlwave-shell-temp-pro-file
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
621 (concat (make-temp-name idlwave-shell-temp-pro-prefix) ".pro"))
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
622 (make-local-hook 'kill-buffer-hook)
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
623 (add-hook 'kill-buffer-hook 'idlwave-shell-kill-shell-buffer-confirm
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
624 nil 'local)
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
625 (use-local-map idlwave-shell-mode-map)
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
626 (easy-menu-add idlwave-shell-mode-menu idlwave-shell-mode-map)
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
627 (run-hooks 'idlwave-shell-mode-hook)
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
628 (idlwave-shell-send-command idlwave-shell-initial-commands nil 'hide)
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
629 )
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
630
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
631 (if (not (fboundp 'idl-shell))
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
632 (fset 'idl-shell 'idlwave-shell))
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
633
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
634 (defvar idlwave-shell-idl-wframe nil
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
635 "Frame for displaying the idl shell window.")
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
636 (defvar idlwave-shell-display-wframe nil
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
637 "Frame for displaying the idl source files.")
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
638
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
639 (defvar idlwave-shell-calling-stack-index 0)
27607
527d42ebb15e (idlwave-shell-print): Fixed bug with
Carsten Dominik <dominik@science.uva.nl>
parents: 27185
diff changeset
640 (defvar idlwave-shell-calling-stack-routine nil)
27107
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
641
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
642 (defun idlwave-shell-source-frame ()
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
643 "Return the frame to be used for source display."
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
644 (if idlwave-shell-use-dedicated-frame
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
645 ;; We want separate frames for source and shell
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
646 (if (frame-live-p idlwave-shell-display-wframe)
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
647 ;; The frame exists, so we use it.
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
648 idlwave-shell-display-wframe
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
649 ;; The frame does not exist. We use the current frame.
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
650 ;; However, if the current is the shell frame, we make a new frame.
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
651 (setq idlwave-shell-display-wframe
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
652 (if (eq (selected-frame) idlwave-shell-idl-wframe)
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
653 (make-frame)
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
654 (selected-frame))))))
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
655
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
656 (defun idlwave-shell-shell-frame ()
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
657 "Return the frame to be used for the shell buffer."
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
658 (if idlwave-shell-use-dedicated-frame
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
659 ;; We want a dedicated frame
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
660 (if (frame-live-p idlwave-shell-idl-wframe)
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
661 ;; It does exist, so we use it.
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
662 idlwave-shell-idl-wframe
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
663 ;; It does not exist. Check if we have a source frame.
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
664 (if (not (frame-live-p idlwave-shell-display-wframe))
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
665 ;; We do not have a source frame, so we use this one.
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
666 (setq idlwave-shell-display-wframe (selected-frame)))
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
667 ;; Return a new frame
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
668 (setq idlwave-shell-idl-wframe
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
669 (make-frame idlwave-shell-frame-parameters)))))
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
670
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
671 ;;;###autoload
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
672 (defun idlwave-shell (&optional arg)
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
673 "Run an inferior IDL, with I/O through buffer `(idlwave-shell-buffer)'.
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
674 If buffer exists but shell process is not running, start new IDL.
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
675 If buffer exists and shell process is running, just switch to the buffer.
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
676
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
677 When called with a prefix ARG, or when `idlwave-shell-use-dedicated-frame'
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
678 is non-nil, the shell buffer and the source buffers will be in
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
679 separate frames.
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
680
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
681 The command to run comes from variable `idlwave-shell-explicit-file-name'.
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
682
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
683 The buffer is put in `idlwave-shell-mode', providing commands for sending
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
684 input and controlling the IDL job. See help on `idlwave-shell-mode'.
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
685 See also the variable `idlwave-shell-prompt-pattern'.
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
686
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
687 \(Type \\[describe-mode] in the shell buffer for a list of commands.)"
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
688 (interactive "P")
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
689
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
690 ;; A non-nil arg means, we want a dedicated frame. This will last
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
691 ;; for the current editing session.
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
692 (if arg (setq idlwave-shell-use-dedicated-frame t))
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
693 (if (equal arg '(16)) (setq idlwave-shell-use-dedicated-frame nil))
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
694
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
695 ;; Check if the process still exists. If not, create it.
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
696 (unless (comint-check-proc (idlwave-shell-buffer))
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
697 (let* ((prg (or idlwave-shell-explicit-file-name "idl"))
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
698 (buf (apply 'make-comint
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
699 idlwave-shell-process-name prg nil
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
700 idlwave-shell-command-line-options))
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
701 ;; FIXME: the next line can go?
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
702 ;(buf (make-comint idlwave-shell-process-name prg))
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
703 (process (get-buffer-process buf)))
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
704 (set-process-filter process 'idlwave-shell-filter)
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
705 (set-process-sentinel process 'idlwave-shell-sentinel)
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
706 (set-buffer buf)
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
707 (idlwave-shell-mode)))
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
708 (let ((window (idlwave-display-buffer (idlwave-shell-buffer) nil
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
709 (idlwave-shell-shell-frame)))
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
710 (current-window (selected-window)))
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
711 (select-window window)
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
712 (goto-char (point-max))
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
713 (select-window current-window)
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
714 (raise-frame (window-frame window))
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
715 (if (eq (selected-frame) (window-frame window))
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
716 (select-window window))
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
717 ))
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
718
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
719 (defun idlwave-shell-recenter-shell-window (&optional arg)
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
720 "Run `idlwave-shell', but make sure the current window stays selected."
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
721 (interactive "P")
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
722 (let ((window (selected-window)))
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
723 (idlwave-shell arg)
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
724 (select-window window)))
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
725
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
726 (defun idlwave-shell-send-command (&optional cmd pcmd hide preempt)
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
727 "Send a command to IDL process.
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
728
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
729 \(CMD PCMD HIDE\) are placed at the end of `idlwave-shell-pending-commands'.
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
730 If IDL is ready the first command, CMD, in
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
731 `idlwave-shell-pending-commands' is sent to the IDL process. If optional
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
732 second argument PCMD is non-nil it will be placed on
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
733 `idlwave-shell-post-command-hook' when CMD is executed. If the optional
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
734 third argument HIDE is non-nil, then hide output from CMD.
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
735 If optional fourth argument PREEMPT is non-nil CMD is put at front of
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
736 `idlwave-shell-pending-commands'.
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
737
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
738 IDL is considered ready if the prompt is present
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
739 and if `idlwave-shell-ready' is non-nil."
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
740
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
741 ;(setq hide nil) ; FIXME: turn this on for debugging only
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
742 (let (buf proc)
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
743 ;; Get or make the buffer and its process
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
744 (if (or (not (setq buf (get-buffer (idlwave-shell-buffer))))
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
745 (not (setq proc (get-buffer-process buf))))
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
746 (if (not idlwave-shell-automatic-start)
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
747 (error
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
748 (substitute-command-keys
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
749 "You need to first start an IDL shell with \\[idlwave-shell]"))
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
750 (idlwave-shell-recenter-shell-window)
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
751 (setq buf (get-buffer (idlwave-shell-buffer)))
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
752 (if (or (not (setq buf (get-buffer (idlwave-shell-buffer))))
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
753 (not (setq proc (get-buffer-process buf))))
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
754 ;; Still nothing
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
755 (error "Problem with autostarting IDL shell"))))
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
756
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
757 (save-excursion
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
758 (set-buffer buf)
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
759 (goto-char (process-mark proc))
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
760 ;; To make this easy, always push CMD onto pending commands
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
761 (if cmd
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
762 (setq idlwave-shell-pending-commands
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
763 (if preempt
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
764 ;; Put at front.
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
765 (append (list (list cmd pcmd hide))
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
766 idlwave-shell-pending-commands)
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
767 ;; Put at end.
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
768 (append idlwave-shell-pending-commands
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
769 (list (list cmd pcmd hide))))))
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
770 ;; Check if IDL ready
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
771 (if (and idlwave-shell-ready
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
772 ;; Check for IDL prompt
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
773 (save-excursion
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
774 (beginning-of-line)
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
775 (looking-at idlwave-shell-prompt-pattern)))
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
776 ;; IDL ready for command
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
777 (if idlwave-shell-pending-commands
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
778 ;; execute command
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
779 (let* ((lcmd (car idlwave-shell-pending-commands))
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
780 (cmd (car lcmd))
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
781 (pcmd (nth 1 lcmd))
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
782 (hide (nth 2 lcmd)))
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
783 ;; If this is an executive command, reset the stack pointer
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
784 (if (eq (string-to-char cmd) ?.)
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
785 (setq idlwave-shell-calling-stack-index 0))
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
786 ;; Set post-command
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
787 (setq idlwave-shell-post-command-hook pcmd)
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
788 ;; Output hiding
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
789 ;;; Debug code
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
790 ;;; (setq idlwave-shell-hide-output nil)
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
791 (setq idlwave-shell-hide-output hide)
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
792 ;; Pop command
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
793 (setq idlwave-shell-pending-commands
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
794 (cdr idlwave-shell-pending-commands))
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
795 ;; Send command for execution
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
796 (set-marker comint-last-input-start (point))
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
797 (set-marker comint-last-input-end (point))
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
798 (comint-simple-send proc cmd)
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
799 (setq idlwave-shell-ready nil)))))))
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
800
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
801 ;; There was a report that a newer version of comint.el changed the
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
802 ;; name of comint-filter to comint-output-filter. Unfortunately, we
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
803 ;; have yet to upgrade.
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
804
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
805 (defun idlwave-shell-comint-filter (process string) nil)
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
806 (if (fboundp 'comint-output-filter)
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
807 (fset 'idlwave-shell-comint-filter (symbol-function 'comint-output-filter))
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
808 (fset 'idlwave-shell-comint-filter (symbol-function 'comint-filter)))
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
809
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
810 (defun idlwave-shell-is-running ()
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
811 "Return t if the shell process is running."
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
812 (eq (process-status idlwave-shell-process-name) 'run))
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
813
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
814 (defun idlwave-shell-filter (proc string)
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
815 "Replace Carriage returns in output. Watch for prompt.
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
816 When the IDL prompt is received executes `idlwave-shell-post-command-hook'
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
817 and then calls `idlwave-shell-send-command' for any pending commands."
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
818 ;; We no longer do the cleanup here - this is done by the process sentinel
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
819 (when (eq (process-status idlwave-shell-process-name) 'run)
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
820 ;; OK, process is still running, so we can use it.
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
821 (let ((data (match-data)))
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
822 (unwind-protect
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
823 (progn
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
824 ;; May change the original match data.
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
825 (let (p)
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
826 (while (setq p (string-match "\C-M" string))
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
827 (aset string p ? )))
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
828 ;;; Test/Debug code
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
829 ;; (save-excursion (set-buffer (get-buffer-create "*test*"))
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
830 ;; (goto-char (point-max))
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
831 ;; (insert "%%%" string))
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
832 ;;
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
833 ;; Keep output
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
834
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
835 ; Should not keep output because the concat is costly. If hidden put
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
836 ; the output in a hide-buffer. Then when the output is needed in post
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
837 ; processing can access either the hide buffer or the idlwave-shell
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
838 ; buffer. Then watching for the prompt is easier. Furthermore, if it
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
839 ; is hidden and there is no post command, could throw away output.
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
840 ; (setq idlwave-shell-command-output
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
841 ; (concat idlwave-shell-command-output string))
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
842 ;; Insert the string. Do this before getting the
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
843 ;; state.
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
844 (if idlwave-shell-hide-output
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
845 (save-excursion
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
846 (set-buffer
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
847 (get-buffer-create "*idlwave-shell-hidden-output*"))
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
848 (goto-char (point-max))
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
849 (insert string))
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
850 (idlwave-shell-comint-filter proc string))
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
851 ;; Watch for prompt - need to accumulate the current line
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
852 ;; since it may not be sent all at once.
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
853 (if (string-match "\n" string)
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
854 (setq idlwave-shell-accumulation
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
855 (substring string
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
856 (progn (string-match "\\(.*\n\\)*" string)
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
857 (match-end 0))))
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
858 (setq idlwave-shell-accumulation
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
859 (concat idlwave-shell-accumulation string)))
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
860 ;; Check for prompt in current line
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
861 (if (setq idlwave-shell-ready
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
862 (string-match idlwave-shell-prompt-pattern
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
863 idlwave-shell-accumulation))
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
864 (progn
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
865 (if idlwave-shell-hide-output
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
866 (save-excursion
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
867 (set-buffer "*idlwave-shell-hidden-output*")
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
868 (goto-char (point-min))
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
869 (re-search-forward idlwave-shell-prompt-pattern nil t)
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
870 (setq idlwave-shell-command-output
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
871 (buffer-substring (point-min) (point)))
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
872 (delete-region (point-min) (point)))
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
873 (setq idlwave-shell-command-output
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
874 (save-excursion
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
875 (set-buffer
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
876 (process-buffer proc))
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
877 (buffer-substring
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
878 (progn
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
879 (goto-char (process-mark proc))
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
880 (beginning-of-line nil)
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
881 (point))
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
882 comint-last-input-end))))
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
883 ;;; Test/Debug code
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
884 ;; (save-excursion (set-buffer
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
885 ;; (get-buffer-create "*idlwave-shell-output*"))
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
886 ;; (goto-char (point-max))
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
887 ;; (insert "%%%" string))
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
888 ;; Scan for state and do post command - bracket them
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
889 ;; with idlwave-shell-ready=nil since they
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
890 ;; may call idlwave-shell-send-command.
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
891 (let ((idlwave-shell-ready nil))
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
892 (idlwave-shell-scan-for-state)
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
893 ;; Unset idlwave-shell-ready to prevent sending
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
894 ;; commands to IDL while running hook.
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
895 (if (listp idlwave-shell-post-command-hook)
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
896 (eval idlwave-shell-post-command-hook)
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
897 (funcall idlwave-shell-post-command-hook))
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
898 ;; Reset to default state for next command.
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
899 ;; Also we do not want to find this prompt again.
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
900 (setq idlwave-shell-accumulation nil
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
901 idlwave-shell-command-output nil
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
902 idlwave-shell-post-command-hook nil
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
903 idlwave-shell-hide-output nil))
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
904 ;; Done with post command. Do pending command if
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
905 ;; any.
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
906 (idlwave-shell-send-command))))
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
907 (store-match-data data)))))
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
908
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
909 (defun idlwave-shell-sentinel (process event)
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
910 "The sentinel function for the IDLWAVE shell process."
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
911 (let* ((buf (idlwave-shell-buffer))
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
912 (win (get-buffer-window buf)))
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
913 (when (get-buffer buf)
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
914 (save-excursion
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
915 (set-buffer (idlwave-shell-buffer))
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
916 (goto-char (point-max))
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
917 (insert (format "\n\n Process %s %s" process event))))
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
918 (when (and (> (length (frame-list)) 1)
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
919 (frame-live-p idlwave-shell-idl-wframe))
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
920 (delete-frame idlwave-shell-idl-wframe)
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
921 (setq idlwave-shell-idl-wframe nil
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
922 idlwave-shell-display-wframe nil))
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
923 (when (window-live-p win)
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
924 (delete-window win))
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
925 (idlwave-shell-cleanup)))
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
926
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
927 (defun idlwave-shell-scan-for-state ()
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
928 "Scan for state info.
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
929 Looks for messages in output from last IDL command indicating where
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
930 IDL has stopped. The types of messages we are interested in are
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
931 execution halted, stepped, breakpoint, interrupted at and trace
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
932 messages. We ignore error messages otherwise.
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
933 For breakpoint messages process any attached count or command
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
934 parameters.
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
935 Update the windows if a message is found."
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
936 (let (update)
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
937 (cond
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
938 ;; Make sure we have output
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
939 ((not idlwave-shell-command-output))
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
940
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
941 ;; Various types of HALT messages.
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
942 ((string-match idlwave-shell-halt-messages-re
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
943 idlwave-shell-command-output)
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
944 ;; Grab the file and line state info.
27607
527d42ebb15e (idlwave-shell-print): Fixed bug with
Carsten Dominik <dominik@science.uva.nl>
parents: 27185
diff changeset
945 (setq idlwave-shell-calling-stack-index 0)
27107
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
946 (setq idlwave-shell-halt-frame
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
947 (idlwave-shell-parse-line
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
948 (substring idlwave-shell-command-output (match-end 0)))
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
949 update t))
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
950
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
951 ;; Handle breakpoints separately
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
952 ((string-match idlwave-shell-break-message
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
953 idlwave-shell-command-output)
27607
527d42ebb15e (idlwave-shell-print): Fixed bug with
Carsten Dominik <dominik@science.uva.nl>
parents: 27185
diff changeset
954 (setq idlwave-shell-calling-stack-index 0)
27107
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
955 (setq idlwave-shell-halt-frame
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
956 (idlwave-shell-parse-line
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
957 (substring idlwave-shell-command-output (match-end 0)))
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
958 update t)
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
959 ;; We used to to counting hits on breakpoints
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
960 ;; this is no longer supported since IDL breakpoints
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
961 ;; have learned counting.
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
962 ;; Do breakpoint command processing
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
963 (let ((bp (assoc
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
964 (list
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
965 (nth 0 idlwave-shell-halt-frame)
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
966 (nth 1 idlwave-shell-halt-frame))
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
967 idlwave-shell-bp-alist)))
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
968 (if bp
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
969 (let ((cmd (idlwave-shell-bp-get bp 'cmd)))
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
970 (if cmd
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
971 ;; Execute command
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
972 (if (listp cmd)
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
973 (eval cmd)
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
974 (funcall cmd))))
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
975 ;; A breakpoint that we did not know about - perhaps it was
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
976 ;; set by the user or IDL isn't reporting breakpoints like
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
977 ;; we expect. Lets update our list.
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
978 (idlwave-shell-bp-query)))))
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
979
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
980 ;; Handle compilation errors in addition to the above
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
981 (if (and idlwave-shell-command-output
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
982 (or (string-match
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
983 idlwave-shell-syntax-error idlwave-shell-command-output)
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
984 (string-match
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
985 idlwave-shell-other-error idlwave-shell-command-output)))
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
986 (progn
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
987 (save-excursion
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
988 (set-buffer
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
989 (get-buffer-create idlwave-shell-error-buffer))
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
990 (erase-buffer)
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
991 (insert idlwave-shell-command-output)
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
992 (goto-char (point-min))
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
993 (setq idlwave-shell-error-last (point)))
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
994 (idlwave-shell-goto-next-error)))
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
995
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
996 ;; Do update
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
997 (when update
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
998 (idlwave-shell-display-line (idlwave-shell-pc-frame)))))
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
999
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1000
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1001 (defvar idlwave-shell-error-buffer
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1002 "*idlwave-shell-errors*"
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1003 "Buffer containing syntax errors from IDL compilations.")
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1004
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1005 ;; FIXME: the following two variables do not currently allow line breaks
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1006 ;; in module and file names. I am not sure if it will be necessary to
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1007 ;; change this. Currently it seems to work the way it is.
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1008 (defvar idlwave-shell-syntax-error
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1009 "^% Syntax error.\\s-*\n\\s-*At:\\s-*\\(.*\\),\\s-*Line\\s-*\\(.*\\)"
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1010 "A regular expression to match an IDL syntax error.
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1011 The first \(..\) pair should match the file name. The second pair
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1012 should match the line number.")
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1013
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1014 (defvar idlwave-shell-other-error
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1015 "^% .*\n\\s-*At:\\s-*\\(.*\\),\\s-*Line\\s-*\\(.*\\)"
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1016 "A regular expression to match any IDL error.
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1017 The first \(..\) pair should match the file name. The second pair
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1018 should match the line number.")
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1019
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1020 (defvar idlwave-shell-file-line-message
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1021 (concat
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1022 "\\(" ; program name group (1)
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1023 "\\<[a-zA-Z][a-zA-Z0-9_$:]*" ; start with a letter, followed by [..]
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1024 "\\([ \t]*\n[ \t]*[a-zA-Z0-9_$:]+\\)*"; continuation lines program name (2)
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1025 "\\)" ; end program name group (1)
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1026 "[ \t\n]+" ; white space
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1027 "\\(" ; line number group (3)
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1028 "[0-9]+" ; the line number (the fix point)
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1029 "\\([ \t]*\n[ \t]*[0-9]+\\)*" ; continuation lines number (4)
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1030 "\\)" ; end line number group (3)
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1031 "[ \t\n]+" ; white space
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1032 "\\(" ; file name group (5)
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1033 "[^ \t\n]+" ; file names can contain any non-white
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1034 "\\([ \t]*\n[ \t]*[^ \t\n]+\\)*" ; continuation lines file name (6)
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1035 "\\)" ; end line number group (5)
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1036 )
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1037 "*A regular expression to parse out the file name and line number.
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1038 The 1st group should match the subroutine name.
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1039 The 3rd group is the line number.
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1040 The 5th group is the file name.
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1041 All parts may contain linebreaks surrounded by spaces. This is important
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1042 in IDL5 which inserts random linebreaks in long module and file names.")
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1043
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1044 (defun idlwave-shell-parse-line (string)
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1045 "Parse IDL message for the subroutine, file name and line number.
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1046 We need to work hard here to remove the stupid line breaks inserted by
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1047 IDL5. These line breaks can be right in the middle of procedure
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1048 or file names.
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1049 It is very difficult to come up with a robust solution. This one seems
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1050 to be pretty good though.
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1051
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1052 Here is in what ways it improves over the previous solution:
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1053
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1054 1. The procedure name can be split and will be restored.
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1055 2. The number can be split. I have never seen this, but who knows.
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1056 3. We do not require the `.pro' extension for files.
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1057
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1058 This function can still break when the file name ends on a end line
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1059 and the message line contains an additional line with garbage. Then
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1060 the first part of that garbage will be added to the file name.
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1061 However, the function checks the existence of the files with and
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1062 without this last part - thus the function only breaks if file name
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1063 plus garbage match an existing regular file. This is hopefully very
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1064 unlikely."
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1065
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1066 (let (number procedure file)
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1067 (when (string-match idlwave-shell-file-line-message string)
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1068 (setq procedure (match-string 1 string)
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1069 number (match-string 3 string)
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1070 file (match-string 5 string))
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1071
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1072 ;; Repair the strings
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1073 (setq procedure (idlwave-shell-repair-string procedure))
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1074 (setq number (idlwave-shell-repair-string number))
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1075 (setq file (idlwave-shell-repair-file-name file))
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1076
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1077 ;; If we have a file, return the frame list
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1078 (if file
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1079 (list (idlwave-shell-file-name file)
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1080 (string-to-int number)
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1081 procedure)
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1082 ;; No success finding a file
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1083 nil))))
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1084
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1085 (defun idlwave-shell-repair-string (string)
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1086 "Repair a string by taking out all linebreaks. This is destructive!"
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1087 (while (string-match "[ \t]*\n[ \t]*" string)
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1088 (setq string (replace-match "" t t string)))
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1089 string)
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1090
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1091 (defun idlwave-shell-repair-file-name (file)
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1092 "Repair a file name string by taking out all linebreaks.
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1093 The last line of STRING may be garbage - we check which one makes a valid
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1094 file name."
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1095 (let ((file1 "") (file2 "") (start 0))
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1096 ;; We scan no further than to the next "^%" line
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1097 (if (string-match "^%" file)
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1098 (setq file (substring file 0 (match-beginning 0))))
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1099 ;; Take out the line breaks
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1100 (while (string-match "[ \t]*\n[ \t]*" file start)
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1101 (setq file1 (concat file1 (substring file start (match-beginning 0)))
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1102 start (match-end 0)))
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1103 (setq file2 (concat file1 (substring file start)))
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1104 (cond
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1105 ((file-regular-p file2) file2)
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1106 ((file-regular-p file1) file1)
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1107 ;; If we cannot veryfy the existence of the file, we return the shorter
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1108 ;; name. The idea behind this is that this may be a relative file name
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1109 ;; and our idea about the current working directory may be wrong.
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1110 ;; If it is a relative file name, it hopefully is short.
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1111 ((not (string= "" file1)) file1)
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1112 ((not (string= "" file2)) file2)
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1113 (t nil))))
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1114
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1115 (defun idlwave-shell-cleanup ()
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1116 "Do necessary cleanup for a terminated IDL process."
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1117 (setq idlwave-shell-step-frame nil
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1118 idlwave-shell-halt-frame nil
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1119 idlwave-shell-pending-commands nil
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1120 idlwave-shell-command-line-to-execute nil
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1121 idlwave-shell-bp-alist nil
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1122 idlwave-shell-calling-stack-index 0)
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1123 (idlwave-shell-display-line nil)
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1124 (idlwave-shell-update-bp-overlays) ; kill old overlays
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1125 (idlwave-shell-kill-buffer "*idlwave-shell-hidden-output*")
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1126 (idlwave-shell-kill-buffer idlwave-shell-bp-buffer)
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1127 (idlwave-shell-kill-buffer idlwave-shell-error-buffer)
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1128 ;; (idlwave-shell-kill-buffer (idlwave-shell-buffer))
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1129 (and (get-buffer (idlwave-shell-buffer))
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1130 (bury-buffer (get-buffer (idlwave-shell-buffer))))
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1131 (run-hooks 'idlwave-shell-cleanup-hook))
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1132
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1133 (defun idlwave-shell-kill-buffer (buf)
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1134 "Kill buffer BUF if it exists."
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1135 (if (setq buf (get-buffer buf))
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1136 (kill-buffer buf)))
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1137
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1138 (defun idlwave-shell-kill-shell-buffer-confirm ()
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1139 (when (idlwave-shell-is-running)
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1140 (ding)
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1141 (unless (y-or-n-p "IDL shell is running. Are you sure you want to kill the buffer? ")
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1142 (error "Abort"))
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1143 (message "Killing buffer *idl* and the associated process")))
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1144
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1145 (defun idlwave-shell-resync-dirs ()
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1146 "Resync the buffer's idea of the current directory stack.
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1147 This command queries IDL with the command bound to
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1148 `idlwave-shell-dirstack-query' (default \"printd\"), reads the
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1149 output for the new directory stack."
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1150 (interactive)
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1151 (idlwave-shell-send-command idlwave-shell-dirstack-query
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1152 'idlwave-shell-filter-directory
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1153 'hide))
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1154
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1155 (defun idlwave-shell-retall (&optional arg)
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1156 "Return from the entire calling stack."
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1157 (interactive "P")
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1158 (idlwave-shell-send-command "retall"))
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1159
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1160 (defun idlwave-shell-closeall (&optional arg)
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1161 "Close all open files."
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1162 (interactive "P")
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1163 (idlwave-shell-send-command "close,/all"))
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1164
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1165 (defun idlwave-shell-quit (&optional arg)
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1166 "Exit the idl process after confirmation.
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1167 With prefix ARG, exit without confirmation."
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1168 (interactive "P")
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1169 (if (not (idlwave-shell-is-running))
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1170 (error "Shell is not running")
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1171 (if (or arg (y-or-n-p "Exit the IDLWAVE Shell? "))
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1172 (condition-case nil
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1173 (idlwave-shell-send-command "exit")
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1174 (error nil)))))
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1175
27607
527d42ebb15e (idlwave-shell-print): Fixed bug with
Carsten Dominik <dominik@science.uva.nl>
parents: 27185
diff changeset
1176 (defun idlwave-shell-reset (&optional hidden)
27107
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1177 "Reset IDL. Return to main level and destroy the leaftover variables.
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1178 This issues the following commands:
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1179 RETALL
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1180 WIDGET_CONTROL,/RESET
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1181 CLOSE, /ALL
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1182 HEAP_GC, /VERBOSE"
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1183 ;; OBJ_DESTROY, OBJ_VALID() FIXME: should this be added?
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1184 (interactive "P")
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1185 (message "Resetting IDL")
27607
527d42ebb15e (idlwave-shell-print): Fixed bug with
Carsten Dominik <dominik@science.uva.nl>
parents: 27185
diff changeset
1186 (setq idlwave-shell-calling-stack-index 0)
527d42ebb15e (idlwave-shell-print): Fixed bug with
Carsten Dominik <dominik@science.uva.nl>
parents: 27185
diff changeset
1187 (idlwave-shell-send-command "retall" nil hidden)
527d42ebb15e (idlwave-shell-print): Fixed bug with
Carsten Dominik <dominik@science.uva.nl>
parents: 27185
diff changeset
1188 (idlwave-shell-send-command "widget_control,/reset" nil hidden)
527d42ebb15e (idlwave-shell-print): Fixed bug with
Carsten Dominik <dominik@science.uva.nl>
parents: 27185
diff changeset
1189 (idlwave-shell-send-command "close,/all" nil hidden)
527d42ebb15e (idlwave-shell-print): Fixed bug with
Carsten Dominik <dominik@science.uva.nl>
parents: 27185
diff changeset
1190 ;; (idlwave-shell-send-command "obj_destroy, obj_valid()" nil hidden)
527d42ebb15e (idlwave-shell-print): Fixed bug with
Carsten Dominik <dominik@science.uva.nl>
parents: 27185
diff changeset
1191 (idlwave-shell-send-command "heap_gc,/verbose" nil hidden)
527d42ebb15e (idlwave-shell-print): Fixed bug with
Carsten Dominik <dominik@science.uva.nl>
parents: 27185
diff changeset
1192 (idlwave-shell-display-line nil))
27107
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1193
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1194 (defun idlwave-shell-filter-directory ()
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1195 "Get the current directory from `idlwave-shell-command-output'.
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1196 Change the default directory for the process buffer to concur."
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1197 (save-excursion
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1198 (set-buffer (idlwave-shell-buffer))
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1199 (if (string-match "Current Directory: *\\(\\S-*\\) *$"
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1200 idlwave-shell-command-output)
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1201 (let ((dir (substring idlwave-shell-command-output
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1202 (match-beginning 1) (match-end 1))))
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1203 (message "Setting Emacs wd to %s" dir)
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1204 (setq idlwave-shell-default-directory dir)
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1205 (setq default-directory (file-name-as-directory dir))))))
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1206
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1207 (defun idlwave-shell-complete (&optional arg)
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1208 "Do completion in the idlwave-shell buffer.
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1209 Calls `idlwave-shell-complete-filename' after some executive commands or
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1210 in strings. Otherwise, calls `idlwave-complete' to complete modules and
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1211 keywords."
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1212 ;;FIXME: batch files?
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1213 (interactive "P")
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1214 (let (cmd)
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1215 (cond
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1216 ((setq cmd (idlwave-shell-executive-command))
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1217 ;; We are in a command line with an executive command
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1218 (if (member (upcase cmd)
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1219 '(".R" ".RU" ".RUN" ".RN" ".RNE" ".RNEW"
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1220 ".COM" ".COMP" ".COMPI" ".COMPIL" ".COMPILE"))
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1221 ;; This command expects file names
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1222 (idlwave-shell-complete-filename)))
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1223 ((idlwave-shell-filename-string)
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1224 ;; In a string, could be a file name to here
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1225 (idlwave-shell-complete-filename))
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1226 (t
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1227 ;; Default completion of modules and keywords
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1228 (idlwave-complete)))))
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1229
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1230 (defun idlwave-shell-complete-filename (&optional arg)
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1231 "Complete a file name at point if after a file name.
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1232 We assume that we are after a file name when completing one of the
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1233 args of an executive .run, .rnew or .compile. Also, in a string
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1234 constant we complete file names. Otherwise return nil, so that
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1235 other completion functions can do thier work."
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1236 (let* ((comint-file-name-chars idlwave-shell-file-name-chars)
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1237 (completion-ignore-case (default-value 'completion-ignore-case)))
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1238 (comint-dynamic-complete-filename)))
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1239
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1240 (defun idlwave-shell-executive-command ()
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1241 "Return the name of the current executive command, if any."
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1242 (save-excursion
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1243 (idlwave-beginning-of-statement)
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1244 (if (looking-at "[ \t]*\\([.][^ \t\n\r]*\\)")
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1245 (match-string 1))))
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1246
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1247 (defun idlwave-shell-filename-string ()
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1248 "Return t if in a string and after what could be a file name."
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1249 (let ((limit (save-excursion (beginning-of-line) (point))))
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1250 (save-excursion
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1251 ;; Skip backwards over file name chars
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1252 (skip-chars-backward idlwave-shell-file-name-chars limit)
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1253 ;; Check of the next char is a string delimiter
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1254 (memq (preceding-char) '(?\' ?\")))))
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1255
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1256 ;;;
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1257 ;;; This section contains code for debugging IDL programs. --------------------
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1258 ;;;
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1259
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1260 (defun idlwave-shell-redisplay (&optional hide)
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1261 "Tries to resync the display with where execution has stopped.
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1262 Issues a \"help,/trace\" command followed by a call to
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1263 `idlwave-shell-display-line'. Also updates the breakpoint
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1264 overlays."
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1265 (interactive)
27607
527d42ebb15e (idlwave-shell-print): Fixed bug with
Carsten Dominik <dominik@science.uva.nl>
parents: 27185
diff changeset
1266 (setq idlwave-shell-calling-stack-index 0)
27107
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1267 (idlwave-shell-send-command
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1268 "help,/trace"
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1269 '(idlwave-shell-display-line
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1270 (idlwave-shell-pc-frame))
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1271 hide)
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1272 (idlwave-shell-bp-query))
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1273
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1274 (defun idlwave-shell-display-level-in-calling-stack (&optional hide)
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1275 (idlwave-shell-send-command
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1276 "help,/trace"
27607
527d42ebb15e (idlwave-shell-print): Fixed bug with
Carsten Dominik <dominik@science.uva.nl>
parents: 27185
diff changeset
1277 `(progn
527d42ebb15e (idlwave-shell-print): Fixed bug with
Carsten Dominik <dominik@science.uva.nl>
parents: 27185
diff changeset
1278 ;; scanning for the state will reset the stack level - restore it
527d42ebb15e (idlwave-shell-print): Fixed bug with
Carsten Dominik <dominik@science.uva.nl>
parents: 27185
diff changeset
1279 (setq idlwave-shell-calling-stack-index
527d42ebb15e (idlwave-shell-print): Fixed bug with
Carsten Dominik <dominik@science.uva.nl>
parents: 27185
diff changeset
1280 ,idlwave-shell-calling-stack-index)
527d42ebb15e (idlwave-shell-print): Fixed bug with
Carsten Dominik <dominik@science.uva.nl>
parents: 27185
diff changeset
1281 ;; parse the stack and visit the selected frame
527d42ebb15e (idlwave-shell-print): Fixed bug with
Carsten Dominik <dominik@science.uva.nl>
parents: 27185
diff changeset
1282 (idlwave-shell-parse-stack-and-display))
27107
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1283 hide))
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1284
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1285 (defun idlwave-shell-parse-stack-and-display ()
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1286 (let* ((lines (delete "" (idlwave-split-string
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1287 idlwave-shell-command-output "^%")))
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1288 (stack (delq nil (mapcar 'idlwave-shell-parse-line lines)))
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1289 (nmax (1- (length stack)))
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1290 (nmin 0) message)
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1291 (cond
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1292 ((< nmax nmin)
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1293 (setq idlwave-shell-calling-stack-index 0)
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1294 (error "Problem with calling stack"))
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1295 ((> idlwave-shell-calling-stack-index nmax)
27607
527d42ebb15e (idlwave-shell-print): Fixed bug with
Carsten Dominik <dominik@science.uva.nl>
parents: 27185
diff changeset
1296 (ding)
27107
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1297 (setq idlwave-shell-calling-stack-index nmax
27607
527d42ebb15e (idlwave-shell-print): Fixed bug with
Carsten Dominik <dominik@science.uva.nl>
parents: 27185
diff changeset
1298 message (format "%d is the highest calling stack level - can't go further up"
527d42ebb15e (idlwave-shell-print): Fixed bug with
Carsten Dominik <dominik@science.uva.nl>
parents: 27185
diff changeset
1299 (- nmax))))
27107
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1300 ((< idlwave-shell-calling-stack-index nmin)
27607
527d42ebb15e (idlwave-shell-print): Fixed bug with
Carsten Dominik <dominik@science.uva.nl>
parents: 27185
diff changeset
1301 (ding)
27107
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1302 (setq idlwave-shell-calling-stack-index nmin
27607
527d42ebb15e (idlwave-shell-print): Fixed bug with
Carsten Dominik <dominik@science.uva.nl>
parents: 27185
diff changeset
1303 message (format "%d is the current calling stack level - can't go further down"
527d42ebb15e (idlwave-shell-print): Fixed bug with
Carsten Dominik <dominik@science.uva.nl>
parents: 27185
diff changeset
1304 (- nmin)))))
527d42ebb15e (idlwave-shell-print): Fixed bug with
Carsten Dominik <dominik@science.uva.nl>
parents: 27185
diff changeset
1305 (setq idlwave-shell-calling-stack-routine
527d42ebb15e (idlwave-shell-print): Fixed bug with
Carsten Dominik <dominik@science.uva.nl>
parents: 27185
diff changeset
1306 (nth 2 (nth idlwave-shell-calling-stack-index stack)))
27107
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1307 (idlwave-shell-display-line
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1308 (nth idlwave-shell-calling-stack-index stack))
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1309 (message (or message
27607
527d42ebb15e (idlwave-shell-print): Fixed bug with
Carsten Dominik <dominik@science.uva.nl>
parents: 27185
diff changeset
1310 (format "In routine %s (stack level %d)"
527d42ebb15e (idlwave-shell-print): Fixed bug with
Carsten Dominik <dominik@science.uva.nl>
parents: 27185
diff changeset
1311 idlwave-shell-calling-stack-routine
527d42ebb15e (idlwave-shell-print): Fixed bug with
Carsten Dominik <dominik@science.uva.nl>
parents: 27185
diff changeset
1312 (- idlwave-shell-calling-stack-index))))))
27107
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1313
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1314 (defun idlwave-shell-stack-up ()
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1315 "Display the source code one step up the calling stack."
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1316 (interactive)
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1317 (incf idlwave-shell-calling-stack-index)
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1318 (idlwave-shell-display-level-in-calling-stack 'hide))
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1319 (defun idlwave-shell-stack-down ()
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1320 "Display the source code one step down the calling stack."
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1321 (interactive)
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1322 (decf idlwave-shell-calling-stack-index)
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1323 (idlwave-shell-display-level-in-calling-stack 'hide))
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1324
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1325 (defun idlwave-shell-goto-frame (&optional frame)
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1326 "Set buffer to FRAME with point at the frame line.
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1327 If the optional argument FRAME is nil then idlwave-shell-pc-frame is
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1328 used. Does nothing if the resulting frame is nil."
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1329 (if frame ()
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1330 (setq frame (idlwave-shell-pc-frame)))
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1331 (cond
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1332 (frame
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1333 (set-buffer (idlwave-find-file-noselect (car frame)))
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1334 (widen)
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1335 (goto-line (nth 1 frame)))))
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1336
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1337 (defun idlwave-shell-pc-frame ()
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1338 "Returns the frame for IDL execution."
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1339 (and idlwave-shell-halt-frame
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1340 (list (nth 0 idlwave-shell-halt-frame)
27607
527d42ebb15e (idlwave-shell-print): Fixed bug with
Carsten Dominik <dominik@science.uva.nl>
parents: 27185
diff changeset
1341 (nth 1 idlwave-shell-halt-frame)
527d42ebb15e (idlwave-shell-print): Fixed bug with
Carsten Dominik <dominik@science.uva.nl>
parents: 27185
diff changeset
1342 (nth 2 idlwave-shell-halt-frame))))
27107
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1343
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1344 (defun idlwave-shell-valid-frame (frame)
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1345 "Check that frame is for an existing file."
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1346 (file-readable-p (car frame)))
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1347
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1348 (defun idlwave-shell-display-line (frame &optional col)
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1349 "Display FRAME file in other window with overlay arrow.
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1350
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1351 FRAME is a list of file name, line number, and subroutine name.
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1352 If FRAME is nil then remove overlay."
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1353 (if (not frame)
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1354 ;; Remove stop-line overlay from old position
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1355 (progn
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1356 (setq overlay-arrow-string nil)
27607
527d42ebb15e (idlwave-shell-print): Fixed bug with
Carsten Dominik <dominik@science.uva.nl>
parents: 27185
diff changeset
1357 (setq idlwave-shell-mode-line-info nil)
27107
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1358 (if idlwave-shell-stop-line-overlay
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1359 (delete-overlay idlwave-shell-stop-line-overlay)))
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1360 (if (not (idlwave-shell-valid-frame frame))
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1361 (error (concat "Invalid frame - unable to access file: " (car frame)))
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1362 ;;;
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1363 ;;; buffer : the buffer to display a line in.
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1364 ;;; select-shell: current buffer is the shell.
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1365 ;;;
27607
527d42ebb15e (idlwave-shell-print): Fixed bug with
Carsten Dominik <dominik@science.uva.nl>
parents: 27185
diff changeset
1366 (setq idlwave-shell-mode-line-info
527d42ebb15e (idlwave-shell-print): Fixed bug with
Carsten Dominik <dominik@science.uva.nl>
parents: 27185
diff changeset
1367 (if (nth 2 frame)
527d42ebb15e (idlwave-shell-print): Fixed bug with
Carsten Dominik <dominik@science.uva.nl>
parents: 27185
diff changeset
1368 (format "[%d:%s]"
527d42ebb15e (idlwave-shell-print): Fixed bug with
Carsten Dominik <dominik@science.uva.nl>
parents: 27185
diff changeset
1369 (- idlwave-shell-calling-stack-index)
527d42ebb15e (idlwave-shell-print): Fixed bug with
Carsten Dominik <dominik@science.uva.nl>
parents: 27185
diff changeset
1370 (nth 2 frame))))
27107
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1371 (let* ((buffer (idlwave-find-file-noselect (car frame)))
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1372 (select-shell (equal (buffer-name) (idlwave-shell-buffer)))
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1373 window pos)
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1374
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1375 ;; First make sure the shell window is visible
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1376 (idlwave-display-buffer (idlwave-shell-buffer)
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1377 nil (idlwave-shell-shell-frame))
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1378
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1379 ;; Now display the buffer and remember which window it is.
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1380 (setq window (idlwave-display-buffer buffer
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1381 nil (idlwave-shell-source-frame)))
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1382
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1383 ;; Enter the buffer and mark the line
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1384 (save-excursion
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1385 (set-buffer buffer)
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1386 (save-restriction
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1387 (widen)
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1388 (goto-line (nth 1 frame))
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1389 (setq pos (point))
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1390 (if idlwave-shell-stop-line-overlay
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1391 ;; Move overlay
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1392 (move-overlay idlwave-shell-stop-line-overlay
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1393 (point) (save-excursion (end-of-line) (point))
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1394 (current-buffer))
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1395 ;; Use the arrow instead, but only if marking is wanted.
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1396 (if idlwave-shell-mark-stop-line
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1397 (setq overlay-arrow-string idlwave-shell-overlay-arrow))
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1398 (or overlay-arrow-position ; create the marker if necessary
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1399 (setq overlay-arrow-position (make-marker)))
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1400 (set-marker overlay-arrow-position (point) buffer)))
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1401
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1402 ;; If the point is outside the restriction, widen the buffer.
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1403 (if (or (< pos (point-min)) (> pos (point-max)))
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1404 (progn
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1405 (widen)
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1406 (goto-char pos)))
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1407
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1408 ;; If we have the column of the error, move the cursor there.
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1409 (if col (move-to-column col))
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1410 (setq pos (point)))
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1411
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1412 ;; Make sure pos is really displayed in the window.
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1413 (set-window-point window pos)
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1414
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1415 ;; FIXME: the following frame redraw was taken out because it
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1416 ;; flashes. I think it is not needed. The code is left here in
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1417 ;; case we have to put it back in.
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1418 ;; (redraw-frame (window-frame window))
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1419
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1420 ;; If we came from the shell, go back there. Otherwise select
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1421 ;; the window where the error is displayed.
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1422 (if (and (equal (buffer-name) (idlwave-shell-buffer))
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1423 (not select-shell))
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1424 (select-window window))))))
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1425
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1426
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1427 (defun idlwave-shell-step (arg)
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1428 "Step one source line. If given prefix argument ARG, step ARG source lines."
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1429 (interactive "p")
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1430 (or (not arg) (< arg 1)
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1431 (setq arg 1))
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1432 (idlwave-shell-send-command
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1433 (concat ".s " (if (integerp arg) (int-to-string arg) arg))))
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1434
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1435 (defun idlwave-shell-stepover (arg)
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1436 "Stepover one source line.
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1437 If given prefix argument ARG, step ARG source lines.
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1438 Uses IDL's stepover executive command which does not enter called functions."
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1439 (interactive "p")
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1440 (or (not arg) (< arg 1)
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1441 (setq arg 1))
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1442 (idlwave-shell-send-command
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1443 (concat ".so " (if (integerp arg) (int-to-string arg) arg))))
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1444
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1445 (defun idlwave-shell-break-here (&optional count cmd)
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1446 "Set breakpoint at current line.
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1447
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1448 If Count is nil then an ordinary breakpoint is set. We treat a count
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1449 of 1 as a temporary breakpoint using the ONCE keyword. Counts greater
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1450 than 1 use the IDL AFTER=count keyword to break only after reaching
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1451 the statement count times.
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1452
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1453 Optional argument CMD is a list or function to evaluate upon reaching
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1454 the breakpoint."
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1455
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1456 (interactive "P")
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1457 (if (listp count)
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1458 (setq count nil))
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1459 (idlwave-shell-set-bp
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1460 ;; Create breakpoint
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1461 (idlwave-shell-bp (idlwave-shell-current-frame)
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1462 (list count cmd)
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1463 (idlwave-shell-current-module))))
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1464
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1465 (defun idlwave-shell-set-bp-check (bp)
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1466 "Check for failure to set breakpoint.
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1467 This is run on `idlwave-shell-post-command-hook'.
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1468 Offers to recompile the procedure if we failed. This usually fixes
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1469 the problem with not being able to set the breakpoint."
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1470 ;; Scan for message
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1471 (if (and idlwave-shell-command-output
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1472 (string-match "% BREAKPOINT: *Unable to find code"
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1473 idlwave-shell-command-output))
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1474 ;; Offer to recompile
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1475 (progn
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1476 (if (progn
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1477 (beep)
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1478 (y-or-n-p
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1479 (concat "Okay to recompile file "
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1480 (idlwave-shell-bp-get bp 'file) " ")))
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1481 ;; Recompile
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1482 (progn
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1483 ;; Clean up before retrying
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1484 (idlwave-shell-command-failure)
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1485 (idlwave-shell-send-command
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1486 (concat ".run " (idlwave-shell-bp-get bp 'file)) nil nil)
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1487 ;; Try setting breakpoint again
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1488 (idlwave-shell-set-bp bp))
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1489 (beep)
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1490 (message "Unable to set breakpoint.")
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1491 (idlwave-shell-command-failure)
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1492 )
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1493 ;; return non-nil if no error found
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1494 nil)
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1495 'okay))
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1496
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1497 (defun idlwave-shell-command-failure ()
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1498 "Do any necessary clean up when an IDL command fails.
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1499 Call this from a function attached to `idlwave-shell-post-command-hook'
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1500 that detects the failure of a command.
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1501 For example, this is called from `idlwave-shell-set-bp-check' when a
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1502 breakpoint can not be set."
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1503 ;; Clear pending commands
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1504 (setq idlwave-shell-pending-commands nil))
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1505
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1506 (defun idlwave-shell-cont ()
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1507 "Continue executing."
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1508 (interactive)
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1509 (idlwave-shell-send-command ".c" '(idlwave-shell-redisplay 'hide)))
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1510
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1511 (defun idlwave-shell-go ()
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1512 "Run .GO. This starts the main program of the last compiled file."
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1513 (interactive)
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1514 (idlwave-shell-send-command ".go" '(idlwave-shell-redisplay 'hide)))
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1515
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1516 (defun idlwave-shell-return ()
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1517 "Run .RETURN (continue to next return, but stay in subprogram)."
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1518 (interactive)
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1519 (idlwave-shell-send-command ".return" '(idlwave-shell-redisplay 'hide)))
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1520
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1521 (defun idlwave-shell-skip ()
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1522 "Run .SKIP (skip one line, then step)."
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1523 (interactive)
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1524 (idlwave-shell-send-command ".skip" '(idlwave-shell-redisplay 'hide)))
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1525
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1526 (defun idlwave-shell-clear-bp (bp)
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1527 "Clear breakpoint BP.
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1528 Clears in IDL and in `idlwave-shell-bp-alist'."
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1529 (let ((index (idlwave-shell-bp-get bp)))
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1530 (if index
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1531 (progn
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1532 (idlwave-shell-send-command
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1533 (concat "breakpoint,/clear,"
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1534 (if (integerp index) (int-to-string index) index)))
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1535 (idlwave-shell-bp-query)))))
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1536
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1537 (defun idlwave-shell-current-frame ()
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1538 "Return a list containing the current file name and line point is in.
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1539 If in the IDL shell buffer, returns `idlwave-shell-pc-frame'."
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1540 (if (eq (current-buffer) (get-buffer (idlwave-shell-buffer)))
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1541 ;; In IDL shell
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1542 (idlwave-shell-pc-frame)
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1543 ;; In source
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1544 (list (idlwave-shell-file-name (buffer-file-name))
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1545 (save-restriction
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1546 (widen)
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1547 (save-excursion
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1548 (beginning-of-line)
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1549 (1+ (count-lines 1 (point))))))))
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1550
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1551 (defun idlwave-shell-current-module ()
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1552 "Return the name of the module for the current file.
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1553 Returns nil if unable to obtain a module name."
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1554 (if (eq (current-buffer) (get-buffer (idlwave-shell-buffer)))
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1555 ;; In IDL shell
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1556 (nth 2 idlwave-shell-halt-frame)
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1557 ;; In pro file
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1558 (save-restriction
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1559 (widen)
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1560 (save-excursion
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1561 (if (idlwave-prev-index-position)
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1562 (upcase (idlwave-unit-name)))))))
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1563
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1564 (defun idlwave-shell-clear-current-bp ()
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1565 "Remove breakpoint at current line.
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1566 This command can be called from the shell buffer if IDL is currently stopped
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1567 at a breakpoint."
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1568 (interactive)
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1569 (let ((bp (idlwave-shell-find-bp (idlwave-shell-current-frame))))
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1570 (if bp (idlwave-shell-clear-bp bp)
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1571 ;; Try moving to beginning of statement
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1572 (save-excursion
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1573 (idlwave-shell-goto-frame)
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1574 (idlwave-beginning-of-statement)
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1575 (setq bp (idlwave-shell-find-bp (idlwave-shell-current-frame)))
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1576 (if bp (idlwave-shell-clear-bp bp)
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1577 (beep)
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1578 (message "Cannot identify breakpoint for this line"))))))
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1579
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1580 (defun idlwave-shell-to-here ()
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1581 "Set a breakpoint with count 1 then continue."
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1582 (interactive)
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1583 (idlwave-shell-break-here 1)
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1584 (idlwave-shell-cont))
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1585
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1586 (defun idlwave-shell-break-in (&optional module)
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1587 "Look for a module name near point and set a break point for it.
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1588 The command looks for an identifier near point and sets a breakpoint
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1589 for the first line of the corresponding module."
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1590 (interactive)
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1591 ;; get the identifier
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1592 (let (module)
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1593 (save-excursion
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1594 (skip-chars-backward "a-zA-Z0-9_$")
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1595 (if (looking-at idlwave-identifier)
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1596 (setq module (match-string 0))
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1597 (error "No identifier at point")))
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1598 (idlwave-shell-send-command
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1599 idlwave-shell-sources-query
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1600 `(progn
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1601 (idlwave-shell-sources-filter)
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1602 (idlwave-shell-set-bp-in-module ,module))
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1603 'hide)))
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1604
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1605 (defun idlwave-shell-set-bp-in-module (module)
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1606 "Set breakpoint in module. Assumes that `idlwave-shell-sources-alist'
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1607 contains an entry for that module."
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1608 (let ((source-file (car-safe
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1609 (cdr-safe
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1610 (assoc (upcase module)
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1611 idlwave-shell-sources-alist))))
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1612 buf)
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1613 (if (or (not source-file)
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1614 (not (file-regular-p source-file))
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1615 (not (setq buf
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1616 (or (idlwave-get-buffer-visiting source-file)
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1617 (find-file-noselect source-file)))))
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1618 (progn
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1619 (message "The source file for module %s is probably not compiled"
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1620 module)
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1621 (beep))
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1622 (save-excursion
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1623 (set-buffer buf)
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1624 (save-excursion
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1625 (goto-char (point-min))
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1626 (let ((case-fold-search t))
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1627 (if (re-search-forward
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1628 (concat "^[ \t]*\\(pro\\|function\\)[ \t]+"
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1629 (downcase module)
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1630 "[ \t\n,]") nil t)
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1631 (progn
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1632 (goto-char (match-beginning 1))
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1633 (message "Setting breakpoint for module %s" module)
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1634 (idlwave-shell-break-here))
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1635 (message "Cannot find module %s in file %s" module source-file)
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1636 (beep))))))))
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1637
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1638 (defun idlwave-shell-up ()
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1639 "Run to end of current block.
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1640 Sets a breakpoint with count 1 at end of block, then continues."
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1641 (interactive)
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1642 (if (idlwave-shell-pc-frame)
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1643 (save-excursion
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1644 (idlwave-shell-goto-frame)
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1645 ;; find end of subprogram
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1646 (let ((eos (save-excursion
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1647 (idlwave-beginning-of-subprogram)
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1648 (idlwave-forward-block)
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1649 (point))))
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1650 (idlwave-backward-up-block -1)
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1651 ;; move beyond end block line - IDL will not break there.
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1652 ;; That is, you can put a breakpoint there but when IDL does
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1653 ;; break it will report that it is at the next line.
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1654 (idlwave-next-statement)
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1655 (idlwave-end-of-statement)
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1656 ;; Make sure we are not beyond subprogram
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1657 (if (< (point) eos)
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1658 ;; okay
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1659 ()
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1660 ;; Move back inside subprogram
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1661 (goto-char eos)
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1662 (idlwave-previous-statement))
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1663 (idlwave-shell-to-here)))))
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1664
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1665 (defun idlwave-shell-out ()
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1666 "Attempt to run until this procedure exits.
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1667 Runs to the last statement and then steps 1 statement. Use the .out command."
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1668 (interactive)
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1669 (idlwave-shell-send-command (concat ".o")))
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1670
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1671 (defun idlwave-shell-help-expression ()
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1672 "Print help on current expression. See `idlwave-shell-print'."
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1673 (interactive)
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1674 (idlwave-shell-print 'help))
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1675
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1676 (defun idlwave-shell-mouse-print (event)
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1677 "Call `idlwave-shell-print' at the mouse position."
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1678 (interactive "e")
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1679 (mouse-set-point event)
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1680 (idlwave-shell-print))
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1681
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1682 (defun idlwave-shell-mouse-help (event)
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1683 "Call `idlwave-shell-print' at the mouse position."
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1684 (interactive "e")
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1685 (mouse-set-point event)
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1686 (idlwave-shell-help-expression))
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1687
27607
527d42ebb15e (idlwave-shell-print): Fixed bug with
Carsten Dominik <dominik@science.uva.nl>
parents: 27185
diff changeset
1688 (defun idlwave-shell-print (&optional help)
527d42ebb15e (idlwave-shell-print): Fixed bug with
Carsten Dominik <dominik@science.uva.nl>
parents: 27185
diff changeset
1689 "Print current expression. With HELP, show help on expression.
27107
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1690 An expression is an identifier plus 1 pair of matched parentheses
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1691 directly following the identifier - an array or function
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1692 call. Alternatively, an expression is the contents of any matched
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1693 parentheses when the open parentheses is not directly preceded by an
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1694 identifier. If point is at the beginning or within an expression
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1695 return the inner-most containing expression, otherwise, return the
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1696 preceding expression."
27607
527d42ebb15e (idlwave-shell-print): Fixed bug with
Carsten Dominik <dominik@science.uva.nl>
parents: 27185
diff changeset
1697 (interactive)
27107
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1698 (save-excursion
27607
527d42ebb15e (idlwave-shell-print): Fixed bug with
Carsten Dominik <dominik@science.uva.nl>
parents: 27185
diff changeset
1699 (let (expr beg end cmd)
527d42ebb15e (idlwave-shell-print): Fixed bug with
Carsten Dominik <dominik@science.uva.nl>
parents: 27185
diff changeset
1700 (if current-prefix-arg
527d42ebb15e (idlwave-shell-print): Fixed bug with
Carsten Dominik <dominik@science.uva.nl>
parents: 27185
diff changeset
1701 (setq expr (read-string "Expression: "))
527d42ebb15e (idlwave-shell-print): Fixed bug with
Carsten Dominik <dominik@science.uva.nl>
parents: 27185
diff changeset
1702 ;; Move to beginning of current or previous expression
527d42ebb15e (idlwave-shell-print): Fixed bug with
Carsten Dominik <dominik@science.uva.nl>
parents: 27185
diff changeset
1703 (if (looking-at "\\<\\|(")
527d42ebb15e (idlwave-shell-print): Fixed bug with
Carsten Dominik <dominik@science.uva.nl>
parents: 27185
diff changeset
1704 ;; At beginning of expression, don't move backwards unless
527d42ebb15e (idlwave-shell-print): Fixed bug with
Carsten Dominik <dominik@science.uva.nl>
parents: 27185
diff changeset
1705 ;; this is at the end of an indentifier.
527d42ebb15e (idlwave-shell-print): Fixed bug with
Carsten Dominik <dominik@science.uva.nl>
parents: 27185
diff changeset
1706 (if (looking-at "\\>")
527d42ebb15e (idlwave-shell-print): Fixed bug with
Carsten Dominik <dominik@science.uva.nl>
parents: 27185
diff changeset
1707 (backward-sexp))
527d42ebb15e (idlwave-shell-print): Fixed bug with
Carsten Dominik <dominik@science.uva.nl>
parents: 27185
diff changeset
1708 (backward-sexp))
527d42ebb15e (idlwave-shell-print): Fixed bug with
Carsten Dominik <dominik@science.uva.nl>
parents: 27185
diff changeset
1709 (if (looking-at "\\>")
527d42ebb15e (idlwave-shell-print): Fixed bug with
Carsten Dominik <dominik@science.uva.nl>
parents: 27185
diff changeset
1710 ;; Move to beginning of identifier - must be an array or
527d42ebb15e (idlwave-shell-print): Fixed bug with
Carsten Dominik <dominik@science.uva.nl>
parents: 27185
diff changeset
1711 ;; function expression.
527d42ebb15e (idlwave-shell-print): Fixed bug with
Carsten Dominik <dominik@science.uva.nl>
parents: 27185
diff changeset
1712 (backward-sexp))
527d42ebb15e (idlwave-shell-print): Fixed bug with
Carsten Dominik <dominik@science.uva.nl>
parents: 27185
diff changeset
1713 ;; Move to end of expression
527d42ebb15e (idlwave-shell-print): Fixed bug with
Carsten Dominik <dominik@science.uva.nl>
parents: 27185
diff changeset
1714 (setq beg (point))
527d42ebb15e (idlwave-shell-print): Fixed bug with
Carsten Dominik <dominik@science.uva.nl>
parents: 27185
diff changeset
1715 (forward-sexp)
527d42ebb15e (idlwave-shell-print): Fixed bug with
Carsten Dominik <dominik@science.uva.nl>
parents: 27185
diff changeset
1716 (while (looking-at "\\>[[(]\\|\\.")
527d42ebb15e (idlwave-shell-print): Fixed bug with
Carsten Dominik <dominik@science.uva.nl>
parents: 27185
diff changeset
1717 ;; an array
527d42ebb15e (idlwave-shell-print): Fixed bug with
Carsten Dominik <dominik@science.uva.nl>
parents: 27185
diff changeset
1718 (forward-sexp))
527d42ebb15e (idlwave-shell-print): Fixed bug with
Carsten Dominik <dominik@science.uva.nl>
parents: 27185
diff changeset
1719 (setq end (point))
527d42ebb15e (idlwave-shell-print): Fixed bug with
Carsten Dominik <dominik@science.uva.nl>
parents: 27185
diff changeset
1720 (setq expr (buffer-substring beg end)))
527d42ebb15e (idlwave-shell-print): Fixed bug with
Carsten Dominik <dominik@science.uva.nl>
parents: 27185
diff changeset
1721 (when (and beg end idlwave-shell-expression-overlay)
527d42ebb15e (idlwave-shell-print): Fixed bug with
Carsten Dominik <dominik@science.uva.nl>
parents: 27185
diff changeset
1722 (move-overlay idlwave-shell-expression-overlay beg end
527d42ebb15e (idlwave-shell-print): Fixed bug with
Carsten Dominik <dominik@science.uva.nl>
parents: 27185
diff changeset
1723 (current-buffer))
27107
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1724 (add-hook 'pre-command-hook 'idlwave-shell-delete-expression-overlay))
27607
527d42ebb15e (idlwave-shell-print): Fixed bug with
Carsten Dominik <dominik@science.uva.nl>
parents: 27185
diff changeset
1725 (if (and (integerp idlwave-shell-calling-stack-index)
527d42ebb15e (idlwave-shell-print): Fixed bug with
Carsten Dominik <dominik@science.uva.nl>
parents: 27185
diff changeset
1726 (> idlwave-shell-calling-stack-index 0))
527d42ebb15e (idlwave-shell-print): Fixed bug with
Carsten Dominik <dominik@science.uva.nl>
parents: 27185
diff changeset
1727 (setq cmd (idlwave-retrieve-expression-from-level
527d42ebb15e (idlwave-shell-print): Fixed bug with
Carsten Dominik <dominik@science.uva.nl>
parents: 27185
diff changeset
1728 expr
527d42ebb15e (idlwave-shell-print): Fixed bug with
Carsten Dominik <dominik@science.uva.nl>
parents: 27185
diff changeset
1729 idlwave-shell-calling-stack-index
527d42ebb15e (idlwave-shell-print): Fixed bug with
Carsten Dominik <dominik@science.uva.nl>
parents: 27185
diff changeset
1730 idlwave-shell-calling-stack-routine
527d42ebb15e (idlwave-shell-print): Fixed bug with
Carsten Dominik <dominik@science.uva.nl>
parents: 27185
diff changeset
1731 help))
527d42ebb15e (idlwave-shell-print): Fixed bug with
Carsten Dominik <dominik@science.uva.nl>
parents: 27185
diff changeset
1732 (setq cmd (concat (if help "help," "print,") expr)))
527d42ebb15e (idlwave-shell-print): Fixed bug with
Carsten Dominik <dominik@science.uva.nl>
parents: 27185
diff changeset
1733 (if idlwave-shell-print-expression-function
27107
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1734 (idlwave-shell-send-command
27607
527d42ebb15e (idlwave-shell-print): Fixed bug with
Carsten Dominik <dominik@science.uva.nl>
parents: 27185
diff changeset
1735 cmd
527d42ebb15e (idlwave-shell-print): Fixed bug with
Carsten Dominik <dominik@science.uva.nl>
parents: 27185
diff changeset
1736 (list idlwave-shell-print-expression-function expr)
27107
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1737 'hide)
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1738 (idlwave-shell-recenter-shell-window)
27607
527d42ebb15e (idlwave-shell-print): Fixed bug with
Carsten Dominik <dominik@science.uva.nl>
parents: 27185
diff changeset
1739 (idlwave-shell-send-command cmd)))))
527d42ebb15e (idlwave-shell-print): Fixed bug with
Carsten Dominik <dominik@science.uva.nl>
parents: 27185
diff changeset
1740
527d42ebb15e (idlwave-shell-print): Fixed bug with
Carsten Dominik <dominik@science.uva.nl>
parents: 27185
diff changeset
1741 (defun idlwave-retrieve-expression-from-level (expr level routine help)
527d42ebb15e (idlwave-shell-print): Fixed bug with
Carsten Dominik <dominik@science.uva.nl>
parents: 27185
diff changeset
1742 "Return IDL command to print the expression EXPR from stack level LEVEL.
527d42ebb15e (idlwave-shell-print): Fixed bug with
Carsten Dominik <dominik@science.uva.nl>
parents: 27185
diff changeset
1743
527d42ebb15e (idlwave-shell-print): Fixed bug with
Carsten Dominik <dominik@science.uva.nl>
parents: 27185
diff changeset
1744 It does not seem possible to evaluate an expression on a differnt
527d42ebb15e (idlwave-shell-print): Fixed bug with
Carsten Dominik <dominik@science.uva.nl>
parents: 27185
diff changeset
1745 level than the current. Therefore, this function retrieves *copies* of
527d42ebb15e (idlwave-shell-print): Fixed bug with
Carsten Dominik <dominik@science.uva.nl>
parents: 27185
diff changeset
1746 the variables involved in the expression from the desired level in the
527d42ebb15e (idlwave-shell-print): Fixed bug with
Carsten Dominik <dominik@science.uva.nl>
parents: 27185
diff changeset
1747 calling stack. The copies are given some unlikely names on the
527d42ebb15e (idlwave-shell-print): Fixed bug with
Carsten Dominik <dominik@science.uva.nl>
parents: 27185
diff changeset
1748 *current* level, and the expression is then evaluated on the *current*
527d42ebb15e (idlwave-shell-print): Fixed bug with
Carsten Dominik <dominik@science.uva.nl>
parents: 27185
diff changeset
1749 level.
527d42ebb15e (idlwave-shell-print): Fixed bug with
Carsten Dominik <dominik@science.uva.nl>
parents: 27185
diff changeset
1750
527d42ebb15e (idlwave-shell-print): Fixed bug with
Carsten Dominik <dominik@science.uva.nl>
parents: 27185
diff changeset
1751 Since this function depends upon the undocumented IDL routine routine_names,
527d42ebb15e (idlwave-shell-print): Fixed bug with
Carsten Dominik <dominik@science.uva.nl>
parents: 27185
diff changeset
1752 there is no guarantie that this will work with future versions of IDL."
527d42ebb15e (idlwave-shell-print): Fixed bug with
Carsten Dominik <dominik@science.uva.nl>
parents: 27185
diff changeset
1753 (let ((prefix "___") ;; No real variables should starts with this.
527d42ebb15e (idlwave-shell-print): Fixed bug with
Carsten Dominik <dominik@science.uva.nl>
parents: 27185
diff changeset
1754 (fetch (- 0 level))
527d42ebb15e (idlwave-shell-print): Fixed bug with
Carsten Dominik <dominik@science.uva.nl>
parents: 27185
diff changeset
1755 (start 0)
527d42ebb15e (idlwave-shell-print): Fixed bug with
Carsten Dominik <dominik@science.uva.nl>
parents: 27185
diff changeset
1756 var tvar fetch-vars pre post)
527d42ebb15e (idlwave-shell-print): Fixed bug with
Carsten Dominik <dominik@science.uva.nl>
parents: 27185
diff changeset
1757
527d42ebb15e (idlwave-shell-print): Fixed bug with
Carsten Dominik <dominik@science.uva.nl>
parents: 27185
diff changeset
1758 ;; FIXME: In the following we try to find the variables in expression
527d42ebb15e (idlwave-shell-print): Fixed bug with
Carsten Dominik <dominik@science.uva.nl>
parents: 27185
diff changeset
1759 ;; This is quite empirical - I don't know in what situations this will
527d42ebb15e (idlwave-shell-print): Fixed bug with
Carsten Dominik <dominik@science.uva.nl>
parents: 27185
diff changeset
1760 ;; break. We will look for identifiers and exclude cases where we
527d42ebb15e (idlwave-shell-print): Fixed bug with
Carsten Dominik <dominik@science.uva.nl>
parents: 27185
diff changeset
1761 ;; know it is not a variable. To distinguish array references from
527d42ebb15e (idlwave-shell-print): Fixed bug with
Carsten Dominik <dominik@science.uva.nl>
parents: 27185
diff changeset
1762 ;; function calls, we require that arrays use [] instead of ()
527d42ebb15e (idlwave-shell-print): Fixed bug with
Carsten Dominik <dominik@science.uva.nl>
parents: 27185
diff changeset
1763
527d42ebb15e (idlwave-shell-print): Fixed bug with
Carsten Dominik <dominik@science.uva.nl>
parents: 27185
diff changeset
1764 (while (string-match
527d42ebb15e (idlwave-shell-print): Fixed bug with
Carsten Dominik <dominik@science.uva.nl>
parents: 27185
diff changeset
1765 "\\(\\`\\|[^a-zA-Z0-9$_]\\)\\([a-zA-Z][a-zA-Z0-9$_]*\\)\\([^a-zA-Z0-9$_]\\|\\'\\)" expr start)
527d42ebb15e (idlwave-shell-print): Fixed bug with
Carsten Dominik <dominik@science.uva.nl>
parents: 27185
diff changeset
1766 (setq var (match-string 2 expr)
527d42ebb15e (idlwave-shell-print): Fixed bug with
Carsten Dominik <dominik@science.uva.nl>
parents: 27185
diff changeset
1767 tvar (concat prefix var)
527d42ebb15e (idlwave-shell-print): Fixed bug with
Carsten Dominik <dominik@science.uva.nl>
parents: 27185
diff changeset
1768 start (match-beginning 2)
527d42ebb15e (idlwave-shell-print): Fixed bug with
Carsten Dominik <dominik@science.uva.nl>
parents: 27185
diff changeset
1769 pre (substring expr 0 (match-beginning 2))
527d42ebb15e (idlwave-shell-print): Fixed bug with
Carsten Dominik <dominik@science.uva.nl>
parents: 27185
diff changeset
1770 post (substring expr (match-end 2)))
527d42ebb15e (idlwave-shell-print): Fixed bug with
Carsten Dominik <dominik@science.uva.nl>
parents: 27185
diff changeset
1771 (cond
527d42ebb15e (idlwave-shell-print): Fixed bug with
Carsten Dominik <dominik@science.uva.nl>
parents: 27185
diff changeset
1772 ;; Exclude identifiers which are not variables
527d42ebb15e (idlwave-shell-print): Fixed bug with
Carsten Dominik <dominik@science.uva.nl>
parents: 27185
diff changeset
1773 ((string-match ",[ \t]*/\\'" pre)) ;; a `/' KEYWORD
527d42ebb15e (idlwave-shell-print): Fixed bug with
Carsten Dominik <dominik@science.uva.nl>
parents: 27185
diff changeset
1774 ((and (string-match "[,(][ \t]*\\'" pre)
527d42ebb15e (idlwave-shell-print): Fixed bug with
Carsten Dominik <dominik@science.uva.nl>
parents: 27185
diff changeset
1775 (string-match "\\`[ \t]*=" post))) ;; a `=' KEYWORD
527d42ebb15e (idlwave-shell-print): Fixed bug with
Carsten Dominik <dominik@science.uva.nl>
parents: 27185
diff changeset
1776 ((string-match "\\`(" post)) ;; a function
527d42ebb15e (idlwave-shell-print): Fixed bug with
Carsten Dominik <dominik@science.uva.nl>
parents: 27185
diff changeset
1777 ((string-match "->[ \t]*\\'" pre)) ;; a method
527d42ebb15e (idlwave-shell-print): Fixed bug with
Carsten Dominik <dominik@science.uva.nl>
parents: 27185
diff changeset
1778 ((string-match "\\.\\'" pre)) ;; structure member
527d42ebb15e (idlwave-shell-print): Fixed bug with
Carsten Dominik <dominik@science.uva.nl>
parents: 27185
diff changeset
1779 (t ;; seems to be a variable - arrange to get it and replace
527d42ebb15e (idlwave-shell-print): Fixed bug with
Carsten Dominik <dominik@science.uva.nl>
parents: 27185
diff changeset
1780 ;; its name in the expression with the temproary name.
527d42ebb15e (idlwave-shell-print): Fixed bug with
Carsten Dominik <dominik@science.uva.nl>
parents: 27185
diff changeset
1781 (push (cons var tvar) fetch-vars)
527d42ebb15e (idlwave-shell-print): Fixed bug with
Carsten Dominik <dominik@science.uva.nl>
parents: 27185
diff changeset
1782 (setq expr (concat pre tvar post)))))
527d42ebb15e (idlwave-shell-print): Fixed bug with
Carsten Dominik <dominik@science.uva.nl>
parents: 27185
diff changeset
1783 ;; Make a command line that first copies the relevant variables
527d42ebb15e (idlwave-shell-print): Fixed bug with
Carsten Dominik <dominik@science.uva.nl>
parents: 27185
diff changeset
1784 ;; and then prints the expression.
527d42ebb15e (idlwave-shell-print): Fixed bug with
Carsten Dominik <dominik@science.uva.nl>
parents: 27185
diff changeset
1785 (concat
527d42ebb15e (idlwave-shell-print): Fixed bug with
Carsten Dominik <dominik@science.uva.nl>
parents: 27185
diff changeset
1786 (mapconcat
527d42ebb15e (idlwave-shell-print): Fixed bug with
Carsten Dominik <dominik@science.uva.nl>
parents: 27185
diff changeset
1787 (lambda (x)
527d42ebb15e (idlwave-shell-print): Fixed bug with
Carsten Dominik <dominik@science.uva.nl>
parents: 27185
diff changeset
1788 (format "%s = routine_names('%s',fetch=%d)" (cdr x) (car x) fetch))
527d42ebb15e (idlwave-shell-print): Fixed bug with
Carsten Dominik <dominik@science.uva.nl>
parents: 27185
diff changeset
1789 (nreverse fetch-vars)
527d42ebb15e (idlwave-shell-print): Fixed bug with
Carsten Dominik <dominik@science.uva.nl>
parents: 27185
diff changeset
1790 " & ")
527d42ebb15e (idlwave-shell-print): Fixed bug with
Carsten Dominik <dominik@science.uva.nl>
parents: 27185
diff changeset
1791 (if idlwave-shell-print-expression-function " & " "\n")
527d42ebb15e (idlwave-shell-print): Fixed bug with
Carsten Dominik <dominik@science.uva.nl>
parents: 27185
diff changeset
1792 (if help "help, " "print, ")
527d42ebb15e (idlwave-shell-print): Fixed bug with
Carsten Dominik <dominik@science.uva.nl>
parents: 27185
diff changeset
1793 expr
527d42ebb15e (idlwave-shell-print): Fixed bug with
Carsten Dominik <dominik@science.uva.nl>
parents: 27185
diff changeset
1794 (format " ; [-%d:%s]" level routine))))
27107
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1795
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1796 (defun idlwave-shell-delete-expression-overlay ()
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1797 (condition-case nil
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1798 (if idlwave-shell-expression-overlay
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1799 (delete-overlay idlwave-shell-expression-overlay))
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1800 (error nil))
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1801 (remove-hook 'pre-command-hook 'idlwave-shell-delete-expression-overlay))
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1802
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1803 (defvar idlwave-shell-bp-alist nil
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1804 "Alist of breakpoints.
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1805 A breakpoint is a cons cell \(\(file line\) . \(\(index module\) data\)\)
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1806
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1807 The car is the frame for the breakpoint:
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1808 file - full path file name.
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1809 line - line number of breakpoint - integer.
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1810
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1811 The first element of the cdr is a list of internal IDL data:
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1812 index - the index number of the breakpoint internal to IDL.
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1813 module - the module for breakpoint internal to IDL.
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1814
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1815 Remaining elements of the cdr:
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1816 data - Data associated with the breakpoint by idlwave-shell currently
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1817 contains two items:
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1818
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1819 count - number of times to execute breakpoint. When count reaches 0
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1820 the breakpoint is cleared and removed from the alist.
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1821 command - command to execute when breakpoint is reached, either a
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1822 lisp function to be called with `funcall' with no arguments or a
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1823 list to be evaluated with `eval'.")
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1824
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1825 (defun idlwave-shell-run-region (beg end &optional n)
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1826 "Compile and run the region using the IDL process.
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1827 Copies the region to a temporary file `idlwave-shell-temp-pro-file'
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1828 and issues the IDL .run command for the file. Because the
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1829 region is compiled and run as a main program there is no
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1830 problem with begin-end blocks extending over multiple
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1831 lines - which would be a problem if `idlwave-shell-evaluate-region'
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1832 was used. An END statement is appended to the region if necessary.
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1833
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1834 If there is a prefix argument, display IDL process."
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1835 (interactive "r\nP")
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1836 (let ((oldbuf (current-buffer)))
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1837 (save-excursion
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1838 (set-buffer (idlwave-find-file-noselect
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1839 idlwave-shell-temp-pro-file))
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1840 (erase-buffer)
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1841 (insert-buffer-substring oldbuf beg end)
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1842 (if (not (save-excursion
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1843 (idlwave-previous-statement)
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1844 (idlwave-look-at "\\<end\\>")))
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1845 (insert "\nend\n"))
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1846 (save-buffer 0)))
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1847 (idlwave-shell-send-command (concat ".run " idlwave-shell-temp-pro-file))
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1848 (if n
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1849 (idlwave-display-buffer (idlwave-shell-buffer)
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1850 nil (idlwave-shell-shell-frame))))
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1851
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1852 (defun idlwave-shell-evaluate-region (beg end &optional n)
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1853 "Send region to the IDL process.
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1854 If there is a prefix argument, display IDL process.
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1855 Does not work for a region with multiline blocks - use
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1856 `idlwave-shell-run-region' for this."
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1857 (interactive "r\nP")
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1858 (idlwave-shell-send-command (buffer-substring beg end))
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1859 (if n
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1860 (idlwave-display-buffer (idlwave-shell-buffer)
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1861 nil (idlwave-shell-shell-frame))))
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1862
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1863 (defun idlwave-display-buffer (buf not-this-window-p &optional frame)
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1864 (if (or (< emacs-major-version 20)
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1865 (and (= emacs-major-version 20)
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1866 (< emacs-minor-version 3)))
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1867 ;; Only two args.
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1868 (display-buffer buf not-this-window-p)
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1869 ;; Three ares possible.
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1870 (display-buffer buf not-this-window-p frame)))
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1871
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1872 (defvar idlwave-shell-bp-buffer "*idlwave-shell-bp*"
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1873 "Scratch buffer for parsing IDL breakpoint lists and other stuff.")
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1874
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1875 (defun idlwave-shell-bp-query ()
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1876 "Reconcile idlwave-shell's breakpoint list with IDL's.
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1877 Queries IDL using the string in `idlwave-shell-bp-query'."
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1878 (interactive)
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1879 (idlwave-shell-send-command idlwave-shell-bp-query
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1880 'idlwave-shell-filter-bp
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1881 'hide))
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1882
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1883 (defun idlwave-shell-bp-get (bp &optional item)
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1884 "Get a value for a breakpoint.
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1885 BP has the form of elements in idlwave-shell-bp-alist.
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1886 Optional second arg ITEM is the particular value to retrieve.
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1887 ITEM can be 'file, 'line, 'index, 'module, 'count, 'cmd, or 'data.
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1888 'data returns a list of 'count and 'cmd.
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1889 Defaults to 'index."
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1890 (cond
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1891 ;; Frame
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1892 ((eq item 'line) (nth 1 (car bp)))
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1893 ((eq item 'file) (nth 0 (car bp)))
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1894 ;; idlwave-shell breakpoint data
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1895 ((eq item 'data) (cdr (cdr bp)))
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1896 ((eq item 'count) (nth 0 (cdr (cdr bp))))
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1897 ((eq item 'cmd) (nth 1 (cdr (cdr bp))))
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1898 ;; IDL breakpoint info
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1899 ((eq item 'module) (nth 1 (car (cdr bp))))
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1900 ;; index - default
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1901 (t (nth 0 (car (cdr bp))))))
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1902
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1903 (defun idlwave-shell-filter-bp ()
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1904 "Get the breakpoints from `idlwave-shell-command-output'.
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1905 Create `idlwave-shell-bp-alist' updating breakpoint count and command data
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1906 from previous breakpoint list."
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1907 (save-excursion
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1908 (set-buffer (get-buffer-create idlwave-shell-bp-buffer))
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1909 (erase-buffer)
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1910 (insert idlwave-shell-command-output)
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1911 (goto-char (point-min))
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1912 (let ((old-bp-alist idlwave-shell-bp-alist))
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1913 (setq idlwave-shell-bp-alist (list nil))
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1914 (if (re-search-forward "^\\s-*Index.*\n\\s-*-" nil t)
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1915 (while (and
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1916 (not (progn (forward-line) (eobp)))
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1917 ;; Parse breakpoint line.
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1918 ;; Breakpoints have the form:
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1919 ;; Index Module Line File
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1920 ;; All seperated by whitespace.
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1921 ;;
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1922 ;; Add the breakpoint info to the list
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1923 (re-search-forward
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1924 "\\s-*\\(\\S-+\\)\\s-+\\(\\S-+\\)\\s-+\\(\\S-+\\)\\s-+\\(\\S-+\\)" nil t))
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1925 (nconc idlwave-shell-bp-alist
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1926 (list
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1927 (cons
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1928 (list
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1929 (save-match-data
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1930 (idlwave-shell-file-name
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1931 (buffer-substring ; file
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1932 (match-beginning 4) (match-end 4))))
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1933 (string-to-int ; line
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1934 (buffer-substring
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1935 (match-beginning 3) (match-end 3))))
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1936 (list
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1937 (list
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1938 (buffer-substring ; index
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1939 (match-beginning 1) (match-end 1))
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1940 (buffer-substring ; module
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1941 (match-beginning 2) (match-end 2)))
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1942 ;; idlwave-shell data: count, command
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1943 nil nil))))))
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1944 (setq idlwave-shell-bp-alist (cdr idlwave-shell-bp-alist))
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1945 ;; Update count, commands of breakpoints
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1946 (mapcar 'idlwave-shell-update-bp old-bp-alist)))
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1947 ;; Update the breakpoint overlays
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1948 (idlwave-shell-update-bp-overlays)
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1949 ;; Return the new list
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1950 idlwave-shell-bp-alist)
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1951
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1952 (defun idlwave-shell-update-bp (bp)
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1953 "Update BP data in breakpoint list.
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1954 If BP frame is in `idlwave-shell-bp-alist' updates the breakpoint data."
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1955 (let ((match (assoc (car bp) idlwave-shell-bp-alist)))
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1956 (if match (setcdr (cdr match) (cdr (cdr bp))))))
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1957
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1958 (defun idlwave-shell-set-bp-data (bp data)
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1959 "Set the data of BP to DATA."
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1960 (setcdr (cdr bp) data))
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1961
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1962 (defun idlwave-shell-bp (frame &optional data module)
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1963 "Create a breakpoint structure containing FRAME and DATA. Second
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1964 and third args, DATA and MODULE, are optional. Returns a breakpoint
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1965 of the format used in `idlwave-shell-bp-alist'. Can be used in commands
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1966 attempting match a breakpoint in `idlwave-shell-bp-alist'."
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1967 (cons frame (cons (list nil module) data)))
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1968
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1969 (defvar idlwave-shell-old-bp nil
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1970 "List of breakpoints previous to setting a new breakpoint.")
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1971
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1972 (defun idlwave-shell-sources-bp (bp)
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1973 "Check `idlwave-shell-sources-alist' for source of breakpoint using BP.
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1974 If an equivalency is found, return the IDL internal source name.
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1975 Otherwise return the filename in bp."
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1976 (let*
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1977 ((bp-file (idlwave-shell-bp-get bp 'file))
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1978 (bp-module (idlwave-shell-bp-get bp 'module))
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1979 (internal-file-list (cdr (assoc bp-module idlwave-shell-sources-alist))))
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1980 (if (and internal-file-list
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1981 (equal bp-file (nth 0 internal-file-list)))
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1982 (nth 1 internal-file-list)
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1983 bp-file)))
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1984
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1985 (defun idlwave-shell-set-bp (bp)
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1986 "Try to set a breakpoint BP.
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1987
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1988 The breakpoint will be placed at the beginning of the statement on the
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1989 line specified by BP or at the next IDL statement if that line is not
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1990 a statement.
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1991 Determines IDL's internal representation for the breakpoint which may
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1992 have occured at a different line then used with the breakpoint
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1993 command."
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1994
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1995 ;; Get and save the old breakpoints
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1996 (idlwave-shell-send-command
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1997 idlwave-shell-bp-query
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1998 '(progn
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
1999 (idlwave-shell-filter-bp)
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2000 (setq idlwave-shell-old-bp idlwave-shell-bp-alist))
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2001 'hide)
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2002 ;; Get sources for IDL compiled procedures followed by setting
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2003 ;; breakpoint.
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2004 (idlwave-shell-send-command
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2005 idlwave-shell-sources-query
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2006 (` (progn
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2007 (idlwave-shell-sources-filter)
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2008 (idlwave-shell-set-bp2 (quote (, bp)))))
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2009 'hide))
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2010
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2011 (defun idlwave-shell-set-bp2 (bp)
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2012 "Use results of breakpoint and sources query to set bp.
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2013 Use the count argument with IDLs breakpoint command.
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2014 We treat a count of 1 as a temporary breakpoint.
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2015 Counts greater than 1 use the IDL AFTER=count keyword to break
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2016 only after reaching the statement count times."
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2017 (let*
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2018 ((arg (idlwave-shell-bp-get bp 'count))
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2019 (key (cond
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2020 ((not (and arg (numberp arg))) "")
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2021 ((= arg 1)
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2022 ",/once")
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2023 ((> arg 1)
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2024 (format ",after=%d" arg))))
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2025 (line (idlwave-shell-bp-get bp 'line)))
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2026 (idlwave-shell-send-command
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2027 (concat "breakpoint,'"
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2028 (idlwave-shell-sources-bp bp) "',"
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2029 (if (integerp line) (setq line (int-to-string line)))
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2030 key)
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2031 ;; Check for failure and look for breakpoint in IDL's list
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2032 (` (progn
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2033 (if (idlwave-shell-set-bp-check (quote (, bp)))
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2034 (idlwave-shell-set-bp3 (quote (, bp)))))
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2035 )
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2036 ;; do not hide output
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2037 nil
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2038 'preempt)))
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2039
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2040 (defun idlwave-shell-set-bp3 (bp)
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2041 "Find the breakpoint in IDL's internal list of breakpoints."
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2042 (idlwave-shell-send-command idlwave-shell-bp-query
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2043 (` (progn
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2044 (idlwave-shell-filter-bp)
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2045 (idlwave-shell-new-bp (quote (, bp)))))
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2046 'hide
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2047 'preempt))
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2048
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2049 (defun idlwave-shell-find-bp (frame)
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2050 "Return breakpoint from `idlwave-shell-bp-alist' for frame.
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2051 Returns nil if frame not found."
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2052 (assoc frame idlwave-shell-bp-alist))
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2053
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2054 (defun idlwave-shell-new-bp (bp)
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2055 "Find the new breakpoint in IDL's list and update with DATA.
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2056 The actual line number for a breakpoint in IDL may be different than
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2057 the line number used with the IDL breakpoint command.
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2058 Looks for a new breakpoint index number in the list. This is
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2059 considered the new breakpoint if the file name of frame matches."
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2060 (let ((obp-index (mapcar 'idlwave-shell-bp-get idlwave-shell-old-bp))
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2061 (bpl idlwave-shell-bp-alist))
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2062 (while (and (member (idlwave-shell-bp-get (car bpl)) obp-index)
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2063 (setq bpl (cdr bpl))))
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2064 (if (and
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2065 (not bpl)
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2066 ;; No additional breakpoint.
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2067 ;; Need to check if we are just replacing a breakpoint.
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2068 (setq bpl (assoc (car bp) idlwave-shell-bp-alist)))
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2069 (setq bpl (list bpl)))
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2070 (if (and bpl
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2071 (equal (idlwave-shell-bp-get (setq bpl (car bpl)) 'file)
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2072 (idlwave-shell-bp-get bp 'file)))
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2073 ;; Got the breakpoint - add count, command to it.
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2074 ;; This updates `idlwave-shell-bp-alist' because a deep copy was
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2075 ;; not done for bpl.
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2076 (idlwave-shell-set-bp-data bpl (idlwave-shell-bp-get bp 'data))
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2077 (beep)
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2078 (message "Failed to identify breakpoint in IDL"))))
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2079
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2080 (defvar idlwave-shell-bp-overlays nil
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2081 "List of overlays marking breakpoints")
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2082
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2083 (defun idlwave-shell-update-bp-overlays ()
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2084 "Update the overlays which mark breakpoints in the source code.
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2085 Existing overlays are recycled, in order to minimize consumption."
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2086 ;; FIXME: we could cache them all, but that would be more work.
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2087 (when idlwave-shell-mark-breakpoints
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2088 (let ((bp-list idlwave-shell-bp-alist)
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2089 (ov-list idlwave-shell-bp-overlays)
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2090 ov bp)
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2091 ;; Delete the old overlays from their buffers
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2092 (while (setq ov (pop ov-list))
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2093 (delete-overlay ov))
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2094 (setq ov-list idlwave-shell-bp-overlays
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2095 idlwave-shell-bp-overlays nil)
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2096 (while (setq bp (pop bp-list))
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2097 (save-excursion
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2098 (idlwave-shell-goto-frame (car bp))
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2099 (let* ((end (progn (end-of-line 1) (point)))
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2100 (beg (progn (beginning-of-line 1) (point)))
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2101 (ov (or (pop ov-list)
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2102 (idlwave-shell-make-new-bp-overlay))))
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2103 (move-overlay ov beg end)
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2104 (push ov idlwave-shell-bp-overlays)))))))
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2105
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2106 (defvar idlwave-shell-bp-glyph)
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2107 (defun idlwave-shell-make-new-bp-overlay ()
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2108 "Make a new overlay for highlighting breakpoints.
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2109 This stuff is stringly dependant upon the version of Emacs."
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2110 (let ((ov (make-overlay 1 1)))
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2111 (if (featurep 'xemacs)
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2112 ;; This is XEmacs
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2113 (progn
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2114 (cond
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2115 ((eq (console-type) 'tty)
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2116 ;; tty's cannot display glyphs
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2117 (set-extent-property ov 'face 'idlwave-shell-bp-face))
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2118 ((and (memq idlwave-shell-mark-breakpoints '(t glyph))
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2119 idlwave-shell-bp-glyph)
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2120 ;; use the glyph
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2121 (set-extent-property ov 'begin-glyph idlwave-shell-bp-glyph))
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2122 (idlwave-shell-mark-breakpoints
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2123 ;; use the face
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2124 (set-extent-property ov 'face 'idlwave-shell-bp-face))
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2125 (t
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2126 ;; no marking
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2127 nil))
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2128 (set-extent-priority ov -1)) ; make stop line face prevail
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2129 ;; This is Emacs
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2130 (cond
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2131 (window-system
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2132 (if (and (memq idlwave-shell-mark-breakpoints '(t glyph))
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2133 idlwave-shell-bp-glyph) ; this var knows if glyph's possible
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2134 ;; use a glyph
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2135 (let ((string "@"))
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2136 (put-text-property 0 1
27607
527d42ebb15e (idlwave-shell-print): Fixed bug with
Carsten Dominik <dominik@science.uva.nl>
parents: 27185
diff changeset
2137 'display idlwave-shell-bp-glyph
27107
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2138 string)
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2139 (overlay-put ov 'before-string string))
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2140 (overlay-put ov 'face 'idlwave-shell-bp-face)))
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2141 (idlwave-shell-mark-breakpoints
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2142 ;; use a face
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2143 (overlay-put ov 'face 'idlwave-shell-bp-face))
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2144 (t
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2145 ;; No marking
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2146 nil)))
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2147 ov))
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2148
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2149 (defun idlwave-shell-edit-default-command-line (arg)
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2150 "Edit the current execute command."
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2151 (interactive "P")
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2152 (setq idlwave-shell-command-line-to-execute
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2153 (read-string "IDL> " idlwave-shell-command-line-to-execute)))
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2154
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2155 (defun idlwave-shell-execute-default-command-line (arg)
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2156 "Execute a command line. On first use, ask for the command.
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2157 Also with prefix arg, ask for the command. You can also uase the command
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2158 `idlwave-shell-edit-default-command-line' to edit the line."
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2159 (interactive "P")
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2160 (if (or (not idlwave-shell-command-line-to-execute)
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2161 arg)
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2162 (setq idlwave-shell-command-line-to-execute
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2163 (read-string "IDL> " idlwave-shell-command-line-to-execute)))
27607
527d42ebb15e (idlwave-shell-print): Fixed bug with
Carsten Dominik <dominik@science.uva.nl>
parents: 27185
diff changeset
2164 (idlwave-shell-reset 'hidden)
27107
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2165 (idlwave-shell-send-command idlwave-shell-command-line-to-execute
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2166 '(idlwave-shell-redisplay 'hide)))
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2167
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2168 (defun idlwave-shell-save-and-run ()
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2169 "Save file and run it in IDL.
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2170 Runs `save-buffer' and sends a '.RUN' command for the associated file to IDL.
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2171 When called from the shell buffer, re-run the file which was last handled by
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2172 one of the save-and-.. commands."
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2173 (interactive)
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2174 (idlwave-shell-save-and-action 'run))
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2175
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2176 (defun idlwave-shell-save-and-compile ()
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2177 "Save file and run it in IDL.
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2178 Runs `save-buffer' and sends '.COMPILE' command for the associated file to IDL.
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2179 When called from the shell buffer, re-compile the file which was last handled by
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2180 one of the save-and-.. commands."
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2181 (interactive)
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2182 (idlwave-shell-save-and-action 'compile))
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2183
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2184 (defun idlwave-shell-save-and-batch ()
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2185 "Save file and batch it in IDL.
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2186 Runs `save-buffer' and sends a '@file' command for the associated file to IDL.
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2187 When called from the shell buffer, re-batch the file which was last handled by
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2188 one of the save-and-.. commands."
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2189 (interactive)
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2190 (idlwave-shell-save-and-action 'batch))
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2191
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2192 (defun idlwave-shell-save-and-action (action)
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2193 "Save file and compile it in IDL.
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2194 Runs `save-buffer' and sends a '.RUN' command for the associated file to IDL.
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2195 When called from the shell buffer, re-compile the file which was last
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2196 handled by this command."
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2197 ;; Remove the stop overlay.
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2198 (if idlwave-shell-stop-line-overlay
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2199 (delete-overlay idlwave-shell-stop-line-overlay))
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2200 (setq overlay-arrow-string nil)
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2201 (let (buf)
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2202 (cond
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2203 ((eq major-mode 'idlwave-mode)
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2204 (save-buffer)
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2205 (setq idlwave-shell-last-save-and-action-file (buffer-file-name)))
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2206 (idlwave-shell-last-save-and-action-file
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2207 (if (setq buf (idlwave-get-buffer-visiting
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2208 idlwave-shell-last-save-and-action-file))
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2209 (save-excursion
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2210 (set-buffer buf)
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2211 (save-buffer))))
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2212 (t (setq idlwave-shell-last-save-and-action-file
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2213 (read-file-name "File: ")))))
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2214 (if (file-regular-p idlwave-shell-last-save-and-action-file)
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2215 (progn
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2216 (idlwave-shell-send-command
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2217 (concat (cond ((eq action 'run) ".run ")
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2218 ((eq action 'compile) ".compile ")
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2219 ((eq action 'batch) "@")
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2220 (t (error "Unknown action %s" action)))
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2221 idlwave-shell-last-save-and-action-file)
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2222 nil nil)
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2223 (idlwave-shell-bp-query))
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2224 (let ((msg (format "No such file %s"
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2225 idlwave-shell-last-save-and-action-file)))
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2226 (setq idlwave-shell-last-save-and-action-file nil)
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2227 (error msg))))
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2228
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2229 (defvar idlwave-shell-sources-query "help,/source"
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2230 "IDL command to obtain source files for compiled procedures.")
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2231
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2232 (defvar idlwave-shell-sources-alist nil
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2233 "Alist of IDL procedure names and compiled source files.
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2234 Elements of the alist have the form:
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2235
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2236 (module name . (source-file-truename idlwave-internal-filename)).")
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2237
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2238 (defun idlwave-shell-sources-query ()
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2239 "Determine source files for IDL compiled procedures.
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2240 Queries IDL using the string in `idlwave-shell-sources-query'."
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2241 (interactive)
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2242 (idlwave-shell-send-command idlwave-shell-sources-query
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2243 'idlwave-shell-sources-filter
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2244 'hide))
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2245
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2246 (defun idlwave-shell-sources-filter ()
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2247 "Get source files from `idlwave-shell-sources-query' output.
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2248 Create `idlwave-shell-sources-alist' consisting of
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2249 list elements of the form:
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2250 (module name . (source-file-truename idlwave-internal-filename))."
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2251 (save-excursion
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2252 (set-buffer (get-buffer-create idlwave-shell-bp-buffer))
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2253 (erase-buffer)
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2254 (insert idlwave-shell-command-output)
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2255 (goto-char (point-min))
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2256 (let (cpro cfun)
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2257 (if (re-search-forward "Compiled Procedures:" nil t)
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2258 (progn
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2259 (forward-line) ; Skip $MAIN$
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2260 (setq cpro (point))))
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2261 (if (re-search-forward "Compiled Functions:" nil t)
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2262 (progn
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2263 (setq cfun (point))
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2264 (setq idlwave-shell-sources-alist
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2265 (append
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2266 ;; compiled procedures
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2267 (progn
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2268 (beginning-of-line)
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2269 (narrow-to-region cpro (point))
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2270 (goto-char (point-min))
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2271 (idlwave-shell-sources-grep))
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2272 ;; compiled functions
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2273 (progn
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2274 (widen)
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2275 (goto-char cfun)
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2276 (idlwave-shell-sources-grep)))))))))
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2277
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2278 (defun idlwave-shell-sources-grep ()
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2279 (save-excursion
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2280 (let ((al (list nil)))
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2281 (while (and
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2282 (not (progn (forward-line) (eobp)))
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2283 (re-search-forward
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2284 "\\s-*\\(\\S-+\\)\\s-+\\(\\S-+\\)" nil t))
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2285 (nconc al
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2286 (list
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2287 (cons
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2288 (buffer-substring ; name
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2289 (match-beginning 1) (match-end 1))
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2290 (let ((internal-filename
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2291 (buffer-substring ; source
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2292 (match-beginning 2) (match-end 2))))
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2293 (list
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2294 (idlwave-shell-file-name internal-filename)
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2295 internal-filename))
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2296 ))))
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2297 (cdr al))))
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2298
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2299
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2300 (defun idlwave-shell-clear-all-bp ()
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2301 "Remove all breakpoints in IDL."
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2302 (interactive)
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2303 (idlwave-shell-send-command
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2304 idlwave-shell-bp-query
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2305 '(progn
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2306 (idlwave-shell-filter-bp)
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2307 (mapcar 'idlwave-shell-clear-bp idlwave-shell-bp-alist))
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2308 'hide))
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2309
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2310 (defun idlwave-shell-list-all-bp ()
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2311 "List all breakpoints in IDL."
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2312 (interactive)
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2313 (idlwave-shell-send-command
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2314 idlwave-shell-bp-query))
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2315
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2316 (defvar idlwave-shell-error-last 0
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2317 "Position of last syntax error in `idlwave-shell-error-buffer'.")
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2318
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2319 (defun idlwave-shell-goto-next-error ()
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2320 "Move point to next IDL syntax error."
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2321 (interactive)
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2322 (let (frame col)
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2323 (save-excursion
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2324 (set-buffer idlwave-shell-error-buffer)
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2325 (goto-char idlwave-shell-error-last)
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2326 (if (or (re-search-forward idlwave-shell-syntax-error nil t)
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2327 (re-search-forward idlwave-shell-other-error nil t))
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2328 (progn
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2329 (setq frame
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2330 (list
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2331 (save-match-data
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2332 (idlwave-shell-file-name
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2333 (buffer-substring (match-beginning 1) (match-end 1))))
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2334 (string-to-int
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2335 (buffer-substring (match-beginning 2)
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2336 (match-end 2)))))
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2337 ;; Try to find the column of the error
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2338 (save-excursion
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2339 (setq col
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2340 (if (re-search-backward "\\^" nil t)
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2341 (current-column)
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2342 0)))))
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2343 (setq idlwave-shell-error-last (point)))
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2344 (if frame
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2345 (progn
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2346 (idlwave-shell-display-line frame col))
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2347 (beep)
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2348 (message "No more errors."))))
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2349
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2350 (defun idlwave-shell-file-name (name)
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2351 "If idlwave-shell-use-truename is non-nil, convert file name to true name.
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2352 Otherwise, just expand the file name."
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2353 (let ((def-dir (if (eq major-mode 'idlwave-shell-mode)
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2354 default-directory
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2355 idlwave-shell-default-directory)))
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2356 (if idlwave-shell-use-truename
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2357 (file-truename name def-dir)
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2358 (expand-file-name name def-dir))))
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2359
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2360
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2361 ;; Keybindings --------------------------------------------------------------
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2362
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2363 (defvar idlwave-shell-mode-map (copy-keymap comint-mode-map)
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2364 "Keymap for idlwave-mode.")
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2365 (defvar idlwave-shell-mode-prefix-map (make-sparse-keymap))
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2366 (fset 'idlwave-shell-mode-prefix-map idlwave-shell-mode-prefix-map)
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2367
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2368 ;(define-key idlwave-shell-mode-map "\M-?" 'comint-dynamic-list-completions)
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2369 ;(define-key idlwave-shell-mode-map "\t" 'comint-dynamic-complete)
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2370 (define-key idlwave-shell-mode-map "\t" 'idlwave-shell-complete)
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2371 (define-key idlwave-shell-mode-map "\M-\t" 'idlwave-shell-complete)
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2372 (define-key idlwave-shell-mode-map "\C-c\C-s" 'idlwave-shell)
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2373 (define-key idlwave-shell-mode-map "\C-c?" 'idlwave-routine-info)
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2374 (define-key idlwave-shell-mode-map "\C-c\C-i" 'idlwave-update-routine-info)
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2375 (define-key idlwave-shell-mode-map "\C-c=" 'idlwave-resolve)
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2376 (define-key idlwave-shell-mode-map "\C-c\C-v" 'idlwave-find-module)
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2377 (define-key idlwave-shell-mode-map idlwave-shell-prefix-key
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2378 'idlwave-shell-debug-map)
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2379
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2380 ;; The following set of bindings is used to bind the debugging keys.
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2381 ;; If `idlwave-shell-activate-prefix-keybindings' is non-nil, the first key
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2382 ;; in the list gets bound the C-c C-d prefix map.
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2383 ;; If `idlwave-shell-activate-alt-keybindings' is non-nil, the second key
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2384 ;; in the list gets bound directly in both idlwave-mode-map and
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2385 ;; idlwave-shell-mode-map.
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2386
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2387 ;; Used keys: abcde hi klmnopqrs u wxyz
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2388 ;; Unused keys: fg j t v
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2389 (let ((specs
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2390 '(([(control ?b)] [(alt ?b)] idlwave-shell-break-here)
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2391 ([(control ?i)] [(alt ?i)] idlwave-shell-break-in)
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2392 ([(control ?d)] [(alt ?d)] idlwave-shell-clear-current-bp)
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2393 ([(control ?a)] [(alt ?a)] idlwave-shell-clear-all-bp)
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2394 ([(control ?s)] [(alt ?s)] idlwave-shell-step)
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2395 ([(control ?n)] [(alt ?n)] idlwave-shell-stepover)
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2396 ([(control ?k)] [(alt ?k)] idlwave-shell-skip)
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2397 ([(control ?u)] [(alt ?u)] idlwave-shell-up)
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2398 ([(control ?o)] [(alt ?o)] idlwave-shell-out)
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2399 ([(control ?m)] [(alt ?m)] idlwave-shell-return)
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2400 ([(control ?h)] [(alt ?h)] idlwave-shell-to-here)
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2401 ([(control ?r)] [(alt ?r)] idlwave-shell-cont)
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2402 ([(control ?y)] [(alt ?y)] idlwave-shell-execute-default-command-line)
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2403 ([(control ?z)] [(alt ?z)] idlwave-shell-reset)
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2404 ([(control ?q)] [(alt ?q)] idlwave-shell-quit)
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2405 ([(control ?p)] [(alt ?p)] idlwave-shell-print)
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2406 ([(??)] [(alt ??)] idlwave-shell-help-expression)
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2407 ([(control ?c)] [(alt ?c)] idlwave-shell-save-and-run)
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2408 ([( ?@)] [(alt ?@)] idlwave-shell-save-and-batch)
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2409 ([(control ?x)] [(alt ?x)] idlwave-shell-goto-next-error)
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2410 ([(control ?e)] [(alt ?e)] idlwave-shell-run-region)
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2411 ([(control ?w)] [(alt ?w)] idlwave-shell-resync-dirs)
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2412 ([(control ?l)] [(alt ?l)] idlwave-shell-redisplay)
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2413 ([(control ?t)] [(alt ?t)] idlwave-shell-toggle-toolbar)
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2414 ([(control up)] [(alt up)] idlwave-shell-stack-up)
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2415 ([(control down)] [(alt down)] idlwave-shell-stack-down)))
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2416 s k1 k2 cmd)
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2417 (while (setq s (pop specs))
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2418 (setq k1 (nth 0 s)
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2419 k2 (nth 1 s)
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2420 cmd (nth 2 s))
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2421 (when idlwave-shell-activate-prefix-keybindings
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2422 (and k1 (define-key idlwave-shell-mode-prefix-map k1 cmd)))
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2423 (when idlwave-shell-activate-alt-keybindings
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2424 (and k2 (define-key idlwave-mode-map k2 cmd))
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2425 (and k2 (define-key idlwave-shell-mode-map k2 cmd)))))
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2426
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2427 ;; Enter the prefix map at the two places.
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2428 (fset 'idlwave-debug-map idlwave-shell-mode-prefix-map)
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2429 (fset 'idlwave-shell-debug-map idlwave-shell-mode-prefix-map)
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2430
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2431 ;; The Menus --------------------------------------------------------------
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2432
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2433 (defvar idlwave-shell-menu-def
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2434 '("Debug"
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2435 ["Save and .RUN" idlwave-shell-save-and-run
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2436 (or (eq major-mode 'idlwave-mode)
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2437 idlwave-shell-last-save-and-action-file)]
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2438 ["Save and .COMPILE" idlwave-shell-save-and-compile
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2439 (or (eq major-mode 'idlwave-mode)
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2440 idlwave-shell-last-save-and-action-file)]
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2441 ["Save and @Batch" idlwave-shell-save-and-batch
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2442 (or (eq major-mode 'idlwave-mode)
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2443 idlwave-shell-last-save-and-action-file)]
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2444 ["Goto Next Error" idlwave-shell-goto-next-error t]
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2445 "--"
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2446 ["Execute Default Cmd" idlwave-shell-execute-default-command-line t]
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2447 ["Edit Default Cmd" idlwave-shell-edit-default-command-line t]
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2448 "--"
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2449 ["Set Breakpoint" idlwave-shell-break-here
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2450 (eq major-mode 'idlwave-mode)]
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2451 ["Break in Module" idlwave-shell-break-in t]
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2452 ["Clear Breakpoint" idlwave-shell-clear-current-bp t]
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2453 ["Clear All Breakpoints" idlwave-shell-clear-all-bp t]
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2454 ["List All Breakpoints" idlwave-shell-list-all-bp t]
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2455 "--"
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2456 ["Step (into)" idlwave-shell-step t]
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2457 ["Step (over)" idlwave-shell-stepover t]
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2458 ["Skip One Statement" idlwave-shell-skip t]
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2459 ["Continue" idlwave-shell-cont t]
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2460 ("Continue to"
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2461 ["End of Block" idlwave-shell-up t]
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2462 ["End of Subprog" idlwave-shell-return t]
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2463 ["End of Subprog+1" idlwave-shell-out t]
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2464 ["Here (Cursor Line)" idlwave-shell-to-here
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2465 (eq major-mode 'idlwave-mode)])
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2466 "--"
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2467 ["Print expression" idlwave-shell-print t]
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2468 ["Help on expression" idlwave-shell-help-expression t]
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2469 ["Evaluate Region" idlwave-shell-evaluate-region
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2470 (eq major-mode 'idlwave-mode)]
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2471 ["Run Region" idlwave-shell-run-region (eq major-mode 'idlwave-mode)]
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2472 "--"
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2473 ["Redisplay" idlwave-shell-redisplay t]
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2474 ["Stack Up" idlwave-shell-stack-up t]
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2475 ["Stack Down" idlwave-shell-stack-down t]
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2476 "--"
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2477 ["Update Working Dir" idlwave-shell-resync-dirs t]
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2478 ["Reset IDL" idlwave-shell-reset t]
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2479 "--"
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2480 ["Toggle Toolbar" idlwave-shell-toggle-toolbar t]
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2481 ["Exit IDL" idlwave-shell-quit t]))
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2482
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2483 (if (or (featurep 'easymenu) (load "easymenu" t))
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2484 (progn
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2485 (easy-menu-define
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2486 idlwave-shell-mode-menu idlwave-shell-mode-map "IDL shell menus"
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2487 idlwave-shell-menu-def)
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2488 (easy-menu-define
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2489 idlwave-mode-debug-menu idlwave-mode-map "IDL debugging menus"
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2490 idlwave-shell-menu-def)
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2491 (save-excursion
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2492 (mapcar (lambda (buf)
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2493 (set-buffer buf)
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2494 (if (eq major-mode 'idlwave-mode)
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2495 (progn
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2496 (easy-menu-remove idlwave-mode-debug-menu)
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2497 (easy-menu-add idlwave-mode-debug-menu))))
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2498 (buffer-list)))))
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2499
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2500 ;; The Breakpoint Glyph -------------------------------------------------------
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2501
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2502 (defvar idlwave-shell-bp-glyph nil
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2503 "The glyph to mark breakpoint lines in the source code.")
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2504
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2505 (let ((image-string "/* XPM */
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2506 static char * file[] = {
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2507 \"14 12 3 1\",
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2508 \" c #FFFFFFFFFFFF s backgroundColor\",
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2509 \". c #4B4B4B4B4B4B\",
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2510 \"R c #FFFF00000000\",
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2511 \" \",
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2512 \" \",
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2513 \" RRRR \",
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2514 \" RRRRRR \",
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2515 \" RRRRRRRR \",
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2516 \" RRRRRRRR \",
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2517 \" RRRRRRRR \",
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2518 \" RRRRRRRR \",
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2519 \" RRRRRR \",
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2520 \" RRRR \",
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2521 \" \",
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2522 \" \"};"))
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2523
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2524 (setq idlwave-shell-bp-glyph
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2525 (cond ((and (featurep 'xemacs)
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2526 (featurep 'xpm))
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2527 (make-glyph image-string))
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2528 ((and (not (featurep 'xemacs))
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2529 (fboundp 'image-type-available-p)
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2530 (image-type-available-p 'xpm))
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2531 (list 'image :type 'xpm :data image-string))
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2532 (t nil))))
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2533
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2534 (provide 'idlw-shell)
27166
b2d17f0c1668 Also provide idlwave.shell, not only idlw-shell.
Carsten Dominik <dominik@science.uva.nl>
parents: 27108
diff changeset
2535 (provide 'idlwave-shell)
27107
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2536
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2537 ;;; Load the toolbar when wanted by the user.
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2538
27607
527d42ebb15e (idlwave-shell-print): Fixed bug with
Carsten Dominik <dominik@science.uva.nl>
parents: 27185
diff changeset
2539 (autoload 'idlwave-toolbar-toggle "idlw-toolbar"
527d42ebb15e (idlwave-shell-print): Fixed bug with
Carsten Dominik <dominik@science.uva.nl>
parents: 27185
diff changeset
2540 "Toggle the IDLWAVE toolbar")
527d42ebb15e (idlwave-shell-print): Fixed bug with
Carsten Dominik <dominik@science.uva.nl>
parents: 27185
diff changeset
2541 (autoload 'idlwave-toolbar-add-everywhere "idlw-toolbar"
527d42ebb15e (idlwave-shell-print): Fixed bug with
Carsten Dominik <dominik@science.uva.nl>
parents: 27185
diff changeset
2542 "Add IDLWAVE toolbar")
27107
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2543 (defun idlwave-shell-toggle-toolbar ()
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2544 "Toggle the display of the debugging toolbar."
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2545 (interactive)
27607
527d42ebb15e (idlwave-shell-print): Fixed bug with
Carsten Dominik <dominik@science.uva.nl>
parents: 27185
diff changeset
2546 (idlwave-toolbar-toggle))
27107
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2547
27607
527d42ebb15e (idlwave-shell-print): Fixed bug with
Carsten Dominik <dominik@science.uva.nl>
parents: 27185
diff changeset
2548 (if idlwave-shell-use-toolbar
527d42ebb15e (idlwave-shell-print): Fixed bug with
Carsten Dominik <dominik@science.uva.nl>
parents: 27185
diff changeset
2549 (add-hook 'idlwave-shell-mode-hook 'idlwave-toolbar-add-everywhere))
27107
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2550
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2551 ;;; idlw-shell.el ends here
7b2b73f13427 Renamed idlwave-*.el into idlw-*.el.
Eli Zaretskii <eliz@gnu.org>
parents:
diff changeset
2552