]> code.delx.au - gnu-emacs/blobdiff - lisp/progmodes/dcl-mode.el
Merge multi-tty branch
[gnu-emacs] / lisp / progmodes / dcl-mode.el
index 2ac2cdea8b8304df295e9ab2057fe9e6e585b67d..887416f906913f4158d7ebff2cf49a5563c375b3 100644 (file)
@@ -1,6 +1,7 @@
 ;;; dcl-mode.el --- major mode for editing DCL command files
 
-;; Copyright (c) 1997 Free Software Foundation, Inc.
+;; Copyright (C) 1997, 2001, 2002, 2003, 2004, 2005, 2006, 2007
+;; Free Software Foundation, Inc.
 
 ;; Author: Odd Gripenstam <gripenstamol@decus.se>
 ;; Maintainer: Odd Gripenstam <gripenstamol@decus.se>
@@ -10,7 +11,7 @@
 
 ;; GNU Emacs is free software; you can redistribute it and/or modify
 ;; it under the terms of the GNU General Public License as published by
-;; the Free Software Foundation; either version 2, or (at your option)
+;; the Free Software Foundation; either version 3, or (at your option)
 ;; any later version.
 
 ;; GNU Emacs is distributed in the hope that it will be useful,
@@ -20,8 +21,8 @@
 
 ;; You should have received a copy of the GNU General Public License
 ;; along with GNU Emacs; see the file COPYING.  If not, write to the
