/[emacs]/emacs/lispref/minibuf.texi
ViewVC logotype

Diff of /emacs/lispref/minibuf.texi

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.29 by pj, Sun Mar 31 16:40:15 2002 UTC revision 1.29.2.1 by miles, Fri Apr 4 06:20:42 2003 UTC
# Line 1  Line 1 
1  @c -*-texinfo-*-  @c -*-texinfo-*-
2  @c This is part of the GNU Emacs Lisp Reference Manual.  @c This is part of the GNU Emacs Lisp Reference Manual.
3  @c Copyright (C) 1990, 1991, 1992, 1993, 1994, 1995, 1998, 1999, 2001  @c Copyright (C) 1990, 1991, 1992, 1993, 1994, 1995, 1998, 1999, 2001
4  @c   Free Software Foundation, Inc.  @c   Free Software Foundation, Inc.
5  @c See the file elisp.texi for copying conditions.  @c See the file elisp.texi for copying conditions.
6  @setfilename ../info/minibuf  @setfilename ../info/minibuf
7  @node Minibuffers, Command Loop, Read and Print, Top  @node Minibuffers, Command Loop, Read and Print, Top
# Line 37  for reading an argument. Line 37  for reading an argument.
37  @emph{within} a buffer, such as editing commands, work normally in a  @emph{within} a buffer, such as editing commands, work normally in a
38  minibuffer.  However, many operations for managing buffers do not apply  minibuffer.  However, many operations for managing buffers do not apply
39  to minibuffers.  The name of a minibuffer always has the form @w{@samp{  to minibuffers.  The name of a minibuffer always has the form @w{@samp{
40  *Minibuf-@var{number}}}, and it cannot be changed.  Minibuffers are  *Minibuf-@var{number}*}}, and it cannot be changed.  Minibuffers are
41  displayed only in special windows used only for minibuffers; these  displayed only in special windows used only for minibuffers; these
42  windows always appear at the bottom of a frame.  (Sometimes frames have  windows always appear at the bottom of a frame.  (Sometimes frames have
43  no minibuffer window, and sometimes a special kind of frame contains  no minibuffer window, and sometimes a special kind of frame contains
# Line 374  text which is a valid form already: Line 374  text which is a valid form already:
374  @group  @group
375  (edit-and-eval-command "Please edit: " '(forward-word 1))  (edit-and-eval-command "Please edit: " '(forward-word 1))
376    
377  ;; @r{After evaluation of the preceding expression,}  ;; @r{After evaluation of the preceding expression,}
378  ;;   @r{the following appears in the minibuffer:}  ;;   @r{the following appears in the minibuffer:}
379  @end group  @end group
380    
# Line 435  needs to do to use a history list is to Line 435  needs to do to use a history list is to
435  name to the input functions when you wish.  But it is safe to modify the  name to the input functions when you wish.  But it is safe to modify the
436  list by hand when the minibuffer input functions are not using it.  list by hand when the minibuffer input functions are not using it.
437    
438      Emacs functions that add a new element to a history list can also
439    delete old elements if the list gets too long.  The variable
440    @code{history-length} specifies the maximum length for most history
441    lists.  To specify a different maximum length for a particular history
442    list, put the length in the @code{history-length} property of the
443    history list symbol.
444    
445    @defvar history-length
446    The value of this variable specifies the maximum length for all
447    history lists that don't specify their own maximum lengths.  If the
448    value is @code{t}, that means there no maximum (don't delete old
449    elements).
450    @end defvar
451    
452    Here are some of the standard minibuffer history list variables:    Here are some of the standard minibuffer history list variables:
453    
454  @defvar minibuffer-history  @defvar minibuffer-history
# Line 568  is @code{t}. Line 582  is @code{t}.
582    
583  @smallexample  @smallexample
584  @group  @group
585  (try-completion  (try-completion
586   "foo"   "foo"
587   '(("foobar1" 1) ("barfoo" 2) ("foobaz" 3) ("foobar2" 4)))   '(("foobar1" 1) ("barfoo" 2) ("foobaz" 3) ("foobar2" 4)))
588       @result{} "fooba"       @result{} "fooba"
# Line 598  too short).  Both of those begin with th Line 612  too short).  Both of those begin with th
612    
613  @smallexample  @smallexample
614  @group  @group
615  (defun test (s)  (defun test (s)
616    (> (length (car s)) 6))    (> (length (car s)) 6))
617       @result{} test       @result{} test
618  @end group  @end group
619  @group  @group
620  (try-completion  (try-completion
621   "foo"   "foo"
622   '(("foobar1" 1) ("barfoo" 2) ("foobaz" 3) ("foobar2" 4))   '(("foobar1" 1) ("barfoo" 2) ("foobaz" 3) ("foobar2" 4))
623   'test)   'test)
624       @result{} "foobar"       @result{} "foobar"
625  @end group  @end group
# Line 628  example for @code{try-completion}: Line 642  example for @code{try-completion}:
642    
643  @smallexample  @smallexample
644  @group  @group
645  (defun test (s)  (defun test (s)
646    (> (length (car s)) 6))    (> (length (car s)) 6))
647       @result{} test       @result{} test
648  @end group  @end group
649    
650  @group  @group
651  (all-completions    (all-completions
652   "foo"   "foo"
653   '(("foobar1" 1) ("barfoo" 2) ("foobaz" 3) ("foobar2" 4))   '(("foobar1" 1) ("barfoo" 2) ("foobaz" 3) ("foobar2" 4))
654   'test)   'test)
# Line 644  example for @code{try-completion}: Line 658  example for @code{try-completion}:
658  @end defun  @end defun
659    
660  @defvar completion-ignore-case  @defvar completion-ignore-case
661  If the value of this variable is  If the value of this variable is
662  non-@code{nil}, Emacs does not consider case significant in completion.  non-@code{nil}, Emacs does not consider case significant in completion.
663  @end defvar  @end defvar
664    
# Line 724  Here's an example of using @code{complet Line 738  Here's an example of using @code{complet
738  @end group  @end group
739    
740  @group  @group
741  ;; @r{After evaluation of the preceding expression,}  ;; @r{After evaluation of the preceding expression,}
742  ;;   @r{the following appears in the minibuffer:}  ;;   @r{the following appears in the minibuffer:}
743    
744  ---------- Buffer: Minibuffer ----------  ---------- Buffer: Minibuffer ----------
# Line 909  only buffer name starting with the given Line 923  only buffer name starting with the given
923  @example  @example
924  (read-buffer "Buffer name? " "foo" t)  (read-buffer "Buffer name? " "foo" t)
925  @group  @group
926  ;; @r{After evaluation of the preceding expression,}  ;; @r{After evaluation of the preceding expression,}
927  ;;   @r{the following prompt appears,}  ;;   @r{the following prompt appears,}
928  ;;   @r{with an empty minibuffer:}  ;;   @r{with an empty minibuffer:}
929  @end group  @end group
# Line 951  enters null input, the return value is @ Line 965  enters null input, the return value is @
965  (read-command "Command name? ")  (read-command "Command name? ")
966    
967  @group  @group
968  ;; @r{After evaluation of the preceding expression,}  ;; @r{After evaluation of the preceding expression,}
969  ;;   @r{the following prompt appears with an empty minibuffer:}  ;;   @r{the following prompt appears with an empty minibuffer:}
970  @end group  @end group
971    
972  @group  @group
973  ---------- Buffer: Minibuffer ----------  ---------- Buffer: Minibuffer ----------
974  Command name?    Command name?
975  ---------- Buffer: Minibuffer ----------  ---------- Buffer: Minibuffer ----------
976  @end group  @end group
977  @end example  @end example
# Line 976  complete in the set of extant Lisp symbo Line 990  complete in the set of extant Lisp symbo
990  @group  @group
991  (read-command @var{prompt})  (read-command @var{prompt})
992  @equiv{}  @equiv{}
993  (intern (completing-read @var{prompt} obarray  (intern (completing-read @var{prompt} obarray
994                           'commandp t nil))                           'commandp t nil))
995  @end group  @end group
996  @end example  @end example
# Line 996  user enters null input, the return value Line 1010  user enters null input, the return value
1010  @group  @group
1011  (read-variable "Variable name? ")  (read-variable "Variable name? ")
1012    
1013  ;; @r{After evaluation of the preceding expression,}  ;; @r{After evaluation of the preceding expression,}
1014  ;;   @r{the following prompt appears,}  ;;   @r{the following prompt appears,}
1015  ;;   @r{with an empty minibuffer:}  ;;   @r{with an empty minibuffer:}
1016  @end group  @end group
1017    
# Line 1066  case, point goes at the beginning of @va Line 1080  case, point goes at the beginning of @va
1080  @var{initial} does, try the command @kbd{C-x C-v}.  @strong{Note:} we  @var{initial} does, try the command @kbd{C-x C-v}.  @strong{Note:} we
1081  recommend using @var{default} rather than @var{initial} in most cases.  recommend using @var{default} rather than @var{initial} in most cases.
1082    
1083  Here is an example:  Here is an example:
1084    
1085  @example  @example
1086  @group  @group
1087  (read-file-name "The file is ")  (read-file-name "The file is ")
1088    
1089  ;; @r{After evaluation of the preceding expression,}  ;; @r{After evaluation of the preceding expression,}
1090  ;;   @r{the following appears in the minibuffer:}  ;;   @r{the following appears in the minibuffer:}
1091  @end group  @end group
1092    
# Line 1261  invalid.  At the next prompt the user ty Line 1275  invalid.  At the next prompt the user ty
1275  @group  @group
1276  (y-or-n-p "Do you need a lift? ")  (y-or-n-p "Do you need a lift? ")
1277    
1278  ;; @r{After evaluation of the preceding expression,}  ;; @r{After evaluation of the preceding expression,}
1279  ;;   @r{the following prompt appears in the echo area:}  ;;   @r{the following prompt appears in the echo area:}
1280  @end group  @end group
1281    
1282  @group  @group
1283  ---------- Echo area ----------  ---------- Echo area ----------
1284  Do you need a lift? (y or n)  Do you need a lift? (y or n)
1285  ---------- Echo area ----------  ---------- Echo area ----------
1286  @end group  @end group
1287    
# Line 1275  Do you need a lift? (y or n) Line 1289  Do you need a lift? (y or n)
1289    
1290  @group  @group
1291  ---------- Echo area ----------  ---------- Echo area ----------
1292  Please answer y or n.  Do you need a lift? (y or n)  Please answer y or n.  Do you need a lift? (y or n)
1293  ---------- Echo area ----------  ---------- Echo area ----------
1294  @end group  @end group
1295    
# Line 1321  Here is an example: Line 1335  Here is an example:
1335  @group  @group
1336  (yes-or-no-p "Do you really want to remove everything? ")  (yes-or-no-p "Do you really want to remove everything? ")
1337    
1338  ;; @r{After evaluation of the preceding expression,}  ;; @r{After evaluation of the preceding expression,}
1339  ;;   @r{the following prompt appears,}  ;;   @r{the following prompt appears,}
1340  ;;   @r{with an empty minibuffer:}  ;;   @r{with an empty minibuffer:}
1341  @end group  @end group
1342    
1343  @group  @group
1344  ---------- Buffer: minibuffer ----------  ---------- Buffer: minibuffer ----------
1345  Do you really want to remove everything? (yes or no)  Do you really want to remove everything? (yes or no)
1346  ---------- Buffer: minibuffer ----------  ---------- Buffer: minibuffer ----------
1347  @end group  @end group
1348  @end smallexample  @end smallexample

Legend:
Removed from v.1.29  
changed lines
  Added in v.1.29.2.1

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26