2008-02-21  Stefan Monnier  <monnier@iro.umontreal.ca>

	* xterm.c (x_connection_closed): Consolidate identical tests.
	(x_delete_terminal): Don't crash if called via x_connection_closed.

2008-02-21  Kenichi Handa  <handa@ni.aist.go.jp>

	* xdisp.c (decode_mode_spec): New arg string.
	(display_mode_element): Adjust for the above change.

2008-02-19  Stefan Monnier  <monnier@iro.umontreal.ca>

	* callint.c (Fcall_interactively): Use AREF.

2008-02-18  Stefan Monnier  <monnier@iro.umontreal.ca>

	* font.c (font_unparse_xlfd): Don't ignore integer pixel size specs.

2008-02-18  Jan Dj$(Q)Z(Brv  <jan.h.d@swipnet.se>

	* xfns.c (Fx_show_tip): Set string to " " if empty.

2008-02-17  Dan Nicolaescu  <dann@ics.uci.edu>

	* callint.c (syms_of_callint): Initialize Vmark_even_if_inactive
	with Qt.

2008-02-17  Kenichi Handa  <handa@m17n.org>

	* ftfont.c (ftfont_shape): Return Lispy number.

	* xfaces.c (prepare_face_for_display): Use display_info->font->fid
	for GCs.
	(Finternal_set_font_selection_order): Call font_update_sort_order
	only when enable_font_backend is set.
	(realize_x_face): Set face->font_info to that of default face only
	when enable_font_backend is set.

	* xdisp.c (handle_composition_prop): Set it->c to the fist
	characte of the composed region.
	(fill_composite_glyph_string): Set base_face->font_info to
	s->font_info.  Get a face for ascii from base_face->ascii_face.
	(BUILD_COMPOSITE_GLYPH_STRING): Call fill_composite_glyph_string
	with a face already decided.
	(x_produce_glyphs): Be sure to set it->ascent and it->descent to
	non-negative.
	(x_produce_glyphs): If the composition method is
	..._WITH_GLYPH_STRING, call font_prepare_composition
	unconditionally.

	* xfns.c (x_make_gc): Use the default font id of the frame for
	GCs.

	* xterm.h (struct x_display_info): New member font.

	* xterm.c (x_set_cursor_gc): Use display_info->font->fid for GCs.
	(x_set_mouse_face_gc, x_new_font): Likewise.
	(x_term_init): Setup display_info->font.
	(x_delete_terminal): Free display_info->font.

	* xfont.c (xfont_draw): Use BLOCK_INPUT and UNBLOCK_INPUT.

	* ftxfont.c (ftxfont_default_fid): Delete it.
	(ftxfont_open): Set xfont->fid to 0.
	(ftxfont_end_for_frame): Clear data specifi to the frame and the
	font-driver.

	* xftfont.c (xftfont_default_fid): Delete it.
	(xftfont_open): Set xfont->fid to 0.

	* fontset.c (FONTSET_OBJLIST): New macro.
	(fontset_find_font): Update font-object list of the fontset.
	(free_realized_fontset): New function.
	(free_face_fontset): Call free_realized_fontset.
	(Ffont_info): Call font_close_object only when enable_font_backend
	is set.

	* font.c [HAVE_X_WINDOWS]: Include xterm.h.
	[HAVE_NTGUI]: Include w32term.h.
	[MAC_OS]: Include macterm.ch.
	(font_otf_ValueRecord): Use make_number.
	(font_finish_cache): Fix handling of reference count.
	(font_clear_cache): Update num_fonts.
	(font_open_entity): Update smallest_char_width and
	smallest_font_height of the frame.
	(font_close_object): Update num_fonts.
	(Fclear_font_cache): Fix finding the target cache data.

2008-02-16  Glenn Morris  <rgm@gnu.org>

	* fontset.c (Finternal_char_font): Fix compilation warning.

2008-02-16  Eli Zaretskii  <eliz@gnu.org>

	* w32.c (init_user_info): Use TOKEN_USER and TOKEN_PRIMARY_GROUP
	instead of char arrays.  Enlarge the size of array passed to
	get_token_information.

	* font.c (Ffont_fill_gstring, Fget_font_glyphs): Fix compilation
	warnings.

2008-02-15  Dan Nicolaescu  <dann@ics.uci.edu>

	* .gdbinit: Don't set `args', it breaks gdb --args.

2008-02-14  Stefan Monnier  <monnier@iro.umontreal.ca>

	* fileio.c (Finsert_file_contents): Adjust offsets when replacing
	within a narrowed buffer.

2008-02-14  Kenichi Handa  <handa@ni.aist.go.jp>

	* coding.c (decode_coding_object, encode_coding_object):
	Preserve Vdeactivate_mark.  Delete unnecessary call of Fcurrent_buffer.

2008-02-12  Stefan Monnier  <monnier@iro.umontreal.ca>

	* coding.c (coding_set_destination): Use BEG_BYTE rather than
	hardcoding 1.
	(detect_coding_system):
	* lisp.h (detect_coding_system, chars_in_text, multibyte_chars_in_text)
	(string_char_to_byte, string_byte_to_char, insert_from_gap):
	* insdel.c (insert_from_gap):
	* fns.c (string_char_byte_cache_charpos, string_char_byte_cache_bytepos)
	(string_char_to_byte, string_byte_to_char, string_make_multibyte)
	(string_to_multibyte):
	* character.c (chars_in_text, multibyte_chars_in_text):
	* fileio.c (Finsert_file_contents): Use EMACS_INT for buffer positions.

	* character.h (FETCH_STRING_CHAR_ADVANCE)
	(FETCH_STRING_CHAR_AS_MULTIBYTE_ADVANCE)
	(FETCH_STRING_CHAR_ADVANCE_NO_CHECK): Use SDATA and SREF.
	(DEC_POS, BUF_DEC_POS): Use BEG_BYTE rather than hardcoding 1.

	* casefiddle.c (casify_region): Only call after-change and composition
	functions on the part of the region that was changed.

	* keyboard.c (read_avail_input):
	* frame.c (Fdelete_frame): Call Fdelete_terminal.

2008-02-11  Stefan Monnier  <monnier@iro.umontreal.ca>

	* buffer.c (clone_per_buffer_values, reset_buffer_local_variables)
	(Fbuffer_local_value, Fbuffer_local_variables): Don't forget undo_list.

2008-02-11  Juanma Barranquero  <lekktu@gmail.com>

	* w32menu.c (push_submenu_start, push_submenu_end)
	(push_left_right_boundary, push_menu_pane, push_menu_item):
	* keyboard.c (read_key_sequence): Don't pass args with side effects
	to AREF, it fails when compiling with -DENABLE_CHECKING.

2008-02-11  Kenichi Handa  <handa@ni.aist.go.jp>

	* Makefile.in (${lispsource}international/charprop.el):
	Delete this target.

	* search.c (boyer_moore): Fix incorrect synching of the trunk and
	emacs-unicode-2.

2008-02-11  Stefan Monnier  <monnier@iro.umontreal.ca>

	* terminal.c (Fdelete_terminal): Clean up the `force' path.

2008-02-10  Stefan Monnier  <monnier@iro.umontreal.ca>

	* frame.c (Qnoelisp): New symbol.
	(syms_of_frame): Initialize it.
	(Fdelete_frame): Use it to distinguish a mere `force' passed from
	someharmles Elisp code, from a strong `force' from x_connection_closed.
	* frame.h (Qnoelisp): Declare.
	* xterm.c (x_connection_closed): Pass `noelisp'.

	* lisp.h (struct Lisp_Misc_Any, struct Lisp_Marker)
	(struct Lisp_Overlay, struct Lisp_Kboard_Objfwd)
	(struct Lisp_Save_Value, struct Lisp_Free): Use enum Lisp_Misc_Type
	rather than `int' for the type of `type'.

2008-02-10  Dan Nicolaescu  <dann@ics.uci.edu>

	* s/gnu-linux.h: Remove support for non-ELF and linux-1.x.

	* Makefile.in (GNUC): Remove support for gcc-1.x.

2008-02-10  Richard Stallman  <rms@gnu.org>

	* lisp.h (ASET): Use AREF, not ASLOT.

2008-02-10  Stefan Monnier  <monnier@iro.umontreal.ca>

	* lisp.h (ASET): Check bounds.

2008-02-10  Glenn Morris  <rgm@gnu.org>

	* buffer.c (mode-name): Doc fix.

2008-02-09  Dan Nicolaescu  <dann@ics.uci.edu>

	* src/Makefile.in:
	* src/emacs.c:
	* src/gmalloc.c:
	* src/keyboard.c:
	* src/lisp.h:
	* src/m/ibm370aix.h:
	* src/process.c:
	* src/regex.c:
	* src/s/hpux.h:
	* src/sysdep.c:
	* src/sysselect.h:
	* src/systty.h:
	* src/unexec.c:
	* src/w32term.c:
	* src/xsmfns.c:
	* src/xterm.c: Remove code that deals with obsolete variables.

	* s/msdos.h (DONT_NEED_ENVIRON): Don't define.

	* ecrt0.c: Replace the DONT_NEED_ENVIRON test with MSDOS test,
	nothing else needs it anymore.

2008-02-09  Eli Zaretskii  <eliz@gnu.org>

	* buffer.h (FETCH_CHAR_AS_MULTIBYTE): Use unibyte_to_multibyte_table
	instead of unibyte_char_to_multibyte.

2008-02-09  Dan Nicolaescu  <dann@ics.uci.edu>

	* s/gnu-linux.h: Remove commented out code.

	* unexec.c: Remove references to obsolete variable COFF_ENCAPSULATE.

	* Makefile.in: Update what RMS says about using autoconf.
	(C_COMPILER, COFF_ENCAPSULATE, MAKE_PARALLEL): Remove obsolete variable.
	(C_SWITCH_MACHINE_1, C_SWITCH_SYSTEM_1, C_SWITCH_SITE_1):
	(C_SWITCH_X_SITE_1, C_SWITCH_X_MACHINE_1)
	(C_SWITCH_X_SYSTEM_1): Move invariant code outside conditional.

2008-02-08  Stefan Monnier  <monnier@iro.umontreal.ca>

	* keymap.c (Fkey_description): Move side effect outside of macro call.

	* xfaces.c (Finternal_make_lisp_face):
	* keyboard.c (add_command_key, parse_menu_item): Use ASET.

	* fontset.c (free_face_fontset): Use FONTSET_FROM_ID.
	(syms_of_fontset): Use ASET.

	* fns.c (concat): Move side effect outside of macro call.
	(hash_clear): Use ASET.

2008-02-08  Richard Stallman  <rms@gnu.org>

	* frame.c (Fdelete_frame): If FORCE, don't call hooks.
	If FORCE, and frame has a surrogate minibuffer for another frame,
	delete the other frame first.

2008-02-07  Timo Savola  <timo.savola@iki.fi>

	* xterm.c (x_detect_focus_change): Handle embed client message.
	(handle_one_xevent): Ditto.
	(handle_one_xevent): If embedded and we get a button press/release,
	request focus.
	(xembed_set_info, xembed_send_message): New functions.
	(x_make_frame_visible): Call xembed_set_info if embedded.
	(x_make_frame_invisible): Call xembed_set_info if embedded.
	(x_term_init): Initialize Xatom_XEMBED.
	(x_make_frame_visible): Check for FRAME_X_EMBEDDED_P also.
	(x_iconify_frame): Ditto.

	* xterm.h (struct x_display_info): Add AtomXatom_XEMBED.
	(enum xembed_info, enum xerm srmbed_message, enum xembed_focus)
	(enum xembed_modifier, enum xembed_accelerator): New.
	(xembed_set_info, xembed_send_message): Declare.
	(FRAME_X_EMBEDDED_P): New.

	* gtkutil.c (xg_create_frame_widgets): If frame is embedded, call
	gtk_plug_new.

	* xfns.c (Fx_create_frame): Do not override the explicitly set parent
	window ID of a frame.
	(x_window): Reparent frame if embedded.
	(Fx_create_frame): Don't set border width if embedded.

	* emacs.c (USAGE3): Add --parent-id
	(standard_args): Ditto.

2008-02-07  Jan Dj,Ad(Brv  <jan.h.d@swipnet.se>

	* coding.c (DECODE_EMACS_MULE_COMPOSITION_CHAR): Use "do...while (0)".

2008-02-07  Jim Meyering  <meyering@redhat.com>

	Use "do...while (0)", not "if (1)..else" in macro definitions.
	The latter provokes a warning from gcc about the empty else, when
	followed by ";".  Also, without that trailing semicolon, it would
	silently swallow up any following statement.
	* syntax.h (SETUP_SYNTAX_TABLE):
	(SETUP_SYNTAX_TABLE_FOR_OBJECT): Likewise.
	* buffer.h (DECODE_POSITION): Likewise.
	* character.h (FETCH_STRING_CHAR_ADVANCE): Likewise.
	(FETCH_STRING_CHAR_AS_MULTIBYTE_ADVANCE): Likewise.
	(FETCH_STRING_CHAR_ADVANCE_NO_CHECK): Likewise.
	(FETCH_CHAR_ADVANCE): Likewise.
	(FETCH_CHAR_ADVANCE_NO_CHECK): Likewise.

2008-02-07  Jim Meyering  <meyering@redhat.com>

	* lread.c [lint]: Don't include <sys/inode.h>.

2008-02-07  Stefan Monnier  <monnier@iro.umontreal.ca>

	* xselect.c (x_handle_dnd_message):
	* xmenu.c (digest_single_submenu, xmenu_show):
	* xdisp.c (with_echo_area_buffer_unwind_data)
	(format_mode_line_unwind_data, unwind_format_mode_line)
	(display_menu_bar):
	* eval.c (Ffetch_bytecode):
	* doc.c (store_function_docstring):
	* ccl.c (resolve_symbol_ccl_program, ccl_get_compiled_code)
	(Fccl_execute, Fccl_execute_on_string, Fregister_code_conversion_map):
	* buffer.c (add_overlay_mod_hooklist): Use ASET.

2008-02-07  Kenichi Handa  <handa@m17n.org>

	* ftxfont.c (ftxfont_open): Don't set
	dpyinfo->smallest_font_height and dpyinfo->smallest_char_width to 0.

	* ftfont.c (ftfont_open): Fix previous change.

2008-02-06  Jason Rumney  <jasonr@gnu.org>

	* w32font.c (w32font_text_extents): Fill in lbearing metric.
	Use cached metrics for ASCII characters.
	(w32font_open_internal): Don't set font's owning_frame.
	Cache metrics for ASCII characters.

	* w32font.h (struct w32font_info): Add ascii_metrics.
	Remove owning_frame.

2008-02-06  Kenichi Handa  <handa@ni.aist.go.jp>

	* xdisp.c (x_produce_glyphs): Don't set it->ascent and it->descent
	to negative value.

	* ftxfont.c (ftxfont_draw): Use s->font_info, not face->font_info.

	* ftfont.c (ftfont_open): Fix calculation of font->font.average_width.

	* charset.c (syms_of_charset): Set QCtest and Qeq.

2008-02-06  Stefan Monnier  <monnier@iro.umontreal.ca>

	* process.c (Fstart_process):
	* callproc.c (Fcall_process): Handle the case where
	Funhandled_file_name_directory returns nil.

	* font.h (enum lgstring_indices, enum lglyph_indices): New enums.
	(LGSTRING_SLOT, LGSTRING_SET_SLOT): New macros.
	* font.c (check_gstring): Use them and AREF to access the vector before
	we know it's really a gstring.
	(Ffont_shape_text): Fix typo.
	(Ffont_shape_text, Ffont_otf_alternates): Fix up int/Lisp_Oject mixups.

	* composite.h (Fcompose_region_internal, Fcompose_string_internal):
	Declare.

	* chartab.c (make_sub_char_table): Remove noop-yet-incorrect statement.

2008-02-05  Jason Rumney  <jasonr@gnu.org>

	* w32font.c (w32font_open_internal): Fill min_width with tmAveCharWidth.
	Set smallest_font_height and smallest_char_width in display info.

2008-02-05  Kenichi Handa  <handa@ni.aist.go.jp>

	* coding.c (decode_eol): Pay attention to coding->dst_multibyte.

2008-02-05  Miles Bader  <miles@gnu.org>

	* xfaces.c (get_lface_attributes, merge_named_face)
	(lookup_named_face, lookup_derived_face, realize_named_face):
	Revert 2008-02-01 change by cyd@stupidchicken.com.

2008-02-04  Kenichi Handa  <handa@ni.aist.go.jp>

	* fontset.c (Ffontset_info): Handle the case of inhibitting the
	fallback fonts.
	(Ffontset_info) [USE_FONT_BACKEND]: Fix getting of opened font names.

2008-02-04  Jason Rumney  <jasonr@gnu.org>

	* w32font.c (w32font_open_internal): Use font_unparse_fcname to
	set full_name.
	(w32font_open_internal): Use xmalloc, xrealloc, xfree.

2008-02-03  Jason Rumney  <jasonr@gnu.org>

	* makefile.w32-in (OBJ1): Include font.o here.
	(FONTOBJ) [USE_FONTBACKEND]: Instead of here.

2008-02-02  Jason Rumney  <jasonr@gnu.org>

	* makefile.w32-in (temacs): Bump EMHEAP to 21.

2008-02-01  Jason Rumney  <jasonr@gnu.org>

	* s/cygwin.h: Define VIRT_ADDR_VARIES.

	* puresize.h [VIRT_ADDR_VARIES]: Don't include CYGWIN in condition.

2008-02-01  Andreas Schwab  <schwab@suse.de>

	* Makefile.in (shortlisp, lisp): Update for rename of
	../lisp/language/myanmar.el.

2008-02-01  Chong Yidong  <cyd@stupidchicken.com>

	* xfaces.c (get_lface_attributes): Delete function.
	(merge_named_face, lookup_named_face, lookup_derived_face)
	(realize_named_face): Call lface_from_face_name directly, and use
	the fact that merge_face_vectors does not alter its FROM argument.

2008-02-01  Jason Rumney  <jasonr@gnu.org>

	* w32term.c (w32_read_socket) <WM_CHAR>: Decode non-Unicode
	input in the default locale.  Handle non-Unicode multibyte input.

2008-02-01  Kenichi Handa  <handa@ni.aist.go.jp>

	* fontset.c (reorder_font_vector): Exclude nil elements from the
	font group.  Don't try multiple fonts.
	(fontset_font): Adjust for the above change.
	(Finternal_char_font): Return nil if the found font doesn't
	contain the character ch.

	* Makefile.in (lisp, shortlisp): Add cham.el.

2008-02-01  Kenichi Handa  <handa@ni.aist.go.jp>

	* font.h (FONTP): Make it return 1 also for a font-object.

	* .gdbinit (xfontset): New function.

	* font.c (font_find_for_lface): Check if the character C is
	supported or not only for the first font.

	* fontset.c (reorder_font_vector): Fix typo.
	(fontset_find_font): Don't add a font-spec specifying a script.
	Use 0 (not Qt) for the indication of empty font-group.  Change the
	format of RFONT-DEF.  Return Qt if no font in the font-group
	support the character.
	(fontset_font): Adjust for the above change.  If no font was
	found the character, remember that.
	(face_for_char): Adjust for the change of RFONT-DEF.
	(Fset_fontset_font): Allow nil for FONT-SPEC to explicitly specify
	no font for the target.
	(Finternal_char_font): Adjust for the change of RFONT-DEF.

2008-02-01  Kenichi Handa  <handa@ni.aist.go.jp>

	* font.c (font_load_for_face): Handle the case that the font in
	face->lface is a string.

2008-02-01  Kenichi Handa  <handa@ni.aist.go.jp>

	* xfaces.c (set_lface_from_font_and_fontset): Set the fontname in lface.

2008-02-01  Kenichi Handa  <handa@ni.aist.go.jp>

	* xfaces.c (Finternal_set_lisp_face_attribute) [USE_FONT_BACKEND]:
	Fix previous change.  If the frame is not on a window system,
	signal an error.

2008-02-01  Kenichi Handa  <handa@ni.aist.go.jp>

	* coding.c (decode_coding_object, encode_coding_object): Adjust
	marker positions after conversion.

	* lisp.h (struct Lisp_Marker): New member need_adjustment.

2008-02-01  Kenichi Handa  <handa@ni.aist.go.jp>

	* font.c (font_find_for_lface): Fix the handling of the return
	value of font_has_char.
	(Ffont_shape_text): Fix previous change.

	* fontset.c (FONTSET_REF_AND_RANGE): Delete it.
	(fontset_ref_and_range): Delete it.
	(fontset_find_font): Call char_table_ref_and_range instead of
	FONTSET_REF_AND_RANGE.
	(make_fontset): Don't setup font groups of Latin here.
	(Fset_fontset_font): Don't overwrite the setting of FONTSET_ASCII.
	(new_fontset_from_font): Make the specified font the default for
	all Latin characters.

2008-02-01  Kenichi Handa  <handa@ni.aist.go.jp>

	* xfaces.c (Finternal_set_lisp_face_attribute): Check if the frame
	is on a window system before accessing the fontset of the frame.

2008-02-01  Kenichi Handa  <handa@ni.aist.go.jp>

	* Makefile.in (lisp, shortlisp): Add kherm.el and myanmar.el.

	* ftfont.c (ftfont_driver): Set ftfont_shape in ftfont_driver only
	when both HAVE_M17N_FLT and HAVE_LIBOTF are defined.

	* font.c (Ffont_shape_text): If the font driver doesn't have a
	shaper function, make zero-width glyphs to have at least one-pixel
	width.  Fix setting of `to' field of glyphs.

2008-02-01  Kenichi Handa  <handa@ni.aist.go.jp>

	* ftfont.c (ftfont_drive_otf): Fix setting of FROM and TO slots of
	glyphs.

	* font.h (struct font_driver): Improve docstring of member `shape'.

2008-02-01  Kenichi Handa  <handa@m17n.org>

	* composite.c (syms_of_composite): Fix docstring of
	auto-composition-function.

	* font.h (LGLYPH_SIZE): New macro.

	* font.c (Ffont_fill_gstring): Stop filling when a character not
	supported by the font is found.
	(Ffont_shape_text): When a shape callback function returns nil,
	try at most two more times with larger gstring.
	(Ffont_at): Fix getting of w.  Call font_at with correct 5th argument.

	* xdisp.c (handle_auto_composed_prop): Change the argument to
	auto-composition-function.

	* ftfont.c (ftfont_encode_char): Use the macro FONT_INVALID_CODE.
	(ftfont_shape_by_flt): If an element of lgstring is nil, make a
	Lispy glyph and store it in the lgstring.

	* xfont.c (xfont_encode_char): Use the macro FONT_INVALID_CODE.

	* xftfont.c (xftfont_encode_char): Use the macro FONT_INVALID_CODE.

2008-02-01  Kenichi Handa  <handa@ni.aist.go.jp>

	* font.c (Ffont_shape_text): Avoid unnecessary composition.

	* fontset.c (Vfont_encoding_charset_alist): New variable.
	(syms_of_fontset): DEFVAR it.
	(reorder_font_vector, fontset_find_font): Optimize for the case of
	no need of reordering.
	(face_for_char): Map the charset property by
	Vfont_encoding_charset_alist.

2008-02-01  Jason Rumney  <jasonr@gnu.org>

	* w32font.c (logfonts_match): Don't check adstyle here.
	(font_matches_spec): Check here against physical font instead.
	(add_font_entity_to_list): Avoid some substitutions.

	* font.c (font_parse_fcname): Default weight and slant to normal.
	(font_score): Prefer normal fonts if weight or slant unspecified.
	(font_score) [WINDOWSNT]: Scale weight difference down to closer
	match freetype scores.

2008-02-01  Jason Rumney  <jasonr@gnu.org>

	* w32font.c (w32font_text_extents): Don't use the frame stored in the
	font, as it may have been deleted.
	(w32_enumfont_pattern_entity): Map generic family to adstyle using
	most common hyphenless variation.
	(logfonts_match): Check generic family.
	(font_matches_spec): Don't check generic family here.
	(fill_in_logfont): Set generic family based on adstyle.

	* w32font.h (w32font_get_cache): Update declaration.

2008-02-01  Kenichi Handa  <handa@ni.aist.go.jp>

	* ftfont.c (ftfont_get_cache): Adjust the argument type.

	* frame.c (x_set_font_backend): Don't call Fclear_font_cache.
	If none of the new drivers are available, call font_update_drviers
	with the old drivers.

	* w32font.c (w32font_get_cache): Adjust the argument type.

	* xfont.c (xfont_get_cache): Adjust the argument type.

	* font.h (struct font_driver): Change argument type of get_cache.

	* xftfont.c (xftfont_start_for_frame): Delete prototype.

	* font.c (Ffont_get): Fix arguments to Fassoc.
	(font_prepare_cache, font_finish_cache, font_get_cache): New functions.
	(font_clear_cache): New function.
	(font_list_entities, font_matching_entity): Use font_get_cache.
	(font_update_drivers): Call font_clear_cache when finishing a driver.

	* fontset.c (fontset_find_font): Fix previous change.

2008-02-01  Kenichi Handa  <handa@ni.aist.go.jp>

	* xterm.c (x_check_font) [USE_FONT_BACKEND]: Don't access
	dpyinfo->font_table.
	(x_delete_display) [USE_FONT_BACKEND]: Likewise.
	(x_delete_terminal) [USE_FONT_BACKEND]: Likewise.

	* font.c (font_at): Handle the case that the arg C is negative.
	Handle the unibyte case.
	(Ffont_at): Call font_at with the arg C -1.

	* xdisp.c (handle_auto_composed_prop): Don't get a character at
	the position here, and call font_at with the arg C -1.
	Don't check the range of the existing composition at the point.

2008-02-01  Kenichi Handa  <handa@ni.aist.go.jp>

	* fontset.c (fontset_add): New args charset_id and family.
	Change caller.
	(load_font_get_repertory, fontset_find_font): Assume that
	font_spec is always a font-spec object.
	(Fset_fontset_font): Always store a font-spec object in a fontset.

	* xdisp.c (handle_auto_composed_prop): Use Fget_text_property
	instead of get_property_and_range.

2008-02-01  Kenichi Handa  <handa@ni.aist.go.jp>

	* xftfont.c (struct xftfont_info): Delete the member ft_face.
	(xftfont_open): Don't keep locking face.
	(xftfont_close): Don't unlock face.
	(xftfont_anchor_point, xftfont_shape): Lock and unlock face.

	* fontset.c (fontset_find_font): Don't prefer a font of
	supplementary charset.

2008-02-01  Kenichi Handa  <handa@m17n.org>

	* ftfont.c (struct OpenTypeSpec): Rename members script_tag to
	script, langsys_tag to langsys, new member script.
	(OTF_TAG_STR): Terminate by '\0'.
	(ftfont_get_open_type_spec): If :otf prop is is spec, Limit the
	listing to the script specified in that property.  Fix arg to
	OTF_check_features.

2008-02-01  Jason Rumney  <jasonr@gnu.org>

	* w32font.h: New file.

	* w32font.c: Include it.
	(struct w32font_info): Add owning_frame field.  Move to w32font.h.
	(w32font_open): Set owning_frame.
	(w32font_text_extents): Use owning_frame.
	(struct font_callback_data): Add opentype_only field.
	(add_font_entity_to_list): Use it to filter fonts.
	Don't check against full name.
	(w32font_list_internal): New function.
	(w32font_list): Use it.
	(w32font_match_internal): New function.
	(w32font_match): Use it.
	(w32font_open_internal): New function.
	(w32font_open): Use it.
	(w32font_get_cache, w32font_close, w32font_has_char)
	(w32font_encode_char, w32font_text_extents, w32font_draw):
	Make non-static.

	* makefile.w32-in (w32font.o): Depend on w32font.h.

2008-02-01  Kenichi Handa  <handa@ni.aist.go.jp>

	* charset.c (Fdefine_charset_internal): Record a supplementary
	charset at the tail of Vcharset_order_list.

	* font.c (Ffont_shape_text): Fix the return value.

	* ftfont.c (OTF_SYM_TAG, OTF_TAG_STR): Fix argument names.

	* xdisp.c (handle_auto_composed_prop): Fix previous change.

2008-02-01  Kenichi Handa  <handa@ni.aist.go.jp>

	* ftfont.c (struct OpenTypeSpec): New struct.
	(OTF_SYM_TAG, OTF_TAG_STR): New macros.
	(ftfont_get_open_type_spec): New function.
	(ftfont_list) [HAVE_LIBOTF]: Check otf-spec property.

	* lread.c (read1): Redo the previous change with checking Vpurify_flag.

2008-02-01  Jason Rumney  <jasonr@gnu.org>

	* w32font.c (add_font_entity_to_list): Compare only the beginning
	of full name.

2008-02-01  Kenichi Handa  <handa@m17n.org>

	* xdisp.c (handle_auto_composed_prop): Simplify the code.
	Never return HANDLED_RECOMPUTE_PROPS.

2008-02-01  Kenichi Handa  <handa@m17n.org>

	* font.c (font_gstring_produce): Delete it.

	* composite.h (COMPOSITION_METHOD):
	Handle COMPOSITION_WITH_GLYPH_STRING.

2008-02-01  Kenichi Handa  <handa@ni.aist.go.jp>

	* xfont.c (Qx): Delete.
	(syms_of_xfont): Don't initialize Qx.

	* composite.h (enum composition_method):
	Define COMPOSITION_WITH_GLYPH_STRING unconditionally.

2008-02-01  Kenichi Handa  <handa@ni.aist.go.jp>

	* xfaces.c [HAVE_WINDOW_SYSTEM]: Include "font.h" unconditionally.
	(choose_face_font): Accept new form of font-spec.

	* frame.h (font_driver_list): Declare it unconditionally.
	(struct frame): Define members font_driver_list and font_data_list
	unconditionally.

	* fontset.c: Include "font.h" unconditionally.
	(generate_ascii_font_name): Use font_parse_xlfd and font_unparse_xlfd.
	(Fset_fontset_font): Accept a font-spec object.

	* font.c (font_unparse_xlfd): If pixel_size is zero, make the
	PIXEL_SIZE part a wild card.

	* dispextern.h (struct glyph_string): Define members clip and
	num_clips unconditionally.
	(struct face): Define members font_info and extra unconditionally.

	* ftfont.c (ftfont_open): Set members maybe_otf and otf of
	ftfont_info only when HAVE_LIBOTF is defined.

2008-02-01  Andreas Schwab  <schwab@suse.de>

	* xdisp.c (back_to_previous_visible_line_start): Fix type of beg
	and end.

2008-02-01  Jason Rumney  <jasonr@gnu.org>

	* w32font.c (w32font_driver): Add new fields.

2008-02-01  Kenichi Handa  <handa@ni.aist.go.jp>

	* Makefile.in (ALL_CFLAGS): Add @M17N_FLT_CFLAGS@.
	(FONTSRC, FONTOBJ) [HAVE_WINDOW_SYSTEM]: Set them unconditionally.
	(LIBES): Add @M17N_FLT_CFLAGS@.

	* composite.c (compose_text): Don't treat the new style
	composition specially.

	* emacs.c (main): Call syms_of_font unconditionally.

	* font.h (FONT_ENTITY_NOT_LOADABLE)
	(FONT_ENTITY_SET_NOT_LOADABLE): New macros.
	(LGSTRING_XXXX, LGLYPH_XXX): Adjust for the change of lispy gstring.
	(struct font_driver): New member shape.
	(font_registry_charsets): Extern it.
	(font_find_for_lface, font_prepare_composition): Adjust prototype.
	(font_otf_capability, font_drive_otf): Delete their externs.

	* font.c [HAVE_M17N_FLT]: Include <m17n-flt.h>.
	(font_charset_alist, font_registry_charsets): Move from xfont.c
	and rename.
	(font_prop_validate_otf): New function.
	(font_property_table): Register it for QCotf.
	(DEVICE_DELTA, adjust_anchor, REPLACEMENT_CHARACTER)
	(font_drive_otf): Delete.
	(font_prepare_composition): New arg F.  Adjust for the change of
	lispy gstring.
	(font_find_for_lface): New arg C.
	(font_load_for_face): Adjust for the change of font_find_for_lface.
	(Ffont_make_gstring, Ffont_fill_gstring): Adjust for the change of
	lispy gstring.
	(Ffont_shape_text): New function.
	(Fopen_font): If the font size is not given, use 12-pixel.
	(Ffont_at): New arg STRING.
	(syms_of_font): Initalize font_charset_alist.
	Declare Ffont_shape_text as a Lisp function.  Call syms_of_XXfont
	conditionally.

	* fontset.c (fontset_find_font) [USE_FONT_BACKEND]: Try multiple
	fonts of the same font-spec.  Change the format of RFONT-DEF.
	(face_for_char, make_fontset_for_ascii_face, Finternal_char_font):
	Adjust for the change of RFONT-DEF.
	(Fset_fontset_font) [USE_FONT_BACKEND]: Handle new format of font-spec.

	* ftfont.h: New file.

	* ftfont.c: Don't include Freetype headers.  Include "ftfont.h".
	(struct ftfont_info) [HAVE_LIBOTF]: New members maybe_otf and otf.
	(ftfont_open) [HAVE_LIBOTF]: Initialize the above members.
	(ftfont_driver) [HAVE_LIBOTF, HAVE_M17N_FLT]: Don't set
	font_otf_capability and font_drive_otf, set ftfont_shape.
	(ftfont_list): Adjust for the change of :otf property value.
	(struct MFLTFontFT) [HAVE_LIBOTF, HAVE_M17N_FLT]: New struct.
	(ftfont_get_glyph_id, ftfont_get_metrics, ftfont_check_otf)
	(adjust_anchor, ftfont_drive_otf, ftfont_shape_by_flt)
	(ftfont_shape) [HAVE_LIBOTF, HAVE_M17N_FLT]: New function.s
	(DEVICE_DELTA) [HAVE_LIBOTF, HAVE_M17N_FLT]: New macro.
	(otf_gstring, gstring, m17n_flt_initialized): New variables.

	* w32term.c (x_draw_composite_glyph_string_foreground):
	Adjust for the change of lispy gstring.

	* xdisp.c (handle_composition_prop): Adjust for the change of
	lispy gstring.  Call a function for auto-composition with the
	third arg it->window.
	(fill_composite_glyph_string): Adjust for the change of lispy string.
	(x_produce_glyphs): Adjust for the change of font_prepare_compositionl.

	* xfaces.c (set_font_frame_param): Adjust for the change of
	font_find_for_lface.

	* xfont.c (x_font_charset_alist): Move to font.c and rename.
	(xfont_registry_charsets): Likewise.  Change caller.
	(syms_of_xfont): Don't handle x_font_charset_alist.

	* xftfont.c: Include "ftfont.h".
	(struct xftfont_info) [HAVE_LIBOTF]: New members maybe_otf and otf.
	(xftfont_open) [HAVE_LIBOTF]: Initialize the above members.
	(xftfont_close) [HAVE_LIBOTF]: Close otf.
	(xftfont_shape) [HAVE_LIBOTF, HAVE_M17N_FLT]: New function.
	(syms_of_xftfont) [HAVE_LIBOTF, HAVE_M17N_FLT]:
	Set xftfont_driver.shape to xftfont_shape.

	* xterm.c (x_draw_composite_glyph_string_foreground): Adjust for
	the change of lispy gstring.

2008-02-01  Kenichi Handa  <handa@ni.aist.go.jp>

	* ftxfont.c (ftxfont_end_for_frame): Fix array indexing error.

2008-02-01  Jason Rumney  <jasonr@gnu.org>

	* w32font.c (w32font_draw): Fill background manually.

2008-02-01  Jason Rumney  <jasonr@gnu.org>

	* font.c (Qfontp): Remove unused symbol.
	(QCantialias): New symbol.
	(syms_of_font): Define it.
	(font_property_table): Set a validator for QCantialias.

	* w32font.c (CLEARTYPE_QUALITY, CLEARTYPE_NATURAL_QUALITY):
	Define if not already.
	(QCfamily): Share with xfaces.c.
	(Qstandard, Qsubpixel, Qnatural): New symbols.
	(syms_of_w32font): Define them.  Don't define QCfamily here.
	(w32_antialias_type, lispy_antialias_type): New functions.
	(w32_enumfont_pattern_entity): New arg requested_font.
	Set antialias parameter if non-default was requested.
	(fill_in_logfont): Fill in lfQuality if :antialias specified.

2008-02-01  Kenichi Handa  <handa@ni.aist.go.jp>

	* lread.c (read1): Undo the previous change.

2008-02-01  CHENG Gao  <chenggao@gmail.com>  (tiny change)

	* frame.c (Fdelete_frame): Call font_update_drivers only when
	USE_FONT_BACKEND is defined..

2008-02-01  Kenichi Handa  <handa@ni.aist.go.jp>

	* font.h (struct font_bitmap): New member bits_per_pixel.
	(struct font_driver): New members start_for_frame and end_for_frame.
	(struct font_data_list): New struct.
	(font_put_frame_data, font_get_frame_data): Extern them.

	* frame.h (struct frame): New member font_data_list.

	* font.c (font_update_drivers): Call driver->start_for_frame and
	driver->end_for_frame at proper timings.
	(font_put_frame_data, font_get_frame_data): New functions.
	(Ffont_spec): Add usage in the docstring.

	* frame.c (make_frame): Initialize f->font_data_list to NULL.
	(Fdelete_frame): Call font_update_drivers.

	* xftfont.c (struct xftface_info): Delete the member xft_draw.
	(xftfont_prepare_face, xftfont_done_face): Adjust for the above change.
	(xftfont_get_xft_draw): New function.
	(xftfont_draw): Get XftDraw by xftfont_get_xft_draw.
	(xftfont_end_for_frame): New function.
	(syms_of_xftfont): Set xftfont_driver.end_for_frame.

	* ftxfont.c (ftxfont_get_gcs): Rename from ftxfont_create_gcs.
	Change argument.  Cache GCs in the per-frame data.
	(struct ftxfont_frame_data): New struct.
	(ftxfont_draw_bitmap): New arg gc_fore and flush.
	(ftxfont_prepare_face, ftxfont_done_face): Delete them.
	(ftxfont_draw): Get GCs by ftxfont_get_gcs.  Reflect s->clip in GCs.
	(ftxfont_end_for_frame): New function.
	(syms_of_ftxfont): Set ftxfont_driver.end_for_frame.

	* ftfont.c (ftfont_get_bitmap): Set bitmap->bits_per_pixel.

2008-02-01  Kenichi Handa  <handa@m17n.org>

	* xselect.c (Vselection_coding_system)
	(Vnext_selection_coding_system): Delete them.
	(syms_of_xselect): Don't declare selection-coding-system and
	next-selection-coding-system.  They are declared in select.el.

2008-02-01  Jason Rumney  <jasonr@gnu.org>

	* w32term.h (WM_UNICHAR, UNICODE_NOCHAR): Define if not already.

	* w32fns.c: Include imm.h.
	(get_composition_string_fn, get_ime_context_fn): New optional
	system functions.
	(globals_of_w32fns): Load them from imm32.dll.
	(ignore_ime_char): New flag.
	(w32_wnd_proc): Handle WM_UNICHAR, WM_IME_CHAR and
	WM_IME_ENDCOMPOSITION messages.

	* w32term.c (w32_read_socket) [WM_UNICHAR]: Handle as
	MULTIBYTE_CHAR_KEYSTROKE_EVENT.

2008-02-01  Kenichi Handa  <handa@ni.aist.go.jp>

	* lread.c (READCHAR): Call readchar with the 2nd arg NULL.
	(READCHAR_REPORT_MULTIBYTE): New macro.
	(readchar): New 2nd arg MULTIBYTE.
	(read1): Use READCHAR_REPORT_MULTIBYTE for the first read.
	Make symbol's name multibyte according to the multibyteness of the
	source.

2008-02-01  Kenichi Handa  <handa@ni.aist.go.jp>

	* xfaces.c (face_for_overlay_string): Call lookup_face with
	correct arguments (fix of synching with the trunk).

2008-02-01  Kenichi Handa  <handa@m17n.org>

	* font.c (font_prop_validate_symbol, font_prop_validate_style)
	(font_prop_validate_non_neg, font_prop_validate_spacing):
	Delete argument prop_index.
	(font_property_table): Change arguments to validater.  Change Callers.
	(font_lispy_object): Delete.
	(font_at): Use font_find_object instead fo font_lispy_object.

2008-02-01  Kenichi Handa  <handa@ni.aist.go.jp>

	* fileio.c (Fexpand_file_name): Adjust multibyteness of directory
	and file names.

2008-02-01  Jason Rumney  <jasonr@gnu.org>

	* w32font.c (add_font_name_to_list): Avoid vertical fonts.
	(font_matches_spec): Remove debug output.
	(add_font_entity_to_list): Avoid using substituted fonts.

2008-02-01  Jason Rumney  <jasonr@gnu.org>

	* doc.c (Fsnarf_documentation):
	* Makefile.in (temacs${EXEEXT}, mostlyclean): Undo last change.

2008-02-01  Miles Bader  <miles@gnu.org>

	* src/dispextern.h (struct glyph_row): Only define "clip" field if
	HAVE_WINDOW_SYSTEM is defined.

2008-02-01  Stefan Monnier  <monnier@iro.umontreal.ca>

	Fix up multi-tty merge.

	* xterm.c (handle_one_xevent): Remove duplicate code and fix up nesting
	and indentation.

	* xfaces.c (free_realized_face, clear_face_gcs):
	Include font_done_for_face in the input_blocked section, just in case.

	* xdisp.c (decode_mode_spec): Use terminal-local coding systems.
	(get_char_face_and_encoding): Undo last change and remove the *other*
	duplicate definition (i.e. keep the one that's better scoped and that
	includes code for the font-backend).

	* terminal.c (create_terminal): Default keyboard_coding to
	`no-conversion' and terminal_coding to `undecided'.

	* lread.c (read1): Use XSETPVECTYPE to set a pseudovector's tag.

	* fontset.c (free_realized_fontsets): Check that the table entry does
	contain a fontset before trying to compare it to `base'.

	* emacs.c (main): Move syms_of_data, syms_of_fileio, syms_of_alloc,
	syms_of_charset, and syms_of_coding earlier because init_window_once
	now needs Vcoding_system_hash_table to be setup.

	* coding.h (default_buffer_file_coding): Remove.

	* coding.c (default_buffer_file_coding): Remove.
	(Fterminal_coding_system, Fkeyboard_coding_system): Use ->id rather
	than ->symbol, and use the terminal-local coding system.
	(syms_of_coding): Don't setup the coding-systems that are not
	terminal-local.
	(Fdefine_coding_system_internal): Use XCAR/XCDR.

	* chartab.c (Fmake_char_table, make_sub_char_table, copy_char_table):
	Use XSETPVECTYPE now that XSETCHAR_TABLE doesn't set the tag anymore.

	* alloc.c (Fmake_char_table, make_sub_char_table): Remove.  They're now
	in chartab.c and were re-added here by mistake.
	(Fpurecopy): Use XSETPVECTYPE after copying a COMPILED pseudovector.

	* doc.c (Fsnarf_documentation):
	* Makefile.in (temacs${EXEEXT}, mostlyclean): Move buildobj.lst from
	src to etc.

	* ChangeLog.10: Add mistakenly removed entry.

2008-02-01  Dan Nicolaescu  <dann@ics.uci.edu>

	* Makefile.in (fringe.o, minibuf.o): Fix dependencies.

2008-02-01  Miles Bader  <miles@gnu.org>

	* xdisp.c (get_char_face_and_encoding): Remove extraneous definition.
	Add extra args to FACE_FOR_CHAR.

2008-02-01  Kenichi Handa  <handa@m17n.org>

	* keymap.c (where_is_internal_1): If key is a cons, store the copy
	in sequence.

	* chartab.c (map_sub_char_table, map_char_table): If the range
	contains just one character, call the function with that character
	even if the depth is not 3.

2008-02-01  Jason Rumney  <jasonr@gnu.org>

	* w32font.c (w32font_text_extents): Calculate metrics for the
	whole string.

2008-02-01  Jason Rumney  <jasonr@gnu.org>

	* w32xfns.c (get_next_msg): Consolidate WM_PAINT messages.

2008-02-01  Jason Rumney  <jasonr@gnu.org>

	* w32term.c (x_set_glyph_string_clipping): Use
	get_glyph_string_clip_rects.
	(x_set_glyph_string_clipping_exactly, x_draw_glyph_string):
	Adjust for the change of struct glyph_string.

	* w32font.c (w32font_draw): Do clipping here.

2008-02-01  Kenichi Handa  <handa@m17n.org>

	* xftfont.c (xftfont_draw): Adjust for the change of struct
	glyph_string.

	* xterm.c (x_set_glyph_string_clipping): Use
	get_glyph_string_clip_rects.
	(x_set_glyph_string_clipping_exactly, x_draw_glyph_string):
	Adjust for the change of struct glyph_string.

	* xdisp.c (get_glyph_string_clip_rects): Reflect s->row->clip to
	the resulting clip(s}.
	(expose_overlaps): Add arg r.  Change callers.  Set it to
	row->clip temporarily.
	(expose_window): Redraw rows overlapping the exposed area.

	* dispextern.h (struct glyph_row): New member clip.
	(struct glyph_string): Delete members clip_x, clip_y, clip_width,
	clip_height, new member clip, and num_clips.

2008-02-01  Kenichi Handa  <handa@m17n.org>

	* data.c (Fchar_or_string_p): Fix docstring.

2008-02-01  Kenichi Handa  <handa@m17n.org>

	* xftfont.c (xftfont_draw): If s->font_info != s->face->font_info,
	create a temporal XftDraw object.

2008-02-01  Kenichi Handa  <handa@m17n.org>

	* font.c (Ffontp): Fix docstring.

	* coding.c (detect_coding_iso_2022): Don't treat SI/SO codes as a
	strong evidence of ISO-2022.

2008-02-01  Kenichi Handa  <handa@m17n.org>

	* abbrev.c (abbrev_check_chars): Use CHAR_TABLE_REF, not
	SYNTAX_ENTRY_FOLLOW_PARENT.

2008-02-01  Stefan Monnier  <monnier@iro.umontreal.ca>

	* fns.c (weak_hash_tables): Rename from Vweak_hash_tables and change
	its type.
	(make_hash_table, copy_hash_table, sweep_weak_hash_tables, init_fns):
	Update to the new type of weak_hash_tables and next_weak.

	* lisp.h (struct Lisp_Hash_Table): Change next_weak from Lisp_Object to
	a plain C pointer to Lisp_Hash_Table.

	* lisp.h (XGCTYPE, GC_HASH_TABLE_P, GC_NILP, GC_NUMBERP, GC_NATNUMP)
	(GC_INTEGERP, GC_SYMBOLP, GC_MISCP, GC_VECTORLIKEP, GC_STRINGP)
	(GC_CONSP, GC_FLOATP, GC_VECTORP, GC_OVERLAYP, GC_MARKERP)
	(GC_INTFWDP, GC_BOOLFWDP, GC_OBJFWDP, GC_BUFFER_OBJFWDP)
	(GC_BUFFER_LOCAL_VALUEP, GC_SOME_BUFFER_LOCAL_VALUEP)
	(GC_KBOARD_OBJFWDP, GC_PSEUDOVECTORP, GC_WINDOW_CONFIGURATIONP)
	(GC_PROCESSP, GC_WINDOWP, GC_SUBRP, GC_COMPILEDP, GC_BUFFERP)
	(GC_SUB_CHAR_TABLE_P, GC_CHAR_TABLE_P, GC_BOOL_VECTOR_P, GC_FRAMEP)
	(GC_EQ): Remove since they've been identical to their non-GC_
	alter-egos ever since the markbit was eradicated.

	* src/alloc.c:
	* src/buffer.c:
	* src/buffer.h:
	* src/data.c:
	* src/fileio.c:
	* src/filelock.c:
	* src/fns.c:
	* src/frame.h:
	* src/lisp.h:
	* src/macterm.c:
	* src/print.c:
	* src/process.c:
	* src/w32fns.c:
	* src/w32menu.c:
	* src/w32term.c:
	* src/xfns.c:
	* src/xmenu.c:
	* src/xterm.c: Replace uses of GC_* macros with the non-GC_ versions.

2008-02-01  Kenichi Handa  <handa@m17n.org>

	* chartab.c (map_sub_char_table): Make it work for the top-level
	char-table.  Fix handling of parent char-table.
	(map_char_table):  Adjust for the above change.

2008-02-01  Jason Rumney  <jasonr@gnu.org>

	* w32font.c (Qgdi): Rename from Qw32.

2008-02-01  Jason Rumney  <jasonr@gnu.org>

	* w32bdf.c (get_quoted_string): Make function static.

2008-02-01  Kenichi Handa  <handa@m17n.org>

	* xftfont.c (xftfont_open): If one of font's ASCII glyph has
	bigger ascent and descent than those of the font, use them as
	font's ascent and descent.

2008-02-01  Kenichi Handa  <handa@m17n.org>

	* Makefile.in (${lispsource}international/charprop.el): Move this
	target within "#ifdef HAVE_UNIDATA" and "#endif".

2008-02-01  Kenichi Handa  <handa@m17n.org>

	* Makefile.in (lisp): Add ${lispsource}language/tai-viet.el.
	(shortlisp): Add ../lisp/language/tai-viet.el.

2008-02-01  Ulrich Mueller  <ulm@gentoo.org>

	* Makefile.in (${lispsource}international/charprop.el): Depend on
	temacs${EXEEXT}.

2008-02-01  Jason Rumney  <jasonr@gnu.org>

	* w32font.c (w32font_close): Delete the GDI font object.

	* w32menu.c: Include character.h

	* w32proc.c: Likewise.

	* w32select.c: Likewise.

	* makefile.w32-in (w32proc.o): Depend on character.h

2008-02-01  Jason Rumney  <jasonr@gnu.org>

	* w32fns.c (syms_of_w32fns): Use DEFSYM macro.

	* w32menu.c (syms_of_w32menu): Likewise.

	* w32proc.c (syms_of_ntproc): Likewise.

	* w32select.c (syms_of_w32select): Likewise.

	* w32term.c (syms_of_w32term): Likewise.

2008-02-01  Jason Rumney  <jasonr@gnu.org>

	* w32font.c (w32font_draw): Delete brush after using it.

2008-02-01  Jason Rumney  <jasonr@gnu.org>

	* w32font.c (w32font_open): Don't set font_idx.
	(w32font_text_extents): Try GetTextExtentPoint32W before defaulting
	to font settings.
	(w32font_draw): Fill background explicitly.

2008-02-01  Jason Rumney  <jasonr@gnu.org>

	* w32term.c (w32_initialize): Don't call w32font_initialize.

	* w32font.c (w32font_info): Remove subranges.
	(QCsubranges, Qmodern, Qswiss, Qroman): Remove.
	(QCfamily, Qmonospace, Qsans_serif, Qmono, Qsans, Qsans__serif)
	(Qraster, Qoutline, Qlatin, Qgreek, Qcoptic, Qcyrillic, Qarmenian)
	(Qhebrew, Qarabic, Qsyriac, Qnko, Qthaana, Qdevanagari, Qbengali)
	(Qgurmukhi, Qgujarati, Qoriya, Qtamil, Qtelugu, Qkannada)
	(Qmalayalam, Qsinhala, Qthai, Qlao, Qtibetan, Qmyanmar, Qgeorgian)
	(Qhangul, Qethiopic, Qcherokee, Qcanadian_aboriginal, Qogham)
	(Qrunic, Qkhmer, Qmongolian, Qsymbol, Qbraille, Qhan)
	(Qideographic_description, Qcjk_misc, Qkana, Qbopomofo, Qkanbun)
	(Qyi, Qbyzantine_musical_symbol, Qmusical_symbol, Qmathematical):
	New symbols.
	(font_callback_data): New struct.
	(w32font_list, w32font_match): Use it.
	(w32font_open): Don't populate subranges.
	(w32font_has_char): Use script Lisp symbols, not subrange bitmask.
	(w32font_encode_char): Always return unicode code-point as-is.
	(w32font_text_extents): Supply a tranformation matrix to
	GetGlyphOutline.  Never look up by glyph index.  Avoid looping
	twice.  Use unicode version of GetTexExtentPoint32 instead of
	glyph index version.
	(set_fonts_frame): Remove
	(w32_enumfont_pattern_entity): Add frame parameter, use it to
	set frame parameter.  Use backward compatible fake foundries.
	Save generic family in extra slot under QCfamily.  Make width slot
	constant.  Save QCspacing value.  Save list of scripts instead of
	binary subranges.
	(w32_generic_family, logfonts_match, font_matches_spec): New functions.
	(add_font_entity_to_list): Use font_callback_data struct.  Filter
	unwanted fonts.
	(add_one_font_entity_to_list): Use font_callback_data struct.
	(w32_registry): Default to iso10646_1.
	(fill_in_logfont): Use dpi from extra slot.  Don't bother with
	string font registries.  Don't fill in font name if it is a generic
	family name, fill family instead.  Use spacing, family and script
	extra info to fill pitch, family and charset fields.
	(list_all_matching_fonts): Use font_callback_data struct.
	(unicode_range_for_char): Remove.
	(font_supported_scripts): New function.
	(w32font_initialize): Remove.
	(syms_of_w32font): Update which symbols are defined.

2008-02-01  Jason Rumney  <jasonr@gnu.org>

	* font.c (font_pixel_size): Reverse assq_no_quit args.

	* w32term.h (FONT_WIDTH): Report max width, not average.
	(FONT_MAX_WIDTH): Remove.
	(FONT_AVG_WIDTH): New macro.

	* xfaces.c (Fx_list_fonts) [WINDOWSNT]: Remove Windows only
	redefinition of FONT_WIDTH.

	* w32term.c (x_font_min_bounds): Use FONT_AVG_WIDTH.
	(w32_cache_char_metrics): Use FONT_WIDTH.

	* w32fns.c (w32_load_system_font, w32_list_fonts): Use FONT_AVG_WIDTH.

2008-02-01  Jason Rumney  <jasonr@gnu.org>

	* w32font.c (w32font_open): Make lfHeight negative.

	* w32fns.c (x_default_font_parameter): Use new style font name.
	(Fx_create_frame, x_create_tip_frame): Initialize resx and resy.

2008-02-01  Jason Rumney  <jasonr@gnu.org>

	* w32font.c (QCsubranges): New symbol.
	(w32font_open, w32font_has_char): Get subranges from subproperty
	of extra.
	(w32_enumfont_pattern_entity): Set subranges as subproperty of extra.
	(syms_of_w32font): Define :subranges symbol.

	* font.c (font_put_extra): Expose externally.

	* font.h (font_put_extra): Move declaration from font.c.

	* font.c (Ffont_get): Use font driver to determine otf capability.
	(adjust_anchor): Check if driver defines anchor_point before using.

	* w32font.c (w32font_open): Handle size, height and pixel_size better.
	(w32font_draw): Use options.
	(w32_enumfont_pattern_entity): Set size to 0 for scalable fonts.
	Fix detection of truetype fonts.
	(registry_to_w32_charset): Handle charsets other than iso8859-1
	expressed as lisp symbols.
	(w32_registry): Express charset as lisp symbol.
	(fill_in_logfont): Reverse pixel and point height logic.
	Don't set width here.  Set quality to default.

	* w32fns.c (w32_load_system_font): Fix detecting FIXED_PITCH fonts.
	(x_to_w32_font): Fill in lfPitchAndFamily correctly.

	* xterm.c (x_draw_glyph_string_foreground) [USE_FONT_BACKEND]:
	Remove redundant loop and allocation.

	* makefile.w32-in (font.o, w32font.o): New objects.
	(fontset.o, xdisp.o, xfaces.o, w32fns.o, w32term.o): Depend on font.h
	(FONTOBJ): New group of objects conditioned on USE_FONT_BACKEND.

	* xdisp.c (fill_composite_glyph_string): Make the first arg to
	STORE_XCHARB a valid l-value.

	* w32term.c (w32_native_per_char_metric): Swap width and rbearing
	calculations for non-Truetype fonts.
	(x_draw_glyph_string): Sync with xterm.c.
	(x_draw_glyph_string_foreground) [USE_FONT_BACKEND]: Remove
	redundant code.
	(w32_initialize) [USE_FONT_BACKEND]: Call w32font_initialize.

	* w32term.h (w32_output_data) [USE_FONT_BACKEND]: Add fontp member.
	(FRAME_FONT_OBJECT) [USE_FONT_BACKEND]: New macro from xterm.h.

	* w32fns.c [USE_FONT_BACKEND]: Port font backend changes from xfns.c.
	(x_to_w32_charset, w32_to_x_charset): Expose externally.

	* w32font.c: New file for w32 font backend.

2008-02-01  Kenichi Handa  <handa@m17n.org>

	* term.c: Don't include "buffer.h" twice.

2008-02-01  Kenichi Handa  <handa@m17n.org>

	* character.c (Funibyte_string): New function.
	(syms_of_character): Defsubr it.

2008-02-01  Jason Rumney  <jasonr@gnu.org>

	* w32term.c [USE_FONT_BACKEND]:
	(x_get_font_repertory, note_mouse_movement, x_set_mouse_face_gc):
	(x_set_glyph_string_clipping, x_set_glyph_string_clipping_exactly):
	(x_draw_glyph_string, x_draw_glyph_string_foreground):
	(x_draw_composite_glyph_string_foreground, x_new_fontset2):
	(x_free_frame_resources): Sync with xterm.c.

2008-02-01  Andreas Schwab  <schwab@suse.de>

	* lread.c (read1): Use CHAR_TABLE_STANDARD_SLOTS to validate
	char-table size.

2008-02-01  Kenichi Handa  <handa@m17n.org>

	* font.c (check_otf_features): Define it regardless of
	HAVE_LIBOTF.

2008-02-01  Kenichi Handa  <handa@m17n.org>

	* ftfont.c (ftfont_driver): Delete font_otf_gsub and
	font_otf_gpos, add font_drive_otf.

	* fontset.c (fontset_find_font): Pay attention to font size
	specified for a font.
	(reorder_font_vector): Check contents of font_def.

	* font.c (struct otf_list): Delete it.
	(otf_list): Make it a lisp variable..
	(otf_open): Use lispy otf_list.
	(generate_otf_features): Rename from parse_gsub_gpos_spec.
	(check_otf_features): New function.
	(font_otf_DeviceTable, font_otf_ValueRecord, font_otf_Anchor): New
	functinos.
	(font_drive_otf): New function merging font_otf_gsub and
	font_otf_gpos.
	(font_open_for_lface): New arg spec.  Change argument order.
	(font_load_for_face): Adjust for the change of font_open_for_lface.
	(Ffont_drive_otf): New function merging Ffont_otf_gsub and
	Ffont_otf_gpos.
	(syms_of_font): Staticpro otf_list.  Delete defsubr of
	Sfont_otf_gsub and Sfont_otf_gpos.  Defsubr Sfont_drive_otf.

	* xfaces.c (set_font_frame_param): Adjust for the change of
	font_open_for_lface.

	* font.h (font_open_for_lface): Adjust prototype.
	(struct font_driver): Delete members otf_gsub and otf_gpos, add
	member otf_drive.
	(font_otf_gsub, font_otf_gpos): Delete externs.
	(font_drive_otf): Extern it.

2008-02-01  Kenichi Handa  <handa@m17n.org>

	* font.c (font_at): If the window W is not on a window system,
	return Qnil.

	* coding.c (produce_chars, encode_coding): Don't call
	insert_from_gap if no characters to produce.

2008-02-01  Kenichi Handa  <handa@m17n.org>

	* fontset.c (free_realized_fontsets): Avoid unnecessary call of
	Fclear_face_cache.

	* xfaces.c (face_for_font): Check also face->font==font->font.font.

2008-02-01  Miles Bader  <miles@gnu.org>

	* emacs.c (main): Change default value of `enable_font_backend' to 1.
	Parse "--disable-font-backend" option.
	(standard_args): Add "--disable-font-backend" option.

2008-02-01  Kenichi Handa  <handa@m17n.org>

	* fontset.c (fontset_find_font): New function.
	(fontset_font): Use fontset_find_font.
	(make_fontset_for_ascii_face): Don't set face ID in rfont_def.
	Register the specified font for all Latin characters.
	(new_fontset_from_font): Register the specified font for all Latin
	characters.
	(dump_fontset): For a realized fontset, include the base fontset
	name in the returned vector.

2008-02-01  Kenichi Handa  <handa@m17n.org>

	* character.h (CHAR_STRING): Cast C to unsigned on calling
	char_string.

	* character.c (char_string): Type of arg C changed to unsigned.
	Signal an error if C is an invalid character code.

	* editfns.c (general_insert_function, Fchar_to_string):
	Use CHARACTERP, not INTEGERP.

2008-02-01  Kenichi Handa  <handa@m17n.org>

	* character.h (MIN_MULTIBYTE_LEADING_CODE)
	(MAX_MULTIBYTE_LEADING_CODE): New macros.

	* regex.c (analyse_first): Fix for multibyte characters in "case
	charset:" and "case categoryspec:".

2008-02-01  Andreas Schwab  <schwab@suse.de>

	* Makefile.in (LIBES): Move standard libraries to the end.

2008-02-01  Kenichi Handa  <handa@m17n.org>

	* alloc.c (Fgarbage_collect): If nextb->text->inhibit_shrinking is
	nonzero, don't shrink the buffer nextb.

	* buffer.h (struct buffer_text): New member inhibit_shrinking.

	* coding.c (coding_alloc_by_making_gap): New arg offset.
	(alloc_destination): Call coding_alloc_by_making_gap with the arg
	offset.
	(decode_coding_iso_2022): Update coding->safe_charsets.
	(decode_coding_gap): Temporarily set
	current_buffer->text->inhibit_shrinking to 1.

2008-02-01  Kenichi Handa  <handa@m17n.org>

	* xterm.c (x_draw_composite_glyph_string_foreground): Fix
	indexing into elements of s->cmp and s->char2b.

2008-02-01  Juanma Barranquero  <lekktu@gmail.com>

	* regex.c (RE_STRING_CHAR_AND_LENGTH) [! emacs]: Add missing arg `len'.

2008-02-01  Kenichi Handa  <handa@m17n.org>

	* regex.c (GET_CHAR_BEFORE_2, GET_CHAR_AFTER): Check the variable
	target_multibyte instead of multibyte.
	(re_match_2_internal): Call bcmp_translate with target_multibyte.
	(bcmp_translate): Change the argument name from multibyte to
	target_multibyte.

2008-02-01  Kenichi Handa  <handa@m17n.org>

	These changes are to compile a regexp into a pattern that can be
	used both for multibyte and unibyte targets.

	* Makefile.in (search.o): Depend on charset.h.

	* character.c (multibyte_char_to_unibyte_safe): New function.

	* search.c: Include "charset.h".
	(compile_pattern_1): Delete argument multibyte.  Don't set
	cp->buf.target_multibyte here.  Set cp->buf.charset_unibyte.
	(compile_pattern): Don't compare cp->buf.target_multibyte.
	Compare cp->buf.charset_unibyte.
	(compile_pattern): Set cp->buf.target_multibyte.

	* lisp.h (multibyte_char_to_unibyte_safe): Extern it.

	* regex.h (struct re_pattern_buffer): New member charset_unibyte.

	* regex.c (RE_STRING_CHAR, RE_STRING_CHAR_AND_LENGTH): New arg
	multibyte.  Change callers.
	(RE_CHAR_TO_MULTIBYTE, RE_CHAR_TO_UNIBYTE): New macros.
	(MAKE_CHAR_MULTIBYTE, MAKE_CHAR_UNIBYTE): Delete.  Change callers
	to use RE_CHAR_TO_MULTIBYTE and RE_CHAR_TO_UNIBYTE, respectively.
	(SETUP_ASCII_RANGE, SETUP_UNIBYTE_RANGE): New macros.
	(SETUP_MULTIBYTE_RANGE): Generate a more compact range_table.
	(regex_compile): Make the compiled pattern usable both for
	multibyte and unibyte targets.
	(analyse_first): Make the fastmap usable both for multibyte and
	unibyte targets.
	(TRANSLATE_VIA_MULTIBYTE): Delete.
	(re_match_2_internal): Pay attention to the case that the
	multibyteness of bufp and target may be different.

2008-02-01  Kenichi Handa  <handa@m17n.org>

	* xdisp.c (x_produce_glyphs): When a font is not found, make the
	empty box occupy at least one column width.

2008-02-01  Miles Bader  <miles@gnu.org>

	* Makefile.in: Remove redundant HAVE_XFT clause.

2008-02-01  Kenichi Handa  <handa@m17n.org>

	* xrdb.c (x_load_resources): Setup the default fontSet X reource.

2008-02-01  Kenichi Handa  <handa@m17n.org>

	* fontset.c (Finternal_char_font): Fix for the case of POSITION
	being nil.

2008-02-01  Kenichi Handa  <handa@m17n.org>

	* xftfont.c (xftfont_open): Call FcConfigSubstitute.

2008-02-01  Kenichi Handa  <handa@m17n.org>

	* xftfont.c (xftfont_open): Don't enable antialias explicitly.

2008-02-01  Kenichi Handa  <handa@m17n.org>

	* search.c (simple_search): Fix previous change.

2008-02-01  Kenichi Handa  <handa@m17n.org>

	* xftfont.c (ftfont_font_format): Extern declaration.

	* frame.c (x_set_font): Fix the second arg to fs_query_fontset.

	* xfont.c (xfont_driver): Initialize ftfont_driver.type by 0.
	(xfont_list): Don't directly use Lisp_Object as an operand of &&.

	* ftfont.c (ftfont_driver): Initialize ftfont_driver.type by 0.
	(ftfont_font_format): Fix previous change.

	* font.h (Ffont_xlfd_name): EXFUN it.

	* font.c (font_parse_xlfd): Fix the array size of `f'.
	(register_font_driver): Use EQ to compare driver->type.

	* xfns.c (xic_create_xfontset2) [USE_FONT_BACKEND]: New function.
	(create_frame_xic) [USE_FONT_BACKEND]: Call xic_create_xfontset2.
	(xic_set_xfontset) [USE_FONT_BACKEND]: Likewise.

2008-02-01  Kenichi Handa  <handa@m17n.org>

	* ftfont.c (ftfont_pattern_entity, ftfont_list_generic_family)
	(ftfont_list, ftfont_font_format): Check if FC_FONTFORMAT is defined.

2008-02-01  Kenichi Handa  <handa@m17n.org>

	* xfont.c (xfont_open): Set font->format.

	* xftfont.c (xftfont_open): Set font->format.

	* ftfont.c (ftfont_pattern_entity): Add fontformat in a pattern.
	(ftfont_list): Include FC_FONTFORMAT in FcObject.
	(ftfont_open): Set font->format.
	(ftfont_font_format): New function.

	* font.h (struct font): New memeber format.

	* font.c (Qopentype): New variable.
	(syms_of_font): Defsym it.
	(Fquery_font): Change the format of the last element of the return
	value.

2008-02-01  Kenichi Handa  <handa@m17n.org>

	* xfns.c (xic_create_xfontset): Try the default fontset name as a
	last resort.

2008-02-01  Kenichi Handa  <handa@m17n.org>

	* coding.c (detect_coding_charset): Fix detection of multi-byte
	charset.

2008-02-01  Bob Halley  <halley@play-bow.org>  (tiny change)

	* ccl.c (ccl_driver): If DST is NULL, set ccl->produced to 0.

2008-02-01  Kenichi Handa  <handa@m17n.org>

	* xdisp.c (get_next_display_element): Set it->face_id for the
	first component of a composition.
	(x_produce_glyphs): Check if the font is changed or not for composition.

2008-02-01  Kenichi Handa  <handa@m17n.org>

	(get_next_display_element): Set it->face_id for the
	first component of a composition.
	(x_produce_glyphs): Check if the font is changed or not for composition.

2008-02-01  Kenichi Handa  <handa@m17n.org>

	* fontset.c (Qlatin): New variable.
	(syms_of_fontset): Define it as a lisp symbol.
	(Fset_fontset_font): If TARGET is `latin', use FONT_SPEC for ASCII.

2008-02-01  Kenichi Handa  <handa@m17n.org>

	* font.c (font_unparse_fcname): Pay attention to the case that
	some of font property is a null string.

2008-02-01  Kenichi Handa  <handa@m17n.org>

	* term.c: Include "composite.h".
	(encode_terminal_code): Output all components of composition.
	Check the size of encode_terminal_src.
	(produce_glyphs): For composition, call produce_composite_glyph.
	(append_composite_glyph, produce_composite_glyph): New functions.

	* xdisp.c (x_produce_glyphs): In handling composition, if a font
	is not found, get font_info from the current ascii face.

2008-02-01  Kenichi Handa  <handa@m17n.org>

	* fileio.c (Finsert_file_contents): On replacing, temporarily bind
	buffer-file-name to Qnil before calling insert_from_buffer.

	* font.c (font_unparse_fcname): Pay attention to the case that
	foundry is a null string.

2008-02-01  Kenichi Handa  <handa@m17n.org>

	* ftfont.c (ftfont_list): Allow registry "unicode-sip".

	* font.c (Qunicode_sip): New variable.
	(syms_of_font): Declare it as a Lisp symbol.

	* font.h (Qunicode_sip): Extern it.

2008-02-01  Kenichi Handa  <handa@m17n.org>

	* composite.c (get_composition_id): Pay attention to TAB component.

	* xterm.c (x_draw_composite_glyph_string_foreground): Don't draw
	TAB.  Adjust for the change of s->char2b which always points to
	the first elememnt of allocated memory.

	* xftfont.c (xftfont_text_extents): Fix calculation of descent value.

	* xdisp.c (handle_composition_prop): Set it->c to the first
	non-TAB component.
	(fill_composite_glyph_string): Change argument.
	(BUILD_COMPOSITE_GLYPH_STRING): Adjust for the above change.
	(x_produce_glyphs): Fix handling of left/right padding.

2008-02-01  Kenichi Handa  <handa@m17n.org>

	* coding.c (detect_coding_system): Fix for handling off
	inhibit_iso_escape_detection.  Fix for the case that no coding
	system is defined for a specific coding category.

2008-02-01  Kenichi Handa  <handa@m17n.org>

	* font.c (font_matching_entity): Delete unused local var.

	* xftfont.c (xftfont_open): Call XftDefaultSubstitute before
	opening a font.

	* fileio.c (Finsert_file_contents): On recovering a file, assume
	Unix-like eol.
	(choose_write_coding_system): On auto-saving a file, force
	Unix-like eol.

	* coding.c (setup_coding_system): Fix setting of
	coding->common_flags based on eol_type.
	(coding_inherit_eol_type): If PARENT is not nil, be sure to
	inherit from it.

2008-02-01  Kenichi Handa  <handa@m17n.org>

	* alloc.c (NSTATICS): Increas to 0x600.

2008-02-01  Kenichi Handa  <handa@m17n.org>

	* ftfont.c (ftfont_driver): Set ftfont_driver.match to ftfont_match.
	(ftfont_list): Don't check :name property.
	(ftfont_match): New function.
	(ftfont_pattern_entity): If the pattern doesn't contain
	FC_SPACING, don't assuce FC_MONO.

	* font.h (struct font_driver): New member `match'.
	(font_update_drivers): Adjust prototype.

	* font.c (font_parse_fcname, font_parse_name): Don't change :name
	property of FONT.
	(LGSTRING_HEADER_SIZE, LGSTRING_GLYPH_SIZE, check_gstring): Define
	them unconditionally.
	(font_matching_entity): New function.
	(font_open_by_name): Try font_matching_entity if exact match is
	not found.
	(font_update_drivers): Delete the arg FONT.  Return a list of
	actually used backends.  Don't free faces, font caches here.
	Don't store data in frame parameters.  Don't call x_set_font.
	(Ffont_spec): Store :name property as is.
	(Ffont_get): Check HAVE_LIBOTF before calling font_otf_capability.
	(Ffont_otf_gsub): Call font->driver->otf_gsub instead of font_otf_gsub.
	(Ffont_otf_gpos): Call font->driver->otf_gpos instead of font_otf_gpos.
	(Ffont_otf_alternates): Check if the driver has otf_gsub function.
	Call font->driver->otf_gsub instead of font_otf_gsub.

	* frame.c (x_set_font_backend): Do more works that were done in
	font_update_drivers before.

	* xfont.c (xfont_match): New function.
	(xfont_driver): Set xfont_driver.match to xfont_match.
	(xfont_draw): Set font in GC if necessary.

	* ftxfont.c (ftxfont_match): New function.
	(syms_of_ftxfont): Set ftxfont_driver.match to ftxfont_match.

	* xftfont.c (xftfont_match): New function.
	(syms_of_xftfont): Set xftfont_driver.match to xftfont_match.

2008-02-01  Kenichi Handa  <handa@m17n.org>

	* font.h (struct font): New member scalable.
	(struct font_driver): New arg ALTERANTE_SUBST to otf_gsub.
	(font_otf_gsub): Adjust prototype.

	* font.c (font_otf_capability): Fix handling of the default langsys.
	(parse_gsub_gpos_spec): Change type to void.  New arg nbytes.
	Check the contents of SPEC.
	(LGSTRING_HEADER_SIZE, LGSTRING_GLYPH_SIZE): New macros.
	(check_gstring): New function.
	(REPLACEMENT_CHARACTER): New macro.
	(font_otf_gsub): New arg alternate_subst.  Be sure to set all
	glyph codes of GSTRING.
	(font_otf_gpos): Be sure to set all glyph codes of GSTRING.
	(font_prepare_composition): Set cmp->glyph_len.
	(font_open_entity): Set font->scalable.
	(Ffont_get): Handle :otf property.
	(Ffont_otf_gsub, Ffont_otf_gpos, Ffont_otf_alternates): New
	functions.
	(Fquery_font): Use font->font.full_name.
	(syms_of_font): Defsubr Sfont_otf_gsub, Sfont_otf_gpos, and
	Sfont_otf_alternates.

	* ftfont.c (ftfont_open): Set font->font.full_name and
	font->font.name properly.  Fix calculation of font->font.height
	and font->min_width.

	* ftxfont.c (ftxfont_create_gcs): New function.
	(ftxfont_draw_bitmap): Fix arg to ftfont_driver.get_bitmap.
	(ftxfont_draw_backgrond): Fix filling region.
	(ftxfont_default_fid): New function.
	(ftxfont_open): Set xfotn->fid to the return value of
	ftxfont_default_fid.
	(ftxfont_prepare_face): Use ftxfont_create_gcs to create GCs.
	(ftxfont_done_face): Free only GCs that are created by
	ftxfont_create_gcs.
	(ftxfont_draw): If face->gc != s->gc, create proper GCs.

	* xterm.c (x_set_glyph_string_clipping_exactly) [USE_FONT_BACKEND]:
	Clip to src->width, etc (not src->clip_XXX).

	* xfns.c (x_create_tip_frame) [USE_FONT_BACKEND]: Handle
	FontBackend frame parameter.

2008-02-01  Kenichi Handa  <handa@m17n.org>

	* font.h (struct font_driver_list): New member `on'.
	(Fclear_font_cache): EXFUN it.
	(font_update_drivers): Extern it.

	* font.c (font_unparse_fcname): Fix typo (swidth->width).
	(font_list_entities): Check driver_list->on.
	(register_font_driver): Initalize `on' member to 0.
	(font_update_drivers): New function.
	(Fclear_font_cache): Check driver_list->on.

	* frame.h (Qfont_backend): Extern it.
	(x_set_font_backend): Extern it.

	* frame.c (Qfont_backend): New variable.
	(frame_parms): New element for font-backend.
	(x_set_font_backend): New function.

	* xfns.c (Fx_create_frame) [USE_FONT_BACKEND]: Handle
	FontBackend frame parameter.
	(x_frame_parm_handlers) [USE_FONT_BACKEND]: New element
	x_set_font_backend.

	* xfont.c (xfont_list): Don't try listing by :name property if the
	name is not for XLFD.

2008-02-01  Kenichi Handa  <handa@m17n.org>

	* font.h (LGLYPH_FROM, LGLYPH_TO, LGLYPH_SET_FROM)
	(LGLYPH_SET_TO): New macros.
	(LGLYPH_XOFF, LGLYPH_YOFF, LGLYPH_WADJUST): Check if adjustment
	element of G is vector or not.
	(font_at): Extern it.

	* font.c: Include window.h.
	(font_lispy_object): New function.
	(font_prepare_composition): Check LGLYPH_FORM (g) to detect the
	end of valid glyph.
	(font_close_object): Fix getting (struct font *).
	(font_at): New function.
	(Ffont_get): If FONT is a font-object, get entity from it.
	(Ffont_make_gstring): Initialize elements of glyphs with nil.
	(Ffont_fill_gstring): Use macro LGSTRING_XXX and LGLYPH_XXX.  Fix
	range check.
	(Ffont_at): New function.
	(syms_of_font): Defsubr Sfont_at.

	* xdisp.c (it_props): Move the entry for Qauto_composed to just
	before the entry for Qcomposition.
	(handle_auto_composed_prop): Call auto-composition-function with 4 args.
	(handle_composition_prop) [USE_FONT_BACKEND]: Set it->face_id from
	the font in gstring.
	(fill_composite_glyph_string) [USE_FONT_BACKEND]: Check
	LGLYPH_FORM (g) to detect the end of valid glyph.
	(x_produce_glyphs) [USE_FONT_BACKEND]: Don't update it->face_id if
	we are composing with gstring.

	* xterm.c (x_draw_composite_glyph_string_foreground) [USE_FONT_BACKEND]:
	Check if adjustment is vector or not.

	* Makefile.in (font.o): Make it depends on window.h.

2008-02-01  Kenichi Handa  <handa@m17n.org>

	* xterm.c (x_draw_composite_glyph_string_foreground): Check if
	adjustment is vector or not.

2008-02-01  Miles Bader  <miles@gnu.org>

	* character.h (CHECK_CHARACTER): Redefine in terms of CHECK_TYPE.

2008-02-01  Kenichi Handa  <handa@m17n.org>

	* font.h (LGLYPH_XOFF, LGLYPH_YOFF, LGLYPH_WIDTH, LGLYPH_WADJUST)
	(LGLYPH_SET_WIDTH): Adjusted for the change of LGLYPH format.
	(LGLYPH_ADJUSTMENT, LGLYPH_SET_ADJUSTMENT): New macros.

	* font.c (font_merge_old_spec): Treat '*' in foundry as a wild card.
	(DEVICE_DELTA): Fix typo.
	(font_otf_gpos, font_prepare_compositio): Adjust for the change of
	LGLYPH format.

	* xterm.c (x_draw_composite_glyph_string_foreground): Adjust for
	the change of LGLYPH format.

2008-02-01  Kenichi Handa  <handa@m17n.org>

	* ftfont.c (ftfont_list): Fix typo.
	(ftfont_build_basic_charsets): Don't include letters with diacritics.

2008-02-01  Jan Dj,Ad(Brv  <jan.h.d@swipnet.se>

	* xfaces.c (realize_non_ascii_face): Set face->extra to NULL.

	* xftfont.c (xftfont_done_face): Call XftDrawDestroy only if
	xftface_info is non-NULL.

2008-02-01  Kenichi Handa  <handa@m17n.org>

	* ftfont.c (ftfont_list): Fix typo.
	(ftfont_build_basic_charsets): Don't include letters with diactrics.

2008-02-01  Jan Dj,Ad(Brv  <jan.h.d@swipnet.se>

	* ftfont.c (ftfont_list): Move misplaced #endif.

2008-02-01  Kenichi Handa  <handa@m17n.org>

	* ftfont.c (ftfont_list): Pay attention to the case that
	FC_CAPABILITY is not defined.

2008-02-01  Kenichi Handa  <handa@m17n.org>

	* xftfont.c (xftfont_open): Set charset related members to -1.

	* ftfont.c (ftfont_list): Handle QCotf property.  Fix handling of
	QCname.
	(ftfont_open): Set charset related members to -1.

	* fontset.c (Votf_script_alist): New variable.
	(syms_of_fontset): Initialize it.
	(fontset_font): Delete unused variable.

	* fontset.h (Votf_script_alist): Extern it.

	* font.c (font_find_for_lface): Optimize code.

	* font.h (font_close_object, font_merge_old_spec): Extern them.

2008-02-01  Kenichi Handa  <handa@m17n.org>

	* font.c (QCscalable, Qc, Qm, Qp, Qd): New variables.
	(syms_of_font): Initialize them.
	(font_pixel_size): Allow float value in dpi.
	(font_prop_validate_type): Delete.
	(font_prop_validate_symbol, font_prop_validate_style): Change argument.
	Change caller.
	(font_prop_validate_non_neg): Rename from font_prop_validate_size.
	(font_prop_validate_extra): Delete.
	(font_prop_validate_spacing): New function.
	(font_property_table): Add elements for all known properties.
	(get_font_prop_index): Rename from check_font_prop_name.  New
	argument FROM.  Change caller.
	(font_prop_validate): Validate all known properties.
	(font_put_extra): Delete argument force.  Change caller.
	(font_expand_wildcards): Make it static.  Fix the way of shrinking
	the possible range.
	(font_parse_xlfd): Delete argument merge.  Fix handling of RESX,
	RESY, SPACING, and AVGWIDTH.  Don't validate property values here.
	Change caller.
	(font_unparse_xlfd): Handle dpi, spacing, and scalable properties.
	(font_parse_fcname): Delete argument merge.  Fix parsing of point
	size.  Don't validate properties values here.  Change caller.
	(font_unparse_fcname): Handle dpi, spacing, and scalable properties.
	(font_open_by_name): Delete unused variable.
	(Ffont_spec): Likewise.  Validate property values.
	(Ffont_match_p): New function.

	* font.h (QCscalable): Extern it.
	(font_parse_xlfd, font_parse_fcname): Adjust prototype.

	* ftfont.c (ftfont_list): Handle properties dpi, spacing, and scalable.

	* xfont.c (xfont_query_font): Adjust for the change of font_parse_xlfd.
	(xfont_list_pattern): New function.
	(xfont_list): Use xfont_list_pattern.

2008-02-01  Kenichi Handa  <handa@m17n.org>

	* font.h (Flist_fonts): EXFUN it.

2008-02-01  Jason Rumney  <jasonr@gnu.org>

	* w32term.c (w32_initialize): Add back smoothing_type and
	smoothing_enabled definitions.

2008-02-01  Kenichi Handa  <handa@m17n.org>

	* xterm.c (x_draw_glyph_string) [USE_FONT_BACKEND]: Check
	s->face->font on determining underline position.

2008-02-01  Kenichi Handa  <handa@m17n.org>

	* font.c (font_parse_xlfd): Fix generating of CHARSET_REGISTRY field.
	(font_has_char): Accept font-object too.
	(font_find_for_lface): Try at first with a size specified in face.

2008-02-01  Kenichi Handa  <handa@m17n.org>

	* frame.c (x_set_font) [USE_FONT_BACKEND]: Fix argument to
	font_open_by_name.

2008-02-01  Kenichi Handa  <handa@m17n.org>

	* font.h (QCspacing, QCdpi): Extern them.
	(enum font_spacing): New enum.
	(FONT_PIXEL_SIZE_QUANTUM): New macro.

	* font.c (POINT_TO_PIXEL): Don't divice POINT by 10.
	(QCspacing, QCdpi): New variables.
	(syms_of_font): Initialize them.
	(font_pixel_size): New function.
	(font_put_extra): New function.
	(font_parse_xlfd): Fix handling of font size.  Add QCdpi property
	in FONT_EXTRA.
	(font_parse_fcname): Handle enumenrated values (e.g. bold).  Fix
	handling font size.  Add QCname property that contains only
	unknown properties.
	(font_score): Change argument.  Change caller.  Pay attention to
	FONT_PIXEL_SIZE_QUANTUM.
	(font_sort_entites, font_list_entities, font_find_for_lface)
	(font_open_for_lface, font_open_by_name): Fix handling of font size.
	(Ffont_spec): Add QCname property that contains only unknown properties.

	* ftfont.c (ftfont_list): Use assq_no_quit, not Fassq.  Don't
	include weight in listing pattern, instead check weight of each
	listed font.  Don't include scalable in pattern.  Pay attention to
	FONT_PIXEL_SIZE_QUANTUM.

2008-02-01  Kenichi Handa  <handa@m17n.org>

	* font.c (font_parse_fcname): Fix parsing of point-size.
	(font_unparse_fcname): Produce symbolic names for style properties.
	(font_list_entities): Handle float size correctly.
	(font_open_by_name): Prefer `normal' property values if the name
	doesn't specify them.

	* fontset.c (Finternal_char_font): Use font_get_name, not
	Ffont_xlfd_name.

	* ftfont.c (ftfont_pattern_entity): Use the numeric value 100 for
	FC_WEIGHT_REGULAR.  Exclude FC_SIZE and FC_PIXEL_SIZE from listing
	pattern.  Don't force scalable.

	* xftfont.c (xftfont_open): For generating a name, start from
	96-byte buffer.

2008-02-01  Jan Dj,Ad(Brv  <jan.h.d@swipnet.se>

	* frame.h (x_new_fontset2): Fix prototype.

2008-02-01  Kenichi Handa  <handa@m17n.org>

	* font.h (struct font_driver): Delete member parse_name.
	(font_match_p, font_get_spec, font_parse_fcname)
	(font_unparse_fcname): Extern them.
	(font_get_name): Adjust prototype.

	* font.c (XLFD_SMALLNUM_MASK): Delete this macro.
	(XLFD_LARGENUM_MASK): Delete XLFD_ENCODING_MASK from it.
	(font_expand_wildcards): Fix handling ENCODING field.  Avoid
	unnecessary checks for weight, slant, and swidth.
	(font_parse_fcname): New function.
	(font_unparse_fcname): New function.
	(font_parse_name): New function.
	(font_match_p): New function.
	(font_get_name): Change return value to Lisp string.
	(font_get_spec): New function.
	(Qunspecified, Qignore_defface): Don't extern them.
	(font_find_for_lface): Assume that LFACE is fully specified.
	(font_load_for_face): If lface[LFACE_FONT_INDEX] is an font
	object, use it for FACE.
	(font_open_by_name): Call Ffont_spec with QCname prop.  Don't call
	driver->parse_name.
	(Ffont_spec): Call font_parse_name, not font_parse_xlfd.

	* fontset.h (new_fontset_from_font) [USE_FONT_BACKEND]: Adjust
	prototype.

	* fontset.c (new_fontset_from_font) [USE_FONT_BACKEND]: Delete
	argument F.  Don't call Fnew_fontset.  Instead, directly call
	make_fontset.

	* frame.h (x_new_fontset2) [USE_FONT_BACKEND]: Adjust prototype.

	* frame.c (x_set_font) [USE_FONT_BACKEND]: Adjust for the change
	of x_new_fontset2.

	* ftfont.c (Qmonospace, Qsans_serif, Qserif, Qmono, Qsans)
	(Qsans__serif): New variables.
	(ftfont_generic_family_list): New variable.
	(syms_of_ftfont): Initialize the above variables.
	(ftfont_pattern_entity): Delete argument NAME.
	(ftfont_list_generic_family): New function.
	(ftfont_parse_name): Delete this function.
	(ftfont_list): Try generic family only when FcFontList found no font.
	(ftfont_list_family): Fix args to FcObjectSetBuild.

	* xfaces.c (check_lface_attrs) [USE_FONT_BACKEND]: Accept font
	object in attrs[LFACE_FONT_INDEX].
	(set_lface_from_font_name): Cancel all changes for font-backend.
	(set_lface_from_font_and_fontset) [USE_FONT_BACKEND]: New
	function.
	(Finternal_set_lisp_face_attribute) [USE_FONT_BACKEND]: Accept a
	font object in QCfont attribute.
	(set_font_frame_param) [USE_FONT_BACKEND]: Likewise.
	(realize_default_face) [USE_FONT_BACKEND]: Call
	set_lface_from_font_and_fontset.

	* xfns.c (x_default_font_parameter) [USE_FONT_BACKEND]: Try also
	"fixed", and signal error here if no suitable font was found.

	* xfont.c (xfont_parse_name): Delete this function.

	* xftfont.c (xftfont_open): Change coding style of error
	handling.  Generate fontconfig's fontname pattern.

	* xterm.h (struct x_output) [USE_FONT_BACKEND]: New member fontp.
	(FRAME_FONT_OBJECT) [USE_FONT_BACKEND]: New macro.

	* xterm.c (x_new_fontset2) [USE_FONT_BACKEND]: Change arguments.
	Both args FONTSET and FONT_OBJECT must be existing ones.

2008-02-01  YAMAMOTO Mitsuharu  <mituharu@math.s.chiba-u.ac.jp>

	* macterm.c (mac_set_unicode_keystroke_event): Don't use MAKE_CHAR.

2008-02-01  Kenichi Handa  <handa@m17n.org>

	* xfont.c (xfont_open, xfont_encode_char): Fix typo.

	* font.h (struct font): Fix typo.

	* font.c (enum xlfd_field_index): Rename XLFD_XXX_SIZE_INDEX to
	XLFD_XXX_INDEX.
	(enum xlfd_field_mask): New enum.
	(intern_font_field): Changed argument.  Change caller.  If digits
	are followed by non-digits, return a symbol.
	(font_expand_wildcards): New function.
	(font_parse_xlfd): Fix wildcard handling.
	(Ffont_spec): If :name is specified, reflect the info in the other
	properties.

	* ftfont.c (ftfont_pattern_entity): Fix typo.
	(ftfont_list): Enforce FC_LANG in PATTERN to cancel the effect of
	locale.

2008-02-01  Kenichi Handa  <handa@m17n.org>

	* font.h (Qiso8859_1, Qiso10646_1, Qunicode_bmp): Extern them.

	* font.c (Qiso8859_1, Qiso10646_1, Qunicode_bmp): Move from ftfont.c.
	(font_unparse_xlfd): Fix argument type declaration.  Append "*" if
	registry doesn't specify encoding part.
	(font_find_for_lface): Pay attention to LFACE_FONT_INDEX.
	(font_open_by_name): At first try parsing the name.
	(syms_of_font): Declare Qiso8859_1, Qiso10646_1, and Qunicode_bmp
	as Lisp symbols.

	* fontset.c (reorder_font_vector): Pay attention to the case that
	the 3rd element of font_def is nil.
	(fontset_font): For the default fontset, append one more fontset
	elements for a script-based font specification.  Don't add script
	attribute on finding a font.
	(new_fontset_from_font): Unconditionally set FONTSET_ASCII to the
	font name.
	(fontset_ascii_font): If a font can't be opened, return nil.

	* ftfont.c (Qiso8859_1, Qiso10646_1, Qunicode_bmp): Move to font.c.
	(ftfont_pattern_entity): New function.
	(ftfont_get_cache): Assume that freetype_font_cache is already
	initialized.
	(ftfont_list): Handle the case that a file is specified in font
	name.  Use ftfont_pattern_entity to generate entities.
	(ftfont_has_char): Check if the pattern contains FC_CHARSET.
	(syms_of_ftfont): Initialize freetype_font_cache.

	* xftfont.c (xftfont_open): Make the font name fontconfig's
	style.  Add BLOCK_INPUT and UNBLOCK_INPUT.
	(xftfont_close): Free font->font.name if not NULL.

	* xfont.c (xfont_list): If script is specified for a font, return
	null_vector.
	(xfont_list_family): Declare argument type.

	* xfaces.c (set_lface_from_font_name): If a font doesn't have a
	name, set LFACE_FONT (lface) to nil.

	* xterm.c (x_new_fontset2): If an ASCII font couldn't be loaded,
	return Qnil.

2008-02-01  Kenichi Handa  <handa@m17n.org>

	* emacs.c (main): Check -enable-font-backend arg after the check of -nl.
	(standard_args): Add "-enable-font-backend".

2008-02-01  Kenichi Handa  <handa@m17n.org>

	* xftfont.c (xftfont_default_fid): Set fid_known to 1.
	(struct xftdraw_list, xftdraw_list): Delete them.
	(register_xftdraw, check_xftdraw): Delete them.
	(xftfont_prepare_face): Don't call register_xftdraw.
	(xftfont_done_face): Don't call check_xftdraw.
	(xftfont_draw): Get backroudn color only when with_background is
	nonzero.

	* xfont.c (xfont_encode_char): Fix calculation of char2b.

2008-02-01  Kenichi Handa  <handa@m17n.org>

	These changes are for the new font handling codes.

	* Makefile.in (ALL_CFLAGS): Add @FREETYPE_CFLAGS@,
	@FONTCONFIG_CFLAGS@, and @LIBOTF_CFLAGS@.
	(LIB_X11_LIB): If HAVE_XFT is defined, set to @XFT_LIBS@.
	(FONTSRC, FONTOBJ): New variables.
	(obj): Add $(FONTOBJ).
	(SOME_MACHINE_OBJECTS): Lib_X11_Lib.
	(LIBES): Add @FREETYPE_LIBS@, @FONTCONFIG_LIBS@, and
	@LIBOTF_LIBS@.
	(font.o, ftfont.o, xfont.o, xftfont.o, ftxfont.o): New targets.
	(fontset.o, xdisp.o, xfaces.o, xfns.o, xterm.o): Depend on $(FONTSRC).

	* font.h, font.c, xfont.c, ftfont.c, xftfont.c, ftxfont.c: New files.

	* character.h (Vscript_representative_chars): Extern it.

	* character.c (Vscript_representative_chars): New variable.
	(syms_of_character): Declare it as a Lisp variable.

	* composite.c (get_composition_id) [USE_FONT_BACKEND]: If
	enable_font_backend is nonzero, accept the composition method
	COMPOSITION_WITH_GLYPH_STRING.

	* composite.h (enum composition_method) [USE_FONT_BACKEND]: New
	enumeration COMPOSITION_WITH_GLYPH_STRING.

	* dispextern.h (struct glyph_string) [USE_FONT_BACKEND]: New
	members clip_x, clip_y, clip_width, and clip_height.
	(struct face) [USE_FONT_BACKEND]: New members font_info and extra.

	* emacs.c (main) [USE_FONT_BACKEND]: Handle arg
	--enable-font-backend.  Call syms_of_font.

	* fns.c (assoc_no_quit): New function.

	* fontset.h (FONT_INFO_FROM_FACE): New macro.
	(face_for_font, new_fontset_from_font)
	(fontset_ascii_font) [USE_FONT_BACKEND]: Extern them.

	* fontset.c [USE_FONT_BACKEND]: Include "font.h".
	(fontset_font, fontset_ascii, face_for_char)
	(make_fontset_for_ascii_face, Ffont_info)
	(Finternal_char_font) [USE_FONT_BACKEND]: If enable_font_backend
	is nonzero, use font-backend mechanism.
	(find_font_encoding): Make it non-static.
	(new_fontset_from_font, fontset_ascii_font) [USE_FONT_BACKEND]:
	New functions.

	* frame.h (struct frame): New members resx and resy.
	(struct frame) [USE_FONT_BACKEND]: New member font_driver_list.
	(x_new_fontset2) [USE_FONT_BACKEND]: Extern it.

	* frame.c [USE_FONT_BACKEND]: Include "font.h".
	(make_frame, x_set_font) [USE_FONT_BACKEND]: Use font-backend mechanism.

	* lisp.h (assoc_no_quit): Extern it.

	* xdisp.c: If USE_FONT_BACKEND is defined, include "font.h".
	Through out the file, use FONT_INFO_FROM_FACE instead of
	FONT_INFO_FROM_ID, use get_per_char_metric instead of
	rif->per_char_metric.
	(handle_composition_prop) [USE_FONT_BACKEND]: If the composition
	method is COMPOSITION_WITH_GLYPH_STRING, just set it->c to ' '.
	(get_glyph_face_and_encoding, fill_composite_glyph_string)
	(get_char_face_and_encoding, BUILD_COMPOSITE_GLYPH_STRING)
	(x_produce_glyphs) [USE_FONT_BACKEND]: If enable_font_backend is
	nonzero, use font-backend mechanism.
	(get_per_char_metric): New function.

	* xfaces.c [USE_FONT_BACKEND]: Include "font.h".
	(set_lface_from_font_name)
	(set_font_frame_param, free_realized_face)
	(prepare_face_for_display, clear_face_gcs)
	(Finternal_set_font_selection_order, realize_x_face)
	[USE_FONT_BACKEND]: If enable_font_backend is nonzero, use
	font-backend mechanism.
	(clear_face_cache) [USE_FONT_BACKEND]: Don't call clear_font_table.
	(load_face_font) [USE_FONT_BACKEND]: Abort.
	(face_symbolic_value, face_symbolic_weight, face_symbolic_slant)
	(face_symbolic_swidth, face_for_font) [USE_FONT_BACKEND]: New functions.

	* xfns.c [USE_FONT_BACKEND]: Include "font.h".
	(x_default_font_parameter) [USE_FONT_BACKEND]: New function.
	(Fx_create_frame) [USE_FONT_BACKEND]: If enable_font_backend is
	nonzero, register all available font drivers.  Call
	x_default_font_parameter for deciding a font.
	(x_create_tip_frame) [USE_FONT_BACKEND]: Likewise.

	* xterm.c [USE_FONT_BACKEND]: Include "font.h".
	(x_set_mouse_face_gc, x_set_glyph_string_clipping)
	(x_set_glyph_string_clipping_exactly)
	(x_compute_glyph_string_overhangs)
	(x_draw_glyph_string_foreground)
	(x_draw_composite_glyph_string_foreground, x_draw_glyph_string)
	(x_free_frame_resources) [USE_FONT_BACKEND]: If
	enable_font_backend is nonzero, use font-backend mechanism.
	(x_new_fontset2) [USE_FONT_BACKEND]: New function.

2008-02-01  Kenichi Handa  <handa@m17n.org>

	* coding.c (coding_inherit_eol_type): If PARENT is nil, inherit from
	system_eol_type.
	(syms_of_coding): Initialize system_eol_type.

	* process.c (Fset_process_coding_system): Inherit system's eol
	format if necessary.

2008-02-01  YAMAMOTO Mitsuharu  <mituharu@math.s.chiba-u.ac.jp>

	* macgui.h (USE_ATSUI): Don't enable on emacs-unicode-2 branch.

2008-02-01  Kenichi Handa  <handa@m17n.org>

	* coding.c (decode_eol): Pay attention to buffer relocation in
	del_range_2.
	(decode_coding): Call decode_eol before restoring undo_list.

2008-02-01  Kenichi Handa  <handa@m17n.org>

	* charset.c (Fdefine_charset_internal): Fix setting of
	emacs_mule_bytes.

2008-02-01  Kenichi Handa  <handa@m17n.org>

	* keyboard.c (read_char): Check if C is a character or not before
	looking up Vkeyboard_translate_table.

2008-02-01  Kenichi Handa  <handa@m17n.org>

	* coding.c (DECODE_EMACS_MULE_20_RELATIVE_COMPOSITION): Fix
	condition to terminate the loop.

2008-02-01  Kenichi Handa  <handa@m17n.org>

	* coding.c (produce_composition): Compare charbuf[i] instead of
	args[i] against 0.
	(Fterminal_coding_system): Use EQ to compare Lisp objects.

2008-02-01  Kenichi Handa  <handa@m17n.org>

	* coding.c (DECODE_COMPOSITION_START): If the source is short, set
	coding->result to CODING_RESULT_INSUFFICIENT_SRC.
	(decode_coding_gap): Set CODING_MODE_LAST_BLOCK after the call of
	detect_coding.
	(emacs_mule_char): Handle old style (Emacs 20) component character
	of a composition.
	(DECODE_EMACS_MULE_COMPOSITION_RULE_20)
	(DECODE_EMACS_MULE_20_RULEBASE_COMPOSITION): Fix parsing a
	composition rule.
	(decode_coding_emacs_mule): Handle invalid bytes correctly.

2008-02-01  Kenichi Handa  <handa@m17n.org>

	* coding.c (encode_coding_ccl): Allocate destination dynamically
	when necessary.

2008-02-01  Kenichi Handa  <handa@m17n.org>

	* ccl.c (Fccl_execute_on_string): Fix the condition of terminating
	the loop.  When quitted, show a proper error message.

2008-02-01  Kenichi Handa  <handa@m17n.org>

	* xterm.c (x_set_glyph_string_clipping_exactly): Set
	src->clip_head and src->clip_tail temporarily instead of src->hl.

	* ccl.c (CCL_WRITE_STRING): Handle a flag bit for multibyte
	character sequence.
	(Fccl_execute_on_string): Use ASET, not XSET.

2008-02-01  Kenichi Handa  <handa@m17n.org>

	* search.c (search_buffer): Fix handling of "\\" in a trivial regexp.

2008-02-01  Kenichi Handa  <handa@m17n.org>

	* coding.c (decode_coding): Fix the condition of terminating the
	decoding loop.

2008-02-01  Kenichi Handa  <handa@m17n.org>

	* data.c (Faset): On setting a character bigger than 255 in a
	unibyte string, signal an error instead of make the string multibyte.

2008-02-01  Kenichi Handa  <handa@m17n.org>

	* charset.c (map_charset_chars): Fix for ascii-compatible charset
	made by a mapping table.

2008-02-01  Kenichi Handa  <handa@m17n.org>

	* xdisp.c (fill_composite_glyph_string): Check s->face is NULL or
	not.
	(BUILD_COMPOSITE_GLYPH_STRING): If C is TAB, set s->face to NULL.
	(x_produce_glyphs): If CH is TAB, set cmp->offsets properly.

	* xterm.c (x_draw_composite_glyph_string_foreground): Check
	s->face is NULL or not.

2008-02-01  Kenichi Handa  <handa@m17n.org>

	* xterm.c (x_set_glyph_string_clipping_exactly): New function.
	(x_draw_glyph_string): Fix drawing of right_overhang and
	left_overhang around/on cursor.

	* xdisp.c (draw_glyphs): Fix inclusion of right_overwriting glyphs.

2008-02-01  Kenichi Handa  <handa@m17n.org>

	* xdisp.c (x_produce_glyphs): Handle composition with TAB.

2008-02-01  Kenichi Handa  <handa@m17n.org>

	* coding.c (Fdefine_coding_system_internal)
	(Fdefine_coding_system_alias): Avoid a duplicated element in
	Vcoding_system_alist.

2008-02-01  Kenichi Handa  <handa@m17n.org>

	* xterm.c (handle_one_xevent): Handle keysyms 0x1000000..0x10000FF.

	* coding.c (Qcoding_system_define_form): New variable.
	(syms_of_coding): Intern and staticpro it.
	(Fcoding_system_p): Check Qcoding_system_define_form.
	(Fcheck_coding_system): Try to autoload the definition of CODING-SYSTEM.

	* coding.h (CODING_SYSTEM_P): If ID is not available, call
	Fcoding_system_p.
	(CHECK_CODING_SYSTEM): If ID is not available, call
	Fcheck_coding_system.
	(CHECK_CODING_SYSTEM_GET_SPEC, CHECK_CODING_SYSTEM_GET_ID):
	Try also Fcheck_coding_system.

2008-02-01  Kenichi Handa  <handa@m17n.org>

	* coding.c (code_conversion_restore): GCPRO arg.

2008-02-01  Kenichi Handa  <handa@m17n.org>

	* character.c (lisp_string_width): Check multibyteness of STRING.

2008-02-01  YAMAMOTO Mitsuharu  <mituharu@math.s.chiba-u.ac.jp>

	* macterm.c (mac_encode_char): Call ccl_driver with the last arg
	Qnil.  Use JIS_TO_SJIS instead of ENCODE_SJIS.
	(decode_mac_font_name): Use decode_coding_c_string instead of
	decode_coding.
	(x_load_font): Initialize fontp->fontset to -1.  Set
	fontp->encoding_type.

2008-02-01  Kenichi Handa  <handa@m17n.org>

	* search.c (search_buffer): Give up BM search on case-fold-search
	if one of a target character has a case-equivalence of different
	byte length even if that target charcter is an ASCII.
	(simple_search): Fix calculation of byte length of matched text.
	(boyer_moore): Fix handling of case-equivalent multibyte characters.

2008-02-01  Kenichi Handa  <handa@m17n.org>

	* coding.c (decode_coding): Fix handling of invalid bytes.

2008-02-01  Kenichi Handa  <handa@m17n.org>

	* xterm.c (handle_one_xevent): Handle keysyms directly mapped to
	Unicode characters.

2008-02-01  Kenichi Handa  <handa@m17n.org>

	* coding.c (encode_coding_object): If a pre-write-conversion
	function makes a new buffer, kill it.

2008-02-01  Kenichi Handa  <handa@m17n.org>

	* coding.c (QCascii_compatible_p): New variable.
	(syms_of_coding): Initialize it.
	(ONE_MORE_BYTE, ONE_MORE_BYTE_NO_CHECK): Decrement `src' before
	calling string_char.
	(record_conversion_result): Add `default:' case.
	(coding_charset_list): Delete unused variable `coding_type'.
	(Fdefine_coding_system_internal): Add `ascii-compatible-p'
	property in the plist of the coding system.
	(Fcoding_system_put): Check QCascii_compatible_p.

2008-02-01  Miles Bader  <miles@gnu.org>

	* xfaces.c (Finternal_lisp_face_equal_p): Restore previously
	removed calculation of frame `f', as it's now used.

2008-02-01  Kenichi Handa  <handa@m17n.org>

	* Makefile.in (RUN_TEMACS): Include "-nl" if HAVE_SHM is defined.
	(emacs${EXEEXT}): Run $(RUN_TEMACS) unconditionally.
	(UNIDATA): New variable.
	(${lispsource}international/charprop.el): Depends on ${UNIDATA}.
	(bootstrap-emacs${EXEEXT}): Depends on charprop.el.  Run
	$(RUN_TEMACS) unconditionally.

2008-02-01  Kenichi Handa  <handa@m17n.org>

	* Makefile.in (temacs${EXEEXT}): Build charprop.el if necessary.
	(admindir): New variable.
	($(lispsource)international/charprop.el): New target.

2008-02-01  Miles Bader  <miles@gnu.org>

	* character.c (chars-in-region): Remove obsolete function.
	(syms_of_character): Remove its initialization.

2008-02-01  Benjamin Riefenstahl  <b.riefenstahl@turtle-trading.net>

	* w32select.c (validate_coding_system)
	(setup_windows_coding_system): New functions.
	(convert_to_handle_as_coded, Fw32_get_clipboard_data): Use
	setup_windows_coding_system.
	(setup_config, Fw32_get_clipboard_data): Use
	validate_coding_system.
	(Fx_selection_exists): Move call to setup_config to a place
	where signals are allowed.

	* lisp.h (Fcoding_system_base, Fcoding_system_eol_type)
	(Fcheck_coding_system): Add declarations.

2008-02-01  Kenichi Handa  <handa@m17n.org>

	* charset.c (load_charset_map_from_vector): Fix for the first iteration.

2008-02-01  YAMAMOTO Mitsuharu  <mituharu@math.s.chiba-u.ac.jp>

	* macfns.c (Fx_create_frame, x_create_tip_frame): Pass Lisp
	string as the second argument for x_new_fontset.

2008-02-01  Kenichi Handa  <handa@m17n.org>

	* coding.c (decode_coding_object): Use safe_call1 instead of call1.
	(encode_coding_object): Use safe_call instead of call2.

2008-02-01  Kenichi Handa  <handa@m17n.org>

	* fontset.c (Fset_fontset_font): Check family element of a given vector.

	* Makefile.in (lisp): Include charprop.el.

2008-02-01  YAMAMOTO Mitsuharu  <mituharu@math.s.chiba-u.ac.jp>

	* macfns.c (Fx_create_frame, x_create_tip_frame): Fix crash.
	Not sure if it's unnecessary.

2008-02-01  Steven Tamm  <steventamm@mac.com>

	* macfns.c (Fx_create_frame, x_create_tip_frame): ifdef'd out
	some possibly unnecessary fontset checking code that crashed
	when creating a new frame.

2008-02-01  Kenichi Handa  <handa@m17n.org>

	* xfaces.c (merge_faces): Fix argument to lookup_derived_face and
	lookup_face.

	* xdisp.c (Fformat_mode_line): Fix argument to lookup_named_face.

	* fringe.c (draw_fringe_bitmap_1): Fix argument to lookup_named_face.

2008-02-01  Kenichi Handa  <handa@m17n.org>

	* coding.c: Cancel the change done in HEAD on 2008-02-01.
	(coding_charset_list): New function.

	* coding.h (coding_charset_list): Extern it.

2008-02-01  Kenichi Handa  <handa@m17n.org>

	* fontset.c (Fset_fontset_font): Call find_font_encoding with
	concatenation of family and registry.

2008-02-01  Kenichi Handa  <handa@m17n.org>

	* character.h (BYTE8_STRING): Fix typo.

	* editfns.c (Ftranslate_region_internal): Don't convert unibyte
	string to multibyte (sync to HEAD).

	* casefiddle.c (casify_region): Handle changes in byte-length
	using replace_range_2 (sync to HEAD).

2008-02-01  Andreas Schwab  <schwab@suse.de>

	* chartab.c (map_char_table): GCPRO table and arg.

2008-02-01  Kenichi Handa  <handa@m17n.org>

	* syntax.c (skip_syntaxes): Return lispy 0 (not nil) if point is
	already at limit.

2008-02-01  Kenichi Handa  <handa@m17n.org>

	* fontset.c (fs_load_font): Use fast_string_match_ignore_case
	instead of fast_c_string_match_ignore_case.
	(find_font_encoding): Change argument to Lisp_Object.  Use
	fast_string_match_ignore_case instead of
	fast_c_string_match_ignore_case.  Change caller.

2008-02-01  Kenichi Handa  <handa@m17n.org>

	* xdisp.c (get_next_display_element): In unibyte case, decide to
	display in octal form by checking a chacter by
	UNIBYTE_CHAR_HAS_MULTIBYTE_P.

	* charset.c (Fset_unibyte_charset): Setup unibyte_has_multibyte_table.

	* character.c (unibyte_has_multibyte_table): New variable.

	* character.h (unibyte_has_multibyte_table): Extern it.
	(UNIBYTE_CHAR_HAS_MULTIBYTE_P): New macro.

2008-02-01  Kenichi Handa  <handa@m17n.org>

	* coding.c (encode_coding_iso_2022): Fix handling of charset
	annotation.

2008-02-01  Kenichi Handa  <handa@m17n.org>

	* coding.c (setup_coding_system): If coding_system is nil, use
	Qundecided.
	(Fterminal_coding_system): Return nil if terminal coding system is
	`undecided'.
	(syms_of_coding): Define coding-system `undecided' here.  Setup
	terminal_coding as `undecided'.

2008-02-01  Kenichi Handa  <handa@m17n.org>

	* xdisp.c (message_dolog, set_message_1): Call
	unibyte_char_to_multibyte with arg type int.

	* lread.c (read1): Fix reading of a char-table.

	* print.c (print_object): Include sub char-table in cicularities
	detection.

2008-02-01  Kenichi Handa  <handa@m17n.org>

	* keymap.c (where_is_internal_2): Fix for the case that KEY is a
	cons.  Append the found sequences in car of ARGS instead of prepending.

2008-02-01  Kenichi Handa  <handa@m17n.org>

	* fileio.c (report_file_error): Make a unibyte string from
	strerror (errorno).
	(Fsubstitute_in_file_name): Fix the arg to
	unibyte_char_to_multibyte.  It is evaluated twice.

2008-02-01  Kenichi Handa  <handa@m17n.org>

	* charset.h (CHAR_CHARSET): Shortcut for ASCII case.

2008-02-01  Kenichi Handa  <handa@m17n.org>

	* coding.c (detect_coding_utf_16): Don't set detect_info->found if
	BOM is not found.
	(detect_coding, detect_coding_system): Optimization for ISO-2022
	when no 8-bit data is found.

2008-02-01  Jason Rumney  <jasonr@gnu.org>

	* w32fns.c (x_to_w32_font): Update to use new coding struct.

2008-02-01  Kenichi Handa  <handa@m17n.org>

	* charset.c (Fdeclare_equiv_charset, Fiso_charset): Fix handing of
	CHARS.

2008-02-01  Steven Tamm  <steventamm@mac.com>

	* macterm.c (mac_encode_char): Add charset argument and update
	to use encoding_type.
	(x_new_font,x_new_fontset): Merge in changes from xterm.c;
	switch to pure fontset.
	(decode_mac_font_name): Temporarily remove decoding.
	(x_font_name_to_mac_font_name): Temporarily remove encoding.
	(x_load_font): Temporarily remove encoding.

2008-02-01  Kenichi Handa  <handa@m17n.org>

	* xfaces.c (Fface_font): If frame is not on a window system,
	ignore CHARACTER arg.  If HAVE_WINDOW_SYSTEM is not defined, don't
	refer to face->font.
	(split_font_name_into_vector, build_font_name_from_vector)
	(lookup_non_ascii_face, realize_non_ascii_face): Define them only
	whne HAVE_WINDOW_SYSTEM is defined.

2008-02-01  Kenichi Handa  <handa@m17n.org>

	* xdisp.c (BUILD_GLYPH_STRINGS): Check if s is NULL.
	(x_produce_glyphs): Fix setting of members of cmp in case
	cmp->glyph_len is zero.

	* fontset.c (Fset_fontset_font): Fix docstring.
	(Ffontset_info): Make it backward compatible.  New arg ALL.

2008-02-01  Kim F. Storm  <storm@cua.dk>

	* process.c (read_process_output): Grow decoding_buf when needed;
	this could cause a crash in allocate_string and compact_small_strings.

2008-02-01  Kenichi Handa  <handa@m17n.org>

	* fileio.c (WRITE_BUF_SIZE): Delete this macro.

2008-02-01  Kenichi Handa  <handa@m17n.org>

	* coding.c (setup_coding_system): Set coding->common_flags
	correctly for raw-text.
	(consume_chars): On encoding unibyte text by raw-text, don't check
	multibyte form.
	(encode_coding): On encoding by raw-text, never use translation tables.

	* fileio.c (e_write): Short cut for the case of no encoding.

2008-02-01  Kenichi Handa  <handa@m17n.org>

	* coding.c (detect_coding, detect_coding_system): Delete unused
	variables.

2008-02-01  Kenichi Handa  <handa@m17n.org>

	* coding.c (encode_coding_utf_8): Fix handling of raw-byte char.
	(consume_chars): Fix handling of 8-bit bytes in unibyte source.

2008-02-01  Kenichi Handa  <handa@m17n.org>

	* coding.c (Ffind_coding_systems_region_internal): Include
	raw-text and no-conversion in the result.

2008-02-01  Kenichi Handa  <handa@m17n.org>

	* fontset.c (find_font_encoding): Return `ascii' for unknown encoding.
	(load_font_get_repertory): Delete unnecessary check of ENCODING of
	FONT_DEF.
	(font_def_arg, add_arg, from_arg, to_arg): New args.
	(set_fontset_font): Change argument.
	(Fset_fontset_font): Fix for the case that TARGET is a script
	name and charset name.
	(new_fontset_from_font_name): Fix argument to Fnew_fontset.

2008-02-01  Kenichi Handa  <handa@m17n.org>

	* fontset.c (fontset_font): Rename from fontset_face.  Change return
	value.
	(face_suitable_for_char_p, face_for_char): Adjust for the change
	of fontset_font.
	(make_fontset_for_ascii_face): Fix setting of the fontset element
	for ASCII.
	(Finternal_char_font): Use fontset_font instead of FACE_FOR_CHAR
	to get a font name.
	(Ffontset_info): Adjust for the change of fontset_font.

	* coding.c (emacs_mule_char): Check invalid code more regidly.

	* character.h (LEADING_CODE_LATIN_1_MIN)
	(LEADING_CODE_LATIN_1_MAX): Delete these macros.

2008-02-01  Kenichi Handa  <handa@m17n.org>

	* editfns.c (check_translation): New function.
	(Ftranslate_region_internal): Handle M:N mapping.

2008-02-01  Kenichi Handa  <handa@m17n.org>

	* xfaces.c (xlfd_point_size): Set font->numeric[XLFD_PIXEL_SIZE].

2008-02-01  Kenichi Handa  <handa@m17n.org>

	* coding.c (DECODE_DESIGNATION): Set chars_96 to -1 instead of
	goto invalid_code.
	(decode_coding_iso_2022): Fix handling of invalid designation.

	* fileio.c (Finsert_file_contents): Be sure to call unbind_to
	after calling code_conversion_save.

2008-02-01  Kenichi Handa  <handa@m17n.org>

	* xdisp.c (handle_auto_composed_prop): Fix Lisp_Object/int mixup.

	* print.c (print_prune_string_charset): Fix Lisp_Object/int mixup.

	* fontset.c: Include "intervals.h".
	(fontset_face): Fix comparing of Lisp_Objects.
	(free_face_fontset, new_fontset_from_font_name): Fix
	Lisp_Object/int mixup.

	* editfns.c (Ftranslate_region_internal): Fix Lisp_Object/int mixup.

	* coding.c: Add many prototypes for static functions.
	(get_translation_table): Allow max_lookup to be NULL.
	(decode_coding,Ffind_coding_systems_region_internal)
	(Funencodable_char_position, Fcheck_coding_systems_region): Call
	get_translation_table with max_lookup NULL.

2008-02-01  Kenichi Handa  <handa@m17n.org>

	* coding.c (get_translation_table): Declare it as Lisp_Object.
	(LOOKUP_TRANSLATION_TABLE): New macro.
	(produce_chars, consume_chars): Use LOOKUP_TRANSLATION_TABLE
	instead of CHAR_TABLE_REF.

2008-02-01  Kenichi Handa  <handa@m17n.org>

	* coding.c (MAX_ANNOTATION_LENGTH): Adjust for the change of
	annotation data format.
	(ADD_ANNOTATION_DATA, ADD_COMPOSITION_DATA, ADD_CHARSET_DATA):
	Change arguments FROM and TO to single argument NCHARS.  Change caller.
	(decode_coding_utf_8, decode_coding_utf_16, decode_coding_emacs_mule)
	(decode_coding_iso_2022, decode_coding_sjis, decode_coding_big5)
	(decode_coding_ccl, decode_coding_charset): Pay attention to
	coding->charbuf_used.
	(get_translation): New function.
	(produce_chars): New arguments translation_table and last_block.
	Translate characters here.  Return number of carryover chars.
	Change caller.
	(produce_composition): New argument pos.  Change caller.
	Adjust for the change of annotation data format.
	(produce_charset, produce_annotation): Likewise.
	(decode_coding, encode_coding): Don't call translate_chars.
	(consume_chars): New arg translation_table.  Change caller.
	(translate_chars): Delete.
	(syms_of_coding): Make translation-table's number of extra slots 2.

2008-02-01  Kenichi Handa  <handa@m17n.org>

	* search.c (simple_search): Fix setting this_pos_byte in backward
	search.

	* coding.c (detect_coding_emacs_mule): Fix counting of encoded
	byte sequence.
	(detect_coding_ccl): Fix setting of the variable valids.

2008-02-01  Kenichi Handa  <handa@m17n.org>

	* xterm.c (x_list_fonts): Fix the detection of an auto-scaled font.

	* coding.c (decode_coding_utf_16): Fix handling of surrogate pair.

	* editfns.c (Ftranslate_region_internal): Rename from
	Ftranslate_region.  Accept a char-table in TABLE.
	(syms_of_editfns): Defsubr Stranslate_region_internal.

	* xfaces.c (set_lface_from_font_name): If a font is specified for
	a frame, generate a fontset from the font.
	(build_scalable_font_name): If the scalable font is requested for
	a specific size, don't change that size.
	(try_font_list): Try a scalable font also in the case that a
	pattern string is specified.

2008-02-01  Kenichi Handa  <handa@m17n.org>

	* xfaces.c (Fface_font): New optional arg CHARACTER.

2008-02-01  Kenichi Handa  <handa@m17n.org>

	* charset.h (CHARSET_OFFSET): New macro.

2008-02-01  Kenichi Handa  <handa@m17n.org>

	* xterm.c (x_get_font_repertory): Fix for non-Unicode-bmp charset.

	* fontset.c (fontset_face): Handle the case that repertory is a
	char-table.
	(find_font_encoding): Return nil for unknown encoding.
	(Fset_fontset_font): Ignore a font of unknown encoding.

2008-02-01  Kenichi Handa  <handa@m17n.org>

	* keymap.c (describe_vector): Handle default value of a char table.

	* fontset.c (fontset_face): Handle fallback fonts correctly.
	(Ffontset_info): Return infomation about fallback fonts.

2008-02-01  Kenichi Handa  <handa@m17n.org>

	* fontset.c (FONTSET_DEFAULT): New macro.
	(FONTSET_ADD, fontset_add): Handle the case that range is nil.
	(Fset_fontset_font): Change the 2nd arg name to TARGET, and handle
	the case that it is nil.
	(dump_fontset): Call FONTSET_DEFAULT, not FONTSET_FALLBACK.
	(syms_of_fontset): Set char-table-extra-slots property of fontset to 9.

	* charset.h (CHAR_CHARSET_P): Fix for the case that the method is
	subset or superset.

2008-02-01  Kenichi Handa  <handa@m17n.org>

	* emacs.c (main): Call init_charset after syms_of_XXX.

	* charset.c (Vcharset_map_directory): Delete.
	(Vcharset_map_path): New variable
	(load_charset_map_from_file): Use Vcharset_map_path instead.
	(init_charset): Initialize Vcharset_map_path.
	(syms_of_charset): Delete declaration of "charset-map-directory",
	add declaration of "charset-map-path".

2008-02-01  Kenichi Handa  <handa@m17n.org>

	* fns.c (string_char_to_byte, string_byte_to_char): Optimize for
	ASCII only string.

	* fileio.c (Finsert_file_contents): Avoid detecting a code twice.

	* coding.c (detect_coding_iso_2022): Fix handling of SS2 and SS3.
	(detect_coding, detect_coding_system): Treat '\0' as normal ASCII byte..

2008-02-01  Kenichi Handa  <handa@m17n.org>

	* coding.h (SJIS_TO_JIS2, JIS_TO_SJIS2): New macros.

	* coding.c (QCmnemonic, QCdefalut_char)
	(QCdecode_translation_table, QCencode_translation_table)
	(QCpost_read_conversion, QCpre_write_conversion): New variables.
	(get_translation_table): Return a list of translation tables if
	necessary.
	(decode_coding): Call get_translation_table with ENCODEP 0.
	(char_encodable_p): If translation_table is non-nil, always call
	translate_char.
	(Fdefine_coding_system_internal): Accept list of translation
	tables as :encode-translation-table and :decode-translation-table.
	(Fcoding_system_put): New function.
	(syms_of_coding): Declare new symbols.  Defsubr
	Scoding_system_put.
	(decode_coding_sjis, encode_coding_sjis): Handle 4th charset,
	typically JISX0212.

	* charset.c (map_charset_chars): Fix arg to map_charset_chars in
	when the charset is superset type.

	* character.c (translate_char): Accept list of translation tables.

2008-02-01  Kenichi Handa  <handa@m17n.org>

	* coding.h (enum coding_attr_index): New member coding_attr_trans_tbl.
	(CODING_ATTR_TRANS_TBL): New macro.

	* coding.c (get_translation_table): New function.
	(translate_chars): Fix the bug of skipping annotation data.
	(decode_coding, encode_coding): Utilize get_translation_table.
	(char_encodable_p, Funencodable_char_position): Translate char if
	necessary.
	(Ffind_coding_systems_region_internal)
	(Fcheck_coding_systems_region): Setup translation table for encode
	in a coding system attribute vector in advance.
	(Fdefine_coding_system_internal): Allow a symbol as translation
	table.  For shift-jis type coding system, allow 4th charset.

2008-02-01  Kenichi Handa  <handa@m17n.org>

	* coding.c (decode_coding_sjis): Check the first byte rigidly.

	* xdisp.c (get_next_display_element): Pass -1 as POS to
	FACE_FOR_CHAR if displaying a C-string.

2008-02-01  Kenichi Handa  <handa@m17n.org>

	* composite.c (get_composition_id): Handle xoff and yoff in a
	composition rule.

	* composite.h (COMPOSITION_DECODE_RULE): New arg xoff and yoff.
	(struct composition): New member lbearing and rbearing.

	* xdisp.c (move_it_to): Optimize for the case (op & MOVE_TO_Y).
	(x_get_glyph_overhangs): Handle a composition glyph.
	(x_produce_glyphs): Setup lbearing and rbreaing for a composition glyph.

	* xterm.c (x_compute_glyph_string_overhangs): Handle also a
	composition glyph.

2008-02-01  Kenichi Handa  <handa@m17n.org>

	* print.c: Include charset.h.
	(Vprint_charset_text_property): New variable.
	(Qdefault): Extern it.
	(PRINT_STRING_NON_CHARSET_FOUND)
	(PRINT_STRING_UNSAFE_CHARSET_FOUND): New macros.
	(print_check_string_result): New variable.
	(print_check_string_charset_prop): New function.
	(print_prune_charset_plist): New variable.
	(print_prune_string_charset): New function.
	(print_object): Call print_prune_string_charset if
	Vprint_charset_text_property is not t.
	(print_interval): Print nothing if itnerval->plist is nil.
	(syms_of_print): Declare Vprint_charset_text_property as a lisp
	variable.  Init and staticpro print_prune_charset_plist.

2008-02-01  Kenichi Handa  <handa@m17n.org>

	* fontset.c (new_fontset_from_font_name): Use the specified font
	for all characters in the new fontset.

	* macterm.c (x_set_mouse_face_gc): Call FACE_FOR_CHAR with POS and
	OBJECT args.

	* xdisp.c (x_produce_glyphs): Call FACE_FOR_CHAR with POS and
	OBJECT args for composition too.

	* w32term.c (x_set_mouse_face_gc): Call FACE_FOR_CHAR with POS and
	OBJECT args.

2008-02-01  Kenichi Handa  <handa@m17n.org>

	* dispextern.h (FACE_FOR_CHAR): New args POS and OBJECT.

	* fontset.c (reorder_font_vector): Adjust for the change of
	FONT_DEF format.
	(fontset_face): New arg id.  Change caller.
	(face_for_char): New args pos and object.
	(make_fontset_for_ascii_face): Adjust for the change of FONT_DEF
	format.n
	(fs_query_fontset): Check NAME by Fassoc too.
	(Fset_fontset_font): Allow non-XLFD font name.
	(Ffontset_info): Adjust for the change of FONT_DEF format.

	* fontset.h (face_for_char): Adjust prototype.

	* xdisp.c (face_before_or_after_it_pos, get_next_display_element)
	(append_space, extend_face_to_end_of_line)
	(get_char_face_and_encoding, BUILD_COMPOSITE_GLYPH_STRING)
	(x_produce_glyphs): Call FACE_FOR_CHAR with POS and OBJECT args.

	* xfaces.c (compute_char_face): Call FACE_FOR_CHAR with
	POS and OBJECT args.

	* xterm.c (x_set_mouse_face_gc): Call FACE_FOR_CHAR with
	POS and OBJECT args.

2008-02-01  Jason Rumney  <jasonr@gnu.org>

	* w32select.c (Fw32_set_clipboard_data): Avoid potential realloc
	of GlobalAlloc'ed memory.

2008-02-01  Kenichi Handa  <handa@m17n.org>

	* ccl.c (Fccl_execute_on_string): Fix the condition of loop.

	* charset.h (charset_table_used): Delete extern.

	* charset.c (charset_table_used): Make it static.
	(map_charset_chars): Fix args to c_function with.

	* chartab.c (map_sub_char_table_for_charset): Fix args to
	c_function with.

	* coding.h (enum coding_result_code): Delete
	CODING_RESULT_INSUFFICIENT_CMP, add CODING_RESULT_INVALID_SRC.

	* coding.c (Qinsufficient_source, Qinconsistent_eol)
	(Qinvalid_source, Qinterrupted, Qinsufficient_memory): New variables.
	(Vlast_code_conversion_error): New variables.
	(syms_of_coding): DEFSYM or DEFVAR_LISP them.
	(ONE_MORE_BYTE): Record error if any instead of signaling an
	error.  If non-ASCII multibyte char is found, return the negative
	value of the code.  All callers changed to check it.
	(ONE_MORE_BYTE_NO_CHECK): Likewise.
	(record_conversion_result): New function.  Change all codes setting
	coding->result to call this function.
	(detect_coding_utf_8, decode_coding_utf_8)
	(detect_coding_emacs_mule, detect_coding_sji, detect_coding_big5):
	Don't use the local variable incomplete.
	(emacs_mule_char): Change the second arg to `const'.
	(decode_coding): Fix of flushing out unprocessed data.
	(make_conversion_work_buffer): Fix making of a work buffer.
	(decode_coding_object): Return coding->dst_object;

	* fontset.c (set_fontset_font): Fix args.

	* lisp.h (CHARACTERBITS): Define as 22.

	* process.c (send_process): Be sure to set coding->src_multibyte.

	* xdisp.c (handle_auto_composed_prop): Fix setting of limit.

2008-02-01  Kenichi Handa  <handa@m17n.org>

	* xdisp.c (handle_auto_composed_prop): Give limit to
	Fnext_single_char_property_change.

2008-02-01  Kenichi Handa  <handa@m17n.org>

	* composite.c (syms_of_composite): Don't make the composition hash
	table weak.

	* fontset.c (Fset_fontset_font): Fix docstring.

	* lisp.h (detect_coding_system): Adjust prototype.

	* fileio.c (kill_workbuf_unwind): Delete this function.
	(Finsert_file_contents): Adjust the call of detect_coding_system.
	Get conversion_buffer by code_conversion_save.  Use the macor
	CODING_MAY_REQUIRE_DECODING.  After decoding, update
	coding_system.

	* coding.h (make_conversion_work_buffer): Delete extern.
	(code_conversion_save): Extern it.

	* coding.c (enum iso_code_class_type): Delete ISO_carriage_return.
	(CODING_GET_INFO): Delete argument eol_type.  Change callers.
	(decode_coding_utf_8): Don't do eol converion.
	(detect_coding_utf_16): Check coding->src_chars, not
	coding->src_bytes.  Add heuristics for those that have no signature.
	(decode_coding_emacs_mule, decode_coding_iso_2022)
	(decode_coding_sjis, decode_coding_big5, decode_coding_charset):
	Don't do eol converion.
	(adjust_coding_eol_type): Return a new coding system.
	(detect_coding): Don't detect eol.  Fix for utf-16 detection.
	(decode_eol): In case of CRLF->LF conversion, use del_range_2 on
	each change.
	(decode_coding): Pay attention to undo_list.  Do eol convesion for
	all types of coding-systems (if necessary).
	(Vcode_conversion_work_buf_list): Delete it.
	(Vcode_conversion_reused_workbuf): Rename from
	Vcode_conversion_reused_work_buf.
	(Vcode_conversion_workbuf_name): New variable.
	(reused_workbuf_in_use): New variable.
	(make_conversion_work_buffer): Delete the arg DEPTH.
	(code_conversion_restore): Change argument to cons.
	(code_conversion_save): Delete the argument BUFFER.  Change callers.
	(detect_coding_system): New argument src_chars.  Change callers.
	Fix for utf-16 detection.
	(init_coding_once): Don't use ISO_carriage_return.
	(syms_of_coding): Initialize Vcode_conversion_workbuf_name and
	reused_workbuf_in_use.

2008-02-01  Kenichi Handa  <handa@m17n.org>

	* keymap.c (store_in_keymap): Pay attention to the case that idx
	is a cons specifying a character range.

2008-02-01  Kenichi Handa  <handa@m17n.org>

	* xdisp.c (handle_auto_composed_prop): Fix the case of returning
	HANDLED_RECOMPUTE_PROPS.

	* coding.c (Fdefine_coding_system_internal): Fix checking of
	ascii compatibility.

2008-02-01  Kenichi Handa  <handa@m17n.org>

	* charset.c (find_charsets_in_text): Delete unused locale variable.
	(Fset_charset_priority): Update Vemacs_mule_charset_list too.

	* coding.c (encode_coding_emacs_mule): Emit bytes with MSB.
	Resync charset_list to Vemacs_mule_charset_list.

	* keymap.c (store_in_keymap): Pay attention to the case that idx
	is a cons specifying a character range.

2008-02-01  Kenichi Handa  <handa@m17n.org>

	* composite.c (update_compositions): Bind inhibit-read-only, etc
	to t before calling remove-list-of-text-properties.

	* print.c (print_object): Always print ASCII chars as is.

2008-02-01  Kenichi Handa  <handa@m17n.org>

	* keymap.c (Fdefine_key): Fix handling of Lucid style event type list.

	* fns.c (Fmapconcat, Fmapcar, Fmapc): Signal an error if SEQUENCE
	is a char table.

2008-02-01  Kenichi Handa  <handa@m17n.org>

	* syntax.c (skip_chars): Be sure to alloca char_ranges when necessary.

2008-02-01  Kenichi Handa  <handa@m17n.org>

	* xfaces.c (set_lface_from_font_name): Fix for the case that
	FONTNAME is not fontset name.

2008-02-01  Kenichi Handa  <handa@m17n.org>

	* fns.c (base64_encode_1): Fix previous change.

2008-02-01  Kenichi Handa  <handa@m17n.org>

	* fontset.c (set_fontset_font): New function.
	(Fset_fontset_font): If a font is specified for a charset, use
	map_charset_chars to store the font spec in a fontset.

2008-02-01  Kenichi Handa  <handa@m17n.org>

	* fontset.c (fontset_face): Create a fallback fontset on demand
	(make_fontset): Don't create a fallback fontset here.
	(free_face_fontset): Free a fallback fontset (if any) too.
	(n_auto_fontsets): Delete this variable.
	(auto_fontset_alist): New variable.
	(new_fontset_from_font_name): Check auto_fontset_alist.
	(dump_fontset) [FONTSET_DEBUG]: Fully re-written.
	(Ffontset_list_all) [FONTSET_DEBUG]: New function.
	(syms_of_fontset): Initialize and staticpro auto_fontset_alist.
	Defsubr Sfontset_list_all.

2008-02-01  Kenichi Handa  <handa@m17n.org>

	* xterm.c (x_list_fonts): Fix excluding of auto-scaled fonts.

2008-02-01  Kenichi Handa  <handa@m17n.org>

	* fontset.c (Fnew_fontset): Check NAME more rigidly.

2008-02-01  Kenichi Handa  <handa@m17n.org>

	* editfns.c (Fgoto_char): Fix docstring.

2008-02-01  Kenichi Handa  <handa@m17n.org>

	* insdel.c (insert_from_gap): Adjust intervals correctly.

2008-02-01  Jason Rumney  <jasonr@gnu.org>

	* w32term.c (GLYPHSET, WCRANGE): Define if system headers don't.
	(pfnGetFontUnicodeRanges): New dynamically loaded function.
	(w32_initialize): Try to load it.
	(x_get_font_repertory): Use it if available.
	(w32_encode_char): Add shortcut for unicode output.

	* w32fns.c (w32_load_system_font): Default charset to -1.
	(x_to_w32_charset): Match all fonts for unicode.
	(w32_to_x_charset): New parameter matching.  Don't return partial
	or wildcard charsets.
	(w32_to_all_x_charsets): Don't return partial or wildcard charsets.
	(w32_codepage_for_font): Return CP_UNICODE for unicode.
	(w32_to_x_font): Match charset to real charset.
	(enum_font_cb2): Always list unicode versions.

	* makefile.w32-in (temacs): Increase EMHEAP.

2008-02-01  Jason Rumney  <jasonr@gnu.org>

	* w32term.c (w32_encode_char): New charset parameter.
	font_info.encoding becomes encoding_type.
	(x_get_font_repertory): New function.  Warning: stub only!
	(x_new_font): Return quickly if font already set.
	(x_new_fontset): fontsetname parameter is Lisp_Object.
	Use new fs_query_fontset.  Try new_fontset_from_font_name.  Use
	fontset_name for return value.

	* w32term.h: Declare x_get_font_repertory.

	* w32select.c (Fw32_set_clipboard_data): Use string_x_string_p in
	place of find_charset_in_text.  Use encode_coding_object in place
	of encode_coding.
	(Fw32_get_clipboard_data): Use decode_coding_c_string in place of
	decode_coding.

	* w32fns.c (Fx_create_frame, x_create_tip_frame): Use new version
	of x_new_fontset.
	(w32_load_system_font): Initialize charset as unicode.
	font_info.encoding becomes encoding_type.
	(w32_to_x_font): Use decode_coding_c_string in place of decode_coding.
	(x_to_w32_font): Use encode_coding_object in place of encode_coding.
	(syms_of_w32fns): Set get_font_repertory_func.

	* w32console.c: Include character.h.  Use terminal_encode_buffer
	from term.c.
	(write_glyphs): Use new version of encode_terminal_code.  Use
	encode_coding_object in place of encode_coding.

	* w32bdf.c (w32_load_bdf_font): Clear font_info before filling.
	encoding becomes encoding_type.

	* term.c (terminal_encode_buffer): Make externally visible.

	* makefile.w32-in: Add character.h dependancies.
	(character.o, chartab.o): New targets.

2008-02-01  Kenichi Handa  <handa@m17n.org>

	* fileio.c (Finsert_file_contents) [DOS_NT]: Use the macro
	CODING_ID_EOL_TYPE.

2008-02-01  Andreas Schwab  <schwab@suse.de>

	* coding.c (produce_chars): Revert last change.

2008-02-01  Kenichi Handa  <handa@m17n.org>

	* charset.h (charset_unicode): Extern it.

	* charset.c (string_xstring_p): Check by (C >= 0x100).
	(find_charsets_in_text): Change format of the arc CHARSETS.  New
	arg MULTIBYTE.
	(Ffind_charset_region, Ffind_charset_string): Adjust for the
	change of find_charsets_in_text.
	(Fsplit_char): Fix doc.  Never return unknown.

	* chartab.c (char_table_translate): Use CHARACTERP, not INETEGERP.

	* coding.c (Fdefine_coding_system_alias): Update
	Vcoding_system_list.

	* fontset.c (load_font_get_repertory): Pay attention to the case
	that ENCODING of a font is specified by a char-table.

	* xterm.c (x_get_font_repertory): Handle the case that the
	encoding of font is other than Unicode.

2008-02-01  Kenichi Handa  <handa@m17n.org>

	* term.c (encode_terminal_code): Don't handle glyph-table.  Check
	if a character is encodable by the terminal coding system.  If
	not, produces proper number of `?'s.  Update
	terminal_encode_buffer and terminal_encode_buf_size if necessary.
	(produce_glyphs): Check by CHAR_BYTE8_P, not SINGLE_BYTE_CHAR_P.

2008-02-01  Kenichi Handa  <handa@m17n.org>

	* term.c (terminal_encode_buffer, terminal_encode_buf_size): New
	variables.
	(encode_terminal_code): Change argument.  Encode multiple
	characters at once.  Store the result of encoding in
	terminal_encode_buffer.
	(write_glyphs, insert_glyphs): Adjust for the change of
	encode_terminal_code.
	(term_init): Initialize terminal_encode_buffer and
	terminal_encode_buf_size.

	* coding.c (consume_chars): If coding->src_object is nil, don't
	check annotation.

2008-02-01  Kenichi Handa  <handa@m17n.org>

	* character.c (char_string): Use ASCII_CHAR_P instead of
	SINGLE_BYTE_CHAR_P.

2008-02-01  Kenichi Handa  <handa@m17n.org>

	* xdisp.c (handle_auto_composed_prop): Check if the last
	characters of auto-composed region is newly composed with the
	following characters.
	(handle_composition_prop): Fix checking of point being inside
	composition.

2008-02-01  Kenichi Handa  <handa@m17n.org>

	* fns.c (concat): Don't change multibyteness of the result by
	concatenating an 8-bit character.

	* data.c (Faset): Check newelt by CHECK_CHARACTER.  Don't change
	multibyteness of the result when newelt is an 8-bit character.

2008-02-01  Dave Love  <fx@gnu.org>

	* xmenu.c (find_and_call_menu_selection): Make menu_bar_items_used
	EMACS_INT.

	* xfns.c (DefaultDepthOfScreen, x_encode_text): Remove unused vars.

	* xfaces.c (face_numeric_value): Declare dim size_t.
	(Finternal_lisp_face_equal_p): Remove unused f.

	* xdisp.c (BUILD_CHAR_GLYPH_STRINGS, display_and_set_cursor)
	(MATRIX_ROW): Remove unused vars.
	(draw_glyphs, x_insert_glyphs, fast_find_position)
	(fast_find_position, fast_find_string_pos): Use EMACS_INT for
	byte/char counts.

	* regex.c (regex_compile): Remove unused var.

	* minibuf.c (Fminibuffer_complete_word): Remove unused var.

	* keymap.c (Fset_keymap_parent, map_keymap, Fcopy_keymap)
	(Faccessible_keymaps, where_is_internal): Remove unused vars.

	* keyboard.c (cancel_hourglass_unwind): Return Qnil.

	* frame.c (frame_name_fnn_p): Make len EMACS_INT.

	* fileio.c (Fwrite_region): Remove unused var.

	* dispnew.c (adjust_frame_glyphs_for_frame_redisplay)
	(adjust_frame_glyphs_for_window_redisplay): Remove unused ch_dim.

	* composite.c (Fremove_list_of_text_properties): Declare.

	* coding.c (inhibit_pre_post_conversion): Remove (unused).
	(alloc_destination, produce_chars): Use EMACS_INT for byte/char counts.
	(coding_inherit_eol_type): Remove unused attrs.
	(detect_coding): Cast arg of detect_eol.

	* charset.c (syms_of_charset): Remove unused var p.
	(find_charsets_in_text, Ffind_charset_region): Use EMACS_INT for
	byte/char counts.

	* casetab.c (set_case_table): Remove unused var.

	* window.c (Fdisplay_buffer, Fframe_selected_window): Remove
	unused vars.

2008-02-01  Dave Love  <fx@gnu.org>

	* xterm.c (x_bitmap_mask): Declare.

2008-02-01  Dave Love  <fx@gnu.org>

	* xterm.c (x_term_init): Fix type error.

	* lisp.h: Add Funibyte_char_to_multibyte.

	* coding.c (Fread_coding_system): Fix arg of XSETSTRING.
	(Fset_coding_system_priority): Doc fix.

	* ccl.c (ccl_driver): Fix arg of CHARACTERP.

	* indent.c (check_composition): Make start and end EMACS_INT.

	* character.c (lisp_string_width): Make ignore and end EMACS_INT.

	* xdisp.c (handle_composition_prop, check_point_in_composition):
	Make buffer positions EMACS_INT.

	* composite.c (find_composition, run_composition_function)
	(update_compositions, Ffind_composition_internal): Make buffer
	positions EMACS_INT.

	* composite.h (find_composition, update_compositions): Make
	position args EMACS_INT.

	* keyboard.c (adjust_point_for_property): Make beg and end EMACS_INT.

	* intervals.c (get_property_and_range):
	* intervals.h (get_property_and_range): Make start and end EMACS_INT.

	* unexalpha.c: Don't include varargs.h.

2008-02-01  Dave Love  <fx@gnu.org>

	* coding.h (ENCODE_UTF_8): New.

	* Makefile.in (gtkutil.o): Depend on coding.h.

	* coding.c (Fset_coding_system_priority): Doc fix.

2008-02-01  Kenichi Handa  <handa@m17n.org>

	* fileio.c (Finsert_file_contents): Call setup_coding_system in
	the case of auto saving.

2008-02-01  Andreas Schwab  <schwab@suse.de>

	* chartab.c (map_char_table, map_char_table_for_charset): Protect
	`range' from GC.

2008-02-01  Kenichi Handa  <handa@m17n.org>

	* coding.c (decode_coding_sjis): Check bytes more rigidly.

2008-02-01  Kenichi Handa  <handa@m17n.org>

	* fileio.c (choose_write_coding_system): Return a decided coding system.
	(Fwrite_region): Set Vlast_coding_system_used to the return value
	of choose_write_coding_system.

2008-02-01  Kenichi Handa  <handa@m17n.org>

	* charset.c (Fset_charset_priority): Pay attention to duplicated
	arguments.

	* coding.c (QCcategory): New variable.
	(syms_of_coding): Defsym it.  Set all elements of
	Vcoding_category_table and their symbol values.
	(Fset_coding_system_priority): Doc fix.  Update symbol qvalues of
	coding-category-XXX, and coding-category-list.
	(Fdefine_coding_system_internal): Add category in the plist.

2008-02-01  Kenichi Handa  <handa@m17n.org>

	* callproc.c (Fcall_process): Handle carryover correctly.

	* coding.c (decode_coding_iso_2022): Fix handling of invalid bytes.
	(raw_text_coding_system): Check NILP (coding_system).
	(coding_inherit_eol_type): Check NILP (coding_system) and
	NILP (parent).
	(consume_chars): Fix for the case of raw-text.

	* process.c (read_process_output): Handle carryover correctly.

2008-02-01  Dave Love  <fx@gnu.org>

	* regex.c (re_search_2): Fix last change.

2008-02-01  Kenichi Handa  <handa@m17n.org>

	* regex.c (GET_CHAR_BEFORE_2): Check multibyte, not
	target_multibyte.  Even in a unibyte case, return a converted
	multibyte char.
	(GET_CHAR_AFTER): New macro.
	(PATFETCH): Translate via multibyte char.
	(HANDLE_UNIBYTE_RANGE): Delete this macro.
	(SETUP_MULTIBYTE_RANGE): New macro.
	(regex_compile): Setup compiled code so that its multibyteness
	matches that of a target.  Fix the handling of "[X-YZ]" using
	SETUP_MULTIBYTE_RANGE.
	(analyse_first) <charset>: For filling fastmap for all multibyte
	characters, don't check by BASE_LEADING_CODE_P.
	(re_search_2): Don't check RE_TARGET_MULTIBYTE_P (bufp).  It is
	the same as RE_MULTIBYTE_P (bufp) now.
	(mutually_exclusive_p): Check by (! multibyte || IS_REAL_ASCII (c)).
	(TARGET_CHAR_AND_LENGTH): Delete this macro.
	(TRANSLATE_VIA_MULTIBYTE): New macro.
	(re_match_2_internal): Don't check RE_TARGET_MULTIBYTE_P (bufp).
	It is the same as RE_MULTIBYTE_P (bufp) now.
	<exactn>: Translate via multibyte.
	<anychar>: Fetch a character by RE_STRING_CHAR_AND_LENGTH.  Don't
	translate it.
	<charset, charset_not>: Fetch a character by
	RE_STRING_CHAR_AND_LENGTH.  Translate via multibyte.
	<duplicate>: Call bcmp_translate with the last arg `multibyte'.
	<wordbound, notwordbound, wordbeg, wordend, syntaxspec,
	notsyntaxspec, categoryspec, notcategoryspec> Fetch a character
	by GET_CHAR_AFTER.
	(bcmp_translate):  Likewise.

	* search.c (compile_pattern): Check the member target_multibyte,
	not the member multibyte of buf.

	* lread.c (read1): While reading a string, set force_singlebyte
	and force_multibyte correctly.

	* charset.c (Fset_unibyte_charset, init_charset_once): Fix setting
	up of unibyte_to_multibyte_table.

2008-02-01  Kenichi Handa  <handa@m17n.org>

	* coding.c (setup_coding_system): If coding has
	post-read-conversion or pre-write-conversion, set
	CODING_REQUIRE_DECODING_MASK and CODING_REQUIRE_ENCODING_MASK
	respectively.
	(decode_coding_gap): Run post-read-conversion if any.

	* fileio.c (Finsert_file_contents): Even if we read into a
	unibyte buffer, check if we must decode the result or not.

2008-02-01  Kenichi Handa  <handa@m17n.org>

	* coding.c (make_conversion_work_buffer): Change the work buffer
	name to the same one as that of Emacs 21.

2008-02-01  Kenichi Handa  <handa@m17n.org>

	* coding.h (make_conversion_work_buffer): Adjust prototype.
	(code_conversion_restore): Don't extern it.

	* coding.c (detected_mask): Delete unused variable.
	(decode_coding_iso_2022): Pay attention to the byte sequence of
	CTEXT extended segment, and retain those bytes as is.
	(decode_coding_ccl): Delete unused variable `valids'.
	(setup_coding_system): Delete unused variable `category'.
	(consume_chars): Delete unused variable `category'.  Make it work
	for non-multibyte case.
	(make_conversion_work_buffer): Change argument.
	(saved_coding): Delete unused variable.
	(code_conversion_restore): Don't check saved_coding->destination.
	(code_conversion_save): New function.
	(decode_coding_gap, encode_coding_gap): Call code_conversion_save
	instead of record_unwind_protect.
	(decode_coding_object, encode_coding_object): Likewise.  Recover PT.
	(detect_coding_system): Delete unused variable `mask'.
	(Fdefine_coding_system_internal): Delete unused vaiable id.

	* fileio.c (kill_workbuf_unwind): New function.
	(Finsert_file_contents): On replacing, call
	make_conversion_work_buffer with correct args, and call
	record_unwind_protect with the first arg kill_workbuf_unwind.

	* lisp.h (Fgenerate_new_buffer_name): EXFUN it.

2008-02-01  Kenichi Handa  <handa@m17n.org>

	* fontset.c (BASE_FONTSET_P): Check FONTSET_BASE, not FONTSET_NAME.
	(fontset_add): Fix for the case that TO is less than TO1.
	(Ffontset_info): Don't use fallback fontset on checking the
	default fontset.
	(dump_fontset): New function for debugging.

	* coding.c (Fdefine_coding_system_internal): Fix for the case that
	coding_type is Qcharset.

2008-02-01  Kenichi Handa  <handa@m17n.org>

	* chartab.c (map_sub_char_table): New argument DEFAULT_VAL.
	(map_char_table): Don't inherit the value from the parent on
	initializing VAL.  Adjust for the above change.

2008-02-01  Kenichi Handa  <handa@m17n.org>

	* coding.c (Qsignature, Qendian): Delete these variables.
	(syms_of_coding): Don't initialize them.
	(CATEGORY_MASK_UTF_16_AUTO): New macro.
	(detect_coding_utf_16): Add CATEGORY_MASK_UTF_16_AUTO in
	detect_info->found.
	(decode_coding_utf_16): Don't detect BOM here.
	(encode_coding_utf_16): Produce BOM if CODING_UTF_16_BOM (coding)
	is NOT utf_16_without_bom.
	(setup_coding_system): For a coding system of type utf-16, check
	if the attribute :endian is Qbig or not (not nil or not), and set
	CODING_REQUIRE_DETECTION_MASK if BOM detection is required.
	(detect_coding): If coding type is utf-16 and BOM detection is
	required, detect it.
	(Fdefine_coding_system_internal): For a coding system of type
	utf-16, check if the attribute :endian is Qbig or not (not nil or not).

2008-02-01  Kenichi Handa  <handa@m17n.org>

	* coding.c (coding_set_source): Fix for the case that the current
	buffer is different from coding->src_object.
	(decode_coding_object): Don't use the conversion work buffer if
	DST_OBJECT is a buffer.

2008-02-01  Dave Love  <fx@gnu.org>

	* lread.c (read_emacs_mule_char) [len==2]: Index
	emacs_mule_charset correctly.

2008-02-01  Dave Love  <fx@gnu.org>

	* coding.c (Qbig5, Vbig5_coding_system, CATEGORY_MASK_BIG5)
	(detect_coding_big5, decode_coding_big5, encode_coding_big5)
	(Fdecode_big5_char, Fencode_big5_char): Delete.  (Big5 no longer
	treated specially.)
	(setup_coding_system, coding_category, CATEGORY_MASK_ANY)
	(detected_mask): Remove Big5 bits.

2008-02-01  Kenichi Handa  <handa@m17n.org>

	The following changes are to make the font rescaling facility
	compatible with Emacs 21.

	* xfaces.c (Vface_font_rescale_alist): Rename from
	Vface_resizing_fonts.
	(struct font_name): Rename member resizing_ratio to rescale_ratio.
	(font_rescale_ratio): Rename from font_resizing_ratio.
	(split_font_name): Set font->rescale_ratio.
	(better_font_p): Pay attention to font->rescale_ratio.
	(build_scalable_font_name): Likewise.  Change RESX, and RESY
	fields.
	(syms_of_xfaces): Declare Vface_font_rescale_alist as a Lisp variable.

2008-02-01  Kenichi Handa  <handa@m17n.org>

	* coding.c (Qutf_16_be_nosig, Qutf_16_be, Qutf_16_le_nosig)
	(Qutf_16_le): Remove these variables.
	(syms_of_coding): Don't DEFSYM them.
	(decode_coding_utf_16): Fix handling of BOM.
	(encode_coding_utf_16): Fix handling of BOM.

2008-02-01  Kenichi Handa  <handa@m17n.org>

	* fileio.c (Finsert_file_contents): On replacing, before decoding
	the file into the work buffer, set point of the work buffer to the end.

2008-02-01  Dave Love  <fx@gnu.org>

	* coding.c (Fcheck_coding_systems_region): Fix type errors.

2008-02-01  Dave Love  <fx@gnu.org>

	* xterm.c (XTread_socket): Check Lisp types for Vx_keysym_table
	and fix C types.

2008-02-01  Kenichi Handa  <handa@m17n.org>

	* xdisp.c (SKIP_GLYPHS): New macro.
	(set_cursor_from_row): Pay attention to string display properties.

	* category.c (copy_category_entry): Fix for the case that RANGE
	is an integer.

	* xterm.c (x_encode_char): Call ccl_driver with the last arg Qnil.

	* w32term.c (w32_encode_char): Call ccl_driver with the last arg Qnil.

2008-02-01  Kenichi Handa  <handa@m17n.org>

	* charset.c (Fcharset_id_internal): New function.
	(syms_of_charset): Defsubr it.

	* coding.c (decode_coding_ccl, encode_coding_ccl): Call ccl_driver
	with the last arg charset_list acquired from coding.
	(Fdefine_coding_system_internal): For ccl-based coding system, fix
	the attribute coding_attr_ccl_valids.

	* coding.h (enum define_coding_ccl_arg_index): Set the first
	member coding_arg_ccl_decoder to coding_arg_max.

	* ccl.h (ccl_driver): Adjust prototype.

	* ccl.c (CCL_DECODE_CHAR, CCL_ENCODE_CHAR): New macros.
	(ccl_driver): New arg CHARSET_LIST.  Use the above macros instead
	of DECODE_CAHR, ENCODE_CHAR, CHAR_CHARSET.
	(Fccl_execute, Fccl_execute_on_string): Call ccl_driver with the
	last arg Qnil.

2008-02-01  Kenichi Handa  <handa@m17n.org>

	* charset.h (ENCODE_CHAR): If the method is SUBSET or SUPERSET,
	call encode_char.

	* charset.c (encode_char): Fix handling of methods SUBSET and SUPERSET.

2008-02-01  Dave Love  <fx@gnu.org>

	* composite.c (syms_of_composite): Make composition_hash_table weak.

2008-02-01  Kenichi Handa  <handa@m17n.org>

	* dispextern.h (check_face_attributes, generate_ascii_font_name)
	(font_name_registry): Don't extern them.
	(split_font_name_into_vector, build_font_name_from_vector): Extern them.

	* fontset.h (Qfontset): Don't extern it.
	(new_fontset_from_font_name): Extern it.

	* fontset.c: Give 8 extra slots to fontset objects.
	(Qfontset_info): New variable.
	(syms_of_fontset): Defsym it.
	(FONTSET_FALLBACK): New macro.
	(fontset_face): Try also the default fontset.
	(make_fontset): Realize a fallback fontset from the default fontset.
	(generate_ascii_font_name): Move from xfaces.c.  Rewritten by
	using split_font_name_into_vector and build_font_name_from_vector.
	(Fset_fontset_font): Access the elements of font_spec by enum
	FONT_SPEC_INDEX.  If font_spec is a string, extract the registry
	name by using split_font_name_into_vector.
	(Fnew_fontset): If no ASCII font is specified in FONTLIST,
	generate a proper font name from the fontset name.  Update
	Vfontset_alias_alist.
	(n_auto_fontsets): New variable.
	(new_fontset_from_font_name): New function.
	(Ffont_info): Store the information about fonts generated from the
	default fontset in the first extra slot of the returned char-table.

	* xfaces.c (generate_ascii_font_name): Move to fontset.c.
	(font_name_registry): Delete function.
	(split_font_name_into_vector): New function.
	(build_font_name_from_vector): New function.
	(font_list): The argument REGISTRY is now a list of registry names.
	(choose_face_font): If we are choosing an ASCII font, and ATTRS
	specifies an explicit font name, return the name as is.  Make a
	list of registy names.

	* xfns.c (x_set_font, x_create_tip_frame): Adjust for the change
	of x_new_fontset.
	(Fx_create_frame): Don't call x_new_fontset here.  Just use
	x_list_fonts to check the existence of fonts.

	* xterm.h (x_new_fontset): Adjust prototype.

	* xterm.c (x_new_fontset): Change the arg FONTSETNAME to Lisp
	string.  Use new_fontset_from_font_name to create a fontset from a
	font name.

2008-02-01  Kenichi Handa  <handa@m17n.org>

	* syntax.c (Vfind_word_boundary_function_table): New name for
	Vnext_word_boundary_function_table.
	(find-word-boundary-function-table): New name for
	next-word-boundary-function-table.

2008-02-01  Dave Love  <fx@gnu.org>

	* Makefile.in: Fix some dependencies.

	* keymap.c (Fapropos_internal): Don't gcpro apropos_predicate but
	set it to nil before returning.

	* composite.c (update_compositions): Fix type error.

	* syntax.c (skip_chars, skip_syntaxes): Fix type errors.

2008-02-01  Kenichi Handa  <handa@m17n.org>

	* xterm.c (x_new_font): Optimize for the case that the font is
	already set for the frame.

2008-02-01  Kenichi Handa  <handa@m17n.org>

	* chartab.c (char_table_ascii): Check if the char table contents
	is sub-char-table or not.
	(char_table_set, char_table_set_range): Fix argument to
	char_table_ascii.

	* coding.c (CATEGORY_MASK_RAW_TEXT): New macro.
	(detect_coding_utf_8, detect_coding_utf_16)
	(detect_coding_emacs_mule, detect_coding_iso_2022)
	(detect_coding_sjis, detect_coding_big5)
	(detect_coding_ccl, detect_coding_charset): Change argument MASK
	to DETECT_INFO.  Update DETECT_INFO and return 1 if the byte
	sequence is valid in this coding system.  Change callers.
	(MAX_ANNOTATION_LENGTH): New macro.
	(ADD_ANNOTATION_DATA): New macro.
	(ADD_COMPOSITION_DATA): Change argument.  Change callers.  Call
	ADD_ANNOTATION_DATA.  Change the format of annotation data.
	(ADD_CHARSET_DATA): New macro.
	(emacs_mule_char): New argument ID.  Change callers.
	(decode_coding_emacs_mule, decode_coding_iso_2022)
	(decode_coding_sjis, decode_coding_big5, decode_coding_charset):
	Produce charset annotation data in coding->charbuf.
	(encode_coding_emacs_mule, encode_coding_iso_2022): Pay attention
	to charset annotation data in coding->charbuf.
	(setup_coding_system): Add CODING_ANNOTATE_CHARSET_MASK
	coding->common_flags if the coding system is iso-2022 based and
	uses designation.
	(produce_composition): Adjust for the new annotation data format.
	(produce_charset): New function.
	(produce_annotation): Handle charset annotation.
	(handle_composition_annotation, handle_charset_annotation): New
	functions.
	(consume_chars): Handle charset annotation.  Utilize the above two
	functions.
	(encode_coding_object): If SRC_OBJECT and DST_OBJECT are the same
	buffer, get the deleted text as a string and set
	coding->src_object to that string.
	(detect_coding, detect_coding_system): Use the new struct
	coding_detection_info.

	* coding.h (struct coding_detection_info): New structure.
	(struct coding_system): Adjust prototype of the member `detector'.
	(CODING_ANNOTATE_CHARSET_MASK): New macro.

2008-02-01  Kenichi Handa  <handa@m17n.org>

	* insdel.c (insert_from_gap): Fix argument to offset_intervals.

2008-02-01  Dave Love  <fx@gnu.org>

	* keymap.c (apropos_predicate, apropos_accumulate): Declare static.
	(Fapropos_internal): Don't gcpro apropos_accumulate.  Set result
	to new local and nullify apropos_accumulate before returning.
	(syms_of_keymap): Staticpro and initialize apropos_accumulate.

2008-02-01  Kenichi Handa  <handa@m17n.org>

	* charset.c (Fdefine_charset_internal): Setup charset.fast_map
	correctly.

2008-02-01  Dave Love  <fx@gnu.org>

	* fns.c (Flanginfo): Call synchronize_system_time_locale.

2008-02-01  Kenichi Handa  <handa@m17n.org>

	The following changes are to make character composition happen
	automatically on displaying.

	* Makefile.in (lisp, shortlisp): Add composite.elc

	* composite.h (Qauto_composed, Vauto_composition_function)
	(Qauto_composition_function): Extern them.

	* composite.c (Vcomposition_function_table)
	(Qcomposition_function_table): Delete variables.
	(Qauto_composed, Vauto_composition_function)
	(Qauto_composition_function): New variables.
	(run_composition_function): Don't call
	compose-chars-after-function.
	(update_compositions): Clear `auto-composed' text property.
	(compose_chars_in_text): Delete this function.
	(syms_of_composite): Staticpro Qauto_composed and
	Qauto_composition_function.  Declare Vauto_composition_function as
	a Lisp variable.

	* dispextern.h (enum prop_idx): Add member AUTO_COMPOSED_PROP_IDX.

	* xdisp.c (it_props): Add an entry for Qauto_composed.
	(handle_auto_composed_prop): New function.

	* xselect.c (selection_data_to_lisp_data): Don't call
	compose_chars_in_text.

2008-02-01  Dave Love  <fx@gnu.org>

	* keyboard.c (read_char): Modify checking around use of
	Vkeyboard_translate_table.

	* xterm.c (XTread_socket): Check Lisp types for Vx_keysym_table
	and fix C types.

2008-02-01  Kenichi Handa  <handa@m17n.org>

	* coding.c (decode_coding_utf_8, decode_coding_emacs_mule)
	(decode_coding_iso_2022, decode_coding_sjis, decode_coding_big5)
	(decode_coding_charset, produce_chars): When eol_type is Qdos, handle
	the case that the last byte is '\r' correctly.
	(decode_coding): Flush out the unprocessed data correctly.
	(decode_coding_gap): Set CODING_MODE_LAST_BLOCK bit of coding->mode.

2008-02-01  Dave Love  <fx@gnu.org>

	* xterm.c (XTread_socket): Fix changes for defined keysyms.  Add
	XK_ISO... case.
	(xaw_scroll_callback): Revert last change.

2008-02-01  Kenichi Handa  <handa@m17n.org>

	* charset.c (Fset_charset_priority): Update Viso_2022_charset_list.

2008-02-01  Kenichi Handa  <handa@m17n.org>

	* xfaces.c (Vface_resizing_fonts): New variable.
	(struct font_name): New member `resizing_ratio'.
	(font_resizing_ratio): New function.
	(split_font_name): Set font->resizing_ratio.
	(better_font_p): Pay attention to font->resizing_ratio.
	(build_scalable_font_name): Likewise.  Don't change POINT_SIZE,
	RESX, and RESY fields.
	(try_alternative_families): Try scalable fonts if
	Vscalable_fonts_allowed is not Qt.
	(syms_of_xfaces): Declare Vface_resizing_fonts as a Lisp variable.

2008-02-01  Dave Love  <fx@gnu.org>

	* xterm.c (xaw_scroll_callback): Cast correctly.

2008-02-01  Dave Love  <fx@gnu.org>

	* keyboard.c (lispy_accent_codes, lispy_accent_keys): Extend.
	(lispy_kana_keys): Comment out.
	(make_lispy_event) [XK_kana_A]: Comment out.

	* xterm.c (xaw_scroll_callback): Cast call_data.
	(XTread_socket): Deal with ASCII keysyms.
	(syms_of_xterm) <Vx_keysym_table>: Fix args of make_hash_table.

2008-02-01  Dave Love  <fx@gnu.org>

	* xterm.c (Vx_keysym_table): New.
	(syms_of_xterm): Initialize it.
	(XTread_socket): Use it.
	From head: Eliminate incorrect optimization that tried to avoid
	decoding the output of X*LookupString.
	(x_get_font_repertory): Delete charset declaration.

2008-02-01  Kenichi Handa  <handa@m17n.org>

	* coding.c (detect_coding_charset): If only ASCII bytes are found,
	return 0.
	(Fdefine_coding_system_internal): Setup
	CODING_ATTR_ASCII_COMPAT (attrs) correctly.

2008-02-01  Dave Love  <fx@gnu.org>

	* coding.c (Fcheck_coding_system): Doc fix.

	* editfns.c (Finsert_byte): Return a proper value.

2008-02-01  Kenichi Handa  <handa@m17n.org>

	* coding.c (decode_coding): Fix args to translate_chars.  Pay
	attention to Vstandard_translation_table_for_decode.
	(encode_coding): Fix args to translate_chars.  Pay attention to
	Vstandard_translation_table_for_encode.

	* data.c (Faset): Check NEWELT by ASCII_CHAR_P, not by
	SINGLE_BYTE_CHAR_P.

	* editfns.c (general_insert_function): Check VAL by ASCII_CHAR_P,
	not by SINGLE_BYTE_CHAR_P.

	* fns.c (concat): Check CH by ASCII_CHAR_P, not by
	SINGLE_BYTE_CHAR_P.

	* insdel.c (copy_text): Check C by ASCII_CHAR_P, not by
	SINGLE_BYTE_CHAR_P.

	* keymap.c (Ftext_char_description): Check C by ASCII_CHAR_P, not
	by SINGLE_BYTE_CHAR_P.

	* search.c (Freplace_match): Check C by ASCII_CHAR_P, not by
	SINGLE_BYTE_CHAR_P.

2008-02-01  Dave Love  <fx@gnu.org>

	* fns.c (Fstring_as_multibyte, Fstring_to_multibyte): Doc fix.

2008-02-01  Dave Love  <fx@gnu.org>

	* fns.c (Flanginfo): Fix typo.

	* unexelf.c (unexec): Make last change conditional on Irix 6.5.

2008-02-01  Kenichi Handa  <handa@m17n.org>

	* coding.c (detect_coding_utf_8, detect_coding_utf_16)
	(detect_coding_emacs_mule, detect_coding_iso_2022)
	(detect_coding_sjis, detect_coding_big5, detect_coding_ccl): Check
	incomplete byte sequence.  Don't update *mask when correctly detected.
	(decode_coding_sjis): Fix decoding of katakana-jisx0201.
	(detect_eol): Delete the argument CODING, and add the argument CATEGORY.
	(detect_coding, detect_coding_system): Adjust for the changes above.

2008-02-01  Kenichi Handa  <handa@m17n.org>

	* character.c (char_string): Rename from
	char_string_with_unification.  Pay attention to CHAR_MODIFIER_MASK.
	(string_char): Rename from string_char.

	* character.h (CHAR_STRING, CHAR_STRING_ADVANCE): Call char_string
	if C is greater than MAX_3_BYTE_CHAR.
	(STRING_CHAR, STRING_CHAR_AND_LENGTH, STRING_CHAR_ADVANCE): Call
	string_char instead of string_char_with_unification.

2008-02-01  Dave Love  <fx@gnu.org>

	* coding.c (decode_coding_utf_8): Treat surrogates as invalid.

2008-02-01  Kenichi Handa  <handa@m17n.org>

	* keymap.c (push_key_description): Pay attention to force_multibyte.

	* regex.c (re_search_2): Fix for the case of unibyte buffer.

2008-02-01  Dave Love  <fx@gnu.org>

	* charset.c (define_charset_internal): Rename `supprementary'.

	* Makefile.in (lisp, shortlisp): Remove latin-N.

2008-02-01  Dave Love  <fx@gnu.org>

	* xfns.c (x_window, x_window): Use use_xim.

	* xterm.c (use_xim): Initialize.
	(xim_open_dpy, xim_initialize, xim_close_dpy): Use use_xim.
	(x_term_init): Maybe set use_xim.

	* xterm.h (use_xim) [HAVE_X_I18N]: Declare.

2008-02-01  Kenichi Handa  <handa@m17n.org>

	* search.c (search_buffer): Fix case-fold-search of multibyte
	characters.
	(boyer_moore): Rename the last argument to char_high_bits.

2008-02-01  Kenichi Handa  <handa@m17n.org>

	* xdisp.c (display_string): Fix for the case of zero width glyph.

	* xfns.c (x_set_font): Change the error message of the case that
	x_new_fontset returns Qt.

	* xfaces.c (set_lface_from_font_name): Reject the default fontset.
	(Finternal_set_lisp_face_attribute): Use signal_error for the
	error of invalid fontset.

	* xterm.c (x_new_fontset): If FONTSETNAME specifies the default
	fontset, return Qt.

2008-02-01  Dave Love  <fx@gnu.org>

	* unexelf.c (unexec): Make .got handling not SGI-specific.

	* syntax.c (syms_of_syntax) <multibyte-syntax-as-symbol>: Doc fix.

	* regex.c: Use `ifdef HAVE_ALLOCA_H', not `if HAVE_ALLOCA_H'.

	* keyboard.c (read_key_sequence): Fix type error.

	* buffer.c (Fset_buffer_multibyte, Fset_buffer_multibyte): Fix
	type error.

	* fontset.c (fontset_add): Return Lisp_Object.

2008-02-01  Dave Love  <fx@gnu.org>

	* charset.h (charset_ordered_list_tick): Declare extern.

2008-02-01  Kenichi Handa  <handa@m17n.org>

	The following changes (and some of 2008-02-01 changes of mine) are
	for handling syntax, category, and case conversion for unibyte
	characters by converting them to multibyte on the fly.  With these
	changes, we don't have to setup syntax and case tables for unibyte
	characters in each language environment.

	* abbrev.c (Fexpand_abbrev): Convert a unibyte character to
	multibyte if necessary.

	* bytecode.c (Fbyte_code): Likewise.

	* character.h (LEADING_CODE_LATIN_1_MIN)
	(LEADING_CODE_LATIN_1_MAX): New macros.
	(unibyte_to_multibyte_table): Extern it.
	(unibyte_char_to_multibyte): New macro.
	(MAKE_CHAR_MULTIBYTE): Use unibyte_to_multibyte_table.
	(CHAR_LEADING_CODE): New macro.
	(FETCH_STRING_CHAR_AS_MULTIBYTE_ADVANCE): New macro.

	* character.c (unibyte_to_multibyte_table): New variable.
	(unibyte_char_to_multibyte): Move to character.h and define as macro.
	(multibyte_char_to_unibyte): If C is an eight-bit character,
	convert it to the corresponding byte value.

	* charset.c (Fset_unibyte_charset): If the dimension of CHARSET is
	not 1, singals an error.  Update the elements of
	unibyte_to_multibyte_table.
	(init_charset_once): Initialize unibyte_to_multibyte_table.
	(syms_of_charset): Define the charset `iso-8859-1'.

	* cmds.c (internal_self_insert): In a multibyte buffer, insert C
	as is without converting it to unibyte.  In a unibyte buffer,
	convert C to multibyte before checking the syntax.

	* lisp.h (unibyte_char_to_multibyte): Delete extern.

	* minibuf.c (Fminibuffer_complete_word): Use the macro
	FETCH_STRING_CHAR_AS_MULTIBYTE_ADVANCE.

	* regex.h (struct re_pattern_buffer): New member target_multibyte.

	* regex.c (RE_TARGET_MULTIBYTE_P): New macro.
	(GET_CHAR_BEFORE_2): Check target_multibyte, not multibyte.  If
	that is zero, convert an eight-bit char to multibyte.
	(MAKE_CHAR_MULTIBYTE, CHAR_LEADING_CODE): New dummy new macros for
	non-emacs case.
	(PATFETCH): Convert an eight-bit char to multibyte.
	(HANDLE_UNIBYTE_RANGE): New macro.
	(regex_compile): Setup the compiled pattern for multibyte chars
	even if the given regex string is unibyte.  Use PATFETCH_RAW
	instead of PATFETCH in many places.  To handle `charset'
	specification of unibyte, call HANDLE_UNIBYTE_RANGE.   Use bitmap
	only for ASCII chars.
	(analyse_first) <exactn>: Simplify because the compiled pattern
	is multibyte.
	<charset_not>: Setup fastmap from bitmap only for ASCII chars.
	<charset>: Use CHAR_LEADING_CODE to get leading codes.
	<categoryspec>: If multibyte, setup fastmap only for ASCII chars here.
	(re_compile_fastmap) [emacs]: Call analyse_first with the arg
	multibyte always 1.
	(re_search_2): In emacs, set the locale variable multibyte to 1,
	otherwise to 0.  New local variable target_multibyte.  Check it
	to decide the multibyteness of STR1 and STR2.  If
	target_multibyte is zero, convert unibyte chars to multibyte
	before translating and checking fastmap.
	(TARGET_CHAR_AND_LENGTH): New macro.
	(re_match_2_internal): In emacs, set the locale variable multibyte
	to 1, otherwise to 0.  New local variable target_multibyte.  Check
	it to decide the multibyteness of STR1 and STR2.  Use
	TARGET_CHAR_AND_LENGTH to fetch a character from D.
	<charset, charset_not>: If multibyte is nonzero, check fastmap
	only for ASCII chars.   Call bcmp_translate with
	target_multibyte, not with multibyte.
	<begline>: Declare the local variable C as `unsigned'.
	(bcmp_translate): Change the last arg name to target_multibyte.

	* search.c (compile_pattern_1): Don't adjust the multibyteness of
	the regexp pattern and the matching target.  Set cp->buf.multibyte
	to the multibyteness of the regexp pattern.  Set
	cp->but.target_multibyte to the multibyteness of the matching target.
	(wordify): Use FETCH_STRING_CHAR_AS_MULTIBYTE_ADVANCE instead of
	FETCH_STRING_CHAR_ADVANCE.
	(Freplace_match): Convert unibyte chars to multibyte.

	* syntax.c (char_quoted, back_comment, scan_words)
	(Fforward_comment, scan_lists, Fbackward_prefix_chars)
	(scan_sexps_forward): Use FETCH_CHAR_AS_MULTIBYTE to convert
	unibyte chars to multibyte.
	(skip_chars): Delete the arg syntaxp, and move the code for
	handling syntaxes to skip_syntaxes.  Change callers.
	Fix the case that the multibyteness of STRING and the current
	buffer doesn't match.
	(skip_syntaxes): New function.
	(SYNTAX_WITH_MULTIBYTE_CHECK): Check C by ASCII_CHAR_P, not by
	SINGLE_BYTE_CHAR_P.

2008-02-01  Kenichi Handa  <handa@m17n.org>

	* xfaces.c (QCfontset): New variable.
	(LFACE_FONTSET): New macro.
	(check_lface_attrs): Check also LFACE_FONTSET_INDEX.
	(set_lface_from_font_name): Setup LFACE_FONTSET (lface).
	(Finternal_set_lisp_face_attribute)
	(Finternal_get_lisp_face_attribute): Handle QCfontset.
	(lface_same_font_attributes_p): Fix checking of LFACE_FONT_INDEX,
	check also LFACE_FONTSET_INDEX.
	(face_fontset): Check attrs[LFACE_FONTSET_INDEX], not
	attrs[LFACE_FONT_INDEX].
	(syms_of_xfaces): Intern and staticpro QCfontset.

	* dispextern.h (enum lface_attribute_index): New member
	LFACE_FONTSET_INDEX.

	* fns.c (base64_encode_1): Handle eight-bit chars correctly.

2008-02-01  Kenichi Handa  <handa@m17n.org>

	* coding.c (coding_set_destination): Fix coding->destination for
	the case converting a region.
	(encode_coding_utf_8): Encode eight-bit chars as single byte.
	(encode_coding_object): Fix coding->dst_pos and
	coding->dst_pos_byte for the case converting a region.

	* insdel.c (insert_from_gap): Make it work even if PT != GTP.

	* character.h (BYTE8_STRING): New macro.

	* fns.c (base64_decode_1): Insert eight-bit chars correctly.

2008-02-01  Kenichi Handa  <handa@m17n.org>

	* xdisp.c (get_next_display_element): Don't display unibyte 8-bit
	characters by octal form.

	* abbrev.c (Fexpand_abbrev): Fix for the multibyte case.

	* buffer.h (_fetch_multibyte_char_len): Delete extern.
	(FETCH_MULTIBYTE_CHAR, BUF_FETCH_MULTIBYTE_CHAR): Don't use
	_fetch_multibyte_char_len.
	(FETCH_CHAR_AS_MULTIBYTE): New macro.

	* casetab.c (set_canon, set_identity, shuffle): Simplify.

	* casefiddle.c (casify_object): Simplify.  Handle the case that
	the case conversion change the byte length.
	(casify_region): Likewise.

	* character.h (MAKE_CHAR_UNIBYTE, MAKE_CHAR_MULTIBYTE): New macros.

	* character.c (_fetch_multibyte_char_len): Delet this variable.
	(syms_of_character): Setup Vprintable_chars.

	* editfns.c (Fchar_equal): Fix for the unibyte case.
	(Finsert_byte): New function.
	(syms_of_editfns): Defsubr it.

	* keyboard.c (read_key_sequence): Use ~CHAR_MODIFIER_MASK instead
	of direct code 0x3ffff.

	* search.c (Freplace_match): Fix for the unibyte case.

2008-02-01  Kenichi Handa  <handa@m17n.org>

	* lread.c (safe_to_load_p): Fix the logic.

	* syntax.c (scan_words): Don't treat characters belonging to
	different scripts as constituting a word.

	* editfns.c (Fformat): Use ASCII_CHAR_P, not SINGLE_BYTE_CHAR_P.

	* fontset.c (Fset_fontset_font): Treat `ascii' as charset, not script.

	* emacs.c (main): In the case of --unibyte, instead of aborting on
	finding non-empty buffer, make it unibyte.

2008-02-01  Kenichi Handa  <handa@m17n.org>

	* xterm.c (x_new_fontset): Call `create-fontset-from-ascii-font'
	to create a fontset.

2008-02-01  Dave Love  <fx@gnu.org>

	* character.c (Funibyte_char_to_multibyte): Doc fix.

	* xfns.c [HAVE_STDLIB_H]: Fix last change.

2008-02-01  Kenichi Handa  <handa@m17n.org>

	* fontset.c (fontset_add): Make the type `int'.
	(fontset_id_valid_p): Define it if FONTSET_DEBUG is defined.

	* character.c (unibyte_char_to_multibyte)
	(multibyte_char_to_unibyte, Funibyte_char_to_multibyte): Refer to
	charset_unibyte, not charset_primary.

	* charset.h (charset_unibyte): Extern it instead of charset_primary.

	* charset.c (charset_unibyte): Rename from charset_primary.
	(Funibyte_charset): Rename from Fprimary_charset.
	(Fset_unibyte_charset): Rename from Fset_primary_charset.
	(syms_of_charset): Adjust for the above changes.

	* w32term.c (x_produce_glyphs): Use ASCII_CHAR_P, not
	SINGLE_BYTE_CHAR_P.  Fix the logic of handling non-ASCII char when
	it->multibyte_p is zero.

	* lisp.h (nonascii_insert_offset, Vnonascii_translation_table):
	Delete extern.

2008-02-01  Kenichi Handa  <handa@m17n.org>

	* coding.c (Fdefine_coding_system_internal): Fix category setting
	for a coding system of type iso-2022.

2008-02-01  Kenichi Handa  <handa@m17n.org>

	* fontset.h (FS_LOAD_FONT): Call fs_load_font with the arg CHARSET -1.

2008-02-01  Kenichi Handa  <handa@m17n.org>

	* syntax.c (Vnext_word_boundary_function_table): New variable.
	(next-word-boundary-function-table): Declare it as a Lisp variable
	in syms_of_syntax.
	(scan_words): Call functions in Vnext_word_boundary_function_table
	if any.

	* xterm.c (x_load_font): Initialize fontp->fontset to -1.

	* fontset.c (fs_load_font): If fontp->charset is not negative,
	return fontp without setting its members.

2008-02-01  Dave Love  <fx@gnu.org>

	* xfns.c [HAVE_STDLIB_H]: Change logic (instead of fixing typo).

	* m/sparc.h (HAVE_ALLOCA): Delete.

	* s/irix6-5.h: Don't include strings.h.
	(bcopy, bzero, bcmp): Don't undef.

	* s/irix6-0.h (bcopy, bzero, bcmp): Don't undef.

	* s/usg5-4.h (NO_SIOCTL_H): Don't define.
	(TIOCSIGSEND): Don't test IRIX6.
	(bcopy, bzero, bcmp): Define conditionally.

2008-02-01  Kenichi Handa  <handa@m17n.org>

	* buffer.c (Qas, Qmake, Qto): New variables.
	(Fset_buffer_multibyte): New optional arg METHOD.  Change caller.
	(syms_of_buffer): Intern and staticpro Qas, Qmake, and Qto.

	* callproc.c (Fcall_process): Don't call insert_1_both directly if
	we are inserting a process output into a multibyte buffer.

	* character.h (CHAR_TO_BYTE8): If C is not eight-bit char, call
	multibyte_char_to_unibyte.

	* character.c (Funibyte_char_to_multibyte): If C can't be decoded
	by the primary charset, make it eight-bit char.
	(Fmultibyte_char_to_unibyte): Call CHAR_TO_BYTE8.

	* charset.c (charset_eight_bit, Qeight_bit_control): New variables.
	(charset_8_bit__control, charset_8_bit_graphic)
	(Qeight_bit_control, Qeight_bit_graphic): Delete these variables.
	(define_charset_internal): New function.
	(syms_of_charset): Call define_charset_internal for pre-defined
	charsets.

	* charset.h (charset_8_bit): Extern it.

	* coding.c (make_conversion_work_buffer): Adjust for the change
	of Fset_buffer_multibyte.
	(encode_coding_raw_text): Increment p0 in the loop.

	* lisp.h (Fset_buffer_multibyte): Adjust prototype.

	* xdisp.c (setup_echo_area_for_printing, set_message_1): Adjust
	for the change of Fset_buffer_multibyte.

	* fns.c (Fstring_to_multibyte): New function.
	(syms_of_fns): Declare Fstring_to_multibyte as Lisp subroutine.

2008-02-01  Dave Love  <fx@gnu.org>

	* xfns.c (x_put_x_image): Declare args.

	* xfaces.c (font_name_registry, choose_face_font): Delete unused vars.
	(try_font_list): Declare an arg.

	* xdisp.c (message2_nolog, set_message): Declare an arg.

	* terminfo.c (tparam): Declare an arg.  Use P_ to declare tparm.

	* syntax.c (scan_sexps_forward): Declare an arg.

	* scroll.c (calculate_scrolling, calculate_direct_scrolling):
	Declare an arg.

	* lisp.h (Fnew_fontset): Declare.

	* keymap.c (push_key_description): Call CHARACTERP correctly.

	* fontset.c (fontset_add): Declare args.  Call make_number correctly.
	(face_for_char): Delete unused vars.
	(Fset_fontset_font): Doc fix.  Delete unused vars.

	* doc.c (Fsubstitute_command_keys): Delete unused vars.

	* composite.c (update_compositions): Declare arg.

	* cm.c (calccost, cmgoto): Declare args.

	* charset.c: Remove `emacs' conditional.  Doc fixes.
	(map_char_table_for_charset): Declare.

	* character.c (syms_of_character) <translation-table-vector>: Doc fix.

	* ccl.c: Remove `emacs' conditional.

2008-02-01  Kenichi Handa  <handa@m17n.org>

	The following changes are to allow specifying multiple font
	patterns for a character range (specified by script or charset).

	* Makefile.in (abbrev.o): Depend on syntax.h.
	(xfaces.o): Depend on charset.h.

	* alloc.c (Fmake_string): Use ASCII_CHAR_P, not
	SINGLE_BYTE_CHAR_P.

	* ccl.c (Fccl_execute_on_string): Add `const' to local variables.

	* character.h (Vchar_script_table): Extern it.

	* character.c (Vscript_alist): Delete.
	(Vchar_script_table, Qchar_script_table): New variable.
	(syms_of_character): Declare Vchar_script_table as a lisp variable
	and initialize it.

	* chartab.c (Fmake_char_table): Doc fix.  If PURPOSE doesn't
	have property char-table-extra-slots, make no extra slot.

	* dispextern.h (struct face): Delete member `charset'.
	(FACE_SUITABLE_FOR_CHAR_P, FACE_FOR): Use ASCII_CHAR_P, not
	SINGLE_BYTE_CHAR_P.
	(choose_face_font, lookup_non_ascii_face, font_name_registry):
	Add prototypes.
	(lookup_face, lookup_named_face, lookup_derived_face): Fix prototype.
	(generate_ascii_font_name): Rename from generate_ascii_font.

	* fontset.h (get_font_repertory_func): New prototype.
	(make_fontset_for_ascii_face, fs_load_font): Fix prototypes.
	(FS_LOAD_FONT): Call fs_load_font with the 3rd arg charset_ascii.

	* fontset.c (Qprepend, Qappend): New variables.
	(FONTSET_CHARSET_ALIST, FONTSET_FACE_ALIST): Delete.
	(FONTSET_NOFONT_FACE, FONTSET_REPERTORY): New macros.
	(FONTSET_REF): Optimize if FONTSET is Vdefault_fontset.
	(FONTSET_REF_AND_RANGE, FONTSET_ADD): New macros.
	(fontset_ref_and_range, fontset_add, reorder_font_vector)
	(load_font_get_repertory): New functions.
	(fontset_set): Delete.
	(fontset_face): New arg FACE.  Return face ID, not face.
	Complete re-write to handle new fontset structure.  Change caller.
	(free_face_fontset): Use ASET istead of AREF (X) = Y.
	(face_for_char): Don't call lookup_face.
	(make_fontset_for_ascii_face): New arg FACE.
	(fs_load_font): New arg CHARSET_ID.  Don't check
	Vfont_encoding_alist here.
	(find_font_encoding): New function.
	(list_fontsets): Use STRINGP, not ! NILP.
	(accumulate_script_ranges): New function.
	(Fset_fontset_font, Fnew_fontset, Ffontset_info): Completely
	re-written to handle new fontset structure.
	(Ffontset_font): Return a copy of element.
	(syms_of_fontset): Define symbols Qprepend and Qappend.  Fix
	docstring of font-encoding-alist.

	* lisp.h (CHAR_TABLE_REF): Remove unnecessary check (IDX >= 0).
	(Fset_fotset_font): Fix arguments to 5.

	* msdos.c (XMenuActivate): Adjust for the change of lookup_derived_face.

	* xdisp.c (message_dolog, set_message_1, extend_face_to_end_of_line):
	Use ASCII_CHAR_P, not SINGLE_BYTE_CHAR_P.
	(highlight_trailing_whitespace): Adjust for the change of
	lookup_named_face.

	* xfaces.c: Include charset.h.
	(load_face_font): Delete argument C.  Change caller.
	(generate_ascii_font_name): Rename from generate_ascii_font.
	(font_name_registry): New function.
	(cache_face): Store ascii faces before non-ascii faces in buckets.
	(lookup_face): Delete arguments C and BASE_FACE.  Change caller.
	Lookup only ascii faces.
	(lookup_non_ascii_face): New function.
	(lookup_named_face): Delete argument C.  Change caller.
	(lookup_derived_face): Delete argument C.  Change caller.
	(try_font_list): New arg PATTERN.  Change caller.  If PATTERN is
	a string, just call font_list with it.
	(choose_face_font): Delete arguments FACE and C.  New arg
	FONT_SPEC.  Change caller.
	(realize_face, realize_x_face): Delete arguments C and BASE_FACE.
	Change caller.
	(realize_non_ascii_face): New function.
	(realize_x_face): Call load_face_font here.
	(realize_tty_face): Delete argument C.  Change caller.
	(compute_char_face): If CH is not ascii, call FACE_FOR_CHAR to
	get a face ID.
	(dump_realized_face): Don't print charset of FACE.

	* xfns.c (x_set_font): Always call x_new_fontset and
	store_frame_parameter.
	(Fx_create_frame): Call x_new_fontset, not x_new_font.
	(syms_of_xfns): Set get_font_repertory_func to x_get_font_repertory.

	* xterm.h (x_get_font_repertory): Extern it.

	* xterm.c (x_produce_glyphs): Use ASCII_CHAR_P, not
	SINGLE_BYTE_CHAR_P.  Fix the logic of handling non-ASCII char when
	it->multibyte_p is zero.
	(XTread_socket): Use ASCII_CHAR_P, not SINGLE_BYTE_CHAR_P.
	(x_new_fontset): If FONTSETNAME doesn't match any existing
	fontsets, create a new one.
	(x_get_font_repertory): New function.

2008-02-01  Kenichi Handa  <handa@m17n.org>

	* coding.c (Ffind_coding_systems_region_internal): Detect an
	ASCII only string correctly.

	* lread.c (Fload): Don't load with Qload_force_doc_strings t if
	version is 0.

2008-02-01  Kenichi Handa  <handa@m17n.org>

	* lread.c: Include "coding.h".
	(Qget_emacs_mule_file_char, Qload_force_doc_strings)
	(load_each_byte, unread_char): New variables.
	(readchar_backlog): Delete.
	(readchar): Return a character unless load_each_byte is nonzero.
	Handle the case that readcharfun is Qget_emacs_mule_file_char or a
	cons.  If unread_char is not -1, simply return it.
	(unreadchar): Handle the case that readcharfun is
	Qget_emacs_mule_file_char or a cons.  Set unread_char if necessary.
	(read_multibyte): Delete.
	(readbyte_for_lambda, readbyte_from_file, readbyte_from_string)
	(read_emacs_mule_char): New functions.
	(Fload): Even if the file doesn't have the extention ".elc", if
	safe_to_load_p returns a positive version number, assume that the
	file contains bytecompiled code.  If the version is less than 22,
	load the file while decoding multibyte sequences by emacs-mule.
	(readevalloop): Don't use readchar_backlog.
	(Fread): Likewise.  Pay attention to the case that STREAM is a cons.
	(Fread_from_string): Pay attention to the case that STREAM is a cons.
	(read_escape): Delete the arg BYTEREP.
	(read1): Set load_each_byte to 1 temporarily while handling
	#@NUMBER.  Don't call read_multibyte.
	(read_vector): Call Fread with a cons.  If readcharfun is
	Qget_emacs_mule_file_char, decode the read string by emacs-mule.
	(read_list): If doc_reference is 2, make the cdr part string as unibyte.
	(syms_of_lread): Intern and staticpro Qget_emacs_mule_file_char
	and Qload_force_doc_strings.

2008-02-01  Kenichi Handa  <handa@m17n.org>

	* xdisp.c (face_before_or_after_it_pos): Call
	FETCH_MULTIBYTE_CHAR with byte postion, not char position.

2008-02-01  Kenichi Handa  <handa@m17n.org>

	* character.h (TRAILING_CODE_P): New macro.
	(MAYBE_UNIFY_CHAR): Adjust for the change of Funify_charset.
	(string_char_with_unification): Fix prototype.
	(Vscript_alist): Extern it.

	* character.c (Vscript_alist): New variable.
	(string_char_with_unification, str_as_unibyte)
	(string_escape_byte8): Add `const' to local variables.
	(syms_of_character): Declare script-alist as a Lisp variable.

	* charset.h (Vcharset_ordered_list): Extern it.
	(charset_ordered_list_tick): Extern it.
	(EMACS_MULE_LEADING_CODE_PRIVATE_11)
	(EMACS_MULE_LEADING_CODE_PRIVATE_12)
	(EMACS_MULE_LEADING_CODE_PRIVATE_21)
	(EMACS_MULE_LEADING_CODE_PRIVATE_22): New macros
	(Funify_charset): Adjust for the change of Funify_charset.

	* charset.c (charset_ordered_list_tick): New variable.
	(Fdefine_charset_internal): Increment charset_ordered_list_tick.
	(Funify_charset): New optional arg DEUNIFY.  If it is non-nil,
	deunify intead of unify a charset.
	(string_xstring_p): Add `const' to local variables.
	(find_charsets_in_text): Add `const' to arguemnts and local variables.
	(encode_char): Adjust for the change of Funify_charset.  Fix
	detecting of invalid code.
	(Fset_charset_priority): Increment charset_ordered_list_tick.
	(Fmap_charset_chars): Fix handling of default value for FROM_CODE
	and TO_CODE.

	* coding.c (LEADING_CODE_PRIVATE_11, LEADING_CODE_PRIVATE_12)
	(LEADING_CODE_PRIVATE_21, LEADING_CODE_PRIVATE_22): Delete macros.
	Changed callers to use EMACS_MULE_LEADING_CODE_PRIVATE_11, etc.
	(decode_coding_ccl, consume_chars)
	(Ffind_coding_systems_region_internal)
	(Fcheck_coding_systems_region): Add `const' to local variables.

	* print.c (print_object): Use octal form for printing the
	contents of a bool vector.

2008-02-01  Dave Love  <fx@gnu.org>

	* lread.c (Fload) <!load_dangerous_libraries>: Don't leak fd.
	<version == 20>: Refuse to load.

2008-02-01  Dave Love  <fx@gnu.org>

	* fns.c: Move coding.h.
	(Qcodeset, Qdays, Qmonths): New.
	(concat): Use CHARACTERP instead of INTERGERP.
	(Flocale_codeset): Delete.
	(Flanginfo): New function.
	(syms_of_fns): Change accordingly.

	* coding.c (adjust_coding_eol_type): Fix eol_type/eol_seen mixup.

2008-02-01  Dave Love  <fx@gnu.org>

	* casetab.c (init_casetab_once, init_casetab_once): Fix
	CHAR_TABLE_SET call.

	* category.c (Fmodify_category_entry): Fix CATEGORY_MEMBER call.

	* character.c (syms_of_character): Fix CHAR_TABLE_SET call.

	* charset.c (Fmap_charset_chars): Check args.  Convert Lisp types.
	(load_charset_map, Fdeclare_equiv_charset, Fencode_char)
	(Fset_charset_priority, syms_of_charset): Convert Lisp types.

	* charset.h (CHECK_CHARSET_GET_ID): Use XINT on AREF result.

	* coding.c (ENCODE_DESIGNATION, decode_eol)
	(make_conversion_work_buffer, code_conversion_restore)
	(Fdefine_coding_system_internal): Convert Lisp types.
	(code_conversion_restore): Use EQ, not ==.
	(Fencode_coding_string): Fix code_convert_string call.

	* coding.h (code_convert_region): Fix prototype.

	* dispextern.h (redraw_frame, redraw_garbaged_frames): Remove.

	* fontset.c (fontset_ref, fontset_set, fs_load_font)
	(Ffontset_info): Convert Lisp types.

	* syntax.h (SYNTAX_ENTRY_INT): Don't use make_number.

	* xterm.c (note_mouse_movement): Fix call of window_from_coordinates.

	* xdisp.c (display_mode_element): Fix call of Fset_text_properties.

	* chartab.c: Include "...h", not <...h> in some cases.

	* callproc.c (Fcall_process): Remove unused variables.

2008-02-01  Dave Love  <fx@gnu.org>

	* coding.c (Fset_coding_system_priority): Allow null arg list.

2008-02-01  Dave Love  <fx@gnu.org>

	* minibuf.c (Fminibuffer_complete_word): Remove unused var.
	(Fself_insert_and_exit): Use CHARACTERP.

	* callproc.c (Fcall_process): Remove unused vars.

	* xterm.c (XTread_socket): Add extra dead keysyms.

	* xdisp.c (decode_mode_spec_coding): Use CHARACTERP.

	* dispextern.h: Remove prototypes for redraw_frame,
	redraw_garbaged_frames.

	* cmds.c (Fself_insert_command): Use CHARACTERP.

	* chartab.c (make_sub_char_table): Remove unused var.
	(Fset_char_table_default, Fmap_char_table): Doc fix.

	* keymap.c (access_keymap): Remove generic char code.
	(push_key_description): Use CHARACTERP.

2008-02-01  Dave Love  <fx@gnu.org>

	* charset.c: Doc fixes.
	(Funify_charset): Extra checking.

2008-02-01  Dave Love  <fx@gnu.org>

	* lread.c: Remove some unused variables.
	(safe_to_load_p): If safe, return the magic number version byte.
	(Fload): Maybe use load-with-code-conversion.

2008-02-01  Kenichi Handa  <handa@m17n.org>

	* category.c (Fmodify_category_entry): Don't modify the contents
	of category_set for characters out of the range.  Avoid
	unnecessary modification.

	* character.h (MAYBE_UNIFY_CHAR): Adjust for the change of
	Vchar_unify_table.  The default value of the table is now nil.

	* character.c (syms_of_character): Setup Vchar_width_table for
	eight-bit-control and raw-byte chars.

	* charset.h (enum define_charset_arg_index): Delete
	charset_arg_parents and add charset_arg_subset and
	charset_arg_superset.
	(enum charset_attr_index): Delete charset_parents and add
	charset_subset and charset_superset.
	(enum charset_method): Delete CHARSET_METHOD_INHERIT and add
	CHARSET_METHOD_SUBSET and CHARSET_METHOD_SUPERSET.
	(CHARSET_ATTR_PARENTS, CHARSET_PARENTS): Delete.
	(CHARSET_ATTR_SUBSET, CHARSET_ATTR_SUPERSET, CHARSET_SUBSET)
	(CHARSET_SUPERSET): New macros.
	(charset_work): Extern it.
	(ENCODE_CHAR): Use charset_work.
	(CHAR_CHARSET_P): Adjust for the change of encoder format.
	(map_charset_chars): Extern it.

	* charset.c (load_charset_map): Set the default value of encoder
	and deunifier char-tables to nil.
	(map_charset_chars): Change argument.  Change callers.  Use
	map_char_table_for_charset instead of map_char_table.
	(Fmap_charset_chars): New optional args from_code and to_code.
	(Fdefine_charset_internal): Adjust for the change of
	`define-charset' (:parents -> :subset or :superset).
	(charset_work): New variable.
	(encode_char, syms_of_charset): Adjust for the change of
	Fdefine_charset_internal.
	(Ffind_charset_string): Setup the vector `charsets' correctly.

	* chartab.c (sub_char_table_ref_and_range): New arg default.  Fix
	the previous change.
	(char_table_ref_and_range): Adjust for the above change.
	(map_sub_char_table_for_charset): New function.
	(map_char_table_for_charset): New function.

	* keymap.c (describe_vector): Handle a char-table directly here.
	(describe_char_table): Delete.

	* lisp.h (map_charset_chars): Delete.

2008-02-01  Dave Love  <fx@gnu.org>

	* fns.c (count_combining): Comment out (unused).
	(Flocale_codeset): New.
	(syms_of_fns): Defsubr it.

	* config.in (HAVE_PTY_H, HAVE_SIZE_T, HAVE_LANGINFO_CODESET): New.
	(size_t): Remove.

2008-02-01  Dave Love  <fx@gnu.org>

	* Makefile.in (chartab.o): Depend on charset.h

2008-02-01  Kenichi Handa  <handa@m17n.org>

	* character.c (syms_of_character): Set the default value of
	Vprintable_chars to Qnil.

2008-02-01  Dave Love  <fx@gnu.org>

	* Makefile.in (lisp, shortlisp): Change indian.elc to indian.el.

2008-02-01  Kenichi Handa  <handa@m17n.org>

	* charset.c (load_charset_map): Handle the case that from < to
	correctly.

	* coding.c (encode_coding_emacs_mule, encode_coding_iso_2022)
	(encode_coding_sjis, encode_coding_big5, encode_coding_charset):
	Pay attention to raw-8-bit chars.

2008-02-01  Kenichi Handa  <handa@m17n.org>

	* Makefile.in (lisp, shortlisp): Change chinese.elc to chinese.el.
	It is not bytecompiled now.

	* charset.c (charset_jisx0201_roman, charset_jisx0208_1978)
	(charset_jisx0208): New variables.
	(Fdefine_charset_internal): Setup them if appropriate.
	(init_charset_once): Initialize them to -1.

	* charset.h (charset_jisx0201_roman, charset_jisx0208_1978)
	(charset_jisx0208): Extern them.

	* coding.c (CODING_ISO_FLAG_USE_ROMAN): New macro
	(CODING_ISO_FLAG_USE_OLDJIS): New macro.
	(CODING_ISO_FLAG_FULL_SUPPORT): Change macro definition.
	(setup_iso_safe_charsets): Fix arguments to Fassq.
	(DECODE_DESIGNATION, ENCODE_ISO_CHARACTER_DIMENSION1)
	(ENCODE_ISO_CHARACTER_DIMENSION2): Pay attention to
	CODING_ISO_FLAG_USE_ROMAN and CODING_ISO_FLAG_USE_OLDJIS.
	(encode_coding_iso_2022): Change the 1st arg to
	ENCODE_ISO_CHARACTER to a variable.

2008-02-01  Kenichi Handa  <handa@m17n.org>

	* charset.h (enum define_charset_arg_index): New enums
	charset_arg_min_code and charset_arg_max_code.
	(struct charset): New member char_index_offset.

	* charset.c (CODE_POINT_TO_INDEX, INDEX_TO_CODE_POINT):
	Take charset->char_index_offset into account.
	(Fdefine_charset_internal): Handle args[charset_arg_min_code] and
	args[charset_arg_max_code].  Setup charset.char_index_offset.
	(syms_of_charset): Fix args to Fdefine_charset_internal.

2008-02-01  Dave Love  <fx@gnu.org>

	* coding.c (decode_coding_utf_8): Reject overlong sequences.

2008-02-01  Dave Love  <fx@gnu.org>

	* coding.c: Doc fixes.
	(Fcoding_system_aliases): Fix return value.
	(Qmac): Remove (duplicated) definition.

2008-02-01  Dave Love  <fx@gnu.org>

	* charset.c (Fcharset_priority_list, Fset_charset_priority): New
	functions.

	* character.c (Fstring): Doc fix.

	* charset.c (Fdefine_charset_alias): Update Vcharset_list.

	* fontset.c (Ffontset_info): Doc fix.  Return charset names, not
	ids.
	(font-encoding-alist): Doc fix.

2008-02-01  Dave Love  <fx@gnu.org>

	* term.c (costs_set): Declare static, non-initialized for pcc.
	(encode_terminal_code): Remove unused var.

	* keyboard.c (kbd_buffer_store_event): Fix interrupt_signal decl
	for K&R.

	* xterm.c (xlwmenu_window_p): Fix prototype for K&R.

	* coding.c (setup_iso_safe_charsets): Fix arg decl for K&R.
	(suffixes): Move out of make_subsidiaries for K&R.

	* charset.c (map_charset_chars): Fix c_function declaration for K&R.

	* lisp.h (DEFUN) [!PROTOTYPES]: Remove spurious `args'.

2008-02-01  Dave Love  <fx@gnu.org>

	* data.c (Fchar_or_string_p): Doc fix.  Use CHARACTERP.

	* category.c (Fmodify_category_entry): Doc fix.  Remove unused vars.

2008-02-01  Yong Lu <lyongu@asia-infonet.com>

	* charset.c (Fdefine_charset_internal): Fix argument to bzero.

	* coding.c (decode_coding_charset): Workaround for the bug of GCC 2.96.

2008-02-01  Kenichi Handa  <handa@m17n.org>

	* Makefile.in (lisp, shortlisp): Change cyrillic.elc to cyrillic.el,
	vietnamese.elc to vietnamese.el.  They are not bytecompiled now.

2008-02-01  Kenichi Handa  <handa@m17n.org>

	* coding.c (decode_coding_charset): Adjust for the change of
	Fdefine_coding_system_internal.
	(Fdefine_coding_system_internal): For a coding system of
	`charset' type, store a list of charset IDs in
	`charset_attr_charset_valids' element of coding attributes.

2008-02-01  Kenichi Handa  <handa@m17n.org>

	* coding.c (ONE_MORE_BYTE_NO_CHECK): Increment consumed_chars.
	(emacs_mule_char): New arg src.  Delete arg `composition'.  Change
	caller.  Handle 2-byte and 3-byte charsets correctly.
	(DECODE_EMACS_MULE_COMPOSITION_RULE_20): Rename from
	DECODE_EMACS_MULE_COMPOSITION_RULE.  Change caller.
	(DECODE_EMACS_MULE_COMPOSITION_RULE_21): New macro.
	(DECODE_EMACS_MULE_21_COMPOSITION): Call
	DECODE_EMACS_MULE_COMPOSITION_RULE_21.  Produce correct annotation
	sequence.
	(decode_coding_emacs_mule): Handle composition correctly.  Rewind
	`src' and `consumed_chars' correctly before calling emacs_mule_char.
	(DECODE_COMPOSITION_START): Correctly handle the case of altchar
	and alt&rule composition.
	(decode_coding_iso_2022): Handle composition correctly.
	(init_coding_once): Setup emacs_mule_bytes for private charsets.

	* charset.c (Fdefine_charset_internal): Fix bug for the case of
	re-defining a charset.  If the charset has :emacs-mule-id, setup
	emacs_mule_bytes.
	(Fmake_char): If CODE1 is nil, use the minimum code of the charset.

2008-02-01  Kenichi Handa  <handa@m17n.org>

	* coding.c (encode_coding_iso_2022, encode_coding_sjis)
	(encode_coding_big5, encode_coding_charset): If coding requires safe
	encoding, produce a character specified by
	CODING_INHIBIT_CHARACTER_SUBSTITUTION.

2008-02-01  Dave Love  <fx@gnu.org>

	* xterm.c (XSetIMValues): Declare.

	* process.c: Conditionally include sys/wait.h, pty.h.

	* print.c (print_object): Fix print format for 64-bit systems.

	* keyboard.c (modify_event_symbol): Fix print format for 64-bit systems.

	* buffer.c (emacs_strerror): Declare.

	* fontset.c (Fclear_face_cache): Declare.
	(accumulate_font_info): Comment-out (unused).
	(face_for_char, Fset_fontset_font, Ffontset_info): Remove unused
	variables.

	* character.h (string_escape_byte8): Declare.

	* charset.c (load_charset_map, load_charset_map_from_file): Remove
	unused vars.
	(Fdefine_charset_internal, Fsplit_char, syms_of_charset)
	(Fmap_charset_chars): Doc fix.

	* coding.c (Vchar_coding_system_table, Qchar_coding_system): Remove.
	(Fset_coding_system_priority, Fset_coding_system_priority)
	(Fdefine_coding_system_internal): Doc fix.

2008-02-01  Dave Love  <fx@gnu.org>

	* s/osf5-0.h (C_SWITCH_SYSTEM) [!__GNUC__]: Remove -nointrinsics.

2008-02-01  Kenichi Handa  <handa@m17n.org>

	* character.c (string_escape_byte8): Make multibyte string with
	correct size.

	* charset.c (Fmake_char): Delete unnecessary code.

2008-02-01  Kenichi Handa  <handa@m17n.org>

	* xfns.c (x_encode_text): Allocate coding.destination here, and
	call encode_coding_object with dst_object Qnil.

	* buffer.c (Fset_buffer_multibyte): Convert 8-bit bytes to
	multibyte form correctly.

	* fontset.c (fs_load_font): Check fontp->full_name (not fontname)
	against Vfont_encoding_alist.

	* coding.c (Fdecode_sjis_char): Fix typo (0x7F->0xFF).  Fix the
	handling of charset list.
	(encode_coding_iso_2022): Setup coding->safe_charsets in advance.
	(decode_coding_object): Move point to coding->dst_pos before
	calling post-read-conversion function.
	(encode_coding_object): Give correct arguments to
	pre-write-conversion.  Ignore the return value of
	pre-write-conversion function.  Pay attention to the case that
	pre-write-conversion changes the current buffer.  If dst_object is
	Qt, even if coding->src_bytes is zero, allocate at least one byte
	to coding->destination.

	* coding.h (JIS_TO_SJIS): Fix typo (j1->s1, j2->s2).

	* charset.c (Fmake_char): Make it more backward compatible.
	(Fmap_charset_chars): Fix docstring.

2008-02-01  Dave Love  <fx@gnu.org>

	* coding.c: Doc fixes.
	(Fdefine_coding_system_alias): Use names, not symbols, in
	coding-system-alist.

2008-02-01  Kenichi Handa  <handa@m17n.org>

	* fontset.c (free_realized_fontsets): Call Fclear_face_cache instead
	of calling free_realized_face.

2008-02-01  Yong Lu <lyongu@asia-infonet.com>

	* charset.c (read_hex): Don't treat SPC as a comment starter.
	(decode_char): If CODE_POINT_TO_INDEX retruns -1, always return -1.
	(Fdecode_char): Fix typo.

2008-02-01  Kenichi Handa  <handa@m17n.org>

	* charset.h (struct charset): New member `code_space_mask'.

	* coding.c (coding_set_source): Delete the local variable beg_byte.
	(encode_coding_charset, Fdefine_coding_system_internal):
	Delete the local variable charset.
	(Fdefine_coding_system_internal): Setup
	attrs[coding_attr_charset_valids] correctly.

	* charset.c (CODE_POINT_TO_INDEX): Utilize `code_space_mask'
	member to check if CODE is valid or not.
	(Fdefine_charset_internal): Initialize `code_space_mask' member.
	(encode_char): Before calling CODE_POINT_TO_INDEX, check if CODE
	is within the range of charset->min_code and carset->max_code.

2008-02-01  Dave Love  <fx@gnu.org>

	* syntax.h (syntax_temp) [!__GNUC__]: Declare.

	* dispextern.h (generate_ascii_font): Fix return type.

	* xfaces.c (generate_ascii_font): Fix arg declaration.

	* coding.c (coding_inherit_eol_type)
	(Fset_terminal_coding_system_internal)
	(Fset_safe_terminal_coding_system_internal): Fix arg declarations.

2008-02-01  Kenichi Handa  <handa@m17n.org>

	* coding.c (decode_coding_charset, encode_coding_charset): Handle
	multiple charsets correctly.

2008-02-01  Kenichi Handa  <handa@m17n.org>

	* search.c (boyer_moore): Fix handling of mulitbyte character
	translation.

	* xdisp.c (display_mode_element): When the variable `elt' is
	changed, update `this' and `lisp_string'.

2008-02-01  Kenichi Handa  <handa@m17n.org>

	* buffer.c (Fset_buffer_multibyte): Fix 8-bit char handling.

	* callproc.c (Fcall_process): Be sure to give the current buffer
	to decode_coding_c_string.  Update PT and PT_BYTE after the insertion.

	* charset.c (struct charset_map_entries): New struct.
	(load_charset_map): Rename from parse_charset_map.  New args
	entries and n_entries.  Change caller.
	(load_charset_map_from_file): Rename from load_charset_map.
	Change caller.  New arg control_flag.  Call load_charset_map at
	the tail.
	(load_charset_map_from_vector): New function.
	(Fdefine_charset_internal): Setup charset.compact_codes_p.
	(encode_char): If the charset is compact, change a character index
	to a code point.

	* coding.c (coding_alloc_by_making_gap): Check the case that the
	source and destination are the same correctly.
	(decode_coding_raw_text): Set coding->consumed_char and
	coding->consumed to 0.
	(produce_chars): If coding->chars_at_source is nonzero, update
	coding->consumed_char and coding->consumed before calling
	alloc_destination.
	(Fdefine_coding_system_alias): Register ALIAS in
	Vcoding_system_alist.
	(syms_of_coding): Define `no-convesion' coding system at the tail.

	* fileio.c (Finsert_file_contents): Set coding_system instead of
	val.  If the current buffer is multibyte, always call
	decode_coding_gap.

	* xfaces.c (try_font_list): Give higher priority to fontset's
	family than face's family.

2008-02-01  Kenichi Handa  <handa@m17n.org>

	* callproc.c (Fcall_process): Be sure to give the current buffer
	to decode_coding_c_string.

	* xfaces.c (try_font_list): Give a family specified in a fontset
	higher priority than a family specified in a face.

2008-02-01  Kenichi Handa  <handa@m17n.org>

	* fileio.c (Finsert_file_contents): Fix calculation of `inserted'.
	Fix arguments to insert_from_buffer.

	* xdisp.c (display_mode_element): Fix calculation of `bytepos'.

2008-02-01  Kenichi Handa  <handa@m17n.org>

	* coding.c (produce_chars): Set the variable `multibytep' correctly.
	(decode_coding_gap): Set coding->dst_multibyte correctly.

2008-02-01  Kenichi Handa  <handa@m17n.org>

	* coding.c (encode_coding_utf_8): Initialize produced_chars to 0.
	(decode_coding_utf_16): Fix converting high and low bytes to code-point.
	(encode_coding_utf_16): Substitute coding->default_char for
	non-Unicode characters.
	(decode_coding): Don't call record_insert here.
	(setup_coding_system): Initialize `surrogate' of
	coding->spec.utf_16 to 0.
	(EMIT_ONE_BYTE): Fix for multibyte case.

	* insdel.c (insert_from_gap): Call record_insert.

2008-02-01  Kenichi Handa  <handa@m17n.org>

	* casefiddle.c (casify_region): Fix multibyte case.

	* character.c (c_string_width): Add return type `int'.
	(char_string_with_unification): Delete arg ADVANCED.

	* character.h (CHAR_VALID_P): Don't call CHARACTERP.
	(CHAR_STRING): Adjust for the change of char_string_with_unification.
	(CHAR_STRING_ADVANCE): Make it do-while statement.

	* chartab.c (sub_char_table_set_range): Optimize for the case
	DEPTH == 3.  Add workaround code for a GCC optimization bug.

	* charset.c (parse_charset_map): Remove an unused variable.

	* coding.c: Delete unused variables.

	* fileio.c (Finsert_file_contents): Set coding_system to Qnil
	earlier.  If inserted is zero and the coding system doesn't
	require flushing, don't call decode_coding_gap.

	* syntax.h (SET_RAW_SYNTAX_ENTRY): Don't call make_number.

2008-02-01  Kenichi Handa  <handa@m17n.org>

	The following changes are for using Unicode as an internal
	character model, and use UTF-8 format for buffer/string
	representation.

	* .gdbinit (xchartable): Adjust for the change of char table structure.
	(xsubchartable, xcoding, xcharset, xcurbuf): New commands.

	* Makefile.in (obj): Add character.o and chartab.o.
	(lisp, shortlisp): Remove utf-8.elc:
	(*.o): For many files, change dependency on charset.h to
	character.h, and add dependency on character.h.
	(character.o, chartab.o): New targets.

	* abbrev.c, bytecode.c, casefiddle.c, cmds.c, dispnew.c, doc.c:
	* doprnt.c, dosfns.c, frame.c, marker.c, minibuf.c, msdos.c:
	* w16select.c, w32bdf.c, w32console.c: Include "character.h" instead
	of "charset.h".

	* dired.c, filelock.c: Include "character.h".

	* alloc.c: Include "character.h" instead of "charset.h".
	(Fmake_char_table, make_sub_char_table): Move to chartab.c.
	(syms_of_alloc): Remove defsubr for Smake_char_table.

	* buffer.c: Include "character.h" instead of "charset.h", don't
	include "coding.h".
	(Fset_buffer_multibyte): Adjust for UTF-8.

	* buffer.h: EXFUN Fbuffer_live_p.

	* callproc.c: Include "character.h" instead of "charset.h".
	(Fcall_process): Big change for the new code-conversion APIs.

	* casetab.c: Include "character.h" instead of "charset.h".
	(set_canon, set_identity, shuffle): Adjust for the new
	map_char_table spec.
	(init_casetab_once): Call CHAR_TABLE_SET instead of directly
	accessing the char table structure.

	* chartab.c: New file that implements char table.

	* category.c: Include "character.h".
	(copy_category_entry): New function.
	(copy_category_table): Call map_char_table and copy_category_entry.
	(Fmake_category_table): Initialize all top-vel slots.
	(char_category_set): New function.
	(modify_lower_category_set): Delete.
	(Fmodify_category_entry): Call char_table_ref_and_range.

	* category.h (CATEGORY_SET): Just call char_category_set.

	* ccl.c: Include "character.h".
	(Qccl, Qcclp): New variables.
	(CCL_WRITE_CHAR): Alway treat the arg CH as a character even if
	it's less than 256.
	(CCL_WRITE_MULTIBYTE_CHAR): Delete.
	(CCL_WRITE_STRING, CCL_READ_CHAR): Adjust for the change of SRC
	and DST type.
	(ccl_driver): Change types of argument, adjust code accordingly.
	(Fccl_execute, Fccl_execute_on_string): Adjust for the change of
	ccl_driver.
	(syms_of_ccl): Intern and staticpro Qccl and Qcclp.

	* ccl.h (struct ccl_program): Delete members eol_type and multibyte.
	New members src_multibyte, dst_multibyte, consumed, and produced.
	(struct ccl_spec): Delete members decoder and encoder.  New member ccl.
	(CODING_SPEC_CCL_PROGRAM): New macro.
	(ccl_driver): Update prototype.
	(Qccl, Qcclp, Fccl_program_p): Extern them.
	(CHECK_CCL_PROGRAM): New macro.

	* character.c, character.h, chartab.c: New files.

	* charset.c: Mostly re-written.  Move character and multibyte sequence
	handling codes to character.c.

	* charset.h: Mostly re-written.  Move character and multibyte sequence
	handling codes to character.h.

	* coding.c, coding.h: Mostly re-written.

	* composite.c: Include "character.h" instead of "charset.h".
	(CHAR_WIDTH): Move to character.h.
	(HASH_KEY, HASH_VALUE): Delete.

	* composite.h (enum composition_method): Change order of enumeration
	symbols.

	* data.c: Include "character.h" instead of "charset.h".
	(Faref): Call CHAR_TABLE_REF for a char table.
	(Faset): Call CHAR_TABLE_SET for a char table.

	* dispextern.h (free_realized_face, check_face_attribytes)
	(generate_ascii_font): Extern them.
	(free_realized_multibyte_face): Delete extern.

	* disptab.h (DISP_CHAR_VECTOR): Adjust for the change of char
	table structure.

	* editfns.c: Include "character.h" instead of "charset.h".
	(Fchar_to_string): Always call CHAR_STRING.

	* emacs.c (main): Call init_charset_once, init_charset,
	syms_of_chartab, and syms_of_character.

	* fileio.c: Include "character.h" instead of "charset.h".
	(Finsert_file_contents): Big change for the new code-conversion API.
	(choose_write_coding_system, Fwrite_region): Likewise.
	(build_annotations_2): Delete.
	(e_write): Big change for the new code-conversion API.

	* fns.c: Include "character.h" instead of "charset.h".
	(copy_sub_char_table): Move to chartab.c.
	(Fcopy_sequence): Call copy_char_table for a char table.
	(concat): Delete codes calling count_multibyte.
	(string_char_to_byte, string_byte_to_char): Adjust for the new
	multibyte form.
	(internal_equal): Adjust for the change of char table structure.
	(Fchar_table_subtype, Fchar_table_parent, Fset_char_table_parent)
	(Fchar_table_extra_slot, Fset_char_table_extra_slot)
	(Fchar_table_range, Fset_char_table_range, Fset_char_table_default)
	(char_table_translate, optimize_sub_char_table)
	(Foptimize_char_table, map_char_table, Fmap_char_table): Move to
	chartab.c.
	(char_table_ref_and_index): Delete.
	(HASH_KEY, HASH_VALUE): Move to lisp.h.
	(Fmd5): Call preferred_coding_system instead of accessing
	Vcoding_category_list.  Adjust for the new code-conversion API.
	(syms_of_fns): Move defsubr for char table related functions to
	chartab.c.

	* fontset.c: Mostly re-written.

	* fontset.h (struct font_info): Change type of the member encoding_type.
	(enum FONT_SPEC_INDEX): New enum.
	(fontset_font_pattern, fs_load_font): Update prototype.
	(FS_LOAD_FONT): Adjust for the change of fs_load_font.

	* indent.c: Include "character.h" instead of "charset.h".
	(MULTIBYTE_BYTES_WIDTH): Call CHAR_WIDTH instead of WIDTH_BY_CHAR_HEAD.

	* insdel.c: Include "character.h" instead of "charset.h".
	(copy_text): Don't refer to Vnonascii_translation_table.
	(insert_from_gap): New function.

	* keyboard.c: Include "character.h" instead of "charset.h".
	(command_loop_1): Never call direct_output_forward_char before
	a non-ASCII character.
	(read_char): If Vkeyboard_translate_table is a char table, always
	translate a character.

	* keymap.c: Include "character.h".
	(store_in_keymap): Handle the case that IDX is a cons.
	(Fdefine_key): Handle the case that KEY is a cons and the car part
	is also a cons (range).
	(push_key_description): Adjust for the new character code.
	(describe_vector): Call describe_char_table for a char table.
	(describe_char_table): New function.

	* keymap.h (describe_char_table): Extern it.

	* lisp.h (enum pvec_type): New member PVEC_SUB_CHAR_TABLE.
	(XSUB_CHAR_TABLE, XSETSUB_CHAR_TABLE): New macros.
	(CHAR_TABLE_ORDINARY_SLOTS, CHAR_TABLE_SINGLE_BYTE_SLOTS)
	(SUB_CHAR_TABLE_ORDINARY_SLOTS, SUB_CHAR_TABLE_STANDARD_SLOTS):
	Delete.
	(CHAR_TABLE_REF, CHAR_TABLE_SET): Adjust for the new char table
	structure.
	(CHAR_TABLE_TRANSLATE): Just call char_table_translate.
	(CHARTAB_SIZE_BITS_0, CHARTAB_SIZE_BITS_1, CHARTAB_SIZE_BITS_2)
	(CHARTAB_SIZE_BITS_3): New macros.
	(chartab_size): Extern it.
	(struct Lisp_Char_Table): Re-design.
	(struct Lisp_Sub_Char_Table): New structure.
	(HASH_KEY, HASH_VALUE): Move from fns.c.
	(CHARACTERBITS): Define as 22.
	(GLYPH_MASK_FACE, GLYPH_MASK_CHAR): Adjust for the above change.
	(SUB_CHAR_TABLE_P): Check PVEC_CHAR_TABLE.
	(GC_SUB_CHAR_TABLE_P): New macro.
	(Fencode_coding_string, Fdecode_coding_string): Update EXFUN.
	(code_convert_string_norecord): Deleted extern.
	(init_character_once, syms_of_character, init_charset)
	(syms_of_composite, Qeq, Fmakehash, insert_from_gap): Extern them.

	* lread.c: Include "character.h".
	(read_multibyte): New arg NBYTES.
	(read_escape): Change the meaning of returned *BYTEREP.
	(to_multibyte): Delete.
	(read1): Adjust the handling of char table and string.

	* print.c: Include "character.h" instead of "charset.h".
	(print_string): Convert 8-bit raw bytes to octal form by
	string_escape_byte8.
	(print_object): Adjust for the new multibyte form.  Print 8-bit
	raw bytes always in octal form.  Handle sub char table correctly.

	* process.c: Include "character.h" instead of "charset.h".
	(read_process_output, send_process): Adjust for the new
	code-conversion API.

	* puresize.h (BASE_PURESIZE): Increase.

	* regex.c: Include "character.h" instead of "charset.h".
	(BYTE8_TO_CHAR, CHAR_BYTE8_P) [not emacs]: New dummy macros.
	(regex_compile): Accept a range whose starting and ending
	character have different leading bytes.
	(analyse_first): Adjust for the above change.

	* search.c: Include "character.h" instead of "charset.h".
	(search_buffer, boyer_moore): Adjust for the new multibyte form.
	(Freplace_match): Adjust for the change of multibyte_char_to_unibyte.

	* syntax.c: Include "character.h" instead of "charset.h".
	(syntax_parent_lookup): Delete.
	(Fmodify_syntax_entry): Accept a cons as CHAR.
	(skip_chars): Adjust for the new multibyte form.
	(init_syntax_once): Call char_table_set_range instead of directly
	accessing the structure of a char table.

	* syntax.h (SET_RAW_SYNTAX_ENTRY): Call CHAR_TABLE_SET.
	(SYNTAX_ENTRY_FOLLOW_PARENT): Delete macro.
	(SET_RAW_SYNTAX_ENTRY_RANGE): New macro.
	(SYNTAX_ENTRY_INT): Call CHAR_TABLE_REF.

	* term.c: Include "buffer.h" and "character.h".
	(encode_terminal_code, write_glyphs): Adjust for the new
	code-conversion API.
	(produce_glyphs): Call CHAR_WIDTH instead of CHARSET_WIDTH.

	* w32term.c (x_new_font): Adjust for the change of FS_LOAD_FONT.

	* xdisp.c: Include "character.h".
	(get_next_display_element): Adjust for the new multibyte form.
	(disp_char_vector): Adjust for the new char table structure.
	(decode_mode_spec_coding): Adjust for the new structure of
	coding system.
	(decode_mode_spec): Adjust for the new code-conversion API.

	* xfaces.c: Include "character.h" instead of "charset.h".
	(load_face_font): Adjust for the change of choose_face_font and
	FS_LOAD_FONT.
	(generate_ascii_font): New function.
	(set_lface_from_font_name): Adjust for the change of FS_LOAD_FONT.
	(set_font_frame_param): Adjust for the change of choose_face_font.
	(free_realized_face): Make it public.
	(free_realized_faces_for_fontset): Rename from
	free_realized_multibyte_face.  Free also faces realized for ASCII.
	(choose_face_font): Change arguments.  Adjust for the change of
	fontset_font_pattern and FS_LOAD_FONT.

	* xfns.c: Include "character.h".
	(x_encode_text): Adjust for the new code-conversion API.

	* xselect.c: Don't include "charset.h".
	(selection_data_to_lisp_data): Adjust for the new code conversion API.

	* xterm.c: Include "character.h".
	(x_encode_char): New argument CHARSET.  Change caller.
	(x_get_char_face_and_encoding, x_get_glyph_face_and_encoding):
	Call ENCODE_CHAR instead of SPLIT_CHAR.
	(x_produce_glyphs): Don't check Vnonascii_translation_table Call
	CHAR_WIDTH instead of CHARSET_WIDTH.
	(XTread_socket): Adjust for the new code-conversion API.
	(x_new_font): Adjust for the change of FS_LOAD_FONT.
	(x_load_font): Adjust for the change of struct font.

2008-02-01  Stefan Monnier  <monnier@iro.umontreal.ca>

	* xfaces.c (face_at_buffer_position): Remove unused vars.

2008-02-01  Kenichi Handa  <handa@ni.aist.go.jp>

	* ccl.c (CCL_WRITE_CHAR, CCL_WRITE_MULTIBYTE_CHAR):
	Fix overflow checking.

2008-02-01  Kenichi Handa  <handa@ni.aist.go.jp>

	* ccl.c (CCL_WRITE_CHAR, CCL_WRITE_MULTIBYTE_CHAR, ccl_driver):
	Cancel previous change.

2008-01-31  Kenichi Handa  <handa@ni.aist.go.jp>

	* ccl.c (CCL_WRITE_CHAR): Increment extra_bytes only when
	ccl->eight_bit_control.  Fix check for buffer overflow.
	(CCL_WRITE_MULTIBYTE_CHAR): Fix check for buffer overflow.
	(ccl_driver): Initialize extra_bytes to 0.

2008-01-31  Kenichi Handa  <handa@ni.aist.go.jp>

	* keyboard.c (make_ctrl_char): If C is a multibyte character, just
	return it ORed with ctrl_modifier.

2008-01-29  Miles Bader  <miles@gnu.org>

	* macterm.c (XTset_vertical_scroll_bar): Fix merge mistake.

2008-01-28  Jason Rumney  <jasonr@gnu.org>

	* w32.c (stat): Don't double check for networked drive.

2008-01-28  Stefan Monnier  <monnier@iro.umontreal.ca>

	* window.c (run_window_configuration_change_hook): New function.
	Code extracted from set_window_buffer.  Set the selected frame.
	(set_window_buffer): Use it.
	* window.h (run_window_configuration_change_hook): Declare.
	* dispnew.c (change_frame_size_1): Use it instead of set-window-buffer.

	* keyboard.c (read_char): Yet another int/Lisp_Object mixup (YAILOM).

2008-01-27  Dan Nicolaescu  <dann@ics.uci.edu>

	* Makefile.in: Remove references to unused macros.

2008-01-26  Eli Zaretskii  <eliz@gnu.org>

	* w32.c (g_b_init_get_sid_sub_authority)
	(g_b_init_get_sid_sub_authority_count): New static variables.
	(GetSidSubAuthority_Proc, GetSidSubAuthorityCount_Proc): New typedefs.
	(get_sid_sub_authority, get_sid_sub_authority_count): New functions.
	(init_user_info): Use them to retrieve uid and gid.
	Use 500/513, the Windows defaults, as Administrator's uid/gid.
	(fstat): Use pw_uid and pw_gid from the_passwd structure for
	st_uid and st_gid of the file.

2008-01-26  Jason Rumney  <jasonr@gnu.org>

	* w32.c (logon_network_drive): New function.
	(stat): Use it.

2008-01-26  Chong Yidong  <cyd@stupidchicken.com>

	* xdisp.c (pos_visible_p): Handle the case where charpos falls on
	invisible text covered with an ellipsis.

2008-01-25  Richard Stallman  <rms@gnu.org>

	* xdisp.c (redisplay_window): Run Qwindow_text_change_functions and
	jump back to beginning.  Move some other initializations after that.
	(Qwindow_text_change_functions, Vwindow_text_change_functions):
	New variables.
	(syms_of_xdisp): Init them.

	* keyboard.c (read_char): Restore echo_message_buffer after redisplay.

	* buffer.c (reset_buffer_local_variables):
	Implement `permanent-local-hook'.
	(Qpermanent_local_hook): New variable.
	(syms_of_buffer): Init and staticpro it.

2008-01-25  Michael Albinus  <michael.albinus@gmx.de>

	* dbusbind.c (xd_retrieve_arg): Pacify GCC on x86_64 GNU/Linux.

2008-01-25  Thien-Thi Nguyen  <ttn@gnuvola.org>

	* fns.c (Fclrhash): Return TABLE.

2008-01-23  YAMAMOTO Mitsuharu  <mituharu@math.s.chiba-u.ac.jp>

	* macterm.c (x_scroll_bar_create): Initialize bar->redraw_needed_p.
	(XTset_vertical_scroll_bar): Redraw scroll bar if bar->redraw_needed_p
	is set even without positional changes.
	(x_scroll_bar_clear): Set bar->redraw_needed_p.

	* macterm.h (struct scroll_bar): New member `redraw_needed_p'.

2008-01-23  Jason Rumney  <jasonr@gnu.org>

	* xterm.c (handle_one_xevent): Revert to counting chars not bytes.

	* w32term.c (w32_read_socket) <WM_CHAR>: Decode characters outside
	the unicode range available in MULE by locale-coding-system.
	Improve dbcs lead byte detection.  Set event timestamp and modifiers
	earlier.

2008-01-23  YAMAMOTO Mitsuharu  <mituharu@math.s.chiba-u.ac.jp>

	* mac.c (mac_emacs_pid) [MAC_OSX]: New variable.
	[MAC_OSX] (init_mac_osx_environment): Initialize it.
	[MAC_OSX] (mac_try_close_socket) [SELECT_USE_CFSOCKET]:	Return 0
	when used on child processes.

2008-01-21  Michael Albinus  <michael.albinus@gmx.de>

	* dbusbind.c (Fdbus_method_return_internal): Rename from
	Fdbus_method_return.
	(Fdbus_unregister_object): Move to dbus.el.
	(Fdbus_call_method, Fdbus_method_return_internal)
	(Fdbus_send_signal): Improve debug messages.

2008-01-20  Martin Rudalics  <rudalics@gmx.at>

	* undo.c (undo_inhibit_record_point): New variable.
	(syms_of_undo): Initialize it.
	(record_point): Don't record point when undo_inhibit_record_point
	is set.

2008-01-19  Stefan Monnier  <monnier@iro.umontreal.ca>

	* process.c (list_processes_1): Don't use SCHARS on a nil buffer name.

	* xdisp.c (Qauto_hscroll_mode): New var.
	(syms_of_xdisp): Initialize it.
	(hscroll_window_tree): Use it to lookup `auto-hscroll-mode' in each
	window's buffer.
	(hscroll_windows): Don't check automatic_hscrolling_p here.

	* window.c (set_window_buffer): Don't unnecessarily reset hscroll and
	vscroll if we're setting window-buffer to the value it already has.

2008-01-18  Dan Nicolaescu  <dann@ics.uci.edu>

	* m/intel386.h: Remove references to XENIX.

2008-01-17  Andreas Schwab  <schwab@suse.de>

	* m/amdx86-64.h (START_FILES, LIB_STANDARD): Use HAVE_LIB64_DIR
	instead of HAVE_X86_64_LIB64_DIR.
	* m/ibms390x.h (START_FILES, LIB_STANDARD): Likewise.

2008-01-17  Glenn Morris  <rgm@gnu.org>

	* m/ibms390x.h (START_FILES, LIB_STANDARD): Adjust value according
	to HAVE_X86_64_LIB64_DIR.

2008-01-16  Dan Nicolaescu  <dann@ics.uci.edu>

	* s/irix3-3.h:
	* s/irix4-0.h:
	* s/386-ix.h:
	* s/domain.h:
	* s/hpux9-x11r4.h:
	* s/hpux9shxr4.h: Remove files for systems no longer supported.

	* sysdep.c: Remove code containing references to symbols defined
	by unsupported systems.

2008-01-16  Glenn Morris  <rgm@gnu.org>

	* coding.c (select-safe-coding-system-function): Doc fix.

2008-01-15  Glenn Morris  <rgm@gnu.org>

	* config.in: Revert 2008-01-13 change: this is a generated file.

2008-01-13  Tom Tromey  <tromey@redhat.com>

	* lisp.h: Fix typo.

2008-01-13  Dan Nicolaescu  <dann@ics.uci.edu>

	* m/sequent-ptx.h:
	* m/sequent.h:
	* s/ptx.h:
	* s/ptx4-2.h:
	* s/ptx4.h: Remove files for systems no longer supported.

	* callproc.c (Fcall_process): Fix previous change.

2008-01-13  Dan Nicolaescu  <dann@ics.uci.edu>

	* unexsunos4.c: Remove file, system not supported anymore.

	* src/m/mips.h:
	* src/m/intel386.h:
	* callproc.c:
	* config.in:
	* ecrt0.c:
	* emacs.c:
	* fileio.c:
	* frame.c:
	* getpagesize.h:
	* keyboard.c:
	* lread.c:
	* process.c:
	* puresize.h:
	* sysdep.c:
	* systty.h:
	* syswait.h:
	* unexec.c:
	* xdisp.c:
	* alloc.c: Remove code containing references to symbols defined by
	unsupported systems.

2008-01-11  Kenichi Handa  <handa@ni.aist.go.jp>

	* coding.c (detect_coding_mask): Fix previous change.

2008-01-10  Chong Yidong  <cyd@stupidchicken.com>

	* process.c (wait_reading_process_output): Check for window
	changes caused by timers.

2008-01-09  Kenichi Handa  <handa@ni.aist.go.jp>

	* coding.c (detect_coding_iso2022): New arg
	latin_extra_code_state.  Allow Latin extra codes only
	when *latin_extra_code_state is nonzero.
	(detect_coding_mask): If there is a NULL byte, detect the encoding
	as UTF-16 or binary.  If Latin extra codes exist, detect the
	encoding as ISO-2022 only when there's no other proper encoding is
	found.

2008-01-08  YAMAMOTO Mitsuharu  <mituharu@math.s.chiba-u.ac.jp>

	* frame.c (Fmake_terminal_frame): Use #ifdef MAC_OS8 instead of
	#ifdef MAC_OS.

2008-01-08  Richard Stallman  <rms@gnu.org>

	* fileio.c (Ffile_name_directory, Fexpand_file_name): Doc fixes.

2008-01-06  Nick Roberts  <nickrob@snap.net.nz>

	* keyboard.c (parse_menu_item): Don't enclose key bindings on
	menu bar in parentheses.

2008-01-06  Dan Nicolaescu  <dann@ics.uci.edu>

	* m/7300.h:
	* m/acorn.h:
	* m/alliant-2800.h:
	* m/alliant.h:
	* m/alliant1.h:
	* m/alliant4.h:
	* m/altos.h:
	* m/amdahl.h:
	* m/apollo.h:
	* m/att3b.h:
	* m/aviion-intel.h:
	* m/aviion.h:
	* m/celerity.h:
	* m/clipper.h:
	* m/cnvrgnt.h:
	* m/convex.h:
	* m/cydra5.h:
	* m/delta88k.h:
	* m/dpx2.h:
	* m/dual.h:
	* m/elxsi.h:
	* m/f301.h:
	* m/gould-np1.h:
	* m/gould.h:
	* m/i860.h:
	* m/ibmps2-aix.h:
	* m/ibmrt-aix.h:
	* m/ibmrt.h:
	* m/irist.h:
	* m/is386.h:
	* m/isi-ov.h:
	* m/mega68.h:
	* m/mg1.h:
	* m/news-r6.h:
	* m/news-risc.h:
	* m/news.h:
	* m/nh3000.h:
	* m/nh4000.h:
	* m/ns16000.h:
	* m/ns32000.h:
	* m/nu.h:
	* m/orion.h:
	* m/orion105.h:
	* m/paragon.h:
	* m/pfa50.h:
	* m/plexus.h:
	* m/pyramid.h:
	* m/pyrmips.h:
	* m/sh3el.h:
	* m/sps7.h:
	* m/sr2k.h:
	* m/stride.h:
	* m/sun1.h:
	* m/sun2.h:
	* m/sun3-68881.h:
	* m/sun3-fpa.h:
	* m/sun3-soft.h:
	* m/sun3.h:
	* m/sun386.h:
	* m/symmetry.h:
	* m/tad68k.h:
	* m/tahoe.h:
	* m/targon31.h:
	* m/tek4300.h:
	* m/tekxd88.h:
	* m/tower32.h:
	* m/tower32v3.h:
	* m/ustation.h:
	* m/wicat.h:
	* m/xps100.h:
	* s/cxux.h:
	* s/cxux7.h:
	* s/dgux.h:
	* s/dgux4.h:
	* s/dgux5-4-3.h:
	* s/dgux5-4r2.h:
	* s/esix.h:
	* s/esix5r4.h:
	* s/hiuxmpp.h:
	* s/hiuxwe2.h:
	* s/iris3-5.h:
	* s/iris3-6.h:
	* s/isc2-2.h:
	* s/isc3-0.h:
	* s/isc4-0.h:
	* s/isc4-1.h:
	* s/newsos5.h:
	* s/newsos6.h:
	* s/osf1.h:
	* s/osf5-0.h:
	* s/riscix1-1.h:
	* s/riscix12.h:
	* s/sco4.h:
	* s/sco5.h:
	* s/sunos4-0.h:
	* s/sunos4-1.h:
	* s/sunos413.h:
	* s/sunos4shr.h:
	* s/umax.h:
	* s/unipl5-2.h:
	* s/xenix.h:
	* cxux-crt0.s:
	* unexapollo.c:
	* unexconvex.c:
	* unexenix.c:
	* unexsni.c: Remove files for systems no longer supported.

	* m/intel386.h: Remove references to unsupported systems.

	* w32.c (get_emacs_configuration): Remove reference to i860.

	* sysdep.c: Remove dead code.

2008-01-05  Dan Nicolaescu  <dann@ics.uci.edu>

	* s/rtu.h:
	* m/masscomp.h: Remove files.  Platform is obsolete.

2008-01-04  Michael Albinus  <michael.albinus@gmx.de>

	* dbusbind.c (Fdbus_method_return): New function.
	(xd_read_message): Add the serial number to the event.
	(Fdbus_register_method): Activate the function.

2008-01-03  Stefan Monnier  <monnier@iro.umontreal.ca>

	* keyboard.c (read_key_sequence): Fix typo.

2008-01-03  Michael Albinus  <michael.albinus@gmx.de>

	* dbusbind.c (all): Replace XCAR by CAR_SAFE and XCDR by CDR_SAFE.
	(xd_signature, xd_append_arg): Handle element type detection for
	empty arrays.
	(Fdbus_call_method, Fdbus_send_signal): Undo type casting for
	SDATA () calls; this must be solved more general.
	(Fdbus_register_signal): Use SBYTES instead of strlen.

2008-01-03  Magnus Henoch  <magnus@zemdatav>

	* dbusbind.c (xd_append_arg): Use unsigned char instead of
	unsigned int for byte values (necessary for big-endian platform).
	(Fdbus_call_method): Handle the case of no returned arguments.

2007-12-31  Tom Tromey  <tromey@redhat.com>  (tiny change)

	* dbusbind.c (xd_read_message): Use non-static input_event struct.

2007-12-31  Magnus Henoch  <mange@freemail.hu>

	* dbusbind.c (xd_signature): Signature of variant is just "v".

2007-12-30  Michael Albinus  <michael.albinus@gmx.de>

	* dbusbind.c: Fix several errors and compiler warnings.
	Reported by Tom Tromey <tromey@redhat.com>
	(XD_ERROR, XD_DEBUG_MESSAGE)
	(XD_DEBUG_VALID_LISP_OBJECT_P): Wrap code with "do ... while (0)".
	(xd_append_arg): Part for basic D-Bus types rewitten.
	(xd_retrieve_arg): Split implementation of DBUS_TYPE_BYTE and
	DBUS_TYPE_(U)INT16.  Don't call XD_DEBUG_MESSAGE with "%f" if not
	appropriate.
	(xd_read_message): Return Qnil.  Don't signal an error; it is not
	useful during event reading.
	(Fdbus_register_signal): Signal an error if the check for
	FUNCTIONP fails.
	(Fdbus_register_method): New function.  The implementation is not
	complete, the call of the function signals an error therefore.
	(Fdbus_unregister_object): New function, renamed from
	Fdbus_unregister_signal.  The initial check signals an error, if
	the object is not well formed.

2007-12-30  Richard Stallman  <rms@gnu.org>

	* textprop.c (get_char_property_and_overlay):
	Signal error if POSITION is out of range in a buffer.

2007-12-29  Martin Rudalics  <rudalics@gmx.at>

	* w32fns.c (Fx_create_frame): Make copy of frame parameters
	because the original parameters are in pure storage now.

2007-12-24  YAMAMOTO Mitsuharu  <mituharu@math.s.chiba-u.ac.jp>

	* xdisp.c (phys_cursor_in_rect_p): Check if cursor is in fringe area.

2007-12-22  Eli Zaretskii  <eliz@gnu.org>

	* callint.c (syms_of_callint) <command-history>: Add reference to
	history-length in the doc string.

2007-12-17  Jason Rumney  <jasonr@gnu.org>

	* w32fns.c (w32_wnd_proc) <WM_KEYDOWN>: Cast char to unsigned
	before passing as wParam.

2007-12-22  Michael Albinus  <michael.albinus@gmx.de>

	* dbusbind.c (xd_retrieve_arg): Handle DBUS_TYPE_BYTE,
	DBUS_TYPE_INT16, DBUS_TYPE_UINT16, DBUS_TYPE_INT64,
	DBUS_TYPE_UINT64, DBUS_TYPE_DOUBLE and DBUS_TYPE_SIGNATURE.
	Return float when DBUS_TYPE_INT32 or DBUS_TYPE_UINT32 do not fit
	as number.
	(Fdbus_call_method): Fix docstring.

2007-12-21  Michael Albinus  <michael.albinus@gmx.de>

	* dbusbind.c (XD_BASIC_DBUS_TYPE, XD_DBUS_TYPE_P, XD_NEXT_VALUE):
	New macros.
	(XD_SYMBOL_TO_DBUS_TYPE): Rename from XD_LISP_SYMBOL_TO_DBUS_TYPE.
	(XD_OBJECT_TO_DBUS_TYPE): Rename from XD_LISP_OBJECT_TO_DBUS_TYPE.
	Simplify.
	(xd_signature): New function.
	(xd_append_arg): Compute also signatures.  Major rewrite.
	(xd_retrieve_arg): Make debug messages friendly.
	(Fdbus_call_method, Fdbus_send_signal): Extend docstring.
	Check for signatures of arguments.

2007-12-19  Michael Albinus  <michael.albinus@gmx.de>

	* dbusbind.c (QCdbus_type_byte, QCdbus_type_boolean)
	(QCdbus_type_int16, QCdbus_type_uint16, QCdbus_type_int32)
	(QCdbus_type_uint32, QCdbus_type_int64, QCdbus_type_uint64)
	(QCdbus_type_double, QCdbus_type_string, QCdbus_type_object_path)
	(QCdbus_type_signature, QCdbus_type_array, QCdbus_type_variant)
	(QCdbus_type_struct, QCdbus_type_dict_entry): New D-Bus type symbols.
	(XD_LISP_SYMBOL_TO_DBUS_TYPE): New macro.
	(XD_LISP_OBJECT_TO_DBUS_TYPE): Add compound types.
	(xd_retrieve_value): Remove.  Functionality included in ...
	(xd_append_arg): New function.
	(Fdbus_call_method, Fdbus_send_signal): Apply it.

2007-12-16  Michael Albinus  <michael.albinus@gmx.de>

	* dbusbind.c (top): Include <stdio.h>.
	(Fdbus_call_method, Fdbus_send_signal): Apply type cast in
	dbus_message_new_method_call and dbus_message_new_signal.
	(Fdbus_register_signal): Rename unique_name to uname.
	Check handler for FUNCTIONP instead of CHECK_SYMBOL.  Handle case of
	non-existing unique name.  Fix typos in matching rule.  Return an
	object which is useful in Fdbus_unregister_signal.
	(Fdbus_unregister_signal): Reimplementation, in order to remove
	only the corresponding entry.
	(Vdbus_registered_functions_table): Change the order of entries.
	Apply these changes in xd_read_message and Fdbus_register_signal.

2007-12-16  Andreas Schwab  <schwab@suse.de>

	* fileio.c (Finsert_file_contents): Fix overflow check to not
	depend on undefined integer overflow.

2007-12-14  Jason Rumney  <jasonr@gnu.org>

	* w32term.c (w32_read_socket): Use MULTIBYTE_CHAR_KEYSTROKE_EVENT
	for characters above 127.

2007-12-13  Jason Rumney  <jasonr@gnu.org>

	* w32fns.c (w32_wnd_proc, Fw32_reconstruct_hot_key): Range check
	before dereferencing array.
	(lookup_vk_code): Remove zero comparison.

2007-12-14  Michael Albinus  <michael.albinus@gmx.de>

	* dbusbind.c (xd_retrieve_value, xd_retrieve_arg)
	(Fdbus_call_method, Fdbus_send_signal, xd_read_message):
	Use `unsigned int' instead of `uint'.
	(xd_read_message, Fdbus_register_signal): Split expressions into
	multiple lines before operators "&&" and "||", according to the
	GNU Coding Standards.

2007-12-14  Eli Zaretskii  <eliz@gnu.org>

	* dispextern.h (WINDOWS_NT): Fix incorrect spelling of WINDOWSNT.

2007-12-12  Juri Linkov  <juri@jurta.org>

	* buffer.c (Frename_buffer): In interactive spec replace
	`read-buffer' with `read-string' that uses `buffer-name-history'
	as history, and the current buffer's name as default.

2007-12-10  Stefan Monnier  <monnier@iro.umontreal.ca>

	* keyboard.c (Fcommand_execute): Call Qcall_interactively instead of
	manipulating the backtrace manually.
	(make_lispy_event): Merge the ASCII and MULTIBYTE cases.
	(struct backtrace, backtrace_list): Remove.
	(command_loop_1): Remove dead var `no_direct'.

	* buffer.c (reset_buffer_local_variables): If permanent_too is 0, also
	preserve non-built-in buffer-local variables.
	(Fkill_all_local_variables): Don't re-create&re-set permanent
	buffer-local variables.

2007-12-09  Juri Linkov  <juri@jurta.org>

	* buffer.c (Frename_buffer): Change interactive spec from "s" to
	Lisp code that uses `read-buffer' with current buffer as default.

2007-12-08  Michael Albinus  <michael.albinus@gmx.de>

	* dbusbind.c (xd_read_message): Generate an event for every
	registered handler.  There might be several handlers registered
	for the same signal.
	(Fdbus_register_signal): Don't overwrite a registration for the
	same signal.  Add a new registration if handlers are different.
	(Vdbus_registered_functions_table): Rework doc string.

2007-12-07  Michael Albinus  <michael.albinus@gmx.de>

	* dbusbind.c (Fdbus_get_unique_name, xd_read_message)
	(Fdbus_register_signal): Use DBUS_MAXIMUM_NAME_LENGTH and
	DBUS_MAXIMUM_MATCH_RULE_LENGTH for string lengths.
	(Fdbus_call_method, Fdbus_send_signal, Fdbus_register_signal):
	Unify argument lists.
	(xd_read_message, Fdbus_register_signal): Reorder and extend event
	arguments and hash table keys.  Use unique name for service.
	(Fdbus_unregister_signal): Remove checks.
	(Vdbus_registered_functions_table): Fix doc string.

2007-12-05  Magnus Henoch  <mange@freemail.hu>

	* process.c (make_process): Initialize pty_flag to 0.

2007-12-05  Jason Rumney  <jasonr@gnu.org>

	* image.c (xbm_load) [WINDOWSNT]: Shuffle the bits of directly
	specified XBMs.

2007-12-05  Richard Stallman  <rms@gnu.org>

	* xdisp.c (syms_of_xdisp) <scroll-conservatively>: Doc fix.

2007-12-05  YAMAMOTO Mitsuharu  <mituharu@math.s.chiba-u.ac.jp>

	* mac.c (cfsockets_for_select) [MAC_OSX && SELECT_USE_CFSOCKET]:
	New variable.
	(mac_try_close_socket) [MAC_OSX]: New function.
	[MAC_OSX] (sys_select) [SELECT_USE_CFSOCKET]:
	Update cfsockets_for_select.  Replace invalid CFRunLoop source.

	* sysdep.c (emacs_close) [MAC_OSX && HAVE_CARBON]:
	Use mac_try_close_socket.

2007-12-05  YAMAMOTO Mitsuharu  <mituharu@math.s.chiba-u.ac.jp>

	* unexmacosx.c (unrelocate): New argument BASE.  Use it instead of
	reloc_base.
	(copy_dysymtab): Compute relocation base here.
	(rebase_reloc_address) [__ppc64__]: New function.
	(copy_dysymtab) [__ppc64__]: Use it if relocation base needs to be
	changed.

2007-12-05  Jason Rumney  <jasonr@gnu.org>

	* w32proc.c (sys_spawnve): Quote args with wildcards.

2007-12-05  YAMAMOTO Mitsuharu  <mituharu@math.s.chiba-u.ac.jp>

	* unexmacosx.c (copy_data_segment): Also copy __gcc_except_tab and
	__objc_* sections.
	(unrelocate) [_LP64]: Set relocation base to address of data segment.

2007-12-05  Michael Albinus  <michael.albinus@gmx.de>

	* dbusbind.c (xd_read_message): Return value is a Lisp_Object.
	Move check for Vdbus_registered_functions_table to
	xd_read_queued_messages.
	(xd_read_queued_messages): Protect xd_read_message calls by
	internal_condition_case_1.

2007-12-04  Michael Albinus  <michael.albinus@gmx.de>

	* dbusbind.c (QCdbus_system_bus, QCdbus_session_bus): Rename from
	Qdbus_system_bus and Qdbus_session_bus, respectively.
	(Vdbus_intern_symbols): Remove.
	(Vdbus_registered_functions_table): New hash table.
	(XD_SYMBOL_INTERN_SYMBOL): Remove.
	(xd_read_message, Fdbus_register_signal, Fdbus_unregister_signal):
	Rewrite in order to manage registered functions by hash table
	Vdbus_registered_functions_table.

2007-12-03  Jan Dj,Ad(Brv  <jan.h.d@swipnet.se>

	* xterm.c: Update URL to Window Manager Specification in comment.

2007-12-02  Michael Albinus  <michael.albinus@gmx.de>

	* config.in (HAVE_DBUS): Add.

	* Makefile.in (HAVE_DBUS): Add D-Bus definitions if defined.
	(ALL_CFLAGS): Add ${DBUS_CFLAGS}.
	(obj): Add $(DBUS_OBJ).
	(LIBES): Add $(DBUS_LIBS).
	(dbusbind.o): New target.

	* dbusbind.c: New file.

	* emacs.c (main): Call syms_of_dbusbind when HAVE_DBUS is defined.

	* keyboard.c: All D-Bus related code is wrapped by "#ifdef HAVE_DBUS".
	(Qdbus_event): New Lisp symbol.
	(kbd_buffer_get_event, make_lispy_event): Handle DBUS_EVENT.
	(gobble_input): Call xd_read_queued_messages, reading D-Bus messages.
	(keys_of_keyboard ): Define dbus-event.

	* termhooks.h (event_kind): Add DBUS_EVENT when HAVE_DBUS is defined.

2007-12-01  Richard Stallman  <rms@gnu.org>

	* search.c (syms_of_search) <inhibit-changing-match-data>: Doc fix.

2007-11-30  Jason Rumney  <jasonr@gnu.org>

	* w32console.c (w32con_ins_del_lines, scroll_line): Clip to window.
	(w32con_reset_terminal_modes): Clear screen buffer.
	(w32_face_attributes): Don't use color indexes that are out of range.
	Only reverse the default colors.

	* xfaces.c (map_tty_color, tty_color_name): Remove special case for
	WINDOWSNT.

	* w32console.c, w32term.h (vga_stdcolor_name): Remove.

2007-11-29  Jason Rumney  <jasonr@gnu.org>

	* w32console.c: Leave HAVE_WINDOW_SYSTEM defined.
	(w32_face_attributes): Use Vtty_defined_color_alist to determine
	if the terminal colors are initialized.
	(unspecified_fg, unspecified_bg): Remove unused declarations.

2007-11-29  Andreas Schwab  <schwab@suse.de>

	* keyboard.c (apply_modifiers): Fix typo.

2007-11-29  Richard Stallman  <rms@gnu.org>

	* keymap.c (Fcurrent_local_map): Doc fix.

2007-11-28  Petr Salinger  <Petr.Salinger@seznam.cz>  (tiny change)

	* s/gnu-kfreebsd.h: New file.

2007-11-28  Stefan Monnier  <monnier@iro.umontreal.ca>

	* buffer.c (Fget_buffer_create, Fmake_indirect_buffer):
	Don't cast redundantly.

	* keyboard.c (KEY_TO_CHAR): New macro.
	(parse_modifiers, apply_modifiers): Accept integer arguments.
	(read_key_sequence): Use them to unify the "shift->unshift" mapping
	for chars and symbol keys.
	After doing such remapping, apply function-key-map again.

2007-11-27  Dan Nicolaescu  <dann@ics.uci.edu>

	* Makefile.in (SOME_MACHINE_LISP): Remove VMS files, they are not
	compiled anymore.

2007-11-26  Andreas Schwab  <schwab@suse.de>

	* process.c (list_processes_1): Fix indentation level of the
	command column.

2007-11-23  Andreas Schwab  <schwab@suse.de>

	* editfns.c (Fformat): Handle %c specially since it requires the
	argument to be of type int.

2007-11-23  Markus Triska  <markus.triska@gmx.at>

	* emacs.c (main): Call init_editfns before init_process, since
	init_process sets Vprocess_connection_type depending on OS release

2007-11-22  Stefan Monnier  <monnier@iro.umontreal.ca>

	* data.c (do_symval_forwarding): Use same code as in find_symbol_value.
	(find_symbol_value): Use do_symval_forwarding.

	* data.c (set_internal): Set the value in the `cons-cell' (for
	Buffer_Local_values) not only for frame-local variables.

2007-11-22  Andreas Schwab  <schwab@suse.de>

	* data.c (Fnumber_to_string): Add cast when passing EMACS_INT
	values to sprintf.
	* keymap.c (Fsingle_key_description): Likewise.
	* print.c (print_object): Likewise.

2007-11-22  Jan Dj,Ad(Brv  <jan.h.d@swipnet.se>

	* gtkutil.c (update_frame_tool_bar): Don't call x-gtk-map-stock if
	file for image is nil.

2007-11-22  Dan Nicolaescu  <dann@ics.uci.edu>

	* term.c: Include stdarg.h.
	(fatal): Implement using varargs.
	* lisp.h (fatal): Add argument types.  (Restore 2005-09-30 change).

2007-11-21  Stefan Monnier  <monnier@iro.umontreal.ca>

	* lisp.h (struct Lisp_Buffer_Objfwd): Add a `slottype' field.
	* data.c (store_symval_forwarding): Get type from buffer_objfwd.
	Update call to buffer_slot_type_mismatch.
	* buffer.h (buffer_local_types, PER_BUFFER_TYPE): Remove.
	(buffer_slot_type_mismatch): Update.
	* buffer.c (buffer_local_types): Remove.
	(buffer_slot_type_mismatch): Get the symbol and type as arguments.
	(defvar_per_buffer): Set the type in the buffer_objfwd.

2007-11-21  Jason Rumney  <jasonr@gnu.org>

	* w32bdf.c (w32_init_bdf_font, w32_BDF_to_x_font):
	CreateFileMapping returns NULL on failure.

2007-11-21  Stefan Monnier  <monnier@iro.umontreal.ca>

	* search.c (Fset_match_data): Remove the `evaporate' feature.
	(unwind_set_match_data): Don't use the `evaporate' feature.

2007-11-21  Jason Rumney  <jasonr@gnu.org>

	* dispnew.c (init_display) [WINDOWSNT]: Hardcode terminal_type.

	* w32console.c (w32con_write_glyphs): Remove unused variables.

2007-11-20  Dan Nicolaescu  <dann@ics.uci.edu>

	* macterm.c (mac_term_init): Call add_keyboard_wait_descriptor.

	* s/darwin.h (MULTI_KBOARD): Remove.

	* macfns.c (x_create_tip_frame, Fx_create_frame)
	(x_create_tip_frame): Don't deal with MULTI_KBOARD.

2007-11-19  Stefan Monnier  <monnier@iro.umontreal.ca>

	* buffer.c (Fbuffer_local_value): Remove redundant test.
	(swap_out_buffer_local_variables): Swap out binding in `buffer' rather
	than in `current-buffer' to match the comment.
	Do the swap using swap_in_global_binding.

	* data.c (store_symval_forwarding, set_internal):
	* eval.c (specbind): Remove dead code.

	* coding.c (detect_coding, Fupdate_coding_systems_internal):
	* fns.c (Fmd5): Use find_symbol_value rather than SYMBOL_VALUE
	Since we do not want to see internal Lisp_*fwd objects here.

2007-11-18  Jan Dj,Ad(Brv  <jan.h.d@swipnet.se>

	* sysdep.c (init_system_name): Use getaddrinfo if available.

	* xterm.c (x_scroll_bar_set_handle, x_scroll_bar_handle_click)
	(x_scroll_bar_note_movement): start, end, with, height in struct
	scroll_bar are integers and not Lisp_Object, so remove XINT for them.

2007-11-17  Dan Nicolaescu  <dann@ics.uci.edu>

	* puresize.h (BASE_PURESIZE): Increase to 1190000.

2007-11-16  Stefan Monnier  <monnier@iro.umontreal.ca>

	* buffer.h (struct buffer): Move `undo_list' back to before `name'.
	This undoes Richard's change of 14-Oct-2002.

	* alloc.c (allocate_other_vector):
	* lisp.h (allocate_other_vector): Remove.

	* window.c (struct save_window_data): Move non-lisp data to the end
	and make it `int' rather than Lisp_Object.
	(Fcurrent_window_configuration): Use ALLOCATE_PSEUDOVECTOR.
	Done wrap/unwrap integer values.
	(Fset_window_configuration, compare_window_configurations):
	Update use of fields to their new types.

	* xterm.h (struct scroll_bar): Only use Lisp_Object for lisp data.
	Turn integer fields into `int'.  Merge x_window_low and x_window_high.
	(SCROLL_BAR_PACK, SCROLL_BAR_UNPACK, SCROLL_BAR_X_WINDOW)
	(SET_SCROLL_BAR_X_WINDOW): Remove.
	(SCROLL_BAR_X_WIDGET, SET_SCROLL_BAR_X_WIDGET):
	Access the new x_window field directly.
	* xterm.c (x_scroll_bar_create): Use a pseudovector.
	Don't wrap/unwrap integers into Lisp_Objects.
	(XTset_vertical_scroll_bar, x_scroll_bar_handle_click)
	(x_scroll_bar_report_motion):
	Don't wrap/unwrap integers into Lisp_Objects.
	(x_term_init): Use SDATA.
	(x_window_to_scroll_bar, x_create_toolkit_scroll_bar)
	(x_scroll_bar_set_handle, x_scroll_bar_remove)
	(XTset_vertical_scroll_bar, x_scroll_bar_expose)
	(x_scroll_bar_report_motion, x_scroll_bar_clear):
	* xfns.c (x_set_background_color):
	* gtkutil.c (xg_create_scroll_bar, xg_set_toolkit_scroll_bar_thumb):
	Access the new x_window field directly.

	* alloc.c (ALLOCATE_PSEUDOVECTOR): Move to lisp.h.
	(allocate_pseudovector): Make non-static.

	* lisp.h (enum pvec_type): New tag PVEC_OTHER.
	(allocate_pseudovector): Declare.
	(ALLOCATE_PSEUDOVECTOR): Move from alloc.c

2007-11-15  Andreas Schwab  <schwab@suse.de>

	* editfns.c (Fformat): Correctly format EMACS_INT values.
	Also take precision into account when formatting an integer.

	* keyboard.c (Fevent_symbol_parse_modifiers): Fix declaration.

2007-11-15  Stefan Monnier  <monnier@iro.umontreal.ca>

	* keyboard.c (Fevent_symbol_parse_modifiers): New function.
	(syms_of_keyboard): Defsubr it.

	* data.c (swap_in_global_binding): Fix longstanding bug where
	store_symval_forwarding was not called with the right second argument,
	thus causing objfwd-ing from being dropped.

2007-11-14  Juanma Barranquero  <lekktu@gmail.com>

	* macfns.c (Fx_create_frame, Fx_display_pixel_width)
	(Fx_display_pixel_height, Fx_display_planes)
	(Fx_display_color_cells, Fx_server_max_request_size)
	(Fx_server_vendor, Fx_server_version, Fx_display_backing_store)
	(Fx_display_visual_class, Fx_display_save_under):
	* w32fns.c (Fx_create_frame, Fx_display_pixel_width)
	(Fx_display_pixel_height, Fx_display_planes)
	(Fx_display_color_cells, Fx_server_max_request_size)
	(Fx_server_vendor, Fx_server_version, Fx_display_screens)
	(Fx_display_mm_height, Fx_display_mm_width)
	(Fx_display_backing_store, Fx_display_visual_class)
	(Fw32_select_font, Fx_display_save_under):
	* xfns.c (Fx_create_frame, Fx_display_pixel_width)
	(Fx_display_pixel_height, Fx_display_planes)
	(Fx_display_color_cells, Fx_server_max_request_size)
	(Fx_server_vendor, Fx_server_version, Fx_display_backing_store)
	(Fx_display_save_under): Fix typos in docstrings.

2007-11-14  Juanma Barranquero  <lekktu@gmail.com>

	* w32fns.c (Fw32_registered_hot_keys): Don't return the nil values
	corresponding to deleted entries; they are an implementation detail.
	(gray_bitmap_width, gray_bitmap_height, gray_bitmap_bits):
	Remove variables.
	(w32_pass_extra_mouse_buttons_to_system, w32_strict_fontnames)
	(w32_pass_multimedia_buttons_to_system, w32_strict_painting)
	(Vw32_charset_info_alist, w32_to_x_color, w32_init_class)
	(w32_createscrollbar, w32_createwindow, my_post_msg, w32_get_modifiers)
	(w32_grabbed_keys, cancel_all_deferred_msgs): Make static.
	(Fw32_define_rgb_color, Fw32_load_color_file)
	(syms_of_w32fns) <w32-pass-multimedia-buttons-to-system>:
	Fix typos in docstrings.
	(Fx_server_version): Reflow docstring.
	(Fw32_shell_execute): Doc fixes.

2007-11-13  Juanma Barranquero  <lekktu@gmail.com>

	* w32fns.c (Fw32_register_hot_key): Don't try to register hot key
	if w32_parse_hot_key returned nil.

2007-11-10  Stefan Monnier  <monnier@iro.umontreal.ca>

	* xdisp.c (load_overlay_strings): Fix copy&paste typo.

2007-11-09  Jason Rumney  <jasonr@gnu.org>

	* s/ms-w32.c (USE_TOOLKIT_SCROLL_BARS): Define.

	* w32term.c (w32_scroll_bar_handle_click): Use SCROLL_BAR_CLICK_EVENT.

	* keyboard.c (discard_mouse_events, make_lispy_event) [WINDOWSNT]:
	Remove W32_SCROLL_BAR_CLICK_EVENT.

	* termhooks.h (enum event_kind) [WINDOWSNT]: Likewise.
	Add MULTIMEDIA_KEY_EVENT.

	* keyboard.c (lispy_function_keys) [WINDOWSNT]: Add more keys.
	(lispy_multimedia_keys) [WINDOWSNT]: New array.
	(make_lispy_event) [WINDOWSNT]: Use it to translate
	MULTIMEDIA_KEY_EVENT.

	* w32term.h (WM_APPCOMMAND): Define if not already.
	(GET_APPCOMMAND_LPARAM): Likewise.

	* w32term.c (w32_read_socket): Generate MULTIMEDIA_KEY_EVENT from
	WM_APPCOMMAND.

	* w32fns.c (w32_pass_multimedia_buttons_to_system): New user option.
	(syms_of_w32fns): Export and initialize it.
	(w32_wnd_proc): Pass WM_APPCOMMAND on to w32_read_socket.

2007-11-09  Chong Yidong  <cyd@stupidchicken.com>

	* dispextern.h (struct it): Don't define OVERLAY_STRING_CHUNK_SIZE
	twice.

	* xdisp.c (handle_face_prop): Fix last change.

2007-11-09  Richard Stallman  <rms@gnu.org>

	* xdisp.c (handle_face_prop): Test for strings that came from overlays,
	not just for after-strings and before-strings.
	Call face_for_overlay_string and pass the overlay to it.
	(handle_display_prop): Determine whether property came from an overlay.
	Pass OVERLAY arg to handle_single_display_spec.
	(handle_single_display_spec): New arg OVERLAY sets it->from_overlay.
	(load_overlay_strings): Fill in it->string_overlays.
	(get_overlay_strings_1, push_it, pop_it): Handle it->from_overlays.

	* xfaces.c (face_for_overlay_string): Function renamed from
	face_at_buffer_position_no_overlays, and add arg OVERLAY.

	* dispextern.h (struct it): New elt string_overlays.
	New elt from_overlay, also in stack.
	Rearrange a few elements.
	(face_for_overlay_string): Decl renamed from
	face_at_buffer_position_no_overlays, and add argument.

2007-11-09  Richard Stallman  <rms@gnu.org>

	* xdisp.c (handle_face_prop): Use face_at_buffer_position_no_overlays
	to get the base face for an overlay string.

	* dispextern.h (face_at_buffer_position_no_overlays): Add decl.

	* xfaces.c (face_at_buffer_position_no_overlays): New function.

	* xdisp.c (handle_stop): Move some code out of loop.

2007-11-09  YAMAMOTO Mitsuharu  <mituharu@math.s.chiba-u.ac.jp>

	* macfns.c [USE_ATSUI] (Fmac_atsu_font_face_attributes):
	Fix conversion from Lisp object to ATSUFontID.

2007-11-09  Jason Rumney  <jasonr@gnu.org>

	* xdisp.c (Fformat_mode_line): Do nothing when noninteractive.

2007-11-09  YAMAMOTO Mitsuharu  <mituharu@math.s.chiba-u.ac.jp>

	* unexmacosx.c (unexec_regions_recorder, unexec_regions_merge):
	Don't assume regions are aligned to page boundary.
	(print_load_command_name): Add LC_UUID if defined.

2007-11-09  Richard Stallman  <rms@gnu.org>

	* emacs.c (syms_of_emacs) <installation-directory>: Reflow docstring.

2007-11-07  Jason Rumney  <jasonr@gnu.org>

	* s/windows95.h: Remove.

2007-11-06  Jan Dj,Ad(Brv  <jan.h.d@swipnet.se>

	* gtkutil.c (xg_tool_bar_menu_proxy): Handle GTK_IMAGE_ICON_NAME and
	abort with a message on unhandled store_type values.

2007-11-01  Jan Dj,Ad(Brv  <jan.h.d@swipnet.se>

	* xterm.c, xfns.c, xselect.c, xterm.h, s/msdos.h, s/sco4.h, s/sco5.h:
	Remove HAVE_X11R5 and HAVE_X11R4.

2007-11-01  Dan Nicolaescu  <dann@ics.uci.edu>

	* Makefile.in: Remove references to sunfns.c and sunfns.o.

2007-11-01  Johan Bockg,Ae(Brd  <bojohan@gnu.org>

	* macterm.c, w32term.c, xterm.c (x_draw_stretch_glyph_string):
	Don't set s->stippled_p here, since it has already been set by
	x_set_glyph_string_gc from x_draw_glyph_string.

2007-11-01  Dan Nicolaescu  <dann@ics.uci.edu>

	* sunfns.c: Remove file

	* m/sun386.h:
	* m/sun2.h:
	* m/sparc.h: Remove Sun windows code.

2007-10-31  Stefan Monnier  <monnier@iro.umontreal.ca>

	* keyboard.c (syms_of_keyboard): Initialize the initial_kboard.
	(init_keyboard): Set current_kboard's window-system to nil.
	(tty_read_avail_input): Typo.
	* frame.c (make_initial_frame): Don't initialize the initial_kboard.

2007-10-31  Dan Nicolaescu  <dann@ics.uci.edu>

	* s/usg5-4.h:
	* s/usg5-3.h:
	* s/ptx.h:
	* m/is386.h:
	* m/ibmps2-aix.h:
	* Makefile.in: Remove all mentions of X10

	* dispnew.c (syms_of_display): Don't mention version 10.

2007-10-28  Juanma Barranquero  <lekktu@gmail.com>

	* makefile.w32-in (OBJ1): Remove abbrev.$(O).
	($(BLD)/abbrev.$(O)): Remove.

2007-10-28  Stefan Monnier  <monnier@iro.umontreal.ca>

	Rewrite abbrev.c in Elisp.
	* image.c (Qcount): Don't declare as extern.
	(syms_of_image): Initialize and staticpro `Qcount'.
	* puresize.h (BASE_PURESIZE): Increase for the new abbrev.el functions.
	* emacs.c (main): Don't call syms_of_abbrev.
	* Makefile.in (obj): Remove abbrev.o.
	(abbrev.o): Remove.
	* abbrev.c: Remove.

2007-10-26  Martin Rudalics  <rudalics@gmx.at>

	* window.c (window_min_size_2): Don't count header-line.

2007-10-26  Dan Nicolaescu  <dann@ics.uci.edu>

	* frame.h (struct frame): Move all bit fields after the first bit
	field to take advantage of the available space.  Group all the
	chars together to reduce wasted space due to padding.

2007-10-26  Juanma Barranquero  <lekktu@gmail.com>

	* minibuf.c (Fread_minibuffer, Feval_minibuffer): Reflow docstrings.

	* alloc.c (spare_memory, stack_copy, stack_copy_size, ignore_warnings)
	(Vdead, dont_register_blocks, staticvec, staticidx, interval_block)
	(n_interval_blocks, init_strings, check_string_bytes, check_sblock)
	(init_float, free_float, n_cons_blocks, init_cons, all_vectors)
	(n_vectors, symbol_block, symbol_block_index, symbol_free_list)
	(n_symbol_blocks, init_symbol, marker_block, marker_free_list)
	(n_marker_blocks, init_marker, valid_pointer_p, make_pure_float)
	(last_marked, mark_object_loop_halt): Make static.

	* frame.c (syms_of_frame) <delete-frame-functions>:
	Fix typo in docstring.

2007-10-25  Juanma Barranquero  <lekktu@gmail.com>

	* w32.c (init_environment): Fix tiny memory leak.
	(w32_get_resource): Remove unused variable `ok'.

2007-10-25  Stefan Monnier  <monnier@iro.umontreal.ca>

	Make `window-system' into a keyboard-local variable (rather than
	frame-local as done originally by multi-tty).

	* keyboard.h (struct kboard): Add Vwindow_system.
	* keyboard.c (init_kboard): Set a default for Vwindow_system.
	(mark_kboards): Mark Vwindow_system.

	* dispnew.c (syms_of_display) <window-system>: Declare terminal-local.
	(init_display): Don't set the obsolete `window-system' frame-param.

	* xterm.c (x_term_init):
	* w32term.c (w32_create_terminal):
	* term.c (init_tty): Set Vwindow_system.
	* macterm.c (mac_create_terminal): Set a keyboard (missing piece of the
	multi-tty merge maybe?), copied from w32term.c.  Set Vwindow_system.

	* xfns.c (Fx_create_frame, x_create_tip_frame):
	* w32fns.c (Fx_create_frame, x_create_tip_frame):
	* macfns.c (Fx_create_frame):
	Don't set the obsolete `window-system' frame-param.

	* frame.h (Qwindow_system): Remove.
	* frame.c (Qwindow_system): Remove.  In `syms_of_frame' as well.
	(Fmake_terminal_frame): Don't set obsolete `window-system' frame-param.

2007-10-24  Richard Stallman  <rms@gnu.org>

	* frame.c (x_figure_window_size): For fullscreen case,
	set USPosition | PPosition without clobbering rest of window_prompting.

	* keyboard.c (Fcurrent_idle_time): Doc fix.

	* print.c (Fwith_output_to_temp_buffer): Doc fix.

2007-10-23  Stefan Monnier  <monnier@iro.umontreal.ca>

	* process.c (unwind_request_sigio): Only define if __ultrix__.

	* callproc.c (child_setup): Remove spurious *.

	* lisp.h (Fget_text_property): Declare.
	(have_menus_p): Declare it here rather than in sys-dep header files.
	* macterm.h (have_menus_p):
	* msdos.h (have_menus_p):
	* xterm.h (have_menus_p): Remove.

	* data.c (Fmake_variable_buffer_local, Fmake_local_variable)
	(Fmake_variable_frame_local): Just check the variable's const-ness
	rather than checking nil or t.

2007-10-22  Jason Rumney  <jasonr@gnu.org>

	* w32fns.c: Include math.h.
	(w32_abort): Declaration moved to nt/config.nt.

	* s/ms-w32.h (HAVE_STDLIB_H): Define.
	(abort): Redefinition moved to nt/config.nt.

	* m/windowsnt.h: Remove.

2007-10-22  Juanma Barranquero  <lekktu@gmail.com>

	* emacs.c (Fdump_emacs): Fix typo in message.
	(syms_of_emacs) <kill-emacs-hook>: Fix typo in docstring.
	<installation-directory>: Reflow docstring.

2007-10-22  Juri Linkov  <juri@jurta.org>

	* minibuf.c: Allow minibuffer default to be a list of default values.
	With empty input use the first element of this list as returned default.
	(string_to_object)
	(read_minibuf_noninteractive): If defalt is cons, set val to its car.
	(read_minibuf): If defalt is cons, set histstring to its car.
	(Fread_string): If default_value is cons, set val to its car.
	(Fread_buffer): If def is cons, use its car.
	(Fcompleting_read): If defalt is cons, set val to its car.

2007-10-21  Michael Albinus  <michael.albinus@gmx.de>

	* fileio.c (Fcopy_file): Call file name handler with preserve_uid_gid.

2007-10-20  Juanma Barranquero  <lekktu@gmail.com>

	* doc.c (Fdocumentation): Check for advice in all cases.

2007-10-19  Chong Yidong  <cyd@stupidchicken.com>

	* Makefile.in [HAVE_LIBRESOLV]: Add -lresolv to linker flags.

2007-10-19  Richard Stallman  <rms@gnu.org>

	* doc.c (Fdocumentation): Check for and handle an advised function.

2007-10-19  Juanma Barranquero  <lekktu@gmail.com>

	* process.c (Fset_process_filter): Doc fix.

2007-10-18  Stefan Monnier  <monnier@iro.umontreal.ca>

	* keyboard.c (read_key_sequence): Undo a change introduced by multi-tty
	which caused key-translation-map to applied repeatedly (thus breaking
	double-mode).

2007-10-17  Stefan Monnier  <monnier@iro.umontreal.ca>

	* xselect.c (x_own_selection, x_handle_selection_clear)
	(x_clear_frame_selections):
	* w32menu.c (list_of_panes, list_of_items):
	* w32fns.c (w32_color_map_lookup, Fx_create_frame, Fx_display_list):
	* textprop.c (validate_plist, interval_has_all_properties)
	(interval_has_some_properties, interval_has_some_properties_list)
	(add_properties, text_property_list):
	* process.c (Fget_buffer_process, list_processes_1, status_notify):
	* minibuf.c (Fassoc_string):
	* macselect.c (x_own_selection, x_clear_frame_selections)
	(Fx_disown_selection_internal):
	* keymap.c (Fcommand_remapping, where_is_internal, describe_map_tree):
	Use CONSP rather than !NILP and XC[AD]R rather than Fc[ad]r.

2007-10-17  Chong Yidong  <cyd@stupidchicken.com>

	* process.c: Link to libs for calling res_init() if available.
	(Fmake_network_process): Call res_init() before getaddrinfo or
	gethostbyname, if possible.

2007-10-17  Stefan Monnier  <monnier@iro.umontreal.ca>

	* lread.c (read1): Set pvectype for char_tables.

	* lisp.h (XMISCANY, XMARKER, XINTFWD, XBOOLFWD, XOBJFWD, XOVERLAY)
	(XBUFFER_OBJFWD, XBUFFER_LOCAL_VALUE, XKBOARD_OBJFWD, XSAVE_VALUE):
	Add type checks.
	(SOME_BUFFER_LOCAL_VALUEP, GC_SOME_BUFFER_LOCAL_VALUEP): Remove.

	* alloc.c (free_misc): Use XMISCTYPE.
	(live_misc_p, gc_sweep): Use Lisp_Misc_Any.

2007-10-17  Glenn Morris  <rgm@gnu.org>

	* minibuf.c (Qcompletion_ignore_case): New Lisp_Object.
	(syms_of_minibuf): Add Qcompletion_ignore_case.
	* dired.c (Qcompletion_ignore_case): Change to external.
	(syms_of_dired) [VMS]: Remove Qcompletion_ignore_case.
	* fileio.c (Qcompletion_ignore_case): New external Lisp_Object.
	(Fread_file_name): Use it rather than intern'ing.

	* coding.c (Qcompletion_ignore_case): New external Lisp_Object.
	(Fread_coding_system): Ignore case of user input.

2007-10-16  YAMAMOTO Mitsuharu  <mituharu@math.s.chiba-u.ac.jp>

	* xdisp.c (handle_display_prop): Ignore display specs after
	replacing one when string text is being replaced.
	(handle_single_display_spec): Pretend as if characters with display
	property haven't been consumed only when buffer text is being replaced.

2007-10-16  Stefan Monnier  <monnier@iro.umontreal.ca>

	* xfns.c (Fx_create_frame, Fx_display_list):
	* window.c (window_fixed_size_p, enlarge_window)
	(shrink_window_lowest_first):
	* macterm.c (init_font_name_table):
	* macfns.c (Fx_create_frame, Fx_display_list):
	* lread.c (close_load_descs):
	* keyboard.c (read_char_x_menu_prompt):
	* fns.c (Fmember, Fmemql, Fdelete, Fset_char_table_parent):
	* coding.c (code_convert_region_unwind): Test the type of an object
	rather than just !NILP before extracting data from it.

	* alloc.c (Fpurecopy): Set the pvec tag on pseudo vectors.

	* lisp.h (enum Lisp_Misc_Type): Del Lisp_Misc_Some_Buffer_Local_Value.
	(XMISCANY): New macro.
	(XMISCTYPE): Use it.
	(struct Lisp_Misc_Any): New type.
	(union Lisp_Misc): Use it.
	(struct Lisp_Buffer_Local_Value): Add `local_if_set' bit.
	* data.c (Fboundp, store_symval_forwarding, swap_in_global_binding)
	(find_symbol_value, set_internal, default_value, Fset_default)
	(Fmake_variable_buffer_local, Fmake_local_variable)
	(Fkill_local_variable, Fmake_variable_frame_local, Flocal_variable_p)
	(Flocal_variable_if_set_p, Fvariable_binding_locus):
	The SOME_BUFFER_LOCAL_VALUEP distinction is replaced by local_if_set.
	* alloc.c (allocate_buffer): Set the size and tag.
	(allocate_misc, mark_maybe_object, mark_object, survives_gc_p):
	Use XMISCANY.
	(die): Follow the GNU convention for error messages.
	* print.c (print_object): SOME_BUFFER_LOCAL_VALUEP -> local_if_set.
	* buffer.c (Fget_buffer_create, Fmake_indirect_buffer): Don't set the
	tag any more.
	(set_buffer_internal_1):
	* frame.c (store_frame_param):
	* eval.c (specbind):
	* xdisp.c (select_frame_for_redisplay): Drop SOME_BUFFER_LOCAL_VALUEP.

	* doc.c (Fsnarf_documentation): Simplify.

2007-10-14  Juanma Barranquero  <lekktu@gmail.com>

	* w32term.c (w32_font_is_double_byte, my_create_scrollbar): Make static.
	(syms_of_w32term) <w32-enable-unicode-output>: Fix typo in docstring.

2007-10-14  Stefan Monnier  <monnier@iro.umontreal.ca>

	* buffer.c (Fmake_indirect_buffer): Set the buffer's tag.

2007-10-14  Juanma Barranquero  <lekktu@gmail.com>

	* eval.c (do_autoload): Don't save autoloads.

	* data.c (Ffset): Save autoload of the function being set.

2007-10-07  John Paul Wallington  <jpw@pobox.com>

	* xfns.c (x_create_tip_frame): Set the `display-type' frame
	parameter before setting up faces.

2007-10-13  Eli Zaretskii  <eliz@gnu.org>

	* ccl.c (Fregister_code_conversion_map):
	* keyboard.c (append_tool_bar_item): Reformat last change.

	* lisp.h (eabs): Rename from `abs'.  All callers changed.

2007-10-05  Dmitry Antipov  <dmantipov@yandex.ru>

	* buffer.c (add_overlay_mod_hooklist):
	* ccl.c (Fregister_ccl_program, Fregister_code_conversion_map):
	* fontset.c (make_fontset):
	* keyboard.c (GROW_RAW_KEYBUF, menu_bar_items, menu_bar_item)
	(append_tool_bar_item):
	* macmenu.c (grow_menu_items):
	* w32menu.c (grow_menu_items):
	* xmenu.c (grow_menu_items): Use larger_vector.

2007-10-13  Eli Zaretskii  <eliz@gnu.org>

	* msdos.c (dos_rawgetc): Undo last change (there's no ``leaving
	selected frame'' on MSDOS).

2007-10-12  Martin Rudalics  <rudalics@gmx.at>

	* frame.c (Qexplicit_name): New variable.
	(x_report_frame_params): Report it in parameter alist.
	(syms_of_frame): Intern and staticpro it.

2007-10-10  Patrick Mahan  <mahan@mahan.org>  (tiny change)

	* macfns.c (x_create_tip_frame): Set terminal for frame.

2007-10-10  Stefan Monnier  <monnier@iro.umontreal.ca>

	* frame.c (Qenvironment): Remove.
	(syms_of_frame) <Qenvironment>: Don't initialize.
	(Fdelete_frame): Don't treat the `environment' param specially.
	* frame.h (Qenvironment): Don't declare.
	* callproc.c (set_initial_environment): Don't set unused frame param.

	* frame.c (Fframe_with_environment): Remove.
	(syms_of_frame) <Sframe_with_environment>: Don't declare.

	* lisp.h (Fframe_with_environment): Don't declare.

2007-10-10  Juanma Barranquero  <lekktu@gmail.com>

	* indent.c (indent_tabs_mode, last_known_column)
	(last_known_column_modified): Make static.
	(syms_of_indent) <indent-tabs-mode>: Remove redundant info in docstring.

2007-10-10  Katsumi Yamaoka  <yamaoka@jpl.org>

	* puresize.h (BASE_PURESIZE): Increase to 1170000.

2007-10-09  Jason Rumney  <jasonr@gnu.org>

	* w32term.c (x_set_window_size): Disable code that attempts to tell
	Lisp code about a size change before it actually happens.

2007-10-09  Richard Stallman  <rms@gnu.org>

	* xdisp.c (handle_invisible_prop): After setting up an ellipsis,
	return HANDLED_RETURN.

2007-10-08  Martin Rudalics  <rudalics@gmx.at>

	* keyboard.c (kbd_buffer_get_event): Break loop waiting for input
	when there's an unread command event.

	* frame.c (focus_follows_mouse): Move here from frame.el to allow
	window autoselection act appropriately when leaving selected frame.
	(syms_of_frame): Initialize focus_follows_mouse.
	* frame.h (focus_follows_mouse): Extern it.
	* macterm.c (XTread_socket): When focus_follows_mouse is nil
	make SELECT_WINDOW_EVENT only if we don't leave the selected frame.
	* msdos.c (dos_rawgetc): Likewise.
	* w32term.c (w32_read_socket): Likewise.
	* xterm.c (handle_one_xevent): Likewise.
	* xdisp.c (syms_of_xdisp): In doc-string of
	mouse-autoselect-window mention focus-follows-mouse.

2007-10-08  YAMAMOTO Mitsuharu  <mituharu@math.s.chiba-u.ac.jp>

	* macterm.c (mac_load_query_font): Fix missing return value.
	[USE_CG_DRAWING] (mac_define_fringe_bitmap, mac_destroy_fringe_bitmap):
	Add BLOCK_INPUT.

2007-10-08  Richard Stallman  <rms@gnu.org>

	* xdisp.c (get_window_cursor_type): Implement documented behavior
	for cursor-in-non-selected-windows = t.

2007-10-08  Jason Rumney  <jasonr@gnu.org>

	* w32.c (w32_get_resource): Always close registry keys.

2007-10-08  Jason Rumney  <jasonr@gnu.org>

	* makefile.w32-in (LIBS): Add COMCTL32.

	* w32fns.c (globals_of_w32fns): Init common controls.

2007-10-08  Richard Stallman  <rms@gnu.org>

	* image.c (our_memory_buffer): Rename from omfib_buffer.

2007-10-08  Richard Stallman  <rms@gnu.org>

	* buffer.c (Foverlays_at): Doc fix.

2007-10-08  Stefan Monnier  <monnier@iro.umontreal.ca>

	* fns.c (Fplist_put): Preserve uneven tail data.

2007-10-08  Peter O'Gorman  <bug-gnu-emacs@mlists.thewrittenword.com>  (tiny change)

	* termhooks.h (enum event_kind): Remove trailing comma.

	* frame.h (enum): Remove trailing comma.

2007-10-08  Dhuvra Krishnamurthy  <dhuvrakm@gmail.com>  (tiny change)

	* w32proc.c (delete_child): Don't terminate threads of zombies.

2007-10-08  Martin Rudalics  <rudalics@gmx.at>

	* keyboard.h (struct kboard): New elt Vlast_repeatable_command.

	* keyboard.c (syms_of_keyboard): Set up new Lisp variable
	last-repeatable-command.
	(init_kboard): Initialize Vlast_repeatable_command.
	(command_loop_1): Set it to real_this_command unless that was
	bound to an input event.
	(mark_kboards): Mark it.

2007-10-08  Richard Stallman  <rms@gnu.org>

	* eval.c (condition-case): Doc fix.

2007-10-08  Masatake YAMATO  <jet@gyve.org>

	* xfaces.c (tty_supports_face_attributes_p): Fix code
	for LFACE_INVERSE_INDEX and LFACE_BACKGROUND_INDEX; code
	was copied and not edited.

2007-10-09  Stefan Monnier  <monnier@iro.umontreal.ca>

	Add new `input-decode-map' keymap and use it for terminal
	escape sequences.
	* keyboard.h (struct kboard): Add Vinput_decode_map.
	Remove Vlocal_key_translation_map.
	* keyboard.c (read_key_sequence): Add support for input-decode-map.
	(init_kboard): Init input-decode-map.
	Replace local-key-translation-map back with key-translation-map.
	(syms_of_keyboard): Declare input-decode-map.
	Remove local-key-translation-map.  Update docstrings.
	(mark_kboards): Mark Vinput_decode_map.
	Don't mark Vlocal_key_translation_map.
	* keymap.c (Fdescribe_buffer_bindings): Describe input-decode-map.
	Replace local-key-translation-map back with key-translation-map.
	* term.c (term_get_fkeys_1, CONDITIONAL_REASSIGN):
	Bind in input-decode-map rather than function-key-map.

	* lisp.h (XSETPSEUDOVECTOR): Don't set the tag anymore.
	This was made redundant by the previous introduction of XSETPVECTYPE.

2007-10-09  Richard Stallman  <rms@gnu.org>

	* image.c (free_bitmap_record): Rename from Free_Bitmap_Record.

2007-09-29  Richard Stallman  <rms@gnu.org>

	* eval.c (internal_condition_case_2, internal_condition_case_1)
	(internal_condition_case): Reenable abort if x_catching_errors ()
	to see if that really happens and why.

2007-10-06  Andreas Schwab  <schwab@suse.de>

	* fileio.c (Fwrite_region): Ignore EINVAL error from fsync.

2007-10-04  Juanma Barranquero  <lekktu@gmail.com>

	* image.c (syms_of_image) <image-types>: Fix typo in docstring.

2007-10-03  Stefan Monnier  <monnier@iro.umontreal.ca>

	* frame.h (struct frame): Don't try to GC-mark menu_bar_items_used.

2007-10-02  Stefan Monnier  <monnier@iro.umontreal.ca>

	* window.h (struct window):
	* window.c (struct save_window_data, struct saved_window):
	* termhooks.h (struct terminal):
	* process.h (struct Lisp_Process):
	* frame.h (struct frame):
	* buffer.h (struct buffer):
	* lisp.h (struct Lisp_Vector, struct Lisp_Char_Table)
	(struct Lisp_Bool_Vector, struct Lisp_Subr, struct Lisp_Hash_Table):
	The size field of (pseudo)vectors is now unsigned.
	(ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG): Simplify accordingly.

	* lisp.h (struct Lisp_Hash_Table): Move non-traced elements at the end.
	Turn `count' into an integer.

	* fns.c (make_hash_table, hash_put, hash_remove, hash_clear)
	(sweep_weak_table, sweep_weak_hash_tables, Fhash_table_count):
	* print.c (print_object) <HASH_TABLE_P>: `count' is an int.
	* alloc.c (allocate_hash_table): Use ALLOCATE_PSEUDOVECTOR.
	(mark_object) <HASH_TABLE_P>: Use mark_vectorlike.

	* alloc.c (allocate_pseudovector): New fun.
	(ALLOCATE_PSEUDOVECTOR): New macro.
	(allocate_window, allocate_terminal, allocate_frame)
	(allocate_process): Use it.
	(mark_vectorlike): New function.
	(mark_object) <FRAMEP, WINDOWP, BOOL_VECTOR_P, VECTORP>: Use it.
	(mark_terminals): Use it.
	(Fmake_bool_vector, Fmake_char_table, make_sub_char_table)
	(Fmake_byte_code): Use XSETPVECTYPE.

	* frame.c (Fframe_parameters): Minor simplification.

	* insdel.c (adjust_markers_for_insert): Generalize assertion checks.

	* marker.c (Fmarker_buffer): Make test for odd case into a failure.

	* buffer.c (Fget_buffer_create, init_buffer_once):
	* lread.c (defsubr):
	* window.c (Fcurrent_window_configuration): Use XSETPVECTYPE.

	* lisp.h (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG): Don't let them be
	defined differently in the m/*.h files.
	(XCHAR_TABLE, XBOOL_VECTOR): Add assertion checking.
	(XSETPVECTYPE): New macro.
	(XSETPSEUDOVECTOR): Use it.

	* buffer.c (syms_of_buffer) <local-abbrev-table>: Move from abbrev.c.
	(DEFVAR_PER_BUFFER, defvar_per_buffer): Move from lisp.h and lread.c.

	* lisp.h (defvar_per_buffer, DEFVAR_PER_BUFFER):
	* lread.c (defvar_per_buffer):
	* abbrev.c (syms_of_abbrev) <local-abbrev-tabl>: Move to buffer.c.

	* window.c (candidate_window_p): Only consider as visible frames that
	are on the same terminal.

	* m/ibms390x.h (MARKBIT): Remove unused macro.

2007-10-01  Juanma Barranquero  <lekktu@gmail.com>

	* lread.c (Fload): Fix typo in docstring.

2007-10-01  Micha,Ak(Bl Cadilhac  <michael@cadilhac.name>

	* floatfns.c (Fexpt): Manually check for overflows, so that a power
	of a non-zero value can't yield zero.

2007-09-29  Stefan Monnier  <monnier@iro.umontreal.ca>

	* term.c (term_clear_mouse_face, term_mouse_highlight)
	(tty_write_glyphs_with_face): Only define is HAVE_GPM.

	* print.c (safe_debug_print): Use XHASH.

	* lisp.h (DECL_ALIGN, USE_LSB_TAG): Move logic to before definition of
	Lisp elements such as tags.
	(XHASH): New macro.
	(EQ): Use it.
	(SREF, SSET, STRING_COPYIN): Use SDATA.
	(VOID_TO_LISP, CVOID_TO_LISP, LISP_TO_VOID, LISP_TO_CVOID): Remove.

	* alloc.c (mark_terminal): Remove left-over declaration.
	(enum mem_type): Replace all vector subtypes -> MEM_TYPE_VECTORLIKE.
	(allocate_vectorlike): Remove type argument.  Adjust callers.
	(live_vector_p, mark_maybe_pointer, valid_lisp_object_p):
	Only handle the one remaining MEM_TYPE_VECTORLIKE.

	* alloc.c (MALLOC_BLOCK_INPUT, MALLOC_UNBLOCK_INPUT): New macros
	to avoid unnecessary BLOCK_INPUTs when SYNC_INPUT is used.
	(xmalloc, xrealloc, xfree, lisp_malloc, lisp_free, lisp_align_malloc)
	(lisp_align_free, make_interval, allocate_string, allocate_string_data)
	(make_float, Fcons, allocate_vectorlike, Fmake_symbol, allocate_misc):
	Use them.

	* xfaces.c (load_face_font, free_realized_face, clear_face_gcs):
	Don't let signal handlers run when a GC is freed but not yet NULL'ed.
	(x_free_gc): Remove BLOCK_INPUT since it's now redundant.

2007-09-28  Dan Nicolaescu  <dann@ics.uci.edu>

	* Makefile.in (lisp, shortlisp): Delete server.elc, it is not
	loaded by default.

2007-09-28  Stefan Monnier  <monnier@iro.umontreal.ca>

	* term.c (Fgpm_mouse_start): Don't signal an error if already activated
	on this tty.
	(Fgpm_mouse_stop): Only deactivate if it was activated on this tty.

	* term.c (mouse_face_window): Rename from Qmouse_face_window.
	Update all users.
	(handle_one_term_event): Use Gpm_DrawPointer.
	(Fgpm_mouse_start): Rename from Fterm_open_connection.
	Signal errors instead of returning nil.  Always return nil.
	(Fgpm_mouse_stop): Rename from Fterm_close_connection.
	Make it a noop if gpm-mouse was not activated.
	(syms_of_term): Update names.

2007-09-27  Stefan Monnier  <monnier@iro.umontreal.ca>

	* sysdep.c (narrow_foreground_group, widen_foreground_group): Static.
	(init_sys_modes): Check that gpm_tty is the current tty.

	* alloc.c (allocate_terminal): Set the vector size to only count the
	lisp fields.  Initialize those to nil.
	(mark_object): Don't treat terminals specially.
	(mark_terminal): Remove.
	(mark_terminals): Use mark_object instead.

	* termhooks.h (struct terminal): Move all Lisp_Object fields traced by
	the GC to the beginning.

	* indent.h:
	* indent.c: Use EMACS_INT for ints coming from Elisp data.

	* indent.c (Fmove_to_column): Use EMACS_INT for buffer positions.

2007-09-25  Jason Rumney  <jasonr@gnu.org>

	* frame.c (make_terminal_frame): Remove special case for WINDOWSNT.

	* w32console.c (create_w32cons_output): Remove.

	* term.c (init_tty): Call init_sys_modes on WINDOWSNT also.

	* sysdep.c (init_sys_modes): Use set_terminal_modes_hook.
	(reset_sys_modes): Use reset_terminal_modes_hook.

2007-09-24  Stefan Monnier  <monnier@iro.umontreal.ca>

	* eval.c (do_autoload): Don't output any message.

2007-09-24  Juri Linkov  <juri@jurta.org>

	* emacs.c (standard_args): Change priority of "--no-splash"
	from 40 to 3.  Add "--no-desktop" with the same priority.

2007-09-23  Dmitry Antipov  <dmantipov@yandex.ru>

	* alloc.c (gc_sweep): Check cons cell mark bits word by word
	and optimize the case where they are all 1.

2007-09-23  Johannes Weiner  <hannes@saeurebad.de>

	* lisp.h (abs): Define if not defined.
	* keyboard.c, sound.c, w32term.c, xfaces.c, xterm.c:
	Don't define `abs', since it's defined in lisp.h.

2007-09-22  Eli Zaretskii  <eliz@gnu.org>

	* term.c (DEV_TTY): New macro.  Provide a definition for MS-Windows.
	(FRAME_TERMCAP_P) [WINDOWSNT]: Don't define to zero.
	(Fcontrolling_tty_p, Fresume_tty, dissociate_if_controlling_tty)
	(init_tty): Use DEV_TTY instead of "/dev/tty".
	[WINDOWSNT]: No need to protect from NAME arg being null.

2007-09-21  Dan Nicolaescu  <dann@ics.uci.edu>

	* term.c (Fsuspend_tty): Run suspend-tty-functions before cleaning
	up the tty state.

2007-09-21  Stefan Monnier  <monnier@iro.umontreal.ca>

	* termhooks.h (term_gpm): Delete.  Use gpm_tty's NULLness instead.
	(gpm_tty): Change its type.
	* term.c (term_gpm): Delete.  Use gpm_tty's NULLness instead.
	(gpm_tty): Change its type and initialize it.
	(Fterm_open_connection): Check the frame is indeed a tty.
	Use the new gpm_tty.
	(Fterm_close_connection): Use the new gpm_tty.
	* keyboard.c (tty_read_avail_input): Use the new gpm_tty.
	* sysdep.c (init_sys_modes): term_gpm -> gpm_tty.

2007-09-21  Juanma Barranquero  <lekktu@gmail.com>

	* w32term.c (x_draw_glyph_string): Use strike_through_color, not
	underline_color, to draw strike-through.

2007-09-21  Stefan Monnier  <monnier@iro.umontreal.ca>

	* lisp.h (allocate_terminal): Declare.

	* window.c (candidate_window_p): Consider frames that are being placed
	by the user as somewhere between visible and iconified.
	(window_loop): Prefer windows on the current frame.
	(Fselect_window): Move the use of select-frame to the beginning so we
	can just delegate all the work (it'll call us back anyway).

	* frame.c (Qdisplay_environment_variable):
	* frame.h (Qdisplay_environment_variable): Delete.

	* .gdbinit (xbacktrace): Print the arg's address rather than the value
	of the first arg, since that value may be a union.

	* callproc.c (child_setup, getenv_internal): Use the frame's `display'
	parameter rather than Qdisplay_environment_variable.  If all else
	fails, look for DISPLAY in initial-environment.

2007-09-21  Glenn Morris  <rgm@gnu.org>

	* Makefile.in (emacstool): Remove target.
	(lisp, shortlisp): Remove termdev.elc.

2007-09-21  Markus Triska  <markus.triska@gmx.at>

	* xterm.c (x_delete_display): Compile session management conditionally.

2007-09-20  Stefan Monnier  <monnier@iro.umontreal.ca>

	* callproc.c (getenv_internal_1): New function.
	(getenv_internal): Use it.
	(Fgetenv_internal): Use it.  Accept an env-list as optional arg.

	* terminal.c (get_terminal): Don't accept ints to represent terminals.
	(Fterminal_name, Fterminal_parameters, Fterminal_parameter)
	(Fset_terminal_parameter): Work with dead terminals as well.
	(Fmodify_terminal_parameters): Remove.

	* terminal.c (get_terminal): Handle terminals.
	Make sure the terminal returned is live.
	(create_terminal): Use allocate_terminal.
	(mark_terminals): Move to alloc.c.
	(delete_terminal): Use terminal->name as liveness status.
	NULL out fields after freeing their contents.
	Don't deallocate the object.
	(Fframe_terminal): Use FRAME_TERMINAL.  Return the terminal object
	rather than an int.
	(Fterminal_live_p): Accept non-integer arguments.
	(Fterminal_list): Return terminal objects rather than an ints.

	* alloc.c (enum mem_type): New member for `terminal' objects.
	(allocate_terminal): New function.
	(mark_maybe_pointer, valid_lisp_object_p, mark_object):
	Handle terminals.
	(mark_terminal): New fun.
	(mark_terminals): Move from terminal.c.

	* term.c (get_tty_terminal): Don't treat output_initial specially.
	(Fsuspend_tty, Fresume_tty): Use terminal objects rather than ints.
	(delete_tty): Use terminal->name as liveness status.

	* termhooks.h (struct terminal): Make it into a pseudovector.
	Remove `deleted' replaced by checking `name's nullness.

	* print.c (print_object): Handle terminals.

	* lisp.h (enum pvec_type): New `terminal' pseudovector.
	(XTERMINAL, XSETTERMINAL, TERMINALP, GC_TERMINALP): New macros.

	* frame.c (make_terminal_frame):
	* keyboard.c (tty_read_avail_input):
	* w32term.c (x_delete_terminal):
	* xfns.c (Fx_create_frame, x_create_tip_frame):
	* xterm.c (x_delete_terminal): Use terminal->name as liveness status.

2007-09-20  Glenn Morris  <rgm@gnu.org>

	* process.c (Fmake_network_process): Doc fix.

2007-09-19  Jason Rumney  <jasonr@gnu.org>

	* dispextern.h (w32_init_fringe, mac_init_fringe): Declare rif argument.

2007-09-19  Micha,Ak(Bl Cadilhac  <michael@cadilhac.name>

	* coding.c (detect_eol_type, detect_eol_type_in_2_octet_form):
	Fix a C warning regarding variable constness.

	* xterm.c (handle_one_xevent): Fix a C warning.

2007-09-18  Jason Rumney  <jasonr@gnu.org>

	* w32fns.c (Fx_focus_frame): Rename from Fw32_focus_frame.

2007-09-17  Jan Dj,Ad(Brv  <jan.h.d@swipnet.se>

	* gtkutil.c (gdpy_def): New variable.
	(xg_initialize): Initialize gdpy_def.
	(xg_display_close): If no other display exists, set gdpy_def to a
	new connection.

2007-09-16  Jan Dj,Ad(Brv  <jan.h.d@swipnet.se>

	* gtkutil.c (xg_get_image_for_pixmap): Always create a GdkPixbuf
	when we have no file name for the icon.
	(xg_tool_bar_expose_callback): Remove.
	(xg_create_tool_bar): Don't connect expose signal to
	xg_tool_bar_expose_callback.
	(xg_get_file_with_chooser): Move GCPRO1 after declarations.

2007-09-16  Andreas Schwab  <schwab@suse.de>

	* alloc.c (reset_malloc_hooks): Set the hooks to the previous
	values instead of zapping them.

2007-09-14  Glenn Morris  <rgm@gnu.org>

	* fringe.c (init_fringe_bitmap) <swap_nibble>: Move to file scope.
	* gtkutil.c (xg_separator_p) <separator_names>: Move to file scope.
	* image.c (our_memory_fill_input_buffer) <buffer>: Move to file
	scope and rename to omfib_buffer for clarity.
	(gif_load) <interlace_start, interlace_increment>: Move to file scope.

2007-09-14  Kenichi Handa  <handa@m17n.org>

	* xterm.c (handle_one_xevent): Skip decoding if nbytes is zero.

2007-09-13  Jason Rumney  <jasonr@gnu.org>

	* fringe.c (w32_init_fringe, mac_init_fringe): Add rif argument.

	* w32term.c (w32_term_init): Pass rif to w32_init_fringe.

	* macterm.c (mac_initialize): Don't call mac_init_fringe here.
	(mac_term_init): Call here instead, passing rif.

2007-09-13  Glenn Morris  <rgm@gnu.org>

	* s/hpux.h: No longer define `static' as nothing.

2007-09-13  Johan Bockg,Ae(Brd  <bojohan@gnu.org>

	* callint.c (Fcall_interactively): Remove unused var `fun'.

2007-09-12  Romain Francoise  <romain@orebokech.com>

	* window.c (prefer_window_split_horizontally, display_buffer):
	Revert 2007-09-08 change.

2007-09-12  Glenn Morris  <rgm@gnu.org>

	* alloca.c: Remove file.
	* Makefile.in (alloca): Do not undef.
	(allocaobj, alloca.o): Remove.
	(otherobj): Remove allocaobj.
	* keyboard.c (command_loop_1): Remove #ifdef C_ALLOCA block.
	* regex.c (C_ALLOCA): Remove all references and code that was only
	used when this was defined.
	* search.c (boyer_moore): Remove #ifdef C_ALLOCA block.
	* xmenu.c (xmenu_show): Remove #ifdef C_ALLOCA block.
	* m/ibms390x.h, m/sh3el.h (C_ALLOCA): Remove references to this.

	* Makefile.in (SOURCES, unlock, relock): Delete.

	* gtkutil.c (cnt): Rename to menu_grab_callback_cnt for clarity.
	(menu_grab_callback): All uses changed.

	* xselect.c (cnt): Rename to x_reply_selection_request_cnt for clarity.
	(x_reply_selection_request): All uses changed.

2007-09-11  Stefan Monnier  <monnier@iro.umontreal.ca>

	* lread.c (load_warn_old_style_backquotes): Change message to look
	better when it appears in the middle of byte-compiler messages.

2007-09-10  Dan Nicolaescu  <dann@ics.uci.edu>

	* s/darwin.h (MULTI_KBOARD): Only define for Carbon.

	* xterm.c (x_create_terminal): Add comment.

	* term.c (clear_tty_hooks, set_tty_hooks): Add comments.

2007-09-10  Richard Stallman  <rms@gnu.org>

	* xterm.c (x_term_init): Give error if can't open DISPLAY_NAME.

2007-09-10  Micha,Ak(Bl Cadilhac  <michael@cadilhac.name>

	* lisp.h (struct Lisp_Subr): Rename `prompt' field to `intspec'.
	(DEFUN): Document `intspec', use it instead of `prompt'.

	* eval.c (Fcommandp): Change `->prompt' to `->intspec'.

	* data.c (Finteractive_form): If the interactive specification starts
	with a `(', use it as a Lisp form.

	* fileio.c (Fset_file_modes): Add an interactive spec that reads a file
	name and file modes.

	* callint.c (Fcall_interactively): Comment fixes.

2007-09-10  Stefan Monnier  <monnier@iro.umontreal.ca>

	* callint.c (Fcall_interactively): Use Finteractive_form also for subrs
	and compiled functions.

2007-09-08  Fredrik Axelsson  <f.axelsson@gmail.com>

	* window.c (prefer_window_split_horizontally): New variable.
	(display_buffer): Consider splitting window horizontally depending
	on prefer_window_split_horizontally.

2007-09-08  Eli Zaretskii  <eliz@gnu.org>

	* sysdep.c [WINDOWSNT]: Don't include sysselect.h.

2007-09-07  Stefan Monnier  <monnier@iro.umontreal.ca>

	* s/cygwin.h (GC_MARK_STACK): Enable conservative stack marking.

	* frame.c (x_set_frame_parameters): Check number is positive before
	using XFASTINT.

	* window.c (freeze_window_start): Don't presume selected_window holds
	a window object.
	(Fdisplay_buffer): Remove `register' since `buffer' needs to be gcpro'd.

2007-09-07  Angelo Graziosi  <Angelo.Graziosi@roma1.infn.it>  (tiny change)

	* term.c (dissociate_if_controlling_tty): Call setsid on CYGWIN.

2007-09-07  Stefan Monnier  <monnier@iro.umontreal.ca>

	* window.c (Vsplit_window_preferred_function): New var.
	(Fdisplay_buffer): Use it.
	(syms_of_window): Export, and initialize it.

2007-09-06  Pixel  <pixel@mandriva.com>  (tiny change)

	* image.c (gif_load): Fix bug: Handle nonexistent colormap.

2007-09-06  Glenn Morris  <rgm@gnu.org>

	* gtkutil.c (menu_grab_callback) <cnt>:
	* xselect.c (x_reply_selection_request) <cnt>: Move static
	variable to file scope.

2007-09-06  Stefan Monnier  <monnier@iro.umontreal.ca>

	* xdisp.c (redisplay_internal): Make sure Elisp code always sees
	consistent values of selected_frame and selected_window.

2007-09-04  Jason Rumney  <jasonr@gnu.org>

	* w32console.c (initialize_w32_display): Zero unused hooks.

2007-09-04  Dan Nicolaescu  <dann@ics.uci.edu>

	* term.c (Vsuspend_tty_functions, Vresume_tty_functions)
	(syms_of_term, Fsuspend_tty, Fresume_tty): Undo previous change.

2007-09-04  Jason Rumney  <jasonr@gnu.org>

	* term.c (init_tty) [WINDOWSNT]: Add hooks that are not accessible
	in w32console.c.  Set up input.  Remove XXX comments that have been
	confirmed as correct.

	* s/ms-w32.h (MULTI_KBOARD): Define.

	* w32console.c (one_and_only_w32cons): Remove.
	(initialize_w32_display): Take terminal argument.

	* term.c (init_tty) [WINDOWSNT]: Pass terminal to
	initialize_w32_display.
	(init_tty) [MULTI_KBOARD]: Include this code on WINDOWSNT too.

	* termhooks.h (enum event_kind) <HORIZ_WHEEL_EVENT>: New event.

	* keyboard.c (discard_mouse_events): Discard it.
	(make_lispy_event): Translate it to a lisp event.
	(lispy_wheel_names): Add wheel-left and right events.
	(syms_of_keyboard): Enlarge wheel_syms.

	* w32fns.c (w32_wnd_proc) <WM_DROPFILES>: Merge with WM_MOUSEWHEEL.
	<WM_MOUSEHWHEEL>: Pass new system message to lisp.

	* w32term.h (WM_MOUSEHWHEEL): Define if system headers don't.

	* w32term.c (construct_mouse_wheel): Make HORIZ_WHEEL_EVENT
	from WM_MOUSEHWHEEL.
	(w32_read_socket) <WM_MOUSEHWHEEL>: Treat as WM_MOUSEWHEEL.

	* w32fns.c (x_create_tip_frame) [MULTI_KBOARD]: Get keyboard from
	terminal.

	* w32term.c (w32_create_terminal) [MULTI_KBOARD]: Create a new
	keyboard for the terminal.

2007-09-04  Dan Nicolaescu  <dann@ics.uci.edu>

	* term.c (Vsuspend_tty_hook): Rename from Vsuspend_tty_functions.
	(Vresume_tty_hook): Rename from Vresume_tty_functions.
	(syms_of_term): Rename suspend-tty-functions to suspend-tty-hook
	and resume-tty-function to resume-tty-hook.
	(Fsuspend_tty, Fresume_tty): Use new names.

2007-09-02  Jan Dj,Ad(Brv  <jan.h.d@swipnet.se>

	* gtkutil.c (update_frame_tool_bar): Handle stock name as a named icon
	if it starts with "n:".

2007-08-31  Jan Dj,Ad(Brv  <jan.h.d@swipnet.se>

	* gtkutil.c (update_frame_tool_bar): Initialize wbutton to NULL.

2007-08-31  Stefan Monnier  <monnier@iro.umontreal.ca>

	* frame.h:
	* frame.c (Qterm_environment_variable): Remove.
	(syms_of_frame): Don't init and staticpro it.

	* callproc.c (getenv_internal): Remove special case for $TERM.

	* callproc.c (Vinitial_environment): New variable.
	(set_initial_environment): Initialize it.
	(syms_of_callproc): Declare it.
	(child_setup): Don't mess with TERM via Qterm_environment_variable; the
	TERM under which a process runs is never related to the TERM in which
	Emacs is running.

2007-08-29  Dan Nicolaescu  <dann@ics.uci.edu>

	* config.in (HAVE_WINDOW_SYSTEM): Don't undef MULTI_KBOARD here...
	* s/darwin.h: ... do it here.

2007-08-29  Stefan Monnier  <monnier@iro.umontreal.ca>

	* lisp.h (set_initial_environment): Rename from set_global_environment.

	* Makefile.in (${etc}DOC): Re-add a ${EXEEXT} which seems to have been
	removed by mistake on the multi-tty branch.

	* frame.c (make_terminal_frame): Yet Another Int/Lisp_Object Mixup.
	(Fmodify_frame_parameters): Return a value.

	* image.c (png_load): Comment-out var only used in commented-out code.

	* term.c (mark_ttys): Don't bother checking top_frame (incorrectly)
	before passing it to mark_object.

	* xfaces.c (internal_resolve_face_name): Return a value.
	(internal_resolve_face_name, resolve_face_name_error): Comment out.

	* xfns.c (check_x_display_info): Yet Another Int/Lisp_Object Mixup.
	(x_icon): Comment-out var only used in commented-out code.

2007-08-29  Romain Francoise  <romain@orebokech.com>

	* keyboard.c (Fset_input_mode): Don't call `Fset_quit_char' if
	QUIT hasn't been provided.

2007-08-29  Dan Nicolaescu  <dann@ics.uci.edu>

	* callproc.c (child_setup, getenv_internal): Use the
	display-environment-variable and term-environment-variable frame params.
	(set_initial_environment): Initialise Vprocess_environment.

	* config.in: Disable multi-keyboard support on a mac.

	* frame.c (Qterm_environment_variable)
	(Qdisplay_environment_variable): New variables.
	(syms_of_frame): Intern and staticpro them.
	(Fmake_terminal_frame): Disable output method test.

	* frame.h: Declare them here.

	* macfns.c (x_set_mouse_color): Get rif from the frame.
	(x_set_tool_bar_lines): Don't use updating_frame.
	(mac_window): Add 2 new parameters for consistency with other systems.
	(Fx_create_frame): Fix doc string.  Rename the parameter.  Set the
	frame parameters following what is done in X11 and w32.  Don't use
	FRAME_MAC_DISPLAY_INFO.
	(Fx_open_connection, start_hourglass): Remove window-system check.
	(x_create_tip_frame): Get the keyboard from the terminal.

	* macmenu.c: Reorder includes.
	(Fx_popup_menu): Use terminal specific mouse_position_hook.

	* macterm.c (XTset_terminal_modes, XTreset_terminal_modes): Add a
	terminal parameter.
	(x_clear_frame): Add a frame parameter.
	(note_mouse_movement): Get rif from the frame.
	(mac_term_init): Initialize the terminal.
	(mac_initialize): Make static and move terminal initialization ...
	(mac_create_terminal): ... to this new function.

	* macterm.h (struct mac_display_info): Add terminal.
	(mac_initialize): Delete declaration.

	* puresize.h (BASE_PURESIZE): Increase base value to 1164000.

	* sysdep.c: Comment out text after #endif.

	* term.c (init_tty): Only use terminal->kboard when MULTI_KBOARD
	is defined.  Better initialize ttys in windows.  Use terminal
	specific mouse_position_hook.

	* termhooks.h (union display_info): Add mac_display_info.

	* w32fns.c (Fx_create_frame): Use kboard from the terminal.
	Set the default minibuffer frame, window_system and the rest of the
	frame parameters following what is done in X11.

	* w32term.c (w32_initialize): Make static.

	* xselect.c (x_handle_selection_clear): Only access
	terminal->kboard when MULTI_KBOARD is defined.

	* s/darwin.h (SYSTEM_PURESIZE_EXTRA): Define here.
	(SYSTEM_PURESIZE_EXTRA): Only define on Carbon.

2007-08-29  Jason Rumney  <jasonr@gnu.org>

	* frame.c (Fdelete_frame): Only get kboard when MULTI_KBOARD defined.
	(make_terminal_frame) [WINDOWSNT]: Initialize terminal.

	* fringe.c (w32_init_fringe w32_reset_fringes) [HAVE_NTGUI]:
	(mac_init_fringe) [MAC_OS]: Get rif from selected_frame.

	* keyboard.c (restore_kboard_configuration): Only define when
	MULTI_KBOARD defined.

	* makefile.w32-in: Update dependancies from Makefile.in.
	(OBJ1): Add terminal.$(O)

	* term.c (dissociate_if_controlling_tty) [WINDOWSNT]:
	Don't define function body.
	(init_tty) [WINDOWSNT]: Use selected_frame for initializing.

	* termhooks.h (display_info) [WINDOWSNT]: Add w32.

	* w32.c (request_sigio, unrequest_sigio): Remove.

	* w32console.c (w32con_move_cursor, w32con_clear_to_end)
	(w32con_clear_frame, w32con_clear_end_of_line)
	(w32con_ins_del_lines, w32con_insert_glyphs, w32con_write_glyphs)
	(w32con_delete_glyphs, w32con_set_terminal_window)
	(scroll_line, w32_sys_ring_bell): Add frame arg.
	(w32con_set_terminal_modes, w32con_reset_terminal_modes):
	Add terminal arg.
	(PICK_FRAME): Remove.
	(w32con_write_glyphs): Use frame specific terminal coding.
	(one_and_only_w32cons): New global variable.
	(initialize_w32_display): Use it for storing hooks.
	(create_w32cons_output): New function.

	* w32inevt.c, w32inevt.h (w32_console_read_socket): Make first
	arg a frame.

	* w32fns.c (x_create_tip_frame): Set terminal and ref count.
	Set window_system.
	(x_set_tool_bar_lines): Don't use updating_frame.
	(Fx_create_frame): Set terminal and ref count.
	(Fx_open_connection): Remove window-system check.

	* w32menu.c (Fx_popup_menu): Use terminal specific mouse_position_hook.

	* w32term.c (w32_term_init): Call add_keyboard_wait_descriptor.
	(w32_set_terminal_modes, w32_reset_terminal_modes): Add terminal arg.
	(x_clear_frame, x_delete_glyphs, w32_ring_bell, x_ins_del_lines):
	Add frame arg.
	(x_delete_terminal, w32_create_terminal): New functions.
	(w32_term_init): Create a terminal.
	(w32_initialize): Move terminal specific initialization to
	w32_create_terminal.

	* w32term.h (x_output): Remove foreground_pixel and background_pixel.
	(w32_clear_rect, w32_clear_area): Use background from frame.
	(w32_display_info): Add terminal.
	(w32_sys_ring_bell, x_delete_display): Declare here.

	* xdisp.c (display_menu_bar) [HAVE_NTGUI]: Check frame type.

	* s/ms-w32.h (SYSTEM_PURESIZE_EXTRA): Bump to 50k.

2007-08-29  Kalle Olavi Niemitalo  <kon@iki.fi>  (tiny change)

	* keyboard.c (interrupt_signal, handle_interrupt, Fset_quit_char):
	Fix get_named_tty calls for the controlling tty.

2007-08-29  ARISAWA Akihiro  <ari@mbf.ocn.ne.jp>  (tiny change)

	* term.c (dissociate_if_controlling_tty)[USG]: Fix parse error.

2007-08-29  Yoshiaki Kasahara  <kasahara@nc.kyushu-u.ac.jp>  (tiny change)

	* term.c (tty_insert_glyphs): Add missing first parameter.

2007-08-29  K,Aa(Broly L$,1 q(Brentey  <karoly@lorentey.hu>

	* buffer.c (Fbuffer_list, Fbury_buffer):
	Take frame->buried_buffer_list into account.

	* cm.c (current_tty): New variable, for cmputc().
	(cmputc): Use it.
	(cmcheckmagic): Add tty parameter, look up terminal streams there.
	(calccost): Add tty parameter.  Use emacs_tputs() instead of tputs().
	(cmgoto): Add tty parameter.  Pass it on to calccost().
	Use emacs_tputs() instead of tputs().

	* cm.h (emacs_tputs): New macro to set current_tty, and then call
	tputs().
	(current_tty): New variable, for cmputc().
	(cmcheckmagic, cmputc, cmgoto): Add prototypes.

	* eval.c (unwind_to_catch): Don't call x_fully_uncatch_errors.
	(internal_condition_case, internal_condition_case_1)
	(internal_condition_case_2): Don't abort when x_catching_errors.

	* fns.c (Fyes_or_no_p): Don't try to open an X dialog on tty terminals.
	(Fy_or_n_p): Likewise.  Use temporarily_switch_to_single_kboard to
	prevent crashes caused by bogus longjmps in read_char.

	* keymap.h (Fset_keymap_parent): Add EXFUN.

	* macterm.h (FRAME_FOREGROUND_PIXEL, FRAME_BACKGROUND_PIXEL)
	* w32term.h (FRAME_FOREGROUND_PIXEL, FRAME_BACKGROUND_PIXEL):
	Remove redundant definition.

	* macfns.c (x_set_mouse_color, x_make_gc):
	Use FRAME_BACKGROUND_PIXEL and FRAME_FOREGROUND_PIXEL.

	* w32term.c (x_free_frame_resources):
	Use FRAME_BACKGROUND_PIXEL and FRAME_FOREGROUND_PIXEL.
	(w32_initialize): Use the accessor macros for terminal characteristics.

	* macterm.c (mac_initialize): Use Fset_input_interrupt_mode.
	Use the accessor macros for terminal characteristics.
	* msdos.c (internal_terminal_init): Use the accessor macros for
	terminal characteristics.
	(ScreenVisualBell, internal_terminal_init):
	Use FRAME_BACKGROUND_PIXEL and FRAME_FOREGROUND_PIXEL.

	* termopts.h (no_redraw_on_reenter): Declare.

	* alloc.c (emacs_blocked_malloc): Disable mallopt call.
	(mark_terminals, mark_ttys): Declare.
	(Fgarbage_collect): Call them.
	(mark_object): Mark buried_buffer_list.

	* prefix-args.c: Include stdlib.h for exit.

	* syssignal.h: Add comment.

	* indent.c: Include stdio.h.

	* window.h (Vinitial_window_system): Declare.
	(Vwindow_system): Delete declaration.

	* fontset.c (Finternal_char_font): Use FRAME_RIF.

	* image.c (lookup_image): Don't initialize `c' until the xasserts
	have been run.

	* gtkutil.c (xg_create_frame_widgets): Use FRAME_BACKGROUND_PIXEL and
	FRAME_FOREGROUND_PIXEL.

	* print.c (print_preprocess): Don't lose print_depth levels while
	iterating.

	* widget.c (update_from_various_frame_slots):
	Use FRAME_BACKGROUND_PIXEL and FRAME_FOREGROUND_PIXEL.

	* window.c (set_window_buffer): Don't call clear_mouse_face on tty
	frames.
	(window_internal_height): Remove bogus make_number call.
	(init_window_once): Call make_terminal_frame with two zero parameters.

	* fileio.c (Fread_file_name): Update comment.

	* callint.c (Fcall_interactively):
	Use temporarily_switch_to_single_kboard instead of single_kboard_state.
	Make sure it is correctly unwound.

	* xsmfns.c (x_session_close): New function.

	* coding.h (terminal_coding, safe_terminal_coding, keyboard_coding):
	Delete declarations.

	* xterm.h: Remove declaration for x_fully_uncatch_errors.
	(x_output): Remove background_pixel and foreground_pixel fields.
	(x_display_info): Add new field TERMINAL.  Remove KBOARD field.
	(x_delete_device):
	(x_session_close): Declare.

	* lread.c: Include setjmp.h.  Update declaration of `read_char'.
	(read_filtered_event): Call `read_char' with a local
	`wrong_kboard_jmpbuf'.

	* minibuf.c (read_minibuf): Call temporarily_switch_to_single_kboard.
	Don't call single_kboard_state.  Use FRAME_RIF.

	* process.c (Fmake_network_process): Don't unrequest_sigio on modern
	systems.

	* lisp.h (set_process_environment): Rename to `set_global_environment'.
	(Fframe_with_environment, Fset_input_meta_mode)
	(Fset_quit_char): EXFUN.
	(x_create_device, tty_output, terminal, tty_display_info): Declare.
	(init_sys_modes, reset_sys_modes): Update prototypes.
	(init_all_sys_modes, reset_all_sys_modes): New prototypes.

	* keyboard.h (struct kboard): Add new fields Vlocal_function_key_map,
	Vlocal_key_translation_map, and Vkeyboard_translate_table.
	(Vfunction_key_map, Vkeyboard_translate_table, single_kboard_state):
	Delete declarations.
	(Vfunction_key_map, Vkey_translation_map, push_kboard, pop_kboard)
	(temporarily_switch_to_single_kboard, tty_read_avail_input):
	New declarations.

	* emacs.c (main): Don't call init_sys_modes(), the new term_init()
	already does that during init_display().  Call syms_of_keymap
	before syms_of_keyboard.  Call `syms_of_terminal'.
	Call set_initial_environment, not set_process_environment.
	(shut_down_emacs): Call reset_all_sys_modes() instead of
	reset_sys_modes().

	* xfaces.c (x_free_gc): Protect xassert with GLYPH_DEBUG.
	(internal_resolve_face_name, resolve_face_name_error): New functions.
	(resolve_face_name): Protect against loops and errors thrown by Fget.
	(realize_default_face): Don't use FRAME_FONT unless frame is an X frame.
	(Ftty_supports_face_attributes_p): Update tty_capable_p call.

	* scroll.c: Replace CURTTY() with local variables throughout the
	file (where applicable).
	(calculate_scrolling, calculate_direct_scrolling)
	(scrolling_1, scroll_cost): Use the accessor macros for terminal
	characteristics.

	* keymap.c (Vfunction_key_map): Remove.
	(Fdescribe_buffer_bindings): Update references to Vfunction_key_map.
	(syms_of_keymap): Remove DEFVAR for Vfunction_key_map.
	(Vkey_translation_map): Remove.
	(syms_of_keymap): Remove DEFVAR for key-translation-map.
	(Fdescribe_buffer_bindings):
	(read_key_sequence, init_kboard, syms_of_keyboard, mark_kboards):
	Update for terminal-local key-translation-map.

	* Makefile.in (callproc.o): Update dependencies.
	(lisp, shortlisp): Add termdev.elc.
	(obj): Add terminal.o.
	(terminal.o): Add dependencies.
	[HAVE_CARBON]: Make terminal.o depend on macgui.h.
	(data.o, fns.o): Add termhooks.h dependency.
	(SOME_MACHINE_LISP): Add dnd.elc.
	(minibuf.o): Fix typo.
	Update dependencies.

	* data.c (do_symval_forwarding, store_symval_forwarding)
	(find_symbol_value): Use the selected frame's keyboard, not
	current_kboard.

	* .gdbinit (init_sys_modes): Use Vinitial_window_system instead of
	Vwindow_system.

	* xmenu.c (Fx_menu_bar_open) [USE_X_TOOLKIT, USE_GTK]: Rename from
	Fmenu_bar_open.
	(syms_of_xmenu): Update defsubr.
	(mouse_position_for_popup, Fx_popup_menu)
	(Fx_popup_dialog, x_activate_menubar, update_frame_menubar)
	(set_frame_menubar, free_frame_menubar)
	(create_and_show_popup_menu, xmenu_show, )
	(create_and_show_dialog, xdialog_show, xmenu_show): Abort if not
	an X frame.

	* xselect.c (x_own_selection): Abort if not an X frame.
	(some_frame_on_display): Check if it is an X frame.
	(x_handle_selection_clear): Deal with MULTI_KBOARD.

	* coding.c: Include frame.h and termhooks.h.
	(terminal_coding, keyboard_coding): Delete.
	(Fset_terminal_coding_system_internal):
	(Fset_keyboard_coding_system_internal):
	(Fkeyboard_coding_system):
	(Fterminal_coding_system): Add a terminal parameter.
	Get terminal_coding from the terminal.
	(init_coding_once): Don't call setup_coding_system here.

	* dispextern.h (set_scroll_region, turn_off_insert)
	(turn_off_highlight, background_highlight, clear_end_of_line_raw)
	(tty_clear_end_of_line, tty_setup_colors)
	(delete_tty, updating_frame)
	(produce_special_glyphs, produce_glyphs, write_glyphs)
	(insert_glyphs): Remove.
	(raw_cursor_to, clear_to_end, tty_turn_off_insert)
	(tty_turn_off_highlight, get_tty_size): Add declaration.
	(tabs_safe_p, init_baud_rate, get_tty_terminal): Update prototypes.

	* frame.h (enum output_method): Add output_initial.
	(struct x_output): Delete.
	(FRAME_FOREGROUND_PIXEL, FRAME_BACKGROUND_PIXEL):
	Access foreground_pixel and background_pixel directly from the frame.
	(tty_display): Delete.
	(struct frame): Add buried_buffer_list, foreground_pixel,
	background_pixel and terminal.  Delete kboard
	(union output_data): Add tty.
	(FRAME_KBOARD): Get the kboard from the terminal.
	(FRAME_INITIAL_P): New macro.
	(Qtty, Qtty_type, Qterminal, Qterminal_live_p, Qenvironment)
	(Qterm_environment_variable, Qdisplay_environment_variable)
	(make_terminal_frame, Qburied_buffer_list, Qwindow_system):
	New declarations.

	* termchar.h (tty_output, tty_display_info): New structures.
	(tty_list): Declare.
	(FRAME_TTY, CURTTY): New macros.
	(must_write_spaces, min_padding_speed, fast_clear_end_of_line)
	(line_ins_del_ok, char_ins_del_ok, scroll_region_ok)
	(scroll_region_cost, memory_below_frame, fast_clear_end_of_line)
	(dont_calculate_costs, no_redraw_on_reenter): Remove declarations.

	* callproc.c: Include frame.h and termhooks.h, for terminal
	parameters.
	(add_env): New function.
	(child_setup): Use it.
	(child_setup, getenv_internal): Handle the new Vprocess_environment.
	(getenv_internal): Fix get_terminal_param call.
	(Fgetenv_internal, egetenv): Update doc.
	(syms_of_callproc): Initialize Vprocess_environment to nil.
	Register and initialize them.  Remove obsolete defvars.  Update doc
	strings.
	(child_setup): Handle Vlocal_environment_variables.
	(getenv_internal): Add terminal parameter.
	Handle Vlocal_environment_variables.
	(Fgetenv_internal): Add terminal parameter.
	(child_setup, getenv_internal, Fgetenv_internal): Store the local
	environment in a frame (not terminal) parameter.  Update doc strings.
	(set_initial_environment): Rename from set_global_environment.
	Store Emacs environment in initial frame parameter.

	* xdisp.c (redisplay_internal): Update references to
	`previous_terminal_frame'.
	(display_mode_line, Fformat_mode_line): Replace calls to
	`push_frame_kboard' with `push_kboard'.
	(get_glyph_string_clip_rects): Add extra parentheses and
	braces to prevent compiler warnings.
	(calc_pixel_width_or_height): Add xassert to check that the
	frame is alive.  Don't call `lookup_image' on a termcap frame.
	(message2_nolog, message3_nolog, redisplay_internal)
	(set_vertical_scroll_bar, redisplay_window, check_x_display_info)
	(x_set_scroll_bar_foreground, x_set_scroll_bar_background)
	(Fx_create_frame, Fxw_display_color_p, Fx_display_grayscale_p)
	(Fx_display_pixel_width, Fx_display_pixel_height)
	(Fx_display_planes, Fx_display_color_cells)
	(Fx_server_max_request_size, Fx_server_vendor, Fx_server_version)
	(Fx_display_screens, Fx_display_mm_height, Fx_display_mm_width)
	(Fx_display_backing_store, Fx_display_visual_class)
	(Fx_display_save_under, Fx_close_connection, x_create_tip_frame):
	Use FRAME_TERMINAL_P, FRAME_WINDOW_P, FRAME_TTY and FRAME_RIF.

	* xfns.c (x_set_foreground_color x_set_background_color)
	(x_set_mouse_color, x_set_cursor_color, x_make_gc):
	Use FRAME_BACKGROUND_PIXEL and FRAME_FOREGROUND_PIXEL.
	(Fx_create_frame, x_create_tip_frame, build_string, x_window)
	(Fx_create_frame, x_create_tip_frame): Don't create frames on a
	terminal that is being deleted.
	(Fx_create_frame): Use `store_frame_param' to set `window-system'
	frame parameter, and make sure it overrides any user-supplied setting.
	(Fx_close_connection, Fx_synchronize): Unify argument names with
	the rest of the DEFUNs.

	* dispnew.c (Fsend_string_to_terminal): Update call to
	`get_tty_terminal'.
	(Fredraw_frame, Fsend_string_to_terminal)
	(Fsend_string_to_terminal, init_display): Use FRAME_RIF,
	FRAME_TERMCAP_P and FRAME_TTY.
	(window_change_signal): Don't believe width/height values that are
	impossibly small.
	(Vinitial_window_system): Rename from Vwindow_system.
	(termscript, Wcm, rif): Delete.

	* termhooks.h (struct terminal): New struct containing the
	previously global text display hooks and new members NAME,
	DELETED and PARAM_ALIST.
	(FRAME_TERMINAL, TERMINAL_TERMINAL_CODING)
	(TERMINAL_KEYBOARD_CODING, TERMINAL_ACTIVE_P, FRAME_WINDOW_P)
	(FRAME_RIF): New macros.
	(get_terminal_param, get_device): New declarations.
	(termscript): Delete declaration.

	* xterm.c (x_initialize): Use Fset_input_interrupt_mode.
	(XTflash, x_free_frame_resources, x_scroll_bar_create)
	(x_scroll_bar_set_handle): Use FRAME_BACKGROUND_PIXEL and
	FRAME_FOREGROUND_PIXEL.
	(x_fully_uncatch_errors): Disable definition.
	(x_scroll_bar_expose): Fix reference to foreground pixel.
	(XTread_socket): Disable loop on all X displays.
	(x_delete_terminal): Don't set terminal->deleted and let
	delete_terminal delete the frames on the terminal.
	(x_delete_display): Doc update to reflect changes in
	delete_terminal.
	(x_display_info) <terminal>: Move member earlier in the struct.
	(deleting_tty): Remove old variable.
	(Fsuspend_tty): Call clear_tty_hooks.
	(Fresume_tty, init_tty): Call set_tty_hooks.
	(Ftty_display_color_p, Ftty_display_color_cells): Don't throw
	errors on X frames.
	(x_catch_errors_unwind): Abort if x_error_message is NULL.
	(handle_one_xevent): Initialize `f' to NULL.
	(x_delete_terminal, x_create_terminal): New functions.
	(XTset_terminal_modes, XTreset_terminal_modes)
	(XTread_socket, x_connection_closed, x_term_init)
	(x_term_init, x_delete_display): Add terminal parameter.
	(x_term_init) [!HAVE_GTK_MULTIDISPLAY]: Refuse to create secondary
	X connections.

	* frame.c (Fframep): Deal with output_initial.
	(Qbuffer_predicate, Qbuffer_list, Qburied_buffer_list, Qtty)
	(Qtty_type, Qwindow_system, Qenvironment)
	(Qterm_environment_variable, Qdisplay_environment_variable): New vars.
	(x_set_screen_gamma, store_frame_param): Fix compilation errors.
	(make_terminal_frame): Don't create frames on a terminal that is
	being deleted.
	(make_terminal_frame): Use FRAME_BACKGROUND_PIXEL and
	FRAME_FOREGROUND_PIXEL.
	(store_frame_param): Check for found_for_frame before calling XFRAME.
	(Fmake_terminal_frame): Handle NULL tty names correctly.
	(syms_of_frame): Enhance doc string of `default-frame-alist'.
	(Fdelete_frame): Remove unused variable `count'.
	(Qenvironment): New variable.
	(Fdelete_frame): Don't allow other frames to refer to a deleted
	frame in their 'environment parameter.
	(Fframe_with_environment): New function.
	(syms_of_frame): Defsubr it.  Initialize and staticpro Qenvironment.
	(get_future_frame_param): New function.
	(Fmake_terminal_frame): Use it.
	(x_set_frame_parameters, x_set_screen_gamma): Use FRAME_RIF.

	* sysdep.c (init_sys_modes, reset_sys_modes): Update for renames.
	* sysdep.c (reset_sys_modes): Update for renames.

	* keyboard.c (tty_read_avail_input): New function.
	(Fset_input_interrupt_mode, Fset_output_flow_control): New functions.
	(syms_of_keyboard): Defsubr them.
	(Fset_input_meta_mode, Fset_quit_char): New functions.
	(Fset_input_mode): Split to above functions.

	(read_char_minibuf_menu_prompt): Add wrong_kboard_jmpbuf
	parameter.  Use it in call to `read_char'.
	(read_char): Declare.  Update call to `read_char_minibuf_menu_prompt'.
	Set wrong_kboard_jmpbuf correctly in recursive calls.
	Use current_kboard to access Vkeyboard_translate_table.
	Enhance comment before extra longjmp to wrong_kboard_jmpbuf.
	Add wrong_kboard_jmpbuf parameter to allow for recursive calls.
	Update longjmp invocations.  Remember the original current_kboard,
	and longjmp to `wrong_kboard_jmpbuf' when a filter, timer or sentinel
	changes it.  Comment out unnecessary calls to
	`record_single_kboard_state' and `any_kboard_state'.
	Update recursive calls.
	(wrong_kboard_jmpbuf): Remove global variable.
	(read_key_sequence): Remove unused variable wrong_kboard_jmpbuf.
	Handle deleted interrupted_kboards correctly; that is a legal
	case.  Add `wrong_kboard_jmpbuf' local variable.  Update setjmp
	and read_char calls.  Abort if interrupted_kboard died in read_char.
	(any_kboard_state, single_kboard_state)
	(push_frame_kboard): Remove function.
	(pop_kboard): Switch out of single_kboard mode if the kboard has
	been deleted.  Remove unused variable.  Help debugging by not
	changing current_kboard unnecessarily.  Set current_kboard to the
	kboard of the selected frame when the stored kboard object has
	been deleted before pop_kboard.
	(temporarily_switch_to_single_kboard): Change first parameter to a
	frame pointer.  Throw an error when caller wants to change kboards
	while in single_kboard mode.  Don't push_kboard if we weren't in
	single kboard state.  Don't pop_kboard if we popped into any
	kboard state.
	(restore_kboard_configuration): Abort if pop_kboard changed the
	kboard in single_kboard mode.  Call pop_kboard only after setting
	up single_kboard mode.
	(Frecursive_edit): Switch to single_kboard mode only in nested
	command loops.
	(cmd_error, command_loop, command_loop_1, timer_check):
	Comment out unnecessary call to `any_kboard_state' and
	`record_single_kboard_state'.
	(delete_kboard): Exit single_kboard mode if we have just deleted
	that kboard.  Use FRAME_KBOARD.
	(interrupt_signal): Use `Fkill_emacs' to exit Emacs, not
	`fatal_error_signal'.
	(record_single_kboard_state): Don't push_kboard if we weren't in
	single kboard state.  Don't pop_kboard if we popped into any
	kboard state.
	(push_frame_kboard): Rename to push_kboard.
	(kbd_buffer_get_event): Use FRAME_TERMINAL.
	(read_avail_input): Read input from all terminals.
	(mark_kboards): Also mark Vkeyboard_translate_table.
	(kbd_buffer_store_event_hold): Simplify condition.
	(read_key_sequence): Reinitialize fkey and keytran at each replay.
	(Vkeyboard_translate_table): Move to struct kboard.
	(init_kboard): Initialize Vkeyboard_translate_table.
	(syms_of_keyboard): Use DEFVAR_KBOARD to define
	Vkeyboard_translate_table.  Update doc strings.  Update docs of
	local-function-key-map and function-key-map.

	* terminal.c: New file.

	* term.c: Include errno.h.
	(Vring_bell_function, device_list, initial_device)
	(next_device_id, ring_bell, update_begin, update_end)
	(set_terminal_window, cursor_to, raw_cursor_to)
	(clear_to_end, clear_frame, clear_end_of_line)
	(write_glyphs, insert_glyphs, delete_glyphs, ins_del_lines)
	(Fdisplay_name, create_device, delete_device): Move to terminal.c.
	(syms_of_term): Move their initialization to terminal.c.
	(get_tty_terminal, Fdisplay_tty_type, Ftty_display_color_p)
	(Ftty_display_color_cells)
	(Ftty_no_underline, Fsuspend_tty, Fresume_tty, create_tty_output)
	(clear_tty_hooks, set_tty_hooks)
	(init_tty, maybe_fatal): New functions.
	(Ftty_type): Return nil if terminal is not on a tty instead of
	throwing an error.  Doc update.
	(syms_of_term) <Vsuspend_tty_functions, Vresume_tty_functions>:
	Doc update.  Initialize new subrs and variables.
	(delete_tty): Use terminal->deleted.
	(tty_set_terminal_modes): Rename from set_terminal_modes.
	(tty_reset_terminal_modes): Rename from reset_terminal_modes.
	(set_scroll_region): Rename to `tty_set_scroll_region'.
	(turn_on_insert): Rename to `tty_turn_on_insert'.
	(turn_off_insert): Rename to `tty_turn_off_insert'.
	(turn_off_highlight): Rename to `tty_turn_off_highlight'.
	(turn_on_highlight): Rename to `tty_turn_on_highlight'.
	(toggle_highligh): Rename to `tty_toggle_highlight'.
	(background_highlight): Rename to `tty_background_highlight'.
	(highlight_if_desired): Rename to `tty_highlight_if_desired'.
	(tty_ring_bell, tty_update_end, tty_set_terminal_window)
	(tty_set_scroll_region, tty_background_highlight)
	(tty_cursor_to, tty_raw_cursor_to, tty_clear_to_end)
	(tty_clear_frame, tty_clear_end_of_line, tty_write_glyphs)
	(tty_insert_glyphs, tty_delete_glyphs, tty_ins_del_lines)
	(term_get_fkeys, tty_setup_colors, dissociate_if_controlling_tty):
	Add static modifier.
	(tty_reset_terminal_modes, tty_set_terminal_window)
	(tty_set_scroll_region, tty_background_highlight)
	(tty_highlight_if_desired, tty_cursor_to)
	(tty_raw_cursor_to, tty_clear_to_end, tty_clear_frame)
	(tty_clear_end_of_line, tty_write_glyphs, tty_insert_glyphs)
	(tty_delete_glyphs, tty_ins_del_lines, turn_on_face): Update for
	renames.

2007-08-28  Jan Dj,Ad(Brv  <jan.h.d@swipnet.se>

	* keyboard.c: Qrtl is new.
	(parse_tool_bar_item): Handle :rtl keyword.
	(syms_of_keyboard): Intern :rtl keyword.

	* dispextern.h (enum tool_bar_item_idx): Add TOOL_BAR_ITEM_RTL_IMAGE.

	* gtkutil.c (xg_tool_bar_expose_callback): Just do SET_FRAME_GARBAGED
	so no Lisp code is executed.
	(file_for_image, find_rtl_image): New functions.
	(xg_get_image_for_pixmap): Use file_for_image
	(update_frame_tool_bar): If direction is RTL, use RTL image if
	defined.  Use Gtk stock images if defined.

2007-08-27  YAMAMOTO Mitsuharu  <mituharu@math.s.chiba-u.ac.jp>

	* macterm.c (x_draw_composite_glyph_string_foreground): Draw rectangle
	for nonexistent or zero-width glyph in composition glyph.

2007-08-25  Stefan Monnier  <monnier@iro.umontreal.ca>

	* m/amdx86-64.h: Redirect to intel386.h if compiling for i386.

	* xdisp.c (Finvisible_p): New function.
	(syms_of_xdisp): defsubr it.

2007-08-24  Juanma Barranquero  <lekktu@gmail.com>

	* image.c (syms_of_image) <image-library-alist, cross-disabled-images>:
	Doc fixes.

2007-08-24  YAMAMOTO Mitsuharu  <mituharu@math.s.chiba-u.ac.jp>

	* mac.c [MAC_OSX] (select_and_poll_event, sys_select): Fix last changes.

2007-08-24  Martin Rudalics  <rudalics@gmx.at>

	* fileio.c (Finsert_file_contents): Consult CHARS_MODIFF to tell
	whether decoding has modified buffer contents.

2007-08-24  Jason Rumney  <jasonr@gnu.org>

	* image.c [HAVE_NTGUI]: Define dynamic loaded functions for SVG.
	(Qgdk_pixbuf, Qglib) [HAVE_NTGUI]: New symbols.
	(syms_of_image) [HAVE_NTGUI]: Intern and staticpro them.
	(init_svg_functions) [HAVE_NTGUI]: New function.
	(fn_g_type_init, fn_g_object_unref, fn_g_error_free): New #defines.
	(svg_load_image): Use them.
	(svg_load_image) [HAVE_NTGUI]: Implement background.

2007-08-23  YAMAMOTO Mitsuharu  <mituharu@math.s.chiba-u.ac.jp>

	* Makefile.in (RSVG_LIBS, RSVG_CFLAGS): New variables.
	(ALL_CFLAGS): Use ${RSVG_CFLAGS} instead of @RSVG_CFLAGS@.
	(LIBX): Remove @RSVG_LIBS@.
	(LIBES): Add $(RSVG_LIBS).

	* image.c (svg_load_image): Blend with specified background if exists.
	Use IMAGE_BACKGROUND.  Add Mac OS Support.

	* mac.c (wakeup_from_rne_enabled_p) [MAC_OSX]: Remove variable.
	(ENABLE_WAKEUP_FROM_RNE, DISABLE_WAKEUP_FROM_RNE) [MAC_OSX]:
	Remove macros.
	[MAC_OSX] (socket_callback): Do nothing.
	[MAC_OSX] (select_and_poll_event): Use CFRunLoopRunInMode instead of
	ReceiveNextEvent.
	[MAC_OSX] (sys_select): Likewise.  Don't set context as argument to
	socket_callback.
	(mac_wakeup_from_rne) [MAC_OSX]: Do nothing.

2007-08-22  Glenn Morris  <rgm@gnu.org>

	* image.c (x_find_image_file): Search in etc/images/ rather than etc/.

2007-08-22  Paul Pogonyshev  <pogonyshev@gmx.net>

	* Makefile.in (ALL_CFLAGS, LIBX): Add RSVG_LIBS.

	* image.c: Add support for SVG images.  Some additional comments
	by Joakim Verona <joakim@verona.se>.  When HAVE_RSVG is defined:
	(svg_image_p): New function to test for SVG image.
	(svg_load): New function to load SVG image.
	(svg_load_image): New function, helper for svg_load.
	(Qsvg): New Lisp_object.
	(svg_keyword_index): New enum.
	(svg_format): New static `image_keyword' struct.
	(svg_type): New static `image_type' struct.
	(librsvg/rsvg.h): Include it.

2007-08-23  Stefan Monnier  <monnier@iro.umontreal.ca>

	* lread.c (load_warn_old_style_backquotes): Fix up array size typo.

2007-08-22  Stefan Monnier  <monnier@iro.umontreal.ca>

	* lread.c (Qold_style_backquotes): New var.
	(syms_of_lread): Init and staticpro it.
	(load_warn_old_style_backquotes): New fun.
	(Fload): Use them to warn about old style backquotes.
	(end_of_file_error, Fload): Remove unused vars.

	* lisp.h (Fclear_face_cache, Fx_send_client_event): Declare.

	* lread.c (Vold_style_backquotes): New var.
	(syms_of_lread): Init and export it to Elisp.
	(read1): Set it when we find an old-style (back)quote.

2007-08-22  Jason Rumney  <jasonr@gnu.org>

	* w32reg.c (SYSTEM_DEFAULT_RESOURCES): Add missing NULL terminator.

2007-08-22  Katsumi Yamaoka  <yamaoka@jpl.org>

	* puresize.h (BASE_PURESIZE): Increase to 1140000.

2007-08-19  Richard Stallman  <rms@gnu.org>

	* eval.c (Ffunction, Fquote): Signal error if not 1 argument.

2007-08-19  Andreas Schwab  <schwab@suse.de>

	* alloc.c (pure): Round PURESIZE up.

2007-08-17  Jan Dj,Ad(Brv  <jan.h.d@swipnet.se>

	* xterm.c (handle_one_xevent): Remove check that mouse click is in
	active frame.

2007-08-16  Richard Stallman  <rms@gnu.org>

	* eval.c (Fcommandp): Add parens to clarify.

	* minibuf.c (Fall_completions): Use enum for type of table.

	* emacs.c (USAGE2): Improve text.

2007-08-15  Philippe Waroquiers  <philippe.waroquiers@eurocontrol.int>

	* term.c (tty_default_color_capabilities): Declare static
	variables in file scope, to avoid HPUX compiler problem.

2007-08-13  Jan Dj,Ad(Brv  <jan.h.d@swipnet.se>

	* gtkutil.c (update_frame_tool_bar): Use -1 as index
	to gtk_toolbar_insert.

2007-08-13  Stefan Monnier  <monnier@iro.umontreal.ca>

	* fileio.c (Finsert_file_contents): Yet Another Int/Lisp_Object Mixup.

	* insdel.c (reset_var_on_error): New fun.
	(signal_before_change, signal_after_change):
	Use it to reset (after|before)-change-functions to nil in case of error.
	Bind inhibit-modification-hooks to t.
	Don't bind (after|before)-change-functions to nil while they run.

2007-08-11  YAMAMOTO Mitsuharu  <mituharu@math.s.chiba-u.ac.jp>

	* xterm.c (x_draw_image_glyph_string): Adjust stipple origin when
	filling pixmap with stippled background.

2007-08-10  YAMAMOTO Mitsuharu  <mituharu@math.s.chiba-u.ac.jp>

	* macterm.c [TARGET_API_MAC_CARBON] (mac_handle_window_event):
	Don't use invisible frame as parent window for repositioning.

2007-08-10  Stefan Monnier  <monnier@iro.umontreal.ca>

	* print.c (new_backquote_output): Rename from old_backquote_output.
	(print): Inverse its logic (according to its name) so as to match the
	behavior of new_backquote_flag in lread.c.

2007-08-09  YAMAMOTO Mitsuharu  <mituharu@math.s.chiba-u.ac.jp>

	* gmalloc.c (posix_memalign): New function.

	* macterm.c (frame_highlight, frame_unhighlight): Don't call
	ActivateControl/DeactivateControl here.
	[USE_MAC_TOOLBAR] (free_frame_tool_bar): Suppress animation when
	frame-notice-user-settings is non-nil.
	[USE_MAC_FONT_PANEL] (mac_handle_font_event): Also record parameter
	for kEventParamFMFontStyle.
	[TARGET_API_MAC_CARBON] (mac_handle_keyboard_event): Don't check
	mac_pass_command_to_system and mac_pass_control_to_system here.
	(XTread_socket): Call ActivateControl/DeactivateControl here.
	(XTread_socket) [TARGET_API_MAC_CARBON]:
	Check mac_pass_command_to_system and mac_pass_control_to_system here.
	(mac_handle_window_event) [USE_MAC_TOOLBAR]: Add further workaround
	for window repositioning.

2007-08-08  Glenn Morris  <rgm@gnu.org>

	* Replace `iff' in doc-strings and comments.

2007-08-07  Chong Yidong  <cyd@stupidchicken.com>

	* xdisp.c (move_it_by_lines): Remove incorrect optimization.

2007-08-07  Martin Rudalics  <rudalics@gmx.at>

	* fileio.c (Finsert_file_contents): Run format-decode and
	after_insert_file_functions on entire buffer when REPLACE is
	non-nil and inhibit modification_hooks and point_motion_hooks.
	For consistency, run after_insert_file_functions iff something
	got inserted.  Move signal_after_change and update_compositions
	after code running after_insert_file_functions.  Make sure that
	undo_list doesn't record intermediate steps of the decoding process.

2007-08-07  YAMAMOTO Mitsuharu  <mituharu@math.s.chiba-u.ac.jp>

	* emacs.c (main)
	[HAVE_GTK_AND_PTHREAD && !SYSTEM_MALLOC && !DOUG_LEA_MALLOC]:
	Call malloc_enable_thread on interactive startup.

	* gmalloc.c (_malloc_thread_enabled_p) [USE_PTHREAD]: New variable.
	(LOCK, UNLOCK, LOCK_ALIGNED_BLOCKS, UNLOCK_ALIGNED_BLOCKS)
	[USE_PTHREAD]: Conditionalize with it.
	(malloc_atfork_handler_prepare, malloc_atfork_handler_parent)
	(malloc_atfork_handler_child, malloc_enable_thread) [USE_PTHREAD]:
	New functions.

2007-08-06  Chong Yidong  <cyd@stupidchicken.com>

	* xdisp.c (redisplay_window): When restoring original buffer
	position, make sure it is still valid.

	* image.c (png_load): Ignore png-supplied background color.

2007-08-06  YAMAMOTO Mitsuharu  <mituharu@math.s.chiba-u.ac.jp>

	* mac.c [TARGET_API_MAC_CARBON] (cfdate_to_lisp): Obtain microsec value.
	Use kCFAbsoluteTimeIntervalSince1970.

	* macmenu.c (quit_dialog_event_loop) [TARGET_API_MAC_CARBON]:
	New variable.
	[TARGET_API_MAC_CARBON] (mac_handle_dialog_event): Set it if dialog
	event loop should be quit.
	[TARGET_API_MAC_CARBON] (create_and_show_dialog) [!MAC_OSX]:
	Quit dialog event loop if quit_dialog_event_loop is set.

	* macselect.c [!TARGET_API_MAC_CARBON]: Include Scrap.h.
	(Selection): New typedef.  Use instead of ScrapRef.
	(mac_get_selection_from_symbol): Rename from get_scrap_from_symbol.
	(mac_valid_selection_target_p): Rename from valid_scrap_target_type_p.
	(mac_clear_selection): Rename from clear_scrap.
	(get_flavor_type_from_symbol): New argument SEL and subsume function of
	scrap_has_target_type.  All uses changed.
	(mac_get_selection_ownership_info, mac_valid_selection_value_p)
	(mac_selection_has_target_p): New functions.
	(mac_put_selection_value): Rename from put_scrap_string.
	(mac_get_selection_value): Rename from get_scrap_string.
	(mac_get_selection_target_list): Rename from get_scrap_target_type_list.
	(put_scrap_private_timestamp, scrap_has_target_type)
	(get_scrap_private_timestamp): Remove functions.
	(SCRAP_FLAVOR_TYPE_EMACS_TIMESTAMP): Remove define.
	(x_own_selection, x_get_local_selection):
	Use mac_valid_selection_value_p.
	(x_own_selection): Don't use put_scrap_private_timestamp.
	Record OWNERSHIP-INFO into Vselection_alist instead.
	(x_get_local_selection): Don't check type if request is local.
	(Fx_selection_owner_p): Don't use get_scrap_private_timestamp.
	Detect ownership change with OWNERSHIP-INFO in Vselection_alist instead.

2007-08-04  Jan Dj,Ad(Brv  <jan.h.d@swipnet.se>

	* gtkutil.c (xg_tool_bar_callback): Generate two TOOL_BAR_EVENT:s,
	add comment explaining why.

2007-08-03  Richard Stallman  <rms@gnu.org>

	* fileio.c (Fvisited_file_modtime): Use make_time.

2007-08-01  Ryo Yoshitake  <ryo@shiftmode.net>  (tiny change)

	* mac.c (init_mac_osx_environment): Adjust load-path on self-contained
	build.

2007-07-31  Stefan Monnier  <monnier@iro.umontreal.ca>

	* gtkutil.c (xg_tool_bar_callback): Generate a single TOOL_BAR_EVENT.

2007-07-30  Katsumi Yamaoka  <yamaoka@jpl.org>

	* puresize.h (BASE_PURESIZE): Increase to 1130000.

2007-07-30  Richard Stallman  <rms@gnu.org>

	* lread.c (readevalloop, read1): Treat NBSP as whitespace.

2007-07-29  Jan Dj,Ad(Brv  <jan.h.d@swipnet.se>

	* gmalloc.c (__malloc_initialize): Remove pthread_once.  Not needed.

2007-07-28  Nick Roberts  <nickrob@snap.net.nz>

	* xdisp.c (decode_mode_spec): Use '@' instead of 'R' to test for
	remote default-directory.

	* buffer.c (mode-line-format): Update doc string.

2007-07-27  YAMAMOTO Mitsuharu  <mituharu@math.s.chiba-u.ac.jp>

	* w32term.c (w32_draw_fringe_bitmap): Extend fringe background to
	scroll bar gap.
	(x_scroll_bar_create): Set bar->fringe_extended_p.
	(w32_set_vertical_scroll_bar): Put leftmost/rightmost scroll bars
	on frame edge.  Check fringe background extension.  Don't clear
	extended fringe background area.

	* w32term.h (struct scroll_bar): New member fringe_extended_p.
	(w32_fill_area): Enclose multiple statements with do ... while (0).

	* xterm.c (x_draw_fringe_bitmap) [USE_TOOLKIT_SCROLL_BARS]:
	Extend fringe background to scroll bar gap.
	(x_scroll_bar_create) [USE_TOOLKIT_SCROLL_BARS]:
	Set bar->fringe_extended_p.
	(XTset_vertical_scroll_bar) [USE_TOOLKIT_SCROLL_BARS]:
	Put leftmost/rightmost scroll bars on frame edge.  Check fringe
	background extension.  Don't clear extended fringe background area.

	* xterm.h (struct scroll_bar) [USE_TOOLKIT_SCROLL_BARS]:
	New member fringe_extended_p.

2007-07-25  Glenn Morris  <rgm@gnu.org>

	* Relicense all FSF files to GPLv3 or later.

	* COPYING: Switch to GPLv3.

2007-07-25  Stefan Monnier  <monnier@iro.umontreal.ca>

	* eval.c (Fcommandp): Pay attention to the `interactive-form' property.

	* data.c (Finteractive_form): Check for the presence of an
	`interactive-form' symbol property more thoroughly.

	* data.c (Finteractive_form): Use an `interactive-form' property if
	present, analogous to the function-documentation property.

2007-07-24  Jason Rumney  <jasonr@gnu.org>

	* w32fns.c (x_real_positions): Get real position from OS instead of
	calculating it.

2007-07-23  Jason Rumney  <jasonr@gnu.org>

	* filelock.c (current_lock_owner): Allow for @ sign in username.

2007-07-22  Nick Roberts  <nickrob@snap.net.nz>

	* xdisp.c (decode_mode_spec): Add case 'R' for to test for
	remote default-directory.

	* buffer.c (mode-line-format): Describe above case in doc string.

2007-07-20  Eli Zaretskii  <eliz@gnu.org>

	* w32proc.c (IMAGE_NT_OPTIONAL_HDR32_MAGIC, IMAGE_OPTIONAL_HEADER32):
	Define if not defined.

2007-07-18  Jason Rumney  <jasonr@gnu.org>

	* w32proc.c (w32_executable_type): Handle 64 bit executables.

2007-07-18  Richard Stallman  <rms@gnu.org>

	* data.c (Fsetq_default): Doc fix.

	* eval.c (Fsetq): Doc fix.

2007-07-18  Juanma Barranquero  <lekktu@gmail.com>

	* coding.c (Ffind_operation_coding_system):
	* eval.c (For, Fand): Doc fixes.
	Reported by Johan Bockg,Ae(Brd.

2007-07-18  Jan Dj,Ad(Brv  <jan.h.d@swipnet.se>

	* xfns.c (Fx_focus_frame): Call x_ewmh_activate_frame.

	* xterm.h: Declare x_ewmh_activate_frame.

	* xterm.c (x_ewmh_activate_frame): New function.
	(XTframe_raise_lower): Move code to x_ewmh_activate_frame.

2007-07-17  Martin Rudalics  <rudalics@gmx.at>

	* window.c (Fdisplay_buffer): If largest or LRU window is the
	only window, split it even if it is not eligible for splitting.
	This restores the original behavior broken by the 2007-07-15
	change.

2007-07-17  Glenn Morris  <rgm@gnu.org>

	* abbrev.c (abbrev_check_chars): New function.
	(Fdefine_global_abbrev, Fdefine_mode_abbrev):
	Call abbrev_check_chars to check abbrev characters are word
	constituents.  Doc fix.

2007-07-17  Stefan Monnier  <monnier@iro.umontreal.ca>

	* process.c (Fstart_process, Fmake_network_process)
	(read_process_output): Fix up last changes.

2007-07-16  Eli Zaretskii  <eliz@gnu.org>

	* makefile.w32-in (clean): Don't delete *~.

2007-07-16  Andreas Schwab  <schwab@suse.de>

	* window.c (Fdisplay_buffer): Use NILP.
	(Fset_window_scroll_bars): Likewise.

2007-07-15  Martin Rudalics  <rudalics@gmx.at>

	* window.c (window_min_size_2): New function.
	(window_min_size_1, size_window, Fdisplay_buffer)
	(Fsplit_window, adjust_window_trailing_edge): Use it to avoid
	windows without mode- or header-lines when window-min-height is
	too small.
	(size_window): Reset nodelete_p after testing it, following an
	earlier note by Kim F. Storm.
	(display_buffer): Do not set split_height_threshold to twice the
	value of window_min_height to avoid changing the value of a
	customizable variable.  Rather explicitly check whether the
	height of the window that shall be splitted is at least as large
	as split_height_threshold.
	(Fwindow_full_width_p): New defun.
	(syms_of_window): Defsubr it.

	* window.h: Add EXFUN for Fwindow_full_width_p.

2007-07-14  Jason Rumney  <jasonr@gnu.org>

	* process.c [WINDOWSNT]: Don't undefine AF_INET6.

2007-07-14  Richard Stallman  <rms@gnu.org>

	* eval.c (maybe_call_debugger): New function.
	(find_handler_clause): Use maybe_call_debugger.
	Call it when the handler says `debug'.
	Eliminate DEBUGGER_VALUE_PTR.
	(Fsignal): Eliminate debugger_value.
	(Qdebug): New variable.
	(syms_of_eval): Initialize it.

2007-07-14  Juanma Barranquero  <lekktu@gmail.com>

	* eval.c (Fprogn):
	* keyboard.c (Ftrack_mouse):
	* print.c (Fwith_output_to_temp_buffer):
	* window.c (Fsave_window_excursion): Doc fix.

2007-07-13  Stefan Monnier  <monnier@iro.umontreal.ca>

	* eval.c (init_eval_once): Bump max_lisp_eval_depth to 400.

2007-07-12  Stefan Monnier  <monnier@iro.umontreal.ca>

	* process.h (struct Lisp_Process): Turn slots infd, outfd,
	kill_without_query, pty_flag, tick, update_tick, decoding_carryover,
	inherit_coding_system_flag, filter_multibyte, adaptive_read_buffering,
	read_output_delay, and read_output_skip from Lisp_Objects to ints.
	Remove unused encoding_carryover.
	* process.c: Adjust all functions accordingly.

2007-07-12  Richard Stallman  <rms@gnu.org>

	* term.c: Include unistd.h only if HAVE_UNISTD_H.

2007-07-11  Jason Rumney  <jasonr@gnu.org>

	* makefile.w32-in (LIBS): Include OLE32.

	* w32fns.c (w32_msg_pump) <WM_EMACS_CREATEWINDOW>: Initialize COM.
	(w32_msg_pump) <WM_DESTROY>: Uninitialize COM.

2007-07-11  Stefan Monnier  <monnier@iro.umontreal.ca>

	* lisp.h (struct Lisp_Hash_Table): Turn next_weak into a bare pointer.
	* fns.c (weak_hash_tables): Rename from Vweak_hash_tables and turned
	from a Lisp_Object into a bare pointer.
	(make_hash_table, copy_hash_table, sweep_weak_hash_tables, init_fns):
	Adjust the code correspondingly.

	* alloc.c (emacs_blocked_free): Remove unused var `bytes_used_now'.

	* term.c: Include unistd.h for ttyname, used in handle_one_term_event.
	(term_show_mouse_face): Remove unused var `j'.
	(handle_one_term_event): Remove unused vars `i' and `j'.
	Don't cast return value of ttyname since it's not necessary.

2007-07-10  Stefan Monnier  <monnier@iro.umontreal.ca>

	* alloc.c (mark_maybe_pointer): Enforce mult-of-8 alignment when using
	USE_LSB_TAG.  Suggested by Dmitry Antipov <dmantipov@yandex.ru>.

	* fns.c (map_char_table): Use an array of int for `indices' rather than
	an array of Lisp_Objects (which are only ever integers anyway).
	(Fmap_char_table): Update caller.
	* lisp.h: Update prototype.
	* keymap.c (Fset_keymap_parent, map_keymap, Fcopy_keymap):
	* fontset.c (Ffontset_info):
	* casetab.c (set_case_table): Update callers.

	* editfns.c (Ftranspose_regions): Use EMACS_INT for positions.

	* keymap.c (struct accessible_keymaps_data)
	(struct where_is_internal_data): New structures.
	(accessible_keymaps_1, where_is_internal_1): Use them to change
	interface to adhere to the one used by map_keymap.
	(Faccessible_keymaps, where_is_internal): Use map_keymap.
	(accessible_keymaps_char_table, where_is_internal_2): Remove.

	* keymap.h (map_keymap_function_t): More informative prototype.

2007-07-10  Guanpeng Xu  <herberteuler@hotmail.com>

	* search.c (Vinhibit_changing_match_data, search_regs_1): New vars.
	(looking_at_1): Don't change search_regs and last_thing_searched
	if `inhibit-changing-match-data' is non-nil.
	(string_match_1, search_buffer, set_search_regs): Likewise.
	(syms_of_search): Add Lisp level definition for
	`inhibit-changing-match-data' and set it to nil.
	(boyer_moore): If `inhibit-changing-match-data' is non-nil, compute
	start and end of the match, instead of using values in search_regs.

2007-07-01  Stefan Monnier  <monnier@iro.umontreal.ca>

	* minibuf.c (Fcompleting_read): New value `confirm-only'
	for `require-match'.

2007-06-28  Stefan Monnier  <monnier@iro.umontreal.ca>

	* fileio.c (Fdo_auto_save): Revert last patch installed unwillingly as
	part of the 2007-06-27 change to syms_of_fileio.

2007-06-28  YAMAMOTO Mitsuharu  <mituharu@math.s.chiba-u.ac.jp>

	* macterm.c [USE_MAC_TSM] (mac_handle_text_input_event):
	Check WINDOWP before using XWINDOW.  Consolidate return statements.

2007-06-27  Richard Stallman  <rms@gnu.org>

	* fileio.c (syms_of_fileio) <after-insert-file-functions>: Doc fix.

2007-06-27  Juanma Barranquero  <lekktu@gmail.com>

	* buffer.c (syms_of_buffer) <selective-display>: Fix typo in docstring.

2007-06-26  YAMAMOTO Mitsuharu  <mituharu@math.s.chiba-u.ac.jp>

	* gmalloc.c [HAVE_GTK_AND_PTHREAD]: Check this after including config.h.
	(_aligned_blocks_mutex) [USE_PTHREAD]: New variable.
	(LOCK_ALIGNED_BLOCKS, UNLOCK_ALIGNED_BLOCKS): New macros.
	(_free_internal, memalign): Use them.
	(_malloc_mutex, _aligned_blocks_mutex) [USE_PTHREAD]:
	Initialize to PTHREAD_MUTEX_INITIALIZER.
	(malloc_initialize_1) [USE_PTHREAD]: Don't use recursive mutex.
	(morecore_nolock): Rename from morecore.  All uses changed.
	Use only nolock versions of internal allocation functions.
	(_malloc_internal_nolock, _realloc_internal_nolock)
	(_free_internal_nolock): New functions created from
	_malloc_internal, _realloc_internal, and _free_internal.
	(_malloc_internal, _realloc_internal, _free_internal): Use them.
	Copy hook value to automatic variable before its use.
	(memalign): Copy hook value to automatic variable before its use.

2007-06-26  Kenichi Handa  <handa@m17n.org>

	* coding.c (Ffind_operation_coding_system): Docstring improved.
	(syms_of_coding): Docstring of `file-coding-system-alist' improved.

2007-06-25  David Kastrup  <dak@gnu.org>

	* keymap.c (Fcurrent_active_maps): Add `position' argument.
	(Fwhere_is_internal): Adjust call to `current-active-maps' to
	cater for additional parameter.

	* keymap.h: Adjust number of parameters to `current-active-maps'.

	* doc.c (Fsubstitute_command_keys): Adjust call of
	`current-active-maps'.

2007-06-25  David Kastrup  <dak@gnu.org>

	* callint.c (Fcall_interactively): Make the parsing of interactive
	specs somewhat more readable.

2007-06-23  YAMAMOTO Mitsuharu  <mituharu@math.s.chiba-u.ac.jp>

	* macterm.c (x_draw_fringe_bitmap) [MAC_OSX]: Extend fringe background
	to scroll bar gap also when bitmap fills fringe.  Draw only foreground
	if extended background has already been filled.

2007-06-22  YAMAMOTO Mitsuharu  <mituharu@math.s.chiba-u.ac.jp>

	* macgui.h (USE_CG_DRAWING): Don't require USE_ATSUI.
	(USE_MAC_TOOLBAR): Require USE_CG_DRAWING.

	* macmenu.c (mac_dialog_modal_filter, Fx_popup_dialog) [MAC_OSX]:
	Put special treatment for Fmessage_box, Fyes_or_no_p, and Fy_or_n_p
	in #if 0 as it is not compatible with y-or-n-p-with-timeout.
	(timer_check) [TARGET_API_MAC_CARBON]: Add extern.
	[TARGET_API_MAC_CARBON] (mac_handle_dialog_event): Use QuitEventLoop
	instead of QuitAppModalLoopForWindow.  Consolidate QuitEventLoop calls.
	(pop_down_dialog) [TARGET_API_MAC_CARBON]: New function.
	[TARGET_API_MAC_CARBON] (create_and_show_dialog): Use it for unwind.
	Run timers during dialog popup.
	(Fmenu_or_popup_active_p) [TARGET_API_MAC_CARBON]: Use popup_activated.

2007-06-21  Jason Rumney  <jasonr@gnu.org>

	* image.c (convert_mono_to_color_image): Swap fore and background.

2007-06-20  Jason Rumney  <jasonr@gnu.org>

	* w32bdf.c (w32_BDF_to_x_font): Unmap memory when finished.
	(w32_free_bdf_font): Unmap memory not handle.

2007-06-20  Sam Steingold  <sds@gnu.org>

	* gmalloc.c (__morecore): Fix the declaration to comply with the
	definition.

2007-06-20  Juanma Barranquero  <lekktu@gmail.com>

	* w32term.c (w32_delete_display): Remove leftover declaration.
	(w32_define_cursor, w32_initialize): Make static.

	* w32.c (_wsa_errlist): Fix typo in error message.
	(init_environment): Ignore any environment variable from the
	registry having a null value.

2007-06-20  Glenn Morris  <rgm@gnu.org>

	* Makefile.in (LIBGIF): Default to -lgif.

2007-06-17  Jason Rumney  <jasonr@gnu.org>

	* w32menu.c (add_menu_item): Don't use multibyte string functions on
	unicode strings.

2007-06-16  Juanma Barranquero  <lekktu@gmail.com>

	* xdisp.c (syms_of_xdisp) <auto-resize-tool-bars>:
	Fix typo in docstring.

2007-06-16  Eli Zaretskii  <eliz@gnu.org>

	* w32menu.c (add_menu_item): Escape `&' characters in menu items
	and their keybindings.

2007-06-15  Chong Yidong  <cyd@stupidchicken.com>

	* composite.c (update_compositions): Fix last fix.

2007-06-14  Jason Rumney  <jasonr@gnu.org>

	* w32.c (get_process_times_fn): New function pointer.
	(globals_of_w32): Intialize it if present in kernel32.dll.
	(w32_get_internal_run_time): New function.

	* editfns.c (Fget_internal_run_time) [WINDOWSNT]: Use it.

2007-06-14  Kenichi Handa  <handa@etlken.m17n.org>

	* composite.c (update_compositions): Check the validness of
	compositions.

2007-06-14  YAMAMOTO Mitsuharu  <mituharu@math.s.chiba-u.ac.jp>

	* frame.h (struct frame) [MAC_OS]: New member external_tool_bar.
	(FRAME_EXTERNAL_TOOL_BAR) [MAC_OS]: Use it.

	* macfns.c (mac_window) [USE_MAC_TOOLBAR]: Set toolbar_win_gravity.
	(x_set_tool_bar_lines) [USE_MAC_TOOLBAR]: Set FRAME_EXTERNAL_TOOL_BAR.

	* macgui.h (USE_MAC_TOOLBAR): New define.

	* macmenu.c [TARGET_API_MAC_CARBON] (menu_target_item_handler):
	Return immediately unless popup is activated.

	* macterm.c (x_draw_fringe_bitmap) [MAC_OSX]: Extend fringe
	background to scroll bar gap.
	(x_scroll_bar_create) [MAC_OSX]: Set bar->fringe_extended_p.
	(XTset_vertical_scroll_bar) [MAC_OSX]: Put leftmost/rightmost
	scroll bars on frame edge.  Check fringe background extension.
	Don't clear extended fringe background area.
	(TOOLBAR_IDENTIFIER, TOOLBAR_ICON_ITEM_IDENTIFIER)
	(TOOLBAR_ITEM_COMMAND_ID_OFFSET, TOOLBAR_ITEM_COMMAND_ID_P)
	(TOOLBAR_ITEM_COMMAND_ID_VALUE, TOOLBAR_ITEM_MAKE_COMMAND_ID):
	[USE_MAC_TOOLBAR]: New macros.
	(mac_move_window_with_gravity, mac_get_window_origin_with_gravity)
	(mac_handle_toolbar_event, mac_image_spec_to_cg_image)
	(mac_create_frame_tool_bar, update_frame_tool_bar, free_frame_tool_bar)
	(mac_tool_bar_note_mouse_movement, mac_handle_toolbar_command_event)
	[USE_MAC_TOOLBAR]: New functions.
	(mac_handle_window_event) [USE_MAC_TOOLBAR]: Reposition window
	manually if previous repositioning has failed.
	(mac_handle_keyboard_event): Use precomputed event kind.
	(XTread_socket) [USE_MAC_TOOLBAR]: Handle click in structure region
	as tool bar item click.  Handle mouse movement over tool bar items.

	* macterm.h (struct mac_output) [USE_MAC_TOOLBAR]: New member
	toolbar_win_gravity.
	(struct scroll_bar) [MAC_OSX]: New member fringe_extended_p.
	(update_frame_tool_bar, free_frame_tool_bar) [USE_MAC_TOOLBAR]:
	Add externs.

	* xdisp.c (update_tool_bar, redisplay_tool_bar, redisplay_window)
	[USE_MAC_TOOLBAR]: Sync with GTK+ tool bar display.

2007-06-14  Chong Yidong  <cyd@stupidchicken.com>

	* image.c (search_image_cache): Remove unused variable.

2007-06-13  Chong Yidong  <cyd@stupidchicken.com>

	* xfns.c, xmenu.c: Link to xaw3d if available.

2007-06-13  YAMAMOTO Mitsuharu  <mituharu@math.s.chiba-u.ac.jp>

	* dispextern.h (struct image) [HAVE_WINDOW_SYSTEM]: New members
	frame_foreground and frame_background.

	* image.c (lookup_image): Save frame foreground and background colors.
	(search_image_cache): Check if saved and current frame colors match.

2007-06-12  Stefan Monnier  <monnier@iro.umontreal.ca>

	* regex.c (regex_compile): Remove the `regnum' counter.
	Use bufp->re_nsub instead.  Add support for \(?N:RE\).

2007-06-11  Stefan Monnier  <monnier@iro.umontreal.ca>

	* term.c: Include intervals.h to declare Fget_text_property.

2007-06-10  Jason Rumney  <jasonr@gnu.org>

	* w32fns.c (Fx_file_dialog): Take size from struct not pointer.

2007-06-08  Juanma Barranquero  <lekktu@gmail.com>

	* callint.c (Fcall_interactively):
	* editfns.c (Fdelete_and_extract_region):
	* fileio.c (Fread_file_name):
	* fns.c (Fmapconcat):
	* keyboard.c (cmd_error_internal):
	* keymap.c (Fkey_description):
	* lread.c (openp):
	* minibuf.c (read_minibuf):
	* search.c (wordify):
	* sunfns.c (sel_read):
	* xdisp.c (Fformat_mode_line, syms_of_xdisp):
	* xfns.c (x_default_scroll_bar_color_parameter):
	* xmenu.c (menu_help_callback):
	* xselect.c (Fx_get_atom_name):
	* xterm.c (x_term_init): Use empty_unibyte_string.

2007-06-08  Dmitry Antipov  <dmantipov@yandex.ru>  (tiny change)

	* alloc.c (init_strings): Initialize canonical empty strings.
	(make_uninit_string, make_uninit_multibyte_string): Return appropriate
	canonical empty string when the requested size is 0.

	* emacs.c (empty_unibyte_string): Rename from empty_string.
	(empty_multibyte_string): New canonical empty string.
	(syms_of_emacs): Don't initialize empty_string.

	* lisp.h (STRING_SET_UNIBYTE): Return the canonical empty unibyte
	string, if appropriate.
	(empty_unibyte_string, empty_multibyte_string): New externs.
	(empty_string): Remove extern.

	* lread.c (syms_of_lread): Use empty_unibyte_string.

2007-06-07  Jason Rumney  <jasonr@gnu.org>

	* s/ms-w32.h: Don't define HAVE_TZNAME.

	* editfns.c (Fcurrent_time_zone): Remove hack for Japanese Windows.

2007-06-07  YAMAMOTO Mitsuharu  <mituharu@math.s.chiba-u.ac.jp>

	* mac.c (xrm_get_preference_database): Remove BLOCK_INPUT.

	* macfns.c (mac_get_window_bounds): Move extern to macterm.h.
	(compute_tip_xy) [TARGET_API_MAC_CARBON]: Use GetGlobalMouse.

	* macmenu.c [TARGET_API_MAC_CARBON] (menu_target_item_handler):
	Don't call next handler.
	[TARGET_API_MAC_CARBON] (install_menu_target_item_handler):
	Remove argument.  Install handler to application.
	(set_frame_menubar): Don't change deep_p.
	(mac_menu_show): Use FRAME_OUTER_TO_INNER_DIFF_X and
	FRAME_OUTER_TO_INNER_DIFF_Y.
	(DIALOG_BUTTON_COMMAND_ID_OFFSET, DIALOG_BUTTON_COMMAND_ID_P)
	(DIALOG_BUTTON_COMMAND_ID_VALUE, DIALOG_BUTTON_MAKE_COMMAND_ID)
	[HAVE_DIALOGS]: New macros.
	[HAVE_DIALOGS] (mac_handle_dialog_event, create_and_show_dialog):
	Use them.
	(fill_menubar) [TARGET_API_MAC_CARBON]: Use CFString.

	* macselect.c [MAC_OSX] (install_service_handler): Rename from
	init_service_handler.  All callers changed.  Return OSStatus value.

	* macterm.c (mac_begin_cg_clip): New arg F.  Call SetPortWindowPort.
	All callers changed so as not to call SetPortWindowPort.
	(mac_begin_cg_clip) [USE_CG_DRAWING]: Call mac_prepare_for_quickdraw.
	(mac_draw_image_string_atsui) [USE_ATSUI]: New function created from
	mac_draw_string_common.
	(mac_draw_image_string_qd): Likewise.
	(mac_draw_string_common): Use them.  Add INLINE.
	(XTmouse_position, x_scroll_bar_report_motion) [TARGET_API_MAC_CARBON]:
	Use FRAME_OUTER_TO_INNER_DIFF_X, FRAME_OUTER_TO_INNER_DIFF_Y, and
	GetGlobalMouse.
	(x_set_mouse_pixel_position) [MAC_OSX]: Use FRAME_OUTER_TO_INNER_DIFF_X
	and FRAME_OUTER_TO_INNER_DIFF_Y.
	[TARGET_API_MAC_CARBON] (mac_handle_mouse_event): Likewise.
	[USE_MAC_TSM] (mac_handle_text_input_event): Likewise.
	(x_make_frame_visible) [TARGET_API_MAC_CARBON]: Move code for
	repositioning window to mac_handle_window_event.
	(x_make_frame_invisible) [TARGET_API_MAC_CARBON]: Move code for
	saving window location to mac_handle_window_event
	[USE_MAC_FONT_PANEL] (mac_show_hide_font_panel): Install handler here.
	(install_menu_target_item_handler): Remove argument in extern.
	[TARGET_API_MAC_CARBON] (mac_event_to_emacs_modifiers):
	Also accept command events.
	(do_keystroke): New function created from XTread_socket.
	(init_command_handler): Remove functions.
	[TARGET_API_MAC_CARBON] (mac_handle_window_event): Reposition window
	and save window location by kEventWindowShowing and kEventWindowHiding
	handlers here.  Don't call next handler for window state change and
	focus events.
	(mac_handle_application_event, mac_handle_keyboard_event)
	[TARGET_API_MAC_CARBON]: New functions.
	(install_window_handler) [TARGET_API_MAC_CARBON]: Register handlers for
	kEventWindowShowing and kEventWindowHiding events.  Move installation
	of mouse, font, text input and menu target item handlers to
	install_application_handler.
	(install_application_handler) [TARGET_API_MAC_CARBON]: New function.
	(mac_handle_cg_display_reconfig) [MAC_OS_X_VERSION_MAX_ALLOWED >= 1030]:
	New function.
	(init_dm_notification_handler) [MAC_OS_X_VERSION_MAX_ALLOWED >= 1030]:
	Register it.
	(XTread_socket) [TARGET_API_MAC_CARBON]:
	Consolidate SendEventToEventTarget calls.
	Use FRAME_OUTER_TO_INNER_DIFF_X and FRAME_OUTER_TO_INNER_DIFF_Y.
	Move application activation handler to mac_handle_application_event.
	Move keyboard handler to mac_handle_keyboard_event.
	(XTread_socket) [!TARGET_API_MAC_CARBON]: Use do_keystroke.
	(mac_initialize) [TARGET_API_MAC_CARBON]: Don't call
	init_command_handler.  Call install_application_handler.

	* macterm.h (mac_get_window_bounds): Move extern from macfns.c.
	(FRAME_OUTER_TO_INNER_DIFF_X, FRAME_OUTER_TO_INNER_DIFF_Y): New macros.

2007-06-07  Glenn Morris  <rgm@gnu.org>

	* emacs.c (main): Use `emacs-copyright' in --version output.

2007-06-06  Chong Yidong  <cyd@stupidchicken.com>

	* image.c (xpm_load): Remove spurious call to xpm_init_color_cache.

2007-06-06  YAMAMOTO Mitsuharu  <mituharu@math.s.chiba-u.ac.jp>

	* macfns.c (mac_window): Replace WindowPtr with WindowRef.

	* macgui.h: Replace WindowPtr with WindowRef.

	* macmenu.c: Replace MenuHandle and GetMenuHandle with MenuRef and
	GetMenuRef, respectively.  Replace WindowPtr with WindowRef.
	Replace ControlHandle with ControlRef.
	(install_menu_quit_handler): Rename arg MENU_HANDLE to ROOT_MENU.

	* macterm.c: Replace MenuHandle and GetMenuHandle with MenuRef and
	GetMenuRef, respectively.  Replace WindowPtr with WindowRef.
	Replace ControlHandle with ControlRef.
	(USE_CARBON_EVENTS): Remove.  Use TARGET_API_MAC_CARBON instead.
	[MAC_OS8] (do_get_menus): Rename variable `menu_handle' to `menu'.

	* macterm.h (struct scroll_bar): Rename member control_handle_low
	and control_handle_high to control_ref_low and control_ref_high.
	All uses changed.
	(SCROLL_BAR_CONTROL_REF, SET_SCROLL_BAR_CONTROL_REF): Rename from
	SCROLL_BAR_CONTROL_HANDLE and SET_SCROLL_BAR_CONTROL_HANDLE,
	respectively.  All uses changed.
	(XCreatePixmap, XCreatePixmapFromBitmapData, XSetWindowBackground)
	(install_window_handler, remove_window_handler): Replace WindowPtr
	with WindowRef in externs.

2007-06-05  Juanma Barranquero  <lekktu@gmail.com>

	* xfaces.c (Finternal_lisp_face_p): Signal error for face alias loops.

2007-06-03  Nick Roberts  <nickrob@snap.net.nz>

	* keyboard.c (discard_mouse_events): Add GPM_CLICK_EVENT case.

	* frame.c (Fmouse_position, Fmouse_pixel_position):
	Condition on HAVE_GPM too.

	* term.c (term_mouse_highlight): Remove unused variables.
	(Fterm_open_connection): Set gpm_zerobased to 1.
	(term_mouse_movement, term_mouse_click, handle_one_term_event):
	Use zero based co-ordinates.
	(handle_one_term_event): Report a drag as mouse movement too.

	* Makefile.in (MOUSE_SUPPORT): Define for HAVE_GPM.

2007-06-03  Chong Yidong  <cyd@stupidchicken.com>

	* image.c (search_image_cache): New function.  Require background
	color match if background color is unspecified in the image spec.
	(uncache_image, lookup_image): Use it.

2007-06-01  Juanma Barranquero  <lekktu@gmail.com>

	* window.c (Fshrink_window): Reflow docstring.

2007-06-02  Chong Yidong  <cyd@stupidchicken.com>

	* Version 22.1 released.

2007-06-01  Richard Stallman  <rms@gnu.org>

	* xfns.c (x_encode_text): Add GCPRO.

2007-06-01  YAMAMOTO Mitsuharu  <mituharu@math.s.chiba-u.ac.jp>

	* xfns.c (x_set_name_internal): Save encoded name before
	x_encode_text in case string data is relocated.

2007-05-31  Richard Stallman  <rms@gnu.org>

	* buffer.c (syms_of_buffer): Doc fix.

2007-05-30  Nick Roberts  <nickrob@snap.net.nz>

	* sysdep.c (init_sys_modes): Add rather than replace with
	O_NONBLOCK.

	* frame.c [HAVE_GPM] (Fset_mouse_pixel_position): Add call to
	term_mouse_moveto.

	* termhooks.h (term_mouse_moveto): New extern.

	* term.c (mouse_face_window): Rename...
	(Qmouse_face_window): ...to this.
	(term_show_mouse_face, term_clear_mouse_face)
	(term_mouse_highlight): Use Qmouse_face_window.
	(term_mouse_moveto): New function.
	(term_mouse_position): Make it work.
	(syms_of_term): Uncomment assignment to mouse_position_hook.
	Staticpro Qmouse_face_window.

2007-05-28  YAMAMOTO Mitsuharu  <mituharu@math.s.chiba-u.ac.jp>

	* xdisp.c (redisplay_internal): Bind inhibit-point-motion-hooks to t
	around current_column call.

2007-05-26  Dan Nicolaescu  <dann@ics.uci.edu>

	* xfaces.c (syms_of_xfaces): Delete stray semicolon.
	* xdisp.c (next_element_from_buffer):
	* window.c (delete_window):
	* term.c (term_mouse_highlight):
	* msdos.c (getdefdir):
	* macterm.c (mac_create_bitmap_from_bitmap_data)
	(init_font_name_table):
	* fns.c (Fsxhash):
	* data.c (Fmake_local_variable):
	* ccl.c (ccl_driver): Likewise.

2007-05-24  YAMAMOTO Mitsuharu  <mituharu@math.s.chiba-u.ac.jp>

	* macterm.c [USE_CARBON_EVENTS] (mac_handle_window_event):
	Call mac_wakeup_from_rne on window size change.

2007-05-25  Chong Yidong  <cyd@stupidchicken.com>

	* image.c (uncache_image): Fix typo.

2007-05-23  Johannes Weiner  <hannes@saeurebad.de>  (tiny change)

	* keyboard.c (make_lispy_movement): Condition on HAVE_GPM too.

2007-05-22  Richard Stallman  <rms@gnu.org>

	* xterm.c (x_connection_closed): Remove NO_RETURN.

2007-05-22  Martin Rudalics  <rudalics@gmx.at>

	* syntax.c (scan_words): Fix arg to UPDATE_SYNTAX_TABLE_BACKWARD.

2007-05-21  Chong Yidong  <cyd@stupidchicken.com>

	* image.c (uncache_image): New function.
	(Fimage_refresh): New function.

2007-05-20  Jan Dj,Ad(Brv  <jan.h.d@swipnet.se>

	* Makefile.in: Move GPM check outside HAVE_X_WINDOWS.

2007-05-20  Nick Roberts  <nickrob@snap.net.nz>

	* config.in, keyboard.c, Makefile.in, sysdep.c, term.c,
	* termhooks.h: Use HAVE_GPM instead of HAVE_GPM_H.

2007-05-20  Nick Roberts  <nickrob@snap.net.nz>

	* keyboard.c (make_lispy_event): Make case GPM_CLICK_EVENT
	conditional on [HAVE_GPM_H].

2007-05-19  Stefan Monnier  <monnier@iro.umontreal.ca>

	* syntax.c (skip_chars): Update syntax-table only after we checked that
	the new location is valid.

2007-05-19  YAMAMOTO Mitsuharu  <mituharu@math.s.chiba-u.ac.jp>

	* macterm.c (x_calc_absolute_position): Add BLOCK_INPUT around
	mac_get_window_bounds.

2007-05-20  Nick Roberts  <nickrob@snap.net.nz>

	* Makefile.in (LIBGPM): Allow it to be set from configure.
	If set then link Emacs with it.

	* config.in: Regenerate.

	* lisp.h (add_gpm_wait_descriptor, delete_gpm_wait_descriptor):
	New externs.

	* termhooks.h [HAVE_GPM_H] (enum event_kind): Add GPM_CLICK_EVENT.
	Include gpm.h.
	(handle_one_term_event, term_gpm): New externs.

	* sysdep.c [HAVE_GPM_H] (init_sys_modes): Make gpm_fd nonblocking
	and allow it to be interrupted by SIGIO.

	* process.c (gpm_wait_mask, max_gpm_desc): New variables.
	(wait_reading_process_output): Wait on gpm_fd too.
	(add_gpm_wait_descriptor, delete_gpm_wait_descriptor)): New functions.
	(add_gpm_wait_descriptor_called_flag): New variable.
	(delete_keyboard_wait_descriptor): Check gpm_wait_mask.

	* keyboard.c [HAVE_GPM_H] (Qmouse_fixup_help_message)
	(make_lispy_movement, tracking_off, Ftrack_mouse, some_mouse_moved)
	(show_help_echo, readable_events, kbd_buffer_get_event, init_keyboard):
	Extend HAVE_MOUSE ifdefs to HAVE_GPM_H.
	(make_lispy_event): Add case GPM_CLICK_EVENT.
	(read_avail_input): Handle mouse input.

	* term.c (write_glyphs_with_face): New function.
	[HAVE_GPM_H]: Include buffer.h, sys/fcntl.h.
	(mouse_face_beg_row, mouse_face_beg_col, mouse_face_end_row)
	(mouse_face_end_col, mouse_face_past_end, mouse_face_window)
	(mouse_face_face_id, term_gpm, pos_x, pos_y)
	(last_mouse_x, last_mouse_y): New variables.
	(term_show_mouse_face, term_clear_mouse_face, fast_find_position)
	(term_mouse_highlight, term_mouse_movement, term_mouse_position)
	(term_mouse_click, handle_one_term_event, Fterm_open_connection)
	(Fterm_close_connection): New functions.
	(term_init): Initialise mouse_face_window.

2007-05-19  Chong Yidong  <cyd@stupidchicken.com>

	* xdisp.c (redisplay_window): If first window line is a
	continuation line, recompute the new window start instead of
	recentering.

2007-05-18  Glenn Morris  <rgm@gnu.org>

	* m/alpha.h (ORDINARY_LINK): No longer define on OpenBSD.
	Suggested by Alfred M. Szmidt <ams@gnu.org>.

2007-05-17  Glenn Morris  <rgm@gnu.org>

	* m/macppc.h (ORDINARY_LINK): No longer define on OpenBSD.

2007-05-16  YAMAMOTO Mitsuharu  <mituharu@math.s.chiba-u.ac.jp>

	* macterm.c [USE_CARBON_EVENTS] (mac_convert_event_ref): Also convert
	dead key repeat and up events.

2007-05-14  Chong Yidong  <cyd@stupidchicken.com>

	* image.c (pbm_load): Check image size for monochrome pbm.

2007-05-13  Chong Yidong  <cyd@stupidchicken.com>

	* xterm.c (XTread_socket): Revert last change.

2007-05-12  Chong Yidong  <cyd@stupidchicken.com>

	* image.c (pbm_load): Correctly check image size for greyscale pbm.

	* xterm.c (XTread_socket): Yet Another Uncaught X Error Crash (YAUXEC).

2007-05-07  Stefan Monnier  <monnier@iro.umontreal.ca>

	* editfns.c (Ftranspose_regions): Yet another int/Lisp_Object
	mixup (YAILOM).

2007-05-07  Andreas Schwab  <schwab@suse.de>

	* keymap.c (Flookup_key): Fix typo in last change.

2007-05-07  Stefan Monnier  <monnier@iro.umontreal.ca>

	* keymap.c (Fdefine_key, Flookup_key): Only do the 0x80->meta_modifier
	mapping for unibyte strings.

2007-05-01  YAMAMOTO Mitsuharu  <mituharu@math.s.chiba-u.ac.jp>

	* macmenu.c (mac_dialog_show): Apply 2007-04-27 change for xmenu.c.
	(Fx_popup_dialog) [MAC_OSX]: Likewise.

2007-04-29  Richard Stallman  <rms@gnu.org>

	* insdel.c (replace_range): For undo, record insertion first.

2007-04-29  Andreas Schwab  <schwab@suse.de>

	* lisp.h (VECSIZE): Use OFFSETOF.

2007-04-29  YAMAMOTO Mitsuharu  <mituharu@math.s.chiba-u.ac.jp>

	* xdisp.c (try_window_reusing_current_matrix): Fix number of
	disabled lines.

2007-04-28  Richard Stallman  <rms@gnu.org>

	* lread.c (read_escape): In a string, \s is always space.

2007-04-27  Jan Dj,Ad(Brv  <jan.h.d@swipnet.se>

	* xmenu.c (xdialog_show): Call Fredisplay before showing the dialog.

	* gtkutil.c (xg_update_menubar, create_menus): Create empty
	submenu for menu bar items.

See ChangeLog.10 for earlier changes.

;; Local Variables:
;; coding: iso-2022-7bit
;; add-log-time-zone-rule: t
;; End:

    Copyright (C) 2007, 2008  Free Software Foundation, Inc.

  This file is part of GNU Emacs.

  GNU Emacs is free software; you can redistribute it and/or modify
  it under the terms of the GNU General Public License as published by
  the Free Software Foundation; either version 3, or (at your option)
  any later version.

  GNU Emacs is distributed in the hope that it will be useful,
  but WITHOUT ANY WARRANTY; without even the implied warranty of
  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  GNU General Public License for more details.

  You should have received a copy of the GNU General Public License
  along with GNU Emacs; see the file COPYING.  If not, write to the
  Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
  Boston, MA 02110-1301, USA.

;; arch-tag: dfb6ad96-1550-4905-9e53-d2059ee84c40