-;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
-;; Boston, MA 02111-1307, USA.
+;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+;; Boston, MA 02110-1301, USA.
 
 ;;; Commentary:
 
 ;;
 ;; Type `C-h m' when you are editing a .COM file to get more
 ;; information about this mode.
-;; 
+;;
 ;; To use templates you will need a version of tempo.el that is at
 ;; least later than the buggy 1.1.1, which was included with my versions of
-;; Emacs.  I used version 1.2.4. 
+;; Emacs.  I used version 1.2.4.
 ;; The latest tempo.el distribution can be fetched from
 ;; ftp.lysator.liu.se in the directory /pub/emacs.
 ;; I recommend setting (setq tempo-interactive t).  This will make
 ;;
 ;; Any feedback will be welcomed.  If you write functions for
 ;; dcl-calc-command-indent-function or dcl-calc-cont-indent-function,
-;; please send them to the maintainer. 
-;; 
+;; please send them to the maintainer.
+;;
 ;;
 ;; Ideas for improvement:
+;; * Better font-lock support.
 ;; * Change meaning of `left margin' when dcl-tab-always-indent is nil.
 ;;   Consider the following line (`_' is the cursor):
 ;;     $ label: _ command
 
 ;;; Code:
 
+(require 'tempo)
+
+
 ;;; *** Customization *****************************************************
 
 
-(defvar dcl-basic-offset 4
+;; First, font lock.  This is a minimal approach, please improve!
+
+(defvar dcl-font-lock-keywords
+  '(("\\<\\(if\\|then\\|else\\|endif\\)\\>"
+     1 font-lock-keyword-face)
+    ("\\<f[$][a-z_]+\\>"
+     0 font-lock-builtin-face)
+    ("[.]\\(eq\\|not\\|or\\|and\\|lt\\|gt\\|le\\|ge\\|eqs\\|nes\\)[.]"
+     0 font-lock-builtin-face))
+  "Font lock keyword specification for DCL mode.
+Presently this includes some syntax, .OP.erators, and \"f$\" lexicals.")
+
+(defvar dcl-font-lock-defaults
+  '(dcl-font-lock-keywords nil)
+  "Font lock specification for DCL mode.")
+
+
+;; Now the rest.
+
+(defgroup dcl nil
+  "Major mode for editing DCL command files."
+  :link '(custom-group-link :tag "Font Lock Faces group" font-lock-faces)
+  :group 'languages)
+
+(defcustom dcl-basic-offset 4
   "*Number of columns to indent a block in DCL.
 A block is the commands between THEN-ELSE-ENDIF and between the commands
 dcl-block-begin-regexp and dcl-block-end-regexp.
 
 The meaning of this variable may be changed if
-dcl-calc-command-indent-function is set to a function.")
+dcl-calc-command-indent-function is set to a function."
+  :type 'integer
+  :group 'dcl)
 
 
-(defvar dcl-continuation-offset 6
+(defcustom dcl-continuation-offset 6
   "*Number of columns to indent a continuation line in DCL.
 A continuation line is a line that follows a line ending with `-'.
 
 The meaning of this variable may be changed if
-dcl-calc-cont-indent-function is set to a function.")
+dcl-calc-cont-indent-function is set to a function."
+  :type 'integer
+  :group 'dcl)
 
 
-(defvar dcl-margin-offset 8
+(defcustom dcl-margin-offset 8
   "*Indentation for the first command line in DCL.
-The first command line in a file or after a SUBROUTINE statement is indented 
+The first command line in a file or after a SUBROUTINE statement is indented
 this much.  Other command lines are indented the same number of columns as
 the preceding command line.
-A command line is a line that starts with `$'.")
+A command line is a line that starts with `$'."
+  :type 'integer
+  :group 'dcl)
 
 
-(defvar dcl-margin-label-offset 2
+(defcustom dcl-margin-label-offset 2
   "*Number of columns to indent a margin label in DCL.
 A margin label is a label that doesn't begin or end a block, i.e. it
-doesn't match dcl-block-begin-regexp or dcl-block-end-regexp.") 
+doesn't match dcl-block-begin-regexp or dcl-block-end-regexp."
+  :type 'integer
+  :group 'dcl)
 
 
-(defvar dcl-comment-line-regexp "^\\$!"
+(defcustom dcl-comment-line-regexp "^\\$!"
   "*Regexp describing the start of a comment line in DCL.
-Comment lines are not indented.")
+Comment lines are not indented."
+  :type 'regexp
+  :group 'dcl)
 
 
-(defvar dcl-block-begin-regexp "loop[0-9]*:"
+(defcustom dcl-block-begin-regexp "loop[0-9]*:"
   "*Regexp describing a command that begins an indented block in DCL.
-Set to nil to only indent at THEN-ELSE-ENDIF.")
+Set to nil to only indent at THEN-ELSE-ENDIF."
+  :type 'regexp
+  :group 'dcl)
 
 
-(defvar dcl-block-end-regexp "endloop[0-9]*:"
+(defcustom dcl-block-end-regexp "endloop[0-9]*:"
   "*Regexp describing a command that ends an indented block in DCL.
-Set to nil to only indent at THEN-ELSE-ENDIF.")
+Set to nil to only indent at THEN-ELSE-ENDIF."
+  :type 'regexp
+  :group 'dcl)
 
 
-(defvar dcl-calc-command-indent-function nil
+(defcustom dcl-calc-command-indent-function nil
   "*Function to calculate indentation for a command line in DCL.
-If this variable is non-nil it is called as a function: 
+If this variable is non-nil it is called as a function:
 
 \(func INDENT-TYPE CUR-INDENT EXTRA-INDENT LAST-POINT THIS-POINT)
 
-The function must return the number of columns to indent the current line or 
+The function must return the number of columns to indent the current line or
 nil to get the default indentation.
 
 INDENT-TYPE is a symbol indicating what kind of indentation should be done.
@@ -133,89 +176,112 @@ It can have the following values:
   outdent     the lines indentation should be decreased, e.g a line with ENDIF.
   first-line  indentation for the first line in a buffer or SUBROUTINE.
 CUR-INDENT is the indentation of the preceding command line.
-EXTRA-INDENT is the default change in indentation for this line 
+EXTRA-INDENT is the default change in indentation for this line
 \(a negative number for 'outdent).
 LAST-POINT is the buffer position of the first significant word on the
 previous line or nil if the current line is the first line.
 THIS-POINT is the buffer position of the first significant word on the
 current line.
 
-If this variable is nil, the indentation is calculated as 
+If this variable is nil, the indentation is calculated as
 CUR-INDENT + EXTRA-INDENT.
 
 This package includes two functions suitable for this:
   dcl-calc-command-indent-multiple
-  dcl-calc-command-indent-hang
-")
+  dcl-calc-command-indent-hang"
+  :type '(choice (const nil) function)
+  :group 'dcl)
 
 
-(defvar dcl-calc-cont-indent-function 'dcl-calc-cont-indent-relative
+(defcustom dcl-calc-cont-indent-function 'dcl-calc-cont-indent-relative
   "*Function to calculate indentation for a continuation line.
-If this variable is non-nil it is called as a function: 
+If this variable is non-nil it is called as a function:
 
 \(func CUR-INDENT EXTRA-INDENT)
 
-The function must return the number of columns to indent the current line or 
+The function must return the number of columns to indent the current line or
 nil to get the default indentation.
 
-If this variable is nil, the indentation is calculated as 
+If this variable is nil, the indentation is calculated as
 CUR-INDENT + EXTRA-INDENT.
 
 This package includes one function suitable for this:
-  dcl-calc-cont-indent-relative
-")
+  dcl-calc-cont-indent-relative"
+  :type 'function
+  :group 'dcl)
 
 
-(defvar dcl-tab-always-indent t
+(defcustom dcl-tab-always-indent t
   "*Controls the operation of the TAB key in DCL mode.
 If t, pressing TAB always indents the current line.
 If nil, pressing TAB indents the current line if point is at the left margin.
-Data lines (i.e. lines not part of a command line or continuation line) are 
-never indented.")
+Data lines (i.e. lines not part of a command line or continuation line) are
+never indented."
+  :type 'boolean
+  :group 'dcl)
 
 
-(defvar dcl-electric-characters t
-  "*Non-nil means reindent immediately when a label, ELSE or ENDIF is inserted.")
+(defcustom dcl-electric-characters t
+  "*Non-nil means reindent immediately when a label, ELSE or ENDIF is inserted."
+  :type 'boolean
+  :group 'dcl)
 
 
-(defvar dcl-tempo-comma ", "
-  "*Text to insert when a comma is needed in a template, in DCL mode.")
+(defcustom dcl-tempo-comma ", "
+  "*Text to insert when a comma is needed in a template, in DCL mode."
+  :type 'string
+  :group 'dcl)
 
-(defvar dcl-tempo-left-paren "("
-  "*Text to insert when a left parenthesis is needed in a template in DCL.")
+(defcustom dcl-tempo-left-paren "("
+  "*Text to insert when a left parenthesis is needed in a template in DCL."
+  :type 'string
+  :group 'dcl)
 
 
-(defvar dcl-tempo-right-paren ")"
-  "*Text to insert when a right parenthesis is needed in a template in DCL.")
+(defcustom dcl-tempo-right-paren ")"
+  "*Text to insert when a right parenthesis is needed in a template in DCL."
+  :type 'string
+  :group 'dcl)
 
 ; I couldn't decide what looked best, so I'll let you decide...
 ; Remember, you can also customize this with imenu-submenu-name-format.
-(defvar dcl-imenu-label-labels "Labels"
-  "*Imenu menu title for sub-listing with label names.")
-(defvar dcl-imenu-label-goto "GOTO"
-  "*Imenu menu title for sub-listing with GOTO statements.")
-(defvar dcl-imenu-label-gosub "GOSUB"
-  "*Imenu menu title for sub-listing with GOSUB statements.")
-(defvar dcl-imenu-label-call "CALL"
-  "*Imenu menu title for sub-listing with CALL statements.")
-
-(defvar dcl-imenu-generic-expression
-  (`
-   ((nil "^\\$[ \t]*\\([A-Za-z0-9_\$]+\\):[ \t]+SUBROUTINE\\b" 1)
-    ((, dcl-imenu-label-labels)
+(defcustom dcl-imenu-label-labels "Labels"
+  "*Imenu menu title for sub-listing with label names."
+  :type 'string
+  :group 'dcl)
+(defcustom dcl-imenu-label-goto "GOTO"
+  "*Imenu menu title for sub-listing with GOTO statements."
+  :type 'string
+  :group 'dcl)
+(defcustom dcl-imenu-label-gosub "GOSUB"
+  "*Imenu menu title for sub-listing with GOSUB statements."
+  :type 'string
+  :group 'dcl)
+(defcustom dcl-imenu-label-call "CALL"
+  "*Imenu menu title for sub-listing with CALL statements."
+  :type 'string
+  :group 'dcl)
+
+(defcustom dcl-imenu-generic-expression
+  `((nil "^\\$[ \t]*\\([A-Za-z0-9_\$]+\\):[ \t]+SUBROUTINE\\b" 1)
+    (,dcl-imenu-label-labels
      "^\\$[ \t]*\\([A-Za-z0-9_\$]+\\):\\([ \t]\\|$\\)" 1)
-    ((, dcl-imenu-label-goto) "\\s-GOTO[ \t]+\\([A-Za-z0-9_\$]+\\)" 1)
-    ((, dcl-imenu-label-gosub) "\\s-GOSUB[ \t]+\\([A-Za-z0-9_\$]+\\)" 1)
-    ((, dcl-imenu-label-call) "\\s-CALL[ \t]+\\([A-Za-z0-9_\$]+\\)" 1)))
-"*Default imenu generic expression for DCL.
+    (,dcl-imenu-label-goto "\\s-GOTO[ \t]+\\([A-Za-z0-9_\$]+\\)" 1)
+    (,dcl-imenu-label-gosub "\\s-GOSUB[ \t]+\\([A-Za-z0-9_\$]+\\)" 1)
+    (,dcl-imenu-label-call "\\s-CALL[ \t]+\\([A-Za-z0-9_\$]+\\)" 1))
+  "*Default imenu generic expression for DCL.
 
 The default includes SUBROUTINE labels in the main listing and
-sub-listings for other labels, CALL, GOTO and GOSUB statements. 
-See `imenu-generic-expression' for details.")
+sub-listings for other labels, CALL, GOTO and GOSUB statements.
+See `imenu-generic-expression' for details."
+  :type '(repeat (sexp :tag "Imenu Expression"))
+  :group 'dcl)
 
 
-(defvar dcl-mode-hook nil
-  "*Hook called by `dcl-mode'.")
+(defcustom dcl-mode-hook nil
+  "*Hook called by `dcl-mode'."
+  :type 'hook
+  :group 'dcl)
 
 
 ;;; *** Global variables ****************************************************
@@ -223,14 +289,14 @@ See `imenu-generic-expression' for details.")
 
 (defvar dcl-mode-syntax-table nil
   "Syntax table used in DCL-buffers.")
-(if dcl-mode-syntax-table
-    ()
+(unless dcl-mode-syntax-table
   (setq dcl-mode-syntax-table (make-syntax-table))
   (modify-syntax-entry ?!  "<" dcl-mode-syntax-table) ; comment start
   (modify-syntax-entry ?\n ">" dcl-mode-syntax-table) ; comment end
   (modify-syntax-entry ?< "(>" dcl-mode-syntax-table) ; < and ...
   (modify-syntax-entry ?> ")<" dcl-mode-syntax-table) ; > is a matching pair
-) 
+  (modify-syntax-entry ?\\ "_" dcl-mode-syntax-table) ; not an escape
+)
 
 
 (defvar dcl-mode-map ()
@@ -300,38 +366,46 @@ See `imenu-generic-expression' for details.")
   )
 
 
-(defvar dcl-ws-r
+(defcustom dcl-ws-r
   "\\([ \t]*-[ \t]*\\(!.*\\)*\n\\)*[ \t]*"
   "Regular expression describing white space in a DCL command line.
 White space is any number of continued lines with only space,tab,endcomment
-followed by space or tab.")
+followed by space or tab."
+  :type 'regexp
+  :group 'dcl)
 
 
-(defvar dcl-label-r
+(defcustom dcl-label-r
   "[a-zA-Z0-9_\$]*:\\([ \t!]\\|$\\)"
   "Regular expression describing a label.
-A label is a name followed by a colon followed by white-space or end-of-line.")
+A label is a name followed by a colon followed by white-space or end-of-line."
+  :type 'regexp
+  :group 'dcl)
 
 
-(defvar dcl-cmd-r 
+(defcustom dcl-cmd-r
   "^\\$\\(.*-[ \t]*\\(!.*\\)*\n\\)*[^!\"\n]*\\(\".*\\(\"\".*\\)*\"\\)*[^!\"\n]*"
   "Regular expression describing a DCL command line up to a trailing comment.
 A line starting with $, optionally followed by continuation lines,
 followed by the end of the command line.
 A continuation line is any characters followed by `-',
-optionally followed by a comment, followed by a newline.")
+optionally followed by a comment, followed by a newline."
+  :type 'regexp
+  :group 'dcl)
 
 
-(defvar dcl-command-regexp 
+(defcustom dcl-command-regexp
   "^\\$\\(.*-[ \t]*\\(!.*\\)*\n\\)*.*\\(\".*\\(\"\".*\\)*\"\\)*"
   "Regular expression describing a DCL command line.
 A line starting with $, optionally followed by continuation lines,
 followed by the end of the command line.
 A continuation line is any characters followed by `-',
-optionally followed by a comment, followed by a newline.")
+optionally followed by a comment, followed by a newline."
+  :type 'regexp
+  :group 'dcl)
 
 
-(defvar dcl-electric-reindent-regexps
+(defcustom dcl-electric-reindent-regexps
   (list "endif" "else" dcl-label-r)
   "*Regexps that can trigger an electric reindent.
 A list of regexps that will trigger a reindent if the last letter
@@ -339,10 +413,12 @@ is defined as dcl-electric-character.
 
 E.g.: if this list contains `endif', the key `f' is defined as
 dcl-electric-character and the you have just typed the `f' in
-`endif', the line will be reindented.")
+`endif', the line will be reindented."
+  :type '(repeat regexp)
+  :group 'dcl)
 
 
-(defvar dcl-option-alist 
+(defvar dcl-option-alist
   '((dcl-basic-offset dcl-option-value-basic)
     (dcl-continuation-offset curval)
     (dcl-margin-offset dcl-option-value-margin-offset)
@@ -350,12 +426,12 @@ dcl-electric-character and the you have just typed the `f' in
     (dcl-comment-line-regexp dcl-option-value-comment-line)
     (dcl-block-begin-regexp curval)
     (dcl-block-end-regexp curval)
-    (dcl-tab-always-indent toggle)             
-    (dcl-electric-characters toggle)   
+    (dcl-tab-always-indent toggle)
+    (dcl-electric-characters toggle)
     (dcl-electric-reindent-regexps curval)
-    (dcl-tempo-comma curval)           
-    (dcl-tempo-left-paren curval)              
-    (dcl-tempo-right-paren curval)             
+    (dcl-tempo-comma curval)
+    (dcl-tempo-left-paren curval)
+    (dcl-tempo-right-paren curval)
     (dcl-calc-command-indent-function curval)
     (dcl-calc-cont-indent-function curval)
     (comment-start curval)
@@ -371,7 +447,7 @@ curval       the current value
 toggle       the opposite of the current value (for t/nil)")
 
 
-(defvar dcl-option-history 
+(defvar dcl-option-history
   (mapcar (lambda (option-assoc)
            (format "%s" (car option-assoc)))
          dcl-option-alist)
@@ -393,7 +469,7 @@ Preloaded with all known option names from dcl-option-alist")
 ;  "*Default imenu generic expression for DCL.
 
 ;The default includes SUBROUTINE labels in the main listing and
-;sub-listings for other labels, CALL, GOTO and GOSUB statements. 
+;sub-listings for other labels, CALL, GOTO and GOSUB statements.
 ;See `imenu-generic-expression' in a recent (e.g. Emacs 19.30) imenu.el
 ;for details.")
 
@@ -410,7 +486,7 @@ THEN-ELSE-ENDIF and between lines matching dcl-block-begin-regexp and
 dcl-block-end-regexp.)
 
 Labels are indented to a fixed position unless they begin or end a block.
-Whole-line comments (matching dcl-comment-line-regexp) are not indented. 
+Whole-line comments (matching dcl-comment-line-regexp) are not indented.
 Data lines are not indented.
 
 Key bindings:
@@ -438,7 +514,7 @@ Variables controlling indentation style and extra features:
     Indentation for a label.
 
  dcl-comment-line-regexp
-    Lines matching this regexp will not be indented. 
+    Lines matching this regexp will not be indented.
 
  dcl-block-begin-regexp
  dcl-block-end-regexp
@@ -461,10 +537,10 @@ Variables controlling indentation style and extra features:
 
  dcl-tab-always-indent
     If t, pressing TAB always indents the current line.
-    If nil, pressing TAB indents the current line if point is at the left 
+    If nil, pressing TAB indents the current line if point is at the left
     margin.
 
- dcl-electric-characters 
+ dcl-electric-characters
     Non-nil causes lines to be indented at once when a label, ELSE or ENDIF is
     typed.
 
@@ -480,7 +556,7 @@ Variables controlling indentation style and extra features:
  dcl-imenu-generic-expression
     Default value for imenu-generic-expression.  The default includes
     SUBROUTINE labels in the main listing and sub-listings for
-    other labels, CALL, GOTO and GOSUB statements. 
+    other labels, CALL, GOTO and GOSUB statements.
 
  dcl-imenu-label-labels
  dcl-imenu-label-goto
@@ -489,34 +565,37 @@ Variables controlling indentation style and extra features:
     Change the text that is used as sub-listing labels in imenu.
 
 Loading this package calls the value of the variable
-`dcl-mode-load-hook' with no args, if that value is non-nil. 
-Turning on DCL mode calls the value of the variable `dcl-mode-hook' 
+`dcl-mode-load-hook' with no args, if that value is non-nil.
+Turning on DCL mode calls the value of the variable `dcl-mode-hook'
 with no args, if that value is non-nil.
 
 
 The following example uses the default values for all variables:
 
-$! This is a comment line that is not indented (it matches 
+$! This is a comment line that is not indented (it matches
 $! dcl-comment-line-regexp)
 $! Next follows the first command line.  It is indented dcl-margin-offset.
 $       i = 1
 $       ! Other comments are indented like command lines.
 $       ! A margin label indented dcl-margin-label-offset:
-$ label: 
+$ label:
 $       if i.eq.1
 $       then
-$           ! Lines between THEN-ELSE and ELSE-ENDIF are 
+$           ! Lines between THEN-ELSE and ELSE-ENDIF are
 $           ! indented dcl-basic-offset
 $           loop1: ! This matches dcl-block-begin-regexp...
 $               ! ...so this line is indented dcl-basic-offset
-$               text = \"This \" + - ! is a continued line 
+$               text = \"This \" + - ! is a continued line
                        \"lined up with the command line\"
 $               type sys$input
-Data lines are not indented at all. 
+Data lines are not indented at all.
 $           endloop1: ! This matches dcl-block-end-regexp
 $       endif
 $
-"
+
+
+There is some minimal font-lock support (see vars
+`dcl-font-lock-defaults' and `dcl-font-lock-keywords')."
   (interactive)
   (kill-all-local-variables)
   (set-syntax-table dcl-mode-syntax-table)
@@ -532,7 +611,7 @@ $
 
   (make-local-variable 'comment-multi-line)
   (setq comment-multi-line nil)
-  
+
   ;; This used to be "^\\$[ \t]*![ \t]*" which looks more correct.
   ;; The drawback was that you couldn't make empty comment lines by pressing
   ;; C-M-j repeatedly - only the first line became a comment line.
@@ -542,7 +621,8 @@ $
   (setq comment-start-skip "\\$[ \t]*![ \t]*")
 
   (if (boundp 'imenu-generic-expression)
-      (setq imenu-generic-expression dcl-imenu-generic-expression))
+      (progn (setq imenu-generic-expression dcl-imenu-generic-expression)
+             (setq imenu-case-fold-search t)))
   (setq imenu-create-index-function 'dcl-imenu-create-index-function)
 
   (make-local-variable 'dcl-comment-line-regexp)
@@ -557,12 +637,16 @@ $
   (make-local-variable 'dcl-calc-command-indent-function)
   (make-local-variable 'dcl-calc-cont-indent-function)
   (make-local-variable 'dcl-electric-reindent-regexps)
-  
+
+  ;; font lock
+  (make-local-variable 'font-lock-defaults)
+  (setq font-lock-defaults dcl-font-lock-defaults)
+
   (setq major-mode 'dcl-mode)
   (setq mode-name "DCL")
   (use-local-map dcl-mode-map)
   (tempo-use-tag-list 'dcl-tempo-tags)
-  (run-hooks 'dcl-mode-hook))
+  (run-mode-hooks 'dcl-mode-hook))
 
 
 ;;; *** Movement commands ***************************************************
@@ -617,7 +701,7 @@ $
   "Move backward to a command.
 Move point to the preceding command line that is not a comment line,
 a command line with only a comment, only contains a `$' or only
-contains a label. 
+contains a label.
 
 Returns point of the found command line or nil if not able to move."
   (interactive)
@@ -661,7 +745,7 @@ Returns point of the found command line or nil if not able to move."
   "Move forward to a command.
 Move point to the end of the next command line that is not a comment line,
 a command line with only a comment, only contains a `$' or only
-contains a label. 
+contains a label.
 
 Returns point of the found command line or nil if not able to move."
   (interactive)
@@ -711,9 +795,9 @@ Leading $ and labels counts as whitespace in this case.
 If this is a comment line then move to the first non-whitespace character
 in the comment.
 
-Typing \\[dcl-back-to-indentation] several times in a row will move point to other 
+Typing \\[dcl-back-to-indentation] several times in a row will move point to other
 `interesting' points closer to the left margin, and then back to the
-rightmost point again. 
+rightmost point again.
 
 E.g. on the following line, point would go to the positions indicated
 by the numbers in order 1-2-3-1-... :
@@ -734,7 +818,7 @@ by the numbers in order 1-2-3-1-... :
   ;;  $  !  text
   ;;  3  2  1
   ;;
-  ;;  $  l:  command  !  
+  ;;  $  l:  command  !
   ;;  3  2   1
   ;;
   ;;  text
@@ -756,7 +840,7 @@ by the numbers in order 1-2-3-1-... :
        (setq last-good-point (point)))
 
     (cond
-     ;; Special treatment for comment lines.  We are trying to allow 
+     ;; Special treatment for comment lines.  We are trying to allow
      ;; things like "$ !*" as comment lines.
      ((looking-at dcl-comment-line-regexp)
       (re-search-forward (concat dcl-comment-line-regexp "[ \t]*") limit t)
@@ -850,7 +934,7 @@ Returns one of the following symbols:
     (dcl-back-to-indentation)
     (point)))
 
-                      
+
 ;;;---------------------------------------------------------------------------
 (defun dcl-show-line-type ()
   "Test dcl-get-line-type."
@@ -928,7 +1012,7 @@ $ xxx
 
 If you use this function you will probably want to add \"then\" to
 dcl-electric-reindent-regexps and define the key \"n\" as
-dcl-electric-character. 
+dcl-electric-character.
 "
   (let ((case-fold-search t))
     (save-excursion
@@ -952,7 +1036,7 @@ dcl-electric-character.
          (- (+ cur-indent extra-indent) 2))
         ((looking-at "\\belse\\b")
          (- (+ cur-indent extra-indent) 2))))
-       ;; Outdent, this word is `endif' or `else': + 2 
+       ;; Outdent, this word is `endif' or `else': + 2
        ((equal indent-type 'outdent)
        (goto-char this-point)
        (cond
@@ -977,19 +1061,19 @@ non-nil.
 
 If the current line should be outdented, calculate its indentation,
 either with the default method or by calling
-dcl-calc-command-indent-function if it is non-nil. 
+dcl-calc-command-indent-function if it is non-nil.
 
 
 Rules for default indentation:
 
 If it is the first line in the buffer, indent dcl-margin-offset.
 
-Go to the previous command line with a command on it. 
+Go to the previous command line with a command on it.
 Find out how much it is indented (cur-indent).
 Look at the first word on the line to see if the indentation should be
 adjusted.  Skip margin-label, continuations and comments while looking for
 the first word.  Save this buffer position as `last-point'.
-If the first word after a label is SUBROUTINE, set extra-indent to 
+If the first word after a label is SUBROUTINE, set extra-indent to
 dcl-margin-offset.
 
 First word  extra-indent
@@ -999,7 +1083,7 @@ block-begin +dcl-basic-offset
 
 Then return to the current line and look at the first word to see if the
 indentation should be adjusted again.  Save this buffer position as
-`this-point'. 
+`this-point'.
 
 First word  extra-indent
 ELSE        -dcl-basic-offset
@@ -1012,7 +1096,7 @@ cur-indent to cur-indent+extra-indent.
 
 If an extra adjustment is necessary and if
 dcl-calc-command-indent-function is nil or returns nil set cur-indent
-to cur-indent+extra-indent. 
+to cur-indent+extra-indent.
 
 See also documentation for dcl-calc-command-indent-function.
 The indent-type classification could probably be expanded upon.
@@ -1055,7 +1139,7 @@ The indent-type classification could probably be expanded upon.
                 ;; We couldn't go further back, so this must have been the
                ;; first line.
                 (setq cur-indent dcl-margin-offset
-                     last-point (dcl-indentation-point)) 
+                     last-point (dcl-indentation-point))
                 (setq done t)))
            ;; Examine the line to get current indentation and possibly a
            ;; reason to indent.
@@ -1139,7 +1223,7 @@ Indented lines will align with either:
 * the second word on the command line
   $ set default -
         [-]
-* the word after an asignment
+* the word after an assignment
   $ a = b + -
         d
 * the third word if it's a qualifier
@@ -1151,7 +1235,7 @@ Indented lines will align with either:
                                 yyy)))
 "
   (let ((case-fold-search t)
-       indent) 
+       indent)
     (save-excursion
       (dcl-beginning-of-statement)
       (let ((end (save-excursion (forward-line 1) (point))))
@@ -1170,7 +1254,7 @@ Indented lines will align with either:
                          (skip-chars-forward " \t:=" end)))
                    ;; This could be the position to indent to
                    (setq indent (current-column))
-                   
+
                    ;; Move to the next word unless we have seen an
                    ;; assignment.  If it starts with `/' it's a
                    ;; qualifier and we will indent to that position
@@ -1277,7 +1361,7 @@ Find out how much it is indented."
             (re-search-forward dcl-label-r)))
       (dcl-indent-to indent 1)
       )
-    ;; 
+    ;;
     (if (> (- (point-max) pos) (point))
         (goto-char (- (point-max) pos)))
     ))
@@ -1325,7 +1409,7 @@ Adjusts indentation on the current line.  Data lines are not indented."
      (t
       (message "dcl-indent-line: unknown type"))
      )))
-     
+
 
 ;;;-------------------------------------------------------------------------
 (defun dcl-indent-command ()
@@ -1355,9 +1439,9 @@ the lines indentation; otherwise insert a tab."
         (start-point (point)))
     (cond
      ;; Data line : always insert tab
-     ((or (equal type 'data) (equal type 'empty-data)) 
+     ((or (equal type 'data) (equal type 'empty-data))
       (tab-to-tab-stop))
-     ;; Indent only at start of line 
+     ;; Indent only at start of line
      ((not dcl-tab-always-indent)       ; nil
       (let ((search-end-point
              (save-excursion
@@ -1377,7 +1461,7 @@ the lines indentation; otherwise insert a tab."
 ;;;-------------------------------------------------------------------------
 (defun dcl-electric-character (arg)
   "Inserts a character and indents if necessary.
-Insert a character if the user gave a numeric argument or the flag 
+Insert a character if the user gave a numeric argument or the flag
 `dcl-electric-characters' is not set.  If an argument was given,
 insert that many characters.
 
@@ -1392,7 +1476,7 @@ regexps in `dcl-electric-reindent-regexps'."
     (self-insert-command 1)
     (let ((case-fold-search t))
       ;; There must be a better way than (memq t ...).
-      ;; (apply 'or ...) didn't work  
+      ;; (apply 'or ...) didn't work
       (if (memq t (mapcar 'dcl-was-looking-at dcl-electric-reindent-regexps))
           (dcl-indent-line)))))
 
@@ -1412,7 +1496,7 @@ regexps in `dcl-electric-reindent-regexps'."
        (progn
          (dcl-delete-chars " \t")
          (indent-to col minimum)))))
-    
+
 
 ;;;-------------------------------------------------------------------------
 (defun dcl-split-line ()
@@ -1460,7 +1544,7 @@ Inserts continuation marks and splits character strings."
     (if (not done)                     ; normal M-LFD action
        (indent-new-comment-line))))
 
-        
+
 ;;;-------------------------------------------------------------------------
 (defun dcl-delete-indentation (&optional arg)
   "Join this line to previous like delete-indentation.
@@ -1531,7 +1615,7 @@ Returns the column offset."
 (defun dcl-option-value-margin-offset (option-assoc)
   "Guess a value for margin offset.
 Find the column of the first non-blank character on the line, not
-counting labels. 
+counting labels.
 Returns a number as a string."
   (save-excursion
     (beginning-of-line)
@@ -1559,7 +1643,7 @@ Must return a string."
         (let ((regexp (buffer-substring (match-beginning 0) (match-end 0))))
           (concat "^" (regexp-quote regexp)))
        dcl-comment-line-regexp))))
-      
+
 
 ;;;-------------------------------------------------------------------------
 (defun dcl-guess-option-value (option)
@@ -1650,7 +1734,7 @@ Returns the name of the option variable as a string."
                   (and next-indent
                        (/= (- this-indent next-indent) 0))))))
       "dcl-basic-offset")
-     ;; No more guesses. 
+     ;; No more guesses.
      (t
       ""))))
 
@@ -1688,8 +1772,8 @@ All variable names are available as completions and in the history list."
 ;;;-------------------------------------------------------------------------
 (defun dcl-save-local-variable (var &optional def-prefix def-suffix)
   "Save a variable in a `Local Variables' list.
-Set or update the value of VAR in the current buffers 
-`Local Variables:' list." 
+Set or update the value of VAR in the current buffers
+`Local Variables:' list."
   ;; Look for "Local variables:" line in last page.
   (save-excursion
     (goto-char (point-max))
@@ -1739,7 +1823,7 @@ Set or update the value of VAR in the current buffers
                    ;; Not found.  Insert a new entry before this line
                    (setq continue nil)
                    (beginning-of-line)
-                   (insert (concat prefix-string (symbol-name var) ": " 
+                   (insert (concat prefix-string (symbol-name var) ": "
                                    (prin1-to-string (eval var)) " "
                                    suffix-string "\n")))
                ;; Is it the variable we are looking for?
@@ -1785,7 +1869,7 @@ Set or update the value of VAR in the current buffers
                    comment-end
                  (concat " " comment-end))))))
        (insert (concat def-prefix "Local variables:" def-suffix "\n"))
-       (insert (concat def-prefix (symbol-name var) ": " 
+       (insert (concat def-prefix (symbol-name var) ": "
                        (prin1-to-string (eval var)) def-suffix "\n"))
        (insert (concat def-prefix "end:" def-suffix)))
       )))
@@ -1854,13 +1938,11 @@ section at the end of the current buffer."
 ;; standard Emacs.  I would have liked something closer to the functionality
 ;; of LSE templates...
 
-
-(require 'tempo)
 (defvar dcl-tempo-tags nil
   "Tempo tags for DCL mode.")
-  
+
 (tempo-define-template "dcl-f$context"
-                      '("f$context" dcl-tempo-left-paren 
+                      '("f$context" dcl-tempo-left-paren
                         (p "context-type: ") dcl-tempo-comma
                         (p "context-symbol: ") dcl-tempo-comma
                         (p "selection-item: ") dcl-tempo-comma
@@ -1869,33 +1951,33 @@ section at the end of the current buffer."
                       "f$context" "" 'dcl-tempo-tags)
 
 (tempo-define-template "dcl-f$csid"
-                      '("f$csid" dcl-tempo-left-paren 
+                      '("f$csid" dcl-tempo-left-paren
                         (p "context-symbol: ") dcl-tempo-right-paren)
                       "f$csid" "" 'dcl-tempo-tags)
 
 (tempo-define-template "dcl-f$cvsi"
-                      '("f$cvsi" dcl-tempo-left-paren 
+                      '("f$cvsi" dcl-tempo-left-paren
                         (p "start-bit: ") dcl-tempo-comma
                         (p "number-of-bits: ") dcl-tempo-comma
                         (p "string: ") dcl-tempo-right-paren)
                       "f$cvsi" "" 'dcl-tempo-tags)
 
 (tempo-define-template "dcl-f$cvtime"
-                      '("f$cvtime" dcl-tempo-left-paren 
+                      '("f$cvtime" dcl-tempo-left-paren
                         (p "[input_time]: ") dcl-tempo-comma
                         (p "[output_time_format]: ") dcl-tempo-comma
                         (p "[output_field]: ") dcl-tempo-right-paren)
                       "f$cvtime" "" 'dcl-tempo-tags)
 
 (tempo-define-template "dcl-f$cvui"
-                      '("f$cvui" dcl-tempo-left-paren 
+                      '("f$cvui" dcl-tempo-left-paren
                         (p "start-bit: ") dcl-tempo-comma
                         (p "number-of-bits: ") dcl-tempo-comma
                         (p "string") dcl-tempo-right-paren)
                       "f$cvui" "" 'dcl-tempo-tags)
 
 (tempo-define-template "dcl-f$device"
-                      '("f$device" dcl-tempo-left-paren 
+                      '("f$device" dcl-tempo-left-paren
                         (p "[search_devnam]: ") dcl-tempo-comma
                         (p "[devclass]: ") dcl-tempo-comma
                         (p "[devtype]: ") dcl-tempo-comma
@@ -1908,56 +1990,56 @@ section at the end of the current buffer."
                       "f$directory" "" 'dcl-tempo-tags)
 
 (tempo-define-template "dcl-f$edit"
-                      '("f$edit" dcl-tempo-left-paren 
+                      '("f$edit" dcl-tempo-left-paren
                         (p "string: ") dcl-tempo-comma
                         (p "edit-list: ") dcl-tempo-right-paren)
                       "f$edit" "" 'dcl-tempo-tags)
 
 (tempo-define-template "dcl-f$element"
-                      '("f$element" dcl-tempo-left-paren 
+                      '("f$element" dcl-tempo-left-paren
                         (p "element-number: ") dcl-tempo-comma
                         (p "delimiter: ") dcl-tempo-comma
                         (p "string: ") dcl-tempo-right-paren)
                       "f$element" "" 'dcl-tempo-tags)
 
 (tempo-define-template "dcl-f$environment"
-                      '("f$environment" dcl-tempo-left-paren 
+                      '("f$environment" dcl-tempo-left-paren
                         (p "item: ") dcl-tempo-right-paren)
                       "f$environment" "" 'dcl-tempo-tags)
 
 (tempo-define-template "dcl-f$extract"
-                      '("f$extract" dcl-tempo-left-paren 
+                      '("f$extract" dcl-tempo-left-paren
                         (p "start: ") dcl-tempo-comma
                         (p "length: ") dcl-tempo-comma
                         (p "string: ") dcl-tempo-right-paren)
                       "f$extract" "" 'dcl-tempo-tags)
 
 (tempo-define-template "dcl-f$fao"
-                      '("f$fao" dcl-tempo-left-paren 
+                      '("f$fao" dcl-tempo-left-paren
                         (p "control-string: ") dcl-tempo-comma
                         ("argument[,...]: ") dcl-tempo-right-paren)
                       "f$fao" "" 'dcl-tempo-tags)
 
 (tempo-define-template "dcl-f$file_attributes"
-                      '("f$file_attributes" dcl-tempo-left-paren 
+                      '("f$file_attributes" dcl-tempo-left-paren
                         (p "filespec: ") dcl-tempo-comma
                         (p "item: ") dcl-tempo-right-paren)
                       "f$file_attributes" "" 'dcl-tempo-tags)
 
 (tempo-define-template "dcl-f$getdvi"
-                      '("f$getdvi" dcl-tempo-left-paren 
+                      '("f$getdvi" dcl-tempo-left-paren
                         (p "device-name: ") dcl-tempo-comma
                         (p "item: ") dcl-tempo-right-paren)
                       "f$getdvi" "" 'dcl-tempo-tags)
 
 (tempo-define-template "dcl-f$getjpi"
-                      '("f$getjpi" dcl-tempo-left-paren 
+                      '("f$getjpi" dcl-tempo-left-paren
                         (p "pid: ") dcl-tempo-comma
                         (p "item: ") dcl-tempo-right-paren )
                       "f$getjpi" "" 'dcl-tempo-tags)
 
 (tempo-define-template "dcl-f$getqui"
-                      '("f$getqui" dcl-tempo-left-paren 
+                      '("f$getqui" dcl-tempo-left-paren
                         (p "function: ") dcl-tempo-comma
                         (p "[item]: ") dcl-tempo-comma
                         (p "[object-id]: ") dcl-tempo-comma
@@ -1965,20 +2047,20 @@ section at the end of the current buffer."
                       "f$getqui" "" 'dcl-tempo-tags)
 
 (tempo-define-template "dcl-f$getsyi"
-                      '("f$getsyi" dcl-tempo-left-paren 
+                      '("f$getsyi" dcl-tempo-left-paren
                         (p "item: ") dcl-tempo-comma
                         (p "[node-name]: ") dcl-tempo-comma
                         (p "[cluster-id]: ") dcl-tempo-right-paren)
                       "f$getsyi" "" 'dcl-tempo-tags)
 
 (tempo-define-template "dcl-f$identifier"
-                      '("f$identifier" dcl-tempo-left-paren 
+                      '("f$identifier" dcl-tempo-left-paren
                         (p "identifier: ") dcl-tempo-comma
                         (p "conversion-type: ") dcl-tempo-right-paren)
                       "f$identifier" "" 'dcl-tempo-tags)
 
 (tempo-define-template "dcl-f$integer"
-                      '("f$integer" dcl-tempo-left-paren 
+                      '("f$integer" dcl-tempo-left-paren
                         (p "expression: ") dcl-tempo-right-paren)
                       "f$integer" "" 'dcl-tempo-tags)
 
@@ -1988,13 +2070,13 @@ section at the end of the current buffer."
                       "f$length" "" 'dcl-tempo-tags)
 
 (tempo-define-template "dcl-f$locate"
-                      '("f$locate" dcl-tempo-left-paren 
+                      '("f$locate" dcl-tempo-left-paren
                         (p "substring: ") dcl-tempo-comma
                         (p "string: ") dcl-tempo-right-paren)
                       "f$locate" "" 'dcl-tempo-tags)
 
 (tempo-define-template "dcl-f$message"
-                      '("f$message" dcl-tempo-left-paren 
+                      '("f$message" dcl-tempo-left-paren
                         (p "status-code: ") dcl-tempo-right-paren )
                       "f$message" "" 'dcl-tempo-tags)
 
@@ -2003,7 +2085,7 @@ section at the end of the current buffer."
                       "f$mode" "" 'dcl-tempo-tags)
 
 (tempo-define-template "dcl-f$parse"
-                      '("f$parse" dcl-tempo-left-paren 
+                      '("f$parse" dcl-tempo-left-paren
                         (p "filespec: ") dcl-tempo-comma
                         (p "[default-spec]: ") dcl-tempo-comma
                         (p "[related-spec]: ") dcl-tempo-comma
@@ -2012,12 +2094,12 @@ section at the end of the current buffer."
                       "f$parse" "" 'dcl-tempo-tags)
 
 (tempo-define-template "dcl-f$pid"
-                      '("f$pid" dcl-tempo-left-paren 
+                      '("f$pid" dcl-tempo-left-paren
                         (p "context-symbol: ") dcl-tempo-right-paren)
                       "f$pid" "" 'dcl-tempo-tags)
 
 (tempo-define-template "dcl-f$privilege"
-                      '("f$privilege" dcl-tempo-left-paren 
+                      '("f$privilege" dcl-tempo-left-paren
                         (p "priv-states: ") dcl-tempo-right-paren)
                       "f$privilege" "" 'dcl-tempo-tags)
 
@@ -2026,18 +2108,18 @@ section at the end of the current buffer."
                       "f$process" "" 'dcl-tempo-tags)
 
 (tempo-define-template "dcl-f$search"
-                      '("f$search" dcl-tempo-left-paren 
+                      '("f$search" dcl-tempo-left-paren
                         (p "filespec: ") dcl-tempo-comma
                         (p "[stream-id]: ") dcl-tempo-right-paren)
                       "f$search" "" 'dcl-tempo-tags)
 
 (tempo-define-template "dcl-f$setprv"
-                      '("f$setprv" dcl-tempo-left-paren 
+                      '("f$setprv" dcl-tempo-left-paren
                         (p "priv-states: ") dcl-tempo-right-paren)
                       "f$setprv" "" 'dcl-tempo-tags)
 
 (tempo-define-template "dcl-f$string"
-                      '("f$string" dcl-tempo-left-paren 
+                      '("f$string" dcl-tempo-left-paren
                         (p "expression: ") dcl-tempo-right-paren)
                       "f$string" "" 'dcl-tempo-tags)
 
@@ -2046,7 +2128,7 @@ section at the end of the current buffer."
                       "f$time" "" 'dcl-tempo-tags)
 
 (tempo-define-template "dcl-f$trnlnm"
-                      '("f$trnlnm" dcl-tempo-left-paren 
+                      '("f$trnlnm" dcl-tempo-left-paren
                         (p "logical-name: ") dcl-tempo-comma
                         (p "[table]: ") dcl-tempo-comma
                         (p "[index]: ") dcl-tempo-comma
@@ -2056,7 +2138,7 @@ section at the end of the current buffer."
                       "f$trnlnm" "" 'dcl-tempo-tags)
 
 (tempo-define-template "dcl-f$type"
-                      '("f$type" dcl-tempo-left-paren 
+                      '("f$type" dcl-tempo-left-paren
                         (p "symbol-name: ") dcl-tempo-right-paren)
                       "f$type" "" 'dcl-tempo-tags)
 
@@ -2065,7 +2147,7 @@ section at the end of the current buffer."
                       "f$user" "" 'dcl-tempo-tags)
 
 (tempo-define-template "dcl-f$verify"
-                      '("f$verify" dcl-tempo-left-paren 
+                      '("f$verify" dcl-tempo-left-paren
                         (p "[procedure-value]: ") dcl-tempo-comma
                         (p "[image-value]: ") dcl-tempo-right-paren)
                       "f$verify" "" 'dcl-tempo-tags)
@@ -2120,7 +2202,7 @@ otherwise return nil."
           ()
         (equal start (match-end 0))))))
 
-                         
+
 ;;;-------------------------------------------------------------------------
 (defun dcl-imenu-create-index-function ()
   "Jacket routine to make imenu searches non case sensitive."
@@ -2136,4 +2218,5 @@ otherwise return nil."
 
 (run-hooks 'dcl-mode-load-hook)                ; for your customizations
 
+;;; arch-tag: e00d421b-f26c-483e-a8bd-af412ea7764a
 ;;; dcl-mode.el ends here