The run_hook_with_args_in_buffer patch neglected the nil case.
Ben pointed out a problem with the remove-hook patch.
Since Steven applied the other patches, this one is on top of
those.
1998-06-29 Kyle Jones <kyle_jones(a)wonderworks.com>
* src/eval.c (run_hook_with_args_in_buffer): Check
default (non-buffer-local) value of hook for
nil before treating it as a function. Don't initialize
the `globals' variable twice.
* lisp/subr.el (remove-hook): When checking the hook value
with functionp, don't apply car to it.
--- src/eval.c 1998/06/30 02:49:15
+++ src/eval.c 1998/06/30 15:16:43
@@ -3728,14 +3728,15 @@
it means to run the global binding too. */
Lisp_Object globals = Fdefault_value (sym);
- if (! CONSP (globals) || EQ (XCAR (globals), Qlambda))
+ if ((! CONSP (globals) || EQ (XCAR (globals), Qlambda)) &&
+ ! NILP (globals))
{
args[0] = globals;
ret = Ffuncall (nargs, args);
}
else
{
- for (globals = Fdefault_value (sym);
+ for (;
CONSP (globals) && ((cond == RUN_HOOKS_TO_COMPLETION)
|| (cond == RUN_HOOKS_UNTIL_SUCCESS
? NILP (ret)
--- lisp/subr.el 1998/06/30 15:19:13
+++ lisp/subr.el 1998/06/30 15:25:44
@@ -194,14 +194,14 @@
(and (local-variable-p hook (current-buffer))
(not (memq t (symbol-value hook)))))
(let ((hook-value (symbol-value hook)))
- (if (and (consp hook-value) (not (functionp (car hook-value))))
+ (if (and (consp hook-value) (not (functionp hook-value)))
(if (member function hook-value)
(setq hook-value (delete function (copy-sequence hook-value))))
(if (equal hook-value function)
(setq hook-value nil)))
(set hook hook-value))
(let ((hook-value (default-value hook)))
- (if (and (consp hook-value) (not (functionp (car hook-value))))
+ (if (and (consp hook-value) (not (functionp hook-value)))
(if (member function hook-value)
(setq hook-value (delete function (copy-sequence hook-value))))
(if (equal hook-value function)