aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEli Zaretskii2018-09-15 11:51:34 +0300
committerEli Zaretskii2018-09-15 11:51:34 +0300
commitcc8f334d2da736be8935f5abae51f7b1f992b343 (patch)
tree160c79380f926560a1dbb1e34c6cc4129db2f680
parent20ecc5266e1ffb1cff3e31475631b5c76b99e997 (diff)
downloademacs-cc8f334d2da736be8935f5abae51f7b1f992b343.tar.gz
emacs-cc8f334d2da736be8935f5abae51f7b1f992b343.zip
Document changes called out in NEWS
* doc/lispref/lists.texi (Association Lists): Document 'assoc-delete-all'. * doc/lispref/minibuf.texi (Minibuffers): Adapt menu. (Multiple Queries): Document 'read-answer'. * etc/NEWS: Reflect the above documentation in the respective entries.
-rw-r--r--doc/lispref/lists.texi7
-rw-r--r--doc/lispref/minibuf.texi55
-rw-r--r--etc/NEWS3
3 files changed, 62 insertions, 3 deletions
diff --git a/doc/lispref/lists.texi b/doc/lispref/lists.texi
index e05633a881d..ce62793550d 100644
--- a/doc/lispref/lists.texi
+++ b/doc/lispref/lists.texi
@@ -1736,6 +1736,13 @@ alist
1736@end example 1736@end example
1737@end defun 1737@end defun
1738 1738
1739@defun assoc-delete-all key alist
1740This function deletes from @var{alist} all the elements whose @sc{car}
1741is @code{equal} to @var{key}. It works like @code{assq-delete-all},
1742except for the predicate used for comparing alist elements with
1743@var{key}.
1744@end defun
1745
1739@defun rassq-delete-all value alist 1746@defun rassq-delete-all value alist
1740This function deletes from @var{alist} all the elements whose @sc{cdr} 1747This function deletes from @var{alist} all the elements whose @sc{cdr}
1741is @code{eq} to @var{value}. It returns the shortened alist, and 1748is @code{eq} to @var{value}. It returns the shortened alist, and
diff --git a/doc/lispref/minibuf.texi b/doc/lispref/minibuf.texi
index 8fac1c3e762..2951ef5aaec 100644
--- a/doc/lispref/minibuf.texi
+++ b/doc/lispref/minibuf.texi
@@ -26,7 +26,7 @@ argument.
26* Initial Input:: Specifying initial contents for the minibuffer. 26* Initial Input:: Specifying initial contents for the minibuffer.
27* Completion:: How to invoke and customize completion. 27* Completion:: How to invoke and customize completion.
28* Yes-or-No Queries:: Asking a question with a simple answer. 28* Yes-or-No Queries:: Asking a question with a simple answer.
29* Multiple Queries:: Asking a series of similar questions. 29* Multiple Queries:: Asking complex questions.
30* Reading a Password:: Reading a password from the terminal. 30* Reading a Password:: Reading a password from the terminal.
31* Minibuffer Commands:: Commands used as key bindings in minibuffers. 31* Minibuffer Commands:: Commands used as key bindings in minibuffers.
32* Minibuffer Windows:: Operating on the special minibuffer windows. 32* Minibuffer Windows:: Operating on the special minibuffer windows.
@@ -2084,9 +2084,12 @@ Do you really want to remove everything? (yes or no)
2084@end defun 2084@end defun
2085 2085
2086@node Multiple Queries 2086@node Multiple Queries
2087@section Asking Multiple Y-or-N Questions 2087@section Asking Multiple-Choice Questions
2088@cindex multiple yes-or-no questions 2088
2089 This section describes facilities for asking the user more complex
2090questions or several similar questions.
2089 2091
2092@cindex multiple yes-or-no questions
2090 When you have a series of similar questions to ask, such as ``Do you 2093 When you have a series of similar questions to ask, such as ``Do you
2091want to save this buffer?'' for each buffer in turn, you should use 2094want to save this buffer?'' for each buffer in turn, you should use
2092@code{map-y-or-n-p} to ask the collection of questions, rather than 2095@code{map-y-or-n-p} to ask the collection of questions, rather than
@@ -2180,6 +2183,52 @@ The return value of @code{map-y-or-n-p} is the number of objects acted on.
2180@c FIXME An example of this would be more useful than all the 2183@c FIXME An example of this would be more useful than all the
2181@c preceding examples of simple things. 2184@c preceding examples of simple things.
2182 2185
2186If you need to ask the user a question that might have more than just
21872 answers, use @code{read-answer}.
2188
2189@defun read-answer question answers
2190@vindex read-answer-short
2191This function prompts the user with text in @var{question}, which
2192should end in the @samp{SPC} character. The function includes in the
2193prompt the possible responses in @var{answers} by appending them to
2194the end of @var{question}. The possible responses are provided in
2195@var{answers} as an alist whose elements are of the following form:
2196
2197@lisp
2198(@var{long-answer} @var{short-answer} @var{help-message})
2199@end lisp
2200
2201@noindent
2202where @var{long-answer} is the complete text of the user response, a
2203string; @var{short-answer} is a short form of the same response, a
2204single character; and @var{help-message} is the text that describes
2205the meaning of the answer. If the variable @code{read-answer-short}
2206is non-@code{nil}, the prompt will show the short variants of the
2207possible answers and the user is expected to type the single
2208characters shown in the prompt; otherwise the prompt will show the
2209long variants of the answers, and the user is expected to type the
2210full text of one of the answers and end by pressing @key{RET}. If
2211@code{use-dialog-box} is non-@code{nil}, and this function was invoked
2212by mouse events, the question and the answers will be displayed in a
2213GUI dialog box.
2214
2215The function returns the text of the @var{long-answer} selected by the
2216user, regardless of whether long or short answers were shown in the
2217prompt and typed by the user.
2218
2219Here is an example of using this function:
2220
2221@lisp
2222(let ((read-answer-short t))
2223 (read-answer "Foo "
2224 '(("yes" ?y "perform the action")
2225 ("no" ?n "skip to the next")
2226 ("all" ?! "perform for the rest without more questions")
2227 ("help" ?h "show help")
2228 ("quit" ?q "exit"))))
2229@end lisp
2230@end defun
2231
2183@node Reading a Password 2232@node Reading a Password
2184@section Reading a Password 2233@section Reading a Password
2185@cindex passwords, reading 2234@cindex passwords, reading
diff --git a/etc/NEWS b/etc/NEWS
index 3a949a9805c..578b9b8d956 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -78,6 +78,7 @@ in its NEWS.)
78 78
79** VC 79** VC
80 80
81---
81*** VC support for Mercurial was improved. 82*** VC support for Mercurial was improved.
82Emacs now avoids invoking 'hg' as much as possible, for faster operation. 83Emacs now avoids invoking 'hg' as much as possible, for faster operation.
83(This and the following changes were actually made in Emacs 26.1, but 84(This and the following changes were actually made in Emacs 26.1, but
@@ -125,9 +126,11 @@ obsolete it.
125 126
126* Lisp Changes in Emacs 26.2 127* Lisp Changes in Emacs 26.2
127 128
129+++
128** The new function 'read-answer' accepts either long or short answers 130** The new function 'read-answer' accepts either long or short answers
129depending on the new customizable variable 'read-answer-short'. 131depending on the new customizable variable 'read-answer-short'.
130 132
133+++
131** New function 'assoc-delete-all'. 134** New function 'assoc-delete-all'.
132Like 'assq-delete-all', but uses 'equal' for comparison. 135Like 'assq-delete-all', but uses 'equal' for comparison.
133 136