[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: master 629f980fad: Enhance safe_run_hooks_1 and safe_run_hook_funcal
From: |
Stefan Monnier |
Subject: |
Re: master 629f980fad: Enhance safe_run_hooks_1 and safe_run_hook_funcall to handle more arguments |
Date: |
Mon, 15 Aug 2022 10:28:56 -0400 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux) |
> static Lisp_Object
> safe_run_hooks_1 (ptrdiff_t nargs, Lisp_Object *args)
> {
> - eassert (nargs == 2);
> - return call0 (args[1]);
> + eassert (nargs >= 2 && nargs <= 4);
> + switch (nargs)
> + {
> + case 2:
> + return call0 (args[1]);
> + case 3:
> + return call1 (args[1], args[2]);
> + default:
> + return call2 (args[1], args[2], args[3]);
> + }
> }
Can't we do something like
return Ffuncall (nargs - 1, args + 1);
?
Stefan
- Re: master 629f980fad: Enhance safe_run_hooks_1 and safe_run_hook_funcall to handle more arguments,
Stefan Monnier <=