summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorStefan Monnier <monnier@iro.umontreal.ca>2011-04-01 11:16:50 -0400
committerStefan Monnier <monnier@iro.umontreal.ca>2011-04-01 11:16:50 -0400
commit7200d79c65c65686495dd95e9f6dd436cf6db55e (patch)
tree5ad8e8f4ad0bb2dadfdc1d670cb3cd47db28a3f8 /src
parent40d83b412f584cc02e68d4eac8fd5e6eb769e2fe (diff)
Miscellanous cleanups in preparation for the merge.
* lisp/emacs-lisp/byte-opt.el (byte-optimize-form-code-walker): Remove debug statement. * lisp/emacs-lisp/bytecomp.el (byte-compile-single-version) (byte-compile-version-cond, byte-compile-delay-out) (byte-compile-delayed-out): Remove, unused. * src/bytecode.c (Fbyte_code): Revert to old calling convention. * src/lisp.h (COMPILED_PUSH_ARGS): Remove, unused.
Diffstat (limited to 'src')
-rw-r--r--src/ChangeLog5
-rw-r--r--src/bytecode.c41
-rw-r--r--src/callint.c4
-rw-r--r--src/eval.c15
-rw-r--r--src/lisp.h3
-rw-r--r--src/lread.c33
-rw-r--r--src/window.c1
7 files changed, 44 insertions, 58 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index e34cd69432..04064adbaa 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,8 @@
+2011-04-01 Stefan Monnier <monnier@iro.umontreal.ca>
+
+ * bytecode.c (Fbyte_code): Revert to old calling convention.
+ * lisp.h (COMPILED_PUSH_ARGS): Remove, unused.
+
2011-03-16 Stefan Monnier <monnier@iro.umontreal.ca>
* image.c (parse_image_spec): Use Ffunctionp.
diff --git a/src/bytecode.c b/src/bytecode.c
index 01ae8055eb..5d94cb0fb3 100644
--- a/src/bytecode.c
+++ b/src/bytecode.c
@@ -51,7 +51,7 @@ by Hallvard:
*
* define BYTE_CODE_METER to enable generation of a byte-op usage histogram.
*/
-#define BYTE_CODE_SAFE 1
+/* #define BYTE_CODE_SAFE */
/* #define BYTE_CODE_METER */
@@ -160,7 +160,7 @@ extern Lisp_Object Qand_optional, Qand_rest;
#ifdef BYTE_CODE_SAFE
#define Bset_mark 0163 /* this loser is no longer generated as of v18 */
#endif
-#define Binteractive_p 0164 /* Obsolete. */
+#define Binteractive_p 0164 /* Obsolete since Emacs-24.1. */
#define Bforward_char 0165
#define Bforward_word 0166
@@ -185,16 +185,16 @@ extern Lisp_Object Qand_optional, Qand_rest;
#define Bdup 0211
#define Bsave_excursion 0212
-#define Bsave_window_excursion 0213 /* Obsolete. */
+#define Bsave_window_excursion 0213 /* Obsolete since Emacs-24.1. */
#define Bsave_restriction 0214
#define Bcatch 0215
#define Bunwind_protect 0216
#define Bcondition_case 0217
-#define Btemp_output_buffer_setup 0220 /* Obsolete. */
-#define Btemp_output_buffer_show 0221 /* Obsolete. */
+#define Btemp_output_buffer_setup 0220 /* Obsolete since Emacs-24.1. */
+#define Btemp_output_buffer_show 0221 /* Obsolete since Emacs-24.1. */
-#define Bunbind_all 0222 /* Obsolete. */
+#define Bunbind_all 0222 /* Obsolete. Never used. */
#define Bset_marker 0223
#define Bmatch_beginning 0224
@@ -413,24 +413,15 @@ unmark_byte_stack (void)
} while (0)
-DEFUN ("byte-code", Fbyte_code, Sbyte_code, 3, MANY, 0,
+DEFUN ("byte-code", Fbyte_code, Sbyte_code, 3, 3, 0,
doc: /* Function used internally in byte-compiled code.
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.
-
-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) */)
- (size_t nargs, Lisp_Object *args)
+If the third argument is incorrect, Emacs may crash. */)
+ (Lisp_Object bytestr, Lisp_Object vector, Lisp_Object maxdepth)
{
- 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);
+ return exec_byte_code (bytestr, vector, maxdepth, Qnil, 0, NULL);
}
/* Execute the byte-code in BYTESTR. VECTOR is the constant vector, and
@@ -810,7 +801,7 @@ exec_byte_code (Lisp_Object bytestr, Lisp_Object vector, Lisp_Object maxdepth,
AFTER_POTENTIAL_GC ();
break;
- case Bunbind_all: /* Obsolete. */
+ case Bunbind_all: /* Obsolete. Never used. */
/* To unbind back to the beginning of this frame. Not used yet,
but will be needed for tail-recursion elimination. */
BEFORE_POTENTIAL_GC ();
@@ -938,12 +929,12 @@ exec_byte_code (Lisp_Object bytestr, Lisp_Object vector, Lisp_Object maxdepth,
save_excursion_save ());
break;
- case Bsave_current_buffer: /* Obsolete. */
+ case Bsave_current_buffer: /* Obsolete since ??. */
case Bsave_current_buffer_1:
record_unwind_protect (set_buffer_if_live, Fcurrent_buffer ());
break;
- case Bsave_window_excursion: /* Obsolete. */
+ case Bsave_window_excursion: /* Obsolete since 24.1. */
{
register int count = SPECPDL_INDEX ();
record_unwind_protect (Fset_window_configuration,
@@ -985,7 +976,7 @@ exec_byte_code (Lisp_Object bytestr, Lisp_Object vector, Lisp_Object maxdepth,
break;
}
- case Btemp_output_buffer_setup: /* Obsolete. */
+ case Btemp_output_buffer_setup: /* Obsolete since 24.1. */
BEFORE_POTENTIAL_GC ();
CHECK_STRING (TOP);
temp_output_buffer_setup (SSDATA (TOP));
@@ -993,7 +984,7 @@ exec_byte_code (Lisp_Object bytestr, Lisp_Object vector, Lisp_Object maxdepth,
TOP = Vstandard_output;
break;
- case Btemp_output_buffer_show: /* Obsolete. */
+ case Btemp_output_buffer_show: /* Obsolete since 24.1. */
{
Lisp_Object v1;
BEFORE_POTENTIAL_GC ();
@@ -1465,7 +1456,7 @@ exec_byte_code (Lisp_Object bytestr, Lisp_Object vector, Lisp_Object maxdepth,
AFTER_POTENTIAL_GC ();
break;
- case Binteractive_p: /* Obsolete. */
+ case Binteractive_p: /* Obsolete since 24.1. */
PUSH (Finteractive_p ());
break;
diff --git a/src/callint.c b/src/callint.c
index 489fa392e4..60570369d9 100644
--- a/src/callint.c
+++ b/src/callint.c
@@ -171,8 +171,8 @@ 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. */
+ interactive spec to return an expression/function that will re-build the
+ args without user intervention. */
if (CONSP (input))
{
Lisp_Object car;
diff --git a/src/eval.c b/src/eval.c
index 9f90e6df4b..0e47d7c757 100644
--- a/src/eval.c
+++ b/src/eval.c
@@ -117,10 +117,10 @@ Lisp_Object Vsignaling_function;
int handling_signal;
-static Lisp_Object apply_lambda (Lisp_Object fun, Lisp_Object args);
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 fun, Lisp_Object args);
void
init_eval_once (void)
@@ -684,7 +684,7 @@ usage: (defmacro NAME ARGLIST [DOCSTRING] [DECL] BODY...) */)
tail = Fcons (lambda_list, tail);
else
tail = Fcons (lambda_list, Fcons (doc, tail));
-
+
defn = Fcons (Qlambda, tail);
if (!NILP (Vinternal_interpreter_environment)) /* Mere optimization! */
defn = Ffunction (Fcons (defn, Qnil));
@@ -1012,11 +1012,8 @@ usage: (let* VARLIST BODY...) */)
varlist = XCDR (varlist);
}
-
UNGCPRO;
-
val = Fprogn (Fcdr (args));
-
return unbind_to (count, val);
}
@@ -2083,7 +2080,8 @@ then strings and vectors are not accepted. */)
return Qnil;
funcar = XCAR (fun);
if (EQ (funcar, Qclosure))
- return !NILP (Fassq (Qinteractive, Fcdr (Fcdr (XCDR (fun))))) ? Qt : if_prop;
+ return (!NILP (Fassq (Qinteractive, Fcdr (Fcdr (XCDR (fun)))))
+ ? Qt : if_prop);
else if (EQ (funcar, Qlambda))
return !NILP (Fassq (Qinteractive, Fcdr (XCDR (fun)))) ? Qt : if_prop;
else if (EQ (funcar, Qautoload))
@@ -2898,7 +2896,7 @@ call7 (Lisp_Object fn, Lisp_Object arg1, Lisp_Object arg2, Lisp_Object arg3,
/* The caller should GCPRO all the elements of ARGS. */
DEFUN ("functionp", Ffunctionp, Sfunctionp, 1, 1, 0,
- doc: /* Return non-nil if OBJECT is a type of object that can be called as a function. */)
+ doc: /* Non-nil if OBJECT is a function. */)
(Lisp_Object object)
{
if (SYMBOLP (object) && !NILP (Ffboundp (object)))
@@ -3220,7 +3218,7 @@ funcall_lambda (Lisp_Object fun, size_t nargs,
xsignal2 (Qwrong_number_of_arguments, fun, make_number (nargs));
else
val = Qnil;
-
+
/* Bind the argument. */
if (!NILP (lexenv) && SYMBOLP (next))
/* Lexically bind NEXT by adding it to the lexenv alist. */
@@ -3501,7 +3499,6 @@ context where binding is lexical by default. */)
}
-
DEFUN ("backtrace-debug", Fbacktrace_debug, Sbacktrace_debug, 2, 2, 0,
doc: /* Set the debug-on-exit flag of eval frame LEVEL levels down to FLAG.
The debugger is entered when that frame exits, if the flag is non-nil. */)
diff --git a/src/lisp.h b/src/lisp.h
index bd70dcebbd..580dbd1101 100644
--- a/src/lisp.h
+++ b/src/lisp.h
@@ -1483,7 +1483,6 @@ typedef unsigned char UCHAR;
#define COMPILED_STACK_DEPTH 3
#define COMPILED_DOC_STRING 4
#define COMPILED_INTERACTIVE 5
-#define COMPILED_PUSH_ARGS 6
/* Flag bits in a character. These also get used in termhooks.h.
Richard Stallman <rms@gnu.ai.mit.edu> thinks that MULE
@@ -3264,7 +3263,7 @@ extern int read_bytecode_char (int);
/* Defined in bytecode.c */
extern Lisp_Object Qbytecode;
-EXFUN (Fbyte_code, MANY);
+EXFUN (Fbyte_code, 3);
extern void syms_of_bytecode (void);
extern struct byte_stack *byte_stack_list;
#ifdef BYTE_MARK_STACK
diff --git a/src/lread.c b/src/lread.c
index 2418353252..6a24569f55 100644
--- a/src/lread.c
+++ b/src/lread.c
@@ -796,16 +796,16 @@ lisp_file_lexically_bound_p (Lisp_Object readcharfun)
} beg_end_state = NOMINAL;
int in_file_vars = 0;
-#define UPDATE_BEG_END_STATE(ch) \
- if (beg_end_state == NOMINAL) \
- beg_end_state = (ch == '-' ? AFTER_FIRST_DASH : NOMINAL); \
- else if (beg_end_state == AFTER_FIRST_DASH) \
- beg_end_state = (ch == '*' ? AFTER_ASTERIX : NOMINAL); \
- else if (beg_end_state == AFTER_ASTERIX) \
- { \
- if (ch == '-') \
- in_file_vars = !in_file_vars; \
- beg_end_state = NOMINAL; \
+#define UPDATE_BEG_END_STATE(ch) \
+ if (beg_end_state == NOMINAL) \
+ beg_end_state = (ch == '-' ? AFTER_FIRST_DASH : NOMINAL); \
+ else if (beg_end_state == AFTER_FIRST_DASH) \
+ beg_end_state = (ch == '*' ? AFTER_ASTERIX : NOMINAL); \
+ else if (beg_end_state == AFTER_ASTERIX) \
+ { \
+ if (ch == '-') \
+ in_file_vars = !in_file_vars; \
+ beg_end_state = NOMINAL; \
}
/* Skip until we get to the file vars, if any. */
@@ -834,7 +834,7 @@ lisp_file_lexically_bound_p (Lisp_Object readcharfun)
UPDATE_BEG_END_STATE (ch);
ch = READCHAR;
}
-
+
while (var_end > var
&& (var_end[-1] == ' ' || var_end[-1] == '\t'))
var_end--;
@@ -880,7 +880,6 @@ lisp_file_lexically_bound_p (Lisp_Object readcharfun)
return rv;
}
}
-
/* Value is a version number of byte compiled code if the file
associated with file descriptor FD is a compiled Lisp file that's
@@ -1275,7 +1274,6 @@ Return t if the file exists and loads successfully. */)
specbind (Qinhibit_file_name_operation, Qnil);
load_descriptor_list
= Fcons (make_number (fileno (stream)), load_descriptor_list);
-
specbind (Qload_in_progress, Qt);
instream = stream;
@@ -1863,11 +1861,9 @@ This function preserves the position of point. */)
specbind (Qeval_buffer_list, Fcons (buf, Veval_buffer_list));
specbind (Qstandard_output, tem);
- specbind (Qlexical_binding, Qnil);
record_unwind_protect (save_excursion_restore, save_excursion_save ());
BUF_TEMP_SET_PT (XBUFFER (buf), BUF_BEGV (XBUFFER (buf)));
- if (lisp_file_lexically_bound_p (buf))
- Fset (Qlexical_binding, Qt);
+ specbind (Qlexical_binding, lisp_file_lexically_bound_p (buf) ? Qt : Qnil);
readevalloop (buf, 0, filename,
!NILP (printflag), unibyte, Qnil, Qnil, Qnil);
unbind_to (count, Qnil);
@@ -3336,7 +3332,6 @@ read_vector (Lisp_Object readcharfun, int bytecodeflag)
for (i = 0; i < size; i++)
{
item = Fcar (tem);
-
/* If `load-force-doc-strings' is t when reading a lazily-loaded
bytecode object, the docstring containing the bytecode and
constants values must be treated as unibyte and passed to
@@ -3394,7 +3389,6 @@ read_vector (Lisp_Object readcharfun, int bytecodeflag)
tem = Fcdr (tem);
free_cons (otem);
}
-
return vector;
}
@@ -4024,7 +4018,6 @@ defvar_lisp (struct Lisp_Objfwd *o_fwd,
staticpro (address);
}
-
/* Similar but define a variable whose value is the Lisp Object stored
at a particular offset in the current kboard object. */
@@ -4470,7 +4463,7 @@ to load. See also `load-dangerous-libraries'. */);
doc: /* If non-nil, use lexical binding when evaluating code.
This only applies to code evaluated by `eval-buffer' and `eval-region'.
This variable is automatically set from the file variables of an interpreted
- lisp file read using `load'. */);
+ Lisp file read using `load'. */);
Fmake_variable_buffer_local (Qlexical_binding);
DEFVAR_LISP ("eval-buffer-list", Veval_buffer_list,
diff --git a/src/window.c b/src/window.c
index 4bd533c22a..7e40cdff42 100644
--- a/src/window.c
+++ b/src/window.c
@@ -3649,6 +3649,7 @@ displaying that buffer. */)
return Qnil;
}
+
void
temp_output_buffer_show (register Lisp_Object buf)
{