aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGlenn Morris2012-04-18 23:04:05 -0700
committerGlenn Morris2012-04-18 23:04:05 -0700
commitc0ea08d2d1420d69b7d0275afcb47b36864b0da4 (patch)
tree0f99d2b0626be515431e950692cca5482a817ceb
parent78c1f4901d5f98f5dc1a05f521a409b753c30548 (diff)
downloademacs-c0ea08d2d1420d69b7d0275afcb47b36864b0da4.tar.gz
emacs-c0ea08d2d1420d69b7d0275afcb47b36864b0da4.zip
More small edits for doc/lispref/minibuf.texi
* doc/lispref/minibuf.texi (Object from Minibuffer): Remove overly pedantic paragraph. (Minibuffer History): Copyedits. Add face-name-history. (Initial Input, Yes-or-No Queries, Multiple Queries) (Minibuffer Windows, Minibuffer Misc): Copyedits. (Yes-or-No Queries): Tweak example. (Minibuffer Commands): Add next-complete-history-element. (Minibuffer Misc): Mention minibuffer-message-timeout, and minibuffer-inactive-mode. * doc/lispref/minibuf.texi (Minibuffers): * doc/lispref/elisp.texi, doc/lispref/vol1.texi, doc/lispref/vol2.texi: Fix minibuffer subsection order. * lisp/subr.el: Comment.
-rw-r--r--doc/lispref/ChangeLog12
-rw-r--r--doc/lispref/elisp.texi2
-rw-r--r--doc/lispref/minibuf.texi97
-rw-r--r--doc/lispref/vol1.texi2
-rw-r--r--doc/lispref/vol2.texi2
-rw-r--r--lisp/subr.el2
6 files changed, 78 insertions, 39 deletions
diff --git a/doc/lispref/ChangeLog b/doc/lispref/ChangeLog
index b815dfbd1ef..ff0b29100ee 100644
--- a/doc/lispref/ChangeLog
+++ b/doc/lispref/ChangeLog
@@ -1,5 +1,17 @@
12012-04-19 Glenn Morris <rgm@gnu.org> 12012-04-19 Glenn Morris <rgm@gnu.org>
2 2
3 * minibuf.texi (Object from Minibuffer): Remove overly pedantic para.
4 (Minibuffer History): Copyedits. Add face-name-history.
5 (Initial Input, Yes-or-No Queries, Multiple Queries)
6 (Minibuffer Windows, Minibuffer Misc): Copyedits.
7 (Yes-or-No Queries): Tweak example.
8 (Minibuffer Commands): Add next-complete-history-element.
9 (Minibuffer Misc): Mention minibuffer-message-timeout, and
10 minibuffer-inactive-mode.
11
12 * minibuf.texi (Minibuffers):
13 * elisp.texi, vol1.texi, vol2.texi: Fix minibuffer subsection order.
14
3 * minibuf.texi: Standardize metasyntactic variables ("history", etc). 15 * minibuf.texi: Standardize metasyntactic variables ("history", etc).
4 Use Texinfo-recommended form of quote+punctuation. 16 Use Texinfo-recommended form of quote+punctuation.
5 (Intro to Minibuffers): First minibuffer is #1, not #0. 17 (Intro to Minibuffers): First minibuffer is #1, not #0.
diff --git a/doc/lispref/elisp.texi b/doc/lispref/elisp.texi
index 76397556b01..fd20bed16ae 100644
--- a/doc/lispref/elisp.texi
+++ b/doc/lispref/elisp.texi
@@ -637,8 +637,8 @@ Minibuffers
637* Multiple Queries:: Asking a series of similar questions. 637* Multiple Queries:: Asking a series of similar questions.
638* Reading a Password:: Reading a password from the terminal. 638* Reading a Password:: Reading a password from the terminal.
639* Minibuffer Commands:: Commands used as key bindings in minibuffers. 639* Minibuffer Commands:: Commands used as key bindings in minibuffers.
640* Minibuffer Contents:: How such commands access the minibuffer text.
641* Minibuffer Windows:: Operating on the special minibuffer windows. 640* Minibuffer Windows:: Operating on the special minibuffer windows.
641* Minibuffer Contents:: How such commands access the minibuffer text.
642* Recursive Mini:: Whether recursive entry to minibuffer is allowed. 642* Recursive Mini:: Whether recursive entry to minibuffer is allowed.
643* Minibuffer Misc:: Various customization hooks and variables. 643* Minibuffer Misc:: Various customization hooks and variables.
644 644
diff --git a/doc/lispref/minibuf.texi b/doc/lispref/minibuf.texi
index f4cc156e284..c856f0f6663 100644
--- a/doc/lispref/minibuf.texi
+++ b/doc/lispref/minibuf.texi
@@ -30,8 +30,8 @@ argument.
30* Multiple Queries:: Asking a series of similar questions. 30* Multiple Queries:: Asking a series of similar questions.
31* Reading a Password:: Reading a password from the terminal. 31* Reading a Password:: Reading a password from the terminal.
32* Minibuffer Commands:: Commands used as key bindings in minibuffers. 32* Minibuffer Commands:: Commands used as key bindings in minibuffers.
33* Minibuffer Contents:: How such commands access the minibuffer text.
34* Minibuffer Windows:: Operating on the special minibuffer windows. 33* Minibuffer Windows:: Operating on the special minibuffer windows.
34* Minibuffer Contents:: How such commands access the minibuffer text.
35* Recursive Mini:: Whether recursive entry to minibuffer is allowed. 35* Recursive Mini:: Whether recursive entry to minibuffer is allowed.
36* Minibuffer Misc:: Various customization hooks and variables. 36* Minibuffer Misc:: Various customization hooks and variables.
37@end menu 37@end menu
@@ -93,8 +93,6 @@ to be done. @xref{Text from Minibuffer}, for the non-completion
93minibuffer local maps. @xref{Completion Commands}, for the minibuffer 93minibuffer local maps. @xref{Completion Commands}, for the minibuffer
94local maps for completion. 94local maps for completion.
95 95
96@findex minibuffer-inactive-mode
97@vindex minibuffer-inactive-mode-map
98@cindex inactive minibuffer 96@cindex inactive minibuffer
99 When a minibuffer is inactive, its major mode is 97 When a minibuffer is inactive, its major mode is
100@code{minibuffer-inactive-mode}, with keymap 98@code{minibuffer-inactive-mode}, with keymap
@@ -408,23 +406,16 @@ This function simply evaluates the result of a call to
408@end defun 406@end defun
409 407
410@defun edit-and-eval-command prompt form 408@defun edit-and-eval-command prompt form
411This function reads a Lisp expression in the minibuffer, and then 409This function reads a Lisp expression in the minibuffer, evaluates it,
412evaluates it. The difference between this command and 410then returns the result. The difference between this command and
413@code{eval-minibuffer} is that here the initial @var{form} is not 411@code{eval-minibuffer} is that here the initial @var{form} is not
414optional and it is treated as a Lisp object to be converted to printed 412optional and it is treated as a Lisp object to be converted to printed
415representation rather than as a string of text. It is printed with 413representation rather than as a string of text. It is printed with
416@code{prin1}, so if it is a string, double-quote characters (@samp{"}) 414@code{prin1}, so if it is a string, double-quote characters (@samp{"})
417appear in the initial text. @xref{Output Functions}. 415appear in the initial text. @xref{Output Functions}.
418 416
419The first thing @code{edit-and-eval-command} does is to activate the
420minibuffer with @var{prompt} as the prompt. Then it inserts the printed
421representation of @var{form} in the minibuffer, and lets the user edit it.
422When the user exits the minibuffer, the edited text is read with
423@code{read} and then evaluated. The resulting value becomes the value
424of @code{edit-and-eval-command}.
425
426In the following example, we offer the user an expression with initial 417In the following example, we offer the user an expression with initial
427text which is a valid form already: 418text that is already a valid form:
428 419
429@smallexample 420@smallexample
430@group 421@group
@@ -444,7 +435,6 @@ Please edit: (forward-word 1)@point{}
444@noindent 435@noindent
445Typing @key{RET} right away would exit the minibuffer and evaluate the 436Typing @key{RET} right away would exit the minibuffer and evaluate the
446expression, thus moving point forward one word. 437expression, thus moving point forward one word.
447@code{edit-and-eval-command} returns @code{nil} in this example.
448@end defun 438@end defun
449 439
450@node Minibuffer History 440@node Minibuffer History
@@ -523,15 +513,15 @@ If the value of this variable is @code{nil}, standard functions that
523read from the minibuffer don't add new elements to the history list. 513read from the minibuffer don't add new elements to the history list.
524This lets Lisp programs explicitly manage input history by using 514This lets Lisp programs explicitly manage input history by using
525@code{add-to-history}. By default, @code{history-add-new-input} is 515@code{add-to-history}. By default, @code{history-add-new-input} is
526set to a non-@code{nil} value. 516non-@code{nil}.
527@end defvar 517@end defvar
528 518
529@defopt history-length 519@defopt history-length
530The value of this variable specifies the maximum length for all 520The value of this variable specifies the maximum length for all
531history lists that don't specify their own maximum lengths. If the 521history lists that don't specify their own maximum lengths. If the
532value is @code{t}, that means there is no maximum (don't delete old 522value is @code{t}, that means there is no maximum (don't delete old
533elements). The value of @code{history-length} property of the history 523elements). If a history list variable's symbol has a non-@code{nil}
534list variable's symbol, if set, overrides this variable for that 524@code{history-length} property, it overrides this variable for that
535particular history list. 525particular history list.
536@end defopt 526@end defopt
537 527
@@ -575,6 +565,14 @@ A history list for arguments that are shell commands.
575A history list for arguments that are Lisp expressions to evaluate. 565A history list for arguments that are Lisp expressions to evaluate.
576@end defvar 566@end defvar
577 567
568@defvar face-name-history
569A history list for arguments that are faces.
570@end defvar
571
572@c Less common: coding-system-history, input-method-history,
573@c command-history, grep-history, grep-find-history,
574@c read-envvar-name-history, setenv-history, yes-or-no-p-history.
575
578@node Initial Input 576@node Initial Input
579@section Initial Input 577@section Initial Input
580 578
@@ -608,11 +606,10 @@ inconsistently in different functions. In @code{completing-read},
608of 0 means the beginning of the string, 1 means after the first 606of 0 means the beginning of the string, 1 means after the first
609character, etc. In @code{read-minibuffer}, and the other 607character, etc. In @code{read-minibuffer}, and the other
610non-completion minibuffer input functions that support this argument, 608non-completion minibuffer input functions that support this argument,
6111 means the beginning of the string 2 means after the first character, 6091 means the beginning of the string, 2 means after the first character,
612etc. 610etc.
613 611
614Use of a cons cell as the value for @var{initial} arguments is 612Use of a cons cell as the value for @var{initial} arguments is deprecated.
615deprecated in user code.
616 613
617@node Completion 614@node Completion
618@section Completion 615@section Completion
@@ -1900,7 +1897,7 @@ answer.
1900using the mouse---more precisely, if @code{last-nonmenu-event} 1897using the mouse---more precisely, if @code{last-nonmenu-event}
1901(@pxref{Command Loop Info}) is either @code{nil} or a list---then it 1898(@pxref{Command Loop Info}) is either @code{nil} or a list---then it
1902uses a dialog box or pop-up menu to ask the question. Otherwise, it 1899uses a dialog box or pop-up menu to ask the question. Otherwise, it
1903uses keyboard input. You can force use of the mouse or use of keyboard 1900uses keyboard input. You can force use either of the mouse or of keyboard
1904input by binding @code{last-nonmenu-event} to a suitable value around 1901input by binding @code{last-nonmenu-event} to a suitable value around
1905the call. 1902the call.
1906 1903
@@ -1935,12 +1932,16 @@ hardwired. The keymap @code{query-replace-map} specifies them.
1935In the following example, the user first types @kbd{q}, which is 1932In the following example, the user first types @kbd{q}, which is
1936invalid. At the next prompt the user types @kbd{y}. 1933invalid. At the next prompt the user types @kbd{y}.
1937 1934
1935@c Need an interactive example, because otherwise the return value
1936@c obscures the display of the valid answer.
1938@smallexample 1937@smallexample
1939@group 1938@group
1940(y-or-n-p "Do you need a lift? ") 1939(defun ask ()
1940 (interactive)
1941 (y-or-n-p "Do you need a lift? "))
1941 1942
1942;; @r{After evaluation of the preceding expression,} 1943;; @r{After evaluation of the preceding definition, @kbd{M-x ask}}
1943;; @r{the following prompt appears in the echo area:} 1944;; @r{causes the following prompt to appear in the echo area:}
1944@end group 1945@end group
1945 1946
1946@group 1947@group
@@ -2043,7 +2044,7 @@ single-character answer in the echo area for each one.
2043The value of @var{list} specifies the objects to ask questions about. 2044The value of @var{list} specifies the objects to ask questions about.
2044It should be either a list of objects or a generator function. If it is 2045It should be either a list of objects or a generator function. If it is
2045a function, it should expect no arguments, and should return either the 2046a function, it should expect no arguments, and should return either the
2046next object to ask about, or @code{nil} meaning stop asking questions. 2047next object to ask about, or @code{nil}, meaning to stop asking questions.
2047 2048
2048The argument @var{prompter} specifies how to ask each question. If 2049The argument @var{prompter} specifies how to ask each question. If
2049@var{prompter} is a string, the question text is computed like this: 2050@var{prompter} is a string, the question text is computed like this:
@@ -2059,8 +2060,8 @@ where @var{object} is the next object to ask about (as obtained from
2059If not a string, @var{prompter} should be a function of one argument 2060If not a string, @var{prompter} should be a function of one argument
2060(the next object to ask about) and should return the question text. If 2061(the next object to ask about) and should return the question text. If
2061the value is a string, that is the question to ask the user. The 2062the value is a string, that is the question to ask the user. The
2062function can also return @code{t} meaning do act on this object (and 2063function can also return @code{t}, meaning do act on this object (and
2063don't ask the user), or @code{nil} meaning ignore this object (and don't 2064don't ask the user), or @code{nil}, meaning ignore this object (and don't
2064ask the user). 2065ask the user).
2065 2066
2066The argument @var{actor} says how to act on the answers that the user 2067The argument @var{actor} says how to act on the answers that the user
@@ -2113,12 +2114,14 @@ If @code{map-y-or-n-p} is called in a command that was invoked using the
2113mouse---more precisely, if @code{last-nonmenu-event} (@pxref{Command 2114mouse---more precisely, if @code{last-nonmenu-event} (@pxref{Command
2114Loop Info}) is either @code{nil} or a list---then it uses a dialog box 2115Loop Info}) is either @code{nil} or a list---then it uses a dialog box
2115or pop-up menu to ask the question. In this case, it does not use 2116or pop-up menu to ask the question. In this case, it does not use
2116keyboard input or the echo area. You can force use of the mouse or use 2117keyboard input or the echo area. You can force use either of the mouse or
2117of keyboard input by binding @code{last-nonmenu-event} to a suitable 2118of keyboard input by binding @code{last-nonmenu-event} to a suitable
2118value around the call. 2119value around the call.
2119 2120
2120The return value of @code{map-y-or-n-p} is the number of objects acted on. 2121The return value of @code{map-y-or-n-p} is the number of objects acted on.
2121@end defun 2122@end defun
2123@c FIXME An example of this would be more useful than all the
2124@c preceding examples of simple things.
2122 2125
2123@node Reading a Password 2126@node Reading a Password
2124@section Reading a Password 2127@section Reading a Password
@@ -2181,6 +2184,19 @@ This command replaces the minibuffer contents with the value of the
2181regular expression). 2184regular expression).
2182@end deffn 2185@end deffn
2183 2186
2187@deffn Command previous-complete-history-element n
2188This command replaces the minibuffer contents with the value of the
2189@var{n}th previous (older) history element that completes the current
2190contents of the minibuffer before the point.
2191@end deffn
2192
2193@deffn Command next-complete-history-element n
2194This command replaces the minibuffer contents with the value of the
2195@var{n}th next (newer) history element that completes the current
2196contents of the minibuffer before the point.
2197@end deffn
2198
2199
2184@node Minibuffer Windows 2200@node Minibuffer Windows
2185@section Minibuffer Windows 2201@section Minibuffer Windows
2186@cindex minibuffer windows 2202@cindex minibuffer windows
@@ -2190,7 +2206,7 @@ and test whether they are active.
2190 2206
2191@defun active-minibuffer-window 2207@defun active-minibuffer-window
2192This function returns the currently active minibuffer window, or 2208This function returns the currently active minibuffer window, or
2193@code{nil} if none is currently active. 2209@code{nil} if there is none.
2194@end defun 2210@end defun
2195 2211
2196@defun minibuffer-window &optional frame 2212@defun minibuffer-window &optional frame
@@ -2223,8 +2239,8 @@ there can be more than one minibuffer window if there is more than one
2223frame. 2239frame.
2224 2240
2225@defun minibuffer-window-active-p window 2241@defun minibuffer-window-active-p window
2226This function returns non-@code{nil} if @var{window}, assumed to be 2242This function returns non-@code{nil} if @var{window} is the currently
2227a minibuffer window, is currently active. 2243active minibuffer window.
2228@end defun 2244@end defun
2229 2245
2230@node Minibuffer Contents 2246@node Minibuffer Contents
@@ -2339,7 +2355,7 @@ minibuffer, it scrolls this window.
2339@end defvar 2355@end defvar
2340 2356
2341@defun minibuffer-selected-window 2357@defun minibuffer-selected-window
2342This function returns the window which was selected when the 2358This function returns the window that was selected when the
2343minibuffer was entered. If selected window is not a minibuffer 2359minibuffer was entered. If selected window is not a minibuffer
2344window, it returns @code{nil}. 2360window, it returns @code{nil}.
2345@end defun 2361@end defun
@@ -2350,10 +2366,19 @@ windows. If a float, it specifies a fraction of the height of the
2350frame. If an integer, it specifies a number of lines. 2366frame. If an integer, it specifies a number of lines.
2351@end defopt 2367@end defopt
2352 2368
2369@vindex minibuffer-message-timeout
2353@defun minibuffer-message string &rest args 2370@defun minibuffer-message string &rest args
2354This function displays @var{string} temporarily at the end of the 2371This function displays @var{string} temporarily at the end of the
2355minibuffer text, for two seconds, or until the next input event 2372minibuffer text, for a few seconds, or until the next input event
2356arrives, whichever comes first. If @var{args} is non-@code{nil}, the 2373arrives, whichever comes first. The variable
2357actual message is obtained by passing @var{string} and @var{args} 2374@code{minibuffer-message-timeout} specifies the number of seconds to
2358through @code{format}. @xref{Formatting Strings}. 2375wait in the absence of input. It defaults to 2. If @var{args} is
2376non-@code{nil}, the actual message is obtained by passing @var{string}
2377and @var{args} through @code{format}. @xref{Formatting Strings}.
2359@end defun 2378@end defun
2379
2380@deffn Command minibuffer-inactive-mode
2381This is the major mode used in inactive minibuffers. It uses
2382keymap @code{minibuffer-inactive-mode-map}. This can be useful
2383if the minibuffer is in a separate frame. @xref{Minibuffers and Frames}.
2384@end deffn
diff --git a/doc/lispref/vol1.texi b/doc/lispref/vol1.texi
index 45a0dee3b1c..c16947692e4 100644
--- a/doc/lispref/vol1.texi
+++ b/doc/lispref/vol1.texi
@@ -658,8 +658,8 @@ Minibuffers
658* Multiple Queries:: Asking a series of similar questions. 658* Multiple Queries:: Asking a series of similar questions.
659* Reading a Password:: Reading a password from the terminal. 659* Reading a Password:: Reading a password from the terminal.
660* Minibuffer Commands:: Commands used as key bindings in minibuffers. 660* Minibuffer Commands:: Commands used as key bindings in minibuffers.
661* Minibuffer Contents:: How such commands access the minibuffer text.
662* Minibuffer Windows:: Operating on the special minibuffer windows. 661* Minibuffer Windows:: Operating on the special minibuffer windows.
662* Minibuffer Contents:: How such commands access the minibuffer text.
663* Recursive Mini:: Whether recursive entry to minibuffer is allowed. 663* Recursive Mini:: Whether recursive entry to minibuffer is allowed.
664* Minibuffer Misc:: Various customization hooks and variables. 664* Minibuffer Misc:: Various customization hooks and variables.
665 665
diff --git a/doc/lispref/vol2.texi b/doc/lispref/vol2.texi
index 01a3e3c129e..b7dc8366f97 100644
--- a/doc/lispref/vol2.texi
+++ b/doc/lispref/vol2.texi
@@ -657,8 +657,8 @@ Minibuffers
657* Multiple Queries:: Asking a series of similar questions. 657* Multiple Queries:: Asking a series of similar questions.
658* Reading a Password:: Reading a password from the terminal. 658* Reading a Password:: Reading a password from the terminal.
659* Minibuffer Commands:: Commands used as key bindings in minibuffers. 659* Minibuffer Commands:: Commands used as key bindings in minibuffers.
660* Minibuffer Contents:: How such commands access the minibuffer text.
661* Minibuffer Windows:: Operating on the special minibuffer windows. 660* Minibuffer Windows:: Operating on the special minibuffer windows.
661* Minibuffer Contents:: How such commands access the minibuffer text.
662* Recursive Mini:: Whether recursive entry to minibuffer is allowed. 662* Recursive Mini:: Whether recursive entry to minibuffer is allowed.
663* Minibuffer Misc:: Various customization hooks and variables. 663* Minibuffer Misc:: Various customization hooks and variables.
664 664
diff --git a/lisp/subr.el b/lisp/subr.el
index 87b98988525..3b120e6ff6a 100644
--- a/lisp/subr.el
+++ b/lisp/subr.el
@@ -2335,6 +2335,8 @@ is nil and `use-dialog-box' is non-nil."
2335 (discard-input)))) 2335 (discard-input))))
2336 (let ((ret (eq answer 'act))) 2336 (let ((ret (eq answer 'act)))
2337 (unless noninteractive 2337 (unless noninteractive
2338 ;; FIXME this prints one too many spaces, since prompt
2339 ;; already ends in a space. Eg "... (y or n) y".
2338 (message "%s %s" prompt (if ret "y" "n"))) 2340 (message "%s %s" prompt (if ret "y" "n")))
2339 ret))) 2341 ret)))
2340 2342