/* Random utility Lisp functions.
- Copyright (C) 1985, 86, 87, 93, 94, 95, 97, 98, 99, 2000, 2001, 2002
+ Copyright (C) 1985, 86, 87, 93, 94, 95, 97, 98, 99, 2000, 2001, 02, 2003
Free Software Foundation, Inc.
This file is part of GNU Emacs.
XSETFASTINT (val, SCHARS (sequence));
else if (VECTORP (sequence))
XSETFASTINT (val, XVECTOR (sequence)->size);
+ else if (SUB_CHAR_TABLE_P (sequence))
+ XSETFASTINT (val, SUB_CHAR_TABLE_ORDINARY_SLOTS);
else if (CHAR_TABLE_P (sequence))
XSETFASTINT (val, MAX_CHAR);
else if (BOOL_VECTOR_P (sequence))
DEFUN ("set-char-table-default", Fset_char_table_default,
Sset_char_table_default, 3, 3, 0,
- doc: /* Set the default value in CHAR-TABLE for a generic character CHAR to VALUE.
+ doc: /* Set the default value in CHAR-TABLE for generic character CH to VALUE.
The generic character specifies the group of characters.
-See also the documentation of make-char. */)
+See also the documentation of `make-char'. */)
(char_table, ch, value)
Lisp_Object char_table, ch, value;
{
ARG is passed to C_FUNCTION when that is called. */
void
-map_char_table (c_function, function, subtable, arg, depth, indices)
+map_char_table (c_function, function, table, subtable, arg, depth, indices)
void (*c_function) P_ ((Lisp_Object, Lisp_Object, Lisp_Object));
- Lisp_Object function, subtable, arg, *indices;
+ Lisp_Object function, table, subtable, arg, *indices;
int depth;
{
int i, to;
/* At first, handle ASCII and 8-bit European characters. */
for (i = 0; i < CHAR_TABLE_SINGLE_BYTE_SLOTS; i++)
{
- Lisp_Object elt = XCHAR_TABLE (subtable)->contents[i];
+ Lisp_Object elt= XCHAR_TABLE (subtable)->contents[i];
+ if (NILP (elt))
+ elt = XCHAR_TABLE (subtable)->defalt;
+ if (NILP (elt))
+ elt = Faref (subtable, make_number (i));
if (c_function)
(*c_function) (arg, make_number (i), elt);
else
{
if (depth >= 3)
error ("Too deep char table");
- map_char_table (c_function, function, elt, arg, depth + 1, indices);
+ map_char_table (c_function, function, table, elt, arg, depth + 1, indices);
}
else
{
int c1, c2, c;
- if (NILP (elt))
- elt = XCHAR_TABLE (subtable)->defalt;
c1 = depth >= 1 ? XFASTINT (indices[1]) : 0;
c2 = depth >= 2 ? XFASTINT (indices[2]) : 0;
c = MAKE_CHAR (charset, c1, c2);
+
+ if (NILP (elt))
+ elt = XCHAR_TABLE (subtable)->defalt;
+ if (NILP (elt))
+ elt = Faref (table, make_number (c));
+
if (c_function)
(*c_function) (arg, make_number (c), elt);
else
be passed to map_char_table because it returns a Lisp_Object rather
than returning nothing.
Casting leads to crashes on some architectures. -stef */
- map_char_table (void_call2, Qnil, char_table, function, 0, indices);
+ map_char_table (void_call2, Qnil, char_table, char_table, function, 0, indices);
return Qnil;
}
These floats are not multiplied by 100.
If the 5-minute or 15-minute load averages are not available, return a
-shortened list, containing only those averages which are available. */)
+shortened list, containing only those averages which are available.
+
+An error is thrown if the load average can't be obtained. In some
+cases making it work would require Emacs being installed setuid or
+setgid so that it can read kernel information, and that usually isn't
+advisable. */)
(use_floats)
Lisp_Object use_floats;
{
doc: /* Access locale data ITEM, if available.
ITEM may be one of the following:
+
`codeset', returning the character set as a string (locale item CODESET);
+
`days', returning a 7-element vector of day names (locale items DAY_n);
+
`months', returning a 12-element vector of month names (locale items MON_n);
+
`paper', returning a list (WIDTH, HEIGHT) for the default paper size,
where the width and height are in mm (locale items PAPER_WIDTH,
PAPER_HEIGHT).
If the system can't provide such information through a call to
-nl_langinfo(3), return nil.
+nl_langinfo(3) or if ITEM isn't from the list above, return nil.
See also Info node `(libc)Locales'.
}
#endif /* PAPER_WIDTH */
#endif /* HAVE_LANGINFO_CODESET*/
- return Qnil;
+ return Qnil;
}
\f
/* base64 encode/decode functions (RFC 2045).
/* Make sure key and value survive. */
if (!key_known_to_survive_p)
{
- mark_object (&HASH_KEY (h, i));
+ mark_object (HASH_KEY (h, i));
marked = 1;
}
if (!value_known_to_survive_p)
{
- mark_object (&HASH_VALUE (h, i));
+ mark_object (HASH_VALUE (h, i));
marked = 1;
}
}