aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorPaul Eggert2011-04-15 00:48:51 -0700
committerPaul Eggert2011-04-15 00:48:51 -0700
commit4170f62f39edf1ff1e99aec9bfbfe7bbf10e7fc9 (patch)
treee993b231bb5555c9c961f5d0b20d90ac76f77bbd /src
parent1963a2e0bb07cc8dee6d27f972f93d9cfd7c6b2d (diff)
parent49093f601b69d91126aefd328ee8f6bfeb797407 (diff)
downloademacs-4170f62f39edf1ff1e99aec9bfbfe7bbf10e7fc9.tar.gz
emacs-4170f62f39edf1ff1e99aec9bfbfe7bbf10e7fc9.zip
Merge from mainline.
Diffstat (limited to 'src')
-rw-r--r--src/ChangeLog444
-rw-r--r--src/ChangeLog.112
-rw-r--r--src/alloc.c36
-rw-r--r--src/atimer.c6
-rw-r--r--src/atimer.h2
-rw-r--r--src/bidi.c2
-rw-r--r--src/buffer.c37
-rw-r--r--src/buffer.h1
-rw-r--r--src/bytecode.c1
-rw-r--r--src/callint.c9
-rw-r--r--src/callproc.c2
-rw-r--r--src/casetab.c11
-rw-r--r--src/category.c13
-rw-r--r--src/category.h7
-rw-r--r--src/ccl.c34
-rw-r--r--src/ccl.h11
-rw-r--r--src/character.c2
-rw-r--r--src/character.h2
-rw-r--r--src/charset.c24
-rw-r--r--src/charset.h3
-rw-r--r--src/chartab.c4
-rw-r--r--src/cmds.c4
-rw-r--r--src/coding.c69
-rw-r--r--src/coding.h10
-rw-r--r--src/commands.h10
-rw-r--r--src/composite.c7
-rw-r--r--src/composite.h4
-rw-r--r--src/data.c44
-rw-r--r--src/dbusbind.c60
-rw-r--r--src/dired.c21
-rw-r--r--src/dispextern.h37
-rw-r--r--src/dispnew.c31
-rw-r--r--src/doc.c4
-rw-r--r--src/editfns.c23
-rw-r--r--src/emacs.c22
-rw-r--r--src/eval.c43
-rw-r--r--src/fileio.c102
-rw-r--r--src/fns.c18
-rw-r--r--src/font.c40
-rw-r--r--src/font.h13
-rw-r--r--src/fontset.c10
-rw-r--r--src/fontset.h2
-rw-r--r--src/frame.c56
-rw-r--r--src/frame.h16
-rw-r--r--src/fringe.c11
-rw-r--r--src/ftfont.c2
-rw-r--r--src/ftxfont.c14
-rw-r--r--src/image.c39
-rw-r--r--src/indent.c4
-rw-r--r--src/insdel.c64
-rw-r--r--src/intervals.c9
-rw-r--r--src/intervals.h10
-rw-r--r--src/keyboard.c184
-rw-r--r--src/keyboard.h21
-rw-r--r--src/keymap.c12
-rw-r--r--src/keymap.h2
-rw-r--r--src/lisp.h120
-rw-r--r--src/lread.c43
-rw-r--r--src/macros.c4
-rw-r--r--src/marker.c2
-rw-r--r--src/minibuf.c35
-rw-r--r--src/print.c28
-rw-r--r--src/process.c63
-rw-r--r--src/process.h9
-rw-r--r--src/region-cache.c1
-rw-r--r--src/region-cache.h3
-rw-r--r--src/scroll.c38
-rw-r--r--src/search.c8
-rw-r--r--src/sound.c10
-rw-r--r--src/syntax.c8
-rw-r--r--src/syntax.h2
-rw-r--r--src/sysdep.c24
-rw-r--r--src/syssignal.h6
-rw-r--r--src/systty.h3
-rw-r--r--src/term.c17
-rw-r--r--src/termhooks.h3
-rw-r--r--src/textprop.c17
-rw-r--r--src/undo.c9
-rw-r--r--src/window.c29
-rw-r--r--src/window.h3
-rw-r--r--src/xdisp.c187
-rw-r--r--src/xfaces.c101
-rw-r--r--src/xfns.c83
-rw-r--r--src/xfont.c2
-rw-r--r--src/xmenu.c5
-rw-r--r--src/xrdb.c4
-rw-r--r--src/xselect.c8
-rw-r--r--src/xsettings.c6
-rw-r--r--src/xsettings.h3
-rw-r--r--src/xterm.c31
-rw-r--r--src/xterm.h22
91 files changed, 1368 insertions, 1240 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index db387750b16..8589bb8a9f0 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,4 +1,4 @@
12011-04-13 Paul Eggert <eggert@cs.ucla.edu> 12011-04-15 Paul Eggert <eggert@cs.ucla.edu>
2 2
3 * sysdep.c (MAX_RW_COUNT): New macro, to work around kernel bugs. 3 * sysdep.c (MAX_RW_COUNT): New macro, to work around kernel bugs.
4 (emacs_read, emacs_write): Use it. 4 (emacs_read, emacs_write): Use it.
@@ -28,6 +28,448 @@
28 (wav_play, au_play): Use size_t to store sizes, and ssize_t to 28 (wav_play, au_play): Use size_t to store sizes, and ssize_t to
29 record read return values. 29 record read return values.
30 30
312011-04-15 Ben Key <bkey76@gmail.com>
32
33 * keyboard.c (Qundefined): Don't declare static since it is
34 used in nsfns.m.
35 * xfaces.c (Qbold, Qexpanded, Qitalic, Qcondensed): Don't
36 declare static since they are used in nsfont.m.
37
382011-04-15 Stefan Monnier <monnier@iro.umontreal.ca>
39
40 * process.c (Qprocessp): Don't declare static.
41 * lisp.h (Qprocessp): Declare again.
42
432011-04-15 Juanma Barranquero <lekktu@gmail.com>
44
45 * font.c (Qopentype): Don't make static (used from w32uniscribe.c).
46
472011-04-14 Paul Eggert <eggert@cs.ucla.edu>
48
49 Improve C-level modularity by making more things 'static'.
50
51 Don't publish debugger-only interfaces to other modules.
52 * lisp.h (safe_debug_print, debug_output_compilation_hack):
53 (verify_bytepos, count_markers): Move decls to the only modules
54 that need them.
55 * region-cache.h (pp_cache): Likewise.
56 * window.h (check_all_windows): Likewise.
57 * marker.c, print.c, region-cache.c, window.c: Decls moved here.
58
59 * sysdep.c (croak): Now static, if
60 defined TIOCNOTTY || defined USG5 || defined CYGWIN.
61 * syssignal.h (croak): Declare only if not static.
62
63 * alloc.c (refill_memory_reserve): Now static if
64 !defined REL_ALLOC || defined SYSTEM_MALLOC.
65 * lisp.h (refill_memory_reserve): Declare only if not static.
66
67 * xsettings.c, xsettings.h (xsettings_get_system_normal_font):
68 Define only if USE_LUCID.
69
70 * xrdb.c (x_customization_string, x_rm_string): Now static.
71
72 * xmenu.c (x_menu_wait_for_event): Export only if USE_MOTIF.
73 * xterm.h (x_menu_wait_for_event): Declare only if USE_MOTIF.
74
75 * xdisp.c (draw_row_with_mouse_face): Now static.
76 * dispextern.h (draw_row_with_mouse_fave): Remove decl.
77
78 * window.h (check_all_windows): Mark externally visible.
79
80 * window.c (window_deletion_count): Now static.
81
82 * undo.c: Make symbols static if they're not exported.
83 (last_undo_buffer, last_boundary_position, pending_boundary):
84 Now static.
85
86 * textprop.c (interval_insert_behind_hooks): Now static.
87 (interval_insert_in_front_hooks): Likewise.
88
89 * term.c: Make symbols static if they're not exported.
90 (tty_turn_off_highlight, get_tty_terminal, max_frame_cols):
91 (max_frame_lines, tty_set_terminal_modes):
92 (tty_reset_terminal_modes, tty_turn_off_highlight):
93 (get_tty_terminal): Now static.
94 (term_mouse_moveto): Do not define if HAVE_WINDOW_SYSTEM.
95 * termhooks.h (term_mouse_moveto): Do not declare if
96 HAVE_WINDOW_SYSTEM.
97 * dispextern.h (tty_set_terminal_modes, tty_reset_terminal_modes):
98 (tty_turn_off_highlight, get_tty_terminal): Remove decls.
99
100 * sysdep.c: Make symbols static if they're not exported.
101 (emacs_get_tty, emacs_set_tty, old_fcntl_flags, old_fcntl_owner):
102 Now static.
103 (sigprocmask_set, full_mask): Remove; unused.
104 (wait_debugging): Mark as visible.
105 * syssignal.h (SIGFULLMASK, full_mask): Remove decls.
106 * systty.h (emacs_get_tty, emacs_set_tty): Remove decls.
107
108 * syntax.c (syntax_temp): Define only if !__GNUC__.
109
110 * sound.c (current_sound_device, current_sound): Now static.
111
112 * search.c (searchbufs, searchbuf_head): Now static.
113
114 * scroll.c (scroll_cost): Remove; unused.
115 * dispextern.h (scroll_cost): Remove decl.
116
117 * region-cache.h (pp_cache): Mark as externally visible.
118
119 * process.c: Make symbols static if they're not exported.
120 (process_tick, update_tick, create_process, chan_process):
121 (Vprocess_alist, proc_buffered_char, datagram_access):
122 (fd_callback_data, send_process_frame, process_sent_to): Now static.
123 (deactivate_process): Mark defn as static, as well as decl.
124 * lisp.h (create_process): Remove decl.
125 * process.h (chan_process, Vprocess_alist): Remove decls.
126
127 * print.c: Make symbols static if they're not exported.
128 (print_depth, new_backquote_output, being_printed, print_buffer):
129 (print_buffer_size, print_buffer_pos, print_buffer_pos_byte):
130 (print_interval, print_number_index, initial_stderr_stream):
131 Now static.
132 * lisp.h (Fprinc): Remove decl.
133 (debug_output_compilation_hack): Mark as externally visible.
134
135 * sysdep.c (croak): Move decl from here to syssignal.h.
136 * syssignal.h (croak): Put it here, so the API can be checked when
137 'croak' is called from dissociate_if_controlling_tty.
138
139 * minibuf.c: Make symbols static if they're not exported.
140 (minibuf_save_list, choose_minibuf_frame): Now static.
141 * lisp.h (choose_minibuf_frame): Remove decl.
142
143 * lisp.h (verify_bytepos, count_markers): Mark as externally visible.
144
145 * lread.c: Make symbols static if they're not exported.
146 (read_objects, initial_obarray, oblookup_last_bucket_number):
147 Now static.
148 (make_symbol): Remove; unused.
149 * lisp.h (initial_obarray, make_symbol): Remove decls.
150
151 * keyboard.c: Make symbols static if they're not exported.
152 (single_kboard, recent_keys_index, total_keys, recent_keys):
153 (this_command_key_count_reset, raw_keybuf, raw_keybuf_count):
154 (this_single_command_key_start, echoing, last_auto_save):
155 (read_key_sequence_cmd, dribble, recursive_edit_unwind):
156 (command_loop, echo_now, keyboard_init_hook, help_char_p):
157 (quit_throw_to_read_char, command_loop_2, top_level_1, poll_timer):
158 (Vlispy_mouse_stem, double_click_count):
159 Now static.
160 (force_auto_save_soon): Define only if SIGDANGER.
161 (ignore_mouse_drag_p): Now static if
162 !defined HAVE_WINDOW_SYSTEM || defined USE_GTK || defined HAVE_NS.
163 (print_help): Remove; unused.
164 (stop_character, last_timer_event): Mark as externally visible.
165 * keyboard.h (ignore_mouse_drag_p): Declare only if
166 defined HAVE_WINDOW_SYSTEM && !defined USE_GTK && !defined HAVE_NS.
167 (echo_now, help_char_p, quit_throw_to_read_char): Remove decls.
168 * lisp.h (echoing): Remove decl.
169 (force_auto_save_soon): Declare only if SIGDANGER.
170 * xdisp.c (redisplay_window): Simplify code, to make it more
171 obvious that ignore_mouse_drag_p is not accessed if !defined
172 USE_GTK && !defined HAVE_NS.
173
174 * intervals.c: Make symbols static if they're not exported.
175 (merge_properties_sticky, merge_interval_right, delete_interval):
176 Now static.
177 * intervals.h (merge_interval_right, delete_interval): Remove decls.
178
179 * insdel.c: Make symbols static if they're not exported.
180 However, leave prepare_to_modify_buffer alone. It's never
181 called from outside this function, but that appears to be a bug.
182 (combine_after_change_list, combine_after_change_buffer):
183 (adjust_after_replace, signal_before_change): Now static.
184 (adjust_after_replace_noundo): Remove; unused.
185 * lisp.h (adjust_after_replace, adjust_after_replace_noundo):
186 (signal_before_change): Remove decls.
187
188 * indent.c (val_compute_motion, val_vmotion): Now static.
189
190 * image.c: Make symbols static if they're not exported.
191 * dispextern.h (x_create_bitmap_from_xpm_data): Do not declare
192 if USE_GTK.
193 * image.c (x_create_bitmap_from_xpm_data): Do not define if USE_GTK.
194 (xpm_color_cache, ct_table, ct_colors_allocated): Now static.
195
196 * fringe.c (standard_bitmaps): Now static.
197 (max_used_fringe_bitmap): Now static, unless HAVE_NS.
198
199 * frame.c: Make symbols static if they're not exported.
200 (x_report_frame_params, make_terminal_frame): Now static.
201 (get_frame_param): Now static, unless HAVE_NS.
202 (x_fullscreen_adjust): Define if WINDOWSNT, not if HAVE_WINDOW_SYSTEM.
203 (x_get_resource_string): Remove; not used.
204 * frame.h (make_terminal_frame, x_report_frame_params):
205 (x_get_resource_string); Remove decls.
206 (x_fullscreen_adjust): Declare only if WINDOWSNT.
207 * lisp.h (get_frame_param): Declare only if HAVE_NS.
208
209 * font.c, fontset.c: Make symbols static if they're not exported.
210 * dispextern.h (FACE_SUITABLE_FOR_ASCII_CHAR_P): New macro.
211 (FACE_SUITABLE_FOR_CHAR_P): Use it.
212 * font.c (font_close_object): Now static.
213 * font.h (font_close_object): Remove.
214 * fontset.c (FONTSET_OBJLIST): Remove.
215 (free_realized_fontset) #if-0 the body, which does nothing.
216 (face_suitable_for_char_p): #if-0, as it's never called.
217 * fontset.h (face_suitable_for_char_p): Remove decl.
218 * xfaces.c (face_at_string_position): Use
219 FACE_SUITABLE_FOR_ASCII_CHAR_P, not FACE_SUITABLE_FOR_CHAR_P,
220 since 0 is always ASCII.
221
222 * fns.c (weak_hash_tables): Now static.
223
224 * fileio.c: Make symbols static if they're not exported.
225 (auto_saving, auto_save_mode_bits, auto_save_error_occurred):
226 (Vwrite_region_annotation_buffers): Now static.
227
228 * eval.c: Make symbols static if they're not exported.
229 (backtrace_list, lisp_eval_depth, when_entered_debugger): Now static.
230 * lisp.h (backtrace_list): Remove decl.
231
232 * emacs.c: Make symbols static if they're not exported.
233 (malloc_state_ptr, malloc_using_checking, syms_of_emacs):
234 (fatal_error_code, fatal_error_signal_hook, standard_args):
235 Now static.
236 (fatal_error_signal): Now static, unless FLOAT_CATCH_SIGKILL.
237 (DEFINE_DUMMY_FUNCTION): Mark function as externally visible.
238 (__CTOR_LIST__, __DTOR_LIST__): Now externally visible.
239 * lisp.h (fatal_error_signal_hook): Remove decl.
240 (fatal_error_signal): Declare only if FLOAT_CATCH_SIGKILL.
241
242 * editfns.c: Move a (normally-unused) function to its only use.
243 * editfns.c, lisp.h (get_operating_system_release): Remove.
244 * process.c (init_process) [DARWIN_OS]: Do it inline, as it is not
245 worth the hassle of breaking this out.
246
247 * xterm.c: Make symbols static if they're not exported.
248 (x_raise_frame, x_lower_frame, x_wm_set_window_state):
249 (x_wm_set_icon_pixmap, x_initialize, XTread_socket_fake_io_error):
250 (x_destroy_window, x_delete_display):
251 Now static.
252 (x_dispatch_event): Now static if ! (USE_MOTIF || USE_X_TOOLKIT).
253 (x_mouse_leave): Remove; unused.
254 * xterm.h (x_display_info_for_name, x_raise_frame, x_lower_frame):
255 (x_destroy_window, x_wm_set_window_state, x_wm_set_icon_pixmap):
256 (x_delete_display, x_initialize, x_set_border_pixel, x_screen_planes):
257 Remove decls.
258 (x_mouse_leave): Declare only if WINDOWSNT.
259 (x_dispatch_event): Declare only if USE_MOTIF or USE_X_TOOLKIT.
260 (xic_create_fontsetname): Declare only if HAVE_X_WINDOWS &&
261 USE_X_TOOLKIT.
262
263 * ftxfont.c: Make symbols static if they're not exported.
264 (ftxfont_driver): Export only if !defined HAVE_XFT && def8ined
265 HAVE_FREETYPE.
266 * font.h (ftxfont_driver): Likewise.
267
268 * xfns.c: Make symbols static if they're not exported.
269 (x_last_font_name, x_display_info_for_name):
270 (x_set_foreground_color, x_set_background_color, x_set_mouse_color):
271 (x_set_cursor_color, x_set_border_pixel, x_set_border_color):
272 (x_set_cursor_type, x_set_icon_type, x_set_icon_name):
273 (x_set_scroll_bar_foreground, x_set_scroll_bar_background):
274 (x_explicitly_set_name, x_set_title, xic_defaut_fontset, tip_timer):
275 (last_show_tip_args): Now static.
276 (xic_defaut_fontset, xic_create_fontsetname): Define only if
277 defined HAVE_X_WINDOWS && defined USE_X_TOOLKIT
278 (x_screen_planes): Remove; unused.
279 * dispextern.h (x_screen_planes): Remove decl.
280
281 * dispnew.c: Make symbols static if they're not exported.
282 * dispextern.h (redraw_garbaged_frames, scrolling):
283 (increment_row_positions): Remove.
284 * dispnew.c (new_glyph_matrix, increment_row_positions, scrolling):
285 (delayed_size_change, glyph_matrix_count, glyph_pool_count):
286 Now static.
287 (redraw_garbaged_frames): Remove; unused.
288
289 * xfaces.c: Make symbols static if they're not exported.
290 * dispextern.h (ascii_face_of_lisp_face, free_realized_face):
291 Remove decls.
292 * xterm.h (defined_color): Remove decls.
293 (x_free_dpy_colors): Declare only if USE_X_TOOLKIT.
294 * xfaces.c (tty_suppress_bold_inverse_default_colors_p):
295 (menu_face_changed_default, defined_color, free_realized_face):
296 (x_free_dpy_colors): Define only if USE_X_TOOLKIT.
297 (ascii_face_of_lisp_face): Remove; unused.
298
299 * xdisp.c: Make symbols static if they're not exported.
300 * dispextern.h (scratch_glyph_row, window_box_edges):
301 (glyph_to_pixel_coords, set_cursor_from_row):
302 (get_next_display_element, set_iterator_to_next):
303 (highlight_trailing_whitespace, frame_to_window_pixel_xy):
304 (show_mouse_face): Remove decls
305 * frame.h (message_buf_print): Likewise.
306 * lisp.h (pop_message, set_message, check_point_in_composition):
307 Likewise.
308 * xterm.h (set_vertical_scroll_bar): Likewise.
309 * xdisp.c (list_of_error, Vmessage_stack, line_number_displayed):
310 (message_buf_print, scratch_glyph_row, displayed_buffer):
311 (set_iterator_to_next, pop_message, set_message, set_cursor_from_row):
312 (get_next_display_element, show_mouse_face, window_box_edges):
313 (frame_to_window_pixel_xy, check_point_in_composition):
314 (set_vertical_scroll_bar, highlight_trailing_whitespace): Now static.
315 (glyph_to_pixel_coords): Remove; unused.
316
317 * dired.c (file_name_completion): Now static.
318
319 * dbusbind.c (xd_in_read_queued_messages): Now static.
320
321 * lisp.h (circular_list_error, FOREACH): Remove; unused.
322 * data.c (circular_list_error): Remove.
323
324 * commands.h (last_point_position, last_point_position_buffer):
325 (last_point_position_window): Remove decls.
326 * keyboard.c: Make these variables static.
327
328 * coding.h (coding, code_convert_region, encode_coding_gap): Remove
329 decls.
330 * coding.c (Vsjis_coding_system, Vbig5_coding_system):
331 (iso_code_class, detect_coding, code_convert_region): Now static.
332 (encode_coding_gap): Remove; unused.
333
334 * chartab.c (chartab_chars, chartab_bits): Now static.
335
336 * charset.h (charset_iso_8859_1): Remove decl.
337 * charset.c (charset_iso_8859_1, charset_emacs, map_charset_for_dump):
338 Now static.
339
340 * ccl.h (check_ccl_update, Vccl_program_table): Remove decls.
341 * ccl.c (Vccl_program_table): Now static.
342 (check_ccl_update): Remove; unused.
343
344 * category.c (SET_CATEGORY_SET, set_category_set): Move here.
345 * category.h: ... from here.
346 * category.c (check_category_table, set_category_set): Now static.
347
348 * casetab.c (Vascii_upcase_table, Vascii_eqv_table): Now static.
349 * lisp.h: Remove these decls.
350
351 * buffer.c (buffer_count): Remove unused var.
352
353 * bidi.c (bidi_dump_cached_states): Mark as externally visible,
354 so that it's not optimized away.
355 (bidi_ignore_explicit_marks_for_paragraph_level): Likewise.
356 * dispextern.h (bidi_dump_cached_states): Remove, since it's
357 exported only to the debugger.
358
359 * atimer.c (alarm_signal_handler, run_all_atimers): Now static.
360 * atimer.h (run_all_atimers): Removed; not exported.
361
362 font.c: Make copy_font_spec and merge_font_spec ordinary C functions.
363 * font.c (copy_font_spec): Rename from Fcopy_font_spec, since it
364 was inaccessible from Lisp.
365 (merge_font_spec): Likewise, renaming from Fmerge_font_spec.
366 * font.c, font.h, fontset.c, xfaces.c, xfont.c: Change all uses.
367
368 alloc.c: Import and export fewer symbols, and remove unused items.
369 * lisp.h (suppress_checking, die): Declare only if ENABLE_CHECKING
370 is defined.
371 (suppress_checking): Add EXTERNALLY_VISIBLE attribute, so that
372 it's not optimized away by whole-program optimization.
373 (message_enable_multibyte, free_misc): Remove.
374 (catchlist, handlerlist, mark_backtrace):
375 Declare only if BYTE_MARK_STACK.
376 (mark_byte_stack): Likewise, fixing a ifdef-vs-if typo.
377 * alloc.c (pure): Export only if VIRT_ADDR_VARIES is defined.
378 (message_enable_multibyte): Remove decl.
379 (free_misc, interval_free_list, float_block, float_block_index):
380 (n_float_blocks, float_free_list, cons_block, cons_block_index):
381 (cons_free_list, last_marked_index):
382 Now static.
383 (suppress_checking, die): Define only if ENABLE_CHECKING is defined.
384 * eval.c (catchlist, handlerlist): Export only if BYTE_MARK_STACK.
385 (mark_backtrace): Define only if BYTE_MARK_STACK.
386 * xdisp.c (message_enable_multibyte): Now static.
387
388 Declare Lisp_Object Q* variables to be 'static' if not exproted.
389 This makes it easier for human readers (and static analyzers)
390 to see whether these variables are used from other modules.
391 * alloc.c, buffer.c, bytecode.c, callint.c, casetab.c, category.c:
392 * ccl.c, character.c, charset.c, cmds.c, coding.c, composite.c:
393 * data.c, dbusbind.c, dired.c, editfns.c, eval.c, fileio.c, fns.c:
394 * font.c, frame.c, fringe.c, ftfont.c, image.c, keyboard.c, keymap.c:
395 * lread.c, macros.c, minibuf.c, print.c, process.c, search.c:
396 * sound.c, syntax.c, textprop.c, window.c, xdisp.c, xfaces.c, xfns.c:
397 * xmenu.c, xselect.c:
398 Declare Q* vars static if they are not used in other modules.
399 * ccl.h, character.h, charset.h, coding.h, composite.h, font.h:
400 * frame.h, intervals.h, keyboard.h, lisp.h, process.h, syntax.h:
401 Remove decls of unexported vars.
402 * keyboard.h (EVENT_HEAD_UNMODIFIED): Remove now-unused macro.
403
404 * lisp.h (DEFINE_FUNC): Make sname 'static'.
405
406 Make Emacs functions such as Fatom 'static' by default.
407 This makes it easier for human readers (and static analyzers)
408 to see whether these functions can be called from other modules.
409 DEFUN now defines a static function. To make the function external
410 so that it can be used in other C modules, use the new macro DEFUE.
411 * lisp.h (Funibyte_char_to_multibyte, Fsyntax_table_p):
412 (Finit_image_library):
413 (Feval_region, Fbacktrace, Ffetch_bytecode, Fswitch_to_buffer):
414 (Ffile_executable_p, Fmake_symbolic_link, Fcommand_execute):
415 (Fget_process, Fdocumentation_property, Fbyte_code, Ffile_attributes):
416 Remove decls, since these functions are now static.
417 (Funintern, Fget_internal_run_time): New decls, since these functions
418 were already external.
419
420 * alloc.c, buffer.c, callint.c, callproc.c, casefiddle.c, casetab.c:
421 * ccl.c, character.c, chartab.c, cmds.c, coding.c, data.c, dispnew.c:
422 * doc.c, editfns.c, emacs.c, eval.c, fileio.c, filelock.c, floatfns.c:
423 * fns.c, font.c, fontset.c, frame.c, image.c, indent.c:
424 * keyboard.c, keymap.c, lread.c:
425 * macros.c, marker.c, menu.c, minibuf.c, print.c, process.c, search.c:
426 * syntax.c, term.c, terminal.c, textprop.c, undo.c:
427 * window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xsettings.c:
428 Mark functions with DEFUE instead of DEFUN,
429 if they are used in other modules.
430 * buffer.c (Fset_buffer_major_mode, Fdelete_overlay): New forward
431 decls for now-static functions.
432 * buffer.h (Fdelete_overlay): Remove decl.
433 * callproc.c (Fgetenv_internal): Mark as internal.
434 * composite.c (Fremove_list_of_text_properties): Remove decl.
435 (Fcomposition_get_gstring): New forward static decl.
436 * composite.h (Fcomposite_get_gstring): Remove decl.
437 * dired.c (Ffile_attributes): New forward static decl.
438 * doc.c (Fdocumntation_property): New forward static decl.
439 * eval.c (Ffetch_bytecode): New forward static decl.
440 (Funintern): Remove extern decl; now in .h file where it belongs.
441 * fileio.c (Fmake_symbolic_link): New forward static decl.
442 * image.c (Finit_image_library): New forward static decl.
443 * insdel.c (Fcombine_after_change_execute): Make forward decl static.
444 * intervals.h (Fprevious_property_change):
445 (Fremove_list_of_text_properties): Remove decls.
446 * keyboard.c (Fthis_command_keys): Remove decl.
447 (Fcommand_execute): New forward static decl.
448 * keymap.c (Flookup_key): New forward static decl.
449 (Fcopy_keymap): Now static.
450 * keymap.h (Flookup_key): Remove decl.
451 * process.c (Fget_process): New forward static decl.
452 (Fprocess_datagram_address): Mark as internal.
453 * syntax.c (Fsyntax_table_p): New forward static decl.
454 (skip_chars): Remove duplicate decl.
455 * textprop.c (Fprevious_property_change): New forward static decl.
456 * window.c (Fset_window_fringes, Fset_window_scroll_bars):
457 Now internal.
458 (Fset_window_margins, Fset_window_vscroll): New forward static decls.
459 * window.h (Fset_window_vscroll, Fset_window_margins): Remove decls.
460
461 * editfns.c (Fformat): Remove unreachable code.
462
4632011-04-14 Andreas Schwab <schwab@linux-m68k.org>
464
465 * fileio.c (Finsert_file_contents): Fix typo in 2005-05-13
466 change. (Bug#8496)
467
4682011-04-13 Eli Zaretskii <eliz@gnu.org>
469
470 * xdisp.c (handle_invisible_prop): Don't call bidi_paragraph_init
471 when at ZV. (Bug#8487)
472
312011-04-12 Andreas Schwab <schwab@linux-m68k.org> 4732011-04-12 Andreas Schwab <schwab@linux-m68k.org>
32 474
33 * charset.c (Fclear_charset_maps): Use xfree instead of free. 475 * charset.c (Fclear_charset_maps): Use xfree instead of free.
diff --git a/src/ChangeLog.11 b/src/ChangeLog.11
index 703b084743c..6f462e32534 100644
--- a/src/ChangeLog.11
+++ b/src/ChangeLog.11
@@ -4906,7 +4906,7 @@
4906 (Finternal_describe_syntax_value): Recognize new flag; use the 4906 (Finternal_describe_syntax_value): Recognize new flag; use the
4907 SYNTAX_FLAGS_* macros. 4907 SYNTAX_FLAGS_* macros.
4908 (scan_sexps_forward, Fparse_partial_sexp): Change representation of 4908 (scan_sexps_forward, Fparse_partial_sexp): Change representation of
4909 comment style to accomodate the new styles. 4909 comment style to accommodate the new styles.
4910 (back_comment, forw_comment, Fforward_comment, scan_lists) 4910 (back_comment, forw_comment, Fforward_comment, scan_lists)
4911 (scan_sexps_forward): Update code to obey the new comment style flag. 4911 (scan_sexps_forward): Update code to obey the new comment style flag.
4912 4912
diff --git a/src/alloc.c b/src/alloc.c
index 6a018b87029..16cd183aaa1 100644
--- a/src/alloc.c
+++ b/src/alloc.c
@@ -212,6 +212,9 @@ static int malloc_hysteresis;
212 remapping on more recent systems because this is less important 212 remapping on more recent systems because this is less important
213 nowadays than in the days of small memories and timesharing. */ 213 nowadays than in the days of small memories and timesharing. */
214 214
215#ifndef VIRT_ADDR_VARIES
216static
217#endif
215EMACS_INT pure[(PURESIZE + sizeof (EMACS_INT) - 1) / sizeof (EMACS_INT)] = {1,}; 218EMACS_INT pure[(PURESIZE + sizeof (EMACS_INT) - 1) / sizeof (EMACS_INT)] = {1,};
216#define PUREBEG (char *) pure 219#define PUREBEG (char *) pure
217 220
@@ -264,11 +267,12 @@ static size_t stack_copy_size;
264 267
265static int ignore_warnings; 268static int ignore_warnings;
266 269
267Lisp_Object Qgc_cons_threshold, Qchar_table_extra_slots; 270static Lisp_Object Qgc_cons_threshold;
271Lisp_Object Qchar_table_extra_slots;
268 272
269/* Hook run after GC has finished. */ 273/* Hook run after GC has finished. */
270 274
271Lisp_Object Qpost_gc_hook; 275static Lisp_Object Qpost_gc_hook;
272 276
273static void mark_buffer (Lisp_Object); 277static void mark_buffer (Lisp_Object);
274static void mark_terminals (void); 278static void mark_terminals (void);
@@ -276,12 +280,14 @@ static void gc_sweep (void);
276static void mark_glyph_matrix (struct glyph_matrix *); 280static void mark_glyph_matrix (struct glyph_matrix *);
277static void mark_face_cache (struct face_cache *); 281static void mark_face_cache (struct face_cache *);
278 282
283#if !defined REL_ALLOC || defined SYSTEM_MALLOC
284static void refill_memory_reserve (void);
285#endif
279static struct Lisp_String *allocate_string (void); 286static struct Lisp_String *allocate_string (void);
280static void compact_small_strings (void); 287static void compact_small_strings (void);
281static void free_large_strings (void); 288static void free_large_strings (void);
282static void sweep_strings (void); 289static void sweep_strings (void);
283 290static void free_misc (Lisp_Object);
284extern int message_enable_multibyte;
285 291
286/* When scanning the C stack for live Lisp objects, Emacs keeps track 292/* When scanning the C stack for live Lisp objects, Emacs keeps track
287 of what memory allocated via lisp_malloc is intended for what 293 of what memory allocated via lisp_malloc is intended for what
@@ -1336,7 +1342,7 @@ static int total_free_intervals, total_intervals;
1336 1342
1337/* List of free intervals. */ 1343/* List of free intervals. */
1338 1344
1339INTERVAL interval_free_list; 1345static INTERVAL interval_free_list;
1340 1346
1341/* Total number of interval blocks now in use. */ 1347/* Total number of interval blocks now in use. */
1342 1348
@@ -2455,19 +2461,19 @@ struct float_block
2455 2461
2456/* Current float_block. */ 2462/* Current float_block. */
2457 2463
2458struct float_block *float_block; 2464static struct float_block *float_block;
2459 2465
2460/* Index of first unused Lisp_Float in the current float_block. */ 2466/* Index of first unused Lisp_Float in the current float_block. */
2461 2467
2462int float_block_index; 2468static int float_block_index;
2463 2469
2464/* Total number of float blocks now in use. */ 2470/* Total number of float blocks now in use. */
2465 2471
2466int n_float_blocks; 2472static int n_float_blocks;
2467 2473
2468/* Free-list of Lisp_Floats. */ 2474/* Free-list of Lisp_Floats. */
2469 2475
2470struct Lisp_Float *float_free_list; 2476static struct Lisp_Float *float_free_list;
2471 2477
2472 2478
2473/* Initialize float allocation. */ 2479/* Initialize float allocation. */
@@ -2567,15 +2573,15 @@ struct cons_block
2567 2573
2568/* Current cons_block. */ 2574/* Current cons_block. */
2569 2575
2570struct cons_block *cons_block; 2576static struct cons_block *cons_block;
2571 2577
2572/* Index of first unused Lisp_Cons in the current block. */ 2578/* Index of first unused Lisp_Cons in the current block. */
2573 2579
2574int cons_block_index; 2580static int cons_block_index;
2575 2581
2576/* Free-list of Lisp_Cons structures. */ 2582/* Free-list of Lisp_Cons structures. */
2577 2583
2578struct Lisp_Cons *cons_free_list; 2584static struct Lisp_Cons *cons_free_list;
2579 2585
2580/* Total number of cons blocks now in use. */ 2586/* Total number of cons blocks now in use. */
2581 2587
@@ -3163,7 +3169,7 @@ allocate_misc (void)
3163 3169
3164/* Free a Lisp_Misc object */ 3170/* Free a Lisp_Misc object */
3165 3171
3166void 3172static void
3167free_misc (Lisp_Object misc) 3173free_misc (Lisp_Object misc)
3168{ 3174{
3169 XMISCTYPE (misc) = Lisp_Misc_Free; 3175 XMISCTYPE (misc) = Lisp_Misc_Free;
@@ -5211,7 +5217,7 @@ mark_face_cache (struct face_cache *c)
5211 5217
5212#define LAST_MARKED_SIZE 500 5218#define LAST_MARKED_SIZE 500
5213static Lisp_Object last_marked[LAST_MARKED_SIZE]; 5219static Lisp_Object last_marked[LAST_MARKED_SIZE];
5214int last_marked_index; 5220static int last_marked_index;
5215 5221
5216/* For debugging--call abort when we cdr down this many 5222/* For debugging--call abort when we cdr down this many
5217 links of a list, in mark_object. In debugging, 5223 links of a list, in mark_object. In debugging,
@@ -6103,6 +6109,7 @@ Frames, windows, buffers, and subprocesses count as vectors
6103 return Flist (8, consed); 6109 return Flist (8, consed);
6104} 6110}
6105 6111
6112#ifdef ENABLE_CHECKING
6106int suppress_checking; 6113int suppress_checking;
6107 6114
6108void 6115void
@@ -6112,6 +6119,7 @@ die (const char *msg, const char *file, int line)
6112 file, line, msg); 6119 file, line, msg);
6113 abort (); 6120 abort ();
6114} 6121}
6122#endif
6115 6123
6116/* Initialization */ 6124/* Initialization */
6117 6125
diff --git a/src/atimer.c b/src/atimer.c
index b947ea59ccd..a54b397f52e 100644
--- a/src/atimer.c
+++ b/src/atimer.c
@@ -64,7 +64,7 @@ static void set_alarm (void);
64static void schedule_atimer (struct atimer *); 64static void schedule_atimer (struct atimer *);
65static struct atimer *append_atimer_lists (struct atimer *, 65static struct atimer *append_atimer_lists (struct atimer *,
66 struct atimer *); 66 struct atimer *);
67void alarm_signal_handler (int signo); 67static void alarm_signal_handler (int signo);
68 68
69 69
70/* Start a new atimer of type TYPE. TIME specifies when the timer is 70/* Start a new atimer of type TYPE. TIME specifies when the timer is
@@ -246,7 +246,7 @@ stop_other_atimers (struct atimer *t)
246/* Run all timers again, if some have been stopped with a call to 246/* Run all timers again, if some have been stopped with a call to
247 stop_other_atimers. */ 247 stop_other_atimers. */
248 248
249void 249static void
250run_all_atimers (void) 250run_all_atimers (void)
251{ 251{
252 if (stopped_atimers) 252 if (stopped_atimers)
@@ -270,7 +270,7 @@ run_all_atimers (void)
270} 270}
271 271
272 272
273/* A version of run_all_timers suitable for a record_unwind_protect. */ 273/* A version of run_all_atimers suitable for a record_unwind_protect. */
274 274
275Lisp_Object 275Lisp_Object
276unwind_stop_other_atimers (Lisp_Object dummy) 276unwind_stop_other_atimers (Lisp_Object dummy)
diff --git a/src/atimer.h b/src/atimer.h
index 798181fcd7f..8035681b225 100644
--- a/src/atimer.h
+++ b/src/atimer.h
@@ -76,8 +76,6 @@ void do_pending_atimers (void);
76void init_atimer (void); 76void init_atimer (void);
77void turn_on_atimers (int); 77void turn_on_atimers (int);
78void stop_other_atimers (struct atimer *); 78void stop_other_atimers (struct atimer *);
79void run_all_atimers (void);
80Lisp_Object unwind_stop_other_atimers (Lisp_Object); 79Lisp_Object unwind_stop_other_atimers (Lisp_Object);
81 80
82#endif /* EMACS_ATIMER_H */ 81#endif /* EMACS_ATIMER_H */
83
diff --git a/src/bidi.c b/src/bidi.c
index 3457e177436..447abb48469 100644
--- a/src/bidi.c
+++ b/src/bidi.c
@@ -91,6 +91,7 @@ typedef enum {
91 STRONG 91 STRONG
92} bidi_category_t; 92} bidi_category_t;
93 93
94extern int bidi_ignore_explicit_marks_for_paragraph_level EXTERNALLY_VISIBLE;
94int bidi_ignore_explicit_marks_for_paragraph_level = 1; 95int bidi_ignore_explicit_marks_for_paragraph_level = 1;
95 96
96static Lisp_Object paragraph_start_re, paragraph_separate_re; 97static Lisp_Object paragraph_start_re, paragraph_separate_re;
@@ -1779,6 +1780,7 @@ bidi_move_to_visually_next (struct bidi_it *bidi_it)
1779 1780
1780/* This is meant to be called from within the debugger, whenever you 1781/* This is meant to be called from within the debugger, whenever you
1781 wish to examine the cache contents. */ 1782 wish to examine the cache contents. */
1783void bidi_dump_cached_states (void) EXTERNALLY_VISIBLE;
1782void 1784void
1783bidi_dump_cached_states (void) 1785bidi_dump_cached_states (void)
1784{ 1786{
diff --git a/src/buffer.c b/src/buffer.c
index a0054e32d0a..c649836adb8 100644
--- a/src/buffer.c
+++ b/src/buffer.c
@@ -100,6 +100,8 @@ static char buffer_permanent_local_flags[MAX_PER_BUFFER_VARS];
100 100
101int last_per_buffer_idx; 101int last_per_buffer_idx;
102 102
103static Lisp_Object Fset_buffer_major_mode (Lisp_Object);
104static Lisp_Object Fdelete_overlay (Lisp_Object);
103static void call_overlay_mod_hooks (Lisp_Object list, Lisp_Object overlay, 105static void call_overlay_mod_hooks (Lisp_Object list, Lisp_Object overlay,
104 int after, Lisp_Object arg1, 106 int after, Lisp_Object arg1,
105 Lisp_Object arg2, Lisp_Object arg3); 107 Lisp_Object arg2, Lisp_Object arg3);
@@ -111,30 +113,31 @@ static void reset_buffer_local_variables (struct buffer *b, int permanent_too);
111 to prevent lossage due to user rplac'ing this alist or its elements. */ 113 to prevent lossage due to user rplac'ing this alist or its elements. */
112Lisp_Object Vbuffer_alist; 114Lisp_Object Vbuffer_alist;
113 115
114Lisp_Object Qkill_buffer_query_functions; 116static Lisp_Object Qkill_buffer_query_functions;
115 117
116/* Hook run before changing a major mode. */ 118/* Hook run before changing a major mode. */
117Lisp_Object Qchange_major_mode_hook; 119static Lisp_Object Qchange_major_mode_hook;
118 120
119Lisp_Object Qfirst_change_hook; 121Lisp_Object Qfirst_change_hook;
120Lisp_Object Qbefore_change_functions; 122Lisp_Object Qbefore_change_functions;
121Lisp_Object Qafter_change_functions; 123Lisp_Object Qafter_change_functions;
122Lisp_Object Qucs_set_table_for_input; 124static Lisp_Object Qucs_set_table_for_input;
123 125
124Lisp_Object Qfundamental_mode, Qmode_class, Qpermanent_local; 126static Lisp_Object Qfundamental_mode, Qmode_class, Qpermanent_local;
125Lisp_Object Qpermanent_local_hook; 127static Lisp_Object Qpermanent_local_hook;
126 128
127Lisp_Object Qprotected_field; 129static Lisp_Object Qprotected_field;
128 130
129Lisp_Object QSFundamental; /* A string "Fundamental" */ 131static Lisp_Object QSFundamental; /* A string "Fundamental" */
130 132
131Lisp_Object Qkill_buffer_hook; 133static Lisp_Object Qkill_buffer_hook;
132 134
133Lisp_Object Qget_file_buffer; 135static Lisp_Object Qget_file_buffer;
134 136
135Lisp_Object Qoverlayp; 137static Lisp_Object Qoverlayp;
136 138
137Lisp_Object Qpriority, Qevaporate, Qbefore_string, Qafter_string; 139Lisp_Object Qpriority, Qbefore_string, Qafter_string;
140static Lisp_Object Qevaporate;
138 141
139Lisp_Object Qmodification_hooks; 142Lisp_Object Qmodification_hooks;
140Lisp_Object Qinsert_in_front_hooks; 143Lisp_Object Qinsert_in_front_hooks;
@@ -291,9 +294,6 @@ get_truename_buffer (register Lisp_Object filename)
291 return Qnil; 294 return Qnil;
292} 295}
293 296
294/* Incremented for each buffer created, to assign the buffer number. */
295int buffer_count;
296
297DEFUN ("get-buffer-create", Fget_buffer_create, Sget_buffer_create, 1, 1, 0, 297DEFUN ("get-buffer-create", Fget_buffer_create, Sget_buffer_create, 1, 1, 0,
298 doc: /* Return the buffer specified by BUFFER-OR-NAME, creating a new one if needed. 298 doc: /* Return the buffer specified by BUFFER-OR-NAME, creating a new one if needed.
299If BUFFER-OR-NAME is a string and a live buffer with that name exists, 299If BUFFER-OR-NAME is a string and a live buffer with that name exists,
@@ -830,8 +830,8 @@ reset_buffer_local_variables (register struct buffer *b, int permanent_too)
830 and set-visited-file-name ought to be able to use this to really 830 and set-visited-file-name ought to be able to use this to really
831 rename the buffer properly. */ 831 rename the buffer properly. */
832 832
833DEFUN ("generate-new-buffer-name", Fgenerate_new_buffer_name, Sgenerate_new_buffer_name, 833DEFUN ("generate-new-buffer-name", Fgenerate_new_buffer_name,
834 1, 2, 0, 834 Sgenerate_new_buffer_name, 1, 2, 0,
835 doc: /* Return a string that is the name of no existing buffer based on NAME. 835 doc: /* Return a string that is the name of no existing buffer based on NAME.
836If there is no live buffer named NAME, then return NAME. 836If there is no live buffer named NAME, then return NAME.
837Otherwise modify name by appending `<NUMBER>', incrementing NUMBER 837Otherwise modify name by appending `<NUMBER>', incrementing NUMBER
@@ -1276,7 +1276,6 @@ If no other buffer exists, the buffer `*scratch*' is returned.
1276If BUFFER is omitted or nil, some interesting buffer is returned. */) 1276If BUFFER is omitted or nil, some interesting buffer is returned. */)
1277 (register Lisp_Object buffer, Lisp_Object visible_ok, Lisp_Object frame) 1277 (register Lisp_Object buffer, Lisp_Object visible_ok, Lisp_Object frame)
1278{ 1278{
1279 Lisp_Object Fset_buffer_major_mode (Lisp_Object buffer);
1280 register Lisp_Object tail, buf, notsogood, tem, pred, add_ons; 1279 register Lisp_Object tail, buf, notsogood, tem, pred, add_ons;
1281 notsogood = Qnil; 1280 notsogood = Qnil;
1282 1281
@@ -2501,8 +2500,8 @@ current buffer is cleared. */)
2501 return flag; 2500 return flag;
2502} 2501}
2503 2502
2504DEFUN ("kill-all-local-variables", Fkill_all_local_variables, Skill_all_local_variables, 2503DEFUN ("kill-all-local-variables", Fkill_all_local_variables,
2505 0, 0, 0, 2504 Skill_all_local_variables, 0, 0, 0,
2506 doc: /* Switch to Fundamental mode by killing current buffer's local variables. 2505 doc: /* Switch to Fundamental mode by killing current buffer's local variables.
2507Most local variable bindings are eliminated so that the default values 2506Most local variable bindings are eliminated so that the default values
2508become effective once more. Also, the syntax table is set from 2507become effective once more. Also, the syntax table is set from
diff --git a/src/buffer.h b/src/buffer.h
index d80875a0811..2963aa382ca 100644
--- a/src/buffer.h
+++ b/src/buffer.h
@@ -917,7 +917,6 @@ extern void mmap_set_vars (int);
917EXFUN (Fbuffer_live_p, 1); 917EXFUN (Fbuffer_live_p, 1);
918EXFUN (Fbuffer_name, 1); 918EXFUN (Fbuffer_name, 1);
919EXFUN (Fnext_overlay_change, 1); 919EXFUN (Fnext_overlay_change, 1);
920EXFUN (Fdelete_overlay, 1);
921EXFUN (Fbuffer_local_value, 2); 920EXFUN (Fbuffer_local_value, 2);
922 921
923extern Lisp_Object Qbefore_change_functions; 922extern Lisp_Object Qbefore_change_functions;
diff --git a/src/bytecode.c b/src/bytecode.c
index b4a5354a0a4..581e16678a6 100644
--- a/src/bytecode.c
+++ b/src/bytecode.c
@@ -80,7 +80,6 @@ Lisp_Object Qbyte_code_meter;
80 80
81 81
82Lisp_Object Qbytecode; 82Lisp_Object Qbytecode;
83extern Lisp_Object Qand_optional, Qand_rest;
84 83
85/* Byte codes: */ 84/* Byte codes: */
86 85
diff --git a/src/callint.c b/src/callint.c
index 047fbcdb467..e5ec3d7d931 100644
--- a/src/callint.c
+++ b/src/callint.c
@@ -30,14 +30,15 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
30 30
31Lisp_Object Qminus, Qplus; 31Lisp_Object Qminus, Qplus;
32Lisp_Object Qcall_interactively; 32Lisp_Object Qcall_interactively;
33Lisp_Object Qcommand_debug_status; 33static Lisp_Object Qcommand_debug_status;
34Lisp_Object Qenable_recursive_minibuffers; 34static Lisp_Object Qenable_recursive_minibuffers;
35 35
36Lisp_Object Qhandle_shift_selection; 36static Lisp_Object Qhandle_shift_selection;
37 37
38Lisp_Object Qmouse_leave_buffer_hook; 38Lisp_Object Qmouse_leave_buffer_hook;
39 39
40Lisp_Object Qlist, Qlet, Qletx, Qsave_excursion, Qprogn, Qif, Qwhen; 40static Lisp_Object Qlist, Qlet, Qletx, Qsave_excursion, Qprogn, Qif;
41Lisp_Object Qwhen;
41static Lisp_Object preserved_fns; 42static Lisp_Object preserved_fns;
42 43
43/* Marker used within call-interactively to refer to point. */ 44/* Marker used within call-interactively to refer to point. */
diff --git a/src/callproc.c b/src/callproc.c
index eb2a2268fe1..3726eb3cc7f 100644
--- a/src/callproc.c
+++ b/src/callproc.c
@@ -96,7 +96,7 @@ int synch_process_retcode;
96/* Nonzero if this is termination due to exit. */ 96/* Nonzero if this is termination due to exit. */
97static int call_process_exited; 97static int call_process_exited;
98 98
99EXFUN (Fgetenv_internal, 2); 99static Lisp_Object Fgetenv_internal (Lisp_Object, Lisp_Object);
100 100
101static Lisp_Object 101static Lisp_Object
102call_process_kill (Lisp_Object fdpid) 102call_process_kill (Lisp_Object fdpid)
diff --git a/src/casetab.c b/src/casetab.c
index 9a1accf6940..29120dd08ce 100644
--- a/src/casetab.c
+++ b/src/casetab.c
@@ -24,9 +24,11 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
24#include "buffer.h" 24#include "buffer.h"
25#include "character.h" 25#include "character.h"
26 26
27Lisp_Object Qcase_table_p, Qcase_table; 27static Lisp_Object Qcase_table_p, Qcase_table;
28Lisp_Object Vascii_downcase_table, Vascii_upcase_table; 28Lisp_Object Vascii_downcase_table;
29Lisp_Object Vascii_canon_table, Vascii_eqv_table; 29static Lisp_Object Vascii_upcase_table;
30Lisp_Object Vascii_canon_table;
31static Lisp_Object Vascii_eqv_table;
30 32
31static void set_canon (Lisp_Object case_table, Lisp_Object range, Lisp_Object elt); 33static void set_canon (Lisp_Object case_table, Lisp_Object range, Lisp_Object elt);
32static void set_identity (Lisp_Object table, Lisp_Object c, Lisp_Object elt); 34static void set_identity (Lisp_Object table, Lisp_Object c, Lisp_Object elt);
@@ -101,7 +103,8 @@ EQUIVALENCES is a map that cyclicly permutes each equivalence class
101 return set_case_table (table, 0); 103 return set_case_table (table, 0);
102} 104}
103 105
104DEFUN ("set-standard-case-table", Fset_standard_case_table, Sset_standard_case_table, 1, 1, 0, 106DEFUN ("set-standard-case-table", Fset_standard_case_table,
107 Sset_standard_case_table, 1, 1, 0,
105 doc: /* Select a new standard case table for new buffers. 108 doc: /* Select a new standard case table for new buffers.
106See `set-case-table' for more info on case tables. */) 109See `set-case-table' for more info on case tables. */)
107 (Lisp_Object table) 110 (Lisp_Object table)
diff --git a/src/category.c b/src/category.c
index bba030360c4..356801a179c 100644
--- a/src/category.c
+++ b/src/category.c
@@ -48,11 +48,16 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
48 For the moment, we are not using this feature. */ 48 For the moment, we are not using this feature. */
49static int category_table_version; 49static int category_table_version;
50 50
51Lisp_Object Qcategory_table, Qcategoryp, Qcategorysetp, Qcategory_table_p; 51static Lisp_Object Qcategory_table, Qcategoryp, Qcategorysetp, Qcategory_table_p;
52 52
53/* Temporary internal variable used in macro CHAR_HAS_CATEGORY. */ 53/* Temporary internal variable used in macro CHAR_HAS_CATEGORY. */
54Lisp_Object _temp_category_set; 54Lisp_Object _temp_category_set;
55 55
56/* Make CATEGORY_SET includes (if VAL is t) or excludes (if VAL is
57 nil) CATEGORY. */
58#define SET_CATEGORY_SET(category_set, category, val) \
59 set_category_set (category_set, category, val)
60static void set_category_set (Lisp_Object, Lisp_Object, Lisp_Object);
56 61
57/* Category set staff. */ 62/* Category set staff. */
58 63
@@ -111,7 +116,7 @@ those categories. */)
111 116
112/* Category staff. */ 117/* Category staff. */
113 118
114Lisp_Object check_category_table (Lisp_Object table); 119static Lisp_Object check_category_table (Lisp_Object table);
115 120
116DEFUN ("define-category", Fdefine_category, Sdefine_category, 2, 3, 0, 121DEFUN ("define-category", Fdefine_category, Sdefine_category, 2, 3, 0,
117 doc: /* Define CATEGORY as a category which is described by DOCSTRING. 122 doc: /* Define CATEGORY as a category which is described by DOCSTRING.
@@ -185,7 +190,7 @@ DEFUN ("category-table-p", Fcategory_table_p, Scategory_table_p, 1, 1, 0,
185 valid, return TABLE itself, but if not valid, signal an error of 190 valid, return TABLE itself, but if not valid, signal an error of
186 wrong-type-argument. */ 191 wrong-type-argument. */
187 192
188Lisp_Object 193static Lisp_Object
189check_category_table (Lisp_Object table) 194check_category_table (Lisp_Object table)
190{ 195{
191 if (NILP (table)) 196 if (NILP (table))
@@ -325,7 +330,7 @@ The return value is a string containing those same categories. */)
325 return build_string (str); 330 return build_string (str);
326} 331}
327 332
328void 333static void
329set_category_set (Lisp_Object category_set, Lisp_Object category, Lisp_Object val) 334set_category_set (Lisp_Object category_set, Lisp_Object category, Lisp_Object val)
330{ 335{
331 do { 336 do {
diff --git a/src/category.h b/src/category.h
index b279f3d9c59..eacd89ce2cb 100644
--- a/src/category.h
+++ b/src/category.h
@@ -67,11 +67,6 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
67/* Return a new empty category set. */ 67/* Return a new empty category set. */
68#define MAKE_CATEGORY_SET (Fmake_bool_vector (make_number (128), Qnil)) 68#define MAKE_CATEGORY_SET (Fmake_bool_vector (make_number (128), Qnil))
69 69
70/* Make CATEGORY_SET includes (if VAL is t) or excludes (if VAL is
71 nil) CATEGORY. */
72#define SET_CATEGORY_SET(category_set, category, val) \
73 (set_category_set (category_set, category, val))
74
75#define CHECK_CATEGORY_SET(x) \ 70#define CHECK_CATEGORY_SET(x) \
76 CHECK_TYPE (CATEGORY_SET_P (x), Qcategorysetp, x) 71 CHECK_TYPE (CATEGORY_SET_P (x), Qcategorysetp, x)
77 72
@@ -114,5 +109,3 @@ extern Lisp_Object _temp_category_set;
114 && word_boundary_p (c1, c2)) 109 && word_boundary_p (c1, c2))
115 110
116extern int word_boundary_p (int, int); 111extern int word_boundary_p (int, int);
117extern void set_category_set (Lisp_Object, Lisp_Object, Lisp_Object);
118
diff --git a/src/ccl.c b/src/ccl.c
index 39b9bc32f09..66e0f2c6169 100644
--- a/src/ccl.c
+++ b/src/ccl.c
@@ -38,16 +38,16 @@ Lisp_Object Qccl, Qcclp;
38 38
39/* This symbol is a property which associates with ccl program vector. 39/* This symbol is a property which associates with ccl program vector.
40 Ex: (get 'ccl-big5-encoder 'ccl-program) returns ccl program vector. */ 40 Ex: (get 'ccl-big5-encoder 'ccl-program) returns ccl program vector. */
41Lisp_Object Qccl_program; 41static Lisp_Object Qccl_program;
42 42
43/* These symbols are properties which associate with code conversion 43/* These symbols are properties which associate with code conversion
44 map and their ID respectively. */ 44 map and their ID respectively. */
45Lisp_Object Qcode_conversion_map; 45static Lisp_Object Qcode_conversion_map;
46Lisp_Object Qcode_conversion_map_id; 46static Lisp_Object Qcode_conversion_map_id;
47 47
48/* Symbols of ccl program have this property, a value of the property 48/* Symbols of ccl program have this property, a value of the property
49 is an index for Vccl_protram_table. */ 49 is an index for Vccl_protram_table. */
50Lisp_Object Qccl_program_idx; 50static Lisp_Object Qccl_program_idx;
51 51
52/* Table of registered CCL programs. Each element is a vector of 52/* Table of registered CCL programs. Each element is a vector of
53 NAME, CCL_PROG, RESOLVEDP, and UPDATEDP, where NAME (symbol) is the 53 NAME, CCL_PROG, RESOLVEDP, and UPDATEDP, where NAME (symbol) is the
@@ -56,7 +56,7 @@ Lisp_Object Qccl_program_idx;
56 CCL_PROG is already resolved to index numbers or not, UPDATEDP (t 56 CCL_PROG is already resolved to index numbers or not, UPDATEDP (t
57 or nil) is the flat to tell if the CCL program is updated after it 57 or nil) is the flat to tell if the CCL program is updated after it
58 was once used. */ 58 was once used. */
59Lisp_Object Vccl_program_table; 59static Lisp_Object Vccl_program_table;
60 60
61/* Return a hash table of id number ID. */ 61/* Return a hash table of id number ID. */
62#define GET_HASH_TABLE(id) \ 62#define GET_HASH_TABLE(id) \
@@ -1929,30 +1929,6 @@ setup_ccl_program (struct ccl_program *ccl, Lisp_Object ccl_prog)
1929} 1929}
1930 1930
1931 1931
1932/* Check if CCL is updated or not. If not, re-setup members of CCL. */
1933
1934int
1935check_ccl_update (struct ccl_program *ccl)
1936{
1937 Lisp_Object slot, ccl_prog;
1938
1939 if (ccl->idx < 0)
1940 return 0;
1941 slot = AREF (Vccl_program_table, ccl->idx);
1942 if (NILP (AREF (slot, 3)))
1943 return 0;
1944 ccl_prog = ccl_get_compiled_code (AREF (slot, 0), &ccl->idx);
1945 if (! VECTORP (ccl_prog))
1946 return -1;
1947 ccl->size = ASIZE (ccl_prog);
1948 ccl->prog = XVECTOR (ccl_prog)->contents;
1949 ccl->eof_ic = XINT (AREF (ccl_prog, CCL_HEADER_EOF));
1950 ccl->buf_magnification = XINT (AREF (ccl_prog, CCL_HEADER_BUF_MAG));
1951 ASET (slot, 3, Qnil);
1952 return 0;
1953}
1954
1955
1956DEFUN ("ccl-program-p", Fccl_program_p, Sccl_program_p, 1, 1, 0, 1932DEFUN ("ccl-program-p", Fccl_program_p, Sccl_program_p, 1, 1, 0,
1957 doc: /* Return t if OBJECT is a CCL program name or a compiled CCL program code. 1933 doc: /* Return t if OBJECT is a CCL program name or a compiled CCL program code.
1958See the documentation of `define-ccl-program' for the detail of CCL program. */) 1934See the documentation of `define-ccl-program' for the detail of CCL program. */)
diff --git a/src/ccl.h b/src/ccl.h
index 8c1f5e5cbd7..e86154352a3 100644
--- a/src/ccl.h
+++ b/src/ccl.h
@@ -96,19 +96,9 @@ struct ccl_spec {
96 execution of ccl program CCL_PROG (symbol or vector). */ 96 execution of ccl program CCL_PROG (symbol or vector). */
97extern int setup_ccl_program (struct ccl_program *, Lisp_Object); 97extern int setup_ccl_program (struct ccl_program *, Lisp_Object);
98 98
99/* Check if CCL is updated or not. If not, re-setup members of CCL. */
100extern int check_ccl_update (struct ccl_program *);
101
102extern void ccl_driver (struct ccl_program *, int *, int *, int, int, 99extern void ccl_driver (struct ccl_program *, int *, int *, int, int,
103 Lisp_Object); 100 Lisp_Object);
104 101
105/* Vector of CCL program names vs corresponding program data. */
106extern Lisp_Object Vccl_program_table;
107
108/* Symbols of ccl program have this property, a value of the property
109 is an index for Vccl_protram_table. */
110extern Lisp_Object Qccl_program_idx;
111
112extern Lisp_Object Qccl, Qcclp; 102extern Lisp_Object Qccl, Qcclp;
113 103
114EXFUN (Fccl_program_p, 1); 104EXFUN (Fccl_program_p, 1);
@@ -120,4 +110,3 @@ EXFUN (Fccl_program_p, 1);
120 } while (0); 110 } while (0);
121 111
122#endif /* EMACS_CCL_H */ 112#endif /* EMACS_CCL_H */
123
diff --git a/src/character.c b/src/character.c
index bac9f6af81e..84eddeb2fc2 100644
--- a/src/character.c
+++ b/src/character.c
@@ -50,7 +50,7 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
50 50
51Lisp_Object Qcharacterp; 51Lisp_Object Qcharacterp;
52 52
53Lisp_Object Qauto_fill_chars; 53static Lisp_Object Qauto_fill_chars;
54 54
55/* Char-table of information about which character to unify to which 55/* Char-table of information about which character to unify to which
56 Unicode character. Mainly used by the macro MAYBE_UNIFY_CHAR. */ 56 Unicode character. Mainly used by the macro MAYBE_UNIFY_CHAR. */
diff --git a/src/character.h b/src/character.h
index 7a75ac186fa..864882db7f6 100644
--- a/src/character.h
+++ b/src/character.h
@@ -615,7 +615,7 @@ extern EMACS_INT c_string_width (const unsigned char *, EMACS_INT, int,
615extern EMACS_INT lisp_string_width (Lisp_Object, int, 615extern EMACS_INT lisp_string_width (Lisp_Object, int,
616 EMACS_INT *, EMACS_INT *); 616 EMACS_INT *, EMACS_INT *);
617 617
618extern Lisp_Object Qcharacterp, Qauto_fill_chars; 618extern Lisp_Object Qcharacterp;
619extern Lisp_Object Vchar_unify_table; 619extern Lisp_Object Vchar_unify_table;
620extern Lisp_Object string_escape_byte8 (Lisp_Object); 620extern Lisp_Object string_escape_byte8 (Lisp_Object);
621 621
diff --git a/src/charset.c b/src/charset.c
index 783d7db5733..c4699dcb0a7 100644
--- a/src/charset.c
+++ b/src/charset.c
@@ -68,17 +68,17 @@ Lisp_Object Qcharsetp;
68 68
69/* Special charset symbols. */ 69/* Special charset symbols. */
70Lisp_Object Qascii; 70Lisp_Object Qascii;
71Lisp_Object Qeight_bit; 71static Lisp_Object Qeight_bit;
72Lisp_Object Qiso_8859_1; 72static Lisp_Object Qiso_8859_1;
73Lisp_Object Qunicode; 73static Lisp_Object Qunicode;
74Lisp_Object Qemacs; 74static Lisp_Object Qemacs;
75 75
76/* The corresponding charsets. */ 76/* The corresponding charsets. */
77int charset_ascii; 77int charset_ascii;
78int charset_eight_bit; 78int charset_eight_bit;
79int charset_iso_8859_1; 79static int charset_iso_8859_1;
80int charset_unicode; 80int charset_unicode;
81int charset_emacs; 81static int charset_emacs;
82 82
83/* The other special charsets. */ 83/* The other special charsets. */
84int charset_jisx0201_roman; 84int charset_jisx0201_roman;
@@ -87,7 +87,7 @@ int charset_jisx0208;
87int charset_ksc5601; 87int charset_ksc5601;
88 88
89/* Value of charset attribute `charset-iso-plane'. */ 89/* Value of charset attribute `charset-iso-plane'. */
90Lisp_Object Qgl, Qgr; 90static Lisp_Object Qgl, Qgr;
91 91
92/* Charset of unibyte characters. */ 92/* Charset of unibyte characters. */
93int charset_unibyte; 93int charset_unibyte;
@@ -652,12 +652,10 @@ DEFUN ("charsetp", Fcharsetp, Scharsetp, 1, 1, 0,
652} 652}
653 653
654 654
655void map_charset_for_dump (void (*c_function) (Lisp_Object, Lisp_Object), 655static void
656 Lisp_Object function, Lisp_Object arg, 656map_charset_for_dump (void (*c_function) (Lisp_Object, Lisp_Object),
657 unsigned from, unsigned to); 657 Lisp_Object function, Lisp_Object arg,
658 658 unsigned int from, unsigned int to)
659void
660map_charset_for_dump (void (*c_function) (Lisp_Object, Lisp_Object), Lisp_Object function, Lisp_Object arg, unsigned int from, unsigned int to)
661{ 659{
662 int from_idx = CODE_POINT_TO_INDEX (temp_charset_work->current, from); 660 int from_idx = CODE_POINT_TO_INDEX (temp_charset_work->current, from);
663 int to_idx = CODE_POINT_TO_INDEX (temp_charset_work->current, to); 661 int to_idx = CODE_POINT_TO_INDEX (temp_charset_work->current, to);
diff --git a/src/charset.h b/src/charset.h
index 8c87ffe6c3d..74d55a31b43 100644
--- a/src/charset.h
+++ b/src/charset.h
@@ -517,9 +517,8 @@ extern int iso_charset_table[ISO_MAX_DIMENSION][ISO_MAX_CHARS][ISO_MAX_FINAL];
517 517
518extern Lisp_Object Qcharsetp; 518extern Lisp_Object Qcharsetp;
519 519
520extern Lisp_Object Qascii, Qunicode; 520extern Lisp_Object Qascii;
521extern int charset_ascii, charset_eight_bit; 521extern int charset_ascii, charset_eight_bit;
522extern int charset_iso_8859_1;
523extern int charset_unicode; 522extern int charset_unicode;
524extern int charset_jisx0201_roman; 523extern int charset_jisx0201_roman;
525extern int charset_jisx0208_1978; 524extern int charset_jisx0208_1978;
diff --git a/src/chartab.c b/src/chartab.c
index 7a0a3aabbb6..eb72d973c87 100644
--- a/src/chartab.c
+++ b/src/chartab.c
@@ -36,7 +36,7 @@ const int chartab_size[4] =
36 36
37/* Number of characters each element of Nth level char-table 37/* Number of characters each element of Nth level char-table
38 covers. */ 38 covers. */
39const int chartab_chars[4] = 39static const int chartab_chars[4] =
40 { (1 << (CHARTAB_SIZE_BITS_1 + CHARTAB_SIZE_BITS_2 + CHARTAB_SIZE_BITS_3)), 40 { (1 << (CHARTAB_SIZE_BITS_1 + CHARTAB_SIZE_BITS_2 + CHARTAB_SIZE_BITS_3)),
41 (1 << (CHARTAB_SIZE_BITS_2 + CHARTAB_SIZE_BITS_3)), 41 (1 << (CHARTAB_SIZE_BITS_2 + CHARTAB_SIZE_BITS_3)),
42 (1 << CHARTAB_SIZE_BITS_3), 42 (1 << CHARTAB_SIZE_BITS_3),
@@ -44,7 +44,7 @@ const int chartab_chars[4] =
44 44
45/* Number of characters (in bits) each element of Nth level char-table 45/* Number of characters (in bits) each element of Nth level char-table
46 covers. */ 46 covers. */
47const int chartab_bits[4] = 47static const int chartab_bits[4] =
48 { (CHARTAB_SIZE_BITS_1 + CHARTAB_SIZE_BITS_2 + CHARTAB_SIZE_BITS_3), 48 { (CHARTAB_SIZE_BITS_1 + CHARTAB_SIZE_BITS_2 + CHARTAB_SIZE_BITS_3),
49 (CHARTAB_SIZE_BITS_2 + CHARTAB_SIZE_BITS_3), 49 (CHARTAB_SIZE_BITS_2 + CHARTAB_SIZE_BITS_3),
50 CHARTAB_SIZE_BITS_3, 50 CHARTAB_SIZE_BITS_3,
diff --git a/src/cmds.c b/src/cmds.c
index 1cf7ff24fec..5dc4d2bfe30 100644
--- a/src/cmds.c
+++ b/src/cmds.c
@@ -31,10 +31,10 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
31#include "dispextern.h" 31#include "dispextern.h"
32#include "frame.h" 32#include "frame.h"
33 33
34Lisp_Object Qkill_forward_chars, Qkill_backward_chars; 34static Lisp_Object Qkill_forward_chars, Qkill_backward_chars;
35 35
36/* A possible value for a buffer's overwrite-mode variable. */ 36/* A possible value for a buffer's overwrite-mode variable. */
37Lisp_Object Qoverwrite_mode_binary; 37static Lisp_Object Qoverwrite_mode_binary;
38 38
39static int internal_self_insert (int, EMACS_INT); 39static int internal_self_insert (int, EMACS_INT);
40 40
diff --git a/src/coding.c b/src/coding.c
index 711ada59c85..b49070e5e16 100644
--- a/src/coding.c
+++ b/src/coding.c
@@ -300,27 +300,30 @@ encode_coding_XXX (struct coding_system *coding)
300 300
301Lisp_Object Vcoding_system_hash_table; 301Lisp_Object Vcoding_system_hash_table;
302 302
303Lisp_Object Qcoding_system, Qcoding_aliases, Qeol_type; 303static Lisp_Object Qcoding_system, Qeol_type;
304static Lisp_Object Qcoding_aliases;
304Lisp_Object Qunix, Qdos; 305Lisp_Object Qunix, Qdos;
305Lisp_Object Qbuffer_file_coding_system; 306Lisp_Object Qbuffer_file_coding_system;
306Lisp_Object Qpost_read_conversion, Qpre_write_conversion; 307static Lisp_Object Qpost_read_conversion, Qpre_write_conversion;
307Lisp_Object Qdefault_char; 308static Lisp_Object Qdefault_char;
308Lisp_Object Qno_conversion, Qundecided; 309Lisp_Object Qno_conversion, Qundecided;
309Lisp_Object Qcharset, Qiso_2022, Qutf_8, Qutf_16, Qshift_jis, Qbig5; 310Lisp_Object Qcharset, Qutf_8;
310Lisp_Object Qbig, Qlittle; 311static Lisp_Object Qiso_2022;
311Lisp_Object Qcoding_system_history; 312static Lisp_Object Qutf_16, Qshift_jis, Qbig5;
312Lisp_Object Qvalid_codes; 313static Lisp_Object Qbig, Qlittle;
313Lisp_Object QCcategory, QCmnemonic, QCdefault_char; 314static Lisp_Object Qcoding_system_history;
314Lisp_Object QCdecode_translation_table, QCencode_translation_table; 315static Lisp_Object Qvalid_codes;
315Lisp_Object QCpost_read_conversion, QCpre_write_conversion; 316static Lisp_Object QCcategory, QCmnemonic, QCdefault_char;
316Lisp_Object QCascii_compatible_p; 317static Lisp_Object QCdecode_translation_table, QCencode_translation_table;
318static Lisp_Object QCpost_read_conversion, QCpre_write_conversion;
319static Lisp_Object QCascii_compatible_p;
317 320
318Lisp_Object Qcall_process, Qcall_process_region; 321Lisp_Object Qcall_process, Qcall_process_region;
319Lisp_Object Qstart_process, Qopen_network_stream; 322Lisp_Object Qstart_process, Qopen_network_stream;
320Lisp_Object Qtarget_idx; 323static Lisp_Object Qtarget_idx;
321 324
322Lisp_Object Qinsufficient_source, Qinconsistent_eol, Qinvalid_source; 325static Lisp_Object Qinsufficient_source, Qinconsistent_eol, Qinvalid_source;
323Lisp_Object Qinterrupted, Qinsufficient_memory; 326static Lisp_Object Qinterrupted, Qinsufficient_memory;
324 327
325/* If a symbol has this property, evaluate the value to define the 328/* If a symbol has this property, evaluate the value to define the
326 symbol as a coding system. */ 329 symbol as a coding system. */
@@ -351,12 +354,12 @@ struct coding_system safe_terminal_coding;
351 354
352Lisp_Object Qtranslation_table; 355Lisp_Object Qtranslation_table;
353Lisp_Object Qtranslation_table_id; 356Lisp_Object Qtranslation_table_id;
354Lisp_Object Qtranslation_table_for_decode; 357static Lisp_Object Qtranslation_table_for_decode;
355Lisp_Object Qtranslation_table_for_encode; 358static Lisp_Object Qtranslation_table_for_encode;
356 359
357/* Two special coding systems. */ 360/* Two special coding systems. */
358Lisp_Object Vsjis_coding_system; 361static Lisp_Object Vsjis_coding_system;
359Lisp_Object Vbig5_coding_system; 362static Lisp_Object Vbig5_coding_system;
360 363
361/* ISO2022 section */ 364/* ISO2022 section */
362 365
@@ -2859,7 +2862,7 @@ encode_coding_emacs_mule (struct coding_system *coding)
2859 COMPOSITION_WITH_RULE_ALTCHARS: 2862 COMPOSITION_WITH_RULE_ALTCHARS:
2860 ESC 4 ALTCHAR [ RULE ALTCHAR ] ESC 0 CHAR [ CHAR ] ESC 1 */ 2863 ESC 4 ALTCHAR [ RULE ALTCHAR ] ESC 0 CHAR [ CHAR ] ESC 1 */
2861 2864
2862enum iso_code_class_type iso_code_class[256]; 2865static enum iso_code_class_type iso_code_class[256];
2863 2866
2864#define SAFE_CHARSET_P(coding, id) \ 2867#define SAFE_CHARSET_P(coding, id) \
2865 ((id) <= (coding)->max_charset_id \ 2868 ((id) <= (coding)->max_charset_id \
@@ -6209,7 +6212,7 @@ adjust_coding_eol_type (struct coding_system *coding, int eol_seen)
6209 system is detected, update fields of CODING by the detected coding 6212 system is detected, update fields of CODING by the detected coding
6210 system. */ 6213 system. */
6211 6214
6212void 6215static void
6213detect_coding (struct coding_system *coding) 6216detect_coding (struct coding_system *coding)
6214{ 6217{
6215 const unsigned char *src, *src_end; 6218 const unsigned char *src, *src_end;
@@ -7527,30 +7530,6 @@ decode_coding_gap (struct coding_system *coding,
7527 return coding->result; 7530 return coding->result;
7528} 7531}
7529 7532
7530int
7531encode_coding_gap (struct coding_system *coding,
7532 EMACS_INT chars, EMACS_INT bytes)
7533{
7534 int count = SPECPDL_INDEX ();
7535
7536 code_conversion_save (0, 0);
7537
7538 coding->src_object = Fcurrent_buffer ();
7539 coding->src_chars = chars;
7540 coding->src_bytes = bytes;
7541 coding->src_pos = -chars;
7542 coding->src_pos_byte = -bytes;
7543 coding->src_multibyte = chars < bytes;
7544 coding->dst_object = coding->src_object;
7545 coding->dst_pos = PT;
7546 coding->dst_pos_byte = PT_BYTE;
7547
7548 encode_coding (coding);
7549
7550 unbind_to (count, Qnil);
7551 return coding->result;
7552}
7553
7554 7533
7555/* Decode the text in the range FROM/FROM_BYTE and TO/TO_BYTE in 7534/* Decode the text in the range FROM/FROM_BYTE and TO/TO_BYTE in
7556 SRC_OBJECT into DST_OBJECT by coding context CODING. 7535 SRC_OBJECT into DST_OBJECT by coding context CODING.
@@ -8831,7 +8810,7 @@ is nil. */)
8831} 8810}
8832 8811
8833 8812
8834Lisp_Object 8813static Lisp_Object
8835code_convert_region (Lisp_Object start, Lisp_Object end, 8814code_convert_region (Lisp_Object start, Lisp_Object end,
8836 Lisp_Object coding_system, Lisp_Object dst_object, 8815 Lisp_Object coding_system, Lisp_Object dst_object,
8837 int encodep, int norecord) 8816 int encodep, int norecord)
diff --git a/src/coding.h b/src/coding.h
index 8414a2fe133..85e153dcc3a 100644
--- a/src/coding.h
+++ b/src/coding.h
@@ -695,10 +695,6 @@ extern int encoding_buffer_size (struct coding_system *, int);
695extern void setup_coding_system (Lisp_Object, struct coding_system *); 695extern void setup_coding_system (Lisp_Object, struct coding_system *);
696extern Lisp_Object coding_charset_list (struct coding_system *); 696extern Lisp_Object coding_charset_list (struct coding_system *);
697extern Lisp_Object coding_system_charset_list (Lisp_Object); 697extern Lisp_Object coding_system_charset_list (Lisp_Object);
698extern void detect_coding (struct coding_system *);
699extern Lisp_Object code_convert_region (Lisp_Object, Lisp_Object,
700 Lisp_Object, Lisp_Object,
701 int, int);
702extern Lisp_Object code_convert_string (Lisp_Object, Lisp_Object, 698extern Lisp_Object code_convert_string (Lisp_Object, Lisp_Object,
703 Lisp_Object, int, int, int); 699 Lisp_Object, int, int, int);
704extern Lisp_Object code_convert_string_norecord (Lisp_Object, Lisp_Object, 700extern Lisp_Object code_convert_string_norecord (Lisp_Object, Lisp_Object,
@@ -709,8 +705,6 @@ extern Lisp_Object complement_process_encoding_system (Lisp_Object);
709 705
710extern int decode_coding_gap (struct coding_system *, 706extern int decode_coding_gap (struct coding_system *,
711 EMACS_INT, EMACS_INT); 707 EMACS_INT, EMACS_INT);
712extern int encode_coding_gap (struct coding_system *,
713 EMACS_INT, EMACS_INT);
714extern void decode_coding_object (struct coding_system *, 708extern void decode_coding_object (struct coding_system *,
715 Lisp_Object, EMACS_INT, EMACS_INT, 709 Lisp_Object, EMACS_INT, EMACS_INT,
716 EMACS_INT, EMACS_INT, Lisp_Object); 710 EMACS_INT, EMACS_INT, Lisp_Object);
@@ -757,10 +751,9 @@ extern Lisp_Object preferred_coding_system (void);
757 751
758extern Lisp_Object Qutf_8, Qutf_8_emacs; 752extern Lisp_Object Qutf_8, Qutf_8_emacs;
759 753
760extern Lisp_Object Qcoding_system, Qeol_type, Qcoding_category_index; 754extern Lisp_Object Qcoding_category_index;
761extern Lisp_Object Qcoding_system_p; 755extern Lisp_Object Qcoding_system_p;
762extern Lisp_Object Qraw_text, Qemacs_mule, Qno_conversion, Qundecided; 756extern Lisp_Object Qraw_text, Qemacs_mule, Qno_conversion, Qundecided;
763extern Lisp_Object Qiso_2022;
764extern Lisp_Object Qbuffer_file_coding_system; 757extern Lisp_Object Qbuffer_file_coding_system;
765 758
766extern Lisp_Object Qunix, Qdos, Qmac; 759extern Lisp_Object Qunix, Qdos, Qmac;
@@ -789,4 +782,3 @@ extern char emacs_mule_bytes[256];
789extern int emacs_mule_string_char (unsigned char *); 782extern int emacs_mule_string_char (unsigned char *);
790 783
791#endif /* EMACS_CODING_H */ 784#endif /* EMACS_CODING_H */
792
diff --git a/src/commands.h b/src/commands.h
index 925e0ba1b80..bcd5de44180 100644
--- a/src/commands.h
+++ b/src/commands.h
@@ -36,15 +36,6 @@ extern Lisp_Object control_x_map;
36 events until a non-ASCII event is acceptable as input. */ 36 events until a non-ASCII event is acceptable as input. */
37extern Lisp_Object unread_switch_frame; 37extern Lisp_Object unread_switch_frame;
38 38
39/* The value of point when the last command was started. */
40extern EMACS_INT last_point_position;
41
42/* The buffer that was current when the last command was started. */
43extern Lisp_Object last_point_position_buffer;
44
45/* The window that was selected when the last command was started. */
46extern Lisp_Object last_point_position_window;
47
48/* Nonzero means ^G can quit instantly */ 39/* Nonzero means ^G can quit instantly */
49extern int immediate_quit; 40extern int immediate_quit;
50 41
@@ -55,4 +46,3 @@ extern int immediate_quit;
55/* Set this nonzero to force reconsideration of mode line. */ 46/* Set this nonzero to force reconsideration of mode line. */
56 47
57extern int update_mode_lines; 48extern int update_mode_lines;
58
diff --git a/src/composite.c b/src/composite.c
index c18f9e8b56e..fab7cb86ba8 100644
--- a/src/composite.c
+++ b/src/composite.c
@@ -152,13 +152,14 @@ int n_compositions;
152 COMPOSITION-ID. */ 152 COMPOSITION-ID. */
153Lisp_Object composition_hash_table; 153Lisp_Object composition_hash_table;
154 154
155Lisp_Object Qauto_composed; 155static Lisp_Object Qauto_composed;
156Lisp_Object Qauto_composition_function; 156static Lisp_Object Qauto_composition_function;
157/* Maximum number of characters to look back for 157/* Maximum number of characters to look back for
158 auto-compositions. */ 158 auto-compositions. */
159#define MAX_AUTO_COMPOSITION_LOOKBACK 3 159#define MAX_AUTO_COMPOSITION_LOOKBACK 3
160 160
161EXFUN (Fremove_list_of_text_properties, 4); 161static Lisp_Object Fcomposition_get_gstring (Lisp_Object, Lisp_Object,
162 Lisp_Object, Lisp_Object);
162 163
163/* Temporary variable used in macros COMPOSITION_XXX. */ 164/* Temporary variable used in macros COMPOSITION_XXX. */
164Lisp_Object composition_temp; 165Lisp_Object composition_temp;
diff --git a/src/composite.h b/src/composite.h
index cfb5db0dc6a..5188f981d9c 100644
--- a/src/composite.h
+++ b/src/composite.h
@@ -216,8 +216,6 @@ extern int n_compositions;
216 216
217extern Lisp_Object Qcomposition; 217extern Lisp_Object Qcomposition;
218extern Lisp_Object composition_hash_table; 218extern Lisp_Object composition_hash_table;
219extern Lisp_Object Qauto_composed;
220extern Lisp_Object Qauto_composition_function;
221extern int get_composition_id (EMACS_INT, EMACS_INT, EMACS_INT, 219extern int get_composition_id (EMACS_INT, EMACS_INT, EMACS_INT,
222 Lisp_Object, Lisp_Object); 220 Lisp_Object, Lisp_Object);
223extern int find_composition (EMACS_INT, EMACS_INT, EMACS_INT *, EMACS_INT *, 221extern int find_composition (EMACS_INT, EMACS_INT, EMACS_INT *, EMACS_INT *,
@@ -328,6 +326,4 @@ extern int composition_update_it (struct composition_it *,
328 326
329extern EMACS_INT composition_adjust_point (EMACS_INT, EMACS_INT); 327extern EMACS_INT composition_adjust_point (EMACS_INT, EMACS_INT);
330 328
331EXFUN (Fcomposition_get_gstring, 4);
332
333#endif /* not EMACS_COMPOSITE_H */ 329#endif /* not EMACS_COMPOSITE_H */
diff --git a/src/data.c b/src/data.c
index 4b9d2ec0387..956ff3700f2 100644
--- a/src/data.c
+++ b/src/data.c
@@ -52,26 +52,33 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
52extern double atof (const char *); 52extern double atof (const char *);
53#endif /* !atof */ 53#endif /* !atof */
54 54
55Lisp_Object Qnil, Qt, Qquote, Qlambda, Qsubr, Qunbound; 55Lisp_Object Qnil, Qt, Qquote, Qlambda, Qunbound;
56static Lisp_Object Qsubr;
56Lisp_Object Qerror_conditions, Qerror_message, Qtop_level; 57Lisp_Object Qerror_conditions, Qerror_message, Qtop_level;
57Lisp_Object Qerror, Qquit, Qwrong_type_argument, Qargs_out_of_range; 58Lisp_Object Qerror, Qquit, Qargs_out_of_range;
58Lisp_Object Qvoid_variable, Qvoid_function, Qcyclic_function_indirection; 59static Lisp_Object Qwrong_type_argument;
59Lisp_Object Qcyclic_variable_indirection, Qcircular_list; 60Lisp_Object Qvoid_variable, Qvoid_function;
60Lisp_Object Qsetting_constant, Qinvalid_read_syntax; 61static Lisp_Object Qcyclic_function_indirection;
62static Lisp_Object Qcyclic_variable_indirection;
63Lisp_Object Qcircular_list;
64static Lisp_Object Qsetting_constant;
65Lisp_Object Qinvalid_read_syntax;
61Lisp_Object Qinvalid_function, Qwrong_number_of_arguments, Qno_catch; 66Lisp_Object Qinvalid_function, Qwrong_number_of_arguments, Qno_catch;
62Lisp_Object Qend_of_file, Qarith_error, Qmark_inactive; 67Lisp_Object Qend_of_file, Qarith_error, Qmark_inactive;
63Lisp_Object Qbeginning_of_buffer, Qend_of_buffer, Qbuffer_read_only; 68Lisp_Object Qbeginning_of_buffer, Qend_of_buffer, Qbuffer_read_only;
64Lisp_Object Qtext_read_only; 69Lisp_Object Qtext_read_only;
65 70
66Lisp_Object Qintegerp, Qnatnump, Qwholenump, Qsymbolp, Qlistp, Qconsp; 71Lisp_Object Qintegerp, Qwholenump, Qsymbolp, Qlistp, Qconsp;
72static Lisp_Object Qnatnump;
67Lisp_Object Qstringp, Qarrayp, Qsequencep, Qbufferp; 73Lisp_Object Qstringp, Qarrayp, Qsequencep, Qbufferp;
68Lisp_Object Qchar_or_string_p, Qmarkerp, Qinteger_or_marker_p, Qvectorp; 74Lisp_Object Qchar_or_string_p, Qmarkerp, Qinteger_or_marker_p, Qvectorp;
69Lisp_Object Qbuffer_or_string_p, Qkeywordp; 75Lisp_Object Qbuffer_or_string_p;
70Lisp_Object Qboundp, Qfboundp; 76static Lisp_Object Qkeywordp, Qboundp;
77Lisp_Object Qfboundp;
71Lisp_Object Qchar_table_p, Qvector_or_char_table_p; 78Lisp_Object Qchar_table_p, Qvector_or_char_table_p;
72 79
73Lisp_Object Qcdr; 80Lisp_Object Qcdr;
74Lisp_Object Qad_advice_info, Qad_activate_internal; 81static Lisp_Object Qad_advice_info, Qad_activate_internal;
75 82
76Lisp_Object Qrange_error, Qdomain_error, Qsingularity_error; 83Lisp_Object Qrange_error, Qdomain_error, Qsingularity_error;
77Lisp_Object Qoverflow_error, Qunderflow_error; 84Lisp_Object Qoverflow_error, Qunderflow_error;
@@ -83,7 +90,7 @@ Lisp_Object Qinteger;
83static Lisp_Object Qsymbol, Qstring, Qcons, Qmarker, Qoverlay; 90static Lisp_Object Qsymbol, Qstring, Qcons, Qmarker, Qoverlay;
84Lisp_Object Qwindow; 91Lisp_Object Qwindow;
85static Lisp_Object Qfloat, Qwindow_configuration; 92static Lisp_Object Qfloat, Qwindow_configuration;
86Lisp_Object Qprocess; 93static Lisp_Object Qprocess;
87static Lisp_Object Qcompiled_function, Qbuffer, Qframe, Qvector; 94static Lisp_Object Qcompiled_function, Qbuffer, Qframe, Qvector;
88static Lisp_Object Qchar_table, Qbool_vector, Qhash_table; 95static Lisp_Object Qchar_table, Qbool_vector, Qhash_table;
89static Lisp_Object Qsubrp, Qmany, Qunevalled; 96static Lisp_Object Qsubrp, Qmany, Qunevalled;
@@ -94,13 +101,6 @@ Lisp_Object Qinteractive_form;
94static void swap_in_symval_forwarding (struct Lisp_Symbol *, struct Lisp_Buffer_Local_Value *); 101static void swap_in_symval_forwarding (struct Lisp_Symbol *, struct Lisp_Buffer_Local_Value *);
95 102
96 103
97void
98circular_list_error (Lisp_Object list)
99{
100 xsignal (Qcircular_list, list);
101}
102
103
104Lisp_Object 104Lisp_Object
105wrong_type_argument (register Lisp_Object predicate, register Lisp_Object value) 105wrong_type_argument (register Lisp_Object predicate, register Lisp_Object value)
106{ 106{
@@ -1479,8 +1479,8 @@ make_blv (struct Lisp_Symbol *sym, int forwarded, union Lisp_Val_Fwd valcontents
1479 return blv; 1479 return blv;
1480} 1480}
1481 1481
1482DEFUN ("make-variable-buffer-local", Fmake_variable_buffer_local, Smake_variable_buffer_local, 1482DEFUN ("make-variable-buffer-local", Fmake_variable_buffer_local,
1483 1, 1, "vMake Variable Buffer Local: ", 1483 Smake_variable_buffer_local, 1, 1, "vMake Variable Buffer Local: ",
1484 doc: /* Make VARIABLE become buffer-local whenever it is set. 1484 doc: /* Make VARIABLE become buffer-local whenever it is set.
1485At any time, the value for the current buffer is in effect, 1485At any time, the value for the current buffer is in effect,
1486unless the variable has never been set in this buffer, 1486unless the variable has never been set in this buffer,
@@ -1955,7 +1955,8 @@ If the current binding is global (the default), the value is nil. */)
1955#if 0 1955#if 0
1956extern struct terminal *get_terminal (Lisp_Object display, int); 1956extern struct terminal *get_terminal (Lisp_Object display, int);
1957 1957
1958DEFUN ("terminal-local-value", Fterminal_local_value, Sterminal_local_value, 2, 2, 0, 1958DEFUN ("terminal-local-value", Fterminal_local_value,
1959 Sterminal_local_value, 2, 2, 0,
1959 doc: /* Return the terminal-local value of SYMBOL on TERMINAL. 1960 doc: /* Return the terminal-local value of SYMBOL on TERMINAL.
1960If SYMBOL is not a terminal-local variable, then return its normal 1961If SYMBOL is not a terminal-local variable, then return its normal
1961value, like `symbol-value'. 1962value, like `symbol-value'.
@@ -1972,7 +1973,8 @@ selected frame's terminal device). */)
1972 return result; 1973 return result;
1973} 1974}
1974 1975
1975DEFUN ("set-terminal-local-value", Fset_terminal_local_value, Sset_terminal_local_value, 3, 3, 0, 1976DEFUN ("set-terminal-local-value", Fset_terminal_local_value,
1977 Sset_terminal_local_value, 3, 3, 0,
1976 doc: /* Set the terminal-local binding of SYMBOL on TERMINAL to VALUE. 1978 doc: /* Set the terminal-local binding of SYMBOL on TERMINAL to VALUE.
1977If VARIABLE is not a terminal-local variable, then set its normal 1979If VARIABLE is not a terminal-local variable, then set its normal
1978binding, like `set'. 1980binding, like `set'.
diff --git a/src/dbusbind.c b/src/dbusbind.c
index 8a6870555d0..792414b23d8 100644
--- a/src/dbusbind.c
+++ b/src/dbusbind.c
@@ -30,53 +30,53 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
30 30
31 31
32/* Subroutines. */ 32/* Subroutines. */
33Lisp_Object Qdbus_init_bus; 33static Lisp_Object Qdbus_init_bus;
34Lisp_Object Qdbus_close_bus; 34static Lisp_Object Qdbus_close_bus;
35Lisp_Object Qdbus_get_unique_name; 35static Lisp_Object Qdbus_get_unique_name;
36Lisp_Object Qdbus_call_method; 36static Lisp_Object Qdbus_call_method;
37Lisp_Object Qdbus_call_method_asynchronously; 37static Lisp_Object Qdbus_call_method_asynchronously;
38Lisp_Object Qdbus_method_return_internal; 38static Lisp_Object Qdbus_method_return_internal;
39Lisp_Object Qdbus_method_error_internal; 39static Lisp_Object Qdbus_method_error_internal;
40Lisp_Object Qdbus_send_signal; 40static Lisp_Object Qdbus_send_signal;
41Lisp_Object Qdbus_register_service; 41static Lisp_Object Qdbus_register_service;
42Lisp_Object Qdbus_register_signal; 42static Lisp_Object Qdbus_register_signal;
43Lisp_Object Qdbus_register_method; 43static Lisp_Object Qdbus_register_method;
44 44
45/* D-Bus error symbol. */ 45/* D-Bus error symbol. */
46Lisp_Object Qdbus_error; 46static Lisp_Object Qdbus_error;
47 47
48/* Lisp symbols of the system and session buses. */ 48/* Lisp symbols of the system and session buses. */
49Lisp_Object QCdbus_system_bus, QCdbus_session_bus; 49static Lisp_Object QCdbus_system_bus, QCdbus_session_bus;
50 50
51/* Lisp symbol for method call timeout. */ 51/* Lisp symbol for method call timeout. */
52Lisp_Object QCdbus_timeout; 52static Lisp_Object QCdbus_timeout;
53 53
54/* Lisp symbols for name request flags. */ 54/* Lisp symbols for name request flags. */
55Lisp_Object QCdbus_request_name_allow_replacement; 55static Lisp_Object QCdbus_request_name_allow_replacement;
56Lisp_Object QCdbus_request_name_replace_existing; 56static Lisp_Object QCdbus_request_name_replace_existing;
57Lisp_Object QCdbus_request_name_do_not_queue; 57static Lisp_Object QCdbus_request_name_do_not_queue;
58 58
59/* Lisp symbols for name request replies. */ 59/* Lisp symbols for name request replies. */
60Lisp_Object QCdbus_request_name_reply_primary_owner; 60static Lisp_Object QCdbus_request_name_reply_primary_owner;
61Lisp_Object QCdbus_request_name_reply_in_queue; 61static Lisp_Object QCdbus_request_name_reply_in_queue;
62Lisp_Object QCdbus_request_name_reply_exists; 62static Lisp_Object QCdbus_request_name_reply_exists;
63Lisp_Object QCdbus_request_name_reply_already_owner; 63static Lisp_Object QCdbus_request_name_reply_already_owner;
64 64
65/* Lisp symbols of D-Bus types. */ 65/* Lisp symbols of D-Bus types. */
66Lisp_Object QCdbus_type_byte, QCdbus_type_boolean; 66static Lisp_Object QCdbus_type_byte, QCdbus_type_boolean;
67Lisp_Object QCdbus_type_int16, QCdbus_type_uint16; 67static Lisp_Object QCdbus_type_int16, QCdbus_type_uint16;
68Lisp_Object QCdbus_type_int32, QCdbus_type_uint32; 68static Lisp_Object QCdbus_type_int32, QCdbus_type_uint32;
69Lisp_Object QCdbus_type_int64, QCdbus_type_uint64; 69static Lisp_Object QCdbus_type_int64, QCdbus_type_uint64;
70Lisp_Object QCdbus_type_double, QCdbus_type_string; 70static Lisp_Object QCdbus_type_double, QCdbus_type_string;
71Lisp_Object QCdbus_type_object_path, QCdbus_type_signature; 71static Lisp_Object QCdbus_type_object_path, QCdbus_type_signature;
72#ifdef DBUS_TYPE_UNIX_FD 72#ifdef DBUS_TYPE_UNIX_FD
73Lisp_Object QCdbus_type_unix_fd; 73Lisp_Object QCdbus_type_unix_fd;
74#endif 74#endif
75Lisp_Object QCdbus_type_array, QCdbus_type_variant; 75static Lisp_Object QCdbus_type_array, QCdbus_type_variant;
76Lisp_Object QCdbus_type_struct, QCdbus_type_dict_entry; 76static Lisp_Object QCdbus_type_struct, QCdbus_type_dict_entry;
77 77
78/* Whether we are reading a D-Bus event. */ 78/* Whether we are reading a D-Bus event. */
79int xd_in_read_queued_messages = 0; 79static int xd_in_read_queued_messages = 0;
80 80
81 81
82/* We use "xd_" and "XD_" as prefix for all internal symbols, because 82/* We use "xd_" and "XD_" as prefix for all internal symbols, because
diff --git a/src/dired.c b/src/dired.c
index 186cfd1420b..60d7bc64974 100644
--- a/src/dired.c
+++ b/src/dired.c
@@ -79,14 +79,15 @@ extern struct direct *readdir (DIR *);
79#include "regex.h" 79#include "regex.h"
80#include "blockinput.h" 80#include "blockinput.h"
81 81
82Lisp_Object Qdirectory_files; 82static Lisp_Object Qdirectory_files;
83Lisp_Object Qdirectory_files_and_attributes; 83static Lisp_Object Qdirectory_files_and_attributes;
84Lisp_Object Qfile_name_completion; 84static Lisp_Object Qfile_name_completion;
85Lisp_Object Qfile_name_all_completions; 85static Lisp_Object Qfile_name_all_completions;
86Lisp_Object Qfile_attributes; 86static Lisp_Object Qfile_attributes;
87Lisp_Object Qfile_attributes_lessp; 87static Lisp_Object Qfile_attributes_lessp;
88 88
89static int scmp (const char *, const char *, int); 89static int scmp (const char *, const char *, int);
90static Lisp_Object Ffile_attributes (Lisp_Object, Lisp_Object);
90 91
91#ifdef WINDOWSNT 92#ifdef WINDOWSNT
92Lisp_Object 93Lisp_Object
@@ -380,7 +381,9 @@ which see. */)
380} 381}
381 382
382 383
383Lisp_Object file_name_completion (Lisp_Object file, Lisp_Object dirname, int all_flag, int ver_flag, Lisp_Object predicate); 384static Lisp_Object file_name_completion
385 (Lisp_Object file, Lisp_Object dirname, int all_flag, int ver_flag,
386 Lisp_Object predicate);
384 387
385DEFUN ("file-name-completion", Ffile_name_completion, Sfile_name_completion, 388DEFUN ("file-name-completion", Ffile_name_completion, Sfile_name_completion,
386 2, 3, 0, 389 2, 3, 0,
@@ -438,9 +441,9 @@ These are all file names in directory DIRECTORY which begin with FILE. */)
438} 441}
439 442
440static int file_name_completion_stat (Lisp_Object dirname, DIRENTRY *dp, struct stat *st_addr); 443static int file_name_completion_stat (Lisp_Object dirname, DIRENTRY *dp, struct stat *st_addr);
441Lisp_Object Qdefault_directory; 444static Lisp_Object Qdefault_directory;
442 445
443Lisp_Object 446static Lisp_Object
444file_name_completion (Lisp_Object file, Lisp_Object dirname, int all_flag, int ver_flag, Lisp_Object predicate) 447file_name_completion (Lisp_Object file, Lisp_Object dirname, int all_flag, int ver_flag, Lisp_Object predicate)
445{ 448{
446 DIR *d; 449 DIR *d;
diff --git a/src/dispextern.h b/src/dispextern.h
index fd474dc6ae5..840a27ebc62 100644
--- a/src/dispextern.h
+++ b/src/dispextern.h
@@ -1149,12 +1149,6 @@ extern int updated_area;
1149 1149
1150extern int display_completed; 1150extern int display_completed;
1151 1151
1152/* A temporary storage area, including a row of glyphs. Initialized
1153 in xdisp.c. Used for various purposes, as an example see
1154 get_overlay_arrow_glyph_row. */
1155
1156extern struct glyph_row scratch_glyph_row;
1157
1158 1152
1159 1153
1160/************************************************************************ 1154/************************************************************************
@@ -1739,9 +1733,12 @@ struct face_cache
1739 1733
1740/* Non-zero if FACE is suitable for displaying character CHAR. */ 1734/* Non-zero if FACE is suitable for displaying character CHAR. */
1741 1735
1736#define FACE_SUITABLE_FOR_ASCII_CHAR_P(FACE, CHAR) \
1737 ((FACE) == (FACE)->ascii_face)
1738
1742#define FACE_SUITABLE_FOR_CHAR_P(FACE, CHAR) \ 1739#define FACE_SUITABLE_FOR_CHAR_P(FACE, CHAR) \
1743 (ASCII_CHAR_P (CHAR) \ 1740 (ASCII_CHAR_P (CHAR) \
1744 ? (FACE) == (FACE)->ascii_face \ 1741 ? FACE_SUITABLE_FOR_ASCII_CHAR_P(FACE) \
1745 : face_suitable_for_char_p ((FACE), (CHAR))) 1742 : face_suitable_for_char_p ((FACE), (CHAR)))
1746 1743
1747/* Return the id of the realized face on frame F that is like the face 1744/* Return the id of the realized face on frame F that is like the face
@@ -2944,7 +2941,6 @@ enum tool_bar_item_image
2944 2941
2945extern void bidi_init_it (EMACS_INT, EMACS_INT, struct bidi_it *); 2942extern void bidi_init_it (EMACS_INT, EMACS_INT, struct bidi_it *);
2946extern void bidi_move_to_visually_next (struct bidi_it *); 2943extern void bidi_move_to_visually_next (struct bidi_it *);
2947extern void bidi_dump_cached_states (void);
2948extern void bidi_paragraph_init (bidi_dir_t, struct bidi_it *, int); 2944extern void bidi_paragraph_init (bidi_dir_t, struct bidi_it *, int);
2949extern int bidi_mirror_char (int); 2945extern int bidi_mirror_char (int);
2950 2946
@@ -2966,24 +2962,17 @@ int window_box_left (struct window *, int);
2966int window_box_left_offset (struct window *, int); 2962int window_box_left_offset (struct window *, int);
2967int window_box_right (struct window *, int); 2963int window_box_right (struct window *, int);
2968int window_box_right_offset (struct window *, int); 2964int window_box_right_offset (struct window *, int);
2969void window_box_edges (struct window *, int, int *, int *, int *, int *);
2970int estimate_mode_line_height (struct frame *, enum face_id); 2965int estimate_mode_line_height (struct frame *, enum face_id);
2971void pixel_to_glyph_coords (struct frame *, int, int, int *, int *, 2966void pixel_to_glyph_coords (struct frame *, int, int, int *, int *,
2972 NativeRectangle *, int); 2967 NativeRectangle *, int);
2973int glyph_to_pixel_coords (struct window *, int, int, int *, int *);
2974void remember_mouse_glyph (struct frame *, int, int, NativeRectangle *); 2968void remember_mouse_glyph (struct frame *, int, int, NativeRectangle *);
2975 2969
2976void mark_window_display_accurate (Lisp_Object, int); 2970void mark_window_display_accurate (Lisp_Object, int);
2977void redisplay_preserve_echo_area (int); 2971void redisplay_preserve_echo_area (int);
2978int set_cursor_from_row (struct window *, struct glyph_row *,
2979 struct glyph_matrix *, EMACS_INT, EMACS_INT,
2980 int, int);
2981void init_iterator (struct it *, struct window *, EMACS_INT, 2972void init_iterator (struct it *, struct window *, EMACS_INT,
2982 EMACS_INT, struct glyph_row *, enum face_id); 2973 EMACS_INT, struct glyph_row *, enum face_id);
2983void init_iterator_to_row_start (struct it *, struct window *, 2974void init_iterator_to_row_start (struct it *, struct window *,
2984 struct glyph_row *); 2975 struct glyph_row *);
2985int get_next_display_element (struct it *);
2986void set_iterator_to_next (struct it *, int);
2987void start_display (struct it *, struct window *, struct text_pos); 2976void start_display (struct it *, struct window *, struct text_pos);
2988void move_it_to (struct it *, EMACS_INT, int, int, int, int); 2977void move_it_to (struct it *, EMACS_INT, int, int, int, int);
2989void move_it_vertically (struct it *, int); 2978void move_it_vertically (struct it *, int);
@@ -2995,7 +2984,6 @@ void move_it_in_display_line (struct it *it,
2995 enum move_operation_enum op); 2984 enum move_operation_enum op);
2996int in_display_vector_p (struct it *); 2985int in_display_vector_p (struct it *);
2997int frame_mode_line_height (struct frame *); 2986int frame_mode_line_height (struct frame *);
2998void highlight_trailing_whitespace (struct frame *, struct glyph_row *);
2999extern Lisp_Object Qtool_bar; 2987extern Lisp_Object Qtool_bar;
3000extern int redisplaying_p; 2988extern int redisplaying_p;
3001extern int help_echo_showing_p; 2989extern int help_echo_showing_p;
@@ -3058,15 +3046,11 @@ extern int x_intersect_rectangles (XRectangle *, XRectangle *,
3058 XRectangle *); 3046 XRectangle *);
3059#endif /* HAVE_WINDOW_SYSTEM */ 3047#endif /* HAVE_WINDOW_SYSTEM */
3060 3048
3061extern void frame_to_window_pixel_xy (struct window *, int *, int *);
3062extern void note_mouse_highlight (struct frame *, int, int); 3049extern void note_mouse_highlight (struct frame *, int, int);
3063extern void x_clear_window_mouse_face (struct window *); 3050extern void x_clear_window_mouse_face (struct window *);
3064extern void cancel_mouse_face (struct frame *); 3051extern void cancel_mouse_face (struct frame *);
3065extern int clear_mouse_face (Mouse_HLInfo *); 3052extern int clear_mouse_face (Mouse_HLInfo *);
3066extern void show_mouse_face (Mouse_HLInfo *, enum draw_glyphs_face);
3067extern int cursor_in_mouse_face_p (struct window *w); 3053extern int cursor_in_mouse_face_p (struct window *w);
3068extern void draw_row_with_mouse_face (struct window *, int, struct glyph_row *,
3069 int, int, enum draw_glyphs_face);
3070extern void tty_draw_row_with_mouse_face (struct window *, struct glyph_row *, 3054extern void tty_draw_row_with_mouse_face (struct window *, struct glyph_row *,
3071 int, int, enum draw_glyphs_face); 3055 int, int, enum draw_glyphs_face);
3072 3056
@@ -3096,7 +3080,7 @@ extern void x_reference_bitmap (struct frame *, int);
3096extern int x_create_bitmap_from_data (struct frame *, char *, 3080extern int x_create_bitmap_from_data (struct frame *, char *,
3097 unsigned int, unsigned int); 3081 unsigned int, unsigned int);
3098extern int x_create_bitmap_from_file (struct frame *, Lisp_Object); 3082extern int x_create_bitmap_from_file (struct frame *, Lisp_Object);
3099#if defined (HAVE_XPM) && defined (HAVE_X_WINDOWS) 3083#if defined HAVE_XPM && defined HAVE_X_WINDOWS && !defined USE_GTK
3100extern int x_create_bitmap_from_xpm_data (struct frame *f, const char **bits); 3084extern int x_create_bitmap_from_xpm_data (struct frame *f, const char **bits);
3101#endif 3085#endif
3102#ifndef x_destroy_bitmap 3086#ifndef x_destroy_bitmap
@@ -3148,7 +3132,6 @@ unsigned long load_color (struct frame *, struct face *, Lisp_Object,
3148void unload_color (struct frame *, unsigned long); 3132void unload_color (struct frame *, unsigned long);
3149char *choose_face_font (struct frame *, Lisp_Object *, Lisp_Object, 3133char *choose_face_font (struct frame *, Lisp_Object *, Lisp_Object,
3150 int *); 3134 int *);
3151int ascii_face_of_lisp_face (struct frame *, int);
3152void prepare_face_for_display (struct frame *, struct face *); 3135void prepare_face_for_display (struct frame *, struct face *);
3153int xstrcasecmp (const char *, const char *); 3136int xstrcasecmp (const char *, const char *);
3154int lookup_named_face (struct frame *, Lisp_Object, int); 3137int lookup_named_face (struct frame *, Lisp_Object, int);
@@ -3174,7 +3157,6 @@ int face_at_string_position (struct window *w, Lisp_Object string,
3174int merge_faces (struct frame *, Lisp_Object, int, int); 3157int merge_faces (struct frame *, Lisp_Object, int, int);
3175int compute_char_face (struct frame *, int, Lisp_Object); 3158int compute_char_face (struct frame *, int, Lisp_Object);
3176void free_all_realized_faces (Lisp_Object); 3159void free_all_realized_faces (Lisp_Object);
3177void free_realized_face (struct frame *, struct face *);
3178extern Lisp_Object Qforeground_color, Qbackground_color; 3160extern Lisp_Object Qforeground_color, Qbackground_color;
3179extern Lisp_Object Qframe_set_background_mode; 3161extern Lisp_Object Qframe_set_background_mode;
3180extern char unspecified_fg[], unspecified_bg[]; 3162extern char unspecified_fg[], unspecified_bg[];
@@ -3190,7 +3172,6 @@ void gamma_correct (struct frame *, COLORREF *);
3190 3172
3191#ifdef HAVE_WINDOW_SYSTEM 3173#ifdef HAVE_WINDOW_SYSTEM
3192 3174
3193int x_screen_planes (struct frame *);
3194void x_implicitly_set_name (struct frame *, Lisp_Object, Lisp_Object); 3175void x_implicitly_set_name (struct frame *, Lisp_Object, Lisp_Object);
3195 3176
3196extern Lisp_Object tip_frame; 3177extern Lisp_Object tip_frame;
@@ -3248,11 +3229,9 @@ extern Lisp_Object marginal_area_string (struct window *, enum window_part,
3248 Lisp_Object *, 3229 Lisp_Object *,
3249 int *, int *, int *, int *); 3230 int *, int *, int *, int *);
3250extern void redraw_frame (struct frame *); 3231extern void redraw_frame (struct frame *);
3251extern void redraw_garbaged_frames (void);
3252extern void cancel_line (int, struct frame *); 3232extern void cancel_line (int, struct frame *);
3253extern void init_desired_glyphs (struct frame *); 3233extern void init_desired_glyphs (struct frame *);
3254extern int update_frame (struct frame *, int, int); 3234extern int update_frame (struct frame *, int, int);
3255extern int scrolling (struct frame *);
3256extern void bitch_at_user (void); 3235extern void bitch_at_user (void);
3257void adjust_glyphs (struct frame *); 3236void adjust_glyphs (struct frame *);
3258void free_glyphs (struct frame *); 3237void free_glyphs (struct frame *);
@@ -3268,7 +3247,6 @@ void rotate_matrix (struct glyph_matrix *, int, int, int);
3268void increment_matrix_positions (struct glyph_matrix *, 3247void increment_matrix_positions (struct glyph_matrix *,
3269 int, int, EMACS_INT, EMACS_INT); 3248 int, int, EMACS_INT, EMACS_INT);
3270void blank_row (struct window *, struct glyph_row *, int); 3249void blank_row (struct window *, struct glyph_row *, int);
3271void increment_row_positions (struct glyph_row *, EMACS_INT, EMACS_INT);
3272void enable_glyph_matrix_rows (struct glyph_matrix *, int, int, int); 3250void enable_glyph_matrix_rows (struct glyph_matrix *, int, int, int);
3273void clear_glyph_row (struct glyph_row *); 3251void clear_glyph_row (struct glyph_row *);
3274void prepare_desired_row (struct glyph_row *); 3252void prepare_desired_row (struct glyph_row *);
@@ -3302,10 +3280,7 @@ extern struct terminal *init_initial_terminal (void);
3302 3280
3303/* Defined in term.c */ 3281/* Defined in term.c */
3304 3282
3305extern void tty_set_terminal_modes (struct terminal *);
3306extern void tty_reset_terminal_modes (struct terminal *);
3307extern void tty_turn_off_insert (struct tty_display_info *); 3283extern void tty_turn_off_insert (struct tty_display_info *);
3308extern void tty_turn_off_highlight (struct tty_display_info *);
3309extern int string_cost (const char *); 3284extern int string_cost (const char *);
3310extern int per_line_cost (const char *); 3285extern int per_line_cost (const char *);
3311extern void calculate_costs (struct frame *); 3286extern void calculate_costs (struct frame *);
@@ -3313,7 +3288,6 @@ extern void produce_glyphs (struct it *);
3313extern void produce_special_glyphs (struct it *, enum display_element_type); 3288extern void produce_special_glyphs (struct it *, enum display_element_type);
3314extern int tty_capable_p (struct tty_display_info *, unsigned, unsigned long, unsigned long); 3289extern int tty_capable_p (struct tty_display_info *, unsigned, unsigned long, unsigned long);
3315extern void set_tty_color_mode (struct tty_display_info *, struct frame *); 3290extern void set_tty_color_mode (struct tty_display_info *, struct frame *);
3316extern struct terminal *get_tty_terminal (Lisp_Object, int);
3317extern struct terminal *get_named_tty (const char *); 3291extern struct terminal *get_named_tty (const char *);
3318EXFUN (Ftty_type, 1); 3292EXFUN (Ftty_type, 1);
3319extern void create_tty_output (struct frame *); 3293extern void create_tty_output (struct frame *);
@@ -3323,7 +3297,6 @@ extern struct terminal *init_tty (const char *, const char *, int);
3323/* Defined in scroll.c */ 3297/* Defined in scroll.c */
3324 3298
3325extern int scrolling_max_lines_saved (int, int, int *, int *, int *); 3299extern int scrolling_max_lines_saved (int, int, int *, int *, int *);
3326extern int scroll_cost (struct frame *, int, int, int);
3327extern void do_line_insertion_deletion_costs (struct frame *, const char *, 3300extern void do_line_insertion_deletion_costs (struct frame *, const char *,
3328 const char *, const char *, 3301 const char *, const char *,
3329 const char *, const char *, 3302 const char *, const char *,
diff --git a/src/dispnew.c b/src/dispnew.c
index 3a78845fa56..5b8eaf4fa34 100644
--- a/src/dispnew.c
+++ b/src/dispnew.c
@@ -121,11 +121,12 @@ static int required_matrix_width (struct window *);
121static void allocate_matrices_for_window_redisplay (struct window *); 121static void allocate_matrices_for_window_redisplay (struct window *);
122static int realloc_glyph_pool (struct glyph_pool *, struct dim); 122static int realloc_glyph_pool (struct glyph_pool *, struct dim);
123static void adjust_frame_glyphs (struct frame *); 123static void adjust_frame_glyphs (struct frame *);
124struct glyph_matrix *new_glyph_matrix (struct glyph_pool *); 124static struct glyph_matrix *new_glyph_matrix (struct glyph_pool *);
125static void free_glyph_matrix (struct glyph_matrix *); 125static void free_glyph_matrix (struct glyph_matrix *);
126static void adjust_glyph_matrix (struct window *, struct glyph_matrix *, 126static void adjust_glyph_matrix (struct window *, struct glyph_matrix *,
127 int, int, struct dim); 127 int, int, struct dim);
128static void change_frame_size_1 (struct frame *, int, int, int, int, int); 128static void change_frame_size_1 (struct frame *, int, int, int, int, int);
129static void increment_row_positions (struct glyph_row *, EMACS_INT, EMACS_INT);
129static void swap_glyph_pointers (struct glyph_row *, struct glyph_row *); 130static void swap_glyph_pointers (struct glyph_row *, struct glyph_row *);
130#if GLYPH_DEBUG 131#if GLYPH_DEBUG
131static int glyph_row_slice_p (struct glyph_row *, struct glyph_row *); 132static int glyph_row_slice_p (struct glyph_row *, struct glyph_row *);
@@ -163,6 +164,7 @@ static void mirror_line_dance (struct window *, int, int, int *, char *);
163static int update_window_tree (struct window *, int); 164static int update_window_tree (struct window *, int);
164static int update_window (struct window *, int); 165static int update_window (struct window *, int);
165static int update_frame_1 (struct frame *, int, int); 166static int update_frame_1 (struct frame *, int, int);
167static int scrolling (struct frame *);
166static void set_window_cursor_after_update (struct window *); 168static void set_window_cursor_after_update (struct window *);
167static void adjust_frame_glyphs_for_window_redisplay (struct frame *); 169static void adjust_frame_glyphs_for_window_redisplay (struct frame *);
168static void adjust_frame_glyphs_for_frame_redisplay (struct frame *); 170static void adjust_frame_glyphs_for_frame_redisplay (struct frame *);
@@ -212,7 +214,7 @@ struct frame *last_nonminibuf_frame;
212 214
213/* 1 means SIGWINCH happened when not safe. */ 215/* 1 means SIGWINCH happened when not safe. */
214 216
215int delayed_size_change; 217static int delayed_size_change;
216 218
217/* 1 means glyph initialization has been completed at startup. */ 219/* 1 means glyph initialization has been completed at startup. */
218 220
@@ -234,8 +236,8 @@ struct glyph space_glyph;
234/* Counts of allocated structures. These counts serve to diagnose 236/* Counts of allocated structures. These counts serve to diagnose
235 memory leaks and double frees. */ 237 memory leaks and double frees. */
236 238
237int glyph_matrix_count; 239static int glyph_matrix_count;
238int glyph_pool_count; 240static int glyph_pool_count;
239 241
240/* If non-null, the frame whose frame matrices are manipulated. If 242/* If non-null, the frame whose frame matrices are manipulated. If
241 null, window matrices are worked on. */ 243 null, window matrices are worked on. */
@@ -383,7 +385,7 @@ safe_bcopy (const char *from, char *to, int size)
383 member `pool' of the glyph matrix structure returned is set to 385 member `pool' of the glyph matrix structure returned is set to
384 POOL, the structure is otherwise zeroed. */ 386 POOL, the structure is otherwise zeroed. */
385 387
386struct glyph_matrix * 388static struct glyph_matrix *
387new_glyph_matrix (struct glyph_pool *pool) 389new_glyph_matrix (struct glyph_pool *pool)
388{ 390{
389 struct glyph_matrix *result; 391 struct glyph_matrix *result;
@@ -1021,7 +1023,7 @@ blank_row (struct window *w, struct glyph_row *row, int y)
1021 the used count of the text area is zero. Such rows display line 1023 the used count of the text area is zero. Such rows display line
1022 ends. */ 1024 ends. */
1023 1025
1024void 1026static void
1025increment_row_positions (struct glyph_row *row, 1027increment_row_positions (struct glyph_row *row,
1026 EMACS_INT delta, EMACS_INT delta_bytes) 1028 EMACS_INT delta, EMACS_INT delta_bytes)
1027{ 1029{
@@ -3200,21 +3202,6 @@ DEFUN ("redraw-display", Fredraw_display, Sredraw_display, 0, 0, "",
3200} 3202}
3201 3203
3202 3204
3203/* This is used when frame_garbaged is set. Call Fredraw_frame on all
3204 visible frames marked as garbaged. */
3205
3206void
3207redraw_garbaged_frames (void)
3208{
3209 Lisp_Object tail, frame;
3210
3211 FOR_EACH_FRAME (tail, frame)
3212 if (FRAME_VISIBLE_P (XFRAME (frame))
3213 && FRAME_GARBAGED_P (XFRAME (frame)))
3214 Fredraw_frame (frame);
3215}
3216
3217
3218 3205
3219/*********************************************************************** 3206/***********************************************************************
3220 Frame Update 3207 Frame Update
@@ -4818,7 +4805,7 @@ update_frame_1 (struct frame *f, int force_p, int inhibit_id_p)
4818 4805
4819/* Do line insertions/deletions on frame F for frame-based redisplay. */ 4806/* Do line insertions/deletions on frame F for frame-based redisplay. */
4820 4807
4821int 4808static int
4822scrolling (struct frame *frame) 4809scrolling (struct frame *frame)
4823{ 4810{
4824 int unchanged_at_top, unchanged_at_bottom; 4811 int unchanged_at_top, unchanged_at_bottom;
diff --git a/src/doc.c b/src/doc.c
index ed0d2323ed5..354aff84979 100644
--- a/src/doc.c
+++ b/src/doc.c
@@ -42,7 +42,9 @@ static char *get_doc_string_buffer;
42static int get_doc_string_buffer_size; 42static int get_doc_string_buffer_size;
43 43
44static unsigned char *read_bytecode_pointer; 44static unsigned char *read_bytecode_pointer;
45Lisp_Object Fsnarf_documentation (Lisp_Object); 45static Lisp_Object Fdocumentation_property (Lisp_Object, Lisp_Object,
46 Lisp_Object);
47static Lisp_Object Fsnarf_documentation (Lisp_Object);
46 48
47/* readchar in lread.c calls back here to fetch the next byte. 49/* readchar in lread.c calls back here to fetch the next byte.
48 If UNREADFLAG is 1, we unread a byte. */ 50 If UNREADFLAG is 1, we unread a byte. */
diff --git a/src/editfns.c b/src/editfns.c
index e754a074ba8..5e1dcce0275 100644
--- a/src/editfns.c
+++ b/src/editfns.c
@@ -107,8 +107,8 @@ static Lisp_Object subst_char_in_region_unwind_1 (Lisp_Object);
107static void transpose_markers (EMACS_INT, EMACS_INT, EMACS_INT, EMACS_INT, 107static void transpose_markers (EMACS_INT, EMACS_INT, EMACS_INT, EMACS_INT,
108 EMACS_INT, EMACS_INT, EMACS_INT, EMACS_INT); 108 EMACS_INT, EMACS_INT, EMACS_INT, EMACS_INT);
109 109
110Lisp_Object Qbuffer_access_fontify_functions; 110static Lisp_Object Qbuffer_access_fontify_functions;
111Lisp_Object Fuser_full_name (Lisp_Object); 111static Lisp_Object Fuser_full_name (Lisp_Object);
112 112
113/* Symbol for the text property used to mark fields. */ 113/* Symbol for the text property used to mark fields. */
114 114
@@ -116,7 +116,7 @@ Lisp_Object Qfield;
116 116
117/* A special value for Qfield properties. */ 117/* A special value for Qfield properties. */
118 118
119Lisp_Object Qboundary; 119static Lisp_Object Qboundary;
120 120
121 121
122void 122void
@@ -1403,15 +1403,6 @@ get_system_name (void)
1403 return ""; 1403 return "";
1404} 1404}
1405 1405
1406const char *
1407get_operating_system_release (void)
1408{
1409 if (STRINGP (Voperating_system_release))
1410 return SSDATA (Voperating_system_release);
1411 else
1412 return "";
1413}
1414
1415DEFUN ("emacs-pid", Femacs_pid, Semacs_pid, 0, 0, 0, 1406DEFUN ("emacs-pid", Femacs_pid, Semacs_pid, 0, 0, 0,
1416 doc: /* Return the process ID of Emacs, as an integer. */) 1407 doc: /* Return the process ID of Emacs, as an integer. */)
1417 (void) 1408 (void)
@@ -3802,7 +3793,7 @@ usage: (format STRING &rest OBJECTS) */)
3802 if (*format == 'c') 3793 if (*format == 'c')
3803 { 3794 {
3804 if (! ASCII_CHAR_P (XINT (args[n])) 3795 if (! ASCII_CHAR_P (XINT (args[n]))
3805 /* Note: No one can remeber why we have to treat 3796 /* Note: No one can remember why we have to treat
3806 the character 0 as a multibyte character here. 3797 the character 0 as a multibyte character here.
3807 But, until it causes a real problem, let's 3798 But, until it causes a real problem, let's
3808 don't change it. */ 3799 don't change it. */
@@ -3816,12 +3807,6 @@ usage: (format STRING &rest OBJECTS) */)
3816 args[n] = Fchar_to_string (args[n]); 3807 args[n] = Fchar_to_string (args[n]);
3817 thissize = SBYTES (args[n]); 3808 thissize = SBYTES (args[n]);
3818 } 3809 }
3819 else if (! ASCII_BYTE_P (XINT (args[n])) && multibyte)
3820 {
3821 args[n]
3822 = Fchar_to_string (Funibyte_char_to_multibyte (args[n]));
3823 thissize = SBYTES (args[n]);
3824 }
3825 } 3810 }
3826 } 3811 }
3827 else if (FLOATP (args[n]) && *format != 's') 3812 else if (FLOATP (args[n]) && *format != 's')
diff --git a/src/emacs.c b/src/emacs.c
index 6bdd2550ed1..cccd07417e1 100644
--- a/src/emacs.c
+++ b/src/emacs.c
@@ -127,14 +127,14 @@ int initialized;
127#ifdef DOUG_LEA_MALLOC 127#ifdef DOUG_LEA_MALLOC
128/* Preserves a pointer to the memory allocated that copies that 128/* Preserves a pointer to the memory allocated that copies that
129 static data inside glibc's malloc. */ 129 static data inside glibc's malloc. */
130void *malloc_state_ptr; 130static void *malloc_state_ptr;
131/* From glibc, a routine that returns a copy of the malloc internal state. */ 131/* From glibc, a routine that returns a copy of the malloc internal state. */
132extern void *malloc_get_state (void); 132extern void *malloc_get_state (void);
133/* From glibc, a routine that overwrites the malloc internal state. */ 133/* From glibc, a routine that overwrites the malloc internal state. */
134extern int malloc_set_state (void*); 134extern int malloc_set_state (void*);
135/* Non-zero if the MALLOC_CHECK_ environment variable was set while 135/* Non-zero if the MALLOC_CHECK_ environment variable was set while
136 dumping. Used to work around a bug in glibc's malloc. */ 136 dumping. Used to work around a bug in glibc's malloc. */
137int malloc_using_checking; 137static int malloc_using_checking;
138#endif 138#endif
139 139
140Lisp_Object Qfile_name_handler_alist; 140Lisp_Object Qfile_name_handler_alist;
@@ -186,7 +186,7 @@ char **initial_argv;
186int initial_argc; 186int initial_argc;
187 187
188static void sort_args (int argc, char **argv); 188static void sort_args (int argc, char **argv);
189void syms_of_emacs (void); 189static void syms_of_emacs (void);
190 190
191/* MSVC needs each string be shorter than 2048 bytes, so the usage 191/* MSVC needs each string be shorter than 2048 bytes, so the usage
192 strings below are split to not overflow this limit. */ 192 strings below are split to not overflow this limit. */
@@ -288,7 +288,7 @@ section of the Emacs manual or the file BUGS.\n"
288 288
289 289
290/* Signal code for the fatal signal that was received. */ 290/* Signal code for the fatal signal that was received. */
291int fatal_error_code; 291static int fatal_error_code;
292 292
293/* Nonzero if handling a fatal error already. */ 293/* Nonzero if handling a fatal error already. */
294int fatal_error_in_progress; 294int fatal_error_in_progress;
@@ -296,7 +296,7 @@ int fatal_error_in_progress;
296/* If non-null, call this function from fatal_error_signal before 296/* If non-null, call this function from fatal_error_signal before
297 committing suicide. */ 297 committing suicide. */
298 298
299void (*fatal_error_signal_hook) (void); 299static void (*fatal_error_signal_hook) (void);
300 300
301#ifdef FORWARD_SIGNAL_TO_MAIN_THREAD 301#ifdef FORWARD_SIGNAL_TO_MAIN_THREAD
302/* When compiled with GTK and running under Gnome, 302/* When compiled with GTK and running under Gnome,
@@ -308,6 +308,9 @@ pthread_t main_thread;
308 308
309 309
310/* Handle bus errors, invalid instruction, etc. */ 310/* Handle bus errors, invalid instruction, etc. */
311#ifndef FLOAT_CATCH_SIGILL
312static
313#endif
311void 314void
312fatal_error_signal (int sig) 315fatal_error_signal (int sig)
313{ 316{
@@ -549,7 +552,8 @@ static char dump_tz[] = "UtC0";
549 552
550/* Define a dummy function F. Declare F too, to pacify gcc 553/* Define a dummy function F. Declare F too, to pacify gcc
551 -Wmissing-prototypes. */ 554 -Wmissing-prototypes. */
552#define DEFINE_DUMMY_FUNCTION(f) void f (void); void f (void) {} 555#define DEFINE_DUMMY_FUNCTION(f) \
556 void f (void) EXTERNALLY_VISIBLE; void f (void) {}
553 557
554#ifndef GCC_CTORS_IN_LIBC 558#ifndef GCC_CTORS_IN_LIBC
555DEFINE_DUMMY_FUNCTION (__do_global_ctors) 559DEFINE_DUMMY_FUNCTION (__do_global_ctors)
@@ -557,9 +561,9 @@ DEFINE_DUMMY_FUNCTION (__do_global_ctors_aux)
557DEFINE_DUMMY_FUNCTION (__do_global_dtors) 561DEFINE_DUMMY_FUNCTION (__do_global_dtors)
558/* GNU/Linux has a bug in its library; avoid an error. */ 562/* GNU/Linux has a bug in its library; avoid an error. */
559#ifndef GNU_LINUX 563#ifndef GNU_LINUX
560char * __CTOR_LIST__[2] = { (char *) (-1), 0 }; 564char * __CTOR_LIST__[2] EXTERNALLY_VISIBLE = { (char *) (-1), 0 };
561#endif 565#endif
562char * __DTOR_LIST__[2] = { (char *) (-1), 0 }; 566char * __DTOR_LIST__[2] EXTERNALLY_VISIBLE = { (char *) (-1), 0 };
563#endif /* GCC_CTORS_IN_LIBC */ 567#endif /* GCC_CTORS_IN_LIBC */
564DEFINE_DUMMY_FUNCTION (__main) 568DEFINE_DUMMY_FUNCTION (__main)
565#endif /* __GNUC__ */ 569#endif /* __GNUC__ */
@@ -1700,7 +1704,7 @@ struct standard_args
1700 int nargs; 1704 int nargs;
1701}; 1705};
1702 1706
1703const struct standard_args standard_args[] = 1707static const struct standard_args standard_args[] =
1704{ 1708{
1705 { "-version", "--version", 150, 0 }, 1709 { "-version", "--version", 150, 0 },
1706 { "-chdir", "--chdir", 130, 1 }, 1710 { "-chdir", "--chdir", 130, 1 },
diff --git a/src/eval.c b/src/eval.c
index 0f9e012b823..c068f5f3fbf 100644
--- a/src/eval.c
+++ b/src/eval.c
@@ -56,9 +56,24 @@ struct backtrace
56 char debug_on_exit : 1; 56 char debug_on_exit : 1;
57}; 57};
58 58
59struct backtrace *backtrace_list; 59static struct backtrace *backtrace_list;
60
61#if !BYTE_MARK_STACK
62static
63#endif
60struct catchtag *catchlist; 64struct catchtag *catchlist;
61 65
66/* Chain of condition handlers currently in effect.
67 The elements of this chain are contained in the stack frames
68 of Fcondition_case and internal_condition_case.
69 When an error is signaled (by calling Fsignal, below),
70 this chain is searched for an element that applies. */
71
72#if !BYTE_MARK_STACK
73static
74#endif
75struct handler *handlerlist;
76
62#ifdef DEBUG_GCPRO 77#ifdef DEBUG_GCPRO
63/* Count levels of GCPRO to detect failure to UNGCPRO. */ 78/* Count levels of GCPRO to detect failure to UNGCPRO. */
64int gcpro_level; 79int gcpro_level;
@@ -66,12 +81,13 @@ int gcpro_level;
66 81
67Lisp_Object Qautoload, Qmacro, Qexit, Qinteractive, Qcommandp, Qdefun; 82Lisp_Object Qautoload, Qmacro, Qexit, Qinteractive, Qcommandp, Qdefun;
68Lisp_Object Qinhibit_quit; 83Lisp_Object Qinhibit_quit;
69Lisp_Object Qand_rest, Qand_optional; 84Lisp_Object Qand_rest;
70Lisp_Object Qdebug_on_error; 85static Lisp_Object Qand_optional;
71Lisp_Object Qdeclare; 86static Lisp_Object Qdebug_on_error;
87static Lisp_Object Qdeclare;
72Lisp_Object Qinternal_interpreter_environment, Qclosure; 88Lisp_Object Qinternal_interpreter_environment, Qclosure;
73 89
74Lisp_Object Qdebug; 90static Lisp_Object Qdebug;
75 91
76/* This holds either the symbol `run-hooks' or nil. 92/* This holds either the symbol `run-hooks' or nil.
77 It is nil at an early stage of startup, and when Emacs 93 It is nil at an early stage of startup, and when Emacs
@@ -100,7 +116,7 @@ struct specbinding *specpdl_ptr;
100 116
101/* Depth in Lisp evaluations and function calls. */ 117/* Depth in Lisp evaluations and function calls. */
102 118
103EMACS_INT lisp_eval_depth; 119static EMACS_INT lisp_eval_depth;
104 120
105/* The value of num_nonmacro_input_events as of the last time we 121/* The value of num_nonmacro_input_events as of the last time we
106 started to enter the debugger. If we decide to enter the debugger 122 started to enter the debugger. If we decide to enter the debugger
@@ -109,7 +125,7 @@ EMACS_INT lisp_eval_depth;
109 signal the error instead of entering an infinite loop of debugger 125 signal the error instead of entering an infinite loop of debugger
110 invocations. */ 126 invocations. */
111 127
112int when_entered_debugger; 128static int when_entered_debugger;
113 129
114/* The function from which the last `signal' was called. Set in 130/* The function from which the last `signal' was called. Set in
115 Fsignal. */ 131 Fsignal. */
@@ -126,6 +142,7 @@ static Lisp_Object funcall_lambda (Lisp_Object, size_t, Lisp_Object *);
126static void unwind_to_catch (struct catchtag *, Lisp_Object) NO_RETURN; 142static void unwind_to_catch (struct catchtag *, Lisp_Object) NO_RETURN;
127static int interactive_p (int); 143static int interactive_p (int);
128static Lisp_Object apply_lambda (Lisp_Object fun, Lisp_Object args); 144static Lisp_Object apply_lambda (Lisp_Object fun, Lisp_Object args);
145static Lisp_Object Ffetch_bytecode (Lisp_Object);
129 146
130void 147void
131init_eval_once (void) 148init_eval_once (void)
@@ -1343,14 +1360,6 @@ usage: (unwind-protect BODYFORM UNWINDFORMS...) */)
1343 return unbind_to (count, val); 1360 return unbind_to (count, val);
1344} 1361}
1345 1362
1346/* Chain of condition handlers currently in effect.
1347 The elements of this chain are contained in the stack frames
1348 of Fcondition_case and internal_condition_case.
1349 When an error is signaled (by calling Fsignal, below),
1350 this chain is searched for an element that applies. */
1351
1352struct handler *handlerlist;
1353
1354DEFUN ("condition-case", Fcondition_case, Scondition_case, 2, UNEVALLED, 0, 1363DEFUN ("condition-case", Fcondition_case, Scondition_case, 2, UNEVALLED, 0,
1355 doc: /* Regain control when an error is signaled. 1364 doc: /* Regain control when an error is signaled.
1356Executes BODYFORM and returns its value if no error happens. 1365Executes BODYFORM and returns its value if no error happens.
@@ -3627,6 +3636,7 @@ If NFRAMES is more than the number of frames, the value is nil. */)
3627} 3636}
3628 3637
3629 3638
3639#if BYTE_MARK_STACK
3630void 3640void
3631mark_backtrace (void) 3641mark_backtrace (void)
3632{ 3642{
@@ -3646,8 +3656,7 @@ mark_backtrace (void)
3646 mark_object (backlist->args[i]); 3656 mark_object (backlist->args[i]);
3647 } 3657 }
3648} 3658}
3649 3659#endif
3650EXFUN (Funintern, 2);
3651 3660
3652void 3661void
3653syms_of_eval (void) 3662syms_of_eval (void)
diff --git a/src/fileio.c b/src/fileio.c
index 7e2d888b227..dcba6b6c0ae 100644
--- a/src/fileio.c
+++ b/src/fileio.c
@@ -88,64 +88,66 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
88#endif 88#endif
89 89
90/* Nonzero during writing of auto-save files */ 90/* Nonzero during writing of auto-save files */
91int auto_saving; 91static int auto_saving;
92 92
93/* Set by auto_save_1 to mode of original file so Fwrite_region will create 93/* Set by auto_save_1 to mode of original file so Fwrite_region will create
94 a new file with the same mode as the original */ 94 a new file with the same mode as the original */
95int auto_save_mode_bits; 95static int auto_save_mode_bits;
96 96
97/* Set by auto_save_1 if an error occurred during the last auto-save. */ 97/* Set by auto_save_1 if an error occurred during the last auto-save. */
98int auto_save_error_occurred; 98static int auto_save_error_occurred;
99 99
100/* The symbol bound to coding-system-for-read when 100/* The symbol bound to coding-system-for-read when
101 insert-file-contents is called for recovering a file. This is not 101 insert-file-contents is called for recovering a file. This is not
102 an actual coding system name, but just an indicator to tell 102 an actual coding system name, but just an indicator to tell
103 insert-file-contents to use `emacs-mule' with a special flag for 103 insert-file-contents to use `emacs-mule' with a special flag for
104 auto saving and recovering a file. */ 104 auto saving and recovering a file. */
105Lisp_Object Qauto_save_coding; 105static Lisp_Object Qauto_save_coding;
106 106
107/* Property name of a file name handler, 107/* Property name of a file name handler,
108 which gives a list of operations it handles.. */ 108 which gives a list of operations it handles.. */
109Lisp_Object Qoperations; 109static Lisp_Object Qoperations;
110 110
111/* Lisp functions for translating file formats */ 111/* Lisp functions for translating file formats */
112Lisp_Object Qformat_decode, Qformat_annotate_function; 112static Lisp_Object Qformat_decode, Qformat_annotate_function;
113 113
114/* Lisp function for setting buffer-file-coding-system and the 114/* Lisp function for setting buffer-file-coding-system and the
115 multibyteness of the current buffer after inserting a file. */ 115 multibyteness of the current buffer after inserting a file. */
116Lisp_Object Qafter_insert_file_set_coding; 116static Lisp_Object Qafter_insert_file_set_coding;
117 117
118Lisp_Object Qwrite_region_annotate_functions; 118static Lisp_Object Qwrite_region_annotate_functions;
119/* Each time an annotation function changes the buffer, the new buffer 119/* Each time an annotation function changes the buffer, the new buffer
120 is added here. */ 120 is added here. */
121Lisp_Object Vwrite_region_annotation_buffers; 121static Lisp_Object Vwrite_region_annotation_buffers;
122 122
123#ifdef HAVE_FSYNC 123#ifdef HAVE_FSYNC
124#endif 124#endif
125 125
126Lisp_Object Qdelete_by_moving_to_trash; 126static Lisp_Object Qdelete_by_moving_to_trash;
127 127
128/* Lisp function for moving files to trash. */ 128/* Lisp function for moving files to trash. */
129Lisp_Object Qmove_file_to_trash; 129static Lisp_Object Qmove_file_to_trash;
130 130
131/* Lisp function for recursively copying directories. */ 131/* Lisp function for recursively copying directories. */
132Lisp_Object Qcopy_directory; 132static Lisp_Object Qcopy_directory;
133 133
134/* Lisp function for recursively deleting directories. */ 134/* Lisp function for recursively deleting directories. */
135Lisp_Object Qdelete_directory; 135static Lisp_Object Qdelete_directory;
136 136
137#ifdef WINDOWSNT 137#ifdef WINDOWSNT
138#endif 138#endif
139 139
140Lisp_Object Qfile_error, Qfile_already_exists, Qfile_date_error; 140Lisp_Object Qfile_error;
141Lisp_Object Qexcl; 141static Lisp_Object Qfile_already_exists, Qfile_date_error;
142static Lisp_Object Qexcl;
142Lisp_Object Qfile_name_history; 143Lisp_Object Qfile_name_history;
143 144
144Lisp_Object Qcar_less_than_car; 145static Lisp_Object Qcar_less_than_car;
145 146
147static Lisp_Object Fmake_symbolic_link (Lisp_Object, Lisp_Object, Lisp_Object);
146static int a_write (int, Lisp_Object, EMACS_INT, EMACS_INT, 148static int a_write (int, Lisp_Object, EMACS_INT, EMACS_INT,
147 Lisp_Object *, struct coding_system *); 149 Lisp_Object *, struct coding_system *);
148static int e_write (int, Lisp_Object, EMACS_INT, EMACS_INT, 150static int e_write (int, Lisp_Object, EMACS_INT, EMACS_INT,
149 struct coding_system *); 151 struct coding_system *);
150 152
151 153
@@ -205,42 +207,43 @@ restore_point_unwind (Lisp_Object location)
205} 207}
206 208
207 209
208Lisp_Object Qexpand_file_name; 210static Lisp_Object Qexpand_file_name;
209Lisp_Object Qsubstitute_in_file_name; 211static Lisp_Object Qsubstitute_in_file_name;
210Lisp_Object Qdirectory_file_name; 212static Lisp_Object Qdirectory_file_name;
211Lisp_Object Qfile_name_directory; 213static Lisp_Object Qfile_name_directory;
212Lisp_Object Qfile_name_nondirectory; 214static Lisp_Object Qfile_name_nondirectory;
213Lisp_Object Qunhandled_file_name_directory; 215static Lisp_Object Qunhandled_file_name_directory;
214Lisp_Object Qfile_name_as_directory; 216static Lisp_Object Qfile_name_as_directory;
215Lisp_Object Qcopy_file; 217static Lisp_Object Qcopy_file;
216Lisp_Object Qmake_directory_internal; 218static Lisp_Object Qmake_directory_internal;
217Lisp_Object Qmake_directory; 219static Lisp_Object Qmake_directory;
218Lisp_Object Qdelete_directory_internal; 220static Lisp_Object Qdelete_directory_internal;
219Lisp_Object Qdelete_file; 221Lisp_Object Qdelete_file;
220Lisp_Object Qrename_file; 222static Lisp_Object Qrename_file;
221Lisp_Object Qadd_name_to_file; 223static Lisp_Object Qadd_name_to_file;
222Lisp_Object Qmake_symbolic_link; 224static Lisp_Object Qmake_symbolic_link;
223Lisp_Object Qfile_exists_p; 225Lisp_Object Qfile_exists_p;
224Lisp_Object Qfile_executable_p; 226static Lisp_Object Qfile_executable_p;
225Lisp_Object Qfile_readable_p; 227static Lisp_Object Qfile_readable_p;
226Lisp_Object Qfile_writable_p; 228static Lisp_Object Qfile_writable_p;
227Lisp_Object Qfile_symlink_p; 229static Lisp_Object Qfile_symlink_p;
228Lisp_Object Qaccess_file; 230static Lisp_Object Qaccess_file;
229Lisp_Object Qfile_directory_p; 231Lisp_Object Qfile_directory_p;
230Lisp_Object Qfile_regular_p; 232static Lisp_Object Qfile_regular_p;
231Lisp_Object Qfile_accessible_directory_p; 233static Lisp_Object Qfile_accessible_directory_p;
232Lisp_Object Qfile_modes; 234static Lisp_Object Qfile_modes;
233Lisp_Object Qset_file_modes; 235static Lisp_Object Qset_file_modes;
234Lisp_Object Qset_file_times; 236static Lisp_Object Qset_file_times;
235Lisp_Object Qfile_selinux_context; 237static Lisp_Object Qfile_selinux_context;
236Lisp_Object Qset_file_selinux_context; 238static Lisp_Object Qset_file_selinux_context;
237Lisp_Object Qfile_newer_than_file_p; 239static Lisp_Object Qfile_newer_than_file_p;
238Lisp_Object Qinsert_file_contents; 240Lisp_Object Qinsert_file_contents;
239Lisp_Object Qwrite_region; 241Lisp_Object Qwrite_region;
240Lisp_Object Qverify_visited_file_modtime; 242static Lisp_Object Qverify_visited_file_modtime;
241Lisp_Object Qset_visited_file_modtime; 243static Lisp_Object Qset_visited_file_modtime;
242 244
243DEFUN ("find-file-name-handler", Ffind_file_name_handler, Sfind_file_name_handler, 2, 2, 0, 245DEFUN ("find-file-name-handler", Ffind_file_name_handler,
246 Sfind_file_name_handler, 2, 2, 0,
244 doc: /* Return FILENAME's handler function for OPERATION, if it has one. 247 doc: /* Return FILENAME's handler function for OPERATION, if it has one.
245Otherwise, return nil. 248Otherwise, return nil.
246A file name is handled if one of the regular expressions in 249A file name is handled if one of the regular expressions in
@@ -2633,7 +2636,8 @@ See `file-symlink-p' to distinguish symlinks. */)
2633 return S_ISDIR (st.st_mode) ? Qt : Qnil; 2636 return S_ISDIR (st.st_mode) ? Qt : Qnil;
2634} 2637}
2635 2638
2636DEFUN ("file-accessible-directory-p", Ffile_accessible_directory_p, Sfile_accessible_directory_p, 1, 1, 0, 2639DEFUN ("file-accessible-directory-p", Ffile_accessible_directory_p,
2640 Sfile_accessible_directory_p, 1, 1, 0,
2637 doc: /* Return t if file FILENAME names a directory you can open. 2641 doc: /* Return t if file FILENAME names a directory you can open.
2638For the value to be t, FILENAME must specify the name of a directory as a file, 2642For the value to be t, FILENAME must specify the name of a directory as a file,
2639and the directory must allow you to open files in it. In order to use a 2643and the directory must allow you to open files in it. In order to use a
@@ -3800,7 +3804,7 @@ variable `last-coding-system-used' to the coding system actually used. */)
3800 /* For a special file, all we can do is guess. */ 3804 /* For a special file, all we can do is guess. */
3801 total = READ_BUF_SIZE; 3805 total = READ_BUF_SIZE;
3802 3806
3803 if (NILP (visit) && inserted > 0) 3807 if (NILP (visit) && total > 0)
3804 { 3808 {
3805#ifdef CLASH_DETECTION 3809#ifdef CLASH_DETECTION
3806 if (!NILP (BVAR (current_buffer, file_truename)) 3810 if (!NILP (BVAR (current_buffer, file_truename))
diff --git a/src/fns.c b/src/fns.c
index 09ce8c1b597..d3009775b81 100644
--- a/src/fns.c
+++ b/src/fns.c
@@ -49,11 +49,12 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
49#define NULL ((POINTER_TYPE *)0) 49#define NULL ((POINTER_TYPE *)0)
50#endif 50#endif
51 51
52Lisp_Object Qstring_lessp, Qprovide, Qrequire; 52Lisp_Object Qstring_lessp;
53Lisp_Object Qyes_or_no_p_history; 53static Lisp_Object Qprovide, Qrequire;
54static Lisp_Object Qyes_or_no_p_history;
54Lisp_Object Qcursor_in_echo_area; 55Lisp_Object Qcursor_in_echo_area;
55Lisp_Object Qwidget_type; 56static Lisp_Object Qwidget_type;
56Lisp_Object Qcodeset, Qdays, Qmonths, Qpaper; 57static Lisp_Object Qcodeset, Qdays, Qmonths, Qpaper;
57 58
58static int internal_equal (Lisp_Object , Lisp_Object, int, int); 59static int internal_equal (Lisp_Object , Lisp_Object, int, int);
59 60
@@ -2541,7 +2542,7 @@ advisable. */)
2541 return ret; 2542 return ret;
2542} 2543}
2543 2544
2544Lisp_Object Qsubfeatures; 2545static Lisp_Object Qsubfeatures;
2545 2546
2546DEFUN ("featurep", Ffeaturep, Sfeaturep, 1, 2, 0, 2547DEFUN ("featurep", Ffeaturep, Sfeaturep, 1, 2, 0,
2547 doc: /* Return t if FEATURE is present in this Emacs. 2548 doc: /* Return t if FEATURE is present in this Emacs.
@@ -3350,13 +3351,14 @@ base64_decode_1 (const char *from, char *to, EMACS_INT length,
3350 3351
3351/* The list of all weak hash tables. Don't staticpro this one. */ 3352/* The list of all weak hash tables. Don't staticpro this one. */
3352 3353
3353struct Lisp_Hash_Table *weak_hash_tables; 3354static struct Lisp_Hash_Table *weak_hash_tables;
3354 3355
3355/* Various symbols. */ 3356/* Various symbols. */
3356 3357
3357Lisp_Object Qhash_table_p, Qeq, Qeql, Qequal, Qkey, Qvalue; 3358static Lisp_Object Qhash_table_p, Qkey, Qvalue;
3359Lisp_Object Qeq, Qeql, Qequal;
3358Lisp_Object QCtest, QCsize, QCrehash_size, QCrehash_threshold, QCweakness; 3360Lisp_Object QCtest, QCsize, QCrehash_size, QCrehash_threshold, QCweakness;
3359Lisp_Object Qhash_table_test, Qkey_or_value, Qkey_and_value; 3361static Lisp_Object Qhash_table_test, Qkey_or_value, Qkey_and_value;
3360 3362
3361/* Function prototypes. */ 3363/* Function prototypes. */
3362 3364
diff --git a/src/font.c b/src/font.c
index e01f67a95f6..7fe0815d80e 100644
--- a/src/font.c
+++ b/src/font.c
@@ -125,14 +125,16 @@ Lisp_Object QCfoundry;
125static Lisp_Object QCadstyle, QCregistry; 125static Lisp_Object QCadstyle, QCregistry;
126/* Symbols representing keys of font extra info. */ 126/* Symbols representing keys of font extra info. */
127Lisp_Object QCspacing, QCdpi, QCscalable, QCotf, QClang, QCscript, QCavgwidth; 127Lisp_Object QCspacing, QCdpi, QCscalable, QCotf, QClang, QCscript, QCavgwidth;
128Lisp_Object QCantialias, QCfont_entity, QCfc_unknown_spec; 128Lisp_Object QCantialias, QCfont_entity;
129static Lisp_Object QCfc_unknown_spec;
129/* Symbols representing values of font spacing property. */ 130/* Symbols representing values of font spacing property. */
130Lisp_Object Qc, Qm, Qp, Qd; 131static Lisp_Object Qc, Qm, Qd;
132Lisp_Object Qp;
131/* Special ADSTYLE properties to avoid fonts used for Latin 133/* Special ADSTYLE properties to avoid fonts used for Latin
132 characters; used in xfont.c and ftfont.c. */ 134 characters; used in xfont.c and ftfont.c. */
133Lisp_Object Qja, Qko; 135Lisp_Object Qja, Qko;
134 136
135Lisp_Object QCuser_spec; 137static Lisp_Object QCuser_spec;
136 138
137/* Alist of font registry symbol and the corresponding charsets 139/* Alist of font registry symbol and the corresponding charsets
138 information. The information is retrieved from 140 information. The information is retrieved from
@@ -2725,7 +2727,7 @@ font_list_entities (Lisp_Object frame, Lisp_Object spec)
2725 val = null_vector; 2727 val = null_vector;
2726 else 2728 else
2727 val = Fvconcat (1, &val); 2729 val = Fvconcat (1, &val);
2728 copy = Fcopy_font_spec (scratch_font_spec); 2730 copy = copy_font_spec (scratch_font_spec);
2729 ASET (copy, FONT_TYPE_INDEX, driver_list->driver->type); 2731 ASET (copy, FONT_TYPE_INDEX, driver_list->driver->type);
2730 XSETCDR (cache, Fcons (Fcons (copy, val), XCDR (cache))); 2732 XSETCDR (cache, Fcons (Fcons (copy, val), XCDR (cache)));
2731 } 2733 }
@@ -2753,7 +2755,7 @@ font_matching_entity (FRAME_PTR f, Lisp_Object *attrs, Lisp_Object spec)
2753 struct font_driver_list *driver_list = f->font_driver_list; 2755 struct font_driver_list *driver_list = f->font_driver_list;
2754 Lisp_Object ftype, size, entity; 2756 Lisp_Object ftype, size, entity;
2755 Lisp_Object frame; 2757 Lisp_Object frame;
2756 Lisp_Object work = Fcopy_font_spec (spec); 2758 Lisp_Object work = copy_font_spec (spec);
2757 2759
2758 XSETFRAME (frame, f); 2760 XSETFRAME (frame, f);
2759 ftype = AREF (spec, FONT_TYPE_INDEX); 2761 ftype = AREF (spec, FONT_TYPE_INDEX);
@@ -2780,7 +2782,7 @@ font_matching_entity (FRAME_PTR f, Lisp_Object *attrs, Lisp_Object spec)
2780 else 2782 else
2781 { 2783 {
2782 entity = driver_list->driver->match (frame, work); 2784 entity = driver_list->driver->match (frame, work);
2783 copy = Fcopy_font_spec (work); 2785 copy = copy_font_spec (work);
2784 ASET (copy, FONT_TYPE_INDEX, driver_list->driver->type); 2786 ASET (copy, FONT_TYPE_INDEX, driver_list->driver->type);
2785 XSETCDR (cache, Fcons (Fcons (copy, entity), XCDR (cache))); 2787 XSETCDR (cache, Fcons (Fcons (copy, entity), XCDR (cache)));
2786 } 2788 }
@@ -2870,7 +2872,7 @@ font_open_entity (FRAME_PTR f, Lisp_Object entity, int pixel_size)
2870 2872
2871/* Close FONT_OBJECT that is opened on frame F. */ 2873/* Close FONT_OBJECT that is opened on frame F. */
2872 2874
2873void 2875static void
2874font_close_object (FRAME_PTR f, Lisp_Object font_object) 2876font_close_object (FRAME_PTR f, Lisp_Object font_object)
2875{ 2877{
2876 struct font *font = XFONT_OBJECT (font_object); 2878 struct font *font = XFONT_OBJECT (font_object);
@@ -2974,7 +2976,7 @@ font_clear_prop (Lisp_Object *attrs, enum font_property_index prop)
2974 2976
2975 if (! NILP (Ffont_get (font, QCname))) 2977 if (! NILP (Ffont_get (font, QCname)))
2976 { 2978 {
2977 font = Fcopy_font_spec (font); 2979 font = copy_font_spec (font);
2978 font_put_extra (font, QCname, Qnil); 2980 font_put_extra (font, QCname, Qnil);
2979 } 2981 }
2980 2982
@@ -2985,7 +2987,7 @@ font_clear_prop (Lisp_Object *attrs, enum font_property_index prop)
2985 && prop != FONT_SIZE_INDEX) 2987 && prop != FONT_SIZE_INDEX)
2986 return; 2988 return;
2987 if (EQ (font, attrs[LFACE_FONT_INDEX])) 2989 if (EQ (font, attrs[LFACE_FONT_INDEX]))
2988 font = Fcopy_font_spec (font); 2990 font = copy_font_spec (font);
2989 ASET (font, prop, Qnil); 2991 ASET (font, prop, Qnil);
2990 if (prop == FONT_FAMILY_INDEX || prop == FONT_FOUNDRY_INDEX) 2992 if (prop == FONT_FAMILY_INDEX || prop == FONT_FOUNDRY_INDEX)
2991 { 2993 {
@@ -3096,7 +3098,7 @@ font_find_for_lface (FRAME_PTR f, Lisp_Object *attrs, Lisp_Object spec, int c)
3096 return Qnil; 3098 return Qnil;
3097 } 3099 }
3098 3100
3099 work = Fcopy_font_spec (spec); 3101 work = copy_font_spec (spec);
3100 ASET (work, FONT_TYPE_INDEX, AREF (spec, FONT_TYPE_INDEX)); 3102 ASET (work, FONT_TYPE_INDEX, AREF (spec, FONT_TYPE_INDEX));
3101 XSETFRAME (frame, f); 3103 XSETFRAME (frame, f);
3102 pixel_size = font_pixel_size (f, spec); 3104 pixel_size = font_pixel_size (f, spec);
@@ -3866,9 +3868,9 @@ usage: (font-spec ARGS...) */)
3866 return spec; 3868 return spec;
3867} 3869}
3868 3870
3869DEFUN ("copy-font-spec", Fcopy_font_spec, Scopy_font_spec, 1, 1, 0, 3871/* Return a copy of FONT as a font-spec. */
3870 doc: /* Return a copy of FONT as a font-spec. */) 3872Lisp_Object
3871 (Lisp_Object font) 3873copy_font_spec (Lisp_Object font)
3872{ 3874{
3873 Lisp_Object new_spec, tail, prev, extra; 3875 Lisp_Object new_spec, tail, prev, extra;
3874 int i; 3876 int i;
@@ -3892,18 +3894,18 @@ DEFUN ("copy-font-spec", Fcopy_font_spec, Scopy_font_spec, 1, 1, 0,
3892 return new_spec; 3894 return new_spec;
3893} 3895}
3894 3896
3895DEFUN ("merge-font-spec", Fmerge_font_spec, Smerge_font_spec, 2, 2, 0, 3897/* Merge font-specs FROM and TO, and return a new font-spec.
3896 doc: /* Merge font-specs FROM and TO, and return a new font-spec. 3898 Every specified property in FROM overrides the corresponding
3897Every specified properties in FROM override the corresponding 3899 property in TO. */
3898properties in TO. */) 3900Lisp_Object
3899 (Lisp_Object from, Lisp_Object to) 3901merge_font_spec (Lisp_Object from, Lisp_Object to)
3900{ 3902{
3901 Lisp_Object extra, tail; 3903 Lisp_Object extra, tail;
3902 int i; 3904 int i;
3903 3905
3904 CHECK_FONT (from); 3906 CHECK_FONT (from);
3905 CHECK_FONT (to); 3907 CHECK_FONT (to);
3906 to = Fcopy_font_spec (to); 3908 to = copy_font_spec (to);
3907 for (i = 0; i < FONT_EXTRA_INDEX; i++) 3909 for (i = 0; i < FONT_EXTRA_INDEX; i++)
3908 ASET (to, i, AREF (from, i)); 3910 ASET (to, i, AREF (from, i));
3909 extra = AREF (to, FONT_EXTRA_INDEX); 3911 extra = AREF (to, FONT_EXTRA_INDEX);
diff --git a/src/font.h b/src/font.h
index 511a7de3a16..7b43c2f99e7 100644
--- a/src/font.h
+++ b/src/font.h
@@ -239,7 +239,7 @@ enum font_property_index
239 ASET ((font), prop, make_number (font_style_to_value (prop, val, 1))) 239 ASET ((font), prop, make_number (font_style_to_value (prop, val, 1)))
240 240
241extern Lisp_Object QCspacing, QCdpi, QCscalable, QCotf, QClang, QCscript; 241extern Lisp_Object QCspacing, QCdpi, QCscalable, QCotf, QClang, QCscript;
242extern Lisp_Object QCavgwidth, QCantialias, QCfont_entity, QCfc_unknown_spec; 242extern Lisp_Object QCavgwidth, QCantialias, QCfont_entity;
243extern Lisp_Object Qp; 243extern Lisp_Object Qp;
244 244
245 245
@@ -737,8 +737,8 @@ struct font_data_list
737}; 737};
738 738
739EXFUN (Ffont_spec, MANY); 739EXFUN (Ffont_spec, MANY);
740EXFUN (Fcopy_font_spec, 1); 740extern Lisp_Object copy_font_spec (Lisp_Object);
741EXFUN (Fmerge_font_spec, 2); 741extern Lisp_Object merge_font_spec (Lisp_Object, Lisp_Object);
742EXFUN (Ffont_get, 2); 742EXFUN (Ffont_get, 2);
743EXFUN (Ffont_put, 3); 743EXFUN (Ffont_put, 3);
744EXFUN (Flist_fonts, 4); 744EXFUN (Flist_fonts, 4);
@@ -779,7 +779,6 @@ extern void font_done_for_face (FRAME_PTR f, struct face *face);
779 779
780extern Lisp_Object font_open_by_spec (FRAME_PTR f, Lisp_Object spec); 780extern Lisp_Object font_open_by_spec (FRAME_PTR f, Lisp_Object spec);
781extern Lisp_Object font_open_by_name (FRAME_PTR f, const char *name); 781extern Lisp_Object font_open_by_name (FRAME_PTR f, const char *name);
782extern void font_close_object (FRAME_PTR f, Lisp_Object font_object);
783 782
784extern Lisp_Object font_intern_prop (const char *str, int len, int force_symbol); 783extern Lisp_Object font_intern_prop (const char *str, int len, int force_symbol);
785extern void font_update_sort_order (int *order); 784extern void font_update_sort_order (int *order);
@@ -821,13 +820,14 @@ extern void syms_of_ftfont (void);
821#endif /* HAVE_FREETYPE */ 820#endif /* HAVE_FREETYPE */
822#ifdef HAVE_X_WINDOWS 821#ifdef HAVE_X_WINDOWS
823extern struct font_driver xfont_driver; 822extern struct font_driver xfont_driver;
824extern struct font_driver ftxfont_driver;
825extern void syms_of_xfont (void); 823extern void syms_of_xfont (void);
826extern void syms_of_ftxfont (void); 824extern void syms_of_ftxfont (void);
827#ifdef HAVE_XFT 825#ifdef HAVE_XFT
828extern struct font_driver xftfont_driver; 826extern struct font_driver xftfont_driver;
829extern void syms_of_xftfont (void); 827extern void syms_of_xftfont (void);
830#endif /* HAVE_XFT */ 828#elif defined HAVE_FREETYPE
829extern struct font_driver ftxfont_driver;
830#endif
831#ifdef HAVE_BDFFONT 831#ifdef HAVE_BDFFONT
832extern void syms_of_bdffont (void); 832extern void syms_of_bdffont (void);
833#endif /* HAVE_BDFFONT */ 833#endif /* HAVE_BDFFONT */
@@ -871,4 +871,3 @@ extern void font_deferred_log (const char *, Lisp_Object, Lisp_Object);
871#endif /* not FONT_DEBUG */ 871#endif /* not FONT_DEBUG */
872 872
873#endif /* not EMACS_FONT_H */ 873#endif /* not EMACS_FONT_H */
874
diff --git a/src/fontset.c b/src/fontset.c
index eea65535c78..a40a3dd5f9c 100644
--- a/src/fontset.c
+++ b/src/fontset.c
@@ -238,7 +238,7 @@ fontset_id_valid_p (int id)
238/* Macros to access special values of (realized) FONTSET. */ 238/* Macros to access special values of (realized) FONTSET. */
239#define FONTSET_BASE(fontset) XCHAR_TABLE (fontset)->extras[2] 239#define FONTSET_BASE(fontset) XCHAR_TABLE (fontset)->extras[2]
240#define FONTSET_FRAME(fontset) XCHAR_TABLE (fontset)->extras[3] 240#define FONTSET_FRAME(fontset) XCHAR_TABLE (fontset)->extras[3]
241#define FONTSET_OBJLIST(fontset) XCHAR_TABLE (fontset)->extras[4] 241/* #define FONTSET_OBJLIST(fontset) XCHAR_TABLE (fontset)->extras[4] */
242#define FONTSET_NOFONT_FACE(fontset) XCHAR_TABLE (fontset)->extras[5] 242#define FONTSET_NOFONT_FACE(fontset) XCHAR_TABLE (fontset)->extras[5]
243/* #define FONTSET_REPERTORY(fontset) XCHAR_TABLE (fontset)->extras[6] */ 243/* #define FONTSET_REPERTORY(fontset) XCHAR_TABLE (fontset)->extras[6] */
244#define FONTSET_DEFAULT(fontset) XCHAR_TABLE (fontset)->extras[7] 244#define FONTSET_DEFAULT(fontset) XCHAR_TABLE (fontset)->extras[7]
@@ -838,6 +838,7 @@ fontset_ascii (int id)
838static void 838static void
839free_realized_fontset (FRAME_PTR f, Lisp_Object fontset) 839free_realized_fontset (FRAME_PTR f, Lisp_Object fontset)
840{ 840{
841#if 0
841 Lisp_Object tail; 842 Lisp_Object tail;
842 843
843 if (0) 844 if (0)
@@ -846,6 +847,7 @@ free_realized_fontset (FRAME_PTR f, Lisp_Object fontset)
846 xassert (FONT_OBJECT_P (XCAR (tail))); 847 xassert (FONT_OBJECT_P (XCAR (tail)));
847 font_close_object (f, XCAR (tail)); 848 font_close_object (f, XCAR (tail));
848 } 849 }
850#endif
849} 851}
850 852
851/* Free fontset of FACE defined on frame F. Called from 853/* Free fontset of FACE defined on frame F. Called from
@@ -881,6 +883,7 @@ free_face_fontset (FRAME_PTR f, struct face *face)
881} 883}
882 884
883 885
886#if 0
884/* Return 1 if FACE is suitable for displaying character C. 887/* Return 1 if FACE is suitable for displaying character C.
885 Otherwise return 0. Called from the macro FACE_SUITABLE_FOR_CHAR_P 888 Otherwise return 0. Called from the macro FACE_SUITABLE_FOR_CHAR_P
886 when C is not an ASCII character. */ 889 when C is not an ASCII character. */
@@ -896,6 +899,7 @@ face_suitable_for_char_p (struct face *face, int c)
896 && INTEGERP (RFONT_DEF_FACE (rfont_def)) 899 && INTEGERP (RFONT_DEF_FACE (rfont_def))
897 && face->id == XINT (RFONT_DEF_FACE (rfont_def))); 900 && face->id == XINT (RFONT_DEF_FACE (rfont_def)));
898} 901}
902#endif
899 903
900 904
901/* Return ID of face suitable for displaying character C on frame F. 905/* Return ID of face suitable for displaying character C on frame F.
@@ -1709,7 +1713,7 @@ int
1709fontset_from_font (Lisp_Object font_object) 1713fontset_from_font (Lisp_Object font_object)
1710{ 1714{
1711 Lisp_Object font_name = font_get_name (font_object); 1715 Lisp_Object font_name = font_get_name (font_object);
1712 Lisp_Object font_spec = Fcopy_font_spec (font_object); 1716 Lisp_Object font_spec = copy_font_spec (font_object);
1713 Lisp_Object registry = AREF (font_spec, FONT_REGISTRY_INDEX); 1717 Lisp_Object registry = AREF (font_spec, FONT_REGISTRY_INDEX);
1714 Lisp_Object fontset_spec, alias, name, fontset; 1718 Lisp_Object fontset_spec, alias, name, fontset;
1715 Lisp_Object val; 1719 Lisp_Object val;
@@ -1726,7 +1730,7 @@ fontset_from_font (Lisp_Object font_object)
1726 sprintf (temp, "fontset-auto%d", num_auto_fontsets - 1); 1730 sprintf (temp, "fontset-auto%d", num_auto_fontsets - 1);
1727 alias = intern (temp); 1731 alias = intern (temp);
1728 } 1732 }
1729 fontset_spec = Fcopy_font_spec (font_spec); 1733 fontset_spec = copy_font_spec (font_spec);
1730 ASET (fontset_spec, FONT_REGISTRY_INDEX, alias); 1734 ASET (fontset_spec, FONT_REGISTRY_INDEX, alias);
1731 name = Ffont_xlfd_name (fontset_spec, Qnil); 1735 name = Ffont_xlfd_name (fontset_spec, Qnil);
1732 if (NILP (name)) 1736 if (NILP (name))
diff --git a/src/fontset.h b/src/fontset.h
index fe2e4fe0ca4..8831f4ce0b7 100644
--- a/src/fontset.h
+++ b/src/fontset.h
@@ -32,7 +32,6 @@ extern void (*check_window_system_func) (void);
32struct face; 32struct face;
33 33
34extern void free_face_fontset (FRAME_PTR, struct face *); 34extern void free_face_fontset (FRAME_PTR, struct face *);
35extern int face_suitable_for_char_p (struct face *, int);
36extern int face_for_char (FRAME_PTR, struct face *, int, 35extern int face_for_char (FRAME_PTR, struct face *, int,
37 int, Lisp_Object); 36 int, Lisp_Object);
38extern Lisp_Object font_for_char (struct face *, int, int, Lisp_Object); 37extern Lisp_Object font_for_char (struct face *, int, int, Lisp_Object);
@@ -51,4 +50,3 @@ struct font;
51extern int face_for_font (struct frame *, Lisp_Object, struct face *); 50extern int face_for_font (struct frame *, Lisp_Object, struct face *);
52 51
53#endif /* EMACS_FONTSET_H */ 52#endif /* EMACS_FONTSET_H */
54
diff --git a/src/frame.c b/src/frame.c
index 1b6d36092ae..cafcd149503 100644
--- a/src/frame.c
+++ b/src/frame.c
@@ -69,10 +69,10 @@ Lisp_Object Qonly;
69Lisp_Object Qx, Qw32, Qmac, Qpc, Qns; 69Lisp_Object Qx, Qw32, Qmac, Qpc, Qns;
70Lisp_Object Qvisible; 70Lisp_Object Qvisible;
71Lisp_Object Qdisplay_type; 71Lisp_Object Qdisplay_type;
72Lisp_Object Qbackground_mode; 72static Lisp_Object Qbackground_mode;
73Lisp_Object Qnoelisp; 73Lisp_Object Qnoelisp;
74 74
75Lisp_Object Qx_frame_parameter; 75static Lisp_Object Qx_frame_parameter;
76Lisp_Object Qx_resource_name; 76Lisp_Object Qx_resource_name;
77Lisp_Object Qterminal; 77Lisp_Object Qterminal;
78Lisp_Object Qterminal_live_p; 78Lisp_Object Qterminal_live_p;
@@ -82,7 +82,7 @@ Lisp_Object Qterminal_live_p;
82Lisp_Object Qauto_raise, Qauto_lower; 82Lisp_Object Qauto_raise, Qauto_lower;
83Lisp_Object Qborder_color, Qborder_width; 83Lisp_Object Qborder_color, Qborder_width;
84Lisp_Object Qcursor_color, Qcursor_type; 84Lisp_Object Qcursor_color, Qcursor_type;
85Lisp_Object Qgeometry; /* Not used */ 85static Lisp_Object Qgeometry; /* Not used */
86Lisp_Object Qheight, Qwidth; 86Lisp_Object Qheight, Qwidth;
87Lisp_Object Qleft, Qright; 87Lisp_Object Qleft, Qright;
88Lisp_Object Qicon_left, Qicon_top, Qicon_type, Qicon_name; 88Lisp_Object Qicon_left, Qicon_top, Qicon_type, Qicon_name;
@@ -95,19 +95,20 @@ Lisp_Object Qvisibility;
95Lisp_Object Qscroll_bar_foreground, Qscroll_bar_background; 95Lisp_Object Qscroll_bar_foreground, Qscroll_bar_background;
96Lisp_Object Qscreen_gamma; 96Lisp_Object Qscreen_gamma;
97Lisp_Object Qline_spacing; 97Lisp_Object Qline_spacing;
98Lisp_Object Quser_position, Quser_size; 98static Lisp_Object Quser_position, Quser_size;
99Lisp_Object Qwait_for_wm; 99Lisp_Object Qwait_for_wm;
100Lisp_Object Qwindow_id; 100static Lisp_Object Qwindow_id;
101#ifdef HAVE_X_WINDOWS 101#ifdef HAVE_X_WINDOWS
102Lisp_Object Qouter_window_id; 102static Lisp_Object Qouter_window_id;
103#endif 103#endif
104Lisp_Object Qparent_id; 104Lisp_Object Qparent_id;
105Lisp_Object Qtitle, Qname; 105Lisp_Object Qtitle, Qname;
106Lisp_Object Qexplicit_name; 106static Lisp_Object Qexplicit_name;
107Lisp_Object Qunsplittable; 107Lisp_Object Qunsplittable;
108Lisp_Object Qmenu_bar_lines, Qtool_bar_lines, Qtool_bar_position; 108Lisp_Object Qmenu_bar_lines, Qtool_bar_lines, Qtool_bar_position;
109Lisp_Object Qleft_fringe, Qright_fringe; 109Lisp_Object Qleft_fringe, Qright_fringe;
110Lisp_Object Qbuffer_predicate, Qbuffer_list, Qburied_buffer_list; 110Lisp_Object Qbuffer_predicate;
111static Lisp_Object Qbuffer_list, Qburied_buffer_list;
111Lisp_Object Qtty_color_mode; 112Lisp_Object Qtty_color_mode;
112Lisp_Object Qtty, Qtty_type; 113Lisp_Object Qtty, Qtty_type;
113 114
@@ -120,6 +121,10 @@ Lisp_Object Qface_set_after_frame_default;
120 121
121static Lisp_Object Qdelete_frame_functions; 122static Lisp_Object Qdelete_frame_functions;
122 123
124#ifdef HAVE_WINDOW_SYSTEM
125static void x_report_frame_params (struct frame *, Lisp_Object *);
126#endif
127
123 128
124static void 129static void
125set_menu_bar_lines_1 (Lisp_Object window, int n) 130set_menu_bar_lines_1 (Lisp_Object window, int n)
@@ -548,7 +553,7 @@ make_initial_frame (void)
548} 553}
549 554
550 555
551struct frame * 556static struct frame *
552make_terminal_frame (struct terminal *terminal) 557make_terminal_frame (struct terminal *terminal)
553{ 558{
554 register struct frame *f; 559 register struct frame *f;
@@ -2077,6 +2082,9 @@ See `redirect-frame-focus'. */)
2077 2082
2078/* Return the value of frame parameter PROP in frame FRAME. */ 2083/* Return the value of frame parameter PROP in frame FRAME. */
2079 2084
2085#if !HAVE_NS
2086static
2087#endif
2080Lisp_Object 2088Lisp_Object
2081get_frame_param (register struct frame *frame, Lisp_Object prop) 2089get_frame_param (register struct frame *frame, Lisp_Object prop)
2082{ 2090{
@@ -2832,7 +2840,7 @@ static const struct frame_parm_table frame_parms[] =
2832 {"tool-bar-position", &Qtool_bar_position}, 2840 {"tool-bar-position", &Qtool_bar_position},
2833}; 2841};
2834 2842
2835#ifdef HAVE_WINDOW_SYSTEM 2843#ifdef WINDOWSNT
2836 2844
2837/* Calculate fullscreen size. Return in *TOP_POS and *LEFT_POS the 2845/* Calculate fullscreen size. Return in *TOP_POS and *LEFT_POS the
2838 wanted positions of the WM window (not Emacs window). 2846 wanted positions of the WM window (not Emacs window).
@@ -2876,6 +2884,9 @@ x_fullscreen_adjust (struct frame *f, int *width, int *height, int *top_pos, int
2876 *height = newheight; 2884 *height = newheight;
2877} 2885}
2878 2886
2887#endif /* WINDOWSNT */
2888
2889#ifdef HAVE_WINDOW_SYSTEM
2879 2890
2880/* Change the parameters of frame F as specified by ALIST. 2891/* Change the parameters of frame F as specified by ALIST.
2881 If a parameter is not specially recognized, do nothing special; 2892 If a parameter is not specially recognized, do nothing special;
@@ -3834,31 +3845,6 @@ display_x_get_resource (Display_Info *dpyinfo, Lisp_Object attribute, Lisp_Objec
3834 attribute, class, component, subclass); 3845 attribute, class, component, subclass);
3835} 3846}
3836 3847
3837#if defined HAVE_X_WINDOWS && !defined USE_X_TOOLKIT
3838/* Used when C code wants a resource value. */
3839/* Called from oldXMenu/Create.c. */
3840char *
3841x_get_resource_string (const char *attribute, const char *class)
3842{
3843 char *name_key;
3844 char *class_key;
3845 struct frame *sf = SELECTED_FRAME ();
3846
3847 /* Allocate space for the components, the dots which separate them,
3848 and the final '\0'. */
3849 name_key = (char *) alloca (SBYTES (Vinvocation_name)
3850 + strlen (attribute) + 2);
3851 class_key = (char *) alloca ((sizeof (EMACS_CLASS) - 1)
3852 + strlen (class) + 2);
3853
3854 sprintf (name_key, "%s.%s", SDATA (Vinvocation_name), attribute);
3855 sprintf (class_key, "%s.%s", EMACS_CLASS, class);
3856
3857 return x_get_string_resource (FRAME_X_DISPLAY_INFO (sf)->xrdb,
3858 name_key, class_key);
3859}
3860#endif
3861
3862/* Return the value of parameter PARAM. 3848/* Return the value of parameter PARAM.
3863 3849
3864 First search ALIST, then Vdefault_frame_alist, then the X defaults 3850 First search ALIST, then Vdefault_frame_alist, then the X defaults
diff --git a/src/frame.h b/src/frame.h
index 756e121f678..1f176f6f900 100644
--- a/src/frame.h
+++ b/src/frame.h
@@ -31,11 +31,6 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
31/* Nonzero means there is at least one garbaged frame. */ 31/* Nonzero means there is at least one garbaged frame. */
32extern int frame_garbaged; 32extern int frame_garbaged;
33 33
34/* Nonzero means FRAME_MESSAGE_BUF (selected_frame) is being used by
35 print. */
36
37extern int message_buf_print;
38
39 34
40/* The structure representing a frame. */ 35/* The structure representing a frame. */
41 36
@@ -843,7 +838,6 @@ extern struct frame *last_nonminibuf_frame;
843 838
844extern void set_menu_bar_lines (struct frame *, Lisp_Object, Lisp_Object); 839extern void set_menu_bar_lines (struct frame *, Lisp_Object, Lisp_Object);
845extern struct frame *make_initial_frame (void); 840extern struct frame *make_initial_frame (void);
846extern struct frame *make_terminal_frame (struct terminal *);
847extern struct frame *make_frame (int); 841extern struct frame *make_frame (int);
848#ifdef HAVE_WINDOW_SYSTEM 842#ifdef HAVE_WINDOW_SYSTEM
849extern struct frame *make_minibuffer_frame (void); 843extern struct frame *make_minibuffer_frame (void);
@@ -1047,7 +1041,7 @@ extern Lisp_Object selected_frame;
1047 1041
1048extern Lisp_Object Qauto_raise, Qauto_lower; 1042extern Lisp_Object Qauto_raise, Qauto_lower;
1049extern Lisp_Object Qborder_color, Qborder_width; 1043extern Lisp_Object Qborder_color, Qborder_width;
1050extern Lisp_Object Qbuffer_predicate, Qbuffer_list, Qburied_buffer_list; 1044extern Lisp_Object Qbuffer_predicate;
1051extern Lisp_Object Qcursor_color, Qcursor_type; 1045extern Lisp_Object Qcursor_color, Qcursor_type;
1052extern Lisp_Object Qfont; 1046extern Lisp_Object Qfont;
1053extern Lisp_Object Qbackground_color, Qforeground_color; 1047extern Lisp_Object Qbackground_color, Qforeground_color;
@@ -1076,7 +1070,6 @@ extern Lisp_Object Qminibuffer, Qmodeline;
1076extern Lisp_Object Qx, Qw32, Qmac, Qpc, Qns; 1070extern Lisp_Object Qx, Qw32, Qmac, Qpc, Qns;
1077extern Lisp_Object Qvisible; 1071extern Lisp_Object Qvisible;
1078extern Lisp_Object Qdisplay_type; 1072extern Lisp_Object Qdisplay_type;
1079extern Lisp_Object Qbackground_mode;
1080 1073
1081extern Lisp_Object Qx_resource_name; 1074extern Lisp_Object Qx_resource_name;
1082 1075
@@ -1101,11 +1094,12 @@ extern Lisp_Object x_new_font (struct frame *, Lisp_Object, int);
1101 1094
1102extern Lisp_Object Qface_set_after_frame_default; 1095extern Lisp_Object Qface_set_after_frame_default;
1103 1096
1097#ifdef WINDOWSNT
1104extern void x_fullscreen_adjust (struct frame *f, int *, int *, 1098extern void x_fullscreen_adjust (struct frame *f, int *, int *,
1105 int *, int *); 1099 int *, int *);
1100#endif
1106 1101
1107extern void x_set_frame_parameters (struct frame *, Lisp_Object); 1102extern void x_set_frame_parameters (struct frame *, Lisp_Object);
1108extern void x_report_frame_params (struct frame *, Lisp_Object *);
1109 1103
1110extern void x_set_fullscreen (struct frame *, Lisp_Object, Lisp_Object); 1104extern void x_set_fullscreen (struct frame *, Lisp_Object, Lisp_Object);
1111extern void x_set_line_spacing (struct frame *, Lisp_Object, Lisp_Object); 1105extern void x_set_line_spacing (struct frame *, Lisp_Object, Lisp_Object);
@@ -1139,10 +1133,6 @@ extern Lisp_Object display_x_get_resource (Display_Info *,
1139 Lisp_Object component, 1133 Lisp_Object component,
1140 Lisp_Object subclass); 1134 Lisp_Object subclass);
1141 1135
1142#if defined HAVE_X_WINDOWS && !defined USE_X_TOOLKIT
1143extern char *x_get_resource_string (const char *, const char *);
1144#endif
1145
1146/* In xmenu.c */ 1136/* In xmenu.c */
1147extern void set_frame_menubar (FRAME_PTR, int, int); 1137extern void set_frame_menubar (FRAME_PTR, int, int);
1148 1138
diff --git a/src/fringe.c b/src/fringe.c
index ce75df766ee..bc6b493584c 100644
--- a/src/fringe.c
+++ b/src/fringe.c
@@ -64,9 +64,9 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
64 must specify physical bitmap symbols. 64 must specify physical bitmap symbols.
65*/ 65*/
66 66
67Lisp_Object Qtruncation, Qcontinuation, Qoverlay_arrow; 67static Lisp_Object Qtruncation, Qcontinuation, Qoverlay_arrow;
68Lisp_Object Qempty_line, Qtop_bottom; 68static Lisp_Object Qempty_line, Qtop_bottom;
69Lisp_Object Qhollow_small; 69static Lisp_Object Qhollow_small;
70 70
71enum fringe_bitmap_align 71enum fringe_bitmap_align
72{ 72{
@@ -427,7 +427,7 @@ static unsigned short empty_line_bits[] = {
427/* NOTE: The order of these bitmaps must match the sequence 427/* NOTE: The order of these bitmaps must match the sequence
428 used in fringe.el to define the corresponding symbols. */ 428 used in fringe.el to define the corresponding symbols. */
429 429
430struct fringe_bitmap standard_bitmaps[] = 430static struct fringe_bitmap standard_bitmaps[] =
431{ 431{
432 { NULL, 0, 0, 0, 0, 0 }, /* NO_FRINGE_BITMAP */ 432 { NULL, 0, 0, 0, 0, 0 }, /* NO_FRINGE_BITMAP */
433 { FRBITS (question_mark_bits), 8, 0, ALIGN_BITMAP_CENTER, 0 }, 433 { FRBITS (question_mark_bits), 8, 0, ALIGN_BITMAP_CENTER, 0 },
@@ -462,6 +462,9 @@ static struct fringe_bitmap **fringe_bitmaps;
462static Lisp_Object *fringe_faces; 462static Lisp_Object *fringe_faces;
463static int max_fringe_bitmaps; 463static int max_fringe_bitmaps;
464 464
465#ifndef HAVE_NS
466static
467#endif
465int max_used_fringe_bitmap = MAX_STANDARD_FRINGE_BITMAPS; 468int max_used_fringe_bitmap = MAX_STANDARD_FRINGE_BITMAPS;
466 469
467 470
diff --git a/src/ftfont.c b/src/ftfont.c
index 2e66222d268..47425e853da 100644
--- a/src/ftfont.c
+++ b/src/ftfont.c
@@ -39,7 +39,7 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
39#include "ftfont.h" 39#include "ftfont.h"
40 40
41/* Symbolic type of this font-driver. */ 41/* Symbolic type of this font-driver. */
42Lisp_Object Qfreetype; 42static Lisp_Object Qfreetype;
43 43
44/* Fontconfig's generic families and their aliases. */ 44/* Fontconfig's generic families and their aliases. */
45static Lisp_Object Qmonospace, Qsans_serif, Qserif, Qmono, Qsans, Qsans__serif; 45static Lisp_Object Qmonospace, Qsans_serif, Qserif, Qmono, Qsans, Qsans__serif;
diff --git a/src/ftxfont.c b/src/ftxfont.c
index c6fa858af74..bbba3ca8163 100644
--- a/src/ftxfont.c
+++ b/src/ftxfont.c
@@ -38,6 +38,11 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
38 38
39static Lisp_Object Qftx; 39static Lisp_Object Qftx;
40 40
41#if defined HAVE_XFT || !defined HAVE_FREETYPE
42static
43#endif
44struct font_driver ftxfont_driver;
45
41/* Prototypes for helper function. */ 46/* Prototypes for helper function. */
42static GC *ftxfont_get_gcs (FRAME_PTR, unsigned long, unsigned long); 47static GC *ftxfont_get_gcs (FRAME_PTR, unsigned long, unsigned long);
43static int ftxfont_draw_bitmap (FRAME_PTR, GC, GC *, struct font *, 48static int ftxfont_draw_bitmap (FRAME_PTR, GC, GC *, struct font *,
@@ -233,13 +238,11 @@ static Lisp_Object ftxfont_open (FRAME_PTR, Lisp_Object, int);
233static void ftxfont_close (FRAME_PTR, struct font *); 238static void ftxfont_close (FRAME_PTR, struct font *);
234static int ftxfont_draw (struct glyph_string *, int, int, int, int, int); 239static int ftxfont_draw (struct glyph_string *, int, int, int, int, int);
235 240
236struct font_driver ftxfont_driver;
237
238static Lisp_Object 241static Lisp_Object
239ftxfont_list (Lisp_Object frame, Lisp_Object spec) 242ftxfont_list (Lisp_Object frame, Lisp_Object spec)
240{ 243{
241 Lisp_Object list = ftfont_driver.list (frame, spec), tail; 244 Lisp_Object list = ftfont_driver.list (frame, spec), tail;
242 245
243 for (tail = list; CONSP (tail); tail = XCDR (tail)) 246 for (tail = list; CONSP (tail); tail = XCDR (tail))
244 ASET (XCAR (tail), FONT_TYPE_INDEX, Qftx); 247 ASET (XCAR (tail), FONT_TYPE_INDEX, Qftx);
245 return list; 248 return list;
@@ -350,13 +353,13 @@ static int
350ftxfont_end_for_frame (FRAME_PTR f) 353ftxfont_end_for_frame (FRAME_PTR f)
351{ 354{
352 struct ftxfont_frame_data *data = font_get_frame_data (f, &ftxfont_driver); 355 struct ftxfont_frame_data *data = font_get_frame_data (f, &ftxfont_driver);
353 356
354 BLOCK_INPUT; 357 BLOCK_INPUT;
355 while (data) 358 while (data)
356 { 359 {
357 struct ftxfont_frame_data *next = data->next; 360 struct ftxfont_frame_data *next = data->next;
358 int i; 361 int i;
359 362
360 for (i = 0; i < 6; i++) 363 for (i = 0; i < 6; i++)
361 XFreeGC (FRAME_X_DISPLAY (f), data->gcs[i]); 364 XFreeGC (FRAME_X_DISPLAY (f), data->gcs[i]);
362 free (data); 365 free (data);
@@ -384,4 +387,3 @@ syms_of_ftxfont (void)
384 ftxfont_driver.end_for_frame = ftxfont_end_for_frame; 387 ftxfont_driver.end_for_frame = ftxfont_end_for_frame;
385 register_font_driver (&ftxfont_driver, NULL); 388 register_font_driver (&ftxfont_driver, NULL);
386} 389}
387
diff --git a/src/image.c b/src/image.c
index b3d2be88b96..fb555725b82 100644
--- a/src/image.c
+++ b/src/image.c
@@ -124,7 +124,7 @@ typedef struct ns_bitmap_record Bitmap_Record;
124 124
125/* The symbol `postscript' identifying images of this type. */ 125/* The symbol `postscript' identifying images of this type. */
126 126
127Lisp_Object Qpostscript; 127static Lisp_Object Qpostscript;
128 128
129static void x_disable_image (struct frame *, struct image *); 129static void x_disable_image (struct frame *, struct image *);
130static void x_edge_detection (struct frame *, struct image *, Lisp_Object, 130static void x_edge_detection (struct frame *, struct image *, Lisp_Object,
@@ -137,6 +137,7 @@ static void free_color_table (void);
137static unsigned long *colors_in_color_table (int *n); 137static unsigned long *colors_in_color_table (int *n);
138static unsigned long lookup_pixel_color (struct frame *f, unsigned long p); 138static unsigned long lookup_pixel_color (struct frame *f, unsigned long p);
139#endif 139#endif
140static Lisp_Object Finit_image_library (Lisp_Object, Lisp_Object);
140 141
141/* Code to deal with bitmaps. Bitmaps are referenced by their bitmap 142/* Code to deal with bitmaps. Bitmaps are referenced by their bitmap
142 id, which is just an int that this section returns. Bitmaps are 143 id, which is just an int that this section returns. Bitmaps are
@@ -561,17 +562,21 @@ static Lisp_Object Vimage_type_cache;
561 562
562/* The symbol `xbm' which is used as the type symbol for XBM images. */ 563/* The symbol `xbm' which is used as the type symbol for XBM images. */
563 564
564Lisp_Object Qxbm; 565static Lisp_Object Qxbm;
565 566
566/* Keywords. */ 567/* Keywords. */
567 568
568Lisp_Object QCascent, QCmargin, QCrelief, Qcount, Qextension_data; 569Lisp_Object QCascent, QCmargin, QCrelief;
569Lisp_Object QCconversion, QCcolor_symbols, QCheuristic_mask; 570static Lisp_Object Qcount, Qextension_data;
570Lisp_Object QCindex, QCmatrix, QCcolor_adjustment, QCmask, QCgeometry, QCcrop, QCrotation; 571Lisp_Object QCconversion;
572static Lisp_Object QCheuristic_mask;
573static Lisp_Object QCcolor_symbols;
574static Lisp_Object QCindex, QCmatrix, QCcolor_adjustment, QCmask, QCgeometry;
575static Lisp_Object QCcrop, QCrotation;
571 576
572/* Other symbols. */ 577/* Other symbols. */
573 578
574Lisp_Object Qlaplace, Qemboss, Qedge_detection, Qheuristic; 579static Lisp_Object Qlaplace, Qemboss, Qedge_detection, Qheuristic;
575 580
576/* Function prototypes. */ 581/* Function prototypes. */
577 582
@@ -3000,7 +3005,7 @@ static int xpm_valid_color_symbols_p (Lisp_Object);
3000#if defined (HAVE_XPM) || defined (HAVE_NS) 3005#if defined (HAVE_XPM) || defined (HAVE_NS)
3001/* The symbol `xpm' identifying XPM-format images. */ 3006/* The symbol `xpm' identifying XPM-format images. */
3002 3007
3003Lisp_Object Qxpm; 3008static Lisp_Object Qxpm;
3004 3009
3005/* Indices of image specification fields in xpm_format, below. */ 3010/* Indices of image specification fields in xpm_format, below. */
3006 3011
@@ -3091,7 +3096,7 @@ struct xpm_cached_color
3091 size. */ 3096 size. */
3092 3097
3093#define XPM_COLOR_CACHE_BUCKETS 1001 3098#define XPM_COLOR_CACHE_BUCKETS 1001
3094struct xpm_cached_color **xpm_color_cache; 3099static struct xpm_cached_color **xpm_color_cache;
3095 3100
3096/* Initialize the color cache. */ 3101/* Initialize the color cache. */
3097 3102
@@ -3307,7 +3312,7 @@ xpm_image_p (Lisp_Object object)
3307 3312
3308#endif /* HAVE_XPM || HAVE_NS */ 3313#endif /* HAVE_XPM || HAVE_NS */
3309 3314
3310#if defined (HAVE_XPM) && defined (HAVE_X_WINDOWS) 3315#if defined HAVE_XPM && defined HAVE_X_WINDOWS && !defined USE_GTK
3311int 3316int
3312x_create_bitmap_from_xpm_data (struct frame *f, const char **bits) 3317x_create_bitmap_from_xpm_data (struct frame *f, const char **bits)
3313{ 3318{
@@ -4131,11 +4136,11 @@ struct ct_color
4131 4136
4132/* The color hash table. */ 4137/* The color hash table. */
4133 4138
4134struct ct_color **ct_table; 4139static struct ct_color **ct_table;
4135 4140
4136/* Number of entries in the color table. */ 4141/* Number of entries in the color table. */
4137 4142
4138int ct_colors_allocated; 4143static int ct_colors_allocated;
4139 4144
4140/* Initialize the color table. */ 4145/* Initialize the color table. */
4141 4146
@@ -4924,7 +4929,7 @@ static int pbm_scan_number (unsigned char **, unsigned char *);
4924 4929
4925/* The symbol `pbm' identifying images of this type. */ 4930/* The symbol `pbm' identifying images of this type. */
4926 4931
4927Lisp_Object Qpbm; 4932static Lisp_Object Qpbm;
4928 4933
4929/* Indices of image specification fields in gs_format, below. */ 4934/* Indices of image specification fields in gs_format, below. */
4930 4935
@@ -5341,7 +5346,7 @@ static int png_load (struct frame *f, struct image *img);
5341 5346
5342/* The symbol `png' identifying images of this type. */ 5347/* The symbol `png' identifying images of this type. */
5343 5348
5344Lisp_Object Qpng; 5349static Lisp_Object Qpng;
5345 5350
5346/* Indices of image specification fields in png_format, below. */ 5351/* Indices of image specification fields in png_format, below. */
5347 5352
@@ -5955,7 +5960,7 @@ static int jpeg_load (struct frame *f, struct image *img);
5955 5960
5956/* The symbol `jpeg' identifying images of this type. */ 5961/* The symbol `jpeg' identifying images of this type. */
5957 5962
5958Lisp_Object Qjpeg; 5963static Lisp_Object Qjpeg;
5959 5964
5960/* Indices of image specification fields in gs_format, below. */ 5965/* Indices of image specification fields in gs_format, below. */
5961 5966
@@ -6504,7 +6509,7 @@ static int tiff_load (struct frame *f, struct image *img);
6504 6509
6505/* The symbol `tiff' identifying images of this type. */ 6510/* The symbol `tiff' identifying images of this type. */
6506 6511
6507Lisp_Object Qtiff; 6512static Lisp_Object Qtiff;
6508 6513
6509/* Indices of image specification fields in tiff_format, below. */ 6514/* Indices of image specification fields in tiff_format, below. */
6510 6515
@@ -6932,7 +6937,7 @@ static void gif_clear_image (struct frame *f, struct image *img);
6932 6937
6933/* The symbol `gif' identifying images of this type. */ 6938/* The symbol `gif' identifying images of this type. */
6934 6939
6935Lisp_Object Qgif; 6940static Lisp_Object Qgif;
6936 6941
6937/* Indices of image specification fields in gif_format, below. */ 6942/* Indices of image specification fields in gif_format, below. */
6938 6943
@@ -8301,7 +8306,7 @@ static void gs_clear_image (struct frame *f, struct image *img);
8301 8306
8302/* Keyword symbols. */ 8307/* Keyword symbols. */
8303 8308
8304Lisp_Object QCloader, QCbounding_box, QCpt_width, QCpt_height; 8309static Lisp_Object QCloader, QCbounding_box, QCpt_width, QCpt_height;
8305 8310
8306/* Indices of image specification fields in gs_format, below. */ 8311/* Indices of image specification fields in gs_format, below. */
8307 8312
diff --git a/src/indent.c b/src/indent.c
index 8732b2ca5cc..0bfe2e61ca6 100644
--- a/src/indent.c
+++ b/src/indent.c
@@ -1044,7 +1044,7 @@ The return value is the current column. */)
1044 1044
1045/* compute_motion: compute buffer posn given screen posn and vice versa */ 1045/* compute_motion: compute buffer posn given screen posn and vice versa */
1046 1046
1047struct position val_compute_motion; 1047static struct position val_compute_motion;
1048 1048
1049/* Scan the current buffer forward from offset FROM, pretending that 1049/* Scan the current buffer forward from offset FROM, pretending that
1050 this is at line FROMVPOS, column FROMHPOS, until reaching buffer 1050 this is at line FROMVPOS, column FROMHPOS, until reaching buffer
@@ -1818,7 +1818,7 @@ visible section of the buffer, and pass LINE and COL as TOPOS. */)
1818 1818
1819/* Fvertical_motion and vmotion */ 1819/* Fvertical_motion and vmotion */
1820 1820
1821struct position val_vmotion; 1821static struct position val_vmotion;
1822 1822
1823struct position * 1823struct position *
1824vmotion (register EMACS_INT from, register EMACS_INT vtarget, struct window *w) 1824vmotion (register EMACS_INT from, register EMACS_INT vtarget, struct window *w)
diff --git a/src/insdel.c b/src/insdel.c
index 4bdcb4bc0b7..82dce13af98 100644
--- a/src/insdel.c
+++ b/src/insdel.c
@@ -48,7 +48,7 @@ static void adjust_markers_for_replace (EMACS_INT, EMACS_INT, EMACS_INT,
48 EMACS_INT, EMACS_INT, EMACS_INT); 48 EMACS_INT, EMACS_INT, EMACS_INT);
49static void adjust_point (EMACS_INT nchars, EMACS_INT nbytes); 49static void adjust_point (EMACS_INT nchars, EMACS_INT nbytes);
50 50
51Lisp_Object Fcombine_after_change_execute (void); 51static Lisp_Object Fcombine_after_change_execute (void);
52 52
53/* List of elements of the form (BEG-UNCHANGED END-UNCHANGED CHANGE-AMOUNT) 53/* List of elements of the form (BEG-UNCHANGED END-UNCHANGED CHANGE-AMOUNT)
54 describing changes which happened while combine_after_change_calls 54 describing changes which happened while combine_after_change_calls
@@ -60,12 +60,14 @@ Lisp_Object Fcombine_after_change_execute (void);
60 END-UNCHANGED is the number of chars after the changed range, 60 END-UNCHANGED is the number of chars after the changed range,
61 and CHANGE-AMOUNT is the number of characters inserted by the change 61 and CHANGE-AMOUNT is the number of characters inserted by the change
62 (negative for a deletion). */ 62 (negative for a deletion). */
63Lisp_Object combine_after_change_list; 63static Lisp_Object combine_after_change_list;
64 64
65/* Buffer which combine_after_change_list is about. */ 65/* Buffer which combine_after_change_list is about. */
66Lisp_Object combine_after_change_buffer; 66static Lisp_Object combine_after_change_buffer;
67 67
68Lisp_Object Qinhibit_modification_hooks; 68Lisp_Object Qinhibit_modification_hooks;
69
70static void signal_before_change (EMACS_INT, EMACS_INT, EMACS_INT *);
69 71
70#define CHECK_MARKERS() \ 72#define CHECK_MARKERS() \
71 do \ 73 do \
@@ -1222,7 +1224,7 @@ insert_from_buffer_1 (struct buffer *buf,
1222 1224
1223 PREV_TEXT nil means the new text was just inserted. */ 1225 PREV_TEXT nil means the new text was just inserted. */
1224 1226
1225void 1227static void
1226adjust_after_replace (EMACS_INT from, EMACS_INT from_byte, 1228adjust_after_replace (EMACS_INT from, EMACS_INT from_byte,
1227 Lisp_Object prev_text, EMACS_INT len, EMACS_INT len_byte) 1229 Lisp_Object prev_text, EMACS_INT len, EMACS_INT len_byte)
1228{ 1230{
@@ -1285,58 +1287,6 @@ adjust_after_replace (EMACS_INT from, EMACS_INT from_byte,
1285 CHARS_MODIFF = MODIFF; 1287 CHARS_MODIFF = MODIFF;
1286} 1288}
1287 1289
1288/* Like adjust_after_replace, but doesn't require PREV_TEXT.
1289 This is for use when undo is not enabled in the current buffer. */
1290
1291void
1292adjust_after_replace_noundo (EMACS_INT from, EMACS_INT from_byte,
1293 EMACS_INT nchars_del, EMACS_INT nbytes_del,
1294 EMACS_INT len, EMACS_INT len_byte)
1295{
1296#ifdef BYTE_COMBINING_DEBUG
1297 if (count_combining_before (GPT_ADDR, len_byte, from, from_byte)
1298 || count_combining_after (GPT_ADDR, len_byte, from, from_byte))
1299 abort ();
1300#endif
1301
1302 /* Update various buffer positions for the new text. */
1303 GAP_SIZE -= len_byte;
1304 ZV += len; Z+= len;
1305 ZV_BYTE += len_byte; Z_BYTE += len_byte;
1306 GPT += len; GPT_BYTE += len_byte;
1307 if (GAP_SIZE > 0) *(GPT_ADDR) = 0; /* Put an anchor. */
1308
1309 if (nchars_del > 0)
1310 adjust_markers_for_replace (from, from_byte, nchars_del, nbytes_del,
1311 len, len_byte);
1312 else
1313 adjust_markers_for_insert (from, from_byte,
1314 from + len, from_byte + len_byte, 0);
1315
1316 if (len > nchars_del)
1317 adjust_overlays_for_insert (from, len - nchars_del);
1318 else if (len < nchars_del)
1319 adjust_overlays_for_delete (from, nchars_del - len);
1320 if (BUF_INTERVALS (current_buffer) != 0)
1321 {
1322 offset_intervals (current_buffer, from, len - nchars_del);
1323 }
1324
1325 if (from < PT)
1326 adjust_point (len - nchars_del, len_byte - nbytes_del);
1327
1328 /* As byte combining will decrease Z, we must check this again. */
1329 if (Z - GPT < END_UNCHANGED)
1330 END_UNCHANGED = Z - GPT;
1331
1332 CHECK_MARKERS ();
1333
1334 if (len == 0)
1335 evaporate_overlays (from);
1336 MODIFF++;
1337 CHARS_MODIFF = MODIFF;
1338}
1339
1340/* Record undo information, adjust markers and position keepers for an 1290/* Record undo information, adjust markers and position keepers for an
1341 insertion of a text from FROM (FROM_BYTE) to TO (TO_BYTE). The 1291 insertion of a text from FROM (FROM_BYTE) to TO (TO_BYTE). The
1342 text already exists in the current buffer but character length (TO 1292 text already exists in the current buffer but character length (TO
@@ -2049,7 +1999,7 @@ reset_var_on_error (Lisp_Object val)
2049 If PRESERVE_PTR is nonzero, we relocate *PRESERVE_PTR 1999 If PRESERVE_PTR is nonzero, we relocate *PRESERVE_PTR
2050 by holding its value temporarily in a marker. */ 2000 by holding its value temporarily in a marker. */
2051 2001
2052void 2002static void
2053signal_before_change (EMACS_INT start_int, EMACS_INT end_int, 2003signal_before_change (EMACS_INT start_int, EMACS_INT end_int,
2054 EMACS_INT *preserve_ptr) 2004 EMACS_INT *preserve_ptr)
2055{ 2005{
diff --git a/src/intervals.c b/src/intervals.c
index 952f826778c..3be6e2d1ffa 100644
--- a/src/intervals.c
+++ b/src/intervals.c
@@ -51,7 +51,8 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
51 51
52#define TMEM(sym, set) (CONSP (set) ? ! NILP (Fmemq (sym, set)) : ! NILP (set)) 52#define TMEM(sym, set) (CONSP (set) ? ! NILP (Fmemq (sym, set)) : ! NILP (set))
53 53
54Lisp_Object merge_properties_sticky (Lisp_Object pleft, Lisp_Object pright); 54static Lisp_Object merge_properties_sticky (Lisp_Object, Lisp_Object);
55static INTERVAL merge_interval_right (INTERVAL);
55static INTERVAL reproduce_tree (INTERVAL, INTERVAL); 56static INTERVAL reproduce_tree (INTERVAL, INTERVAL);
56static INTERVAL reproduce_tree_obj (INTERVAL, Lisp_Object); 57static INTERVAL reproduce_tree_obj (INTERVAL, Lisp_Object);
57 58
@@ -1089,7 +1090,7 @@ FR 8 9 A B
1089 left rear-nonsticky = t, right front-sticky = nil (inherit none) 1090 left rear-nonsticky = t, right front-sticky = nil (inherit none)
1090*/ 1091*/
1091 1092
1092Lisp_Object 1093static Lisp_Object
1093merge_properties_sticky (Lisp_Object pleft, Lisp_Object pright) 1094merge_properties_sticky (Lisp_Object pleft, Lisp_Object pright)
1094{ 1095{
1095 register Lisp_Object props, front, rear; 1096 register Lisp_Object props, front, rear;
@@ -1258,7 +1259,7 @@ delete_node (register INTERVAL i)
1258 I is presumed to be empty; that is, no adjustments are made 1259 I is presumed to be empty; that is, no adjustments are made
1259 for the length of I. */ 1260 for the length of I. */
1260 1261
1261void 1262static void
1262delete_interval (register INTERVAL i) 1263delete_interval (register INTERVAL i)
1263{ 1264{
1264 register INTERVAL parent; 1265 register INTERVAL parent;
@@ -1446,7 +1447,7 @@ offset_intervals (struct buffer *buffer, EMACS_INT start, EMACS_INT length)
1446 The caller must verify that this is not the last (rightmost) 1447 The caller must verify that this is not the last (rightmost)
1447 interval. */ 1448 interval. */
1448 1449
1449INTERVAL 1450static INTERVAL
1450merge_interval_right (register INTERVAL i) 1451merge_interval_right (register INTERVAL i)
1451{ 1452{
1452 register EMACS_INT absorb = LENGTH (i); 1453 register EMACS_INT absorb = LENGTH (i);
diff --git a/src/intervals.h b/src/intervals.h
index d7c34012e1f..f1679eb8b40 100644
--- a/src/intervals.h
+++ b/src/intervals.h
@@ -266,8 +266,6 @@ extern INTERVAL find_interval (INTERVAL, EMACS_INT);
266extern INTERVAL next_interval (INTERVAL); 266extern INTERVAL next_interval (INTERVAL);
267extern INTERVAL previous_interval (INTERVAL); 267extern INTERVAL previous_interval (INTERVAL);
268extern INTERVAL merge_interval_left (INTERVAL); 268extern INTERVAL merge_interval_left (INTERVAL);
269extern INTERVAL merge_interval_right (INTERVAL);
270extern void delete_interval (INTERVAL);
271extern void offset_intervals (struct buffer *, EMACS_INT, EMACS_INT); 269extern void offset_intervals (struct buffer *, EMACS_INT, EMACS_INT);
272extern void graft_intervals_into_buffer (INTERVAL, EMACS_INT, EMACS_INT, 270extern void graft_intervals_into_buffer (INTERVAL, EMACS_INT, EMACS_INT,
273 struct buffer *, int); 271 struct buffer *, int);
@@ -295,8 +293,6 @@ extern int invisible_p (Lisp_Object, Lisp_Object);
295/* Declared in textprop.c */ 293/* Declared in textprop.c */
296 294
297/* Types of hooks. */ 295/* Types of hooks. */
298extern Lisp_Object Qmouse_left;
299extern Lisp_Object Qmouse_entered;
300extern Lisp_Object Qpoint_left; 296extern Lisp_Object Qpoint_left;
301extern Lisp_Object Qpoint_entered; 297extern Lisp_Object Qpoint_entered;
302extern Lisp_Object Qmodification_hooks; 298extern Lisp_Object Qmodification_hooks;
@@ -305,8 +301,8 @@ extern Lisp_Object Qlocal_map;
305extern Lisp_Object Qkeymap; 301extern Lisp_Object Qkeymap;
306 302
307/* Visual properties text (including strings) may have. */ 303/* Visual properties text (including strings) may have. */
308extern Lisp_Object Qforeground, Qbackground, Qfont, Qunderline, Qstipple; 304extern Lisp_Object Qfont;
309extern Lisp_Object Qinvisible, Qintangible, Qread_only; 305extern Lisp_Object Qinvisible, Qintangible;
310 306
311/* Sticky properties */ 307/* Sticky properties */
312extern Lisp_Object Qfront_sticky, Qrear_nonsticky; 308extern Lisp_Object Qfront_sticky, Qrear_nonsticky;
@@ -315,10 +311,10 @@ EXFUN (Fget_char_property, 3);
315EXFUN (Fget_text_property, 3); 311EXFUN (Fget_text_property, 3);
316EXFUN (Ftext_properties_at, 2); 312EXFUN (Ftext_properties_at, 2);
317EXFUN (Fnext_property_change, 3); 313EXFUN (Fnext_property_change, 3);
318EXFUN (Fprevious_property_change, 3);
319EXFUN (Fadd_text_properties, 4); 314EXFUN (Fadd_text_properties, 4);
320EXFUN (Fset_text_properties, 4); 315EXFUN (Fset_text_properties, 4);
321EXFUN (Fremove_text_properties, 4); 316EXFUN (Fremove_text_properties, 4);
317EXFUN (Fremove_list_of_text_properties, 4);
322EXFUN (Ftext_property_any, 5); 318EXFUN (Ftext_property_any, 5);
323EXFUN (Fprevious_single_char_property_change, 4); 319EXFUN (Fprevious_single_char_property_change, 4);
324extern Lisp_Object copy_text_properties (Lisp_Object, Lisp_Object, 320extern Lisp_Object copy_text_properties (Lisp_Object, Lisp_Object,
diff --git a/src/keyboard.c b/src/keyboard.c
index a73f6656cd2..c0c53c82714 100644
--- a/src/keyboard.c
+++ b/src/keyboard.c
@@ -96,16 +96,25 @@ int pending_signals;
96KBOARD *initial_kboard; 96KBOARD *initial_kboard;
97KBOARD *current_kboard; 97KBOARD *current_kboard;
98KBOARD *all_kboards; 98KBOARD *all_kboards;
99int single_kboard; 99
100/* Nonzero in the single-kboard state, 0 in the any-kboard state. */
101static int single_kboard;
100 102
101/* Non-nil disable property on a command means 103/* Non-nil disable property on a command means
102 do not execute it; call disabled-command-function's value instead. */ 104 do not execute it; call disabled-command-function's value instead. */
103Lisp_Object Qdisabled, Qdisabled_command_function; 105Lisp_Object Qdisabled;
106static Lisp_Object Qdisabled_command_function;
104 107
105#define NUM_RECENT_KEYS (300) 108#define NUM_RECENT_KEYS (300)
106int recent_keys_index; /* Index for storing next element into recent_keys */ 109
107int total_keys; /* Total number of elements stored into recent_keys */ 110/* Index for storing next element into recent_keys. */
108Lisp_Object recent_keys; /* Vector holds the last NUM_RECENT_KEYS keystrokes */ 111static int recent_keys_index;
112
113/* Total number of elements stored into recent_keys. */
114static int total_keys;
115
116/* This vector holds the last NUM_RECENT_KEYS keystrokes. */
117static Lisp_Object recent_keys;
109 118
110/* Vector holding the key sequence that invoked the current command. 119/* Vector holding the key sequence that invoked the current command.
111 It is reused for each command, and it may be longer than the current 120 It is reused for each command, and it may be longer than the current
@@ -117,12 +126,12 @@ int this_command_key_count;
117 126
118/* 1 after calling Freset_this_command_lengths. 127/* 1 after calling Freset_this_command_lengths.
119 Usually it is 0. */ 128 Usually it is 0. */
120int this_command_key_count_reset; 129static int this_command_key_count_reset;
121 130
122/* This vector is used as a buffer to record the events that were actually read 131/* This vector is used as a buffer to record the events that were actually read
123 by read_key_sequence. */ 132 by read_key_sequence. */
124Lisp_Object raw_keybuf; 133static Lisp_Object raw_keybuf;
125int raw_keybuf_count; 134static int raw_keybuf_count;
126 135
127#define GROW_RAW_KEYBUF \ 136#define GROW_RAW_KEYBUF \
128 if (raw_keybuf_count == XVECTOR (raw_keybuf)->size) \ 137 if (raw_keybuf_count == XVECTOR (raw_keybuf)->size) \
@@ -130,7 +139,7 @@ int raw_keybuf_count;
130 139
131/* Number of elements of this_command_keys 140/* Number of elements of this_command_keys
132 that precede this key sequence. */ 141 that precede this key sequence. */
133int this_single_command_key_start; 142static int this_single_command_key_start;
134 143
135/* Record values of this_command_key_count and echo_length () 144/* Record values of this_command_key_count and echo_length ()
136 before this command was read. */ 145 before this command was read. */
@@ -146,7 +155,7 @@ int waiting_for_input;
146 155
147/* True while displaying for echoing. Delays C-g throwing. */ 156/* True while displaying for echoing. Delays C-g throwing. */
148 157
149int echoing; 158static int echoing;
150 159
151/* Non-null means we can start echoing at the next input pause even 160/* Non-null means we can start echoing at the next input pause even
152 though there is something in the echo area. */ 161 though there is something in the echo area. */
@@ -206,19 +215,19 @@ size_t num_input_events;
206 215
207/* Value of num_nonmacro_input_events as of last auto save. */ 216/* Value of num_nonmacro_input_events as of last auto save. */
208 217
209int last_auto_save; 218static int last_auto_save;
210 219
211/* This is like Vthis_command, except that commands never set it. */ 220/* This is like Vthis_command, except that commands never set it. */
212Lisp_Object real_this_command; 221Lisp_Object real_this_command;
213 222
214/* The value of point when the last command was started. */ 223/* The value of point when the last command was started. */
215EMACS_INT last_point_position; 224static EMACS_INT last_point_position;
216 225
217/* The buffer that was current when the last command was started. */ 226/* The buffer that was current when the last command was started. */
218Lisp_Object last_point_position_buffer; 227static Lisp_Object last_point_position_buffer;
219 228
220/* The window that was selected when the last command was started. */ 229/* The window that was selected when the last command was started. */
221Lisp_Object last_point_position_window; 230static Lisp_Object last_point_position_window;
222 231
223/* The frame in which the last input event occurred, or Qmacro if the 232/* The frame in which the last input event occurred, or Qmacro if the
224 last event came from a macro. We use this to determine when to 233 last event came from a macro. We use this to determine when to
@@ -231,39 +240,40 @@ Lisp_Object internal_last_event_frame;
231 X Windows wants this for selection ownership. */ 240 X Windows wants this for selection ownership. */
232unsigned long last_event_timestamp; 241unsigned long last_event_timestamp;
233 242
234Lisp_Object Qx_set_selection, QPRIMARY, Qhandle_switch_frame; 243static Lisp_Object Qx_set_selection, Qhandle_switch_frame;
244Lisp_Object QPRIMARY;
235 245
236Lisp_Object Qself_insert_command; 246static Lisp_Object Qself_insert_command;
237Lisp_Object Qforward_char; 247static Lisp_Object Qforward_char;
238Lisp_Object Qbackward_char; 248static Lisp_Object Qbackward_char;
239Lisp_Object Qundefined; 249Lisp_Object Qundefined;
240Lisp_Object Qtimer_event_handler; 250static Lisp_Object Qtimer_event_handler;
241 251
242/* read_key_sequence stores here the command definition of the 252/* read_key_sequence stores here the command definition of the
243 key sequence that it reads. */ 253 key sequence that it reads. */
244Lisp_Object read_key_sequence_cmd; 254static Lisp_Object read_key_sequence_cmd;
245 255
246Lisp_Object Qinput_method_function; 256static Lisp_Object Qinput_method_function;
247 257
248Lisp_Object Qdeactivate_mark; 258static Lisp_Object Qdeactivate_mark;
249 259
250Lisp_Object Qrecompute_lucid_menubar, Qactivate_menubar_hook; 260Lisp_Object Qrecompute_lucid_menubar, Qactivate_menubar_hook;
251 261
252Lisp_Object Qecho_area_clear_hook; 262static Lisp_Object Qecho_area_clear_hook;
253 263
254/* Hooks to run before and after each command. */ 264/* Hooks to run before and after each command. */
255Lisp_Object Qpre_command_hook; 265static Lisp_Object Qpre_command_hook;
256Lisp_Object Qpost_command_hook; 266static Lisp_Object Qpost_command_hook;
257 267
258Lisp_Object Qdeferred_action_function; 268static Lisp_Object Qdeferred_action_function;
259 269
260Lisp_Object Qinput_method_exit_on_first_char; 270static Lisp_Object Qinput_method_exit_on_first_char;
261Lisp_Object Qinput_method_use_echo_area; 271static Lisp_Object Qinput_method_use_echo_area;
262 272
263Lisp_Object Qhelp_form_show; 273static Lisp_Object Qhelp_form_show;
264 274
265/* File in which we write all commands we read. */ 275/* File in which we write all commands we read. */
266FILE *dribble; 276static FILE *dribble;
267 277
268/* Nonzero if input is available. */ 278/* Nonzero if input is available. */
269int input_pending; 279int input_pending;
@@ -293,42 +303,49 @@ static struct input_event * volatile kbd_store_ptr;
293 at inopportune times. */ 303 at inopportune times. */
294 304
295/* Symbols to head events. */ 305/* Symbols to head events. */
296Lisp_Object Qmouse_movement; 306static Lisp_Object Qmouse_movement;
297Lisp_Object Qscroll_bar_movement; 307static Lisp_Object Qscroll_bar_movement;
298Lisp_Object Qswitch_frame; 308Lisp_Object Qswitch_frame;
299Lisp_Object Qdelete_frame; 309static Lisp_Object Qdelete_frame;
300Lisp_Object Qiconify_frame; 310static Lisp_Object Qiconify_frame;
301Lisp_Object Qmake_frame_visible; 311static Lisp_Object Qmake_frame_visible;
302Lisp_Object Qselect_window; 312static Lisp_Object Qselect_window;
303Lisp_Object Qhelp_echo; 313Lisp_Object Qhelp_echo;
304 314
305#if defined (HAVE_MOUSE) || defined (HAVE_GPM) 315#if defined (HAVE_MOUSE) || defined (HAVE_GPM)
306Lisp_Object Qmouse_fixup_help_message; 316static Lisp_Object Qmouse_fixup_help_message;
307#endif 317#endif
308 318
309/* Symbols to denote kinds of events. */ 319/* Symbols to denote kinds of events. */
310Lisp_Object Qfunction_key; 320static Lisp_Object Qfunction_key;
311Lisp_Object Qmouse_click; 321Lisp_Object Qmouse_click;
312#if defined (WINDOWSNT) 322#if defined (WINDOWSNT)
313Lisp_Object Qlanguage_change; 323Lisp_Object Qlanguage_change;
314#endif 324#endif
315Lisp_Object Qdrag_n_drop; 325static Lisp_Object Qdrag_n_drop;
316Lisp_Object Qsave_session; 326static Lisp_Object Qsave_session;
317#ifdef HAVE_DBUS 327#ifdef HAVE_DBUS
318Lisp_Object Qdbus_event; 328static Lisp_Object Qdbus_event;
319#endif 329#endif
320Lisp_Object Qconfig_changed_event; 330static Lisp_Object Qconfig_changed_event;
321 331
322/* Lisp_Object Qmouse_movement; - also an event header */ 332/* Lisp_Object Qmouse_movement; - also an event header */
323 333
324/* Properties of event headers. */ 334/* Properties of event headers. */
325Lisp_Object Qevent_kind; 335Lisp_Object Qevent_kind;
326Lisp_Object Qevent_symbol_elements; 336static Lisp_Object Qevent_symbol_elements;
327 337
328/* menu and tool bar item parts */ 338/* menu and tool bar item parts */
329Lisp_Object Qmenu_enable; 339static Lisp_Object Qmenu_enable;
330Lisp_Object QCenable, QCvisible, QChelp, QCfilter, QCkeys, QCkey_sequence; 340static Lisp_Object QCenable, QCvisible, QChelp, QCkeys, QCkey_sequence;
331Lisp_Object QCbutton, QCtoggle, QCradio, QClabel, QCvert_only; 341Lisp_Object QCfilter;
342
343/* Non-nil disable property on a command means
344 do not execute it; call disabled-command-function's value instead. */
345Lisp_Object QCtoggle, QCradio;
346static Lisp_Object QCbutton, QClabel;
347
348static Lisp_Object QCvert_only;
332 349
333/* An event header symbol HEAD may have a property named 350/* An event header symbol HEAD may have a property named
334 Qevent_symbol_element_mask, which is of the form (BASE MODIFIERS); 351 Qevent_symbol_element_mask, which is of the form (BASE MODIFIERS);
@@ -341,23 +358,24 @@ Lisp_Object Qevent_symbol_element_mask;
341 Qmodifier_cache, which is an alist mapping modifier masks onto 358 Qmodifier_cache, which is an alist mapping modifier masks onto
342 modified versions of BASE. If present, this helps speed up 359 modified versions of BASE. If present, this helps speed up
343 apply_modifiers. */ 360 apply_modifiers. */
344Lisp_Object Qmodifier_cache; 361static Lisp_Object Qmodifier_cache;
345 362
346/* Symbols to use for parts of windows. */ 363/* Symbols to use for parts of windows. */
347Lisp_Object Qmode_line; 364Lisp_Object Qmode_line;
348Lisp_Object Qvertical_line; 365Lisp_Object Qvertical_line;
349Lisp_Object Qvertical_scroll_bar; 366static Lisp_Object Qvertical_scroll_bar;
350Lisp_Object Qmenu_bar; 367Lisp_Object Qmenu_bar;
351 368
352Lisp_Object recursive_edit_unwind (Lisp_Object buffer), command_loop (void); 369static Lisp_Object recursive_edit_unwind (Lisp_Object buffer);
353Lisp_Object Fthis_command_keys (void); 370static Lisp_Object command_loop (void);
354Lisp_Object Qextended_command_history; 371static Lisp_Object Qextended_command_history;
355EMACS_TIME timer_check (void); 372EMACS_TIME timer_check (void);
356 373
357static void record_menu_key (Lisp_Object c); 374static void record_menu_key (Lisp_Object c);
375static void echo_now (void);
358static int echo_length (void); 376static int echo_length (void);
359 377
360Lisp_Object Qpolling_period; 378static Lisp_Object Qpolling_period;
361 379
362/* Incremented whenever a timer is run. */ 380/* Incremented whenever a timer is run. */
363int timers_run; 381int timers_run;
@@ -410,7 +428,7 @@ static EMACS_TIME timer_last_idleness_start_time;
410#define READABLE_EVENTS_IGNORE_SQUEEZABLES (1 << 2) 428#define READABLE_EVENTS_IGNORE_SQUEEZABLES (1 << 2)
411 429
412/* Function for init_keyboard to call with no args (if nonzero). */ 430/* Function for init_keyboard to call with no args (if nonzero). */
413void (*keyboard_init_hook) (void); 431static void (*keyboard_init_hook) (void);
414 432
415static int read_avail_input (int); 433static int read_avail_input (int);
416static void get_input_pending (int *, int); 434static void get_input_pending (int *, int);
@@ -430,6 +448,7 @@ static Lisp_Object modify_event_symbol (EMACS_INT, unsigned, Lisp_Object,
430 Lisp_Object, const char *const *, 448 Lisp_Object, const char *const *,
431 Lisp_Object *, unsigned); 449 Lisp_Object *, unsigned);
432static Lisp_Object make_lispy_switch_frame (Lisp_Object); 450static Lisp_Object make_lispy_switch_frame (Lisp_Object);
451static int help_char_p (Lisp_Object);
433static void save_getcjmp (jmp_buf); 452static void save_getcjmp (jmp_buf);
434static void restore_getcjmp (jmp_buf); 453static void restore_getcjmp (jmp_buf);
435static Lisp_Object apply_modifiers (int, Lisp_Object); 454static Lisp_Object apply_modifiers (int, Lisp_Object);
@@ -439,7 +458,10 @@ static void interrupt_signal (int signalnum);
439#ifdef SIGIO 458#ifdef SIGIO
440static void input_available_signal (int signo); 459static void input_available_signal (int signo);
441#endif 460#endif
461static Lisp_Object (Fcommand_execute) (Lisp_Object, Lisp_Object, Lisp_Object,
462 Lisp_Object);
442static void handle_interrupt (void); 463static void handle_interrupt (void);
464static void quit_throw_to_read_char (void) NO_RETURN;
443static void timer_start_idle (void); 465static void timer_start_idle (void);
444static void timer_stop_idle (void); 466static void timer_stop_idle (void);
445static void timer_resume_idle (void); 467static void timer_resume_idle (void);
@@ -583,7 +605,7 @@ echo_dash (void)
583/* Display the current echo string, and begin echoing if not already 605/* Display the current echo string, and begin echoing if not already
584 doing so. */ 606 doing so. */
585 607
586void 608static void
587echo_now (void) 609echo_now (void)
588{ 610{
589 if (!current_kboard->immediate_echo) 611 if (!current_kboard->immediate_echo)
@@ -750,6 +772,7 @@ record_auto_save (void)
750 772
751/* Make an auto save happen as soon as possible at command level. */ 773/* Make an auto save happen as soon as possible at command level. */
752 774
775#ifdef SIGDANGER
753void 776void
754force_auto_save_soon (void) 777force_auto_save_soon (void)
755{ 778{
@@ -757,6 +780,7 @@ force_auto_save_soon (void)
757 780
758 record_asynch_buffer_change (); 781 record_asynch_buffer_change ();
759} 782}
783#endif
760 784
761DEFUN ("recursive-edit", Frecursive_edit, Srecursive_edit, 0, 0, "", 785DEFUN ("recursive-edit", Frecursive_edit, Srecursive_edit, 0, 0, "",
762 doc: /* Invoke the editor command loop recursively. 786 doc: /* Invoke the editor command loop recursively.
@@ -1079,8 +1103,8 @@ cmd_error_internal (Lisp_Object data, const char *context)
1079} 1103}
1080 1104
1081Lisp_Object command_loop_1 (void); 1105Lisp_Object command_loop_1 (void);
1082Lisp_Object command_loop_2 (Lisp_Object); 1106static Lisp_Object command_loop_2 (Lisp_Object);
1083Lisp_Object top_level_1 (Lisp_Object); 1107static Lisp_Object top_level_1 (Lisp_Object);
1084 1108
1085/* Entry to editor-command-loop. 1109/* Entry to editor-command-loop.
1086 This level has the catches for exiting/returning to editor command loop. 1110 This level has the catches for exiting/returning to editor command loop.
@@ -1170,7 +1194,7 @@ This also exits all active minibuffers. */)
1170 Fthrow (Qtop_level, Qnil); 1194 Fthrow (Qtop_level, Qnil);
1171} 1195}
1172 1196
1173Lisp_Object Fexit_recursive_edit (void) NO_RETURN; 1197static Lisp_Object Fexit_recursive_edit (void) NO_RETURN;
1174DEFUN ("exit-recursive-edit", Fexit_recursive_edit, Sexit_recursive_edit, 0, 0, "", 1198DEFUN ("exit-recursive-edit", Fexit_recursive_edit, Sexit_recursive_edit, 0, 0, "",
1175 doc: /* Exit from the innermost recursive edit or minibuffer. */) 1199 doc: /* Exit from the innermost recursive edit or minibuffer. */)
1176 (void) 1200 (void)
@@ -1181,7 +1205,7 @@ DEFUN ("exit-recursive-edit", Fexit_recursive_edit, Sexit_recursive_edit, 0, 0,
1181 error ("No recursive edit is in progress"); 1205 error ("No recursive edit is in progress");
1182} 1206}
1183 1207
1184Lisp_Object Fabort_recursive_edit (void) NO_RETURN; 1208static Lisp_Object Fabort_recursive_edit (void) NO_RETURN;
1185DEFUN ("abort-recursive-edit", Fabort_recursive_edit, Sabort_recursive_edit, 0, 0, "", 1209DEFUN ("abort-recursive-edit", Fabort_recursive_edit, Sabort_recursive_edit, 0, 0, "",
1186 doc: /* Abort the command that requested this recursive edit or minibuffer input. */) 1210 doc: /* Abort the command that requested this recursive edit or minibuffer input. */)
1187 (void) 1211 (void)
@@ -1244,6 +1268,9 @@ usage: (track-mouse BODY...) */)
1244 If ignore_mouse_drag_p is non-zero, ignore (implicit) mouse movement 1268 If ignore_mouse_drag_p is non-zero, ignore (implicit) mouse movement
1245 after resizing the tool-bar window. */ 1269 after resizing the tool-bar window. */
1246 1270
1271#if !defined HAVE_WINDOW_SYSTEM || defined USE_GTK || defined HAVE_NS
1272static
1273#endif
1247int ignore_mouse_drag_p; 1274int ignore_mouse_drag_p;
1248 1275
1249static FRAME_PTR 1276static FRAME_PTR
@@ -1901,7 +1928,7 @@ int poll_suppress_count;
1901 1928
1902/* Asynchronous timer for polling. */ 1929/* Asynchronous timer for polling. */
1903 1930
1904struct atimer *poll_timer; 1931static struct atimer *poll_timer;
1905 1932
1906 1933
1907#ifdef POLL_FOR_INPUT 1934#ifdef POLL_FOR_INPUT
@@ -2168,7 +2195,6 @@ show_help_echo (Lisp_Object help, Lisp_Object window, Lisp_Object object,
2168 2195
2169/* Input of single characters from keyboard */ 2196/* Input of single characters from keyboard */
2170 2197
2171Lisp_Object print_help (Lisp_Object object);
2172static Lisp_Object kbd_buffer_get_event (KBOARD **kbp, int *used_mouse_menu, 2198static Lisp_Object kbd_buffer_get_event (KBOARD **kbp, int *used_mouse_menu,
2173 struct timeval *end_time); 2199 struct timeval *end_time);
2174static void record_char (Lisp_Object c); 2200static void record_char (Lisp_Object c);
@@ -3162,7 +3188,7 @@ record_menu_key (Lisp_Object c)
3162 3188
3163/* Return 1 if should recognize C as "the help character". */ 3189/* Return 1 if should recognize C as "the help character". */
3164 3190
3165int 3191static int
3166help_char_p (Lisp_Object c) 3192help_char_p (Lisp_Object c)
3167{ 3193{
3168 Lisp_Object tail; 3194 Lisp_Object tail;
@@ -3311,17 +3337,6 @@ record_char (Lisp_Object c)
3311 } 3337 }
3312} 3338}
3313 3339
3314Lisp_Object
3315print_help (Lisp_Object object)
3316{
3317 struct buffer *old = current_buffer;
3318 Fprinc (object, Qnil);
3319 set_buffer_internal (XBUFFER (Vstandard_output));
3320 call0 (intern ("help-mode"));
3321 set_buffer_internal (old);
3322 return Qnil;
3323}
3324
3325/* Copy out or in the info on where C-g should throw to. 3340/* Copy out or in the info on where C-g should throw to.
3326 This is used when running Lisp code from within get_char, 3341 This is used when running Lisp code from within get_char,
3327 in case get_char is called recursively. 3342 in case get_char is called recursively.
@@ -3413,7 +3428,7 @@ readable_events (int flags)
3413} 3428}
3414 3429
3415/* Set this for debugging, to have a way to get out */ 3430/* Set this for debugging, to have a way to get out */
3416int stop_character; 3431int stop_character EXTERNALLY_VISIBLE;
3417 3432
3418static KBOARD * 3433static KBOARD *
3419event_to_kboard (struct input_event *event) 3434event_to_kboard (struct input_event *event)
@@ -4209,7 +4224,7 @@ timer_resume_idle (void)
4209} 4224}
4210 4225
4211/* This is only for debugging. */ 4226/* This is only for debugging. */
4212struct input_event last_timer_event; 4227struct input_event last_timer_event EXTERNALLY_VISIBLE;
4213 4228
4214/* List of elisp functions to call, delayed because they were generated in 4229/* List of elisp functions to call, delayed because they were generated in
4215 a context where Elisp could not be safely run (e.g. redisplay, signal, 4230 a context where Elisp could not be safely run (e.g. redisplay, signal,
@@ -5017,7 +5032,7 @@ static const char *const iso_lispy_function_keys[] =
5017 5032
5018#endif /* not HAVE_NTGUI */ 5033#endif /* not HAVE_NTGUI */
5019 5034
5020Lisp_Object Vlispy_mouse_stem; 5035static Lisp_Object Vlispy_mouse_stem;
5021 5036
5022static const char *const lispy_wheel_names[] = 5037static const char *const lispy_wheel_names[] =
5023{ 5038{
@@ -5032,9 +5047,11 @@ static const char *const lispy_drag_n_drop_names[] =
5032}; 5047};
5033 5048
5034/* Scroll bar parts. */ 5049/* Scroll bar parts. */
5035Lisp_Object Qabove_handle, Qhandle, Qbelow_handle; 5050static Lisp_Object Qabove_handle, Qhandle, Qbelow_handle;
5036Lisp_Object Qup, Qdown, Qbottom, Qend_scroll; 5051Lisp_Object Qup, Qdown, Qbottom;
5037Lisp_Object Qtop, Qratio; 5052static Lisp_Object Qend_scroll;
5053Lisp_Object Qtop;
5054static Lisp_Object Qratio;
5038 5055
5039/* An array of scroll bar parts, indexed by an enum scroll_bar_part value. */ 5056/* An array of scroll bar parts, indexed by an enum scroll_bar_part value. */
5040static Lisp_Object *const scroll_bar_parts[] = { 5057static Lisp_Object *const scroll_bar_parts[] = {
@@ -5065,7 +5082,7 @@ static unsigned long button_down_time;
5065 5082
5066/* The number of clicks in this multiple-click. */ 5083/* The number of clicks in this multiple-click. */
5067 5084
5068int double_click_count; 5085static int double_click_count;
5069 5086
5070/* X and Y are frame-relative coordinates for a click or wheel event. 5087/* X and Y are frame-relative coordinates for a click or wheel event.
5071 Return a Lisp-style event list. */ 5088 Return a Lisp-style event list. */
@@ -7889,8 +7906,8 @@ static int ntool_bar_items;
7889 7906
7890/* The symbols `:image' and `:rtl'. */ 7907/* The symbols `:image' and `:rtl'. */
7891 7908
7892Lisp_Object QCimage; 7909static Lisp_Object QCimage;
7893Lisp_Object Qrtl; 7910static Lisp_Object Qrtl;
7894 7911
7895/* Function prototypes. */ 7912/* Function prototypes. */
7896 7913
@@ -10934,7 +10951,7 @@ handle_interrupt (void)
10934 10951
10935/* Handle a C-g by making read_char return C-g. */ 10952/* Handle a C-g by making read_char return C-g. */
10936 10953
10937void 10954static void
10938quit_throw_to_read_char (void) 10955quit_throw_to_read_char (void)
10939{ 10956{
10940 sigfree (); 10957 sigfree ();
@@ -10962,7 +10979,8 @@ quit_throw_to_read_char (void)
10962 _longjmp (getcjmp, 1); 10979 _longjmp (getcjmp, 1);
10963} 10980}
10964 10981
10965DEFUN ("set-input-interrupt-mode", Fset_input_interrupt_mode, Sset_input_interrupt_mode, 1, 1, 0, 10982DEFUN ("set-input-interrupt-mode", Fset_input_interrupt_mode,
10983 Sset_input_interrupt_mode, 1, 1, 0,
10966 doc: /* Set interrupt mode of reading keyboard input. 10984 doc: /* Set interrupt mode of reading keyboard input.
10967If INTERRUPT is non-nil, Emacs will use input interrupts; 10985If INTERRUPT is non-nil, Emacs will use input interrupts;
10968otherwise Emacs uses CBREAK mode. 10986otherwise Emacs uses CBREAK mode.
diff --git a/src/keyboard.h b/src/keyboard.h
index 72bb821b2eb..1f5cbd23639 100644
--- a/src/keyboard.h
+++ b/src/keyboard.h
@@ -190,9 +190,6 @@ extern KBOARD *current_kboard;
190 190
191/* A list of all kboard objects, linked through next_kboard. */ 191/* A list of all kboard objects, linked through next_kboard. */
192extern KBOARD *all_kboards; 192extern KBOARD *all_kboards;
193
194/* Nonzero in the single-kboard state, 0 in the any-kboard state. */
195extern int single_kboard;
196 193
197/* Total number of times read_char has returned, modulo SIZE_MAX + 1. */ 194/* Total number of times read_char has returned, modulo SIZE_MAX + 1. */
198extern size_t num_input_events; 195extern size_t num_input_events;
@@ -408,15 +405,10 @@ typedef struct _widget_value
408extern Lisp_Object Qswitch_frame; 405extern Lisp_Object Qswitch_frame;
409 406
410/* Properties on event heads. */ 407/* Properties on event heads. */
411extern Lisp_Object Qevent_kind, Qevent_symbol_elements; 408extern Lisp_Object Qevent_kind;
412
413/* Getting an unmodified version of an event head. */
414#define EVENT_HEAD_UNMODIFIED(event_head) \
415 (Fcar (Fget ((event_head), Qevent_symbol_elements)))
416 409
417/* The values of Qevent_kind properties. */ 410/* The values of Qevent_kind properties. */
418extern Lisp_Object Qfunction_key, Qmouse_click, Qmouse_movement; 411extern Lisp_Object Qmouse_click;
419extern Lisp_Object Qscroll_bar_movement;
420 412
421extern Lisp_Object Qhelp_echo; 413extern Lisp_Object Qhelp_echo;
422 414
@@ -434,7 +426,9 @@ extern int waiting_for_input;
434 happens. */ 426 happens. */
435extern EMACS_TIME *input_available_clear_time; 427extern EMACS_TIME *input_available_clear_time;
436 428
429#if defined HAVE_WINDOW_SYSTEM && !defined USE_GTK && !defined HAVE_NS
437extern int ignore_mouse_drag_p; 430extern int ignore_mouse_drag_p;
431#endif
438 432
439/* The primary selection. */ 433/* The primary selection. */
440extern Lisp_Object QPRIMARY; 434extern Lisp_Object QPRIMARY;
@@ -454,9 +448,7 @@ extern Lisp_Object real_this_command;
454 448
455/* Non-nil disable property on a command means 449/* Non-nil disable property on a command means
456 do not execute it; call disabled-command-function's value instead. */ 450 do not execute it; call disabled-command-function's value instead. */
457extern Lisp_Object QCbutton, QCtoggle, QCradio, QClabel; 451extern Lisp_Object QCtoggle, QCradio;
458
459extern Lisp_Object Qinput_method_function;
460 452
461/* An event header symbol HEAD may have a property named 453/* An event header symbol HEAD may have a property named
462 Qevent_symbol_element_mask, which is of the form (BASE MODIFIERS); 454 Qevent_symbol_element_mask, which is of the form (BASE MODIFIERS);
@@ -476,7 +468,6 @@ extern int timers_run;
476extern int menu_separator_name_p (const char *); 468extern int menu_separator_name_p (const char *);
477extern int parse_menu_item (Lisp_Object, int); 469extern int parse_menu_item (Lisp_Object, int);
478 470
479extern void echo_now (void);
480extern void init_kboard (KBOARD *); 471extern void init_kboard (KBOARD *);
481extern void delete_kboard (KBOARD *); 472extern void delete_kboard (KBOARD *);
482extern void not_single_kboard_state (KBOARD *); 473extern void not_single_kboard_state (KBOARD *);
@@ -498,8 +489,6 @@ extern int make_ctrl_char (int);
498extern void stuff_buffered_input (Lisp_Object); 489extern void stuff_buffered_input (Lisp_Object);
499extern void clear_waiting_for_input (void); 490extern void clear_waiting_for_input (void);
500extern void swallow_events (int); 491extern void swallow_events (int);
501extern int help_char_p (Lisp_Object);
502extern void quit_throw_to_read_char (void) NO_RETURN;
503extern int lucid_event_type_list_p (Lisp_Object); 492extern int lucid_event_type_list_p (Lisp_Object);
504extern void kbd_buffer_store_event (struct input_event *); 493extern void kbd_buffer_store_event (struct input_event *);
505extern void kbd_buffer_store_event_hold (struct input_event *, 494extern void kbd_buffer_store_event_hold (struct input_event *,
diff --git a/src/keymap.c b/src/keymap.c
index 10000b935aa..8713bcf1279 100644
--- a/src/keymap.c
+++ b/src/keymap.c
@@ -56,8 +56,9 @@ Lisp_Object control_x_map; /* The keymap used for globally bound
56 56
57/* keymap used for minibuffers when doing completion */ 57/* keymap used for minibuffers when doing completion */
58/* keymap used for minibuffers when doing completion and require a match */ 58/* keymap used for minibuffers when doing completion and require a match */
59Lisp_Object Qkeymapp, Qkeymap, Qnon_ascii, Qmenu_item, Qremap; 59static Lisp_Object Qkeymapp, Qnon_ascii;
60Lisp_Object QCadvertised_binding; 60Lisp_Object Qkeymap, Qmenu_item, Qremap;
61static Lisp_Object QCadvertised_binding;
61 62
62/* Alist of elements like (DEL . "\d"). */ 63/* Alist of elements like (DEL . "\d"). */
63static Lisp_Object exclude_keys; 64static Lisp_Object exclude_keys;
@@ -70,6 +71,7 @@ static Lisp_Object where_is_cache;
70/* Which keymaps are reverse-stored in the cache. */ 71/* Which keymaps are reverse-stored in the cache. */
71static Lisp_Object where_is_cache_keymaps; 72static Lisp_Object where_is_cache_keymaps;
72 73
74static Lisp_Object Flookup_key (Lisp_Object, Lisp_Object, Lisp_Object);
73static Lisp_Object store_in_keymap (Lisp_Object, Lisp_Object, Lisp_Object); 75static Lisp_Object store_in_keymap (Lisp_Object, Lisp_Object, Lisp_Object);
74static void fix_submap_inheritance (Lisp_Object, Lisp_Object, Lisp_Object); 76static void fix_submap_inheritance (Lisp_Object, Lisp_Object, Lisp_Object);
75 77
@@ -658,7 +660,7 @@ map_keymap (Lisp_Object map, map_keymap_function_t fun, Lisp_Object args, void *
658 UNGCPRO; 660 UNGCPRO;
659} 661}
660 662
661Lisp_Object Qkeymap_canonicalize; 663static Lisp_Object Qkeymap_canonicalize;
662 664
663/* Same as map_keymap, but does it right, properly eliminating duplicate 665/* Same as map_keymap, but does it right, properly eliminating duplicate
664 bindings due to inheritance. */ 666 bindings due to inheritance. */
@@ -955,7 +957,7 @@ store_in_keymap (Lisp_Object keymap, register Lisp_Object idx, Lisp_Object def)
955 return def; 957 return def;
956} 958}
957 959
958EXFUN (Fcopy_keymap, 1); 960static Lisp_Object Fcopy_keymap (Lisp_Object);
959 961
960static Lisp_Object 962static Lisp_Object
961copy_keymap_item (Lisp_Object elt) 963copy_keymap_item (Lisp_Object elt)
@@ -2174,7 +2176,7 @@ then the value includes only maps for prefixes that start with PREFIX. */)
2174 } 2176 }
2175 return maps; 2177 return maps;
2176} 2178}
2177Lisp_Object Qsingle_key_description, Qkey_description; 2179static Lisp_Object Qsingle_key_description, Qkey_description;
2178 2180
2179/* This function cannot GC. */ 2181/* This function cannot GC. */
2180 2182
diff --git a/src/keymap.h b/src/keymap.h
index 38c6e986784..2b9d58b39dc 100644
--- a/src/keymap.h
+++ b/src/keymap.h
@@ -27,7 +27,6 @@ extern Lisp_Object current_global_map;
27EXFUN (Fmake_sparse_keymap, 1); 27EXFUN (Fmake_sparse_keymap, 1);
28EXFUN (Fkeymap_prompt, 1); 28EXFUN (Fkeymap_prompt, 1);
29EXFUN (Fdefine_key, 3); 29EXFUN (Fdefine_key, 3);
30EXFUN (Flookup_key, 3);
31EXFUN (Fcommand_remapping, 3); 30EXFUN (Fcommand_remapping, 3);
32EXFUN (Fkey_binding, 4); 31EXFUN (Fkey_binding, 4);
33EXFUN (Fkey_description, 2); 32EXFUN (Fkey_description, 2);
@@ -53,4 +52,3 @@ extern void map_keymap_canonical (Lisp_Object map,
53 Lisp_Object args, void *data); 52 Lisp_Object args, void *data);
54 53
55#endif 54#endif
56
diff --git a/src/lisp.h b/src/lisp.h
index ae8f3c793c5..3e5d1fcc695 100644
--- a/src/lisp.h
+++ b/src/lisp.h
@@ -55,11 +55,11 @@ extern void check_cons_list (void);
55#endif 55#endif
56 56
57/* Extra internal type checking? */ 57/* Extra internal type checking? */
58extern int suppress_checking;
59extern void die (const char *, const char *, int) NO_RETURN;
60 58
61#ifdef ENABLE_CHECKING 59#ifdef ENABLE_CHECKING
62 60
61extern void die (const char *, const char *, int) NO_RETURN;
62
63/* The suppress_checking variable is initialized to 0 in alloc.c. Set 63/* The suppress_checking variable is initialized to 0 in alloc.c. Set
64 it to 1 using a debugger to temporarily disable aborting on 64 it to 1 using a debugger to temporarily disable aborting on
65 detected internal inconsistencies or error conditions. 65 detected internal inconsistencies or error conditions.
@@ -74,6 +74,8 @@ extern void die (const char *, const char *, int) NO_RETURN;
74 STRINGP (x), but a particular use of XSTRING is invoked only after 74 STRINGP (x), but a particular use of XSTRING is invoked only after
75 testing that STRINGP (x) is true, making the test redundant. */ 75 testing that STRINGP (x) is true, making the test redundant. */
76 76
77extern int suppress_checking EXTERNALLY_VISIBLE;
78
77#define CHECK(check,msg) (((check) || suppress_checking \ 79#define CHECK(check,msg) (((check) || suppress_checking \
78 ? (void) 0 \ 80 ? (void) 0 \
79 : die ((msg), __FILE__, __LINE__)), \ 81 : die ((msg), __FILE__, __LINE__)), \
@@ -1805,9 +1807,9 @@ typedef struct {
1805 1807
1806/* This version of DEFUN declares a function prototype with the right 1808/* This version of DEFUN declares a function prototype with the right
1807 arguments, so we can catch errors with maxargs at compile-time. */ 1809 arguments, so we can catch errors with maxargs at compile-time. */
1808#define DEFUN(lname, fnname, sname, minargs, maxargs, intspec, doc) \ 1810#define DEFUN(lname, fnname, sname, minargs, maxargs, intspec, doc) \
1809 Lisp_Object fnname DEFUN_ARGS_ ## maxargs ; \ 1811 Lisp_Object fnname DEFUN_ARGS_ ## maxargs ; \
1810 DECL_ALIGN (struct Lisp_Subr, sname) = \ 1812 static DECL_ALIGN (struct Lisp_Subr, sname) = \
1811 { PVEC_SUBR | (sizeof (struct Lisp_Subr) / sizeof (EMACS_INT)), \ 1813 { PVEC_SUBR | (sizeof (struct Lisp_Subr) / sizeof (EMACS_INT)), \
1812 { .a ## maxargs = fnname }, \ 1814 { .a ## maxargs = fnname }, \
1813 minargs, maxargs, lname, intspec, 0}; \ 1815 minargs, maxargs, lname, intspec, 0}; \
@@ -1964,8 +1966,6 @@ struct handler
1964 struct handler *next; 1966 struct handler *next;
1965 }; 1967 };
1966 1968
1967extern struct handler *handlerlist;
1968
1969/* This structure helps implement the `catch' and `throw' control 1969/* This structure helps implement the `catch' and `throw' control
1970 structure. A struct catchtag contains all the information needed 1970 structure. A struct catchtag contains all the information needed
1971 to restore the state of the interpreter after a non-local jump. 1971 to restore the state of the interpreter after a non-local jump.
@@ -2001,9 +2001,6 @@ struct catchtag
2001 struct byte_stack *byte_stack; 2001 struct byte_stack *byte_stack;
2002}; 2002};
2003 2003
2004extern struct catchtag *catchlist;
2005extern struct backtrace *backtrace_list;
2006
2007extern Lisp_Object memory_signal_data; 2004extern Lisp_Object memory_signal_data;
2008 2005
2009/* An address near the bottom of the stack. 2006/* An address near the bottom of the stack.
@@ -2051,8 +2048,8 @@ extern int pending_signals;
2051 2048
2052#define QUITP (!NILP (Vquit_flag) && NILP (Vinhibit_quit)) 2049#define QUITP (!NILP (Vquit_flag) && NILP (Vinhibit_quit))
2053 2050
2054extern Lisp_Object Vascii_downcase_table, Vascii_upcase_table; 2051extern Lisp_Object Vascii_downcase_table;
2055extern Lisp_Object Vascii_canon_table, Vascii_eqv_table; 2052extern Lisp_Object Vascii_canon_table;
2056 2053
2057/* Number of bytes of structure consed since last GC. */ 2054/* Number of bytes of structure consed since last GC. */
2058 2055
@@ -2285,22 +2282,22 @@ struct window;
2285struct frame; 2282struct frame;
2286 2283
2287/* Defined in data.c. */ 2284/* Defined in data.c. */
2288extern Lisp_Object Qnil, Qt, Qquote, Qlambda, Qsubr, Qunbound; 2285extern Lisp_Object Qnil, Qt, Qquote, Qlambda, Qunbound;
2289extern Lisp_Object Qerror_conditions, Qerror_message, Qtop_level; 2286extern Lisp_Object Qerror_conditions, Qerror_message, Qtop_level;
2290extern Lisp_Object Qerror, Qquit, Qwrong_type_argument, Qargs_out_of_range; 2287extern Lisp_Object Qerror, Qquit, Qargs_out_of_range;
2291extern Lisp_Object Qvoid_variable, Qvoid_function; 2288extern Lisp_Object Qvoid_variable, Qvoid_function;
2292extern Lisp_Object Qsetting_constant, Qinvalid_read_syntax; 2289extern Lisp_Object Qinvalid_read_syntax;
2293extern Lisp_Object Qinvalid_function, Qwrong_number_of_arguments, Qno_catch; 2290extern Lisp_Object Qinvalid_function, Qwrong_number_of_arguments, Qno_catch;
2294extern Lisp_Object Qend_of_file, Qarith_error, Qmark_inactive; 2291extern Lisp_Object Qend_of_file, Qarith_error, Qmark_inactive;
2295extern Lisp_Object Qbeginning_of_buffer, Qend_of_buffer, Qbuffer_read_only; 2292extern Lisp_Object Qbeginning_of_buffer, Qend_of_buffer, Qbuffer_read_only;
2296extern Lisp_Object Qtext_read_only; 2293extern Lisp_Object Qtext_read_only;
2297extern Lisp_Object Qinteractive_form; 2294extern Lisp_Object Qinteractive_form;
2298extern Lisp_Object Qcircular_list; 2295extern Lisp_Object Qcircular_list;
2299extern Lisp_Object Qintegerp, Qnatnump, Qwholenump, Qsymbolp, Qlistp, Qconsp; 2296extern Lisp_Object Qintegerp, Qwholenump, Qsymbolp, Qlistp, Qconsp;
2300extern Lisp_Object Qstringp, Qarrayp, Qsequencep, Qbufferp; 2297extern Lisp_Object Qstringp, Qarrayp, Qsequencep, Qbufferp;
2301extern Lisp_Object Qchar_or_string_p, Qmarkerp, Qinteger_or_marker_p, Qvectorp; 2298extern Lisp_Object Qchar_or_string_p, Qmarkerp, Qinteger_or_marker_p, Qvectorp;
2302extern Lisp_Object Qbuffer_or_string_p; 2299extern Lisp_Object Qbuffer_or_string_p;
2303extern Lisp_Object Qboundp, Qfboundp; 2300extern Lisp_Object Qfboundp;
2304extern Lisp_Object Qchar_table_p, Qvector_or_char_table_p; 2301extern Lisp_Object Qchar_table_p, Qvector_or_char_table_p;
2305 2302
2306extern Lisp_Object Qcdr; 2303extern Lisp_Object Qcdr;
@@ -2315,7 +2312,6 @@ extern Lisp_Object Qinteger;
2315 2312
2316extern Lisp_Object Qfont_spec, Qfont_entity, Qfont_object; 2313extern Lisp_Object Qfont_spec, Qfont_entity, Qfont_object;
2317 2314
2318extern void circular_list_error (Lisp_Object) NO_RETURN;
2319EXFUN (Finteractive_form, 1); 2315EXFUN (Finteractive_form, 1);
2320EXFUN (Fbyteorder, 0); 2316EXFUN (Fbyteorder, 0);
2321 2317
@@ -2404,7 +2400,6 @@ extern void init_coding_once (void);
2404extern void syms_of_coding (void); 2400extern void syms_of_coding (void);
2405 2401
2406/* Defined in character.c */ 2402/* Defined in character.c */
2407EXFUN (Funibyte_char_to_multibyte, 1);
2408EXFUN (Fchar_width, 1); 2403EXFUN (Fchar_width, 1);
2409EXFUN (Fstring, MANY); 2404EXFUN (Fstring, MANY);
2410extern EMACS_INT chars_in_text (const unsigned char *, EMACS_INT); 2405extern EMACS_INT chars_in_text (const unsigned char *, EMACS_INT);
@@ -2428,7 +2423,6 @@ extern void syms_of_composite (void);
2428EXFUN (Fforward_word, 1); 2423EXFUN (Fforward_word, 1);
2429EXFUN (Fskip_chars_forward, 2); 2424EXFUN (Fskip_chars_forward, 2);
2430EXFUN (Fskip_chars_backward, 2); 2425EXFUN (Fskip_chars_backward, 2);
2431EXFUN (Fsyntax_table_p, 1);
2432extern void init_syntax_once (void); 2426extern void init_syntax_once (void);
2433extern void syms_of_syntax (void); 2427extern void syms_of_syntax (void);
2434 2428
@@ -2526,10 +2520,8 @@ extern void init_fringe_once (void);
2526#endif /* HAVE_WINDOW_SYSTEM */ 2520#endif /* HAVE_WINDOW_SYSTEM */
2527 2521
2528/* Defined in image.c */ 2522/* Defined in image.c */
2529extern Lisp_Object QCascent, QCmargin, QCrelief, Qcount, Qextension_data; 2523extern Lisp_Object QCascent, QCmargin, QCrelief;
2530extern Lisp_Object QCconversion, QCcolor_symbols, QCheuristic_mask; 2524extern Lisp_Object QCconversion;
2531extern Lisp_Object QCindex, QCmatrix, QCcolor_adjustment, QCmask;
2532EXFUN (Finit_image_library, 2);
2533extern int x_bitmap_mask (struct frame *, int); 2525extern int x_bitmap_mask (struct frame *, int);
2534extern void syms_of_image (void); 2526extern void syms_of_image (void);
2535extern void init_image (void); 2527extern void init_image (void);
@@ -2570,12 +2562,7 @@ extern Lisp_Object del_range_2 (EMACS_INT, EMACS_INT,
2570 EMACS_INT, EMACS_INT, int); 2562 EMACS_INT, EMACS_INT, int);
2571extern void modify_region (struct buffer *, EMACS_INT, EMACS_INT, int); 2563extern void modify_region (struct buffer *, EMACS_INT, EMACS_INT, int);
2572extern void prepare_to_modify_buffer (EMACS_INT, EMACS_INT, EMACS_INT *); 2564extern void prepare_to_modify_buffer (EMACS_INT, EMACS_INT, EMACS_INT *);
2573extern void signal_before_change (EMACS_INT, EMACS_INT, EMACS_INT *);
2574extern void signal_after_change (EMACS_INT, EMACS_INT, EMACS_INT); 2565extern void signal_after_change (EMACS_INT, EMACS_INT, EMACS_INT);
2575extern void adjust_after_replace (EMACS_INT, EMACS_INT, Lisp_Object,
2576 EMACS_INT, EMACS_INT);
2577extern void adjust_after_replace_noundo (EMACS_INT, EMACS_INT, EMACS_INT,
2578 EMACS_INT, EMACS_INT, EMACS_INT);
2579extern void adjust_after_insert (EMACS_INT, EMACS_INT, EMACS_INT, 2566extern void adjust_after_insert (EMACS_INT, EMACS_INT, EMACS_INT,
2580 EMACS_INT, EMACS_INT); 2567 EMACS_INT, EMACS_INT);
2581extern void adjust_markers_for_delete (EMACS_INT, EMACS_INT, 2568extern void adjust_markers_for_delete (EMACS_INT, EMACS_INT,
@@ -2599,8 +2586,6 @@ extern void syms_of_display (void);
2599/* Defined in xdisp.c */ 2586/* Defined in xdisp.c */
2600extern Lisp_Object Qinhibit_point_motion_hooks; 2587extern Lisp_Object Qinhibit_point_motion_hooks;
2601extern Lisp_Object Qinhibit_redisplay, Qdisplay; 2588extern Lisp_Object Qinhibit_redisplay, Qdisplay;
2602extern Lisp_Object Qinhibit_eval_during_redisplay;
2603extern Lisp_Object Qmessage_truncate_lines;
2604extern Lisp_Object Qmenu_bar_update_hook; 2589extern Lisp_Object Qmenu_bar_update_hook;
2605extern Lisp_Object Qwindow_scroll_functions; 2590extern Lisp_Object Qwindow_scroll_functions;
2606extern Lisp_Object Qoverriding_local_map, Qoverriding_terminal_local_map; 2591extern Lisp_Object Qoverriding_local_map, Qoverriding_terminal_local_map;
@@ -2615,7 +2600,6 @@ extern Lisp_Object Qrisky_local_variable;
2615extern struct frame *last_glyphless_glyph_frame; 2600extern struct frame *last_glyphless_glyph_frame;
2616extern unsigned last_glyphless_glyph_face_id; 2601extern unsigned last_glyphless_glyph_face_id;
2617extern int last_glyphless_glyph_merged_face_id; 2602extern int last_glyphless_glyph_merged_face_id;
2618extern int message_enable_multibyte;
2619extern int noninteractive_need_newline; 2603extern int noninteractive_need_newline;
2620extern Lisp_Object echo_area_buffer[2]; 2604extern Lisp_Object echo_area_buffer[2];
2621extern void add_to_log (const char *, Lisp_Object, Lisp_Object); 2605extern void add_to_log (const char *, Lisp_Object, Lisp_Object);
@@ -2624,10 +2608,8 @@ extern void setup_echo_area_for_printing (int);
2624extern int push_message (void); 2608extern int push_message (void);
2625extern Lisp_Object pop_message_unwind (Lisp_Object); 2609extern Lisp_Object pop_message_unwind (Lisp_Object);
2626extern Lisp_Object restore_message_unwind (Lisp_Object); 2610extern Lisp_Object restore_message_unwind (Lisp_Object);
2627extern void pop_message (void);
2628extern void restore_message (void); 2611extern void restore_message (void);
2629extern Lisp_Object current_message (void); 2612extern Lisp_Object current_message (void);
2630extern void set_message (const char *s, Lisp_Object, EMACS_INT, int);
2631extern void clear_message (int, int); 2613extern void clear_message (int, int);
2632extern void message (const char *, ...) ATTRIBUTE_FORMAT_PRINTF (1, 2); 2614extern void message (const char *, ...) ATTRIBUTE_FORMAT_PRINTF (1, 2);
2633extern void message1 (const char *); 2615extern void message1 (const char *);
@@ -2642,8 +2624,6 @@ extern void message_log_maybe_newline (void);
2642extern void update_echo_area (void); 2624extern void update_echo_area (void);
2643extern void truncate_echo_area (EMACS_INT); 2625extern void truncate_echo_area (EMACS_INT);
2644extern void redisplay (void); 2626extern void redisplay (void);
2645extern int check_point_in_composition
2646 (struct buffer *, EMACS_INT, struct buffer *, EMACS_INT);
2647extern void redisplay_preserve_echo_area (int); 2627extern void redisplay_preserve_echo_area (int);
2648extern void prepare_menu_bars (void); 2628extern void prepare_menu_bars (void);
2649 2629
@@ -2670,7 +2650,9 @@ extern void memory_full (void) NO_RETURN;
2670extern void buffer_memory_full (void) NO_RETURN; 2650extern void buffer_memory_full (void) NO_RETURN;
2671extern int survives_gc_p (Lisp_Object); 2651extern int survives_gc_p (Lisp_Object);
2672extern void mark_object (Lisp_Object); 2652extern void mark_object (Lisp_Object);
2653#if defined REL_ALLOC && !defined SYSTEM_MALLOC
2673extern void refill_memory_reserve (void); 2654extern void refill_memory_reserve (void);
2655#endif
2674extern const char *pending_malloc_warning; 2656extern const char *pending_malloc_warning;
2675extern Lisp_Object *stack_base; 2657extern Lisp_Object *stack_base;
2676EXFUN (Fcons, 2); 2658EXFUN (Fcons, 2);
@@ -2724,7 +2706,6 @@ extern Lisp_Object make_float (double);
2724extern void display_malloc_warning (void); 2706extern void display_malloc_warning (void);
2725extern int inhibit_garbage_collection (void); 2707extern int inhibit_garbage_collection (void);
2726extern Lisp_Object make_save_value (void *, int); 2708extern Lisp_Object make_save_value (void *, int);
2727extern void free_misc (Lisp_Object);
2728extern void free_marker (Lisp_Object); 2709extern void free_marker (Lisp_Object);
2729extern void free_cons (struct Lisp_Cons *); 2710extern void free_cons (struct Lisp_Cons *);
2730extern void init_alloc_once (void); 2711extern void init_alloc_once (void);
@@ -2760,16 +2741,13 @@ extern void syms_of_chartab (void);
2760/* Defined in print.c */ 2741/* Defined in print.c */
2761extern Lisp_Object Vprin1_to_string_buffer; 2742extern Lisp_Object Vprin1_to_string_buffer;
2762extern void debug_print (Lisp_Object) EXTERNALLY_VISIBLE; 2743extern void debug_print (Lisp_Object) EXTERNALLY_VISIBLE;
2763extern void safe_debug_print (Lisp_Object) EXTERNALLY_VISIBLE;
2764EXFUN (Fprin1, 2); 2744EXFUN (Fprin1, 2);
2765EXFUN (Fprin1_to_string, 2); 2745EXFUN (Fprin1_to_string, 2);
2766EXFUN (Fprinc, 2);
2767EXFUN (Fterpri, 1); 2746EXFUN (Fterpri, 1);
2768EXFUN (Fprint, 2); 2747EXFUN (Fprint, 2);
2769EXFUN (Ferror_message_string, 1); 2748EXFUN (Ferror_message_string, 1);
2770extern Lisp_Object Qstandard_output; 2749extern Lisp_Object Qstandard_output;
2771extern Lisp_Object Qexternal_debugging_output; 2750extern Lisp_Object Qexternal_debugging_output;
2772extern void debug_output_compilation_hack (int);
2773extern void temp_output_buffer_setup (const char *); 2751extern void temp_output_buffer_setup (const char *);
2774extern int print_level; 2752extern int print_level;
2775extern Lisp_Object Qprint_escape_newlines; 2753extern Lisp_Object Qprint_escape_newlines;
@@ -2785,20 +2763,18 @@ extern void syms_of_print (void);
2785/* Defined in lread.c. */ 2763/* Defined in lread.c. */
2786extern Lisp_Object Qvariable_documentation, Qstandard_input; 2764extern Lisp_Object Qvariable_documentation, Qstandard_input;
2787extern Lisp_Object Qbackquote, Qcomma, Qcomma_at, Qcomma_dot, Qfunction; 2765extern Lisp_Object Qbackquote, Qcomma, Qcomma_at, Qcomma_dot, Qfunction;
2788extern Lisp_Object initial_obarray;
2789EXFUN (Fread, 1); 2766EXFUN (Fread, 1);
2790EXFUN (Fread_from_string, 3); 2767EXFUN (Fread_from_string, 3);
2791EXFUN (Fintern, 2); 2768EXFUN (Fintern, 2);
2792EXFUN (Fintern_soft, 2); 2769EXFUN (Fintern_soft, 2);
2770EXFUN (Funintern, 2);
2793EXFUN (Fload, 5); 2771EXFUN (Fload, 5);
2794EXFUN (Fget_load_suffixes, 0); 2772EXFUN (Fget_load_suffixes, 0);
2795EXFUN (Fread_char, 3); 2773EXFUN (Fread_char, 3);
2796EXFUN (Fread_event, 3); 2774EXFUN (Fread_event, 3);
2797EXFUN (Feval_region, 4);
2798extern Lisp_Object check_obarray (Lisp_Object); 2775extern Lisp_Object check_obarray (Lisp_Object);
2799extern Lisp_Object intern (const char *); 2776extern Lisp_Object intern (const char *);
2800extern Lisp_Object intern_c_string (const char *); 2777extern Lisp_Object intern_c_string (const char *);
2801extern Lisp_Object make_symbol (const char *);
2802extern Lisp_Object oblookup (Lisp_Object, const char *, EMACS_INT, EMACS_INT); 2778extern Lisp_Object oblookup (Lisp_Object, const char *, EMACS_INT, EMACS_INT);
2803#define LOADHIST_ATTACH(x) \ 2779#define LOADHIST_ATTACH(x) \
2804 do { \ 2780 do { \
@@ -2818,9 +2794,14 @@ extern void syms_of_lread (void);
2818/* Defined in eval.c. */ 2794/* Defined in eval.c. */
2819extern Lisp_Object Qautoload, Qexit, Qinteractive, Qcommandp, Qdefun, Qmacro; 2795extern Lisp_Object Qautoload, Qexit, Qinteractive, Qcommandp, Qdefun, Qmacro;
2820extern Lisp_Object Qinhibit_quit, Qclosure; 2796extern Lisp_Object Qinhibit_quit, Qclosure;
2797extern Lisp_Object Qand_rest;
2821extern Lisp_Object Vautoload_queue; 2798extern Lisp_Object Vautoload_queue;
2822extern Lisp_Object Vsignaling_function; 2799extern Lisp_Object Vsignaling_function;
2823extern int handling_signal; 2800extern int handling_signal;
2801#if BYTE_MARK_STACK
2802extern struct catchtag *catchlist;
2803extern struct handler *handlerlist;
2804#endif
2824/* To run a normal hook, use the appropriate function from the list below. 2805/* To run a normal hook, use the appropriate function from the list below.
2825 The calling convention: 2806 The calling convention:
2826 2807
@@ -2852,7 +2833,6 @@ EXFUN (Feval, 2);
2852extern Lisp_Object eval_sub (Lisp_Object form); 2833extern Lisp_Object eval_sub (Lisp_Object form);
2853EXFUN (Fapply, MANY); 2834EXFUN (Fapply, MANY);
2854EXFUN (Ffuncall, MANY); 2835EXFUN (Ffuncall, MANY);
2855EXFUN (Fbacktrace, 0);
2856extern Lisp_Object apply1 (Lisp_Object, Lisp_Object); 2836extern Lisp_Object apply1 (Lisp_Object, Lisp_Object);
2857extern Lisp_Object call0 (Lisp_Object); 2837extern Lisp_Object call0 (Lisp_Object);
2858extern Lisp_Object call1 (Lisp_Object, Lisp_Object); 2838extern Lisp_Object call1 (Lisp_Object, Lisp_Object);
@@ -2877,13 +2857,14 @@ extern void verror (const char *, va_list)
2877 NO_RETURN ATTRIBUTE_FORMAT_PRINTF (1, 0); 2857 NO_RETURN ATTRIBUTE_FORMAT_PRINTF (1, 0);
2878extern void do_autoload (Lisp_Object, Lisp_Object); 2858extern void do_autoload (Lisp_Object, Lisp_Object);
2879extern Lisp_Object un_autoload (Lisp_Object); 2859extern Lisp_Object un_autoload (Lisp_Object);
2880EXFUN (Ffetch_bytecode, 1);
2881extern void init_eval_once (void); 2860extern void init_eval_once (void);
2882extern Lisp_Object safe_call (size_t, Lisp_Object *); 2861extern Lisp_Object safe_call (size_t, Lisp_Object *);
2883extern Lisp_Object safe_call1 (Lisp_Object, Lisp_Object); 2862extern Lisp_Object safe_call1 (Lisp_Object, Lisp_Object);
2884extern Lisp_Object safe_call2 (Lisp_Object, Lisp_Object, Lisp_Object); 2863extern Lisp_Object safe_call2 (Lisp_Object, Lisp_Object, Lisp_Object);
2885extern void init_eval (void); 2864extern void init_eval (void);
2865#if BYTE_MARK_STACK
2886extern void mark_backtrace (void); 2866extern void mark_backtrace (void);
2867#endif
2887extern void syms_of_eval (void); 2868extern void syms_of_eval (void);
2888 2869
2889/* Defined in editfns.c */ 2870/* Defined in editfns.c */
@@ -2921,13 +2902,13 @@ EXFUN (Fwiden, 0);
2921EXFUN (Fuser_login_name, 1); 2902EXFUN (Fuser_login_name, 1);
2922EXFUN (Fsystem_name, 0); 2903EXFUN (Fsystem_name, 0);
2923EXFUN (Fcurrent_time, 0); 2904EXFUN (Fcurrent_time, 0);
2905EXFUN (Fget_internal_run_time, 0);
2924extern EMACS_INT clip_to_bounds (EMACS_INT, EMACS_INT, EMACS_INT); 2906extern EMACS_INT clip_to_bounds (EMACS_INT, EMACS_INT, EMACS_INT);
2925extern Lisp_Object make_buffer_string (EMACS_INT, EMACS_INT, int); 2907extern Lisp_Object make_buffer_string (EMACS_INT, EMACS_INT, int);
2926extern Lisp_Object make_buffer_string_both (EMACS_INT, EMACS_INT, EMACS_INT, 2908extern Lisp_Object make_buffer_string_both (EMACS_INT, EMACS_INT, EMACS_INT,
2927 EMACS_INT, int); 2909 EMACS_INT, int);
2928extern void init_editfns (void); 2910extern void init_editfns (void);
2929const char *get_system_name (void); 2911const char *get_system_name (void);
2930const char *get_operating_system_release (void);
2931extern void syms_of_editfns (void); 2912extern void syms_of_editfns (void);
2932EXFUN (Fconstrain_to_field, 5); 2913EXFUN (Fconstrain_to_field, 5);
2933EXFUN (Ffield_end, 3); 2914EXFUN (Ffield_end, 3);
@@ -2953,7 +2934,6 @@ EXFUN (Fset_buffer, 1);
2953extern Lisp_Object set_buffer_if_live (Lisp_Object); 2934extern Lisp_Object set_buffer_if_live (Lisp_Object);
2954EXFUN (Fbarf_if_buffer_read_only, 0); 2935EXFUN (Fbarf_if_buffer_read_only, 0);
2955EXFUN (Fcurrent_buffer, 0); 2936EXFUN (Fcurrent_buffer, 0);
2956EXFUN (Fswitch_to_buffer, 2);
2957EXFUN (Fother_buffer, 3); 2937EXFUN (Fother_buffer, 3);
2958EXFUN (Foverlay_get, 2); 2938EXFUN (Foverlay_get, 2);
2959EXFUN (Fbuffer_modified_p, 1); 2939EXFUN (Fbuffer_modified_p, 1);
@@ -2962,8 +2942,7 @@ EXFUN (Fkill_buffer, 1);
2962EXFUN (Fkill_all_local_variables, 0); 2942EXFUN (Fkill_all_local_variables, 0);
2963EXFUN (Fbuffer_enable_undo, 1); 2943EXFUN (Fbuffer_enable_undo, 1);
2964EXFUN (Ferase_buffer, 0); 2944EXFUN (Ferase_buffer, 0);
2965extern Lisp_Object Qoverlayp; 2945extern Lisp_Object Qpriority, Qwindow, Qbefore_string, Qafter_string;
2966extern Lisp_Object Qpriority, Qwindow, Qevaporate, Qbefore_string, Qafter_string;
2967extern Lisp_Object get_truename_buffer (Lisp_Object); 2946extern Lisp_Object get_truename_buffer (Lisp_Object);
2968extern struct buffer *all_buffers; 2947extern struct buffer *all_buffers;
2969EXFUN (Fprevious_overlay_change, 1); 2948EXFUN (Fprevious_overlay_change, 1);
@@ -2984,14 +2963,12 @@ extern EMACS_INT marker_byte_position (Lisp_Object);
2984extern void clear_charpos_cache (struct buffer *); 2963extern void clear_charpos_cache (struct buffer *);
2985extern EMACS_INT charpos_to_bytepos (EMACS_INT); 2964extern EMACS_INT charpos_to_bytepos (EMACS_INT);
2986extern EMACS_INT buf_charpos_to_bytepos (struct buffer *, EMACS_INT); 2965extern EMACS_INT buf_charpos_to_bytepos (struct buffer *, EMACS_INT);
2987extern EMACS_INT verify_bytepos (EMACS_INT charpos);
2988extern EMACS_INT buf_bytepos_to_charpos (struct buffer *, EMACS_INT); 2966extern EMACS_INT buf_bytepos_to_charpos (struct buffer *, EMACS_INT);
2989extern void unchain_marker (struct Lisp_Marker *marker); 2967extern void unchain_marker (struct Lisp_Marker *marker);
2990extern Lisp_Object set_marker_restricted (Lisp_Object, Lisp_Object, Lisp_Object); 2968extern Lisp_Object set_marker_restricted (Lisp_Object, Lisp_Object, Lisp_Object);
2991extern Lisp_Object set_marker_both (Lisp_Object, Lisp_Object, EMACS_INT, EMACS_INT); 2969extern Lisp_Object set_marker_both (Lisp_Object, Lisp_Object, EMACS_INT, EMACS_INT);
2992extern Lisp_Object set_marker_restricted_both (Lisp_Object, Lisp_Object, 2970extern Lisp_Object set_marker_restricted_both (Lisp_Object, Lisp_Object,
2993 EMACS_INT, EMACS_INT); 2971 EMACS_INT, EMACS_INT);
2994extern int count_markers (struct buffer *);
2995extern void syms_of_marker (void); 2972extern void syms_of_marker (void);
2996 2973
2997/* Defined in fileio.c */ 2974/* Defined in fileio.c */
@@ -3018,7 +2995,6 @@ EXFUN (Funhandled_file_name_directory, 1);
3018EXFUN (Ffile_directory_p, 1); 2995EXFUN (Ffile_directory_p, 1);
3019EXFUN (Fwrite_region, 7); 2996EXFUN (Fwrite_region, 7);
3020EXFUN (Ffile_readable_p, 1); 2997EXFUN (Ffile_readable_p, 1);
3021EXFUN (Ffile_executable_p, 1);
3022EXFUN (Fread_file_name, 6); 2998EXFUN (Fread_file_name, 6);
3023extern Lisp_Object close_file_unwind (Lisp_Object); 2999extern Lisp_Object close_file_unwind (Lisp_Object);
3024extern Lisp_Object restore_point_unwind (Lisp_Object); 3000extern Lisp_Object restore_point_unwind (Lisp_Object);
@@ -3026,7 +3002,6 @@ extern void report_file_error (const char *, Lisp_Object) NO_RETURN;
3026extern int internal_delete_file (Lisp_Object); 3002extern int internal_delete_file (Lisp_Object);
3027extern void syms_of_fileio (void); 3003extern void syms_of_fileio (void);
3028extern Lisp_Object make_temp_name (Lisp_Object, int); 3004extern Lisp_Object make_temp_name (Lisp_Object, int);
3029EXFUN (Fmake_symbolic_link, 3);
3030extern Lisp_Object Qdelete_file; 3005extern Lisp_Object Qdelete_file;
3031 3006
3032/* Defined in abbrev.c */ 3007/* Defined in abbrev.c */
@@ -3066,7 +3041,6 @@ extern void clear_regexp_cache (void);
3066extern Lisp_Object Qcompletion_ignore_case; 3041extern Lisp_Object Qcompletion_ignore_case;
3067extern Lisp_Object Vminibuffer_list; 3042extern Lisp_Object Vminibuffer_list;
3068extern Lisp_Object last_minibuf_string; 3043extern Lisp_Object last_minibuf_string;
3069extern void choose_minibuf_frame (void);
3070EXFUN (Fcompleting_read, 8); 3044EXFUN (Fcompleting_read, 8);
3071EXFUN (Fread_from_minibuffer, 7); 3045EXFUN (Fread_from_minibuffer, 7);
3072EXFUN (Fread_variable, 2); 3046EXFUN (Fread_variable, 2);
@@ -3107,22 +3081,18 @@ extern void syms_of_casetab (void);
3107 3081
3108/* Defined in keyboard.c */ 3082/* Defined in keyboard.c */
3109 3083
3110extern int echoing;
3111extern Lisp_Object echo_message_buffer; 3084extern Lisp_Object echo_message_buffer;
3112extern struct kboard *echo_kboard; 3085extern struct kboard *echo_kboard;
3113extern void cancel_echoing (void); 3086extern void cancel_echoing (void);
3114extern Lisp_Object Qdisabled, QCfilter; 3087extern Lisp_Object Qdisabled, QCfilter;
3115extern Lisp_Object Qabove_handle, Qhandle, Qbelow_handle; 3088extern Lisp_Object Qup, Qdown, Qbottom;
3116extern Lisp_Object Qup, Qdown, Qbottom, Qend_scroll; 3089extern Lisp_Object Qtop;
3117extern Lisp_Object Qtop, Qratio;
3118extern int input_pending; 3090extern int input_pending;
3119EXFUN (Fdiscard_input, 0); 3091EXFUN (Fdiscard_input, 0);
3120EXFUN (Frecursive_edit, 0); 3092EXFUN (Frecursive_edit, 0);
3121EXFUN (Ftop_level, 0) NO_RETURN; 3093EXFUN (Ftop_level, 0) NO_RETURN;
3122EXFUN (Fcommand_execute, 4);
3123extern Lisp_Object menu_bar_items (Lisp_Object); 3094extern Lisp_Object menu_bar_items (Lisp_Object);
3124extern Lisp_Object tool_bar_items (Lisp_Object, int *); 3095extern Lisp_Object tool_bar_items (Lisp_Object, int *);
3125extern Lisp_Object Qvertical_scroll_bar;
3126extern void discard_mouse_events (void); 3096extern void discard_mouse_events (void);
3127EXFUN (Fevent_convert_list, 1); 3097EXFUN (Fevent_convert_list, 1);
3128EXFUN (Fread_key_sequence, 5); 3098EXFUN (Fread_key_sequence, 5);
@@ -3137,7 +3107,9 @@ extern void cmd_error_internal (Lisp_Object, const char *);
3137extern Lisp_Object command_loop_1 (void); 3107extern Lisp_Object command_loop_1 (void);
3138extern Lisp_Object recursive_edit_1 (void); 3108extern Lisp_Object recursive_edit_1 (void);
3139extern void record_auto_save (void); 3109extern void record_auto_save (void);
3110#ifdef SIGDANGER
3140extern void force_auto_save_soon (void); 3111extern void force_auto_save_soon (void);
3112#endif
3141extern void init_keyboard (void); 3113extern void init_keyboard (void);
3142extern void syms_of_keyboard (void); 3114extern void syms_of_keyboard (void);
3143extern void keys_of_keyboard (void); 3115extern void keys_of_keyboard (void);
@@ -3161,7 +3133,9 @@ extern Lisp_Object Qvisible;
3161extern void store_frame_param (struct frame *, Lisp_Object, Lisp_Object); 3133extern void store_frame_param (struct frame *, Lisp_Object, Lisp_Object);
3162extern void store_in_alist (Lisp_Object *, Lisp_Object, Lisp_Object); 3134extern void store_in_alist (Lisp_Object *, Lisp_Object, Lisp_Object);
3163extern Lisp_Object do_switch_frame (Lisp_Object, int, int, Lisp_Object); 3135extern Lisp_Object do_switch_frame (Lisp_Object, int, int, Lisp_Object);
3136#if HAVE_NS
3164extern Lisp_Object get_frame_param (struct frame *, Lisp_Object); 3137extern Lisp_Object get_frame_param (struct frame *, Lisp_Object);
3138#endif
3165extern Lisp_Object frame_buffer_predicate (Lisp_Object); 3139extern Lisp_Object frame_buffer_predicate (Lisp_Object);
3166EXFUN (Fselect_frame, 2); 3140EXFUN (Fselect_frame, 2);
3167EXFUN (Fselected_frame, 0); 3141EXFUN (Fselected_frame, 0);
@@ -3189,8 +3163,9 @@ extern int display_arg;
3189extern Lisp_Object decode_env_path (const char *, const char *); 3163extern Lisp_Object decode_env_path (const char *, const char *);
3190extern Lisp_Object empty_unibyte_string, empty_multibyte_string; 3164extern Lisp_Object empty_unibyte_string, empty_multibyte_string;
3191extern Lisp_Object Qfile_name_handler_alist; 3165extern Lisp_Object Qfile_name_handler_alist;
3192extern void (*fatal_error_signal_hook) (void); 3166#ifdef FLOAT_CATCH_SIGILL
3193extern void fatal_error_signal (int); 3167extern void fatal_error_signal (int);
3168#endif
3194EXFUN (Fkill_emacs, 1) NO_RETURN; 3169EXFUN (Fkill_emacs, 1) NO_RETURN;
3195#if HAVE_SETLOCALE 3170#if HAVE_SETLOCALE
3196void fixup_locale (void); 3171void fixup_locale (void);
@@ -3219,9 +3194,8 @@ extern int inhibit_window_system;
3219/* Nonzero means that a filter or a sentinel is running. */ 3194/* Nonzero means that a filter or a sentinel is running. */
3220extern int running_asynch_code; 3195extern int running_asynch_code;
3221 3196
3222/* Defined in process.c */ 3197/* Defined in process.c. */
3223extern Lisp_Object QCtype, Qlocal; 3198extern Lisp_Object QCtype, Qlocal;
3224EXFUN (Fget_process, 1);
3225EXFUN (Fget_buffer_process, 1); 3199EXFUN (Fget_buffer_process, 1);
3226EXFUN (Fprocess_status, 1); 3200EXFUN (Fprocess_status, 1);
3227EXFUN (Fkill_process, 2); 3201EXFUN (Fkill_process, 2);
@@ -3255,7 +3229,6 @@ extern void syms_of_callproc (void);
3255/* Defined in doc.c */ 3229/* Defined in doc.c */
3256extern Lisp_Object Qfunction_documentation; 3230extern Lisp_Object Qfunction_documentation;
3257EXFUN (Fsubstitute_command_keys, 1); 3231EXFUN (Fsubstitute_command_keys, 1);
3258EXFUN (Fdocumentation_property, 3);
3259extern Lisp_Object read_doc_string (Lisp_Object); 3232extern Lisp_Object read_doc_string (Lisp_Object);
3260extern Lisp_Object get_doc_string (Lisp_Object, int, int); 3233extern Lisp_Object get_doc_string (Lisp_Object, int, int);
3261extern void syms_of_doc (void); 3234extern void syms_of_doc (void);
@@ -3263,10 +3236,9 @@ extern int read_bytecode_char (int);
3263 3236
3264/* Defined in bytecode.c */ 3237/* Defined in bytecode.c */
3265extern Lisp_Object Qbytecode; 3238extern Lisp_Object Qbytecode;
3266EXFUN (Fbyte_code, 3);
3267extern void syms_of_bytecode (void); 3239extern void syms_of_bytecode (void);
3268extern struct byte_stack *byte_stack_list; 3240extern struct byte_stack *byte_stack_list;
3269#ifdef BYTE_MARK_STACK 3241#if BYTE_MARK_STACK
3270extern void mark_byte_stack (void); 3242extern void mark_byte_stack (void);
3271#endif 3243#endif
3272extern void unmark_byte_stack (void); 3244extern void unmark_byte_stack (void);
@@ -3341,7 +3313,6 @@ extern void flush_pending_output (int);
3341extern void child_setup_tty (int); 3313extern void child_setup_tty (int);
3342extern void setup_pty (int); 3314extern void setup_pty (int);
3343extern int set_window_size (int, int, int); 3315extern int set_window_size (int, int, int);
3344extern void create_process (Lisp_Object, char **, Lisp_Object);
3345extern long get_random (void); 3316extern long get_random (void);
3346extern void seed_random (long); 3317extern void seed_random (long);
3347extern int emacs_open (const char *, int, int); 3318extern int emacs_open (const char *, int, int);
@@ -3384,7 +3355,6 @@ extern void syms_of_category (void);
3384extern void syms_of_ccl (void); 3355extern void syms_of_ccl (void);
3385 3356
3386/* Defined in dired.c */ 3357/* Defined in dired.c */
3387EXFUN (Ffile_attributes, 2);
3388extern void syms_of_dired (void); 3358extern void syms_of_dired (void);
3389extern Lisp_Object directory_files_internal (Lisp_Object, Lisp_Object, 3359extern Lisp_Object directory_files_internal (Lisp_Object, Lisp_Object,
3390 Lisp_Object, Lisp_Object, 3360 Lisp_Object, Lisp_Object,
@@ -3417,9 +3387,9 @@ EXFUN (Fx_focus_frame, 1);
3417#endif 3387#endif
3418 3388
3419/* Defined in xfaces.c */ 3389/* Defined in xfaces.c */
3420extern Lisp_Object Qdefault, Qtool_bar, Qregion, Qfringe; 3390extern Lisp_Object Qdefault, Qtool_bar, Qfringe;
3421extern Lisp_Object Qheader_line, Qscroll_bar, Qcursor, Qborder, Qmouse, Qmenu; 3391extern Lisp_Object Qheader_line, Qscroll_bar, Qcursor;
3422extern Lisp_Object Qmode_line_inactive, Qvertical_border; 3392extern Lisp_Object Qmode_line_inactive;
3423extern Lisp_Object Qface; 3393extern Lisp_Object Qface;
3424extern Lisp_Object Qnormal; 3394extern Lisp_Object Qnormal;
3425extern Lisp_Object QCfamily, QCweight, QCslant; 3395extern Lisp_Object QCfamily, QCweight, QCslant;
@@ -3530,16 +3500,6 @@ extern void init_system_name (void);
3530 ? 0 \ 3500 ? 0 \
3531 : (wrong_type_argument (Qlistp, (list))), 1)) 3501 : (wrong_type_argument (Qlistp, (list))), 1))
3532 3502
3533#define FOREACH(hare, list, tortoise, n) \
3534 for (tortoise = hare = (list), n = 0; \
3535 !LIST_END_P (list, hare); \
3536 (hare = XCDR (hare), ++n, \
3537 ((n & 1) != 0 \
3538 ? (tortoise = XCDR (tortoise), \
3539 (EQ (hare, tortoise) \
3540 && (circular_list_error ((list)), 1))) \
3541 : 0)))
3542
3543/* Use this to suppress gcc's `...may be used before initialized' warnings. */ 3503/* Use this to suppress gcc's `...may be used before initialized' warnings. */
3544#ifdef lint 3504#ifdef lint
3545# define IF_LINT(Code) Code 3505# define IF_LINT(Code) Code
diff --git a/src/lread.c b/src/lread.c
index 8777bc34545..d32f0b6a7e2 100644
--- a/src/lread.c
+++ b/src/lread.c
@@ -61,20 +61,21 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
61#endif 61#endif
62 62
63/* hash table read constants */ 63/* hash table read constants */
64Lisp_Object Qhash_table, Qdata; 64static Lisp_Object Qhash_table, Qdata;
65Lisp_Object Qtest, Qsize; 65static Lisp_Object Qtest, Qsize;
66Lisp_Object Qweakness; 66static Lisp_Object Qweakness;
67Lisp_Object Qrehash_size; 67static Lisp_Object Qrehash_size;
68Lisp_Object Qrehash_threshold; 68static Lisp_Object Qrehash_threshold;
69 69
70Lisp_Object Qread_char, Qget_file_char, Qstandard_input, Qcurrent_load_list; 70static Lisp_Object Qread_char, Qget_file_char, Qcurrent_load_list;
71Lisp_Object Qstandard_input;
71Lisp_Object Qvariable_documentation; 72Lisp_Object Qvariable_documentation;
72Lisp_Object Qascii_character, Qload, Qload_file_name; 73static Lisp_Object Qascii_character, Qload, Qload_file_name;
73Lisp_Object Qbackquote, Qcomma, Qcomma_at, Qcomma_dot, Qfunction; 74Lisp_Object Qbackquote, Qcomma, Qcomma_at, Qcomma_dot, Qfunction;
74Lisp_Object Qinhibit_file_name_operation; 75static Lisp_Object Qinhibit_file_name_operation;
75Lisp_Object Qeval_buffer_list; 76static Lisp_Object Qeval_buffer_list;
76Lisp_Object Qlexical_binding; 77static Lisp_Object Qlexical_binding;
77Lisp_Object Qfile_truename, Qdo_after_load_evaluation; /* ACM 2006/5/16 */ 78static Lisp_Object Qfile_truename, Qdo_after_load_evaluation; /* ACM 2006/5/16 */
78 79
79/* Used instead of Qget_file_char while loading *.elc files compiled 80/* Used instead of Qget_file_char while loading *.elc files compiled
80 by Emacs 21 or older. */ 81 by Emacs 21 or older. */
@@ -90,7 +91,7 @@ static Lisp_Object Qload_in_progress;
90 Each member of the list has the form (n . object), and is used to 91 Each member of the list has the form (n . object), and is used to
91 look up the object for the corresponding #n# construct. 92 look up the object for the corresponding #n# construct.
92 It must be set to nil before all top-level calls to read0. */ 93 It must be set to nil before all top-level calls to read0. */
93Lisp_Object read_objects; 94static Lisp_Object read_objects;
94 95
95/* Nonzero means READCHAR should read bytes one by one (not character) 96/* Nonzero means READCHAR should read bytes one by one (not character)
96 when READCHARFUN is Qget_file_char or Qget_emacs_mule_file_char. 97 when READCHARFUN is Qget_file_char or Qget_emacs_mule_file_char.
@@ -3577,11 +3578,11 @@ read_list (int flag, register Lisp_Object readcharfun)
3577 } 3578 }
3578} 3579}
3579 3580
3580Lisp_Object initial_obarray; 3581static Lisp_Object initial_obarray;
3581 3582
3582/* oblookup stores the bucket number here, for the sake of Funintern. */ 3583/* oblookup stores the bucket number here, for the sake of Funintern. */
3583 3584
3584int oblookup_last_bucket_number; 3585static int oblookup_last_bucket_number;
3585 3586
3586static int hash_string (const char *ptr, int len); 3587static int hash_string (const char *ptr, int len);
3587 3588
@@ -3641,18 +3642,6 @@ intern_c_string (const char *str)
3641 3642
3642 return Fintern (make_pure_c_string (str), obarray); 3643 return Fintern (make_pure_c_string (str), obarray);
3643} 3644}
3644
3645/* Create an uninterned symbol with name STR. */
3646
3647Lisp_Object
3648make_symbol (const char *str)
3649{
3650 int len = strlen (str);
3651
3652 return Fmake_symbol (!NILP (Vpurify_flag)
3653 ? make_pure_string (str, len, len, 0)
3654 : make_string (str, len));
3655}
3656 3645
3657DEFUN ("intern", Fintern, Sintern, 1, 2, 0, 3646DEFUN ("intern", Fintern, Sintern, 1, 2, 0,
3658 doc: /* Return the canonical symbol whose name is STRING. 3647 doc: /* Return the canonical symbol whose name is STRING.
diff --git a/src/macros.c b/src/macros.c
index d90b31b503f..3523e513d6a 100644
--- a/src/macros.c
+++ b/src/macros.c
@@ -27,7 +27,8 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
27#include "window.h" 27#include "window.h"
28#include "keyboard.h" 28#include "keyboard.h"
29 29
30Lisp_Object Qexecute_kbd_macro, Qkbd_macro_termination_hook; 30Lisp_Object Qexecute_kbd_macro;
31static Lisp_Object Qkbd_macro_termination_hook;
31 32
32/* Number of successful iterations so far 33/* Number of successful iterations so far
33 for innermost keyboard macro. 34 for innermost keyboard macro.
@@ -391,4 +392,3 @@ This is nil when not executing a keyboard macro. */);
391 DEFVAR_KBOARD ("last-kbd-macro", Vlast_kbd_macro, 392 DEFVAR_KBOARD ("last-kbd-macro", Vlast_kbd_macro,
392 doc: /* Last kbd macro defined, as a string or vector; nil if none defined. */); 393 doc: /* Last kbd macro defined, as a string or vector; nil if none defined. */);
393} 394}
394
diff --git a/src/marker.c b/src/marker.c
index 7d461099140..675bbc5ad73 100644
--- a/src/marker.c
+++ b/src/marker.c
@@ -242,6 +242,7 @@ buf_charpos_to_bytepos (struct buffer *b, EMACS_INT charpos)
242/* Used for debugging: recompute the bytepos corresponding to CHARPOS 242/* Used for debugging: recompute the bytepos corresponding to CHARPOS
243 in the simplest, most reliable way. */ 243 in the simplest, most reliable way. */
244 244
245extern EMACS_INT verify_bytepos (EMACS_INT charpos) EXTERNALLY_VISIBLE;
245EMACS_INT 246EMACS_INT
246verify_bytepos (EMACS_INT charpos) 247verify_bytepos (EMACS_INT charpos)
247{ 248{
@@ -864,6 +865,7 @@ DEFUN ("buffer-has-markers-at", Fbuffer_has_markers_at, Sbuffer_has_markers_at,
864 865
865/* For debugging -- count the markers in buffer BUF. */ 866/* For debugging -- count the markers in buffer BUF. */
866 867
868extern int count_markers (struct buffer *) EXTERNALLY_VISIBLE;
867int 869int
868count_markers (struct buffer *buf) 870count_markers (struct buffer *buf)
869{ 871{
diff --git a/src/minibuf.c b/src/minibuf.c
index 54cb9c1acd7..6316ba514b9 100644
--- a/src/minibuf.c
+++ b/src/minibuf.c
@@ -45,7 +45,7 @@ Lisp_Object Vminibuffer_list;
45 45
46/* Data to remember during recursive minibuffer invocations */ 46/* Data to remember during recursive minibuffer invocations */
47 47
48Lisp_Object minibuf_save_list; 48static Lisp_Object minibuf_save_list;
49 49
50/* Depth in minibuffer invocations. */ 50/* Depth in minibuffer invocations. */
51 51
@@ -53,35 +53,35 @@ int minibuf_level;
53 53
54/* The maximum length of a minibuffer history. */ 54/* The maximum length of a minibuffer history. */
55 55
56Lisp_Object Qhistory_length; 56static Lisp_Object Qhistory_length;
57 57
58/* Fread_minibuffer leaves the input here as a string. */ 58/* Fread_minibuffer leaves the input here as a string. */
59 59
60Lisp_Object last_minibuf_string; 60Lisp_Object last_minibuf_string;
61 61
62Lisp_Object Qminibuffer_history, Qbuffer_name_history; 62static Lisp_Object Qminibuffer_history, Qbuffer_name_history;
63 63
64Lisp_Object Qread_file_name_internal; 64static Lisp_Object Qread_file_name_internal;
65 65
66/* Normal hooks for entry to and exit from minibuffer. */ 66/* Normal hooks for entry to and exit from minibuffer. */
67 67
68Lisp_Object Qminibuffer_setup_hook; 68static Lisp_Object Qminibuffer_setup_hook;
69Lisp_Object Qminibuffer_exit_hook; 69static Lisp_Object Qminibuffer_exit_hook;
70 70
71Lisp_Object Qcompletion_ignore_case; 71Lisp_Object Qcompletion_ignore_case;
72Lisp_Object Qminibuffer_completion_table; 72static Lisp_Object Qminibuffer_completion_table;
73Lisp_Object Qminibuffer_completion_predicate; 73static Lisp_Object Qminibuffer_completion_predicate;
74Lisp_Object Qminibuffer_completion_confirm; 74static Lisp_Object Qminibuffer_completion_confirm;
75Lisp_Object Qcompleting_read_default; 75static Lisp_Object Qcompleting_read_default;
76Lisp_Object Quser_variable_p; 76static Lisp_Object Quser_variable_p;
77 77
78Lisp_Object Qminibuffer_default; 78static Lisp_Object Qminibuffer_default;
79 79
80Lisp_Object Qcurrent_input_method, Qactivate_input_method; 80static Lisp_Object Qcurrent_input_method, Qactivate_input_method;
81 81
82Lisp_Object Qcase_fold_search; 82static Lisp_Object Qcase_fold_search;
83 83
84Lisp_Object Qread_expression_history; 84static Lisp_Object Qread_expression_history;
85 85
86/* Prompt to display in front of the mini-buffer contents. */ 86/* Prompt to display in front of the mini-buffer contents. */
87 87
@@ -97,7 +97,7 @@ static EMACS_INT minibuf_prompt_width;
97 We do this whenever the user starts a new minibuffer 97 We do this whenever the user starts a new minibuffer
98 or when a minibuffer exits. */ 98 or when a minibuffer exits. */
99 99
100void 100static void
101choose_minibuf_frame (void) 101choose_minibuf_frame (void)
102{ 102{
103 if (FRAMEP (selected_frame) 103 if (FRAMEP (selected_frame)
@@ -872,7 +872,8 @@ read_minibuf_unwind (Lisp_Object data)
872} 872}
873 873
874 874
875DEFUN ("read-from-minibuffer", Fread_from_minibuffer, Sread_from_minibuffer, 1, 7, 0, 875DEFUN ("read-from-minibuffer", Fread_from_minibuffer,
876 Sread_from_minibuffer, 1, 7, 0,
876 doc: /* Read a string from the minibuffer, prompting with string PROMPT. 877 doc: /* Read a string from the minibuffer, prompting with string PROMPT.
877The optional second arg INITIAL-CONTENTS is an obsolete alternative to 878The optional second arg INITIAL-CONTENTS is an obsolete alternative to
878 DEFAULT-VALUE. It normally should be nil in new code, except when 879 DEFAULT-VALUE. It normally should be nil in new code, except when
diff --git a/src/print.c b/src/print.c
index f68f04ac5fa..6a331cb11f2 100644
--- a/src/print.c
+++ b/src/print.c
@@ -39,11 +39,11 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
39 39
40Lisp_Object Qstandard_output; 40Lisp_Object Qstandard_output;
41 41
42Lisp_Object Qtemp_buffer_setup_hook; 42static Lisp_Object Qtemp_buffer_setup_hook;
43 43
44/* These are used to print like we read. */ 44/* These are used to print like we read. */
45 45
46Lisp_Object Qfloat_output_format; 46static Lisp_Object Qfloat_output_format;
47 47
48#include <math.h> 48#include <math.h>
49 49
@@ -58,28 +58,28 @@ Lisp_Object Qfloat_output_format;
58#endif 58#endif
59 59
60/* Avoid actual stack overflow in print. */ 60/* Avoid actual stack overflow in print. */
61int print_depth; 61static int print_depth;
62 62
63/* Level of nesting inside outputting backquote in new style. */ 63/* Level of nesting inside outputting backquote in new style. */
64int new_backquote_output; 64static int new_backquote_output;
65 65
66/* Detect most circularities to print finite output. */ 66/* Detect most circularities to print finite output. */
67#define PRINT_CIRCLE 200 67#define PRINT_CIRCLE 200
68Lisp_Object being_printed[PRINT_CIRCLE]; 68static Lisp_Object being_printed[PRINT_CIRCLE];
69 69
70/* When printing into a buffer, first we put the text in this 70/* When printing into a buffer, first we put the text in this
71 block, then insert it all at once. */ 71 block, then insert it all at once. */
72char *print_buffer; 72static char *print_buffer;
73 73
74/* Size allocated in print_buffer. */ 74/* Size allocated in print_buffer. */
75EMACS_INT print_buffer_size; 75static EMACS_INT print_buffer_size;
76/* Chars stored in print_buffer. */ 76/* Chars stored in print_buffer. */
77EMACS_INT print_buffer_pos; 77static EMACS_INT print_buffer_pos;
78/* Bytes stored in print_buffer. */ 78/* Bytes stored in print_buffer. */
79EMACS_INT print_buffer_pos_byte; 79static EMACS_INT print_buffer_pos_byte;
80 80
81Lisp_Object Qprint_escape_newlines; 81Lisp_Object Qprint_escape_newlines;
82Lisp_Object Qprint_escape_multibyte, Qprint_escape_nonascii; 82static Lisp_Object Qprint_escape_multibyte, Qprint_escape_nonascii;
83 83
84/* Vprint_number_table is a table, that keeps objects that are going to 84/* Vprint_number_table is a table, that keeps objects that are going to
85 be printed, to allow use of #n= and #n# to express sharing. 85 be printed, to allow use of #n= and #n# to express sharing.
@@ -89,8 +89,8 @@ Lisp_Object Qprint_escape_multibyte, Qprint_escape_nonascii;
89 N the object has been printed so we can refer to it as #N#. 89 N the object has been printed so we can refer to it as #N#.
90 print_number_index holds the largest N already used. 90 print_number_index holds the largest N already used.
91 N has to be striclty larger than 0 since we need to distinguish -N. */ 91 N has to be striclty larger than 0 since we need to distinguish -N. */
92int print_number_index; 92static int print_number_index;
93void print_interval (INTERVAL interval, Lisp_Object printcharfun); 93static void print_interval (INTERVAL interval, Lisp_Object printcharfun);
94 94
95/* GDB resets this to zero on W32 to disable OutputDebugString calls. */ 95/* GDB resets this to zero on W32 to disable OutputDebugString calls. */
96int print_output_debug_flag EXTERNALLY_VISIBLE = 1; 96int print_output_debug_flag EXTERNALLY_VISIBLE = 1;
@@ -738,6 +738,7 @@ to make it write to the debugging output. */)
738/* This function is never called. Its purpose is to prevent 738/* This function is never called. Its purpose is to prevent
739 print_output_debug_flag from being optimized away. */ 739 print_output_debug_flag from being optimized away. */
740 740
741extern void debug_output_compilation_hack (int) EXTERNALLY_VISIBLE;
741void 742void
742debug_output_compilation_hack (int x) 743debug_output_compilation_hack (int x)
743{ 744{
@@ -751,7 +752,7 @@ debug_output_compilation_hack (int x)
751 752
752#define WITH_REDIRECT_DEBUGGING_OUTPUT 1 753#define WITH_REDIRECT_DEBUGGING_OUTPUT 1
753 754
754FILE *initial_stderr_stream = NULL; 755static FILE *initial_stderr_stream = NULL;
755 756
756DEFUN ("redirect-debugging-output", Fredirect_debugging_output, Sredirect_debugging_output, 757DEFUN ("redirect-debugging-output", Fredirect_debugging_output, Sredirect_debugging_output,
757 1, 2, 758 1, 2,
@@ -798,6 +799,7 @@ debug_print (Lisp_Object arg)
798 fprintf (stderr, "\r\n"); 799 fprintf (stderr, "\r\n");
799} 800}
800 801
802void safe_debug_print (Lisp_Object) EXTERNALLY_VISIBLE;
801void 803void
802safe_debug_print (Lisp_Object arg) 804safe_debug_print (Lisp_Object arg)
803{ 805{
diff --git a/src/process.c b/src/process.c
index 2c3124f429c..f41cdbe5c71 100644
--- a/src/process.c
+++ b/src/process.c
@@ -24,7 +24,7 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
24#include <stdio.h> 24#include <stdio.h>
25#include <errno.h> 25#include <errno.h>
26#include <setjmp.h> 26#include <setjmp.h>
27#include <sys/types.h> /* some typedefs are used in sys/file.h */ 27#include <sys/types.h> /* Some typedefs are used in sys/file.h. */
28#include <sys/file.h> 28#include <sys/file.h>
29#include <sys/stat.h> 29#include <sys/stat.h>
30#include <setjmp.h> 30#include <setjmp.h>
@@ -128,21 +128,23 @@ int inhibit_sentinels;
128#ifdef subprocesses 128#ifdef subprocesses
129 129
130Lisp_Object Qprocessp; 130Lisp_Object Qprocessp;
131Lisp_Object Qrun, Qstop, Qsignal; 131static Lisp_Object Qrun, Qstop, Qsignal;
132Lisp_Object Qopen, Qclosed, Qconnect, Qfailed, Qlisten; 132static Lisp_Object Qopen, Qclosed, Qconnect, Qfailed, Qlisten;
133Lisp_Object Qlocal, Qipv4, Qdatagram, Qseqpacket; 133Lisp_Object Qlocal;
134Lisp_Object Qreal, Qnetwork, Qserial; 134static Lisp_Object Qipv4, Qdatagram, Qseqpacket;
135static Lisp_Object Qreal, Qnetwork, Qserial;
135#ifdef AF_INET6 136#ifdef AF_INET6
136Lisp_Object Qipv6; 137static Lisp_Object Qipv6;
137#endif 138#endif
138Lisp_Object QCport, QCspeed, QCprocess; 139static Lisp_Object QCport, QCprocess;
140Lisp_Object QCspeed;
139Lisp_Object QCbytesize, QCstopbits, QCparity, Qodd, Qeven; 141Lisp_Object QCbytesize, QCstopbits, QCparity, Qodd, Qeven;
140Lisp_Object QCflowcontrol, Qhw, Qsw, QCsummary; 142Lisp_Object QCflowcontrol, Qhw, Qsw, QCsummary;
141Lisp_Object QCbuffer, QChost, QCservice; 143static Lisp_Object QCbuffer, QChost, QCservice;
142Lisp_Object QClocal, QCremote, QCcoding; 144static Lisp_Object QClocal, QCremote, QCcoding;
143Lisp_Object QCserver, QCnowait, QCnoquery, QCstop; 145static Lisp_Object QCserver, QCnowait, QCnoquery, QCstop;
144Lisp_Object QCsentinel, QClog, QCoptions, QCplist; 146static Lisp_Object QCsentinel, QClog, QCoptions, QCplist;
145Lisp_Object Qlast_nonmenu_event; 147static Lisp_Object Qlast_nonmenu_event;
146/* QCfamily is declared and initialized in xfaces.c, 148/* QCfamily is declared and initialized in xfaces.c,
147 QCfilter in keyboard.c. */ 149 QCfilter in keyboard.c. */
148extern Lisp_Object QCfamily, QCfilter; 150extern Lisp_Object QCfamily, QCfilter;
@@ -163,12 +165,10 @@ extern Lisp_Object QCfilter;
163extern int h_errno; 165extern int h_errno;
164#endif 166#endif
165 167
166/* These next two vars are non-static since sysdep.c uses them in the
167 emulation of `select'. */
168/* Number of events of change of status of a process. */ 168/* Number of events of change of status of a process. */
169int process_tick; 169static int process_tick;
170/* Number of events for which the user or sentinel has been notified. */ 170/* Number of events for which the user or sentinel has been notified. */
171int update_tick; 171static int update_tick;
172 172
173/* Define NON_BLOCKING_CONNECT if we can support non-blocking connects. */ 173/* Define NON_BLOCKING_CONNECT if we can support non-blocking connects. */
174 174
@@ -235,6 +235,8 @@ static int process_output_skip;
235#define process_output_delay_count 0 235#define process_output_delay_count 0
236#endif 236#endif
237 237
238static Lisp_Object Fget_process (Lisp_Object);
239static void create_process (Lisp_Object, char **, Lisp_Object);
238static int keyboard_bit_set (SELECT_TYPE *); 240static int keyboard_bit_set (SELECT_TYPE *);
239static void deactivate_process (Lisp_Object); 241static void deactivate_process (Lisp_Object);
240static void status_notify (struct Lisp_Process *); 242static void status_notify (struct Lisp_Process *);
@@ -284,10 +286,10 @@ static int max_process_desc;
284static int max_input_desc; 286static int max_input_desc;
285 287
286/* Indexed by descriptor, gives the process (if any) for that descriptor */ 288/* Indexed by descriptor, gives the process (if any) for that descriptor */
287Lisp_Object chan_process[MAXDESC]; 289static Lisp_Object chan_process[MAXDESC];
288 290
289/* Alist of elements (NAME . PROCESS) */ 291/* Alist of elements (NAME . PROCESS) */
290Lisp_Object Vprocess_alist; 292static Lisp_Object Vprocess_alist;
291 293
292/* Buffered-ahead input char from process, indexed by channel. 294/* Buffered-ahead input char from process, indexed by channel.
293 -1 means empty (no char is buffered). 295 -1 means empty (no char is buffered).
@@ -295,8 +297,7 @@ Lisp_Object Vprocess_alist;
295 output from the process is to read at least one char. 297 output from the process is to read at least one char.
296 Always -1 on systems that support FIONREAD. */ 298 Always -1 on systems that support FIONREAD. */
297 299
298/* Don't make static; need to access externally. */ 300static int proc_buffered_char[MAXDESC];
299int proc_buffered_char[MAXDESC];
300 301
301/* Table of `struct coding-system' for each process. */ 302/* Table of `struct coding-system' for each process. */
302static struct coding_system *proc_decode_coding_system[MAXDESC]; 303static struct coding_system *proc_decode_coding_system[MAXDESC];
@@ -304,7 +305,7 @@ static struct coding_system *proc_encode_coding_system[MAXDESC];
304 305
305#ifdef DATAGRAM_SOCKETS 306#ifdef DATAGRAM_SOCKETS
306/* Table of `partner address' for datagram sockets. */ 307/* Table of `partner address' for datagram sockets. */
307struct sockaddr_and_len { 308static struct sockaddr_and_len {
308 struct sockaddr *sa; 309 struct sockaddr *sa;
309 int len; 310 int len;
310} datagram_address[MAXDESC]; 311} datagram_address[MAXDESC];
@@ -320,7 +321,7 @@ static int pty_max_bytes;
320 321
321 322
322 323
323struct fd_callback_data 324static struct fd_callback_data
324{ 325{
325 fd_callback func; 326 fd_callback func;
326 void *data; 327 void *data;
@@ -1083,7 +1084,7 @@ DEFUN ("process-query-on-exit-flag",
1083} 1084}
1084 1085
1085#ifdef DATAGRAM_SOCKETS 1086#ifdef DATAGRAM_SOCKETS
1086Lisp_Object Fprocess_datagram_address (Lisp_Object process); 1087static Lisp_Object Fprocess_datagram_address (Lisp_Object);
1087#endif 1088#endif
1088 1089
1089DEFUN ("process-contact", Fprocess_contact, Sprocess_contact, 1090DEFUN ("process-contact", Fprocess_contact, Sprocess_contact,
@@ -1518,7 +1519,7 @@ create_process_1 (struct atimer *timer)
1518} 1519}
1519 1520
1520 1521
1521void 1522static void
1522create_process (Lisp_Object process, char **new_argv, Lisp_Object current_dir) 1523create_process (Lisp_Object process, char **new_argv, Lisp_Object current_dir)
1523{ 1524{
1524 int inchannel, outchannel; 1525 int inchannel, outchannel;
@@ -3790,7 +3791,7 @@ FLAGS is the current flags of the interface. */)
3790 3791
3791/* Turn off input and output for process PROC. */ 3792/* Turn off input and output for process PROC. */
3792 3793
3793void 3794static void
3794deactivate_process (Lisp_Object proc) 3795deactivate_process (Lisp_Object proc)
3795{ 3796{
3796 register int inchannel, outchannel; 3797 register int inchannel, outchannel;
@@ -5216,8 +5217,8 @@ read_process_output (Lisp_Object proc, register int channel)
5216 5217
5217/* Sending data to subprocess */ 5218/* Sending data to subprocess */
5218 5219
5219jmp_buf send_process_frame; 5220static jmp_buf send_process_frame;
5220Lisp_Object process_sent_to; 5221static Lisp_Object process_sent_to;
5221 5222
5222static void 5223static void
5223send_process_trap (int ignore) 5224send_process_trap (int ignore)
@@ -6984,8 +6985,8 @@ kill_buffer_processes (Lisp_Object buffer)
6984#endif /* subprocesses */ 6985#endif /* subprocesses */
6985} 6986}
6986 6987
6987DEFUN ("waiting-for-user-input-p", Fwaiting_for_user_input_p, Swaiting_for_user_input_p, 6988DEFUN ("waiting-for-user-input-p", Fwaiting_for_user_input_p,
6988 0, 0, 0, 6989 Swaiting_for_user_input_p, 0, 0, 0,
6989 doc: /* Returns non-nil if Emacs is waiting for input from the user. 6990 doc: /* Returns non-nil if Emacs is waiting for input from the user.
6990This is intended for use by asynchronous process output filters and sentinels. */) 6991This is intended for use by asynchronous process output filters and sentinels. */)
6991 (void) 6992 (void)
@@ -7187,7 +7188,9 @@ init_process (void)
7187 processes. As such, we only change the default value. */ 7188 processes. As such, we only change the default value. */
7188 if (initialized) 7189 if (initialized)
7189 { 7190 {
7190 const char *release = get_operating_system_release (); 7191 char const *release = (STRINGP (Voperating_system_release)
7192 ? SSDATA (Voperating_system_release)
7193 : 0);
7191 if (!release || !release[0] || (release[0] < MIN_PTY_KERNEL_VERSION 7194 if (!release || !release[0] || (release[0] < MIN_PTY_KERNEL_VERSION
7192 && release[1] == '.')) { 7195 && release[1] == '.')) {
7193 Vprocess_connection_type = Qnil; 7196 Vprocess_connection_type = Qnil;
diff --git a/src/process.h b/src/process.h
index 6bf1084afcd..0348f211bb9 100644
--- a/src/process.h
+++ b/src/process.h
@@ -143,12 +143,6 @@ struct Lisp_Process
143 143
144#define ChannelMask(n) (1<<(n)) 144#define ChannelMask(n) (1<<(n))
145 145
146/* Indexed by descriptor, gives the process (if any) for that descriptor. */
147extern Lisp_Object chan_process[];
148
149/* Alist of elements (NAME . PROCESS). */
150extern Lisp_Object Vprocess_alist;
151
152/* True if we are about to fork off a synchronous process or if we 146/* True if we are about to fork off a synchronous process or if we
153 are waiting for it. */ 147 are waiting for it. */
154extern int synch_process_alive; 148extern int synch_process_alive;
@@ -181,7 +175,7 @@ extern Lisp_Object Qminflt, Qmajflt, Qcminflt, Qcmajflt, Qutime, Qstime;
181extern Lisp_Object Qcutime, Qpri, Qnice, Qthcount, Qstart, Qvsize, Qrss, Qargs; 175extern Lisp_Object Qcutime, Qpri, Qnice, Qthcount, Qstart, Qvsize, Qrss, Qargs;
182extern Lisp_Object Quser, Qgroup, Qetime, Qpcpu, Qpmem, Qtpgid, Qcstime; 176extern Lisp_Object Quser, Qgroup, Qetime, Qpcpu, Qpmem, Qtpgid, Qcstime;
183extern Lisp_Object Qtime, Qctime; 177extern Lisp_Object Qtime, Qctime;
184extern Lisp_Object QCport, QCspeed, QCprocess; 178extern Lisp_Object QCspeed;
185extern Lisp_Object QCbytesize, QCstopbits, QCparity, Qodd, Qeven; 179extern Lisp_Object QCbytesize, QCstopbits, QCparity, Qodd, Qeven;
186extern Lisp_Object QCflowcontrol, Qhw, Qsw, QCsummary; 180extern Lisp_Object QCflowcontrol, Qhw, Qsw, QCsummary;
187 181
@@ -198,4 +192,3 @@ extern void add_read_fd (int fd, fd_callback func, void *data);
198extern void delete_read_fd (int fd); 192extern void delete_read_fd (int fd);
199extern void add_write_fd (int fd, fd_callback func, void *data); 193extern void add_write_fd (int fd, fd_callback func, void *data);
200extern void delete_write_fd (int fd); 194extern void delete_write_fd (int fd);
201
diff --git a/src/region-cache.c b/src/region-cache.c
index 53ce0e9d802..a0b85039e74 100644
--- a/src/region-cache.c
+++ b/src/region-cache.c
@@ -781,6 +781,7 @@ int region_cache_backward (struct buffer *buf, struct region_cache *c,
781 781
782/* Debugging: pretty-print a cache to the standard error output. */ 782/* Debugging: pretty-print a cache to the standard error output. */
783 783
784void pp_cache (struct region_cache *) EXTERNALLY_VISIBLE;
784void 785void
785pp_cache (struct region_cache *c) 786pp_cache (struct region_cache *c)
786{ 787{
diff --git a/src/region-cache.h b/src/region-cache.h
index 8e4336c2885..ea767ed0dc3 100644
--- a/src/region-cache.h
+++ b/src/region-cache.h
@@ -110,6 +110,3 @@ extern int region_cache_backward (struct buffer *BUF,
110 struct region_cache *CACHE, 110 struct region_cache *CACHE,
111 EMACS_INT POS, 111 EMACS_INT POS,
112 EMACS_INT *NEXT); 112 EMACS_INT *NEXT);
113
114/* For debugging. */
115void pp_cache (struct region_cache *);
diff --git a/src/scroll.c b/src/scroll.c
index fcec596daa3..ba012874460 100644
--- a/src/scroll.c
+++ b/src/scroll.c
@@ -882,44 +882,6 @@ scrolling_max_lines_saved (int start, int end,
882 return matchcount; 882 return matchcount;
883} 883}
884 884
885/* Return a measure of the cost of moving the lines starting with vpos
886 FROM, up to but not including vpos TO, down by AMOUNT lines (AMOUNT
887 may be negative). */
888
889int
890scroll_cost (FRAME_PTR frame, int from, int to, int amount)
891{
892 /* Compute how many lines, at bottom of frame,
893 will not be involved in actual motion. */
894 EMACS_INT limit = to;
895 EMACS_INT offset;
896 EMACS_INT height = FRAME_LINES (frame);
897
898 if (amount == 0)
899 return 0;
900
901 if (! FRAME_SCROLL_REGION_OK (frame))
902 limit = height;
903 else if (amount > 0)
904 limit += amount;
905
906 if (amount < 0)
907 {
908 int temp = to;
909 to = from + amount;
910 from = temp + amount;
911 amount = - amount;
912 }
913
914 offset = height - limit;
915
916 return
917 (FRAME_INSERT_COST (frame)[offset + from]
918 + (amount - 1) * FRAME_INSERTN_COST (frame)[offset + from]
919 + FRAME_DELETE_COST (frame)[offset + to]
920 + (amount - 1) * FRAME_DELETEN_COST (frame)[offset + to]);
921}
922
923/* Calculate the line insertion/deletion 885/* Calculate the line insertion/deletion
924 overhead and multiply factor values */ 886 overhead and multiply factor values */
925 887
diff --git a/src/search.c b/src/search.c
index d9be8ca0105..6c835f2cc64 100644
--- a/src/search.c
+++ b/src/search.c
@@ -53,10 +53,10 @@ struct regexp_cache
53}; 53};
54 54
55/* The instances of that struct. */ 55/* The instances of that struct. */
56struct regexp_cache searchbufs[REGEXP_CACHE_SIZE]; 56static struct regexp_cache searchbufs[REGEXP_CACHE_SIZE];
57 57
58/* The head of the linked list; points to the most recently used buffer. */ 58/* The head of the linked list; points to the most recently used buffer. */
59struct regexp_cache *searchbuf_head; 59static struct regexp_cache *searchbuf_head;
60 60
61 61
62/* Every call to re_match, etc., must pass &search_regs as the regs 62/* Every call to re_match, etc., must pass &search_regs as the regs
@@ -85,10 +85,10 @@ static Lisp_Object last_thing_searched;
85 85
86/* error condition signaled when regexp compile_pattern fails */ 86/* error condition signaled when regexp compile_pattern fails */
87 87
88Lisp_Object Qinvalid_regexp; 88static Lisp_Object Qinvalid_regexp;
89 89
90/* Error condition used for failing searches */ 90/* Error condition used for failing searches */
91Lisp_Object Qsearch_failed; 91static Lisp_Object Qsearch_failed;
92 92
93static void set_search_regs (EMACS_INT, EMACS_INT); 93static void set_search_regs (EMACS_INT, EMACS_INT);
94static void save_search_regs (void); 94static void save_search_regs (void);
diff --git a/src/sound.c b/src/sound.c
index c0741f27ff6..55207ddcf51 100644
--- a/src/sound.c
+++ b/src/sound.c
@@ -94,9 +94,9 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
94 94
95/* Symbols. */ 95/* Symbols. */
96 96
97Lisp_Object QCvolume, QCdevice; 97static Lisp_Object QCvolume, QCdevice;
98Lisp_Object Qsound; 98static Lisp_Object Qsound;
99Lisp_Object Qplay_sound_functions; 99static Lisp_Object Qplay_sound_functions;
100 100
101/* Indices of attributes in a sound attributes vector. */ 101/* Indices of attributes in a sound attributes vector. */
102 102
@@ -281,8 +281,8 @@ struct sound
281/* These are set during `play-sound-internal' so that sound_cleanup has 281/* These are set during `play-sound-internal' so that sound_cleanup has
282 access to them. */ 282 access to them. */
283 283
284struct sound_device *current_sound_device; 284static struct sound_device *current_sound_device;
285struct sound *current_sound; 285static struct sound *current_sound;
286 286
287/* Function prototypes. */ 287/* Function prototypes. */
288 288
diff --git a/src/syntax.c b/src/syntax.c
index 1301c0689ad..031409144b1 100644
--- a/src/syntax.c
+++ b/src/syntax.c
@@ -95,12 +95,15 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
95#define ST_COMMENT_STYLE (256 + 1) 95#define ST_COMMENT_STYLE (256 + 1)
96#define ST_STRING_STYLE (256 + 2) 96#define ST_STRING_STYLE (256 + 2)
97 97
98Lisp_Object Qsyntax_table_p, Qsyntax_table, Qscan_error; 98static Lisp_Object Qsyntax_table_p;
99static Lisp_Object Qsyntax_table, Qscan_error;
99 100
101#ifndef __GNUC__
100/* Used as a temporary in SYNTAX_ENTRY and other macros in syntax.h, 102/* Used as a temporary in SYNTAX_ENTRY and other macros in syntax.h,
101 if not compiled with GCC. No need to mark it, since it is used 103 if not compiled with GCC. No need to mark it, since it is used
102 only very temporarily. */ 104 only very temporarily. */
103Lisp_Object syntax_temp; 105Lisp_Object syntax_temp;
106#endif
104 107
105/* This is the internal form of the parse state used in parse-partial-sexp. */ 108/* This is the internal form of the parse state used in parse-partial-sexp. */
106 109
@@ -138,6 +141,7 @@ static EMACS_INT find_start_begv;
138static int find_start_modiff; 141static int find_start_modiff;
139 142
140 143
144static Lisp_Object Fsyntax_table_p (Lisp_Object);
141static Lisp_Object skip_chars (int, Lisp_Object, Lisp_Object, int); 145static Lisp_Object skip_chars (int, Lisp_Object, Lisp_Object, int);
142static Lisp_Object skip_syntaxes (int, Lisp_Object, Lisp_Object); 146static Lisp_Object skip_syntaxes (int, Lisp_Object, Lisp_Object);
143static Lisp_Object scan_lists (EMACS_INT, EMACS_INT, EMACS_INT, int); 147static Lisp_Object scan_lists (EMACS_INT, EMACS_INT, EMACS_INT, int);
@@ -1366,8 +1370,6 @@ and the function returns nil. Field boundaries are not noticed if
1366 return val == orig_val ? Qt : Qnil; 1370 return val == orig_val ? Qt : Qnil;
1367} 1371}
1368 1372
1369Lisp_Object skip_chars (int, Lisp_Object, Lisp_Object, int);
1370
1371DEFUN ("skip-chars-forward", Fskip_chars_forward, Sskip_chars_forward, 1, 2, 0, 1373DEFUN ("skip-chars-forward", Fskip_chars_forward, Sskip_chars_forward, 1, 2, 0,
1372 doc: /* Move point forward, stopping before a char not in STRING, or at pos LIM. 1374 doc: /* Move point forward, stopping before a char not in STRING, or at pos LIM.
1373STRING is like the inside of a `[...]' in a regular expression 1375STRING is like the inside of a `[...]' in a regular expression
diff --git a/src/syntax.h b/src/syntax.h
index e8726bb28a4..2b052715dac 100644
--- a/src/syntax.h
+++ b/src/syntax.h
@@ -19,7 +19,6 @@ You should have received a copy of the GNU General Public License
19along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */ 19along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
20 20
21 21
22extern Lisp_Object Qsyntax_table_p;
23extern void update_syntax_table (EMACS_INT, int, int, Lisp_Object); 22extern void update_syntax_table (EMACS_INT, int, int, Lisp_Object);
24 23
25/* The standard syntax table is stored where it will automatically 24/* The standard syntax table is stored where it will automatically
@@ -300,4 +299,3 @@ struct gl_state_s
300 299
301extern struct gl_state_s gl_state; 300extern struct gl_state_s gl_state;
302extern EMACS_INT scan_words (EMACS_INT, EMACS_INT); 301extern EMACS_INT scan_words (EMACS_INT, EMACS_INT);
303
diff --git a/src/sysdep.c b/src/sysdep.c
index 8d0bd3df9cc..06fbd2b7d0f 100644
--- a/src/sysdep.c
+++ b/src/sysdep.c
@@ -118,6 +118,12 @@ struct utimbuf {
118#endif 118#endif
119#endif 119#endif
120 120
121static int emacs_get_tty (int, struct emacs_tty *);
122static int emacs_set_tty (int, struct emacs_tty *, int);
123#if defined TIOCNOTTY || defined USG5 || defined CYGWIN
124static void croak (char *) NO_RETURN;
125#endif
126
121/* Declare here, including term.h is problematic on some systems. */ 127/* Declare here, including term.h is problematic on some systems. */
122extern void tputs (const char *, int, int (*)(int)); 128extern void tputs (const char *, int, int (*)(int));
123 129
@@ -127,12 +133,6 @@ static const int baud_convert[] =
127 1800, 2400, 4800, 9600, 19200, 38400 133 1800, 2400, 4800, 9600, 19200, 38400
128 }; 134 };
129 135
130void croak (char *) NO_RETURN;
131
132/* Temporary used by `sigblock' when defined in terms of signprocmask. */
133
134SIGMASKTYPE sigprocmask_set;
135
136 136
137#if !defined (HAVE_GET_CURRENT_DIR_NAME) || defined (BROKEN_GET_CURRENT_DIR_NAME) 137#if !defined (HAVE_GET_CURRENT_DIR_NAME) || defined (BROKEN_GET_CURRENT_DIR_NAME)
138 138
@@ -291,8 +291,9 @@ init_baud_rate (int fd)
291 291
292 292
293 293
294int wait_debugging; /* Set nonzero to make following function work under dbx 294/* Set nonzero to make following function work under dbx
295 (at least for bsd). */ 295 (at least for bsd). */
296int wait_debugging EXTERNALLY_VISIBLE;
296 297
297#ifndef MSDOS 298#ifndef MSDOS
298/* Wait for subprocess with process id `pid' to terminate and 299/* Wait for subprocess with process id `pid' to terminate and
@@ -650,7 +651,7 @@ unrequest_sigio (void)
650#else 651#else
651#ifdef F_SETFL 652#ifdef F_SETFL
652 653
653int old_fcntl_flags[MAXDESC]; 654static int old_fcntl_flags[MAXDESC];
654 655
655void 656void
656init_sigio (int fd) 657init_sigio (int fd)
@@ -809,7 +810,7 @@ emacs_set_tty (int fd, struct emacs_tty *settings, int flushp)
809 810
810 811
811#ifdef F_SETOWN 812#ifdef F_SETOWN
812int old_fcntl_owner[MAXDESC]; 813static int old_fcntl_owner[MAXDESC];
813#endif /* F_SETOWN */ 814#endif /* F_SETOWN */
814 815
815/* This may also be defined in stdio, 816/* This may also be defined in stdio,
@@ -1451,7 +1452,7 @@ init_system_name (void)
1451/* POSIX signals support - DJB */ 1452/* POSIX signals support - DJB */
1452/* Anyone with POSIX signals should have ANSI C declarations */ 1453/* Anyone with POSIX signals should have ANSI C declarations */
1453 1454
1454sigset_t empty_mask, full_mask; 1455sigset_t empty_mask;
1455 1456
1456#ifndef WINDOWSNT 1457#ifndef WINDOWSNT
1457 1458
@@ -1540,7 +1541,6 @@ void
1540init_signals (void) 1541init_signals (void)
1541{ 1542{
1542 sigemptyset (&empty_mask); 1543 sigemptyset (&empty_mask);
1543 sigfillset (&full_mask);
1544 1544
1545#if !defined HAVE_STRSIGNAL && !HAVE_DECL_SYS_SIGLIST 1545#if !defined HAVE_STRSIGNAL && !HAVE_DECL_SYS_SIGLIST
1546 if (! initialized) 1546 if (! initialized)
diff --git a/src/syssignal.h b/src/syssignal.h
index 03768168e20..c5c749407cc 100644
--- a/src/syssignal.h
+++ b/src/syssignal.h
@@ -35,8 +35,7 @@ extern void init_signals (void);
35#define SIGMASKTYPE sigset_t 35#define SIGMASKTYPE sigset_t
36 36
37#define SIGEMPTYMASK (empty_mask) 37#define SIGEMPTYMASK (empty_mask)
38#define SIGFULLMASK (full_mask) 38extern sigset_t empty_mask;
39extern sigset_t empty_mask, full_mask;
40 39
41/* POSIX pretty much destroys any possibility of writing sigmask as a 40/* POSIX pretty much destroys any possibility of writing sigmask as a
42 macro in standard C. We always define our own version because the 41 macro in standard C. We always define our own version because the
@@ -75,6 +74,9 @@ signal_handler_t sys_signal (int signal_number, signal_handler_t action);
75sigset_t sys_sigblock (sigset_t new_mask); 74sigset_t sys_sigblock (sigset_t new_mask);
76sigset_t sys_sigunblock (sigset_t new_mask); 75sigset_t sys_sigunblock (sigset_t new_mask);
77sigset_t sys_sigsetmask (sigset_t new_mask); 76sigset_t sys_sigsetmask (sigset_t new_mask);
77#if ! (defined TIOCNOTTY || defined USG5 || defined CYGWIN)
78void croak (char *) NO_RETURN;
79#endif
78 80
79#define sys_sigdel(MASK,SIG) sigdelset (&MASK,SIG) 81#define sys_sigdel(MASK,SIG) sigdelset (&MASK,SIG)
80 82
diff --git a/src/systty.h b/src/systty.h
index 1548952e7a8..647cfa23cee 100644
--- a/src/systty.h
+++ b/src/systty.h
@@ -115,9 +115,6 @@ struct emacs_tty {
115#endif /* DOS_NT */ 115#endif /* DOS_NT */
116}; 116};
117 117
118extern int emacs_get_tty (int, struct emacs_tty *);
119extern int emacs_set_tty (int, struct emacs_tty *, int);
120
121/* From sysdep.c or w32.c */ 118/* From sysdep.c or w32.c */
122extern int serial_open (char *); 119extern int serial_open (char *);
123extern void serial_configure (struct Lisp_Process *, Lisp_Object); 120extern void serial_configure (struct Lisp_Process *, Lisp_Object);
diff --git a/src/term.c b/src/term.c
index ea856543a7d..df13d7c0db2 100644
--- a/src/term.c
+++ b/src/term.c
@@ -77,9 +77,11 @@ static int been_here = -1;
77static void tty_set_scroll_region (struct frame *f, int start, int stop); 77static void tty_set_scroll_region (struct frame *f, int start, int stop);
78static void turn_on_face (struct frame *, int face_id); 78static void turn_on_face (struct frame *, int face_id);
79static void turn_off_face (struct frame *, int face_id); 79static void turn_off_face (struct frame *, int face_id);
80static void tty_turn_off_highlight (struct tty_display_info *);
80static void tty_show_cursor (struct tty_display_info *); 81static void tty_show_cursor (struct tty_display_info *);
81static void tty_hide_cursor (struct tty_display_info *); 82static void tty_hide_cursor (struct tty_display_info *);
82static void tty_background_highlight (struct tty_display_info *tty); 83static void tty_background_highlight (struct tty_display_info *tty);
84static struct terminal *get_tty_terminal (Lisp_Object, int);
83static void clear_tty_hooks (struct terminal *terminal); 85static void clear_tty_hooks (struct terminal *terminal);
84static void set_tty_hooks (struct terminal *terminal); 86static void set_tty_hooks (struct terminal *terminal);
85static void dissociate_if_controlling_tty (int fd); 87static void dissociate_if_controlling_tty (int fd);
@@ -133,11 +135,11 @@ enum no_color_bit
133 135
134/* The largest frame width in any call to calculate_costs. */ 136/* The largest frame width in any call to calculate_costs. */
135 137
136int max_frame_cols; 138static int max_frame_cols;
137 139
138/* The largest frame height in any call to calculate_costs. */ 140/* The largest frame height in any call to calculate_costs. */
139 141
140int max_frame_lines; 142static int max_frame_lines;
141 143
142/* Non-zero if we have dropped our controlling tty and therefore 144/* Non-zero if we have dropped our controlling tty and therefore
143 should not open a frame on stdout. */ 145 should not open a frame on stdout. */
@@ -173,7 +175,7 @@ tty_ring_bell (struct frame *f)
173 175
174/* Set up termcap modes for Emacs. */ 176/* Set up termcap modes for Emacs. */
175 177
176void 178static void
177tty_set_terminal_modes (struct terminal *terminal) 179tty_set_terminal_modes (struct terminal *terminal)
178{ 180{
179 struct tty_display_info *tty = terminal->display_info.tty; 181 struct tty_display_info *tty = terminal->display_info.tty;
@@ -201,7 +203,7 @@ tty_set_terminal_modes (struct terminal *terminal)
201 203
202/* Reset termcap modes before exiting Emacs. */ 204/* Reset termcap modes before exiting Emacs. */
203 205
204void 206static void
205tty_reset_terminal_modes (struct terminal *terminal) 207tty_reset_terminal_modes (struct terminal *terminal)
206{ 208{
207 struct tty_display_info *tty = terminal->display_info.tty; 209 struct tty_display_info *tty = terminal->display_info.tty;
@@ -286,7 +288,7 @@ tty_turn_off_insert (struct tty_display_info *tty)
286 288
287/* Handle highlighting. */ 289/* Handle highlighting. */
288 290
289void 291static void
290tty_turn_off_highlight (struct tty_display_info *tty) 292tty_turn_off_highlight (struct tty_display_info *tty)
291{ 293{
292 if (tty->standout_mode) 294 if (tty->standout_mode)
@@ -2368,7 +2370,7 @@ set_tty_color_mode (struct tty_display_info *tty, struct frame *f)
2368 2370
2369/* Return the tty display object specified by TERMINAL. */ 2371/* Return the tty display object specified by TERMINAL. */
2370 2372
2371struct terminal * 2373static struct terminal *
2372get_tty_terminal (Lisp_Object terminal, int throw) 2374get_tty_terminal (Lisp_Object terminal, int throw)
2373{ 2375{
2374 struct terminal *t = get_terminal (terminal, throw); 2376 struct terminal *t = get_terminal (terminal, throw);
@@ -2614,6 +2616,8 @@ frame's terminal). */)
2614 ***********************************************************************/ 2616 ***********************************************************************/
2615 2617
2616#ifdef HAVE_GPM 2618#ifdef HAVE_GPM
2619
2620#ifndef HAVE_WINDOW_SYSTEM
2617void 2621void
2618term_mouse_moveto (int x, int y) 2622term_mouse_moveto (int x, int y)
2619{ 2623{
@@ -2627,6 +2631,7 @@ term_mouse_moveto (int x, int y)
2627 last_mouse_x = x; 2631 last_mouse_x = x;
2628 last_mouse_y = y; */ 2632 last_mouse_y = y; */
2629} 2633}
2634#endif /* HAVE_WINDOW_SYSTEM */
2630 2635
2631/* Implementation of draw_row_with_mouse_face for TTY/GPM. */ 2636/* Implementation of draw_row_with_mouse_face for TTY/GPM. */
2632void 2637void
diff --git a/src/termhooks.h b/src/termhooks.h
index 0ccd2dac9e1..2f509009bd9 100644
--- a/src/termhooks.h
+++ b/src/termhooks.h
@@ -306,7 +306,9 @@ enum {
306#ifdef HAVE_GPM 306#ifdef HAVE_GPM
307#include <gpm.h> 307#include <gpm.h>
308extern int handle_one_term_event (struct tty_display_info *, Gpm_Event *, struct input_event *); 308extern int handle_one_term_event (struct tty_display_info *, Gpm_Event *, struct input_event *);
309#ifndef HAVE_WINDOW_SYSTEM
309extern void term_mouse_moveto (int, int); 310extern void term_mouse_moveto (int, int);
311#endif
310 312
311/* The device for which we have enabled gpm support. */ 313/* The device for which we have enabled gpm support. */
312extern struct tty_display_info *gpm_tty; 314extern struct tty_display_info *gpm_tty;
@@ -660,4 +662,3 @@ extern unsigned char *encode_terminal_code (struct glyph *, int,
660#ifdef HAVE_GPM 662#ifdef HAVE_GPM
661extern void close_gpm (int gpm_fd); 663extern void close_gpm (int gpm_fd);
662#endif 664#endif
663
diff --git a/src/textprop.c b/src/textprop.c
index 53f92ec936b..a0d7d2689c4 100644
--- a/src/textprop.c
+++ b/src/textprop.c
@@ -47,16 +47,19 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
47 47
48 48
49/* Types of hooks. */ 49/* Types of hooks. */
50Lisp_Object Qmouse_left; 50static Lisp_Object Qmouse_left;
51Lisp_Object Qmouse_entered; 51static Lisp_Object Qmouse_entered;
52Lisp_Object Qpoint_left; 52Lisp_Object Qpoint_left;
53Lisp_Object Qpoint_entered; 53Lisp_Object Qpoint_entered;
54Lisp_Object Qcategory; 54Lisp_Object Qcategory;
55Lisp_Object Qlocal_map; 55Lisp_Object Qlocal_map;
56 56
57/* Visual properties text (including strings) may have. */ 57/* Visual properties text (including strings) may have. */
58Lisp_Object Qforeground, Qbackground, Qfont, Qunderline, Qstipple; 58static Lisp_Object Qforeground, Qbackground, Qunderline;
59Lisp_Object Qinvisible, Qread_only, Qintangible, Qmouse_face; 59Lisp_Object Qfont;
60static Lisp_Object Qstipple;
61Lisp_Object Qinvisible, Qintangible, Qmouse_face;
62static Lisp_Object Qread_only;
60Lisp_Object Qminibuffer_prompt; 63Lisp_Object Qminibuffer_prompt;
61 64
62/* Sticky properties */ 65/* Sticky properties */
@@ -69,10 +72,12 @@ Lisp_Object Qfront_sticky, Qrear_nonsticky;
69 72
70/* verify_interval_modification saves insertion hooks here 73/* verify_interval_modification saves insertion hooks here
71 to be run later by report_interval_modification. */ 74 to be run later by report_interval_modification. */
72Lisp_Object interval_insert_behind_hooks; 75static Lisp_Object interval_insert_behind_hooks;
73Lisp_Object interval_insert_in_front_hooks; 76static Lisp_Object interval_insert_in_front_hooks;
74 77
75static void text_read_only (Lisp_Object) NO_RETURN; 78static void text_read_only (Lisp_Object) NO_RETURN;
79static Lisp_Object Fprevious_property_change (Lisp_Object, Lisp_Object,
80 Lisp_Object);
76 81
77 82
78/* Signal a `text-read-only' error. This function makes it easier 83/* Signal a `text-read-only' error. This function makes it easier
diff --git a/src/undo.c b/src/undo.c
index d11cd6f5570..80aff50d18a 100644
--- a/src/undo.c
+++ b/src/undo.c
@@ -26,11 +26,11 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
26 26
27/* Last buffer for which undo information was recorded. */ 27/* Last buffer for which undo information was recorded. */
28/* BEWARE: This is not traced by the GC, so never dereference it! */ 28/* BEWARE: This is not traced by the GC, so never dereference it! */
29struct buffer *last_undo_buffer; 29static struct buffer *last_undo_buffer;
30 30
31/* Position of point last time we inserted a boundary. */ 31/* Position of point last time we inserted a boundary. */
32struct buffer *last_boundary_buffer; 32static struct buffer *last_boundary_buffer;
33EMACS_INT last_boundary_position; 33static EMACS_INT last_boundary_position;
34 34
35Lisp_Object Qinhibit_read_only; 35Lisp_Object Qinhibit_read_only;
36 36
@@ -43,7 +43,7 @@ Lisp_Object Qapply;
43 which will be added to the list at the end of the command. 43 which will be added to the list at the end of the command.
44 This ensures we can't run out of space while trying to make 44 This ensures we can't run out of space while trying to make
45 an undo-boundary. */ 45 an undo-boundary. */
46Lisp_Object pending_boundary; 46static Lisp_Object pending_boundary;
47 47
48/* Record point as it was at beginning of this command (if necessary) 48/* Record point as it was at beginning of this command (if necessary)
49 and prepare the undo info for recording a change. 49 and prepare the undo info for recording a change.
@@ -711,4 +711,3 @@ so it must make sure not to do a lot of consing. */);
711 doc: /* Non-nil means do not record `point' in `buffer-undo-list'. */); 711 doc: /* Non-nil means do not record `point' in `buffer-undo-list'. */);
712 undo_inhibit_record_point = 0; 712 undo_inhibit_record_point = 0;
713} 713}
714
diff --git a/src/window.c b/src/window.c
index a8a6fceaaee..5d059535614 100644
--- a/src/window.c
+++ b/src/window.c
@@ -50,10 +50,11 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
50#include "nsterm.h" 50#include "nsterm.h"
51#endif 51#endif
52 52
53Lisp_Object Qwindowp, Qwindow_live_p, Qwindow_configuration_p; 53Lisp_Object Qwindowp, Qwindow_live_p;
54Lisp_Object Qdisplay_buffer; 54static Lisp_Object Qwindow_configuration_p;
55Lisp_Object Qscroll_up, Qscroll_down, Qscroll_command; 55static Lisp_Object Qdisplay_buffer;
56Lisp_Object Qwindow_size_fixed; 56static Lisp_Object Qscroll_up, Qscroll_down, Qscroll_command;
57static Lisp_Object Qwindow_size_fixed;
57 58
58static int displayed_window_lines (struct window *); 59static int displayed_window_lines (struct window *);
59static struct window *decode_window (Lisp_Object); 60static struct window *decode_window (Lisp_Object);
@@ -116,7 +117,7 @@ Lisp_Object minibuf_selected_window;
116 117
117/* Hook run at end of temp_output_buffer_show. */ 118/* Hook run at end of temp_output_buffer_show. */
118 119
119Lisp_Object Qtemp_buffer_show_hook; 120static Lisp_Object Qtemp_buffer_show_hook;
120 121
121/* Incremented for each window created. */ 122/* Incremented for each window created. */
122 123
@@ -131,7 +132,7 @@ static int window_initialized;
131static Lisp_Object Qwindow_configuration_change_hook; 132static Lisp_Object Qwindow_configuration_change_hook;
132/* Incremented by 1 whenever a window is deleted. */ 133/* Incremented by 1 whenever a window is deleted. */
133 134
134int window_deletion_count; 135static int window_deletion_count;
135 136
136/* Used by the function window_scroll_pixel_based */ 137/* Used by the function window_scroll_pixel_based */
137 138
@@ -235,7 +236,8 @@ used by that frame. */)
235 return FRAME_MINIBUF_WINDOW (XFRAME (frame)); 236 return FRAME_MINIBUF_WINDOW (XFRAME (frame));
236} 237}
237 238
238DEFUN ("window-minibuffer-p", Fwindow_minibuffer_p, Swindow_minibuffer_p, 0, 1, 0, 239DEFUN ("window-minibuffer-p", Fwindow_minibuffer_p,
240 Swindow_minibuffer_p, 0, 1, 0,
239 doc: /* Return non-nil if WINDOW is a minibuffer window. 241 doc: /* Return non-nil if WINDOW is a minibuffer window.
240WINDOW defaults to the selected window. */) 242WINDOW defaults to the selected window. */)
241 (Lisp_Object window) 243 (Lisp_Object window)
@@ -2336,6 +2338,7 @@ window_loop (enum window_loop type, Lisp_Object obj, int mini, Lisp_Object frame
2336 2338
2337/* Used for debugging. Abort if any window has a dead buffer. */ 2339/* Used for debugging. Abort if any window has a dead buffer. */
2338 2340
2341extern void check_all_windows (void) EXTERNALLY_VISIBLE;
2339void 2342void
2340check_all_windows (void) 2343check_all_windows (void)
2341{ 2344{
@@ -3275,8 +3278,12 @@ change_window_heights (Lisp_Object window, int n)
3275 3278
3276int window_select_count; 3279int window_select_count;
3277 3280
3278EXFUN (Fset_window_fringes, 4); 3281static Lisp_Object Fset_window_margins (Lisp_Object, Lisp_Object, Lisp_Object);
3279EXFUN (Fset_window_scroll_bars, 4); 3282static Lisp_Object Fset_window_fringes (Lisp_Object, Lisp_Object, Lisp_Object,
3283 Lisp_Object);
3284static Lisp_Object Fset_window_scroll_bars (Lisp_Object, Lisp_Object,
3285 Lisp_Object, Lisp_Object);
3286static Lisp_Object Fset_window_vscroll (Lisp_Object, Lisp_Object, Lisp_Object);
3280 3287
3281static void 3288static void
3282run_funs (Lisp_Object funs) 3289run_funs (Lisp_Object funs)
@@ -6607,8 +6614,8 @@ Value is a list of the form (LEFT-WIDTH RIGHT-WIDTH OUTSIDE-MARGINS). */)
6607 Scroll bars 6614 Scroll bars
6608 ***********************************************************************/ 6615 ***********************************************************************/
6609 6616
6610DEFUN ("set-window-scroll-bars", Fset_window_scroll_bars, Sset_window_scroll_bars, 6617DEFUN ("set-window-scroll-bars", Fset_window_scroll_bars,
6611 2, 4, 0, 6618 Sset_window_scroll_bars, 2, 4, 0,
6612 doc: /* Set width and type of scroll bars of window WINDOW. 6619 doc: /* Set width and type of scroll bars of window WINDOW.
6613If window is nil, set scroll bars of the currently selected window. 6620If window is nil, set scroll bars of the currently selected window.
6614Second parameter WIDTH specifies the pixel width for the scroll bar; 6621Second parameter WIDTH specifies the pixel width for the scroll bar;
diff --git a/src/window.h b/src/window.h
index ad627aca340..65d554a5501 100644
--- a/src/window.h
+++ b/src/window.h
@@ -763,8 +763,6 @@ extern Lisp_Object Vmouse_event;
763EXFUN (Fnext_window, 3); 763EXFUN (Fnext_window, 3);
764EXFUN (Fselect_window, 2); 764EXFUN (Fselect_window, 2);
765EXFUN (Fset_window_buffer, 3); 765EXFUN (Fset_window_buffer, 3);
766EXFUN (Fset_window_vscroll, 3);
767EXFUN (Fset_window_margins, 3);
768EXFUN (Fset_window_point, 2); 766EXFUN (Fset_window_point, 2);
769extern Lisp_Object make_window (void); 767extern Lisp_Object make_window (void);
770extern Lisp_Object window_from_coordinates (struct frame *, int, int, 768extern Lisp_Object window_from_coordinates (struct frame *, int, int,
@@ -778,7 +776,6 @@ extern void freeze_window_starts (struct frame *, int);
778extern void grow_mini_window (struct window *, int); 776extern void grow_mini_window (struct window *, int);
779extern void shrink_mini_window (struct window *); 777extern void shrink_mini_window (struct window *);
780extern int window_relative_x_coord (struct window *, enum window_part, int); 778extern int window_relative_x_coord (struct window *, enum window_part, int);
781extern void check_all_windows (void);
782 779
783void run_window_configuration_change_hook (struct frame *f); 780void run_window_configuration_change_hook (struct frame *f);
784 781
diff --git a/src/xdisp.c b/src/xdisp.c
index fc9771b6a7e..4f1830f4c6c 100644
--- a/src/xdisp.c
+++ b/src/xdisp.c
@@ -318,29 +318,31 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
318 318
319Lisp_Object Qoverriding_local_map, Qoverriding_terminal_local_map; 319Lisp_Object Qoverriding_local_map, Qoverriding_terminal_local_map;
320Lisp_Object Qwindow_scroll_functions; 320Lisp_Object Qwindow_scroll_functions;
321Lisp_Object Qwindow_text_change_functions; 321static Lisp_Object Qwindow_text_change_functions;
322Lisp_Object Qredisplay_end_trigger_functions; 322static Lisp_Object Qredisplay_end_trigger_functions;
323Lisp_Object Qinhibit_point_motion_hooks; 323Lisp_Object Qinhibit_point_motion_hooks;
324Lisp_Object QCeval, QCfile, QCdata, QCpropertize; 324static Lisp_Object QCeval, QCpropertize;
325Lisp_Object Qfontified; 325Lisp_Object QCfile, QCdata;
326Lisp_Object Qgrow_only; 326static Lisp_Object Qfontified;
327Lisp_Object Qinhibit_eval_during_redisplay; 327static Lisp_Object Qgrow_only;
328Lisp_Object Qbuffer_position, Qposition, Qobject; 328static Lisp_Object Qinhibit_eval_during_redisplay;
329Lisp_Object Qright_to_left, Qleft_to_right; 329static Lisp_Object Qbuffer_position, Qposition, Qobject;
330static Lisp_Object Qright_to_left, Qleft_to_right;
330 331
331/* Cursor shapes */ 332/* Cursor shapes */
332Lisp_Object Qbar, Qhbar, Qbox, Qhollow; 333Lisp_Object Qbar, Qhbar, Qbox, Qhollow;
333 334
334/* Pointer shapes */ 335/* Pointer shapes */
335Lisp_Object Qarrow, Qhand, Qtext; 336static Lisp_Object Qarrow, Qhand;
337Lisp_Object Qtext;
336 338
337/* Holds the list (error). */ 339/* Holds the list (error). */
338Lisp_Object list_of_error; 340static Lisp_Object list_of_error;
339 341
340Lisp_Object Qfontification_functions; 342static Lisp_Object Qfontification_functions;
341 343
342Lisp_Object Qwrap_prefix; 344static Lisp_Object Qwrap_prefix;
343Lisp_Object Qline_prefix; 345static Lisp_Object Qline_prefix;
344 346
345/* Non-nil means don't actually do any redisplay. */ 347/* Non-nil means don't actually do any redisplay. */
346 348
@@ -350,12 +352,14 @@ Lisp_Object Qinhibit_redisplay;
350 352
351Lisp_Object Qdisplay; 353Lisp_Object Qdisplay;
352 354
353Lisp_Object Qspace, QCalign_to, QCrelative_width, QCrelative_height; 355Lisp_Object Qspace, QCalign_to;
354Lisp_Object Qleft_margin, Qright_margin, Qspace_width, Qraise; 356static Lisp_Object QCrelative_width, QCrelative_height;
355Lisp_Object Qslice; 357Lisp_Object Qleft_margin, Qright_margin;
358static Lisp_Object Qspace_width, Qraise;
359static Lisp_Object Qslice;
356Lisp_Object Qcenter; 360Lisp_Object Qcenter;
357Lisp_Object Qmargin, Qpointer; 361static Lisp_Object Qmargin, Qpointer;
358Lisp_Object Qline_height; 362static Lisp_Object Qline_height;
359 363
360#ifdef HAVE_WINDOW_SYSTEM 364#ifdef HAVE_WINDOW_SYSTEM
361 365
@@ -383,15 +387,15 @@ Lisp_Object Qline_height;
383 387
384/* Name of the face used to highlight trailing whitespace. */ 388/* Name of the face used to highlight trailing whitespace. */
385 389
386Lisp_Object Qtrailing_whitespace; 390static Lisp_Object Qtrailing_whitespace;
387 391
388/* Name and number of the face used to highlight escape glyphs. */ 392/* Name and number of the face used to highlight escape glyphs. */
389 393
390Lisp_Object Qescape_glyph; 394static Lisp_Object Qescape_glyph;
391 395
392/* Name and number of the face used to highlight non-breaking spaces. */ 396/* Name and number of the face used to highlight non-breaking spaces. */
393 397
394Lisp_Object Qnobreak_space; 398static Lisp_Object Qnobreak_space;
395 399
396/* The symbol `image' which is the car of the lists used to represent 400/* The symbol `image' which is the car of the lists used to represent
397 images in Lisp. Also a tool bar style. */ 401 images in Lisp. Also a tool bar style. */
@@ -399,8 +403,9 @@ Lisp_Object Qnobreak_space;
399Lisp_Object Qimage; 403Lisp_Object Qimage;
400 404
401/* The image map types. */ 405/* The image map types. */
402Lisp_Object QCmap, QCpointer; 406Lisp_Object QCmap;
403Lisp_Object Qrect, Qcircle, Qpoly; 407static Lisp_Object QCpointer;
408static Lisp_Object Qrect, Qcircle, Qpoly;
404 409
405/* Tool bar styles */ 410/* Tool bar styles */
406Lisp_Object Qboth, Qboth_horiz, Qtext_image_horiz; 411Lisp_Object Qboth, Qboth_horiz, Qtext_image_horiz;
@@ -460,12 +465,12 @@ static struct buffer *this_line_buffer;
460 Voverlay_arrow_position is a marker, last-arrow-position is its 465 Voverlay_arrow_position is a marker, last-arrow-position is its
461 numerical position. */ 466 numerical position. */
462 467
463Lisp_Object Qlast_arrow_position, Qlast_arrow_string; 468static Lisp_Object Qlast_arrow_position, Qlast_arrow_string;
464 469
465/* Alternative overlay-arrow-string and overlay-arrow-bitmap 470/* Alternative overlay-arrow-string and overlay-arrow-bitmap
466 properties on a symbol in overlay-arrow-variable-list. */ 471 properties on a symbol in overlay-arrow-variable-list. */
467 472
468Lisp_Object Qoverlay_arrow_string, Qoverlay_arrow_bitmap; 473static Lisp_Object Qoverlay_arrow_string, Qoverlay_arrow_bitmap;
469 474
470Lisp_Object Qmenu_bar_update_hook; 475Lisp_Object Qmenu_bar_update_hook;
471 476
@@ -494,12 +499,12 @@ Lisp_Object echo_area_window;
494 message_enable_multibyte on the stack, the function restore_message 499 message_enable_multibyte on the stack, the function restore_message
495 pops the stack and displays MESSAGE again. */ 500 pops the stack and displays MESSAGE again. */
496 501
497Lisp_Object Vmessage_stack; 502static Lisp_Object Vmessage_stack;
498 503
499/* Nonzero means multibyte characters were enabled when the echo area 504/* Nonzero means multibyte characters were enabled when the echo area
500 message was specified. */ 505 message was specified. */
501 506
502int message_enable_multibyte; 507static int message_enable_multibyte;
503 508
504/* Nonzero if we should redraw the mode lines on the next redisplay. */ 509/* Nonzero if we should redraw the mode lines on the next redisplay. */
505 510
@@ -517,7 +522,7 @@ int cursor_type_changed;
517/* Nonzero after display_mode_line if %l was used and it displayed a 522/* Nonzero after display_mode_line if %l was used and it displayed a
518 line number. */ 523 line number. */
519 524
520int line_number_displayed; 525static int line_number_displayed;
521 526
522/* The name of the *Messages* buffer, a string. */ 527/* The name of the *Messages* buffer, a string. */
523 528
@@ -544,12 +549,12 @@ static int display_last_displayed_message_p;
544/* Nonzero if echo area is being used by print; zero if being used by 549/* Nonzero if echo area is being used by print; zero if being used by
545 message. */ 550 message. */
546 551
547int message_buf_print; 552static int message_buf_print;
548 553
549/* The symbol `inhibit-menubar-update' and its DEFVAR_BOOL variable. */ 554/* The symbol `inhibit-menubar-update' and its DEFVAR_BOOL variable. */
550 555
551Lisp_Object Qinhibit_menubar_update; 556static Lisp_Object Qinhibit_menubar_update;
552Lisp_Object Qmessage_truncate_lines; 557static Lisp_Object Qmessage_truncate_lines;
553 558
554/* Set to 1 in clear_message to make redisplay_internal aware 559/* Set to 1 in clear_message to make redisplay_internal aware
555 of an emptied echo area. */ 560 of an emptied echo area. */
@@ -560,7 +565,7 @@ static int message_cleared_p;
560 glyphs. Also used in direct_output_for_insert. */ 565 glyphs. Also used in direct_output_for_insert. */
561 566
562#define MAX_SCRATCH_GLYPHS 100 567#define MAX_SCRATCH_GLYPHS 100
563struct glyph_row scratch_glyph_row; 568static struct glyph_row scratch_glyph_row;
564static struct glyph scratch_glyphs[MAX_SCRATCH_GLYPHS]; 569static struct glyph scratch_glyphs[MAX_SCRATCH_GLYPHS];
565 570
566/* Ascent and height of the last line processed by move_it_to. */ 571/* Ascent and height of the last line processed by move_it_to. */
@@ -603,11 +608,11 @@ int trace_move;
603#define TRACE_MOVE(x) (void) 0 608#define TRACE_MOVE(x) (void) 0
604#endif 609#endif
605 610
606Lisp_Object Qauto_hscroll_mode; 611static Lisp_Object Qauto_hscroll_mode;
607 612
608/* Buffer being redisplayed -- for redisplay_window_error. */ 613/* Buffer being redisplayed -- for redisplay_window_error. */
609 614
610struct buffer *displayed_buffer; 615static struct buffer *displayed_buffer;
611 616
612/* Value returned from text property handlers (see below). */ 617/* Value returned from text property handlers (see below). */
613 618
@@ -708,7 +713,7 @@ static struct glyph_slice null_glyph_slice = { 0, 0, 0, 0 };
708 713
709int redisplaying_p; 714int redisplaying_p;
710 715
711Lisp_Object Qinhibit_free_realized_faces; 716static Lisp_Object Qinhibit_free_realized_faces;
712 717
713/* If a string, XTread_socket generates an event to display that string. 718/* If a string, XTread_socket generates an event to display that string.
714 (The display is done in read_char.) */ 719 (The display is done in read_char.) */
@@ -735,7 +740,7 @@ struct atimer *hourglass_atimer;
735Lisp_Object Qglyphless_char; 740Lisp_Object Qglyphless_char;
736 741
737/* Symbol for the purpose of Vglyphless_char_display. */ 742/* Symbol for the purpose of Vglyphless_char_display. */
738Lisp_Object Qglyphless_char_display; 743static Lisp_Object Qglyphless_char_display;
739 744
740/* Method symbols for Vglyphless_char_display. */ 745/* Method symbols for Vglyphless_char_display. */
741static Lisp_Object Qhex_code, Qempty_box, Qthin_space, Qzero_width; 746static Lisp_Object Qhex_code, Qempty_box, Qthin_space, Qzero_width;
@@ -751,6 +756,7 @@ static Lisp_Object Qhex_code, Qempty_box, Qthin_space, Qzero_width;
751/* Function prototypes. */ 756/* Function prototypes. */
752 757
753static void setup_for_ellipsis (struct it *, int); 758static void setup_for_ellipsis (struct it *, int);
759static void set_iterator_to_next (struct it *, int);
754static void mark_window_display_accurate_1 (struct window *, int); 760static void mark_window_display_accurate_1 (struct window *, int);
755static int single_display_spec_string_p (Lisp_Object, Lisp_Object); 761static int single_display_spec_string_p (Lisp_Object, Lisp_Object);
756static int display_prop_string_p (Lisp_Object, Lisp_Object); 762static int display_prop_string_p (Lisp_Object, Lisp_Object);
@@ -783,7 +789,9 @@ static int with_echo_area_buffer (struct window *, int,
783 EMACS_INT, Lisp_Object, EMACS_INT, EMACS_INT); 789 EMACS_INT, Lisp_Object, EMACS_INT, EMACS_INT);
784static void clear_garbaged_frames (void); 790static void clear_garbaged_frames (void);
785static int current_message_1 (EMACS_INT, Lisp_Object, EMACS_INT, EMACS_INT); 791static int current_message_1 (EMACS_INT, Lisp_Object, EMACS_INT, EMACS_INT);
792static void pop_message (void);
786static int truncate_message_1 (EMACS_INT, Lisp_Object, EMACS_INT, EMACS_INT); 793static int truncate_message_1 (EMACS_INT, Lisp_Object, EMACS_INT, EMACS_INT);
794static void set_message (const char *, Lisp_Object, EMACS_INT, int);
787static int set_message_1 (EMACS_INT, Lisp_Object, EMACS_INT, EMACS_INT); 795static int set_message_1 (EMACS_INT, Lisp_Object, EMACS_INT, EMACS_INT);
788static int display_echo_area (struct window *); 796static int display_echo_area (struct window *);
789static int display_echo_area_1 (EMACS_INT, Lisp_Object, EMACS_INT, EMACS_INT); 797static int display_echo_area_1 (EMACS_INT, Lisp_Object, EMACS_INT, EMACS_INT);
@@ -815,6 +823,9 @@ static void redisplay_window (Lisp_Object, int);
815static Lisp_Object redisplay_window_error (Lisp_Object); 823static Lisp_Object redisplay_window_error (Lisp_Object);
816static Lisp_Object redisplay_window_0 (Lisp_Object); 824static Lisp_Object redisplay_window_0 (Lisp_Object);
817static Lisp_Object redisplay_window_1 (Lisp_Object); 825static Lisp_Object redisplay_window_1 (Lisp_Object);
826static int set_cursor_from_row (struct window *, struct glyph_row *,
827 struct glyph_matrix *, EMACS_INT, EMACS_INT,
828 int, int);
818static int update_menu_bar (struct frame *, int, int); 829static int update_menu_bar (struct frame *, int, int);
819static int try_window_reusing_current_matrix (struct window *); 830static int try_window_reusing_current_matrix (struct window *);
820static int try_window_id (struct window *); 831static int try_window_id (struct window *);
@@ -852,6 +863,7 @@ static int init_from_display_pos (struct it *, struct window *,
852 struct display_pos *); 863 struct display_pos *);
853static void reseat_to_string (struct it *, const char *, 864static void reseat_to_string (struct it *, const char *,
854 Lisp_Object, EMACS_INT, EMACS_INT, int, int); 865 Lisp_Object, EMACS_INT, EMACS_INT, int, int);
866static int get_next_display_element (struct it *);
855static enum move_it_result 867static enum move_it_result
856 move_it_in_display_line_to (struct it *, EMACS_INT, int, 868 move_it_in_display_line_to (struct it *, EMACS_INT, int,
857 enum move_operation_enum); 869 enum move_operation_enum);
@@ -899,6 +911,7 @@ static void append_stretch_glyph (struct it *, Lisp_Object,
899 911
900#endif /* HAVE_WINDOW_SYSTEM */ 912#endif /* HAVE_WINDOW_SYSTEM */
901 913
914static void show_mouse_face (Mouse_HLInfo *, enum draw_glyphs_face);
902static int coords_in_mouse_face_p (struct window *, int, int); 915static int coords_in_mouse_face_p (struct window *, int, int);
903 916
904 917
@@ -1115,7 +1128,7 @@ window_box (struct window *w, int area, int *box_x, int *box_y,
1115 *BOTTOM_RIGHT_Y the coordinates of the bottom-right corner of the 1128 *BOTTOM_RIGHT_Y the coordinates of the bottom-right corner of the
1116 box. */ 1129 box. */
1117 1130
1118INLINE void 1131static INLINE void
1119window_box_edges (struct window *w, int area, int *top_left_x, int *top_left_y, 1132window_box_edges (struct window *w, int area, int *top_left_x, int *top_left_y,
1120 int *bottom_right_x, int *bottom_right_y) 1133 int *bottom_right_x, int *bottom_right_y)
1121{ 1134{
@@ -1533,61 +1546,6 @@ pixel_to_glyph_coords (FRAME_PTR f, register int pix_x, register int pix_y,
1533} 1546}
1534 1547
1535 1548
1536/* Given HPOS/VPOS in the current matrix of W, return corresponding
1537 frame-relative pixel positions in *FRAME_X and *FRAME_Y. If we
1538 can't tell the positions because W's display is not up to date,
1539 return 0. */
1540
1541int
1542glyph_to_pixel_coords (struct window *w, int hpos, int vpos,
1543 int *frame_x, int *frame_y)
1544{
1545#ifdef HAVE_WINDOW_SYSTEM
1546 if (FRAME_WINDOW_P (XFRAME (WINDOW_FRAME (w))))
1547 {
1548 int success_p;
1549
1550 xassert (hpos >= 0 && hpos < w->current_matrix->matrix_w);
1551 xassert (vpos >= 0 && vpos < w->current_matrix->matrix_h);
1552
1553 if (display_completed)
1554 {
1555 struct glyph_row *row = MATRIX_ROW (w->current_matrix, vpos);
1556 struct glyph *glyph = row->glyphs[TEXT_AREA];
1557 struct glyph *end = glyph + min (hpos, row->used[TEXT_AREA]);
1558
1559 hpos = row->x;
1560 vpos = row->y;
1561 while (glyph < end)
1562 {
1563 hpos += glyph->pixel_width;
1564 ++glyph;
1565 }
1566
1567 /* If first glyph is partially visible, its first visible position is still 0. */
1568 if (hpos < 0)
1569 hpos = 0;
1570
1571 success_p = 1;
1572 }
1573 else
1574 {
1575 hpos = vpos = 0;
1576 success_p = 0;
1577 }
1578
1579 *frame_x = WINDOW_TO_FRAME_PIXEL_X (w, hpos);
1580 *frame_y = WINDOW_TO_FRAME_PIXEL_Y (w, vpos);
1581 return success_p;
1582 }
1583#endif
1584
1585 *frame_x = hpos;
1586 *frame_y = vpos;
1587 return 1;
1588}
1589
1590
1591/* Find the glyph under window-relative coordinates X/Y in window W. 1549/* Find the glyph under window-relative coordinates X/Y in window W.
1592 Consider only glyphs from buffer text, i.e. no glyphs from overlay 1550 Consider only glyphs from buffer text, i.e. no glyphs from overlay
1593 strings. Return in *HPOS and *VPOS the row and column number of 1551 strings. Return in *HPOS and *VPOS the row and column number of
@@ -1670,11 +1628,10 @@ x_y_to_hpos_vpos (struct window *w, int x, int y, int *hpos, int *vpos,
1670 return glyph; 1628 return glyph;
1671} 1629}
1672 1630
1673/* EXPORT: 1631/* Convert frame-relative x/y to coordinates relative to window W.
1674 Convert frame-relative x/y to coordinates relative to window W.
1675 Takes pseudo-windows into account. */ 1632 Takes pseudo-windows into account. */
1676 1633
1677void 1634static void
1678frame_to_window_pixel_xy (struct window *w, int *x, int *y) 1635frame_to_window_pixel_xy (struct window *w, int *x, int *y)
1679{ 1636{
1680 if (w->pseudo_window_p) 1637 if (w->pseudo_window_p)
@@ -3660,7 +3617,7 @@ handle_invisible_prop (struct it *it)
3660 _after_ bidi iteration avoids affecting the visual 3617 _after_ bidi iteration avoids affecting the visual
3661 order of the displayed text when invisible properties 3618 order of the displayed text when invisible properties
3662 are added or removed. */ 3619 are added or removed. */
3663 if (it->bidi_it.first_elt) 3620 if (it->bidi_it.first_elt && it->bidi_it.charpos < ZV)
3664 { 3621 {
3665 /* If we were `reseat'ed to a new paragraph, 3622 /* If we were `reseat'ed to a new paragraph,
3666 determine the paragraph base direction. We need 3623 determine the paragraph base direction. We need
@@ -5632,7 +5589,7 @@ struct frame *last_glyphless_glyph_frame = NULL;
5632unsigned last_glyphless_glyph_face_id = (1 << FACE_ID_BITS); 5589unsigned last_glyphless_glyph_face_id = (1 << FACE_ID_BITS);
5633int last_glyphless_glyph_merged_face_id = 0; 5590int last_glyphless_glyph_merged_face_id = 0;
5634 5591
5635int 5592static int
5636get_next_display_element (struct it *it) 5593get_next_display_element (struct it *it)
5637{ 5594{
5638 /* Non-zero means that we found a display element. Zero means that 5595 /* Non-zero means that we found a display element. Zero means that
@@ -9095,7 +9052,7 @@ pop_message_unwind (Lisp_Object dummy)
9095 9052
9096/* Pop the top-most entry off Vmessage_stack. */ 9053/* Pop the top-most entry off Vmessage_stack. */
9097 9054
9098void 9055static void
9099pop_message (void) 9056pop_message (void)
9100{ 9057{
9101 xassert (CONSP (Vmessage_stack)); 9058 xassert (CONSP (Vmessage_stack));
@@ -9165,7 +9122,7 @@ truncate_message_1 (EMACS_INT nchars, Lisp_Object a2, EMACS_INT a3, EMACS_INT a4
9165 to t before calling set_message_1 (which calls insert). 9122 to t before calling set_message_1 (which calls insert).
9166 */ 9123 */
9167 9124
9168void 9125static void
9169set_message (const char *s, Lisp_Object string, 9126set_message (const char *s, Lisp_Object string,
9170 EMACS_INT nbytes, int multibyte_p) 9127 EMACS_INT nbytes, int multibyte_p)
9171{ 9128{
@@ -11315,7 +11272,7 @@ overlay_arrow_at_row (struct it *it, struct glyph_row *row)
11315 return 0. PREV_BUF and PREV_PT are the last point buffer and 11272 return 0. PREV_BUF and PREV_PT are the last point buffer and
11316 position. BUF and PT are the current point buffer and position. */ 11273 position. BUF and PT are the current point buffer and position. */
11317 11274
11318int 11275static int
11319check_point_in_composition (struct buffer *prev_buf, EMACS_INT prev_pt, 11276check_point_in_composition (struct buffer *prev_buf, EMACS_INT prev_pt,
11320 struct buffer *buf, EMACS_INT pt) 11277 struct buffer *buf, EMACS_INT pt)
11321{ 11278{
@@ -12402,7 +12359,7 @@ redisplay_window_1 (Lisp_Object window)
12402 12359
12403 Return 0 if cursor is not on this row, 1 otherwise. */ 12360 Return 0 if cursor is not on this row, 1 otherwise. */
12404 12361
12405int 12362static int
12406set_cursor_from_row (struct window *w, struct glyph_row *row, 12363set_cursor_from_row (struct window *w, struct glyph_row *row,
12407 struct glyph_matrix *matrix, 12364 struct glyph_matrix *matrix,
12408 EMACS_INT delta, EMACS_INT delta_bytes, 12365 EMACS_INT delta, EMACS_INT delta_bytes,
@@ -13673,7 +13630,7 @@ try_cursor_movement (Lisp_Object window, struct text_pos startp, int *scroll_ste
13673 return rc; 13630 return rc;
13674} 13631}
13675 13632
13676void 13633static void
13677set_vertical_scroll_bar (struct window *w) 13634set_vertical_scroll_bar (struct window *w)
13678{ 13635{
13679 EMACS_INT start, end, whole; 13636 EMACS_INT start, end, whole;
@@ -14482,7 +14439,6 @@ redisplay_window (Lisp_Object window, int just_this_one_p)
14482 && EQ (FRAME_SELECTED_WINDOW (f), window)) 14439 && EQ (FRAME_SELECTED_WINDOW (f), window))
14483 { 14440 {
14484 int redisplay_menu_p = 0; 14441 int redisplay_menu_p = 0;
14485 int redisplay_tool_bar_p = 0;
14486 14442
14487 if (FRAME_WINDOW_P (f)) 14443 if (FRAME_WINDOW_P (f))
14488 { 14444 {
@@ -14503,17 +14459,15 @@ redisplay_window (Lisp_Object window, int just_this_one_p)
14503 if (FRAME_WINDOW_P (f)) 14459 if (FRAME_WINDOW_P (f))
14504 { 14460 {
14505#if defined (USE_GTK) || defined (HAVE_NS) 14461#if defined (USE_GTK) || defined (HAVE_NS)
14506 redisplay_tool_bar_p = FRAME_EXTERNAL_TOOL_BAR (f); 14462 if (FRAME_EXTERNAL_TOOL_BAR (f))
14463 redisplay_tool_bar (f);
14507#else 14464#else
14508 redisplay_tool_bar_p = WINDOWP (f->tool_bar_window) 14465 if (WINDOWP (f->tool_bar_window)
14509 && (FRAME_TOOL_BAR_LINES (f) > 0 14466 && (FRAME_TOOL_BAR_LINES (f) > 0
14510 || !NILP (Vauto_resize_tool_bars)); 14467 || !NILP (Vauto_resize_tool_bars))
14468 && redisplay_tool_bar (f))
14469 ignore_mouse_drag_p = 1;
14511#endif 14470#endif
14512
14513 if (redisplay_tool_bar_p && redisplay_tool_bar (f))
14514 {
14515 ignore_mouse_drag_p = 1;
14516 }
14517 } 14471 }
14518#endif 14472#endif
14519 } 14473 }
@@ -16989,7 +16943,7 @@ trailing_whitespace_p (EMACS_INT charpos)
16989 16943
16990/* Highlight trailing whitespace, if any, in ROW. */ 16944/* Highlight trailing whitespace, if any, in ROW. */
16991 16945
16992void 16946static void
16993highlight_trailing_whitespace (struct frame *f, struct glyph_row *row) 16947highlight_trailing_whitespace (struct frame *f, struct glyph_row *row)
16994{ 16948{
16995 int used = row->used[TEXT_AREA]; 16949 int used = row->used[TEXT_AREA];
@@ -23931,7 +23885,7 @@ x_clear_cursor (struct window *w)
23931 23885
23932/* Implementation of draw_row_with_mouse_face for GUI sessions, GPM, 23886/* Implementation of draw_row_with_mouse_face for GUI sessions, GPM,
23933 and MSDOS. */ 23887 and MSDOS. */
23934void 23888static void
23935draw_row_with_mouse_face (struct window *w, int start_x, struct glyph_row *row, 23889draw_row_with_mouse_face (struct window *w, int start_x, struct glyph_row *row,
23936 int start_hpos, int end_hpos, 23890 int start_hpos, int end_hpos,
23937 enum draw_glyphs_face draw) 23891 enum draw_glyphs_face draw)
@@ -23948,10 +23902,9 @@ draw_row_with_mouse_face (struct window *w, int start_x, struct glyph_row *row,
23948#endif 23902#endif
23949} 23903}
23950 23904
23951/* EXPORT: 23905/* Display the active region described by mouse_face_* according to DRAW. */
23952 Display the active region described by mouse_face_* according to DRAW. */
23953 23906
23954void 23907static void
23955show_mouse_face (Mouse_HLInfo *hlinfo, enum draw_glyphs_face draw) 23908show_mouse_face (Mouse_HLInfo *hlinfo, enum draw_glyphs_face draw)
23956{ 23909{
23957 struct window *w = XWINDOW (hlinfo->mouse_face_window); 23910 struct window *w = XWINDOW (hlinfo->mouse_face_window);
diff --git a/src/xfaces.c b/src/xfaces.c
index 8a64855bd8f..5cfe99d1285 100644
--- a/src/xfaces.c
+++ b/src/xfaces.c
@@ -304,25 +304,33 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
304 304
305/* Keyword symbols used for face attribute names. */ 305/* Keyword symbols used for face attribute names. */
306 306
307Lisp_Object QCfamily, QCheight, QCweight, QCslant, QCunderline; 307Lisp_Object QCfamily, QCheight, QCweight, QCslant;
308Lisp_Object QCinverse_video, QCforeground, QCbackground, QCstipple; 308static Lisp_Object QCunderline;
309Lisp_Object QCwidth, QCfont, QCbold, QCitalic; 309static Lisp_Object QCinverse_video, QCstipple;
310Lisp_Object QCreverse_video; 310Lisp_Object QCforeground, QCbackground;
311Lisp_Object QCoverline, QCstrike_through, QCbox, QCinherit; 311Lisp_Object QCwidth;
312Lisp_Object QCfontset; 312static Lisp_Object QCfont, QCbold, QCitalic;
313static Lisp_Object QCreverse_video;
314static Lisp_Object QCoverline, QCstrike_through, QCbox, QCinherit;
315static Lisp_Object QCfontset;
313 316
314/* Symbols used for attribute values. */ 317/* Symbols used for attribute values. */
315 318
316Lisp_Object Qnormal, Qbold, Qultra_light, Qextra_light, Qlight; 319Lisp_Object Qnormal;
317Lisp_Object Qsemi_light, Qsemi_bold, Qextra_bold, Qultra_bold; 320Lisp_Object Qbold;
318Lisp_Object Qoblique, Qitalic, Qreverse_oblique, Qreverse_italic; 321static Lisp_Object Qultra_light, Qextra_light, Qlight;
319Lisp_Object Qultra_condensed, Qextra_condensed, Qcondensed; 322static Lisp_Object Qsemi_light, Qsemi_bold, Qextra_bold, Qultra_bold;
320Lisp_Object Qsemi_condensed, Qsemi_expanded, Qexpanded, Qextra_expanded; 323static Lisp_Object Qoblique, Qreverse_oblique, Qreverse_italic;
321Lisp_Object Qultra_expanded; 324Lisp_Object Qitalic;
322Lisp_Object Qreleased_button, Qpressed_button; 325static Lisp_Object Qultra_condensed, Qextra_condensed;
323Lisp_Object QCstyle, QCcolor, QCline_width; 326Lisp_Object Qcondensed;
324Lisp_Object Qunspecified; 327static Lisp_Object Qsemi_condensed, Qsemi_expanded, Qextra_expanded;
325Lisp_Object Qignore_defface; 328Lisp_Object Qexpanded;
329static Lisp_Object Qultra_expanded;
330static Lisp_Object Qreleased_button, Qpressed_button;
331static Lisp_Object QCstyle, QCcolor, QCline_width;
332static Lisp_Object Qunspecified;
333static Lisp_Object Qignore_defface;
326 334
327char unspecified_fg[] = "unspecified-fg", unspecified_bg[] = "unspecified-bg"; 335char unspecified_fg[] = "unspecified-fg", unspecified_bg[] = "unspecified-bg";
328 336
@@ -333,15 +341,18 @@ Lisp_Object Qframe_set_background_mode;
333 341
334/* Names of basic faces. */ 342/* Names of basic faces. */
335 343
336Lisp_Object Qdefault, Qtool_bar, Qregion, Qfringe; 344Lisp_Object Qdefault, Qtool_bar, Qfringe;
337Lisp_Object Qheader_line, Qscroll_bar, Qcursor, Qborder, Qmouse, Qmenu; 345static Lisp_Object Qregion;
338Lisp_Object Qmode_line_inactive, Qvertical_border; 346Lisp_Object Qheader_line, Qscroll_bar, Qcursor;
347static Lisp_Object Qborder, Qmouse, Qmenu;
348Lisp_Object Qmode_line_inactive;
349static Lisp_Object Qvertical_border;
339 350
340/* The symbol `face-alias'. A symbols having that property is an 351/* The symbol `face-alias'. A symbols having that property is an
341 alias for another face. Value of the property is the name of 352 alias for another face. Value of the property is the name of
342 the aliased face. */ 353 the aliased face. */
343 354
344Lisp_Object Qface_alias; 355static Lisp_Object Qface_alias;
345 356
346/* Alist of alternative font families. Each element is of the form 357/* Alist of alternative font families. Each element is of the form
347 (FAMILY FAMILY1 FAMILY2 ...). If fonts of FAMILY can't be loaded, 358 (FAMILY FAMILY1 FAMILY2 ...). If fonts of FAMILY can't be loaded,
@@ -361,7 +372,7 @@ Lisp_Object Vface_alternative_font_registry_alist;
361 font may be scaled if its name matches a regular expression in the 372 font may be scaled if its name matches a regular expression in the
362 list. */ 373 list. */
363 374
364Lisp_Object Qscalable_fonts_allowed; 375static Lisp_Object Qscalable_fonts_allowed;
365 376
366#define DEFAULT_FONT_LIST_LIMIT 100 377#define DEFAULT_FONT_LIST_LIMIT 100
367 378
@@ -377,11 +388,11 @@ Lisp_Object Qface;
377 388
378/* Property for basic faces which other faces cannot inherit. */ 389/* Property for basic faces which other faces cannot inherit. */
379 390
380Lisp_Object Qface_no_inherit; 391static Lisp_Object Qface_no_inherit;
381 392
382/* Error symbol for wrong_type_argument in load_pixmap. */ 393/* Error symbol for wrong_type_argument in load_pixmap. */
383 394
384Lisp_Object Qbitmap_spec_p; 395static Lisp_Object Qbitmap_spec_p;
385 396
386/* The next ID to assign to Lisp faces. */ 397/* The next ID to assign to Lisp faces. */
387 398
@@ -394,11 +405,11 @@ static int lface_id_to_name_size;
394 405
395/* TTY color-related functions (defined in tty-colors.el). */ 406/* TTY color-related functions (defined in tty-colors.el). */
396 407
397Lisp_Object Qtty_color_desc, Qtty_color_by_index, Qtty_color_standard_values; 408static Lisp_Object Qtty_color_desc, Qtty_color_by_index, Qtty_color_standard_values;
398 409
399/* The name of the function used to compute colors on TTYs. */ 410/* The name of the function used to compute colors on TTYs. */
400 411
401Lisp_Object Qtty_color_alist; 412static Lisp_Object Qtty_color_alist;
402 413
403/* Counter for calls to clear_face_cache. If this counter reaches 414/* Counter for calls to clear_face_cache. If this counter reaches
404 CLEAR_FONT_TABLE_COUNT, and a frame has more than 415 CLEAR_FONT_TABLE_COUNT, and a frame has more than
@@ -418,7 +429,7 @@ int face_change_count;
418 display. This is a kluge to suppress `bold black' foreground text 429 display. This is a kluge to suppress `bold black' foreground text
419 which is hard to read on an LCD monitor. */ 430 which is hard to read on an LCD monitor. */
420 431
421int tty_suppress_bold_inverse_default_colors_p; 432static int tty_suppress_bold_inverse_default_colors_p;
422 433
423/* A list of the form `((x . y))' used to avoid consing in 434/* A list of the form `((x . y))' used to avoid consing in
424 Finternal_set_lisp_face_attribute. */ 435 Finternal_set_lisp_face_attribute. */
@@ -436,7 +447,7 @@ static int ngcs;
436/* Non-zero means the definition of the `menu' face for new frames has 447/* Non-zero means the definition of the `menu' face for new frames has
437 been changed. */ 448 been changed. */
438 449
439int menu_face_changed_default; 450static int menu_face_changed_default;
440 451
441 452
442/* Function prototypes. */ 453/* Function prototypes. */
@@ -606,6 +617,8 @@ x_free_colors (struct frame *f, long unsigned int *pixels, int npixels)
606} 617}
607 618
608 619
620#ifdef USE_X_TOOLKIT
621
609/* Free colors used on frame F. PIXELS is an array of NPIXELS pixel 622/* Free colors used on frame F. PIXELS is an array of NPIXELS pixel
610 color values. Interrupt input must be blocked when this function 623 color values. Interrupt input must be blocked when this function
611 is called. */ 624 is called. */
@@ -626,7 +639,7 @@ x_free_dpy_colors (Display *dpy, Screen *screen, Colormap cmap, long unsigned in
626 XFreeColors (dpy, cmap, pixels, npixels, 0); 639 XFreeColors (dpy, cmap, pixels, npixels, 0);
627 } 640 }
628} 641}
629 642#endif /* USE_X_TOOLKIT */
630 643
631/* Create and return a GC for use on frame F. GC values and mask 644/* Create and return a GC for use on frame F. GC values and mask
632 are given by XGCV and MASK. */ 645 are given by XGCV and MASK. */
@@ -1138,7 +1151,7 @@ tty_defined_color (struct frame *f, const char *color_name,
1138 1151
1139 This does the right thing for any type of frame. */ 1152 This does the right thing for any type of frame. */
1140 1153
1141int 1154static int
1142defined_color (struct frame *f, const char *color_name, XColor *color_def, int alloc) 1155defined_color (struct frame *f, const char *color_name, XColor *color_def, int alloc)
1143{ 1156{
1144 if (!FRAME_WINDOW_P (f)) 1157 if (!FRAME_WINDOW_P (f))
@@ -1786,7 +1799,7 @@ the WIDTH times as wide as FACE on FRAME. */)
1786 { 1799 {
1787 /* This is a scalable font. For backward compatibility, 1800 /* This is a scalable font. For backward compatibility,
1788 we set the specified size. */ 1801 we set the specified size. */
1789 font_entity = Fcopy_font_spec (font_entity); 1802 font_entity = copy_font_spec (font_entity);
1790 ASET (font_entity, FONT_SIZE_INDEX, 1803 ASET (font_entity, FONT_SIZE_INDEX,
1791 AREF (font_spec, FONT_SIZE_INDEX)); 1804 AREF (font_spec, FONT_SIZE_INDEX));
1792 } 1805 }
@@ -2310,9 +2323,9 @@ merge_face_vectors (struct frame *f, Lisp_Object *from, Lisp_Object *to, struct
2310 if (!UNSPECIFIEDP (from[i])) 2323 if (!UNSPECIFIEDP (from[i]))
2311 { 2324 {
2312 if (!UNSPECIFIEDP (to[i])) 2325 if (!UNSPECIFIEDP (to[i]))
2313 to[i] = Fmerge_font_spec (from[i], to[i]); 2326 to[i] = merge_font_spec (from[i], to[i]);
2314 else 2327 else
2315 to[i] = Fcopy_font_spec (from[i]); 2328 to[i] = copy_font_spec (from[i]);
2316 if (! NILP (AREF (to[i], FONT_FOUNDRY_INDEX))) 2329 if (! NILP (AREF (to[i], FONT_FOUNDRY_INDEX)))
2317 to[LFACE_FOUNDRY_INDEX] = SYMBOL_NAME (AREF (to[i], FONT_FOUNDRY_INDEX)); 2330 to[LFACE_FOUNDRY_INDEX] = SYMBOL_NAME (AREF (to[i], FONT_FOUNDRY_INDEX));
2318 if (! NILP (AREF (to[i], FONT_FAMILY_INDEX))) 2331 if (! NILP (AREF (to[i], FONT_FAMILY_INDEX)))
@@ -4084,7 +4097,7 @@ make_realized_face (Lisp_Object *attr)
4084/* Free realized face FACE, including its X resources. FACE may 4097/* Free realized face FACE, including its X resources. FACE may
4085 be null. */ 4098 be null. */
4086 4099
4087void 4100static void
4088free_realized_face (struct frame *f, struct face *face) 4101free_realized_face (struct frame *f, struct face *face)
4089{ 4102{
4090 if (face) 4103 if (face)
@@ -4602,26 +4615,6 @@ lookup_basic_face (struct frame *f, int face_id)
4602} 4615}
4603 4616
4604 4617
4605/* Return the ID of the realized ASCII face of Lisp face with ID
4606 LFACE_ID on frame F. Value is -1 if LFACE_ID isn't valid. */
4607
4608int
4609ascii_face_of_lisp_face (struct frame *f, int lface_id)
4610{
4611 int face_id;
4612
4613 if (lface_id >= 0 && lface_id < lface_id_to_name_size)
4614 {
4615 Lisp_Object face_name = lface_id_to_name[lface_id];
4616 face_id = lookup_named_face (f, face_name, 1);
4617 }
4618 else
4619 face_id = -1;
4620
4621 return face_id;
4622}
4623
4624
4625/* Return a face for charset ASCII that is like the face with id 4618/* Return a face for charset ASCII that is like the face with id
4626 FACE_ID on frame F, but has a font that is STEPS steps smaller. 4619 FACE_ID on frame F, but has a font that is STEPS steps smaller.
4627 STEPS < 0 means larger. Value is the id of the face. */ 4620 STEPS < 0 means larger. Value is the id of the face. */
@@ -6190,7 +6183,7 @@ face_at_string_position (struct window *w, Lisp_Object string,
6190 if we don't have fonts, so we can stop here if not working 6183 if we don't have fonts, so we can stop here if not working
6191 on a window-system frame. */ 6184 on a window-system frame. */
6192 || !FRAME_WINDOW_P (f) 6185 || !FRAME_WINDOW_P (f)
6193 || FACE_SUITABLE_FOR_CHAR_P (base_face, 0))) 6186 || FACE_SUITABLE_FOR_ASCII_CHAR_P (base_face, 0)))
6194 return base_face->id; 6187 return base_face->id;
6195 6188
6196 /* Begin with attributes from the base face. */ 6189 /* Begin with attributes from the base face. */
diff --git a/src/xfns.c b/src/xfns.c
index 33b21c84b2c..290b6161215 100644
--- a/src/xfns.c
+++ b/src/xfns.c
@@ -139,10 +139,10 @@ char *gray_bitmap_bits = gray_bits;
139 139
140static int x_in_use; 140static int x_in_use;
141 141
142Lisp_Object Qnone; 142static Lisp_Object Qnone;
143Lisp_Object Qsuppress_icon; 143static Lisp_Object Qsuppress_icon;
144Lisp_Object Qundefined_color; 144static Lisp_Object Qundefined_color;
145Lisp_Object Qcompound_text, Qcancel_timer; 145static Lisp_Object Qcompound_text, Qcancel_timer;
146Lisp_Object Qfont_param; 146Lisp_Object Qfont_param;
147 147
148#if GLYPH_DEBUG 148#if GLYPH_DEBUG
@@ -150,9 +150,11 @@ int image_cache_refcount, dpyinfo_refcount;
150#endif 150#endif
151 151
152#if defined (USE_GTK) && defined (HAVE_FREETYPE) 152#if defined (USE_GTK) && defined (HAVE_FREETYPE)
153char *x_last_font_name; 153static char *x_last_font_name;
154#endif 154#endif
155 155
156static struct x_display_info *x_display_info_for_name (Lisp_Object);
157
156 158
157/* Error if we are not connected to X. */ 159/* Error if we are not connected to X. */
158 160
@@ -419,35 +421,6 @@ x_top_window_to_frame (struct x_display_info *dpyinfo, int wdesc)
419 421
420 422
421 423
422static void x_default_font_parameter (struct frame *, Lisp_Object);
423
424static Lisp_Object unwind_create_frame (Lisp_Object);
425static Lisp_Object unwind_create_tip_frame (Lisp_Object);
426
427void x_set_foreground_color (struct frame *, Lisp_Object, Lisp_Object);
428static void x_set_wait_for_wm (struct frame *, Lisp_Object, Lisp_Object);
429void x_set_background_color (struct frame *, Lisp_Object, Lisp_Object);
430void x_set_mouse_color (struct frame *, Lisp_Object, Lisp_Object);
431void x_set_cursor_color (struct frame *, Lisp_Object, Lisp_Object);
432void x_set_border_color (struct frame *, Lisp_Object, Lisp_Object);
433void x_set_cursor_type (struct frame *, Lisp_Object, Lisp_Object);
434void x_set_icon_type (struct frame *, Lisp_Object, Lisp_Object);
435void x_set_icon_name (struct frame *, Lisp_Object, Lisp_Object);
436void x_explicitly_set_name (struct frame *, Lisp_Object, Lisp_Object);
437void x_set_menu_bar_lines (struct frame *, Lisp_Object, Lisp_Object);
438void x_set_title (struct frame *, Lisp_Object, Lisp_Object);
439void x_set_tool_bar_lines (struct frame *, Lisp_Object, Lisp_Object);
440void x_set_scroll_bar_foreground (struct frame *, Lisp_Object,
441 Lisp_Object);
442void x_set_scroll_bar_background (struct frame *, Lisp_Object,
443 Lisp_Object);
444static Lisp_Object x_default_scroll_bar_color_parameter (struct frame *,
445 Lisp_Object,
446 Lisp_Object,
447 const char *, const char *,
448 int);
449
450
451/* Store the screen positions of frame F into XPTR and YPTR. 424/* Store the screen positions of frame F into XPTR and YPTR.
452 These are the positions of the containing window manager window, 425 These are the positions of the containing window manager window,
453 not Emacs's own window. */ 426 not Emacs's own window. */
@@ -766,7 +739,7 @@ xg_set_icon_from_xpm_data (FRAME_PTR f, const char **data)
766 In that case, just record the parameter's new value 739 In that case, just record the parameter's new value
767 in the standard place; do not attempt to change the window. */ 740 in the standard place; do not attempt to change the window. */
768 741
769void 742static void
770x_set_foreground_color (struct frame *f, Lisp_Object arg, Lisp_Object oldval) 743x_set_foreground_color (struct frame *f, Lisp_Object arg, Lisp_Object oldval)
771{ 744{
772 struct x_output *x = f->output_data.x; 745 struct x_output *x = f->output_data.x;
@@ -802,7 +775,7 @@ x_set_foreground_color (struct frame *f, Lisp_Object arg, Lisp_Object oldval)
802 unload_color (f, old_fg); 775 unload_color (f, old_fg);
803} 776}
804 777
805void 778static void
806x_set_background_color (struct frame *f, Lisp_Object arg, Lisp_Object oldval) 779x_set_background_color (struct frame *f, Lisp_Object arg, Lisp_Object oldval)
807{ 780{
808 struct x_output *x = f->output_data.x; 781 struct x_output *x = f->output_data.x;
@@ -877,7 +850,7 @@ make_invisible_cursor (struct frame *f)
877 return c; 850 return c;
878} 851}
879 852
880void 853static void
881x_set_mouse_color (struct frame *f, Lisp_Object arg, Lisp_Object oldval) 854x_set_mouse_color (struct frame *f, Lisp_Object arg, Lisp_Object oldval)
882{ 855{
883 struct x_output *x = f->output_data.x; 856 struct x_output *x = f->output_data.x;
@@ -1022,7 +995,7 @@ x_set_mouse_color (struct frame *f, Lisp_Object arg, Lisp_Object oldval)
1022 update_face_from_frame_parameter (f, Qmouse_color, arg); 995 update_face_from_frame_parameter (f, Qmouse_color, arg);
1023} 996}
1024 997
1025void 998static void
1026x_set_cursor_color (struct frame *f, Lisp_Object arg, Lisp_Object oldval) 999x_set_cursor_color (struct frame *f, Lisp_Object arg, Lisp_Object oldval)
1027{ 1000{
1028 unsigned long fore_pixel, pixel; 1001 unsigned long fore_pixel, pixel;
@@ -1093,7 +1066,7 @@ x_set_cursor_color (struct frame *f, Lisp_Object arg, Lisp_Object oldval)
1093 Note that this does not fully take effect if done before 1066 Note that this does not fully take effect if done before
1094 F has an x-window. */ 1067 F has an x-window. */
1095 1068
1096void 1069static void
1097x_set_border_pixel (struct frame *f, int pix) 1070x_set_border_pixel (struct frame *f, int pix)
1098{ 1071{
1099 unload_color (f, f->output_data.x->border_pixel); 1072 unload_color (f, f->output_data.x->border_pixel);
@@ -1122,7 +1095,7 @@ x_set_border_pixel (struct frame *f, int pix)
1122 Note: under X11, this is normally the province of the window manager, 1095 Note: under X11, this is normally the province of the window manager,
1123 and so emacs' border colors may be overridden. */ 1096 and so emacs' border colors may be overridden. */
1124 1097
1125void 1098static void
1126x_set_border_color (struct frame *f, Lisp_Object arg, Lisp_Object oldval) 1099x_set_border_color (struct frame *f, Lisp_Object arg, Lisp_Object oldval)
1127{ 1100{
1128 int pix; 1101 int pix;
@@ -1134,7 +1107,7 @@ x_set_border_color (struct frame *f, Lisp_Object arg, Lisp_Object oldval)
1134} 1107}
1135 1108
1136 1109
1137void 1110static void
1138x_set_cursor_type (FRAME_PTR f, Lisp_Object arg, Lisp_Object oldval) 1111x_set_cursor_type (FRAME_PTR f, Lisp_Object arg, Lisp_Object oldval)
1139{ 1112{
1140 set_frame_cursor_types (f, arg); 1113 set_frame_cursor_types (f, arg);
@@ -1143,7 +1116,7 @@ x_set_cursor_type (FRAME_PTR f, Lisp_Object arg, Lisp_Object oldval)
1143 cursor_type_changed = 1; 1116 cursor_type_changed = 1;
1144} 1117}
1145 1118
1146void 1119static void
1147x_set_icon_type (struct frame *f, Lisp_Object arg, Lisp_Object oldval) 1120x_set_icon_type (struct frame *f, Lisp_Object arg, Lisp_Object oldval)
1148{ 1121{
1149 int result; 1122 int result;
@@ -1175,7 +1148,7 @@ x_set_icon_type (struct frame *f, Lisp_Object arg, Lisp_Object oldval)
1175 UNBLOCK_INPUT; 1148 UNBLOCK_INPUT;
1176} 1149}
1177 1150
1178void 1151static void
1179x_set_icon_name (struct frame *f, Lisp_Object arg, Lisp_Object oldval) 1152x_set_icon_name (struct frame *f, Lisp_Object arg, Lisp_Object oldval)
1180{ 1153{
1181 int result; 1154 int result;
@@ -1398,7 +1371,7 @@ x_set_tool_bar_lines (struct frame *f, Lisp_Object value, Lisp_Object oldval)
1398 isn't a valid color name, do nothing. OLDVAL is the old value of 1371 isn't a valid color name, do nothing. OLDVAL is the old value of
1399 the frame parameter. */ 1372 the frame parameter. */
1400 1373
1401void 1374static void
1402x_set_scroll_bar_foreground (struct frame *f, Lisp_Object value, Lisp_Object oldval) 1375x_set_scroll_bar_foreground (struct frame *f, Lisp_Object value, Lisp_Object oldval)
1403{ 1376{
1404 unsigned long pixel; 1377 unsigned long pixel;
@@ -1431,7 +1404,7 @@ x_set_scroll_bar_foreground (struct frame *f, Lisp_Object value, Lisp_Object old
1431 valid color name, do nothing. OLDVAL is the old value of the frame 1404 valid color name, do nothing. OLDVAL is the old value of the frame
1432 parameter. */ 1405 parameter. */
1433 1406
1434void 1407static void
1435x_set_scroll_bar_background (struct frame *f, Lisp_Object value, Lisp_Object oldval) 1408x_set_scroll_bar_background (struct frame *f, Lisp_Object value, Lisp_Object oldval)
1436{ 1409{
1437 unsigned long pixel; 1410 unsigned long pixel;
@@ -1682,7 +1655,7 @@ x_set_name (struct frame *f, Lisp_Object name, int explicit)
1682/* This function should be called when the user's lisp code has 1655/* This function should be called when the user's lisp code has
1683 specified a name for the frame; the name will override any set by the 1656 specified a name for the frame; the name will override any set by the
1684 redisplay code. */ 1657 redisplay code. */
1685void 1658static void
1686x_explicitly_set_name (FRAME_PTR f, Lisp_Object arg, Lisp_Object oldval) 1659x_explicitly_set_name (FRAME_PTR f, Lisp_Object arg, Lisp_Object oldval)
1687{ 1660{
1688 x_set_name (f, arg, 1); 1661 x_set_name (f, arg, 1);
@@ -1700,7 +1673,7 @@ x_implicitly_set_name (FRAME_PTR f, Lisp_Object arg, Lisp_Object oldval)
1700/* Change the title of frame F to NAME. 1673/* Change the title of frame F to NAME.
1701 If NAME is nil, use the frame name as the title. */ 1674 If NAME is nil, use the frame name as the title. */
1702 1675
1703void 1676static void
1704x_set_title (struct frame *f, Lisp_Object name, Lisp_Object old_name) 1677x_set_title (struct frame *f, Lisp_Object name, Lisp_Object old_name)
1705{ 1678{
1706 /* Don't change the title if it's already NAME. */ 1679 /* Don't change the title if it's already NAME. */
@@ -1888,9 +1861,10 @@ static XIMStyle supported_xim_styles[] =
1888}; 1861};
1889 1862
1890 1863
1864#if defined HAVE_X_WINDOWS && defined USE_X_TOOLKIT
1891/* Create an X fontset on frame F with base font name BASE_FONTNAME. */ 1865/* Create an X fontset on frame F with base font name BASE_FONTNAME. */
1892 1866
1893const char xic_defaut_fontset[] = "-*-*-*-r-normal--14-*-*-*-*-*-*-*"; 1867static const char xic_defaut_fontset[] = "-*-*-*-r-normal--14-*-*-*-*-*-*-*";
1894 1868
1895/* Create an Xt fontset spec from the name of a base font. 1869/* Create an Xt fontset spec from the name of a base font.
1896 If `motif' is True use the Motif syntax. */ 1870 If `motif' is True use the Motif syntax. */
@@ -2016,6 +1990,7 @@ xic_create_fontsetname (const char *base_fontname, int motif)
2016 strcat (fontsetname, ":"); 1990 strcat (fontsetname, ":");
2017 return fontsetname; 1991 return fontsetname;
2018} 1992}
1993#endif /* HAVE_X_WINDOWS && USE_X_TOOLKIT */
2019 1994
2020#ifdef DEBUG_XIC_FONTSET 1995#ifdef DEBUG_XIC_FONTSET
2021static void 1996static void
@@ -3887,12 +3862,6 @@ x_char_height (register struct frame *f)
3887 return FRAME_LINE_HEIGHT (f); 3862 return FRAME_LINE_HEIGHT (f);
3888} 3863}
3889 3864
3890int
3891x_screen_planes (register struct frame *f)
3892{
3893 return FRAME_X_DISPLAY_INFO (f)->n_planes;
3894}
3895
3896 3865
3897 3866
3898/************************************************************************ 3867/************************************************************************
@@ -4017,7 +3986,7 @@ select_visual (struct x_display_info *dpyinfo)
4017/* Return the X display structure for the display named NAME. 3986/* Return the X display structure for the display named NAME.
4018 Open a new connection if necessary. */ 3987 Open a new connection if necessary. */
4019 3988
4020struct x_display_info * 3989static struct x_display_info *
4021x_display_info_for_name (Lisp_Object name) 3990x_display_info_for_name (Lisp_Object name)
4022{ 3991{
4023 Lisp_Object names; 3992 Lisp_Object names;
@@ -4538,13 +4507,13 @@ Lisp_Object tip_frame;
4538/* If non-nil, a timer started that hides the last tooltip when it 4507/* If non-nil, a timer started that hides the last tooltip when it
4539 fires. */ 4508 fires. */
4540 4509
4541Lisp_Object tip_timer; 4510static Lisp_Object tip_timer;
4542Window tip_window; 4511Window tip_window;
4543 4512
4544/* If non-nil, a vector of 3 elements containing the last args 4513/* If non-nil, a vector of 3 elements containing the last args
4545 with which x-show-tip was called. See there. */ 4514 with which x-show-tip was called. See there. */
4546 4515
4547Lisp_Object last_show_tip_args; 4516static Lisp_Object last_show_tip_args;
4548 4517
4549 4518
4550static Lisp_Object 4519static Lisp_Object
diff --git a/src/xfont.c b/src/xfont.c
index eaa1a3ea59b..5dd6aae3846 100644
--- a/src/xfont.c
+++ b/src/xfont.c
@@ -739,7 +739,7 @@ xfont_open (FRAME_PTR f, Lisp_Object entity, int pixel_size)
739 So, we try again with wildcards in RESX and RESY. */ 739 So, we try again with wildcards in RESX and RESY. */
740 Lisp_Object temp; 740 Lisp_Object temp;
741 741
742 temp = Fcopy_font_spec (entity); 742 temp = copy_font_spec (entity);
743 ASET (temp, FONT_DPI_INDEX, Qnil); 743 ASET (temp, FONT_DPI_INDEX, Qnil);
744 len = font_unparse_xlfd (temp, pixel_size, name, 512); 744 len = font_unparse_xlfd (temp, pixel_size, name, 512);
745 if (len <= 0 || (len = xfont_encode_coding_xlfd (name)) < 0) 745 if (len <= 0 || (len = xfont_encode_coding_xlfd (name)) < 0)
diff --git a/src/xmenu.c b/src/xmenu.c
index b1f7dfb26bc..6e84b845a46 100644
--- a/src/xmenu.c
+++ b/src/xmenu.c
@@ -111,7 +111,7 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
111#define FALSE 0 111#define FALSE 0
112#endif /* no TRUE */ 112#endif /* no TRUE */
113 113
114Lisp_Object Qdebug_on_next_call; 114static Lisp_Object Qdebug_on_next_call;
115 115
116#if defined (USE_X_TOOLKIT) || defined (USE_GTK) 116#if defined (USE_X_TOOLKIT) || defined (USE_GTK)
117static Lisp_Object xdialog_show (FRAME_PTR, int, Lisp_Object, Lisp_Object, 117static Lisp_Object xdialog_show (FRAME_PTR, int, Lisp_Object, Lisp_Object,
@@ -365,6 +365,9 @@ x_menu_set_in_use (int in_use)
365 365
366/* Wait for an X event to arrive or for a timer to expire. */ 366/* Wait for an X event to arrive or for a timer to expire. */
367 367
368#ifndef USE_MOTIF
369static
370#endif
368void 371void
369x_menu_wait_for_event (void *data) 372x_menu_wait_for_event (void *data)
370{ 373{
diff --git a/src/xrdb.c b/src/xrdb.c
index a79f453e5e1..d350f38a8c4 100644
--- a/src/xrdb.c
+++ b/src/xrdb.c
@@ -64,7 +64,7 @@ static int file_p (const char *filename);
64 64
65/* The string which gets substituted for the %C escape in XFILESEARCHPATH 65/* The string which gets substituted for the %C escape in XFILESEARCHPATH
66 and friends, or zero if none was specified. */ 66 and friends, or zero if none was specified. */
67char *x_customization_string; 67static char *x_customization_string;
68 68
69 69
70/* Return the value of the emacs.customization (Emacs.Customization) 70/* Return the value of the emacs.customization (Emacs.Customization)
@@ -466,7 +466,7 @@ get_environ_db (void)
466/* Types of values that we can find in a database */ 466/* Types of values that we can find in a database */
467 467
468#define XrmStringType "String" /* String representation */ 468#define XrmStringType "String" /* String representation */
469XrmRepresentation x_rm_string; /* Quark representation */ 469static XrmRepresentation x_rm_string; /* Quark representation */
470 470
471/* Load X resources based on the display and a possible -xrm option. */ 471/* Load X resources based on the display and a possible -xrm option. */
472 472
diff --git a/src/xselect.c b/src/xselect.c
index 4f1a452023a..2d656cfec9a 100644
--- a/src/xselect.c
+++ b/src/xselect.c
@@ -100,14 +100,14 @@ static Lisp_Object clean_local_selection_data (Lisp_Object);
100#endif 100#endif
101 101
102 102
103Lisp_Object QSECONDARY, QSTRING, QINTEGER, QCLIPBOARD, QTIMESTAMP, 103static Lisp_Object QSECONDARY, QSTRING, QINTEGER, QCLIPBOARD, QTIMESTAMP,
104 QTEXT, QDELETE, QMULTIPLE, QINCR, QEMACS_TMP, QTARGETS, QATOM, QNULL, 104 QTEXT, QDELETE, QMULTIPLE, QINCR, QEMACS_TMP, QTARGETS, QATOM, QNULL,
105 QATOM_PAIR; 105 QATOM_PAIR;
106 106
107Lisp_Object QCOMPOUND_TEXT; /* This is a type of selection. */ 107static Lisp_Object QCOMPOUND_TEXT; /* This is a type of selection. */
108Lisp_Object QUTF8_STRING; /* This is a type of selection. */ 108static Lisp_Object QUTF8_STRING; /* This is a type of selection. */
109 109
110Lisp_Object Qcompound_text_with_extensions; 110static Lisp_Object Qcompound_text_with_extensions;
111 111
112static Lisp_Object Qforeign_selection; 112static Lisp_Object Qforeign_selection;
113 113
diff --git a/src/xsettings.c b/src/xsettings.c
index 24ea48e7b67..2513bcc5aa8 100644
--- a/src/xsettings.c
+++ b/src/xsettings.c
@@ -691,11 +691,13 @@ xsettings_get_system_font (void)
691 return current_mono_font; 691 return current_mono_font;
692} 692}
693 693
694#ifdef USE_LUCID
694const char * 695const char *
695xsettings_get_system_normal_font (void) 696xsettings_get_system_normal_font (void)
696{ 697{
697 return current_font; 698 return current_font;
698} 699}
700#endif
699 701
700DEFUN ("font-get-system-normal-font", Ffont_get_system_normal_font, 702DEFUN ("font-get-system-normal-font", Ffont_get_system_normal_font,
701 Sfont_get_system_normal_font, 703 Sfont_get_system_normal_font,
@@ -718,8 +720,8 @@ DEFUN ("font-get-system-font", Ffont_get_system_font, Sfont_get_system_font,
718 : Qnil; 720 : Qnil;
719} 721}
720 722
721DEFUN ("tool-bar-get-system-style", Ftool_bar_get_system_style, Stool_bar_get_system_style, 723DEFUN ("tool-bar-get-system-style", Ftool_bar_get_system_style,
722 0, 0, 0, 724 Stool_bar_get_system_style, 0, 0, 0,
723 doc: /* Get the system tool bar style. 725 doc: /* Get the system tool bar style.
724If no system tool bar style is known, return `tool-bar-style' if set to a 726If no system tool bar style is known, return `tool-bar-style' if set to a
725known style. Otherwise return image. */) 727known style. Otherwise return image. */)
diff --git a/src/xsettings.h b/src/xsettings.h
index 5b2fdbf43c5..38448eb88f5 100644
--- a/src/xsettings.h
+++ b/src/xsettings.h
@@ -26,8 +26,9 @@ extern void xsettings_initialize (struct x_display_info *dpyinfo);
26extern void xft_settings_event (struct x_display_info *dpyinfo, 26extern void xft_settings_event (struct x_display_info *dpyinfo,
27 XEvent *); 27 XEvent *);
28extern const char *xsettings_get_system_font (void); 28extern const char *xsettings_get_system_font (void);
29#ifdef USE_LUCID
29extern const char *xsettings_get_system_normal_font (void); 30extern const char *xsettings_get_system_normal_font (void);
31#endif
30 32
31 33
32#endif /* XSETTINGS_H */ 34#endif /* XSETTINGS_H */
33
diff --git a/src/xterm.c b/src/xterm.c
index b3e33b7c0bb..bc847388756 100644
--- a/src/xterm.c
+++ b/src/xterm.c
@@ -306,6 +306,8 @@ enum xembed_message
306 306
307static int x_alloc_nearest_color_1 (Display *, Colormap, XColor *); 307static int x_alloc_nearest_color_1 (Display *, Colormap, XColor *);
308static void x_set_window_size_1 (struct frame *, int, int, int); 308static void x_set_window_size_1 (struct frame *, int, int, int);
309static void x_raise_frame (struct frame *);
310static void x_lower_frame (struct frame *);
309static const XColor *x_color_cells (Display *, int *); 311static const XColor *x_color_cells (Display *, int *);
310static void x_update_window_end (struct window *, int, int); 312static void x_update_window_end (struct window *, int, int);
311 313
@@ -347,9 +349,15 @@ static void x_check_expected_move (struct frame *, int, int);
347static void x_sync_with_move (struct frame *, int, int, int); 349static void x_sync_with_move (struct frame *, int, int, int);
348static int handle_one_xevent (struct x_display_info *, XEvent *, 350static int handle_one_xevent (struct x_display_info *, XEvent *,
349 int *, struct input_event *); 351 int *, struct input_event *);
352#if ! (defined USE_MOTIF || defined USE_X_TOOLKIT)
353static int x_dispatch_event (XEvent *, Display *);
354#endif
350/* Don't declare this NO_RETURN because we want no 355/* Don't declare this NO_RETURN because we want no
351 interference with debugging failing X calls. */ 356 interference with debugging failing X calls. */
352static void x_connection_closed (Display *, const char *); 357static void x_connection_closed (Display *, const char *);
358static void x_wm_set_window_state (struct frame *, int);
359static void x_wm_set_icon_pixmap (struct frame *, int);
360static void x_initialize (void);
353 361
354 362
355/* Flush display of frame F, or of all frames if F is null. */ 363/* Flush display of frame F, or of all frames if F is null. */
@@ -3451,14 +3459,6 @@ x_detect_focus_change (struct x_display_info *dpyinfo, XEvent *event, struct inp
3451} 3459}
3452 3460
3453 3461
3454/* Handle an event saying the mouse has moved out of an Emacs frame. */
3455
3456void
3457x_mouse_leave (struct x_display_info *dpyinfo)
3458{
3459 x_new_focus_frame (dpyinfo, dpyinfo->x_focus_event_frame);
3460}
3461
3462/* The focus has changed, or we have redirected a frame's focus to 3462/* The focus has changed, or we have redirected a frame's focus to
3463 another frame (this happens when a frame uses a surrogate 3463 another frame (this happens when a frame uses a surrogate
3464 mini-buffer frame). Shift the highlight as appropriate. 3464 mini-buffer frame). Shift the highlight as appropriate.
@@ -5659,7 +5659,7 @@ static short temp_buffer[100];
5659/* Set this to nonzero to fake an "X I/O error" 5659/* Set this to nonzero to fake an "X I/O error"
5660 on a particular display. */ 5660 on a particular display. */
5661 5661
5662struct x_display_info *XTread_socket_fake_io_error; 5662static struct x_display_info *XTread_socket_fake_io_error;
5663 5663
5664/* When we find no input here, we occasionally do a no-op command 5664/* When we find no input here, we occasionally do a no-op command
5665 to verify that the X server is still running and we can still talk with it. 5665 to verify that the X server is still running and we can still talk with it.
@@ -6984,6 +6984,9 @@ handle_one_xevent (struct x_display_info *dpyinfo, XEvent *eventptr,
6984 i.e. looping while a popup menu or a dialog is posted. 6984 i.e. looping while a popup menu or a dialog is posted.
6985 6985
6986 Returns the value handle_one_xevent sets in the finish argument. */ 6986 Returns the value handle_one_xevent sets in the finish argument. */
6987#if ! (defined USE_MOTIF || defined USE_X_TOOLKIT)
6988static
6989#endif
6987int 6990int
6988x_dispatch_event (XEvent *event, Display *display) 6991x_dispatch_event (XEvent *event, Display *display)
6989{ 6992{
@@ -8870,7 +8873,7 @@ x_raise_frame (struct frame *f)
8870 8873
8871/* Lower frame F. */ 8874/* Lower frame F. */
8872 8875
8873void 8876static void
8874x_lower_frame (struct frame *f) 8877x_lower_frame (struct frame *f)
8875{ 8878{
8876 if (f->async_visible) 8879 if (f->async_visible)
@@ -9432,7 +9435,7 @@ x_free_frame_resources (struct frame *f)
9432 9435
9433/* Destroy the X window of frame F. */ 9436/* Destroy the X window of frame F. */
9434 9437
9435void 9438static void
9436x_destroy_window (struct frame *f) 9439x_destroy_window (struct frame *f)
9437{ 9440{
9438 struct x_display_info *dpyinfo = FRAME_X_DISPLAY_INFO (f); 9441 struct x_display_info *dpyinfo = FRAME_X_DISPLAY_INFO (f);
@@ -9556,7 +9559,7 @@ x_wm_set_size_hint (struct frame *f, long flags, int user_position)
9556 9559
9557/* Used for IconicState or NormalState */ 9560/* Used for IconicState or NormalState */
9558 9561
9559void 9562static void
9560x_wm_set_window_state (struct frame *f, int state) 9563x_wm_set_window_state (struct frame *f, int state)
9561{ 9564{
9562#ifdef USE_X_TOOLKIT 9565#ifdef USE_X_TOOLKIT
@@ -9574,7 +9577,7 @@ x_wm_set_window_state (struct frame *f, int state)
9574#endif /* not USE_X_TOOLKIT */ 9577#endif /* not USE_X_TOOLKIT */
9575} 9578}
9576 9579
9577void 9580static void
9578x_wm_set_icon_pixmap (struct frame *f, int pixmap_id) 9581x_wm_set_icon_pixmap (struct frame *f, int pixmap_id)
9579{ 9582{
9580 Pixmap icon_pixmap, icon_mask; 9583 Pixmap icon_pixmap, icon_mask;
@@ -10338,7 +10341,7 @@ x_term_init (Lisp_Object display_name, char *xrm_option, char *resource_name)
10338/* Get rid of display DPYINFO, deleting all frames on it, 10341/* Get rid of display DPYINFO, deleting all frames on it,
10339 and without sending any more commands to the X server. */ 10342 and without sending any more commands to the X server. */
10340 10343
10341void 10344static void
10342x_delete_display (struct x_display_info *dpyinfo) 10345x_delete_display (struct x_display_info *dpyinfo)
10343{ 10346{
10344 struct terminal *t; 10347 struct terminal *t;
diff --git a/src/xterm.h b/src/xterm.h
index 15630e902e5..bd5cf2dbd31 100644
--- a/src/xterm.h
+++ b/src/xterm.h
@@ -388,7 +388,6 @@ extern struct x_display_info *x_display_list;
388extern Lisp_Object x_display_name_list; 388extern Lisp_Object x_display_name_list;
389 389
390extern struct x_display_info *x_display_info_for_display (Display *); 390extern struct x_display_info *x_display_info_for_display (Display *);
391extern struct x_display_info *x_display_info_for_name (Lisp_Object);
392extern void x_set_frame_alpha (struct frame *); 391extern void x_set_frame_alpha (struct frame *);
393 392
394extern struct x_display_info *x_term_init (Lisp_Object, char *, char *); 393extern struct x_display_info *x_term_init (Lisp_Object, char *, char *);
@@ -965,19 +964,12 @@ extern void x_set_window_size (struct frame *, int, int, int);
965extern void x_set_mouse_position (struct frame *, int, int); 964extern void x_set_mouse_position (struct frame *, int, int);
966extern void x_set_mouse_pixel_position (struct frame *, int, int); 965extern void x_set_mouse_pixel_position (struct frame *, int, int);
967extern void x_ewmh_activate_frame (struct frame *); 966extern void x_ewmh_activate_frame (struct frame *);
968extern void x_raise_frame (struct frame *);
969extern void x_lower_frame (struct frame *);
970extern void x_make_frame_visible (struct frame *); 967extern void x_make_frame_visible (struct frame *);
971extern void x_make_frame_invisible (struct frame *); 968extern void x_make_frame_invisible (struct frame *);
972extern void x_iconify_frame (struct frame *); 969extern void x_iconify_frame (struct frame *);
973extern void x_free_frame_resources (struct frame *); 970extern void x_free_frame_resources (struct frame *);
974extern void x_destroy_window (struct frame *);
975extern void x_wm_set_size_hint (struct frame *, long, int); 971extern void x_wm_set_size_hint (struct frame *, long, int);
976extern void x_wm_set_window_state (struct frame *, int);
977extern void x_wm_set_icon_pixmap (struct frame *, int);
978extern void x_delete_display (struct x_display_info *);
979extern void x_delete_terminal (struct terminal *terminal); 972extern void x_delete_terminal (struct terminal *terminal);
980extern void x_initialize (void);
981extern unsigned long x_copy_color (struct frame *, unsigned long); 973extern unsigned long x_copy_color (struct frame *, unsigned long);
982#ifdef USE_X_TOOLKIT 974#ifdef USE_X_TOOLKIT
983extern XtAppContext Xt_app_con; 975extern XtAppContext Xt_app_con;
@@ -990,10 +982,13 @@ extern int x_alloc_nearest_color (struct frame *, Colormap, XColor *);
990extern void x_query_colors (struct frame *f, XColor *, int); 982extern void x_query_colors (struct frame *f, XColor *, int);
991extern void x_query_color (struct frame *f, XColor *); 983extern void x_query_color (struct frame *f, XColor *);
992extern void x_clear_area (Display *, Window, int, int, int, int, int); 984extern void x_clear_area (Display *, Window, int, int, int, int, int);
985#ifdef WINDOWSNT
993extern void x_mouse_leave (struct x_display_info *); 986extern void x_mouse_leave (struct x_display_info *);
994extern void set_vertical_scroll_bar (struct window *); 987#endif
995 988
989#if defined USE_MOTIF || defined USE_X_TOOLKIT
996extern int x_dispatch_event (XEvent *, Display *); 990extern int x_dispatch_event (XEvent *, Display *);
991#endif
997extern unsigned int x_x_to_emacs_modifiers (struct x_display_info *, 992extern unsigned int x_x_to_emacs_modifiers (struct x_display_info *,
998 unsigned); 993 unsigned);
999extern int x_display_pixel_height (struct x_display_info *); 994extern int x_display_pixel_height (struct x_display_info *);
@@ -1042,8 +1037,6 @@ extern int xg_set_icon_from_xpm_data (struct frame *, const char**);
1042#endif /* USE_GTK */ 1037#endif /* USE_GTK */
1043 1038
1044extern void x_real_positions (struct frame *, int *, int *); 1039extern void x_real_positions (struct frame *, int *, int *);
1045extern int defined_color (struct frame *, const char *, XColor *, int);
1046extern void x_set_border_pixel (struct frame *, int);
1047extern void x_set_menu_bar_lines (struct frame *, Lisp_Object, Lisp_Object); 1040extern void x_set_menu_bar_lines (struct frame *, Lisp_Object, Lisp_Object);
1048extern void x_implicitly_set_name (struct frame *, Lisp_Object, Lisp_Object); 1041extern void x_implicitly_set_name (struct frame *, Lisp_Object, Lisp_Object);
1049extern void xic_free_xfontset (struct frame *); 1042extern void xic_free_xfontset (struct frame *);
@@ -1056,24 +1049,29 @@ extern int x_pixel_width (struct frame *);
1056extern int x_pixel_height (struct frame *); 1049extern int x_pixel_height (struct frame *);
1057extern int x_char_width (struct frame *); 1050extern int x_char_width (struct frame *);
1058extern int x_char_height (struct frame *); 1051extern int x_char_height (struct frame *);
1059extern int x_screen_planes (struct frame *);
1060extern void x_sync (struct frame *); 1052extern void x_sync (struct frame *);
1061extern int x_defined_color (struct frame *, const char *, XColor *, int); 1053extern int x_defined_color (struct frame *, const char *, XColor *, int);
1062#ifdef HAVE_X_I18N 1054#ifdef HAVE_X_I18N
1063extern void free_frame_xic (struct frame *); 1055extern void free_frame_xic (struct frame *);
1056# if defined HAVE_X_WINDOWS && defined USE_X_TOOLKIT
1064extern char * xic_create_fontsetname (const char *base_fontname, int motif); 1057extern char * xic_create_fontsetname (const char *base_fontname, int motif);
1058# endif
1065#endif 1059#endif
1066extern void x_set_tool_bar_lines (struct frame *, Lisp_Object, Lisp_Object); 1060extern void x_set_tool_bar_lines (struct frame *, Lisp_Object, Lisp_Object);
1067 1061
1068/* Defined in xfaces.c */ 1062/* Defined in xfaces.c */
1069 1063
1064#ifdef USE_X_TOOLKIT
1070extern void x_free_dpy_colors (Display *, Screen *, Colormap, 1065extern void x_free_dpy_colors (Display *, Screen *, Colormap,
1071 unsigned long *, int); 1066 unsigned long *, int);
1067#endif /* USE_X_TOOLKIT */
1072 1068
1073/* Defined in xmenu.c */ 1069/* Defined in xmenu.c */
1074 1070
1075extern void x_menu_set_in_use (int); 1071extern void x_menu_set_in_use (int);
1072#ifdef USE_MOTIF
1076extern void x_menu_wait_for_event (void *data); 1073extern void x_menu_wait_for_event (void *data);
1074#endif
1077extern void x_activate_menubar (struct frame *); 1075extern void x_activate_menubar (struct frame *);
1078extern int popup_activated (void); 1076extern int popup_activated (void);
1079extern void initialize_frame_menubar (struct frame *); 1077extern void initialize_frame_menubar (struct frame *);