Function: idlwave-mode

idlwave-mode is an interactive and byte-compiled function defined in idlwave.el.gz.

Signature

(idlwave-mode)

Documentation

Major mode for editing IDL source files (version 6.1_em22).

The main features of this mode are

1. Indentation and Formatting
   --------------------------
   Like other Emacs programming modes, C-j inserts a newline and indents.
   TAB is used for explicit indentation of the current line.

   To start a continuation line, use M-x idlwave-split-line (idlwave-split-line). This
   function can also be used in the middle of a line to split the line
   at that point. When used inside a long constant string, the string
   is split at that point with the + concatenation operator.

   Comments are indented as follows:

   ;;; Indentation remains unchanged.
   ;; Indent like the surrounding code
   ; Indent to a minimum column.

   The indentation of comments starting in column 0 is never changed.

   Use M-x idlwave-fill-paragraph (idlwave-fill-paragraph) to refill a paragraph inside a
   comment. The indentation of the second line of the paragraph
   relative to the first will be retained. Use
   M-x auto-fill-mode (auto-fill-mode) to toggle auto-fill mode for these
   comments. When the variable idlwave-fill-comment-line-only is
   nil, code can also be auto-filled and auto-indented.

   To convert pre-existing IDL code to your formatting style, mark the
   entire buffer with C-x h (mark-whole-buffer) and execute
   M-x idlwave-expand-region-abbrevs (idlwave-expand-region-abbrevs). Then mark the entire buffer
   again followed by C-M-\ (indent-region) (indent-region).

2. Routine Info
   ------------
   IDLWAVE displays information about the calling sequence and the
   accepted keyword parameters of a procedure or function with
   M-x idlwave-routine-info (idlwave-routine-info). M-x idlwave-find-module (idlwave-find-module) jumps to the
   source file of a module. These commands know about system
   routines, all routines in idlwave-mode buffers and (when the
   idlwave-shell is active) about all modules currently compiled under
   this shell. It also makes use of pre-compiled or custom-scanned
   user and library catalogs many popular libraries ship with by
   default. Use M-x idlwave-update-routine-info (idlwave-update-routine-info) to update this
   information, which is also used for completion (see item 4).

3. Online IDL Help
   ---------------

   M-x idlwave-context-help (idlwave-context-help) displays the IDL documentation relevant
   for the system variable, keyword, or routines at point. A single
   key stroke gets you directly to the right place in the docs. See
   the manual to configure where and how the HTML help is displayed.

4. Completion
   ----------
   M-x idlwave-complete (idlwave-complete) completes the names of procedures, functions
   class names, keyword parameters, system variables and tags, class
   tags, structure tags, filenames and much more. It is context
   sensitive and figures out what is expected at point. Lower case
   strings are completed in lower case, other strings in mixed or
   upper case.

5. Code Templates and Abbreviations
   --------------------------------
   Many Abbreviations are predefined to expand to code fragments and templates.
   The abbreviations start generally with a \. Some examples:

   \pr PROCEDURE template
   \fu FUNCTION template
   \c CASE statement template
   \sw SWITCH statement template
   \f FOR loop template
   \r REPEAT Loop template
   \w WHILE loop template
   \i IF statement template
   \elif IF-ELSE statement template
   \b BEGIN

   For a full list, use M-x idlwave-list-abbrevs (idlwave-list-abbrevs). Some templates also
   have direct keybindings - see the list of keybindings below.

   M-x idlwave-doc-header (idlwave-doc-header) inserts a documentation header at the
   beginning of the current program unit (pro, function or main).
   Change log entries can be added to the current program unit with
   M-x idlwave-doc-modification (idlwave-doc-modification).

6. Automatic Case Conversion
   -------------------------
   The case of reserved words and some abbrevs is controlled by
   idlwave-reserved-word-upcase and idlwave-abbrev-change-case.

7. Automatic END completion
   ------------------------
   If the variable idlwave-expand-generic-end is non-nil, each END typed
   will be converted to the specific version, like ENDIF, ENDFOR, etc.

8. Hooks
   -----
   Turning on idlwave-mode runs idlwave-mode-hook.

