Function: reftex-select-with-char

reftex-select-with-char is a byte-compiled function defined in reftex.el.gz.

Signature

(reftex-select-with-char PROMPT HELP-STRING &optional DELAY-TIME SCROLL)

Documentation

Offer to select something with PROMPT.

After DELAY-TIME seconds, also with HELP-STRING. When SCROLL is non-nil, use \SPC and \DEL to scroll help window.

Source Code

;; Defined in /usr/src/emacs/lisp/textmodes/reftex.el.gz
(defun reftex-select-with-char (prompt help-string &optional delay-time scroll)
  "Offer to select something with PROMPT.
After DELAY-TIME seconds, also with HELP-STRING.  When SCROLL is
non-nil, use \\`SPC' and \\`DEL' to scroll help window."
  (let ((char ?\?))
    (save-window-excursion
      (catch 'exit
        (message "%s   (?=Help)" prompt)
        (when (or (sit-for (or delay-time 0))
                  (= ?\? (setq char (read-char-exclusive))))
          (reftex-kill-buffer "*RefTeX Select*")
          (switch-to-buffer-other-window "*RefTeX Select*")
          (insert help-string)
          (goto-char 1)
          (unless (and (pos-visible-in-window-p (point-min))
                       (pos-visible-in-window-p (point-max)))
            (enlarge-window (1+ (- (count-lines (point-min) (point-max))
                                   (window-height)))))
          (setq truncate-lines t))
        (if (and (pos-visible-in-window-p (point-min))
                 (pos-visible-in-window-p (point-max)))
            nil
          (setq prompt (concat prompt (if scroll "   (SPC/DEL=Scroll)" ""))))
        (message "%s" prompt)
        (and (equal char ?\?) (setq char (read-char-exclusive)))
        (while t
          (cond ((equal char ?\C-g) (keyboard-quit))
                ((equal char ?\?))
                ((and scroll (equal char ?\ ))
                 (condition-case nil (scroll-up) (error nil))
                 (message "%s" prompt))
                ((and scroll (equal char ?\C-? ))
                 (condition-case nil (scroll-down) (error nil))
                 (message "%s" prompt))
                (t (message "")
		   (reftex-kill-buffer "*RefTeX Select*")
                   (throw 'exit char)))
          (setq char (read-char-exclusive)))))))