1 |
/* Minibuffer input and completion. |
/* Minibuffer input and completion. |
2 |
Copyright (C) 1985,86,93,94,95,96,97,98,99,2000,01,03 |
Copyright (C) 1985,86,93,94,95,96,97,98,99,2000,01,03,04 |
3 |
Free Software Foundation, Inc. |
Free Software Foundation, Inc. |
4 |
|
|
5 |
This file is part of GNU Emacs. |
This file is part of GNU Emacs. |
209 |
/* Actual minibuffer invocation. */ |
/* Actual minibuffer invocation. */ |
210 |
|
|
211 |
static Lisp_Object read_minibuf_unwind P_ ((Lisp_Object)); |
static Lisp_Object read_minibuf_unwind P_ ((Lisp_Object)); |
212 |
|
static Lisp_Object run_exit_minibuf_hook P_ ((Lisp_Object)); |
213 |
static Lisp_Object read_minibuf P_ ((Lisp_Object, Lisp_Object, |
static Lisp_Object read_minibuf P_ ((Lisp_Object, Lisp_Object, |
214 |
Lisp_Object, Lisp_Object, |
Lisp_Object, Lisp_Object, |
215 |
int, Lisp_Object, |
int, Lisp_Object, |
564 |
|
|
565 |
record_unwind_protect (read_minibuf_unwind, Qnil); |
record_unwind_protect (read_minibuf_unwind, Qnil); |
566 |
minibuf_level++; |
minibuf_level++; |
567 |
|
/* We are exiting the minibuffer one way or the other, so run the hook. |
568 |
|
It should be run before unwinding the minibuf settings. Do it |
569 |
|
separately from read_minibuf_unwind because we need to make sure that |
570 |
|
read_minibuf_unwind is fully executed even if exit-minibuffer-hook |
571 |
|
signals an error. --Stef */ |
572 |
|
record_unwind_protect (run_exit_minibuf_hook, Qnil); |
573 |
|
|
574 |
/* Now that we can restore all those variables, start changing them. */ |
/* Now that we can restore all those variables, start changing them. */ |
575 |
|
|
829 |
return buf; |
return buf; |
830 |
} |
} |
831 |
|
|
832 |
|
static Lisp_Object |
833 |
|
run_exit_minibuf_hook (data) |
834 |
|
Lisp_Object data; |
835 |
|
{ |
836 |
|
if (!NILP (Vminibuffer_exit_hook) && !EQ (Vminibuffer_exit_hook, Qunbound) |
837 |
|
&& !NILP (Vrun_hooks)) |
838 |
|
safe_run_hooks (Qminibuffer_exit_hook); |
839 |
|
|
840 |
|
return Qnil; |
841 |
|
} |
842 |
|
|
843 |
/* This function is called on exiting minibuffer, whether normally or |
/* This function is called on exiting minibuffer, whether normally or |
844 |
not, and it restores the current window, buffer, etc. */ |
not, and it restores the current window, buffer, etc. */ |
845 |
|
|
850 |
Lisp_Object old_deactivate_mark; |
Lisp_Object old_deactivate_mark; |
851 |
Lisp_Object window; |
Lisp_Object window; |
852 |
|
|
|
/* We are exiting the minibuffer one way or the other, |
|
|
so run the hook. */ |
|
|
if (!NILP (Vminibuffer_exit_hook) && !EQ (Vminibuffer_exit_hook, Qunbound) |
|
|
&& !NILP (Vrun_hooks)) |
|
|
safe_run_hooks (Qminibuffer_exit_hook); |
|
|
|
|
853 |
/* If this was a recursive minibuffer, |
/* If this was a recursive minibuffer, |
854 |
tie the minibuffer window back to the outer level minibuffer buffer. */ |
tie the minibuffer window back to the outer level minibuffer buffer. */ |
855 |
minibuf_level--; |
minibuf_level--; |