/* Fundamental definitions for GNU Emacs Lisp interpreter.
- Copyright (C) 1985,86,87,93,94,95, 1997 Free Software Foundation, Inc.
+ Copyright (C) 1985,86,87,93,94,95,97,1998 Free Software Foundation, Inc.
This file is part of GNU Emacs.
unsigned int total_length; /* Length of myself and both children. */
unsigned int position; /* Cache of interval's character position. */
+ /* This field is usually updated
+ simultaneously with an interval
+ traversal, there is no guaranty
+ that it is valid for a random
+ interval. */
struct interval *left; /* Intervals which precede me. */
struct interval *right; /* Intervals which succeed me. */
int bufpos;
};
+#if 0
+
+/* Nonzero if STR is a multibyte string. */
+#define STRING_MULTIBYTE(STR) \
+ (XSTRING (STR)->size_byte != XSTRING (STR)->size)
+
+/* Return the length in bytes of STR. */
+#define STRING_BYTES(STR) ((STR)->size_byte + 0)
+
+/* Set the length in bytes of STR. */
+#define SET_STRING_BYTES(STR, SIZE) ((STR)->size_byte = (SIZE))
+
+#else
+
+/* Nonzero if STR is a multibyte string. */
+#define STRING_MULTIBYTE(STR) \
+ (XSTRING (STR)->size_byte >= 0)
+
+/* Return the length in bytes of STR. */
+#define STRING_BYTES(STR) \
+ ((STR)->size_byte < 0 ? (STR)->size : (STR)->size_byte)
+
+/* Set the length in bytes of STR. */
+#define SET_STRING_BYTES(STR, SIZE) ((STR)->size_byte = (SIZE))
+
+#endif /* 0 */
+
/* In a string or vector, the sign bit of the `size' is the gc mark bit */
struct Lisp_String
{
EMACS_INT size;
+ EMACS_INT size_byte;
DECLARE_INTERVALS /* `data' field must be last. */
unsigned char data[1];
};
/* 1 means normal insertion at the marker's position
leaves the marker after the inserted text. */
unsigned int insertion_type : 1;
+ /* This is the buffer that the marker points into,
+ or 0 if it points nowhere. */
struct buffer *buffer;
+
+ /* The remaining fields are meaningless in a marker that
+ does not point anywhere. */
+
+ /* For markers that point somewhere,
+ this is used to chain of all the markers in a given buffer. */
Lisp_Object chain;
- int bufpos;
+ /* This is the char position where the marker points. */
+ int charpos;
+ /* This is the byte position. */
+ int bytepos;
};
/* Forwarding pointer to an int variable.
Only make-local-variable does that. */
struct Lisp_Buffer_Local_Value
{
- int type : 16; /* = Lisp_Misc_Buffer_Local_Value
- or Lisp_Misc_Some_Buffer_Local_Value */
- int spacer : 16;
- Lisp_Object car, cdr;
+ int type : 16; /* = Lisp_Misc_Buffer_Local_Value
+ or Lisp_Misc_Some_Buffer_Local_Value */
+ int spacer : 13;
+ unsigned int check_frame : 1;
+ unsigned int found_for_buffer : 1;
+ unsigned int found_for_frame : 1;
+ Lisp_Object realvalue;
+ Lisp_Object buffer, frame;
+ Lisp_Object cdr;
};
/* In an overlay object, the mark bit of the plist is used as the GC mark.
EXFUN (Fsymbolp, 1);
EXFUN (Fvectorp, 1);
EXFUN (Fstringp, 1);
+EXFUN (Fmultibyte_string_p, 1);
EXFUN (Farrayp, 1);
EXFUN (Fsequencep, 1);
EXFUN (Fbufferp, 1);
EXFUN (Ffind_operation_coding_system, MANY);
EXFUN (Fencode_coding_string, 3);
EXFUN (Fdecode_coding_string, 3);
+extern Lisp_Object detect_coding_system P_ ((unsigned char *, int, int));
/* Defined in charset.c */
+extern int nonascii_insert_offset;
+extern Lisp_Object Vnonascii_translate_table;
EXFUN (Fchar_bytes, 1);
+EXFUN (Fchar_width, 1);
+extern int chars_in_text P_ ((unsigned char *, int));
+extern int multibyte_chars_in_text P_ ((unsigned char *, int));
+extern int unibyte_char_to_multibyte P_ ((int));
+extern Lisp_Object Qcharset;
/* Defined in syntax.c */
EXFUN (Fforward_word, 1);
EXFUN (Fconcat, MANY);
EXFUN (Fvconcat, MANY);
EXFUN (Fcopy_sequence, 1);
+EXFUN (Fstring_make_multibyte, 1);
+EXFUN (Fstring_make_unibyte, 1);
+EXFUN (Fstring_as_multibyte, 1);
+EXFUN (Fstring_as_unibyte, 1);
EXFUN (Fsubstring, 3);
+extern Lisp_Object substring_both P_ ((Lisp_Object, int, int, int, int));
EXFUN (Fnth, 2);
EXFUN (Fnthcdr, 2);
EXFUN (Fmemq, 2);
extern Lisp_Object concat3 P_ ((Lisp_Object, Lisp_Object, Lisp_Object));
extern Lisp_Object nconc2 P_ ((Lisp_Object, Lisp_Object));
extern Lisp_Object assq_no_quit P_ ((Lisp_Object, Lisp_Object));
+extern int string_char_to_byte P_ ((Lisp_Object, int));
+extern int string_byte_to_char P_ ((Lisp_Object, int));
+extern Lisp_Object string_make_multibyte P_ ((Lisp_Object));
+extern Lisp_Object string_make_unibyte P_ ((Lisp_Object));
EXFUN (Fcopy_alist, 1);
EXFUN (Fplist_get, 2);
EXFUN (Fset_char_table_parent, 2);
EXFUN (Frassoc, 2);
EXFUN (Fstring_equal, 2);
EXFUN (Fstring_lessp, 2);
+extern int char_table_translate P_ ((Lisp_Object, int));
extern void map_char_table P_ ((void (*) (Lisp_Object, Lisp_Object, Lisp_Object),
Lisp_Object, Lisp_Object, Lisp_Object, int,
Lisp_Object *));
/* Defined in insdel.c */
extern void move_gap P_ ((int));
+extern void move_gap_both P_ ((int, int));
extern void make_gap P_ ((int));
+extern int copy_text P_ ((unsigned char *, unsigned char *, int, int, int));
+extern int count_size_as_multibyte P_ ((unsigned char *, int));
+extern int count_combining_before P_ ((unsigned char *, int, int, int));
+extern int count_combining_after P_ ((unsigned char *, int, int, int));
extern void insert P_ ((unsigned char *, int));
extern void insert_and_inherit P_ ((unsigned char *, int));
-extern void insert_1 P_ ((unsigned char *, int, int, int));
-extern void insert_from_string P_ ((Lisp_Object, int, int, int));
+extern void insert_1 P_ ((unsigned char *, int, int, int, int));
+extern void insert_1_both P_ ((unsigned char *, int, int, int, int, int));
+extern void insert_from_string P_ ((Lisp_Object, int, int, int, int, int));
extern void insert_from_buffer P_ ((struct buffer *, int, int, int));
extern void insert_char P_ ((int));
extern void insert_string P_ ((char *));
extern void insert_before_markers P_ ((unsigned char *, int));
extern void insert_before_markers_and_inherit P_ ((unsigned char *, int));
-extern void insert_from_string_before_markers P_ ((Lisp_Object, int, int, int));
+extern void insert_from_string_before_markers P_ ((Lisp_Object, int, int, int, int, int));
extern void del_range P_ ((int, int));
extern void del_range_1 P_ ((int, int, int));
+extern void del_range_byte P_ ((int, int, int));
+extern void del_range_both P_ ((int, int, int, int, int));
+extern void del_range_2 P_ ((int, int, int, int));
extern void modify_region P_ ((struct buffer *, int, int));
extern void prepare_to_modify_buffer P_ ((int, int, int *));
extern void signal_before_change P_ ((int, int, int *));
extern void signal_after_change P_ ((int, int, int));
-extern void replace_range P_ ((int, int, Lisp_Object, int, int));
+extern void adjust_after_replace P_ ((int, int, Lisp_Object, int, int));
+extern void adjust_after_insert P_ ((int, int, int, int, int));
+extern void replace_range P_ ((int, int, Lisp_Object, int, int, int));
/* Defined in dispnew.c */
EXFUN (Fding, 1);
/* Defined in xdisp.c */
extern Lisp_Object Vmessage_log_max;
+extern int message_enable_multibyte;
extern void message P_ ((/* char *, ... */));
extern void message_nolog P_ ((/* char *, ... */));
extern void message1 P_ ((char *));
extern void message1_nolog P_ ((char *));
-extern void message2 P_ ((char *, int));
+extern void message2 P_ ((char *, int, int));
extern void message2_nolog P_ ((char *, int, int));
-extern void message_dolog P_ ((char *, int, int));
+extern void message_dolog P_ ((char *, int, int, int));
+extern void message_with_string P_ ((char *, Lisp_Object, int));
extern void message_log_maybe_newline P_ ((void));
extern void update_echo_area P_ ((void));
extern void truncate_echo_area P_ ((int));
extern void buffer_memory_full P_ ((void));
extern Lisp_Object Vpurify_flag;
EXFUN (Fcons, 2);
+EXFUN (list2, 2);
+EXFUN (list3, 3);
+EXFUN (list4, 4);
+EXFUN (list5, 5);
EXFUN (Flist, MANY);
EXFUN (Fmake_list, 2);
extern Lisp_Object allocate_misc P_ ((void));
EXFUN (Fmake_string, 2);
extern Lisp_Object build_string P_ ((char *));
extern Lisp_Object make_string P_ ((char *, int));
+extern Lisp_Object make_unibyte_string P_ ((char *, int));
+extern Lisp_Object make_multibyte_string P_ ((char *, int, int));
extern Lisp_Object make_event_array P_ ((int, Lisp_Object *));
extern Lisp_Object make_uninit_string P_ ((int));
+extern Lisp_Object make_uninit_multibyte_string P_ ((int, int));
+extern Lisp_Object make_string_from_bytes P_ ((char *, int, int));
+extern Lisp_Object make_specified_string P_ ((char *, int, int, int));
EXFUN (Fpurecopy, 1);
-extern Lisp_Object make_pure_string P_ ((char *, int));
+extern Lisp_Object make_pure_string P_ ((char *, int, int, int));
extern Lisp_Object pure_cons P_ ((Lisp_Object, Lisp_Object));
extern Lisp_Object make_pure_vector P_ ((EMACS_INT));
EXFUN (Fgarbage_collect, 0);
extern void write_string_1 P_ ((char *, int, Lisp_Object));
extern void print_error_message P_ ((Lisp_Object, Lisp_Object));
extern Lisp_Object internal_with_output_to_temp_buffer
- P_ ((char *, Lisp_Object (*) (), Lisp_Object));
+ P_ ((char *, Lisp_Object (*) (Lisp_Object), Lisp_Object));
extern void float_to_string P_ ((unsigned char *, double));
/* Defined in doprnt.c */
EXFUN (Feval_region, 3);
extern Lisp_Object intern P_ ((char *));
extern Lisp_Object make_symbol P_ ((char *));
-extern Lisp_Object oblookup P_ ((Lisp_Object, char *, int));
+extern Lisp_Object oblookup P_ ((Lisp_Object, char *, int, int));
#define LOADHIST_ATTACH(x) \
if (initialized) Vcurrent_load_list = Fcons (x, Vcurrent_load_list)
extern Lisp_Object Vcurrent_load_list;
EXFUN (Fuser_login_name, 1);
EXFUN (Fsystem_name, 0);
extern int clip_to_bounds P_ ((int, int, int));
+extern Lisp_Object make_buffer_string P_ ((int, int, int));
+extern Lisp_Object make_buffer_string_both P_ ((int, int, int, int, int));
/* defined in buffer.c */
extern void nsberror P_ ((Lisp_Object));
EXFUN (Fget_buffer, 1);
EXFUN (Fget_buffer_create, 1);
EXFUN (Fset_buffer, 1);
+EXFUN (set_buffer_if_live, 1);
EXFUN (Fbarf_if_buffer_read_only, 0);
EXFUN (Fcurrent_buffer, 0);
EXFUN (Fswitch_to_buffer, 2);
EXFUN (Fcopy_marker, 2);
EXFUN (Fset_marker, 3);
extern int marker_position P_ ((Lisp_Object));
+extern int marker_byte_position P_ ((Lisp_Object));
+extern void clear_charpos_cache P_ ((struct buffer *));
+extern int charpos_to_bytepos P_ ((int));
+extern int buf_charpos_to_bytepos P_ ((struct buffer *, int));
+extern int buf_bytepos_to_charpos P_ ((struct buffer *, int));
extern void unchain_marker P_ ((Lisp_Object));
extern Lisp_Object set_marker_restricted P_ ((Lisp_Object, Lisp_Object, Lisp_Object));
+extern Lisp_Object set_marker_both P_ ((Lisp_Object, Lisp_Object, int, int));
+extern Lisp_Object set_marker_restricted_both P_ ((Lisp_Object, Lisp_Object,
+ int, int));
/* Defined in fileio.c */
EXFUN (Ffile_accessible_directory_p, 1);
EXFUN (Funhandled_file_name_directory, 1);
EXFUN (Ffile_directory_p, 1);
-EXFUN (Fwrite_region, 6);
+EXFUN (Fwrite_region, 7);
EXFUN (Ffile_readable_p, 1);
EXFUN (Ffile_executable_p, 1);
EXFUN (Fread_file_name, 5);
EXFUN (Fstring_match, 3);
extern void restore_match_data P_ ((void));
EXFUN (Fmatch_data, 2);
-EXFUN (Fstore_match_data, 1);
+EXFUN (Fset_match_data, 1);
EXFUN (Fmatch_beginning, 1);
EXFUN (Fmatch_end, 1);
extern int fast_string_match P_ ((Lisp_Object, Lisp_Object));
extern int fast_c_string_match_ignore_case P_ ((Lisp_Object, char *));
extern int scan_buffer P_ ((int, int, int, int, int *, int));
+extern int scan_newline P_ ((int, int, int, int, int, int));
extern int find_next_newline P_ ((int, int));
extern int find_next_newline_no_quit P_ ((int, int));
extern int find_before_next_newline P_ ((int, int, int));
extern Lisp_Object last_minibuf_string;
extern void choose_minibuf_frame P_ ((void));
+extern int scmp P_ ((unsigned char *, unsigned char *, int));
EXFUN (Fcompleting_read, 8);
EXFUN (Fread_from_minibuffer, 7);
EXFUN (Fread_variable, 2);
EXFUN (Fmove_to_column, 2);
extern int current_column P_ ((void));
extern void invalidate_current_column P_ ((void));
-extern int pos_tab_offset P_ ((struct window *, int));
-extern int indented_beyond_p P_ ((int, int));
+extern int indented_beyond_p P_ ((int, int, int));
/* defined in window.c */
extern Lisp_Object Qwindowp, Qwindow_live_p;
EXFUN (Fsplit_window, 3);
EXFUN (Fset_window_configuration, 1);
EXFUN (Fcurrent_window_configuration, 1);
+extern int compare_window_configurations P_ ((Lisp_Object, Lisp_Object, int));
EXFUN (Fcoordinates_in_window_p, 2);
EXFUN (Fwindow_at, 3);
EXFUN (Fpos_visible_in_window_p, 2);
extern Lisp_Object truncate_undo_list P_ ((Lisp_Object, int, int));
extern void record_marker_adjustment P_ ((Lisp_Object, int));
extern void record_insert P_ ((int, int));
-extern void record_delete P_ ((int, int));
+extern void record_delete P_ ((int, Lisp_Object));
extern void record_first_change P_ ((void));
extern void record_change P_ ((int, int));
extern void record_property_change P_ ((int, int, Lisp_Object, Lisp_Object,
/* defined in filelock.c */
EXFUN (Funlock_buffer, 0);
+EXFUN (Ffile_locked_p, 1);;
extern void unlock_all_files P_ ((void));
extern void lock_file P_ ((Lisp_Object));
extern void unlock_file P_ ((Lisp_Object));