- (setq actions (1+ actions)))))
- ((= ?? char)
- (setq unread-command-char help-char)
- (setq next (` (function (lambda ()
- (setq next (, next))
- t)))))
+ (setq actions (1+ actions))))))
+ ((eq def 'help)
+ (with-output-to-temp-buffer "*Help*"
+ (princ
+ (let ((object (if help (nth 0 help) "object"))
+ (objects (if help (nth 1 help) "objects"))
+ (action (if help (nth 2 help) "act on")))
+ (concat (format "Type SPC or `y' to %s the current %s;
+DEL or `n' to skip the current %s;
+! to %s all remaining %s;
+ESC or `q' to exit;\n"
+ action object object action objects)
+ (mapconcat (function
+ (lambda (elt)
+ (format "%c to %s"
+ (nth 0 elt)
+ (nth 2 elt))))
+ action-alist
+ ";\n")
+ (if action-alist ";\n")
+ (format "or . (period) to %s \
+the current %s and exit."
+ action object)))))
+
+ (setq next (` (lambda ()
+ (setq next '(, next))
+ '(, elt)))))
+ ((vectorp def)
+ ;; A user-defined key.
+ (if (funcall (aref def 0) elt) ;Call its function.
+ ;; The function has eaten this object.
+ (setq actions (1+ actions))
+ ;; Regurgitated; try again.
+ (setq next (` (lambda ()
+ (setq next '(, next))
+ '(, elt))))))