Function: idlwave-shell-mode
idlwave-shell-mode is an interactive and byte-compiled function
defined in idlw-shell.el.gz.
Signature
(idlwave-shell-mode)
Documentation
Major mode for interacting with an inferior IDL process.
1. Shell Interaction
-----------------
RET after the end of the process' output sends the text from the
end of process to the end of the current line. RET before end of
process output copies the current line (except for the prompt) to
the end of the buffer.
Command history, searching of previous commands, command line
editing are available via the comint-mode key bindings, by default
mostly on the key \C-c. Command history is also available with
the arrow keys UP and DOWN.
2. Completion
----------
TAB and M-TAB do completion of IDL routines, classes and keywords -
similar to M-TAB in idlwave-mode. In executive commands and
strings, it completes file names. Abbreviations are also expanded
like in idlwave-mode.
3. Routine Info
------------
M-x idlwave-routine-info (idlwave-routine-info) displays information about an IDL routine near point,
just like in idlwave-mode. The module used is the one at point or
the one whose argument list is being edited.
To update IDLWAVE's knowledge about compiled or edited modules, use
M-x idlwave-update-routine-info (idlwave-update-routine-info).
M-x idlwave-find-module (idlwave-find-module) find the source of a module.
M-x idlwave-resolve (idlwave-resolve) tells IDL to compile an unresolved module.
M-x idlwave-context-help (idlwave-context-help) shows the online help on the item at
point, if online help has been installed.
4. Debugging
---------
A complete set of commands for compiling and debugging IDL programs
is available from the menu. Also keybindings starting with a
\C-c C-d prefix are available for most commands in the *idl* buffer
and also in source buffers. The best place to learn about the
keybindings is again the menu.
On Emacs versions where this is possible, a debugging toolbar is
installed.
When IDL is halted in the middle of a procedure, the corresponding
line of that procedure file is displayed with an overlay in another
window. Breakpoints are also highlighted in the source.
M-x idlwave-shell-resync-dirs (idlwave-shell-resync-dirs) queries IDL in order to change Emacs current directory
to correspond to the IDL process current directory.
5. Expression Examination
----------------------
Expressions near point can be examined with print,
M-x idlwave-shell-print (idlwave-shell-print) or M-x idlwave-shell-mouse-print (idlwave-shell-mouse-print) with the
mouse, help, M-x idlwave-shell-help-expression (idlwave-shell-help-expression) or
M-x idlwave-shell-mouse-help (idlwave-shell-mouse-help) with the mouse, or with a
configurable set of custom examine commands using
M-x idlwave-shell-examine-select (idlwave-shell-examine-select). The mouse examine commands can
also work by click and drag, to select an expression for
examination.
6. Hooks
-----
Turning on idlwave-shell-mode runs comint-mode-hook and
idlwave-shell-mode-hook (in that order).
7. Documentation and Customization
-------------------------------
Info documentation for this package is available. Use M-x idlwave-info (idlwave-info)
to display (complain to your sysadmin if that does not work).
For PostScript and HTML versions of the documentation, see IDLWAVE's
website at URL https://github.com/jdtsmith/idlwave.
IDLWAVE has customize support - see the group idlwave.
8. Keybindings
-----------
C-M-<down-mouse-2> idlwave-shell-mouse-help
C-M-<mouse-2> ignore
C-S-<down-mouse-2> idlwave-shell-examine-select
C-S-<mouse-2> ignore
S-<down-mouse-2> idlwave-shell-mouse-print
S-<mouse-2> ignore
Key Bindings
Source Code
;; Defined in /usr/src/emacs/lisp/obsolete/idlw-shell.el.gz
(define-derived-mode idlwave-shell-mode comint-mode "IDL-Shell"
"Major mode for interacting with an inferior IDL process.
1. Shell Interaction
-----------------
RET after the end of the process' output sends the text from the
end of process to the end of the current line. RET before end of
process output copies the current line (except for the prompt) to
the end of the buffer.
Command history, searching of previous commands, command line
editing are available via the comint-mode key bindings, by default
mostly on the key \\`C-c'. Command history is also available with
the arrow keys UP and DOWN.
2. Completion
----------
TAB and M-TAB do completion of IDL routines, classes and keywords -
similar to M-TAB in `idlwave-mode'. In executive commands and
strings, it completes file names. Abbreviations are also expanded
like in `idlwave-mode'.
3. Routine Info
------------
\\[idlwave-routine-info] displays information about an IDL routine near point,
just like in `idlwave-mode'. The module used is the one at point or
the one whose argument list is being edited.
To update IDLWAVE's knowledge about compiled or edited modules, use
\\[idlwave-update-routine-info].
\\[idlwave-find-module] find the source of a module.
\\[idlwave-resolve] tells IDL to compile an unresolved module.
\\[idlwave-context-help] shows the online help on the item at
point, if online help has been installed.
4. Debugging
---------
A complete set of commands for compiling and debugging IDL programs
is available from the menu. Also keybindings starting with a
\\`C-c C-d' prefix are available for most commands in the *idl* buffer
and also in source buffers. The best place to learn about the
keybindings is again the menu.
On Emacs versions where this is possible, a debugging toolbar is
installed.
When IDL is halted in the middle of a procedure, the corresponding
line of that procedure file is displayed with an overlay in another
window. Breakpoints are also highlighted in the source.
\\[idlwave-shell-resync-dirs] queries IDL in order to change Emacs current directory
to correspond to the IDL process current directory.
5. Expression Examination
----------------------
Expressions near point can be examined with print,
\\[idlwave-shell-print] or \\[idlwave-shell-mouse-print] with the
mouse, help, \\[idlwave-shell-help-expression] or
\\[idlwave-shell-mouse-help] with the mouse, or with a
configurable set of custom examine commands using
\\[idlwave-shell-examine-select]. The mouse examine commands can
also work by click and drag, to select an expression for
examination.
6. Hooks
-----
Turning on `idlwave-shell-mode' runs `comint-mode-hook' and
`idlwave-shell-mode-hook' (in that order).
7. Documentation and Customization
-------------------------------
Info documentation for this package is available. Use \\[idlwave-info]
to display (complain to your sysadmin if that does not work).
For PostScript and HTML versions of the documentation, see IDLWAVE's
website at URL `https://github.com/jdtsmith/idlwave'.
IDLWAVE has customize support - see the group `idlwave'.
8. Keybindings
-----------
\\{idlwave-shell-mode-map}"
:abbrev-table idlwave-mode-abbrev-table
(idlwave-setup) ; Make sure config files and paths, etc. are available.
(unless (file-name-absolute-p idlwave-shell-command-history-file)
(setq idlwave-shell-command-history-file
(expand-file-name idlwave-shell-command-history-file
idlwave-config-directory)))
(setq comint-prompt-regexp idlwave-shell-prompt-pattern)
(setq comint-process-echoes t)
;; Can not use history expansion because "!" is used for system variables.
(setq comint-input-autoexpand nil)
;; (setq comint-input-ring-size 64)
(set (make-local-variable 'completion-ignore-case) t)
(set (make-local-variable 'comint-completion-addsuffix) '("/" . ""))
(setq comint-input-ignoredups t)
(setq idlwave-shell-mode-line-info nil)
(setq mode-line-format
'(""
mode-line-modified
mode-line-buffer-identification
" "
global-mode-string
" %[("
mode-name
mode-line-process
minor-mode-alist
"%n"
")%]-"
idlwave-shell-mode-line-info
"---"
(line-number-mode "L%l--")
(column-number-mode "C%c--")
(-3 . "%p")
"-%-"))
;; (make-local-variable 'idlwave-shell-bp-alist)
(setq idlwave-shell-halt-frame nil
idlwave-shell-trace-frame nil
idlwave-shell-command-output nil
idlwave-shell-step-frame nil)
(idlwave-shell-display-line nil)
(setq idlwave-shell-calling-stack-index 0)
(setq idlwave-shell-only-prompt-pattern
(concat "\\`[ \t\n]*"
(substring idlwave-shell-prompt-pattern 1)
"[ \t\n]*\\'"))
(when idlwave-shell-query-for-class
(add-hook 'idlwave-determine-class-functions
#'idlwave-shell-get-object-class nil t)
(setq idlwave-store-inquired-class t))
;; Make sure comint-last-input-end does not go to beginning of
;; buffer (in case there were other processes already in this buffer).
(set-marker comint-last-input-end (point))
(setq idlwave-idlwave_routine_info-compiled nil)
(setq idlwave-shell-ready nil)
(setq idlwave-shell-bp-alist nil)
(idlwave-shell-update-bp-overlays) ; Throw away old overlays
(setq idlwave-shell-post-command-hook nil ;clean up any old stuff
idlwave-shell-sources-alist nil)
(setq idlwave-shell-default-directory default-directory)
(setq idlwave-shell-hide-output nil)
(add-hook 'kill-buffer-hook #'idlwave-shell-kill-shell-buffer-confirm
nil 'local)
(add-hook 'kill-buffer-hook #'idlwave-shell-delete-temp-files nil 'local)
(add-hook 'kill-emacs-hook #'idlwave-shell-delete-temp-files)
;; Set the optional comint variables
(when idlwave-shell-comint-settings
(let ((list idlwave-shell-comint-settings) entry)
(while (setq entry (pop list))
(set (make-local-variable (car entry)) (cdr entry)))))
(unless (memq #'comint-carriage-motion
(default-value 'comint-output-filter-functions))
;; Strip those pesky ctrl-m's.
(add-hook 'comint-output-filter-functions
(lambda (string)
(when (string-search "\r" string)
(let ((pmark (process-mark (get-buffer-process
(current-buffer)))))
(save-excursion
;; bare CR -> delete preceding line
(goto-char comint-last-output-start)
(while (search-forward "\r" pmark t)
(delete-region (point) (line-beginning-position)))))))
'append 'local)
(add-hook 'comint-output-filter-functions #'comint-strip-ctrl-m nil 'local))
;; Python-mode, bundled with many Emacs installs, quite cavalierly
;; adds this function to the global default hook. It interferes
;; with overlay-arrows.
;; FIXME: We should fix this interference rather than globally turn it off.
(when (fboundp 'py-pdbtrack-track-stack-file)
(remove-hook 'comint-output-filter-functions
#'py-pdbtrack-track-stack-file))
;; IDLWAVE syntax, and turn on abbreviations
(set (make-local-variable 'comment-start) ";")
(setq abbrev-mode t)
(add-hook 'post-command-hook #'idlwave-command-hook nil t)
;; Read the command history?
(when (and idlwave-shell-save-command-history
(stringp idlwave-shell-command-history-file))
(set (make-local-variable 'comint-input-ring-file-name)
idlwave-shell-command-history-file)
(if (file-regular-p idlwave-shell-command-history-file)
(comint-read-input-ring)))
;; Turn off the non-debug toolbar buttons (open,save,etc.)
(set (make-local-variable 'tool-bar-map) nil)
(idlwave-shell-send-command idlwave-shell-initial-commands nil 'hide)
;; Turn off IDL's ^d interpreting, and define a system
;; variable which knows the version of IDLWAVE
(idlwave-shell-send-command
(format "defsysv,'!idlwave_version','%s',1" idlwave-mode-version)
nil 'hide)
;; Read the paths, and save if they changed
(idlwave-shell-send-command idlwave-shell-path-query
'idlwave-shell-get-path-info
'hide))