+;; Stop gap for 21.0 until we do help-char etc properly.
+(defun help-keymap-with-help-key (keymap form)
+ "Return a copy of KEYMAP with an help-key binding according to help-char
+ invoking FORM like help-form. An existing binding is not overridden.
+ If FORM is nil then no binding is made."
+ (let ((map (copy-keymap keymap))
+ (key (if (characterp help-char)
+ (vector (character-to-event help-char))
+ help-char)))
+ (when (and form key (not (lookup-key map key)))
+ (define-key map key
+ `(lambda () (interactive) (help-print-help-form ,form))))
+ map))
+
+(defun help-print-help-form (form)
+ (let ((string (eval form)))
+ (if (stringp string)
+ (with-displaying-help-buffer
+ (insert string)))))
+
+