diff options
| author | J.D. Smith | 2004-11-17 05:56:18 +0000 |
|---|---|---|
| committer | J.D. Smith | 2004-11-17 05:56:18 +0000 |
| commit | 12b86f0e396d5451068cd4c31f85b8c72e476e36 (patch) | |
| tree | be30f56e2116b95d4b35b3a08973baf0dd6eca0f | |
| parent | 52a244ebe2bad252967dc1cb72038b43ecc56278 (diff) | |
| download | emacs-12b86f0e396d5451068cd4c31f85b8c72e476e36.tar.gz emacs-12b86f0e396d5451068cd4c31f85b8c72e476e36.zip | |
Updated to IDLWAVE version 5.5. See idlwave.org.
| -rw-r--r-- | man/idlwave.texi | 2318 |
1 files changed, 1511 insertions, 807 deletions
diff --git a/man/idlwave.texi b/man/idlwave.texi index 9c803790171..c0878f1a206 100644 --- a/man/idlwave.texi +++ b/man/idlwave.texi | |||
| @@ -1,34 +1,38 @@ | |||
| 1 | \input texinfo @c -*-texinfo-*- | 1 | \input texinfo @c -*-texinfo-*- |
| 2 | @c %**start of header | 2 | @c %**start of header |
| 3 | @setfilename ../info/idlwave | 3 | @setfilename idlwave |
| 4 | @settitle IDLWAVE User Manual | 4 | @settitle IDLWAVE User Manual |
| 5 | @dircategory Emacs | ||
| 6 | @direntry | ||
| 7 | * IDLWAVE: (idlwave). Major mode and shell for IDL files. | ||
| 8 | @end direntry | ||
| 5 | @synindex ky cp | 9 | @synindex ky cp |
| 6 | @syncodeindex vr cp | 10 | @syncodeindex vr cp |
| 7 | @syncodeindex fn cp | 11 | @syncodeindex fn cp |
| 8 | @set VERSION 4.15 | 12 | @set VERSION 5.5 |
| 9 | @set EDITION 4.15 | 13 | @set EDITION 5.5 |
| 10 | @set IDLVERSION 5.5 | 14 | @set IDLVERSION 6.1 |
| 11 | @set NSYSROUTINES 1324 | 15 | @set NSYSROUTINES 1850 |
| 12 | @set NSYSKEYWORDS 6129 | 16 | @set NSYSKEYWORDS 7685 |
| 13 | @set DATE September 2002 | 17 | @set DATE November, 2004 |
| 14 | @set AUTHOR J.D. Smith & Carsten Dominik | 18 | @set AUTHOR J.D. Smith & Carsten Dominik |
| 15 | @set AUTHOR-EMAIL dominik@@astro.uva.nl | 19 | @set AUTHOR-EMAIL jdsmith@@as.arizona.edu |
| 16 | @set MAINTAINER J.D. Smith | 20 | @set MAINTAINER J.D. Smith |
| 17 | @set MAINTAINER-EMAIL jdsmith@@as.arizona.edu | 21 | @set MAINTAINER-EMAIL jdsmith@@as.arizona.edu |
| 18 | @set IDLWAVE-HOMEPAGE http://idlwave.org/ | 22 | @set IDLWAVE-HOMEPAGE http://idlwave.org/ |
| 19 | @c %**end of header | 23 | @c %**end of header |
| 24 | @finalout | ||
| 20 | 25 | ||
| 21 | @copying | 26 | @ifinfo |
| 22 | This file documents IDLWAVE, a major mode for editing IDL files with | 27 | This file documents IDLWAVE, a major mode for editing IDL files with |
| 23 | Emacs, and interacting with an IDL shell run as a subprocess. | 28 | Emacs, and interacting with an IDL shell run as a subprocess. |
| 24 | 29 | ||
| 25 | This is edition @value{EDITION} of the IDLWAVE User Manual for IDLWAVE | 30 | This is edition @value{EDITION} of the IDLWAVE User Manual for IDLWAVE |
| 26 | @value{VERSION} | 31 | @value{VERSION} |
| 27 | 32 | ||
| 28 | Copyright @copyright{} 1999, 2000, 2001, 2002 Free Software Foundation, | 33 | Copyright @copyright{} 1999, 2000, 2001, 2002, 2003, 2004 Free Software |
| 29 | Inc. | 34 | Foundation, Inc. |
| 30 | 35 | ||
| 31 | @quotation | ||
| 32 | Permission is granted to copy, distribute and/or modify this document | 36 | Permission is granted to copy, distribute and/or modify this document |
| 33 | under the terms of the GNU Free Documentation License, Version 1.1 or | 37 | under the terms of the GNU Free Documentation License, Version 1.1 or |
| 34 | any later version published by the Free Software Foundation; with no | 38 | any later version published by the Free Software Foundation; with no |
| @@ -45,27 +49,38 @@ This document is part of a collection distributed under the GNU Free | |||
| 45 | Documentation License. If you want to distribute this document | 49 | Documentation License. If you want to distribute this document |
| 46 | separately from the collection, you can do so by adding a copy of the | 50 | separately from the collection, you can do so by adding a copy of the |
| 47 | license to the document, as described in section 6 of the license. | 51 | license to the document, as described in section 6 of the license. |
| 48 | @end quotation | 52 | @end ifinfo |
| 49 | @end copying | ||
| 50 | |||
| 51 | @dircategory Emacs | ||
| 52 | @direntry | ||
| 53 | * IDLWAVE: (idlwave). Major mode and shell for IDL files. | ||
| 54 | @end direntry | ||
| 55 | |||
| 56 | @finalout | ||
| 57 | 53 | ||
| 58 | @titlepage | 54 | @titlepage |
| 59 | @title IDLWAVE User Manual | 55 | @title IDLWAVE User Manual |
| 60 | @subtitle Emacs major mode and shell for IDL | 56 | @subtitle Emacs major mode and shell for IDL |
| 61 | @subtitle Edition @value{EDITION}, @value{DATE} | 57 | @subtitle Edition @value{EDITION}, @value{DATE} |
| 62 | 58 | ||
| 63 | @author by Carsten Dominik & J.D. Smith | 59 | @author by J.D. Smith & Carsten Dominik |
| 64 | @page | 60 | @page |
| 65 | This is edition @value{EDITION} of the @cite{IDLWAVE User Manual} for | 61 | This is edition @value{EDITION} of the @cite{IDLWAVE User Manual} for |
| 66 | IDLWAVE version @value{VERSION}, @value{DATE}. | 62 | IDLWAVE version @value{VERSION}, @value{DATE}. |
| 63 | @sp 2 | ||
| 64 | Copyright @copyright{} 1999, 2000, 2001, 2002, 2003, 2004 Free Software | ||
| 65 | Foundation, Inc. | ||
| 66 | @sp 2 | ||
| 67 | @cindex Copyright, of IDLWAVE | 67 | @cindex Copyright, of IDLWAVE |
| 68 | @insertcopying | 68 | Permission is granted to copy, distribute and/or modify this document |
| 69 | under the terms of the GNU Free Documentation License, Version 1.1 or | ||
| 70 | any later version published by the Free Software Foundation; with no | ||
| 71 | Invariant Sections, with the Front-Cover texts being ``A GNU | ||
| 72 | Manual'', and with the Back-Cover Texts as in (a) below. A copy of the | ||
| 73 | license is included in the section entitled ``GNU Free Documentation | ||
| 74 | License'' in the Emacs manual. | ||
| 75 | |||
| 76 | (a) The FSF's Back-Cover Text is: ``You have freedom to copy and modify | ||
| 77 | this GNU Manual, like GNU software. Copies published by the Free | ||
| 78 | Software Foundation raise funds for GNU development.'' | ||
| 79 | |||
| 80 | This document is part of a collection distributed under the GNU Free | ||
| 81 | Documentation License. If you want to distribute this document | ||
| 82 | separately from the collection, you can do so by adding a copy of the | ||
| 83 | license to the document, as described in section 6 of the license. | ||
| 69 | @end titlepage | 84 | @end titlepage |
| 70 | @contents | 85 | @contents |
| 71 | 86 | ||
| @@ -75,23 +90,24 @@ IDLWAVE version @value{VERSION}, @value{DATE}. | |||
| 75 | 90 | ||
| 76 | @node Top, Introduction, (dir), (dir) | 91 | @node Top, Introduction, (dir), (dir) |
| 77 | 92 | ||
| 78 | IDLWAVE is a package which supports editing source for the | 93 | IDLWAVE is a package which supports editing source code written in the |
| 79 | Interactive Data Language (IDL), and running IDL as an inferior | 94 | Interactive Data Language (IDL), and running IDL as an inferior shell. |
| 80 | shell. | ||
| 81 | 95 | ||
| 82 | @end ifnottex | 96 | @end ifnottex |
| 83 | 97 | ||
| 84 | @menu | 98 | @menu |
| 85 | * Introduction:: What IDLWAVE is and what it's not | 99 | * Introduction:: What IDLWAVE is, and what it is not |
| 86 | * IDLWAVE in a Nutshell:: One page quick-start guide | 100 | * IDLWAVE in a Nutshell:: One page quick-start guide |
| 87 | * Getting Started:: Tutorial | 101 | * Getting Started:: Tutorial |
| 88 | * The IDLWAVE Major Mode:: The mode to edit IDL programs | 102 | * The IDLWAVE Major Mode:: The mode for editing IDL programs |
| 89 | * The IDLWAVE Shell:: The mode to run IDL as an inferior program | 103 | * The IDLWAVE Shell:: The mode for running IDL as an inferior program |
| 90 | * Installation:: How to Install or Upgrade | 104 | * Installation:: How to Install or Upgrade |
| 91 | * Acknowledgements:: Who did what | 105 | * Acknowledgements:: Who did what |
| 92 | * Sources of Routine Info:: How does IDLWAVE know about routine XYZ | 106 | * Sources of Routine Info:: How does IDLWAVE know about routine XYZ |
| 93 | * Configuration Examples:: The user is king... | 107 | * HTML Help Browser Tips:: |
| 108 | * Configuration Examples:: The user is king | ||
| 94 | * Windows and MacOS:: What still works, and how | 109 | * Windows and MacOS:: What still works, and how |
| 110 | * Troubleshooting:: When good computers turn bad | ||
| 95 | * Index:: Fast access | 111 | * Index:: Fast access |
| 96 | 112 | ||
| 97 | @detailmenu | 113 | @detailmenu |
| @@ -99,9 +115,9 @@ shell. | |||
| 99 | 115 | ||
| 100 | Getting Started (Tutorial) | 116 | Getting Started (Tutorial) |
| 101 | 117 | ||
| 102 | * Lesson I -- Development Cycle:: | 118 | * Lesson I -- Development Cycle:: |
| 103 | * Lesson II -- Customization:: | 119 | * Lesson II -- Customization:: |
| 104 | * Lesson III -- Library Catalog:: | 120 | * Lesson III -- User Catalog:: |
| 105 | 121 | ||
| 106 | The IDLWAVE Major Mode | 122 | The IDLWAVE Major Mode |
| 107 | 123 | ||
| @@ -121,17 +137,22 @@ The IDLWAVE Major Mode | |||
| 121 | Code Formatting | 137 | Code Formatting |
| 122 | 138 | ||
| 123 | * Code Indentation:: Reflecting the logical structure | 139 | * Code Indentation:: Reflecting the logical structure |
| 124 | * Continued Statement Indentation:: | 140 | * Continued Statement Indentation:: |
| 125 | * Comment Indentation:: Special indentation for comment lines | 141 | * Comment Indentation:: Special indentation for comment lines |
| 126 | * Continuation Lines:: Splitting statements over lines | 142 | * Continuation Lines:: Splitting statements over lines |
| 127 | * Syntax Highlighting:: Font-lock support | 143 | * Syntax Highlighting:: Font-lock support |
| 128 | * Octals and Highlighting:: Why "123 causes problems | 144 | * Octals and Highlighting:: Why "123 causes problems |
| 129 | 145 | ||
| 146 | Online Help | ||
| 147 | |||
| 148 | * Help with HTML Documentation:: | ||
| 149 | * Help with Source:: | ||
| 150 | |||
| 130 | Completion | 151 | Completion |
| 131 | 152 | ||
| 132 | * Case of Completed Words:: CaseOFcomPletedWords | 153 | * Case of Completed Words:: CaseOFcomPletedWords |
| 133 | * Object Method Completion and Class Ambiguity:: obj->Method, what? | 154 | * Object Method Completion and Class Ambiguity:: obj->Method, what? |
| 134 | * Object Method Completion in the Shell:: | 155 | * Object Method Completion in the Shell:: |
| 135 | * Class and Keyword Inheritance:: obj->Method, _EXTRA=e | 156 | * Class and Keyword Inheritance:: obj->Method, _EXTRA=e |
| 136 | * Structure Tag Completion:: Completing state.Tag | 157 | * Structure Tag Completion:: Completing state.Tag |
| 137 | 158 | ||
| @@ -145,32 +166,38 @@ The IDLWAVE Shell | |||
| 145 | 166 | ||
| 146 | * Starting the Shell:: How to launch IDL as a subprocess | 167 | * Starting the Shell:: How to launch IDL as a subprocess |
| 147 | * Using the Shell:: Interactively working with the Shell | 168 | * Using the Shell:: Interactively working with the Shell |
| 148 | * Commands Sent to the Shell:: | 169 | * Commands Sent to the Shell:: |
| 149 | * Debugging IDL Programs:: | 170 | * Debugging IDL Programs:: |
| 150 | * Examining Variables:: | 171 | * Examining Variables:: |
| 151 | * Custom Expression Examination:: | 172 | * Custom Expression Examination:: |
| 152 | 173 | ||
| 153 | Debugging IDL Programs | 174 | Debugging IDL Programs |
| 154 | 175 | ||
| 155 | * Debug Key Bindings:: | 176 | * A Tale of Two Modes:: |
| 156 | * Compiling Programs:: | 177 | * Debug Key Bindings:: |
| 157 | * Breakpoints and Stepping:: | 178 | * Breakpoints and Stepping:: |
| 158 | * Walking the Calling Stack:: | 179 | * Compiling Programs:: |
| 180 | * Walking the Calling Stack:: | ||
| 181 | * Electric Debug Mode:: | ||
| 159 | 182 | ||
| 160 | Installation | 183 | Installation |
| 161 | 184 | ||
| 162 | * Installing IDLWAVE:: How to install the distribution | 185 | * Installing IDLWAVE:: How to install the distribution |
| 163 | * Installing Online Help:: Where to get the additional files needed | 186 | * Installing Online Help:: Where to get the additional files needed |
| 164 | * Upgrading from idl.el:: Necessary configuration changes | ||
| 165 | 187 | ||
| 166 | Sources of Routine Info | 188 | Sources of Routine Info |
| 167 | 189 | ||
| 168 | * Routine Definitions:: Where IDL Routines are defined. | 190 | * Routine Definitions:: Where IDL Routines are defined. |
| 169 | * Routine Information Sources:: So how does IDLWAVE know about... | 191 | * Routine Information Sources:: So how does IDLWAVE know about... |
| 170 | * Library Catalog:: Scanning the Libraries for Routine Info | 192 | * Catalogs:: |
| 171 | * Load-Path Shadows:: Routines defined in several places | 193 | * Load-Path Shadows:: Routines defined in several places |
| 172 | * Documentation Scan:: Scanning the IDL Manuals | 194 | * Documentation Scan:: Scanning the IDL Manuals |
| 173 | 195 | ||
| 196 | Catalogs | ||
| 197 | |||
| 198 | * Library Catalogs:: | ||
| 199 | * User Catalog:: | ||
| 200 | |||
| 174 | @end detailmenu | 201 | @end detailmenu |
| 175 | @end menu | 202 | @end menu |
| 176 | 203 | ||
| @@ -185,38 +212,44 @@ Sources of Routine Info | |||
| 185 | @cindex @file{idl-shell.el} | 212 | @cindex @file{idl-shell.el} |
| 186 | @cindex Feature overview | 213 | @cindex Feature overview |
| 187 | 214 | ||
| 188 | IDLWAVE is a package which supports editing source files for the | 215 | IDLWAVE is a package which supports editing source files written in |
| 189 | Interactive Data Language (IDL@footnote{IDL is a registered trademark of | 216 | the Interactive Data Language (IDL@footnote{IDL is a registered |
| 190 | Research Systems, Inc., a Kodak Company}), and for running IDL as an | 217 | trademark of Research Systems, Inc., a Kodak Company}), and running |
| 191 | inferior shell@footnote{Note that this package has nothing to do with | 218 | IDL as an inferior shell@footnote{Note that this package has nothing |
| 192 | the Interface Definition Language, part of the Common Object Request | 219 | to do with the Interface Definition Language, part of the Common |
| 193 | Broker Architecture (CORBA)}. It can also be used for editing source | 220 | Object Request Broker Architecture (CORBA)}@footnote{IDLWAVE can also |
| 194 | files for the related WAVE/CL language, but with only limited | 221 | be used for editing source files for the related WAVE/CL language, but |
| 195 | support. | 222 | with only limited support.}. It is a feature-rich replacement for the |
| 196 | 223 | IDLDE development environment bundled with IDL, and uses the full | |
| 197 | IDLWAVE consists of two main parts: a major mode for editing IDL source | 224 | power of Emacs to make editing and running IDL programs easier, |
| 198 | files files (@code{idlwave-mode}) and a mode for running the IDL program | 225 | quicker, and more structured. |
| 199 | as an inferior shell (@code{idlwave-shell-mode}). Although one mode can | 226 | |
| 200 | be used without the other, both work together closely to form a complete | 227 | IDLWAVE consists of two main parts: a major mode for editing IDL |
| 201 | development environment. Here is a brief summary of what IDLWAVE does: | 228 | source files (@code{idlwave-mode}) and a mode for running the IDL |
| 229 | program as an inferior shell (@code{idlwave-shell-mode}). Although | ||
| 230 | one mode can be used without the other, both work together closely to | ||
| 231 | form a complete development environment. Here is a brief summary of | ||
| 232 | what IDLWAVE does: | ||
| 202 | 233 | ||
| 203 | @itemize @bullet | 234 | @itemize @bullet |
| 204 | @item | 235 | @item |
| 205 | Code indentation and formatting. | 236 | Smart code indentation and automatic-formatting. |
| 206 | @item | 237 | @item |
| 207 | Three level syntax highlighting support. | 238 | Three level syntax highlighting support. |
| 208 | @item | 239 | @item |
| 209 | Context-sensitive display of calling sequences and keywords for more | 240 | Context-sensitive display of calling sequences and keywords for more |
| 210 | than 1000 native IDL routines, extendible to any number of additional | 241 | than 1000 native IDL routines, extendible to any additional number of |
| 211 | routines in your local IDL libraries. | 242 | local routines, and already available with many pre-scanned libraries. |
| 212 | @item | 243 | @item |
| 213 | Routine name space conflict search, likelihood-of-use ranking. | 244 | Routine name space conflict search with likelihood-of-use ranking. |
| 214 | @item | 245 | @item |
| 215 | Fast, context-sensitive online help. | 246 | Fast, context-sensitive online HTML help, or source-header help for |
| 247 | undocumented routines. | ||
| 216 | @item | 248 | @item |
| 217 | Context sensitive completion of routine names and keywords. | 249 | Context sensitive completion of routine names, keywords, system |
| 250 | variables, class names and much more. | ||
| 218 | @item | 251 | @item |
| 219 | Easy insertion of code templates. | 252 | Easy insertion of code templates and abbreviations of common constructs. |
| 220 | @item | 253 | @item |
| 221 | Automatic corrections to enforce a variety of customizable coding | 254 | Automatic corrections to enforce a variety of customizable coding |
| 222 | standards. | 255 | standards. |
| @@ -231,8 +264,8 @@ Running IDL as an inferior Shell with history search, command line | |||
| 231 | editing and all the completion and routine info capabilities present in | 264 | editing and all the completion and routine info capabilities present in |
| 232 | IDL source buffers. | 265 | IDL source buffers. |
| 233 | @item | 266 | @item |
| 234 | Compilation, execution and interactive debugging of programs directly | 267 | Compilation, execution and interactive single-keystroke debugging of |
| 235 | from the source buffer. | 268 | programs directly from the source buffer. |
| 236 | @item | 269 | @item |
| 237 | Quick, source-guided navigation of the calling stack, with variable | 270 | Quick, source-guided navigation of the calling stack, with variable |
| 238 | inspection, etc. | 271 | inspection, etc. |
| @@ -261,12 +294,10 @@ stopped at a breakpoint} | |||
| 261 | @end itemize | 294 | @end itemize |
| 262 | @end ifnottex | 295 | @end ifnottex |
| 263 | 296 | ||
| 264 | IDLWAVE is the successor to the @file{idl.el} and @file{idl-shell.el} | 297 | IDLWAVE is the distant successor to the @file{idl.el} and |
| 265 | files written by Chris Chase. The modes and files had to be renamed | 298 | @file{idl-shell.el} files written by Chris Chase. The modes and files |
| 266 | because of a name space conflict with CORBA's @code{idl-mode}, defined in | 299 | had to be renamed because of a name space conflict with CORBA's |
| 267 | Emacs in the file @file{cc-mode.el}. If you have been using the old | 300 | @code{idl-mode}, defined in Emacs in the file @file{cc-mode.el}. |
| 268 | files, check @ref{Upgrading from idl.el} for information on how to | ||
| 269 | switch. | ||
| 270 | 301 | ||
| 271 | In this manual, each section ends with a list of related user options. | 302 | In this manual, each section ends with a list of related user options. |
| 272 | Don't be confused by the sheer number of options available --- in most | 303 | Don't be confused by the sheer number of options available --- in most |
| @@ -307,6 +338,8 @@ at point. | |||
| 307 | @tab Update IDLWAVE's knowledge about functions and procedures. | 338 | @tab Update IDLWAVE's knowledge about functions and procedures. |
| 308 | @item @kbd{C-c C-v} | 339 | @item @kbd{C-c C-v} |
| 309 | @tab Visit the source code of a procedure/function. | 340 | @tab Visit the source code of a procedure/function. |
| 341 | @item @kbd{C-u C-c C-v} | ||
| 342 | @tab Visit the source code of a procedure/function in this buffer. | ||
| 310 | @item @kbd{C-c C-h} | 343 | @item @kbd{C-c C-h} |
| 311 | @tab Insert a standard documentation header. | 344 | @tab Insert a standard documentation header. |
| 312 | @item @kbd{C-c @key{RET}} | 345 | @item @kbd{C-c @key{RET}} |
| @@ -322,16 +355,22 @@ at point. | |||
| 322 | @tab Cycle back through IDL command history. | 355 | @tab Cycle back through IDL command history. |
| 323 | @item @kbd{M-n} | 356 | @item @kbd{M-n} |
| 324 | @tab Cycle forward. | 357 | @tab Cycle forward. |
| 325 | @item @kbd{M-@key{TAB}} | 358 | @item @kbd{@key{TAB}} |
| 326 | @tab Complete a procedure name, function name or keyword in the shell buffer. | 359 | @tab Complete a procedure name, function name or keyword in the shell buffer. |
| 327 | @item @kbd{C-c C-d C-c} | 360 | @item @kbd{C-c C-d C-c} |
| 328 | @tab Save and compile the source file in the current buffer. | 361 | @tab Save and compile the source file in the current buffer. |
| 329 | @item @kbd{C-c C-d C-x} | 362 | @item @kbd{C-c C-d C-x} |
| 330 | @tab Goto next syntax error. | 363 | @tab Go to next syntax error. |
| 364 | @item @kbd{C-c C-d C-v} | ||
| 365 | @tab Switch to electric debug mode. | ||
| 331 | @item @kbd{C-c C-d C-b} | 366 | @item @kbd{C-c C-d C-b} |
| 332 | @tab Set a breakpoint at the nearest viable source line. | 367 | @tab Set a breakpoint at the nearest viable source line. |
| 333 | @item @kbd{C-c C-d C-d} | 368 | @item @kbd{C-c C-d C-d} |
| 334 | @tab Clear the nearest breakpoint. | 369 | @tab Clear the nearest breakpoint. |
| 370 | @item @kbd{C-c C-d [} | ||
| 371 | @tab Go to the previous breakpoint. | ||
| 372 | @item @kbd{C-c C-d ]} | ||
| 373 | @tab Go to the next breakpoint. | ||
| 335 | @item @kbd{C-c C-d C-p} | 374 | @item @kbd{C-c C-d C-p} |
| 336 | @tab Print the value of the expression near point in IDL. | 375 | @tab Print the value of the expression near point in IDL. |
| 337 | @end multitable | 376 | @end multitable |
| @@ -353,8 +392,6 @@ at point. | |||
| 353 | (setq idlwave-shell-automatic-start t) | 392 | (setq idlwave-shell-automatic-start t) |
| 354 | ;; Bind debugging commands with CONTROL and SHIFT modifiers | 393 | ;; Bind debugging commands with CONTROL and SHIFT modifiers |
| 355 | (setq idlwave-shell-debug-modifiers '(control shift)) | 394 | (setq idlwave-shell-debug-modifiers '(control shift)) |
| 356 | ;; Specify the online help files' location. | ||
| 357 | (setq idlwave-help-directory "~/.idlwave") | ||
| 358 | @end lisp | 395 | @end lisp |
| 359 | 396 | ||
| 360 | @ifhtml | 397 | @ifhtml |
| @@ -367,20 +404,21 @@ at point. | |||
| 367 | @cindex Getting Started | 404 | @cindex Getting Started |
| 368 | 405 | ||
| 369 | @menu | 406 | @menu |
| 370 | * Lesson I -- Development Cycle:: | 407 | * Lesson I -- Development Cycle:: |
| 371 | * Lesson II -- Customization:: | 408 | * Lesson II -- Customization:: |
| 372 | * Lesson III -- Library Catalog:: | 409 | * Lesson III -- User Catalog:: |
| 373 | @end menu | 410 | @end menu |
| 374 | 411 | ||
| 375 | @node Lesson I -- Development Cycle, Lesson II -- Customization, Getting Started, Getting Started | 412 | @node Lesson I -- Development Cycle, Lesson II -- Customization, Getting Started, Getting Started |
| 376 | @section Lesson I: Development Cycle | 413 | @section Lesson I: Development Cycle |
| 377 | 414 | ||
| 378 | The purpose of this tutorial is to guide you through a very basic | 415 | The purpose of this tutorial is to guide you through a very basic |
| 379 | development cycle using IDLWAVE. We will paste a simple program into a | 416 | development cycle using IDLWAVE. We will paste a simple program into |
| 380 | buffer and use the shell to compile, debug and run it. On the way we | 417 | a buffer and use the shell to compile, debug and run it. On the way |
| 381 | will use many of the important IDLWAVE commands. Note however that | 418 | we will use many of the important IDLWAVE commands. Note, however, |
| 382 | there are many more capabilities in IDLWAVE than covered here, which can | 419 | that IDLWAVE has many more capabilities than covered here, which can |
| 383 | be discovered by reading the entire manual. | 420 | be discovered by reading the entire manual, or hovering over the |
| 421 | shoulder of your nearest IDLWAVE guru for a few days. | ||
| 384 | 422 | ||
| 385 | It is assumed that you have access to Emacs or XEmacs with the full | 423 | It is assumed that you have access to Emacs or XEmacs with the full |
| 386 | IDLWAVE package including online help (@pxref{Installation}). We also | 424 | IDLWAVE package including online help (@pxref{Installation}). We also |
| @@ -395,9 +433,9 @@ Open a new source file by typing: | |||
| 395 | @kbd{C-x C-f tutorial.pro @key{RET}} | 433 | @kbd{C-x C-f tutorial.pro @key{RET}} |
| 396 | @end example | 434 | @end example |
| 397 | 435 | ||
| 398 | A buffer for this file will pop up, and it should be in IDLWAVE mode, as | 436 | A buffer for this file will pop up, and it should be in IDLWAVE mode, |
| 399 | shown in the mode line just below the editing window. Also, the menu | 437 | indicated in the mode line just below the editing window. Also, the |
| 400 | bar should contain entries @samp{IDLWAVE} and @samp{Debug}. | 438 | menu bar should contain @samp{IDLWAVE}. |
| 401 | 439 | ||
| 402 | Now cut-and-paste the following code, also available as | 440 | Now cut-and-paste the following code, also available as |
| 403 | @file{tutorial.pro} in the IDLWAVE distribution. | 441 | @file{tutorial.pro} in the IDLWAVE distribution. |
| @@ -412,13 +450,13 @@ function daynr,d,m,y | |||
| 412 | y1 = y * delta | 450 | y1 = y * delta |
| 413 | return, d + floor(m1*30.6)+floor(y1*365.25)+5 | 451 | return, d + floor(m1*30.6)+floor(y1*365.25)+5 |
| 414 | end | 452 | end |
| 415 | 453 | ||
| 416 | function weekday,day,month,year | 454 | function weekday,day,month,year |
| 417 | ;; compute weekday number for date | 455 | ;; compute weekday number for date |
| 418 | nr = daynr(day,month,year) | 456 | nr = daynr(day,month,year) |
| 419 | return, nr mod 7 | 457 | return, nr mod 7 |
| 420 | end | 458 | end |
| 421 | 459 | ||
| 422 | pro plot_wday,day,month | 460 | pro plot_wday,day,month |
| 423 | ;; Plot the weekday of a date in the first 10 years of this century. | 461 | ;; Plot the weekday of a date in the first 10 years of this century. |
| 424 | years = 2000,+indgen(10) | 462 | years = 2000,+indgen(10) |
| @@ -431,31 +469,35 @@ end | |||
| 431 | @end example | 469 | @end example |
| 432 | 470 | ||
| 433 | The indentation probably looks funny, since it's different from the | 471 | The indentation probably looks funny, since it's different from the |
| 434 | settings you use, so use the @key{TAB} key in each line to automatically | 472 | settings you use, so use the @key{TAB} key in each line to |
| 435 | line it up (or more quickly @emph{select} the entire buffer with | 473 | automatically line it up (or, more quickly, @emph{select} the entire |
| 436 | @kbd{C-x h}, and indent the whole region with @kbd{C-M-\}). Notice how | 474 | buffer with @kbd{C-x h}, and indent the whole region with |
| 437 | different syntactical elements are highlighted in different colors, if | 475 | @kbd{C-M-\}). Notice how different syntactical elements are |
| 438 | you have set up support for font-lock. | 476 | highlighted in different colors, if you have set up support for |
| 477 | font-lock. | ||
| 439 | 478 | ||
| 440 | Let's check out two particular editing features of IDLWAVE. Place the | 479 | Let's check out two particular editing features of IDLWAVE. Place the |
| 441 | cursor after the @code{end} statement of the @code{for} loop and press | 480 | cursor after the @code{end} statement of the @code{for} loop and press |
| 442 | @key{SPC}. IDLWAVE blinks back to the beginning of the block and | 481 | @key{SPC}. IDLWAVE blinks back to the beginning of the block and |
| 443 | changes the generic @code{end} to the specific @code{endfor} | 482 | changes the generic @code{end} to the specific @code{endfor} |
| 444 | automatically. Now place the cursor in any line you would like to split | 483 | automatically (as long as the variable @code{idlwave-expand-generic-end} |
| 445 | and press @kbd{M-@key{RET}}. The line is split at the cursor position, | 484 | is turned on --- @pxref{Lesson II -- Customization}). Now place the |
| 446 | with the continuation @samp{$} and indentation all taken care of. Use | 485 | cursor in any line you would like to split and press @kbd{M-@key{RET}}. |
| 447 | @kbd{C-/} to undo the last change. | 486 | The line is split at the cursor position, with the continuation @samp{$} |
| 448 | 487 | and indentation all taken care of. Use @kbd{C-/} to undo the last | |
| 449 | The procedure @code{plot_wday} is supposed to plot the weekday of a | 488 | change. |
| 450 | given date for the first 10 years of the 21st century. As in most code, | 489 | |
| 451 | there are a few bugs, which we are going to use IDLWAVE to help us fix. | 490 | The procedure @code{plot_wday} is supposed to plot the day of the week |
| 491 | of a given date for the first 10 years of the 21st century. As in | ||
| 492 | most code, there are a few bugs, which we are going to use IDLWAVE to | ||
| 493 | help us fix. | ||
| 452 | 494 | ||
| 453 | First, let's launch the IDLWAVE shell. You do this with the command | 495 | First, let's launch the IDLWAVE shell. You do this with the command |
| 454 | @kbd{C-c C-s}. The Emacs window will split and display IDL running in a | 496 | @kbd{C-c C-s}. The Emacs window will split or another window will popup |
| 455 | shell interaction buffer. Type a few commands like @code{print,!PI} to | 497 | to display IDL running in a shell interaction buffer. Type a few |
| 456 | convince yourself that you can work there just as well as in a terminal, | 498 | commands like @code{print,!PI} to convince yourself that you can work |
| 457 | or the IDLDE. Use the arrow keys to cycle through your command history. | 499 | there just as well as in a terminal, or the IDLDE. Use the arrow keys |
| 458 | Are we having fun now? | 500 | to cycle through your command history. Are we having fun now? |
| 459 | 501 | ||
| 460 | Now go back to the source window and type @kbd{C-c C-d C-c} to compile | 502 | Now go back to the source window and type @kbd{C-c C-d C-c} to compile |
| 461 | the program. If you watch the shell buffer, you see that IDLWAVE types | 503 | the program. If you watch the shell buffer, you see that IDLWAVE types |
| @@ -469,44 +511,47 @@ see the three routines compile. | |||
| 469 | 511 | ||
| 470 | Now we want to use the command to plot the day of the week on January | 512 | Now we want to use the command to plot the day of the week on January |
| 471 | 1st. We could type the full command ourselves, but why do that? Go | 513 | 1st. We could type the full command ourselves, but why do that? Go |
| 472 | back to the shell window, type @samp{plot_} and hit @key{TAB}. After a | 514 | back to the shell window, type @samp{plot_} and hit @key{TAB}. After |
| 473 | bit of a delay (while IDLWAVE initializes its routine info database, if | 515 | a bit of a delay (while IDLWAVE initializes its routine info database, |
| 474 | necessary), the window will split to show all procedures it knows | 516 | if necessary), the window will split to show all procedures it knows |
| 475 | starting with that string, and @w{@code{plot_wday}} should be one of | 517 | starting with that string, and @w{@code{plot_wday}} should be one of |
| 476 | them. Saving the buffer alerted IDLWAVE about this new routine. Click | 518 | them. Saving the buffer alerted IDLWAVE about this new routine. |
| 477 | with the middle mouse button on @code{plot_wday} and it will be copied | 519 | Click with the middle mouse button on @code{plot_wday} and it will be |
| 478 | to the shell buffer, or if you prefer, add @samp{w} to @samp{plot_} to | 520 | copied to the shell buffer, or if you prefer, add @samp{w} to |
| 479 | make it unambiguous, hit @key{TAB} again, and the full routine name will | 521 | @samp{plot_} to make it unambiguous (depending on what other routines |
| 480 | be completed. Now provide the two arguments: | 522 | starting with @samp{plot_} you have installed on your system), hit |
| 523 | @key{TAB} again, and the full routine name will be completed. Now | ||
| 524 | provide the two arguments: | ||
| 481 | 525 | ||
| 482 | @example | 526 | @example |
| 483 | plot_wday,1,1 | 527 | plot_wday,1,1 |
| 484 | @end example | 528 | @end example |
| 485 | 529 | ||
| 486 | and press @key{RET}. This fails with an error message telling you the | 530 | @noindent and press @key{RET}. This fails with an error message telling |
| 487 | @code{YT} keyword to plot is ambiguous. What are the allowed keywords | 531 | you the @code{YT} keyword to plot is ambiguous. What are the allowed |
| 488 | again? Go back to the source window and put the cursor into the `plot' | 532 | keywords again? Go back to the source window and put the cursor into |
| 489 | line, and press @kbd{C-c ?}. This shows the routine info window for the | 533 | the `plot' line and press @kbd{C-c ?}. This shows the routine info |
| 490 | plot routine, which contains a list of keywords, along with the argument | 534 | window for the plot routine, which contains a list of keywords, along |
| 491 | list. Oh, we wanted @code{YTITLE}. Fix that up. Recompile with | 535 | with the argument list. Oh, we wanted @code{YTITLE}. Fix that up. |
| 492 | @kbd{C-c C-d C-c}. Jump back into the shell with @kbd{C-c C-s}, press | 536 | Recompile with @kbd{C-c C-d C-c}. Jump back into the shell with |
| 493 | the @key{UP} arrow to recall the previous command and execute again. | 537 | @kbd{C-c C-s}, press the @key{UP} arrow to recall the previous command |
| 538 | and execute again. | ||
| 494 | 539 | ||
| 495 | This time we get a plot, but it is pretty ugly --- the points are all | 540 | This time we get a plot, but it is pretty ugly --- the points are all |
| 496 | connected with a line. Hmm, isn't there a way for @code{plot} to use | 541 | connected with a line. Hmm, isn't there a way for @code{plot} to use |
| 497 | symbols instead? What was that keyword? Position the cursor on the | 542 | symbols instead? What was that keyword? Position the cursor on the |
| 498 | plot line after a comma (where you'd normally type a keyword), and hit | 543 | plot line after a comma (where you'd normally type a keyword), and hit |
| 499 | @kbd{M-@key{Tab}}. A long list of plot's keywords appears. Aha, there | 544 | @kbd{M-@key{Tab}}. A long list of plot's keywords appears. Aha, |
| 500 | it is, @code{PSYM}. Middle click to insert it. An @samp{=} sign is | 545 | there it is, @code{PSYM}. Middle click to insert it. An @samp{=} |
| 501 | included for you too. Now what were the values of @code{PSYM} supposed | 546 | sign is included for you too. Now what were the values of @code{PSYM} |
| 502 | to be? With the cursor on or after the keyword, press @kbd{M-?} for | 547 | supposed to be? With the cursor on or after the keyword, press |
| 503 | online help (alternatively, you could have right clicked on the colored | 548 | @kbd{M-?} for online help (alternatively, you could have right clicked |
| 504 | keyword itself in the completion list). The online help window will pop | 549 | on the colored keyword itself in the completion list). A browser will |
| 505 | up showing the documentation for the @code{PYSM} keyword. OK, let's use | 550 | pop up showing the HTML documentation for the @code{PYSM} keyword. |
| 506 | diamonds=4. Fix this, recompile (you know the command by now: @kbd{C-c | 551 | OK, let's use diamonds=4. Fix this, recompile (you know the command |
| 507 | C-d C-c}, go back to the shell (if it's vanished, you know the command | 552 | by now: @kbd{C-c C-d C-c}), go back to the shell (if it's vanished, |
| 508 | to recall it by now: @kbd{C-c C-s}) and execute again. Now things look | 553 | you know what to do: @kbd{C-c C-s}) and execute again. Now things |
| 509 | pretty good. | 554 | look pretty good. |
| 510 | 555 | ||
| 511 | Let's try a different day --- how about April fool's day? | 556 | Let's try a different day --- how about April fool's day? |
| 512 | 557 | ||
| @@ -518,16 +563,17 @@ Oops, this looks very wrong. All April fool's days cannot be Fridays! | |||
| 518 | We've got a bug in the program, perhaps in the @code{daynr} function. | 563 | We've got a bug in the program, perhaps in the @code{daynr} function. |
| 519 | Let's put a breakpoint on the last line there. Position the cursor on | 564 | Let's put a breakpoint on the last line there. Position the cursor on |
| 520 | the @samp{return, d+...} line and press @kbd{C-c C-d C-b}. IDL sets a | 565 | the @samp{return, d+...} line and press @kbd{C-c C-d C-b}. IDL sets a |
| 521 | breakpoint (as you see in the shell window), and the line is highlighted | 566 | breakpoint (as you see in the shell window), and the break line is |
| 522 | in some way. Back to the shell buffer, re-execute the previous command. | 567 | indicated. Back to the shell buffer, re-execute the previous command. |
| 523 | IDL stops at the line with the breakpoint. Now hold down the SHIFT key | 568 | IDL stops at the line with the breakpoint. Now hold down the SHIFT |
| 524 | and click with the middle mouse button on a few variables there: | 569 | key and click with the middle mouse button on a few variables there: |
| 525 | @samp{d}, @samp{y}, @samp{m}, @samp{y1}, etc. Maybe @code{d} isn't the | 570 | @samp{d}, @samp{y}, @samp{m}, @samp{y1}, etc. Maybe @code{d} isn't |
| 526 | correct type. CONTROL-SHIFT middle-click on it for help. Well, it's an | 571 | the correct type. CONTROL-SHIFT middle-click on it for help. Well, |
| 527 | integer, so that's not the problem. Aha, @samp{y1} is zero, but it | 572 | it's an integer, so that's not the problem. Aha, @samp{y1} is zero, |
| 528 | should be the year, depending on delta. Shift click @samp{delta} to see | 573 | but it should be the year, depending on delta. Shift click |
| 529 | that it's 0. Below, we see the offending line: @samp{y1=y*delta...} the | 574 | @samp{delta} to see that it's 0. Below, we see the offending line: |
| 530 | multiplication should have been a minus sign! So fix the line to read: | 575 | @samp{y1=y*delta...} the multiplication should have been a minus sign! |
| 576 | Hit @kbd{q} to exit the debugging mode, and fix the line to read: | ||
| 531 | 577 | ||
| 532 | @example | 578 | @example |
| 533 | y1 = y - delta | 579 | y1 = y - delta |
| @@ -538,15 +584,15 @@ command. Everything should now work fine. How about those leap years? | |||
| 538 | Change the code to plot 100 years and see that every 28 years, the | 584 | Change the code to plot 100 years and see that every 28 years, the |
| 539 | sequence of weekdays repeats. | 585 | sequence of weekdays repeats. |
| 540 | 586 | ||
| 541 | @node Lesson II -- Customization, Lesson III -- Library Catalog, Lesson I -- Development Cycle, Getting Started | 587 | @node Lesson II -- Customization, Lesson III -- User Catalog, Lesson I -- Development Cycle, Getting Started |
| 542 | @section Lesson II: Customization | 588 | @section Lesson II: Customization |
| 543 | 589 | ||
| 544 | Emacs is probably the most customizable piece of software available, and | 590 | Emacs is probably the most customizable piece of software ever |
| 545 | it would be a shame if you did not make use of this and adapt IDLWAVE to | 591 | written, and it would be a shame if you did not make use of this and |
| 546 | your own preferences. Customizing Emacs or IDLWAVE is accomplished by | 592 | adapt IDLWAVE to your own preferences. Customizing Emacs or IDLWAVE |
| 547 | setting Lisp variables in the @file{.emacs} file in your home directory | 593 | is accomplished by setting Lisp variables in the @file{.emacs} file in |
| 548 | --- but do not be dismayed; for the most part, you can just copy and work | 594 | your home directory --- but do not be dismayed; for the most part, you |
| 549 | from the examples given here. | 595 | can just copy and work from the examples given here. |
| 550 | 596 | ||
| 551 | Let's first use a boolean variable. These are variables which you turn | 597 | Let's first use a boolean variable. These are variables which you turn |
| 552 | on or off, much like a checkbox. A value of @samp{t} means on, a value | 598 | on or off, much like a checkbox. A value of @samp{t} means on, a value |
| @@ -561,7 +607,8 @@ When this option is turned on, each reserved word you type into an IDL | |||
| 561 | source buffer will be converted to upper case when you press @key{SPC} | 607 | source buffer will be converted to upper case when you press @key{SPC} |
| 562 | or @key{RET} right after the word. Try it out! @samp{if} changes to | 608 | or @key{RET} right after the word. Try it out! @samp{if} changes to |
| 563 | @samp{IF}, @samp{begin} to @samp{BEGIN}. If you don't like this | 609 | @samp{IF}, @samp{begin} to @samp{BEGIN}. If you don't like this |
| 564 | behavior, remove the option again from your @file{.emacs} file. | 610 | behavior, remove the option again from your @file{.emacs} file and |
| 611 | restart Emacs. | ||
| 565 | 612 | ||
| 566 | You likely have your own indentation preferences for IDL code. For | 613 | You likely have your own indentation preferences for IDL code. For |
| 567 | example, some like to indent the main block of an IDL program from the | 614 | example, some like to indent the main block of an IDL program from the |
| @@ -588,50 +635,52 @@ there is another, more user-friendly way to customize all the IDLWAVE | |||
| 588 | variables. You can access it through the IDLWAVE menu in one of the | 635 | variables. You can access it through the IDLWAVE menu in one of the |
| 589 | @file{.pro} buffers, menu item @code{Customize->Browse IDLWAVE | 636 | @file{.pro} buffers, menu item @code{Customize->Browse IDLWAVE |
| 590 | Group}. Here you'll be presented with all the various variables grouped | 637 | Group}. Here you'll be presented with all the various variables grouped |
| 591 | into categories. You can navigate the hierarchy (e.g. Idlwave Code | 638 | into categories. You can navigate the hierarchy (e.g. @samp{IDLWAVE |
| 592 | Formatting->Idlwave Main Block Indent), read about the variables, change | 639 | Code Formatting->Idlwave Abbrev And Indent Action->Idlwave Expand |
| 593 | them, and `Save for Future Sessions'. Few of these variables need | 640 | Generic End} to turn on @code{END} expansion), read about the variables, |
| 594 | customization, but you can exercise considerable control over IDLWAVE's | 641 | change them, and `Save for Future Sessions'. Few of these variables |
| 595 | functionality with them. | 642 | need customization, but you can exercise considerable control over |
| 643 | IDLWAVE's functionality with them. | ||
| 596 | 644 | ||
| 597 | You may also find the key bindings used for the debugging commands too | 645 | You may also find the key bindings used for the debugging commands too |
| 598 | long and complicated. Often we have heard such complaints, ``Do I | 646 | long and complicated. Often we have heard complaints along the lines |
| 599 | really have to type @kbd{C-c C-d C-c} to run a simple command?'' Due to | 647 | of, ``Do I really have to go through the finger gymnastics of @kbd{C-c |
| 600 | Emacs rules and conventions, shorter bindings cannot be set by default, | 648 | C-d C-c} to run a simple command?'' Due to Emacs rules and |
| 601 | but you can enable them. First, there is a way to assign all debugging | 649 | conventions, shorter bindings cannot be set by default, but you can |
| 602 | commands in a single sweep to other combinations. The only problem is | 650 | easily enable them. First, there is a way to assign all debugging |
| 603 | that we have to use something which Emacs does not need for other | 651 | commands in a single sweep to another simpler combination. The only |
| 604 | important commands. One good option is to execute debugging commands by | 652 | problem is that we have to use something which Emacs does not need for |
| 605 | holding down @key{CONTROL} and @key{SHIFT} while pressing a single | 653 | other important commands. One good option is to execute debugging |
| 606 | character: @kbd{C-S-b} for setting a breakpoint, @kbd{C-S-c} for | 654 | commands by holding down @key{CONTROL} and @key{SHIFT} while pressing |
| 607 | compiling the current source file, @kbd{C-S-a} for deleting all | 655 | a single character: @kbd{C-S-b} for setting a breakpoint, @kbd{C-S-c} |
| 608 | breakpoints. You can enable this with: | 656 | for compiling the current source file, @kbd{C-S-a} for deleting all |
| 657 | breakpoints (try it, it's easier). You can enable this with: | ||
| 609 | 658 | ||
| 610 | @lisp | 659 | @lisp |
| 611 | (setq idlwave-shell-debug-modifiers '(shift control)) | 660 | (setq idlwave-shell-debug-modifiers '(shift control)) |
| 612 | @end lisp | 661 | @end lisp |
| 613 | 662 | ||
| 614 | @noindent If you have a special keyboard with, for example, a | 663 | @noindent If you have a special keyboard with, for example, a |
| 615 | @key{HYPER} key, you could even shorten that: | 664 | @key{SUPER} key, you could even shorten that: |
| 616 | 665 | ||
| 617 | @lisp | 666 | @lisp |
| 618 | (setq idlwave-shell-debug-modifiers '(hyper)) | 667 | (setq idlwave-shell-debug-modifiers '(super)) |
| 619 | @end lisp | 668 | @end lisp |
| 620 | 669 | ||
| 621 | @noindent to get compilation on @kbd{H-c}. Often, a modifier key like | 670 | @noindent to get compilation on @kbd{S-c}. Often, a modifier key like |
| 622 | @key{HYPER} or @key{SUPER} is bound or can be bound to an otherwise | 671 | @key{SUPER} or @key{HYPER} is bound or can be bound to an otherwise |
| 623 | unused key -- consult your system documentation. | 672 | unused key on your keyboard --- consult your system documentation. |
| 624 | 673 | ||
| 625 | You can also assign specific commands to keys. This you must do in the | 674 | You can also assign specific commands to keys. This you must do in the |
| 626 | @emph{mode-hook}, a special function which is run when a new buffer gets | 675 | @emph{mode-hook}, a special function which is run when a new IDLWAVE |
| 627 | set up. Keybindings can only be done when the buffer exists. The | 676 | buffer gets set up. The possibilities for key customization are |
| 628 | possibilities for key customization are endless. Here we set function | 677 | endless. Here we set function keys f4-f8 to common debugging commands. |
| 629 | keys f5-f8 to common debugging commands. | ||
| 630 | 678 | ||
| 631 | @lisp | 679 | @lisp |
| 632 | ;; First for the source buffer | 680 | ;; First for the source buffer |
| 633 | (add-hook 'idlwave-mode-hook | 681 | (add-hook 'idlwave-mode-hook |
| 634 | (lambda () | 682 | (lambda () |
| 683 | (local-set-key [f4] 'idlwave-shell-retall) | ||
| 635 | (local-set-key [f5] 'idlwave-shell-break-here) | 684 | (local-set-key [f5] 'idlwave-shell-break-here) |
| 636 | (local-set-key [f6] 'idlwave-shell-clear-current-bp) | 685 | (local-set-key [f6] 'idlwave-shell-clear-current-bp) |
| 637 | (local-set-key [f7] 'idlwave-shell-cont) | 686 | (local-set-key [f7] 'idlwave-shell-cont) |
| @@ -639,43 +688,53 @@ keys f5-f8 to common debugging commands. | |||
| 639 | ;; Then for the shell buffer | 688 | ;; Then for the shell buffer |
| 640 | (add-hook 'idlwave-shell-mode-hook | 689 | (add-hook 'idlwave-shell-mode-hook |
| 641 | (lambda () | 690 | (lambda () |
| 691 | (local-set-key [f4] 'idlwave-shell-retall) | ||
| 642 | (local-set-key [f5] 'idlwave-shell-break-here) | 692 | (local-set-key [f5] 'idlwave-shell-break-here) |
| 643 | (local-set-key [f6] 'idlwave-shell-clear-current-bp) | 693 | (local-set-key [f6] 'idlwave-shell-clear-current-bp) |
| 644 | (local-set-key [f7] 'idlwave-shell-cont) | 694 | (local-set-key [f7] 'idlwave-shell-cont) |
| 645 | (local-set-key [f8] 'idlwave-shell-clear-all-bp))) | 695 | (local-set-key [f8] 'idlwave-shell-clear-all-bp))) |
| 646 | @end lisp | 696 | @end lisp |
| 647 | 697 | ||
| 648 | @node Lesson III -- Library Catalog, , Lesson II -- Customization, Getting Started | 698 | @node Lesson III -- User Catalog, , Lesson II -- Customization, Getting Started |
| 649 | @section Lesson III: Library Catalog | 699 | @section Lesson III: User and Library Catalogs |
| 650 | 700 | ||
| 651 | We have already used the routine info display in the first part of this | 701 | We have already used the routine info display in the first part of this |
| 652 | tutorial. This was the key @kbd{C-c ?} which displays information about | 702 | tutorial. This was the invoked using @kbd{C-c ?}, and displays |
| 653 | the IDL routine near the cursor position. Wouldn't it be nice | 703 | information about the IDL routine near the cursor position. Wouldn't it |
| 654 | to have the same available for your own library routines and for the | 704 | be nice to have the same kind of information available for your own |
| 655 | huge amount of code in major extension libraries like JHUPL or the | 705 | routines and for the huge amount of code in major libraries like JHUPL |
| 656 | IDL-Astro library? To do this, you must give IDLWAVE a chance to study | 706 | or the IDL-Astro library? In many cases, you may already have this |
| 657 | these routines first. We call this @emph{Building the library catalog}. | 707 | information. Files named @file{.idlwave_catalog} in library directories |
| 658 | 708 | contain scanned information on the routines in that directory; many | |
| 659 | From the IDLWAVE entry in the menu bar, select @code{Routine Info/Select | 709 | popular libraries ship with these ``library catalogs'' pre-scanned. |
| 660 | Catalog Directories}. If necessary, start the shell first with @kbd{C-c | 710 | Users can scan their own routines in one of two ways: either using the |
| 661 | C-s} (@pxref{Starting the Shell}). IDLWAVE will find out about the IDL | 711 | supplied tool to scan directories and build their own |
| 662 | @code{!PATH} variable and offer a list of directories on the path. | 712 | @file{.idlwave_catalog} files, or using the built-in method to create a |
| 663 | Simply select them all (or whichever you want) and click on the | 713 | single ``user catalog'', which we'll show here. @xref{Catalogs}, for |
| 664 | @samp{Scan&Save} button. Then go for a cup of coffee while IDLWAVE | 714 | more information on choosing which method to use. |
| 665 | collects information for each and every IDL routine on your search path. | 715 | |
| 666 | All this information is written to the file @file{.idlcat} in your home | 716 | To build a user catalog, select @code{Routine Info/Select Catalog |
| 667 | directory and will from now one be automatically loaded whenever you use | 717 | Directories} from the IDLWAVE entry in the menu bar. If necessary, |
| 718 | start the shell first with @kbd{C-c C-s} (@pxref{Starting the Shell}). | ||
| 719 | IDLWAVE will find out about the IDL @code{!PATH} variable and offer a | ||
| 720 | list of directories on the path. Simply select them all (or whichever | ||
| 721 | you want --- directories with existing library catalogs will not be | ||
| 722 | selected by default) and click on the @samp{Scan&Save} button. Then | ||
| 723 | go for a cup of coffee while IDLWAVE collects information for each and | ||
| 724 | every IDL routine on your search path. All this information is | ||
| 725 | written to the file @file{.idlwave/idlusercat.el} in your home | ||
| 726 | directory and will from now on automatically load whenever you use | ||
| 668 | IDLWAVE. You may find it necessary to rebuild the catalog on occasion | 727 | IDLWAVE. You may find it necessary to rebuild the catalog on occasion |
| 669 | as your local libraries change. Try to use routine info (@kbd{C-c ?}) | 728 | as your local libraries change, or build a library catalog for those |
| 670 | or completion (@kbd{M-@key{TAB}}) while on any routine or partial routine | 729 | directories instead. Invoke routine info (@kbd{C-c ?}) or completion |
| 671 | name you know to be located in the library. E.g., if you have scanned | 730 | (@kbd{M-@key{TAB}}) on any routine or partial routine name you know to |
| 672 | the IDL-Astro library: | 731 | be located in the library. E.g., if you have scanned the IDL-Astro |
| 732 | library: | ||
| 673 | 733 | ||
| 674 | @example | 734 | @example |
| 675 | a=readf@key{M-<TAB>} | 735 | a=readf@key{M-@key{TAB}} |
| 676 | @end example | 736 | @end example |
| 677 | 737 | ||
| 678 | |||
| 679 | expands to `readfits('. Then try | 738 | expands to `readfits('. Then try |
| 680 | 739 | ||
| 681 | @example | 740 | @example |
| @@ -690,11 +749,11 @@ Usage: Result = READFITS(filename, header, heap) | |||
| 690 | @end example | 749 | @end example |
| 691 | 750 | ||
| 692 | I hope you made it until here. Now you are set to work with IDLWAVE. | 751 | I hope you made it until here. Now you are set to work with IDLWAVE. |
| 693 | On the way you will want to change other things, and to learn more about | 752 | On the way you will want to change other things, and to learn more |
| 694 | the possibilities not discussed in this short tutorial. Read the | 753 | about the possibilities not discussed in this short tutorial. Read |
| 695 | manual, look at the documentation strings of interesting variables (with | 754 | the manual, look at the documentation strings of interesting variables |
| 696 | @kbd{C-h v idlwave<-variable-name> @key{RET}}) and ask the remaining | 755 | (with @kbd{C-h v idlwave<-variable-name> @key{RET}}) and ask the |
| 697 | questions on the newsgroup @code{comp.lang.idl-pvwave}. | 756 | remaining questions on the newsgroup @code{comp.lang.idl-pvwave}. |
| 698 | 757 | ||
| 699 | @node The IDLWAVE Major Mode, The IDLWAVE Shell, Getting Started, Top | 758 | @node The IDLWAVE Major Mode, The IDLWAVE Shell, Getting Started, Top |
| 700 | @chapter The IDLWAVE Major Mode | 759 | @chapter The IDLWAVE Major Mode |
| @@ -727,35 +786,26 @@ them. | |||
| 727 | 786 | ||
| 728 | @menu | 787 | @menu |
| 729 | * Code Indentation:: Reflecting the logical structure | 788 | * Code Indentation:: Reflecting the logical structure |
| 730 | * Continued Statement Indentation:: | 789 | * Continued Statement Indentation:: |
| 731 | * Comment Indentation:: Special indentation for comment lines | 790 | * Comment Indentation:: Special indentation for comment lines |
| 732 | * Continuation Lines:: Splitting statements over lines | 791 | * Continuation Lines:: Splitting statements over lines |
| 733 | * Syntax Highlighting:: Font-lock support | 792 | * Syntax Highlighting:: Font-lock support |
| 734 | * Octals and Highlighting:: Why "123 causes problems | 793 | * Octals and Highlighting:: Why "123 causes problems |
| 735 | @end menu | 794 | @end menu |
| 736 | 795 | ||
| 737 | The IDL language, with it's early roots in FORTRAN, modern | 796 | The IDL language, with its early roots in FORTRAN, modern |
| 738 | implementation in C, and liberal borrowing of features of many vector | 797 | implementation in C, and liberal borrowing of features of many vector |
| 739 | languages along its 25+ year history, has inherited an unusual mix of | 798 | and other languages along its 25+ year history, has inherited an |
| 740 | syntax elements. Left to his or her own devices, a novice IDL | 799 | unusual mix of syntax elements. Left to his or her own devices, a |
| 741 | programmer will often conjure code which is very difficult to read and | 800 | novice IDL programmer will often conjure code which is very difficult |
| 742 | impossible to adapt. Much can be gleaned from studying available IDL | 801 | to read and impossible to adapt. Much can be gleaned from studying |
| 743 | code libraries for coding style pointers, but, due to the variety of | 802 | available IDL code libraries for coding style pointers, but, due to |
| 744 | IDL syntax elements, replicating this style can be challenging at | 803 | the variety of IDL syntax elements, replicating this style can be |
| 745 | best. Luckily, IDLWAVE understands the structure of IDL code very | 804 | challenging at best. Luckily, IDLWAVE understands the structure of |
| 746 | well, and takes care of almost all formatting issues for you. After | 805 | IDL code very well, and takes care of almost all formatting issues for |
| 747 | configuring it to match your coding standards, you can rely on it to | 806 | you. After configuring it to match your coding standards, you can |
| 748 | help keep your code neat and organized. | 807 | rely on it to help keep your code neat and organized. |
| 749 | 808 | ||
| 750 | @cindex Foreign code, adapting | ||
| 751 | @cindex Indentation, of foreign code | ||
| 752 | @kindex C-M-\ | ||
| 753 | To re-indent a larger portion of code (e.g. when working with foreign code | ||
| 754 | written with different conventions), use @kbd{C-M-\} | ||
| 755 | (@code{indent-region}) after marking the relevant code. Useful marking | ||
| 756 | commands are @kbd{C-x h} (the entire file) or @kbd{C-M-h} (the | ||
| 757 | current subprogram). @xref{Actions}, for information how to impose | ||
| 758 | additional formatting conventions on foreign code. | ||
| 759 | 809 | ||
| 760 | @node Code Indentation, Continued Statement Indentation, Code Formatting, Code Formatting | 810 | @node Code Indentation, Continued Statement Indentation, Code Formatting, Code Formatting |
| 761 | @subsection Code Indentation | 811 | @subsection Code Indentation |
| @@ -769,7 +819,17 @@ governed by a number of variables. IDLWAVE indents blocks (between | |||
| 769 | @code{PRO}/@code{FUNCTION}/@code{BEGIN} and @code{END}), and | 819 | @code{PRO}/@code{FUNCTION}/@code{BEGIN} and @code{END}), and |
| 770 | continuation lines. | 820 | continuation lines. |
| 771 | 821 | ||
| 772 | @defopt idlwave-main-block-indent (@code{0}) | 822 | @cindex Foreign code, adapting |
| 823 | @cindex Indentation, of foreign code | ||
| 824 | @kindex C-M-\ | ||
| 825 | To re-indent a larger portion of code (e.g. when working with foreign code | ||
| 826 | written with different conventions), use @kbd{C-M-\} | ||
| 827 | (@code{indent-region}) after marking the relevant code. Useful marking | ||
| 828 | commands are @kbd{C-x h} (the entire file) or @kbd{C-M-h} (the | ||
| 829 | current subprogram). @xref{Actions}, for information how to impose | ||
| 830 | additional formatting conventions on foreign code. | ||
| 831 | |||
| 832 | @defopt idlwave-main-block-indent (@code{0}) | ||
| 773 | Extra indentation for the main block of code. That is the block between | 833 | Extra indentation for the main block of code. That is the block between |
| 774 | the FUNCTION/PRO statement and the END statement for that program | 834 | the FUNCTION/PRO statement and the END statement for that program |
| 775 | unit. | 835 | unit. |
| @@ -827,12 +887,16 @@ indentation by setting the variable | |||
| 827 | maximum additional indentation beyond the basic indent to be | 887 | maximum additional indentation beyond the basic indent to be |
| 828 | tolerated, otherwise defaulting to a fixed-offset from the enclosing | 888 | tolerated, otherwise defaulting to a fixed-offset from the enclosing |
| 829 | indent (the size of which offset is set in | 889 | indent (the size of which offset is set in |
| 830 | @code{idlwave-continuation-indent}). Also, since the indentation | 890 | @code{idlwave-continuation-indent}). As a special case, continuations |
| 831 | level can be somewhat dynamic in continued statements with special | 891 | of routine calls without any arguments or keywords will @emph{not} |
| 832 | continuation indentation, especially if | 892 | align the continued line, under the assumption that you continued |
| 893 | because you needed the space. | ||
| 894 | |||
| 895 | Also, since the indentation level can be somewhat dynamic in continued | ||
| 896 | statements with special continuation indentation, especially if | ||
| 833 | @code{idlwave-max-extra-continuation-indent} is small, the key | 897 | @code{idlwave-max-extra-continuation-indent} is small, the key |
| 834 | @kbd{C-u @key{TAB}} will re-indent all lines in the current statement. | 898 | @kbd{C-u @key{TAB}} will re-indent all lines in the current statement. |
| 835 | Note that @code{idlwave-indent-to-open-paren}, if non-@code{nil}, overrides | 899 | Note that @code{idlwave-indent-to-open-paren}, if non-nil, overrides |
| 836 | the @code{idlwave-max-extra-continuation-indent} limit, for | 900 | the @code{idlwave-max-extra-continuation-indent} limit, for |
| 837 | parentheses only, forcing them always to line up. | 901 | parentheses only, forcing them always to line up. |
| 838 | 902 | ||
| @@ -966,7 +1030,7 @@ in the first line of a comment paragraph. | |||
| 966 | 1030 | ||
| 967 | @defopt idlwave-use-last-hang-indent (@code{nil}) | 1031 | @defopt idlwave-use-last-hang-indent (@code{nil}) |
| 968 | Non-@code{nil} means use last match on line for | 1032 | Non-@code{nil} means use last match on line for |
| 969 | @code{idlwave-indent-regexp}. | 1033 | @code{idlwave-indent-regexp}. |
| 970 | @end defopt | 1034 | @end defopt |
| 971 | 1035 | ||
| 972 | @node Syntax Highlighting, Octals and Highlighting, Continuation Lines, Code Formatting | 1036 | @node Syntax Highlighting, Octals and Highlighting, Continuation Lines, Code Formatting |
| @@ -994,7 +1058,7 @@ for highlighting using the variable | |||
| 994 | 1058 | ||
| 995 | @defopt idlwave-default-font-lock-items | 1059 | @defopt idlwave-default-font-lock-items |
| 996 | Items which should be fontified on the default fontification level | 1060 | Items which should be fontified on the default fontification level |
| 997 | 2. | 1061 | 2. |
| 998 | @end defopt | 1062 | @end defopt |
| 999 | 1063 | ||
| 1000 | @node Octals and Highlighting, , Syntax Highlighting, Code Formatting | 1064 | @node Octals and Highlighting, , Syntax Highlighting, Code Formatting |
| @@ -1002,12 +1066,12 @@ Items which should be fontified on the default fontification level | |||
| 1002 | @cindex Syntax highlighting, Octals | 1066 | @cindex Syntax highlighting, Octals |
| 1003 | @cindex Highlighting of syntax, Octals | 1067 | @cindex Highlighting of syntax, Octals |
| 1004 | 1068 | ||
| 1005 | A rare syntax highlighting problem results from the extremely | 1069 | A rare syntax highlighting problem results from an extremely unfortunate |
| 1006 | unfortunate notation for octal numbers in IDL: @code{"123}. This | 1070 | notation for octal numbers in IDL: @code{"123}. This unpaired quotation |
| 1007 | unpaired quotation mark is very difficult to parse, given that it can be | 1071 | mark is very difficult to parse, given that it can be mixed on a single |
| 1008 | mixed on a single line with any number of strings. Emacs will | 1072 | line with any number of strings. Emacs will incorrectly identify this |
| 1009 | incorrectly identify this as a string, and the highlighting of following | 1073 | as a string, and the highlighting of following lines of code can be |
| 1010 | lines of code can be distorted, since the string is never terminated. | 1074 | distorted, since the string is never terminated. |
| 1011 | 1075 | ||
| 1012 | One solution to this involves terminating the mistakenly identified | 1076 | One solution to this involves terminating the mistakenly identified |
| 1013 | string yourself by providing a closing quotation mark in a comment: | 1077 | string yourself by providing a closing quotation mark in a comment: |
| @@ -1041,15 +1105,16 @@ and object methods, and large libraries typically contain hundreds or | |||
| 1041 | even thousands more (each with a few to tens of keywords and | 1105 | even thousands more (each with a few to tens of keywords and |
| 1042 | arguments). This large command set can make it difficult to remember | 1106 | arguments). This large command set can make it difficult to remember |
| 1043 | the calling sequence and keywords for the routines you use, but | 1107 | the calling sequence and keywords for the routines you use, but |
| 1044 | IDLWAVE can help. It builds up routine information using a wide | 1108 | IDLWAVE can help. It builds up routine information from a wide |
| 1045 | variety of sources: IDLWAVE in fact knows far more about the routines | 1109 | variety of sources; IDLWAVE in fact knows far more about the |
| 1046 | on your system than IDL itself. It maintains a list of all built-in | 1110 | @samp{.pro} routines on your system than IDL itself! It maintains a |
| 1047 | routines, with calling sequences and keywords@footnote{This list is | 1111 | list of all built-in routines, with calling sequences and |
| 1048 | created by scanning the IDL manuals and might contain (very few) | 1112 | keywords@footnote{This list is created by scanning the IDL manuals and |
| 1049 | errors. Please report any errors to the maintainer, so that they can | 1113 | might contain (very few) errors. Please report any errors to the |
| 1050 | be fixed.}. It also scans Emacs buffers and library files for routine | 1114 | maintainer, so that they can be fixed.}. It also scans Emacs buffers |
| 1051 | definitions, and queries the IDLWAVE-Shell for information about | 1115 | for routine definitions, queries the IDLWAVE-Shell for information |
| 1052 | routines currently compiled there. This information is updated | 1116 | about routines currently compiled there, and automatically locates |
| 1117 | library and user-created catalogs. This information is updated | ||
| 1053 | automatically, and so should usually be current. To force a global | 1118 | automatically, and so should usually be current. To force a global |
| 1054 | update and refresh the routine information, use @kbd{C-c C-i} | 1119 | update and refresh the routine information, use @kbd{C-c C-i} |
| 1055 | (@code{idlwave-update-routine-info}). | 1120 | (@code{idlwave-update-routine-info}). |
| @@ -1071,13 +1136,13 @@ plot,x,alog(x+5*sin(x) + 2), | |||
| 1071 | On positions 1,2 and 8, information about the @samp{plot} procedure will | 1136 | On positions 1,2 and 8, information about the @samp{plot} procedure will |
| 1072 | be shown. On positions 3,4, and 7, the @samp{alog} function will be | 1137 | be shown. On positions 3,4, and 7, the @samp{alog} function will be |
| 1073 | described, while positions 5 and 6 will investigate the @samp{sin} | 1138 | described, while positions 5 and 6 will investigate the @samp{sin} |
| 1074 | function. | 1139 | function. |
| 1075 | 1140 | ||
| 1076 | When you ask for routine information about an object method, and the | 1141 | When you ask for routine information about an object method, and the |
| 1077 | method exists in several classes, IDLWAVE queries for the class of the | 1142 | method exists in several classes, IDLWAVE queries for the class of the |
| 1078 | object, unless the class is already known through a text property on the | 1143 | object, unless the class is already known through a text property on the |
| 1079 | @samp{->} operator (@pxref{Object Method Completion and Class | 1144 | @samp{->} operator (@pxref{Object Method Completion and Class |
| 1080 | Ambiguity}), or by having been explicitly included in the call | 1145 | Ambiguity}), or by having been explicity included in the call |
| 1081 | (e.g. @code{a->myclass::Foo}). | 1146 | (e.g. @code{a->myclass::Foo}). |
| 1082 | 1147 | ||
| 1083 | @cindex Calling sequences | 1148 | @cindex Calling sequences |
| @@ -1090,7 +1155,7 @@ keywords and the source location of this routine. It looks like this: | |||
| 1090 | Usage: XMANAGER, NAME, ID | 1155 | Usage: XMANAGER, NAME, ID |
| 1091 | Keywords: BACKGROUND CATCH CLEANUP EVENT_HANDLER GROUP_LEADER | 1156 | Keywords: BACKGROUND CATCH CLEANUP EVENT_HANDLER GROUP_LEADER |
| 1092 | JUST_REG MODAL NO_BLOCK | 1157 | JUST_REG MODAL NO_BLOCK |
| 1093 | Source: SystemLib [CSB] /soft1/idl53/lib/xmanager.pro | 1158 | Source: SystemLib [LCSB] /soft1/idl53/lib/xmanager.pro |
| 1094 | @end example | 1159 | @end example |
| 1095 | 1160 | ||
| 1096 | @cindex Categories, of routines | 1161 | @cindex Categories, of routines |
| @@ -1102,20 +1167,22 @@ Source: SystemLib [CSB] /soft1/idl53/lib/xmanager.pro | |||
| 1102 | @cindex @code{!DIR}, IDL variable | 1167 | @cindex @code{!DIR}, IDL variable |
| 1103 | 1168 | ||
| 1104 | If a definition of this routine exists in several files accessible to | 1169 | If a definition of this routine exists in several files accessible to |
| 1105 | IDLWAVE, several @samp{Source} lines will point to the different files. | 1170 | IDLWAVE, several @samp{Source} lines will point to the different |
| 1106 | This may indicate that your routine is shadowing a library routine, | 1171 | files. This may indicate that your routine is shadowing a system |
| 1107 | which may or may not be what you want (@pxref{Load-Path Shadows}). The | 1172 | library routine, which may or may not be what you want |
| 1108 | information about the calling sequence and keywords is derived from the | 1173 | (@pxref{Load-Path Shadows}). The information about the calling |
| 1109 | first source listed. Library routines are supported only if you have | 1174 | sequence and keywords is derived from the first source listed. |
| 1110 | scanned your local IDL libraries (@pxref{Library Catalog}). The source | 1175 | Library routines are available only if you have scanned your local IDL |
| 1111 | entry consists of a @emph{source category}, a set of @emph{flags} and | 1176 | directories or are using pre-scanned libraries (@pxref{Catalogs}). |
| 1112 | the path to the @emph{source file}. The following categories exist: | 1177 | The source entry consists of a @emph{source category}, a set of |
| 1178 | @emph{flags} and the path to the @emph{source file}. The following | ||
| 1179 | default categories exist: | ||
| 1113 | 1180 | ||
| 1114 | @multitable @columnfractions .15 .85 | 1181 | @multitable @columnfractions .15 .85 |
| 1115 | @item @i{System} | 1182 | @item @i{System} |
| 1116 | @tab A system routine of unknown origin. When the system library has | 1183 | @tab A system routine of unknown origin. When the system library has |
| 1117 | been scanned (@pxref{Library Catalog}), this category will automatically | 1184 | been scanned as part of a catalog (@pxref{Catalogs}), this category |
| 1118 | split into the next two. | 1185 | will automatically split into the next two. |
| 1119 | @item @i{Builtin} | 1186 | @item @i{Builtin} |
| 1120 | @tab A builtin system routine with no source code available. | 1187 | @tab A builtin system routine with no source code available. |
| 1121 | @item @i{SystemLib} | 1188 | @item @i{SystemLib} |
| @@ -1127,27 +1194,28 @@ split into the next two. | |||
| 1127 | @item @i{Other} | 1194 | @item @i{Other} |
| 1128 | @tab Any other routine with a file not known to be on the search path. | 1195 | @tab Any other routine with a file not known to be on the search path. |
| 1129 | @item @i{Unresolved} | 1196 | @item @i{Unresolved} |
| 1130 | @tab An otherwise unkown routine the shell lists as unresolved | 1197 | @tab An otherwise unkown routine the shell lists as unresolved |
| 1131 | (referenced, but not compiled). | 1198 | (referenced, but not compiled). |
| 1132 | @end multitable | 1199 | @end multitable |
| 1133 | 1200 | ||
| 1134 | You can create additional categories based on the routine's filepath | 1201 | Any routines discovered in library catalogs (@pxref{Library |
| 1135 | with the variable @code{idlwave-special-lib-alist}. This is useful for | 1202 | Catalogs}), will display the category assigned during creation, |
| 1136 | easy discrimination of various libraries, or even versions of the same | 1203 | e.g. @samp{NasaLib}. For routines not discovered in this way, you can |
| 1137 | library. | 1204 | create additional categories based on the routine's filename using the |
| 1205 | variable @code{idlwave-special-lib-alist}. | ||
| 1138 | 1206 | ||
| 1139 | @cindex Flags, in routine info | 1207 | @cindex Flags, in routine info |
| 1140 | @cindex Duplicate routines | 1208 | @cindex Duplicate routines |
| 1141 | @cindex Multiply defined routines | 1209 | @cindex Multiply defined routines |
| 1142 | @cindex Routine definitions, multiple | 1210 | @cindex Routine definitions, multiple |
| 1143 | The flags @code{[CSB]} indicate the source of the information IDLWAVE | 1211 | The flags @code{[LCSB]} indicate the source of the information IDLWAVE |
| 1144 | has regarding the file: from a library catalog (@w{@code{[C--]}}, | 1212 | has regarding the file: from a library catalog (@w{@code{[L---]}}), |
| 1145 | @pxref{Library Catalog}), from the IDL Shell (@w{@code{[-S-]}}) or from | 1213 | from a user catalog (@w{@code{[-C--]}}, from the IDL Shell |
| 1146 | an Emacs buffer (@w{@code{[--B]}}). Combinations are possible (a | 1214 | (@w{@code{[--S-]}}) or from an Emacs buffer (@w{@code{[---B]}}). |
| 1147 | compiled library routine visited in a buffer might read | 1215 | Combinations are possible (a compiled library routine visited in a |
| 1148 | @w{@code{[CSB]}}). If a file contains multiple definitions of the same | 1216 | buffer might read @w{@code{[L-SB]}}). If a file contains multiple |
| 1149 | routine, the file name will be prefixed with @samp{(Nx)} where @samp{N} | 1217 | definitions of the same routine, the file name will be prefixed with |
| 1150 | is the number of definitions. | 1218 | @samp{(Nx)} where @samp{N} is the number of definitions. |
| 1151 | 1219 | ||
| 1152 | @cindex Online Help from the routine info buffer | 1220 | @cindex Online Help from the routine info buffer |
| 1153 | @cindex Active text, in routine info | 1221 | @cindex Active text, in routine info |
| @@ -1162,7 +1230,7 @@ with the middle mouse button inserts keywords or visits files: | |||
| 1162 | @item @i{Usage} | 1230 | @item @i{Usage} |
| 1163 | @tab If online help is installed, a click with the @emph{right} mouse | 1231 | @tab If online help is installed, a click with the @emph{right} mouse |
| 1164 | button on the @i{Usage:} line will access the help for the | 1232 | button on the @i{Usage:} line will access the help for the |
| 1165 | routine (@pxref{Online Help}). | 1233 | routine (@pxref{Online Help}). |
| 1166 | @item @i{Keyword} | 1234 | @item @i{Keyword} |
| 1167 | @tab Online help about keywords is also available with the | 1235 | @tab Online help about keywords is also available with the |
| 1168 | @emph{right} mouse button. Clicking on a keyword with the @emph{middle} | 1236 | @emph{right} mouse button. Clicking on a keyword with the @emph{middle} |
| @@ -1198,54 +1266,32 @@ Maximum number of source files displayed in the Routine Info window. | |||
| 1198 | @end defopt | 1266 | @end defopt |
| 1199 | 1267 | ||
| 1200 | 1268 | ||
| 1269 | @ifhtml | ||
| 1270 | <A NAME="ONLINE_HELP"></A> | ||
| 1271 | @end ifhtml | ||
| 1201 | @node Online Help, Completion, Routine Info, The IDLWAVE Major Mode | 1272 | @node Online Help, Completion, Routine Info, The IDLWAVE Major Mode |
| 1202 | @section Online Help | 1273 | @section Online Help |
| 1203 | 1274 | ||
| 1204 | @cindex Online Help | 1275 | @cindex Online Help |
| 1205 | @cindex @file{idlw-help.txt} | 1276 | @cindex @file{idlw-help.txt} |
| 1206 | @cindex @file{idlw-help.el} | 1277 | @cindex @file{idlw-help.el} |
| 1207 | @cindex IDL manual, ASCII version | ||
| 1208 | @cindex Installing online help | 1278 | @cindex Installing online help |
| 1209 | @cindex Online Help, Installation | 1279 | @cindex Online Help, Installation |
| 1210 | @cindex Speed, of online help | 1280 | @cindex Speed, of online help |
| 1211 | For IDL system routines, RSI provides extensive documentation. IDLWAVE | ||
| 1212 | can access an ASCII version of this documentation very quickly and | ||
| 1213 | accurately. This is @emph{much} faster than using the IDL online help | ||
| 1214 | application, because IDLWAVE usually gets you to the right place in the | ||
| 1215 | documentation directly, without any additional browsing and scrolling. | ||
| 1216 | For this online help to work, an ASCII version of the IDL documentation, | ||
| 1217 | which is not part of the standalone IDLWAVE distribution, is required. | ||
| 1218 | The necessary help files can be downloaded from | ||
| 1219 | @uref{@value{IDLWAVE-HOMEPAGE}, the maintainers webpage}. The text | ||
| 1220 | extracted from the PDF files is fine for normal documentation | ||
| 1221 | paragraphs, but graphics and multiline equations will not be well | ||
| 1222 | formatted. See also @ref{Documentation Scan}. | ||
| 1223 | |||
| 1224 | @cindex Updated online help | ||
| 1225 | @cindex Online help, updates | ||
| 1226 | @cindex @code{<NEW>..</NEW>} | ||
| 1227 | Occasionally RSI releases a synopsis of new features in an IDL release, | ||
| 1228 | without simultaneously updating the documentation files, instead | ||
| 1229 | preferring a @i{What's New} document which describes the changes. These | ||
| 1230 | updates are incorporated directly into the IDLWAVE online help, and are | ||
| 1231 | delimited in @code{<NEW>..</NEW>} blocks. | ||
| 1232 | 1281 | ||
| 1233 | @cindex Source code, as online help | 1282 | For IDL system routines, RSI provides extensive documentation. |
| 1234 | @cindex DocLib header, as online help | 1283 | IDLWAVE can access an HTML version of this documentation very quickly |
| 1235 | For routines which are not documented in the IDL manual (for example | 1284 | and accurately. This is @emph{much} faster than using the IDL online |
| 1236 | personal or library routines), the source code itself is used as help | 1285 | help application, because IDLWAVE usually gets you to the right place |
| 1237 | text. If the requested information can be found in a (more or less) | 1286 | in the documentation directly --- e.g. a specific keyword of a routine |
| 1238 | standard DocLib file header, IDLWAVE shows the header (scrolling down to | 1287 | --- without any additional browsing and scrolling. For this online |
| 1239 | appropriate keyword). Otherwise the routine definition statement | 1288 | help to work, an HTML version of the IDL documentation, which is not |
| 1240 | (@code{pro}/@code{function}) is shown. | 1289 | part of the standalone IDLWAVE distribution, is required. The |
| 1241 | 1290 | necessary files can be downloaded from @uref{@value{IDLWAVE-HOMEPAGE}, | |
| 1242 | @cindex Structure tags, in online help | 1291 | the maintainers webpage}. There are a variety of options for |
| 1243 | @cindex Class tags, in online help | 1292 | displaying the HTML help: see below. Help for routines without HTML |
| 1244 | Help is also available for class structure tags (@code{self.TAG}), and | 1293 | documentation is also available, using the routine documentation |
| 1245 | generic structure tags, if structure tag completion is enabled | 1294 | header and/or source. |
| 1246 | (@pxref{Structure Tag Completion}). This is implemented by visiting the | ||
| 1247 | tag within the class or structure definition source itself. Help is not | ||
| 1248 | available on built-in system class tags. | ||
| 1249 | 1295 | ||
| 1250 | @kindex M-? | 1296 | @kindex M-? |
| 1251 | In any IDL program (or, as with most IDLWAVE commands, in the IDL | 1297 | In any IDL program (or, as with most IDLWAVE commands, in the IDL |
| @@ -1261,6 +1307,8 @@ locations are recognized context for help: | |||
| 1261 | @tab A keyword parameter of a routine. | 1307 | @tab A keyword parameter of a routine. |
| 1262 | @item @i{System Variable} | 1308 | @item @i{System Variable} |
| 1263 | @tab System variables like @code{!DPI}. | 1309 | @tab System variables like @code{!DPI}. |
| 1310 | @item @i{System Variable Tags} | ||
| 1311 | @tab System variables tags like @code{!D.X_SIZE}. | ||
| 1264 | @item @i{IDL Statement} | 1312 | @item @i{IDL Statement} |
| 1265 | @tab Statements like @code{PRO}, @code{REPEAT}, @code{COMPILE_OPT}, etc. | 1313 | @tab Statements like @code{PRO}, @code{REPEAT}, @code{COMPILE_OPT}, etc. |
| 1266 | @item @i{Class name} | 1314 | @item @i{Class name} |
| @@ -1270,23 +1318,23 @@ locations are recognized context for help: | |||
| 1270 | @item @i{Executive Command} | 1318 | @item @i{Executive Command} |
| 1271 | @tab An executive command like @code{.RUN}. Mostly useful in the shell. | 1319 | @tab An executive command like @code{.RUN}. Mostly useful in the shell. |
| 1272 | @item @i{Structure Tags} | 1320 | @item @i{Structure Tags} |
| 1273 | @tab In structure tags like @code{state.xsize} | 1321 | @tab Structure tags like @code{state.xsize} |
| 1274 | @item @i{Structure Tags} | 1322 | @item @i{Class Tags} |
| 1275 | @tab In class tags like @code{self.value}. | 1323 | @tab Class tags like @code{self.value}. |
| 1276 | @item @i{Default} | 1324 | @item @i{Default} |
| 1277 | @tab The routine that would be selected for routine info display. | 1325 | @tab The routine that would be selected for routine info display. |
| 1278 | @end multitable | 1326 | @end multitable |
| 1279 | 1327 | ||
| 1280 | @cindex @code{OBJ_NEW}, special online help | 1328 | @cindex @code{OBJ_NEW}, special online help |
| 1281 | Note that the @code{OBJ_NEW} function is special in that the help | 1329 | Note that the @code{OBJ_NEW} function is special in that the help |
| 1282 | displayed depends on the cursor position: If the cursor is on the | 1330 | displayed depends on the cursor position. If the cursor is on the |
| 1283 | @samp{OBJ_NEW}, this function is described. If it is on the class name | 1331 | @samp{OBJ_NEW}, this function is described. If it is on the class |
| 1284 | inside the quotes, the documentation for the class is pulled up. If the | 1332 | name inside the quotes, the documentation for the class is pulled up. |
| 1285 | cursor is @emph{after} the class name, anywhere in the argument list, | 1333 | If the cursor is @emph{after} the class name, anywhere in the argument |
| 1286 | the documentation for the corresponding @code{Init} method and its | 1334 | list, the documentation for the corresponding @code{Init} method and |
| 1287 | keywords is targeted. | 1335 | its keywords is targeted. |
| 1288 | 1336 | ||
| 1289 | @noindent Apart from source buffers, there are two more places from | 1337 | Apart from an IDLWAVE buffer or shell, there are two more places from |
| 1290 | which online help can be accessed. | 1338 | which online help can be accessed. |
| 1291 | 1339 | ||
| 1292 | @itemize @bullet | 1340 | @itemize @bullet |
| @@ -1302,14 +1350,112 @@ help is available in the online system documentation (vs. just the | |||
| 1302 | program source itself) will be emphasized (e.g. colored blue). | 1350 | program source itself) will be emphasized (e.g. colored blue). |
| 1303 | @end itemize | 1351 | @end itemize |
| 1304 | @noindent | 1352 | @noindent |
| 1305 | In both cases, a blue face indicates that the item is documented in the | 1353 | In both cases, a blue face indicates that the item is documented in |
| 1306 | IDL manual, but an attempt will be made to visit non-blue items directly | 1354 | the IDL manual, but an attempt will be made to visit non-blue items |
| 1307 | in the originating source file. | 1355 | directly in the originating source file. |
| 1356 | |||
| 1357 | |||
| 1358 | @menu | ||
| 1359 | * Help with HTML Documentation:: | ||
| 1360 | * Help with Source:: | ||
| 1361 | @end menu | ||
| 1308 | 1362 | ||
| 1309 | @cindex Help application, key bindings | 1363 | @node Help with HTML Documentation, Help with Source, Online Help, Online Help |
| 1310 | @cindex Key bindings, in help application | 1364 | @subsection Help with HTML Documentation |
| 1311 | The help window is normally displayed in a separate frame. The | 1365 | @cindex HTML Help |
| 1312 | following commands can be used to navigate inside the help system: | 1366 | @cindex Help using HTML manuals |
| 1367 | @cindex IDL manual, HTML version | ||
| 1368 | |||
| 1369 | Help using the HTML documentation is invoked with the built-in Emacs | ||
| 1370 | command @code{browse-url}, which displays the relevant help topic in a | ||
| 1371 | browser of your choosing. There are many possible browsers to choose | ||
| 1372 | among, with differing advantages and disadvantages. The variable | ||
| 1373 | @code{idlwave-help-browser-function} controls which browser help is | ||
| 1374 | sent to. This function is used to set the variable | ||
| 1375 | @code{browse-url-browser-function} locally for IDLWAVE help only. | ||
| 1376 | Customize this variable to see what choices of browsers your system | ||
| 1377 | offers. | ||
| 1378 | |||
| 1379 | Certain browsers like @code{w3} (bundled with many versions of Emacs) | ||
| 1380 | and @code{w3m} (@uref{http://emacs-w3m.namazu.org/}, the author's help | ||
| 1381 | browser of choice) are run within Emacs, and use Emacs buffers to | ||
| 1382 | display the HTML help. This can be convenient, especially on small | ||
| 1383 | displays, and images can even be displayed in-line on new Emacs | ||
| 1384 | versions. However, better formatting results are often achieved with | ||
| 1385 | external browsers, like Mozilla. IDLWAVE assumes any browser function | ||
| 1386 | containing "w3" is displayed in a local buffer. If you are using | ||
| 1387 | another Emacs-local browser for which this is not true, set the | ||
| 1388 | variable @code{idlwave-help-browser-is-local}. | ||
| 1389 | |||
| 1390 | @emph{N.B. For Windows users}: IDLWAVE can bring up RSI help directly | ||
| 1391 | in the Microsoft HTMLHelp documentation supplied with IDL: no | ||
| 1392 | additional help files are needed. Be sure to set | ||
| 1393 | @code{idlwave-system-directory} and the help file will be found | ||
| 1394 | automatically (or, alternatively, specify its location directly with | ||
| 1395 | @code{idlwave-html-help-location}). The variable | ||
| 1396 | @code{idlwave-help-use-hh} controls whether HTMLHelp is used, and | ||
| 1397 | which application is called to invoke it (@code{HH} is the default). | ||
| 1398 | The free helper application @code{KEYHH} | ||
| 1399 | (@uref{http://www.keyworks.net/keyhh.htm}) can be used instead, and is | ||
| 1400 | preferrable, as it permits loading new help topics into the same help | ||
| 1401 | window. @code{KEYHH} must be downloaded and installed separately. | ||
| 1402 | |||
| 1403 | @xref{HTML Help Browser Tips}, for more information on selecting and | ||
| 1404 | configuring a browser for use with IDL's HTML help system. | ||
| 1405 | |||
| 1406 | @defopt idlwave-html-help-location @file{/usr/local/etc} | ||
| 1407 | The directory where the @file{idl_html_help} dir or @file{idl.chm} | ||
| 1408 | HTMLHelp files live. | ||
| 1409 | @end defopt | ||
| 1410 | |||
| 1411 | @defopt idlwave-help-use-hh @code{nil} | ||
| 1412 | If set to @code{'hh} or @code{'keyhh}, use Windows native HTMLHelp | ||
| 1413 | with the specified help application. | ||
| 1414 | @end defopt | ||
| 1415 | |||
| 1416 | @defopt idlwave-help-browser-function | ||
| 1417 | The browser function to use to display IDLWAVE HTML help. Should be | ||
| 1418 | one of the functions available for setting | ||
| 1419 | @code{browse-url-browser-function}, which see. | ||
| 1420 | @end defopt | ||
| 1421 | |||
| 1422 | @defopt idlwave-help-browser-is-local | ||
| 1423 | Is the browser selected in @code{idlwave-help-browser-function} run in a | ||
| 1424 | local Emacs buffer? Defaults to @code{t} if the function contains | ||
| 1425 | "-w3". | ||
| 1426 | @end defopt | ||
| 1427 | |||
| 1428 | @defopt idlwave-help-link-face | ||
| 1429 | The face for links to IDLWAVE online help. | ||
| 1430 | @end defopt | ||
| 1431 | |||
| 1432 | @node Help with Source, , Help with HTML Documentation, Online Help | ||
| 1433 | @subsection Help with Source | ||
| 1434 | @cindex Help using routine source | ||
| 1435 | |||
| 1436 | @cindex Source code, as online help | ||
| 1437 | @cindex DocLib header, as online help | ||
| 1438 | For routines which are not documented in an HTML manual (for example | ||
| 1439 | personal or library routines), the source code itself is used as help | ||
| 1440 | text. If the requested information can be found in a (more or less) | ||
| 1441 | standard DocLib file header, IDLWAVE shows the header (scrolling down to | ||
| 1442 | a keyword, if appropriate). Otherwise the routine definition statement | ||
| 1443 | (@code{pro}/@code{function}) is shown. The doclib header sections which | ||
| 1444 | are searched for include @samp{NAME} and @samp{KEYWORDS}. Localization | ||
| 1445 | support can be added by customizing the @code{idlwave-help-doclib-name} | ||
| 1446 | and @code{idlwave-help-doclib-keyword} variables. | ||
| 1447 | |||
| 1448 | @cindex Structure tags, in online help | ||
| 1449 | @cindex Class tags, in online help | ||
| 1450 | Help is also available for class structure tags (@code{self.TAG}), and | ||
| 1451 | generic structure tags, if structure tag completion is enabled | ||
| 1452 | (@pxref{Structure Tag Completion}). This is implemented by visiting the | ||
| 1453 | tag within the class or structure definition source itself. Help is not | ||
| 1454 | available on built-in system class tags. | ||
| 1455 | |||
| 1456 | The help window is normally displayed in the same frame, but can be | ||
| 1457 | popped-up in a separate frame. The following commands can be used to | ||
| 1458 | navigate inside the help system for source files: | ||
| 1313 | 1459 | ||
| 1314 | @multitable @columnfractions .15 .85 | 1460 | @multitable @columnfractions .15 .85 |
| 1315 | @item @kbd{@key{SPACE}} | 1461 | @item @kbd{@key{SPACE}} |
| @@ -1318,29 +1464,6 @@ following commands can be used to navigate inside the help system: | |||
| 1318 | @tab Scroll forward one line. | 1464 | @tab Scroll forward one line. |
| 1319 | @item @kbd{@key{DEL}} | 1465 | @item @kbd{@key{DEL}} |
| 1320 | @tab Scroll back one page. | 1466 | @tab Scroll back one page. |
| 1321 | @item @kbd{n, p} | ||
| 1322 | @tab Browse to the next or previous topic (in physical sequence). | ||
| 1323 | @item @kbd{b, f} | ||
| 1324 | @tab Move back and forward through the help topic history. | ||
| 1325 | @item @kbd{c} | ||
| 1326 | @tab Clear the history. | ||
| 1327 | @item @kbd{Mouse-2} | ||
| 1328 | @tab Follow a link. Active links are displayed in a different font. | ||
| 1329 | Items under @i{See Also} are active, and classes have links to their | ||
| 1330 | methods and back. | ||
| 1331 | @item @kbd{o} | ||
| 1332 | @tab Open a topic. The topic can be selected with completion. | ||
| 1333 | @item @kbd{*} | ||
| 1334 | @tab Load the whole help file into Emacs, for global text searches. | ||
| 1335 | @item @kbd{q} | ||
| 1336 | @tab Kill the help window. | ||
| 1337 | @end multitable | ||
| 1338 | |||
| 1339 | @sp 1 | ||
| 1340 | @noindent When the help text is a source file, the following commands | ||
| 1341 | are also available: | ||
| 1342 | |||
| 1343 | @multitable @columnfractions .15 .85 | ||
| 1344 | @item @kbd{h} | 1467 | @item @kbd{h} |
| 1345 | @tab Jump to DocLib Header of the routine whose source is displayed | 1468 | @tab Jump to DocLib Header of the routine whose source is displayed |
| 1346 | as help. | 1469 | as help. |
| @@ -1352,13 +1475,12 @@ as help. | |||
| 1352 | item in the DocLib header. | 1475 | item in the DocLib header. |
| 1353 | @item @kbd{F} | 1476 | @item @kbd{F} |
| 1354 | @tab Fontify the buffer like source code. See the variable @code{idlwave-help-fontify-source-code}. | 1477 | @tab Fontify the buffer like source code. See the variable @code{idlwave-help-fontify-source-code}. |
| 1478 | @item @kbd{q} | ||
| 1479 | @tab Kill the help window. | ||
| 1355 | @end multitable | 1480 | @end multitable |
| 1356 | 1481 | ||
| 1357 | @defopt idlwave-help-directory | ||
| 1358 | The directory where idlw-help.txt and idlw-help.el are stored. | ||
| 1359 | @end defopt | ||
| 1360 | 1482 | ||
| 1361 | @defopt idlwave-help-use-dedicated-frame (@code{t}) | 1483 | @defopt idlwave-help-use-dedicated-frame (@code{nil}) |
| 1362 | Non-@code{nil} means use a separate frame for Online Help if possible. | 1484 | Non-@code{nil} means use a separate frame for Online Help if possible. |
| 1363 | @end defopt | 1485 | @end defopt |
| 1364 | 1486 | ||
| @@ -1379,18 +1501,21 @@ Non-@code{nil} means fontify source code displayed as help. | |||
| 1379 | @end defopt | 1501 | @end defopt |
| 1380 | 1502 | ||
| 1381 | @defopt idlwave-help-source-try-header (@code{t}) | 1503 | @defopt idlwave-help-source-try-header (@code{t}) |
| 1382 | Non-@code{nil} means try to find help in routine header when displaying source | 1504 | Non-@code{nil} means try to find help in routine header when |
| 1383 | file. | 1505 | displaying source file. |
| 1384 | @end defopt | 1506 | @end defopt |
| 1385 | 1507 | ||
| 1386 | @defopt idlwave-help-link-face | 1508 | @defopt idlwave-help-doclib-name (@code{"name"}) |
| 1387 | The face for links in IDLWAVE online help. | 1509 | The case-insensitive heading word in doclib headers to locate the |
| 1510 | @emph{name} section. Can be a regexp, e.g. @code{"\\(name\\|nom\\)"}. | ||
| 1388 | @end defopt | 1511 | @end defopt |
| 1389 | 1512 | ||
| 1390 | @defopt idlwave-help-activate-links-aggressively (@code{t}) | 1513 | @defopt idlwave-help-doclib-keyword (@code{"KEYWORD"}) |
| 1391 | Non-@code{nil} means make all possible links in help window active. | 1514 | The case-insensitive heading word in doclib headers to locate the |
| 1515 | @emph{keywords} section. Can be a regexp. | ||
| 1392 | @end defopt | 1516 | @end defopt |
| 1393 | 1517 | ||
| 1518 | |||
| 1394 | @node Completion, Routine Source, Online Help, The IDLWAVE Major Mode | 1519 | @node Completion, Routine Source, Online Help, The IDLWAVE Major Mode |
| 1395 | @section Completion | 1520 | @section Completion |
| 1396 | @cindex Completion | 1521 | @cindex Completion |
| @@ -1404,12 +1529,13 @@ Non-@code{nil} means make all possible links in help window active. | |||
| 1404 | @kindex M-@key{TAB} | 1529 | @kindex M-@key{TAB} |
| 1405 | @kindex C-c C-i | 1530 | @kindex C-c C-i |
| 1406 | IDLWAVE offers completion for class names, routine names, keywords, | 1531 | IDLWAVE offers completion for class names, routine names, keywords, |
| 1407 | system variables, class structure tags, regular structure tags and file | 1532 | system variables, system variable tags, class structure tags, regular |
| 1408 | names. As in many programming modes, completion is bound to | 1533 | structure tags and file names. As in many programming modes, |
| 1409 | @kbd{M-@key{TAB}} (or @kbd{@key{TAB}} in the IDLWAVE Shell --- | 1534 | completion is bound to @kbd{M-@key{TAB}} (or @kbd{@key{TAB}} in the |
| 1410 | @pxref{Using the Shell}). Completion uses exactly the same internal | 1535 | IDLWAVE Shell --- @pxref{Using the Shell}). Completion uses exactly |
| 1411 | information as routine info, so when necessary (rarely) it can be | 1536 | the same internal information as routine info, so when necessary |
| 1412 | updated with @kbd{C-c C-i} (@code{idlwave-update-routine-info}). | 1537 | (rarely) it can be updated with @kbd{C-c C-i} |
| 1538 | (@code{idlwave-update-routine-info}). | ||
| 1413 | 1539 | ||
| 1414 | The completion function is context sensitive and figures out what to | 1540 | The completion function is context sensitive and figures out what to |
| 1415 | complete based location of the point. Here are example lines and what | 1541 | complete based location of the point. Here are example lines and what |
| @@ -1443,6 +1569,11 @@ will always assume a keyword to @samp{plot}. However, a function is | |||
| 1443 | also a possible completion here. You can force completion of a function | 1569 | also a possible completion here. You can force completion of a function |
| 1444 | name at such a location by using a prefix arg: @kbd{C-u M-@key{TAB}}. | 1570 | name at such a location by using a prefix arg: @kbd{C-u M-@key{TAB}}. |
| 1445 | 1571 | ||
| 1572 | Giving two prefix arguments (@kbd{C-u C-u M-@key{TAB}}) prompts for a | ||
| 1573 | regular expression to search among the commands to be completed. As | ||
| 1574 | an example, completing a blank line in this way will allow you to | ||
| 1575 | search for a procedure matching a regexp. | ||
| 1576 | |||
| 1446 | @cindex Scrolling the @file{*Completions*} window | 1577 | @cindex Scrolling the @file{*Completions*} window |
| 1447 | @cindex Completion, scrolling | 1578 | @cindex Completion, scrolling |
| 1448 | @cindex Completion, Online Help | 1579 | @cindex Completion, Online Help |
| @@ -1489,7 +1620,7 @@ available. | |||
| 1489 | @menu | 1620 | @menu |
| 1490 | * Case of Completed Words:: CaseOFcomPletedWords | 1621 | * Case of Completed Words:: CaseOFcomPletedWords |
| 1491 | * Object Method Completion and Class Ambiguity:: obj->Method, what? | 1622 | * Object Method Completion and Class Ambiguity:: obj->Method, what? |
| 1492 | * Object Method Completion in the Shell:: | 1623 | * Object Method Completion in the Shell:: |
| 1493 | * Class and Keyword Inheritance:: obj->Method, _EXTRA=e | 1624 | * Class and Keyword Inheritance:: obj->Method, _EXTRA=e |
| 1494 | * Structure Tag Completion:: Completing state.Tag | 1625 | * Structure Tag Completion:: Completing state.Tag |
| 1495 | @end menu | 1626 | @end menu |
| @@ -1498,19 +1629,21 @@ available. | |||
| 1498 | @subsection Case of Completed Words | 1629 | @subsection Case of Completed Words |
| 1499 | @cindex Case of completed words | 1630 | @cindex Case of completed words |
| 1500 | @cindex Mixed case completion | 1631 | @cindex Mixed case completion |
| 1501 | The case of the completed words is determined by what is already in the | 1632 | IDL is a case-insensitive language, so casing is a matter of style |
| 1502 | buffer. When the partial word being completed is all lower case, the | 1633 | only. IDLWAVE helps maintain a consistent casing style for completed |
| 1503 | completion will be lower case as well. If at least one character is | 1634 | items. The case of the completed words is determined by what is |
| 1504 | upper case, the string will be completed in upper case or mixed case. | 1635 | already in the buffer. As an exception, when the partial word being |
| 1505 | The default is to use upper case for procedures, functions and keywords, | 1636 | completed is all lower case, the completion will be lower case as |
| 1506 | and mixed case for object class names and methods, similar to the | 1637 | well. If at least one character is upper case, the string will be |
| 1507 | conventions in the IDL manuals. These defaults can be changed with the | 1638 | completed in upper case or mixed case, depending on the value of the |
| 1508 | variable @code{idlwave-completion-case}. For instance, to enable | 1639 | variable @code{idlwave-completion-case}. The default is to use upper |
| 1509 | mixed-case completion for routines in addition to classes and methods, | 1640 | case for procedures, functions and keywords, and mixed case for object |
| 1510 | you need an entry such as @code{routine . preserve} in that variable. | 1641 | class names and methods, similar to the conventions in the IDL |
| 1511 | To enable total control over the case of completed items, independent of | 1642 | manuals. For instance, to enable mixed-case completion for routines |
| 1512 | buffer context, set @code{idlwave-completion-force-default-case} to | 1643 | in addition to classes and methods, you need an entry such as |
| 1513 | non-@code{nil}. | 1644 | @code{(routine . preserve)} in that variable. To enable total control |
| 1645 | over the case of completed items, independent of buffer context, set | ||
| 1646 | @code{idlwave-completion-force-default-case} to non-@code{nil}. | ||
| 1514 | 1647 | ||
| 1515 | @defopt idlwave-completion-case | 1648 | @defopt idlwave-completion-case |
| 1516 | Association list setting the case (UPPER/lower/Capitalized/MixedCase...) | 1649 | Association list setting the case (UPPER/lower/Capitalized/MixedCase...) |
| @@ -1554,7 +1687,7 @@ narrow down the number of possible completions. The variable | |||
| 1554 | @code{idlwave-query-class} can be configured to make such prompting the | 1687 | @code{idlwave-query-class} can be configured to make such prompting the |
| 1555 | default for all methods (not recommended), or selectively for very | 1688 | default for all methods (not recommended), or selectively for very |
| 1556 | common methods for which the number of completing keywords would be too | 1689 | common methods for which the number of completing keywords would be too |
| 1557 | large (e.g. @code{Init}). | 1690 | large (e.g. @code{Init}). |
| 1558 | 1691 | ||
| 1559 | @cindex Saving object class on @code{->} | 1692 | @cindex Saving object class on @code{->} |
| 1560 | @cindex @code{->} | 1693 | @cindex @code{->} |
| @@ -1568,8 +1701,9 @@ enabled by default --- the variable @code{idlwave-store-inquired-class} | |||
| 1568 | can be used to turn it on. | 1701 | can be used to turn it on. |
| 1569 | 1702 | ||
| 1570 | @defopt idlwave-completion-show-classes (@code{1}) | 1703 | @defopt idlwave-completion-show-classes (@code{1}) |
| 1571 | Non-@code{nil} means show classes in @file{*Completions*} buffer when | 1704 | Non-@code{nil} means show up to that many classes in |
| 1572 | completing object methods and keywords. | 1705 | @file{*Completions*} buffer when completing object methods and |
| 1706 | keywords. | ||
| 1573 | @end defopt | 1707 | @end defopt |
| 1574 | 1708 | ||
| 1575 | @defopt idlwave-completion-fontify-classes (@code{t}) | 1709 | @defopt idlwave-completion-fontify-classes (@code{t}) |
| @@ -1630,23 +1764,23 @@ entire class inheritance chain. This is often referred to as | |||
| 1630 | @emph{chaining}, and is characterized by chained method calls like | 1764 | @emph{chaining}, and is characterized by chained method calls like |
| 1631 | @w{@code{self->MySuperClass::SetProperty,_EXTRA=e}}. | 1765 | @w{@code{self->MySuperClass::SetProperty,_EXTRA=e}}. |
| 1632 | 1766 | ||
| 1633 | IDLWAVE can accommodate this special synergy between class and keyword | 1767 | IDLWAVE can accomodate this special synergy between class and keyword |
| 1634 | inheritance: if @code{_EXTRA} or @code{_REF_EXTRA} is detected among a | 1768 | inheritance: if @code{_EXTRA} or @code{_REF_EXTRA} is detected among a |
| 1635 | method's keyword parameters, all keywords of superclass versions of the | 1769 | method's keyword parameters, all keywords of superclass versions of |
| 1636 | method being considered are included in completion. There is of course | 1770 | the method being considered can be included in completion. There is |
| 1637 | no guarantee that this type of keyword chaining actually occurrs, but | 1771 | of course no guarantee that this type of keyword chaining actually |
| 1638 | for some methods it's a very convenient assumption. The variable | 1772 | occurrs, but for some methods it's a very convenient assumption. The |
| 1639 | @code{idlwave-keyword-class-inheritance} can be used to configure which | 1773 | variable @code{idlwave-keyword-class-inheritance} can be used to |
| 1640 | methods have keyword inheritance treated in this simple, class-driven | 1774 | configure which methods have keyword inheritance treated in this |
| 1641 | way. By default, only @code{Init} and @code{(Get|Set)Property} are. | 1775 | simple, class-driven way. By default, only @code{Init} and |
| 1642 | The completion buffer will label keywords based on their originating | 1776 | @code{(Get|Set)Property} are. The completion buffer will label |
| 1643 | class. | 1777 | keywords based on their originating class. |
| 1644 | 1778 | ||
| 1645 | @defopt idlwave-support-inheritance (@code{t}) | 1779 | @defopt idlwave-support-inheritance (@code{t}) |
| 1646 | Non-@code{nil} means consider inheritance during completion, online help etc. | 1780 | Non-@code{nil} means consider inheritance during completion, online help etc. |
| 1647 | @end defopt | 1781 | @end defopt |
| 1648 | 1782 | ||
| 1649 | @defopt idlwave-keyword-class-inheritance | 1783 | @defopt idlwave-keyword-class-inheritance |
| 1650 | A list of regular expressions to match methods for which simple | 1784 | A list of regular expressions to match methods for which simple |
| 1651 | class-driven keyword inheritance will be used for Completion. | 1785 | class-driven keyword inheritance will be used for Completion. |
| 1652 | @end defopt | 1786 | @end defopt |
| @@ -1676,7 +1810,7 @@ Structure tag completion is not enabled by default. To enable it, | |||
| 1676 | simply add the following to your @file{.emacs}: | 1810 | simply add the following to your @file{.emacs}: |
| 1677 | 1811 | ||
| 1678 | @lisp | 1812 | @lisp |
| 1679 | (add-hook 'idlwave-load-hook | 1813 | (add-hook 'idlwave-load-hook |
| 1680 | (lambda () (require 'idlw-complete-structtag))) | 1814 | (lambda () (require 'idlw-complete-structtag))) |
| 1681 | @end lisp | 1815 | @end lisp |
| 1682 | 1816 | ||
| @@ -1696,7 +1830,9 @@ for a module name, offering the same default as | |||
| 1696 | @code{idlwave-routine-info} would have used, taken from nearby buffer | 1830 | @code{idlwave-routine-info} would have used, taken from nearby buffer |
| 1697 | contents. In the minibuffer, specify a complete routine name (including | 1831 | contents. In the minibuffer, specify a complete routine name (including |
| 1698 | any class part). IDLWAVE will display the source file in another | 1832 | any class part). IDLWAVE will display the source file in another |
| 1699 | window, positioned at the routine in question. | 1833 | window, positioned at the routine in question. You can also visit a |
| 1834 | routine in the current buffer, with completion, by using a single prefix | ||
| 1835 | (@kbd{C-u C-c C-v}). | ||
| 1700 | 1836 | ||
| 1701 | @cindex Buffers, killing | 1837 | @cindex Buffers, killing |
| 1702 | @cindex Killing autoloaded buffers | 1838 | @cindex Killing autoloaded buffers |
| @@ -1719,9 +1855,9 @@ taken from context, but you get a chance to edit it. | |||
| 1719 | 1855 | ||
| 1720 | @code{idlwave-resolve} is one way to get a library module within reach | 1856 | @code{idlwave-resolve} is one way to get a library module within reach |
| 1721 | of IDLWAVE's routine info collecting functions. A better way is to | 1857 | of IDLWAVE's routine info collecting functions. A better way is to |
| 1722 | scan (parts of) the library (@pxref{Library Catalog}). Routine info on | 1858 | keep routine information available in catalogs (@pxref{Catalogs}). |
| 1723 | library modules will then be available without the need to compile the | 1859 | Routine info on modules will then be available without the need to |
| 1724 | modules first, and even without a running shell. | 1860 | compile the modules first, and even without a running shell. |
| 1725 | 1861 | ||
| 1726 | @xref{Sources of Routine Info}, for more information on the ways IDLWAVE | 1862 | @xref{Sources of Routine Info}, for more information on the ways IDLWAVE |
| 1727 | collects data about routines, and how to update this information. | 1863 | collects data about routines, and how to update this information. |
| @@ -1970,7 +2106,8 @@ indentation of the code. | |||
| 1970 | @end itemize | 2106 | @end itemize |
| 1971 | 2107 | ||
| 1972 | @defopt idlwave-do-actions (@code{nil}) | 2108 | @defopt idlwave-do-actions (@code{nil}) |
| 1973 | Non-@code{nil} means performs actions when indenting. | 2109 | Non-@code{nil} means performs actions when indenting. Individual action |
| 2110 | settings are described below and set separately. | ||
| 1974 | @end defopt | 2111 | @end defopt |
| 1975 | 2112 | ||
| 1976 | @menu | 2113 | @menu |
| @@ -2069,7 +2206,7 @@ your @file{.emacs} file: | |||
| 2069 | (idlwave-action-and-binding "\\<\\(pro\\|function\\)\\>[ \t]*\\<" | 2206 | (idlwave-action-and-binding "\\<\\(pro\\|function\\)\\>[ \t]*\\<" |
| 2070 | '(capitalize-word 1) t) | 2207 | '(capitalize-word 1) t) |
| 2071 | ;; Capitalize common block name | 2208 | ;; Capitalize common block name |
| 2072 | (idlwave-action-and-binding "\\<common\\>[ \t]+\\<" | 2209 | (idlwave-action-and-binding "\\<common\\>[ \t]+\\<" |
| 2073 | '(capitalize-word 1) t))) | 2210 | '(capitalize-word 1) t))) |
| 2074 | @end lisp | 2211 | @end lisp |
| 2075 | 2212 | ||
| @@ -2096,7 +2233,7 @@ expansion. | |||
| 2096 | @cindex Modification timestamp | 2233 | @cindex Modification timestamp |
| 2097 | @cindex Header, for file documentation | 2234 | @cindex Header, for file documentation |
| 2098 | @cindex Timestamp, in doc header. | 2235 | @cindex Timestamp, in doc header. |
| 2099 | @cindex ChangeLog, in doc header. | 2236 | @cindex Changelog, in doc header. |
| 2100 | 2237 | ||
| 2101 | @kindex C-c C-h | 2238 | @kindex C-c C-h |
| 2102 | @kindex C-c C-m | 2239 | @kindex C-c C-m |
| @@ -2220,21 +2357,21 @@ The IDLWAVE shell is an Emacs major mode which permits running the IDL | |||
| 2220 | program as an inferior process of Emacs, and works closely with the | 2357 | program as an inferior process of Emacs, and works closely with the |
| 2221 | IDLWAVE major mode in buffers. It can be used to work with IDL | 2358 | IDLWAVE major mode in buffers. It can be used to work with IDL |
| 2222 | interactively, to compile and run IDL programs in Emacs buffers and to | 2359 | interactively, to compile and run IDL programs in Emacs buffers and to |
| 2223 | debug these programs. The IDLWAVE shell is built upon @file{comint}, an | 2360 | debug these programs. The IDLWAVE shell is built on @file{comint}, an |
| 2224 | Emacs packages which handles the communication with the IDL program. | 2361 | Emacs packages which handles the communication with the IDL program. |
| 2225 | Unfortunately IDL for Windows and MacOS do not have command-prompt | 2362 | Unfortunately IDL for Windows does not have command-prompt versions |
| 2226 | versions and thus do not allow the interaction with | 2363 | and thus do not allow the interaction with Emacs@footnote{Please |
| 2227 | Emacs@footnote{Please inform the maintainer if you come up with a way to | 2364 | inform the maintainer if you come up with a way to make the IDLWAVE |
| 2228 | make the IDLWAVE shell work on these systems.} --- so the IDLWAVE shell | 2365 | shell work on these systems.} --- so the IDLWAVE shell currently only |
| 2229 | currently only works under Unix. | 2366 | works under Unix and MacOSX. |
| 2230 | 2367 | ||
| 2231 | @menu | 2368 | @menu |
| 2232 | * Starting the Shell:: How to launch IDL as a subprocess | 2369 | * Starting the Shell:: How to launch IDL as a subprocess |
| 2233 | * Using the Shell:: Interactively working with the Shell | 2370 | * Using the Shell:: Interactively working with the Shell |
| 2234 | * Commands Sent to the Shell:: | 2371 | * Commands Sent to the Shell:: |
| 2235 | * Debugging IDL Programs:: | 2372 | * Debugging IDL Programs:: |
| 2236 | * Examining Variables:: | 2373 | * Examining Variables:: |
| 2237 | * Custom Expression Examination:: | 2374 | * Custom Expression Examination:: |
| 2238 | @end menu | 2375 | @end menu |
| 2239 | 2376 | ||
| 2240 | @node Starting the Shell, Using the Shell, The IDLWAVE Shell, The IDLWAVE Shell | 2377 | @node Starting the Shell, Using the Shell, The IDLWAVE Shell, The IDLWAVE Shell |
| @@ -2249,22 +2386,23 @@ currently only works under Unix. | |||
| 2249 | The IDLWAVE shell can be started with the command @kbd{M-x | 2386 | The IDLWAVE shell can be started with the command @kbd{M-x |
| 2250 | idlwave-shell}. In @code{idlwave-mode} the function is bound to | 2387 | idlwave-shell}. In @code{idlwave-mode} the function is bound to |
| 2251 | @kbd{C-c C-s}. It creates a buffer @file{*idl*} which is used to | 2388 | @kbd{C-c C-s}. It creates a buffer @file{*idl*} which is used to |
| 2252 | interact with the shell. If the shell is already running, @kbd{C-c C-s} | 2389 | interact with the shell. If the shell is already running, @kbd{C-c |
| 2253 | will simple switch to the shell buffer. The command @kbd{C-c C-l} | 2390 | C-s} will simply switch to the shell buffer. The command @kbd{C-c |
| 2254 | (@code{idlwave-shell-recenter-shell-window}) displays the shell window | 2391 | C-l} (@code{idlwave-shell-recenter-shell-window}) displays the shell |
| 2255 | without selecting it. The shell can also be started automatically when | 2392 | window without selecting it. The shell can also be started |
| 2256 | another command tries to send a command to it. To enable auto start, | 2393 | automatically when another command tries to send a command to it. To |
| 2257 | set the variable @code{idlwave-shell-automatic-start} to @code{t}. | 2394 | enable auto start, set the variable |
| 2395 | @code{idlwave-shell-automatic-start} to @code{t}. | ||
| 2258 | 2396 | ||
| 2259 | In order to create a separate frame for the IDLWAVE shell buffer, call | 2397 | In order to create a separate frame for the IDLWAVE shell buffer, call |
| 2260 | @code{idlwave-shell} with a prefix argument: @kbd{C-u C-c C-s} or | 2398 | @code{idlwave-shell} with a prefix argument: @kbd{C-u C-c C-s} or |
| 2261 | @kbd{C-u C-c C-l}. If you always want a dedicated frame for the shell | 2399 | @kbd{C-u C-c C-l}. If you always want a dedicated frame for the shell |
| 2262 | window, configure the variable | 2400 | window, configure the variable |
| 2263 | @code{idlwave-shell-use-dedicated-frame}. | 2401 | @code{idlwave-shell-use-dedicated-frame}. |
| 2264 | 2402 | ||
| 2265 | To launch a quick IDLWAVE shell directly from a shell prompt without an | 2403 | To launch a quick IDLWAVE shell directly from a shell prompt without |
| 2266 | IDLWAVE buffer (e.g., as a replacement for running inside an xterm), | 2404 | an IDLWAVE buffer (e.g., as a replacement for running inside an |
| 2267 | define an alias with the following content: | 2405 | xterm), define a system alias with the following content: |
| 2268 | 2406 | ||
| 2269 | @example | 2407 | @example |
| 2270 | emacs -geometry 80x32 -eval "(idlwave-shell 'quick)" | 2408 | emacs -geometry 80x32 -eval "(idlwave-shell 'quick)" |
| @@ -2273,6 +2411,16 @@ emacs -geometry 80x32 -eval "(idlwave-shell 'quick)" | |||
| 2273 | Replace the @samp{-geometry 80x32} option with @samp{-nw} if you prefer | 2411 | Replace the @samp{-geometry 80x32} option with @samp{-nw} if you prefer |
| 2274 | the Emacs process to run directly inside the terminal window. | 2412 | the Emacs process to run directly inside the terminal window. |
| 2275 | 2413 | ||
| 2414 | @cindex ENVI | ||
| 2415 | @cindex IDL> Prompt | ||
| 2416 | |||
| 2417 | To use IDLWAVE with ENVI or other custom packages which change the | ||
| 2418 | @samp{IDL> } prompt, you must change the | ||
| 2419 | @code{idlwave-shell-prompt-pattern}, which defaults to @samp{"^ ?IDL> | ||
| 2420 | "}. Normally, you can just replace the @samp{IDL} in this expression | ||
| 2421 | with the prompt you see. A suitable pattern which matches the prompt | ||
| 2422 | for both ENVI and IDL simultaneously is @samp{"^ ?\\(ENVI\\|IDL\\)> "}. | ||
| 2423 | |||
| 2276 | @defopt idlwave-shell-explicit-file-name (@file{idl}) | 2424 | @defopt idlwave-shell-explicit-file-name (@file{idl}) |
| 2277 | This is the command to run IDL. | 2425 | This is the command to run IDL. |
| 2278 | @end defopt | 2426 | @end defopt |
| @@ -2302,12 +2450,14 @@ Initial commands, separated by newlines, to send to IDL. | |||
| 2302 | Non-@code{nil} means preserve command history between sessions. | 2450 | Non-@code{nil} means preserve command history between sessions. |
| 2303 | @end defopt | 2451 | @end defopt |
| 2304 | 2452 | ||
| 2305 | @defopt idlwave-shell-command-history-file (@file{~/.idlwhist}) | 2453 | @defopt idlwave-shell-command-history-file (@file{~/.idlwave/.idlwhist}) |
| 2306 | The file in which the command history of the idlwave shell is saved. | 2454 | The file in which the command history of the idlwave shell is saved. |
| 2455 | Unless it's an absolute path, it goes in | ||
| 2456 | @code{idlwave-config-directory}. | ||
| 2307 | @end defopt | 2457 | @end defopt |
| 2308 | 2458 | ||
| 2309 | @defopt idlwave-shell-use-dedicated-frame (@code{nil}) | 2459 | @defopt idlwave-shell-use-dedicated-frame (@code{nil}) |
| 2310 | Non-@code{nil} means IDLWAVE should use a special frame to display | 2460 | Non-@code{nil} means IDLWAVE should use a special frame to display the |
| 2311 | shell buffer. | 2461 | shell buffer. |
| 2312 | @end defopt | 2462 | @end defopt |
| 2313 | 2463 | ||
| @@ -2476,18 +2626,22 @@ By default, much of this background shell input and output is hidden | |||
| 2476 | from the user, but this is configurable. The custom variable | 2626 | from the user, but this is configurable. The custom variable |
| 2477 | @code{idlwave-abbrev-show-commands} allows you to configure which | 2627 | @code{idlwave-abbrev-show-commands} allows you to configure which |
| 2478 | commands sent to the shell are shown there. For a related customization | 2628 | commands sent to the shell are shown there. For a related customization |
| 2479 | for separating the output of @emph{examine} commands @xref{Examining | 2629 | for separating the output of @emph{examine} commands, see @ref{Examining |
| 2480 | Variables}. | 2630 | Variables}. |
| 2481 | 2631 | ||
| 2482 | @defopt idlwave-shell-show-commands (@code{'(run misc breakpoint)}) | 2632 | @defopt idlwave-shell-show-commands (@code{'(run misc breakpoint)}) |
| 2483 | A list of command types to echo in the shell when sent. Possible values | 2633 | A list of command types to echo in the shell when sent. Possible values |
| 2484 | are @code{run} for @code{.run}, @code{.compile} and other run commands, | 2634 | are @code{run} for @code{.run}, @code{.compile} and other run commands, |
| 2485 | @code{misc} for lesser used commands like @code{window}, @code{retall}, | 2635 | @code{misc} for lesser used commands like @code{window}, |
| 2486 | etc., @code{breakpoint} for breakpoint setting and clearing commands, | 2636 | @code{retall},@code{close}, etc., @code{breakpoint} for breakpoint |
| 2487 | and @code{debug} for other debug, stepping, and continue commands. In | 2637 | setting and clearing commands, and @code{debug} for other debug, |
| 2488 | addition, if the variable is set to the single symbol @code{'everything}, | 2638 | stepping, and continue commands. In addition, if the variable is set to |
| 2489 | all the copious shell input is displayed (which is probably only useful | 2639 | the single symbol @code{'everything}, all the copious shell input is |
| 2490 | for debugging purposes). | 2640 | displayed (which is probably only useful for debugging purposes). |
| 2641 | N.B. For hidden commands which produce output by side-effect, that | ||
| 2642 | output remains hidden (e.g., stepping through a @code{print} command). | ||
| 2643 | As a special case, any error message in the output will be displayed | ||
| 2644 | (e.g., stepping to an error). | ||
| 2491 | @end defopt | 2645 | @end defopt |
| 2492 | 2646 | ||
| 2493 | @node Debugging IDL Programs, Examining Variables, Commands Sent to the Shell, The IDLWAVE Shell | 2647 | @node Debugging IDL Programs, Examining Variables, Commands Sent to the Shell, The IDLWAVE Shell |
| @@ -2497,17 +2651,21 @@ for debugging purposes). | |||
| 2497 | @cindex Toolbar | 2651 | @cindex Toolbar |
| 2498 | 2652 | ||
| 2499 | Programs can be compiled, run, and debugged directly from the source | 2653 | Programs can be compiled, run, and debugged directly from the source |
| 2500 | buffer in Emacs. IDLWAVE makes compiling and debugging IDL programs | 2654 | buffer in Emacs, walking through arbitrarily deeply nested code, |
| 2501 | far less cumbersome by providing a full-featured, | 2655 | printing expressions and skipping up and down the calling stack along |
| 2502 | key/menu/toolbar-driven interface to commands like @code{breakpoint}, | 2656 | the way. IDLWAVE makes compiling and debugging IDL programs far less |
| 2503 | @code{.step}, @code{.run}, etc. | 2657 | cumbersome by providing a full-featured, key/menu/toolbar-driven |
| 2504 | 2658 | interface to commands like @code{breakpoint}, @code{.step}, | |
| 2505 | The IDLWAVE shell installs key bindings both in the shell buffer and in | 2659 | @code{.run}, etc. It can even perform complex debug operations not |
| 2506 | all IDL code buffers of the current Emacs session, so debug commands | 2660 | natively supported by IDL (like continuing to the line at the cursor). |
| 2507 | work in both places (in the shell, commands operate on the last file | 2661 | |
| 2508 | compiled). On Emacs versions which support this, a debugging toolbar is | 2662 | The IDLWAVE shell installs key bindings both in the shell buffer and |
| 2509 | also installed. The display of the toolbar can be toggled with @kbd{C-c | 2663 | in all IDL code buffers of the current Emacs session, so debug |
| 2510 | C-d C-t} (@code{idlwave-shell-toggle-toolbar}). | 2664 | commands work in both places (in the shell, commands operate on the |
| 2665 | last file compiled). On Emacs versions which support it, a debugging | ||
| 2666 | toolbar is also installed. The toolbar display can be toggled with | ||
| 2667 | @kbd{C-c C-d C-t} (@code{idlwave-shell-toggle-toolbar}). | ||
| 2668 | |||
| 2511 | 2669 | ||
| 2512 | @defopt idlwave-shell-use-toolbar (@code{t}) | 2670 | @defopt idlwave-shell-use-toolbar (@code{t}) |
| 2513 | Non-@code{nil} means use the debugging toolbar in all IDL related | 2671 | Non-@code{nil} means use the debugging toolbar in all IDL related |
| @@ -2515,38 +2673,67 @@ buffers. | |||
| 2515 | @end defopt | 2673 | @end defopt |
| 2516 | 2674 | ||
| 2517 | @menu | 2675 | @menu |
| 2518 | * Debug Key Bindings:: | 2676 | * A Tale of Two Modes:: |
| 2519 | * Compiling Programs:: | 2677 | * Debug Key Bindings:: |
| 2520 | * Breakpoints and Stepping:: | 2678 | * Breakpoints and Stepping:: |
| 2521 | * Walking the Calling Stack:: | 2679 | * Compiling Programs:: |
| 2680 | * Walking the Calling Stack:: | ||
| 2681 | * Electric Debug Mode:: | ||
| 2522 | @end menu | 2682 | @end menu |
| 2523 | 2683 | ||
| 2524 | @node Debug Key Bindings, Compiling Programs, Debugging IDL Programs, Debugging IDL Programs | 2684 | |
| 2685 | @node A Tale of Two Modes, Debug Key Bindings, Debugging IDL Programs, Debugging IDL Programs | ||
| 2686 | @subsection A Tale of Two Modes | ||
| 2687 | @cindex Electric Debug Mode | ||
| 2688 | @cindex Debugging Interface | ||
| 2689 | |||
| 2690 | The many debugging, compiling, and examination commands provided in | ||
| 2691 | IDLWAVE are available simultaneously through two different interfaces: | ||
| 2692 | the original, multi-key command interface, and the new Electric Debug | ||
| 2693 | Mode. The functionality they offer is similar, but the way you | ||
| 2694 | interact with them is quite different. The main difference is that, | ||
| 2695 | in Electric Debug Mode, the source buffers are made read-only, and | ||
| 2696 | single key-strokes are used to step through, examine expressions, set | ||
| 2697 | and remove breakpoints, etc. The same variables, prefix arguments, | ||
| 2698 | and settings apply to both versions, and both can be used | ||
| 2699 | interchangeably. By default, when breakpoints are hit, Electric Debug | ||
| 2700 | Mode is enabled. The traditional interface is described first. | ||
| 2701 | @xref{Electric Debug Mode}, for more on that mode. | ||
| 2702 | |||
| 2703 | |||
| 2704 | @sp 1 | ||
| 2705 | @noindent @strong{Note that electric debug mode can be prevented from | ||
| 2706 | activating automatically by customizing the variable | ||
| 2707 | @code{idlwave-shell-automatic-electric-debug}.} | ||
| 2708 | |||
| 2709 | @node Debug Key Bindings, Breakpoints and Stepping, A Tale of Two Modes, Debugging IDL Programs | ||
| 2525 | @subsection Debug Key Bindings | 2710 | @subsection Debug Key Bindings |
| 2526 | @kindex C-c C-d | 2711 | @kindex C-c C-d |
| 2527 | @cindex Key bindings | 2712 | @cindex Key bindings |
| 2528 | 2713 | ||
| 2529 | The debugging key bindings are by default on the prefix key @kbd{C-c | 2714 | The standard debugging key bindings are always available by default on |
| 2530 | C-d}, so for example setting a breakpoint is done with @kbd{C-c C-d | 2715 | the prefix key @kbd{C-c C-d}, so, for example, setting a breakpoint is |
| 2531 | C-b}, and compiling a source file with @kbd{C-c C-d C-c}. If you find | 2716 | done with @kbd{C-c C-d C-b}, and compiling a source file with @kbd{C-c |
| 2532 | this too much work, you can easily configure IDLWAVE to use one or more | 2717 | C-d C-c}. You can also easily configure IDLWAVE to use one or more |
| 2533 | modifier keys not in use by other commands, in lieu of the prefix | 2718 | modifier keys not in use by other commands, in lieu of the prefix |
| 2534 | @kbd{C-c C-d} (though these bindings will typically also be available | 2719 | @kbd{C-c C-d} (though these bindings will typically also be available |
| 2535 | --- see @code{idlwave-shell-activate-prefix-keybindings}). For example, | 2720 | --- see @code{idlwave-shell-activate-prefix-keybindings}). For |
| 2536 | if you write in @file{.emacs}: | 2721 | example, if you include in @file{.emacs}: |
| 2537 | 2722 | ||
| 2538 | @lisp | 2723 | @lisp |
| 2539 | (setq idlwave-shell-debug-modifiers '(control shift)) | 2724 | (setq idlwave-shell-debug-modifiers '(control shift)) |
| 2540 | @end lisp | 2725 | @end lisp |
| 2541 | 2726 | ||
| 2542 | @noindent a breakpoint can be set by pressing @kbd{b} while holding down | 2727 | @noindent a breakpoint can then be set by pressing @kbd{b} while holding down |
| 2543 | @kbd{shift} and @kbd{control} keys, i.e. @kbd{C-S-b}. Compiling a | 2728 | @kbd{shift} and @kbd{control} keys, i.e. @kbd{C-S-b}. Compiling a |
| 2544 | source file will be on @kbd{C-S-c}, deleting a breakpoint @kbd{C-S-d}, | 2729 | source file will be on @kbd{C-S-c}, deleting a breakpoint @kbd{C-S-d}, |
| 2545 | etc. In the remainder of this chapter we will assume that the @kbd{C-c | 2730 | etc. In the remainder of this chapter we will assume that the |
| 2546 | C-d} bindings are active, but each of these bindings will have an | 2731 | @kbd{C-c C-d} bindings are active, but each of these bindings will |
| 2547 | equivalent single-keypress shortcut if modifiers are given in the | 2732 | have an equivalent shortcut if modifiers are given in the |
| 2548 | @code{idlwave-shell-debug-modifiers} variable (see @pxref{Lesson II -- | 2733 | @code{idlwave-shell-debug-modifiers} variable (@pxref{Lesson II -- |
| 2549 | Customization}). | 2734 | Customization}). A much simpler and faster form of debugging for |
| 2735 | running code is also available by default --- see @ref{Electric Debug | ||
| 2736 | Mode}. | ||
| 2550 | 2737 | ||
| 2551 | @defopt idlwave-shell-prefix-key (@kbd{C-c C-d}) | 2738 | @defopt idlwave-shell-prefix-key (@kbd{C-c C-d}) |
| 2552 | The prefix key for the debugging map | 2739 | The prefix key for the debugging map |
| @@ -2559,53 +2746,13 @@ key, like @kbd{C-c C-d C-b}. | |||
| 2559 | @end defopt | 2746 | @end defopt |
| 2560 | 2747 | ||
| 2561 | @defopt idlwave-shell-debug-modifiers (@code{nil}) | 2748 | @defopt idlwave-shell-debug-modifiers (@code{nil}) |
| 2562 | List of modifier keys to use for additional binding of debugging | 2749 | List of modifier keys to use for additional, alternative binding of |
| 2563 | commands in the shell and source buffers. Can be one or more of | 2750 | debugging commands in the shell and source buffers. Can be one or |
| 2564 | @code{control}, @code{meta}, @code{super}, @code{hyper}, @code{alt}, and | 2751 | more of @code{control}, @code{meta}, @code{super}, @code{hyper}, |
| 2565 | @code{shift}. | 2752 | @code{alt}, and @code{shift}. |
| 2566 | @end defopt | ||
| 2567 | |||
| 2568 | @node Compiling Programs, Breakpoints and Stepping, Debug Key Bindings, Debugging IDL Programs | ||
| 2569 | @subsection Compiling Programs | ||
| 2570 | @cindex Compiling programs | ||
| 2571 | @cindex Programs, compiling | ||
| 2572 | @cindex Default command line, executing | ||
| 2573 | @cindex Executing a default command line | ||
| 2574 | |||
| 2575 | @kindex C-c C-d C-c | ||
| 2576 | In order to compile the current buffer under the IDLWAVE shell, press | ||
| 2577 | @kbd{C-c C-d C-c} (@code{idlwave-save-and-run}). This first saves the | ||
| 2578 | current buffer and then sends the command @samp{.run path/to/file} to the | ||
| 2579 | shell. You can also execute @kbd{C-c C-d C-c} from the shell buffer, in | ||
| 2580 | which case the most recently compiled buffer will be saved and | ||
| 2581 | re-compiled. | ||
| 2582 | |||
| 2583 | When developing or debugging a program, it is often necessary to execute | ||
| 2584 | the same command line many times. A convenient way to do this is | ||
| 2585 | @kbd{C-c C-d C-y} (@code{idlwave-shell-execute-default-command-line}). | ||
| 2586 | This command first resets IDL from a state of interrupted execution by | ||
| 2587 | closing all files and returning to the main interpreter level. Then a | ||
| 2588 | default command line is send to the shell. To edit the default command | ||
| 2589 | line, call @code{idlwave-shell-execute-default-command-line} with a | ||
| 2590 | prefix argument: @kbd{C-u C-c C-d C-y}. | ||
| 2591 | |||
| 2592 | @defopt idlwave-shell-mark-stop-line (@code{t}) | ||
| 2593 | Non-@code{nil} means mark the source code line where IDL is currently | ||
| 2594 | stopped. The value specifies the preferred method. Legal values are | ||
| 2595 | @code{nil}, @code{t}, @code{arrow}, and @code{face}. | ||
| 2596 | @end defopt | 2753 | @end defopt |
| 2597 | 2754 | ||
| 2598 | @defopt idlwave-shell-overlay-arrow (@code{">"}) | 2755 | @node Breakpoints and Stepping, Compiling Programs, Debug Key Bindings, Debugging IDL Programs |
| 2599 | The overlay arrow to display at source lines where execution halts, if | ||
| 2600 | configured in @code{idlwave-shell-mark-stop-line}. | ||
| 2601 | @end defopt | ||
| 2602 | |||
| 2603 | @defopt idlwave-shell-stop-line-face | ||
| 2604 | The face which highlights the source line where IDL is stopped, if | ||
| 2605 | configured in @code{idlwave-shell-mark-stop-line}. | ||
| 2606 | @end defopt | ||
| 2607 | |||
| 2608 | @node Breakpoints and Stepping, Walking the Calling Stack, Compiling Programs, Debugging IDL Programs | ||
| 2609 | @subsection Breakpoints and Stepping | 2756 | @subsection Breakpoints and Stepping |
| 2610 | @cindex Breakpoints | 2757 | @cindex Breakpoints |
| 2611 | @cindex Stepping | 2758 | @cindex Stepping |
| @@ -2613,24 +2760,33 @@ configured in @code{idlwave-shell-mark-stop-line}. | |||
| 2613 | 2760 | ||
| 2614 | @kindex C-c C-d C-b | 2761 | @kindex C-c C-d C-b |
| 2615 | @kindex C-c C-d C-b | 2762 | @kindex C-c C-d C-b |
| 2616 | You can set breakpoints and step through a program with IDLWAVE. | 2763 | IDLWAVE helps you set breakpoints and step through code. Setting a |
| 2617 | Setting a breakpoint in the current line of the source buffer is done | 2764 | breakpoint in the current line of the source buffer is accomplished |
| 2618 | with @kbd{C-c C-d C-b} (@code{idlwave-shell-break-here}). With a prefix | 2765 | with @kbd{C-c C-d C-b} (@code{idlwave-shell-break-here}). With a |
| 2619 | arg of 1 (i.e. @kbd{C-1 C-c C-d C-b}), the breakpoint gets a | 2766 | prefix arg of 1 (i.e. @kbd{C-1 C-c C-d C-b}), the breakpoint gets a |
| 2620 | @code{/ONCE} keyword, meaning that it will be deleted after first use. | 2767 | @code{/ONCE} keyword, meaning that it will be deleted after first use. |
| 2621 | With a numeric prefix greater than one (e.g. @kbd{C-4 C-c C-d C-b}), the | 2768 | With a numeric prefix greater than one (e.g. @kbd{C-4 C-c C-d C-b}), |
| 2622 | breakpoint will only be active the @code{nth} time it is hit. With a | 2769 | the breakpoint will only be active the @code{nth} time it is hit. |
| 2623 | single non-numeric prefix (i.e. @kbd{C-u C-c C-d C-b}), prompt for a | 2770 | With a single non-numeric prefix (i.e. @kbd{C-u C-c C-d C-b}), prompt |
| 2624 | condition --- an IDL expression to be evaulated and trigger the | 2771 | for a condition --- an IDL expression to be evaulated and trigger the |
| 2625 | breakpoint only if true. To clear the breakpoint in the current line, | 2772 | breakpoint only if true. To clear the breakpoint in the current line, |
| 2626 | use @kbd{C-c C-d C-d} (@code{idlwave-clear-current-bp}). When executed | 2773 | use @kbd{C-c C-d C-d} (@code{idlwave-clear-current-bp}). When |
| 2627 | from the shell window, the breakpoint where IDL is currently stopped | 2774 | executed from the shell window, the breakpoint where IDL is currently |
| 2628 | will be deleted. To clear all breakpoints, use @kbd{C-c C-d C-a} | 2775 | stopped will be deleted. To clear all breakpoints, use @kbd{C-c C-d |
| 2629 | (@code{idlwave-clear-all-bp}). Breakpoint lines are highlighted in the | 2776 | C-a} (@code{idlwave-clear-all-bp}). Breakpoints can also be disabled |
| 2630 | source code. Note that IDL places breakpoints as close as possible on | 2777 | and re-enabled: @kbd{C-c C-d C-\} |
| 2631 | or after the line you specify. IDLWAVE queries the shell for the actual | 2778 | (@code{idlwave-shell-toggle-enable-current-bp}). |
| 2632 | breakpoint location which was set, so the exact line you specify may not | 2779 | |
| 2633 | be marked. | 2780 | |
| 2781 | Breakpoint lines are highlighted or indicated with an icon in the | ||
| 2782 | source code (different icons for conditional, after, and other break | ||
| 2783 | types). Disabled breakpoints are @emph{grayed out} by default. Note | ||
| 2784 | that IDL places breakpoints as close as possible on or after the line | ||
| 2785 | you specify. IDLWAVE queries the shell for the actual breakpoint | ||
| 2786 | location which was set, so the exact line you specify may not be | ||
| 2787 | marked. You can re-sync the breakpoint list and display at any time | ||
| 2788 | (e.g., if you add or remove some on the command line) using @kbd{C-c | ||
| 2789 | C-d C-l}. | ||
| 2634 | 2790 | ||
| 2635 | Once the program has stopped somewhere, you can step through it. The | 2791 | Once the program has stopped somewhere, you can step through it. The |
| 2636 | most important stepping commands are @kbd{C-c C-d C-s} to execute one | 2792 | most important stepping commands are @kbd{C-c C-d C-s} to execute one |
| @@ -2651,6 +2807,14 @@ breakpoint and stepping commands: | |||
| 2651 | @tab Clear current breakpoint (@code{idlwave-shell-clear-current-bp}) | 2807 | @tab Clear current breakpoint (@code{idlwave-shell-clear-current-bp}) |
| 2652 | @item @kbd{C-c C-d C-a} | 2808 | @item @kbd{C-c C-d C-a} |
| 2653 | @tab Clear all breakpoints (@code{idlwave-shell-clear-all-bp}) | 2809 | @tab Clear all breakpoints (@code{idlwave-shell-clear-all-bp}) |
| 2810 | @item @kbd{C-c C-d [} | ||
| 2811 | @tab Go to the previous breakpoint (@code{idlwave-shell-goto-previous-bp}) | ||
| 2812 | @item @kbd{C-c C-d ]} | ||
| 2813 | @tab Go to the next breakpoint (@code{idlwave-shell-goto-next-bp}) | ||
| 2814 | @item @kbd{C-c C-d C-\} | ||
| 2815 | @tab Disable/Enable current breakpoint (@code{idlwave-shell-toggle-enable-current-bp}) | ||
| 2816 | @item @kbd{C-c C-d C-j} | ||
| 2817 | @tab Set a breakpoint at the beginning of the enclosing routine. | ||
| 2654 | @item @kbd{C-c C-d C-s} | 2818 | @item @kbd{C-c C-d C-s} |
| 2655 | @tab Step, into function calls (@code{idlwave-shell-step}) | 2819 | @tab Step, into function calls (@code{idlwave-shell-step}) |
| 2656 | @item @kbd{C-c C-d C-n} | 2820 | @item @kbd{C-c C-d C-n} |
| @@ -2666,13 +2830,16 @@ breakpoint and stepping commands: | |||
| 2666 | @item @kbd{C-c C-d C-h} | 2830 | @item @kbd{C-c C-d C-h} |
| 2667 | @tab Continue to line at cursor position (@code{idlwave-shell-to-here}) | 2831 | @tab Continue to line at cursor position (@code{idlwave-shell-to-here}) |
| 2668 | @item @kbd{C-c C-d C-r} | 2832 | @item @kbd{C-c C-d C-r} |
| 2669 | @tab Continue execution to next breakpoint (@code{idlwave-shell-cont}) | 2833 | @tab Continue execution to next breakpoint, if any (@code{idlwave-shell-cont}) |
| 2670 | @item @kbd{C-c C-d C-up} | 2834 | @item @kbd{C-c C-d C-up} |
| 2671 | @tab Show higher level in calling stack (@code{idlwave-shell-stack-up}) | 2835 | @tab Show higher level in calling stack (@code{idlwave-shell-stack-up}) |
| 2672 | @item @kbd{C-c C-d C-down} | 2836 | @item @kbd{C-c C-d C-down} |
| 2673 | @tab Show lower level in calling stack (@code{idlwave-shell-stack-down}) | 2837 | @tab Show lower level in calling stack (@code{idlwave-shell-stack-down}) |
| 2674 | @end multitable | 2838 | @end multitable |
| 2675 | 2839 | ||
| 2840 | All of these commands have equivalents in Electric Debug Mode, which | ||
| 2841 | provides faster access (@pxref{Electric Debug Mode}). | ||
| 2842 | |||
| 2676 | @defopt idlwave-shell-mark-breakpoints (@code{t}) | 2843 | @defopt idlwave-shell-mark-breakpoints (@code{t}) |
| 2677 | Non-@code{nil} means mark breakpoints in the source file buffers. The | 2844 | Non-@code{nil} means mark breakpoints in the source file buffers. The |
| 2678 | value indicates the preferred method. Legal values are @code{nil}, | 2845 | value indicates the preferred method. Legal values are @code{nil}, |
| @@ -2684,7 +2851,49 @@ The face for breakpoint lines in the source code if | |||
| 2684 | @code{idlwave-shell-mark-breakpoints} has the value @code{face}. | 2851 | @code{idlwave-shell-mark-breakpoints} has the value @code{face}. |
| 2685 | @end defopt | 2852 | @end defopt |
| 2686 | 2853 | ||
| 2687 | @node Walking the Calling Stack, , Breakpoints and Stepping, Debugging IDL Programs | 2854 | @node Compiling Programs, Walking the Calling Stack, Breakpoints and Stepping, Debugging IDL Programs |
| 2855 | @subsection Compiling Programs | ||
| 2856 | @cindex Compiling programs | ||
| 2857 | @cindex Programs, compiling | ||
| 2858 | @cindex Default command line, executing | ||
| 2859 | @cindex Executing a default command line | ||
| 2860 | |||
| 2861 | @kindex C-c C-d C-c | ||
| 2862 | In order to compile the current buffer under the IDLWAVE shell, press | ||
| 2863 | @kbd{C-c C-d C-c} (@code{idlwave-save-and-run}). This first saves the | ||
| 2864 | current buffer and then sends the command @samp{.run path/to/file} to the | ||
| 2865 | shell. You can also execute @kbd{C-c C-d C-c} from the shell buffer, in | ||
| 2866 | which case the most recently compiled buffer will be saved and | ||
| 2867 | re-compiled. | ||
| 2868 | |||
| 2869 | When developing or debugging a program, it is often necessary to execute | ||
| 2870 | the same command line many times. A convenient way to do this is | ||
| 2871 | @kbd{C-c C-d C-y} (@code{idlwave-shell-execute-default-command-line}). | ||
| 2872 | This command first resets IDL from a state of interrupted execution by | ||
| 2873 | closing all files and returning to the main interpreter level. Then a | ||
| 2874 | default command line is send to the shell. To edit the default command | ||
| 2875 | line, call @code{idlwave-shell-execute-default-command-line} with a | ||
| 2876 | prefix argument: @kbd{C-u C-c C-d C-y}. If no default command line has | ||
| 2877 | been set (or you give two prefix arguments), the last command on the | ||
| 2878 | @code{comint} input history is sent. | ||
| 2879 | |||
| 2880 | @defopt idlwave-shell-mark-stop-line (@code{t}) | ||
| 2881 | Non-@code{nil} means mark the source code line where IDL is currently | ||
| 2882 | stopped. The value specifies the preferred method. Legal values are | ||
| 2883 | @code{nil}, @code{t}, @code{arrow}, and @code{face}. | ||
| 2884 | @end defopt | ||
| 2885 | |||
| 2886 | @defopt idlwave-shell-overlay-arrow (@code{">"}) | ||
| 2887 | The overlay arrow to display at source lines where execution halts, if | ||
| 2888 | configured in @code{idlwave-shell-mark-stop-line}. | ||
| 2889 | @end defopt | ||
| 2890 | |||
| 2891 | @defopt idlwave-shell-stop-line-face | ||
| 2892 | The face which highlights the source line where IDL is stopped, if | ||
| 2893 | configured in @code{idlwave-shell-mark-stop-line}. | ||
| 2894 | @end defopt | ||
| 2895 | |||
| 2896 | @node Walking the Calling Stack, Electric Debug Mode, Compiling Programs, Debugging IDL Programs | ||
| 2688 | @subsection Walking the Calling Stack | 2897 | @subsection Walking the Calling Stack |
| 2689 | @cindex Calling stack, walking | 2898 | @cindex Calling stack, walking |
| 2690 | 2899 | ||
| @@ -2704,25 +2913,150 @@ for information how to examine the value of variables and expressions on | |||
| 2704 | higher calling stack levels. | 2913 | higher calling stack levels. |
| 2705 | 2914 | ||
| 2706 | @ifhtml | 2915 | @ifhtml |
| 2916 | <A NAME="EDEBUG"></A> | ||
| 2917 | @end ifhtml | ||
| 2918 | @node Electric Debug Mode, , Walking the Calling Stack, Debugging IDL Programs | ||
| 2919 | @subsection Electric Debug Mode | ||
| 2920 | @cindex Electric Debug Mode | ||
| 2921 | @cindex @samp{*Debugging*} | ||
| 2922 | |||
| 2923 | Even with a convenient debug key prefix enabled, repetitive stepping, | ||
| 2924 | variable examination (@pxref{Examining Variables}), and other | ||
| 2925 | debugging activities can be awkward and slow using commands which | ||
| 2926 | require multiple keystrokes. Luckily, there's a better way, inspired | ||
| 2927 | by the lisp e-debug mode, and available through the @emph{Electric | ||
| 2928 | Debug Mode}. By default, as soon as a breakpoint is hit, this minor | ||
| 2929 | mode is enabled. The buffer showing the line where execution has | ||
| 2930 | halted is switched to Electric Debug Mode. This mode is visible as | ||
| 2931 | @samp{*Debugging*} in the mode line, and a different face (violet by | ||
| 2932 | default, where color is available) for the line stopped at point. The | ||
| 2933 | buffer is made read-only and single-character bindings for the most | ||
| 2934 | commonly used debugging commands are enabled: | ||
| 2935 | |||
| 2936 | @multitable @columnfractions .2 .8 | ||
| 2937 | @item @kbd{a} | ||
| 2938 | @tab Clear all breakpoints (@code{idlwave-shell-clear-all-bp}) | ||
| 2939 | @item @kbd{b} | ||
| 2940 | @tab Set breakpoint, @kbd{C-u b} for a conditional break, @kbd{C-n b} for nth hit (@code{idlwave-shell-break-here}) | ||
| 2941 | @item @kbd{d} | ||
| 2942 | @tab Clear current breakpoint (@code{idlwave-shell-clear-current-bp}) | ||
| 2943 | @item @kbd{h} | ||
| 2944 | @tab Continue to the line at cursor position (@code{idlwave-shell-to-here}) | ||
| 2945 | @item @kbd{i} | ||
| 2946 | @tab Set breakpoint in function named here (@code{idlwave-shell-break-in}) | ||
| 2947 | @item @kbd{[} | ||
| 2948 | @tab Go to the previous breakpoint in the file (@code{idlwave-shell-goto-previous-bp}) | ||
| 2949 | @item @kbd{]} | ||
| 2950 | @tab Go to the next breakpoint in the file | ||
| 2951 | (@code{idlwave-shell-goto-next-bp}) | ||
| 2952 | @item @kbd{\} | ||
| 2953 | @tab Disable/Enable current breakpoint (@code{idlwave-shell-toggle-enable-current-bp}) | ||
| 2954 | @item @kbd{j} | ||
| 2955 | @tab Set breakpoint at beginning of enclosing routine (@code{idlwave-shell-break-this-module}) | ||
| 2956 | @item @kbd{k} | ||
| 2957 | @tab Skip one statement (@code{idlwave-shell-skip}) | ||
| 2958 | @item @kbd{m} | ||
| 2959 | @tab Continue to end of function (@code{idlwave-shell-return}) | ||
| 2960 | @item @kbd{n} | ||
| 2961 | @tab Step, over function calls (@code{idlwave-shell-stepover}) | ||
| 2962 | @item @kbd{o} | ||
| 2963 | @tab Continue past end of function (@code{idlwave-shell-out}) | ||
| 2964 | @item @kbd{p} | ||
| 2965 | @tab Print expression near point or in region with @kbd{C-u p} (@code{idlwave-shell-print}) | ||
| 2966 | @item @kbd{q} | ||
| 2967 | @tab End the debugging session and return to the Shell's main level | ||
| 2968 | (@code{idlwave-shell-retall}) | ||
| 2969 | @item @kbd{r} | ||
| 2970 | @tab Continue execution to next breakpoint, if any (@code{idlwave-shell-cont}) | ||
| 2971 | @item @kbd{s} or @kbd{@key{SPACE}} | ||
| 2972 | @tab Step, into function calls (@code{idlwave-shell-step}) | ||
| 2973 | @item @kbd{t} | ||
| 2974 | @tab Print a calling-level traceback in the shell | ||
| 2975 | @item @kbd{u} | ||
| 2976 | @tab Continue to end of block (@code{idlwave-shell-up}) | ||
| 2977 | @item @kbd{v} | ||
| 2978 | @tab Turn Electric Debug Mode off | ||
| 2979 | (@code{idlwave-shell-electric-debug-mode}) | ||
| 2980 | @item @kbd{x} | ||
| 2981 | @tab Examine expression near point (or in region with @kbd{C-u x}) | ||
| 2982 | with shortcut of examine type. | ||
| 2983 | @item @kbd{z} | ||
| 2984 | @tab Reset IDL (@code{idlwave-shell-reset}) | ||
| 2985 | @item @kbd{+} or @kbd{=} | ||
| 2986 | @tab Show higher level in calling stack (@code{idlwave-shell-stack-up}) | ||
| 2987 | @item @kbd{-} or @kbd{_} | ||
| 2988 | @tab Show lower level in calling stack (@code{idlwave-shell-stack-down}) | ||
| 2989 | @item @kbd{?} | ||
| 2990 | @tab Help on expression near point or in region with @kbd{C-u ?} | ||
| 2991 | (@code{idlwave-shell-help-expression}) | ||
| 2992 | @item @kbd{C-?} | ||
| 2993 | @tab Show help on the commands available. | ||
| 2994 | @end multitable | ||
| 2995 | |||
| 2996 | Most single-character electric debug bindings use the final keystroke | ||
| 2997 | of the equivalent multiple key commands (which are of course also | ||
| 2998 | still available), but some differ (e.g. @kbd{t},@kbd{q},@kbd{x}). | ||
| 2999 | Some have additional convenience bindings (like @kbd{@key{SPACE}} for | ||
| 3000 | stepping). All prefix and other argument options described in this | ||
| 3001 | section for the commands invoked by electric debug bindings are still | ||
| 3002 | valid. For example, @kbd{C-u b} sets a conditional breakpoint, just | ||
| 3003 | as it did with @kbd{C-u C-c C-d C-b}. | ||
| 3004 | |||
| 3005 | You can toggle the electric debug mode at any time in a buffer using | ||
| 3006 | @kbd{C-c C-d C-v} (@kbd{v} to turn it off while in the mode), or from | ||
| 3007 | the Debug menu. Normally the mode will be enabled and disabled at the | ||
| 3008 | appropriate times, but occassionally you might want to edit a file | ||
| 3009 | while still debugging it, or switch to the mode for conveniently | ||
| 3010 | setting lots of breakpoints. | ||
| 3011 | |||
| 3012 | To quickly abandon a debugging session and return to normal editing at | ||
| 3013 | the Shell's main level, use @kbd{q} (@code{idlwave-shell-retall}). | ||
| 3014 | This disables electric debug mode in all IDLWAVE buffers@footnote{Note | ||
| 3015 | that this binding is not symmetric: @kbd{C-c C-d C-q} is bound to | ||
| 3016 | @code{idlwave-shell-quit}, which quits your IDL session.}. Help is | ||
| 3017 | available for the command shortcuts with @kbd{C-?}. If you find this | ||
| 3018 | mode gets in your way, you can keep it from automatically activating | ||
| 3019 | by setting the variable @code{idlwave-shell-automatic-electric-debug} | ||
| 3020 | to @code{nil}, or @code{'breakpoint}. If you'd like the convenient | ||
| 3021 | electric debug shortcuts available also when run-time errors are | ||
| 3022 | encountered, set to @code{t}. | ||
| 3023 | |||
| 3024 | @defopt idlwave-shell-automatic-electric-debug (@code{'breakpoint}) | ||
| 3025 | Whether to enter electric debug mode automatically when a breakpoint | ||
| 3026 | or run-time error is encountered, and then disable it in all buffers | ||
| 3027 | when the $MAIN$ level is reached (either through normal program | ||
| 3028 | execution, or retall). In addition to @code{nil} for never, and | ||
| 3029 | @code{t} for both breakpoints and errors, this can be | ||
| 3030 | @code{'breakpoint} (the default) to enable it only at breakpoint | ||
| 3031 | halts. | ||
| 3032 | @end defopt | ||
| 3033 | |||
| 3034 | @defopt idlwave-shell-electric-zap-to-file (@code{t}) | ||
| 3035 | If set, when entering electric debug mode, select the window displaying | ||
| 3036 | the file where point is stopped. This takes point away from the shell | ||
| 3037 | window, but is useful for immediate stepping, etc. | ||
| 3038 | @end defopt | ||
| 3039 | |||
| 3040 | @ifhtml | ||
| 2707 | <A NAME="EXAMINE"></A> | 3041 | <A NAME="EXAMINE"></A> |
| 2708 | @end ifhtml | 3042 | @end ifhtml |
| 2709 | @node Examining Variables, Custom Expression Examination, Debugging IDL Programs, The IDLWAVE Shell | 3043 | @node Examining Variables, Custom Expression Examination, Debugging IDL Programs, The IDLWAVE Shell |
| 2710 | @section Examining Variables | 3044 | @section Examining Variables |
| 2711 | @cindex @code{PRINT} expressions | 3045 | @cindex @code{PRINT} expressions |
| 2712 | @cindex @code{HELP}, on expressions | 3046 | @cindex @code{HELP}, on expressions |
| 2713 | @cindex Expressions, printing | 3047 | @cindex Expressions, printing & help |
| 2714 | @cindex Expressions, help | 3048 | @cindex Examining expressions |
| 2715 | @cindex Printing expressions | 3049 | @cindex Printing expressions |
| 2716 | @cindex Mouse binding to print expressions | 3050 | @cindex Mouse binding to print expressions |
| 2717 | 3051 | ||
| 2718 | @kindex C-c C-d C-p | 3052 | @kindex C-c C-d C-p |
| 2719 | Do you find yourself repeatedly typing, e.g. @code{print,n_elements(x)}, | 3053 | Do you find yourself repeatedly typing, |
| 2720 | and similar statements to remind yourself of the | 3054 | e.g. @code{print,n_elements(x)}, and similar statements to remind |
| 2721 | type/size/structure/value/etc. of variables and expressions in your code | 3055 | yourself of the type/size/structure/value/etc. of variables and |
| 2722 | or at the command line? IDLWAVE has a suite of special commands to | 3056 | expressions in your code or at the command line? IDLWAVE has a suite |
| 2723 | automate these types of variables or expression examinations. They work | 3057 | of special commands to automate these types of variable or expression |
| 2724 | by sending statements to the shell formatted to include the indicated | 3058 | examinations. They work by sending statements to the shell formatted |
| 2725 | expression. | 3059 | to include the indicated expression. |
| 2726 | 3060 | ||
| 2727 | These examination commands can be used in the shell or buffer at any | 3061 | These examination commands can be used in the shell or buffer at any |
| 2728 | time (as long as the shell is running), and are very useful when | 3062 | time (as long as the shell is running), and are very useful when |
| @@ -2730,7 +3064,7 @@ execution is stopped in a buffer due to a triggered breakpoint or error, | |||
| 2730 | or while composing a long command in the IDLWAVE shell. In the latter | 3064 | or while composing a long command in the IDLWAVE shell. In the latter |
| 2731 | case, the command is sent to the shell and its output is visible, but | 3065 | case, the command is sent to the shell and its output is visible, but |
| 2732 | point remains unmoved in the command being composed --- you can inspect | 3066 | point remains unmoved in the command being composed --- you can inspect |
| 2733 | the constituents of a command you're building without interrupting the | 3067 | the contituents of a command you're building without interrupting the |
| 2734 | process of building it! You can even print arbitrary expressions from | 3068 | process of building it! You can even print arbitrary expressions from |
| 2735 | older input or output further up in the shell window --- any expression, | 3069 | older input or output further up in the shell window --- any expression, |
| 2736 | variable, number, or function you see can be examined. | 3070 | variable, number, or function you see can be examined. |
| @@ -2743,13 +3077,14 @@ contents, and @key{q} hides the buffer. | |||
| 2743 | 3077 | ||
| 2744 | The two most basic examine commands are bound to @kbd{C-c C-d C-p}, to | 3078 | The two most basic examine commands are bound to @kbd{C-c C-d C-p}, to |
| 2745 | print the expression at point, and @kbd{C-c C-d ?}, to invoke help on | 3079 | print the expression at point, and @kbd{C-c C-d ?}, to invoke help on |
| 2746 | this expression. The expression at point is either an array expression | 3080 | this expression@footnote{Available as @kbd{p} and @kbd{?} in Electric |
| 2747 | or a function call, or the contents of a pair of parentheses. The | 3081 | Debug Mode (@pxref{Electric Debug Mode})}. The expression at point is |
| 2748 | selected expression is highlighted, and simultaneously the resulting | 3082 | either an array expression or a function call, or the contents of a |
| 2749 | output is highlighted in the shell. Calling the above commands with a | 3083 | pair of parentheses. The selected expression is highlighted, and |
| 2750 | prefix argument will prompt for an expression instead of using the one | 3084 | simultaneously the resulting output is highlighted in the shell. |
| 2751 | at point. Two prefix arguments (@kbd{C-u C-u C-c C-d C-p}) will use the | 3085 | Calling the above commands with a prefix argument will use the current |
| 2752 | current region as expression. | 3086 | region as expression instead of using the one at point. Two prefix |
| 3087 | arguments (@kbd{C-u C-u C-c C-d C-p}) will prompt for an expression. | ||
| 2753 | 3088 | ||
| 2754 | For added speed and convenience, there are mouse bindings which allow | 3089 | For added speed and convenience, there are mouse bindings which allow |
| 2755 | you to click on expressions and examine their values. Use | 3090 | you to click on expressions and examine their values. Use |
| @@ -2757,10 +3092,10 @@ you to click on expressions and examine their values. Use | |||
| 2757 | help (i.e. you need to hold down @key{META} and @key{CONTROL} while | 3092 | help (i.e. you need to hold down @key{META} and @key{CONTROL} while |
| 2758 | clicking with the middle mouse button). If you simply click, the | 3093 | clicking with the middle mouse button). If you simply click, the |
| 2759 | nearest expression will be selected in the same manner as described | 3094 | nearest expression will be selected in the same manner as described |
| 2760 | above. You can also @emph{drag} the mouse in order to highlight exactly | 3095 | above. You can also @emph{drag} the mouse in order to highlight |
| 2761 | a specific expression or sub-expression to be examined. For custom | 3096 | exactly the specific expression or sub-expression you want to examine. |
| 2762 | expression examination, and the customizable pop-up examine selection, | 3097 | For custom expression examination, and the powerful customizable |
| 2763 | @xref{Custom Expression Examination}. | 3098 | pop-up examine selection, @xref{Custom Expression Examination}. |
| 2764 | 3099 | ||
| 2765 | @cindex Printing expressions, on calling stack | 3100 | @cindex Printing expressions, on calling stack |
| 2766 | @cindex Restrictions for expression printing | 3101 | @cindex Restrictions for expression printing |
| @@ -2782,7 +3117,8 @@ with a @samp{( )} will be interpreted as function calls. | |||
| 2782 | @cindex ROUTINE_NAMES, IDL procedure | 3117 | @cindex ROUTINE_NAMES, IDL procedure |
| 2783 | N.B.: printing values of expressions on higher levels of the calling | 3118 | N.B.: printing values of expressions on higher levels of the calling |
| 2784 | stack uses the @emph{unsupported} IDL routine @code{ROUTINE_NAMES}, | 3119 | stack uses the @emph{unsupported} IDL routine @code{ROUTINE_NAMES}, |
| 2785 | which may or may not be available in future versions of IDL. | 3120 | which may or may not be available in future versions of IDL. Caveat |
| 3121 | Examinor. | ||
| 2786 | @end itemize | 3122 | @end itemize |
| 2787 | 3123 | ||
| 2788 | @defopt idlwave-shell-expression-face | 3124 | @defopt idlwave-shell-expression-face |
| @@ -2792,14 +3128,14 @@ the expression printed by IDL. | |||
| 2792 | @end defopt | 3128 | @end defopt |
| 2793 | 3129 | ||
| 2794 | @defopt idlwave-shell-output-face | 3130 | @defopt idlwave-shell-output-face |
| 2795 | The face for @code{idlwave-shell-output-overlay}. | 3131 | The face for @code{idlwave-shell-output-overlay}. |
| 2796 | Allows to choose the font, color and other properties for the most | 3132 | Allows to choose the font, color and other properties for the most |
| 2797 | recent output of IDL when examining an expression." | 3133 | recent output of IDL when examining an expression." |
| 2798 | @end defopt | 3134 | @end defopt |
| 2799 | 3135 | ||
| 2800 | @defopt idlwave-shell-separate-examine-output (@code{t}) | 3136 | @defopt idlwave-shell-separate-examine-output (@code{t}) |
| 2801 | If non-@code{nil}, re-direct the output of examine commands to a special | 3137 | If non-@code{nil}, re-direct the output of examine commands to a special |
| 2802 | @file{*Examine*} buffer, instead of in the shell itself. | 3138 | @file{*Examine*} buffer, instead of in the shell itself. |
| 2803 | @end defopt | 3139 | @end defopt |
| 2804 | 3140 | ||
| 2805 | @node Custom Expression Examination, , Examining Variables, The IDLWAVE Shell | 3141 | @node Custom Expression Examination, , Examining Variables, The IDLWAVE Shell |
| @@ -2812,45 +3148,53 @@ endless (just look, for instance, at the keyword list to | |||
| 2812 | @code{widget_info()}). Rather than attempt to include them all, IDLWAVE | 3148 | @code{widget_info()}). Rather than attempt to include them all, IDLWAVE |
| 2813 | provides two easy methods to customize your own commands, with a special | 3149 | provides two easy methods to customize your own commands, with a special |
| 2814 | mouse examine command, and two macros for generating your own examine | 3150 | mouse examine command, and two macros for generating your own examine |
| 2815 | bindings. | 3151 | key and mouse bindings. |
| 2816 | 3152 | ||
| 2817 | The most powerful and flexible mouse examine command is available on | 3153 | The most powerful and flexible mouse examine command of all is |
| 2818 | @kbd{C-S-Mouse-2}. Just as for all the other mouse examine commands, it | 3154 | available on @kbd{C-S-Mouse-2}. Just as for all the other mouse |
| 2819 | permits click or drag expression selection, but instead of sending | 3155 | examine commands, it permits click or drag expression selection, but |
| 2820 | hard-coded commands to the shell, it pops-up a customizable selection | 3156 | instead of sending hard-coded commands to the shell, it pops-up a |
| 2821 | list of examine functions to choose among, configured with the | 3157 | customizable selection list of examine functions to choose among, |
| 2822 | @code{idlwave-shell-examine-alist} variable. This variable is a list of | 3158 | configured with the @code{idlwave-shell-examine-alist} |
| 2823 | key-value pairs (an @emph{alist} in Emacs parlance), where the keys name | 3159 | variable@footnote{In Electric Debug Mode (@pxref{Electric Debug |
| 2824 | the command, and the values are the command strings, in which the text | 3160 | Mode}), the key @kbd{x} provides a single-character shortcut interface |
| 2825 | @code{___} (three underscores) will be replaced by the selected | 3161 | to the same examine functions for the expression at point or marked by |
| 2826 | expression before being sent to the shell. An example might be key | 3162 | the region.}. This variable is a list of key-value pairs (an |
| 2827 | @code{Structure Help} with value @code{help,___,/STRUCTURE}. | 3163 | @emph{alist} in Emacs parlance), where the key gives a name to be |
| 2828 | @code{idlwave-shell-examine-alist} comes by default with a large list of | 3164 | shown for the examine command, and the value is the command strings |
| 2829 | examine commands, but can be easily customized to add more. | 3165 | itself, in which the text @code{___} (three underscores) will be |
| 2830 | 3166 | replaced by the selected expression before being sent to the shell. | |
| 2831 | In addition to the pop-up mouse command, you can easily create your own | 3167 | An example might be key @code{Structure Help} with value |
| 2832 | customized bindings to inspect expressions using the two convenience | 3168 | @code{help,___,/STRUCTURE}. In that case, you'd be prompted with |
| 2833 | macros @code{idlwave-shell-inspect} and | 3169 | @emph{Structure Help}, which might send something like |
| 2834 | @code{idlwave-shell-mouse-inspect}. These create keyboard or | 3170 | @code{help,var,/STRUCTURE} to the shell for output. |
| 2835 | mouse-based custom inspections of variables, sharing all the same | 3171 | @code{idlwave-shell-examine-alist} comes configured by default with a |
| 2836 | properties of the built-in examine commands. Both functions take a | 3172 | large list of examine commands, but you can easily customize it to add |
| 2837 | single string argument sharing the syntax of the | 3173 | your own. |
| 3174 | |||
| 3175 | In addition to configuring the functions available to the pop-up mouse | ||
| 3176 | command, you can easily create your own customized bindings to inspect | ||
| 3177 | expressions using the two convenience macros | ||
| 3178 | @code{idlwave-shell-examine} and @code{idlwave-shell-mouse-examine}. | ||
| 3179 | These create keyboard or mouse-based custom inspections of variables, | ||
| 3180 | sharing all the same properties of the built-in examine commands. | ||
| 3181 | Both functions take a single string argument sharing the syntax of the | ||
| 2838 | @code{idlwave-shell-examine-alist} values, e.g.: | 3182 | @code{idlwave-shell-examine-alist} values, e.g.: |
| 2839 | 3183 | ||
| 2840 | @lisp | 3184 | @lisp |
| 2841 | (add-hook 'idlwave-shell-mode-hook | 3185 | (add-hook 'idlwave-shell-mode-hook |
| 2842 | (lambda () | 3186 | (lambda () |
| 2843 | (idlwave-shell-define-key-both [s-down-mouse-2] | 3187 | (idlwave-shell-define-key-both [s-down-mouse-2] |
| 2844 | (idlwave-shell-mouse-examine | 3188 | (idlwave-shell-mouse-examine |
| 2845 | "print, size(___,/DIMENSIONS)")) | 3189 | "print, size(___,/DIMENSIONS)")) |
| 2846 | (idlwave-shell-define-key-both [f9] (idlwave-shell-examine | 3190 | (idlwave-shell-define-key-both [f9] (idlwave-shell-examine |
| 2847 | "print, size(___,/DIMENSIONS)")) | 3191 | "print, size(___,/DIMENSIONS)")) |
| 2848 | (idlwave-shell-define-key-both [f10] (idlwave-shell-examine | 3192 | (idlwave-shell-define-key-both [f10] (idlwave-shell-examine |
| 2849 | "print,size(___,/TNAME)")) | 3193 | "print,size(___,/TNAME)")) |
| 2850 | (idlwave-shell-define-key-both [f11] (idlwave-shell-examine | 3194 | (idlwave-shell-define-key-both [f11] (idlwave-shell-examine |
| 2851 | "help,___,/STRUCTURE")))) | 3195 | "help,___,/STRUCTURE")))) |
| 2852 | @end lisp | 3196 | @end lisp |
| 2853 | 3197 | ||
| 2854 | @noindent Now pressing @key{f9}, or middle-mouse dragging with the | 3198 | @noindent Now pressing @key{f9}, or middle-mouse dragging with the |
| 2855 | @key{SUPER} key depressed, will print the dimensions of the nearby or | 3199 | @key{SUPER} key depressed, will print the dimensions of the nearby or |
| 2856 | highlighted expression. Pressing @key{f10} will give the type string, | 3200 | highlighted expression. Pressing @key{f10} will give the type string, |
| @@ -2858,10 +3202,10 @@ and @key{f11} will show the contents of a nearby structure. As you can | |||
| 2858 | see, the possibilities are only marginally finite. | 3202 | see, the possibilities are only marginally finite. |
| 2859 | 3203 | ||
| 2860 | @defopt idlwave-shell-examine-alist | 3204 | @defopt idlwave-shell-examine-alist |
| 2861 | An alist of examine commands in which the keys name the command and are | 3205 | An alist of examine commands in which the keys name the command and |
| 2862 | displayed in the selection pop-up, and the values are custom IDL examine | 3206 | are displayed in the selection pop-up, and the values are custom IDL |
| 2863 | command strings to send, after all instances of @code{___} are replaced | 3207 | examine command strings to send, after all instances of @code{___} |
| 2864 | by the indicated expression. | 3208 | (three underscores) are replaced by the indicated expression. |
| 2865 | @end defopt | 3209 | @end defopt |
| 2866 | 3210 | ||
| 2867 | 3211 | ||
| @@ -2872,7 +3216,6 @@ by the indicated expression. | |||
| 2872 | @menu | 3216 | @menu |
| 2873 | * Installing IDLWAVE:: How to install the distribution | 3217 | * Installing IDLWAVE:: How to install the distribution |
| 2874 | * Installing Online Help:: Where to get the additional files needed | 3218 | * Installing Online Help:: Where to get the additional files needed |
| 2875 | * Upgrading from idl.el:: Necessary configuration changes | ||
| 2876 | @end menu | 3219 | @end menu |
| 2877 | 3220 | ||
| 2878 | @node Installing IDLWAVE, Installing Online Help, Installation, Installation | 3221 | @node Installing IDLWAVE, Installing Online Help, Installation, Installation |
| @@ -2889,65 +3232,34 @@ IDLWAVE is part of Emacs 21.1 and later. It is also an XEmacs package | |||
| 2889 | and can be installed from | 3232 | and can be installed from |
| 2890 | @uref{ftp://ftp.xemacs.org/pub/xemacs/packages/,the XEmacs ftp site} | 3233 | @uref{ftp://ftp.xemacs.org/pub/xemacs/packages/,the XEmacs ftp site} |
| 2891 | with the normal package management system on XEmacs 21. These | 3234 | with the normal package management system on XEmacs 21. These |
| 2892 | pre-installed versions should work out-of-the-box. However, the files | 3235 | pre-installed versions should work out-of-the-box. However, the HTML |
| 2893 | required for online help are not distributed with XEmacs/Emacs and have | 3236 | files required for online HTML help are not distributed with |
| 2894 | to be installed separately@footnote{Due to copyright reasons, the ASCII | 3237 | XEmacs/Emacs and have to be installed separately@footnote{Due to |
| 2895 | version of the IDL manual cannot be distributed under the GPL.} | 3238 | copyright reasons, the HTML version of the IDL manual cannot be |
| 2896 | (@pxref{Installing Online Help}). | 3239 | distributed under the GPL.} (@pxref{Installing Online Help}). |
| 2897 | 3240 | ||
| 2898 | You can also download IDLWAVE and install it yourself from | 3241 | You can also download IDLWAVE and install it yourself from |
| 2899 | @uref{@value{IDLWAVE-HOMEPAGE}, the maintainers webpage}. Follow the | 3242 | @uref{@value{IDLWAVE-HOMEPAGE}, the maintainers webpage}. Follow the |
| 2900 | instructions in the INSTALL file. | 3243 | instructions in the INSTALL file. |
| 2901 | 3244 | ||
| 2902 | @node Installing Online Help, Upgrading from idl.el, Installing IDLWAVE, Installation | 3245 | @node Installing Online Help, , Installing IDLWAVE, Installation |
| 2903 | @section Installing Online Help | 3246 | @section Installing Online Help |
| 2904 | @cindex Installing online help | 3247 | @cindex Installing online help |
| 2905 | @cindex Online Help, Installation | 3248 | @cindex Online Help, Installation |
| 2906 | 3249 | ||
| 2907 | If you want to use the online help display, two additional files (an | 3250 | If you want to use the online help display, an additional set of files |
| 2908 | ASCII version of the IDL documentation and a topics/code file) must be | 3251 | (HTML versions of the IDL documentation) must be installed. These |
| 2909 | installed. These files can also be downloaded from | 3252 | files can also be downloaded from @uref{@value{IDLWAVE-HOMEPAGE}, the |
| 2910 | @uref{@value{IDLWAVE-HOMEPAGE}, the maintainers webpage}. You need to | 3253 | maintainers webpage}. You need to place the files somewhere on your |
| 2911 | place the files somewhere on your system and tell IDLWAVE where they are | 3254 | system and tell IDLWAVE where they are with |
| 2912 | with | ||
| 2913 | 3255 | ||
| 2914 | @lisp | 3256 | @lisp |
| 2915 | (setq idlwave-help-directory "/path/to/help/files/") | 3257 | (setq idlwave-html-help-location "/path/to/help/dir/") ;e.g. /usr/local/etc |
| 2916 | @end lisp | 3258 | @end lisp |
| 2917 | 3259 | ||
| 2918 | @node Upgrading from idl.el, , Installing Online Help, Installation | 3260 | Note that the help package only changes with new versions of the IDL |
| 2919 | @section Upgrading from the old @b{@file{idl.el}} file | 3261 | documentation, and need not be updated unless your version of IDL |
| 2920 | @cindex Upgrading from old @b{@file{idl.el}} | 3262 | changes. |
| 2921 | @cindex Renaming old variables | ||
| 2922 | @cindex Old variables, renaming | ||
| 2923 | @kindex M-@key{TAB} | ||
| 2924 | |||
| 2925 | If you have been using the old @file{idl.el} and @file{idl-shell.el} | ||
| 2926 | files and would like to use IDLWAVE, you need to update your | ||
| 2927 | customization in @file{.emacs}. | ||
| 2928 | |||
| 2929 | @enumerate | ||
| 2930 | @item | ||
| 2931 | Change all variable and function prefixes from @samp{idl-} to @samp{idlwave-}. | ||
| 2932 | @item | ||
| 2933 | Remove the now invalid @code{autoload} and @code{auto-mode-alist} forms | ||
| 2934 | pointing to the @file{idl.el} and @file{idl-shell.el} files. Install | ||
| 2935 | the new autoload forms. | ||
| 2936 | @item | ||
| 2937 | If you have been using the hook function recommended in earlier versions | ||
| 2938 | to get a separate frame for the IDL shell, remove that command from your | ||
| 2939 | @code{idlwave-shell-mode-hook}. Instead, set the variable | ||
| 2940 | @code{idlwave-shell-use-dedicated-frame} with | ||
| 2941 | @lisp | ||
| 2942 | (setq idlwave-shell-use-dedicated-frame t) | ||
| 2943 | @end lisp | ||
| 2944 | @item | ||
| 2945 | The key sequence @kbd{M-@key{TAB}} no longer inserts a TAB character. | ||
| 2946 | Like in many other Emacs modes, @kbd{M-@key{TAB}} now does | ||
| 2947 | completion. Inserting a TAB has therefore been moved to | ||
| 2948 | @kbd{C-@key{TAB}}. On a character based terminal you can also use | ||
| 2949 | @kbd{C-c @key{SPC}}. | ||
| 2950 | @end enumerate | ||
| 2951 | 3263 | ||
| 2952 | @node Acknowledgements, Sources of Routine Info, Installation, Top | 3264 | @node Acknowledgements, Sources of Routine Info, Installation, Top |
| 2953 | @chapter Acknowledgements | 3265 | @chapter Acknowledgements |
| @@ -2973,10 +3285,11 @@ of the package from version 3.0, during which time he overhauled almost | |||
| 2973 | everything, modernized IDLWAVE with many new features, and developed the | 3285 | everything, modernized IDLWAVE with many new features, and developed the |
| 2974 | manual. | 3286 | manual. |
| 2975 | 3287 | ||
| 2976 | @item | 3288 | @item |
| 2977 | @uref{mailto:jdsmith@@as.arizona.edu, @b{J.D. Smith}}, the current | 3289 | @uref{mailto:jdsmith@@as.arizona.edu, @b{J.D. Smith}}, the current |
| 2978 | maintainer, as of version 4.10, helped shape object method completion | 3290 | maintainer, as of version 4.10, helped shape object method completion |
| 2979 | and most new features introduced in versions 4.x. | 3291 | and most new features introduced in versions 4.x, and added |
| 3292 | significant new capabilities for versions 5.x. | ||
| 2980 | @end itemize | 3293 | @end itemize |
| 2981 | 3294 | ||
| 2982 | @noindent | 3295 | @noindent |
| @@ -2985,43 +3298,45 @@ with patches, ideas, bug reports and suggestions. | |||
| 2985 | 3298 | ||
| 2986 | @itemize @minus | 3299 | @itemize @minus |
| 2987 | @item | 3300 | @item |
| 2988 | Ulrik Dickow <dickow@@nbi.dk> | 3301 | Ulrik Dickow <dickow__at__nbi.dk> |
| 2989 | @item | 3302 | @item |
| 2990 | Eric E. Dors <edors@@lanl.gov> | 3303 | Eric E. Dors <edors__at__lanl.gov> |
| 2991 | @item | 3304 | @item |
| 2992 | Stein Vidar H. Haugan <s.v.h.haugan@@astro.uio.no> | 3305 | Stein Vidar H. Haugan <s.v.h.haugan__at__astro.uio.no> |
| 2993 | @item | 3306 | @item |
| 2994 | David Huenemoerder <dph@@space.mit.edu> | 3307 | David Huenemoerder <dph__at__space.mit.edu> |
| 2995 | @item | 3308 | @item |
| 2996 | Kevin Ivory <Kevin.Ivory@@linmpi.mpg.de> | 3309 | Kevin Ivory <Kevin.Ivory__at__linmpi.mpg.de> |
| 2997 | @item | 3310 | @item |
| 2998 | Dick Jackson <dick@@d-jackson.com> | 3311 | Dick Jackson <dick__at__d-jackson.com> |
| 2999 | @item | 3312 | @item |
| 3000 | Xuyong Liu <liu@@stsci.edu> | 3313 | Xuyong Liu <liu__at__stsci.edu> |
| 3001 | @item | 3314 | @item |
| 3002 | Simon Marshall <Simon.Marshall@@esrin.esa.it> | 3315 | Simon Marshall <Simon.Marshall__at__esrin.esa.it> |
| 3003 | @item | 3316 | @item |
| 3004 | Craig Markwardt <craigm@@cow.physics.wisc.edu> | 3317 | Craig Markwardt <craigm__at__cow.physics.wisc.edu> |
| 3005 | @item | 3318 | @item |
| 3006 | Laurent Mugnier <mugnier@@onera.fr> | 3319 | Laurent Mugnier <mugnier__at__onera.fr> |
| 3007 | @item | 3320 | @item |
| 3008 | Lubos Pochman <lubos@@rsinc.com> | 3321 | Lubos Pochman <lubos__at__rsinc.com> |
| 3009 | @item | 3322 | @item |
| 3010 | Bob Portmann <portmann@@al.noaa.gov> | 3323 | Bob Portmann <portmann__at__al.noaa.gov> |
| 3011 | @item | 3324 | @item |
| 3012 | Patrick M. Ryan <pat@@jaameri.gsfc.nasa.gov> | 3325 | Patrick M. Ryan <pat__at__jaameri.gsfc.nasa.gov> |
| 3013 | @item | 3326 | @item |
| 3014 | Marty Ryba <ryba@@ll.mit.edu> | 3327 | Marty Ryba <ryba__at__ll.mit.edu> |
| 3015 | @item | 3328 | @item |
| 3016 | Phil Williams <williams@@irc.chmcc.org> | 3329 | Phil Williams <williams__at__irc.chmcc.org> |
| 3017 | @item | 3330 | @item |
| 3018 | Phil Sterne <sterne@@dublin.llnl.gov> | 3331 | Phil Sterne <sterne__at__dublin.llnl.gov> |
| 3332 | @item | ||
| 3333 | Paul Sorenson <aardvark62__at__msn.com> | ||
| 3019 | @end itemize | 3334 | @end itemize |
| 3020 | 3335 | ||
| 3021 | @noindent | 3336 | @noindent |
| 3022 | Thanks to everyone! | 3337 | Thanks to everyone! |
| 3023 | 3338 | ||
| 3024 | @node Sources of Routine Info, Configuration Examples, Acknowledgements, Top | 3339 | @node Sources of Routine Info, HTML Help Browser Tips, Acknowledgements, Top |
| 3025 | @appendix Sources of Routine Info | 3340 | @appendix Sources of Routine Info |
| 3026 | 3341 | ||
| 3027 | @cindex Sources of routine information | 3342 | @cindex Sources of routine information |
| @@ -3033,7 +3348,7 @@ know about the accessible routines. | |||
| 3033 | @menu | 3348 | @menu |
| 3034 | * Routine Definitions:: Where IDL Routines are defined. | 3349 | * Routine Definitions:: Where IDL Routines are defined. |
| 3035 | * Routine Information Sources:: So how does IDLWAVE know about... | 3350 | * Routine Information Sources:: So how does IDLWAVE know about... |
| 3036 | * Library Catalog:: Scanning the Libraries for Routine Info | 3351 | * Catalogs:: |
| 3037 | * Load-Path Shadows:: Routines defined in several places | 3352 | * Load-Path Shadows:: Routines defined in several places |
| 3038 | * Documentation Scan:: Scanning the IDL Manuals | 3353 | * Documentation Scan:: Scanning the IDL Manuals |
| 3039 | @end menu | 3354 | @end menu |
| @@ -3051,14 +3366,14 @@ know about the accessible routines. | |||
| 3051 | several places: | 3366 | several places: |
| 3052 | 3367 | ||
| 3053 | @enumerate | 3368 | @enumerate |
| 3054 | @item | 3369 | @item |
| 3055 | @emph{Builtin routines} are defined inside IDL itself. The source | 3370 | @emph{Builtin routines} are defined inside IDL itself. The source |
| 3056 | code of such routines is not available. | 3371 | code of such routines is not available. |
| 3057 | @item | 3372 | @item |
| 3058 | Routines which are @emph{part of the current program}, are defined in a | 3373 | Routines which are @emph{part of the current program}, are defined in a |
| 3059 | file explicitly compiled by the user. This file may or may not be | 3374 | file explicitly compiled by the user. This file may or may not be |
| 3060 | located on the IDL search path. | 3375 | located on the IDL search path. |
| 3061 | @item | 3376 | @item |
| 3062 | @emph{Library routines} are defined in files located on IDL's search | 3377 | @emph{Library routines} are defined in files located on IDL's search |
| 3063 | path, and will not need to be manually compiled. When a library routine | 3378 | path, and will not need to be manually compiled. When a library routine |
| 3064 | is called for the first time, IDL will find the source file and compile | 3379 | is called for the first time, IDL will find the source file and compile |
| @@ -3072,7 +3387,7 @@ or included as dynamically loaded modules (DLMs). Currently IDLWAVE | |||
| 3072 | cannot provide routine info and completion for such external routines. | 3387 | cannot provide routine info and completion for such external routines. |
| 3073 | @end enumerate | 3388 | @end enumerate |
| 3074 | 3389 | ||
| 3075 | @node Routine Information Sources, Library Catalog, Routine Definitions, Sources of Routine Info | 3390 | @node Routine Information Sources, Catalogs, Routine Definitions, Sources of Routine Info |
| 3076 | @appendixsec Routine Information Sources | 3391 | @appendixsec Routine Information Sources |
| 3077 | @cindex Routine info sources | 3392 | @cindex Routine info sources |
| 3078 | @cindex Builtin list of routines | 3393 | @cindex Builtin list of routines |
| @@ -3087,21 +3402,21 @@ routines on a system, IDLWAVE collects data from many sources: | |||
| 3087 | @enumerate | 3402 | @enumerate |
| 3088 | 3403 | ||
| 3089 | @item | 3404 | @item |
| 3090 | It has a @emph{builtin list} with the properties of the builtin IDL | 3405 | It has a @emph{builtin list} with information about the routines IDL |
| 3091 | routines. IDLWAVE @value{VERSION} is distributed with a list of | 3406 | ships with. IDLWAVE @value{VERSION} is distributed with a list of |
| 3092 | @value{NSYSROUTINES} routines and @value{NSYSKEYWORDS} keywords, | 3407 | @value{NSYSROUTINES} routines and @value{NSYSKEYWORDS} keywords, |
| 3093 | reflecting IDL version @value{IDLVERSION}. This list has been created | 3408 | reflecting IDL version @value{IDLVERSION}. This list has been created |
| 3094 | by scanning the IDL manuals and is stored in the file | 3409 | by scanning the IDL manuals and is stored in the file |
| 3095 | @file{idlw-rinfo.el}. @xref{Documentation Scan}, for information on how | 3410 | @file{idlw-rinfo.el}. @xref{Documentation Scan}, for information on |
| 3096 | to regenerate this file for new versions of IDL. | 3411 | how to regenerate this file for new versions of IDL. |
| 3097 | 3412 | ||
| 3098 | @item | 3413 | @item |
| 3099 | It @emph{scans} all @emph{buffers} of the current Emacs session for | 3414 | It @emph{scans} all @emph{buffers} of the current Emacs session for |
| 3100 | routine definitions. This is done automatically when routine | 3415 | routine definitions. This is done automatically when routine |
| 3101 | information or completion is first requested by the user. Each new | 3416 | information or completion is first requested by the user. Each new |
| 3102 | buffer and each buffer which is saved after making changes is also | 3417 | buffer and each buffer saved after making changes is also scanned. The |
| 3103 | scanned. The command @kbd{C-c C-i} (@code{idlwave-update-routine-info}) | 3418 | command @kbd{C-c C-i} (@code{idlwave-update-routine-info}) can be used |
| 3104 | can be used at any time to rescan all buffers. | 3419 | at any time to rescan all buffers. |
| 3105 | 3420 | ||
| 3106 | @item | 3421 | @item |
| 3107 | If you have an IDLWAVE-Shell running in the Emacs session, IDLWAVE will | 3422 | If you have an IDLWAVE-Shell running in the Emacs session, IDLWAVE will |
| @@ -3113,19 +3428,28 @@ requested by the user, and each time an Emacs buffer is compiled with | |||
| 3113 | routine data. | 3428 | routine data. |
| 3114 | 3429 | ||
| 3115 | @item | 3430 | @item |
| 3116 | IDLWAVE can scan all or selected library source files and store the | 3431 | Many popular libraries are distributed with routine information |
| 3117 | result in a file which will be automatically loaded just like | 3432 | already scanned into @emph{library catalogs} (@pxref{Library |
| 3118 | @file{idlw-rinfo.el}. @xref{Library Catalog}, for information how to | 3433 | Catalogs}). These per-directory catalog files can also be built by |
| 3119 | scan library files. | 3434 | the user with the supplied @file{idlwave_catalog} tool. |
| 3435 | |||
| 3436 | @item | ||
| 3437 | IDLWAVE can scan selected directories of source files and store the | ||
| 3438 | result in a single @emph{user catalog} file which will be | ||
| 3439 | automatically loaded just like @file{idlw-rinfo.el}. @xref{User | ||
| 3440 | Catalog}, for information on how to scan files in this way. | ||
| 3120 | @end enumerate | 3441 | @end enumerate |
| 3121 | 3442 | ||
| 3122 | Loading routine and catalog information is a time consuming process. | 3443 | Loading routine and catalog information can be a time consuming process, |
| 3123 | Depending on the system and network configuration it can take up to 30 | 3444 | especially over slow networks. Depending on the system and network |
| 3124 | seconds. In order to minimize the waiting time upon your first | 3445 | configuration it could take up to 30 seconds. In order to minimize the |
| 3125 | completion or routine info command in a session, IDLWAVE uses Emacs idle | 3446 | wait time upon your first completion or routine info command in a |
| 3126 | time to do the initialization in 5 steps, yielding to user input in | 3447 | session, IDLWAVE uses Emacs idle time to do the initialization in six |
| 3127 | between. If this gets into your way, set the variable | 3448 | steps, yielding to user input in between. If this gets into your way, |
| 3128 | @code{idlwave-init-rinfo-when-idle-after} to 0 (zero). | 3449 | set the variable @code{idlwave-init-rinfo-when-idle-after} to 0 (zero). |
| 3450 | The more routines documented in library and user catalogs, the slower | ||
| 3451 | the loading will be, so reducing this number can help alleviate any long | ||
| 3452 | load times. | ||
| 3129 | 3453 | ||
| 3130 | @defopt idlwave-init-rinfo-when-idle-after (@code{10}) | 3454 | @defopt idlwave-init-rinfo-when-idle-after (@code{10}) |
| 3131 | Seconds of idle time before routine info is automatically initialized. | 3455 | Seconds of idle time before routine info is automatically initialized. |
| @@ -3144,82 +3468,199 @@ Non-@code{nil} means query the shell for info about compiled routines. | |||
| 3144 | Controls under what circumstances routine info is updated automatically. | 3468 | Controls under what circumstances routine info is updated automatically. |
| 3145 | @end defopt | 3469 | @end defopt |
| 3146 | 3470 | ||
| 3147 | @node Library Catalog, Load-Path Shadows, Routine Information Sources, Sources of Routine Info | 3471 | @ifhtml |
| 3148 | @appendixsec Library Catalog | 3472 | <A NAME="CATALOGS"></A> |
| 3149 | @cindex Library scan | 3473 | @end ifhtml |
| 3150 | @cindex Library catalog | 3474 | @node Catalogs, Load-Path Shadows, Routine Information Sources, Sources of Routine Info |
| 3475 | @appendixsec Catalogs | ||
| 3476 | @cindex Catalogs | ||
| 3477 | |||
| 3478 | @emph{Catalogs} are files containing scanned information on individual | ||
| 3479 | routines, including arguments and keywords, calling sequence, file path, | ||
| 3480 | class and procedure vs. function type, etc. They represent a way of | ||
| 3481 | extending the internal built-in information available for IDL system | ||
| 3482 | routines (@pxref{Routine Info}) to other source collections. | ||
| 3483 | |||
| 3484 | Starting with version 5.0, there are two types of catalogs available | ||
| 3485 | with IDLWAVE. The traditional @emph{user catalog} and the newer | ||
| 3486 | @emph{library catalogs}. Although they can be used interchangeably, the | ||
| 3487 | library catalogs are more flexible, and preferred. There are few | ||
| 3488 | occasions when a user catalog might be preferred --- read below. Both | ||
| 3489 | types of catalogs can coexist without causing problems. | ||
| 3490 | |||
| 3491 | To facilitate the catalog systems, IDLWAVE stores information it gathers | ||
| 3492 | from the shell about the IDL search paths, and can write this | ||
| 3493 | information out automatically, or on-demand (menu @code{Debug->Save Path | ||
| 3494 | Info}). On systems with no shell from which to discover the path | ||
| 3495 | information (e.g. Windows), a library path must be specified in | ||
| 3496 | @code{idlwave-library-path} to allow library catalogs to be located, and | ||
| 3497 | to setup directories for user catalog scan (@pxref{User Catalog} for | ||
| 3498 | more on this variable). | ||
| 3499 | |||
| 3500 | @defopt idlwave-auto-write-path (@code{t}) | ||
| 3501 | Write out information on the !PATH and !DIR paths from IDL automatically | ||
| 3502 | when they change and when the Shell is closed. These paths are needed | ||
| 3503 | to locate library catalogs. | ||
| 3504 | @end defopt | ||
| 3505 | |||
| 3506 | @defopt idlwave-library-path | ||
| 3507 | IDL library path for Windows and MacOS. Not needed under Unix/MacOSX. | ||
| 3508 | @end defopt | ||
| 3509 | |||
| 3510 | @defopt idlwave-system-directory | ||
| 3511 | The IDL system directory for Windows and MacOS. Not needed under | ||
| 3512 | Unix/MacOSX (obtained from the Shell). | ||
| 3513 | @end defopt | ||
| 3514 | |||
| 3515 | @defopt idlwave-config-directory (@file{~/.idlwave}) | ||
| 3516 | Default path where IDLWAVE saves configuration information and any | ||
| 3517 | user catalog. | ||
| 3518 | @end defopt | ||
| 3519 | |||
| 3520 | @menu | ||
| 3521 | * Library Catalogs:: | ||
| 3522 | * User Catalog:: | ||
| 3523 | @end menu | ||
| 3524 | |||
| 3525 | @ifhtml | ||
| 3526 | <A NAME="LIBRARY_CATALOGS"></A> | ||
| 3527 | @end ifhtml | ||
| 3528 | @node Library Catalogs, User Catalog, Catalogs, Catalogs | ||
| 3529 | @appendixsubsec Library Catalogs | ||
| 3530 | @cindex @file{.idlwave_catalog} | ||
| 3531 | @cindex Library catalogs | ||
| 3532 | @cindex @code{idlwave_catalog} | ||
| 3533 | |||
| 3534 | Library catalogs are files named @file{.idlwave_catalog} stored in | ||
| 3535 | directories containing @code{.pro} routine files. They are discovered | ||
| 3536 | on the IDL search path and loaded automatically when routine information | ||
| 3537 | is read. Each catalog file documents the routines found in that | ||
| 3538 | directory --- one catalog per directory. Every catalog has a library | ||
| 3539 | name associated with it (e.g. @emph{AstroLib}). This name will be shown | ||
| 3540 | briefly when the catalog is found, and in the routine info of routines | ||
| 3541 | it documents. | ||
| 3542 | |||
| 3543 | Many popular libraries of routines are shipped with IDLWAVE catalog | ||
| 3544 | files by default, and so will be automatically discovered. Library | ||
| 3545 | catalogs are scanned externally to Emacs using a tool provided with | ||
| 3546 | IDLWAVE. Each catalog can be re-scanned independently of any other. | ||
| 3547 | Catalogs can easily be made available system-wide with a common source | ||
| 3548 | repository, providing uniform routine information, and lifting the | ||
| 3549 | burden of scanning from the user (who may not even know they're using a | ||
| 3550 | scanned catalog). Since all catalogs are independent, they can be | ||
| 3551 | re-scanned automatically to gather updates, e.g. in a @file{cron} job. | ||
| 3552 | Scanning is much faster than with the built-in user catalog method. One | ||
| 3553 | minor disadvantage: the entire IDL search path is scanned for catalog | ||
| 3554 | files every time IDLWAVE starts up, which might be slow over a network. | ||
| 3555 | |||
| 3556 | A Perl tool to create library catalogs is distributed with IDLWAVE: | ||
| 3557 | @code{idlwave_catalog}. It can be called quite simply: | ||
| 3558 | @example | ||
| 3559 | idlwave_catalog MyLib | ||
| 3560 | @end example | ||
| 3561 | |||
| 3562 | @noindent This would scan all directories recursively beneath the current and | ||
| 3563 | populate them with @file{.idlwave_catalog} files, tagging the routines | ||
| 3564 | found with the name library ``MyLib''. The full usage information: | ||
| 3565 | |||
| 3566 | @example | ||
| 3567 | Usage: idlwave_catalog [-l] [-v] [-d] [-s] [-f] [-h] libname | ||
| 3568 | libname - Unique name of the catalog (4 or more alphanumeric | ||
| 3569 | characters). | ||
| 3570 | -l - Scan local directory only, otherwise recursively | ||
| 3571 | catalog all directories at or beneath this one. | ||
| 3572 | -v - Print verbose information. | ||
| 3573 | -d - Instead of scanning, delete all .idlwave_catalog files | ||
| 3574 | here or below. | ||
| 3575 | -s - Be silent. | ||
| 3576 | -f - Force overwriting any catalogs found with a different | ||
| 3577 | library name. | ||
| 3578 | -h - Print this usage. | ||
| 3579 | @end example | ||
| 3580 | |||
| 3581 | To re-load the library catalogs on the IDL path, force a system routine | ||
| 3582 | info update using a single prefix to @code{idlwave-update-routine-info}: | ||
| 3583 | @kbd{C-u C-c C-i}. | ||
| 3584 | |||
| 3585 | @defopt idlwave-use-library-catalogs (@code{t}) | ||
| 3586 | Whether to search for and load library catalogs. Only disable if | ||
| 3587 | performance is a problem and the catalogs are not needed. | ||
| 3588 | @end defopt | ||
| 3589 | |||
| 3590 | @node User Catalog, , Library Catalogs, Catalogs | ||
| 3591 | @appendixsubsec User Catalog | ||
| 3592 | @cindex User catalog | ||
| 3151 | @cindex IDL library routine info | 3593 | @cindex IDL library routine info |
| 3152 | @cindex Windows | 3594 | @cindex Windows |
| 3153 | @cindex MacOS | 3595 | @cindex MacOS |
| 3154 | @cindex IDL variable @code{!DIR} | 3596 | @cindex IDL variable @code{!DIR} |
| 3155 | @cindex @code{!DIR}, IDL variable | 3597 | @cindex @code{!DIR}, IDL variable |
| 3156 | 3598 | ||
| 3599 | The user catalog is the old routine catalog system. It is produced | ||
| 3600 | within Emacs, and stored in a single file in the user's home directory | ||
| 3601 | (@file{.idlwave/idlusercat.el} by default). Although library catalogs | ||
| 3602 | are more flexible, there may be reasons to prefer a user catalog | ||
| 3603 | instead, including: | ||
| 3604 | |||
| 3605 | @itemize @bullet | ||
| 3606 | @item The scan is internal to Emacs, so you don't need a working Perl | ||
| 3607 | installation, as you do for library catalogs. | ||
| 3608 | @item Can be used to scan directories for which the user has no write | ||
| 3609 | privileges. | ||
| 3610 | @item Easy widget-based path selection. | ||
| 3611 | @end itemize | ||
| 3612 | |||
| 3613 | However, no routine info is available in the user catalog by default; | ||
| 3614 | the user must actively complete a scan. In addition, this type of | ||
| 3615 | catalog is all or nothing: if a single routine changes, the entire | ||
| 3616 | catalog must be rescanned to update it. Creating the user catalog is | ||
| 3617 | also much slower than scanning library catalogs. | ||
| 3157 | 3618 | ||
| 3158 | IDLWAVE can extract routine information from library modules and store | 3619 | You can scan any of the directories on the currently known path. Under |
| 3159 | that information in a file. To do this, the variable | 3620 | Windows and MacOS (not OSX), you need to specify the IDL search path in |
| 3160 | @code{idlwave-libinfo-file} needs to contain the path to a file in an | 3621 | the variable @code{idlwave-library-path}, and the location of the IDL |
| 3161 | existing directory (the default is @code{"~/.idlcat.el"}). Since the | 3622 | directory (the value of the @code{!DIR} system variable) in the variable |
| 3162 | file will contain lisp code, its name should end in @file{.el}. Under | 3623 | @code{idlwave-system-directory}, like this@footnote{The initial @samp{+} |
| 3163 | Windows and MacOS, you also need to specify the search path for IDL | 3624 | leads to recursive expansion of the path, just like in IDL}: |
| 3164 | library files in the variable @code{idlwave-library-path}, and the | ||
| 3165 | location of the IDL directory (the value of the @code{!DIR} system | ||
| 3166 | variable) in the variable @code{idlwave-system-directory}, like | ||
| 3167 | this@footnote{The initial @samp{+} leads to recursive expansion of the | ||
| 3168 | path, just like in IDL}: | ||
| 3169 | 3625 | ||
| 3170 | @lisp | 3626 | @lisp |
| 3171 | (setq idlwave-library-path | 3627 | (setq idlwave-library-path |
| 3172 | '("+c:/RSI/IDL54/lib/" "+c:/user/me/idllibs" )) | 3628 | '("+c:/RSI/IDL56/lib/" "+c:/user/me/idllibs")) |
| 3173 | (setq idlwave-system-directory "c:/RSI/IDL54/") | 3629 | (setq idlwave-system-directory "c:/RSI/IDL56/") |
| 3174 | @end lisp | 3630 | @end lisp |
| 3175 | 3631 | ||
| 3176 | @noindent Under GNU and UNIX, these values will be automatically inferred from | 3632 | @noindent Under GNU and UNIX, these values will be automatically gathered from |
| 3177 | an IDLWAVE shell. | 3633 | the IDLWAVE shell. |
| 3178 | 3634 | ||
| 3179 | The command @kbd{M-x idlwave-create-libinfo-file} can then be used to | 3635 | The command @kbd{M-x idlwave-create-user-catalog-file} (or the menu item |
| 3180 | scan library files. It brings up a widget in which you can select some | 3636 | @samp{IDLWAVE->Routine Info->Select Catalog Directories} can then be |
| 3181 | or all directories on the search path. If you only want to have routine | 3637 | used to create a user catalog. It brings up a widget in which you can |
| 3182 | and completion info of some libraries, it is sufficient to scan those | 3638 | select some or all directories on the search path. Directories which |
| 3183 | directories. However, if you want IDLWAVE to detect possible name | 3639 | already contain a library catalog are marked with @samp{[LIB]}, and need |
| 3184 | conflicts with routines defined in other libraries, the whole pass | 3640 | not be scanned (although there is no harm if you do so, other than the |
| 3185 | should be scanned. | 3641 | additional memory used for the duplication). |
| 3186 | 3642 | ||
| 3187 | After selecting directories, click on the @w{@samp{[Scan & Save]}} | 3643 | After selecting directories, click on the @w{@samp{[Scan & Save]}} |
| 3188 | button in the widget to scan all files in the selected directories and | 3644 | button in the widget to scan all files in the selected directories and |
| 3189 | write the resulting routine information into the file | 3645 | write out the resulting routine information. In order to update the |
| 3190 | @code{idlwave-libinfo-file}. In order to update the library information | 3646 | library information using the directory selection, call the command |
| 3191 | from the same directories, call the command | ||
| 3192 | @code{idlwave-update-routine-info} with a double prefix argument: | 3647 | @code{idlwave-update-routine-info} with a double prefix argument: |
| 3193 | @w{@kbd{C-u C-u C-c C-i}}. This will rescan files in the previously | 3648 | @w{@kbd{C-u C-u C-c C-i}}. This will rescan files in the previously |
| 3194 | selected directories, write an updated version of the libinfo file and | 3649 | selected directories, write an updated version of the user catalog file |
| 3195 | rebuild IDLWAVE's internal lists. If you give three prefix arguments | 3650 | and rebuild IDLWAVE's internal lists. If you give three prefix |
| 3196 | @w{@kbd{C-u C-u C-u C-c C-i}}, updating will be done with a background | 3651 | arguments @w{@kbd{C-u C-u C-u C-c C-i}}, updating will be done with a |
| 3197 | job@footnote{Unix systems only, I think.}. You can continue to work, | 3652 | background job@footnote{Unix systems only, I think.}. You can continue |
| 3198 | and the library catalog will be re-read when it is ready. | 3653 | to work, and the library catalog will be re-read when it is ready. If |
| 3199 | 3654 | you find you need to update the user catalog often, you should consider | |
| 3200 | A note of caution: Depending on your local installation, the IDL | 3655 | building a library catalog for your routines instead (@pxref{Library |
| 3201 | library can be very large. Parsing it for routine information will take | 3656 | Catalogs}). |
| 3202 | time and loading this information into Emacs can require a | ||
| 3203 | significant amount of memory. However, having this information | ||
| 3204 | available will be a great help. | ||
| 3205 | |||
| 3206 | @defopt idlwave-libinfo-file | ||
| 3207 | File for routine information of the IDL library. | ||
| 3208 | @end defopt | ||
| 3209 | |||
| 3210 | @defopt idlwave-library-path | ||
| 3211 | IDL library path for Windows and MacOS. Not needed under Unix. | ||
| 3212 | @end defopt | ||
| 3213 | |||
| 3214 | @defopt idlwave-system-directory | ||
| 3215 | The IDL system directory for Windows and MacOS. Not needed under Unix. | ||
| 3216 | @end defopt | ||
| 3217 | 3657 | ||
| 3218 | @defopt idlwave-special-lib-alist | 3658 | @defopt idlwave-special-lib-alist |
| 3219 | Alist of regular expressions matching special library directories. | 3659 | Alist of regular expressions matching special library directories for |
| 3660 | labeling in routine-info display. | ||
| 3220 | @end defopt | 3661 | @end defopt |
| 3221 | 3662 | ||
| 3222 | @node Load-Path Shadows, Documentation Scan, Library Catalog, Sources of Routine Info | 3663 | @node Load-Path Shadows, Documentation Scan, Catalogs, Sources of Routine Info |
| 3223 | @appendixsec Load-Path Shadows | 3664 | @appendixsec Load-Path Shadows |
| 3224 | @cindex Load-path shadows | 3665 | @cindex Load-path shadows |
| 3225 | @cindex Shadows, load-path | 3666 | @cindex Shadows, load-path |
| @@ -3229,18 +3670,19 @@ Alist of regular expressions matching special library directories. | |||
| 3229 | @cindex Application, testing for shadowing | 3670 | @cindex Application, testing for shadowing |
| 3230 | @cindex Buffer, testing for shadowing | 3671 | @cindex Buffer, testing for shadowing |
| 3231 | 3672 | ||
| 3232 | IDLWAVE can compile a list of routines which are defined in several | 3673 | IDLWAVE can compile a list of routines which are (re-)defined in more |
| 3233 | different files. Since one definition will hide (shadow) the others | 3674 | than one file. Since one definition will hide (shadow) the others |
| 3234 | depending on which file is compiled first, such multiple definitions are | 3675 | depending on which file is compiled first, such multiple definitions are |
| 3235 | called "load-path shadows". IDLWAVE has several routines to scan for | 3676 | called "load-path shadows". IDLWAVE has several routines to scan for |
| 3236 | load path shadows. The output is placed into the special buffer | 3677 | load path shadows. The output is placed into the special buffer |
| 3237 | @file{*Shadows*}. The format of the output is identical to the source | 3678 | @file{*Shadows*}. The format of the output is identical to the source |
| 3238 | section of the routine info buffer (@pxref{Routine Info}). The | 3679 | section of the routine info buffer (@pxref{Routine Info}). The |
| 3239 | different definitions of a routine are listed in the sequence of | 3680 | different definitions of a routine are ordered by @emph{likelihood of |
| 3240 | @emph{likelihood of use}. So the first entry will be most likely the | 3681 | use}. So the first entry will be most likely the one you'll get if an |
| 3241 | one you'll get if an unsuspecting command uses that routine. Before | 3682 | unsuspecting command uses that routine. Before listing shadows, you |
| 3242 | listing shadows, you should make sure that routine info is up-to-date by | 3683 | should make sure that routine info is up-to-date by pressing @kbd{C-c |
| 3243 | pressing @kbd{C-c C-i}. Here are the different routines: | 3684 | C-i}. Here are the different routines (also available in the Menu |
| 3685 | @samp{IDLWAVE->Routine Info}): | ||
| 3244 | 3686 | ||
| 3245 | @table @asis | 3687 | @table @asis |
| 3246 | @item @kbd{M-x idlwave-list-buffer-load-path-shadows} | 3688 | @item @kbd{M-x idlwave-list-buffer-load-path-shadows} |
| @@ -3257,9 +3699,9 @@ then check for shadowing. | |||
| 3257 | This command checks all routines accessible to IDLWAVE for conflicts. | 3699 | This command checks all routines accessible to IDLWAVE for conflicts. |
| 3258 | @end table | 3700 | @end table |
| 3259 | 3701 | ||
| 3260 | For these commands to work properly you should have scanned the entire | 3702 | For these commands to work fully you need to scan the entire load path |
| 3261 | load path, not just selected directories. Also, IDLWAVE should be able | 3703 | in either a user or library catalog. Also, IDLWAVE should be able to |
| 3262 | to distinguish between the system library files (normally installed in | 3704 | distinguish between the system library files (normally installed in |
| 3263 | @file{/usr/local/rsi/idl/lib}) and any site specific or user specific | 3705 | @file{/usr/local/rsi/idl/lib}) and any site specific or user specific |
| 3264 | files. Therefore, such local files should not be installed inside the | 3706 | files. Therefore, such local files should not be installed inside the |
| 3265 | @file{lib} directory of the IDL directory. This is also advisable for | 3707 | @file{lib} directory of the IDL directory. This is also advisable for |
| @@ -3279,37 +3721,108 @@ Another way to find out if a specific routine has multiple definitions | |||
| 3279 | on the load path is routine info display (@pxref{Routine Info}). | 3721 | on the load path is routine info display (@pxref{Routine Info}). |
| 3280 | 3722 | ||
| 3281 | @node Documentation Scan, , Load-Path Shadows, Sources of Routine Info | 3723 | @node Documentation Scan, , Load-Path Shadows, Sources of Routine Info |
| 3282 | @appendixsec Documentation Scan | 3724 | @appendixsec Documentation Scan |
| 3283 | @cindex @file{get_rinfo} | 3725 | @cindex @file{get_html_rinfo} |
| 3284 | @cindex @file{idlw-rinfo.el} | 3726 | @cindex @file{idlw-rinfo.el} |
| 3285 | @cindex @file{idlw-help.txt} | ||
| 3286 | @cindex @file{idlw-help.el} | ||
| 3287 | @cindex Scanning the documentation | 3727 | @cindex Scanning the documentation |
| 3288 | @cindex Perl program, to create @file{idlw-rinfo.el} | 3728 | @cindex Perl program, to create @file{idlw-rinfo.el} |
| 3289 | 3729 | ||
| 3290 | IDLWAVE derives it knowledge about system routines from the IDL | 3730 | IDLWAVE derives its knowledge about system routines from the IDL |
| 3291 | manuals. The file @file{idlw-rinfo.el} contains the routine information | 3731 | manuals. The file @file{idlw-rinfo.el} contains the routine information |
| 3292 | for the IDL system routines. The Online Help feature of IDLWAVE | 3732 | for the IDL system routines, and links to relevant sections of the HTML |
| 3293 | requires ASCII versions of some IDL manuals to be available in a | 3733 | documentation. The Online Help feature of IDLWAVE requires HTML |
| 3294 | specific format (@file{idlw-help.txt}), along with an Emacs-Lisp file | 3734 | versions of the IDL manuals to be available; the HTML documentation is |
| 3295 | @file{idlw-help.el} with supporting code and pointers to the ASCII file. | 3735 | not distributed with IDLWAVE by default, but must be downloaded |
| 3296 | 3736 | separately from the @uref{@value{IDLWAVE-HOMEPAGE}, the maintainers | |
| 3297 | All 3 files can be derived from the IDL documentation. If you are | 3737 | webpage}. |
| 3298 | lucky, the maintainer of IDLWAVE will always have access to the newest | 3738 | |
| 3299 | version of IDL and provide updates. The IDLWAVE distribution also | 3739 | The HTML files and related images can be produced from the |
| 3300 | contains the Perl program @file{get_rinfo} which constructs these files | 3740 | @file{idl.chm} HTMLHelp file distributed with IDL using the free |
| 3301 | by scanning selected files from the IDL documentation. Instructions on | 3741 | Microsoft HTML Help Workshop. If you are lucky, the maintainer of |
| 3302 | how to use @file{get_rinfo} are in the program itself. | 3742 | IDLWAVE will always have access to the newest version of IDL and |
| 3303 | 3743 | provide updates. The IDLWAVE distribution also contains the Perl | |
| 3304 | One particularly frustrating situation occurs when a new IDL version is | 3744 | program @file{get_html_rinfo} which constructs the |
| 3305 | released without the associated documentation updates. Instead, a | 3745 | @file{idlw-rinfo.el} file by scanning the HTML documents produced from |
| 3306 | @emph{What's New} file containing new and updated documentation is | 3746 | the IDL documentation. Instructions on how to use |
| 3307 | shipped alongside the previous version's reference material. The | 3747 | @file{get_html_rinfo} are in the program itself. |
| 3308 | @file{get_rinfo} script can merge this new information into the standard | 3748 | |
| 3309 | help text and routine information, as long as it is pre-formatted in a | 3749 | @node HTML Help Browser Tips, Configuration Examples, Sources of Routine Info, Top |
| 3310 | simple way. See @file{get_rinfo} for more information. | 3750 | @appendix HTML Help Browser Tips |
| 3311 | 3751 | @cindex Browser Tips | |
| 3312 | @node Configuration Examples, Windows and MacOS, Sources of Routine Info, Top | 3752 | |
| 3753 | There are a wide variety of possible browsers to use for displaying | ||
| 3754 | the online HTML help available with IDLWAVE (starting with version | ||
| 3755 | 5.0). Since IDLWAVE runs on a many different system types, a single | ||
| 3756 | browser configuration is not possible, but choices abound. | ||
| 3757 | |||
| 3758 | On many systems, the default browser configured in | ||
| 3759 | @code{browse-url-browser-function}, and hence inherited by default by | ||
| 3760 | @code{idlwave-help-browser-function}, is Netscape. Unfortunately, the | ||
| 3761 | HTML manuals decompiled from the original RSI source contain | ||
| 3762 | formatting structures which Netscape 4.x does not handle well, though | ||
| 3763 | they are still readable. A much better choice is Mozilla, or one of | ||
| 3764 | the Mozilla-derived browsers such as | ||
| 3765 | @uref{http://galeon.sourceforge.net/,Galeon} (Linux), | ||
| 3766 | @uref{http://www.mozilla.org/projects/camino/,Camino} (MacOSX), or | ||
| 3767 | @uref{http://www.mozilla.org/projects/firebird/,Firebird} (all | ||
| 3768 | platforms). Newer versions of Emacs provide a browser-function choice | ||
| 3769 | @code{browse-url-gnome-moz} which uses the Gnome-configured browser. | ||
| 3770 | |||
| 3771 | Note that the HTML files decompiled from RSI Microsoft Help sources | ||
| 3772 | contain specific references to the @samp{Symbol} font, which by default | ||
| 3773 | is not permitted in normal encodings (it's technically illegal). Though | ||
| 3774 | it only impacts a few symbols, you can trick Mozilla-based browsers into | ||
| 3775 | recognizing @samp{Symbol} by following the directions | ||
| 3776 | @uref{http://hutchinson.belmont.ma.us/tth/Xfonts.html, here}. With this | ||
| 3777 | fix in place, HTML help pages look almost identical to their PDF | ||
| 3778 | equivalents (yet can be bookmarked, browsed as history, searched, etc.). | ||
| 3779 | |||
| 3780 | @noindent Individual platform recommendations: | ||
| 3781 | |||
| 3782 | @itemize @bullet | ||
| 3783 | @item Windows: The native Microsoft HTMLHelp browser is preferred, | ||
| 3784 | with even better results using the free | ||
| 3785 | @uref{http://www.keyworks.net/keyhh.htm,@code{KEYHH}} program to | ||
| 3786 | permit IDL help to be targetted to a single window. To use HTMLHelp, | ||
| 3787 | specify @code{idlwave-help-use-hh} as @code{'hh} or @code{'keyhh}. | ||
| 3788 | One bonus: since IDL is shipped with the @file{idl.chm} help file, you | ||
| 3789 | don't need to download the HTML help package. @xref{Help with HTML | ||
| 3790 | Documentation}. | ||
| 3791 | @item Unix/MacOSX: The @uref{http://www.w3m.org,@code{w3m}} browser | ||
| 3792 | and its associated | ||
| 3793 | @uref{http://emacs-w3m.namazu.org/,@code{emacs-w3m}} emacs mode | ||
| 3794 | provide in-buffer browsing with image display, and excellent speed and | ||
| 3795 | formatting. Both the Emacs mode and the browser itself must be | ||
| 3796 | downloaded separately. To use this browser, include | ||
| 3797 | |||
| 3798 | @lisp | ||
| 3799 | (setq idlwave-help-browser-function 'w3m-browse-url) | ||
| 3800 | @end lisp | ||
| 3801 | |||
| 3802 | in your @file{.emacs}. Setting a few other nice @code{w3m} options | ||
| 3803 | cuts down on screen clutter: | ||
| 3804 | |||
| 3805 | @lisp | ||
| 3806 | (setq w3m-use-tab nil | ||
| 3807 | w3m-use-header-line nil | ||
| 3808 | w3m-use-toolbar nil) | ||
| 3809 | @end lisp | ||
| 3810 | |||
| 3811 | If you use a dedicated frame for help, you might want to add the | ||
| 3812 | following, to get consistent behavior with the @kbd{q} key: | ||
| 3813 | |||
| 3814 | @lisp | ||
| 3815 | ;; Close my help window when w3m closes. | ||
| 3816 | (defadvice w3m-close-window (after idlwave-close activate) | ||
| 3817 | (if (boundp 'idlwave-help-frame) | ||
| 3818 | (idlwave-help-quit))) | ||
| 3819 | @end lisp | ||
| 3820 | |||
| 3821 | Note that you can open the file in an external browser from within | ||
| 3822 | @code{w3m} using @kbd{M}. | ||
| 3823 | @end itemize | ||
| 3824 | |||
| 3825 | @node Configuration Examples, Windows and MacOS, HTML Help Browser Tips, Top | ||
| 3313 | @appendix Configuration Examples | 3826 | @appendix Configuration Examples |
| 3314 | @cindex Configuration examples | 3827 | @cindex Configuration examples |
| 3315 | @cindex Example configuration | 3828 | @cindex Example configuration |
| @@ -3370,7 +3883,7 @@ user is King! | |||
| 3370 | (setq idlwave-main-block-indent 3) | 3883 | (setq idlwave-main-block-indent 3) |
| 3371 | (setq idlwave-end-offset -3) | 3884 | (setq idlwave-end-offset -3) |
| 3372 | (setq idlwave-continuation-indent 1) | 3885 | (setq idlwave-continuation-indent 1) |
| 3373 | (setq idlwave-begin-line-comment "^;[^;]") ; Leave ";" but not ";;" | 3886 | (setq idlwave-begin-line-comment "^;[^;]") ; Leave ";" but not ";;" |
| 3374 | ; anchored at start of line. | 3887 | ; anchored at start of line. |
| 3375 | (setq idlwave-surround-by-blank t) ; Turn on padding ops =,<,> | 3888 | (setq idlwave-surround-by-blank t) ; Turn on padding ops =,<,> |
| 3376 | (setq idlwave-pad-keyword nil) ; Remove spaces for keyword '=' | 3889 | (setq idlwave-pad-keyword nil) ; Remove spaces for keyword '=' |
| @@ -3388,6 +3901,18 @@ user is King! | |||
| 3388 | ("SETPROPERTY" .t) | 3901 | ("SETPROPERTY" .t) |
| 3389 | ("GETPROPERTY" .t))) | 3902 | ("GETPROPERTY" .t))) |
| 3390 | 3903 | ||
| 3904 | ;; Using w3m for help (must install w3m and emacs-w3m) | ||
| 3905 | (autoload 'w3m-browse-url "w3m" "Interface for w3m on Emacs." t) | ||
| 3906 | (setq idlwave-help-browser-function 'w3m-browse-url | ||
| 3907 | w3m-use-tab nil ; no tabs, location line, or toolbar | ||
| 3908 | w3m-use-header-line nil | ||
| 3909 | w3m-use-toolbar nil) | ||
| 3910 | |||
| 3911 | ;; Close my help window or frame when w3m closes with `q' | ||
| 3912 | (defadvice w3m-close-window (after idlwave-close activate) | ||
| 3913 | (if (boundp 'idlwave-help-frame) | ||
| 3914 | (idlwave-help-quit))) | ||
| 3915 | |||
| 3391 | ;; Some setting can only be done from a mode hook. Here is an example: | 3916 | ;; Some setting can only be done from a mode hook. Here is an example: |
| 3392 | (add-hook 'idlwave-mode-hook | 3917 | (add-hook 'idlwave-mode-hook |
| 3393 | (lambda () | 3918 | (lambda () |
| @@ -3395,6 +3920,7 @@ user is King! | |||
| 3395 | ;; Run other functions here | 3920 | ;; Run other functions here |
| 3396 | (font-lock-mode 1) ; Turn on font-lock mode | 3921 | (font-lock-mode 1) ; Turn on font-lock mode |
| 3397 | (idlwave-auto-fill-mode 0) ; Turn off auto filling | 3922 | (idlwave-auto-fill-mode 0) ; Turn off auto filling |
| 3923 | (setq idlwave-help-browser-function 'browse-url-w3) | ||
| 3398 | 3924 | ||
| 3399 | ;; Pad with 1 space (if -n is used then make the | 3925 | ;; Pad with 1 space (if -n is used then make the |
| 3400 | ;; padding a minimum of n spaces.) The defaults use -1 | 3926 | ;; padding a minimum of n spaces.) The defaults use -1 |
| @@ -3424,10 +3950,10 @@ user is King! | |||
| 3424 | ;; (local-set-key "\C-j" 'idlwave-newline) ; My preference. | 3950 | ;; (local-set-key "\C-j" 'idlwave-newline) ; My preference. |
| 3425 | 3951 | ||
| 3426 | ;; Some personal abbreviations | 3952 | ;; Some personal abbreviations |
| 3427 | (define-abbrev idlwave-mode-abbrev-table | 3953 | (define-abbrev idlwave-mode-abbrev-table |
| 3428 | (concat idlwave-abbrev-start-char "wb") "widget_base()" | 3954 | (concat idlwave-abbrev-start-char "wb") "widget_base()" |
| 3429 | (idlwave-keyword-abbrev 1)) | 3955 | (idlwave-keyword-abbrev 1)) |
| 3430 | (define-abbrev idlwave-mode-abbrev-table | 3956 | (define-abbrev idlwave-mode-abbrev-table |
| 3431 | (concat idlwave-abbrev-start-char "on") "obj_new()" | 3957 | (concat idlwave-abbrev-start-char "on") "obj_new()" |
| 3432 | (idlwave-keyword-abbrev 1)) | 3958 | (idlwave-keyword-abbrev 1)) |
| 3433 | )) | 3959 | )) |
| @@ -3445,12 +3971,12 @@ user is King! | |||
| 3445 | (add-hook 'idlwave-shell-mode-hook | 3971 | (add-hook 'idlwave-shell-mode-hook |
| 3446 | (lambda () | 3972 | (lambda () |
| 3447 | ;; Set up some custom key and mouse examine commands | 3973 | ;; Set up some custom key and mouse examine commands |
| 3448 | (idlwave-shell-define-key-both [s-down-mouse-2] | 3974 | (idlwave-shell-define-key-both [s-down-mouse-2] |
| 3449 | (idlwave-shell-mouse-examine | 3975 | (idlwave-shell-mouse-examine |
| 3450 | "print, size(___,/DIMENSIONS)")) | 3976 | "print, size(___,/DIMENSIONS)")) |
| 3451 | (idlwave-shell-define-key-both [f9] (idlwave-shell-examine | 3977 | (idlwave-shell-define-key-both [f9] (idlwave-shell-examine |
| 3452 | "print, size(___,/DIMENSIONS)")) | 3978 | "print, size(___,/DIMENSIONS)")) |
| 3453 | (idlwave-shell-define-key-both [f10] (idlwave-shell-examine | 3979 | (idlwave-shell-define-key-both [f10] (idlwave-shell-examine |
| 3454 | "print,size(___,/TNAME)")) | 3980 | "print,size(___,/TNAME)")) |
| 3455 | (idlwave-shell-define-key-both [f11] (idlwave-shell-examine | 3981 | (idlwave-shell-define-key-both [f11] (idlwave-shell-examine |
| 3456 | "help,___,/STRUCTURE")))) | 3982 | "help,___,/STRUCTURE")))) |
| @@ -3459,27 +3985,28 @@ user is King! | |||
| 3459 | @ifhtml | 3985 | @ifhtml |
| 3460 | <A NAME="WIN_MAC"></A> | 3986 | <A NAME="WIN_MAC"></A> |
| 3461 | @end ifhtml | 3987 | @end ifhtml |
| 3462 | @node Windows and MacOS, Index, Configuration Examples, Top | 3988 | @node Windows and MacOS, Troubleshooting, Configuration Examples, Top |
| 3463 | @appendix Windows and MacOS | 3989 | @appendix Windows and MacOS |
| 3464 | @cindex Windows | 3990 | @cindex Windows |
| 3465 | @cindex MacOS | 3991 | @cindex MacOS |
| 3992 | @cindex MacOSX | ||
| 3466 | 3993 | ||
| 3467 | IDLWAVE was developed on a UNIX system. However, due to the portability | 3994 | IDLWAVE was developed on a UNIX system. However, thanks to the |
| 3468 | of Emacs, much of IDLWAVE does also work under different operating | 3995 | portability of Emacs, much of IDLWAVE does also work under different |
| 3469 | systems like Windows (with NTEmacs or NTXEmacs) or MacOS. | 3996 | operating systems like Windows (with NTEmacs or NTXEmacs) or MacOS. |
| 3470 | 3997 | ||
| 3471 | The only problem really is that RSI does not provide a command-line | 3998 | The only real problem is that RSI does not provide a command-line |
| 3472 | version of IDL for Windows or MacOS with which IDLWAVE can | 3999 | version of IDL for Windows or MacOS(<=9) with which IDLWAVE can |
| 3473 | interact@footnote{Call your RSI representative and complain --- it | 4000 | interact@footnote{Call your RSI representative and complain --- it |
| 3474 | should be trivial for them to provide one. And if enough people ask | 4001 | should be trivial for them to provide one. And if enough people ask for |
| 3475 | for it, maybe they will. The upcoming IDL for Mac OSX is slated to | 4002 | it, maybe they will. The new MacOSX version of IDL @emph{does} have a |
| 3476 | have a command-line version.}. Therefore the IDLWAVE Shell does not | 4003 | shell and works well with IDLWAVE.}. As a result, the IDLWAVE Shell |
| 3477 | work and you have to rely on IDLDE to run and debug your programs. | 4004 | does not work and you have to rely on IDLDE to run and debug your |
| 3478 | However, editing IDL source files with Emacs/IDLWAVE works with all | 4005 | programs. However, editing IDL source files with Emacs/IDLWAVE works |
| 3479 | bells and whistles, including routine info, completion and fast online | 4006 | with all bells and whistles, including routine info, completion and fast |
| 3480 | help. Only a small amount of additional information must be specified | 4007 | online help. Only a small amount of additional information must be |
| 3481 | in your .emacs file: the path names which, on a UNIX system, are | 4008 | specified in your @file{.emacs} file: the path names which, on a UNIX |
| 3482 | automatically gathered by talking to the IDL program. | 4009 | system, are automatically gathered by talking to the IDL program. |
| 3483 | 4010 | ||
| 3484 | Here is an example of the additional configuration needed for a Windows | 4011 | Here is an example of the additional configuration needed for a Windows |
| 3485 | system. I am assuming that IDLWAVE has been installed in | 4012 | system. I am assuming that IDLWAVE has been installed in |
| @@ -3487,7 +4014,7 @@ system. I am assuming that IDLWAVE has been installed in | |||
| 3487 | @w{@samp{C:\RSI\IDL55}}. | 4014 | @w{@samp{C:\RSI\IDL55}}. |
| 3488 | 4015 | ||
| 3489 | @lisp | 4016 | @lisp |
| 3490 | ;; location of the lisp files (needed if IDLWAVE is not part of | 4017 | ;; location of the lisp files (needed if IDLWAVE is not part of |
| 3491 | ;; the X/Emacs installation) | 4018 | ;; the X/Emacs installation) |
| 3492 | (setq load-path (cons "c:/program files/IDLWAVE" load-path)) | 4019 | (setq load-path (cons "c:/program files/IDLWAVE" load-path)) |
| 3493 | 4020 | ||
| @@ -3499,37 +4026,214 @@ system. I am assuming that IDLWAVE has been installed in | |||
| 3499 | ;; location of the IDL system directory (try "print,!DIR") | 4026 | ;; location of the IDL system directory (try "print,!DIR") |
| 3500 | (setq idlwave-system-directory "c:/RSI/IDL55/") | 4027 | (setq idlwave-system-directory "c:/RSI/IDL55/") |
| 3501 | 4028 | ||
| 3502 | ;; location of the IDLWAVE help files idlw-help.el and idlw-help.txt. | 4029 | ;; specify using the HTMLHelp documentation for online help, with the |
| 3503 | (setq idlwave-help-directory "c:/IDLWAVE") | 4030 | ;; KEYHH helper routine (Windows only) |
| 4031 | (setq idlwave-use-hh 'keyhh) | ||
| 3504 | 4032 | ||
| 3505 | ;; file in which to store the user catalog info | 4033 | ;; file in which to store the user catalog info |
| 3506 | (setq idlwave-libinfo-file "c:/IDLWAVE/idlcat.el") | 4034 | (setq idlwave-user-catalog-file "c:/IDLWAVE/idlcat.el") |
| 3507 | @end lisp | 4035 | @end lisp |
| 3508 | 4036 | ||
| 3509 | @noindent Furthermore, Windows sometimes tries to outsmart you --- make | 4037 | @noindent Furthermore, Windows sometimes tries to outsmart you --- make |
| 3510 | sure you check the following things: | 4038 | sure you check the following things: |
| 3511 | 4039 | ||
| 3512 | @itemize @bullet | 4040 | @itemize @bullet |
| 3513 | @item When you download the IDLWAVE distribution, make sure you save the | 4041 | @item When you download the IDLWAVE distribution, make sure you save the |
| 3514 | files under the names @file{idlwave.tar.gz} and | 4042 | file under the names @file{idlwave.tar.gz}. |
| 3515 | @file{idlwave-help-tar.gz}. | ||
| 3516 | @item Be sure that your software for untarring/ungzipping is @emph{NOT} | ||
| 3517 | doing smart CR/LF conversion (WinZip users will find this in | ||
| 3518 | Options:Configuration:Miscellaneous, change the setting, then re-open | ||
| 3519 | the archive). This adds one byte per line, throwing off the | ||
| 3520 | byte-counts for the help file lookups and defeating fast online help lookup. | ||
| 3521 | @item M-TAB switches among running programs --- use Esc-TAB | 4043 | @item M-TAB switches among running programs --- use Esc-TAB |
| 3522 | instead. | 4044 | instead. |
| 3523 | @item Other issues as yet unnamed... | 4045 | @item Other issues as yet unnamed... |
| 3524 | @end itemize | 4046 | @end itemize |
| 3525 | 4047 | ||
| 4048 | Windows users who'd like to make use of IDLWAVE's context-aware HTML | ||
| 4049 | help can skip the browser and use the HTMLHelp functionality directly. | ||
| 4050 | @xref{Help with HTML Documentation}. | ||
| 4051 | |||
| 4052 | @ifhtml | ||
| 4053 | <A NAME="TROUBLE"></A> | ||
| 4054 | @end ifhtml | ||
| 4055 | @node Troubleshooting, Index, Windows and MacOS, Top | ||
| 4056 | @appendix Troubleshooting | ||
| 4057 | @cindex Troubleshooting | ||
| 4058 | |||
| 4059 | Although IDLWAVE usually installs and works without difficulty, a few | ||
| 4060 | common problems and their solutions are documented below. | ||
| 4061 | |||
| 4062 | @enumerate | ||
| 4063 | |||
| 4064 | @item @strong{Whenever an IDL error occurs or a breakpoint is hit, I get | ||
| 4065 | errors or strange behavior when I try to type anything into some of my | ||
| 4066 | IDLWAVE buffers.} | ||
| 4067 | |||
| 4068 | This is a @emph{feature}, not an error. You're in @emph{Electric | ||
| 4069 | Debug Mode} (@pxref{Electric Debug Mode}). You should see | ||
| 4070 | @code{*Debugging*} in the mode-line. The buffer is read-only and all | ||
| 4071 | debugging and examination commands are available as single keystrokes; | ||
| 4072 | @kbd{C-?} lists these shortcuts. Use @kbd{q} to quit the mode, and | ||
| 4073 | customize the variable @code{idlwave-shell-automatic-electric-debug} | ||
| 4074 | if you prefer not to enter electric debug on breakpoints@dots{} but | ||
| 4075 | you really should try it before you disable it! You can also | ||
| 4076 | customize this variable to enter debug mode when errors are | ||
| 4077 | encountered too. | ||
| 4078 | |||
| 4079 | @item @strong{I get errors like @samp{Searching for program: no such | ||
| 4080 | file or directory, idl} when attempting to start the IDL shell.} | ||
| 4081 | |||
| 4082 | IDLWAVE needs to know where IDL is in order to run it as a process. | ||
| 4083 | By default, it attempts to invoke it simply as @samp{idl}, which | ||
| 4084 | presumes such an executable is on your search path. You need to | ||
| 4085 | ensure @samp{idl} is on your @samp{$PATH}, or specify the full | ||
| 4086 | pathname to the idl program with the variable | ||
| 4087 | @code{idlwave-shell-explicit-file-name}. Note that you may need to | ||
| 4088 | set your shell search path in two places when running Emacs as an Aqua | ||
| 4089 | application with MacOSX; see the next topic. | ||
| 4090 | |||
| 4091 | @item @strong{IDLWAVE is disregarding my @samp{IDL_PATH} which I set | ||
| 4092 | under MacOSX} | ||
| 4093 | |||
| 4094 | If you run Emacs directly as an Aqua application, rather than from the | ||
| 4095 | console shell, the environment is set not from your usual shell | ||
| 4096 | configuration files (e.g. @file{.cshrc}), but from the file | ||
| 4097 | @file{~/.MacOSX/environment.plist}. Either include your path settings | ||
| 4098 | there, or start Emacs and IDLWAVE from the shell. | ||
| 4099 | |||
| 4100 | @item @strong{I get errors like @samp{Symbol's function is void: | ||
| 4101 | overlayp} when trying to start the shell in XEmacs} | ||
| 4102 | |||
| 4103 | You don't have the @samp{fsf-compat} package installed, which IDLWAVE | ||
| 4104 | needs to run under XEmacs. Install it and, if necessary, insert | ||
| 4105 | @code{(require 'overlay)} in your @file{.emacs}. | ||
| 4106 | |||
| 4107 | @item @strong{I'm getting errors like @samp{Symbol's value as variable is void: | ||
| 4108 | cl-builtin-gethash} on completion or routine info.} | ||
| 4109 | |||
| 4110 | This error arises if you upgraded Emacs from 20.x to 21.x without | ||
| 4111 | re-installing IDLWAVE. Old Emacs and new Emacs are not byte-compatible | ||
| 4112 | in compiled lisp files. Presumably, you kept the original .elc files in | ||
| 4113 | place, and this is the source of the error. If you recompile (or just | ||
| 4114 | "make; make install") from source, it should resolve this problem. | ||
| 4115 | Another option is to recompile the @file{idlw*.el} files by hand using | ||
| 4116 | @kbd{M-x byte-compile-file}. Why not take the opportunity to grab the | ||
| 4117 | latest IDLWAVE version at @uref{@value{IDLWAVE-HOMEPAGE}, the | ||
| 4118 | maintainers webpage} | ||
| 4119 | |||
| 4120 | @item @strong{@kbd{M-@key{TAB}} doesn't complete words, it switches | ||
| 4121 | windows on my desktop.} | ||
| 4122 | |||
| 4123 | Your system is trapping @kbd{M-@key{TAB}} and using it for its own | ||
| 4124 | nefarious purposes: Emacs never sees the keystrokes. On many Unix | ||
| 4125 | systems, you can reconfigure your window manager to use another key | ||
| 4126 | sequence for switching among windows. Another option is to use the | ||
| 4127 | equivalent sequence @kbd{@key{ESC}-@key{TAB}}. | ||
| 4128 | |||
| 4129 | @item @strong{When stopping at breakpoints or errors, IDLWAVE does not | ||
| 4130 | seem to highlight the relevant line in the source.} | ||
| 4131 | |||
| 4132 | IDLWAVE scans for error and halt messages and highlights the stop | ||
| 4133 | location in the correct file. However, if you've changed the system | ||
| 4134 | variable @samp{!ERROR_STATE.MSG_PREFIX}, it is unable to parse these | ||
| 4135 | message correctly. Don't do that. | ||
| 4136 | |||
| 4137 | @item @strong{IDLWAVE doesn't work correctly when using ENVI.} | ||
| 4138 | |||
| 4139 | Though IDLWAVE was not written with ENVI in mind, it works just fine | ||
| 4140 | with it, as long as you update the prompt it's looking for (@samp{IDL> | ||
| 4141 | } by default). You can do this with the variable | ||
| 4142 | @code{idlwave-shell-prompt-pattern} (@pxref{Starting the Shell}), e.g., | ||
| 4143 | in your @file{.emacs}: | ||
| 4144 | |||
| 4145 | @lisp | ||
| 4146 | (setq idlwave-shell-prompt-pattern "^\\(ENVI\\|IDL\\)> ") | ||
| 4147 | @end lisp | ||
| 4148 | |||
| 4149 | @item @strong{Attempts to set breakpoints fail: no breakpoint is | ||
| 4150 | indicated in the IDLWAVE buffer.} | ||
| 4151 | |||
| 4152 | IDL changed its breakpoint reporting format starting with IDLv5.5. The | ||
| 4153 | first version of IDLWAVE to support the new format is IDLWAVE v4.10. If | ||
| 4154 | you have an older version and are using IDL >v5.5, you need to upgrade, | ||
| 4155 | and/or make sure your recent version of IDLWAVE is being found on the | ||
| 4156 | Emacs load-path (see the next entry). You can list the version being | ||
| 4157 | used with @kbd{C-h v idlwave-mode-version @key{RET}}. | ||
| 4158 | |||
| 4159 | @item @strong{I installed a new version of IDLWAVE, but the old | ||
| 4160 | version is still being used} or @strong{IDLWAVE works, but when I | ||
| 4161 | tried to install the optional modules @file{idlw-roprompt.el} or | ||
| 4162 | @file{idlw-complete-structtag}, I get errors like @samp{Cannot open | ||
| 4163 | load file}}. | ||
| 4164 | |||
| 4165 | The problem is that your Emacs is not finding the version of IDLWAVE you | ||
| 4166 | installed. Many Emacsen come with an older bundled copy of IDLWAVE | ||
| 4167 | (e.g. v4.7 for Emacs 21.x), which is likely what's being used instead. | ||
| 4168 | You need to make sure your Emacs @emph{load-path} contains the directory | ||
| 4169 | where IDLWAVE is installed (@file{/usr/local/share/emacs/site-lisp}, by | ||
| 4170 | default), @emph{before} Emacs' default search directories. You can | ||
| 4171 | accomplish this by putting the following in your @file{.emacs}: | ||
| 4172 | |||
| 4173 | @lisp | ||
| 4174 | (setq load-path (cons "/usr/local/share/emacs/site-lisp" load-path)) | ||
| 4175 | @end lisp | ||
| 4176 | |||
| 4177 | @noindent You can check on your load-path value using @kbd{C-h v | ||
| 4178 | load-path @key{RET}}. | ||
| 3526 | 4179 | ||
| 3527 | @node Index, , Windows and MacOS, Top | 4180 | @item @strong{IDLWAVE is screwing up the formatting of my @file{.idl} files.} |
| 4181 | |||
| 4182 | Actually, this isn't IDLWAVE at all, but @samp{idl-mode}, an unrelated | ||
| 4183 | programming mode for CORBA's Interface Definition Language (you should | ||
| 4184 | see @samp{(IDL)}, not @samp{(IDLWAVE)} in the mode-line). One | ||
| 4185 | solution: don't name your file @file{.idl}, but rather @file{.pro}. | ||
| 4186 | Another solution: make sure @file{.idl} files load IDLWAVE instead of | ||
| 4187 | @samp{idl-mode} by adding the following to your @file{.emacs}: | ||
| 4188 | |||
| 4189 | @lisp | ||
| 4190 | (setcdr (rassoc 'idl-mode auto-mode-alist) 'idlwave-mode) | ||
| 4191 | @end lisp | ||
| 4192 | |||
| 4193 | @item @strong{The routine info for my local routines is out of date!} | ||
| 4194 | |||
| 4195 | IDLWAVE collects routine info from various locations (@pxref{Routine | ||
| 4196 | Information Sources}). Routines in files visited in a buffer or | ||
| 4197 | compiled in the shell should be up to date. For other routines, the | ||
| 4198 | information is only as current as the most recent scan. If you have a | ||
| 4199 | rapidly changing set of routines, and you'd like the latest routine | ||
| 4200 | information to be available for it, one powerful technique makes use of | ||
| 4201 | the library catalog tool, @samp{idlwave_catalog}. Simply add a line to | ||
| 4202 | your @samp{cron} file (@samp{crontab -e} will let you edit this on some | ||
| 4203 | systems), like this: | ||
| 4204 | |||
| 4205 | @example | ||
| 4206 | 45 3 * * 1-5 (cd /path/to/myidllib; /path/to/idlwave_catalog MyLib) | ||
| 4207 | @end example | ||
| 4208 | |||
| 4209 | @noindent where @samp{MyLib} is the name of your library. This will | ||
| 4210 | rescan all @file{.pro} files at or below @file{/path/to/myidllib} every | ||
| 4211 | week night at 3:45am. You can even scan site-wide libraries with this | ||
| 4212 | method, and the most recent information will be available to all users. | ||
| 4213 | |||
| 4214 | @item @strong{All the Greek-font characters in the HTML help are | ||
| 4215 | displayed as Latin characters!} | ||
| 4216 | |||
| 4217 | Unfortunately, the HTMLHelp files RSI provides attempt to switch to | ||
| 4218 | @samp{Symbol} font to display Greek characters, which is not really an | ||
| 4219 | permitted method for doing this in HTML. There is a "workaround" for | ||
| 4220 | many browsers: @xref{HTML Help Browser Tips}. | ||
| 4221 | |||
| 4222 | @item @strong{In the shell, my long commands are truncated at 256 characters!} | ||
| 4223 | |||
| 4224 | This actually happens when running IDL in an XTerm as well. There are | ||
| 4225 | a couple of work arounds: @code{define_key,/control,'^d'} (e.g. in | ||
| 4226 | your @file{$IDL_STARTUP} file) will disable the @samp{EOF} character | ||
| 4227 | and give you a 512 character limit. You won't be able to use | ||
| 4228 | @key{C-d} to quit the shell, however. Another possibility is | ||
| 4229 | @code{!EDIT_INPUT=0}, which gives you an @emph{infinite} limit (OK, a | ||
| 4230 | memory-bounded limit), but disables the processing of background | ||
| 4231 | widget events (those with @code{/NO_BLOCK} passed to @code{XManager}). | ||
| 4232 | |||
| 4233 | @end enumerate | ||
| 4234 | |||
| 4235 | @node Index, , Troubleshooting, Top | ||
| 3528 | @unnumbered Index | 4236 | @unnumbered Index |
| 3529 | @printindex cp | 4237 | @printindex cp |
| 3530 | 4238 | ||
| 3531 | @bye | 4239 | @bye |
| 3532 | |||
| 3533 | @ignore | ||
| 3534 | arch-tag: f1d73958-1423-4127-b8aa-f7b953d64492 | ||
| 3535 | @end ignore | ||