[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] Changes to emacs/src/fns.c [emacs-unicode-2]
From: |
Miles Bader |
Subject: |
[Emacs-diffs] Changes to emacs/src/fns.c [emacs-unicode-2] |
Date: |
Mon, 28 Jun 2004 03:55:51 -0400 |
Index: emacs/src/fns.c
diff -c emacs/src/fns.c:1.342.2.6 emacs/src/fns.c:1.342.2.7
*** emacs/src/fns.c:1.342.2.6 Fri Apr 16 12:50:47 2004
--- emacs/src/fns.c Mon Jun 28 07:29:20 2004
***************
*** 1,5 ****
/* Random utility Lisp functions.
! 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.
--- 1,5 ----
/* Random utility Lisp functions.
! Copyright (C) 1985, 86, 87, 93, 94, 95, 97, 98, 99, 2000, 2001, 02, 03,
2004
Free Software Foundation, Inc.
This file is part of GNU Emacs.
***************
*** 473,479 ****
{
Lisp_Object val;
int size_in_chars
! = (XBOOL_VECTOR (arg)->size + BITS_PER_CHAR - 1) / BITS_PER_CHAR;
val = Fmake_bool_vector (Flength (arg), Qnil);
bcopy (XBOOL_VECTOR (arg)->data, XBOOL_VECTOR (val)->data,
--- 473,480 ----
{
Lisp_Object val;
int size_in_chars
! = ((XBOOL_VECTOR (arg)->size + BOOL_VECTOR_BITS_PER_CHAR - 1)
! / BOOL_VECTOR_BITS_PER_CHAR);
val = Fmake_bool_vector (Flength (arg), Qnil);
bcopy (XBOOL_VECTOR (arg)->data, XBOOL_VECTOR (val)->data,
***************
*** 486,514 ****
return concat (1, &arg, CONSP (arg) ? Lisp_Cons : XTYPE (arg), 0);
}
- #if 0 /* unused */
- /* In string STR of length LEN, see if bytes before STR[I] combine
- with bytes after STR[I] to form a single character. If so, return
- the number of bytes after STR[I] which combine in this way.
- Otherwize, return 0. */
-
- static int
- count_combining (str, len, i)
- unsigned char *str;
- int len, i;
- {
- int j = i - 1, bytes;
-
- if (i == 0 || i == len || CHAR_HEAD_P (str[i]))
- return 0;
- while (j >= 0 && !CHAR_HEAD_P (str[j])) j--;
- if (j < 0 || ! BASE_LEADING_CODE_P (str[j]))
- return 0;
- PARSE_MULTIBYTE_SEQ (str + j, len - j, bytes);
- return (bytes <= i - j ? 0 : bytes - (i - j));
- }
- #endif
-
/* This structure holds information of an argument of `concat' that is
a string and has text properties to be copied. */
struct textprop_rec
--- 487,492 ----
***************
*** 682,687 ****
--- 660,666 ----
}
toindex_byte += thislen_byte;
toindex += thisleni;
+ STRING_SET_CHARS (val, SCHARS (val));
}
/* Copy a single-byte string to a multibyte string. */
else if (STRINGP (this) && STRINGP (val))
***************
*** 735,742 ****
else if (BOOL_VECTOR_P (this))
{
int byte;
! byte = XBOOL_VECTOR (this)->data[thisindex / BITS_PER_CHAR];
! if (byte & (1 << (thisindex % BITS_PER_CHAR)))
elt = Qt;
else
elt = Qnil;
--- 714,721 ----
else if (BOOL_VECTOR_P (this))
{
int byte;
! byte = XBOOL_VECTOR (this)->data[thisindex /
BOOL_VECTOR_BITS_PER_CHAR];
! if (byte & (1 << (thisindex % BOOL_VECTOR_BITS_PER_CHAR)))
elt = Qt;
else
elt = Qnil;
***************
*** 993,1008 ****
Lisp_Object string;
{
unsigned char *buf;
if (! STRING_MULTIBYTE (string))
return string;
! buf = (unsigned char *) alloca (SCHARS (string));
copy_text (SDATA (string), buf, SBYTES (string),
1, 0);
! return make_unibyte_string (buf, SCHARS (string));
}
DEFUN ("string-make-multibyte", Fstring_make_multibyte,
Sstring_make_multibyte,
--- 972,995 ----
Lisp_Object string;
{
unsigned char *buf;
+ Lisp_Object ret;
if (! STRING_MULTIBYTE (string))
return string;
! /* We can not use alloca here, because string might be very long.
! For example when selecting megabytes of text and then pasting it to
! another application. */
! buf = (unsigned char *) xmalloc (SCHARS (string));
copy_text (SDATA (string), buf, SBYTES (string),
1, 0);
! ret = make_unibyte_string (buf, SCHARS (string));
!
! xfree (buf);
!
! return ret;
}
DEFUN ("string-make-multibyte", Fstring_make_multibyte,
Sstring_make_multibyte,
***************
*** 1475,1481 ****
DEFUN ("assoc", Fassoc, Sassoc, 2, 2, 0,
doc: /* Return non-nil if KEY is `equal' to the car of an element of
LIST.
The value is actually the first element of LIST whose car equals KEY. */)
! (key, list)
Lisp_Object key, list;
{
Lisp_Object result, car;
--- 1462,1468 ----
DEFUN ("assoc", Fassoc, Sassoc, 2, 2, 0,
doc: /* Return non-nil if KEY is `equal' to the car of an element of
LIST.
The value is actually the first element of LIST whose car equals KEY. */)
! (key, list)
Lisp_Object key, list;
{
Lisp_Object result, car;
***************
*** 2050,2055 ****
--- 2037,2054 ----
return plist;
}
+ DEFUN ("eql", Feql, Seql, 2, 2, 0,
+ doc: /* Return t if the two args are the same Lisp object.
+ Floating-point numbers of equal value are `eql', but they may not be `eq'.
*/)
+ (obj1, obj2)
+ Lisp_Object obj1, obj2;
+ {
+ if (FLOATP (obj1))
+ return internal_equal (obj1, obj2, 0, 0) ? Qt : Qnil;
+ else
+ return EQ (obj1, obj2) ? Qt : Qnil;
+ }
+
DEFUN ("equal", Fequal, Sequal, 2, 2, 0,
doc: /* Return t if two Lisp objects have similar structure and
contents.
They must have the same data type.
***************
*** 2148,2154 ****
if (BOOL_VECTOR_P (o1))
{
int size_in_chars
! = (XBOOL_VECTOR (o1)->size + BITS_PER_CHAR - 1) / BITS_PER_CHAR;
if (XBOOL_VECTOR (o1)->size != XBOOL_VECTOR (o2)->size)
return 0;
--- 2147,2154 ----
if (BOOL_VECTOR_P (o1))
{
int size_in_chars
! = ((XBOOL_VECTOR (o1)->size + BOOL_VECTOR_BITS_PER_CHAR - 1)
! / BOOL_VECTOR_BITS_PER_CHAR);
if (XBOOL_VECTOR (o1)->size != XBOOL_VECTOR (o2)->size)
return 0;
***************
*** 2260,2266 ****
{
register unsigned char *p = XBOOL_VECTOR (array)->data;
int size_in_chars
! = (XBOOL_VECTOR (array)->size + BITS_PER_CHAR - 1) / BITS_PER_CHAR;
charval = (! NILP (item) ? -1 : 0);
for (index = 0; index < size_in_chars - 1; index++)
--- 2260,2267 ----
{
register unsigned char *p = XBOOL_VECTOR (array)->data;
int size_in_chars
! = ((XBOOL_VECTOR (array)->size + BOOL_VECTOR_BITS_PER_CHAR - 1)
! / BOOL_VECTOR_BITS_PER_CHAR);
charval = (! NILP (item) ? -1 : 0);
for (index = 0; index < size_in_chars - 1; index++)
***************
*** 2268,2275 ****
if (index < size_in_chars)
{
/* Mask out bits beyond the vector size. */
! if (XBOOL_VECTOR (array)->size % BITS_PER_CHAR)
! charval &= (1 << (XBOOL_VECTOR (array)->size % BITS_PER_CHAR)) - 1;
p[index] = charval;
}
}
--- 2269,2276 ----
if (index < size_in_chars)
{
/* Mask out bits beyond the vector size. */
! if (XBOOL_VECTOR (array)->size % BOOL_VECTOR_BITS_PER_CHAR)
! charval &= (1 << (XBOOL_VECTOR (array)->size %
BOOL_VECTOR_BITS_PER_CHAR)) - 1;
p[index] = charval;
}
}
***************
*** 2398,2405 ****
for (i = 0; i < leni; i++)
{
int byte;
! byte = XBOOL_VECTOR (seq)->data[i / BITS_PER_CHAR];
! if (byte & (1 << (i % BITS_PER_CHAR)))
dummy = Qt;
else
dummy = Qnil;
--- 2399,2406 ----
for (i = 0; i < leni; i++)
{
int byte;
! byte = XBOOL_VECTOR (seq)->data[i / BOOL_VECTOR_BITS_PER_CHAR];
! if (byte & (1 << (i % BOOL_VECTOR_BITS_PER_CHAR)))
dummy = Qt;
else
dummy = Qnil;
***************
*** 5203,5208 ****
--- 5204,5210 ----
defsubr (&Sput);
defsubr (&Slax_plist_get);
defsubr (&Slax_plist_put);
+ defsubr (&Seql);
defsubr (&Sequal);
defsubr (&Sequal_including_properties);
defsubr (&Sfillarray);
- [Emacs-diffs] Changes to emacs/src/fns.c [emacs-unicode-2],
Miles Bader <=