/* Minibuffer input and completion.
- Copyright (C) 1985,86,93,94,95,96,97,98,99,2000,01,03,04
+ Copyright (C) 1985,86,93,94,95,96,97,98,99,2000,01,03,04,05
Free Software Foundation, Inc.
This file is part of GNU Emacs.
You should have received a copy of the GNU General Public License
along with GNU Emacs; see the file COPYING. If not, write to
-the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
-Boston, MA 02111-1307, USA. */
+the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+Boston, MA 02110-1301, USA. */
#include <config.h>
DEFUN ("minibuffer-prompt-end", Fminibuffer_prompt_end,
Sminibuffer_prompt_end, 0, 0, 0,
doc: /* Return the buffer position of the end of the minibuffer prompt.
-Return (point-min) if current buffer is not a mini-buffer. */)
+Return (point-min) if current buffer is not a minibuffer. */)
()
{
/* This function is written to be most efficient when there's a prompt. */
Prompt with PROMPT. If non-nil, optional second arg INITIAL-CONTENTS
is a string to insert in the minibuffer before reading.
\(INITIAL-CONTENTS can also be a cons of a string and an integer. Such
-arguments are used as in `read-from-minibuffer') */)
+arguments are used as in `read-from-minibuffer'.) */)
(prompt, initial_contents)
Lisp_Object prompt, initial_contents;
{
|| NILP (alist))
{
tem = Fassoc_string (string, alist, completion_ignore_case ? Qt : Qnil);
- if NILP (tem)
+ if (NILP (tem))
return Qnil;
}
else if (VECTORP (alist))
return make_number (1);
}
+EXFUN (Fexit_minibuffer, 0) NO_RETURN;
+
DEFUN ("minibuffer-complete-and-exit", Fminibuffer_complete_and_exit,
Sminibuffer_complete_and_exit, 0, 0, "",
doc: /* If the minibuffer contents is a valid completion then exit.
return Qnil;
}
exit:
- return Fthrow (Qexit, Qnil);
+ return Fexit_minibuffer ();
/* NOTREACHED */
}
else
bitch_at_user ();
- return Fthrow (Qexit, Qnil);
+ return Fexit_minibuffer ();
}
DEFUN ("exit-minibuffer", Fexit_minibuffer, Sexit_minibuffer, 0, 0, "",
doc: /* Terminate this minibuffer argument. */)
()
{
- return Fthrow (Qexit, Qnil);
+ /* If the command that uses this has made modifications in the minibuffer,
+ we don't want them to cause deactivation of the mark in the original
+ buffer.
+ A better solution would be to make deactivate-mark buffer-local
+ (or to turn it into a list of buffers, ...), but in the mean time,
+ this should do the trick in most cases. */
+ Vdeactivate_mark = Qnil;
+ Fthrow (Qexit, Qnil);
}
DEFUN ("minibuffer-depth", Fminibuffer_depth, Sminibuffer_depth, 0, 0, 0,