emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] /srv/bzr/emacs/trunk r103913: Improve C-level modularity b


From: Paul Eggert
Subject: [Emacs-diffs] /srv/bzr/emacs/trunk r103913: Improve C-level modularity by making more things 'static'.
Date: Thu, 14 Apr 2011 16:19:38 -0700
User-agent: Bazaar (2.3.1)

------------------------------------------------------------
revno: 103913 [merge]
committer: Paul Eggert <address@hidden>
branch nick: trunk
timestamp: Thu 2011-04-14 16:19:38 -0700
message:
  Improve C-level modularity by making more things 'static'.
modified:
  src/ChangeLog
  src/alloc.c
  src/atimer.c
  src/atimer.h
  src/bidi.c
  src/buffer.c
  src/buffer.h
  src/bytecode.c
  src/callint.c
  src/callproc.c
  src/casetab.c
  src/category.c
  src/category.h
  src/ccl.c
  src/ccl.h
  src/character.c
  src/character.h
  src/charset.c
  src/charset.h
  src/chartab.c
  src/cmds.c
  src/coding.c
  src/coding.h
  src/commands.h
  src/composite.c
  src/composite.h
  src/data.c
  src/dbusbind.c
  src/dired.c
  src/dispextern.h
  src/dispnew.c
  src/doc.c
  src/editfns.c
  src/emacs.c
  src/eval.c
  src/fileio.c
  src/fns.c
  src/font.c
  src/font.h
  src/fontset.c
  src/fontset.h
  src/frame.c
  src/frame.h
  src/fringe.c
  src/ftfont.c
  src/ftxfont.c
  src/image.c
  src/indent.c
  src/insdel.c
  src/intervals.c
  src/intervals.h
  src/keyboard.c
  src/keyboard.h
  src/keymap.c
  src/keymap.h
  src/lisp.h
  src/lread.c
  src/macros.c
  src/marker.c
  src/minibuf.c
  src/print.c
  src/process.c
  src/process.h
  src/region-cache.c
  src/region-cache.h
  src/scroll.c
  src/search.c
  src/sound.c
  src/syntax.c
  src/syntax.h
  src/sysdep.c
  src/syssignal.h
  src/systty.h
  src/term.c
  src/termhooks.h
  src/textprop.c
  src/undo.c
  src/window.c
  src/window.h
  src/xdisp.c
  src/xfaces.c
  src/xfns.c
  src/xfont.c
  src/xmenu.c
  src/xrdb.c
  src/xselect.c
  src/xsettings.c
  src/xsettings.h
  src/xterm.c
  src/xterm.h
=== modified file 'src/ChangeLog'
--- a/src/ChangeLog     2011-04-14 07:56:52 +0000
+++ b/src/ChangeLog     2011-04-14 20:16:48 +0000
@@ -1,3 +1,419 @@
+2011-04-14  Paul Eggert  <address@hidden>
+
+       Improve C-level modularity by making more things 'static'.
+
+       Don't publish debugger-only interfaces to other modules.
+       * lisp.h (safe_debug_print, debug_output_compilation_hack):
+       (verify_bytepos, count_markers): Move decls to the only modules
+       that need them.
+       * region-cache.h (pp_cache): Likewise.
+       * window.h (check_all_windows): Likewise.
+       * marker.c, print.c, region-cache.c, window.c: Decls moved here.
+
+       * sysdep.c (croak): Now static, if
+       defined TIOCNOTTY || defined USG5 || defined CYGWIN.
+       * syssignal.h (croak): Declare only if not static.
+
+       * alloc.c (refill_memory_reserve): Now static if
+       !defined REL_ALLOC || defined SYSTEM_MALLOC.
+       * lisp.h (refill_memory_reserve): Declare only if not static.
+
+       * xsettings.c, xsettings.h (xsettings_get_system_normal_font):
+       Define only if USE_LUCID.
+
+       * xrdb.c (x_customization_string, x_rm_string): Now static.
+
+       * xmenu.c (x_menu_wait_for_event): Export only if USE_MOTIF.
+       * xterm.h (x_menu_wait_for_event): Declare only if USE_MOTIF.
+
+       * xdisp.c (draw_row_with_mouse_face): Now static.
+       * dispextern.h (draw_row_with_mouse_fave): Remove decl.
+
+       * window.h (check_all_windows): Mark externally visible.
+
+       * window.c (window_deletion_count): Now static.
+
+       * undo.c: Make symbols static if they're not exported.
+       (last_undo_buffer, last_boundary_position, pending_boundary):
+       Now static.
+
+       * textprop.c (interval_insert_behind_hooks): Now static.
+       (interval_insert_in_front_hooks): Likewise.
+
+       * term.c: Make symbols static if they're not exported.
+       (tty_turn_off_highlight, get_tty_terminal, max_frame_cols):
+       (max_frame_lines, tty_set_terminal_modes):
+       (tty_reset_terminal_modes, tty_turn_off_highlight):
+       (get_tty_terminal): Now static.
+       (term_mouse_moveto): Do not define if HAVE_WINDOW_SYSTEM.
+       * termhooks.h (term_mouse_moveto): Do not declare if
+       HAVE_WINDOW_SYSTEM.
+       * dispextern.h (tty_set_terminal_modes, tty_reset_terminal_modes):
+       (tty_turn_off_highlight, get_tty_terminal): Remove decls.
+
+       * sysdep.c: Make symbols static if they're not exported.
+       (emacs_get_tty, emacs_set_tty, old_fcntl_flags, old_fcntl_owner):
+       Now static.
+       (sigprocmask_set, full_mask): Remove; unused.
+       (wait_debugging): Mark as visible.
+       * syssignal.h (SIGFULLMASK, full_mask): Remove decls.
+       * systty.h (emacs_get_tty, emacs_set_tty): Remove decls.
+
+       * syntax.c (syntax_temp): Define only if !__GNUC__.
+
+       * sound.c (current_sound_device, current_sound): Now static.
+
+       * search.c (searchbufs, searchbuf_head): Now static.
+
+       * scroll.c (scroll_cost): Remove; unused.
+       * dispextern.h (scroll_cost): Remove decl.
+
+       * region-cache.h (pp_cache): Mark as externally visible.
+
+       * process.c: Make symbols static if they're not exported.
+       (process_tick, update_tick, create_process, chan_process):
+       (Vprocess_alist, proc_buffered_char, datagram_access):
+       (fd_callback_data, send_process_frame, process_sent_to): Now static.
+       (deactivate_process): Mark defn as static, as well as decl.
+       * lisp.h (create_process): Remove decl.
+       * process.h (chan_process, Vprocess_alist): Remove decls.
+
+       * print.c: Make symbols static if they're not exported.
+       (print_depth, new_backquote_output, being_printed, print_buffer):
+       (print_buffer_size, print_buffer_pos, print_buffer_pos_byte):
+       (print_interval, print_number_index, initial_stderr_stream):
+       Now static.
+       * lisp.h (Fprinc): Remove decl.
+       (debug_output_compilation_hack): Mark as externally visible.
+
+       * sysdep.c (croak): Move decl from here to syssignal.h.
+       * syssignal.h (croak): Put it here, so the API can be checked when
+       'croak' is called from dissociate_if_controlling_tty.
+
+       * minibuf.c: Make symbols static if they're not exported.
+       (minibuf_save_list, choose_minibuf_frame): Now static.
+       * lisp.h (choose_minibuf_frame): Remove decl.
+
+       * lisp.h (verify_bytepos, count_markers): Mark as externally visible.
+
+       * lread.c: Make symbols static if they're not exported.
+       (read_objects, initial_obarray, oblookup_last_bucket_number):
+       Now static.
+       (make_symbol): Remove; unused.
+       * lisp.h (initial_obarray, make_symbol): Remove decls.
+
+       * keyboard.c: Make symbols static if they're not exported.
+       (single_kboard, recent_keys_index, total_keys, recent_keys):
+       (this_command_key_count_reset, raw_keybuf, raw_keybuf_count):
+       (this_single_command_key_start, echoing, last_auto_save):
+       (read_key_sequence_cmd, dribble, recursive_edit_unwind):
+       (command_loop, echo_now, keyboard_init_hook, help_char_p):
+       (quit_throw_to_read_char, command_loop_2, top_level_1, poll_timer):
+       (Vlispy_mouse_stem, double_click_count):
+       Now static.
+       (force_auto_save_soon): Define only if SIGDANGER.
+       (ignore_mouse_drag_p): Now static if
+       !defined HAVE_WINDOW_SYSTEM || defined USE_GTK || defined HAVE_NS.
+       (print_help): Remove; unused.
+       (stop_character, last_timer_event): Mark as externally visible.
+       * keyboard.h (ignore_mouse_drag_p): Declare only if
+       defined HAVE_WINDOW_SYSTEM && !defined USE_GTK && !defined HAVE_NS.
+       (echo_now, help_char_p, quit_throw_to_read_char): Remove decls.
+       * lisp.h (echoing): Remove decl.
+       (force_auto_save_soon): Declare only if SIGDANGER.
+       * xdisp.c (redisplay_window): Simplify code, to make it more
+       obvious that ignore_mouse_drag_p is not accessed if !defined
+       USE_GTK && !defined HAVE_NS.
+
+       * intervals.c: Make symbols static if they're not exported.
+       (merge_properties_sticky, merge_interval_right, delete_interval):
+       Now static.
+       * intervals.h (merge_interval_right, delete_interval): Remove decls.
+
+       * insdel.c: Make symbols static if they're not exported.
+       However, leave prepare_to_modify_buffer alone.  It's never
+       called from outside this function, but that appears to be a bug.
+       (combine_after_change_list, combine_after_change_buffer):
+       (adjust_after_replace, signal_before_change): Now static.
+       (adjust_after_replace_noundo): Remove; unused.
+       * lisp.h (adjust_after_replace, adjust_after_replace_noundo):
+       (signal_before_change): Remove decls.
+
+       * indent.c (val_compute_motion, val_vmotion): Now static.
+
+       * image.c: Make symbols static if they're not exported.
+       * dispextern.h (x_create_bitmap_from_xpm_data): Do not declare
+       if USE_GTK.
+       * image.c (x_create_bitmap_from_xpm_data): Do not define if USE_GTK.
+       (xpm_color_cache, ct_table, ct_colors_allocated): Now static.
+
+       * fringe.c (standard_bitmaps): Now static.
+       (max_used_fringe_bitmap): Now static, unless HAVE_NS.
+
+       * frame.c: Make symbols static if they're not exported.
+       (x_report_frame_params, make_terminal_frame): Now static.
+       (get_frame_param): Now static, unless HAVE_NS.
+       (x_fullscreen_adjust): Define if WINDOWSNT, not if HAVE_WINDOW_SYSTEM.
+       (x_get_resource_string): Remove; not used.
+       * frame.h (make_terminal_frame, x_report_frame_params):
+       (x_get_resource_string); Remove decls.
+       (x_fullscreen_adjust): Declare only if WINDOWSNT.
+       * lisp.h (get_frame_param): Declare only if HAVE_NS.
+
+       * font.c, fontset.c: Make symbols static if they're not exported.
+       * dispextern.h (FACE_SUITABLE_FOR_ASCII_CHAR_P): New macro.
+       (FACE_SUITABLE_FOR_CHAR_P): Use it.
+       * font.c (font_close_object): Now static.
+       * font.h (font_close_object): Remove.
+       * fontset.c (FONTSET_OBJLIST): Remove.
+       (free_realized_fontset) #if-0 the body, which does nothing.
+       (face_suitable_for_char_p): #if-0, as it's never called.
+       * fontset.h (face_suitable_for_char_p): Remove decl.
+       * xfaces.c (face_at_string_position): Use
+       FACE_SUITABLE_FOR_ASCII_CHAR_P, not FACE_SUITABLE_FOR_CHAR_P,
+       since 0 is always ASCII.
+
+       * fns.c (weak_hash_tables): Now static.
+
+       * fileio.c: Make symbols static if they're not exported.
+       (auto_saving, auto_save_mode_bits, auto_save_error_occurred):
+       (Vwrite_region_annotation_buffers): Now static.
+
+       * eval.c: Make symbols static if they're not exported.
+       (backtrace_list, lisp_eval_depth, when_entered_debugger): Now static.
+       * lisp.h (backtrace_list): Remove decl.
+
+       * emacs.c: Make symbols static if they're not exported.
+       (malloc_state_ptr, malloc_using_checking, syms_of_emacs):
+       (fatal_error_code, fatal_error_signal_hook, standard_args):
+       Now static.
+       (fatal_error_signal): Now static, unless FLOAT_CATCH_SIGKILL.
+       (DEFINE_DUMMY_FUNCTION): Mark function as externally visible.
+       (__CTOR_LIST__, __DTOR_LIST__): Now externally visible.
+       * lisp.h (fatal_error_signal_hook): Remove decl.
+       (fatal_error_signal): Declare only if FLOAT_CATCH_SIGKILL.
+
+       * editfns.c: Move a (normally-unused) function to its only use.
+       * editfns.c, lisp.h (get_operating_system_release): Remove.
+       * process.c (init_process) [DARWIN_OS]: Do it inline, as it is not
+       worth the hassle of breaking this out.
+
+       * xterm.c: Make symbols static if they're not exported.
+       (x_raise_frame, x_lower_frame, x_wm_set_window_state):
+       (x_wm_set_icon_pixmap, x_initialize, XTread_socket_fake_io_error):
+       (x_destroy_window, x_delete_display):
+       Now static.
+       (x_dispatch_event): Now static if ! (USE_MOTIF || USE_X_TOOLKIT).
+       (x_mouse_leave): Remove; unused.
+       * xterm.h (x_display_info_for_name, x_raise_frame, x_lower_frame):
+       (x_destroy_window, x_wm_set_window_state, x_wm_set_icon_pixmap):
+       (x_delete_display, x_initialize, x_set_border_pixel, x_screen_planes):
+       Remove decls.
+       (x_mouse_leave): Declare only if WINDOWSNT.
+       (x_dispatch_event): Declare only if USE_MOTIF or USE_X_TOOLKIT.
+       (xic_create_fontsetname): Declare only if HAVE_X_WINDOWS &&
+       USE_X_TOOLKIT.
+
+       * ftxfont.c: Make symbols static if they're not exported.
+       (ftxfont_driver): Export only if !defined HAVE_XFT && def8ined
+       HAVE_FREETYPE.
+       * font.h (ftxfont_driver): Likewise.
+
+       * xfns.c: Make symbols static if they're not exported.
+       (x_last_font_name, x_display_info_for_name):
+       (x_set_foreground_color, x_set_background_color, x_set_mouse_color):
+       (x_set_cursor_color, x_set_border_pixel, x_set_border_color):
+       (x_set_cursor_type, x_set_icon_type, x_set_icon_name):
+       (x_set_scroll_bar_foreground, x_set_scroll_bar_background):
+       (x_explicitly_set_name, x_set_title, xic_defaut_fontset, tip_timer):
+       (last_show_tip_args): Now static.
+       (xic_defaut_fontset, xic_create_fontsetname): Define only if
+       defined HAVE_X_WINDOWS && defined USE_X_TOOLKIT
+       (x_screen_planes): Remove; unused.
+       * dispextern.h (x_screen_planes): Remove decl.
+
+       * dispnew.c: Make symbols static if they're not exported.
+       * dispextern.h (redraw_garbaged_frames, scrolling):
+       (increment_row_positions): Remove.
+       * dispnew.c (new_glyph_matrix, increment_row_positions, scrolling):
+       (delayed_size_change, glyph_matrix_count, glyph_pool_count):
+       Now static.
+       (redraw_garbaged_frames): Remove; unused.
+
+       * xfaces.c: Make symbols static if they're not exported.
+       * dispextern.h (ascii_face_of_lisp_face, free_realized_face):
+       Remove decls.
+       * xterm.h (defined_color): Remove decls.
+       (x_free_dpy_colors): Declare only if USE_X_TOOLKIT.
+       * xfaces.c (tty_suppress_bold_inverse_default_colors_p):
+       (menu_face_changed_default, defined_color, free_realized_face):
+       (x_free_dpy_colors): Define only if USE_X_TOOLKIT.
+       (ascii_face_of_lisp_face): Remove; unused.
+
+       * xdisp.c: Make symbols static if they're not exported.
+       * dispextern.h (scratch_glyph_row, window_box_edges):
+       (glyph_to_pixel_coords, set_cursor_from_row):
+       (get_next_display_element, set_iterator_to_next):
+       (highlight_trailing_whitespace, frame_to_window_pixel_xy):
+       (show_mouse_face): Remove decls
+       * frame.h (message_buf_print): Likewise.
+       * lisp.h (pop_message, set_message, check_point_in_composition):
+       Likewise.
+       * xterm.h (set_vertical_scroll_bar): Likewise.
+       * xdisp.c (list_of_error, Vmessage_stack, line_number_displayed):
+       (message_buf_print, scratch_glyph_row, displayed_buffer):
+       (set_iterator_to_next, pop_message, set_message, set_cursor_from_row):
+       (get_next_display_element, show_mouse_face, window_box_edges):
+       (frame_to_window_pixel_xy, check_point_in_composition):
+       (set_vertical_scroll_bar, highlight_trailing_whitespace): Now static.
+       (glyph_to_pixel_coords): Remove; unused.
+
+       * dired.c (file_name_completion): Now static.
+
+       * dbusbind.c (xd_in_read_queued_messages): Now static.
+
+       * lisp.h (circular_list_error, FOREACH): Remove; unused.
+       * data.c (circular_list_error): Remove.
+
+       * commands.h (last_point_position, last_point_position_buffer):
+       (last_point_position_window): Remove decls.
+       * keyboard.c: Make these variables static.
+
+       * coding.h (coding, code_convert_region, encode_coding_gap): Remove
+       decls.
+       * coding.c (Vsjis_coding_system, Vbig5_coding_system):
+       (iso_code_class, detect_coding, code_convert_region): Now static.
+       (encode_coding_gap): Remove; unused.
+
+       * chartab.c (chartab_chars, chartab_bits): Now static.
+
+       * charset.h (charset_iso_8859_1): Remove decl.
+       * charset.c (charset_iso_8859_1, charset_emacs, map_charset_for_dump):
+       Now static.
+
+       * ccl.h (check_ccl_update, Vccl_program_table): Remove decls.
+       * ccl.c (Vccl_program_table): Now static.
+       (check_ccl_update): Remove; unused.
+
+       * category.c (SET_CATEGORY_SET, set_category_set): Move here.
+       * category.h: ... from here.
+       * category.c (check_category_table, set_category_set): Now static.
+
+       * casetab.c (Vascii_upcase_table, Vascii_eqv_table): Now static.
+       * lisp.h: Remove these decls.
+
+       * buffer.c (buffer_count): Remove unused var.
+
+       * bidi.c (bidi_dump_cached_states): Mark as externally visible,
+       so that it's not optimized away.
+       (bidi_ignore_explicit_marks_for_paragraph_level): Likewise.
+       * dispextern.h (bidi_dump_cached_states): Remove, since it's
+       exported only to the debugger.
+
+       * atimer.c (alarm_signal_handler, run_all_atimers): Now static.
+       * atimer.h (run_all_atimers): Removed; not exported.
+
+       font.c: Make copy_font_spec and merge_font_spec ordinary C functions.
+       * font.c (copy_font_spec): Rename from Fcopy_font_spec, since it
+       was inaccessible from Lisp.
+       (merge_font_spec): Likewise, renaming from Fmerge_font_spec.
+       * font.c, font.h, fontset.c, xfaces.c, xfont.c: Change all uses.
+
+       alloc.c: Import and export fewer symbols, and remove unused items.
+       * lisp.h (suppress_checking, die): Declare only if ENABLE_CHECKING
+       is defined.
+       (suppress_checking): Add EXTERNALLY_VISIBLE attribute, so that
+       it's not optimized away by whole-program optimization.
+       (message_enable_multibyte, free_misc): Remove.
+       (catchlist, handlerlist, mark_backtrace):
+       Declare only if BYTE_MARK_STACK.
+       (mark_byte_stack): Likewise, fixing a ifdef-vs-if typo.
+       * alloc.c (pure): Export only if VIRT_ADDR_VARIES is defined.
+       (message_enable_multibyte): Remove decl.
+       (free_misc, interval_free_list, float_block, float_block_index):
+       (n_float_blocks, float_free_list, cons_block, cons_block_index):
+       (cons_free_list, last_marked_index):
+       Now static.
+       (suppress_checking, die): Define only if ENABLE_CHECKING is defined.
+       * eval.c (catchlist, handlerlist): Export only if BYTE_MARK_STACK.
+       (mark_backtrace): Define only if BYTE_MARK_STACK.
+       * xdisp.c (message_enable_multibyte): Now static.
+
+       Declare Lisp_Object Q* variables to be 'static' if not exproted.
+       This makes it easier for human readers (and static analyzers)
+       to see whether these variables are used from other modules.
+       * alloc.c, buffer.c, bytecode.c, callint.c, casetab.c, category.c:
+       * ccl.c, character.c, charset.c, cmds.c, coding.c, composite.c:
+       * data.c, dbusbind.c, dired.c, editfns.c, eval.c, fileio.c, fns.c:
+       * font.c, frame.c, fringe.c, ftfont.c, image.c, keyboard.c, keymap.c:
+       * lread.c, macros.c, minibuf.c, print.c, process.c, search.c:
+       * sound.c, syntax.c, textprop.c, window.c, xdisp.c, xfaces.c, xfns.c:
+       * xmenu.c, xselect.c:
+       Declare Q* vars static if they are not used in other modules.
+       * ccl.h, character.h, charset.h, coding.h, composite.h, font.h:
+       * frame.h, intervals.h, keyboard.h, lisp.h, process.h, syntax.h:
+       Remove decls of unexported vars.
+       * keyboard.h (EVENT_HEAD_UNMODIFIED): Remove now-unused macro.
+
+       * lisp.h (DEFINE_FUNC): Make sname 'static'.
+
+       Make Emacs functions such as Fatom 'static' by default.
+       This makes it easier for human readers (and static analyzers)
+       to see whether these functions can be called from other modules.
+       DEFUN now defines a static function.  To make the function external
+       so that it can be used in other C modules, use the new macro DEFUE.
+       * lisp.h (Funibyte_char_to_multibyte, Fsyntax_table_p):
+       (Finit_image_library):
+       (Feval_region, Fbacktrace, Ffetch_bytecode, Fswitch_to_buffer):
+       (Ffile_executable_p, Fmake_symbolic_link, Fcommand_execute):
+       (Fget_process, Fdocumentation_property, Fbyte_code, Ffile_attributes):
+       Remove decls, since these functions are now static.
+       (Funintern, Fget_internal_run_time): New decls, since these functions
+       were already external.
+
+       * alloc.c, buffer.c, callint.c, callproc.c, casefiddle.c, casetab.c:
+       * ccl.c, character.c, chartab.c, cmds.c, coding.c, data.c, dispnew.c:
+       * doc.c, editfns.c, emacs.c, eval.c, fileio.c, filelock.c, floatfns.c:
+       * fns.c, font.c, fontset.c, frame.c, image.c, indent.c:
+       * keyboard.c, keymap.c, lread.c:
+       * macros.c, marker.c, menu.c, minibuf.c, print.c, process.c, search.c:
+       * syntax.c, term.c, terminal.c, textprop.c, undo.c:
+       * window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xsettings.c:
+       Mark functions with DEFUE instead of DEFUN,
+       if they are used in other modules.
+       * buffer.c (Fset_buffer_major_mode, Fdelete_overlay): New forward
+       decls for now-static functions.
+       * buffer.h (Fdelete_overlay): Remove decl.
+       * callproc.c (Fgetenv_internal): Mark as internal.
+       * composite.c (Fremove_list_of_text_properties): Remove decl.
+       (Fcomposition_get_gstring): New forward static decl.
+       * composite.h (Fcomposite_get_gstring): Remove decl.
+       * dired.c (Ffile_attributes): New forward static decl.
+       * doc.c (Fdocumntation_property): New forward static decl.
+       * eval.c (Ffetch_bytecode): New forward static decl.
+       (Funintern): Remove extern decl; now in .h file where it belongs.
+       * fileio.c (Fmake_symbolic_link): New forward static decl.
+       * image.c (Finit_image_library): New forward static decl.
+       * insdel.c (Fcombine_after_change_execute): Make forward decl static.
+       * intervals.h (Fprevious_property_change):
+       (Fremove_list_of_text_properties): Remove decls.
+       * keyboard.c (Fthis_command_keys): Remove decl.
+       (Fcommand_execute): New forward static decl.
+       * keymap.c (Flookup_key): New forward static decl.
+       (Fcopy_keymap): Now static.
+       * keymap.h (Flookup_key): Remove decl.
+       * process.c (Fget_process): New forward static decl.
+       (Fprocess_datagram_address): Mark as internal.
+       * syntax.c (Fsyntax_table_p): New forward static decl.
+       (skip_chars): Remove duplicate decl.
+       * textprop.c (Fprevious_property_change): New forward static decl.
+       * window.c (Fset_window_fringes, Fset_window_scroll_bars):
+       Now internal.
+       (Fset_window_margins, Fset_window_vscroll): New forward static decls.
+       * window.h (Fset_window_vscroll, Fset_window_margins): Remove decls.
+
+       * editfns.c (Fformat): Remove unreachable code.
+
 2011-04-14  Andreas Schwab  <address@hidden>
 
        * fileio.c (Finsert_file_contents): Fix typo in 2005-05-13

=== modified file 'src/alloc.c'
--- a/src/alloc.c       2011-04-12 10:20:32 +0000
+++ b/src/alloc.c       2011-04-14 20:16:48 +0000
@@ -212,6 +212,9 @@
    remapping on more recent systems because this is less important
    nowadays than in the days of small memories and timesharing.  */
 
+#ifndef VIRT_ADDR_VARIES
+static
+#endif
 EMACS_INT pure[(PURESIZE + sizeof (EMACS_INT) - 1) / sizeof (EMACS_INT)] = 
{1,};
 #define PUREBEG (char *) pure
 
@@ -264,11 +267,12 @@
 
 static int ignore_warnings;
 
-Lisp_Object Qgc_cons_threshold, Qchar_table_extra_slots;
+static Lisp_Object Qgc_cons_threshold;
+Lisp_Object Qchar_table_extra_slots;
 
 /* Hook run after GC has finished.  */
 
-Lisp_Object Qpost_gc_hook;
+static Lisp_Object Qpost_gc_hook;
 
 static void mark_buffer (Lisp_Object);
 static void mark_terminals (void);
@@ -276,12 +280,14 @@
 static void mark_glyph_matrix (struct glyph_matrix *);
 static void mark_face_cache (struct face_cache *);
 
+#if !defined REL_ALLOC || defined SYSTEM_MALLOC
+static void refill_memory_reserve (void);
+#endif
 static struct Lisp_String *allocate_string (void);
 static void compact_small_strings (void);
 static void free_large_strings (void);
 static void sweep_strings (void);
-
-extern int message_enable_multibyte;
+static void free_misc (Lisp_Object);
 
 /* When scanning the C stack for live Lisp objects, Emacs keeps track
    of what memory allocated via lisp_malloc is intended for what
@@ -1336,7 +1342,7 @@
 
 /* List of free intervals.  */
 
-INTERVAL interval_free_list;
+static INTERVAL interval_free_list;
 
 /* Total number of interval blocks now in use.  */
 
@@ -2455,19 +2461,19 @@
 
 /* Current float_block.  */
 
-struct float_block *float_block;
+static struct float_block *float_block;
 
 /* Index of first unused Lisp_Float in the current float_block.  */
 
-int float_block_index;
+static int float_block_index;
 
 /* Total number of float blocks now in use.  */
 
-int n_float_blocks;
+static int n_float_blocks;
 
 /* Free-list of Lisp_Floats.  */
 
-struct Lisp_Float *float_free_list;
+static struct Lisp_Float *float_free_list;
 
 
 /* Initialize float allocation.  */
@@ -2567,15 +2573,15 @@
 
 /* Current cons_block.  */
 
-struct cons_block *cons_block;
+static struct cons_block *cons_block;
 
 /* Index of first unused Lisp_Cons in the current block.  */
 
-int cons_block_index;
+static int cons_block_index;
 
 /* Free-list of Lisp_Cons structures.  */
 
-struct Lisp_Cons *cons_free_list;
+static struct Lisp_Cons *cons_free_list;
 
 /* Total number of cons blocks now in use.  */
 
@@ -3163,7 +3169,7 @@
 
 /* Free a Lisp_Misc object */
 
-void
+static void
 free_misc (Lisp_Object misc)
 {
   XMISCTYPE (misc) = Lisp_Misc_Free;
@@ -5211,7 +5217,7 @@
 
 #define LAST_MARKED_SIZE 500
 static Lisp_Object last_marked[LAST_MARKED_SIZE];
-int last_marked_index;
+static int last_marked_index;
 
 /* For debugging--call abort when we cdr down this many
    links of a list, in mark_object.  In debugging,
@@ -6103,6 +6109,7 @@
   return Flist (8, consed);
 }
 
+#ifdef ENABLE_CHECKING
 int suppress_checking;
 
 void
@@ -6112,6 +6119,7 @@
           file, line, msg);
   abort ();
 }
+#endif
 
 /* Initialization */
 

=== modified file 'src/atimer.c'
--- a/src/atimer.c      2011-03-27 02:27:11 +0000
+++ b/src/atimer.c      2011-04-11 06:04:34 +0000
@@ -64,7 +64,7 @@
 static void schedule_atimer (struct atimer *);
 static struct atimer *append_atimer_lists (struct atimer *,
                                            struct atimer *);
-void alarm_signal_handler (int signo);
+static void alarm_signal_handler (int signo);
 
 
 /* Start a new atimer of type TYPE.  TIME specifies when the timer is
@@ -246,7 +246,7 @@
 /* Run all timers again, if some have been stopped with a call to
    stop_other_atimers.  */
 
-void
+static void
 run_all_atimers (void)
 {
   if (stopped_atimers)
@@ -270,7 +270,7 @@
 }
 
 
-/* A version of run_all_timers suitable for a record_unwind_protect.  */
+/* A version of run_all_atimers suitable for a record_unwind_protect.  */
 
 Lisp_Object
 unwind_stop_other_atimers (Lisp_Object dummy)

=== modified file 'src/atimer.h'
--- a/src/atimer.h      2011-01-25 04:08:28 +0000
+++ b/src/atimer.h      2011-04-11 06:04:34 +0000
@@ -76,8 +76,6 @@
 void init_atimer (void);
 void turn_on_atimers (int);
 void stop_other_atimers (struct atimer *);
-void run_all_atimers (void);
 Lisp_Object unwind_stop_other_atimers (Lisp_Object);
 
 #endif /* EMACS_ATIMER_H */
-

=== modified file 'src/bidi.c'
--- a/src/bidi.c        2011-03-08 17:25:52 +0000
+++ b/src/bidi.c        2011-04-11 06:13:04 +0000
@@ -91,6 +91,7 @@
   STRONG
 } bidi_category_t;
 
+extern int bidi_ignore_explicit_marks_for_paragraph_level EXTERNALLY_VISIBLE;
 int bidi_ignore_explicit_marks_for_paragraph_level = 1;
 
 static Lisp_Object paragraph_start_re, paragraph_separate_re;
@@ -1779,6 +1780,7 @@
 
 /* This is meant to be called from within the debugger, whenever you
    wish to examine the cache contents.  */
+void bidi_dump_cached_states (void) EXTERNALLY_VISIBLE;
 void
 bidi_dump_cached_states (void)
 {

=== modified file 'src/buffer.c'
--- a/src/buffer.c      2011-04-02 07:36:27 +0000
+++ b/src/buffer.c      2011-04-14 19:34:42 +0000
@@ -100,6 +100,8 @@
 
 int last_per_buffer_idx;
 
+static Lisp_Object Fset_buffer_major_mode (Lisp_Object);
+static Lisp_Object Fdelete_overlay (Lisp_Object);
 static void call_overlay_mod_hooks (Lisp_Object list, Lisp_Object overlay,
                                     int after, Lisp_Object arg1,
                                     Lisp_Object arg2, Lisp_Object arg3);
@@ -111,30 +113,31 @@
  to prevent lossage due to user rplac'ing this alist or its elements.  */
 Lisp_Object Vbuffer_alist;
 
-Lisp_Object Qkill_buffer_query_functions;
+static Lisp_Object Qkill_buffer_query_functions;
 
 /* Hook run before changing a major mode.  */
-Lisp_Object Qchange_major_mode_hook;
+static Lisp_Object Qchange_major_mode_hook;
 
 Lisp_Object Qfirst_change_hook;
 Lisp_Object Qbefore_change_functions;
 Lisp_Object Qafter_change_functions;
-Lisp_Object Qucs_set_table_for_input;
-
-Lisp_Object Qfundamental_mode, Qmode_class, Qpermanent_local;
-Lisp_Object Qpermanent_local_hook;
-
-Lisp_Object Qprotected_field;
-
-Lisp_Object QSFundamental;     /* A string "Fundamental" */
-
-Lisp_Object Qkill_buffer_hook;
-
-Lisp_Object Qget_file_buffer;
-
-Lisp_Object Qoverlayp;
-
-Lisp_Object Qpriority, Qevaporate, Qbefore_string, Qafter_string;
+static Lisp_Object Qucs_set_table_for_input;
+
+static Lisp_Object Qfundamental_mode, Qmode_class, Qpermanent_local;
+static Lisp_Object Qpermanent_local_hook;
+
+static Lisp_Object Qprotected_field;
+
+static Lisp_Object QSFundamental;      /* A string "Fundamental" */
+
+static Lisp_Object Qkill_buffer_hook;
+
+static Lisp_Object Qget_file_buffer;
+
+static Lisp_Object Qoverlayp;
+
+Lisp_Object Qpriority, Qbefore_string, Qafter_string;
+static Lisp_Object Qevaporate;
 
 Lisp_Object Qmodification_hooks;
 Lisp_Object Qinsert_in_front_hooks;
@@ -291,9 +294,6 @@
   return Qnil;
 }
 
