Fix typos in comments.
[bpt/emacs.git] / src / minibuf.c
index ed892e9..06e2fc5 100644 (file)
@@ -1,7 +1,7 @@
 /* Minibuffer input and completion.
    Copyright (C) 1985, 1986, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
                  2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007,
-                 2008  Free Software Foundation, Inc.
+                 2008, 2009  Free Software Foundation, Inc.
 
 This file is part of GNU Emacs.
 
@@ -21,6 +21,7 @@ along with GNU Emacs.  If not, see <http://www.gnu.org/licenses/>.  */
 
 #include <config.h>
 #include <stdio.h>
+#include <setjmp.h>
 
 #include "lisp.h"
 #include "commands.h"
@@ -525,7 +526,11 @@ read_minibuf (map, initial, prompt, backup_n, expflag,
                build_string ("Command attempted to use minibuffer while in minibuffer"));
     }
 
-  if (noninteractive && NILP (Vexecuting_kbd_macro))
+  if ((noninteractive
+       /* In case we are running as a daemon, only do this before
+         detaching from the terminal.  */
+       || (IS_DAEMON && (daemon_pipe[1] >= 0)))
+      && NILP (Vexecuting_kbd_macro))
     {
       val = read_minibuf_noninteractive (map, initial, prompt,
                                         make_number (pos),
@@ -1177,8 +1182,9 @@ DEFUN ("read-buffer", Fread_buffer, Sread_buffer, 1, 3, 0,
 Prompt with PROMPT.
 Optional second arg DEF is value to return if user enters an empty line.
  If DEF is a list of default values, return its first element.
-If optional third arg REQUIRE-MATCH is non-nil,
- only existing buffer names are allowed.
+Optional third arg REQUIRE-MATCH determines whether non-existing
+ buffer names are allowed.  It has the same meaning as the
+ REQUIRE-MATCH argument of `confirm-after-completion'.
 The argument PROMPT should be a string ending with a colon and a space.
 If `read-buffer-completion-ignore-case' is non-nil, completion ignores
 case while reading the buffer name.
@@ -1555,9 +1561,9 @@ predicate is called with two arguments: the key and the value.
 Additionally to this predicate, `completion-regexp-list'
 is used to further constrain the set of candidates.
 
-If the optional fourth argument HIDE-SPACES is non-nil,
-strings in COLLECTION that start with a space
-are ignored unless STRING itself starts with a space.  */)
+An osbolete optional fourth argument HIDE-SPACES is still accepted for
+backward compatibility.  If non-nil, strings in COLLECTION that start
+with a space are ignored unless STRING itself starts with a space.  */)
      (string, collection, predicate, hide_spaces)
      Lisp_Object string, collection, predicate, hide_spaces;
 {
@@ -2197,8 +2203,8 @@ If the value is `confirm', the user may exit with an input that is not
  a valid completion alternative, but Emacs asks for confirmation.
 If the value is `confirm-after-completion', the user may exit with an
  input that is not a valid completion alternative, but Emacs asks for
- confirmation if the user submitted the input right after
`minibuffer-complete'.  */);
+ confirmation if the user submitted the input right after any of the
completion commands listed in `minibuffer-confirm-exit-commands'.  */);
   Vminibuffer_completion_confirm = Qnil;
 
   DEFVAR_LISP ("minibuffer-completing-file-name",