* keymap.c.c (Fdefine_key): Use ptrdiff_t, not int.
[bpt/emacs.git] / src / ChangeLog
CommitLineData
c801946a 12011-09-27 Paul Eggert <eggert@cs.ucla.edu>
d311d28c
PE
2
3 * alloc.c (pure_bytes_used_lisp, pure_bytes_used_non_lisp):
4 (allocate_vectorlike, buffer_memory_full, struct sdata, SDATA_SIZE)
5 (string_bytes, check_sblock, allocate_string_data):
6 (compact_small_strings, Fmake_bool_vector, make_string)
7 (make_unibyte_string, make_multibyte_string)
8 (make_string_from_bytes, make_specified_string)
9 (allocate_vectorlike, Fmake_vector, find_string_data_in_pure)
10 (make_pure_string, make_pure_c_string, make_pure_vector, Fpurecopy)
11 (mark_vectorlike):
12 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13 (allocate_pseudovector):
14 Use int, not EMACS_INT, where int is wide enough.
15 (inhibit_garbage_collection, Fgarbage_collect):
16 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
17 * bidi.c (bidi_mirror_char): Use EMACS_INT, not int, where
18 int might not be wide enough.
19 (bidi_cache_search, bidi_cache_find, bidi_init_it)
20 (bidi_count_bytes, bidi_char_at_pos, bidi_fetch_char)
21 (bidi_at_paragraph_end, bidi_find_paragraph_start)
22 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak)
23 (bidi_level_of_next_char, bidi_move_to_visually_next):
24 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
25 * buffer.c (copy_overlays, Fgenerate_new_buffer_name)
26 (Fkill_buffer, Fset_buffer_major_mode)
27 (advance_to_char_boundary, Fbuffer_swap_text)
28 (Fset_buffer_multibyte, overlays_at, overlays_in)
29 (overlay_touches_p, struct sortvec, record_overlay_string)
30 (overlay_strings, recenter_overlay_lists)
31 (adjust_overlays_for_insert, adjust_overlays_for_delete)
32 (fix_start_end_in_overlays, fix_overlays_before, modify_overlay)
33 (Fmove_overlay, Fnext_overlay_change, Fprevious_overlay_change)
34 (Foverlay_recenter, last_overlay_modification_hooks_used)
35 (report_overlay_modification, evaporate_overlays, enlarge_buffer_text):
36 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
37 (validate_region): Omit unnecessary test for b <= e, since
38 that's guaranteed by the previous test.
39 (adjust_overlays_for_delete): Avoid pos + length overflow.
40 (Fmove_overlay, Fdelete_overlay, add_overlay_mod_hooklist)
41 (report_overlay_modification):
42 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
43 (Foverlays_at, Fnext_overlay_change, Fprevious_overlay_change):
44 Omit pointer cast, which isn't needed anyway, and doesn't work
45 after the EMACS_INT -> ptrdiff_t change.
46 * buffer.h: Adjust decls to match defn changes elsewhere.
47 (struct buffer_text, struct buffer):
48 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
49 Use EMACS_INT, not int, where int might not be wide enough.
50 * bytecode.c (exec_byte_code): Use ptrdiff_t, not int, to avoid
51 needless 32-bit limit on 64-bit hosts. Remove unnecessary
52 memory-full test. Use EMACS_INT, not ptrdiff_t or int, where
53 ptrdiff_t or int might not be wide enough.
54 * callint.c (Fcall_interactively):
55 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
56 * callproc.c (call_process_kill, Fcall_process):
57 Don't assume pid_t fits into an Emacs fixnum.
58 (call_process_cleanup, Fcall_process, child_setup):
59 Don't assume pid_t fits into int.
60 (call_process_cleanup, Fcall_process, delete_temp_file)
61 (Fcall_process_region):
62 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
63 (Fcall_process): Simplify handling of volatile integers.
64 Use int, not EMACS_INT, where int will do.
65 * casefiddle.c (casify_object, casify_region, operate_on_word)
66 (Fupcase_word, Fdowncase_word, Fcapitalize_word):
67 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
68 (casify_object): Avoid integer overflow when overallocating buffer.
69 * casetab.c (set_identity, shuffle): Prefer int to unsigned when
45c2afd6 70 either works. Use lint_assume to convince GCC 4.6.1 that it's OK.
d311d28c
PE
71 * category.c (Fchar_category_set): Don't assume fixnum fits in int.
72 * category.h (CATEGORYP): Don't assume arg is nonnegative.
73 * ccl.c (GET_CCL_INT): Remove; no longer needed, since the
74 integers are now checked earlier. All uses replaced with XINT.
75 (ccl_driver):
76 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
77 For CCL_MapSingle, check that content and value are in int range.
c801946a
PE
78 (ccl_driver, Fregister_code_conversion_map):
79 Check that Vcode_version_map_vector is a vector.
d311d28c
PE
80 (resolve_symbol_ccl_program): Check that vector header is in range.
81 Always copy the vector, so that we can check its contents reliably
82 now rather than having to recheck each instruction as it's being
83 executed. Check that vector words fit in 'int'.
84 (ccl_get_compiled_code, Fregister_ccl_program)
85 (Fregister_code_conversion_map): Use ptrdiff_t, not int, for
86 program indexes, to avoid needless 32-bit limit on 64-bit hosts.
87 (Fccl_execute, Fccl_execute_on_string): Check that initial reg
88 contents are in range.
89 (Fccl_execute_on_string): Check that status is in range.
90 * ccl.h (struct ccl_program.idx): Now ptrdiff_t, not int.
91 * character.c (char_resolve_modifier_mask, Fchar_resolve_modifiers):
92 Accept and return EMACS_INT, not int, because callers can pass values
93 out of 'int' range.
94 (c_string_width, strwidth, lisp_string_width, chars_in_text)
95 (multibyte_chars_in_text, parse_str_as_multibyte)
96 (str_as_multibyte, count_size_as_multibyte, str_to_multibyte)
97 (str_as_unibyte, str_to_unibyte, string_count_byte8)
98 (string_escape_byte8, Fget_byte):
99 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
100 (Funibyte_string): Use CHECK_CHARACTER, not CHECK_NATNUM, to
101 avoid mishandling large integers.
102 * character.h: Adjust decls to match defn changes elsewhere.
103 * charset.c (load_charset_map_from_file, find_charsets_in_text)
104 (Ffind_charset_region):
105 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
106 (load_charset_map_from_file): Redo idx calculation to avoid overflow.
107 (load_charset_map_from_vector, Fdefine_charset_internal):
3c7649c1 108 Don't assume fixnum fits in int.
d311d28c
PE
109 (load_charset_map_from_vector, Fmap_charset_chars):
110 Remove now-unnecessary CHECK_NATNUMs.
111 (Fdefine_charset_internal): Check ranges here, more carefully.
3c7649c1
PE
112 Don't rely on undefined behavior with signed left shift overflow.
113 Don't assume unsigned int fits into fixnum, or that fixnum fits
114 into unsigned int. Don't require max_code to be a valid fixnum;
115 that's not true for gb10830 4-byte on a 32-bit host. Allow
116 invalid_code to be a cons, for the same reason. Require code_offset
117 to be a character. Avoid int overflow if max_char is close
118 to INT_MAX.
119 (CODE_POINT_TO_INDEX): On 32-bit hosts, return int, not unsigned;
120 this is intended anyway and avoids some undefined behavior.
121 (load_charset_map): Pass unsigned, not int, as 2nd arg of
122 INDEX_TO_CODE_POINT, as that's what it expects.
123 (Funify_charset, encode_char): Don't stuff unsigned vals into int vars.
60ad3eab
PE
124 * charset.h (DECODE_CHAR): Return int, not unsigned;
125 this is what was intended anyway, and it avoids undefined behavior.
126 (CHARSET_OFFSET): Remove unused macro, instead of fixing its
127 integer-overflow issues.
128 (ENCODE_CHAR): Return unsigned on all hosts, not just on 32-bit hosts.
129 Formerly, it returned EMACS_INT on 64-bit hosts in the common case
130 where the argument is EMACS_INT, and this behavior is not intended.
d311d28c
PE
131 * chartab.c (Fmake_char_table, Fset_char_table_range)
132 (uniprop_get_decoder, uniprop_get_encoder):
133 Don't assume fixnum fits in int.
134 * cmds.c (move_point): New function, that does the gist of
135 Fforward_char and Fbackward_char, but does so while checking
136 for integer overflow more accurately.
c96e5d6a 137 (Fforward_char, Fbackward_char): Use it.
d311d28c
PE
138 (Fforward_line, Fend_of_line, internal_self_insert)
139 (internal_self_insert):
140 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
141 Fix a FIXME, by checking for integer overflow when calculating
142 target_clm and actual_clm.
143 * coding.c (detect_coding_XXX, encode_coding_XXX, CODING_DECODE_CHAR)
144 (ASSURE_DESTINATION, coding_alloc_by_realloc)
145 (coding_alloc_by_making_gap, alloc_destination)
146 (detect_coding_utf_8, encode_coding_utf_8, decode_coding_utf_16)
147 (encode_coding_utf_16, detect_coding_emacs_mule)
148 (decode_coding_emacs_mule, encode_coding_emacs_mule)
149 (detect_coding_iso_2022, decode_coding_iso_2022)
150 (encode_invocation_designation, encode_designation_at_bol)
151 (encode_coding_iso_2022, detect_coding_sjis, detect_coding_big5)
152 (decode_coding_sjis, decode_coding_big5, encode_coding_sjis)
153 (encode_coding_big5, detect_coding_ccl, decode_coding_ccl)
154 (encode_coding_ccl, encode_coding_raw_text)
155 (detect_coding_charset, decode_coding_charset)
156 (encode_coding_charset, detect_eol, decode_eol, produce_chars)
157 (produce_composition, produce_charset, produce_annotation)
158 (decode_coding, handle_composition_annotation)
159 (handle_charset_annotation, consume_chars, decode_coding_gap)
160 (decode_coding_object, encode_coding_object, detect_coding_system)
161 (Ffind_coding_systems_region_internal, Fcheck_coding_systems_region)
162 (code_convert_region, code_convert_string)
163 (Fdefine_coding_system_internal):
164 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
165 (setup_iso_safe_charsets, consume_chars, Funencodable_char_position)
166 (Fdefine_coding_system_internal):
167 Don't assume fixnums fit in int.
168 (decode_coding_gap, decode_coding_object, encode_coding_object)
5895d7b9 169 (Fread_coding_system, Fdetect_coding_region)
2c6a9faa
PE
170 (Funencodable_char_position, Fcheck_coding_systems_region)
171 (get_translation, handle_composition_annotation, consume_chars):
d311d28c 172 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
2c6a9faa 173 (consume_chars): Rewrite to avoid calculating an address outside buffer.
d311d28c
PE
174 (Ffind_operation_coding_system): NATNUMP can eval its arg twice.
175 (Fdefine_coding_system_internal): Check for charset-id overflow.
47664caa
PE
176 (ENCODE_ISO_CHARACTER): Use unsigned, not int, to store the unsigned
177 result of ENCODE_CHAR.
d311d28c
PE
178 * coding.h: Adjust decls to match defn changes elsewhere.
179 (struct coding_system):
180 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
181 * composite.c (get_composition_id, find_composition)
182 (run_composition_function, update_compositions)
183 (compose_text, composition_gstring_put_cache)
184 (composition_gstring_p, composition_gstring_width)
185 (fill_gstring_header, fill_gstring_body, autocmp_chars)
186 (composition_compute_stop_pos, composition_reseat_it)
187 (composition_update_it, struct position_record)
188 (find_automatic_composition, composition_adjust_point)
189 (Fcomposition_get_gstring, Ffind_composition_internal):
190 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
191 (update_compositions):
192 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
193 * composite.h: Adjust decls to match defn changes elsewhere.
194 (struct composition):
195 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
196 * data.c (let_shadows_buffer_binding_p, let_shadows_global_binding_p):
197 Do not attempt to compute the address of the object just before a
198 buffer; this is not portable.
199 (Faref, Faset):
200 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
201 (Faset): Use int, not EMACS_INT, where int is wide enough.
202 (Fstring_to_number): Don't assume fixnums fit in int.
203 (Frem): Don't assume arg is nonnegative.
204 * dbusbind.c (xd_append_arg): Check for integers out of range.
205 (Fdbus_call_method): Don't overflow the timeout int.
206 * dired.c (directory_files_internal, file_name_completion, scmp)
207 (file_name_completion_stat):
208 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
209 (file_name_completion): Don't overflow matchcount.
210 (file_name_completion_stat): Use SAFE_ALLOCA, not alloca.
211 * dispextern.h: Adjust decls to match defn changes elsewhere.
212 (struct text_pos, struct glyph, struct bidi_saved_info)
213 (struct bidi_string_data, struct bidi_it, struct composition_it)
214 (struct it):
215 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
216 (struct display_pos, struct composition_it, struct it):
217 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
218 * dispnew.c (increment_matrix_positions)
219 (increment_row_positions, mode_line_string)
220 (marginal_area_string):
221 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
54e1617f 222 (change_frame_size_1, Fredisplay, Fframe_or_buffer_changed_p):
d311d28c
PE
223 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
224 (duration_to_sec_usec): New function, to check for overflow better.
225 (Fsleep_for, sit_for): Use it.
226 * doc.c (get_doc_string, store_function_docstring):
227 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
228 (get_doc_string, Fsnarf_documentation):
229 Use int, not EMACS_INT, where int is wide enough.
230 (get_doc_string):
231 Use SAFE_ALLOCA, not alloca.
232 Check for overflow when converting EMACS_INT to off_t.
233 * doprnt.c (doprnt):
234 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
235 * editfns.c (init_editfns, Fuser_uid, Fuser_real_uid):
236 Don't assume uid_t fits into fixnum.
237 (buildmark, Fgoto_char, overlays_around, find_field, Fdelete_field)
238 (Ffield_string, Ffield_string_no_properties, Ffield_beginning)
239 (Ffield_end, Fconstrain_to_field, Fline_beginning_position)
240 (Fline_end_position, Fprevious_char, Fchar_after, Fchar_before)
241 (general_insert_function)
242 (Finsert_char, make_buffer_string, make_buffer_string_both)
243 (update_buffer_properties, Fbuffer_substring)
244 (Fbuffer_substring_no_properties, Fcompare_buffer_substrings)
245 (Fsubst_char_in_region, check_translation)
246 (Ftranslate_region_internal, save_restriction_restore, Fformat)
247 (transpose_markers, Ftranspose_regions):
248 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
249 (clip_to_bounds): Move to lisp.h as an inline function).
250 (Fconstrain_to_field): Don't assume integers are nonnegative.
251 (Fline_beginning_position, Fsave_excursion, Fsave_current_buffer):
252 (Fsubst_char_in_region, Fsave_restriction):
253 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
254 (Femacs_pid): Don't assume pid_t fits into fixnum.
255 (lo_time): Use int, not EMACS_INT, when int suffices.
256 (lisp_time_argument): Check for usec out of range.
257 (Fencode_time): Don't assume fixnum fits in int.
258 * emacs.c (gdb_valbits, gdb_gctypebits): Now int, not EMACS_INT.
259 (gdb_data_seg_bits): Now uintptr_t, not EMACS_INT.
260 (PVEC_FLAG, gdb_array_mark_flag): Now ptrdiff_t, not EMACS_INT.
261 (init_cmdargs, Fdump_emacs):
262 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
263 (Fkill_emacs): Don't assume fixnum fits in int; instead, take just
264 the bottom (typically) 32 bits of the fixnum.
265 * eval.c (specpdl_size, call_debugger):
266 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
267 (when_entered_debugger, Fbacktrace_debug):
268 Don't assume fixnum can fit in int.
269 (Fdefvaralias, Fdefvar): Do not attempt to compute the address of
270 the object just before a buffer; this is not portable.
271 (FletX, Flet, Funwind_protect, do_autoload, Feval, funcall_lambda)
272 (grow_specpdl, unbind_to):
273 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
274 (Fapply, apply_lambda): Don't assume ptrdiff_t can hold fixnum.
275 (grow_specpdl): Simplify allocation by using xpalloc.
856bbc81 276 (Fprog1, Fprog2): Don't assume list length fits in int. Simplify.
d311d28c
PE
277 * fileio.c (Ffind_file_name_handler, Fcopy_file, Frename_file)
278 (Finsert_file_contents, Fwrite_region, Fdo_auto_save):
279 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
280 (Ffind_file_name_handler, non_regular_inserted, Finsert_file_contents)
281 (a_write, e_write):
282 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
283 (Fcopy_file, non_regular_nbytes, read_non_regular)
284 (Finsert_file_contents):
285 Use int, not EMACS_INT, where int is wide enough.
286 (READ_BUF_SIZE): Verify that it fits in int.
287 (Finsert_file_contents): Check that counts are in proper range,
288 rather than assuming fixnums fit into ptrdiff_t etc.
289 Don't assume fixnums fit into int.
290 (Fdo_auto_save, Fset_buffer_auto_saved)
291 (Fclear_buffer_auto_save_failure):
292 Don't assume time_t is signed, or that it fits in int.
125b3835 293 * floatfns.c (Fexpt): Avoid undefined signed * signed overflow.
5895d7b9
PE
294 * fns.c (Fcompare_strings, Fstring_lessp, struct textprop_rec, concat)
295 (string_char_byte_cache_charpos, string_char_byte_cache_bytepos)
d311d28c
PE
296 (string_char_to_byte, string_byte_to_char)
297 (string_make_multibyte, string_to_multibyte)
298 (string_make_unibyte, Fstring_as_unibyte, Fstring_as_multibyte)
299 (Fstring_to_unibyte, Fsubstring, Fsubstring_no_properties)
300 (substring_both, Fdelete, internal_equal, Ffillarray)
301 (Fclear_string, mapcar1)
302 (Fbase64_encode_region, Fbase64_encode_string, base64_encode_1)
303 (Fbase64_decode_region, Fbase64_decode_string, base64_decode_1)
304 (larger_vector, make_hash_table, maybe_resize_hash_table)
305 (hash_lookup, hash_remove_from_table, hash_clear, sweep_weak_table)
306 (Fmaphash, secure_hash):
307 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
308 (concat): Check for string index and length overflow.
309 (Fmapconcat): Don't assume fixnums fit into ptrdiff_t.
310 (Frequire):
311 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
312 (larger_vector): New API (vec, incr_min, size_max) replaces old
313 one (vec, new_size, init). This catches size overflow.
314 INIT was removed because it was always Qnil.
315 All callers changed.
316 (INDEX_SIZE_BOUND): New macro, which calculates more precisely
317 the upper bound on a hash table index size.
318 (make_hash_table, maybe_resize_hash_table): Use it.
319 (secure_hash): Computer start_byte and end_byte only after
320 they're known to be in ptrdiff_t range.
321 * font.c (font_intern_prop, font_at, font_range, Ffont_shape_gstring)
322 (Ffont_get_glyphs, Ffont_at):
323 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
324 (font_style_to_value, font_prop_validate_style, font_expand_wildcards)
325 (Flist_fonts, Fopen_font):
326 Don't assume fixnum can fit in int.
327 (check_gstring): Don't assume index can fit in int.
328 (font_match_p): Check that fixnum is a character, not a nonnegative
329 fixnum, since the later code needs to stuff it into an int.
330 (font_find_for_lface): Use SAFE_ALLOCA_LISP, not alloca.
331 (font_fill_lglyph_metrics): Use unsigned, not EMACS_INT, to avoid
332 conversion overflow issues.
333 (Fopen_font): Check for integer out of range.
334 (Ffont_get_glyphs): Don't assume index can fit in int.
335 * font.h: Adjust decls to match defn changes elsewhere.
336 * fontset.c (reorder_font_vector): Redo score calculation to avoid
337 integer overflow.
338 (num_auto_fontsets, fontset_from_font): Use ptrdiff_t, not
339 printmax_t, where ptrdiff_t is wide enough.
340 (Finternal_char_font):
341 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
342 * frame.c (Fset_mouse_position, Fset_mouse_pixel_position)
343 (Fset_frame_height, Fset_frame_width, Fset_frame_size)
344 (Fset_frame_position, x_set_frame_parameters)
345 (x_set_line_spacing, x_set_border_width)
346 (x_set_internal_border_width, x_set_alpha, x_figure_window_size):
347 Check that fixnums are in proper range for system types.
348 (frame_name_fnn_p, Fframe_parameter, Fmodify_frame_parameters):
349 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
350 (Fmodify_frame_parameters): Don't assume fixnum fits in int.
351 Use SAFE_ALLOCA_LISP, not alloca.
352 * frame.h (struct frame): Use intptr_t, not EMACS_INT, where
353 intptr_t is wide enough.
354 * fringe.c (lookup_fringe_bitmap, get_logical_fringe_bitmap)
355 (Fdefine_fringe_bitmap): Don't assume fixnum fits in int.
356 (Ffringe_bitmaps_at_pos): Don't assume index fits in int.
357 Check for fixnum out of range.
358 * ftfont.c (ftfont_list): Don't assume index fits in int.
359 Check that fixnums are in proper range for system types.
360 (ftfont_shape_by_flt):
361 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
d311d28c
PE
362 * gnutls.c (emacs_gnutls_write, emacs_gnutls_read):
363 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
364 (Fgnutls_error_fatalp, Fgnutls_error_string, Fgnutls_boot):
365 Check that fixnums are in proper range for system types.
366 * gnutls.h: Adjust decls to match defn changes elsewhere.
367 * gtkutil.c (xg_dialog_run):
368 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
369 (update_frame_tool_bar):
370 Check that fixnums are in proper range for system types.
371 * image.c (parse_image_spec): Redo count calculation to avoid overflow.
5895d7b9 372 (lookup_image): Check that fixnums are in range for system types.
d311d28c
PE
373 * indent.c (last_known_column, last_known_column_point):
374 (current_column_bol_cache):
375 (skip_invisible, current_column, check_display_width):
376 (check_display_width, scan_for_column, current_column_1)
377 (Findent_to, Fcurrent_indentation, position_indentation)
378 (indented_beyond_p, Fmove_to_column, compute_motion):
379 (Fcompute_motion, Fvertical_motion):
380 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
381 (last_known_column_modified): Use EMACS_INT, not int.
382 (check_display_width):
383 (Fcompute_motion):
384 Check that fixnums and floats are in proper range for system types.
385 (compute_motion): Don't assume index or fixnum fits in int.
386 (compute_motion, Fcompute_motion):
387 Use int, not EMACS_INT, when it is wide enough.
388 (vmotion): Omit local var start_hpos that is always 0; that way
389 we don't need to worry about overflow in expressions involving it.
390 * indent.h: Adjust decls to match defn changes elsewhere.
391 (struct position):
392 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
393 Use int, not EMACS_INT, where int is wide enough.
394 Remove unused members ovstring_chars_done and tab_offset;
395 all uses removed.
396 * insdel.c (move_gap, move_gap_both, gap_left, gap_right)
397 (adjust_markers_for_delete, adjust_markers_for_insert, adjust_point)
398 (adjust_markers_for_replace, make_gap_larger, make_gap_smaller)
399 (make_gap, copy_text, insert, insert_and_inherit)
400 (insert_before_markers, insert_before_markers_and_inherit)
401 (insert_1, count_combining_before, count_combining_after)
402 (insert_1_both, insert_from_string)
403 (insert_from_string_before_markers, insert_from_string_1)
404 (insert_from_gap, insert_from_buffer, insert_from_buffer_1)
405 (adjust_after_replace, adjust_after_insert, replace_range)
406 (replace_range_2, del_range, del_range_1, del_range_byte)
407 (del_range_both, del_range_2, modify_region)
408 (prepare_to_modify_buffer, signal_before_change)
409 (signal_after_change, Fcombine_after_change_execute):
410 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
411 * intervals.c (traverse_intervals, rotate_right, rotate_left)
412 (balance_an_interval, split_interval_right, split_interval_left)
413 (find_interval, next_interval, update_interval)
414 (adjust_intervals_for_insertion, delete_node, delete_interval)
415 (interval_deletion_adjustment, adjust_intervals_for_deletion)
416 (static_offset_intervals, offset_intervals)
417 (merge_interval_right, merge_interval_left, make_new_interval)
418 (graft_intervals_into_buffer, temp_set_point_both)
419 (temp_set_point, set_point, adjust_for_invis_intang)
420 (set_point_both, move_if_not_intangible, get_property_and_range)
421 (get_local_map, copy_intervals, copy_intervals_to_string)
422 (compare_string_intervals, set_intervals_multibyte_1):
423 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
424 * intervals.h: Adjust decls to match defn changes elsewhere.
425 (struct interval):
426 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
427 * keyboard.c (this_command_key_count, this_single_command_key_start)
428 (before_command_key_count, before_command_echo_length, echo_now)
429 (echo_length, recursive_edit_1, Frecursive_edit, Ftrack_mouse)
430 (command_loop_1, safe_run_hooks, read_char, timer_check_2)
431 (menu_item_eval_property, read_key_sequence, Fread_key_sequence)
432 (Fread_key_sequence_vector, Fexecute_extended_command, Fsuspend_emacs):
433 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
434 (last_non_minibuf_size, last_point_position, echo_truncate)
435 (command_loop_1, adjust_point_for_property, read_char, gen_help_event)
436 (make_lispy_position, make_lispy_event, parse_modifiers_uncached)
437 (parse_modifiers, modify_event_symbol, Fexecute_extended_command)
438 (stuff_buffered_input):
439 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
440 (last_auto_save, command_loop_1, read_char):
441 Use EMACS_INT, not int, to avoid integer overflow.
442 (record_char): Avoid overflow in total_keys computation.
443 (parse_modifiers_uncached): Redo index calculation to avoid overflow.
444 * keyboard.h: Adjust decls to match defn changes elsewhere.
445 * keymap.c (Fdefine_key, Fcurrent_active_maps, accessible_keymaps_1)
446 (Fkey_description, Fdescribe_vector, Flookup_key):
447 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
448 (click_position): New function, to check that positions are in range.
449 (Fcurrent_active_maps):
450 (describe_command):
451 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
452 (Faccessible_keymaps, Fkey_description):
453 (preferred_sequence_p):
454 Don't assume fixnum can fit into int.
455 (Fkey_description): Use SAFE_ALLOCA_LISP, not alloca.
456 Check for integer overflow in size calculations.
457 (Ftext_char_description): Use CHECK_CHARACTER, not CHECK_NUMBER, to
458 avoid mishandling large integers.
459 * lisp.h: Adjust decls to match defn changes elsewhere.
460 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, struct Lisp_String)
461 (struct vectorlike_header, struct Lisp_Subr, struct Lisp_Hash_Table)
462 (struct Lisp_Marker):
463 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
464 (clip_to_bounds): Now an inline function, moved here from editfns.c.
d311d28c
PE
465 (GLYPH_CODE_P): Check for overflow in system types, subsuming the
466 need for GLYPH_CODE_CHAR_VALID_P and doing proper checking ourselves.
467 All callers changed.
468 (GLYPH_CODE_CHAR, GLYPH_CODE_FACE):
469 Assume the arg has valid form, since it always does.
470 (TYPE_RANGED_INTEGERP): Avoid bug when checking against a wide
471 unsigned integer system type.
472 (CHECK_RANGED_INTEGER, CHECK_TYPE_RANGED_INTEGER): New macros.
473 (struct catchtag, specpdl_size, SPECPDL_INDEX, USE_SAFE_ALLOCA):
474 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
475 (struct catchtag): Use EMACS_INT, not int, since it may be a fixnum.
476 (duration_to_sec_usec): New decl.
477 * lread.c (read_from_string_index, read_from_string_index_byte)
478 (read_from_string_limit, readchar, unreadchar, openp)
479 (read_internal_start, read1, oblookup):
480 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
481 (Fload, readevalloop, Feval_buffer, Feval_region):
482 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
483 (openp): Check for out-of-range argument to 'access'.
484 (read1): Use int, not EMACS_INT, where int is wide enough.
485 Don't assume fixnum fits into int.
1ab7b8ac
PE
486 (read_filtered_event): Use duration_to_sec_usec
487 to do proper overflow checking on durations.
d311d28c
PE
488 * macros.c (Fstart_kbd_macro): Use xpalloc to check for overflow
489 in size calculation.
490 (Fexecute_kbd_macro):
491 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
492 * marker.c (cached_charpos, cached_bytepos, CONSIDER)
493 (byte_char_debug_check, buf_charpos_to_bytepos, verify_bytepos)
494 (buf_bytepos_to_charpos, Fset_marker, set_marker_restricted)
495 (set_marker_both, set_marker_restricted_both, marker_position)
496 (marker_byte_position, Fbuffer_has_markers_at):
497 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
498 (Fset_marker, set_marker_restricted): Don't assume fixnum fits in int.
499 * menu.c (ensure_menu_items): Renamed from grow_menu_items.
500 It now merely ensures that the menu is large enough, without
501 necessarily growing it, as this avoids some integer overflow issues.
502 All callers changed.
503 (keymap_panes, parse_single_submenu, Fx_popup_menu):
504 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
505 (parse_single_submenu, Fx_popup_menu): Don't assume fixnum fits in int.
506 Use SAFE_ALLOCA_LISP, not alloca.
507 (find_and_return_menu_selection): Avoid unnecessary casts of pointers
508 to EMACS_INT. Check that fixnums are in proper range for system types.
509 * minibuf.c (minibuf_prompt_width, string_to_object)
510 (Fminibuffer_contents, Fminibuffer_contents_no_properties)
511 (Fminibuffer_completion_contents, Ftry_completion, Fall_completions):
512 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
513 (get_minibuffer, read_minibuf_unwind):
514 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
515 (read_minibuf): Omit unnecessary arg BACKUP_N, which is always nil;
516 this simplifies overflow checking. All callers changed.
517 (read_minibuf, Fread_buffer, Ftry_completion, Fall_completions)
518 (Ftest_completion):
519 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
520 * nsfns.m (check_ns_display_info): Don't assume fixnum fits in long.
521 (x_set_menu_bar_lines, x_set_tool_bar_lines, Fx_create_frame):
522 Check that fixnums are in proper range for system types.
523 (Fx_create_frame, Fx_show_tip):
524 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
525 * nsfont.m (ns_findfonts, nsfont_list_family):
526 Don't assume fixnum fits in long.
527 * nsmenu.m (ns_update_menubar, ns_menu_show, ns_popup_dialog):
528 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
529 (ns_update_menubar): Use intptr_t, not EMACS_INT, when intptr_t is
530 wide enough.
531 * nsselect.m (ns_get_local_selection):
532 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
533 * print.c (print_buffer_size, print_buffer_pos, print_buffer_pos_byte)
534 (PRINTDECLARE, PRINTPREPARE):
535 (strout, print_string):
536 (print, print_preprocess, print_check_string_charset_prop)
537 (print_object):
538 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
539 (PRINTDECLARE):
540 (temp_output_buffer_setup, Fprin1_to_string, print_object):
541 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
542 (PRINTPREPARE): Use int, not ptrdiff_t, where int is wide enough.
543 (PRINTFINISH): Use SAFE_ALLOCA, not alloca.
544 (printchar, strout): Use xpalloc to catch size calculation overflow.
545 (Fexternal_debugging_output): Use CHECK_CHARACTER, not CHECK_NUMBER,
546 to avoid mishandling large integers.
547 (print_error_message): Use SAFE_ALLOCA, not alloca.
548 (print_object): Use int, not EMACS_INT, where int is wide enough.
549 * process.c (Fdelete_process): Don't assume pid fits into EMACS_INT.
550 (Fset_process_window_size, Fformat_network_address)
551 (get_lisp_to_sockaddr_size, set_socket_option, Fmake_network_process)
552 (Fsignal_process, sigchld_handler):
553 Check that fixnums are in proper range for system types.
554 (Fformat_network_address, read_process_output, send_process)
555 (Fprocess_send_region, status_notify):
556 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
557 (Fformat_network_address, Fmake_serial_process, Fmake_network_process)
558 (wait_reading_process_output, read_process_output, exec_sentinel):
559 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
560 (conv_lisp_to_sockaddr): Don't assume fixnums fit into int.
561 (Faccept_process_output): Use duration_to_sec_usec to do proper
562 overflow checking on durations.
b62b53e8
PE
563 * puresize.h (PURESIZE_RATIO): Shrink this to 8/6 on 32-bit hosts
564 configured --with-wide-int.
d311d28c
PE
565 * scroll.c (calculate_scrolling, calculate_direct_scrolling)
566 (line_ins_del): Use int, not EMACS_INT, where int is wide enough.
567 * search.c (looking_at_1, string_match_1):
568 (fast_string_match, fast_c_string_match_ignore_case)
569 (fast_string_match_ignore_case, fast_looking_at, scan_buffer)
570 (scan_newline, find_before_next_newline, search_command)
571 (trivial_regexp_p, search_buffer, simple_search, boyer_moore)
572 (set_search_regs, wordify):
573 (Freplace_match):
574 (Fmatch_data):
575 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
576 (string_match_1, search_buffer, set_search_regs):
577 (Fmatch_data):
578 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
579 (wordify): Check for overflow in size calculation.
580 (Freplace_match): Avoid potential buffer overflow in search_regs.start.
581 (Fset_match_data): Don't assume fixnum fits in ptrdiff_t.
582 Check that fixnums are in proper range for system types.
583 * sound.c (struct sound_device)
584 (wav_play, au_play, vox_write, alsa_period_size, alsa_write):
585 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
586 (Fplay_sound_internal):
587 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
588 * syntax.c (ST_COMMENT_STYLE, ST_STRING_STYLE):
589 In definitions, make it clearer that these values must be out of range
5895d7b9
PE
590 for the respective integer ranges. This fixes a bug with
591 ST_STRING_STYLE and non-ASCII characters.
d311d28c
PE
592 (struct lisp_parse_state, find_start_modiff)
593 (Finternal_describe_syntax_value, scan_lists, scan_sexps_forward):
594 (Fparse_partial_sexp):
595 Don't assume fixnums can fit in int.
596 (struct lisp_parse_state, find_start_pos, find_start_value)
597 (find_start_value_byte, find_start_begv)
598 (update_syntax_table, char_quoted, dec_bytepos)
599 (find_defun_start, prev_char_comend_first, back_comment):
600 (scan_words, skip_chars, skip_syntaxes, forw_comment, Fforward_comment)
601 (scan_lists, Fbackward_prefix_chars, scan_sexps_forward):
602 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
603 (Finternal_describe_syntax_value): Check that match_lisp is a
604 character, not an integer, since the code stuffs it into int.
605 (scan_words, scan_sexps_forward):
606 Check that fixnums are in proper range for system types.
607 (Fforward_word):
608 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
609 (scan_sexps_forward):
610 Use CHARACTERP, not INTEGERP, since the value must fit into int.
611 (Fparse_partial_sexp): Fix doc; element 8 is not ignored.
612 * syntax.h: Adjust decls to match defn changes elsewhere.
613 (struct gl_state_s):
614 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
615 * sysdep.c (wait_for_termination_1, wait_for_termination)
616 (interruptible_wait_for_termination, mkdir):
617 Don't assume pid_t fits in int; on 64-bit AIX pid_t is 64-bit.
618 (emacs_read, emacs_write):
619 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
620 (system_process_attributes): Don't assume uid_t, gid_t, and
621 double all fit in int or even EMACS_INT.
622 * term.c (set_tty_color_mode):
623 Check that fixnums are in proper range for system types.
624 * termhooks.h (struct input_event):
625 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
626 * textprop.c (validate_interval_range, interval_of)
627 (Fadd_text_properties, set_text_properties_1)
628 (Fremove_text_properties, Fremove_list_of_text_properties)
629 (Ftext_property_any, Ftext_property_not_all)
630 (copy_text_properties, text_property_list, extend_property_ranges)
631 (verify_interval_modification):
632 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
633 (Fnext_single_char_property_change)
634 (Fprevious_single_char_property_change):
635 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5895d7b9
PE
636 (copy_text_properties):
637 Check for integer overflow in index calculation.
d311d28c
PE
638 * undo.c (last_boundary_position, record_point, record_insert)
639 (record_delete, record_marker_adjustment, record_change)
640 (record_property_change):
641 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
642 (truncate_undo_list, Fprimitive_undo): Don't assume fixnum fits in int.
643 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
644 * w32fns.c (Fx_create_frame, x_create_tip_frame, Fx_show_tip)
645 (Fx_hide_tip, Fx_file_dialog):
646 * w32menu.c (set_frame_menubar):
647 Use ptrdiff_t, not int, for consistency with rest of code.
648 * window.c (window_scroll_preserve_hpos, window_scroll_preserve_vpos)
649 (select_window, Fdelete_other_windows_internal)
650 (window_scroll_pixel_based, window_scroll_line_based)
651 (Frecenter, Fset_window_configuration):
652 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
653 (Fset_window_hscroll, run_window_configuration_change_hook)
654 (set_window_buffer, temp_output_buffer_show, scroll_command)
5895d7b9 655 (Fscroll_other_window, Frecenter):
d311d28c
PE
656 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
657 (Fwindow_line_height, window_scroll, Fscroll_left, Fscroll_right):
658 Don't assume fixnum fits in int.
659 (Fset_window_scroll_bars):
660 Check that fixnums are in proper range for system types.
661 * xdisp.c (help_echo_pos, pos_visible_p, string_pos_nchars_ahead)
662 (string_pos, c_string_pos, number_of_chars, init_iterator)
663 (in_ellipses_for_invisible_text_p, init_from_display_pos)
664 (compute_stop_pos, next_overlay_change, compute_display_string_pos)
665 (compute_display_string_end, handle_face_prop)
5895d7b9
PE
666 (face_before_or_after_it_pos, handle_invisible_prop)
667 (handle_display_prop, handle_display_spec, handle_single_display_spec)
d311d28c
PE
668 (display_prop_intangible_p, string_buffer_position_lim)
669 (string_buffer_position, handle_composition_prop, load_overlay_strings)
670 (get_overlay_strings_1, get_overlay_strings)
671 (iterate_out_of_display_property, forward_to_next_line_start)
672 (back_to_previous_visible_line_start, reseat, reseat_to_string)
673 (get_next_display_element, set_iterator_to_next)
674 (get_visually_first_element, compute_stop_pos_backwards)
675 (handle_stop_backwards, next_element_from_buffer)
676 (move_it_in_display_line_to, move_it_in_display_line)
677 (move_it_to, move_it_vertically_backward, move_it_by_lines)
678 (add_to_log, message_dolog, message_log_check_duplicate)
679 (message2, message2_nolog, message3, message3_nolog
680 (with_echo_area_buffer, display_echo_area_1, resize_mini_window_1)
681 (current_message_1, truncate_echo_area, truncate_message_1)
682 (set_message, set_message_1, store_mode_line_noprop)
683 (hscroll_window_tree, debug_delta, debug_delta_bytes, debug_end_vpos)
684 (text_outside_line_unchanged_p, check_point_in_composition)
685 (reconsider_clip_changes)
686 (redisplay_internal, set_cursor_from_row, try_scrolling)
687 (try_cursor_movement, set_vertical_scroll_bar, redisplay_window)
688 (redisplay_window, find_last_unchanged_at_beg_row)
689 (find_first_unchanged_at_end_row, row_containing_pos, try_window_id)
690 (trailing_whitespace_p, find_row_edges, display_line)
691 (RECORD_MAX_MIN_POS, Fcurrent_bidi_paragraph_direction)
692 (display_mode_element, store_mode_line_string)
693 (pint2str, pint2hrstr, decode_mode_spec)
694 (display_count_lines, display_string, draw_glyphs)
695 (x_produce_glyphs, x_insert_glyphs)
696 (rows_from_pos_range, mouse_face_from_buffer_pos)
697 (fast_find_string_pos, mouse_face_from_string_pos)
698 (note_mode_line_or_margin_highlight, note_mouse_highlight):
699 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
700 (safe_call, init_from_display_pos, handle_fontified_prop)
701 (handle_single_display_spec, load_overlay_strings)
702 (with_echo_area_buffer, setup_echo_area_for_printing)
703 (display_echo_area, echo_area_display)
704 (x_consider_frame_title, prepare_menu_bars, update_menu_bar)
705 (update_tool_bar, hscroll_window_tree, redisplay_internal)
5895d7b9
PE
706 (redisplay_window, dump_glyph_row, display_mode_line)
707 (Fformat_mode_line, decode_mode_spec, on_hot_spot_p):
d311d28c
PE
708 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
709 (handle_single_display_spec, build_desired_tool_bar_string)
710 (redisplay_tool_bar, scroll_window_tree, Fdump_glyph_matrix)
711 (get_specified_cursor_type):
712 Check that fixnums are in proper range for system types.
713 (struct overlay_entry, resize_mini_window, Fdump_glyph_row)
714 (Flookup_image_map):
715 Don't assume fixnums fit in int.
716 (compare_overlay_entries):
717 Avoid mishandling comparisons due to subtraction overflow.
718 (load_overlay_strings): Use SAFE_NALLOCA, not alloca.
719 (last_escape_glyph_face_id, last_glyphless_glyph_face_id):
720 (handle_tool_bar_click):
721 Use int, not unsigned, since we prefer signed and the signedness
722 doesn't matter here.
723 (get_next_display_element, next_element_from_display_vector):
724 Use int, not EMACS_INT, when int is wide enough.
725 (start_hourglass): Use duration_to_sec_usec to do proper
726 overflow checking on durations.
727 * xfaces.c (Fbitmap_spec_p):
728 Check that fixnums are in proper range for system types.
729 (compare_fonts_by_sort_order):
730 Avoid mishandling comparisons due to subtraction overflow.
731 (Fx_family_fonts, realize_basic_faces):
732 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
733 (Fx_family_fonts):
734 Don't assume fixnum fits in int.
735 Use SAFE_ALLOCA_LISP, not alloca.
736 (merge_face_heights): Remove unnecessary cast to EMACS_INT.
737 (Finternal_make_lisp_face): Don't allocate more than MAX_FACE_ID.
738 (face_at_buffer_position, face_for_overlay_string)
739 (face_at_string_position):
740 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
741 (merge_faces): Use int, not EMACS_INT, where int is wide enough.
742 * xfns.c (x_set_menu_bar_lines, x_set_tool_bar_lines, x_icon_verify)
743 (Fx_show_tip):
744 Check that fixnums are in proper range for system types.
745 (Fx_create_frame, x_create_tip_frame, Fx_show_tip)
746 (Fx_hide_tip, Fx_file_dialog, Fx_select_font):
747 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
748 (Fx_change_window_property): Don't assume fixnums fit in int.
749 * xfont.c (xfont_chars_supported):
750 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
751 * xmenu.c (Fx_popup_dialog, set_frame_menubar)
752 (create_and_show_popup_menu, create_and_show_dialog, xmenu_show):
753 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
754 * xml.c (parse_region):
755 * xrdb.c (magic_file_p):
756 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
757 * xselect.c (TRACE1): Don't assume pid_t promotes to int.
758 (x_get_local_selection, x_reply_selection_request)
759 (x_handle_selection_request, wait_for_property_change):
760 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
761 (selection_data_to_lisp_data): Use short, not EMACS_INT, where
762 short is wide enough.
763 (x_send_client_event): Don't assume fixnum fits in int.
764 * xterm.c (x_x_to_emacs_modifiers):
765 Don't assume EMACS_INT overflows nicely into int.
766 (x_emacs_to_x_modifiers): Use EMACS_INT, not int, because values
767 may come from Lisp.
768 (handle_one_xevent): NATNUMP can eval its arg twice.
769 (x_connection_closed):
770 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
771 * xterm.h: Adjust decls to match defn changes elsewhere.
772 (struct scroll_bar): Use struct vectorlike_header
773 rather than rolling our own approximation.
774 (SCROLL_BAR_VEC_SIZE): Remove; not used.
775
b2bf61aa
MA
7762011-09-25 Michael Albinus <michael.albinus@gmx.de>
777
778 * dbusbind.c (Fdbus_register_signal): When service is not
779 registered, use nil in Vdbus_registered_objects_table. (Bug#9581)
780
32bbb17c
GM
7812011-09-25 Glenn Morris <rgm@gnu.org>
782
783 * buffer.c (truncate-lines): Doc fix.
784
94e0933e
CY
7852011-09-24 Chong Yidong <cyd@stupidchicken.com>
786
787 * window.c (Fwindow_prev_buffers, Fset_window_prev_buffers)
788 (Fset_window_next_buffers): Doc fix.
789
cddde921
GM
7902011-09-24 Glenn Morris <rgm@gnu.org>
791
792 * minibuf.c (read_minibuf): Disable line truncation. (Bug#5715)
793
1260aef1
PE
7942011-09-24 Paul Eggert <eggert@cs.ucla.edu>
795
25b4bfa0
PE
796 Fix minor problems found by static checking.
797 * xdisp.c (string_from_display_spec): Don't assume vecsize fits in int.
1260aef1
PE
798 * indent.c (Fvertical_motion): Fix == vs = typo.
799
e3cbd34b
EZ
8002011-09-24 Eli Zaretskii <eliz@gnu.org>
801
6bf7006f
EZ
802 * dispnew.c (syms_of_display) <redisplay-dont-pause>: Default
803 value is now t. Doc fix.
804
e3cbd34b
EZ
805 * indent.c (Fvertical_motion): Compute and apply the overshoot
806 logic when moving up, not only when moving down. Fix the
807 confusing name and values of the it_overshoot_expected variable;
808 logic changes accordingly. (Bug#9254) (Bug#9549)
809
810 * xdisp.c (pos_visible_p): Produce correct pixel coordinates when
811 CHARPOS is covered by a display string which includes newlines.
812 (move_it_vertically_backward): Avoid inflooping when START_CHARPOS
813 is covered by a display string with embedded newlines.
814
a3de0cbd
MA
8152011-09-24 Michael Albinus <michael.albinus@gmx.de>
816
817 * dbusbind.c (Fdbus_register_signal): Add match rule to
818 Vdbus_registered_objects_table. (Bug#9581)
819 (Fdbus_register_method, Vdbus_registered_objects_table): Fix
820 docstring.
821
b260039d
JM
8222011-09-24 Jim Meyering <meyering@redhat.com>
823
824 do not ignore write error for any output size
825 The previous change was incomplete.
826 While it makes emacs --batch detect the vast majority of stdout
827 write failures, errors were still ignored whenever the output size is
828 k * (BUFSIZ+1) - 4. E.g., on a system with BUFSIZ of 4096,
829 $ emacs --batch --eval '(print (format "%4093d" 0))' > /dev/full \
830 && echo FAIL: ignored write error
831 FAIL: ignored write error
832 $ emacs --batch --eval '(print (format "%20481d" 0))' > /dev/full \
833 && echo FAIL: ignored write error
834 FAIL: ignored write error
835 * emacs.c (Fkill_emacs): Also test ferror. (Bug#9574)
836
8eca8a7c
AS
8372011-09-23 Andreas Schwab <schwab@linux-m68k.org>
838
839 * emacs.c (Fkill_emacs): In noninteractive mode exit
840 non-successfully if a write error occurred on stdout. (Bug#9574)
841
3341db62
EZ
8422011-09-21 Eli Zaretskii <eliz@gnu.org>
843
844 * xdisp.c (pop_it): Allow it->object that is a cons cell to pass
845 the xassert test.
846
847 * dispextern.h (struct it): Update the comment documenting what
848 can it->OBJECT be.
849
8c203dbf
EZ
8502011-09-20 Eli Zaretskii <eliz@gnu.org>
851
852 * xdisp.c (set_cursor_from_row): If the row ends in a newline from
853 a display string, extend search for cursor position to end of row.
854 (find_row_edges): If the row ends in a newline from a display
855 string, increment its MATRIX_ROW_END_CHARPOS by one. (Bug#9549)
856 Handle the case of a display string with multiple newlines.
fd317ddf
EZ
857 (Fcurrent_bidi_paragraph_direction): Fix search for previous
858 non-empty line. Fixes confusing cursor motion with arrow keys at
859 the beginning of a line that starts with whitespace.
8c203dbf 860
a4824228
LMI
8612011-09-19 Lars Magne Ingebrigtsen <larsi@gnus.org>
862
863 * lread.c (Fread_from_string): Document what FINAL-STRING-INDEX is
864 (bug#9493).
865
33ed493b
CY
8662011-09-18 Chong Yidong <cyd@stupidchicken.com>
867
868 * xfns.c (Fx_create_frame): Handle the bitmapIcon resource as
869 boolean (Bug#9154).
870
56cd55c8
EZ
8712011-09-18 Eli Zaretskii <eliz@gnu.org>
872
873 * xdisp.c (display_line): Record maximum and minimum buffer
874 positions even if no glyphs were produced (e.g., by a zero-width
875 stretch). Fixes bug#9530 on a TTY. Under word-wrap, don't record
876 buffer positions that will be removed from the glyph row because
877 they don't fit.
c02dcedf
EZ
878 (produce_stretch_glyph): Fix a bug in :align-to on a TTY when the
879 column is beyond frame width: don't subtract 1 "pixel" when
880 computing width of the stretch.
3e62b7e0
EZ
881 (reseat_at_next_visible_line_start): Undo the change made on
882 2011-09-17 that saved paragraph information and restored it after
883 the call to `reseat'. (Bug#9545)
56cd55c8 884
5ed99d36 8852011-09-18 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
3390454c
YM
886
887 * xdisp.c (expose_window): Save original value of phys_cursor_on_p
888 and turn window cursor on if cleared (Bug#9415).
889
5ed99d36 8902011-09-18 Andreas Schwab <schwab@linux-m68k.org>
edb7b4dc
AS
891
892 * search.c (boyer_moore): Take unibyte characters from pattern
893 literally. (Bug#9458)
894
9bade7b2
EZ
8952011-09-18 Eli Zaretskii <eliz@gnu.org>
896
897 * xdisp.c (reseat_at_next_visible_line_start): Fix last change.
898
e5e9d610
PE
8992011-09-18 Paul Eggert <eggert@cs.ucla.edu>
900
87e4427a
PE
901 Fix minor problem found by static checking.
902 * xdisp.c (reseat_at_next_visible_line_start): Mark locals as
903 initialized, to pacify gcc -Wuninitialized.
904
e5e9d610
PE
905 * fileio.c: Report proper errno when syscall falls.
906 (Finsert_file_contents): Save and restore errno,
907 so that report_file_error outputs the correct diagnostic.
908 (Fwrite_region) [CLASH_DETECTION]: Likewise.
909
a1674f0b
EZ
9102011-09-18 Eli Zaretskii <eliz@gnu.org>
911
912 * .gdbinit (pgx): Fix references to fields of `struct glyph'.
913
fbfb6dd4
EZ
9142011-09-17 Eli Zaretskii <eliz@gnu.org>
915
916 * xdisp.c (produce_stretch_glyph): Another fix for changes made on
917 2011-08-30T17:32:44Z!eliz@gnu.org. (Bug#9530)
918
bb187662
EZ
9192011-09-17 Eli Zaretskii <eliz@gnu.org>
920
1137e8b8
EZ
921 * xdisp.c (reseat_at_next_visible_line_start): Keep information
922 about the current paragraph and restore it after the call to
923 reseat.
924
925 * bidi.c (MAX_PARAGRAPH_SEARCH): New macro.
926 (bidi_find_paragraph_start): Search back for paragraph beginning
927 at most MAX_PARAGRAPH_SEARCH lines; if not found, return BEGV_BYTE.
928 (bidi_move_to_visually_next): Only trigger paragraph-related
929 computations when the last character is a newline or at EOB, not
930 just any NEUTRAL_B. (Bug#9470)
931
bb187662
EZ
932 * xdisp.c (set_cursor_from_row): Don't invoke special treatment of
933 truncated lines if point is covered by a display string. (Bug#9524)
934
2e621251
PE
9352011-09-16 Paul Eggert <eggert@cs.ucla.edu>
936
937 * xselect.c: Relax test for outgoing X longs (Bug#9498).
938 (cons_to_x_long): New function.
939 (lisp_data_to_selection_data): Use it. Correct the test for
940 short-versus-long data; it was negated. Break out of vector
941 loop, for efficiency, when a long datum is discovered.
942
91a15bc6
SM
9432011-09-16 Stefan Monnier <monnier@iro.umontreal.ca>
944
945 * eval.c (Fquote): Document its non-consing behavior (bug#9482).
946
b41c3a35
EZ
9472011-09-16 Eli Zaretskii <eliz@gnu.org>
948
949 * image.c (tiff_handler): Work around a bug in MinGW GCC 3.x (see
950 GCC PR/17406) by declaring this function with external scope.
951
7812ba2d
PE
9522011-09-15 Paul Eggert <eggert@cs.ucla.edu>
953
954 * editfns.c (Fformat): Fix bug in text-property fix (Bug#9514).
955 Don't mishandle (length (format "%%")) and (format "%4000s%%" "").
956
cf7edc2a
AS
9572011-09-15 Andreas Schwab <schwab@linux-m68k.org>
958
959 * editfns.c (Fformat): Correctly handle text properties on "%%".
960
bd01620e
EZ
9612011-09-15 Eli Zaretskii <eliz@gnu.org>
962
963 * xterm.c (x_draw_composite_glyph_string_foreground):
964 * w32term.c (x_draw_composite_glyph_string_foreground):
965 * term.c (encode_terminal_code):
966 * composite.c (composition_update_it, get_composition_id):
967 * xdisp.c (get_next_display_element)
968 (fill_composite_glyph_string): Add comments about special meaning
969 of TAB characters in a composition.
970
a02719a3
PE
9712011-09-15 Paul Eggert <eggert@cs.ucla.edu>
972
973 * editfns.c (Fformat): Fix off-by-1 bug for "%%b" (Bug#9514).
4c122725
PE
974 This occurs when processing a multibyte format.
975 Problem reported by Wolfgang Jenker.
a02719a3 976
72589a3c
JB
9772011-09-15 Johan Bockgård <bojohan@gnu.org>
978
979 * xdisp.c (try_cursor_movement): Only check for exact match if
980 cursor hpos found by set_cursor_from_row is valid. (Bug#9495)
981
1c14176c
PE
9822011-09-14 Paul Eggert <eggert@cs.ucla.edu>
983
984 Remove unused external symbols.
985 * dispextern.h (calc_pixel_width_or_height): Remove decl.
986 * xdisp.c (calc_pixel_width_or_height): Now static.
987 * doprnt.c (exprintf) [! (HAVE_X_WINDOWS && USE_X_TOOLKIT)]: Remove.
988 * indent.c (check_display_width):
989 * w32term.c: Fix comment to match code.
990 * xterm.c, xterm.h (x_catching_errors): Remove.
991
d2eea5b5
PE
9922011-09-14 Paul Eggert <eggert@cs.ucla.edu>
993
994 * xselect.c: Use signed conversions more consistently (Bug#9498).
995 (selection_data_to_lisp_data): Assume incoming selection data are
996 signed integers, not unsigned. This is to be consistent with
997 outgoing selection data, which was modified to use signed integers
998 in as part of the fix to Bug#9196 in response to Jan D.'s comment
999 in <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9196#32> that X11
1000 expects long, not unsigned long.
1001
46888499
EZ
10022011-09-14 Eli Zaretskii <eliz@gnu.org>
1003
1004 * xdisp.c (try_window_reusing_current_matrix): Fix incorrect
1005 computation of loop end. Reported by Johan Bockgård
1006 <bojohan@gnu.org>.
1007
ef8ef9fb
CY
10082011-09-13 Chong Yidong <cyd@stupidchicken.com>
1009
1010 * frame.c (Fother_visible_frames_p): Function deleted.
1011
fa819fed
EZ
10122011-09-12 Eli Zaretskii <eliz@gnu.org>
1013
1014 * indent.c (compute_motion): Process display vector front to back
1015 rather than the other way around. (Bug#2496)
1016
2ba8e008
SM
10172011-09-12 Stefan Monnier <monnier@iro.umontreal.ca>
1018
1019 * fileio.c (Finsert_file_contents): Don't assume beg_offset is 0.
1020
20f53c69
CY
10212011-09-11 Chong Yidong <cyd@stupidchicken.com>
1022
1023 * minibuf.c (Fread_from_minibuffer): Doc fix.
1024
d562d7a4
EZ
10252011-09-11 Eli Zaretskii <eliz@gnu.org>
1026
1027 * xdisp.c (produce_stretch_glyph): Fix a typo made in changes from
1028 2011-08-30T17:32:44Z!eliz@gnu.org. (Bug#9475)
1029
1c4d7f3d
LMI
10302011-09-11 Lars Magne Ingebrigtsen <larsi@gnus.org>
1031
1032 * fileio.c (Fvisited_file_modtime): Document `(-1 65535)' as a
1033 value for non-existent files.
1034
b885bf36
EZ
10352011-09-11 Eli Zaretskii <eliz@gnu.org>
1036
1037 * fileio.c (Finsert_file_contents): If the file cannot be opened,
1038 set its "size" to -1. This will set the modtime_size field of
1039 the corresponding buffer to -1, which is what
1040 verify-visited-file-modtime expects for files that do not exist.
1041 (Bug#9139)
1042
6612f0bf
PE
10432011-09-11 Paul Eggert <eggert@cs.ucla.edu>
1044
1045 * keymap.h (KEY_DESCRIPTION_SIZE, push_key_description): Move decls
1046 here ...
1047 * lisp.h: ... from here. push_key_description is no longer
1048 defined in keyboard.c, so its declaration should not be in
1049 lisp.h's "Defined in keyboard.c" section, and KEY_DESCRIPTION_SIZE
1050 logically belongs with push_key_description.
1051
dfb3f755
PE
10522011-09-10 Paul Eggert <eggert@cs.ucla.edu>
1053
1054 * buffer.h: Include <sys/types.h> instead of <time.h>.
1055 Otherwise, off_t wasn't defined on FreeBSD 9.0-BETA2 i386.
1056 Problem reported by Herbert J. Skuhra.
1057
3134906c
LMI
10582011-09-10 Lars Magne Ingebrigtsen <larsi@gnus.org>
1059
1060 * xml.c (parse_region): Make the parsing work for
1061 non-comment-starting XML files again (bug#9144).
1062
8d903f4e
AS
10632011-09-10 Andreas Schwab <schwab@linux-m68k.org>
1064
1065 * image.c (gif_load): Fix calculation of bottom and right corner.
1066 (Bug#9468)
1067
80ad64f4
EZ
10682011-09-10 Eli Zaretskii <eliz@gnu.org>
1069
1070 * xdisp.c (MAX_DISP_SCAN): Decrease to 250. Prevents sluggish
1071 redisplay in small windows.
1072
208a048d
EZ
10732011-09-09 Eli Zaretskii <eliz@gnu.org>
1074
1075 * frame.c (x_report_frame_params): Cast to avoid compiler warnings.
1076
9b1c252e
MR
10772011-09-08 Martin Rudalics <rudalics@gmx.at>
1078
1079 * window.c (Fset_window_prev_buffers, Fset_window_next_buffers):
1080 Operate on live windows only.
1081
2949f33b
JB
10822011-09-08 Juanma Barranquero <lekktu@gmail.com>
1083
1084 * emacs.c (my_heap_start): #ifdef to avoid warnings when unused.
1085
e08dcafd
EZ
10862011-09-07 Eli Zaretskii <eliz@gnu.org>
1087
1088 * xdisp.c (move_it_in_display_line_to): Call RESTORE_IT on ppos_it
1089 only under bidi iteration.
1090
115b96bd
JD
10912011-09-07 Jan Djärv <jan.h.d@swipnet.se>
1092
1093 * gtkutil.c (xg_make_tool_item): Insert comment about eventbox.
1094
c8199d0f
PE
10952011-09-06 Paul Eggert <eggert@cs.ucla.edu>
1096
1097 isnan: Fix porting problem to Solaris 10 with bundled gcc.
1098 Without this fix, the command to link temacs failed due to an
1099 undefined symbol __builtin_isnan. This is because
1100 /usr/include/iso/math_c99.h #defines isnan(x) to
1101 __builtin_isnan(x), but the bundled gcc, which identifies itself
1102 as gcc 3.4.3 (csl-sol210-3_4-branch+sol_rpath), does not have
1103 a __builtin_isnan.
1104 * floatfns.c (isnan): #undef, and then #define to a clone of
1105 what's in data.c.
1106 (Fisnan): Always define, since it's always available now.
1107 (syms_of_floatfns): Always define isnan at the Lisp level.
1108
e39b275c 11092011-09-06 Paul Eggert <eggert@cs.ucla.edu>
1c262cae
PE
1110
1111 * Makefile.in (gl-stamp): move-if-change now in build-aux (Bug#9169).
1112
b2db44d9 11132011-09-06 Paul Eggert <eggert@cs.ucla.edu>
728f8f0a 1114
f4af5137 1115 * fileio.c: Fix bugs with large file offsets (Bug#9428).
728f8f0a
PE
1116 The previous code assumed that file offsets (off_t values) fit in
1117 EMACS_INT variables, which is not true on typical 32-bit hosts.
1118 The code messed up by falsely reporting buffer overflow in cases
1119 such as (insert-file-contents "big" nil 1 2) into an empty buffer
1120 when "big" contains more than 2**29 bytes, even though this
1121 inserts just one byte and does not overflow the buffer.
1122 (Finsert_file_contents): Store file offsets as off_t
1123 values, not as EMACS_INT values. Check for overflow when
1124 converting between EMACS_INT and off_t. When checking for
1125 buffer overflow or for overlap, take the offsets into account.
1126 Don't use EMACS_INT for small values where int suffices.
1127 When checking for overlap, fix a typo: ZV was used where
1128 ZV_BYTE was intended.
1129 (Fwrite_region): Don't assume off_t fits into 'long'.
1130 * buffer.h (struct buffer.modtime_size): Now off_t, not EMACS_INT.
1131
ecfc0a49
MA
11322011-09-05 Michael Albinus <michael.albinus@gmx.de>
1133
1134 * dbusbind.c (xd_signature_cat): Rename from signature_cat.
1135
6511acf2 11362011-09-04 Paul Eggert <eggert@cs.ucla.edu>
61bfeeb7 1137
0999621a 1138 sprintf-related integer and memory overflow issues (Bug#9412).
62f19c19
PE
1139
1140 * doprnt.c (doprnt): Support printing ptrdiff_t and intmax_t values.
8666506e 1141 (esprintf, exprintf, evxprintf): New functions.
62f19c19
PE
1142 * keyboard.c (command_loop_level): Now EMACS_INT, not int.
1143 (cmd_error): kbd macro iterations count is now EMACS_INT, not int.
1144 (modify_event_symbol): Do not assume that the length of
1145 name_alist_or_stem is safe to alloca and fits in int.
1146 (Fexecute_extended_command): Likewise for function name and binding.
1147 (Frecursion_depth): Wrap around reliably on integer overflow.
1148 * keymap.c (push_key_description): First arg is now EMACS_INT, not int,
1149 since some callers pass EMACS_INT values.
1150 (Fsingle_key_description): Don't crash if symbol name contains more
1151 than MAX_ALLOCA bytes.
1152 * minibuf.c (minibuf_level): Now EMACS_INT, not int.
1153 (get_minibuffer): Arg is now EMACS_INT, not int.
1154 * lisp.h (get_minibuffer, push_key_description): Reflect API changes.
8666506e 1155 (esprintf, exprintf, evxprintf): New decls.
62f19c19
PE
1156 * window.h (command_loop_level, minibuf_level): Reflect API changes.
1157
2be7d702
PE
1158 * dbusbind.c (signature_cat): New function.
1159 (xd_signature, Fdbus_register_signal):
2ea16b89
PE
1160 Do not overrun buffer; instead, report string overflow.
1161
9d1df220
PE
1162 * dispnew.c (add_window_display_history): Don't overrun buffer.
1163 Truncate instead; this is OK since it's just a log.
1164
33ef5c64
PE
1165 * editfns.c (Fcurrent_time_zone): Don't overrun buffer
1166 even if the time zone offset is outlandishly large.
1167 Don't mishandle offset == INT_MIN.
1168
66c6fdd5
PE
1169 * emacs.c (main) [NS_IMPL_COCOA]: Don't overrun buffer
1170 when creating daemon; the previous buffer-overflow check was incorrect.
1171
d749b01b
PE
1172 * eval.c (verror): Simplify by rewriting in terms of evxprintf,
1173 which has the guts of the old verror function.
1174
b5cd1905
PE
1175 * filelock.c (lock_file_1, lock_file): Don't blindly alloca long name;
1176 use SAFE_ALLOCA instead. Use esprintf to avoid int-overflow issues.
1177
6e1a67fb
PE
1178 * font.c: Include <float.h>, for DBL_MAX_10_EXP.
1179 (font_unparse_xlfd): Don't blindly alloca long strings.
c21721cc 1180 Don't assume XINT result fits in int, or that XFLOAT_DATA * 10
8666506e 1181 fits in int, when using sprintf. Use single snprintf to count
c21721cc
PE
1182 length of string rather than counting it via multiple sprintfs;
1183 that's simpler and more reliable.
c21721cc
PE
1184 (font_unparse_fcname): Use it to avoid sprintf buffer overrun.
1185 (generate_otf_features) [0 && HAVE_LIBOTF]: Use esprintf, not
1186 sprintf, in case result does not fit in int.
1187
c57b67fc
PE
1188 * fontset.c (num_auto_fontsets): Now printmax_t, not int.
1189 (fontset_from_font): Print it.
1190
8a401434
PE
1191 * frame.c (tty_frame_count): Now printmax_t, not int.
1192 (make_terminal_frame, set_term_frame_name): Print it.
1193 (x_report_frame_params): In X, window IDs are unsigned long,
1194 not signed long, so print them as unsigned.
1195 (validate_x_resource_name): Check for implausibly long names,
1196 and don't assume name length fits in 'int'.
1197 (x_get_resource_string): Don't blindly alloca invocation name;
1198 use SAFE_ALLOCA. Use esprintf, not sprintf, in case result does
1199 not fit in int.
1200
6e1a67fb
PE
1201 * gtkutil.c: Include <float.h>, for DBL_MAX_10_EXP.
1202 (xg_check_special_colors, xg_set_geometry):
84722b3d
PE
1203 Make sprintf buffers a bit bigger, to avoid potential buffer overrun.
1204
0df02bf3
PE
1205 * lread.c (dir_warning): Don't blindly alloca buffer; use SAFE_ALLOCA.
1206 Use esprintf, not sprintf, in case result does not fit in int.
1207
48e30793
PE
1208 * macros.c (executing_kbd_macro_iterations): Now EMACS_INT, not int.
1209 (Fend_kbd_macro): Don't mishandle MOST_NEGATIVE_FIXNUM by treating
1210 it as a large positive number.
1211 (Fexecute_kbd_macro): Don't assume repeat count fits in int.
1212 * macros.h (executing_kbd_macro_iterations): Now EMACS_INT, not int.
1213
a66ff6d8
PE
1214 * nsterm.m ((NSSize)windowWillResize): Use esprintf, not sprintf,
1215 in case result does not fit in int.
1216
aca216ff
PE
1217 * print.c (float_to_string): Detect width overflow more reliably.
1218 (print_object): Make sprintf buffer a bit bigger, to avoid potential
1219 buffer overrun. Don't assume list length fits in 'int'. Treat
1220 print length of 0 as 0, not as infinity; to be consistent with other
1221 uses of print length in this function. Don't overflow print length
1222 index. Don't assume hash table size fits in 'long', or that
1223 vectorlike size fits in 'unsigned long'.
1224
31c286f7
PE
1225 * process.c (make_process): Use printmax_t, not int, to format
1226 process-name gensyms.
1227
55e5faa1
PE
1228 * sysdep.c (snprintf) [! HAVE_SNPRINTF]: New function.
1229
80f2e268
PE
1230 * term.c (produce_glyphless_glyph): Make sprintf buffer a bit bigger
1231 to avoid potential buffer overrun.
1232
670741ab
PE
1233 * xfaces.c (x_update_menu_appearance): Don't overrun buffer
1234 if X resource line is longer than 512 bytes.
1235
b7163a50
PE
1236 * xfns.c (x_window): Make sprintf buffer a bit bigger
1237 to avoid potential buffer overrun.
1238
ae58ff1f
PE
1239 * xterm.c (x_io_error_quitter): Don't overrun sprintf buffer.
1240
c43c8a6a
PE
1241 * xterm.h (x_check_errors): Add ATTRIBUTE_FORMAT_PRINTF.
1242
3f8236f4
PE
12432011-09-04 Paul Eggert <eggert@cs.ucla.edu>
1244
53e9fe90 1245 Integer overflow fixes for scrolling, etc.
6511acf2
PE
1246 Without these, Emacs silently mishandles large integers sometimes.
1247 For example, "C-u 4294967297 M-x recenter" was treated as if
53e9fe90
PE
1248 it were "C-u 1 M-x recenter" on a typical 64-bit host.
1249
6511acf2
PE
1250 * xdisp.c (try_window_id): Check Emacs fixnum range before
1251 converting to 'int'.
806add1d 1252
6511acf2 1253 * window.c (window_scroll_line_based, Frecenter):
71f02bc5
PE
1254 Check that an Emacs fixnum is in range before assigning it to 'int'.
1255 (Frecenter, Fmove_to_window_line): Use EMACS_INT, not int, for
1256 values converted from Emacs fixnums.
1257 (Frecenter): Don't wrap around a line count if it is out of 'int'
1258 range; instead, treat it as an extreme value.
1259 (Fset_window_configuration, compare_window_configurations):
1260 Use ptrdiff_t, not int, for index that might exceed 2 GiB.
1261
6511acf2
PE
1262 * search.c (Freplace_match): Use ptrdiff_t, not int, for indexes
1263 that can exceed INT_MAX. Check that EMACS_INT value is in range
1264 before assigning it to the (possibly-narrower) index.
a0efffc8
PE
1265 (match_limit): Don't assume that a fixnum can fit in 'int'.
1266
6511acf2 1267 * print.c (print_object): Use ptrdiff_t, not int, for index that can
29ebea3b
PE
1268 exceed INT_MAX.
1269
6511acf2 1270 * indent.c (position_indentation): Now takes ptrdiff_t, not int.
3f8236f4
PE
1271 (Fvertical_motion): Don't wrap around LINES values that don't fit
1272 in 'int'. Instead, treat them as extreme values. This is good
1273 enough for windows, which can't have more than INT_MAX lines anyway.
1274
fcb901a7
LMI
12752011-09-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
1276
0f2f6b6d
LMI
1277 * Require libxml/parser.h to avoid compilation warning.
1278
fcb901a7
LMI
1279 * emacs.c (shut_down_emacs): Call xmlCleanupParser on shutdown.
1280
1281 * xml.c (parse_region): Don't call xmlCleanupParser after parsing,
1282 since this reportedly can destroy thread storage.
1283
6e20a0d4
CY
12842011-08-30 Chong Yidong <cyd@stupidchicken.com>
1285
1286 * syntax.c (find_defun_start): Update all cache variables if
1287 exiting early (Bug#9401).
1288
148ae00e
EZ
12892011-08-30 Eli Zaretskii <eliz@gnu.org>
1290
f6cfbd8f
EZ
1291 * image.c (x_bitmap_pixmap): Cast to int to avoid compiler warnings.
1292
148ae00e
EZ
1293 * xdisp.c (produce_stretch_glyph): No longer static, compiled also
1294 when HAVE_WINDOW_SYSTEM is not defined. Support both GUI and TTY
1295 frames. Call tty_append_glyph in the TTY case. (Bug#9402)
1296
1297 * term.c (tty_append_glyph): New function.
1298 (produce_stretch_glyph): Static function and its prototype deleted.
1299
1300 * dispextern.h (produce_stretch_glyph, tty_append_glyph): Add
1301 prototypes.
1302
c4a07a4c
PE
13032011-08-29 Paul Eggert <eggert@cs.ucla.edu>
1304
1305 * image.c (parse_image_spec): Check for nonnegative, not for positive,
1306 when checking :margin (Bug#9390).
1307 (IMAGE_NON_NEGATIVE_INTEGER_VALUE_OR_PAIR):
1308 Renamed from IMAGE_POSITIVE_INTEGER_VALUE_OR_PAIR,
1309 so that the name doesn't mislead. All uses changed.
1310
6bc8cd65
JB
13112011-08-28 Johan Bockgård <bojohan@gnu.org>
1312
1313 * term.c (init_tty) [HAVE_GPM]: Move mouse settings after
1314 set_tty_hooks.
1315
dca4927e
EZ
13162011-08-27 Eli Zaretskii <eliz@gnu.org>
1317
1318 * xdisp.c (move_it_to): Don't bail out early when reaching
1319 position beyond to_charpos, if we are scanning backwards.
1320 (move_it_vertically_backward): When DY == 0, make sure we get to
1321 the first character in the line after the newline.
1322
f2cad773
PE
13232011-08-27 Paul Eggert <eggert@cs.ucla.edu>
1324
1325 * ccl.c: Improve and simplify overflow checking (Bug#9196).
1326 (ccl_driver): Do not generate an out-of-range pointer.
1327 (Fccl_execute_on_string): Remove unnecessary check for
1328 integer overflow, noted by Stefan Monnier in
1329 <http://lists.gnu.org/archive/html/emacs-devel/2011-08/msg00979.html>.
1330 Remove a FIXME that didn't need fixing.
1331 Simplify the newly-introduced buffer reallocation code.
1332
0cae2cdb
JB
13332011-08-27 Juanma Barranquero <lekktu@gmail.com>
1334
1335 * makefile.w32-in ($(BLD)/alloc.$(O)): Depend on lib/verify.h.
1336
5fc295a4 13372011-08-26 Paul Eggert <eggert@cs.ucla.edu>
ddff3151 1338
70c60eb2 1339 Integer and memory overflow issues (Bug#9196).
726e0ab1 1340
d31850da
PE
1341 * doc.c (get_doc_string): Rework so that
1342 get_doc_string_buffer_size is the actual buffer size, rather than
1343 being 1 less than the actual buffer size; this makes xpalloc more
1344 convenient.
1345
a69fbedb
PE
1346 * image.c (x_allocate_bitmap_record, cache_image):
1347 * xselect.c (Fx_register_dnd_atom):
1348 Simplify previous changes by using xpalloc.
1349
fe5c5d37
PE
1350 * buffer.c (overlay_str_len): Now ptrdiff_t, not EMACS_INT,
1351 since either will do and ptrdiff_t is convenient with xpalloc.
1352
0065d054
PE
1353 * charset.c (charset_table_size)
1354 (struct charset_sort_data.priority): Now ptrdiff_t.
1355 (charset_compare): Don't overflow if priorities differ greatly.
1356 (Fsort_charsets): Don't assume list length fits in int.
1357 Check for size-calculation overflow when allocating sort data.
1358 (syms_of_charset): Allocate an initial charset table that is
1359 just under 64 KiB, to avoid problems with glibc malloc and mmap.
1360
1361 * cmds.c (internal_self_insert): Check for size-calculation overflow.
1362
1363 * composite.h (struct composition.glyph_len): Now int, not unsigned.
1364 The actual value is always <= INT_MAX, and leaving it unsigned made
1365 overflow checking harder.
1366
1367 * dispextern.h (struct glyph_matrix.rows_allocated)
1368 (struct face_cache.size): Now ptrdiff_t, for convenience in use
1369 with xpalloc. The values are still always <= INT_MAX.
1370
1371 * indent.c (compute_motion): Adjust to region_cache_forward sig change.
1372
1373 * lisp.h (xnmalloc, xnrealloc, xpalloc): New decls.
1374 (SAFE_NALLOCA): New macro.
1375
1376 * region-cache.c (struct boundary.pos, find_cache_boundary)
1377 (move_cache_gap, insert_cache_boundary, delete_cache_boundaries)
1378 (set_cache_region, invalidate_region_cache)
1379 (revalidate_region_cache, know_region_cache, region_cache_forward)
1380 (region_cache_backward, pp_cache):
1381 Use ptrdiff_t, not EMACS_INT, since either will do. This is needed
1382 so that ptrdiff_t * can be passed to xpalloc.
1383 (struct region_cache): Similarly, for gap_start, gap_len, cache_len,
1384 beg_unchanged, end_unchanged, buffer_beg, buffer_end members.
1385 (pp_cache): Don't assume cache_len fits in int.
1386 * region-cache.h: Adjust extern decls to match.
1387
1388 * search.c (scan_buffer, Freplace_match): Use ptrdiff_t, not
1389 EMACS_INT, since either will do, for xpalloc.
1390
1391 * alloc.c: Include verify.h, and check that int fits in ptrdiff_t.
1392 (xnmalloc, xnrealloc, xpalloc): New functions.
1393
726e0ab1
PE
1394 * bidi.c (bidi_shelve_header_size): New constant.
1395 (bidi_cache_ensure_space, bidi_shelve_cache): Use it.
1396 (bidi_cache_ensure_space): Avoid integer overflow when allocating.
1397
51f30bc5 1398 * bidi.c (bidi_cache_shrink):
726e0ab1
PE
1399 * buffer.c (overlays_at, overlays_in, record_overlay_string)
1400 (overlay_strings):
1401 Don't update size of array until after memory allocation succeeds,
1402 because xmalloc/xrealloc may not return.
0065d054
PE
1403 (struct sortstrlist.bytes): Now ptrdiff_t, as EMACS_INT doesn't help
1404 now that we have proper integer overflow checking.
1405 (record_overlay_string, overlay_strings): Catch overflows when
1406 calculating size of overlay_str_buf.
726e0ab1 1407
0065d054
PE
1408 * callproc.c (Fcall_process): Check for size overflow when
1409 calculating size of args2.
1410 (child_setup): Avoid overflow by using size_t rather than ptrdiff_t.
1411 Normally we prefer signed values, but sticking with ptrdiff_t would
1412 require adding more-complicated checks.
726e0ab1
PE
1413
1414 * ccl.c (Fccl_execute_on_string): Check for memory overflow.
1415 Use ptrdiff_t rather than EMACS_INT where ptrdiff_t will do.
1416 Redo buffer-overflow calculations to avoid integer overflow.
0065d054 1417 Add a FIXME comment where memory seems to be over-allocated.
726e0ab1
PE
1418
1419 * character.c (Fstring): Check for size-calculation overflow.
1420
1421 * coding.c (produce_chars): Redo buffer-overflow calculations to avoid
1422 unnecessary integer overflow. Check for size overflow.
1423 (encode_coding_object): Don't update size until xmalloc succeeds.
1424
1425 * composite.c (get_composition_id): Check for overflow in glyph
1426 length calculations.
1427
1428 Integer and memory overflow fixes for display code.
1429 * dispextern.h (struct glyph_pool.nglyphs): Now ptrdiff_t, not int.
1430 * dispnew.c (adjust_glyph_matrix, realloc_glyph_pool)
1431 (scrolling_window): Check for overflow in size calculations.
1432 (line_draw_cost, realloc_glyph_pool, add_row_entry):
1433 Don't assume glyph table len fits in int.
1434 (struct row_entry.bucket, row_entry_pool_size, row_entry_idx)
1435 (row_table_size): Now ptrdiff_t, not int.
1436 (scrolling_window): Avoid overflow in size calculations.
1437 Don't update size until allocation succeeds.
1438 * fns.c (concat): Check for overflow in size calculations.
1439 (next_almost_prime): Verify NEXT_ALMOST_PRIME_LIMIT.
1440 * lisp.h (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): New macros.
1441 (NEXT_ALMOST_PRIME_LIMIT): New constant.
1442
1443 * doc.c (get_doc_string_buffer_size): Now ptrdiff_t, not int.
1444 (get_doc_string): Check for size calculation overflow.
1445 Don't update size until allocation succeeds.
1446 (get_doc_string, Fsubstitute_command_keys): Use ptrdiff_t, not
1447 EMACS_INT, where ptrdiff_t will do.
1448 (Fsubstitute_command_keys): Check for string overflow.
1449
1450 * editfns.c (set_time_zone_rule): Don't assume environment length
1451 fits in int.
1452 (message_length): Now ptrdiff_t, not int.
1453 (Fmessage_box): Don't update size until allocation succeeds.
1454 Don't assume message length fits in int.
1455 (Fformat): Use ptrdiff_t, not EMACS_INT, where ptrdiff_t will do.
1456
0065d054
PE
1457 * emacs.c (main): Do not reallocate argv, since there is a null at
1458 the end that can be overwritten, and this way there's no need to
1459 worry about size-calculation overflow.
1460 (sort_args): Check for size-calculation overflow.
726e0ab1
PE
1461
1462 * eval.c (init_eval_once, grow_specpdl): Don't update size until
1463 alloc succeeds.
1464 (call_debugger, grow_specpdl): Redo calculations to avoid overflow.
1465
1466 * frame.c (set_menu_bar_lines, x_set_frame_parameters)
1467 (x_set_scroll_bar_width, x_figure_window_size):
1468 Check for integer overflow.
1469 (x_set_alpha): Do not assume XINT fits in int.
1470
1471 * frame.h (struct frame): Use int, not EMACS_INT, where int works.
1472 This is for the members text_lines, text_cols, total_lines, total_cols,
1473 where the system imposes an 'int' limit.
1474
1475 * fringe.c (Fdefine_fringe_bitmap):
1476 Don't update size until alloc works.
1477
1478 * ftfont.c (ftfont_get_open_type_spec, setup_otf_gstring)
1479 (ftfont_shape_by_flt): Check for integer overflow in size calculations.
1480
1481 * gtkutil.c (get_utf8_string, xg_store_widget_in_map):
1482 Check for size-calculation overflow.
1483 (get_utf8_string): Use ptrdiff_t, not size_t, where either will
1484 do, as we prefer signed integers.
1485 (id_to_widget.max_size, id_to_widget.used)
1486 (xg_store_widget_in_map, xg_remove_widget_from_map)
1487 (xg_get_widget_from_map, xg_get_scroll_id_for_window)
1488 (xg_remove_scroll_bar, xg_update_scrollbar_pos):
1489 Use and return ptrdiff_t, not int.
1490 (xg_gtk_scroll_destroy): Don't assume ptrdiff_t fits in int.
1491 * gtkutil.h: Change prototypes to match the above.
1492
1493 * image.c (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): Remove; these
1494 are duplicate now that they've been promoted to lisp.h.
1495 (x_allocate_bitmap_record, x_alloc_image_color)
1496 (make_image_cache, cache_image, xpm_load):
1497 Don't update size until alloc is done.
1498 (xpm_load, lookup_rgb_color, lookup_pixel_color, x_to_xcolors)
1499 (x_detect_edges):
3256efce 1500 Check for size calculation overflow.
726e0ab1
PE
1501 (ct_colors_allocated_max): New constant.
1502 (x_to_xcolors, x_detect_edges): Reorder multiplicands to avoid
1503 overflow.
3256efce 1504
726e0ab1
PE
1505 * keyboard.c (read_char, menu_bar_items, tool_bar_items)
1506 (read_char_x_menu_prompt, read_char_minibuf_menu_width)
1507 (read_char_minibuf_menu_prompt, follow_key, read_key_sequence):
1508 Use ptrdiff_t, not int, to count maps.
1509 (read_char_minibuf_menu_prompt): Check for overflow in size
1510 calculations. Don't update size until allocation succeeds. Redo
1511 calculations to avoid overflow.
1512 * keyboard.h: Change prototypes to match the above.
1513
1514 * keymap.c (cmm_size, current_minor_maps): Use ptrdiff_t, not int,
1515 to count maps.
1516 (current_minor_maps): Check for size calculation overflow.
1517 * keymap.h: Change prototypes to match the above.
1518
1519 * lread.c (read1, init_obarray): Don't update size until alloc done.
1520
1521 * macros.c (Fstart_kbd_macro): Don't update size until alloc done.
1522 (store_kbd_macro_char): Reorder multiplicands to avoid overflow.
1523
726e0ab1
PE
1524 * nsterm.h (struct ns_color_table.size, struct ns_color_table.avail):
1525 Now ptrdiff_t, not int.
1526 * nsterm.m (ns_index_color): Use ptrdiff_t, not int, for table indexes.
1527 (ns_draw_fringe_bitmap): Rewrite to avoid overflow.
1528
1529 * process.c (Fnetwork_interface_list): Check for overflow
1530 in size calculation.
1531
1532 * region-cache.c (move_cache_gap): Check for size calculation overflow.
1533
1534 * scroll.c (do_line_insertion_deletion_costs): Check for size calc
1535 overflow. Don't bother calling xmalloc when xrealloc will do.
1536
1537 * search.c (Freplace_match): Check for size calculation overflow.
1538 (Fset_match_data): Don't assume list lengths fit in 'int'.
1539
1540 * sysdep.c (system_process_attributes): Use ptrdiff_t, not int,
1541 for command line length. Do not attempt to address one before the
1542 beginning of an array, as that's not portable.
1543
1544 * term.c (max_frame_lines): Remove; unused.
1545 (encode_terminal_src_size, encode_terminal_dst_size): Now ptrdiff_t,
1546 not int.
1547 (encode_terminal_code, calculate_costs): Check for size
1548 calculation overflow.
1549 (encode_terminal_code): Use ptrdiff_t, not int, to record glyph
1550 table lengths and related sizes. Don't update size until alloc
1551 done. Redo calculations to avoid overflow.
1552 (calculate_costs): Don't bother calling xmalloc when xrealloc will do.
1553
1554 * termcap.c (tgetent): Use ptrdiff_t, not int, to record results of
1555 subtracting pointers.
1556 (gobble_line): Check for overflow more carefully. Don't update size
1557 until alloc done.
1558
1559 * tparam.c (tparam1): Use ptrdiff_t, not int, for sizes.
1560 Don't update size until alloc done.
1561 Redo size calculations to avoid overflow.
1562 Check for size calculation overflow.
0065d054 1563 (main) [DEBUG]: Fix typo in invoking tparam1.
726e0ab1
PE
1564
1565 * xdisp.c (store_mode_line_noprop_char, x_consider_frame_title):
1566 Use ptrdiff_t, not int, for sizes.
1567 (store_mode_line_noprop_char): Don't update size until alloc done.
1568
0065d054
PE
1569 * xfaces.c (lface_id_to_name_size, Finternal_make_lisp_face):
1570 Use ptrdiff_t, not int, for sizes.
1571 (Finternal_make_lisp_face, cache_face):
1572 Check for size calculation overflow.
1573 (cache_face): Treat size calculation overflows as if they were
1574 memory exhaustion (the usual treatment), rather than aborting.
726e0ab1
PE
1575
1576 * xfns.c (x_encode_text, x_set_name_internal)
1577 (Fx_change_window_property): Use ptrdiff_t, not int, to count
1578 sizes, since they can exceed INT_MAX in size. Check for size
1579 calculation overflow.
1580
0065d054
PE
1581 * xgselect.c (gfds_size): Now ptrdiff_t, for convenience with xpalloc.
1582 (xg_select): Check for size calculation overflow.
726e0ab1
PE
1583 Don't update size until alloc done.
1584
0065d054 1585 * xrdb.c (get_environ_db): Don't assume path length fits in int,
726e0ab1 1586 as sprintf is limited to int lengths.
1d526e2f 1587
252c5ee1
PE
1588 * xselect.c (X_LONG_SIZE, X_SHRT_MAX, X_SHRT_MIN, X_LONG_MAX)
1589 (X_LONG_MIN): New macros.
864d7ce7
PE
1590 Use them to make the following changes clearer.
1591 (MAX_SELECTION_QUANTUM): Make the other bounds on this value clearer.
1592 This change doesn't affect the value now, but it may help remind
1593 future maintainers not to raise the value too much later.
1594 (SELECTION_QUANTUM): Remove, replacing with ...
1595 (selection_quantum): ... new function, which avoids overflow.
1596 All uses changed.
1597 (struct selection_data.size): Now ptrdiff_t, not int, to avoid
1598 assumption that selection length fits in 'int'.
1599 (x_reply_selection_request, x_handle_selection_request)
1600 (x_get_window_property, receive_incremental_selection)
1601 (x_get_window_property_as_lisp_data, selection_data_to_lisp_data)
1602 (lisp_data_to_selection_data, clean_local_selection_data):
1603 Use ptrdiff_t, not int, to record length of selection.
1604 (x_reply_selection_request, x_get_window_property)
1605 (receive_incremental_selection, x_property_data_to_lisp):
1606 Redo calculations to avoid overflow.
1607 (x_reply_selection_request): When sending hint, ceiling it at
252c5ee1 1608 X_LONG_MAX rather than relying on wraparound overflow to send
864d7ce7
PE
1609 something.
1610 (x_get_window_property, receive_incremental_selection)
1611 (lisp_data_to_selection_data, x_property_data_to_lisp):
1612 Check for size-calculation overflow.
1613 (x_get_window_property, receive_incremental_selection)
1614 (lisp_data_to_selection_data, Fx_register_dnd_atom):
1615 Don't store size until memory allocation succeeds.
1616 (x_get_window_property): Plug memory leak on memory exhaustion.
1617 Don't double-block input; malloc is safe here. Don't assume 2**34
1618 - 4 fits in unsigned long. Add an xassert to check
1619 XGetWindowProperty overflow. Be more careful about overflow
1620 calculations, and distinguish size from memory overflow better.
1621 (receive_incremental_selection): When tracing, don't assume
1622 unsigned int is less than INT_MAX.
1623 (x_selection_data_to_lisp_data): Remove unnecessary (and in theory
1624 harmful) conversions of unsigned short to int.
1625 (lisp_data_to_selection_data): Don't assume that integers
1626 in the range -65535 through -1 fit in an X unsigned short.
1627 Don't assume that ULONG_MAX == X_ULONG_MAX. Don't store into
1628 result parameters unless successful. Rely on cons_to_unsigned
1629 to report problems with elements; the old code wasn't right anyway.
1630 (x_check_property_data): Check for int overflow; we cannot use
1631 a wider type due to X limits.
1632 (x_handle_dnd_message): Use unsigned int, to avoid int overflow.
1633
726e0ab1 1634 * xsmfns.c (smc_save_yourself_CB): Check for size calc overflow.
34db673b 1635
0065d054
PE
1636 * xterm.c (x_color_cells, x_send_scrollbar_event, handle_one_xevent)
1637 (x_term_init): Check for size calculation overflow.
726e0ab1
PE
1638 (x_color_cells): Don't store size until memory allocation succeeds.
1639 (handle_one_xevent): Use ptrdiff_t, not int, for byte counts.
0065d054 1640 Don't assume alloca size is less than MAX_ALLOCA.
726e0ab1
PE
1641 (x_term_init): Don't assume length fits in int (sprintf is limited
1642 to int size).
bc18e09d 1643
ebfa62c0
PE
1644 Use ptrdiff_t for composition IDs.
1645 * character.c (lisp_string_width):
1646 * composite.c (composition_table_size, n_compositions)
1647 (get_composition_id, composition_gstring_from_id):
1648 * dispextern.h (struct glyph_string.cmp_id, struct composition_it.id):
1649 * xdisp.c (BUILD_COMPOSITE_GLYPH_STRING):
1650 * window.c (Frecenter):
1651 Use ptrdiff_t, not int, for composition IDs.
1652 * composite.c (get_composition_id): Check for integer overflow.
1653 * composite.h: Adjust prototypes to match the above changes.
1654
d3411f89
PE
1655 Use ptrdiff_t for hash table indexes.
1656 * category.c (hash_get_category_set):
1657 * ccl.c (ccl_driver):
1658 * charset.h (struct charset.hash_index, CHECK_CHARSET_GET_ID):
1659 * coding.c (coding_system_charset_list, detect_coding_system):
1660 * coding.h (struct coding_system.id):
1661 * composite.c (get_composition_id, gstring_lookup_cache):
1662 * fns.c (hash_lookup, hash_put, Fgethash, Fputhash):
1663 * image.c (xpm_get_color_table_h):
1664 * lisp.h (hash_lookup, hash_put):
1665 * minibuf.c (Ftest_completion):
1666 Use ptrdiff_t for hash table indexes, not int (which is too
1667 narrow, on 64-bit hosts) or EMACS_INT (which is too wide, on
1668 32-bit --with-wide-int hosts).
1669
e097a6fa
PE
1670 * charset.c (Fdefine_charset_internal): Check for integer overflow.
1671 Add a FIXME comment about memory leaks.
1672 (syms_of_charset): Don't assume xmalloc returns.
1673
5637687f
PE
1674 Don't assume that stated character widths fit in int.
1675 * character.c (Fchar_width, c_string_width, lisp_string_width):
1676 * character.h (CHAR_WIDTH):
1677 * indent.c (MULTIBYTE_BYTES_WIDTH):
1678 Use sanitize_char_width to avoid undefined and/or bad behavior
1679 with outlandish widths.
1680 * character.h (sanitize_tab_width): Renamed from sanitize_width,
1681 now that we have two such functions. All uses changed.
1682 (sanitize_char_width): New inline function.
1683
a2271ba2
PE
1684 Don't assume that tab-width fits in int.
1685 * character.h (sanitize_width): New inline function.
1686 (SANE_TAB_WIDTH): New macro.
1687 (ASCII_CHAR_WIDTH): Use it.
1688 * indent.c (sane_tab_width): Remove. All uses replaced by
1689 SANE_TAB_WIDTH (current_buffer).
1690 * xdisp.c (init_iterator): Use SANE_TAB_WIDTH.
1691
18c52557
PE
1692 * fileio.c: Integer overflow issues with file modes.
1693 (Fset_file_modes, auto_save_1): Don't assume EMACS_INT fits in int.
1694
caeeedc1
PE
1695 * charset.c (read_hex): New arg OVERFLOW. All uses changed.
1696 Remove unreachable code.
1697 (read_hex, load_charset_map_from_file): Check for integer overflow.
1698
50849c52
PE
1699 * xterm.c: don't go over XClientMessageEvent limit
1700 (scroll_bar_windows_size): Now ptrdiff_t, as we prefer signed.
1701 (x_send_scroll_bar_event): Likewise. Check that the size does not
1702 exceed limits imposed by XClientMessageEvent, as well as the usual
1703 ptrdiff_t and size_t limits.
1704
b13995db
PE
1705 * keyboard.c: Overflow, signedness and related fixes.
1706 (make_lispy_movement): Use same integer type in forward decl
1707 that is used in the definition.
1708 (read_key_sequence, keyremap_step):
1709 Change bufsize argument back to int, undoing my 2011-03-30 change.
1710 We prefer signed types, and int is wide enough here.
1711 (parse_tool_bar_item): Don't assume tool_bar_max_label_size is less
1712 than TYPE_MAXIMUM (EMACS_INT) / 2. Don't let the label size grow
1713 larger than STRING_BYTES_BOUND. Use ptrdiff_t for Emacs string
1714 length, not size_t. Use ptrdiff_t for index, not int.
1715 (keyremap_step, read_key_sequence): Redo bufsize check to avoid
1716 possibility of integer overflow.
1717
13464394
PE
1718 Overflow, signedness and related fixes for images.
1719
1720 * dispextern.h (struct it.stack[0].u.image.image_id)
1721 (struct_it.image_id, struct image.id, struct image_cache.size)
1722 (struct image_cache.used, struct image_cache.ref_count):
1723 * gtkutil.c (update_frame_tool_bar):
1724 * image.c (x_reference_bitmap, Fimage_size, Fimage_mask_p)
1725 (Fimage_metadata, free_image_cache, clear_image_cache, lookup_image)
1726 (cache_image, mark_image_cache, x_kill_gs_process, Flookup_image):
1727 * nsmenu.m (update_frame_tool_bar):
1728 * xdisp.c (calc_pixel_width_or_height):
1729 * xfns.c (image_cache_refcount):
1730 Image IDs are now ptrdiff_t, not int, to avoid arbitrary limits
1731 on typical 64-bit hosts.
1732
1733 * image.c (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): New macros.
1734 (x_bitmap_pixmap, x_create_x_image_and_pixmap):
1735 Omit unnecessary casts to int.
1736 (parse_image_spec): Check that integers fall into 'int' range
1737 when the callers expect that.
1738 (image_ascent): Redo ascent calculation to avoid int overflow.
1739 (clear_image_cache): Avoid overflow when sqrt (INT_MAX) < nimages.
1740 (lookup_image): Remove unnecessary tests.
1741 (xbm_image_p): Locals are now of int, not EMACS_INT,
1742 since parse_image_check makes sure they fit into int.
1743 (png_load, gif_load, svg_load_image):
1744 Prefer int to unsigned where either will do.
1745 (tiff_handler): New function, combining the cores of the
1746 old tiff_error_handler and tiff_warning_handler. This
1747 function is rewritten to use vsnprintf and thereby avoid
1748 stack buffer overflows. It uses only the features of vsnprintf
1749 that are common to both POSIX and native Microsoft.
1750 (tiff_error_handler, tiff_warning_handler): Use it.
1751 (tiff_load, gif_load, imagemagick_load_image):
1752 Don't assume :index value fits in 'int'.
1753 (gif_load): Omit unnecessary cast to double, and avoid double-rounding.
1754 (imagemagick_load_image): Check that crop parameters fit into
1755 the integer types that MagickCropImage accepts. Don't assume
1756 Vimagemagick_render_type has a nonnegative value. Don't assume
1757 size_t fits in 'long'.
1758 (gs_load): Use printmax_t to print the widest integers possible.
1759 Check for integer overflow when computing image height and width.
1760
c11821d4
EZ
17612011-08-26 Eli Zaretskii <eliz@gnu.org>
1762
1763 * xdisp.c (redisplay_window): Don't force window start if point
1764 will be invisible in the resulting window. (Bug#9324)
1765
0c95fcf7
EZ
17662011-08-25 Eli Zaretskii <eliz@gnu.org>
1767
1768 * xdisp.c (compute_display_string_pos): Return 2 in DISP_PROP when
1769 the display spec is of the form `(space ...)'.
1770 (handle_display_spec): Return the value returned by
1771 handle_single_display_spec, not just 1 or zero.
1772 (handle_single_display_spec): If the display spec is of the form
1773 `(space ...)', and specifies display in the text area, return 2
1774 rather than 1.
fee65a97 1775 (try_cursor_movement): Check for the need to scroll more
e25be792
EZ
1776 accurately, and prefer exact match for point under bidi. Don't
1777 advance `row' beyond the last row of the window.
0c95fcf7
EZ
1778
1779 * dispextern.h (struct bidi_it): Rename the disp_prop_p member
1780 into disp_prop; all users changed.
1781
1782 * bidi.c (bidi_fetch_char): If compute_display_string_pos returns
1783 DISP_PROP = 2, substitute the u+2029 PARAGRAPH SEPARATOR character
1784 for the text covered by the display property.
1785
e4ed06f1
CY
17862011-08-25 Chong Yidong <cyd@stupidchicken.com>
1787
1788 * buffer.c (Fbury_buffer_internal): Rename from Funrecord_buffer.
1789 Change return value to nil.
1790 (Frecord_buffer): Delete unused function.
1791
f67cdd7f
EZ
17922011-08-24 Eli Zaretskii <eliz@gnu.org>
1793
5980d4c6
EZ
1794 * xdisp.c (Fcurrent_bidi_paragraph_direction): For unibyte
1795 buffers, return left-to-right.
8610fe8b
EZ
1796 (set_cursor_from_row): Consider candidate row a win if its glyph
1797 represents a newline and point is on that newline. Fixes cursor
1798 positioning on the newline at EOL of R2L text within L2R
1799 paragraph, and vice versa.
1800 (try_cursor_movement): Check continued rows, in addition to
1801 continuation rows. Fixes unwarranted scroll when point enters a
1802 continued line of R2L text within an L2R paragraph, or vice versa.
1803 (cursor_row_p): Consider the case of point being equal to
1804 MATRIX_ROW_END_CHARPOS. Prevents cursor being stuck when moving
1805 from the end of a short line to the beginning of a continued line
1806 of R2L text within L2R paragraph.
1807 (RECORD_MAX_MIN_POS): For max_pos, use IT_CHARPOS even for
1808 composed characters.
5980d4c6 1809
f67cdd7f
EZ
1810 * bidi.c (bidi_check_type): Use xassert.
1811 (bidi_cache_iterator_state): Update the disp_pos and disp_prop_p
1812 members.
1813
bca633fb
EZ
18142011-08-23 Eli Zaretskii <eliz@gnu.org>
1815
1816 * bidi.c (bidi_get_type): Abort if we get zero as the bidi type of
1817 a character.
1818
4a5885a7
CY
18192011-08-23 Chong Yidong <cyd@stupidchicken.com>
1820
1821 * nsfont.m (ns_otf_to_script): Fix typo.
1822
0902a04e
KH
18232011-08-22 Kenichi Handa <handa@m17n.org>
1824
1825 * chartab.c (Fset_char_table_extra_slot): Do not inhibit setting a
1826 extra slot even if the purpose is char-code-property-table.
1827
1a2e6670
EZ
18282011-08-23 Eli Zaretskii <eliz@gnu.org>
1829
8ddde651
EZ
1830 * xdisp.c (redisplay_window): When computing centering_position,
1831 account for the height of the header line. (Bug#8874)
1832
425cc014
EZ
1833 * dispnew.c (buffer_posn_from_coords): Use buf_charpos_to_bytepos
1834 instead of CHAR_TO_BYTE. Fixes a crash when a completion
1835 candidate is selected by the mouse, and that candidate has a
1836 composed character under the mouse.
1837
1a2e6670
EZ
1838 * xdisp.c (x_produce_glyphs): Set it->nglyphs to 1. Fixes pixel
1839 coordinates reported by pos-visible-in-window-p for a composed
1840 character in column zero.
1841
8b76d6f8
SM
18422011-08-23 Stefan Monnier <monnier@iro.umontreal.ca>
1843
1844 * cmds.c (Fself_insert_command): Mention post-self-insert-hook.
1845
dac347dd
EZ
18462011-08-22 Eli Zaretskii <eliz@gnu.org>
1847
1848 * xdisp.c (BUFFER_POS_REACHED_P): If this is a composition,
1849 consider it a hit if to_charpos is anywhere in the range of the
1850 composed buffer positions.
1851
e013fb34
CY
18522011-08-22 Chong Yidong <cyd@stupidchicken.com>
1853
1854 * image.c (gif_load): Don't assume that each subimage has the same
1855 dimensions as the base image. Handle disposal method that is
1856 "undefined" by the gif spec (Bug#9335).
1857
bd1ba3e8
CY
18582011-08-20 Chong Yidong <cyd@stupidchicken.com>
1859
1860 * eval.c (Fsignal): Handle `debug' symbol in error handler (Bug#9329).
024a2d76 1861 (Fcondition_case): Document `debug' symbol in error handler.
bd1ba3e8 1862
54a1215b
EZ
18632011-08-19 Eli Zaretskii <eliz@gnu.org>
1864
823564e5
EZ
1865 * xfaces.c (face_at_buffer_position): Avoid repeated evaluation of
1866 face ID by FACE_FROM_ID, and avoid a crash when mouse is moved
1867 from an Org mode buffer to a Speedbar frame.
1868
54a1215b
EZ
1869 * xdisp.c (RECORD_MAX_MIN_POS): If the display element comes from
1870 a composition, take its buffer position from IT->cmp_it.charpos.
1871 Fixes cursor positioning at the beginning of a line that begins
1872 with a composed character.
1873
9778ebcc
EZ
18742011-08-18 Eli Zaretskii <eliz@gnu.org>
1875
0be6ee06
EZ
1876 * bidi.c (bidi_get_type): If bidi_type_table reports zero as the
1877 character bidirectional type, use STRONG_L instead. Fixes crashes
1878 in a buffer produced by `describe-categories'.
1879
9778ebcc
EZ
1880 * dispextern.h (struct bidi_it): Move disp_pos and disp_prop_p
1881 members before the level stack, so they would be saved and
1882 restored when copying iterator state. Fixes incorrect reordering
1883 around TABs covered by display properties.
1884
156bffbe
AS
18852011-08-18 Andreas Schwab <schwab@linux-m68k.org>
1886
1887 * process.c (Fnetwork_interface_list): Correctly determine buffer
1888 size.
1889
72ad093b
CY
18902011-08-17 Chong Yidong <cyd@stupidchicken.com>
1891
1892 * eval.c (internal_condition_case, internal_condition_case_1)
8b76d6f8
SM
1893 (internal_condition_case_2, internal_condition_case_n):
1894 Remove unnecessary aborts (Bug#9081).
72ad093b 1895
35774242
EZ
18962011-08-17 Eli Zaretskii <eliz@gnu.org>
1897
1898 * lread.c (Fload) [DOS_NT]: If `openp' returns -2, but the file
1899 has no `load' handler, try opening the file locally. (Bug#9311)
1900
db76dd85
KB
19012011-08-16 Ken Brown <kbrown@cornell.edu>
1902
1903 * gmalloc.c: Expand comment.
1904
b215eee5
EZ
19052011-08-16 Eli Zaretskii <eliz@gnu.org>
1906
1907 * xdisp.c (set_cursor_from_row): Don't accept a previous candidate
1908 if it fails the cursor_row_p test. Fixes cursor positioning at ZV.
1909
a4579d33
KB
19102011-08-16 Ken Brown <kbrown@cornell.edu>
1911
1912 Fix memory allocation problems in Cygwin build (Bug#9273).
1913
1914 * unexcw.c ( __malloc_initialized): Declare external variable.
1915 (fixup_executable): Force the dumped emacs to reinitialize malloc.
1916
8b76d6f8
SM
1917 * gmalloc.c [CYGWIN] (bss_sbrk_heapbase, bss_sbrk_heapinfo):
1918 New variables.
a4579d33
KB
1919 (malloc_initialize_1) [CYGWIN]: Prepare for reinitializing the
1920 dumped emacs.
1921 (_free_internal_nolock) [CYGWIN]: Ignore requests to free storage
1922 in the static heap.
1923 [CYGWIN] (special_realloc): New function.
1924 (_realloc_internal_nolock) [CYGWIN]: Use the new function on
1925 requests to realloc storage in the static heap.
1926
3ebec551
PE
19272011-08-15 Paul Eggert <eggert@cs.ucla.edu>
1928
1929 * bidi.c (bidi_initialize): Remove unused local.
1930
9fd8be00
EZ
19312011-08-15 Eli Zaretskii <eliz@gnu.org>
1932
474a8465
EZ
1933 * biditype.h: File removed.
1934
1935 * bidimirror.h: File removed.
1936
1937 * deps.mk (bidi.o): Remove biditype.h and
1938 bidimirror.h.
1939
1940 * makefile.w32-in ($(BLD)/bidi.$(O)): Remove biditype.h and
1941 bidimirror.h.
1942
1943 * dispextern.h: Fix a typo in the comment to bidi_type_t.
1944
1945 * chartab.c: Improve commentary for the uniprop_table API.
1946
32413314
EZ
1947 * bidi.c (bidi_paragraph_init): Support zero value of
1948 bidi_ignore_explicit_marks_for_paragraph_level.
474a8465
EZ
1949 (bidi_initialize): Use uniprop_table instead of including
1950 biditype.h and bidimirror.h.
32413314 1951
9fd8be00
EZ
1952 * xdisp.c (move_it_in_display_line_to): Don't reset pixel
1953 coordinates of the iterator when restoring from ppos_it.
1954 (Bug#9296)
1955
5cf2b69b
KH
19562011-08-14 Kenichi Handa <handa@m17n.org>
1957
1958 * process.c (create_process): Call setup_process_coding_systems
72ad093b 1959 after the pid of the process is set to -1 (Bug#8162).
5cf2b69b 1960
daf17d00
EZ
19612011-08-14 Eli Zaretskii <eliz@gnu.org>
1962
1963 * xdisp.c (move_it_in_display_line_to): Don't invoke
1964 IT_RESET_X_ASCENT_DESCENT when iterator position was restored from
1965 ppos_it. Fixes vertical cursor motion when line beginning is
1966 covered by an image. (Bug#9296)
1967
08e3161a
JD
19682011-08-14 Jan Djärv <jan.h.d@swipnet.se>
1969
1970 * nsterm.h (ns_run_ascript): Declare.
1971 (NSAPP_DATA2_RUNASSCRIPT): Define.
1972
1973 * nsfns.m (as_script, as_result, as_status): New static variables.
1974 (ns_run_ascript): New function.
5e617bc2 1975 (Fns_do_applescript): Set variables as_*. Make an NSApplicationDefined
08e3161a
JD
1976 event with data2 set to NSAPP_DATA2_RUNASSCRIPT, post it and then start
1977 the event loop. Get status from as_status (Bug#7276).
1978
1979 * nsterm.m (sendEvent): If event is NSApplicationDefined and
1980 data2 is NSAPP_DATA2_RUNASSCRIPT, call ns_run_ascript and then exit
1981 the event loop (Bug#7276).
1982
a3720aa2
AS
19832011-08-14 Andreas Schwab <schwab@linux-m68k.org>
1984
1985 * gnutls.c (QCgnutls_bootprop_priority)
1986 (QCgnutls_bootprop_trustfiles, QCgnutls_bootprop_keylist)
1987 (QCgnutls_bootprop_crlfiles, QCgnutls_bootprop_callbacks)
1988 (QCgnutls_bootprop_loglevel, QCgnutls_bootprop_hostname)
1989 (QCgnutls_bootprop_min_prime_bits, QCgnutls_bootprop_verify_flags)
1990 (QCgnutls_bootprop_verify_hostname_error)
1991 (QCgnutls_bootprop_callbacks_verify): Rename from
1992 Qgnutls_bootprop_..., all uses changed.
1993
1994 * xfaces.c (QCignore_defface): Rename from Qignore_defface, all
1995 uses changed.
1996
0a0d27fb
PE
19972011-08-14 Paul Eggert <eggert@cs.ucla.edu>
1998
19d5c50c
PE
1999 * xfaces.c (Qframe_set_background_mode): Now static.
2000 * dispextern.h (Qframe_set_background_mode): Remove decl.
2001
0a0d27fb
PE
2002 * process.c (Fnetwork_interface_info): Declare local only if needed.
2003
377538cb
JD
20042011-08-13 Jan Djärv <jan.h.d@swipnet.se>
2005
2006 * process.c: Include ifaddrs.h and net/if_dl.h if available (Bug#8477).
2007 (Fnetwork_interface_list): Allocate in increments of bytes instead
2008 of sizeof (struct ifreq). Iterate over ifconf.ifc_req by counting
2009 bytes (Bug#8477). Count bytes correctly when ifr_addr is a struct
2010 sockaddr.
2011 (struct ifflag_def): notrailers is smart on OSX.
2012 (Fnetwork_interface_info): Handle case when ifr_flags is negative.
2013 Get hardware address with getifaddrs if available.
2014
08fff70c
EZ
20152011-08-12 Eli Zaretskii <eliz@gnu.org>
2016
2017 * xdisp.c (iterate_out_of_display_property): xassert that
2018 IT->position is set to within IT->object's boundaries. Break from
2019 the loop as soon as EOB is reached; avoids infloops in redisplay
8b76d6f8
SM
2020 when IT->position is set up wrongly due to some bug.
2021 Set IT->current to match the bidi iterator unconditionally.
08fff70c
EZ
2022 (push_display_prop): Allow GET_FROM_STRING as IT->method on
2023 entry. Force push_it to save on the stack the current
2024 buffer/string position, to be restored by pop_it. Fix flags in
2025 the iterator structure wrt the object coming from a display
2026 property, as `line-prefix' and `wrap-prefix' are not ``replacing''
2027 properties. (Bug#9284)
2028
7be1c708 20292011-08-09 Andreas Schwab <schwab@linux-m68k.org>
aac0c6e3 2030
7be1c708
CY
2031 * fontset.c (fontset_get_font_group): Add proper type checks.
2032 (Bug#9172)
aac0c6e3 2033
7be1c708 20342011-08-09 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
aac0c6e3 2035
7be1c708
CY
2036 * unexmacosx.c (print_load_command_name): Add cases LC_FUNCTION_STARTS
2037 and LC_VERSION_MIN_MACOSX.
2038 (copy_linkedit_data) [LC_FUNCTION_STARTS]: New function.
2039 (dump_it) [LC_FUNCTION_STARTS]: Use it.
aac0c6e3 2040
97bb72a6
EZ
20412011-08-08 Eli Zaretskii <eliz@gnu.org>
2042
2043 * xdisp.c (forward_to_next_line_start): Allow to use the
8b76d6f8
SM
2044 no-display-properties-and-no-overlays under bidi display.
2045 Set disp_pos in the bidi iterator to avoid searches for display
757664a4 2046 properties and overlays.
97bb72a6 2047
d5617611
CY
20482011-08-08 Chong Yidong <cyd@stupidchicken.com>
2049
37e11a63
CY
2050 * editfns.c (Fset_time_zone_rule): Document relationship with the
2051 setenv function.
2052
d5617611
CY
2053 * ftfont.c (ftfont_pattern_entity): Copy the extras argument to
2054 the font entity extracted from the cache (Bug#8109).
2055
58872834
CY
20562011-08-07 Chong Yidong <cyd@stupidchicken.com>
2057
2058 * composite.c (autocmp_chars): Don't reset point. That is done by
2059 restore_point_unwind (Bug#5984).
2060
75bfc667
JL
20612011-08-07 Juri Linkov <juri@jurta.org>
2062
2063 * editfns.c (Fformat_time_string): Doc fix, add tag `usage:'
2064 to show the arg `TIME' instead of `TIMEVAL'.
2065
d1410150
EZ
20662011-08-06 Eli Zaretskii <eliz@gnu.org>
2067
2068 * xdisp.c (set_cursor_from_row): Fix cursor positioning when a
2069 display property strides EOL and includes a newline, as in
2070 longlines-mode. (Bug#9254)
75b771e4
EZ
2071 (move_it_in_display_line_to): Fix vertical-motion in a buffer with
2072 word-wrap under bidirectional display. (Bug#9224)
d1410150
EZ
2073
2074 * bidi.c (bidi_unshelve_cache): Don't reset the cache if JUST_FREE
2075 is non-zero, even if the data buffer is NULL. Fixes a crash in
2076 vertical-motion with longlines-mode. (Bug#9254)
2077
35928349
EZ
20782011-08-05 Eli Zaretskii <eliz@gnu.org>
2079
ec7cc85b
EZ
2080 * bidi.c <bidi_cache_total_alloc>: Now static.
2081 (bidi_initialize): Initialize bidi_cache_total_alloc.
2082
8b76d6f8 2083 * xdisp.c (display_line): Release buffer allocated for shelved bidi
35928349
EZ
2084 cache. (Bug#9221)
2085
2086 * bidi.c (bidi_shelve_cache, bidi_unshelve_cache): Track total
2087 amount allocated this far in `bidi_cache_total_alloc'.
2088 (bidi_unshelve_cache): Accept an additional argument JUST_FREE; if
2089 non-zero, only free the data buffer without restoring the cache
2090 contents. All callers changed.
2091
2092 * dispextern.h (bidi_unshelve_cache): Update prototype.
2093
2094 * xdisp.c (SAVE_IT, pos_visible_p, move_it_in_display_line_to)
2095 (move_it_in_display_line, move_it_to)
2096 (move_it_vertically_backward, move_it_by_lines): Replace the call
2097 to xfree to an equivalent call to bidi_unshelve_cache.
2098 (move_it_in_display_line_to): Fix logic of returning
412b6358 2099 MOVE_POS_MATCH_OR_ZV in the bidi case. (Bug#9224)
35928349 2100
e2e2423b
EZ
21012011-08-05 Eli Zaretskii <eliz@gnu.org>
2102
2103 * xdisp.c (set_cursor_from_row): Prefer the candidate glyph that
2104 came from a string character with a `cursor' property. (Bug#9229)
2105
ae9e757a
JD
21062011-08-04 Jan Djärv <jan.h.d@swipnet.se>
2107
2108 * Makefile.in (LIB_PTHREAD): New variable.
2109 (LIBES): Add LIB_PTHREAD (Bug#9216).
2110
2111 * alloc.c, emacs.c, gmalloc.c, gtkutil.c, keyboard.c, syssignal.h:
2112 Rename HAVE_GTK_AND_PTHREAD to HAVE_PTHREAD (Bug#9216).
2113
213bd7f2
AS
21142011-08-04 Andreas Schwab <schwab@linux-m68k.org>
2115
2116 * regex.c (re_iswctype): Remove some redundant boolean
2117 conversions.
2118
99aaf75f
JD
21192011-08-04 Jan Djärv <jan.h.d@swipnet.se>
2120
2121 * xterm.c (x_find_topmost_parent): New function.
2122 (x_set_frame_alpha): Find topmost parent window with
2123 x_find_topmost_parent and set the property there also (bug#9181).
2124 (handle_one_xevent): Call x_set_frame_alpha on ReparentNotify.
2125
c74e9d86
PE
21262011-08-04 Paul Eggert <eggert@cs.ucla.edu>
2127
2128 * callproc.c (Fcall_process): Avoid vfork clobbering
2129 the local vars buffer, coding_systems, current_dir.
2130
640c8776
SM
21312011-08-03 Stefan Monnier <monnier@iro.umontreal.ca>
2132
2133 * keymap.c (Fmake_composed_keymap): Move to subr.el.
2134
f26d0e4c
PE
21352011-08-03 Paul Eggert <eggert@cs.ucla.edu>
2136
8a10d76c
PE
2137 * fontset.c (dump_fontset) [FONTSET_DEBUG]: Declare EXTERNALLY_VISIBLE
2138 so that it is not optimized away.
2139
f26d0e4c
PE
2140 * xdisp.c (compute_display_string_pos): Remove unused local.
2141
55439c61
EZ
21422011-08-02 Eli Zaretskii <eliz@gnu.org>
2143
2144 Fix slow cursor motion and scrolling in large buffers with
2145 selective display, like Org Mode buffers. (Bug#9218)
2146
2147 * dispextern.h (struct bidi_it): New member disp_prop_p.
2148
2149 * xdisp.c: Remove one-slot cache of display string positions.
2150 (compute_display_string_pos): Accept an additional argument
5e617bc2 2151 DISP_PROP_P; callers changed. Scan at most 5K characters forward
55439c61
EZ
2152 for a display string or property. If found, set DISP_PROP_P
2153 non-zero.
2154
2155 * bidi.c (bidi_fetch_char): Accept an additional argument
640c8776
SM
2156 DISP_PROP_P, and pass it to compute_display_string_pos.
2157 Only handle text covered by a display string if DISP_PROP_P is returned
55439c61
EZ
2158 non-zero. All callers of bidi_fetch_char changed.
2159
fb33fa43
SM
21602011-08-02 Stefan Monnier <monnier@iro.umontreal.ca>
2161
2162 * keymap.c (Fdefine_key): Fix Lisp_Object/int mixup; apply some CSE.
2163
b099e063
DM
21642010-12-03 Don March <don@ohspite.net>
2165
2166 * keymap.c (Fdefine_key): Fix non-prefix key error message when
2167 last character M-[char] is translated to ESC [char] (bug#7541).
2168
5cc7f7af
KH
21692011-08-02 Kenichi Handa <handa@m17n.org>
2170
d0fffa3f 2171 * lisp.h (uniprop_table): Extern it.
5cc7f7af
KH
2172
2173 * chartab.c (uniprop_table): Make it non-static.
2174
525d5e6e
EZ
21752011-08-01 Eli Zaretskii <eliz@gnu.org>
2176
2177 * xdisp.c (forward_to_next_line_start): Accept additional argument
2178 BIDI_IT_PREV, and store into it the state of the bidi iterator had
2179 on the newline.
2180 (reseat_at_next_visible_line_start): Use the bidi iterator state
2181 returned by forward_to_next_line_start to restore the state of
2182 it->bidi_it after backing up to previous newline. (Bug#9212)
2183
31011111
AS
21842011-07-30 Andreas Schwab <schwab@linux-m68k.org>
2185
2186 * regex.c (re_comp): Protoize.
2187 (re_exec): Fix return type.
2188 (regexec): Fix type of `ret'. (Bug#9203)
2189
476371c4
PE
21902011-07-28 Paul Eggert <eggert@cs.ucla.edu>
2191
e5d76069
PE
2192 * image.c (check_image_size): Use 1024x1024 if unknown frame (Bug#9189).
2193 This is needed if max-image-size is a floating-point number.
2194
9a79b20c
AS
21952011-07-28 Andreas Schwab <schwab@linux-m68k.org>
2196
2197 * print.c (print_object): Print empty symbol as ##.
2198
2199 * lread.c (read1): Read ## as empty symbol.
2200
d8c2fa78
AA
22012011-07-28 Alp Aker <alp.tekin.aker@gmail.com>
2202
2203 * nsfns.m (x_set_foreground_color): Set f->foreground_pixel when
2204 setting frame foreground color (Bug#9175).
2205 (x_set_background_color): Likewise.
2206
ffe57a7a
AA
2207 * nsmenu.m (-setText): Size tooltip dimensions precisely to
2208 contents (Bug#9176).
2209 (EmacsTooltip -init): Remove bezels and add shadows to
2210 tooltip windows.
2211
bf3492a5
AA
2212 * nsterm.m (ns_dumpglyphs_stretch): Avoid overwriting left fringe
2213 or scroll bar (Bug#8470).
2214
d55e9c53
AA
2215 * nsfont.m (nsfont_open): Remove assignment to voffset and
2216 unnecessary vars hshink, expand, hd, full_height, min_height.
2217 (nsfont_draw): Use s->ybase as baseline for glyph drawing (Bug#8913).
2218
2219 * nsterm.h (nsfont_info): Remove voffset field.
2220
d8c2fa78 22212011-07-28 Alp Aker <alp.tekin.aker@gmail.com>
4843aac3
AA
2222
2223 Implement strike-through and overline on NextStep (Bug#8863).
2224
2225 * nsfont.m (nsfont_open): Use underline position provided by font,
2226 instead of hard-coded value of 2.
2227 (nsfont_draw): Call ns_draw_text_decoration instead.
2228
2229 * nsterm.h: Add declaration for ns_draw_text_decoration.
2230
2231 * nsterm.m (ns_draw_text_decoration): New function for drawing
2232 underline, overline, and strike-through.
2233 (ns_dumpglyphs_image, ns_dumpglyphs_stretch): Add call to
2234 ns_draw_text_decoration. Change treatment of cursor drawing to
8d5ed899 2235 accommodate underlining, etc.
4843aac3 2236
4cc60b9b
EZ
22372011-07-28 Eli Zaretskii <eliz@gnu.org>
2238
bc7ece87
EZ
2239 * buffer.c (init_buffer_once): Set bidi-display-reordering to t by
2240 default.
4cc60b9b 2241
476371c4
PE
22422011-07-28 Paul Eggert <eggert@cs.ucla.edu>
2243
66606eea
PE
2244 * alloc.c (memory_full) [!SYNC_INPUT]: Fix signal-related race.
2245 Without this fix, if a signal arrives just after memory fills up,
2246 'malloc' might be invoked reentrantly.
2247
476371c4
PE
2248 * image.c (x_check_image_size) [!HAVE_X_WINDOWS]: Return 1.
2249 In other words, assume that every image size is allowed, on non-X
2250 hosts. This assumption is probably wrong, but it lets Emacs compile.
2251
f3fcc40d
AS
22522011-07-28 Andreas Schwab <schwab@linux-m68k.org>
2253
2254 * regex.c (re_iswctype): Convert return values to boolean.
2255
350c992f
EZ
22562011-07-28 Eli Zaretskii <eliz@fencepost.gnu.org>
2257
2258 * xdisp.c (compute_display_string_pos): Don't use cached display
2259 string position if the buffer had its restriction changed.
2260 (Bug#9184)
2261
5266b4bb
PE
22622011-07-28 Paul Eggert <eggert@cs.ucla.edu>
2263
2264 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork clobbering.
2265
2573a837 22662011-07-28 Paul Eggert <eggert@cs.ucla.edu>
ca4aa935 2267
41f55ccd 2268 Integer signedness and overflow and related fixes. (Bug#9079)
cf950e6b 2269
39e378da
PE
2270 * bidi.c: Integer size and overflow fixes.
2271 (bidi_cache_size, bidi_cache_idx, bidi_cache_last_idx)
2272 (bidi_cache_start, bidi_cache_fetch_state, bidi_cache_search)
2273 (bidi_cache_find_level_change, bidi_cache_ensure_space)
2274 (bidi_cache_iterator_state, bidi_cache_find, bidi_cache_start_stack)
2275 (bidi_find_other_level_edge):
2276 Use ptrdiff_t instead of EMACS_INT where either will do.
2277 This works better on 32-bit hosts configured --with-wide-int.
2278 (bidi_cache_ensure_space): Check for size-calculation overflow.
2279 Use % rather than repeated addition, for better worst-case speed.
2280 Don't set bidi_cache_size until after xrealloc returns, because it
2281 might not return.
2282 (bidi_dump_cached_states): Use ptrdiff_t, not int, to avoid overflow.
f0eb61e9
PE
2283 (bidi_cache_ensure_space): Also check that the bidi cache size
2284 does not exceed that of the largest Lisp string or buffer. See Eli
2285 Zaretskii in <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9079#29>.
39e378da 2286
5e927815
PE
2287 * alloc.c (__malloc_size_t): Remove.
2288 All uses replaced by size_t. See Andreas Schwab's note
2289 <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9079#8>.
2290
ca4aa935
PE
2291 * image.c: Improve checking for integer overflow.
2292 (check_image_size): Assume that f is nonnull, since
2293 it is always nonnull in practice. This is one less thing to
2294 worry about when checking for integer overflow later.
2295 (x_check_image_size): New function, which checks for integer
2296 overflow issues inside X.
2297 (x_create_x_image_and_pixmap, xbm_read_bitmap_data): Use it.
2298 This removes the need for a memory_full check.
2299 (xbm_image_p): Rewrite to avoid integer multiplication overflow.
2300 (Create_Pixmap_From_Bitmap_Data, xbm_load): Use x_check_image_size.
2301 (xbm_read_bitmap_data): Change locals back to 'int', since
2302 their values must fit in 'int'.
2303 (xpm_load_image, png_load, tiff_load):
2304 Invoke x_create_x_image_and_pixmap earlier,
2305 to avoid much needless work if the image is too large.
2306 (tiff_load): Treat overly large images as if
2307 x_create_x_image_and_pixmap failed, not as malloc failures.
2308 (gs_load): Use x_check_image_size.
2309
5f8f9cc2
PE
2310 * gtkutil.c: Omit integer casts.
2311 (xg_get_pixbuf_from_pixmap): Remove unnecessary cast.
2312 (xg_set_toolkit_scroll_bar_thumb): Rewrite to avoid need for cast.
2313
5adf60bc
PE
2314 * image.c (png_load): Don't assume height * row_bytes fits in 'int'.
2315
c8907a93
PE
2316 * xfaces.c (Fbitmap_spec_p): Fix integer overflow bug.
2317 Without this fix, (bitmap-spec-p '(34359738368 1 "x"))
2318 would wrongly return t on a 64-bit host.
2319
e3c25c68
PE
2320 * dispnew.c (init_display): Use *_RANGE_OVERFLOW macros.
2321 The plain *_OVERFLOW macros run afoul of GCC bug 49705
2322 <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49705>
2323 and therefore cause GCC to emit a bogus diagnostic in some cases.
2324
3f791afe
PE
2325 * image.c: Integer signedness and overflow and related fixes.
2326 This is not an exhaustive set of fixes, but it's time to
2327 record what I've got.
2328 (lookup_pixel_color, check_image_size): Remove redundant decls.
2329 (check_image_size): Don't assume that arbitrary EMACS_INT values
2330 fit in 'int', or that arbitrary 'double' values fit in 'int'.
2331 (x_alloc_image_color, x_create_x_image_and_pixmap, png_load)
2332 (tiff_load, imagemagick_load_image):
2333 Check for overflow in size calculations.
2334 (x_create_x_image_and_pixmap): Remove unnecessary test for
2335 xmalloc returning NULL; that can't happen.
2336 (xbm_read_bitmap_data): Don't assume sizes fit into 'int'.
2337 (xpm_color_bucket): Use better integer hashing function.
2338 (xpm_cache_color): Don't possibly over-allocate memory.
2339 (struct png_memory_storage, tiff_memory_source, tiff_seek_in_memory)
2340 (gif_memory_source):
2341 Use ptrdiff_t, not int or size_t, to record sizes.
2342 (png_load): Don't assume values greater than 2**31 fit in 'int'.
2343 (our_stdio_fill_input_buffer): Prefer ptrdiff_t to size_t when
2344 either works, as we prefer signed integers.
2345 (tiff_read_from_memory, tiff_write_from_memory):
2346 Return tsize_t, not size_t, since that's what the TIFF API wants.
2347 (tiff_read_from_memory): Don't fail simply because the read would
2348 go past EOF; instead, return a short read.
2349 (tiff_load): Omit no-longer-needed casts.
2350 (Fimagemagick_types): Don't assume size fits into 'int'.
2351
3cc5a532
PE
2352 Improve hashing quality when configured --with-wide-int.
2353 * fns.c (hash_string): New function, taken from sxhash_string.
2354 Do not discard information about ASCII character case; this
2355 discarding is no longer needed.
2356 (sxhash-string): Use it. Change sig to match it. Caller changed.
2357 * lisp.h: Declare it.
2358 * lread.c (hash_string): Remove, since we now use fns.c's version.
2359 The fns.c version returns a wider integer if --with-wide-int is
2360 specified, so this should help the quality of the hashing a bit.
2361
b312a492
PE
2362 * emacs.c: Integer overflow minor fix.
2363 (heap_bss_diff): Now uprintmax_t, not unsigned long. All used changed.
2364 Define only if GNU_LINUX.
2365 (main, Fdump_emacs): Set and use heap_bss_diff only if GNU_LINUX.
2366
dfd153ae
PE
2367 * dispnew.c: Integer signedness and overflow fixes.
2368 Remove unnecessary forward decls, that were a maintenance hassle.
2369 (history_tick): Now uprintmax_t, so it's more likely to avoid overflow.
2370 All uses changed.
2371 (adjust_glyph_matrix, realloc_glyph_pool, adjust_frame_message_buffer)
2372 (scrolling_window): Use ptrdiff_t, not int, for byte count.
2373 (prepare_desired_row, line_draw_cost):
2374 Use int, not unsigned, where either works.
2375 (save_current_matrix, restore_current_matrix):
2376 Use ptrdiff_t, not size_t, where either works.
2377 (init_display): Check for overflow more accurately, and without
2378 relying on undefined behavior.
2379
a81d11a3
PE
2380 * editfns.c (pWIDE, pWIDElen, signed_wide, unsigned_wide):
2381 Remove, replacing with the new symbols in lisp.h. All uses changed.
2382 * fileio.c (make_temp_name):
2383 * filelock.c (lock_file_1, lock_file):
2384 * xdisp.c (message_dolog):
2385 Don't assume PRIdMAX etc. works; this isn't portable to pre-C99 hosts.
2386 Use pMd etc. instead.
2387 * lisp.h (printmax_t, uprintmax_t, pMd, pMu): New types and macros,
2388 replacing the pWIDE etc. symbols removed from editfns.c.
2389
3300e6fd
PE
2390 * keyboard.h (num_input_events): Now uintmax_t.
2391 This is (very slightly) less likely to mess up due to wraparound.
2392 All uses changed.
2393
fd05c7e9
PE
2394 * buffer.c: Integer signedness fixes.
2395 (alloc_buffer_text, enlarge_buffer_text):
2396 Use ptrdiff_t rather than size_t when either will do, as we prefer
2397 signed integers.
2398
903fe15d
PE
2399 * alloc.c: Integer signedness and overflow fixes.
2400 Do not impose an arbitrary 32-bit limit on malloc sizes when debugging.
2401 (__malloc_size_t): Default to size_t, not to int.
2402 (pure_size, pure_bytes_used_before_overflow, stack_copy_size)
2403 (Fgarbage_collect, mark_object_loop_halt, mark_object):
2404 Prefer ptrdiff_t to size_t when either would do, as we prefer
2405 signed integers.
2406 (XMALLOC_OVERRUN_CHECK_OVERHEAD): New macro.
2407 (xmalloc_overrun_check_header, xmalloc_overrun_check_trailer):
2408 Now const. Initialize with values that are in range even if char
2409 is signed.
2410 (XMALLOC_PUT_SIZE, XMALLOC_GET_SIZE): Remove, replacing with ...
2411 (xmalloc_put_size, xmalloc_get_size): New functions. All uses changed.
2412 These functions do the right thing with sizes > 2**32.
2413 (check_depth): Now ptrdiff_t, not int.
2414 (overrun_check_malloc, overrun_check_realloc, overrun_check_free):
2415 Adjust to new way of storing sizes. Check for size overflow bugs
2416 in rest of code.
2417 (STRING_BYTES_MAX): Adjust to new overheads. The old code was
2418 slightly wrong anyway, as it missed one instance of
2419 XMALLOC_OVERRUN_CHECK_OVERHEAD.
2420 (refill_memory_reserve): Omit needless cast to size_t.
2421 (mark_object_loop_halt): Mark as externally visible.
2422
ac82cc6a
PE
2423 * xselect.c: Integer signedness and overflow fixes.
2424 (Fx_register_dnd_atom, x_handle_dnd_message):
2425 Use ptrdiff_t, not size_t, since we prefer signed.
2426 (Fx_register_dnd_atom): Check for ptrdiff_t (and size_t) overflow.
2427 * xterm.h (struct x_display_info): Use ptrdiff_t, not size_t, for
2428 x_dnd_atoms_size and x_dnd_atoms_length.
2429
c2d1e36d
PE
2430 * doprnt.c: Prefer signed to unsigned when either works.
2431 * eval.c (verror):
2432 * doprnt.c (doprnt):
2433 * lisp.h (doprnt):
2434 * xdisp.c (vmessage):
2435 Use ptrdiff_t, not size_t, when using or implementing doprnt,
2436 since the sizes cannot exceed ptrdiff_t bounds anyway, and we
2437 prefer signed arithmetic to avoid comparison confusion.
2438 * doprnt.c (doprnt): Avoid a "+ 1" that can't overflow,
2439 but is a bit tricky.
2440
0e926e56
PE
2441 Assume freestanding C89 headers, string.h, stdlib.h.
2442 * data.c, doprnt.c, floatfns.c, print.c:
2443 Include float.h unconditionally.
2444 * gmalloc.c: Assume C89-at-least behavior for preprocessor,
2445 limits.h, stddef.h, string.h. Use memset instead of 'flood'.
2446 * regex.c: Likewise for stddef.h, string.h.
2447 (ISASCII): Remove; can assume it returns 1 now. All uses removed.
2448 * s/aix4-2.h (HAVE_STRING_H): Remove obsolete undef.
2449 * s/ms-w32.h (HAVE_LIMITS_H, HAVE_STRING_H, HAVE_STDLIB_H)
2450 (STDC_HEADERS): Remove obsolete defines.
2451 * sysdep.c: Include limits.h unconditionally.
2452
9cfdb3ec
PE
2453 Assume support for memcmp, memcpy, memmove, memset.
2454 * lisp.h, sysdep.c (memcmp, memcpy, memmove, memset):
2455 * regex.c (memcmp, memcpy):
2456 Remove; we assume C89 now.
2457
2458 * gmalloc.c (memcpy, memset, memmove): Remove; we assume C89 now.
2459 (__malloc_safe_bcopy): Remove; no longer needed.
2460
cf950e6b 2461 * lisp.h (struct vectorlike_header, struct Lisp_Subr): Signed sizes.
6089c567
PE
2462 Use EMACS_INT, not EMACS_UINT, for sizes. The code works equally
2463 well either way, and we prefer signed to unsigned.
2464
dbf38e02
LMI
24652011-07-27 Lars Magne Ingebrigtsen <larsi@gnus.org>
2466
2467 * gnutls.c (emacs_gnutls_read): Don't message anything if the peer
2468 closes the connection while we're reading (bug#9182).
2469
d6f0886c 24702011-07-25 Jan Djärv <jan.h.d@swipnet.se>
24e0f6b1 2471
d6f0886c
JD
2472 * nsmenu.m (ns_popup_dialog): Add an "ok" button if no buttons
2473 are specified (Bug#9168).
24e0f6b1 2474
2eb1f9e6
PE
24752011-07-25 Paul Eggert <eggert@cs.ucla.edu>
2476
2477 * bidi.c (bidi_dump_cached_states): Fix printf format mismatch.
2478 Found by GCC static checking and --with-wide-int on a 32-bit host.
2479
22381272 24802011-07-25 Eli Zaretskii <eliz@gnu.org>
7daee910
EZ
2481
2482 * xdisp.c (compute_display_string_pos): Fix logic of caching
2483 previous display string position. Initialize cached_prev_pos to
2484 -1. Fixes slow-down at the beginning of a buffer.
2485
f25e39b4
EZ
24862011-07-24 Eli Zaretskii <eliz@gnu.org>
2487
2488 * xfaces.c (check_lface_attrs) [HAVE_WINDOW_SYSTEM]: Allow `nil'
2489 for attrs[LFACE_FONTSET_INDEX].
2490
04c4b52e
PE
24912011-07-23 Paul Eggert <eggert@cs.ucla.edu>
2492
2493 * xml.c (parse_region): Remove unused local
2494 that was recently introduced.
2495
c1734fbd
EZ
24962011-07-23 Eli Zaretskii <eliz@gnu.org>
2497
be18c5a5
EZ
2498 * xfns.c (unwind_create_frame) [GLYPH_DEBUG]: Adapt to changes in
2499 2008-02-22T17:42:09Z!monnier@iro.umontreal.ca.
2500
c1734fbd
EZ
2501 * xdisp.c (move_it_in_display_line_to): Record the best matching
2502 position for TO_CHARPOS while scanning the line, and restore it on
640c8776
SM
2503 exit if none of the characters scanned was an exact match.
2504 Fixes vertical-motion and pos-visible-in-window-p under bidi redisplay
a9269c18
EZ
2505 when exact match is impossible due to invisible text, and the
2506 lines are truncated.
2507
a258d627
JD
25082011-07-23 Jan Djärv <jan.h.d@swipnet.se>
2509
2510 * nsterm.m (initFrameFromEmacs): Set NSTitledWindowMask in styleMask
2511 for OSX >= 10.7.
2512
b6d5a689
EZ
25132011-07-22 Eli Zaretskii <eliz@gnu.org>
2514
0f74f785
EZ
2515 Fix a significant slow-down of cursor motion with C-n, C-p,
2516 C-f/C-b, and C-v/M-v that couldn't keep up with keyboard
2517 auto-repeat under bidi redisplay in fontified buffers.
b6d5a689 2518 * xdisp.c (compute_stop_pos_backwards): New function.
b6d5a689
EZ
2519 (next_element_from_buffer): Call compute_stop_pos_backwards to
2520 find a suitable prev_stop when we find ourselves before
0f74f785
EZ
2521 base_level_stop.
2522 (reseat): Don't look for prev_stop, as that could mean a very long
2523 run.
2524 <cached_disp_pos, cached_disp_buffer, cached_disp_modiff>
2525 <cached_disp_overlay_modiff>: Cache for last found display string
2526 position.
551918c1 2527 (compute_display_string_pos): Return the cached position if asked
0f74f785
EZ
2528 about the same buffer in the same area of character positions, and
2529 the buffer wasn't changed since the time the display string
2530 position was cached.
551918c1 2531
b2d0c91a
EZ
25322011-07-22 Eli Zaretskii <eliz@gnu.org>
2533
2534 * xdisp.c (rows_from_pos_range): Don't ignore glyphs whose object
2535 is an integer, which is important for empty lines. (Bug#9149)
2536
043604ee
CY
25372011-07-22 Chong Yidong <cyd@stupidchicken.com>
2538
2539 * frame.c (Fmodify_frame_parameters): In tty case, update the
2540 default face if necessary (Bug#4238).
2541
da4adb04
CY
25422011-07-21 Chong Yidong <cyd@stupidchicken.com>
2543
2544 * editfns.c (Fstring_to_char): No need to explain what a character
2545 is in the docstring (Bug#6576).
2546
9abd0532
LMI
25472011-07-20 Lars Magne Ingebrigtsen <larsi@gnus.org>
2548
2549 * xml.c (parse_region): Make sure we always return a tree.
2550
36881d16
HK
25512011-07-20 HAMANO Kiyoto <khiker.mail@gmail.com>
2552
2553 * xml.c (parse_region): If a document contains only comments,
2554 return that, too.
2555
1e98674d
LMI
25562011-07-20 Lars Magne Ingebrigtsen <larsi@gnus.org>
2557
2558 * xml.c (make_dom): Return comments, too.
2559
590bd467
PE
25602011-07-19 Paul Eggert <eggert@cs.ucla.edu>
2561
2562 Port to OpenBSD.
2563 See http://lists.gnu.org/archive/html/emacs-devel/2011-07/msg00688.html
2564 and the surrounding thread.
2565 * minibuf.c (read_minibuf_noninteractive): Rewrite to use getchar
2566 rather than fgets, and retry after EINTR. Otherwise, 'emacs
2567 --batch -f byte-compile-file' fails on OpenBSD if an inactivity
2568 timer goes off.
2569 * s/openbsd.h (BROKEN_SIGIO): Define.
2570 * unexelf.c (unexec) [__OpenBSD__]:
2571 Don't update the .mdebug section of the Alpha COFF symbol table.
2572
f41628b2
LMI
25732011-07-19 Lars Magne Ingebrigtsen <larsi@gnus.org>
2574
2575 * lread.c (syms_of_lread): Clarify when `lexical-binding' is used
2576 (bug#8460).
2577
b59b67c5
PE
25782011-07-18 Paul Eggert <eggert@cs.ucla.edu>
2579
15e3a074
PE
2580 * fileio.c (Fcopy_file) [!MSDOS]: Tighten created file's mask.
2581 This fixes some race conditions on the permissions of any newly
2582 created file.
2583
41bed37d
PE
2584 * alloc.c (valid_pointer_p): Use pipe, not open.
2585 This fixes some permissions issues when debugging.
2586
b59b67c5
PE
2587 * fileio.c (Fcopy_file): Adjust mode if fchown fails. (Bug#9002)
2588 If fchown fails to set both uid and gid, try to set just gid,
2589 as that is sometimes allowed. Adjust the file's mode to eliminate
2590 setuid or setgid bits that are inappropriate if fchown fails.
2591
925a6be7
SM
25922011-07-18 Stefan Monnier <monnier@iro.umontreal.ca>
2593
2594 * xdisp.c (next_element_from_string, next_element_from_buffer): Use EQ
2595 to compare Lisp_Objects.
2596 * gnutls.c (syms_of_gnutls): Rename Vgnutls_log_level to
2597 global_gnutls_log_level, don't mistake it for a Lisp_Object.
2598 (init_gnutls_functions, emacs_gnutls_handle_error): Fix up uses.
2599
52968808
AS
26002011-07-17 Andreas Schwab <schwab@linux-m68k.org>
2601
0a6a104b
AS
2602 * lread.c (read_integer): Unread even EOF character.
2603 (read1): Likewise. Properly record start position of symbol.
2604
52968808
AS
2605 * lread.c (read1): Read `#:' as empty uninterned symbol if no
2606 symbol character follows.
2607
9e381cdd
PE
26082011-07-17 Paul Eggert <eggert@cs.ucla.edu>
2609
2610 * fileio.c (Fcopy_file): Pacify gcc re fchown. (Bug#9002)
2611 This works around a problem with the previous change to Fcopy_file.
2612 Recent glibc declares fchown with __attribute__((warn_unused_result)),
2613 and without this change, GCC might complain about discarding
2614 fchown's return value.
2615
b5641435
JB
26162011-07-16 Juanma Barranquero <lekktu@gmail.com>
2617
2618 * makefile.w32-in (GLOBAL_SOURCES): Add gnutls.c (followup to bug#9059).
2619
a8031457
PE
26202011-07-16 Paul Eggert <eggert@cs.ucla.edu>
2621
2622 * fileio.c (Fcopy_file): Don't diagnose fchown failures. (Bug#9002)
2623
dd889327
LMI
26242011-07-16 Lars Magne Ingebrigtsen <larsi@gnus.org>
2625
750c33f7
LMI
2626 * gnutls.c (syms_of_gnutls): Define `gnutls-log-level' here, since
2627 it's used from the C level.
2628
dd889327
LMI
2629 * process.c: Use the same condition for POLL_FOR_INPUT in both
2630 keyboard.c and process.c (bug#1858).
2631
87e86684
LM
26322011-07-09 Lawrence Mitchell <wence@gmx.li>
2633
2634 * gnutls.c (Qgnutls_bootprop_min_prime_bits): New variable.
2635 (Fgnutls_boot): Use it.
2636
64348f40
AS
26372011-07-15 Andreas Schwab <schwab@linux-m68k.org>
2638
2639 * doc.c (Fsubstitute_command_keys): Revert last change.
2640
1d698799
LMI
26412011-07-15 Lars Magne Ingebrigtsen <larsi@gnus.org>
2642
f863868c
LMI
2643 * doc.c (Fsubstitute_command_keys): Clarify that \= really only
2644 quotes the next character, and doesn't affect other longer
2645 sequences (bug#8935).
2646
1d698799
LMI
2647 * lread.c (syms_of_lread): Clarify that is isn't only
2648 `eval-buffer' and `eval-defun' that's affected by
2649 `lexical-binding' (bug#8460).
2650
aa4b6df6
EZ
26512011-07-15 Eli Zaretskii <eliz@gnu.org>
2652
2653 * xdisp.c (move_it_in_display_line_to): Fix vertical motion with
2654 bidi redisplay when a line includes both an image and is
2655 truncated.
2656
5d856da6
PE
26572011-07-14 Paul Eggert <eggert@cs.ucla.edu>
2658
ad6042bb
PE
2659 Fix minor problems found by static checking.
2660 * bidi.c (bidi_cache_size): Now EMACS_INT, not size_t.
2661 (elsz): Now a signed constant, not a size_t var. We prefer signed
2662 types to unsigned, to avoid integer comparison confusion. Without
2663 this change, GCC 4.6.1 with -Wunsafe-loop-optimizations complains
2664 "cannot optimize loop, the loop counter may overflow", a symptom
2665 of the confusion.
f00bbb22 2666 * indent.c (Fvertical_motion): Mark locals as initialized.
5d856da6
PE
2667 * xdisp.c (reseat_to_string): Fix pointer signedness issue.
2668
6468f31c
LMI
26692011-07-14 Lars Magne Ingebrigtsen <larsi@gnus.org>
2670
49080b10
LMI
2671 * search.c (Fre_search_backward): Mention `case-fold-search' in
2672 all the re_search_* functions (bug#8138).
2673
6468f31c
LMI
2674 * keyboard.c (Fopen_dribble_file): Document when the file is
2675 closed (bug#8056).
2676
c965adc5
EZ
26772011-07-14 Eli Zaretskii <eliz@gnu.org>
2678
df9733bf
EZ
2679 * bidi.c (bidi_dump_cached_states): Fix format of displaying
2680 bidi_cache_idx.
2681
0bb23927
EZ
2682 Support bidi reordering of display and overlay strings.
2683 * xdisp.c (compute_display_string_pos)
2684 (compute_display_string_end): Accept additional argument STRING.
2685 (init_iterator, reseat_1): Initialize bidi_it->string.s to NULL.
2686 (reseat_to_string): Initialize bidi_it->string.s and
2687 bidi_it->string.schars.
2688 (Fcurrent_bidi_paragraph_direction): Initialize itb.string.s to
640c8776
SM
2689 NULL (avoids a crash in bidi_paragraph_init).
2690 Initialize itb.string.lstring.
0bb23927
EZ
2691 (init_iterator): Call bidi_init_it only of a valid
2692 buffer position was specified. Initialize paragraph_embedding to
2693 L2R.
2694 (reseat_to_string): Initialize the bidi iterator.
2695 (display_string): If we need to ignore text properties of
2696 LISP_STRING, set IT->stop_charpos to IT->end_charpos. (The
2697 original value of -1 will not work with bidi.)
2698 (compute_display_string_pos): First arg is now struct
2699 `text_pos *'; all callers changed. Support display properties on
2700 Lisp strings.
2701 (compute_display_string_end): Support display properties on Lisp
2702 strings.
2703 (init_iterator, reseat_1, reseat_to_string): Initialize the
2704 string.bufpos member to 0 (zero, for compatibility with IT_CHARPOS
2705 when iterating on a string not from display properties).
640c8776
SM
2706 (compute_display_string_pos, compute_display_string_end):
2707 Fix calculation of the object to scan. Fixes an error when using
0bb23927
EZ
2708 arrow keys.
2709 (next_element_from_buffer): Don't abort when IT_CHARPOS is before
640c8776
SM
2710 base_level_stop; instead, set base_level_stop to BEGV.
2711 Fixes crashes in vertical-motion.
0bb23927
EZ
2712 (next_element_from_buffer): Improve commentary for when
2713 the iterator is before prev_stop.
2714 (init_iterator): Initialize bidi_p from the default value of
2715 bidi-display-reordering, not from buffer-local value. Use the
2716 buffer-local value only if initializing for buffer iteration.
2717 (handle_invisible_prop): Support invisible properties on strings
2718 that are being bidi-reordered.
2719 (set_iterator_to_next): Support bidi reordering of C strings and
2720 Lisp strings.
2721 (next_element_from_string): Support bidi reordering of Lisp
2722 strings.
2723 (handle_stop_backwards): Support Lisp strings as well.
640c8776
SM
2724 (display_string): Support display of R2L glyph rows.
2725 Use IT_STRING_CHARPOS when displaying from a Lisp string.
0bb23927
EZ
2726 (init_iterator): Don't initialize it->bidi_p for strings
2727 here.
2728 (reseat_to_string): Initialize it->bidi_p for strings here.
2729 (next_element_from_string, next_element_from_c_string)
2730 (next_element_from_buffer): Add xassert's for correspondence
2731 between IT's object being iterated and it->bidi_it.string
2732 structure.
2733 (face_before_or_after_it_pos): Support bidi iteration.
2734 (next_element_from_c_string): Handle the case of the first string
2735 character that is not the first one in the visual order.
2736 (get_visually_first_element): New function, refactored from common
2737 parts of next_element_from_buffer, next_element_from_string, and
2738 next_element_from_c_string.
2739 (tool_bar_lines_needed, redisplay_tool_bar)
2740 (display_menu_bar): Force left-to-right direction. Add a FIXME
2741 comment for making that be controlled by a user option.
2742 (push_it, pop_it): Save and restore the state of the
2743 bidi iterator. Save and restore the bidi_p flag.
2744 (pop_it): Iterate out of display property for string iteration as
2745 well.
2746 (iterate_out_of_display_property): Support iteration over strings.
2747 (handle_single_display_spec): Set up it->bidi_it for iteration
2748 over a display string, and call bidi_init_it.
2749 (handle_single_display_spec, next_overlay_string)
2750 (get_overlay_strings_1, push_display_prop): Set up the bidi
2751 iterator for displaying display or overlay strings.
2752 (forward_to_next_line_start): Don't use the shortcut if
2753 bidi-iterating.
2754 (back_to_previous_visible_line_start): If handle_display_prop
2755 pushed the iterator stack, restore the internal state of the bidi
2756 iterator by calling bidi_pop_it same number of times.
2757 (reseat_at_next_visible_line_start): If ON_NEWLINE_P is non-zero,
2758 and we are bidi-iterating, don't decrement the iterator position;
2759 instead, set the first_elt flag in the bidi iterator, to produce
2760 the same effect.
2761 (reseat_1): Remove redundant setting of string_from_display_prop_p.
2762 (push_display_prop): xassert that we are iterating a buffer.
2763 (push_it, pop_it): Save and restore paragraph_embedding member.
2764 (handle_single_display_spec, next_overlay_string)
2765 (get_overlay_strings_1, reseat_1, reseat_to_string)
2766 (push_display_prop): Set up the `unibyte' member of bidi_it.string
2767 correctly. Don't assume unibyte strings are not bidi-reordered.
2768 (compute_display_string_pos)
2769 (compute_display_string_end): Fix handling the case of C string.
2770 (push_it, pop_it): Save and restore from_disp_prop_p.
2771 (handle_single_display_spec, push_display_prop): Set the
2772 from_disp_prop_p flag.
2773 (get_overlay_strings_1): Reset the from_disp_prop_p flag.
2774 (pop_it): Call iterate_out_of_display_property only if we are
2775 popping after iteration over a string that came from a display
2776 property. Fix a typo in popping stretch info. Add an assertion
2777 for verifying that the iterator position is in sync with the bidi
2778 iterator.
2779 (handle_single_display_spec, get_overlay_strings_1)
2780 (push_display_prop): Fix initialization of paragraph direction for
2781 string when that of the parent object is not yet determined.
2782 (reseat_1): Call bidi_init_it to resync the bidi
2783 iterator with IT's position. (Bug#7616)
2784 (find_row_edges): If ROW->start.pos gives position
2785 smaller than min_pos, use it as ROW->minpos. (Bug#7616)
2786 (handle_stop, back_to_previous_visible_line_start, reseat_1):
2787 Reset the from_disp_prop_p flag.
2788 (SAVE_IT, RESTORE_IT): New macros.
2789 (pos_visible_p, face_before_or_after_it_pos)
2790 (back_to_previous_visible_line_start)
2791 (move_it_in_display_line_to, move_it_in_display_line)
2792 (move_it_to, move_it_vertically_backward, move_it_by_lines)
2793 (try_scrolling, redisplay_window, display_line): Use them when
2794 saving a temporary copy of the iterator and restoring it back.
2795 (back_to_previous_visible_line_start, reseat_1)
2796 (init_iterator): Empty the bidi cache "stack".
2797 (move_it_in_display_line_to): If iterator ended up at
2798 EOL, but we never saw any buffer positions smaller than
2799 to_charpos, return MOVE_POS_MATCH_OR_ZV. Fixes vertical cursor
2800 motion in bidi-reordered lines.
2801 (move_it_in_display_line_to): Record prev_method and prev_pos
2802 immediately before the call to set_iterator_to_next. Fixes cursor
2803 motion in bidi-reordered lines with stretch glyphs and strings
2804 displayed in margins. (Bug#8133) (Bug#8867)
2805 Return MOVE_POS_MATCH_OR_ZV only if iterator position is past
2806 TO_CHARPOS.
640c8776
SM
2807 (pos_visible_p): Support positions in bidi-reordered lines.
2808 Save and restore bidi cache.
0bb23927
EZ
2809
2810 * bidi.c (bidi_level_of_next_char): clen should be EMACS_NT, not int.
2811 (bidi_paragraph_info): Delete unused struct.
2812 (bidi_cache_idx, bidi_cache_last_idx): Declare EMACS_INT.
2813 (bidi_cache_start): New variable.
2814 (bidi_cache_reset): Reset bidi_cache_idx to bidi_cache_start, not
2815 to zero.
2816 (bidi_cache_fetch_state, bidi_cache_search)
2817 (bidi_cache_find_level_change, bidi_cache_iterator_state)
2818 (bidi_cache_find, bidi_peek_at_next_level)
2819 (bidi_level_of_next_char, bidi_find_other_level_edge)
2820 (bidi_move_to_visually_next): Compare cache index with
2821 bidi_cache_start rather than with zero.
2822 (bidi_fetch_char): Accept new argument STRING; all callers
2823 changed. Support iteration over a string. Support strings with
2824 display properties. Support unibyte strings. Fix the type of
2825 `len' according to what STRING_CHAR_AND_LENGTH expects.
2826 (bidi_paragraph_init, bidi_resolve_explicit_1)
2827 (bidi_resolve_explicit, bidi_resolve_weak)
640c8776
SM
2828 (bidi_level_of_next_char, bidi_move_to_visually_next):
2829 Support iteration over a string.
0bb23927
EZ
2830 (bidi_set_sor_type, bidi_resolve_explicit_1)
2831 (bidi_resolve_explicit, bidi_type_of_next_char): ignore_bn_limit
2832 can now be zero (for strings); special values 0 and -1 were
2833 changed to -1 and -2, respectively.
2834 (bidi_char_at_pos): New function.
2835 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak):
2836 Call it instead of FETCH_MULTIBYTE_CHAR.
2837 (bidi_move_to_visually_next): Abort if charpos or bytepos were not
2838 initialized to valid values.
2839 (bidi_init_it): Don't initialize charpos and bytepos with invalid
2840 values.
2841 (bidi_level_of_next_char): Allow the sentinel "position" to pass
2842 the test for valid cached positions. Fix the logic for looking up
2843 the sentinel state in the cache. GCPRO the Lisp string we are
2844 iterating.
2845 (bidi_push_it, bidi_pop_it): New functions.
2846 (bidi_initialize): Initialize the bidi cache start stack pointer.
2847 (bidi_cache_ensure_space): New function, refactored from part of
2848 bidi_cache_iterator_state. Don't assume the required size is just
2849 one BIDI_CACHE_CHUNK away.
2850 (bidi_cache_start_stack, bidi_push_it): Use IT_STACK_SIZE.
2851 (bidi_count_bytes, bidi_char_at_pos): New functions.
2852 (bidi_cache_search): Don't assume bidi_cache_last_idx is
2853 always valid if bidi_cache_idx is valid.
2854 (bidi_cache_find_level_change): xassert that bidi_cache_last_idx
2855 is valid if it's going to be used.
2856 (bidi_shelve_cache, bidi_unshelve_cache): New functions.
2857 (bidi_cache_fetch_state, bidi_cache_search)
c965adc5
EZ
2858 (bidi_cache_find_level_change, bidi_cache_ensure_space)
2859 (bidi_cache_iterator_state, bidi_cache_find)
640c8776
SM
2860 (bidi_find_other_level_edge, bidi_cache_start_stack):
2861 All variables related to cache indices are now EMACS_INT.
c965adc5 2862
0bb23927
EZ
2863 * dispextern.h (struct bidi_string_data): New structure.
2864 (struct bidi_it): New member `string'. Make flag members be 1-bit
2865 fields, and put them last in the struct.
640c8776
SM
2866 (compute_display_string_pos, compute_display_string_end):
2867 Update prototypes.
0bb23927
EZ
2868 (bidi_push_it, bidi_pop_it): Add prototypes.
2869 (struct iterator_stack_entry): New members bidi_p,
2870 paragraph_embedding, and from_disp_prop_p.
2871 (struct it): Member bidi_p is now a bit field 1 bit wide.
640c8776
SM
2872 (bidi_shelve_cache, bidi_unshelve_cache):
2873 Declare prototypes.
0bb23927
EZ
2874
2875 * .gdbinit (xvectype, xvector, xcompiled, xchartable, xboolvector)
2876 (xpr, xfont, xbacktrace): Use "header.size" when accessing vectors
2877 and vector-like objects.
2878
2879 * dispnew.c (buffer_posn_from_coords): Save and restore the bidi
2880 cache around display iteration.
2881
2882 * window.c (Fwindow_end, window_scroll_pixel_based)
2883 (displayed_window_lines, Frecenter): Save and restore the bidi
2884 cache around display iteration.
2885
3bbd2265
LMI
28862011-07-14 Lars Magne Ingebrigtsen <larsi@gnus.org>
2887
2888 * editfns.c (Fdelete_region): Clarify the use of the named
2889 parameters (bug#6788).
2890
adc47434
MR
28912011-07-14 Martin Rudalics <rudalics@gmx.at>
2892
2893 * indent.c (Fvertical_motion): Set and restore w->pointm when
2894 saving and restoring the window's buffer (Bug#9006).
2895
837c31f8
LMI
28962011-07-13 Lars Magne Ingebrigtsen <larsi@gnus.org>
2897
2898 * editfns.c (Fstring_to_char): Clarify just what is returned
2899 (bug#6576). Text by Eli Zaretskii.
2900
ac389d0c
JB
29012011-07-13 Juanma Barranquero <lekktu@gmail.com>
2902
2903 * gnutls.c (init_gnutls_functions): Honor gnutls_log_level (bug#9059).
2904
0be0ce47
EZ
29052011-07-13 Eli Zaretskii <eliz@gnu.org>
2906
2907 * buffer.c (mmap_find): Fix a typo.
2908
cd18e7e3
JB
29092011-07-13 Johan Bockgård <bojohan@gnu.org>
2910
2911 Fix execution of x selection hooks.
2912 * xselect.c (Qx_lost_selection_functions)
2913 (Qx_sent_selection_functions): New vars.
2914 (syms_of_xselect): DEFSYM them.
2915 (x_handle_selection_request): Pass Qx_sent_selection_functions
2916 rather than Vx_sent_selection_functions to Frun_hook_with_args.
2917 (x_handle_selection_clear,x_clear_frame_selections):
2918 Pass Qx_lost_selection_functions rather than
2919 Vx_lost_selection_functions to Frun_hook_with_args.
2920
47ea7f44
PE
29212011-07-13 Paul Eggert <eggert@cs.ucla.edu>
2922
ac389d0c 2923 * buffer.c (Fget_buffer_create): Initialize inhibit_shrinking.
2941c447
PE
2924 The old code sometimes used this field without initializing it.
2925
47ea7f44
PE
2926 * alloc.c (gc_sweep): Don't read past end of array.
2927 In theory, the old code could also have corrupted Emacs internals,
2928 though it'd be very unlikely.
2929
bc985c87
AS
29302011-07-12 Andreas Schwab <schwab@linux-m68k.org>
2931
2932 * character.c (Fcharacterp): Don't advertise optional ignored
ac389d0c 2933 argument. (Bug#4026)
bc985c87 2934
0cf34688
LMI
29352011-07-12 Lars Magne Ingebrigtsen <larsi@gnus.org>
2936
b3dadd76
LMI
2937 * keymap.c (syms_of_keymap): Clarify that "modifier" is "modifier
2938 key" (bug#4257).
2939
0cf34688
LMI
2940 * window.c (Fset_window_start): Doc fix (bug#4199).
2941 (Fset_window_hscroll): Ditto.
2942
270768cd
PE
29432011-07-12 Paul Eggert <eggert@cs.ucla.edu>
2944
077e3dda 2945 Fix minor new problems caught by GCC 4.6.1.
270768cd 2946 * term.c (init_tty): Remove unused local.
490011a6 2947 * xsettings.c (store_monospaced_changed): Define this function only
077e3dda 2948 if (defined HAVE_GSETTINGS || defined HAVE_GCONF), as it's
490011a6 2949 not used otherwise.
270768cd 2950
b1f58454
CY
29512011-07-12 Chong Yidong <cyd@stupidchicken.com>
2952
2953 * xdisp.c (Vresize_mini_windows): Minor doc fix (Bug#3300).
2954
22b9578d
LMI
29552011-07-11 Lars Magne Ingebrigtsen <larsi@gnus.org>
2956
6e70ab07
LMI
2957 * xdisp.c (syms_of_xdisp): Make it explicit that the mini-windows
2958 are the mini-buffer and the echo area (bug#3320).
2959
22b9578d
LMI
2960 * term.c (init_tty): Remove support for supdup, c10 and perq
2961 terminals, which are no longer supported (bug#1482).
2962
8974cc9f
JB
29632011-07-10 Johan Bockgård <bojohan@gnu.org>
2964
2965 * xdisp.c (Ftool_bar_lines_needed): Fix WINDOWP check.
2966
a560d974
JD
29672011-07-10 Jan Djärv <jan.h.d@swipnet.se>
2968
2969 * xmenu.c (menu_highlight_callback): Only pass frame to show_help_event
2970 for non-popups (Bug#3642).
2971
1dae0f0a
AS
29722011-07-10 Andreas Schwab <schwab@linux-m68k.org>
2973
268c2c36 2974 * alloc.c (reset_malloc_hooks): Protoize.
1dae0f0a 2975 * buffer.c (mmap_init, mmap_find, mmap_free_1, mmap_enlarge)
268c2c36
AS
2976 (mmap_set_vars, mmap_alloc, mmap_free, mmap_realloc): Likewise.
2977 * cm.c (losecursor): Likewise.
1dae0f0a
AS
2978 * data.c (fmod): Likewise.
2979 * dispnew.c (swap_glyphs_in_rows): Likewise.
2980 * emacs.c (memory_warning_signal): Likewise.
2981 * floatfns.c (float_error): Likewise.
2982 * font.c (check_gstring, check_otf_features, otf_tag_symbol)
2983 (otf_open, font_otf_capability, generate_otf_features)
2984 (font_otf_DeviceTable, font_otf_ValueRecord, font_otf_Anchor):
2985 Likewise.
2986 * image.c (pbm_read_file): Likewise.
2987 * indent.c (string_display_width): Likewise.
2988 * intervals.c (check_for_interval, search_for_interval)
2989 (inc_interval_count, count_intervals, root_interval)
2990 (adjust_intervals_for_insertion, make_new_interval): Likewise.
2991 * lread.c (defalias): Likewise.
268c2c36 2992 * ralloc.c (r_alloc_check): Likewise.
1dae0f0a
AS
2993 * regex.c (set_image_of_range_1, set_image_of_range)
2994 (regex_grow_registers): Likewise.
2995 * sysdep.c (strerror): Likewise.
2996 * termcap.c (valid_filename_p, tprint, main): Likewise.
2997 * tparam.c (main): Likewise.
2998 * unexhp9k800.c (run_time_remap, save_data_space)
2999 (update_file_ptrs, read_header, write_header, calculate_checksum)
3000 (copy_file, copy_rest, display_header): Likewise.
3001 * widget.c (mark_shell_size_user_specified, create_frame_gcs):
3002 Likewise.
3003 * xdisp.c (check_it): Likewise.
3004 * xfaces.c (register_color, unregister_color, unregister_colors):
3005 Likewise.
3006 * xfns.c (print_fontset_result): Likewise.
3007 * xrdb.c (member, fatal, main): Likewise.
3008
99033785
PE
30092011-07-10 Paul Eggert <eggert@cs.ucla.edu>
3010
3011 Fix minor problems found by static checking (Bug#9031).
3012 * chartab.c (char_table_set_range, map_sub_char_table):
3013 Remove unused locals.
3014 (uniprop_table): Now static.
3015 * composite.c (_work_char): Remove unused static var.
3016
9cb2ac56
JB
30172011-07-09 Juanma Barranquero <lekktu@gmail.com>
3018
3019 * chartab.c (uniprop_table_uncompress): Remove unused local variable.
3020
f25661f0
JD
30212011-07-09 Jan Djärv <jan.h.d@swipnet.se>
3022
3023 * gtkutil.c (qttip_cb): Remove code without function.
3024
8278c4fe
EZ
30252011-07-09 Eli Zaretskii <eliz@gnu.org>
3026
3027 * w32.c (pthread_sigmask): New stub.
3028
1692ae2d 30292011-07-08 Paul Eggert <eggert@cs.ucla.edu>
123403e4 3030
8a6ebd58 3031 Use pthread_sigmask, not sigprocmask (Bug#9010).
123403e4
PE
3032 sigprocmask is portable only for single-threaded applications, and
3033 Emacs can be multi-threaded when it uses GTK.
1301ac26
PE
3034 * Makefile.in (LIB_PTHREAD_SIGMASK): New macro.
3035 (LIBES): Use it.
3036 * callproc.c (Fcall_process):
3037 * process.c (create_process):
3038 * sysdep.c (sys_sigblock, sys_sigunblock, sys_sigsetmask):
3039 Use pthread_sigmask, not sigprocmask.
123403e4 3040
1b854618
JD
30412011-07-08 Jan Djärv <jan.h.d@swipnet.se>
3042
3043 * gtkutil.c (qttip_cb): Set line wrap to FALSE for tooltip widget.
3044 (xg_prepare_tooltip): Revert text in x->ttip_lbl, margins was
3045 wrong (Bug#8591).
3046
3fe4b549
JD
30472011-07-08 Jan Djärv <jan.h.d@swipnet.se>
3048
0ce7e563
JD
3049 * gtkutil.c (xg_prepare_tooltip): Fix indentation and comment.
3050 Put text in x->ttip_lbl instead of gtk_tooltip_set_text (Bug#8591).
3051 (xg_hide_tooltip): Fix comment.
3052
3fe4b549
JD
3053 * nsterm.m (initFrameFromEmacs): Don't use ns_return_types
3054 in registerServicesMenuSendTypes.
3055 (validRequestorForSendType): Don't check ns_return_types.
3056
3057 * nsfns.m (Fx_open_connection): Put NSStringPboardType into
3058 ns_return_type.
3059
5df75e47
JR
30602011-07-08 Jason Rumney <jasonr@gnu.org>
3061
3062 * w32fns.c (w32_wnd_proc) [WM_TIMER, WM_SET_CURSOR]: Avoid using
3063 frame struct members of non-existent frames (Bug#6284).
3064
699c10bd
JD
30652011-07-08 Jan Djärv <jan.h.d@swipnet.se>
3066
4393663b
JD
3067 * nsterm.m (keyDown): Call to wantsToDelayTextChangeNotifications and
3068 variable firstTime not needed on OSX >= 10.6.
3069 (setPosition): setFloatValue:knobProportion: is deprecated on OSX
3070 >= 10.5. Use setKnobProportion, setDoubleValue.
3071
3072 * nsterm.h (MAC_OS_X_VERSION_10_3, MAC_OS_X_VERSION_10_4)
3073 (MAC_OS_X_VERSION_10_5): Define if not defined.
3074 (EmacsView, EmacsTooltip): Implements NSWindowDelegate on OSX >= 10.6.
3075 (EmacsMenu): Implements NSMenuDelegate on OSX >= 10.6.
3076 (EmacsToolbar): Implements NSToolbarDelegate on OSX >= 10.6.
3077
3078 * nsselect.m (ns_string_from_pasteboard): Don't use deprecated methods
3079 cString and lossyCString on OSX >= 10.4
3080
3081 * nsmenu.m (fillWithWidgetValue): Don't use depercated method
3082 sizeToFit on OSX >= 10.2.
3083
3084 * nsimage.m (allocInitFromFile): Don't use deprecated method
3085 bestRepresentationForDevice on OSX >= 10.6.
3086
3087 * nsfns.m (check_ns_display_info): Cast to long and use %ld in error
3088 to avoid warning.
3089
3090 * emacs.c: Declare unexec_init_emacs_zone.
3091
a63e0781
JD
3092 * nsgui.h: Fix compiler warning about gnulib redefining verify.
3093
699c10bd
JD
3094 * nsselect.m (ns_get_local_selection): Change to extern (Bug#8842).
3095
3096 * nsmenu.m (ns_update_menubar): Remove useless setDelegate call
3097 on svcsMenu (Bug#8842).
3098
3099 * nsfns.m (Fx_open_connection): Remove NSStringPboardType from
3100 ns_return_types.
3101 (Fns_list_services): Just return Qnil on 10.6, code not working there.
3102
3103 * nsterm.m (QUTF8_STRING): Declare.
3104 (initFrameFromEmacs): Call registerServicesMenuSendTypes.
3105 (validRequestorForSendType): Return type is (id).
3106 Change indexOfObjectIdenticalTo to indexOfObject.
3107 Check if we have local selection before returning self (Bug#8842).
3108 (writeSelectionToPasteboard): Put local selection into paste board
3109 if we have a local selection (Bug#8842).
3110 (syms_of_nsterm): DEFSYM QUTF8_STRING.
3111
3112 * nsterm.h (MAC_OS_X_VERSION_10_6): Define here instead of nsterm.m.
3113 (ns_get_local_selection): Declare.
3114
54e10184
LMI
31152011-07-07 Lars Magne Ingebrigtsen <larsi@gnus.org>
3116
9888ff71
LMI
3117 * keymap.c (describe_map_tree): Don't insert a double newline at
3118 the end of the buffer (bug#1169) and return whether we inserted
3119 something.
3120
54e10184
LMI
3121 * callint.c (Fcall_interactively): Change "reading args" to
3122 "providing args" to try to clarify what it does (bug#1010).
3123
15fa4783
KH
31242011-07-07 Kenichi Handa <handa@m17n.org>
3125
3126 * composite.c (composition_compute_stop_pos): Ignore a static
3127 composition starting before CHARPOS (Bug#8915).
3128
3129 * xdisp.c (handle_composition_prop): Likewise.
3130
a8815b00
EZ
31312011-07-07 Eli Zaretskii <eliz@gnu.org>
3132
3133 * term.c (produce_glyphs) <xassert>: Allow IT_GLYPHLESS in it->what.
3134 (Bug#9015)
3135
ef7b981d 31362011-07-07 Kenichi Handa <handa@m17n.org>
c805dec0
KH
3137
3138 * character.h (unicode_category_t): New enum type.
3139
3140 * chartab.c (uniprop_decoder_t, uniprop_encoder_t): New types.
3141 (Qchar_code_property_table): New variable.
3142 (UNIPROP_TABLE_P, UNIPROP_GET_DECODER)
3143 (UNIPROP_COMPRESSED_FORM_P): New macros.
3144 (char_table_ascii): Uncompress the compressed values.
3145 (sub_char_table_ref): New arg is_uniprop. Callers changed.
3146 Uncompress the compressed values.
ac389d0c 3147 (sub_char_table_ref_and_range): Likewise.
c805dec0
KH
3148 (char_table_ref_and_range): Uncompress the compressed values.
3149 (sub_char_table_set): New arg is_uniprop. Callers changed.
3150 Uncompress the compressed values.
3151 (sub_char_table_set_range): Args changed. Callers changed.
3152 (char_table_set_range): Adjuted for the above change.
3153 (map_sub_char_table): Delete args default_val and parent. Add arg
3154 top. Give decoded values to a Lisp function.
640c8776 3155 (map_char_table): Adjust for the above change. Give decoded
c805dec0
KH
3156 values to a Lisp function. Gcpro more variables.
3157 (uniprop_table_uncompress)
3158 (uniprop_decode_value_run_length): New functions.
3159 (uniprop_decoder, uniprop_decoder_count): New variables.
3160 (uniprop_get_decoder, uniprop_encode_value_character)
3161 (uniprop_encode_value_run_length, uniprop_encode_value_numeric):
3162 New functions.
3163 (uniprop_encoder, uniprop_encoder_count): New variables.
3164 (uniprop_get_encoder, uniprop_table)
3165 (Funicode_property_table_internal, Fget_unicode_property_internal)
3166 (Fput_unicode_property_internal): New functions.
3167 (syms_of_chartab): DEFSYM Qchar_code_property_table, defsubr
3168 Sunicode_property_table_internal, Sget_unicode_property_internal,
5e617bc2 3169 and Sput_unicode_property_internal. Defvar_lisp
c805dec0
KH
3170 char-code-property-alist.
3171
640c8776 3172 * composite.c (CHAR_COMPOSABLE_P): Adjust for the change of
c805dec0
KH
3173 Vunicode_category_table.
3174
640c8776 3175 * font.c (font_range): Adjust for the change of
c805dec0
KH
3176 Vunicode_category_table.
3177
76b397fb
DN
31782011-07-07 Dan Nicolaescu <dann@ics.uci.edu>
3179
3180 * m/iris4d.h: Remove file, move contents ...
3181 * s/irix6-5.h: ... here.
3182
22b4128e
PE
31832011-07-06 Paul Eggert <eggert@cs.ucla.edu>
3184
3185 Remove unportable assumption about struct layout (Bug#8884).
8a5c77bb
PE
3186 * alloc.c (mark_buffer):
3187 * buffer.c (reset_buffer_local_variables, Fbuffer_local_variables)
3188 (clone_per_buffer_values): Don't assume that
22b4128e
PE
3189 sizeof (struct buffer) is a multiple of sizeof (Lisp_Object).
3190 This isn't true in general, and it's particularly not true
3191 if Emacs is configured with --with-wide-int.
3192 * buffer.h (FIRST_FIELD_PER_BUFFER, LAST_FIELD_PER_BUFFER):
3193 New macros, used in the buffer.c change.
3194
869795d6
JD
31952011-07-05 Jan Djärv <jan.h.d@swipnet.se>
3196
3197 * xsettings.c: Use both GConf and GSettings if both are available.
3198 (store_config_changed_event): Add comment.
3199 (dpyinfo_valid, store_font_name_changed, map_tool_bar_style)
3200 (store_tool_bar_style_changed): New functions.
5e617bc2 3201 (store_monospaced_changed): Add comment. Call dpyinfo_valid.
869795d6
JD
3202 (struct xsettings): Move font inside HAVE_XFT.
3203 (GSETTINGS_TOOL_BAR_STYLE, GSETTINGS_FONT_NAME): New defines.
640c8776 3204 (GSETTINGS_MONO_FONT): Rename from SYSTEM_MONO_FONT.
869795d6 3205 Move inside HAVE_XFT.
640c8776 3206 (something_changed_gsettingsCB): Rename from something_changedCB.
869795d6
JD
3207 Check for changes in GSETTINGS_TOOL_BAR_STYLE and GSETTINGS_FONT_NAME
3208 also.
3209 (GCONF_TOOL_BAR_STYLE, GCONF_FONT_NAME): New defines.
5e617bc2 3210 (GCONF_MONO_FONT): Rename from SYSTEM_MONO_FONT. Move inside HAVE_XFT.
640c8776 3211 (something_changed_gconfCB): Rename from something_changedCB.
869795d6
JD
3212 Check for changes in GCONF_TOOL_BAR_STYLE and GCONF_FONT_NAME also.
3213 (parse_settings): Move check for font inside HAVE_XFT.
3214 (read_settings, apply_xft_settings): Add comment.
3215 (read_and_apply_settings): Add comment. Call map_tool_bar_style and
3216 store_tool_bar_style_changed. Move check for font inside HAVE_XFT and
3217 call store_font_name_changed.
3218 (xft_settings_event): Add comment.
3219 (init_gsettings): Add comment. Get values for GSETTINGS_TOOL_BAR_STYLE
3220 and GSETTINGS_FONT_NAME. Move check for fonts within HAVE_XFT.
3221 (init_gconf): Add comment. Get values for GCONF_TOOL_BAR_STYLE
3222 and GCONF_FONT_NAME. Move check for fonts within HAVE_XFT.
3223 (xsettings_initialize): Call init_gsettings last.
640c8776
SM
3224 (xsettings_get_system_font, xsettings_get_system_normal_font):
3225 Add comment.
869795d6 3226
d8ed26bd
PE
32272011-07-05 Paul Eggert <eggert@cs.ucla.edu>
3228
3229 Random fixes. E.g., (random) never returned negative values.
3230 * fns.c (Frandom): Use GET_EMACS_TIME for random seed, and add the
3231 subseconds part to the entropy, as that's a bit more random.
3232 Prefer signed to unsigned, since the signedness doesn't matter and
3233 in general we prefer signed. When given a limit, use a
3234 denominator equal to INTMASK + 1, not to VALMASK + 1, because the
3235 latter isn't right if USE_2_TAGS_FOR_INTS.
3236 * sysdep.c (get_random): Return a value in the range 0..INTMASK,
3237 not 0..VALMASK. Don't discard "excess" bits that random () returns.
3238
cabf1cac
SM
32392011-07-04 Stefan Monnier <monnier@iro.umontreal.ca>
3240
3241 * textprop.c (text_property_stickiness):
3242 Obey Vtext_property_default_nonsticky.
3243 (syms_of_textprop): Add `display' to Vtext_property_default_nonsticky.
3244 * w32fns.c (syms_of_w32fns):
3245 * xfns.c (syms_of_xfns): Don't Add `display' since it's there by default.
3246
6e9b2be9
PE
32472011-07-04 Paul Eggert <eggert@cs.ucla.edu>
3248
3249 * fileio.c (barf_or_query_if_file_exists): Use S_ISDIR.
3250 This is more efficient than Ffile_directory_p and avoids a minor race.
3251
90186c68
LMI
32522011-07-04 Lars Magne Ingebrigtsen <larsi@gnus.org>
3253
7c301272
LMI
3254 * buffer.c (Foverlay_put): Say what the return value is
3255 (bug#7835).
3256
c4f2d8d4
LMI
3257 * fileio.c (barf_or_query_if_file_exists): Check first if the file
3258 is a directory before asking whether to use the file name
3259 (bug#7564).
ad637907
LMI
3260 (barf_or_query_if_file_exists): Make the "File is a directory"
3261 error be more correct.
c4f2d8d4 3262
90186c68
LMI
3263 * fns.c (Frequire): Remove the mention of the .gz files, since
3264 that's installation-specific, but keep the mention of
3265 `get-load-suffixes'.
3266
da64016e
PE
32672011-07-04 Paul Eggert <eggert@cs.ucla.edu>
3268
3269 * editfns.c (Fformat_time_string): Don't assume strlen fits in int.
3270 Report string overflow if the output is too long.
3271
7d47b580
JB
32722011-07-04 Juanma Barranquero <lekktu@gmail.com>
3273
a555cb87
JB
3274 * gnutls.c (Fgnutls_boot): Don't mention :verify-error.
3275 (syms_of_gnutls): Remove duplicate DEFSYM for
3276 Qgnutls_bootprop_verify_hostname_error, an error for
3277 Qgnutls_bootprop_verify_error (which is no longer used).
3278
7d47b580
JB
3279 * eval.c (find_handler_clause): Remove parameters `sig' and `data',
3280 unused since 2011-01-26T20:02:07Z!monnier@iro.umontreal.ca. All callers changed.
3281 Also (re)move comments that are misplaced or no longer relevant.
3282
1e49bfab
LMI
32832011-07-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
3284
3285 * callint.c (Finteractive): Clarify the meaning of "@" (bug#8813).
3286
1485f4c0
CY
32872011-07-03 Chong Yidong <cyd@stupidchicken.com>
3288
3289 * xfaces.c (Finternal_merge_in_global_face): Modify the foreground
3290 and background color parameters if they have been changed.
3291
a9ab721e
LMI
32922011-07-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
3293
3294 * editfns.c (Fformat): Clarify the - and 0 flags (bug#6659).
3295
cf7cff57
PE
32962011-07-03 Paul Eggert <eggert@cs.ucla.edu>
3297
2e13213d
PE
3298 * xsettings.c (SYSTEM_FONT): Define only when used.
3299 No need to define when HAVE_GSETTINGS || !HAVE_XFT.
3300
cf7cff57
PE
3301 * keymap.c (access_keymap_1): Now static.
3302
7a8e04f7
CY
33032011-07-02 Chong Yidong <cyd@stupidchicken.com>
3304
3305 * keyboard.c (command_loop_1): If a down-mouse event is unbound,
3306 leave any prefix arg for the up event (Bug#1586).
3307
61352f62
LMI
33082011-07-02 Lars Magne Ingebrigtsen <larsi@gnus.org>
3309
69bb1ef7
LMI
3310 * lread.c (syms_of_lread): Mention single symbols defined by
3311 `defvar' or `defconst' (bug#7154).
3312
61352f62 3313 * fns.c (Frequire): Mention .el.gz files (bug#7314).
7b3747f9 3314 (Frequire): Mention get-load-suffixes.
61352f62 3315
28545e04
MR
33162011-07-02 Martin Rudalics <rudalics@gmx.at>
3317
3318 * window.h (window): Remove clone_number slot.
3319 * window.c (Fwindow_clone_number, Fset_window_clone_number):
3320 Remove.
3321 (make_parent_window, make_window, saved_window)
3322 (Fset_window_configuration, save_window_save): Don't deal with
3323 clone numbers.
3324 * buffer.c (Qclone_number): Remove declaration.
3325 (sort_overlays, overlay_strings): Don't deal with clone numbers.
3326
3349e122
SM
33272011-07-02 Stefan Monnier <monnier@iro.umontreal.ca>
3328
3329 Add multiple inheritance to keymaps.
3330 * keymap.c (Fmake_composed_keymap): New function.
3331 (Fset_keymap_parent): Simplify.
3332 (fix_submap_inheritance): Remove.
3333 (access_keymap_1): New function extracted from access_keymap to handle
3334 embedded parents and handle lists of maps.
3335 (access_keymap): Use it.
3336 (Fkeymap_prompt, map_keymap_internal, map_keymap, store_in_keymap)
3337 (Fcopy_keymap): Handle embedded parents.
3338 (Fcommand_remapping, define_as_prefix): Simplify.
3339 (Fkey_binding): Simplify.
3340 (syms_of_keymap): Move minibuffer-local-completion-map,
3341 minibuffer-local-filename-completion-map,
3342 minibuffer-local-must-match-map, and
3343 minibuffer-local-filename-must-match-map to Elisp.
3344 (syms_of_keymap): Defsubr make-composed-keymap.
3345 * keyboard.c (menu_bar_items): Use map_keymap_canonical.
3346 (parse_menu_item): Trivial simplification.
3347
3279eb87
GM
33482011-07-01 Glenn Morris <rgm@gnu.org>
3349
3350 * Makefile.in (SETTINGS_LIBS): Fix typo.
3351
4550efdf
KI
33522011-07-01 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny patch)
3353
3354 * coding.c (Fencode_coding_string): Record the last coding system
3355 used, as the function doc string says (bug#8738).
3356
0949d2b6
JD
33572011-07-01 Jan Djärv <jan.h.d@swipnet.se>
3358
3359 * xsettings.c (store_monospaced_changed): Take new font as arg and
3360 check for change against current_mono_font.
3361 (EMACS_TYPE_SETTINGS): Remove this and related defines.
3362 (emacs_settings_constructor, emacs_settings_get_property)
3363 (emacs_settings_set_property, emacs_settings_class_init)
3364 (emacs_settings_init, gsettings_obj): Remove.
3365 (something_changedCB): New function for HAVE_GSETTINGS.
3366 (something_changedCB): HAVE_GCONF: Call store_monospaced_changed
3367 with value as argument.
3368 (init_gsettings): Check that GSETTINGS_SCHEMA exists before calling
3369 g_settings_new (Bug#8967). Do not create gsettings_obj.
9173deec 3370 Remove calls to g_settings_bind. Connect something_changedCB to
0949d2b6
JD
3371 "changed".
3372
3373 * xgselect.c: Add defined (HAVE_GSETTINGS).
3374 (xgselect_initialize): Ditto.
3375
3376 * process.c: Add defined (HAVE_GSETTINGS) for xgselect.h
3377 (wait_reading_process_output): Add defined (HAVE_GSETTINGS) for
3378 xg_select.
3379
bbc6b304
PE
33802011-07-01 Paul Eggert <eggert@cs.ucla.edu>
3381
3382 * eval.c (struct backtrace): Simplify and port the data structure.
3383 Do not assume that "int nargs : BITS_PER_INT - 2;" produces a
3384 signed bit field, as this assumption is not portable and it makes
3385 Emacs crash when compiled with Sun C 5.8 on sparc. Do not use
3386 "char debug_on_exit : 1" as this is not portable either; instead,
3387 use the portable "unsigned int debug_on_exit : 1". Remove unused
3388 member evalargs. Remove obsolete comments about cc bombing out.
3389
9851bfc5
JD
33902011-06-30 Jan Djärv <jan.h.d@swipnet.se>
3391
51bb811f 3392 * xsettings.c: Include glib-object.h, gio/gio.h if HAVE_GSETTINGS.
9851bfc5
JD
3393 Let HAVE_GSETTINGS override HAVE_GCONF.
3394 (store_monospaced_changed): New function.
3395 (EMACS_SETTINGS): A new type derived from GObject to handle
3396 GSettings notifications.
3397 (emacs_settings_constructor, emacs_settings_get_property)
3398 (emacs_settings_set_property, emacs_settings_class_init):
3399 New functions.
3400 (gsettings_client, gsettings_obj): New variables.
3401 (GSETTINGS_SCHEMA): New define.
3402 (something_changedCB): Call store_monospaced_changed.
3403 (init_gsettings): New function.
3404 (xsettings_initialize): Call init_gsettings.
3405 (syms_of_xsettings): Initialize gsettings_client, gsettings_obj
3406 to NULL.
3407
640c8776 3408 * Makefile.in (SETTINGS_CFLAGS, SETTINGS_LIBS): Rename from
9851bfc5
JD
3409 GCONF_CFLAGS/LIBS.
3410
5386012d
MR
34112011-06-29 Martin Rudalics <rudalics@gmx.at>
3412
3413 * window.c (resize_root_window, grow_mini_window)
3414 (shrink_mini_window): Rename Qresize_root_window to
3415 Qwindow_resize_root_window and Qresize_root_window_vertically to
3416 Qwindow_resize_root_window_vertically.
3417
f13e0b08
PE
34182011-06-28 Paul Eggert <eggert@cs.ucla.edu>
3419
3420 * gnutls.c (Qgnutls_bootprop_verify_error): Remove unused var.
3421
94515237
JB
34222011-06-27 Juanma Barranquero <lekktu@gmail.com>
3423
3424 * makefile.w32-in: Redesign dependencies so they reflect more
3425 clearly which files are directly included by each source file,
3426 and not through other includes.
3427
e43b6e43
MR
34282011-06-27 Martin Rudalics <rudalics@gmx.at>
3429
3430 * buffer.c (Qclone_number): Declare static and DEFSYM it.
3431 (sort_overlays, overlay_strings): When an overlay's clone number
3432 matches the window's clone number process the overlay even if
3433 the overlay's window property doesn't match the current window.
3434
d68443dc
MR
3435 * window.c (Fwindow_vchild): Rename to Fwindow_top_child.
3436 (Fwindow_hchild): Rename to Fwindow_left_child.
3437 (Fwindow_next): Rename to Fwindow_next_sibling.
3438 (Fwindow_prev): Rename to Fwindow_prev_sibling.
d615d6d2
MR
3439 (resize_window_check): Rename to window_resize_check.
3440 (resize_window_apply): Rename to window_resize_apply.
3441 (Fresize_window_apply): Rename to Fwindow_resize_apply.
3442 (Fdelete_other_windows_internal, resize_frame_windows)
3443 (Fsplit_window_internal, Fdelete_window_internal)
3444 (grow_mini_window, shrink_mini_window)
3445 (Fresize_mini_window_internal): Fix callers accordingly.
d68443dc 3446
c7e73be5
JD
34472011-06-26 Jan Djärv <jan.h.d@swipnet.se>
3448
3449 * emacsgtkfixed.h: State that this is only used with Gtk+3.
3450 (emacs_fixed_set_min_size): Remove.
3451 (emacs_fixed_new): Take frame as argument.
3452
3453 * emacsgtkfixed.c: State that this is only used with Gtk+3.
3454 (_EmacsFixedPrivate): Remove minwidth/height.
3455 Add struct frame *f.
3456 (emacs_fixed_init): Initialize priv->f.
3457 (get_parent_class, emacs_fixed_set_min_size): Remove.
3458 (emacs_fixed_new): Set priv->f to argument.
3459 (emacs_fixed_get_preferred_width)
3460 (emacs_fixed_get_preferred_height): Use min_width/height from
3461 frames size_hint to set minimum and natural (Bug#8919).
3462 (XSetWMSizeHints, XSetWMNormalHints): Override these functions
3463 and use min_width/height from frames size_hint to set
3464 min_width/height (Bug#8919).
3465
3466 * gtkutil.c (xg_create_frame_widgets): Pass f to emacs_fixed_new.
9173deec
JB
3467 (x_wm_set_size_hint): Remove call to emacs_fixed_set_min_size.
3468 Fix indentation.
c7e73be5 3469
cf99dcf8
EZ
34702011-06-26 Eli Zaretskii <eliz@gnu.org>
3471
3472 * bidi.c (bidi_paragraph_init): Test for ZV_BYTE before calling
3473 bidi_at_paragraph_end, since fast_looking_at doesn't like to be
3474 called at ZV.
3475
029529ac
CY
34762011-06-26 Chong Yidong <cyd@stupidchicken.com>
3477
3478 * process.c (wait_reading_process_output): Bypass select if
3479 waiting for a cell while ignoring keyboard input, and input is
3480 pending. Suggested by Jan Djärv (Bug#8869).
3481
7a7ef429
PE
34822011-06-25 Paul Eggert <eggert@cs.ucla.edu>
3483
3484 Use gnulib's dup2 module instead of rolling our own.
3485 * sysdep.c (dup2) [!HAVE_DUP2]: Remove; gnulib now does this.
3486
11fdef7d 34872011-06-25 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
989b42d2
YM
3488
3489 * dispnew.c (scrolling_window): Before scrolling, turn off a
3490 mouse-highlight in the window being scrolled.
3491
cd3520a4
JB
34922011-06-24 Juanma Barranquero <lekktu@gmail.com>
3493
3494 Move DEFSYM to lisp.h and use everywhere.
3495
3496 * character.h (DEFSYM): Move declaration...
3497 * lisp.h (DEFSYM): ...here.
3498
3499 * gnutls.c:
3500 * minibuf.c:
3501 * w32menu.c:
3502 * w32proc.c:
3503 * w32select.c: Don't include character.h.
3504
3505 * alloc.c (syms_of_alloc):
3506 * buffer.c (syms_of_buffer):
3507 * bytecode.c (syms_of_bytecode):
3508 * callint.c (syms_of_callint):
3509 * casefiddle.c (syms_of_casefiddle):
3510 * casetab.c (init_casetab_once):
3511 * category.c (init_category_once, syms_of_category):
3512 * ccl.c (syms_of_ccl):
3513 * cmds.c (syms_of_cmds):
3514 * composite.c (syms_of_composite):
3515 * dbusbind.c (syms_of_dbusbind):
3516 * dired.c (syms_of_dired):
3517 * dispnew.c (syms_of_display):
3518 * doc.c (syms_of_doc):
3519 * editfns.c (syms_of_editfns):
3520 * emacs.c (syms_of_emacs):
3521 * eval.c (syms_of_eval):
3522 * fileio.c (syms_of_fileio):
3523 * fns.c (syms_of_fns):
3524 * frame.c (syms_of_frame):
3525 * fringe.c (syms_of_fringe):
3526 * insdel.c (syms_of_insdel):
3527 * keymap.c (syms_of_keymap):
3528 * lread.c (init_obarray, syms_of_lread):
3529 * macros.c (syms_of_macros):
3530 * msdos.c (syms_of_msdos):
3531 * print.c (syms_of_print):
3532 * process.c (syms_of_process):
3533 * search.c (syms_of_search):
3534 * sound.c (syms_of_sound):
3535 * syntax.c (init_syntax_once, syms_of_syntax):
3536 * terminal.c (syms_of_terminal):
3537 * textprop.c (syms_of_textprop):
3538 * undo.c (syms_of_undo):
3539 * w32.c (globals_of_w32):
3540 * window.c (syms_of_window):
3541 * xdisp.c (syms_of_xdisp):
3542 * xfaces.c (syms_of_xfaces):
3543 * xfns.c (syms_of_xfns):
3544 * xmenu.c (syms_of_xmenu):
3545 * xsettings.c (syms_of_xsettings):
3546 * xterm.c (syms_of_xterm): Use DEFSYM.
3547
4228cf16
TZ
35482011-06-24 Teodor Zlatanov <tzz@lifelogs.com>
3549
cd3520a4 3550 * gnutls.c (syms_of_gnutls): Use the DEFSYM macro from character.h.
4228cf16 3551
7fcccf1e
PE
35522011-06-23 Paul Eggert <eggert@cs.ucla.edu>
3553
7efb4e0e
PE
3554 Integer and buffer overflow fixes (Bug#8873).
3555
ff5844ad
PE
3556 * print.c (printchar, strout): Check for string overflow.
3557 (PRINTPREPARE, printchar, strout):
3558 Don't set size unless allocation succeeds.
3559
90532f02
PE
3560 * minibuf.c (read_minibuf_noninteractive): Use ptrdiff_t, not int,
3561 for sizes. Check for string overflow more accurately.
3562 Simplify newline removal at end; this suppresses a GCC 4.6.0 warning.
3563
6d84508d
PE
3564 * macros.c: Integer and buffer overflow fixes.
3565 * keyboard.h (struct keyboard.kbd_macro_bufsize):
3566 * macros.c (Fstart_kbd_macro, store_kbd_macro_char):
3567 Use ptrdiff_t, not int, for sizes.
3568 Don't increment bufsize until after realloc succeeds.
3569 Check for size-calculation overflow.
3570 (Fstart_kbd_macro): Use EMACS_INT, not int, for XINT result.
3571
437b2cb4
PE
3572 * lisp.h (DEFVAR_KBOARD): Use offsetof instead of char * finagling.
3573
8b9ac8b4
PE
3574 * lread.c: Integer overflow fixes.
3575 (read_integer): Radix is now EMACS_INT, not int,
3576 to improve quality of diagnostics for out-of-range radices.
3577 Calculate buffer size correctly for out-of-range radices.
3578 (read1): Check for integer overflow in radices, and in
3579 read-circle numbers.
82cb60d3
PE
3580 (read_escape): Avoid int overflow.
3581 (Fload, openp, read_buffer_size, read1)
3582 (substitute_object_recurse, read_vector, read_list, map_obarray):
3583 Use ptrdiff_t, not int, for sizes.
3584 (read1): Use EMACS_INT, not int, for sizes.
20270765 3585 Check for size overflow.
8b9ac8b4 3586
7fcccf1e
PE
3587 * image.c (cache_image): Check for size arithmetic overflow.
3588
bfbbd7e7
PE
3589 * lread.c: Integer overflow issues.
3590 (saved_doc_string_size, saved_doc_string_length)
3591 (prev_saved_doc_string_size, prev_saved_doc_string_length):
3592 Now ptrdiff_t, not int.
3593 (read1): Don't assume doc string length fits in int. Check for
3594 out-of-range doc string lengths.
3595 (read_list): Don't assume file position fits in int.
39019e54 3596 (read_escape): Check for hex character overflow.
bfbbd7e7 3597
4e323265
LL
35982011-06-22 Leo Liu <sdl.web@gmail.com>
3599
3600 * minibuf.c (Fcompleting_read_default, Vcompleting_read_function):
3601 Move to minibuffer.el.
3602
85fece3e
PE
36032011-06-22 Paul Eggert <eggert@cs.ucla.edu>
3604
20b84ce9 3605 Fixes for GLYPH_DEBUG found by GCC 4.6.0 static checking.
85fece3e
PE
3606 The following patches are for when GLYPH_DEBUG && !XASSERT.
3607 * dispextern.h (trace_redisplay_p, dump_glyph_string):
3608 * dispnew.c (flush_stdout):
3609 * xdisp.c (dump_glyph_row, dump_glyph_matrix, dump_glyph):
3610 Mark as externally visible.
3611 * dispnew.c (check_window_matrix_pointers): Now static.
3612 * dispnew.c (window_to_frame_vpos):
3613 * xfns.c (unwind_create_frame):
3614 * xterm.c (x_check_font): Remove unused local.
3615 * scroll.c (CHECK_BOUNDS):
3616 * xfaces.c (cache_fache): Rename local to avoid shadowing.
3617 * xfns.c, w32fns.c (image_cache_refcount, dpyinfo_refcount): Now static.
3618 * xdisp.c (check_window_end): Now a no-op if !XASSERTS.
3619 (debug_first_unchanged_at_end_vpos, debug_last_unchanged_at_beg_vpos)
3620 (debug_dvpos, debug_dy, debug_delta, debug_delta_bytes, debug_end_vpos):
3621 Now static.
3622 (debug_method_add): Use va_list and vsprintf rather than relying
3623 on undefined behavior with wrong number of arguments.
3624 (dump_glyph, dump_glyph_row, Fdump_glyph_matrix):
3625 Don't assume ptrdiff_t and EMACS_INT are the same width as int.
3626 In this code, it's OK to assume C99 behavior for ptrdiff_t formats
3627 since we're not interested in debugging glyphs with old libraries.
3628 * xfaces.c (cache_face): Move debugging code earlier; this pacifies
3629 GCC 4.6.0's static checking.
3630
0766b489
PE
36312011-06-22 Paul Eggert <eggert@cs.ucla.edu>
3632
31fd4b32
PE
3633 Integer overflow and signedness fixes (Bug#8873).
3634 A few related buffer overrun fixes, too.
3635
b79e8648
PE
3636 * font.c (font_score): Use EMACS_INT, not int, to store XINT value.
3637
0766b489
PE
3638 * dispextern.h (struct face.stipple):
3639 * image.c (x_bitmap_height, x_bitmap_width, x_bitmap_pixmap)
3640 (x_bitmap_mask, x_allocate_bitmap_record)
3641 (x_create_bitmap_from_data, x_create_bitmap_from_file)
3642 (x_destroy_bitmap, x_destroy_all_bitmaps, x_create_bitmap_mask)
3643 (x_create_bitmap_from_xpm_data):
3644 * nsterm.h (struct ns_display_info.bitmaps_size, .bitmaps_last):
3645 * w32term.h (struct w32_display_info.icon_bitmap_id, .bitmaps_size)
3646 (.bitmaps_last):
3647 * xfaces.c (load_pixmap):
3648 * xterm.c (x_bitmap_icon, x_wm_set_icon_pixmap):
3649 * xterm.h (struct x_display_info.icon_bitmap_id, .bitmaps_size)
3650 (.bitmaps_last, struct x_output.icon_bitmap):
3651 Use ptrdiff_t, not int, for bitmap indexes.
3652 (x_allocate_bitmap_record): Check for size overflow.
3653 * dispextern.h, lisp.h: Adjust to API changes elsewhere.
3654
b081724f
PE
3655 Use ptrdiff_t, not int, for overlay counts.
3656 * buffer.h (overlays_at, sort_overlays, GET_OVERLAYS_AT):
3657 * editfns.c (overlays_around, get_pos_property):
3658 * textprop.c (get_char_property_and_overlay):
3659 * xdisp.c (next_overlay_change, note_mouse_highlight):
3660 * xfaces.c (face_at_buffer_position):
21514da7
PE
3661 * buffer.c (OVERLAY_COUNT_MAX): New macro.
3662 (overlays_at, overlays_in, sort_overlays, Foverlays_at)
3663 (Fnext_overlay_change, Fprevious_overlay_change)
3664 (mouse_face_overlay_overlaps, Foverlays_in):
b081724f 3665 Use ptrdiff_t, not int, for sizes.
21514da7 3666 (overlays_at, overlays_in): Check for size-calculation overflow.
b081724f 3667
3de73e5e
PE
3668 * xterm.c (xim_initialize, same_x_server): Strlen may not fit in int.
3669
2606c57b
PE
3670 * xsmfns.c (smc_save_yourself_CB, x_session_initialize): Avoid strlen.
3671 (x_session_initialize): Do not assume string length fits in int.
3672
aaafe47a
PE
3673 * xsettings.c (apply_xft_settings): Fix potential buffer overrun.
3674 This is unlikely, but can occur if DPI is outlandish.
3675
2674ddc8 3676 * xsettings.c (Ffont_get_system_normal_font, Ffont_get_system_font):
3a5077c5
PE
3677 * xselect.c (Fx_get_atom_name): Avoid need for strlen.
3678
28154962
PE
3679 * xrdb.c: Don't assume strlen fits in int; avoid some strlens.
3680 * xrdb.c (magic_file_p, search_magic_path):
3681 Omit last arg SUFFIX; it was always 0. All callers changed.
3682 (magic_file_p): Use ptrdiff_t, not int. Check for size overflow.
3683
7de51af5
PE
3684 * xfont.c (xfont_match): Avoid need for strlen.
3685
25ed6cc3
PE
3686 * xfns.c: Don't assume strlen fits in int.
3687 (xic_create_fontsetname, x_window): Use ptrdiff_t, not int.
3688
4eab31dd
PE
3689 * xdisp.c (message_log_check_duplicate): Return intmax_t,
3690 not unsigned long, as we prefer signed integers. All callers changed.
3691 Detect integer overflow in repeat count.
3692 (message_dolog): Don't assume print length fits in 39 bytes.
df1f27af 3693 (display_mode_element): Don't assume strlen fits in int.
4eab31dd 3694
171e2a58
PE
3695 * termcap.c: Don't assume sizes fit in int and never overflow.
3696 (struct termcap_buffer, tgetent): Use ptrdiff_t, not int, for sizes.
3697 (gobble_line): Check for size-calculation overflow.
3698
ad39faca 3699 * minibuf.c (Fread_buffer):
6e5bb2dc 3700 * lread.c (intern, intern_c_string):
74ca2eb3
PE
3701 * image.c (xpm_scan) [HAVE_NS && !HAVE_XPM]:
3702 Don't assume string length fits in int.
3703
52c61c22 3704 * keyboard.c (parse_tool_bar_item):
9bda3520
PE
3705 * gtkutil.c (style_changed_cb): Avoid need for strlen.
3706
b5b8c9e5
PE
3707 * font.c: Don't assume string length fits in int.
3708 (font_parse_xlfd, font_parse_fcname, font_unparse_fcname):
3709 Use ptrdiff_t, not int.
ccd6111c
PE
3710 (font_intern_prop): Don't assume string length fits in int.
3711 Don't assume integer property fits in fixnum.
3712 * font.h (font_intern_prop): 2nd arg is now ptrdiff_t, not int.
b5b8c9e5 3713
882f0d81 3714 * filelock.c: Fix some buffer overrun and integer overflow issues.
51cab52b 3715 (get_boot_time): Don't assume gzip command string fits in 100 bytes.
882f0d81
PE
3716 Reformulate so as not to need the command string.
3717 Invoke gzip -cd rather than gunzip, as it's more portable.
3718 (lock_info_type, lock_file_1, lock_file):
3719 Don't assume pid_t and time_t fit in unsigned long.
3720 (LOCK_PID_MAX): Remove; we now use more-reliable bounds.
3721 (current_lock_owner): Prefer signed type for sizes.
3722 Use memcpy, not strncpy, where memcpy is what is really wanted.
3723 Don't assume (via atoi) that time_t and pid_t fit in int.
3724 Check for time_t and/or pid_t out of range, e.g., via a network share.
3725 Don't alloca where an auto var works fine.
3726
93f4cf88
PE
3727 * fileio.c: Fix some integer overflow issues.
3728 (file_name_as_directory, Fexpand_file_name, Fsubstitute_in_file_name):
3729 Don't assume string length fits in int.
3730 (directory_file_name): Don't assume string length fits in long.
3731 (make_temp_name): Don't assume pid fits in int, or that its print
3732 length is less than 20.
3733
f3e92b69
PE
3734 * data.c (Fsubr_name): Rewrite to avoid a strlen call.
3735
1bfdaf10
PE
3736 * coding.c (make_subsidiaries): Don't assume string length fits in int.
3737
35016e9a
PE
3738 * callproc.c (child_setup): Rewrite to avoid two strlen calls.
3739
3d1e65a1
PE
3740 * process.c (Fformat_network_address): Use EMACS_INT, not EMACS_UINT.
3741 We prefer signed integers, even for size calculations.
3742
0b963a93
PE
3743 * emacs.c: Don't assume string length fits in 'int'.
3744 (DEFINE_DUMMY_FUNCTION, sort_args): Use ptrdiff_t, not int.
3745 (main): Don't invoke strlen when not needed.
3746
573f4b54
PE
3747 * dbusbind.c (XD_ERROR): Don't arbitrarily truncate string.
3748 (XD_DEBUG_MESSAGE): Don't waste a byte.
3749
989f33ba
PE
3750 * callproc.c (getenv_internal_1, getenv_internal)
3751 (Fgetenv_internal):
965d34eb
PE
3752 * buffer.c (init_buffer): Don't assume string length fits in 'int'.
3753
e4d29b33
PE
3754 * lread.c (invalid_syntax): Omit length argument.
3755 All uses changed. This doesn't fix a bug, but it simplifies the
3756 code away from its former Hollerith-constant appearance, and it's
3757 one less 'int' to worry about when looking at integer-overflow issues.
51cab52b 3758 (string_to_number): Simplify 2011-04-26 change by invoking xsignal1.
e4d29b33 3759
eb49b136
PE
3760 * lisp.h (DEFUN): Remove bogus use of sizeof (struct Lisp_Subr).
3761 This didn't break anything, but it didn't help either.
3762 It's confusing to put a bogus integer in a place where the actual
3763 value does not matter.
9f62aeb1 3764 (LIST_END_P): Remove unused macro and its bogus comment.
cbeff735 3765 (make_fixnum_or_float): Remove unnecessary cast to EMACS_INT.
eb49b136 3766
15375a22
PE
3767 * lisp.h (union Lisp_Object.i): EMACS_INT, not EMACS_UINT.
3768 This is for consistency with the ordinary, non-USE_LISP_UNION_TYPE,
3769 implementation.
b61cc01c
PE
3770 (struct Lisp_Bool_Vector.size): EMACS_INT, not EMACS_UINT.
3771 We prefer signed types, and the value cannot exceed the EMACS_INT
3772 range anyway (because otherwise the length would not be representable).
9a8e8d9b
PE
3773 (XSET) [USE_LISP_UNION_TYPE]: Use uintptr_t and intptr_t,
3774 not EMACS_UINT and EMACS_INT, when converting pointer to integer.
3775 This avoids a GCC warning when WIDE_EMACS_INT.
15375a22 3776
53b2623d
PE
3777 * indent.c (sane_tab_width): New function.
3778 (current_column, scan_for_column, Findent_to, position_indentation)
3779 (compute_motion): Use it. This is just for clarity.
8fcaf9cc 3780 (Fcompute_motion): Don't assume hscroll and tab offset fit in int.
53b2623d 3781
51cab52b 3782 * image.c (xbm_image_p): Don't assume stated width, height fit in int.
45aebb64 3783
f2ed8a70
PE
3784 * lisp.h (lint_assume): New macro.
3785 * composite.c (composition_gstring_put_cache):
3786 * ftfont.c (ftfont_shape_by_flt): Use it to pacify GCC 4.6.0.
3787
abe80cc6
PE
3788 * editfns.c, insdel.c:
3789 Omit unnecessary forward decls, to simplify future changes.
a9e860e1 3790
b02c740e
PE
3791 * ftfont.c (ftfont_shape_by_flt): Use signed integers for lengths.
3792
ebc96716
PE
3793 * font.c (Ffont_shape_gstring): Don't assume glyph len fits in 'int'.
3794
b4e50fa0 3795 * fns.c (Ffillarray): Don't assume bool vector size fits in 'int'.
f03dc6ef 3796 Use much-faster test for byte-length change.
311d5d7c 3797 Don't assume string byte-length fits in 'int'.
a4cf38e4 3798 Check that character arg fits in 'int'.
85461888 3799 (mapcar1): Declare byte as byte, for clarity.
b4e50fa0 3800
c0c1ee9f
PE
3801 * alloc.c (Fmake_bool_vector): Avoid unnecessary multiplication.
3802
a498d7f4
PE
3803 * fns.c (concat): Catch string overflow earlier.
3804 Do not rely on integer wraparound.
3805
51cab52b
PE
3806 * dispextern.h (struct it.overlay_strings_charpos)
3807 (struct it.selective): Now EMACS_INT, not int.
87830974
PE
3808 * xdisp.c (forward_to_next_line_start)
3809 (back_to_previous_visible_line_start)
3810 (reseat_at_next_visible_line_start, next_element_from_buffer):
3811 Don't arbitrarily truncate the value of 'selective' to int.
3812
76031fad
PE
3813 * xdisp.c (init_iterator): Use XINT, not XFASTINT; it might be < 0.
3814
5eb55db9
PE
3815 * composite.c: Don't truncate sizes to 'int'.
3816 (composition_gstring_p, composition_reseat_it)
3817 (composition_adjust_point): Use EMACS_INT, not int.
7d100a81
PE
3818 (get_composition_id, composition_gstring_put_cache): Use EMACS_INT,
3819 not EMACS_UINT, for indexes.
5eb55db9 3820
0703a717
PE
3821 * category.h (CATEGORY_SET_P): Remove unnecessary cast to EMACS_INT.
3822
d6202519
PE
3823 * buffer.c: Include <verify.h>.
3824 (struct sortvec.priority, struct sortstr.priority):
8961a454 3825 Now EMACS_INT, not int.
c20998a7 3826 (compare_overlays, cmp_for_strings): Avoid subtraction overflow.
67c36fce
PE
3827 (struct sortstr.size, record_overlay_string)
3828 (struct sortstrlist.size, struct sortlist.used):
3829 Don't truncate size to int.
3830 (record_overlay_string): Check for size-calculation overflow.
d6202519 3831 (init_buffer_once): Check at compile-time, not run-time.
fadf4e30 3832
d5a19415
JM
38332011-06-22 Jim Meyering <meyering@redhat.com>
3834
029529ac 3835 Don't leak an XBM-image-sized buffer
d5a19415
JM
3836 * image.c (xbm_load): Free the image buffer after using it.
3837
a9041e6c
PE
38382011-06-21 Paul Eggert <eggert@cs.ucla.edu>
3839
3840 Port to Sun C.
3841 * composite.c (find_automatic_composition): Omit needless 'return 0;'
3842 that Sun C diagnosed.
3843 * fns.c (secure_hash): Fix pointer signedness issue.
3844 * intervals.c (static_offset_intervals): New function.
3845 (offset_intervals): Use it.
3846
7f3f739f
LL
38472011-06-21 Leo Liu <sdl.web@gmail.com>
3848
3849 * deps.mk (fns.o):
3850 * makefile.w32-in ($(BLD)/fns.$(O)): Include sha256.h and
3851 sha512.h.
3852
3853 * fns.c (secure_hash): Rename from crypto_hash_function and change
3854 the first arg to accept symbols.
5b66d427 3855 (Fsecure_hash): New primitive.
7f3f739f
LL
3856 (syms_of_fns): New symbols.
3857
76147d94
DD
38582011-06-20 Deniz Dogan <deniz@dogan.se>
3859
3860 * process.c (Fset_process_buffer): Clarify return value in
3861 docstring.
3862
7d7d0045
CY
38632011-06-18 Chong Yidong <cyd@stupidchicken.com>
3864
3865 * dispnew.c (add_window_display_history): Use BVAR.
3866
3867 * xdisp.c (debug_method_add): Use BVAR.
3868 (check_window_end, dump_glyph_matrix, dump_glyph)
3869 (dump_glyph_row, dump_glyph_string): Convert arglist to ANSI C.
3870
3871 * xfaces.c (check_lface_attrs, check_lface, dump_realized_face):
3872 Likewise.
3873
3874 * xfns.c (Fx_create_frame, x_create_tip_frame): Delay image cache
3875 check till after the cache is created in init_frame_faces.
3876
ff2bc410
SM
38772011-06-17 Stefan Monnier <monnier@iro.umontreal.ca>
3878
3879 * fns.c (Fsafe_length): Yet another int/Lisp_Object mixup.
3880
28177add
PE
38812011-06-16 Paul Eggert <eggert@cs.ucla.edu>
3882
dd3482fe
PE
3883 * lisp.h: Include <limits.h>, for INT_MAX, LONG_MAX, LLONG_MAX.
3884 Without this, prin1 mishandles Lisp_Misc_Save_Value printing on
3885 hosts with pre-C99 libraries, because pD is wrongly defined to "t".
3886
393d71f3 3887 Improve buffer-overflow checking (Bug#8873).
1c8e352f
PE
3888 * fileio.c (Finsert_file_contents):
3889 * insdel.c (insert_from_buffer_1, replace_range, replace_range_2):
3890 Remove the old (too-loose) buffer overflow checks.
3891 They weren't needed, since make_gap checks for buffer overflow.
3892 * insdel.c (make_gap_larger): Catch buffer overflows that were missed.
3893 The old code merely checked for Emacs fixnum overflow, and relied
3894 on undefined (wraparound) behavior. The new code avoids undefined
3895 behavior, and also checks for ptrdiff_t and/or size_t overflow.
3896
2e6813b0 3897 * editfns.c (Finsert_char): Don't dump core with very negative counts.
21d890a4
PE
3898 Tune. Don't use wider integers than needed. Don't use alloca.
3899 Use a bigger 'string' buffer. Rewrite to avoid 'n > 0' test.
2e6813b0 3900
599a9e4f
PE
3901 * insdel.c (replace_range): Fix buf overflow when insbytes < outgoing.
3902
99561444
PE
3903 * insdel.c, lisp.h (buffer_overflow): New function.
3904 (insert_from_buffer_1, replace_range, replace_range_2):
3905 * insdel.c (make_gap_larger):
3906 * editfns.c (Finsert_char):
3907 * fileio.c (Finsert_file_contents): Use it, to normalize wording.
3908
28177add
PE
3909 * buffer.h (BUF_BYTES_MAX): Cast to ptrdiff_t so that it's signed.
3910
e69dafad
PE
39112011-06-15 Paul Eggert <eggert@cs.ucla.edu>
3912
a7af7fde 3913 Integer overflow and signedness fixes (Bug#8873).
ff672d2c 3914
b1c46f02
PE
3915 * ccl.c (ASCENDING_ORDER): New macro, to work around GCC bug 43772.
3916 (GET_CCL_RANGE, IN_INT_RANGE): Use it.
3917
e69dafad
PE
3918 * fileio.c: Don't assume EMACS_INT fits in off_t.
3919 (emacs_lseek): New static function.
3920 (Finsert_file_contents, Fwrite_region): Use it.
3921 Use SEEK_SET, SEEK_CUR, SEEK_END as appropriate.
3922
566684ea
PE
3923 * fns.c (Fload_average): Don't assume 100 * load average fits in int.
3924
e6966cd6
PE
3925 * fns.c: Don't overflow int when computing a list length.
3926 * fns.c (QUIT_COUNT_HEURISTIC): New constant.
3927 (Flength, Fsafe_length): Use EMACS_INT, not int, to avoid unwanted
3928 truncation on 64-bit hosts. Check for QUIT every
3929 QUIT_COUNT_HEURISTIC entries rather than every other entry; that's
3930 faster and is responsive enough.
3931 (Flength): Report an error instead of overflowing an integer.
3932 (Fsafe_length): Return a float if the value is not representable
3933 as a fixnum. This shouldn't happen except in contrived situations.
6346d301 3934 (Fnthcdr, Fsort): Don't assume list length fits in int.
de41a810 3935 (Fcopy_sequence): Don't assume vector length fits in int.
00c604f2 3936
dd0b0efb
PE
3937 * alloc.c: Check that resized vectors' lengths fit in fixnums.
3938 (header_size, word_size): New constants.
3939 (allocate_vectorlike): Don't check size overflow here.
3940 (allocate_vector): Check it here instead, since this is the only
3941 caller of allocate_vectorlike that could cause overflow.
3942 Check that the new vector's length is representable as a fixnum.
3943
86fe5cfe
PE
3944 * fns.c (next_almost_prime): Don't return a multiple of 3 or 5.
3945 The previous code was bogus. For example, next_almost_prime (32)
3946 returned 39, which is undesirable as it is a multiple of 3; and
3947 next_almost_prime (24) returned 25, which is a multiple of 5 so
3948 why was the code bothering to check for multiples of 7?
3949
80e88859
PE
3950 * bytecode.c (exec_byte_code): Use ptrdiff_t, not int, for vector length.
3951
4a2f0ad6
PE
3952 * eval.c, doprnt.c (SIZE_MAX): Remove; inttypes.h defines this now.
3953
f66c7cf8
PE
3954 Variadic C functions now count arguments with ptrdiff_t.
3955 This partly undoes my 2011-03-30 change, which replaced int with size_t.
3956 Back then I didn't know that the Emacs coding style prefers signed int.
3957 Also, in the meantime I found a few more instances where arguments
4a2f0ad6
PE
3958 were being counted with int, which may truncate counts on 64-bit
3959 machines, or EMACS_INT, which may be unnecessarily wide.
f66c7cf8
PE
3960 * lisp.h (struct Lisp_Subr.function.aMANY)
3961 (DEFUN_ARGS_MANY, internal_condition_case_n, safe_call):
3962 Arg counts are now ptrdiff_t, not size_t.
3963 All variadic functions and their callers changed accordingly.
3964 (struct gcpro.nvars): Now size_t, not size_t. All uses changed.
3965 * bytecode.c (exec_byte_code): Check maxdepth for overflow,
3966 to avoid potential buffer overrun. Don't assume arg counts fit in 'int'.
3967 * callint.c (Fcall_interactively): Check arg count for overflow,
3968 to avoid potential buffer overrun. Use signed char, not 'int',
3969 for 'varies' array, so that we needn't bother to check its size
3970 calculation for overflow.
3971 * editfns.c (Fformat): Use ptrdiff_t, not EMACS_INT, to count args.
3972 * eval.c (apply_lambda):
3973 * fns.c (Fmapconcat): Use XFASTINT, not XINT, to get args length.
3974 (struct textprop_rec.argnum): Now ptrdiff_t, not int. All uses changed.
3975 (mapconcat): Use ptrdiff_t, not int and EMACS_INT, to count args.
3976
a1759b76
PE
3977 * callint.c (Fcall_interactively): Don't use index var as event count.
3978
d96be9fc
PE
3979 * vm-limit.c (check_memory_limits): Fix incorrect extern function decls.
3980 * mem-limits.h (SIZE): Remove; no longer used.
3981
a690a978 3982 * xterm.c (x_alloc_nearest_color_1): Prefer int to long when int works.
5efd304b 3983
578c21e6
PE
3984 Remove unnecessary casts.
3985 * xterm.c (x_term_init):
3986 * xfns.c (x_set_border_pixel):
3987 * widget.c (create_frame_gcs): Remove casts to unsigned long etc.
3988 These aren't needed now that we assume ANSI C.
3989
96f53c6c
PE
3990 * sound.c (Fplay_sound_internal): Remove cast to unsigned long.
3991 It's more likely to cause problems (due to unsigned overflow)
3992 than to cure them.
3993
83c77d31
PE
3994 * dired.c (Ffile_attributes): Don't use 32-bit hack on 64-bit hosts.
3995
ee2079f1
PE
3996 * unexelf.c (unexec): Don't assume BSS addr fits in unsigned.
3997
6da65536
PE
3998 * xterm.c (handle_one_xevent): Omit unnecessary casts to unsigned.
3999
7147c4a4
PE
4000 * keyboard.c (modify_event_symbol): Don't limit alist len to UINT_MAX.
4001
193e32d9
PE
4002 * lisp.h (CHAR_TABLE_SET): Omit now-redundant test.
4003
e5533da6
PE
4004 * lread.c (Fload): Don't compare a possibly-garbage time_t value.
4005
9910e595
PE
4006 GLYPH_CODE_FACE returns EMACS_INT, not int.
4007 * dispextern.h (merge_faces):
4008 * xfaces.c (merge_faces):
01103c44
PE
4009 * xdisp.c (get_next_display_element, next_element_from_display_vector):
4010 Don't assume EMACS_INT fits in int.
9910e595 4011
2638320e
PE
4012 * character.h (CHAR_VALID_P): Remove unused parameter.
4013 * fontset.c, lisp.h, xdisp.c: All uses changed.
4014
045eb8d9
PE
4015 * editfns.c (Ftranslate_region_internal): Omit redundant test.
4016
c1f134b5
PE
4017 * fns.c (concat): Minor tuning based on overflow analysis.
4018 This doesn't fix any bugs. Use int to hold character, instead
4019 of constantly refetching from Emacs object. Use XFASTINT, not
4020 XINT, for value known to be a character. Don't bother comparing
4021 a single byte to 0400, as it's always less.
4022
395fcb93 4023 * floatfns.c (Fexpt):
327eeec8
PE
4024 * fileio.c (make_temp_name): Omit unnecessary cast to unsigned.
4025
abbd3d23
PE
4026 * editfns.c (Ftranslate_region_internal): Use int, not EMACS_INT
4027 for characters.
4028
684a03ef
PE
4029 * doc.c (get_doc_string): Omit (unsigned)c that mishandled negatives.
4030
0fed43f3
PE
4031 * data.c (Faset): If ARRAY is a string, check that NEWELT is a char.
4032 Without this fix, on a 64-bit host (aset S 0 4294967386) would
4033 incorrectly succeed when S was a string, because 4294967386 was
4034 truncated before it was used.
4035
8fd02eb7
PE
4036 * chartab.c (Fchar_table_range): Use CHARACTERP to check range.
4037 Otherwise, an out-of-range integer could cause undefined behavior
4038 on a 64-bit host.
4039
f8c86b69
PE
4040 * composite.c: Use int, not EMACS_INT, for characters.
4041 (fill_gstring_body, composition_compute_stop_pos): Use int, not
4042 EMACS_INT, for values that are known to be in character range.
4043 This doesn't fix any bugs but is the usual style inside Emacs and
4044 may generate better code on 32-bit machines.
4045
34206dd2
PE
4046 Make sure a 64-bit char is never passed to ENCODE_CHAR.
4047 This is for reasons similar to the recent CHAR_STRING fix.
4048 * charset.c (Fencode_char): Check that character arg is actually
4049 a character. Pass an int to ENCODE_CHAR.
4050 * charset.h (ENCODE_CHAR): Verify that the character argument is no
4051 wider than 'int', as a compile-time check to prevent future regressions
4052 in this area.
4053
c5958d4c 4054 * character.c (char_string): Remove unnecessary casts.
13bdea59
PE
4055
4056 Make sure a 64-bit char is never passed to CHAR_STRING.
4057 Otherwise, CHAR_STRING would do the wrong thing on a 64-bit platform,
4058 by silently ignoring the top 32 bits, allowing some values
4059 that were far too large to be valid characters.
4060 * character.h: Include <verify.h>.
4061 (CHAR_STRING, CHAR_STRING_ADVANCE): Verify that the character
4062 arguments are no wider than unsigned, as a compile-time check
4063 to prevent future regressions in this area.
4064 * data.c (Faset):
01103c44 4065 * editfns.c (Fchar_to_string, general_insert_function, Finsert_char)
13bdea59
PE
4066 (Fsubst_char_in_region):
4067 * fns.c (concat):
4068 * xdisp.c (decode_mode_spec_coding):
4069 Adjust to CHAR_STRING's new requirement.
4070 * editfns.c (Finsert_char, Fsubst_char_in_region):
4071 * fns.c (concat): Check that character args are actually
4072 characters. Without this test, these functions did the wrong
4073 thing with wildly out-of-range values on 64-bit hosts.
4074
d37ca623
PE
4075 Remove incorrect casts to 'unsigned' that lose info on 64-bit hosts.
4076 These casts should not be needed on 32-bit hosts, either.
4077 * keyboard.c (read_char):
4078 * lread.c (Fload): Remove casts to unsigned.
4079
ea204efb
PE
4080 * lisp.h (UNSIGNED_CMP): New macro.
4081 This fixes comparison bugs on 64-bit hosts.
4082 (ASCII_CHAR_P): Use it.
4083 * casefiddle.c (casify_object):
01103c44 4084 * character.h (ASCII_BYTE_P, CHAR_VALID_P)
ea204efb
PE
4085 (SINGLE_BYTE_CHAR_P, CHAR_STRING):
4086 * composite.h (COMPOSITION_ENCODE_RULE_VALID):
4087 * dispextern.h (FACE_FROM_ID):
4088 * keyboard.c (read_char): Use UNSIGNED_CMP.
4089
41cb286c
PE
4090 * xmenu.c (dialog_selection_callback) [!USE_GTK]: Cast to intptr_t,
4091 not to EMACS_INT, to avoid GCC warning.
4092
4a1b9832
PE
4093 * xfns.c (x_set_scroll_bar_default_width): Remove unused 'int' locals.
4094
55daad71
PE
4095 * buffer.h (PTR_BYTE_POS, BUF_PTR_BYTE_POS): Remove harmful cast.
4096 The cast incorrectly truncated 64-bit byte offsets to 32 bits, and
4097 isn't needed on 32-bit machines.
8f95c75c 4098
01103c44
PE
4099 * buffer.c (Fgenerate_new_buffer_name):
4100 Use EMACS_INT for count, not int.
0ceccced 4101 (advance_to_char_boundary): Return EMACS_INT, not int.
e762cafe
PE
4102
4103 * data.c (Qcompiled_function): Now static.
4104
c6f072e7
PE
4105 * window.c (window_body_lines): Now static.
4106
20ce5912
PE
4107 * image.c (gif_load): Rename local to avoid shadowing.
4108
9c4c5f81
PE
4109 * lisp.h (SAFE_ALLOCA_LISP): Check for integer overflow.
4110 (struct Lisp_Save_Value): Use ptrdiff_t, not int, for 'integer' member.
4111 * alloc.c (make_save_value): Integer argument is now of type
4112 ptrdiff_t, not int.
4113 (mark_object): Use ptrdiff_t, not int.
4114 * lisp.h (pD): New macro.
4115 * print.c (print_object): Use it.
4116
c0c5c8ae
PE
4117 * alloc.c: Use EMACS_INT, not int, to count objects.
4118 (total_conses, total_markers, total_symbols, total_vector_size)
4119 (total_free_conses, total_free_markers, total_free_symbols)
01103c44
PE
4120 (total_free_floats, total_floats, total_free_intervals)
4121 (total_intervals, total_strings, total_free_strings):
c0c5c8ae
PE
4122 Now EMACS_INT, not int. All uses changed.
4123 (Fgarbage_collect): Compute overall total using a double, so that
4124 integer overflow is less likely to be a problem. Check for overflow
4125 when converting back to an integer.
5a25e253
PE
4126 (n_interval_blocks, n_string_blocks, n_float_blocks, n_cons_blocks)
4127 (n_vectors, n_symbol_blocks, n_marker_blocks): Remove.
4128 These were 'int' variables that could overflow on 64-bit hosts;
4129 they were never used, so remove them instead of repairing them.
211a0b2a 4130 (nzombies, ngcs, max_live, max_zombies): Now EMACS_INT, not 'int'.
6349ae4d
PE
4131 (inhibit_garbage_collection): Set gc_cons_threshold to max value.
4132 Previously, this ceilinged at INT_MAX, but that doesn't work on
4133 64-bit machines.
e46bb31a 4134 (allocate_pseudovector): Don't use EMACS_INT when int would do.
c0c5c8ae 4135
c78baabf 4136 * alloc.c (Fmake_bool_vector): Don't assume vector size fits in int.
86f61a15 4137 (allocate_vectorlike): Check for ptrdiff_t overflow.
b6439961
PE
4138 (mark_vectorlike, mark_char_table, mark_object): Avoid EMACS_UINT
4139 when a (possibly-narrower) signed value would do just as well.
4140 We prefer using signed arithmetic, to avoid comparison confusion.
c78baabf 4141
c9d624c6
PE
4142 * alloc.c: Catch some string size overflows that we were missing.
4143 (XMALLOC_OVERRUN_CHECK_SIZE) [!XMALLOC_OVERRUN_CHECK]: Define to 0,
4144 for convenience in STRING_BYTES_MAX.
4145 (STRING_BYTES_MAX): New macro, superseding the old one in lisp.h.
4146 The definition here is exact; the one in lisp.h was approximate.
4147 (allocate_string_data): Check for string overflow. This catches
4148 some instances we weren't catching before. Also, it catches
4149 size_t overflow on (unusual) hosts where SIZE_MAX <= min
4150 (PTRDIFF_MAX, MOST_POSITIVE_FIXNUM), e.g., when size_t is 32 bits
4151 and ptrdiff_t and EMACS_INT are both 64 bits.
c78baabf 4152
c9d624c6
PE
4153 * character.c, coding.c, doprnt.c, editfns.c, eval.c:
4154 All uses of STRING_BYTES_MAX replaced by STRING_BYTES_BOUND.
640c8776 4155 * lisp.h (STRING_BYTES_BOUND): Rename from STRING_BYTES_MAX.
c9d624c6 4156
353032ce
PE
4157 * character.c (string_escape_byte8): Fix nbytes/nchars typo.
4158
2bccce07
PE
4159 * alloc.c (Fmake_string): Check for out-of-range init.
4160
0ac30604
SM
41612011-06-15 Stefan Monnier <monnier@iro.umontreal.ca>
4162
4163 * eval.c (Fdefvaralias): Also mark the target as variable-special-p.
4164
c195f2de
JD
41652011-06-14 Jan Djärv <jan.h.d@swipnet.se>
4166
4167 * xfns.c (x_set_scroll_bar_default_width): Remove argument to
4168 xg_get_default_scrollbar_width.
4169
4170 * gtkutil.c: Include emacsgtkfixed.h if HAVE_GTK3.
4171 (int_gtk_range_get_value): Move to the scroll bar part of the file.
4172 (style_changed_cb): Call update_theme_scrollbar_width and call
4173 x_set_scroll_bar_default_width and xg_frame_set_char_size for
4174 all frames (Bug#8505).
4175 (xg_create_frame_widgets): Call emacs_fixed_new if HAVE_GTK3 (Bug#8505).
4176 Call gtk_window_set_resizable if HAVE_GTK3.
4177 (x_wm_set_size_hint): Call emacs_fixed_set_min_size with min width
4178 and height if HAVE_GTK3 (Bug#8505).
4179 (scroll_bar_width_for_theme): New variable.
4180 (update_theme_scrollbar_width): New function.
4181 (xg_get_default_scrollbar_width): Move code to
4182 update_theme_scrollbar_width, just return scroll_bar_width_for_theme.
4183 (xg_initialize): Call update_theme_scrollbar_width.
4184
4185 * gtkutil.h (xg_get_default_scrollbar_width): Remove argument.
4186
4187 * emacsgtkfixed.c, emacsgtkfixed.h: New files.
4188
e10ac9f1
MR
41892011-06-12 Martin Rudalics <rudalics@gmx.at>
4190
4191 * frame.c (make_frame): Call other_buffer_safely instead of
4192 other_buffer.
4193
4194 * window.c (temp_output_buffer_show): Call display_buffer with
4195 second argument Vtemp_buffer_show_specifiers and reset latter
4196 immediately after the call.
4197 (Vtemp_buffer_show_specifiers): New variable.
4198 (auto_window_vscroll_p, next_screen_context_lines)
4199 (Vscroll_preserve_screen_position): Remove leading asterisks from
4200 doc-strings.
4201
2d3c217e 42022011-06-12 Paul Eggert <eggert@cs.ucla.edu>
4475bec4 4203
7b7f97e8 4204 Fix minor problems found by GCC 4.6.0 static checking.
4475bec4
PE
4205 * buffer.c (Qclone_number): Remove for now, as it's unused.
4206 (record_buffer, Funrecord_buffer): Rename local to avoid shadowing.
4207 (record_buffer): Remove unused local.
4208 * frame.c (other_visible_frames, frame_buffer_list): Now static.
4209 (set_frame_buffer_list): Remove; unused.
4210 * frame.h (other_visible_frames): Remove decl.
4211 * keyboard.h (menu_items_inuse): Declare only if USE_GTK || USE_MOTIF.
4212 * lisp.h (frame_buffer_list, set_frame_buffer_list): Remove decls.
4213 (add_gpm_wait_descriptor, delete_gpm_wait_descriptor): Declare only
4214 if HAVE_GPM.
4215 * menu.c (menu_items_inuse): Now static unless USE_GTK || USE_MOTIF.
4216 * process.c (add_gpm_wait_descriptor, delete_gpm_wait_descriptor):
4217 Define only if HAVE_GPM.
4218 * widget.c (EmacsFrameResize, emacsFrameClassRec): Now static.
4219 (update_hints_inhibit): Remove; never set. All uses removed.
4220 * widgetprv.h (emacsFrameClassRec): Remove decl.
4221 * window.c (delete_deletable_window): Now returns void, since it
4222 wasn't returning anything.
4223 (compare_window_configurations): Remove unused locals.
4224 * xfns.c (x_set_scroll_bar_default_width): Remove unused locals.
4225 * xmenu.c (x_menu_set_in_use): Define only if USE_GTK || USE_MOTIF.
4475bec4
PE
4226 (dialog_selection_callback) [!USE_GTK]: Prefer intptr_t for integers
4227 the same widths as pointers. This follows up on the 2011-05-06 patch.
4228 * xterm.c (x_alloc_lighter_color_for_widget): Define only if USE_LUCID.
4229 * xterm.h: Likewise.
4230 (x_menu_set_in_use): Declare only if USE_GTK || USE_MOTIF.
4231
1384b89e
JB
42322011-06-12 Juanma Barranquero <lekktu@gmail.com>
4233
4234 * makefile.w32-in: Update dependencies.
4235 (LISP_H): Add lib/intprops.h.
4236
1100a63c
CY
42372011-06-11 Chong Yidong <cyd@stupidchicken.com>
4238
4239 * image.c (gif_load): Add animation frame delay to the metadata.
4240 (syms_of_image): Use DEFSYM. New symbol `delay'.
4241
6198ccd0
MR
42422011-06-11 Martin Rudalics <rudalics@gmx.at>
4243
4244 * window.c (delete_deletable_window): Re-add.
4245 (Fset_window_configuration): Rewrite to handle dead buffers and
4246 consequently deletable windows.
4247 (window_tree, Fwindow_tree): Remove. Supply functionality in
4248 window.el.
4249 (compare_window_configurations): Simplify code.
4250
b6e3633c
AS
42512011-06-11 Andreas Schwab <schwab@linux-m68k.org>
4252
1ab0dee5
AS
4253 * image.c (imagemagick_load_image): Fix type mismatch.
4254 (Fimagemagick_types): Likewise.
4255
b6e3633c
AS
4256 * window.h (replace_buffer_in_windows): Declare.
4257
9397e56f
MR
42582011-06-11 Martin Rudalics <rudalics@gmx.at>
4259
4260 * buffer.c: New Lisp objects Qbuffer_list_update_hook and
4261 Qclone_number. Remove external declaration of Qdelete_window.
4262 (Fbuffer_list): Rewrite doc-string. Minor restructuring of
4263 code.
640c8776
SM
4264 (Fget_buffer_create, Fmake_indirect_buffer, Frename_buffer):
4265 Run Qbuffer_list_update_hook if allowed.
9397e56f
MR
4266 (Fother_buffer): Rewrite doc-string. Major rewrite for new
4267 buffer list implementation.
4268 (other_buffer_safely): New function.
4269 (Fkill_buffer): Replace call to replace_buffer_in_all_windows by
4270 calls to replace_buffer_in_windows and
4271 replace_buffer_in_windows_safely. Run Qbuffer_list_update_hook
4272 if allowed.
4273 (record_buffer): Inhibit quitting and rewrite using quittable
4274 functions. Run Qbuffer_list_update_hook if allowed.
4275 (Frecord_buffer, Funrecord_buffer): New functions.
640c8776
SM
4276 (switch_to_buffer_1, Fswitch_to_buffer): Remove.
4277 Move switch-to-buffer to window.el.
9397e56f
MR
4278 (bury-buffer): Move to window.el.
4279 (Vbuffer_list_update_hook): New variable.
4280
4281 * lisp.h (other_buffer_safely): Add prototype in buffer.c
4282 section.
4283
4284 * window.h (resize_frame_windows): Move up in code.
4285 (Fwindow_frame): Remove EXFUN.
4286 (replace_buffer_in_all_windows): Remove prototype.
4287 (replace_buffer_in_windows_safely): Add prototype.
4288
4289 * window.c: Declare Qdelete_window static again. Move down
4290 declaration of select_count.
4291 (Fnext_window, Fprevious_window): Rewrite doc-strings.
4292 (Fother_window): Move to window.el.
4293 (window_loop): Remove DELETE_BUFFER_WINDOWS and UNSHOW_BUFFER
4294 cases. Add REPLACE_BUFFER_IN_WINDOWS_SAFELY case.
4295 (Fdelete_windows_on, Freplace_buffer_in_windows): Move to
4296 window.el.
4297 (replace_buffer_in_windows): Implement by calling
4298 Qreplace_buffer_in_windows.
4299 (replace_buffer_in_all_windows): Remove with some functionality
4300 moved into replace_buffer_in_windows_safely.
4301 (replace_buffer_in_windows_safely): New function.
4302 (select_window_norecord, select_frame_norecord): Move in front
4303 of run_window_configuration_change_hook. Remove now obsolete
4304 declarations.
640c8776
SM
4305 (Fset_window_buffer): Rewrite doc-string.
4306 Call Qrecord_window_buffer.
9397e56f
MR
4307 (keys_of_window): Move binding for other-window to window.el.
4308
b50691aa
CY
43092011-06-11 Chong Yidong <cyd@stupidchicken.com>
4310
4311 * dispextern.h (struct image): Replace data member, whose int_val
4312 and ptr_val fields were not used by anything, with a single
4313 lisp_val object.
4314
4315 * image.c (Fimage_metadata, make_image, mark_image, tiff_load)
4316 (gif_clear_image, gif_load, imagemagick_load_image)
4317 (gs_clear_image, gs_load): Callers changed.
4318
3f754b86
PE
43192011-06-10 Paul Eggert <eggert@cs.ucla.edu>
4320
cca69397
PE
4321 * buffer.h: Include <time.h>, for time_t.
4322 Needed to build on FreeBSD 8.2. Problem reported by Herbert J. Skuhra.
4323
109e28d0
PE
4324 Fix minor problems found by static checking.
4325
60737f02
PE
4326 * image.c (PixelGetMagickColor): Declare if ImageMagick headers don't.
4327
4b66faf3
PE
4328 Make identifiers static if they are not used in other modules.
4329 * data.c (Qcompiled_function, Qframe, Qvector):
4330 * image.c (QimageMagick, Qsvg):
4331 * minibuf.c (Qmetadata):
4332 * window.c (resize_window_check, resize_root_window): Now static.
4333 * window.h (resize_window_check, resize_root_window): Remove decls.
4334
109e28d0
PE
4335 * window.c (window_deletion_count, delete_deletable_window):
4336 Remove; unused.
46a4ce9e
PE
4337 (window_body_lines): Now static.
4338 (Fdelete_other_windows_internal): Mark vars as initialized.
4339 Make sure 'resize_failed' is initialized.
4340 (run_window_configuration_change_hook): Rename local to avoid shadowing.
4341 (resize_window_apply): Remove unused local.
4342 * window.h (delete_deletable_window): Remove decl.
4343
109e28d0 4344 * image.c (gif_load, svg_load_image): Rename locals to avoid shadowing.
33290528
PE
4345 (imagemagick_load_image): Fix pointer signedness problem by changing
4346 last arg from unsigned char * to char *. All uses changed.
4347 Also, fix a local for similar reasons.
4348 Remove unused locals. Remove locals to avoid shadowing.
4349 (fn_rsvg_handle_free): Remove; unused.
4350 (svg_load, svg_load_image): Fix pointer signedness problem.
f7e13da3 4351 (imagemagick_load_image): Don't use garbage pointer image_wand.
33290528 4352
3f754b86
PE
4353 * ftfont.c (ftfont_get_metrics, ftfont_drive_otf): Remove unused locals.
4354
2547adb1
CY
43552011-06-10 Chong Yidong <cyd@stupidchicken.com>
4356
4357 * image.c (gif_load): Fix omitted cast error introduced by
4358 2011-06-06 change.
4359
2c8e37d4
MR
43602011-06-10 Martin Rudalics <rudalics@gmx.at>
4361
4362 * window.h (resize_proportionally, orig_total_lines)
4363 (orig_top_line): Remove from window structure.
4364 (set_window_height, set_window_width, change_window_heights)
4365 (Fdelete_window): Remove prototypes.
4366 (resize_frame_windows): Remove duplicate declaration.
4367
440a42e3
EZ
43682011-06-10 Eli Zaretskii <eliz@gnu.org>
4369
4370 * window.h (resize_frame_windows, resize_window_check)
4371 (delete_deletable_window, resize_root_window)
4372 (resize_frame_windows): Declare prototypes.
4373
4374 * window.c (resize_window_apply): Make definition be "static" to
4375 match the prototype.
4376
562dd5e9
MR
43772011-06-10 Martin Rudalics <rudalics@gmx.at>
4378
4379 * window.c: Remove declarations of Qwindow_size_fixed,
4380 window_min_size_1, window_min_size_2, window_min_size,
4381 size_window, window_fixed_size_p, enlarge_window, delete_window.
4382 Remove static from declaration of Qdelete_window, it's
4383 temporarily needed by Fbury_buffer.
4384 (replace_window): Don't assign orig_top_line and
4385 orig_total_lines.
4386 (Fdelete_window, delete_window): Remove. Window deletion is
4387 handled by window.el.
640c8776
SM
4388 (window_loop): Remove DELETE_OTHER_WINDOWS case.
4389 Replace Fdelete_window calls with calls to Qdelete_window.
562dd5e9
MR
4390 (Fdelete_other_windows): Remove. Deleting other windows is
4391 handled by window.el.
4392 (window_fixed_size_p): Remove. Fixed-sizeness of windows is
4393 handled in window.el.
4394 (window_min_size_2, window_min_size_1, window_min_size): Remove.
4395 Window minimum sizes are handled in window.el.
4396 (shrink_windows, size_window, set_window_height)
4397 (set_window_width, change_window_heights, window_height)
4398 (window_width, CURBEG, CURSIZE, enlarge_window)
4399 (adjust_window_trailing_edge, Fadjust_window_trailing_edge)
4400 (Fenlarge_window, Fshrink_window): Remove. Window resizing is
4401 handled in window.el.
4402 (make_dummy_parent): Rename to make_parent_window and give it a
4403 second argument horflag.
4404 (make_window): Don't set resize_proportionally any more.
4405 (Fsplit_window): Remove. Windows are split in window.el.
4406 (save_restore_action, save_restore_orig_size)
4407 (shrink_window_lowest_first, save_restore_orig_size): Remove.
4408 Resize mini windows in window.el.
4409 (grow_mini_window, shrink_mini_window): Implement by calling
4410 Qresize_root_window_vertically, resize_window_check and
4411 resize_window_apply.
640c8776
SM
4412 (saved_window, Fset_window_configuration, save_window_save):
4413 Do not handle orig_top_line, orig_total_lines, and
562dd5e9
MR
4414 resize_proportionally.
4415 (window_min_height, window_min_width): Move to window.el.
4416 (keys_of_window): Move bindings for delete-other-windows,
4417 split-window, delete-window and enlarge-window to window.el.
4418
4419 * buffer.c: Temporarily extern Qdelete_window.
4420 (Fbury_buffer): Temporarily call Qdelete_window instead of
4421 Fdelete_window (Fbury_buffer will move to window.el soon).
4422
4423 * frame.c (set_menu_bar_lines_1): Remove code handling
4424 orig_top_line and orig_total_lines.
4425
4426 * dispnew.c (adjust_frame_glyphs_initially): Don't use
4427 set_window_height but set heights directly.
4428 (change_frame_size_1): Use resize_frame_windows.
4429
4430 * xdisp.c (init_xdisp): Don't use set_window_height but set
4431 heights directly.
4432
640c8776
SM
4433 * xfns.c (x_set_menu_bar_lines, x_set_tool_bar_lines):
4434 Use resize_frame_windows instead of change_window_heights and run
562dd5e9
MR
4435 run_window_configuration_change_hook.
4436
4437 * w32fns.c (x_set_tool_bar_lines): Use resize_frame_windows
4438 instead of change_window_heights and run
4439 run_window_configuration_change_hook.
4440
1a13852e
MR
44412011-06-09 Martin Rudalics <rudalics@gmx.at>
4442
4443 * window.c (replace_window): Rename second argument REPLACEMENT to
4444 NEW. New third argument SETFLAG. Rewrite.
4445 (delete_window, make_dummy_parent): Call replace_window with
4446 third argument 1.
4447 (window_list_1): Move down in code.
4448 (run_window_configuration_change_hook): Move set_buffer part
4449 before select_frame_norecord part in order to unwind correctly.
4450 Rename count1 to count.
4451 (recombine_windows, delete_deletable_window, resize_root_window)
4452 (Fdelete_other_windows_internal)
4453 (Frun_window_configuration_change_hook, make_parent_window)
4454 (resize_window_check, resize_window_apply, Fresize_window_apply)
4455 (resize_frame_windows, Fsplit_window_internal)
640c8776
SM
4456 (Fdelete_window_internal, Fresize_mini_window_internal):
4457 New functions.
1a13852e
MR
4458 (syms_of_window): New variables Vwindow_splits and Vwindow_nest.
4459
f3d1777e
MR
44602011-06-08 Martin Rudalics <rudalics@gmx.at>
4461
496e208e
MR
4462 * window.h (window): Add some new members to window structure -
4463 normal_lines, normal_cols, new_total, new_normal, clone_number,
4464 splits, nest, prev_buffers, next_buffers.
4465 (WINDOW_TOTAL_SIZE): Move here from window.c.
b9e809c2 4466 (MIN_SAFE_WINDOW_WIDTH, MIN_SAFE_WINDOW_HEIGHT): Define here.
496e208e 4467
f3d1777e
MR
4468 * window.c (Fwindow_height, Fwindow_width, Fwindow_full_width_p):
4469 Remove.
496e208e
MR
4470 (make_dummy_parent): Set new members of windows structure.
4471 (make_window): Move down in code. Handle new members of window
4472 structure.
4473 (Fwindow_clone_number, Fwindow_splits, Fset_window_splits)
4474 (Fwindow_nest, Fset_window_nest, Fwindow_new_total)
4475 (Fwindow_normal_size, Fwindow_new_normal, Fwindow_prev_buffers)
4476 (Fset_window_prev_buffers, Fwindow_next_buffers)
640c8776
SM
4477 (Fset_window_next_buffers, Fset_window_clone_number):
4478 New functions.
496e208e
MR
4479 (Fwindow_hscroll, Fwindow_at, Fwindow_point, Fwindow_start)
4480 (Fwindow_end, Fwindow_line_height, Fset_window_dedicated_p):
4481 Doc-string fixes.
4482 (Fwindow_parameters, Fwindow_parameter, Fset_window_parameter):
4483 Argument WINDOW can be now internal window too.
4484 (Fwindow_use_time): Move up in code.
4485 (Fget_buffer_window): Rename argument FRAME to ALL-FRAMES.
4486 Rewrite doc-string.
4487 (Fset_window_configuration, saved_window)
4488 (Fcurrent_window_configuration, save_window_save): Handle new
4489 members of window structure.
b9e809c2
MR
4490 (WINDOW_TOTAL_SIZE, MIN_SAFE_WINDOW_WIDTH)
4491 (MIN_SAFE_WINDOW_HEIGHT): Move to window.h.
4492 (syms_of_window): New Lisp objects Qrecord_window_buffer,
4493 Qwindow_deletable_p, Qdelete_window, Qreplace_buffer_in_windows,
4494 Qget_mru_window, Qresize_root_window,
4495 Qresize_root_window_vertically, Qsafe, Qabove, Qbelow,
4496 Qauto_buffer_name; staticpro them.
f3d1777e 4497
abde8f8c
MR
44982011-06-07 Martin Rudalics <rudalics@gmx.at>
4499
4500 * window.c (Fwindow_total_size, Fwindow_left_column)
4501 (Fwindow_top_line, window_body_lines, Fwindow_body_size)
4502 (Fwindow_list_1): New functions.
4503 (window_box_text_cols): Replace with window_body_cols.
640c8776
SM
4504 (Fwindow_width, Fscroll_left, Fscroll_right):
4505 Use window_body_cols instead of window_box_text_cols.
4506 (delete_window, Fset_window_configuration):
4507 Call delete_all_subwindows with window as argument.
fa8a67e6
MR
4508 (delete_all_subwindows): Take a window as argument and not a
4509 structure. Rewrite.
190b47e6
MR
4510 (window_loop): Remove handling of GET_LRU_WINDOW and
4511 GET_LARGEST_WINDOW.
4512 (Fget_lru_window, Fget_largest_window): Move to window.el.
abde8f8c
MR
4513
4514 * window.h: Extern window_body_cols instead of
fa8a67e6
MR
4515 window_box_text_cols. delete_all_subwindows now takes a
4516 Lisp_Object as argument.
abde8f8c 4517
640c8776
SM
4518 * indent.c (compute_motion, Fcompute_motion):
4519 Use window_body_cols instead of window_box_text_cols.
abde8f8c 4520
fa8a67e6
MR
4521 * frame.c (delete_frame): Call delete_all_subwindows with root
4522 window as argument.
4523
a54e3482
DC
45242011-06-07 Daniel Colascione <dan.colascione@gmail.com>
4525
4526 * fns.c (Fputhash): Document return value.
4527
60002bf5
CY
45282011-06-06 Chong Yidong <cyd@stupidchicken.com>
4529
4530 * image.c (gif_load): Implement gif89a spec "no disposal" method.
4531
0c671da6 45322011-06-06 Paul Eggert <eggert@cs.ucla.edu>
ccd9a01a 4533
b862a52a 4534 Cons<->int and similar integer overflow fixes (Bug#8794).
77984278 4535
be44ca6c
PE
4536 Check for overflow when converting integer to cons and back.
4537 * charset.c (Fdefine_charset_internal, Fdecode_char):
4538 Use cons_to_unsigned to catch overflow.
4539 (Fencode_char): Use INTEGER_TO_CONS.
4540 * composite.h (LGLYPH_CODE): Use cons_to_unsigned.
4541 (LGLYPH_SET_CODE): Use INTEGER_TO_CONS.
4542 * data.c (long_to_cons, cons_to_long): Remove.
4543 (cons_to_unsigned, cons_to_signed): New functions.
4544 These signal an error for invalid or out-of-range values.
4545 * dired.c (Ffile_attributes): Use INTEGER_TO_CONS.
4546 * fileio.c (Fset_visited_file_modtime): Use CONS_TO_INTEGER.
4547 * font.c (Ffont_variation_glyphs):
4548 * fontset.c (Finternal_char_font): Use INTEGER_TO_CONS.
4549 * lisp.h: Include <intprops.h>.
4550 (INTEGER_TO_CONS, CONS_TO_INTEGER): New macros.
4551 (cons_to_signed, cons_to_unsigned): New decls.
4552 (long_to_cons, cons_to_long): Remove decls.
4553 * undo.c (record_first_change): Use INTEGER_TO_CONS.
4554 (Fprimitive_undo): Use CONS_TO_INTEGER.
4555 * xfns.c (Fx_window_property): Likewise.
4556 * xselect.c: Include <limits.h>.
4557 (x_own_selection, selection_data_to_lisp_data):
4558 Use INTEGER_TO_CONS.
4559 (x_handle_selection_request, x_handle_selection_clear)
4560 (x_get_foreign_selection, Fx_disown_selection_internal)
4561 (Fx_get_atom_name, x_send_client_event): Use CONS_TO_INTEGER.
4562 (lisp_data_to_selection_data): Use cons_to_unsigned.
4563 (x_fill_property_data): Use cons_to_signed.
4564 Report values out of range.
4565
d1f3d2af
PE
4566 Check for buffer and string overflow more precisely.
4567 * buffer.h (BUF_BYTES_MAX): New macro.
4568 * lisp.h (STRING_BYTES_MAX): New macro.
4569 * alloc.c (Fmake_string):
4570 * character.c (string_escape_byte8):
4571 * coding.c (coding_alloc_by_realloc):
4572 * doprnt.c (doprnt):
4573 * editfns.c (Fformat):
4574 * eval.c (verror):
4575 Use STRING_BYTES_MAX, not MOST_POSITIVE_FIXNUM,
4576 since they may not be the same number.
4577 * editfns.c (Finsert_char):
4578 * fileio.c (Finsert_file_contents):
4579 Likewise for BUF_BYTES_MAX.
4580
dd52fcea
PE
4581 * image.c: Use ptrdiff_t, not int, for sizes.
4582 (slurp_file): Switch from int to ptrdiff_t.
4583 All uses changed.
4584 (slurp_file): Check that file size fits in both size_t (for
4585 malloc) and ptrdiff_t (for sanity and safety).
4586
7f9bbdbb
PE
4587 * fileio.c (Fverify_visited_file_modtime): Avoid time overflow
4588 if b->modtime has its maximal value.
4589
dfe18f82
PE
4590 * dired.c (Ffile_attributes): Don't assume EMACS_INT has >32 bits.
4591
84acfcf0
PE
4592 Don't assume time_t can fit into int.
4593 * buffer.h (struct buffer.modtime): Now time_t, not int.
4594 * fileio.c (Fvisited_file_modtime): No need for time_t cast now.
4595 * undo.c (Fprimitive_undo): Use time_t, not int, for time_t value.
4596
ccd9a01a
PE
4597 Minor fixes for signed vs unsigned integers.
4598 * character.h (MAYBE_UNIFY_CHAR):
4599 * charset.c (maybe_unify_char):
4600 * keyboard.c (read_char, reorder_modifiers):
4601 XINT -> XFASTINT, since the integer must be nonnegative.
4602 * ftfont.c (ftfont_spec_pattern):
4603 * keymap.c (access_keymap, silly_event_symbol_error):
4604 XUINT -> XFASTINT, since the integer must be nonnegative.
4605 (Fsingle_key_description, preferred_sequence_p): XUINT -> XINT,
4606 since it makes no difference and we prefer signed.
4607 * keyboard.c (record_char): Use XUINT when all the neighbors do.
4608 (access_keymap): NATNUMP -> INTEGERP, since the integer must be
4609 nonnegative.
4610
d6d100dd
SM
46112011-06-06 Stefan Monnier <monnier@iro.umontreal.ca>
4612
4613 * window.h (Fwindow_frame): Declare.
4614
2b6148e4
PE
46152011-06-06 Paul Eggert <eggert@cs.ucla.edu>
4616
4617 * alloc.c: Simplify handling of large-request failures (Bug#8800).
4618 (SPARE_MEMORY): Always define.
4619 (LARGE_REQUEST): Remove.
4620 (memory_full): Use SPARE_MEMORY rather than LARGE_REQUEST.
4621
f230ecc9
MR
46222011-06-06 Martin Rudalics <rudalics@gmx.at>
4623
727e958e
MR
4624 * lisp.h: Move EXFUNS for Fframe_root_window,
4625 Fframe_first_window and Fset_frame_selected_window to window.h.
4626
4627 * window.h: Move EXFUNS for Fframe_root_window,
4628 Fframe_first_window and Fset_frame_selected_window here from
4629 lisp.h.
4630
4631 * frame.c (Fwindow_frame, Fframe_first_window)
4632 (Fframe_root_window, Fframe_selected_window)
4633 (Fset_frame_selected_window): Move to window.c.
4634 (Factive_minibuffer_window): Move to minibuf.c.
4635 (Fother_visible_frames_p): New function.
4636
4637 * minibuf.c (Factive_minibuffer_window): Move here from frame.c.
4638
f230ecc9
MR
4639 * window.c (decode_window, decode_any_window): Move up in code.
4640 (Fwindowp, Fwindow_live_p): Rewrite doc-strings.
4641 (inhibit_frame_unsplittable): Remove unused variable.
bf60a96b
MR
4642 (Fwindow_buffer): Move up and rewrite doc-string.
4643 (Fwindow_parent, Fwindow_vchild, Fwindow_hchild, Fwindow_next)
4644 (Fwindow_prev): New functions.
727e958e
MR
4645 (Fwindow_frame): Move here from frame.c. Accept any window as
4646 argument.
4647 (Fframe_root_window, Fframe_first_window)
4648 (Fframe_selected_window): Move here from frame.c. Accept frame
4649 or arbitrary window as argument. Update doc-strings.
4650 (Fminibuffer_window): Move up in code.
4651 (Fwindow_minibuffer_p): Move up in code and simplify.
d6d100dd
SM
4652 (Fset_frame_selected_window): Move here from frame.c.
4653 Marginal rewrite.
727e958e
MR
4654 (Fselected_window, select_window, Fselect_window): Move up in
4655 code. Minor doc-string fixes.
f230ecc9 4656
4d09bcf6
PE
46572011-06-06 Paul Eggert <eggert@cs.ucla.edu>
4658
4659 * alloc.c (memory_full) [SYSTEM_MALLOC]: Port to MacOS (Bug#8800).
4660 Do not assume that spare memory exists; that assumption is valid
4661 only if SYSTEM_MALLOC.
4662 (LARGE_REQUEST): New macro, so that the issue of large requests
4663 is separated from the issue of spare memory.
4664
810928a2
AS
46652011-06-05 Andreas Schwab <schwab@linux-m68k.org>
4666
172418ad
AS
4667 * editfns.c (Fformat): Correctly handle zero flag with hexadecimal
4668 format. (Bug#8806)
4669
43f862f7
AS
4670 * gtkutil.c (xg_get_default_scrollbar_width): Avoid warning.
4671
810928a2
AS
4672 * xfns.c (x_set_scroll_bar_default_width): Move declarations
4673 before statements.
4674
a059fe24
JD
46752011-06-05 Jan Djärv <jan.h.d@swipnet.se>
4676
4677 * gtkutil.c (xg_get_default_scrollbar_width): New function.
4678
4679 * gtkutil.h: Declare xg_get_default_scrollbar_width.
4680
4681 * xfns.c (x_set_scroll_bar_default_width): If USE_GTK, get
4682 min width by calling x_set_scroll_bar_default_width (Bug#8505).
4683
989bf368
JB
46842011-06-05 Juanma Barranquero <lekktu@gmail.com>
4685
4686 * xdisp.c (single_display_spec_intangible_p): Remove declaration.
4687
4b80f674
CY
46882011-06-04 Chong Yidong <cyd@stupidchicken.com>
4689
4690 * xselect.c (x_clipboard_manager_save): Remove redundant arg.
4691 (x_clipboard_manager_save): Add return value.
d6d100dd
SM
4692 (x_clipboard_manager_error_1, x_clipboard_manager_error_2):
4693 New error handlers.
4b80f674
CY
4694 (x_clipboard_manager_save_frame, x_clipboard_manager_save_all):
4695 Obey Vx_select_enable_clipboard_manager. Catch errors in
4696 x_clipboard_manager_save (Bug#8779).
4697 (Vx_select_enable_clipboard_manager): New variable.
de65b42c 4698 (x_get_foreign_selection): Reduce scope of x_catch_errors (Bug#8790).
4b80f674 4699
99a33b77 47002011-06-04 Dan Nicolaescu <dann@ics.uci.edu>
8b3115e7
DN
4701
4702 * emacs.c (main): Warn when starting a GTK emacs in daemon mode.
4703
99a33b77 47042011-06-04 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
14eca62f
YM
4705
4706 * fringe.c (update_window_fringes): Don't update overlay arrow bitmap
4707 in the current matrix if keep_current_p is non-zero.
4708
8264569d
EZ
47092011-06-04 Eli Zaretskii <eliz@gnu.org>
4710
4711 * bidi.c (bidi_level_of_next_char): Fix last change.
4712
57f97249
EZ
47132011-06-03 Eli Zaretskii <eliz@gnu.org>
4714
fec2107c 4715 Support bidi reordering of text covered by display properties.
57f97249 4716
fec2107c
EZ
4717 * bidi.c (bidi_copy_it): Use offsetof instead of emulating it.
4718 (bidi_fetch_char, bidi_fetch_char_advance): New functions.
4719 (bidi_cache_search, bidi_cache_iterator_state)
4720 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak)
d6d100dd
SM
4721 (bidi_level_of_next_char, bidi_move_to_visually_next):
4722 Support character positions inside a run of characters covered by a
fec2107c
EZ
4723 display string.
4724 (bidi_paragraph_init, bidi_resolve_explicit_1)
4725 (bidi_level_of_next_char): Call bidi_fetch_char and
4726 bidi_fetch_char_advance instead of FETCH_CHAR and
4727 FETCH_CHAR_ADVANCE.
4728 (bidi_init_it): Initialize new members.
4729 (LRE_CHAR, RLE_CHAR, PDF_CHAR, LRO_CHAR, RLO_CHAR): Remove macro
4730 definitions.
4731 (bidi_explicit_dir_char): Lookup character type in bidi_type_table,
4732 instead of using explicit *_CHAR codes.
d6d100dd
SM
4733 (bidi_resolve_explicit, bidi_resolve_weak):
4734 Use FETCH_MULTIBYTE_CHAR instead of FETCH_CHAR, as reordering of
fec2107c
EZ
4735 bidirectional text is supported only in multibyte buffers.
4736 (bidi_init_it): Accept additional argument FRAME_WINDOW_P and use
4737 it to initialize the frame_window_p member of struct bidi_it.
4738 (bidi_cache_iterator_state, bidi_resolve_explicit_1)
4739 (bidi_resolve_explicit, bidi_resolve_weak)
4740 (bidi_level_of_next_char, bidi_move_to_visually_next): Abort if
4741 bidi_it->nchars is non-positive.
4742 (bidi_level_of_next_char): Don't try to lookup the cache for the
4743 next/previous character if nothing is cached there yet, or if we
4744 were just reseat()'ed to a new position.
c40e2fb2 4745
0e14fe90
EZ
4746 * xdisp.c (set_cursor_from_row): Set start and stop points
4747 according to the row's direction when priming the loop that looks
4748 for the glyph on which to display cursor.
4749 (single_display_spec_intangible_p): Function deleted.
4750 (display_prop_intangible_p): Reimplement to call
4751 handle_display_spec instead of single_display_spec_intangible_p.
d6d100dd
SM
4752 Accept 3 additional arguments needed by handle_display_spec.
4753 This fixes incorrect cursor motion across display property with complex
0e14fe90
EZ
4754 values: lists, `(when COND...)' forms, etc.
4755 (single_display_spec_string_p): Support property values that are
4756 lists with the argument STRING its top-level element.
4757 (display_prop_string_p): Fix the condition for processing a
4758 property that is a list to be consistent with handle_display_spec.
fec2107c 4759 (handle_display_spec): New function, refactored from the
fc6f18ce
EZ
4760 last portion of handle_display_prop.
4761 (compute_display_string_pos): Accept additional argument
4762 FRAME_WINDOW_P. Call handle_display_spec to determine whether the
4763 value of a `display' property is a "replacing spec".
4764 (handle_single_display_spec): Accept 2 additional arguments BUFPOS
4765 and FRAME_WINDOW_P. If IT is NULL, don't set up the iterator from
4766 the display property, but just return a value indicating whether
4767 the display property will replace the characters it covers.
4768 (Fcurrent_bidi_paragraph_direction): Initialize the nchars and
4769 frame_window_p members of struct bidi_it.
d6d100dd
SM
4770 (compute_display_string_pos, compute_display_string_end):
4771 New functions.
fec2107c
EZ
4772 (push_it): Accept second argument POSITION, where pop_it should
4773 jump to continue iteration.
4774 (reseat_1): Initialize bidi_it.disp_pos.
fc6f18ce 4775
fec2107c
EZ
4776 * keyboard.c (adjust_point_for_property): Adjust the call to
4777 display_prop_intangible_p to its new signature.
fc6f18ce
EZ
4778
4779 * dispextern.h (struct bidi_it): New member frame_window_p.
fec2107c
EZ
4780 (bidi_init_it): Update prototypes.
4781 (display_prop_intangible_p): Update prototype.
d6d100dd
SM
4782 (compute_display_string_pos, compute_display_string_end):
4783 Declare prototypes.
fec2107c
EZ
4784 (struct bidi_it): New members nchars and disp_pos. ch_len is now
4785 EMACS_INT.
fc6f18ce 4786
40087514 47872011-06-02 Paul Eggert <eggert@cs.ucla.edu>
0de4bb68 4788
57f53182
PE
4789 Malloc failure behavior now depends on size of allocation.
4790 * alloc.c (buffer_memory_full, memory_full): New arg NBYTES.
4791 * lisp.h: Change signatures accordingly.
4792 * alloc.c, buffer.c, editfns.c, menu.c, minibuf.c, xterm.c:
4793 All callers changed. (Bug#8762)
4794
4795 * gnutls.c: Use Emacs's memory allocators.
4796 Without this change, the gnutls library would invoke malloc etc.
4797 directly, which causes problems on non-SYNC_INPUT hosts, and which
4798 runs afoul of improving memory_full behavior. (Bug#8761)
4799 (fn_gnutls_global_set_mem_functions): New macro or function pointer.
4800 (emacs_gnutls_global_init): Use it to specify xmalloc, xrealloc,
4801 xfree instead of the default malloc, realloc, free.
4802 (Fgnutls_boot): No need to check for memory allocation failure,
4803 since xmalloc does that for us.
4804
ac32cd99 4805 Remove arbitrary limit of 2**31 entries in hash tables. (Bug#8771)
3870d916
PE
4806 * category.c (hash_get_category_set):
4807 * ccl.c (ccl_driver):
4808 * charset.c (Fdefine_charset_internal):
4809 * charset.h (struct charset.hash_index):
4810 * composite.c (get_composition_id, gstring_lookup_cache)
4811 (composition_gstring_put_cache):
4812 * composite.h (struct composition.hash_index):
4813 * dispextern.h (struct image.hash):
4814 * fns.c (next_almost_prime, larger_vector, cmpfn_eql)
4815 (cmpfn_equal, cmpfn_user_defined, hashfn_eq, hashfn_eql)
4816 (hashfn_equal, hashfn_user_defined, make_hash_table)
4817 (maybe_resize_hash_table, hash_lookup, hash_put)
4818 (hash_remove_from_table, hash_clear, sweep_weak_table, SXHASH_COMBINE)
4819 (sxhash_string, sxhash_list, sxhash_vector, sxhash_bool_vector)
4820 (Fsxhash, Fgethash, Fputhash, Fmaphash):
4821 * image.c (make_image, search_image_cache, lookup_image)
4822 (xpm_put_color_table_h):
4823 * lisp.h (struct Lisp_Hash_Table):
0de4bb68 4824 * minibuf.c (Ftry_completion, Fall_completions, Ftest_completion):
ac389d0c 4825 * print.c (print): Use 'EMACS_UINT' and 'EMACS_INT'
3870d916 4826 for hashes and hash indexes, instead of 'unsigned' and 'int'.
40087514
PE
4827 * alloc.c (allocate_vectorlike):
4828 Check for overflow in vector size calculations.
4829 * ccl.c (ccl_driver):
4830 Check for overflow when converting EMACS_INT to int.
0de4bb68
PE
4831 * fns.c, image.c: Remove unnecessary static decls that would otherwise
4832 need to be updated by these changes.
40087514
PE
4833 * fns.c (make_hash_table, maybe_resize_hash_table):
4834 Check for integer overflow with large hash tables.
0de4bb68
PE
4835 (make_hash_table, maybe_resize_hash_table, Fmake_hash_table):
4836 Prefer the faster XFLOAT_DATA to XFLOATINT where either will do.
4837 (SXHASH_REDUCE): New macro.
4838 (sxhash_string, sxhash_list, sxhash_vector, sxhash_bool_vector):
4839 Use it instead of discarding useful hash info with large hash values.
4840 (sxhash_float): New function.
4841 (sxhash): Use it. No more need for "& INTMASK" due to above changes.
4842 * lisp.h (FIXNUM_BITS): New macro, useful for SXHASH_REDUCE etc.
40087514
PE
4843 (MOST_NEGATIVE_FIXNUM, MOST_POSITIVE_FIXNUM, INTMASK):
4844 Rewrite to use FIXNUM_BITS, as this simplifies things.
0de4bb68
PE
4845 (next_almost_prime, larger_vector, sxhash, hash_lookup, hash_put):
4846 Adjust signatures to match updated version of code.
4847 (consing_since_gc): Now EMACS_INT, since a single hash table can
4848 use more than INT_MAX bytes.
4849
698d32e2
DN
48502011-06-01 Dan Nicolaescu <dann@ics.uci.edu>
4851
4852 Make it possible to build with GCC-4.6+ -O2 -flto.
4853
4854 * emacs.c (__malloc_initialize_hook): Mark as EXTERNALLY_VISIBLE.
4855
fd6fa53f
SM
48562011-06-01 Stefan Monnier <monnier@iro.umontreal.ca>
4857
4858 * minibuf.c (get_minibuffer, read_minibuf_unwind):
4859 Call minibuffer-inactive-mode.
4860
864db017
JB
48612011-05-31 Juanma Barranquero <lekktu@gmail.com>
4862
4863 * makefile.w32-in ($(BLD)/data.$(O), $(BLD)/editfns.$(O)):
4864 Update dependencies.
4865
2ad0baf4
DN
48662011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
4867
4868 * data.c (init_data): Remove code for UTS, this system is not
4869 supported anymore.
4870
4fcc2638
DN
48712011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
4872
4873 Don't force ./temacs to start in terminal mode.
4874
4875 * frame.c (make_initial_frame): Initialize faces in all cases, not
4876 only when CANNOT_DUMP is defined.
4877 * dispnew.c (init_display): Remove CANNOT_DUMP condition.
4878
c56e0fd5
DN
48792011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
4880
4881 * dispnew.c (add_window_display_history): Use const for the string
4882 pointer. Remove declaration, not needed.
4883
333d54da 48842011-05-31 Paul Eggert <eggert@cs.ucla.edu>
9cf9f756 4885
55d4c1b2 4886 Use 'inline', not 'INLINE'.
333d54da 4887 <http://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00914.html>
55d4c1b2
PE
4888 * alloc.c, fontset.c (INLINE): Remove.
4889 * alloc.c, bidi.c, charset.c, coding.c, dispnew.c, fns.c, image.c:
4890 * intervals.c, keyboard.c, process.c, syntax.c, textprop.c, w32term.c:
4891 * xdisp.c, xfaces.c, xterm.c: Replace all uses of INLINE with inline.
4892 * gmalloc.c (register_heapinfo): Use inline unconditionally.
4893 * lisp.h (LISP_MAKE_RVALUE): Use inline, not __inline__.
4894
738db178
DN
48952011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
4896
4897 Make it possible to run ./temacs.
4898
4899 * callproc.c (set_initial_environment): Remove CANNOT_DUMP code,
4900 syms_of_callproc does the same thing. Remove test for
4901 "initialized", do it in the caller.
4902 * emacs.c (main): Avoid calling set_initial_environment when dumping.
4903
620c53a6
SM
49042011-05-31 Stefan Monnier <monnier@iro.umontreal.ca>
4905
4906 * minibuf.c (Finternal_complete_buffer): Return `category' metadata.
4907 (read_minibuf): Use get_minibuffer.
4908 (syms_of_minibuf): Use DEFSYM.
4909 (Qmetadata): New var.
4910 * data.c (Qbuffer): Don't make it static.
4911 (syms_of_data): Use DEFSYM.
4912
e003a292
PE
49132011-05-31 Paul Eggert <eggert@cs.ucla.edu>
4914
4915 * ccl.c (CCL_CODE_RANGE): Allow negative numbers. (Bug#8751)
4916 (CCL_CODE_MIN): New macro.
4917
ed008a6d
PE
49182011-05-30 Paul Eggert <eggert@cs.ucla.edu>
4919
3687c2ef
PE
4920 * alloc.c (lisp_align_malloc): Omit unnecessary val==NULL tests.
4921
ed008a6d
PE
4922 * eval.c (Qdebug): Now static.
4923 * lisp.h (Qdebug): Remove decl. This reverts a part of the
4924 2011-04-26T11:26:05Z!dan.colascione@gmail.com that inadvertently undid part of
4925 2011-04-14T06:48:41Z!eggert@cs.ucla.edu.
4926
d66c4c7c
CY
49272011-05-29 Chong Yidong <cyd@stupidchicken.com>
4928
4929 * image.c: Various fixes to ImageMagick code comments.
4930 (Fimagemagick_types): Doc fix.
4931
5fbc2025
PE
49322011-05-29 Paul Eggert <eggert@cs.ucla.edu>
4933
0196f88a
PE
4934 Minor fixes prompted by GCC 4.6.0 warnings.
4935
4936 * xselect.c (converted_selections, conversion_fail_tag): Now static.
4937
5fbc2025
PE
4938 * emacs.c [HAVE_X_WINDOWS]: Include "xterm.h".
4939 (x_clipboard_manager_save_all): Move extern decl to ...
4940 * xterm.h: ... here, so that it can be checked for consistency.
4941
1dd3c2d9
CY
49422011-05-29 Chong Yidong <cyd@stupidchicken.com>
4943
4944 * xselect.c (x_clipboard_manager_save_frame)
4945 (x_clipboard_manager_save_all): New functions.
4946 (Fx_clipboard_manager_save): Lisp function deleted.
4947
4948 * emacs.c (Fkill_emacs): Call x_clipboard_manager_save_all.
4949 * frame.c (delete_frame): Call x_clipboard_manager_save_frame.
4950
4951 * xterm.h: Update prototype.
4952
5ba6571d
WX
49532011-05-28 William Xu <william.xwl@gmail.com>
4954
4955 * nsterm.m (ns_term_shutdown): Synchronize user defaults before
4956 exiting (Bug#8239).
4957
3eaff834
JM
49582011-05-28 Jim Meyering <meyering@redhat.com>
4959
e1900994 4960 Avoid a sign-extension bug in crypto_hash_function.
3eaff834
JM
4961 * fns.c (to_uchar): Define.
4962 (crypto_hash_function): Use it to convert some newly-signed
4963 variables to unsigned, to avoid sign-extension bugs. For example,
4964 without this change, (md5 "truc") would evaluate to
4965 45723a2aff78ff4fff7fff1114760e62 rather than the expected
4966 45723a2af3788c4ff17f8d1114760e62. Reported by Antoine Levitt in
e1900994 4967 https://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00883.html.
3eaff834 4968
0f6990a7
PE
49692011-05-27 Paul Eggert <eggert@cs.ucla.edu>
4970
4971 Integer overflow fixes.
c8a9ca5a 4972
08686060
PE
4973 * dbusbind.c: Serial number integer overflow fixes.
4974 (CHECK_DBUS_SERIAL_GET_SERIAL): New macro.
08686060
PE
4975 (Fdbus_call_method_asynchronously, xd_read_message_1): Use a float
4976 to hold a serial number that is too large for a fixnum.
4977 (Fdbus_method_return_internal, Fdbus_method_error_internal):
4978 Check for serial numbers out of range. Decode any serial number
59568bf0 4979 that was so large that it became a float. (Bug#8722)
08686060 4980
2d1fc3c7
PE
4981 * dbusbind.c: Use XFASTINT rather than XUINT, and check for nonneg.
4982 (Fdbus_call_method, Fdbus_call_method_asynchronously):
4983 Use XFASTINT rather than XUINT when numbers are nonnegative.
4984 (xd_append_arg, Fdbus_method_return_internal):
4985 (Fdbus_method_error_internal): Likewise. Also, for unsigned
4986 arguments, check that Lisp number is nonnegative, rather than
59568bf0 4987 silently wrapping negative numbers around. (Bug#8722)
30217ff0 4988 (xd_read_message_1): Don't assume dbus_uint32_t can fit in int.
59568bf0 4989 (Bug#8722)
2d1fc3c7 4990
c8a9ca5a
PE
4991 * data.c (arith_driver, Flsh): Avoid unnecessary casts to EMACS_UINT.
4992
519e1d69
PE
4993 * ccl.c (ccl_driver): Redo slightly to avoid the need for 'unsigned'.
4994
30569699
PE
4995 ccl: add integer overflow checks
4996 * ccl.c (CCL_CODE_MAX, GET_CCL_RANGE, GET_CCL_CODE, GET_CCL_INT):
4997 (IN_INT_RANGE): New macros.
4998 (ccl_driver): Use them to check for integer overflow when
4999 decoding a CCL program. Many of the new checks are whether XINT (x)
5000 fits in int; it doesn't always, on 64-bit hosts. The new version
5001 doesn't catch all possible integer overflows, but it's an
847044ea 5002 improvement. (Bug#8719)
30569699 5003
c11285dc
PE
5004 * alloc.c (make_event_array): Use XINT, not XUINT.
5005 There's no need for unsigned here.
5006
fdccd48e
PE
5007 * mem-limits.h (EXCEEDS_LISP_PTR) [!USE_LSB_TAG]: EMACS_UINT -> uintptr_t
5008 This follows up to the 2011-05-06 change that substituted uintptr_t
5009 for EMACS_INT. This case wasn't caught back then.
5010
37910ab2
PE
5011 Rework Fformat to avoid integer overflow issues.
5012 * editfns.c: Include <float.h> unconditionally, as it's everywhere
5013 now (part of C89). Include <verify.h>.
5014 (MAX_10_EXP, CONVERTED_BYTE_SIZE): Remove; no longer needed.
5015 (pWIDE, pWIDElen, signed_wide, unsigned_wide): New defns.
5016 (Fformat): Avoid the prepass trying to compute sizes; it was only
5017 approximate and thus did not catch overflow reliably. Instead, walk
5018 through the format just once, formatting and computing sizes as we go,
5019 checking for integer overflow at every step, and allocating a larger
5020 buffer as needed. Keep track separately whether the format is
5021 multibyte. Keep only the most-recently calculated precision, rather
5022 than them all. Record whether each argument has been converted to
5023 string. Use EMACS_INT, not int, for byte and char and arg counts.
5024 Support field widths and precisions larger than INT_MAX. Avoid
5025 sprintf's undefined behavior with conversion specifications such as %#d
5026 and %.0c. Fix bug with strchr succeeding on '\0' when looking for
5027 flags. Fix bug with (format "%c" 256.0). Avoid integer overflow when
5028 formatting out-of-range floating point numbers with int
9173deec 5029 formats. (Bug#8668)
37910ab2 5030
2e6578fb
PE
5031 * lisp.h (FIXNUM_OVERFLOW_P): Work even if arg is a NaN.
5032
0ae6bdee
PE
5033 * data.c: Avoid integer truncation in expressions involving floats.
5034 * data.c: Include <intprops.h>.
5035 (arith_driver): When there's an integer overflow in an expression
5036 involving floating point, convert the integers to floating point
5037 so that the resulting value does not suffer from catastrophic
5038 integer truncation. For example, on a 64-bit host (* 4
5039 most-negative-fixnum 0.5) should yield about -4.6e+18, not zero.
5040 Do not rely on undefined behavior after integer overflow.
5041
de883a70
PE
5042 merge count_size_as_multibyte, parse_str_to_multibyte
5043 * character.c, character.h (count_size_as_multibyte):
fd6fa53f 5044 Rename from parse_str_to_multibyte; all uses changed.
de883a70
PE
5045 Check for integer overflow.
5046 * insdel.c, lisp.h (count_size_as_multibyte): Remove,
5047 since it's now a duplicate of the other. This is more of
5048 a character than a buffer op, so better that it's in character.c.
5049 * fns.c, print.c: Adjust to above changes.
5050
2ff916cb
PE
50512011-05-27 Stefan Monnier <monnier@iro.umontreal.ca>
5052
5053 * xselect.c (x_convert_selection): Yet another int/Lisp_Object mixup.
5054
f1b54466
PE
50552011-05-27 Paul Eggert <eggert@cs.ucla.edu>
5056
fb1ac845
PE
5057 * xselect.c: Fix minor problems prompted by GCC 4.6.0 warnings.
5058 (x_handle_selection_request, frame_for_x_selection): Remove unused vars.
5059 (x_clipboard_manager_save): Now static.
5060 (Fx_clipboard_manager_save): Rename local to avoid shadowing.
5061
f1b54466
PE
5062 * fns.c: Fix minor problems prompted by GCC 4.6.0 warnings.
5063 (crypto_hash_function): Now static.
5064 Fix pointer signedness problems. Avoid unnecessary initializations.
5065
a9f737ee
CY
50662011-05-27 Chong Yidong <cyd@stupidchicken.com>
5067
5068 * termhooks.h (Vselection_alist): Make it terminal-local.
5069
5070 * terminal.c (create_terminal): Initialize it.
5071
5072 * xselect.c: Support for clipboard managers.
5073 (Vselection_alist): Move to termhooks.h as terminal-local var.
5074 (LOCAL_SELECTION): New macro.
5075 (x_atom_to_symbol): Handle x_display_info_for_display fail case.
5076 (symbol_to_x_atom): Remove gratuitous arg.
5077 (x_handle_selection_request, lisp_data_to_selection_data)
5078 (x_get_foreign_selection, Fx_register_dnd_atom): Callers changed.
620c53a6
SM
5079 (x_own_selection, x_get_local_selection, x_convert_selection):
5080 New arg, specifying work frame. Use terminal-local Vselection_alist.
a9f737ee
CY
5081 (some_frame_on_display): Delete unused function.
5082 (Fx_own_selection_internal, Fx_get_selection_internal)
5083 (Fx_disown_selection_internal, Fx_selection_owner_p)
5084 (Fx_selection_exists_p): New optional frame arg.
5085 (frame_for_x_selection, Fx_clipboard_manager_save): New functions.
5086 (x_handle_selection_clear): Don't treat other terminals with the
5087 same keyboard specially. Use the terminal-local Vselection_alist.
5088 (x_clear_frame_selections): Use Frun_hook_with_args.
5089
5090 * xterm.c (x_term_init): Intern ATOM and CLIPBOARD_MANAGER atoms.
5091
5092 * xterm.h: Add support for those atoms.
5093
e067f0c1
CY
50942011-05-26 Chong Yidong <cyd@stupidchicken.com>
5095
5096 * xselect.c: ICCCM-compliant handling of MULTIPLE targets.
5097 (converted_selections, conversion_fail_tag): New global variables.
5098 (x_selection_request_lisp_error): Free the above.
5099 (x_get_local_selection): Remove unnecessary code.
5100 (x_reply_selection_request): Args changed; handle arbitrary array
620c53a6
SM
5101 of converted selections stored in converted_selections.
5102 Separate the XChangeProperty and SelectionNotify steps.
e067f0c1
CY
5103 (x_handle_selection_request): Rewrite to handle MULTIPLE target.
5104 (x_convert_selection): New function.
5105 (x_handle_selection_event): Simplify.
5106 (x_get_foreign_selection): Don't ignore incoming requests while
5107 waiting for an answer; this will fail when we implement
5108 SAVE_TARGETS, and seems unnecessary anyway.
5109 (selection_data_to_lisp_data): Recognize ATOM_PAIR type.
5110 (Vx_sent_selection_functions): Doc fix.
5111
0f4aebc0
LL
51122011-05-26 Leo Liu <sdl.web@gmail.com>
5113
5114 * editfns.c (Ftranspose_regions): Allow empty regions. (Bug#8699)
5115
e61124cd
YM
51162011-05-25 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
5117
5118 * dispextern.h (struct glyph_row): New member fringe_bitmap_periodic_p.
5119
5120 * dispnew.c (shift_glyph_matrix, scrolling_window): Mark scrolled row
5121 for fringe update if it has periodic bitmap.
ac389d0c 5122 (row_equal_p): Also compare left_fringe_offset, right_fringe_offset,
e61124cd
YM
5123 and fringe_bitmap_periodic_p.
5124
5125 * fringe.c (get_fringe_bitmap_data): New function.
5126 (draw_fringe_bitmap_1, update_window_fringes): Use it.
5127 (update_window_fringes): Record periodicity of fringe bitmap in glyph
5128 row. Mark glyph row for fringe update if periodicity changed.
5129
5130 * xdisp.c (try_window_reusing_current_matrix): Don't mark scrolled row
5131 for fringe update unless it has periodic bitmap.
5132
f16d9837
KH
51332011-05-25 Kenichi Handa <handa@m17n.org>
5134
5135 * xdisp.c (get_next_display_element): Set correct it->face_id for
5136 a static composition.
5137
e1b90ef6
LL
51382011-05-24 Leo Liu <sdl.web@gmail.com>
5139
5140 * deps.mk (fns.o):
5141 * makefile.w32-in ($(BLD)/fns.$(O)): Include sha1.h.
5142
5143 * fns.c (crypto_hash_function, Fsha1): New function.
5144 (Fmd5): Use crypto_hash_function.
5145 (syms_of_fns): Add Ssha1.
5146
7400048f
PE
51472011-05-22 Paul Eggert <eggert@cs.ucla.edu>
5148
5149 * gnutls.c: Remove unused macros.
5150 (fn_gnutls_transport_set_lowat, fn_gnutls_transport_set_pull_function):
5151 (fn_gnutls_transport_set_push_function) [!WINDOWSNT]:
5152 Remove macros that are defined and never used.
5153 Caught by gcc -Wunused-macros (GCC 4.6.0, Fedora 14).
5154
abb71cf4
CY
51552011-05-22 Chong Yidong <cyd@stupidchicken.com>
5156
5157 * xselect.c (syms_of_xselect): Remove unused symbol SAVE_TARGETS.
5158 (Fx_get_selection_internal): Minor cleanup.
5159 (Fx_own_selection_internal): Rename arguments for consistency with
5160 select.el.
5161
6307db39
PE
51622011-05-22 Paul Eggert <eggert@cs.ucla.edu>
5163
5164 * xselect.c (QSAVE_TARGETS): New static var, to fix build failure.
5165
f3d4e0a4
CY
51662011-05-22 Chong Yidong <cyd@stupidchicken.com>
5167
5168 * xselect.c (syms_of_xselect): Include character.h; use DEFSYM.
5169
4d8ade89
YM
51702011-05-21 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
5171
5172 * dispnew.c (scrolling_window): Don't exclude the case that the
5173 last enabled row in the desired matrix touches the bottom boundary.
5174
32078c8d
GM
51752011-05-21 Glenn Morris <rgm@gnu.org>
5176
5177 * Makefile.in ($(etc)/DOC): Make second command line even shorter.
33cf345f
GM
5178 (SOME_MACHINE_OBJECTS): Replace FONT_OBJ by its maximal expansion,
5179 and add some more files.
32078c8d 5180
7285dc67
EZ
51812011-05-20 Eli Zaretskii <eliz@gnu.org>
5182
5183 * callproc.c (Fcall_process) [MSDOS]: Fix arguments to
5184 report_file_error introduced by the change from 2011-05-07.
5185
89d1bd22
PE
51862011-05-20 Paul Eggert <eggert@cs.ucla.edu>
5187
5188 * systime.h (Time): Define only if emacs is defined.
5189 This is to allow ../lib-src/profile.c to be compiled on FreeBSD,
5190 where the include path doesn't have X11/X.h by default. See
5191 <http://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00561.html>.
5192
e23640bb 51932011-05-20 Kenichi Handa <handa@m17n.org>
31bfc35c
KH
5194
5195 * composite.c (find_automatic_composition): Fix previous change.
5196
b9704ad9
GM
51972011-05-20 Glenn Morris <rgm@gnu.org>
5198
5199 * lisp.mk: New file, split from Makefile.in.
5200 * Makefile.in (lisp): Move to separate file, inserted by @lisp_frag@.
5201 (shortlisp): Remove.
5202 ($(etc)/DOC): Edit lisp.mk rather than using $shortlisp.
5203
4a720484
GM
52042011-05-19 Glenn Morris <rgm@gnu.org>
5205
5206 * Makefile.in (MSDOS_SUPPORT_REAL, MSDOS_SUPPORT, NS_SUPPORT)
5207 (REAL_MOUSE_SUPPORT, GPM_MOUSE_SUPPORT, MOUSE_SUPPORT, TOOLTIP_SUPPORT)
5208 (BASE_WINDOW_SUPPORT, X_WINDOW_SUPPORT, WINDOW_SUPPORT): Remove.
5209 (lisp): Set the order to that of loadup.el.
5210 (shortlisp): Make it a copy of $lisp.
5211 (SOME_MACHINE_LISP): Remove.
5212 ($(etc)/DOC): Depend just on $lisp, not $SOME_MACHINE_LISP too.
5213 Use just $shortlisp, not $SOME_MACHINE_LISP too.
5214
a28d4396
KH
52152011-05-18 Kenichi Handa <handa@m17n.org>
5216
5217 * composite.c (CHAR_COMPOSABLE_P): Add more check for efficiency.
5218 (BACKWARD_CHAR): Wrap the arg STOP by parenthesis.
5219 (find_automatic_composition): Mostly rewrite for efficiency.
5220
a2b1fa8e
JB
52212011-05-18 Juanma Barranquero <lekktu@gmail.com>
5222
5223 * makefile.w32-in: Update dependencies.
5224
8e1f5610
CS
52252011-05-18 Christoph Scholtes <cschol2112@googlemail.com>
5226
5227 * menu.c: Include limits.h (fixes the MS-Windows build broken by
7d7d0045 5228 2011-06-18T18:49:19Z!cyd@stupidchicken.com).
8e1f5610 5229
7025ee00 52302011-05-18 Paul Eggert <eggert@cs.ucla.edu>
cb93f9be 5231
cdfa6eab
PE
5232 Fix some integer overflow issues, such as string length overflow.
5233
06d6db33
PE
5234 * insdel.c (count_size_as_multibyte): Check for string overflow.
5235
2b4560a8
PE
5236 * character.c (lisp_string_width): Check for string overflow.
5237 Use EMACS_INT, not int, for string indexes and lengths; in
5238 particular, 2nd arg is now EMACS_INT, not int. Do not crash if
5239 the resulting string length overflows an EMACS_INT; instead,
5240 report a string overflow if no precision given. When checking for
5241 precision exhaustion, use a check that cannot possibly have
5242 integer overflow. (Bug#8675)
5243 * character.h (lisp_string_width): Adjust to new signature.
5244
cb93f9be
PE
5245 * alloc.c (string_overflow): New function.
5246 (Fmake_string): Use it. This doesn't change behavior, but saves
5247 a few bytes and will simplify future changes.
5248 * character.c (string_escape_byte8): Likewise.
5249 * lisp.h (string_overflow): New decl.
5250
1a1f3366
PE
5251 Fixups, following up to the user-interface timestamp change.
5252 * nsterm.m (last_mouse_movement_time, ns_mouse_position): Use Time
5253 for UI timestamps, instead of unsigned long.
9fbd6841
PE
5254 * msdos.c (mouse_get_pos): Likewise.
5255 * w32inevt.c (movement_time, w32_console_mouse_position): Likewise.
1a1f3366
PE
5256 * w32gui.h (Time): Define by including "systime.h" rather than by
5257 declaring it ourselves. (Bug#8664)
5258
d4e3e4d3
PE
5259 * dispextern.h (struct image): Don't assume time_t <= unsigned long.
5260 * image.c (clear_image_cache): Likewise.
5261
f6a24d19
PE
5262 * term.c (term_mouse_position): Don't assume time_t wraparound.
5263
08dc5ae6
PE
5264 Be more systematic about user-interface timestamps.
5265 Before, the code sometimes used 'Time', sometimes 'unsigned long',
620c53a6
SM
5266 and sometimes 'EMACS_UINT', to represent these timestamps.
5267 This change causes it to use 'Time' uniformly, as that's what X uses.
08dc5ae6
PE
5268 This makes the code easier to follow, and makes it easier to catch
5269 integer overflow bugs such as Bug#8664.
5270 * frame.c (Fmouse_position, Fmouse_pixel_position):
5271 Use Time, not unsigned long, for user-interface timestamps.
5272 * keyboard.c (last_event_timestamp, kbd_buffer_get_event): Likewise.
5273 (button_down_time, make_lispy_position, make_lispy_movement): Likewise.
5274 * keyboard.h (last_event_timestamp): Likewise.
5275 * menu.c (Fx_popup_menu) [!HAVE_X_WINDOWS]: Likewise.
5276 * menu.h (xmenu_show): Likewise.
5277 * term.c (term_mouse_position): Likewise.
5278 * termhooks.h (struct input_event.timestamp): Likewise.
5279 (struct terminal.mouse_position_hook): Likewise.
5280 * xmenu.c (create_and_show_popup_menu, xmenu_show): Likewise.
5281 * xterm.c (XTmouse_position, x_scroll_bar_report_motion): Likewise.
5282 * systime.h (Time): New decl. Pull it in from <X11/X.h> if
5283 HAVE_X_WINDOWS, otherwise define it as unsigned long, which is
5284 what it was before.
5285 * menu.h, termhooks.h: Include "systime.h", for Time.
5286
8e55734a
PE
5287 * keyboard.c (make_lispy_event): Fix problem in integer overflow.
5288 Don't assume that the difference between two unsigned long values
5289 can fit into an integer. At this point, we know button_down_time
5290 <= event->timestamp, so the difference must be nonnegative, so
5291 there's no need to cast the result if double-click-time is
5292 nonnegative, as it should be; check that it's nonnegative, just in
5293 case. This bug is triggered when events are more than 2**31 ms
86db42d2 5294 apart (about 25 days). (Bug#8664)
8e55734a 5295
841f1b75 5296 * xselect.c (last_event_timestamp): Remove duplicate decl.
6434756c 5297 (x_own_selection): Remove needless cast to unsigned long.
841f1b75 5298
3e26f69c
PE
5299 * xmenu.c (set_frame_menubar): Use int, not EMACS_UINT, for indexes
5300 that always fit in int. Use a sentinel instead of a counter, to
5301 avoid a temp and to allay GCC's concerns about possible int overflow.
d230cb74
PE
5302 * frame.h (struct frame): Use int for menu_bar_items_used
5303 instead of EMACS_INT, since it always fits in int.
3e26f69c 5304
5cc152c0
PE
5305 * menu.c (grow_menu_items): Check for int overflow.
5306
d89eb65e
PE
5307 * xmenu.c (set_frame_menubar): Don't mishandle vectors with no nils.
5308
5235bd3e
PE
5309 * xterm.c: Use EMACS_INT for Emacs modifiers, and int for X modifiers.
5310 Before, the code was not consistent. These values cannot exceed
5311 2**31 - 1 so there's no need to make them unsigned.
5312 (x_x_to_emacs_modifiers): Accept int and return EMACS_INT.
5313 (x_emacs_to_x_modifiers): Accept EMACS_INT and return int.
5314 (x_x_to_emacs_modifiers, x_emacs_to_x_modifiers): Reject non-integers
5315 as modifiers.
5316 * xterm.h (x_x_to_emacs_modifiers): Adjust to signature change.
5317
bc827e23
PE
5318 * lisp.h (XINT) [USE_LISP_UNION_TYPE]: Cast to EMACS_INT.
5319 (XUINT) [USE_LISP_UNION_TYPE]: Cast to EMACS_UINT.
5320 Otherwise, GCC 4.6.0 warns about printf (pI, XINT (...)),
5321 presumably because the widths might not match.
5322
78eb494e
PE
5323 * window.c (size_window): Avoid needless test at loop start.
5324
04f2d78b
CB
53252011-05-18 Courtney Bane <emacs-bugs-7626@cbane.org> (tiny change)
5326
5327 * term.c (Fresume_tty): Restore hooks before reinitializing (bug#8687).
5328
d2fc7e3d 53292011-05-12 Drew Adams <drew.adams@oracle.com>
e531bdff
DA
5330
5331 * textprop.c (Fprevious_single_char_property_change): Doc fix (bug#8655).
5332
d2fc7e3d 53332011-05-12 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
7db47798
YM
5334
5335 * w32term.c (w32_draw_fringe_bitmap): Rename local vars `left' and
5336 `width' to `bar_area_x' and `bar_area_width', respectively.
5337 (x_scroll_run): Take account of fringe background extension.
5338
04f2d78b
CB
5339 * xterm.c (x_draw_fringe_bitmap) [USE_TOOLKIT_SCROLL_BARS]:
5340 Rename local vars `left' and `width' to `bar_area_x' and
7db47798
YM
5341 `bar_area_width', respectively.
5342 (x_scroll_run) [USE_TOOLKIT_SCROLL_BARS]: Take account of fringe
5343 background extension.
5344
79b70037
GM
53452011-05-10 Jim Meyering <meyering@redhat.com>
5346
5347 * xdisp.c (x_intersect_rectangles): Fix typo "the the -> the".
5348
2f142cc5
JB
53492011-05-10 Juanma Barranquero <lekktu@gmail.com>
5350
5351 * image.c (Finit_image_library): Return t for built-in image types,
5352 like pbm and xbm. (Bug#8640)
5353
57679c86
AS
53542011-05-09 Andreas Schwab <schwab@linux-m68k.org>
5355
5356 * w32menu.c (set_frame_menubar): Fix submenu allocation.
5357
888c9e86
EZ
53582011-05-07 Eli Zaretskii <eliz@gnu.org>
5359
b0512a1d
EZ
5360 * w32console.c (Fset_screen_color): Doc fix.
5361 (Fget_screen_color): New function.
5362 (syms_of_ntterm): Defsubr it.
5363
7285dc67
EZ
5364 * callproc.c (call_process_cleanup) [MSDOS]: Don't close and
5365 unlink the temporary file if Fcall_process didn't create it in the
5366 first place.
5367 (Fcall_process) [MSDOS]: Don't create tempfile if stdout of the
5368 child process will be redirected to a file specified with `:file'.
888c9e86
EZ
5369 Don't try to re-open tempfile in that case, and set fd[0] to -1 as
5370 cue to call_process_cleanup not to close that handle.
5371
4d3fcc8e
BK
53722011-05-07 Ben Key <bkey76@gmail.com>
5373
5374 * makefile.w32-in: The bootstrap-temacs rule now makes use of
5375 one of two shell specific rules, either bootstrap-temacs-CMD or
5376 bootstrap-temacs-SH. The bootstrap-temacs-SH rule is identical
5377 to the previous implementation of the bootstrap-temacs rule.
5378 The bootstrap-temacs-CMD rule is similar to the previous
5379 implementation of the bootstrap-temacs rule except that it
5380 makes use of the ESC_CFLAGS variable instead of the CFLAGS
5381 variable.
5382
5383 These changes, along with some changes to nt/configure.bat,
5384 nt/gmake.defs, and nt/nmake.defs, are required to extend my
5385 earlier fix to add support for --cflags and --ldflags options
5386 that include quotes so that it works whether make uses cmd or
5387 sh as the shell.
5388
b4289b64
MA
53892011-05-06 Michael Albinus <michael.albinus@gmx.de>
5390
5391 * dbusbind.c (QCdbus_type_unix_fd): Declare static.
5392 (xd_remove_watch): Don't check QCdbus_type_unix_fd for SYMBOLP, it
5393 is a constant.
5394 (Fdbus_init_bus, xd_read_queued_messages): Bus can be a symbol or
5395 a string. Handle both cases.
5396 (Fdbus_call_method_asynchronously, Fdbus_register_signal)
5397 (Fdbus_register_method): Use Qinvalid_function.
5398
af4c0e28
JB
53992011-05-06 Juanma Barranquero <lekktu@gmail.com>
5400
5401 * makefile.w32-in: Update dependencies.
5402 (LISP_H): Add inttypes.h and stdin.h.
5403 (PROCESS_H): Add unistd.h.
5404
c51453d9
EZ
54052011-05-06 Eli Zaretskii <eliz@gnu.org>
5406
5407 * lread.c: Include limits.h (fixes the MS-Windows build broken by
5408 2011-05-06T07:13:19Z!eggert@cs.ucla.edu).
5409
8ff0ac3c 54102011-05-06 Paul Eggert <eggert@cs.ucla.edu>
c032b5f8 5411
4c4b566b
PE
5412 * image.c (Finit_image_library) [!HAVE_NTGUI]: Omit unused local.
5413
aab2b9b5
PE
5414 * term.c (vfatal): Remove stray call to va_end.
5415 It's not needed and the C Standard doesn't allow it here anyway.
5416
c378da0b
PE
5417 Use C99's va_copy to avoid undefined behavior on x86-64 GNU/Linux.
5418 * eval.c (verror): doprnt a copy of ap, not the original. (Bug#8545)
5419
288b08c7
PE
5420 * eval.c (verror): OK to create a string of up to MOST_POSITIVE_FIXNUM
5421 bytes.
5422
e3601888
PE
5423 * term.c: Don't include <stdarg.h>, as <lisp.h> does that.
5424
db6c0e74
PE
5425 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork clobbering.
5426
dd5963ea
PE
5427 * process.c (Fformat_network_address): Fix typo: args2 -> *args2.
5428
88c9450f
PE
5429 * xmenu.c (set_frame_menubar): Fix typo: int * -> int (3 times).
5430
2f9442b8
PE
5431 * coding.c (detect_coding_charset): Fix typo: * 2 -> *4 (Bug#8601).
5432
c032b5f8
PE
5433 * charset.h (struct charset.code_space): Now has 15 elements, not 16.
5434 * charset.c (Fdefine_charset_internal): Don't initialize
5435 charset.code_space[15]. The value was garbage, on hosts with
2d38271b 5436 32-bit int (Bug#8600).
a108c10b
PE
5437
5438 * lread.c (read_integer): Be more consistent with string-to-number.
5439 Use string_to_number to do the actual conversion; this avoids
5440 rounding errors and fixes some other screwups. Without this fix,
5441 for example, #x1fffffffffffffff was misread as -2305843009213693952.
5442 (digit_to_number): Move earlier, for benefit of read_integer.
5443 Return -1 if the digit is out of range for the base, -2 if it is
48e400f0 5444 not a digit in any supported base. (Bug#8602)
a108c10b 5445
ad5f9eea
PE
5446 * doprnt.c (doprnt): Support arbitrary pI values, such as "I64".
5447
aec1708a
PE
5448 * dispnew.c (scrolling_window): Return 1 if we scrolled,
5449 to match comment at start of function. This also removes a
5450 GCC warning about overflow in a 32+64-bit port.
5451
47be4ab5
PE
5452 * lisp.h (EMACS_INT, EMACS_UINT, BITS_PER_EMACS_INT, pI): Simplify.
5453
371cac43
PE
5454 * dbusbind.c: Do not use XPNTR on a value that may be an integer.
5455 Reported by Stefan Monnier in
5456 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00919.html>.
04f2d78b
CB
5457 (xd_remove_watch, Fdbus_init_bus, xd_read_queued_messages):
5458 Use SYMBOLP-guarded XSYMBOL, not XPNTR.
371cac43 5459
d01a7826
PE
5460 * lisp.h (EMACS_INTPTR): Remove. All uses changed to intptr_t.
5461 (EMACS_UINTPTR): Likewise, with uintptr_t.
5462
7fd47d5c
PE
5463 * lisp.h: Prefer 64-bit EMACS_INT if available.
5464 (EMACS_INT, EMACS_UINT, BITS_PER_EMACS_INT, pI): Define to 64-bit
5465 on 32-bit hosts that have 64-bit int, so that they can access
5466 large files.
122b0c86
PE
5467 However, temporarily disable this change unless the temporary
5468 symbol WIDE_EMACS_INT is defined.
7fd47d5c 5469
8727937b
PE
5470 * lread.c, process.c: Do not include <inttypes.h>; lisp.h does it now.
5471
8ac068ac
PE
5472 Prefer intptr_t/uintptr_t for integers the same widths as pointers.
5473 This removes an assumption that EMACS_INT and long are the same
5474 width as pointers. The assumption is true for Emacs porting targets
5475 now, but we want to make other targets possible.
5476 * lisp.h: Include <inttypes.h>, for INTPTR_MAX, UINTPTR_MAX.
5477 (EMACS_INTPTR, EMACS_UINTPTR): New macros.
5478 In the rest of the code, change types of integers that hold casted
5479 pointers to EMACS_INTPTR and EMACS_UINTPTR, systematically
5480 replacing EMACS_INT, long, EMACS_UINT, and unsigned long.
5481 (XTYPE): Don't cast arg to EMACS_UINT; normally is not needed.
5482 (XSET): Cast type of XTYPE arg to EMACS_INTPTR; it is needed here.
5483 No need to cast type when ORing.
5484 (XPNTR): Return a value of type EMACS_INTPTR or EMACS_UINTPTR.
5485 * alloc.c (lisp_align_malloc): Remove a no-longer-needed cast.
5486 * doc.c (store_function_docstring): Use EMACS_INTPTR, so as not to
5487 assume EMACS_INT is the same width as char *.
5488 * gtkutil.c (xg_gtk_scroll_destroy, xg_tool_bar_button_cb):
5489 (xg_tool_bar_callback, xg_tool_bar_help_callback, xg_make_tool_item):
5490 Remove no-longer-needed casts.
5491 (xg_create_scroll_bar, xg_tool_bar_button_cb, xg_tool_bar_callback):
5492 (xg_tool_bar_help_callback, xg_make_tool_item):
5493 Use EMACS_INTPTR to hold an integer
5494 that will be cast to void *; this can avoid a GCC warning
5495 if EMACS_INT is not the same width as void *.
5496 * menu.c (find_and_call_menu_selection): Remove no-longer-needed cast.
5497 * xdisp.c (display_echo_area_1, resize_mini_window_1):
5498 (current_message_1, set_message_1):
5499 Use a local to convert to proper width without a cast.
5500 * xmenu.c (dialog_selection_callback): Likewise.
5501
ede49d71
PE
5502 * sysdep.c (get_random): Don't assume EMACS_INT is no wider than long.
5503 Also, don't assume VALBITS / RAND_BITS is less than 5,
5504 and don't rely on undefined behavior when shifting a 1 left into
5505 the sign bit.
5506 * lisp.h (get_random): Change signature to match.
5507
2f30ecd0
PE
5508 * lread.c (hash_string): Use size_t, not int, for hash computation.
5509 Normally we prefer signed values; but hashing is special, because
5510 it's better to use unsigned division on hash table sizes so that
5511 the remainder is nonnegative. Also, size_t is the natural width
5512 for hashing into memory. The previous code used 'int', which doesn't
5513 retain enough info to hash well into very large tables.
5514 (oblookup, oblookup_last_bucket_number, Funintern): Likewise.
5515
2a866e7b
PE
5516 * dbusbind.c: Don't possibly lose pointer info when converting.
5517 (xd_remove_watch, Fdbus_init_bus, xd_read_queued_messages):
5518 Use XPNTR rather than XHASH, so that the high-order bits of
5519 the pointer aren't lost when converting through void *.
5520
51639eac
PE
5521 * eval.c (Fautoload): Don't double-shift a pointer.
5522
92394119
PE
5523 * fns.c (Frandom): Let EMACS_UINT be wider than unsigned long.
5524
dbdb9a7c
JB
55252011-05-06 Juanma Barranquero <lekktu@gmail.com>
5526
5527 * gnutls.c (DEF_GNUTLS_FN):
5528 * image.c (DEF_IMGLIB_FN): Make function pointers static.
5529
db7a0b4f
AS
55302011-05-05 Andreas Schwab <schwab@linux-m68k.org>
5531
5532 * lread.c (lisp_file_lexically_bound_p): Stop scanning at end
5533 marker. (Bug#8610)
5534
f7ff1b0f 55352011-05-05 Eli Zaretskii <eliz@gnu.org>
fab624aa
EZ
5536
5537 * w32heap.c (allocate_heap) [USE_LISP_UNION_TYPE || USE_LSB_TAG]:
5538 New version that can reserve upto 2GB of heap space.
5539
f7ff1b0f 55402011-05-05 Chong Yidong <cyd@stupidchicken.com>
45cb8994
CY
5541
5542 * nsfns.m (Fns_read_file_name): Doc fix (Bug#8534).
5543
639c109b
TZ
55442011-05-05 Teodor Zlatanov <tzz@lifelogs.com>
5545
5546 * gnutls.c (fn_gnutls_certificate_set_x509_key_file): Add alias to
5547 `gnutls_certificate_set_x509_key_file'.
5548
d2127135
JB
55492011-05-05 Juanma Barranquero <lekktu@gmail.com>
5550
5551 * makefile.w32-in ($(BLD)/image.$(O), $(BLD)/process.$(O)):
5552 Update dependencies.
5553
e968f4f3
JB
55542011-05-04 Juanma Barranquero <lekktu@gmail.com>
5555
5556 * gnutls.h (emacs_gnutls_write, emacs_gnutls_read):
5557 * gnutls.c (emacs_gnutls_write, emacs_gnutls_read):
5558 Remove unused parameter `fildes'.
5559 * process.c (read_process_output, send_process): Don't pass it.
5560
84d358f0
JB
55612011-05-04 Juanma Barranquero <lekktu@gmail.com>
5562
5563 Fix previous change: the library cache is defined in w32.c.
5564 * image.c (CACHE_IMAGE_TYPE) [!HAVE_NTGUI]: Define to noop.
5565 (Finit_image_library): Wrap Vlibrary_cache on "#ifdef HAVE_NTGUI".
5566
0898ca10
JB
55672011-05-04 Juanma Barranquero <lekktu@gmail.com>
5568
5569 Implement dynamic loading of GnuTLS on Windows.
5570
5571 * gnutls.h (GNUTLS_EMACS_ERROR_NOT_LOADED): New macro.
5572 (emacs_gnutls_write, emacs_gnutls_read): Mark as extern.
5573 (emacs_gnutls_record_check_pending, emacs_gnutls_transport_set_errno):
5574 Declare.
5575
5576 * gnutls.c (Qgnutls_dll): Define.
5577 (DEF_GNUTLS_FN, LOAD_GNUTLS_FN): New macros.
5578 (gnutls_*): Declare function pointers.
5579 (init_gnutls_functions): New function to initialize function pointers.
5580 (emacs_gnutls_handshake, Fgnutls_error_string, Fgnutls_deinit)
5581 (emacs_gnutls_global_init, Fgnutls_bye): Use function pointers.
5582 (emacs_gnutls_record_check_pending, emacs_gnutls_transport_set_errno):
5583 Wrappers for gnutls_record_check_pending and gnutls_transport_set_errno.
5584 (emacs_gnutls_write, emacs_gnutls_read)
5585 (emacs_gnutls_handle_error, Fgnutls_error_fatalp)
5586 (Fgnutls_available_p): New function.
5587 (Fgnutls_boot): Call Fgnutls_available_p. Use function pointers.
5588 (syms_of_gnutls) <Qgnutls_dll>: Initialize and staticpro it.
5589 (syms_of_gnutls) <Sgnutls_available_p>: defsubr it.
5590
5591 * image.c: Include w32.h.
5592 (Vimage_type_cache): Delete.
5593 (syms_of_image) <Vimage_type_cache>: Don't initialize and staticpro it.
5594 (CACHE_IMAGE_TYPE, Finit_image_library): Use Vlibrary_cache instead.
5595 (w32_delayed_load): Move to w32.c.
5596
5597 * w32.h (VlibraryCache, QCloaded_from, w32_delayed_load): Declare.
5598
5599 * w32.c (QCloaded_from, Vlibrary_cache): Define.
5600 (w32_delayed_load): Move from image.c. When loading a library, record
5601 its filename in the :loaded-from property of the library id.
5602 (globals_of_w32) <QCloaded_from, Vlibrary_cache>:
5603 Initialize and staticpro them.
5604 (emacs_gnutls_pull, emacs_gnutls_push): Call emacs_gnutls_* functions.
5605
5606 * process.c: Include lisp.h before w32.h, not after.
5607 (wait_reading_process_output): Call emacs_gnutls_record_check_pending
5608 instead of gnutls_record_check_pending.
5609
5610 * callproc.c, emacs.c: Include lisp.h before w32.h, not after.
5611
ff4de4aa
TZ
56122011-05-04 Teodor Zlatanov <tzz@lifelogs.com>
5613
5614 * gnutls.c (Fgnutls_boot): Support :keylist and :crlfiles options
5615 instead of :keyfiles. Give GnuTLS the keylist and the CRL lists
5616 as passed in.
5617
abe95abb
JD
56182011-05-03 Jan Djärv <jan.h.d@swipnet.se>
5619
5620 * xterm.c (x_set_frame_alpha): Do not set property on anything
5621 else than FRAME_X_OUTER_WINDOW (Bug#8608).
5622
e16e55d4
JB
56232011-05-02 Juanma Barranquero <lekktu@gmail.com>
5624
5625 * sysdep.c (get_tty_size) [WINDOWSNT]: Implement. (Bug#8596)
5626
bafcf6a5
JB
56272011-05-02 Juanma Barranquero <lekktu@gmail.com>
5628
5629 * gnutls.c (Qgnutls_log_level, Qgnutls_code, Qgnutls_anon)
5630 (Qgnutls_x509pki, Qgnutls_e_interrupted, Qgnutls_e_again)
5631 (Qgnutls_e_invalid_session, Qgnutls_e_not_ready_for_handshake)
5632 (gnutls_global_initialized, Qgnutls_bootprop_priority)
5633 (Qgnutls_bootprop_trustfiles, Qgnutls_bootprop_keyfiles)
5634 (Qgnutls_bootprop_callbacks, Qgnutls_bootprop_loglevel)
5635 (Qgnutls_bootprop_hostname, Qgnutls_bootprop_verify_flags)
5636 (Qgnutls_bootprop_verify_error, Qgnutls_bootprop_verify_hostname_error)
5637 (Qgnutls_bootprop_callbacks_verify): Make static.
5638
e7a6747f
AS
56392011-05-01 Andreas Schwab <schwab@linux-m68k.org>
5640
19ed11ba
AS
5641 * callproc.c: Indentation fixup.
5642
e7a6747f 5643 * sysdep.c (wait_for_termination_1): Make static.
04f2d78b
CB
5644 (wait_for_termination, interruptible_wait_for_termination):
5645 Move after wait_for_termination_1.
e7a6747f 5646
1ef14cb4
LMI
56472011-05-01 Lars Magne Ingebrigtsen <larsi@gnus.org>
5648
5649 * sysdep.c (interruptible_wait_for_termination): New function
5650 which is like wait_for_termination, but allows keyboard
5651 interruptions.
5652
5653 * callproc.c (Fcall_process): Add (:file "file") as an option for
5654 the STDOUT buffer.
5655 (Fcall_process_region): Ditto.
5656
330d880c
EZ
56572011-04-30 Eli Zaretskii <eliz@gnu.org>
5658
8db90b73
EZ
5659 * dosfns.c (Fint86, Fdos_memget, Fdos_memput): Use `ASIZE (FOO)'
5660 rather than `XVECTOR (FOO)->size'.
5661
330d880c
EZ
5662 * process.c: Remove HAVE_INTTYPES_H condition from inclusion of
5663 inttypes.h, as a gnulib replacement is used if it not available in
5664 system headers.
5665
15cbd324
EZ
56662011-04-21 Eli Zaretskii <eliz@gnu.org>
5667
5668 Lift the MOST_POSITIVE_FIXNUM/4 limitation on visited files.
5669 * fileio.c (Finsert_file_contents): Don't limit file size to 1/4
5670 of MOST_POSITIVE_FIXNUM. (Bug#8528)
5671
5672 * coding.c (coding_alloc_by_realloc): Error out if destination
5673 will grow beyond MOST_POSITIVE_FIXNUM.
5674 (decode_coding_emacs_mule): Abort if there isn't enough place in
5675 charbuf for the composition carryover bytes. Reserve an extra
5676 space for up to 2 characters produced in a loop.
5677 (decode_coding_iso_2022): Abort if there isn't enough place in
5678 charbuf for the composition carryover bytes.
5679
56802011-04-21 Eli Zaretskii <eliz@gnu.org>
afda1437 5681
ae940cca
EZ
5682 * doprnt.c (doprnt) [!HAVE_LONG_LONG_INT]: Error out instead of
5683 aborting when %lld or %lll format is passed.
5684 [!HAVE_UNSIGNED_LONG_LONG_INT]: Error out instead of aborting when
5685 %llo or %llx format is passed. (Bug#8545)
5686
03ab8921
EZ
5687 * window.c (window_scroll_line_based): Use a marker instead of
5688 simple variables to record original value of point. (Bug#7952)
5689
afda1437
EZ
5690 * doprnt.c (doprnt): Fix the case where a multibyte sequence
5691 produced by %s or %c overflows available buffer space. (Bug#8545)
5692
f76dee0c
PE
56932011-04-28 Paul Eggert <eggert@cs.ucla.edu>
5694
5695 * doprnt.c (doprnt): Omit useless test; int overflow check (Bug#8545).
283cdbef 5696 (SIZE_MAX): Move defn after all includes, as they might #define it.
f76dee0c 5697
fdc5744d
JB
56982011-04-28 Juanma Barranquero <lekktu@gmail.com>
5699
5700 * w32.c (init_environment): Warn about defaulting HOME to C:\.
5701
638f053a
JB
57022011-04-28 Juanma Barranquero <lekktu@gmail.com>
5703
5704 * keyboard.c (Qdelayed_warnings_hook): Define.
5705 (command_loop_1): Run `delayed-warnings-hook'
5706 if Vdelayed_warnings_list is non-nil.
5707 (syms_of_keyboard) <delayed-warnings-hook>: DEFSYM it.
5708 (syms_of_keyboard) <delayed-warnings-list>: DEFVAR_LISP it.
5709
d178f871
EZ
57102011-04-28 Eli Zaretskii <eliz@gnu.org>
5711
5712 * doprnt.c (doprnt): Don't return value smaller than the buffer
5713 size if the message was truncated. (Bug#8545).
5714
b124fd93
JB
57152011-04-28 Juanma Barranquero <lekktu@gmail.com>
5716
5717 * w32fns.c (Fx_change_window_property, Fx_delete_window_property)
5718 (Fx_window_property): #if-0 the whole functions, not just the bodies.
5719
e810457d
PE
57202011-04-27 Paul Eggert <eggert@cs.ucla.edu>
5721
5722 * doprnt.c (doprnt): Support "ll" length modifier, for long long.
5723
ea51cceb
JB
57242011-04-27 Juanma Barranquero <lekktu@gmail.com>
5725
5726 * makefile.w32-in: Update dependencies.
5727
94dcfacf
EZ
57282011-04-27 Eli Zaretskii <eliz@gnu.org>
5729
5730 Improve `doprnt' and its usage. (Bug#8545)
5731 * doprnt.c (doprnt): Make sure `format' is never accessed beyond
5732 `format_end'. Remove support for %l as a conversion specifier.
5733 Don't use xrealloc. Improve diagnostics when the %l size modifier
5734 is used. Update the commentary.
5735
5736 * eval.c (verror): Simplify calculation of size_t.
5737
5738 * coding.c (Ffind_operation_coding_system): Fix diagnostic error
5739 messages.
5740
f61f41d7
PE
57412011-04-27 Yoshiaki Kasahara <kasahara@nc.kyushu-u.ac.jp> (tiny change)
5742
5743 * buffer.c (init_buffer) [USE_MMAP_FOR_BUFFERS]: Adjust to aliasing
5744 change.
5745
96fb4434
PE
57462011-04-27 Paul Eggert <eggert@cs.ucla.edu>
5747
5748 * nsmenu.m: Replace all uses of XVECTOR with ASIZE and AREF.
5749 This makes this file independent of the recent pseudovector change.
5750
671875da 57512011-04-26 Paul Eggert <eggert@cs.ucla.edu>
eab3844f 5752
69e9b5a3
PE
5753 * keyboard.c (handle_user_signal): Fix pointer signedness problem.
5754
b5f869a7 5755 * gnutls.c (emacs_gnutls_handle_error): Remove unused local.
7754e151 5756 (Fgnutls_boot): gnutls_certificate_verify_peers2 wants unsigned *.
8d4c3955 5757 Remove unused local.
c8926152 5758 (emacs_gnutls_write): Don't use uninitialized rtnval if nbyte <= 0.
080e5a8d 5759
841a1577 5760 * lisp.h: Fix a problem with aliasing and vector headers. (Bug#8546)
04f2d78b
CB
5761 GCC 4.6.0 optimizes based on type-based alias analysis.
5762 For example, if b is of type struct buffer * and v of type struct
eab3844f
PE
5763 Lisp_Vector *, then gcc -O2 was incorrectly assuming that &b->size
5764 != &v->size, and therefore "v->size = 1; b->size = 2; return
5765 v->size;" must therefore return 1. This assumption is incorrect
5766 for Emacs, since it type-puns struct Lisp_Vector * with many other
5767 types. To fix this problem, this patch adds a new type struct
f904488f 5768 vectorlike_header that documents the constraints on layout of vectors
eab3844f
PE
5769 and pseudovectors, and helps optimizing compilers not get fooled
5770 by Emacs's type punning. It also adds the macros XSETTYPED_PVECTYPE
5771 XSETTYPED_PSEUDOVECTOR, TYPED_PSEUDOVECTORP, for similar reasons.
f904488f
PE
5772 * lisp.h (XSETTYPED_PVECTYPE): New macro, specifying the name of
5773 the size member.
eab3844f
PE
5774 (XSETPVECTYPE): Rewrite in terms of new macro.
5775 (XSETPVECTYPESIZE): New macro, specifying both type and size.
5776 This is a bit clearer, and further avoids the possibility of
5777 undesirable aliasing.
5778 (XSETTYPED_PSEUDOVECTOR): New macro, specifying the size.
f904488f 5779 (XSETPSEUDOVECTOR): Rewrite in terms of XSETTYPED_PSEUDOVECTOR.
eab3844f
PE
5780 (XSETSUBR): Rewrite in terms of XSETTYPED_PSEUDOVECTOR and XSIZE,
5781 since Lisp_Subr is a special case (no "next" field).
04f2d78b
CB
5782 (ASIZE): Now uses header.size rather than size.
5783 All previous uses of XVECTOR (foo)->size replaced to use this macro,
f904488f
PE
5784 to avoid the hassle of writing XVECTOR (foo)->header.size.
5785 (struct vectorlike_header): New type.
eab3844f
PE
5786 (TYPED_PSEUDOVECTORP): New macro, also specifying the C type of the
5787 object, to help avoid aliasing.
5788 (PSEUDOVECTORP): Rewrite in terms of TYPED_PSEUDOVECTORP.
5789 (SUBRP): Likewise, since Lisp_Subr is a special case.
5790 * lisp.h (struct Lisp_Vector, struct Lisp_Char_Table):
5791 (struct Lisp_Sub_Char_Table, struct Lisp_Bool_Vector):
5792 (struct Lisp_Hash_Table): Combine first two members into a single
f904488f 5793 struct vectorlike_header member. All uses of "size" and "next" members
eab3844f
PE
5794 changed to be "header.size" and "header.next".
5795 * buffer.h (struct buffer): Likewise.
5796 * font.h (struct font_spec, struct font_entity, struct font): Likewise.
5797 * frame.h (struct frame): Likewise.
5798 * process.h (struct Lisp_Process): Likewise.
5799 * termhooks.h (struct terminal): Likewise.
5800 * window.c (struct save_window_data, struct saved_window): Likewise.
5801 * window.h (struct window): Likewise.
5802 * alloc.c (allocate_buffer, Fmake_bool_vector, allocate_pseudovector):
5803 Use XSETPVECTYPESIZE, not XSETPVECTYPE, to avoid aliasing problems.
5804 * buffer.c (init_buffer_once): Likewise.
5805 * lread.c (defsubr): Use XSETTYPED_PVECTYPE, since Lisp_Subr is a
5806 special case.
5807 * process.c (Fformat_network_address): Use local var for size,
5808 for brevity.
5809
0df1eac5
PE
5810 * bytecode.c (exec_byte_code): Don't use XVECTOR before CHECK_VECTOR.
5811
847ab9d1 5812 Make the Lisp reader and string-to-float more consistent (Bug#8525)
452f4150
PE
5813 * data.c (atof): Remove decl; no longer used or needed.
5814 (digit_to_number): Move to lread.c.
5815 (Fstring_to_number): Use new string_to_number function, to be
5816 consistent with how the Lisp reader treats infinities and NaNs.
5817 Do not assume that floating-point numbers represent EMACS_INT
5818 without losing information; this is not true on most 64-bit hosts.
5819 Avoid double-rounding errors, by insisting on integers when
5820 parsing non-base-10 numbers, as the documentation specifies.
5821 * lisp.h (string_to_number): New decl, replacing ...
5822 (isfloat_string): Remove.
bc0a5c13 5823 * lread.c: Include <inttypes.h>, for uintmax_t and strtoumax.
d78050d6 5824 (read1): Do not accept +. and -. as integers; this
452f4150
PE
5825 appears to have been a coding error. Similarly, do not accept
5826 strings like +-1e0 as floating point numbers. Do not report
5827 overflow for integer overflows unless the base is not 10 which
5828 means we have no simple and reliable way to continue.
5829 Break out the floating-point parsing into a new
5830 function string_to_number, so that Fstring_to_number parses
5831 floating point numbers consistently with the Lisp reader.
04f2d78b 5832 (digit_to_number): Move here from data.c. Make it static inline.
452f4150
PE
5833 (E_CHAR, EXP_INT): Remove, replacing with ...
5834 (E_EXP): New macro, to solve the "1.0e+" problem mentioned below.
5835 (string_to_number): New function, replacing isfloat_string.
5836 This function checks for valid syntax and produces the resulting
5837 Lisp float number too. Rework it so that string-to-number
bc0a5c13 5838 no longer mishandles examples like "1.0e+". Use strtoumax,
d78050d6
PE
5839 so that overflow for non-base-10 numbers is reported only when
5840 there's no portable and simple way to convert to floating point.
452f4150 5841
67769ffc
PE
5842 * textprop.c (set_text_properties_1): Rewrite for clarity,
5843 and to avoid GCC warning about integer overflow.
5844
c20db43f
PE
5845 * intervals.h (struct interval): Use EMACS_INT for members
5846 where EMACS_UINT might cause problems. See
5847 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00514.html>.
5848 (CHECK_TOTAL_LENGTH): Remove cast to EMACS_INT; no longer needed.
5849 * intervals.c (interval_deletion_adjustment): Now returns EMACS_INT.
5850 All uses changed.
37aa2f85
PE
5851 (offset_intervals): Tell GCC not to worry about length overflow
5852 when negating a negative length.
c20db43f 5853
2538aa2f
PE
5854 * alloc.c (overrun_check_malloc, overrun_check_realloc): Now static.
5855 (overrun_check_free): Likewise.
5856
f2d3008d
PE
5857 * alloc.c (SDATA_SIZE) [!GC_CHECK_STRING_BYTES]: Avoid runtime check
5858 in the common case where SDATA_DATA_OFFSET is a multiple of Emacs
5859 word size.
5860
ec8df744
PE
5861 * gnutls.c: Fix problems found by GCC 4.6.0 on Ubuntu 10.10.
5862 (gnutls_make_error): Rename local to avoid shadowing.
5863 (gnutls_emacs_global_deinit): ifdef out; not used.
5864 (Fgnutls_boot): Use const for pointer to readonly storage.
5865 Comment out unused local. Fix pointer signedness problems.
5866
640ee02d
PE
5867 * lread.c (openp): Don't stuff size_t into an 'int'.
5868 Use <= on length, not < on length + 1, to avoid GCC 4.6.0 warning
5869 about possible signed overflow.
5870
6048fb2a
PE
5871 * gtkutil.c: Fix problems found by GCC 4.6.0 on Ubuntu 10.10.
5872 (GDK_KEY_g): Don't define if already defined.
5873 (xg_prepare_tooltip): Avoid pointer signedness problem.
5874 (xg_set_toolkit_scroll_bar_thumb): Redo to avoid two casts.
5875
fa3c87e1
PE
5876 * process.c (Fnetwork_interface_info): Avoid left-shift undefined
5877 behavior with 1 << 31. GCC 4.6.0 warns about this on 32-bit hosts.
5878
2172544b
PE
5879 * xfns.c (Fx_window_property): Simplify a bit,
5880 to make a bit faster and to avoid GCC 4.6.0 warning.
5881 * xselect.c (x_get_window_property, x_handle_dnd_message): Likewise.
5882
9b821a21
PE
5883 * fns.c (internal_equal): Don't assume size_t fits in int.
5884
3c616cfa
PE
5885 * alloc.c (compact_small_strings): Tighten assertion a little.
5886
c2982e87
PE
5887 Replace pEd with more-general pI, and fix some printf arg casts.
5888 * lisp.h (pI): New macro, generalizing old pEd macro to other
5889 conversion specifiers. For example, use "...%"pI"d..." rather
5890 than "...%"pEd"...".
5891 (pEd): Remove. All uses replaced with similar uses of pI.
5892 * src/m/amdx86-64.h, src/m/ia64.h, src/m/ibms390x.h: Likewise.
5893 * alloc.c (check_pure_size): Don't overflow by converting size to int.
5894 * bidi.c (bidi_dump_cached_states): Use pI to avoid cast.
5895 * data.c (Fnumber_to_string): Use pI instead of if-then-else-abort.
5896 * dbusbind.c (xd_append_arg): Use pI to avoid cast.
5897 (Fdbus_method_return_internal, Fdbus_method_error_internal): Likewise.
5898 * font.c (font_unparse_xlfd): Avoid potential buffer overrun on
5899 64-bit hosts.
5900 (font_unparse_xlfd, font_unparse_fcname): Use pI to avoid casts.
5901 * keyboard.c (record_char, modify_event_symbol): Use pI to avoid casts.
5902 * print.c (safe_debug_print, print_object): Likewise.
5903 (print_object): Don't overflow by converting EMACS_INT or EMACS_UINT
5904 to int.
6f04d126
PE
5905 Use pI instead of if-then-else-abort. Use %p to avoid casts,
5906 avoiding the 0 flag, which is not portable.
c2982e87
PE
5907 * process.c (Fmake_network_process): Use pI to avoid cast.
5908 * region-cache.c (pp_cache): Likewise.
5909 * xdisp.c (decode_mode_spec): Likewise.
5910 * xrdb.c (x_load_resources) [USE_MOTIF]: Use pI to avoid undefined
5911 behavior on 64-bit hosts with printf arg.
6f04d126 5912 * xselect.c (x_queue_event): Use %p to avoid casts, avoiding 0 flag.
c2982e87
PE
5913 (x_stop_queuing_selection_requests): Likewise.
5914 (x_get_window_property): Don't truncate byte count to an 'int'
5915 when tracing.
0b432f21 5916
5e073ec7
PE
5917 * frame.c (frame_name_fnn_p): Get rid of strtol, which isn't right
5918 here, since it parses constructs like leading '-' and spaces,
5919 which are not wanted; and it overflows with large numbers.
5920 Instead, simply match F[0-9]+, which is what is wanted anyway.
5921
36372bf9
PE
5922 * alloc.c: Remove unportable assumptions about struct layout.
5923 (SDATA_SELECTOR, SDATA_DATA_OFFSET): New macros.
5924 (SDATA_OF_STRING, SDATA_SIZE, allocate_string_data):
5925 (allocate_vectorlike, make_pure_vector): Use the new macros,
5926 plus offsetof, to remove unportable assumptions about struct layout.
5927 These assumptions hold on all porting targets that I know of, but
5928 they are not guaranteed, they're easy to remove, and removing them
5929 makes further changes easier.
5930
0b432f21
PE
5931 * alloc.c (BLOCK BYTES): Fix typo by changing "ablock" to "ablocks".
5932 This doesn't fix a bug but makes the code clearer.
bfd1c781
PE
5933 (string_overrun_cookie): Now const. Use initializers that
5934 don't formally overflow signed char, to avoid warnings.
000098c1
PE
5935 (allocate_string_data) [GC_CHECK_STRING_OVERRUN]: Fix typo that
5936 can cause Emacs to crash when string overrun checking is enabled.
c7bda33c
PE
5937 (allocate_buffer): Don't assume sizeof (struct buffer) is a
5938 multiple of sizeof (EMACS_INT); it need not be, if
5939 alignof(EMACS_INT) < sizeof (EMACS_INT).
d0f4e1f5 5940 (check_sblock, check_string_bytes, check_string_free_list): Protoize.
0b432f21 5941
895009e1
JB
59422011-04-26 Juanma Barranquero <lekktu@gmail.com>
5943
5944 * keyboard.c (QCrtl): Rename from Qrtl. All uses changed.
5945
6a7a1b0b
TZ
59462011-04-26 Teodor Zlatanov <tzz@lifelogs.com>
5947
5948 * gnutls.c (emacs_gnutls_handshake): Return an error if we're not
b5f869a7 5949 supposed to be handshaking. (Bug#8556)
6a7a1b0b
TZ
5950 Reported by Paul Eggert <eggert@cs.ucla.edu>.
5951
841a1577 59522011-04-26 Daniel Colascione <dan.colascione@gmail.com>
0438ce91
DC
5953
5954 * lisp.h (Qdebug): List symbol.
895009e1 5955 * eval.c (Qdebug): Restore global linkage.
0438ce91
DC
5956 * keyboard.c (debug-on-event): New variable.
5957 (handle_user_signal): Break into debugger when debug-on-event
5958 matches the current signal symbol.
5959
f2d3ba6f
DN
59602011-04-25 Dan Nicolaescu <dann@ics.uci.edu>
5961
5962 * alloc.c (check_sblock, check_string_bytes)
5963 (check_string_free_list): Convert to standard C.
5964
42ce4c63
TZ
59652011-04-25 Teodor Zlatanov <tzz@lifelogs.com>
5966
5967 * w32.c (emacs_gnutls_push): Fix typo.
5968
825cd63c
EZ
59692011-04-25 Eli Zaretskii <eliz@gnu.org>
5970
fb11d64d
EZ
5971 * gnutls.c (emacs_gnutls_handshake): Avoid compiler warnings about
5972 "cast to pointer from integer of different size".
5973
825cd63c
EZ
5974 Improve doprnt and its use in verror. (Bug#8545)
5975 * doprnt.c (doprnt): Document the set of format control sequences
5976 supported by the function. Use SAFE_ALLOCA instead of always
5977 using `alloca'.
5978
5979 * eval.c (verror): Don't limit the buffer size at size_max-1, that
5980 is one byte too soon. Don't use xrealloc; instead xfree and
5981 xmalloc anew.
5982
e061a11b
TZ
59832011-04-24 Teodor Zlatanov <tzz@lifelogs.com>
5984
5985 * gnutls.h: Add GNUTLS_STAGE_CALLBACKS enum to denote we're in the
5986 callbacks stage.
5987
5988 * gnutls.c: Renamed global_initialized to
5989 gnutls_global_initialized. Added internals for the
5990 :verify-hostname-error, :verify-error, and :verify-flags
5991 parameters of `gnutls-boot' and documented those parameters in the
5992 docstring. Start callback support.
9173deec
JB
5993 (emacs_gnutls_handshake): Add Woe32 support. Retry handshake
5994 unless a fatal error occurred. Call gnutls_alert_send_appropriate
5995 on error. Return error code.
e061a11b
TZ
5996 (emacs_gnutls_write): Call emacs_gnutls_handle_error.
5997 (emacs_gnutls_read): Likewise.
5998 (Fgnutls_boot): Return handshake error code.
5999 (emacs_gnutls_handle_error): New function.
6000 (wsaerror_to_errno): Likewise.
6001
6002 * w32.h (emacs_gnutls_pull): Add prototype.
6003 (emacs_gnutls_push): Likewise.
6004
6005 * w32.c (emacs_gnutls_pull): New function for GnuTLS on Woe32.
6006 (emacs_gnutls_push): Likewise.
6007
60082011-04-24 Claudio Bley <claudio.bley@gmail.com> (tiny change)
6009
6010 * process.c (wait_reading_process_output): Check if GnuTLS
6011 buffered some data internally if no FDs are set for TLS
6012 connections.
6013
6014 * makefile.w32-in (OBJ2): Add gnutls.$(O).
6015 (LIBS): Link to USER_LIBS.
6016 ($(BLD)/gnutls.$(0)): New target.
6017
fa6996bc
EZ
60182011-04-24 Eli Zaretskii <eliz@gnu.org>
6019
eb35682e
EZ
6020 * xdisp.c (handle_single_display_spec): Rename the
6021 display_replaced_before_p argument into display_replaced_p, to
6022 make it consistent with the commentary. Fix typos in the
6023 commentary.
6024
e2ad650c
EZ
6025 * textprop.c (syms_of_textprop): Remove dead code.
6026 (copy_text_properties): Delete obsolete commentary about an
6027 interface that was deleted long ago. Fix typos in the description
6028 of arguments.
6029
1b2de274
EZ
6030 * msdos.c (XMenuActivate, XMenuAddSelection): Adjust argument list
6031 to changes in oldXMenu/XMenu.h from 2011-04-16.
6032 <menu_help_message, prev_menu_help_message>: Constify.
6033 (IT_menu_make_room): menu->help_text is now `const char **';
6034 adjust.
6035
6036 * msdos.h (XMenuActivate, XMenuAddSelection): Adjust prototypes
6037 to changes in oldXMenu/XMenu.h from 2011-04-16.
6038 (struct XMenu): Declare `help_text' `const char **'.
6039
6040 * xfaces.c <Qunspecified>: Make extern again.
6041
6042 * syntax.c: Include sys/types.h before including regex.h, as
6043 required by Posix.
6044
762b15be
EZ
6045 * doc.c (get_doc_string): Improve the format passed to `error'.
6046
6047 * doprnt.c (doprnt): Improve commentary.
6048
6049 * term.c (init_tty) [MSDOS]: Fix 1st argument to maybe_fatal.
6050
6051 * Makefile.in (TAGS): Depend on $(M_FILE) and $(S_FILE), and scan
6052 them with etags.
6053
f1052e5d
EZ
6054 * makefile.w32-in (globals.h): Add a dummy recipe, to make any
6055 changes in globals.h immediately force recompilation.
762b15be
EZ
6056 (TAGS): Depend on $(CURDIR)/m/intel386.h and
6057 $(CURDIR)/s/ms-w32.h.
6058 (TAGS-gmake): Scan $(CURDIR)/m/intel386.h and $(CURDIR)/s/ms-w32.h.
f1052e5d 6059
fa6996bc
EZ
6060 * character.c (Fchar_direction): Function deleted.
6061 (syms_of_character): Don't defsubr it.
6062 <char-direction-table>: Deleted.
6063
e6c3da20
EZ
60642011-04-23 Eli Zaretskii <eliz@gnu.org>
6065
6066 Fix doprnt so it could be used again safely in `verror'. (Bug#8435)
6067 * doprnt.c: Include limits.h.
6068 (SIZE_MAX): New macro.
04f2d78b
CB
6069 (doprnt): Return a size_t value. 2nd arg is now size_t.
6070 Many local variables are now size_t instead of int or unsigned.
e6c3da20
EZ
6071 Improve overflow protection. Support `l' modifier for integer
6072 conversions. Support %l conversion. Don't assume an EMACS_INT
6073 argument for integer conversions and for %c.
6074
6075 * lisp.h (doprnt): Restore prototype.
6076
6077 * makefile.w32-in ($(BLD)/callint.$(O)): Depend on
6078 $(SRC)/character.h.
6079
6080 * Makefile.in (base_obj): Add back doprnt.o.
6081
6082 * deps.mk (doprnt.o): Add back prerequisites.
6083 (callint.o): Depend on character.h.
6084
6085 * eval.c (internal_lisp_condition_case): Include the handler
6086 representation in the error message.
6087 (verror): Call doprnt instead of vsnprintf. Fix an off-by-one bug
6088 when breaking from the loop.
6089
6090 * xdisp.c (vmessage): Call doprnt instead of vsnprintf.
6091
6092 * callint.c (Fcall_interactively): When displaying error message
6093 about invalid control letter, pass the character's codepoint, not
6094 a pointer to its multibyte form. Improve display of the character
6095 in octal and display also its hex code.
6096
6097 * character.c (char_string): Use %x to display the (unsigned)
6098 codepoint of an invalid character, to avoid displaying a bogus
6099 negative value.
6100
6101 * font.c (check_otf_features): Pass SDATA of SYMBOL_NAME to
6102 `error', not SYMBOL_NAME itself.
6103
6104 * coding.c (Fencode_sjis_char, Fencode_big5_char): Use %c for
6105 character arguments to `error'.
6106
6107 * charset.c (check_iso_charset_parameter): Fix incorrect argument
6108 to `error' in error message about FINAL_CHAR argument. Make sure
6109 FINAL_CHAR is a character, and use %c when it is passed as
6110 argument to `error'.
6111
4ffd0d6b 61122011-04-23 Eli Zaretskii <eliz@gnu.org>
97a93095
EZ
6113
6114 * s/ms-w32.h (localtime): Redirect to sys_localtime.
6115
6116 * w32.c: Include <time.h>.
6117 (sys_localtime): New function.
6118
4ffd0d6b 61192011-04-23 Chong Yidong <cyd@stupidchicken.com>
c17819f4
CY
6120
6121 * xdisp.c (init_xdisp): Initialize echo_area_window (Bug#6451).
6122
4ffd0d6b 6123 * buffer.c (syms_of_buffer): Doc fix (Bug#6902).
aac0c6e3 6124
4ffd0d6b 61252011-04-23 Samuel Thibault <sthibault@debian.org> (tiny change)
aac0c6e3 6126
4ffd0d6b
GM
6127 * sysdep.c (wait_for_termination): On GNU Hurd, kill returns -1 on
6128 zombies (Bug#8467).
aac0c6e3 6129
04c56954
EZ
61302011-04-19 Eli Zaretskii <eliz@gnu.org>
6131
6132 * syntax.h (SETUP_SYNTAX_TABLE_FOR_OBJECT): Fix setting of
6133 gl_state.e_property when gl_state.object is Qt.
6134
6135 * insdel.c (make_gap_larger): Remove limitation of buffer size
6136 to <= INT_MAX.
6137
16a43933
CY
61382011-04-18 Chong Yidong <cyd@stupidchicken.com>
6139
6140 * xdisp.c (lookup_glyphless_char_display)
6141 (produce_glyphless_glyph): Handle cons cell entry in
6142 glyphless-char-display.
6143 (Vglyphless_char_display): Document it.
6144
6145 * term.c (produce_glyphless_glyph): Handle cons cell entry in
6146 glyphless-char-display.
6147
4581706e
CY
61482011-04-17 Chong Yidong <cyd@stupidchicken.com>
6149
6150 * xdisp.c (get_next_display_element): Remove unnecessary ifdefs.
6151
6152 * termhooks.h (FRAME_WINDOW_P): Remove duplicated definitions.
6153
6154 * dispextern.h (FACE_SUITABLE_FOR_ASCII_CHAR_P): Add missing
6155 definition for no-X builds.
6156
4887c6e2 61572011-04-16 Paul Eggert <eggert@cs.ucla.edu>
764430a3 6158
fd35b6f9
PE
6159 Static checks with GCC 4.6.0 and non-default toolkits.
6160
5c1ccb01
PE
6161 * s/sol2-6.h, s/unixware.h (PTY_TTY_NAME_SPRINTF): Protoize decl.
6162
006c5daa
PE
6163 * process.c (keyboard_bit_set): Define only if SIGIO.
6164 (send_process_trap): Mark it with NO_RETURN if it doesn't return.
6165 (send_process): Repair possible setjmp clobbering.
6166
efc736d3
PE
6167 * s/usg5-4-common.h (SETUP_SLAVE_PTY): Don't pass extra arg to 'fatal'.
6168
4e2fe2e6
PE
6169 * eval.c: Include <stdio.h>, for vsnprintf on non-GNU/Linux hosts.
6170
f97334a2
PE
6171 * data.c (arith_error): Mark with NO_RETURN if it doesn't return.
6172
4e75f29d
PE
6173 * alloc.c (bytes_used_when_full, SPARE_MEMORY, BYTES_USED):
6174 Define only if needed.
6175
90efadd1
PE
6176 * sysdep.c (_FILE_OFFSET_BITS): Make this hack even uglier
6177 by pacifying GCC about it. Maybe it's time to retire it?
875975e9 6178 * xfaces.c (USG, __TIMEVAL__): Likewise.
90efadd1 6179
3c647824
PE
6180 * dispextern.h (struct redisplay_interface): Rename param
6181 to avoid shadowing.
e264f262 6182 * termhooks.h (struct terminal): Likewise.
761383f4 6183 * xterm.c (xembed_send_message): Likewise.
3c647824 6184
b58c5c4a
PE
6185 * insdel.c (make_gap_smaller): Define only if
6186 USE_MMAP_FOR_BUFFERS || REL_ALLOC || DOUG_LEA_MALLOC.
6187
cad59032
PE
6188 * keyboard.c (read_char): Make a var volatile so longjmp won't clobber
6189 it.
6190
c339dc2e
PE
6191 * emacs.c (MAX_HEAP_BSS_DIFF, my_edata): Move to where they're used,
6192 so that we aren't warned about unused symbols.
6193
91a3e27b
PE
6194 * xfns.c (Fx_file_dialog): Rename local to avoid shadowing.
6195
399c71d3 6196 * xdisp.c (x_produce_glyphs): Mark var as initialized (Bug#8512).
7a3fb125 6197
8ffc96f5
PE
6198 * xfns.c (x_real_positions): Mark locals as initialized.
6199
eef9bc79
PE
6200 * xmenu.c (xmenu_show): Don't use uninitialized vars.
6201
098db9dd
PE
6202 * xterm.c: Fix problems found by static analysis with other toolkits.
6203 (toolkit_scroll_bar_interaction): Define and use only if USE_X_TOOLKIT.
dda3aedd
PE
6204 (x_dispatch_event): Declare static if USE_GTK, and
6205 define if USE_GTK || USE_X_TOOLKIT.
098db9dd 6206 (SET_SAVED_BUTTON_EVENT): Define only if USE_X_TOOLKIT || USE_GTK.
dda3aedd 6207 * xterm.h (x_dispatch_event): Extern only if USE_X_TOOLKIT.
841a1577
JB
6208 * xterm.c, xterm.h (x_mouse_leave): Bring this function back, but only
6209 if defined HAVE_MENUS && !defined USE_X_TOOLKIT && !defined USE_GTK.
098db9dd 6210
eb18f6cc
PE
6211 * xmenu.c (menu_help_callback): Pointer type fixes.
6212 Use const pointers when pointing at readonly data. Avoid pointer
6213 signedness clashes.
6214 (FALSE): Remove unused macro.
6215 (update_frame_menubar): Remove unused decl.
6216
1fe72bf8
PE
6217 * xfns.c (Fx_hide_tip): Move locals to avoid shadowing.
6218
60d9e1db
PE
6219 * menu.c (push_submenu_start, push_submenu_end): Do not define unless
6220 USE_X_TOOLKIT || USE_GTK || HAVE_NS || defined HAVE_NTGUI.
6221 (single_menu_item): Rename local to avoid shadowing.
6222
39261c26
PE
6223 * keyboard.c (make_lispy_event): Remove unused local var.
6224
018c5e19
PE
6225 * frame.c, frame.h (x_get_resource_string): Bring this back, but
6226 only if HAVE_X_WINDOWS && !USE_X_TOOLKIT.
6227
63d2b86e
PE
6228 * bitmaps: Change bitmaps from unsigned char back to the X11
6229 compatible char. Avoid the old compiler warnings about
6230 out-of-range initializers by using, for example, '\xab' rather
6231 than 0xab.
6232
aefd87e1
PE
6233 * xgselect.c (xgselect_initialize): Check vs interface
6234 even if ! (defined (USE_GTK) || defined (HAVE_GCONF)).
6235
bf501fb9
PE
6236 * xmenu.c (xmenu_show): Rename parm to avoid shadowing.
6237
e9829fdf
PE
6238 * xterm.c (x_create_toolkit_scroll_bar): Use const * for pointers
6239 to read-only memory.
6240
1086c095
PE
6241 * fns.c (vector): Remove; this old hack is no longer needed.
6242
2baccd04 6243 * xsmfns.c (create_client_leader_window): Rename shadowing arg.
401f10cb 6244 Remove unused var.
dde42981 6245 (gdk_x11_set_sm_client_id) [!USE_GTK]: Don't define.
2baccd04 6246
72391843 6247 * xrdb.c (x_load_resources): Omit unused local.
3565b346 6248
436c16df 6249 * xfns.c (free_frame_menubar, atof): Remove duplicate decls.
8a94ea33 6250 (x_window): Rename locals to avoid shadowing.
dc5ddd85 6251 (USG): Use the kludged USG macro, to pacify gcc.
436c16df 6252
92bb796d 6253 * xterm.c (x_alloc_nearest_color_for_widget): Remove; unused.
bbbef9e1 6254 (x_term_init): Remove local to avoid shadowing.
92bb796d 6255
764430a3 6256 * xfns.c, xterm.c (_XEditResCheckMessages): Protoize decl.
4887c6e2
PE
6257
6258 * xdisp.c, dispextern.h (set_vertical_scroll_bar): Now extern if
6259 USE_TOOLKIT_SCROLL_BARS && !USE_GTK, as xterm.c needs it then.
6260
d1dfb56c
EZ
62612011-04-16 Eli Zaretskii <eliz@gnu.org>
6262
c4354cb4
EZ
6263 * gnutls.c (Fgnutls_boot): Don't pass Lisp_Object to `error'.
6264
d1dfb56c
EZ
6265 Fix regex.c, syntax.c and friends for buffers > 2GB.
6266 * syntax.h (struct gl_state_s): Declare character position members
6267 EMACS_INT.
6268
6269 * syntax.c (update_syntax_table): Declare 2nd argument EMACS_INT.
6270
04f2d78b
CB
6271 * textprop.c (verify_interval_modification, interval_of):
6272 Declare arguments EMACS_INT.
d1dfb56c
EZ
6273
6274 * intervals.c (adjust_intervals_for_insertion): Declare arguments
6275 EMACS_INT.
6276
6277 * intervals.h (CHECK_TOTAL_LENGTH): Cast to EMACS_INT, not `int'.
6278
6279 * indent.c (Fvertical_motion): Local variable it_start is now
6280 EMACS_INT.
6281
6282 * regex.c (re_match, re_match_2, re_match_2_internal)
6283 (bcmp_translate, regcomp, regexec, print_double_string)
6284 (group_in_compile_stack, re_search, re_search_2, regex_compile)
6285 (re_compile_pattern, re_exec): Declare arguments and local
6286 variables `size_t' and `ssize_t' and return values `regoff_t', as
6287 appropriate.
6288 (POP_FAILURE_REG_OR_COUNT) <pfreg>: Declare `long'.
6289 (CHECK_INFINITE_LOOP) <failure>: Declare `ssize_t'.
6290 <compile_stack_type>: `size' and `avail' are now `size_t'.
6291
6292 * regex.h <regoff_t>: Use ssize_t, not int.
6293 (re_search, re_search_2, re_match, re_match_2): Arguments that
6294 specify buffer/string position and length are now ssize_t and
6295 size_t. Return type is regoff_t.
6296
613052cd
BK
62972011-04-16 Ben Key <bkey76@gmail.com>
6298
6299 * nsfont.m: Fixed bugs in ns_get_family and
6300 ns_descriptor_to_entity that were caused by using free to
6301 deallocate memory blocks that were allocated by xmalloc (via
6302 xstrdup). This caused Emacs to crash when compiled with
6303 XMALLOC_OVERRUN_CHECK defined (when Emacs was configured with
6304 --enable-checking=xmallocoverrun). xfree is now used to
6305 deallocate these memory blocks.
6306
4170f62f 63072011-04-15 Paul Eggert <eggert@cs.ucla.edu>
3e047f51 6308
71b41406
PE
6309 * sysdep.c (emacs_read): Remove unnecessary check vs MAX_RW_COUNT.
6310
9587a89d
PE
6311 emacs_write: Accept and return EMACS_INT for sizes.
6312 See http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00514.html
6313 et seq.
6314 * gnutls.c, gnutls.h (emacs_gnutls_read, emacs_gnutls_write):
6315 Accept and return EMACS_INT.
6316 (emacs_gnutls_write): Return the number of bytes written on
6317 partial writes.
6318 * sysdep.c, lisp.h (emacs_read, emacs_write): Likewise.
273a5f82
PE
6319 (emacs_read, emacs_write): Remove check for negative size, as the
6320 Emacs source code has been audited now.
9587a89d
PE
6321 * sysdep.c (MAX_RW_COUNT): New macro, to work around kernel bugs.
6322 (emacs_read, emacs_write): Use it.
273a5f82
PE
6323 * process.c (send_process): Adjust to the new signatures of
6324 emacs_write and emacs_gnutls_write. Do not attempt to store
6325 a byte offset into an 'int'; it might overflow.
9587a89d 6326 See http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00483.html
273a5f82 6327
3e047f51
PE
6328 * sound.c: Don't assume sizes fit in 'int'.
6329 (struct sound_device.period_size, alsa_period_size):
9c3c56a7 6330 Return EMACS_INT, not int.
3e047f51 6331 (struct sound_device.write, vox_write, alsa_write):
9c3c56a7
PE
6332 Accept EMACS_INT, not int.
6333 (wav_play, au_play): Use EMACS_INT to store sizes and to
3e047f51
PE
6334 record read return values.
6335
cc39a9db
BK
63362011-04-15 Ben Key <bkey76@gmail.com>
6337
c9d0ec6d
JB
6338 * keyboard.c (Qundefined): Don't declare static since it is used
6339 in nsfns.m.
6340 * xfaces.c (Qbold, Qexpanded, Qitalic, Qcondensed): Don't declare
6341 static since they are used in nsfont.m.
cc39a9db 6342
6c60eb9f
SM
63432011-04-15 Stefan Monnier <monnier@iro.umontreal.ca>
6344
6345 * process.c (Qprocessp): Don't declare static.
6346 * lisp.h (Qprocessp): Declare again.
6347
7990b61a
JB
63482011-04-15 Juanma Barranquero <lekktu@gmail.com>
6349
6350 * font.c (Qopentype): Don't make static (used from w32uniscribe.c).
6351
5d4cb038
PE
63522011-04-14 Paul Eggert <eggert@cs.ucla.edu>
6353
8bd7b830 6354 Improve C-level modularity by making more things 'static'.
cd64ea1d 6355
e3b27b31
PE
6356 Don't publish debugger-only interfaces to other modules.
6357 * lisp.h (safe_debug_print, debug_output_compilation_hack):
6358 (verify_bytepos, count_markers): Move decls to the only modules
6359 that need them.
6360 * region-cache.h (pp_cache): Likewise.
6361 * window.h (check_all_windows): Likewise.
6362 * marker.c, print.c, region-cache.c, window.c: Decls moved here.
6363
5d4cb038
PE
6364 * sysdep.c (croak): Now static, if
6365 defined TIOCNOTTY || defined USG5 || defined CYGWIN.
6366 * syssignal.h (croak): Declare only if not static.
69003fd8
PE
6367
6368 * alloc.c (refill_memory_reserve): Now static if
6369 !defined REL_ALLOC || defined SYSTEM_MALLOC.
6370 * lisp.h (refill_memory_reserve): Declare only if not static.
93ea6e8f 6371
e87b6180
PE
6372 * xsettings.c, xsettings.h (xsettings_get_system_normal_font):
6373 Define only if USE_LUCID.
6374
ac64929e
PE
6375 * xrdb.c (x_customization_string, x_rm_string): Now static.
6376
6f37259d
PE
6377 * xmenu.c (x_menu_wait_for_event): Export only if USE_MOTIF.
6378 * xterm.h (x_menu_wait_for_event): Declare only if USE_MOTIF.
6379
1683e3ab
PE
6380 * xdisp.c (draw_row_with_mouse_face): Now static.
6381 * dispextern.h (draw_row_with_mouse_fave): Remove decl.
6382
de9c2632
PE
6383 * window.h (check_all_windows): Mark externally visible.
6384
2b96acb7
PE
6385 * window.c (window_deletion_count): Now static.
6386
6387 * undo.c: Make symbols static if they're not exported.
6388 (last_undo_buffer, last_boundary_position, pending_boundary):
6389 Now static.
6390
50436f33
PE
6391 * textprop.c (interval_insert_behind_hooks): Now static.
6392 (interval_insert_in_front_hooks): Likewise.
6393
64520e5c
PE
6394 * term.c: Make symbols static if they're not exported.
6395 (tty_turn_off_highlight, get_tty_terminal, max_frame_cols):
6396 (max_frame_lines, tty_set_terminal_modes):
6397 (tty_reset_terminal_modes, tty_turn_off_highlight):
6398 (get_tty_terminal): Now static.
6399 (term_mouse_moveto): Do not define if HAVE_WINDOW_SYSTEM.
6400 * termhooks.h (term_mouse_moveto): Do not declare if
8bd7b830 6401 HAVE_WINDOW_SYSTEM.
64520e5c
PE
6402 * dispextern.h (tty_set_terminal_modes, tty_reset_terminal_modes):
6403 (tty_turn_off_highlight, get_tty_terminal): Remove decls.
6404
1fa53021
PE
6405 * sysdep.c: Make symbols static if they're not exported.
6406 (emacs_get_tty, emacs_set_tty, old_fcntl_flags, old_fcntl_owner):
6407 Now static.
6408 (sigprocmask_set, full_mask): Remove; unused.
6409 (wait_debugging): Mark as visible.
6410 * syssignal.h (SIGFULLMASK, full_mask): Remove decls.
6411 * systty.h (emacs_get_tty, emacs_set_tty): Remove decls.
6412
d4b43b22
PE
6413 * syntax.c (syntax_temp): Define only if !__GNUC__.
6414
b7c513d0
PE
6415 * sound.c (current_sound_device, current_sound): Now static.
6416
989b29ad
PE
6417 * search.c (searchbufs, searchbuf_head): Now static.
6418
13a55a78
PE
6419 * scroll.c (scroll_cost): Remove; unused.
6420 * dispextern.h (scroll_cost): Remove decl.
6421
de68a1fc
PE
6422 * region-cache.h (pp_cache): Mark as externally visible.
6423
40ccffa6
PE
6424 * process.c: Make symbols static if they're not exported.
6425 (process_tick, update_tick, create_process, chan_process):
6426 (Vprocess_alist, proc_buffered_char, datagram_access):
6427 (fd_callback_data, send_process_frame, process_sent_to): Now static.
6428 (deactivate_process): Mark defn as static, as well as decl.
6429 * lisp.h (create_process): Remove decl.
6430 * process.h (chan_process, Vprocess_alist): Remove decls.
6431
ad64fc97
PE
6432 * print.c: Make symbols static if they're not exported.
6433 (print_depth, new_backquote_output, being_printed, print_buffer):
6434 (print_buffer_size, print_buffer_pos, print_buffer_pos_byte):
6435 (print_interval, print_number_index, initial_stderr_stream):
6436 Now static.
6437 * lisp.h (Fprinc): Remove decl.
6438 (debug_output_compilation_hack): Mark as externally visible.
6439
adddb265
PE
6440 * sysdep.c (croak): Move decl from here to syssignal.h.
6441 * syssignal.h (croak): Put it here, so the API can be checked when
6442 'croak' is called from dissociate_if_controlling_tty.
6443
1717ede2
PE
6444 * minibuf.c: Make symbols static if they're not exported.
6445 (minibuf_save_list, choose_minibuf_frame): Now static.
6446 * lisp.h (choose_minibuf_frame): Remove decl.
6447
fa5fb2bc
PE
6448 * lisp.h (verify_bytepos, count_markers): Mark as externally visible.
6449
1e3890d1
PE
6450 * lread.c: Make symbols static if they're not exported.
6451 (read_objects, initial_obarray, oblookup_last_bucket_number):
6452 Now static.
6453 (make_symbol): Remove; unused.
6454 * lisp.h (initial_obarray, make_symbol): Remove decls.
6455
8a1414fa
PE
6456 * keyboard.c: Make symbols static if they're not exported.
6457 (single_kboard, recent_keys_index, total_keys, recent_keys):
6458 (this_command_key_count_reset, raw_keybuf, raw_keybuf_count):
6459 (this_single_command_key_start, echoing, last_auto_save):
6460 (read_key_sequence_cmd, dribble, recursive_edit_unwind):
6461 (command_loop, echo_now, keyboard_init_hook, help_char_p):
6462 (quit_throw_to_read_char, command_loop_2, top_level_1, poll_timer):
6463 (Vlispy_mouse_stem, double_click_count):
6464 Now static.
6465 (force_auto_save_soon): Define only if SIGDANGER.
6466 (ignore_mouse_drag_p): Now static if
6467 !defined HAVE_WINDOW_SYSTEM || defined USE_GTK || defined HAVE_NS.
6468 (print_help): Remove; unused.
6469 (stop_character, last_timer_event): Mark as externally visible.
6470 * keyboard.h (ignore_mouse_drag_p): Declare only if
6471 defined HAVE_WINDOW_SYSTEM && !defined USE_GTK && !defined HAVE_NS.
6472 (echo_now, help_char_p, quit_throw_to_read_char): Remove decls.
6473 * lisp.h (echoing): Remove decl.
6474 (force_auto_save_soon): Declare only if SIGDANGER.
6475 * xdisp.c (redisplay_window): Simplify code, to make it more
6476 obvious that ignore_mouse_drag_p is not accessed if !defined
6477 USE_GTK && !defined HAVE_NS.
6478
93ea6e8f
PE
6479 * intervals.c: Make symbols static if they're not exported.
6480 (merge_properties_sticky, merge_interval_right, delete_interval):
6481 Now static.
6482 * intervals.h (merge_interval_right, delete_interval): Remove decls.
6483
77382fcc
PE
6484 * insdel.c: Make symbols static if they're not exported.
6485 However, leave prepare_to_modify_buffer alone. It's never
6486 called from outside this function, but that appears to be a bug.
6487 (combine_after_change_list, combine_after_change_buffer):
4889fc82 6488 (adjust_after_replace, signal_before_change): Now static.
77382fcc
PE
6489 (adjust_after_replace_noundo): Remove; unused.
6490 * lisp.h (adjust_after_replace, adjust_after_replace_noundo):
4889fc82 6491 (signal_before_change): Remove decls.
77382fcc 6492
9306c32e
PE
6493 * indent.c (val_compute_motion, val_vmotion): Now static.
6494
cd44d2eb
PE
6495 * image.c: Make symbols static if they're not exported.
6496 * dispextern.h (x_create_bitmap_from_xpm_data): Do not declare
6497 if USE_GTK.
6498 * image.c (x_create_bitmap_from_xpm_data): Do not define if USE_GTK.
6499 (xpm_color_cache, ct_table, ct_colors_allocated): Now static.
6500
ad9a7a06
PE
6501 * fringe.c (standard_bitmaps): Now static.
6502 (max_used_fringe_bitmap): Now static, unless HAVE_NS.
6503
81626931
PE
6504 * frame.c: Make symbols static if they're not exported.
6505 (x_report_frame_params, make_terminal_frame): Now static.
6506 (get_frame_param): Now static, unless HAVE_NS.
6507 (x_fullscreen_adjust): Define if WINDOWSNT, not if HAVE_WINDOW_SYSTEM.
6508 (x_get_resource_string): Remove; not used.
6509 * frame.h (make_terminal_frame, x_report_frame_params):
6510 (x_get_resource_string); Remove decls.
6511 (x_fullscreen_adjust): Declare only if WINDOWSNT.
6512 * lisp.h (get_frame_param): Declare only if HAVE_NS.
6513
239f9db9
PE
6514 * font.c, fontset.c: Make symbols static if they're not exported.
6515 * dispextern.h (FACE_SUITABLE_FOR_ASCII_CHAR_P): New macro.
6516 (FACE_SUITABLE_FOR_CHAR_P): Use it.
6517 * font.c (font_close_object): Now static.
6518 * font.h (font_close_object): Remove.
6519 * fontset.c (FONTSET_OBJLIST): Remove.
6520 (free_realized_fontset) #if-0 the body, which does nothing.
6521 (face_suitable_for_char_p): #if-0, as it's never called.
6522 * fontset.h (face_suitable_for_char_p): Remove decl.
04f2d78b
CB
6523 * xfaces.c (face_at_string_position):
6524 Use FACE_SUITABLE_FOR_ASCII_CHAR_P, not FACE_SUITABLE_FOR_CHAR_P,
239f9db9
PE
6525 since 0 is always ASCII.
6526
dfcf3579
PE
6527 * fns.c (weak_hash_tables): Now static.
6528
5045092b
PE
6529 * fileio.c: Make symbols static if they're not exported.
6530 (auto_saving, auto_save_mode_bits, auto_save_error_occurred):
6531 (Vwrite_region_annotation_buffers): Now static.
6532
57a96f5c
PE
6533 * eval.c: Make symbols static if they're not exported.
6534 (backtrace_list, lisp_eval_depth, when_entered_debugger): Now static.
6535 * lisp.h (backtrace_list): Remove decl.
6536
35f08c38
PE
6537 * emacs.c: Make symbols static if they're not exported.
6538 (malloc_state_ptr, malloc_using_checking, syms_of_emacs):
6539 (fatal_error_code, fatal_error_signal_hook, standard_args):
6540 Now static.
6541 (fatal_error_signal): Now static, unless FLOAT_CATCH_SIGKILL.
6542 (DEFINE_DUMMY_FUNCTION): Mark function as externally visible.
6543 (__CTOR_LIST__, __DTOR_LIST__): Now externally visible.
6544 * lisp.h (fatal_error_signal_hook): Remove decl.
6545 (fatal_error_signal): Declare only if FLOAT_CATCH_SIGKILL.
6546
f44bd759
PE
6547 * editfns.c: Move a (normally-unused) function to its only use.
6548 * editfns.c, lisp.h (get_operating_system_release): Remove.
6549 * process.c (init_process) [DARWIN_OS]: Do it inline, as it is not
6550 worth the hassle of breaking this out.
6551
b532497d
PE
6552 * xterm.c: Make symbols static if they're not exported.
6553 (x_raise_frame, x_lower_frame, x_wm_set_window_state):
6554 (x_wm_set_icon_pixmap, x_initialize, XTread_socket_fake_io_error):
6555 (x_destroy_window, x_delete_display):
6556 Now static.
6557 (x_dispatch_event): Now static if ! (USE_MOTIF || USE_X_TOOLKIT).
6558 (x_mouse_leave): Remove; unused.
6559 * xterm.h (x_display_info_for_name, x_raise_frame, x_lower_frame):
6560 (x_destroy_window, x_wm_set_window_state, x_wm_set_icon_pixmap):
6561 (x_delete_display, x_initialize, x_set_border_pixel, x_screen_planes):
6562 Remove decls.
6563 (x_mouse_leave): Declare only if WINDOWSNT.
6564 (x_dispatch_event): Declare only if USE_MOTIF or USE_X_TOOLKIT.
6565 (xic_create_fontsetname): Declare only if HAVE_X_WINDOWS &&
6566 USE_X_TOOLKIT.
6567
1675728f
PE
6568 * ftxfont.c: Make symbols static if they're not exported.
6569 (ftxfont_driver): Export only if !defined HAVE_XFT && def8ined
6570 HAVE_FREETYPE.
6571 * font.h (ftxfont_driver): Likewise.
6572
e4cebfca
PE
6573 * xfns.c: Make symbols static if they're not exported.
6574 (x_last_font_name, x_display_info_for_name):
6575 (x_set_foreground_color, x_set_background_color, x_set_mouse_color):
6576 (x_set_cursor_color, x_set_border_pixel, x_set_border_color):
6577 (x_set_cursor_type, x_set_icon_type, x_set_icon_name):
6578 (x_set_scroll_bar_foreground, x_set_scroll_bar_background):
6579 (x_explicitly_set_name, x_set_title, xic_defaut_fontset, tip_timer):
6580 (last_show_tip_args): Now static.
6581 (xic_defaut_fontset, xic_create_fontsetname): Define only if
6582 defined HAVE_X_WINDOWS && defined USE_X_TOOLKIT
6583 (x_screen_planes): Remove; unused.
6584 * dispextern.h (x_screen_planes): Remove decl.
6585
5bf46f05
PE
6586 * dispnew.c: Make symbols static if they're not exported.
6587 * dispextern.h (redraw_garbaged_frames, scrolling):
6588 (increment_row_positions): Remove.
6589 * dispnew.c (new_glyph_matrix, increment_row_positions, scrolling):
6590 (delayed_size_change, glyph_matrix_count, glyph_pool_count):
6591 Now static.
6592 (redraw_garbaged_frames): Remove; unused.
6593
435f4c28
PE
6594 * xfaces.c: Make symbols static if they're not exported.
6595 * dispextern.h (ascii_face_of_lisp_face, free_realized_face):
6596 Remove decls.
6597 * xterm.h (defined_color): Remove decls.
6598 (x_free_dpy_colors): Declare only if USE_X_TOOLKIT.
6599 * xfaces.c (tty_suppress_bold_inverse_default_colors_p):
6600 (menu_face_changed_default, defined_color, free_realized_face):
6601 (x_free_dpy_colors): Define only if USE_X_TOOLKIT.
6602 (ascii_face_of_lisp_face): Remove; unused.
6603
8524aef3
PE
6604 * xdisp.c: Make symbols static if they're not exported.
6605 * dispextern.h (scratch_glyph_row, window_box_edges):
6606 (glyph_to_pixel_coords, set_cursor_from_row):
6607 (get_next_display_element, set_iterator_to_next):
6608 (highlight_trailing_whitespace, frame_to_window_pixel_xy):
6609 (show_mouse_face): Remove decls
6610 * frame.h (message_buf_print): Likewise.
6611 * lisp.h (pop_message, set_message, check_point_in_composition):
6612 Likewise.
6613 * xterm.h (set_vertical_scroll_bar): Likewise.
6614 * xdisp.c (list_of_error, Vmessage_stack, line_number_displayed):
6615 (message_buf_print, scratch_glyph_row, displayed_buffer):
6616 (set_iterator_to_next, pop_message, set_message, set_cursor_from_row):
6617 (get_next_display_element, show_mouse_face, window_box_edges):
6618 (frame_to_window_pixel_xy, check_point_in_composition):
6619 (set_vertical_scroll_bar, highlight_trailing_whitespace): Now static.
6620 (glyph_to_pixel_coords): Remove; unused.
6621
16390cd2
PE
6622 * dired.c (file_name_completion): Now static.
6623
6624 * dbusbind.c (xd_in_read_queued_messages): Now static.
6625
a25f4dfa
PE
6626 * lisp.h (circular_list_error, FOREACH): Remove; unused.
6627 * data.c (circular_list_error): Remove.
6628
14a9c8df
PE
6629 * commands.h (last_point_position, last_point_position_buffer):
6630 (last_point_position_window): Remove decls.
6631 * keyboard.c: Make these variables static.
6632
04f2d78b
CB
6633 * coding.h (coding, code_convert_region, encode_coding_gap):
6634 Remove decls.
74ab6df5
PE
6635 * coding.c (Vsjis_coding_system, Vbig5_coding_system):
6636 (iso_code_class, detect_coding, code_convert_region): Now static.
6637 (encode_coding_gap): Remove; unused.
6638
38dfbee1
PE
6639 * chartab.c (chartab_chars, chartab_bits): Now static.
6640
a2cb4e63
PE
6641 * charset.h (charset_iso_8859_1): Remove decl.
6642 * charset.c (charset_iso_8859_1, charset_emacs, map_charset_for_dump):
6643 Now static.
6644
127198fd
PE
6645 * ccl.h (check_ccl_update, Vccl_program_table): Remove decls.
6646 * ccl.c (Vccl_program_table): Now static.
6647 (check_ccl_update): Remove; unused.
6648
d85b608f
PE
6649 * category.c (SET_CATEGORY_SET, set_category_set): Move here.
6650 * category.h: ... from here.
6651 * category.c (check_category_table, set_category_set): Now static.
6652
31cd66f3
PE
6653 * casetab.c (Vascii_upcase_table, Vascii_eqv_table): Now static.
6654 * lisp.h: Remove these decls.
6655
c358e587
PE
6656 * buffer.c (buffer_count): Remove unused var.
6657
e78aecca
PE
6658 * bidi.c (bidi_dump_cached_states): Mark as externally visible,
6659 so that it's not optimized away.
6660 (bidi_ignore_explicit_marks_for_paragraph_level): Likewise.
6661 * dispextern.h (bidi_dump_cached_states): Remove, since it's
6662 exported only to the debugger.
6663
e192d7d3 6664 * atimer.c (alarm_signal_handler, run_all_atimers): Now static.
04f2d78b 6665 * atimer.h (run_all_atimers): Remove; not exported.
e192d7d3 6666
92470028
PE
6667 font.c: Make copy_font_spec and merge_font_spec ordinary C functions.
6668 * font.c (copy_font_spec): Rename from Fcopy_font_spec, since it
6669 was inaccessible from Lisp.
6670 (merge_font_spec): Likewise, renaming from Fmerge_font_spec.
6671 * font.c, font.h, fontset.c, xfaces.c, xfont.c: Change all uses.
6672
244ed907
PE
6673 alloc.c: Import and export fewer symbols, and remove unused items.
6674 * lisp.h (suppress_checking, die): Declare only if ENABLE_CHECKING
6675 is defined.
6676 (suppress_checking): Add EXTERNALLY_VISIBLE attribute, so that
6677 it's not optimized away by whole-program optimization.
6678 (message_enable_multibyte, free_misc): Remove.
6679 (catchlist, handlerlist, mark_backtrace):
6680 Declare only if BYTE_MARK_STACK.
6681 (mark_byte_stack): Likewise, fixing a ifdef-vs-if typo.
6682 * alloc.c (pure): Export only if VIRT_ADDR_VARIES is defined.
6683 (message_enable_multibyte): Remove decl.
6684 (free_misc, interval_free_list, float_block, float_block_index):
6685 (n_float_blocks, float_free_list, cons_block, cons_block_index):
6686 (cons_free_list, last_marked_index):
6687 Now static.
6688 (suppress_checking, die): Define only if ENABLE_CHECKING is defined.
6689 * eval.c (catchlist, handlerlist): Export only if BYTE_MARK_STACK.
6690 (mark_backtrace): Define only if BYTE_MARK_STACK.
6691 * xdisp.c (message_enable_multibyte): Now static.
6692
61c2b50e 6693 Declare Lisp_Object Q* variables to be 'static' if not exported.
955cbe7b
PE
6694 This makes it easier for human readers (and static analyzers)
6695 to see whether these variables are used from other modules.
6696 * alloc.c, buffer.c, bytecode.c, callint.c, casetab.c, category.c:
6697 * ccl.c, character.c, charset.c, cmds.c, coding.c, composite.c:
6698 * data.c, dbusbind.c, dired.c, editfns.c, eval.c, fileio.c, fns.c:
6699 * font.c, frame.c, fringe.c, ftfont.c, image.c, keyboard.c, keymap.c:
6700 * lread.c, macros.c, minibuf.c, print.c, process.c, search.c:
6701 * sound.c, syntax.c, textprop.c, window.c, xdisp.c, xfaces.c, xfns.c:
6702 * xmenu.c, xselect.c:
6703 Declare Q* vars static if they are not used in other modules.
6704 * ccl.h, character.h, charset.h, coding.h, composite.h, font.h:
6705 * frame.h, intervals.h, keyboard.h, lisp.h, process.h, syntax.h:
6706 Remove decls of unexported vars.
6707 * keyboard.h (EVENT_HEAD_UNMODIFIED): Remove now-unused macro.
6708
95c82688
PE
6709 * lisp.h (DEFINE_FUNC): Make sname 'static'.
6710
16a97296
PE
6711 Make Emacs functions such as Fatom 'static' by default.
6712 This makes it easier for human readers (and static analyzers)
6713 to see whether these functions can be called from other modules.
6714 DEFUN now defines a static function. To make the function external
6715 so that it can be used in other C modules, use the new macro DEFUE.
8bd7b830
PE
6716 * lisp.h (Funibyte_char_to_multibyte, Fsyntax_table_p):
6717 (Finit_image_library):
16a97296
PE
6718 (Feval_region, Fbacktrace, Ffetch_bytecode, Fswitch_to_buffer):
6719 (Ffile_executable_p, Fmake_symbolic_link, Fcommand_execute):
6720 (Fget_process, Fdocumentation_property, Fbyte_code, Ffile_attributes):
6721 Remove decls, since these functions are now static.
6722 (Funintern, Fget_internal_run_time): New decls, since these functions
6723 were already external.
95c82688 6724
16a97296
PE
6725 * alloc.c, buffer.c, callint.c, callproc.c, casefiddle.c, casetab.c:
6726 * ccl.c, character.c, chartab.c, cmds.c, coding.c, data.c, dispnew.c:
6727 * doc.c, editfns.c, emacs.c, eval.c, fileio.c, filelock.c, floatfns.c:
6728 * fns.c, font.c, fontset.c, frame.c, image.c, indent.c:
6729 * keyboard.c, keymap.c, lread.c:
6730 * macros.c, marker.c, menu.c, minibuf.c, print.c, process.c, search.c:
6731 * syntax.c, term.c, terminal.c, textprop.c, undo.c:
6732 * window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xsettings.c:
6733 Mark functions with DEFUE instead of DEFUN,
6734 if they are used in other modules.
6735 * buffer.c (Fset_buffer_major_mode, Fdelete_overlay): New forward
6736 decls for now-static functions.
6737 * buffer.h (Fdelete_overlay): Remove decl.
6738 * callproc.c (Fgetenv_internal): Mark as internal.
6739 * composite.c (Fremove_list_of_text_properties): Remove decl.
6740 (Fcomposition_get_gstring): New forward static decl.
6741 * composite.h (Fcomposite_get_gstring): Remove decl.
6742 * dired.c (Ffile_attributes): New forward static decl.
6743 * doc.c (Fdocumntation_property): New forward static decl.
6744 * eval.c (Ffetch_bytecode): New forward static decl.
6745 (Funintern): Remove extern decl; now in .h file where it belongs.
6746 * fileio.c (Fmake_symbolic_link): New forward static decl.
6747 * image.c (Finit_image_library): New forward static decl.
6748 * insdel.c (Fcombine_after_change_execute): Make forward decl static.
6749 * intervals.h (Fprevious_property_change):
6750 (Fremove_list_of_text_properties): Remove decls.
6751 * keyboard.c (Fthis_command_keys): Remove decl.
6752 (Fcommand_execute): New forward static decl.
6753 * keymap.c (Flookup_key): New forward static decl.
6754 (Fcopy_keymap): Now static.
6755 * keymap.h (Flookup_key): Remove decl.
6756 * process.c (Fget_process): New forward static decl.
6757 (Fprocess_datagram_address): Mark as internal.
6758 * syntax.c (Fsyntax_table_p): New forward static decl.
6759 (skip_chars): Remove duplicate decl.
6760 * textprop.c (Fprevious_property_change): New forward static decl.
6761 * window.c (Fset_window_fringes, Fset_window_scroll_bars):
6762 Now internal.
6763 (Fset_window_margins, Fset_window_vscroll): New forward static decls.
6764 * window.h (Fset_window_vscroll, Fset_window_margins): Remove decls.
6765
785bbd42
PE
6766 * editfns.c (Fformat): Remove unreachable code.
6767
8b913b57
AS
67682011-04-14 Andreas Schwab <schwab@linux-m68k.org>
6769
6770 * fileio.c (Finsert_file_contents): Fix typo in 2005-05-13
6771 change. (Bug#8496)
6772
a6744a35
EZ
67732011-04-13 Eli Zaretskii <eliz@gnu.org>
6774
6775 * xdisp.c (handle_invisible_prop): Don't call bidi_paragraph_init
6776 when at ZV. (Bug#8487)
6777
e7974947
AS
67782011-04-12 Andreas Schwab <schwab@linux-m68k.org>
6779
baad03f0
AS
6780 * charset.c (Fclear_charset_maps): Use xfree instead of free.
6781 (Bug#8437)
6782 * keyboard.c (parse_tool_bar_item): Likewise.
6783 * sound.c (sound_cleanup, alsa_close): Likewise.
6784 * termcap.c (tgetent): Likewise.
6785 * xfns.c (x_default_font_parameter): Likewise.
6786 * xsettings.c (read_and_apply_settings): Likewise.
6787
e7974947
AS
6788 * alloc.c (overrun_check_malloc, overrun_check_realloc)
6789 (overrun_check_free): Protoize.
6790
28272684
PE
67912011-04-12 Paul Eggert <eggert@cs.ucla.edu>
6792
6793 * sysdep.c (emacs_read, emacs_write): Check for negative sizes
6794 since callers should never pass a negative size.
6795 Change the signature to match that of plain 'read' and 'write'; see
6796 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00397.html>.
6797 * lisp.h: Update prototypes of emacs_write and emacs_read.
6798
11997c76
EZ
67992011-04-11 Eli Zaretskii <eliz@gnu.org>
6800
6801 * xdisp.c (redisplay_window): Don't try to determine the character
6802 position of the scroll margin if the window start point w->startp
e896f03c 6803 is outside the buffer's accessible region. (Bug#8468)
11997c76 6804
8a2cbd72
EZ
68052011-04-10 Eli Zaretskii <eliz@gnu.org>
6806
6807 Fix write-region and its subroutines for buffers > 2GB.
6808 * fileio.c (a_write, e_write): Modify declaration of arguments and
6809 local variables to support buffers larger than 2GB.
6810 (Fcopy_file): Use EMACS_INT for return value of emacs_read.
6811
6812 * sysdep.c (emacs_write, emacs_read): Use ssize_t for last
6813 argument, local variables, and return value.
6814
6815 * lisp.h: Update prototypes of emacs_write and emacs_read.
6816
6817 * sound.c (vox_write): Use ssize_t for return value of emacs_write.
6818
4073e537 68192011-04-10 Paul Eggert <eggert@cs.ucla.edu>
eb3f1cc8 6820
1ebfdcb6
PE
6821 * xdisp.c (vmessage): Use memchr, not strnlen, which some hosts lack.
6822
b2ded58d
PE
6823 Fix more problems found by GCC 4.6.0's static checks.
6824
7d66342c
PE
6825 * xdisp.c (vmessage): Use a better test for character truncation.
6826
bbf47d44
PE
6827 * charset.c (load_charset_map): <, not <=, for optimization,
6828 and to avoid potential problems with integer overflow.
9248994d 6829 * chartab.c (sub_char_table_set_range, char_table_set_range): Likewise.
f9a68bc5 6830 * casetab.c (set_identity, shuffle): Likewise.
3ab1c7ce 6831 * editfns.c (Fformat): Likewise.
1e69125e 6832 * syntax.c (skip_chars): Likewise.
3befa583 6833
e3019616
PE
6834 * xmenu.c (set_frame_menubar): Allocate smaller local vectors.
6835 This also lets GCC 4.6.0 generate slightly better loop code.
6836
becfa255
PE
6837 * callint.c (Fcall_interactively): <, not <=, for optimization.
6838 (Fcall_interactively): Count the number of arguments produced,
6839 not the number of arguments given. This is simpler and lets GCC
6840 4.6.0 generate slightly better code.
6841
dae0cd48
PE
6842 * ftfont.c: Distingish more carefully between FcChar8 and char.
6843 The previous code passed unsigned char * to a functions like
6844 strlen and xstrcasecmp that expect char *, which does not
6845 conform to the C standard.
6846 (get_adstyle_property, ftfont_pattern_entity): Use FcChar8 for
6847 arguments to FcPatternGetString, and explicitly cast FcChar8 * to
6848 char * when the C standard requires it.
6849
76032d70
PE
6850 * keyboard.c (read_char): Remove unused var.
6851
eb3f1cc8
PE
6852 * eval.c: Port to Windows vsnprintf (Bug#8435).
6853 Include <limits.h>.
6854 (SIZE_MAX): Define if the headers do not.
6855 (verror): Do not give up if vsnprintf returns a negative count.
6856 Instead, grow the buffer. This ports to Windows vsnprintf, which
6857 does not conform to C99. Problem reported by Eli Zaretskii.
6858 Also, simplify the allocation scheme, by avoiding the need for
6859 calling realloc, and removing the ALLOCATED variable.
6860
70476b54
PE
6861 * eval.c (verror): Initial buffer size is 4000 (not 200) bytes.
6862
12020a9e
PE
6863 Remove invocations of doprnt, as Emacs now uses vsnprintf.
6864 But keep the doprint source code for now, as we might revamp it
6865 and use it again (Bug#8435).
ea6c7ae6
PE
6866 * lisp.h (doprnt): Remove.
6867 * Makefile.in (base_obj): Remove doprnt.o.
6868 * deps.mk (doprnt.o): Remove.
6869
5fdb398c
PE
6870 error: Print 32- and 64-bit integers portably (Bug#8435).
6871 Without this change, on typical 64-bit hosts error ("...%d...", N)
6872 was used to print both 32- and 64-bit integers N, which relied on
6873 undefined behavior.
6874 * lisp.h, src/m/amdx86-64.h, src/m/ia64.h, src/m/ibms390x.h (pEd):
6875 New macro.
6876 * lisp.h (error, verror): Mark as printf-like functions.
6877 * eval.c (verror): Use vsnprintf, not doprnt, to do the real work.
6878 Report overflow in size calculations when allocating printf buffer.
6879 Do not truncate output string at its first null byte.
6880 * xdisp.c (vmessage): Use vsnprintf, not doprnt, to do the real work.
6881 Truncate the output at a character boundary, since vsnprintf does not
6882 do that.
6883 * charset.c (check_iso_charset_parameter): Convert internal
6884 character to string before calling 'error', since %c now has the
6885 printf meaning.
6886 * coding.c (Fdecode_sjis_char, Fdecode_big5_char): Avoid int
6887 overflow when computing char to be passed to 'error'. Do not
6888 pass Lisp_Object to 'error'; pass the integer instead.
6889 * nsfns.m (Fns_do_applescript): Use int, not long, since it's
6890 formatted with plain %d.
6891
b189fa66
PE
6892 * eval.c (internal_lisp_condition_case): Don't pass spurious arg.
6893
bff87ef0
PE
6894 * keyboard.c (access_keymap_keyremap): Print func name, not garbage.
6895
7e2cac20
PE
6896 * coding.c (Fdecode_sjis_char): Don't assume CODE fits in int.
6897
ce4d90b5
PE
6898 * xterm.c (x_catch_errors): Remove duplicate declaration.
6899
266c9547
PE
6900 * term.c (maybe_fatal): Mark its 3rd arg as a printf format, too.
6901
79c49ad2
PE
6902 * xdisp.c, lisp.h (message_nolog): Remove; unused.
6903
368f4090
JM
69042011-04-10 Jim Meyering <meyering@redhat.com>
6905
6906 use ssize_t and size_t for read- and write-like emacs_gnutls_* functions
6907 * gnutls.c (emacs_gnutls_read): Adjust signature to be more read-like:
6908 return ssize_t not "int", and use size_t as the buffer length.
6909 (emacs_gnutls_write): Likewise, and make the buffer pointer "const".
6910 * gnutls.h: Update declarations.
6911 * process.c (read_process_output): Use ssize_t, to match.
6912 (send_process): Likewise.
6913
a32d4040
CY
69142011-04-09 Chong Yidong <cyd@stupidchicken.com>
6915
6916 * image.c (Fimagemagick_types): Doc fix, and comment cleanup.
6917
8546720e 69182011-04-09 Chong Yidong <cyd@stupidchicken.com>
aac0c6e3 6919
04f2d78b
CB
6920 * ftfont.c (get_adstyle_property, ftfont_pattern_entity):
6921 Use unsigned char, to match FcChar8 type definition.
aac0c6e3 6922
8546720e
GM
6923 * xterm.c (handle_one_xevent):
6924 * xmenu.c (create_and_show_popup_menu):
6925 * xselect.c (x_decline_selection_request)
6926 (x_reply_selection_request): Avoid type-punned deref of X events.
aac0c6e3 6927
0a2f5c1a 69282011-04-09 Eli Zaretskii <eliz@gnu.org>
a53e2e89
EZ
6929
6930 Fix some uses of `int' instead of EMACS_INT.
6931 * search.c (string_match_1, fast_string_match)
6932 (fast_c_string_match_ignore_case, fast_string_match_ignore_case)
6933 (scan_buffer, find_next_newline_no_quit)
6934 (find_before_next_newline, search_command, Freplace_match)
6935 (Fmatch_data): Make some `int' variables be EMACS_INT.
6936
6937 * xdisp.c (display_count_lines): 3rd argument and return value now
6938 EMACS_INT. All callers changed.
6939 (pint2hrstr): Last argument is now EMACS_INT.
6940
6941 * coding.c (detect_coding_utf_8, detect_coding_emacs_mule)
6942 (detect_coding_iso_2022, detect_coding_sjis, detect_coding_big5)
6943 (detect_coding_ccl, detect_coding_charset, decode_coding_utf_8)
6944 (decode_coding_utf_16, decode_coding_emacs_mule)
6945 (decode_coding_iso_2022, decode_coding_sjis, decode_coding_big5)
6946 (decode_coding_ccl, decode_coding_charset)
6947 <consumed_chars, consumed_chars_base>: Declare EMACS_INT.
6948 (decode_coding_iso_2022, decode_coding_emacs_mule)
6949 (decode_coding_sjis, decode_coding_big5, decode_coding_charset)
6950 <char_offset, last_offset>: Declare EMACS_INT.
6951 (encode_coding_utf_8, encode_coding_utf_16)
6952 (encode_coding_emacs_mule, encode_invocation_designation)
6953 (encode_designation_at_bol, encode_coding_iso_2022)
6954 (encode_coding_sjis, encode_coding_big5, encode_coding_ccl)
6955 (encode_coding_raw_text, encode_coding_charset) <produced_chars>:
6956 Declare EMACS_INT.
6957 (ASSURE_DESTINATION): Declare more_bytes EMACS_INT.
6958 (encode_invocation_designation): Last argument P_NCHARS is now
6959 EMACS_INT.
6960 (decode_eol): Declare pos_byte, pos, and pos_end EMACS_INT.
6961 (produce_chars): from_nchars and to_nchars are now EMACS_INT.
6962
6963 * coding.h (struct coding_system) <head_ascii>: Declare EMACS_INT.
6964 All users changed.
6965
6966 * ccl.c (Fccl_execute_on_string): Declare some variables
6967 EMACS_INT.
6968
8546720e 69692011-04-08 Samuel Thibault <sthibault@debian.org> (tiny change)
0080dc6b
SS
6970
6971 * term.c (init_tty): Fix incorrect ifdef placement (Bug#8450).
6972
4e19a977
CS
69732011-03-19 Christoph Scholtes <cschol2112@googlemail.com>
6974
6975 * process.c (Fformat_network_address): Doc fix.
6976
87302331
R
69772011-04-08 T.V. Raman <tv.raman.tv@gmail.com> (tiny change)
6978
6979 * xml.c (parse_region): Avoid creating spurious whiespace nodes.
6980
cbb59342
CY
69812011-04-08 Chong Yidong <cyd@stupidchicken.com>
6982
6983 * keyboard.c (read_char): Call Lisp function help-form-show,
6984 instead of using internal_with_output_to_temp_buffer.
6985 (Qhelp_form_show): New var.
e0d38eeb 6986 (syms_of_keyboard): Use DEFSYM macro.
cbb59342
CY
6987
6988 * print.c (internal_with_output_to_temp_buffer): Function deleted.
6989
6990 * lisp.h (internal_with_output_to_temp_buffer): Remove prototype.
6991
e67a13ab
CY
69922011-04-06 Chong Yidong <cyd@stupidchicken.com>
6993
04f2d78b
CB
6994 * process.c (Flist_processes): Remove to Lisp.
6995 (list_processes_1): Delete.
e67a13ab 6996
973f782d
EZ
69972011-04-06 Eli Zaretskii <eliz@gnu.org>
6998
7c106b1e
EZ
6999 * msdos.c (careadlinkat, careadlinkatcwd): MS-DOS replacements.
7000
973f782d
EZ
7001 * w32.c (careadlinkat, careadlinkatcwd): New always-fail stubs.
7002
41cf7d1a 70032011-04-06 Paul Eggert <eggert@cs.ucla.edu>
27ccc379 7004
ca23cc88
PE
7005 Fix more problems found by GCC 4.6.0's static checks.
7006
f390e2d5
PE
7007 * xmenu.c (Fx_popup_dialog): Don't assume string is free of formats.
7008
42eea0d0
PE
7009 * menu.c (Fx_popup_menu): Don't assume error_name lacks printf formats.
7010
b69769da 7011 * lisp.h (message, message_nolog, fatal): Mark as printf-like.
1e973bc7 7012
f9541e84
PE
7013 * xdisp.c (vmessage): Mark as a printf-like function.
7014
13841b55
PE
7015 * term.c (vfatal, maybe_fatal): Mark as printf-like functions.
7016
c136c10f
PE
7017 * sound.c (sound_warning): Don't crash if arg contains a printf format.
7018
5e2d4a30
PE
7019 * image.c (tiff_error_handler, tiff_warning_handler): Mark as
7020 printf-like functions.
7021 (tiff_load): Add casts to remove these marks before passing them
7022 to system-supplied API.
7023
583f48b9
PE
7024 * eval.c (Fsignal): Remove excess argument to 'fatal'.
7025
b25d760e
PE
7026 * coding.c (EMIT_ONE_BYTE, EMIT_TWO_BYTES): Use unsigned, not int.
7027 This avoids several warnings with gcc -Wstrict-overflow.
d5efd1d1
PE
7028 (DECODE_COMPOSITION_RULE): If the rule is invalid, goto invalid_code
7029 directly, rather than having caller test rule sign. This avoids
7030 some unnecessary tests.
7031 * composite.h (COMPOSITION_ENCODE_RULE_VALID): New macro.
7032 (COMPOSITION_ENCODE_RULE): Arguments now must be valid. This
7033 affects only one use, in DECODE_COMPOSITION_RULE, which is changed.
b25d760e 7034
bc7b6697 7035 * xfont.c (xfont_text_extents): Remove var that was set but not used.
625a3eb1 7036 (xfont_open): Avoid unnecessary tests.
bc7b6697 7037
27ccc379
PE
7038 * composite.c (composition_gstring_put_cache): Use unsigned integer.
7039
dcd5c89a
PE
7040 * composite.h, composite.c (composition_gstring_put_cache):
7041 Use EMACS_INT, not int, for length.
7042
b13a45c6
PE
7043 * composite.h (COMPOSITION_DECODE_REFS): New macro,
7044 breaking out part of COMPOSITION_DECODE_RULE.
7045 (COMPOSITION_DECODE_RULE): Use it.
7046 * composite.c (get_composition_id): Remove unused local vars,
7047 by using the new macro.
7048
1e792e4d
PE
7049 * textprop.c (set_text_properties_1): Change while to do-while,
7050 since the condition is always true at first.
7051
dc6c6455 7052 * intervals.c (graft_intervals_into_buffer): Mark var as used.
aa86731f
PE
7053 (interval_deletion_adjustment): Return unsigned value.
7054 All uses changed.
dc6c6455 7055
aba7731a
PE
7056 * process.c (list_processes_1, create_pty, read_process_output):
7057 (exec_sentinel): Remove vars that were set but not used.
afd4052b 7058 (create_pty): Remove unnecessary "volatile"s.
bc57d757 7059 (Fnetwork_interface_info): Avoid possibility of int overflow.
82eaa333 7060 (read_process_output): Do adaptive read buffering even if carryover.
fe07cdfa 7061 (read_process_output): Simplify nbytes computation if buffered.
aba7731a 7062
fdfc4bf3
PE
7063 * bytecode.c (exec_byte_code): Rename local to avoid shadowing.
7064
fca8fe46 7065 * syntax.c (scan_words): Remove var that was set but not used.
12cbf13f 7066 (update_syntax_table): Use unsigned instead of int.
fca8fe46 7067
06a0259a 7068 * lread.c (lisp_file_lexically_bound_p): Use ints rather than endptrs.
3c346cc3 7069 (lisp_file_lexically_bound_p, read1): Use unsigned instead of int.
e6eb4e9e 7070 (safe_to_load_p): Make the end-of-loop test the inverse of the in-loop.
06a0259a 7071
e7b9e80f
PE
7072 * print.c (print_error_message): Avoid int overflow.
7073
56201685
PE
7074 * font.c (font_list_entities): Redo for clarity,
7075 so that reader need not know FONT_DPI_INDEX + 1 == FONT_SPACING_INDEX.
7076
78834453 7077 * font.c (font_find_for_lface, Ffont_get_glyphs): Remove unused vars.
790771b1 7078 (font_score): Avoid potential overflow in diff calculation.
78834453 7079
0bc0b309 7080 * fns.c (substring_both): Remove var that is set but not used.
8cd55cb4 7081 (sxhash): Redo loop for clarity and to avoid wraparound warning.
0bc0b309 7082
e610eaca
PE
7083 * eval.c (funcall_lambda): Rename local to avoid shadowing.
7084
b895abce
PE
7085 * alloc.c (mark_object_loop_halt, mark_object): Use size_t, not int.
7086 Otherwise, GCC 4.6.0 optimizes the loop check away since the check
7087 can always succeed if overflow has undefined behavior.
7088
1f1d9321 7089 * search.c (boyer_moore, wordify): Remove vars set but not used.
6f076cc7 7090 (wordify): Omit three unnecessary tests.
1f1d9321 7091
c59478bc
PE
7092 * indent.c (MULTIBYTE_BYTES_WIDTH): Don't compute wide_column.
7093 All callers changed. This avoids the need for an unused var.
7094
79b73827
PE
7095 * casefiddle.c (casify_region): Remove var that is set but not used.
7096
a4db5dfe
PE
7097 * dired.c (file_name_completion): Remove var that is set but not used.
7098
43aae36e
PE
7099 * fileio.c (Finsert_file_contents): Make EOF condition clearer.
7100
2a47c44d 7101 * fileio.c (Finsert_file_contents): Avoid signed integer overflow.
163c5f32 7102 (Finsert_file_contents): Remove unnecessary code checking fd.
2a47c44d 7103
a37c69bf
PE
7104 * minibuf.c (read_minibuf_noninteractive): Use size_t for sizes.
7105 Check for integer overflow on size calculations.
7106
328ab8e7
PE
7107 * buffer.c (Fprevious_overlay_change): Remove var that is set
7108 but not used.
7109
e5a2a5cb
PE
7110 * keyboard.c (menu_bar_items, read_char_minibuf_menu_prompt):
7111 Remove vars that are set but not used.
8d84a6eb 7112 (timer_check_2): Don't assume timer-list and idle-timer-list are lists.
6b043475 7113 (timer_check_2): Mark vars as initialized.
e5a2a5cb 7114
a60e5f68
PE
7115 * gtkutil.c (xg_get_file_with_chooser): Mark var as initialized.
7116
f661cb61 7117 * image.c (lookup_image): Remove var that is set but not used.
35fa624f 7118 (xbm_load): Use parse_p, for gcc -Werror=unused-but-set-variable.
f661cb61 7119
f0397f5a
PE
7120 * fontset.c (Finternal_char_font, Ffontset_info): Remove vars
7121 that are set but not used.
7122
8664db06 7123 * xfns.c (make_invisible_cursor): Don't return garbage
03733ee7 7124 if XCreateBitmapFromData fails (Bug#8410).
8664db06 7125
6abdaa4a
PE
7126 * xselect.c (x_get_local_selection, x_handle_property_notify):
7127 Remove vars that are set but not used.
7128
0ce7538d 7129 * xfns.c (x_create_tip_frame): Remove var that is set but not used.
6abdaa4a 7130 (make_invisible_cursor): Initialize a possibly-uninitialized variable.
0ce7538d 7131
9ae848fc
PE
7132 * xterm.c (x_scroll_bar_to_input_event) [!USE_GTK]:
7133 Remove var that is set but not used.
0b918413
PE
7134 (scroll_bar_windows_size): Now size_t, not int.
7135 (x_send_scroll_bar_event): Use size_t, not int, for sizes.
7136 Check for overflow.
9ae848fc 7137
a5a62657
PE
7138 * xfaces.c (realize_named_face): Remove vars that are set but not used.
7139 (map_tty_color) [!defined MSDOS]: Likewise.
7140
5c5cdd39
PE
7141 * term.c (tty_write_glyphs): Use size_t; this avoids overflow warning.
7142
66ebf983
PE
7143 * coding.c: Remove vars that are set but not used.
7144 (DECODE_COMPOSITION_RULE): Remove 2nd arg, which is unused.
7145 All callers changed.
7146 (decode_coding_utf_8, decode_coding_utf_16 decode_coding_emacs_mule):
7147 (decode_coding_iso_2022, encode_coding_sjis, encode_coding_big5):
7148 (decode_coding_charset): Remove vars that are set but not used.
7149
1be4d761
PE
7150 * bytecode.c (Fbyte_code) [!defined BYTE_CODE_SAFE]: Remove var
7151 that is set but not used.
7152
47553fa8
PE
7153 * print.c (print_object): Remove var that is set but not used.
7154
1f7196bf 7155 Replace 2 copies of readlink code with 1 gnulib version (Bug#8401).
d1fdcab7
PE
7156 The gnulib version avoids calling malloc in the usual case,
7157 and on 64-bit hosts doesn't have some arbitrary 32-bit limits.
7158 * fileio.c (Ffile_symlink_p): Use emacs_readlink.
7159 * filelock.c (current_lock_owner): Likewise.
7160 * lisp.h (READLINK_BUFSIZE, emacs_readlink): New function.
7161 * sysdep.c: Include allocator.h, careadlinkat.h.
7162 (emacs_no_realloc_allocator): New static constant.
7163 (emacs_readlink): New function.
fdb61804
PE
7164 * deps.mk (sysdep.o): Depend on ../lib/allocator.h and on
7165 ../lib/careadlinkat.h.
d1fdcab7 7166
f84c17c7
SM
71672011-04-04 Stefan Monnier <monnier@iro.umontreal.ca>
7168
7169 * keyboard.c (safe_run_hook_funcall): Fix last change (don't stop at the
7170 first non-nil return value).
7171
ef3862ad
JD
71722011-04-03 Jan Djärv <jan.h.d@swipnet.se>
7173
7174 * nsterm.m (ns_update_auto_hide_menu_bar): Define MAC_OS_X_VERSION_10_6
7175 if not defined (Bug#8403).
7176
376a7006
JB
71772011-04-02 Juanma Barranquero <lekktu@gmail.com>
7178
7179 * xdisp.c (display_count_lines): Remove parameter `start',
7180 unused since 1998-01-01T02:27:27Z!rms@gnu.org. All callers changed.
7181 (get_char_face_and_encoding): Remove parameter `multibyte_p',
7182 unused since 2008-05-14T01:40:23Z!handa@m17n.org. All callers changed.
7183 (fill_stretch_glyph_string): Remove parameters `row' and `area',
7184 unused at least since Kim's GUI unification at 2003-03-16T20:45:46Z!storm@cua.dk
7185 and thereabouts. All callers changed.
7186 (get_per_char_metric): Remove parameter `f', unused since
7187 2008-05-14T01:40:23Z!handa@m17n.org. All callers changed.
7188
6ca3801d
JM
71892011-04-02 Jim Meyering <meyering@redhat.com>
7190
7191 do not dereference NULL upon failed strdup
7192 * nsfont.m (ns_descriptor_to_entity): Use xstrdup, not strdup.
7193 (ns_get_family): Likewise.
7194
d8e2b5ba
JB
71952011-04-02 Juanma Barranquero <lekktu@gmail.com>
7196
7197 * eval.c (unwind_to_catch) [DEBUG_GCPRO]: Remove redundant assignment.
7198
8c74fcbd
JD
71992011-04-02 Jan Djärv <jan.h.d@swipnet.se>
7200
7201 * nsterm.m (ns_update_auto_hide_menu_bar): Only for OSX 10.6 or
7202 later (Bug#8403).
7203
7200d79c
SM
72042011-04-01 Stefan Monnier <monnier@iro.umontreal.ca>
7205
03408648 7206 Add lexical binding.
7200d79c 7207
03408648
SM
7208 * window.c (Ftemp_output_buffer_show): New fun.
7209 (Fsave_window_excursion):
7210 * print.c (Fwith_output_to_temp_buffer): Move to subr.el.
7211
7212 * lread.c (lisp_file_lexically_bound_p): New function.
7213 (Fload): Bind Qlexical_binding.
7214 (readevalloop): Remove `evalfun' arg.
7215 Bind Qinternal_interpreter_environment.
7216 (Feval_buffer): Bind Qlexical_binding.
7217 (defvar_int, defvar_bool, defvar_lisp_nopro, defvar_kboard):
7218 Mark as dynamic.
7219 (syms_of_lread): Declare `lexical-binding'.
7220
7221 * lisp.h (struct Lisp_Symbol): New field `declared_special'.
7222
7223 * keyboard.c (eval_dyn): New fun.
7224 (menu_item_eval_property): Use it.
ca105506
SM
7225
7226 * image.c (parse_image_spec): Use Ffunctionp.
ca105506 7227
03408648
SM
7228 * fns.c (concat, mapcar1): Accept byte-code-functions.
7229
7230 * eval.c (Fsetq): Handle lexical vars.
7231 (Fdefun, Fdefmacro, Ffunction): Make closures when needed.
7232 (Fdefconst, Fdefvaralias, Fdefvar): Mark as dynamic.
7233 (FletX, Flet): Obey lexical binding.
7234 (Fcommandp): Handle closures.
7235 (Feval): New `lexical' arg.
7236 (eval_sub): New function extracted from Feval. Use it almost
7237 everywhere where Feval was used. Look up vars in lexical env.
7238 Handle closures.
7239 (Ffunctionp): Move from subr.el.
7240 (Ffuncall): Handle closures.
7241 (apply_lambda): Remove `eval_flags'.
7242 (funcall_lambda): Handle closures and new byte-code-functions.
7243 (Fspecial_variable_p): New function.
7244 (syms_of_eval): Initialize the Vinternal_interpreter_environment var,
7245 but without exporting it to Lisp.
23aba0ea 7246
23aba0ea 7247 * doc.c (Fdocumentation, store_function_docstring):
03408648 7248 * data.c (Finteractive_form): Handle closures.
23aba0ea 7249
03408648
SM
7250 * callint.c (Fcall_interactively): Preserve lexical-binding mode for
7251 interactive spec.
ba83908c 7252
04f2d78b
CB
7253 * bytecode.c (Bstack_ref, Bstack_set, Bstack_set2, BdiscardN):
7254 New byte-codes.
03408648
SM
7255 (exec_byte_code): New function extracted from Fbyte_code to handle new
7256 calling convention for byte-code-functions. Add new byte-codes.
ba83908c 7257
03408648 7258 * buffer.c (defvar_per_buffer): Set new `declared_special' field.
e2abe5a1 7259
03408648 7260 * alloc.c (Fmake_symbol): Init new `declared_special' field.
e2abe5a1 7261
e2abce01
JB
72622011-03-31 Juanma Barranquero <lekktu@gmail.com>
7263
7264 * xdisp.c (redisplay_internal): Fix prototype.
7265
63696a73 72662011-03-31 Eli Zaretskii <eliz@gnu.org>
09725d26 7267
63696a73 7268 * xdisp.c (SCROLL_LIMIT): New macro.
04f2d78b
CB
7269 (try_scrolling): Use it when setting scroll_limit.
7270 Limit scrolling to 100 screen lines.
63696a73
EZ
7271 (redisplay_window): Even when falling back on "recentering",
7272 position point in the window according to scroll-conservatively,
7273 scroll-margin, and scroll-*-aggressively variables. (Bug#6671)
7274
7275 (try_scrolling): When point is above the window, allow searching
7276 as far as scroll_max, or one screenful, to compute vertical
7277 distance from PT to the scroll margin position. This prevents
7278 try_scrolling from unnecessarily failing when
7279 scroll-conservatively is set to a value slightly larger than the
7280 window height. Clean up the case of PT below the margin at bottom
7281 of window: scroll_max can no longer be INT_MAX. When aggressive
7282 scrolling is in use, don't let point enter the opposite scroll
7283 margin as result of the scroll.
7284 (syms_of_xdisp) <scroll-conservatively>: Document the
09725d26
EZ
7285 threshold of 100 lines for never-recentering scrolling.
7286
e4cc2dfc
JB
72872011-03-31 Juanma Barranquero <lekktu@gmail.com>
7288
7289 * dispextern.h (move_it_by_lines):
7290 * xdisp.c (move_it_by_lines): Remove parameter `need_y_p', unused
7291 since 2000-12-29T14:24:09Z!gerd@gnu.org. All callers changed.
7292 (message_log_check_duplicate): Remove parameters `prev_bol' and
7293 `this_bol', unused since 1998-01-01T02:27:27Z!rms@gnu.org. All callers changed.
7294 (redisplay_internal): Remove parameter `preserve_echo_area',
7295 unused since 1999-07-21T21:43:52Z!gerd@gnu.org. All callers changed.
7296
7297 * indent.c (Fvertical_motion):
7298 * window.c (window_scroll_pixel_based, Frecenter):
7299 Don't pass `need_y_p' to `move_it_by_lines'.
7300
1c470562
SM
73012011-03-30 Stefan Monnier <monnier@iro.umontreal.ca>
7302
44f230aa
SM
7303 * eval.c (struct backtrace): Don't cheat with negative numbers, but do
7304 steal a few bits to be more compact.
7305 (interactive_p, Fbacktrace, Fbacktrace_frame, mark_backtrace):
7306 Remove unneeded casts.
7307
1c470562
SM
7308 * bytecode.c (Fbyte_code): CAR and CDR can GC.
7309
888adce9
ZK
73102011-03-30 Zachary Kanfer <zkanfer@gmail.com> (tiny change)
7311
7312 * keyboard.c (Fexecute_extended_command): Do log the "suggest key
7313 binding" message (bug#7967).
7314
f838ed7b
PE
73152011-03-30 Paul Eggert <eggert@cs.ucla.edu>
7316
77861b95
PE
7317 Fix more problems found by GCC 4.6.0's static checks.
7318
de6dbc14
PE
7319 * unexelf.c (unexec) [! (defined _SYSTYPE_SYSV || defined __sgi)]:
7320 Remove unused local var.
7321
f838ed7b
PE
7322 * editfns.c (Fmessage_box): Remove unused local var.
7323
792c7b2b
PE
7324 * xdisp.c (try_window_reusing_current_matrix, x_produce_glyphs):
7325 (note_mode_line_or_margin_highlight, note_mouse_highlight):
7326 Omit unused local vars.
c499e557 7327 * window.c (shrink_windows): Omit unused local var.
b01a1c29 7328 * menu.c (digest_single_submenu): Omit unused local var.
0bc32927
PE
7329 * dispnew.c (update_window) [PERIODIC_PREEMPTION_CHECKING]:
7330 Omit unused local var.
7331
ba0165e1
PE
7332 * keyboard.c (parse_modifiers_uncached, parse_modifiers):
7333 Don't assume string length fits in int.
32ad8845 7334 (keyremap_step, read_key_sequence): Use size_t for sizes.
48011560 7335 (read_key_sequence): Don't check last_real_key_start redundantly.
ba0165e1 7336
3c59b4c9
PE
7337 * callproc.c (Fcall_process, Fcall_process_region): Use SAFE_ALLOCA
7338 instead of alloca (Bug#8344).
7339
a3eed478 7340 * eval.c (Fbacktrace): Don't assume nargs fits in int.
5d5d959d 7341 (Fbacktrace_frame): Don't assume nframes fits in int.
a3eed478 7342
eb4d412d
PE
7343 * syntax.c (scan_sexps_forward): Avoid pointer wraparound.
7344
1658b401
PE
7345 * xterm.c (x_make_frame_visible, same_x_server): Redo to avoid overflow
7346 concerns.
7347
7348 * term.c (produce_glyphless_glyph): Remove unnecessary test.
7349
7350 * cm.c (calccost): Turn while-do into do-while, for clarity.
44f730c8 7351
9a2c6e05
PE
7352 * keyboard.c (syms_of_keyboard): Use the same style as later
7353 in this function when indexing through an array. This also
7354 works around GCC bug 48267.
7355
03d0a109
PE
7356 * image.c (tiff_load): Fix off-by-one image count (Bug#8336).
7357
44f730c8
PE
7358 * xselect.c (x_check_property_data): Return correct size (Bug#8335).
7359
fe75f926
PE
7360 * chartab.c (sub_char_table_ref_and_range): Redo for slight
7361 efficiency gain, and to bypass a gcc -Wstrict-overflow warning.
7362
ffa8c828
PE
7363 * keyboard.c, keyboard.h (num_input_events): Now size_t.
7364 This avoids undefined behavior on integer overflow, and is a bit
7365 more convenient anyway since it is compared to a size_t variable.
7366
c5101a77
PE
7367 Variadic C functions now count arguments with size_t, not int.
7368 This avoids an unnecessary limitation on 64-bit machines, which
7369 caused (substring ...) to crash on large vectors (Bug#8344).
7370 * lisp.h (struct Lisp_Subr.function.aMANY): Now takes size_t, not int.
7371 (DEFUN_ARGS_MANY, internal_condition_case_n, safe_call): Likewise.
77861b95 7372 All variadic functions and their callers changed accordingly.
c5101a77
PE
7373 (struct gcpro.nvars): Now size_t, not int. All uses changed.
7374 * data.c (arith_driver, float_arith_driver): Likewise.
7375 * editfns.c (general_insert_function): Likewise.
7376 * eval.c (struct backtrace.nargs, interactive_p)
7377 (internal_condition_case_n, run_hook_with_args, apply_lambda)
7378 (funcall_lambda, mark_backtrace): Likewise.
7379 * fns.c (concat): Likewise.
7380 * frame.c (x_set_frame_parameters): Likewise.
7381 * fns.c (get_key_arg): Now accepts and returns size_t, and returns
7382 0 if not found, not -1. All callers changed.
7383
dd3f25f7
PE
7384 * alloc.c (garbage_collect): Don't assume stack size fits in int.
7385 (stack_copy_size): Now size_t, not int.
7386 (stack_copy, stack_copy_size): Define only if MAX_SAVE_STACK > 0.
7387
461c2ab9
JB
73882011-03-28 Juanma Barranquero <lekktu@gmail.com>
7389
7390 * coding.c (encode_designation_at_bol): Remove parameter `charbuf_end',
7391 unused since 2002-03-01T01:17:24Z!handa@m17n.org and 2008-02-01T16:01:31Z!miles@gnu.org.
7392 All callers changed.
7393
7394 * lisp.h (multibyte_char_to_unibyte):
7395 * character.c (multibyte_char_to_unibyte): Remove parameter `rev_tbl',
7396 unused since 2002-03-01T01:16:34Z!handa@m17n.org and 2008-02-01T16:01:31Z!miles@gnu.org.
7397 * character.h (CHAR_TO_BYTE8):
7398 * cmds.c (internal_self_insert):
7399 * editfns.c (general_insert_function):
7400 * keymap.c (push_key_description):
7401 * search.c (Freplace_match):
7402 * xdisp.c (message_dolog, set_message_1): All callers changed.
7403
f6d62986
SM
74042011-03-28 Stefan Monnier <monnier@iro.umontreal.ca>
7405
7406 * keyboard.c (safe_run_hook_funcall): New function.
7407 (safe_run_hooks_1, safe_run_hooks_error, safe_run_hooks): On error,
7408 don't set the hook to nil, but remove the offending function instead.
7409 (Qcommand_hook_internal): Remove, unused.
7410 (syms_of_keyboard): Don't initialize Qcommand_hook_internal nor define
7411 Vcommand_hook_internal.
7412
7413 * eval.c (enum run_hooks_condition): Remove.
7414 (funcall_nil, funcall_not): New functions.
7415 (run_hook_with_args): Call each function through a `funcall' argument.
7416 Remove `cond' argument, now redundant.
7417 (Frun_hooks, Frun_hook_with_args, Frun_hook_with_args_until_success)
7418 (Frun_hook_with_args_until_failure): Adjust accordingly.
7419 (run_hook_wrapped_funcall, Frun_hook_wrapped): New functions.
7420
1db5b1ad
JB
74212011-03-28 Juanma Barranquero <lekktu@gmail.com>
7422
7423 * dispextern.h (string_buffer_position): Remove declaration.
7424
7425 * print.c (strout): Remove parameter `multibyte', unused since
7426 1999-08-21T19:30:21Z!gerd@gnu.org. All callers changed.
7427
7428 * search.c (boyer_moore): Remove parameters `len', `pos' and `lim',
7429 never used since function introduction in 1998-02-08T21:33:56Z!rms@gnu.org.
7430 All callers changed.
7431
7432 * w32.c (_wsa_errlist): Use braces for struct initializers.
7433
7434 * xdisp.c (string_buffer_position_lim): Remove parameter `w',
7435 never used since function introduction in 2001-03-09T18:41:50Z!gerd@gnu.org.
7436 All callers changed.
7437 (string_buffer_position): Likewise. Also, make static (it's never
7438 used outside xdisp.c).
7439 (cursor_row_p): Remove parameter `w', unused since
7440 2000-10-17T16:08:57Z!gerd@gnu.org. All callers changed.
7441 (decode_mode_spec): Remove parameter `precision', introduced during
7442 Gerd Moellmann's rewrite at 1999-07-21T21:43:52Z!gerd@gnu.org, but never used.
7443 All callers changed.
7444
5ffb62aa
JD
74452011-03-27 Jan Djärv <jan.h.d@swipnet.se>
7446
7447 * nsterm.m (syms_of_nsterm): Use doc: for ns-auto-hide-menu-bar.
7448
461c2ab9 74492011-03-27 Anders Lindgren <andlind@gmail.com>
f0a1382a
JD
7450
7451 * nsterm.m (ns_menu_bar_is_hidden): New variable.
7452 (ns_constrain_all_frames, ns_menu_bar_should_be_hidden)
7453 (ns_update_auto_hide_menu_bar): New functions.
7454 (ns_update_begin): Call ns_update_auto_hide_menu_bar.
7455 (applicationDidBecomeActive): Call ns_update_auto_hide_menu_bar and
7456 ns_constrain_all_frames.
7457 (constrainFrameRect): Return at once if ns_menu_bar_should_be_hidden.
7458 (syms_of_nsterm): DEFVAR ns-auto-hide-menu-bar, init to Qnil.
7459
5c380ffb
JD
74602011-03-27 Jan Djärv <jan.h.d@swipnet.se>
7461
7462 * nsmenu.m (runDialogAt): Remove argument to timer_check.
7463
9af30bdf
GM
74642011-03-27 Glenn Morris <rgm@gnu.org>
7465
7466 * syssignal.h: Replace RETSIGTYPE with void.
7467 * atimer.c, data.c, dispnew.c, emacs.c, floatfns.c, keyboard.c:
7468 * keyboard.h, lisp.h, process.c, sysdep.c, xterm.c:
7469 Replace SIGTYPE with void everywhere.
7470 * s/usg5-4-common.h (SIGTYPE): Remove definition.
7471 * s/template.h (SIGTYPE): Remove commented out definition.
7472
e2abce01
JB
74732011-03-26 Eli Zaretskii <eliz@gnu.org>
7474
7475 * xdisp.c (redisplay_window): Don't check buffer's clip_changed
7476 flag as a prerequisite for invoking try_scrolling. (Bug#6671)
7477
f868cd8a
JB
74782011-03-26 Juanma Barranquero <lekktu@gmail.com>
7479
59eb0929
JB
7480 * w32.c (read_unc_volume): Use parameter `henum', instead of
7481 global variable `wget_enum_handle'.
7482
7483 * keymap.c (describe_vector): Remove parameters `indices' and
7484 `char_table_depth', unused since 2002-03-01T01:43:26Z!handa@m17n.org.
7485 (describe_map, Fdescribe_vector): Adjust calls to `describe_vector'.
7486
f868cd8a
JB
7487 * keyboard.h (timer_check, show_help_echo): Remove unused parameters.
7488
7489 * keyboard.c (timer_check): Remove parameter `do_it_now',
7490 unused since 1996-04-12T06:01:29Z!rms@gnu.org.
7491 (show_help_echo): Remove parameter `ok_to_overwrite_keystroke_echo',
7492 unused since 2008-04-19T19:30:53Z!monnier@iro.umontreal.ca.
7493
7494 * keyboard.c (read_char):
7495 * w32menu.c (w32_menu_display_help):
7496 * xmenu.c (show_help_event, menu_help_callback):
7497 Adjust calls to `show_help_echo'.
7498
7499 * gtkutil.c (xg_maybe_add_timer):
7500 * keyboard.c (readable_events):
7501 * process.c (wait_reading_process_output):
7502 * xmenu.c (x_menu_wait_for_event): Adjust calls to `timer_check'.
7503
7504 * insdel.c (adjust_markers_gap_motion):
7505 Remove; no-op since 1998-01-02T21:29:48Z!rms@gnu.org.
7506 (gap_left, gap_right): Don't call it.
7507
2ecf6fdb
CY
75082011-03-25 Chong Yidong <cyd@stupidchicken.com>
7509
7510 * xdisp.c (handle_fontified_prop): Discard changes to clip_changed
7511 incurred during fontification.
7512
6b1f9ba4
JB
75132011-03-25 Juanma Barranquero <lekktu@gmail.com>
7514
7515 * buffer.c (defvar_per_buffer): Remove unused parameter `doc'.
7516 (DEFVAR_PER_BUFFER): Don't pass it.
7517
7518 * dispnew.c (row_equal_p, add_row_entry): Remove unused parameter `w'.
7519 (scrolling_window): Don't pass it.
7520
0f4a96b5
JB
75212011-03-25 Juanma Barranquero <lekktu@gmail.com>
7522
7523 * dispextern.h (glyph_matric): Use #if GLYPH_DEBUG, not #ifdef.
7524
7525 * fileio.c (check_executable) [DOS_NT]: Remove unused variables `len'
7526 and `suffix'.
7527 (Fset_file_selinux_context) [HAVE_LIBSELINUX]: Move here declaration
7528 of variables specific to SELinux and computation of `encoded_absname'.
7529
7530 * image.c (XPutPixel): Remove unused variable `height'.
7531
7532 * keyboard.c (make_lispy_event): Remove unused variable `hpos'.
7533
7534 * unexw32.c (get_section_info): Remove unused variable `section'.
7535
7536 * w32.c (stat): Remove unused variables `drive_root' and `devtype'.
7537 (system_process_attributes): Remove unused variable `sess'.
7538 (sys_read): Remove unused variable `err'.
7539
7540 * w32fns.c (top): Wrap variables with #if GLYPH_DEBUG, not #ifdef.
7541 (w32_wnd_proc): Remove unused variable `isdead'.
7542 (unwind_create_frame): Use #if GLYPH_DEBUG, not #ifdef.
7543 (Fx_server_max_request_size): Remove unused variable `dpyinfo'.
7544 (x_create_tip_frame): Remove unused variable `tem'.
7545
7546 * w32inevt.c (w32_console_read_socket):
7547 Remove unused variable `no_events'.
7548
7549 * w32term.c (x_draw_composite_glyph_string_foreground):
7550 Remove unused variable `width'.
7551
1149507c
JB
75522011-03-24 Juanma Barranquero <lekktu@gmail.com>
7553
7554 * w32term.c (x_set_glyph_string_clipping):
7555 Don't pass uninitialized region to CombineRgn.
7556
9c88f339
JB
75572011-03-23 Juanma Barranquero <lekktu@gmail.com>
7558
7559 * w32fns.c (x_set_menu_bar_lines): Remove unused variable `olines'.
7560 (w32_wnd_proc): Pass NULL to Windows API, not uninitialized buffer.
7561 (Fx_close_connection): Remove unused variable `i'.
7562
7563 * w32font.c (w32font_draw): Return number of glyphs.
7564 (w32font_open_internal): Remove unused variable `i'.
7565 (w32font_driver): Add missing initializer.
7566
7567 * w32menu.c (utf8to16): Remove unused variable `utf16'.
7568 (fill_in_menu): Remove unused variable `items_added'.
7569
7570 * w32term.c (last_mouse_press_frame): Remove static global variable.
7571 (w32_clip_to_row): Remove unused variable `f'.
7572 (x_delete_terminal): Remove unused variable `i'.
7573
7574 * w32uniscribe.c (uniscribe_shape): Remove unused variable `nclusters'.
7575 (NOTHING): Remove unused static global variable.
7576 (uniscribe_check_otf): Remove unused variable `table'.
7577 (uniscribe_font_driver): Add missing initializers.
7578
dee091a3
JD
75792011-03-23 Julien Danjou <julien@danjou.info>
7580
7581 * term.c (Fsuspend_tty, Fresume_tty):
7582 * minibuf.c (read_minibuf, run_exit_minibuf_hook):
7583 * window.c (temp_output_buffer_show):
7584 * insdel.c (signal_before_change):
7585 * frame.c (Fhandle_switch_frame):
7586 * fileio.c (Fdo_auto_save):
7587 * emacs.c (Fkill_emacs):
7588 * editfns.c (save_excursion_restore):
7589 * cmds.c (internal_self_insert):
7590 * callint.c (Fcall_interactively):
7591 * buffer.c (Fkill_all_local_variables):
7592 * keyboard.c (Fcommand_execute, Fsuspend_emacs, safe_run_hooks_1):
7593 Use Frun_hooks.
0f4a96b5 7594 (command_loop_1): Use Frun_hooks. Call safe_run_hooks
dee091a3
JD
7595 unconditionnaly since it does the check itself.
7596
2c520ab5 75972011-03-23 Paul Eggert <eggert@cs.ucla.edu>
f0641eff 7598
c9c49752
PE
7599 Fix more problems found by GCC 4.5.2's static checks.
7600
8abc3f12
PE
7601 * coding.c (encode_coding_raw_text): Avoid unnecessary test
7602 the first time through the loop, since we know p0 < p1 then.
7603 This also avoids a gcc -Wstrict-overflow warning.
7604
a2d26660
PE
7605 * lisp.h (SAFE_ALLOCA, SAFE_ALLOCA_LISP): Avoid 'int' overflow
7606 leading to a memory leak, possible in functions like
7607 load_charset_map_from_file that can allocate an unbounded number
b12ef411 7608 of objects (Bug#8318).
a2d26660 7609
916c72e9
PE
7610 * xmenu.c (set_frame_menubar): Use EMACS_UINT, not int, for indexes
7611 that could (at least in theory) be that large.
7612
19ab8a18
PE
7613 * xdisp.c (message_log_check_duplicate): Return unsigned long, not int.
7614 This is less likely to overflow, and avoids undefined behavior if
7615 overflow does occur. All callers changed. Use strtoul to scan
7616 for the unsigned long integer.
b7cbbd6f
PE
7617 (pint2hrstr): Simplify and tune code slightly.
7618 This also avoids a (bogus) GCC warning with gcc -Wstrict-overflow.
19ab8a18 7619
f0641eff
PE
7620 * scroll.c (do_scrolling): Work around GCC bug 48228.
7621 See <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48228>.
7622
7f650bb9
PE
7623 * frame.c (Fmodify_frame_parameters): Simplify loop counter.
7624 This also avoids a warning with gcc -Wstrict-overflow.
39f5e519
PE
7625 (validate_x_resource_name): Simplify count usage.
7626 This also avoids a warning with gcc -Wstrict-overflow.
7f650bb9 7627
37dd57d1
PE
7628 * fileio.c (Fcopy_file): Report error if fchown or fchmod
7629 fail (Bug#8306).
81e56e61 7630
699979fc 7631 * emacs.c (Fdaemon_initialized): Do not ignore I/O errors (Bug#8303).
dc1ca6a8 7632
401bf9b4
PE
7633 * process.c (Fmake_network_process): Use socklen_t, not int,
7634 where POSIX says socklen_t is required in portable programs.
7635 This fixes a porting bug on hosts like 64-bit HP-UX, where
591b2973 7636 socklen_t is wider than int (Bug#8277).
401bf9b4
PE
7637 (Fmake_network_process, server_accept_connection):
7638 (wait_reading_process_output, read_process_output):
7639 Likewise.
7640
b93aacde
PE
7641 * process.c: Rename or move locals to avoid shadowing.
7642 (list_processes_1, Fmake_network_process):
7643 (read_process_output_error_handler, exec_sentinel_error_handler):
7644 Rename or move locals.
4dc343ee 7645 (Fmake_network_process): Define label "retry_connect" only if needed.
0da49335 7646 (Fnetwork_interface_info): Fix pointer signedness.
f990b4e5 7647 (process_send_signal): Add cast to avoid pointer signedness problem.
7b808126 7648 (FIRST_PROC_DESC, IF_NON_BLOCKING_CONNECT): Remove unused macros.
c939f91b 7649 (create_process): Use 'volatile' to avoid vfork clobbering (Bug#8298).
b93aacde 7650
af8a867c 7651 Make tparam.h and terminfo.c consistent.
44f230aa
SM
7652 * cm.c (tputs, tgoto, BC, UP): Remove extern decls.
7653 Include tparam.h instead, since it declares them.
af8a867c
PE
7654 * cm.h (PC): Remove extern decl; tparam.h now does this.
7655 * deps.mk (cm.o, terminfo.o): Depend on tparam.h.
7656 * terminfo.c: Include tparam.h, to check interfaces.
7657 (tparm): Make 1st arg a const pointer in decl. Put it at top level.
7658 (tparam): Adjust signature to match interface in tparam.h;
7659 this removes some undefined behavior. Check that outstring and len
7660 are zero, which they always are with Emacs.
7661 * tparam.h (PC, BC, UP): New extern decls.
7662
0248044d 7663 * xftfont.c (xftfont_shape): Now static, and defined only if needed.
001a7ab4 7664 (xftfont_open): Rename locals to avoid shadowing.
0248044d 7665
8ff096c1 7666 * ftfont.c (ftfont_resolve_generic_family): Fix pointer signedness.
a00924bb
PE
7667 (ftfont_otf_capability, ftfont_shape): Omit decls if not needed.
7668 (OTF_TAG_SYM): Omit macro if not needed.
e932860f 7669 (ftfont_list): Remove unused local.
49eaafba
PE
7670 (get_adstyle_property, ftfont_pattern_entity):
7671 (ftfont_lookup_cache, ftfont_open, ftfont_anchor_point):
7672 Rename locals to avoid shadowing.
8ff096c1 7673
e2be39f6
PE
7674 * xfont.c (xfont_list_family): Mark var as initialized.
7675
c9735e30
PE
7676 * xml.c (make_dom): Now static.
7677
8f5201ae
PE
7678 * composite.c (composition_compute_stop_pos): Rename local to
7679 avoid shadowing.
b246f932
PE
7680 (composition_reseat_it): Remove unused locals.
7681 (find_automatic_composition, composition_adjust_point): Likewise.
80e079b2 7682 (composition_update_it): Mark var as initialized.
11b61122
PE
7683 (find_automatic_composition): Mark vars as initialized,
7684 with a FIXME (Bug#8290).
8f5201ae 7685
760fbc2c
PE
7686 character.h: Rename locals to avoid shadowing.
7687 * character.h (PREV_CHAR_BOUNDARY, FETCH_STRING_CHAR_ADVANCE):
7688 (FETCH_STRING_CHAR_AS_MULTIBYTE_ADVANCE, FETCH_CHAR_ADVANCE):
7689 (FETCH_CHAR_ADVANCE_NO_CHECK, INC_POS, DEC_POS, BUF_INC_POS):
7690 (BUF_DEC_POS): Be more systematic about renaming local temporaries
7691 to avoid shadowing.
7692
ff08eb85
PE
7693 * textprop.c (property_change_between_p): Remove; unused.
7694
fc7bf025
PE
7695 * intervals.c (interval_start_pos): Now static.
7696
235d7abc
PE
7697 * intervals.h (CHECK_TOTAL_LENGTH): Avoid empty "else".
7698
44f230aa
SM
7699 * atimer.c (start_atimer, append_atimer_lists, set_alarm):
7700 Rename locals to avoid shadowing.
3e7d6594 7701
50060332
PE
7702 * sound.c (wav_play, au_play, Fplay_sound_internal):
7703 Fix pointer signedness.
d01f234b 7704 (alsa_choose_format): Remove unused local var.
c83b8872
PE
7705 (wav_play): Initialize a variable to 0, to prevent undefined
7706 behavior (Bug#8278).
50060332 7707
c4fc4e30
PE
7708 * region-cache.c (insert_cache_boundary): Redo var to avoid shadowing.
7709
918436ed
PE
7710 * region-cache.h (pp_cache): New decl, for gcc -Wmissing-prototypes.
7711
c939f91b
PE
7712 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork
7713 clobbering (Bug#8298).
b9c7f648
PE
7714 * sysdep.c (sys_subshell): Likewise.
7715 Previously, the sys_subshell 'volatile' was incorrectly IF_LINTted out.
7e9123a2 7716
6bd8c144
PE
7717 * lisp.h (child_setup): Now NO_RETURN unless DOS_NT.
7718 This should get cleaned up, so that child_setup has the
7719 same signature on all platforms.
7720
7710357c 7721 * callproc.c (call_process_cleanup): Now static.
cb1d0ef7 7722 (relocate_fd): Rename locals to avoid shadowing.
7710357c 7723
c59da222
CY
77242011-03-22 Chong Yidong <cyd@stupidchicken.com>
7725
7726 * xterm.c (x_clear_frame): Remove XClearWindow call. This appears
7727 not to be necessary, and produces flickering.
7728
66b87493
GM
77292011-03-20 Glenn Morris <rgm@gnu.org>
7730
7731 * config.in: Remove file.
7732
45b6f6d5
JB
77332011-03-20 Juanma Barranquero <lekktu@gmail.com>
7734
7735 * minibuf.c (Vcompleting_read_function): Don't declare, global variables
7736 are now in src/globals.h.
7737 (syms_of_minibuf): Remove spurious & from previous change.
7738
3ec03f7e
LL
77392011-03-20 Leo <sdl.web@gmail.com>
7740
7741 * minibuf.c (completing-read-function): New variable.
7742 (completing-read-default): Rename from completing-read.
7743 (completing-read): Call completing-read-function.
7744
b14e3e21
CY
77452011-03-19 Juanma Barranquero <lekktu@gmail.com>
7746
7747 * xfaces.c (Fx_load_color_file):
7748 Read color file from absolute filename (bug#8250).
7749
f2b726e6
JB
77502011-03-19 Juanma Barranquero <lekktu@gmail.com>
7751
7752 * makefile.w32-in: Update dependencies.
7753
09f6ff02
EZ
77542011-03-17 Eli Zaretskii <eliz@gnu.org>
7755
7756 * makefile.w32-in ($(BLD)/unexw32.$(O)): Depend on $(SRC)/unexec.h.
7757
29a6015a
PE
77582011-03-17 Paul Eggert <eggert@cs.ucla.edu>
7759
a3a6c54e
PE
7760 Fix more problems found by GCC 4.5.2's static checks.
7761
b766f867
PE
7762 * process.c (make_serial_process_unwind, send_process_trap):
7763 (sigchld_handler): Now static.
7764
be02381c
PE
7765 * process.c (allocate_pty): Let PTY_ITERATION declare iteration vars.
7766 That way, the code declares only the vars that it needs.
7767 * s/aix4-2.h (PTY_ITERATION): Declare iteration vars.
7768 * s/cygwin.h (PTY_ITERATION): Likewise.
7769 * s/darwin.h (PTY_ITERATION): Likewise.
7770 * s/gnu-linux.h (PTY_ITERATION): Likewise.
7771
57048744
PE
7772 * s/irix6-5.h (PTY_OPEN): Declare stb, to loosen coupling.
7773 * process.c (allocate_pty): Don't declare stb unless it's needed.
7774
7914961c 7775 * bytecode.c (MAYBE_GC): Rewrite so as not to use empty "else".
615f2d59
PE
7776 (CONSTANTLIM): Remove; unused.
7777 (METER_CODE, Bscan_buffer, Bread_char, Bset_mark):
7778 Define only if needed.
7914961c 7779
b3967b18
PE
7780 * unexelf.c (unexec): Name an expression,
7781 to avoid gcc -Wbad-function-cast warning.
9ae71512
PE
7782 Use a different way to cause a compilation error if anyone uses
7783 n rather than nn, a way that does not involve shadowing.
73366a00 7784 (ELF_BSS_SECTION_NAME, OLD_PROGRAM_H): Remove; unused.
b3967b18 7785
29a6015a
PE
7786 * deps.mk (unexalpha.o): Remove; unused.
7787
43cfc33e 7788 New file unexec.h, the (simple) interface for unexec (Bug#8267).
7feda0d2 7789 * unexec.h: New file.
ce701a33
PE
7790 * deps.mk (emacs.o, unexaix.o, unexcw.o, unexcoff.o, unexelf.o):
7791 (unexhp9k800.o, unexmacosx.o, unexsol.o, unexw32.o):
7792 Depend on unexec.h.
7793 * emacs.c [!defined CANNOT_DUMP]: Include unexec.h.
7794 * unexaix.c, unexcoff.c, unexcw.c, unexelf.c, unexhp9k800.c:
7795 * unexmacosx.c, unexsol.c, unexw32.c: Include unexec.h.
381259ef 7796 Change as necessary to match prototype in unexec.h.
ce701a33 7797
01f44d5a
PE
7798 * syntax.c (Fforward_comment, scan_lists): Rename locals to avoid
7799 shadowing.
4f63c6bb 7800 (back_comment, skip_chars): Mark vars as initialized.
01f44d5a 7801
a6670b0b
PE
7802 * character.h (FETCH_STRING_CHAR_ADVANCE_NO_CHECK, BUF_INC_POS):
7803 Rename locals to avoid shadowing.
7804
cef2010d 7805 * lread.c (read1): Rewrite so as not to use empty "else".
0902fe45 7806 (Fload, readevalloop, read1): Rename locals to avoid shadowing.
cef2010d 7807
d4d7173a
PE
7808 * print.c (Fredirect_debugging_output): Fix pointer signedess.
7809
f08b802a
PE
7810 * lisp.h (debug_output_compilation_hack): Add decl here, to avoid
7811 warning when compiling print.c.
7812
3ddb0639
PE
7813 * font.c (font_unparse_fcname): Abort in an "impossible" situation
7814 instead of using an uninitialized var.
5ad03b97 7815 (font_sort_entities): Mark var as initialized.
3ddb0639 7816
170a2692
PE
7817 * character.h (FETCH_CHAR_ADVANCE): Rename locals to avoid shadowing.
7818
e663c700
PE
7819 * font.c (font_unparse_xlfd): Don't mix pointers to variables with
7820 pointers to constants.
89bc529a 7821 (font_parse_fcname): Remove unused vars.
7b81e2d0 7822 (font_delete_unmatched): Now static.
ea838e10 7823 (font_get_spec): Remove; unused.
13a547c6
PE
7824 (font_style_to_value, font_prop_validate_style, font_unparse_fcname):
7825 (font_update_drivers, Ffont_get_glyphs, font_add_log):
7826 Rename or move locals to avoid shadowing.
e663c700 7827
2a80c887 7828 * fns.c (require_nesting_list, require_unwind): Now static.
612f56df 7829 (Ffillarray): Rename locals to avoid shadowing.
2a80c887 7830
1384fa33 7831 * floatfns.c (domain_error2): Define only if needed.
a885e2ed 7832 (Ffrexp, Fldexp): Rename locals to avoid shadowing.
1384fa33 7833
8b2c52e9
PE
7834 * alloc.c (mark_backtrace): Move decl from here ...
7835 * lisp.h: ... to here, so that it can be checked.
7836
475545b5 7837 * eval.c (call_debugger, do_debug_on_call, grow_specpdl): Now static.
d28a2170 7838 (Fdefvar): Rewrite so as not to use empty "else".
cfcbfb1a
PE
7839 (lisp_indirect_variable): Name an expression,
7840 to avoid gcc -Wbad-function-cast warning.
1faed8ae 7841 (Fdefvar): Rename locals to avoid shadowing.
475545b5 7842
b1349114 7843 * callint.c (quotify_arg, quotify_args): Now static.
a3e8cbda 7844 (Fcall_interactively): Rename locals to avoid shadowing.
b0e80955 7845 Use const pointer when appropriate.
b1349114 7846
a2928364
PE
7847 * lisp.h (get_system_name, get_operating_system_release):
7848 Move decls here, to check interfaces.
7849 * process.c (get_operating_system_release): Move decl to lisp.h.
7850 * xrdb.c (get_system_name): Likewise.
63c5d10b
PE
7851 * editfns.c (init_editfns, Fuser_login_name, Fuser_uid):
7852 (Fuser_real_uid, Fuser_full_name): Remove unnecessary casts,
7853 some of which prompt warnings from gcc -Wbad-function-cast.
545b49b4
PE
7854 (Fformat_time_string, Fencode_time, Finsert_char):
7855 (Ftranslate_region_internal, Fformat):
7856 Rename or remove local vars to avoid shadowing.
9710023e 7857 (Ftranslate_region_internal): Mark var as initialized.
63c5d10b 7858
a415e694
PE
7859 * doc.c (Fdocumentation, Fsnarf_documentation): Move locals to
7860 avoid shadowing.
7861
8ef4622d
PE
7862 * lisp.h (eassert): Check that the argument compiles, even if
7863 ENABLE_CHECKING is not defined.
7864
946f9a5b
PE
7865 * data.c (Findirect_variable): Name an expression, to avoid
7866 gcc -Wbad-function-cast warning.
112396d6 7867 (default_value, arithcompare, arith_driver, arith_error): Now static.
b9b84fa9 7868 (store_symval_forwarding): Rename local to avoid shadowing.
44f230aa
SM
7869 (Fmake_variable_buffer_local, Fmake_local_variable):
7870 Mark variables as initialized.
52746918 7871 (do_blv_forwarding, do_symval_forwarding): Remove; unused.
946f9a5b 7872
e5aab7e7 7873 * alloc.c (check_cons_list): Do not define unless GC_CHECK_CONS_LIST.
ae35e756
PE
7874 (Fmake_vector, Fvector, Fmake_byte_code, Fgarbage_collect):
7875 Rename locals to avoid shadowing.
dff45157
PE
7876 (mark_stack): Move local variables into the #ifdef region where
7877 they're used.
7bc26fdb
PE
7878 (BLOCK_INPUT_ALLOC, UNBLOCK_INPUT_ALLOC): Define only if
7879 ! defined SYSTEM_MALLOC && ! defined SYNC_INPUT, as they are not
7880 needed otherwise.
7881 (CHECK_ALLOCATED): Define only if GC_CHECK_MARKED_OBJECTS.
7882 (GC_STRING_CHARS): Remove; not used.
d40d4be1 7883 (Fmemory_limit): Cast sbrk's returned value to char *.
ae35e756 7884
e5aab7e7
PE
7885 * lisp.h (check_cons_list): Declare if GC_CHECK_CONS_LIST; this
7886 avoids undefined behavior in theory.
7887
4da60324
PE
7888 * regex.c (IF_LINT): Add defn, for benefit of ../lib-src.
7889
88043301
PE
7890 Use functions, not macros, for up- and down-casing (Bug#8254).
7891 * buffer.h (DOWNCASE_TABLE, UPCASE_TABLE, DOWNCASE, UPPERCASEP):
7892 (NOCASEP, LOWERCASEP, UPCASE, UPCASE1): Remove. All callers changed
7893 to use the following functions instead of these macros.
7894 (downcase): Adjust to lack of DOWNCASE_TABLE. Return int, not
7895 EMACS_INT, since callers assume the returned value fits in int.
7896 (upcase1): Likewise, for UPCASE_TABLE.
7897 (uppercasep, lowercasep, upcase): New static inline functions.
0da09c43 7898 * editfns.c (Fchar_equal): Remove no-longer-needed workaround for
db69b0cd 7899 the race-condition problem in the old DOWNCASE.
88043301 7900
19ed5445
PE
7901 * regex.c (CHARSET_LOOKUP_RANGE_TABLE_RAW, POP_FAILURE_REG_OR_COUNT):
7902 Rename locals to avoid shadowing.
7903 (regex_compile, re_match_2_internal): Move locals to avoid shadowing.
abbd1bcf
PE
7904 (regex_compile, re_search_2, re_match_2_internal):
7905 Remove unused local vars.
952db0d7
PE
7906 (FREE_VAR): Rewrite so as not to use empty "else",
7907 which gcc can warn about.
da053e48 7908 (regex_compile, re_match_2_internal): Mark locals as initialized.
b313f9d8
PE
7909 (RETALLOC_IF): Define only if needed.
7910 (WORDCHAR_P): Likewise. This one is never needed, but is used
7911 only in a comment talking about a compiler bug, so put inside
7912 the #if 0 of that comment.
7913 (CHARSET_LOOKUP_BITMAP, FAIL_STACK_FULL, RESET_FAIL_STACK):
7914 (PUSH_FAILURE_ELT, BUF_PUSH_3, STOP_ADDR_VSTRING):
7915 Remove; unused.
19ed5445 7916
1f3561e4 7917 * search.c (boyer_moore): Rename locals to avoid shadowing.
76ef09b7
PE
7918 * character.h (FETCH_STRING_CHAR_AS_MULTIBYTE_ADVANCE):
7919 (PREV_CHAR_BOUNDARY): Likewise.
1f3561e4 7920
ded6f8f7
PE
7921 * search.c (simple_search): Remove unused var.
7922
dbd37a95
PE
7923 * dired.c (compile_pattern): Move decl from here ...
7924 * lisp.h: ... to here, so that it can be checked.
7925 (struct re_registers): New forward decl.
7926
7e47afad
PE
7927 * character.h (INC_POS, DEC_POS): Rename locals to avoid shadowing.
7928
85f24f61
PE
7929 * indent.c (MULTIBYTE_BYTES_WIDTH): New args bytes, width.
7930 All uses changed.
7931 (MULTIBYTE_BYTES_WIDTH, scan_for_column, compute_motion):
7932 Rename locals to avoid shadowing.
5671df8f 7933 (Fvertical_motion): Mark locals as initialized.
85f24f61 7934
181aa2be 7935 * casefiddle.c (casify_object, casify_region): Now static.
e45a141a 7936 (casify_region): Mark local as initialized.
181aa2be 7937
930d429c
PE
7938 * cmds.c (internal_self_insert): Rename local to avoid shadowing.
7939
7082eac6
PE
7940 * lisp.h (GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR, GCPRO5_VAR, GCPRO6_VAR):
7941 New macros, so that the caller can use some names other than
7942 gcpro1, gcpro2, etc.
7943 (GCPRO2, GCPRO3, GCPRO4, GCPRO5, GCPRO6): Reimplement in terms
7944 of the new macros.
7945 (GCPRO1_VAR, UNGCPRO_VAR): Change the meaning of the second
7946 argument, for consistency with GCPRO2_VAR, etc: it is now the
7947 prefix of the variable, not the variable itself. All uses
7948 changed.
38b2c076
PE
7949 * dired.c (directory_files_internal, file_name_completion):
7950 Rename locals to avoid shadowing.
7951
15206ed9
PE
7952 Fix a race condition diagnosed by gcc -Wsequence-point (Bug#8254).
7953 An expression of the form (DOWNCASE (x) == DOWNCASE (y)), found in
7954 dired.c's scmp function, had undefined behavior.
7955 * lisp.h (DOWNCASE_TABLE, UPCASE_TABLE, DOWNCASE, UPPERCASEP):
7956 (NOCASEP, LOWERCASEP, UPCASE, UPCASE1): Move from here ...
7957 * buffer.h: ... to here, because these macros use current_buffer,
7958 and the new implementation with inline functions needs to have
7959 current_buffer in scope now, rather than later when the macros
7960 are used.
7961 (downcase, upcase1): New static inline functions.
7962 (DOWNCASE, UPCASE1): Reimplement using these functions.
7963 This avoids undefined behavior in expressions like
7964 DOWNCASE (x) == DOWNCASE (y), which previously suffered
7965 from race conditions in accessing the global variables
7966 case_temp1 and case_temp2.
7967 * casetab.c (case_temp1, case_temp2): Remove; no longer needed.
7968 * lisp.h (case_temp1, case_temp2): Remove their decls.
7969 * character.h (ASCII_CHAR_P): Move from here ...
7970 * lisp.h: ... to here, so that the inline functions mentioned
7971 above can use them.
7972
4a6bea26
PE
7973 * dired.c (directory_files_internal_unwind): Now static.
7974
f14b7e14
PE
7975 * fileio.c (file_name_as_directory, directory_file_name):
7976 (barf_or_query_if_file_exists, auto_save_error, auto_save_1):
7977 Now static.
2893f146
PE
7978 (file_name_as_directory): Use const pointers when appropriate.
7979 (Fexpand_file_name): Likewise. In particular, newdir might
7980 point at constant storage, so make it a const pointer.
fd4ead52 7981 (Fmake_directory_internal, Fread_file_name): Remove unused vars.
b14aac08
PE
7982 (Ffile_selinux_context, Fset_file_selinux_context): Fix pointer
7983 signedness issues.
f839df0c
PE
7984 (Fset_file_times, Finsert_file_contents, auto_save_error):
7985 Rename locals to avoid shadowing.
f14b7e14 7986
5716756e 7987 * minibuf.c (choose_minibuf_frame_1): Now static.
62137a95
PE
7988 (Ftry_completion, Fall_completions): Rename or remove locals
7989 to avoid shadowing.
5716756e 7990
b4c3046a
PE
7991 * marker.c (bytepos_to_charpos): Remove; unused.
7992
b45db522
PE
7993 * lisp.h (verify_bytepos, count_markers): New decls,
7994 so that gcc does not warn that these functions aren't declared.
7995
85876d07
PE
7996 * insdel.c (check_markers, make_gap_larger, make_gap_smaller):
7997 (reset_var_on_error, Fcombine_after_change_execute_1): Now static.
f0cb4a60 7998 (CHECK_MARKERS): Redo to avoid gcc -Wempty-body diagnostic.
40ef059e 7999 (copy_text): Remove unused local var.
85876d07 8000
03d78a21 8001 * filelock.c (within_one_second): Now static.
b3dd38ab 8002 (lock_file_1): Rename local to avoid shadowing.
03d78a21 8003
5df8f01b
PE
8004 * buffer.c (fix_overlays_before): Mark locals as initialized.
8005 (fix_start_end_in_overlays): Likewise. This function should be
8006 simplified by using pointers-to-pointers, but that's a different
8007 matter.
b1d876f1 8008 (switch_to_buffer_1): Now static.
8f54f30a
PE
8009 (Fkill_buffer, record_buffer, Fbury_buffer, Fset_buffer_multibyte):
8010 (report_overlay_modification): Rename locals to avoid shadowing.
c3bd59b5 8011
a70072c9 8012 * sysdep.c (system_process_attributes): Rename vars to avoid shadowing.
fbd02d7b 8013 Fix pointer signedness issue.
edced198
PE
8014 (sys_subshell): Mark local as volatile if checking for lint,
8015 to suppress a gcc -Wclobbered warning that does not seem to be right.
15dfd3d9 8016 (MAXPATHLEN): Define only if needed.
a70072c9 8017
a0977c44
PE
8018 * process.c (serial_open, serial_configure): Move decls from here ...
8019 * systty.h: ... to here, so that they can be checked.
8020
a884fdcc
PE
8021 * fns.c (get_random, seed_random): Move extern decls from here ...
8022 * lisp.h: ... to here, so that they can be checked.
8023
604efe86 8024 * sysdep.c (reset_io): Now static.
b8950c94 8025 (wait_for_termination_signal): Remove; unused.
604efe86 8026
38fc62d9
PE
8027 * keymap.c (keymap_parent, keymap_memberp, map_keymap_internal):
8028 (copy_keymap_item, append_key, push_text_char_description):
8029 Now static.
1004a21a 8030 (Fwhere_is_internal): Don't test CONSP (sequences) unnecessarily.
dbbb8427 8031 (DENSE_TABLE_SIZE): Remove; unused.
c1141155
PE
8032 (get_keymap, access_keymap, Fdefine_key, Fwhere_is_internal):
8033 (describe_map_tree):
8034 Rename locals to avoid shadowing.
38fc62d9 8035
2f2650da
PE
8036 * keyboard.c: Declare functions static if they are not used elsewhere.
8037 (echo_char, echo_dash, cmd_error, top_level_2):
8038 (poll_for_input, handle_async_input): Now static.
69a058fa
PE
8039 (read_char, kbd_buffer_get_event, make_lispy_position):
8040 (make_lispy_event, make_lispy_movement, apply_modifiers):
8041 (decode_keyboard_code, tty_read_avail_input, menu_bar_items):
8042 (parse_tool_bar_item, read_key_sequence, Fread_key_sequence):
8043 (Fread_key_sequence_vector): Rename locals to avoid shadowing.
c8a06054 8044 (read_key_sequence, read_char): Mark locals as initialized.
3ac94672 8045 (Fexit_recursive_edit, Fabort_recursive_edit): Mark with NO_RETURN.
2f2650da 8046
a053e86c 8047 * keyboard.h (make_ctrl_char): New decl.
da2f2dd9
PE
8048 (mark_kboards): Move decl here ...
8049 * alloc.c (mark_kboards): ... from here.
a053e86c 8050
4752793e
PE
8051 * lisp.h (force_auto_save_soon): New decl.
8052
74f10ca7 8053 * emacs.c (init_cmdargs): Rename local to avoid shadowing.
244fc23d
PE
8054 (DEFINE_DUMMY_FUNCTION): New macro.
8055 (__do_global_ctors, __do_global_ctors_aux, __do_global_dtors, __main):
8056 Use it.
c03cd23f
PE
8057 (main): Add casts to avoid warnings
8058 if GCC considers string literals to be constants.
74f10ca7 8059
022e70d4
PE
8060 * lisp.h (fatal_error_signal): Add decl, since it's exported.
8061
59d6fe83
PE
8062 * dbusbind.c: Pointer signedness fixes.
8063 (xd_signature, xd_append_arg, xd_initialize):
8064 (Fdbus_call_method, Fdbus_call_method_asynchronously):
8065 (Fdbus_method_return_internal, Fdbus_method_error_internal):
8066 (Fdbus_send_signal, xd_read_message_1, Fdbus_register_service):
8067 (Fdbus_register_signal): Use SSDATA when the context wants char *.
8068
78320123
PE
8069 * dbusbind.c (Fdbus_init_bus): Add cast to avoid warning
8070 if GCC considers string literals to be constants.
49cebcca 8071 (Fdbus_register_service, Fdbus_register_method): Remove unused vars.
78320123 8072
35ac2a97
SM
80732011-03-16 Stefan Monnier <monnier@iro.umontreal.ca>
8074
fb103ca9
SM
8075 * print.c (PRINT_CIRCLE_CANDIDATE_P): New macro.
8076 (print_preprocess, print_object): New macro to fix last change.
8077
35ac2a97
SM
8078 * print.c (print_preprocess): Don't forget font objects.
8079
62973b41
JB
80802011-03-16 Juanma Barranquero <lekktu@gmail.com>
8081
8082 * emacs.c (USAGE3): Doc fixes.
8083
0e48bb22
AS
80842011-03-15 Andreas Schwab <schwab@linux-m68k.org>
8085
8086 * coding.c (detect_coding_iso_2022): Reorganize code to clarify
8087 structure.
8088
7684e57b
JB
80892011-03-14 Juanma Barranquero <lekktu@gmail.com>
8090
8091 * lisp.h (VWindow_system, Qfile_name_history):
8092 * keyboard.h (lispy_function_keys) [WINDOWSNT]:
8093 * w32term.h (w32_system_caret_hwnd, w32_system_caret_height)
8094 (w32_system_caret_x, w32_system_caret_y): Declare extern.
8095
8096 * w32select.c: Don't #include "keyboard.h".
c96bbc66 8097 (run_protected): Add extern declaration for waiting_for_input.
7684e57b
JB
8098
8099 * w32.c (Qlocal, noninteractive1, inhibit_window_system):
8100 * w32console.c (detect_input_pending, read_input_pending)
8101 (encode_terminal_code):
8102 * w32fns.c (quit_char, lispy_function_keys, Qtooltip)
8103 (w32_system_caret_hwnd, w32_system_caret_height, w32_system_caret_x)
8104 (w32_system_caret_y, Qfile_name_history):
8105 * w32font.c (w32font_driver, QCantialias, QCotf, QClang):
8106 * w32inevt.c (reinvoke_input_signal, lispy_function_keys):
8107 * w32menu.c (Qmenu_bar, QCtoggle, QCradio, Qoverriding_local_map)
8108 (Qoverriding_terminal_local_map, Qmenu_bar_update_hook):
8109 * w32proc.c (Qlocal, report_file_error):
8110 * w32term.c (Vwindow_system, updating_frame):
8111 * w32uniscribe.c (initialized, uniscribe_font_driver):
8112 Remove unneeded extern declarations.
8113
2aa46d6c
CY
81142011-03-14 Chong Yidong <cyd@stupidchicken.com>
8115
c96bbc66 8116 * buffer.c (Fmake_indirect_buffer): Fix incorrect assertions.
2aa46d6c 8117
cffc6f3b
CY
81182011-03-13 Chong Yidong <cyd@stupidchicken.com>
8119
8120 * buffer.h (BUF_BEGV, BUF_BEGV_BYTE, BUF_ZV, BUF_ZV_BYTE, BUF_PT)
8121 (BUF_PT_BYTE): Rewrite to handle indirect buffers (Bug#8219).
8122 These macros can no longer be used for assignment.
8123
44f230aa
SM
8124 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer):
8125 Assign struct members directly, instead of using BUF_BEGV etc.
cffc6f3b
CY
8126 (record_buffer_markers, fetch_buffer_markers): New functions for
8127 recording and fetching special buffer markers.
8128 (set_buffer_internal_1, set_buffer_temp): Use them.
8129
8130 * lread.c (unreadchar): Use SET_BUF_PT_BOTH.
8131
8132 * insdel.c (adjust_point): Use SET_BUF_PT_BOTH.
8133
8134 * intervals.c (temp_set_point_both): Use SET_BUF_PT_BOTH.
8135 (get_local_map): Use SET_BUF_BEGV_BOTH and SET_BUF_ZV_BOTH.
8136
8137 * xdisp.c (hscroll_window_tree):
8138 (reconsider_clip_changes): Use PT instead of BUF_PT.
8139
d251f04b
EZ
81402011-03-13 Eli Zaretskii <eliz@gnu.org>
8141
8142 * makefile.w32-in ($(BLD)/editfns.$(O)): Depend on
8143 $(EMACS_ROOT)/lib/intprops.h.
8144
f0c77cd1
PE
81452011-03-13 Paul Eggert <eggert@cs.ucla.edu>
8146
3eca4629
PE
8147 Fix more problems found by GCC 4.5.2's static checks.
8148
7c86ee98
PE
8149 * gtkutil.c (xg_get_pixbuf_from_pixmap): Add cast from char *
8150 to unsigned char * to avoid compiler diagnostic.
b0afc268
PE
8151 (xg_free_frame_widgets): Make it clear that a local variable is
8152 needed only if USE_GTK_TOOLTIP.
01e0b5ad
PE
8153 (gdk_window_get_screen): Make it clear that this macro is needed
8154 only if USE_GTK_TOOLTIP.
1e5524e7
PE
8155 (int_gtk_range_get_value): New function, which avoids a diagnostic
8156 from gcc -Wbad-function-cast.
8157 (xg_set_toolkit_scroll_bar_thumb): Use it.
8158 (xg_tool_bar_callback, xg_tool_item_stale_p): Rewrite to avoid
8159 diagnostic from gcc -Wbad-function-cast.
65dc836c
PE
8160 (get_utf8_string, xg_get_file_with_chooser):
8161 Rename locals to avoid shadowing.
8162 (create_dialog): Move locals to avoid shadowing.
7c86ee98 8163
41729b81
PE
8164 * xgselect.c (xg_select): Remove unused var.
8165
f0c77cd1
PE
8166 * image.c (four_corners_best): Mark locals as initialized.
8167 (gif_load): Initialize transparent_p to zero (Bug#8238).
8168 Mark another local as initialized.
ec6cf4c6 8169 (my_png_error, my_error_exit): Mark with NO_RETURN.
f0c77cd1 8170
ce0ad53d 8171 * image.c (clear_image_cache): Now static.
d5d5a617 8172 (DIM, HAVE_STDLIB_H_1): Remove unused macros.
e22cffbc 8173 (xpm_load): Redo to avoid "discards qualifiers" gcc warning.
77a765fd
PE
8174 (x_edge_detection): Remove unnecessary cast that
8175 gcc -Wbad-function-cast diagnoses.
2037898d 8176 (gif_load): Fix pointer signedness.
6ae141d6
PE
8177 (clear_image_cache, xbm_read_bitmap_data, x_detect_edges):
8178 (jpeg_load, gif_load): Rename locals to avoid shadowing.
ce0ad53d 8179
33383987 81802011-03-12 Paul Eggert <eggert@cs.ucla.edu>
3eca4629 8181
d32df629
PE
8182 Improve quality of tests for time stamp overflow.
8183 For example, without this patch (encode-time 0 0 0 1 1
8184 1152921504606846976) returns the obviously-bogus value (-948597
8185 62170) on my RHEL 5.5 x86-64 host. With the patch, it correctly
8186 reports time overflow. See
8187 <http://lists.gnu.org/archive/html/emacs-devel/2011-03/msg00470.html>.
b8d9bd41
PE
8188 * deps.mk (editfns.o): Depend on ../lib/intprops.h.
8189 * editfns.c: Include limits.h and intprops.h.
8190 (TIME_T_MIN, TIME_T_MAX): New macros.
8191 (time_overflow): Move earlier, to before first use.
8192 (hi_time, lo_time): New functions, for an accurate test for
8193 out-of-range times.
8194 (Fcurrent_time, Fget_internal_run_time, make_time): Use them.
8195 (Fget_internal_run_time): Don't assume time_t fits in int.
8196 (make_time): Use list2 instead of Fcons twice.
8197 (Fdecode_time): More accurate test for out-of-range times.
8198 (check_tm_member): New function.
8199 (Fencode_time): Use it, to test for out-of-range times.
d32df629
PE
8200 (lisp_time_argument): Don't rely on undefined left-shift and
8201 right-shift behavior when checking for time stamp overflow.
8be6f318 8202
fe31d94c
PE
8203 * editfns.c (time_overflow): New function, refactoring common code.
8204 (Fformat_time_string, Fdecode_time, Fencode_time):
8205 (Fcurrent_time_string): Use it.
8206
8be6f318
PE
8207 Move 'make_time' to be next to its inverse 'lisp_time_argument'.
8208 * dired.c (make_time): Move to ...
8209 * editfns.c (make_time): ... here.
8210 * systime.h: Note the move.
8211
09d9db2c 82122011-03-12 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
c47cbdfd 8213
126bc0dc
YM
8214 * fringe.c (update_window_fringes): Remove unused variables.
8215
c47cbdfd
YM
8216 * unexmacosx.c (copy_data_segment): Also copy __got section.
8217 (Bug#8223)
8218
7ac80be9
EZ
82192011-03-12 Eli Zaretskii <eliz@gnu.org>
8220
c96bbc66 8221 * termcap.c [MSDOS]: Include "msdos.h".
058e5dad
EZ
8222 (find_capability, tgetnum, tgetflag, tgetstr, tputs, tgetent):
8223 Constify `char *' arguments and their references according to
8224 prototypes in tparam.h.
8225
ecb0f94d 8226 * deps.mk (termcap.o): Depend on tparam.h and msdos.h.
058e5dad 8227
7ac80be9
EZ
8228 * msdos.c (XMenuAddPane): 3rd argument is `const char *' now.
8229 Adapt all references accordingly.
8230
8231 * msdos.h (XMenuAddPane): 3rd argument is `const char *' now.
8232
ef1fd07e
TT
82332011-03-11 Tom Tromey <tromey@redhat.com>
8234
8235 * buffer.c (syms_of_buffer): Remove obsolete comment.
8236
7ef4b50c
EZ
82372011-03-11 Eli Zaretskii <eliz@gnu.org>
8238
8239 * termhooks.h (encode_terminal_code): Declare prototype.
8240
8241 * msdos.c (encode_terminal_code): Don't declare prototype.
8242
8243 * term.c (encode_terminal_code): Now external again, used by
8244 w32console.c and msdos.c.
8245
44f230aa
SM
8246 * makefile.w32-in ($(BLD)/term.$(O), ($(BLD)/tparam.$(O)):
8247 Depend on $(SRC)/tparam.h, see 2011-03-11T07:24:21Z!eggert@cs.ucla.edu.
7ef4b50c 8248
4b1ec863 82492011-03-11 Paul Eggert <eggert@cs.ucla.edu>
f78faa98 8250
1714f52b 8251 Fix some minor problems found by GCC 4.5.2's static checks.
83316bf4 8252
4b1ec863
PE
8253 * fringe.c (update_window_fringes): Mark locals as initialized
8254 (Bug#8227).
8255 (destroy_fringe_bitmap, init_fringe_bitmap): Now static.
bf60f616 8256
524c7aa6
PE
8257 * alloc.c (mark_fringe_data): Move decl from here ...
8258 * lisp.h (mark_fringe_data) [HAVE_WINDOW_SYSTEM]: ... to here,
8259 to check its interface.
8260 (init_fringe_once): Do not declare unless HAVE_WINDOW_SYSTEM.
8261
a5c0af81 8262 * fontset.c (free_realized_fontset): Now static.
7519b8cd 8263 (Fset_fontset_font): Rename local to avoid shadowing.
cc6e5db1 8264 (fontset_font): Mark local as initialized.
a9a06e0b 8265 (FONTSET_SPEC, FONTSET_REPERTORY, RFONT_DEF_REPERTORY): Remove; unused.
a5c0af81 8266
b4716021
PE
8267 * xrdb.c: Include "xterm.h", to check x_load_resources's interface.
8268
811e9bac 8269 * xselect.c (x_disown_buffer_selections): Remove; not used.
7b83e2f1 8270 (TRACE3) [!defined TRACE_SELECTION]: Remove; not used.
aa0daa9f
PE
8271 (x_own_selection, Fx_disown_selection_internal): Rename locals
8272 to avoid shadowing.
8273 (x_handle_dnd_message): Remove local to avoid shadowing.
811e9bac 8274
7e3ab302
PE
8275 * lisp.h (GCPRO1_VAR, UNGCPRO_VAR): New macros,
8276 so that the caller can use some name other than gcpro1.
8277 (GCPRO1, UNGCPRO): Reimplement in terms of the new macros.
58d2d479
PE
8278 * xfns.c (Fx_create_frame, x_create_tip_frame, Fx_show_tip):
8279 (Fx_backspace_delete_keys_p):
8280 Use them to avoid shadowing, and rename vars to avoid shadowing.
8281 (x_decode_color, x_set_name, x_window): Now static.
6b437900 8282 (Fx_create_frame): Add braces to silence GCC warning.
c0951e53 8283 (Fx_file_dialog, Fx_select_font): Fix pointer signedness.
06b0c8a0
PE
8284 (x_real_positions, xg_set_icon_from_xpm_data, x_create_tip_frame):
8285 Remove unused locals.
7e3ab302
PE
8286 (Fx_create_frame, x_create_tip_frame, Fx_show_tip):
8287 (Fx_backspace_delete_keys_p): Rename locals to avoid shadowing.
8288 Some of these renamings use the new GCPRO1_VAR and UNGCPRO_VAR
8289 macros.
f78faa98 8290
e2b13473
PE
8291 * xterm.h (x_mouse_leave): New decl.
8292
77f23912
PE
8293 * xterm.c (x_copy_dpy_color, x_focus_on_frame, x_unfocus_frame):
8294 Remove unused functions.
cdf4ba58
PE
8295 (x_shift_glyphs_for_insert, XTflash, XTring_bell):
8296 (x_calc_absolute_position): Now static.
7411c686 8297 (XTread_socket): Don't define label "out" unless it's used.
2b07bcff 8298 Don't declare local "event" unless it's used.
ed7bf3a5
PE
8299 (x_iconify_frame, x_free_frame_resources): Don't declare locals
8300 unless they are used.
38d0b34a
PE
8301 (XEMBED_VERSION, xembed_set_info): Don't define unless needed.
8302 (x_fatal_error_signal): Remove; not used.
a6067996
PE
8303 (x_draw_image_foreground, redo_mouse_highlight, XTmouse_position):
8304 (x_scroll_bar_report_motion, handle_one_xevent, x_draw_bar_cursor):
8305 (x_error_catcher, x_connection_closed, x_error_handler):
8306 (x_error_quitter, xembed_send_message, x_iconify_frame):
8307 (my_log_handler): Rename locals to avoid shadowing.
28f1c698 8308 (x_delete_glyphs, x_ins_del_lines): Mark with NO_RETURN.
2a8fade0 8309 (x_connection_closed): Tell GCC not to suggest NO_RETURN.
77f23912 8310
44f230aa
SM
8311 * xfaces.c (clear_face_cache, Fx_list_fonts, Fface_font):
8312 Rename or move locals to avoid shadowing.
6b463e58 8313 (tty_defined_color, merge_face_heights): Now static.
5967d051 8314 (free_realized_faces_for_fontset): Remove; not used.
1e9966ea
PE
8315 (Fx_list_fonts): Mark variable that gcc -Wuninitialized
8316 does not deduce is never used uninitialized.
73719eba
PE
8317 (STRDUPA, LSTRDUPA, FONT_POINT_SIZE_QUANTUM): Remove; not used.
8318 (LFACEP): Define only if XASSERTS, as it's not needed otherwise.
071048a3 8319
426994c3 8320 * terminal.c (store_terminal_param): Now static.
5489860b 8321
032f1620 8322 * xmenu.c (menu_highlight_callback): Now static.
9d66f88e 8323 (set_frame_menubar): Remove unused local.
d4323972 8324 (xmenu_show): Rename parameter to avoid shadowing.
6d1f7fee
PE
8325 (xmenu_show, xdialog_show, xmenu_show): Make local pointers "const"
8326 since they might point to immutable storage.
281585b0
PE
8327 (next_menubar_widget_id): Declare only if USE_X_TOOLKIT,
8328 since it's unused otherwise.
032f1620 8329
367c19e5 8330 * xdisp.c (produce_glyphless_glyph): Initialize lower_xoff.
53df7c11 8331 Add a FIXME, since the code still doesn't look right. (Bug#8215)
9f36b9fd
PE
8332 (Fcurrent_bidi_paragraph_direction): Simplify slightly; this
8333 avoids a gcc -Wuninitialized diagnostic.
0e086e8f 8334 (display_line, BUILD_COMPOSITE_GLYPH_STRING, draw_glyphs):
44a3a108
PE
8335 (note_mouse_highlight): Mark variables that gcc -Wuninitialized
8336 does not deduce are never used uninitialized.
70739cbe 8337
07b48fa9
PE
8338 * lisp.h (IF_LINT): New macro, copied from ../lib-src/emacsclient.c.
8339
8868a238 8340 * xdisp.c (redisplay_window): Rename local to avoid shadowing.
4554d213
PE
8341 * window.c (window_loop, size_window):
8342 (run_window_configuration_change_hook, enlarge_window): Likewise.
8868a238 8343
7e5cf297 8344 * window.c (display_buffer): Now static.
d6550a9f
PE
8345 (size_window): Mark variables that gcc -Wuninitialized
8346 does not deduce are never used uninitialized.
a586633d
PE
8347 * window.h (check_all_windows): New decl, to forestall
8348 gcc -Wmissing-prototypes diagnostic.
5b555da1 8349 * dispextern.h (bidi_dump_cached_states): Likewise.
7e5cf297 8350
f6095868
PE
8351 * charset.h (CHECK_CHARSET_GET_CHARSET): Rename locals to avoid
8352 shadowing.
8353 * charset.c (map_charset_for_dump, Fchar_charset): Likewise.
726929c4
PE
8354 Include <limits.h>.
8355 (Fsort_charsets): Redo min/max calculation to shorten the code a bit
8356 and to avoid gcc -Wuninitialized warning.
89ef49df
PE
8357 (load_charset_map): Mark variables that gcc -Wuninitialized
8358 does not deduce are never used uninitialized.
53df7c11 8359 (load_charset): Abort instead of using uninitialized var (Bug#8229).
f6095868 8360
f38b440c
PE
8361 * coding.c (coding_set_source, coding_set_destination):
8362 Use "else { /* comment */ }" rather than "else /* comment */;"
8363 for clarity, and to avoid gcc -Wempty-body warning.
2735d060
PE
8364 (Fdefine_coding_system_internal): Don't redeclare 'i' inside
8365 a block, when the outer 'i' will do.
8366 (decode_coding_utf_8, decode_coding_utf_16, detect_coding_emacs_mule):
8367 (emacs_mule_char, decode_coding_emacs_mule, detect_coding_iso_2022):
8368 (decode_coding_iso_2022, decode_coding_sjis, decode_coding_big5):
8369 (decode_coding_raw_text, decode_coding_charset, get_translation_table):
8370 (Fdecode_sjis_char, Fdefine_coding_system_internal):
8371 Rename locals to avoid shadowing.
8372 * character.h (FETCH_STRING_CHAR_ADVANCE): Likewise.
e2f1bab9
PE
8373 * coding.c (emacs_mule_char, encode_invocation_designation):
8374 Now static, since they're not used elsewhere.
413bb2db 8375 (decode_coding_iso_2022): Add "default: abort ();" as a safety check.
c4a63b12 8376 (decode_coding_object, encode_coding_object, detect_coding_system):
ee05f961
PE
8377 (decode_coding_emacs_mule): Mark variables that gcc
8378 -Wuninitialized does not deduce are never used uninitialized.
160b01f6
PE
8379 (detect_coding_iso_2022): Initialize a local variable that might
8380 be used uninitialized. Leave a FIXME because it's not clear that
53df7c11 8381 this initialization is needed. (Bug#8211)
5f58e762
PE
8382 (ISO_CODE_LF, ISO_CODE_CR, CODING_ISO_FLAG_EUC_TW_SHIFT):
8383 (ONE_MORE_BYTE_NO_CHECK, UTF_BOM, UTF_16_INVALID_P):
8384 (SHIFT_OUT_OK, ENCODE_CONTROL_SEQUENCE_INTRODUCER):
8385 (ENCODE_DIRECTION_R2L, ENCODE_DIRECTION_L2R):
8386 Remove unused macros.
f38b440c 8387
232b38b9 8388 * category.c (hash_get_category_set): Remove unused local var.
9f3b5e69 8389 (copy_category_table): Now static, since it's not used elsewhere.
d0891610 8390 * character.c (string_count_byte8): Likewise.
232b38b9 8391
fb90da1b
PE
8392 * ccl.c (CCL_WRITE_STRING, CCL_ENCODE_CHAR, Fccl_execute_on_string):
8393 (Fregister_code_conversion_map): Rename locals to avoid shadowing.
8394
fb93dbc2
PE
8395 * chartab.c (copy_sub_char_table): Now static, since it's not used
8396 elsewhere.
5c156ace
PE
8397 (sub_char_table_ref_and_range, char_table_ref_and_range):
8398 Rename locals to avoid shadowing.
bbcd0949 8399 (ASET_RANGE, GET_SUB_CHAR_TABLE): Remove unused macros.
fb93dbc2 8400
7d3b3862 8401 * bidi.c (bidi_check_type): Now static, since it's not used elsewhere.
630d6892 8402 (BIDI_BOB): Remove unused macro.
7d3b3862 8403
6be7d3da
PE
8404 * cm.c (cmgoto): Mark variables that gcc -Wuninitialized does not
8405 deduce are never used uninitialized.
c2ed9c8b 8406 * term.c (encode_terminal_code): Likewise.
6be7d3da 8407
75f8807f 8408 * term.c (encode_terminal_code): Now static. Remove unused local.
72abad34 8409
50938595
PE
8410 * tparam.h: New file.
8411 * term.c, tparam.h: Include it.
8412 * deps.mk (term.o, tparam.o): Depend on tparam.h.
8413 * term.c (tputs, tgetent, tgetflag, tgetnum, tparam, tgetstr):
8414 Move these decls to tparam.h, and make them agree with what
8415 is actually in tparam.c. The previous trick of using incompatible
8416 decls in different modules does not conform to the C standard.
8417 All callers of tparam changed to use tparam's actual API.
8418 * tparam.c (tparam1, tparam, tgoto):
8419 Use const pointers where appropriate.
8420
fbceeba2
PE
8421 * cm.c (calccost, cmgoto): Use const pointers where appropriate.
8422 * cm.h (struct cm): Likewise.
8423 * dispextern.h (do_line_insertion_deletion_costs): Likewise.
8424 * scroll.c (ins_del_costs, do_line_insertion_deletion_costs): Likewise.
8425 * term.c (tty_ins_del_lines, calculate_costs, struct fkey_table):
8426 (term_get_fkeys_1, append_glyphless_glyph, produce_glyphless_glyph):
8427 (turn_on_face, init_tty): Likewise.
8428 * termchar.h (struct tty_display_info): Likewise.
fbceeba2 8429
7f3f1250
PE
8430 * term.c (term_mouse_position): Rename local to avoid shadowing.
8431
e6ca6543
PE
8432 * alloc.c (mark_ttys): Move decl from here ...
8433 * lisp.h (mark_ttys): ... to here, so that it's checked against defn.
8434
c40f8d15
AS
84352011-03-11 Andreas Schwab <schwab@linux-m68k.org>
8436
8437 * .gdbinit (pwinx, xbuffer): Fix access to buffer name.
8438
cfe0661d
JB
84392011-03-09 Juanma Barranquero <lekktu@gmail.com>
8440
8441 * search.c (compile_pattern_1): Remove argument regp, unused since
8442 revid:rms@gnu.org-19941211082627-3x1g1wyqkjmwloig.
8443 (compile_pattern): Don't pass it.
8444
0afb4571
J
84452011-03-08 Jan Djärv <jan.h.d@swipnet.se>
8446
8447 * xterm.h (DEFAULT_GDK_DISPLAY): New define.
8448 (GDK_WINDOW_XID, gtk_widget_get_preferred_size): New defines
8449 for ! HAVE_GTK3.
8450 (GTK_WIDGET_TO_X_WIN): Use GDK_WINDOW_XID.
8451
8452 * xmenu.c (menu_position_func): Call gtk_widget_get_preferred_size.
8453
8454 * gtkutil.c: Include gtkx.h if HAVE_GTK3. If ! HAVE_GTK3, define
8455 gdk_window_get_screen, gdk_window_get_geometry,
8456 gdk_x11_window_lookup_for_display and GDK_KEY_g.
8457 (xg_set_screen): Use DEFAULT_GDK_DISPLAY.
8458 (xg_get_pixbuf_from_pixmap): New function.
8459 (xg_get_pixbuf_from_pix_and_mask): Change parameters from GdkPixmap
8460 to Pixmap, take frame as parameter, remove GdkColormap parameter.
8461 Call xg_get_pixbuf_from_pixmap instead of
8462 gdk_pixbuf_get_from_drawable.
8463 (xg_get_image_for_pixmap): Do not make GdkPixmaps, call
8464 xg_get_pixbuf_from_pix_and_mask with Pixmap parameters instead.
8465 (xg_check_special_colors): Use GtkStyleContext and its functions
8466 for HAVE_GTK3.
8467 (xg_prepare_tooltip, xg_hide_tooltip): Call gdk_window_get_screen.
8468 (xg_prepare_tooltip, create_dialog, menubar_map_cb)
8469 (xg_update_frame_menubar, xg_tool_bar_detach_callback)
44f230aa
SM
8470 (xg_tool_bar_attach_callback, xg_update_tool_bar_sizes):
8471 Call gtk_widget_get_preferred_size.
0afb4571
J
8472 (xg_frame_resized): gdk_window_get_geometry only takes 5
8473 parameters.
44f230aa
SM
8474 (xg_win_to_widget, xg_event_is_for_menubar):
8475 Call gdk_x11_window_lookup_for_display.
0afb4571
J
8476 (xg_set_widget_bg): New function.
8477 (delete_cb): New function.
895009e1 8478 (xg_create_frame_widgets): Connect delete-event to delete_cb.
0afb4571
J
8479 Call xg_set_widget_bg. Only set backgrund pixmap for ! HAVE_GTK3
8480 (xg_set_background_color): Call xg_set_widget_bg.
8481 (xg_set_frame_icon): Call xg_get_pixbuf_from_pix_and_mask.
8482 (xg_create_scroll_bar): vadj is a GtkAdjustment for HAVE_GTK3.
8483 Only call gtk_range_set_update_policy if ! HAVE_GTK3.
8484 (xg_make_tool_item): Only connect xg_tool_bar_item_expose_callback
8485 if ! HAVE_GTK3.
8486 (update_frame_tool_bar): Call gtk_widget_hide.
8487 (xg_initialize): Use GDK_KEY_g.
8488
8489 * xsmfns.c (gdk_set_sm_client_id): Define to gdk_set_sm_client_id
8490 if ! HAVE_GTK3
8491 (x_session_initialize): Call gdk_x11_set_sm_client_id.
8492
8493 * xterm.c (XFillRectangle): Use cairo routines for HAVE_GTK3.
8494 (x_term_init): Disable Xinput(2) with GDK_CORE_DEVICE_EVENTS.
8495 Load ~/emacs.d/gtkrc only for ! HAVE_GTK3.
8496
1c2cc4ef
JB
84972011-03-08 Juanma Barranquero <lekktu@gmail.com>
8498
8499 * w32xfns.c (select_palette): Check success of RealizePalette against
8500 GDI_ERROR, not zero.
8501
33383987 8502See ChangeLog.11 for earlier changes.
aac0c6e3
MR
8503
8504;; Local Variables:
8505;; coding: utf-8
aac0c6e3
MR
8506;; End:
8507
33383987 8508 Copyright (C) 2011 Free Software Foundation, Inc.
aac0c6e3
MR
8509
8510 This file is part of GNU Emacs.
8511
8512 GNU Emacs is free software: you can redistribute it and/or modify
8513 it under the terms of the GNU General Public License as published by
8514 the Free Software Foundation, either version 3 of the License, or
8515 (at your option) any later version.
8516
8517 GNU Emacs is distributed in the hope that it will be useful,
8518 but WITHOUT ANY WARRANTY; without even the implied warranty of
8519 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
8520 GNU General Public License for more details.
8521
8522 You should have received a copy of the GNU General Public License
8523 along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.