/* Random utility Lisp functions.
Copyright (C) 1985, 1986, 1987, 1993, 1994, 1995, 1997,
1998, 1999, 2000, 2001, 2002, 2003, 2004,
- 2005, 2006, 2007 Free Software Foundation, Inc.
+ 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
This file is part of GNU Emacs.
thisindex++;
}
else
- elt = AREF (this, thisindex++);
+ {
+ elt = AREF (this, thisindex);
+ thisindex++;
+ }
/* Store this element into the result. */
if (toindex < 0)
tail = XCDR (tail);
}
else if (VECTORP (val))
- AREF (val, toindex++) = elt;
+ {
+ ASET (val, toindex, elt);
+ toindex++;
+ }
else
{
CHECK_NUMBER (elt);
}
\f
static Lisp_Object string_char_byte_cache_string;
-static int string_char_byte_cache_charpos;
-static int string_char_byte_cache_bytepos;
+static EMACS_INT string_char_byte_cache_charpos;
+static EMACS_INT string_char_byte_cache_bytepos;
void
clear_string_char_byte_cache ()
string_char_byte_cache_string = Qnil;
}
-/* Return the character index corresponding to CHAR_INDEX in STRING. */
+/* Return the byte index corresponding to CHAR_INDEX in STRING. */
-int
+EMACS_INT
string_char_to_byte (string, char_index)
Lisp_Object string;
- int char_index;
+ EMACS_INT char_index;
{
- int i_byte;
- int best_below, best_below_byte;
- int best_above, best_above_byte;
+ EMACS_INT i_byte;
+ EMACS_INT best_below, best_below_byte;
+ EMACS_INT best_above, best_above_byte;
best_below = best_below_byte = 0;
best_above = SCHARS (string);
\f
/* Return the character index corresponding to BYTE_INDEX in STRING. */
-int
+EMACS_INT
string_byte_to_char (string, byte_index)
Lisp_Object string;
- int byte_index;
+ EMACS_INT byte_index;
{
- int i, i_byte;
- int best_below, best_below_byte;
- int best_above, best_above_byte;
+ EMACS_INT i, i_byte;
+ EMACS_INT best_below, best_below_byte;
+ EMACS_INT best_above, best_above_byte;
best_below = best_below_byte = 0;
best_above = SCHARS (string);
Lisp_Object string;
{
unsigned char *buf;
- int nbytes;
+ EMACS_INT nbytes;
Lisp_Object ret;
USE_SAFE_ALLOCA;
Lisp_Object string;
{
unsigned char *buf;
- int nbytes;
+ EMACS_INT nbytes;
Lisp_Object ret;
USE_SAFE_ALLOCA;
}
for (i = 0; i < ASIZE (h->index); ++i)
- AREF (h->index, i) = Qnil;
+ ASET (h->index, i, Qnil);
h->next_free = make_number (0);
h->count = 0;
DEFUN ("clrhash", Fclrhash, Sclrhash, 1, 1, 0,
- doc: /* Clear hash table TABLE. */)
+ doc: /* Clear hash table TABLE and return it. */)
(table)
Lisp_Object table;
{
hash_clear (check_hash_table (table));
- return Qnil;
+ /* Be compatible with XEmacs. */
+ return table;
}
DEFVAR_BOOL ("use-file-dialog", &use_file_dialog,
doc: /* *Non-nil means mouse commands use a file dialog to ask for files.
-This applies to commands from menus and tool bar buttons. The value of
-`use-dialog-box' takes precedence over this variable, so a file dialog is only
-used if both `use-dialog-box' and this variable are non-nil. */);
+This applies to commands from menus and tool bar buttons even when
+they are initiated from the keyboard. The value of `use-dialog-box'
+takes precedence over this variable, so a file dialog is only used if
+both `use-dialog-box' and this variable are non-nil. */);
use_file_dialog = 1;
defsubr (&Sidentity);