#| -*-Scheme-*-
-$Id: comman.scm,v 1.82 2000/02/23 19:20:42 cph Exp $
+$Id: comman.scm,v 1.83 2000/02/25 20:24:15 cph Exp $
Copyright (c) 1986, 1989-2000 Massachusetts Institute of Technology
(define editor-commands
(make-string-table 500))
-(define (name->command name #!optional error?)
+(define (name->command name #!optional if-undefined)
(let ((name (canonicalize-name name)))
(or (string-table-get editor-commands (symbol->string name))
- (case (if (default-object? error?) 'INTERN error?)
+ (case (if (default-object? if-undefined) 'INTERN if-undefined)
((#F) #f)
+ ((ERROR) (error "Undefined command:" name))
((INTERN)
(letrec ((command
(make-command
name
"undefined command"
'()
- (lambda ()
- (editor-error "Undefined command: "
- (command-name-string command))))))
+ (lambda () (editor-error "Undefined command:" name)))))
command))
(else
- (error "Undefined command:" (command-name-string command)))))))
+ (error:bad-range-argument if-undefined 'NAME->COMMAND))))))
(define (->command object)
(if (command? object)
(define editor-variables
(make-string-table 50))
-(define (name->variable name)
+(define (name->variable name #!optional if-undefined)
(let ((name (canonicalize-name name)))
(or (string-table-get editor-variables (symbol->string name))
- (make-variable name "" #f #f))))
+ (case (if (default-object? if-undefined) 'INTERN if-undefined)
+ ((#F) #f)
+ ((ERROR) (error "Undefined variable:" name))
+ ((INTERN) (make-variable name "" #f #f))
+ (else (error:bad-range-argument if-undefined 'NAME->VARIABLE))))))
(define (->variable object)
(if (variable? object)
;;; -*-Scheme-*-
;;;
-;;; $Id: modes.scm,v 1.31 2000/02/23 19:20:33 cph Exp $
+;;; $Id: modes.scm,v 1.32 2000/02/25 20:24:19 cph Exp $
;;;
;;; Copyright (c) 1986, 1989-2000 Massachusetts Institute of Technology
;;;
(define editor-modes
(make-string-table))
-(define (name->mode object #!optional error?)
+(define (name->mode object #!optional if-undefined)
(let ((name (canonicalize-name object)))
(let ((sname (symbol->string name)))
(or (string-table-get editor-modes sname)
- (case (if (default-object? error?) 'INTERN error?)
+ (case (if (default-object? if-undefined) 'INTERN if-undefined)
((#F) #f)
+ ((ERROR) (error "Undefined mode:" name))
((INTERN)
(make-mode name #t sname #f ""
(lambda () (error "Undefined mode:" name))))
- (else
- (error "Undefined mode:" name)))))))
+
+ (else
+ (error:bad-range-argument if-undefined 'NAME->MODE)))))))
(define (->mode object)
(if (mode? object)