9. 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, PDF, and HTML versions of the
   documentation, check IDLWAVE's website at URL
   https://github.com/jdtsmith/idlwave.
   IDLWAVE has customize support - see the group idlwave.

10.Keybindings
   -----------
   Here is a list of all keybindings of this mode.
   If some of the key bindings below show with ??, use C-h k (describe-key)
   followed by the key sequence to see what the key sequence does.

" idlwave-show-matching-quote
& #<anonymous-function>
' idlwave-show-matching-quote
, #<anonymous-function>
< #<anonymous-function>
= #<anonymous-function>
> #<anonymous-function>
C-<tab> idlwave-hard-tab
C-M-<down-mouse-2> idlwave-shell-mouse-help
C-M-<mouse-2> ignore
C-M-? idlwave-help-assistant-help-with-topic
C-M-a idlwave-beginning-of-subprogram
C-M-d idlwave-down-block
C-M-e idlwave-end-of-subprogram
C-M-h idlwave-mark-subprogram
C-M-i idlwave-complete
C-M-n idlwave-forward-block
C-M-p idlwave-backward-block
C-M-q idlwave-indent-subprogram
C-M-u idlwave-backward-up-block
C-S-<down-mouse-2> idlwave-shell-examine-select
C-S-<mouse-2> ignore
C-c ; idlwave-toggle-comment-region
C-c = idlwave-resolve
C-c ? idlwave-routine-info
C-c C-a auto-fill-mode
C-c C-b idlwave-list-buffer-load-path-shadows
C-c C-c idlwave-case
C-c C-d ? idlwave-shell-help-expression
C-c C-d @ idlwave-shell-save-and-batch
C-c C-d C-<down> idlwave-shell-stack-down
C-c C-d C-<up> idlwave-shell-stack-up
C-c C-d C-\ idlwave-shell-toggle-enable-current-bp
C-c C-d C-a idlwave-shell-clear-all-bp
C-c C-d C-b idlwave-shell-break-here
C-c C-d C-c idlwave-shell-save-and-run
C-c C-d C-d idlwave-shell-clear-current-bp
C-c C-d C-e idlwave-shell-run-region
C-c C-d C-f idlwave-shell-window
C-c C-d C-h idlwave-shell-to-here
C-c C-d C-j idlwave-shell-break-this-module
C-c C-d C-k idlwave-shell-skip
C-c C-d C-l idlwave-shell-redisplay
C-c C-d C-n idlwave-shell-stepover
C-c C-d C-o idlwave-shell-out
C-c C-d C-p idlwave-shell-print
C-c C-d C-q idlwave-shell-quit
C-c C-d C-r idlwave-shell-cont
C-c C-d C-s idlwave-shell-step
C-c C-d C-t idlwave-shell-toggle-toolbar
C-c C-d C-u idlwave-shell-up
C-c C-d C-v idlwave-shell-toggle-electric-debug-mode
C-c C-d C-w idlwave-shell-resync-dirs
C-c C-d C-x idlwave-shell-goto-next-error
C-c C-d C-y idlwave-shell-execute-default-command-line
C-c C-d C-z idlwave-shell-reset
C-c C-d RET idlwave-shell-return
C-c C-d TAB idlwave-shell-break-in
C-c C-d [ idlwave-shell-goto-previous-bp
C-c C-d ] idlwave-shell-goto-next-bp
C-c C-f idlwave-for
C-c C-h idlwave-doc-header
C-c C-k idlwave-kill-autoloaded-buffers
C-c C-l idlwave-shell-recenter-shell-window
C-c C-n idlwave-next-statement
C-c C-p idlwave-previous-statement
C-c C-r idlwave-repeat
C-c C-s idlwave-shell
C-c C-t idlwave-find-module-this-file
C-c C-v idlwave-find-module
C-c C-w idlwave-while
C-c C-x idlwave-shell-send-char
C-c C-y idlwave-shell-char-mode-loop
C-c RET idlwave-doc-modification
C-c SPC idlwave-hard-tab
C-c TAB idlwave-update-routine-info
C-c ] idlwave-close-block
C-c { idlwave-beginning-of-block
C-c } idlwave-end-of-block
C-g idlwave-keyboard-quit
M-<tab> idlwave-complete
M-? idlwave-context-help
M-RET idlwave-split-line
M-q idlwave-fill-paragraph
M-s idlwave-edit-in-idlde
S-<down-mouse-2> idlwave-shell-mouse-print
S-<iso-lefttab> idlwave-indent-statement
S-<mouse-2> ignore
S-<mouse-3> idlwave-mouse-context-help