-/* Incremented for each buffer created, to assign the buffer number. */
-int buffer_count;
-
 DEFUN ("get-buffer-create", Fget_buffer_create, Sget_buffer_create, 1, 1, 0,
        doc: /* Return the buffer specified by BUFFER-OR-NAME, creating a new 
one if needed.
 If BUFFER-OR-NAME is a string and a live buffer with that name exists,
@@ -830,8 +830,8 @@
    and set-visited-file-name ought to be able to use this to really
    rename the buffer properly.  */
 
-DEFUN ("generate-new-buffer-name", Fgenerate_new_buffer_name, 
Sgenerate_new_buffer_name,
-       1, 2, 0,
+DEFUN ("generate-new-buffer-name", Fgenerate_new_buffer_name,
+       Sgenerate_new_buffer_name, 1, 2, 0,
        doc: /* Return a string that is the name of no existing buffer based on 
NAME.
 If there is no live buffer named NAME, then return NAME.
 Otherwise modify name by appending `<NUMBER>', incrementing NUMBER
@@ -1276,7 +1276,6 @@
 If BUFFER is omitted or nil, some interesting buffer is returned.  */)
   (register Lisp_Object buffer, Lisp_Object visible_ok, Lisp_Object frame)
 {
-  Lisp_Object Fset_buffer_major_mode (Lisp_Object buffer);
   register Lisp_Object tail, buf, notsogood, tem, pred, add_ons;
   notsogood = Qnil;
 
@@ -2501,8 +2500,8 @@
   return flag;
 }
 
-DEFUN ("kill-all-local-variables", Fkill_all_local_variables, 
Skill_all_local_variables,
-       0, 0, 0,
+DEFUN ("kill-all-local-variables", Fkill_all_local_variables,
+       Skill_all_local_variables, 0, 0, 0,
        doc: /* Switch to Fundamental mode by killing current buffer's local 
variables.
 Most local variable bindings are eliminated so that the default values
 become effective once more.  Also, the syntax table is set from

=== modified file 'src/buffer.h'
--- a/src/buffer.h      2011-03-19 18:49:31 +0000
+++ b/src/buffer.h      2011-04-11 01:41:15 +0000
@@ -917,7 +917,6 @@
 EXFUN (Fbuffer_live_p, 1);
 EXFUN (Fbuffer_name, 1);
 EXFUN (Fnext_overlay_change, 1);
-EXFUN (Fdelete_overlay, 1);
 EXFUN (Fbuffer_local_value, 2);
 
 extern Lisp_Object Qbefore_change_functions;

=== modified file 'src/bytecode.c'
--- a/src/bytecode.c    2011-04-04 07:55:46 +0000
+++ b/src/bytecode.c    2011-04-11 03:39:45 +0000
@@ -80,7 +80,6 @@
 
 
 Lisp_Object Qbytecode;
-extern Lisp_Object Qand_optional, Qand_rest;
 
 /*  Byte codes: */
 

=== modified file 'src/callint.c'
--- a/src/callint.c     2011-04-09 20:19:05 +0000
+++ b/src/callint.c     2011-04-14 05:04:02 +0000
@@ -30,14 +30,15 @@
 
 Lisp_Object Qminus, Qplus;
 Lisp_Object Qcall_interactively;
-Lisp_Object Qcommand_debug_status;
-Lisp_Object Qenable_recursive_minibuffers;
+static Lisp_Object Qcommand_debug_status;
+static Lisp_Object Qenable_recursive_minibuffers;
 
-Lisp_Object Qhandle_shift_selection;
+static Lisp_Object Qhandle_shift_selection;
 
 Lisp_Object Qmouse_leave_buffer_hook;
 
-Lisp_Object Qlist, Qlet, Qletx, Qsave_excursion, Qprogn, Qif, Qwhen;
+static Lisp_Object Qlist, Qlet, Qletx, Qsave_excursion, Qprogn, Qif;
+Lisp_Object Qwhen;
 static Lisp_Object preserved_fns;
 
 /* Marker used within call-interactively to refer to point.  */

=== modified file 'src/callproc.c'
--- a/src/callproc.c    2011-03-27 09:07:38 +0000
+++ b/src/callproc.c    2011-04-14 19:34:42 +0000
@@ -96,7 +96,7 @@
 /* Nonzero if this is termination due to exit.  */
 static int call_process_exited;
 
-EXFUN (Fgetenv_internal, 2);
+static Lisp_Object Fgetenv_internal (Lisp_Object, Lisp_Object);
 
 static Lisp_Object
 call_process_kill (Lisp_Object fdpid)

=== modified file 'src/casetab.c'
--- a/src/casetab.c     2011-04-09 22:31:34 +0000
+++ b/src/casetab.c     2011-04-14 05:04:02 +0000
@@ -24,9 +24,11 @@
 #include "buffer.h"
 #include "character.h"
 
-Lisp_Object Qcase_table_p, Qcase_table;
-Lisp_Object Vascii_downcase_table, Vascii_upcase_table;
-Lisp_Object Vascii_canon_table, Vascii_eqv_table;
+static Lisp_Object Qcase_table_p, Qcase_table;
+Lisp_Object Vascii_downcase_table;
+static Lisp_Object Vascii_upcase_table;
+Lisp_Object Vascii_canon_table;
+static Lisp_Object Vascii_eqv_table;
 
 static void set_canon (Lisp_Object case_table, Lisp_Object range, Lisp_Object 
elt);
 static void set_identity (Lisp_Object table, Lisp_Object c, Lisp_Object elt);
@@ -101,7 +103,8 @@
   return set_case_table (table, 0);
 }
 
-DEFUN ("set-standard-case-table", Fset_standard_case_table, 
Sset_standard_case_table, 1, 1, 0,
+DEFUN ("set-standard-case-table", Fset_standard_case_table,
+       Sset_standard_case_table, 1, 1, 0,
        doc: /* Select a new standard case table for new buffers.
 See `set-case-table' for more info on case tables.  */)
   (Lisp_Object table)

=== modified file 'src/category.c'
--- a/src/category.c    2011-04-07 03:34:05 +0000
+++ b/src/category.c    2011-04-11 06:28:35 +0000
@@ -48,11 +48,16 @@
    For the moment, we are not using this feature.  */
 static int category_table_version;
 
-Lisp_Object Qcategory_table, Qcategoryp, Qcategorysetp, Qcategory_table_p;
+static Lisp_Object Qcategory_table, Qcategoryp, Qcategorysetp, 
Qcategory_table_p;
 
 /* Temporary internal variable used in macro CHAR_HAS_CATEGORY.  */
 Lisp_Object _temp_category_set;
 
+/* Make CATEGORY_SET includes (if VAL is t) or excludes (if VAL is
+   nil) CATEGORY.  */
+#define SET_CATEGORY_SET(category_set, category, val) \
+  set_category_set (category_set, category, val)
+static void set_category_set (Lisp_Object, Lisp_Object, Lisp_Object);
 
 /* Category set staff.  */
 
@@ -111,7 +116,7 @@
 
 /* Category staff.  */
 
-Lisp_Object check_category_table (Lisp_Object table);
+static Lisp_Object check_category_table (Lisp_Object table);
 
 DEFUN ("define-category", Fdefine_category, Sdefine_category, 2, 3, 0,
        doc: /* Define CATEGORY as a category which is described by DOCSTRING.
@@ -185,7 +190,7 @@
    valid, return TABLE itself, but if not valid, signal an error of
    wrong-type-argument.  */
 
-Lisp_Object
+static Lisp_Object
 check_category_table (Lisp_Object table)
 {
   if (NILP (table))
@@ -325,7 +330,7 @@
   return build_string (str);
 }
 
-void
+static void
 set_category_set (Lisp_Object category_set, Lisp_Object category, Lisp_Object 
val)
 {
   do {

=== modified file 'src/category.h'
--- a/src/category.h    2011-02-16 15:02:50 +0000
+++ b/src/category.h    2011-04-11 06:28:35 +0000
@@ -67,11 +67,6 @@
 /* Return a new empty category set.  */
 #define MAKE_CATEGORY_SET (Fmake_bool_vector (make_number (128), Qnil))
 
-/* Make CATEGORY_SET includes (if VAL is t) or excludes (if VAL is
-   nil) CATEGORY.  */
-#define SET_CATEGORY_SET(category_set, category, val) \
-  (set_category_set (category_set, category, val))
-
 #define CHECK_CATEGORY_SET(x) \
   CHECK_TYPE (CATEGORY_SET_P (x), Qcategorysetp, x)
 
@@ -114,5 +109,3 @@
    && word_boundary_p (c1, c2))
 
 extern int word_boundary_p (int, int);
-extern void set_category_set (Lisp_Object, Lisp_Object, Lisp_Object);
-

=== modified file 'src/ccl.c'
--- a/src/ccl.c 2011-04-09 16:35:19 +0000
+++ b/src/ccl.c 2011-04-14 05:04:02 +0000
@@ -38,16 +38,16 @@
 
 /* This symbol is a property which associates with ccl program vector.
    Ex: (get 'ccl-big5-encoder 'ccl-program) returns ccl program vector.  */
-Lisp_Object Qccl_program;
+static Lisp_Object Qccl_program;
 
 /* These symbols are properties which associate with code conversion
    map and their ID respectively.  */
-Lisp_Object Qcode_conversion_map;
-Lisp_Object Qcode_conversion_map_id;
+static Lisp_Object Qcode_conversion_map;
+static Lisp_Object Qcode_conversion_map_id;
 
 /* Symbols of ccl program have this property, a value of the property
    is an index for Vccl_protram_table. */
-Lisp_Object Qccl_program_idx;
+static Lisp_Object Qccl_program_idx;
 
 /* Table of registered CCL programs.  Each element is a vector of
    NAME, CCL_PROG, RESOLVEDP, and UPDATEDP, where NAME (symbol) is the
@@ -56,7 +56,7 @@
    CCL_PROG is already resolved to index numbers or not, UPDATEDP (t
    or nil) is the flat to tell if the CCL program is updated after it
    was once used.  */
-Lisp_Object Vccl_program_table;
+static Lisp_Object Vccl_program_table;
 
 /* Return a hash table of id number ID.  */
 #define GET_HASH_TABLE(id) \
@@ -1929,30 +1929,6 @@
 }
 
 
-/* Check if CCL is updated or not.  If not, re-setup members of CCL.  */
-
-int
-check_ccl_update (struct ccl_program *ccl)
-{
-  Lisp_Object slot, ccl_prog;
-
-  if (ccl->idx < 0)
-    return 0;
-  slot = AREF (Vccl_program_table, ccl->idx);
-  if (NILP (AREF (slot, 3)))
-    return 0;
-  ccl_prog = ccl_get_compiled_code (AREF (slot, 0), &ccl->idx);
-  if (! VECTORP (ccl_prog))
-    return -1;
-  ccl->size = ASIZE (ccl_prog);
-  ccl->prog = XVECTOR (ccl_prog)->contents;
-  ccl->eof_ic = XINT (AREF (ccl_prog, CCL_HEADER_EOF));
-  ccl->buf_magnification = XINT (AREF (ccl_prog, CCL_HEADER_BUF_MAG));
-  ASET (slot, 3, Qnil);
-  return 0;
-}
-
-
 DEFUN ("ccl-program-p", Fccl_program_p, Sccl_program_p, 1, 1, 0,
        doc: /* Return t if OBJECT is a CCL program name or a compiled CCL 
program code.
 See the documentation of `define-ccl-program' for the detail of CCL program.  
*/)

=== modified file 'src/ccl.h'
--- a/src/ccl.h 2011-01-18 20:45:37 +0000
+++ b/src/ccl.h 2011-04-11 06:43:21 +0000
@@ -96,19 +96,9 @@
    execution of ccl program CCL_PROG (symbol or vector).  */
 extern int setup_ccl_program (struct ccl_program *, Lisp_Object);
 
-/* Check if CCL is updated or not.  If not, re-setup members of CCL.  */
-extern int check_ccl_update (struct ccl_program *);
-
 extern void ccl_driver (struct ccl_program *, int *, int *, int, int,
                         Lisp_Object);
 
-/* Vector of CCL program names vs corresponding program data.  */
-extern Lisp_Object Vccl_program_table;
-
-/* Symbols of ccl program have this property, a value of the property
-   is an index for Vccl_protram_table. */
-extern Lisp_Object Qccl_program_idx;
-
 extern Lisp_Object Qccl, Qcclp;
 
 EXFUN (Fccl_program_p, 1);
@@ -120,4 +110,3 @@
   } while (0);
 
 #endif /* EMACS_CCL_H */
-

=== modified file 'src/character.c'
--- a/src/character.c   2011-03-29 23:35:49 +0000
+++ b/src/character.c   2011-04-14 05:04:02 +0000
@@ -50,7 +50,7 @@
 
 Lisp_Object Qcharacterp;
 
-Lisp_Object Qauto_fill_chars;
+static Lisp_Object Qauto_fill_chars;
 
 /* Char-table of information about which character to unify to which
    Unicode character.  Mainly used by the macro MAYBE_UNIFY_CHAR.  */

=== modified file 'src/character.h'
--- a/src/character.h   2011-03-28 22:41:01 +0000
+++ b/src/character.h   2011-04-11 03:39:45 +0000
@@ -615,7 +615,7 @@
 extern EMACS_INT lisp_string_width (Lisp_Object, int,
                                    EMACS_INT *, EMACS_INT *);
 
-extern Lisp_Object Qcharacterp, Qauto_fill_chars;
+extern Lisp_Object Qcharacterp;
 extern Lisp_Object Vchar_unify_table;
 extern Lisp_Object string_escape_byte8 (Lisp_Object);
 

=== modified file 'src/charset.c'
--- a/src/charset.c     2011-04-12 10:20:32 +0000
+++ b/src/charset.c     2011-04-14 20:16:48 +0000
@@ -68,17 +68,17 @@
 
 /* Special charset symbols.  */
 Lisp_Object Qascii;
-Lisp_Object Qeight_bit;
-Lisp_Object Qiso_8859_1;
-Lisp_Object Qunicode;
-Lisp_Object Qemacs;
+static Lisp_Object Qeight_bit;
+static Lisp_Object Qiso_8859_1;
+static Lisp_Object Qunicode;
+static Lisp_Object Qemacs;
 
 /* The corresponding charsets.  */
 int charset_ascii;
 int charset_eight_bit;
-int charset_iso_8859_1;
+static int charset_iso_8859_1;
 int charset_unicode;
-int charset_emacs;
+static int charset_emacs;
 
 /* The other special charsets.  */
 int charset_jisx0201_roman;
@@ -87,7 +87,7 @@
 int charset_ksc5601;
 
 /* Value of charset attribute `charset-iso-plane'.  */
-Lisp_Object Qgl, Qgr;
+static Lisp_Object Qgl, Qgr;
 
 /* Charset of unibyte characters.  */
 int charset_unibyte;
@@ -652,12 +652,10 @@
 }
 
 
-void map_charset_for_dump (void (*c_function) (Lisp_Object, Lisp_Object),
-                           Lisp_Object function, Lisp_Object arg,
-                           unsigned from, unsigned to);
-
-void
-map_charset_for_dump (void (*c_function) (Lisp_Object, Lisp_Object), 
Lisp_Object function, Lisp_Object arg, unsigned int from, unsigned int to)
+static void
+map_charset_for_dump (void (*c_function) (Lisp_Object, Lisp_Object),
+                     Lisp_Object function, Lisp_Object arg,
+                     unsigned int from, unsigned int to)
 {
   int from_idx = CODE_POINT_TO_INDEX (temp_charset_work->current, from);
   int to_idx = CODE_POINT_TO_INDEX (temp_charset_work->current, to);

=== modified file 'src/charset.h'
--- a/src/charset.h     2011-03-08 00:22:52 +0000
+++ b/src/charset.h     2011-04-11 06:48:18 +0000
@@ -517,9 +517,8 @@
 
 extern Lisp_Object Qcharsetp;
 
-extern Lisp_Object Qascii, Qunicode;
+extern Lisp_Object Qascii;
 extern int charset_ascii, charset_eight_bit;
-extern int charset_iso_8859_1;
 extern int charset_unicode;
 extern int charset_jisx0201_roman;
 extern int charset_jisx0208_1978;

=== modified file 'src/chartab.c'
--- a/src/chartab.c     2011-04-09 22:34:16 +0000
+++ b/src/chartab.c     2011-04-14 05:04:02 +0000
@@ -36,7 +36,7 @@
 
 /* Number of characters each element of Nth level char-table
    covers.  */
-const int chartab_chars[4] =
+static const int chartab_chars[4] =
   { (1 << (CHARTAB_SIZE_BITS_1 + CHARTAB_SIZE_BITS_2 + CHARTAB_SIZE_BITS_3)),
     (1 << (CHARTAB_SIZE_BITS_2 + CHARTAB_SIZE_BITS_3)),
     (1 << CHARTAB_SIZE_BITS_3),
@@ -44,7 +44,7 @@
 
 /* Number of characters (in bits) each element of Nth level char-table
    covers.  */
-const int chartab_bits[4] =
+static const int chartab_bits[4] =
   { (CHARTAB_SIZE_BITS_1 + CHARTAB_SIZE_BITS_2 + CHARTAB_SIZE_BITS_3),
     (CHARTAB_SIZE_BITS_2 + CHARTAB_SIZE_BITS_3),
     CHARTAB_SIZE_BITS_3,

=== modified file 'src/cmds.c'
--- a/src/cmds.c        2011-03-28 22:41:01 +0000
+++ b/src/cmds.c        2011-04-14 05:04:02 +0000
@@ -31,10 +31,10 @@
 #include "dispextern.h"
 #include "frame.h"
 
-Lisp_Object Qkill_forward_chars, Qkill_backward_chars;
+static Lisp_Object Qkill_forward_chars, Qkill_backward_chars;
 
 /* A possible value for a buffer's overwrite-mode variable.  */
-Lisp_Object Qoverwrite_mode_binary;
+static Lisp_Object Qoverwrite_mode_binary;
 
 static int internal_self_insert (int, EMACS_INT);
 

=== modified file 'src/coding.c'
--- a/src/coding.c      2011-04-09 18:42:31 +0000
+++ b/src/coding.c      2011-04-14 05:04:02 +0000
@@ -300,27 +300,30 @@
 
 Lisp_Object Vcoding_system_hash_table;
 
-Lisp_Object Qcoding_system, Qcoding_aliases, Qeol_type;
+static Lisp_Object Qcoding_system, Qeol_type;
+static Lisp_Object Qcoding_aliases;
 Lisp_Object Qunix, Qdos;
 Lisp_Object Qbuffer_file_coding_system;
-Lisp_Object Qpost_read_conversion, Qpre_write_conversion;
-Lisp_Object Qdefault_char;
+static Lisp_Object Qpost_read_conversion, Qpre_write_conversion;
+static Lisp_Object Qdefault_char;
 Lisp_Object Qno_conversion, Qundecided;
-Lisp_Object Qcharset, Qiso_2022, Qutf_8, Qutf_16, Qshift_jis, Qbig5;
-Lisp_Object Qbig, Qlittle;
-Lisp_Object Qcoding_system_history;
-Lisp_Object Qvalid_codes;
-Lisp_Object QCcategory, QCmnemonic, QCdefault_char;
-Lisp_Object QCdecode_translation_table, QCencode_translation_table;
-Lisp_Object QCpost_read_conversion, QCpre_write_conversion;
-Lisp_Object QCascii_compatible_p;
+Lisp_Object Qcharset, Qutf_8;
+static Lisp_Object Qiso_2022;
+static Lisp_Object Qutf_16, Qshift_jis, Qbig5;
+static Lisp_Object Qbig, Qlittle;
+static Lisp_Object Qcoding_system_history;
+static Lisp_Object Qvalid_codes;
+static Lisp_Object QCcategory, QCmnemonic, QCdefault_char;
+static Lisp_Object QCdecode_translation_table, QCencode_translation_table;
+static Lisp_Object QCpost_read_conversion, QCpre_write_conversion;
+static Lisp_Object QCascii_compatible_p;
 
 Lisp_Object Qcall_process, Qcall_process_region;
 Lisp_Object Qstart_process, Qopen_network_stream;
-Lisp_Object Qtarget_idx;
+static Lisp_Object Qtarget_idx;
 
-Lisp_Object Qinsufficient_source, Qinconsistent_eol, Qinvalid_source;
-Lisp_Object Qinterrupted, Qinsufficient_memory;
+static Lisp_Object Qinsufficient_source, Qinconsistent_eol, Qinvalid_source;
+static Lisp_Object Qinterrupted, Qinsufficient_memory;
 
 /* If a symbol has this property, evaluate the value to define the
    symbol as a coding system.  */
@@ -351,12 +354,12 @@
 
 Lisp_Object Qtranslation_table;
 Lisp_Object Qtranslation_table_id;
-Lisp_Object Qtranslation_table_for_decode;
-Lisp_Object Qtranslation_table_for_encode;
+static Lisp_Object Qtranslation_table_for_decode;
+static Lisp_Object Qtranslation_table_for_encode;
 
 /* Two special coding systems.  */
-Lisp_Object Vsjis_coding_system;
-Lisp_Object Vbig5_coding_system;
+static Lisp_Object Vsjis_coding_system;
+static Lisp_Object Vbig5_coding_system;
 
 /* ISO2022 section */
 
@@ -2859,7 +2862,7 @@
   COMPOSITION_WITH_RULE_ALTCHARS:
        ESC 4 ALTCHAR [ RULE ALTCHAR ] ESC 0 CHAR [ CHAR ] ESC 1 */
 
-enum iso_code_class_type iso_code_class[256];
+static enum iso_code_class_type iso_code_class[256];
 
 #define SAFE_CHARSET_P(coding, id)     \
   ((id) <= (coding)->max_charset_id    \
@@ -6209,7 +6212,7 @@
    system is detected, update fields of CODING by the detected coding
    system.  */
 
-void
+static void
 detect_coding (struct coding_system *coding)
 {
   const unsigned char *src, *src_end;
@@ -7527,30 +7530,6 @@
   return coding->result;
 }
 
-int
-encode_coding_gap (struct coding_system *coding,
-                  EMACS_INT chars, EMACS_INT bytes)
-{
-  int count = SPECPDL_INDEX ();
-
-  code_conversion_save (0, 0);
-
-  coding->src_object = Fcurrent_buffer ();
-  coding->src_chars = chars;
-  coding->src_bytes = bytes;
-  coding->src_pos = -chars;
-  coding->src_pos_byte = -bytes;
-  coding->src_multibyte = chars < bytes;
-  coding->dst_object = coding->src_object;
-  coding->dst_pos = PT;
-  coding->dst_pos_byte = PT_BYTE;
-
-  encode_coding (coding);
-
-  unbind_to (count, Qnil);
-  return coding->result;
-}
-
 
 /* Decode the text in the range FROM/FROM_BYTE and TO/TO_BYTE in
    SRC_OBJECT into DST_OBJECT by coding context CODING.
@@ -8831,7 +8810,7 @@
 }
 
 
-Lisp_Object
+static Lisp_Object
 code_convert_region (Lisp_Object start, Lisp_Object end,
                     Lisp_Object coding_system, Lisp_Object dst_object,
                     int encodep, int norecord)

=== modified file 'src/coding.h'
--- a/src/coding.h      2011-04-09 16:35:19 +0000
+++ b/src/coding.h      2011-04-11 06:58:57 +0000
@@ -695,10 +695,6 @@
 extern void setup_coding_system (Lisp_Object, struct coding_system *);
 extern Lisp_Object coding_charset_list (struct coding_system *);
 extern Lisp_Object coding_system_charset_list (Lisp_Object);
-extern void detect_coding (struct coding_system *);
-extern Lisp_Object code_convert_region (Lisp_Object, Lisp_Object,
-                                        Lisp_Object, Lisp_Object,
-                                        int, int);
 extern Lisp_Object code_convert_string (Lisp_Object, Lisp_Object,
                                         Lisp_Object, int, int, int);
 extern Lisp_Object code_convert_string_norecord (Lisp_Object, Lisp_Object,
@@ -709,8 +705,6 @@
 
 extern int decode_coding_gap (struct coding_system *,
                               EMACS_INT, EMACS_INT);
-extern int encode_coding_gap (struct coding_system *,
-                              EMACS_INT, EMACS_INT);
 extern void decode_coding_object (struct coding_system *,
                                   Lisp_Object, EMACS_INT, EMACS_INT,
                                   EMACS_INT, EMACS_INT, Lisp_Object);
@@ -757,10 +751,9 @@
 
 extern Lisp_Object Qutf_8, Qutf_8_emacs;
 
-extern Lisp_Object Qcoding_system, Qeol_type, Qcoding_category_index;
+extern Lisp_Object Qcoding_category_index;
 extern Lisp_Object Qcoding_system_p;
 extern Lisp_Object Qraw_text, Qemacs_mule, Qno_conversion, Qundecided;
-extern Lisp_Object Qiso_2022;
 extern Lisp_Object Qbuffer_file_coding_system;
 
 extern Lisp_Object Qunix, Qdos, Qmac;
@@ -789,4 +782,3 @@
 extern int emacs_mule_string_char (unsigned char *);
 
 #endif /* EMACS_CODING_H */
-

=== modified file 'src/commands.h'
--- a/src/commands.h    2011-01-25 04:08:28 +0000
+++ b/src/commands.h    2011-04-11 07:02:21 +0000
@@ -36,15 +36,6 @@
    events until a non-ASCII event is acceptable as input.  */
 extern Lisp_Object unread_switch_frame;
 
-/* The value of point when the last command was started.  */
-extern EMACS_INT last_point_position;
-
-/* The buffer that was current when the last command was started.  */
-extern Lisp_Object last_point_position_buffer;
-
-/* The window that was selected when the last command was started.  */
-extern Lisp_Object last_point_position_window;
-
 /* Nonzero means ^G can quit instantly */
 extern int immediate_quit;
 
@@ -55,4 +46,3 @@
 /* Set this nonzero to force reconsideration of mode line. */
 
 extern int update_mode_lines;
-

=== modified file 'src/composite.c'
--- a/src/composite.c   2011-04-05 05:11:14 +0000
+++ b/src/composite.c   2011-04-14 19:34:42 +0000
@@ -152,13 +152,14 @@
    COMPOSITION-ID.  */
 Lisp_Object composition_hash_table;
 
-Lisp_Object Qauto_composed;
-Lisp_Object Qauto_composition_function;
+static Lisp_Object Qauto_composed;
+static Lisp_Object Qauto_composition_function;
 /* Maximum number of characters to look back for
    auto-compositions.  */
 #define MAX_AUTO_COMPOSITION_LOOKBACK 3
 
-EXFUN (Fremove_list_of_text_properties, 4);
+static Lisp_Object Fcomposition_get_gstring (Lisp_Object, Lisp_Object,
+                                            Lisp_Object, Lisp_Object);
 
 /* Temporary variable used in macros COMPOSITION_XXX.  */
 Lisp_Object composition_temp;

=== modified file 'src/composite.h'
--- a/src/composite.h   2011-04-05 06:41:53 +0000
+++ b/src/composite.h   2011-04-11 03:39:45 +0000
@@ -216,8 +216,6 @@
 
 extern Lisp_Object Qcomposition;
 extern Lisp_Object composition_hash_table;
-extern Lisp_Object Qauto_composed;
-extern Lisp_Object Qauto_composition_function;
 extern int get_composition_id (EMACS_INT, EMACS_INT, EMACS_INT,
                               Lisp_Object, Lisp_Object);
 extern int find_composition (EMACS_INT, EMACS_INT, EMACS_INT *, EMACS_INT *,
@@ -328,6 +326,4 @@
 
 extern EMACS_INT composition_adjust_point (EMACS_INT, EMACS_INT);
 
-EXFUN (Fcomposition_get_gstring, 4);
-
 #endif /* not EMACS_COMPOSITE_H */

=== modified file 'src/data.c'
--- a/src/data.c        2011-03-31 04:24:03 +0000
+++ b/src/data.c        2011-04-14 05:04:02 +0000
@@ -52,26 +52,33 @@
 extern double atof (const char *);
 #endif /* !atof */
 
-Lisp_Object Qnil, Qt, Qquote, Qlambda, Qsubr, Qunbound;
+Lisp_Object Qnil, Qt, Qquote, Qlambda, Qunbound;
+static Lisp_Object Qsubr;
 Lisp_Object Qerror_conditions, Qerror_message, Qtop_level;
-Lisp_Object Qerror, Qquit, Qwrong_type_argument, Qargs_out_of_range;
-Lisp_Object Qvoid_variable, Qvoid_function, Qcyclic_function_indirection;
-Lisp_Object Qcyclic_variable_indirection, Qcircular_list;
-Lisp_Object Qsetting_constant, Qinvalid_read_syntax;
+Lisp_Object Qerror, Qquit, Qargs_out_of_range;
+static Lisp_Object Qwrong_type_argument;
+Lisp_Object Qvoid_variable, Qvoid_function;
+static Lisp_Object Qcyclic_function_indirection;
+static Lisp_Object Qcyclic_variable_indirection;
+Lisp_Object Qcircular_list;
+static Lisp_Object Qsetting_constant;
+Lisp_Object Qinvalid_read_syntax;
 Lisp_Object Qinvalid_function, Qwrong_number_of_arguments, Qno_catch;
 Lisp_Object Qend_of_file, Qarith_error, Qmark_inactive;
 Lisp_Object Qbeginning_of_buffer, Qend_of_buffer, Qbuffer_read_only;
 Lisp_Object Qtext_read_only;
 
-Lisp_Object Qintegerp, Qnatnump, Qwholenump, Qsymbolp, Qlistp, Qconsp;
+Lisp_Object Qintegerp, Qwholenump, Qsymbolp, Qlistp, Qconsp;
+static Lisp_Object Qnatnump;
 Lisp_Object Qstringp, Qarrayp, Qsequencep, Qbufferp;
 Lisp_Object Qchar_or_string_p, Qmarkerp, Qinteger_or_marker_p, Qvectorp;
-Lisp_Object Qbuffer_or_string_p, Qkeywordp;
-Lisp_Object Qboundp, Qfboundp;
+Lisp_Object Qbuffer_or_string_p;
+static Lisp_Object Qkeywordp, Qboundp;
+Lisp_Object Qfboundp;
 Lisp_Object Qchar_table_p, Qvector_or_char_table_p;
 
 Lisp_Object Qcdr;
-Lisp_Object Qad_advice_info, Qad_activate_internal;
+static Lisp_Object Qad_advice_info, Qad_activate_internal;
 
 Lisp_Object Qrange_error, Qdomain_error, Qsingularity_error;
 Lisp_Object Qoverflow_error, Qunderflow_error;
@@ -83,7 +90,7 @@
 static Lisp_Object Qsymbol, Qstring, Qcons, Qmarker, Qoverlay;
 Lisp_Object Qwindow;
 static Lisp_Object Qfloat, Qwindow_configuration;
-Lisp_Object Qprocess;
+static Lisp_Object Qprocess;
 static Lisp_Object Qcompiled_function, Qbuffer, Qframe, Qvector;
 static Lisp_Object Qchar_table, Qbool_vector, Qhash_table;
 static Lisp_Object Qsubrp, Qmany, Qunevalled;
@@ -94,13 +101,6 @@
 static void swap_in_symval_forwarding (struct Lisp_Symbol *, struct 
Lisp_Buffer_Local_Value *);
 
 
-void
-circular_list_error (Lisp_Object list)
-{
-  xsignal (Qcircular_list, list);
-}
-
-
 Lisp_Object
 wrong_type_argument (register Lisp_Object predicate, register Lisp_Object 
value)
 {
@@ -1479,8 +1479,8 @@
   return blv;
 }
 
-DEFUN ("make-variable-buffer-local", Fmake_variable_buffer_local, 
Smake_variable_buffer_local,
-       1, 1, "vMake Variable Buffer Local: ",
+DEFUN ("make-variable-buffer-local", Fmake_variable_buffer_local,
+       Smake_variable_buffer_local, 1, 1, "vMake Variable Buffer Local: ",
        doc: /* Make VARIABLE become buffer-local whenever it is set.
 At any time, the value for the current buffer is in effect,
 unless the variable has never been set in this buffer,
@@ -1955,7 +1955,8 @@
 #if 0
 extern struct terminal *get_terminal (Lisp_Object display, int);
 
-DEFUN ("terminal-local-value", Fterminal_local_value, Sterminal_local_value, 
2, 2, 0,
+DEFUN ("terminal-local-value", Fterminal_local_value,
+       Sterminal_local_value, 2, 2, 0,
        doc: /* Return the terminal-local value of SYMBOL on TERMINAL.
 If SYMBOL is not a terminal-local variable, then return its normal
 value, like `symbol-value'.
@@ -1972,7 +1973,8 @@
   return result;
 }
 
-DEFUN ("set-terminal-local-value", Fset_terminal_local_value, 
Sset_terminal_local_value, 3, 3, 0,
+DEFUN ("set-terminal-local-value", Fset_terminal_local_value,
+       Sset_terminal_local_value, 3, 3, 0,
        doc: /* Set the terminal-local binding of SYMBOL on TERMINAL to VALUE.
 If VARIABLE is not a terminal-local variable, then set its normal
 binding, like `set'.

=== modified file 'src/dbusbind.c'
--- a/src/dbusbind.c    2011-03-27 02:12:36 +0000
+++ b/src/dbusbind.c    2011-04-12 05:20:44 +0000
@@ -30,53 +30,53 @@
 
 
 /* Subroutines.  */
-Lisp_Object Qdbus_init_bus;
-Lisp_Object Qdbus_close_bus;
-Lisp_Object Qdbus_get_unique_name;
-Lisp_Object Qdbus_call_method;
-Lisp_Object Qdbus_call_method_asynchronously;
-Lisp_Object Qdbus_method_return_internal;
-Lisp_Object Qdbus_method_error_internal;
-Lisp_Object Qdbus_send_signal;
-Lisp_Object Qdbus_register_service;
-Lisp_Object Qdbus_register_signal;
-Lisp_Object Qdbus_register_method;
+static Lisp_Object Qdbus_init_bus;
+static Lisp_Object Qdbus_close_bus;
+static Lisp_Object Qdbus_get_unique_name;
+static Lisp_Object Qdbus_call_method;
+static Lisp_Object Qdbus_call_method_asynchronously;
+static Lisp_Object Qdbus_method_return_internal;
+static Lisp_Object Qdbus_method_error_internal;
+static Lisp_Object Qdbus_send_signal;
+static Lisp_Object Qdbus_register_service;
+static Lisp_Object Qdbus_register_signal;
+static Lisp_Object Qdbus_register_method;
 
 /* D-Bus error symbol.  */
-Lisp_Object Qdbus_error;
+static Lisp_Object Qdbus_error;
 
 /* Lisp symbols of the system and session buses.  */
-Lisp_Object QCdbus_system_bus, QCdbus_session_bus;
+static Lisp_Object QCdbus_system_bus, QCdbus_session_bus;
 
 /* Lisp symbol for method call timeout.  */
-Lisp_Object QCdbus_timeout;
+static Lisp_Object QCdbus_timeout;
 
 /* Lisp symbols for name request flags.  */
-Lisp_Object QCdbus_request_name_allow_replacement;
-Lisp_Object QCdbus_request_name_replace_existing;
-Lisp_Object QCdbus_request_name_do_not_queue;
+static Lisp_Object QCdbus_request_name_allow_replacement;
+static Lisp_Object QCdbus_request_name_replace_existing;
+static Lisp_Object QCdbus_request_name_do_not_queue;
 
 /* Lisp symbols for name request replies.  */
-Lisp_Object QCdbus_request_name_reply_primary_owner;
-Lisp_Object QCdbus_request_name_reply_in_queue;
-Lisp_Object QCdbus_request_name_reply_exists;
-Lisp_Object QCdbus_request_name_reply_already_owner;
+static Lisp_Object QCdbus_request_name_reply_primary_owner;
+static Lisp_Object QCdbus_request_name_reply_in_queue;
+static Lisp_Object QCdbus_request_name_reply_exists;
+static Lisp_Object QCdbus_request_name_reply_already_owner;
 
 /* Lisp symbols of D-Bus types.  */
-Lisp_Object QCdbus_type_byte, QCdbus_type_boolean;
-Lisp_Object QCdbus_type_int16, QCdbus_type_uint16;
-Lisp_Object QCdbus_type_int32, QCdbus_type_uint32;
-Lisp_Object QCdbus_type_int64, QCdbus_type_uint64;
-Lisp_Object QCdbus_type_double, QCdbus_type_string;
-Lisp_Object QCdbus_type_object_path, QCdbus_type_signature;
+static Lisp_Object QCdbus_type_byte, QCdbus_type_boolean;
+static Lisp_Object QCdbus_type_int16, QCdbus_type_uint16;
+static Lisp_Object QCdbus_type_int32, QCdbus_type_uint32;
+static Lisp_Object QCdbus_type_int64, QCdbus_type_uint64;
+static Lisp_Object QCdbus_type_double, QCdbus_type_string;
+static Lisp_Object QCdbus_type_object_path, QCdbus_type_signature;
 #ifdef DBUS_TYPE_UNIX_FD
 Lisp_Object QCdbus_type_unix_fd;
 #endif
-Lisp_Object QCdbus_type_array, QCdbus_type_variant;
-Lisp_Object QCdbus_type_struct, QCdbus_type_dict_entry;
+static Lisp_Object QCdbus_type_array, QCdbus_type_variant;
+static Lisp_Object QCdbus_type_struct, QCdbus_type_dict_entry;
 
 /* Whether we are reading a D-Bus event.  */
-int xd_in_read_queued_messages = 0;
+static int xd_in_read_queued_messages = 0;
 
 
 /* We use "xd_" and "XD_" as prefix for all internal symbols, because

=== modified file 'src/dired.c'
--- a/src/dired.c       2011-04-03 00:32:58 +0000
+++ b/src/dired.c       2011-04-14 19:34:42 +0000
@@ -79,14 +79,15 @@
 #include "regex.h"
 #include "blockinput.h"
 
-Lisp_Object Qdirectory_files;
-Lisp_Object Qdirectory_files_and_attributes;
-Lisp_Object Qfile_name_completion;
-Lisp_Object Qfile_name_all_completions;
-Lisp_Object Qfile_attributes;
-Lisp_Object Qfile_attributes_lessp;
+static Lisp_Object Qdirectory_files;
+static Lisp_Object Qdirectory_files_and_attributes;
+static Lisp_Object Qfile_name_completion;
+static Lisp_Object Qfile_name_all_completions;
+static Lisp_Object Qfile_attributes;
+static Lisp_Object Qfile_attributes_lessp;
 
 static int scmp (const char *, const char *, int);
+static Lisp_Object Ffile_attributes (Lisp_Object, Lisp_Object);
 
 #ifdef WINDOWSNT
 Lisp_Object
@@ -380,7 +381,9 @@
 }
 
 
-Lisp_Object file_name_completion (Lisp_Object file, Lisp_Object dirname, int 
all_flag, int ver_flag, Lisp_Object predicate);
+static Lisp_Object file_name_completion
+  (Lisp_Object file, Lisp_Object dirname, int all_flag, int ver_flag,
+   Lisp_Object predicate);
 
 DEFUN ("file-name-completion", Ffile_name_completion, Sfile_name_completion,
        2, 3, 0,
@@ -438,9 +441,9 @@
 }
 
 static int file_name_completion_stat (Lisp_Object dirname, DIRENTRY *dp, 
struct stat *st_addr);
-Lisp_Object Qdefault_directory;
+static Lisp_Object Qdefault_directory;
 
-Lisp_Object
+static Lisp_Object
 file_name_completion (Lisp_Object file, Lisp_Object dirname, int all_flag, int 
ver_flag, Lisp_Object predicate)
 {
   DIR *d;

=== modified file 'src/dispextern.h'
--- a/src/dispextern.h  2011-03-31 01:37:51 +0000
+++ b/src/dispextern.h  2011-04-14 03:01:10 +0000
@@ -1149,12 +1149,6 @@
 
 extern int display_completed;
 
-/* A temporary storage area, including a row of glyphs.  Initialized
-   in xdisp.c.  Used for various purposes, as an example see
-   get_overlay_arrow_glyph_row.  */
-
-extern struct glyph_row scratch_glyph_row;
-
 
 
 /************************************************************************
@@ -1739,9 +1733,12 @@
 
 /* Non-zero if FACE is suitable for displaying character CHAR.  */
 
+#define FACE_SUITABLE_FOR_ASCII_CHAR_P(FACE, CHAR)     \
+  ((FACE) == (FACE)->ascii_face)
+
 #define FACE_SUITABLE_FOR_CHAR_P(FACE, CHAR)   \
   (ASCII_CHAR_P (CHAR)                         \
-   ? (FACE) == (FACE)->ascii_face              \
+   ? FACE_SUITABLE_FOR_ASCII_CHAR_P(FACE)      \
    : face_suitable_for_char_p ((FACE), (CHAR)))
 
 /* Return the id of the realized face on frame F that is like the face
@@ -2944,7 +2941,6 @@
 
 extern void bidi_init_it (EMACS_INT, EMACS_INT, struct bidi_it *);
 extern void bidi_move_to_visually_next (struct bidi_it *);
-extern void bidi_dump_cached_states (void);
 extern void bidi_paragraph_init (bidi_dir_t, struct bidi_it *, int);
 extern int  bidi_mirror_char (int);
 
@@ -2966,24 +2962,17 @@
 int window_box_left_offset (struct window *, int);
 int window_box_right (struct window *, int);
 int window_box_right_offset (struct window *, int);
-void window_box_edges (struct window *, int, int *, int *, int *, int *);
 int estimate_mode_line_height (struct frame *, enum face_id);
 void pixel_to_glyph_coords (struct frame *, int, int, int *, int *,
                             NativeRectangle *, int);
-int glyph_to_pixel_coords (struct window *, int, int, int *, int *);
 void remember_mouse_glyph (struct frame *, int, int, NativeRectangle *);
 
 void mark_window_display_accurate (Lisp_Object, int);
 void redisplay_preserve_echo_area (int);
-int set_cursor_from_row (struct window *, struct glyph_row *,
-                         struct glyph_matrix *, EMACS_INT, EMACS_INT,
-                        int, int);
 void init_iterator (struct it *, struct window *, EMACS_INT,
                     EMACS_INT, struct glyph_row *, enum face_id);
 void init_iterator_to_row_start (struct it *, struct window *,
                                  struct glyph_row *);
-int get_next_display_element (struct it *);
-void set_iterator_to_next (struct it *, int);
 void start_display (struct it *, struct window *, struct text_pos);
 void move_it_to (struct it *, EMACS_INT, int, int, int, int);
 void move_it_vertically (struct it *, int);
@@ -2995,7 +2984,6 @@
                              enum move_operation_enum op);
 int in_display_vector_p (struct it *);
 int frame_mode_line_height (struct frame *);
-void highlight_trailing_whitespace (struct frame *, struct glyph_row *);
 extern Lisp_Object Qtool_bar;
 extern int redisplaying_p;
 extern int help_echo_showing_p;
@@ -3058,15 +3046,11 @@
                                    XRectangle *);
 #endif /* HAVE_WINDOW_SYSTEM */
 
-extern void frame_to_window_pixel_xy (struct window *, int *, int *);
 extern void note_mouse_highlight (struct frame *, int, int);
 extern void x_clear_window_mouse_face (struct window *);
 extern void cancel_mouse_face (struct frame *);
 extern int clear_mouse_face (Mouse_HLInfo *);
-extern void show_mouse_face (Mouse_HLInfo *, enum draw_glyphs_face);
 extern int cursor_in_mouse_face_p (struct window *w);
-extern void draw_row_with_mouse_face (struct window *, int, struct glyph_row *,
-                                     int, int, enum draw_glyphs_face);
 extern void tty_draw_row_with_mouse_face (struct window *, struct glyph_row *,
                                          int, int, enum draw_glyphs_face);
 
@@ -3096,7 +3080,7 @@
 extern int x_create_bitmap_from_data (struct frame *, char *,
                                       unsigned int, unsigned int);
 extern int x_create_bitmap_from_file (struct frame *, Lisp_Object);
-#if defined (HAVE_XPM) && defined (HAVE_X_WINDOWS)
+#if defined HAVE_XPM && defined HAVE_X_WINDOWS && !defined USE_GTK
 extern int x_create_bitmap_from_xpm_data (struct frame *f, const char **bits);
 #endif
 #ifndef x_destroy_bitmap
@@ -3148,7 +3132,6 @@
 void unload_color (struct frame *, unsigned long);
 char *choose_face_font (struct frame *, Lisp_Object *, Lisp_Object,
                         int *);
-int ascii_face_of_lisp_face (struct frame *, int);
 void prepare_face_for_display (struct frame *, struct face *);
 int xstrcasecmp (const char *, const char *);
 int lookup_named_face (struct frame *, Lisp_Object, int);
@@ -3174,7 +3157,6 @@
 int merge_faces (struct frame *, Lisp_Object, int, int);
 int compute_char_face (struct frame *, int, Lisp_Object);
 void free_all_realized_faces (Lisp_Object);
-void free_realized_face (struct frame *, struct face *);
 extern Lisp_Object Qforeground_color, Qbackground_color;
 extern Lisp_Object Qframe_set_background_mode;
 extern char unspecified_fg[], unspecified_bg[];
@@ -3190,7 +3172,6 @@
 
 #ifdef HAVE_WINDOW_SYSTEM
 
-int x_screen_planes (struct frame *);
 void x_implicitly_set_name (struct frame *, Lisp_Object, Lisp_Object);
 
 extern Lisp_Object tip_frame;
@@ -3248,11 +3229,9 @@
                                          Lisp_Object *,
                                          int *, int *, int *, int *);
 extern void redraw_frame (struct frame *);
-extern void redraw_garbaged_frames (void);
 extern void cancel_line (int, struct frame *);
 extern void init_desired_glyphs (struct frame *);
 extern int update_frame (struct frame *, int, int);
-extern int scrolling (struct frame *);
 extern void bitch_at_user (void);
 void adjust_glyphs (struct frame *);
 void free_glyphs (struct frame *);
@@ -3268,7 +3247,6 @@
 void increment_matrix_positions (struct glyph_matrix *,
                                  int, int, EMACS_INT, EMACS_INT);
 void blank_row (struct window *, struct glyph_row *, int);
-void increment_row_positions (struct glyph_row *, EMACS_INT, EMACS_INT);
 void enable_glyph_matrix_rows (struct glyph_matrix *, int, int, int);
 void clear_glyph_row (struct glyph_row *);
 void prepare_desired_row (struct glyph_row *);
@@ -3302,10 +3280,7 @@
 
 /* Defined in term.c */
 
-extern void tty_set_terminal_modes (struct terminal *);
-extern void tty_reset_terminal_modes (struct terminal *);
 extern void tty_turn_off_insert (struct tty_display_info *);
-extern void tty_turn_off_highlight (struct tty_display_info *);
 extern int string_cost (const char *);
 extern int per_line_cost (const char *);
 extern void calculate_costs (struct frame *);
@@ -3313,7 +3288,6 @@
 extern void produce_special_glyphs (struct it *, enum display_element_type);
 extern int tty_capable_p (struct tty_display_info *, unsigned, unsigned long, 
unsigned long);
 extern void set_tty_color_mode (struct tty_display_info *, struct frame *);
-extern struct terminal *get_tty_terminal (Lisp_Object, int);
 extern struct terminal *get_named_tty (const char *);
 EXFUN (Ftty_type, 1);
 extern void create_tty_output (struct frame *);
@@ -3323,7 +3297,6 @@
 /* Defined in scroll.c */
 
 extern int scrolling_max_lines_saved (int, int, int *, int *, int *);
-extern int scroll_cost (struct frame *, int, int, int);
 extern void do_line_insertion_deletion_costs (struct frame *, const char *,
                                               const char *, const char *,
                                              const char *, const char *,

=== modified file 'src/dispnew.c'
--- a/src/dispnew.c     2011-03-29 06:57:40 +0000
+++ b/src/dispnew.c     2011-04-14 05:04:02 +0000
@@ -121,11 +121,12 @@
 static void allocate_matrices_for_window_redisplay (struct window *);
 static int realloc_glyph_pool (struct glyph_pool *, struct dim);
 static void adjust_frame_glyphs (struct frame *);
-struct glyph_matrix *new_glyph_matrix (struct glyph_pool *);
+static struct glyph_matrix *new_glyph_matrix (struct glyph_pool *);
 static void free_glyph_matrix (struct glyph_matrix *);
 static void adjust_glyph_matrix (struct window *, struct glyph_matrix *,
                                  int, int, struct dim);
 static void change_frame_size_1 (struct frame *, int, int, int, int, int);
+static void increment_row_positions (struct glyph_row *, EMACS_INT, EMACS_INT);
 static void swap_glyph_pointers (struct glyph_row *, struct glyph_row *);
 #if GLYPH_DEBUG
 static int glyph_row_slice_p (struct glyph_row *, struct glyph_row *);
@@ -163,6 +164,7 @@
 static int update_window_tree (struct window *, int);
 static int update_window (struct window *, int);
 static int update_frame_1 (struct frame *, int, int);
+static int scrolling (struct frame *);
 static void set_window_cursor_after_update (struct window *);
 static void adjust_frame_glyphs_for_window_redisplay (struct frame *);
 static void adjust_frame_glyphs_for_frame_redisplay (struct frame *);
@@ -212,7 +214,7 @@
 
 /* 1 means SIGWINCH happened when not safe.  */
 
-int delayed_size_change;
+static int delayed_size_change;
 
 /* 1 means glyph initialization has been completed at startup.  */
 
@@ -234,8 +236,8 @@
 /* Counts of allocated structures.  These counts serve to diagnose
    memory leaks and double frees.  */
 
-int glyph_matrix_count;
-int glyph_pool_count;
+static int glyph_matrix_count;
+static int glyph_pool_count;
 
 /* If non-null, the frame whose frame matrices are manipulated.  If
    null, window matrices are worked on.  */
@@ -383,7 +385,7 @@
    member `pool' of the glyph matrix structure returned is set to
    POOL, the structure is otherwise zeroed.  */
 
-struct glyph_matrix *
+static struct glyph_matrix *
 new_glyph_matrix (struct glyph_pool *pool)
 {
   struct glyph_matrix *result;
@@ -1021,7 +1023,7 @@
    the used count of the text area is zero.  Such rows display line
    ends.  */
 
-void
+static void
 increment_row_positions (struct glyph_row *row,
                         EMACS_INT delta, EMACS_INT delta_bytes)
 {
@@ -3200,21 +3202,6 @@
 }
 
 
-/* This is used when frame_garbaged is set.  Call Fredraw_frame on all
-   visible frames marked as garbaged.  */
-
-void
-redraw_garbaged_frames (void)
-{
-  Lisp_Object tail, frame;
-
-  FOR_EACH_FRAME (tail, frame)
-    if (FRAME_VISIBLE_P (XFRAME (frame))
-       && FRAME_GARBAGED_P (XFRAME (frame)))
-      Fredraw_frame (frame);
-}
-
-
 
 /***********************************************************************
                             Frame Update
@@ -4818,7 +4805,7 @@
 
 /* Do line insertions/deletions on frame F for frame-based redisplay.  */
 
-int
+static int
 scrolling (struct frame *frame)
 {
   int unchanged_at_top, unchanged_at_bottom;

=== modified file 'src/doc.c'
--- a/src/doc.c 2011-04-07 03:34:05 +0000
+++ b/src/doc.c 2011-04-14 19:34:42 +0000
@@ -42,7 +42,9 @@
 static int get_doc_string_buffer_size;
 
 static unsigned char *read_bytecode_pointer;
-Lisp_Object Fsnarf_documentation (Lisp_Object);
+static Lisp_Object Fdocumentation_property (Lisp_Object, Lisp_Object,
+                                           Lisp_Object);
+static Lisp_Object Fsnarf_documentation (Lisp_Object);
 
 /* readchar in lread.c calls back here to fetch the next byte.
    If UNREADFLAG is 1, we unread a byte.  */

=== modified file 'src/editfns.c'
--- a/src/editfns.c     2011-04-09 22:39:14 +0000
+++ b/src/editfns.c     2011-04-14 19:34:42 +0000
@@ -107,8 +107,8 @@
 static void transpose_markers (EMACS_INT, EMACS_INT, EMACS_INT, EMACS_INT,
                               EMACS_INT, EMACS_INT, EMACS_INT, EMACS_INT);
 
-Lisp_Object Qbuffer_access_fontify_functions;
-Lisp_Object Fuser_full_name (Lisp_Object);
+static Lisp_Object Qbuffer_access_fontify_functions;
+static Lisp_Object Fuser_full_name (Lisp_Object);
 
 /* Symbol for the text property used to mark fields.  */
 
@@ -116,7 +116,7 @@
 
 /* A special value for Qfield properties.  */
 
-Lisp_Object Qboundary;
+static Lisp_Object Qboundary;
 
 
 void
@@ -1403,15 +1403,6 @@
     return "";
 }
 
-const char *
-get_operating_system_release (void)
-{
-  if (STRINGP (Voperating_system_release))
-    return SSDATA (Voperating_system_release);
-  else
-    return "";
-}
-
 DEFUN ("emacs-pid", Femacs_pid, Semacs_pid, 0, 0, 0,
        doc: /* Return the process ID of Emacs, as an integer.  */)
   (void)
@@ -3802,7 +3793,7 @@
            if (*format == 'c')
              {
                if (! ASCII_CHAR_P (XINT (args[n]))
-                   /* Note: No one can remeber why we have to treat
+                   /* Note: No one can remember why we have to treat
                       the character 0 as a multibyte character here.
                       But, until it causes a real problem, let's
                       don't change it.  */
@@ -3816,12 +3807,6 @@
                    args[n] = Fchar_to_string (args[n]);
                    thissize = SBYTES (args[n]);
                  }
-               else if (! ASCII_BYTE_P (XINT (args[n])) && multibyte)
-                 {
-                   args[n]
-                     = Fchar_to_string (Funibyte_char_to_multibyte (args[n]));
-                   thissize = SBYTES (args[n]);
-                 }
              }
          }
        else if (FLOATP (args[n]) && *format != 's')

=== modified file 'src/emacs.c'
--- a/src/emacs.c       2011-03-27 02:27:11 +0000
+++ b/src/emacs.c       2011-04-14 05:04:02 +0000
@@ -127,14 +127,14 @@
 #ifdef DOUG_LEA_MALLOC
 /* Preserves a pointer to the memory allocated that copies that
    static data inside glibc's malloc.  */
-void *malloc_state_ptr;
+static void *malloc_state_ptr;
 /* From glibc, a routine that returns a copy of the malloc internal state.  */
 extern void *malloc_get_state (void);
 /* From glibc, a routine that overwrites the malloc internal state.  */
 extern int malloc_set_state (void*);
 /* Non-zero if the MALLOC_CHECK_ environment variable was set while
    dumping.  Used to work around a bug in glibc's malloc.  */
-int malloc_using_checking;
+static int malloc_using_checking;
 #endif
 
 Lisp_Object Qfile_name_handler_alist;
@@ -186,7 +186,7 @@
 int initial_argc;
 
 static void sort_args (int argc, char **argv);
-void syms_of_emacs (void);
+static void syms_of_emacs (void);
 
 /* MSVC needs each string be shorter than 2048 bytes, so the usage
    strings below are split to not overflow this limit.  */
@@ -288,7 +288,7 @@
 
 
 /* Signal code for the fatal signal that was received.  */
-int fatal_error_code;
+static int fatal_error_code;
 
 /* Nonzero if handling a fatal error already.  */
 int fatal_error_in_progress;
@@ -296,7 +296,7 @@
 /* If non-null, call this function from fatal_error_signal before
    committing suicide.  */
 
-void (*fatal_error_signal_hook) (void);
+static void (*fatal_error_signal_hook) (void);
 
 #ifdef FORWARD_SIGNAL_TO_MAIN_THREAD
 /* When compiled with GTK and running under Gnome,
@@ -308,6 +308,9 @@
 
 
 /* Handle bus errors, invalid instruction, etc.  */
+#ifndef FLOAT_CATCH_SIGILL
+static
+#endif
 void
 fatal_error_signal (int sig)
 {
@@ -549,7 +552,8 @@
 
 /* Define a dummy function F.  Declare F too, to pacify gcc
    -Wmissing-prototypes.  */
-#define DEFINE_DUMMY_FUNCTION(f) void f (void); void f (void) {}
+#define DEFINE_DUMMY_FUNCTION(f) \
+  void f (void) EXTERNALLY_VISIBLE; void f (void) {}
 
 #ifndef GCC_CTORS_IN_LIBC
 DEFINE_DUMMY_FUNCTION (__do_global_ctors)
@@ -557,9 +561,9 @@
 DEFINE_DUMMY_FUNCTION (__do_global_dtors)
 /* GNU/Linux has a bug in its library; avoid an error.  */
 #ifndef GNU_LINUX
-char * __CTOR_LIST__[2] = { (char *) (-1), 0 };
+char * __CTOR_LIST__[2] EXTERNALLY_VISIBLE = { (char *) (-1), 0 };
 #endif
-char * __DTOR_LIST__[2] = { (char *) (-1), 0 };
+char * __DTOR_LIST__[2] EXTERNALLY_VISIBLE = { (char *) (-1), 0 };
 #endif /* GCC_CTORS_IN_LIBC */
 DEFINE_DUMMY_FUNCTION (__main)
 #endif /* __GNUC__ */
@@ -1700,7 +1704,7 @@
   int nargs;
 };
 
-const struct standard_args standard_args[] =
+static const struct standard_args standard_args[] =
 {
   { "-version", "--version", 150, 0 },
   { "-chdir", "--chdir", 130, 1 },

=== modified file 'src/eval.c'
--- a/src/eval.c        2011-04-08 23:28:52 +0000
+++ b/src/eval.c        2011-04-14 19:34:42 +0000
@@ -56,9 +56,24 @@
   char debug_on_exit : 1;
 };
 
-struct backtrace *backtrace_list;
+static struct backtrace *backtrace_list;
+
+#if !BYTE_MARK_STACK
+static
+#endif
 struct catchtag *catchlist;
 
+/* Chain of condition handlers currently in effect.
+   The elements of this chain are contained in the stack frames
+   of Fcondition_case and internal_condition_case.
+   When an error is signaled (by calling Fsignal, below),
+   this chain is searched for an element that applies.  */
+
+#if !BYTE_MARK_STACK
+static
+#endif
+struct handler *handlerlist;
+
 #ifdef DEBUG_GCPRO
 /* Count levels of GCPRO to detect failure to UNGCPRO.  */
 int gcpro_level;
@@ -66,12 +81,13 @@
 
 Lisp_Object Qautoload, Qmacro, Qexit, Qinteractive, Qcommandp, Qdefun;
 Lisp_Object Qinhibit_quit;
-Lisp_Object Qand_rest, Qand_optional;
-Lisp_Object Qdebug_on_error;
-Lisp_Object Qdeclare;
+Lisp_Object Qand_rest;
+static Lisp_Object Qand_optional;
+static Lisp_Object Qdebug_on_error;
+static Lisp_Object Qdeclare;
 Lisp_Object Qinternal_interpreter_environment, Qclosure;
 
-Lisp_Object Qdebug;
+static Lisp_Object Qdebug;
 
 /* This holds either the symbol `run-hooks' or nil.
    It is nil at an early stage of startup, and when Emacs
@@ -100,7 +116,7 @@
 
 /* Depth in Lisp evaluations and function calls.  */
 
-EMACS_INT lisp_eval_depth;
+static EMACS_INT lisp_eval_depth;
 
 /* The value of num_nonmacro_input_events as of the last time we
    started to enter the debugger.  If we decide to enter the debugger
@@ -109,7 +125,7 @@
    signal the error instead of entering an infinite loop of debugger
    invocations.  */
 
-int when_entered_debugger;
+static int when_entered_debugger;
 
 /* The function from which the last `signal' was called.  Set in
    Fsignal.  */
@@ -126,6 +142,7 @@
 static void unwind_to_catch (struct catchtag *, Lisp_Object) NO_RETURN;
 static int interactive_p (int);
 static Lisp_Object apply_lambda (Lisp_Object fun, Lisp_Object args);
+static Lisp_Object Ffetch_bytecode (Lisp_Object);
 
 void
 init_eval_once (void)
@@ -1343,14 +1360,6 @@
   return unbind_to (count, val);
 }
 
-/* Chain of condition handlers currently in effect.
-   The elements of this chain are contained in the stack frames
-   of Fcondition_case and internal_condition_case.
-   When an error is signaled (by calling Fsignal, below),
-   this chain is searched for an element that applies.  */
-
-struct handler *handlerlist;
-
 DEFUN ("condition-case", Fcondition_case, Scondition_case, 2, UNEVALLED, 0,
        doc: /* Regain control when an error is signaled.
 Executes BODYFORM and returns its value if no error happens.
@@ -3627,6 +3636,7 @@
 }
 
 
+#if BYTE_MARK_STACK
 void
 mark_backtrace (void)
 {
@@ -3646,8 +3656,7 @@
        mark_object (backlist->args[i]);
     }
 }
-
-EXFUN (Funintern, 2);
+#endif
 
 void
 syms_of_eval (void)

=== modified file 'src/fileio.c'
--- a/src/fileio.c      2011-04-14 07:56:52 +0000
+++ b/src/fileio.c      2011-04-14 20:20:17 +0000
@@ -88,64 +88,66 @@
 #endif
 
 /* Nonzero during writing of auto-save files */
-int auto_saving;
+static int auto_saving;
 
 /* Set by auto_save_1 to mode of original file so Fwrite_region will create
    a new file with the same mode as the original */
-int auto_save_mode_bits;
+static int auto_save_mode_bits;
 
 /* Set by auto_save_1 if an error occurred during the last auto-save. */
-int auto_save_error_occurred;
+static int auto_save_error_occurred;
 
 /* The symbol bound to coding-system-for-read when
    insert-file-contents is called for recovering a file.  This is not
    an actual coding system name, but just an indicator to tell
    insert-file-contents to use `emacs-mule' with a special flag for
    auto saving and recovering a file.  */
-Lisp_Object Qauto_save_coding;
+static Lisp_Object Qauto_save_coding;
 
 /* Property name of a file name handler,
    which gives a list of operations it handles..  */
-Lisp_Object Qoperations;
+static Lisp_Object Qoperations;
 
 /* Lisp functions for translating file formats */
-Lisp_Object Qformat_decode, Qformat_annotate_function;
+static Lisp_Object Qformat_decode, Qformat_annotate_function;
 
 /* Lisp function for setting buffer-file-coding-system and the
    multibyteness of the current buffer after inserting a file.  */
-Lisp_Object Qafter_insert_file_set_coding;
+static Lisp_Object Qafter_insert_file_set_coding;
 
-Lisp_Object Qwrite_region_annotate_functions;
+static Lisp_Object Qwrite_region_annotate_functions;
 /* Each time an annotation function changes the buffer, the new buffer
    is added here.  */
-Lisp_Object Vwrite_region_annotation_buffers;
+static Lisp_Object Vwrite_region_annotation_buffers;
 
 #ifdef HAVE_FSYNC
 #endif
 
-Lisp_Object Qdelete_by_moving_to_trash;
+static Lisp_Object Qdelete_by_moving_to_trash;
 
 /* Lisp function for moving files to trash.  */
-Lisp_Object Qmove_file_to_trash;
+static Lisp_Object Qmove_file_to_trash;
 
 /* Lisp function for recursively copying directories.  */
-Lisp_Object Qcopy_directory;
+static Lisp_Object Qcopy_directory;
 
 /* Lisp function for recursively deleting directories.  */
-Lisp_Object Qdelete_directory;
+static Lisp_Object Qdelete_directory;
 
 #ifdef WINDOWSNT
 #endif
 
-Lisp_Object Qfile_error, Qfile_already_exists, Qfile_date_error;
-Lisp_Object Qexcl;
+Lisp_Object Qfile_error;
+static Lisp_Object Qfile_already_exists, Qfile_date_error;
+static Lisp_Object Qexcl;
 Lisp_Object Qfile_name_history;
 
-Lisp_Object Qcar_less_than_car;
+static Lisp_Object Qcar_less_than_car;
 
+static Lisp_Object Fmake_symbolic_link (Lisp_Object, Lisp_Object, Lisp_Object);
 static int a_write (int, Lisp_Object, EMACS_INT, EMACS_INT,
                     Lisp_Object *, struct coding_system *);
-static int e_write (int, Lisp_Object, EMACS_INT, EMACS_INT, 
+static int e_write (int, Lisp_Object, EMACS_INT, EMACS_INT,
                    struct coding_system *);
 
 
@@ -205,42 +207,43 @@
 }
 
 
-Lisp_Object Qexpand_file_name;
-Lisp_Object Qsubstitute_in_file_name;
-Lisp_Object Qdirectory_file_name;
-Lisp_Object Qfile_name_directory;
-Lisp_Object Qfile_name_nondirectory;
-Lisp_Object Qunhandled_file_name_directory;
-Lisp_Object Qfile_name_as_directory;
-Lisp_Object Qcopy_file;
-Lisp_Object Qmake_directory_internal;
-Lisp_Object Qmake_directory;
-Lisp_Object Qdelete_directory_internal;
+static Lisp_Object Qexpand_file_name;
+static Lisp_Object Qsubstitute_in_file_name;
+static Lisp_Object Qdirectory_file_name;
+static Lisp_Object Qfile_name_directory;
+static Lisp_Object Qfile_name_nondirectory;
+static Lisp_Object Qunhandled_file_name_directory;
+static Lisp_Object Qfile_name_as_directory;
+static Lisp_Object Qcopy_file;
+static Lisp_Object Qmake_directory_internal;
+static Lisp_Object Qmake_directory;
+static Lisp_Object Qdelete_directory_internal;
 Lisp_Object Qdelete_file;
-Lisp_Object Qrename_file;
-Lisp_Object Qadd_name_to_file;
-Lisp_Object Qmake_symbolic_link;
+static Lisp_Object Qrename_file;
+static Lisp_Object Qadd_name_to_file;
+static Lisp_Object Qmake_symbolic_link;
 Lisp_Object Qfile_exists_p;
-Lisp_Object Qfile_executable_p;
-Lisp_Object Qfile_readable_p;
-Lisp_Object Qfile_writable_p;
-Lisp_Object Qfile_symlink_p;
-Lisp_Object Qaccess_file;
+static Lisp_Object Qfile_executable_p;
+static Lisp_Object Qfile_readable_p;
+static Lisp_Object Qfile_writable_p;
+static Lisp_Object Qfile_symlink_p;
+static Lisp_Object Qaccess_file;
 Lisp_Object Qfile_directory_p;
-Lisp_Object Qfile_regular_p;
-Lisp_Object Qfile_accessible_directory_p;
-Lisp_Object Qfile_modes;
-Lisp_Object Qset_file_modes;
-Lisp_Object Qset_file_times;
-Lisp_Object Qfile_selinux_context;
-Lisp_Object Qset_file_selinux_context;
-Lisp_Object Qfile_newer_than_file_p;
+static Lisp_Object Qfile_regular_p;
+static Lisp_Object Qfile_accessible_directory_p;
+static Lisp_Object Qfile_modes;
+static Lisp_Object Qset_file_modes;
+static Lisp_Object Qset_file_times;
+static Lisp_Object Qfile_selinux_context;
+static Lisp_Object Qset_file_selinux_context;
+static Lisp_Object Qfile_newer_than_file_p;
 Lisp_Object Qinsert_file_contents;
 Lisp_Object Qwrite_region;
-Lisp_Object Qverify_visited_file_modtime;
-Lisp_Object Qset_visited_file_modtime;
+static Lisp_Object Qverify_visited_file_modtime;
+static Lisp_Object Qset_visited_file_modtime;
 
-DEFUN ("find-file-name-handler", Ffind_file_name_handler, 
Sfind_file_name_handler, 2, 2, 0,
+DEFUN ("find-file-name-handler", Ffind_file_name_handler,
+       Sfind_file_name_handler, 2, 2, 0,
        doc: /* Return FILENAME's handler function for OPERATION, if it has one.
 Otherwise, return nil.
 A file name is handled if one of the regular expressions in
@@ -2633,7 +2636,8 @@
   return S_ISDIR (st.st_mode) ? Qt : Qnil;
 }
 
-DEFUN ("file-accessible-directory-p", Ffile_accessible_directory_p, 
Sfile_accessible_directory_p, 1, 1, 0,
+DEFUN ("file-accessible-directory-p", Ffile_accessible_directory_p,
+       Sfile_accessible_directory_p, 1, 1, 0,
        doc: /* Return t if file FILENAME names a directory you can open.
 For the value to be t, FILENAME must specify the name of a directory as a file,
 and the directory must allow you to open files in it.  In order to use a

=== modified file 'src/fns.c'
--- a/src/fns.c 2011-04-07 03:34:05 +0000
+++ b/src/fns.c 2011-04-14 05:04:02 +0000
@@ -49,11 +49,12 @@
 #define NULL ((POINTER_TYPE *)0)
 #endif
 
-Lisp_Object Qstring_lessp, Qprovide, Qrequire;
-Lisp_Object Qyes_or_no_p_history;
+Lisp_Object Qstring_lessp;
+static Lisp_Object Qprovide, Qrequire;
+static Lisp_Object Qyes_or_no_p_history;
 Lisp_Object Qcursor_in_echo_area;
-Lisp_Object Qwidget_type;
-Lisp_Object Qcodeset, Qdays, Qmonths, Qpaper;
+static Lisp_Object Qwidget_type;
+static Lisp_Object Qcodeset, Qdays, Qmonths, Qpaper;
 
 static int internal_equal (Lisp_Object , Lisp_Object, int, int);
 
@@ -2541,7 +2542,7 @@
   return ret;
 }
 
-Lisp_Object Qsubfeatures;
+static Lisp_Object Qsubfeatures;
 
 DEFUN ("featurep", Ffeaturep, Sfeaturep, 1, 2, 0,
        doc: /* Return t if FEATURE is present in this Emacs.
@@ -3350,13 +3351,14 @@
 
 /* The list of all weak hash tables.  Don't staticpro this one.  */
 
-struct Lisp_Hash_Table *weak_hash_tables;
+static struct Lisp_Hash_Table *weak_hash_tables;
 
 /* Various symbols.  */
 
-Lisp_Object Qhash_table_p, Qeq, Qeql, Qequal, Qkey, Qvalue;
+static Lisp_Object Qhash_table_p, Qkey, Qvalue;
+Lisp_Object Qeq, Qeql, Qequal;
 Lisp_Object QCtest, QCsize, QCrehash_size, QCrehash_threshold, QCweakness;
-Lisp_Object Qhash_table_test, Qkey_or_value, Qkey_and_value;
+static Lisp_Object Qhash_table_test, Qkey_or_value, Qkey_and_value;
 
 /* Function prototypes.  */
 

=== modified file 'src/font.c'
--- a/src/font.c        2011-04-04 06:29:11 +0000
+++ b/src/font.c        2011-04-14 05:04:02 +0000
@@ -48,7 +48,7 @@
 #include "nsterm.h"
 #endif /* HAVE_NS */
 
-Lisp_Object Qopentype;
+static Lisp_Object Qopentype;
 
 /* Important character set strings.  */
 Lisp_Object Qascii_0, Qiso8859_1, Qiso10646_1, Qunicode_bmp, Qunicode_sip;
@@ -125,14 +125,16 @@
 static Lisp_Object QCadstyle, QCregistry;
 /* Symbols representing keys of font extra info.  */
 Lisp_Object QCspacing, QCdpi, QCscalable, QCotf, QClang, QCscript, QCavgwidth;
-Lisp_Object QCantialias, QCfont_entity, QCfc_unknown_spec;
+Lisp_Object QCantialias, QCfont_entity;
+static Lisp_Object QCfc_unknown_spec;
 /* Symbols representing values of font spacing property.  */
-Lisp_Object Qc, Qm, Qp, Qd;
+static Lisp_Object Qc, Qm, Qd;
+Lisp_Object Qp;
 /* Special ADSTYLE properties to avoid fonts used for Latin
    characters; used in xfont.c and ftfont.c.  */
 Lisp_Object Qja, Qko;
 
-Lisp_Object QCuser_spec;
+static Lisp_Object QCuser_spec;
 
 /* Alist of font registry symbol and the corresponding charsets
    information.  The information is retrieved from
@@ -2725,7 +2727,7 @@
              val = null_vector;
            else
              val = Fvconcat (1, &val);
-           copy = Fcopy_font_spec (scratch_font_spec);
+           copy = copy_font_spec (scratch_font_spec);
            ASET (copy, FONT_TYPE_INDEX, driver_list->driver->type);
            XSETCDR (cache, Fcons (Fcons (copy, val), XCDR (cache)));
          }
@@ -2753,7 +2755,7 @@
   struct font_driver_list *driver_list = f->font_driver_list;
   Lisp_Object ftype, size, entity;
   Lisp_Object frame;
-  Lisp_Object work = Fcopy_font_spec (spec);
+  Lisp_Object work = copy_font_spec (spec);
 
   XSETFRAME (frame, f);
   ftype = AREF (spec, FONT_TYPE_INDEX);
@@ -2780,7 +2782,7 @@
        else
          {
            entity = driver_list->driver->match (frame, work);
-           copy = Fcopy_font_spec (work);
+           copy = copy_font_spec (work);
            ASET (copy, FONT_TYPE_INDEX, driver_list->driver->type);
            XSETCDR (cache, Fcons (Fcons (copy, entity), XCDR (cache)));
          }
@@ -2870,7 +2872,7 @@
 
 /* Close FONT_OBJECT that is opened on frame F.  */
 
-void
+static void
 font_close_object (FRAME_PTR f, Lisp_Object font_object)
 {
   struct font *font = XFONT_OBJECT (font_object);
@@ -2974,7 +2976,7 @@
 
   if (! NILP (Ffont_get (font, QCname)))
     {
-      font = Fcopy_font_spec (font);
+      font = copy_font_spec (font);
       font_put_extra (font, QCname, Qnil);
     }
 
@@ -2985,7 +2987,7 @@
       && prop != FONT_SIZE_INDEX)
     return;
   if (EQ (font, attrs[LFACE_FONT_INDEX]))
-    font = Fcopy_font_spec (font);
+    font = copy_font_spec (font);
   ASET (font, prop, Qnil);
   if (prop == FONT_FAMILY_INDEX || prop == FONT_FOUNDRY_INDEX)
     {
@@ -3096,7 +3098,7 @@
        return Qnil;
     }
 
-  work = Fcopy_font_spec (spec);
+  work = copy_font_spec (spec);
   ASET (work, FONT_TYPE_INDEX, AREF (spec, FONT_TYPE_INDEX));
   XSETFRAME (frame, f);
   pixel_size = font_pixel_size (f, spec);
@@ -3866,9 +3868,9 @@
   return spec;
 }
 
-DEFUN ("copy-font-spec", Fcopy_font_spec, Scopy_font_spec, 1, 1, 0,
-       doc: /* Return a copy of FONT as a font-spec.  */)
-  (Lisp_Object font)
+/* Return a copy of FONT as a font-spec.  */
+Lisp_Object
+copy_font_spec (Lisp_Object font)
 {
   Lisp_Object new_spec, tail, prev, extra;
   int i;
@@ -3892,18 +3894,18 @@
   return new_spec;
 }
 
-DEFUN ("merge-font-spec", Fmerge_font_spec, Smerge_font_spec, 2, 2, 0,
-       doc: /* Merge font-specs FROM and TO, and return a new font-spec.
-Every specified properties in FROM override the corresponding
-properties in TO.  */)
-  (Lisp_Object from, Lisp_Object to)
+/* Merge font-specs FROM and TO, and return a new font-spec.
+   Every specified property in FROM overrides the corresponding
+   property in TO.  */
+Lisp_Object
+merge_font_spec (Lisp_Object from, Lisp_Object to)
 {
   Lisp_Object extra, tail;
   int i;
 
   CHECK_FONT (from);
   CHECK_FONT (to);
-  to = Fcopy_font_spec (to);
+  to = copy_font_spec (to);
   for (i = 0; i < FONT_EXTRA_INDEX; i++)
     ASET (to, i, AREF (from, i));
   extra = AREF (to, FONT_EXTRA_INDEX);

=== modified file 'src/font.h'
--- a/src/font.h        2011-01-25 04:08:28 +0000
+++ b/src/font.h        2011-04-13 23:22:35 +0000
@@ -239,7 +239,7 @@
   ASET ((font), prop, make_number (font_style_to_value (prop, val, 1)))
 
 extern Lisp_Object QCspacing, QCdpi, QCscalable, QCotf, QClang, QCscript;
-extern Lisp_Object QCavgwidth, QCantialias, QCfont_entity, QCfc_unknown_spec;
+extern Lisp_Object QCavgwidth, QCantialias, QCfont_entity;
 extern Lisp_Object Qp;
 
 
@@ -737,8 +737,8 @@
 };
 
 EXFUN (Ffont_spec, MANY);
-EXFUN (Fcopy_font_spec, 1);
-EXFUN (Fmerge_font_spec, 2);
+extern Lisp_Object copy_font_spec (Lisp_Object);
+extern Lisp_Object merge_font_spec (Lisp_Object, Lisp_Object);
 EXFUN (Ffont_get, 2);
 EXFUN (Ffont_put, 3);
 EXFUN (Flist_fonts, 4);
@@ -779,7 +779,6 @@
 
 extern Lisp_Object font_open_by_spec (FRAME_PTR f, Lisp_Object spec);
 extern Lisp_Object font_open_by_name (FRAME_PTR f, const char *name);
-extern void font_close_object (FRAME_PTR f, Lisp_Object font_object);
 
 extern Lisp_Object font_intern_prop (const char *str, int len, int 
force_symbol);
 extern void font_update_sort_order (int *order);
@@ -821,13 +820,14 @@
 #endif /* HAVE_FREETYPE */
 #ifdef HAVE_X_WINDOWS
 extern struct font_driver xfont_driver;
-extern struct font_driver ftxfont_driver;
 extern void syms_of_xfont (void);
 extern void syms_of_ftxfont (void);
 #ifdef HAVE_XFT
 extern struct font_driver xftfont_driver;
 extern void syms_of_xftfont (void);
-#endif /* HAVE_XFT */
+#elif defined HAVE_FREETYPE
+extern struct font_driver ftxfont_driver;
+#endif
 #ifdef HAVE_BDFFONT
 extern void syms_of_bdffont (void);
 #endif /* HAVE_BDFFONT */
@@ -871,4 +871,3 @@
 #endif /* not FONT_DEBUG */
 
 #endif /* not EMACS_FONT_H */
-

=== modified file 'src/fontset.c'
--- a/src/fontset.c     2011-04-02 02:25:18 +0000
+++ b/src/fontset.c     2011-04-14 05:04:02 +0000
@@ -238,7 +238,7 @@
 /* Macros to access special values of (realized) FONTSET.  */
 #define FONTSET_BASE(fontset)          XCHAR_TABLE (fontset)->extras[2]
 #define FONTSET_FRAME(fontset)         XCHAR_TABLE (fontset)->extras[3]
-#define FONTSET_OBJLIST(fontset)       XCHAR_TABLE (fontset)->extras[4]
+/* #define FONTSET_OBJLIST(fontset)    XCHAR_TABLE (fontset)->extras[4] */
 #define FONTSET_NOFONT_FACE(fontset)   XCHAR_TABLE (fontset)->extras[5]
 /* #define FONTSET_REPERTORY(fontset)  XCHAR_TABLE (fontset)->extras[6] */
 #define FONTSET_DEFAULT(fontset)       XCHAR_TABLE (fontset)->extras[7]
@@ -838,6 +838,7 @@
 static void
 free_realized_fontset (FRAME_PTR f, Lisp_Object fontset)
 {
+#if 0
   Lisp_Object tail;
 
   if (0)
@@ -846,6 +847,7 @@
        xassert (FONT_OBJECT_P (XCAR (tail)));
        font_close_object (f, XCAR (tail));
       }
+#endif
 }
 
 /* Free fontset of FACE defined on frame F.  Called from
@@ -881,6 +883,7 @@
 }
 
 
+#if 0
 /* Return 1 if FACE is suitable for displaying character C.
    Otherwise return 0.  Called from the macro FACE_SUITABLE_FOR_CHAR_P
    when C is not an ASCII character.  */
@@ -896,6 +899,7 @@
          && INTEGERP (RFONT_DEF_FACE (rfont_def))
          && face->id == XINT (RFONT_DEF_FACE (rfont_def)));
 }
+#endif
 
 
 /* Return ID of face suitable for displaying character C on frame F.
@@ -1709,7 +1713,7 @@
 fontset_from_font (Lisp_Object font_object)
 {
   Lisp_Object font_name = font_get_name (font_object);
-  Lisp_Object font_spec = Fcopy_font_spec (font_object);
+  Lisp_Object font_spec = copy_font_spec (font_object);
   Lisp_Object registry = AREF (font_spec, FONT_REGISTRY_INDEX);
   Lisp_Object fontset_spec, alias, name, fontset;
   Lisp_Object val;
@@ -1726,7 +1730,7 @@
       sprintf (temp, "fontset-auto%d", num_auto_fontsets - 1);
       alias = intern (temp);
     }
-  fontset_spec = Fcopy_font_spec (font_spec);
+  fontset_spec = copy_font_spec (font_spec);
   ASET (fontset_spec, FONT_REGISTRY_INDEX, alias);
   name = Ffont_xlfd_name (fontset_spec, Qnil);
   if (NILP (name))

=== modified file 'src/fontset.h'
--- a/src/fontset.h     2011-01-25 04:08:28 +0000
+++ b/src/fontset.h     2011-04-13 23:22:35 +0000
@@ -32,7 +32,6 @@
 struct face;
 
 extern void free_face_fontset (FRAME_PTR, struct face *);
-extern int face_suitable_for_char_p (struct face *, int);
 extern int face_for_char (FRAME_PTR, struct face *, int,
                           int, Lisp_Object);
 extern Lisp_Object font_for_char (struct face *, int, int, Lisp_Object);
@@ -51,4 +50,3 @@
 extern int face_for_font (struct frame *, Lisp_Object, struct face *);
 
 #endif /* EMACS_FONTSET_H */
-

=== modified file 'src/frame.c'
--- a/src/frame.c       2011-03-27 02:12:36 +0000
+++ b/src/frame.c       2011-04-14 05:04:02 +0000
@@ -69,10 +69,10 @@
 Lisp_Object Qx, Qw32, Qmac, Qpc, Qns;
 Lisp_Object Qvisible;
 Lisp_Object Qdisplay_type;
-Lisp_Object Qbackground_mode;
+static Lisp_Object Qbackground_mode;
 Lisp_Object Qnoelisp;
 
-Lisp_Object Qx_frame_parameter;
+static Lisp_Object Qx_frame_parameter;
 Lisp_Object Qx_resource_name;
 Lisp_Object Qterminal;
 Lisp_Object Qterminal_live_p;
@@ -82,7 +82,7 @@
 Lisp_Object Qauto_raise, Qauto_lower;
 Lisp_Object Qborder_color, Qborder_width;
 Lisp_Object Qcursor_color, Qcursor_type;
-Lisp_Object Qgeometry;  /* Not used */
+static Lisp_Object Qgeometry;  /* Not used */
 Lisp_Object Qheight, Qwidth;
 Lisp_Object Qleft, Qright;
 Lisp_Object Qicon_left, Qicon_top, Qicon_type, Qicon_name;
@@ -95,19 +95,20 @@
 Lisp_Object Qscroll_bar_foreground, Qscroll_bar_background;
 Lisp_Object Qscreen_gamma;
 Lisp_Object Qline_spacing;
-Lisp_Object Quser_position, Quser_size;
+static Lisp_Object Quser_position, Quser_size;
 Lisp_Object Qwait_for_wm;
-Lisp_Object Qwindow_id;
+static Lisp_Object Qwindow_id;
 #ifdef HAVE_X_WINDOWS
-Lisp_Object Qouter_window_id;
+static Lisp_Object Qouter_window_id;
 #endif
 Lisp_Object Qparent_id;
 Lisp_Object Qtitle, Qname;
-Lisp_Object Qexplicit_name;
+static Lisp_Object Qexplicit_name;
 Lisp_Object Qunsplittable;
 Lisp_Object Qmenu_bar_lines, Qtool_bar_lines, Qtool_bar_position;
 Lisp_Object Qleft_fringe, Qright_fringe;
-Lisp_Object Qbuffer_predicate, Qbuffer_list, Qburied_buffer_list;
+Lisp_Object Qbuffer_predicate;
+static Lisp_Object Qbuffer_list, Qburied_buffer_list;
 Lisp_Object Qtty_color_mode;
 Lisp_Object Qtty, Qtty_type;
 
@@ -120,6 +121,10 @@
 
 static Lisp_Object Qdelete_frame_functions;
 
+#ifdef HAVE_WINDOW_SYSTEM
+static void x_report_frame_params (struct frame *, Lisp_Object *);
+#endif
+
 
 static void
 set_menu_bar_lines_1 (Lisp_Object window, int n)
@@ -548,7 +553,7 @@
 }
 
 
-struct frame *
+static struct frame *
 make_terminal_frame (struct terminal *terminal)
 {
   register struct frame *f;
@@ -2077,6 +2082,9 @@
 
 /* Return the value of frame parameter PROP in frame FRAME.  */
 
+#if !HAVE_NS
+static
+#endif
 Lisp_Object
 get_frame_param (register struct frame *frame, Lisp_Object prop)
 {
@@ -2832,7 +2840,7 @@
   {"tool-bar-position",                &Qtool_bar_position},
 };
 
-#ifdef HAVE_WINDOW_SYSTEM
+#ifdef WINDOWSNT
 
 /* Calculate fullscreen size.  Return in *TOP_POS and *LEFT_POS the
    wanted positions of the WM window (not Emacs window).
@@ -2876,6 +2884,9 @@
   *height = newheight;
 }
 
+#endif /* WINDOWSNT */
+
+#ifdef HAVE_WINDOW_SYSTEM
 
 /* Change the parameters of frame F as specified by ALIST.
    If a parameter is not specially recognized, do nothing special;
@@ -3834,31 +3845,6 @@
                            attribute, class, component, subclass);
 }
 
-#if defined HAVE_X_WINDOWS && !defined USE_X_TOOLKIT
-/* Used when C code wants a resource value.  */
-/* Called from oldXMenu/Create.c.  */
-char *
-x_get_resource_string (const char *attribute, const char *class)
-{
-  char *name_key;
-  char *class_key;
-  struct frame *sf = SELECTED_FRAME ();
-
-  /* Allocate space for the components, the dots which separate them,
-     and the final '\0'.  */
-  name_key = (char *) alloca (SBYTES (Vinvocation_name)
-                             + strlen (attribute) + 2);
-  class_key = (char *) alloca ((sizeof (EMACS_CLASS) - 1)
-                              + strlen (class) + 2);
-
-  sprintf (name_key, "%s.%s", SDATA (Vinvocation_name), attribute);
-  sprintf (class_key, "%s.%s", EMACS_CLASS, class);
-
-  return x_get_string_resource (FRAME_X_DISPLAY_INFO (sf)->xrdb,
-                               name_key, class_key);
-}
-#endif
-
 /* Return the value of parameter PARAM.
 
    First search ALIST, then Vdefault_frame_alist, then the X defaults

=== modified file 'src/frame.h'
--- a/src/frame.h       2011-02-27 07:30:02 +0000
+++ b/src/frame.h       2011-04-13 23:35:33 +0000
@@ -31,11 +31,6 @@
 /* Nonzero means there is at least one garbaged frame. */
 extern int frame_garbaged;
 
-/* Nonzero means FRAME_MESSAGE_BUF (selected_frame) is being used by
-   print.  */
-
-extern int message_buf_print;
-
 
 /* The structure representing a frame.  */
 
@@ -843,7 +838,6 @@
 
 extern void set_menu_bar_lines (struct frame *, Lisp_Object, Lisp_Object);
 extern struct frame *make_initial_frame (void);
-extern struct frame *make_terminal_frame (struct terminal *);
 extern struct frame *make_frame (int);
 #ifdef HAVE_WINDOW_SYSTEM
 extern struct frame *make_minibuffer_frame (void);
@@ -1047,7 +1041,7 @@
 
 extern Lisp_Object Qauto_raise, Qauto_lower;
 extern Lisp_Object Qborder_color, Qborder_width;
-extern Lisp_Object Qbuffer_predicate, Qbuffer_list, Qburied_buffer_list;
+extern Lisp_Object Qbuffer_predicate;
 extern Lisp_Object Qcursor_color, Qcursor_type;
 extern Lisp_Object Qfont;
 extern Lisp_Object Qbackground_color, Qforeground_color;
@@ -1076,7 +1070,6 @@
 extern Lisp_Object Qx, Qw32, Qmac, Qpc, Qns;
 extern Lisp_Object Qvisible;
 extern Lisp_Object Qdisplay_type;
-extern Lisp_Object Qbackground_mode;
 
 extern Lisp_Object Qx_resource_name;
 
@@ -1101,11 +1094,12 @@
 
 extern Lisp_Object Qface_set_after_frame_default;
 
+#ifdef WINDOWSNT
 extern void x_fullscreen_adjust (struct frame *f, int *, int *,
                                  int *, int *);
+#endif
 
 extern void x_set_frame_parameters (struct frame *, Lisp_Object);
-extern void x_report_frame_params (struct frame *, Lisp_Object *);
 
 extern void x_set_fullscreen (struct frame *, Lisp_Object, Lisp_Object);
 extern void x_set_line_spacing (struct frame *, Lisp_Object, Lisp_Object);
@@ -1139,10 +1133,6 @@
                                           Lisp_Object component,
                                           Lisp_Object subclass);
 
-#if defined HAVE_X_WINDOWS && !defined USE_X_TOOLKIT
-extern char *x_get_resource_string (const char *, const char *);
-#endif
-
 /* In xmenu.c */
 extern void set_frame_menubar (FRAME_PTR, int, int);
 

=== modified file 'src/fringe.c'
--- a/src/fringe.c      2011-03-12 19:19:47 +0000
+++ b/src/fringe.c      2011-04-13 23:38:13 +0000
@@ -64,9 +64,9 @@
    must specify physical bitmap symbols.
 */
 
-Lisp_Object Qtruncation, Qcontinuation, Qoverlay_arrow;
-Lisp_Object Qempty_line, Qtop_bottom;
-Lisp_Object Qhollow_small;
+static Lisp_Object Qtruncation, Qcontinuation, Qoverlay_arrow;
+static Lisp_Object Qempty_line, Qtop_bottom;
+static Lisp_Object Qhollow_small;
 
 enum fringe_bitmap_align
 {
@@ -427,7 +427,7 @@
 /* NOTE:  The order of these bitmaps must match the sequence
    used in fringe.el to define the corresponding symbols.  */
 
-struct fringe_bitmap standard_bitmaps[] =
+static struct fringe_bitmap standard_bitmaps[] =
 {
   { NULL, 0, 0, 0, 0, 0 }, /* NO_FRINGE_BITMAP */
   { FRBITS (question_mark_bits),      8, 0, ALIGN_BITMAP_CENTER, 0 },
@@ -462,6 +462,9 @@
 static Lisp_Object *fringe_faces;
 static int max_fringe_bitmaps;
 
+#ifndef HAVE_NS
+static
+#endif
 int max_used_fringe_bitmap = MAX_STANDARD_FRINGE_BITMAPS;
 
 

=== modified file 'src/ftfont.c'
--- a/src/ftfont.c      2011-04-09 19:14:12 +0000
+++ b/src/ftfont.c      2011-04-11 03:39:45 +0000
@@ -39,7 +39,7 @@
 #include "ftfont.h"
 
 /* Symbolic type of this font-driver.  */
-Lisp_Object Qfreetype;
+static Lisp_Object Qfreetype;
 
 /* Fontconfig's generic families and their aliases.  */
 static Lisp_Object Qmonospace, Qsans_serif, Qserif, Qmono, Qsans, Qsans__serif;

=== modified file 'src/ftxfont.c'
--- a/src/ftxfont.c     2011-01-25 04:08:28 +0000
+++ b/src/ftxfont.c     2011-04-12 08:42:29 +0000
@@ -38,6 +38,11 @@
 
 static Lisp_Object Qftx;
 
+#if defined HAVE_XFT || !defined HAVE_FREETYPE
+static
+#endif
+struct font_driver ftxfont_driver;
+
 /* Prototypes for helper function.  */
 static GC *ftxfont_get_gcs (FRAME_PTR, unsigned long, unsigned long);
 static int ftxfont_draw_bitmap (FRAME_PTR, GC, GC *, struct font *,
@@ -233,13 +238,11 @@
 static void ftxfont_close (FRAME_PTR, struct font *);
 static int ftxfont_draw (struct glyph_string *, int, int, int, int, int);
 
-struct font_driver ftxfont_driver;
-
 static Lisp_Object
 ftxfont_list (Lisp_Object frame, Lisp_Object spec)
 {
   Lisp_Object list = ftfont_driver.list (frame, spec), tail;
-  
+
   for (tail = list; CONSP (tail); tail = XCDR (tail))
     ASET (XCAR (tail), FONT_TYPE_INDEX, Qftx);
   return list;
@@ -350,13 +353,13 @@
 ftxfont_end_for_frame (FRAME_PTR f)
 {
   struct ftxfont_frame_data *data = font_get_frame_data (f, &ftxfont_driver);
-  
+
   BLOCK_INPUT;
   while (data)
     {
       struct ftxfont_frame_data *next = data->next;
       int i;
-      
+
       for (i = 0; i < 6; i++)
        XFreeGC (FRAME_X_DISPLAY (f), data->gcs[i]);
       free (data);
@@ -384,4 +387,3 @@
   ftxfont_driver.end_for_frame = ftxfont_end_for_frame;
   register_font_driver (&ftxfont_driver, NULL);
 }
-

=== modified file 'src/image.c'
--- a/src/image.c       2011-04-09 20:28:01 +0000
+++ b/src/image.c       2011-04-14 19:34:42 +0000
@@ -124,7 +124,7 @@
 
 /* The symbol `postscript' identifying images of this type.  */
 
-Lisp_Object Qpostscript;
+static Lisp_Object Qpostscript;
 
 static void x_disable_image (struct frame *, struct image *);
 static void x_edge_detection (struct frame *, struct image *, Lisp_Object,
@@ -137,6 +137,7 @@
 static unsigned long *colors_in_color_table (int *n);
 static unsigned long lookup_pixel_color (struct frame *f, unsigned long p);
 #endif
+static Lisp_Object Finit_image_library (Lisp_Object, Lisp_Object);
 
 /* Code to deal with bitmaps.  Bitmaps are referenced by their bitmap
    id, which is just an int that this section returns.  Bitmaps are
@@ -561,17 +562,21 @@
 
 /* The symbol `xbm' which is used as the type symbol for XBM images.  */
 
-Lisp_Object Qxbm;
+static Lisp_Object Qxbm;
 
 /* Keywords.  */
 
-Lisp_Object QCascent, QCmargin, QCrelief, Qcount, Qextension_data;
-Lisp_Object QCconversion, QCcolor_symbols, QCheuristic_mask;
-Lisp_Object QCindex, QCmatrix, QCcolor_adjustment, QCmask, QCgeometry, QCcrop, 
QCrotation;
+Lisp_Object QCascent, QCmargin, QCrelief;
+static Lisp_Object Qcount, Qextension_data;
+Lisp_Object QCconversion;
+static Lisp_Object QCheuristic_mask;
+static Lisp_Object QCcolor_symbols;
+static Lisp_Object QCindex, QCmatrix, QCcolor_adjustment, QCmask, QCgeometry;
+static Lisp_Object QCcrop, QCrotation;
 
 /* Other symbols.  */
 
-Lisp_Object Qlaplace, Qemboss, Qedge_detection, Qheuristic;
+static Lisp_Object Qlaplace, Qemboss, Qedge_detection, Qheuristic;
 
 /* Function prototypes.  */
 
@@ -3000,7 +3005,7 @@
 #if defined (HAVE_XPM) || defined (HAVE_NS)
 /* The symbol `xpm' identifying XPM-format images.  */
 
-Lisp_Object Qxpm;
+static Lisp_Object Qxpm;
 
 /* Indices of image specification fields in xpm_format, below.  */
 
@@ -3091,7 +3096,7 @@
    size.  */
 
 #define XPM_COLOR_CACHE_BUCKETS        1001
-struct xpm_cached_color **xpm_color_cache;
+static struct xpm_cached_color **xpm_color_cache;
 
 /* Initialize the color cache.  */
 
@@ -3307,7 +3312,7 @@
 
 #endif /* HAVE_XPM || HAVE_NS */
 
-#if defined (HAVE_XPM) && defined (HAVE_X_WINDOWS)
+#if defined HAVE_XPM && defined HAVE_X_WINDOWS && !defined USE_GTK
 int
 x_create_bitmap_from_xpm_data (struct frame *f, const char **bits)
 {
@@ -4131,11 +4136,11 @@
 
 /* The color hash table.  */
 
-struct ct_color **ct_table;
+static struct ct_color **ct_table;
 
 /* Number of entries in the color table.  */
 
-int ct_colors_allocated;
+static int ct_colors_allocated;
 
 /* Initialize the color table.  */
 
@@ -4924,7 +4929,7 @@
 
 /* The symbol `pbm' identifying images of this type.  */
 
-Lisp_Object Qpbm;
+static Lisp_Object Qpbm;
 
 /* Indices of image specification fields in gs_format, below.  */
 
@@ -5341,7 +5346,7 @@
 
 /* The symbol `png' identifying images of this type.  */
 
-Lisp_Object Qpng;
+static Lisp_Object Qpng;
 
 /* Indices of image specification fields in png_format, below.  */
 
@@ -5955,7 +5960,7 @@
 
 /* The symbol `jpeg' identifying images of this type.  */
 
-Lisp_Object Qjpeg;
+static Lisp_Object Qjpeg;
 
 /* Indices of image specification fields in gs_format, below.  */
 
@@ -6504,7 +6509,7 @@
 
 /* The symbol `tiff' identifying images of this type.  */
 
-Lisp_Object Qtiff;
+static Lisp_Object Qtiff;
 
 /* Indices of image specification fields in tiff_format, below.  */
 
@@ -6932,7 +6937,7 @@
 
 /* The symbol `gif' identifying images of this type.  */
 
-Lisp_Object Qgif;
+static Lisp_Object Qgif;
 
 /* Indices of image specification fields in gif_format, below.  */
 
@@ -8301,7 +8306,7 @@
 
 /* Keyword symbols.  */
 
-Lisp_Object QCloader, QCbounding_box, QCpt_width, QCpt_height;
+static Lisp_Object QCloader, QCbounding_box, QCpt_width, QCpt_height;
 
 /* Indices of image specification fields in gs_format, below.  */
 

=== modified file 'src/indent.c'
--- a/src/indent.c      2011-04-03 01:00:03 +0000
+++ b/src/indent.c      2011-04-14 05:04:02 +0000
@@ -1044,7 +1044,7 @@
 
 /* compute_motion: compute buffer posn given screen posn and vice versa */
 
-struct position val_compute_motion;
+static struct position val_compute_motion;
 
 /* Scan the current buffer forward from offset FROM, pretending that
    this is at line FROMVPOS, column FROMHPOS, until reaching buffer
@@ -1818,7 +1818,7 @@
 
 /* Fvertical_motion and vmotion */
 
-struct position val_vmotion;
+static struct position val_vmotion;
 
 struct position *
 vmotion (register EMACS_INT from, register EMACS_INT vtarget, struct window *w)

=== modified file 'src/insdel.c'
--- a/src/insdel.c      2011-03-26 01:23:15 +0000
+++ b/src/insdel.c      2011-04-14 19:34:42 +0000
@@ -48,7 +48,7 @@
                                        EMACS_INT, EMACS_INT, EMACS_INT);
 static void adjust_point (EMACS_INT nchars, EMACS_INT nbytes);
 
-Lisp_Object Fcombine_after_change_execute (void);
+static Lisp_Object Fcombine_after_change_execute (void);
 
 /* List of elements of the form (BEG-UNCHANGED END-UNCHANGED CHANGE-AMOUNT)
    describing changes which happened while combine_after_change_calls
@@ -60,12 +60,14 @@
    END-UNCHANGED is the number of chars after the changed range,
    and CHANGE-AMOUNT is the number of characters inserted by the change
    (negative for a deletion).  */
-Lisp_Object combine_after_change_list;
+static Lisp_Object combine_after_change_list;
 
 /* Buffer which combine_after_change_list is about.  */
-Lisp_Object combine_after_change_buffer;
+static Lisp_Object combine_after_change_buffer;
 
 Lisp_Object Qinhibit_modification_hooks;
+
+static void signal_before_change (EMACS_INT, EMACS_INT, EMACS_INT *);
 
 #define CHECK_MARKERS()                                \
   do                                           \
@@ -1222,7 +1224,7 @@
 
    PREV_TEXT nil means the new text was just inserted.  */
 
-void
+static void
 adjust_after_replace (EMACS_INT from, EMACS_INT from_byte,
                      Lisp_Object prev_text, EMACS_INT len, EMACS_INT len_byte)
 {
@@ -1285,58 +1287,6 @@
   CHARS_MODIFF = MODIFF;
 }
 
-/* Like adjust_after_replace, but doesn't require PREV_TEXT.
-   This is for use when undo is not enabled in the current buffer.  */
-
-void
-adjust_after_replace_noundo (EMACS_INT from, EMACS_INT from_byte,
-                            EMACS_INT nchars_del, EMACS_INT nbytes_del,
-                            EMACS_INT len, EMACS_INT len_byte)
-{
-#ifdef BYTE_COMBINING_DEBUG
-  if (count_combining_before (GPT_ADDR, len_byte, from, from_byte)
-      || count_combining_after (GPT_ADDR, len_byte, from, from_byte))
-    abort ();
-#endif
-
-  /* Update various buffer positions for the new text.  */
-  GAP_SIZE -= len_byte;
-  ZV += len; Z+= len;
-  ZV_BYTE += len_byte; Z_BYTE += len_byte;
-  GPT += len; GPT_BYTE += len_byte;
-  if (GAP_SIZE > 0) *(GPT_ADDR) = 0; /* Put an anchor. */
-
-  if (nchars_del > 0)
-    adjust_markers_for_replace (from, from_byte, nchars_del, nbytes_del,
-                               len, len_byte);
-  else
-    adjust_markers_for_insert (from, from_byte,
-                              from + len, from_byte + len_byte, 0);
-
-  if (len > nchars_del)
-    adjust_overlays_for_insert (from, len - nchars_del);
-  else if (len < nchars_del)
-    adjust_overlays_for_delete (from, nchars_del - len);
-  if (BUF_INTERVALS (current_buffer) != 0)
-    {
-      offset_intervals (current_buffer, from, len - nchars_del);
-    }
-
-  if (from < PT)
-    adjust_point (len - nchars_del, len_byte - nbytes_del);
-
-  /* As byte combining will decrease Z, we must check this again. */
-  if (Z - GPT < END_UNCHANGED)
-    END_UNCHANGED = Z - GPT;
-
-  CHECK_MARKERS ();
-
-  if (len == 0)
-    evaporate_overlays (from);
-  MODIFF++;
-  CHARS_MODIFF = MODIFF;
-}
-
 /* Record undo information, adjust markers and position keepers for an
    insertion of a text from FROM (FROM_BYTE) to TO (TO_BYTE).  The
    text already exists in the current buffer but character length (TO
@@ -2049,7 +1999,7 @@
    If PRESERVE_PTR is nonzero, we relocate *PRESERVE_PTR
    by holding its value temporarily in a marker.  */
 
-void
+static void
 signal_before_change (EMACS_INT start_int, EMACS_INT end_int,
                      EMACS_INT *preserve_ptr)
 {

=== modified file 'src/intervals.c'
--- a/src/intervals.c   2011-04-07 03:34:05 +0000
+++ b/src/intervals.c   2011-04-14 00:55:09 +0000
@@ -51,7 +51,8 @@
 
 #define TMEM(sym, set) (CONSP (set) ? ! NILP (Fmemq (sym, set)) : ! NILP (set))
 
-Lisp_Object merge_properties_sticky (Lisp_Object pleft, Lisp_Object pright);
+static Lisp_Object merge_properties_sticky (Lisp_Object, Lisp_Object);
+static INTERVAL merge_interval_right (INTERVAL);
 static INTERVAL reproduce_tree (INTERVAL, INTERVAL);
 static INTERVAL reproduce_tree_obj (INTERVAL, Lisp_Object);
 
@@ -1089,7 +1090,7 @@
        left rear-nonsticky = t,   right front-sticky = nil (inherit none)
 */
 
-Lisp_Object
+static Lisp_Object
 merge_properties_sticky (Lisp_Object pleft, Lisp_Object pright)
 {
   register Lisp_Object props, front, rear;
@@ -1258,7 +1259,7 @@
    I is presumed to be empty; that is, no adjustments are made
    for the length of I.  */
 
-void
+static void
 delete_interval (register INTERVAL i)
 {
   register INTERVAL parent;
@@ -1446,7 +1447,7 @@
    The caller must verify that this is not the last (rightmost)
    interval.  */
 
-INTERVAL
+static INTERVAL
 merge_interval_right (register INTERVAL i)
 {
   register EMACS_INT absorb = LENGTH (i);

=== modified file 'src/intervals.h'
--- a/src/intervals.h   2011-03-18 16:39:15 +0000
+++ b/src/intervals.h   2011-04-14 00:55:09 +0000
@@ -266,8 +266,6 @@
 extern INTERVAL next_interval (INTERVAL);
 extern INTERVAL previous_interval (INTERVAL);
 extern INTERVAL merge_interval_left (INTERVAL);
-extern INTERVAL merge_interval_right (INTERVAL);
-extern void delete_interval (INTERVAL);
 extern void offset_intervals (struct buffer *, EMACS_INT, EMACS_INT);
 extern void graft_intervals_into_buffer (INTERVAL, EMACS_INT, EMACS_INT,
                                          struct buffer *, int);
@@ -295,8 +293,6 @@
 /* Declared in textprop.c */
 
 /* Types of hooks. */
-extern Lisp_Object Qmouse_left;
-extern Lisp_Object Qmouse_entered;
 extern Lisp_Object Qpoint_left;
 extern Lisp_Object Qpoint_entered;
 extern Lisp_Object Qmodification_hooks;
@@ -305,8 +301,8 @@
 extern Lisp_Object Qkeymap;
 
 /* Visual properties text (including strings) may have. */
-extern Lisp_Object Qforeground, Qbackground, Qfont, Qunderline, Qstipple;
-extern Lisp_Object Qinvisible, Qintangible, Qread_only;
+extern Lisp_Object Qfont;
+extern Lisp_Object Qinvisible, Qintangible;
 
 /* Sticky properties */
 extern Lisp_Object Qfront_sticky, Qrear_nonsticky;
@@ -315,10 +311,10 @@
 EXFUN (Fget_text_property, 3);
 EXFUN (Ftext_properties_at, 2);
 EXFUN (Fnext_property_change, 3);
-EXFUN (Fprevious_property_change, 3);
 EXFUN (Fadd_text_properties, 4);
 EXFUN (Fset_text_properties, 4);
 EXFUN (Fremove_text_properties, 4);
+EXFUN (Fremove_list_of_text_properties, 4);
 EXFUN (Ftext_property_any, 5);
 EXFUN (Fprevious_single_char_property_change, 4);
 extern Lisp_Object copy_text_properties (Lisp_Object, Lisp_Object,

=== modified file 'src/keyboard.c'
--- a/src/keyboard.c    2011-04-12 10:20:32 +0000
+++ b/src/keyboard.c    2011-04-14 20:16:48 +0000
@@ -96,16 +96,25 @@
 KBOARD *initial_kboard;
 KBOARD *current_kboard;
 KBOARD *all_kboards;
-int single_kboard;
+
+/* Nonzero in the single-kboard state, 0 in the any-kboard state.  */
+static int single_kboard;
 
 /* Non-nil disable property on a command means
    do not execute it; call disabled-command-function's value instead.  */
-Lisp_Object Qdisabled, Qdisabled_command_function;
+Lisp_Object Qdisabled;
+static Lisp_Object Qdisabled_command_function;
 
 #define NUM_RECENT_KEYS (300)
-int recent_keys_index; /* Index for storing next element into recent_keys */
-int total_keys;                /* Total number of elements stored into 
recent_keys */
-Lisp_Object recent_keys; /* Vector holds the last NUM_RECENT_KEYS keystrokes */
+
+/* Index for storing next element into recent_keys.  */
+static int recent_keys_index;
+
+/* Total number of elements stored into recent_keys.  */
+static int total_keys;
+
+/* This vector holds the last NUM_RECENT_KEYS keystrokes.  */
+static Lisp_Object recent_keys;
 
 /* Vector holding the key sequence that invoked the current command.
    It is reused for each command, and it may be longer than the current
@@ -117,12 +126,12 @@
 
 /* 1 after calling Freset_this_command_lengths.
    Usually it is 0.  */
-int this_command_key_count_reset;
+static int this_command_key_count_reset;
 
 /* This vector is used as a buffer to record the events that were actually read
    by read_key_sequence.  */
-Lisp_Object raw_keybuf;
-int raw_keybuf_count;
+static Lisp_Object raw_keybuf;
+static int raw_keybuf_count;
 
 #define GROW_RAW_KEYBUF                                                        
\
  if (raw_keybuf_count == XVECTOR (raw_keybuf)->size)                   \
@@ -130,7 +139,7 @@
 
 /* Number of elements of this_command_keys
    that precede this key sequence.  */
-int this_single_command_key_start;
+static int this_single_command_key_start;
 
 /* Record values of this_command_key_count and echo_length ()
    before this command was read.  */
@@ -146,7 +155,7 @@
 
 /* True while displaying for echoing.   Delays C-g throwing.  */
 
-int echoing;
+static int echoing;
 
 /* Non-null means we can start echoing at the next input pause even
    though there is something in the echo area.  */
@@ -206,19 +215,19 @@
 
 /* Value of num_nonmacro_input_events as of last auto save.  */
 
-int last_auto_save;
+static int last_auto_save;
 
 /* This is like Vthis_command, except that commands never set it.  */
 Lisp_Object real_this_command;
 
 /* The value of point when the last command was started.  */
-EMACS_INT last_point_position;
+static EMACS_INT last_point_position;
 
 /* The buffer that was current when the last command was started.  */
-Lisp_Object last_point_position_buffer;
+static Lisp_Object last_point_position_buffer;
 
 /* The window that was selected when the last command was started.  */
-Lisp_Object last_point_position_window;
+static Lisp_Object last_point_position_window;
 
 /* The frame in which the last input event occurred, or Qmacro if the
    last event came from a macro.  We use this to determine when to
@@ -231,39 +240,40 @@
    X Windows wants this for selection ownership.  */
 unsigned long last_event_timestamp;
 
-Lisp_Object Qx_set_selection, QPRIMARY, Qhandle_switch_frame;
+static Lisp_Object Qx_set_selection, Qhandle_switch_frame;
+Lisp_Object QPRIMARY;
 
-Lisp_Object Qself_insert_command;
-Lisp_Object Qforward_char;
-Lisp_Object Qbackward_char;
-Lisp_Object Qundefined;
-Lisp_Object Qtimer_event_handler;
+static Lisp_Object Qself_insert_command;
+static Lisp_Object Qforward_char;
+static Lisp_Object Qbackward_char;
+static Lisp_Object Qundefined;
+static Lisp_Object Qtimer_event_handler;
 
 /* read_key_sequence stores here the command definition of the
    key sequence that it reads.  */
-Lisp_Object read_key_sequence_cmd;
-
-Lisp_Object Qinput_method_function;
-
-Lisp_Object Qdeactivate_mark;
+static Lisp_Object read_key_sequence_cmd;
+
+static Lisp_Object Qinput_method_function;
+
+static Lisp_Object Qdeactivate_mark;
 
 Lisp_Object Qrecompute_lucid_menubar, Qactivate_menubar_hook;
 
-Lisp_Object Qecho_area_clear_hook;
+static Lisp_Object Qecho_area_clear_hook;
 
 /* Hooks to run before and after each command.  */
-Lisp_Object Qpre_command_hook;
-Lisp_Object Qpost_command_hook;
-
-Lisp_Object Qdeferred_action_function;
-
-Lisp_Object Qinput_method_exit_on_first_char;
-Lisp_Object Qinput_method_use_echo_area;
-
-Lisp_Object Qhelp_form_show;
+static Lisp_Object Qpre_command_hook;
+static Lisp_Object Qpost_command_hook;
+
+static Lisp_Object Qdeferred_action_function;
+
+static Lisp_Object Qinput_method_exit_on_first_char;
+static Lisp_Object Qinput_method_use_echo_area;
+
+static Lisp_Object Qhelp_form_show;
 
 /* File in which we write all commands we read.  */
-FILE *dribble;
+static FILE *dribble;
 
 /* Nonzero if input is available.  */
 int input_pending;
@@ -293,42 +303,49 @@
    at inopportune times.  */
 
 /* Symbols to head events.  */
-Lisp_Object Qmouse_movement;
-Lisp_Object Qscroll_bar_movement;
+static Lisp_Object Qmouse_movement;
+static Lisp_Object Qscroll_bar_movement;
 Lisp_Object Qswitch_frame;
-Lisp_Object Qdelete_frame;
-Lisp_Object Qiconify_frame;
-Lisp_Object Qmake_frame_visible;
-Lisp_Object Qselect_window;
+static Lisp_Object Qdelete_frame;
+static Lisp_Object Qiconify_frame;
+static Lisp_Object Qmake_frame_visible;
+static Lisp_Object Qselect_window;
 Lisp_Object Qhelp_echo;
 
 #if defined (HAVE_MOUSE) || defined (HAVE_GPM)
-Lisp_Object Qmouse_fixup_help_message;
+static Lisp_Object Qmouse_fixup_help_message;
 #endif
 
 /* Symbols to denote kinds of events.  */
-Lisp_Object Qfunction_key;
+static Lisp_Object Qfunction_key;
 Lisp_Object Qmouse_click;
 #if defined (WINDOWSNT)
 Lisp_Object Qlanguage_change;
 #endif
-Lisp_Object Qdrag_n_drop;
-Lisp_Object Qsave_session;
+static Lisp_Object Qdrag_n_drop;
+static Lisp_Object Qsave_session;
 #ifdef HAVE_DBUS
-Lisp_Object Qdbus_event;
+static Lisp_Object Qdbus_event;
 #endif
-Lisp_Object Qconfig_changed_event;
+static Lisp_Object Qconfig_changed_event;
 
 /* Lisp_Object Qmouse_movement; - also an event header */
 
 /* Properties of event headers.  */
 Lisp_Object Qevent_kind;
-Lisp_Object Qevent_symbol_elements;
+static Lisp_Object Qevent_symbol_elements;
 
 /* menu and tool bar item parts */
-Lisp_Object Qmenu_enable;
-Lisp_Object QCenable, QCvisible, QChelp, QCfilter, QCkeys, QCkey_sequence;
-Lisp_Object QCbutton, QCtoggle, QCradio, QClabel, QCvert_only;
+static Lisp_Object Qmenu_enable;
+static Lisp_Object QCenable, QCvisible, QChelp, QCkeys, QCkey_sequence;
+Lisp_Object QCfilter;
+
+/* Non-nil disable property on a command means
+   do not execute it; call disabled-command-function's value instead.  */
+Lisp_Object QCtoggle, QCradio;
+static Lisp_Object QCbutton, QClabel;
+
+static Lisp_Object QCvert_only;
 
 /* An event header symbol HEAD may have a property named
    Qevent_symbol_element_mask, which is of the form (BASE MODIFIERS);
@@ -341,23 +358,24 @@
    Qmodifier_cache, which is an alist mapping modifier masks onto
    modified versions of BASE.  If present, this helps speed up
    apply_modifiers.  */
-Lisp_Object Qmodifier_cache;
+static Lisp_Object Qmodifier_cache;
 
 /* Symbols to use for parts of windows.  */
 Lisp_Object Qmode_line;
 Lisp_Object Qvertical_line;
-Lisp_Object Qvertical_scroll_bar;
+static Lisp_Object Qvertical_scroll_bar;
 Lisp_Object Qmenu_bar;
 
-Lisp_Object recursive_edit_unwind (Lisp_Object buffer), command_loop (void);
-Lisp_Object Fthis_command_keys (void);
-Lisp_Object Qextended_command_history;
+static Lisp_Object recursive_edit_unwind (Lisp_Object buffer);
+static Lisp_Object command_loop (void);
+static Lisp_Object Qextended_command_history;
 EMACS_TIME timer_check (void);
 
 static void record_menu_key (Lisp_Object c);
+static void echo_now (void);
 static int echo_length (void);
 
-Lisp_Object Qpolling_period;
+static Lisp_Object Qpolling_period;
 
 /* Incremented whenever a timer is run.  */
 int timers_run;
@@ -410,7 +428,7 @@
 #define READABLE_EVENTS_IGNORE_SQUEEZABLES     (1 << 2)
 
 /* Function for init_keyboard to call with no args (if nonzero).  */
-void (*keyboard_init_hook) (void);
+static void (*keyboard_init_hook) (void);
 
 static int read_avail_input (int);
 static void get_input_pending (int *, int);
@@ -430,6 +448,7 @@
                                         Lisp_Object, const char *const *,
                                         Lisp_Object *, unsigned);
 static Lisp_Object make_lispy_switch_frame (Lisp_Object);
+static int help_char_p (Lisp_Object);
 static void save_getcjmp (jmp_buf);
 static void restore_getcjmp (jmp_buf);
 static Lisp_Object apply_modifiers (int, Lisp_Object);
@@ -439,7 +458,10 @@
 #ifdef SIGIO
 static void input_available_signal (int signo);
 #endif
+static Lisp_Object (Fcommand_execute) (Lisp_Object, Lisp_Object, Lisp_Object,
+                                      Lisp_Object);
 static void handle_interrupt (void);
+static void quit_throw_to_read_char (void) NO_RETURN;
 static void timer_start_idle (void);
 static void timer_stop_idle (void);
 static void timer_resume_idle (void);
@@ -583,7 +605,7 @@
 /* Display the current echo string, and begin echoing if not already
    doing so.  */
 
-void
+static void
 echo_now (void)
 {
   if (!current_kboard->immediate_echo)
@@ -750,6 +772,7 @@
 
 /* Make an auto save happen as soon as possible at command level.  */
 
+#ifdef SIGDANGER
 void
 force_auto_save_soon (void)
 {
@@ -757,6 +780,7 @@
 
   record_asynch_buffer_change ();
 }
+#endif
 
 DEFUN ("recursive-edit", Frecursive_edit, Srecursive_edit, 0, 0, "",
        doc: /* Invoke the editor command loop recursively.
@@ -1079,8 +1103,8 @@
 }
 
 Lisp_Object command_loop_1 (void);
-Lisp_Object command_loop_2 (Lisp_Object);
-Lisp_Object top_level_1 (Lisp_Object);
+static Lisp_Object command_loop_2 (Lisp_Object);
+static Lisp_Object top_level_1 (Lisp_Object);
 
 /* Entry to editor-command-loop.
    This level has the catches for exiting/returning to editor command loop.
@@ -1170,7 +1194,7 @@
   Fthrow (Qtop_level, Qnil);
 }
 
-Lisp_Object Fexit_recursive_edit (void) NO_RETURN;
+static Lisp_Object Fexit_recursive_edit (void) NO_RETURN;
 DEFUN ("exit-recursive-edit", Fexit_recursive_edit, Sexit_recursive_edit, 0, 
0, "",
        doc: /* Exit from the innermost recursive edit or minibuffer.  */)
   (void)
@@ -1181,7 +1205,7 @@
   error ("No recursive edit is in progress");
 }
 
-Lisp_Object Fabort_recursive_edit (void) NO_RETURN;
+static Lisp_Object Fabort_recursive_edit (void) NO_RETURN;
 DEFUN ("abort-recursive-edit", Fabort_recursive_edit, Sabort_recursive_edit, 
0, 0, "",
        doc: /* Abort the command that requested this recursive edit or 
minibuffer input.  */)
   (void)
@@ -1244,6 +1268,9 @@
    If ignore_mouse_drag_p is non-zero, ignore (implicit) mouse movement
    after resizing the tool-bar window.  */
 
+#if !defined HAVE_WINDOW_SYSTEM || defined USE_GTK || defined HAVE_NS
+static
+#endif
 int ignore_mouse_drag_p;
 
 static FRAME_PTR
@@ -1901,7 +1928,7 @@
 
 /* Asynchronous timer for polling.  */
 
-struct atimer *poll_timer;
+static struct atimer *poll_timer;
 
 
 #ifdef POLL_FOR_INPUT
@@ -2168,7 +2195,6 @@
 
 /* Input of single characters from keyboard */
 
-Lisp_Object print_help (Lisp_Object object);
 static Lisp_Object kbd_buffer_get_event (KBOARD **kbp, int *used_mouse_menu,
                                         struct timeval *end_time);
 static void record_char (Lisp_Object c);
@@ -3162,7 +3188,7 @@
 
 /* Return 1 if should recognize C as "the help character".  */
 
-int
+static int
 help_char_p (Lisp_Object c)
 {
   Lisp_Object tail;
@@ -3311,17 +3337,6 @@
     }
 }
 
-Lisp_Object
-print_help (Lisp_Object object)
-{
-  struct buffer *old = current_buffer;
-  Fprinc (object, Qnil);
-  set_buffer_internal (XBUFFER (Vstandard_output));
-  call0 (intern ("help-mode"));
-  set_buffer_internal (old);
-  return Qnil;
-}
-
 /* Copy out or in the info on where C-g should throw to.
    This is used when running Lisp code from within get_char,
    in case get_char is called recursively.
@@ -3413,7 +3428,7 @@
 }
 
 /* Set this for debugging, to have a way to get out */
-int stop_character;
+int stop_character EXTERNALLY_VISIBLE;
 
 static KBOARD *
 event_to_kboard (struct input_event *event)
@@ -4209,7 +4224,7 @@
 }
 
 /* This is only for debugging.  */
-struct input_event last_timer_event;
+struct input_event last_timer_event EXTERNALLY_VISIBLE;
 
 /* List of elisp functions to call, delayed because they were generated in
    a context where Elisp could not be safely run (e.g. redisplay, signal,
@@ -5017,7 +5032,7 @@
 
 #endif /* not HAVE_NTGUI */
 
-Lisp_Object Vlispy_mouse_stem;
+static Lisp_Object Vlispy_mouse_stem;
 
 static const char *const lispy_wheel_names[] =
 {
@@ -5032,9 +5047,11 @@
 };
 
 /* Scroll bar parts.  */
-Lisp_Object Qabove_handle, Qhandle, Qbelow_handle;
-Lisp_Object Qup, Qdown, Qbottom, Qend_scroll;
-Lisp_Object Qtop, Qratio;
+static Lisp_Object Qabove_handle, Qhandle, Qbelow_handle;
+Lisp_Object Qup, Qdown, Qbottom;
+static Lisp_Object Qend_scroll;
+Lisp_Object Qtop;
+static Lisp_Object Qratio;
 
 /* An array of scroll bar parts, indexed by an enum scroll_bar_part value.  */
 static Lisp_Object *const scroll_bar_parts[] = {
@@ -5065,7 +5082,7 @@
 
 /* The number of clicks in this multiple-click. */
 
-int double_click_count;
+static int double_click_count;
 
 /* X and Y are frame-relative coordinates for a click or wheel event.
    Return a Lisp-style event list.  */
@@ -7889,8 +7906,8 @@
 
 /* The symbols `:image' and `:rtl'.  */
 
-Lisp_Object QCimage;
-Lisp_Object Qrtl;
+static Lisp_Object QCimage;
+static Lisp_Object Qrtl;
 
 /* Function prototypes.  */
 
@@ -10934,7 +10951,7 @@
 
 /* Handle a C-g by making read_char return C-g.  */
 
-void
+static void
 quit_throw_to_read_char (void)
 {
   sigfree ();
@@ -10962,7 +10979,8 @@
   _longjmp (getcjmp, 1);
 }
 
-DEFUN ("set-input-interrupt-mode", Fset_input_interrupt_mode, 
Sset_input_interrupt_mode, 1, 1, 0,
+DEFUN ("set-input-interrupt-mode", Fset_input_interrupt_mode,
+       Sset_input_interrupt_mode, 1, 1, 0,
        doc: /* Set interrupt mode of reading keyboard input.
 If INTERRUPT is non-nil, Emacs will use input interrupts;
 otherwise Emacs uses CBREAK mode.

=== modified file 'src/keyboard.h'
--- a/src/keyboard.h    2011-03-27 02:32:40 +0000
+++ b/src/keyboard.h    2011-04-14 01:36:53 +0000
@@ -190,9 +190,6 @@
 
 /* A list of all kboard objects, linked through next_kboard.  */
 extern KBOARD *all_kboards;
-
-/* Nonzero in the single-kboard state, 0 in the any-kboard state.  */
-extern int single_kboard;
 
 /* Total number of times read_char has returned, modulo SIZE_MAX + 1.  */
 extern size_t num_input_events;
@@ -408,15 +405,10 @@
 extern Lisp_Object Qswitch_frame;
 
 /* Properties on event heads.  */
-extern Lisp_Object Qevent_kind, Qevent_symbol_elements;
-
-/* Getting an unmodified version of an event head.  */
-#define EVENT_HEAD_UNMODIFIED(event_head) \
-  (Fcar (Fget ((event_head), Qevent_symbol_elements)))
+extern Lisp_Object Qevent_kind;
 
 /* The values of Qevent_kind properties.  */
-extern Lisp_Object Qfunction_key, Qmouse_click, Qmouse_movement;
-extern Lisp_Object Qscroll_bar_movement;
+extern Lisp_Object Qmouse_click;
 
 extern Lisp_Object Qhelp_echo;
 
@@ -434,7 +426,9 @@
    happens.  */
 extern EMACS_TIME *input_available_clear_time;
 
+#if defined HAVE_WINDOW_SYSTEM && !defined USE_GTK && !defined HAVE_NS
 extern int ignore_mouse_drag_p;
+#endif
 
 /* The primary selection.  */
 extern Lisp_Object QPRIMARY;
@@ -454,9 +448,7 @@
 
 /* Non-nil disable property on a command means
    do not execute it; call disabled-command-function's value instead.  */
-extern Lisp_Object QCbutton, QCtoggle, QCradio, QClabel;
-
-extern Lisp_Object Qinput_method_function;
+extern Lisp_Object QCtoggle, QCradio;
 
 /* An event header symbol HEAD may have a property named
    Qevent_symbol_element_mask, which is of the form (BASE MODIFIERS);
@@ -476,7 +468,6 @@
 extern int menu_separator_name_p (const char *);
 extern int parse_menu_item (Lisp_Object, int);
 
-extern void echo_now (void);
 extern void init_kboard (KBOARD *);
 extern void delete_kboard (KBOARD *);
 extern void not_single_kboard_state (KBOARD *);
@@ -498,8 +489,6 @@
 extern void stuff_buffered_input (Lisp_Object);
 extern void clear_waiting_for_input (void);
 extern void swallow_events (int);
-extern int help_char_p (Lisp_Object);
-extern void quit_throw_to_read_char (void) NO_RETURN;
 extern int lucid_event_type_list_p (Lisp_Object);
 extern void kbd_buffer_store_event (struct input_event *);
 extern void kbd_buffer_store_event_hold (struct input_event *,

=== modified file 'src/keymap.c'
--- a/src/keymap.c      2011-03-28 22:41:01 +0000
+++ b/src/keymap.c      2011-04-14 19:34:42 +0000
@@ -56,8 +56,9 @@
 
 /* keymap used for minibuffers when doing completion */
 /* keymap used for minibuffers when doing completion and require a match */
-Lisp_Object Qkeymapp, Qkeymap, Qnon_ascii, Qmenu_item, Qremap;
-Lisp_Object QCadvertised_binding;
+static Lisp_Object Qkeymapp, Qnon_ascii;
+Lisp_Object Qkeymap, Qmenu_item, Qremap;
+static Lisp_Object QCadvertised_binding;
 
 /* Alist of elements like (DEL . "\d").  */
 static Lisp_Object exclude_keys;
@@ -70,6 +71,7 @@
 /* Which keymaps are reverse-stored in the cache.  */
 static Lisp_Object where_is_cache_keymaps;
 
+static Lisp_Object Flookup_key (Lisp_Object, Lisp_Object, Lisp_Object);
 static Lisp_Object store_in_keymap (Lisp_Object, Lisp_Object, Lisp_Object);
 static void fix_submap_inheritance (Lisp_Object, Lisp_Object, Lisp_Object);
 
@@ -658,7 +660,7 @@
   UNGCPRO;
 }
 
-Lisp_Object Qkeymap_canonicalize;
+static Lisp_Object Qkeymap_canonicalize;
 
 /* Same as map_keymap, but does it right, properly eliminating duplicate
    bindings due to inheritance.   */
@@ -955,7 +957,7 @@
   return def;
 }
 
-EXFUN (Fcopy_keymap, 1);
+static Lisp_Object Fcopy_keymap (Lisp_Object);
 
 static Lisp_Object
 copy_keymap_item (Lisp_Object elt)
@@ -2174,7 +2176,7 @@
     }
   return maps;
 }
-Lisp_Object Qsingle_key_description, Qkey_description;
+static Lisp_Object Qsingle_key_description, Qkey_description;
 
 /* This function cannot GC.  */
 

=== modified file 'src/keymap.h'
--- a/src/keymap.h      2011-01-25 04:08:28 +0000
+++ b/src/keymap.h      2011-04-11 01:41:15 +0000
@@ -27,7 +27,6 @@
 EXFUN (Fmake_sparse_keymap, 1);
 EXFUN (Fkeymap_prompt, 1);
 EXFUN (Fdefine_key, 3);
-EXFUN (Flookup_key, 3);
 EXFUN (Fcommand_remapping, 3);
 EXFUN (Fkey_binding, 4);
 EXFUN (Fkey_description, 2);
@@ -53,4 +52,3 @@
                                  Lisp_Object args, void *data);
 
 #endif
-

=== modified file 'src/lisp.h'
--- a/src/lisp.h        2011-04-12 08:12:01 +0000
+++ b/src/lisp.h        2011-04-14 20:16:48 +0000
@@ -55,11 +55,11 @@
 #endif
 
 /* Extra internal type checking?  */
-extern int suppress_checking;
+
+#ifdef ENABLE_CHECKING
+
 extern void die (const char *, const char *, int) NO_RETURN;
 
-#ifdef ENABLE_CHECKING
-
 /* The suppress_checking variable is initialized to 0 in alloc.c.  Set
    it to 1 using a debugger to temporarily disable aborting on
    detected internal inconsistencies or error conditions.
@@ -74,6 +74,8 @@
    STRINGP (x), but a particular use of XSTRING is invoked only after
    testing that STRINGP (x) is true, making the test redundant.  */
 
+extern int suppress_checking EXTERNALLY_VISIBLE;
+
 #define CHECK(check,msg) (((check) || suppress_checking                \
                           ? (void) 0                           \
                           : die ((msg), __FILE__, __LINE__)),  \
@@ -1805,9 +1807,9 @@
 
 /* This version of DEFUN declares a function prototype with the right
    arguments, so we can catch errors with maxargs at compile-time.  */
-#define DEFUN(lname, fnname, sname, minargs, maxargs, intspec, doc)    \
+#define DEFUN(lname, fnname, sname, minargs, maxargs, intspec, doc) \
   Lisp_Object fnname DEFUN_ARGS_ ## maxargs ;                          \
-  DECL_ALIGN (struct Lisp_Subr, sname) =                               \
+  static DECL_ALIGN (struct Lisp_Subr, sname) =                                
\
     { PVEC_SUBR | (sizeof (struct Lisp_Subr) / sizeof (EMACS_INT)),    \
       { .a ## maxargs = fnname },                              \
       minargs, maxargs, lname, intspec, 0};                            \
@@ -1964,8 +1966,6 @@
     struct handler *next;
   };
 
-extern struct handler *handlerlist;
-
 /* This structure helps implement the `catch' and `throw' control
    structure.  A struct catchtag contains all the information needed
    to restore the state of the interpreter after a non-local jump.
@@ -2001,9 +2001,6 @@
   struct byte_stack *byte_stack;
 };
 
-extern struct catchtag *catchlist;
-extern struct backtrace *backtrace_list;
-
 extern Lisp_Object memory_signal_data;
 
 /* An address near the bottom of the stack.
@@ -2051,8 +2048,8 @@
 
 #define QUITP (!NILP (Vquit_flag) && NILP (Vinhibit_quit))
 
-extern Lisp_Object Vascii_downcase_table, Vascii_upcase_table;
-extern Lisp_Object Vascii_canon_table, Vascii_eqv_table;
+extern Lisp_Object Vascii_downcase_table;
+extern Lisp_Object Vascii_canon_table;
 
 /* Number of bytes of structure consed since last GC.  */
 
@@ -2285,22 +2282,22 @@
 struct frame;
 
 /* Defined in data.c.  */
-extern Lisp_Object Qnil, Qt, Qquote, Qlambda, Qsubr, Qunbound;
+extern Lisp_Object Qnil, Qt, Qquote, Qlambda, Qunbound;
 extern Lisp_Object Qerror_conditions, Qerror_message, Qtop_level;
-extern Lisp_Object Qerror, Qquit, Qwrong_type_argument, Qargs_out_of_range;
+extern Lisp_Object Qerror, Qquit, Qargs_out_of_range;
 extern Lisp_Object Qvoid_variable, Qvoid_function;
-extern Lisp_Object Qsetting_constant, Qinvalid_read_syntax;
+extern Lisp_Object Qinvalid_read_syntax;
 extern Lisp_Object Qinvalid_function, Qwrong_number_of_arguments, Qno_catch;
 extern Lisp_Object Qend_of_file, Qarith_error, Qmark_inactive;
 extern Lisp_Object Qbeginning_of_buffer, Qend_of_buffer, Qbuffer_read_only;
 extern Lisp_Object Qtext_read_only;
 extern Lisp_Object Qinteractive_form;
 extern Lisp_Object Qcircular_list;
-extern Lisp_Object Qintegerp, Qnatnump, Qwholenump, Qsymbolp, Qlistp, Qconsp;
+extern Lisp_Object Qintegerp, Qwholenump, Qsymbolp, Qlistp, Qconsp;
 extern Lisp_Object Qstringp, Qarrayp, Qsequencep, Qbufferp;
 extern Lisp_Object Qchar_or_string_p, Qmarkerp, Qinteger_or_marker_p, Qvectorp;
 extern Lisp_Object Qbuffer_or_string_p;
-extern Lisp_Object Qboundp, Qfboundp;
+extern Lisp_Object Qfboundp;
 extern Lisp_Object Qchar_table_p, Qvector_or_char_table_p;
 
 extern Lisp_Object Qcdr;
@@ -2315,7 +2312,6 @@
 
 extern Lisp_Object Qfont_spec, Qfont_entity, Qfont_object;
 
-extern void circular_list_error (Lisp_Object) NO_RETURN;
 EXFUN (Finteractive_form, 1);
 EXFUN (Fbyteorder, 0);
 
@@ -2404,7 +2400,6 @@
 extern void syms_of_coding (void);
 
 /* Defined in character.c */
-EXFUN (Funibyte_char_to_multibyte, 1);
 EXFUN (Fchar_width, 1);
 EXFUN (Fstring, MANY);
 extern EMACS_INT chars_in_text (const unsigned char *, EMACS_INT);
@@ -2428,7 +2423,6 @@
 EXFUN (Fforward_word, 1);
 EXFUN (Fskip_chars_forward, 2);
 EXFUN (Fskip_chars_backward, 2);
-EXFUN (Fsyntax_table_p, 1);
 extern void init_syntax_once (void);
 extern void syms_of_syntax (void);
 
@@ -2526,10 +2520,8 @@
 #endif /* HAVE_WINDOW_SYSTEM */
 
 /* Defined in image.c */
-extern Lisp_Object QCascent, QCmargin, QCrelief, Qcount, Qextension_data;
-extern Lisp_Object QCconversion, QCcolor_symbols, QCheuristic_mask;
-extern Lisp_Object QCindex, QCmatrix, QCcolor_adjustment, QCmask;
-EXFUN (Finit_image_library, 2);
+extern Lisp_Object QCascent, QCmargin, QCrelief;
+extern Lisp_Object QCconversion;
 extern int x_bitmap_mask (struct frame *, int);
 extern void syms_of_image (void);
 extern void init_image (void);
@@ -2570,12 +2562,7 @@
                                EMACS_INT, EMACS_INT, int);
 extern void modify_region (struct buffer *, EMACS_INT, EMACS_INT, int);
 extern void prepare_to_modify_buffer (EMACS_INT, EMACS_INT, EMACS_INT *);
-extern void signal_before_change (EMACS_INT, EMACS_INT, EMACS_INT *);
 extern void signal_after_change (EMACS_INT, EMACS_INT, EMACS_INT);
-extern void adjust_after_replace (EMACS_INT, EMACS_INT, Lisp_Object,
-                                 EMACS_INT, EMACS_INT);
-extern void adjust_after_replace_noundo (EMACS_INT, EMACS_INT, EMACS_INT,
-                                        EMACS_INT, EMACS_INT, EMACS_INT);
 extern void adjust_after_insert (EMACS_INT, EMACS_INT, EMACS_INT,
                                 EMACS_INT, EMACS_INT);
 extern void adjust_markers_for_delete (EMACS_INT, EMACS_INT,
@@ -2599,8 +2586,6 @@
 /* Defined in xdisp.c */
 extern Lisp_Object Qinhibit_point_motion_hooks;
 extern Lisp_Object Qinhibit_redisplay, Qdisplay;
-extern Lisp_Object Qinhibit_eval_during_redisplay;
-extern Lisp_Object Qmessage_truncate_lines;
 extern Lisp_Object Qmenu_bar_update_hook;
 extern Lisp_Object Qwindow_scroll_functions;
 extern Lisp_Object Qoverriding_local_map, Qoverriding_terminal_local_map;
@@ -2615,7 +2600,6 @@
 extern struct frame *last_glyphless_glyph_frame;
 extern unsigned last_glyphless_glyph_face_id;
 extern int last_glyphless_glyph_merged_face_id;
-extern int message_enable_multibyte;
 extern int noninteractive_need_newline;
 extern Lisp_Object echo_area_buffer[2];
 extern void add_to_log (const char *, Lisp_Object, Lisp_Object);
@@ -2624,10 +2608,8 @@
 extern int push_message (void);
 extern Lisp_Object pop_message_unwind (Lisp_Object);
 extern Lisp_Object restore_message_unwind (Lisp_Object);
-extern void pop_message (void);
 extern void restore_message (void);
 extern Lisp_Object current_message (void);
-extern void set_message (const char *s, Lisp_Object, EMACS_INT, int);
 extern void clear_message (int, int);
 extern void message (const char *, ...) ATTRIBUTE_FORMAT_PRINTF (1, 2);
 extern void message1 (const char *);
@@ -2642,8 +2624,6 @@
 extern void update_echo_area (void);
 extern void truncate_echo_area (EMACS_INT);
 extern void redisplay (void);
-extern int check_point_in_composition
-        (struct buffer *, EMACS_INT, struct buffer *, EMACS_INT);
 extern void redisplay_preserve_echo_area (int);
 extern void prepare_menu_bars (void);
 
@@ -2670,7 +2650,9 @@
 extern void buffer_memory_full (void) NO_RETURN;
 extern int survives_gc_p (Lisp_Object);
 extern void mark_object (Lisp_Object);
+#if defined REL_ALLOC && !defined SYSTEM_MALLOC
 extern void refill_memory_reserve (void);
+#endif
 extern const char *pending_malloc_warning;
 extern Lisp_Object *stack_base;
 EXFUN (Fcons, 2);
@@ -2724,7 +2706,6 @@
 extern void display_malloc_warning (void);
 extern int inhibit_garbage_collection (void);
 extern Lisp_Object make_save_value (void *, int);
-extern void free_misc (Lisp_Object);
 extern void free_marker (Lisp_Object);
 extern void free_cons (struct Lisp_Cons *);
 extern void init_alloc_once (void);
@@ -2760,16 +2741,13 @@
 /* Defined in print.c */
 extern Lisp_Object Vprin1_to_string_buffer;
 extern void debug_print (Lisp_Object) EXTERNALLY_VISIBLE;
-extern void safe_debug_print (Lisp_Object) EXTERNALLY_VISIBLE;
 EXFUN (Fprin1, 2);
 EXFUN (Fprin1_to_string, 2);
-EXFUN (Fprinc, 2);
 EXFUN (Fterpri, 1);
 EXFUN (Fprint, 2);
 EXFUN (Ferror_message_string, 1);
 extern Lisp_Object Qstandard_output;
 extern Lisp_Object Qexternal_debugging_output;
-extern void debug_output_compilation_hack (int);
 extern void temp_output_buffer_setup (const char *);
 extern int print_level;
 extern Lisp_Object Qprint_escape_newlines;
@@ -2785,20 +2763,18 @@
 /* Defined in lread.c.  */
 extern Lisp_Object Qvariable_documentation, Qstandard_input;
 extern Lisp_Object Qbackquote, Qcomma, Qcomma_at, Qcomma_dot, Qfunction;
-extern Lisp_Object initial_obarray;
 EXFUN (Fread, 1);
 EXFUN (Fread_from_string, 3);
 EXFUN (Fintern, 2);
 EXFUN (Fintern_soft, 2);
+EXFUN (Funintern, 2);
 EXFUN (Fload, 5);
 EXFUN (Fget_load_suffixes, 0);
 EXFUN (Fread_char, 3);
 EXFUN (Fread_event, 3);
-EXFUN (Feval_region, 4);
 extern Lisp_Object check_obarray (Lisp_Object);
 extern Lisp_Object intern (const char *);
 extern Lisp_Object intern_c_string (const char *);
-extern Lisp_Object make_symbol (const char *);
 extern Lisp_Object oblookup (Lisp_Object, const char *, EMACS_INT, EMACS_INT);
 #define LOADHIST_ATTACH(x) \
   do {                                                                 \
@@ -2818,9 +2794,14 @@
 /* Defined in eval.c.  */
 extern Lisp_Object Qautoload, Qexit, Qinteractive, Qcommandp, Qdefun, Qmacro;
 extern Lisp_Object Qinhibit_quit, Qclosure;
+extern Lisp_Object Qand_rest;
 extern Lisp_Object Vautoload_queue;
 extern Lisp_Object Vsignaling_function;
 extern int handling_signal;
+#if BYTE_MARK_STACK
+extern struct catchtag *catchlist;
+extern struct handler *handlerlist;
+#endif
 /* To run a normal hook, use the appropriate function from the list below.
    The calling convention:
 
@@ -2852,7 +2833,6 @@
 extern Lisp_Object eval_sub (Lisp_Object form);
 EXFUN (Fapply, MANY);
 EXFUN (Ffuncall, MANY);
-EXFUN (Fbacktrace, 0);
 extern Lisp_Object apply1 (Lisp_Object, Lisp_Object);
 extern Lisp_Object call0 (Lisp_Object);
 extern Lisp_Object call1 (Lisp_Object, Lisp_Object);
@@ -2877,13 +2857,14 @@
   NO_RETURN ATTRIBUTE_FORMAT_PRINTF (1, 0);
 extern void do_autoload (Lisp_Object, Lisp_Object);
 extern Lisp_Object un_autoload (Lisp_Object);
-EXFUN (Ffetch_bytecode, 1);
 extern void init_eval_once (void);
 extern Lisp_Object safe_call (size_t, Lisp_Object *);
 extern Lisp_Object safe_call1 (Lisp_Object, Lisp_Object);
 extern Lisp_Object safe_call2 (Lisp_Object, Lisp_Object, Lisp_Object);
 extern void init_eval (void);
+#if BYTE_MARK_STACK
 extern void mark_backtrace (void);
+#endif
 extern void syms_of_eval (void);
 
 /* Defined in editfns.c */
@@ -2921,13 +2902,13 @@
 EXFUN (Fuser_login_name, 1);
 EXFUN (Fsystem_name, 0);
 EXFUN (Fcurrent_time, 0);
+EXFUN (Fget_internal_run_time, 0);
 extern EMACS_INT clip_to_bounds (EMACS_INT, EMACS_INT, EMACS_INT);
 extern Lisp_Object make_buffer_string (EMACS_INT, EMACS_INT, int);
 extern Lisp_Object make_buffer_string_both (EMACS_INT, EMACS_INT, EMACS_INT,
                                            EMACS_INT, int);
 extern void init_editfns (void);
 const char *get_system_name (void);
-const char *get_operating_system_release (void);
 extern void syms_of_editfns (void);
 EXFUN (Fconstrain_to_field, 5);
 EXFUN (Ffield_end, 3);
@@ -2953,7 +2934,6 @@
 extern Lisp_Object set_buffer_if_live (Lisp_Object);
 EXFUN (Fbarf_if_buffer_read_only, 0);
 EXFUN (Fcurrent_buffer, 0);
-EXFUN (Fswitch_to_buffer, 2);
 EXFUN (Fother_buffer, 3);
 EXFUN (Foverlay_get, 2);
 EXFUN (Fbuffer_modified_p, 1);
@@ -2962,8 +2942,7 @@
 EXFUN (Fkill_all_local_variables, 0);
 EXFUN (Fbuffer_enable_undo, 1);
 EXFUN (Ferase_buffer, 0);
-extern Lisp_Object Qoverlayp;
-extern Lisp_Object Qpriority, Qwindow, Qevaporate, Qbefore_string, 
Qafter_string;
+extern Lisp_Object Qpriority, Qwindow, Qbefore_string, Qafter_string;
 extern Lisp_Object get_truename_buffer (Lisp_Object);
 extern struct buffer *all_buffers;
 EXFUN (Fprevious_overlay_change, 1);
@@ -2984,14 +2963,12 @@
 extern void clear_charpos_cache (struct buffer *);
 extern EMACS_INT charpos_to_bytepos (EMACS_INT);
 extern EMACS_INT buf_charpos_to_bytepos (struct buffer *, EMACS_INT);
-extern EMACS_INT verify_bytepos (EMACS_INT charpos);
 extern EMACS_INT buf_bytepos_to_charpos (struct buffer *, EMACS_INT);
 extern void unchain_marker (struct Lisp_Marker *marker);
 extern Lisp_Object set_marker_restricted (Lisp_Object, Lisp_Object, 
Lisp_Object);
 extern Lisp_Object set_marker_both (Lisp_Object, Lisp_Object, EMACS_INT, 
EMACS_INT);
 extern Lisp_Object set_marker_restricted_both (Lisp_Object, Lisp_Object,
                                                EMACS_INT, EMACS_INT);
-extern int count_markers (struct buffer *);
 extern void syms_of_marker (void);
 
 /* Defined in fileio.c */
@@ -3018,7 +2995,6 @@
 EXFUN (Ffile_directory_p, 1);
 EXFUN (Fwrite_region, 7);
 EXFUN (Ffile_readable_p, 1);
-EXFUN (Ffile_executable_p, 1);
 EXFUN (Fread_file_name, 6);
 extern Lisp_Object close_file_unwind (Lisp_Object);
 extern Lisp_Object restore_point_unwind (Lisp_Object);
@@ -3026,7 +3002,6 @@
 extern int internal_delete_file (Lisp_Object);
 extern void syms_of_fileio (void);
 extern Lisp_Object make_temp_name (Lisp_Object, int);
-EXFUN (Fmake_symbolic_link, 3);
 extern Lisp_Object Qdelete_file;
 
 /* Defined in abbrev.c */
@@ -3066,7 +3041,6 @@
 extern Lisp_Object Qcompletion_ignore_case;
 extern Lisp_Object Vminibuffer_list;
 extern Lisp_Object last_minibuf_string;
-extern void choose_minibuf_frame (void);
 EXFUN (Fcompleting_read, 8);
 EXFUN (Fread_from_minibuffer, 7);
 EXFUN (Fread_variable, 2);
@@ -3107,22 +3081,18 @@
 
 /* Defined in keyboard.c */
 
-extern int echoing;
 extern Lisp_Object echo_message_buffer;
 extern struct kboard *echo_kboard;
 extern void cancel_echoing (void);
 extern Lisp_Object Qdisabled, QCfilter;
-extern Lisp_Object Qabove_handle, Qhandle, Qbelow_handle;
-extern Lisp_Object Qup, Qdown, Qbottom, Qend_scroll;
-extern Lisp_Object Qtop, Qratio;
+extern Lisp_Object Qup, Qdown, Qbottom;
+extern Lisp_Object Qtop;
 extern int input_pending;
 EXFUN (Fdiscard_input, 0);
 EXFUN (Frecursive_edit, 0);
 EXFUN (Ftop_level, 0) NO_RETURN;
-EXFUN (Fcommand_execute, 4);
 extern Lisp_Object menu_bar_items (Lisp_Object);
 extern Lisp_Object tool_bar_items (Lisp_Object, int *);
-extern Lisp_Object Qvertical_scroll_bar;
 extern void discard_mouse_events (void);
 EXFUN (Fevent_convert_list, 1);
 EXFUN (Fread_key_sequence, 5);
@@ -3137,7 +3107,9 @@
 extern Lisp_Object command_loop_1 (void);
 extern Lisp_Object recursive_edit_1 (void);
 extern void record_auto_save (void);
+#ifdef SIGDANGER
 extern void force_auto_save_soon (void);
+#endif
 extern void init_keyboard (void);
 extern void syms_of_keyboard (void);
 extern void keys_of_keyboard (void);
@@ -3161,7 +3133,9 @@
 extern void store_frame_param (struct frame *, Lisp_Object, Lisp_Object);
 extern void store_in_alist (Lisp_Object *, Lisp_Object, Lisp_Object);
 extern Lisp_Object do_switch_frame (Lisp_Object, int, int, Lisp_Object);
+#if HAVE_NS
 extern Lisp_Object get_frame_param (struct frame *, Lisp_Object);
+#endif
 extern Lisp_Object frame_buffer_predicate (Lisp_Object);
 EXFUN (Fselect_frame, 2);
 EXFUN (Fselected_frame, 0);
@@ -3189,8 +3163,9 @@
 extern Lisp_Object decode_env_path (const char *, const char *);
 extern Lisp_Object empty_unibyte_string, empty_multibyte_string;
 extern Lisp_Object Qfile_name_handler_alist;
-extern void (*fatal_error_signal_hook) (void);
+#ifdef FLOAT_CATCH_SIGILL
 extern void fatal_error_signal (int);
+#endif
 EXFUN (Fkill_emacs, 1) NO_RETURN;
 #if HAVE_SETLOCALE
 void fixup_locale (void);
@@ -3221,12 +3196,10 @@
 
 /* Defined in process.c */
 extern Lisp_Object QCtype, Qlocal;
-EXFUN (Fget_process, 1);
 EXFUN (Fget_buffer_process, 1);
 EXFUN (Fprocess_status, 1);
 EXFUN (Fkill_process, 2);
 EXFUN (Fwaiting_for_user_input_p, 0);
-extern Lisp_Object Qprocessp;
 extern void kill_buffer_processes (Lisp_Object);
 extern int wait_reading_process_output (int, int, int, int,
                                         Lisp_Object,
@@ -3255,7 +3228,6 @@
 /* Defined in doc.c */
 extern Lisp_Object Qfunction_documentation;
 EXFUN (Fsubstitute_command_keys, 1);
-EXFUN (Fdocumentation_property, 3);
 extern Lisp_Object read_doc_string (Lisp_Object);
 extern Lisp_Object get_doc_string (Lisp_Object, int, int);
 extern void syms_of_doc (void);
@@ -3263,10 +3235,9 @@
 
 /* Defined in bytecode.c */
 extern Lisp_Object Qbytecode;
-EXFUN (Fbyte_code, 3);
 extern void syms_of_bytecode (void);
 extern struct byte_stack *byte_stack_list;
-#ifdef BYTE_MARK_STACK
+#if BYTE_MARK_STACK
 extern void mark_byte_stack (void);
 #endif
 extern void unmark_byte_stack (void);
@@ -3341,7 +3312,6 @@
 extern void child_setup_tty (int);
 extern void setup_pty (int);
 extern int set_window_size (int, int, int);
-extern void create_process (Lisp_Object, char **, Lisp_Object);
 extern long get_random (void);
 extern void seed_random (long);
 extern int emacs_open (const char *, int, int);
@@ -3384,7 +3354,6 @@
 extern void syms_of_ccl (void);
 
 /* Defined in dired.c */
-EXFUN (Ffile_attributes, 2);
 extern void syms_of_dired (void);
 extern Lisp_Object directory_files_internal (Lisp_Object, Lisp_Object,
                                              Lisp_Object, Lisp_Object,
@@ -3417,9 +3386,9 @@
 #endif
 
 /* Defined in xfaces.c */
-extern Lisp_Object Qdefault, Qtool_bar, Qregion, Qfringe;
-extern Lisp_Object Qheader_line, Qscroll_bar, Qcursor, Qborder, Qmouse, Qmenu;
-extern Lisp_Object Qmode_line_inactive, Qvertical_border;
+extern Lisp_Object Qdefault, Qtool_bar, Qfringe;
+extern Lisp_Object Qheader_line, Qscroll_bar, Qcursor;
+extern Lisp_Object Qmode_line_inactive;
 extern Lisp_Object Qface;
 extern Lisp_Object Qnormal;
 extern Lisp_Object QCfamily, QCweight, QCslant;
@@ -3530,16 +3499,6 @@
       ? 0                                              \
       : (wrong_type_argument (Qlistp, (list))), 1))
 
-#define FOREACH(hare, list, tortoise, n)               \
-  for (tortoise = hare = (list), n = 0;                        \
-       !LIST_END_P (list, hare);                       \
-       (hare = XCDR (hare), ++n,                       \
-       ((n & 1) != 0                                   \
-        ? (tortoise = XCDR (tortoise),                 \
-           (EQ (hare, tortoise)                        \
-            && (circular_list_error ((list)), 1)))     \
-        : 0)))
-
 /* Use this to suppress gcc's `...may be used before initialized' warnings. */
 #ifdef lint
 # define IF_LINT(Code) Code

=== modified file 'src/lread.c'
--- a/src/lread.c       2011-04-04 07:48:36 +0000
+++ b/src/lread.c       2011-04-14 05:04:02 +0000
@@ -61,20 +61,21 @@
 #endif
 
 /* hash table read constants */
-Lisp_Object Qhash_table, Qdata;
-Lisp_Object Qtest, Qsize;
-Lisp_Object Qweakness;
-Lisp_Object Qrehash_size;
-Lisp_Object Qrehash_threshold;
+static Lisp_Object Qhash_table, Qdata;
+static Lisp_Object Qtest, Qsize;
+static Lisp_Object Qweakness;
+static Lisp_Object Qrehash_size;
+static Lisp_Object Qrehash_threshold;
 
-Lisp_Object Qread_char, Qget_file_char, Qstandard_input, Qcurrent_load_list;
+static Lisp_Object Qread_char, Qget_file_char, Qcurrent_load_list;
+Lisp_Object Qstandard_input;
 Lisp_Object Qvariable_documentation;
-Lisp_Object Qascii_character, Qload, Qload_file_name;
+static Lisp_Object Qascii_character, Qload, Qload_file_name;
 Lisp_Object Qbackquote, Qcomma, Qcomma_at, Qcomma_dot, Qfunction;
-Lisp_Object Qinhibit_file_name_operation;
-Lisp_Object Qeval_buffer_list;
-Lisp_Object Qlexical_binding;
-Lisp_Object Qfile_truename, Qdo_after_load_evaluation; /* ACM 2006/5/16 */
+static Lisp_Object Qinhibit_file_name_operation;
+static Lisp_Object Qeval_buffer_list;
+static Lisp_Object Qlexical_binding;
+static Lisp_Object Qfile_truename, Qdo_after_load_evaluation; /* ACM 2006/5/16 
*/
 
 /* Used instead of Qget_file_char while loading *.elc files compiled
    by Emacs 21 or older.  */
@@ -90,7 +91,7 @@
    Each member of the list has the form (n . object), and is used to
    look up the object for the corresponding #n# construct.
    It must be set to nil before all top-level calls to read0.  */
-Lisp_Object read_objects;
+static Lisp_Object read_objects;
 
 /* Nonzero means READCHAR should read bytes one by one (not character)
    when READCHARFUN is Qget_file_char or Qget_emacs_mule_file_char.
@@ -3577,11 +3578,11 @@
     }
 }
 
-Lisp_Object initial_obarray;
+static Lisp_Object initial_obarray;
 
 /* oblookup stores the bucket number here, for the sake of Funintern.  */
 
-int oblookup_last_bucket_number;
+static int oblookup_last_bucket_number;
 
 static int hash_string (const char *ptr, int len);
 
@@ -3641,18 +3642,6 @@
 
   return Fintern (make_pure_c_string (str), obarray);
 }
-
-/* Create an uninterned symbol with name STR.  */
-
-Lisp_Object
-make_symbol (const char *str)
-{
-  int len = strlen (str);
-
-  return Fmake_symbol (!NILP (Vpurify_flag)
-                      ? make_pure_string (str, len, len, 0)
-                      : make_string (str, len));
-}
 
 DEFUN ("intern", Fintern, Sintern, 1, 2, 0,
        doc: /* Return the canonical symbol whose name is STRING.

=== modified file 'src/macros.c'
--- a/src/macros.c      2011-02-16 16:35:16 +0000
+++ b/src/macros.c      2011-04-14 05:04:02 +0000
@@ -27,7 +27,8 @@
 #include "window.h"
 #include "keyboard.h"
 
-Lisp_Object Qexecute_kbd_macro, Qkbd_macro_termination_hook;
+Lisp_Object Qexecute_kbd_macro;
+static Lisp_Object Qkbd_macro_termination_hook;
 
 /* Number of successful iterations so far
    for innermost keyboard macro.
@@ -391,4 +392,3 @@
   DEFVAR_KBOARD ("last-kbd-macro", Vlast_kbd_macro,
                 doc: /* Last kbd macro defined, as a string or vector; nil if 
none defined.  */);
 }
-

=== modified file 'src/marker.c'
--- a/src/marker.c      2011-03-15 01:33:14 +0000
+++ b/src/marker.c      2011-04-14 06:48:41 +0000
@@ -242,6 +242,7 @@
 /* Used for debugging: recompute the bytepos corresponding to CHARPOS
    in the simplest, most reliable way.  */
 
+extern EMACS_INT verify_bytepos (EMACS_INT charpos) EXTERNALLY_VISIBLE;
 EMACS_INT
 verify_bytepos (EMACS_INT charpos)
 {
@@ -864,6 +865,7 @@
 
 /* For debugging -- count the markers in buffer BUF.  */
 
+extern int count_markers (struct buffer *) EXTERNALLY_VISIBLE;
 int
 count_markers (struct buffer *buf)
 {

=== modified file 'src/minibuf.c'
--- a/src/minibuf.c     2011-04-02 07:40:13 +0000
+++ b/src/minibuf.c     2011-04-14 05:04:02 +0000
@@ -45,7 +45,7 @@
 
 /* Data to remember during recursive minibuffer invocations  */
 
-Lisp_Object minibuf_save_list;
+static Lisp_Object minibuf_save_list;
 
 /* Depth in minibuffer invocations.  */
 
@@ -53,35 +53,35 @@
 
 /* The maximum length of a minibuffer history.  */
 
-Lisp_Object Qhistory_length;
+static Lisp_Object Qhistory_length;
 
 /* Fread_minibuffer leaves the input here as a string. */
 
 Lisp_Object last_minibuf_string;
 
-Lisp_Object Qminibuffer_history, Qbuffer_name_history;
+static Lisp_Object Qminibuffer_history, Qbuffer_name_history;
 
-Lisp_Object Qread_file_name_internal;
+static Lisp_Object Qread_file_name_internal;
 
 /* Normal hooks for entry to and exit from minibuffer.  */
 
-Lisp_Object Qminibuffer_setup_hook;
-Lisp_Object Qminibuffer_exit_hook;
+static Lisp_Object Qminibuffer_setup_hook;
+static Lisp_Object Qminibuffer_exit_hook;
 
 Lisp_Object Qcompletion_ignore_case;
-Lisp_Object Qminibuffer_completion_table;
-Lisp_Object Qminibuffer_completion_predicate;
-Lisp_Object Qminibuffer_completion_confirm;
-Lisp_Object Qcompleting_read_default;
-Lisp_Object Quser_variable_p;
-
-Lisp_Object Qminibuffer_default;
-
-Lisp_Object Qcurrent_input_method, Qactivate_input_method;
-
-Lisp_Object Qcase_fold_search;
-
-Lisp_Object Qread_expression_history;
+static Lisp_Object Qminibuffer_completion_table;
+static Lisp_Object Qminibuffer_completion_predicate;
+static Lisp_Object Qminibuffer_completion_confirm;
+static Lisp_Object Qcompleting_read_default;
+static Lisp_Object Quser_variable_p;
+
+static Lisp_Object Qminibuffer_default;
+
+static Lisp_Object Qcurrent_input_method, Qactivate_input_method;
+
+static Lisp_Object Qcase_fold_search;
+
+static Lisp_Object Qread_expression_history;
 
 /* Prompt to display in front of the mini-buffer contents.  */
 
@@ -97,7 +97,7 @@
    We do this whenever the user starts a new minibuffer
    or when a minibuffer exits.  */
 
-void
+static void
 choose_minibuf_frame (void)
 {
   if (FRAMEP (selected_frame)
@@ -872,7 +872,8 @@
 }
 
 
-DEFUN ("read-from-minibuffer", Fread_from_minibuffer, Sread_from_minibuffer, 
1, 7, 0,
+DEFUN ("read-from-minibuffer", Fread_from_minibuffer,
+       Sread_from_minibuffer, 1, 7, 0,
        doc: /* Read a string from the minibuffer, prompting with string PROMPT.
 The optional second arg INITIAL-CONTENTS is an obsolete alternative to
   DEFAULT-VALUE.  It normally should be nil in new code, except when

=== modified file 'src/print.c'
--- a/src/print.c       2011-04-08 15:37:15 +0000
+++ b/src/print.c       2011-04-14 07:09:45 +0000
@@ -39,11 +39,11 @@
 
 Lisp_Object Qstandard_output;
 
-Lisp_Object Qtemp_buffer_setup_hook;
+static Lisp_Object Qtemp_buffer_setup_hook;
 
 /* These are used to print like we read.  */
 
-Lisp_Object Qfloat_output_format;
+static Lisp_Object Qfloat_output_format;
 
 #include <math.h>
 
@@ -58,28 +58,28 @@
 #endif
 
 /* Avoid actual stack overflow in print.  */
-int print_depth;
+static int print_depth;
 
 /* Level of nesting inside outputting backquote in new style.  */
-int new_backquote_output;
+static int new_backquote_output;
 
 /* Detect most circularities to print finite output.  */
 #define PRINT_CIRCLE 200
-Lisp_Object being_printed[PRINT_CIRCLE];
+static Lisp_Object being_printed[PRINT_CIRCLE];
 
 /* When printing into a buffer, first we put the text in this
    block, then insert it all at once.  */
-char *print_buffer;
+static char *print_buffer;
 
 /* Size allocated in print_buffer.  */
-EMACS_INT print_buffer_size;
+static EMACS_INT print_buffer_size;
 /* Chars stored in print_buffer.  */
-EMACS_INT print_buffer_pos;
+static EMACS_INT print_buffer_pos;
 /* Bytes stored in print_buffer.  */
-EMACS_INT print_buffer_pos_byte;
+static EMACS_INT print_buffer_pos_byte;
 
 Lisp_Object Qprint_escape_newlines;
-Lisp_Object Qprint_escape_multibyte, Qprint_escape_nonascii;
+static Lisp_Object Qprint_escape_multibyte, Qprint_escape_nonascii;
 
 /* Vprint_number_table is a table, that keeps objects that are going to
    be printed, to allow use of #n= and #n# to express sharing.
@@ -89,8 +89,8 @@
      N    the object has been printed so we can refer to it as #N#.
    print_number_index holds the largest N already used.
    N has to be striclty larger than 0 since we need to distinguish -N.  */
-int print_number_index;
-void print_interval (INTERVAL interval, Lisp_Object printcharfun);
+static int print_number_index;
+static void print_interval (INTERVAL interval, Lisp_Object printcharfun);
 
 /* GDB resets this to zero on W32 to disable OutputDebugString calls.  */
 int print_output_debug_flag EXTERNALLY_VISIBLE = 1;
@@ -738,6 +738,7 @@
 /* This function is never called.  Its purpose is to prevent
    print_output_debug_flag from being optimized away.  */
 
+extern void debug_output_compilation_hack (int) EXTERNALLY_VISIBLE;
 void
 debug_output_compilation_hack (int x)
 {
@@ -751,7 +752,7 @@
 
 #define WITH_REDIRECT_DEBUGGING_OUTPUT 1
 
-FILE *initial_stderr_stream = NULL;
+static FILE *initial_stderr_stream = NULL;
 
 DEFUN ("redirect-debugging-output", Fredirect_debugging_output, 
Sredirect_debugging_output,
        1, 2,
@@ -798,6 +799,7 @@
   fprintf (stderr, "\r\n");
 }
 
+void safe_debug_print (Lisp_Object) EXTERNALLY_VISIBLE;
 void
 safe_debug_print (Lisp_Object arg)
 {

=== modified file 'src/process.c'
--- a/src/process.c     2011-04-10 14:00:13 +0000
+++ b/src/process.c     2011-04-14 19:34:42 +0000
@@ -127,22 +127,24 @@
 
 #ifdef subprocesses
 
-Lisp_Object Qprocessp;
-Lisp_Object Qrun, Qstop, Qsignal;
-Lisp_Object Qopen, Qclosed, Qconnect, Qfailed, Qlisten;
-Lisp_Object Qlocal, Qipv4, Qdatagram, Qseqpacket;
-Lisp_Object Qreal, Qnetwork, Qserial;
+static Lisp_Object Qprocessp;
+static Lisp_Object Qrun, Qstop, Qsignal;
+static Lisp_Object Qopen, Qclosed, Qconnect, Qfailed, Qlisten;
+Lisp_Object Qlocal;
+static Lisp_Object Qipv4, Qdatagram, Qseqpacket;
+static Lisp_Object Qreal, Qnetwork, Qserial;
 #ifdef AF_INET6
-Lisp_Object Qipv6;
+static Lisp_Object Qipv6;
 #endif
-Lisp_Object QCport, QCspeed, QCprocess;
+static Lisp_Object QCport, QCprocess;
+Lisp_Object QCspeed;
 Lisp_Object QCbytesize, QCstopbits, QCparity, Qodd, Qeven;
 Lisp_Object QCflowcontrol, Qhw, Qsw, QCsummary;
-Lisp_Object QCbuffer, QChost, QCservice;
-Lisp_Object QClocal, QCremote, QCcoding;
-Lisp_Object QCserver, QCnowait, QCnoquery, QCstop;
-Lisp_Object QCsentinel, QClog, QCoptions, QCplist;
-Lisp_Object Qlast_nonmenu_event;
+static Lisp_Object QCbuffer, QChost, QCservice;
+static Lisp_Object QClocal, QCremote, QCcoding;
+static Lisp_Object QCserver, QCnowait, QCnoquery, QCstop;
+static Lisp_Object QCsentinel, QClog, QCoptions, QCplist;
+static Lisp_Object Qlast_nonmenu_event;
 /* QCfamily is declared and initialized in xfaces.c,
    QCfilter in keyboard.c.  */
 extern Lisp_Object QCfamily, QCfilter;
@@ -163,12 +165,10 @@
 extern int h_errno;
 #endif
 
-/* These next two vars are non-static since sysdep.c uses them in the
-   emulation of `select'.  */
 /* Number of events of change of status of a process.  */
-int process_tick;
+static int process_tick;
 /* Number of events for which the user or sentinel has been notified.  */
-int update_tick;
+static int update_tick;
 
 /* Define NON_BLOCKING_CONNECT if we can support non-blocking connects.  */
 
@@ -235,6 +235,8 @@
 #define process_output_delay_count 0
 #endif
 
+static Lisp_Object Fget_process (Lisp_Object);
+static void create_process (Lisp_Object, char **, Lisp_Object);
 static int keyboard_bit_set (SELECT_TYPE *);
 static void deactivate_process (Lisp_Object);
 static void status_notify (struct Lisp_Process *);
@@ -284,10 +286,10 @@
 static int max_input_desc;
 
 /* Indexed by descriptor, gives the process (if any) for that descriptor */
-Lisp_Object chan_process[MAXDESC];
+static Lisp_Object chan_process[MAXDESC];
 
 /* Alist of elements (NAME . PROCESS) */
-Lisp_Object Vprocess_alist;
+static Lisp_Object Vprocess_alist;
 
 /* Buffered-ahead input char from process, indexed by channel.
    -1 means empty (no char is buffered).
@@ -295,8 +297,7 @@
    output from the process is to read at least one char.
    Always -1 on systems that support FIONREAD.  */
 
-/* Don't make static; need to access externally.  */
-int proc_buffered_char[MAXDESC];
+static int proc_buffered_char[MAXDESC];
 
 /* Table of `struct coding-system' for each process.  */
 static struct coding_system *proc_decode_coding_system[MAXDESC];
@@ -304,7 +305,7 @@
 
 #ifdef DATAGRAM_SOCKETS
 /* Table of `partner address' for datagram sockets.  */
-struct sockaddr_and_len {
+static struct sockaddr_and_len {
   struct sockaddr *sa;
   int len;
 } datagram_address[MAXDESC];
@@ -320,7 +321,7 @@
 
 
 
-struct fd_callback_data
+static struct fd_callback_data
 {
   fd_callback func;
   void *data;
@@ -1083,7 +1084,7 @@
 }
 
 #ifdef DATAGRAM_SOCKETS
-Lisp_Object Fprocess_datagram_address (Lisp_Object process);
+static Lisp_Object Fprocess_datagram_address (Lisp_Object);
 #endif
 
 DEFUN ("process-contact", Fprocess_contact, Sprocess_contact,
@@ -1518,7 +1519,7 @@
 }
 
 
-void
+static void
 create_process (Lisp_Object process, char **new_argv, Lisp_Object current_dir)
 {
   int inchannel, outchannel;
@@ -3790,7 +3791,7 @@
 
 /* Turn off input and output for process PROC.  */
 
-void
+static void
 deactivate_process (Lisp_Object proc)
 {
   register int inchannel, outchannel;
@@ -5216,8 +5217,8 @@
 
 /* Sending data to subprocess */
 
-jmp_buf send_process_frame;
-Lisp_Object process_sent_to;
+static jmp_buf send_process_frame;
+static Lisp_Object process_sent_to;
 
 static void
 send_process_trap (int ignore)
@@ -6982,8 +6983,8 @@
 #endif /* subprocesses */
 }
 
-DEFUN ("waiting-for-user-input-p", Fwaiting_for_user_input_p, 
Swaiting_for_user_input_p,
-       0, 0, 0,
+DEFUN ("waiting-for-user-input-p", Fwaiting_for_user_input_p,
+       Swaiting_for_user_input_p, 0, 0, 0,
        doc: /* Returns non-nil if Emacs is waiting for input from the user.
 This is intended for use by asynchronous process output filters and sentinels. 
 */)
   (void)
@@ -7185,7 +7186,9 @@
      processes.  As such, we only change the default value.  */
  if (initialized)
   {
-    const char *release = get_operating_system_release ();
+    char const *release = (STRINGP (Voperating_system_release)
+                          ? SSDATA (Voperating_system_release)
+                          : 0);
     if (!release || !release[0] || (release[0] < MIN_PTY_KERNEL_VERSION
                                    && release[1] == '.')) {
       Vprocess_connection_type = Qnil;

=== modified file 'src/process.h'
--- a/src/process.h     2011-01-25 04:08:28 +0000
+++ b/src/process.h     2011-04-14 02:16:00 +0000
@@ -143,12 +143,6 @@
 
 #define ChannelMask(n) (1<<(n))
 
-/* Indexed by descriptor, gives the process (if any) for that descriptor.  */
-extern Lisp_Object chan_process[];
-
-/* Alist of elements (NAME . PROCESS).  */
-extern Lisp_Object Vprocess_alist;
-
 /* True if we are about to fork off a synchronous process or if we
    are waiting for it.  */
 extern int synch_process_alive;
@@ -181,7 +175,7 @@
 extern Lisp_Object Qcutime, Qpri, Qnice, Qthcount, Qstart, Qvsize, Qrss, Qargs;
 extern Lisp_Object Quser, Qgroup, Qetime, Qpcpu, Qpmem, Qtpgid, Qcstime;
 extern Lisp_Object Qtime, Qctime;
-extern Lisp_Object QCport, QCspeed, QCprocess;
+extern Lisp_Object QCspeed;
 extern Lisp_Object QCbytesize, QCstopbits, QCparity, Qodd, Qeven;
 extern Lisp_Object QCflowcontrol, Qhw, Qsw, QCsummary;
 
@@ -198,4 +192,3 @@
 extern void delete_read_fd (int fd);
 extern void add_write_fd (int fd, fd_callback func, void *data);
 extern void delete_write_fd (int fd);
-

=== modified file 'src/region-cache.c'
--- a/src/region-cache.c        2011-03-18 06:25:25 +0000
+++ b/src/region-cache.c        2011-04-14 06:48:41 +0000
@@ -781,6 +781,7 @@
 
 /* Debugging: pretty-print a cache to the standard error output.  */
 
+void pp_cache (struct region_cache *) EXTERNALLY_VISIBLE;
 void
 pp_cache (struct region_cache *c)
 {

=== modified file 'src/region-cache.h'
--- a/src/region-cache.h        2011-03-18 06:22:42 +0000
+++ b/src/region-cache.h        2011-04-14 06:48:41 +0000
@@ -110,6 +110,3 @@
                                   struct region_cache *CACHE,
                                   EMACS_INT POS,
                                   EMACS_INT *NEXT);
-
-/* For debugging.  */
-void pp_cache (struct region_cache *);

=== modified file 'src/scroll.c'
--- a/src/scroll.c      2011-03-29 14:00:16 +0000
+++ b/src/scroll.c      2011-04-14 02:20:00 +0000
@@ -882,44 +882,6 @@
   return matchcount;
 }
 
-/* Return a measure of the cost of moving the lines starting with vpos
-   FROM, up to but not including vpos TO, down by AMOUNT lines (AMOUNT
-   may be negative).  */
-
-int
-scroll_cost (FRAME_PTR frame, int from, int to, int amount)
-{
-  /* Compute how many lines, at bottom of frame,
-     will not be involved in actual motion.  */
-  EMACS_INT limit = to;
-  EMACS_INT offset;
-  EMACS_INT height = FRAME_LINES (frame);
-
-  if (amount == 0)
-    return 0;
-
-  if (! FRAME_SCROLL_REGION_OK (frame))
-    limit = height;
-  else if (amount > 0)
-    limit += amount;
-
-  if (amount < 0)
-    {
-      int temp = to;
-      to = from + amount;
-      from = temp + amount;
-      amount = - amount;
-    }
-
-  offset = height - limit;
-
-  return
-    (FRAME_INSERT_COST (frame)[offset + from]
-     + (amount - 1) * FRAME_INSERTN_COST (frame)[offset + from]
-     + FRAME_DELETE_COST (frame)[offset + to]
-     + (amount - 1) * FRAME_DELETEN_COST (frame)[offset + to]);
-}
-
 /* Calculate the line insertion/deletion
    overhead and multiply factor values */
 

=== modified file 'src/search.c'
--- a/src/search.c      2011-04-09 16:35:19 +0000
+++ b/src/search.c      2011-04-14 05:04:02 +0000
@@ -53,10 +53,10 @@
 };
 
 /* The instances of that struct.  */
-struct regexp_cache searchbufs[REGEXP_CACHE_SIZE];
+static struct regexp_cache searchbufs[REGEXP_CACHE_SIZE];
 
 /* The head of the linked list; points to the most recently used buffer.  */
-struct regexp_cache *searchbuf_head;
+static struct regexp_cache *searchbuf_head;
 
 
 /* Every call to re_match, etc., must pass &search_regs as the regs
@@ -85,10 +85,10 @@
 
 /* error condition signaled when regexp compile_pattern fails */
 
-Lisp_Object Qinvalid_regexp;
+static Lisp_Object Qinvalid_regexp;
 
 /* Error condition used for failing searches */
-Lisp_Object Qsearch_failed;
+static Lisp_Object Qsearch_failed;
 
 static void set_search_regs (EMACS_INT, EMACS_INT);
 static void save_search_regs (void);

=== modified file 'src/sound.c'
--- a/src/sound.c       2011-04-12 10:20:32 +0000
+++ b/src/sound.c       2011-04-14 20:16:48 +0000
@@ -94,9 +94,9 @@
 
 /* Symbols.  */
 
-Lisp_Object QCvolume, QCdevice;
-Lisp_Object Qsound;
-Lisp_Object Qplay_sound_functions;
+static Lisp_Object QCvolume, QCdevice;
+static Lisp_Object Qsound;
+static Lisp_Object Qplay_sound_functions;
 
 /* Indices of attributes in a sound attributes vector.  */
 
@@ -281,8 +281,8 @@
 /* These are set during `play-sound-internal' so that sound_cleanup has
    access to them.  */
 
-struct sound_device *current_sound_device;
-struct sound *current_sound;
+static struct sound_device *current_sound_device;
+static struct sound *current_sound;
 
 /* Function prototypes.  */
 

=== modified file 'src/syntax.c'
--- a/src/syntax.c      2011-04-09 22:51:22 +0000
+++ b/src/syntax.c      2011-04-14 19:34:42 +0000
@@ -95,12 +95,15 @@
 #define ST_COMMENT_STYLE (256 + 1)
 #define ST_STRING_STYLE (256 + 2)
 
-Lisp_Object Qsyntax_table_p, Qsyntax_table, Qscan_error;
+static Lisp_Object Qsyntax_table_p;
+static Lisp_Object Qsyntax_table, Qscan_error;
 
+#ifndef __GNUC__
 /* Used as a temporary in SYNTAX_ENTRY and other macros in syntax.h,
    if not compiled with GCC.  No need to mark it, since it is used
    only very temporarily.  */
 Lisp_Object syntax_temp;
+#endif
 
 /* This is the internal form of the parse state used in parse-partial-sexp.  */
 
@@ -138,6 +141,7 @@
 static int find_start_modiff;
 
 
+static Lisp_Object Fsyntax_table_p (Lisp_Object);
 static Lisp_Object skip_chars (int, Lisp_Object, Lisp_Object, int);
 static Lisp_Object skip_syntaxes (int, Lisp_Object, Lisp_Object);
 static Lisp_Object scan_lists (EMACS_INT, EMACS_INT, EMACS_INT, int);
@@ -1366,8 +1370,6 @@
   return val == orig_val ? Qt : Qnil;
 }
 
-Lisp_Object skip_chars (int, Lisp_Object, Lisp_Object, int);
-
 DEFUN ("skip-chars-forward", Fskip_chars_forward, Sskip_chars_forward, 1, 2, 0,
        doc: /* Move point forward, stopping before a char not in STRING, or at 
pos LIM.
 STRING is like the inside of a `[...]' in a regular expression

=== modified file 'src/syntax.h'
--- a/src/syntax.h      2011-02-16 15:02:50 +0000
+++ b/src/syntax.h      2011-04-11 03:39:45 +0000
@@ -19,7 +19,6 @@
 along with GNU Emacs.  If not, see <http://www.gnu.org/licenses/>.  */
 
 
-extern Lisp_Object Qsyntax_table_p;
 extern void update_syntax_table (EMACS_INT, int, int, Lisp_Object);
 
 /* The standard syntax table is stored where it will automatically
@@ -300,4 +299,3 @@
 
 extern struct gl_state_s gl_state;
 extern EMACS_INT scan_words (EMACS_INT, EMACS_INT);
-

=== modified file 'src/sysdep.c'
--- a/src/sysdep.c      2011-04-12 08:12:01 +0000
+++ b/src/sysdep.c      2011-04-14 20:16:48 +0000
@@ -118,6 +118,12 @@
 #endif
 #endif
 
+static int emacs_get_tty (int, struct emacs_tty *);
+static int emacs_set_tty (int, struct emacs_tty *, int);
+#if defined TIOCNOTTY || defined USG5 || defined CYGWIN
+static void croak (char *) NO_RETURN;
+#endif
+
 /* Declare here, including term.h is problematic on some systems.  */
 extern void tputs (const char *, int, int (*)(int));
 
@@ -127,12 +133,6 @@
     1800, 2400, 4800, 9600, 19200, 38400
   };
 
-void croak (char *) NO_RETURN;
-
-/* Temporary used by `sigblock' when defined in terms of signprocmask.  */
-
-SIGMASKTYPE sigprocmask_set;
-
 
 #if !defined (HAVE_GET_CURRENT_DIR_NAME) || defined 
(BROKEN_GET_CURRENT_DIR_NAME)
 
@@ -291,8 +291,9 @@
 
 
 
-int wait_debugging;   /* Set nonzero to make following function work under dbx
-                        (at least for bsd).  */
+/* Set nonzero to make following function work under dbx
+   (at least for bsd).  */
+int wait_debugging EXTERNALLY_VISIBLE;
 
 #ifndef MSDOS
 /* Wait for subprocess with process id `pid' to terminate and
@@ -650,7 +651,7 @@
 #else
 #ifdef F_SETFL
 
-int old_fcntl_flags[MAXDESC];
+static int old_fcntl_flags[MAXDESC];
 
 void
 init_sigio (int fd)
@@ -809,7 +810,7 @@
 
 
 #ifdef F_SETOWN
-int old_fcntl_owner[MAXDESC];
+static int old_fcntl_owner[MAXDESC];
 #endif /* F_SETOWN */
 
 /* This may also be defined in stdio,
@@ -1451,7 +1452,7 @@
 /* POSIX signals support - DJB */
 /* Anyone with POSIX signals should have ANSI C declarations */
 
-sigset_t empty_mask, full_mask;
+sigset_t empty_mask;
 
 #ifndef WINDOWSNT
 
@@ -1540,7 +1541,6 @@
 init_signals (void)
 {
   sigemptyset (&empty_mask);
-  sigfillset (&full_mask);
 
 #if !defined HAVE_STRSIGNAL && !HAVE_DECL_SYS_SIGLIST
   if (! initialized)

=== modified file 'src/syssignal.h'
--- a/src/syssignal.h   2011-03-27 02:27:11 +0000
+++ b/src/syssignal.h   2011-04-14 06:26:22 +0000
@@ -35,8 +35,7 @@
 #define SIGMASKTYPE sigset_t
 
 #define SIGEMPTYMASK (empty_mask)
-#define SIGFULLMASK (full_mask)
-extern sigset_t empty_mask, full_mask;
+extern sigset_t empty_mask;
 
 /* POSIX pretty much destroys any possibility of writing sigmask as a
    macro in standard C.  We always define our own version because the
@@ -75,6 +74,9 @@
 sigset_t sys_sigblock   (sigset_t new_mask);
 sigset_t sys_sigunblock (sigset_t new_mask);
 sigset_t sys_sigsetmask (sigset_t new_mask);
+#if ! (defined TIOCNOTTY || defined USG5 || defined CYGWIN)
+void croak (char *) NO_RETURN;
+#endif
 
 #define sys_sigdel(MASK,SIG) sigdelset (&MASK,SIG)
 

=== modified file 'src/systty.h'
--- a/src/systty.h      2011-03-14 22:49:41 +0000
+++ b/src/systty.h      2011-04-14 02:38:06 +0000
@@ -115,9 +115,6 @@
 #endif /* DOS_NT */
 };
 
-extern int emacs_get_tty (int, struct emacs_tty *);
-extern int emacs_set_tty (int, struct emacs_tty *, int);
-
 /* From sysdep.c or w32.c  */
 extern int serial_open (char *);
 extern void serial_configure (struct Lisp_Process *, Lisp_Object);

=== modified file 'src/term.c'
--- a/src/term.c        2011-04-09 18:42:31 +0000
+++ b/src/term.c        2011-04-14 05:04:02 +0000
@@ -77,9 +77,11 @@
 static void tty_set_scroll_region (struct frame *f, int start, int stop);
 static void turn_on_face (struct frame *, int face_id);
 static void turn_off_face (struct frame *, int face_id);
+static void tty_turn_off_highlight (struct tty_display_info *);
 static void tty_show_cursor (struct tty_display_info *);
 static void tty_hide_cursor (struct tty_display_info *);
 static void tty_background_highlight (struct tty_display_info *tty);
+static struct terminal *get_tty_terminal (Lisp_Object, int);
 static void clear_tty_hooks (struct terminal *terminal);
 static void set_tty_hooks (struct terminal *terminal);
 static void dissociate_if_controlling_tty (int fd);
@@ -133,11 +135,11 @@
 
 /* The largest frame width in any call to calculate_costs.  */
 
-int max_frame_cols;
+static int max_frame_cols;
 
 /* The largest frame height in any call to calculate_costs.  */
 
-int max_frame_lines;
+static int max_frame_lines;
 
 /* Non-zero if we have dropped our controlling tty and therefore
    should not open a frame on stdout. */
@@ -173,7 +175,7 @@
 
 /* Set up termcap modes for Emacs. */
 
-void
+static void
 tty_set_terminal_modes (struct terminal *terminal)
 {
   struct tty_display_info *tty = terminal->display_info.tty;
@@ -201,7 +203,7 @@
 
 /* Reset termcap modes before exiting Emacs. */
 
-void
+static void
 tty_reset_terminal_modes (struct terminal *terminal)
 {
   struct tty_display_info *tty = terminal->display_info.tty;
@@ -286,7 +288,7 @@
 
 /* Handle highlighting.  */
 
-void
+static void
 tty_turn_off_highlight (struct tty_display_info *tty)
 {
   if (tty->standout_mode)
@@ -2368,7 +2370,7 @@
 
 /* Return the tty display object specified by TERMINAL. */
 
-struct terminal *
+static struct terminal *
 get_tty_terminal (Lisp_Object terminal, int throw)
 {
   struct terminal *t = get_terminal (terminal, throw);
@@ -2614,6 +2616,8 @@
  ***********************************************************************/
 
 #ifdef HAVE_GPM
+
+#ifndef HAVE_WINDOW_SYSTEM
 void
 term_mouse_moveto (int x, int y)
 {
@@ -2627,6 +2631,7 @@
   last_mouse_x = x;
   last_mouse_y = y;  */
 }
+#endif /* HAVE_WINDOW_SYSTEM */
 
 /* Implementation of draw_row_with_mouse_face for TTY/GPM.  */
 void

=== modified file 'src/termhooks.h'
--- a/src/termhooks.h   2011-03-11 09:41:56 +0000
+++ b/src/termhooks.h   2011-04-14 02:52:33 +0000
@@ -306,7 +306,9 @@
 #ifdef HAVE_GPM
 #include <gpm.h>
 extern int handle_one_term_event (struct tty_display_info *, Gpm_Event *, 
struct input_event *);
+#ifndef HAVE_WINDOW_SYSTEM
 extern void term_mouse_moveto (int, int);
+#endif
 
 /* The device for which we have enabled gpm support.  */
 extern struct tty_display_info *gpm_tty;
@@ -660,4 +662,3 @@
 #ifdef HAVE_GPM
 extern void close_gpm (int gpm_fd);
 #endif
-

=== modified file 'src/textprop.c'
--- a/src/textprop.c    2011-04-04 19:30:48 +0000
+++ b/src/textprop.c    2011-04-14 19:34:42 +0000
@@ -47,16 +47,19 @@
 
 
 /* Types of hooks.  */
-Lisp_Object Qmouse_left;
-Lisp_Object Qmouse_entered;
+static Lisp_Object Qmouse_left;
+static Lisp_Object Qmouse_entered;
 Lisp_Object Qpoint_left;
 Lisp_Object Qpoint_entered;
 Lisp_Object Qcategory;
 Lisp_Object Qlocal_map;
 
 /* Visual properties text (including strings) may have.  */
-Lisp_Object Qforeground, Qbackground, Qfont, Qunderline, Qstipple;
-Lisp_Object Qinvisible, Qread_only, Qintangible, Qmouse_face;
+static Lisp_Object Qforeground, Qbackground, Qunderline;
+Lisp_Object Qfont;
+static Lisp_Object Qstipple;
+Lisp_Object Qinvisible, Qintangible, Qmouse_face;
+static Lisp_Object Qread_only;
 Lisp_Object Qminibuffer_prompt;
 
 /* Sticky properties */
@@ -69,10 +72,12 @@
 
 /* verify_interval_modification saves insertion hooks here
    to be run later by report_interval_modification.  */
-Lisp_Object interval_insert_behind_hooks;
-Lisp_Object interval_insert_in_front_hooks;
+static Lisp_Object interval_insert_behind_hooks;
+static Lisp_Object interval_insert_in_front_hooks;
 
 static void text_read_only (Lisp_Object) NO_RETURN;
+static Lisp_Object Fprevious_property_change (Lisp_Object, Lisp_Object,
+                                             Lisp_Object);
 
 
 /* Signal a `text-read-only' error.  This function makes it easier

=== modified file 'src/undo.c'
--- a/src/undo.c        2011-02-16 15:02:50 +0000
+++ b/src/undo.c        2011-04-14 05:04:02 +0000
@@ -26,11 +26,11 @@
 
 /* Last buffer for which undo information was recorded.  */
 /* BEWARE: This is not traced by the GC, so never dereference it!  */
-struct buffer *last_undo_buffer;
+static struct buffer *last_undo_buffer;
 
 /* Position of point last time we inserted a boundary.  */
-struct buffer *last_boundary_buffer;
-EMACS_INT last_boundary_position;
+static struct buffer *last_boundary_buffer;
+static EMACS_INT last_boundary_position;
 
 Lisp_Object Qinhibit_read_only;
 
@@ -43,7 +43,7 @@
    which will be added to the list at the end of the command.
    This ensures we can't run out of space while trying to make
    an undo-boundary.  */
-Lisp_Object pending_boundary;
+static Lisp_Object pending_boundary;
 
 /* Record point as it was at beginning of this command (if necessary)
    and prepare the undo info for recording a change.
@@ -711,4 +711,3 @@
               doc: /* Non-nil means do not record `point' in 
`buffer-undo-list'.  */);
   undo_inhibit_record_point = 0;
 }
-

=== modified file 'src/window.c'
--- a/src/window.c      2011-04-09 18:42:31 +0000
+++ b/src/window.c      2011-04-14 19:34:42 +0000
@@ -50,10 +50,11 @@
 #include "nsterm.h"
 #endif
 
-Lisp_Object Qwindowp, Qwindow_live_p, Qwindow_configuration_p;
-Lisp_Object Qdisplay_buffer;
-Lisp_Object Qscroll_up, Qscroll_down, Qscroll_command;
-Lisp_Object Qwindow_size_fixed;
+Lisp_Object Qwindowp, Qwindow_live_p;
+static Lisp_Object Qwindow_configuration_p;
+static Lisp_Object Qdisplay_buffer;
+static Lisp_Object Qscroll_up, Qscroll_down, Qscroll_command;
+static Lisp_Object Qwindow_size_fixed;
 
 static int displayed_window_lines (struct window *);
 static struct window *decode_window (Lisp_Object);
@@ -116,7 +117,7 @@
 
 /* Hook run at end of temp_output_buffer_show.  */
 
-Lisp_Object Qtemp_buffer_show_hook;
+static Lisp_Object Qtemp_buffer_show_hook;
 
 /* Incremented for each window created.  */
 
@@ -131,7 +132,7 @@
 static Lisp_Object Qwindow_configuration_change_hook;
 /* Incremented by 1 whenever a window is deleted.  */
 
-int window_deletion_count;
+static int window_deletion_count;
 
 /* Used by the function window_scroll_pixel_based */
 
@@ -235,7 +236,8 @@
   return FRAME_MINIBUF_WINDOW (XFRAME (frame));
 }
 
-DEFUN ("window-minibuffer-p", Fwindow_minibuffer_p, Swindow_minibuffer_p, 0, 
1, 0,
+DEFUN ("window-minibuffer-p", Fwindow_minibuffer_p,
+       Swindow_minibuffer_p, 0, 1, 0,
        doc: /* Return non-nil if WINDOW is a minibuffer window.
 WINDOW defaults to the selected window.  */)
   (Lisp_Object window)
@@ -2336,6 +2338,7 @@
 
 /* Used for debugging.  Abort if any window has a dead buffer.  */
 
+extern void check_all_windows (void) EXTERNALLY_VISIBLE;
 void
 check_all_windows (void)
 {
@@ -3275,8 +3278,12 @@
 
 int window_select_count;
 
-EXFUN (Fset_window_fringes, 4);
-EXFUN (Fset_window_scroll_bars, 4);
+static Lisp_Object Fset_window_margins (Lisp_Object, Lisp_Object, Lisp_Object);
+static Lisp_Object Fset_window_fringes (Lisp_Object, Lisp_Object, Lisp_Object,
+                                       Lisp_Object);
+static Lisp_Object Fset_window_scroll_bars (Lisp_Object, Lisp_Object,
+                                           Lisp_Object, Lisp_Object);
+static Lisp_Object Fset_window_vscroll (Lisp_Object, Lisp_Object, Lisp_Object);
 
 static void
 run_funs (Lisp_Object funs)
@@ -6607,8 +6614,8 @@
                            Scroll bars
  ***********************************************************************/
 
-DEFUN ("set-window-scroll-bars", Fset_window_scroll_bars, 
Sset_window_scroll_bars,
-       2, 4, 0,
+DEFUN ("set-window-scroll-bars", Fset_window_scroll_bars,
+       Sset_window_scroll_bars, 2, 4, 0,
        doc: /* Set width and type of scroll bars of window WINDOW.
 If window is nil, set scroll bars of the currently selected window.
 Second parameter WIDTH specifies the pixel width for the scroll bar;

=== modified file 'src/window.h'
--- a/src/window.h      2011-03-21 16:42:16 +0000
+++ b/src/window.h      2011-04-14 06:48:41 +0000
@@ -763,8 +763,6 @@
 EXFUN (Fnext_window, 3);
 EXFUN (Fselect_window, 2);
 EXFUN (Fset_window_buffer, 3);
-EXFUN (Fset_window_vscroll, 3);
-EXFUN (Fset_window_margins, 3);
 EXFUN (Fset_window_point, 2);
 extern Lisp_Object make_window (void);
 extern Lisp_Object window_from_coordinates (struct frame *, int, int,
@@ -778,7 +776,6 @@
 extern void grow_mini_window (struct window *, int);
 extern void shrink_mini_window (struct window *);
 extern int window_relative_x_coord (struct window *, enum window_part, int);
-extern void check_all_windows (void);
 
 void run_window_configuration_change_hook (struct frame *f);
 

=== modified file 'src/xdisp.c'
--- a/src/xdisp.c       2011-04-13 17:43:38 +0000
+++ b/src/xdisp.c       2011-04-14 20:16:48 +0000
@@ -318,29 +318,31 @@
 
 Lisp_Object Qoverriding_local_map, Qoverriding_terminal_local_map;
 Lisp_Object Qwindow_scroll_functions;
-Lisp_Object Qwindow_text_change_functions;
-Lisp_Object Qredisplay_end_trigger_functions;
+static Lisp_Object Qwindow_text_change_functions;
+static Lisp_Object Qredisplay_end_trigger_functions;
 Lisp_Object Qinhibit_point_motion_hooks;
-Lisp_Object QCeval, QCfile, QCdata, QCpropertize;
-Lisp_Object Qfontified;
-Lisp_Object Qgrow_only;
-Lisp_Object Qinhibit_eval_during_redisplay;
-Lisp_Object Qbuffer_position, Qposition, Qobject;
-Lisp_Object Qright_to_left, Qleft_to_right;
+static Lisp_Object QCeval, QCpropertize;
+Lisp_Object QCfile, QCdata;
+static Lisp_Object Qfontified;
+static Lisp_Object Qgrow_only;
+static Lisp_Object Qinhibit_eval_during_redisplay;
+static Lisp_Object Qbuffer_position, Qposition, Qobject;
+static Lisp_Object Qright_to_left, Qleft_to_right;
 
 /* Cursor shapes */
 Lisp_Object Qbar, Qhbar, Qbox, Qhollow;
 
 /* Pointer shapes */
-Lisp_Object Qarrow, Qhand, Qtext;
+static Lisp_Object Qarrow, Qhand;
+Lisp_Object Qtext;
 
 /* Holds the list (error).  */
-Lisp_Object list_of_error;
-
-Lisp_Object Qfontification_functions;
-
-Lisp_Object Qwrap_prefix;
-Lisp_Object Qline_prefix;
+static Lisp_Object list_of_error;
+
+static Lisp_Object Qfontification_functions;
+
+static Lisp_Object Qwrap_prefix;
+static Lisp_Object Qline_prefix;
 
 /* Non-nil means don't actually do any redisplay.  */
 
@@ -350,12 +352,14 @@
 
 Lisp_Object Qdisplay;
 
-Lisp_Object Qspace, QCalign_to, QCrelative_width, QCrelative_height;
-Lisp_Object Qleft_margin, Qright_margin, Qspace_width, Qraise;
-Lisp_Object Qslice;
+Lisp_Object Qspace, QCalign_to;
+static Lisp_Object QCrelative_width, QCrelative_height;
+Lisp_Object Qleft_margin, Qright_margin;
+static Lisp_Object Qspace_width, Qraise;
+static Lisp_Object Qslice;
 Lisp_Object Qcenter;
-Lisp_Object Qmargin, Qpointer;
-Lisp_Object Qline_height;
+static Lisp_Object Qmargin, Qpointer;
+static Lisp_Object Qline_height;
 
 #ifdef HAVE_WINDOW_SYSTEM
 
@@ -383,15 +387,15 @@
 
 /* Name of the face used to highlight trailing whitespace.  */
 
-Lisp_Object Qtrailing_whitespace;
+static Lisp_Object Qtrailing_whitespace;
 
 /* Name and number of the face used to highlight escape glyphs.  */
 
-Lisp_Object Qescape_glyph;
+static Lisp_Object Qescape_glyph;
 
 /* Name and number of the face used to highlight non-breaking spaces.  */
 
-Lisp_Object Qnobreak_space;
+static Lisp_Object Qnobreak_space;
 
 /* The symbol `image' which is the car of the lists used to represent
    images in Lisp.  Also a tool bar style.  */
@@ -399,8 +403,9 @@
 Lisp_Object Qimage;
 
 /* The image map types.  */
-Lisp_Object QCmap, QCpointer;
-Lisp_Object Qrect, Qcircle, Qpoly;
+Lisp_Object QCmap;
+static Lisp_Object QCpointer;
+static Lisp_Object Qrect, Qcircle, Qpoly;
 
 /* Tool bar styles */
 Lisp_Object Qboth, Qboth_horiz, Qtext_image_horiz;
@@ -460,12 +465,12 @@
    Voverlay_arrow_position is a marker, last-arrow-position is its
    numerical position.  */
 
-Lisp_Object Qlast_arrow_position, Qlast_arrow_string;
+static Lisp_Object Qlast_arrow_position, Qlast_arrow_string;
 
 /* Alternative overlay-arrow-string and overlay-arrow-bitmap
    properties on a symbol in overlay-arrow-variable-list.  */
 
-Lisp_Object Qoverlay_arrow_string, Qoverlay_arrow_bitmap;
+static Lisp_Object Qoverlay_arrow_string, Qoverlay_arrow_bitmap;
 
 Lisp_Object Qmenu_bar_update_hook;
 
@@ -494,12 +499,12 @@
    message_enable_multibyte on the stack, the function restore_message
    pops the stack and displays MESSAGE again.  */
 
-Lisp_Object Vmessage_stack;
+static Lisp_Object Vmessage_stack;
 
 /* Nonzero means multibyte characters were enabled when the echo area
    message was specified.  */
 
-int message_enable_multibyte;
+static int message_enable_multibyte;
 
 /* Nonzero if we should redraw the mode lines on the next redisplay.  */
 
@@ -517,7 +522,7 @@
 /* Nonzero after display_mode_line if %l was used and it displayed a
    line number.  */
 
-int line_number_displayed;
+static int line_number_displayed;
 
 /* The name of the *Messages* buffer, a string.  */
 
@@ -544,12 +549,12 @@
 /* Nonzero if echo area is being used by print; zero if being used by
    message.  */
 
-int message_buf_print;
+static int message_buf_print;
 
 /* The symbol `inhibit-menubar-update' and its DEFVAR_BOOL variable.  */
 
-Lisp_Object Qinhibit_menubar_update;
-Lisp_Object Qmessage_truncate_lines;
+static Lisp_Object Qinhibit_menubar_update;
+static Lisp_Object Qmessage_truncate_lines;
 
 /* Set to 1 in clear_message to make redisplay_internal aware
    of an emptied echo area.  */
@@ -560,7 +565,7 @@
    glyphs.  Also used in direct_output_for_insert.  */
 
 #define MAX_SCRATCH_GLYPHS 100
-struct glyph_row scratch_glyph_row;
+static struct glyph_row scratch_glyph_row;
 static struct glyph scratch_glyphs[MAX_SCRATCH_GLYPHS];
 
 /* Ascent and height of the last line processed by move_it_to.  */
@@ -603,11 +608,11 @@
 #define TRACE_MOVE(x)  (void) 0
 #endif
 
-Lisp_Object Qauto_hscroll_mode;
+static Lisp_Object Qauto_hscroll_mode;
 
 /* Buffer being redisplayed -- for redisplay_window_error.  */
 
-struct buffer *displayed_buffer;
+static struct buffer *displayed_buffer;
 
 /* Value returned from text property handlers (see below).  */
 
@@ -708,7 +713,7 @@
 
 int redisplaying_p;
 
-Lisp_Object Qinhibit_free_realized_faces;
+static Lisp_Object Qinhibit_free_realized_faces;
 
 /* If a string, XTread_socket generates an event to display that string.
    (The display is done in read_char.)  */
@@ -735,7 +740,7 @@
 Lisp_Object Qglyphless_char;
 
 /* Symbol for the purpose of Vglyphless_char_display.  */
-Lisp_Object Qglyphless_char_display;
+static Lisp_Object Qglyphless_char_display;
 
 /* Method symbols for Vglyphless_char_display.  */
 static Lisp_Object Qhex_code, Qempty_box, Qthin_space, Qzero_width;
@@ -751,6 +756,7 @@
 /* Function prototypes.  */
 
 static void setup_for_ellipsis (struct it *, int);
+static void set_iterator_to_next (struct it *, int);
 static void mark_window_display_accurate_1 (struct window *, int);
 static int single_display_spec_string_p (Lisp_Object, Lisp_Object);
 static int display_prop_string_p (Lisp_Object, Lisp_Object);
@@ -783,7 +789,9 @@
                                   EMACS_INT, Lisp_Object, EMACS_INT, 
EMACS_INT);
 static void clear_garbaged_frames (void);
 static int current_message_1 (EMACS_INT, Lisp_Object, EMACS_INT, EMACS_INT);
+static void pop_message (void);
 static int truncate_message_1 (EMACS_INT, Lisp_Object, EMACS_INT, EMACS_INT);
+static void set_message (const char *, Lisp_Object, EMACS_INT, int);
 static int set_message_1 (EMACS_INT, Lisp_Object, EMACS_INT, EMACS_INT);
 static int display_echo_area (struct window *);
 static int display_echo_area_1 (EMACS_INT, Lisp_Object, EMACS_INT, EMACS_INT);
@@ -815,6 +823,9 @@
 static Lisp_Object redisplay_window_error (Lisp_Object);
 static Lisp_Object redisplay_window_0 (Lisp_Object);
 static Lisp_Object redisplay_window_1 (Lisp_Object);
+static int set_cursor_from_row (struct window *, struct glyph_row *,
+                               struct glyph_matrix *, EMACS_INT, EMACS_INT,
+                               int, int);
 static int update_menu_bar (struct frame *, int, int);
 static int try_window_reusing_current_matrix (struct window *);
 static int try_window_id (struct window *);
@@ -852,6 +863,7 @@
                                   struct display_pos *);
 static void reseat_to_string (struct it *, const char *,
                               Lisp_Object, EMACS_INT, EMACS_INT, int, int);
+static int get_next_display_element (struct it *);
 static enum move_it_result
        move_it_in_display_line_to (struct it *, EMACS_INT, int,
                                   enum move_operation_enum);
@@ -899,6 +911,7 @@
 
 #endif /* HAVE_WINDOW_SYSTEM */
 
+static void show_mouse_face (Mouse_HLInfo *, enum draw_glyphs_face);
 static int coords_in_mouse_face_p (struct window *, int, int);
 
 
@@ -1115,7 +1128,7 @@
    *BOTTOM_RIGHT_Y the coordinates of the bottom-right corner of the
    box.  */
 
-INLINE void
+static INLINE void
 window_box_edges (struct window *w, int area, int *top_left_x, int *top_left_y,
                   int *bottom_right_x, int *bottom_right_y)
 {
@@ -1533,61 +1546,6 @@
 }
 
 
-/* Given HPOS/VPOS in the current matrix of W, return corresponding
-   frame-relative pixel positions in *FRAME_X and *FRAME_Y.  If we
-   can't tell the positions because W's display is not up to date,
-   return 0.  */
-
-int
-glyph_to_pixel_coords (struct window *w, int hpos, int vpos,
-                      int *frame_x, int *frame_y)
-{
-#ifdef HAVE_WINDOW_SYSTEM
-  if (FRAME_WINDOW_P (XFRAME (WINDOW_FRAME (w))))
-    {
-      int success_p;
-
-      xassert (hpos >= 0 && hpos < w->current_matrix->matrix_w);
-      xassert (vpos >= 0 && vpos < w->current_matrix->matrix_h);
-
-      if (display_completed)
-       {
-         struct glyph_row *row = MATRIX_ROW (w->current_matrix, vpos);
-         struct glyph *glyph = row->glyphs[TEXT_AREA];
-         struct glyph *end = glyph + min (hpos, row->used[TEXT_AREA]);
-
-         hpos = row->x;
-         vpos = row->y;
-         while (glyph < end)
-           {
-             hpos += glyph->pixel_width;
-             ++glyph;
-           }
-
-         /* If first glyph is partially visible, its first visible position is 
still 0.  */
-         if (hpos < 0)
-           hpos = 0;
-
-         success_p = 1;
-       }
-      else
-       {
-         hpos = vpos = 0;
-         success_p = 0;
-       }
-
-      *frame_x = WINDOW_TO_FRAME_PIXEL_X (w, hpos);
-      *frame_y = WINDOW_TO_FRAME_PIXEL_Y (w, vpos);
-      return success_p;
-    }
-#endif
-
-  *frame_x = hpos;
-  *frame_y = vpos;
-  return 1;
-}
-
-
 /* Find the glyph under window-relative coordinates X/Y in window W.
    Consider only glyphs from buffer text, i.e. no glyphs from overlay
    strings.  Return in *HPOS and *VPOS the row and column number of
@@ -1670,11 +1628,10 @@
   return glyph;
 }
 
-/* EXPORT:
-   Convert frame-relative x/y to coordinates relative to window W.
+/* Convert frame-relative x/y to coordinates relative to window W.
    Takes pseudo-windows into account.  */
 
-void
+static void
 frame_to_window_pixel_xy (struct window *w, int *x, int *y)
 {
   if (w->pseudo_window_p)
@@ -5632,7 +5589,7 @@
 unsigned last_glyphless_glyph_face_id = (1 << FACE_ID_BITS);
 int last_glyphless_glyph_merged_face_id = 0;
 
-int
+static int
 get_next_display_element (struct it *it)
 {
   /* Non-zero means that we found a display element.  Zero means that
@@ -9095,7 +9052,7 @@
 
 /* Pop the top-most entry off Vmessage_stack.  */
 
-void
+static void
 pop_message (void)
 {
   xassert (CONSP (Vmessage_stack));
@@ -9165,7 +9122,7 @@
    to t before calling set_message_1 (which calls insert).
   */
 
-void
+static void
 set_message (const char *s, Lisp_Object string,
             EMACS_INT nbytes, int multibyte_p)
 {
@@ -11315,7 +11272,7 @@
    return 0.  PREV_BUF and PREV_PT are the last point buffer and
    position.  BUF and PT are the current point buffer and position.  */
 
-int
+static int
 check_point_in_composition (struct buffer *prev_buf, EMACS_INT prev_pt,
                            struct buffer *buf, EMACS_INT pt)
 {
@@ -12402,7 +12359,7 @@
 
    Return 0 if cursor is not on this row, 1 otherwise.  */
 
-int
+static int
 set_cursor_from_row (struct window *w, struct glyph_row *row,
                     struct glyph_matrix *matrix,
                     EMACS_INT delta, EMACS_INT delta_bytes,
@@ -13673,7 +13630,7 @@
   return rc;
 }
 
-void
+static void
 set_vertical_scroll_bar (struct window *w)
 {
   EMACS_INT start, end, whole;
@@ -14482,7 +14439,6 @@
       && EQ (FRAME_SELECTED_WINDOW (f), window))
     {
       int redisplay_menu_p = 0;
-      int redisplay_tool_bar_p = 0;
 
       if (FRAME_WINDOW_P (f))
        {
@@ -14503,17 +14459,15 @@
       if (FRAME_WINDOW_P (f))
         {
 #if defined (USE_GTK) || defined (HAVE_NS)
-          redisplay_tool_bar_p = FRAME_EXTERNAL_TOOL_BAR (f);
+         if (FRAME_EXTERNAL_TOOL_BAR (f))
+           redisplay_tool_bar (f);
 #else
-          redisplay_tool_bar_p = WINDOWP (f->tool_bar_window)
-            && (FRAME_TOOL_BAR_LINES (f) > 0
-                || !NILP (Vauto_resize_tool_bars));
+         if (WINDOWP (f->tool_bar_window)
+             && (FRAME_TOOL_BAR_LINES (f) > 0
+                 || !NILP (Vauto_resize_tool_bars))
+             && redisplay_tool_bar (f))
+           ignore_mouse_drag_p = 1;
 #endif
-
-          if (redisplay_tool_bar_p && redisplay_tool_bar (f))
-           {
-             ignore_mouse_drag_p = 1;
-           }
         }
 #endif
     }
@@ -16989,7 +16943,7 @@
 
 /* Highlight trailing whitespace, if any, in ROW.  */
 
-void
+static void
 highlight_trailing_whitespace (struct frame *f, struct glyph_row *row)
 {
   int used = row->used[TEXT_AREA];
@@ -23931,7 +23885,7 @@
 
 /* Implementation of draw_row_with_mouse_face for GUI sessions, GPM,
    and MSDOS.  */
-void
+static void
 draw_row_with_mouse_face (struct window *w, int start_x, struct glyph_row *row,
                          int start_hpos, int end_hpos,
                          enum draw_glyphs_face draw)
@@ -23948,10 +23902,9 @@
 #endif
 }
 
-/* EXPORT:
-   Display the active region described by mouse_face_* according to DRAW.  */
+/* Display the active region described by mouse_face_* according to DRAW.  */
 
-void
+static void
 show_mouse_face (Mouse_HLInfo *hlinfo, enum draw_glyphs_face draw)
 {
   struct window *w = XWINDOW (hlinfo->mouse_face_window);

=== modified file 'src/xfaces.c'
--- a/src/xfaces.c      2011-04-01 17:41:46 +0000
+++ b/src/xfaces.c      2011-04-14 05:04:02 +0000
@@ -304,25 +304,29 @@
 
 /* Keyword symbols used for face attribute names.  */
 
-Lisp_Object QCfamily, QCheight, QCweight, QCslant, QCunderline;
-Lisp_Object QCinverse_video, QCforeground, QCbackground, QCstipple;
-Lisp_Object QCwidth, QCfont, QCbold, QCitalic;
-Lisp_Object QCreverse_video;
-Lisp_Object QCoverline, QCstrike_through, QCbox, QCinherit;
-Lisp_Object QCfontset;
+Lisp_Object QCfamily, QCheight, QCweight, QCslant;
+static Lisp_Object QCunderline;
+static Lisp_Object QCinverse_video, QCstipple;
+Lisp_Object QCforeground, QCbackground;
+Lisp_Object QCwidth;
+static Lisp_Object QCfont, QCbold, QCitalic;
+static Lisp_Object QCreverse_video;
+static Lisp_Object QCoverline, QCstrike_through, QCbox, QCinherit;
+static Lisp_Object QCfontset;
 
 /* Symbols used for attribute values.  */
 
-Lisp_Object Qnormal, Qbold, Qultra_light, Qextra_light, Qlight;
-Lisp_Object Qsemi_light, Qsemi_bold, Qextra_bold, Qultra_bold;
-Lisp_Object Qoblique, Qitalic, Qreverse_oblique, Qreverse_italic;
-Lisp_Object Qultra_condensed, Qextra_condensed, Qcondensed;
-Lisp_Object Qsemi_condensed, Qsemi_expanded, Qexpanded, Qextra_expanded;
-Lisp_Object Qultra_expanded;
-Lisp_Object Qreleased_button, Qpressed_button;
-Lisp_Object QCstyle, QCcolor, QCline_width;
-Lisp_Object Qunspecified;
-Lisp_Object Qignore_defface;
+Lisp_Object Qnormal;
+static Lisp_Object Qbold, Qultra_light, Qextra_light, Qlight;
+static Lisp_Object Qsemi_light, Qsemi_bold, Qextra_bold, Qultra_bold;
+static Lisp_Object Qoblique, Qitalic, Qreverse_oblique, Qreverse_italic;
+static Lisp_Object Qultra_condensed, Qextra_condensed, Qcondensed;
+static Lisp_Object Qsemi_condensed, Qsemi_expanded, Qexpanded, Qextra_expanded;
+static Lisp_Object Qultra_expanded;
+static Lisp_Object Qreleased_button, Qpressed_button;
+static Lisp_Object QCstyle, QCcolor, QCline_width;
+static Lisp_Object Qunspecified;
+static Lisp_Object Qignore_defface;
 
 char unspecified_fg[] = "unspecified-fg", unspecified_bg[] = "unspecified-bg";
 
@@ -333,15 +337,18 @@
 
 /* Names of basic faces.  */
 
-Lisp_Object Qdefault, Qtool_bar, Qregion, Qfringe;
-Lisp_Object Qheader_line, Qscroll_bar, Qcursor, Qborder, Qmouse, Qmenu;
-Lisp_Object Qmode_line_inactive, Qvertical_border;
+Lisp_Object Qdefault, Qtool_bar, Qfringe;
+static Lisp_Object Qregion;
+Lisp_Object Qheader_line, Qscroll_bar, Qcursor;
+static Lisp_Object Qborder, Qmouse, Qmenu;
+Lisp_Object Qmode_line_inactive;
+static Lisp_Object Qvertical_border;
 
 /* The symbol `face-alias'.  A symbols having that property is an
    alias for another face.  Value of the property is the name of
    the aliased face.  */
 
-Lisp_Object Qface_alias;
+static Lisp_Object Qface_alias;
 
 /* Alist of alternative font families.  Each element is of the form
    (FAMILY FAMILY1 FAMILY2 ...).  If fonts of FAMILY can't be loaded,
@@ -361,7 +368,7 @@
    font may be scaled if its name matches a regular expression in the
    list.  */
 
-Lisp_Object Qscalable_fonts_allowed;
+static Lisp_Object Qscalable_fonts_allowed;
 
 #define DEFAULT_FONT_LIST_LIMIT 100
 
@@ -377,11 +384,11 @@
 
 /* Property for basic faces which other faces cannot inherit.  */
 
-Lisp_Object Qface_no_inherit;
+static Lisp_Object Qface_no_inherit;
 
 /* Error symbol for wrong_type_argument in load_pixmap.  */
 
-Lisp_Object Qbitmap_spec_p;
+static Lisp_Object Qbitmap_spec_p;
 
 /* The next ID to assign to Lisp faces.  */
 
@@ -394,11 +401,11 @@
 
 /* TTY color-related functions (defined in tty-colors.el).  */
 
-Lisp_Object Qtty_color_desc, Qtty_color_by_index, Qtty_color_standard_values;
+static Lisp_Object Qtty_color_desc, Qtty_color_by_index, 
Qtty_color_standard_values;
 
 /* The name of the function used to compute colors on TTYs.  */
 
-Lisp_Object Qtty_color_alist;
+static Lisp_Object Qtty_color_alist;
 
 /* Counter for calls to clear_face_cache.  If this counter reaches
    CLEAR_FONT_TABLE_COUNT, and a frame has more than
@@ -418,7 +425,7 @@
    display.   This is a kluge to suppress `bold black' foreground text
    which is hard to read on an LCD monitor.  */
 
-int tty_suppress_bold_inverse_default_colors_p;
+static int tty_suppress_bold_inverse_default_colors_p;
 
 /* A list of the form `((x . y))' used to avoid consing in
    Finternal_set_lisp_face_attribute.  */
@@ -436,7 +443,7 @@
 /* Non-zero means the definition of the `menu' face for new frames has
    been changed.  */
 
-int menu_face_changed_default;
+static int menu_face_changed_default;
 
 
 /* Function prototypes.  */
@@ -606,6 +613,8 @@
 }
 
 
+#ifdef USE_X_TOOLKIT
+
 /* Free colors used on frame F.  PIXELS is an array of NPIXELS pixel
    color values.  Interrupt input must be blocked when this function
    is called.  */
@@ -626,7 +635,7 @@
       XFreeColors (dpy, cmap, pixels, npixels, 0);
     }
 }
-
+#endif /* USE_X_TOOLKIT */
 
 /* Create and return a GC for use on frame F.  GC values and mask
    are given by XGCV and MASK.  */
@@ -1138,7 +1147,7 @@
 
    This does the right thing for any type of frame.  */
 
-int
+static int
 defined_color (struct frame *f, const char *color_name, XColor *color_def, int 
alloc)
 {
   if (!FRAME_WINDOW_P (f))
@@ -1786,7 +1795,7 @@
          {
            /* This is a scalable font.  For backward compatibility,
               we set the specified size. */
-           font_entity = Fcopy_font_spec (font_entity);
+           font_entity = copy_font_spec (font_entity);
            ASET (font_entity, FONT_SIZE_INDEX,
                  AREF (font_spec, FONT_SIZE_INDEX));
          }
@@ -2310,9 +2319,9 @@
   if (!UNSPECIFIEDP (from[i]))
     {
       if (!UNSPECIFIEDP (to[i]))
-       to[i] = Fmerge_font_spec (from[i], to[i]);
+       to[i] = merge_font_spec (from[i], to[i]);
       else
-       to[i] = Fcopy_font_spec (from[i]);
+       to[i] = copy_font_spec (from[i]);
       if (! NILP (AREF (to[i], FONT_FOUNDRY_INDEX)))
        to[LFACE_FOUNDRY_INDEX] = SYMBOL_NAME (AREF (to[i], 
FONT_FOUNDRY_INDEX));
       if (! NILP (AREF (to[i], FONT_FAMILY_INDEX)))
@@ -4084,7 +4093,7 @@
 /* Free realized face FACE, including its X resources.  FACE may
    be null.  */
 
-void
+static void
 free_realized_face (struct frame *f, struct face *face)
 {
   if (face)
@@ -4602,26 +4611,6 @@
 }
 
 
-/* Return the ID of the realized ASCII face of Lisp face with ID
-   LFACE_ID on frame F.  Value is -1 if LFACE_ID isn't valid.  */
-
-int
-ascii_face_of_lisp_face (struct frame *f, int lface_id)
-{
-  int face_id;
-
-  if (lface_id >= 0 && lface_id < lface_id_to_name_size)
-    {
-      Lisp_Object face_name = lface_id_to_name[lface_id];
-      face_id = lookup_named_face (f, face_name, 1);
-    }
-  else
-    face_id = -1;
-
-  return face_id;
-}
-
-
 /* Return a face for charset ASCII that is like the face with id
    FACE_ID on frame F, but has a font that is STEPS steps smaller.
    STEPS < 0 means larger.  Value is the id of the face.  */
@@ -6190,7 +6179,7 @@
             if we don't have fonts, so we can stop here if not working
             on a window-system frame.  */
          || !FRAME_WINDOW_P (f)
-         || FACE_SUITABLE_FOR_CHAR_P (base_face, 0)))
+         || FACE_SUITABLE_FOR_ASCII_CHAR_P (base_face, 0)))
     return base_face->id;
 
   /* Begin with attributes from the base face.  */

=== modified file 'src/xfns.c'
--- a/src/xfns.c        2011-04-12 10:20:32 +0000
+++ b/src/xfns.c        2011-04-14 20:16:48 +0000
@@ -139,10 +139,10 @@
 
 static int x_in_use;
 
-Lisp_Object Qnone;
-Lisp_Object Qsuppress_icon;
-Lisp_Object Qundefined_color;
-Lisp_Object Qcompound_text, Qcancel_timer;
+static Lisp_Object Qnone;
+static Lisp_Object Qsuppress_icon;
+static Lisp_Object Qundefined_color;
+static Lisp_Object Qcompound_text, Qcancel_timer;
 Lisp_Object Qfont_param;
 
 #if GLYPH_DEBUG
@@ -150,9 +150,11 @@
 #endif
 
 #if defined (USE_GTK) && defined (HAVE_FREETYPE)
-char *x_last_font_name;
+static char *x_last_font_name;
 #endif
 
+static struct x_display_info *x_display_info_for_name (Lisp_Object);
+
 
 /* Error if we are not connected to X.  */
 
@@ -419,35 +421,6 @@
 
 
 
-static void x_default_font_parameter (struct frame *, Lisp_Object);
-
-static Lisp_Object unwind_create_frame (Lisp_Object);
-static Lisp_Object unwind_create_tip_frame (Lisp_Object);
-
-void x_set_foreground_color (struct frame *, Lisp_Object, Lisp_Object);
-static void x_set_wait_for_wm (struct frame *, Lisp_Object, Lisp_Object);
-void x_set_background_color (struct frame *, Lisp_Object, Lisp_Object);
-void x_set_mouse_color (struct frame *, Lisp_Object, Lisp_Object);
-void x_set_cursor_color (struct frame *, Lisp_Object, Lisp_Object);
-void x_set_border_color (struct frame *, Lisp_Object, Lisp_Object);
-void x_set_cursor_type (struct frame *, Lisp_Object, Lisp_Object);
-void x_set_icon_type (struct frame *, Lisp_Object, Lisp_Object);
-void x_set_icon_name (struct frame *, Lisp_Object, Lisp_Object);
-void x_explicitly_set_name (struct frame *, Lisp_Object, Lisp_Object);
-void x_set_menu_bar_lines (struct frame *, Lisp_Object, Lisp_Object);
-void x_set_title (struct frame *, Lisp_Object, Lisp_Object);
-void x_set_tool_bar_lines (struct frame *, Lisp_Object, Lisp_Object);
-void x_set_scroll_bar_foreground (struct frame *, Lisp_Object,
-                                  Lisp_Object);
-void x_set_scroll_bar_background (struct frame *, Lisp_Object,
-                                  Lisp_Object);
-static Lisp_Object x_default_scroll_bar_color_parameter (struct frame *,
-                                                         Lisp_Object,
-                                                         Lisp_Object,
-                                                         const char *, const 
char *,
-                                                         int);
-
-
 /* Store the screen positions of frame F into XPTR and YPTR.
    These are the positions of the containing window manager window,
    not Emacs's own window.  */
@@ -766,7 +739,7 @@
    In that case, just record the parameter's new value
    in the standard place; do not attempt to change the window.  */
 
-void
+static void
 x_set_foreground_color (struct frame *f, Lisp_Object arg, Lisp_Object oldval)
 {
   struct x_output *x = f->output_data.x;
@@ -802,7 +775,7 @@
   unload_color (f, old_fg);
 }
 
-void
+static void
 x_set_background_color (struct frame *f, Lisp_Object arg, Lisp_Object oldval)
 {
   struct x_output *x = f->output_data.x;
@@ -877,7 +850,7 @@
   return c;
 }
 
-void
+static void
 x_set_mouse_color (struct frame *f, Lisp_Object arg, Lisp_Object oldval)
 {
   struct x_output *x = f->output_data.x;
@@ -1022,7 +995,7 @@
   update_face_from_frame_parameter (f, Qmouse_color, arg);
 }
 
-void
+static void
 x_set_cursor_color (struct frame *f, Lisp_Object arg, Lisp_Object oldval)
 {
   unsigned long fore_pixel, pixel;
@@ -1093,7 +1066,7 @@
    Note that this does not fully take effect if done before
    F has an x-window.  */
 
-void
+static void
 x_set_border_pixel (struct frame *f, int pix)
 {
   unload_color (f, f->output_data.x->border_pixel);
@@ -1122,7 +1095,7 @@
    Note: under X11, this is normally the province of the window manager,
    and so emacs' border colors may be overridden.  */
 
-void
+static void
 x_set_border_color (struct frame *f, Lisp_Object arg, Lisp_Object oldval)
 {
   int pix;
@@ -1134,7 +1107,7 @@
 }
 
 
-void
+static void
 x_set_cursor_type (FRAME_PTR f, Lisp_Object arg, Lisp_Object oldval)
 {
   set_frame_cursor_types (f, arg);
@@ -1143,7 +1116,7 @@
   cursor_type_changed = 1;
 }
 
-void
+static void
 x_set_icon_type (struct frame *f, Lisp_Object arg, Lisp_Object oldval)
 {
   int result;
@@ -1175,7 +1148,7 @@
   UNBLOCK_INPUT;
 }
 
-void
+static void
 x_set_icon_name (struct frame *f, Lisp_Object arg, Lisp_Object oldval)
 {
   int result;
@@ -1398,7 +1371,7 @@
    isn't a valid color name, do nothing.  OLDVAL is the old value of
    the frame parameter.  */
 
-void
+static void
 x_set_scroll_bar_foreground (struct frame *f, Lisp_Object value, Lisp_Object 
oldval)
 {
   unsigned long pixel;
@@ -1431,7 +1404,7 @@
    valid color name, do nothing.  OLDVAL is the old value of the frame
    parameter.  */
 
-void
+static void
 x_set_scroll_bar_background (struct frame *f, Lisp_Object value, Lisp_Object 
oldval)
 {
   unsigned long pixel;
@@ -1682,7 +1655,7 @@
 /* This function should be called when the user's lisp code has
    specified a name for the frame; the name will override any set by the
    redisplay code.  */
-void
+static void
 x_explicitly_set_name (FRAME_PTR f, Lisp_Object arg, Lisp_Object oldval)
 {
   x_set_name (f, arg, 1);
@@ -1700,7 +1673,7 @@
 /* Change the title of frame F to NAME.
    If NAME is nil, use the frame name as the title.  */
 
-void
+static void
 x_set_title (struct frame *f, Lisp_Object name, Lisp_Object old_name)
 {
   /* Don't change the title if it's already NAME.  */
@@ -1888,9 +1861,10 @@
 };
 
 
+#if defined HAVE_X_WINDOWS && defined USE_X_TOOLKIT
 /* Create an X fontset on frame F with base font name BASE_FONTNAME.  */
 
-const char xic_defaut_fontset[] = "-*-*-*-r-normal--14-*-*-*-*-*-*-*";
+static const char xic_defaut_fontset[] = "-*-*-*-r-normal--14-*-*-*-*-*-*-*";
 
 /* Create an Xt fontset spec from the name of a base font.
    If `motif' is True use the Motif syntax.  */
@@ -2016,6 +1990,7 @@
     strcat (fontsetname, ":");
   return fontsetname;
 }
+#endif /* HAVE_X_WINDOWS && USE_X_TOOLKIT */
 
 #ifdef DEBUG_XIC_FONTSET
 static void
@@ -3887,12 +3862,6 @@
   return FRAME_LINE_HEIGHT (f);
 }
 
-int
-x_screen_planes (register struct frame *f)
-{
-  return FRAME_X_DISPLAY_INFO (f)->n_planes;
-}
-
 
 
 /************************************************************************
@@ -4017,7 +3986,7 @@
 /* Return the X display structure for the display named NAME.
    Open a new connection if necessary.  */
 
-struct x_display_info *
+static struct x_display_info *
 x_display_info_for_name (Lisp_Object name)
 {
   Lisp_Object names;
@@ -4538,13 +4507,13 @@
 /* If non-nil, a timer started that hides the last tooltip when it
    fires.  */
 
-Lisp_Object tip_timer;
+static Lisp_Object tip_timer;
 Window tip_window;
 
 /* If non-nil, a vector of 3 elements containing the last args
    with which x-show-tip was called.  See there.  */
 
-Lisp_Object last_show_tip_args;
+static Lisp_Object last_show_tip_args;
 
 
 static Lisp_Object

=== modified file 'src/xfont.c'
--- a/src/xfont.c       2011-04-05 05:14:06 +0000
+++ b/src/xfont.c       2011-04-11 05:58:27 +0000
@@ -739,7 +739,7 @@
         So, we try again with wildcards in RESX and RESY.  */
       Lisp_Object temp;
 
-      temp = Fcopy_font_spec (entity);
+      temp = copy_font_spec (entity);
       ASET (temp, FONT_DPI_INDEX, Qnil);
       len = font_unparse_xlfd (temp, pixel_size, name, 512);
       if (len <= 0 || (len = xfont_encode_coding_xlfd (name)) < 0)

=== modified file 'src/xmenu.c'
--- a/src/xmenu.c       2011-04-09 20:39:49 +0000
+++ b/src/xmenu.c       2011-04-14 05:04:02 +0000
@@ -111,7 +111,7 @@
 #define FALSE 0
 #endif /* no TRUE */
 
-Lisp_Object Qdebug_on_next_call;
+static Lisp_Object Qdebug_on_next_call;
 
 #if defined (USE_X_TOOLKIT) || defined (USE_GTK)
 static Lisp_Object xdialog_show (FRAME_PTR, int, Lisp_Object, Lisp_Object,
@@ -365,6 +365,9 @@
 
 /* Wait for an X event to arrive or for a timer to expire.  */
 
+#ifndef USE_MOTIF
+static
+#endif
 void
 x_menu_wait_for_event (void *data)
 {

=== modified file 'src/xrdb.c'
--- a/src/xrdb.c        2011-03-16 00:44:50 +0000
+++ b/src/xrdb.c        2011-04-14 03:05:57 +0000
@@ -64,7 +64,7 @@
 
 /* The string which gets substituted for the %C escape in XFILESEARCHPATH
    and friends, or zero if none was specified.  */
-char *x_customization_string;
+static char *x_customization_string;
 
 
 /* Return the value of the emacs.customization (Emacs.Customization)
@@ -466,7 +466,7 @@
 /* Types of values that we can find in a database */
 
 #define XrmStringType "String" /* String representation */
-XrmRepresentation x_rm_string; /* Quark representation */
+static XrmRepresentation x_rm_string;  /* Quark representation */
 
 /* Load X resources based on the display and a possible -xrm option. */
 

=== modified file 'src/xselect.c'
--- a/src/xselect.c     2011-04-09 17:40:29 +0000
+++ b/src/xselect.c     2011-04-11 03:39:45 +0000
@@ -100,14 +100,14 @@
 #endif
 
 
-Lisp_Object QSECONDARY, QSTRING, QINTEGER, QCLIPBOARD, QTIMESTAMP,
+static Lisp_Object QSECONDARY, QSTRING, QINTEGER, QCLIPBOARD, QTIMESTAMP,
   QTEXT, QDELETE, QMULTIPLE, QINCR, QEMACS_TMP, QTARGETS, QATOM, QNULL,
   QATOM_PAIR;
 
-Lisp_Object QCOMPOUND_TEXT;    /* This is a type of selection.  */
-Lisp_Object QUTF8_STRING;      /* This is a type of selection.  */
+static Lisp_Object QCOMPOUND_TEXT;     /* This is a type of selection.  */
+static Lisp_Object QUTF8_STRING;       /* This is a type of selection.  */
 
-Lisp_Object Qcompound_text_with_extensions;
+static Lisp_Object Qcompound_text_with_extensions;
 
 static Lisp_Object Qforeign_selection;
 

=== modified file 'src/xsettings.c'
--- a/src/xsettings.c   2011-04-12 10:20:32 +0000
+++ b/src/xsettings.c   2011-04-14 20:16:48 +0000
@@ -691,11 +691,13 @@
   return current_mono_font;
 }
 
+#ifdef USE_LUCID
 const char *
 xsettings_get_system_normal_font (void)
 {
   return current_font;
 }
+#endif
 
 DEFUN ("font-get-system-normal-font", Ffont_get_system_normal_font,
        Sfont_get_system_normal_font,
@@ -718,8 +720,8 @@
     : Qnil;
 }
 
-DEFUN ("tool-bar-get-system-style", Ftool_bar_get_system_style, 
Stool_bar_get_system_style,
-       0, 0, 0,
+DEFUN ("tool-bar-get-system-style", Ftool_bar_get_system_style,
+       Stool_bar_get_system_style, 0, 0, 0,
        doc: /* Get the system tool bar style.
 If no system tool bar style is known, return `tool-bar-style' if set to a
 known style.  Otherwise return image.  */)

=== modified file 'src/xsettings.h'
--- a/src/xsettings.h   2011-01-26 08:36:39 +0000
+++ b/src/xsettings.h   2011-04-14 03:08:55 +0000
@@ -26,8 +26,9 @@
 extern void xft_settings_event (struct x_display_info *dpyinfo,
                                 XEvent *);
 extern const char *xsettings_get_system_font (void);
+#ifdef USE_LUCID
 extern const char *xsettings_get_system_normal_font (void);
+#endif
 
 
 #endif /* XSETTINGS_H */
-

=== modified file 'src/xterm.c'
--- a/src/xterm.c       2011-04-09 18:42:31 +0000
+++ b/src/xterm.c       2011-04-13 22:19:27 +0000
@@ -306,6 +306,8 @@
 
 static int x_alloc_nearest_color_1 (Display *, Colormap, XColor *);
 static void x_set_window_size_1 (struct frame *, int, int, int);
+static void x_raise_frame (struct frame *);
+static void x_lower_frame (struct frame *);
 static const XColor *x_color_cells (Display *, int *);
 static void x_update_window_end (struct window *, int, int);
 
@@ -347,9 +349,15 @@
 static void x_sync_with_move (struct frame *, int, int, int);
 static int handle_one_xevent (struct x_display_info *, XEvent *,
                               int *, struct input_event *);
+#if ! (defined USE_MOTIF || defined USE_X_TOOLKIT)
+static int x_dispatch_event (XEvent *, Display *);
+#endif
 /* Don't declare this NO_RETURN because we want no
    interference with debugging failing X calls.  */
 static void x_connection_closed (Display *, const char *);
+static void x_wm_set_window_state (struct frame *, int);
+static void x_wm_set_icon_pixmap (struct frame *, int);
+static void x_initialize (void);
 
 
 /* Flush display of frame F, or of all frames if F is null.  */
@@ -3451,14 +3459,6 @@
 }
 
 
-/* Handle an event saying the mouse has moved out of an Emacs frame.  */
-
-void
-x_mouse_leave (struct x_display_info *dpyinfo)
-{
-  x_new_focus_frame (dpyinfo, dpyinfo->x_focus_event_frame);
-}
-
 /* The focus has changed, or we have redirected a frame's focus to
    another frame (this happens when a frame uses a surrogate
    mini-buffer frame).  Shift the highlight as appropriate.
@@ -5659,7 +5659,7 @@
 /* Set this to nonzero to fake an "X I/O error"
    on a particular display.  */
 
-struct x_display_info *XTread_socket_fake_io_error;
+static struct x_display_info *XTread_socket_fake_io_error;
 
 /* When we find no input here, we occasionally do a no-op command
    to verify that the X server is still running and we can still talk with it.
@@ -6984,6 +6984,9 @@
    i.e. looping while a popup menu or a dialog is posted.
 
    Returns the value handle_one_xevent sets in the finish argument.  */
+#if ! (defined USE_MOTIF || defined USE_X_TOOLKIT)
+static
+#endif
 int
 x_dispatch_event (XEvent *event, Display *display)
 {
@@ -8870,7 +8873,7 @@
 
 /* Lower frame F.  */
 
-void
+static void
 x_lower_frame (struct frame *f)
 {
   if (f->async_visible)
@@ -9432,7 +9435,7 @@
 
 /* Destroy the X window of frame F.  */
 
-void
+static void
 x_destroy_window (struct frame *f)
 {
   struct x_display_info *dpyinfo = FRAME_X_DISPLAY_INFO (f);
@@ -9556,7 +9559,7 @@
 
 /* Used for IconicState or NormalState */
 
-void
+static void
 x_wm_set_window_state (struct frame *f, int state)
 {
 #ifdef USE_X_TOOLKIT
@@ -9574,7 +9577,7 @@
 #endif /* not USE_X_TOOLKIT */
 }
 
-void
+static void
 x_wm_set_icon_pixmap (struct frame *f, int pixmap_id)
 {
   Pixmap icon_pixmap, icon_mask;
@@ -10338,7 +10341,7 @@
 /* Get rid of display DPYINFO, deleting all frames on it,
    and without sending any more commands to the X server.  */
 
-void
+static void
 x_delete_display (struct x_display_info *dpyinfo)
 {
   struct terminal *t;

=== modified file 'src/xterm.h'
--- a/src/xterm.h       2011-03-11 06:57:50 +0000
+++ b/src/xterm.h       2011-04-14 03:04:14 +0000
@@ -388,7 +388,6 @@
 extern Lisp_Object x_display_name_list;
 
 extern struct x_display_info *x_display_info_for_display (Display *);
-extern struct x_display_info *x_display_info_for_name (Lisp_Object);
 extern void x_set_frame_alpha (struct frame *);
 
 extern struct x_display_info *x_term_init (Lisp_Object, char *, char *);
@@ -965,19 +964,12 @@
 extern void x_set_mouse_position (struct frame *, int, int);
 extern void x_set_mouse_pixel_position (struct frame *, int, int);
 extern void x_ewmh_activate_frame (struct frame *);
-extern void x_raise_frame (struct frame *);
-extern void x_lower_frame (struct frame *);
 extern void x_make_frame_visible (struct frame *);
 extern void x_make_frame_invisible (struct frame *);
 extern void x_iconify_frame (struct frame *);
 extern void x_free_frame_resources (struct frame *);
-extern void x_destroy_window (struct frame *);
 extern void x_wm_set_size_hint (struct frame *, long, int);
-extern void x_wm_set_window_state (struct frame *, int);
-extern void x_wm_set_icon_pixmap (struct frame *, int);
-extern void x_delete_display (struct x_display_info *);
 extern void x_delete_terminal (struct terminal *terminal);
-extern void x_initialize (void);
 extern unsigned long x_copy_color (struct frame *, unsigned long);
 #ifdef USE_X_TOOLKIT
 extern XtAppContext Xt_app_con;
@@ -990,10 +982,13 @@
 extern void x_query_colors (struct frame *f, XColor *, int);
 extern void x_query_color (struct frame *f, XColor *);
 extern void x_clear_area (Display *, Window, int, int, int, int, int);
+#ifdef WINDOWSNT
 extern void x_mouse_leave (struct x_display_info *);
-extern void set_vertical_scroll_bar (struct window *);
+#endif
 
+#if defined USE_MOTIF || defined USE_X_TOOLKIT
 extern int x_dispatch_event (XEvent *, Display *);
+#endif
 extern unsigned int x_x_to_emacs_modifiers (struct x_display_info *,
                                             unsigned);
 extern int x_display_pixel_height (struct x_display_info *);
@@ -1042,8 +1037,6 @@
 #endif /* USE_GTK */
 
 extern void x_real_positions (struct frame *, int *, int *);
-extern int defined_color (struct frame *, const char *, XColor *, int);
-extern void x_set_border_pixel (struct frame *, int);
 extern void x_set_menu_bar_lines (struct frame *, Lisp_Object, Lisp_Object);
 extern void x_implicitly_set_name (struct frame *, Lisp_Object, Lisp_Object);
 extern void xic_free_xfontset (struct frame *);
@@ -1056,24 +1049,29 @@
 extern int x_pixel_height (struct frame *);
 extern int x_char_width (struct frame *);
 extern int x_char_height (struct frame *);
-extern int x_screen_planes (struct frame *);
 extern void x_sync (struct frame *);
 extern int x_defined_color (struct frame *, const char *, XColor *, int);
 #ifdef HAVE_X_I18N
 extern void free_frame_xic (struct frame *);
+# if defined HAVE_X_WINDOWS && defined USE_X_TOOLKIT
 extern char * xic_create_fontsetname (const char *base_fontname, int motif);
+# endif
 #endif
 extern void x_set_tool_bar_lines (struct frame *, Lisp_Object, Lisp_Object);
 
 /* Defined in xfaces.c */
 
+#ifdef USE_X_TOOLKIT
 extern void x_free_dpy_colors (Display *, Screen *, Colormap,
                                unsigned long *, int);
+#endif /* USE_X_TOOLKIT */
 
 /* Defined in xmenu.c */
 
 extern void x_menu_set_in_use (int);
+#ifdef USE_MOTIF
 extern void x_menu_wait_for_event (void *data);
+#endif
 extern void x_activate_menubar (struct frame *);
 extern int popup_activated (void);
 extern void initialize_frame_menubar (struct frame *);


reply via email to

[Prev in Thread] Current Thread [Next in Thread]