#include "syssignal.h"
#include "termhooks.h" /* For FRAME_KBOARD reference in y-or-n-p. */
#include "font.h"
+#include "keymap.h"
#include <float.h>
/* If IEEE_FLOATING_POINT isn't defined, default it from FLT_*. */
static Lisp_Object Qchar_table, Qbool_vector, Qhash_table;
static Lisp_Object Qsubrp, Qmany, Qunevalled;
Lisp_Object Qfont_spec, Qfont_entity, Qfont_object;
+static Lisp_Object Qdefun;
Lisp_Object Qinteractive_form;
}
\f
-/* Data type predicates */
+/* Data type predicates. */
DEFUN ("eq", Feq, Seq, 2, 2, 0,
doc: /* Return t if the two args are the same Lisp object. */)
if (CONSP (XSYMBOL (symbol)->function)
&& EQ (XCAR (XSYMBOL (symbol)->function), Qautoload))
LOADHIST_ATTACH (Fcons (Qt, symbol));
+ if (!NILP (Vpurify_flag)
+ /* If `definition' is a keymap, immutable (and copying) is wrong. */
+ && !KEYMAPP (definition))
+ definition = Fpurecopy (definition);
definition = Ffset (symbol, definition);
LOADHIST_ATTACH (Fcons (Qdefun, symbol));
if (!NILP (docstring))
{
struct specbinding *p;
- for (p = specpdl_ptr - 1; p >= specpdl; p--)
- if (p->func == NULL
+ for (p = specpdl_ptr; p > specpdl; )
+ if ((--p)->func == NULL
&& CONSP (p->symbol))
{
struct Lisp_Symbol *let_bound_symbol = XSYMBOL (XCAR (p->symbol));
eassert (let_bound_symbol->redirect != SYMBOL_VARALIAS);
if (symbol == let_bound_symbol
&& XBUFFER (XCDR (XCDR (p->symbol))) == current_buffer)
- break;
+ return 1;
}
- return p >= specpdl;
+ return 0;
}
static int
{
struct specbinding *p;
- for (p = specpdl_ptr - 1; p >= specpdl; p--)
- if (p->func == NULL && EQ (p->symbol, symbol))
- break;
+ for (p = specpdl_ptr; p > specpdl; )
+ if ((--p)->func == NULL && EQ (p->symbol, symbol))
+ return 1;
- return p >= specpdl;
+ return 0;
}
/* Store the value NEWVAL into SYMBOL.
if (STRINGP (array))
{
int c;
- EMACS_INT idxval_byte;
+ ptrdiff_t idxval_byte;
if (idxval < 0 || idxval >= SCHARS (array))
args_out_of_range (array, idx);
}
else
{
- int size = 0;
+ ptrdiff_t size = 0;
if (VECTORP (array))
size = ASIZE (array);
else if (COMPILEDP (array))
if (STRING_MULTIBYTE (array))
{
- EMACS_INT idxval_byte, prev_bytes, new_bytes, nbytes;
+ ptrdiff_t idxval_byte, nbytes;
+ int prev_bytes, new_bytes;
unsigned char workbuf[MAX_MULTIBYTE_LENGTH], *p0 = workbuf, *p1;
nbytes = SBYTES (array);
if (prev_bytes != new_bytes)
{
/* We must relocate the string data. */
- EMACS_INT nchars = SCHARS (array);
+ ptrdiff_t nchars = SCHARS (array);
unsigned char *str;
USE_SAFE_ALLOCA;
else
{
CHECK_NUMBER (base);
- b = XINT (base);
- if (b < 2 || b > 16)
+ if (! (2 <= XINT (base) && XINT (base) <= 16))
xsignal1 (Qargs_out_of_range, base);
+ b = XINT (base);
}
p = SSDATA (string);
CHECK_NUMBER_COERCE_MARKER (x);
CHECK_NUMBER_COERCE_MARKER (y);
- if (XFASTINT (y) == 0)
+ if (XINT (y) == 0)
xsignal0 (Qarith_error);
XSETINT (val, XINT (x) % XINT (y));
DEFSYM (Qbool_vector, "bool-vector");
DEFSYM (Qhash_table, "hash-table");
+ DEFSYM (Qdefun, "defun");
+
DEFSYM (Qfont_spec, "font-spec");
DEFSYM (Qfont_entity, "font-entity");
DEFSYM (Qfont_object, "font-object");