Commit 464f8898 authored by Richard M. Stallman's avatar Richard M. Stallman
Browse files

*** empty log message ***

parent 706ac90d
...@@ -49,7 +49,7 @@ Lisp_Object Qboundp, Qfboundp; ...@@ -49,7 +49,7 @@ Lisp_Object Qboundp, Qfboundp;
Lisp_Object Qcdr; Lisp_Object Qcdr;
#ifdef LISP_FLOAT_TYPE #ifdef LISP_FLOAT_TYPE
Lisp_Object Qfloatp, Qinteger_or_floatp, Qinteger_or_float_or_marker_p; Lisp_Object Qfloatp;
Lisp_Object Qnumberp, Qnumber_or_marker_p; Lisp_Object Qnumberp, Qnumber_or_marker_p;
#endif #endif
...@@ -246,16 +246,6 @@ DEFUN ("markerp", Fmarkerp, Smarkerp, 1, 1, 0, "T if OBJECT is a marker (editor ...@@ -246,16 +246,6 @@ DEFUN ("markerp", Fmarkerp, Smarkerp, 1, 1, 0, "T if OBJECT is a marker (editor
return Qnil; return Qnil;
} }
DEFUN ("integer-or-marker-p", Finteger_or_marker_p, Sinteger_or_marker_p, 1, 1, 0,
"T if OBJECT is an integer or a marker (editor pointer).")
(obj)
register Lisp_Object obj;
{
if (XTYPE (obj) == Lisp_Marker || XTYPE (obj) == Lisp_Int)
return Qt;
return Qnil;
}
DEFUN ("subrp", Fsubrp, Ssubrp, 1, 1, 0, "T if OBJECT is a built-in function.") DEFUN ("subrp", Fsubrp, Ssubrp, 1, 1, 0, "T if OBJECT is a built-in function.")
(obj) (obj)
Lisp_Object obj; Lisp_Object obj;
...@@ -293,22 +283,21 @@ DEFUN ("integerp", Fintegerp, Sintegerp, 1, 1, 0, "T if OBJECT is a number.") ...@@ -293,22 +283,21 @@ DEFUN ("integerp", Fintegerp, Sintegerp, 1, 1, 0, "T if OBJECT is a number.")
return Qnil; return Qnil;
} }
DEFUN ("natnump", Fnatnump, Snatnump, 1, 1, 0, "T if OBJECT is a nonnegative number.") DEFUN ("integer-or-marker-p", Finteger_or_marker_p, Sinteger_or_marker_p, 1, 1, 0,
"T if OBJECT is an integer or a marker (editor pointer).")
(obj) (obj)
Lisp_Object obj; register Lisp_Object obj;
{ {
if (XTYPE (obj) == Lisp_Int && XINT (obj) >= 0) if (XTYPE (obj) == Lisp_Marker || XTYPE (obj) == Lisp_Int)
return Qt; return Qt;
return Qnil; return Qnil;
} }
#ifdef LISP_FLOAT_TYPE DEFUN ("natnump", Fnatnump, Snatnump, 1, 1, 0, "T if OBJECT is a nonnegative number.")
DEFUN ("floatp", Ffloatp, Sfloatp, 1, 1, 0,
"T if OBJECT is a floating point number.")
(obj) (obj)
Lisp_Object obj; Lisp_Object obj;
{ {
if (XTYPE (obj) == Lisp_Float) if (XTYPE (obj) == Lisp_Int && XINT (obj) >= 0)
return Qt; return Qt;
return Qnil; return Qnil;
} }
...@@ -318,7 +307,11 @@ DEFUN ("numberp", Fnumberp, Snumberp, 1, 1, 0, ...@@ -318,7 +307,11 @@ DEFUN ("numberp", Fnumberp, Snumberp, 1, 1, 0,
(obj) (obj)
Lisp_Object obj; Lisp_Object obj;
{ {
if (XTYPE (obj) == Lisp_Float || XTYPE (obj) == Lisp_Int) if (0
#ifdef LISP_FLOAT_TYPE
|| XTYPE (obj) == Lisp_Float
#endif
|| XTYPE (obj) == Lisp_Int)
return Qt; return Qt;
return Qnil; return Qnil;
} }
...@@ -329,12 +322,25 @@ DEFUN ("number-or-marker-p", Fnumber_or_marker_p, ...@@ -329,12 +322,25 @@ DEFUN ("number-or-marker-p", Fnumber_or_marker_p,
(obj) (obj)
Lisp_Object obj; Lisp_Object obj;
{ {
if (XTYPE (obj) == Lisp_Float if (XTYPE (obj) == Lisp_Int
|| XTYPE (obj) == Lisp_Int #ifdef LISP_FLOAT_TYPE
|| XTYPE (obj) == Lisp_Float
#endif
|| XTYPE (obj) == Lisp_Marker) || XTYPE (obj) == Lisp_Marker)
return Qt; return Qt;
return Qnil; return Qnil;
} }
#ifdef LISP_FLOAT_TYPE
DEFUN ("floatp", Ffloatp, Sfloatp, 1, 1, 0,
"T if OBJECT is a floating point number.")
(obj)
Lisp_Object obj;
{
if (XTYPE (obj) == Lisp_Float)
return Qt;
return Qnil;
}
#endif /* LISP_FLOAT_TYPE */ #endif /* LISP_FLOAT_TYPE */
/* Extract and set components of lists */ /* Extract and set components of lists */
...@@ -1922,8 +1928,8 @@ syms_of_data () ...@@ -1922,8 +1928,8 @@ syms_of_data ()
staticpro (&Qinteger_or_marker_p); staticpro (&Qinteger_or_marker_p);
#ifdef LISP_FLOAT_TYPE #ifdef LISP_FLOAT_TYPE
staticpro (&Qfloatp); staticpro (&Qfloatp);
staticpro (&Qinteger_or_floatp); staticpro (&Qnumberp);
staticpro (&Qinteger_or_float_or_marker_p); staticpro (&Qnumber_or_marker_p);
#endif /* LISP_FLOAT_TYPE */ #endif /* LISP_FLOAT_TYPE */
staticpro (&Qboundp); staticpro (&Qboundp);
...@@ -1937,10 +1943,11 @@ syms_of_data () ...@@ -1937,10 +1943,11 @@ syms_of_data ()
defsubr (&Sconsp); defsubr (&Sconsp);
defsubr (&Satom); defsubr (&Satom);
defsubr (&Sintegerp); defsubr (&Sintegerp);
#ifdef LISP_FLOAT_TYPE defsubr (&Sinteger_or_marker_p);
defsubr (&Sfloatp);
defsubr (&Snumberp); defsubr (&Snumberp);
defsubr (&Snumber_or_marker_p); defsubr (&Snumber_or_marker_p);
#ifdef LISP_FLOAT_TYPE
defsubr (&Sfloatp);
#endif /* LISP_FLOAT_TYPE */ #endif /* LISP_FLOAT_TYPE */
defsubr (&Snatnump); defsubr (&Snatnump);
defsubr (&Ssymbolp); defsubr (&Ssymbolp);
...@@ -1950,7 +1957,6 @@ syms_of_data () ...@@ -1950,7 +1957,6 @@ syms_of_data ()
defsubr (&Ssequencep); defsubr (&Ssequencep);
defsubr (&Sbufferp); defsubr (&Sbufferp);
defsubr (&Smarkerp); defsubr (&Smarkerp);
defsubr (&Sinteger_or_marker_p);
defsubr (&Ssubrp); defsubr (&Ssubrp);
defsubr (&Scompiled_function_p); defsubr (&Scompiled_function_p);
defsubr (&Schar_or_string_p); defsubr (&Schar_or_string_p);
......
...@@ -3349,12 +3349,13 @@ quit_throw_to_read_char () ...@@ -3349,12 +3349,13 @@ quit_throw_to_read_char ()
DEFUN ("set-input-mode", Fset_input_mode, Sset_input_mode, 3, 4, 0, DEFUN ("set-input-mode", Fset_input_mode, Sset_input_mode, 3, 4, 0,
"Set mode of reading keyboard input.\n\ "Set mode of reading keyboard input.\n\
First arg non-nil means use input interrupts; nil means use CBREAK mode.\n\ First arg INTERRUPT non-nil means use input interrupts;\n\
Second arg non-nil means use ^S/^Q flow control for output to terminal\n\ nil means use CBREAK mode.\n\
Second arg FLOW non-nil means use ^S/^Q flow control for output to terminal\n\
(no effect except in CBREAK mode).\n\ (no effect except in CBREAK mode).\n\
Third arg non-nil means accept 8-bit input (for a Meta key).\n\ Third arg META non-nil means accept 8-bit input (for a Meta key).\n\
Otherwise, the top bit is ignored, on the assumption it is parity.\n\ Otherwise, the top bit is ignored, on the assumption it is parity.\n\
Optional fourth arg non-nil specifies character to use for quitting.") Optional fourth arg QUIT if non-nil specifies character to use for quitting.")
(interrupt, flow, meta, quit) (interrupt, flow, meta, quit)
Lisp_Object interrupt, flow, meta, quit; Lisp_Object interrupt, flow, meta, quit;
{ {
......
...@@ -571,12 +571,12 @@ typedef unsigned char UCHAR; ...@@ -571,12 +571,12 @@ typedef unsigned char UCHAR;
#define CHECK_NUMBER_OR_FLOAT(x, i) \ #define CHECK_NUMBER_OR_FLOAT(x, i) \
{ if (XTYPE (x) != Lisp_Float && XTYPE (x) != Lisp_Int) \ { if (XTYPE (x) != Lisp_Float && XTYPE (x) != Lisp_Int) \
x = wrong_type_argument (Qinteger_or_floatp, (x)); } x = wrong_type_argument (Qnumberp, (x)); }
#define CHECK_NUMBER_OR_FLOAT_COERCE_MARKER(x, i) \ #define CHECK_NUMBER_OR_FLOAT_COERCE_MARKER(x, i) \
{ if (XTYPE (x) == Lisp_Marker) XFASTINT (x) = marker_position (x); \ { if (XTYPE (x) == Lisp_Marker) XFASTINT (x) = marker_position (x); \
else if (XTYPE (x) != Lisp_Int && XTYPE (x) != Lisp_Float) \ else if (XTYPE (x) != Lisp_Int && XTYPE (x) != Lisp_Float) \
x = wrong_type_argument (Qinteger_or_float_or_marker_p, (x)); } x = wrong_type_argument (Qnumber_or_marker_p, (x)); }
#else /* Not LISP_FLOAT_TYPE */ #else /* Not LISP_FLOAT_TYPE */
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment