summaryrefslogtreecommitdiff
path: root/lisp/map-ynp.el
diff options
context:
space:
mode:
authorRoland McGrath <roland@gnu.org>1993-10-12 00:53:28 +0000
committerRoland McGrath <roland@gnu.org>1993-10-12 00:53:28 +0000
commit1f2db68cb164ac28baace26646151bc826bc0af6 (patch)
treef61dc600600bd4e849468ad195457fb3bc047755 /lisp/map-ynp.el
parenta9aea41391dda0a8fb8818156a18ec3cbb41ce4d (diff)
downloademacs-1f2db68cb164ac28baace26646151bc826bc0af6.tar.gz
(map-y-or-n-p): Take new optional arg to not set cursor-in-echo-area.
Diffstat (limited to 'lisp/map-ynp.el')
-rw-r--r--lisp/map-ynp.el10
1 files changed, 7 insertions, 3 deletions
diff --git a/lisp/map-ynp.el b/lisp/map-ynp.el
index a0badd5ed3a..0e3f219c23c 100644
--- a/lisp/map-ynp.el
+++ b/lisp/map-ynp.el
@@ -1,6 +1,6 @@
;;; map-ynp.el --- General-purpose boolean question-asker.
-;;; Copyright (C) 1991, 1992 Free Software Foundation, Inc.
+;;; Copyright (C) 1991, 1992, 1993 Free Software Foundation, Inc.
;; Author: Roland McGrath <roland@gnu.ai.mit.edu>
;; Keywords: lisp, extensions
@@ -33,7 +33,8 @@
;;; Code:
;;;###autoload
-(defun map-y-or-n-p (prompter actor list &optional help action-alist)
+(defun map-y-or-n-p (prompter actor list &optional help action-alist
+ no-cursor-in-echo-area)
"Ask a series of boolean questions.
Takes args PROMPTER ACTOR LIST, and optional args HELP and ACTION-ALIST.
@@ -67,6 +68,9 @@ 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.
@@ -114,7 +118,7 @@ Returns the number of actions taken."
(progn
(setq quit-flag nil)
;; Prompt the user about this object.
- (let ((cursor-in-echo-area t))
+ (let ((cursor-in-echo-area (not no-cursor-in-echo-area)))
(message "%s(y, n, !, ., q, %sor %s) "
prompt user-keys
(key-description (char-to-string help-char)))