;ELC ;;; compiled by kwzh@hal.gnu.ai.mit.edu on Thu Jun 8 22:13:53 1995 ;;; from file /gd/gnu/emacs/19.0/lisp/map-ynp.el ;;; emacs version 19.28.93.6. ;;; bytecomp version FSF 2.10 ;;; optimization is on. ;;; this file uses opcodes which do not exist in Emacs 18. (if (and (boundp 'emacs-version) (or (and (boundp 'epoch::version) epoch::version) (string-lessp emacs-version "19.28.90"))) (error "`map-ynp.el' was compiled for Emacs 19.29 or later")) #@1922 Ask a series of boolean questions. Takes args PROMPTER ACTOR LIST, and optional args HELP and ACTION-ALIST. LIST is a list of objects, or a function of no arguments to return the next object or nil. If PROMPTER is a string, the prompt is (format PROMPTER OBJECT). If not a string, PROMPTER is a function of one arg (an object from LIST), which returns a string to be used as the prompt for that object. If the return value is not a string, it may be nil to ignore the object or non-nil to act on the object without asking the user. ACTOR is a function of one arg (an object from LIST), which gets called with each object that the user answers `yes' for. If HELP is given, it is a list (OBJECT OBJECTS ACTION), where OBJECT is a string giving the singular noun for an elt of LIST; OBJECTS is the plural noun for elts of LIST, and ACTION is a transitive verb describing ACTOR. The default is ("object" "objects" "act on"). At the prompts, the user may enter y, Y, or SPC to act on that object; n, N, or DEL to skip that object; ! to act on all following objects; ESC or q to exit (skip all following objects); . (period) to act on the current object and then exit; or \[help-command] to get help. If ACTION-ALIST is given, it is an alist (KEY FUNCTION HELP) of extra keys that will be accepted. KEY is a character; FUNCTION is a function of one arg (an object from LIST); HELP is a string. When the user hits KEY, FUNCTION is called. If it returns non-nil, the object is considered "acted upon", and the next object from LIST is processed. If it returns nil, the prompt is repeated for the same object. Final optional argument NO-CURSOR-IN-ECHO-AREA non-nil says not to set `cursor-in-echo-area' while prompting. This function uses `query-replace-map' to define the standard responses, but not all of the responses which `query-replace' understands are meaningful here. Returns the number of actions taken. (defalias 'map-y-or-n-p #[(prompter actor list &optional help action-alist no-cursor-in-echo-area) " \n \f%\f9A\f!A\f!A\f:E\f@=EЂF<@!A@!8!wRxBQB&\"BBBBB+&&#P&\".\"B0;0BBE0 0!;4\f\f B\"\n17?89 >!!$ @ >!!A!%*B !\"\n\nC=CD\nE=XF! T\nG=\n=zF! TH\n=\nI=J4KҁLDELDF\n=0!F! T 0!F! T\n=oMN@OA@P8QR&S&T#&<TU#R+!VqW )KҁLDELDFX\n!\nH! TKҁLDELDF:@Y= KҁLDELDFZ>!!\"[ \\]!KҁLDELDFF! T)8!) . " [0 actions nil user-keys mouse-event map prompt char elt tail def delayed-switch-frame list subrp byte-code-function-p lambda #[nil " " [list elt] 2] #[nil " @A‡" [list elt t] 1] next last-nonmenu-event capitalize help 2 action objects object ("Yes" . act) ("No" . skip) ("Quit" . exit) " " " And Quit" "Do it and Quit" act-and-exit " All " "Do All" automatic mapcar #[(elt) "\n8!\nA@!B" [capitalize 2 elt vector] 3] action-alist mapconcat #[(elt) "\n@!!" [key-description char-to-string elt] 3] ", " "" keymap append #[(elt) "@A@!B" [elt vector] 3] query-replace-map ((byte-code " B‡" [delayed-switch-frame unread-command-events nil] 2)) prompter (object) format (object) quit-flag x-popup-dialog quit no-cursor-in-echo-area message-log-max cursor-in-echo-area message "%s(y, n, !, ., q, %sor %s) " key-description vector help-char read-event "%s(y, n, !, ., q, %sor %s) %s" single-key-description lookup-key exit #[nil "" [nil] 1] act actor skip #[nil "" [nil] 1] exit-prefix t setq quote "*Help*" princ "object" "objects" "act on" "Type SPC or `y' to %s the current %s;\nDEL or `n' to skip the current %s;\n! to %s all remaining %s;\nESC or `q' to exit;\n" #[(elt) "\n@\n8#" [format "%c to %s" elt 2] 5] ";\n" "or . (period) to %s the current %s and exit." standard-output help-mode vectorp switch-frame "Type %s for help." beep sit-for 1] 10 (#$ . 478)])