comparison lisp/map-ynp.el @ 807:4f28bd14272c

*** empty log message ***
author Eric S. Raymond <esr@snark.thyrsus.com>
date Thu, 16 Jul 1992 21:47:34 +0000
parents 505130d1ddf8
children e694e0879463
comparison
equal deleted inserted replaced
806:d42e1151eed8 807:4f28bd14272c
1 ;;; map-ynp.el --- General-purpose boolean question-asker. 1 ;;; map-ynp.el --- General-purpose boolean question-asker.
2 2
3 ;; Author: Roland McGrath <roland@gnu.ai.mit.edu>
4 ;; Last-Modified: 14 Mar 1992
5
3 ;;; Copyright (C) 1991, 1992 Free Software Foundation, Inc. 6 ;;; Copyright (C) 1991, 1992 Free Software Foundation, Inc.
4 ;;; Written by Roland McGrath.
5 ;;; 7 ;;;
6 ;;; This program is free software; you can redistribute it and/or modify 8 ;;; This program is free software; you can redistribute it and/or modify
7 ;;; it under the terms of the GNU General Public License as published by 9 ;;; it under the terms of the GNU General Public License as published by
8 ;;; the Free Software Foundation; either version 1, or (at your option) 10 ;;; the Free Software Foundation; either version 2, or (at your option)
9 ;;; any later version. 11 ;;; any later version.
10 ;;; 12 ;;;
11 ;;; This program is distributed in the hope that it will be useful, 13 ;;; This program is distributed in the hope that it will be useful,
12 ;;; but WITHOUT ANY WARRANTY; without even the implied warranty of 14 ;;; but WITHOUT ANY WARRANTY; without even the implied warranty of
13 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 ;;; 17 ;;;
16 ;;; A copy of the GNU General Public License can be obtained from this 18 ;;; A copy of the GNU General Public License can be obtained from this
17 ;;; program's author (send electronic mail to roland@ai.mit.edu) or from 19 ;;; program's author (send electronic mail to roland@ai.mit.edu) or from
18 ;;; the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 20 ;;; the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA
19 ;;; 02139, USA. 21 ;;; 02139, USA.
20 ;;; 22
23 ;;; Commentary:
24
21 ;;; map-y-or-n-p is a general-purpose question-asking function. 25 ;;; map-y-or-n-p is a general-purpose question-asking function.
22 ;;; It asks a series of y/n questions (a la y-or-n-p), and decides to 26 ;;; It asks a series of y/n questions (a la y-or-n-p), and decides to
23 ;;; applies an action to each element of a list based on the answer. 27 ;;; applies an action to each element of a list based on the answer.
24 ;;; The nice thing is that you also get some other possible answers 28 ;;; The nice thing is that you also get some other possible answers
25 ;;; to use, reminiscent of query-replace: ! to answer y to all remaining 29 ;;; to use, reminiscent of query-replace: ! to answer y to all remaining
26 ;;; questions; ESC or q to answer n to all remaining questions; . to answer 30 ;;; questions; ESC or q to answer n to all remaining questions; . to answer
27 ;;; y once and then n for the remainder; and you can get help with C-h. 31 ;;; y once and then n for the remainder; and you can get help with C-h.
32
33 ;;; Code:
28 34
29 (defun map-y-or-n-p-help (object objects action) 35 (defun map-y-or-n-p-help (object objects action)
30 (format "Type SPC or `y' to %s the current %s; 36 (format "Type SPC or `y' to %s the current %s;
31 DEL or `n' to skip the current %s; 37 DEL or `n' to skip the current %s;
32 ! to %s all remaining %s; 38 ! to %s all remaining %s;