Merge from trunk.
[bpt/emacs.git] / src / ChangeLog
CommitLineData
45e9f7da 12012-04-09 Paul Eggert <eggert@cs.ucla.edu>
3164aeac 2
2121662f 3 Fix integer width and related bugs (Bug#9874).
eb106a49 4 * alloc.c (pure_bytes_used_lisp, pure_bytes_used_non_lisp):
d311d28c
PE
5 (allocate_vectorlike, buffer_memory_full, struct sdata, SDATA_SIZE)
6 (string_bytes, check_sblock, allocate_string_data):
7 (compact_small_strings, Fmake_bool_vector, make_string)
8 (make_unibyte_string, make_multibyte_string)
9 (make_string_from_bytes, make_specified_string)
10 (allocate_vectorlike, Fmake_vector, find_string_data_in_pure)
11 (make_pure_string, make_pure_c_string, make_pure_vector, Fpurecopy)
12 (mark_vectorlike):
13 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
14 (allocate_pseudovector):
15 Use int, not EMACS_INT, where int is wide enough.
16 (inhibit_garbage_collection, Fgarbage_collect):
17 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
18 * bidi.c (bidi_mirror_char): Use EMACS_INT, not int, where
19 int might not be wide enough.
20 (bidi_cache_search, bidi_cache_find, bidi_init_it)
21 (bidi_count_bytes, bidi_char_at_pos, bidi_fetch_char)
22 (bidi_at_paragraph_end, bidi_find_paragraph_start)
23 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak)
24 (bidi_level_of_next_char, bidi_move_to_visually_next):
25 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
26 * buffer.c (copy_overlays, Fgenerate_new_buffer_name)
27 (Fkill_buffer, Fset_buffer_major_mode)
28 (advance_to_char_boundary, Fbuffer_swap_text)
29 (Fset_buffer_multibyte, overlays_at, overlays_in)
30 (overlay_touches_p, struct sortvec, record_overlay_string)
31 (overlay_strings, recenter_overlay_lists)
32 (adjust_overlays_for_insert, adjust_overlays_for_delete)
33 (fix_start_end_in_overlays, fix_overlays_before, modify_overlay)
34 (Fmove_overlay, Fnext_overlay_change, Fprevious_overlay_change)
35 (Foverlay_recenter, last_overlay_modification_hooks_used)
36 (report_overlay_modification, evaporate_overlays, enlarge_buffer_text):
37 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
977b0e45
PE
38 (validate_region): Omit unnecessary test for b <= e,
39 since that's guaranteed by the previous test.
d311d28c
PE
40 (adjust_overlays_for_delete): Avoid pos + length overflow.
41 (Fmove_overlay, Fdelete_overlay, add_overlay_mod_hooklist)
42 (report_overlay_modification):
43 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
44 (Foverlays_at, Fnext_overlay_change, Fprevious_overlay_change):
45 Omit pointer cast, which isn't needed anyway, and doesn't work
46 after the EMACS_INT -> ptrdiff_t change.
79cce3f2
PE
47 (Fmove_overlay): Delete an evaporating overlay
48 if it becomes empty after its bounds are adjusted to fit within
49 its buffer. Without this fix, in a nonempty buffer (let ((o
50 (make-overlay 1 2))) (overlay-put o 'evaporate t) (move-overlay o 0 1))
51 yields an empty overlay that has the evaporate property, which is
52 not supposed to happen. (Bug#9642)
d311d28c
PE
53 * buffer.h: Adjust decls to match defn changes elsewhere.
54 (struct buffer_text, struct buffer):
55 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
56 Use EMACS_INT, not int, where int might not be wide enough.
39b5db3b
PE
57 * bytecode.c (unmark_byte_stack, exec_byte_code): Use ptrdiff_t,
58 not int, to avoid needless 32-bit limit on 64-bit hosts.
59 (exec_byte_code): Use tighter memory-full test, one that checks
60 for alloca overflow. Don't compute the address of the object just
61 before an array, as that's not portable. Use EMACS_INT, not
62 ptrdiff_t or int, where ptrdiff_t or int might not be wide enough.
d311d28c
PE
63 * callint.c (Fcall_interactively):
64 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
65 * callproc.c (call_process_kill, Fcall_process):
66 Don't assume pid_t fits into an Emacs fixnum.
67 (call_process_cleanup, Fcall_process, child_setup):
68 Don't assume pid_t fits into int.
69 (call_process_cleanup, Fcall_process, delete_temp_file)
70 (Fcall_process_region):
71 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
72 (Fcall_process): Simplify handling of volatile integers.
73 Use int, not EMACS_INT, where int will do.
74 * casefiddle.c (casify_object, casify_region, operate_on_word)
75 (Fupcase_word, Fdowncase_word, Fcapitalize_word):
76 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
77 (casify_object): Avoid integer overflow when overallocating buffer.
78 * casetab.c (set_identity, shuffle): Prefer int to unsigned when
45c2afd6 79 either works. Use lint_assume to convince GCC 4.6.1 that it's OK.
d311d28c
PE
80 * category.c (Fchar_category_set): Don't assume fixnum fits in int.
81 * category.h (CATEGORYP): Don't assume arg is nonnegative.
82 * ccl.c (GET_CCL_INT): Remove; no longer needed, since the
83 integers are now checked earlier. All uses replaced with XINT.
84 (ccl_driver):
85 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
86 For CCL_MapSingle, check that content and value are in int range.
c801946a
PE
87 (ccl_driver, Fregister_code_conversion_map):
88 Check that Vcode_version_map_vector is a vector.
d311d28c
PE
89 (resolve_symbol_ccl_program): Check that vector header is in range.
90 Always copy the vector, so that we can check its contents reliably
91 now rather than having to recheck each instruction as it's being
92 executed. Check that vector words fit in 'int'.
93 (ccl_get_compiled_code, Fregister_ccl_program)
94 (Fregister_code_conversion_map): Use ptrdiff_t, not int, for
95 program indexes, to avoid needless 32-bit limit on 64-bit hosts.
96 (Fccl_execute, Fccl_execute_on_string): Check that initial reg
97 contents are in range.
98 (Fccl_execute_on_string): Check that status is in range.
99 * ccl.h (struct ccl_program.idx): Now ptrdiff_t, not int.
100 * character.c (char_resolve_modifier_mask, Fchar_resolve_modifiers):
101 Accept and return EMACS_INT, not int, because callers can pass values
102 out of 'int' range.
103 (c_string_width, strwidth, lisp_string_width, chars_in_text)
104 (multibyte_chars_in_text, parse_str_as_multibyte)
105 (str_as_multibyte, count_size_as_multibyte, str_to_multibyte)
106 (str_as_unibyte, str_to_unibyte, string_count_byte8)
107 (string_escape_byte8, Fget_byte):
108 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
a14e1568 109 (Funibyte_string): Use CHECK_RANGED_INTEGER, not CHECK_NATNUM, to
d311d28c
PE
110 avoid mishandling large integers.
111 * character.h: Adjust decls to match defn changes elsewhere.
112 * charset.c (load_charset_map_from_file, find_charsets_in_text)
113 (Ffind_charset_region):
114 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
115 (load_charset_map_from_file): Redo idx calculation to avoid overflow.
116 (load_charset_map_from_vector, Fdefine_charset_internal):
3c7649c1 117 Don't assume fixnum fits in int.
d311d28c
PE
118 (load_charset_map_from_vector, Fmap_charset_chars):
119 Remove now-unnecessary CHECK_NATNUMs.
120 (Fdefine_charset_internal): Check ranges here, more carefully.
3c7649c1
PE
121 Don't rely on undefined behavior with signed left shift overflow.
122 Don't assume unsigned int fits into fixnum, or that fixnum fits
123 into unsigned int. Don't require max_code to be a valid fixnum;
124 that's not true for gb10830 4-byte on a 32-bit host. Allow
125 invalid_code to be a cons, for the same reason. Require code_offset
126 to be a character. Avoid int overflow if max_char is close
127 to INT_MAX.
128 (CODE_POINT_TO_INDEX): On 32-bit hosts, return int, not unsigned;
129 this is intended anyway and avoids some undefined behavior.
130 (load_charset_map): Pass unsigned, not int, as 2nd arg of
131 INDEX_TO_CODE_POINT, as that's what it expects.
132 (Funify_charset, encode_char): Don't stuff unsigned vals into int vars.
60ad3eab
PE
133 * charset.h (DECODE_CHAR): Return int, not unsigned;
134 this is what was intended anyway, and it avoids undefined behavior.
135 (CHARSET_OFFSET): Remove unused macro, instead of fixing its
136 integer-overflow issues.
137 (ENCODE_CHAR): Return unsigned on all hosts, not just on 32-bit hosts.
138 Formerly, it returned EMACS_INT on 64-bit hosts in the common case
139 where the argument is EMACS_INT, and this behavior is not intended.
d311d28c
PE
140 * chartab.c (Fmake_char_table, Fset_char_table_range)
141 (uniprop_get_decoder, uniprop_get_encoder):
142 Don't assume fixnum fits in int.
143 * cmds.c (move_point): New function, that does the gist of
144 Fforward_char and Fbackward_char, but does so while checking
145 for integer overflow more accurately.
c96e5d6a 146 (Fforward_char, Fbackward_char): Use it.
d311d28c
PE
147 (Fforward_line, Fend_of_line, internal_self_insert)
148 (internal_self_insert):
149 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
150 Fix a FIXME, by checking for integer overflow when calculating
151 target_clm and actual_clm.
152 * coding.c (detect_coding_XXX, encode_coding_XXX, CODING_DECODE_CHAR)
8f50130c 153 (CODING_ENCODE_CHAR, CODING_CHAR_CHARSET, CODING_CHAR_CHARSET_P)
d311d28c
PE
154 (ASSURE_DESTINATION, coding_alloc_by_realloc)
155 (coding_alloc_by_making_gap, alloc_destination)
156 (detect_coding_utf_8, encode_coding_utf_8, decode_coding_utf_16)
157 (encode_coding_utf_16, detect_coding_emacs_mule)
158 (decode_coding_emacs_mule, encode_coding_emacs_mule)
159 (detect_coding_iso_2022, decode_coding_iso_2022)
160 (encode_invocation_designation, encode_designation_at_bol)
161 (encode_coding_iso_2022, detect_coding_sjis, detect_coding_big5)
162 (decode_coding_sjis, decode_coding_big5, encode_coding_sjis)
163 (encode_coding_big5, detect_coding_ccl, decode_coding_ccl)
164 (encode_coding_ccl, encode_coding_raw_text)
165 (detect_coding_charset, decode_coding_charset)
166 (encode_coding_charset, detect_eol, decode_eol, produce_chars)
167 (produce_composition, produce_charset, produce_annotation)
168 (decode_coding, handle_composition_annotation)
169 (handle_charset_annotation, consume_chars, decode_coding_gap)
170 (decode_coding_object, encode_coding_object, detect_coding_system)
171 (Ffind_coding_systems_region_internal, Fcheck_coding_systems_region)
172 (code_convert_region, code_convert_string)
8f50130c
PE
173 (Fdefine_coding_system_internal)
174 (coding_set_source, coding_set_destination):
d311d28c
PE
175 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
176 (setup_iso_safe_charsets, consume_chars, Funencodable_char_position)
177 (Fdefine_coding_system_internal):
178 Don't assume fixnums fit in int.
179 (decode_coding_gap, decode_coding_object, encode_coding_object)
5895d7b9 180 (Fread_coding_system, Fdetect_coding_region)
2c6a9faa
PE
181 (Funencodable_char_position, Fcheck_coding_systems_region)
182 (get_translation, handle_composition_annotation, consume_chars):
d311d28c 183 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
977b0e45 184 (consume_chars): Rewrite to not calculate an address outside buffer.
d311d28c 185 (Ffind_operation_coding_system): NATNUMP can eval its arg twice.
7b09a37a 186 Don't access memory outside of the args array.
d311d28c 187 (Fdefine_coding_system_internal): Check for charset-id overflow.
47664caa
PE
188 (ENCODE_ISO_CHARACTER): Use unsigned, not int, to store the unsigned
189 result of ENCODE_CHAR.
d311d28c
PE
190 * coding.h: Adjust decls to match defn changes elsewhere.
191 (struct coding_system):
192 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
193 * composite.c (get_composition_id, find_composition)
194 (run_composition_function, update_compositions)
195 (compose_text, composition_gstring_put_cache)
196 (composition_gstring_p, composition_gstring_width)
197 (fill_gstring_header, fill_gstring_body, autocmp_chars)
198 (composition_compute_stop_pos, composition_reseat_it)
199 (composition_update_it, struct position_record)
200 (find_automatic_composition, composition_adjust_point)
201 (Fcomposition_get_gstring, Ffind_composition_internal):
202 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
203 (update_compositions):
204 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
205 * composite.h: Adjust decls to match defn changes elsewhere.
206 (struct composition):
207 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
208 * data.c (let_shadows_buffer_binding_p, let_shadows_global_binding_p):
209 Do not attempt to compute the address of the object just before a
210 buffer; this is not portable.
211 (Faref, Faset):
212 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
213 (Faset): Use int, not EMACS_INT, where int is wide enough.
214 (Fstring_to_number): Don't assume fixnums fit in int.
215 (Frem): Don't assume arg is nonnegative.
216 * dbusbind.c (xd_append_arg): Check for integers out of range.
217 (Fdbus_call_method): Don't overflow the timeout int.
218 * dired.c (directory_files_internal, file_name_completion, scmp)
219 (file_name_completion_stat):
220 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
221 (file_name_completion): Don't overflow matchcount.
222 (file_name_completion_stat): Use SAFE_ALLOCA, not alloca.
223 * dispextern.h: Adjust decls to match defn changes elsewhere.
224 (struct text_pos, struct glyph, struct bidi_saved_info)
225 (struct bidi_string_data, struct bidi_it, struct composition_it)
226 (struct it):
227 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
228 (struct display_pos, struct composition_it, struct it):
229 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
230 * dispnew.c (increment_matrix_positions)
231 (increment_row_positions, mode_line_string)
232 (marginal_area_string):
233 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
54e1617f 234 (change_frame_size_1, Fredisplay, Fframe_or_buffer_changed_p):
d311d28c
PE
235 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
236 (duration_to_sec_usec): New function, to check for overflow better.
237 (Fsleep_for, sit_for): Use it.
238 * doc.c (get_doc_string, store_function_docstring):
239 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
240 (get_doc_string, Fsnarf_documentation):
241 Use int, not EMACS_INT, where int is wide enough.
242 (get_doc_string):
243 Use SAFE_ALLOCA, not alloca.
244 Check for overflow when converting EMACS_INT to off_t.
245 * doprnt.c (doprnt):
246 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
247 * editfns.c (init_editfns, Fuser_uid, Fuser_real_uid):
248 Don't assume uid_t fits into fixnum.
249 (buildmark, Fgoto_char, overlays_around, find_field, Fdelete_field)
250 (Ffield_string, Ffield_string_no_properties, Ffield_beginning)
251 (Ffield_end, Fconstrain_to_field, Fline_beginning_position)
252 (Fline_end_position, Fprevious_char, Fchar_after, Fchar_before)
253 (general_insert_function)
254 (Finsert_char, make_buffer_string, make_buffer_string_both)
255 (update_buffer_properties, Fbuffer_substring)
256 (Fbuffer_substring_no_properties, Fcompare_buffer_substrings)
257 (Fsubst_char_in_region, check_translation)
258 (Ftranslate_region_internal, save_restriction_restore, Fformat)
259 (transpose_markers, Ftranspose_regions):
260 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
261 (clip_to_bounds): Move to lisp.h as an inline function).
262 (Fconstrain_to_field): Don't assume integers are nonnegative.
263 (Fline_beginning_position, Fsave_excursion, Fsave_current_buffer):
264 (Fsubst_char_in_region, Fsave_restriction):
265 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
266 (Femacs_pid): Don't assume pid_t fits into fixnum.
267 (lo_time): Use int, not EMACS_INT, when int suffices.
268 (lisp_time_argument): Check for usec out of range.
269 (Fencode_time): Don't assume fixnum fits in int.
3f4eabd1
PE
270 (Fuser_login_name, Fuser_full_name): Signal an error
271 if a uid argument is out of range, rather than relying on
272 undefined behavior.
c8d5c857
PE
273 (Fformat_time_string): Remove now-unnecessary check.
274 lisp_time_argument checks for out-of-range usec now.
d311d28c
PE
275 * emacs.c (gdb_valbits, gdb_gctypebits): Now int, not EMACS_INT.
276 (gdb_data_seg_bits): Now uintptr_t, not EMACS_INT.
277 (PVEC_FLAG, gdb_array_mark_flag): Now ptrdiff_t, not EMACS_INT.
278 (init_cmdargs, Fdump_emacs):
279 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
280 (Fkill_emacs): Don't assume fixnum fits in int; instead, take just
281 the bottom (typically) 32 bits of the fixnum.
282 * eval.c (specpdl_size, call_debugger):
283 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
284 (when_entered_debugger, Fbacktrace_debug):
285 Don't assume fixnum can fit in int.
286 (Fdefvaralias, Fdefvar): Do not attempt to compute the address of
287 the object just before a buffer; this is not portable.
288 (FletX, Flet, Funwind_protect, do_autoload, Feval, funcall_lambda)
289 (grow_specpdl, unbind_to):
290 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
291 (Fapply, apply_lambda): Don't assume ptrdiff_t can hold fixnum.
292 (grow_specpdl): Simplify allocation by using xpalloc.
856bbc81 293 (Fprog1, Fprog2): Don't assume list length fits in int. Simplify.
d311d28c
PE
294 * fileio.c (Ffind_file_name_handler, Fcopy_file, Frename_file)
295 (Finsert_file_contents, Fwrite_region, Fdo_auto_save):
296 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
297 (Ffind_file_name_handler, non_regular_inserted, Finsert_file_contents)
298 (a_write, e_write):
299 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
300 (Fcopy_file, non_regular_nbytes, read_non_regular)
301 (Finsert_file_contents):
302 Use int, not EMACS_INT, where int is wide enough.
303 (READ_BUF_SIZE): Verify that it fits in int.
304 (Finsert_file_contents): Check that counts are in proper range,
305 rather than assuming fixnums fit into ptrdiff_t etc.
306 Don't assume fixnums fit into int.
125b3835 307 * floatfns.c (Fexpt): Avoid undefined signed * signed overflow.
5895d7b9
PE
308 * fns.c (Fcompare_strings, Fstring_lessp, struct textprop_rec, concat)
309 (string_char_byte_cache_charpos, string_char_byte_cache_bytepos)
d311d28c
PE
310 (string_char_to_byte, string_byte_to_char)
311 (string_make_multibyte, string_to_multibyte)
312 (string_make_unibyte, Fstring_as_unibyte, Fstring_as_multibyte)
313 (Fstring_to_unibyte, Fsubstring, Fsubstring_no_properties)
314 (substring_both, Fdelete, internal_equal, Ffillarray)
315 (Fclear_string, mapcar1)
316 (Fbase64_encode_region, Fbase64_encode_string, base64_encode_1)
317 (Fbase64_decode_region, Fbase64_decode_string, base64_decode_1)
318 (larger_vector, make_hash_table, maybe_resize_hash_table)
319 (hash_lookup, hash_remove_from_table, hash_clear, sweep_weak_table)
320 (Fmaphash, secure_hash):
321 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
322 (concat): Check for string index and length overflow.
323 (Fmapconcat): Don't assume fixnums fit into ptrdiff_t.
324 (Frequire):
325 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
326 (larger_vector): New API (vec, incr_min, size_max) replaces old
327 one (vec, new_size, init). This catches size overflow.
328 INIT was removed because it was always Qnil.
329 All callers changed.
330 (INDEX_SIZE_BOUND): New macro, which calculates more precisely
331 the upper bound on a hash table index size.
332 (make_hash_table, maybe_resize_hash_table): Use it.
333 (secure_hash): Computer start_byte and end_byte only after
334 they're known to be in ptrdiff_t range.
335 * font.c (font_intern_prop, font_at, font_range, Ffont_shape_gstring)
336 (Ffont_get_glyphs, Ffont_at):
337 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
338 (font_style_to_value, font_prop_validate_style, font_expand_wildcards)
339 (Flist_fonts, Fopen_font):
340 Don't assume fixnum can fit in int.
341 (check_gstring): Don't assume index can fit in int.
342 (font_match_p): Check that fixnum is a character, not a nonnegative
343 fixnum, since the later code needs to stuff it into an int.
344 (font_find_for_lface): Use SAFE_ALLOCA_LISP, not alloca.
345 (font_fill_lglyph_metrics): Use unsigned, not EMACS_INT, to avoid
346 conversion overflow issues.
347 (Fopen_font): Check for integer out of range.
348 (Ffont_get_glyphs): Don't assume index can fit in int.
349 * font.h: Adjust decls to match defn changes elsewhere.
350 * fontset.c (reorder_font_vector): Redo score calculation to avoid
351 integer overflow.
352 (num_auto_fontsets, fontset_from_font): Use ptrdiff_t, not
353 printmax_t, where ptrdiff_t is wide enough.
354 (Finternal_char_font):
355 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
356 * frame.c (Fset_mouse_position, Fset_mouse_pixel_position)
357 (Fset_frame_height, Fset_frame_width, Fset_frame_size)
358 (Fset_frame_position, x_set_frame_parameters)
359 (x_set_line_spacing, x_set_border_width)
360 (x_set_internal_border_width, x_set_alpha, x_figure_window_size):
361 Check that fixnums are in proper range for system types.
362 (frame_name_fnn_p, Fframe_parameter, Fmodify_frame_parameters):
363 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
364 (Fmodify_frame_parameters): Don't assume fixnum fits in int.
365 Use SAFE_ALLOCA_LISP, not alloca.
366 * frame.h (struct frame): Use intptr_t, not EMACS_INT, where
367 intptr_t is wide enough.
368 * fringe.c (lookup_fringe_bitmap, get_logical_fringe_bitmap)
369 (Fdefine_fringe_bitmap): Don't assume fixnum fits in int.
370 (Ffringe_bitmaps_at_pos): Don't assume index fits in int.
371 Check for fixnum out of range.
372 * ftfont.c (ftfont_list): Don't assume index fits in int.
373 Check that fixnums are in proper range for system types.
374 (ftfont_shape_by_flt):
375 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
d311d28c
PE
376 * gnutls.c (emacs_gnutls_write, emacs_gnutls_read):
377 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
378 (Fgnutls_error_fatalp, Fgnutls_error_string, Fgnutls_boot):
379 Check that fixnums are in proper range for system types.
380 * gnutls.h: Adjust decls to match defn changes elsewhere.
381 * gtkutil.c (xg_dialog_run):
382 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
383 (update_frame_tool_bar):
384 Check that fixnums are in proper range for system types.
385 * image.c (parse_image_spec): Redo count calculation to avoid overflow.
5895d7b9 386 (lookup_image): Check that fixnums are in range for system types.
d311d28c
PE
387 * indent.c (last_known_column, last_known_column_point):
388 (current_column_bol_cache):
389 (skip_invisible, current_column, check_display_width):
390 (check_display_width, scan_for_column, current_column_1)
391 (Findent_to, Fcurrent_indentation, position_indentation)
392 (indented_beyond_p, Fmove_to_column, compute_motion):
393 (Fcompute_motion, Fvertical_motion):
394 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
395 (last_known_column_modified): Use EMACS_INT, not int.
396 (check_display_width):
397 (Fcompute_motion):
398 Check that fixnums and floats are in proper range for system types.
399 (compute_motion): Don't assume index or fixnum fits in int.
400 (compute_motion, Fcompute_motion):
401 Use int, not EMACS_INT, when it is wide enough.
402 (vmotion): Omit local var start_hpos that is always 0; that way
403 we don't need to worry about overflow in expressions involving it.
404 * indent.h: Adjust decls to match defn changes elsewhere.
405 (struct position):
406 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
407 Use int, not EMACS_INT, where int is wide enough.
408 Remove unused members ovstring_chars_done and tab_offset;
409 all uses removed.
410 * insdel.c (move_gap, move_gap_both, gap_left, gap_right)
411 (adjust_markers_for_delete, adjust_markers_for_insert, adjust_point)
412 (adjust_markers_for_replace, make_gap_larger, make_gap_smaller)
413 (make_gap, copy_text, insert, insert_and_inherit)
414 (insert_before_markers, insert_before_markers_and_inherit)
415 (insert_1, count_combining_before, count_combining_after)
416 (insert_1_both, insert_from_string)
417 (insert_from_string_before_markers, insert_from_string_1)
418 (insert_from_gap, insert_from_buffer, insert_from_buffer_1)
419 (adjust_after_replace, adjust_after_insert, replace_range)
420 (replace_range_2, del_range, del_range_1, del_range_byte)
421 (del_range_both, del_range_2, modify_region)
422 (prepare_to_modify_buffer, signal_before_change)
423 (signal_after_change, Fcombine_after_change_execute):
424 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
425 * intervals.c (traverse_intervals, rotate_right, rotate_left)
426 (balance_an_interval, split_interval_right, split_interval_left)
427 (find_interval, next_interval, update_interval)
428 (adjust_intervals_for_insertion, delete_node, delete_interval)
429 (interval_deletion_adjustment, adjust_intervals_for_deletion)
430 (static_offset_intervals, offset_intervals)
431 (merge_interval_right, merge_interval_left, make_new_interval)
432 (graft_intervals_into_buffer, temp_set_point_both)
433 (temp_set_point, set_point, adjust_for_invis_intang)
434 (set_point_both, move_if_not_intangible, get_property_and_range)
435 (get_local_map, copy_intervals, copy_intervals_to_string)
436 (compare_string_intervals, set_intervals_multibyte_1):
437 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
438 * intervals.h: Adjust decls to match defn changes elsewhere.
439 (struct interval):
440 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
441 * keyboard.c (this_command_key_count, this_single_command_key_start)
442 (before_command_key_count, before_command_echo_length, echo_now)
443 (echo_length, recursive_edit_1, Frecursive_edit, Ftrack_mouse)
444 (command_loop_1, safe_run_hooks, read_char, timer_check_2)
445 (menu_item_eval_property, read_key_sequence, Fread_key_sequence)
446 (Fread_key_sequence_vector, Fexecute_extended_command, Fsuspend_emacs):
447 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
448 (last_non_minibuf_size, last_point_position, echo_truncate)
449 (command_loop_1, adjust_point_for_property, read_char, gen_help_event)
450 (make_lispy_position, make_lispy_event, parse_modifiers_uncached)
451 (parse_modifiers, modify_event_symbol, Fexecute_extended_command)
452 (stuff_buffered_input):
453 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
454 (last_auto_save, command_loop_1, read_char):
455 Use EMACS_INT, not int, to avoid integer overflow.
456 (record_char): Avoid overflow in total_keys computation.
457 (parse_modifiers_uncached): Redo index calculation to avoid overflow.
458 * keyboard.h: Adjust decls to match defn changes elsewhere.
459 * keymap.c (Fdefine_key, Fcurrent_active_maps, accessible_keymaps_1)
460 (Fkey_description, Fdescribe_vector, Flookup_key):
461 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
462 (click_position): New function, to check that positions are in range.
463 (Fcurrent_active_maps):
464 (describe_command):
465 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
466 (Faccessible_keymaps, Fkey_description):
467 (preferred_sequence_p):
468 Don't assume fixnum can fit into int.
469 (Fkey_description): Use SAFE_ALLOCA_LISP, not alloca.
470 Check for integer overflow in size calculations.
471 (Ftext_char_description): Use CHECK_CHARACTER, not CHECK_NUMBER, to
472 avoid mishandling large integers.
473 * lisp.h: Adjust decls to match defn changes elsewhere.
474 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, struct Lisp_String)
475 (struct vectorlike_header, struct Lisp_Subr, struct Lisp_Hash_Table)
476 (struct Lisp_Marker):
477 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
478 (clip_to_bounds): Now an inline function, moved here from editfns.c.
d311d28c
PE
479 (GLYPH_CODE_P): Check for overflow in system types, subsuming the
480 need for GLYPH_CODE_CHAR_VALID_P and doing proper checking ourselves.
481 All callers changed.
482 (GLYPH_CODE_CHAR, GLYPH_CODE_FACE):
483 Assume the arg has valid form, since it always does.
484 (TYPE_RANGED_INTEGERP): Avoid bug when checking against a wide
485 unsigned integer system type.
486 (CHECK_RANGED_INTEGER, CHECK_TYPE_RANGED_INTEGER): New macros.
487 (struct catchtag, specpdl_size, SPECPDL_INDEX, USE_SAFE_ALLOCA):
488 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
489 (struct catchtag): Use EMACS_INT, not int, since it may be a fixnum.
490 (duration_to_sec_usec): New decl.
491 * lread.c (read_from_string_index, read_from_string_index_byte)
492 (read_from_string_limit, readchar, unreadchar, openp)
493 (read_internal_start, read1, oblookup):
494 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
495 (Fload, readevalloop, Feval_buffer, Feval_region):
496 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
497 (openp): Check for out-of-range argument to 'access'.
498 (read1): Use int, not EMACS_INT, where int is wide enough.
499 Don't assume fixnum fits into int.
6efdadfd 500 Fix off-by-one error that can read outside a buffer.
1ab7b8ac
PE
501 (read_filtered_event): Use duration_to_sec_usec
502 to do proper overflow checking on durations.
d311d28c
PE
503 * macros.c (Fstart_kbd_macro): Use xpalloc to check for overflow
504 in size calculation.
505 (Fexecute_kbd_macro):
506 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
507 * marker.c (cached_charpos, cached_bytepos, CONSIDER)
508 (byte_char_debug_check, buf_charpos_to_bytepos, verify_bytepos)
509 (buf_bytepos_to_charpos, Fset_marker, set_marker_restricted)
510 (set_marker_both, set_marker_restricted_both, marker_position)
511 (marker_byte_position, Fbuffer_has_markers_at):
512 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
513 (Fset_marker, set_marker_restricted): Don't assume fixnum fits in int.
514 * menu.c (ensure_menu_items): Renamed from grow_menu_items.
515 It now merely ensures that the menu is large enough, without
516 necessarily growing it, as this avoids some integer overflow issues.
517 All callers changed.
518 (keymap_panes, parse_single_submenu, Fx_popup_menu):
519 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
520 (parse_single_submenu, Fx_popup_menu): Don't assume fixnum fits in int.
521 Use SAFE_ALLOCA_LISP, not alloca.
522 (find_and_return_menu_selection): Avoid unnecessary casts of pointers
523 to EMACS_INT. Check that fixnums are in proper range for system types.
524 * minibuf.c (minibuf_prompt_width, string_to_object)
525 (Fminibuffer_contents, Fminibuffer_contents_no_properties)
526 (Fminibuffer_completion_contents, Ftry_completion, Fall_completions):
527 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
528 (get_minibuffer, read_minibuf_unwind):
529 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
530 (read_minibuf): Omit unnecessary arg BACKUP_N, which is always nil;
531 this simplifies overflow checking. All callers changed.
532 (read_minibuf, Fread_buffer, Ftry_completion, Fall_completions)
533 (Ftest_completion):
534 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
535 * nsfns.m (check_ns_display_info): Don't assume fixnum fits in long.
536 (x_set_menu_bar_lines, x_set_tool_bar_lines, Fx_create_frame):
537 Check that fixnums are in proper range for system types.
538 (Fx_create_frame, Fx_show_tip):
539 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
540 * nsfont.m (ns_findfonts, nsfont_list_family):
541 Don't assume fixnum fits in long.
542 * nsmenu.m (ns_update_menubar, ns_menu_show, ns_popup_dialog):
543 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
544 (ns_update_menubar): Use intptr_t, not EMACS_INT, when intptr_t is
545 wide enough.
17fdb222 546 * nsselect.m (ns_get_local_selection, clean_local_selection_data):
d311d28c
PE
547 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
548 * print.c (print_buffer_size, print_buffer_pos, print_buffer_pos_byte)
549 (PRINTDECLARE, PRINTPREPARE):
550 (strout, print_string):
551 (print, print_preprocess, print_check_string_charset_prop)
552 (print_object):
553 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
554 (PRINTDECLARE):
555 (temp_output_buffer_setup, Fprin1_to_string, print_object):
556 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
557 (PRINTPREPARE): Use int, not ptrdiff_t, where int is wide enough.
d311d28c 558 (printchar, strout): Use xpalloc to catch size calculation overflow.
0fd11aa5 559 (Fexternal_debugging_output): Don't overflow EMACS_INT->int conversion.
d311d28c
PE
560 (print_error_message): Use SAFE_ALLOCA, not alloca.
561 (print_object): Use int, not EMACS_INT, where int is wide enough.
562 * process.c (Fdelete_process): Don't assume pid fits into EMACS_INT.
563 (Fset_process_window_size, Fformat_network_address)
564 (get_lisp_to_sockaddr_size, set_socket_option, Fmake_network_process)
d44287d4 565 (sigchld_handler):
d311d28c 566 Check that fixnums are in proper range for system types.
d44287d4 567 (Fsignal_process): Simplify by avoiding a goto.
d83cf4cc
PE
568 Check for process-ids out of pid_t range rather than relying on
569 undefined behavior.
d311d28c
PE
570 (Fformat_network_address, read_process_output, send_process)
571 (Fprocess_send_region, status_notify):
572 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
573 (Fformat_network_address, Fmake_serial_process, Fmake_network_process)
574 (wait_reading_process_output, read_process_output, exec_sentinel):
575 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
576 (conv_lisp_to_sockaddr): Don't assume fixnums fit into int.
577 (Faccept_process_output): Use duration_to_sec_usec to do proper
578 overflow checking on durations.
dde14581
PE
579 (emacs_get_tty_pgrp, Fprocess_running_child_p, process_send_signal):
580 Don't assume pid_t fits in int.
b62b53e8
PE
581 * puresize.h (PURESIZE_RATIO): Shrink this to 8/6 on 32-bit hosts
582 configured --with-wide-int.
d311d28c
PE
583 * scroll.c (calculate_scrolling, calculate_direct_scrolling)
584 (line_ins_del): Use int, not EMACS_INT, where int is wide enough.
585 * search.c (looking_at_1, string_match_1):
586 (fast_string_match, fast_c_string_match_ignore_case)
587 (fast_string_match_ignore_case, fast_looking_at, scan_buffer)
588 (scan_newline, find_before_next_newline, search_command)
589 (trivial_regexp_p, search_buffer, simple_search, boyer_moore)
590 (set_search_regs, wordify):
591 (Freplace_match):
592 (Fmatch_data):
593 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
594 (string_match_1, search_buffer, set_search_regs):
595 (Fmatch_data):
596 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
597 (wordify): Check for overflow in size calculation.
598 (Freplace_match): Avoid potential buffer overflow in search_regs.start.
599 (Fset_match_data): Don't assume fixnum fits in ptrdiff_t.
600 Check that fixnums are in proper range for system types.
601 * sound.c (struct sound_device)
602 (wav_play, au_play, vox_write, alsa_period_size, alsa_write):
603 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
604 (Fplay_sound_internal):
605 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
eacd378d 606 * syntax.c (struct lisp_parse_state, find_start_modiff)
d311d28c
PE
607 (Finternal_describe_syntax_value, scan_lists, scan_sexps_forward):
608 (Fparse_partial_sexp):
609 Don't assume fixnums can fit in int.
610 (struct lisp_parse_state, find_start_pos, find_start_value)
611 (find_start_value_byte, find_start_begv)
612 (update_syntax_table, char_quoted, dec_bytepos)
613 (find_defun_start, prev_char_comend_first, back_comment):
614 (scan_words, skip_chars, skip_syntaxes, forw_comment, Fforward_comment)
615 (scan_lists, Fbackward_prefix_chars, scan_sexps_forward):
616 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
617 (Finternal_describe_syntax_value): Check that match_lisp is a
618 character, not an integer, since the code stuffs it into int.
619 (scan_words, scan_sexps_forward):
620 Check that fixnums are in proper range for system types.
621 (Fforward_word):
622 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
623 (scan_sexps_forward):
624 Use CHARACTERP, not INTEGERP, since the value must fit into int.
625 (Fparse_partial_sexp): Fix doc; element 8 is not ignored.
626 * syntax.h: Adjust decls to match defn changes elsewhere.
627 (struct gl_state_s):
628 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
629 * sysdep.c (wait_for_termination_1, wait_for_termination)
630 (interruptible_wait_for_termination, mkdir):
631 Don't assume pid_t fits in int; on 64-bit AIX pid_t is 64-bit.
632 (emacs_read, emacs_write):
633 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
225a2cff
PE
634 (system_process_attributes): Don't assume uid_t, gid_t, EMACS_INT,
635 and double all fit in int.
d311d28c
PE
636 * term.c (set_tty_color_mode):
637 Check that fixnums are in proper range for system types.
638 * termhooks.h (struct input_event):
639 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
640 * textprop.c (validate_interval_range, interval_of)
641 (Fadd_text_properties, set_text_properties_1)
642 (Fremove_text_properties, Fremove_list_of_text_properties)
643 (Ftext_property_any, Ftext_property_not_all)
644 (copy_text_properties, text_property_list, extend_property_ranges)
645 (verify_interval_modification):
646 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
647 (Fnext_single_char_property_change)
648 (Fprevious_single_char_property_change):
649 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5895d7b9
PE
650 (copy_text_properties):
651 Check for integer overflow in index calculation.
d311d28c
PE
652 * undo.c (last_boundary_position, record_point, record_insert)
653 (record_delete, record_marker_adjustment, record_change)
654 (record_property_change):
655 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
656 (truncate_undo_list, Fprimitive_undo): Don't assume fixnum fits in int.
657 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
658 * w32fns.c (Fx_create_frame, x_create_tip_frame, Fx_show_tip)
659 (Fx_hide_tip, Fx_file_dialog):
660 * w32menu.c (set_frame_menubar):
661 Use ptrdiff_t, not int, for consistency with rest of code.
662 * window.c (window_scroll_preserve_hpos, window_scroll_preserve_vpos)
663 (select_window, Fdelete_other_windows_internal)
664 (window_scroll_pixel_based, window_scroll_line_based)
665 (Frecenter, Fset_window_configuration):
666 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
667 (Fset_window_hscroll, run_window_configuration_change_hook)
668 (set_window_buffer, temp_output_buffer_show, scroll_command)
5895d7b9 669 (Fscroll_other_window, Frecenter):
d311d28c
PE
670 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
671 (Fwindow_line_height, window_scroll, Fscroll_left, Fscroll_right):
672 Don't assume fixnum fits in int.
673 (Fset_window_scroll_bars):
674 Check that fixnums are in proper range for system types.
675 * xdisp.c (help_echo_pos, pos_visible_p, string_pos_nchars_ahead)
676 (string_pos, c_string_pos, number_of_chars, init_iterator)
677 (in_ellipses_for_invisible_text_p, init_from_display_pos)
678 (compute_stop_pos, next_overlay_change, compute_display_string_pos)
679 (compute_display_string_end, handle_face_prop)
5895d7b9
PE
680 (face_before_or_after_it_pos, handle_invisible_prop)
681 (handle_display_prop, handle_display_spec, handle_single_display_spec)
d311d28c
PE
682 (display_prop_intangible_p, string_buffer_position_lim)
683 (string_buffer_position, handle_composition_prop, load_overlay_strings)
684 (get_overlay_strings_1, get_overlay_strings)
685 (iterate_out_of_display_property, forward_to_next_line_start)
686 (back_to_previous_visible_line_start, reseat, reseat_to_string)
687 (get_next_display_element, set_iterator_to_next)
688 (get_visually_first_element, compute_stop_pos_backwards)
689 (handle_stop_backwards, next_element_from_buffer)
690 (move_it_in_display_line_to, move_it_in_display_line)
691 (move_it_to, move_it_vertically_backward, move_it_by_lines)
692 (add_to_log, message_dolog, message_log_check_duplicate)
693 (message2, message2_nolog, message3, message3_nolog
694 (with_echo_area_buffer, display_echo_area_1, resize_mini_window_1)
695 (current_message_1, truncate_echo_area, truncate_message_1)
696 (set_message, set_message_1, store_mode_line_noprop)
697 (hscroll_window_tree, debug_delta, debug_delta_bytes, debug_end_vpos)
698 (text_outside_line_unchanged_p, check_point_in_composition)
699 (reconsider_clip_changes)
700 (redisplay_internal, set_cursor_from_row, try_scrolling)
701 (try_cursor_movement, set_vertical_scroll_bar, redisplay_window)
702 (redisplay_window, find_last_unchanged_at_beg_row)
703 (find_first_unchanged_at_end_row, row_containing_pos, try_window_id)
704 (trailing_whitespace_p, find_row_edges, display_line)
705 (RECORD_MAX_MIN_POS, Fcurrent_bidi_paragraph_direction)
706 (display_mode_element, store_mode_line_string)
707 (pint2str, pint2hrstr, decode_mode_spec)
708 (display_count_lines, display_string, draw_glyphs)
709 (x_produce_glyphs, x_insert_glyphs)
710 (rows_from_pos_range, mouse_face_from_buffer_pos)
711 (fast_find_string_pos, mouse_face_from_string_pos)
712 (note_mode_line_or_margin_highlight, note_mouse_highlight):
713 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
714 (safe_call, init_from_display_pos, handle_fontified_prop)
715 (handle_single_display_spec, load_overlay_strings)
716 (with_echo_area_buffer, setup_echo_area_for_printing)
717 (display_echo_area, echo_area_display)
718 (x_consider_frame_title, prepare_menu_bars, update_menu_bar)
719 (update_tool_bar, hscroll_window_tree, redisplay_internal)
5895d7b9
PE
720 (redisplay_window, dump_glyph_row, display_mode_line)
721 (Fformat_mode_line, decode_mode_spec, on_hot_spot_p):
43ad2e9a 722 (handle_display_spec, display_prop_string_p):
d311d28c
PE
723 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
724 (handle_single_display_spec, build_desired_tool_bar_string)
725 (redisplay_tool_bar, scroll_window_tree, Fdump_glyph_matrix)
726 (get_specified_cursor_type):
727 Check that fixnums are in proper range for system types.
728 (struct overlay_entry, resize_mini_window, Fdump_glyph_row)
729 (Flookup_image_map):
730 Don't assume fixnums fit in int.
731 (compare_overlay_entries):
732 Avoid mishandling comparisons due to subtraction overflow.
733 (load_overlay_strings): Use SAFE_NALLOCA, not alloca.
734 (last_escape_glyph_face_id, last_glyphless_glyph_face_id):
735 (handle_tool_bar_click):
736 Use int, not unsigned, since we prefer signed and the signedness
737 doesn't matter here.
738 (get_next_display_element, next_element_from_display_vector):
739 Use int, not EMACS_INT, when int is wide enough.
740 (start_hourglass): Use duration_to_sec_usec to do proper
741 overflow checking on durations.
742 * xfaces.c (Fbitmap_spec_p):
743 Check that fixnums are in proper range for system types.
744 (compare_fonts_by_sort_order):
745 Avoid mishandling comparisons due to subtraction overflow.
746 (Fx_family_fonts, realize_basic_faces):
747 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
748 (Fx_family_fonts):
749 Don't assume fixnum fits in int.
750 Use SAFE_ALLOCA_LISP, not alloca.
751 (merge_face_heights): Remove unnecessary cast to EMACS_INT.
752 (Finternal_make_lisp_face): Don't allocate more than MAX_FACE_ID.
753 (face_at_buffer_position, face_for_overlay_string)
754 (face_at_string_position):
755 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
756 (merge_faces): Use int, not EMACS_INT, where int is wide enough.
757 * xfns.c (x_set_menu_bar_lines, x_set_tool_bar_lines, x_icon_verify)
758 (Fx_show_tip):
759 Check that fixnums are in proper range for system types.
760 (Fx_create_frame, x_create_tip_frame, Fx_show_tip)
761 (Fx_hide_tip, Fx_file_dialog, Fx_select_font):
762 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
763 (Fx_change_window_property): Don't assume fixnums fit in int.
764 * xfont.c (xfont_chars_supported):
765 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
766 * xmenu.c (Fx_popup_dialog, set_frame_menubar)
767 (create_and_show_popup_menu, create_and_show_dialog, xmenu_show):
768 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
769 * xml.c (parse_region):
770 * xrdb.c (magic_file_p):
771 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
772 * xselect.c (TRACE1): Don't assume pid_t promotes to int.
773 (x_get_local_selection, x_reply_selection_request)
774 (x_handle_selection_request, wait_for_property_change):
775 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
776 (selection_data_to_lisp_data): Use short, not EMACS_INT, where
777 short is wide enough.
778 (x_send_client_event): Don't assume fixnum fits in int.
779 * xterm.c (x_x_to_emacs_modifiers):
780 Don't assume EMACS_INT overflows nicely into int.
781 (x_emacs_to_x_modifiers): Use EMACS_INT, not int, because values
782 may come from Lisp.
783 (handle_one_xevent): NATNUMP can eval its arg twice.
784 (x_connection_closed):
785 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
786 * xterm.h: Adjust decls to match defn changes elsewhere.
787 (struct scroll_bar): Use struct vectorlike_header
788 rather than rolling our own approximation.
789 (SCROLL_BAR_VEC_SIZE): Remove; not used.
790
935396c0
GM
7912012-04-09 Glenn Morris <rgm@gnu.org>
792
05920a43
GM
793 * doc.c (Fsnarf_documentation): Check variables, functions are bound,
794 not just in the obarray, before snarfing them. (Bug#11036)
795
935396c0
GM
796 * Makefile.in ($(leimdir)/leim-list.el):
797 Pass EMACS rather than BUILT_EMACS.
798
a18ecafa
TZ
7992012-04-09 Teodor Zlatanov <tzz@lifelogs.com>
800
801 * process.c (make_process):
802 * process.h: Add integer `gnutls_handshakes_tried' member to
803 process struct.
804
805 * gnutls.h: Add `GNUTLS_EMACS_HANDSHAKES_LIMIT' upper limit. Add
806 convenience `GNUTLS_LOG2i' macro.
807
808 * gnutls.c (gnutls_log_function2i): Convenience log function.
809 (emacs_gnutls_read): Use new log functions,
810 `gnutls_handshakes_tried' process member, and
811 `GNUTLS_EMACS_HANDSHAKES_LIMIT' to limit the number of handshake
812 attempts per process (connection).
813
b4d3bc10
CY
8142012-04-09 Chong Yidong <cyd@gnu.org>
815
816 * eval.c (Fuser_variable_p, user_variable_p_eh)
817 (lisp_indirect_variable): Functions deleted.
818 (Fdefvar): Caller changed.
819
820 * callint.c (Finteractive, Fcall_interactively):
821 * minibuf.c (Fread_variable): Callers changed.
822
70f4d973
EZ
8232012-04-09 Eli Zaretskii <eliz@gnu.org>
824
825 * xdisp.c (set_cursor_from_row): If the display string appears in
826 the buffer at position that is closer to point than the position
827 after the display string, display the cursor on the first glyph of
828 the display string. Fixes cursor display when a 'display' text
829 property immediately follows invisible text. (Bug#11094)
830
cb3c2e3e
PE
8312012-04-09 Paul Eggert <eggert@cs.ucla.edu>
832
833 composite.c: use 'double' consistently
834 * composite.c (get_composition_id): Use 'double' consistently
835 instead of converting 'float' to 'double' and vice versa; this is
836 easier to understand and avoids a GCC warning.
837
fd06db5d
GM
8382012-04-09 Glenn Morris <rgm@gnu.org>
839
50fe702a
GM
840 * Makefile.in: Generate leim-list with bootstrap-emacs, in
841 preparation for dumping it with emacs. (Bug#4789)
842 (leimdir): New variable.
843 ($(leimdir)/leim-list.el): New rule.
844 (emacs$(EXEEXT)): Depend on leim-list.el.
845
fd06db5d
GM
846 * buffer.c (Qucs_set_table_for_input): Remove. (Bug#9821)
847 (Fget_buffer_create): Don't call Qucs_set_table_for_input.
848 (init_buffer_once, syms_of_buffer): Remove Qucs_set_table_for_input.
849
55c131ee
AS
8502012-04-08 Andreas Schwab <schwab@linux-m68k.org>
851
852 * lisp.h (struct Lisp_Symbol): Add explicit padding to ensure
853 proper alignment.
854
9209588f
JB
8552012-04-07 Juanma Barranquero <lekktu@gmail.com>
856
857 * xml.c (init_libxml2_functions) [WINDOWSNT]:
858 Remove unused local variable.
859
e3fb2efb
PE
8602012-04-07 Paul Eggert <eggert@cs.ucla.edu>
861
862 Avoid unnecessary pointer scanning in garbage collection (Bug#10780).
863 * alloc.c (POINTERS_MIGHT_HIDE_IN_OBJECTS): New macro.
864 (mark_memory): Mark Lisp_Objects only if pointers might hide in
865 objects, as mark_maybe_pointer will catch them otherwise.
866 (GC_LISP_OBJECT_ALIGNMENT): Remove; no longer needed.
867 * s/gnu-linux.h (GC_LISP_OBJECT_ALIGNMENT) [__mc68000__]: Likewise.
868
b5385551
PE
8692012-04-07 Paul Eggert <eggert@cs.ucla.edu>
870
871 Fix typo that broke non-Windows builds.
872 * xml.c (libxml2_loaded_p) [!!WINDOWSNT]: 'inine' -> 'inline'.
873
9078ead6
EZ
8742012-04-07 Eli Zaretskii <eliz@gnu.org>
875
876 Support building on MS-Windows with libxml2.
877
878 * makefile.w32-in (OBJ2): Add xml.$(O).
879 (GLOBAL_SOURCES): Add xml.c.
880 ($(BLD)/xml.$(O)): New dependency list.
881
882 * xml.c (DEF_XML2_FN, LOAD_XML2_FN) [WINDOWSNT]: New macros.
883 (fn_htmlReadMemory, fn_xmlReadMemory, fn_xmlDocGetRootElement)
884 (fn_xmlFreeDoc, fn_xmlCleanupParser, fn_xmlCheckVersion)
885 [!WINDOWSNT]: New macros.
886 (init_libxml2_functions, libxml2_loaded_p): New functions.
887 (parse_region): Call fn_xmlCheckVersion instead of using the macro
888 LIBXML_TEST_VERSION. Call libxml2 functions via the fn_* macros.
889 (xml_cleanup_parser): New function, export for fn_xmlCleanupParser.
890 Calls xmlCleanupParser only if libxml2 was loaded (or statically
891 linked in).
892 (Flibxml_parse_html_region, Flibxml_parse_xml_region): Call
893 init_libxml2_functions before calling libxml2 functions.
894 (syms_of_xml) <Qlibxml2_dll>: DEFSYM it.
895
896 * emacs.c: Don't include libxml/parser.h.
897 (shut_down_emacs): Call xml_cleanup_parser, instead of calling
898 xmlCleanupParser directly.
899
900 * lisp.h [HAVE_LIBXML2]: Add prototype for xml_cleanup_parser.
901
3811fdf3
EZ
9022012-04-07 Eli Zaretskii <eliz@gnu.org>
903
904 * indent.c (Fvertical_motion): If there is a display string at
905 point, use it.vpos to compute how many lines to backtrack after
906 move_it_to point. (Bug#11133)
907
2f8e16b2
EZ
9082012-04-06 Eli Zaretskii <eliz@gnu.org>
909
910 * buffer.h (FETCH_CHAR, FETCH_MULTIBYTE_CHAR):
911 * character.h (STRING_CHAR, STRING_CHAR_AND_LENGTH): Add comments
912 about subtle differences between FETCH_CHAR* and STRING_CHAR*
913 macros related to unification of CJK characters. For the details,
914 see the discussion following the message here:
915 http://debbugs.gnu.org/cgi/bugreport.cgi?bug=11073#14.
916
3d439cd1
CY
9172012-04-04 Chong Yidong <cyd@gnu.org>
918
919 * keyboard.c (Vdelayed_warnings_list): Doc fix.
920
8bc53d00
EZ
9212012-04-01 Eli Zaretskii <eliz@gnu.org>
922
923 * w32menu.c (simple_dialog_show, add_menu_item): Use SAFE_ALLOCA
924 instead of alloca. (Bug#11138)
925
3b0512a3
AS
9262012-04-01 Andreas Schwab <schwab@linux-m68k.org>
927
928 * w32menu.c (is_simple_dialog): Properly check lisp types.
929 (Bug#11141)
930
8427ddd2
EZ
9312012-03-31 Eli Zaretskii <eliz@gnu.org>
932
979022ef
EZ
933 * xdisp.c (move_it_by_lines): When DVPOS is positive, and the
934 position we get to after a call to move_it_to fails the
935 IS_POS_VALID_AFTER_MOVE_P test, move to the next buffer position
936 only if we wind up in a string from display property. (Bug#11063)
937
a6b1c7cc
EZ
938 * window.c (Fdelete_other_windows_internal): Invalidate the row
939 and column information about mouse highlight, so that redisplay
940 restores it after reallocating the glyph matrices. (Bug#7464)
941
8427ddd2
EZ
942 * xdisp.c (set_cursor_from_row): If `cursor' property on a display
943 string comes from a `display' text property, use the buffer
944 position of that property as if we actually saw that position in
945 the row's glyphs.
697ba24b
EZ
946 (move_it_by_lines): Remove the assertion that
947 "it->current_x == 0 && it->hpos == 0" which can be legitimately
948 violated when there's a before-string at the beginning of a line.
949 (Bug#11063)
8427ddd2 950
65a0a738
EZ
9512012-03-30 Eli Zaretskii <eliz@gnu.org>
952
953 * xdisp.c (append_space_for_newline): If the default face was
954 remapped, use the remapped face for the appended newline.
955 (extend_face_to_end_of_line): Use the remapped default face for
956 extending the face to the end of the line.
957 (display_line): Call extend_face_to_end_of_line when the default
958 face was remapped. (Bug#11068)
959
581355cc
EZ
9602012-03-29 Eli Zaretskii <eliz@gnu.org>
961
962 * s/ms-w32.h: Discourage from defining HAVE_GETCWD.
963
e8fc049f
SM
9642012-03-28 Stefan Monnier <monnier@iro.umontreal.ca>
965
966 * keyboard.c (safe_run_hooks_error): Don't unquote strings.
967
4fb9a543
GM
9682012-03-27 Glenn Morris <rgm@gnu.org>
969
970 * search.c (Fword_search_backward_lax, Fword_search_forward_lax):
971 Doc fixes.
972
679910f1
KH
9732012-03-26 Kenichi Handa <handa@m17n.org>
974
975 * dispextern.h (struct glyph): Fix previous change. Change the
976 bit length of glyphless.ch to 25 (Bug#11082).
977
90d49b7f
CY
9782012-03-26 Chong Yidong <cyd@gnu.org>
979
980 * keyboard.c (Vselection_inhibit_update_commands): New variable.
981 (command_loop_1): Use it; inhibit selection update for
982 handle-select-window too (Bug#8996).
983
f514f6f0
FP
9842012-03-25 Fabrice Popineau <fabrice.popineau@supelec.fr>
985
e8fc049f 986 * w32heap.c (_heap_init, _heap_term): Remove dead MSVC-specific code.
f514f6f0 987
bf43fa51
KH
9882012-03-25 Kenichi Handa <handa@m17n.org>
989
990 * dispextern.h (struct glyph): Change the bit length of
991 glyphless.ch to 22 to make the member glyphless fit in 32 bits.
992
8a0c01dd
EZ
9932012-03-24 Eli Zaretskii <eliz@gnu.org>
994
995 * s/ms-w32.h (tzname): Include time.h before redirecting to
996 _tzname. Fixes the MSVC build. (Bug#9960)
997
7d1c3a76
AS
9982012-03-24 Andreas Schwab <schwab@linux-m68k.org>
999
8ed79523
AS
1000 * xdisp.c (produce_glyphless_glyph): Limit length of acronym to 6
1001 characters.
1002
7d1c3a76
AS
1003 * xterm.c (XTread_socket): Only modify handling_signal if
1004 !SYNC_INPUT. (Bug#11080)
1005
e99a9b8b
EZ
10062012-03-23 Eli Zaretskii <eliz@gnu.org>
1007
1008 * bidi.c (bidi_fetch_char): Use STRING_CHAR_AND_LENGTH instead of
1009 FETCH_MULTIBYTE_CHAR followed by CHAR_BYTES. Prevents crashes
1010 when fetching a multibyte character consumes more bytes than
1011 CHAR_BYTES returns, due to unification of CJK characters in
1012 string_char. (Bug#11073)
1013
5063c0e1
TN
10142012-03-23 Troels Nielsen <bn.troels@gmail.com> (tiny change)
1015
1016 * process.c (wait_reading_process_output): Handle pty disconnect
1017 by refraining from sending oneself a SIGCHLD (bug#10933).
1018
9f851fbd
CY
10192012-03-22 Chong Yidong <cyd@gnu.org>
1020
1021 * dispextern.h (struct it): New member string_from_prefix_prop_p.
1022
5063c0e1 1023 * xdisp.c (push_prefix_prop): Rename from push_display_prop.
9f851fbd
CY
1024 Mark string as coming from a prefix property.
1025 (handle_face_prop): Use default face for prefix strings (Bug#4281).
1026 (pop_it, reseat_1): Save and restore string_from_prefix_prop_p.
1027
fb5b8aca
CY
10282012-03-21 Chong Yidong <cyd@gnu.org>
1029
1030 * xfaces.c (Vface_remapping_alist): Doc fix.
1031
62356a1b
EZ
10322012-03-20 Eli Zaretskii <eliz@gnu.org>
1033
1034 * w32proc.c (Fw32_set_console_codepage)
5063c0e1
TN
1035 (Fw32_set_console_output_codepage, Fw32_get_codepage_charset):
1036 Doc fixes.
62356a1b 1037
025de85b
CY
10382012-03-20 Chong Yidong <cyd@gnu.org>
1039
1040 * dispnew.c (Fredisplay, Vredisplay_preemption_period): Update doc
1041 to reflect default non-nil value of redisplay-dont-pause.
1042
4827f94e
KH
10432012-03-19 Kenichi Handa <handa@m17n.org>
1044
1045 * ftfont.c (ftfont_drive_otf): Mask bits of character code to make
1046 it fit in a valid range (Bug#11003).
1047
e50a24a2
EZ
10482012-03-18 Eli Zaretskii <eliz@gnu.org>
1049
1050 * xdisp.c (cursor_row_p): Even if the glyph row ends in a string
1051 that is not from display property, accept the row as a "cursor
1052 row" if one of the string's character has a non-nil `cursor'
1053 property. Fixes cursor positioning when there are newlines in
1054 overlay strings, e.g. in icomplete.el. (Bug#11035)
1055
9af5ed87
PE
10562012-03-12 Paul Eggert <eggert@cs.ucla.edu>
1057
1058 * buffer.c (compare_overlays): Don't assume args differ (Bug#6830).
1059
d1f55f16
CY
10602012-03-12 Chong Yidong <cyd@gnu.org>
1061
1062 * eval.c (inhibit_lisp_code): Rename from
1063 inhibit_window_configuration_change_hook; move from window.c.
1064
1065 * xfns.c (unwind_create_frame_1, Fx_create_frame):
1066 * window.c (run_window_configuration_change_hook)
1067 (syms_of_window): Callers changed.
1068
66c5eebd
CY
10692012-03-11 Chong Yidong <cyd@gnu.org>
1070
413df973
CY
1071 * keymap.c (Fkey_description): Doc fix (Bug#9700).
1072
66c5eebd
CY
1073 * editfns.c (Fconstrain_to_field): Doc fix (Bug#9452).
1074
1de11f56
CY
10752012-03-10 Chong Yidong <cyd@gnu.org>
1076
1077 * frame.c (other_visible_frames): Don't assume the selected frame
1078 is visible (Bug#10955).
1079
cae07000
SM
10802012-03-09 Stefan Monnier <monnier@iro.umontreal.ca>
1081
1082 * buffer.c (compare_overlays): Avoid qsort's instability (bug#6830).
1083
89c94350
JD
10842012-03-08 Jan Djärv <jan.h.d@swipnet.se>
1085
1086 * gtkutil.c (x_wm_set_size_hint): Use one row in call to
1087 FRAME_TEXT_LINES_TO_PIXEL_HEIGHT so base_height is greater than
1088 zero (Bug#10954).
1089
999dd333
GM
10902012-03-03 Glenn Morris <rgm@gnu.org>
1091
01a6dcc8 1092 * alloc.c (Fgarbage_collect, misc-objects-consed): Doc fixes.
999dd333 1093
de0100f2
EZ
10942012-03-02 Eli Zaretskii <eliz@gnu.org>
1095
1096 * xdisp.c (try_window_reusing_current_matrix): Don't move cursor
1097 position past the first glyph_row that ends at ZV. (Bug#10902)
b8456c5c
EZ
1098 (redisplay_window, next_element_from_string): Fix typos in
1099 comments.
3e441275
EZ
1100 (redisplay_window): Pass to move_it_vertically the margin in
1101 pixels, not in screen lines.
de0100f2 1102
96a72ee9
GM
11032012-03-02 Glenn Morris <rgm@gnu.org>
1104
1105 * buffer.c (buffer-list-update-hook): Doc fix.
1106
312508d7
EZ
11072012-02-29 Eli Zaretskii <eliz@gnu.org>
1108
1109 * xdisp.c (get_overlay_strings_1): Under bidi redisplay, call
1110 push_it before setting up the iterator for the first overlay
1111 string, even if we have an empty string loaded.
1112 (next_overlay_string): If there's an empty string on the iterator
1113 stack, pop the stack. (Bug#10903)
1114
27f3c637
PE
11152012-02-25 Paul Eggert <eggert@cs.ucla.edu>
1116
1117 Generalize fix for crash due to non-contiguous EMACS_INT (Bug#10780).
1118 Suggested by Stefan Monnier in
1119 <http://lists.gnu.org/archive/html/emacs-devel/2012-02/msg00692.html>.
1120 * alloc.c (widen_to_Lisp_Object): New static function.
1121 (mark_memory): Also mark Lisp_Objects by fetching pointer words
1122 and widening them to Lisp_Objects. This would work even if
1123 USE_LSB_TAG is defined and wide integers are used, which might
1124 happen in a future version of Emacs.
1125
3c9dfce6
CY
11262012-02-25 Chong Yidong <cyd@gnu.org>
1127
fa74b241
CY
1128 * fileio.c (Ffile_selinux_context, Fset_file_selinux_context):
1129 Doc fix.
1130
3c9dfce6
CY
1131 * xselect.c (Fx_selection_exists_p): Doc fix.
1132 (x_clipboard_manager_save_all): Print an informative message
1133 before saving to clipboard manager.
1134
9486df08
CY
11352012-02-24 Chong Yidong <cyd@gnu.org>
1136
1137 * keyboard.c (process_special_events): Handle all X selection
1138 requests in kbd_buffer, not just the next one (Bug#8869).
1139
f01d3321
CY
11402012-02-23 Chong Yidong <cyd@gnu.org>
1141
1142 * xfns.c (Fx_create_frame): Avoid window-configuration-change-hook
1143 call when setting menu-bar-lines and tool-bar-lines parameters.
1144 (unwind_create_frame_1): New helper function.
1145
1146 * window.c (inhibit_window_configuration_change_hook): New var.
1147 (run_window_configuration_change_hook): Obey it.
b2e4ca7d 1148 (syms_of_window): Initialize it.
f01d3321 1149
86b847b6
CY
11502012-02-22 Chong Yidong <cyd@gnu.org>
1151
1152 * xterm.c (x_draw_image_relief): Add missing type check for
1153 Vtool_bar_button_margin (Bug#10743).
1154
a59225b1
CY
11552012-02-21 Chong Yidong <cyd@gnu.org>
1156
1157 * fileio.c (Vfile_name_handler_alist): Doc fix.
1158
1159 * buffer.c (Fget_file_buffer): Protect against invalid file
1160 handler return value.
1161
310f5bd4
PE
11622012-02-20 Paul Eggert <eggert@cs.ucla.edu>
1163
cb3a28cc
PE
1164 * .gdbinit (xreload): Don't assume EMACS_INT fits in 'long'
1165 when computing $valmask.
1166
310f5bd4
PE
1167 Fix crash due to non-contiguous EMACS_INT (Bug#10780).
1168 * lisp.h (VALBITS): Move definition up, so that USE_LSB_TAG can use it.
1169 (USE_LSB_TAG): Do not define if UINTPTR_MAX >> VALBITS == 0.
1170 It's useless in that case, and it can cause problems on hosts
1171 that allocate halves of EMACS_INT values separately.
1172 Reported by Dan Horák. Diagnosed by Andreas Schwab in
1173 <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=10780#30>.
1174 * mem-limits.h (EXCEEDS_LISP_PTR): Define to 0 on hosts where
1175 UINTPTR_MAX >> VALBITS == 0. This is required by the above change;
1176 it avoids undefined behavior on hosts where shifting right by more
1177 than the word width has undefined behavior.
1178
2375c96a
CY
11792012-02-19 Chong Yidong <cyd@gnu.org>
1180
1181 * fileio.c (Ffile_name_directory, Ffile_name_nondirectory)
1182 (Funhandled_file_name_directory, Ffile_name_as_directory)
1183 (Fdirectory_file_name, Fexpand_file_name)
1184 (Fsubstitute_in_file_name): Protect against invalid file handler
1185 return values (Bug#10845).
1186
3eb49e71
EZ
11872012-02-18 Eli Zaretskii <eliz@gnu.org>
1188
1189 * .gdbinit (pitx): Fix incorrect references to fields of the
1190 iterator stack.
1191
7b926f3f
CY
11922012-02-17 Chong Yidong <cyd@gnu.org>
1193
1194 * syntax.c (Fscan_lists): Doc fix (Bug#10833).
1195
11273115
PE
11962012-02-15 Paul Eggert <eggert@cs.ucla.edu>
1197
1198 * image.c (MAX_IMAGE_SIZE): Increase from 6.0 to 10.0; see
1199 <http://lists.gnu.org/archive/html/emacs-devel/2012-02/msg00540.html>.
1200
c3a70e2b
CY
12012012-02-15 Chong Yidong <cyd@gnu.org>
1202
1203 * eval.c (Fdefvar, Fdefconst): Doc fix; note that the variable is
1204 marked as special. Also, starting docstrings with * is obsolete.
1205
0ca43699
AS
12062012-02-13 Andreas Schwab <schwab@linux-m68k.org>
1207
1208 * gnutls.c (emacs_gnutls_write): Fix last change.
1209
2e8f3c56
LI
12102012-02-13 Lars Ingebrigtsen <larsi@gnus.org>
1211
1212 * gnutls.c (emacs_gnutls_write): Set errno appropriately for
1213 send_process.
1214
af70074f
SM
12152012-02-13 Stefan Monnier <monnier@iro.umontreal.ca>
1216
1217 * keymap.c (Fsingle_key_description): Handle char ranges.
1218
95986d52
CY
12192012-02-12 Chong Yidong <cyd@gnu.org>
1220
afd83bd1
CY
1221 * xdisp.c (handle_stop): Avoid assigning -1 to it->face_id here,
1222 as that creates a dangerous corner case.
1223
95986d52
CY
1224 * window.c (Fdelete_window_internal): Invalidate the mouse
1225 highlight (Bug#9904).
1226
bd7da63e
GM
12272012-02-12 Glenn Morris <rgm@gnu.org>
1228
1229 * xselect.c (Fx_own_selection_internal)
1230 (Fx_get_selection_internal, Fx_disown_selection_internal)
1231 (Fx_selection_owner_p, Fx_selection_exists_p): Doc fixes.
1232 * nsselect.m (Fx_own_selection_internal)
1233 (Fx_disown_selection_internal, Fx_selection_exists_p)
1234 (Fx_selection_owner_p, Fx_get_selection_internal):
1235 Sync docs and argument specs with the xselect.c versions.
1236
77abcbc2
LI
12372012-02-11 Lars Ingebrigtsen <larsi@gnus.org>
1238
1239 * gnutls.c (emacs_gnutls_write): Don't infloop if sendto fails.
1240
90b671e2
EZ
12412012-02-11 Eli Zaretskii <eliz@gnu.org>
1242
1c0ca0b7
EZ
1243 * w32select.c (Fx_selection_exists_p): Sync doc string and
1244 argument list with xselect.c. (Bug#10783)
1245
1246 * w16select.c (Fx_selection_exists_p): Sync doc string and
1247 argument list with xselect.c. (Bug#10783)
90b671e2 1248
49241268
GM
12492012-02-10 Glenn Morris <rgm@gnu.org>
1250
1251 * fns.c (Fsecure_hash): Doc fix.
1252
f998bbe7 12532012-02-09 Kenichi Handa <handa@m17n.org>
5c1ca13d
KH
1254
1255 * coding.c (produce_chars): Fix updating of src_end (Bug#10701).
1256
0992bd9c
CY
12572012-02-07 Chong Yidong <cyd@gnu.org>
1258
1259 * buffer.c (Fbuffer_local_variables)
1260 (buffer_lisp_local_variables): Handle unbound vars correctly;
1261 don't let Qunbound leak into Lisp.
1262
af008560
GM
12632012-02-07 Glenn Morris <rgm@gnu.org>
1264
dd605cc4
GM
1265 * image.c (Fimagemagick_types): Doc fix.
1266
af008560
GM
1267 * image.c (imagemagick-render-type): Change it from a lisp object
1268 to an integer. Move the doc here from the lisp manual.
1269 Treat all values not equal to 0 the same.
1270
1449fa1d
CY
12712012-02-06 Chong Yidong <cyd@gnu.org>
1272
1273 * doc.c (store_function_docstring): Avoid applying docstring of
1274 alias to base function (Bug#2603).
1275
3723ec07
AS
12762012-02-04 Andreas Schwab <schwab@linux-m68k.org>
1277
1278 * .gdbinit (pp1, pv1): Remove redundant defines.
1279 (pr): Use pp.
1280
79c1cc1e
CY
12812012-02-04 Chong Yidong <cyd@gnu.org>
1282
1283 * nsterm.m: Declare a global (Bug#10694).
1284
d7f29f8e
EZ
12852012-02-04 Eli Zaretskii <eliz@gnu.org>
1286
cae07000
SM
1287 * w32.c (get_emacs_configuration_options):
1288 Include --enable-checking, if specified, in the return value.
d7f29f8e 1289
3b95a6f9
MR
12902012-02-04 Martin Rudalics <rudalics@gmx.at>
1291
1292 * dispnew.c (change_frame_size_1): Calculate new_frame_total_cols
1293 after rounding frame sizes. (Bug#9723)
1294
d6fa96a6
EZ
12952012-02-04 Eli Zaretskii <eliz@gnu.org>
1296
1297 * keyboard.c (adjust_point_for_property): Don't position point
1298 before BEGV. (Bug#10696)
1299
df0b2940
PE
13002012-02-03 Paul Eggert <eggert@cs.ucla.edu>
1301
1302 Handle overflow when computing char display width (Bug#9496).
1303 * character.c (char_width): Return EMACS_INT, not int.
1304 (char_width, c_string_width): Check for overflow when
1305 computing the width; this is possible now that individual
1306 characters can have unbounded width. Problem introduced
1307 by merge from Emacs 23 on 2012-01-19.
1308
6bee44d6
MA
13092012-02-02 Michael Albinus <michael.albinus@gmx.de>
1310
1311 * dbusbind.c (Fdbus_register_method): Mention the return value
1312 :ignore in the docstring.
1313
44f92739
GM
13142012-02-02 Glenn Morris <rgm@gnu.org>
1315
1b9f60cc
GM
1316 * callproc.c (Fcall_process, Fcall_process_region): Doc fix.
1317
44f92739
GM
1318 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
1319 Unconditionally set to t. (Bug#10673)
1320 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
1321 * w32term.c (syms_of_w32term) <x-toolkit-scroll-bars>:
1322 * xterm.c (syms_of_xterm) <x-toolkit-scroll-bars>: Doc fix.
1323
c5d3843c
KH
13242012-02-02 Kenichi Handa <handa@m17n.org>
1325
1326 (x_produce_glyphs): Cancel previous change. If cmp->glyph_len is
1327 0, do not call append_composite_glyph.
1328
159462d4 13292012-02-02 Kenichi Handa <handa@m17n.org>
d2a51fd7
KH
1330
1331 * xdisp.c (BUILD_COMPOSITE_GLYPH_STRING): Initialize first_s to
1332 NULL (Bug#6988).
1333 (x_produce_glyphs): If the component of a composition is a null
1334 string, set it->pixel_width to 1 to avoid zero-width glyph.
1335
78cef877
EZ
13362012-02-01 Eli Zaretskii <eliz@gnu.org>
1337
1338 * ralloc.c (resize_bloc, r_alloc_sbrk): Don't call memmove if its
1339 first 2 arguments are identical. This makes inserting large
1340 output from a subprocess an order of magnitude faster on
1341 MS-Windows, where all sbrk'ed memory is always contiguous.
1342
97897668
GM
13432012-01-31 Glenn Morris <rgm@gnu.org>
1344
1345 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
c78c6e0b 1346 * w32term.c (syms_of_w32term) <x-toolkit-scroll-bars>:
97897668
GM
1347 * xterm.c (syms_of_xterm) <x-toolkit-scroll-bars>: Sync docs.
1348
31fd3586
GM
13492012-01-29 Glenn Morris <rgm@gnu.org>
1350
1351 * gnutls.c (syms_of_gnutls): More doc (from etc/NEWS).
1352
0e24a8b2
CY
13532012-01-28 Samuel Thibault <sthibault@debian.org> (tiny change)
1354
1355 * s/gnu.h: Define POSIX_SIGNALS (Bug#10552).
1356
cc0adcb0
CY
13572012-01-28 Chong Yidong <cyd@gnu.org>
1358
1359 * minibuf.c (syms_of_minibuf): Doc fix (Bug#10550).
1360
acc28cb9
CY
13612012-01-26 Chong Yidong <cyd@gnu.org>
1362
9c69cfb7
CY
1363 * keyboard.c (Vecho_keystrokes): Document zero value (Bug#10503).
1364
acc28cb9
CY
1365 * search.c (Fsearch_forward, Fsearch_backward): Document negative
1366 repeat counts (Bug#10507).
1367
48da7392
GM
13682012-01-26 Glenn Morris <rgm@gnu.org>
1369
1370 * lread.c (syms_of_lread): Doc fix.
1371
14af5f7f
CY
13722012-01-25 HIROSHI OOTA <nil@mad.dog.cx> (tiny change)
1373
1374 * coding.c (encode_designation_at_bol): Change return value to
1375 EMACS_INT.
1376
0b21c100
CY
13772012-01-25 Chong Yidong <cyd@gnu.org>
1378
1379 * eval.c (Fuser_variable_p): Doc fix; mention custom-variable-p.
1380
3c2907f7
CY
13812012-01-21 Chong Yidong <cyd@gnu.org>
1382
1383 * floatfns.c (Fcopysign): Make the second argument non-optional,
1384 since nil is not allowed anyway.
1385
959ad23f
AS
13862012-01-21 Andreas Schwab <schwab@linux-m68k.org>
1387
1388 * process.c (read_process_output): Use p instead of XPROCESS (proc).
1389 (send_process): Likewise.
1390
34a02f46
MR
13912012-01-19 Martin Rudalics <rudalics@gmx.at>
1392
1393 * window.c (save_window_save, Fcurrent_window_configuration)
cae07000
SM
1394 (Vwindow_persistent_parameters): Do not use Qstate.
1395 Rewrite doc-strings.
34a02f46 1396
1259009a 13972012-01-19 Kenichi Handa <handa@m17n.org>
25ed9e61
KH
1398
1399 * character.c (char_width): New function.
70d4fdf6
GM
1400 (Fchar_width, c_string_width, lisp_string_width):
1401 Use char_width (Bug#9496).
25ed9e61 1402
6a6ee00d
MR
14032012-01-16 Martin Rudalics <rudalics@gmx.at>
1404
1405 * window.c (Vwindow_persistent_parameters): New variable.
1406 (Fset_window_configuration, save_window_save): Handle persistent
1407 window parameters.
1408
c85efaf7
EZ
14092012-01-14 Eli Zaretskii <eliz@gnu.org>
1410
1411 * w32fns.c (signal_user_input): Don't do a QUIT, to avoid
1412 thrashing the stack of the thread. (Bug#9087)
1413
5944709e
PE
14142012-01-12 Paul Eggert <eggert@cs.ucla.edu>
1415
1416 * xdisp.c (rows_from_pos_range): Add parens as per gcc -Wparentheses.
1417
e71f5d99
EZ
14182012-01-11 Eli Zaretskii <eliz@gnu.org>
1419
1420 * xdisp.c (rows_from_pos_range): Handle the case where the
1421 highlight ends on a newline. (Bug#10464)
1422 (mouse_face_from_buffer_pos): Fix off-by-one error in calculating
1423 he end column for display of highlight that ends on a newline
1424 before a R2L line.
1425
ce316182
GM
14262012-01-11 Glenn Morris <rgm@gnu.org>
1427
1428 * lread.c (init_lread): If no-site-lisp, remove site-lisp dirs
1429 from load-path also when installation-directory is nil. (Bug#10208)
1430
5b43da69
GM
14312012-01-10 Glenn Morris <rgm@gnu.org>
1432
74cc8ff9
GM
1433 * emacs.c (syms_of_emacs) <installation-directory>: Doc fix.
1434
7d8d6e4e
GM
1435 * epaths.in (PATH_LOADSEARCH, PATH_EXEC, PATH_DATA, PATH_DOC):
1436 Update template values to be closer to their typical values these days.
5b43da69 1437
a0db8d43
EZ
14382012-01-09 Eli Zaretskii <eliz@gnu.org>
1439
1440 * xdisp.c (rows_from_pos_range): Accept additional argument
1441 DISP_STRING, and accept any glyph in a row whose object is that
1442 string as eligible for mouse highlight. Fixes mouse highlight of
1443 display strings from overlays. (Bug#10464)
1444
9a0115ab 14452012-01-07 Paul Eggert <eggert@cs.ucla.edu>
09450bae 1446
b9110d6a 1447 emacs: fix an auto-save permissions race condition (Bug#10400)
09450bae
PE
1448 * fileio.c (auto_saving_dir_umask): New static var.
1449 (Fmake_directory_internal): Use it.
1450 (do_auto_save_make_dir): Set it, instead of invoking chmod after
1451 creating the directory. The old code temporarily assigns
1452 too-generous permissions to the directory.
1453 (do_auto_save_eh): Clear it.
b9110d6a 1454 (Fdo_auto_save): Catch all errors, not just file errors, so
09450bae
PE
1455 that the var is always cleared.
1456
6c1bd3f3
EZ
14572012-01-07 Eli Zaretskii <eliz@gnu.org>
1458
1459 * search.c (scan_buffer): Pass character positions to
1460 know_region_cache, not byte positions. (Bug#6540)
1461
069d2b50
L
14622012-01-07 LynX <_LynX@bk.ru> (tiny change)
1463
1464 * w32.c (sys_rename): Report EXDEV when rename of a directory
1465 fails because the target is on another logical disk. (Bug#10284)
1466
75bf0d33
DB
14672012-01-07 David Benjamin <davidben@mit.edu> (tiny change)
1468
1469 * xterm.c (x_embed_request_focus): New function.
1470
1471 * xterm.h: Add prototype.
1472
1473 * xfns.c (Fx_focus_frame): Use it for embedded frames (Bug#9977).
1474
1c6e5a32
GM
14752012-01-05 Glenn Morris <rgm@gnu.org>
1476
1477 * emacs.c (emacs_copyright): Update short copyright year to 2012.
1478
651e947e
EZ
14792012-01-01 Eli Zaretskii <eliz@gnu.org>
1480
1481 * gnutls.c (init_gnutls_functions): Load gnutls_check_version.
1482 Load gnutls_transport_set_lowat only if GnuTLS version is below
1483 2.11.1.
1484 (emacs_gnutls_handshake): Call gnutls_transport_set_lowat only for
1485 GnuTLS versions below 2.11.1.
1486
3778cdd8
AL
14872011-12-31 Antoine Levitt <antoine.levitt@gmail.com>
1488
1489 * xdisp.c (syms_of_xdisp) <window-scroll-functions>: Add warning
1490 to the doc string advising against its use for altering the way
1491 windows are scrolled.
1492
0e5317f7
KH
14932011-12-28 Kenichi Handa <handa@m17n.org>
1494
1495 * coding.c (Fdefine_coding_system_internal): Make an utf-8 base
1496 coding-system ASCII compatible only when it does not produce BOM
1497 on encoding (Bug#10383).
1498
93d5ca1f
JD
14992011-12-26 Jan Djärv <jan.h.d@swipnet.se>
1500
1501 * xmenu.c (x_menu_wait_for_event): Use xg_select for Gtk3 so menus
1502 can scroll.
1503 (create_and_show_popup_menu): Always use menu_position_func for
1504 Gtk3 (Bug#10361).
1505
ca22b785
AS
15062011-12-24 Andreas Schwab <schwab@linux-m68k.org>
1507
1508 * callint.c (Fcall_interactively): Don't truncate prompt string.
1509
d048e1e6
EZ
15102011-12-23 Eli Zaretskii <eliz@gnu.org>
1511
1512 * xdisp.c (handle_invisible_prop): Handle correctly an invisible
1513 property that ends at ZV, so that the bidi iteration could be
3ba1a2ad 1514 resumed from there (after widening). (Bug#10360)
d048e1e6 1515
5ccaba1f
JD
15162011-12-22 Jan Djärv <jan.h.d@swipnet.se>
1517
1518 * nsfont.m (ns_spec_to_descriptor): Do not autorelease fdesc.
1519
204ee57f
JD
15202011-12-21 Jan Djärv <jan.h.d@swipnet.se>
1521
b81d40f0
JB
1522 * nsterm.m (x_free_frame_resources):
1523 Release f->output_data.ns->miniimage.
204ee57f
JD
1524 (ns_index_color): Fix indentation. Do not retain
1525 color_table->colors[i].
1526
1527 * nsmenu.m (ns_update_menubar): Call free_menubar_widget_value_tree
1528 before returning.
1529
1530 * nsfns.m (x_set_background_color): Assign return value from
1531 ns_index_color to face-background instead of NSColor*.
1532 (ns_implicitly_set_icon_type): Fix indentation.
1533 Change assignment in for loop to comparison.
1534
1535 * emacs.c (ns_pool): New variable.
1536 (main): Assign ns_pool.
1537 (Fkill_emacs): Call ns_release_autorelease_pool.
1538
1539 * nsfont.m (ns_spec_to_descriptor): Fix indentation,
1540 autorelease fdesc, release fdAttrs and tdict.
1541 (ns_get_covering_families): Release charset.
1542 (ns_findfonts): Release NSFontDescriptor created with new.
1543 (ns_uni_to_glyphs): Fix indentation.
1544 (setString): Release attrStr before assigning new value.
1545
c803b2b7
JD
15462011-12-18 Jan Djärv <jan.h.d@swipnet.se>
1547
678f4426
JD
1548 * nsmenu.m (NSMenuDidBeginTrackingNotification): Declare if OSX < 10.5
1549 and NS_IMPL_COCOA.
1550 (trackingNotification): Surround with ifdef NS_IMPL_COCOA.
1551 (syms_of_nsmenu): Set trackingMenu to 1 if not NS_IMPL_COCOA.
1552
cd394be1 15532011-12-18 David Reitter <reitter@cmu.edu>
678f4426 1554
5fecd5fc
JD
1555 * nsterm.m (ns_term_init): Subscribe for notifications
1556 NSMenuDidBeginTrackingNotification and NSMenuDidEndTrackingNotification
1557 to method trackingNotification in EmacsMenu.
1558
1559 * nsmenu.m (trackingMenu): New variable.
3771cb17 1560 (trackingNotification): New method (from Aquamacs).
5fecd5fc 1561 (menuNeedsUpdate): Expand comment and return if trackingMenu is 0,
3771cb17 1562 from Aquamacs (Bug#7030).
678f4426
JD
1563
15642011-12-18 Jan Djärv <jan.h.d@swipnet.se>
5fecd5fc 1565
c803b2b7
JD
1566 * nsselect.m (CUT_BUFFER_SUPPORT): Remove define.
1567 (symbol_to_nsstring): Fix indentation.
1568 (ns_symbol_to_pb): New function.
cae07000
SM
1569 (Fns_get_selection_internal): Rename from Fns_get_cut_buffer_internal.
1570 (Fns_rotate_cut_buffers_internal): Remove.
1571 (Fns_store_selection_internal): Rename from
c803b2b7
JD
1572 Fns_store_cut_buffer_internal.
1573 (ns_get_foreign_selection, Fx_own_selection_internal)
1574 (Fx_disown_selection_internal, Fx_selection_exists_p)
b81d40f0
JB
1575 (Fns_get_selection_internal, Fns_store_selection_internal):
1576 Use ns_symbol_to_pb and check if return value is nil.
1577 (syms_of_nsselect): Remove ifdef CUT_BUFFER_SUPPORT. Remove defsubr
1578 Sns_rotate_cut_buffers_internal. Sns_get_cut_buffer_internal
c803b2b7
JD
1579 renamed to Sns_get_selection_internal, Sns_store_cut_buffer_internal
1580 renamed to Sns_store_selection_internal.
1581 (ns_handle_selection_request): Move code to Fx_own_selection_internal
1582 and remove this function.
1583 (ns_handle_selection_clear): Remove, never used.
1584 (Fx_own_selection_internal): Move code from ns_handle_selection_request
1585 here.
1586
e1b01a3a
KB
15872011-12-17 Ken Brown <kbrown@cornell.edu>
1588
1589 * fileio.c (check_writable) [CYGWIN]: Return non-zero if UID or
1590 GID is unknown (Bug#10257).
1591
2adb6e85
PE
15922011-12-17 Paul Eggert <eggert@cs.ucla.edu>
1593
1594 * s/gnu-linux.h: Fix mark_memory typo (Bug#10286).
1595 (GC_MARK_SECONDARY_STACK): Omit removed 3rd arg to mark_memory,
1596 which caused a build failure on GNU/Linux IA-64. This problem was
1597 introduced by my 2011-10-07 patch.
1598
d1d7b339
JL
15992011-12-15 Juri Linkov <juri@jurta.org>
1600
1601 * image.c (imagemagick_error): New function. (Bug#10112)
1602 (imagemagick_load_image): Comment out `MagickSetResolution' call.
1603 Use `imagemagick_error' where ImageMagick functions return
1604 `MagickFalse'.
1605 (Fimagemagick_types): Add `Fnreverse' to return the list in the
1606 proper order.
1607
100d5755
KH
16082011-12-15 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
1609
1610 * xftfont.c (xftfont_draw): Use the font metrics of s->font to
1611 fill background (Bug#8992).
1612
454592a6
MR
16132011-12-13 Martin Rudalics <rudalics@gmx.at>
1614
1615 * window.c (Vwindow_combination_resize)
1616 (Vwindow_combination_limit): Use t instead of non-nil in
1617 doc-strings.
61d4b438
MR
1618 (Vrecenter_redisplay): Add first sentence of doc-string on
1619 separate line.
53524d93 1620 (Frecenter): Fix doc-string typo.
454592a6 1621
3633e3aa
KH
16222011-12-11 Kenichi Handa <handa@m17n.org>
1623
1624 * coding.c (Funencodable_char_position): Pay attention to the
1625 buffer text relocation (Bug#9389).
1626
7b9d523a 16272011-12-10 Jan Djärv <jan.h.d@swipnet.se>
61ccba97 1628
7b9d523a
JD
1629 * xterm.c (x_term_init): Move call to gdk_window_add_filter before
1630 gtk_init (Bug#10100).
1631
b73189c6
EZ
16322011-12-10 Eli Zaretskii <eliz@gnu.org>
1633
1634 * xdisp.c (RECORD_MAX_MIN_POS): Use IT->cmp_it.charpos only if
1635 IT->string is nil. (Bug#10263)
1636
f7dfe5d6
JD
16372011-12-10 Jan Djärv <jan.h.d@swipnet.se>
1638
83faebb4
JD
1639 * nsterm.h (x_free_frame_resources): Declare.
1640
f7dfe5d6
JD
1641 * nsfns.m (ns_get_defaults_value): New function (Bug#10103).
1642 (Fns_get_resource, x_get_string_resource): Call ns_get_defaults_value.
1643
1644 * nsterm.h (ns_get_defaults_value): Declare.
1645
1646 * nsterm.m (ns_default): Call ns_get_defaults_value.
1647
7cd4e72c
EZ
16482011-12-09 Eli Zaretskii <eliz@gnu.org>
1649
1650 * xdisp.c (try_scrolling): Don't set scroll_down_p if dy is zero.
1651 (Bug#10170)
1652
b34d7317
YM
16532011-12-09 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
1654
1655 * unexelf.c (unexec) [NS_IMPL_GNUSTEP]: Take account of the case
1656 that where the value of an _OBJC_* symbol points to is in the .bss
1657 section (Bug#10240).
1658
76470ad1
KH
16592011-12-08 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
1660
1661 * coding.c (encode_coding_ccl): Check (charbuf < charbuf_end)
2fac8180 1662 after the loop to call ccl_driver at least once (Bug#8619).
76470ad1 1663
745fff94
KH
16642011-12-08 Kenichi Handa <handa@m17n.org>
1665
1666 * ftfont.c (get_adstyle_property): Fix previous change
1667 (Bug#10233).
1668
6e44397c
JB
16692011-12-07 Juanma Barranquero <lekktu@gmail.com>
1670
1671 * w32.c (init_environment): If no_site_lisp, remove site-lisp
1672 dirs from the default value of EMACSLOADPATH (bug#10208).
1673
7efa6272
GM
16742011-12-07 Glenn Morris <rgm@gnu.org>
1675
1676 * lread.c (init_lread): If no_site_lisp, exclude site-lisp/ in
1677 installation and source directories as well. (Bug#10208)
1678
f6fc4d87
CY
16792011-12-06 Chong Yidong <cyd@gnu.org>
1680
1681 * minibuf.c (Fread_from_minibuffer): Doc fix (Bug#10228).
1682
2bf26180
GM
16832011-12-06 Glenn Morris <rgm@gnu.org>
1684
1685 * process.c (start_process_unwind): Treat any pid <= 0, except -2,
1686 as an error, not just -1. (Bug#10217)
1687
3a6ad4f0
CY
16882011-12-05 Chong Yidong <cyd@gnu.org>
1689
1690 * keyboard.c (process_special_events): New function.
1691 (swallow_events, Finput_pending_p): Use it (Bug#10195).
1692
75a3b399
PE
16932011-12-05 Paul Eggert <eggert@cs.ucla.edu>
1694
1695 * coding.c (encode_designation_at_bol): Don't use uninitialized
1696 local variable (Bug#9318).
1697
c3c9e25e
KH
16982011-12-05 Kenichi Handa <handa@m17n.org>
1699
1700 * ftfont.c (get_adstyle_property): If the font is not BDF nor PCF,
1701 return Qnil (Bug#8046, Bug#10193).
1702
5eb05ea3
KH
17032011-12-05 Kenichi Handa <handa@m17n.org>
1704
1705 * coding.c (encode_designation_at_bol): New args charbuf_end and
1706 dst. Return the number of produced bytes. Callers changed.
a79703f5
KH
1707 (coding_set_source): Return how many bytes coding->source was
1708 relocated.
1709 (coding_set_destination): Return how many bytes
1710 coding->destination was relocated.
1711 (CODING_DECODE_CHAR, CODING_ENCODE_CHAR, CODING_CHAR_CHARSET)
cae07000 1712 (CODING_CHAR_CHARSET_P): Adjust for the avove changes.
5eb05ea3
KH
1713
17142011-12-05 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
1715
1716 * coding.c (CODING_CHAR_CHARSET_P): New macro.
1717 (encode_coding_emacs_mule, encode_coding_iso_2022): Use the above
1718 macro (Bug#9318).
1719
17202011-12-05 Andreas Schwab <schwab@linux-m68k.org>
1721
1722 The following changes are to fix Bug#9318.
1723
a79703f5 1724 * coding.c (CODING_ENCODE_CHAR, CODING_CHAR_CHARSET): New macros.
5eb05ea3
KH
1725 (encode_coding_emacs_mule, ENCODE_ISO_CHARACTER)
1726 (encode_coding_iso_2022, encode_coding_sjis)
a79703f5 1727 (encode_coding_big5, encode_coding_charset): Use the above macros.
5eb05ea3 1728
7dbda6df
JB
17292011-12-05 Juanma Barranquero <lekktu@gmail.com>
1730
1731 * lisp.h (process_quit_flag): Fix external declaration.
1732
6d5eb5b0
SM
17332011-12-04 Stefan Monnier <monnier@iro.umontreal.ca>
1734
1735 Don't macro-inline non-performance-critical code.
1736 * eval.c (process_quit_flag): New function.
1737 * lisp.h (QUIT): Use it.
1738
a0c3fad0
JD
17392011-12-04 Jan Djärv <jan.h.d@swipnet.se>
1740
1741 * nsfns.m (get_geometry_from_preferences): New function.
1742 (Fx_create_frame): Call get_geometry_from_preferences (Bug#10103).
1743
6c07aac2
AS
17442011-12-04 Andreas Schwab <schwab@linux-m68k.org>
1745
1746 * emacs.c (Qkill_emacs): Define.
1747 (syms_of_emacs): Initialize it.
1748 * keyboard.c (interrupt_signal): Don't call Fkill_emacs here, set
1749 Qquit_flag to `kill-emacs' instead.
6d5eb5b0
SM
1750 (quit_throw_to_read_char): Add parameter `from_signal'.
1751 All callers changed. Call Fkill_emacs if requested and safe.
6c07aac2
AS
1752 * lisp.h (QUIT): Call Fkill_emacs if requested.
1753
c052ead4
JD
17542011-12-03 Jan Djärv <jan.h.d@swipnet.se>
1755
1756 * widget.c (update_wm_hints): Return if wmshell is null.
1757 (widget_update_wm_size_hints): New function.
1758
1759 * widget.h (widget_update_wm_size_hints): Declare.
1760
1761 * xterm.c (x_wm_set_size_hint): If USE_X_TOOLKIT, call
1762 widget_update_wm_size_hints (Bug#10104).
1763
9e49252b
EZ
17642011-12-03 Eli Zaretskii <eliz@gnu.org>
1765
1766 * xdisp.c (handle_invisible_prop): If the invisible text ends just
1767 before a newline, prepare the bidi iterator for consuming the
1768 newline, and keep the current paragraph direction. (Bug#10183)
e9a49426 1769 (redisplay_window): Don't let `margin' become negative. (Bug#10192)
9e49252b 1770
02b16839
JL
17712011-12-02 Juri Linkov <juri@jurta.org>
1772
1773 * search.c (Fword_search_regexp): New Lisp function created from
1774 `wordify'. Change type of arg `lax' from `int' to `Lisp_Object'.
1775 (Fword_search_backward, Fword_search_forward)
1776 (Fword_search_backward_lax, Fword_search_forward_lax):
1777 Use `Fword_search_regexp' instead of `wordify'. Doc fix.
1778 (syms_of_search): Define `Sword_search_regexp'. (Bug#10145)
1779
0068070e
SM
17802011-12-01 Stefan Monnier <monnier@iro.umontreal.ca>
1781
1782 * fileio.c (Finsert_file_contents): Move after-change-function call
1783 to before the "handled:" label, since all "goto handled" appear in
1784 cases where the *-change-functions have already been properly called
1785 (bug#10117).
1786
3360a3fc
AS
17872011-12-01 Andreas Schwab <schwab@linux-m68k.org>
1788
1789 * keyboard.c (interrupt_signal): Don't call kill-emacs when
1790 waiting for input. (Bug#10169)
1791
73d6c093
EZ
17922011-11-30 Eli Zaretskii <eliz@gnu.org>
1793
1794 * dispnew.c (adjust_glyph_matrix): Remove the assertion that
1795 verifies glyph row's hash code--we have just reallocated the
1796 glyphs, so their contents can be complete garbage. (Bug#10164)
1797
febe6bea
JB
17982011-11-30 Juanma Barranquero <lekktu@gmail.com>
1799
1800 * dispnew.c (adjust_glyph_matrix) [XASSERTS]: Add missing check.
1801
801a4313
EZ
18022011-11-30 Eli Zaretskii <eliz@gnu.org>
1803
1804 * dispnew.c (adjust_glyph_matrix) [XASSERTS]: Ensure ROW's
1805 attributes are tested _before_ calling verify_row_hash, to protect
1806 against GCC re-ordering of the tests. (Bug#10164)
1807
2b56b87e
JD
18082011-11-29 Jan Djärv <jan.h.d@swipnet.se>
1809
1810 * xterm.h (struct x_output): net_wm_state_hidden_seen is new.
1811
1812 * xterm.c (handle_one_xevent): Only set async_visible and friends
1813 if net_wm_state_hidden_seen is non-zero (Bug#10002)
7dbda6df 1814 (get_current_wm_state): Set net_wm_state_hidden_seen to 1 if
2b56b87e
JD
1815 _NET_WM_STATE_HIDDEN is in NET_WM_STATE.
1816
dbf31225
PE
18172011-11-28 Paul Eggert <eggert@cs.ucla.edu>
1818
1819 Remove GCPRO-related macros that exist only to avoid shadowing locals.
1820 * lisp.h (GCPRO1_VAR, GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR, GCPRO5_VAR)
1821 (GCPRO6_VAR, UNGCPRO_VAR): Remove. See
1822 <http://lists.gnu.org/archive/html/emacs-diffs/2011-11/msg00265.html>.
1823 All uses changed to use GCPRO1 etc.
1824 (GCPRO1, GCPRO2, GCPRO3, GCPRO4, GCPRO5, GCPRO6, UNGCPRO):
1825 Revert to old implementation (i.e., before 2011-03-11).
1826
1305621b
YM
18272011-11-28 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
1828
1829 * dispnew.c (scrolling_window): Truncate overlaps in copy destination
1830 of scroll runs so as to avoid assigning disabled bogus rows and
1831 unnecessary graphics copy operations.
1832
8c9afb46
EZ
18332011-11-27 Eli Zaretskii <eliz@gnu.org>
1834
1835 * s/ms-w32.h (utimbuf) [_MSC_VER]: Don't define.
1836 (snprintf) [_MSC_VER]: Redirect to _snprintf.
1837 (strtoll) [_MSC_VER]: Redirect to _strtoi64.
1838 (malloc, free, realloc, calloc): Redirect to e_* only when
1839 compiling Emacs.
1840
1841 * lisp.h (GCTYPEBITS): Move before first use.
1842 (ALIGN_GCTYPEBITS) [_MSC_VER]: Define.
1843 (DECL_ALIGN) [_MSC_VER]: Use it, as MSVC doesn't like bit ops in
1844 this macro definition.
1845
1846 * s/ms-w32.h (tzname): Redirect to _tzname for all values of
1847 _MSC_VER.
1848
54e9e3bf
JD
18492011-11-27 Jan Djärv <jan.h.d@swipnet.se>
1850
6d5eb5b0
SM
1851 * gtkutil.c (xg_create_frame_widgets):
1852 Call gtk_window_set_has_resize_grip (FALSE) if that function is
54e9e3bf
JD
1853 present with Gtk+ 2.0.
1854
83aca1cb
PE
18552011-11-26 Paul Eggert <eggert@cs.ucla.edu>
1856
1857 * fileio.c (Finsert_file_contents): Undo previous change; see
1858 <http://lists.gnu.org/archive/html/emacs-diffs/2011-11/msg00265.html>.
1859
5b76caa4
PE
18602011-11-26 Paul Eggert <eggert@cs.ucla.edu>
1861
1862 Rename locals to avoid shadowing.
1863 * fileio.c (Finsert_file_contents):
1864 Rename inner 'gcpro1' to 'inner_gcpro1' to avoid shadowing.
1865 * process.c (wait_reading_process_output):
1866 Rename inner 'proc' to 'p' to avoid shadowing.
1867 Indent for consistency with usual Emacs style.
1868
8c535114
EZ
18692011-11-25 Eli Zaretskii <eliz@gnu.org>
1870
1871 * xdisp.c (redisplay_window): If cursor row is not fully visible
1872 after recentering, and scroll-conservatively is set to a large
1873 number, scroll window by a few more lines to make the cursor fully
1874 visible and out of scroll-margin. (Bug#10105)
91b4a718
EZ
1875 (start_display): Don't move to the next line if the display should
1876 start at a newline that is part of a display vector or an overlay
1877 string. (Bug#10119)
8c535114 1878
fa4fdb5c
JL
18792011-11-24 Juri Linkov <juri@jurta.org>
1880
1881 * image.c (imagemagick_load_image): Move `MagickSetResolution' down
1882 after the `MagickPingImage' call. (Bug#10112)
1883
90ec88df
CY
18842011-11-23 Chong Yidong <cyd@gnu.org>
1885
1886 * window.c (Fcoordinates_in_window_p): Accept only live windows.
1887
56e2e794
MR
18882011-11-23 Martin Rudalics <rudalics@gmx.at>
1889
1890 * buffer.c (Fkill_buffer): Run replace_buffer_in_windows before
1891 making another buffer current. (Bug#10114)
1892
b6e64c41
GM
18932011-11-23 Glenn Morris <rgm@gnu.org>
1894
1895 * font.c (font_find_for_lface) [HAVE_NS]: Ignore case. (Bug#2526)
1896
6b21de18
CY
18972011-11-23 Chong Yidong <cyd@gnu.org>
1898
1899 * xdisp.c (compute_stop_pos): Check validity of end_charpos before
1900 using it (Bug#5984).
1901
b12cd789
EZ
19022011-11-22 Eli Zaretskii <eliz@gnu.org>
1903
1904 * dispnew.c (adjust_glyph_matrix): Don't verify hash code of mode-
1905 and header-lines, as they don't have one computed for them.
1906 (Bug#10098)
1907
1908 * .gdbinit (prow): Make displayed values more self-explaining.
1909 Add row's hash code.
1910
261b6fd4
LMI
19112011-11-21 Lars Magne Ingebrigtsen <larsi@gnus.org>
1912
1913 * process.c (wait_reading_process_output): Fix asynchrounous
1914 GnuTLS socket handling on some versions of the GnuTLS library.
16c1ad08 1915 (wait_reading_process_output): Add comment and URL.
261b6fd4 1916
e7cfd277
JD
19172011-11-21 Jan Djärv <jan.h.d@swipnet.se>
1918
1919 * xterm.c (x_clear_frame): Reinstate the XClearWindow call.
1920
a9b9b7f5
CY
19212011-11-21 Chong Yidong <cyd@gnu.org>
1922
1923 * window.c (Fnext_window, Fprevious_window): Doc fix.
1924
b0d15b4f
SM
19252011-11-20 Stefan Monnier <monnier@iro.umontreal.ca>
1926
1927 * window.c (get_phys_cursor_glyph): Fix Lisp_Object/int mixup.
1928
fe7a3057
JB
19292011-11-20 Juanma Barranquero <lekktu@gmail.com>
1930
1931 * nsfont.m (syms_of_nsfont) <ns-reg-to-script>: Fix typo.
1932
d2999b1a
MR
19332011-11-20 Martin Rudalics <rudalics@gmx.at>
1934
1935 * window.c (Fset_window_combination_limit): Rename argument
1936 STATUS to LIMIT.
1937 (Vwindow_combination_limit): Remove "status" from doc-string.
1938
d5ff9cd0
AS
19392011-11-20 Andreas Schwab <schwab@linux-m68k.org>
1940
1941 * m/ibms390.h: Remove.
1942 * m/ibms390x.h: Don't include "ibms390.h".
1943
a5bb9bd3
SM
19442011-11-20 Stefan Monnier <monnier@iro.umontreal.ca>
1945
1946 * fileio.c (Finsert_file_contents): Add missing gcpro1 variable.
1947 Suggested by Dmitry Antipov <dmantipov@yandex.ru>.
1948
cd1181db
JB
19492011-11-20 Juanma Barranquero <lekktu@gmail.com>
1950
1951 * casetab.c (Fset_case_table):
1952 * charset.c (Fcharset_after): Fix typos.
1953
615a3b8d 19542011-11-20 Paul Eggert <eggert@cs.ucla.edu>
6a0bf43d 1955
17e845af
PE
1956 Standardize on VIRT_ADDR_VARIES behavior (Bug#10042).
1957 Otherwise, valgrind does not work on some platforms.
1958 Problem reported by Andreas Schwab in
6a0bf43d
PE
1959 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00081.html>.
1960 * puresize.h (pure, PURE_P): Always behave as if VIRT_ADDR_VARIES
1961 is set, removing the need for VIRT_ADDRESS_VARIES.
1962 (PURE_P): Use a more-efficient implementation that needs just one
1963 comparison, not two: on x86-64 with GCC 4.6.2, this cut down the
1964 number of instructions from 6 (xorl, cmpq, jge, xorl, cmpq, setge)
1965 to 4 (xorl, subq, cmpq, setbe).
1966 * alloc.c (pure): Always extern now, since that's the
1967 VIRT_ADDR_VARIES behavior.
1968 (PURE_POINTER_P): Use a single comparison, not two, for
1969 consistency with the new puresize.h.
1970 * lisp.h (PNTR_COMPARISON_TYPE): Remove; no longer needed.
1971 * m/ibms390.h, m/intel386.h, m/template.h, s/cygwin.h, s/hpux10-20.h:
1972 Remove VIRT_ADDR_VARIES no longer needed.
1973
f8fe6f96
EZ
19742011-11-19 Eli Zaretskii <eliz@gnu.org>
1975
1976 * xdisp.c (x_write_glyphs, draw_phys_cursor_glyph)
1977 (erase_phys_cursor, update_window_cursor, show_mouse_face)
1978 (cursor_in_mouse_face_p): If the cursor position is out of bounds,
1979 behave as if the cursor position were at the window margin.
1980
1981 * window.c (get_phys_cursor_glyph): If the window is hscrolled,
1982 and the cursor position is out of bounds, behave as if the cursor
1983 position were at the window margin. (Bug#10075)
1984
df05a53c
CY
19852011-11-18 Chong Yidong <cyd@gnu.org>
1986
1987 * window.c (Fwindow_combination_limit): Make first argument
1988 non-optional, since it is meaningless for live windows like the
1989 selected window.
61ccba97 1990
2071918e
DA
19912011-11-18 Dmitry Antipov <dmantipov@yandex.ru>
1992
1993 * keymap.c (Fwhere_is_internal): Add missing RETURN_UNGCPROs.
1994
b50a28de
SM
19952011-11-18 Stefan Monnier <monnier@iro.umontreal.ca>
1996
1997 * intervals.c: Fix grafting over the whole buffer (bug#10071).
1998 (graft_intervals_into_buffer): Simplify.
1999
015137db
EZ
20002011-11-18 Eli Zaretskii <eliz@gnu.org>
2001
2002 * dispnew.c (swap_glyph_pointers): Swap the used[] arrays and the
2003 hash values of the two rows.
2004 (copy_row_except_pointers): Preserve the used[] arrays and the
2005 hash values of the two rows. (Bug#10035)
68c95424 2006 (add_row_entry): Add xassert to verify that ROW's hash code is valid.
015137db
EZ
2007
2008 * xdisp.c (row_hash): New function, body extracted from
2009 compute_line_metrics.
2010 (compute_line_metrics): Call row_hash, instead of computing the
2011 hash code inline.
2012
2013 * dispnew.c (verify_row_hash): Call row_hash for computing the
2014 hash code of a row, instead of duplicating code from xdisp.c.
2015
2016 * dispextern.h (row_hash): Add prototype.
2017
a2addb04
TH
20182011-11-18 Tassilo Horn <tassilo@member.fsf.org>
2019
2020 * frame.c (delete_frame): Don't delete the terminal when the last
2021 X frame is closed if emacs is built with GTK toolkit.
2022
df85d315
JB
20232011-11-17 Juanma Barranquero <lekktu@gmail.com>
2024
2025 * window.c (syms_of_window) <window-combination-resize>: Fix typo.
2026
a0c2d0ae
MR
20272011-11-17 Martin Rudalics <rudalics@gmx.at>
2028
2029 * window.c (Vwindow_splits): Rename to
2030 Vwindow_combination_resize. Suggested by Juri Linkov.
2031 (Fsplit_window_internal): Use Vwindow_combination_resize instead
2032 of Vwindow_splits.
2033
58179cce
JB
20342011-11-16 Juanma Barranquero <lekktu@gmail.com>
2035
7877f373
JB
2036 * nsfns.m (Fns_font_name):
2037 * window.c (syms_of_window) <window-combination-limit>: Fix typos.
58179cce 2038
b6f67890
MR
20392011-11-16 Martin Rudalics <rudalics@gmx.at>
2040
2041 * window.h (window): Rename slot "nest" to "combination_limit".
2042 * window.c (Fwindow_nest): Rename to Fwindow_combination_limit.
2043 (Fset_window_nest): Rename to Fset_window_combination_limit.
2044 (Vwindow_nest): Rename to Vwindow_combination_limit.
2045 (recombine_windows, make_parent_window, make_window)
2046 (Fsplit_window_internal, saved_window)
2047 (Fset_window_configuration, save_window_save): Rename all
2048 occurrences of window_nest to window_combination_limit.
2049
c7015153
JB
20502011-11-15 Juanma Barranquero <lekktu@gmail.com>
2051
2052 * image.c (imagemagick_load_image): Fix typo.
2053
322ad6ec
EZ
20542011-11-14 Eli Zaretskii <eliz@gnu.org>
2055
2056 * xdisp.c (display_line): Move the call to
2057 highlight_trailing_whitespace before the call to
2058 compute_line_metrics, since the latter needs to see the final
6d5eb5b0
SM
2059 faces of all the glyphs to compute ROW's hash value.
2060 Fixes assertion violations in row_equal_p. (Bug#10035)
322ad6ec 2061
f067b8ec
JB
20622011-11-14 Juanma Barranquero <lekktu@gmail.com>
2063
2064 * w32proc.c (reader_thread): Don't check pending input if cp->fd < 0,
2065 just return (bug#10044).
2066
1e5b2111
EZ
20672011-11-12 Eli Zaretskii <eliz@gnu.org>
2068
7ef3cbd5
EZ
2069 * makefile.w32-in (HEAPSIZE): New variable, allows to build temacs
2070 with user-defined heap size. Bump the default size of the temacs
2071 heap to 27MB, to avoid memory warning when running temacs.
2072 ($(TEMACS)): Use HEAPSIZE instead of a hardcoded value.
2073
1e5b2111
EZ
2074 * dispnew.c (scrolling_window): Fix incorrect indices in accessing
2075 current_matrix and desired_matrix. (Bug#9990)
7a7270dd
EZ
2076 (verify_row_hash) [XASSERTS]: New function.
2077 (adjust_glyph_matrix, row_equal_p): Use it in xassert to verify
2078 that the hash value of glyph rows is correct.
1e5b2111 2079
89d61221
MR
20802011-11-12 Martin Rudalics <rudalics@gmx.at>
2081
2082 * window.h (window): Remove splits slot.
2083 * window.c (Fwindow_splits, Fset_window_splits): Remove.
2084 (Fdelete_other_windows_internal, make_parent_window)
2085 (make_window, Fsplit_window_internal, Fdelete_window_internal)
2086 (Fset_window_configuration, save_window_save): Don't deal with
2087 split status of windows.
2088 (saved_window): Remove splits slot.
2089 (Vwindow_splits): Rewrite doc-string.
2090
97f18cc8
JD
20912011-11-11 Jan Djärv <jan.h.d@swipnet.se>
2092
2093 * xfns.c (unwind_create_frame):
2094 * nsfns.m (unwind_create_frame):
2095 * w32fns.c (unwind_create_frame): Use Fmemq to check if frame is in
2096 Vframe_list (Bug#9999).
2097
22a648b4
DA
20982011-11-11 Dmitry Antipov <dmantipov@yandex.ru>
2099
0b381c7e 2100 * xdisp.c (syms_of_xdisp): Remove duplicated definition of Qtext.
22a648b4 2101
659afede
KH
21022011-11-11 Kenichi Handa <handa@m17n.org>
2103
2104 * callproc.c (Fcall_process): Set the member dst_multibyte of
2105 process_coding.
2106
9ac0394b
KH
21072011-11-11 Johan Bockgård <bojohan@gnu.org>
2108
2109 * xdisp.c (fill_composite_glyph_string): Always set s->face, to
2110 avoid a crash (bug#9496).
2111
2fbdc249
CY
21122011-11-09 Chong Yidong <cyd@gnu.org>
2113
2114 * window.c (Fwindow_inside_edges, Fwindow_inside_pixel_edges)
2115 (Fwindow_inside_absolute_pixel_edges): Only allow live windows.
2116
ac6b1f81
PE
21172011-11-08 Paul Eggert <eggert@cs.ucla.edu>
2118
2119 * s/gnu.h (GC_MARK_STACK): Define to GC_MAKE_GCPROS_NOOPS (Bug#9926).
2120
09db192c
PE
21212011-11-08 Paul Eggert <eggert@cs.ucla.edu>
2122
2123 Avoid some portability problems by eschewing 'extern inline' functions.
2124 The trivial performance wins aren't worth the portability hassles; see
2125 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00084.html>
2126 et seq.
2127 * dispextern.h (window_box, window_box_height, window_text_bottom_y)
2128 (window_box_width, window_box_left, window_box_left_offset)
2129 (window_box_right, window_box_right_offset): Undo previous change,
2130 by removing the "extern"s.
2131 * intervals.c (adjust_intervals_for_insertion)
2132 (adjust_intervals_for_deletion): Undo previous change,
2133 making these static again.
2134 (offset_intervals, temp_set_point_both, temp_set_point)
2135 (copy_intervals_to_string): No longer inline.
2136 * xdisp.c (window_text_bottom_y, window_box_width)
2137 (window_box_height, window_box_left_offset)
2138 (window_box_right_offset, window_box_left, window_box_right)
2139 (window_box): No longer inline.
2140
105216ed
CY
21412011-11-08 Chong Yidong <cyd@gnu.org>
2142
2143 * window.c (Fwindow_left_column, Fwindow_top_line): Doc fix.
6d5eb5b0
SM
2144 (Fwindow_body_height, Fwindow_body_width): Move from Lisp.
2145 Signal an error if not a live window.
105216ed
CY
2146 (Fwindow_total_width, Fwindow_total_height): Move from Lisp.
2147 (Fwindow_total_size, Fwindow_body_size): Move to Lisp.
2148
ae9e237f
JB
21492011-11-07 Juanma Barranquero <lekktu@gmail.com>
2150
2151 * lisp.h (syms_of_abbrev): Remove declaration.
2152 Reported by CHENG Gao <chenggao@royau.me>.
2153
c7aa8333
EZ
21542011-11-07 Eli Zaretskii <eliz@gnu.org>
2155
2156 * w32.c (check_windows_init_file): Don't look for term/w32-win.el
2157 if Vpurify_flag is non-nil. Fixes a crash when running w32 build
2158 of temacs in GUI mode.
2159
be7f5545
MR
21602011-11-07 Martin Rudalics <rudalics@gmx.at>
2161
2162 * window.h: Declare delete_all_child_windows instead of
2163 delete_all_subwindows.
2164 * window.c (Fwindow_nest, Fset_window_nest)
2165 (Fset_window_new_total, Fset_window_new_normal)
2166 (Fwindow_resize_apply): Don't use term subwindow in doc-strings.
2167 (delete_all_subwindows): Rename to delete_all_child_windows.
2168 (Fdelete_other_windows_internal, Fset_window_configuration):
2169 Call delete_all_child_windows instead of delete_all_subwindows.
2170 * frame.c (delete_frame): Call delete_all_child_windows instead
2171 of delete_all_subwindows.
2172
ca78dc43
PE
21732011-11-07 Paul Eggert <eggert@cs.ucla.edu>
2174
2175 * alloc.c (DEADP): New macro, for porting to GNU/Hurd (Bug#9926).
2176 This is also needed for porting to any host where GC_MARK_STACK is
2177 not GC_MAKE_GCPROS_NOOPS.
2178 (which_symbols): Use it.
2179
a0241d01
KH
21802011-11-07 Kenichi Handa <handa@m17n.org>
2181
2182 * coding.c (coding_set_destination): Check coding->src_pos only
2183 when coding->src_object is a buffer (bug#9910).
2184
2185 * process.c (send_process): Set the member src_multibyte of coding
2186 to 0 (bug#9911) when sending a unibyte text.
2187
2188 * callproc.c (Fcall_process): Set the member src_multibyte of
2189 process_coding to 0 (bug#9912).
2190
a64bfdfa 21912011-11-06 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
ba24cea2
YM
2192
2193 * xmenu.c (cleanup_widget_value_tree): New function.
2194 (xmenu_show, xdialog_show): Use it in record_unwind_protect instead of
2195 calling free_menubar_widget_value_tree directly (Bug#9830).
2196
cb41b32a
PE
21972011-11-06 Paul Eggert <eggert@cs.ucla.edu>
2198
2199 Fix some portability problems with 'inline'.
2200 * dispextern.h (window_box, window_box_height, window_text_bottom_y)
2201 (window_box_width, window_box_left, window_box_left_offset)
2202 (window_box_right, window_box_right_offset): Declare extern.
2203 Otherwise, these inline functions do not conform to C99 and
2204 are miscompiled by Microsoft compilers. Reported by Eli Zaretskii in
2205 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00084.html>.
2206 * intervals.c (adjust_intervals_for_insertion)
2207 (adjust_intervals_for_deletion): Now extern, because otherwise the
2208 extern inline functions 'offset_intervals' couldn't refer to it.
2209 (static_offset_intervals): Remove.
2210 (offset_intervals): Rewrite using the old contents of
2211 static_offset_intervals. The old version didn't conform to C99
2212 because an extern inline function contained a reference to an
2213 identifier with static linkage.
2214
b7041366
AS
22152011-11-06 Andreas Schwab <schwab@linux-m68k.org>
2216
2217 * keyboard.c (interrupt_signal): Don't call kill-emacs while in
2218 GC.
2219
88a37c4d
EZ
22202011-11-06 Eli Zaretskii <eliz@gnu.org>
2221
2222 * xdisp.c (init_iterator, reseat_to_string): Don't set the
2223 iterator's bidi_p flag if Vpurify_flag is non-nil. (Bug#9963)
2224 (Fcurrent_bidi_paragraph_direction): If Vpurify_flag is non-nil,
2225 return Qleft_to_right.
2226
49745b39
CY
22272011-11-06 Chong Yidong <cyd@gnu.org>
2228
2229 * window.c (Fwindow_live_p, Fwindow_frame, Fframe_root_window)
2230 (Fminibuffer_window, Fwindow_buffer, Fwindow_splits)
2231 (Fset_window_splits, Fwindow_nest, Fset_window_nest)
2232 (Fwindow_use_time, Fwindow_total_size, Fwindow_normal_size)
2233 (Fwindow_new_normal, Fwindow_left_column, Fwindow_top_line)
2234 (Fwindow_margins, Fwindow_fringes, Fwindow_scroll_bars)
2235 (Fwindow_vscroll): Doc fix.
2236 (Fwindow_top_child, Fwindow_left_child): Eliminate a nil default
2237 argument, since it makes no sense to pass a live window and for
2238 consistency with window-child.
2239
1f05cd82
CS
22402011-11-05 Christoph Scholtes <cschol2112@googlemail.com>
2241
2242 * makefile.w32-in ($(TEMACS), (gl-stamp)): Use $(THISDIR) to
2243 support MSVC.
2244
22610910
JR
22452011-11-05 Jason Rumney <jasonr@gnu.org>
2246
2247 * w32font.c (font_matches_spec): Filter out non-Japanese kana fonts.
2248 (add_font_entity_to_list): Filter out non-Japanese Shift-JIS
2249 fonts (Bug#6029).
2250 (add_font_entity_to_list): Fix logic errors in mixed boolean and
2251 bitwise arithmetic preventing use of unicode-sip and non-truetype
2252 opentype fonts.
2253
a06776b2
EZ
22542011-11-05 Eli Zaretskii <eliz@gnu.org>
2255
3ad924ba
EZ
2256 * s/ms-w32.h (fstat, stat, utime): Move redirections to
2257 "emacs"-only part.
2258
a06776b2
EZ
2259 * w32fns.c (x_create_tip_frame, Fx_create_frame): Rearrange
2260 initialization code to keep similarity to xfns.c after changes
2261 from 2011-11-05.
2262
c9e7db78
JD
22632011-11-05 Jan Djärv <jan.h.d@swipnet.se>
2264
a97f8f3f
JD
2265 * nsfns.m: Declare image_cache_refcount if GLYPH_DEBUG.
2266 (unwind_create_frame): New function (Bug#9943).
2267 (Fx_create_frame): Restructure code to be more similar to the one in
2268 xfns.c. Call record_unwind_protect with unwind_create_frame (Bug#9943).
2269 Initialize image_cache_refcount if GLYPH_DEBUG (Bug#9943).
2270 Move terminal->reference_count++ just before making the frame official
2271 (Bug#9943).
2272
2273 * nsterm.m (x_free_frame_resources): New function.
2274 (x_destroy_window): Move code to x_free_frame_resources.
2275
c9e7db78 2276 * xfns.c (unwind_create_frame): Fix comment.
6d5eb5b0
SM
2277 (Fx_create_frame, x_create_tip_frame):
2278 Move terminal->reference_count++ just before making the frame
c9e7db78
JD
2279 official. Move initialization of image_cache_refcount and
2280 dpyinfo_refcount before calling init_frame_faces (Bug#9943).
2281
a6fc3b5c
EZ
22822011-11-05 Eli Zaretskii <eliz@gnu.org>
2283
2284 Support MSVC build with newer versions of Visual Studio.
2285 * makefile.w32-in (TAGS-gmake): Don't use $(patsubst ...), as
2286 Nmake barfs on that. Use $(OBJ*_c) variables instead, defined on
2287 nt/gmake.defs.
2288
2289 * lisp.h (ENUM_BF): New macro, for enumerated types in bitfields,
2290 which are not supported by MSVC.
2291 (Lisp_Symbol, Lisp_Misc_Any, Lisp_Marker, Lisp_Misc_Overlay)
2292 (Lisp_Save_Value, Lisp_Free): Use ENUM_BF for enumerated types in
2293 bitfields.
2294 (Lisp_Object) [USE_LISP_UNION_TYPE]: Use ENUM_BF for enumerated
2295 types in bitfields.
2296 (DEFUN) [_MSC_VER]: Define in a different way for MSVC.
2297
2298 * w32fns.c [_MSC_VER]: DECLARE_HANDLE for any MSVC version.
2299
58179cce 23002011-11-05 Fabrice Popineau <fabrice.popineau@supelec.fr> (tiny change)
a6fc3b5c
EZ
2301
2302 Support MSVC build with newer versions of Visual Studio.
2303 * w32.c: Don't include w32api.h for MSVC.
2304 (init_environment) [_MSC_VER]: Call sys_access, not _access.
2305
2306 * s/ms-w32.h <sigset_t, ssize_t> [_MSC_VER]: Typedefs for MSVC.
2307 [_MSC_VER]: Include sys/timeb.h, sys/stat.h, and signal.h.
2308 (fstat, stat, utime) [_MSC_VER]: Redirect to their sys_* cousins.
2309 (malloc, free, realloc, calloc) [_MSC_VER]: Always redirect to the
2310 e_* cousins.
2311 (alloca) [_MSC_VER]: Define to _alloca.
2312
2313 * lisp.h (DECL_ALIGN) [_MSC_VER]: Define for MSVC.
2314
2315 * regex.c <re_char> [_MSC_VER]: A separate definition for MSVC.
2316
a58c13ed
EZ
23172011-11-04 Eli Zaretskii <eliz@gnu.org>
2318
2319 * xdisp.c (note_mouse_highlight): If either of
2320 previous/next-single-property-change returns nil, treat that as
2321 the beginning or the end of the buffer. (Bug#9955)
2322
fe0b6370
JD
23232011-11-04 Jan Djärv <jan.h.d@swipnet.se>
2324
a58c13ed 2325 * gtkutil.c (xg_make_tool_item): Add callbacks if one of wimage or
fe0b6370
JD
2326 label is not null (Bug#9951).
2327 (xg_tool_item_stale_p): Handle the fact that wimage and/or wlbl
2328 may be NULL.
2329
89bd5ee1
EZ
23302011-11-04 Eli Zaretskii <eliz@gnu.org>
2331
2332 * window.c (Fwindow_body_size): Mention in the doc string that the
2333 return value is in frame's canonical units. (Bug#9949)
2334
84c3edb9
EZ
23352011-11-03 Eli Zaretskii <eliz@gnu.org>
2336
4e2fb5c7
EZ
2337 * xdisp.c (note_mouse_highlight): Initialize `area'. (Bug#9947)
2338
84c3edb9 2339 * w32fns.c (unwind_create_frame): If needed, free the glyph
3ab15fd6 2340 matrices of the partially constructed frame. (Bug#9943)
2a58bbc1 2341 * xfns.c (unwind_create_frame): Likewise.
84c3edb9 2342
bc17a887
EZ
23432011-11-01 Eli Zaretskii <eliz@gnu.org>
2344
2345 * xdisp.c (mouse_face_from_buffer_pos): Fix a typo in a comment.
2346 Don't stop backward scan on the continuation glyph, even though
2347 its CHARPOS is positive.
6d5eb5b0
SM
2348 (mouse_face_from_buffer_pos, note_mouse_highlight):
2349 Rename cover_string to disp_string.
bc17a887 2350
4ee88440
MR
23512011-11-01 Martin Rudalics <rudalics@gmx.at>
2352
2353 * window.c (temp_output_buffer_show): Don't use
2354 Vtemp_buffer_show_specifiers.
2355 (Vtemp_buffer_show_specifiers): Remove unused variable.
2356
c2ff3c02
EZ
23572011-10-30 Eli Zaretskii <eliz@gnu.org>
2358
2359 * xdisp.c (try_cursor_movement): Make sure ROW isn't decremented
2360 past the beginning of the current glyph matrix.
2361
58179cce 23622011-10-30 Adam Sjøgren <asjo@koldfront.dk> (tiny change)
6e56383b
JD
2363
2364 * xterm.c: Include X11/Xproto.h if HAVE_GTK3.
2365 (x_error_handler): Ignore BadMatch for X_SetInputFocus for
2366 HAVE_GTK3 (Bug#9869).
b77a6a7f 2367
3b574623
JD
2368 * gtkutil.c (xg_win_to_widget, xg_event_is_for_menubar): Initialize
2369 type to GDK_NOTHING so valgrind does not complain (Bug#9901).
2370
b77a6a7f
JD
2371 * xterm.h (x_display_info): Add Xatom_net_wm_state_hidden (Bug#9893).
2372
2373 * xterm.c: Declare x_handle_net_wm_state to return int.
2374 (handle_one_xevent): Check if we are iconified but don't have
2375 _NET_WM_STATE_HIDDEN. If do, treat as deiconify (Bug#9893).
2376 (get_current_wm_state): Return non-zero if not hidden,
2377 check for _NET_WM_STATE_HIDDEN (Bug#9893).
2378 (do_ewmh_fullscreen): Ignore return value from get_current_wm_state.
2379 (x_handle_net_wm_state): Return what get_current_wm_state returns.
2380 (x_term_init): Initialize dpyinfo->Xatom_net_wm_state_hidden.
2381
196e41e4
PE
23822011-10-29 Paul Eggert <eggert@cs.ucla.edu>
2383
2384 * alloc.c (which_symbols): Declare EXTERNALLY_VISIBLE,
2385 so that this new function doesn't get optimized away by a
2386 whole-program optimizer. Make the 2nd arg EMACS_INT, not int.
2387
021f2e1a
AS
23882011-10-29 Andreas Schwab <schwab@linux-m68k.org>
2389
2390 * frame.h (MOUSE_HL_INFO): Remove excess parens.
2391
8b058d44
EZ
23922011-10-29 Eli Zaretskii <eliz@gnu.org>
2393
2394 Fix the `xbytecode' command.
2395 * .gdbinit (xprintbytestr): New command.
b50a28de 2396 (xwhichsymbols): Rename from `which'; all callers changed.
8b058d44
EZ
2397 (xbytecode): Print the byte-code string as well.
2398
4452fb80
EZ
23992011-10-29 Kim Storm <storm@cua.dk>
2400
8b058d44
EZ
2401 * alloc.c (which_symbols): New function.
2402
21b72067
AS
24032011-10-29 Andreas Schwab <schwab@linux-m68k.org>
2404
2405 * minibuf.c (read_minibuf_noninteractive): Allow reading empty
2406 line. (Bug#9903)
2407
83ed7b5c
GM
24082011-10-29 Glenn Morris <rgm@gnu.org>
2409
2410 * process.c (wait_reading_process_output): Revert 2009-08-30 change.
2411 Not clear what it was for, and it causes various bugs. (Bug#9839)
2412
5a7a728b
EZ
24132011-10-28 Eli Zaretskii <eliz@gnu.org>
2414
2415 * xdisp.c (note_mouse_highlight): Initialize `part', to avoid a
2416 possible random value that matches one of those tested as
2417 condition to clear the mouse face.
2418
d3d0842f
CY
24192011-10-28 Chong Yidong <cyd@gnu.org>
2420
2421 * xdisp.c (note_mouse_highlight): Fix use of uninitialized var.
2422
31b39d13
DN
24232011-10-28 Dan Nicolaescu <dann@ics.uci.edu>
2424
2425 * window.c (make_window): Initialize phys_cursor_on_p.
2426
9aba6043
SM
24272011-10-28 Stefan Monnier <monnier@iro.umontreal.ca>
2428
2429 * lisp.h (struct Lisp_Symbol): Update comments.
2430
c20992f4
JB
24312011-10-28 Juanma Barranquero <lekktu@gmail.com>
2432
2433 * w32font.c (w32_load_unicows_or_gdi32): Add missing return.
2434
db4f02f2
EZ
24352011-10-28 Eli Zaretskii <eliz@gnu.org>
2436
2437 Fix Emacs on Windows 9X (bug#8562). Thanks to oslsachem
2438 <oslsachem@gmail.com> for helping to debug this.
2439
2440 * w32font.c (g_b_init_is_w9x, g_b_init_get_outline_metrics_w)
2441 (g_b_init_get_text_metrics_w, g_b_init_get_glyph_outline_w)
2442 (g_b_init_get_glyph_outline_w): New static variables.
2443 (GetOutlineTextMetricsW_Proc, GetTextMetricsW_Proc)
2444 (GetGlyphOutlineW_Proc): New typedefs.
2445 (w32_load_unicows_or_gdi32, get_outline_metrics_w)
9aba6043
SM
2446 (get_text_metrics_w, get_glyph_outline_w, globals_of_w32font):
2447 New functions.
2448 (w32font_open_internal, compute_metrics):
2449 Call get_outline_metrics_w, get_text_metrics_w, and get_glyph_outline_w
db4f02f2
EZ
2450 instead of calling the "wide" APIs directly.
2451
2452 * emacs.c (main) [HAVE_NTGUI]: Call globals_of_w32font.
2453
2454 * w32.h (syms_of_w32font): Add prototype.
2455
87e68db4
JB
24562011-10-27 Juanma Barranquero <lekktu@gmail.com>
2457
2458 * window.c (Fframe_root_window, Fframe_first_window, Fwindow_end)
2459 (Fframe_selected_window, Ftemp_output_buffer_show, Fnext_window)
2460 (Fdelete_window_internal, Fwindow_parameters): Fix typos in docstrings.
2461 (Fmove_to_window_line): Doc fix.
2462
435c1d67
CY
24632011-10-27 Chong Yidong <cyd@gnu.org>
2464
2465 * process.c (make_process): Set gnutls_state to NULL.
2466
2467 * gnutls.c (emacs_gnutls_deinit): Deinit the gnutls_state if it is
2468 non-NULL, regardless of GNUTLS_INITSTAGE.
2469 (Fgnutls_boot): Cleanups. Call emacs_gnutls_deinit if we signal
2470 an error. Set process slots as soon as we allocate them.
2471
2472 * gnutls.h (GNUTLS_LOG, GNUTLS_LOG2): Fix macros.
2473
9c6c6f49
CY
24742011-10-27 Chong Yidong <cyd@gnu.org>
2475
9aba6043
SM
2476 * gnutls.c (emacs_gnutls_deinit): New function.
2477 Deallocate credentials structures as well as calling gnutls_deinit.
9c6c6f49
CY
2478 (Fgnutls_deinit, Fgnutls_boot): Use it.
2479
2480 * process.c (make_process): Initialize GnuTLS credentials to NULL.
2481 (deactivate_process): Call emacs_gnutls_deinit.
2482
657d08d3
JB
24832011-10-27 Juanma Barranquero <lekktu@gmail.com>
2484
2485 * image.c (x_create_x_image_and_pixmap):
2486 * w32.c (sys_rename, w32_delayed_load):
2487 * w32font.c (fill_in_logfont):
2488 * w32reg.c (x_get_string_resource): Silence compiler warnings.
2489
5430d399
JB
24902011-10-26 Juanma Barranquero <lekktu@gmail.com>
2491
2492 * w32fns.c (w32_default_color_map): New function,
2493 extracted from Fw32_default_color_map.
a7ef684b 2494 (Fw32_default_color_map, Fx_open_connection): Use it. (Bug#9785)
5430d399 2495
fe0055fa
PE
24962011-10-25 Paul Eggert <eggert@cs.ucla.edu>
2497
2498 * dispextern.h (Fcontrolling_tty_p): New decl (Bug#6649 part 2).
2499
e6346438
SM
25002011-10-25 Stefan Monnier <monnier@iro.umontreal.ca>
2501
2502 * keyboard.c (test_undefined): New function (bug#9751).
2503 (read_key_sequence): Use it to detect when a key is bound to `undefined'.
2504
e112cc37
ET
25052011-10-25 Enami Tsugutomo <tsugutomo.enami@jp.sony.com>
2506
2507 * sysdep.c (init_sys_modes): Fix the check for the controlling
2508 terminal (Bug#6649).
2509
7b5d6677
EZ
25102011-10-20 Eli Zaretskii <eliz@gnu.org>
2511
2512 * dispextern.h (struct bidi_it): New member next_en_type.
2513
2514 * bidi.c (bidi_line_init): Initialize the next_en_type member.
2515 (bidi_resolve_explicit_1): When next_en_pos is valid for the
2516 current character, check also for next_en_type being WEAK_EN.
2517 (bidi_resolve_weak): Don't enter the expensive loop if the current
2518 position is before next_en_pos. Record the bidi type of the first
2519 non-ET, non-BN character we find, in addition to its position.
2520 (bidi_level_of_next_char): Invalidate next_en_type when
2521 next_en_pos is over-stepped.
2522
7da0b018
PE
25232011-10-20 Paul Eggert <eggert@cs.ucla.edu>
2524
2525 Time zone name fixes for non-ASCII locales (Bug#641, Bug#9794)
2526 * editfns.c: Rewrite current-time-zone so that it invokes
2527 the equivalent of (format-time-string "%Z") to get the time zone name.
2528 This fixes a bug when the time zone name contains characters that
2529 need converting from the system time locale to Emacs internal format.
2530 This fixes a shortcoming that I introduced in my 1999-10-19 patch:
2531 that patch fixed format-time-string to do the conversion, but
2532 I forgot to fix current-time-zone.
2533 (format_time_string): New function, containing most of
2534 what Fformat_time_string used to contain.
2535 (Fformat_time_string): Rewrite in terms of format_time_string.
2536 This doesn't change this function's behavior.
2537 (current-time-zone): Rewrite to use format_time_string.
2538 This fixes the bug reported by Michael Schierl in
2539 <http://lists.gnu.org/archive/html/emacs-devel/2007-06/msg00334.html>.
2540 Jason Rumney's 2007-06-07 change worked around this bug, but
2541 didn't fix it.
2542 * systime.h (tzname, timezone): Remove no-longer-used declarations.
2543
8547b010
EZ
25442011-10-19 Eli Zaretskii <eliz@gnu.org>
2545
2546 * xdisp.c (start_display): If the character at POS is displayed
2547 via a display vector, reset IT->current.dpvec_index to zero.
12b32963
EZ
2548 (try_window_reusing_current_matrix): If a line ends in a display
2549 vector or the next line starts in a display vector, continue
2550 redrawing the window even though the character position of
2551 start_row was reached.
8547b010
EZ
2552 (Bug#9771, part 2)
2553
4e948d15
CY
25542011-10-18 Chong Yidong <cyd@gnu.org>
2555
2556 * xdisp.c (get_next_display_element): Handle U+2010 and U+2011
2557 with nobreak-char-display too.
2558
4787455f
EZ
25592011-10-18 Eli Zaretskii <eliz@gnu.org>
2560
2561 Fix part 3 of bug#9771.
2562 * bidi.c (bidi_line_init): Initialize next_en_pos to zero, not -1.
2563 (bidi_resolve_neutral): Don't enter the expensive loop looking for
2564 non-neutral characters if the current character is a paragraph
2565 separator (a.k.a. Newline). This avoids running the same
2566 expensive loop twice, once when we consume the preceding newline
2567 and the other time when the line actually needs to be displayed.
2568 Avoid the loop when we see neutrals on the base embedding level
2569 following a character whose directionality is the same as the
2570 paragraph's. This avoids running the expensive loop when a line
2571 ends in a long sequence of neutrals, like control characters.
2572 Add assertion against STRONG_AL type. Slightly rearrange code
2573 that determines the type of a neutral given the first non-neutral
2574 that follows it.
2575 (bidi_level_of_next_char): Set next_en_pos to zero when
2576 invalidating its info.
2577
2c91f553
EZ
25782011-10-17 Eli Zaretskii <eliz@gnu.org>
2579
2580 * xdisp.c (push_display_prop): Determine whether to record string
2581 or buffer position by IT->string, not by IT->method. Allow
2582 GET_FROM_DISPLAY_VECTOR as IT->method on entry. (Bug#9771, part 4)
f2ff9e88
EZ
2583 (move_it_vertically_backward): Don't look for character position
2584 immediately after the newline when in a continuation line.
2585 (Bug#9771, part 1)
2c91f553 2586
c7b08b0d
MR
25872011-10-15 Martin Rudalics <rudalics@gmx.at>
2588
2589 * window.c (coordinates_in_window): Rewrite and delabelize
2590 vertical border check. (Bug#5357) (Bug#9618)
2591
6b02f655
SM
25922011-10-14 Stefan Monnier <monnier@iro.umontreal.ca>
2593
2594 * xterm.c (frame_highlight, frame_unhighlight): Ignore unexplained
2595 errors in XSetWindowBorder (bug#9310).
2596
81d40c92
DA
25972011-10-13 Dmitry Antipov <dmantipov@yandex.ru>
2598
2599 * editfns.c (Fset_time_zone_rule): Replace free with xfree to
2600 avoid crash when xmalloc overrun checking is enabled.
2601
d4172c3b
EZ
26022011-10-13 Eli Zaretskii <eliz@gnu.org>
2603
2604 * xdisp.c (Fcurrent_bidi_paragraph_direction): Initialize
2605 itb.paragraph_dir to NEUTRAL_DIR. Fixes an occasional incorrect
2606 cursor motion with <left> and <right> arrow keys.
2607
2608 * bidi.c (bidi_init_it): Don't initialize paragraph_dir here, as
2609 some callers set that themselves.
2610
b00eea75
EZ
26112011-10-12 Eli Zaretskii <eliz@gnu.org>
2612
2613 * xdisp.c (find_row_edges): Handle the case where ROW comes from a
2614 display string and the previous row comes from the same string and
2615 is empty. (Bug#9739) (Bug#9738)
2616
8fe012c4
SM
26172011-10-12 Stefan Monnier <monnier@iro.umontreal.ca>
2618
2619 * doc.c (get_doc_string): Encode file name (bug#9735).
2620
0074aef2
EZ
26212011-10-12 Eli Zaretskii <eliz@gnu.org>
2622
79beb178
EZ
2623 * bidi.c (bidi_level_of_next_char):
2624 * xdisp.c (get_visually_first_element): Remove old incorrect
2625 comments regarding the Unicode Line Separator character.
2626
0074aef2
EZ
2627 * bidi.c (bidi_init_it): Initialize paragraph_dir to NEUTRAL_DIR.
2628
6e4b3fbe
DA
26292011-10-12 Dmitry Antipov <dmantipov@yandex.ru>
2630
2631 * alloc.c (Fgc_status): Do not access beyond zombies array
2632 boundary if nzombies > MAX_ZOMBIES.
2633 * alloc.c (dump_zombies): Add missing format specifier.
2634
0324f3af
PE
26352011-10-12 Paul Eggert <eggert@cs.ucla.edu>
2636
b5525cac
PE
2637 * xdisp.c (set_cursor_from_row): Simplify conditionals,
2638 to pacify GCC 4.6.1 x86-64 with -O2 -Wstrict-overflow.
2639
0324f3af
PE
2640 * lread.c (read_escape): Allow hex escapes as large as ?\xfffffff.
2641 Some packages use them to denote characters with modifiers.
2642
e9b5f888
AS
26432011-10-11 Andreas Schwab <schwab@linux-m68k.org>
2644
2645 * lisp.h (GCPRO1_VAR, GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR)
2646 (GCPRO5_VAR, GCPRO6_VAR, UNGCPRO_VAR): Add whitespace to avoid
2647 matching a pp-number. Rename parameter var to var1.
2648
127827c0
SM
26492011-10-11 Stefan Monnier <monnier@iro.umontreal.ca>
2650
2651 * minibuf.c (Finternal_complete_buffer): Fix last change (bug#9709).
2652
c8fd3bd0
GM
26532011-10-08 Glenn Morris <rgm@gnu.org>
2654
2655 * callint.c (Fcall_interactively): Give a more explicit error for the
2656 'c' case with a non-character input. (Bug#8479)
2657
352ec8ff
EZ
26582011-10-08 Eli Zaretskii <eliz@gnu.org>
2659
03669ccb
EZ
2660 * xdisp.c (hscroll_window_tree): Support hscroll in right-to-left
2661 lines.
7061c986
EZ
2662 (set_cursor_from_row): Fix cursor positioning in mixed L2R+R2L
2663 lines that are hscrolled on the left.
03669ccb 2664
352ec8ff
EZ
2665 * dispnew.c (buffer_posn_from_coords): Account for a possible
2666 presence of header-line. (Bug#4426)
2667
a66cfb1c
SM
26682011-10-07 Stefan Monnier <monnier@iro.umontreal.ca>
2669
6b02f655
SM
2670 * buffer.c (syms_of_buffer) <enable-multibyte-characters>:
2671 Don't advertise functionality which we discourage or doesn't work.
a66cfb1c 2672
7c5ee88e
PE
26732011-10-07 Paul Eggert <eggert@cs.ucla.edu>
2674
2675 * alloc.c (GC_LISP_OBJECT_ALIGNMENT): Use offsetof, not __alignof__
2676 or sizeof. __alignof__ gives the wrong answer on Fedora x86-64
2677 with GCC 4.6.1 when configured with CC='gcc -m32' --with-wide-int;
2678 this makes Emacs dump core during garbage collection on rare
2679 occasions. sizeof is obviously inferior to offsetof here, so
2680 stick with offsetof.
2681 (GC_POINTER_ALIGNMENT): New macro.
2682 (mark_memory): Omit 3rd (offset) arg; caller changed.
2683 Don't assume EMACS_INT alignment is the same as pointer alignment.
2684
df1bbe5b
SM
26852011-10-03 Stefan Monnier <monnier@iro.umontreal.ca>
2686
2687 * keyboard.c (read_key_sequence_remapped): New var.
2688 (read_key_sequence): Compute remapping in the right buffer.
2689 (command_loop_1): Use read_key_sequence's remapping directly.
2690
51553db6
SM
26912011-10-02 Stefan Monnier <monnier@iro.umontreal.ca>
2692
32c1fffd
SM
2693 * dired.c (file_name_completion): Don't expand file name.
2694 (Ffile_name_completion, Ffile_name_all_completions): Expand file name
2695 before checking file name handler.
2696
51553db6
SM
2697 * minibuf.c (Finternal_complete_buffer): Only show internal buffers if
2698 they've been requested explicitly (bug#9591).
2699
b6bd1599 27002011-10-01 Andreas Schwab <schwab@linux-m68k.org>
fa2ec41f
AS
2701
2702 * keymap.c (Fsingle_key_description): Use make_specified_string
2703 instead of build_string to build string from push_key_description.
2704 (Bug#5193)
2705
f701dc2a
PE
27062011-09-30 Paul Eggert <eggert@cs.ucla.edu>
2707
4222c55d
PE
2708 * buffer.h (struct buffer): Use time_t, not int, for a time stamp.
2709 This fixes a Y2038 bug on 64-bit hosts.
2710 * buffer.c (reset_buffer):
2711 * fileio.c (Fdo_auto_save, Fset_buffer_auto_saved)
2712 (Fclear_buffer_auto_save_failure):
2713 Use 0, not -1, to represent an unset failure time, since time_t
2714 might not be signed.
2715
f701dc2a
PE
2716 Remove dependency on glibc malloc internals.
2717 * alloc.c (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
2718 Move back here from lisp.h, but with their new implementations.
2719 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
2720 (XMALLOC_OVERRUN_SIZE_SIZE): Move these new lisp.h macros here.
2721 * charset.c (charset_table_init): New static var.
2722 (syms_of_charset): Use it instead of xmalloc. This removes a
2723 dependency on glibc malloc internals. See Eli Zaretskii's comment in
2724 <http://lists.gnu.org/archive/html/emacs-devel/2011-09/msg00815.html>.
2725 * lisp.h (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
2726 Move back to alloc.c.
2727 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
2728 (XMALLOC_OVERRUN_SIZE_SIZE): Move to alloc.c.
2729
9ceebf39
JD
27302011-09-30 Jan Djärv <jan.h.d@swipnet.se>
2731
2732 * nsterm.m (windowDidResize): Call x_set_window_size only when
2733 ns_in_resize is true. Otherwise set pixelwidth/height and
2734 call change_frame_size (Bug#9628).
2735
cb993c58
PE
27362011-09-30 Paul Eggert <eggert@cs.ucla.edu>
2737
3930c88b
PE
2738 Port --enable-checking=all to Fedora 14 x86-64.
2739 * charset.c (syms_of_charset): Also account for glibc malloc's
2740 internal overhead when calculating the initial malloc maximum.
2741
cb993c58
PE
2742 Port --enable-checking=all to Fedora 14 x86.
2743 * alloc.c (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
2744 Move to lisp.h.
2745 (xmalloc_put_size, xmalloc_get_size, overrun_check_malloc)
2746 (overrun_check_realloc, overrun_check_free):
2747 Use XMALLOC_OVERRUN_SIZE_SIZE, not sizeof (size_t).
2748 That way, xmalloc returns a properly-aligned pointer even if
2749 XMALLOC_OVERRUN_CHECK is defined. The old debugging code happened
2750 to align OK on typical 64-bit hosts, but not on Fedora 14 x86.
2751 * charset.c (syms_of_charset): Take XMALLOC_OVERRUN_CHECK_OVERHEAD
2752 into account when calculating the initial malloc maximum.
2753 * lisp.h (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
2754 Move here from alloc.c, so that charset.c can use it too.
2755 Properly align; the old code wasn't right for common 32-bit hosts
2756 when configured with --enable-checking=all.
2757 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
2758 (XMALLOC_OVERRUN_SIZE_SIZE): New macros.
2759
31bed486
EZ
27602011-09-29 Eli Zaretskii <eliz@gnu.org>
2761
04c70788 2762 * sysdep.c (snprintf) [!EOVERFLOW]: If EOVERFLOW is not defined,
31bed486
EZ
2763 use EDOM.
2764
fbcaa2f3
EZ
27652011-09-28 Eli Zaretskii <eliz@gnu.org>
2766
2767 * xdisp.c (compute_display_string_end): If there's no display
2768 string at CHARPOS, return -1.
2769
2770 * bidi.c (bidi_fetch_char): When compute_display_string_end
2771 returns a negative value, treat the character as a normal
2772 character not covered by a display string. (Bug#9624)
2773
a239d4e9
JB
27742011-09-28 Juanma Barranquero <lekktu@gmail.com>
2775
2776 * lread.c (Fread_from_string): Fix typo in docstring.
2777
88652fd5
EZ
27782011-09-27 Eli Zaretskii <eliz@gnu.org>
2779
2780 * xdisp.c (handle_invisible_prop): If invisible text ends on a
2781 newline, reseat the iterator instead of bidi-iterating there one
2782 character at a time. (Bug#9610)
32c1fffd
SM
2783 (BUFFER_POS_REACHED_P, move_it_in_display_line_to): Bail when past
2784 TO_CHARPOS if the bidi iterator is at base embedding level.
88652fd5 2785
ed497dd4
AS
27862011-09-27 Andreas Schwab <schwab@linux-m68k.org>
2787
2788 * lread.c (readevalloop): Use correct code for NBSP.
2789 (read1): Likewise. (Bug#9608)
2790
b2bf61aa
MA
27912011-09-25 Michael Albinus <michael.albinus@gmx.de>
2792
2793 * dbusbind.c (Fdbus_register_signal): When service is not
2794 registered, use nil in Vdbus_registered_objects_table. (Bug#9581)
2795
32bbb17c
GM
27962011-09-25 Glenn Morris <rgm@gnu.org>
2797
2798 * buffer.c (truncate-lines): Doc fix.
2799
94e0933e
CY
28002011-09-24 Chong Yidong <cyd@stupidchicken.com>
2801
2802 * window.c (Fwindow_prev_buffers, Fset_window_prev_buffers)
2803 (Fset_window_next_buffers): Doc fix.
2804
cddde921
GM
28052011-09-24 Glenn Morris <rgm@gnu.org>
2806
2807 * minibuf.c (read_minibuf): Disable line truncation. (Bug#5715)
2808
1260aef1
PE
28092011-09-24 Paul Eggert <eggert@cs.ucla.edu>
2810
25b4bfa0
PE
2811 Fix minor problems found by static checking.
2812 * xdisp.c (string_from_display_spec): Don't assume vecsize fits in int.
1260aef1
PE
2813 * indent.c (Fvertical_motion): Fix == vs = typo.
2814
e3cbd34b
EZ
28152011-09-24 Eli Zaretskii <eliz@gnu.org>
2816
a66cfb1c
SM
2817 * dispnew.c (syms_of_display) <redisplay-dont-pause>:
2818 Default value is now t. Doc fix.
6bf7006f 2819
e3cbd34b 2820 * indent.c (Fvertical_motion): Compute and apply the overshoot
32c1fffd 2821 logic when moving up, not only when moving down. Fix the
e3cbd34b 2822 confusing name and values of the it_overshoot_expected variable;
32c1fffd 2823 logic changes accordingly. (Bug#9254) (Bug#9549)
e3cbd34b
EZ
2824
2825 * xdisp.c (pos_visible_p): Produce correct pixel coordinates when
2826 CHARPOS is covered by a display string which includes newlines.
2827 (move_it_vertically_backward): Avoid inflooping when START_CHARPOS
2828 is covered by a display string with embedded newlines.
2829
a3de0cbd
MA
28302011-09-24 Michael Albinus <michael.albinus@gmx.de>
2831
2832 * dbusbind.c (Fdbus_register_signal): Add match rule to
2833 Vdbus_registered_objects_table. (Bug#9581)
a66cfb1c
SM
2834 (Fdbus_register_method, Vdbus_registered_objects_table):
2835 Fix docstring.
a3de0cbd 2836
b260039d
JM
28372011-09-24 Jim Meyering <meyering@redhat.com>
2838
32c1fffd 2839 do not ignore write error for any output size
b260039d
JM
2840 The previous change was incomplete.
2841 While it makes emacs --batch detect the vast majority of stdout
2842 write failures, errors were still ignored whenever the output size is
2843 k * (BUFSIZ+1) - 4. E.g., on a system with BUFSIZ of 4096,
2844 $ emacs --batch --eval '(print (format "%4093d" 0))' > /dev/full \
2845 && echo FAIL: ignored write error
2846 FAIL: ignored write error
2847 $ emacs --batch --eval '(print (format "%20481d" 0))' > /dev/full \
2848 && echo FAIL: ignored write error
2849 FAIL: ignored write error
2850 * emacs.c (Fkill_emacs): Also test ferror. (Bug#9574)
2851
8eca8a7c
AS
28522011-09-23 Andreas Schwab <schwab@linux-m68k.org>
2853
2854 * emacs.c (Fkill_emacs): In noninteractive mode exit
2855 non-successfully if a write error occurred on stdout. (Bug#9574)
2856
3341db62
EZ
28572011-09-21 Eli Zaretskii <eliz@gnu.org>
2858
2859 * xdisp.c (pop_it): Allow it->object that is a cons cell to pass
2860 the xassert test.
2861
2862 * dispextern.h (struct it): Update the comment documenting what
2863 can it->OBJECT be.
2864
8c203dbf
EZ
28652011-09-20 Eli Zaretskii <eliz@gnu.org>
2866
2867 * xdisp.c (set_cursor_from_row): If the row ends in a newline from
2868 a display string, extend search for cursor position to end of row.
2869 (find_row_edges): If the row ends in a newline from a display
2870 string, increment its MATRIX_ROW_END_CHARPOS by one. (Bug#9549)
2871 Handle the case of a display string with multiple newlines.
fd317ddf
EZ
2872 (Fcurrent_bidi_paragraph_direction): Fix search for previous
2873 non-empty line. Fixes confusing cursor motion with arrow keys at
2874 the beginning of a line that starts with whitespace.
8c203dbf 2875
a4824228
LMI
28762011-09-19 Lars Magne Ingebrigtsen <larsi@gnus.org>
2877
2878 * lread.c (Fread_from_string): Document what FINAL-STRING-INDEX is
2879 (bug#9493).
2880
33ed493b
CY
28812011-09-18 Chong Yidong <cyd@stupidchicken.com>
2882
2883 * xfns.c (Fx_create_frame): Handle the bitmapIcon resource as
2884 boolean (Bug#9154).
2885
56cd55c8
EZ
28862011-09-18 Eli Zaretskii <eliz@gnu.org>
2887
2888 * xdisp.c (display_line): Record maximum and minimum buffer
2889 positions even if no glyphs were produced (e.g., by a zero-width
2890 stretch). Fixes bug#9530 on a TTY. Under word-wrap, don't record
2891 buffer positions that will be removed from the glyph row because
2892 they don't fit.
c02dcedf
EZ
2893 (produce_stretch_glyph): Fix a bug in :align-to on a TTY when the
2894 column is beyond frame width: don't subtract 1 "pixel" when
2895 computing width of the stretch.
3e62b7e0
EZ
2896 (reseat_at_next_visible_line_start): Undo the change made on
2897 2011-09-17 that saved paragraph information and restored it after
2898 the call to `reseat'. (Bug#9545)
56cd55c8 2899
5ed99d36 29002011-09-18 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
3390454c
YM
2901
2902 * xdisp.c (expose_window): Save original value of phys_cursor_on_p
2903 and turn window cursor on if cleared (Bug#9415).
2904
5ed99d36 29052011-09-18 Andreas Schwab <schwab@linux-m68k.org>
edb7b4dc
AS
2906
2907 * search.c (boyer_moore): Take unibyte characters from pattern
2908 literally. (Bug#9458)
2909
9bade7b2
EZ
29102011-09-18 Eli Zaretskii <eliz@gnu.org>
2911
2912 * xdisp.c (reseat_at_next_visible_line_start): Fix last change.
2913
e5e9d610
PE
29142011-09-18 Paul Eggert <eggert@cs.ucla.edu>
2915
87e4427a
PE
2916 Fix minor problem found by static checking.
2917 * xdisp.c (reseat_at_next_visible_line_start): Mark locals as
2918 initialized, to pacify gcc -Wuninitialized.
2919
e5e9d610
PE
2920 * fileio.c: Report proper errno when syscall falls.
2921 (Finsert_file_contents): Save and restore errno,
2922 so that report_file_error outputs the correct diagnostic.
2923 (Fwrite_region) [CLASH_DETECTION]: Likewise.
2924
a1674f0b
EZ
29252011-09-18 Eli Zaretskii <eliz@gnu.org>
2926
2927 * .gdbinit (pgx): Fix references to fields of `struct glyph'.
2928
fbfb6dd4
EZ
29292011-09-17 Eli Zaretskii <eliz@gnu.org>
2930
2931 * xdisp.c (produce_stretch_glyph): Another fix for changes made on
2932 2011-08-30T17:32:44Z!eliz@gnu.org. (Bug#9530)
2933
bb187662
EZ
29342011-09-17 Eli Zaretskii <eliz@gnu.org>
2935
1137e8b8 2936 * xdisp.c (reseat_at_next_visible_line_start): Keep information
6b02f655 2937 about the current paragraph and restore it after the call to reseat.
1137e8b8
EZ
2938
2939 * bidi.c (MAX_PARAGRAPH_SEARCH): New macro.
2940 (bidi_find_paragraph_start): Search back for paragraph beginning
2941 at most MAX_PARAGRAPH_SEARCH lines; if not found, return BEGV_BYTE.
2942 (bidi_move_to_visually_next): Only trigger paragraph-related
2943 computations when the last character is a newline or at EOB, not
2944 just any NEUTRAL_B. (Bug#9470)
2945
bb187662
EZ
2946 * xdisp.c (set_cursor_from_row): Don't invoke special treatment of
2947 truncated lines if point is covered by a display string. (Bug#9524)
2948
2e621251
PE
29492011-09-16 Paul Eggert <eggert@cs.ucla.edu>
2950
2951 * xselect.c: Relax test for outgoing X longs (Bug#9498).
2952 (cons_to_x_long): New function.
2953 (lisp_data_to_selection_data): Use it. Correct the test for
2954 short-versus-long data; it was negated. Break out of vector
2955 loop, for efficiency, when a long datum is discovered.
2956
91a15bc6
SM
29572011-09-16 Stefan Monnier <monnier@iro.umontreal.ca>
2958
2959 * eval.c (Fquote): Document its non-consing behavior (bug#9482).
2960
b41c3a35
EZ
29612011-09-16 Eli Zaretskii <eliz@gnu.org>
2962
2963 * image.c (tiff_handler): Work around a bug in MinGW GCC 3.x (see
2964 GCC PR/17406) by declaring this function with external scope.
2965
7812ba2d
PE
29662011-09-15 Paul Eggert <eggert@cs.ucla.edu>
2967
2968 * editfns.c (Fformat): Fix bug in text-property fix (Bug#9514).
2969 Don't mishandle (length (format "%%")) and (format "%4000s%%" "").
2970
cf7edc2a
AS
29712011-09-15 Andreas Schwab <schwab@linux-m68k.org>
2972
2973 * editfns.c (Fformat): Correctly handle text properties on "%%".
2974
bd01620e
EZ
29752011-09-15 Eli Zaretskii <eliz@gnu.org>
2976
2977 * xterm.c (x_draw_composite_glyph_string_foreground):
2978 * w32term.c (x_draw_composite_glyph_string_foreground):
2979 * term.c (encode_terminal_code):
2980 * composite.c (composition_update_it, get_composition_id):
2981 * xdisp.c (get_next_display_element)
2982 (fill_composite_glyph_string): Add comments about special meaning
2983 of TAB characters in a composition.
2984
a02719a3
PE
29852011-09-15 Paul Eggert <eggert@cs.ucla.edu>
2986
2987 * editfns.c (Fformat): Fix off-by-1 bug for "%%b" (Bug#9514).
4c122725
PE
2988 This occurs when processing a multibyte format.
2989 Problem reported by Wolfgang Jenker.
a02719a3 2990
72589a3c
JB
29912011-09-15 Johan Bockgård <bojohan@gnu.org>
2992
2993 * xdisp.c (try_cursor_movement): Only check for exact match if
2994 cursor hpos found by set_cursor_from_row is valid. (Bug#9495)
2995
1c14176c
PE
29962011-09-14 Paul Eggert <eggert@cs.ucla.edu>
2997
2998 Remove unused external symbols.
2999 * dispextern.h (calc_pixel_width_or_height): Remove decl.
3000 * xdisp.c (calc_pixel_width_or_height): Now static.
3001 * doprnt.c (exprintf) [! (HAVE_X_WINDOWS && USE_X_TOOLKIT)]: Remove.
3002 * indent.c (check_display_width):
3003 * w32term.c: Fix comment to match code.
3004 * xterm.c, xterm.h (x_catching_errors): Remove.
3005
d2eea5b5
PE
30062011-09-14 Paul Eggert <eggert@cs.ucla.edu>
3007
3008 * xselect.c: Use signed conversions more consistently (Bug#9498).
3009 (selection_data_to_lisp_data): Assume incoming selection data are
3010 signed integers, not unsigned. This is to be consistent with
3011 outgoing selection data, which was modified to use signed integers
3012 in as part of the fix to Bug#9196 in response to Jan D.'s comment
3013 in <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9196#32> that X11
3014 expects long, not unsigned long.
3015
46888499
EZ
30162011-09-14 Eli Zaretskii <eliz@gnu.org>
3017
3018 * xdisp.c (try_window_reusing_current_matrix): Fix incorrect
3019 computation of loop end. Reported by Johan Bockgård
3020 <bojohan@gnu.org>.
3021
ef8ef9fb
CY
30222011-09-13 Chong Yidong <cyd@stupidchicken.com>
3023
3024 * frame.c (Fother_visible_frames_p): Function deleted.
3025
fa819fed
EZ
30262011-09-12 Eli Zaretskii <eliz@gnu.org>
3027
3028 * indent.c (compute_motion): Process display vector front to back
3029 rather than the other way around. (Bug#2496)
3030
2ba8e008
SM
30312011-09-12 Stefan Monnier <monnier@iro.umontreal.ca>
3032
3033 * fileio.c (Finsert_file_contents): Don't assume beg_offset is 0.
3034
20f53c69
CY
30352011-09-11 Chong Yidong <cyd@stupidchicken.com>
3036
3037 * minibuf.c (Fread_from_minibuffer): Doc fix.
3038
d562d7a4
EZ
30392011-09-11 Eli Zaretskii <eliz@gnu.org>
3040
3041 * xdisp.c (produce_stretch_glyph): Fix a typo made in changes from
3042 2011-08-30T17:32:44Z!eliz@gnu.org. (Bug#9475)
3043
1c4d7f3d
LMI
30442011-09-11 Lars Magne Ingebrigtsen <larsi@gnus.org>
3045
3046 * fileio.c (Fvisited_file_modtime): Document `(-1 65535)' as a
3047 value for non-existent files.
3048
b885bf36
EZ
30492011-09-11 Eli Zaretskii <eliz@gnu.org>
3050
3051 * fileio.c (Finsert_file_contents): If the file cannot be opened,
3052 set its "size" to -1. This will set the modtime_size field of
3053 the corresponding buffer to -1, which is what
3054 verify-visited-file-modtime expects for files that do not exist.
3055 (Bug#9139)
3056
6612f0bf
PE
30572011-09-11 Paul Eggert <eggert@cs.ucla.edu>
3058
3059 * keymap.h (KEY_DESCRIPTION_SIZE, push_key_description): Move decls
3060 here ...
3061 * lisp.h: ... from here. push_key_description is no longer
3062 defined in keyboard.c, so its declaration should not be in
3063 lisp.h's "Defined in keyboard.c" section, and KEY_DESCRIPTION_SIZE
3064 logically belongs with push_key_description.
3065
dfb3f755
PE
30662011-09-10 Paul Eggert <eggert@cs.ucla.edu>
3067
3068 * buffer.h: Include <sys/types.h> instead of <time.h>.
3069 Otherwise, off_t wasn't defined on FreeBSD 9.0-BETA2 i386.
3070 Problem reported by Herbert J. Skuhra.
3071
3134906c
LMI
30722011-09-10 Lars Magne Ingebrigtsen <larsi@gnus.org>
3073
3074 * xml.c (parse_region): Make the parsing work for
3075 non-comment-starting XML files again (bug#9144).
3076
8d903f4e
AS
30772011-09-10 Andreas Schwab <schwab@linux-m68k.org>
3078
3079 * image.c (gif_load): Fix calculation of bottom and right corner.
3080 (Bug#9468)
3081
80ad64f4
EZ
30822011-09-10 Eli Zaretskii <eliz@gnu.org>
3083
3084 * xdisp.c (MAX_DISP_SCAN): Decrease to 250. Prevents sluggish
3085 redisplay in small windows.
3086
208a048d
EZ
30872011-09-09 Eli Zaretskii <eliz@gnu.org>
3088
3089 * frame.c (x_report_frame_params): Cast to avoid compiler warnings.
3090
9b1c252e
MR
30912011-09-08 Martin Rudalics <rudalics@gmx.at>
3092
3093 * window.c (Fset_window_prev_buffers, Fset_window_next_buffers):
3094 Operate on live windows only.
3095
2949f33b
JB
30962011-09-08 Juanma Barranquero <lekktu@gmail.com>
3097
3098 * emacs.c (my_heap_start): #ifdef to avoid warnings when unused.
3099
e08dcafd
EZ
31002011-09-07 Eli Zaretskii <eliz@gnu.org>
3101
3102 * xdisp.c (move_it_in_display_line_to): Call RESTORE_IT on ppos_it
3103 only under bidi iteration.
3104
115b96bd
JD
31052011-09-07 Jan Djärv <jan.h.d@swipnet.se>
3106
3107 * gtkutil.c (xg_make_tool_item): Insert comment about eventbox.
3108
c8199d0f
PE
31092011-09-06 Paul Eggert <eggert@cs.ucla.edu>
3110
3111 isnan: Fix porting problem to Solaris 10 with bundled gcc.
3112 Without this fix, the command to link temacs failed due to an
3113 undefined symbol __builtin_isnan. This is because
3114 /usr/include/iso/math_c99.h #defines isnan(x) to
3115 __builtin_isnan(x), but the bundled gcc, which identifies itself
3116 as gcc 3.4.3 (csl-sol210-3_4-branch+sol_rpath), does not have
3117 a __builtin_isnan.
3118 * floatfns.c (isnan): #undef, and then #define to a clone of
3119 what's in data.c.
3120 (Fisnan): Always define, since it's always available now.
3121 (syms_of_floatfns): Always define isnan at the Lisp level.
3122
e39b275c 31232011-09-06 Paul Eggert <eggert@cs.ucla.edu>
1c262cae
PE
3124
3125 * Makefile.in (gl-stamp): move-if-change now in build-aux (Bug#9169).
3126
b2db44d9 31272011-09-06 Paul Eggert <eggert@cs.ucla.edu>
728f8f0a 3128
f4af5137 3129 * fileio.c: Fix bugs with large file offsets (Bug#9428).
728f8f0a
PE
3130 The previous code assumed that file offsets (off_t values) fit in
3131 EMACS_INT variables, which is not true on typical 32-bit hosts.
3132 The code messed up by falsely reporting buffer overflow in cases
3133 such as (insert-file-contents "big" nil 1 2) into an empty buffer
3134 when "big" contains more than 2**29 bytes, even though this
3135 inserts just one byte and does not overflow the buffer.
3136 (Finsert_file_contents): Store file offsets as off_t
3137 values, not as EMACS_INT values. Check for overflow when
3138 converting between EMACS_INT and off_t. When checking for
3139 buffer overflow or for overlap, take the offsets into account.
3140 Don't use EMACS_INT for small values where int suffices.
3141 When checking for overlap, fix a typo: ZV was used where
3142 ZV_BYTE was intended.
3143 (Fwrite_region): Don't assume off_t fits into 'long'.
3144 * buffer.h (struct buffer.modtime_size): Now off_t, not EMACS_INT.
3145
ecfc0a49
MA
31462011-09-05 Michael Albinus <michael.albinus@gmx.de>
3147
3148 * dbusbind.c (xd_signature_cat): Rename from signature_cat.
3149
6511acf2 31502011-09-04 Paul Eggert <eggert@cs.ucla.edu>
61bfeeb7 3151
0999621a 3152 sprintf-related integer and memory overflow issues (Bug#9412).
62f19c19
PE
3153
3154 * doprnt.c (doprnt): Support printing ptrdiff_t and intmax_t values.
8666506e 3155 (esprintf, exprintf, evxprintf): New functions.
62f19c19 3156 * keyboard.c (command_loop_level): Now EMACS_INT, not int.
6b02f655 3157 (cmd_error): Kbd macro iterations count is now EMACS_INT, not int.
62f19c19
PE
3158 (modify_event_symbol): Do not assume that the length of
3159 name_alist_or_stem is safe to alloca and fits in int.
3160 (Fexecute_extended_command): Likewise for function name and binding.
3161 (Frecursion_depth): Wrap around reliably on integer overflow.
3162 * keymap.c (push_key_description): First arg is now EMACS_INT, not int,
3163 since some callers pass EMACS_INT values.
3164 (Fsingle_key_description): Don't crash if symbol name contains more
3165 than MAX_ALLOCA bytes.
3166 * minibuf.c (minibuf_level): Now EMACS_INT, not int.
3167 (get_minibuffer): Arg is now EMACS_INT, not int.
3168 * lisp.h (get_minibuffer, push_key_description): Reflect API changes.
8666506e 3169 (esprintf, exprintf, evxprintf): New decls.
62f19c19
PE
3170 * window.h (command_loop_level, minibuf_level): Reflect API changes.
3171
2be7d702
PE
3172 * dbusbind.c (signature_cat): New function.
3173 (xd_signature, Fdbus_register_signal):
2ea16b89
PE
3174 Do not overrun buffer; instead, report string overflow.
3175
9d1df220
PE
3176 * dispnew.c (add_window_display_history): Don't overrun buffer.
3177 Truncate instead; this is OK since it's just a log.
3178
33ef5c64
PE
3179 * editfns.c (Fcurrent_time_zone): Don't overrun buffer
3180 even if the time zone offset is outlandishly large.
3181 Don't mishandle offset == INT_MIN.
3182
66c6fdd5
PE
3183 * emacs.c (main) [NS_IMPL_COCOA]: Don't overrun buffer
3184 when creating daemon; the previous buffer-overflow check was incorrect.
3185
d749b01b
PE
3186 * eval.c (verror): Simplify by rewriting in terms of evxprintf,
3187 which has the guts of the old verror function.
3188
b5cd1905
PE
3189 * filelock.c (lock_file_1, lock_file): Don't blindly alloca long name;
3190 use SAFE_ALLOCA instead. Use esprintf to avoid int-overflow issues.
3191
6e1a67fb
PE
3192 * font.c: Include <float.h>, for DBL_MAX_10_EXP.
3193 (font_unparse_xlfd): Don't blindly alloca long strings.
c21721cc 3194 Don't assume XINT result fits in int, or that XFLOAT_DATA * 10
8666506e 3195 fits in int, when using sprintf. Use single snprintf to count
c21721cc
PE
3196 length of string rather than counting it via multiple sprintfs;
3197 that's simpler and more reliable.
c21721cc
PE
3198 (font_unparse_fcname): Use it to avoid sprintf buffer overrun.
3199 (generate_otf_features) [0 && HAVE_LIBOTF]: Use esprintf, not
3200 sprintf, in case result does not fit in int.
3201
c57b67fc
PE
3202 * fontset.c (num_auto_fontsets): Now printmax_t, not int.
3203 (fontset_from_font): Print it.
3204
8a401434
PE
3205 * frame.c (tty_frame_count): Now printmax_t, not int.
3206 (make_terminal_frame, set_term_frame_name): Print it.
3207 (x_report_frame_params): In X, window IDs are unsigned long,
3208 not signed long, so print them as unsigned.
3209 (validate_x_resource_name): Check for implausibly long names,
3210 and don't assume name length fits in 'int'.
3211 (x_get_resource_string): Don't blindly alloca invocation name;
3212 use SAFE_ALLOCA. Use esprintf, not sprintf, in case result does
3213 not fit in int.
3214
6e1a67fb
PE
3215 * gtkutil.c: Include <float.h>, for DBL_MAX_10_EXP.
3216 (xg_check_special_colors, xg_set_geometry):
84722b3d
PE
3217 Make sprintf buffers a bit bigger, to avoid potential buffer overrun.
3218
0df02bf3
PE
3219 * lread.c (dir_warning): Don't blindly alloca buffer; use SAFE_ALLOCA.
3220 Use esprintf, not sprintf, in case result does not fit in int.
3221
48e30793
PE
3222 * macros.c (executing_kbd_macro_iterations): Now EMACS_INT, not int.
3223 (Fend_kbd_macro): Don't mishandle MOST_NEGATIVE_FIXNUM by treating
3224 it as a large positive number.
3225 (Fexecute_kbd_macro): Don't assume repeat count fits in int.
3226 * macros.h (executing_kbd_macro_iterations): Now EMACS_INT, not int.
3227
a66ff6d8
PE
3228 * nsterm.m ((NSSize)windowWillResize): Use esprintf, not sprintf,
3229 in case result does not fit in int.
3230
aca216ff
PE
3231 * print.c (float_to_string): Detect width overflow more reliably.
3232 (print_object): Make sprintf buffer a bit bigger, to avoid potential
3233 buffer overrun. Don't assume list length fits in 'int'. Treat
3234 print length of 0 as 0, not as infinity; to be consistent with other
3235 uses of print length in this function. Don't overflow print length
3236 index. Don't assume hash table size fits in 'long', or that
3237 vectorlike size fits in 'unsigned long'.
3238
31c286f7
PE
3239 * process.c (make_process): Use printmax_t, not int, to format
3240 process-name gensyms.
3241
55e5faa1
PE
3242 * sysdep.c (snprintf) [! HAVE_SNPRINTF]: New function.
3243
80f2e268
PE
3244 * term.c (produce_glyphless_glyph): Make sprintf buffer a bit bigger
3245 to avoid potential buffer overrun.
3246
670741ab
PE
3247 * xfaces.c (x_update_menu_appearance): Don't overrun buffer
3248 if X resource line is longer than 512 bytes.
3249
b7163a50
PE
3250 * xfns.c (x_window): Make sprintf buffer a bit bigger
3251 to avoid potential buffer overrun.
3252
ae58ff1f
PE
3253 * xterm.c (x_io_error_quitter): Don't overrun sprintf buffer.
3254
c43c8a6a
PE
3255 * xterm.h (x_check_errors): Add ATTRIBUTE_FORMAT_PRINTF.
3256
3f8236f4
PE
32572011-09-04 Paul Eggert <eggert@cs.ucla.edu>
3258
53e9fe90 3259 Integer overflow fixes for scrolling, etc.
6511acf2
PE
3260 Without these, Emacs silently mishandles large integers sometimes.
3261 For example, "C-u 4294967297 M-x recenter" was treated as if
53e9fe90
PE
3262 it were "C-u 1 M-x recenter" on a typical 64-bit host.
3263
6511acf2
PE
3264 * xdisp.c (try_window_id): Check Emacs fixnum range before
3265 converting to 'int'.
806add1d 3266
6511acf2 3267 * window.c (window_scroll_line_based, Frecenter):
71f02bc5
PE
3268 Check that an Emacs fixnum is in range before assigning it to 'int'.
3269 (Frecenter, Fmove_to_window_line): Use EMACS_INT, not int, for
3270 values converted from Emacs fixnums.
3271 (Frecenter): Don't wrap around a line count if it is out of 'int'
3272 range; instead, treat it as an extreme value.
3273 (Fset_window_configuration, compare_window_configurations):
3274 Use ptrdiff_t, not int, for index that might exceed 2 GiB.
3275
6511acf2
PE
3276 * search.c (Freplace_match): Use ptrdiff_t, not int, for indexes
3277 that can exceed INT_MAX. Check that EMACS_INT value is in range
3278 before assigning it to the (possibly-narrower) index.
a0efffc8
PE
3279 (match_limit): Don't assume that a fixnum can fit in 'int'.
3280
6511acf2 3281 * print.c (print_object): Use ptrdiff_t, not int, for index that can
29ebea3b
PE
3282 exceed INT_MAX.
3283
6511acf2 3284 * indent.c (position_indentation): Now takes ptrdiff_t, not int.
3f8236f4
PE
3285 (Fvertical_motion): Don't wrap around LINES values that don't fit
3286 in 'int'. Instead, treat them as extreme values. This is good
3287 enough for windows, which can't have more than INT_MAX lines anyway.
3288
fcb901a7
LMI
32892011-09-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
3290
0f2f6b6d
LMI
3291 * Require libxml/parser.h to avoid compilation warning.
3292
fcb901a7
LMI
3293 * emacs.c (shut_down_emacs): Call xmlCleanupParser on shutdown.
3294
3295 * xml.c (parse_region): Don't call xmlCleanupParser after parsing,
3296 since this reportedly can destroy thread storage.
3297
6e20a0d4
CY
32982011-08-30 Chong Yidong <cyd@stupidchicken.com>
3299
3300 * syntax.c (find_defun_start): Update all cache variables if
3301 exiting early (Bug#9401).
3302
148ae00e
EZ
33032011-08-30 Eli Zaretskii <eliz@gnu.org>
3304
f6cfbd8f
EZ
3305 * image.c (x_bitmap_pixmap): Cast to int to avoid compiler warnings.
3306
148ae00e
EZ
3307 * xdisp.c (produce_stretch_glyph): No longer static, compiled also
3308 when HAVE_WINDOW_SYSTEM is not defined. Support both GUI and TTY
3309 frames. Call tty_append_glyph in the TTY case. (Bug#9402)
3310
3311 * term.c (tty_append_glyph): New function.
3312 (produce_stretch_glyph): Static function and its prototype deleted.
3313
a66cfb1c
SM
3314 * dispextern.h (produce_stretch_glyph, tty_append_glyph):
3315 Add prototypes.
148ae00e 3316
c4a07a4c
PE
33172011-08-29 Paul Eggert <eggert@cs.ucla.edu>
3318
3319 * image.c (parse_image_spec): Check for nonnegative, not for positive,
3320 when checking :margin (Bug#9390).
3321 (IMAGE_NON_NEGATIVE_INTEGER_VALUE_OR_PAIR):
a66cfb1c 3322 Rename from IMAGE_POSITIVE_INTEGER_VALUE_OR_PAIR,
c4a07a4c
PE
3323 so that the name doesn't mislead. All uses changed.
3324
6bc8cd65
JB
33252011-08-28 Johan Bockgård <bojohan@gnu.org>
3326
3327 * term.c (init_tty) [HAVE_GPM]: Move mouse settings after
3328 set_tty_hooks.
3329
dca4927e
EZ
33302011-08-27 Eli Zaretskii <eliz@gnu.org>
3331
3332 * xdisp.c (move_it_to): Don't bail out early when reaching
3333 position beyond to_charpos, if we are scanning backwards.
3334 (move_it_vertically_backward): When DY == 0, make sure we get to
3335 the first character in the line after the newline.
3336
f2cad773
PE
33372011-08-27 Paul Eggert <eggert@cs.ucla.edu>
3338
3339 * ccl.c: Improve and simplify overflow checking (Bug#9196).
3340 (ccl_driver): Do not generate an out-of-range pointer.
3341 (Fccl_execute_on_string): Remove unnecessary check for
3342 integer overflow, noted by Stefan Monnier in
3343 <http://lists.gnu.org/archive/html/emacs-devel/2011-08/msg00979.html>.
3344 Remove a FIXME that didn't need fixing.
3345 Simplify the newly-introduced buffer reallocation code.
3346
0cae2cdb
JB
33472011-08-27 Juanma Barranquero <lekktu@gmail.com>
3348
3349 * makefile.w32-in ($(BLD)/alloc.$(O)): Depend on lib/verify.h.
3350
5fc295a4 33512011-08-26 Paul Eggert <eggert@cs.ucla.edu>
ddff3151 3352
70c60eb2 3353 Integer and memory overflow issues (Bug#9196).
726e0ab1 3354
d31850da
PE
3355 * doc.c (get_doc_string): Rework so that
3356 get_doc_string_buffer_size is the actual buffer size, rather than
3357 being 1 less than the actual buffer size; this makes xpalloc more
3358 convenient.
3359
a69fbedb
PE
3360 * image.c (x_allocate_bitmap_record, cache_image):
3361 * xselect.c (Fx_register_dnd_atom):
3362 Simplify previous changes by using xpalloc.
3363
fe5c5d37
PE
3364 * buffer.c (overlay_str_len): Now ptrdiff_t, not EMACS_INT,
3365 since either will do and ptrdiff_t is convenient with xpalloc.
3366
0065d054
PE
3367 * charset.c (charset_table_size)
3368 (struct charset_sort_data.priority): Now ptrdiff_t.
3369 (charset_compare): Don't overflow if priorities differ greatly.
3370 (Fsort_charsets): Don't assume list length fits in int.
3371 Check for size-calculation overflow when allocating sort data.
3372 (syms_of_charset): Allocate an initial charset table that is
3373 just under 64 KiB, to avoid problems with glibc malloc and mmap.
3374
3375 * cmds.c (internal_self_insert): Check for size-calculation overflow.
3376
3377 * composite.h (struct composition.glyph_len): Now int, not unsigned.
3378 The actual value is always <= INT_MAX, and leaving it unsigned made
3379 overflow checking harder.
3380
3381 * dispextern.h (struct glyph_matrix.rows_allocated)
3382 (struct face_cache.size): Now ptrdiff_t, for convenience in use
3383 with xpalloc. The values are still always <= INT_MAX.
3384
3385 * indent.c (compute_motion): Adjust to region_cache_forward sig change.
3386
3387 * lisp.h (xnmalloc, xnrealloc, xpalloc): New decls.
3388 (SAFE_NALLOCA): New macro.
3389
3390 * region-cache.c (struct boundary.pos, find_cache_boundary)
3391 (move_cache_gap, insert_cache_boundary, delete_cache_boundaries)
3392 (set_cache_region, invalidate_region_cache)
3393 (revalidate_region_cache, know_region_cache, region_cache_forward)
3394 (region_cache_backward, pp_cache):
3395 Use ptrdiff_t, not EMACS_INT, since either will do. This is needed
3396 so that ptrdiff_t * can be passed to xpalloc.
3397 (struct region_cache): Similarly, for gap_start, gap_len, cache_len,
3398 beg_unchanged, end_unchanged, buffer_beg, buffer_end members.
3399 (pp_cache): Don't assume cache_len fits in int.
3400 * region-cache.h: Adjust extern decls to match.
3401
3402 * search.c (scan_buffer, Freplace_match): Use ptrdiff_t, not
3403 EMACS_INT, since either will do, for xpalloc.
3404
3405 * alloc.c: Include verify.h, and check that int fits in ptrdiff_t.
3406 (xnmalloc, xnrealloc, xpalloc): New functions.
3407
726e0ab1
PE
3408 * bidi.c (bidi_shelve_header_size): New constant.
3409 (bidi_cache_ensure_space, bidi_shelve_cache): Use it.
3410 (bidi_cache_ensure_space): Avoid integer overflow when allocating.
3411
51f30bc5 3412 * bidi.c (bidi_cache_shrink):
726e0ab1
PE
3413 * buffer.c (overlays_at, overlays_in, record_overlay_string)
3414 (overlay_strings):
3415 Don't update size of array until after memory allocation succeeds,
3416 because xmalloc/xrealloc may not return.
0065d054
PE
3417 (struct sortstrlist.bytes): Now ptrdiff_t, as EMACS_INT doesn't help
3418 now that we have proper integer overflow checking.
3419 (record_overlay_string, overlay_strings): Catch overflows when
3420 calculating size of overlay_str_buf.
726e0ab1 3421
0065d054
PE
3422 * callproc.c (Fcall_process): Check for size overflow when
3423 calculating size of args2.
3424 (child_setup): Avoid overflow by using size_t rather than ptrdiff_t.
3425 Normally we prefer signed values, but sticking with ptrdiff_t would
3426 require adding more-complicated checks.
726e0ab1
PE
3427
3428 * ccl.c (Fccl_execute_on_string): Check for memory overflow.
3429 Use ptrdiff_t rather than EMACS_INT where ptrdiff_t will do.
3430 Redo buffer-overflow calculations to avoid integer overflow.
0065d054 3431 Add a FIXME comment where memory seems to be over-allocated.
726e0ab1
PE
3432
3433 * character.c (Fstring): Check for size-calculation overflow.
3434
3435 * coding.c (produce_chars): Redo buffer-overflow calculations to avoid
3436 unnecessary integer overflow. Check for size overflow.
3437 (encode_coding_object): Don't update size until xmalloc succeeds.
3438
3439 * composite.c (get_composition_id): Check for overflow in glyph
3440 length calculations.
3441
3442 Integer and memory overflow fixes for display code.
3443 * dispextern.h (struct glyph_pool.nglyphs): Now ptrdiff_t, not int.
3444 * dispnew.c (adjust_glyph_matrix, realloc_glyph_pool)
3445 (scrolling_window): Check for overflow in size calculations.
3446 (line_draw_cost, realloc_glyph_pool, add_row_entry):
3447 Don't assume glyph table len fits in int.
3448 (struct row_entry.bucket, row_entry_pool_size, row_entry_idx)
3449 (row_table_size): Now ptrdiff_t, not int.
3450 (scrolling_window): Avoid overflow in size calculations.
3451 Don't update size until allocation succeeds.
3452 * fns.c (concat): Check for overflow in size calculations.
3453 (next_almost_prime): Verify NEXT_ALMOST_PRIME_LIMIT.
3454 * lisp.h (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): New macros.
3455 (NEXT_ALMOST_PRIME_LIMIT): New constant.
3456
3457 * doc.c (get_doc_string_buffer_size): Now ptrdiff_t, not int.
3458 (get_doc_string): Check for size calculation overflow.
3459 Don't update size until allocation succeeds.
3460 (get_doc_string, Fsubstitute_command_keys): Use ptrdiff_t, not
3461 EMACS_INT, where ptrdiff_t will do.
3462 (Fsubstitute_command_keys): Check for string overflow.
3463
3464 * editfns.c (set_time_zone_rule): Don't assume environment length
3465 fits in int.
3466 (message_length): Now ptrdiff_t, not int.
3467 (Fmessage_box): Don't update size until allocation succeeds.
3468 Don't assume message length fits in int.
3469 (Fformat): Use ptrdiff_t, not EMACS_INT, where ptrdiff_t will do.
3470
0065d054
PE
3471 * emacs.c (main): Do not reallocate argv, since there is a null at
3472 the end that can be overwritten, and this way there's no need to
3473 worry about size-calculation overflow.
3474 (sort_args): Check for size-calculation overflow.
726e0ab1
PE
3475
3476 * eval.c (init_eval_once, grow_specpdl): Don't update size until
3477 alloc succeeds.
3478 (call_debugger, grow_specpdl): Redo calculations to avoid overflow.
3479
3480 * frame.c (set_menu_bar_lines, x_set_frame_parameters)
3481 (x_set_scroll_bar_width, x_figure_window_size):
3482 Check for integer overflow.
3483 (x_set_alpha): Do not assume XINT fits in int.
3484
3485 * frame.h (struct frame): Use int, not EMACS_INT, where int works.
3486 This is for the members text_lines, text_cols, total_lines, total_cols,
3487 where the system imposes an 'int' limit.
3488
3489 * fringe.c (Fdefine_fringe_bitmap):
3490 Don't update size until alloc works.
3491
3492 * ftfont.c (ftfont_get_open_type_spec, setup_otf_gstring)
3493 (ftfont_shape_by_flt): Check for integer overflow in size calculations.
3494
3495 * gtkutil.c (get_utf8_string, xg_store_widget_in_map):
3496 Check for size-calculation overflow.
3497 (get_utf8_string): Use ptrdiff_t, not size_t, where either will
3498 do, as we prefer signed integers.
3499 (id_to_widget.max_size, id_to_widget.used)
3500 (xg_store_widget_in_map, xg_remove_widget_from_map)
3501 (xg_get_widget_from_map, xg_get_scroll_id_for_window)
3502 (xg_remove_scroll_bar, xg_update_scrollbar_pos):
3503 Use and return ptrdiff_t, not int.
3504 (xg_gtk_scroll_destroy): Don't assume ptrdiff_t fits in int.
3505 * gtkutil.h: Change prototypes to match the above.
3506
3507 * image.c (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): Remove; these
3508 are duplicate now that they've been promoted to lisp.h.
3509 (x_allocate_bitmap_record, x_alloc_image_color)
3510 (make_image_cache, cache_image, xpm_load):
3511 Don't update size until alloc is done.
3512 (xpm_load, lookup_rgb_color, lookup_pixel_color, x_to_xcolors)
3513 (x_detect_edges):
3256efce 3514 Check for size calculation overflow.
726e0ab1
PE
3515 (ct_colors_allocated_max): New constant.
3516 (x_to_xcolors, x_detect_edges): Reorder multiplicands to avoid
3517 overflow.
3256efce 3518
726e0ab1
PE
3519 * keyboard.c (read_char, menu_bar_items, tool_bar_items)
3520 (read_char_x_menu_prompt, read_char_minibuf_menu_width)
3521 (read_char_minibuf_menu_prompt, follow_key, read_key_sequence):
3522 Use ptrdiff_t, not int, to count maps.
3523 (read_char_minibuf_menu_prompt): Check for overflow in size
a66cfb1c
SM
3524 calculations. Don't update size until allocation succeeds.
3525 Redo calculations to avoid overflow.
726e0ab1
PE
3526 * keyboard.h: Change prototypes to match the above.
3527
3528 * keymap.c (cmm_size, current_minor_maps): Use ptrdiff_t, not int,
3529 to count maps.
3530 (current_minor_maps): Check for size calculation overflow.
3531 * keymap.h: Change prototypes to match the above.
3532
3533 * lread.c (read1, init_obarray): Don't update size until alloc done.
3534
3535 * macros.c (Fstart_kbd_macro): Don't update size until alloc done.
3536 (store_kbd_macro_char): Reorder multiplicands to avoid overflow.
3537
726e0ab1
PE
3538 * nsterm.h (struct ns_color_table.size, struct ns_color_table.avail):
3539 Now ptrdiff_t, not int.
3540 * nsterm.m (ns_index_color): Use ptrdiff_t, not int, for table indexes.
3541 (ns_draw_fringe_bitmap): Rewrite to avoid overflow.
3542
3543 * process.c (Fnetwork_interface_list): Check for overflow
3544 in size calculation.
3545
3546 * region-cache.c (move_cache_gap): Check for size calculation overflow.
3547
3548 * scroll.c (do_line_insertion_deletion_costs): Check for size calc
3549 overflow. Don't bother calling xmalloc when xrealloc will do.
3550
3551 * search.c (Freplace_match): Check for size calculation overflow.
3552 (Fset_match_data): Don't assume list lengths fit in 'int'.
3553
3554 * sysdep.c (system_process_attributes): Use ptrdiff_t, not int,
3555 for command line length. Do not attempt to address one before the
3556 beginning of an array, as that's not portable.
3557
3558 * term.c (max_frame_lines): Remove; unused.
3559 (encode_terminal_src_size, encode_terminal_dst_size): Now ptrdiff_t,
3560 not int.
3561 (encode_terminal_code, calculate_costs): Check for size
3562 calculation overflow.
3563 (encode_terminal_code): Use ptrdiff_t, not int, to record glyph
3564 table lengths and related sizes. Don't update size until alloc
3565 done. Redo calculations to avoid overflow.
3566 (calculate_costs): Don't bother calling xmalloc when xrealloc will do.
3567
3568 * termcap.c (tgetent): Use ptrdiff_t, not int, to record results of
3569 subtracting pointers.
3570 (gobble_line): Check for overflow more carefully. Don't update size
3571 until alloc done.
3572
3573 * tparam.c (tparam1): Use ptrdiff_t, not int, for sizes.
3574 Don't update size until alloc done.
3575 Redo size calculations to avoid overflow.
3576 Check for size calculation overflow.
0065d054 3577 (main) [DEBUG]: Fix typo in invoking tparam1.
726e0ab1
PE
3578
3579 * xdisp.c (store_mode_line_noprop_char, x_consider_frame_title):
3580 Use ptrdiff_t, not int, for sizes.
3581 (store_mode_line_noprop_char): Don't update size until alloc done.
3582
0065d054
PE
3583 * xfaces.c (lface_id_to_name_size, Finternal_make_lisp_face):
3584 Use ptrdiff_t, not int, for sizes.
3585 (Finternal_make_lisp_face, cache_face):
3586 Check for size calculation overflow.
3587 (cache_face): Treat size calculation overflows as if they were
3588 memory exhaustion (the usual treatment), rather than aborting.
726e0ab1
PE
3589
3590 * xfns.c (x_encode_text, x_set_name_internal)
3591 (Fx_change_window_property): Use ptrdiff_t, not int, to count
3592 sizes, since they can exceed INT_MAX in size. Check for size
3593 calculation overflow.
3594
0065d054
PE
3595 * xgselect.c (gfds_size): Now ptrdiff_t, for convenience with xpalloc.
3596 (xg_select): Check for size calculation overflow.
726e0ab1
PE
3597 Don't update size until alloc done.
3598
0065d054 3599 * xrdb.c (get_environ_db): Don't assume path length fits in int,
726e0ab1 3600 as sprintf is limited to int lengths.
1d526e2f 3601
252c5ee1
PE
3602 * xselect.c (X_LONG_SIZE, X_SHRT_MAX, X_SHRT_MIN, X_LONG_MAX)
3603 (X_LONG_MIN): New macros.
864d7ce7
PE
3604 Use them to make the following changes clearer.
3605 (MAX_SELECTION_QUANTUM): Make the other bounds on this value clearer.
3606 This change doesn't affect the value now, but it may help remind
3607 future maintainers not to raise the value too much later.
3608 (SELECTION_QUANTUM): Remove, replacing with ...
3609 (selection_quantum): ... new function, which avoids overflow.
3610 All uses changed.
3611 (struct selection_data.size): Now ptrdiff_t, not int, to avoid
3612 assumption that selection length fits in 'int'.
3613 (x_reply_selection_request, x_handle_selection_request)
3614 (x_get_window_property, receive_incremental_selection)
3615 (x_get_window_property_as_lisp_data, selection_data_to_lisp_data)
3616 (lisp_data_to_selection_data, clean_local_selection_data):
3617 Use ptrdiff_t, not int, to record length of selection.
3618 (x_reply_selection_request, x_get_window_property)
3619 (receive_incremental_selection, x_property_data_to_lisp):
3620 Redo calculations to avoid overflow.
3621 (x_reply_selection_request): When sending hint, ceiling it at
252c5ee1 3622 X_LONG_MAX rather than relying on wraparound overflow to send
864d7ce7
PE
3623 something.
3624 (x_get_window_property, receive_incremental_selection)
3625 (lisp_data_to_selection_data, x_property_data_to_lisp):
3626 Check for size-calculation overflow.
3627 (x_get_window_property, receive_incremental_selection)
3628 (lisp_data_to_selection_data, Fx_register_dnd_atom):
3629 Don't store size until memory allocation succeeds.
3630 (x_get_window_property): Plug memory leak on memory exhaustion.
3631 Don't double-block input; malloc is safe here. Don't assume 2**34
3632 - 4 fits in unsigned long. Add an xassert to check
3633 XGetWindowProperty overflow. Be more careful about overflow
3634 calculations, and distinguish size from memory overflow better.
3635 (receive_incremental_selection): When tracing, don't assume
3636 unsigned int is less than INT_MAX.
3637 (x_selection_data_to_lisp_data): Remove unnecessary (and in theory
3638 harmful) conversions of unsigned short to int.
3639 (lisp_data_to_selection_data): Don't assume that integers
3640 in the range -65535 through -1 fit in an X unsigned short.
3641 Don't assume that ULONG_MAX == X_ULONG_MAX. Don't store into
3642 result parameters unless successful. Rely on cons_to_unsigned
3643 to report problems with elements; the old code wasn't right anyway.
3644 (x_check_property_data): Check for int overflow; we cannot use
3645 a wider type due to X limits.
3646 (x_handle_dnd_message): Use unsigned int, to avoid int overflow.
3647
726e0ab1 3648 * xsmfns.c (smc_save_yourself_CB): Check for size calc overflow.
34db673b 3649
0065d054
PE
3650 * xterm.c (x_color_cells, x_send_scrollbar_event, handle_one_xevent)
3651 (x_term_init): Check for size calculation overflow.
726e0ab1
PE
3652 (x_color_cells): Don't store size until memory allocation succeeds.
3653 (handle_one_xevent): Use ptrdiff_t, not int, for byte counts.
0065d054 3654 Don't assume alloca size is less than MAX_ALLOCA.
726e0ab1
PE
3655 (x_term_init): Don't assume length fits in int (sprintf is limited
3656 to int size).
bc18e09d 3657
ebfa62c0
PE
3658 Use ptrdiff_t for composition IDs.
3659 * character.c (lisp_string_width):
3660 * composite.c (composition_table_size, n_compositions)
3661 (get_composition_id, composition_gstring_from_id):
3662 * dispextern.h (struct glyph_string.cmp_id, struct composition_it.id):
3663 * xdisp.c (BUILD_COMPOSITE_GLYPH_STRING):
3664 * window.c (Frecenter):
3665 Use ptrdiff_t, not int, for composition IDs.
3666 * composite.c (get_composition_id): Check for integer overflow.
3667 * composite.h: Adjust prototypes to match the above changes.
3668
d3411f89
PE
3669 Use ptrdiff_t for hash table indexes.
3670 * category.c (hash_get_category_set):
3671 * ccl.c (ccl_driver):
3672 * charset.h (struct charset.hash_index, CHECK_CHARSET_GET_ID):
3673 * coding.c (coding_system_charset_list, detect_coding_system):
3674 * coding.h (struct coding_system.id):
3675 * composite.c (get_composition_id, gstring_lookup_cache):
3676 * fns.c (hash_lookup, hash_put, Fgethash, Fputhash):
3677 * image.c (xpm_get_color_table_h):
3678 * lisp.h (hash_lookup, hash_put):
3679 * minibuf.c (Ftest_completion):
3680 Use ptrdiff_t for hash table indexes, not int (which is too
3681 narrow, on 64-bit hosts) or EMACS_INT (which is too wide, on
3682 32-bit --with-wide-int hosts).
3683
e097a6fa
PE
3684 * charset.c (Fdefine_charset_internal): Check for integer overflow.
3685 Add a FIXME comment about memory leaks.
3686 (syms_of_charset): Don't assume xmalloc returns.
3687
5637687f
PE
3688 Don't assume that stated character widths fit in int.
3689 * character.c (Fchar_width, c_string_width, lisp_string_width):
3690 * character.h (CHAR_WIDTH):
3691 * indent.c (MULTIBYTE_BYTES_WIDTH):
3692 Use sanitize_char_width to avoid undefined and/or bad behavior
3693 with outlandish widths.
a66cfb1c 3694 * character.h (sanitize_tab_width): Rename from sanitize_width,
5637687f
PE
3695 now that we have two such functions. All uses changed.
3696 (sanitize_char_width): New inline function.
3697
a2271ba2
PE
3698 Don't assume that tab-width fits in int.
3699 * character.h (sanitize_width): New inline function.
3700 (SANE_TAB_WIDTH): New macro.
3701 (ASCII_CHAR_WIDTH): Use it.
3702 * indent.c (sane_tab_width): Remove. All uses replaced by
3703 SANE_TAB_WIDTH (current_buffer).
3704 * xdisp.c (init_iterator): Use SANE_TAB_WIDTH.
3705
18c52557
PE
3706 * fileio.c: Integer overflow issues with file modes.
3707 (Fset_file_modes, auto_save_1): Don't assume EMACS_INT fits in int.
3708
caeeedc1
PE
3709 * charset.c (read_hex): New arg OVERFLOW. All uses changed.
3710 Remove unreachable code.
3711 (read_hex, load_charset_map_from_file): Check for integer overflow.
3712
6df6ae42 3713 * xterm.c: Don't go over XClientMessageEvent limit.
50849c52
PE
3714 (scroll_bar_windows_size): Now ptrdiff_t, as we prefer signed.
3715 (x_send_scroll_bar_event): Likewise. Check that the size does not
3716 exceed limits imposed by XClientMessageEvent, as well as the usual
3717 ptrdiff_t and size_t limits.
3718
b13995db
PE
3719 * keyboard.c: Overflow, signedness and related fixes.
3720 (make_lispy_movement): Use same integer type in forward decl
3721 that is used in the definition.
3722 (read_key_sequence, keyremap_step):
3723 Change bufsize argument back to int, undoing my 2011-03-30 change.
3724 We prefer signed types, and int is wide enough here.
3725 (parse_tool_bar_item): Don't assume tool_bar_max_label_size is less
3726 than TYPE_MAXIMUM (EMACS_INT) / 2. Don't let the label size grow
3727 larger than STRING_BYTES_BOUND. Use ptrdiff_t for Emacs string
3728 length, not size_t. Use ptrdiff_t for index, not int.
3729 (keyremap_step, read_key_sequence): Redo bufsize check to avoid
3730 possibility of integer overflow.
3731
13464394
PE
3732 Overflow, signedness and related fixes for images.
3733
3734 * dispextern.h (struct it.stack[0].u.image.image_id)
3735 (struct_it.image_id, struct image.id, struct image_cache.size)
3736 (struct image_cache.used, struct image_cache.ref_count):
3737 * gtkutil.c (update_frame_tool_bar):
3738 * image.c (x_reference_bitmap, Fimage_size, Fimage_mask_p)
3739 (Fimage_metadata, free_image_cache, clear_image_cache, lookup_image)
3740 (cache_image, mark_image_cache, x_kill_gs_process, Flookup_image):
3741 * nsmenu.m (update_frame_tool_bar):
3742 * xdisp.c (calc_pixel_width_or_height):
3743 * xfns.c (image_cache_refcount):
3744 Image IDs are now ptrdiff_t, not int, to avoid arbitrary limits
3745 on typical 64-bit hosts.
3746
3747 * image.c (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): New macros.
3748 (x_bitmap_pixmap, x_create_x_image_and_pixmap):
3749 Omit unnecessary casts to int.
3750 (parse_image_spec): Check that integers fall into 'int' range
3751 when the callers expect that.
3752 (image_ascent): Redo ascent calculation to avoid int overflow.
3753 (clear_image_cache): Avoid overflow when sqrt (INT_MAX) < nimages.
3754 (lookup_image): Remove unnecessary tests.
3755 (xbm_image_p): Locals are now of int, not EMACS_INT,
3756 since parse_image_check makes sure they fit into int.
3757 (png_load, gif_load, svg_load_image):
3758 Prefer int to unsigned where either will do.
3759 (tiff_handler): New function, combining the cores of the
a66cfb1c
SM
3760 old tiff_error_handler and tiff_warning_handler.
3761 This function is rewritten to use vsnprintf and thereby avoid
13464394
PE
3762 stack buffer overflows. It uses only the features of vsnprintf
3763 that are common to both POSIX and native Microsoft.
3764 (tiff_error_handler, tiff_warning_handler): Use it.
3765 (tiff_load, gif_load, imagemagick_load_image):
3766 Don't assume :index value fits in 'int'.
3767 (gif_load): Omit unnecessary cast to double, and avoid double-rounding.
3768 (imagemagick_load_image): Check that crop parameters fit into
3769 the integer types that MagickCropImage accepts. Don't assume
3770 Vimagemagick_render_type has a nonnegative value. Don't assume
3771 size_t fits in 'long'.
3772 (gs_load): Use printmax_t to print the widest integers possible.
3773 Check for integer overflow when computing image height and width.
3774
c11821d4
EZ
37752011-08-26 Eli Zaretskii <eliz@gnu.org>
3776
3777 * xdisp.c (redisplay_window): Don't force window start if point
3778 will be invisible in the resulting window. (Bug#9324)
3779
0c95fcf7
EZ
37802011-08-25 Eli Zaretskii <eliz@gnu.org>
3781
3782 * xdisp.c (compute_display_string_pos): Return 2 in DISP_PROP when
3783 the display spec is of the form `(space ...)'.
3784 (handle_display_spec): Return the value returned by
3785 handle_single_display_spec, not just 1 or zero.
3786 (handle_single_display_spec): If the display spec is of the form
3787 `(space ...)', and specifies display in the text area, return 2
3788 rather than 1.
fee65a97 3789 (try_cursor_movement): Check for the need to scroll more
a66cfb1c
SM
3790 accurately, and prefer exact match for point under bidi.
3791 Don't advance `row' beyond the last row of the window.
0c95fcf7
EZ
3792
3793 * dispextern.h (struct bidi_it): Rename the disp_prop_p member
3794 into disp_prop; all users changed.
3795
3796 * bidi.c (bidi_fetch_char): If compute_display_string_pos returns
3797 DISP_PROP = 2, substitute the u+2029 PARAGRAPH SEPARATOR character
3798 for the text covered by the display property.
3799
e4ed06f1
CY
38002011-08-25 Chong Yidong <cyd@stupidchicken.com>
3801
3802 * buffer.c (Fbury_buffer_internal): Rename from Funrecord_buffer.
3803 Change return value to nil.
3804 (Frecord_buffer): Delete unused function.
3805
f67cdd7f
EZ
38062011-08-24 Eli Zaretskii <eliz@gnu.org>
3807
5980d4c6
EZ
3808 * xdisp.c (Fcurrent_bidi_paragraph_direction): For unibyte
3809 buffers, return left-to-right.
8610fe8b
EZ
3810 (set_cursor_from_row): Consider candidate row a win if its glyph
3811 represents a newline and point is on that newline. Fixes cursor
3812 positioning on the newline at EOL of R2L text within L2R
3813 paragraph, and vice versa.
3814 (try_cursor_movement): Check continued rows, in addition to
3815 continuation rows. Fixes unwarranted scroll when point enters a
3816 continued line of R2L text within an L2R paragraph, or vice versa.
3817 (cursor_row_p): Consider the case of point being equal to
3818 MATRIX_ROW_END_CHARPOS. Prevents cursor being stuck when moving
3819 from the end of a short line to the beginning of a continued line
3820 of R2L text within L2R paragraph.
3821 (RECORD_MAX_MIN_POS): For max_pos, use IT_CHARPOS even for
3822 composed characters.
5980d4c6 3823
f67cdd7f
EZ
3824 * bidi.c (bidi_check_type): Use xassert.
3825 (bidi_cache_iterator_state): Update the disp_pos and disp_prop_p
3826 members.
3827
bca633fb
EZ
38282011-08-23 Eli Zaretskii <eliz@gnu.org>
3829
3830 * bidi.c (bidi_get_type): Abort if we get zero as the bidi type of
3831 a character.
3832
4a5885a7
CY
38332011-08-23 Chong Yidong <cyd@stupidchicken.com>
3834
3835 * nsfont.m (ns_otf_to_script): Fix typo.
3836
0902a04e
KH
38372011-08-22 Kenichi Handa <handa@m17n.org>
3838
3839 * chartab.c (Fset_char_table_extra_slot): Do not inhibit setting a
3840 extra slot even if the purpose is char-code-property-table.
3841
1a2e6670
EZ
38422011-08-23 Eli Zaretskii <eliz@gnu.org>
3843
8ddde651
EZ
3844 * xdisp.c (redisplay_window): When computing centering_position,
3845 account for the height of the header line. (Bug#8874)
3846
425cc014
EZ
3847 * dispnew.c (buffer_posn_from_coords): Use buf_charpos_to_bytepos
3848 instead of CHAR_TO_BYTE. Fixes a crash when a completion
3849 candidate is selected by the mouse, and that candidate has a
3850 composed character under the mouse.
3851
1a2e6670
EZ
3852 * xdisp.c (x_produce_glyphs): Set it->nglyphs to 1. Fixes pixel
3853 coordinates reported by pos-visible-in-window-p for a composed
3854 character in column zero.
3855
8b76d6f8
SM
38562011-08-23 Stefan Monnier <monnier@iro.umontreal.ca>
3857
3858 * cmds.c (Fself_insert_command): Mention post-self-insert-hook.
3859
dac347dd
EZ
38602011-08-22 Eli Zaretskii <eliz@gnu.org>
3861
3862 * xdisp.c (BUFFER_POS_REACHED_P): If this is a composition,
3863 consider it a hit if to_charpos is anywhere in the range of the
3864 composed buffer positions.
3865
e013fb34
CY
38662011-08-22 Chong Yidong <cyd@stupidchicken.com>
3867
3868 * image.c (gif_load): Don't assume that each subimage has the same
3869 dimensions as the base image. Handle disposal method that is
3870 "undefined" by the gif spec (Bug#9335).
3871
bd1ba3e8
CY
38722011-08-20 Chong Yidong <cyd@stupidchicken.com>
3873
3874 * eval.c (Fsignal): Handle `debug' symbol in error handler (Bug#9329).
024a2d76 3875 (Fcondition_case): Document `debug' symbol in error handler.
bd1ba3e8 3876
54a1215b
EZ
38772011-08-19 Eli Zaretskii <eliz@gnu.org>
3878
823564e5
EZ
3879 * xfaces.c (face_at_buffer_position): Avoid repeated evaluation of
3880 face ID by FACE_FROM_ID, and avoid a crash when mouse is moved
3881 from an Org mode buffer to a Speedbar frame.
3882
54a1215b
EZ
3883 * xdisp.c (RECORD_MAX_MIN_POS): If the display element comes from
3884 a composition, take its buffer position from IT->cmp_it.charpos.
3885 Fixes cursor positioning at the beginning of a line that begins
3886 with a composed character.
3887
9778ebcc
EZ
38882011-08-18 Eli Zaretskii <eliz@gnu.org>
3889
0be6ee06
EZ
3890 * bidi.c (bidi_get_type): If bidi_type_table reports zero as the
3891 character bidirectional type, use STRONG_L instead. Fixes crashes
3892 in a buffer produced by `describe-categories'.
3893
9778ebcc
EZ
3894 * dispextern.h (struct bidi_it): Move disp_pos and disp_prop_p
3895 members before the level stack, so they would be saved and
3896 restored when copying iterator state. Fixes incorrect reordering
3897 around TABs covered by display properties.
3898
156bffbe
AS
38992011-08-18 Andreas Schwab <schwab@linux-m68k.org>
3900
6b02f655 3901 * process.c (Fnetwork_interface_list): Correctly determine buffer size.
156bffbe 3902
72ad093b
CY
39032011-08-17 Chong Yidong <cyd@stupidchicken.com>
3904
3905 * eval.c (internal_condition_case, internal_condition_case_1)
8b76d6f8
SM
3906 (internal_condition_case_2, internal_condition_case_n):
3907 Remove unnecessary aborts (Bug#9081).
72ad093b 3908
35774242
EZ
39092011-08-17 Eli Zaretskii <eliz@gnu.org>
3910
3911 * lread.c (Fload) [DOS_NT]: If `openp' returns -2, but the file
3912 has no `load' handler, try opening the file locally. (Bug#9311)
3913
db76dd85
KB
39142011-08-16 Ken Brown <kbrown@cornell.edu>
3915
3916 * gmalloc.c: Expand comment.
3917
b215eee5
EZ
39182011-08-16 Eli Zaretskii <eliz@gnu.org>
3919
3920 * xdisp.c (set_cursor_from_row): Don't accept a previous candidate
3921 if it fails the cursor_row_p test. Fixes cursor positioning at ZV.
3922
a4579d33
KB
39232011-08-16 Ken Brown <kbrown@cornell.edu>
3924
3925 Fix memory allocation problems in Cygwin build (Bug#9273).
3926
3927 * unexcw.c ( __malloc_initialized): Declare external variable.
3928 (fixup_executable): Force the dumped emacs to reinitialize malloc.
3929
8b76d6f8
SM
3930 * gmalloc.c [CYGWIN] (bss_sbrk_heapbase, bss_sbrk_heapinfo):
3931 New variables.
a4579d33
KB
3932 (malloc_initialize_1) [CYGWIN]: Prepare for reinitializing the
3933 dumped emacs.
3934 (_free_internal_nolock) [CYGWIN]: Ignore requests to free storage
3935 in the static heap.
3936 [CYGWIN] (special_realloc): New function.
3937 (_realloc_internal_nolock) [CYGWIN]: Use the new function on
3938 requests to realloc storage in the static heap.
3939
3ebec551
PE
39402011-08-15 Paul Eggert <eggert@cs.ucla.edu>
3941
3942 * bidi.c (bidi_initialize): Remove unused local.
3943
9fd8be00
EZ
39442011-08-15 Eli Zaretskii <eliz@gnu.org>
3945
6b02f655
SM
3946 * bidimirror.h:
3947 * biditype.h: Remove file.
3948 * makefile.w32-in ($(BLD)/bidi.$(O)):
3949 * deps.mk (bidi.o): Remove biditype.h and bidimirror.h.
474a8465
EZ
3950
3951 * dispextern.h: Fix a typo in the comment to bidi_type_t.
3952
3953 * chartab.c: Improve commentary for the uniprop_table API.
3954
32413314
EZ
3955 * bidi.c (bidi_paragraph_init): Support zero value of
3956 bidi_ignore_explicit_marks_for_paragraph_level.
474a8465
EZ
3957 (bidi_initialize): Use uniprop_table instead of including
3958 biditype.h and bidimirror.h.
32413314 3959
9fd8be00
EZ
3960 * xdisp.c (move_it_in_display_line_to): Don't reset pixel
3961 coordinates of the iterator when restoring from ppos_it.
3962 (Bug#9296)
3963
5cf2b69b
KH
39642011-08-14 Kenichi Handa <handa@m17n.org>
3965
3966 * process.c (create_process): Call setup_process_coding_systems
72ad093b 3967 after the pid of the process is set to -1 (Bug#8162).
5cf2b69b 3968
daf17d00
EZ
39692011-08-14 Eli Zaretskii <eliz@gnu.org>
3970
3971 * xdisp.c (move_it_in_display_line_to): Don't invoke
3972 IT_RESET_X_ASCENT_DESCENT when iterator position was restored from
3973 ppos_it. Fixes vertical cursor motion when line beginning is
3974 covered by an image. (Bug#9296)
3975
08e3161a
JD
39762011-08-14 Jan Djärv <jan.h.d@swipnet.se>
3977
3978 * nsterm.h (ns_run_ascript): Declare.
3979 (NSAPP_DATA2_RUNASSCRIPT): Define.
3980
3981 * nsfns.m (as_script, as_result, as_status): New static variables.
3982 (ns_run_ascript): New function.
5e617bc2 3983 (Fns_do_applescript): Set variables as_*. Make an NSApplicationDefined
08e3161a
JD
3984 event with data2 set to NSAPP_DATA2_RUNASSCRIPT, post it and then start
3985 the event loop. Get status from as_status (Bug#7276).
3986
3987 * nsterm.m (sendEvent): If event is NSApplicationDefined and
3988 data2 is NSAPP_DATA2_RUNASSCRIPT, call ns_run_ascript and then exit
3989 the event loop (Bug#7276).
3990
a3720aa2
AS
39912011-08-14 Andreas Schwab <schwab@linux-m68k.org>
3992
3993 * gnutls.c (QCgnutls_bootprop_priority)
3994 (QCgnutls_bootprop_trustfiles, QCgnutls_bootprop_keylist)
3995 (QCgnutls_bootprop_crlfiles, QCgnutls_bootprop_callbacks)
3996 (QCgnutls_bootprop_loglevel, QCgnutls_bootprop_hostname)
3997 (QCgnutls_bootprop_min_prime_bits, QCgnutls_bootprop_verify_flags)
3998 (QCgnutls_bootprop_verify_hostname_error)
3999 (QCgnutls_bootprop_callbacks_verify): Rename from
4000 Qgnutls_bootprop_..., all uses changed.
4001
4002 * xfaces.c (QCignore_defface): Rename from Qignore_defface, all
4003 uses changed.
4004
0a0d27fb
PE
40052011-08-14 Paul Eggert <eggert@cs.ucla.edu>
4006
19d5c50c
PE
4007 * xfaces.c (Qframe_set_background_mode): Now static.
4008 * dispextern.h (Qframe_set_background_mode): Remove decl.
4009
0a0d27fb
PE
4010 * process.c (Fnetwork_interface_info): Declare local only if needed.
4011
377538cb
JD
40122011-08-13 Jan Djärv <jan.h.d@swipnet.se>
4013
4014 * process.c: Include ifaddrs.h and net/if_dl.h if available (Bug#8477).
4015 (Fnetwork_interface_list): Allocate in increments of bytes instead
4016 of sizeof (struct ifreq). Iterate over ifconf.ifc_req by counting
4017 bytes (Bug#8477). Count bytes correctly when ifr_addr is a struct
4018 sockaddr.
4019 (struct ifflag_def): notrailers is smart on OSX.
4020 (Fnetwork_interface_info): Handle case when ifr_flags is negative.
4021 Get hardware address with getifaddrs if available.
4022
08fff70c
EZ
40232011-08-12 Eli Zaretskii <eliz@gnu.org>
4024
4025 * xdisp.c (iterate_out_of_display_property): xassert that
4026 IT->position is set to within IT->object's boundaries. Break from
4027 the loop as soon as EOB is reached; avoids infloops in redisplay
8b76d6f8
SM
4028 when IT->position is set up wrongly due to some bug.
4029 Set IT->current to match the bidi iterator unconditionally.
08fff70c
EZ
4030 (push_display_prop): Allow GET_FROM_STRING as IT->method on
4031 entry. Force push_it to save on the stack the current
4032 buffer/string position, to be restored by pop_it. Fix flags in
4033 the iterator structure wrt the object coming from a display
4034 property, as `line-prefix' and `wrap-prefix' are not ``replacing''
4035 properties. (Bug#9284)
4036
7be1c708 40372011-08-09 Andreas Schwab <schwab@linux-m68k.org>
aac0c6e3 4038
7be1c708
CY
4039 * fontset.c (fontset_get_font_group): Add proper type checks.
4040 (Bug#9172)
aac0c6e3 4041
7be1c708 40422011-08-09 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
aac0c6e3 4043
7be1c708
CY
4044 * unexmacosx.c (print_load_command_name): Add cases LC_FUNCTION_STARTS
4045 and LC_VERSION_MIN_MACOSX.
4046 (copy_linkedit_data) [LC_FUNCTION_STARTS]: New function.
4047 (dump_it) [LC_FUNCTION_STARTS]: Use it.
aac0c6e3 4048
97bb72a6
EZ
40492011-08-08 Eli Zaretskii <eliz@gnu.org>
4050
4051 * xdisp.c (forward_to_next_line_start): Allow to use the
8b76d6f8
SM
4052 no-display-properties-and-no-overlays under bidi display.
4053 Set disp_pos in the bidi iterator to avoid searches for display
757664a4 4054 properties and overlays.
97bb72a6 4055
d5617611
CY
40562011-08-08 Chong Yidong <cyd@stupidchicken.com>
4057
37e11a63
CY
4058 * editfns.c (Fset_time_zone_rule): Document relationship with the
4059 setenv function.
4060
d5617611
CY
4061 * ftfont.c (ftfont_pattern_entity): Copy the extras argument to
4062 the font entity extracted from the cache (Bug#8109).
4063
58872834
CY
40642011-08-07 Chong Yidong <cyd@stupidchicken.com>
4065
4066 * composite.c (autocmp_chars): Don't reset point. That is done by
4067 restore_point_unwind (Bug#5984).
4068
75bfc667
JL
40692011-08-07 Juri Linkov <juri@jurta.org>
4070
4071 * editfns.c (Fformat_time_string): Doc fix, add tag `usage:'
4072 to show the arg `TIME' instead of `TIMEVAL'.
4073
d1410150
EZ
40742011-08-06 Eli Zaretskii <eliz@gnu.org>
4075
4076 * xdisp.c (set_cursor_from_row): Fix cursor positioning when a
4077 display property strides EOL and includes a newline, as in
4078 longlines-mode. (Bug#9254)
75b771e4
EZ
4079 (move_it_in_display_line_to): Fix vertical-motion in a buffer with
4080 word-wrap under bidirectional display. (Bug#9224)
d1410150
EZ
4081
4082 * bidi.c (bidi_unshelve_cache): Don't reset the cache if JUST_FREE
4083 is non-zero, even if the data buffer is NULL. Fixes a crash in
4084 vertical-motion with longlines-mode. (Bug#9254)
4085
35928349
EZ
40862011-08-05 Eli Zaretskii <eliz@gnu.org>
4087
ec7cc85b
EZ
4088 * bidi.c <bidi_cache_total_alloc>: Now static.
4089 (bidi_initialize): Initialize bidi_cache_total_alloc.
4090
8b76d6f8 4091 * xdisp.c (display_line): Release buffer allocated for shelved bidi
35928349
EZ
4092 cache. (Bug#9221)
4093
4094 * bidi.c (bidi_shelve_cache, bidi_unshelve_cache): Track total
4095 amount allocated this far in `bidi_cache_total_alloc'.
4096 (bidi_unshelve_cache): Accept an additional argument JUST_FREE; if
4097 non-zero, only free the data buffer without restoring the cache
4098 contents. All callers changed.
4099
4100 * dispextern.h (bidi_unshelve_cache): Update prototype.
4101
4102 * xdisp.c (SAVE_IT, pos_visible_p, move_it_in_display_line_to)
4103 (move_it_in_display_line, move_it_to)
4104 (move_it_vertically_backward, move_it_by_lines): Replace the call
4105 to xfree to an equivalent call to bidi_unshelve_cache.
4106 (move_it_in_display_line_to): Fix logic of returning
412b6358 4107 MOVE_POS_MATCH_OR_ZV in the bidi case. (Bug#9224)
35928349 4108
e2e2423b
EZ
41092011-08-05 Eli Zaretskii <eliz@gnu.org>
4110
4111 * xdisp.c (set_cursor_from_row): Prefer the candidate glyph that
4112 came from a string character with a `cursor' property. (Bug#9229)
4113
ae9e757a
JD
41142011-08-04 Jan Djärv <jan.h.d@swipnet.se>
4115
4116 * Makefile.in (LIB_PTHREAD): New variable.
4117 (LIBES): Add LIB_PTHREAD (Bug#9216).
4118
4119 * alloc.c, emacs.c, gmalloc.c, gtkutil.c, keyboard.c, syssignal.h:
4120 Rename HAVE_GTK_AND_PTHREAD to HAVE_PTHREAD (Bug#9216).
4121
213bd7f2
AS
41222011-08-04 Andreas Schwab <schwab@linux-m68k.org>
4123
6b02f655 4124 * regex.c (re_iswctype): Remove some redundant boolean conversions.
213bd7f2 4125
99aaf75f
JD
41262011-08-04 Jan Djärv <jan.h.d@swipnet.se>
4127
4128 * xterm.c (x_find_topmost_parent): New function.
4129 (x_set_frame_alpha): Find topmost parent window with
4130 x_find_topmost_parent and set the property there also (bug#9181).
4131 (handle_one_xevent): Call x_set_frame_alpha on ReparentNotify.
4132
c74e9d86
PE
41332011-08-04 Paul Eggert <eggert@cs.ucla.edu>
4134
4135 * callproc.c (Fcall_process): Avoid vfork clobbering
4136 the local vars buffer, coding_systems, current_dir.
4137
640c8776
SM
41382011-08-03 Stefan Monnier <monnier@iro.umontreal.ca>
4139
4140 * keymap.c (Fmake_composed_keymap): Move to subr.el.
4141
f26d0e4c
PE
41422011-08-03 Paul Eggert <eggert@cs.ucla.edu>
4143
8a10d76c
PE
4144 * fontset.c (dump_fontset) [FONTSET_DEBUG]: Declare EXTERNALLY_VISIBLE
4145 so that it is not optimized away.
4146
f26d0e4c
PE
4147 * xdisp.c (compute_display_string_pos): Remove unused local.
4148
55439c61
EZ
41492011-08-02 Eli Zaretskii <eliz@gnu.org>
4150
4151 Fix slow cursor motion and scrolling in large buffers with
4152 selective display, like Org Mode buffers. (Bug#9218)
4153
4154 * dispextern.h (struct bidi_it): New member disp_prop_p.
4155
4156 * xdisp.c: Remove one-slot cache of display string positions.
4157 (compute_display_string_pos): Accept an additional argument
5e617bc2 4158 DISP_PROP_P; callers changed. Scan at most 5K characters forward
55439c61
EZ
4159 for a display string or property. If found, set DISP_PROP_P
4160 non-zero.
4161
4162 * bidi.c (bidi_fetch_char): Accept an additional argument
640c8776
SM
4163 DISP_PROP_P, and pass it to compute_display_string_pos.
4164 Only handle text covered by a display string if DISP_PROP_P is returned
55439c61
EZ
4165 non-zero. All callers of bidi_fetch_char changed.
4166
fb33fa43
SM
41672011-08-02 Stefan Monnier <monnier@iro.umontreal.ca>
4168
4169 * keymap.c (Fdefine_key): Fix Lisp_Object/int mixup; apply some CSE.
4170
b099e063
DM
41712010-12-03 Don March <don@ohspite.net>
4172
4173 * keymap.c (Fdefine_key): Fix non-prefix key error message when
4174 last character M-[char] is translated to ESC [char] (bug#7541).
4175
5cc7f7af
KH
41762011-08-02 Kenichi Handa <handa@m17n.org>
4177
d0fffa3f 4178 * lisp.h (uniprop_table): Extern it.
5cc7f7af
KH
4179
4180 * chartab.c (uniprop_table): Make it non-static.
4181
525d5e6e
EZ
41822011-08-01 Eli Zaretskii <eliz@gnu.org>
4183
4184 * xdisp.c (forward_to_next_line_start): Accept additional argument
4185 BIDI_IT_PREV, and store into it the state of the bidi iterator had
4186 on the newline.
4187 (reseat_at_next_visible_line_start): Use the bidi iterator state
4188 returned by forward_to_next_line_start to restore the state of
4189 it->bidi_it after backing up to previous newline. (Bug#9212)
4190
31011111
AS
41912011-07-30 Andreas Schwab <schwab@linux-m68k.org>
4192
4193 * regex.c (re_comp): Protoize.
4194 (re_exec): Fix return type.
4195 (regexec): Fix type of `ret'. (Bug#9203)
4196
476371c4
PE
41972011-07-28 Paul Eggert <eggert@cs.ucla.edu>
4198
e5d76069
PE
4199 * image.c (check_image_size): Use 1024x1024 if unknown frame (Bug#9189).
4200 This is needed if max-image-size is a floating-point number.
4201
9a79b20c
AS
42022011-07-28 Andreas Schwab <schwab@linux-m68k.org>
4203
4204 * print.c (print_object): Print empty symbol as ##.
4205
4206 * lread.c (read1): Read ## as empty symbol.
4207
d8c2fa78
AA
42082011-07-28 Alp Aker <alp.tekin.aker@gmail.com>
4209
4210 * nsfns.m (x_set_foreground_color): Set f->foreground_pixel when
4211 setting frame foreground color (Bug#9175).
4212 (x_set_background_color): Likewise.
4213
ffe57a7a
AA
4214 * nsmenu.m (-setText): Size tooltip dimensions precisely to
4215 contents (Bug#9176).
4216 (EmacsTooltip -init): Remove bezels and add shadows to
4217 tooltip windows.
4218
bf3492a5
AA
4219 * nsterm.m (ns_dumpglyphs_stretch): Avoid overwriting left fringe
4220 or scroll bar (Bug#8470).
4221
d55e9c53
AA
4222 * nsfont.m (nsfont_open): Remove assignment to voffset and
4223 unnecessary vars hshink, expand, hd, full_height, min_height.
4224 (nsfont_draw): Use s->ybase as baseline for glyph drawing (Bug#8913).
4225
4226 * nsterm.h (nsfont_info): Remove voffset field.
4227
d8c2fa78 42282011-07-28 Alp Aker <alp.tekin.aker@gmail.com>
4843aac3
AA
4229
4230 Implement strike-through and overline on NextStep (Bug#8863).
4231
4232 * nsfont.m (nsfont_open): Use underline position provided by font,
4233 instead of hard-coded value of 2.
4234 (nsfont_draw): Call ns_draw_text_decoration instead.
4235
4236 * nsterm.h: Add declaration for ns_draw_text_decoration.
4237
4238 * nsterm.m (ns_draw_text_decoration): New function for drawing
4239 underline, overline, and strike-through.
4240 (ns_dumpglyphs_image, ns_dumpglyphs_stretch): Add call to
4241 ns_draw_text_decoration. Change treatment of cursor drawing to
8d5ed899 4242 accommodate underlining, etc.
4843aac3 4243
4cc60b9b
EZ
42442011-07-28 Eli Zaretskii <eliz@gnu.org>
4245
bc7ece87
EZ
4246 * buffer.c (init_buffer_once): Set bidi-display-reordering to t by
4247 default.
4cc60b9b 4248
476371c4
PE
42492011-07-28 Paul Eggert <eggert@cs.ucla.edu>
4250
66606eea
PE
4251 * alloc.c (memory_full) [!SYNC_INPUT]: Fix signal-related race.
4252 Without this fix, if a signal arrives just after memory fills up,
4253 'malloc' might be invoked reentrantly.
4254
476371c4
PE
4255 * image.c (x_check_image_size) [!HAVE_X_WINDOWS]: Return 1.
4256 In other words, assume that every image size is allowed, on non-X
4257 hosts. This assumption is probably wrong, but it lets Emacs compile.
4258
f3fcc40d
AS
42592011-07-28 Andreas Schwab <schwab@linux-m68k.org>
4260
4261 * regex.c (re_iswctype): Convert return values to boolean.
4262
350c992f
EZ
42632011-07-28 Eli Zaretskii <eliz@fencepost.gnu.org>
4264
4265 * xdisp.c (compute_display_string_pos): Don't use cached display
4266 string position if the buffer had its restriction changed.
4267 (Bug#9184)
4268
5266b4bb
PE
42692011-07-28 Paul Eggert <eggert@cs.ucla.edu>
4270
4271 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork clobbering.
4272
2573a837 42732011-07-28 Paul Eggert <eggert@cs.ucla.edu>
ca4aa935 4274
41f55ccd 4275 Integer signedness and overflow and related fixes. (Bug#9079)
cf950e6b 4276
39e378da
PE
4277 * bidi.c: Integer size and overflow fixes.
4278 (bidi_cache_size, bidi_cache_idx, bidi_cache_last_idx)
4279 (bidi_cache_start, bidi_cache_fetch_state, bidi_cache_search)
4280 (bidi_cache_find_level_change, bidi_cache_ensure_space)
4281 (bidi_cache_iterator_state, bidi_cache_find, bidi_cache_start_stack)
4282 (bidi_find_other_level_edge):
4283 Use ptrdiff_t instead of EMACS_INT where either will do.
4284 This works better on 32-bit hosts configured --with-wide-int.
4285 (bidi_cache_ensure_space): Check for size-calculation overflow.
4286 Use % rather than repeated addition, for better worst-case speed.
4287 Don't set bidi_cache_size until after xrealloc returns, because it
4288 might not return.
4289 (bidi_dump_cached_states): Use ptrdiff_t, not int, to avoid overflow.
f0eb61e9
PE
4290 (bidi_cache_ensure_space): Also check that the bidi cache size
4291 does not exceed that of the largest Lisp string or buffer. See Eli
4292 Zaretskii in <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9079#29>.
39e378da 4293
5e927815
PE
4294 * alloc.c (__malloc_size_t): Remove.
4295 All uses replaced by size_t. See Andreas Schwab's note
4296 <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9079#8>.
4297
ca4aa935
PE
4298 * image.c: Improve checking for integer overflow.
4299 (check_image_size): Assume that f is nonnull, since
4300 it is always nonnull in practice. This is one less thing to
4301 worry about when checking for integer overflow later.
4302 (x_check_image_size): New function, which checks for integer
4303 overflow issues inside X.
4304 (x_create_x_image_and_pixmap, xbm_read_bitmap_data): Use it.
4305 This removes the need for a memory_full check.
4306 (xbm_image_p): Rewrite to avoid integer multiplication overflow.
4307 (Create_Pixmap_From_Bitmap_Data, xbm_load): Use x_check_image_size.
4308 (xbm_read_bitmap_data): Change locals back to 'int', since
4309 their values must fit in 'int'.
4310 (xpm_load_image, png_load, tiff_load):
4311 Invoke x_create_x_image_and_pixmap earlier,
4312 to avoid much needless work if the image is too large.
4313 (tiff_load): Treat overly large images as if
4314 x_create_x_image_and_pixmap failed, not as malloc failures.
4315 (gs_load): Use x_check_image_size.
4316
5f8f9cc2
PE
4317 * gtkutil.c: Omit integer casts.
4318 (xg_get_pixbuf_from_pixmap): Remove unnecessary cast.
4319 (xg_set_toolkit_scroll_bar_thumb): Rewrite to avoid need for cast.
4320
5adf60bc
PE
4321 * image.c (png_load): Don't assume height * row_bytes fits in 'int'.
4322
c8907a93
PE
4323 * xfaces.c (Fbitmap_spec_p): Fix integer overflow bug.
4324 Without this fix, (bitmap-spec-p '(34359738368 1 "x"))
4325 would wrongly return t on a 64-bit host.
4326
e3c25c68
PE
4327 * dispnew.c (init_display): Use *_RANGE_OVERFLOW macros.
4328 The plain *_OVERFLOW macros run afoul of GCC bug 49705
4329 <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49705>
4330 and therefore cause GCC to emit a bogus diagnostic in some cases.
4331
3f791afe
PE
4332 * image.c: Integer signedness and overflow and related fixes.
4333 This is not an exhaustive set of fixes, but it's time to
4334 record what I've got.
4335 (lookup_pixel_color, check_image_size): Remove redundant decls.
4336 (check_image_size): Don't assume that arbitrary EMACS_INT values
4337 fit in 'int', or that arbitrary 'double' values fit in 'int'.
4338 (x_alloc_image_color, x_create_x_image_and_pixmap, png_load)
4339 (tiff_load, imagemagick_load_image):
4340 Check for overflow in size calculations.
4341 (x_create_x_image_and_pixmap): Remove unnecessary test for
4342 xmalloc returning NULL; that can't happen.
4343 (xbm_read_bitmap_data): Don't assume sizes fit into 'int'.
4344 (xpm_color_bucket): Use better integer hashing function.
4345 (xpm_cache_color): Don't possibly over-allocate memory.
4346 (struct png_memory_storage, tiff_memory_source, tiff_seek_in_memory)
4347 (gif_memory_source):
4348 Use ptrdiff_t, not int or size_t, to record sizes.
4349 (png_load): Don't assume values greater than 2**31 fit in 'int'.
4350 (our_stdio_fill_input_buffer): Prefer ptrdiff_t to size_t when
4351 either works, as we prefer signed integers.
4352 (tiff_read_from_memory, tiff_write_from_memory):
4353 Return tsize_t, not size_t, since that's what the TIFF API wants.
4354 (tiff_read_from_memory): Don't fail simply because the read would
4355 go past EOF; instead, return a short read.
4356 (tiff_load): Omit no-longer-needed casts.
4357 (Fimagemagick_types): Don't assume size fits into 'int'.
4358
3cc5a532
PE
4359 Improve hashing quality when configured --with-wide-int.
4360 * fns.c (hash_string): New function, taken from sxhash_string.
4361 Do not discard information about ASCII character case; this
4362 discarding is no longer needed.
4363 (sxhash-string): Use it. Change sig to match it. Caller changed.
4364 * lisp.h: Declare it.
4365 * lread.c (hash_string): Remove, since we now use fns.c's version.
4366 The fns.c version returns a wider integer if --with-wide-int is
4367 specified, so this should help the quality of the hashing a bit.
4368
b312a492
PE
4369 * emacs.c: Integer overflow minor fix.
4370 (heap_bss_diff): Now uprintmax_t, not unsigned long. All used changed.
4371 Define only if GNU_LINUX.
4372 (main, Fdump_emacs): Set and use heap_bss_diff only if GNU_LINUX.
4373
dfd153ae
PE
4374 * dispnew.c: Integer signedness and overflow fixes.
4375 Remove unnecessary forward decls, that were a maintenance hassle.
4376 (history_tick): Now uprintmax_t, so it's more likely to avoid overflow.
4377 All uses changed.
4378 (adjust_glyph_matrix, realloc_glyph_pool, adjust_frame_message_buffer)
4379 (scrolling_window): Use ptrdiff_t, not int, for byte count.
4380 (prepare_desired_row, line_draw_cost):
4381 Use int, not unsigned, where either works.
4382 (save_current_matrix, restore_current_matrix):
4383 Use ptrdiff_t, not size_t, where either works.
4384 (init_display): Check for overflow more accurately, and without
4385 relying on undefined behavior.
4386
a81d11a3
PE
4387 * editfns.c (pWIDE, pWIDElen, signed_wide, unsigned_wide):
4388 Remove, replacing with the new symbols in lisp.h. All uses changed.
4389 * fileio.c (make_temp_name):
4390 * filelock.c (lock_file_1, lock_file):
4391 * xdisp.c (message_dolog):
4392 Don't assume PRIdMAX etc. works; this isn't portable to pre-C99 hosts.
4393 Use pMd etc. instead.
4394 * lisp.h (printmax_t, uprintmax_t, pMd, pMu): New types and macros,
4395 replacing the pWIDE etc. symbols removed from editfns.c.
4396
3300e6fd
PE
4397 * keyboard.h (num_input_events): Now uintmax_t.
4398 This is (very slightly) less likely to mess up due to wraparound.
4399 All uses changed.
4400
fd05c7e9
PE
4401 * buffer.c: Integer signedness fixes.
4402 (alloc_buffer_text, enlarge_buffer_text):
4403 Use ptrdiff_t rather than size_t when either will do, as we prefer
4404 signed integers.
4405
903fe15d
PE
4406 * alloc.c: Integer signedness and overflow fixes.
4407 Do not impose an arbitrary 32-bit limit on malloc sizes when debugging.
4408 (__malloc_size_t): Default to size_t, not to int.
4409 (pure_size, pure_bytes_used_before_overflow, stack_copy_size)
4410 (Fgarbage_collect, mark_object_loop_halt, mark_object):
4411 Prefer ptrdiff_t to size_t when either would do, as we prefer
4412 signed integers.
4413 (XMALLOC_OVERRUN_CHECK_OVERHEAD): New macro.
4414 (xmalloc_overrun_check_header, xmalloc_overrun_check_trailer):
4415 Now const. Initialize with values that are in range even if char
4416 is signed.
4417 (XMALLOC_PUT_SIZE, XMALLOC_GET_SIZE): Remove, replacing with ...
4418 (xmalloc_put_size, xmalloc_get_size): New functions. All uses changed.
4419 These functions do the right thing with sizes > 2**32.
4420 (check_depth): Now ptrdiff_t, not int.
4421 (overrun_check_malloc, overrun_check_realloc, overrun_check_free):
4422 Adjust to new way of storing sizes. Check for size overflow bugs
4423 in rest of code.
4424 (STRING_BYTES_MAX): Adjust to new overheads. The old code was
4425 slightly wrong anyway, as it missed one instance of
4426 XMALLOC_OVERRUN_CHECK_OVERHEAD.
4427 (refill_memory_reserve): Omit needless cast to size_t.
4428 (mark_object_loop_halt): Mark as externally visible.
4429
ac82cc6a
PE
4430 * xselect.c: Integer signedness and overflow fixes.
4431 (Fx_register_dnd_atom, x_handle_dnd_message):
4432 Use ptrdiff_t, not size_t, since we prefer signed.
4433 (Fx_register_dnd_atom): Check for ptrdiff_t (and size_t) overflow.
4434 * xterm.h (struct x_display_info): Use ptrdiff_t, not size_t, for
4435 x_dnd_atoms_size and x_dnd_atoms_length.
4436
c2d1e36d
PE
4437 * doprnt.c: Prefer signed to unsigned when either works.
4438 * eval.c (verror):
4439 * doprnt.c (doprnt):
4440 * lisp.h (doprnt):
4441 * xdisp.c (vmessage):
4442 Use ptrdiff_t, not size_t, when using or implementing doprnt,
4443 since the sizes cannot exceed ptrdiff_t bounds anyway, and we
4444 prefer signed arithmetic to avoid comparison confusion.
4445 * doprnt.c (doprnt): Avoid a "+ 1" that can't overflow,
4446 but is a bit tricky.
4447
0e926e56
PE
4448 Assume freestanding C89 headers, string.h, stdlib.h.
4449 * data.c, doprnt.c, floatfns.c, print.c:
4450 Include float.h unconditionally.
4451 * gmalloc.c: Assume C89-at-least behavior for preprocessor,
4452 limits.h, stddef.h, string.h. Use memset instead of 'flood'.
4453 * regex.c: Likewise for stddef.h, string.h.
4454 (ISASCII): Remove; can assume it returns 1 now. All uses removed.
4455 * s/aix4-2.h (HAVE_STRING_H): Remove obsolete undef.
4456 * s/ms-w32.h (HAVE_LIMITS_H, HAVE_STRING_H, HAVE_STDLIB_H)
4457 (STDC_HEADERS): Remove obsolete defines.
4458 * sysdep.c: Include limits.h unconditionally.
4459
9cfdb3ec
PE
4460 Assume support for memcmp, memcpy, memmove, memset.
4461 * lisp.h, sysdep.c (memcmp, memcpy, memmove, memset):
4462 * regex.c (memcmp, memcpy):
4463 Remove; we assume C89 now.
4464
4465 * gmalloc.c (memcpy, memset, memmove): Remove; we assume C89 now.
4466 (__malloc_safe_bcopy): Remove; no longer needed.
4467
cf950e6b 4468 * lisp.h (struct vectorlike_header, struct Lisp_Subr): Signed sizes.
6089c567
PE
4469 Use EMACS_INT, not EMACS_UINT, for sizes. The code works equally
4470 well either way, and we prefer signed to unsigned.
4471
dbf38e02
LMI
44722011-07-27 Lars Magne Ingebrigtsen <larsi@gnus.org>
4473
4474 * gnutls.c (emacs_gnutls_read): Don't message anything if the peer
4475 closes the connection while we're reading (bug#9182).
4476
d6f0886c 44772011-07-25 Jan Djärv <jan.h.d@swipnet.se>
24e0f6b1 4478
d6f0886c
JD
4479 * nsmenu.m (ns_popup_dialog): Add an "ok" button if no buttons
4480 are specified (Bug#9168).
24e0f6b1 4481
2eb1f9e6
PE
44822011-07-25 Paul Eggert <eggert@cs.ucla.edu>
4483
4484 * bidi.c (bidi_dump_cached_states): Fix printf format mismatch.
4485 Found by GCC static checking and --with-wide-int on a 32-bit host.
4486
22381272 44872011-07-25 Eli Zaretskii <eliz@gnu.org>
7daee910
EZ
4488
4489 * xdisp.c (compute_display_string_pos): Fix logic of caching
4490 previous display string position. Initialize cached_prev_pos to
4491 -1. Fixes slow-down at the beginning of a buffer.
4492
f25e39b4
EZ
44932011-07-24 Eli Zaretskii <eliz@gnu.org>
4494
4495 * xfaces.c (check_lface_attrs) [HAVE_WINDOW_SYSTEM]: Allow `nil'
4496 for attrs[LFACE_FONTSET_INDEX].
4497
04c4b52e
PE
44982011-07-23 Paul Eggert <eggert@cs.ucla.edu>
4499
4500 * xml.c (parse_region): Remove unused local
4501 that was recently introduced.
4502
c1734fbd
EZ
45032011-07-23 Eli Zaretskii <eliz@gnu.org>
4504
be18c5a5
EZ
4505 * xfns.c (unwind_create_frame) [GLYPH_DEBUG]: Adapt to changes in
4506 2008-02-22T17:42:09Z!monnier@iro.umontreal.ca.
4507
c1734fbd
EZ
4508 * xdisp.c (move_it_in_display_line_to): Record the best matching
4509 position for TO_CHARPOS while scanning the line, and restore it on
640c8776
SM
4510 exit if none of the characters scanned was an exact match.
4511 Fixes vertical-motion and pos-visible-in-window-p under bidi redisplay
a9269c18
EZ
4512 when exact match is impossible due to invisible text, and the
4513 lines are truncated.
4514
a258d627
JD
45152011-07-23 Jan Djärv <jan.h.d@swipnet.se>
4516
4517 * nsterm.m (initFrameFromEmacs): Set NSTitledWindowMask in styleMask
4518 for OSX >= 10.7.
4519
b6d5a689
EZ
45202011-07-22 Eli Zaretskii <eliz@gnu.org>
4521
0f74f785
EZ
4522 Fix a significant slow-down of cursor motion with C-n, C-p,
4523 C-f/C-b, and C-v/M-v that couldn't keep up with keyboard
4524 auto-repeat under bidi redisplay in fontified buffers.
b6d5a689 4525 * xdisp.c (compute_stop_pos_backwards): New function.
b6d5a689
EZ
4526 (next_element_from_buffer): Call compute_stop_pos_backwards to
4527 find a suitable prev_stop when we find ourselves before
0f74f785
EZ
4528 base_level_stop.
4529 (reseat): Don't look for prev_stop, as that could mean a very long
4530 run.
4531 <cached_disp_pos, cached_disp_buffer, cached_disp_modiff>
4532 <cached_disp_overlay_modiff>: Cache for last found display string
4533 position.
551918c1 4534 (compute_display_string_pos): Return the cached position if asked
0f74f785
EZ
4535 about the same buffer in the same area of character positions, and
4536 the buffer wasn't changed since the time the display string
4537 position was cached.
551918c1 4538
b2d0c91a
EZ
45392011-07-22 Eli Zaretskii <eliz@gnu.org>
4540
4541 * xdisp.c (rows_from_pos_range): Don't ignore glyphs whose object
4542 is an integer, which is important for empty lines. (Bug#9149)
4543
043604ee
CY
45442011-07-22 Chong Yidong <cyd@stupidchicken.com>
4545
4546 * frame.c (Fmodify_frame_parameters): In tty case, update the
4547 default face if necessary (Bug#4238).
4548
da4adb04
CY
45492011-07-21 Chong Yidong <cyd@stupidchicken.com>
4550
4551 * editfns.c (Fstring_to_char): No need to explain what a character
4552 is in the docstring (Bug#6576).
4553
9abd0532
LMI
45542011-07-20 Lars Magne Ingebrigtsen <larsi@gnus.org>
4555
4556 * xml.c (parse_region): Make sure we always return a tree.
4557
36881d16
HK
45582011-07-20 HAMANO Kiyoto <khiker.mail@gmail.com>
4559
4560 * xml.c (parse_region): If a document contains only comments,
4561 return that, too.
4562
1e98674d
LMI
45632011-07-20 Lars Magne Ingebrigtsen <larsi@gnus.org>
4564
4565 * xml.c (make_dom): Return comments, too.
4566
590bd467
PE
45672011-07-19 Paul Eggert <eggert@cs.ucla.edu>
4568
4569 Port to OpenBSD.
4570 See http://lists.gnu.org/archive/html/emacs-devel/2011-07/msg00688.html
4571 and the surrounding thread.
4572 * minibuf.c (read_minibuf_noninteractive): Rewrite to use getchar
4573 rather than fgets, and retry after EINTR. Otherwise, 'emacs
4574 --batch -f byte-compile-file' fails on OpenBSD if an inactivity
4575 timer goes off.
4576 * s/openbsd.h (BROKEN_SIGIO): Define.
4577 * unexelf.c (unexec) [__OpenBSD__]:
4578 Don't update the .mdebug section of the Alpha COFF symbol table.
4579
f41628b2
LMI
45802011-07-19 Lars Magne Ingebrigtsen <larsi@gnus.org>
4581
4582 * lread.c (syms_of_lread): Clarify when `lexical-binding' is used
4583 (bug#8460).
4584
b59b67c5
PE
45852011-07-18 Paul Eggert <eggert@cs.ucla.edu>
4586
15e3a074
PE
4587 * fileio.c (Fcopy_file) [!MSDOS]: Tighten created file's mask.
4588 This fixes some race conditions on the permissions of any newly
4589 created file.
4590
41bed37d
PE
4591 * alloc.c (valid_pointer_p): Use pipe, not open.
4592 This fixes some permissions issues when debugging.
4593
b59b67c5
PE
4594 * fileio.c (Fcopy_file): Adjust mode if fchown fails. (Bug#9002)
4595 If fchown fails to set both uid and gid, try to set just gid,
4596 as that is sometimes allowed. Adjust the file's mode to eliminate
4597 setuid or setgid bits that are inappropriate if fchown fails.
4598
925a6be7
SM
45992011-07-18 Stefan Monnier <monnier@iro.umontreal.ca>
4600
4601 * xdisp.c (next_element_from_string, next_element_from_buffer): Use EQ
4602 to compare Lisp_Objects.
4603 * gnutls.c (syms_of_gnutls): Rename Vgnutls_log_level to
4604 global_gnutls_log_level, don't mistake it for a Lisp_Object.
4605 (init_gnutls_functions, emacs_gnutls_handle_error): Fix up uses.
4606
52968808
AS
46072011-07-17 Andreas Schwab <schwab@linux-m68k.org>
4608
0a6a104b
AS
4609 * lread.c (read_integer): Unread even EOF character.
4610 (read1): Likewise. Properly record start position of symbol.
4611
52968808
AS
4612 * lread.c (read1): Read `#:' as empty uninterned symbol if no
4613 symbol character follows.
4614
9e381cdd
PE
46152011-07-17 Paul Eggert <eggert@cs.ucla.edu>
4616
4617 * fileio.c (Fcopy_file): Pacify gcc re fchown. (Bug#9002)
4618 This works around a problem with the previous change to Fcopy_file.
4619 Recent glibc declares fchown with __attribute__((warn_unused_result)),
4620 and without this change, GCC might complain about discarding
4621 fchown's return value.
4622
b5641435
JB
46232011-07-16 Juanma Barranquero <lekktu@gmail.com>
4624
4625 * makefile.w32-in (GLOBAL_SOURCES): Add gnutls.c (followup to bug#9059).
4626
a8031457
PE
46272011-07-16 Paul Eggert <eggert@cs.ucla.edu>
4628
4629 * fileio.c (Fcopy_file): Don't diagnose fchown failures. (Bug#9002)
4630
dd889327
LMI
46312011-07-16 Lars Magne Ingebrigtsen <larsi@gnus.org>
4632
750c33f7
LMI
4633 * gnutls.c (syms_of_gnutls): Define `gnutls-log-level' here, since
4634 it's used from the C level.
4635
dd889327
LMI
4636 * process.c: Use the same condition for POLL_FOR_INPUT in both
4637 keyboard.c and process.c (bug#1858).
4638
87e86684
LM
46392011-07-09 Lawrence Mitchell <wence@gmx.li>
4640
4641 * gnutls.c (Qgnutls_bootprop_min_prime_bits): New variable.
4642 (Fgnutls_boot): Use it.
4643
64348f40
AS
46442011-07-15 Andreas Schwab <schwab@linux-m68k.org>
4645
4646 * doc.c (Fsubstitute_command_keys): Revert last change.
4647
1d698799
LMI
46482011-07-15 Lars Magne Ingebrigtsen <larsi@gnus.org>
4649
f863868c
LMI
4650 * doc.c (Fsubstitute_command_keys): Clarify that \= really only
4651 quotes the next character, and doesn't affect other longer
4652 sequences (bug#8935).
4653
1d698799
LMI
4654 * lread.c (syms_of_lread): Clarify that is isn't only
4655 `eval-buffer' and `eval-defun' that's affected by
4656 `lexical-binding' (bug#8460).
4657
aa4b6df6
EZ
46582011-07-15 Eli Zaretskii <eliz@gnu.org>
4659
4660 * xdisp.c (move_it_in_display_line_to): Fix vertical motion with
6b02f655 4661 bidi redisplay when a line includes both an image and is truncated.
aa4b6df6 4662
5d856da6
PE
46632011-07-14 Paul Eggert <eggert@cs.ucla.edu>
4664
ad6042bb
PE
4665 Fix minor problems found by static checking.
4666 * bidi.c (bidi_cache_size): Now EMACS_INT, not size_t.
4667 (elsz): Now a signed constant, not a size_t var. We prefer signed
4668 types to unsigned, to avoid integer comparison confusion. Without
4669 this change, GCC 4.6.1 with -Wunsafe-loop-optimizations complains
4670 "cannot optimize loop, the loop counter may overflow", a symptom
4671 of the confusion.
f00bbb22 4672 * indent.c (Fvertical_motion): Mark locals as initialized.
5d856da6
PE
4673 * xdisp.c (reseat_to_string): Fix pointer signedness issue.
4674
6468f31c
LMI
46752011-07-14 Lars Magne Ingebrigtsen <larsi@gnus.org>
4676
49080b10
LMI
4677 * search.c (Fre_search_backward): Mention `case-fold-search' in
4678 all the re_search_* functions (bug#8138).
4679
6468f31c
LMI
4680 * keyboard.c (Fopen_dribble_file): Document when the file is
4681 closed (bug#8056).
4682
c965adc5
EZ
46832011-07-14 Eli Zaretskii <eliz@gnu.org>
4684
df9733bf
EZ
4685 * bidi.c (bidi_dump_cached_states): Fix format of displaying
4686 bidi_cache_idx.
4687
0bb23927
EZ
4688 Support bidi reordering of display and overlay strings.
4689 * xdisp.c (compute_display_string_pos)
4690 (compute_display_string_end): Accept additional argument STRING.
4691 (init_iterator, reseat_1): Initialize bidi_it->string.s to NULL.
4692 (reseat_to_string): Initialize bidi_it->string.s and
4693 bidi_it->string.schars.
4694 (Fcurrent_bidi_paragraph_direction): Initialize itb.string.s to
640c8776
SM
4695 NULL (avoids a crash in bidi_paragraph_init).
4696 Initialize itb.string.lstring.
0bb23927
EZ
4697 (init_iterator): Call bidi_init_it only of a valid
4698 buffer position was specified. Initialize paragraph_embedding to
4699 L2R.
4700 (reseat_to_string): Initialize the bidi iterator.
4701 (display_string): If we need to ignore text properties of
4702 LISP_STRING, set IT->stop_charpos to IT->end_charpos. (The
4703 original value of -1 will not work with bidi.)
4704 (compute_display_string_pos): First arg is now struct
4705 `text_pos *'; all callers changed. Support display properties on
4706 Lisp strings.
4707 (compute_display_string_end): Support display properties on Lisp
4708 strings.
4709 (init_iterator, reseat_1, reseat_to_string): Initialize the
4710 string.bufpos member to 0 (zero, for compatibility with IT_CHARPOS
4711 when iterating on a string not from display properties).
640c8776
SM
4712 (compute_display_string_pos, compute_display_string_end):
4713 Fix calculation of the object to scan. Fixes an error when using
0bb23927
EZ
4714 arrow keys.
4715 (next_element_from_buffer): Don't abort when IT_CHARPOS is before
640c8776
SM
4716 base_level_stop; instead, set base_level_stop to BEGV.
4717 Fixes crashes in vertical-motion.
0bb23927
EZ
4718 (next_element_from_buffer): Improve commentary for when
4719 the iterator is before prev_stop.
4720 (init_iterator): Initialize bidi_p from the default value of
4721 bidi-display-reordering, not from buffer-local value. Use the
4722 buffer-local value only if initializing for buffer iteration.
4723 (handle_invisible_prop): Support invisible properties on strings
4724 that are being bidi-reordered.
4725 (set_iterator_to_next): Support bidi reordering of C strings and
4726 Lisp strings.
4727 (next_element_from_string): Support bidi reordering of Lisp
4728 strings.
4729 (handle_stop_backwards): Support Lisp strings as well.
640c8776
SM
4730 (display_string): Support display of R2L glyph rows.
4731 Use IT_STRING_CHARPOS when displaying from a Lisp string.
0bb23927
EZ
4732 (init_iterator): Don't initialize it->bidi_p for strings
4733 here.
4734 (reseat_to_string): Initialize it->bidi_p for strings here.
4735 (next_element_from_string, next_element_from_c_string)
4736 (next_element_from_buffer): Add xassert's for correspondence
4737 between IT's object being iterated and it->bidi_it.string
4738 structure.
4739 (face_before_or_after_it_pos): Support bidi iteration.
4740 (next_element_from_c_string): Handle the case of the first string
4741 character that is not the first one in the visual order.
4742 (get_visually_first_element): New function, refactored from common
4743 parts of next_element_from_buffer, next_element_from_string, and
4744 next_element_from_c_string.
4745 (tool_bar_lines_needed, redisplay_tool_bar)
4746 (display_menu_bar): Force left-to-right direction. Add a FIXME
4747 comment for making that be controlled by a user option.
4748 (push_it, pop_it): Save and restore the state of the
4749 bidi iterator. Save and restore the bidi_p flag.
4750 (pop_it): Iterate out of display property for string iteration as
4751 well.
4752 (iterate_out_of_display_property): Support iteration over strings.
4753 (handle_single_display_spec): Set up it->bidi_it for iteration
4754 over a display string, and call bidi_init_it.
4755 (handle_single_display_spec, next_overlay_string)
4756 (get_overlay_strings_1, push_display_prop): Set up the bidi
4757 iterator for displaying display or overlay strings.
4758 (forward_to_next_line_start): Don't use the shortcut if
4759 bidi-iterating.
4760 (back_to_previous_visible_line_start): If handle_display_prop
4761 pushed the iterator stack, restore the internal state of the bidi
4762 iterator by calling bidi_pop_it same number of times.
4763 (reseat_at_next_visible_line_start): If ON_NEWLINE_P is non-zero,
4764 and we are bidi-iterating, don't decrement the iterator position;
4765 instead, set the first_elt flag in the bidi iterator, to produce
4766 the same effect.
4767 (reseat_1): Remove redundant setting of string_from_display_prop_p.
4768 (push_display_prop): xassert that we are iterating a buffer.
4769 (push_it, pop_it): Save and restore paragraph_embedding member.
4770 (handle_single_display_spec, next_overlay_string)
4771 (get_overlay_strings_1, reseat_1, reseat_to_string)
4772 (push_display_prop): Set up the `unibyte' member of bidi_it.string
4773 correctly. Don't assume unibyte strings are not bidi-reordered.
4774 (compute_display_string_pos)
4775 (compute_display_string_end): Fix handling the case of C string.
4776 (push_it, pop_it): Save and restore from_disp_prop_p.
4777 (handle_single_display_spec, push_display_prop): Set the
4778 from_disp_prop_p flag.
4779 (get_overlay_strings_1): Reset the from_disp_prop_p flag.
4780 (pop_it): Call iterate_out_of_display_property only if we are
4781 popping after iteration over a string that came from a display
4782 property. Fix a typo in popping stretch info. Add an assertion
4783 for verifying that the iterator position is in sync with the bidi
4784 iterator.
4785 (handle_single_display_spec, get_overlay_strings_1)
4786 (push_display_prop): Fix initialization of paragraph direction for
4787 string when that of the parent object is not yet determined.
4788 (reseat_1): Call bidi_init_it to resync the bidi
4789 iterator with IT's position. (Bug#7616)
4790 (find_row_edges): If ROW->start.pos gives position
4791 smaller than min_pos, use it as ROW->minpos. (Bug#7616)
4792 (handle_stop, back_to_previous_visible_line_start, reseat_1):
4793 Reset the from_disp_prop_p flag.
4794 (SAVE_IT, RESTORE_IT): New macros.
4795 (pos_visible_p, face_before_or_after_it_pos)
4796 (back_to_previous_visible_line_start)
4797 (move_it_in_display_line_to, move_it_in_display_line)
4798 (move_it_to, move_it_vertically_backward, move_it_by_lines)
4799 (try_scrolling, redisplay_window, display_line): Use them when
4800 saving a temporary copy of the iterator and restoring it back.
4801 (back_to_previous_visible_line_start, reseat_1)
4802 (init_iterator): Empty the bidi cache "stack".
4803 (move_it_in_display_line_to): If iterator ended up at
4804 EOL, but we never saw any buffer positions smaller than
4805 to_charpos, return MOVE_POS_MATCH_OR_ZV. Fixes vertical cursor
4806 motion in bidi-reordered lines.
4807 (move_it_in_display_line_to): Record prev_method and prev_pos
4808 immediately before the call to set_iterator_to_next. Fixes cursor
4809 motion in bidi-reordered lines with stretch glyphs and strings
4810 displayed in margins. (Bug#8133) (Bug#8867)
4811 Return MOVE_POS_MATCH_OR_ZV only if iterator position is past
4812 TO_CHARPOS.
640c8776
SM
4813 (pos_visible_p): Support positions in bidi-reordered lines.
4814 Save and restore bidi cache.
0bb23927
EZ
4815
4816 * bidi.c (bidi_level_of_next_char): clen should be EMACS_NT, not int.
4817 (bidi_paragraph_info): Delete unused struct.
4818 (bidi_cache_idx, bidi_cache_last_idx): Declare EMACS_INT.
4819 (bidi_cache_start): New variable.
4820 (bidi_cache_reset): Reset bidi_cache_idx to bidi_cache_start, not
4821 to zero.
4822 (bidi_cache_fetch_state, bidi_cache_search)
4823 (bidi_cache_find_level_change, bidi_cache_iterator_state)
4824 (bidi_cache_find, bidi_peek_at_next_level)
4825 (bidi_level_of_next_char, bidi_find_other_level_edge)
4826 (bidi_move_to_visually_next): Compare cache index with
4827 bidi_cache_start rather than with zero.
4828 (bidi_fetch_char): Accept new argument STRING; all callers
4829 changed. Support iteration over a string. Support strings with
4830 display properties. Support unibyte strings. Fix the type of
4831 `len' according to what STRING_CHAR_AND_LENGTH expects.
4832 (bidi_paragraph_init, bidi_resolve_explicit_1)
4833 (bidi_resolve_explicit, bidi_resolve_weak)
640c8776
SM
4834 (bidi_level_of_next_char, bidi_move_to_visually_next):
4835 Support iteration over a string.
0bb23927
EZ
4836 (bidi_set_sor_type, bidi_resolve_explicit_1)
4837 (bidi_resolve_explicit, bidi_type_of_next_char): ignore_bn_limit
4838 can now be zero (for strings); special values 0 and -1 were
4839 changed to -1 and -2, respectively.
4840 (bidi_char_at_pos): New function.
4841 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak):
4842 Call it instead of FETCH_MULTIBYTE_CHAR.
4843 (bidi_move_to_visually_next): Abort if charpos or bytepos were not
4844 initialized to valid values.
4845 (bidi_init_it): Don't initialize charpos and bytepos with invalid
4846 values.
4847 (bidi_level_of_next_char): Allow the sentinel "position" to pass
4848 the test for valid cached positions. Fix the logic for looking up
4849 the sentinel state in the cache. GCPRO the Lisp string we are
4850 iterating.
4851 (bidi_push_it, bidi_pop_it): New functions.
4852 (bidi_initialize): Initialize the bidi cache start stack pointer.
4853 (bidi_cache_ensure_space): New function, refactored from part of
4854 bidi_cache_iterator_state. Don't assume the required size is just
4855 one BIDI_CACHE_CHUNK away.
4856 (bidi_cache_start_stack, bidi_push_it): Use IT_STACK_SIZE.
4857 (bidi_count_bytes, bidi_char_at_pos): New functions.
4858 (bidi_cache_search): Don't assume bidi_cache_last_idx is
4859 always valid if bidi_cache_idx is valid.
4860 (bidi_cache_find_level_change): xassert that bidi_cache_last_idx
4861 is valid if it's going to be used.
4862 (bidi_shelve_cache, bidi_unshelve_cache): New functions.
4863 (bidi_cache_fetch_state, bidi_cache_search)
c965adc5
EZ
4864 (bidi_cache_find_level_change, bidi_cache_ensure_space)
4865 (bidi_cache_iterator_state, bidi_cache_find)
640c8776
SM
4866 (bidi_find_other_level_edge, bidi_cache_start_stack):
4867 All variables related to cache indices are now EMACS_INT.
c965adc5 4868
0bb23927
EZ
4869 * dispextern.h (struct bidi_string_data): New structure.
4870 (struct bidi_it): New member `string'. Make flag members be 1-bit
4871 fields, and put them last in the struct.
640c8776
SM
4872 (compute_display_string_pos, compute_display_string_end):
4873 Update prototypes.
0bb23927
EZ
4874 (bidi_push_it, bidi_pop_it): Add prototypes.
4875 (struct iterator_stack_entry): New members bidi_p,
4876 paragraph_embedding, and from_disp_prop_p.
4877 (struct it): Member bidi_p is now a bit field 1 bit wide.
640c8776
SM
4878 (bidi_shelve_cache, bidi_unshelve_cache):
4879 Declare prototypes.
0bb23927
EZ
4880
4881 * .gdbinit (xvectype, xvector, xcompiled, xchartable, xboolvector)
4882 (xpr, xfont, xbacktrace): Use "header.size" when accessing vectors
4883 and vector-like objects.
4884
4885 * dispnew.c (buffer_posn_from_coords): Save and restore the bidi
4886 cache around display iteration.
4887
4888 * window.c (Fwindow_end, window_scroll_pixel_based)
4889 (displayed_window_lines, Frecenter): Save and restore the bidi
4890 cache around display iteration.
4891
3bbd2265
LMI
48922011-07-14 Lars Magne Ingebrigtsen <larsi@gnus.org>
4893
4894 * editfns.c (Fdelete_region): Clarify the use of the named
4895 parameters (bug#6788).
4896
adc47434
MR
48972011-07-14 Martin Rudalics <rudalics@gmx.at>
4898
4899 * indent.c (Fvertical_motion): Set and restore w->pointm when
4900 saving and restoring the window's buffer (Bug#9006).
4901
837c31f8
LMI
49022011-07-13 Lars Magne Ingebrigtsen <larsi@gnus.org>
4903
4904 * editfns.c (Fstring_to_char): Clarify just what is returned
4905 (bug#6576). Text by Eli Zaretskii.
4906
ac389d0c
JB
49072011-07-13 Juanma Barranquero <lekktu@gmail.com>
4908
4909 * gnutls.c (init_gnutls_functions): Honor gnutls_log_level (bug#9059).
4910
0be0ce47
EZ
49112011-07-13 Eli Zaretskii <eliz@gnu.org>
4912
4913 * buffer.c (mmap_find): Fix a typo.
4914
cd18e7e3
JB
49152011-07-13 Johan Bockgård <bojohan@gnu.org>
4916
4917 Fix execution of x selection hooks.
4918 * xselect.c (Qx_lost_selection_functions)
4919 (Qx_sent_selection_functions): New vars.
4920 (syms_of_xselect): DEFSYM them.
4921 (x_handle_selection_request): Pass Qx_sent_selection_functions
4922 rather than Vx_sent_selection_functions to Frun_hook_with_args.
4923 (x_handle_selection_clear,x_clear_frame_selections):
4924 Pass Qx_lost_selection_functions rather than
4925 Vx_lost_selection_functions to Frun_hook_with_args.
4926
47ea7f44
PE
49272011-07-13 Paul Eggert <eggert@cs.ucla.edu>
4928
ac389d0c 4929 * buffer.c (Fget_buffer_create): Initialize inhibit_shrinking.
2941c447
PE
4930 The old code sometimes used this field without initializing it.
4931
47ea7f44
PE
4932 * alloc.c (gc_sweep): Don't read past end of array.
4933 In theory, the old code could also have corrupted Emacs internals,
4934 though it'd be very unlikely.
4935
bc985c87
AS
49362011-07-12 Andreas Schwab <schwab@linux-m68k.org>
4937
4938 * character.c (Fcharacterp): Don't advertise optional ignored
ac389d0c 4939 argument. (Bug#4026)
bc985c87 4940
0cf34688
LMI
49412011-07-12 Lars Magne Ingebrigtsen <larsi@gnus.org>
4942
b3dadd76
LMI
4943 * keymap.c (syms_of_keymap): Clarify that "modifier" is "modifier
4944 key" (bug#4257).
4945
0cf34688
LMI
4946 * window.c (Fset_window_start): Doc fix (bug#4199).
4947 (Fset_window_hscroll): Ditto.
4948
270768cd
PE
49492011-07-12 Paul Eggert <eggert@cs.ucla.edu>
4950
077e3dda 4951 Fix minor new problems caught by GCC 4.6.1.
270768cd 4952 * term.c (init_tty): Remove unused local.
490011a6 4953 * xsettings.c (store_monospaced_changed): Define this function only
077e3dda 4954 if (defined HAVE_GSETTINGS || defined HAVE_GCONF), as it's
490011a6 4955 not used otherwise.
270768cd 4956
b1f58454
CY
49572011-07-12 Chong Yidong <cyd@stupidchicken.com>
4958
4959 * xdisp.c (Vresize_mini_windows): Minor doc fix (Bug#3300).
4960
22b9578d
LMI
49612011-07-11 Lars Magne Ingebrigtsen <larsi@gnus.org>
4962
6e70ab07
LMI
4963 * xdisp.c (syms_of_xdisp): Make it explicit that the mini-windows
4964 are the mini-buffer and the echo area (bug#3320).
4965
22b9578d
LMI
4966 * term.c (init_tty): Remove support for supdup, c10 and perq
4967 terminals, which are no longer supported (bug#1482).
4968
8974cc9f
JB
49692011-07-10 Johan Bockgård <bojohan@gnu.org>
4970
4971 * xdisp.c (Ftool_bar_lines_needed): Fix WINDOWP check.
4972
a560d974
JD
49732011-07-10 Jan Djärv <jan.h.d@swipnet.se>
4974
4975 * xmenu.c (menu_highlight_callback): Only pass frame to show_help_event
4976 for non-popups (Bug#3642).
4977
1dae0f0a
AS
49782011-07-10 Andreas Schwab <schwab@linux-m68k.org>
4979
268c2c36 4980 * alloc.c (reset_malloc_hooks): Protoize.
1dae0f0a 4981 * buffer.c (mmap_init, mmap_find, mmap_free_1, mmap_enlarge)
268c2c36
AS
4982 (mmap_set_vars, mmap_alloc, mmap_free, mmap_realloc): Likewise.
4983 * cm.c (losecursor): Likewise.
1dae0f0a
AS
4984 * data.c (fmod): Likewise.
4985 * dispnew.c (swap_glyphs_in_rows): Likewise.
4986 * emacs.c (memory_warning_signal): Likewise.
4987 * floatfns.c (float_error): Likewise.
4988 * font.c (check_gstring, check_otf_features, otf_tag_symbol)
4989 (otf_open, font_otf_capability, generate_otf_features)
4990 (font_otf_DeviceTable, font_otf_ValueRecord, font_otf_Anchor):
4991 Likewise.
4992 * image.c (pbm_read_file): Likewise.
4993 * indent.c (string_display_width): Likewise.
4994 * intervals.c (check_for_interval, search_for_interval)
4995 (inc_interval_count, count_intervals, root_interval)
4996 (adjust_intervals_for_insertion, make_new_interval): Likewise.
4997 * lread.c (defalias): Likewise.
268c2c36 4998 * ralloc.c (r_alloc_check): Likewise.
1dae0f0a
AS
4999 * regex.c (set_image_of_range_1, set_image_of_range)
5000 (regex_grow_registers): Likewise.
5001 * sysdep.c (strerror): Likewise.
5002 * termcap.c (valid_filename_p, tprint, main): Likewise.
5003 * tparam.c (main): Likewise.
5004 * unexhp9k800.c (run_time_remap, save_data_space)
5005 (update_file_ptrs, read_header, write_header, calculate_checksum)
5006 (copy_file, copy_rest, display_header): Likewise.
5007 * widget.c (mark_shell_size_user_specified, create_frame_gcs):
5008 Likewise.
5009 * xdisp.c (check_it): Likewise.
5010 * xfaces.c (register_color, unregister_color, unregister_colors):
5011 Likewise.
5012 * xfns.c (print_fontset_result): Likewise.
5013 * xrdb.c (member, fatal, main): Likewise.
5014
99033785
PE
50152011-07-10 Paul Eggert <eggert@cs.ucla.edu>
5016
5017 Fix minor problems found by static checking (Bug#9031).
5018 * chartab.c (char_table_set_range, map_sub_char_table):
5019 Remove unused locals.
5020 (uniprop_table): Now static.
5021 * composite.c (_work_char): Remove unused static var.
5022
9cb2ac56
JB
50232011-07-09 Juanma Barranquero <lekktu@gmail.com>
5024
5025 * chartab.c (uniprop_table_uncompress): Remove unused local variable.
5026
f25661f0
JD
50272011-07-09 Jan Djärv <jan.h.d@swipnet.se>
5028
5029 * gtkutil.c (qttip_cb): Remove code without function.
5030
8278c4fe
EZ
50312011-07-09 Eli Zaretskii <eliz@gnu.org>
5032
5033 * w32.c (pthread_sigmask): New stub.
5034
1692ae2d 50352011-07-08 Paul Eggert <eggert@cs.ucla.edu>
123403e4 5036
8a6ebd58 5037 Use pthread_sigmask, not sigprocmask (Bug#9010).
123403e4
PE
5038 sigprocmask is portable only for single-threaded applications, and
5039 Emacs can be multi-threaded when it uses GTK.
1301ac26
PE
5040 * Makefile.in (LIB_PTHREAD_SIGMASK): New macro.
5041 (LIBES): Use it.
5042 * callproc.c (Fcall_process):
5043 * process.c (create_process):
5044 * sysdep.c (sys_sigblock, sys_sigunblock, sys_sigsetmask):
5045 Use pthread_sigmask, not sigprocmask.
123403e4 5046
1b854618
JD
50472011-07-08 Jan Djärv <jan.h.d@swipnet.se>
5048
5049 * gtkutil.c (qttip_cb): Set line wrap to FALSE for tooltip widget.
5050 (xg_prepare_tooltip): Revert text in x->ttip_lbl, margins was
5051 wrong (Bug#8591).
5052
3fe4b549
JD
50532011-07-08 Jan Djärv <jan.h.d@swipnet.se>
5054
0ce7e563
JD
5055 * gtkutil.c (xg_prepare_tooltip): Fix indentation and comment.
5056 Put text in x->ttip_lbl instead of gtk_tooltip_set_text (Bug#8591).
5057 (xg_hide_tooltip): Fix comment.
5058
3fe4b549
JD
5059 * nsterm.m (initFrameFromEmacs): Don't use ns_return_types
5060 in registerServicesMenuSendTypes.
5061 (validRequestorForSendType): Don't check ns_return_types.
5062
5063 * nsfns.m (Fx_open_connection): Put NSStringPboardType into
5064 ns_return_type.
5065
5df75e47
JR
50662011-07-08 Jason Rumney <jasonr@gnu.org>
5067
22610910
JR
5068 * w32term.c (x_make_frame_visible): Use SH_SHOWNORMAL rather than
5069 SH_SHOW for hidden windows (Bug#5482).
5070
5df75e47
JR
5071 * w32fns.c (w32_wnd_proc) [WM_TIMER, WM_SET_CURSOR]: Avoid using
5072 frame struct members of non-existent frames (Bug#6284).
5073
699c10bd
JD
50742011-07-08 Jan Djärv <jan.h.d@swipnet.se>
5075
4393663b
JD
5076 * nsterm.m (keyDown): Call to wantsToDelayTextChangeNotifications and
5077 variable firstTime not needed on OSX >= 10.6.
5078 (setPosition): setFloatValue:knobProportion: is deprecated on OSX
5079 >= 10.5. Use setKnobProportion, setDoubleValue.
5080
5081 * nsterm.h (MAC_OS_X_VERSION_10_3, MAC_OS_X_VERSION_10_4)
5082 (MAC_OS_X_VERSION_10_5): Define if not defined.
5083 (EmacsView, EmacsTooltip): Implements NSWindowDelegate on OSX >= 10.6.
5084 (EmacsMenu): Implements NSMenuDelegate on OSX >= 10.6.
5085 (EmacsToolbar): Implements NSToolbarDelegate on OSX >= 10.6.
5086
5087 * nsselect.m (ns_string_from_pasteboard): Don't use deprecated methods
5088 cString and lossyCString on OSX >= 10.4
5089
58179cce 5090 * nsmenu.m (fillWithWidgetValue): Don't use deprecated method
4393663b
JD
5091 sizeToFit on OSX >= 10.2.
5092
5093 * nsimage.m (allocInitFromFile): Don't use deprecated method
5094 bestRepresentationForDevice on OSX >= 10.6.
5095
5096 * nsfns.m (check_ns_display_info): Cast to long and use %ld in error
5097 to avoid warning.
5098
5099 * emacs.c: Declare unexec_init_emacs_zone.
5100
a63e0781
JD
5101 * nsgui.h: Fix compiler warning about gnulib redefining verify.
5102
699c10bd
JD
5103 * nsselect.m (ns_get_local_selection): Change to extern (Bug#8842).
5104
5105 * nsmenu.m (ns_update_menubar): Remove useless setDelegate call
5106 on svcsMenu (Bug#8842).
5107
5108 * nsfns.m (Fx_open_connection): Remove NSStringPboardType from
5109 ns_return_types.
5110 (Fns_list_services): Just return Qnil on 10.6, code not working there.
5111
5112 * nsterm.m (QUTF8_STRING): Declare.
5113 (initFrameFromEmacs): Call registerServicesMenuSendTypes.
5114 (validRequestorForSendType): Return type is (id).
5115 Change indexOfObjectIdenticalTo to indexOfObject.
5116 Check if we have local selection before returning self (Bug#8842).
5117 (writeSelectionToPasteboard): Put local selection into paste board
5118 if we have a local selection (Bug#8842).
5119 (syms_of_nsterm): DEFSYM QUTF8_STRING.
5120
5121 * nsterm.h (MAC_OS_X_VERSION_10_6): Define here instead of nsterm.m.
5122 (ns_get_local_selection): Declare.
5123
54e10184
LMI
51242011-07-07 Lars Magne Ingebrigtsen <larsi@gnus.org>
5125
9888ff71
LMI
5126 * keymap.c (describe_map_tree): Don't insert a double newline at
5127 the end of the buffer (bug#1169) and return whether we inserted
5128 something.
5129
54e10184
LMI
5130 * callint.c (Fcall_interactively): Change "reading args" to
5131 "providing args" to try to clarify what it does (bug#1010).
5132
15fa4783
KH
51332011-07-07 Kenichi Handa <handa@m17n.org>
5134
5135 * composite.c (composition_compute_stop_pos): Ignore a static
5136 composition starting before CHARPOS (Bug#8915).
5137
5138 * xdisp.c (handle_composition_prop): Likewise.
5139
a8815b00
EZ
51402011-07-07 Eli Zaretskii <eliz@gnu.org>
5141
5142 * term.c (produce_glyphs) <xassert>: Allow IT_GLYPHLESS in it->what.
5143 (Bug#9015)
5144
ef7b981d 51452011-07-07 Kenichi Handa <handa@m17n.org>
c805dec0
KH
5146
5147 * character.h (unicode_category_t): New enum type.
5148
5149 * chartab.c (uniprop_decoder_t, uniprop_encoder_t): New types.
5150 (Qchar_code_property_table): New variable.
5151 (UNIPROP_TABLE_P, UNIPROP_GET_DECODER)
5152 (UNIPROP_COMPRESSED_FORM_P): New macros.
5153 (char_table_ascii): Uncompress the compressed values.
5154 (sub_char_table_ref): New arg is_uniprop. Callers changed.
5155 Uncompress the compressed values.
ac389d0c 5156 (sub_char_table_ref_and_range): Likewise.
c805dec0
KH
5157 (char_table_ref_and_range): Uncompress the compressed values.
5158 (sub_char_table_set): New arg is_uniprop. Callers changed.
5159 Uncompress the compressed values.
5160 (sub_char_table_set_range): Args changed. Callers changed.
5161 (char_table_set_range): Adjuted for the above change.
5162 (map_sub_char_table): Delete args default_val and parent. Add arg
5163 top. Give decoded values to a Lisp function.
640c8776 5164 (map_char_table): Adjust for the above change. Give decoded
c805dec0
KH
5165 values to a Lisp function. Gcpro more variables.
5166 (uniprop_table_uncompress)
5167 (uniprop_decode_value_run_length): New functions.
5168 (uniprop_decoder, uniprop_decoder_count): New variables.
5169 (uniprop_get_decoder, uniprop_encode_value_character)
5170 (uniprop_encode_value_run_length, uniprop_encode_value_numeric):
5171 New functions.
5172 (uniprop_encoder, uniprop_encoder_count): New variables.
5173 (uniprop_get_encoder, uniprop_table)
5174 (Funicode_property_table_internal, Fget_unicode_property_internal)
5175 (Fput_unicode_property_internal): New functions.
5176 (syms_of_chartab): DEFSYM Qchar_code_property_table, defsubr
5177 Sunicode_property_table_internal, Sget_unicode_property_internal,
5e617bc2 5178 and Sput_unicode_property_internal. Defvar_lisp
c805dec0
KH
5179 char-code-property-alist.
5180
640c8776 5181 * composite.c (CHAR_COMPOSABLE_P): Adjust for the change of
c805dec0
KH
5182 Vunicode_category_table.
5183
640c8776 5184 * font.c (font_range): Adjust for the change of
c805dec0
KH
5185 Vunicode_category_table.
5186
76b397fb
DN
51872011-07-07 Dan Nicolaescu <dann@ics.uci.edu>
5188
5189 * m/iris4d.h: Remove file, move contents ...
5190 * s/irix6-5.h: ... here.
5191
22b4128e
PE
51922011-07-06 Paul Eggert <eggert@cs.ucla.edu>
5193
5194 Remove unportable assumption about struct layout (Bug#8884).
8a5c77bb
PE
5195 * alloc.c (mark_buffer):
5196 * buffer.c (reset_buffer_local_variables, Fbuffer_local_variables)
5197 (clone_per_buffer_values): Don't assume that
22b4128e
PE
5198 sizeof (struct buffer) is a multiple of sizeof (Lisp_Object).
5199 This isn't true in general, and it's particularly not true
5200 if Emacs is configured with --with-wide-int.
5201 * buffer.h (FIRST_FIELD_PER_BUFFER, LAST_FIELD_PER_BUFFER):
5202 New macros, used in the buffer.c change.
5203
869795d6
JD
52042011-07-05 Jan Djärv <jan.h.d@swipnet.se>
5205
5206 * xsettings.c: Use both GConf and GSettings if both are available.
5207 (store_config_changed_event): Add comment.
5208 (dpyinfo_valid, store_font_name_changed, map_tool_bar_style)
5209 (store_tool_bar_style_changed): New functions.
5e617bc2 5210 (store_monospaced_changed): Add comment. Call dpyinfo_valid.
869795d6
JD
5211 (struct xsettings): Move font inside HAVE_XFT.
5212 (GSETTINGS_TOOL_BAR_STYLE, GSETTINGS_FONT_NAME): New defines.
640c8776 5213 (GSETTINGS_MONO_FONT): Rename from SYSTEM_MONO_FONT.
869795d6 5214 Move inside HAVE_XFT.
640c8776 5215 (something_changed_gsettingsCB): Rename from something_changedCB.
869795d6
JD
5216 Check for changes in GSETTINGS_TOOL_BAR_STYLE and GSETTINGS_FONT_NAME
5217 also.
5218 (GCONF_TOOL_BAR_STYLE, GCONF_FONT_NAME): New defines.
5e617bc2 5219 (GCONF_MONO_FONT): Rename from SYSTEM_MONO_FONT. Move inside HAVE_XFT.
640c8776 5220 (something_changed_gconfCB): Rename from something_changedCB.
869795d6
JD
5221 Check for changes in GCONF_TOOL_BAR_STYLE and GCONF_FONT_NAME also.
5222 (parse_settings): Move check for font inside HAVE_XFT.
5223 (read_settings, apply_xft_settings): Add comment.
5224 (read_and_apply_settings): Add comment. Call map_tool_bar_style and
5225 store_tool_bar_style_changed. Move check for font inside HAVE_XFT and
5226 call store_font_name_changed.
5227 (xft_settings_event): Add comment.
5228 (init_gsettings): Add comment. Get values for GSETTINGS_TOOL_BAR_STYLE
5229 and GSETTINGS_FONT_NAME. Move check for fonts within HAVE_XFT.
5230 (init_gconf): Add comment. Get values for GCONF_TOOL_BAR_STYLE
5231 and GCONF_FONT_NAME. Move check for fonts within HAVE_XFT.
5232 (xsettings_initialize): Call init_gsettings last.
640c8776
SM
5233 (xsettings_get_system_font, xsettings_get_system_normal_font):
5234 Add comment.
869795d6 5235
d8ed26bd
PE
52362011-07-05 Paul Eggert <eggert@cs.ucla.edu>
5237
5238 Random fixes. E.g., (random) never returned negative values.
5239 * fns.c (Frandom): Use GET_EMACS_TIME for random seed, and add the
5240 subseconds part to the entropy, as that's a bit more random.
5241 Prefer signed to unsigned, since the signedness doesn't matter and
5242 in general we prefer signed. When given a limit, use a
5243 denominator equal to INTMASK + 1, not to VALMASK + 1, because the
5244 latter isn't right if USE_2_TAGS_FOR_INTS.
5245 * sysdep.c (get_random): Return a value in the range 0..INTMASK,
5246 not 0..VALMASK. Don't discard "excess" bits that random () returns.
5247
cabf1cac
SM
52482011-07-04 Stefan Monnier <monnier@iro.umontreal.ca>
5249
5250 * textprop.c (text_property_stickiness):
5251 Obey Vtext_property_default_nonsticky.
5252 (syms_of_textprop): Add `display' to Vtext_property_default_nonsticky.
5253 * w32fns.c (syms_of_w32fns):
5254 * xfns.c (syms_of_xfns): Don't Add `display' since it's there by default.
5255
6e9b2be9
PE
52562011-07-04 Paul Eggert <eggert@cs.ucla.edu>
5257
5258 * fileio.c (barf_or_query_if_file_exists): Use S_ISDIR.
5259 This is more efficient than Ffile_directory_p and avoids a minor race.
5260
90186c68
LMI
52612011-07-04 Lars Magne Ingebrigtsen <larsi@gnus.org>
5262
7c301272
LMI
5263 * buffer.c (Foverlay_put): Say what the return value is
5264 (bug#7835).
5265
c4f2d8d4
LMI
5266 * fileio.c (barf_or_query_if_file_exists): Check first if the file
5267 is a directory before asking whether to use the file name
5268 (bug#7564).
ad637907
LMI
5269 (barf_or_query_if_file_exists): Make the "File is a directory"
5270 error be more correct.
c4f2d8d4 5271
90186c68
LMI
5272 * fns.c (Frequire): Remove the mention of the .gz files, since
5273 that's installation-specific, but keep the mention of
5274 `get-load-suffixes'.
5275
da64016e
PE
52762011-07-04 Paul Eggert <eggert@cs.ucla.edu>
5277
5278 * editfns.c (Fformat_time_string): Don't assume strlen fits in int.
5279 Report string overflow if the output is too long.
5280
7d47b580
JB
52812011-07-04 Juanma Barranquero <lekktu@gmail.com>
5282
a555cb87
JB
5283 * gnutls.c (Fgnutls_boot): Don't mention :verify-error.
5284 (syms_of_gnutls): Remove duplicate DEFSYM for
5285 Qgnutls_bootprop_verify_hostname_error, an error for
5286 Qgnutls_bootprop_verify_error (which is no longer used).
5287
7d47b580
JB
5288 * eval.c (find_handler_clause): Remove parameters `sig' and `data',
5289 unused since 2011-01-26T20:02:07Z!monnier@iro.umontreal.ca. All callers changed.
5290 Also (re)move comments that are misplaced or no longer relevant.
5291
1e49bfab
LMI
52922011-07-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
5293
5294 * callint.c (Finteractive): Clarify the meaning of "@" (bug#8813).
5295
1485f4c0
CY
52962011-07-03 Chong Yidong <cyd@stupidchicken.com>
5297
5298 * xfaces.c (Finternal_merge_in_global_face): Modify the foreground
5299 and background color parameters if they have been changed.
5300
a9ab721e
LMI
53012011-07-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
5302
5303 * editfns.c (Fformat): Clarify the - and 0 flags (bug#6659).
5304
cf7cff57
PE
53052011-07-03 Paul Eggert <eggert@cs.ucla.edu>
5306
2e13213d
PE
5307 * xsettings.c (SYSTEM_FONT): Define only when used.
5308 No need to define when HAVE_GSETTINGS || !HAVE_XFT.
5309
cf7cff57
PE
5310 * keymap.c (access_keymap_1): Now static.
5311
7a8e04f7
CY
53122011-07-02 Chong Yidong <cyd@stupidchicken.com>
5313
5314 * keyboard.c (command_loop_1): If a down-mouse event is unbound,
5315 leave any prefix arg for the up event (Bug#1586).
5316
61352f62
LMI
53172011-07-02 Lars Magne Ingebrigtsen <larsi@gnus.org>
5318
69bb1ef7
LMI
5319 * lread.c (syms_of_lread): Mention single symbols defined by
5320 `defvar' or `defconst' (bug#7154).
5321
61352f62 5322 * fns.c (Frequire): Mention .el.gz files (bug#7314).
7b3747f9 5323 (Frequire): Mention get-load-suffixes.
61352f62 5324
28545e04
MR
53252011-07-02 Martin Rudalics <rudalics@gmx.at>
5326
5327 * window.h (window): Remove clone_number slot.
5328 * window.c (Fwindow_clone_number, Fset_window_clone_number):
5329 Remove.
5330 (make_parent_window, make_window, saved_window)
5331 (Fset_window_configuration, save_window_save): Don't deal with
5332 clone numbers.
5333 * buffer.c (Qclone_number): Remove declaration.
5334 (sort_overlays, overlay_strings): Don't deal with clone numbers.
5335
3349e122
SM
53362011-07-02 Stefan Monnier <monnier@iro.umontreal.ca>
5337
5338 Add multiple inheritance to keymaps.
5339 * keymap.c (Fmake_composed_keymap): New function.
5340 (Fset_keymap_parent): Simplify.
5341 (fix_submap_inheritance): Remove.
5342 (access_keymap_1): New function extracted from access_keymap to handle
5343 embedded parents and handle lists of maps.
5344 (access_keymap): Use it.
5345 (Fkeymap_prompt, map_keymap_internal, map_keymap, store_in_keymap)
5346 (Fcopy_keymap): Handle embedded parents.
5347 (Fcommand_remapping, define_as_prefix): Simplify.
5348 (Fkey_binding): Simplify.
5349 (syms_of_keymap): Move minibuffer-local-completion-map,
5350 minibuffer-local-filename-completion-map,
5351 minibuffer-local-must-match-map, and
5352 minibuffer-local-filename-must-match-map to Elisp.
5353 (syms_of_keymap): Defsubr make-composed-keymap.
5354 * keyboard.c (menu_bar_items): Use map_keymap_canonical.
5355 (parse_menu_item): Trivial simplification.
5356
3279eb87
GM
53572011-07-01 Glenn Morris <rgm@gnu.org>
5358
5359 * Makefile.in (SETTINGS_LIBS): Fix typo.
5360
4550efdf
KI
53612011-07-01 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny patch)
5362
5363 * coding.c (Fencode_coding_string): Record the last coding system
5364 used, as the function doc string says (bug#8738).
5365
0949d2b6
JD
53662011-07-01 Jan Djärv <jan.h.d@swipnet.se>
5367
5368 * xsettings.c (store_monospaced_changed): Take new font as arg and
5369 check for change against current_mono_font.
5370 (EMACS_TYPE_SETTINGS): Remove this and related defines.
5371 (emacs_settings_constructor, emacs_settings_get_property)
5372 (emacs_settings_set_property, emacs_settings_class_init)
5373 (emacs_settings_init, gsettings_obj): Remove.
5374 (something_changedCB): New function for HAVE_GSETTINGS.
5375 (something_changedCB): HAVE_GCONF: Call store_monospaced_changed
5376 with value as argument.
5377 (init_gsettings): Check that GSETTINGS_SCHEMA exists before calling
5378 g_settings_new (Bug#8967). Do not create gsettings_obj.
9173deec 5379 Remove calls to g_settings_bind. Connect something_changedCB to
0949d2b6
JD
5380 "changed".
5381
5382 * xgselect.c: Add defined (HAVE_GSETTINGS).
5383 (xgselect_initialize): Ditto.
5384
5385 * process.c: Add defined (HAVE_GSETTINGS) for xgselect.h
5386 (wait_reading_process_output): Add defined (HAVE_GSETTINGS) for
5387 xg_select.
5388
bbc6b304
PE
53892011-07-01 Paul Eggert <eggert@cs.ucla.edu>
5390
5391 * eval.c (struct backtrace): Simplify and port the data structure.
5392 Do not assume that "int nargs : BITS_PER_INT - 2;" produces a
5393 signed bit field, as this assumption is not portable and it makes
5394 Emacs crash when compiled with Sun C 5.8 on sparc. Do not use
5395 "char debug_on_exit : 1" as this is not portable either; instead,
5396 use the portable "unsigned int debug_on_exit : 1". Remove unused
5397 member evalargs. Remove obsolete comments about cc bombing out.
5398
9851bfc5
JD
53992011-06-30 Jan Djärv <jan.h.d@swipnet.se>
5400
51bb811f 5401 * xsettings.c: Include glib-object.h, gio/gio.h if HAVE_GSETTINGS.
9851bfc5
JD
5402 Let HAVE_GSETTINGS override HAVE_GCONF.
5403 (store_monospaced_changed): New function.
5404 (EMACS_SETTINGS): A new type derived from GObject to handle
5405 GSettings notifications.
5406 (emacs_settings_constructor, emacs_settings_get_property)
5407 (emacs_settings_set_property, emacs_settings_class_init):
5408 New functions.
5409 (gsettings_client, gsettings_obj): New variables.
5410 (GSETTINGS_SCHEMA): New define.
5411 (something_changedCB): Call store_monospaced_changed.
5412 (init_gsettings): New function.
5413 (xsettings_initialize): Call init_gsettings.
5414 (syms_of_xsettings): Initialize gsettings_client, gsettings_obj
5415 to NULL.
5416
640c8776 5417 * Makefile.in (SETTINGS_CFLAGS, SETTINGS_LIBS): Rename from
9851bfc5
JD
5418 GCONF_CFLAGS/LIBS.
5419
5386012d
MR
54202011-06-29 Martin Rudalics <rudalics@gmx.at>
5421
5422 * window.c (resize_root_window, grow_mini_window)
5423 (shrink_mini_window): Rename Qresize_root_window to
5424 Qwindow_resize_root_window and Qresize_root_window_vertically to
5425 Qwindow_resize_root_window_vertically.
5426
f13e0b08
PE
54272011-06-28 Paul Eggert <eggert@cs.ucla.edu>
5428
5429 * gnutls.c (Qgnutls_bootprop_verify_error): Remove unused var.
5430
94515237
JB
54312011-06-27 Juanma Barranquero <lekktu@gmail.com>
5432
5433 * makefile.w32-in: Redesign dependencies so they reflect more
5434 clearly which files are directly included by each source file,
5435 and not through other includes.
5436
e43b6e43
MR
54372011-06-27 Martin Rudalics <rudalics@gmx.at>
5438
5439 * buffer.c (Qclone_number): Declare static and DEFSYM it.
5440 (sort_overlays, overlay_strings): When an overlay's clone number
5441 matches the window's clone number process the overlay even if
5442 the overlay's window property doesn't match the current window.
5443
d68443dc
MR
5444 * window.c (Fwindow_vchild): Rename to Fwindow_top_child.
5445 (Fwindow_hchild): Rename to Fwindow_left_child.
5446 (Fwindow_next): Rename to Fwindow_next_sibling.
5447 (Fwindow_prev): Rename to Fwindow_prev_sibling.
d615d6d2
MR
5448 (resize_window_check): Rename to window_resize_check.
5449 (resize_window_apply): Rename to window_resize_apply.
5450 (Fresize_window_apply): Rename to Fwindow_resize_apply.
5451 (Fdelete_other_windows_internal, resize_frame_windows)
5452 (Fsplit_window_internal, Fdelete_window_internal)
5453 (grow_mini_window, shrink_mini_window)
5454 (Fresize_mini_window_internal): Fix callers accordingly.
d68443dc 5455
c7e73be5
JD
54562011-06-26 Jan Djärv <jan.h.d@swipnet.se>
5457
5458 * emacsgtkfixed.h: State that this is only used with Gtk+3.
5459 (emacs_fixed_set_min_size): Remove.
5460 (emacs_fixed_new): Take frame as argument.
5461
5462 * emacsgtkfixed.c: State that this is only used with Gtk+3.
5463 (_EmacsFixedPrivate): Remove minwidth/height.
5464 Add struct frame *f.
5465 (emacs_fixed_init): Initialize priv->f.
5466 (get_parent_class, emacs_fixed_set_min_size): Remove.
5467 (emacs_fixed_new): Set priv->f to argument.
5468 (emacs_fixed_get_preferred_width)
5469 (emacs_fixed_get_preferred_height): Use min_width/height from
5470 frames size_hint to set minimum and natural (Bug#8919).
5471 (XSetWMSizeHints, XSetWMNormalHints): Override these functions
5472 and use min_width/height from frames size_hint to set
5473 min_width/height (Bug#8919).
5474
5475 * gtkutil.c (xg_create_frame_widgets): Pass f to emacs_fixed_new.
9173deec
JB
5476 (x_wm_set_size_hint): Remove call to emacs_fixed_set_min_size.
5477 Fix indentation.
c7e73be5 5478
cf99dcf8
EZ
54792011-06-26 Eli Zaretskii <eliz@gnu.org>
5480
5481 * bidi.c (bidi_paragraph_init): Test for ZV_BYTE before calling
5482 bidi_at_paragraph_end, since fast_looking_at doesn't like to be
5483 called at ZV.
5484
029529ac
CY
54852011-06-26 Chong Yidong <cyd@stupidchicken.com>
5486
5487 * process.c (wait_reading_process_output): Bypass select if
5488 waiting for a cell while ignoring keyboard input, and input is
5489 pending. Suggested by Jan Djärv (Bug#8869).
5490
7a7ef429
PE
54912011-06-25 Paul Eggert <eggert@cs.ucla.edu>
5492
5493 Use gnulib's dup2 module instead of rolling our own.
5494 * sysdep.c (dup2) [!HAVE_DUP2]: Remove; gnulib now does this.
5495
11fdef7d 54962011-06-25 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
989b42d2
YM
5497
5498 * dispnew.c (scrolling_window): Before scrolling, turn off a
5499 mouse-highlight in the window being scrolled.
5500
cd3520a4
JB
55012011-06-24 Juanma Barranquero <lekktu@gmail.com>
5502
5503 Move DEFSYM to lisp.h and use everywhere.
5504
5505 * character.h (DEFSYM): Move declaration...
5506 * lisp.h (DEFSYM): ...here.
5507
5508 * gnutls.c:
5509 * minibuf.c:
5510 * w32menu.c:
5511 * w32proc.c:
5512 * w32select.c: Don't include character.h.
5513
5514 * alloc.c (syms_of_alloc):
5515 * buffer.c (syms_of_buffer):
5516 * bytecode.c (syms_of_bytecode):
5517 * callint.c (syms_of_callint):
5518 * casefiddle.c (syms_of_casefiddle):
5519 * casetab.c (init_casetab_once):
5520 * category.c (init_category_once, syms_of_category):
5521 * ccl.c (syms_of_ccl):
5522 * cmds.c (syms_of_cmds):
5523 * composite.c (syms_of_composite):
5524 * dbusbind.c (syms_of_dbusbind):
5525 * dired.c (syms_of_dired):
5526 * dispnew.c (syms_of_display):
5527 * doc.c (syms_of_doc):
5528 * editfns.c (syms_of_editfns):
5529 * emacs.c (syms_of_emacs):
5530 * eval.c (syms_of_eval):
5531 * fileio.c (syms_of_fileio):
5532 * fns.c (syms_of_fns):
5533 * frame.c (syms_of_frame):
5534 * fringe.c (syms_of_fringe):
5535 * insdel.c (syms_of_insdel):
5536 * keymap.c (syms_of_keymap):
5537 * lread.c (init_obarray, syms_of_lread):
5538 * macros.c (syms_of_macros):
5539 * msdos.c (syms_of_msdos):
5540 * print.c (syms_of_print):
5541 * process.c (syms_of_process):
5542 * search.c (syms_of_search):
5543 * sound.c (syms_of_sound):
5544 * syntax.c (init_syntax_once, syms_of_syntax):
5545 * terminal.c (syms_of_terminal):
5546 * textprop.c (syms_of_textprop):
5547 * undo.c (syms_of_undo):
5548 * w32.c (globals_of_w32):
5549 * window.c (syms_of_window):
5550 * xdisp.c (syms_of_xdisp):
5551 * xfaces.c (syms_of_xfaces):
5552 * xfns.c (syms_of_xfns):
5553 * xmenu.c (syms_of_xmenu):
5554 * xsettings.c (syms_of_xsettings):
5555 * xterm.c (syms_of_xterm): Use DEFSYM.
5556
4228cf16
TZ
55572011-06-24 Teodor Zlatanov <tzz@lifelogs.com>
5558
cd3520a4 5559 * gnutls.c (syms_of_gnutls): Use the DEFSYM macro from character.h.
4228cf16 5560
7fcccf1e
PE
55612011-06-23 Paul Eggert <eggert@cs.ucla.edu>
5562
7efb4e0e
PE
5563 Integer and buffer overflow fixes (Bug#8873).
5564
ff5844ad
PE
5565 * print.c (printchar, strout): Check for string overflow.
5566 (PRINTPREPARE, printchar, strout):
5567 Don't set size unless allocation succeeds.
5568
90532f02
PE
5569 * minibuf.c (read_minibuf_noninteractive): Use ptrdiff_t, not int,
5570 for sizes. Check for string overflow more accurately.
5571 Simplify newline removal at end; this suppresses a GCC 4.6.0 warning.
5572
6d84508d
PE
5573 * macros.c: Integer and buffer overflow fixes.
5574 * keyboard.h (struct keyboard.kbd_macro_bufsize):
5575 * macros.c (Fstart_kbd_macro, store_kbd_macro_char):
5576 Use ptrdiff_t, not int, for sizes.
5577 Don't increment bufsize until after realloc succeeds.
5578 Check for size-calculation overflow.
5579 (Fstart_kbd_macro): Use EMACS_INT, not int, for XINT result.
5580
437b2cb4
PE
5581 * lisp.h (DEFVAR_KBOARD): Use offsetof instead of char * finagling.
5582
8b9ac8b4
PE
5583 * lread.c: Integer overflow fixes.
5584 (read_integer): Radix is now EMACS_INT, not int,
5585 to improve quality of diagnostics for out-of-range radices.
5586 Calculate buffer size correctly for out-of-range radices.
5587 (read1): Check for integer overflow in radices, and in
5588 read-circle numbers.
82cb60d3
PE
5589 (read_escape): Avoid int overflow.
5590 (Fload, openp, read_buffer_size, read1)
5591 (substitute_object_recurse, read_vector, read_list, map_obarray):
5592 Use ptrdiff_t, not int, for sizes.
5593 (read1): Use EMACS_INT, not int, for sizes.
20270765 5594 Check for size overflow.
8b9ac8b4 5595
7fcccf1e
PE
5596 * image.c (cache_image): Check for size arithmetic overflow.
5597
bfbbd7e7
PE
5598 * lread.c: Integer overflow issues.
5599 (saved_doc_string_size, saved_doc_string_length)
5600 (prev_saved_doc_string_size, prev_saved_doc_string_length):
5601 Now ptrdiff_t, not int.
5602 (read1): Don't assume doc string length fits in int. Check for
5603 out-of-range doc string lengths.
5604 (read_list): Don't assume file position fits in int.
39019e54 5605 (read_escape): Check for hex character overflow.
bfbbd7e7 5606
4e323265
LL
56072011-06-22 Leo Liu <sdl.web@gmail.com>
5608
5609 * minibuf.c (Fcompleting_read_default, Vcompleting_read_function):
5610 Move to minibuffer.el.
5611
85fece3e
PE
56122011-06-22 Paul Eggert <eggert@cs.ucla.edu>
5613
20b84ce9 5614 Fixes for GLYPH_DEBUG found by GCC 4.6.0 static checking.
85fece3e
PE
5615 The following patches are for when GLYPH_DEBUG && !XASSERT.
5616 * dispextern.h (trace_redisplay_p, dump_glyph_string):
5617 * dispnew.c (flush_stdout):
5618 * xdisp.c (dump_glyph_row, dump_glyph_matrix, dump_glyph):
5619 Mark as externally visible.
5620 * dispnew.c (check_window_matrix_pointers): Now static.
5621 * dispnew.c (window_to_frame_vpos):
5622 * xfns.c (unwind_create_frame):
5623 * xterm.c (x_check_font): Remove unused local.
5624 * scroll.c (CHECK_BOUNDS):
5625 * xfaces.c (cache_fache): Rename local to avoid shadowing.
5626 * xfns.c, w32fns.c (image_cache_refcount, dpyinfo_refcount): Now static.
5627 * xdisp.c (check_window_end): Now a no-op if !XASSERTS.
5628 (debug_first_unchanged_at_end_vpos, debug_last_unchanged_at_beg_vpos)
5629 (debug_dvpos, debug_dy, debug_delta, debug_delta_bytes, debug_end_vpos):
5630 Now static.
5631 (debug_method_add): Use va_list and vsprintf rather than relying
5632 on undefined behavior with wrong number of arguments.
5633 (dump_glyph, dump_glyph_row, Fdump_glyph_matrix):
5634 Don't assume ptrdiff_t and EMACS_INT are the same width as int.
5635 In this code, it's OK to assume C99 behavior for ptrdiff_t formats
5636 since we're not interested in debugging glyphs with old libraries.
5637 * xfaces.c (cache_face): Move debugging code earlier; this pacifies
5638 GCC 4.6.0's static checking.
5639
0766b489
PE
56402011-06-22 Paul Eggert <eggert@cs.ucla.edu>
5641
31fd4b32
PE
5642 Integer overflow and signedness fixes (Bug#8873).
5643 A few related buffer overrun fixes, too.
5644
b79e8648
PE
5645 * font.c (font_score): Use EMACS_INT, not int, to store XINT value.
5646
0766b489
PE
5647 * dispextern.h (struct face.stipple):
5648 * image.c (x_bitmap_height, x_bitmap_width, x_bitmap_pixmap)
5649 (x_bitmap_mask, x_allocate_bitmap_record)
5650 (x_create_bitmap_from_data, x_create_bitmap_from_file)
5651 (x_destroy_bitmap, x_destroy_all_bitmaps, x_create_bitmap_mask)
5652 (x_create_bitmap_from_xpm_data):
5653 * nsterm.h (struct ns_display_info.bitmaps_size, .bitmaps_last):
5654 * w32term.h (struct w32_display_info.icon_bitmap_id, .bitmaps_size)
5655 (.bitmaps_last):
5656 * xfaces.c (load_pixmap):
5657 * xterm.c (x_bitmap_icon, x_wm_set_icon_pixmap):
5658 * xterm.h (struct x_display_info.icon_bitmap_id, .bitmaps_size)
5659 (.bitmaps_last, struct x_output.icon_bitmap):
5660 Use ptrdiff_t, not int, for bitmap indexes.
5661 (x_allocate_bitmap_record): Check for size overflow.
5662 * dispextern.h, lisp.h: Adjust to API changes elsewhere.
5663
b081724f
PE
5664 Use ptrdiff_t, not int, for overlay counts.
5665 * buffer.h (overlays_at, sort_overlays, GET_OVERLAYS_AT):
5666 * editfns.c (overlays_around, get_pos_property):
5667 * textprop.c (get_char_property_and_overlay):
5668 * xdisp.c (next_overlay_change, note_mouse_highlight):
5669 * xfaces.c (face_at_buffer_position):
21514da7
PE
5670 * buffer.c (OVERLAY_COUNT_MAX): New macro.
5671 (overlays_at, overlays_in, sort_overlays, Foverlays_at)
5672 (Fnext_overlay_change, Fprevious_overlay_change)
5673 (mouse_face_overlay_overlaps, Foverlays_in):
b081724f 5674 Use ptrdiff_t, not int, for sizes.
21514da7 5675 (overlays_at, overlays_in): Check for size-calculation overflow.
b081724f 5676
3de73e5e
PE
5677 * xterm.c (xim_initialize, same_x_server): Strlen may not fit in int.
5678
2606c57b
PE
5679 * xsmfns.c (smc_save_yourself_CB, x_session_initialize): Avoid strlen.
5680 (x_session_initialize): Do not assume string length fits in int.
5681
aaafe47a
PE
5682 * xsettings.c (apply_xft_settings): Fix potential buffer overrun.
5683 This is unlikely, but can occur if DPI is outlandish.
5684
2674ddc8 5685 * xsettings.c (Ffont_get_system_normal_font, Ffont_get_system_font):
3a5077c5
PE
5686 * xselect.c (Fx_get_atom_name): Avoid need for strlen.
5687
28154962
PE
5688 * xrdb.c: Don't assume strlen fits in int; avoid some strlens.
5689 * xrdb.c (magic_file_p, search_magic_path):
5690 Omit last arg SUFFIX; it was always 0. All callers changed.
5691 (magic_file_p): Use ptrdiff_t, not int. Check for size overflow.
5692
7de51af5
PE
5693 * xfont.c (xfont_match): Avoid need for strlen.
5694
25ed6cc3
PE
5695 * xfns.c: Don't assume strlen fits in int.
5696 (xic_create_fontsetname, x_window): Use ptrdiff_t, not int.
5697
4eab31dd
PE
5698 * xdisp.c (message_log_check_duplicate): Return intmax_t,
5699 not unsigned long, as we prefer signed integers. All callers changed.
5700 Detect integer overflow in repeat count.
5701 (message_dolog): Don't assume print length fits in 39 bytes.
df1f27af 5702 (display_mode_element): Don't assume strlen fits in int.
4eab31dd 5703
171e2a58
PE
5704 * termcap.c: Don't assume sizes fit in int and never overflow.
5705 (struct termcap_buffer, tgetent): Use ptrdiff_t, not int, for sizes.
5706 (gobble_line): Check for size-calculation overflow.
5707
ad39faca 5708 * minibuf.c (Fread_buffer):
6e5bb2dc 5709 * lread.c (intern, intern_c_string):
74ca2eb3
PE
5710 * image.c (xpm_scan) [HAVE_NS && !HAVE_XPM]:
5711 Don't assume string length fits in int.
5712
52c61c22 5713 * keyboard.c (parse_tool_bar_item):
9bda3520
PE
5714 * gtkutil.c (style_changed_cb): Avoid need for strlen.
5715
b5b8c9e5
PE
5716 * font.c: Don't assume string length fits in int.
5717 (font_parse_xlfd, font_parse_fcname, font_unparse_fcname):
5718 Use ptrdiff_t, not int.
ccd6111c
PE
5719 (font_intern_prop): Don't assume string length fits in int.
5720 Don't assume integer property fits in fixnum.
5721 * font.h (font_intern_prop): 2nd arg is now ptrdiff_t, not int.
b5b8c9e5 5722
882f0d81 5723 * filelock.c: Fix some buffer overrun and integer overflow issues.
51cab52b 5724 (get_boot_time): Don't assume gzip command string fits in 100 bytes.
882f0d81
PE
5725 Reformulate so as not to need the command string.
5726 Invoke gzip -cd rather than gunzip, as it's more portable.
5727 (lock_info_type, lock_file_1, lock_file):
5728 Don't assume pid_t and time_t fit in unsigned long.
5729 (LOCK_PID_MAX): Remove; we now use more-reliable bounds.
5730 (current_lock_owner): Prefer signed type for sizes.
5731 Use memcpy, not strncpy, where memcpy is what is really wanted.
5732 Don't assume (via atoi) that time_t and pid_t fit in int.
5733 Check for time_t and/or pid_t out of range, e.g., via a network share.
5734 Don't alloca where an auto var works fine.
5735
93f4cf88
PE
5736 * fileio.c: Fix some integer overflow issues.
5737 (file_name_as_directory, Fexpand_file_name, Fsubstitute_in_file_name):
5738 Don't assume string length fits in int.
5739 (directory_file_name): Don't assume string length fits in long.
5740 (make_temp_name): Don't assume pid fits in int, or that its print
5741 length is less than 20.
5742
f3e92b69
PE
5743 * data.c (Fsubr_name): Rewrite to avoid a strlen call.
5744
1bfdaf10
PE
5745 * coding.c (make_subsidiaries): Don't assume string length fits in int.
5746
35016e9a
PE
5747 * callproc.c (child_setup): Rewrite to avoid two strlen calls.
5748
3d1e65a1
PE
5749 * process.c (Fformat_network_address): Use EMACS_INT, not EMACS_UINT.
5750 We prefer signed integers, even for size calculations.
5751
0b963a93
PE
5752 * emacs.c: Don't assume string length fits in 'int'.
5753 (DEFINE_DUMMY_FUNCTION, sort_args): Use ptrdiff_t, not int.
5754 (main): Don't invoke strlen when not needed.
5755
573f4b54
PE
5756 * dbusbind.c (XD_ERROR): Don't arbitrarily truncate string.
5757 (XD_DEBUG_MESSAGE): Don't waste a byte.
5758
989f33ba
PE
5759 * callproc.c (getenv_internal_1, getenv_internal)
5760 (Fgetenv_internal):
965d34eb
PE
5761 * buffer.c (init_buffer): Don't assume string length fits in 'int'.
5762
e4d29b33
PE
5763 * lread.c (invalid_syntax): Omit length argument.
5764 All uses changed. This doesn't fix a bug, but it simplifies the
5765 code away from its former Hollerith-constant appearance, and it's
5766 one less 'int' to worry about when looking at integer-overflow issues.
51cab52b 5767 (string_to_number): Simplify 2011-04-26 change by invoking xsignal1.
e4d29b33 5768
eb49b136
PE
5769 * lisp.h (DEFUN): Remove bogus use of sizeof (struct Lisp_Subr).
5770 This didn't break anything, but it didn't help either.
5771 It's confusing to put a bogus integer in a place where the actual
5772 value does not matter.
9f62aeb1 5773 (LIST_END_P): Remove unused macro and its bogus comment.
cbeff735 5774 (make_fixnum_or_float): Remove unnecessary cast to EMACS_INT.
eb49b136 5775
15375a22
PE
5776 * lisp.h (union Lisp_Object.i): EMACS_INT, not EMACS_UINT.
5777 This is for consistency with the ordinary, non-USE_LISP_UNION_TYPE,
5778 implementation.
b61cc01c
PE
5779 (struct Lisp_Bool_Vector.size): EMACS_INT, not EMACS_UINT.
5780 We prefer signed types, and the value cannot exceed the EMACS_INT
5781 range anyway (because otherwise the length would not be representable).
9a8e8d9b
PE
5782 (XSET) [USE_LISP_UNION_TYPE]: Use uintptr_t and intptr_t,
5783 not EMACS_UINT and EMACS_INT, when converting pointer to integer.
5784 This avoids a GCC warning when WIDE_EMACS_INT.
15375a22 5785
53b2623d
PE
5786 * indent.c (sane_tab_width): New function.
5787 (current_column, scan_for_column, Findent_to, position_indentation)
5788 (compute_motion): Use it. This is just for clarity.
8fcaf9cc 5789 (Fcompute_motion): Don't assume hscroll and tab offset fit in int.
53b2623d 5790
51cab52b 5791 * image.c (xbm_image_p): Don't assume stated width, height fit in int.
45aebb64 5792
f2ed8a70
PE
5793 * lisp.h (lint_assume): New macro.
5794 * composite.c (composition_gstring_put_cache):
5795 * ftfont.c (ftfont_shape_by_flt): Use it to pacify GCC 4.6.0.
5796
abe80cc6
PE
5797 * editfns.c, insdel.c:
5798 Omit unnecessary forward decls, to simplify future changes.
a9e860e1 5799
b02c740e
PE
5800 * ftfont.c (ftfont_shape_by_flt): Use signed integers for lengths.
5801
ebc96716
PE
5802 * font.c (Ffont_shape_gstring): Don't assume glyph len fits in 'int'.
5803
b4e50fa0 5804 * fns.c (Ffillarray): Don't assume bool vector size fits in 'int'.
f03dc6ef 5805 Use much-faster test for byte-length change.
311d5d7c 5806 Don't assume string byte-length fits in 'int'.
a4cf38e4 5807 Check that character arg fits in 'int'.
85461888 5808 (mapcar1): Declare byte as byte, for clarity.
b4e50fa0 5809
c0c1ee9f
PE
5810 * alloc.c (Fmake_bool_vector): Avoid unnecessary multiplication.
5811
a498d7f4
PE
5812 * fns.c (concat): Catch string overflow earlier.
5813 Do not rely on integer wraparound.
5814
51cab52b
PE
5815 * dispextern.h (struct it.overlay_strings_charpos)
5816 (struct it.selective): Now EMACS_INT, not int.
87830974
PE
5817 * xdisp.c (forward_to_next_line_start)
5818 (back_to_previous_visible_line_start)
5819 (reseat_at_next_visible_line_start, next_element_from_buffer):
5820 Don't arbitrarily truncate the value of 'selective' to int.
5821
76031fad
PE
5822 * xdisp.c (init_iterator): Use XINT, not XFASTINT; it might be < 0.
5823
5eb55db9
PE
5824 * composite.c: Don't truncate sizes to 'int'.
5825 (composition_gstring_p, composition_reseat_it)
5826 (composition_adjust_point): Use EMACS_INT, not int.
7d100a81
PE
5827 (get_composition_id, composition_gstring_put_cache): Use EMACS_INT,
5828 not EMACS_UINT, for indexes.
5eb55db9 5829
0703a717
PE
5830 * category.h (CATEGORY_SET_P): Remove unnecessary cast to EMACS_INT.
5831
d6202519
PE
5832 * buffer.c: Include <verify.h>.
5833 (struct sortvec.priority, struct sortstr.priority):
8961a454 5834 Now EMACS_INT, not int.
c20998a7 5835 (compare_overlays, cmp_for_strings): Avoid subtraction overflow.
67c36fce
PE
5836 (struct sortstr.size, record_overlay_string)
5837 (struct sortstrlist.size, struct sortlist.used):
5838 Don't truncate size to int.
5839 (record_overlay_string): Check for size-calculation overflow.
d6202519 5840 (init_buffer_once): Check at compile-time, not run-time.
fadf4e30 5841
d5a19415
JM
58422011-06-22 Jim Meyering <meyering@redhat.com>
5843
029529ac 5844 Don't leak an XBM-image-sized buffer
d5a19415
JM
5845 * image.c (xbm_load): Free the image buffer after using it.
5846
a9041e6c
PE
58472011-06-21 Paul Eggert <eggert@cs.ucla.edu>
5848
5849 Port to Sun C.
5850 * composite.c (find_automatic_composition): Omit needless 'return 0;'
5851 that Sun C diagnosed.
5852 * fns.c (secure_hash): Fix pointer signedness issue.
5853 * intervals.c (static_offset_intervals): New function.
5854 (offset_intervals): Use it.
5855
7f3f739f
LL
58562011-06-21 Leo Liu <sdl.web@gmail.com>
5857
5858 * deps.mk (fns.o):
5859 * makefile.w32-in ($(BLD)/fns.$(O)): Include sha256.h and
5860 sha512.h.
5861
5862 * fns.c (secure_hash): Rename from crypto_hash_function and change
5863 the first arg to accept symbols.
5b66d427 5864 (Fsecure_hash): New primitive.
7f3f739f
LL
5865 (syms_of_fns): New symbols.
5866
76147d94
DD
58672011-06-20 Deniz Dogan <deniz@dogan.se>
5868
5869 * process.c (Fset_process_buffer): Clarify return value in
5870 docstring.
5871
7d7d0045
CY
58722011-06-18 Chong Yidong <cyd@stupidchicken.com>
5873
5874 * dispnew.c (add_window_display_history): Use BVAR.
5875
5876 * xdisp.c (debug_method_add): Use BVAR.
5877 (check_window_end, dump_glyph_matrix, dump_glyph)
5878 (dump_glyph_row, dump_glyph_string): Convert arglist to ANSI C.
5879
5880 * xfaces.c (check_lface_attrs, check_lface, dump_realized_face):
5881 Likewise.
5882
5883 * xfns.c (Fx_create_frame, x_create_tip_frame): Delay image cache
5884 check till after the cache is created in init_frame_faces.
5885
ff2bc410
SM
58862011-06-17 Stefan Monnier <monnier@iro.umontreal.ca>
5887
5888 * fns.c (Fsafe_length): Yet another int/Lisp_Object mixup.
5889
28177add
PE
58902011-06-16 Paul Eggert <eggert@cs.ucla.edu>
5891
dd3482fe
PE
5892 * lisp.h: Include <limits.h>, for INT_MAX, LONG_MAX, LLONG_MAX.
5893 Without this, prin1 mishandles Lisp_Misc_Save_Value printing on
5894 hosts with pre-C99 libraries, because pD is wrongly defined to "t".
5895
393d71f3 5896 Improve buffer-overflow checking (Bug#8873).
1c8e352f
PE
5897 * fileio.c (Finsert_file_contents):
5898 * insdel.c (insert_from_buffer_1, replace_range, replace_range_2):
5899 Remove the old (too-loose) buffer overflow checks.
5900 They weren't needed, since make_gap checks for buffer overflow.
5901 * insdel.c (make_gap_larger): Catch buffer overflows that were missed.
5902 The old code merely checked for Emacs fixnum overflow, and relied
5903 on undefined (wraparound) behavior. The new code avoids undefined
5904 behavior, and also checks for ptrdiff_t and/or size_t overflow.
5905
2e6813b0 5906 * editfns.c (Finsert_char): Don't dump core with very negative counts.
21d890a4
PE
5907 Tune. Don't use wider integers than needed. Don't use alloca.
5908 Use a bigger 'string' buffer. Rewrite to avoid 'n > 0' test.
2e6813b0 5909
599a9e4f
PE
5910 * insdel.c (replace_range): Fix buf overflow when insbytes < outgoing.
5911
99561444
PE
5912 * insdel.c, lisp.h (buffer_overflow): New function.
5913 (insert_from_buffer_1, replace_range, replace_range_2):
5914 * insdel.c (make_gap_larger):
5915 * editfns.c (Finsert_char):
5916 * fileio.c (Finsert_file_contents): Use it, to normalize wording.
5917
28177add
PE
5918 * buffer.h (BUF_BYTES_MAX): Cast to ptrdiff_t so that it's signed.
5919
e69dafad
PE
59202011-06-15 Paul Eggert <eggert@cs.ucla.edu>
5921
4baa020d 5922 Integer overflow and signedness fixes (Bug#8873, Bug#8828).
ff672d2c 5923
b1c46f02
PE
5924 * ccl.c (ASCENDING_ORDER): New macro, to work around GCC bug 43772.
5925 (GET_CCL_RANGE, IN_INT_RANGE): Use it.
5926
e69dafad
PE
5927 * fileio.c: Don't assume EMACS_INT fits in off_t.
5928 (emacs_lseek): New static function.
5929 (Finsert_file_contents, Fwrite_region): Use it.
5930 Use SEEK_SET, SEEK_CUR, SEEK_END as appropriate.
5931
566684ea
PE
5932 * fns.c (Fload_average): Don't assume 100 * load average fits in int.
5933
e6966cd6
PE
5934 * fns.c: Don't overflow int when computing a list length.
5935 * fns.c (QUIT_COUNT_HEURISTIC): New constant.
5936 (Flength, Fsafe_length): Use EMACS_INT, not int, to avoid unwanted
5937 truncation on 64-bit hosts. Check for QUIT every
5938 QUIT_COUNT_HEURISTIC entries rather than every other entry; that's
5939 faster and is responsive enough.
5940 (Flength): Report an error instead of overflowing an integer.
5941 (Fsafe_length): Return a float if the value is not representable
5942 as a fixnum. This shouldn't happen except in contrived situations.
6346d301 5943 (Fnthcdr, Fsort): Don't assume list length fits in int.
de41a810 5944 (Fcopy_sequence): Don't assume vector length fits in int.
00c604f2 5945
dd0b0efb
PE
5946 * alloc.c: Check that resized vectors' lengths fit in fixnums.
5947 (header_size, word_size): New constants.
5948 (allocate_vectorlike): Don't check size overflow here.
5949 (allocate_vector): Check it here instead, since this is the only
5950 caller of allocate_vectorlike that could cause overflow.
5951 Check that the new vector's length is representable as a fixnum.
5952
86fe5cfe
PE
5953 * fns.c (next_almost_prime): Don't return a multiple of 3 or 5.
5954 The previous code was bogus. For example, next_almost_prime (32)
5955 returned 39, which is undesirable as it is a multiple of 3; and
5956 next_almost_prime (24) returned 25, which is a multiple of 5 so
5957 why was the code bothering to check for multiples of 7?
5958
80e88859
PE
5959 * bytecode.c (exec_byte_code): Use ptrdiff_t, not int, for vector length.
5960
4a2f0ad6
PE
5961 * eval.c, doprnt.c (SIZE_MAX): Remove; inttypes.h defines this now.
5962
f66c7cf8
PE
5963 Variadic C functions now count arguments with ptrdiff_t.
5964 This partly undoes my 2011-03-30 change, which replaced int with size_t.
5965 Back then I didn't know that the Emacs coding style prefers signed int.
5966 Also, in the meantime I found a few more instances where arguments
4a2f0ad6
PE
5967 were being counted with int, which may truncate counts on 64-bit
5968 machines, or EMACS_INT, which may be unnecessarily wide.
f66c7cf8
PE
5969 * lisp.h (struct Lisp_Subr.function.aMANY)
5970 (DEFUN_ARGS_MANY, internal_condition_case_n, safe_call):
5971 Arg counts are now ptrdiff_t, not size_t.
5972 All variadic functions and their callers changed accordingly.
5973 (struct gcpro.nvars): Now size_t, not size_t. All uses changed.
5974 * bytecode.c (exec_byte_code): Check maxdepth for overflow,
5975 to avoid potential buffer overrun. Don't assume arg counts fit in 'int'.
5976 * callint.c (Fcall_interactively): Check arg count for overflow,
5977 to avoid potential buffer overrun. Use signed char, not 'int',
5978 for 'varies' array, so that we needn't bother to check its size
5979 calculation for overflow.
5980 * editfns.c (Fformat): Use ptrdiff_t, not EMACS_INT, to count args.
5981 * eval.c (apply_lambda):
5982 * fns.c (Fmapconcat): Use XFASTINT, not XINT, to get args length.
5983 (struct textprop_rec.argnum): Now ptrdiff_t, not int. All uses changed.
5984 (mapconcat): Use ptrdiff_t, not int and EMACS_INT, to count args.
5985
a1759b76
PE
5986 * callint.c (Fcall_interactively): Don't use index var as event count.
5987
d96be9fc
PE
5988 * vm-limit.c (check_memory_limits): Fix incorrect extern function decls.
5989 * mem-limits.h (SIZE): Remove; no longer used.
5990
a690a978 5991 * xterm.c (x_alloc_nearest_color_1): Prefer int to long when int works.
5efd304b 5992
578c21e6
PE
5993 Remove unnecessary casts.
5994 * xterm.c (x_term_init):
5995 * xfns.c (x_set_border_pixel):
5996 * widget.c (create_frame_gcs): Remove casts to unsigned long etc.
5997 These aren't needed now that we assume ANSI C.
5998
96f53c6c
PE
5999 * sound.c (Fplay_sound_internal): Remove cast to unsigned long.
6000 It's more likely to cause problems (due to unsigned overflow)
6001 than to cure them.
6002
83c77d31
PE
6003 * dired.c (Ffile_attributes): Don't use 32-bit hack on 64-bit hosts.
6004
ee2079f1
PE
6005 * unexelf.c (unexec): Don't assume BSS addr fits in unsigned.
6006
6da65536
PE
6007 * xterm.c (handle_one_xevent): Omit unnecessary casts to unsigned.
6008
7147c4a4
PE
6009 * keyboard.c (modify_event_symbol): Don't limit alist len to UINT_MAX.
6010
193e32d9
PE
6011 * lisp.h (CHAR_TABLE_SET): Omit now-redundant test.
6012
e5533da6
PE
6013 * lread.c (Fload): Don't compare a possibly-garbage time_t value.
6014
9910e595
PE
6015 GLYPH_CODE_FACE returns EMACS_INT, not int.
6016 * dispextern.h (merge_faces):
6017 * xfaces.c (merge_faces):
01103c44
PE
6018 * xdisp.c (get_next_display_element, next_element_from_display_vector):
6019 Don't assume EMACS_INT fits in int.
9910e595 6020
2638320e
PE
6021 * character.h (CHAR_VALID_P): Remove unused parameter.
6022 * fontset.c, lisp.h, xdisp.c: All uses changed.
6023
045eb8d9
PE
6024 * editfns.c (Ftranslate_region_internal): Omit redundant test.
6025
c1f134b5
PE
6026 * fns.c (concat): Minor tuning based on overflow analysis.
6027 This doesn't fix any bugs. Use int to hold character, instead
6028 of constantly refetching from Emacs object. Use XFASTINT, not
6029 XINT, for value known to be a character. Don't bother comparing
6030 a single byte to 0400, as it's always less.
6031
395fcb93 6032 * floatfns.c (Fexpt):
327eeec8
PE
6033 * fileio.c (make_temp_name): Omit unnecessary cast to unsigned.
6034
abbd3d23
PE
6035 * editfns.c (Ftranslate_region_internal): Use int, not EMACS_INT
6036 for characters.
6037
684a03ef
PE
6038 * doc.c (get_doc_string): Omit (unsigned)c that mishandled negatives.
6039
0fed43f3
PE
6040 * data.c (Faset): If ARRAY is a string, check that NEWELT is a char.
6041 Without this fix, on a 64-bit host (aset S 0 4294967386) would
6042 incorrectly succeed when S was a string, because 4294967386 was
6043 truncated before it was used.
6044
8fd02eb7
PE
6045 * chartab.c (Fchar_table_range): Use CHARACTERP to check range.
6046 Otherwise, an out-of-range integer could cause undefined behavior
6047 on a 64-bit host.
6048
f8c86b69
PE
6049 * composite.c: Use int, not EMACS_INT, for characters.
6050 (fill_gstring_body, composition_compute_stop_pos): Use int, not
6051 EMACS_INT, for values that are known to be in character range.
6052 This doesn't fix any bugs but is the usual style inside Emacs and
6053 may generate better code on 32-bit machines.
6054
34206dd2
PE
6055 Make sure a 64-bit char is never passed to ENCODE_CHAR.
6056 This is for reasons similar to the recent CHAR_STRING fix.
6057 * charset.c (Fencode_char): Check that character arg is actually
6058 a character. Pass an int to ENCODE_CHAR.
6059 * charset.h (ENCODE_CHAR): Verify that the character argument is no
6060 wider than 'int', as a compile-time check to prevent future regressions
6061 in this area.
6062
c5958d4c 6063 * character.c (char_string): Remove unnecessary casts.
13bdea59
PE
6064
6065 Make sure a 64-bit char is never passed to CHAR_STRING.
6066 Otherwise, CHAR_STRING would do the wrong thing on a 64-bit platform,
6067 by silently ignoring the top 32 bits, allowing some values
6068 that were far too large to be valid characters.
6069 * character.h: Include <verify.h>.
6070 (CHAR_STRING, CHAR_STRING_ADVANCE): Verify that the character
6071 arguments are no wider than unsigned, as a compile-time check
6072 to prevent future regressions in this area.
6073 * data.c (Faset):
01103c44 6074 * editfns.c (Fchar_to_string, general_insert_function, Finsert_char)
13bdea59
PE
6075 (Fsubst_char_in_region):
6076 * fns.c (concat):
6077 * xdisp.c (decode_mode_spec_coding):
6078 Adjust to CHAR_STRING's new requirement.
6079 * editfns.c (Finsert_char, Fsubst_char_in_region):
6080 * fns.c (concat): Check that character args are actually
6081 characters. Without this test, these functions did the wrong
6082 thing with wildly out-of-range values on 64-bit hosts.
6083
d37ca623
PE
6084 Remove incorrect casts to 'unsigned' that lose info on 64-bit hosts.
6085 These casts should not be needed on 32-bit hosts, either.
6086 * keyboard.c (read_char):
6087 * lread.c (Fload): Remove casts to unsigned.
6088
ea204efb
PE
6089 * lisp.h (UNSIGNED_CMP): New macro.
6090 This fixes comparison bugs on 64-bit hosts.
6091 (ASCII_CHAR_P): Use it.
6092 * casefiddle.c (casify_object):
01103c44 6093 * character.h (ASCII_BYTE_P, CHAR_VALID_P)
ea204efb
PE
6094 (SINGLE_BYTE_CHAR_P, CHAR_STRING):
6095 * composite.h (COMPOSITION_ENCODE_RULE_VALID):
6096 * dispextern.h (FACE_FROM_ID):
6097 * keyboard.c (read_char): Use UNSIGNED_CMP.
6098
41cb286c
PE
6099 * xmenu.c (dialog_selection_callback) [!USE_GTK]: Cast to intptr_t,
6100 not to EMACS_INT, to avoid GCC warning.
6101
4a1b9832
PE
6102 * xfns.c (x_set_scroll_bar_default_width): Remove unused 'int' locals.
6103
55daad71
PE
6104 * buffer.h (PTR_BYTE_POS, BUF_PTR_BYTE_POS): Remove harmful cast.
6105 The cast incorrectly truncated 64-bit byte offsets to 32 bits, and
6106 isn't needed on 32-bit machines.
8f95c75c 6107
01103c44
PE
6108 * buffer.c (Fgenerate_new_buffer_name):
6109 Use EMACS_INT for count, not int.
0ceccced 6110 (advance_to_char_boundary): Return EMACS_INT, not int.
e762cafe
PE
6111
6112 * data.c (Qcompiled_function): Now static.
6113
c6f072e7
PE
6114 * window.c (window_body_lines): Now static.
6115
20ce5912
PE
6116 * image.c (gif_load): Rename local to avoid shadowing.
6117
9c4c5f81
PE
6118 * lisp.h (SAFE_ALLOCA_LISP): Check for integer overflow.
6119 (struct Lisp_Save_Value): Use ptrdiff_t, not int, for 'integer' member.
6120 * alloc.c (make_save_value): Integer argument is now of type
6121 ptrdiff_t, not int.
6122 (mark_object): Use ptrdiff_t, not int.
6123 * lisp.h (pD): New macro.
6124 * print.c (print_object): Use it.
6125
c0c5c8ae
PE
6126 * alloc.c: Use EMACS_INT, not int, to count objects.
6127 (total_conses, total_markers, total_symbols, total_vector_size)
6128 (total_free_conses, total_free_markers, total_free_symbols)
01103c44
PE
6129 (total_free_floats, total_floats, total_free_intervals)
6130 (total_intervals, total_strings, total_free_strings):
c0c5c8ae
PE
6131 Now EMACS_INT, not int. All uses changed.
6132 (Fgarbage_collect): Compute overall total using a double, so that
6133 integer overflow is less likely to be a problem. Check for overflow
6134 when converting back to an integer.
5a25e253
PE
6135 (n_interval_blocks, n_string_blocks, n_float_blocks, n_cons_blocks)
6136 (n_vectors, n_symbol_blocks, n_marker_blocks): Remove.
6137 These were 'int' variables that could overflow on 64-bit hosts;
6138 they were never used, so remove them instead of repairing them.
211a0b2a 6139 (nzombies, ngcs, max_live, max_zombies): Now EMACS_INT, not 'int'.
6349ae4d
PE
6140 (inhibit_garbage_collection): Set gc_cons_threshold to max value.
6141 Previously, this ceilinged at INT_MAX, but that doesn't work on
6142 64-bit machines.
e46bb31a 6143 (allocate_pseudovector): Don't use EMACS_INT when int would do.
c0c5c8ae 6144
c78baabf 6145 * alloc.c (Fmake_bool_vector): Don't assume vector size fits in int.
86f61a15 6146 (allocate_vectorlike): Check for ptrdiff_t overflow.
b6439961
PE
6147 (mark_vectorlike, mark_char_table, mark_object): Avoid EMACS_UINT
6148 when a (possibly-narrower) signed value would do just as well.
6149 We prefer using signed arithmetic, to avoid comparison confusion.
c78baabf 6150
c9d624c6
PE
6151 * alloc.c: Catch some string size overflows that we were missing.
6152 (XMALLOC_OVERRUN_CHECK_SIZE) [!XMALLOC_OVERRUN_CHECK]: Define to 0,
6153 for convenience in STRING_BYTES_MAX.
6154 (STRING_BYTES_MAX): New macro, superseding the old one in lisp.h.
6155 The definition here is exact; the one in lisp.h was approximate.
6156 (allocate_string_data): Check for string overflow. This catches
6157 some instances we weren't catching before. Also, it catches
6158 size_t overflow on (unusual) hosts where SIZE_MAX <= min
6159 (PTRDIFF_MAX, MOST_POSITIVE_FIXNUM), e.g., when size_t is 32 bits
6160 and ptrdiff_t and EMACS_INT are both 64 bits.
c78baabf 6161
c9d624c6
PE
6162 * character.c, coding.c, doprnt.c, editfns.c, eval.c:
6163 All uses of STRING_BYTES_MAX replaced by STRING_BYTES_BOUND.
640c8776 6164 * lisp.h (STRING_BYTES_BOUND): Rename from STRING_BYTES_MAX.
c9d624c6 6165
353032ce
PE
6166 * character.c (string_escape_byte8): Fix nbytes/nchars typo.
6167
2bccce07
PE
6168 * alloc.c (Fmake_string): Check for out-of-range init.
6169
0ac30604
SM
61702011-06-15 Stefan Monnier <monnier@iro.umontreal.ca>
6171
6172 * eval.c (Fdefvaralias): Also mark the target as variable-special-p.
6173
c195f2de
JD
61742011-06-14 Jan Djärv <jan.h.d@swipnet.se>
6175
6176 * xfns.c (x_set_scroll_bar_default_width): Remove argument to
6177 xg_get_default_scrollbar_width.
6178
6179 * gtkutil.c: Include emacsgtkfixed.h if HAVE_GTK3.
6180 (int_gtk_range_get_value): Move to the scroll bar part of the file.
6181 (style_changed_cb): Call update_theme_scrollbar_width and call
6182 x_set_scroll_bar_default_width and xg_frame_set_char_size for
6183 all frames (Bug#8505).
6184 (xg_create_frame_widgets): Call emacs_fixed_new if HAVE_GTK3 (Bug#8505).
6185 Call gtk_window_set_resizable if HAVE_GTK3.
6186 (x_wm_set_size_hint): Call emacs_fixed_set_min_size with min width
6187 and height if HAVE_GTK3 (Bug#8505).
6188 (scroll_bar_width_for_theme): New variable.
6189 (update_theme_scrollbar_width): New function.
6190 (xg_get_default_scrollbar_width): Move code to
6191 update_theme_scrollbar_width, just return scroll_bar_width_for_theme.
6192 (xg_initialize): Call update_theme_scrollbar_width.
6193
6194 * gtkutil.h (xg_get_default_scrollbar_width): Remove argument.
6195
6196 * emacsgtkfixed.c, emacsgtkfixed.h: New files.
6197
e10ac9f1
MR
61982011-06-12 Martin Rudalics <rudalics@gmx.at>
6199
6200 * frame.c (make_frame): Call other_buffer_safely instead of
6201 other_buffer.
6202
6203 * window.c (temp_output_buffer_show): Call display_buffer with
6204 second argument Vtemp_buffer_show_specifiers and reset latter
6205 immediately after the call.
6206 (Vtemp_buffer_show_specifiers): New variable.
6207 (auto_window_vscroll_p, next_screen_context_lines)
6208 (Vscroll_preserve_screen_position): Remove leading asterisks from
6209 doc-strings.
6210
2d3c217e 62112011-06-12 Paul Eggert <eggert@cs.ucla.edu>
4475bec4 6212
7b7f97e8 6213 Fix minor problems found by GCC 4.6.0 static checking.
4475bec4
PE
6214 * buffer.c (Qclone_number): Remove for now, as it's unused.
6215 (record_buffer, Funrecord_buffer): Rename local to avoid shadowing.
6216 (record_buffer): Remove unused local.
6217 * frame.c (other_visible_frames, frame_buffer_list): Now static.
6218 (set_frame_buffer_list): Remove; unused.
6219 * frame.h (other_visible_frames): Remove decl.
6220 * keyboard.h (menu_items_inuse): Declare only if USE_GTK || USE_MOTIF.
6221 * lisp.h (frame_buffer_list, set_frame_buffer_list): Remove decls.
6222 (add_gpm_wait_descriptor, delete_gpm_wait_descriptor): Declare only
6223 if HAVE_GPM.
6224 * menu.c (menu_items_inuse): Now static unless USE_GTK || USE_MOTIF.
6225 * process.c (add_gpm_wait_descriptor, delete_gpm_wait_descriptor):
6226 Define only if HAVE_GPM.
6227 * widget.c (EmacsFrameResize, emacsFrameClassRec): Now static.
6228 (update_hints_inhibit): Remove; never set. All uses removed.
6229 * widgetprv.h (emacsFrameClassRec): Remove decl.
6230 * window.c (delete_deletable_window): Now returns void, since it
6231 wasn't returning anything.
6232 (compare_window_configurations): Remove unused locals.
6233 * xfns.c (x_set_scroll_bar_default_width): Remove unused locals.
6234 * xmenu.c (x_menu_set_in_use): Define only if USE_GTK || USE_MOTIF.
4475bec4
PE
6235 (dialog_selection_callback) [!USE_GTK]: Prefer intptr_t for integers
6236 the same widths as pointers. This follows up on the 2011-05-06 patch.
6237 * xterm.c (x_alloc_lighter_color_for_widget): Define only if USE_LUCID.
6238 * xterm.h: Likewise.
6239 (x_menu_set_in_use): Declare only if USE_GTK || USE_MOTIF.
6240
1384b89e
JB
62412011-06-12 Juanma Barranquero <lekktu@gmail.com>
6242
6243 * makefile.w32-in: Update dependencies.
6244 (LISP_H): Add lib/intprops.h.
6245
1100a63c
CY
62462011-06-11 Chong Yidong <cyd@stupidchicken.com>
6247
6248 * image.c (gif_load): Add animation frame delay to the metadata.
6249 (syms_of_image): Use DEFSYM. New symbol `delay'.
6250
6198ccd0
MR
62512011-06-11 Martin Rudalics <rudalics@gmx.at>
6252
6253 * window.c (delete_deletable_window): Re-add.
6254 (Fset_window_configuration): Rewrite to handle dead buffers and
6255 consequently deletable windows.
6256 (window_tree, Fwindow_tree): Remove. Supply functionality in
6257 window.el.
6258 (compare_window_configurations): Simplify code.
6259
b6e3633c
AS
62602011-06-11 Andreas Schwab <schwab@linux-m68k.org>
6261
1ab0dee5
AS
6262 * image.c (imagemagick_load_image): Fix type mismatch.
6263 (Fimagemagick_types): Likewise.
6264
b6e3633c
AS
6265 * window.h (replace_buffer_in_windows): Declare.
6266
9397e56f
MR
62672011-06-11 Martin Rudalics <rudalics@gmx.at>
6268
6269 * buffer.c: New Lisp objects Qbuffer_list_update_hook and
6270 Qclone_number. Remove external declaration of Qdelete_window.
6271 (Fbuffer_list): Rewrite doc-string. Minor restructuring of
6272 code.
640c8776
SM
6273 (Fget_buffer_create, Fmake_indirect_buffer, Frename_buffer):
6274 Run Qbuffer_list_update_hook if allowed.
9397e56f
MR
6275 (Fother_buffer): Rewrite doc-string. Major rewrite for new
6276 buffer list implementation.
6277 (other_buffer_safely): New function.
6278 (Fkill_buffer): Replace call to replace_buffer_in_all_windows by
6279 calls to replace_buffer_in_windows and
6280 replace_buffer_in_windows_safely. Run Qbuffer_list_update_hook
6281 if allowed.
6282 (record_buffer): Inhibit quitting and rewrite using quittable
6283 functions. Run Qbuffer_list_update_hook if allowed.
6284 (Frecord_buffer, Funrecord_buffer): New functions.
640c8776
SM
6285 (switch_to_buffer_1, Fswitch_to_buffer): Remove.
6286 Move switch-to-buffer to window.el.
9397e56f
MR
6287 (bury-buffer): Move to window.el.
6288 (Vbuffer_list_update_hook): New variable.
6289
6290 * lisp.h (other_buffer_safely): Add prototype in buffer.c
6291 section.
6292
6293 * window.h (resize_frame_windows): Move up in code.
6294 (Fwindow_frame): Remove EXFUN.
6295 (replace_buffer_in_all_windows): Remove prototype.
6296 (replace_buffer_in_windows_safely): Add prototype.
6297
6298 * window.c: Declare Qdelete_window static again. Move down
6299 declaration of select_count.
6300 (Fnext_window, Fprevious_window): Rewrite doc-strings.
6301 (Fother_window): Move to window.el.
6302 (window_loop): Remove DELETE_BUFFER_WINDOWS and UNSHOW_BUFFER
6303 cases. Add REPLACE_BUFFER_IN_WINDOWS_SAFELY case.
6304 (Fdelete_windows_on, Freplace_buffer_in_windows): Move to
6305 window.el.
6306 (replace_buffer_in_windows): Implement by calling
6307 Qreplace_buffer_in_windows.
6308 (replace_buffer_in_all_windows): Remove with some functionality
6309 moved into replace_buffer_in_windows_safely.
6310 (replace_buffer_in_windows_safely): New function.
6311 (select_window_norecord, select_frame_norecord): Move in front
6312 of run_window_configuration_change_hook. Remove now obsolete
6313 declarations.
640c8776
SM
6314 (Fset_window_buffer): Rewrite doc-string.
6315 Call Qrecord_window_buffer.
9397e56f
MR
6316 (keys_of_window): Move binding for other-window to window.el.
6317
b50691aa
CY
63182011-06-11 Chong Yidong <cyd@stupidchicken.com>
6319
6320 * dispextern.h (struct image): Replace data member, whose int_val
6321 and ptr_val fields were not used by anything, with a single
6322 lisp_val object.
6323
6324 * image.c (Fimage_metadata, make_image, mark_image, tiff_load)
6325 (gif_clear_image, gif_load, imagemagick_load_image)
6326 (gs_clear_image, gs_load): Callers changed.
6327
3f754b86
PE
63282011-06-10 Paul Eggert <eggert@cs.ucla.edu>
6329
cca69397
PE
6330 * buffer.h: Include <time.h>, for time_t.
6331 Needed to build on FreeBSD 8.2. Problem reported by Herbert J. Skuhra.
6332
109e28d0
PE
6333 Fix minor problems found by static checking.
6334
60737f02
PE
6335 * image.c (PixelGetMagickColor): Declare if ImageMagick headers don't.
6336
4b66faf3
PE
6337 Make identifiers static if they are not used in other modules.
6338 * data.c (Qcompiled_function, Qframe, Qvector):
6339 * image.c (QimageMagick, Qsvg):
6340 * minibuf.c (Qmetadata):
6341 * window.c (resize_window_check, resize_root_window): Now static.
6342 * window.h (resize_window_check, resize_root_window): Remove decls.
6343
109e28d0
PE
6344 * window.c (window_deletion_count, delete_deletable_window):
6345 Remove; unused.
46a4ce9e
PE
6346 (window_body_lines): Now static.
6347 (Fdelete_other_windows_internal): Mark vars as initialized.
6348 Make sure 'resize_failed' is initialized.
6349 (run_window_configuration_change_hook): Rename local to avoid shadowing.
6350 (resize_window_apply): Remove unused local.
6351 * window.h (delete_deletable_window): Remove decl.
6352
109e28d0 6353 * image.c (gif_load, svg_load_image): Rename locals to avoid shadowing.
33290528
PE
6354 (imagemagick_load_image): Fix pointer signedness problem by changing
6355 last arg from unsigned char * to char *. All uses changed.
6356 Also, fix a local for similar reasons.
6357 Remove unused locals. Remove locals to avoid shadowing.
6358 (fn_rsvg_handle_free): Remove; unused.
6359 (svg_load, svg_load_image): Fix pointer signedness problem.
f7e13da3 6360 (imagemagick_load_image): Don't use garbage pointer image_wand.
33290528 6361
3f754b86
PE
6362 * ftfont.c (ftfont_get_metrics, ftfont_drive_otf): Remove unused locals.
6363
2547adb1
CY
63642011-06-10 Chong Yidong <cyd@stupidchicken.com>
6365
6366 * image.c (gif_load): Fix omitted cast error introduced by
6367 2011-06-06 change.
6368
2c8e37d4
MR
63692011-06-10 Martin Rudalics <rudalics@gmx.at>
6370
6371 * window.h (resize_proportionally, orig_total_lines)
6372 (orig_top_line): Remove from window structure.
6373 (set_window_height, set_window_width, change_window_heights)
6374 (Fdelete_window): Remove prototypes.
6375 (resize_frame_windows): Remove duplicate declaration.
6376
440a42e3
EZ
63772011-06-10 Eli Zaretskii <eliz@gnu.org>
6378
6379 * window.h (resize_frame_windows, resize_window_check)
6380 (delete_deletable_window, resize_root_window)
6381 (resize_frame_windows): Declare prototypes.
6382
6383 * window.c (resize_window_apply): Make definition be "static" to
6384 match the prototype.
6385
562dd5e9
MR
63862011-06-10 Martin Rudalics <rudalics@gmx.at>
6387
6388 * window.c: Remove declarations of Qwindow_size_fixed,
6389 window_min_size_1, window_min_size_2, window_min_size,
6390 size_window, window_fixed_size_p, enlarge_window, delete_window.
6391 Remove static from declaration of Qdelete_window, it's
6392 temporarily needed by Fbury_buffer.
6393 (replace_window): Don't assign orig_top_line and
6394 orig_total_lines.
6395 (Fdelete_window, delete_window): Remove. Window deletion is
6396 handled by window.el.
640c8776
SM
6397 (window_loop): Remove DELETE_OTHER_WINDOWS case.
6398 Replace Fdelete_window calls with calls to Qdelete_window.
562dd5e9
MR
6399 (Fdelete_other_windows): Remove. Deleting other windows is
6400 handled by window.el.
6401 (window_fixed_size_p): Remove. Fixed-sizeness of windows is
6402 handled in window.el.
6403 (window_min_size_2, window_min_size_1, window_min_size): Remove.
6404 Window minimum sizes are handled in window.el.
6405 (shrink_windows, size_window, set_window_height)
6406 (set_window_width, change_window_heights, window_height)
6407 (window_width, CURBEG, CURSIZE, enlarge_window)
6408 (adjust_window_trailing_edge, Fadjust_window_trailing_edge)
6409 (Fenlarge_window, Fshrink_window): Remove. Window resizing is
6410 handled in window.el.
6411 (make_dummy_parent): Rename to make_parent_window and give it a
6412 second argument horflag.
6413 (make_window): Don't set resize_proportionally any more.
6414 (Fsplit_window): Remove. Windows are split in window.el.
6415 (save_restore_action, save_restore_orig_size)
6416 (shrink_window_lowest_first, save_restore_orig_size): Remove.
6417 Resize mini windows in window.el.
6418 (grow_mini_window, shrink_mini_window): Implement by calling
6419 Qresize_root_window_vertically, resize_window_check and
6420 resize_window_apply.
640c8776
SM
6421 (saved_window, Fset_window_configuration, save_window_save):
6422 Do not handle orig_top_line, orig_total_lines, and
562dd5e9
MR
6423 resize_proportionally.
6424 (window_min_height, window_min_width): Move to window.el.
6425 (keys_of_window): Move bindings for delete-other-windows,
6426 split-window, delete-window and enlarge-window to window.el.
6427
6428 * buffer.c: Temporarily extern Qdelete_window.
6429 (Fbury_buffer): Temporarily call Qdelete_window instead of
6430 Fdelete_window (Fbury_buffer will move to window.el soon).
6431
6432 * frame.c (set_menu_bar_lines_1): Remove code handling
6433 orig_top_line and orig_total_lines.
6434
6435 * dispnew.c (adjust_frame_glyphs_initially): Don't use
6436 set_window_height but set heights directly.
6437 (change_frame_size_1): Use resize_frame_windows.
6438
6439 * xdisp.c (init_xdisp): Don't use set_window_height but set
6440 heights directly.
6441
640c8776
SM
6442 * xfns.c (x_set_menu_bar_lines, x_set_tool_bar_lines):
6443 Use resize_frame_windows instead of change_window_heights and run
562dd5e9
MR
6444 run_window_configuration_change_hook.
6445
6446 * w32fns.c (x_set_tool_bar_lines): Use resize_frame_windows
6447 instead of change_window_heights and run
6448 run_window_configuration_change_hook.
6449
1a13852e
MR
64502011-06-09 Martin Rudalics <rudalics@gmx.at>
6451
6452 * window.c (replace_window): Rename second argument REPLACEMENT to
6453 NEW. New third argument SETFLAG. Rewrite.
6454 (delete_window, make_dummy_parent): Call replace_window with
6455 third argument 1.
6456 (window_list_1): Move down in code.
6457 (run_window_configuration_change_hook): Move set_buffer part
6458 before select_frame_norecord part in order to unwind correctly.
6459 Rename count1 to count.
6460 (recombine_windows, delete_deletable_window, resize_root_window)
6461 (Fdelete_other_windows_internal)
6462 (Frun_window_configuration_change_hook, make_parent_window)
6463 (resize_window_check, resize_window_apply, Fresize_window_apply)
6464 (resize_frame_windows, Fsplit_window_internal)
640c8776
SM
6465 (Fdelete_window_internal, Fresize_mini_window_internal):
6466 New functions.
1a13852e
MR
6467 (syms_of_window): New variables Vwindow_splits and Vwindow_nest.
6468
f3d1777e
MR
64692011-06-08 Martin Rudalics <rudalics@gmx.at>
6470
496e208e
MR
6471 * window.h (window): Add some new members to window structure -
6472 normal_lines, normal_cols, new_total, new_normal, clone_number,
6473 splits, nest, prev_buffers, next_buffers.
6474 (WINDOW_TOTAL_SIZE): Move here from window.c.
b9e809c2 6475 (MIN_SAFE_WINDOW_WIDTH, MIN_SAFE_WINDOW_HEIGHT): Define here.
496e208e 6476
f3d1777e
MR
6477 * window.c (Fwindow_height, Fwindow_width, Fwindow_full_width_p):
6478 Remove.
496e208e
MR
6479 (make_dummy_parent): Set new members of windows structure.
6480 (make_window): Move down in code. Handle new members of window
6481 structure.
6482 (Fwindow_clone_number, Fwindow_splits, Fset_window_splits)
6483 (Fwindow_nest, Fset_window_nest, Fwindow_new_total)
6484 (Fwindow_normal_size, Fwindow_new_normal, Fwindow_prev_buffers)
6485 (Fset_window_prev_buffers, Fwindow_next_buffers)
640c8776
SM
6486 (Fset_window_next_buffers, Fset_window_clone_number):
6487 New functions.
496e208e
MR
6488 (Fwindow_hscroll, Fwindow_at, Fwindow_point, Fwindow_start)
6489 (Fwindow_end, Fwindow_line_height, Fset_window_dedicated_p):
6490 Doc-string fixes.
6491 (Fwindow_parameters, Fwindow_parameter, Fset_window_parameter):
6492 Argument WINDOW can be now internal window too.
6493 (Fwindow_use_time): Move up in code.
6494 (Fget_buffer_window): Rename argument FRAME to ALL-FRAMES.
6495 Rewrite doc-string.
6496 (Fset_window_configuration, saved_window)
6497 (Fcurrent_window_configuration, save_window_save): Handle new
6498 members of window structure.
b9e809c2
MR
6499 (WINDOW_TOTAL_SIZE, MIN_SAFE_WINDOW_WIDTH)
6500 (MIN_SAFE_WINDOW_HEIGHT): Move to window.h.
6501 (syms_of_window): New Lisp objects Qrecord_window_buffer,
6502 Qwindow_deletable_p, Qdelete_window, Qreplace_buffer_in_windows,
6503 Qget_mru_window, Qresize_root_window,
6504 Qresize_root_window_vertically, Qsafe, Qabove, Qbelow,
6505 Qauto_buffer_name; staticpro them.
f3d1777e 6506
abde8f8c
MR
65072011-06-07 Martin Rudalics <rudalics@gmx.at>
6508
6509 * window.c (Fwindow_total_size, Fwindow_left_column)
6510 (Fwindow_top_line, window_body_lines, Fwindow_body_size)
6511 (Fwindow_list_1): New functions.
6512 (window_box_text_cols): Replace with window_body_cols.
640c8776
SM
6513 (Fwindow_width, Fscroll_left, Fscroll_right):
6514 Use window_body_cols instead of window_box_text_cols.
6515 (delete_window, Fset_window_configuration):
6516 Call delete_all_subwindows with window as argument.
fa8a67e6
MR
6517 (delete_all_subwindows): Take a window as argument and not a
6518 structure. Rewrite.
190b47e6
MR
6519 (window_loop): Remove handling of GET_LRU_WINDOW and
6520 GET_LARGEST_WINDOW.
6521 (Fget_lru_window, Fget_largest_window): Move to window.el.
abde8f8c
MR
6522
6523 * window.h: Extern window_body_cols instead of
fa8a67e6
MR
6524 window_box_text_cols. delete_all_subwindows now takes a
6525 Lisp_Object as argument.
abde8f8c 6526
640c8776
SM
6527 * indent.c (compute_motion, Fcompute_motion):
6528 Use window_body_cols instead of window_box_text_cols.
abde8f8c 6529
fa8a67e6
MR
6530 * frame.c (delete_frame): Call delete_all_subwindows with root
6531 window as argument.
6532
a54e3482
DC
65332011-06-07 Daniel Colascione <dan.colascione@gmail.com>
6534
6535 * fns.c (Fputhash): Document return value.
6536
60002bf5
CY
65372011-06-06 Chong Yidong <cyd@stupidchicken.com>
6538
6539 * image.c (gif_load): Implement gif89a spec "no disposal" method.
6540
0c671da6 65412011-06-06 Paul Eggert <eggert@cs.ucla.edu>
ccd9a01a 6542
b862a52a 6543 Cons<->int and similar integer overflow fixes (Bug#8794).
77984278 6544
be44ca6c
PE
6545 Check for overflow when converting integer to cons and back.
6546 * charset.c (Fdefine_charset_internal, Fdecode_char):
6547 Use cons_to_unsigned to catch overflow.
6548 (Fencode_char): Use INTEGER_TO_CONS.
6549 * composite.h (LGLYPH_CODE): Use cons_to_unsigned.
6550 (LGLYPH_SET_CODE): Use INTEGER_TO_CONS.
6551 * data.c (long_to_cons, cons_to_long): Remove.
6552 (cons_to_unsigned, cons_to_signed): New functions.
6553 These signal an error for invalid or out-of-range values.
6554 * dired.c (Ffile_attributes): Use INTEGER_TO_CONS.
6555 * fileio.c (Fset_visited_file_modtime): Use CONS_TO_INTEGER.
6556 * font.c (Ffont_variation_glyphs):
6557 * fontset.c (Finternal_char_font): Use INTEGER_TO_CONS.
6558 * lisp.h: Include <intprops.h>.
6559 (INTEGER_TO_CONS, CONS_TO_INTEGER): New macros.
6560 (cons_to_signed, cons_to_unsigned): New decls.
6561 (long_to_cons, cons_to_long): Remove decls.
6562 * undo.c (record_first_change): Use INTEGER_TO_CONS.
6563 (Fprimitive_undo): Use CONS_TO_INTEGER.
6564 * xfns.c (Fx_window_property): Likewise.
6565 * xselect.c: Include <limits.h>.
6566 (x_own_selection, selection_data_to_lisp_data):
6567 Use INTEGER_TO_CONS.
6568 (x_handle_selection_request, x_handle_selection_clear)
6569 (x_get_foreign_selection, Fx_disown_selection_internal)
6570 (Fx_get_atom_name, x_send_client_event): Use CONS_TO_INTEGER.
6571 (lisp_data_to_selection_data): Use cons_to_unsigned.
6572 (x_fill_property_data): Use cons_to_signed.
6573 Report values out of range.
6574
d1f3d2af
PE
6575 Check for buffer and string overflow more precisely.
6576 * buffer.h (BUF_BYTES_MAX): New macro.
6577 * lisp.h (STRING_BYTES_MAX): New macro.
6578 * alloc.c (Fmake_string):
6579 * character.c (string_escape_byte8):
6580 * coding.c (coding_alloc_by_realloc):
6581 * doprnt.c (doprnt):
6582 * editfns.c (Fformat):
6583 * eval.c (verror):
6584 Use STRING_BYTES_MAX, not MOST_POSITIVE_FIXNUM,
6585 since they may not be the same number.
6586 * editfns.c (Finsert_char):
6587 * fileio.c (Finsert_file_contents):
6588 Likewise for BUF_BYTES_MAX.
6589
dd52fcea
PE
6590 * image.c: Use ptrdiff_t, not int, for sizes.
6591 (slurp_file): Switch from int to ptrdiff_t.
6592 All uses changed.
6593 (slurp_file): Check that file size fits in both size_t (for
6594 malloc) and ptrdiff_t (for sanity and safety).
6595
7f9bbdbb
PE
6596 * fileio.c (Fverify_visited_file_modtime): Avoid time overflow
6597 if b->modtime has its maximal value.
6598
dfe18f82
PE
6599 * dired.c (Ffile_attributes): Don't assume EMACS_INT has >32 bits.
6600
84acfcf0
PE
6601 Don't assume time_t can fit into int.
6602 * buffer.h (struct buffer.modtime): Now time_t, not int.
6603 * fileio.c (Fvisited_file_modtime): No need for time_t cast now.
6604 * undo.c (Fprimitive_undo): Use time_t, not int, for time_t value.
6605
ccd9a01a
PE
6606 Minor fixes for signed vs unsigned integers.
6607 * character.h (MAYBE_UNIFY_CHAR):
6608 * charset.c (maybe_unify_char):
6609 * keyboard.c (read_char, reorder_modifiers):
6610 XINT -> XFASTINT, since the integer must be nonnegative.
6611 * ftfont.c (ftfont_spec_pattern):
6612 * keymap.c (access_keymap, silly_event_symbol_error):
6613 XUINT -> XFASTINT, since the integer must be nonnegative.
6614 (Fsingle_key_description, preferred_sequence_p): XUINT -> XINT,
6615 since it makes no difference and we prefer signed.
6616 * keyboard.c (record_char): Use XUINT when all the neighbors do.
6617 (access_keymap): NATNUMP -> INTEGERP, since the integer must be
6618 nonnegative.
6619
d6d100dd
SM
66202011-06-06 Stefan Monnier <monnier@iro.umontreal.ca>
6621
6622 * window.h (Fwindow_frame): Declare.
6623
2b6148e4
PE
66242011-06-06 Paul Eggert <eggert@cs.ucla.edu>
6625
6626 * alloc.c: Simplify handling of large-request failures (Bug#8800).
6627 (SPARE_MEMORY): Always define.
6628 (LARGE_REQUEST): Remove.
6629 (memory_full): Use SPARE_MEMORY rather than LARGE_REQUEST.
6630
f230ecc9
MR
66312011-06-06 Martin Rudalics <rudalics@gmx.at>
6632
727e958e
MR
6633 * lisp.h: Move EXFUNS for Fframe_root_window,
6634 Fframe_first_window and Fset_frame_selected_window to window.h.
6635
6636 * window.h: Move EXFUNS for Fframe_root_window,
6637 Fframe_first_window and Fset_frame_selected_window here from
6638 lisp.h.
6639
6640 * frame.c (Fwindow_frame, Fframe_first_window)
6641 (Fframe_root_window, Fframe_selected_window)
6642 (Fset_frame_selected_window): Move to window.c.
6643 (Factive_minibuffer_window): Move to minibuf.c.
6644 (Fother_visible_frames_p): New function.
6645
6646 * minibuf.c (Factive_minibuffer_window): Move here from frame.c.
6647
f230ecc9
MR
6648 * window.c (decode_window, decode_any_window): Move up in code.
6649 (Fwindowp, Fwindow_live_p): Rewrite doc-strings.
6650 (inhibit_frame_unsplittable): Remove unused variable.
bf60a96b
MR
6651 (Fwindow_buffer): Move up and rewrite doc-string.
6652 (Fwindow_parent, Fwindow_vchild, Fwindow_hchild, Fwindow_next)
6653 (Fwindow_prev): New functions.
727e958e
MR
6654 (Fwindow_frame): Move here from frame.c. Accept any window as
6655 argument.
6656 (Fframe_root_window, Fframe_first_window)
6657 (Fframe_selected_window): Move here from frame.c. Accept frame
6658 or arbitrary window as argument. Update doc-strings.
6659 (Fminibuffer_window): Move up in code.
6660 (Fwindow_minibuffer_p): Move up in code and simplify.
d6d100dd
SM
6661 (Fset_frame_selected_window): Move here from frame.c.
6662 Marginal rewrite.
727e958e
MR
6663 (Fselected_window, select_window, Fselect_window): Move up in
6664 code. Minor doc-string fixes.
f230ecc9 6665
4d09bcf6
PE
66662011-06-06 Paul Eggert <eggert@cs.ucla.edu>
6667
6668 * alloc.c (memory_full) [SYSTEM_MALLOC]: Port to MacOS (Bug#8800).
6669 Do not assume that spare memory exists; that assumption is valid
6670 only if SYSTEM_MALLOC.
6671 (LARGE_REQUEST): New macro, so that the issue of large requests
6672 is separated from the issue of spare memory.
6673
810928a2
AS
66742011-06-05 Andreas Schwab <schwab@linux-m68k.org>
6675
172418ad
AS
6676 * editfns.c (Fformat): Correctly handle zero flag with hexadecimal
6677 format. (Bug#8806)
6678
43f862f7
AS
6679 * gtkutil.c (xg_get_default_scrollbar_width): Avoid warning.
6680
810928a2
AS
6681 * xfns.c (x_set_scroll_bar_default_width): Move declarations
6682 before statements.
6683
a059fe24
JD
66842011-06-05 Jan Djärv <jan.h.d@swipnet.se>
6685
6686 * gtkutil.c (xg_get_default_scrollbar_width): New function.
6687
6688 * gtkutil.h: Declare xg_get_default_scrollbar_width.
6689
6690 * xfns.c (x_set_scroll_bar_default_width): If USE_GTK, get
6691 min width by calling x_set_scroll_bar_default_width (Bug#8505).
6692
989bf368
JB
66932011-06-05 Juanma Barranquero <lekktu@gmail.com>
6694
6695 * xdisp.c (single_display_spec_intangible_p): Remove declaration.
6696
4b80f674
CY
66972011-06-04 Chong Yidong <cyd@stupidchicken.com>
6698
6699 * xselect.c (x_clipboard_manager_save): Remove redundant arg.
6700 (x_clipboard_manager_save): Add return value.
d6d100dd
SM
6701 (x_clipboard_manager_error_1, x_clipboard_manager_error_2):
6702 New error handlers.
4b80f674
CY
6703 (x_clipboard_manager_save_frame, x_clipboard_manager_save_all):
6704 Obey Vx_select_enable_clipboard_manager. Catch errors in
6705 x_clipboard_manager_save (Bug#8779).
6706 (Vx_select_enable_clipboard_manager): New variable.
de65b42c 6707 (x_get_foreign_selection): Reduce scope of x_catch_errors (Bug#8790).
4b80f674 6708
99a33b77 67092011-06-04 Dan Nicolaescu <dann@ics.uci.edu>
8b3115e7
DN
6710
6711 * emacs.c (main): Warn when starting a GTK emacs in daemon mode.
6712
99a33b77 67132011-06-04 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
14eca62f
YM
6714
6715 * fringe.c (update_window_fringes): Don't update overlay arrow bitmap
6716 in the current matrix if keep_current_p is non-zero.
6717
8264569d
EZ
67182011-06-04 Eli Zaretskii <eliz@gnu.org>
6719
6720 * bidi.c (bidi_level_of_next_char): Fix last change.
6721
57f97249
EZ
67222011-06-03 Eli Zaretskii <eliz@gnu.org>
6723
fec2107c 6724 Support bidi reordering of text covered by display properties.
57f97249 6725
fec2107c
EZ
6726 * bidi.c (bidi_copy_it): Use offsetof instead of emulating it.
6727 (bidi_fetch_char, bidi_fetch_char_advance): New functions.
6728 (bidi_cache_search, bidi_cache_iterator_state)
6729 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak)
d6d100dd
SM
6730 (bidi_level_of_next_char, bidi_move_to_visually_next):
6731 Support character positions inside a run of characters covered by a
fec2107c
EZ
6732 display string.
6733 (bidi_paragraph_init, bidi_resolve_explicit_1)
6734 (bidi_level_of_next_char): Call bidi_fetch_char and
6735 bidi_fetch_char_advance instead of FETCH_CHAR and
6736 FETCH_CHAR_ADVANCE.
6737 (bidi_init_it): Initialize new members.
6738 (LRE_CHAR, RLE_CHAR, PDF_CHAR, LRO_CHAR, RLO_CHAR): Remove macro
6739 definitions.
6740 (bidi_explicit_dir_char): Lookup character type in bidi_type_table,
6741 instead of using explicit *_CHAR codes.
d6d100dd
SM
6742 (bidi_resolve_explicit, bidi_resolve_weak):
6743 Use FETCH_MULTIBYTE_CHAR instead of FETCH_CHAR, as reordering of
fec2107c
EZ
6744 bidirectional text is supported only in multibyte buffers.
6745 (bidi_init_it): Accept additional argument FRAME_WINDOW_P and use
6746 it to initialize the frame_window_p member of struct bidi_it.
6747 (bidi_cache_iterator_state, bidi_resolve_explicit_1)
6748 (bidi_resolve_explicit, bidi_resolve_weak)
6749 (bidi_level_of_next_char, bidi_move_to_visually_next): Abort if
6750 bidi_it->nchars is non-positive.
6751 (bidi_level_of_next_char): Don't try to lookup the cache for the
6752 next/previous character if nothing is cached there yet, or if we
6753 were just reseat()'ed to a new position.
c40e2fb2 6754
0e14fe90
EZ
6755 * xdisp.c (set_cursor_from_row): Set start and stop points
6756 according to the row's direction when priming the loop that looks
6757 for the glyph on which to display cursor.
6758 (single_display_spec_intangible_p): Function deleted.
6759 (display_prop_intangible_p): Reimplement to call
6760 handle_display_spec instead of single_display_spec_intangible_p.
d6d100dd
SM
6761 Accept 3 additional arguments needed by handle_display_spec.
6762 This fixes incorrect cursor motion across display property with complex
0e14fe90
EZ
6763 values: lists, `(when COND...)' forms, etc.
6764 (single_display_spec_string_p): Support property values that are
6765 lists with the argument STRING its top-level element.
6766 (display_prop_string_p): Fix the condition for processing a
6767 property that is a list to be consistent with handle_display_spec.
fec2107c 6768 (handle_display_spec): New function, refactored from the
fc6f18ce
EZ
6769 last portion of handle_display_prop.
6770 (compute_display_string_pos): Accept additional argument
6771 FRAME_WINDOW_P. Call handle_display_spec to determine whether the
6772 value of a `display' property is a "replacing spec".
6773 (handle_single_display_spec): Accept 2 additional arguments BUFPOS
6774 and FRAME_WINDOW_P. If IT is NULL, don't set up the iterator from
6775 the display property, but just return a value indicating whether
6776 the display property will replace the characters it covers.
6777 (Fcurrent_bidi_paragraph_direction): Initialize the nchars and
6778 frame_window_p members of struct bidi_it.
d6d100dd
SM
6779 (compute_display_string_pos, compute_display_string_end):
6780 New functions.
fec2107c
EZ
6781 (push_it): Accept second argument POSITION, where pop_it should
6782 jump to continue iteration.
6783 (reseat_1): Initialize bidi_it.disp_pos.
fc6f18ce 6784
fec2107c
EZ
6785 * keyboard.c (adjust_point_for_property): Adjust the call to
6786 display_prop_intangible_p to its new signature.
fc6f18ce
EZ
6787
6788 * dispextern.h (struct bidi_it): New member frame_window_p.
fec2107c
EZ
6789 (bidi_init_it): Update prototypes.
6790 (display_prop_intangible_p): Update prototype.
d6d100dd
SM
6791 (compute_display_string_pos, compute_display_string_end):
6792 Declare prototypes.
fec2107c
EZ
6793 (struct bidi_it): New members nchars and disp_pos. ch_len is now
6794 EMACS_INT.
fc6f18ce 6795
40087514 67962011-06-02 Paul Eggert <eggert@cs.ucla.edu>
0de4bb68 6797
57f53182
PE
6798 Malloc failure behavior now depends on size of allocation.
6799 * alloc.c (buffer_memory_full, memory_full): New arg NBYTES.
6800 * lisp.h: Change signatures accordingly.
6801 * alloc.c, buffer.c, editfns.c, menu.c, minibuf.c, xterm.c:
6802 All callers changed. (Bug#8762)
6803
6804 * gnutls.c: Use Emacs's memory allocators.
6805 Without this change, the gnutls library would invoke malloc etc.
6806 directly, which causes problems on non-SYNC_INPUT hosts, and which
6807 runs afoul of improving memory_full behavior. (Bug#8761)
6808 (fn_gnutls_global_set_mem_functions): New macro or function pointer.
6809 (emacs_gnutls_global_init): Use it to specify xmalloc, xrealloc,
6810 xfree instead of the default malloc, realloc, free.
6811 (Fgnutls_boot): No need to check for memory allocation failure,
6812 since xmalloc does that for us.
6813
ac32cd99 6814 Remove arbitrary limit of 2**31 entries in hash tables. (Bug#8771)
3870d916
PE
6815 * category.c (hash_get_category_set):
6816 * ccl.c (ccl_driver):
6817 * charset.c (Fdefine_charset_internal):
6818 * charset.h (struct charset.hash_index):
6819 * composite.c (get_composition_id, gstring_lookup_cache)
6820 (composition_gstring_put_cache):
6821 * composite.h (struct composition.hash_index):
6822 * dispextern.h (struct image.hash):
6823 * fns.c (next_almost_prime, larger_vector, cmpfn_eql)
6824 (cmpfn_equal, cmpfn_user_defined, hashfn_eq, hashfn_eql)
6825 (hashfn_equal, hashfn_user_defined, make_hash_table)
6826 (maybe_resize_hash_table, hash_lookup, hash_put)
6827 (hash_remove_from_table, hash_clear, sweep_weak_table, SXHASH_COMBINE)
6828 (sxhash_string, sxhash_list, sxhash_vector, sxhash_bool_vector)
6829 (Fsxhash, Fgethash, Fputhash, Fmaphash):
6830 * image.c (make_image, search_image_cache, lookup_image)
6831 (xpm_put_color_table_h):
6832 * lisp.h (struct Lisp_Hash_Table):
0de4bb68 6833 * minibuf.c (Ftry_completion, Fall_completions, Ftest_completion):
ac389d0c 6834 * print.c (print): Use 'EMACS_UINT' and 'EMACS_INT'
3870d916 6835 for hashes and hash indexes, instead of 'unsigned' and 'int'.
40087514
PE
6836 * alloc.c (allocate_vectorlike):
6837 Check for overflow in vector size calculations.
6838 * ccl.c (ccl_driver):
6839 Check for overflow when converting EMACS_INT to int.
0de4bb68
PE
6840 * fns.c, image.c: Remove unnecessary static decls that would otherwise
6841 need to be updated by these changes.
40087514
PE
6842 * fns.c (make_hash_table, maybe_resize_hash_table):
6843 Check for integer overflow with large hash tables.
0de4bb68
PE
6844 (make_hash_table, maybe_resize_hash_table, Fmake_hash_table):
6845 Prefer the faster XFLOAT_DATA to XFLOATINT where either will do.
6846 (SXHASH_REDUCE): New macro.
6847 (sxhash_string, sxhash_list, sxhash_vector, sxhash_bool_vector):
6848 Use it instead of discarding useful hash info with large hash values.
6849 (sxhash_float): New function.
6850 (sxhash): Use it. No more need for "& INTMASK" due to above changes.
6851 * lisp.h (FIXNUM_BITS): New macro, useful for SXHASH_REDUCE etc.
40087514
PE
6852 (MOST_NEGATIVE_FIXNUM, MOST_POSITIVE_FIXNUM, INTMASK):
6853 Rewrite to use FIXNUM_BITS, as this simplifies things.
0de4bb68
PE
6854 (next_almost_prime, larger_vector, sxhash, hash_lookup, hash_put):
6855 Adjust signatures to match updated version of code.
6856 (consing_since_gc): Now EMACS_INT, since a single hash table can
6857 use more than INT_MAX bytes.
6858
698d32e2
DN
68592011-06-01 Dan Nicolaescu <dann@ics.uci.edu>
6860
6861 Make it possible to build with GCC-4.6+ -O2 -flto.
6862
6863 * emacs.c (__malloc_initialize_hook): Mark as EXTERNALLY_VISIBLE.
6864
fd6fa53f
SM
68652011-06-01 Stefan Monnier <monnier@iro.umontreal.ca>
6866
6867 * minibuf.c (get_minibuffer, read_minibuf_unwind):
6868 Call minibuffer-inactive-mode.
6869
864db017
JB
68702011-05-31 Juanma Barranquero <lekktu@gmail.com>
6871
6872 * makefile.w32-in ($(BLD)/data.$(O), $(BLD)/editfns.$(O)):
6873 Update dependencies.
6874
2ad0baf4
DN
68752011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
6876
6877 * data.c (init_data): Remove code for UTS, this system is not
6878 supported anymore.
6879
4fcc2638
DN
68802011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
6881
6882 Don't force ./temacs to start in terminal mode.
6883
6884 * frame.c (make_initial_frame): Initialize faces in all cases, not
6885 only when CANNOT_DUMP is defined.
6886 * dispnew.c (init_display): Remove CANNOT_DUMP condition.
6887
c56e0fd5
DN
68882011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
6889
6890 * dispnew.c (add_window_display_history): Use const for the string
6891 pointer. Remove declaration, not needed.
6892
333d54da 68932011-05-31 Paul Eggert <eggert@cs.ucla.edu>
9cf9f756 6894
55d4c1b2 6895 Use 'inline', not 'INLINE'.
333d54da 6896 <http://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00914.html>
55d4c1b2
PE
6897 * alloc.c, fontset.c (INLINE): Remove.
6898 * alloc.c, bidi.c, charset.c, coding.c, dispnew.c, fns.c, image.c:
6899 * intervals.c, keyboard.c, process.c, syntax.c, textprop.c, w32term.c:
6900 * xdisp.c, xfaces.c, xterm.c: Replace all uses of INLINE with inline.
6901 * gmalloc.c (register_heapinfo): Use inline unconditionally.
6902 * lisp.h (LISP_MAKE_RVALUE): Use inline, not __inline__.
6903
738db178
DN
69042011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
6905
6906 Make it possible to run ./temacs.
6907
6908 * callproc.c (set_initial_environment): Remove CANNOT_DUMP code,
6909 syms_of_callproc does the same thing. Remove test for
6910 "initialized", do it in the caller.
6911 * emacs.c (main): Avoid calling set_initial_environment when dumping.
6912
620c53a6
SM
69132011-05-31 Stefan Monnier <monnier@iro.umontreal.ca>
6914
6915 * minibuf.c (Finternal_complete_buffer): Return `category' metadata.
6916 (read_minibuf): Use get_minibuffer.
6917 (syms_of_minibuf): Use DEFSYM.
6918 (Qmetadata): New var.
6919 * data.c (Qbuffer): Don't make it static.
6920 (syms_of_data): Use DEFSYM.
6921
e003a292
PE
69222011-05-31 Paul Eggert <eggert@cs.ucla.edu>
6923
6924 * ccl.c (CCL_CODE_RANGE): Allow negative numbers. (Bug#8751)
6925 (CCL_CODE_MIN): New macro.
6926
ed008a6d
PE
69272011-05-30 Paul Eggert <eggert@cs.ucla.edu>
6928
3687c2ef
PE
6929 * alloc.c (lisp_align_malloc): Omit unnecessary val==NULL tests.
6930
ed008a6d
PE
6931 * eval.c (Qdebug): Now static.
6932 * lisp.h (Qdebug): Remove decl. This reverts a part of the
6933 2011-04-26T11:26:05Z!dan.colascione@gmail.com that inadvertently undid part of
6934 2011-04-14T06:48:41Z!eggert@cs.ucla.edu.
6935
d66c4c7c
CY
69362011-05-29 Chong Yidong <cyd@stupidchicken.com>
6937
6938 * image.c: Various fixes to ImageMagick code comments.
6939 (Fimagemagick_types): Doc fix.
6940
5fbc2025
PE
69412011-05-29 Paul Eggert <eggert@cs.ucla.edu>
6942
0196f88a
PE
6943 Minor fixes prompted by GCC 4.6.0 warnings.
6944
6945 * xselect.c (converted_selections, conversion_fail_tag): Now static.
6946
5fbc2025
PE
6947 * emacs.c [HAVE_X_WINDOWS]: Include "xterm.h".
6948 (x_clipboard_manager_save_all): Move extern decl to ...
6949 * xterm.h: ... here, so that it can be checked for consistency.
6950
1dd3c2d9
CY
69512011-05-29 Chong Yidong <cyd@stupidchicken.com>
6952
6953 * xselect.c (x_clipboard_manager_save_frame)
6954 (x_clipboard_manager_save_all): New functions.
6955 (Fx_clipboard_manager_save): Lisp function deleted.
6956
6957 * emacs.c (Fkill_emacs): Call x_clipboard_manager_save_all.
6958 * frame.c (delete_frame): Call x_clipboard_manager_save_frame.
6959
6960 * xterm.h: Update prototype.
6961
5ba6571d
WX
69622011-05-28 William Xu <william.xwl@gmail.com>
6963
6964 * nsterm.m (ns_term_shutdown): Synchronize user defaults before
6965 exiting (Bug#8239).
6966
3eaff834
JM
69672011-05-28 Jim Meyering <meyering@redhat.com>
6968
e1900994 6969 Avoid a sign-extension bug in crypto_hash_function.
3eaff834
JM
6970 * fns.c (to_uchar): Define.
6971 (crypto_hash_function): Use it to convert some newly-signed
6972 variables to unsigned, to avoid sign-extension bugs. For example,
6973 without this change, (md5 "truc") would evaluate to
6974 45723a2aff78ff4fff7fff1114760e62 rather than the expected
6975 45723a2af3788c4ff17f8d1114760e62. Reported by Antoine Levitt in
e1900994 6976 https://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00883.html.
3eaff834 6977
0f6990a7
PE
69782011-05-27 Paul Eggert <eggert@cs.ucla.edu>
6979
6980 Integer overflow fixes.
c8a9ca5a 6981
08686060
PE
6982 * dbusbind.c: Serial number integer overflow fixes.
6983 (CHECK_DBUS_SERIAL_GET_SERIAL): New macro.
08686060
PE
6984 (Fdbus_call_method_asynchronously, xd_read_message_1): Use a float
6985 to hold a serial number that is too large for a fixnum.
6986 (Fdbus_method_return_internal, Fdbus_method_error_internal):
6987 Check for serial numbers out of range. Decode any serial number
59568bf0 6988 that was so large that it became a float. (Bug#8722)
08686060 6989
2d1fc3c7
PE
6990 * dbusbind.c: Use XFASTINT rather than XUINT, and check for nonneg.
6991 (Fdbus_call_method, Fdbus_call_method_asynchronously):
6992 Use XFASTINT rather than XUINT when numbers are nonnegative.
6993 (xd_append_arg, Fdbus_method_return_internal):
6994 (Fdbus_method_error_internal): Likewise. Also, for unsigned
6995 arguments, check that Lisp number is nonnegative, rather than
59568bf0 6996 silently wrapping negative numbers around. (Bug#8722)
30217ff0 6997 (xd_read_message_1): Don't assume dbus_uint32_t can fit in int.
59568bf0 6998 (Bug#8722)
2d1fc3c7 6999
c8a9ca5a
PE
7000 * data.c (arith_driver, Flsh): Avoid unnecessary casts to EMACS_UINT.
7001
519e1d69
PE
7002 * ccl.c (ccl_driver): Redo slightly to avoid the need for 'unsigned'.
7003
6df6ae42 7004 ccl: Add integer overflow checks.
30569699
PE
7005 * ccl.c (CCL_CODE_MAX, GET_CCL_RANGE, GET_CCL_CODE, GET_CCL_INT):
7006 (IN_INT_RANGE): New macros.
7007 (ccl_driver): Use them to check for integer overflow when
7008 decoding a CCL program. Many of the new checks are whether XINT (x)
7009 fits in int; it doesn't always, on 64-bit hosts. The new version
7010 doesn't catch all possible integer overflows, but it's an
847044ea 7011 improvement. (Bug#8719)
30569699 7012
c11285dc
PE
7013 * alloc.c (make_event_array): Use XINT, not XUINT.
7014 There's no need for unsigned here.
7015
fdccd48e
PE
7016 * mem-limits.h (EXCEEDS_LISP_PTR) [!USE_LSB_TAG]: EMACS_UINT -> uintptr_t
7017 This follows up to the 2011-05-06 change that substituted uintptr_t
7018 for EMACS_INT. This case wasn't caught back then.
7019
37910ab2
PE
7020 Rework Fformat to avoid integer overflow issues.
7021 * editfns.c: Include <float.h> unconditionally, as it's everywhere
7022 now (part of C89). Include <verify.h>.
7023 (MAX_10_EXP, CONVERTED_BYTE_SIZE): Remove; no longer needed.
7024 (pWIDE, pWIDElen, signed_wide, unsigned_wide): New defns.
7025 (Fformat): Avoid the prepass trying to compute sizes; it was only
7026 approximate and thus did not catch overflow reliably. Instead, walk
7027 through the format just once, formatting and computing sizes as we go,
7028 checking for integer overflow at every step, and allocating a larger
7029 buffer as needed. Keep track separately whether the format is
7030 multibyte. Keep only the most-recently calculated precision, rather
7031 than them all. Record whether each argument has been converted to
7032 string. Use EMACS_INT, not int, for byte and char and arg counts.
7033 Support field widths and precisions larger than INT_MAX. Avoid
7034 sprintf's undefined behavior with conversion specifications such as %#d
7035 and %.0c. Fix bug with strchr succeeding on '\0' when looking for
7036 flags. Fix bug with (format "%c" 256.0). Avoid integer overflow when
7037 formatting out-of-range floating point numbers with int
9173deec 7038 formats. (Bug#8668)
37910ab2 7039
2e6578fb
PE
7040 * lisp.h (FIXNUM_OVERFLOW_P): Work even if arg is a NaN.
7041
0ae6bdee
PE
7042 * data.c: Avoid integer truncation in expressions involving floats.
7043 * data.c: Include <intprops.h>.
7044 (arith_driver): When there's an integer overflow in an expression
7045 involving floating point, convert the integers to floating point
7046 so that the resulting value does not suffer from catastrophic
7047 integer truncation. For example, on a 64-bit host (* 4
7048 most-negative-fixnum 0.5) should yield about -4.6e+18, not zero.
7049 Do not rely on undefined behavior after integer overflow.
7050
de883a70
PE
7051 merge count_size_as_multibyte, parse_str_to_multibyte
7052 * character.c, character.h (count_size_as_multibyte):
fd6fa53f 7053 Rename from parse_str_to_multibyte; all uses changed.
de883a70
PE
7054 Check for integer overflow.
7055 * insdel.c, lisp.h (count_size_as_multibyte): Remove,
7056 since it's now a duplicate of the other. This is more of
7057 a character than a buffer op, so better that it's in character.c.
7058 * fns.c, print.c: Adjust to above changes.
7059
2ff916cb
PE
70602011-05-27 Stefan Monnier <monnier@iro.umontreal.ca>
7061
7062 * xselect.c (x_convert_selection): Yet another int/Lisp_Object mixup.
7063
f1b54466
PE
70642011-05-27 Paul Eggert <eggert@cs.ucla.edu>
7065
fb1ac845
PE
7066 * xselect.c: Fix minor problems prompted by GCC 4.6.0 warnings.
7067 (x_handle_selection_request, frame_for_x_selection): Remove unused vars.
7068 (x_clipboard_manager_save): Now static.
7069 (Fx_clipboard_manager_save): Rename local to avoid shadowing.
7070
f1b54466
PE
7071 * fns.c: Fix minor problems prompted by GCC 4.6.0 warnings.
7072 (crypto_hash_function): Now static.
7073 Fix pointer signedness problems. Avoid unnecessary initializations.
7074
a9f737ee
CY
70752011-05-27 Chong Yidong <cyd@stupidchicken.com>
7076
7077 * termhooks.h (Vselection_alist): Make it terminal-local.
7078
7079 * terminal.c (create_terminal): Initialize it.
7080
7081 * xselect.c: Support for clipboard managers.
7082 (Vselection_alist): Move to termhooks.h as terminal-local var.
7083 (LOCAL_SELECTION): New macro.
7084 (x_atom_to_symbol): Handle x_display_info_for_display fail case.
7085 (symbol_to_x_atom): Remove gratuitous arg.
7086 (x_handle_selection_request, lisp_data_to_selection_data)
7087 (x_get_foreign_selection, Fx_register_dnd_atom): Callers changed.
620c53a6
SM
7088 (x_own_selection, x_get_local_selection, x_convert_selection):
7089 New arg, specifying work frame. Use terminal-local Vselection_alist.
a9f737ee
CY
7090 (some_frame_on_display): Delete unused function.
7091 (Fx_own_selection_internal, Fx_get_selection_internal)
7092 (Fx_disown_selection_internal, Fx_selection_owner_p)
7093 (Fx_selection_exists_p): New optional frame arg.
7094 (frame_for_x_selection, Fx_clipboard_manager_save): New functions.
7095 (x_handle_selection_clear): Don't treat other terminals with the
7096 same keyboard specially. Use the terminal-local Vselection_alist.
7097 (x_clear_frame_selections): Use Frun_hook_with_args.
7098
7099 * xterm.c (x_term_init): Intern ATOM and CLIPBOARD_MANAGER atoms.
7100
7101 * xterm.h: Add support for those atoms.
7102
e067f0c1
CY
71032011-05-26 Chong Yidong <cyd@stupidchicken.com>
7104
7105 * xselect.c: ICCCM-compliant handling of MULTIPLE targets.
7106 (converted_selections, conversion_fail_tag): New global variables.
7107 (x_selection_request_lisp_error): Free the above.
7108 (x_get_local_selection): Remove unnecessary code.
7109 (x_reply_selection_request): Args changed; handle arbitrary array
620c53a6
SM
7110 of converted selections stored in converted_selections.
7111 Separate the XChangeProperty and SelectionNotify steps.
e067f0c1
CY
7112 (x_handle_selection_request): Rewrite to handle MULTIPLE target.
7113 (x_convert_selection): New function.
7114 (x_handle_selection_event): Simplify.
7115 (x_get_foreign_selection): Don't ignore incoming requests while
7116 waiting for an answer; this will fail when we implement
7117 SAVE_TARGETS, and seems unnecessary anyway.
7118 (selection_data_to_lisp_data): Recognize ATOM_PAIR type.
7119 (Vx_sent_selection_functions): Doc fix.
7120
0f4aebc0
LL
71212011-05-26 Leo Liu <sdl.web@gmail.com>
7122
7123 * editfns.c (Ftranspose_regions): Allow empty regions. (Bug#8699)
7124
e61124cd
YM
71252011-05-25 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
7126
7127 * dispextern.h (struct glyph_row): New member fringe_bitmap_periodic_p.
7128
7129 * dispnew.c (shift_glyph_matrix, scrolling_window): Mark scrolled row
7130 for fringe update if it has periodic bitmap.
ac389d0c 7131 (row_equal_p): Also compare left_fringe_offset, right_fringe_offset,
e61124cd
YM
7132 and fringe_bitmap_periodic_p.
7133
7134 * fringe.c (get_fringe_bitmap_data): New function.
7135 (draw_fringe_bitmap_1, update_window_fringes): Use it.
7136 (update_window_fringes): Record periodicity of fringe bitmap in glyph
7137 row. Mark glyph row for fringe update if periodicity changed.
7138
7139 * xdisp.c (try_window_reusing_current_matrix): Don't mark scrolled row
7140 for fringe update unless it has periodic bitmap.
7141
f16d9837
KH
71422011-05-25 Kenichi Handa <handa@m17n.org>
7143
7144 * xdisp.c (get_next_display_element): Set correct it->face_id for
7145 a static composition.
7146
e1b90ef6
LL
71472011-05-24 Leo Liu <sdl.web@gmail.com>
7148
7149 * deps.mk (fns.o):
7150 * makefile.w32-in ($(BLD)/fns.$(O)): Include sha1.h.
7151
7152 * fns.c (crypto_hash_function, Fsha1): New function.
7153 (Fmd5): Use crypto_hash_function.
7154 (syms_of_fns): Add Ssha1.
7155
7400048f
PE
71562011-05-22 Paul Eggert <eggert@cs.ucla.edu>
7157
7158 * gnutls.c: Remove unused macros.
7159 (fn_gnutls_transport_set_lowat, fn_gnutls_transport_set_pull_function):
7160 (fn_gnutls_transport_set_push_function) [!WINDOWSNT]:
7161 Remove macros that are defined and never used.
7162 Caught by gcc -Wunused-macros (GCC 4.6.0, Fedora 14).
7163
abb71cf4
CY
71642011-05-22 Chong Yidong <cyd@stupidchicken.com>
7165
7166 * xselect.c (syms_of_xselect): Remove unused symbol SAVE_TARGETS.
7167 (Fx_get_selection_internal): Minor cleanup.
7168 (Fx_own_selection_internal): Rename arguments for consistency with
7169 select.el.
7170
6307db39
PE
71712011-05-22 Paul Eggert <eggert@cs.ucla.edu>
7172
7173 * xselect.c (QSAVE_TARGETS): New static var, to fix build failure.
7174
f3d4e0a4
CY
71752011-05-22 Chong Yidong <cyd@stupidchicken.com>
7176
7177 * xselect.c (syms_of_xselect): Include character.h; use DEFSYM.
7178
4d8ade89
YM
71792011-05-21 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
7180
7181 * dispnew.c (scrolling_window): Don't exclude the case that the
7182 last enabled row in the desired matrix touches the bottom boundary.
7183
32078c8d
GM
71842011-05-21 Glenn Morris <rgm@gnu.org>
7185
7186 * Makefile.in ($(etc)/DOC): Make second command line even shorter.
33cf345f
GM
7187 (SOME_MACHINE_OBJECTS): Replace FONT_OBJ by its maximal expansion,
7188 and add some more files.
32078c8d 7189
7285dc67
EZ
71902011-05-20 Eli Zaretskii <eliz@gnu.org>
7191
7192 * callproc.c (Fcall_process) [MSDOS]: Fix arguments to
7193 report_file_error introduced by the change from 2011-05-07.
7194
89d1bd22
PE
71952011-05-20 Paul Eggert <eggert@cs.ucla.edu>
7196
7197 * systime.h (Time): Define only if emacs is defined.
7198 This is to allow ../lib-src/profile.c to be compiled on FreeBSD,
7199 where the include path doesn't have X11/X.h by default. See
7200 <http://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00561.html>.
7201
cd394be1 72022011-05-20 Kenichi Handa <handa@m17n.org>
31bfc35c
KH
7203
7204 * composite.c (find_automatic_composition): Fix previous change.
7205
b9704ad9
GM
72062011-05-20 Glenn Morris <rgm@gnu.org>
7207
7208 * lisp.mk: New file, split from Makefile.in.
7209 * Makefile.in (lisp): Move to separate file, inserted by @lisp_frag@.
7210 (shortlisp): Remove.
7211 ($(etc)/DOC): Edit lisp.mk rather than using $shortlisp.
7212
4a720484
GM
72132011-05-19 Glenn Morris <rgm@gnu.org>
7214
7215 * Makefile.in (MSDOS_SUPPORT_REAL, MSDOS_SUPPORT, NS_SUPPORT)
7216 (REAL_MOUSE_SUPPORT, GPM_MOUSE_SUPPORT, MOUSE_SUPPORT, TOOLTIP_SUPPORT)
7217 (BASE_WINDOW_SUPPORT, X_WINDOW_SUPPORT, WINDOW_SUPPORT): Remove.
7218 (lisp): Set the order to that of loadup.el.
7219 (shortlisp): Make it a copy of $lisp.
7220 (SOME_MACHINE_LISP): Remove.
7221 ($(etc)/DOC): Depend just on $lisp, not $SOME_MACHINE_LISP too.
7222 Use just $shortlisp, not $SOME_MACHINE_LISP too.
7223
a28d4396
KH
72242011-05-18 Kenichi Handa <handa@m17n.org>
7225
7226 * composite.c (CHAR_COMPOSABLE_P): Add more check for efficiency.
7227 (BACKWARD_CHAR): Wrap the arg STOP by parenthesis.
7228 (find_automatic_composition): Mostly rewrite for efficiency.
7229
a2b1fa8e
JB
72302011-05-18 Juanma Barranquero <lekktu@gmail.com>
7231
7232 * makefile.w32-in: Update dependencies.
7233
8e1f5610
CS
72342011-05-18 Christoph Scholtes <cschol2112@googlemail.com>
7235
7236 * menu.c: Include limits.h (fixes the MS-Windows build broken by
7d7d0045 7237 2011-06-18T18:49:19Z!cyd@stupidchicken.com).
8e1f5610 7238
7025ee00 72392011-05-18 Paul Eggert <eggert@cs.ucla.edu>
cb93f9be 7240
cdfa6eab
PE
7241 Fix some integer overflow issues, such as string length overflow.
7242
06d6db33
PE
7243 * insdel.c (count_size_as_multibyte): Check for string overflow.
7244
2b4560a8
PE
7245 * character.c (lisp_string_width): Check for string overflow.
7246 Use EMACS_INT, not int, for string indexes and lengths; in
7247 particular, 2nd arg is now EMACS_INT, not int. Do not crash if
7248 the resulting string length overflows an EMACS_INT; instead,
7249 report a string overflow if no precision given. When checking for
7250 precision exhaustion, use a check that cannot possibly have
7251 integer overflow. (Bug#8675)
7252 * character.h (lisp_string_width): Adjust to new signature.
7253
cb93f9be
PE
7254 * alloc.c (string_overflow): New function.
7255 (Fmake_string): Use it. This doesn't change behavior, but saves
7256 a few bytes and will simplify future changes.
7257 * character.c (string_escape_byte8): Likewise.
7258 * lisp.h (string_overflow): New decl.
7259
1a1f3366
PE
7260 Fixups, following up to the user-interface timestamp change.
7261 * nsterm.m (last_mouse_movement_time, ns_mouse_position): Use Time
7262 for UI timestamps, instead of unsigned long.
9fbd6841
PE
7263 * msdos.c (mouse_get_pos): Likewise.
7264 * w32inevt.c (movement_time, w32_console_mouse_position): Likewise.
1a1f3366
PE
7265 * w32gui.h (Time): Define by including "systime.h" rather than by
7266 declaring it ourselves. (Bug#8664)
7267
d4e3e4d3
PE
7268 * dispextern.h (struct image): Don't assume time_t <= unsigned long.
7269 * image.c (clear_image_cache): Likewise.
7270
f6a24d19
PE
7271 * term.c (term_mouse_position): Don't assume time_t wraparound.
7272
08dc5ae6
PE
7273 Be more systematic about user-interface timestamps.
7274 Before, the code sometimes used 'Time', sometimes 'unsigned long',
620c53a6
SM
7275 and sometimes 'EMACS_UINT', to represent these timestamps.
7276 This change causes it to use 'Time' uniformly, as that's what X uses.
08dc5ae6
PE
7277 This makes the code easier to follow, and makes it easier to catch
7278 integer overflow bugs such as Bug#8664.
7279 * frame.c (Fmouse_position, Fmouse_pixel_position):
7280 Use Time, not unsigned long, for user-interface timestamps.
7281 * keyboard.c (last_event_timestamp, kbd_buffer_get_event): Likewise.
7282 (button_down_time, make_lispy_position, make_lispy_movement): Likewise.
7283 * keyboard.h (last_event_timestamp): Likewise.
7284 * menu.c (Fx_popup_menu) [!HAVE_X_WINDOWS]: Likewise.
7285 * menu.h (xmenu_show): Likewise.
7286 * term.c (term_mouse_position): Likewise.
7287 * termhooks.h (struct input_event.timestamp): Likewise.
7288 (struct terminal.mouse_position_hook): Likewise.
7289 * xmenu.c (create_and_show_popup_menu, xmenu_show): Likewise.
7290 * xterm.c (XTmouse_position, x_scroll_bar_report_motion): Likewise.
7291 * systime.h (Time): New decl. Pull it in from <X11/X.h> if
7292 HAVE_X_WINDOWS, otherwise define it as unsigned long, which is
7293 what it was before.
7294 * menu.h, termhooks.h: Include "systime.h", for Time.
7295
8e55734a
PE
7296 * keyboard.c (make_lispy_event): Fix problem in integer overflow.
7297 Don't assume that the difference between two unsigned long values
7298 can fit into an integer. At this point, we know button_down_time
7299 <= event->timestamp, so the difference must be nonnegative, so
7300 there's no need to cast the result if double-click-time is
7301 nonnegative, as it should be; check that it's nonnegative, just in
7302 case. This bug is triggered when events are more than 2**31 ms
86db42d2 7303 apart (about 25 days). (Bug#8664)
8e55734a 7304
841f1b75 7305 * xselect.c (last_event_timestamp): Remove duplicate decl.
6434756c 7306 (x_own_selection): Remove needless cast to unsigned long.
841f1b75 7307
3e26f69c
PE
7308 * xmenu.c (set_frame_menubar): Use int, not EMACS_UINT, for indexes
7309 that always fit in int. Use a sentinel instead of a counter, to
7310 avoid a temp and to allay GCC's concerns about possible int overflow.
d230cb74
PE
7311 * frame.h (struct frame): Use int for menu_bar_items_used
7312 instead of EMACS_INT, since it always fits in int.
3e26f69c 7313
5cc152c0
PE
7314 * menu.c (grow_menu_items): Check for int overflow.
7315
d89eb65e
PE
7316 * xmenu.c (set_frame_menubar): Don't mishandle vectors with no nils.
7317
5235bd3e
PE
7318 * xterm.c: Use EMACS_INT for Emacs modifiers, and int for X modifiers.
7319 Before, the code was not consistent. These values cannot exceed
7320 2**31 - 1 so there's no need to make them unsigned.
7321 (x_x_to_emacs_modifiers): Accept int and return EMACS_INT.
7322 (x_emacs_to_x_modifiers): Accept EMACS_INT and return int.
7323 (x_x_to_emacs_modifiers, x_emacs_to_x_modifiers): Reject non-integers
7324 as modifiers.
7325 * xterm.h (x_x_to_emacs_modifiers): Adjust to signature change.
7326
bc827e23
PE
7327 * lisp.h (XINT) [USE_LISP_UNION_TYPE]: Cast to EMACS_INT.
7328 (XUINT) [USE_LISP_UNION_TYPE]: Cast to EMACS_UINT.
7329 Otherwise, GCC 4.6.0 warns about printf (pI, XINT (...)),
7330 presumably because the widths might not match.
7331
78eb494e
PE
7332 * window.c (size_window): Avoid needless test at loop start.
7333
04f2d78b
CB
73342011-05-18 Courtney Bane <emacs-bugs-7626@cbane.org> (tiny change)
7335
7336 * term.c (Fresume_tty): Restore hooks before reinitializing (bug#8687).
7337
d2fc7e3d 73382011-05-12 Drew Adams <drew.adams@oracle.com>
e531bdff
DA
7339
7340 * textprop.c (Fprevious_single_char_property_change): Doc fix (bug#8655).
7341
d2fc7e3d 73422011-05-12 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
7db47798
YM
7343
7344 * w32term.c (w32_draw_fringe_bitmap): Rename local vars `left' and
7345 `width' to `bar_area_x' and `bar_area_width', respectively.
7346 (x_scroll_run): Take account of fringe background extension.
7347
04f2d78b
CB
7348 * xterm.c (x_draw_fringe_bitmap) [USE_TOOLKIT_SCROLL_BARS]:
7349 Rename local vars `left' and `width' to `bar_area_x' and
7db47798
YM
7350 `bar_area_width', respectively.
7351 (x_scroll_run) [USE_TOOLKIT_SCROLL_BARS]: Take account of fringe
7352 background extension.
7353
79b70037
GM
73542011-05-10 Jim Meyering <meyering@redhat.com>
7355
7356 * xdisp.c (x_intersect_rectangles): Fix typo "the the -> the".
7357
2f142cc5
JB
73582011-05-10 Juanma Barranquero <lekktu@gmail.com>
7359
7360 * image.c (Finit_image_library): Return t for built-in image types,
7361 like pbm and xbm. (Bug#8640)
7362
57679c86
AS
73632011-05-09 Andreas Schwab <schwab@linux-m68k.org>
7364
7365 * w32menu.c (set_frame_menubar): Fix submenu allocation.
7366
888c9e86
EZ
73672011-05-07 Eli Zaretskii <eliz@gnu.org>
7368
b0512a1d
EZ
7369 * w32console.c (Fset_screen_color): Doc fix.
7370 (Fget_screen_color): New function.
7371 (syms_of_ntterm): Defsubr it.
7372
7285dc67
EZ
7373 * callproc.c (call_process_cleanup) [MSDOS]: Don't close and
7374 unlink the temporary file if Fcall_process didn't create it in the
7375 first place.
7376 (Fcall_process) [MSDOS]: Don't create tempfile if stdout of the
7377 child process will be redirected to a file specified with `:file'.
888c9e86
EZ
7378 Don't try to re-open tempfile in that case, and set fd[0] to -1 as
7379 cue to call_process_cleanup not to close that handle.
7380
4d3fcc8e
BK
73812011-05-07 Ben Key <bkey76@gmail.com>
7382
7383 * makefile.w32-in: The bootstrap-temacs rule now makes use of
7384 one of two shell specific rules, either bootstrap-temacs-CMD or
7385 bootstrap-temacs-SH. The bootstrap-temacs-SH rule is identical
7386 to the previous implementation of the bootstrap-temacs rule.
7387 The bootstrap-temacs-CMD rule is similar to the previous
7388 implementation of the bootstrap-temacs rule except that it
7389 makes use of the ESC_CFLAGS variable instead of the CFLAGS
7390 variable.
7391
7392 These changes, along with some changes to nt/configure.bat,
7393 nt/gmake.defs, and nt/nmake.defs, are required to extend my
7394 earlier fix to add support for --cflags and --ldflags options
7395 that include quotes so that it works whether make uses cmd or
7396 sh as the shell.
7397
b4289b64
MA
73982011-05-06 Michael Albinus <michael.albinus@gmx.de>
7399
7400 * dbusbind.c (QCdbus_type_unix_fd): Declare static.
7401 (xd_remove_watch): Don't check QCdbus_type_unix_fd for SYMBOLP, it
7402 is a constant.
7403 (Fdbus_init_bus, xd_read_queued_messages): Bus can be a symbol or
7404 a string. Handle both cases.
7405 (Fdbus_call_method_asynchronously, Fdbus_register_signal)
7406 (Fdbus_register_method): Use Qinvalid_function.
7407
af4c0e28
JB
74082011-05-06 Juanma Barranquero <lekktu@gmail.com>
7409
7410 * makefile.w32-in: Update dependencies.
7411 (LISP_H): Add inttypes.h and stdin.h.
7412 (PROCESS_H): Add unistd.h.
7413
c51453d9
EZ
74142011-05-06 Eli Zaretskii <eliz@gnu.org>
7415
7416 * lread.c: Include limits.h (fixes the MS-Windows build broken by
7417 2011-05-06T07:13:19Z!eggert@cs.ucla.edu).
7418
8ff0ac3c 74192011-05-06 Paul Eggert <eggert@cs.ucla.edu>
c032b5f8 7420
4c4b566b
PE
7421 * image.c (Finit_image_library) [!HAVE_NTGUI]: Omit unused local.
7422
aab2b9b5
PE
7423 * term.c (vfatal): Remove stray call to va_end.
7424 It's not needed and the C Standard doesn't allow it here anyway.
7425
c378da0b
PE
7426 Use C99's va_copy to avoid undefined behavior on x86-64 GNU/Linux.
7427 * eval.c (verror): doprnt a copy of ap, not the original. (Bug#8545)
7428
288b08c7
PE
7429 * eval.c (verror): OK to create a string of up to MOST_POSITIVE_FIXNUM
7430 bytes.
7431
e3601888
PE
7432 * term.c: Don't include <stdarg.h>, as <lisp.h> does that.
7433
db6c0e74
PE
7434 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork clobbering.
7435
dd5963ea
PE
7436 * process.c (Fformat_network_address): Fix typo: args2 -> *args2.
7437
88c9450f
PE
7438 * xmenu.c (set_frame_menubar): Fix typo: int * -> int (3 times).
7439
2f9442b8
PE
7440 * coding.c (detect_coding_charset): Fix typo: * 2 -> *4 (Bug#8601).
7441
c032b5f8
PE
7442 * charset.h (struct charset.code_space): Now has 15 elements, not 16.
7443 * charset.c (Fdefine_charset_internal): Don't initialize
7444 charset.code_space[15]. The value was garbage, on hosts with
2d38271b 7445 32-bit int (Bug#8600).
a108c10b
PE
7446
7447 * lread.c (read_integer): Be more consistent with string-to-number.
7448 Use string_to_number to do the actual conversion; this avoids
7449 rounding errors and fixes some other screwups. Without this fix,
7450 for example, #x1fffffffffffffff was misread as -2305843009213693952.
7451 (digit_to_number): Move earlier, for benefit of read_integer.
7452 Return -1 if the digit is out of range for the base, -2 if it is
48e400f0 7453 not a digit in any supported base. (Bug#8602)
a108c10b 7454
ad5f9eea
PE
7455 * doprnt.c (doprnt): Support arbitrary pI values, such as "I64".
7456
aec1708a
PE
7457 * dispnew.c (scrolling_window): Return 1 if we scrolled,
7458 to match comment at start of function. This also removes a
7459 GCC warning about overflow in a 32+64-bit port.
7460
47be4ab5
PE
7461 * lisp.h (EMACS_INT, EMACS_UINT, BITS_PER_EMACS_INT, pI): Simplify.
7462
371cac43
PE
7463 * dbusbind.c: Do not use XPNTR on a value that may be an integer.
7464 Reported by Stefan Monnier in
7465 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00919.html>.
04f2d78b
CB
7466 (xd_remove_watch, Fdbus_init_bus, xd_read_queued_messages):
7467 Use SYMBOLP-guarded XSYMBOL, not XPNTR.
371cac43 7468
d01a7826
PE
7469 * lisp.h (EMACS_INTPTR): Remove. All uses changed to intptr_t.
7470 (EMACS_UINTPTR): Likewise, with uintptr_t.
7471
7fd47d5c
PE
7472 * lisp.h: Prefer 64-bit EMACS_INT if available.
7473 (EMACS_INT, EMACS_UINT, BITS_PER_EMACS_INT, pI): Define to 64-bit
7474 on 32-bit hosts that have 64-bit int, so that they can access
7475 large files.
122b0c86
PE
7476 However, temporarily disable this change unless the temporary
7477 symbol WIDE_EMACS_INT is defined.
7fd47d5c 7478
8727937b
PE
7479 * lread.c, process.c: Do not include <inttypes.h>; lisp.h does it now.
7480
8ac068ac
PE
7481 Prefer intptr_t/uintptr_t for integers the same widths as pointers.
7482 This removes an assumption that EMACS_INT and long are the same
7483 width as pointers. The assumption is true for Emacs porting targets
7484 now, but we want to make other targets possible.
7485 * lisp.h: Include <inttypes.h>, for INTPTR_MAX, UINTPTR_MAX.
7486 (EMACS_INTPTR, EMACS_UINTPTR): New macros.
7487 In the rest of the code, change types of integers that hold casted
7488 pointers to EMACS_INTPTR and EMACS_UINTPTR, systematically
7489 replacing EMACS_INT, long, EMACS_UINT, and unsigned long.
7490 (XTYPE): Don't cast arg to EMACS_UINT; normally is not needed.
7491 (XSET): Cast type of XTYPE arg to EMACS_INTPTR; it is needed here.
7492 No need to cast type when ORing.
7493 (XPNTR): Return a value of type EMACS_INTPTR or EMACS_UINTPTR.
7494 * alloc.c (lisp_align_malloc): Remove a no-longer-needed cast.
7495 * doc.c (store_function_docstring): Use EMACS_INTPTR, so as not to
7496 assume EMACS_INT is the same width as char *.
7497 * gtkutil.c (xg_gtk_scroll_destroy, xg_tool_bar_button_cb):
7498 (xg_tool_bar_callback, xg_tool_bar_help_callback, xg_make_tool_item):
7499 Remove no-longer-needed casts.
7500 (xg_create_scroll_bar, xg_tool_bar_button_cb, xg_tool_bar_callback):
7501 (xg_tool_bar_help_callback, xg_make_tool_item):
7502 Use EMACS_INTPTR to hold an integer
7503 that will be cast to void *; this can avoid a GCC warning
7504 if EMACS_INT is not the same width as void *.
7505 * menu.c (find_and_call_menu_selection): Remove no-longer-needed cast.
7506 * xdisp.c (display_echo_area_1, resize_mini_window_1):
7507 (current_message_1, set_message_1):
7508 Use a local to convert to proper width without a cast.
7509 * xmenu.c (dialog_selection_callback): Likewise.
7510
ede49d71
PE
7511 * sysdep.c (get_random): Don't assume EMACS_INT is no wider than long.
7512 Also, don't assume VALBITS / RAND_BITS is less than 5,
7513 and don't rely on undefined behavior when shifting a 1 left into
7514 the sign bit.
7515 * lisp.h (get_random): Change signature to match.
7516
2f30ecd0
PE
7517 * lread.c (hash_string): Use size_t, not int, for hash computation.
7518 Normally we prefer signed values; but hashing is special, because
7519 it's better to use unsigned division on hash table sizes so that
7520 the remainder is nonnegative. Also, size_t is the natural width
7521 for hashing into memory. The previous code used 'int', which doesn't
7522 retain enough info to hash well into very large tables.
7523 (oblookup, oblookup_last_bucket_number, Funintern): Likewise.
7524
2a866e7b
PE
7525 * dbusbind.c: Don't possibly lose pointer info when converting.
7526 (xd_remove_watch, Fdbus_init_bus, xd_read_queued_messages):
7527 Use XPNTR rather than XHASH, so that the high-order bits of
7528 the pointer aren't lost when converting through void *.
7529
51639eac
PE
7530 * eval.c (Fautoload): Don't double-shift a pointer.
7531
92394119
PE
7532 * fns.c (Frandom): Let EMACS_UINT be wider than unsigned long.
7533
dbdb9a7c
JB
75342011-05-06 Juanma Barranquero <lekktu@gmail.com>
7535
7536 * gnutls.c (DEF_GNUTLS_FN):
7537 * image.c (DEF_IMGLIB_FN): Make function pointers static.
7538
db7a0b4f
AS
75392011-05-05 Andreas Schwab <schwab@linux-m68k.org>
7540
7541 * lread.c (lisp_file_lexically_bound_p): Stop scanning at end
7542 marker. (Bug#8610)
7543
cd394be1 75442011-05-05 Eli Zaretskii <eliz@gnu.org>
fab624aa
EZ
7545
7546 * w32heap.c (allocate_heap) [USE_LISP_UNION_TYPE || USE_LSB_TAG]:
7547 New version that can reserve upto 2GB of heap space.
7548
f7ff1b0f 75492011-05-05 Chong Yidong <cyd@stupidchicken.com>
45cb8994
CY
7550
7551 * nsfns.m (Fns_read_file_name): Doc fix (Bug#8534).
7552
639c109b
TZ
75532011-05-05 Teodor Zlatanov <tzz@lifelogs.com>
7554
7555 * gnutls.c (fn_gnutls_certificate_set_x509_key_file): Add alias to
7556 `gnutls_certificate_set_x509_key_file'.
7557
d2127135
JB
75582011-05-05 Juanma Barranquero <lekktu@gmail.com>
7559
7560 * makefile.w32-in ($(BLD)/image.$(O), $(BLD)/process.$(O)):
7561 Update dependencies.
7562
e968f4f3
JB
75632011-05-04 Juanma Barranquero <lekktu@gmail.com>
7564
7565 * gnutls.h (emacs_gnutls_write, emacs_gnutls_read):
7566 * gnutls.c (emacs_gnutls_write, emacs_gnutls_read):
7567 Remove unused parameter `fildes'.
7568 * process.c (read_process_output, send_process): Don't pass it.
7569
84d358f0
JB
75702011-05-04 Juanma Barranquero <lekktu@gmail.com>
7571
7572 Fix previous change: the library cache is defined in w32.c.
7573 * image.c (CACHE_IMAGE_TYPE) [!HAVE_NTGUI]: Define to noop.
7574 (Finit_image_library): Wrap Vlibrary_cache on "#ifdef HAVE_NTGUI".
7575
0898ca10
JB
75762011-05-04 Juanma Barranquero <lekktu@gmail.com>
7577
7578 Implement dynamic loading of GnuTLS on Windows.
7579
7580 * gnutls.h (GNUTLS_EMACS_ERROR_NOT_LOADED): New macro.
7581 (emacs_gnutls_write, emacs_gnutls_read): Mark as extern.
7582 (emacs_gnutls_record_check_pending, emacs_gnutls_transport_set_errno):
7583 Declare.
7584
7585 * gnutls.c (Qgnutls_dll): Define.
7586 (DEF_GNUTLS_FN, LOAD_GNUTLS_FN): New macros.
7587 (gnutls_*): Declare function pointers.
7588 (init_gnutls_functions): New function to initialize function pointers.
7589 (emacs_gnutls_handshake, Fgnutls_error_string, Fgnutls_deinit)
7590 (emacs_gnutls_global_init, Fgnutls_bye): Use function pointers.
7591 (emacs_gnutls_record_check_pending, emacs_gnutls_transport_set_errno):
7592 Wrappers for gnutls_record_check_pending and gnutls_transport_set_errno.
7593 (emacs_gnutls_write, emacs_gnutls_read)
7594 (emacs_gnutls_handle_error, Fgnutls_error_fatalp)
7595 (Fgnutls_available_p): New function.
7596 (Fgnutls_boot): Call Fgnutls_available_p. Use function pointers.
7597 (syms_of_gnutls) <Qgnutls_dll>: Initialize and staticpro it.
7598 (syms_of_gnutls) <Sgnutls_available_p>: defsubr it.
7599
7600 * image.c: Include w32.h.
7601 (Vimage_type_cache): Delete.
7602 (syms_of_image) <Vimage_type_cache>: Don't initialize and staticpro it.
7603 (CACHE_IMAGE_TYPE, Finit_image_library): Use Vlibrary_cache instead.
7604 (w32_delayed_load): Move to w32.c.
7605
7606 * w32.h (VlibraryCache, QCloaded_from, w32_delayed_load): Declare.
7607
7608 * w32.c (QCloaded_from, Vlibrary_cache): Define.
7609 (w32_delayed_load): Move from image.c. When loading a library, record
7610 its filename in the :loaded-from property of the library id.
7611 (globals_of_w32) <QCloaded_from, Vlibrary_cache>:
7612 Initialize and staticpro them.
7613 (emacs_gnutls_pull, emacs_gnutls_push): Call emacs_gnutls_* functions.
7614
7615 * process.c: Include lisp.h before w32.h, not after.
7616 (wait_reading_process_output): Call emacs_gnutls_record_check_pending
7617 instead of gnutls_record_check_pending.
7618
7619 * callproc.c, emacs.c: Include lisp.h before w32.h, not after.
7620
ff4de4aa
TZ
76212011-05-04 Teodor Zlatanov <tzz@lifelogs.com>
7622
7623 * gnutls.c (Fgnutls_boot): Support :keylist and :crlfiles options
7624 instead of :keyfiles. Give GnuTLS the keylist and the CRL lists
7625 as passed in.
7626
abe95abb
JD
76272011-05-03 Jan Djärv <jan.h.d@swipnet.se>
7628
7629 * xterm.c (x_set_frame_alpha): Do not set property on anything
7630 else than FRAME_X_OUTER_WINDOW (Bug#8608).
7631
e16e55d4
JB
76322011-05-02 Juanma Barranquero <lekktu@gmail.com>
7633
7634 * sysdep.c (get_tty_size) [WINDOWSNT]: Implement. (Bug#8596)
7635
bafcf6a5
JB
76362011-05-02 Juanma Barranquero <lekktu@gmail.com>
7637
7638 * gnutls.c (Qgnutls_log_level, Qgnutls_code, Qgnutls_anon)
7639 (Qgnutls_x509pki, Qgnutls_e_interrupted, Qgnutls_e_again)
7640 (Qgnutls_e_invalid_session, Qgnutls_e_not_ready_for_handshake)
7641 (gnutls_global_initialized, Qgnutls_bootprop_priority)
7642 (Qgnutls_bootprop_trustfiles, Qgnutls_bootprop_keyfiles)
7643 (Qgnutls_bootprop_callbacks, Qgnutls_bootprop_loglevel)
7644 (Qgnutls_bootprop_hostname, Qgnutls_bootprop_verify_flags)
7645 (Qgnutls_bootprop_verify_error, Qgnutls_bootprop_verify_hostname_error)
7646 (Qgnutls_bootprop_callbacks_verify): Make static.
7647
e7a6747f
AS
76482011-05-01 Andreas Schwab <schwab@linux-m68k.org>
7649
19ed11ba
AS
7650 * callproc.c: Indentation fixup.
7651
e7a6747f 7652 * sysdep.c (wait_for_termination_1): Make static.
04f2d78b
CB
7653 (wait_for_termination, interruptible_wait_for_termination):
7654 Move after wait_for_termination_1.
e7a6747f 7655
1ef14cb4
LMI
76562011-05-01 Lars Magne Ingebrigtsen <larsi@gnus.org>
7657
7658 * sysdep.c (interruptible_wait_for_termination): New function
7659 which is like wait_for_termination, but allows keyboard
7660 interruptions.
7661
7662 * callproc.c (Fcall_process): Add (:file "file") as an option for
7663 the STDOUT buffer.
7664 (Fcall_process_region): Ditto.
7665
330d880c
EZ
76662011-04-30 Eli Zaretskii <eliz@gnu.org>
7667
8db90b73
EZ
7668 * dosfns.c (Fint86, Fdos_memget, Fdos_memput): Use `ASIZE (FOO)'
7669 rather than `XVECTOR (FOO)->size'.
7670
330d880c
EZ
7671 * process.c: Remove HAVE_INTTYPES_H condition from inclusion of
7672 inttypes.h, as a gnulib replacement is used if it not available in
7673 system headers.
7674
15cbd324
EZ
76752011-04-21 Eli Zaretskii <eliz@gnu.org>
7676
7677 Lift the MOST_POSITIVE_FIXNUM/4 limitation on visited files.
7678 * fileio.c (Finsert_file_contents): Don't limit file size to 1/4
7679 of MOST_POSITIVE_FIXNUM. (Bug#8528)
7680
7681 * coding.c (coding_alloc_by_realloc): Error out if destination
7682 will grow beyond MOST_POSITIVE_FIXNUM.
7683 (decode_coding_emacs_mule): Abort if there isn't enough place in
7684 charbuf for the composition carryover bytes. Reserve an extra
7685 space for up to 2 characters produced in a loop.
7686 (decode_coding_iso_2022): Abort if there isn't enough place in
7687 charbuf for the composition carryover bytes.
7688
76892011-04-21 Eli Zaretskii <eliz@gnu.org>
afda1437 7690
ae940cca
EZ
7691 * doprnt.c (doprnt) [!HAVE_LONG_LONG_INT]: Error out instead of
7692 aborting when %lld or %lll format is passed.
7693 [!HAVE_UNSIGNED_LONG_LONG_INT]: Error out instead of aborting when
7694 %llo or %llx format is passed. (Bug#8545)
7695
03ab8921
EZ
7696 * window.c (window_scroll_line_based): Use a marker instead of
7697 simple variables to record original value of point. (Bug#7952)
7698
afda1437
EZ
7699 * doprnt.c (doprnt): Fix the case where a multibyte sequence
7700 produced by %s or %c overflows available buffer space. (Bug#8545)
7701
f76dee0c
PE
77022011-04-28 Paul Eggert <eggert@cs.ucla.edu>
7703
7704 * doprnt.c (doprnt): Omit useless test; int overflow check (Bug#8545).
283cdbef 7705 (SIZE_MAX): Move defn after all includes, as they might #define it.
f76dee0c 7706
fdc5744d
JB
77072011-04-28 Juanma Barranquero <lekktu@gmail.com>
7708
7709 * w32.c (init_environment): Warn about defaulting HOME to C:\.
7710
638f053a
JB
77112011-04-28 Juanma Barranquero <lekktu@gmail.com>
7712
7713 * keyboard.c (Qdelayed_warnings_hook): Define.
7714 (command_loop_1): Run `delayed-warnings-hook'
7715 if Vdelayed_warnings_list is non-nil.
7716 (syms_of_keyboard) <delayed-warnings-hook>: DEFSYM it.
7717 (syms_of_keyboard) <delayed-warnings-list>: DEFVAR_LISP it.
7718
d178f871
EZ
77192011-04-28 Eli Zaretskii <eliz@gnu.org>
7720
7721 * doprnt.c (doprnt): Don't return value smaller than the buffer
7722 size if the message was truncated. (Bug#8545).
7723
b124fd93
JB
77242011-04-28 Juanma Barranquero <lekktu@gmail.com>
7725
7726 * w32fns.c (Fx_change_window_property, Fx_delete_window_property)
7727 (Fx_window_property): #if-0 the whole functions, not just the bodies.
7728
e810457d
PE
77292011-04-27 Paul Eggert <eggert@cs.ucla.edu>
7730
7731 * doprnt.c (doprnt): Support "ll" length modifier, for long long.
7732
ea51cceb
JB
77332011-04-27 Juanma Barranquero <lekktu@gmail.com>
7734
7735 * makefile.w32-in: Update dependencies.
7736
94dcfacf
EZ
77372011-04-27 Eli Zaretskii <eliz@gnu.org>
7738
7739 Improve `doprnt' and its usage. (Bug#8545)
7740 * doprnt.c (doprnt): Make sure `format' is never accessed beyond
7741 `format_end'. Remove support for %l as a conversion specifier.
7742 Don't use xrealloc. Improve diagnostics when the %l size modifier
7743 is used. Update the commentary.
7744
7745 * eval.c (verror): Simplify calculation of size_t.
7746
7747 * coding.c (Ffind_operation_coding_system): Fix diagnostic error
7748 messages.
7749
f61f41d7
PE
77502011-04-27 Yoshiaki Kasahara <kasahara@nc.kyushu-u.ac.jp> (tiny change)
7751
7752 * buffer.c (init_buffer) [USE_MMAP_FOR_BUFFERS]: Adjust to aliasing
7753 change.
7754
96fb4434
PE
77552011-04-27 Paul Eggert <eggert@cs.ucla.edu>
7756
7757 * nsmenu.m: Replace all uses of XVECTOR with ASIZE and AREF.
7758 This makes this file independent of the recent pseudovector change.
7759
671875da 77602011-04-26 Paul Eggert <eggert@cs.ucla.edu>
eab3844f 7761
69e9b5a3
PE
7762 * keyboard.c (handle_user_signal): Fix pointer signedness problem.
7763
b5f869a7 7764 * gnutls.c (emacs_gnutls_handle_error): Remove unused local.
7754e151 7765 (Fgnutls_boot): gnutls_certificate_verify_peers2 wants unsigned *.
8d4c3955 7766 Remove unused local.
c8926152 7767 (emacs_gnutls_write): Don't use uninitialized rtnval if nbyte <= 0.
080e5a8d 7768
841a1577 7769 * lisp.h: Fix a problem with aliasing and vector headers. (Bug#8546)
04f2d78b
CB
7770 GCC 4.6.0 optimizes based on type-based alias analysis.
7771 For example, if b is of type struct buffer * and v of type struct
eab3844f
PE
7772 Lisp_Vector *, then gcc -O2 was incorrectly assuming that &b->size
7773 != &v->size, and therefore "v->size = 1; b->size = 2; return
7774 v->size;" must therefore return 1. This assumption is incorrect
7775 for Emacs, since it type-puns struct Lisp_Vector * with many other
7776 types. To fix this problem, this patch adds a new type struct
f904488f 7777 vectorlike_header that documents the constraints on layout of vectors
eab3844f
PE
7778 and pseudovectors, and helps optimizing compilers not get fooled
7779 by Emacs's type punning. It also adds the macros XSETTYPED_PVECTYPE
7780 XSETTYPED_PSEUDOVECTOR, TYPED_PSEUDOVECTORP, for similar reasons.
f904488f
PE
7781 * lisp.h (XSETTYPED_PVECTYPE): New macro, specifying the name of
7782 the size member.
eab3844f
PE
7783 (XSETPVECTYPE): Rewrite in terms of new macro.
7784 (XSETPVECTYPESIZE): New macro, specifying both type and size.
7785 This is a bit clearer, and further avoids the possibility of
7786 undesirable aliasing.
7787 (XSETTYPED_PSEUDOVECTOR): New macro, specifying the size.
f904488f 7788 (XSETPSEUDOVECTOR): Rewrite in terms of XSETTYPED_PSEUDOVECTOR.
eab3844f
PE
7789 (XSETSUBR): Rewrite in terms of XSETTYPED_PSEUDOVECTOR and XSIZE,
7790 since Lisp_Subr is a special case (no "next" field).
04f2d78b
CB
7791 (ASIZE): Now uses header.size rather than size.
7792 All previous uses of XVECTOR (foo)->size replaced to use this macro,
f904488f
PE
7793 to avoid the hassle of writing XVECTOR (foo)->header.size.
7794 (struct vectorlike_header): New type.
eab3844f
PE
7795 (TYPED_PSEUDOVECTORP): New macro, also specifying the C type of the
7796 object, to help avoid aliasing.
7797 (PSEUDOVECTORP): Rewrite in terms of TYPED_PSEUDOVECTORP.
7798 (SUBRP): Likewise, since Lisp_Subr is a special case.
7799 * lisp.h (struct Lisp_Vector, struct Lisp_Char_Table):
7800 (struct Lisp_Sub_Char_Table, struct Lisp_Bool_Vector):
7801 (struct Lisp_Hash_Table): Combine first two members into a single
f904488f 7802 struct vectorlike_header member. All uses of "size" and "next" members
eab3844f
PE
7803 changed to be "header.size" and "header.next".
7804 * buffer.h (struct buffer): Likewise.
7805 * font.h (struct font_spec, struct font_entity, struct font): Likewise.
7806 * frame.h (struct frame): Likewise.
7807 * process.h (struct Lisp_Process): Likewise.
7808 * termhooks.h (struct terminal): Likewise.
7809 * window.c (struct save_window_data, struct saved_window): Likewise.
7810 * window.h (struct window): Likewise.
7811 * alloc.c (allocate_buffer, Fmake_bool_vector, allocate_pseudovector):
7812 Use XSETPVECTYPESIZE, not XSETPVECTYPE, to avoid aliasing problems.
7813 * buffer.c (init_buffer_once): Likewise.
7814 * lread.c (defsubr): Use XSETTYPED_PVECTYPE, since Lisp_Subr is a
7815 special case.
7816 * process.c (Fformat_network_address): Use local var for size,
7817 for brevity.
7818
0df1eac5
PE
7819 * bytecode.c (exec_byte_code): Don't use XVECTOR before CHECK_VECTOR.
7820
847ab9d1 7821 Make the Lisp reader and string-to-float more consistent (Bug#8525)
452f4150
PE
7822 * data.c (atof): Remove decl; no longer used or needed.
7823 (digit_to_number): Move to lread.c.
7824 (Fstring_to_number): Use new string_to_number function, to be
7825 consistent with how the Lisp reader treats infinities and NaNs.
7826 Do not assume that floating-point numbers represent EMACS_INT
7827 without losing information; this is not true on most 64-bit hosts.
7828 Avoid double-rounding errors, by insisting on integers when
7829 parsing non-base-10 numbers, as the documentation specifies.
7830 * lisp.h (string_to_number): New decl, replacing ...
7831 (isfloat_string): Remove.
bc0a5c13 7832 * lread.c: Include <inttypes.h>, for uintmax_t and strtoumax.
d78050d6 7833 (read1): Do not accept +. and -. as integers; this
452f4150
PE
7834 appears to have been a coding error. Similarly, do not accept
7835 strings like +-1e0 as floating point numbers. Do not report
7836 overflow for integer overflows unless the base is not 10 which
7837 means we have no simple and reliable way to continue.
7838 Break out the floating-point parsing into a new
7839 function string_to_number, so that Fstring_to_number parses
7840 floating point numbers consistently with the Lisp reader.
04f2d78b 7841 (digit_to_number): Move here from data.c. Make it static inline.
452f4150
PE
7842 (E_CHAR, EXP_INT): Remove, replacing with ...
7843 (E_EXP): New macro, to solve the "1.0e+" problem mentioned below.
7844 (string_to_number): New function, replacing isfloat_string.
7845 This function checks for valid syntax and produces the resulting
7846 Lisp float number too. Rework it so that string-to-number
bc0a5c13 7847 no longer mishandles examples like "1.0e+". Use strtoumax,
d78050d6
PE
7848 so that overflow for non-base-10 numbers is reported only when
7849 there's no portable and simple way to convert to floating point.
452f4150 7850
67769ffc
PE
7851 * textprop.c (set_text_properties_1): Rewrite for clarity,
7852 and to avoid GCC warning about integer overflow.
7853
c20db43f
PE
7854 * intervals.h (struct interval): Use EMACS_INT for members
7855 where EMACS_UINT might cause problems. See
7856 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00514.html>.
7857 (CHECK_TOTAL_LENGTH): Remove cast to EMACS_INT; no longer needed.
7858 * intervals.c (interval_deletion_adjustment): Now returns EMACS_INT.
7859 All uses changed.
37aa2f85
PE
7860 (offset_intervals): Tell GCC not to worry about length overflow
7861 when negating a negative length.
c20db43f 7862
2538aa2f
PE
7863 * alloc.c (overrun_check_malloc, overrun_check_realloc): Now static.
7864 (overrun_check_free): Likewise.
7865
f2d3008d
PE
7866 * alloc.c (SDATA_SIZE) [!GC_CHECK_STRING_BYTES]: Avoid runtime check
7867 in the common case where SDATA_DATA_OFFSET is a multiple of Emacs
7868 word size.
7869
ec8df744
PE
7870 * gnutls.c: Fix problems found by GCC 4.6.0 on Ubuntu 10.10.
7871 (gnutls_make_error): Rename local to avoid shadowing.
7872 (gnutls_emacs_global_deinit): ifdef out; not used.
7873 (Fgnutls_boot): Use const for pointer to readonly storage.
7874 Comment out unused local. Fix pointer signedness problems.
7875
640ee02d
PE
7876 * lread.c (openp): Don't stuff size_t into an 'int'.
7877 Use <= on length, not < on length + 1, to avoid GCC 4.6.0 warning
7878 about possible signed overflow.
7879
6048fb2a
PE
7880 * gtkutil.c: Fix problems found by GCC 4.6.0 on Ubuntu 10.10.
7881 (GDK_KEY_g): Don't define if already defined.
7882 (xg_prepare_tooltip): Avoid pointer signedness problem.
7883 (xg_set_toolkit_scroll_bar_thumb): Redo to avoid two casts.
7884
fa3c87e1
PE
7885 * process.c (Fnetwork_interface_info): Avoid left-shift undefined
7886 behavior with 1 << 31. GCC 4.6.0 warns about this on 32-bit hosts.
7887
2172544b
PE
7888 * xfns.c (Fx_window_property): Simplify a bit,
7889 to make a bit faster and to avoid GCC 4.6.0 warning.
7890 * xselect.c (x_get_window_property, x_handle_dnd_message): Likewise.
7891
9b821a21
PE
7892 * fns.c (internal_equal): Don't assume size_t fits in int.
7893
3c616cfa
PE
7894 * alloc.c (compact_small_strings): Tighten assertion a little.
7895
c2982e87
PE
7896 Replace pEd with more-general pI, and fix some printf arg casts.
7897 * lisp.h (pI): New macro, generalizing old pEd macro to other
7898 conversion specifiers. For example, use "...%"pI"d..." rather
7899 than "...%"pEd"...".
7900 (pEd): Remove. All uses replaced with similar uses of pI.
61bdb816 7901 * m/amdx86-64.h, m/ia64.h, m/ibms390x.h: Likewise.
c2982e87
PE
7902 * alloc.c (check_pure_size): Don't overflow by converting size to int.
7903 * bidi.c (bidi_dump_cached_states): Use pI to avoid cast.
7904 * data.c (Fnumber_to_string): Use pI instead of if-then-else-abort.
7905 * dbusbind.c (xd_append_arg): Use pI to avoid cast.
7906 (Fdbus_method_return_internal, Fdbus_method_error_internal): Likewise.
7907 * font.c (font_unparse_xlfd): Avoid potential buffer overrun on
7908 64-bit hosts.
7909 (font_unparse_xlfd, font_unparse_fcname): Use pI to avoid casts.
7910 * keyboard.c (record_char, modify_event_symbol): Use pI to avoid casts.
7911 * print.c (safe_debug_print, print_object): Likewise.
7912 (print_object): Don't overflow by converting EMACS_INT or EMACS_UINT
7913 to int.
6f04d126
PE
7914 Use pI instead of if-then-else-abort. Use %p to avoid casts,
7915 avoiding the 0 flag, which is not portable.
c2982e87
PE
7916 * process.c (Fmake_network_process): Use pI to avoid cast.
7917 * region-cache.c (pp_cache): Likewise.
7918 * xdisp.c (decode_mode_spec): Likewise.
7919 * xrdb.c (x_load_resources) [USE_MOTIF]: Use pI to avoid undefined
7920 behavior on 64-bit hosts with printf arg.
6f04d126 7921 * xselect.c (x_queue_event): Use %p to avoid casts, avoiding 0 flag.
c2982e87
PE
7922 (x_stop_queuing_selection_requests): Likewise.
7923 (x_get_window_property): Don't truncate byte count to an 'int'
7924 when tracing.
0b432f21 7925
5e073ec7
PE
7926 * frame.c (frame_name_fnn_p): Get rid of strtol, which isn't right
7927 here, since it parses constructs like leading '-' and spaces,
7928 which are not wanted; and it overflows with large numbers.
7929 Instead, simply match F[0-9]+, which is what is wanted anyway.
7930
36372bf9
PE
7931 * alloc.c: Remove unportable assumptions about struct layout.
7932 (SDATA_SELECTOR, SDATA_DATA_OFFSET): New macros.
7933 (SDATA_OF_STRING, SDATA_SIZE, allocate_string_data):
7934 (allocate_vectorlike, make_pure_vector): Use the new macros,
7935 plus offsetof, to remove unportable assumptions about struct layout.
7936 These assumptions hold on all porting targets that I know of, but
7937 they are not guaranteed, they're easy to remove, and removing them
7938 makes further changes easier.
7939
0b432f21
PE
7940 * alloc.c (BLOCK BYTES): Fix typo by changing "ablock" to "ablocks".
7941 This doesn't fix a bug but makes the code clearer.
bfd1c781
PE
7942 (string_overrun_cookie): Now const. Use initializers that
7943 don't formally overflow signed char, to avoid warnings.
000098c1
PE
7944 (allocate_string_data) [GC_CHECK_STRING_OVERRUN]: Fix typo that
7945 can cause Emacs to crash when string overrun checking is enabled.
c7bda33c
PE
7946 (allocate_buffer): Don't assume sizeof (struct buffer) is a
7947 multiple of sizeof (EMACS_INT); it need not be, if
7948 alignof(EMACS_INT) < sizeof (EMACS_INT).
d0f4e1f5 7949 (check_sblock, check_string_bytes, check_string_free_list): Protoize.
0b432f21 7950
895009e1
JB
79512011-04-26 Juanma Barranquero <lekktu@gmail.com>
7952
7953 * keyboard.c (QCrtl): Rename from Qrtl. All uses changed.
7954
6a7a1b0b
TZ
79552011-04-26 Teodor Zlatanov <tzz@lifelogs.com>
7956
7957 * gnutls.c (emacs_gnutls_handshake): Return an error if we're not
b5f869a7 7958 supposed to be handshaking. (Bug#8556)
6a7a1b0b
TZ
7959 Reported by Paul Eggert <eggert@cs.ucla.edu>.
7960
841a1577 79612011-04-26 Daniel Colascione <dan.colascione@gmail.com>
0438ce91
DC
7962
7963 * lisp.h (Qdebug): List symbol.
895009e1 7964 * eval.c (Qdebug): Restore global linkage.
0438ce91
DC
7965 * keyboard.c (debug-on-event): New variable.
7966 (handle_user_signal): Break into debugger when debug-on-event
7967 matches the current signal symbol.
7968
f2d3ba6f
DN
79692011-04-25 Dan Nicolaescu <dann@ics.uci.edu>
7970
7971 * alloc.c (check_sblock, check_string_bytes)
7972 (check_string_free_list): Convert to standard C.
7973
42ce4c63
TZ
79742011-04-25 Teodor Zlatanov <tzz@lifelogs.com>
7975
7976 * w32.c (emacs_gnutls_push): Fix typo.
7977
825cd63c
EZ
79782011-04-25 Eli Zaretskii <eliz@gnu.org>
7979
fb11d64d
EZ
7980 * gnutls.c (emacs_gnutls_handshake): Avoid compiler warnings about
7981 "cast to pointer from integer of different size".
7982
825cd63c
EZ
7983 Improve doprnt and its use in verror. (Bug#8545)
7984 * doprnt.c (doprnt): Document the set of format control sequences
7985 supported by the function. Use SAFE_ALLOCA instead of always
7986 using `alloca'.
7987
7988 * eval.c (verror): Don't limit the buffer size at size_max-1, that
7989 is one byte too soon. Don't use xrealloc; instead xfree and
7990 xmalloc anew.
7991
e061a11b
TZ
79922011-04-24 Teodor Zlatanov <tzz@lifelogs.com>
7993
7994 * gnutls.h: Add GNUTLS_STAGE_CALLBACKS enum to denote we're in the
7995 callbacks stage.
7996
7997 * gnutls.c: Renamed global_initialized to
7998 gnutls_global_initialized. Added internals for the
7999 :verify-hostname-error, :verify-error, and :verify-flags
8000 parameters of `gnutls-boot' and documented those parameters in the
8001 docstring. Start callback support.
9173deec
JB
8002 (emacs_gnutls_handshake): Add Woe32 support. Retry handshake
8003 unless a fatal error occurred. Call gnutls_alert_send_appropriate
8004 on error. Return error code.
e061a11b
TZ
8005 (emacs_gnutls_write): Call emacs_gnutls_handle_error.
8006 (emacs_gnutls_read): Likewise.
8007 (Fgnutls_boot): Return handshake error code.
8008 (emacs_gnutls_handle_error): New function.
8009 (wsaerror_to_errno): Likewise.
8010
8011 * w32.h (emacs_gnutls_pull): Add prototype.
8012 (emacs_gnutls_push): Likewise.
8013
8014 * w32.c (emacs_gnutls_pull): New function for GnuTLS on Woe32.
8015 (emacs_gnutls_push): Likewise.
8016
80172011-04-24 Claudio Bley <claudio.bley@gmail.com> (tiny change)
8018
8019 * process.c (wait_reading_process_output): Check if GnuTLS
8020 buffered some data internally if no FDs are set for TLS
8021 connections.
8022
8023 * makefile.w32-in (OBJ2): Add gnutls.$(O).
8024 (LIBS): Link to USER_LIBS.
8025 ($(BLD)/gnutls.$(0)): New target.
8026
fa6996bc
EZ
80272011-04-24 Eli Zaretskii <eliz@gnu.org>
8028
eb35682e
EZ
8029 * xdisp.c (handle_single_display_spec): Rename the
8030 display_replaced_before_p argument into display_replaced_p, to
8031 make it consistent with the commentary. Fix typos in the
8032 commentary.
8033
e2ad650c
EZ
8034 * textprop.c (syms_of_textprop): Remove dead code.
8035 (copy_text_properties): Delete obsolete commentary about an
8036 interface that was deleted long ago. Fix typos in the description
8037 of arguments.
8038
1b2de274
EZ
8039 * msdos.c (XMenuActivate, XMenuAddSelection): Adjust argument list
8040 to changes in oldXMenu/XMenu.h from 2011-04-16.
8041 <menu_help_message, prev_menu_help_message>: Constify.
8042 (IT_menu_make_room): menu->help_text is now `const char **';
8043 adjust.
8044
8045 * msdos.h (XMenuActivate, XMenuAddSelection): Adjust prototypes
8046 to changes in oldXMenu/XMenu.h from 2011-04-16.
8047 (struct XMenu): Declare `help_text' `const char **'.
8048
8049 * xfaces.c <Qunspecified>: Make extern again.
8050
8051 * syntax.c: Include sys/types.h before including regex.h, as
8052 required by Posix.
8053
762b15be
EZ
8054 * doc.c (get_doc_string): Improve the format passed to `error'.
8055
8056 * doprnt.c (doprnt): Improve commentary.
8057
8058 * term.c (init_tty) [MSDOS]: Fix 1st argument to maybe_fatal.
8059
8060 * Makefile.in (TAGS): Depend on $(M_FILE) and $(S_FILE), and scan
8061 them with etags.
8062
f1052e5d
EZ
8063 * makefile.w32-in (globals.h): Add a dummy recipe, to make any
8064 changes in globals.h immediately force recompilation.
762b15be
EZ
8065 (TAGS): Depend on $(CURDIR)/m/intel386.h and
8066 $(CURDIR)/s/ms-w32.h.
8067 (TAGS-gmake): Scan $(CURDIR)/m/intel386.h and $(CURDIR)/s/ms-w32.h.
f1052e5d 8068
fa6996bc
EZ
8069 * character.c (Fchar_direction): Function deleted.
8070 (syms_of_character): Don't defsubr it.
8071 <char-direction-table>: Deleted.
8072
e6c3da20
EZ
80732011-04-23 Eli Zaretskii <eliz@gnu.org>
8074
8075 Fix doprnt so it could be used again safely in `verror'. (Bug#8435)
8076 * doprnt.c: Include limits.h.
8077 (SIZE_MAX): New macro.
04f2d78b
CB
8078 (doprnt): Return a size_t value. 2nd arg is now size_t.
8079 Many local variables are now size_t instead of int or unsigned.
e6c3da20
EZ
8080 Improve overflow protection. Support `l' modifier for integer
8081 conversions. Support %l conversion. Don't assume an EMACS_INT
8082 argument for integer conversions and for %c.
8083
8084 * lisp.h (doprnt): Restore prototype.
8085
8086 * makefile.w32-in ($(BLD)/callint.$(O)): Depend on
8087 $(SRC)/character.h.
8088
8089 * Makefile.in (base_obj): Add back doprnt.o.
8090
8091 * deps.mk (doprnt.o): Add back prerequisites.
8092 (callint.o): Depend on character.h.
8093
8094 * eval.c (internal_lisp_condition_case): Include the handler
8095 representation in the error message.
8096 (verror): Call doprnt instead of vsnprintf. Fix an off-by-one bug
8097 when breaking from the loop.
8098
8099 * xdisp.c (vmessage): Call doprnt instead of vsnprintf.
8100
8101 * callint.c (Fcall_interactively): When displaying error message
8102 about invalid control letter, pass the character's codepoint, not
8103 a pointer to its multibyte form. Improve display of the character
8104 in octal and display also its hex code.
8105
8106 * character.c (char_string): Use %x to display the (unsigned)
8107 codepoint of an invalid character, to avoid displaying a bogus
8108 negative value.
8109
8110 * font.c (check_otf_features): Pass SDATA of SYMBOL_NAME to
8111 `error', not SYMBOL_NAME itself.
8112
8113 * coding.c (Fencode_sjis_char, Fencode_big5_char): Use %c for
8114 character arguments to `error'.
8115
8116 * charset.c (check_iso_charset_parameter): Fix incorrect argument
8117 to `error' in error message about FINAL_CHAR argument. Make sure
8118 FINAL_CHAR is a character, and use %c when it is passed as
8119 argument to `error'.
8120
4ffd0d6b 81212011-04-23 Eli Zaretskii <eliz@gnu.org>
97a93095
EZ
8122
8123 * s/ms-w32.h (localtime): Redirect to sys_localtime.
8124
8125 * w32.c: Include <time.h>.
8126 (sys_localtime): New function.
8127
4ffd0d6b 81282011-04-23 Chong Yidong <cyd@stupidchicken.com>
c17819f4
CY
8129
8130 * xdisp.c (init_xdisp): Initialize echo_area_window (Bug#6451).
8131
4ffd0d6b 8132 * buffer.c (syms_of_buffer): Doc fix (Bug#6902).
aac0c6e3 8133
4ffd0d6b 81342011-04-23 Samuel Thibault <sthibault@debian.org> (tiny change)
aac0c6e3 8135
4ffd0d6b
GM
8136 * sysdep.c (wait_for_termination): On GNU Hurd, kill returns -1 on
8137 zombies (Bug#8467).
aac0c6e3 8138
04c56954
EZ
81392011-04-19 Eli Zaretskii <eliz@gnu.org>
8140
8141 * syntax.h (SETUP_SYNTAX_TABLE_FOR_OBJECT): Fix setting of
8142 gl_state.e_property when gl_state.object is Qt.
8143
8144 * insdel.c (make_gap_larger): Remove limitation of buffer size
8145 to <= INT_MAX.
8146
16a43933
CY
81472011-04-18 Chong Yidong <cyd@stupidchicken.com>
8148
8149 * xdisp.c (lookup_glyphless_char_display)
8150 (produce_glyphless_glyph): Handle cons cell entry in
8151 glyphless-char-display.
8152 (Vglyphless_char_display): Document it.
8153
8154 * term.c (produce_glyphless_glyph): Handle cons cell entry in
8155 glyphless-char-display.
8156
4581706e
CY
81572011-04-17 Chong Yidong <cyd@stupidchicken.com>
8158
8159 * xdisp.c (get_next_display_element): Remove unnecessary ifdefs.
8160
8161 * termhooks.h (FRAME_WINDOW_P): Remove duplicated definitions.
8162
8163 * dispextern.h (FACE_SUITABLE_FOR_ASCII_CHAR_P): Add missing
8164 definition for no-X builds.
8165
4887c6e2 81662011-04-16 Paul Eggert <eggert@cs.ucla.edu>
764430a3 8167
fd35b6f9
PE
8168 Static checks with GCC 4.6.0 and non-default toolkits.
8169
5c1ccb01
PE
8170 * s/sol2-6.h, s/unixware.h (PTY_TTY_NAME_SPRINTF): Protoize decl.
8171
006c5daa
PE
8172 * process.c (keyboard_bit_set): Define only if SIGIO.
8173 (send_process_trap): Mark it with NO_RETURN if it doesn't return.
8174 (send_process): Repair possible setjmp clobbering.
8175
efc736d3
PE
8176 * s/usg5-4-common.h (SETUP_SLAVE_PTY): Don't pass extra arg to 'fatal'.
8177
4e2fe2e6
PE
8178 * eval.c: Include <stdio.h>, for vsnprintf on non-GNU/Linux hosts.
8179
f97334a2
PE
8180 * data.c (arith_error): Mark with NO_RETURN if it doesn't return.
8181
4e75f29d
PE
8182 * alloc.c (bytes_used_when_full, SPARE_MEMORY, BYTES_USED):
8183 Define only if needed.
8184
90efadd1
PE
8185 * sysdep.c (_FILE_OFFSET_BITS): Make this hack even uglier
8186 by pacifying GCC about it. Maybe it's time to retire it?
875975e9 8187 * xfaces.c (USG, __TIMEVAL__): Likewise.
90efadd1 8188
3c647824
PE
8189 * dispextern.h (struct redisplay_interface): Rename param
8190 to avoid shadowing.
e264f262 8191 * termhooks.h (struct terminal): Likewise.
761383f4 8192 * xterm.c (xembed_send_message): Likewise.
3c647824 8193
b58c5c4a
PE
8194 * insdel.c (make_gap_smaller): Define only if
8195 USE_MMAP_FOR_BUFFERS || REL_ALLOC || DOUG_LEA_MALLOC.
8196
cad59032
PE
8197 * keyboard.c (read_char): Make a var volatile so longjmp won't clobber
8198 it.
8199
c339dc2e
PE
8200 * emacs.c (MAX_HEAP_BSS_DIFF, my_edata): Move to where they're used,
8201 so that we aren't warned about unused symbols.
8202
91a3e27b
PE
8203 * xfns.c (Fx_file_dialog): Rename local to avoid shadowing.
8204
399c71d3 8205 * xdisp.c (x_produce_glyphs): Mark var as initialized (Bug#8512).
7a3fb125 8206
8ffc96f5
PE
8207 * xfns.c (x_real_positions): Mark locals as initialized.
8208
eef9bc79
PE
8209 * xmenu.c (xmenu_show): Don't use uninitialized vars.
8210
098db9dd
PE
8211 * xterm.c: Fix problems found by static analysis with other toolkits.
8212 (toolkit_scroll_bar_interaction): Define and use only if USE_X_TOOLKIT.
dda3aedd
PE
8213 (x_dispatch_event): Declare static if USE_GTK, and
8214 define if USE_GTK || USE_X_TOOLKIT.
098db9dd 8215 (SET_SAVED_BUTTON_EVENT): Define only if USE_X_TOOLKIT || USE_GTK.
dda3aedd 8216 * xterm.h (x_dispatch_event): Extern only if USE_X_TOOLKIT.
841a1577
JB
8217 * xterm.c, xterm.h (x_mouse_leave): Bring this function back, but only
8218 if defined HAVE_MENUS && !defined USE_X_TOOLKIT && !defined USE_GTK.
098db9dd 8219
eb18f6cc
PE
8220 * xmenu.c (menu_help_callback): Pointer type fixes.
8221 Use const pointers when pointing at readonly data. Avoid pointer
8222 signedness clashes.
8223 (FALSE): Remove unused macro.
8224 (update_frame_menubar): Remove unused decl.
8225
1fe72bf8
PE
8226 * xfns.c (Fx_hide_tip): Move locals to avoid shadowing.
8227
60d9e1db
PE
8228 * menu.c (push_submenu_start, push_submenu_end): Do not define unless
8229 USE_X_TOOLKIT || USE_GTK || HAVE_NS || defined HAVE_NTGUI.
8230 (single_menu_item): Rename local to avoid shadowing.
8231
39261c26
PE
8232 * keyboard.c (make_lispy_event): Remove unused local var.
8233
018c5e19
PE
8234 * frame.c, frame.h (x_get_resource_string): Bring this back, but
8235 only if HAVE_X_WINDOWS && !USE_X_TOOLKIT.
8236
63d2b86e
PE
8237 * bitmaps: Change bitmaps from unsigned char back to the X11
8238 compatible char. Avoid the old compiler warnings about
8239 out-of-range initializers by using, for example, '\xab' rather
8240 than 0xab.
8241
aefd87e1
PE
8242 * xgselect.c (xgselect_initialize): Check vs interface
8243 even if ! (defined (USE_GTK) || defined (HAVE_GCONF)).
8244
bf501fb9
PE
8245 * xmenu.c (xmenu_show): Rename parm to avoid shadowing.
8246
e9829fdf
PE
8247 * xterm.c (x_create_toolkit_scroll_bar): Use const * for pointers
8248 to read-only memory.
8249
1086c095
PE
8250 * fns.c (vector): Remove; this old hack is no longer needed.
8251
2baccd04 8252 * xsmfns.c (create_client_leader_window): Rename shadowing arg.
401f10cb 8253 Remove unused var.
dde42981 8254 (gdk_x11_set_sm_client_id) [!USE_GTK]: Don't define.
2baccd04 8255
72391843 8256 * xrdb.c (x_load_resources): Omit unused local.
3565b346 8257
436c16df 8258 * xfns.c (free_frame_menubar, atof): Remove duplicate decls.
8a94ea33 8259 (x_window): Rename locals to avoid shadowing.
dc5ddd85 8260 (USG): Use the kludged USG macro, to pacify gcc.
436c16df 8261
92bb796d 8262 * xterm.c (x_alloc_nearest_color_for_widget): Remove; unused.
bbbef9e1 8263 (x_term_init): Remove local to avoid shadowing.
92bb796d 8264
764430a3 8265 * xfns.c, xterm.c (_XEditResCheckMessages): Protoize decl.
4887c6e2
PE
8266
8267 * xdisp.c, dispextern.h (set_vertical_scroll_bar): Now extern if
8268 USE_TOOLKIT_SCROLL_BARS && !USE_GTK, as xterm.c needs it then.
8269
d1dfb56c
EZ
82702011-04-16 Eli Zaretskii <eliz@gnu.org>
8271
c4354cb4
EZ
8272 * gnutls.c (Fgnutls_boot): Don't pass Lisp_Object to `error'.
8273
d1dfb56c
EZ
8274 Fix regex.c, syntax.c and friends for buffers > 2GB.
8275 * syntax.h (struct gl_state_s): Declare character position members
8276 EMACS_INT.
8277
8278 * syntax.c (update_syntax_table): Declare 2nd argument EMACS_INT.
8279
04f2d78b
CB
8280 * textprop.c (verify_interval_modification, interval_of):
8281 Declare arguments EMACS_INT.
d1dfb56c
EZ
8282
8283 * intervals.c (adjust_intervals_for_insertion): Declare arguments
8284 EMACS_INT.
8285
8286 * intervals.h (CHECK_TOTAL_LENGTH): Cast to EMACS_INT, not `int'.
8287
8288 * indent.c (Fvertical_motion): Local variable it_start is now
8289 EMACS_INT.
8290
8291 * regex.c (re_match, re_match_2, re_match_2_internal)
8292 (bcmp_translate, regcomp, regexec, print_double_string)
8293 (group_in_compile_stack, re_search, re_search_2, regex_compile)
8294 (re_compile_pattern, re_exec): Declare arguments and local
8295 variables `size_t' and `ssize_t' and return values `regoff_t', as
8296 appropriate.
8297 (POP_FAILURE_REG_OR_COUNT) <pfreg>: Declare `long'.
8298 (CHECK_INFINITE_LOOP) <failure>: Declare `ssize_t'.
8299 <compile_stack_type>: `size' and `avail' are now `size_t'.
8300
8301 * regex.h <regoff_t>: Use ssize_t, not int.
8302 (re_search, re_search_2, re_match, re_match_2): Arguments that
8303 specify buffer/string position and length are now ssize_t and
8304 size_t. Return type is regoff_t.
8305
613052cd
BK
83062011-04-16 Ben Key <bkey76@gmail.com>
8307
8308 * nsfont.m: Fixed bugs in ns_get_family and
8309 ns_descriptor_to_entity that were caused by using free to
8310 deallocate memory blocks that were allocated by xmalloc (via
8311 xstrdup). This caused Emacs to crash when compiled with
8312 XMALLOC_OVERRUN_CHECK defined (when Emacs was configured with
8313 --enable-checking=xmallocoverrun). xfree is now used to
8314 deallocate these memory blocks.
8315
4170f62f 83162011-04-15 Paul Eggert <eggert@cs.ucla.edu>
3e047f51 8317
71b41406
PE
8318 * sysdep.c (emacs_read): Remove unnecessary check vs MAX_RW_COUNT.
8319
9587a89d
PE
8320 emacs_write: Accept and return EMACS_INT for sizes.
8321 See http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00514.html
8322 et seq.
8323 * gnutls.c, gnutls.h (emacs_gnutls_read, emacs_gnutls_write):
8324 Accept and return EMACS_INT.
8325 (emacs_gnutls_write): Return the number of bytes written on
8326 partial writes.
8327 * sysdep.c, lisp.h (emacs_read, emacs_write): Likewise.
273a5f82
PE
8328 (emacs_read, emacs_write): Remove check for negative size, as the
8329 Emacs source code has been audited now.
9587a89d
PE
8330 * sysdep.c (MAX_RW_COUNT): New macro, to work around kernel bugs.
8331 (emacs_read, emacs_write): Use it.
273a5f82
PE
8332 * process.c (send_process): Adjust to the new signatures of
8333 emacs_write and emacs_gnutls_write. Do not attempt to store
8334 a byte offset into an 'int'; it might overflow.
9587a89d 8335 See http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00483.html
273a5f82 8336
3e047f51
PE
8337 * sound.c: Don't assume sizes fit in 'int'.
8338 (struct sound_device.period_size, alsa_period_size):
9c3c56a7 8339 Return EMACS_INT, not int.
3e047f51 8340 (struct sound_device.write, vox_write, alsa_write):
9c3c56a7
PE
8341 Accept EMACS_INT, not int.
8342 (wav_play, au_play): Use EMACS_INT to store sizes and to
3e047f51
PE
8343 record read return values.
8344
cc39a9db
BK
83452011-04-15 Ben Key <bkey76@gmail.com>
8346
c9d0ec6d
JB
8347 * keyboard.c (Qundefined): Don't declare static since it is used
8348 in nsfns.m.
8349 * xfaces.c (Qbold, Qexpanded, Qitalic, Qcondensed): Don't declare
8350 static since they are used in nsfont.m.
cc39a9db 8351
6c60eb9f
SM
83522011-04-15 Stefan Monnier <monnier@iro.umontreal.ca>
8353
8354 * process.c (Qprocessp): Don't declare static.
8355 * lisp.h (Qprocessp): Declare again.
8356
7990b61a
JB
83572011-04-15 Juanma Barranquero <lekktu@gmail.com>
8358
8359 * font.c (Qopentype): Don't make static (used from w32uniscribe.c).
8360
5d4cb038
PE
83612011-04-14 Paul Eggert <eggert@cs.ucla.edu>
8362
8bd7b830 8363 Improve C-level modularity by making more things 'static'.
cd64ea1d 8364
e3b27b31
PE
8365 Don't publish debugger-only interfaces to other modules.
8366 * lisp.h (safe_debug_print, debug_output_compilation_hack):
8367 (verify_bytepos, count_markers): Move decls to the only modules
8368 that need them.
8369 * region-cache.h (pp_cache): Likewise.
8370 * window.h (check_all_windows): Likewise.
8371 * marker.c, print.c, region-cache.c, window.c: Decls moved here.
8372
5d4cb038
PE
8373 * sysdep.c (croak): Now static, if
8374 defined TIOCNOTTY || defined USG5 || defined CYGWIN.
8375 * syssignal.h (croak): Declare only if not static.
69003fd8
PE
8376
8377 * alloc.c (refill_memory_reserve): Now static if
8378 !defined REL_ALLOC || defined SYSTEM_MALLOC.
8379 * lisp.h (refill_memory_reserve): Declare only if not static.
93ea6e8f 8380
e87b6180
PE
8381 * xsettings.c, xsettings.h (xsettings_get_system_normal_font):
8382 Define only if USE_LUCID.
8383
ac64929e
PE
8384 * xrdb.c (x_customization_string, x_rm_string): Now static.
8385
6f37259d
PE
8386 * xmenu.c (x_menu_wait_for_event): Export only if USE_MOTIF.
8387 * xterm.h (x_menu_wait_for_event): Declare only if USE_MOTIF.
8388
1683e3ab
PE
8389 * xdisp.c (draw_row_with_mouse_face): Now static.
8390 * dispextern.h (draw_row_with_mouse_fave): Remove decl.
8391
de9c2632
PE
8392 * window.h (check_all_windows): Mark externally visible.
8393
2b96acb7
PE
8394 * window.c (window_deletion_count): Now static.
8395
8396 * undo.c: Make symbols static if they're not exported.
8397 (last_undo_buffer, last_boundary_position, pending_boundary):
8398 Now static.
8399
50436f33
PE
8400 * textprop.c (interval_insert_behind_hooks): Now static.
8401 (interval_insert_in_front_hooks): Likewise.
8402
64520e5c
PE
8403 * term.c: Make symbols static if they're not exported.
8404 (tty_turn_off_highlight, get_tty_terminal, max_frame_cols):
8405 (max_frame_lines, tty_set_terminal_modes):
8406 (tty_reset_terminal_modes, tty_turn_off_highlight):
8407 (get_tty_terminal): Now static.
8408 (term_mouse_moveto): Do not define if HAVE_WINDOW_SYSTEM.
8409 * termhooks.h (term_mouse_moveto): Do not declare if
8bd7b830 8410 HAVE_WINDOW_SYSTEM.
64520e5c
PE
8411 * dispextern.h (tty_set_terminal_modes, tty_reset_terminal_modes):
8412 (tty_turn_off_highlight, get_tty_terminal): Remove decls.
8413
1fa53021
PE
8414 * sysdep.c: Make symbols static if they're not exported.
8415 (emacs_get_tty, emacs_set_tty, old_fcntl_flags, old_fcntl_owner):
8416 Now static.
8417 (sigprocmask_set, full_mask): Remove; unused.
8418 (wait_debugging): Mark as visible.
8419 * syssignal.h (SIGFULLMASK, full_mask): Remove decls.
8420 * systty.h (emacs_get_tty, emacs_set_tty): Remove decls.
8421
d4b43b22
PE
8422 * syntax.c (syntax_temp): Define only if !__GNUC__.
8423
b7c513d0
PE
8424 * sound.c (current_sound_device, current_sound): Now static.
8425
989b29ad
PE
8426 * search.c (searchbufs, searchbuf_head): Now static.
8427
13a55a78
PE
8428 * scroll.c (scroll_cost): Remove; unused.
8429 * dispextern.h (scroll_cost): Remove decl.
8430
de68a1fc
PE
8431 * region-cache.h (pp_cache): Mark as externally visible.
8432
40ccffa6
PE
8433 * process.c: Make symbols static if they're not exported.
8434 (process_tick, update_tick, create_process, chan_process):
8435 (Vprocess_alist, proc_buffered_char, datagram_access):
8436 (fd_callback_data, send_process_frame, process_sent_to): Now static.
8437 (deactivate_process): Mark defn as static, as well as decl.
8438 * lisp.h (create_process): Remove decl.
8439 * process.h (chan_process, Vprocess_alist): Remove decls.
8440
ad64fc97
PE
8441 * print.c: Make symbols static if they're not exported.
8442 (print_depth, new_backquote_output, being_printed, print_buffer):
8443 (print_buffer_size, print_buffer_pos, print_buffer_pos_byte):
8444 (print_interval, print_number_index, initial_stderr_stream):
8445 Now static.
8446 * lisp.h (Fprinc): Remove decl.
8447 (debug_output_compilation_hack): Mark as externally visible.
8448
adddb265
PE
8449 * sysdep.c (croak): Move decl from here to syssignal.h.
8450 * syssignal.h (croak): Put it here, so the API can be checked when
8451 'croak' is called from dissociate_if_controlling_tty.
8452
1717ede2
PE
8453 * minibuf.c: Make symbols static if they're not exported.
8454 (minibuf_save_list, choose_minibuf_frame): Now static.
8455 * lisp.h (choose_minibuf_frame): Remove decl.
8456
fa5fb2bc
PE
8457 * lisp.h (verify_bytepos, count_markers): Mark as externally visible.
8458
1e3890d1
PE
8459 * lread.c: Make symbols static if they're not exported.
8460 (read_objects, initial_obarray, oblookup_last_bucket_number):
8461 Now static.
8462 (make_symbol): Remove; unused.
8463 * lisp.h (initial_obarray, make_symbol): Remove decls.
8464
8a1414fa
PE
8465 * keyboard.c: Make symbols static if they're not exported.
8466 (single_kboard, recent_keys_index, total_keys, recent_keys):
8467 (this_command_key_count_reset, raw_keybuf, raw_keybuf_count):
8468 (this_single_command_key_start, echoing, last_auto_save):
8469 (read_key_sequence_cmd, dribble, recursive_edit_unwind):
8470 (command_loop, echo_now, keyboard_init_hook, help_char_p):
8471 (quit_throw_to_read_char, command_loop_2, top_level_1, poll_timer):
8472 (Vlispy_mouse_stem, double_click_count):
8473 Now static.
8474 (force_auto_save_soon): Define only if SIGDANGER.
8475 (ignore_mouse_drag_p): Now static if
8476 !defined HAVE_WINDOW_SYSTEM || defined USE_GTK || defined HAVE_NS.
8477 (print_help): Remove; unused.
8478 (stop_character, last_timer_event): Mark as externally visible.
8479 * keyboard.h (ignore_mouse_drag_p): Declare only if
8480 defined HAVE_WINDOW_SYSTEM && !defined USE_GTK && !defined HAVE_NS.
8481 (echo_now, help_char_p, quit_throw_to_read_char): Remove decls.
8482 * lisp.h (echoing): Remove decl.
8483 (force_auto_save_soon): Declare only if SIGDANGER.
8484 * xdisp.c (redisplay_window): Simplify code, to make it more
8485 obvious that ignore_mouse_drag_p is not accessed if !defined
8486 USE_GTK && !defined HAVE_NS.
8487
93ea6e8f
PE
8488 * intervals.c: Make symbols static if they're not exported.
8489 (merge_properties_sticky, merge_interval_right, delete_interval):
8490 Now static.
8491 * intervals.h (merge_interval_right, delete_interval): Remove decls.
8492
77382fcc
PE
8493 * insdel.c: Make symbols static if they're not exported.
8494 However, leave prepare_to_modify_buffer alone. It's never
8495 called from outside this function, but that appears to be a bug.
8496 (combine_after_change_list, combine_after_change_buffer):
4889fc82 8497 (adjust_after_replace, signal_before_change): Now static.
77382fcc
PE
8498 (adjust_after_replace_noundo): Remove; unused.
8499 * lisp.h (adjust_after_replace, adjust_after_replace_noundo):
4889fc82 8500 (signal_before_change): Remove decls.
77382fcc 8501
9306c32e
PE
8502 * indent.c (val_compute_motion, val_vmotion): Now static.
8503
cd44d2eb
PE
8504 * image.c: Make symbols static if they're not exported.
8505 * dispextern.h (x_create_bitmap_from_xpm_data): Do not declare
8506 if USE_GTK.
8507 * image.c (x_create_bitmap_from_xpm_data): Do not define if USE_GTK.
8508 (xpm_color_cache, ct_table, ct_colors_allocated): Now static.
8509
ad9a7a06
PE
8510 * fringe.c (standard_bitmaps): Now static.
8511 (max_used_fringe_bitmap): Now static, unless HAVE_NS.
8512
81626931
PE
8513 * frame.c: Make symbols static if they're not exported.
8514 (x_report_frame_params, make_terminal_frame): Now static.
8515 (get_frame_param): Now static, unless HAVE_NS.
8516 (x_fullscreen_adjust): Define if WINDOWSNT, not if HAVE_WINDOW_SYSTEM.
8517 (x_get_resource_string): Remove; not used.
8518 * frame.h (make_terminal_frame, x_report_frame_params):
8519 (x_get_resource_string); Remove decls.
8520 (x_fullscreen_adjust): Declare only if WINDOWSNT.
8521 * lisp.h (get_frame_param): Declare only if HAVE_NS.
8522
239f9db9
PE
8523 * font.c, fontset.c: Make symbols static if they're not exported.
8524 * dispextern.h (FACE_SUITABLE_FOR_ASCII_CHAR_P): New macro.
8525 (FACE_SUITABLE_FOR_CHAR_P): Use it.
8526 * font.c (font_close_object): Now static.
8527 * font.h (font_close_object): Remove.
8528 * fontset.c (FONTSET_OBJLIST): Remove.
8529 (free_realized_fontset) #if-0 the body, which does nothing.
8530 (face_suitable_for_char_p): #if-0, as it's never called.
8531 * fontset.h (face_suitable_for_char_p): Remove decl.
04f2d78b
CB
8532 * xfaces.c (face_at_string_position):
8533 Use FACE_SUITABLE_FOR_ASCII_CHAR_P, not FACE_SUITABLE_FOR_CHAR_P,
239f9db9
PE
8534 since 0 is always ASCII.
8535
dfcf3579
PE
8536 * fns.c (weak_hash_tables): Now static.
8537
5045092b
PE
8538 * fileio.c: Make symbols static if they're not exported.
8539 (auto_saving, auto_save_mode_bits, auto_save_error_occurred):
8540 (Vwrite_region_annotation_buffers): Now static.
8541
57a96f5c
PE
8542 * eval.c: Make symbols static if they're not exported.
8543 (backtrace_list, lisp_eval_depth, when_entered_debugger): Now static.
8544 * lisp.h (backtrace_list): Remove decl.
8545
35f08c38
PE
8546 * emacs.c: Make symbols static if they're not exported.
8547 (malloc_state_ptr, malloc_using_checking, syms_of_emacs):
8548 (fatal_error_code, fatal_error_signal_hook, standard_args):
8549 Now static.
8550 (fatal_error_signal): Now static, unless FLOAT_CATCH_SIGKILL.
8551 (DEFINE_DUMMY_FUNCTION): Mark function as externally visible.
8552 (__CTOR_LIST__, __DTOR_LIST__): Now externally visible.
8553 * lisp.h (fatal_error_signal_hook): Remove decl.
8554 (fatal_error_signal): Declare only if FLOAT_CATCH_SIGKILL.
8555
f44bd759
PE
8556 * editfns.c: Move a (normally-unused) function to its only use.
8557 * editfns.c, lisp.h (get_operating_system_release): Remove.
8558 * process.c (init_process) [DARWIN_OS]: Do it inline, as it is not
8559 worth the hassle of breaking this out.
8560
b532497d
PE
8561 * xterm.c: Make symbols static if they're not exported.
8562 (x_raise_frame, x_lower_frame, x_wm_set_window_state):
8563 (x_wm_set_icon_pixmap, x_initialize, XTread_socket_fake_io_error):
8564 (x_destroy_window, x_delete_display):
8565 Now static.
8566 (x_dispatch_event): Now static if ! (USE_MOTIF || USE_X_TOOLKIT).
8567 (x_mouse_leave): Remove; unused.
8568 * xterm.h (x_display_info_for_name, x_raise_frame, x_lower_frame):
8569 (x_destroy_window, x_wm_set_window_state, x_wm_set_icon_pixmap):
8570 (x_delete_display, x_initialize, x_set_border_pixel, x_screen_planes):
8571 Remove decls.
8572 (x_mouse_leave): Declare only if WINDOWSNT.
8573 (x_dispatch_event): Declare only if USE_MOTIF or USE_X_TOOLKIT.
8574 (xic_create_fontsetname): Declare only if HAVE_X_WINDOWS &&
8575 USE_X_TOOLKIT.
8576
1675728f
PE
8577 * ftxfont.c: Make symbols static if they're not exported.
8578 (ftxfont_driver): Export only if !defined HAVE_XFT && def8ined
8579 HAVE_FREETYPE.
8580 * font.h (ftxfont_driver): Likewise.
8581
e4cebfca
PE
8582 * xfns.c: Make symbols static if they're not exported.
8583 (x_last_font_name, x_display_info_for_name):
8584 (x_set_foreground_color, x_set_background_color, x_set_mouse_color):
8585 (x_set_cursor_color, x_set_border_pixel, x_set_border_color):
8586 (x_set_cursor_type, x_set_icon_type, x_set_icon_name):
8587 (x_set_scroll_bar_foreground, x_set_scroll_bar_background):
8588 (x_explicitly_set_name, x_set_title, xic_defaut_fontset, tip_timer):
8589 (last_show_tip_args): Now static.
8590 (xic_defaut_fontset, xic_create_fontsetname): Define only if
8591 defined HAVE_X_WINDOWS && defined USE_X_TOOLKIT
8592 (x_screen_planes): Remove; unused.
8593 * dispextern.h (x_screen_planes): Remove decl.
8594
5bf46f05
PE
8595 * dispnew.c: Make symbols static if they're not exported.
8596 * dispextern.h (redraw_garbaged_frames, scrolling):
8597 (increment_row_positions): Remove.
8598 * dispnew.c (new_glyph_matrix, increment_row_positions, scrolling):
8599 (delayed_size_change, glyph_matrix_count, glyph_pool_count):
8600 Now static.
8601 (redraw_garbaged_frames): Remove; unused.
8602
435f4c28
PE
8603 * xfaces.c: Make symbols static if they're not exported.
8604 * dispextern.h (ascii_face_of_lisp_face, free_realized_face):
8605 Remove decls.
8606 * xterm.h (defined_color): Remove decls.
8607 (x_free_dpy_colors): Declare only if USE_X_TOOLKIT.
8608 * xfaces.c (tty_suppress_bold_inverse_default_colors_p):
8609 (menu_face_changed_default, defined_color, free_realized_face):
8610 (x_free_dpy_colors): Define only if USE_X_TOOLKIT.
8611 (ascii_face_of_lisp_face): Remove; unused.
8612
8524aef3
PE
8613 * xdisp.c: Make symbols static if they're not exported.
8614 * dispextern.h (scratch_glyph_row, window_box_edges):
8615 (glyph_to_pixel_coords, set_cursor_from_row):
8616 (get_next_display_element, set_iterator_to_next):
8617 (highlight_trailing_whitespace, frame_to_window_pixel_xy):
8618 (show_mouse_face): Remove decls
8619 * frame.h (message_buf_print): Likewise.
8620 * lisp.h (pop_message, set_message, check_point_in_composition):
8621 Likewise.
8622 * xterm.h (set_vertical_scroll_bar): Likewise.
8623 * xdisp.c (list_of_error, Vmessage_stack, line_number_displayed):
8624 (message_buf_print, scratch_glyph_row, displayed_buffer):
8625 (set_iterator_to_next, pop_message, set_message, set_cursor_from_row):
8626 (get_next_display_element, show_mouse_face, window_box_edges):
8627 (frame_to_window_pixel_xy, check_point_in_composition):
8628 (set_vertical_scroll_bar, highlight_trailing_whitespace): Now static.
8629 (glyph_to_pixel_coords): Remove; unused.
8630
16390cd2
PE
8631 * dired.c (file_name_completion): Now static.
8632
8633 * dbusbind.c (xd_in_read_queued_messages): Now static.
8634
a25f4dfa
PE
8635 * lisp.h (circular_list_error, FOREACH): Remove; unused.
8636 * data.c (circular_list_error): Remove.
8637
14a9c8df
PE
8638 * commands.h (last_point_position, last_point_position_buffer):
8639 (last_point_position_window): Remove decls.
8640 * keyboard.c: Make these variables static.
8641
04f2d78b
CB
8642 * coding.h (coding, code_convert_region, encode_coding_gap):
8643 Remove decls.
74ab6df5
PE
8644 * coding.c (Vsjis_coding_system, Vbig5_coding_system):
8645 (iso_code_class, detect_coding, code_convert_region): Now static.
8646 (encode_coding_gap): Remove; unused.
8647
38dfbee1
PE
8648 * chartab.c (chartab_chars, chartab_bits): Now static.
8649
a2cb4e63
PE
8650 * charset.h (charset_iso_8859_1): Remove decl.
8651 * charset.c (charset_iso_8859_1, charset_emacs, map_charset_for_dump):
8652 Now static.
8653
127198fd
PE
8654 * ccl.h (check_ccl_update, Vccl_program_table): Remove decls.
8655 * ccl.c (Vccl_program_table): Now static.
8656 (check_ccl_update): Remove; unused.
8657
d85b608f
PE
8658 * category.c (SET_CATEGORY_SET, set_category_set): Move here.
8659 * category.h: ... from here.
8660 * category.c (check_category_table, set_category_set): Now static.
8661
31cd66f3
PE
8662 * casetab.c (Vascii_upcase_table, Vascii_eqv_table): Now static.
8663 * lisp.h: Remove these decls.
8664
c358e587
PE
8665 * buffer.c (buffer_count): Remove unused var.
8666
e78aecca
PE
8667 * bidi.c (bidi_dump_cached_states): Mark as externally visible,
8668 so that it's not optimized away.
8669 (bidi_ignore_explicit_marks_for_paragraph_level): Likewise.
8670 * dispextern.h (bidi_dump_cached_states): Remove, since it's
8671 exported only to the debugger.
8672
e192d7d3 8673 * atimer.c (alarm_signal_handler, run_all_atimers): Now static.
04f2d78b 8674 * atimer.h (run_all_atimers): Remove; not exported.
e192d7d3 8675
92470028
PE
8676 font.c: Make copy_font_spec and merge_font_spec ordinary C functions.
8677 * font.c (copy_font_spec): Rename from Fcopy_font_spec, since it
8678 was inaccessible from Lisp.
8679 (merge_font_spec): Likewise, renaming from Fmerge_font_spec.
8680 * font.c, font.h, fontset.c, xfaces.c, xfont.c: Change all uses.
8681
244ed907
PE
8682 alloc.c: Import and export fewer symbols, and remove unused items.
8683 * lisp.h (suppress_checking, die): Declare only if ENABLE_CHECKING
8684 is defined.
8685 (suppress_checking): Add EXTERNALLY_VISIBLE attribute, so that
8686 it's not optimized away by whole-program optimization.
8687 (message_enable_multibyte, free_misc): Remove.
8688 (catchlist, handlerlist, mark_backtrace):
8689 Declare only if BYTE_MARK_STACK.
8690 (mark_byte_stack): Likewise, fixing a ifdef-vs-if typo.
8691 * alloc.c (pure): Export only if VIRT_ADDR_VARIES is defined.
8692 (message_enable_multibyte): Remove decl.
8693 (free_misc, interval_free_list, float_block, float_block_index):
8694 (n_float_blocks, float_free_list, cons_block, cons_block_index):
8695 (cons_free_list, last_marked_index):
8696 Now static.
8697 (suppress_checking, die): Define only if ENABLE_CHECKING is defined.
8698 * eval.c (catchlist, handlerlist): Export only if BYTE_MARK_STACK.
8699 (mark_backtrace): Define only if BYTE_MARK_STACK.
8700 * xdisp.c (message_enable_multibyte): Now static.
8701
61c2b50e 8702 Declare Lisp_Object Q* variables to be 'static' if not exported.
955cbe7b
PE
8703 This makes it easier for human readers (and static analyzers)
8704 to see whether these variables are used from other modules.
8705 * alloc.c, buffer.c, bytecode.c, callint.c, casetab.c, category.c:
8706 * ccl.c, character.c, charset.c, cmds.c, coding.c, composite.c:
8707 * data.c, dbusbind.c, dired.c, editfns.c, eval.c, fileio.c, fns.c:
8708 * font.c, frame.c, fringe.c, ftfont.c, image.c, keyboard.c, keymap.c:
8709 * lread.c, macros.c, minibuf.c, print.c, process.c, search.c:
8710 * sound.c, syntax.c, textprop.c, window.c, xdisp.c, xfaces.c, xfns.c:
8711 * xmenu.c, xselect.c:
8712 Declare Q* vars static if they are not used in other modules.
8713 * ccl.h, character.h, charset.h, coding.h, composite.h, font.h:
8714 * frame.h, intervals.h, keyboard.h, lisp.h, process.h, syntax.h:
8715 Remove decls of unexported vars.
8716 * keyboard.h (EVENT_HEAD_UNMODIFIED): Remove now-unused macro.
8717
95c82688
PE
8718 * lisp.h (DEFINE_FUNC): Make sname 'static'.
8719
16a97296
PE
8720 Make Emacs functions such as Fatom 'static' by default.
8721 This makes it easier for human readers (and static analyzers)
8722 to see whether these functions can be called from other modules.
8723 DEFUN now defines a static function. To make the function external
8724 so that it can be used in other C modules, use the new macro DEFUE.
8bd7b830
PE
8725 * lisp.h (Funibyte_char_to_multibyte, Fsyntax_table_p):
8726 (Finit_image_library):
16a97296
PE
8727 (Feval_region, Fbacktrace, Ffetch_bytecode, Fswitch_to_buffer):
8728 (Ffile_executable_p, Fmake_symbolic_link, Fcommand_execute):
8729 (Fget_process, Fdocumentation_property, Fbyte_code, Ffile_attributes):
8730 Remove decls, since these functions are now static.
8731 (Funintern, Fget_internal_run_time): New decls, since these functions
8732 were already external.
95c82688 8733
16a97296
PE
8734 * alloc.c, buffer.c, callint.c, callproc.c, casefiddle.c, casetab.c:
8735 * ccl.c, character.c, chartab.c, cmds.c, coding.c, data.c, dispnew.c:
8736 * doc.c, editfns.c, emacs.c, eval.c, fileio.c, filelock.c, floatfns.c:
8737 * fns.c, font.c, fontset.c, frame.c, image.c, indent.c:
8738 * keyboard.c, keymap.c, lread.c:
8739 * macros.c, marker.c, menu.c, minibuf.c, print.c, process.c, search.c:
8740 * syntax.c, term.c, terminal.c, textprop.c, undo.c:
8741 * window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xsettings.c:
8742 Mark functions with DEFUE instead of DEFUN,
8743 if they are used in other modules.
8744 * buffer.c (Fset_buffer_major_mode, Fdelete_overlay): New forward
8745 decls for now-static functions.
8746 * buffer.h (Fdelete_overlay): Remove decl.
8747 * callproc.c (Fgetenv_internal): Mark as internal.
8748 * composite.c (Fremove_list_of_text_properties): Remove decl.
8749 (Fcomposition_get_gstring): New forward static decl.
8750 * composite.h (Fcomposite_get_gstring): Remove decl.
8751 * dired.c (Ffile_attributes): New forward static decl.
8752 * doc.c (Fdocumntation_property): New forward static decl.
8753 * eval.c (Ffetch_bytecode): New forward static decl.
8754 (Funintern): Remove extern decl; now in .h file where it belongs.
8755 * fileio.c (Fmake_symbolic_link): New forward static decl.
8756 * image.c (Finit_image_library): New forward static decl.
8757 * insdel.c (Fcombine_after_change_execute): Make forward decl static.
8758 * intervals.h (Fprevious_property_change):
8759 (Fremove_list_of_text_properties): Remove decls.
8760 * keyboard.c (Fthis_command_keys): Remove decl.
8761 (Fcommand_execute): New forward static decl.
8762 * keymap.c (Flookup_key): New forward static decl.
8763 (Fcopy_keymap): Now static.
8764 * keymap.h (Flookup_key): Remove decl.
8765 * process.c (Fget_process): New forward static decl.
8766 (Fprocess_datagram_address): Mark as internal.
8767 * syntax.c (Fsyntax_table_p): New forward static decl.
8768 (skip_chars): Remove duplicate decl.
8769 * textprop.c (Fprevious_property_change): New forward static decl.
8770 * window.c (Fset_window_fringes, Fset_window_scroll_bars):
8771 Now internal.
8772 (Fset_window_margins, Fset_window_vscroll): New forward static decls.
8773 * window.h (Fset_window_vscroll, Fset_window_margins): Remove decls.
8774
785bbd42
PE
8775 * editfns.c (Fformat): Remove unreachable code.
8776
8b913b57
AS
87772011-04-14 Andreas Schwab <schwab@linux-m68k.org>
8778
8779 * fileio.c (Finsert_file_contents): Fix typo in 2005-05-13
8780 change. (Bug#8496)
8781
a6744a35
EZ
87822011-04-13 Eli Zaretskii <eliz@gnu.org>
8783
8784 * xdisp.c (handle_invisible_prop): Don't call bidi_paragraph_init
8785 when at ZV. (Bug#8487)
8786
e7974947
AS
87872011-04-12 Andreas Schwab <schwab@linux-m68k.org>
8788
baad03f0
AS
8789 * charset.c (Fclear_charset_maps): Use xfree instead of free.
8790 (Bug#8437)
8791 * keyboard.c (parse_tool_bar_item): Likewise.
8792 * sound.c (sound_cleanup, alsa_close): Likewise.
8793 * termcap.c (tgetent): Likewise.
8794 * xfns.c (x_default_font_parameter): Likewise.
8795 * xsettings.c (read_and_apply_settings): Likewise.
8796
e7974947
AS
8797 * alloc.c (overrun_check_malloc, overrun_check_realloc)
8798 (overrun_check_free): Protoize.
8799
28272684
PE
88002011-04-12 Paul Eggert <eggert@cs.ucla.edu>
8801
8802 * sysdep.c (emacs_read, emacs_write): Check for negative sizes
8803 since callers should never pass a negative size.
8804 Change the signature to match that of plain 'read' and 'write'; see
8805 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00397.html>.
8806 * lisp.h: Update prototypes of emacs_write and emacs_read.
8807
11997c76
EZ
88082011-04-11 Eli Zaretskii <eliz@gnu.org>
8809
8810 * xdisp.c (redisplay_window): Don't try to determine the character
8811 position of the scroll margin if the window start point w->startp
e896f03c 8812 is outside the buffer's accessible region. (Bug#8468)
11997c76 8813
8a2cbd72
EZ
88142011-04-10 Eli Zaretskii <eliz@gnu.org>
8815
8816 Fix write-region and its subroutines for buffers > 2GB.
8817 * fileio.c (a_write, e_write): Modify declaration of arguments and
8818 local variables to support buffers larger than 2GB.
8819 (Fcopy_file): Use EMACS_INT for return value of emacs_read.
8820
8821 * sysdep.c (emacs_write, emacs_read): Use ssize_t for last
8822 argument, local variables, and return value.
8823
8824 * lisp.h: Update prototypes of emacs_write and emacs_read.
8825
8826 * sound.c (vox_write): Use ssize_t for return value of emacs_write.
8827
4073e537 88282011-04-10 Paul Eggert <eggert@cs.ucla.edu>
eb3f1cc8 8829
1ebfdcb6
PE
8830 * xdisp.c (vmessage): Use memchr, not strnlen, which some hosts lack.
8831
b2ded58d
PE
8832 Fix more problems found by GCC 4.6.0's static checks.
8833
7d66342c
PE
8834 * xdisp.c (vmessage): Use a better test for character truncation.
8835
bbf47d44
PE
8836 * charset.c (load_charset_map): <, not <=, for optimization,
8837 and to avoid potential problems with integer overflow.
9248994d 8838 * chartab.c (sub_char_table_set_range, char_table_set_range): Likewise.
f9a68bc5 8839 * casetab.c (set_identity, shuffle): Likewise.
3ab1c7ce 8840 * editfns.c (Fformat): Likewise.
1e69125e 8841 * syntax.c (skip_chars): Likewise.
3befa583 8842
e3019616
PE
8843 * xmenu.c (set_frame_menubar): Allocate smaller local vectors.
8844 This also lets GCC 4.6.0 generate slightly better loop code.
8845
becfa255
PE
8846 * callint.c (Fcall_interactively): <, not <=, for optimization.
8847 (Fcall_interactively): Count the number of arguments produced,
8848 not the number of arguments given. This is simpler and lets GCC
8849 4.6.0 generate slightly better code.
8850
dae0cd48
PE
8851 * ftfont.c: Distingish more carefully between FcChar8 and char.
8852 The previous code passed unsigned char * to a functions like
8853 strlen and xstrcasecmp that expect char *, which does not
8854 conform to the C standard.
8855 (get_adstyle_property, ftfont_pattern_entity): Use FcChar8 for
8856 arguments to FcPatternGetString, and explicitly cast FcChar8 * to
8857 char * when the C standard requires it.
8858
76032d70
PE
8859 * keyboard.c (read_char): Remove unused var.
8860
eb3f1cc8
PE
8861 * eval.c: Port to Windows vsnprintf (Bug#8435).
8862 Include <limits.h>.
8863 (SIZE_MAX): Define if the headers do not.
8864 (verror): Do not give up if vsnprintf returns a negative count.
8865 Instead, grow the buffer. This ports to Windows vsnprintf, which
8866 does not conform to C99. Problem reported by Eli Zaretskii.
8867 Also, simplify the allocation scheme, by avoiding the need for
8868 calling realloc, and removing the ALLOCATED variable.
8869
70476b54
PE
8870 * eval.c (verror): Initial buffer size is 4000 (not 200) bytes.
8871
12020a9e
PE
8872 Remove invocations of doprnt, as Emacs now uses vsnprintf.
8873 But keep the doprint source code for now, as we might revamp it
8874 and use it again (Bug#8435).
ea6c7ae6
PE
8875 * lisp.h (doprnt): Remove.
8876 * Makefile.in (base_obj): Remove doprnt.o.
8877 * deps.mk (doprnt.o): Remove.
8878
5fdb398c
PE
8879 error: Print 32- and 64-bit integers portably (Bug#8435).
8880 Without this change, on typical 64-bit hosts error ("...%d...", N)
8881 was used to print both 32- and 64-bit integers N, which relied on
8882 undefined behavior.
61bdb816 8883 * lisp.h, m/amdx86-64.h, m/ia64.h, m/ibms390x.h (pEd): New macro.
5fdb398c
PE
8884 * lisp.h (error, verror): Mark as printf-like functions.
8885 * eval.c (verror): Use vsnprintf, not doprnt, to do the real work.
8886 Report overflow in size calculations when allocating printf buffer.
8887 Do not truncate output string at its first null byte.
8888 * xdisp.c (vmessage): Use vsnprintf, not doprnt, to do the real work.
8889 Truncate the output at a character boundary, since vsnprintf does not
8890 do that.
8891 * charset.c (check_iso_charset_parameter): Convert internal
8892 character to string before calling 'error', since %c now has the
8893 printf meaning.
8894 * coding.c (Fdecode_sjis_char, Fdecode_big5_char): Avoid int
8895 overflow when computing char to be passed to 'error'. Do not
8896 pass Lisp_Object to 'error'; pass the integer instead.
8897 * nsfns.m (Fns_do_applescript): Use int, not long, since it's
8898 formatted with plain %d.
8899
b189fa66
PE
8900 * eval.c (internal_lisp_condition_case): Don't pass spurious arg.
8901
bff87ef0
PE
8902 * keyboard.c (access_keymap_keyremap): Print func name, not garbage.
8903
7e2cac20
PE
8904 * coding.c (Fdecode_sjis_char): Don't assume CODE fits in int.
8905
ce4d90b5
PE
8906 * xterm.c (x_catch_errors): Remove duplicate declaration.
8907
266c9547
PE
8908 * term.c (maybe_fatal): Mark its 3rd arg as a printf format, too.
8909
79c49ad2
PE
8910 * xdisp.c, lisp.h (message_nolog): Remove; unused.
8911
368f4090
JM
89122011-04-10 Jim Meyering <meyering@redhat.com>
8913
8914 use ssize_t and size_t for read- and write-like emacs_gnutls_* functions
8915 * gnutls.c (emacs_gnutls_read): Adjust signature to be more read-like:
8916 return ssize_t not "int", and use size_t as the buffer length.
8917 (emacs_gnutls_write): Likewise, and make the buffer pointer "const".
8918 * gnutls.h: Update declarations.
8919 * process.c (read_process_output): Use ssize_t, to match.
8920 (send_process): Likewise.
8921
a32d4040
CY
89222011-04-09 Chong Yidong <cyd@stupidchicken.com>
8923
8924 * image.c (Fimagemagick_types): Doc fix, and comment cleanup.
8925
8546720e 89262011-04-09 Chong Yidong <cyd@stupidchicken.com>
aac0c6e3 8927
04f2d78b
CB
8928 * ftfont.c (get_adstyle_property, ftfont_pattern_entity):
8929 Use unsigned char, to match FcChar8 type definition.
aac0c6e3 8930
8546720e
GM
8931 * xterm.c (handle_one_xevent):
8932 * xmenu.c (create_and_show_popup_menu):
8933 * xselect.c (x_decline_selection_request)
8934 (x_reply_selection_request): Avoid type-punned deref of X events.
aac0c6e3 8935
0a2f5c1a 89362011-04-09 Eli Zaretskii <eliz@gnu.org>
a53e2e89
EZ
8937
8938 Fix some uses of `int' instead of EMACS_INT.
8939 * search.c (string_match_1, fast_string_match)
8940 (fast_c_string_match_ignore_case, fast_string_match_ignore_case)
8941 (scan_buffer, find_next_newline_no_quit)
8942 (find_before_next_newline, search_command, Freplace_match)
8943 (Fmatch_data): Make some `int' variables be EMACS_INT.
8944
8945 * xdisp.c (display_count_lines): 3rd argument and return value now
8946 EMACS_INT. All callers changed.
8947 (pint2hrstr): Last argument is now EMACS_INT.
8948
8949 * coding.c (detect_coding_utf_8, detect_coding_emacs_mule)
8950 (detect_coding_iso_2022, detect_coding_sjis, detect_coding_big5)
8951 (detect_coding_ccl, detect_coding_charset, decode_coding_utf_8)
8952 (decode_coding_utf_16, decode_coding_emacs_mule)
8953 (decode_coding_iso_2022, decode_coding_sjis, decode_coding_big5)
8954 (decode_coding_ccl, decode_coding_charset)
8955 <consumed_chars, consumed_chars_base>: Declare EMACS_INT.
8956 (decode_coding_iso_2022, decode_coding_emacs_mule)
8957 (decode_coding_sjis, decode_coding_big5, decode_coding_charset)
8958 <char_offset, last_offset>: Declare EMACS_INT.
8959 (encode_coding_utf_8, encode_coding_utf_16)
8960 (encode_coding_emacs_mule, encode_invocation_designation)
8961 (encode_designation_at_bol, encode_coding_iso_2022)
8962 (encode_coding_sjis, encode_coding_big5, encode_coding_ccl)
8963 (encode_coding_raw_text, encode_coding_charset) <produced_chars>:
8964 Declare EMACS_INT.
8965 (ASSURE_DESTINATION): Declare more_bytes EMACS_INT.
8966 (encode_invocation_designation): Last argument P_NCHARS is now
8967 EMACS_INT.
8968 (decode_eol): Declare pos_byte, pos, and pos_end EMACS_INT.
8969 (produce_chars): from_nchars and to_nchars are now EMACS_INT.
8970
8971 * coding.h (struct coding_system) <head_ascii>: Declare EMACS_INT.
8972 All users changed.
8973
8974 * ccl.c (Fccl_execute_on_string): Declare some variables
8975 EMACS_INT.
8976
8546720e 89772011-04-08 Samuel Thibault <sthibault@debian.org> (tiny change)
0080dc6b
SS
8978
8979 * term.c (init_tty): Fix incorrect ifdef placement (Bug#8450).
8980
4e19a977
CS
89812011-03-19 Christoph Scholtes <cschol2112@googlemail.com>
8982
8983 * process.c (Fformat_network_address): Doc fix.
8984
87302331
R
89852011-04-08 T.V. Raman <tv.raman.tv@gmail.com> (tiny change)
8986
ee7683eb 8987 * xml.c (parse_region): Avoid creating spurious whitespace nodes.
87302331 8988
cbb59342
CY
89892011-04-08 Chong Yidong <cyd@stupidchicken.com>
8990
8991 * keyboard.c (read_char): Call Lisp function help-form-show,
8992 instead of using internal_with_output_to_temp_buffer.
8993 (Qhelp_form_show): New var.
e0d38eeb 8994 (syms_of_keyboard): Use DEFSYM macro.
cbb59342
CY
8995
8996 * print.c (internal_with_output_to_temp_buffer): Function deleted.
8997
8998 * lisp.h (internal_with_output_to_temp_buffer): Remove prototype.
8999
e67a13ab
CY
90002011-04-06 Chong Yidong <cyd@stupidchicken.com>
9001
04f2d78b
CB
9002 * process.c (Flist_processes): Remove to Lisp.
9003 (list_processes_1): Delete.
e67a13ab 9004
973f782d
EZ
90052011-04-06 Eli Zaretskii <eliz@gnu.org>
9006
7c106b1e
EZ
9007 * msdos.c (careadlinkat, careadlinkatcwd): MS-DOS replacements.
9008
973f782d
EZ
9009 * w32.c (careadlinkat, careadlinkatcwd): New always-fail stubs.
9010
41cf7d1a 90112011-04-06 Paul Eggert <eggert@cs.ucla.edu>
27ccc379 9012
ca23cc88
PE
9013 Fix more problems found by GCC 4.6.0's static checks.
9014
f390e2d5
PE
9015 * xmenu.c (Fx_popup_dialog): Don't assume string is free of formats.
9016
42eea0d0
PE
9017 * menu.c (Fx_popup_menu): Don't assume error_name lacks printf formats.
9018
b69769da 9019 * lisp.h (message, message_nolog, fatal): Mark as printf-like.
1e973bc7 9020
f9541e84
PE
9021 * xdisp.c (vmessage): Mark as a printf-like function.
9022
13841b55
PE
9023 * term.c (vfatal, maybe_fatal): Mark as printf-like functions.
9024
c136c10f
PE
9025 * sound.c (sound_warning): Don't crash if arg contains a printf format.
9026
5e2d4a30
PE
9027 * image.c (tiff_error_handler, tiff_warning_handler): Mark as
9028 printf-like functions.
9029 (tiff_load): Add casts to remove these marks before passing them
9030 to system-supplied API.
9031
583f48b9
PE
9032 * eval.c (Fsignal): Remove excess argument to 'fatal'.
9033
b25d760e
PE
9034 * coding.c (EMIT_ONE_BYTE, EMIT_TWO_BYTES): Use unsigned, not int.
9035 This avoids several warnings with gcc -Wstrict-overflow.
d5efd1d1
PE
9036 (DECODE_COMPOSITION_RULE): If the rule is invalid, goto invalid_code
9037 directly, rather than having caller test rule sign. This avoids
9038 some unnecessary tests.
9039 * composite.h (COMPOSITION_ENCODE_RULE_VALID): New macro.
9040 (COMPOSITION_ENCODE_RULE): Arguments now must be valid. This
9041 affects only one use, in DECODE_COMPOSITION_RULE, which is changed.
b25d760e 9042
bc7b6697 9043 * xfont.c (xfont_text_extents): Remove var that was set but not used.
625a3eb1 9044 (xfont_open): Avoid unnecessary tests.
bc7b6697 9045
27ccc379
PE
9046 * composite.c (composition_gstring_put_cache): Use unsigned integer.
9047
dcd5c89a
PE
9048 * composite.h, composite.c (composition_gstring_put_cache):
9049 Use EMACS_INT, not int, for length.
9050
b13a45c6
PE
9051 * composite.h (COMPOSITION_DECODE_REFS): New macro,
9052 breaking out part of COMPOSITION_DECODE_RULE.
9053 (COMPOSITION_DECODE_RULE): Use it.
9054 * composite.c (get_composition_id): Remove unused local vars,
9055 by using the new macro.
9056
1e792e4d
PE
9057 * textprop.c (set_text_properties_1): Change while to do-while,
9058 since the condition is always true at first.
9059
dc6c6455 9060 * intervals.c (graft_intervals_into_buffer): Mark var as used.
aa86731f
PE
9061 (interval_deletion_adjustment): Return unsigned value.
9062 All uses changed.
dc6c6455 9063
aba7731a
PE
9064 * process.c (list_processes_1, create_pty, read_process_output):
9065 (exec_sentinel): Remove vars that were set but not used.
afd4052b 9066 (create_pty): Remove unnecessary "volatile"s.
bc57d757 9067 (Fnetwork_interface_info): Avoid possibility of int overflow.
82eaa333 9068 (read_process_output): Do adaptive read buffering even if carryover.
fe07cdfa 9069 (read_process_output): Simplify nbytes computation if buffered.
aba7731a 9070
fdfc4bf3
PE
9071 * bytecode.c (exec_byte_code): Rename local to avoid shadowing.
9072
fca8fe46 9073 * syntax.c (scan_words): Remove var that was set but not used.
12cbf13f 9074 (update_syntax_table): Use unsigned instead of int.
fca8fe46 9075
06a0259a 9076 * lread.c (lisp_file_lexically_bound_p): Use ints rather than endptrs.
3c346cc3 9077 (lisp_file_lexically_bound_p, read1): Use unsigned instead of int.
e6eb4e9e 9078 (safe_to_load_p): Make the end-of-loop test the inverse of the in-loop.
06a0259a 9079
e7b9e80f
PE
9080 * print.c (print_error_message): Avoid int overflow.
9081
56201685
PE
9082 * font.c (font_list_entities): Redo for clarity,
9083 so that reader need not know FONT_DPI_INDEX + 1 == FONT_SPACING_INDEX.
9084
78834453 9085 * font.c (font_find_for_lface, Ffont_get_glyphs): Remove unused vars.
790771b1 9086 (font_score): Avoid potential overflow in diff calculation.
78834453 9087
0bc0b309 9088 * fns.c (substring_both): Remove var that is set but not used.
8cd55cb4 9089 (sxhash): Redo loop for clarity and to avoid wraparound warning.
0bc0b309 9090
e610eaca
PE
9091 * eval.c (funcall_lambda): Rename local to avoid shadowing.
9092
b895abce
PE
9093 * alloc.c (mark_object_loop_halt, mark_object): Use size_t, not int.
9094 Otherwise, GCC 4.6.0 optimizes the loop check away since the check
9095 can always succeed if overflow has undefined behavior.
9096
1f1d9321 9097 * search.c (boyer_moore, wordify): Remove vars set but not used.
6f076cc7 9098 (wordify): Omit three unnecessary tests.
1f1d9321 9099
c59478bc
PE
9100 * indent.c (MULTIBYTE_BYTES_WIDTH): Don't compute wide_column.
9101 All callers changed. This avoids the need for an unused var.
9102
79b73827
PE
9103 * casefiddle.c (casify_region): Remove var that is set but not used.
9104
a4db5dfe
PE
9105 * dired.c (file_name_completion): Remove var that is set but not used.
9106
43aae36e
PE
9107 * fileio.c (Finsert_file_contents): Make EOF condition clearer.
9108
2a47c44d 9109 * fileio.c (Finsert_file_contents): Avoid signed integer overflow.
163c5f32 9110 (Finsert_file_contents): Remove unnecessary code checking fd.
2a47c44d 9111
a37c69bf
PE
9112 * minibuf.c (read_minibuf_noninteractive): Use size_t for sizes.
9113 Check for integer overflow on size calculations.
9114
328ab8e7
PE
9115 * buffer.c (Fprevious_overlay_change): Remove var that is set
9116 but not used.
9117
e5a2a5cb
PE
9118 * keyboard.c (menu_bar_items, read_char_minibuf_menu_prompt):
9119 Remove vars that are set but not used.
8d84a6eb 9120 (timer_check_2): Don't assume timer-list and idle-timer-list are lists.
6b043475 9121 (timer_check_2): Mark vars as initialized.
e5a2a5cb 9122
a60e5f68
PE
9123 * gtkutil.c (xg_get_file_with_chooser): Mark var as initialized.
9124
f661cb61 9125 * image.c (lookup_image): Remove var that is set but not used.
35fa624f 9126 (xbm_load): Use parse_p, for gcc -Werror=unused-but-set-variable.
f661cb61 9127
f0397f5a
PE
9128 * fontset.c (Finternal_char_font, Ffontset_info): Remove vars
9129 that are set but not used.
9130
8664db06 9131 * xfns.c (make_invisible_cursor): Don't return garbage
03733ee7 9132 if XCreateBitmapFromData fails (Bug#8410).
8664db06 9133
6abdaa4a
PE
9134 * xselect.c (x_get_local_selection, x_handle_property_notify):
9135 Remove vars that are set but not used.
9136
0ce7538d 9137 * xfns.c (x_create_tip_frame): Remove var that is set but not used.
6abdaa4a 9138 (make_invisible_cursor): Initialize a possibly-uninitialized variable.
0ce7538d 9139
9ae848fc
PE
9140 * xterm.c (x_scroll_bar_to_input_event) [!USE_GTK]:
9141 Remove var that is set but not used.
0b918413
PE
9142 (scroll_bar_windows_size): Now size_t, not int.
9143 (x_send_scroll_bar_event): Use size_t, not int, for sizes.
9144 Check for overflow.
9ae848fc 9145
a5a62657
PE
9146 * xfaces.c (realize_named_face): Remove vars that are set but not used.
9147 (map_tty_color) [!defined MSDOS]: Likewise.
9148
5c5cdd39
PE
9149 * term.c (tty_write_glyphs): Use size_t; this avoids overflow warning.
9150
66ebf983
PE
9151 * coding.c: Remove vars that are set but not used.
9152 (DECODE_COMPOSITION_RULE): Remove 2nd arg, which is unused.
9153 All callers changed.
9154 (decode_coding_utf_8, decode_coding_utf_16 decode_coding_emacs_mule):
9155 (decode_coding_iso_2022, encode_coding_sjis, encode_coding_big5):
9156 (decode_coding_charset): Remove vars that are set but not used.
9157
1be4d761
PE
9158 * bytecode.c (Fbyte_code) [!defined BYTE_CODE_SAFE]: Remove var
9159 that is set but not used.
9160
47553fa8
PE
9161 * print.c (print_object): Remove var that is set but not used.
9162
1f7196bf 9163 Replace 2 copies of readlink code with 1 gnulib version (Bug#8401).
d1fdcab7
PE
9164 The gnulib version avoids calling malloc in the usual case,
9165 and on 64-bit hosts doesn't have some arbitrary 32-bit limits.
9166 * fileio.c (Ffile_symlink_p): Use emacs_readlink.
9167 * filelock.c (current_lock_owner): Likewise.
9168 * lisp.h (READLINK_BUFSIZE, emacs_readlink): New function.
9169 * sysdep.c: Include allocator.h, careadlinkat.h.
9170 (emacs_no_realloc_allocator): New static constant.
9171 (emacs_readlink): New function.
fdb61804
PE
9172 * deps.mk (sysdep.o): Depend on ../lib/allocator.h and on
9173 ../lib/careadlinkat.h.
d1fdcab7 9174
f84c17c7
SM
91752011-04-04 Stefan Monnier <monnier@iro.umontreal.ca>
9176
9177 * keyboard.c (safe_run_hook_funcall): Fix last change (don't stop at the
9178 first non-nil return value).
9179
ef3862ad
JD
91802011-04-03 Jan Djärv <jan.h.d@swipnet.se>
9181
9182 * nsterm.m (ns_update_auto_hide_menu_bar): Define MAC_OS_X_VERSION_10_6
9183 if not defined (Bug#8403).
9184
376a7006
JB
91852011-04-02 Juanma Barranquero <lekktu@gmail.com>
9186
9187 * xdisp.c (display_count_lines): Remove parameter `start',
9188 unused since 1998-01-01T02:27:27Z!rms@gnu.org. All callers changed.
9189 (get_char_face_and_encoding): Remove parameter `multibyte_p',
9190 unused since 2008-05-14T01:40:23Z!handa@m17n.org. All callers changed.
9191 (fill_stretch_glyph_string): Remove parameters `row' and `area',
9192 unused at least since Kim's GUI unification at 2003-03-16T20:45:46Z!storm@cua.dk
9193 and thereabouts. All callers changed.
9194 (get_per_char_metric): Remove parameter `f', unused since
9195 2008-05-14T01:40:23Z!handa@m17n.org. All callers changed.
9196
6ca3801d
JM
91972011-04-02 Jim Meyering <meyering@redhat.com>
9198
9199 do not dereference NULL upon failed strdup
9200 * nsfont.m (ns_descriptor_to_entity): Use xstrdup, not strdup.
9201 (ns_get_family): Likewise.
9202
d8e2b5ba
JB
92032011-04-02 Juanma Barranquero <lekktu@gmail.com>
9204
9205 * eval.c (unwind_to_catch) [DEBUG_GCPRO]: Remove redundant assignment.
9206
8c74fcbd
JD
92072011-04-02 Jan Djärv <jan.h.d@swipnet.se>
9208
9209 * nsterm.m (ns_update_auto_hide_menu_bar): Only for OSX 10.6 or
9210 later (Bug#8403).
9211
7200d79c
SM
92122011-04-01 Stefan Monnier <monnier@iro.umontreal.ca>
9213
03408648 9214 Add lexical binding.
7200d79c 9215
03408648
SM
9216 * window.c (Ftemp_output_buffer_show): New fun.
9217 (Fsave_window_excursion):
9218 * print.c (Fwith_output_to_temp_buffer): Move to subr.el.
9219
9220 * lread.c (lisp_file_lexically_bound_p): New function.
9221 (Fload): Bind Qlexical_binding.
9222 (readevalloop): Remove `evalfun' arg.
9223 Bind Qinternal_interpreter_environment.
9224 (Feval_buffer): Bind Qlexical_binding.
9225 (defvar_int, defvar_bool, defvar_lisp_nopro, defvar_kboard):
9226 Mark as dynamic.
9227 (syms_of_lread): Declare `lexical-binding'.
9228
9229 * lisp.h (struct Lisp_Symbol): New field `declared_special'.
9230
9231 * keyboard.c (eval_dyn): New fun.
9232 (menu_item_eval_property): Use it.
ca105506
SM
9233
9234 * image.c (parse_image_spec): Use Ffunctionp.
ca105506 9235
03408648
SM
9236 * fns.c (concat, mapcar1): Accept byte-code-functions.
9237
9238 * eval.c (Fsetq): Handle lexical vars.
9239 (Fdefun, Fdefmacro, Ffunction): Make closures when needed.
9240 (Fdefconst, Fdefvaralias, Fdefvar): Mark as dynamic.
9241 (FletX, Flet): Obey lexical binding.
9242 (Fcommandp): Handle closures.
9243 (Feval): New `lexical' arg.
9244 (eval_sub): New function extracted from Feval. Use it almost
9245 everywhere where Feval was used. Look up vars in lexical env.
9246 Handle closures.
9247 (Ffunctionp): Move from subr.el.
9248 (Ffuncall): Handle closures.
9249 (apply_lambda): Remove `eval_flags'.
9250 (funcall_lambda): Handle closures and new byte-code-functions.
9251 (Fspecial_variable_p): New function.
9252 (syms_of_eval): Initialize the Vinternal_interpreter_environment var,
9253 but without exporting it to Lisp.
23aba0ea 9254
23aba0ea 9255 * doc.c (Fdocumentation, store_function_docstring):
03408648 9256 * data.c (Finteractive_form): Handle closures.
23aba0ea 9257
03408648
SM
9258 * callint.c (Fcall_interactively): Preserve lexical-binding mode for
9259 interactive spec.
ba83908c 9260
04f2d78b
CB
9261 * bytecode.c (Bstack_ref, Bstack_set, Bstack_set2, BdiscardN):
9262 New byte-codes.
03408648
SM
9263 (exec_byte_code): New function extracted from Fbyte_code to handle new
9264 calling convention for byte-code-functions. Add new byte-codes.
ba83908c 9265
03408648 9266 * buffer.c (defvar_per_buffer): Set new `declared_special' field.
e2abe5a1 9267
03408648 9268 * alloc.c (Fmake_symbol): Init new `declared_special' field.
e2abe5a1 9269
e2abce01
JB
92702011-03-31 Juanma Barranquero <lekktu@gmail.com>
9271
9272 * xdisp.c (redisplay_internal): Fix prototype.
9273
63696a73 92742011-03-31 Eli Zaretskii <eliz@gnu.org>
09725d26 9275
63696a73 9276 * xdisp.c (SCROLL_LIMIT): New macro.
04f2d78b
CB
9277 (try_scrolling): Use it when setting scroll_limit.
9278 Limit scrolling to 100 screen lines.
63696a73
EZ
9279 (redisplay_window): Even when falling back on "recentering",
9280 position point in the window according to scroll-conservatively,
9281 scroll-margin, and scroll-*-aggressively variables. (Bug#6671)
9282
9283 (try_scrolling): When point is above the window, allow searching
9284 as far as scroll_max, or one screenful, to compute vertical
9285 distance from PT to the scroll margin position. This prevents
9286 try_scrolling from unnecessarily failing when
9287 scroll-conservatively is set to a value slightly larger than the
9288 window height. Clean up the case of PT below the margin at bottom
9289 of window: scroll_max can no longer be INT_MAX. When aggressive
9290 scrolling is in use, don't let point enter the opposite scroll
9291 margin as result of the scroll.
9292 (syms_of_xdisp) <scroll-conservatively>: Document the
09725d26
EZ
9293 threshold of 100 lines for never-recentering scrolling.
9294
e4cc2dfc
JB
92952011-03-31 Juanma Barranquero <lekktu@gmail.com>
9296
9297 * dispextern.h (move_it_by_lines):
9298 * xdisp.c (move_it_by_lines): Remove parameter `need_y_p', unused
9299 since 2000-12-29T14:24:09Z!gerd@gnu.org. All callers changed.
9300 (message_log_check_duplicate): Remove parameters `prev_bol' and
9301 `this_bol', unused since 1998-01-01T02:27:27Z!rms@gnu.org. All callers changed.
9302 (redisplay_internal): Remove parameter `preserve_echo_area',
9303 unused since 1999-07-21T21:43:52Z!gerd@gnu.org. All callers changed.
9304
9305 * indent.c (Fvertical_motion):
9306 * window.c (window_scroll_pixel_based, Frecenter):
9307 Don't pass `need_y_p' to `move_it_by_lines'.
9308
1c470562
SM
93092011-03-30 Stefan Monnier <monnier@iro.umontreal.ca>
9310
44f230aa
SM
9311 * eval.c (struct backtrace): Don't cheat with negative numbers, but do
9312 steal a few bits to be more compact.
9313 (interactive_p, Fbacktrace, Fbacktrace_frame, mark_backtrace):
9314 Remove unneeded casts.
9315
1c470562
SM
9316 * bytecode.c (Fbyte_code): CAR and CDR can GC.
9317
888adce9
ZK
93182011-03-30 Zachary Kanfer <zkanfer@gmail.com> (tiny change)
9319
9320 * keyboard.c (Fexecute_extended_command): Do log the "suggest key
9321 binding" message (bug#7967).
9322
f838ed7b
PE
93232011-03-30 Paul Eggert <eggert@cs.ucla.edu>
9324
77861b95
PE
9325 Fix more problems found by GCC 4.6.0's static checks.
9326
de6dbc14
PE
9327 * unexelf.c (unexec) [! (defined _SYSTYPE_SYSV || defined __sgi)]:
9328 Remove unused local var.
9329
f838ed7b
PE
9330 * editfns.c (Fmessage_box): Remove unused local var.
9331
792c7b2b
PE
9332 * xdisp.c (try_window_reusing_current_matrix, x_produce_glyphs):
9333 (note_mode_line_or_margin_highlight, note_mouse_highlight):
9334 Omit unused local vars.
c499e557 9335 * window.c (shrink_windows): Omit unused local var.
b01a1c29 9336 * menu.c (digest_single_submenu): Omit unused local var.
0bc32927
PE
9337 * dispnew.c (update_window) [PERIODIC_PREEMPTION_CHECKING]:
9338 Omit unused local var.
9339
ba0165e1
PE
9340 * keyboard.c (parse_modifiers_uncached, parse_modifiers):
9341 Don't assume string length fits in int.
32ad8845 9342 (keyremap_step, read_key_sequence): Use size_t for sizes.
48011560 9343 (read_key_sequence): Don't check last_real_key_start redundantly.
ba0165e1 9344
3c59b4c9
PE
9345 * callproc.c (Fcall_process, Fcall_process_region): Use SAFE_ALLOCA
9346 instead of alloca (Bug#8344).
9347
a3eed478 9348 * eval.c (Fbacktrace): Don't assume nargs fits in int.
5d5d959d 9349 (Fbacktrace_frame): Don't assume nframes fits in int.
a3eed478 9350
eb4d412d
PE
9351 * syntax.c (scan_sexps_forward): Avoid pointer wraparound.
9352
1658b401
PE
9353 * xterm.c (x_make_frame_visible, same_x_server): Redo to avoid overflow
9354 concerns.
9355
9356 * term.c (produce_glyphless_glyph): Remove unnecessary test.
9357
9358 * cm.c (calccost): Turn while-do into do-while, for clarity.
44f730c8 9359
9a2c6e05
PE
9360 * keyboard.c (syms_of_keyboard): Use the same style as later
9361 in this function when indexing through an array. This also
9362 works around GCC bug 48267.
9363
03d0a109
PE
9364 * image.c (tiff_load): Fix off-by-one image count (Bug#8336).
9365
44f730c8
PE
9366 * xselect.c (x_check_property_data): Return correct size (Bug#8335).
9367
fe75f926
PE
9368 * chartab.c (sub_char_table_ref_and_range): Redo for slight
9369 efficiency gain, and to bypass a gcc -Wstrict-overflow warning.
9370
ffa8c828
PE
9371 * keyboard.c, keyboard.h (num_input_events): Now size_t.
9372 This avoids undefined behavior on integer overflow, and is a bit
9373 more convenient anyway since it is compared to a size_t variable.
9374
c5101a77
PE
9375 Variadic C functions now count arguments with size_t, not int.
9376 This avoids an unnecessary limitation on 64-bit machines, which
9377 caused (substring ...) to crash on large vectors (Bug#8344).
9378 * lisp.h (struct Lisp_Subr.function.aMANY): Now takes size_t, not int.
9379 (DEFUN_ARGS_MANY, internal_condition_case_n, safe_call): Likewise.
77861b95 9380 All variadic functions and their callers changed accordingly.
c5101a77
PE
9381 (struct gcpro.nvars): Now size_t, not int. All uses changed.
9382 * data.c (arith_driver, float_arith_driver): Likewise.
9383 * editfns.c (general_insert_function): Likewise.
9384 * eval.c (struct backtrace.nargs, interactive_p)
9385 (internal_condition_case_n, run_hook_with_args, apply_lambda)
9386 (funcall_lambda, mark_backtrace): Likewise.
9387 * fns.c (concat): Likewise.
9388 * frame.c (x_set_frame_parameters): Likewise.
9389 * fns.c (get_key_arg): Now accepts and returns size_t, and returns
9390 0 if not found, not -1. All callers changed.
9391
dd3f25f7
PE
9392 * alloc.c (garbage_collect): Don't assume stack size fits in int.
9393 (stack_copy_size): Now size_t, not int.
9394 (stack_copy, stack_copy_size): Define only if MAX_SAVE_STACK > 0.
9395
461c2ab9
JB
93962011-03-28 Juanma Barranquero <lekktu@gmail.com>
9397
9398 * coding.c (encode_designation_at_bol): Remove parameter `charbuf_end',
9399 unused since 2002-03-01T01:17:24Z!handa@m17n.org and 2008-02-01T16:01:31Z!miles@gnu.org.
9400 All callers changed.
9401
9402 * lisp.h (multibyte_char_to_unibyte):
9403 * character.c (multibyte_char_to_unibyte): Remove parameter `rev_tbl',
9404 unused since 2002-03-01T01:16:34Z!handa@m17n.org and 2008-02-01T16:01:31Z!miles@gnu.org.
9405 * character.h (CHAR_TO_BYTE8):
9406 * cmds.c (internal_self_insert):
9407 * editfns.c (general_insert_function):
9408 * keymap.c (push_key_description):
9409 * search.c (Freplace_match):
9410 * xdisp.c (message_dolog, set_message_1): All callers changed.
9411
f6d62986
SM
94122011-03-28 Stefan Monnier <monnier@iro.umontreal.ca>
9413
9414 * keyboard.c (safe_run_hook_funcall): New function.
9415 (safe_run_hooks_1, safe_run_hooks_error, safe_run_hooks): On error,
9416 don't set the hook to nil, but remove the offending function instead.
9417 (Qcommand_hook_internal): Remove, unused.
9418 (syms_of_keyboard): Don't initialize Qcommand_hook_internal nor define
9419 Vcommand_hook_internal.
9420
9421 * eval.c (enum run_hooks_condition): Remove.
9422 (funcall_nil, funcall_not): New functions.
9423 (run_hook_with_args): Call each function through a `funcall' argument.
9424 Remove `cond' argument, now redundant.
9425 (Frun_hooks, Frun_hook_with_args, Frun_hook_with_args_until_success)
9426 (Frun_hook_with_args_until_failure): Adjust accordingly.
9427 (run_hook_wrapped_funcall, Frun_hook_wrapped): New functions.
9428
1db5b1ad
JB
94292011-03-28 Juanma Barranquero <lekktu@gmail.com>
9430
9431 * dispextern.h (string_buffer_position): Remove declaration.
9432
9433 * print.c (strout): Remove parameter `multibyte', unused since
9434 1999-08-21T19:30:21Z!gerd@gnu.org. All callers changed.
9435
9436 * search.c (boyer_moore): Remove parameters `len', `pos' and `lim',
9437 never used since function introduction in 1998-02-08T21:33:56Z!rms@gnu.org.
9438 All callers changed.
9439
9440 * w32.c (_wsa_errlist): Use braces for struct initializers.
9441
9442 * xdisp.c (string_buffer_position_lim): Remove parameter `w',
9443 never used since function introduction in 2001-03-09T18:41:50Z!gerd@gnu.org.
9444 All callers changed.
9445 (string_buffer_position): Likewise. Also, make static (it's never
9446 used outside xdisp.c).
9447 (cursor_row_p): Remove parameter `w', unused since
9448 2000-10-17T16:08:57Z!gerd@gnu.org. All callers changed.
9449 (decode_mode_spec): Remove parameter `precision', introduced during
9450 Gerd Moellmann's rewrite at 1999-07-21T21:43:52Z!gerd@gnu.org, but never used.
9451 All callers changed.
9452
5ffb62aa
JD
94532011-03-27 Jan Djärv <jan.h.d@swipnet.se>
9454
9455 * nsterm.m (syms_of_nsterm): Use doc: for ns-auto-hide-menu-bar.
9456
461c2ab9 94572011-03-27 Anders Lindgren <andlind@gmail.com>
f0a1382a
JD
9458
9459 * nsterm.m (ns_menu_bar_is_hidden): New variable.
9460 (ns_constrain_all_frames, ns_menu_bar_should_be_hidden)
9461 (ns_update_auto_hide_menu_bar): New functions.
9462 (ns_update_begin): Call ns_update_auto_hide_menu_bar.
9463 (applicationDidBecomeActive): Call ns_update_auto_hide_menu_bar and
9464 ns_constrain_all_frames.
9465 (constrainFrameRect): Return at once if ns_menu_bar_should_be_hidden.
9466 (syms_of_nsterm): DEFVAR ns-auto-hide-menu-bar, init to Qnil.
9467
5c380ffb
JD
94682011-03-27 Jan Djärv <jan.h.d@swipnet.se>
9469
9470 * nsmenu.m (runDialogAt): Remove argument to timer_check.
9471
9af30bdf
GM
94722011-03-27 Glenn Morris <rgm@gnu.org>
9473
9474 * syssignal.h: Replace RETSIGTYPE with void.
9475 * atimer.c, data.c, dispnew.c, emacs.c, floatfns.c, keyboard.c:
9476 * keyboard.h, lisp.h, process.c, sysdep.c, xterm.c:
9477 Replace SIGTYPE with void everywhere.
9478 * s/usg5-4-common.h (SIGTYPE): Remove definition.
9479 * s/template.h (SIGTYPE): Remove commented out definition.
9480
e2abce01
JB
94812011-03-26 Eli Zaretskii <eliz@gnu.org>
9482
9483 * xdisp.c (redisplay_window): Don't check buffer's clip_changed
9484 flag as a prerequisite for invoking try_scrolling. (Bug#6671)
9485
f868cd8a
JB
94862011-03-26 Juanma Barranquero <lekktu@gmail.com>
9487
59eb0929
JB
9488 * w32.c (read_unc_volume): Use parameter `henum', instead of
9489 global variable `wget_enum_handle'.
9490
9491 * keymap.c (describe_vector): Remove parameters `indices' and
9492 `char_table_depth', unused since 2002-03-01T01:43:26Z!handa@m17n.org.
9493 (describe_map, Fdescribe_vector): Adjust calls to `describe_vector'.
9494
f868cd8a
JB
9495 * keyboard.h (timer_check, show_help_echo): Remove unused parameters.
9496
9497 * keyboard.c (timer_check): Remove parameter `do_it_now',
9498 unused since 1996-04-12T06:01:29Z!rms@gnu.org.
9499 (show_help_echo): Remove parameter `ok_to_overwrite_keystroke_echo',
9500 unused since 2008-04-19T19:30:53Z!monnier@iro.umontreal.ca.
9501
9502 * keyboard.c (read_char):
9503 * w32menu.c (w32_menu_display_help):
9504 * xmenu.c (show_help_event, menu_help_callback):
9505 Adjust calls to `show_help_echo'.
9506
9507 * gtkutil.c (xg_maybe_add_timer):
9508 * keyboard.c (readable_events):
9509 * process.c (wait_reading_process_output):
9510 * xmenu.c (x_menu_wait_for_event): Adjust calls to `timer_check'.
9511
9512 * insdel.c (adjust_markers_gap_motion):
9513 Remove; no-op since 1998-01-02T21:29:48Z!rms@gnu.org.
9514 (gap_left, gap_right): Don't call it.
9515
2ecf6fdb
CY
95162011-03-25 Chong Yidong <cyd@stupidchicken.com>
9517
9518 * xdisp.c (handle_fontified_prop): Discard changes to clip_changed
9519 incurred during fontification.
9520
6b1f9ba4
JB
95212011-03-25 Juanma Barranquero <lekktu@gmail.com>
9522
9523 * buffer.c (defvar_per_buffer): Remove unused parameter `doc'.
9524 (DEFVAR_PER_BUFFER): Don't pass it.
9525
9526 * dispnew.c (row_equal_p, add_row_entry): Remove unused parameter `w'.
9527 (scrolling_window): Don't pass it.
9528
0f4a96b5
JB
95292011-03-25 Juanma Barranquero <lekktu@gmail.com>
9530
9531 * dispextern.h (glyph_matric): Use #if GLYPH_DEBUG, not #ifdef.
9532
9533 * fileio.c (check_executable) [DOS_NT]: Remove unused variables `len'
9534 and `suffix'.
9535 (Fset_file_selinux_context) [HAVE_LIBSELINUX]: Move here declaration
9536 of variables specific to SELinux and computation of `encoded_absname'.
9537
9538 * image.c (XPutPixel): Remove unused variable `height'.
9539
9540 * keyboard.c (make_lispy_event): Remove unused variable `hpos'.
9541
9542 * unexw32.c (get_section_info): Remove unused variable `section'.
9543
9544 * w32.c (stat): Remove unused variables `drive_root' and `devtype'.
9545 (system_process_attributes): Remove unused variable `sess'.
9546 (sys_read): Remove unused variable `err'.
9547
9548 * w32fns.c (top): Wrap variables with #if GLYPH_DEBUG, not #ifdef.
9549 (w32_wnd_proc): Remove unused variable `isdead'.
9550 (unwind_create_frame): Use #if GLYPH_DEBUG, not #ifdef.
9551 (Fx_server_max_request_size): Remove unused variable `dpyinfo'.
9552 (x_create_tip_frame): Remove unused variable `tem'.
9553
9554 * w32inevt.c (w32_console_read_socket):
9555 Remove unused variable `no_events'.
9556
9557 * w32term.c (x_draw_composite_glyph_string_foreground):
9558 Remove unused variable `width'.
9559
1149507c
JB
95602011-03-24 Juanma Barranquero <lekktu@gmail.com>
9561
9562 * w32term.c (x_set_glyph_string_clipping):
9563 Don't pass uninitialized region to CombineRgn.
9564
9c88f339
JB
95652011-03-23 Juanma Barranquero <lekktu@gmail.com>
9566
9567 * w32fns.c (x_set_menu_bar_lines): Remove unused variable `olines'.
9568 (w32_wnd_proc): Pass NULL to Windows API, not uninitialized buffer.
9569 (Fx_close_connection): Remove unused variable `i'.
9570
9571 * w32font.c (w32font_draw): Return number of glyphs.
9572 (w32font_open_internal): Remove unused variable `i'.
9573 (w32font_driver): Add missing initializer.
9574
9575 * w32menu.c (utf8to16): Remove unused variable `utf16'.
9576 (fill_in_menu): Remove unused variable `items_added'.
9577
9578 * w32term.c (last_mouse_press_frame): Remove static global variable.
9579 (w32_clip_to_row): Remove unused variable `f'.
9580 (x_delete_terminal): Remove unused variable `i'.
9581
9582 * w32uniscribe.c (uniscribe_shape): Remove unused variable `nclusters'.
9583 (NOTHING): Remove unused static global variable.
9584 (uniscribe_check_otf): Remove unused variable `table'.
9585 (uniscribe_font_driver): Add missing initializers.
9586
dee091a3
JD
95872011-03-23 Julien Danjou <julien@danjou.info>
9588
9589 * term.c (Fsuspend_tty, Fresume_tty):
9590 * minibuf.c (read_minibuf, run_exit_minibuf_hook):
9591 * window.c (temp_output_buffer_show):
9592 * insdel.c (signal_before_change):
9593 * frame.c (Fhandle_switch_frame):
9594 * fileio.c (Fdo_auto_save):
9595 * emacs.c (Fkill_emacs):
9596 * editfns.c (save_excursion_restore):
9597 * cmds.c (internal_self_insert):
9598 * callint.c (Fcall_interactively):
9599 * buffer.c (Fkill_all_local_variables):
9600 * keyboard.c (Fcommand_execute, Fsuspend_emacs, safe_run_hooks_1):
9601 Use Frun_hooks.
0f4a96b5 9602 (command_loop_1): Use Frun_hooks. Call safe_run_hooks
e9fce1ac 9603 unconditionally since it does the check itself.
dee091a3 9604
2c520ab5 96052011-03-23 Paul Eggert <eggert@cs.ucla.edu>
f0641eff 9606
c9c49752
PE
9607 Fix more problems found by GCC 4.5.2's static checks.
9608
8abc3f12
PE
9609 * coding.c (encode_coding_raw_text): Avoid unnecessary test
9610 the first time through the loop, since we know p0 < p1 then.
9611 This also avoids a gcc -Wstrict-overflow warning.
9612
a2d26660
PE
9613 * lisp.h (SAFE_ALLOCA, SAFE_ALLOCA_LISP): Avoid 'int' overflow
9614 leading to a memory leak, possible in functions like
9615 load_charset_map_from_file that can allocate an unbounded number
b12ef411 9616 of objects (Bug#8318).
a2d26660 9617
916c72e9
PE
9618 * xmenu.c (set_frame_menubar): Use EMACS_UINT, not int, for indexes
9619 that could (at least in theory) be that large.
9620
19ab8a18
PE
9621 * xdisp.c (message_log_check_duplicate): Return unsigned long, not int.
9622 This is less likely to overflow, and avoids undefined behavior if
9623 overflow does occur. All callers changed. Use strtoul to scan
9624 for the unsigned long integer.
b7cbbd6f
PE
9625 (pint2hrstr): Simplify and tune code slightly.
9626 This also avoids a (bogus) GCC warning with gcc -Wstrict-overflow.
19ab8a18 9627
f0641eff
PE
9628 * scroll.c (do_scrolling): Work around GCC bug 48228.
9629 See <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48228>.
9630
7f650bb9
PE
9631 * frame.c (Fmodify_frame_parameters): Simplify loop counter.
9632 This also avoids a warning with gcc -Wstrict-overflow.
39f5e519
PE
9633 (validate_x_resource_name): Simplify count usage.
9634 This also avoids a warning with gcc -Wstrict-overflow.
7f650bb9 9635
37dd57d1
PE
9636 * fileio.c (Fcopy_file): Report error if fchown or fchmod
9637 fail (Bug#8306).
81e56e61 9638
699979fc 9639 * emacs.c (Fdaemon_initialized): Do not ignore I/O errors (Bug#8303).
dc1ca6a8 9640
401bf9b4
PE
9641 * process.c (Fmake_network_process): Use socklen_t, not int,
9642 where POSIX says socklen_t is required in portable programs.
9643 This fixes a porting bug on hosts like 64-bit HP-UX, where
591b2973 9644 socklen_t is wider than int (Bug#8277).
401bf9b4
PE
9645 (Fmake_network_process, server_accept_connection):
9646 (wait_reading_process_output, read_process_output):
9647 Likewise.
9648
b93aacde
PE
9649 * process.c: Rename or move locals to avoid shadowing.
9650 (list_processes_1, Fmake_network_process):
9651 (read_process_output_error_handler, exec_sentinel_error_handler):
9652 Rename or move locals.
4dc343ee 9653 (Fmake_network_process): Define label "retry_connect" only if needed.
0da49335 9654 (Fnetwork_interface_info): Fix pointer signedness.
f990b4e5 9655 (process_send_signal): Add cast to avoid pointer signedness problem.
7b808126 9656 (FIRST_PROC_DESC, IF_NON_BLOCKING_CONNECT): Remove unused macros.
c939f91b 9657 (create_process): Use 'volatile' to avoid vfork clobbering (Bug#8298).
b93aacde 9658
af8a867c 9659 Make tparam.h and terminfo.c consistent.
44f230aa
SM
9660 * cm.c (tputs, tgoto, BC, UP): Remove extern decls.
9661 Include tparam.h instead, since it declares them.
af8a867c
PE
9662 * cm.h (PC): Remove extern decl; tparam.h now does this.
9663 * deps.mk (cm.o, terminfo.o): Depend on tparam.h.
9664 * terminfo.c: Include tparam.h, to check interfaces.
9665 (tparm): Make 1st arg a const pointer in decl. Put it at top level.
9666 (tparam): Adjust signature to match interface in tparam.h;
9667 this removes some undefined behavior. Check that outstring and len
9668 are zero, which they always are with Emacs.
9669 * tparam.h (PC, BC, UP): New extern decls.
9670
0248044d 9671 * xftfont.c (xftfont_shape): Now static, and defined only if needed.
001a7ab4 9672 (xftfont_open): Rename locals to avoid shadowing.
0248044d 9673
8ff096c1 9674 * ftfont.c (ftfont_resolve_generic_family): Fix pointer signedness.
a00924bb
PE
9675 (ftfont_otf_capability, ftfont_shape): Omit decls if not needed.
9676 (OTF_TAG_SYM): Omit macro if not needed.
e932860f 9677 (ftfont_list): Remove unused local.
49eaafba
PE
9678 (get_adstyle_property, ftfont_pattern_entity):
9679 (ftfont_lookup_cache, ftfont_open, ftfont_anchor_point):
9680 Rename locals to avoid shadowing.
8ff096c1 9681
e2be39f6
PE
9682 * xfont.c (xfont_list_family): Mark var as initialized.
9683
c9735e30
PE
9684 * xml.c (make_dom): Now static.
9685
8f5201ae
PE
9686 * composite.c (composition_compute_stop_pos): Rename local to
9687 avoid shadowing.
b246f932
PE
9688 (composition_reseat_it): Remove unused locals.
9689 (find_automatic_composition, composition_adjust_point): Likewise.
80e079b2 9690 (composition_update_it): Mark var as initialized.
11b61122
PE
9691 (find_automatic_composition): Mark vars as initialized,
9692 with a FIXME (Bug#8290).
8f5201ae 9693
760fbc2c
PE
9694 character.h: Rename locals to avoid shadowing.
9695 * character.h (PREV_CHAR_BOUNDARY, FETCH_STRING_CHAR_ADVANCE):
9696 (FETCH_STRING_CHAR_AS_MULTIBYTE_ADVANCE, FETCH_CHAR_ADVANCE):
9697 (FETCH_CHAR_ADVANCE_NO_CHECK, INC_POS, DEC_POS, BUF_INC_POS):
9698 (BUF_DEC_POS): Be more systematic about renaming local temporaries
9699 to avoid shadowing.
9700
ff08eb85
PE
9701 * textprop.c (property_change_between_p): Remove; unused.
9702
fc7bf025
PE
9703 * intervals.c (interval_start_pos): Now static.
9704
235d7abc
PE
9705 * intervals.h (CHECK_TOTAL_LENGTH): Avoid empty "else".
9706
44f230aa
SM
9707 * atimer.c (start_atimer, append_atimer_lists, set_alarm):
9708 Rename locals to avoid shadowing.
3e7d6594 9709
50060332
PE
9710 * sound.c (wav_play, au_play, Fplay_sound_internal):
9711 Fix pointer signedness.
d01f234b 9712 (alsa_choose_format): Remove unused local var.
c83b8872
PE
9713 (wav_play): Initialize a variable to 0, to prevent undefined
9714 behavior (Bug#8278).
50060332 9715
c4fc4e30
PE
9716 * region-cache.c (insert_cache_boundary): Redo var to avoid shadowing.
9717
918436ed
PE
9718 * region-cache.h (pp_cache): New decl, for gcc -Wmissing-prototypes.
9719
c939f91b
PE
9720 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork
9721 clobbering (Bug#8298).
b9c7f648
PE
9722 * sysdep.c (sys_subshell): Likewise.
9723 Previously, the sys_subshell 'volatile' was incorrectly IF_LINTted out.
7e9123a2 9724
6bd8c144
PE
9725 * lisp.h (child_setup): Now NO_RETURN unless DOS_NT.
9726 This should get cleaned up, so that child_setup has the
9727 same signature on all platforms.
9728
7710357c 9729 * callproc.c (call_process_cleanup): Now static.
cb1d0ef7 9730 (relocate_fd): Rename locals to avoid shadowing.
7710357c 9731
c59da222
CY
97322011-03-22 Chong Yidong <cyd@stupidchicken.com>
9733
9734 * xterm.c (x_clear_frame): Remove XClearWindow call. This appears
9735 not to be necessary, and produces flickering.
9736
66b87493
GM
97372011-03-20 Glenn Morris <rgm@gnu.org>
9738
9739 * config.in: Remove file.
9740
45b6f6d5
JB
97412011-03-20 Juanma Barranquero <lekktu@gmail.com>
9742
9743 * minibuf.c (Vcompleting_read_function): Don't declare, global variables
9744 are now in src/globals.h.
9745 (syms_of_minibuf): Remove spurious & from previous change.
9746
cd394be1 97472011-03-20 Leo Liu <sdl.web@gmail.com>
3ec03f7e
LL
9748
9749 * minibuf.c (completing-read-function): New variable.
9750 (completing-read-default): Rename from completing-read.
9751 (completing-read): Call completing-read-function.
9752
b14e3e21
CY
97532011-03-19 Juanma Barranquero <lekktu@gmail.com>
9754
9755 * xfaces.c (Fx_load_color_file):
9756 Read color file from absolute filename (bug#8250).
9757
f2b726e6
JB
97582011-03-19 Juanma Barranquero <lekktu@gmail.com>
9759
9760 * makefile.w32-in: Update dependencies.
9761
09f6ff02
EZ
97622011-03-17 Eli Zaretskii <eliz@gnu.org>
9763
9764 * makefile.w32-in ($(BLD)/unexw32.$(O)): Depend on $(SRC)/unexec.h.
9765
29a6015a
PE
97662011-03-17 Paul Eggert <eggert@cs.ucla.edu>
9767
a3a6c54e
PE
9768 Fix more problems found by GCC 4.5.2's static checks.
9769
b766f867
PE
9770 * process.c (make_serial_process_unwind, send_process_trap):
9771 (sigchld_handler): Now static.
9772
be02381c
PE
9773 * process.c (allocate_pty): Let PTY_ITERATION declare iteration vars.
9774 That way, the code declares only the vars that it needs.
9775 * s/aix4-2.h (PTY_ITERATION): Declare iteration vars.
9776 * s/cygwin.h (PTY_ITERATION): Likewise.
9777 * s/darwin.h (PTY_ITERATION): Likewise.
9778 * s/gnu-linux.h (PTY_ITERATION): Likewise.
9779
57048744
PE
9780 * s/irix6-5.h (PTY_OPEN): Declare stb, to loosen coupling.
9781 * process.c (allocate_pty): Don't declare stb unless it's needed.
9782
7914961c 9783 * bytecode.c (MAYBE_GC): Rewrite so as not to use empty "else".
615f2d59
PE
9784 (CONSTANTLIM): Remove; unused.
9785 (METER_CODE, Bscan_buffer, Bread_char, Bset_mark):
9786 Define only if needed.
7914961c 9787
b3967b18
PE
9788 * unexelf.c (unexec): Name an expression,
9789 to avoid gcc -Wbad-function-cast warning.
9ae71512
PE
9790 Use a different way to cause a compilation error if anyone uses
9791 n rather than nn, a way that does not involve shadowing.
73366a00 9792 (ELF_BSS_SECTION_NAME, OLD_PROGRAM_H): Remove; unused.
b3967b18 9793
29a6015a
PE
9794 * deps.mk (unexalpha.o): Remove; unused.
9795
43cfc33e 9796 New file unexec.h, the (simple) interface for unexec (Bug#8267).
7feda0d2 9797 * unexec.h: New file.
ce701a33
PE
9798 * deps.mk (emacs.o, unexaix.o, unexcw.o, unexcoff.o, unexelf.o):
9799 (unexhp9k800.o, unexmacosx.o, unexsol.o, unexw32.o):
9800 Depend on unexec.h.
9801 * emacs.c [!defined CANNOT_DUMP]: Include unexec.h.
9802 * unexaix.c, unexcoff.c, unexcw.c, unexelf.c, unexhp9k800.c:
9803 * unexmacosx.c, unexsol.c, unexw32.c: Include unexec.h.
381259ef 9804 Change as necessary to match prototype in unexec.h.
ce701a33 9805
01f44d5a
PE
9806 * syntax.c (Fforward_comment, scan_lists): Rename locals to avoid
9807 shadowing.
4f63c6bb 9808 (back_comment, skip_chars): Mark vars as initialized.
01f44d5a 9809
a6670b0b
PE
9810 * character.h (FETCH_STRING_CHAR_ADVANCE_NO_CHECK, BUF_INC_POS):
9811 Rename locals to avoid shadowing.
9812
cef2010d 9813 * lread.c (read1): Rewrite so as not to use empty "else".
0902fe45 9814 (Fload, readevalloop, read1): Rename locals to avoid shadowing.
cef2010d 9815
d4d7173a
PE
9816 * print.c (Fredirect_debugging_output): Fix pointer signedess.
9817
f08b802a
PE
9818 * lisp.h (debug_output_compilation_hack): Add decl here, to avoid
9819 warning when compiling print.c.
9820
3ddb0639
PE
9821 * font.c (font_unparse_fcname): Abort in an "impossible" situation
9822 instead of using an uninitialized var.
5ad03b97 9823 (font_sort_entities): Mark var as initialized.
3ddb0639 9824
170a2692
PE
9825 * character.h (FETCH_CHAR_ADVANCE): Rename locals to avoid shadowing.
9826
e663c700
PE
9827 * font.c (font_unparse_xlfd): Don't mix pointers to variables with
9828 pointers to constants.
89bc529a 9829 (font_parse_fcname): Remove unused vars.
7b81e2d0 9830 (font_delete_unmatched): Now static.
ea838e10 9831 (font_get_spec): Remove; unused.
13a547c6
PE
9832 (font_style_to_value, font_prop_validate_style, font_unparse_fcname):
9833 (font_update_drivers, Ffont_get_glyphs, font_add_log):
9834 Rename or move locals to avoid shadowing.
e663c700 9835
2a80c887 9836 * fns.c (require_nesting_list, require_unwind): Now static.
612f56df 9837 (Ffillarray): Rename locals to avoid shadowing.
2a80c887 9838
1384fa33 9839 * floatfns.c (domain_error2): Define only if needed.
a885e2ed 9840 (Ffrexp, Fldexp): Rename locals to avoid shadowing.
1384fa33 9841
8b2c52e9
PE
9842 * alloc.c (mark_backtrace): Move decl from here ...
9843 * lisp.h: ... to here, so that it can be checked.
9844
475545b5 9845 * eval.c (call_debugger, do_debug_on_call, grow_specpdl): Now static.
d28a2170 9846 (Fdefvar): Rewrite so as not to use empty "else".
cfcbfb1a
PE
9847 (lisp_indirect_variable): Name an expression,
9848 to avoid gcc -Wbad-function-cast warning.
1faed8ae 9849 (Fdefvar): Rename locals to avoid shadowing.
475545b5 9850
b1349114 9851 * callint.c (quotify_arg, quotify_args): Now static.
a3e8cbda 9852 (Fcall_interactively): Rename locals to avoid shadowing.
b0e80955 9853 Use const pointer when appropriate.
b1349114 9854
a2928364
PE
9855 * lisp.h (get_system_name, get_operating_system_release):
9856 Move decls here, to check interfaces.
9857 * process.c (get_operating_system_release): Move decl to lisp.h.
9858 * xrdb.c (get_system_name): Likewise.
63c5d10b
PE
9859 * editfns.c (init_editfns, Fuser_login_name, Fuser_uid):
9860 (Fuser_real_uid, Fuser_full_name): Remove unnecessary casts,
9861 some of which prompt warnings from gcc -Wbad-function-cast.
545b49b4
PE
9862 (Fformat_time_string, Fencode_time, Finsert_char):
9863 (Ftranslate_region_internal, Fformat):
9864 Rename or remove local vars to avoid shadowing.
9710023e 9865 (Ftranslate_region_internal): Mark var as initialized.
63c5d10b 9866
a415e694
PE
9867 * doc.c (Fdocumentation, Fsnarf_documentation): Move locals to
9868 avoid shadowing.
9869
8ef4622d
PE
9870 * lisp.h (eassert): Check that the argument compiles, even if
9871 ENABLE_CHECKING is not defined.
9872
946f9a5b
PE
9873 * data.c (Findirect_variable): Name an expression, to avoid
9874 gcc -Wbad-function-cast warning.
112396d6 9875 (default_value, arithcompare, arith_driver, arith_error): Now static.
b9b84fa9 9876 (store_symval_forwarding): Rename local to avoid shadowing.
44f230aa
SM
9877 (Fmake_variable_buffer_local, Fmake_local_variable):
9878 Mark variables as initialized.
52746918 9879 (do_blv_forwarding, do_symval_forwarding): Remove; unused.
946f9a5b 9880
e5aab7e7 9881 * alloc.c (check_cons_list): Do not define unless GC_CHECK_CONS_LIST.
ae35e756
PE
9882 (Fmake_vector, Fvector, Fmake_byte_code, Fgarbage_collect):
9883 Rename locals to avoid shadowing.
dff45157
PE
9884 (mark_stack): Move local variables into the #ifdef region where
9885 they're used.
7bc26fdb
PE
9886 (BLOCK_INPUT_ALLOC, UNBLOCK_INPUT_ALLOC): Define only if
9887 ! defined SYSTEM_MALLOC && ! defined SYNC_INPUT, as they are not
9888 needed otherwise.
9889 (CHECK_ALLOCATED): Define only if GC_CHECK_MARKED_OBJECTS.
9890 (GC_STRING_CHARS): Remove; not used.
d40d4be1 9891 (Fmemory_limit): Cast sbrk's returned value to char *.
ae35e756 9892
e5aab7e7
PE
9893 * lisp.h (check_cons_list): Declare if GC_CHECK_CONS_LIST; this
9894 avoids undefined behavior in theory.
9895
4da60324
PE
9896 * regex.c (IF_LINT): Add defn, for benefit of ../lib-src.
9897
88043301
PE
9898 Use functions, not macros, for up- and down-casing (Bug#8254).
9899 * buffer.h (DOWNCASE_TABLE, UPCASE_TABLE, DOWNCASE, UPPERCASEP):
9900 (NOCASEP, LOWERCASEP, UPCASE, UPCASE1): Remove. All callers changed
9901 to use the following functions instead of these macros.
9902 (downcase): Adjust to lack of DOWNCASE_TABLE. Return int, not
9903 EMACS_INT, since callers assume the returned value fits in int.
9904 (upcase1): Likewise, for UPCASE_TABLE.
9905 (uppercasep, lowercasep, upcase): New static inline functions.
0da09c43 9906 * editfns.c (Fchar_equal): Remove no-longer-needed workaround for
db69b0cd 9907 the race-condition problem in the old DOWNCASE.
88043301 9908
19ed5445
PE
9909 * regex.c (CHARSET_LOOKUP_RANGE_TABLE_RAW, POP_FAILURE_REG_OR_COUNT):
9910 Rename locals to avoid shadowing.
9911 (regex_compile, re_match_2_internal): Move locals to avoid shadowing.
abbd1bcf
PE
9912 (regex_compile, re_search_2, re_match_2_internal):
9913 Remove unused local vars.
952db0d7
PE
9914 (FREE_VAR): Rewrite so as not to use empty "else",
9915 which gcc can warn about.
da053e48 9916 (regex_compile, re_match_2_internal): Mark locals as initialized.
b313f9d8
PE
9917 (RETALLOC_IF): Define only if needed.
9918 (WORDCHAR_P): Likewise. This one is never needed, but is used
9919 only in a comment talking about a compiler bug, so put inside
9920 the #if 0 of that comment.
9921 (CHARSET_LOOKUP_BITMAP, FAIL_STACK_FULL, RESET_FAIL_STACK):
9922 (PUSH_FAILURE_ELT, BUF_PUSH_3, STOP_ADDR_VSTRING):
9923 Remove; unused.
19ed5445 9924
1f3561e4 9925 * search.c (boyer_moore): Rename locals to avoid shadowing.
76ef09b7
PE
9926 * character.h (FETCH_STRING_CHAR_AS_MULTIBYTE_ADVANCE):
9927 (PREV_CHAR_BOUNDARY): Likewise.
1f3561e4 9928
ded6f8f7
PE
9929 * search.c (simple_search): Remove unused var.
9930
dbd37a95
PE
9931 * dired.c (compile_pattern): Move decl from here ...
9932 * lisp.h: ... to here, so that it can be checked.
9933 (struct re_registers): New forward decl.
9934
7e47afad
PE
9935 * character.h (INC_POS, DEC_POS): Rename locals to avoid shadowing.
9936
85f24f61
PE
9937 * indent.c (MULTIBYTE_BYTES_WIDTH): New args bytes, width.
9938 All uses changed.
9939 (MULTIBYTE_BYTES_WIDTH, scan_for_column, compute_motion):
9940 Rename locals to avoid shadowing.
5671df8f 9941 (Fvertical_motion): Mark locals as initialized.
85f24f61 9942
181aa2be 9943 * casefiddle.c (casify_object, casify_region): Now static.
e45a141a 9944 (casify_region): Mark local as initialized.
181aa2be 9945
930d429c
PE
9946 * cmds.c (internal_self_insert): Rename local to avoid shadowing.
9947
7082eac6
PE
9948 * lisp.h (GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR, GCPRO5_VAR, GCPRO6_VAR):
9949 New macros, so that the caller can use some names other than
9950 gcpro1, gcpro2, etc.
9951 (GCPRO2, GCPRO3, GCPRO4, GCPRO5, GCPRO6): Reimplement in terms
9952 of the new macros.
9953 (GCPRO1_VAR, UNGCPRO_VAR): Change the meaning of the second
9954 argument, for consistency with GCPRO2_VAR, etc: it is now the
9955 prefix of the variable, not the variable itself. All uses
9956 changed.
38b2c076
PE
9957 * dired.c (directory_files_internal, file_name_completion):
9958 Rename locals to avoid shadowing.
9959
15206ed9
PE
9960 Fix a race condition diagnosed by gcc -Wsequence-point (Bug#8254).
9961 An expression of the form (DOWNCASE (x) == DOWNCASE (y)), found in
9962 dired.c's scmp function, had undefined behavior.
9963 * lisp.h (DOWNCASE_TABLE, UPCASE_TABLE, DOWNCASE, UPPERCASEP):
9964 (NOCASEP, LOWERCASEP, UPCASE, UPCASE1): Move from here ...
9965 * buffer.h: ... to here, because these macros use current_buffer,
9966 and the new implementation with inline functions needs to have
9967 current_buffer in scope now, rather than later when the macros
9968 are used.
9969 (downcase, upcase1): New static inline functions.
9970 (DOWNCASE, UPCASE1): Reimplement using these functions.
9971 This avoids undefined behavior in expressions like
9972 DOWNCASE (x) == DOWNCASE (y), which previously suffered
9973 from race conditions in accessing the global variables
9974 case_temp1 and case_temp2.
9975 * casetab.c (case_temp1, case_temp2): Remove; no longer needed.
9976 * lisp.h (case_temp1, case_temp2): Remove their decls.
9977 * character.h (ASCII_CHAR_P): Move from here ...
9978 * lisp.h: ... to here, so that the inline functions mentioned
9979 above can use them.
9980
4a6bea26
PE
9981 * dired.c (directory_files_internal_unwind): Now static.
9982
f14b7e14
PE
9983 * fileio.c (file_name_as_directory, directory_file_name):
9984 (barf_or_query_if_file_exists, auto_save_error, auto_save_1):
9985 Now static.
2893f146
PE
9986 (file_name_as_directory): Use const pointers when appropriate.
9987 (Fexpand_file_name): Likewise. In particular, newdir might
9988 point at constant storage, so make it a const pointer.
fd4ead52 9989 (Fmake_directory_internal, Fread_file_name): Remove unused vars.
b14aac08
PE
9990 (Ffile_selinux_context, Fset_file_selinux_context): Fix pointer
9991 signedness issues.
f839df0c
PE
9992 (Fset_file_times, Finsert_file_contents, auto_save_error):
9993 Rename locals to avoid shadowing.
f14b7e14 9994
5716756e 9995 * minibuf.c (choose_minibuf_frame_1): Now static.
62137a95
PE
9996 (Ftry_completion, Fall_completions): Rename or remove locals
9997 to avoid shadowing.
5716756e 9998
b4c3046a
PE
9999 * marker.c (bytepos_to_charpos): Remove; unused.
10000
b45db522
PE
10001 * lisp.h (verify_bytepos, count_markers): New decls,
10002 so that gcc does not warn that these functions aren't declared.
10003
85876d07
PE
10004 * insdel.c (check_markers, make_gap_larger, make_gap_smaller):
10005 (reset_var_on_error, Fcombine_after_change_execute_1): Now static.
f0cb4a60 10006 (CHECK_MARKERS): Redo to avoid gcc -Wempty-body diagnostic.
40ef059e 10007 (copy_text): Remove unused local var.
85876d07 10008
03d78a21 10009 * filelock.c (within_one_second): Now static.
b3dd38ab 10010 (lock_file_1): Rename local to avoid shadowing.
03d78a21 10011
5df8f01b
PE
10012 * buffer.c (fix_overlays_before): Mark locals as initialized.
10013 (fix_start_end_in_overlays): Likewise. This function should be
10014 simplified by using pointers-to-pointers, but that's a different
10015 matter.
b1d876f1 10016 (switch_to_buffer_1): Now static.
8f54f30a
PE
10017 (Fkill_buffer, record_buffer, Fbury_buffer, Fset_buffer_multibyte):
10018 (report_overlay_modification): Rename locals to avoid shadowing.
c3bd59b5 10019
a70072c9 10020 * sysdep.c (system_process_attributes): Rename vars to avoid shadowing.
fbd02d7b 10021 Fix pointer signedness issue.
edced198
PE
10022 (sys_subshell): Mark local as volatile if checking for lint,
10023 to suppress a gcc -Wclobbered warning that does not seem to be right.
15dfd3d9 10024 (MAXPATHLEN): Define only if needed.
a70072c9 10025
a0977c44
PE
10026 * process.c (serial_open, serial_configure): Move decls from here ...
10027 * systty.h: ... to here, so that they can be checked.
10028
a884fdcc
PE
10029 * fns.c (get_random, seed_random): Move extern decls from here ...
10030 * lisp.h: ... to here, so that they can be checked.
10031
604efe86 10032 * sysdep.c (reset_io): Now static.
b8950c94 10033 (wait_for_termination_signal): Remove; unused.
604efe86 10034
38fc62d9
PE
10035 * keymap.c (keymap_parent, keymap_memberp, map_keymap_internal):
10036 (copy_keymap_item, append_key, push_text_char_description):
10037 Now static.
1004a21a 10038 (Fwhere_is_internal): Don't test CONSP (sequences) unnecessarily.
dbbb8427 10039 (DENSE_TABLE_SIZE): Remove; unused.
c1141155
PE
10040 (get_keymap, access_keymap, Fdefine_key, Fwhere_is_internal):
10041 (describe_map_tree):
10042 Rename locals to avoid shadowing.
38fc62d9 10043
2f2650da
PE
10044 * keyboard.c: Declare functions static if they are not used elsewhere.
10045 (echo_char, echo_dash, cmd_error, top_level_2):
10046 (poll_for_input, handle_async_input): Now static.
69a058fa
PE
10047 (read_char, kbd_buffer_get_event, make_lispy_position):
10048 (make_lispy_event, make_lispy_movement, apply_modifiers):
10049 (decode_keyboard_code, tty_read_avail_input, menu_bar_items):
10050 (parse_tool_bar_item, read_key_sequence, Fread_key_sequence):
10051 (Fread_key_sequence_vector): Rename locals to avoid shadowing.
c8a06054 10052 (read_key_sequence, read_char): Mark locals as initialized.
3ac94672 10053 (Fexit_recursive_edit, Fabort_recursive_edit): Mark with NO_RETURN.
2f2650da 10054
a053e86c 10055 * keyboard.h (make_ctrl_char): New decl.
da2f2dd9
PE
10056 (mark_kboards): Move decl here ...
10057 * alloc.c (mark_kboards): ... from here.
a053e86c 10058
4752793e
PE
10059 * lisp.h (force_auto_save_soon): New decl.
10060
74f10ca7 10061 * emacs.c (init_cmdargs): Rename local to avoid shadowing.
244fc23d
PE
10062 (DEFINE_DUMMY_FUNCTION): New macro.
10063 (__do_global_ctors, __do_global_ctors_aux, __do_global_dtors, __main):
10064 Use it.
c03cd23f
PE
10065 (main): Add casts to avoid warnings
10066 if GCC considers string literals to be constants.
74f10ca7 10067
022e70d4
PE
10068 * lisp.h (fatal_error_signal): Add decl, since it's exported.
10069
59d6fe83
PE
10070 * dbusbind.c: Pointer signedness fixes.
10071 (xd_signature, xd_append_arg, xd_initialize):
10072 (Fdbus_call_method, Fdbus_call_method_asynchronously):
10073 (Fdbus_method_return_internal, Fdbus_method_error_internal):
10074 (Fdbus_send_signal, xd_read_message_1, Fdbus_register_service):
10075 (Fdbus_register_signal): Use SSDATA when the context wants char *.
10076
78320123
PE
10077 * dbusbind.c (Fdbus_init_bus): Add cast to avoid warning
10078 if GCC considers string literals to be constants.
49cebcca 10079 (Fdbus_register_service, Fdbus_register_method): Remove unused vars.
78320123 10080
35ac2a97
SM
100812011-03-16 Stefan Monnier <monnier@iro.umontreal.ca>
10082
fb103ca9
SM
10083 * print.c (PRINT_CIRCLE_CANDIDATE_P): New macro.
10084 (print_preprocess, print_object): New macro to fix last change.
10085
35ac2a97
SM
10086 * print.c (print_preprocess): Don't forget font objects.
10087
62973b41
JB
100882011-03-16 Juanma Barranquero <lekktu@gmail.com>
10089
10090 * emacs.c (USAGE3): Doc fixes.
10091
0e48bb22
AS
100922011-03-15 Andreas Schwab <schwab@linux-m68k.org>
10093
10094 * coding.c (detect_coding_iso_2022): Reorganize code to clarify
10095 structure.
10096
7684e57b
JB
100972011-03-14 Juanma Barranquero <lekktu@gmail.com>
10098
10099 * lisp.h (VWindow_system, Qfile_name_history):
10100 * keyboard.h (lispy_function_keys) [WINDOWSNT]:
10101 * w32term.h (w32_system_caret_hwnd, w32_system_caret_height)
10102 (w32_system_caret_x, w32_system_caret_y): Declare extern.
10103
10104 * w32select.c: Don't #include "keyboard.h".
c96bbc66 10105 (run_protected): Add extern declaration for waiting_for_input.
7684e57b
JB
10106
10107 * w32.c (Qlocal, noninteractive1, inhibit_window_system):
10108 * w32console.c (detect_input_pending, read_input_pending)
10109 (encode_terminal_code):
10110 * w32fns.c (quit_char, lispy_function_keys, Qtooltip)
10111 (w32_system_caret_hwnd, w32_system_caret_height, w32_system_caret_x)
10112 (w32_system_caret_y, Qfile_name_history):
10113 * w32font.c (w32font_driver, QCantialias, QCotf, QClang):
10114 * w32inevt.c (reinvoke_input_signal, lispy_function_keys):
10115 * w32menu.c (Qmenu_bar, QCtoggle, QCradio, Qoverriding_local_map)
10116 (Qoverriding_terminal_local_map, Qmenu_bar_update_hook):
10117 * w32proc.c (Qlocal, report_file_error):
10118 * w32term.c (Vwindow_system, updating_frame):
10119 * w32uniscribe.c (initialized, uniscribe_font_driver):
10120 Remove unneeded extern declarations.
10121
2aa46d6c
CY
101222011-03-14 Chong Yidong <cyd@stupidchicken.com>
10123
c96bbc66 10124 * buffer.c (Fmake_indirect_buffer): Fix incorrect assertions.
2aa46d6c 10125
cffc6f3b
CY
101262011-03-13 Chong Yidong <cyd@stupidchicken.com>
10127
10128 * buffer.h (BUF_BEGV, BUF_BEGV_BYTE, BUF_ZV, BUF_ZV_BYTE, BUF_PT)
10129 (BUF_PT_BYTE): Rewrite to handle indirect buffers (Bug#8219).
10130 These macros can no longer be used for assignment.
10131
44f230aa
SM
10132 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer):
10133 Assign struct members directly, instead of using BUF_BEGV etc.
cffc6f3b
CY
10134 (record_buffer_markers, fetch_buffer_markers): New functions for
10135 recording and fetching special buffer markers.
10136 (set_buffer_internal_1, set_buffer_temp): Use them.
10137
10138 * lread.c (unreadchar): Use SET_BUF_PT_BOTH.
10139
10140 * insdel.c (adjust_point): Use SET_BUF_PT_BOTH.
10141
10142 * intervals.c (temp_set_point_both): Use SET_BUF_PT_BOTH.
10143 (get_local_map): Use SET_BUF_BEGV_BOTH and SET_BUF_ZV_BOTH.
10144
10145 * xdisp.c (hscroll_window_tree):
10146 (reconsider_clip_changes): Use PT instead of BUF_PT.
10147
d251f04b
EZ
101482011-03-13 Eli Zaretskii <eliz@gnu.org>
10149
10150 * makefile.w32-in ($(BLD)/editfns.$(O)): Depend on
10151 $(EMACS_ROOT)/lib/intprops.h.
10152
f0c77cd1
PE
101532011-03-13 Paul Eggert <eggert@cs.ucla.edu>
10154
3eca4629
PE
10155 Fix more problems found by GCC 4.5.2's static checks.
10156
7c86ee98
PE
10157 * gtkutil.c (xg_get_pixbuf_from_pixmap): Add cast from char *
10158 to unsigned char * to avoid compiler diagnostic.
b0afc268
PE
10159 (xg_free_frame_widgets): Make it clear that a local variable is
10160 needed only if USE_GTK_TOOLTIP.
01e0b5ad
PE
10161 (gdk_window_get_screen): Make it clear that this macro is needed
10162 only if USE_GTK_TOOLTIP.
1e5524e7
PE
10163 (int_gtk_range_get_value): New function, which avoids a diagnostic
10164 from gcc -Wbad-function-cast.
10165 (xg_set_toolkit_scroll_bar_thumb): Use it.
10166 (xg_tool_bar_callback, xg_tool_item_stale_p): Rewrite to avoid
10167 diagnostic from gcc -Wbad-function-cast.
65dc836c
PE
10168 (get_utf8_string, xg_get_file_with_chooser):
10169 Rename locals to avoid shadowing.
10170 (create_dialog): Move locals to avoid shadowing.
7c86ee98 10171
41729b81
PE
10172 * xgselect.c (xg_select): Remove unused var.
10173
f0c77cd1
PE
10174 * image.c (four_corners_best): Mark locals as initialized.
10175 (gif_load): Initialize transparent_p to zero (Bug#8238).
10176 Mark another local as initialized.
ec6cf4c6 10177 (my_png_error, my_error_exit): Mark with NO_RETURN.
f0c77cd1 10178
ce0ad53d 10179 * image.c (clear_image_cache): Now static.
d5d5a617 10180 (DIM, HAVE_STDLIB_H_1): Remove unused macros.
e22cffbc 10181 (xpm_load): Redo to avoid "discards qualifiers" gcc warning.
77a765fd
PE
10182 (x_edge_detection): Remove unnecessary cast that
10183 gcc -Wbad-function-cast diagnoses.
2037898d 10184 (gif_load): Fix pointer signedness.
6ae141d6
PE
10185 (clear_image_cache, xbm_read_bitmap_data, x_detect_edges):
10186 (jpeg_load, gif_load): Rename locals to avoid shadowing.
ce0ad53d 10187
33383987 101882011-03-12 Paul Eggert <eggert@cs.ucla.edu>
3eca4629 10189
d32df629
PE
10190 Improve quality of tests for time stamp overflow.
10191 For example, without this patch (encode-time 0 0 0 1 1
10192 1152921504606846976) returns the obviously-bogus value (-948597
10193 62170) on my RHEL 5.5 x86-64 host. With the patch, it correctly
10194 reports time overflow. See
10195 <http://lists.gnu.org/archive/html/emacs-devel/2011-03/msg00470.html>.
b8d9bd41
PE
10196 * deps.mk (editfns.o): Depend on ../lib/intprops.h.
10197 * editfns.c: Include limits.h and intprops.h.
10198 (TIME_T_MIN, TIME_T_MAX): New macros.
10199 (time_overflow): Move earlier, to before first use.
10200 (hi_time, lo_time): New functions, for an accurate test for
10201 out-of-range times.
10202 (Fcurrent_time, Fget_internal_run_time, make_time): Use them.
10203 (Fget_internal_run_time): Don't assume time_t fits in int.
10204 (make_time): Use list2 instead of Fcons twice.
10205 (Fdecode_time): More accurate test for out-of-range times.
10206 (check_tm_member): New function.
10207 (Fencode_time): Use it, to test for out-of-range times.
d32df629
PE
10208 (lisp_time_argument): Don't rely on undefined left-shift and
10209 right-shift behavior when checking for time stamp overflow.
8be6f318 10210
fe31d94c
PE
10211 * editfns.c (time_overflow): New function, refactoring common code.
10212 (Fformat_time_string, Fdecode_time, Fencode_time):
10213 (Fcurrent_time_string): Use it.
10214
8be6f318
PE
10215 Move 'make_time' to be next to its inverse 'lisp_time_argument'.
10216 * dired.c (make_time): Move to ...
10217 * editfns.c (make_time): ... here.
10218 * systime.h: Note the move.
10219
09d9db2c 102202011-03-12 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
c47cbdfd 10221
126bc0dc
YM
10222 * fringe.c (update_window_fringes): Remove unused variables.
10223
c47cbdfd
YM
10224 * unexmacosx.c (copy_data_segment): Also copy __got section.
10225 (Bug#8223)
10226
7ac80be9
EZ
102272011-03-12 Eli Zaretskii <eliz@gnu.org>
10228
c96bbc66 10229 * termcap.c [MSDOS]: Include "msdos.h".
058e5dad
EZ
10230 (find_capability, tgetnum, tgetflag, tgetstr, tputs, tgetent):
10231 Constify `char *' arguments and their references according to
10232 prototypes in tparam.h.
10233
ecb0f94d 10234 * deps.mk (termcap.o): Depend on tparam.h and msdos.h.
058e5dad 10235
7ac80be9
EZ
10236 * msdos.c (XMenuAddPane): 3rd argument is `const char *' now.
10237 Adapt all references accordingly.
10238
10239 * msdos.h (XMenuAddPane): 3rd argument is `const char *' now.
10240
ef1fd07e
TT
102412011-03-11 Tom Tromey <tromey@redhat.com>
10242
10243 * buffer.c (syms_of_buffer): Remove obsolete comment.
10244
7ef4b50c
EZ
102452011-03-11 Eli Zaretskii <eliz@gnu.org>
10246
10247 * termhooks.h (encode_terminal_code): Declare prototype.
10248
10249 * msdos.c (encode_terminal_code): Don't declare prototype.
10250
10251 * term.c (encode_terminal_code): Now external again, used by
10252 w32console.c and msdos.c.
10253
44f230aa
SM
10254 * makefile.w32-in ($(BLD)/term.$(O), ($(BLD)/tparam.$(O)):
10255 Depend on $(SRC)/tparam.h, see 2011-03-11T07:24:21Z!eggert@cs.ucla.edu.
7ef4b50c 10256
4b1ec863 102572011-03-11 Paul Eggert <eggert@cs.ucla.edu>
f78faa98 10258
1714f52b 10259 Fix some minor problems found by GCC 4.5.2's static checks.
83316bf4 10260
4b1ec863
PE
10261 * fringe.c (update_window_fringes): Mark locals as initialized
10262 (Bug#8227).
10263 (destroy_fringe_bitmap, init_fringe_bitmap): Now static.
bf60f616 10264
524c7aa6
PE
10265 * alloc.c (mark_fringe_data): Move decl from here ...
10266 * lisp.h (mark_fringe_data) [HAVE_WINDOW_SYSTEM]: ... to here,
10267 to check its interface.
10268 (init_fringe_once): Do not declare unless HAVE_WINDOW_SYSTEM.
10269
a5c0af81 10270 * fontset.c (free_realized_fontset): Now static.
7519b8cd 10271 (Fset_fontset_font): Rename local to avoid shadowing.
cc6e5db1 10272 (fontset_font): Mark local as initialized.
a9a06e0b 10273 (FONTSET_SPEC, FONTSET_REPERTORY, RFONT_DEF_REPERTORY): Remove; unused.
a5c0af81 10274
b4716021
PE
10275 * xrdb.c: Include "xterm.h", to check x_load_resources's interface.
10276
811e9bac 10277 * xselect.c (x_disown_buffer_selections): Remove; not used.
7b83e2f1 10278 (TRACE3) [!defined TRACE_SELECTION]: Remove; not used.
aa0daa9f
PE
10279 (x_own_selection, Fx_disown_selection_internal): Rename locals
10280 to avoid shadowing.
10281 (x_handle_dnd_message): Remove local to avoid shadowing.
811e9bac 10282
7e3ab302
PE
10283 * lisp.h (GCPRO1_VAR, UNGCPRO_VAR): New macros,
10284 so that the caller can use some name other than gcpro1.
10285 (GCPRO1, UNGCPRO): Reimplement in terms of the new macros.
58d2d479
PE
10286 * xfns.c (Fx_create_frame, x_create_tip_frame, Fx_show_tip):
10287 (Fx_backspace_delete_keys_p):
10288 Use them to avoid shadowing, and rename vars to avoid shadowing.
10289 (x_decode_color, x_set_name, x_window): Now static.
6b437900 10290 (Fx_create_frame): Add braces to silence GCC warning.
c0951e53 10291 (Fx_file_dialog, Fx_select_font): Fix pointer signedness.
06b0c8a0
PE
10292 (x_real_positions, xg_set_icon_from_xpm_data, x_create_tip_frame):
10293 Remove unused locals.
7e3ab302
PE
10294 (Fx_create_frame, x_create_tip_frame, Fx_show_tip):
10295 (Fx_backspace_delete_keys_p): Rename locals to avoid shadowing.
10296 Some of these renamings use the new GCPRO1_VAR and UNGCPRO_VAR
10297 macros.
f78faa98 10298
e2b13473
PE
10299 * xterm.h (x_mouse_leave): New decl.
10300
77f23912
PE
10301 * xterm.c (x_copy_dpy_color, x_focus_on_frame, x_unfocus_frame):
10302 Remove unused functions.
cdf4ba58
PE
10303 (x_shift_glyphs_for_insert, XTflash, XTring_bell):
10304 (x_calc_absolute_position): Now static.
7411c686 10305 (XTread_socket): Don't define label "out" unless it's used.
2b07bcff 10306 Don't declare local "event" unless it's used.
ed7bf3a5
PE
10307 (x_iconify_frame, x_free_frame_resources): Don't declare locals
10308 unless they are used.
38d0b34a
PE
10309 (XEMBED_VERSION, xembed_set_info): Don't define unless needed.
10310 (x_fatal_error_signal): Remove; not used.
a6067996
PE
10311 (x_draw_image_foreground, redo_mouse_highlight, XTmouse_position):
10312 (x_scroll_bar_report_motion, handle_one_xevent, x_draw_bar_cursor):
10313 (x_error_catcher, x_connection_closed, x_error_handler):
10314 (x_error_quitter, xembed_send_message, x_iconify_frame):
10315 (my_log_handler): Rename locals to avoid shadowing.
28f1c698 10316 (x_delete_glyphs, x_ins_del_lines): Mark with NO_RETURN.
2a8fade0 10317 (x_connection_closed): Tell GCC not to suggest NO_RETURN.
77f23912 10318
44f230aa
SM
10319 * xfaces.c (clear_face_cache, Fx_list_fonts, Fface_font):
10320 Rename or move locals to avoid shadowing.
6b463e58 10321 (tty_defined_color, merge_face_heights): Now static.
5967d051 10322 (free_realized_faces_for_fontset): Remove; not used.
1e9966ea
PE
10323 (Fx_list_fonts): Mark variable that gcc -Wuninitialized
10324 does not deduce is never used uninitialized.
73719eba
PE
10325 (STRDUPA, LSTRDUPA, FONT_POINT_SIZE_QUANTUM): Remove; not used.
10326 (LFACEP): Define only if XASSERTS, as it's not needed otherwise.
071048a3 10327
426994c3 10328 * terminal.c (store_terminal_param): Now static.
5489860b 10329
032f1620 10330 * xmenu.c (menu_highlight_callback): Now static.
9d66f88e 10331 (set_frame_menubar): Remove unused local.
d4323972 10332 (xmenu_show): Rename parameter to avoid shadowing.
6d1f7fee
PE
10333 (xmenu_show, xdialog_show, xmenu_show): Make local pointers "const"
10334 since they might point to immutable storage.
281585b0
PE
10335 (next_menubar_widget_id): Declare only if USE_X_TOOLKIT,
10336 since it's unused otherwise.
032f1620 10337
367c19e5 10338 * xdisp.c (produce_glyphless_glyph): Initialize lower_xoff.
53df7c11 10339 Add a FIXME, since the code still doesn't look right. (Bug#8215)
9f36b9fd
PE
10340 (Fcurrent_bidi_paragraph_direction): Simplify slightly; this
10341 avoids a gcc -Wuninitialized diagnostic.
0e086e8f 10342 (display_line, BUILD_COMPOSITE_GLYPH_STRING, draw_glyphs):
44a3a108
PE
10343 (note_mouse_highlight): Mark variables that gcc -Wuninitialized
10344 does not deduce are never used uninitialized.
70739cbe 10345
07b48fa9
PE
10346 * lisp.h (IF_LINT): New macro, copied from ../lib-src/emacsclient.c.
10347
8868a238 10348 * xdisp.c (redisplay_window): Rename local to avoid shadowing.
4554d213
PE
10349 * window.c (window_loop, size_window):
10350 (run_window_configuration_change_hook, enlarge_window): Likewise.
8868a238 10351
7e5cf297 10352 * window.c (display_buffer): Now static.
d6550a9f
PE
10353 (size_window): Mark variables that gcc -Wuninitialized
10354 does not deduce are never used uninitialized.
a586633d
PE
10355 * window.h (check_all_windows): New decl, to forestall
10356 gcc -Wmissing-prototypes diagnostic.
5b555da1 10357 * dispextern.h (bidi_dump_cached_states): Likewise.
7e5cf297 10358
f6095868
PE
10359 * charset.h (CHECK_CHARSET_GET_CHARSET): Rename locals to avoid
10360 shadowing.
10361 * charset.c (map_charset_for_dump, Fchar_charset): Likewise.
726929c4
PE
10362 Include <limits.h>.
10363 (Fsort_charsets): Redo min/max calculation to shorten the code a bit
10364 and to avoid gcc -Wuninitialized warning.
89ef49df
PE
10365 (load_charset_map): Mark variables that gcc -Wuninitialized
10366 does not deduce are never used uninitialized.
53df7c11 10367 (load_charset): Abort instead of using uninitialized var (Bug#8229).
f6095868 10368
f38b440c
PE
10369 * coding.c (coding_set_source, coding_set_destination):
10370 Use "else { /* comment */ }" rather than "else /* comment */;"
10371 for clarity, and to avoid gcc -Wempty-body warning.
2735d060
PE
10372 (Fdefine_coding_system_internal): Don't redeclare 'i' inside
10373 a block, when the outer 'i' will do.
10374 (decode_coding_utf_8, decode_coding_utf_16, detect_coding_emacs_mule):
10375 (emacs_mule_char, decode_coding_emacs_mule, detect_coding_iso_2022):
10376 (decode_coding_iso_2022, decode_coding_sjis, decode_coding_big5):
10377 (decode_coding_raw_text, decode_coding_charset, get_translation_table):
10378 (Fdecode_sjis_char, Fdefine_coding_system_internal):
10379 Rename locals to avoid shadowing.
10380 * character.h (FETCH_STRING_CHAR_ADVANCE): Likewise.
e2f1bab9
PE
10381 * coding.c (emacs_mule_char, encode_invocation_designation):
10382 Now static, since they're not used elsewhere.
413bb2db 10383 (decode_coding_iso_2022): Add "default: abort ();" as a safety check.
c4a63b12 10384 (decode_coding_object, encode_coding_object, detect_coding_system):
ee05f961
PE
10385 (decode_coding_emacs_mule): Mark variables that gcc
10386 -Wuninitialized does not deduce are never used uninitialized.
160b01f6
PE
10387 (detect_coding_iso_2022): Initialize a local variable that might
10388 be used uninitialized. Leave a FIXME because it's not clear that
53df7c11 10389 this initialization is needed. (Bug#8211)
5f58e762
PE
10390 (ISO_CODE_LF, ISO_CODE_CR, CODING_ISO_FLAG_EUC_TW_SHIFT):
10391 (ONE_MORE_BYTE_NO_CHECK, UTF_BOM, UTF_16_INVALID_P):
10392 (SHIFT_OUT_OK, ENCODE_CONTROL_SEQUENCE_INTRODUCER):
10393 (ENCODE_DIRECTION_R2L, ENCODE_DIRECTION_L2R):
10394 Remove unused macros.
f38b440c 10395
232b38b9 10396 * category.c (hash_get_category_set): Remove unused local var.
9f3b5e69 10397 (copy_category_table): Now static, since it's not used elsewhere.
d0891610 10398 * character.c (string_count_byte8): Likewise.
232b38b9 10399
fb90da1b
PE
10400 * ccl.c (CCL_WRITE_STRING, CCL_ENCODE_CHAR, Fccl_execute_on_string):
10401 (Fregister_code_conversion_map): Rename locals to avoid shadowing.
10402
fb93dbc2
PE
10403 * chartab.c (copy_sub_char_table): Now static, since it's not used
10404 elsewhere.
5c156ace
PE
10405 (sub_char_table_ref_and_range, char_table_ref_and_range):
10406 Rename locals to avoid shadowing.
bbcd0949 10407 (ASET_RANGE, GET_SUB_CHAR_TABLE): Remove unused macros.
fb93dbc2 10408
7d3b3862 10409 * bidi.c (bidi_check_type): Now static, since it's not used elsewhere.
630d6892 10410 (BIDI_BOB): Remove unused macro.
7d3b3862 10411
6be7d3da
PE
10412 * cm.c (cmgoto): Mark variables that gcc -Wuninitialized does not
10413 deduce are never used uninitialized.
c2ed9c8b 10414 * term.c (encode_terminal_code): Likewise.
6be7d3da 10415
75f8807f 10416 * term.c (encode_terminal_code): Now static. Remove unused local.
72abad34 10417
50938595
PE
10418 * tparam.h: New file.
10419 * term.c, tparam.h: Include it.
10420 * deps.mk (term.o, tparam.o): Depend on tparam.h.
10421 * term.c (tputs, tgetent, tgetflag, tgetnum, tparam, tgetstr):
10422 Move these decls to tparam.h, and make them agree with what
10423 is actually in tparam.c. The previous trick of using incompatible
10424 decls in different modules does not conform to the C standard.
10425 All callers of tparam changed to use tparam's actual API.
10426 * tparam.c (tparam1, tparam, tgoto):
10427 Use const pointers where appropriate.
10428
fbceeba2
PE
10429 * cm.c (calccost, cmgoto): Use const pointers where appropriate.
10430 * cm.h (struct cm): Likewise.
10431 * dispextern.h (do_line_insertion_deletion_costs): Likewise.
10432 * scroll.c (ins_del_costs, do_line_insertion_deletion_costs): Likewise.
10433 * term.c (tty_ins_del_lines, calculate_costs, struct fkey_table):
10434 (term_get_fkeys_1, append_glyphless_glyph, produce_glyphless_glyph):
10435 (turn_on_face, init_tty): Likewise.
10436 * termchar.h (struct tty_display_info): Likewise.
fbceeba2 10437
7f3f1250
PE
10438 * term.c (term_mouse_position): Rename local to avoid shadowing.
10439
e6ca6543
PE
10440 * alloc.c (mark_ttys): Move decl from here ...
10441 * lisp.h (mark_ttys): ... to here, so that it's checked against defn.
10442
c40f8d15
AS
104432011-03-11 Andreas Schwab <schwab@linux-m68k.org>
10444
10445 * .gdbinit (pwinx, xbuffer): Fix access to buffer name.
10446
cfe0661d
JB
104472011-03-09 Juanma Barranquero <lekktu@gmail.com>
10448
10449 * search.c (compile_pattern_1): Remove argument regp, unused since
10450 revid:rms@gnu.org-19941211082627-3x1g1wyqkjmwloig.
10451 (compile_pattern): Don't pass it.
10452
0afb4571
J
104532011-03-08 Jan Djärv <jan.h.d@swipnet.se>
10454
10455 * xterm.h (DEFAULT_GDK_DISPLAY): New define.
10456 (GDK_WINDOW_XID, gtk_widget_get_preferred_size): New defines
10457 for ! HAVE_GTK3.
10458 (GTK_WIDGET_TO_X_WIN): Use GDK_WINDOW_XID.
10459
10460 * xmenu.c (menu_position_func): Call gtk_widget_get_preferred_size.
10461
10462 * gtkutil.c: Include gtkx.h if HAVE_GTK3. If ! HAVE_GTK3, define
10463 gdk_window_get_screen, gdk_window_get_geometry,
10464 gdk_x11_window_lookup_for_display and GDK_KEY_g.
10465 (xg_set_screen): Use DEFAULT_GDK_DISPLAY.
10466 (xg_get_pixbuf_from_pixmap): New function.
10467 (xg_get_pixbuf_from_pix_and_mask): Change parameters from GdkPixmap
10468 to Pixmap, take frame as parameter, remove GdkColormap parameter.
10469 Call xg_get_pixbuf_from_pixmap instead of
10470 gdk_pixbuf_get_from_drawable.
10471 (xg_get_image_for_pixmap): Do not make GdkPixmaps, call
10472 xg_get_pixbuf_from_pix_and_mask with Pixmap parameters instead.
10473 (xg_check_special_colors): Use GtkStyleContext and its functions
10474 for HAVE_GTK3.
10475 (xg_prepare_tooltip, xg_hide_tooltip): Call gdk_window_get_screen.
10476 (xg_prepare_tooltip, create_dialog, menubar_map_cb)
10477 (xg_update_frame_menubar, xg_tool_bar_detach_callback)
44f230aa
SM
10478 (xg_tool_bar_attach_callback, xg_update_tool_bar_sizes):
10479 Call gtk_widget_get_preferred_size.
0afb4571
J
10480 (xg_frame_resized): gdk_window_get_geometry only takes 5
10481 parameters.
44f230aa
SM
10482 (xg_win_to_widget, xg_event_is_for_menubar):
10483 Call gdk_x11_window_lookup_for_display.
0afb4571
J
10484 (xg_set_widget_bg): New function.
10485 (delete_cb): New function.
895009e1 10486 (xg_create_frame_widgets): Connect delete-event to delete_cb.
5c32d3f2 10487 Call xg_set_widget_bg. Only set background pixmap for ! HAVE_GTK3
0afb4571
J
10488 (xg_set_background_color): Call xg_set_widget_bg.
10489 (xg_set_frame_icon): Call xg_get_pixbuf_from_pix_and_mask.
10490 (xg_create_scroll_bar): vadj is a GtkAdjustment for HAVE_GTK3.
10491 Only call gtk_range_set_update_policy if ! HAVE_GTK3.
10492 (xg_make_tool_item): Only connect xg_tool_bar_item_expose_callback
10493 if ! HAVE_GTK3.
10494 (update_frame_tool_bar): Call gtk_widget_hide.
10495 (xg_initialize): Use GDK_KEY_g.
10496
10497 * xsmfns.c (gdk_set_sm_client_id): Define to gdk_set_sm_client_id
10498 if ! HAVE_GTK3
10499 (x_session_initialize): Call gdk_x11_set_sm_client_id.
10500
10501 * xterm.c (XFillRectangle): Use cairo routines for HAVE_GTK3.
10502 (x_term_init): Disable Xinput(2) with GDK_CORE_DEVICE_EVENTS.
10503 Load ~/emacs.d/gtkrc only for ! HAVE_GTK3.
10504
1c2cc4ef
JB
105052011-03-08 Juanma Barranquero <lekktu@gmail.com>
10506
10507 * w32xfns.c (select_palette): Check success of RealizePalette against
10508 GDI_ERROR, not zero.
10509
33383987 10510See ChangeLog.11 for earlier changes.
aac0c6e3
MR
10511
10512;; Local Variables:
10513;; coding: utf-8
aac0c6e3
MR
10514;; End:
10515
acaf905b 10516 Copyright (C) 2011-2012 Free Software Foundation, Inc.
aac0c6e3
MR
10517
10518 This file is part of GNU Emacs.
10519
10520 GNU Emacs is free software: you can redistribute it and/or modify
10521 it under the terms of the GNU General Public License as published by
10522 the Free Software Foundation, either version 3 of the License, or
10523 (at your option) any later version.
10524
10525 GNU Emacs is distributed in the hope that it will be useful,
10526 but WITHOUT ANY WARRANTY; without even the implied warranty of
10527 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10528 GNU General Public License for more details.
10529
10530 You should have received a copy of the GNU General Public License
10531 along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.