t)
(t t)))))
-(defun completion--flush-all-sorted-completions (&rest ignore)
+(defun completion--flush-all-sorted-completions (&rest _ignore)
+ (remove-hook 'after-change-functions
+ 'completion--flush-all-sorted-completions t)
(setq completion-cycling nil)
(setq completion-all-sorted-completions nil))
DEFUN ("make-byte-code", Fmake_byte_code, Smake_byte_code, 4, MANY, 0,
doc: /* Create a byte-code object with specified arguments as elements.
-The arguments should be the arglist, bytecode-string, constant vector,
-stack size, (optional) doc string, and (optional) interactive spec.
+The arguments should be the ARGLIST, bytecode-string BYTE-CODE, constant
+vector CONSTANTS, maximum stack size DEPTH, (optional) DOCSTRING,
+and (optional) INTERACTIVE-SPEC.
The first four arguments are required; at most six have any
significance.
+The ARGLIST can be either like the one of `lambda', in which case the arguments
+will be dynamically bound before executing the byte code, or it can be an
+integer of the form NNNNNNNRMMMMMMM where the 7bit MMMMMMM specifies the
+minimum number of arguments, the 7-bit NNNNNNN specifies the maximum number
+of arguments (ignoring &rest) and the R bit specifies whether there is a &rest
+argument to catch the left-over arguments. If such an integer is used, the
+arguments will not be dynamically bound but will be instead pushed on the
+stack before executing the byte-code.
usage: (make-byte-code ARGLIST BYTE-CODE CONSTANTS DEPTH &optional DOCSTRING INTERACTIVE-SPEC &rest ELEMENTS) */)
- (register int nargs, Lisp_Object *args)
+ (register size_t nargs, Lisp_Object *args)
{
register Lisp_Object len, val;
- register int i;
+ register size_t i;
register struct Lisp_Vector *p;
XSETFASTINT (len, nargs);
The first argument, BYTESTR, is a string of byte code;
the second, VECTOR, a vector of constants;
the third, MAXDEPTH, the maximum stack depth used in this function.
-If the third argument is incorrect, Emacs may crash. */)
- (Lisp_Object bytestr, Lisp_Object vector, Lisp_Object maxdepth)
+If the third argument is incorrect, Emacs may crash.
+
+If ARGS-TEMPLATE is specified, it is an argument list specification,
+according to which any remaining arguments are pushed on the stack
+before executing BYTESTR.
+
+usage: (byte-code BYTESTR VECTOR MAXDEP &optional ARGS-TEMPLATE &rest ARGS) */)
- (int nargs, Lisp_Object *args)
++ (size_t nargs, Lisp_Object *args)
+{
+ Lisp_Object args_tmpl = nargs >= 4 ? args[3] : Qnil;
+ int pnargs = nargs >= 4 ? nargs - 4 : 0;
+ Lisp_Object *pargs = nargs >= 4 ? args + 4 : 0;
+ return exec_byte_code (args[0], args[1], args[2], args_tmpl, pnargs, pargs);
+}
+
+/* Execute the byte-code in BYTESTR. VECTOR is the constant vector, and
+ MAXDEPTH is the maximum stack depth used (if MAXDEPTH is incorrect,
+ emacs may crash!). If ARGS_TEMPLATE is non-nil, it should be a lisp
+ argument list (including &rest, &optional, etc.), and ARGS, of size
+ NARGS, should be a vector of the actual arguments. The arguments in
+ ARGS are pushed on the stack according to ARGS_TEMPLATE before
+ executing BYTESTR. */
+
+Lisp_Object
+exec_byte_code (Lisp_Object bytestr, Lisp_Object vector, Lisp_Object maxdepth,
+ Lisp_Object args_template, int nargs, Lisp_Object *args)
{
int count = SPECPDL_INDEX ();
#ifdef BYTE_CODE_METER
int handling_signal;
-static Lisp_Object funcall_lambda (Lisp_Object, size_t, Lisp_Object*);
+static Lisp_Object apply_lambda (Lisp_Object fun, Lisp_Object args);
- static Lisp_Object funcall_lambda (Lisp_Object, int, Lisp_Object *);
++static Lisp_Object funcall_lambda (Lisp_Object, size_t, Lisp_Object *);
static void unwind_to_catch (struct catchtag *, Lisp_Object) NO_RETURN;
static int interactive_p (int);
-static Lisp_Object apply_lambda (Lisp_Object, Lisp_Object, int);
\f
void
init_eval_once (void)
usage: (let VARLIST BODY...) */)
(Lisp_Object args)
{
- Lisp_Object *temps, tem;
+ Lisp_Object *temps, tem, lexenv;
register Lisp_Object elt, varlist;
int count = SPECPDL_INDEX ();
- register int argnum;
+ register size_t argnum;
struct gcpro gcpro1, gcpro2;
USE_SAFE_ALLOCA;
}
\f
static Lisp_Object
-apply_lambda (Lisp_Object fun, Lisp_Object args, int eval_flag)
+apply_lambda (Lisp_Object fun, Lisp_Object args)
{
Lisp_Object args_left;
- Lisp_Object numargs;
+ size_t numargs;
register Lisp_Object *arg_vector;
struct gcpro gcpro1, gcpro2, gcpro3;
- register int i;
+ register size_t i;
register Lisp_Object tem;
USE_SAFE_ALLOCA;
GCPRO3 (*arg_vector, args_left, fun);
gcpro1.nvars = 0;
- for (i = 0; i < XINT (numargs);)
+ for (i = 0; i < numargs; )
{
tem = Fcar (args_left), args_left = Fcdr (args_left);
- if (eval_flag) tem = Feval (tem);
+ tem = eval_sub (tem);
arg_vector[i++] = tem;
gcpro1.nvars = i;
}
UNGCPRO;
- if (eval_flag)
- {
- backtrace_list->args = arg_vector;
- backtrace_list->nargs = i;
- }
+ backtrace_list->args = arg_vector;
+ backtrace_list->nargs = i;
backtrace_list->evalargs = 0;
- tem = funcall_lambda (fun, XINT (numargs), arg_vector);
+ tem = funcall_lambda (fun, numargs, arg_vector);
/* Do the debug-on-exit now, while arg_vector still exists. */
if (backtrace_list->debug_on_exit)
FUN must be either a lambda-expression or a compiled-code object. */
static Lisp_Object
- funcall_lambda (Lisp_Object fun, int nargs,
+ funcall_lambda (Lisp_Object fun, size_t nargs,
register Lisp_Object *arg_vector)
{
- Lisp_Object val, syms_left, next;
+ Lisp_Object val, syms_left, next, lexenv;
int count = SPECPDL_INDEX ();
- int i, optional, rest;
+ size_t i;
+ int optional, rest;
if (CONSP (fun))
{
extern void init_lread (void);
extern void syms_of_lread (void);
- /* Defined in eval.c */
+ /* Defined in eval.c. */
extern Lisp_Object Qautoload, Qexit, Qinteractive, Qcommandp, Qdefun, Qmacro;
-extern Lisp_Object Qinhibit_quit;
+extern Lisp_Object Qinhibit_quit, Qclosure;
extern Lisp_Object Vautoload_queue;
extern Lisp_Object Vsignaling_function;
extern int handling_signal;
/* Run temp-buffer-show-hook, with the chosen window selected
and its buffer current. */
-
- if (!NILP (Vrun_hooks)
- && !NILP (Fboundp (Qtemp_buffer_show_hook))
- && !NILP (Fsymbol_value (Qtemp_buffer_show_hook)))
- {
- int count = SPECPDL_INDEX ();
- Lisp_Object prev_window, prev_buffer;
- prev_window = selected_window;
- XSETBUFFER (prev_buffer, old);
-
- /* Select the window that was chosen, for running the hook.
- Note: Both Fselect_window and select_window_norecord may
- set-buffer to the buffer displayed in the window,
- so we need to save the current buffer. --stef */
- record_unwind_protect (Fset_buffer, prev_buffer);
- record_unwind_protect (select_window_norecord, prev_window);
- Fselect_window (window, Qt);
- Fset_buffer (w->buffer);
- call1 (Vrun_hooks, Qtemp_buffer_show_hook);
- unbind_to (count, Qnil);
- }
+ {
+ int count = SPECPDL_INDEX ();
+ Lisp_Object prev_window, prev_buffer;
+ prev_window = selected_window;
+ XSETBUFFER (prev_buffer, old);
+
+ /* Select the window that was chosen, for running the hook.
+ Note: Both Fselect_window and select_window_norecord may
+ set-buffer to the buffer displayed in the window,
+ so we need to save the current buffer. --stef */
+ record_unwind_protect (Fset_buffer, prev_buffer);
+ record_unwind_protect (select_window_norecord, prev_window);
+ Fselect_window (window, Qt);
+ Fset_buffer (w->buffer);
+ Frun_hooks (1, &Qtemp_buffer_show_hook);
+ unbind_to (count, Qnil);
+ }
}
}
+
+DEFUN ("internal-temp-output-buffer-show",
+ Ftemp_output_buffer_show, Stemp_output_buffer_show,
+ 1, 1, 0,
+ doc: /* Internal function for `with-output-to-temp-buffer''. */)
+ (Lisp_Object buf)
+{
+ temp_output_buffer_show (buf);
+ return Qnil;
+}
\f
static void
make_dummy_parent (Lisp_Object window)