aboutsummaryrefslogtreecommitdiffstats
path: root/src/eval.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/eval.c')
-rw-r--r--src/eval.c38
1 files changed, 16 insertions, 22 deletions
diff --git a/src/eval.c b/src/eval.c
index 4748712708f..7e4b016b236 100644
--- a/src/eval.c
+++ b/src/eval.c
@@ -38,22 +38,6 @@ struct handler *handlerlist;
38int gcpro_level; 38int gcpro_level;
39#endif 39#endif
40 40
41Lisp_Object Qautoload, Qmacro, Qexit, Qinteractive, Qcommandp;
42Lisp_Object Qinhibit_quit;
43Lisp_Object Qand_rest;
44static Lisp_Object Qand_optional;
45static Lisp_Object Qinhibit_debugger;
46static Lisp_Object Qdeclare;
47Lisp_Object Qinternal_interpreter_environment, Qclosure;
48
49static Lisp_Object Qdebug;
50
51/* This holds either the symbol `run-hooks' or nil.
52 It is nil at an early stage of startup, and when Emacs
53 is shutting down. */
54
55Lisp_Object Vrun_hooks;
56
57/* Non-nil means record all fset's and provide's, to be undone 41/* Non-nil means record all fset's and provide's, to be undone
58 if the file being autoloaded is not fully loaded. 42 if the file being autoloaded is not fully loaded.
59 They are recorded by being consed onto the front of Vautoload_queue: 43 They are recorded by being consed onto the front of Vautoload_queue:
@@ -61,6 +45,11 @@ Lisp_Object Vrun_hooks;
61 45
62Lisp_Object Vautoload_queue; 46Lisp_Object Vautoload_queue;
63 47
48/* This holds either the symbol `run-hooks' or nil.
49 It is nil at an early stage of startup, and when Emacs
50 is shutting down. */
51Lisp_Object Vrun_hooks;
52
64/* Current number of specbindings allocated in specpdl, not counting 53/* Current number of specbindings allocated in specpdl, not counting
65 the dummy entry specpdl[-1]. */ 54 the dummy entry specpdl[-1]. */
66 55
@@ -2363,14 +2352,10 @@ Instead, use `add-hook' and specify t for the LOCAL argument.
2363usage: (run-hooks &rest HOOKS) */) 2352usage: (run-hooks &rest HOOKS) */)
2364 (ptrdiff_t nargs, Lisp_Object *args) 2353 (ptrdiff_t nargs, Lisp_Object *args)
2365{ 2354{
2366 Lisp_Object hook[1];
2367 ptrdiff_t i; 2355 ptrdiff_t i;
2368 2356
2369 for (i = 0; i < nargs; i++) 2357 for (i = 0; i < nargs; i++)
2370 { 2358 run_hook (args[i]);
2371 hook[0] = args[i];
2372 run_hook_with_args (1, hook, funcall_nil);
2373 }
2374 2359
2375 return Qnil; 2360 return Qnil;
2376} 2361}
@@ -2536,6 +2521,14 @@ run_hook_with_args (ptrdiff_t nargs, Lisp_Object *args,
2536 } 2521 }
2537} 2522}
2538 2523
2524/* Run the hook HOOK, giving each function no args. */
2525
2526void
2527run_hook (Lisp_Object hook)
2528{
2529 Frun_hook_with_args (1, &hook);
2530}
2531
2539/* Run the hook HOOK, giving each function the two args ARG1 and ARG2. */ 2532/* Run the hook HOOK, giving each function the two args ARG1 and ARG2. */
2540 2533
2541void 2534void
@@ -3762,7 +3755,8 @@ alist of active lexical bindings. */);
3762 (Just imagine if someone makes it buffer-local). */ 3755 (Just imagine if someone makes it buffer-local). */
3763 Funintern (Qinternal_interpreter_environment, Qnil); 3756 Funintern (Qinternal_interpreter_environment, Qnil);
3764 3757
3765 DEFSYM (Vrun_hooks, "run-hooks"); 3758 Vrun_hooks = intern_c_string ("run-hooks");
3759 staticpro (&Vrun_hooks);
3766 3760
3767 staticpro (&Vautoload_queue); 3761 staticpro (&Vautoload_queue);
3768 Vautoload_queue = Qnil; 3762 Vautoload_queue = Qnil;