Key Bindings

Source Code

;; Defined in /usr/src/emacs/lisp/obsolete/idlwave.el.gz
;;;###autoload
(define-derived-mode idlwave-mode prog-mode "IDLWAVE"
  "Major mode for editing IDL source files (version 6.1_em22).

The main features of this mode are

1. Indentation and Formatting
   --------------------------
   Like other Emacs programming modes, C-j inserts a newline and indents.
   TAB is used for explicit indentation of the current line.

   To start a continuation line, use \\[idlwave-split-line].  This
   function can also be used in the middle of a line to split the line
   at that point.  When used inside a long constant string, the string
   is split at that point with the `+' concatenation operator.

   Comments are indented as follows:

   `;;;' Indentation remains unchanged.
   `;;'  Indent like the surrounding code
   `;'   Indent to a minimum column.

   The indentation of comments starting in column 0 is never changed.

   Use \\[idlwave-fill-paragraph] to refill a paragraph inside a
   comment.  The indentation of the second line of the paragraph
   relative to the first will be retained.  Use
   \\[auto-fill-mode] to toggle auto-fill mode for these
   comments.  When the variable `idlwave-fill-comment-line-only' is
   nil, code can also be auto-filled and auto-indented.

   To convert pre-existing IDL code to your formatting style, mark the
   entire buffer with \\[mark-whole-buffer] and execute
   \\[idlwave-expand-region-abbrevs].  Then mark the entire buffer
   again followed by \\[indent-region] (`indent-region').

2. Routine Info
   ------------
   IDLWAVE displays information about the calling sequence and the
   accepted keyword parameters of a procedure or function with
   \\[idlwave-routine-info].  \\[idlwave-find-module] jumps to the
   source file of a module.  These commands know about system
   routines, all routines in idlwave-mode buffers and (when the
   idlwave-shell is active) about all modules currently compiled under
   this shell.  It also makes use of pre-compiled or custom-scanned
   user and library catalogs many popular libraries ship with by
   default.  Use \\[idlwave-update-routine-info] to update this
   information, which is also used for completion (see item 4).

3. Online IDL Help
   ---------------

   \\[idlwave-context-help] displays the IDL documentation relevant
   for the system variable, keyword, or routines at point.  A single
   key stroke gets you directly to the right place in the docs.  See
   the manual to configure where and how the HTML help is displayed.

4. Completion
   ----------
   \\[idlwave-complete] completes the names of procedures, functions
   class names, keyword parameters, system variables and tags, class
   tags, structure tags, filenames and much more.  It is context
   sensitive and figures out what is expected at point.  Lower case
   strings are completed in lower case, other strings in mixed or
   upper case.

5. Code Templates and Abbreviations
   --------------------------------
   Many Abbreviations are predefined to expand to code fragments and templates.
   The abbreviations start generally with a `\\'.  Some examples:

   \\pr        PROCEDURE template
   \\fu        FUNCTION template
   \\c         CASE statement template
   \\sw        SWITCH statement template
   \\f         FOR loop template
   \\r         REPEAT Loop template
   \\w         WHILE loop template
   \\i         IF statement template
   \\elif      IF-ELSE statement template
   \\b         BEGIN

   For a full list, use \\[idlwave-list-abbrevs].  Some templates also
   have direct keybindings - see the list of keybindings below.

   \\[idlwave-doc-header] inserts a documentation header at the
   beginning of the current program unit (pro, function or main).
   Change log entries can be added to the current program unit with
   \\[idlwave-doc-modification].

6. Automatic Case Conversion
   -------------------------
   The case of reserved words and some abbrevs is controlled by
   `idlwave-reserved-word-upcase' and `idlwave-abbrev-change-case'.

7. Automatic END completion
   ------------------------
   If the variable `idlwave-expand-generic-end' is non-nil, each END typed
   will be converted to the specific version, like ENDIF, ENDFOR, etc.

8. Hooks
   -----
   Turning on `idlwave-mode' runs `idlwave-mode-hook'.

9. 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, PDF, and HTML versions of the
   documentation, check IDLWAVE's website at URL
   `https://github.com/jdtsmith/idlwave'.
   IDLWAVE has customize support - see the group `idlwave'.

10.Keybindings
   -----------
   Here is a list of all keybindings of this mode.
   If some of the key bindings below show with ??, use \\[describe-key]
   followed by the key sequence to see what the key sequence does.

\\{idlwave-mode-map}"
  :abbrev-table idlwave-mode-abbrev-table
  (if idlwave-startup-message
      (message "Emacs IDLWAVE mode version %s." idlwave-mode-version))
  (setq idlwave-startup-message nil)

  (set (make-local-variable 'indent-line-function) #'idlwave-indent-and-action)

  (set (make-local-variable idlwave-comment-indent-function)
       #'idlwave-comment-hook)

  (set (make-local-variable 'comment-start-skip) ";+[ \t]*")
  (set (make-local-variable 'comment-start) ";")
  (set (make-local-variable 'comment-add) 1) ; ";;" for new and regions
  (set (make-local-variable 'abbrev-all-caps) t)
  (set (make-local-variable 'indent-tabs-mode) nil)
  (set (make-local-variable 'completion-ignore-case) t)

  (setq abbrev-mode t)

  (set (make-local-variable 'normal-auto-fill-function) #'idlwave-auto-fill)
  (setq comment-end "")
  (set (make-local-variable 'comment-multi-line) nil)
  (set (make-local-variable 'paragraph-separate)
       "[ \t\f]*$\\|[ \t]*;+[ \t]*$\\|;+[+=-_*]+$")
  (set (make-local-variable 'paragraph-start) "[ \t\f]\\|[ \t]*;+[ \t]")
  (set (make-local-variable 'paragraph-ignore-fill-prefix) nil)
  (set (make-local-variable 'parse-sexp-ignore-comments) t)

  ;; ChangeLog
  (set (make-local-variable 'add-log-current-defun-function)
       #'idlwave-current-routine-fullname)

  ;; Set tag table list to use IDLTAGS as file name.
  (if (boundp 'tag-table-alist)
      (add-to-list 'tag-table-alist '("\\.pro\\'" . "IDLTAGS")))

  ;; Font-lock additions
  (set (make-local-variable 'font-lock-defaults) idlwave-font-lock-defaults)
  (set (make-local-variable 'font-lock-mark-block-function)
       #'idlwave-mark-subprogram)
  (set (make-local-variable 'font-lock-fontify-region-function)
       #'idlwave-font-lock-fontify-region)

  ;; Imenu setup
  ;;(set (make-local-variable 'imenu-create-index-function)
  ;;     ;; FIXME: Why set it explicitly to the value it already has?
  ;;     #'imenu-default-create-index-function)
  (set (make-local-variable 'imenu-extract-index-name-function)
       #'idlwave-unit-name)
  (set (make-local-variable 'imenu-prev-index-position-function)
       #'idlwave-prev-index-position)

  ;; HideShow setup
  (add-to-list 'hs-special-modes-alist
	       (list 'idlwave-mode
		     idlwave-begin-block-reg
		     idlwave-end-block-reg
		     ";"
		     'idlwave-forward-block nil))

  ;; Make a local post-command-hook and add our hook to it
  (add-hook 'post-command-hook #'idlwave-command-hook nil 'local)

  ;; Make local hooks for buffer updates
  (add-hook 'kill-buffer-hook #'idlwave-kill-buffer-update nil 'local)
  (add-hook 'after-save-hook #'idlwave-save-buffer-update nil 'local)
  (add-hook 'after-save-hook #'idlwave-revoke-license-to-kill nil 'local)

  ;; Setup directories and file, if necessary
  (idlwave-setup)

  ;; Update the routine info with info about current buffer?
  (idlwave-new-buffer-update)

  ;; Check help location
  (idlwave-help-check-locations))