From d032d5e7dfabfae60f3304da02c97cd1e189b9a2 Mon Sep 17 00:00:00 2001 From: Stefan Monnier Date: Tue, 1 Mar 2011 00:03:24 -0500 Subject: * doc/lispref/variables.texi (Scope): Mention the availability of lexbind. (Lexical Binding): New node. * doc/lispref/eval.texi (Eval): Add `eval's new `lexical' arg. * lisp/emacs-lisp/cconv.el (cconv-liftwhen): Increase threshold. (cconv-closure-convert-rec): Convert interactive spec in empty lexenv. (cconv-analyse-use): Improve unused vars warnings. (cconv-analyse-form): Analyze interactive spec in empty lexenv. * lisp/emacs-lisp/bytecomp.el (byte-compile-lambda): Always byte-compile the interactive spec in lexical-binding mode. (byte-compile-refresh-preloaded): Don't reload byte-compiler files. * lisp/custom.el (custom-initialize-default): Use defvar. (custom-declare-variable): Set the special-variable-p flag. * lisp/help-fns.el (help-make-usage): Drop leading underscores. * lisp/dired.el (dired-revert, dired-make-relative): Mark unused args. (dired-unmark-all-files): Remove unused var `query'. (dired-overwrite-confirmed): Declare. (dired-restore-desktop-buffer): Don't use dynamically scoped arg names. * lisp/mpc.el: Mark unused args. (mpc--faster-toggle): Remove unused var `songnb'. * lisp/server.el (server-kill-buffer-running): Move before first use. * lisp/minibuffer.el: Mark unused args. * src/callint.c (quotify_arg): Simplify the logic. (Fcall_interactively): Use lexical binding when evaluating the interactive spec of a lexically bound function. --- src/callint.c | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'src/callint.c') diff --git a/src/callint.c b/src/callint.c index 253f2b9dd09..a0efc4bbfe4 100644 --- a/src/callint.c +++ b/src/callint.c @@ -121,8 +121,9 @@ usage: (interactive &optional ARGS) */) Lisp_Object quotify_arg (register Lisp_Object exp) { - if (!INTEGERP (exp) && !STRINGP (exp) - && !NILP (exp) && !EQ (exp, Qt)) + if (CONSP (exp) + || (SYMBOLP (exp) + && !NILP (exp) && !EQ (exp, Qt))) return Fcons (Qquote, Fcons (exp, Qnil)); return exp; @@ -169,6 +170,9 @@ check_mark (int for_region) static void fix_command (Lisp_Object input, Lisp_Object values) { + /* FIXME: Instead of this ugly hack, we should provide a way for an + interactive spec to return an expression that will re-build the args + without user intervention. */ if (CONSP (input)) { Lisp_Object car; @@ -331,11 +335,14 @@ invoke it. If KEYS is omitted or nil, the return value of else { Lisp_Object input; + Lisp_Object funval = Findirect_function (function, Qt); i = num_input_events; input = specs; /* Compute the arg values using the user's expression. */ GCPRO2 (input, filter_specs); - specs = Feval (specs, Qnil); /* FIXME: lexbind */ + specs = Feval (specs, + CONSP (funval) && EQ (Qclosure, XCAR (funval)) + ? Qt : Qnil); UNGCPRO; if (i != num_input_events || !NILP (record_flag)) { -- cgit v1.2.3