;; 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
;;; Functions
-;;; First some useful functions and macros
-
-(defun tempo-mapc (fun lst)
- (if (null lst) nil
- (funcall fun (car lst))
- (tempo-mapc fun (cdr lst))))
-
-(defmacro tempo-dolist (il &rest forms)
- (let ((i (car il))
- (l (car (cdr il))))
- (list 'tempo-mapc
- (list 'function (append (list 'lambda
- (list i))
- forms))
- l)))
-(put 'tempo-dolist 'lisp-indent-function 1)
-
;;
;; tempo-define-template
(setq string
(funcall tempo-insert-string-functions string)))
((listp tempo-insert-string-functions)
- (tempo-dolist (fn tempo-insert-string-functions)
+ (dolist (fn tempo-insert-string-functions)
(setq string (funcall fn string))))
(t
(error "Bogus value in tempo-insert-string-functions: %s"