;;; tempo.el --- Flexible template insertion
+
;; Copyright (C) 1994, 1995 Free Software Foundation, Inc.
;; Author: David K}gedal <davidk@lysator.liu.se >
;; GNU General Public License for more details.
;; 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, 675 Mass Ave, Cambridge, MA 02139, USA.
+;; 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.
;;; Commentary:
;;; Contributors:
-;; These people have given me importand feedback and new ideas for
+;; These people have given me important feedback and new ideas for
;; tempo.el. Thanks.
;; Nelson Minar <nelson@santafe.edu>
-;; Richard Stallman <rms@gnu.ai.mit.edu>
+;; Richard Stallman <rms@gnu.org>
;; Lars Lindberg <Lars.Lindberg@sypro.cap.se>
;; Glen Whitney <Glen.Whitney@math.lsa.umich.edu>
;;; User options
-(defvar tempo-interactive nil
+(defgroup tempo nil
+ "Flexible template insertion."
+ :prefix "tempo-"
+ :group 'tools)
+
+(defcustom tempo-interactive nil
"*Prompt user for strings in templates.
If this variable is non-nil, `tempo-insert' prompts the
-user for text to insert in the templates")
+user for text to insert in the templates"
+ :type 'boolean
+ :group 'tempo)
-(defvar tempo-insert-region nil
+(defcustom tempo-insert-region nil
"*Automatically insert current region when there is a `r' in the template
If this variable is NIL, `r' elements will be treated just like `p'
elements, unless the template function is given a prefix (or a non-nil
argument). If this variable is non-NIL, the behaviour is reversed.
-In Transient Mark mode, this option is unused.")
+In Transient Mark mode, this option is unused."
+ :type 'boolean
+ :group 'tempo)
-(defvar tempo-show-completion-buffer t
+(defcustom tempo-show-completion-buffer t
"*If non-NIL, show a buffer with possible completions, when only
-a partial completion can be found")
+a partial completion can be found"
+ :type 'boolean
+ :group 'tempo)
-(defvar tempo-leave-completion-buffer nil
+(defcustom tempo-leave-completion-buffer nil
"*If NIL, a completion buffer generated by \\[tempo-complete-tag]
-disappears at the next keypress; otherwise, it remains forever.")
+disappears at the next keypress; otherwise, it remains forever."
+ :type 'boolean
+ :group 'tempo)
;;; Internal variables
(defvar tempo-local-tags '((tempo-tags . nil))
"A list of locally installed tag completion lists.
It is a association list where the car of every element is a symbol
-whose varable value is a template list. The cdr part, if non-nil, is a
+whose variable value is a template list. The cdr part, if non-nil, is a
function or a regexp that defines the string to match. See the
documentation for the function `tempo-complete-tag' for more info.
(defvar tempo-user-elements nil
"Element handlers for user-defined elements.
A list of symbols which are bound to functions that take one argument.
-This function should return somthing to be sent to `tempo-insert' if
+This function should return something to be sent to `tempo-insert' if
it recognizes the argument, and NIL otherwise")
(defvar tempo-named-insertions nil
TAG-LIST is a symbol whose variable value is a tag list created with
`tempo-add-tag'.
-COMPLETION-FUNCTION is an obsolete option for specifyingis an optional
+COMPLETION-FUNCTION is an obsolete option for specifying an optional
function or string that is used by `\\[tempo-complete-tag]' to find a
string to match the tag against. It has the same definition as the
variable `tempo-match-finder'. In this version, supplying a