* process.h (struct Lisp_Process): Members tick and update_tick
[bpt/emacs.git] / src / ChangeLog
CommitLineData
c62c46f3 12012-04-22 Paul Eggert <eggert@cs.ucla.edu>
3164aeac 2
e4d81efc
PE
3 * process.h (struct Lisp_Process): Members tick and update_tick
4 are now of type EMACS_INT, not int.
5
2121662f 6 Fix integer width and related bugs (Bug#9874).
eb106a49 7 * alloc.c (pure_bytes_used_lisp, pure_bytes_used_non_lisp):
d311d28c
PE
8 (allocate_vectorlike, buffer_memory_full, struct sdata, SDATA_SIZE)
9 (string_bytes, check_sblock, allocate_string_data):
10 (compact_small_strings, Fmake_bool_vector, make_string)
11 (make_unibyte_string, make_multibyte_string)
12 (make_string_from_bytes, make_specified_string)
13 (allocate_vectorlike, Fmake_vector, find_string_data_in_pure)
14 (make_pure_string, make_pure_c_string, make_pure_vector, Fpurecopy)
15 (mark_vectorlike):
16 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
17 (allocate_pseudovector):
18 Use int, not EMACS_INT, where int is wide enough.
19 (inhibit_garbage_collection, Fgarbage_collect):
20 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
21 * bidi.c (bidi_mirror_char): Use EMACS_INT, not int, where
22 int might not be wide enough.
23 (bidi_cache_search, bidi_cache_find, bidi_init_it)
24 (bidi_count_bytes, bidi_char_at_pos, bidi_fetch_char)
25 (bidi_at_paragraph_end, bidi_find_paragraph_start)
26 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak)
27 (bidi_level_of_next_char, bidi_move_to_visually_next):
28 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
29 * buffer.c (copy_overlays, Fgenerate_new_buffer_name)
30 (Fkill_buffer, Fset_buffer_major_mode)
31 (advance_to_char_boundary, Fbuffer_swap_text)
32 (Fset_buffer_multibyte, overlays_at, overlays_in)
33 (overlay_touches_p, struct sortvec, record_overlay_string)
34 (overlay_strings, recenter_overlay_lists)
35 (adjust_overlays_for_insert, adjust_overlays_for_delete)
36 (fix_start_end_in_overlays, fix_overlays_before, modify_overlay)
37 (Fmove_overlay, Fnext_overlay_change, Fprevious_overlay_change)
38 (Foverlay_recenter, last_overlay_modification_hooks_used)
39 (report_overlay_modification, evaporate_overlays, enlarge_buffer_text):
40 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
977b0e45
PE
41 (validate_region): Omit unnecessary test for b <= e,
42 since that's guaranteed by the previous test.
d311d28c
PE
43 (adjust_overlays_for_delete): Avoid pos + length overflow.
44 (Fmove_overlay, Fdelete_overlay, add_overlay_mod_hooklist)
45 (report_overlay_modification):
46 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
47 (Foverlays_at, Fnext_overlay_change, Fprevious_overlay_change):
48 Omit pointer cast, which isn't needed anyway, and doesn't work
49 after the EMACS_INT -> ptrdiff_t change.
79cce3f2
PE
50 (Fmove_overlay): Delete an evaporating overlay
51 if it becomes empty after its bounds are adjusted to fit within
52 its buffer. Without this fix, in a nonempty buffer (let ((o
53 (make-overlay 1 2))) (overlay-put o 'evaporate t) (move-overlay o 0 1))
54 yields an empty overlay that has the evaporate property, which is
55 not supposed to happen. (Bug#9642)
d311d28c
PE
56 * buffer.h: Adjust decls to match defn changes elsewhere.
57 (struct buffer_text, struct buffer):
58 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
59 Use EMACS_INT, not int, where int might not be wide enough.
39b5db3b
PE
60 * bytecode.c (unmark_byte_stack, exec_byte_code): Use ptrdiff_t,
61 not int, to avoid needless 32-bit limit on 64-bit hosts.
62 (exec_byte_code): Use tighter memory-full test, one that checks
63 for alloca overflow. Don't compute the address of the object just
64 before an array, as that's not portable. Use EMACS_INT, not
65 ptrdiff_t or int, where ptrdiff_t or int might not be wide enough.
d311d28c
PE
66 * callint.c (Fcall_interactively):
67 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
68 * callproc.c (call_process_kill, Fcall_process):
69 Don't assume pid_t fits into an Emacs fixnum.
70 (call_process_cleanup, Fcall_process, child_setup):
71 Don't assume pid_t fits into int.
72 (call_process_cleanup, Fcall_process, delete_temp_file)
73 (Fcall_process_region):
74 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
75 (Fcall_process): Simplify handling of volatile integers.
76 Use int, not EMACS_INT, where int will do.
77 * casefiddle.c (casify_object, casify_region, operate_on_word)
78 (Fupcase_word, Fdowncase_word, Fcapitalize_word):
79 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
80 (casify_object): Avoid integer overflow when overallocating buffer.
81 * casetab.c (set_identity, shuffle): Prefer int to unsigned when
45c2afd6 82 either works. Use lint_assume to convince GCC 4.6.1 that it's OK.
d311d28c
PE
83 * category.c (Fchar_category_set): Don't assume fixnum fits in int.
84 * category.h (CATEGORYP): Don't assume arg is nonnegative.
85 * ccl.c (GET_CCL_INT): Remove; no longer needed, since the
86 integers are now checked earlier. All uses replaced with XINT.
87 (ccl_driver):
88 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
89 For CCL_MapSingle, check that content and value are in int range.
c801946a
PE
90 (ccl_driver, Fregister_code_conversion_map):
91 Check that Vcode_version_map_vector is a vector.
d311d28c
PE
92 (resolve_symbol_ccl_program): Check that vector header is in range.
93 Always copy the vector, so that we can check its contents reliably
94 now rather than having to recheck each instruction as it's being
95 executed. Check that vector words fit in 'int'.
96 (ccl_get_compiled_code, Fregister_ccl_program)
97 (Fregister_code_conversion_map): Use ptrdiff_t, not int, for
98 program indexes, to avoid needless 32-bit limit on 64-bit hosts.
99 (Fccl_execute, Fccl_execute_on_string): Check that initial reg
100 contents are in range.
101 (Fccl_execute_on_string): Check that status is in range.
102 * ccl.h (struct ccl_program.idx): Now ptrdiff_t, not int.
103 * character.c (char_resolve_modifier_mask, Fchar_resolve_modifiers):
104 Accept and return EMACS_INT, not int, because callers can pass values
105 out of 'int' range.
106 (c_string_width, strwidth, lisp_string_width, chars_in_text)
107 (multibyte_chars_in_text, parse_str_as_multibyte)
108 (str_as_multibyte, count_size_as_multibyte, str_to_multibyte)
109 (str_as_unibyte, str_to_unibyte, string_count_byte8)
110 (string_escape_byte8, Fget_byte):
111 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
a14e1568 112 (Funibyte_string): Use CHECK_RANGED_INTEGER, not CHECK_NATNUM, to
d311d28c
PE
113 avoid mishandling large integers.
114 * character.h: Adjust decls to match defn changes elsewhere.
115 * charset.c (load_charset_map_from_file, find_charsets_in_text)
116 (Ffind_charset_region):
117 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
118 (load_charset_map_from_file): Redo idx calculation to avoid overflow.
119 (load_charset_map_from_vector, Fdefine_charset_internal):
3c7649c1 120 Don't assume fixnum fits in int.
d311d28c
PE
121 (load_charset_map_from_vector, Fmap_charset_chars):
122 Remove now-unnecessary CHECK_NATNUMs.
123 (Fdefine_charset_internal): Check ranges here, more carefully.
3c7649c1
PE
124 Don't rely on undefined behavior with signed left shift overflow.
125 Don't assume unsigned int fits into fixnum, or that fixnum fits
126 into unsigned int. Don't require max_code to be a valid fixnum;
127 that's not true for gb10830 4-byte on a 32-bit host. Allow
128 invalid_code to be a cons, for the same reason. Require code_offset
129 to be a character. Avoid int overflow if max_char is close
130 to INT_MAX.
131 (CODE_POINT_TO_INDEX): On 32-bit hosts, return int, not unsigned;
132 this is intended anyway and avoids some undefined behavior.
133 (load_charset_map): Pass unsigned, not int, as 2nd arg of
134 INDEX_TO_CODE_POINT, as that's what it expects.
135 (Funify_charset, encode_char): Don't stuff unsigned vals into int vars.
60ad3eab
PE
136 * charset.h (DECODE_CHAR): Return int, not unsigned;
137 this is what was intended anyway, and it avoids undefined behavior.
138 (CHARSET_OFFSET): Remove unused macro, instead of fixing its
139 integer-overflow issues.
140 (ENCODE_CHAR): Return unsigned on all hosts, not just on 32-bit hosts.
141 Formerly, it returned EMACS_INT on 64-bit hosts in the common case
142 where the argument is EMACS_INT, and this behavior is not intended.
d311d28c
PE
143 * chartab.c (Fmake_char_table, Fset_char_table_range)
144 (uniprop_get_decoder, uniprop_get_encoder):
145 Don't assume fixnum fits in int.
146 * cmds.c (move_point): New function, that does the gist of
147 Fforward_char and Fbackward_char, but does so while checking
148 for integer overflow more accurately.
c96e5d6a 149 (Fforward_char, Fbackward_char): Use it.
d311d28c
PE
150 (Fforward_line, Fend_of_line, internal_self_insert)
151 (internal_self_insert):
152 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
153 Fix a FIXME, by checking for integer overflow when calculating
154 target_clm and actual_clm.
155 * coding.c (detect_coding_XXX, encode_coding_XXX, CODING_DECODE_CHAR)
8f50130c 156 (CODING_ENCODE_CHAR, CODING_CHAR_CHARSET, CODING_CHAR_CHARSET_P)
d311d28c
PE
157 (ASSURE_DESTINATION, coding_alloc_by_realloc)
158 (coding_alloc_by_making_gap, alloc_destination)
159 (detect_coding_utf_8, encode_coding_utf_8, decode_coding_utf_16)
160 (encode_coding_utf_16, detect_coding_emacs_mule)
161 (decode_coding_emacs_mule, encode_coding_emacs_mule)
162 (detect_coding_iso_2022, decode_coding_iso_2022)
163 (encode_invocation_designation, encode_designation_at_bol)
164 (encode_coding_iso_2022, detect_coding_sjis, detect_coding_big5)
165 (decode_coding_sjis, decode_coding_big5, encode_coding_sjis)
166 (encode_coding_big5, detect_coding_ccl, decode_coding_ccl)
167 (encode_coding_ccl, encode_coding_raw_text)
168 (detect_coding_charset, decode_coding_charset)
169 (encode_coding_charset, detect_eol, decode_eol, produce_chars)
170 (produce_composition, produce_charset, produce_annotation)
171 (decode_coding, handle_composition_annotation)
172 (handle_charset_annotation, consume_chars, decode_coding_gap)
173 (decode_coding_object, encode_coding_object, detect_coding_system)
174 (Ffind_coding_systems_region_internal, Fcheck_coding_systems_region)
175 (code_convert_region, code_convert_string)
8f50130c
PE
176 (Fdefine_coding_system_internal)
177 (coding_set_source, coding_set_destination):
d311d28c
PE
178 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
179 (setup_iso_safe_charsets, consume_chars, Funencodable_char_position)
180 (Fdefine_coding_system_internal):
181 Don't assume fixnums fit in int.
182 (decode_coding_gap, decode_coding_object, encode_coding_object)
5895d7b9 183 (Fread_coding_system, Fdetect_coding_region)
2c6a9faa
PE
184 (Funencodable_char_position, Fcheck_coding_systems_region)
185 (get_translation, handle_composition_annotation, consume_chars):
d311d28c 186 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
977b0e45 187 (consume_chars): Rewrite to not calculate an address outside buffer.
d311d28c 188 (Ffind_operation_coding_system): NATNUMP can eval its arg twice.
7b09a37a 189 Don't access memory outside of the args array.
d311d28c 190 (Fdefine_coding_system_internal): Check for charset-id overflow.
47664caa
PE
191 (ENCODE_ISO_CHARACTER): Use unsigned, not int, to store the unsigned
192 result of ENCODE_CHAR.
d311d28c
PE
193 * coding.h: Adjust decls to match defn changes elsewhere.
194 (struct coding_system):
195 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
196 * composite.c (get_composition_id, find_composition)
197 (run_composition_function, update_compositions)
198 (compose_text, composition_gstring_put_cache)
199 (composition_gstring_p, composition_gstring_width)
200 (fill_gstring_header, fill_gstring_body, autocmp_chars)
201 (composition_compute_stop_pos, composition_reseat_it)
202 (composition_update_it, struct position_record)
203 (find_automatic_composition, composition_adjust_point)
204 (Fcomposition_get_gstring, Ffind_composition_internal):
205 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
206 (update_compositions):
207 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
208 * composite.h: Adjust decls to match defn changes elsewhere.
209 (struct composition):
210 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
211 * data.c (let_shadows_buffer_binding_p, let_shadows_global_binding_p):
212 Do not attempt to compute the address of the object just before a
213 buffer; this is not portable.
214 (Faref, Faset):
215 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
216 (Faset): Use int, not EMACS_INT, where int is wide enough.
217 (Fstring_to_number): Don't assume fixnums fit in int.
218 (Frem): Don't assume arg is nonnegative.
219 * dbusbind.c (xd_append_arg): Check for integers out of range.
220 (Fdbus_call_method): Don't overflow the timeout int.
221 * dired.c (directory_files_internal, file_name_completion, scmp)
222 (file_name_completion_stat):
223 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
224 (file_name_completion): Don't overflow matchcount.
225 (file_name_completion_stat): Use SAFE_ALLOCA, not alloca.
226 * dispextern.h: Adjust decls to match defn changes elsewhere.
227 (struct text_pos, struct glyph, struct bidi_saved_info)
228 (struct bidi_string_data, struct bidi_it, struct composition_it)
229 (struct it):
230 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
231 (struct display_pos, struct composition_it, struct it):
232 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
233 * dispnew.c (increment_matrix_positions)
234 (increment_row_positions, mode_line_string)
235 (marginal_area_string):
236 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
54e1617f 237 (change_frame_size_1, Fredisplay, Fframe_or_buffer_changed_p):
d311d28c
PE
238 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
239 (duration_to_sec_usec): New function, to check for overflow better.
240 (Fsleep_for, sit_for): Use it.
241 * doc.c (get_doc_string, store_function_docstring):
242 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
243 (get_doc_string, Fsnarf_documentation):
244 Use int, not EMACS_INT, where int is wide enough.
245 (get_doc_string):
246 Use SAFE_ALLOCA, not alloca.
247 Check for overflow when converting EMACS_INT to off_t.
248 * doprnt.c (doprnt):
249 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
250 * editfns.c (init_editfns, Fuser_uid, Fuser_real_uid):
251 Don't assume uid_t fits into fixnum.
252 (buildmark, Fgoto_char, overlays_around, find_field, Fdelete_field)
253 (Ffield_string, Ffield_string_no_properties, Ffield_beginning)
254 (Ffield_end, Fconstrain_to_field, Fline_beginning_position)
255 (Fline_end_position, Fprevious_char, Fchar_after, Fchar_before)
256 (general_insert_function)
257 (Finsert_char, make_buffer_string, make_buffer_string_both)
258 (update_buffer_properties, Fbuffer_substring)
259 (Fbuffer_substring_no_properties, Fcompare_buffer_substrings)
260 (Fsubst_char_in_region, check_translation)
261 (Ftranslate_region_internal, save_restriction_restore, Fformat)
262 (transpose_markers, Ftranspose_regions):
263 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
264 (clip_to_bounds): Move to lisp.h as an inline function).
265 (Fconstrain_to_field): Don't assume integers are nonnegative.
266 (Fline_beginning_position, Fsave_excursion, Fsave_current_buffer):
267 (Fsubst_char_in_region, Fsave_restriction):
268 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
269 (Femacs_pid): Don't assume pid_t fits into fixnum.
270 (lo_time): Use int, not EMACS_INT, when int suffices.
271 (lisp_time_argument): Check for usec out of range.
272 (Fencode_time): Don't assume fixnum fits in int.
3f4eabd1
PE
273 (Fuser_login_name, Fuser_full_name): Signal an error
274 if a uid argument is out of range, rather than relying on
275 undefined behavior.
c8d5c857
PE
276 (Fformat_time_string): Remove now-unnecessary check.
277 lisp_time_argument checks for out-of-range usec now.
d311d28c
PE
278 * emacs.c (gdb_valbits, gdb_gctypebits): Now int, not EMACS_INT.
279 (gdb_data_seg_bits): Now uintptr_t, not EMACS_INT.
280 (PVEC_FLAG, gdb_array_mark_flag): Now ptrdiff_t, not EMACS_INT.
281 (init_cmdargs, Fdump_emacs):
282 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
283 (Fkill_emacs): Don't assume fixnum fits in int; instead, take just
284 the bottom (typically) 32 bits of the fixnum.
285 * eval.c (specpdl_size, call_debugger):
286 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
287 (when_entered_debugger, Fbacktrace_debug):
288 Don't assume fixnum can fit in int.
289 (Fdefvaralias, Fdefvar): Do not attempt to compute the address of
290 the object just before a buffer; this is not portable.
291 (FletX, Flet, Funwind_protect, do_autoload, Feval, funcall_lambda)
292 (grow_specpdl, unbind_to):
293 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
294 (Fapply, apply_lambda): Don't assume ptrdiff_t can hold fixnum.
295 (grow_specpdl): Simplify allocation by using xpalloc.
856bbc81 296 (Fprog1, Fprog2): Don't assume list length fits in int. Simplify.
d311d28c
PE
297 * fileio.c (Ffind_file_name_handler, Fcopy_file, Frename_file)
298 (Finsert_file_contents, Fwrite_region, Fdo_auto_save):
299 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
300 (Ffind_file_name_handler, non_regular_inserted, Finsert_file_contents)
301 (a_write, e_write):
302 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
303 (Fcopy_file, non_regular_nbytes, read_non_regular)
304 (Finsert_file_contents):
305 Use int, not EMACS_INT, where int is wide enough.
306 (READ_BUF_SIZE): Verify that it fits in int.
307 (Finsert_file_contents): Check that counts are in proper range,
308 rather than assuming fixnums fit into ptrdiff_t etc.
309 Don't assume fixnums fit into int.
125b3835 310 * floatfns.c (Fexpt): Avoid undefined signed * signed overflow.
5895d7b9
PE
311 * fns.c (Fcompare_strings, Fstring_lessp, struct textprop_rec, concat)
312 (string_char_byte_cache_charpos, string_char_byte_cache_bytepos)
d311d28c
PE
313 (string_char_to_byte, string_byte_to_char)
314 (string_make_multibyte, string_to_multibyte)
315 (string_make_unibyte, Fstring_as_unibyte, Fstring_as_multibyte)
316 (Fstring_to_unibyte, Fsubstring, Fsubstring_no_properties)
317 (substring_both, Fdelete, internal_equal, Ffillarray)
318 (Fclear_string, mapcar1)
319 (Fbase64_encode_region, Fbase64_encode_string, base64_encode_1)
320 (Fbase64_decode_region, Fbase64_decode_string, base64_decode_1)
321 (larger_vector, make_hash_table, maybe_resize_hash_table)
322 (hash_lookup, hash_remove_from_table, hash_clear, sweep_weak_table)
323 (Fmaphash, secure_hash):
324 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
325 (concat): Check for string index and length overflow.
326 (Fmapconcat): Don't assume fixnums fit into ptrdiff_t.
327 (Frequire):
328 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
329 (larger_vector): New API (vec, incr_min, size_max) replaces old
330 one (vec, new_size, init). This catches size overflow.
331 INIT was removed because it was always Qnil.
332 All callers changed.
333 (INDEX_SIZE_BOUND): New macro, which calculates more precisely
334 the upper bound on a hash table index size.
335 (make_hash_table, maybe_resize_hash_table): Use it.
336 (secure_hash): Computer start_byte and end_byte only after
337 they're known to be in ptrdiff_t range.
338 * font.c (font_intern_prop, font_at, font_range, Ffont_shape_gstring)
339 (Ffont_get_glyphs, Ffont_at):
340 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
341 (font_style_to_value, font_prop_validate_style, font_expand_wildcards)
342 (Flist_fonts, Fopen_font):
343 Don't assume fixnum can fit in int.
344 (check_gstring): Don't assume index can fit in int.
345 (font_match_p): Check that fixnum is a character, not a nonnegative
346 fixnum, since the later code needs to stuff it into an int.
347 (font_find_for_lface): Use SAFE_ALLOCA_LISP, not alloca.
348 (font_fill_lglyph_metrics): Use unsigned, not EMACS_INT, to avoid
349 conversion overflow issues.
350 (Fopen_font): Check for integer out of range.
351 (Ffont_get_glyphs): Don't assume index can fit in int.
352 * font.h: Adjust decls to match defn changes elsewhere.
353 * fontset.c (reorder_font_vector): Redo score calculation to avoid
354 integer overflow.
355 (num_auto_fontsets, fontset_from_font): Use ptrdiff_t, not
356 printmax_t, where ptrdiff_t is wide enough.
357 (Finternal_char_font):
358 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
359 * frame.c (Fset_mouse_position, Fset_mouse_pixel_position)
360 (Fset_frame_height, Fset_frame_width, Fset_frame_size)
361 (Fset_frame_position, x_set_frame_parameters)
362 (x_set_line_spacing, x_set_border_width)
363 (x_set_internal_border_width, x_set_alpha, x_figure_window_size):
364 Check that fixnums are in proper range for system types.
365 (frame_name_fnn_p, Fframe_parameter, Fmodify_frame_parameters):
366 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
367 (Fmodify_frame_parameters): Don't assume fixnum fits in int.
368 Use SAFE_ALLOCA_LISP, not alloca.
369 * frame.h (struct frame): Use intptr_t, not EMACS_INT, where
370 intptr_t is wide enough.
371 * fringe.c (lookup_fringe_bitmap, get_logical_fringe_bitmap)
372 (Fdefine_fringe_bitmap): Don't assume fixnum fits in int.
373 (Ffringe_bitmaps_at_pos): Don't assume index fits in int.
374 Check for fixnum out of range.
375 * ftfont.c (ftfont_list): Don't assume index fits in int.
376 Check that fixnums are in proper range for system types.
377 (ftfont_shape_by_flt):
378 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
d311d28c
PE
379 * gnutls.c (emacs_gnutls_write, emacs_gnutls_read):
380 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
381 (Fgnutls_error_fatalp, Fgnutls_error_string, Fgnutls_boot):
382 Check that fixnums are in proper range for system types.
383 * gnutls.h: Adjust decls to match defn changes elsewhere.
384 * gtkutil.c (xg_dialog_run):
385 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
386 (update_frame_tool_bar):
387 Check that fixnums are in proper range for system types.
388 * image.c (parse_image_spec): Redo count calculation to avoid overflow.
5895d7b9 389 (lookup_image): Check that fixnums are in range for system types.
d311d28c
PE
390 * indent.c (last_known_column, last_known_column_point):
391 (current_column_bol_cache):
392 (skip_invisible, current_column, check_display_width):
393 (check_display_width, scan_for_column, current_column_1)
394 (Findent_to, Fcurrent_indentation, position_indentation)
395 (indented_beyond_p, Fmove_to_column, compute_motion):
396 (Fcompute_motion, Fvertical_motion):
397 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
398 (last_known_column_modified): Use EMACS_INT, not int.
399 (check_display_width):
400 (Fcompute_motion):
401 Check that fixnums and floats are in proper range for system types.
402 (compute_motion): Don't assume index or fixnum fits in int.
403 (compute_motion, Fcompute_motion):
404 Use int, not EMACS_INT, when it is wide enough.
405 (vmotion): Omit local var start_hpos that is always 0; that way
406 we don't need to worry about overflow in expressions involving it.
407 * indent.h: Adjust decls to match defn changes elsewhere.
408 (struct position):
409 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
410 Use int, not EMACS_INT, where int is wide enough.
411 Remove unused members ovstring_chars_done and tab_offset;
412 all uses removed.
413 * insdel.c (move_gap, move_gap_both, gap_left, gap_right)
414 (adjust_markers_for_delete, adjust_markers_for_insert, adjust_point)
415 (adjust_markers_for_replace, make_gap_larger, make_gap_smaller)
416 (make_gap, copy_text, insert, insert_and_inherit)
417 (insert_before_markers, insert_before_markers_and_inherit)
418 (insert_1, count_combining_before, count_combining_after)
419 (insert_1_both, insert_from_string)
420 (insert_from_string_before_markers, insert_from_string_1)
421 (insert_from_gap, insert_from_buffer, insert_from_buffer_1)
422 (adjust_after_replace, adjust_after_insert, replace_range)
423 (replace_range_2, del_range, del_range_1, del_range_byte)
424 (del_range_both, del_range_2, modify_region)
425 (prepare_to_modify_buffer, signal_before_change)
426 (signal_after_change, Fcombine_after_change_execute):
427 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
428 * intervals.c (traverse_intervals, rotate_right, rotate_left)
429 (balance_an_interval, split_interval_right, split_interval_left)
430 (find_interval, next_interval, update_interval)
431 (adjust_intervals_for_insertion, delete_node, delete_interval)
432 (interval_deletion_adjustment, adjust_intervals_for_deletion)
433 (static_offset_intervals, offset_intervals)
434 (merge_interval_right, merge_interval_left, make_new_interval)
435 (graft_intervals_into_buffer, temp_set_point_both)
436 (temp_set_point, set_point, adjust_for_invis_intang)
437 (set_point_both, move_if_not_intangible, get_property_and_range)
438 (get_local_map, copy_intervals, copy_intervals_to_string)
439 (compare_string_intervals, set_intervals_multibyte_1):
440 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
441 * intervals.h: Adjust decls to match defn changes elsewhere.
442 (struct interval):
443 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
444 * keyboard.c (this_command_key_count, this_single_command_key_start)
445 (before_command_key_count, before_command_echo_length, echo_now)
446 (echo_length, recursive_edit_1, Frecursive_edit, Ftrack_mouse)
447 (command_loop_1, safe_run_hooks, read_char, timer_check_2)
448 (menu_item_eval_property, read_key_sequence, Fread_key_sequence)
449 (Fread_key_sequence_vector, Fexecute_extended_command, Fsuspend_emacs):
450 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
451 (last_non_minibuf_size, last_point_position, echo_truncate)
452 (command_loop_1, adjust_point_for_property, read_char, gen_help_event)
453 (make_lispy_position, make_lispy_event, parse_modifiers_uncached)
454 (parse_modifiers, modify_event_symbol, Fexecute_extended_command)
455 (stuff_buffered_input):
456 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
457 (last_auto_save, command_loop_1, read_char):
458 Use EMACS_INT, not int, to avoid integer overflow.
459 (record_char): Avoid overflow in total_keys computation.
460 (parse_modifiers_uncached): Redo index calculation to avoid overflow.
461 * keyboard.h: Adjust decls to match defn changes elsewhere.
462 * keymap.c (Fdefine_key, Fcurrent_active_maps, accessible_keymaps_1)
463 (Fkey_description, Fdescribe_vector, Flookup_key):
464 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
465 (click_position): New function, to check that positions are in range.
466 (Fcurrent_active_maps):
467 (describe_command):
468 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
469 (Faccessible_keymaps, Fkey_description):
470 (preferred_sequence_p):
471 Don't assume fixnum can fit into int.
472 (Fkey_description): Use SAFE_ALLOCA_LISP, not alloca.
473 Check for integer overflow in size calculations.
474 (Ftext_char_description): Use CHECK_CHARACTER, not CHECK_NUMBER, to
475 avoid mishandling large integers.
476 * lisp.h: Adjust decls to match defn changes elsewhere.
477 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, struct Lisp_String)
478 (struct vectorlike_header, struct Lisp_Subr, struct Lisp_Hash_Table)
479 (struct Lisp_Marker):
480 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
481 (clip_to_bounds): Now an inline function, moved here from editfns.c.
d311d28c
PE
482 (GLYPH_CODE_P): Check for overflow in system types, subsuming the
483 need for GLYPH_CODE_CHAR_VALID_P and doing proper checking ourselves.
484 All callers changed.
485 (GLYPH_CODE_CHAR, GLYPH_CODE_FACE):
486 Assume the arg has valid form, since it always does.
487 (TYPE_RANGED_INTEGERP): Avoid bug when checking against a wide
488 unsigned integer system type.
489 (CHECK_RANGED_INTEGER, CHECK_TYPE_RANGED_INTEGER): New macros.
490 (struct catchtag, specpdl_size, SPECPDL_INDEX, USE_SAFE_ALLOCA):
491 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
492 (struct catchtag): Use EMACS_INT, not int, since it may be a fixnum.
493 (duration_to_sec_usec): New decl.
494 * lread.c (read_from_string_index, read_from_string_index_byte)
495 (read_from_string_limit, readchar, unreadchar, openp)
496 (read_internal_start, read1, oblookup):
497 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
498 (Fload, readevalloop, Feval_buffer, Feval_region):
499 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
500 (openp): Check for out-of-range argument to 'access'.
501 (read1): Use int, not EMACS_INT, where int is wide enough.
502 Don't assume fixnum fits into int.
6efdadfd 503 Fix off-by-one error that can read outside a buffer.
1ab7b8ac
PE
504 (read_filtered_event): Use duration_to_sec_usec
505 to do proper overflow checking on durations.
d311d28c
PE
506 * macros.c (Fstart_kbd_macro): Use xpalloc to check for overflow
507 in size calculation.
508 (Fexecute_kbd_macro):
509 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
510 * marker.c (cached_charpos, cached_bytepos, CONSIDER)
511 (byte_char_debug_check, buf_charpos_to_bytepos, verify_bytepos)
512 (buf_bytepos_to_charpos, Fset_marker, set_marker_restricted)
513 (set_marker_both, set_marker_restricted_both, marker_position)
514 (marker_byte_position, Fbuffer_has_markers_at):
515 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
516 (Fset_marker, set_marker_restricted): Don't assume fixnum fits in int.
517 * menu.c (ensure_menu_items): Renamed from grow_menu_items.
518 It now merely ensures that the menu is large enough, without
519 necessarily growing it, as this avoids some integer overflow issues.
520 All callers changed.
521 (keymap_panes, parse_single_submenu, Fx_popup_menu):
522 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
523 (parse_single_submenu, Fx_popup_menu): Don't assume fixnum fits in int.
524 Use SAFE_ALLOCA_LISP, not alloca.
525 (find_and_return_menu_selection): Avoid unnecessary casts of pointers
526 to EMACS_INT. Check that fixnums are in proper range for system types.
527 * minibuf.c (minibuf_prompt_width, string_to_object)
528 (Fminibuffer_contents, Fminibuffer_contents_no_properties)
529 (Fminibuffer_completion_contents, Ftry_completion, Fall_completions):
530 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
531 (get_minibuffer, read_minibuf_unwind):
532 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
533 (read_minibuf): Omit unnecessary arg BACKUP_N, which is always nil;
534 this simplifies overflow checking. All callers changed.
535 (read_minibuf, Fread_buffer, Ftry_completion, Fall_completions)
536 (Ftest_completion):
537 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
538 * nsfns.m (check_ns_display_info): Don't assume fixnum fits in long.
539 (x_set_menu_bar_lines, x_set_tool_bar_lines, Fx_create_frame):
540 Check that fixnums are in proper range for system types.
541 (Fx_create_frame, Fx_show_tip):
542 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
543 * nsfont.m (ns_findfonts, nsfont_list_family):
544 Don't assume fixnum fits in long.
545 * nsmenu.m (ns_update_menubar, ns_menu_show, ns_popup_dialog):
546 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
547 (ns_update_menubar): Use intptr_t, not EMACS_INT, when intptr_t is
548 wide enough.
17fdb222 549 * nsselect.m (ns_get_local_selection, clean_local_selection_data):
d311d28c
PE
550 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
551 * print.c (print_buffer_size, print_buffer_pos, print_buffer_pos_byte)
552 (PRINTDECLARE, PRINTPREPARE):
553 (strout, print_string):
554 (print, print_preprocess, print_check_string_charset_prop)
555 (print_object):
556 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
557 (PRINTDECLARE):
558 (temp_output_buffer_setup, Fprin1_to_string, print_object):
559 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
560 (PRINTPREPARE): Use int, not ptrdiff_t, where int is wide enough.
d311d28c 561 (printchar, strout): Use xpalloc to catch size calculation overflow.
0fd11aa5 562 (Fexternal_debugging_output): Don't overflow EMACS_INT->int conversion.
d311d28c
PE
563 (print_error_message): Use SAFE_ALLOCA, not alloca.
564 (print_object): Use int, not EMACS_INT, where int is wide enough.
a8b7caa3
PE
565 (print_depth, new_backquote_output, print_number_index):
566 Use ptrdiff_t, not int, where int might not be wide enough.
d311d28c
PE
567 * process.c (Fdelete_process): Don't assume pid fits into EMACS_INT.
568 (Fset_process_window_size, Fformat_network_address)
569 (get_lisp_to_sockaddr_size, set_socket_option, Fmake_network_process)
d44287d4 570 (sigchld_handler):
d311d28c 571 Check that fixnums are in proper range for system types.
d44287d4 572 (Fsignal_process): Simplify by avoiding a goto.
d83cf4cc
PE
573 Check for process-ids out of pid_t range rather than relying on
574 undefined behavior.
e4d81efc 575 (process_tick, update_tick): Use EMACS_INT, not int.
d311d28c
PE
576 (Fformat_network_address, read_process_output, send_process)
577 (Fprocess_send_region, status_notify):
578 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
579 (Fformat_network_address, Fmake_serial_process, Fmake_network_process)
580 (wait_reading_process_output, read_process_output, exec_sentinel):
581 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
582 (conv_lisp_to_sockaddr): Don't assume fixnums fit into int.
583 (Faccept_process_output): Use duration_to_sec_usec to do proper
584 overflow checking on durations.
dde14581
PE
585 (emacs_get_tty_pgrp, Fprocess_running_child_p, process_send_signal):
586 Don't assume pid_t fits in int.
b62b53e8
PE
587 * puresize.h (PURESIZE_RATIO): Shrink this to 8/6 on 32-bit hosts
588 configured --with-wide-int.
d311d28c
PE
589 * scroll.c (calculate_scrolling, calculate_direct_scrolling)
590 (line_ins_del): Use int, not EMACS_INT, where int is wide enough.
591 * search.c (looking_at_1, string_match_1):
592 (fast_string_match, fast_c_string_match_ignore_case)
593 (fast_string_match_ignore_case, fast_looking_at, scan_buffer)
594 (scan_newline, find_before_next_newline, search_command)
595 (trivial_regexp_p, search_buffer, simple_search, boyer_moore)
596 (set_search_regs, wordify):
597 (Freplace_match):
598 (Fmatch_data):
599 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
600 (string_match_1, search_buffer, set_search_regs):
601 (Fmatch_data):
602 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
603 (wordify): Check for overflow in size calculation.
604 (Freplace_match): Avoid potential buffer overflow in search_regs.start.
605 (Fset_match_data): Don't assume fixnum fits in ptrdiff_t.
606 Check that fixnums are in proper range for system types.
607 * sound.c (struct sound_device)
608 (wav_play, au_play, vox_write, alsa_period_size, alsa_write):
609 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
610 (Fplay_sound_internal):
611 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
eacd378d 612 * syntax.c (struct lisp_parse_state, find_start_modiff)
d311d28c
PE
613 (Finternal_describe_syntax_value, scan_lists, scan_sexps_forward):
614 (Fparse_partial_sexp):
615 Don't assume fixnums can fit in int.
616 (struct lisp_parse_state, find_start_pos, find_start_value)
617 (find_start_value_byte, find_start_begv)
618 (update_syntax_table, char_quoted, dec_bytepos)
619 (find_defun_start, prev_char_comend_first, back_comment):
620 (scan_words, skip_chars, skip_syntaxes, forw_comment, Fforward_comment)
621 (scan_lists, Fbackward_prefix_chars, scan_sexps_forward):
622 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
623 (Finternal_describe_syntax_value): Check that match_lisp is a
624 character, not an integer, since the code stuffs it into int.
625 (scan_words, scan_sexps_forward):
626 Check that fixnums are in proper range for system types.
627 (Fforward_word):
628 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
629 (scan_sexps_forward):
630 Use CHARACTERP, not INTEGERP, since the value must fit into int.
631 (Fparse_partial_sexp): Fix doc; element 8 is not ignored.
632 * syntax.h: Adjust decls to match defn changes elsewhere.
633 (struct gl_state_s):
634 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
e4ecdc9c
PE
635 (SETUP_SYNTAX_TABLE_FOR_OBJECT): Use PTRDIFF_MAX, not
636 MOST_POSITIVE_FIXNUM.
d311d28c
PE
637 * sysdep.c (wait_for_termination_1, wait_for_termination)
638 (interruptible_wait_for_termination, mkdir):
639 Don't assume pid_t fits in int; on 64-bit AIX pid_t is 64-bit.
640 (emacs_read, emacs_write):
641 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
225a2cff
PE
642 (system_process_attributes): Don't assume uid_t, gid_t, EMACS_INT,
643 and double all fit in int.
d311d28c
PE
644 * term.c (set_tty_color_mode):
645 Check that fixnums are in proper range for system types.
646 * termhooks.h (struct input_event):
647 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
648 * textprop.c (validate_interval_range, interval_of)
649 (Fadd_text_properties, set_text_properties_1)
650 (Fremove_text_properties, Fremove_list_of_text_properties)
651 (Ftext_property_any, Ftext_property_not_all)
652 (copy_text_properties, text_property_list, extend_property_ranges)
653 (verify_interval_modification):
654 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
655 (Fnext_single_char_property_change)
656 (Fprevious_single_char_property_change):
657 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5895d7b9
PE
658 (copy_text_properties):
659 Check for integer overflow in index calculation.
d311d28c
PE
660 * undo.c (last_boundary_position, record_point, record_insert)
661 (record_delete, record_marker_adjustment, record_change)
662 (record_property_change):
663 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
664 (truncate_undo_list, Fprimitive_undo): Don't assume fixnum fits in int.
665 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
666 * w32fns.c (Fx_create_frame, x_create_tip_frame, Fx_show_tip)
667 (Fx_hide_tip, Fx_file_dialog):
668 * w32menu.c (set_frame_menubar):
669 Use ptrdiff_t, not int, for consistency with rest of code.
670 * window.c (window_scroll_preserve_hpos, window_scroll_preserve_vpos)
671 (select_window, Fdelete_other_windows_internal)
672 (window_scroll_pixel_based, window_scroll_line_based)
673 (Frecenter, Fset_window_configuration):
674 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
675 (Fset_window_hscroll, run_window_configuration_change_hook)
676 (set_window_buffer, temp_output_buffer_show, scroll_command)
5895d7b9 677 (Fscroll_other_window, Frecenter):
d311d28c
PE
678 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
679 (Fwindow_line_height, window_scroll, Fscroll_left, Fscroll_right):
680 Don't assume fixnum fits in int.
681 (Fset_window_scroll_bars):
682 Check that fixnums are in proper range for system types.
683 * xdisp.c (help_echo_pos, pos_visible_p, string_pos_nchars_ahead)
684 (string_pos, c_string_pos, number_of_chars, init_iterator)
685 (in_ellipses_for_invisible_text_p, init_from_display_pos)
686 (compute_stop_pos, next_overlay_change, compute_display_string_pos)
687 (compute_display_string_end, handle_face_prop)
5895d7b9
PE
688 (face_before_or_after_it_pos, handle_invisible_prop)
689 (handle_display_prop, handle_display_spec, handle_single_display_spec)
d311d28c
PE
690 (display_prop_intangible_p, string_buffer_position_lim)
691 (string_buffer_position, handle_composition_prop, load_overlay_strings)
692 (get_overlay_strings_1, get_overlay_strings)
693 (iterate_out_of_display_property, forward_to_next_line_start)
694 (back_to_previous_visible_line_start, reseat, reseat_to_string)
695 (get_next_display_element, set_iterator_to_next)
696 (get_visually_first_element, compute_stop_pos_backwards)
697 (handle_stop_backwards, next_element_from_buffer)
698 (move_it_in_display_line_to, move_it_in_display_line)
699 (move_it_to, move_it_vertically_backward, move_it_by_lines)
700 (add_to_log, message_dolog, message_log_check_duplicate)
701 (message2, message2_nolog, message3, message3_nolog
702 (with_echo_area_buffer, display_echo_area_1, resize_mini_window_1)
703 (current_message_1, truncate_echo_area, truncate_message_1)
704 (set_message, set_message_1, store_mode_line_noprop)
705 (hscroll_window_tree, debug_delta, debug_delta_bytes, debug_end_vpos)
706 (text_outside_line_unchanged_p, check_point_in_composition)
707 (reconsider_clip_changes)
708 (redisplay_internal, set_cursor_from_row, try_scrolling)
709 (try_cursor_movement, set_vertical_scroll_bar, redisplay_window)
710 (redisplay_window, find_last_unchanged_at_beg_row)
711 (find_first_unchanged_at_end_row, row_containing_pos, try_window_id)
712 (trailing_whitespace_p, find_row_edges, display_line)
713 (RECORD_MAX_MIN_POS, Fcurrent_bidi_paragraph_direction)
714 (display_mode_element, store_mode_line_string)
715 (pint2str, pint2hrstr, decode_mode_spec)
716 (display_count_lines, display_string, draw_glyphs)
717 (x_produce_glyphs, x_insert_glyphs)
718 (rows_from_pos_range, mouse_face_from_buffer_pos)
719 (fast_find_string_pos, mouse_face_from_string_pos)
720 (note_mode_line_or_margin_highlight, note_mouse_highlight):
721 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
722 (safe_call, init_from_display_pos, handle_fontified_prop)
723 (handle_single_display_spec, load_overlay_strings)
724 (with_echo_area_buffer, setup_echo_area_for_printing)
725 (display_echo_area, echo_area_display)
726 (x_consider_frame_title, prepare_menu_bars, update_menu_bar)
727 (update_tool_bar, hscroll_window_tree, redisplay_internal)
5895d7b9
PE
728 (redisplay_window, dump_glyph_row, display_mode_line)
729 (Fformat_mode_line, decode_mode_spec, on_hot_spot_p):
43ad2e9a 730 (handle_display_spec, display_prop_string_p):
d311d28c
PE
731 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
732 (handle_single_display_spec, build_desired_tool_bar_string)
733 (redisplay_tool_bar, scroll_window_tree, Fdump_glyph_matrix)
734 (get_specified_cursor_type):
735 Check that fixnums are in proper range for system types.
736 (struct overlay_entry, resize_mini_window, Fdump_glyph_row)
737 (Flookup_image_map):
738 Don't assume fixnums fit in int.
739 (compare_overlay_entries):
740 Avoid mishandling comparisons due to subtraction overflow.
741 (load_overlay_strings): Use SAFE_NALLOCA, not alloca.
742 (last_escape_glyph_face_id, last_glyphless_glyph_face_id):
743 (handle_tool_bar_click):
744 Use int, not unsigned, since we prefer signed and the signedness
745 doesn't matter here.
746 (get_next_display_element, next_element_from_display_vector):
747 Use int, not EMACS_INT, when int is wide enough.
748 (start_hourglass): Use duration_to_sec_usec to do proper
749 overflow checking on durations.
750 * xfaces.c (Fbitmap_spec_p):
751 Check that fixnums are in proper range for system types.
752 (compare_fonts_by_sort_order):
753 Avoid mishandling comparisons due to subtraction overflow.
754 (Fx_family_fonts, realize_basic_faces):
755 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
756 (Fx_family_fonts):
757 Don't assume fixnum fits in int.
758 Use SAFE_ALLOCA_LISP, not alloca.
759 (merge_face_heights): Remove unnecessary cast to EMACS_INT.
760 (Finternal_make_lisp_face): Don't allocate more than MAX_FACE_ID.
761 (face_at_buffer_position, face_for_overlay_string)
762 (face_at_string_position):
763 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
764 (merge_faces): Use int, not EMACS_INT, where int is wide enough.
765 * xfns.c (x_set_menu_bar_lines, x_set_tool_bar_lines, x_icon_verify)
766 (Fx_show_tip):
767 Check that fixnums are in proper range for system types.
768 (Fx_create_frame, x_create_tip_frame, Fx_show_tip)
769 (Fx_hide_tip, Fx_file_dialog, Fx_select_font):
770 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
771 (Fx_change_window_property): Don't assume fixnums fit in int.
772 * xfont.c (xfont_chars_supported):
773 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
774 * xmenu.c (Fx_popup_dialog, set_frame_menubar)
775 (create_and_show_popup_menu, create_and_show_dialog, xmenu_show):
776 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
777 * xml.c (parse_region):
778 * xrdb.c (magic_file_p):
779 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
780 * xselect.c (TRACE1): Don't assume pid_t promotes to int.
781 (x_get_local_selection, x_reply_selection_request)
782 (x_handle_selection_request, wait_for_property_change):
783 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
784 (selection_data_to_lisp_data): Use short, not EMACS_INT, where
785 short is wide enough.
786 (x_send_client_event): Don't assume fixnum fits in int.
787 * xterm.c (x_x_to_emacs_modifiers):
788 Don't assume EMACS_INT overflows nicely into int.
789 (x_emacs_to_x_modifiers): Use EMACS_INT, not int, because values
790 may come from Lisp.
791 (handle_one_xevent): NATNUMP can eval its arg twice.
792 (x_connection_closed):
793 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
794 * xterm.h: Adjust decls to match defn changes elsewhere.
795 (struct scroll_bar): Use struct vectorlike_header
796 rather than rolling our own approximation.
797 (SCROLL_BAR_VEC_SIZE): Remove; not used.
798
f01769f9
LL
7992012-04-22 Leo Liu <sdl.web@gmail.com>
800
801 * sysdep.c (list_system_processes): Support Darwin (Bug#5725).
802
5790543d
PE
8032012-04-22 Paul Eggert <eggert@cs.ucla.edu>
804
805 * sysdep.c [__FreeBSD__]: Minor cleanups.
806 (list_system_processes, system_process_attributes) [__FreeBSD__]:
807 Use Emacs indenting style more consistently. Avoid some casts.
808 Use 'double' consistently rather than mixing 'float' and 'double'.
809
b91b7e4d
EW
8102012-04-21 Eduard Wiebe <usenet@pusto.de>
811
812 * sysdep.c (list_system_processes, system_process_attributes): Add
813 implementation for FreeBSD (Bug#5243).
814
6114eb15
AS
8152012-04-21 Andreas Schwab <schwab@linux-m68k.org>
816
817 * lisp.mk (lisp): Update.
818
2f38dff7
PE
8192012-04-20 Paul Eggert <eggert@cs.ucla.edu>
820
821 * keyboard.c (process_pending_signals): Define only if SYNC_INPUT.
822 It is never used otherwise.
823
4ae29f89
SM
8242012-04-20 Stefan Monnier <monnier@iro.umontreal.ca>
825
826 * print.c (print_preprocess): Only check print_depth if print-circle
827 is nil.
828 (print_object): Check for cycles even when print-circle is nil and
829 print-gensym is t, but only check print_depth if print-circle is nil.
830
f30d612a
CY
8312012-04-20 Chong Yidong <cyd@gnu.org>
832
833 * process.c (wait_reading_process_output): If EIO occurs on a pty,
834 set the status to "failed" and ensure that sentinel is run.
835
c07a4c0b 8362012-04-20 Glenn Morris <rgm@gnu.org>
016a35df
GM
837
838 * process.c (Fset_process_inherit_coding_system_flag)
839 (Fset_process_query_on_exit_flag): Doc fix (mention return value).
4373fd43 840 (Fmake_network_process, Fmake_serial_process): Doc fix.
016a35df 841
c07a4c0b 8422012-04-20 Eli Zaretskii <eliz@gnu.org>
20a68157
EZ
843
844 * xdisp.c (string_buffer_position_lim): Limit starting position to
845 BEGV.
846 (set_cursor_from_row): If called for a mode-line or header-line
847 row, return zero immediately.
848 (try_cursor_movement): If inside continuation line, don't back up
4ae29f89
SM
849 farther than the first row after the header line, if any.
850 Don't consider the header-line row as "partially visible", even if
20a68157
EZ
851 MATRIX_ROW_PARTIALLY_VISIBLE_P returns non-zero. (Bug#11261)
852
c07a4c0b 8532012-04-20 Atsuo Ohki <ohki@gssm.otsuka.tsukuba.ac.jp> (tiny change)
ad3a2b41 854
4ae29f89
SM
855 * lread.c (lisp_file_lexically_bound_p): Fix hang at ";-*-\n"
856 (bug#11238).
ad3a2b41 857
c07a4c0b 8582012-04-20 Teodor Zlatanov <tzz@lifelogs.com>
6c94c34f 8592012-04-18 Paul Eggert <eggert@cs.ucla.edu>
ae6e112d
PE
860
861 configure: new option --enable-gcc-warnings (Bug#11207)
862 * Makefile.in (C_WARNINGS_SWITCH): Remove.
863 (WARN_CFLAGS, WERROR_CFLAGS): New macros.
864 (ALL_CFLAGS): Use new macros rather than old.
865 * process.c: Ignore -Wstrict-overflow to work around GCC bug 52904.
866 * regex.c: Ignore -Wstrict-overflow. If !emacs, also ignore
867 -Wunused-but-set-variable, -Wunused-function, -Wunused-macros,
868 -Wunused-result, -Wunused-variable. This should go away once
869 the Emacs and Gnulib regex code is merged.
870 (xmalloc, xrealloc): Now static.
871
aba027e8
PE
8722012-04-17 Paul Eggert <eggert@cs.ucla.edu>
873
874 * dired.c (Fsystem_groups): Remove unused local.
875
e5a36063
GM
8762012-04-17 Glenn Morris <rgm@gnu.org>
877
878 * dired.c (Fsystem_users): Doc fix.
879
316411f0
DA
8802012-04-17 Dmitry Antipov <dmantipov@yandex.ru>
881
882 * dired.c (Fsystem_users, Fsystem_groups): New functions. (Bug#7900)
883 (syms_of_dired): Add them.
884
9426aba4
PE
8852012-04-16 Paul Eggert <eggert@cs.ucla.edu>
886
b62a57be
PE
887 Fix minor alloc.c problems found by static checking.
888 * alloc.c (_malloc_internal, _free_internal) [!DOUG_LEA_MALLOC]:
889 New extern decls, to avoid calling undeclared functions.
890 (dont_register_blocks): Define if ((!SYSTEM_MALLOC && !SYNC_INPUT)
891 && GC_MALLOC_CHECK), not if ((GC_MARK_STACK || defined
892 GC_MALLOC_CHECK) && GC_MALLOC_CHECK), to match when it's used.
893 (NEED_MEM_INSERT): New macro.
894 (mem_insert, mem_insert_fixup) [!NEED_MEM_INSERT]: Remove; unused.
4b5afbb0 895 Remove one incorrect comment and fix another.
b62a57be 896
3539f31f
PE
897 Fix minor ralloc.c problems found by static checking.
898 See http://lists.gnu.org/archive/html/emacs-devel/2011-12/msg00720.html
899 * ralloc.c (ALIGNED, ROUND_TO_PAGE, HEAP_PTR_SIZE)
900 (r_alloc_size_in_use, r_alloc_freeze, r_alloc_thaw): Remove; unused.
901 (r_alloc_sbrk): Now static.
902
a041960a
PE
903 Improve ralloc.c interface checking.
904 See http://lists.gnu.org/archive/html/emacs-devel/2011-12/msg00720.html
905 * buffer.c (ralloc_reset_variable, r_alloc, r_re_alloc)
906 (r_alloc_free) [REL_ALLOC]: Move decls from here ...
907 * lisp.h (r_alloc, r_alloc_free, r_re_alloc, r_alloc_reset_variable)
908 [REL_ALLOC]: ... to here, to check interface.
909 * m/ia64.h (r_alloc, r_alloc_free) [REL_ALLOC && !_MALLOC_INTERNAL]:
910 Remove decls. This fixes an "It stinks!".
911
9426aba4
PE
912 * alloc.c (which_symbols): Fix alignment issue / type clash.
913
d55c12ed
AS
9142012-04-15 Andreas Schwab <schwab@linux-m68k.org>
915
916 * lisp.h (struct Lisp_Symbol): Remove explicit padding.
917 (struct Lisp_Misc_Any): Likewise.
918 (struct Lisp_Free): Likewise.
919 * alloc.c (union aligned_Lisp_Symbol): Define.
920 (SYMBOL_BLOCK_SIZE, struct symbol_block): Use union
921 aligned_Lisp_Symbol instead of struct Lisp_Symbol.
922 (union aligned_Lisp_Misc): Define.
923 (MARKER_BLOCK_SIZE, struct marker_block): Use union
924 aligned_Lisp_Misc instead of union Lisp_Misc.
4ae29f89 925 (Fmake_symbol, allocate_misc, gc_sweep): Adjust.
d55c12ed 926
b948ce8b
PE
9272012-04-14 Paul Eggert <eggert@cs.ucla.edu>
928
929 Make GC_MAKE_GCPROS_NOOPS the default (Bug#9926).
930 * lisp.h (GC_MARK_STACK): Default to GC_MAKE_GCPROS_NOOPS.
931 * s/cygwin.h, s/darwin.h, s/freebsd.h, s/gnu.h, s/irix6-5.h, s/msdos.h:
932 * s/netbsd.h, s/sol2-6.h:
933 Remove definition of GC_MARK_STACK, since the default now works.
934 * s/aix4-2.h, s/hpux10-20.h, s/unixware.h:
935 Define GC_MARK_STACK to GC_USE_GCPROS_AS_BEFORE, since that's
936 no longer the default.
937 * s/gnu-linux.h (GC_MARK_STACK): Adjust to change in default.
938
35dc09a1 9392012-04-14 Atsuo Ohki <ohki@gssm.otsuka.tsukuba.ac.jp> (tiny change)
ad3a2b41 940
35dc09a1
GM
941 * lread.c (lisp_file_lexically_bound_p):
942 Fix hang at ";-*-\n" (bug#11238).
ad3a2b41 943
35dc09a1
GM
9442012-04-14 Eli Zaretskii <eliz@gnu.org>
945
946 * xdisp.c (find_last_unchanged_at_beg_row): Don't consider a row
947 "unchanged" if its end.pos is beyond ZV. (Bug#11199)
948
9492012-04-14 Jan Djärv <jan.h.d@swipnet.se>
950
951 * nsterm.m (constrainFrameRect): Always constrain when there is only
952 one screen (Bug#10962).
953
bcd86815
KB
9542012-04-13 Ken Brown <kbrown@cornell.edu>
955
956 * s/cygwin.h (PTY_OPEN): Don't try to close a bogus file descriptor.
957
c25df26e
RT
9582012-04-13 Reuben Thomas <rrt@sc3d.org>
959
960 * indent.c (Fmove_to_column): Change interactive spec (Bug#739).
961
0fc59f1e
DC
9622012-04-11 Daniel Colascione <dancol@dancol.org>
963
964 * s/cygwin.h: The vfork the #define in cygwin.h was protecting
965 against is gone. It's better to use vfork now so that when Cygwin
966 gains a new, working vfork, we use it automatically (bug#10398).
967
de8c03dc
SM
9682012-04-11 Stefan Monnier <monnier@iro.umontreal.ca>
969
970 * window.c (save_window_save): Obey window-point-insertion-type.
971
2f097256
GM
9722012-04-11 Glenn Morris <rgm@gnu.org>
973
974 * Makefile.in (GNUSTEP_CFLAGS): Rename from C_SWITCH_X_SYSTEM.
975
453b951e
SM
9762012-04-11 Stefan Monnier <monnier@iro.umontreal.ca>
977
978 * alloc.c (lisp_align_malloc): Remove unneeded prototype.
979
75f1671a 9802012-04-10 Jason S. Cornez <jcornez@ravenpack.com> (tiny change)
6bbef4e5
JC
981
982 * keyboard.c: Override inhibit-quit after the third C-g (bug#6585).
983 (force_quit_count): New var.
984 (handle_interrupt): Use it.
985
2a8ce227
JB
9862012-04-10 Juanma Barranquero <lekktu@gmail.com>
987
988 * w32.c (w32_delayed_load): Record the full path of the library
989 being loaded (bug#10424).
990
935396c0
GM
9912012-04-09 Glenn Morris <rgm@gnu.org>
992
05920a43
GM
993 * doc.c (Fsnarf_documentation): Check variables, functions are bound,
994 not just in the obarray, before snarfing them. (Bug#11036)
995
935396c0
GM
996 * Makefile.in ($(leimdir)/leim-list.el):
997 Pass EMACS rather than BUILT_EMACS.
998
a18ecafa
TZ
9992012-04-09 Teodor Zlatanov <tzz@lifelogs.com>
1000
1001 * process.c (make_process):
1002 * process.h: Add integer `gnutls_handshakes_tried' member to
1003 process struct.
1004
6bbef4e5
JC
1005 * gnutls.h: Add `GNUTLS_EMACS_HANDSHAKES_LIMIT' upper limit.
1006 Add convenience `GNUTLS_LOG2i' macro.
a18ecafa
TZ
1007
1008 * gnutls.c (gnutls_log_function2i): Convenience log function.
1009 (emacs_gnutls_read): Use new log functions,
1010 `gnutls_handshakes_tried' process member, and
1011 `GNUTLS_EMACS_HANDSHAKES_LIMIT' to limit the number of handshake
1012 attempts per process (connection).
1013
b4d3bc10
CY
10142012-04-09 Chong Yidong <cyd@gnu.org>
1015
1016 * eval.c (Fuser_variable_p, user_variable_p_eh)
1017 (lisp_indirect_variable): Functions deleted.
1018 (Fdefvar): Caller changed.
1019
1020 * callint.c (Finteractive, Fcall_interactively):
1021 * minibuf.c (Fread_variable): Callers changed.
1022
70f4d973
EZ
10232012-04-09 Eli Zaretskii <eliz@gnu.org>
1024
1025 * xdisp.c (set_cursor_from_row): If the display string appears in
1026 the buffer at position that is closer to point than the position
1027 after the display string, display the cursor on the first glyph of
1028 the display string. Fixes cursor display when a 'display' text
1029 property immediately follows invisible text. (Bug#11094)
1030
cb3c2e3e
PE
10312012-04-09 Paul Eggert <eggert@cs.ucla.edu>
1032
1033 composite.c: use 'double' consistently
1034 * composite.c (get_composition_id): Use 'double' consistently
1035 instead of converting 'float' to 'double' and vice versa; this is
1036 easier to understand and avoids a GCC warning.
1037
fd06db5d
GM
10382012-04-09 Glenn Morris <rgm@gnu.org>
1039
50fe702a
GM
1040 * Makefile.in: Generate leim-list with bootstrap-emacs, in
1041 preparation for dumping it with emacs. (Bug#4789)
1042 (leimdir): New variable.
1043 ($(leimdir)/leim-list.el): New rule.
1044 (emacs$(EXEEXT)): Depend on leim-list.el.
1045
fd06db5d
GM
1046 * buffer.c (Qucs_set_table_for_input): Remove. (Bug#9821)
1047 (Fget_buffer_create): Don't call Qucs_set_table_for_input.
1048 (init_buffer_once, syms_of_buffer): Remove Qucs_set_table_for_input.
1049
55c131ee
AS
10502012-04-08 Andreas Schwab <schwab@linux-m68k.org>
1051
1052 * lisp.h (struct Lisp_Symbol): Add explicit padding to ensure
1053 proper alignment.
1054
9209588f
JB
10552012-04-07 Juanma Barranquero <lekktu@gmail.com>
1056
1057 * xml.c (init_libxml2_functions) [WINDOWSNT]:
1058 Remove unused local variable.
1059
e3fb2efb
PE
10602012-04-07 Paul Eggert <eggert@cs.ucla.edu>
1061
1062 Avoid unnecessary pointer scanning in garbage collection (Bug#10780).
1063 * alloc.c (POINTERS_MIGHT_HIDE_IN_OBJECTS): New macro.
1064 (mark_memory): Mark Lisp_Objects only if pointers might hide in
1065 objects, as mark_maybe_pointer will catch them otherwise.
1066 (GC_LISP_OBJECT_ALIGNMENT): Remove; no longer needed.
1067 * s/gnu-linux.h (GC_LISP_OBJECT_ALIGNMENT) [__mc68000__]: Likewise.
1068
b5385551
PE
10692012-04-07 Paul Eggert <eggert@cs.ucla.edu>
1070
1071 Fix typo that broke non-Windows builds.
1072 * xml.c (libxml2_loaded_p) [!!WINDOWSNT]: 'inine' -> 'inline'.
1073
9078ead6
EZ
10742012-04-07 Eli Zaretskii <eliz@gnu.org>
1075
1076 Support building on MS-Windows with libxml2.
1077
1078 * makefile.w32-in (OBJ2): Add xml.$(O).
1079 (GLOBAL_SOURCES): Add xml.c.
1080 ($(BLD)/xml.$(O)): New dependency list.
1081
1082 * xml.c (DEF_XML2_FN, LOAD_XML2_FN) [WINDOWSNT]: New macros.
1083 (fn_htmlReadMemory, fn_xmlReadMemory, fn_xmlDocGetRootElement)
1084 (fn_xmlFreeDoc, fn_xmlCleanupParser, fn_xmlCheckVersion)
1085 [!WINDOWSNT]: New macros.
1086 (init_libxml2_functions, libxml2_loaded_p): New functions.
1087 (parse_region): Call fn_xmlCheckVersion instead of using the macro
1088 LIBXML_TEST_VERSION. Call libxml2 functions via the fn_* macros.
1089 (xml_cleanup_parser): New function, export for fn_xmlCleanupParser.
1090 Calls xmlCleanupParser only if libxml2 was loaded (or statically
1091 linked in).
6bbef4e5
JC
1092 (Flibxml_parse_html_region, Flibxml_parse_xml_region):
1093 Call init_libxml2_functions before calling libxml2 functions.
9078ead6
EZ
1094 (syms_of_xml) <Qlibxml2_dll>: DEFSYM it.
1095
1096 * emacs.c: Don't include libxml/parser.h.
1097 (shut_down_emacs): Call xml_cleanup_parser, instead of calling
1098 xmlCleanupParser directly.
1099
1100 * lisp.h [HAVE_LIBXML2]: Add prototype for xml_cleanup_parser.
1101
3811fdf3
EZ
11022012-04-07 Eli Zaretskii <eliz@gnu.org>
1103
1104 * indent.c (Fvertical_motion): If there is a display string at
1105 point, use it.vpos to compute how many lines to backtrack after
1106 move_it_to point. (Bug#11133)
1107
2f8e16b2
EZ
11082012-04-06 Eli Zaretskii <eliz@gnu.org>
1109
1110 * buffer.h (FETCH_CHAR, FETCH_MULTIBYTE_CHAR):
1111 * character.h (STRING_CHAR, STRING_CHAR_AND_LENGTH): Add comments
1112 about subtle differences between FETCH_CHAR* and STRING_CHAR*
1113 macros related to unification of CJK characters. For the details,
1114 see the discussion following the message here:
1115 http://debbugs.gnu.org/cgi/bugreport.cgi?bug=11073#14.
1116
3d439cd1
CY
11172012-04-04 Chong Yidong <cyd@gnu.org>
1118
1119 * keyboard.c (Vdelayed_warnings_list): Doc fix.
1120
8bc53d00
EZ
11212012-04-01 Eli Zaretskii <eliz@gnu.org>
1122
1123 * w32menu.c (simple_dialog_show, add_menu_item): Use SAFE_ALLOCA
1124 instead of alloca. (Bug#11138)
1125
3b0512a3
AS
11262012-04-01 Andreas Schwab <schwab@linux-m68k.org>
1127
1128 * w32menu.c (is_simple_dialog): Properly check lisp types.
1129 (Bug#11141)
1130
8427ddd2
EZ
11312012-03-31 Eli Zaretskii <eliz@gnu.org>
1132
979022ef
EZ
1133 * xdisp.c (move_it_by_lines): When DVPOS is positive, and the
1134 position we get to after a call to move_it_to fails the
1135 IS_POS_VALID_AFTER_MOVE_P test, move to the next buffer position
1136 only if we wind up in a string from display property. (Bug#11063)
1137
a6b1c7cc
EZ
1138 * window.c (Fdelete_other_windows_internal): Invalidate the row
1139 and column information about mouse highlight, so that redisplay
1140 restores it after reallocating the glyph matrices. (Bug#7464)
1141
8427ddd2
EZ
1142 * xdisp.c (set_cursor_from_row): If `cursor' property on a display
1143 string comes from a `display' text property, use the buffer
1144 position of that property as if we actually saw that position in
1145 the row's glyphs.
697ba24b
EZ
1146 (move_it_by_lines): Remove the assertion that
1147 "it->current_x == 0 && it->hpos == 0" which can be legitimately
1148 violated when there's a before-string at the beginning of a line.
1149 (Bug#11063)
8427ddd2 1150
65a0a738
EZ
11512012-03-30 Eli Zaretskii <eliz@gnu.org>
1152
1153 * xdisp.c (append_space_for_newline): If the default face was
1154 remapped, use the remapped face for the appended newline.
1155 (extend_face_to_end_of_line): Use the remapped default face for
1156 extending the face to the end of the line.
1157 (display_line): Call extend_face_to_end_of_line when the default
1158 face was remapped. (Bug#11068)
1159
581355cc
EZ
11602012-03-29 Eli Zaretskii <eliz@gnu.org>
1161
1162 * s/ms-w32.h: Discourage from defining HAVE_GETCWD.
1163
e8fc049f
SM
11642012-03-28 Stefan Monnier <monnier@iro.umontreal.ca>
1165
1166 * keyboard.c (safe_run_hooks_error): Don't unquote strings.
1167
4fb9a543
GM
11682012-03-27 Glenn Morris <rgm@gnu.org>
1169
1170 * search.c (Fword_search_backward_lax, Fword_search_forward_lax):
1171 Doc fixes.
1172
679910f1
KH
11732012-03-26 Kenichi Handa <handa@m17n.org>
1174
1175 * dispextern.h (struct glyph): Fix previous change. Change the
1176 bit length of glyphless.ch to 25 (Bug#11082).
1177
90d49b7f
CY
11782012-03-26 Chong Yidong <cyd@gnu.org>
1179
1180 * keyboard.c (Vselection_inhibit_update_commands): New variable.
1181 (command_loop_1): Use it; inhibit selection update for
1182 handle-select-window too (Bug#8996).
1183
f514f6f0
FP
11842012-03-25 Fabrice Popineau <fabrice.popineau@supelec.fr>
1185
e8fc049f 1186 * w32heap.c (_heap_init, _heap_term): Remove dead MSVC-specific code.
f514f6f0 1187
bf43fa51
KH
11882012-03-25 Kenichi Handa <handa@m17n.org>
1189
1190 * dispextern.h (struct glyph): Change the bit length of
1191 glyphless.ch to 22 to make the member glyphless fit in 32 bits.
1192
8a0c01dd
EZ
11932012-03-24 Eli Zaretskii <eliz@gnu.org>
1194
1195 * s/ms-w32.h (tzname): Include time.h before redirecting to
1196 _tzname. Fixes the MSVC build. (Bug#9960)
1197
7d1c3a76
AS
11982012-03-24 Andreas Schwab <schwab@linux-m68k.org>
1199
8ed79523
AS
1200 * xdisp.c (produce_glyphless_glyph): Limit length of acronym to 6
1201 characters.
1202
7d1c3a76
AS
1203 * xterm.c (XTread_socket): Only modify handling_signal if
1204 !SYNC_INPUT. (Bug#11080)
1205
e99a9b8b
EZ
12062012-03-23 Eli Zaretskii <eliz@gnu.org>
1207
1208 * bidi.c (bidi_fetch_char): Use STRING_CHAR_AND_LENGTH instead of
1209 FETCH_MULTIBYTE_CHAR followed by CHAR_BYTES. Prevents crashes
1210 when fetching a multibyte character consumes more bytes than
1211 CHAR_BYTES returns, due to unification of CJK characters in
1212 string_char. (Bug#11073)
1213
5063c0e1
TN
12142012-03-23 Troels Nielsen <bn.troels@gmail.com> (tiny change)
1215
1216 * process.c (wait_reading_process_output): Handle pty disconnect
1217 by refraining from sending oneself a SIGCHLD (bug#10933).
1218
9f851fbd
CY
12192012-03-22 Chong Yidong <cyd@gnu.org>
1220
1221 * dispextern.h (struct it): New member string_from_prefix_prop_p.
1222
5063c0e1 1223 * xdisp.c (push_prefix_prop): Rename from push_display_prop.
9f851fbd
CY
1224 Mark string as coming from a prefix property.
1225 (handle_face_prop): Use default face for prefix strings (Bug#4281).
1226 (pop_it, reseat_1): Save and restore string_from_prefix_prop_p.
1227
fb5b8aca
CY
12282012-03-21 Chong Yidong <cyd@gnu.org>
1229
1230 * xfaces.c (Vface_remapping_alist): Doc fix.
1231
62356a1b
EZ
12322012-03-20 Eli Zaretskii <eliz@gnu.org>
1233
1234 * w32proc.c (Fw32_set_console_codepage)
5063c0e1
TN
1235 (Fw32_set_console_output_codepage, Fw32_get_codepage_charset):
1236 Doc fixes.
62356a1b 1237
025de85b
CY
12382012-03-20 Chong Yidong <cyd@gnu.org>
1239
1240 * dispnew.c (Fredisplay, Vredisplay_preemption_period): Update doc
1241 to reflect default non-nil value of redisplay-dont-pause.
1242
4827f94e
KH
12432012-03-19 Kenichi Handa <handa@m17n.org>
1244
1245 * ftfont.c (ftfont_drive_otf): Mask bits of character code to make
1246 it fit in a valid range (Bug#11003).
1247
e50a24a2
EZ
12482012-03-18 Eli Zaretskii <eliz@gnu.org>
1249
1250 * xdisp.c (cursor_row_p): Even if the glyph row ends in a string
1251 that is not from display property, accept the row as a "cursor
1252 row" if one of the string's character has a non-nil `cursor'
1253 property. Fixes cursor positioning when there are newlines in
1254 overlay strings, e.g. in icomplete.el. (Bug#11035)
1255
9af5ed87
PE
12562012-03-12 Paul Eggert <eggert@cs.ucla.edu>
1257
1258 * buffer.c (compare_overlays): Don't assume args differ (Bug#6830).
1259
d1f55f16
CY
12602012-03-12 Chong Yidong <cyd@gnu.org>
1261
1262 * eval.c (inhibit_lisp_code): Rename from
1263 inhibit_window_configuration_change_hook; move from window.c.
1264
1265 * xfns.c (unwind_create_frame_1, Fx_create_frame):
1266 * window.c (run_window_configuration_change_hook)
1267 (syms_of_window): Callers changed.
1268
66c5eebd
CY
12692012-03-11 Chong Yidong <cyd@gnu.org>
1270
413df973
CY
1271 * keymap.c (Fkey_description): Doc fix (Bug#9700).
1272
66c5eebd
CY
1273 * editfns.c (Fconstrain_to_field): Doc fix (Bug#9452).
1274
1de11f56
CY
12752012-03-10 Chong Yidong <cyd@gnu.org>
1276
1277 * frame.c (other_visible_frames): Don't assume the selected frame
1278 is visible (Bug#10955).
1279
cae07000
SM
12802012-03-09 Stefan Monnier <monnier@iro.umontreal.ca>
1281
1282 * buffer.c (compare_overlays): Avoid qsort's instability (bug#6830).
1283
89c94350
JD
12842012-03-08 Jan Djärv <jan.h.d@swipnet.se>
1285
1286 * gtkutil.c (x_wm_set_size_hint): Use one row in call to
1287 FRAME_TEXT_LINES_TO_PIXEL_HEIGHT so base_height is greater than
1288 zero (Bug#10954).
1289
999dd333
GM
12902012-03-03 Glenn Morris <rgm@gnu.org>
1291
01a6dcc8 1292 * alloc.c (Fgarbage_collect, misc-objects-consed): Doc fixes.
999dd333 1293
de0100f2
EZ
12942012-03-02 Eli Zaretskii <eliz@gnu.org>
1295
1296 * xdisp.c (try_window_reusing_current_matrix): Don't move cursor
1297 position past the first glyph_row that ends at ZV. (Bug#10902)
b8456c5c
EZ
1298 (redisplay_window, next_element_from_string): Fix typos in
1299 comments.
3e441275
EZ
1300 (redisplay_window): Pass to move_it_vertically the margin in
1301 pixels, not in screen lines.
de0100f2 1302
96a72ee9
GM
13032012-03-02 Glenn Morris <rgm@gnu.org>
1304
1305 * buffer.c (buffer-list-update-hook): Doc fix.
1306
312508d7
EZ
13072012-02-29 Eli Zaretskii <eliz@gnu.org>
1308
1309 * xdisp.c (get_overlay_strings_1): Under bidi redisplay, call
1310 push_it before setting up the iterator for the first overlay
1311 string, even if we have an empty string loaded.
1312 (next_overlay_string): If there's an empty string on the iterator
1313 stack, pop the stack. (Bug#10903)
1314
27f3c637
PE
13152012-02-25 Paul Eggert <eggert@cs.ucla.edu>
1316
1317 Generalize fix for crash due to non-contiguous EMACS_INT (Bug#10780).
1318 Suggested by Stefan Monnier in
1319 <http://lists.gnu.org/archive/html/emacs-devel/2012-02/msg00692.html>.
1320 * alloc.c (widen_to_Lisp_Object): New static function.
1321 (mark_memory): Also mark Lisp_Objects by fetching pointer words
1322 and widening them to Lisp_Objects. This would work even if
1323 USE_LSB_TAG is defined and wide integers are used, which might
1324 happen in a future version of Emacs.
1325
3c9dfce6
CY
13262012-02-25 Chong Yidong <cyd@gnu.org>
1327
fa74b241
CY
1328 * fileio.c (Ffile_selinux_context, Fset_file_selinux_context):
1329 Doc fix.
1330
3c9dfce6
CY
1331 * xselect.c (Fx_selection_exists_p): Doc fix.
1332 (x_clipboard_manager_save_all): Print an informative message
1333 before saving to clipboard manager.
1334
9486df08
CY
13352012-02-24 Chong Yidong <cyd@gnu.org>
1336
1337 * keyboard.c (process_special_events): Handle all X selection
1338 requests in kbd_buffer, not just the next one (Bug#8869).
1339
f01d3321
CY
13402012-02-23 Chong Yidong <cyd@gnu.org>
1341
1342 * xfns.c (Fx_create_frame): Avoid window-configuration-change-hook
1343 call when setting menu-bar-lines and tool-bar-lines parameters.
1344 (unwind_create_frame_1): New helper function.
1345
1346 * window.c (inhibit_window_configuration_change_hook): New var.
1347 (run_window_configuration_change_hook): Obey it.
b2e4ca7d 1348 (syms_of_window): Initialize it.
f01d3321 1349
86b847b6
CY
13502012-02-22 Chong Yidong <cyd@gnu.org>
1351
1352 * xterm.c (x_draw_image_relief): Add missing type check for
1353 Vtool_bar_button_margin (Bug#10743).
1354
a59225b1
CY
13552012-02-21 Chong Yidong <cyd@gnu.org>
1356
1357 * fileio.c (Vfile_name_handler_alist): Doc fix.
1358
1359 * buffer.c (Fget_file_buffer): Protect against invalid file
1360 handler return value.
1361
310f5bd4
PE
13622012-02-20 Paul Eggert <eggert@cs.ucla.edu>
1363
cb3a28cc
PE
1364 * .gdbinit (xreload): Don't assume EMACS_INT fits in 'long'
1365 when computing $valmask.
1366
310f5bd4
PE
1367 Fix crash due to non-contiguous EMACS_INT (Bug#10780).
1368 * lisp.h (VALBITS): Move definition up, so that USE_LSB_TAG can use it.
1369 (USE_LSB_TAG): Do not define if UINTPTR_MAX >> VALBITS == 0.
1370 It's useless in that case, and it can cause problems on hosts
1371 that allocate halves of EMACS_INT values separately.
1372 Reported by Dan Horák. Diagnosed by Andreas Schwab in
1373 <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=10780#30>.
1374 * mem-limits.h (EXCEEDS_LISP_PTR): Define to 0 on hosts where
1375 UINTPTR_MAX >> VALBITS == 0. This is required by the above change;
1376 it avoids undefined behavior on hosts where shifting right by more
1377 than the word width has undefined behavior.
1378
2375c96a
CY
13792012-02-19 Chong Yidong <cyd@gnu.org>
1380
1381 * fileio.c (Ffile_name_directory, Ffile_name_nondirectory)
1382 (Funhandled_file_name_directory, Ffile_name_as_directory)
1383 (Fdirectory_file_name, Fexpand_file_name)
1384 (Fsubstitute_in_file_name): Protect against invalid file handler
1385 return values (Bug#10845).
1386
3eb49e71
EZ
13872012-02-18 Eli Zaretskii <eliz@gnu.org>
1388
1389 * .gdbinit (pitx): Fix incorrect references to fields of the
1390 iterator stack.
1391
7b926f3f
CY
13922012-02-17 Chong Yidong <cyd@gnu.org>
1393
1394 * syntax.c (Fscan_lists): Doc fix (Bug#10833).
1395
11273115
PE
13962012-02-15 Paul Eggert <eggert@cs.ucla.edu>
1397
1398 * image.c (MAX_IMAGE_SIZE): Increase from 6.0 to 10.0; see
1399 <http://lists.gnu.org/archive/html/emacs-devel/2012-02/msg00540.html>.
1400
c3a70e2b
CY
14012012-02-15 Chong Yidong <cyd@gnu.org>
1402
1403 * eval.c (Fdefvar, Fdefconst): Doc fix; note that the variable is
1404 marked as special. Also, starting docstrings with * is obsolete.
1405
0ca43699
AS
14062012-02-13 Andreas Schwab <schwab@linux-m68k.org>
1407
1408 * gnutls.c (emacs_gnutls_write): Fix last change.
1409
2e8f3c56
LI
14102012-02-13 Lars Ingebrigtsen <larsi@gnus.org>
1411
1412 * gnutls.c (emacs_gnutls_write): Set errno appropriately for
1413 send_process.
1414
af70074f
SM
14152012-02-13 Stefan Monnier <monnier@iro.umontreal.ca>
1416
1417 * keymap.c (Fsingle_key_description): Handle char ranges.
1418
95986d52
CY
14192012-02-12 Chong Yidong <cyd@gnu.org>
1420
afd83bd1
CY
1421 * xdisp.c (handle_stop): Avoid assigning -1 to it->face_id here,
1422 as that creates a dangerous corner case.
1423
95986d52
CY
1424 * window.c (Fdelete_window_internal): Invalidate the mouse
1425 highlight (Bug#9904).
1426
bd7da63e
GM
14272012-02-12 Glenn Morris <rgm@gnu.org>
1428
1429 * xselect.c (Fx_own_selection_internal)
1430 (Fx_get_selection_internal, Fx_disown_selection_internal)
1431 (Fx_selection_owner_p, Fx_selection_exists_p): Doc fixes.
1432 * nsselect.m (Fx_own_selection_internal)
1433 (Fx_disown_selection_internal, Fx_selection_exists_p)
1434 (Fx_selection_owner_p, Fx_get_selection_internal):
1435 Sync docs and argument specs with the xselect.c versions.
1436
77abcbc2
LI
14372012-02-11 Lars Ingebrigtsen <larsi@gnus.org>
1438
1439 * gnutls.c (emacs_gnutls_write): Don't infloop if sendto fails.
1440
90b671e2
EZ
14412012-02-11 Eli Zaretskii <eliz@gnu.org>
1442
1c0ca0b7
EZ
1443 * w32select.c (Fx_selection_exists_p): Sync doc string and
1444 argument list with xselect.c. (Bug#10783)
1445
1446 * w16select.c (Fx_selection_exists_p): Sync doc string and
1447 argument list with xselect.c. (Bug#10783)
90b671e2 1448
49241268
GM
14492012-02-10 Glenn Morris <rgm@gnu.org>
1450
1451 * fns.c (Fsecure_hash): Doc fix.
1452
f998bbe7 14532012-02-09 Kenichi Handa <handa@m17n.org>
5c1ca13d
KH
1454
1455 * coding.c (produce_chars): Fix updating of src_end (Bug#10701).
1456
0992bd9c
CY
14572012-02-07 Chong Yidong <cyd@gnu.org>
1458
1459 * buffer.c (Fbuffer_local_variables)
1460 (buffer_lisp_local_variables): Handle unbound vars correctly;
1461 don't let Qunbound leak into Lisp.
1462
af008560
GM
14632012-02-07 Glenn Morris <rgm@gnu.org>
1464
dd605cc4
GM
1465 * image.c (Fimagemagick_types): Doc fix.
1466
af008560
GM
1467 * image.c (imagemagick-render-type): Change it from a lisp object
1468 to an integer. Move the doc here from the lisp manual.
1469 Treat all values not equal to 0 the same.
1470
1449fa1d
CY
14712012-02-06 Chong Yidong <cyd@gnu.org>
1472
1473 * doc.c (store_function_docstring): Avoid applying docstring of
1474 alias to base function (Bug#2603).
1475
3723ec07
AS
14762012-02-04 Andreas Schwab <schwab@linux-m68k.org>
1477
1478 * .gdbinit (pp1, pv1): Remove redundant defines.
1479 (pr): Use pp.
1480
79c1cc1e
CY
14812012-02-04 Chong Yidong <cyd@gnu.org>
1482
1483 * nsterm.m: Declare a global (Bug#10694).
1484
d7f29f8e
EZ
14852012-02-04 Eli Zaretskii <eliz@gnu.org>
1486
cae07000
SM
1487 * w32.c (get_emacs_configuration_options):
1488 Include --enable-checking, if specified, in the return value.
d7f29f8e 1489
3b95a6f9
MR
14902012-02-04 Martin Rudalics <rudalics@gmx.at>
1491
1492 * dispnew.c (change_frame_size_1): Calculate new_frame_total_cols
1493 after rounding frame sizes. (Bug#9723)
1494
d6fa96a6
EZ
14952012-02-04 Eli Zaretskii <eliz@gnu.org>
1496
1497 * keyboard.c (adjust_point_for_property): Don't position point
1498 before BEGV. (Bug#10696)
1499
df0b2940
PE
15002012-02-03 Paul Eggert <eggert@cs.ucla.edu>
1501
1502 Handle overflow when computing char display width (Bug#9496).
1503 * character.c (char_width): Return EMACS_INT, not int.
1504 (char_width, c_string_width): Check for overflow when
1505 computing the width; this is possible now that individual
1506 characters can have unbounded width. Problem introduced
1507 by merge from Emacs 23 on 2012-01-19.
1508
6bee44d6
MA
15092012-02-02 Michael Albinus <michael.albinus@gmx.de>
1510
1511 * dbusbind.c (Fdbus_register_method): Mention the return value
1512 :ignore in the docstring.
1513
44f92739
GM
15142012-02-02 Glenn Morris <rgm@gnu.org>
1515
1b9f60cc
GM
1516 * callproc.c (Fcall_process, Fcall_process_region): Doc fix.
1517
44f92739
GM
1518 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
1519 Unconditionally set to t. (Bug#10673)
1520 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
1521 * w32term.c (syms_of_w32term) <x-toolkit-scroll-bars>:
1522 * xterm.c (syms_of_xterm) <x-toolkit-scroll-bars>: Doc fix.
1523
c5d3843c
KH
15242012-02-02 Kenichi Handa <handa@m17n.org>
1525
1526 (x_produce_glyphs): Cancel previous change. If cmp->glyph_len is
1527 0, do not call append_composite_glyph.
1528
159462d4 15292012-02-02 Kenichi Handa <handa@m17n.org>
d2a51fd7
KH
1530
1531 * xdisp.c (BUILD_COMPOSITE_GLYPH_STRING): Initialize first_s to
1532 NULL (Bug#6988).
1533 (x_produce_glyphs): If the component of a composition is a null
1534 string, set it->pixel_width to 1 to avoid zero-width glyph.
1535
78cef877
EZ
15362012-02-01 Eli Zaretskii <eliz@gnu.org>
1537
1538 * ralloc.c (resize_bloc, r_alloc_sbrk): Don't call memmove if its
1539 first 2 arguments are identical. This makes inserting large
1540 output from a subprocess an order of magnitude faster on
1541 MS-Windows, where all sbrk'ed memory is always contiguous.
1542
97897668
GM
15432012-01-31 Glenn Morris <rgm@gnu.org>
1544
1545 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
c78c6e0b 1546 * w32term.c (syms_of_w32term) <x-toolkit-scroll-bars>:
97897668
GM
1547 * xterm.c (syms_of_xterm) <x-toolkit-scroll-bars>: Sync docs.
1548
31fd3586
GM
15492012-01-29 Glenn Morris <rgm@gnu.org>
1550
1551 * gnutls.c (syms_of_gnutls): More doc (from etc/NEWS).
1552
0e24a8b2
CY
15532012-01-28 Samuel Thibault <sthibault@debian.org> (tiny change)
1554
1555 * s/gnu.h: Define POSIX_SIGNALS (Bug#10552).
1556
cc0adcb0
CY
15572012-01-28 Chong Yidong <cyd@gnu.org>
1558
1559 * minibuf.c (syms_of_minibuf): Doc fix (Bug#10550).
1560
acc28cb9
CY
15612012-01-26 Chong Yidong <cyd@gnu.org>
1562
9c69cfb7
CY
1563 * keyboard.c (Vecho_keystrokes): Document zero value (Bug#10503).
1564
acc28cb9
CY
1565 * search.c (Fsearch_forward, Fsearch_backward): Document negative
1566 repeat counts (Bug#10507).
1567
48da7392
GM
15682012-01-26 Glenn Morris <rgm@gnu.org>
1569
1570 * lread.c (syms_of_lread): Doc fix.
1571
14af5f7f
CY
15722012-01-25 HIROSHI OOTA <nil@mad.dog.cx> (tiny change)
1573
1574 * coding.c (encode_designation_at_bol): Change return value to
1575 EMACS_INT.
1576
0b21c100
CY
15772012-01-25 Chong Yidong <cyd@gnu.org>
1578
1579 * eval.c (Fuser_variable_p): Doc fix; mention custom-variable-p.
1580
3c2907f7
CY
15812012-01-21 Chong Yidong <cyd@gnu.org>
1582
1583 * floatfns.c (Fcopysign): Make the second argument non-optional,
1584 since nil is not allowed anyway.
1585
959ad23f
AS
15862012-01-21 Andreas Schwab <schwab@linux-m68k.org>
1587
1588 * process.c (read_process_output): Use p instead of XPROCESS (proc).
1589 (send_process): Likewise.
1590
34a02f46
MR
15912012-01-19 Martin Rudalics <rudalics@gmx.at>
1592
1593 * window.c (save_window_save, Fcurrent_window_configuration)
cae07000
SM
1594 (Vwindow_persistent_parameters): Do not use Qstate.
1595 Rewrite doc-strings.
34a02f46 1596
1259009a 15972012-01-19 Kenichi Handa <handa@m17n.org>
25ed9e61
KH
1598
1599 * character.c (char_width): New function.
70d4fdf6
GM
1600 (Fchar_width, c_string_width, lisp_string_width):
1601 Use char_width (Bug#9496).
25ed9e61 1602
6a6ee00d
MR
16032012-01-16 Martin Rudalics <rudalics@gmx.at>
1604
1605 * window.c (Vwindow_persistent_parameters): New variable.
1606 (Fset_window_configuration, save_window_save): Handle persistent
1607 window parameters.
1608
c85efaf7
EZ
16092012-01-14 Eli Zaretskii <eliz@gnu.org>
1610
1611 * w32fns.c (signal_user_input): Don't do a QUIT, to avoid
1612 thrashing the stack of the thread. (Bug#9087)
1613
5944709e
PE
16142012-01-12 Paul Eggert <eggert@cs.ucla.edu>
1615
1616 * xdisp.c (rows_from_pos_range): Add parens as per gcc -Wparentheses.
1617
e71f5d99
EZ
16182012-01-11 Eli Zaretskii <eliz@gnu.org>
1619
1620 * xdisp.c (rows_from_pos_range): Handle the case where the
1621 highlight ends on a newline. (Bug#10464)
1622 (mouse_face_from_buffer_pos): Fix off-by-one error in calculating
1623 he end column for display of highlight that ends on a newline
1624 before a R2L line.
1625
ce316182
GM
16262012-01-11 Glenn Morris <rgm@gnu.org>
1627
1628 * lread.c (init_lread): If no-site-lisp, remove site-lisp dirs
1629 from load-path also when installation-directory is nil. (Bug#10208)
1630
5b43da69
GM
16312012-01-10 Glenn Morris <rgm@gnu.org>
1632
74cc8ff9
GM
1633 * emacs.c (syms_of_emacs) <installation-directory>: Doc fix.
1634
7d8d6e4e
GM
1635 * epaths.in (PATH_LOADSEARCH, PATH_EXEC, PATH_DATA, PATH_DOC):
1636 Update template values to be closer to their typical values these days.
5b43da69 1637
a0db8d43
EZ
16382012-01-09 Eli Zaretskii <eliz@gnu.org>
1639
1640 * xdisp.c (rows_from_pos_range): Accept additional argument
1641 DISP_STRING, and accept any glyph in a row whose object is that
1642 string as eligible for mouse highlight. Fixes mouse highlight of
1643 display strings from overlays. (Bug#10464)
1644
9a0115ab 16452012-01-07 Paul Eggert <eggert@cs.ucla.edu>
09450bae 1646
b9110d6a 1647 emacs: fix an auto-save permissions race condition (Bug#10400)
09450bae
PE
1648 * fileio.c (auto_saving_dir_umask): New static var.
1649 (Fmake_directory_internal): Use it.
1650 (do_auto_save_make_dir): Set it, instead of invoking chmod after
1651 creating the directory. The old code temporarily assigns
1652 too-generous permissions to the directory.
1653 (do_auto_save_eh): Clear it.
b9110d6a 1654 (Fdo_auto_save): Catch all errors, not just file errors, so
09450bae
PE
1655 that the var is always cleared.
1656
6c1bd3f3
EZ
16572012-01-07 Eli Zaretskii <eliz@gnu.org>
1658
1659 * search.c (scan_buffer): Pass character positions to
1660 know_region_cache, not byte positions. (Bug#6540)
1661
069d2b50
L
16622012-01-07 LynX <_LynX@bk.ru> (tiny change)
1663
1664 * w32.c (sys_rename): Report EXDEV when rename of a directory
1665 fails because the target is on another logical disk. (Bug#10284)
1666
75bf0d33
DB
16672012-01-07 David Benjamin <davidben@mit.edu> (tiny change)
1668
1669 * xterm.c (x_embed_request_focus): New function.
1670
1671 * xterm.h: Add prototype.
1672
1673 * xfns.c (Fx_focus_frame): Use it for embedded frames (Bug#9977).
1674
1c6e5a32
GM
16752012-01-05 Glenn Morris <rgm@gnu.org>
1676
1677 * emacs.c (emacs_copyright): Update short copyright year to 2012.
1678
651e947e
EZ
16792012-01-01 Eli Zaretskii <eliz@gnu.org>
1680
1681 * gnutls.c (init_gnutls_functions): Load gnutls_check_version.
1682 Load gnutls_transport_set_lowat only if GnuTLS version is below
1683 2.11.1.
1684 (emacs_gnutls_handshake): Call gnutls_transport_set_lowat only for
1685 GnuTLS versions below 2.11.1.
1686
3778cdd8
AL
16872011-12-31 Antoine Levitt <antoine.levitt@gmail.com>
1688
1689 * xdisp.c (syms_of_xdisp) <window-scroll-functions>: Add warning
1690 to the doc string advising against its use for altering the way
1691 windows are scrolled.
1692
0e5317f7
KH
16932011-12-28 Kenichi Handa <handa@m17n.org>
1694
1695 * coding.c (Fdefine_coding_system_internal): Make an utf-8 base
1696 coding-system ASCII compatible only when it does not produce BOM
1697 on encoding (Bug#10383).
1698
93d5ca1f
JD
16992011-12-26 Jan Djärv <jan.h.d@swipnet.se>
1700
1701 * xmenu.c (x_menu_wait_for_event): Use xg_select for Gtk3 so menus
1702 can scroll.
1703 (create_and_show_popup_menu): Always use menu_position_func for
1704 Gtk3 (Bug#10361).
1705
ca22b785
AS
17062011-12-24 Andreas Schwab <schwab@linux-m68k.org>
1707
1708 * callint.c (Fcall_interactively): Don't truncate prompt string.
1709
d048e1e6
EZ
17102011-12-23 Eli Zaretskii <eliz@gnu.org>
1711
1712 * xdisp.c (handle_invisible_prop): Handle correctly an invisible
1713 property that ends at ZV, so that the bidi iteration could be
3ba1a2ad 1714 resumed from there (after widening). (Bug#10360)
d048e1e6 1715
5ccaba1f
JD
17162011-12-22 Jan Djärv <jan.h.d@swipnet.se>
1717
1718 * nsfont.m (ns_spec_to_descriptor): Do not autorelease fdesc.
1719
204ee57f
JD
17202011-12-21 Jan Djärv <jan.h.d@swipnet.se>
1721
b81d40f0
JB
1722 * nsterm.m (x_free_frame_resources):
1723 Release f->output_data.ns->miniimage.
204ee57f
JD
1724 (ns_index_color): Fix indentation. Do not retain
1725 color_table->colors[i].
1726
1727 * nsmenu.m (ns_update_menubar): Call free_menubar_widget_value_tree
1728 before returning.
1729
1730 * nsfns.m (x_set_background_color): Assign return value from
1731 ns_index_color to face-background instead of NSColor*.
1732 (ns_implicitly_set_icon_type): Fix indentation.
1733 Change assignment in for loop to comparison.
1734
1735 * emacs.c (ns_pool): New variable.
1736 (main): Assign ns_pool.
1737 (Fkill_emacs): Call ns_release_autorelease_pool.
1738
1739 * nsfont.m (ns_spec_to_descriptor): Fix indentation,
1740 autorelease fdesc, release fdAttrs and tdict.
1741 (ns_get_covering_families): Release charset.
1742 (ns_findfonts): Release NSFontDescriptor created with new.
1743 (ns_uni_to_glyphs): Fix indentation.
1744 (setString): Release attrStr before assigning new value.
1745
c803b2b7
JD
17462011-12-18 Jan Djärv <jan.h.d@swipnet.se>
1747
678f4426
JD
1748 * nsmenu.m (NSMenuDidBeginTrackingNotification): Declare if OSX < 10.5
1749 and NS_IMPL_COCOA.
1750 (trackingNotification): Surround with ifdef NS_IMPL_COCOA.
1751 (syms_of_nsmenu): Set trackingMenu to 1 if not NS_IMPL_COCOA.
1752
cd394be1 17532011-12-18 David Reitter <reitter@cmu.edu>
678f4426 1754
5fecd5fc
JD
1755 * nsterm.m (ns_term_init): Subscribe for notifications
1756 NSMenuDidBeginTrackingNotification and NSMenuDidEndTrackingNotification
1757 to method trackingNotification in EmacsMenu.
1758
1759 * nsmenu.m (trackingMenu): New variable.
3771cb17 1760 (trackingNotification): New method (from Aquamacs).
5fecd5fc 1761 (menuNeedsUpdate): Expand comment and return if trackingMenu is 0,
3771cb17 1762 from Aquamacs (Bug#7030).
678f4426
JD
1763
17642011-12-18 Jan Djärv <jan.h.d@swipnet.se>
5fecd5fc 1765
c803b2b7
JD
1766 * nsselect.m (CUT_BUFFER_SUPPORT): Remove define.
1767 (symbol_to_nsstring): Fix indentation.
1768 (ns_symbol_to_pb): New function.
cae07000
SM
1769 (Fns_get_selection_internal): Rename from Fns_get_cut_buffer_internal.
1770 (Fns_rotate_cut_buffers_internal): Remove.
1771 (Fns_store_selection_internal): Rename from
c803b2b7
JD
1772 Fns_store_cut_buffer_internal.
1773 (ns_get_foreign_selection, Fx_own_selection_internal)
1774 (Fx_disown_selection_internal, Fx_selection_exists_p)
b81d40f0
JB
1775 (Fns_get_selection_internal, Fns_store_selection_internal):
1776 Use ns_symbol_to_pb and check if return value is nil.
1777 (syms_of_nsselect): Remove ifdef CUT_BUFFER_SUPPORT. Remove defsubr
1778 Sns_rotate_cut_buffers_internal. Sns_get_cut_buffer_internal
c803b2b7
JD
1779 renamed to Sns_get_selection_internal, Sns_store_cut_buffer_internal
1780 renamed to Sns_store_selection_internal.
1781 (ns_handle_selection_request): Move code to Fx_own_selection_internal
1782 and remove this function.
1783 (ns_handle_selection_clear): Remove, never used.
1784 (Fx_own_selection_internal): Move code from ns_handle_selection_request
1785 here.
1786
e1b01a3a
KB
17872011-12-17 Ken Brown <kbrown@cornell.edu>
1788
1789 * fileio.c (check_writable) [CYGWIN]: Return non-zero if UID or
1790 GID is unknown (Bug#10257).
1791
2adb6e85
PE
17922011-12-17 Paul Eggert <eggert@cs.ucla.edu>
1793
1794 * s/gnu-linux.h: Fix mark_memory typo (Bug#10286).
1795 (GC_MARK_SECONDARY_STACK): Omit removed 3rd arg to mark_memory,
1796 which caused a build failure on GNU/Linux IA-64. This problem was
1797 introduced by my 2011-10-07 patch.
1798
d1d7b339
JL
17992011-12-15 Juri Linkov <juri@jurta.org>
1800
1801 * image.c (imagemagick_error): New function. (Bug#10112)
1802 (imagemagick_load_image): Comment out `MagickSetResolution' call.
1803 Use `imagemagick_error' where ImageMagick functions return
1804 `MagickFalse'.
1805 (Fimagemagick_types): Add `Fnreverse' to return the list in the
1806 proper order.
1807
100d5755
KH
18082011-12-15 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
1809
1810 * xftfont.c (xftfont_draw): Use the font metrics of s->font to
1811 fill background (Bug#8992).
1812
454592a6
MR
18132011-12-13 Martin Rudalics <rudalics@gmx.at>
1814
1815 * window.c (Vwindow_combination_resize)
1816 (Vwindow_combination_limit): Use t instead of non-nil in
1817 doc-strings.
61d4b438
MR
1818 (Vrecenter_redisplay): Add first sentence of doc-string on
1819 separate line.
53524d93 1820 (Frecenter): Fix doc-string typo.
454592a6 1821
3633e3aa
KH
18222011-12-11 Kenichi Handa <handa@m17n.org>
1823
1824 * coding.c (Funencodable_char_position): Pay attention to the
1825 buffer text relocation (Bug#9389).
1826
7b9d523a 18272011-12-10 Jan Djärv <jan.h.d@swipnet.se>
61ccba97 1828
7b9d523a
JD
1829 * xterm.c (x_term_init): Move call to gdk_window_add_filter before
1830 gtk_init (Bug#10100).
1831
b73189c6
EZ
18322011-12-10 Eli Zaretskii <eliz@gnu.org>
1833
1834 * xdisp.c (RECORD_MAX_MIN_POS): Use IT->cmp_it.charpos only if
1835 IT->string is nil. (Bug#10263)
1836
f7dfe5d6
JD
18372011-12-10 Jan Djärv <jan.h.d@swipnet.se>
1838
83faebb4
JD
1839 * nsterm.h (x_free_frame_resources): Declare.
1840
f7dfe5d6
JD
1841 * nsfns.m (ns_get_defaults_value): New function (Bug#10103).
1842 (Fns_get_resource, x_get_string_resource): Call ns_get_defaults_value.
1843
1844 * nsterm.h (ns_get_defaults_value): Declare.
1845
1846 * nsterm.m (ns_default): Call ns_get_defaults_value.
1847
7cd4e72c
EZ
18482011-12-09 Eli Zaretskii <eliz@gnu.org>
1849
1850 * xdisp.c (try_scrolling): Don't set scroll_down_p if dy is zero.
1851 (Bug#10170)
1852
b34d7317
YM
18532011-12-09 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
1854
1855 * unexelf.c (unexec) [NS_IMPL_GNUSTEP]: Take account of the case
1856 that where the value of an _OBJC_* symbol points to is in the .bss
1857 section (Bug#10240).
1858
76470ad1
KH
18592011-12-08 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
1860
1861 * coding.c (encode_coding_ccl): Check (charbuf < charbuf_end)
2fac8180 1862 after the loop to call ccl_driver at least once (Bug#8619).
76470ad1 1863
745fff94
KH
18642011-12-08 Kenichi Handa <handa@m17n.org>
1865
1866 * ftfont.c (get_adstyle_property): Fix previous change
1867 (Bug#10233).
1868
6e44397c
JB
18692011-12-07 Juanma Barranquero <lekktu@gmail.com>
1870
1871 * w32.c (init_environment): If no_site_lisp, remove site-lisp
1872 dirs from the default value of EMACSLOADPATH (bug#10208).
1873
7efa6272
GM
18742011-12-07 Glenn Morris <rgm@gnu.org>
1875
1876 * lread.c (init_lread): If no_site_lisp, exclude site-lisp/ in
1877 installation and source directories as well. (Bug#10208)
1878
f6fc4d87
CY
18792011-12-06 Chong Yidong <cyd@gnu.org>
1880
1881 * minibuf.c (Fread_from_minibuffer): Doc fix (Bug#10228).
1882
2bf26180
GM
18832011-12-06 Glenn Morris <rgm@gnu.org>
1884
1885 * process.c (start_process_unwind): Treat any pid <= 0, except -2,
1886 as an error, not just -1. (Bug#10217)
1887
3a6ad4f0
CY
18882011-12-05 Chong Yidong <cyd@gnu.org>
1889
1890 * keyboard.c (process_special_events): New function.
1891 (swallow_events, Finput_pending_p): Use it (Bug#10195).
1892
75a3b399
PE
18932011-12-05 Paul Eggert <eggert@cs.ucla.edu>
1894
1895 * coding.c (encode_designation_at_bol): Don't use uninitialized
1896 local variable (Bug#9318).
1897
c3c9e25e
KH
18982011-12-05 Kenichi Handa <handa@m17n.org>
1899
1900 * ftfont.c (get_adstyle_property): If the font is not BDF nor PCF,
1901 return Qnil (Bug#8046, Bug#10193).
1902
5eb05ea3
KH
19032011-12-05 Kenichi Handa <handa@m17n.org>
1904
1905 * coding.c (encode_designation_at_bol): New args charbuf_end and
1906 dst. Return the number of produced bytes. Callers changed.
a79703f5
KH
1907 (coding_set_source): Return how many bytes coding->source was
1908 relocated.
1909 (coding_set_destination): Return how many bytes
1910 coding->destination was relocated.
1911 (CODING_DECODE_CHAR, CODING_ENCODE_CHAR, CODING_CHAR_CHARSET)
cae07000 1912 (CODING_CHAR_CHARSET_P): Adjust for the avove changes.
5eb05ea3
KH
1913
19142011-12-05 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
1915
1916 * coding.c (CODING_CHAR_CHARSET_P): New macro.
1917 (encode_coding_emacs_mule, encode_coding_iso_2022): Use the above
1918 macro (Bug#9318).
1919
19202011-12-05 Andreas Schwab <schwab@linux-m68k.org>
1921
1922 The following changes are to fix Bug#9318.
1923
a79703f5 1924 * coding.c (CODING_ENCODE_CHAR, CODING_CHAR_CHARSET): New macros.
5eb05ea3
KH
1925 (encode_coding_emacs_mule, ENCODE_ISO_CHARACTER)
1926 (encode_coding_iso_2022, encode_coding_sjis)
a79703f5 1927 (encode_coding_big5, encode_coding_charset): Use the above macros.
5eb05ea3 1928
7dbda6df
JB
19292011-12-05 Juanma Barranquero <lekktu@gmail.com>
1930
1931 * lisp.h (process_quit_flag): Fix external declaration.
1932
6d5eb5b0
SM
19332011-12-04 Stefan Monnier <monnier@iro.umontreal.ca>
1934
1935 Don't macro-inline non-performance-critical code.
1936 * eval.c (process_quit_flag): New function.
1937 * lisp.h (QUIT): Use it.
1938
a0c3fad0
JD
19392011-12-04 Jan Djärv <jan.h.d@swipnet.se>
1940
1941 * nsfns.m (get_geometry_from_preferences): New function.
1942 (Fx_create_frame): Call get_geometry_from_preferences (Bug#10103).
1943
6c07aac2
AS
19442011-12-04 Andreas Schwab <schwab@linux-m68k.org>
1945
1946 * emacs.c (Qkill_emacs): Define.
1947 (syms_of_emacs): Initialize it.
1948 * keyboard.c (interrupt_signal): Don't call Fkill_emacs here, set
1949 Qquit_flag to `kill-emacs' instead.
6d5eb5b0
SM
1950 (quit_throw_to_read_char): Add parameter `from_signal'.
1951 All callers changed. Call Fkill_emacs if requested and safe.
6c07aac2
AS
1952 * lisp.h (QUIT): Call Fkill_emacs if requested.
1953
c052ead4
JD
19542011-12-03 Jan Djärv <jan.h.d@swipnet.se>
1955
1956 * widget.c (update_wm_hints): Return if wmshell is null.
1957 (widget_update_wm_size_hints): New function.
1958
1959 * widget.h (widget_update_wm_size_hints): Declare.
1960
1961 * xterm.c (x_wm_set_size_hint): If USE_X_TOOLKIT, call
1962 widget_update_wm_size_hints (Bug#10104).
1963
9e49252b
EZ
19642011-12-03 Eli Zaretskii <eliz@gnu.org>
1965
1966 * xdisp.c (handle_invisible_prop): If the invisible text ends just
1967 before a newline, prepare the bidi iterator for consuming the
1968 newline, and keep the current paragraph direction. (Bug#10183)
e9a49426 1969 (redisplay_window): Don't let `margin' become negative. (Bug#10192)
9e49252b 1970
02b16839
JL
19712011-12-02 Juri Linkov <juri@jurta.org>
1972
1973 * search.c (Fword_search_regexp): New Lisp function created from
1974 `wordify'. Change type of arg `lax' from `int' to `Lisp_Object'.
1975 (Fword_search_backward, Fword_search_forward)
1976 (Fword_search_backward_lax, Fword_search_forward_lax):
1977 Use `Fword_search_regexp' instead of `wordify'. Doc fix.
1978 (syms_of_search): Define `Sword_search_regexp'. (Bug#10145)
1979
0068070e
SM
19802011-12-01 Stefan Monnier <monnier@iro.umontreal.ca>
1981
1982 * fileio.c (Finsert_file_contents): Move after-change-function call
1983 to before the "handled:" label, since all "goto handled" appear in
1984 cases where the *-change-functions have already been properly called
1985 (bug#10117).
1986
3360a3fc
AS
19872011-12-01 Andreas Schwab <schwab@linux-m68k.org>
1988
1989 * keyboard.c (interrupt_signal): Don't call kill-emacs when
1990 waiting for input. (Bug#10169)
1991
73d6c093
EZ
19922011-11-30 Eli Zaretskii <eliz@gnu.org>
1993
1994 * dispnew.c (adjust_glyph_matrix): Remove the assertion that
1995 verifies glyph row's hash code--we have just reallocated the
1996 glyphs, so their contents can be complete garbage. (Bug#10164)
1997
febe6bea
JB
19982011-11-30 Juanma Barranquero <lekktu@gmail.com>
1999
2000 * dispnew.c (adjust_glyph_matrix) [XASSERTS]: Add missing check.
2001
801a4313
EZ
20022011-11-30 Eli Zaretskii <eliz@gnu.org>
2003
2004 * dispnew.c (adjust_glyph_matrix) [XASSERTS]: Ensure ROW's
2005 attributes are tested _before_ calling verify_row_hash, to protect
2006 against GCC re-ordering of the tests. (Bug#10164)
2007
2b56b87e
JD
20082011-11-29 Jan Djärv <jan.h.d@swipnet.se>
2009
2010 * xterm.h (struct x_output): net_wm_state_hidden_seen is new.
2011
2012 * xterm.c (handle_one_xevent): Only set async_visible and friends
2013 if net_wm_state_hidden_seen is non-zero (Bug#10002)
7dbda6df 2014 (get_current_wm_state): Set net_wm_state_hidden_seen to 1 if
2b56b87e
JD
2015 _NET_WM_STATE_HIDDEN is in NET_WM_STATE.
2016
dbf31225
PE
20172011-11-28 Paul Eggert <eggert@cs.ucla.edu>
2018
2019 Remove GCPRO-related macros that exist only to avoid shadowing locals.
2020 * lisp.h (GCPRO1_VAR, GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR, GCPRO5_VAR)
2021 (GCPRO6_VAR, UNGCPRO_VAR): Remove. See
2022 <http://lists.gnu.org/archive/html/emacs-diffs/2011-11/msg00265.html>.
2023 All uses changed to use GCPRO1 etc.
2024 (GCPRO1, GCPRO2, GCPRO3, GCPRO4, GCPRO5, GCPRO6, UNGCPRO):
2025 Revert to old implementation (i.e., before 2011-03-11).
2026
1305621b
YM
20272011-11-28 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
2028
2029 * dispnew.c (scrolling_window): Truncate overlaps in copy destination
2030 of scroll runs so as to avoid assigning disabled bogus rows and
2031 unnecessary graphics copy operations.
2032
8c9afb46
EZ
20332011-11-27 Eli Zaretskii <eliz@gnu.org>
2034
2035 * s/ms-w32.h (utimbuf) [_MSC_VER]: Don't define.
2036 (snprintf) [_MSC_VER]: Redirect to _snprintf.
2037 (strtoll) [_MSC_VER]: Redirect to _strtoi64.
2038 (malloc, free, realloc, calloc): Redirect to e_* only when
2039 compiling Emacs.
2040
2041 * lisp.h (GCTYPEBITS): Move before first use.
2042 (ALIGN_GCTYPEBITS) [_MSC_VER]: Define.
2043 (DECL_ALIGN) [_MSC_VER]: Use it, as MSVC doesn't like bit ops in
2044 this macro definition.
2045
2046 * s/ms-w32.h (tzname): Redirect to _tzname for all values of
2047 _MSC_VER.
2048
54e9e3bf
JD
20492011-11-27 Jan Djärv <jan.h.d@swipnet.se>
2050
6d5eb5b0
SM
2051 * gtkutil.c (xg_create_frame_widgets):
2052 Call gtk_window_set_has_resize_grip (FALSE) if that function is
54e9e3bf
JD
2053 present with Gtk+ 2.0.
2054
83aca1cb
PE
20552011-11-26 Paul Eggert <eggert@cs.ucla.edu>
2056
2057 * fileio.c (Finsert_file_contents): Undo previous change; see
2058 <http://lists.gnu.org/archive/html/emacs-diffs/2011-11/msg00265.html>.
2059
5b76caa4
PE
20602011-11-26 Paul Eggert <eggert@cs.ucla.edu>
2061
2062 Rename locals to avoid shadowing.
2063 * fileio.c (Finsert_file_contents):
2064 Rename inner 'gcpro1' to 'inner_gcpro1' to avoid shadowing.
2065 * process.c (wait_reading_process_output):
2066 Rename inner 'proc' to 'p' to avoid shadowing.
2067 Indent for consistency with usual Emacs style.
2068
8c535114
EZ
20692011-11-25 Eli Zaretskii <eliz@gnu.org>
2070
2071 * xdisp.c (redisplay_window): If cursor row is not fully visible
2072 after recentering, and scroll-conservatively is set to a large
2073 number, scroll window by a few more lines to make the cursor fully
2074 visible and out of scroll-margin. (Bug#10105)
91b4a718
EZ
2075 (start_display): Don't move to the next line if the display should
2076 start at a newline that is part of a display vector or an overlay
2077 string. (Bug#10119)
8c535114 2078
fa4fdb5c
JL
20792011-11-24 Juri Linkov <juri@jurta.org>
2080
2081 * image.c (imagemagick_load_image): Move `MagickSetResolution' down
2082 after the `MagickPingImage' call. (Bug#10112)
2083
90ec88df
CY
20842011-11-23 Chong Yidong <cyd@gnu.org>
2085
2086 * window.c (Fcoordinates_in_window_p): Accept only live windows.
2087
56e2e794
MR
20882011-11-23 Martin Rudalics <rudalics@gmx.at>
2089
2090 * buffer.c (Fkill_buffer): Run replace_buffer_in_windows before
2091 making another buffer current. (Bug#10114)
2092
b6e64c41
GM
20932011-11-23 Glenn Morris <rgm@gnu.org>
2094
2095 * font.c (font_find_for_lface) [HAVE_NS]: Ignore case. (Bug#2526)
2096
6b21de18
CY
20972011-11-23 Chong Yidong <cyd@gnu.org>
2098
2099 * xdisp.c (compute_stop_pos): Check validity of end_charpos before
2100 using it (Bug#5984).
2101
b12cd789
EZ
21022011-11-22 Eli Zaretskii <eliz@gnu.org>
2103
2104 * dispnew.c (adjust_glyph_matrix): Don't verify hash code of mode-
2105 and header-lines, as they don't have one computed for them.
2106 (Bug#10098)
2107
2108 * .gdbinit (prow): Make displayed values more self-explaining.
2109 Add row's hash code.
2110
261b6fd4
LMI
21112011-11-21 Lars Magne Ingebrigtsen <larsi@gnus.org>
2112
2113 * process.c (wait_reading_process_output): Fix asynchrounous
2114 GnuTLS socket handling on some versions of the GnuTLS library.
16c1ad08 2115 (wait_reading_process_output): Add comment and URL.
261b6fd4 2116
e7cfd277
JD
21172011-11-21 Jan Djärv <jan.h.d@swipnet.se>
2118
2119 * xterm.c (x_clear_frame): Reinstate the XClearWindow call.
2120
a9b9b7f5
CY
21212011-11-21 Chong Yidong <cyd@gnu.org>
2122
2123 * window.c (Fnext_window, Fprevious_window): Doc fix.
2124
b0d15b4f
SM
21252011-11-20 Stefan Monnier <monnier@iro.umontreal.ca>
2126
2127 * window.c (get_phys_cursor_glyph): Fix Lisp_Object/int mixup.
2128
fe7a3057
JB
21292011-11-20 Juanma Barranquero <lekktu@gmail.com>
2130
2131 * nsfont.m (syms_of_nsfont) <ns-reg-to-script>: Fix typo.
2132
d2999b1a
MR
21332011-11-20 Martin Rudalics <rudalics@gmx.at>
2134
2135 * window.c (Fset_window_combination_limit): Rename argument
2136 STATUS to LIMIT.
2137 (Vwindow_combination_limit): Remove "status" from doc-string.
2138
d5ff9cd0
AS
21392011-11-20 Andreas Schwab <schwab@linux-m68k.org>
2140
2141 * m/ibms390.h: Remove.
2142 * m/ibms390x.h: Don't include "ibms390.h".
2143
a5bb9bd3
SM
21442011-11-20 Stefan Monnier <monnier@iro.umontreal.ca>
2145
2146 * fileio.c (Finsert_file_contents): Add missing gcpro1 variable.
2147 Suggested by Dmitry Antipov <dmantipov@yandex.ru>.
2148
cd1181db
JB
21492011-11-20 Juanma Barranquero <lekktu@gmail.com>
2150
2151 * casetab.c (Fset_case_table):
2152 * charset.c (Fcharset_after): Fix typos.
2153
615a3b8d 21542011-11-20 Paul Eggert <eggert@cs.ucla.edu>
6a0bf43d 2155
17e845af
PE
2156 Standardize on VIRT_ADDR_VARIES behavior (Bug#10042).
2157 Otherwise, valgrind does not work on some platforms.
2158 Problem reported by Andreas Schwab in
6a0bf43d
PE
2159 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00081.html>.
2160 * puresize.h (pure, PURE_P): Always behave as if VIRT_ADDR_VARIES
2161 is set, removing the need for VIRT_ADDRESS_VARIES.
2162 (PURE_P): Use a more-efficient implementation that needs just one
2163 comparison, not two: on x86-64 with GCC 4.6.2, this cut down the
2164 number of instructions from 6 (xorl, cmpq, jge, xorl, cmpq, setge)
2165 to 4 (xorl, subq, cmpq, setbe).
2166 * alloc.c (pure): Always extern now, since that's the
2167 VIRT_ADDR_VARIES behavior.
2168 (PURE_POINTER_P): Use a single comparison, not two, for
2169 consistency with the new puresize.h.
2170 * lisp.h (PNTR_COMPARISON_TYPE): Remove; no longer needed.
2171 * m/ibms390.h, m/intel386.h, m/template.h, s/cygwin.h, s/hpux10-20.h:
2172 Remove VIRT_ADDR_VARIES no longer needed.
2173
f8fe6f96
EZ
21742011-11-19 Eli Zaretskii <eliz@gnu.org>
2175
2176 * xdisp.c (x_write_glyphs, draw_phys_cursor_glyph)
2177 (erase_phys_cursor, update_window_cursor, show_mouse_face)
2178 (cursor_in_mouse_face_p): If the cursor position is out of bounds,
2179 behave as if the cursor position were at the window margin.
2180
2181 * window.c (get_phys_cursor_glyph): If the window is hscrolled,
2182 and the cursor position is out of bounds, behave as if the cursor
2183 position were at the window margin. (Bug#10075)
2184
df05a53c
CY
21852011-11-18 Chong Yidong <cyd@gnu.org>
2186
2187 * window.c (Fwindow_combination_limit): Make first argument
2188 non-optional, since it is meaningless for live windows like the
2189 selected window.
61ccba97 2190
2071918e
DA
21912011-11-18 Dmitry Antipov <dmantipov@yandex.ru>
2192
2193 * keymap.c (Fwhere_is_internal): Add missing RETURN_UNGCPROs.
2194
b50a28de
SM
21952011-11-18 Stefan Monnier <monnier@iro.umontreal.ca>
2196
2197 * intervals.c: Fix grafting over the whole buffer (bug#10071).
2198 (graft_intervals_into_buffer): Simplify.
2199
015137db
EZ
22002011-11-18 Eli Zaretskii <eliz@gnu.org>
2201
2202 * dispnew.c (swap_glyph_pointers): Swap the used[] arrays and the
2203 hash values of the two rows.
2204 (copy_row_except_pointers): Preserve the used[] arrays and the
2205 hash values of the two rows. (Bug#10035)
68c95424 2206 (add_row_entry): Add xassert to verify that ROW's hash code is valid.
015137db
EZ
2207
2208 * xdisp.c (row_hash): New function, body extracted from
2209 compute_line_metrics.
2210 (compute_line_metrics): Call row_hash, instead of computing the
2211 hash code inline.
2212
2213 * dispnew.c (verify_row_hash): Call row_hash for computing the
2214 hash code of a row, instead of duplicating code from xdisp.c.
2215
2216 * dispextern.h (row_hash): Add prototype.
2217
a2addb04
TH
22182011-11-18 Tassilo Horn <tassilo@member.fsf.org>
2219
2220 * frame.c (delete_frame): Don't delete the terminal when the last
2221 X frame is closed if emacs is built with GTK toolkit.
2222
df85d315
JB
22232011-11-17 Juanma Barranquero <lekktu@gmail.com>
2224
2225 * window.c (syms_of_window) <window-combination-resize>: Fix typo.
2226
a0c2d0ae
MR
22272011-11-17 Martin Rudalics <rudalics@gmx.at>
2228
2229 * window.c (Vwindow_splits): Rename to
2230 Vwindow_combination_resize. Suggested by Juri Linkov.
2231 (Fsplit_window_internal): Use Vwindow_combination_resize instead
2232 of Vwindow_splits.
2233
58179cce
JB
22342011-11-16 Juanma Barranquero <lekktu@gmail.com>
2235
7877f373
JB
2236 * nsfns.m (Fns_font_name):
2237 * window.c (syms_of_window) <window-combination-limit>: Fix typos.
58179cce 2238
b6f67890
MR
22392011-11-16 Martin Rudalics <rudalics@gmx.at>
2240
2241 * window.h (window): Rename slot "nest" to "combination_limit".
2242 * window.c (Fwindow_nest): Rename to Fwindow_combination_limit.
2243 (Fset_window_nest): Rename to Fset_window_combination_limit.
2244 (Vwindow_nest): Rename to Vwindow_combination_limit.
2245 (recombine_windows, make_parent_window, make_window)
2246 (Fsplit_window_internal, saved_window)
2247 (Fset_window_configuration, save_window_save): Rename all
2248 occurrences of window_nest to window_combination_limit.
2249
c7015153
JB
22502011-11-15 Juanma Barranquero <lekktu@gmail.com>
2251
2252 * image.c (imagemagick_load_image): Fix typo.
2253
322ad6ec
EZ
22542011-11-14 Eli Zaretskii <eliz@gnu.org>
2255
2256 * xdisp.c (display_line): Move the call to
2257 highlight_trailing_whitespace before the call to
2258 compute_line_metrics, since the latter needs to see the final
6d5eb5b0
SM
2259 faces of all the glyphs to compute ROW's hash value.
2260 Fixes assertion violations in row_equal_p. (Bug#10035)
322ad6ec 2261
f067b8ec
JB
22622011-11-14 Juanma Barranquero <lekktu@gmail.com>
2263
2264 * w32proc.c (reader_thread): Don't check pending input if cp->fd < 0,
2265 just return (bug#10044).
2266
1e5b2111
EZ
22672011-11-12 Eli Zaretskii <eliz@gnu.org>
2268
7ef3cbd5
EZ
2269 * makefile.w32-in (HEAPSIZE): New variable, allows to build temacs
2270 with user-defined heap size. Bump the default size of the temacs
2271 heap to 27MB, to avoid memory warning when running temacs.
2272 ($(TEMACS)): Use HEAPSIZE instead of a hardcoded value.
2273
1e5b2111
EZ
2274 * dispnew.c (scrolling_window): Fix incorrect indices in accessing
2275 current_matrix and desired_matrix. (Bug#9990)
7a7270dd
EZ
2276 (verify_row_hash) [XASSERTS]: New function.
2277 (adjust_glyph_matrix, row_equal_p): Use it in xassert to verify
2278 that the hash value of glyph rows is correct.
1e5b2111 2279
89d61221
MR
22802011-11-12 Martin Rudalics <rudalics@gmx.at>
2281
2282 * window.h (window): Remove splits slot.
2283 * window.c (Fwindow_splits, Fset_window_splits): Remove.
2284 (Fdelete_other_windows_internal, make_parent_window)
2285 (make_window, Fsplit_window_internal, Fdelete_window_internal)
2286 (Fset_window_configuration, save_window_save): Don't deal with
2287 split status of windows.
2288 (saved_window): Remove splits slot.
2289 (Vwindow_splits): Rewrite doc-string.
2290
97f18cc8
JD
22912011-11-11 Jan Djärv <jan.h.d@swipnet.se>
2292
2293 * xfns.c (unwind_create_frame):
2294 * nsfns.m (unwind_create_frame):
2295 * w32fns.c (unwind_create_frame): Use Fmemq to check if frame is in
2296 Vframe_list (Bug#9999).
2297
22a648b4
DA
22982011-11-11 Dmitry Antipov <dmantipov@yandex.ru>
2299
0b381c7e 2300 * xdisp.c (syms_of_xdisp): Remove duplicated definition of Qtext.
22a648b4 2301
659afede
KH
23022011-11-11 Kenichi Handa <handa@m17n.org>
2303
2304 * callproc.c (Fcall_process): Set the member dst_multibyte of
2305 process_coding.
2306
9ac0394b
KH
23072011-11-11 Johan Bockgård <bojohan@gnu.org>
2308
2309 * xdisp.c (fill_composite_glyph_string): Always set s->face, to
2310 avoid a crash (bug#9496).
2311
2fbdc249
CY
23122011-11-09 Chong Yidong <cyd@gnu.org>
2313
2314 * window.c (Fwindow_inside_edges, Fwindow_inside_pixel_edges)
2315 (Fwindow_inside_absolute_pixel_edges): Only allow live windows.
2316
ac6b1f81
PE
23172011-11-08 Paul Eggert <eggert@cs.ucla.edu>
2318
2319 * s/gnu.h (GC_MARK_STACK): Define to GC_MAKE_GCPROS_NOOPS (Bug#9926).
2320
09db192c
PE
23212011-11-08 Paul Eggert <eggert@cs.ucla.edu>
2322
2323 Avoid some portability problems by eschewing 'extern inline' functions.
2324 The trivial performance wins aren't worth the portability hassles; see
2325 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00084.html>
2326 et seq.
2327 * dispextern.h (window_box, window_box_height, window_text_bottom_y)
2328 (window_box_width, window_box_left, window_box_left_offset)
2329 (window_box_right, window_box_right_offset): Undo previous change,
2330 by removing the "extern"s.
2331 * intervals.c (adjust_intervals_for_insertion)
2332 (adjust_intervals_for_deletion): Undo previous change,
2333 making these static again.
2334 (offset_intervals, temp_set_point_both, temp_set_point)
2335 (copy_intervals_to_string): No longer inline.
2336 * xdisp.c (window_text_bottom_y, window_box_width)
2337 (window_box_height, window_box_left_offset)
2338 (window_box_right_offset, window_box_left, window_box_right)
2339 (window_box): No longer inline.
2340
105216ed
CY
23412011-11-08 Chong Yidong <cyd@gnu.org>
2342
2343 * window.c (Fwindow_left_column, Fwindow_top_line): Doc fix.
6d5eb5b0
SM
2344 (Fwindow_body_height, Fwindow_body_width): Move from Lisp.
2345 Signal an error if not a live window.
105216ed
CY
2346 (Fwindow_total_width, Fwindow_total_height): Move from Lisp.
2347 (Fwindow_total_size, Fwindow_body_size): Move to Lisp.
2348
ae9e237f
JB
23492011-11-07 Juanma Barranquero <lekktu@gmail.com>
2350
2351 * lisp.h (syms_of_abbrev): Remove declaration.
2352 Reported by CHENG Gao <chenggao@royau.me>.
2353
c7aa8333
EZ
23542011-11-07 Eli Zaretskii <eliz@gnu.org>
2355
2356 * w32.c (check_windows_init_file): Don't look for term/w32-win.el
2357 if Vpurify_flag is non-nil. Fixes a crash when running w32 build
2358 of temacs in GUI mode.
2359
be7f5545
MR
23602011-11-07 Martin Rudalics <rudalics@gmx.at>
2361
2362 * window.h: Declare delete_all_child_windows instead of
2363 delete_all_subwindows.
2364 * window.c (Fwindow_nest, Fset_window_nest)
2365 (Fset_window_new_total, Fset_window_new_normal)
2366 (Fwindow_resize_apply): Don't use term subwindow in doc-strings.
2367 (delete_all_subwindows): Rename to delete_all_child_windows.
2368 (Fdelete_other_windows_internal, Fset_window_configuration):
2369 Call delete_all_child_windows instead of delete_all_subwindows.
2370 * frame.c (delete_frame): Call delete_all_child_windows instead
2371 of delete_all_subwindows.
2372
ca78dc43
PE
23732011-11-07 Paul Eggert <eggert@cs.ucla.edu>
2374
2375 * alloc.c (DEADP): New macro, for porting to GNU/Hurd (Bug#9926).
2376 This is also needed for porting to any host where GC_MARK_STACK is
2377 not GC_MAKE_GCPROS_NOOPS.
2378 (which_symbols): Use it.
2379
a0241d01
KH
23802011-11-07 Kenichi Handa <handa@m17n.org>
2381
2382 * coding.c (coding_set_destination): Check coding->src_pos only
2383 when coding->src_object is a buffer (bug#9910).
2384
2385 * process.c (send_process): Set the member src_multibyte of coding
2386 to 0 (bug#9911) when sending a unibyte text.
2387
2388 * callproc.c (Fcall_process): Set the member src_multibyte of
2389 process_coding to 0 (bug#9912).
2390
a64bfdfa 23912011-11-06 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
ba24cea2
YM
2392
2393 * xmenu.c (cleanup_widget_value_tree): New function.
2394 (xmenu_show, xdialog_show): Use it in record_unwind_protect instead of
2395 calling free_menubar_widget_value_tree directly (Bug#9830).
2396
cb41b32a
PE
23972011-11-06 Paul Eggert <eggert@cs.ucla.edu>
2398
2399 Fix some portability problems with 'inline'.
2400 * dispextern.h (window_box, window_box_height, window_text_bottom_y)
2401 (window_box_width, window_box_left, window_box_left_offset)
2402 (window_box_right, window_box_right_offset): Declare extern.
2403 Otherwise, these inline functions do not conform to C99 and
2404 are miscompiled by Microsoft compilers. Reported by Eli Zaretskii in
2405 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00084.html>.
2406 * intervals.c (adjust_intervals_for_insertion)
2407 (adjust_intervals_for_deletion): Now extern, because otherwise the
2408 extern inline functions 'offset_intervals' couldn't refer to it.
2409 (static_offset_intervals): Remove.
2410 (offset_intervals): Rewrite using the old contents of
2411 static_offset_intervals. The old version didn't conform to C99
2412 because an extern inline function contained a reference to an
2413 identifier with static linkage.
2414
b7041366
AS
24152011-11-06 Andreas Schwab <schwab@linux-m68k.org>
2416
2417 * keyboard.c (interrupt_signal): Don't call kill-emacs while in
2418 GC.
2419
88a37c4d
EZ
24202011-11-06 Eli Zaretskii <eliz@gnu.org>
2421
2422 * xdisp.c (init_iterator, reseat_to_string): Don't set the
2423 iterator's bidi_p flag if Vpurify_flag is non-nil. (Bug#9963)
2424 (Fcurrent_bidi_paragraph_direction): If Vpurify_flag is non-nil,
2425 return Qleft_to_right.
2426
49745b39
CY
24272011-11-06 Chong Yidong <cyd@gnu.org>
2428
2429 * window.c (Fwindow_live_p, Fwindow_frame, Fframe_root_window)
2430 (Fminibuffer_window, Fwindow_buffer, Fwindow_splits)
2431 (Fset_window_splits, Fwindow_nest, Fset_window_nest)
2432 (Fwindow_use_time, Fwindow_total_size, Fwindow_normal_size)
2433 (Fwindow_new_normal, Fwindow_left_column, Fwindow_top_line)
2434 (Fwindow_margins, Fwindow_fringes, Fwindow_scroll_bars)
2435 (Fwindow_vscroll): Doc fix.
2436 (Fwindow_top_child, Fwindow_left_child): Eliminate a nil default
2437 argument, since it makes no sense to pass a live window and for
2438 consistency with window-child.
2439
1f05cd82
CS
24402011-11-05 Christoph Scholtes <cschol2112@googlemail.com>
2441
2442 * makefile.w32-in ($(TEMACS), (gl-stamp)): Use $(THISDIR) to
2443 support MSVC.
2444
22610910
JR
24452011-11-05 Jason Rumney <jasonr@gnu.org>
2446
2447 * w32font.c (font_matches_spec): Filter out non-Japanese kana fonts.
2448 (add_font_entity_to_list): Filter out non-Japanese Shift-JIS
2449 fonts (Bug#6029).
2450 (add_font_entity_to_list): Fix logic errors in mixed boolean and
2451 bitwise arithmetic preventing use of unicode-sip and non-truetype
2452 opentype fonts.
2453
a06776b2
EZ
24542011-11-05 Eli Zaretskii <eliz@gnu.org>
2455
3ad924ba
EZ
2456 * s/ms-w32.h (fstat, stat, utime): Move redirections to
2457 "emacs"-only part.
2458
a06776b2
EZ
2459 * w32fns.c (x_create_tip_frame, Fx_create_frame): Rearrange
2460 initialization code to keep similarity to xfns.c after changes
2461 from 2011-11-05.
2462
c9e7db78
JD
24632011-11-05 Jan Djärv <jan.h.d@swipnet.se>
2464
a97f8f3f
JD
2465 * nsfns.m: Declare image_cache_refcount if GLYPH_DEBUG.
2466 (unwind_create_frame): New function (Bug#9943).
2467 (Fx_create_frame): Restructure code to be more similar to the one in
2468 xfns.c. Call record_unwind_protect with unwind_create_frame (Bug#9943).
2469 Initialize image_cache_refcount if GLYPH_DEBUG (Bug#9943).
2470 Move terminal->reference_count++ just before making the frame official
2471 (Bug#9943).
2472
2473 * nsterm.m (x_free_frame_resources): New function.
2474 (x_destroy_window): Move code to x_free_frame_resources.
2475
c9e7db78 2476 * xfns.c (unwind_create_frame): Fix comment.
6d5eb5b0
SM
2477 (Fx_create_frame, x_create_tip_frame):
2478 Move terminal->reference_count++ just before making the frame
75f1671a 2479 official. Move initialization of image_cache_refcount and
c9e7db78
JD
2480 dpyinfo_refcount before calling init_frame_faces (Bug#9943).
2481
a6fc3b5c
EZ
24822011-11-05 Eli Zaretskii <eliz@gnu.org>
2483
2484 Support MSVC build with newer versions of Visual Studio.
2485 * makefile.w32-in (TAGS-gmake): Don't use $(patsubst ...), as
2486 Nmake barfs on that. Use $(OBJ*_c) variables instead, defined on
2487 nt/gmake.defs.
2488
2489 * lisp.h (ENUM_BF): New macro, for enumerated types in bitfields,
2490 which are not supported by MSVC.
2491 (Lisp_Symbol, Lisp_Misc_Any, Lisp_Marker, Lisp_Misc_Overlay)
2492 (Lisp_Save_Value, Lisp_Free): Use ENUM_BF for enumerated types in
2493 bitfields.
2494 (Lisp_Object) [USE_LISP_UNION_TYPE]: Use ENUM_BF for enumerated
2495 types in bitfields.
2496 (DEFUN) [_MSC_VER]: Define in a different way for MSVC.
2497
2498 * w32fns.c [_MSC_VER]: DECLARE_HANDLE for any MSVC version.
2499
58179cce 25002011-11-05 Fabrice Popineau <fabrice.popineau@supelec.fr> (tiny change)
a6fc3b5c
EZ
2501
2502 Support MSVC build with newer versions of Visual Studio.
2503 * w32.c: Don't include w32api.h for MSVC.
2504 (init_environment) [_MSC_VER]: Call sys_access, not _access.
2505
2506 * s/ms-w32.h <sigset_t, ssize_t> [_MSC_VER]: Typedefs for MSVC.
2507 [_MSC_VER]: Include sys/timeb.h, sys/stat.h, and signal.h.
2508 (fstat, stat, utime) [_MSC_VER]: Redirect to their sys_* cousins.
2509 (malloc, free, realloc, calloc) [_MSC_VER]: Always redirect to the
2510 e_* cousins.
2511 (alloca) [_MSC_VER]: Define to _alloca.
2512
2513 * lisp.h (DECL_ALIGN) [_MSC_VER]: Define for MSVC.
2514
2515 * regex.c <re_char> [_MSC_VER]: A separate definition for MSVC.
2516
a58c13ed
EZ
25172011-11-04 Eli Zaretskii <eliz@gnu.org>
2518
2519 * xdisp.c (note_mouse_highlight): If either of
2520 previous/next-single-property-change returns nil, treat that as
2521 the beginning or the end of the buffer. (Bug#9955)
2522
fe0b6370
JD
25232011-11-04 Jan Djärv <jan.h.d@swipnet.se>
2524
a58c13ed 2525 * gtkutil.c (xg_make_tool_item): Add callbacks if one of wimage or
fe0b6370
JD
2526 label is not null (Bug#9951).
2527 (xg_tool_item_stale_p): Handle the fact that wimage and/or wlbl
2528 may be NULL.
2529
89bd5ee1
EZ
25302011-11-04 Eli Zaretskii <eliz@gnu.org>
2531
2532 * window.c (Fwindow_body_size): Mention in the doc string that the
2533 return value is in frame's canonical units. (Bug#9949)
2534
84c3edb9
EZ
25352011-11-03 Eli Zaretskii <eliz@gnu.org>
2536
4e2fb5c7
EZ
2537 * xdisp.c (note_mouse_highlight): Initialize `area'. (Bug#9947)
2538
84c3edb9 2539 * w32fns.c (unwind_create_frame): If needed, free the glyph
3ab15fd6 2540 matrices of the partially constructed frame. (Bug#9943)
2a58bbc1 2541 * xfns.c (unwind_create_frame): Likewise.
84c3edb9 2542
bc17a887
EZ
25432011-11-01 Eli Zaretskii <eliz@gnu.org>
2544
2545 * xdisp.c (mouse_face_from_buffer_pos): Fix a typo in a comment.
2546 Don't stop backward scan on the continuation glyph, even though
2547 its CHARPOS is positive.
6d5eb5b0
SM
2548 (mouse_face_from_buffer_pos, note_mouse_highlight):
2549 Rename cover_string to disp_string.
bc17a887 2550
4ee88440
MR
25512011-11-01 Martin Rudalics <rudalics@gmx.at>
2552
2553 * window.c (temp_output_buffer_show): Don't use
2554 Vtemp_buffer_show_specifiers.
2555 (Vtemp_buffer_show_specifiers): Remove unused variable.
2556
c2ff3c02
EZ
25572011-10-30 Eli Zaretskii <eliz@gnu.org>
2558
2559 * xdisp.c (try_cursor_movement): Make sure ROW isn't decremented
2560 past the beginning of the current glyph matrix.
2561
58179cce 25622011-10-30 Adam Sjøgren <asjo@koldfront.dk> (tiny change)
6e56383b
JD
2563
2564 * xterm.c: Include X11/Xproto.h if HAVE_GTK3.
2565 (x_error_handler): Ignore BadMatch for X_SetInputFocus for
2566 HAVE_GTK3 (Bug#9869).
b77a6a7f 2567
3b574623
JD
2568 * gtkutil.c (xg_win_to_widget, xg_event_is_for_menubar): Initialize
2569 type to GDK_NOTHING so valgrind does not complain (Bug#9901).
2570
b77a6a7f
JD
2571 * xterm.h (x_display_info): Add Xatom_net_wm_state_hidden (Bug#9893).
2572
2573 * xterm.c: Declare x_handle_net_wm_state to return int.
2574 (handle_one_xevent): Check if we are iconified but don't have
2575 _NET_WM_STATE_HIDDEN. If do, treat as deiconify (Bug#9893).
2576 (get_current_wm_state): Return non-zero if not hidden,
2577 check for _NET_WM_STATE_HIDDEN (Bug#9893).
2578 (do_ewmh_fullscreen): Ignore return value from get_current_wm_state.
2579 (x_handle_net_wm_state): Return what get_current_wm_state returns.
2580 (x_term_init): Initialize dpyinfo->Xatom_net_wm_state_hidden.
2581
196e41e4
PE
25822011-10-29 Paul Eggert <eggert@cs.ucla.edu>
2583
2584 * alloc.c (which_symbols): Declare EXTERNALLY_VISIBLE,
2585 so that this new function doesn't get optimized away by a
2586 whole-program optimizer. Make the 2nd arg EMACS_INT, not int.
2587
021f2e1a
AS
25882011-10-29 Andreas Schwab <schwab@linux-m68k.org>
2589
2590 * frame.h (MOUSE_HL_INFO): Remove excess parens.
2591
8b058d44
EZ
25922011-10-29 Eli Zaretskii <eliz@gnu.org>
2593
2594 Fix the `xbytecode' command.
2595 * .gdbinit (xprintbytestr): New command.
b50a28de 2596 (xwhichsymbols): Rename from `which'; all callers changed.
8b058d44
EZ
2597 (xbytecode): Print the byte-code string as well.
2598
4452fb80
EZ
25992011-10-29 Kim Storm <storm@cua.dk>
2600
8b058d44
EZ
2601 * alloc.c (which_symbols): New function.
2602
21b72067
AS
26032011-10-29 Andreas Schwab <schwab@linux-m68k.org>
2604
2605 * minibuf.c (read_minibuf_noninteractive): Allow reading empty
2606 line. (Bug#9903)
2607
83ed7b5c
GM
26082011-10-29 Glenn Morris <rgm@gnu.org>
2609
2610 * process.c (wait_reading_process_output): Revert 2009-08-30 change.
2611 Not clear what it was for, and it causes various bugs. (Bug#9839)
2612
5a7a728b
EZ
26132011-10-28 Eli Zaretskii <eliz@gnu.org>
2614
2615 * xdisp.c (note_mouse_highlight): Initialize `part', to avoid a
2616 possible random value that matches one of those tested as
2617 condition to clear the mouse face.
2618
d3d0842f
CY
26192011-10-28 Chong Yidong <cyd@gnu.org>
2620
2621 * xdisp.c (note_mouse_highlight): Fix use of uninitialized var.
2622
31b39d13
DN
26232011-10-28 Dan Nicolaescu <dann@ics.uci.edu>
2624
2625 * window.c (make_window): Initialize phys_cursor_on_p.
2626
9aba6043
SM
26272011-10-28 Stefan Monnier <monnier@iro.umontreal.ca>
2628
2629 * lisp.h (struct Lisp_Symbol): Update comments.
2630
c20992f4
JB
26312011-10-28 Juanma Barranquero <lekktu@gmail.com>
2632
2633 * w32font.c (w32_load_unicows_or_gdi32): Add missing return.
2634
db4f02f2
EZ
26352011-10-28 Eli Zaretskii <eliz@gnu.org>
2636
2637 Fix Emacs on Windows 9X (bug#8562). Thanks to oslsachem
2638 <oslsachem@gmail.com> for helping to debug this.
2639
2640 * w32font.c (g_b_init_is_w9x, g_b_init_get_outline_metrics_w)
2641 (g_b_init_get_text_metrics_w, g_b_init_get_glyph_outline_w)
2642 (g_b_init_get_glyph_outline_w): New static variables.
2643 (GetOutlineTextMetricsW_Proc, GetTextMetricsW_Proc)
2644 (GetGlyphOutlineW_Proc): New typedefs.
2645 (w32_load_unicows_or_gdi32, get_outline_metrics_w)
9aba6043
SM
2646 (get_text_metrics_w, get_glyph_outline_w, globals_of_w32font):
2647 New functions.
2648 (w32font_open_internal, compute_metrics):
2649 Call get_outline_metrics_w, get_text_metrics_w, and get_glyph_outline_w
db4f02f2
EZ
2650 instead of calling the "wide" APIs directly.
2651
2652 * emacs.c (main) [HAVE_NTGUI]: Call globals_of_w32font.
2653
2654 * w32.h (syms_of_w32font): Add prototype.
2655
87e68db4
JB
26562011-10-27 Juanma Barranquero <lekktu@gmail.com>
2657
2658 * window.c (Fframe_root_window, Fframe_first_window, Fwindow_end)
2659 (Fframe_selected_window, Ftemp_output_buffer_show, Fnext_window)
2660 (Fdelete_window_internal, Fwindow_parameters): Fix typos in docstrings.
2661 (Fmove_to_window_line): Doc fix.
2662
435c1d67
CY
26632011-10-27 Chong Yidong <cyd@gnu.org>
2664
2665 * process.c (make_process): Set gnutls_state to NULL.
2666
2667 * gnutls.c (emacs_gnutls_deinit): Deinit the gnutls_state if it is
2668 non-NULL, regardless of GNUTLS_INITSTAGE.
2669 (Fgnutls_boot): Cleanups. Call emacs_gnutls_deinit if we signal
2670 an error. Set process slots as soon as we allocate them.
2671
2672 * gnutls.h (GNUTLS_LOG, GNUTLS_LOG2): Fix macros.
2673
9c6c6f49
CY
26742011-10-27 Chong Yidong <cyd@gnu.org>
2675
9aba6043
SM
2676 * gnutls.c (emacs_gnutls_deinit): New function.
2677 Deallocate credentials structures as well as calling gnutls_deinit.
9c6c6f49
CY
2678 (Fgnutls_deinit, Fgnutls_boot): Use it.
2679
2680 * process.c (make_process): Initialize GnuTLS credentials to NULL.
2681 (deactivate_process): Call emacs_gnutls_deinit.
2682
657d08d3
JB
26832011-10-27 Juanma Barranquero <lekktu@gmail.com>
2684
2685 * image.c (x_create_x_image_and_pixmap):
2686 * w32.c (sys_rename, w32_delayed_load):
2687 * w32font.c (fill_in_logfont):
2688 * w32reg.c (x_get_string_resource): Silence compiler warnings.
2689
5430d399
JB
26902011-10-26 Juanma Barranquero <lekktu@gmail.com>
2691
2692 * w32fns.c (w32_default_color_map): New function,
2693 extracted from Fw32_default_color_map.
a7ef684b 2694 (Fw32_default_color_map, Fx_open_connection): Use it. (Bug#9785)
5430d399 2695
fe0055fa
PE
26962011-10-25 Paul Eggert <eggert@cs.ucla.edu>
2697
2698 * dispextern.h (Fcontrolling_tty_p): New decl (Bug#6649 part 2).
2699
e6346438
SM
27002011-10-25 Stefan Monnier <monnier@iro.umontreal.ca>
2701
2702 * keyboard.c (test_undefined): New function (bug#9751).
2703 (read_key_sequence): Use it to detect when a key is bound to `undefined'.
2704
e112cc37
ET
27052011-10-25 Enami Tsugutomo <tsugutomo.enami@jp.sony.com>
2706
2707 * sysdep.c (init_sys_modes): Fix the check for the controlling
2708 terminal (Bug#6649).
2709
7b5d6677
EZ
27102011-10-20 Eli Zaretskii <eliz@gnu.org>
2711
2712 * dispextern.h (struct bidi_it): New member next_en_type.
2713
2714 * bidi.c (bidi_line_init): Initialize the next_en_type member.
2715 (bidi_resolve_explicit_1): When next_en_pos is valid for the
2716 current character, check also for next_en_type being WEAK_EN.
2717 (bidi_resolve_weak): Don't enter the expensive loop if the current
2718 position is before next_en_pos. Record the bidi type of the first
2719 non-ET, non-BN character we find, in addition to its position.
2720 (bidi_level_of_next_char): Invalidate next_en_type when
2721 next_en_pos is over-stepped.
2722
7da0b018
PE
27232011-10-20 Paul Eggert <eggert@cs.ucla.edu>
2724
2725 Time zone name fixes for non-ASCII locales (Bug#641, Bug#9794)
2726 * editfns.c: Rewrite current-time-zone so that it invokes
2727 the equivalent of (format-time-string "%Z") to get the time zone name.
2728 This fixes a bug when the time zone name contains characters that
2729 need converting from the system time locale to Emacs internal format.
2730 This fixes a shortcoming that I introduced in my 1999-10-19 patch:
2731 that patch fixed format-time-string to do the conversion, but
2732 I forgot to fix current-time-zone.
2733 (format_time_string): New function, containing most of
2734 what Fformat_time_string used to contain.
2735 (Fformat_time_string): Rewrite in terms of format_time_string.
2736 This doesn't change this function's behavior.
2737 (current-time-zone): Rewrite to use format_time_string.
2738 This fixes the bug reported by Michael Schierl in
2739 <http://lists.gnu.org/archive/html/emacs-devel/2007-06/msg00334.html>.
2740 Jason Rumney's 2007-06-07 change worked around this bug, but
2741 didn't fix it.
2742 * systime.h (tzname, timezone): Remove no-longer-used declarations.
2743
8547b010
EZ
27442011-10-19 Eli Zaretskii <eliz@gnu.org>
2745
2746 * xdisp.c (start_display): If the character at POS is displayed
2747 via a display vector, reset IT->current.dpvec_index to zero.
12b32963
EZ
2748 (try_window_reusing_current_matrix): If a line ends in a display
2749 vector or the next line starts in a display vector, continue
2750 redrawing the window even though the character position of
2751 start_row was reached.
8547b010
EZ
2752 (Bug#9771, part 2)
2753
4e948d15
CY
27542011-10-18 Chong Yidong <cyd@gnu.org>
2755
2756 * xdisp.c (get_next_display_element): Handle U+2010 and U+2011
2757 with nobreak-char-display too.
2758
4787455f
EZ
27592011-10-18 Eli Zaretskii <eliz@gnu.org>
2760
2761 Fix part 3 of bug#9771.
2762 * bidi.c (bidi_line_init): Initialize next_en_pos to zero, not -1.
2763 (bidi_resolve_neutral): Don't enter the expensive loop looking for
2764 non-neutral characters if the current character is a paragraph
2765 separator (a.k.a. Newline). This avoids running the same
2766 expensive loop twice, once when we consume the preceding newline
2767 and the other time when the line actually needs to be displayed.
2768 Avoid the loop when we see neutrals on the base embedding level
2769 following a character whose directionality is the same as the
2770 paragraph's. This avoids running the expensive loop when a line
2771 ends in a long sequence of neutrals, like control characters.
2772 Add assertion against STRONG_AL type. Slightly rearrange code
2773 that determines the type of a neutral given the first non-neutral
2774 that follows it.
2775 (bidi_level_of_next_char): Set next_en_pos to zero when
2776 invalidating its info.
2777
2c91f553
EZ
27782011-10-17 Eli Zaretskii <eliz@gnu.org>
2779
2780 * xdisp.c (push_display_prop): Determine whether to record string
2781 or buffer position by IT->string, not by IT->method. Allow
2782 GET_FROM_DISPLAY_VECTOR as IT->method on entry. (Bug#9771, part 4)
f2ff9e88
EZ
2783 (move_it_vertically_backward): Don't look for character position
2784 immediately after the newline when in a continuation line.
2785 (Bug#9771, part 1)
2c91f553 2786
c7b08b0d
MR
27872011-10-15 Martin Rudalics <rudalics@gmx.at>
2788
2789 * window.c (coordinates_in_window): Rewrite and delabelize
2790 vertical border check. (Bug#5357) (Bug#9618)
2791
6b02f655
SM
27922011-10-14 Stefan Monnier <monnier@iro.umontreal.ca>
2793
2794 * xterm.c (frame_highlight, frame_unhighlight): Ignore unexplained
2795 errors in XSetWindowBorder (bug#9310).
2796
81d40c92
DA
27972011-10-13 Dmitry Antipov <dmantipov@yandex.ru>
2798
2799 * editfns.c (Fset_time_zone_rule): Replace free with xfree to
2800 avoid crash when xmalloc overrun checking is enabled.
2801
d4172c3b
EZ
28022011-10-13 Eli Zaretskii <eliz@gnu.org>
2803
2804 * xdisp.c (Fcurrent_bidi_paragraph_direction): Initialize
2805 itb.paragraph_dir to NEUTRAL_DIR. Fixes an occasional incorrect
2806 cursor motion with <left> and <right> arrow keys.
2807
2808 * bidi.c (bidi_init_it): Don't initialize paragraph_dir here, as
2809 some callers set that themselves.
2810
b00eea75
EZ
28112011-10-12 Eli Zaretskii <eliz@gnu.org>
2812
2813 * xdisp.c (find_row_edges): Handle the case where ROW comes from a
2814 display string and the previous row comes from the same string and
2815 is empty. (Bug#9739) (Bug#9738)
2816
8fe012c4
SM
28172011-10-12 Stefan Monnier <monnier@iro.umontreal.ca>
2818
2819 * doc.c (get_doc_string): Encode file name (bug#9735).
2820
0074aef2
EZ
28212011-10-12 Eli Zaretskii <eliz@gnu.org>
2822
79beb178
EZ
2823 * bidi.c (bidi_level_of_next_char):
2824 * xdisp.c (get_visually_first_element): Remove old incorrect
2825 comments regarding the Unicode Line Separator character.
2826
0074aef2
EZ
2827 * bidi.c (bidi_init_it): Initialize paragraph_dir to NEUTRAL_DIR.
2828
6e4b3fbe
DA
28292011-10-12 Dmitry Antipov <dmantipov@yandex.ru>
2830
2831 * alloc.c (Fgc_status): Do not access beyond zombies array
2832 boundary if nzombies > MAX_ZOMBIES.
2833 * alloc.c (dump_zombies): Add missing format specifier.
2834
0324f3af
PE
28352011-10-12 Paul Eggert <eggert@cs.ucla.edu>
2836
b5525cac
PE
2837 * xdisp.c (set_cursor_from_row): Simplify conditionals,
2838 to pacify GCC 4.6.1 x86-64 with -O2 -Wstrict-overflow.
2839
0324f3af
PE
2840 * lread.c (read_escape): Allow hex escapes as large as ?\xfffffff.
2841 Some packages use them to denote characters with modifiers.
2842
e9b5f888
AS
28432011-10-11 Andreas Schwab <schwab@linux-m68k.org>
2844
2845 * lisp.h (GCPRO1_VAR, GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR)
2846 (GCPRO5_VAR, GCPRO6_VAR, UNGCPRO_VAR): Add whitespace to avoid
2847 matching a pp-number. Rename parameter var to var1.
2848
127827c0
SM
28492011-10-11 Stefan Monnier <monnier@iro.umontreal.ca>
2850
2851 * minibuf.c (Finternal_complete_buffer): Fix last change (bug#9709).
2852
c8fd3bd0
GM
28532011-10-08 Glenn Morris <rgm@gnu.org>
2854
2855 * callint.c (Fcall_interactively): Give a more explicit error for the
2856 'c' case with a non-character input. (Bug#8479)
2857
352ec8ff
EZ
28582011-10-08 Eli Zaretskii <eliz@gnu.org>
2859
03669ccb
EZ
2860 * xdisp.c (hscroll_window_tree): Support hscroll in right-to-left
2861 lines.
7061c986
EZ
2862 (set_cursor_from_row): Fix cursor positioning in mixed L2R+R2L
2863 lines that are hscrolled on the left.
03669ccb 2864
352ec8ff
EZ
2865 * dispnew.c (buffer_posn_from_coords): Account for a possible
2866 presence of header-line. (Bug#4426)
2867
a66cfb1c
SM
28682011-10-07 Stefan Monnier <monnier@iro.umontreal.ca>
2869
6b02f655
SM
2870 * buffer.c (syms_of_buffer) <enable-multibyte-characters>:
2871 Don't advertise functionality which we discourage or doesn't work.
a66cfb1c 2872
7c5ee88e
PE
28732011-10-07 Paul Eggert <eggert@cs.ucla.edu>
2874
2875 * alloc.c (GC_LISP_OBJECT_ALIGNMENT): Use offsetof, not __alignof__
2876 or sizeof. __alignof__ gives the wrong answer on Fedora x86-64
2877 with GCC 4.6.1 when configured with CC='gcc -m32' --with-wide-int;
2878 this makes Emacs dump core during garbage collection on rare
2879 occasions. sizeof is obviously inferior to offsetof here, so
2880 stick with offsetof.
2881 (GC_POINTER_ALIGNMENT): New macro.
2882 (mark_memory): Omit 3rd (offset) arg; caller changed.
2883 Don't assume EMACS_INT alignment is the same as pointer alignment.
2884
df1bbe5b
SM
28852011-10-03 Stefan Monnier <monnier@iro.umontreal.ca>
2886
2887 * keyboard.c (read_key_sequence_remapped): New var.
2888 (read_key_sequence): Compute remapping in the right buffer.
2889 (command_loop_1): Use read_key_sequence's remapping directly.
2890
51553db6
SM
28912011-10-02 Stefan Monnier <monnier@iro.umontreal.ca>
2892
32c1fffd
SM
2893 * dired.c (file_name_completion): Don't expand file name.
2894 (Ffile_name_completion, Ffile_name_all_completions): Expand file name
2895 before checking file name handler.
2896
51553db6
SM
2897 * minibuf.c (Finternal_complete_buffer): Only show internal buffers if
2898 they've been requested explicitly (bug#9591).
2899
b6bd1599 29002011-10-01 Andreas Schwab <schwab@linux-m68k.org>
fa2ec41f
AS
2901
2902 * keymap.c (Fsingle_key_description): Use make_specified_string
2903 instead of build_string to build string from push_key_description.
2904 (Bug#5193)
2905
f701dc2a
PE
29062011-09-30 Paul Eggert <eggert@cs.ucla.edu>
2907
4222c55d
PE
2908 * buffer.h (struct buffer): Use time_t, not int, for a time stamp.
2909 This fixes a Y2038 bug on 64-bit hosts.
2910 * buffer.c (reset_buffer):
2911 * fileio.c (Fdo_auto_save, Fset_buffer_auto_saved)
2912 (Fclear_buffer_auto_save_failure):
2913 Use 0, not -1, to represent an unset failure time, since time_t
2914 might not be signed.
2915
f701dc2a
PE
2916 Remove dependency on glibc malloc internals.
2917 * alloc.c (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
2918 Move back here from lisp.h, but with their new implementations.
2919 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
2920 (XMALLOC_OVERRUN_SIZE_SIZE): Move these new lisp.h macros here.
2921 * charset.c (charset_table_init): New static var.
2922 (syms_of_charset): Use it instead of xmalloc. This removes a
2923 dependency on glibc malloc internals. See Eli Zaretskii's comment in
2924 <http://lists.gnu.org/archive/html/emacs-devel/2011-09/msg00815.html>.
2925 * lisp.h (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
2926 Move back to alloc.c.
2927 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
2928 (XMALLOC_OVERRUN_SIZE_SIZE): Move to alloc.c.
2929
9ceebf39
JD
29302011-09-30 Jan Djärv <jan.h.d@swipnet.se>
2931
2932 * nsterm.m (windowDidResize): Call x_set_window_size only when
2933 ns_in_resize is true. Otherwise set pixelwidth/height and
2934 call change_frame_size (Bug#9628).
2935
cb993c58
PE
29362011-09-30 Paul Eggert <eggert@cs.ucla.edu>
2937
3930c88b
PE
2938 Port --enable-checking=all to Fedora 14 x86-64.
2939 * charset.c (syms_of_charset): Also account for glibc malloc's
2940 internal overhead when calculating the initial malloc maximum.
2941
cb993c58
PE
2942 Port --enable-checking=all to Fedora 14 x86.
2943 * alloc.c (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
2944 Move to lisp.h.
2945 (xmalloc_put_size, xmalloc_get_size, overrun_check_malloc)
2946 (overrun_check_realloc, overrun_check_free):
2947 Use XMALLOC_OVERRUN_SIZE_SIZE, not sizeof (size_t).
2948 That way, xmalloc returns a properly-aligned pointer even if
2949 XMALLOC_OVERRUN_CHECK is defined. The old debugging code happened
2950 to align OK on typical 64-bit hosts, but not on Fedora 14 x86.
2951 * charset.c (syms_of_charset): Take XMALLOC_OVERRUN_CHECK_OVERHEAD
2952 into account when calculating the initial malloc maximum.
2953 * lisp.h (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
2954 Move here from alloc.c, so that charset.c can use it too.
2955 Properly align; the old code wasn't right for common 32-bit hosts
2956 when configured with --enable-checking=all.
2957 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
2958 (XMALLOC_OVERRUN_SIZE_SIZE): New macros.
2959
31bed486
EZ
29602011-09-29 Eli Zaretskii <eliz@gnu.org>
2961
04c70788 2962 * sysdep.c (snprintf) [!EOVERFLOW]: If EOVERFLOW is not defined,
31bed486
EZ
2963 use EDOM.
2964
fbcaa2f3
EZ
29652011-09-28 Eli Zaretskii <eliz@gnu.org>
2966
2967 * xdisp.c (compute_display_string_end): If there's no display
2968 string at CHARPOS, return -1.
2969
2970 * bidi.c (bidi_fetch_char): When compute_display_string_end
2971 returns a negative value, treat the character as a normal
2972 character not covered by a display string. (Bug#9624)
2973
a239d4e9
JB
29742011-09-28 Juanma Barranquero <lekktu@gmail.com>
2975
2976 * lread.c (Fread_from_string): Fix typo in docstring.
2977
88652fd5
EZ
29782011-09-27 Eli Zaretskii <eliz@gnu.org>
2979
2980 * xdisp.c (handle_invisible_prop): If invisible text ends on a
2981 newline, reseat the iterator instead of bidi-iterating there one
2982 character at a time. (Bug#9610)
32c1fffd
SM
2983 (BUFFER_POS_REACHED_P, move_it_in_display_line_to): Bail when past
2984 TO_CHARPOS if the bidi iterator is at base embedding level.
88652fd5 2985
ed497dd4
AS
29862011-09-27 Andreas Schwab <schwab@linux-m68k.org>
2987
2988 * lread.c (readevalloop): Use correct code for NBSP.
2989 (read1): Likewise. (Bug#9608)
2990
b2bf61aa
MA
29912011-09-25 Michael Albinus <michael.albinus@gmx.de>
2992
2993 * dbusbind.c (Fdbus_register_signal): When service is not
2994 registered, use nil in Vdbus_registered_objects_table. (Bug#9581)
2995
32bbb17c
GM
29962011-09-25 Glenn Morris <rgm@gnu.org>
2997
2998 * buffer.c (truncate-lines): Doc fix.
2999
94e0933e
CY
30002011-09-24 Chong Yidong <cyd@stupidchicken.com>
3001
3002 * window.c (Fwindow_prev_buffers, Fset_window_prev_buffers)
3003 (Fset_window_next_buffers): Doc fix.
3004
cddde921
GM
30052011-09-24 Glenn Morris <rgm@gnu.org>
3006
3007 * minibuf.c (read_minibuf): Disable line truncation. (Bug#5715)
3008
1260aef1
PE
30092011-09-24 Paul Eggert <eggert@cs.ucla.edu>
3010
25b4bfa0
PE
3011 Fix minor problems found by static checking.
3012 * xdisp.c (string_from_display_spec): Don't assume vecsize fits in int.
1260aef1
PE
3013 * indent.c (Fvertical_motion): Fix == vs = typo.
3014
e3cbd34b
EZ
30152011-09-24 Eli Zaretskii <eliz@gnu.org>
3016
a66cfb1c
SM
3017 * dispnew.c (syms_of_display) <redisplay-dont-pause>:
3018 Default value is now t. Doc fix.
6bf7006f 3019
e3cbd34b 3020 * indent.c (Fvertical_motion): Compute and apply the overshoot
32c1fffd 3021 logic when moving up, not only when moving down. Fix the
e3cbd34b 3022 confusing name and values of the it_overshoot_expected variable;
32c1fffd 3023 logic changes accordingly. (Bug#9254) (Bug#9549)
e3cbd34b
EZ
3024
3025 * xdisp.c (pos_visible_p): Produce correct pixel coordinates when
3026 CHARPOS is covered by a display string which includes newlines.
3027 (move_it_vertically_backward): Avoid inflooping when START_CHARPOS
3028 is covered by a display string with embedded newlines.
3029
a3de0cbd
MA
30302011-09-24 Michael Albinus <michael.albinus@gmx.de>
3031
3032 * dbusbind.c (Fdbus_register_signal): Add match rule to
3033 Vdbus_registered_objects_table. (Bug#9581)
a66cfb1c
SM
3034 (Fdbus_register_method, Vdbus_registered_objects_table):
3035 Fix docstring.
a3de0cbd 3036
b260039d
JM
30372011-09-24 Jim Meyering <meyering@redhat.com>
3038
32c1fffd 3039 do not ignore write error for any output size
b260039d
JM
3040 The previous change was incomplete.
3041 While it makes emacs --batch detect the vast majority of stdout
3042 write failures, errors were still ignored whenever the output size is
3043 k * (BUFSIZ+1) - 4. E.g., on a system with BUFSIZ of 4096,
3044 $ emacs --batch --eval '(print (format "%4093d" 0))' > /dev/full \
3045 && echo FAIL: ignored write error
3046 FAIL: ignored write error
3047 $ emacs --batch --eval '(print (format "%20481d" 0))' > /dev/full \
3048 && echo FAIL: ignored write error
3049 FAIL: ignored write error
3050 * emacs.c (Fkill_emacs): Also test ferror. (Bug#9574)
3051
8eca8a7c
AS
30522011-09-23 Andreas Schwab <schwab@linux-m68k.org>
3053
3054 * emacs.c (Fkill_emacs): In noninteractive mode exit
3055 non-successfully if a write error occurred on stdout. (Bug#9574)
3056
3341db62
EZ
30572011-09-21 Eli Zaretskii <eliz@gnu.org>
3058
3059 * xdisp.c (pop_it): Allow it->object that is a cons cell to pass
3060 the xassert test.
3061
3062 * dispextern.h (struct it): Update the comment documenting what
3063 can it->OBJECT be.
3064
8c203dbf
EZ
30652011-09-20 Eli Zaretskii <eliz@gnu.org>
3066
3067 * xdisp.c (set_cursor_from_row): If the row ends in a newline from
3068 a display string, extend search for cursor position to end of row.
3069 (find_row_edges): If the row ends in a newline from a display
3070 string, increment its MATRIX_ROW_END_CHARPOS by one. (Bug#9549)
3071 Handle the case of a display string with multiple newlines.
fd317ddf
EZ
3072 (Fcurrent_bidi_paragraph_direction): Fix search for previous
3073 non-empty line. Fixes confusing cursor motion with arrow keys at
3074 the beginning of a line that starts with whitespace.
8c203dbf 3075
a4824228
LMI
30762011-09-19 Lars Magne Ingebrigtsen <larsi@gnus.org>
3077
3078 * lread.c (Fread_from_string): Document what FINAL-STRING-INDEX is
3079 (bug#9493).
3080
33ed493b
CY
30812011-09-18 Chong Yidong <cyd@stupidchicken.com>
3082
3083 * xfns.c (Fx_create_frame): Handle the bitmapIcon resource as
3084 boolean (Bug#9154).
3085
56cd55c8
EZ
30862011-09-18 Eli Zaretskii <eliz@gnu.org>
3087
3088 * xdisp.c (display_line): Record maximum and minimum buffer
3089 positions even if no glyphs were produced (e.g., by a zero-width
3090 stretch). Fixes bug#9530 on a TTY. Under word-wrap, don't record
3091 buffer positions that will be removed from the glyph row because
3092 they don't fit.
c02dcedf
EZ
3093 (produce_stretch_glyph): Fix a bug in :align-to on a TTY when the
3094 column is beyond frame width: don't subtract 1 "pixel" when
3095 computing width of the stretch.
3e62b7e0
EZ
3096 (reseat_at_next_visible_line_start): Undo the change made on
3097 2011-09-17 that saved paragraph information and restored it after
3098 the call to `reseat'. (Bug#9545)
56cd55c8 3099
5ed99d36 31002011-09-18 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
3390454c
YM
3101
3102 * xdisp.c (expose_window): Save original value of phys_cursor_on_p
3103 and turn window cursor on if cleared (Bug#9415).
3104
5ed99d36 31052011-09-18 Andreas Schwab <schwab@linux-m68k.org>
edb7b4dc
AS
3106
3107 * search.c (boyer_moore): Take unibyte characters from pattern
3108 literally. (Bug#9458)
3109
9bade7b2
EZ
31102011-09-18 Eli Zaretskii <eliz@gnu.org>
3111
3112 * xdisp.c (reseat_at_next_visible_line_start): Fix last change.
3113
e5e9d610
PE
31142011-09-18 Paul Eggert <eggert@cs.ucla.edu>
3115
87e4427a
PE
3116 Fix minor problem found by static checking.
3117 * xdisp.c (reseat_at_next_visible_line_start): Mark locals as
3118 initialized, to pacify gcc -Wuninitialized.
3119
e5e9d610
PE
3120 * fileio.c: Report proper errno when syscall falls.
3121 (Finsert_file_contents): Save and restore errno,
3122 so that report_file_error outputs the correct diagnostic.
3123 (Fwrite_region) [CLASH_DETECTION]: Likewise.
3124
a1674f0b
EZ
31252011-09-18 Eli Zaretskii <eliz@gnu.org>
3126
3127 * .gdbinit (pgx): Fix references to fields of `struct glyph'.
3128
fbfb6dd4
EZ
31292011-09-17 Eli Zaretskii <eliz@gnu.org>
3130
3131 * xdisp.c (produce_stretch_glyph): Another fix for changes made on
3132 2011-08-30T17:32:44Z!eliz@gnu.org. (Bug#9530)
3133
bb187662
EZ
31342011-09-17 Eli Zaretskii <eliz@gnu.org>
3135
1137e8b8 3136 * xdisp.c (reseat_at_next_visible_line_start): Keep information
6b02f655 3137 about the current paragraph and restore it after the call to reseat.
1137e8b8
EZ
3138
3139 * bidi.c (MAX_PARAGRAPH_SEARCH): New macro.
3140 (bidi_find_paragraph_start): Search back for paragraph beginning
3141 at most MAX_PARAGRAPH_SEARCH lines; if not found, return BEGV_BYTE.
3142 (bidi_move_to_visually_next): Only trigger paragraph-related
3143 computations when the last character is a newline or at EOB, not
3144 just any NEUTRAL_B. (Bug#9470)
3145
bb187662
EZ
3146 * xdisp.c (set_cursor_from_row): Don't invoke special treatment of
3147 truncated lines if point is covered by a display string. (Bug#9524)
3148
2e621251
PE
31492011-09-16 Paul Eggert <eggert@cs.ucla.edu>
3150
3151 * xselect.c: Relax test for outgoing X longs (Bug#9498).
3152 (cons_to_x_long): New function.
3153 (lisp_data_to_selection_data): Use it. Correct the test for
3154 short-versus-long data; it was negated. Break out of vector
3155 loop, for efficiency, when a long datum is discovered.
3156
91a15bc6
SM
31572011-09-16 Stefan Monnier <monnier@iro.umontreal.ca>
3158
3159 * eval.c (Fquote): Document its non-consing behavior (bug#9482).
3160
b41c3a35
EZ
31612011-09-16 Eli Zaretskii <eliz@gnu.org>
3162
3163 * image.c (tiff_handler): Work around a bug in MinGW GCC 3.x (see
3164 GCC PR/17406) by declaring this function with external scope.
3165
7812ba2d
PE
31662011-09-15 Paul Eggert <eggert@cs.ucla.edu>
3167
3168 * editfns.c (Fformat): Fix bug in text-property fix (Bug#9514).
3169 Don't mishandle (length (format "%%")) and (format "%4000s%%" "").
3170
cf7edc2a
AS
31712011-09-15 Andreas Schwab <schwab@linux-m68k.org>
3172
3173 * editfns.c (Fformat): Correctly handle text properties on "%%".
3174
bd01620e
EZ
31752011-09-15 Eli Zaretskii <eliz@gnu.org>
3176
3177 * xterm.c (x_draw_composite_glyph_string_foreground):
3178 * w32term.c (x_draw_composite_glyph_string_foreground):
3179 * term.c (encode_terminal_code):
3180 * composite.c (composition_update_it, get_composition_id):
3181 * xdisp.c (get_next_display_element)
3182 (fill_composite_glyph_string): Add comments about special meaning
3183 of TAB characters in a composition.
3184
a02719a3
PE
31852011-09-15 Paul Eggert <eggert@cs.ucla.edu>
3186
3187 * editfns.c (Fformat): Fix off-by-1 bug for "%%b" (Bug#9514).
4c122725
PE
3188 This occurs when processing a multibyte format.
3189 Problem reported by Wolfgang Jenker.
a02719a3 3190
72589a3c
JB
31912011-09-15 Johan Bockgård <bojohan@gnu.org>
3192
3193 * xdisp.c (try_cursor_movement): Only check for exact match if
3194 cursor hpos found by set_cursor_from_row is valid. (Bug#9495)
3195
1c14176c
PE
31962011-09-14 Paul Eggert <eggert@cs.ucla.edu>
3197
3198 Remove unused external symbols.
3199 * dispextern.h (calc_pixel_width_or_height): Remove decl.
3200 * xdisp.c (calc_pixel_width_or_height): Now static.
3201 * doprnt.c (exprintf) [! (HAVE_X_WINDOWS && USE_X_TOOLKIT)]: Remove.
3202 * indent.c (check_display_width):
3203 * w32term.c: Fix comment to match code.
3204 * xterm.c, xterm.h (x_catching_errors): Remove.
3205
d2eea5b5
PE
32062011-09-14 Paul Eggert <eggert@cs.ucla.edu>
3207
3208 * xselect.c: Use signed conversions more consistently (Bug#9498).
3209 (selection_data_to_lisp_data): Assume incoming selection data are
3210 signed integers, not unsigned. This is to be consistent with
3211 outgoing selection data, which was modified to use signed integers
3212 in as part of the fix to Bug#9196 in response to Jan D.'s comment
3213 in <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9196#32> that X11
3214 expects long, not unsigned long.
3215
46888499
EZ
32162011-09-14 Eli Zaretskii <eliz@gnu.org>
3217
3218 * xdisp.c (try_window_reusing_current_matrix): Fix incorrect
3219 computation of loop end. Reported by Johan Bockgård
3220 <bojohan@gnu.org>.
3221
ef8ef9fb
CY
32222011-09-13 Chong Yidong <cyd@stupidchicken.com>
3223
3224 * frame.c (Fother_visible_frames_p): Function deleted.
3225
fa819fed
EZ
32262011-09-12 Eli Zaretskii <eliz@gnu.org>
3227
3228 * indent.c (compute_motion): Process display vector front to back
3229 rather than the other way around. (Bug#2496)
3230
2ba8e008
SM
32312011-09-12 Stefan Monnier <monnier@iro.umontreal.ca>
3232
3233 * fileio.c (Finsert_file_contents): Don't assume beg_offset is 0.
3234
20f53c69
CY
32352011-09-11 Chong Yidong <cyd@stupidchicken.com>
3236
3237 * minibuf.c (Fread_from_minibuffer): Doc fix.
3238
d562d7a4
EZ
32392011-09-11 Eli Zaretskii <eliz@gnu.org>
3240
3241 * xdisp.c (produce_stretch_glyph): Fix a typo made in changes from
3242 2011-08-30T17:32:44Z!eliz@gnu.org. (Bug#9475)
3243
1c4d7f3d
LMI
32442011-09-11 Lars Magne Ingebrigtsen <larsi@gnus.org>
3245
3246 * fileio.c (Fvisited_file_modtime): Document `(-1 65535)' as a
3247 value for non-existent files.
3248
b885bf36
EZ
32492011-09-11 Eli Zaretskii <eliz@gnu.org>
3250
3251 * fileio.c (Finsert_file_contents): If the file cannot be opened,
3252 set its "size" to -1. This will set the modtime_size field of
3253 the corresponding buffer to -1, which is what
3254 verify-visited-file-modtime expects for files that do not exist.
3255 (Bug#9139)
3256
6612f0bf
PE
32572011-09-11 Paul Eggert <eggert@cs.ucla.edu>
3258
3259 * keymap.h (KEY_DESCRIPTION_SIZE, push_key_description): Move decls
3260 here ...
3261 * lisp.h: ... from here. push_key_description is no longer
3262 defined in keyboard.c, so its declaration should not be in
3263 lisp.h's "Defined in keyboard.c" section, and KEY_DESCRIPTION_SIZE
3264 logically belongs with push_key_description.
3265
dfb3f755
PE
32662011-09-10 Paul Eggert <eggert@cs.ucla.edu>
3267
3268 * buffer.h: Include <sys/types.h> instead of <time.h>.
3269 Otherwise, off_t wasn't defined on FreeBSD 9.0-BETA2 i386.
3270 Problem reported by Herbert J. Skuhra.
3271
3134906c
LMI
32722011-09-10 Lars Magne Ingebrigtsen <larsi@gnus.org>
3273
3274 * xml.c (parse_region): Make the parsing work for
3275 non-comment-starting XML files again (bug#9144).
3276
8d903f4e
AS
32772011-09-10 Andreas Schwab <schwab@linux-m68k.org>
3278
3279 * image.c (gif_load): Fix calculation of bottom and right corner.
3280 (Bug#9468)
3281
80ad64f4
EZ
32822011-09-10 Eli Zaretskii <eliz@gnu.org>
3283
3284 * xdisp.c (MAX_DISP_SCAN): Decrease to 250. Prevents sluggish
3285 redisplay in small windows.
3286
208a048d
EZ
32872011-09-09 Eli Zaretskii <eliz@gnu.org>
3288
3289 * frame.c (x_report_frame_params): Cast to avoid compiler warnings.
3290
9b1c252e
MR
32912011-09-08 Martin Rudalics <rudalics@gmx.at>
3292
3293 * window.c (Fset_window_prev_buffers, Fset_window_next_buffers):
3294 Operate on live windows only.
3295
2949f33b
JB
32962011-09-08 Juanma Barranquero <lekktu@gmail.com>
3297
3298 * emacs.c (my_heap_start): #ifdef to avoid warnings when unused.
3299
e08dcafd
EZ
33002011-09-07 Eli Zaretskii <eliz@gnu.org>
3301
3302 * xdisp.c (move_it_in_display_line_to): Call RESTORE_IT on ppos_it
3303 only under bidi iteration.
3304
115b96bd
JD
33052011-09-07 Jan Djärv <jan.h.d@swipnet.se>
3306
3307 * gtkutil.c (xg_make_tool_item): Insert comment about eventbox.
3308
c8199d0f
PE
33092011-09-06 Paul Eggert <eggert@cs.ucla.edu>
3310
3311 isnan: Fix porting problem to Solaris 10 with bundled gcc.
3312 Without this fix, the command to link temacs failed due to an
3313 undefined symbol __builtin_isnan. This is because
3314 /usr/include/iso/math_c99.h #defines isnan(x) to
3315 __builtin_isnan(x), but the bundled gcc, which identifies itself
3316 as gcc 3.4.3 (csl-sol210-3_4-branch+sol_rpath), does not have
3317 a __builtin_isnan.
3318 * floatfns.c (isnan): #undef, and then #define to a clone of
3319 what's in data.c.
3320 (Fisnan): Always define, since it's always available now.
3321 (syms_of_floatfns): Always define isnan at the Lisp level.
3322
e39b275c 33232011-09-06 Paul Eggert <eggert@cs.ucla.edu>
1c262cae
PE
3324
3325 * Makefile.in (gl-stamp): move-if-change now in build-aux (Bug#9169).
3326
b2db44d9 33272011-09-06 Paul Eggert <eggert@cs.ucla.edu>
728f8f0a 3328
f4af5137 3329 * fileio.c: Fix bugs with large file offsets (Bug#9428).
728f8f0a
PE
3330 The previous code assumed that file offsets (off_t values) fit in
3331 EMACS_INT variables, which is not true on typical 32-bit hosts.
3332 The code messed up by falsely reporting buffer overflow in cases
3333 such as (insert-file-contents "big" nil 1 2) into an empty buffer
3334 when "big" contains more than 2**29 bytes, even though this
3335 inserts just one byte and does not overflow the buffer.
3336 (Finsert_file_contents): Store file offsets as off_t
3337 values, not as EMACS_INT values. Check for overflow when
3338 converting between EMACS_INT and off_t. When checking for
3339 buffer overflow or for overlap, take the offsets into account.
3340 Don't use EMACS_INT for small values where int suffices.
3341 When checking for overlap, fix a typo: ZV was used where
3342 ZV_BYTE was intended.
3343 (Fwrite_region): Don't assume off_t fits into 'long'.
3344 * buffer.h (struct buffer.modtime_size): Now off_t, not EMACS_INT.
3345
ecfc0a49
MA
33462011-09-05 Michael Albinus <michael.albinus@gmx.de>
3347
3348 * dbusbind.c (xd_signature_cat): Rename from signature_cat.
3349
6511acf2 33502011-09-04 Paul Eggert <eggert@cs.ucla.edu>
61bfeeb7 3351
0999621a 3352 sprintf-related integer and memory overflow issues (Bug#9412).
62f19c19
PE
3353
3354 * doprnt.c (doprnt): Support printing ptrdiff_t and intmax_t values.
8666506e 3355 (esprintf, exprintf, evxprintf): New functions.
62f19c19 3356 * keyboard.c (command_loop_level): Now EMACS_INT, not int.
6b02f655 3357 (cmd_error): Kbd macro iterations count is now EMACS_INT, not int.
62f19c19
PE
3358 (modify_event_symbol): Do not assume that the length of
3359 name_alist_or_stem is safe to alloca and fits in int.
3360 (Fexecute_extended_command): Likewise for function name and binding.
3361 (Frecursion_depth): Wrap around reliably on integer overflow.
3362 * keymap.c (push_key_description): First arg is now EMACS_INT, not int,
3363 since some callers pass EMACS_INT values.
3364 (Fsingle_key_description): Don't crash if symbol name contains more
3365 than MAX_ALLOCA bytes.
3366 * minibuf.c (minibuf_level): Now EMACS_INT, not int.
3367 (get_minibuffer): Arg is now EMACS_INT, not int.
3368 * lisp.h (get_minibuffer, push_key_description): Reflect API changes.
8666506e 3369 (esprintf, exprintf, evxprintf): New decls.
62f19c19
PE
3370 * window.h (command_loop_level, minibuf_level): Reflect API changes.
3371
2be7d702
PE
3372 * dbusbind.c (signature_cat): New function.
3373 (xd_signature, Fdbus_register_signal):
2ea16b89
PE
3374 Do not overrun buffer; instead, report string overflow.
3375
9d1df220
PE
3376 * dispnew.c (add_window_display_history): Don't overrun buffer.
3377 Truncate instead; this is OK since it's just a log.
3378
33ef5c64
PE
3379 * editfns.c (Fcurrent_time_zone): Don't overrun buffer
3380 even if the time zone offset is outlandishly large.
3381 Don't mishandle offset == INT_MIN.
3382
66c6fdd5
PE
3383 * emacs.c (main) [NS_IMPL_COCOA]: Don't overrun buffer
3384 when creating daemon; the previous buffer-overflow check was incorrect.
3385
d749b01b
PE
3386 * eval.c (verror): Simplify by rewriting in terms of evxprintf,
3387 which has the guts of the old verror function.
3388
b5cd1905
PE
3389 * filelock.c (lock_file_1, lock_file): Don't blindly alloca long name;
3390 use SAFE_ALLOCA instead. Use esprintf to avoid int-overflow issues.
3391
6e1a67fb
PE
3392 * font.c: Include <float.h>, for DBL_MAX_10_EXP.
3393 (font_unparse_xlfd): Don't blindly alloca long strings.
c21721cc 3394 Don't assume XINT result fits in int, or that XFLOAT_DATA * 10
8666506e 3395 fits in int, when using sprintf. Use single snprintf to count
c21721cc
PE
3396 length of string rather than counting it via multiple sprintfs;
3397 that's simpler and more reliable.
c21721cc
PE
3398 (font_unparse_fcname): Use it to avoid sprintf buffer overrun.
3399 (generate_otf_features) [0 && HAVE_LIBOTF]: Use esprintf, not
3400 sprintf, in case result does not fit in int.
3401
c57b67fc
PE
3402 * fontset.c (num_auto_fontsets): Now printmax_t, not int.
3403 (fontset_from_font): Print it.
3404
8a401434
PE
3405 * frame.c (tty_frame_count): Now printmax_t, not int.
3406 (make_terminal_frame, set_term_frame_name): Print it.
3407 (x_report_frame_params): In X, window IDs are unsigned long,
3408 not signed long, so print them as unsigned.
3409 (validate_x_resource_name): Check for implausibly long names,
3410 and don't assume name length fits in 'int'.
3411 (x_get_resource_string): Don't blindly alloca invocation name;
3412 use SAFE_ALLOCA. Use esprintf, not sprintf, in case result does
3413 not fit in int.
3414
6e1a67fb
PE
3415 * gtkutil.c: Include <float.h>, for DBL_MAX_10_EXP.
3416 (xg_check_special_colors, xg_set_geometry):
84722b3d
PE
3417 Make sprintf buffers a bit bigger, to avoid potential buffer overrun.
3418
0df02bf3
PE
3419 * lread.c (dir_warning): Don't blindly alloca buffer; use SAFE_ALLOCA.
3420 Use esprintf, not sprintf, in case result does not fit in int.
3421
48e30793
PE
3422 * macros.c (executing_kbd_macro_iterations): Now EMACS_INT, not int.
3423 (Fend_kbd_macro): Don't mishandle MOST_NEGATIVE_FIXNUM by treating
3424 it as a large positive number.
3425 (Fexecute_kbd_macro): Don't assume repeat count fits in int.
3426 * macros.h (executing_kbd_macro_iterations): Now EMACS_INT, not int.
3427
a66ff6d8
PE
3428 * nsterm.m ((NSSize)windowWillResize): Use esprintf, not sprintf,
3429 in case result does not fit in int.
3430
aca216ff
PE
3431 * print.c (float_to_string): Detect width overflow more reliably.
3432 (print_object): Make sprintf buffer a bit bigger, to avoid potential
3433 buffer overrun. Don't assume list length fits in 'int'. Treat
3434 print length of 0 as 0, not as infinity; to be consistent with other
3435 uses of print length in this function. Don't overflow print length
3436 index. Don't assume hash table size fits in 'long', or that
3437 vectorlike size fits in 'unsigned long'.
3438
31c286f7
PE
3439 * process.c (make_process): Use printmax_t, not int, to format
3440 process-name gensyms.
3441
55e5faa1
PE
3442 * sysdep.c (snprintf) [! HAVE_SNPRINTF]: New function.
3443
80f2e268
PE
3444 * term.c (produce_glyphless_glyph): Make sprintf buffer a bit bigger
3445 to avoid potential buffer overrun.
3446
670741ab
PE
3447 * xfaces.c (x_update_menu_appearance): Don't overrun buffer
3448 if X resource line is longer than 512 bytes.
3449
b7163a50
PE
3450 * xfns.c (x_window): Make sprintf buffer a bit bigger
3451 to avoid potential buffer overrun.
3452
ae58ff1f
PE
3453 * xterm.c (x_io_error_quitter): Don't overrun sprintf buffer.
3454
c43c8a6a
PE
3455 * xterm.h (x_check_errors): Add ATTRIBUTE_FORMAT_PRINTF.
3456
3f8236f4
PE
34572011-09-04 Paul Eggert <eggert@cs.ucla.edu>
3458
53e9fe90 3459 Integer overflow fixes for scrolling, etc.
6511acf2
PE
3460 Without these, Emacs silently mishandles large integers sometimes.
3461 For example, "C-u 4294967297 M-x recenter" was treated as if
53e9fe90
PE
3462 it were "C-u 1 M-x recenter" on a typical 64-bit host.
3463
6511acf2
PE
3464 * xdisp.c (try_window_id): Check Emacs fixnum range before
3465 converting to 'int'.
806add1d 3466
6511acf2 3467 * window.c (window_scroll_line_based, Frecenter):
71f02bc5
PE
3468 Check that an Emacs fixnum is in range before assigning it to 'int'.
3469 (Frecenter, Fmove_to_window_line): Use EMACS_INT, not int, for
3470 values converted from Emacs fixnums.
3471 (Frecenter): Don't wrap around a line count if it is out of 'int'
3472 range; instead, treat it as an extreme value.
3473 (Fset_window_configuration, compare_window_configurations):
3474 Use ptrdiff_t, not int, for index that might exceed 2 GiB.
3475
6511acf2
PE
3476 * search.c (Freplace_match): Use ptrdiff_t, not int, for indexes
3477 that can exceed INT_MAX. Check that EMACS_INT value is in range
3478 before assigning it to the (possibly-narrower) index.
a0efffc8
PE
3479 (match_limit): Don't assume that a fixnum can fit in 'int'.
3480
6511acf2 3481 * print.c (print_object): Use ptrdiff_t, not int, for index that can
29ebea3b
PE
3482 exceed INT_MAX.
3483
6511acf2 3484 * indent.c (position_indentation): Now takes ptrdiff_t, not int.
3f8236f4
PE
3485 (Fvertical_motion): Don't wrap around LINES values that don't fit
3486 in 'int'. Instead, treat them as extreme values. This is good
3487 enough for windows, which can't have more than INT_MAX lines anyway.
3488
fcb901a7
LMI
34892011-09-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
3490
0f2f6b6d
LMI
3491 * Require libxml/parser.h to avoid compilation warning.
3492
fcb901a7
LMI
3493 * emacs.c (shut_down_emacs): Call xmlCleanupParser on shutdown.
3494
3495 * xml.c (parse_region): Don't call xmlCleanupParser after parsing,
3496 since this reportedly can destroy thread storage.
3497
6e20a0d4
CY
34982011-08-30 Chong Yidong <cyd@stupidchicken.com>
3499
3500 * syntax.c (find_defun_start): Update all cache variables if
3501 exiting early (Bug#9401).
3502
148ae00e
EZ
35032011-08-30 Eli Zaretskii <eliz@gnu.org>
3504
f6cfbd8f
EZ
3505 * image.c (x_bitmap_pixmap): Cast to int to avoid compiler warnings.
3506
148ae00e
EZ
3507 * xdisp.c (produce_stretch_glyph): No longer static, compiled also
3508 when HAVE_WINDOW_SYSTEM is not defined. Support both GUI and TTY
3509 frames. Call tty_append_glyph in the TTY case. (Bug#9402)
3510
3511 * term.c (tty_append_glyph): New function.
3512 (produce_stretch_glyph): Static function and its prototype deleted.
3513
a66cfb1c
SM
3514 * dispextern.h (produce_stretch_glyph, tty_append_glyph):
3515 Add prototypes.
148ae00e 3516
c4a07a4c
PE
35172011-08-29 Paul Eggert <eggert@cs.ucla.edu>
3518
3519 * image.c (parse_image_spec): Check for nonnegative, not for positive,
3520 when checking :margin (Bug#9390).
3521 (IMAGE_NON_NEGATIVE_INTEGER_VALUE_OR_PAIR):
a66cfb1c 3522 Rename from IMAGE_POSITIVE_INTEGER_VALUE_OR_PAIR,
c4a07a4c
PE
3523 so that the name doesn't mislead. All uses changed.
3524
6bc8cd65
JB
35252011-08-28 Johan Bockgård <bojohan@gnu.org>
3526
3527 * term.c (init_tty) [HAVE_GPM]: Move mouse settings after
3528 set_tty_hooks.
3529
dca4927e
EZ
35302011-08-27 Eli Zaretskii <eliz@gnu.org>
3531
3532 * xdisp.c (move_it_to): Don't bail out early when reaching
3533 position beyond to_charpos, if we are scanning backwards.
3534 (move_it_vertically_backward): When DY == 0, make sure we get to
3535 the first character in the line after the newline.
3536
f2cad773
PE
35372011-08-27 Paul Eggert <eggert@cs.ucla.edu>
3538
3539 * ccl.c: Improve and simplify overflow checking (Bug#9196).
3540 (ccl_driver): Do not generate an out-of-range pointer.
3541 (Fccl_execute_on_string): Remove unnecessary check for
3542 integer overflow, noted by Stefan Monnier in
3543 <http://lists.gnu.org/archive/html/emacs-devel/2011-08/msg00979.html>.
3544 Remove a FIXME that didn't need fixing.
3545 Simplify the newly-introduced buffer reallocation code.
3546
0cae2cdb
JB
35472011-08-27 Juanma Barranquero <lekktu@gmail.com>
3548
3549 * makefile.w32-in ($(BLD)/alloc.$(O)): Depend on lib/verify.h.
3550
5fc295a4 35512011-08-26 Paul Eggert <eggert@cs.ucla.edu>
ddff3151 3552
70c60eb2 3553 Integer and memory overflow issues (Bug#9196).
726e0ab1 3554
d31850da
PE
3555 * doc.c (get_doc_string): Rework so that
3556 get_doc_string_buffer_size is the actual buffer size, rather than
3557 being 1 less than the actual buffer size; this makes xpalloc more
3558 convenient.
3559
a69fbedb
PE
3560 * image.c (x_allocate_bitmap_record, cache_image):
3561 * xselect.c (Fx_register_dnd_atom):
3562 Simplify previous changes by using xpalloc.
3563
fe5c5d37
PE
3564 * buffer.c (overlay_str_len): Now ptrdiff_t, not EMACS_INT,
3565 since either will do and ptrdiff_t is convenient with xpalloc.
3566
0065d054
PE
3567 * charset.c (charset_table_size)
3568 (struct charset_sort_data.priority): Now ptrdiff_t.
3569 (charset_compare): Don't overflow if priorities differ greatly.
3570 (Fsort_charsets): Don't assume list length fits in int.
3571 Check for size-calculation overflow when allocating sort data.
3572 (syms_of_charset): Allocate an initial charset table that is
3573 just under 64 KiB, to avoid problems with glibc malloc and mmap.
3574
3575 * cmds.c (internal_self_insert): Check for size-calculation overflow.
3576
3577 * composite.h (struct composition.glyph_len): Now int, not unsigned.
3578 The actual value is always <= INT_MAX, and leaving it unsigned made
3579 overflow checking harder.
3580
3581 * dispextern.h (struct glyph_matrix.rows_allocated)
3582 (struct face_cache.size): Now ptrdiff_t, for convenience in use
3583 with xpalloc. The values are still always <= INT_MAX.
3584
3585 * indent.c (compute_motion): Adjust to region_cache_forward sig change.
3586
3587 * lisp.h (xnmalloc, xnrealloc, xpalloc): New decls.
3588 (SAFE_NALLOCA): New macro.
3589
3590 * region-cache.c (struct boundary.pos, find_cache_boundary)
3591 (move_cache_gap, insert_cache_boundary, delete_cache_boundaries)
3592 (set_cache_region, invalidate_region_cache)
3593 (revalidate_region_cache, know_region_cache, region_cache_forward)
3594 (region_cache_backward, pp_cache):
3595 Use ptrdiff_t, not EMACS_INT, since either will do. This is needed
3596 so that ptrdiff_t * can be passed to xpalloc.
3597 (struct region_cache): Similarly, for gap_start, gap_len, cache_len,
3598 beg_unchanged, end_unchanged, buffer_beg, buffer_end members.
3599 (pp_cache): Don't assume cache_len fits in int.
3600 * region-cache.h: Adjust extern decls to match.
3601
3602 * search.c (scan_buffer, Freplace_match): Use ptrdiff_t, not
3603 EMACS_INT, since either will do, for xpalloc.
3604
3605 * alloc.c: Include verify.h, and check that int fits in ptrdiff_t.
3606 (xnmalloc, xnrealloc, xpalloc): New functions.
3607
726e0ab1
PE
3608 * bidi.c (bidi_shelve_header_size): New constant.
3609 (bidi_cache_ensure_space, bidi_shelve_cache): Use it.
3610 (bidi_cache_ensure_space): Avoid integer overflow when allocating.
3611
51f30bc5 3612 * bidi.c (bidi_cache_shrink):
726e0ab1
PE
3613 * buffer.c (overlays_at, overlays_in, record_overlay_string)
3614 (overlay_strings):
3615 Don't update size of array until after memory allocation succeeds,
3616 because xmalloc/xrealloc may not return.
0065d054
PE
3617 (struct sortstrlist.bytes): Now ptrdiff_t, as EMACS_INT doesn't help
3618 now that we have proper integer overflow checking.
3619 (record_overlay_string, overlay_strings): Catch overflows when
3620 calculating size of overlay_str_buf.
726e0ab1 3621
0065d054
PE
3622 * callproc.c (Fcall_process): Check for size overflow when
3623 calculating size of args2.
3624 (child_setup): Avoid overflow by using size_t rather than ptrdiff_t.
3625 Normally we prefer signed values, but sticking with ptrdiff_t would
3626 require adding more-complicated checks.
726e0ab1
PE
3627
3628 * ccl.c (Fccl_execute_on_string): Check for memory overflow.
3629 Use ptrdiff_t rather than EMACS_INT where ptrdiff_t will do.
3630 Redo buffer-overflow calculations to avoid integer overflow.
0065d054 3631 Add a FIXME comment where memory seems to be over-allocated.
726e0ab1
PE
3632
3633 * character.c (Fstring): Check for size-calculation overflow.
3634
3635 * coding.c (produce_chars): Redo buffer-overflow calculations to avoid
3636 unnecessary integer overflow. Check for size overflow.
3637 (encode_coding_object): Don't update size until xmalloc succeeds.
3638
3639 * composite.c (get_composition_id): Check for overflow in glyph
3640 length calculations.
3641
3642 Integer and memory overflow fixes for display code.
3643 * dispextern.h (struct glyph_pool.nglyphs): Now ptrdiff_t, not int.
3644 * dispnew.c (adjust_glyph_matrix, realloc_glyph_pool)
3645 (scrolling_window): Check for overflow in size calculations.
3646 (line_draw_cost, realloc_glyph_pool, add_row_entry):
3647 Don't assume glyph table len fits in int.
3648 (struct row_entry.bucket, row_entry_pool_size, row_entry_idx)
3649 (row_table_size): Now ptrdiff_t, not int.
3650 (scrolling_window): Avoid overflow in size calculations.
3651 Don't update size until allocation succeeds.
3652 * fns.c (concat): Check for overflow in size calculations.
3653 (next_almost_prime): Verify NEXT_ALMOST_PRIME_LIMIT.
3654 * lisp.h (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): New macros.
3655 (NEXT_ALMOST_PRIME_LIMIT): New constant.
3656
3657 * doc.c (get_doc_string_buffer_size): Now ptrdiff_t, not int.
3658 (get_doc_string): Check for size calculation overflow.
3659 Don't update size until allocation succeeds.
3660 (get_doc_string, Fsubstitute_command_keys): Use ptrdiff_t, not
3661 EMACS_INT, where ptrdiff_t will do.
3662 (Fsubstitute_command_keys): Check for string overflow.
3663
3664 * editfns.c (set_time_zone_rule): Don't assume environment length
3665 fits in int.
3666 (message_length): Now ptrdiff_t, not int.
3667 (Fmessage_box): Don't update size until allocation succeeds.
3668 Don't assume message length fits in int.
3669 (Fformat): Use ptrdiff_t, not EMACS_INT, where ptrdiff_t will do.
3670
0065d054
PE
3671 * emacs.c (main): Do not reallocate argv, since there is a null at
3672 the end that can be overwritten, and this way there's no need to
3673 worry about size-calculation overflow.
3674 (sort_args): Check for size-calculation overflow.
726e0ab1
PE
3675
3676 * eval.c (init_eval_once, grow_specpdl): Don't update size until
3677 alloc succeeds.
3678 (call_debugger, grow_specpdl): Redo calculations to avoid overflow.
3679
3680 * frame.c (set_menu_bar_lines, x_set_frame_parameters)
3681 (x_set_scroll_bar_width, x_figure_window_size):
3682 Check for integer overflow.
3683 (x_set_alpha): Do not assume XINT fits in int.
3684
3685 * frame.h (struct frame): Use int, not EMACS_INT, where int works.
3686 This is for the members text_lines, text_cols, total_lines, total_cols,
3687 where the system imposes an 'int' limit.
3688
3689 * fringe.c (Fdefine_fringe_bitmap):
3690 Don't update size until alloc works.
3691
3692 * ftfont.c (ftfont_get_open_type_spec, setup_otf_gstring)
3693 (ftfont_shape_by_flt): Check for integer overflow in size calculations.
3694
3695 * gtkutil.c (get_utf8_string, xg_store_widget_in_map):
3696 Check for size-calculation overflow.
3697 (get_utf8_string): Use ptrdiff_t, not size_t, where either will
3698 do, as we prefer signed integers.
3699 (id_to_widget.max_size, id_to_widget.used)
3700 (xg_store_widget_in_map, xg_remove_widget_from_map)
3701 (xg_get_widget_from_map, xg_get_scroll_id_for_window)
3702 (xg_remove_scroll_bar, xg_update_scrollbar_pos):
3703 Use and return ptrdiff_t, not int.
3704 (xg_gtk_scroll_destroy): Don't assume ptrdiff_t fits in int.
3705 * gtkutil.h: Change prototypes to match the above.
3706
3707 * image.c (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): Remove; these
3708 are duplicate now that they've been promoted to lisp.h.
3709 (x_allocate_bitmap_record, x_alloc_image_color)
3710 (make_image_cache, cache_image, xpm_load):
3711 Don't update size until alloc is done.
3712 (xpm_load, lookup_rgb_color, lookup_pixel_color, x_to_xcolors)
3713 (x_detect_edges):
3256efce 3714 Check for size calculation overflow.
726e0ab1
PE
3715 (ct_colors_allocated_max): New constant.
3716 (x_to_xcolors, x_detect_edges): Reorder multiplicands to avoid
3717 overflow.
3256efce 3718
726e0ab1
PE
3719 * keyboard.c (read_char, menu_bar_items, tool_bar_items)
3720 (read_char_x_menu_prompt, read_char_minibuf_menu_width)
3721 (read_char_minibuf_menu_prompt, follow_key, read_key_sequence):
3722 Use ptrdiff_t, not int, to count maps.
3723 (read_char_minibuf_menu_prompt): Check for overflow in size
a66cfb1c
SM
3724 calculations. Don't update size until allocation succeeds.
3725 Redo calculations to avoid overflow.
726e0ab1
PE
3726 * keyboard.h: Change prototypes to match the above.
3727
3728 * keymap.c (cmm_size, current_minor_maps): Use ptrdiff_t, not int,
3729 to count maps.
3730 (current_minor_maps): Check for size calculation overflow.
3731 * keymap.h: Change prototypes to match the above.
3732
3733 * lread.c (read1, init_obarray): Don't update size until alloc done.
3734
3735 * macros.c (Fstart_kbd_macro): Don't update size until alloc done.
3736 (store_kbd_macro_char): Reorder multiplicands to avoid overflow.
3737
726e0ab1
PE
3738 * nsterm.h (struct ns_color_table.size, struct ns_color_table.avail):
3739 Now ptrdiff_t, not int.
3740 * nsterm.m (ns_index_color): Use ptrdiff_t, not int, for table indexes.
3741 (ns_draw_fringe_bitmap): Rewrite to avoid overflow.
3742
3743 * process.c (Fnetwork_interface_list): Check for overflow
3744 in size calculation.
3745
3746 * region-cache.c (move_cache_gap): Check for size calculation overflow.
3747
3748 * scroll.c (do_line_insertion_deletion_costs): Check for size calc
3749 overflow. Don't bother calling xmalloc when xrealloc will do.
3750
3751 * search.c (Freplace_match): Check for size calculation overflow.
3752 (Fset_match_data): Don't assume list lengths fit in 'int'.
3753
3754 * sysdep.c (system_process_attributes): Use ptrdiff_t, not int,
3755 for command line length. Do not attempt to address one before the
3756 beginning of an array, as that's not portable.
3757
3758 * term.c (max_frame_lines): Remove; unused.
3759 (encode_terminal_src_size, encode_terminal_dst_size): Now ptrdiff_t,
3760 not int.
3761 (encode_terminal_code, calculate_costs): Check for size
3762 calculation overflow.
3763 (encode_terminal_code): Use ptrdiff_t, not int, to record glyph
3764 table lengths and related sizes. Don't update size until alloc
3765 done. Redo calculations to avoid overflow.
3766 (calculate_costs): Don't bother calling xmalloc when xrealloc will do.
3767
3768 * termcap.c (tgetent): Use ptrdiff_t, not int, to record results of
3769 subtracting pointers.
3770 (gobble_line): Check for overflow more carefully. Don't update size
3771 until alloc done.
3772
3773 * tparam.c (tparam1): Use ptrdiff_t, not int, for sizes.
3774 Don't update size until alloc done.
3775 Redo size calculations to avoid overflow.
3776 Check for size calculation overflow.
0065d054 3777 (main) [DEBUG]: Fix typo in invoking tparam1.
726e0ab1
PE
3778
3779 * xdisp.c (store_mode_line_noprop_char, x_consider_frame_title):
3780 Use ptrdiff_t, not int, for sizes.
3781 (store_mode_line_noprop_char): Don't update size until alloc done.
3782
0065d054
PE
3783 * xfaces.c (lface_id_to_name_size, Finternal_make_lisp_face):
3784 Use ptrdiff_t, not int, for sizes.
3785 (Finternal_make_lisp_face, cache_face):
3786 Check for size calculation overflow.
3787 (cache_face): Treat size calculation overflows as if they were
3788 memory exhaustion (the usual treatment), rather than aborting.
726e0ab1
PE
3789
3790 * xfns.c (x_encode_text, x_set_name_internal)
3791 (Fx_change_window_property): Use ptrdiff_t, not int, to count
3792 sizes, since they can exceed INT_MAX in size. Check for size
3793 calculation overflow.
3794
0065d054
PE
3795 * xgselect.c (gfds_size): Now ptrdiff_t, for convenience with xpalloc.
3796 (xg_select): Check for size calculation overflow.
726e0ab1
PE
3797 Don't update size until alloc done.
3798
0065d054 3799 * xrdb.c (get_environ_db): Don't assume path length fits in int,
726e0ab1 3800 as sprintf is limited to int lengths.
1d526e2f 3801
252c5ee1
PE
3802 * xselect.c (X_LONG_SIZE, X_SHRT_MAX, X_SHRT_MIN, X_LONG_MAX)
3803 (X_LONG_MIN): New macros.
864d7ce7
PE
3804 Use them to make the following changes clearer.
3805 (MAX_SELECTION_QUANTUM): Make the other bounds on this value clearer.
3806 This change doesn't affect the value now, but it may help remind
3807 future maintainers not to raise the value too much later.
3808 (SELECTION_QUANTUM): Remove, replacing with ...
3809 (selection_quantum): ... new function, which avoids overflow.
3810 All uses changed.
3811 (struct selection_data.size): Now ptrdiff_t, not int, to avoid
3812 assumption that selection length fits in 'int'.
3813 (x_reply_selection_request, x_handle_selection_request)
3814 (x_get_window_property, receive_incremental_selection)
3815 (x_get_window_property_as_lisp_data, selection_data_to_lisp_data)
3816 (lisp_data_to_selection_data, clean_local_selection_data):
3817 Use ptrdiff_t, not int, to record length of selection.
3818 (x_reply_selection_request, x_get_window_property)
3819 (receive_incremental_selection, x_property_data_to_lisp):
3820 Redo calculations to avoid overflow.
3821 (x_reply_selection_request): When sending hint, ceiling it at
252c5ee1 3822 X_LONG_MAX rather than relying on wraparound overflow to send
864d7ce7
PE
3823 something.
3824 (x_get_window_property, receive_incremental_selection)
3825 (lisp_data_to_selection_data, x_property_data_to_lisp):
3826 Check for size-calculation overflow.
3827 (x_get_window_property, receive_incremental_selection)
3828 (lisp_data_to_selection_data, Fx_register_dnd_atom):
3829 Don't store size until memory allocation succeeds.
3830 (x_get_window_property): Plug memory leak on memory exhaustion.
3831 Don't double-block input; malloc is safe here. Don't assume 2**34
3832 - 4 fits in unsigned long. Add an xassert to check
3833 XGetWindowProperty overflow. Be more careful about overflow
3834 calculations, and distinguish size from memory overflow better.
3835 (receive_incremental_selection): When tracing, don't assume
3836 unsigned int is less than INT_MAX.
3837 (x_selection_data_to_lisp_data): Remove unnecessary (and in theory
3838 harmful) conversions of unsigned short to int.
3839 (lisp_data_to_selection_data): Don't assume that integers
3840 in the range -65535 through -1 fit in an X unsigned short.
3841 Don't assume that ULONG_MAX == X_ULONG_MAX. Don't store into
3842 result parameters unless successful. Rely on cons_to_unsigned
3843 to report problems with elements; the old code wasn't right anyway.
3844 (x_check_property_data): Check for int overflow; we cannot use
3845 a wider type due to X limits.
3846 (x_handle_dnd_message): Use unsigned int, to avoid int overflow.
3847
726e0ab1 3848 * xsmfns.c (smc_save_yourself_CB): Check for size calc overflow.
34db673b 3849
0065d054
PE
3850 * xterm.c (x_color_cells, x_send_scrollbar_event, handle_one_xevent)
3851 (x_term_init): Check for size calculation overflow.
726e0ab1
PE
3852 (x_color_cells): Don't store size until memory allocation succeeds.
3853 (handle_one_xevent): Use ptrdiff_t, not int, for byte counts.
0065d054 3854 Don't assume alloca size is less than MAX_ALLOCA.
726e0ab1
PE
3855 (x_term_init): Don't assume length fits in int (sprintf is limited
3856 to int size).
bc18e09d 3857
ebfa62c0
PE
3858 Use ptrdiff_t for composition IDs.
3859 * character.c (lisp_string_width):
3860 * composite.c (composition_table_size, n_compositions)
3861 (get_composition_id, composition_gstring_from_id):
3862 * dispextern.h (struct glyph_string.cmp_id, struct composition_it.id):
3863 * xdisp.c (BUILD_COMPOSITE_GLYPH_STRING):
3864 * window.c (Frecenter):
3865 Use ptrdiff_t, not int, for composition IDs.
3866 * composite.c (get_composition_id): Check for integer overflow.
3867 * composite.h: Adjust prototypes to match the above changes.
3868
d3411f89
PE
3869 Use ptrdiff_t for hash table indexes.
3870 * category.c (hash_get_category_set):
3871 * ccl.c (ccl_driver):
3872 * charset.h (struct charset.hash_index, CHECK_CHARSET_GET_ID):
3873 * coding.c (coding_system_charset_list, detect_coding_system):
3874 * coding.h (struct coding_system.id):
3875 * composite.c (get_composition_id, gstring_lookup_cache):
3876 * fns.c (hash_lookup, hash_put, Fgethash, Fputhash):
3877 * image.c (xpm_get_color_table_h):
3878 * lisp.h (hash_lookup, hash_put):
3879 * minibuf.c (Ftest_completion):
3880 Use ptrdiff_t for hash table indexes, not int (which is too
3881 narrow, on 64-bit hosts) or EMACS_INT (which is too wide, on
3882 32-bit --with-wide-int hosts).
3883
e097a6fa
PE
3884 * charset.c (Fdefine_charset_internal): Check for integer overflow.
3885 Add a FIXME comment about memory leaks.
3886 (syms_of_charset): Don't assume xmalloc returns.
3887
5637687f
PE
3888 Don't assume that stated character widths fit in int.
3889 * character.c (Fchar_width, c_string_width, lisp_string_width):
3890 * character.h (CHAR_WIDTH):
3891 * indent.c (MULTIBYTE_BYTES_WIDTH):
3892 Use sanitize_char_width to avoid undefined and/or bad behavior
3893 with outlandish widths.
a66cfb1c 3894 * character.h (sanitize_tab_width): Rename from sanitize_width,
5637687f
PE
3895 now that we have two such functions. All uses changed.
3896 (sanitize_char_width): New inline function.
3897
a2271ba2
PE
3898 Don't assume that tab-width fits in int.
3899 * character.h (sanitize_width): New inline function.
3900 (SANE_TAB_WIDTH): New macro.
3901 (ASCII_CHAR_WIDTH): Use it.
3902 * indent.c (sane_tab_width): Remove. All uses replaced by
3903 SANE_TAB_WIDTH (current_buffer).
3904 * xdisp.c (init_iterator): Use SANE_TAB_WIDTH.
3905
18c52557
PE
3906 * fileio.c: Integer overflow issues with file modes.
3907 (Fset_file_modes, auto_save_1): Don't assume EMACS_INT fits in int.
3908
caeeedc1
PE
3909 * charset.c (read_hex): New arg OVERFLOW. All uses changed.
3910 Remove unreachable code.
3911 (read_hex, load_charset_map_from_file): Check for integer overflow.
3912
6df6ae42 3913 * xterm.c: Don't go over XClientMessageEvent limit.
50849c52
PE
3914 (scroll_bar_windows_size): Now ptrdiff_t, as we prefer signed.
3915 (x_send_scroll_bar_event): Likewise. Check that the size does not
3916 exceed limits imposed by XClientMessageEvent, as well as the usual
3917 ptrdiff_t and size_t limits.
3918
b13995db
PE
3919 * keyboard.c: Overflow, signedness and related fixes.
3920 (make_lispy_movement): Use same integer type in forward decl
3921 that is used in the definition.
3922 (read_key_sequence, keyremap_step):
3923 Change bufsize argument back to int, undoing my 2011-03-30 change.
3924 We prefer signed types, and int is wide enough here.
3925 (parse_tool_bar_item): Don't assume tool_bar_max_label_size is less
3926 than TYPE_MAXIMUM (EMACS_INT) / 2. Don't let the label size grow
3927 larger than STRING_BYTES_BOUND. Use ptrdiff_t for Emacs string
3928 length, not size_t. Use ptrdiff_t for index, not int.
3929 (keyremap_step, read_key_sequence): Redo bufsize check to avoid
3930 possibility of integer overflow.
3931
13464394
PE
3932 Overflow, signedness and related fixes for images.
3933
3934 * dispextern.h (struct it.stack[0].u.image.image_id)
3935 (struct_it.image_id, struct image.id, struct image_cache.size)
3936 (struct image_cache.used, struct image_cache.ref_count):
3937 * gtkutil.c (update_frame_tool_bar):
3938 * image.c (x_reference_bitmap, Fimage_size, Fimage_mask_p)
3939 (Fimage_metadata, free_image_cache, clear_image_cache, lookup_image)
3940 (cache_image, mark_image_cache, x_kill_gs_process, Flookup_image):
3941 * nsmenu.m (update_frame_tool_bar):
3942 * xdisp.c (calc_pixel_width_or_height):
3943 * xfns.c (image_cache_refcount):
3944 Image IDs are now ptrdiff_t, not int, to avoid arbitrary limits
3945 on typical 64-bit hosts.
3946
3947 * image.c (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): New macros.
3948 (x_bitmap_pixmap, x_create_x_image_and_pixmap):
3949 Omit unnecessary casts to int.
3950 (parse_image_spec): Check that integers fall into 'int' range
3951 when the callers expect that.
3952 (image_ascent): Redo ascent calculation to avoid int overflow.
3953 (clear_image_cache): Avoid overflow when sqrt (INT_MAX) < nimages.
3954 (lookup_image): Remove unnecessary tests.
3955 (xbm_image_p): Locals are now of int, not EMACS_INT,
3956 since parse_image_check makes sure they fit into int.
3957 (png_load, gif_load, svg_load_image):
3958 Prefer int to unsigned where either will do.
3959 (tiff_handler): New function, combining the cores of the
a66cfb1c
SM
3960 old tiff_error_handler and tiff_warning_handler.
3961 This function is rewritten to use vsnprintf and thereby avoid
13464394
PE
3962 stack buffer overflows. It uses only the features of vsnprintf
3963 that are common to both POSIX and native Microsoft.
3964 (tiff_error_handler, tiff_warning_handler): Use it.
3965 (tiff_load, gif_load, imagemagick_load_image):
3966 Don't assume :index value fits in 'int'.
3967 (gif_load): Omit unnecessary cast to double, and avoid double-rounding.
3968 (imagemagick_load_image): Check that crop parameters fit into
3969 the integer types that MagickCropImage accepts. Don't assume
3970 Vimagemagick_render_type has a nonnegative value. Don't assume
3971 size_t fits in 'long'.
3972 (gs_load): Use printmax_t to print the widest integers possible.
3973 Check for integer overflow when computing image height and width.
3974
c11821d4
EZ
39752011-08-26 Eli Zaretskii <eliz@gnu.org>
3976
3977 * xdisp.c (redisplay_window): Don't force window start if point
3978 will be invisible in the resulting window. (Bug#9324)
3979
0c95fcf7
EZ
39802011-08-25 Eli Zaretskii <eliz@gnu.org>
3981
3982 * xdisp.c (compute_display_string_pos): Return 2 in DISP_PROP when
3983 the display spec is of the form `(space ...)'.
3984 (handle_display_spec): Return the value returned by
3985 handle_single_display_spec, not just 1 or zero.
3986 (handle_single_display_spec): If the display spec is of the form
3987 `(space ...)', and specifies display in the text area, return 2
3988 rather than 1.
fee65a97 3989 (try_cursor_movement): Check for the need to scroll more
a66cfb1c
SM
3990 accurately, and prefer exact match for point under bidi.
3991 Don't advance `row' beyond the last row of the window.
0c95fcf7
EZ
3992
3993 * dispextern.h (struct bidi_it): Rename the disp_prop_p member
3994 into disp_prop; all users changed.
3995
3996 * bidi.c (bidi_fetch_char): If compute_display_string_pos returns
3997 DISP_PROP = 2, substitute the u+2029 PARAGRAPH SEPARATOR character
3998 for the text covered by the display property.
3999
e4ed06f1
CY
40002011-08-25 Chong Yidong <cyd@stupidchicken.com>
4001
4002 * buffer.c (Fbury_buffer_internal): Rename from Funrecord_buffer.
4003 Change return value to nil.
4004 (Frecord_buffer): Delete unused function.
4005
f67cdd7f
EZ
40062011-08-24 Eli Zaretskii <eliz@gnu.org>
4007
5980d4c6
EZ
4008 * xdisp.c (Fcurrent_bidi_paragraph_direction): For unibyte
4009 buffers, return left-to-right.
8610fe8b
EZ
4010 (set_cursor_from_row): Consider candidate row a win if its glyph
4011 represents a newline and point is on that newline. Fixes cursor
4012 positioning on the newline at EOL of R2L text within L2R
4013 paragraph, and vice versa.
4014 (try_cursor_movement): Check continued rows, in addition to
4015 continuation rows. Fixes unwarranted scroll when point enters a
4016 continued line of R2L text within an L2R paragraph, or vice versa.
4017 (cursor_row_p): Consider the case of point being equal to
4018 MATRIX_ROW_END_CHARPOS. Prevents cursor being stuck when moving
4019 from the end of a short line to the beginning of a continued line
4020 of R2L text within L2R paragraph.
4021 (RECORD_MAX_MIN_POS): For max_pos, use IT_CHARPOS even for
4022 composed characters.
5980d4c6 4023
f67cdd7f
EZ
4024 * bidi.c (bidi_check_type): Use xassert.
4025 (bidi_cache_iterator_state): Update the disp_pos and disp_prop_p
4026 members.
4027
bca633fb
EZ
40282011-08-23 Eli Zaretskii <eliz@gnu.org>
4029
4030 * bidi.c (bidi_get_type): Abort if we get zero as the bidi type of
4031 a character.
4032
4a5885a7
CY
40332011-08-23 Chong Yidong <cyd@stupidchicken.com>
4034
4035 * nsfont.m (ns_otf_to_script): Fix typo.
4036
0902a04e
KH
40372011-08-22 Kenichi Handa <handa@m17n.org>
4038
4039 * chartab.c (Fset_char_table_extra_slot): Do not inhibit setting a
4040 extra slot even if the purpose is char-code-property-table.
4041
1a2e6670
EZ
40422011-08-23 Eli Zaretskii <eliz@gnu.org>
4043
8ddde651
EZ
4044 * xdisp.c (redisplay_window): When computing centering_position,
4045 account for the height of the header line. (Bug#8874)
4046
425cc014
EZ
4047 * dispnew.c (buffer_posn_from_coords): Use buf_charpos_to_bytepos
4048 instead of CHAR_TO_BYTE. Fixes a crash when a completion
4049 candidate is selected by the mouse, and that candidate has a
4050 composed character under the mouse.
4051
1a2e6670
EZ
4052 * xdisp.c (x_produce_glyphs): Set it->nglyphs to 1. Fixes pixel
4053 coordinates reported by pos-visible-in-window-p for a composed
4054 character in column zero.
4055
8b76d6f8
SM
40562011-08-23 Stefan Monnier <monnier@iro.umontreal.ca>
4057
4058 * cmds.c (Fself_insert_command): Mention post-self-insert-hook.
4059
dac347dd
EZ
40602011-08-22 Eli Zaretskii <eliz@gnu.org>
4061
4062 * xdisp.c (BUFFER_POS_REACHED_P): If this is a composition,
4063 consider it a hit if to_charpos is anywhere in the range of the
4064 composed buffer positions.
4065
e013fb34
CY
40662011-08-22 Chong Yidong <cyd@stupidchicken.com>
4067
4068 * image.c (gif_load): Don't assume that each subimage has the same
4069 dimensions as the base image. Handle disposal method that is
4070 "undefined" by the gif spec (Bug#9335).
4071
bd1ba3e8
CY
40722011-08-20 Chong Yidong <cyd@stupidchicken.com>
4073
4074 * eval.c (Fsignal): Handle `debug' symbol in error handler (Bug#9329).
024a2d76 4075 (Fcondition_case): Document `debug' symbol in error handler.
bd1ba3e8 4076
54a1215b
EZ
40772011-08-19 Eli Zaretskii <eliz@gnu.org>
4078
823564e5
EZ
4079 * xfaces.c (face_at_buffer_position): Avoid repeated evaluation of
4080 face ID by FACE_FROM_ID, and avoid a crash when mouse is moved
4081 from an Org mode buffer to a Speedbar frame.
4082
54a1215b
EZ
4083 * xdisp.c (RECORD_MAX_MIN_POS): If the display element comes from
4084 a composition, take its buffer position from IT->cmp_it.charpos.
4085 Fixes cursor positioning at the beginning of a line that begins
4086 with a composed character.
4087
9778ebcc
EZ
40882011-08-18 Eli Zaretskii <eliz@gnu.org>
4089
0be6ee06
EZ
4090 * bidi.c (bidi_get_type): If bidi_type_table reports zero as the
4091 character bidirectional type, use STRONG_L instead. Fixes crashes
4092 in a buffer produced by `describe-categories'.
4093
9778ebcc
EZ
4094 * dispextern.h (struct bidi_it): Move disp_pos and disp_prop_p
4095 members before the level stack, so they would be saved and
4096 restored when copying iterator state. Fixes incorrect reordering
4097 around TABs covered by display properties.
4098
156bffbe
AS
40992011-08-18 Andreas Schwab <schwab@linux-m68k.org>
4100
6b02f655 4101 * process.c (Fnetwork_interface_list): Correctly determine buffer size.
156bffbe 4102
72ad093b
CY
41032011-08-17 Chong Yidong <cyd@stupidchicken.com>
4104
4105 * eval.c (internal_condition_case, internal_condition_case_1)
8b76d6f8
SM
4106 (internal_condition_case_2, internal_condition_case_n):
4107 Remove unnecessary aborts (Bug#9081).
72ad093b 4108
35774242
EZ
41092011-08-17 Eli Zaretskii <eliz@gnu.org>
4110
4111 * lread.c (Fload) [DOS_NT]: If `openp' returns -2, but the file
4112 has no `load' handler, try opening the file locally. (Bug#9311)
4113
db76dd85
KB
41142011-08-16 Ken Brown <kbrown@cornell.edu>
4115
4116 * gmalloc.c: Expand comment.
4117
b215eee5
EZ
41182011-08-16 Eli Zaretskii <eliz@gnu.org>
4119
4120 * xdisp.c (set_cursor_from_row): Don't accept a previous candidate
4121 if it fails the cursor_row_p test. Fixes cursor positioning at ZV.
4122
a4579d33
KB
41232011-08-16 Ken Brown <kbrown@cornell.edu>
4124
4125 Fix memory allocation problems in Cygwin build (Bug#9273).
4126
4127 * unexcw.c ( __malloc_initialized): Declare external variable.
4128 (fixup_executable): Force the dumped emacs to reinitialize malloc.
4129
8b76d6f8
SM
4130 * gmalloc.c [CYGWIN] (bss_sbrk_heapbase, bss_sbrk_heapinfo):
4131 New variables.
a4579d33
KB
4132 (malloc_initialize_1) [CYGWIN]: Prepare for reinitializing the
4133 dumped emacs.
4134 (_free_internal_nolock) [CYGWIN]: Ignore requests to free storage
4135 in the static heap.
4136 [CYGWIN] (special_realloc): New function.
4137 (_realloc_internal_nolock) [CYGWIN]: Use the new function on
4138 requests to realloc storage in the static heap.
4139
3ebec551
PE
41402011-08-15 Paul Eggert <eggert@cs.ucla.edu>
4141
4142 * bidi.c (bidi_initialize): Remove unused local.
4143
9fd8be00
EZ
41442011-08-15 Eli Zaretskii <eliz@gnu.org>
4145
6b02f655
SM
4146 * bidimirror.h:
4147 * biditype.h: Remove file.
4148 * makefile.w32-in ($(BLD)/bidi.$(O)):
4149 * deps.mk (bidi.o): Remove biditype.h and bidimirror.h.
474a8465
EZ
4150
4151 * dispextern.h: Fix a typo in the comment to bidi_type_t.
4152
4153 * chartab.c: Improve commentary for the uniprop_table API.
4154
32413314
EZ
4155 * bidi.c (bidi_paragraph_init): Support zero value of
4156 bidi_ignore_explicit_marks_for_paragraph_level.
474a8465
EZ
4157 (bidi_initialize): Use uniprop_table instead of including
4158 biditype.h and bidimirror.h.
32413314 4159
9fd8be00
EZ
4160 * xdisp.c (move_it_in_display_line_to): Don't reset pixel
4161 coordinates of the iterator when restoring from ppos_it.
4162 (Bug#9296)
4163
5cf2b69b
KH
41642011-08-14 Kenichi Handa <handa@m17n.org>
4165
4166 * process.c (create_process): Call setup_process_coding_systems
72ad093b 4167 after the pid of the process is set to -1 (Bug#8162).
5cf2b69b 4168
daf17d00
EZ
41692011-08-14 Eli Zaretskii <eliz@gnu.org>
4170
4171 * xdisp.c (move_it_in_display_line_to): Don't invoke
4172 IT_RESET_X_ASCENT_DESCENT when iterator position was restored from
4173 ppos_it. Fixes vertical cursor motion when line beginning is
4174 covered by an image. (Bug#9296)
4175
08e3161a
JD
41762011-08-14 Jan Djärv <jan.h.d@swipnet.se>
4177
4178 * nsterm.h (ns_run_ascript): Declare.
4179 (NSAPP_DATA2_RUNASSCRIPT): Define.
4180
4181 * nsfns.m (as_script, as_result, as_status): New static variables.
4182 (ns_run_ascript): New function.
5e617bc2 4183 (Fns_do_applescript): Set variables as_*. Make an NSApplicationDefined
08e3161a
JD
4184 event with data2 set to NSAPP_DATA2_RUNASSCRIPT, post it and then start
4185 the event loop. Get status from as_status (Bug#7276).
4186
4187 * nsterm.m (sendEvent): If event is NSApplicationDefined and
4188 data2 is NSAPP_DATA2_RUNASSCRIPT, call ns_run_ascript and then exit
4189 the event loop (Bug#7276).
4190
a3720aa2
AS
41912011-08-14 Andreas Schwab <schwab@linux-m68k.org>
4192
4193 * gnutls.c (QCgnutls_bootprop_priority)
4194 (QCgnutls_bootprop_trustfiles, QCgnutls_bootprop_keylist)
4195 (QCgnutls_bootprop_crlfiles, QCgnutls_bootprop_callbacks)
4196 (QCgnutls_bootprop_loglevel, QCgnutls_bootprop_hostname)
4197 (QCgnutls_bootprop_min_prime_bits, QCgnutls_bootprop_verify_flags)
4198 (QCgnutls_bootprop_verify_hostname_error)
4199 (QCgnutls_bootprop_callbacks_verify): Rename from
4200 Qgnutls_bootprop_..., all uses changed.
4201
4202 * xfaces.c (QCignore_defface): Rename from Qignore_defface, all
4203 uses changed.
4204
0a0d27fb
PE
42052011-08-14 Paul Eggert <eggert@cs.ucla.edu>
4206
19d5c50c
PE
4207 * xfaces.c (Qframe_set_background_mode): Now static.
4208 * dispextern.h (Qframe_set_background_mode): Remove decl.
4209
0a0d27fb
PE
4210 * process.c (Fnetwork_interface_info): Declare local only if needed.
4211
377538cb
JD
42122011-08-13 Jan Djärv <jan.h.d@swipnet.se>
4213
4214 * process.c: Include ifaddrs.h and net/if_dl.h if available (Bug#8477).
4215 (Fnetwork_interface_list): Allocate in increments of bytes instead
4216 of sizeof (struct ifreq). Iterate over ifconf.ifc_req by counting
4217 bytes (Bug#8477). Count bytes correctly when ifr_addr is a struct
4218 sockaddr.
4219 (struct ifflag_def): notrailers is smart on OSX.
4220 (Fnetwork_interface_info): Handle case when ifr_flags is negative.
4221 Get hardware address with getifaddrs if available.
4222
08fff70c
EZ
42232011-08-12 Eli Zaretskii <eliz@gnu.org>
4224
4225 * xdisp.c (iterate_out_of_display_property): xassert that
4226 IT->position is set to within IT->object's boundaries. Break from
4227 the loop as soon as EOB is reached; avoids infloops in redisplay
8b76d6f8
SM
4228 when IT->position is set up wrongly due to some bug.
4229 Set IT->current to match the bidi iterator unconditionally.
08fff70c
EZ
4230 (push_display_prop): Allow GET_FROM_STRING as IT->method on
4231 entry. Force push_it to save on the stack the current
4232 buffer/string position, to be restored by pop_it. Fix flags in
4233 the iterator structure wrt the object coming from a display
4234 property, as `line-prefix' and `wrap-prefix' are not ``replacing''
4235 properties. (Bug#9284)
4236
7be1c708 42372011-08-09 Andreas Schwab <schwab@linux-m68k.org>
aac0c6e3 4238
7be1c708
CY
4239 * fontset.c (fontset_get_font_group): Add proper type checks.
4240 (Bug#9172)
aac0c6e3 4241
7be1c708 42422011-08-09 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
aac0c6e3 4243
7be1c708
CY
4244 * unexmacosx.c (print_load_command_name): Add cases LC_FUNCTION_STARTS
4245 and LC_VERSION_MIN_MACOSX.
4246 (copy_linkedit_data) [LC_FUNCTION_STARTS]: New function.
4247 (dump_it) [LC_FUNCTION_STARTS]: Use it.
aac0c6e3 4248
97bb72a6
EZ
42492011-08-08 Eli Zaretskii <eliz@gnu.org>
4250
4251 * xdisp.c (forward_to_next_line_start): Allow to use the
8b76d6f8
SM
4252 no-display-properties-and-no-overlays under bidi display.
4253 Set disp_pos in the bidi iterator to avoid searches for display
757664a4 4254 properties and overlays.
97bb72a6 4255
d5617611
CY
42562011-08-08 Chong Yidong <cyd@stupidchicken.com>
4257
37e11a63
CY
4258 * editfns.c (Fset_time_zone_rule): Document relationship with the
4259 setenv function.
4260
d5617611
CY
4261 * ftfont.c (ftfont_pattern_entity): Copy the extras argument to
4262 the font entity extracted from the cache (Bug#8109).
4263
58872834
CY
42642011-08-07 Chong Yidong <cyd@stupidchicken.com>
4265
4266 * composite.c (autocmp_chars): Don't reset point. That is done by
4267 restore_point_unwind (Bug#5984).
4268
75bfc667
JL
42692011-08-07 Juri Linkov <juri@jurta.org>
4270
4271 * editfns.c (Fformat_time_string): Doc fix, add tag `usage:'
4272 to show the arg `TIME' instead of `TIMEVAL'.
4273
d1410150
EZ
42742011-08-06 Eli Zaretskii <eliz@gnu.org>
4275
4276 * xdisp.c (set_cursor_from_row): Fix cursor positioning when a
4277 display property strides EOL and includes a newline, as in
4278 longlines-mode. (Bug#9254)
75b771e4
EZ
4279 (move_it_in_display_line_to): Fix vertical-motion in a buffer with
4280 word-wrap under bidirectional display. (Bug#9224)
d1410150
EZ
4281
4282 * bidi.c (bidi_unshelve_cache): Don't reset the cache if JUST_FREE
4283 is non-zero, even if the data buffer is NULL. Fixes a crash in
4284 vertical-motion with longlines-mode. (Bug#9254)
4285
35928349
EZ
42862011-08-05 Eli Zaretskii <eliz@gnu.org>
4287
ec7cc85b
EZ
4288 * bidi.c <bidi_cache_total_alloc>: Now static.
4289 (bidi_initialize): Initialize bidi_cache_total_alloc.
4290
8b76d6f8 4291 * xdisp.c (display_line): Release buffer allocated for shelved bidi
35928349
EZ
4292 cache. (Bug#9221)
4293
4294 * bidi.c (bidi_shelve_cache, bidi_unshelve_cache): Track total
4295 amount allocated this far in `bidi_cache_total_alloc'.
4296 (bidi_unshelve_cache): Accept an additional argument JUST_FREE; if
4297 non-zero, only free the data buffer without restoring the cache
4298 contents. All callers changed.
4299
4300 * dispextern.h (bidi_unshelve_cache): Update prototype.
4301
4302 * xdisp.c (SAVE_IT, pos_visible_p, move_it_in_display_line_to)
4303 (move_it_in_display_line, move_it_to)
4304 (move_it_vertically_backward, move_it_by_lines): Replace the call
4305 to xfree to an equivalent call to bidi_unshelve_cache.
4306 (move_it_in_display_line_to): Fix logic of returning
412b6358 4307 MOVE_POS_MATCH_OR_ZV in the bidi case. (Bug#9224)
35928349 4308
e2e2423b
EZ
43092011-08-05 Eli Zaretskii <eliz@gnu.org>
4310
4311 * xdisp.c (set_cursor_from_row): Prefer the candidate glyph that
4312 came from a string character with a `cursor' property. (Bug#9229)
4313
ae9e757a
JD
43142011-08-04 Jan Djärv <jan.h.d@swipnet.se>
4315
4316 * Makefile.in (LIB_PTHREAD): New variable.
4317 (LIBES): Add LIB_PTHREAD (Bug#9216).
4318
4319 * alloc.c, emacs.c, gmalloc.c, gtkutil.c, keyboard.c, syssignal.h:
4320 Rename HAVE_GTK_AND_PTHREAD to HAVE_PTHREAD (Bug#9216).
4321
213bd7f2
AS
43222011-08-04 Andreas Schwab <schwab@linux-m68k.org>
4323
6b02f655 4324 * regex.c (re_iswctype): Remove some redundant boolean conversions.
213bd7f2 4325
99aaf75f
JD
43262011-08-04 Jan Djärv <jan.h.d@swipnet.se>
4327
4328 * xterm.c (x_find_topmost_parent): New function.
4329 (x_set_frame_alpha): Find topmost parent window with
4330 x_find_topmost_parent and set the property there also (bug#9181).
4331 (handle_one_xevent): Call x_set_frame_alpha on ReparentNotify.
4332
c74e9d86
PE
43332011-08-04 Paul Eggert <eggert@cs.ucla.edu>
4334
4335 * callproc.c (Fcall_process): Avoid vfork clobbering
4336 the local vars buffer, coding_systems, current_dir.
4337
640c8776
SM
43382011-08-03 Stefan Monnier <monnier@iro.umontreal.ca>
4339
4340 * keymap.c (Fmake_composed_keymap): Move to subr.el.
4341
f26d0e4c
PE
43422011-08-03 Paul Eggert <eggert@cs.ucla.edu>
4343
8a10d76c
PE
4344 * fontset.c (dump_fontset) [FONTSET_DEBUG]: Declare EXTERNALLY_VISIBLE
4345 so that it is not optimized away.
4346
f26d0e4c
PE
4347 * xdisp.c (compute_display_string_pos): Remove unused local.
4348
55439c61
EZ
43492011-08-02 Eli Zaretskii <eliz@gnu.org>
4350
4351 Fix slow cursor motion and scrolling in large buffers with
4352 selective display, like Org Mode buffers. (Bug#9218)
4353
4354 * dispextern.h (struct bidi_it): New member disp_prop_p.
4355
4356 * xdisp.c: Remove one-slot cache of display string positions.
4357 (compute_display_string_pos): Accept an additional argument
5e617bc2 4358 DISP_PROP_P; callers changed. Scan at most 5K characters forward
55439c61
EZ
4359 for a display string or property. If found, set DISP_PROP_P
4360 non-zero.
4361
4362 * bidi.c (bidi_fetch_char): Accept an additional argument
640c8776
SM
4363 DISP_PROP_P, and pass it to compute_display_string_pos.
4364 Only handle text covered by a display string if DISP_PROP_P is returned
55439c61
EZ
4365 non-zero. All callers of bidi_fetch_char changed.
4366
fb33fa43
SM
43672011-08-02 Stefan Monnier <monnier@iro.umontreal.ca>
4368
4369 * keymap.c (Fdefine_key): Fix Lisp_Object/int mixup; apply some CSE.
4370
b099e063
DM
43712010-12-03 Don March <don@ohspite.net>
4372
4373 * keymap.c (Fdefine_key): Fix non-prefix key error message when
4374 last character M-[char] is translated to ESC [char] (bug#7541).
4375
5cc7f7af
KH
43762011-08-02 Kenichi Handa <handa@m17n.org>
4377
d0fffa3f 4378 * lisp.h (uniprop_table): Extern it.
5cc7f7af
KH
4379
4380 * chartab.c (uniprop_table): Make it non-static.
4381
525d5e6e
EZ
43822011-08-01 Eli Zaretskii <eliz@gnu.org>
4383
4384 * xdisp.c (forward_to_next_line_start): Accept additional argument
4385 BIDI_IT_PREV, and store into it the state of the bidi iterator had
4386 on the newline.
4387 (reseat_at_next_visible_line_start): Use the bidi iterator state
4388 returned by forward_to_next_line_start to restore the state of
4389 it->bidi_it after backing up to previous newline. (Bug#9212)
4390
31011111
AS
43912011-07-30 Andreas Schwab <schwab@linux-m68k.org>
4392
4393 * regex.c (re_comp): Protoize.
4394 (re_exec): Fix return type.
4395 (regexec): Fix type of `ret'. (Bug#9203)
4396
476371c4
PE
43972011-07-28 Paul Eggert <eggert@cs.ucla.edu>
4398
e5d76069
PE
4399 * image.c (check_image_size): Use 1024x1024 if unknown frame (Bug#9189).
4400 This is needed if max-image-size is a floating-point number.
4401
9a79b20c
AS
44022011-07-28 Andreas Schwab <schwab@linux-m68k.org>
4403
4404 * print.c (print_object): Print empty symbol as ##.
4405
4406 * lread.c (read1): Read ## as empty symbol.
4407
d8c2fa78
AA
44082011-07-28 Alp Aker <alp.tekin.aker@gmail.com>
4409
4410 * nsfns.m (x_set_foreground_color): Set f->foreground_pixel when
4411 setting frame foreground color (Bug#9175).
4412 (x_set_background_color): Likewise.
4413
ffe57a7a
AA
4414 * nsmenu.m (-setText): Size tooltip dimensions precisely to
4415 contents (Bug#9176).
4416 (EmacsTooltip -init): Remove bezels and add shadows to
4417 tooltip windows.
4418
bf3492a5
AA
4419 * nsterm.m (ns_dumpglyphs_stretch): Avoid overwriting left fringe
4420 or scroll bar (Bug#8470).
4421
d55e9c53
AA
4422 * nsfont.m (nsfont_open): Remove assignment to voffset and
4423 unnecessary vars hshink, expand, hd, full_height, min_height.
4424 (nsfont_draw): Use s->ybase as baseline for glyph drawing (Bug#8913).
4425
4426 * nsterm.h (nsfont_info): Remove voffset field.
4427
d8c2fa78 44282011-07-28 Alp Aker <alp.tekin.aker@gmail.com>
4843aac3
AA
4429
4430 Implement strike-through and overline on NextStep (Bug#8863).
4431
4432 * nsfont.m (nsfont_open): Use underline position provided by font,
4433 instead of hard-coded value of 2.
4434 (nsfont_draw): Call ns_draw_text_decoration instead.
4435
4436 * nsterm.h: Add declaration for ns_draw_text_decoration.
4437
4438 * nsterm.m (ns_draw_text_decoration): New function for drawing
4439 underline, overline, and strike-through.
4440 (ns_dumpglyphs_image, ns_dumpglyphs_stretch): Add call to
4441 ns_draw_text_decoration. Change treatment of cursor drawing to
8d5ed899 4442 accommodate underlining, etc.
4843aac3 4443
4cc60b9b
EZ
44442011-07-28 Eli Zaretskii <eliz@gnu.org>
4445
bc7ece87
EZ
4446 * buffer.c (init_buffer_once): Set bidi-display-reordering to t by
4447 default.
4cc60b9b 4448
476371c4
PE
44492011-07-28 Paul Eggert <eggert@cs.ucla.edu>
4450
66606eea
PE
4451 * alloc.c (memory_full) [!SYNC_INPUT]: Fix signal-related race.
4452 Without this fix, if a signal arrives just after memory fills up,
4453 'malloc' might be invoked reentrantly.
4454
476371c4
PE
4455 * image.c (x_check_image_size) [!HAVE_X_WINDOWS]: Return 1.
4456 In other words, assume that every image size is allowed, on non-X
4457 hosts. This assumption is probably wrong, but it lets Emacs compile.
4458
f3fcc40d
AS
44592011-07-28 Andreas Schwab <schwab@linux-m68k.org>
4460
4461 * regex.c (re_iswctype): Convert return values to boolean.
4462
350c992f
EZ
44632011-07-28 Eli Zaretskii <eliz@fencepost.gnu.org>
4464
4465 * xdisp.c (compute_display_string_pos): Don't use cached display
4466 string position if the buffer had its restriction changed.
4467 (Bug#9184)
4468
5266b4bb
PE
44692011-07-28 Paul Eggert <eggert@cs.ucla.edu>
4470
4471 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork clobbering.
4472
2573a837 44732011-07-28 Paul Eggert <eggert@cs.ucla.edu>
ca4aa935 4474
41f55ccd 4475 Integer signedness and overflow and related fixes. (Bug#9079)
cf950e6b 4476
39e378da
PE
4477 * bidi.c: Integer size and overflow fixes.
4478 (bidi_cache_size, bidi_cache_idx, bidi_cache_last_idx)
4479 (bidi_cache_start, bidi_cache_fetch_state, bidi_cache_search)
4480 (bidi_cache_find_level_change, bidi_cache_ensure_space)
4481 (bidi_cache_iterator_state, bidi_cache_find, bidi_cache_start_stack)
4482 (bidi_find_other_level_edge):
4483 Use ptrdiff_t instead of EMACS_INT where either will do.
4484 This works better on 32-bit hosts configured --with-wide-int.
4485 (bidi_cache_ensure_space): Check for size-calculation overflow.
4486 Use % rather than repeated addition, for better worst-case speed.
4487 Don't set bidi_cache_size until after xrealloc returns, because it
4488 might not return.
4489 (bidi_dump_cached_states): Use ptrdiff_t, not int, to avoid overflow.
f0eb61e9
PE
4490 (bidi_cache_ensure_space): Also check that the bidi cache size
4491 does not exceed that of the largest Lisp string or buffer. See Eli
4492 Zaretskii in <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9079#29>.
39e378da 4493
5e927815
PE
4494 * alloc.c (__malloc_size_t): Remove.
4495 All uses replaced by size_t. See Andreas Schwab's note
4496 <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9079#8>.
4497
ca4aa935
PE
4498 * image.c: Improve checking for integer overflow.
4499 (check_image_size): Assume that f is nonnull, since
4500 it is always nonnull in practice. This is one less thing to
4501 worry about when checking for integer overflow later.
4502 (x_check_image_size): New function, which checks for integer
4503 overflow issues inside X.
4504 (x_create_x_image_and_pixmap, xbm_read_bitmap_data): Use it.
4505 This removes the need for a memory_full check.
4506 (xbm_image_p): Rewrite to avoid integer multiplication overflow.
4507 (Create_Pixmap_From_Bitmap_Data, xbm_load): Use x_check_image_size.
4508 (xbm_read_bitmap_data): Change locals back to 'int', since
4509 their values must fit in 'int'.
4510 (xpm_load_image, png_load, tiff_load):
4511 Invoke x_create_x_image_and_pixmap earlier,
4512 to avoid much needless work if the image is too large.
4513 (tiff_load): Treat overly large images as if
4514 x_create_x_image_and_pixmap failed, not as malloc failures.
4515 (gs_load): Use x_check_image_size.
4516
5f8f9cc2
PE
4517 * gtkutil.c: Omit integer casts.
4518 (xg_get_pixbuf_from_pixmap): Remove unnecessary cast.
4519 (xg_set_toolkit_scroll_bar_thumb): Rewrite to avoid need for cast.
4520
5adf60bc
PE
4521 * image.c (png_load): Don't assume height * row_bytes fits in 'int'.
4522
c8907a93
PE
4523 * xfaces.c (Fbitmap_spec_p): Fix integer overflow bug.
4524 Without this fix, (bitmap-spec-p '(34359738368 1 "x"))
4525 would wrongly return t on a 64-bit host.
4526
e3c25c68
PE
4527 * dispnew.c (init_display): Use *_RANGE_OVERFLOW macros.
4528 The plain *_OVERFLOW macros run afoul of GCC bug 49705
4529 <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49705>
4530 and therefore cause GCC to emit a bogus diagnostic in some cases.
4531
3f791afe
PE
4532 * image.c: Integer signedness and overflow and related fixes.
4533 This is not an exhaustive set of fixes, but it's time to
4534 record what I've got.
4535 (lookup_pixel_color, check_image_size): Remove redundant decls.
4536 (check_image_size): Don't assume that arbitrary EMACS_INT values
4537 fit in 'int', or that arbitrary 'double' values fit in 'int'.
4538 (x_alloc_image_color, x_create_x_image_and_pixmap, png_load)
4539 (tiff_load, imagemagick_load_image):
4540 Check for overflow in size calculations.
4541 (x_create_x_image_and_pixmap): Remove unnecessary test for
4542 xmalloc returning NULL; that can't happen.
4543 (xbm_read_bitmap_data): Don't assume sizes fit into 'int'.
4544 (xpm_color_bucket): Use better integer hashing function.
4545 (xpm_cache_color): Don't possibly over-allocate memory.
4546 (struct png_memory_storage, tiff_memory_source, tiff_seek_in_memory)
4547 (gif_memory_source):
4548 Use ptrdiff_t, not int or size_t, to record sizes.
4549 (png_load): Don't assume values greater than 2**31 fit in 'int'.
4550 (our_stdio_fill_input_buffer): Prefer ptrdiff_t to size_t when
4551 either works, as we prefer signed integers.
4552 (tiff_read_from_memory, tiff_write_from_memory):
4553 Return tsize_t, not size_t, since that's what the TIFF API wants.
4554 (tiff_read_from_memory): Don't fail simply because the read would
4555 go past EOF; instead, return a short read.
4556 (tiff_load): Omit no-longer-needed casts.
4557 (Fimagemagick_types): Don't assume size fits into 'int'.
4558
3cc5a532
PE
4559 Improve hashing quality when configured --with-wide-int.
4560 * fns.c (hash_string): New function, taken from sxhash_string.
4561 Do not discard information about ASCII character case; this
4562 discarding is no longer needed.
4563 (sxhash-string): Use it. Change sig to match it. Caller changed.
4564 * lisp.h: Declare it.
4565 * lread.c (hash_string): Remove, since we now use fns.c's version.
4566 The fns.c version returns a wider integer if --with-wide-int is
4567 specified, so this should help the quality of the hashing a bit.
4568
b312a492
PE
4569 * emacs.c: Integer overflow minor fix.
4570 (heap_bss_diff): Now uprintmax_t, not unsigned long. All used changed.
4571 Define only if GNU_LINUX.
4572 (main, Fdump_emacs): Set and use heap_bss_diff only if GNU_LINUX.
4573
dfd153ae
PE
4574 * dispnew.c: Integer signedness and overflow fixes.
4575 Remove unnecessary forward decls, that were a maintenance hassle.
4576 (history_tick): Now uprintmax_t, so it's more likely to avoid overflow.
4577 All uses changed.
4578 (adjust_glyph_matrix, realloc_glyph_pool, adjust_frame_message_buffer)
4579 (scrolling_window): Use ptrdiff_t, not int, for byte count.
4580 (prepare_desired_row, line_draw_cost):
4581 Use int, not unsigned, where either works.
4582 (save_current_matrix, restore_current_matrix):
4583 Use ptrdiff_t, not size_t, where either works.
4584 (init_display): Check for overflow more accurately, and without
4585 relying on undefined behavior.
4586
a81d11a3
PE
4587 * editfns.c (pWIDE, pWIDElen, signed_wide, unsigned_wide):
4588 Remove, replacing with the new symbols in lisp.h. All uses changed.
4589 * fileio.c (make_temp_name):
4590 * filelock.c (lock_file_1, lock_file):
4591 * xdisp.c (message_dolog):
4592 Don't assume PRIdMAX etc. works; this isn't portable to pre-C99 hosts.
4593 Use pMd etc. instead.
4594 * lisp.h (printmax_t, uprintmax_t, pMd, pMu): New types and macros,
4595 replacing the pWIDE etc. symbols removed from editfns.c.
4596
3300e6fd
PE
4597 * keyboard.h (num_input_events): Now uintmax_t.
4598 This is (very slightly) less likely to mess up due to wraparound.
4599 All uses changed.
4600
fd05c7e9
PE
4601 * buffer.c: Integer signedness fixes.
4602 (alloc_buffer_text, enlarge_buffer_text):
4603 Use ptrdiff_t rather than size_t when either will do, as we prefer
4604 signed integers.
4605
903fe15d
PE
4606 * alloc.c: Integer signedness and overflow fixes.
4607 Do not impose an arbitrary 32-bit limit on malloc sizes when debugging.
4608 (__malloc_size_t): Default to size_t, not to int.
4609 (pure_size, pure_bytes_used_before_overflow, stack_copy_size)
4610 (Fgarbage_collect, mark_object_loop_halt, mark_object):
4611 Prefer ptrdiff_t to size_t when either would do, as we prefer
4612 signed integers.
4613 (XMALLOC_OVERRUN_CHECK_OVERHEAD): New macro.
4614 (xmalloc_overrun_check_header, xmalloc_overrun_check_trailer):
4615 Now const. Initialize with values that are in range even if char
4616 is signed.
4617 (XMALLOC_PUT_SIZE, XMALLOC_GET_SIZE): Remove, replacing with ...
4618 (xmalloc_put_size, xmalloc_get_size): New functions. All uses changed.
4619 These functions do the right thing with sizes > 2**32.
4620 (check_depth): Now ptrdiff_t, not int.
4621 (overrun_check_malloc, overrun_check_realloc, overrun_check_free):
4622 Adjust to new way of storing sizes. Check for size overflow bugs
4623 in rest of code.
4624 (STRING_BYTES_MAX): Adjust to new overheads. The old code was
4625 slightly wrong anyway, as it missed one instance of
4626 XMALLOC_OVERRUN_CHECK_OVERHEAD.
4627 (refill_memory_reserve): Omit needless cast to size_t.
4628 (mark_object_loop_halt): Mark as externally visible.
4629
ac82cc6a
PE
4630 * xselect.c: Integer signedness and overflow fixes.
4631 (Fx_register_dnd_atom, x_handle_dnd_message):
4632 Use ptrdiff_t, not size_t, since we prefer signed.
4633 (Fx_register_dnd_atom): Check for ptrdiff_t (and size_t) overflow.
4634 * xterm.h (struct x_display_info): Use ptrdiff_t, not size_t, for
4635 x_dnd_atoms_size and x_dnd_atoms_length.
4636
c2d1e36d
PE
4637 * doprnt.c: Prefer signed to unsigned when either works.
4638 * eval.c (verror):
4639 * doprnt.c (doprnt):
4640 * lisp.h (doprnt):
4641 * xdisp.c (vmessage):
4642 Use ptrdiff_t, not size_t, when using or implementing doprnt,
4643 since the sizes cannot exceed ptrdiff_t bounds anyway, and we
4644 prefer signed arithmetic to avoid comparison confusion.
4645 * doprnt.c (doprnt): Avoid a "+ 1" that can't overflow,
4646 but is a bit tricky.
4647
0e926e56
PE
4648 Assume freestanding C89 headers, string.h, stdlib.h.
4649 * data.c, doprnt.c, floatfns.c, print.c:
4650 Include float.h unconditionally.
4651 * gmalloc.c: Assume C89-at-least behavior for preprocessor,
4652 limits.h, stddef.h, string.h. Use memset instead of 'flood'.
4653 * regex.c: Likewise for stddef.h, string.h.
4654 (ISASCII): Remove; can assume it returns 1 now. All uses removed.
4655 * s/aix4-2.h (HAVE_STRING_H): Remove obsolete undef.
4656 * s/ms-w32.h (HAVE_LIMITS_H, HAVE_STRING_H, HAVE_STDLIB_H)
4657 (STDC_HEADERS): Remove obsolete defines.
4658 * sysdep.c: Include limits.h unconditionally.
4659
9cfdb3ec
PE
4660 Assume support for memcmp, memcpy, memmove, memset.
4661 * lisp.h, sysdep.c (memcmp, memcpy, memmove, memset):
4662 * regex.c (memcmp, memcpy):
4663 Remove; we assume C89 now.
4664
4665 * gmalloc.c (memcpy, memset, memmove): Remove; we assume C89 now.
4666 (__malloc_safe_bcopy): Remove; no longer needed.
4667
cf950e6b 4668 * lisp.h (struct vectorlike_header, struct Lisp_Subr): Signed sizes.
6089c567
PE
4669 Use EMACS_INT, not EMACS_UINT, for sizes. The code works equally
4670 well either way, and we prefer signed to unsigned.
4671
dbf38e02
LMI
46722011-07-27 Lars Magne Ingebrigtsen <larsi@gnus.org>
4673
4674 * gnutls.c (emacs_gnutls_read): Don't message anything if the peer
4675 closes the connection while we're reading (bug#9182).
4676
d6f0886c 46772011-07-25 Jan Djärv <jan.h.d@swipnet.se>
24e0f6b1 4678
d6f0886c
JD
4679 * nsmenu.m (ns_popup_dialog): Add an "ok" button if no buttons
4680 are specified (Bug#9168).
24e0f6b1 4681
2eb1f9e6
PE
46822011-07-25 Paul Eggert <eggert@cs.ucla.edu>
4683
4684 * bidi.c (bidi_dump_cached_states): Fix printf format mismatch.
4685 Found by GCC static checking and --with-wide-int on a 32-bit host.
4686
22381272 46872011-07-25 Eli Zaretskii <eliz@gnu.org>
7daee910
EZ
4688
4689 * xdisp.c (compute_display_string_pos): Fix logic of caching
4690 previous display string position. Initialize cached_prev_pos to
4691 -1. Fixes slow-down at the beginning of a buffer.
4692
f25e39b4
EZ
46932011-07-24 Eli Zaretskii <eliz@gnu.org>
4694
4695 * xfaces.c (check_lface_attrs) [HAVE_WINDOW_SYSTEM]: Allow `nil'
4696 for attrs[LFACE_FONTSET_INDEX].
4697
04c4b52e
PE
46982011-07-23 Paul Eggert <eggert@cs.ucla.edu>
4699
4700 * xml.c (parse_region): Remove unused local
4701 that was recently introduced.
4702
c1734fbd
EZ
47032011-07-23 Eli Zaretskii <eliz@gnu.org>
4704
be18c5a5
EZ
4705 * xfns.c (unwind_create_frame) [GLYPH_DEBUG]: Adapt to changes in
4706 2008-02-22T17:42:09Z!monnier@iro.umontreal.ca.
4707
c1734fbd
EZ
4708 * xdisp.c (move_it_in_display_line_to): Record the best matching
4709 position for TO_CHARPOS while scanning the line, and restore it on
640c8776
SM
4710 exit if none of the characters scanned was an exact match.
4711 Fixes vertical-motion and pos-visible-in-window-p under bidi redisplay
a9269c18
EZ
4712 when exact match is impossible due to invisible text, and the
4713 lines are truncated.
4714
a258d627
JD
47152011-07-23 Jan Djärv <jan.h.d@swipnet.se>
4716
4717 * nsterm.m (initFrameFromEmacs): Set NSTitledWindowMask in styleMask
4718 for OSX >= 10.7.
4719
b6d5a689
EZ
47202011-07-22 Eli Zaretskii <eliz@gnu.org>
4721
0f74f785
EZ
4722 Fix a significant slow-down of cursor motion with C-n, C-p,
4723 C-f/C-b, and C-v/M-v that couldn't keep up with keyboard
4724 auto-repeat under bidi redisplay in fontified buffers.
b6d5a689 4725 * xdisp.c (compute_stop_pos_backwards): New function.
b6d5a689
EZ
4726 (next_element_from_buffer): Call compute_stop_pos_backwards to
4727 find a suitable prev_stop when we find ourselves before
0f74f785
EZ
4728 base_level_stop.
4729 (reseat): Don't look for prev_stop, as that could mean a very long
4730 run.
4731 <cached_disp_pos, cached_disp_buffer, cached_disp_modiff>
4732 <cached_disp_overlay_modiff>: Cache for last found display string
4733 position.
551918c1 4734 (compute_display_string_pos): Return the cached position if asked
0f74f785
EZ
4735 about the same buffer in the same area of character positions, and
4736 the buffer wasn't changed since the time the display string
4737 position was cached.
551918c1 4738
b2d0c91a
EZ
47392011-07-22 Eli Zaretskii <eliz@gnu.org>
4740
4741 * xdisp.c (rows_from_pos_range): Don't ignore glyphs whose object
4742 is an integer, which is important for empty lines. (Bug#9149)
4743
043604ee
CY
47442011-07-22 Chong Yidong <cyd@stupidchicken.com>
4745
4746 * frame.c (Fmodify_frame_parameters): In tty case, update the
4747 default face if necessary (Bug#4238).
4748
da4adb04
CY
47492011-07-21 Chong Yidong <cyd@stupidchicken.com>
4750
4751 * editfns.c (Fstring_to_char): No need to explain what a character
4752 is in the docstring (Bug#6576).
4753
9abd0532
LMI
47542011-07-20 Lars Magne Ingebrigtsen <larsi@gnus.org>
4755
4756 * xml.c (parse_region): Make sure we always return a tree.
4757
36881d16
HK
47582011-07-20 HAMANO Kiyoto <khiker.mail@gmail.com>
4759
4760 * xml.c (parse_region): If a document contains only comments,
4761 return that, too.
4762
1e98674d
LMI
47632011-07-20 Lars Magne Ingebrigtsen <larsi@gnus.org>
4764
4765 * xml.c (make_dom): Return comments, too.
4766
590bd467
PE
47672011-07-19 Paul Eggert <eggert@cs.ucla.edu>
4768
4769 Port to OpenBSD.
4770 See http://lists.gnu.org/archive/html/emacs-devel/2011-07/msg00688.html
4771 and the surrounding thread.
4772 * minibuf.c (read_minibuf_noninteractive): Rewrite to use getchar
4773 rather than fgets, and retry after EINTR. Otherwise, 'emacs
4774 --batch -f byte-compile-file' fails on OpenBSD if an inactivity
4775 timer goes off.
4776 * s/openbsd.h (BROKEN_SIGIO): Define.
4777 * unexelf.c (unexec) [__OpenBSD__]:
4778 Don't update the .mdebug section of the Alpha COFF symbol table.
4779
f41628b2
LMI
47802011-07-19 Lars Magne Ingebrigtsen <larsi@gnus.org>
4781
4782 * lread.c (syms_of_lread): Clarify when `lexical-binding' is used
4783 (bug#8460).
4784
b59b67c5
PE
47852011-07-18 Paul Eggert <eggert@cs.ucla.edu>
4786
15e3a074
PE
4787 * fileio.c (Fcopy_file) [!MSDOS]: Tighten created file's mask.
4788 This fixes some race conditions on the permissions of any newly
4789 created file.
4790
41bed37d
PE
4791 * alloc.c (valid_pointer_p): Use pipe, not open.
4792 This fixes some permissions issues when debugging.
4793
b59b67c5
PE
4794 * fileio.c (Fcopy_file): Adjust mode if fchown fails. (Bug#9002)
4795 If fchown fails to set both uid and gid, try to set just gid,
4796 as that is sometimes allowed. Adjust the file's mode to eliminate
4797 setuid or setgid bits that are inappropriate if fchown fails.
4798
925a6be7
SM
47992011-07-18 Stefan Monnier <monnier@iro.umontreal.ca>
4800
4801 * xdisp.c (next_element_from_string, next_element_from_buffer): Use EQ
4802 to compare Lisp_Objects.
4803 * gnutls.c (syms_of_gnutls): Rename Vgnutls_log_level to
4804 global_gnutls_log_level, don't mistake it for a Lisp_Object.
4805 (init_gnutls_functions, emacs_gnutls_handle_error): Fix up uses.
4806
52968808
AS
48072011-07-17 Andreas Schwab <schwab@linux-m68k.org>
4808
0a6a104b
AS
4809 * lread.c (read_integer): Unread even EOF character.
4810 (read1): Likewise. Properly record start position of symbol.
4811
52968808
AS
4812 * lread.c (read1): Read `#:' as empty uninterned symbol if no
4813 symbol character follows.
4814
9e381cdd
PE
48152011-07-17 Paul Eggert <eggert@cs.ucla.edu>
4816
4817 * fileio.c (Fcopy_file): Pacify gcc re fchown. (Bug#9002)
4818 This works around a problem with the previous change to Fcopy_file.
4819 Recent glibc declares fchown with __attribute__((warn_unused_result)),
4820 and without this change, GCC might complain about discarding
4821 fchown's return value.
4822
b5641435
JB
48232011-07-16 Juanma Barranquero <lekktu@gmail.com>
4824
4825 * makefile.w32-in (GLOBAL_SOURCES): Add gnutls.c (followup to bug#9059).
4826
a8031457
PE
48272011-07-16 Paul Eggert <eggert@cs.ucla.edu>
4828
4829 * fileio.c (Fcopy_file): Don't diagnose fchown failures. (Bug#9002)
4830
dd889327
LMI
48312011-07-16 Lars Magne Ingebrigtsen <larsi@gnus.org>
4832
750c33f7
LMI
4833 * gnutls.c (syms_of_gnutls): Define `gnutls-log-level' here, since
4834 it's used from the C level.
4835
dd889327
LMI
4836 * process.c: Use the same condition for POLL_FOR_INPUT in both
4837 keyboard.c and process.c (bug#1858).
4838
87e86684
LM
48392011-07-09 Lawrence Mitchell <wence@gmx.li>
4840
4841 * gnutls.c (Qgnutls_bootprop_min_prime_bits): New variable.
4842 (Fgnutls_boot): Use it.
4843
64348f40
AS
48442011-07-15 Andreas Schwab <schwab@linux-m68k.org>
4845
4846 * doc.c (Fsubstitute_command_keys): Revert last change.
4847
1d698799
LMI
48482011-07-15 Lars Magne Ingebrigtsen <larsi@gnus.org>
4849
f863868c
LMI
4850 * doc.c (Fsubstitute_command_keys): Clarify that \= really only
4851 quotes the next character, and doesn't affect other longer
4852 sequences (bug#8935).
4853
1d698799
LMI
4854 * lread.c (syms_of_lread): Clarify that is isn't only
4855 `eval-buffer' and `eval-defun' that's affected by
4856 `lexical-binding' (bug#8460).
4857
aa4b6df6
EZ
48582011-07-15 Eli Zaretskii <eliz@gnu.org>
4859
4860 * xdisp.c (move_it_in_display_line_to): Fix vertical motion with
6b02f655 4861 bidi redisplay when a line includes both an image and is truncated.
aa4b6df6 4862
5d856da6
PE
48632011-07-14 Paul Eggert <eggert@cs.ucla.edu>
4864
ad6042bb
PE
4865 Fix minor problems found by static checking.
4866 * bidi.c (bidi_cache_size): Now EMACS_INT, not size_t.
4867 (elsz): Now a signed constant, not a size_t var. We prefer signed
4868 types to unsigned, to avoid integer comparison confusion. Without
4869 this change, GCC 4.6.1 with -Wunsafe-loop-optimizations complains
4870 "cannot optimize loop, the loop counter may overflow", a symptom
4871 of the confusion.
f00bbb22 4872 * indent.c (Fvertical_motion): Mark locals as initialized.
5d856da6
PE
4873 * xdisp.c (reseat_to_string): Fix pointer signedness issue.
4874
6468f31c
LMI
48752011-07-14 Lars Magne Ingebrigtsen <larsi@gnus.org>
4876
49080b10
LMI
4877 * search.c (Fre_search_backward): Mention `case-fold-search' in
4878 all the re_search_* functions (bug#8138).
4879
6468f31c
LMI
4880 * keyboard.c (Fopen_dribble_file): Document when the file is
4881 closed (bug#8056).
4882
c965adc5
EZ
48832011-07-14 Eli Zaretskii <eliz@gnu.org>
4884
df9733bf
EZ
4885 * bidi.c (bidi_dump_cached_states): Fix format of displaying
4886 bidi_cache_idx.
4887
0bb23927
EZ
4888 Support bidi reordering of display and overlay strings.
4889 * xdisp.c (compute_display_string_pos)
4890 (compute_display_string_end): Accept additional argument STRING.
4891 (init_iterator, reseat_1): Initialize bidi_it->string.s to NULL.
4892 (reseat_to_string): Initialize bidi_it->string.s and
4893 bidi_it->string.schars.
4894 (Fcurrent_bidi_paragraph_direction): Initialize itb.string.s to
640c8776
SM
4895 NULL (avoids a crash in bidi_paragraph_init).
4896 Initialize itb.string.lstring.
0bb23927
EZ
4897 (init_iterator): Call bidi_init_it only of a valid
4898 buffer position was specified. Initialize paragraph_embedding to
4899 L2R.
4900 (reseat_to_string): Initialize the bidi iterator.
4901 (display_string): If we need to ignore text properties of
4902 LISP_STRING, set IT->stop_charpos to IT->end_charpos. (The
4903 original value of -1 will not work with bidi.)
4904 (compute_display_string_pos): First arg is now struct
4905 `text_pos *'; all callers changed. Support display properties on
4906 Lisp strings.
4907 (compute_display_string_end): Support display properties on Lisp
4908 strings.
4909 (init_iterator, reseat_1, reseat_to_string): Initialize the
4910 string.bufpos member to 0 (zero, for compatibility with IT_CHARPOS
4911 when iterating on a string not from display properties).
640c8776
SM
4912 (compute_display_string_pos, compute_display_string_end):
4913 Fix calculation of the object to scan. Fixes an error when using
0bb23927
EZ
4914 arrow keys.
4915 (next_element_from_buffer): Don't abort when IT_CHARPOS is before
640c8776
SM
4916 base_level_stop; instead, set base_level_stop to BEGV.
4917 Fixes crashes in vertical-motion.
0bb23927
EZ
4918 (next_element_from_buffer): Improve commentary for when
4919 the iterator is before prev_stop.
4920 (init_iterator): Initialize bidi_p from the default value of
4921 bidi-display-reordering, not from buffer-local value. Use the
4922 buffer-local value only if initializing for buffer iteration.
4923 (handle_invisible_prop): Support invisible properties on strings
4924 that are being bidi-reordered.
4925 (set_iterator_to_next): Support bidi reordering of C strings and
4926 Lisp strings.
4927 (next_element_from_string): Support bidi reordering of Lisp
4928 strings.
4929 (handle_stop_backwards): Support Lisp strings as well.
640c8776
SM
4930 (display_string): Support display of R2L glyph rows.
4931 Use IT_STRING_CHARPOS when displaying from a Lisp string.
0bb23927
EZ
4932 (init_iterator): Don't initialize it->bidi_p for strings
4933 here.
4934 (reseat_to_string): Initialize it->bidi_p for strings here.
4935 (next_element_from_string, next_element_from_c_string)
4936 (next_element_from_buffer): Add xassert's for correspondence
4937 between IT's object being iterated and it->bidi_it.string
4938 structure.
4939 (face_before_or_after_it_pos): Support bidi iteration.
4940 (next_element_from_c_string): Handle the case of the first string
4941 character that is not the first one in the visual order.
4942 (get_visually_first_element): New function, refactored from common
4943 parts of next_element_from_buffer, next_element_from_string, and
4944 next_element_from_c_string.
4945 (tool_bar_lines_needed, redisplay_tool_bar)
4946 (display_menu_bar): Force left-to-right direction. Add a FIXME
4947 comment for making that be controlled by a user option.
4948 (push_it, pop_it): Save and restore the state of the
4949 bidi iterator. Save and restore the bidi_p flag.
4950 (pop_it): Iterate out of display property for string iteration as
4951 well.
4952 (iterate_out_of_display_property): Support iteration over strings.
4953 (handle_single_display_spec): Set up it->bidi_it for iteration
4954 over a display string, and call bidi_init_it.
4955 (handle_single_display_spec, next_overlay_string)
4956 (get_overlay_strings_1, push_display_prop): Set up the bidi
4957 iterator for displaying display or overlay strings.
4958 (forward_to_next_line_start): Don't use the shortcut if
4959 bidi-iterating.
4960 (back_to_previous_visible_line_start): If handle_display_prop
4961 pushed the iterator stack, restore the internal state of the bidi
4962 iterator by calling bidi_pop_it same number of times.
4963 (reseat_at_next_visible_line_start): If ON_NEWLINE_P is non-zero,
4964 and we are bidi-iterating, don't decrement the iterator position;
4965 instead, set the first_elt flag in the bidi iterator, to produce
4966 the same effect.
4967 (reseat_1): Remove redundant setting of string_from_display_prop_p.
4968 (push_display_prop): xassert that we are iterating a buffer.
4969 (push_it, pop_it): Save and restore paragraph_embedding member.
4970 (handle_single_display_spec, next_overlay_string)
4971 (get_overlay_strings_1, reseat_1, reseat_to_string)
4972 (push_display_prop): Set up the `unibyte' member of bidi_it.string
4973 correctly. Don't assume unibyte strings are not bidi-reordered.
4974 (compute_display_string_pos)
4975 (compute_display_string_end): Fix handling the case of C string.
4976 (push_it, pop_it): Save and restore from_disp_prop_p.
4977 (handle_single_display_spec, push_display_prop): Set the
4978 from_disp_prop_p flag.
4979 (get_overlay_strings_1): Reset the from_disp_prop_p flag.
4980 (pop_it): Call iterate_out_of_display_property only if we are
4981 popping after iteration over a string that came from a display
4982 property. Fix a typo in popping stretch info. Add an assertion
4983 for verifying that the iterator position is in sync with the bidi
4984 iterator.
4985 (handle_single_display_spec, get_overlay_strings_1)
4986 (push_display_prop): Fix initialization of paragraph direction for
4987 string when that of the parent object is not yet determined.
4988 (reseat_1): Call bidi_init_it to resync the bidi
4989 iterator with IT's position. (Bug#7616)
4990 (find_row_edges): If ROW->start.pos gives position
4991 smaller than min_pos, use it as ROW->minpos. (Bug#7616)
4992 (handle_stop, back_to_previous_visible_line_start, reseat_1):
4993 Reset the from_disp_prop_p flag.
4994 (SAVE_IT, RESTORE_IT): New macros.
4995 (pos_visible_p, face_before_or_after_it_pos)
4996 (back_to_previous_visible_line_start)
4997 (move_it_in_display_line_to, move_it_in_display_line)
4998 (move_it_to, move_it_vertically_backward, move_it_by_lines)
4999 (try_scrolling, redisplay_window, display_line): Use them when
5000 saving a temporary copy of the iterator and restoring it back.
5001 (back_to_previous_visible_line_start, reseat_1)
5002 (init_iterator): Empty the bidi cache "stack".
5003 (move_it_in_display_line_to): If iterator ended up at
5004 EOL, but we never saw any buffer positions smaller than
5005 to_charpos, return MOVE_POS_MATCH_OR_ZV. Fixes vertical cursor
5006 motion in bidi-reordered lines.
5007 (move_it_in_display_line_to): Record prev_method and prev_pos
5008 immediately before the call to set_iterator_to_next. Fixes cursor
5009 motion in bidi-reordered lines with stretch glyphs and strings
5010 displayed in margins. (Bug#8133) (Bug#8867)
5011 Return MOVE_POS_MATCH_OR_ZV only if iterator position is past
5012 TO_CHARPOS.
640c8776
SM
5013 (pos_visible_p): Support positions in bidi-reordered lines.
5014 Save and restore bidi cache.
0bb23927
EZ
5015
5016 * bidi.c (bidi_level_of_next_char): clen should be EMACS_NT, not int.
5017 (bidi_paragraph_info): Delete unused struct.
5018 (bidi_cache_idx, bidi_cache_last_idx): Declare EMACS_INT.
5019 (bidi_cache_start): New variable.
5020 (bidi_cache_reset): Reset bidi_cache_idx to bidi_cache_start, not
5021 to zero.
5022 (bidi_cache_fetch_state, bidi_cache_search)
5023 (bidi_cache_find_level_change, bidi_cache_iterator_state)
5024 (bidi_cache_find, bidi_peek_at_next_level)
5025 (bidi_level_of_next_char, bidi_find_other_level_edge)
5026 (bidi_move_to_visually_next): Compare cache index with
5027 bidi_cache_start rather than with zero.
5028 (bidi_fetch_char): Accept new argument STRING; all callers
5029 changed. Support iteration over a string. Support strings with
5030 display properties. Support unibyte strings. Fix the type of
5031 `len' according to what STRING_CHAR_AND_LENGTH expects.
5032 (bidi_paragraph_init, bidi_resolve_explicit_1)
5033 (bidi_resolve_explicit, bidi_resolve_weak)
640c8776
SM
5034 (bidi_level_of_next_char, bidi_move_to_visually_next):
5035 Support iteration over a string.
0bb23927
EZ
5036 (bidi_set_sor_type, bidi_resolve_explicit_1)
5037 (bidi_resolve_explicit, bidi_type_of_next_char): ignore_bn_limit
5038 can now be zero (for strings); special values 0 and -1 were
5039 changed to -1 and -2, respectively.
5040 (bidi_char_at_pos): New function.
5041 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak):
5042 Call it instead of FETCH_MULTIBYTE_CHAR.
5043 (bidi_move_to_visually_next): Abort if charpos or bytepos were not
5044 initialized to valid values.
5045 (bidi_init_it): Don't initialize charpos and bytepos with invalid
5046 values.
5047 (bidi_level_of_next_char): Allow the sentinel "position" to pass
5048 the test for valid cached positions. Fix the logic for looking up
5049 the sentinel state in the cache. GCPRO the Lisp string we are
5050 iterating.
5051 (bidi_push_it, bidi_pop_it): New functions.
5052 (bidi_initialize): Initialize the bidi cache start stack pointer.
5053 (bidi_cache_ensure_space): New function, refactored from part of
5054 bidi_cache_iterator_state. Don't assume the required size is just
5055 one BIDI_CACHE_CHUNK away.
5056 (bidi_cache_start_stack, bidi_push_it): Use IT_STACK_SIZE.
5057 (bidi_count_bytes, bidi_char_at_pos): New functions.
5058 (bidi_cache_search): Don't assume bidi_cache_last_idx is
5059 always valid if bidi_cache_idx is valid.
5060 (bidi_cache_find_level_change): xassert that bidi_cache_last_idx
5061 is valid if it's going to be used.
5062 (bidi_shelve_cache, bidi_unshelve_cache): New functions.
5063 (bidi_cache_fetch_state, bidi_cache_search)
c965adc5
EZ
5064 (bidi_cache_find_level_change, bidi_cache_ensure_space)
5065 (bidi_cache_iterator_state, bidi_cache_find)
640c8776
SM
5066 (bidi_find_other_level_edge, bidi_cache_start_stack):
5067 All variables related to cache indices are now EMACS_INT.
c965adc5 5068
0bb23927
EZ
5069 * dispextern.h (struct bidi_string_data): New structure.
5070 (struct bidi_it): New member `string'. Make flag members be 1-bit
5071 fields, and put them last in the struct.
640c8776
SM
5072 (compute_display_string_pos, compute_display_string_end):
5073 Update prototypes.
0bb23927
EZ
5074 (bidi_push_it, bidi_pop_it): Add prototypes.
5075 (struct iterator_stack_entry): New members bidi_p,
5076 paragraph_embedding, and from_disp_prop_p.
5077 (struct it): Member bidi_p is now a bit field 1 bit wide.
640c8776
SM
5078 (bidi_shelve_cache, bidi_unshelve_cache):
5079 Declare prototypes.
0bb23927
EZ
5080
5081 * .gdbinit (xvectype, xvector, xcompiled, xchartable, xboolvector)
5082 (xpr, xfont, xbacktrace): Use "header.size" when accessing vectors
5083 and vector-like objects.
5084
5085 * dispnew.c (buffer_posn_from_coords): Save and restore the bidi
5086 cache around display iteration.
5087
5088 * window.c (Fwindow_end, window_scroll_pixel_based)
5089 (displayed_window_lines, Frecenter): Save and restore the bidi
5090 cache around display iteration.
5091
3bbd2265
LMI
50922011-07-14 Lars Magne Ingebrigtsen <larsi@gnus.org>
5093
5094 * editfns.c (Fdelete_region): Clarify the use of the named
5095 parameters (bug#6788).
5096
adc47434
MR
50972011-07-14 Martin Rudalics <rudalics@gmx.at>
5098
5099 * indent.c (Fvertical_motion): Set and restore w->pointm when
5100 saving and restoring the window's buffer (Bug#9006).
5101
837c31f8
LMI
51022011-07-13 Lars Magne Ingebrigtsen <larsi@gnus.org>
5103
5104 * editfns.c (Fstring_to_char): Clarify just what is returned
5105 (bug#6576). Text by Eli Zaretskii.
5106
ac389d0c
JB
51072011-07-13 Juanma Barranquero <lekktu@gmail.com>
5108
5109 * gnutls.c (init_gnutls_functions): Honor gnutls_log_level (bug#9059).
5110
0be0ce47
EZ
51112011-07-13 Eli Zaretskii <eliz@gnu.org>
5112
5113 * buffer.c (mmap_find): Fix a typo.
5114
cd18e7e3
JB
51152011-07-13 Johan Bockgård <bojohan@gnu.org>
5116
5117 Fix execution of x selection hooks.
5118 * xselect.c (Qx_lost_selection_functions)
5119 (Qx_sent_selection_functions): New vars.
5120 (syms_of_xselect): DEFSYM them.
5121 (x_handle_selection_request): Pass Qx_sent_selection_functions
5122 rather than Vx_sent_selection_functions to Frun_hook_with_args.
5123 (x_handle_selection_clear,x_clear_frame_selections):
5124 Pass Qx_lost_selection_functions rather than
5125 Vx_lost_selection_functions to Frun_hook_with_args.
5126
47ea7f44
PE
51272011-07-13 Paul Eggert <eggert@cs.ucla.edu>
5128
ac389d0c 5129 * buffer.c (Fget_buffer_create): Initialize inhibit_shrinking.
2941c447
PE
5130 The old code sometimes used this field without initializing it.
5131
47ea7f44
PE
5132 * alloc.c (gc_sweep): Don't read past end of array.
5133 In theory, the old code could also have corrupted Emacs internals,
5134 though it'd be very unlikely.
5135
bc985c87
AS
51362011-07-12 Andreas Schwab <schwab@linux-m68k.org>
5137
5138 * character.c (Fcharacterp): Don't advertise optional ignored
ac389d0c 5139 argument. (Bug#4026)
bc985c87 5140
0cf34688
LMI
51412011-07-12 Lars Magne Ingebrigtsen <larsi@gnus.org>
5142
b3dadd76
LMI
5143 * keymap.c (syms_of_keymap): Clarify that "modifier" is "modifier
5144 key" (bug#4257).
5145
0cf34688
LMI
5146 * window.c (Fset_window_start): Doc fix (bug#4199).
5147 (Fset_window_hscroll): Ditto.
5148
270768cd
PE
51492011-07-12 Paul Eggert <eggert@cs.ucla.edu>
5150
077e3dda 5151 Fix minor new problems caught by GCC 4.6.1.
270768cd 5152 * term.c (init_tty): Remove unused local.
490011a6 5153 * xsettings.c (store_monospaced_changed): Define this function only
077e3dda 5154 if (defined HAVE_GSETTINGS || defined HAVE_GCONF), as it's
490011a6 5155 not used otherwise.
270768cd 5156
b1f58454
CY
51572011-07-12 Chong Yidong <cyd@stupidchicken.com>
5158
5159 * xdisp.c (Vresize_mini_windows): Minor doc fix (Bug#3300).
5160
22b9578d
LMI
51612011-07-11 Lars Magne Ingebrigtsen <larsi@gnus.org>
5162
6e70ab07
LMI
5163 * xdisp.c (syms_of_xdisp): Make it explicit that the mini-windows
5164 are the mini-buffer and the echo area (bug#3320).
5165
22b9578d
LMI
5166 * term.c (init_tty): Remove support for supdup, c10 and perq
5167 terminals, which are no longer supported (bug#1482).
5168
8974cc9f
JB
51692011-07-10 Johan Bockgård <bojohan@gnu.org>
5170
5171 * xdisp.c (Ftool_bar_lines_needed): Fix WINDOWP check.
5172
a560d974
JD
51732011-07-10 Jan Djärv <jan.h.d@swipnet.se>
5174
5175 * xmenu.c (menu_highlight_callback): Only pass frame to show_help_event
5176 for non-popups (Bug#3642).
5177
1dae0f0a
AS
51782011-07-10 Andreas Schwab <schwab@linux-m68k.org>
5179
268c2c36 5180 * alloc.c (reset_malloc_hooks): Protoize.
1dae0f0a 5181 * buffer.c (mmap_init, mmap_find, mmap_free_1, mmap_enlarge)
268c2c36
AS
5182 (mmap_set_vars, mmap_alloc, mmap_free, mmap_realloc): Likewise.
5183 * cm.c (losecursor): Likewise.
1dae0f0a
AS
5184 * data.c (fmod): Likewise.
5185 * dispnew.c (swap_glyphs_in_rows): Likewise.
5186 * emacs.c (memory_warning_signal): Likewise.
5187 * floatfns.c (float_error): Likewise.
5188 * font.c (check_gstring, check_otf_features, otf_tag_symbol)
5189 (otf_open, font_otf_capability, generate_otf_features)
5190 (font_otf_DeviceTable, font_otf_ValueRecord, font_otf_Anchor):
5191 Likewise.
5192 * image.c (pbm_read_file): Likewise.
5193 * indent.c (string_display_width): Likewise.
5194 * intervals.c (check_for_interval, search_for_interval)
5195 (inc_interval_count, count_intervals, root_interval)
5196 (adjust_intervals_for_insertion, make_new_interval): Likewise.
5197 * lread.c (defalias): Likewise.
268c2c36 5198 * ralloc.c (r_alloc_check): Likewise.
1dae0f0a
AS
5199 * regex.c (set_image_of_range_1, set_image_of_range)
5200 (regex_grow_registers): Likewise.
5201 * sysdep.c (strerror): Likewise.
5202 * termcap.c (valid_filename_p, tprint, main): Likewise.
5203 * tparam.c (main): Likewise.
5204 * unexhp9k800.c (run_time_remap, save_data_space)
5205 (update_file_ptrs, read_header, write_header, calculate_checksum)
5206 (copy_file, copy_rest, display_header): Likewise.
5207 * widget.c (mark_shell_size_user_specified, create_frame_gcs):
5208 Likewise.
5209 * xdisp.c (check_it): Likewise.
5210 * xfaces.c (register_color, unregister_color, unregister_colors):
5211 Likewise.
5212 * xfns.c (print_fontset_result): Likewise.
5213 * xrdb.c (member, fatal, main): Likewise.
5214
99033785
PE
52152011-07-10 Paul Eggert <eggert@cs.ucla.edu>
5216
5217 Fix minor problems found by static checking (Bug#9031).
5218 * chartab.c (char_table_set_range, map_sub_char_table):
5219 Remove unused locals.
5220 (uniprop_table): Now static.
5221 * composite.c (_work_char): Remove unused static var.
5222
9cb2ac56
JB
52232011-07-09 Juanma Barranquero <lekktu@gmail.com>
5224
5225 * chartab.c (uniprop_table_uncompress): Remove unused local variable.
5226
f25661f0
JD
52272011-07-09 Jan Djärv <jan.h.d@swipnet.se>
5228
5229 * gtkutil.c (qttip_cb): Remove code without function.
5230
8278c4fe
EZ
52312011-07-09 Eli Zaretskii <eliz@gnu.org>
5232
5233 * w32.c (pthread_sigmask): New stub.
5234
1692ae2d 52352011-07-08 Paul Eggert <eggert@cs.ucla.edu>
123403e4 5236
8a6ebd58 5237 Use pthread_sigmask, not sigprocmask (Bug#9010).
123403e4
PE
5238 sigprocmask is portable only for single-threaded applications, and
5239 Emacs can be multi-threaded when it uses GTK.
1301ac26
PE
5240 * Makefile.in (LIB_PTHREAD_SIGMASK): New macro.
5241 (LIBES): Use it.
5242 * callproc.c (Fcall_process):
5243 * process.c (create_process):
5244 * sysdep.c (sys_sigblock, sys_sigunblock, sys_sigsetmask):
5245 Use pthread_sigmask, not sigprocmask.
123403e4 5246
1b854618
JD
52472011-07-08 Jan Djärv <jan.h.d@swipnet.se>
5248
5249 * gtkutil.c (qttip_cb): Set line wrap to FALSE for tooltip widget.
5250 (xg_prepare_tooltip): Revert text in x->ttip_lbl, margins was
5251 wrong (Bug#8591).
5252
3fe4b549
JD
52532011-07-08 Jan Djärv <jan.h.d@swipnet.se>
5254
0ce7e563
JD
5255 * gtkutil.c (xg_prepare_tooltip): Fix indentation and comment.
5256 Put text in x->ttip_lbl instead of gtk_tooltip_set_text (Bug#8591).
5257 (xg_hide_tooltip): Fix comment.
5258
3fe4b549
JD
5259 * nsterm.m (initFrameFromEmacs): Don't use ns_return_types
5260 in registerServicesMenuSendTypes.
5261 (validRequestorForSendType): Don't check ns_return_types.
5262
5263 * nsfns.m (Fx_open_connection): Put NSStringPboardType into
5264 ns_return_type.
5265
5df75e47
JR
52662011-07-08 Jason Rumney <jasonr@gnu.org>
5267
22610910
JR
5268 * w32term.c (x_make_frame_visible): Use SH_SHOWNORMAL rather than
5269 SH_SHOW for hidden windows (Bug#5482).
5270
5df75e47
JR
5271 * w32fns.c (w32_wnd_proc) [WM_TIMER, WM_SET_CURSOR]: Avoid using
5272 frame struct members of non-existent frames (Bug#6284).
5273
699c10bd
JD
52742011-07-08 Jan Djärv <jan.h.d@swipnet.se>
5275
4393663b
JD
5276 * nsterm.m (keyDown): Call to wantsToDelayTextChangeNotifications and
5277 variable firstTime not needed on OSX >= 10.6.
5278 (setPosition): setFloatValue:knobProportion: is deprecated on OSX
5279 >= 10.5. Use setKnobProportion, setDoubleValue.
5280
5281 * nsterm.h (MAC_OS_X_VERSION_10_3, MAC_OS_X_VERSION_10_4)
5282 (MAC_OS_X_VERSION_10_5): Define if not defined.
5283 (EmacsView, EmacsTooltip): Implements NSWindowDelegate on OSX >= 10.6.
5284 (EmacsMenu): Implements NSMenuDelegate on OSX >= 10.6.
5285 (EmacsToolbar): Implements NSToolbarDelegate on OSX >= 10.6.
5286
5287 * nsselect.m (ns_string_from_pasteboard): Don't use deprecated methods
5288 cString and lossyCString on OSX >= 10.4
5289
58179cce 5290 * nsmenu.m (fillWithWidgetValue): Don't use deprecated method
4393663b
JD
5291 sizeToFit on OSX >= 10.2.
5292
5293 * nsimage.m (allocInitFromFile): Don't use deprecated method
5294 bestRepresentationForDevice on OSX >= 10.6.
5295
5296 * nsfns.m (check_ns_display_info): Cast to long and use %ld in error
5297 to avoid warning.
5298
5299 * emacs.c: Declare unexec_init_emacs_zone.
5300
a63e0781
JD
5301 * nsgui.h: Fix compiler warning about gnulib redefining verify.
5302
699c10bd
JD
5303 * nsselect.m (ns_get_local_selection): Change to extern (Bug#8842).
5304
5305 * nsmenu.m (ns_update_menubar): Remove useless setDelegate call
5306 on svcsMenu (Bug#8842).
5307
5308 * nsfns.m (Fx_open_connection): Remove NSStringPboardType from
5309 ns_return_types.
5310 (Fns_list_services): Just return Qnil on 10.6, code not working there.
5311
5312 * nsterm.m (QUTF8_STRING): Declare.
5313 (initFrameFromEmacs): Call registerServicesMenuSendTypes.
5314 (validRequestorForSendType): Return type is (id).
5315 Change indexOfObjectIdenticalTo to indexOfObject.
5316 Check if we have local selection before returning self (Bug#8842).
5317 (writeSelectionToPasteboard): Put local selection into paste board
5318 if we have a local selection (Bug#8842).
5319 (syms_of_nsterm): DEFSYM QUTF8_STRING.
5320
5321 * nsterm.h (MAC_OS_X_VERSION_10_6): Define here instead of nsterm.m.
5322 (ns_get_local_selection): Declare.
5323
54e10184
LMI
53242011-07-07 Lars Magne Ingebrigtsen <larsi@gnus.org>
5325
9888ff71
LMI
5326 * keymap.c (describe_map_tree): Don't insert a double newline at
5327 the end of the buffer (bug#1169) and return whether we inserted
5328 something.
5329
54e10184
LMI
5330 * callint.c (Fcall_interactively): Change "reading args" to
5331 "providing args" to try to clarify what it does (bug#1010).
5332
15fa4783
KH
53332011-07-07 Kenichi Handa <handa@m17n.org>
5334
5335 * composite.c (composition_compute_stop_pos): Ignore a static
5336 composition starting before CHARPOS (Bug#8915).
5337
5338 * xdisp.c (handle_composition_prop): Likewise.
5339
a8815b00
EZ
53402011-07-07 Eli Zaretskii <eliz@gnu.org>
5341
5342 * term.c (produce_glyphs) <xassert>: Allow IT_GLYPHLESS in it->what.
5343 (Bug#9015)
5344
ef7b981d 53452011-07-07 Kenichi Handa <handa@m17n.org>
c805dec0
KH
5346
5347 * character.h (unicode_category_t): New enum type.
5348
5349 * chartab.c (uniprop_decoder_t, uniprop_encoder_t): New types.
5350 (Qchar_code_property_table): New variable.
5351 (UNIPROP_TABLE_P, UNIPROP_GET_DECODER)
5352 (UNIPROP_COMPRESSED_FORM_P): New macros.
5353 (char_table_ascii): Uncompress the compressed values.
5354 (sub_char_table_ref): New arg is_uniprop. Callers changed.
5355 Uncompress the compressed values.
ac389d0c 5356 (sub_char_table_ref_and_range): Likewise.
c805dec0
KH
5357 (char_table_ref_and_range): Uncompress the compressed values.
5358 (sub_char_table_set): New arg is_uniprop. Callers changed.
5359 Uncompress the compressed values.
5360 (sub_char_table_set_range): Args changed. Callers changed.
5361 (char_table_set_range): Adjuted for the above change.
5362 (map_sub_char_table): Delete args default_val and parent. Add arg
5363 top. Give decoded values to a Lisp function.
640c8776 5364 (map_char_table): Adjust for the above change. Give decoded
c805dec0
KH
5365 values to a Lisp function. Gcpro more variables.
5366 (uniprop_table_uncompress)
5367 (uniprop_decode_value_run_length): New functions.
5368 (uniprop_decoder, uniprop_decoder_count): New variables.
5369 (uniprop_get_decoder, uniprop_encode_value_character)
5370 (uniprop_encode_value_run_length, uniprop_encode_value_numeric):
5371 New functions.
5372 (uniprop_encoder, uniprop_encoder_count): New variables.
5373 (uniprop_get_encoder, uniprop_table)
5374 (Funicode_property_table_internal, Fget_unicode_property_internal)
5375 (Fput_unicode_property_internal): New functions.
5376 (syms_of_chartab): DEFSYM Qchar_code_property_table, defsubr
5377 Sunicode_property_table_internal, Sget_unicode_property_internal,
5e617bc2 5378 and Sput_unicode_property_internal. Defvar_lisp
c805dec0
KH
5379 char-code-property-alist.
5380
640c8776 5381 * composite.c (CHAR_COMPOSABLE_P): Adjust for the change of
c805dec0
KH
5382 Vunicode_category_table.
5383
640c8776 5384 * font.c (font_range): Adjust for the change of
c805dec0
KH
5385 Vunicode_category_table.
5386
76b397fb
DN
53872011-07-07 Dan Nicolaescu <dann@ics.uci.edu>
5388
5389 * m/iris4d.h: Remove file, move contents ...
5390 * s/irix6-5.h: ... here.
5391
22b4128e
PE
53922011-07-06 Paul Eggert <eggert@cs.ucla.edu>
5393
5394 Remove unportable assumption about struct layout (Bug#8884).
8a5c77bb
PE
5395 * alloc.c (mark_buffer):
5396 * buffer.c (reset_buffer_local_variables, Fbuffer_local_variables)
5397 (clone_per_buffer_values): Don't assume that
22b4128e
PE
5398 sizeof (struct buffer) is a multiple of sizeof (Lisp_Object).
5399 This isn't true in general, and it's particularly not true
5400 if Emacs is configured with --with-wide-int.
5401 * buffer.h (FIRST_FIELD_PER_BUFFER, LAST_FIELD_PER_BUFFER):
5402 New macros, used in the buffer.c change.
5403
869795d6
JD
54042011-07-05 Jan Djärv <jan.h.d@swipnet.se>
5405
5406 * xsettings.c: Use both GConf and GSettings if both are available.
5407 (store_config_changed_event): Add comment.
5408 (dpyinfo_valid, store_font_name_changed, map_tool_bar_style)
5409 (store_tool_bar_style_changed): New functions.
5e617bc2 5410 (store_monospaced_changed): Add comment. Call dpyinfo_valid.
869795d6
JD
5411 (struct xsettings): Move font inside HAVE_XFT.
5412 (GSETTINGS_TOOL_BAR_STYLE, GSETTINGS_FONT_NAME): New defines.
640c8776 5413 (GSETTINGS_MONO_FONT): Rename from SYSTEM_MONO_FONT.
869795d6 5414 Move inside HAVE_XFT.
640c8776 5415 (something_changed_gsettingsCB): Rename from something_changedCB.
869795d6
JD
5416 Check for changes in GSETTINGS_TOOL_BAR_STYLE and GSETTINGS_FONT_NAME
5417 also.
5418 (GCONF_TOOL_BAR_STYLE, GCONF_FONT_NAME): New defines.
5e617bc2 5419 (GCONF_MONO_FONT): Rename from SYSTEM_MONO_FONT. Move inside HAVE_XFT.
640c8776 5420 (something_changed_gconfCB): Rename from something_changedCB.
869795d6
JD
5421 Check for changes in GCONF_TOOL_BAR_STYLE and GCONF_FONT_NAME also.
5422 (parse_settings): Move check for font inside HAVE_XFT.
5423 (read_settings, apply_xft_settings): Add comment.
5424 (read_and_apply_settings): Add comment. Call map_tool_bar_style and
5425 store_tool_bar_style_changed. Move check for font inside HAVE_XFT and
5426 call store_font_name_changed.
5427 (xft_settings_event): Add comment.
5428 (init_gsettings): Add comment. Get values for GSETTINGS_TOOL_BAR_STYLE
5429 and GSETTINGS_FONT_NAME. Move check for fonts within HAVE_XFT.
5430 (init_gconf): Add comment. Get values for GCONF_TOOL_BAR_STYLE
5431 and GCONF_FONT_NAME. Move check for fonts within HAVE_XFT.
5432 (xsettings_initialize): Call init_gsettings last.
640c8776
SM
5433 (xsettings_get_system_font, xsettings_get_system_normal_font):
5434 Add comment.
869795d6 5435
d8ed26bd
PE
54362011-07-05 Paul Eggert <eggert@cs.ucla.edu>
5437
5438 Random fixes. E.g., (random) never returned negative values.
5439 * fns.c (Frandom): Use GET_EMACS_TIME for random seed, and add the
5440 subseconds part to the entropy, as that's a bit more random.
5441 Prefer signed to unsigned, since the signedness doesn't matter and
5442 in general we prefer signed. When given a limit, use a
5443 denominator equal to INTMASK + 1, not to VALMASK + 1, because the
5444 latter isn't right if USE_2_TAGS_FOR_INTS.
5445 * sysdep.c (get_random): Return a value in the range 0..INTMASK,
5446 not 0..VALMASK. Don't discard "excess" bits that random () returns.
5447
cabf1cac
SM
54482011-07-04 Stefan Monnier <monnier@iro.umontreal.ca>
5449
5450 * textprop.c (text_property_stickiness):
5451 Obey Vtext_property_default_nonsticky.
5452 (syms_of_textprop): Add `display' to Vtext_property_default_nonsticky.
5453 * w32fns.c (syms_of_w32fns):
5454 * xfns.c (syms_of_xfns): Don't Add `display' since it's there by default.
5455
6e9b2be9
PE
54562011-07-04 Paul Eggert <eggert@cs.ucla.edu>
5457
5458 * fileio.c (barf_or_query_if_file_exists): Use S_ISDIR.
5459 This is more efficient than Ffile_directory_p and avoids a minor race.
5460
90186c68
LMI
54612011-07-04 Lars Magne Ingebrigtsen <larsi@gnus.org>
5462
7c301272
LMI
5463 * buffer.c (Foverlay_put): Say what the return value is
5464 (bug#7835).
5465
c4f2d8d4
LMI
5466 * fileio.c (barf_or_query_if_file_exists): Check first if the file
5467 is a directory before asking whether to use the file name
5468 (bug#7564).
ad637907
LMI
5469 (barf_or_query_if_file_exists): Make the "File is a directory"
5470 error be more correct.
c4f2d8d4 5471
90186c68
LMI
5472 * fns.c (Frequire): Remove the mention of the .gz files, since
5473 that's installation-specific, but keep the mention of
5474 `get-load-suffixes'.
5475
da64016e
PE
54762011-07-04 Paul Eggert <eggert@cs.ucla.edu>
5477
5478 * editfns.c (Fformat_time_string): Don't assume strlen fits in int.
5479 Report string overflow if the output is too long.
5480
7d47b580
JB
54812011-07-04 Juanma Barranquero <lekktu@gmail.com>
5482
a555cb87
JB
5483 * gnutls.c (Fgnutls_boot): Don't mention :verify-error.
5484 (syms_of_gnutls): Remove duplicate DEFSYM for
5485 Qgnutls_bootprop_verify_hostname_error, an error for
5486 Qgnutls_bootprop_verify_error (which is no longer used).
5487
7d47b580
JB
5488 * eval.c (find_handler_clause): Remove parameters `sig' and `data',
5489 unused since 2011-01-26T20:02:07Z!monnier@iro.umontreal.ca. All callers changed.
5490 Also (re)move comments that are misplaced or no longer relevant.
5491
1e49bfab
LMI
54922011-07-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
5493
5494 * callint.c (Finteractive): Clarify the meaning of "@" (bug#8813).
5495
1485f4c0
CY
54962011-07-03 Chong Yidong <cyd@stupidchicken.com>
5497
5498 * xfaces.c (Finternal_merge_in_global_face): Modify the foreground
5499 and background color parameters if they have been changed.
5500
a9ab721e
LMI
55012011-07-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
5502
5503 * editfns.c (Fformat): Clarify the - and 0 flags (bug#6659).
5504
cf7cff57
PE
55052011-07-03 Paul Eggert <eggert@cs.ucla.edu>
5506
2e13213d
PE
5507 * xsettings.c (SYSTEM_FONT): Define only when used.
5508 No need to define when HAVE_GSETTINGS || !HAVE_XFT.
5509
cf7cff57
PE
5510 * keymap.c (access_keymap_1): Now static.
5511
7a8e04f7
CY
55122011-07-02 Chong Yidong <cyd@stupidchicken.com>
5513
5514 * keyboard.c (command_loop_1): If a down-mouse event is unbound,
5515 leave any prefix arg for the up event (Bug#1586).
5516
61352f62
LMI
55172011-07-02 Lars Magne Ingebrigtsen <larsi@gnus.org>
5518
69bb1ef7
LMI
5519 * lread.c (syms_of_lread): Mention single symbols defined by
5520 `defvar' or `defconst' (bug#7154).
5521
61352f62 5522 * fns.c (Frequire): Mention .el.gz files (bug#7314).
7b3747f9 5523 (Frequire): Mention get-load-suffixes.
61352f62 5524
28545e04
MR
55252011-07-02 Martin Rudalics <rudalics@gmx.at>
5526
5527 * window.h (window): Remove clone_number slot.
5528 * window.c (Fwindow_clone_number, Fset_window_clone_number):
5529 Remove.
5530 (make_parent_window, make_window, saved_window)
5531 (Fset_window_configuration, save_window_save): Don't deal with
5532 clone numbers.
5533 * buffer.c (Qclone_number): Remove declaration.
5534 (sort_overlays, overlay_strings): Don't deal with clone numbers.
5535
3349e122
SM
55362011-07-02 Stefan Monnier <monnier@iro.umontreal.ca>
5537
5538 Add multiple inheritance to keymaps.
5539 * keymap.c (Fmake_composed_keymap): New function.
5540 (Fset_keymap_parent): Simplify.
5541 (fix_submap_inheritance): Remove.
5542 (access_keymap_1): New function extracted from access_keymap to handle
5543 embedded parents and handle lists of maps.
5544 (access_keymap): Use it.
5545 (Fkeymap_prompt, map_keymap_internal, map_keymap, store_in_keymap)
5546 (Fcopy_keymap): Handle embedded parents.
5547 (Fcommand_remapping, define_as_prefix): Simplify.
5548 (Fkey_binding): Simplify.
5549 (syms_of_keymap): Move minibuffer-local-completion-map,
5550 minibuffer-local-filename-completion-map,
5551 minibuffer-local-must-match-map, and
5552 minibuffer-local-filename-must-match-map to Elisp.
5553 (syms_of_keymap): Defsubr make-composed-keymap.
5554 * keyboard.c (menu_bar_items): Use map_keymap_canonical.
5555 (parse_menu_item): Trivial simplification.
5556
3279eb87
GM
55572011-07-01 Glenn Morris <rgm@gnu.org>
5558
5559 * Makefile.in (SETTINGS_LIBS): Fix typo.
5560
4550efdf
KI
55612011-07-01 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny patch)
5562
5563 * coding.c (Fencode_coding_string): Record the last coding system
5564 used, as the function doc string says (bug#8738).
5565
0949d2b6
JD
55662011-07-01 Jan Djärv <jan.h.d@swipnet.se>
5567
5568 * xsettings.c (store_monospaced_changed): Take new font as arg and
5569 check for change against current_mono_font.
5570 (EMACS_TYPE_SETTINGS): Remove this and related defines.
5571 (emacs_settings_constructor, emacs_settings_get_property)
5572 (emacs_settings_set_property, emacs_settings_class_init)
5573 (emacs_settings_init, gsettings_obj): Remove.
5574 (something_changedCB): New function for HAVE_GSETTINGS.
5575 (something_changedCB): HAVE_GCONF: Call store_monospaced_changed
5576 with value as argument.
5577 (init_gsettings): Check that GSETTINGS_SCHEMA exists before calling
5578 g_settings_new (Bug#8967). Do not create gsettings_obj.
9173deec 5579 Remove calls to g_settings_bind. Connect something_changedCB to
0949d2b6
JD
5580 "changed".
5581
5582 * xgselect.c: Add defined (HAVE_GSETTINGS).
5583 (xgselect_initialize): Ditto.
5584
5585 * process.c: Add defined (HAVE_GSETTINGS) for xgselect.h
5586 (wait_reading_process_output): Add defined (HAVE_GSETTINGS) for
5587 xg_select.
5588
bbc6b304
PE
55892011-07-01 Paul Eggert <eggert@cs.ucla.edu>
5590
5591 * eval.c (struct backtrace): Simplify and port the data structure.
5592 Do not assume that "int nargs : BITS_PER_INT - 2;" produces a
5593 signed bit field, as this assumption is not portable and it makes
5594 Emacs crash when compiled with Sun C 5.8 on sparc. Do not use
5595 "char debug_on_exit : 1" as this is not portable either; instead,
5596 use the portable "unsigned int debug_on_exit : 1". Remove unused
5597 member evalargs. Remove obsolete comments about cc bombing out.
5598
9851bfc5
JD
55992011-06-30 Jan Djärv <jan.h.d@swipnet.se>
5600
51bb811f 5601 * xsettings.c: Include glib-object.h, gio/gio.h if HAVE_GSETTINGS.
9851bfc5
JD
5602 Let HAVE_GSETTINGS override HAVE_GCONF.
5603 (store_monospaced_changed): New function.
5604 (EMACS_SETTINGS): A new type derived from GObject to handle
5605 GSettings notifications.
5606 (emacs_settings_constructor, emacs_settings_get_property)
5607 (emacs_settings_set_property, emacs_settings_class_init):
5608 New functions.
5609 (gsettings_client, gsettings_obj): New variables.
5610 (GSETTINGS_SCHEMA): New define.
5611 (something_changedCB): Call store_monospaced_changed.
5612 (init_gsettings): New function.
5613 (xsettings_initialize): Call init_gsettings.
5614 (syms_of_xsettings): Initialize gsettings_client, gsettings_obj
5615 to NULL.
5616
640c8776 5617 * Makefile.in (SETTINGS_CFLAGS, SETTINGS_LIBS): Rename from
9851bfc5
JD
5618 GCONF_CFLAGS/LIBS.
5619
5386012d
MR
56202011-06-29 Martin Rudalics <rudalics@gmx.at>
5621
5622 * window.c (resize_root_window, grow_mini_window)
5623 (shrink_mini_window): Rename Qresize_root_window to
5624 Qwindow_resize_root_window and Qresize_root_window_vertically to
5625 Qwindow_resize_root_window_vertically.
5626
f13e0b08
PE
56272011-06-28 Paul Eggert <eggert@cs.ucla.edu>
5628
5629 * gnutls.c (Qgnutls_bootprop_verify_error): Remove unused var.
5630
94515237
JB
56312011-06-27 Juanma Barranquero <lekktu@gmail.com>
5632
5633 * makefile.w32-in: Redesign dependencies so they reflect more
5634 clearly which files are directly included by each source file,
5635 and not through other includes.
5636
e43b6e43
MR
56372011-06-27 Martin Rudalics <rudalics@gmx.at>
5638
5639 * buffer.c (Qclone_number): Declare static and DEFSYM it.
5640 (sort_overlays, overlay_strings): When an overlay's clone number
5641 matches the window's clone number process the overlay even if
5642 the overlay's window property doesn't match the current window.
5643
d68443dc
MR
5644 * window.c (Fwindow_vchild): Rename to Fwindow_top_child.
5645 (Fwindow_hchild): Rename to Fwindow_left_child.
5646 (Fwindow_next): Rename to Fwindow_next_sibling.
5647 (Fwindow_prev): Rename to Fwindow_prev_sibling.
d615d6d2
MR
5648 (resize_window_check): Rename to window_resize_check.
5649 (resize_window_apply): Rename to window_resize_apply.
5650 (Fresize_window_apply): Rename to Fwindow_resize_apply.
5651 (Fdelete_other_windows_internal, resize_frame_windows)
5652 (Fsplit_window_internal, Fdelete_window_internal)
5653 (grow_mini_window, shrink_mini_window)
5654 (Fresize_mini_window_internal): Fix callers accordingly.
d68443dc 5655
c7e73be5
JD
56562011-06-26 Jan Djärv <jan.h.d@swipnet.se>
5657
5658 * emacsgtkfixed.h: State that this is only used with Gtk+3.
5659 (emacs_fixed_set_min_size): Remove.
5660 (emacs_fixed_new): Take frame as argument.
5661
5662 * emacsgtkfixed.c: State that this is only used with Gtk+3.
5663 (_EmacsFixedPrivate): Remove minwidth/height.
5664 Add struct frame *f.
5665 (emacs_fixed_init): Initialize priv->f.
5666 (get_parent_class, emacs_fixed_set_min_size): Remove.
5667 (emacs_fixed_new): Set priv->f to argument.
5668 (emacs_fixed_get_preferred_width)
5669 (emacs_fixed_get_preferred_height): Use min_width/height from
5670 frames size_hint to set minimum and natural (Bug#8919).
5671 (XSetWMSizeHints, XSetWMNormalHints): Override these functions
5672 and use min_width/height from frames size_hint to set
5673 min_width/height (Bug#8919).
5674
5675 * gtkutil.c (xg_create_frame_widgets): Pass f to emacs_fixed_new.
9173deec
JB
5676 (x_wm_set_size_hint): Remove call to emacs_fixed_set_min_size.
5677 Fix indentation.
c7e73be5 5678
cf99dcf8
EZ
56792011-06-26 Eli Zaretskii <eliz@gnu.org>
5680
5681 * bidi.c (bidi_paragraph_init): Test for ZV_BYTE before calling
5682 bidi_at_paragraph_end, since fast_looking_at doesn't like to be
5683 called at ZV.
5684
029529ac
CY
56852011-06-26 Chong Yidong <cyd@stupidchicken.com>
5686
5687 * process.c (wait_reading_process_output): Bypass select if
5688 waiting for a cell while ignoring keyboard input, and input is
5689 pending. Suggested by Jan Djärv (Bug#8869).
5690
7a7ef429
PE
56912011-06-25 Paul Eggert <eggert@cs.ucla.edu>
5692
5693 Use gnulib's dup2 module instead of rolling our own.
5694 * sysdep.c (dup2) [!HAVE_DUP2]: Remove; gnulib now does this.
5695
11fdef7d 56962011-06-25 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
989b42d2
YM
5697
5698 * dispnew.c (scrolling_window): Before scrolling, turn off a
5699 mouse-highlight in the window being scrolled.
5700
cd3520a4
JB
57012011-06-24 Juanma Barranquero <lekktu@gmail.com>
5702
5703 Move DEFSYM to lisp.h and use everywhere.
5704
5705 * character.h (DEFSYM): Move declaration...
5706 * lisp.h (DEFSYM): ...here.
5707
5708 * gnutls.c:
5709 * minibuf.c:
5710 * w32menu.c:
5711 * w32proc.c:
5712 * w32select.c: Don't include character.h.
5713
5714 * alloc.c (syms_of_alloc):
5715 * buffer.c (syms_of_buffer):
5716 * bytecode.c (syms_of_bytecode):
5717 * callint.c (syms_of_callint):
5718 * casefiddle.c (syms_of_casefiddle):
5719 * casetab.c (init_casetab_once):
5720 * category.c (init_category_once, syms_of_category):
5721 * ccl.c (syms_of_ccl):
5722 * cmds.c (syms_of_cmds):
5723 * composite.c (syms_of_composite):
5724 * dbusbind.c (syms_of_dbusbind):
5725 * dired.c (syms_of_dired):
5726 * dispnew.c (syms_of_display):
5727 * doc.c (syms_of_doc):
5728 * editfns.c (syms_of_editfns):
5729 * emacs.c (syms_of_emacs):
5730 * eval.c (syms_of_eval):
5731 * fileio.c (syms_of_fileio):
5732 * fns.c (syms_of_fns):
5733 * frame.c (syms_of_frame):
5734 * fringe.c (syms_of_fringe):
5735 * insdel.c (syms_of_insdel):
5736 * keymap.c (syms_of_keymap):
5737 * lread.c (init_obarray, syms_of_lread):
5738 * macros.c (syms_of_macros):
5739 * msdos.c (syms_of_msdos):
5740 * print.c (syms_of_print):
5741 * process.c (syms_of_process):
5742 * search.c (syms_of_search):
5743 * sound.c (syms_of_sound):
5744 * syntax.c (init_syntax_once, syms_of_syntax):
5745 * terminal.c (syms_of_terminal):
5746 * textprop.c (syms_of_textprop):
5747 * undo.c (syms_of_undo):
5748 * w32.c (globals_of_w32):
5749 * window.c (syms_of_window):
5750 * xdisp.c (syms_of_xdisp):
5751 * xfaces.c (syms_of_xfaces):
5752 * xfns.c (syms_of_xfns):
5753 * xmenu.c (syms_of_xmenu):
5754 * xsettings.c (syms_of_xsettings):
5755 * xterm.c (syms_of_xterm): Use DEFSYM.
5756
4228cf16
TZ
57572011-06-24 Teodor Zlatanov <tzz@lifelogs.com>
5758
cd3520a4 5759 * gnutls.c (syms_of_gnutls): Use the DEFSYM macro from character.h.
4228cf16 5760
7fcccf1e
PE
57612011-06-23 Paul Eggert <eggert@cs.ucla.edu>
5762
7efb4e0e
PE
5763 Integer and buffer overflow fixes (Bug#8873).
5764
ff5844ad
PE
5765 * print.c (printchar, strout): Check for string overflow.
5766 (PRINTPREPARE, printchar, strout):
5767 Don't set size unless allocation succeeds.
5768
90532f02
PE
5769 * minibuf.c (read_minibuf_noninteractive): Use ptrdiff_t, not int,
5770 for sizes. Check for string overflow more accurately.
5771 Simplify newline removal at end; this suppresses a GCC 4.6.0 warning.
5772
6d84508d
PE
5773 * macros.c: Integer and buffer overflow fixes.
5774 * keyboard.h (struct keyboard.kbd_macro_bufsize):
5775 * macros.c (Fstart_kbd_macro, store_kbd_macro_char):
5776 Use ptrdiff_t, not int, for sizes.
5777 Don't increment bufsize until after realloc succeeds.
5778 Check for size-calculation overflow.
5779 (Fstart_kbd_macro): Use EMACS_INT, not int, for XINT result.
5780
437b2cb4
PE
5781 * lisp.h (DEFVAR_KBOARD): Use offsetof instead of char * finagling.
5782
8b9ac8b4
PE
5783 * lread.c: Integer overflow fixes.
5784 (read_integer): Radix is now EMACS_INT, not int,
5785 to improve quality of diagnostics for out-of-range radices.
5786 Calculate buffer size correctly for out-of-range radices.
5787 (read1): Check for integer overflow in radices, and in
5788 read-circle numbers.
82cb60d3
PE
5789 (read_escape): Avoid int overflow.
5790 (Fload, openp, read_buffer_size, read1)
5791 (substitute_object_recurse, read_vector, read_list, map_obarray):
5792 Use ptrdiff_t, not int, for sizes.
5793 (read1): Use EMACS_INT, not int, for sizes.
20270765 5794 Check for size overflow.
8b9ac8b4 5795
7fcccf1e
PE
5796 * image.c (cache_image): Check for size arithmetic overflow.
5797
bfbbd7e7
PE
5798 * lread.c: Integer overflow issues.
5799 (saved_doc_string_size, saved_doc_string_length)
5800 (prev_saved_doc_string_size, prev_saved_doc_string_length):
5801 Now ptrdiff_t, not int.
5802 (read1): Don't assume doc string length fits in int. Check for
5803 out-of-range doc string lengths.
5804 (read_list): Don't assume file position fits in int.
39019e54 5805 (read_escape): Check for hex character overflow.
bfbbd7e7 5806
4e323265
LL
58072011-06-22 Leo Liu <sdl.web@gmail.com>
5808
5809 * minibuf.c (Fcompleting_read_default, Vcompleting_read_function):
5810 Move to minibuffer.el.
5811
85fece3e
PE
58122011-06-22 Paul Eggert <eggert@cs.ucla.edu>
5813
20b84ce9 5814 Fixes for GLYPH_DEBUG found by GCC 4.6.0 static checking.
85fece3e
PE
5815 The following patches are for when GLYPH_DEBUG && !XASSERT.
5816 * dispextern.h (trace_redisplay_p, dump_glyph_string):
5817 * dispnew.c (flush_stdout):
5818 * xdisp.c (dump_glyph_row, dump_glyph_matrix, dump_glyph):
5819 Mark as externally visible.
5820 * dispnew.c (check_window_matrix_pointers): Now static.
5821 * dispnew.c (window_to_frame_vpos):
5822 * xfns.c (unwind_create_frame):
5823 * xterm.c (x_check_font): Remove unused local.
5824 * scroll.c (CHECK_BOUNDS):
5825 * xfaces.c (cache_fache): Rename local to avoid shadowing.
5826 * xfns.c, w32fns.c (image_cache_refcount, dpyinfo_refcount): Now static.
5827 * xdisp.c (check_window_end): Now a no-op if !XASSERTS.
5828 (debug_first_unchanged_at_end_vpos, debug_last_unchanged_at_beg_vpos)
5829 (debug_dvpos, debug_dy, debug_delta, debug_delta_bytes, debug_end_vpos):
5830 Now static.
5831 (debug_method_add): Use va_list and vsprintf rather than relying
5832 on undefined behavior with wrong number of arguments.
5833 (dump_glyph, dump_glyph_row, Fdump_glyph_matrix):
5834 Don't assume ptrdiff_t and EMACS_INT are the same width as int.
5835 In this code, it's OK to assume C99 behavior for ptrdiff_t formats
5836 since we're not interested in debugging glyphs with old libraries.
5837 * xfaces.c (cache_face): Move debugging code earlier; this pacifies
5838 GCC 4.6.0's static checking.
5839
0766b489
PE
58402011-06-22 Paul Eggert <eggert@cs.ucla.edu>
5841
31fd4b32
PE
5842 Integer overflow and signedness fixes (Bug#8873).
5843 A few related buffer overrun fixes, too.
5844
b79e8648
PE
5845 * font.c (font_score): Use EMACS_INT, not int, to store XINT value.
5846
0766b489
PE
5847 * dispextern.h (struct face.stipple):
5848 * image.c (x_bitmap_height, x_bitmap_width, x_bitmap_pixmap)
5849 (x_bitmap_mask, x_allocate_bitmap_record)
5850 (x_create_bitmap_from_data, x_create_bitmap_from_file)
5851 (x_destroy_bitmap, x_destroy_all_bitmaps, x_create_bitmap_mask)
5852 (x_create_bitmap_from_xpm_data):
5853 * nsterm.h (struct ns_display_info.bitmaps_size, .bitmaps_last):
5854 * w32term.h (struct w32_display_info.icon_bitmap_id, .bitmaps_size)
5855 (.bitmaps_last):
5856 * xfaces.c (load_pixmap):
5857 * xterm.c (x_bitmap_icon, x_wm_set_icon_pixmap):
5858 * xterm.h (struct x_display_info.icon_bitmap_id, .bitmaps_size)
5859 (.bitmaps_last, struct x_output.icon_bitmap):
5860 Use ptrdiff_t, not int, for bitmap indexes.
5861 (x_allocate_bitmap_record): Check for size overflow.
5862 * dispextern.h, lisp.h: Adjust to API changes elsewhere.
5863
b081724f
PE
5864 Use ptrdiff_t, not int, for overlay counts.
5865 * buffer.h (overlays_at, sort_overlays, GET_OVERLAYS_AT):
5866 * editfns.c (overlays_around, get_pos_property):
5867 * textprop.c (get_char_property_and_overlay):
5868 * xdisp.c (next_overlay_change, note_mouse_highlight):
5869 * xfaces.c (face_at_buffer_position):
21514da7
PE
5870 * buffer.c (OVERLAY_COUNT_MAX): New macro.
5871 (overlays_at, overlays_in, sort_overlays, Foverlays_at)
5872 (Fnext_overlay_change, Fprevious_overlay_change)
5873 (mouse_face_overlay_overlaps, Foverlays_in):
b081724f 5874 Use ptrdiff_t, not int, for sizes.
21514da7 5875 (overlays_at, overlays_in): Check for size-calculation overflow.
b081724f 5876
3de73e5e
PE
5877 * xterm.c (xim_initialize, same_x_server): Strlen may not fit in int.
5878
2606c57b
PE
5879 * xsmfns.c (smc_save_yourself_CB, x_session_initialize): Avoid strlen.
5880 (x_session_initialize): Do not assume string length fits in int.
5881
aaafe47a
PE
5882 * xsettings.c (apply_xft_settings): Fix potential buffer overrun.
5883 This is unlikely, but can occur if DPI is outlandish.
5884
2674ddc8 5885 * xsettings.c (Ffont_get_system_normal_font, Ffont_get_system_font):
3a5077c5
PE
5886 * xselect.c (Fx_get_atom_name): Avoid need for strlen.
5887
28154962
PE
5888 * xrdb.c: Don't assume strlen fits in int; avoid some strlens.
5889 * xrdb.c (magic_file_p, search_magic_path):
5890 Omit last arg SUFFIX; it was always 0. All callers changed.
5891 (magic_file_p): Use ptrdiff_t, not int. Check for size overflow.
5892
7de51af5
PE
5893 * xfont.c (xfont_match): Avoid need for strlen.
5894
25ed6cc3
PE
5895 * xfns.c: Don't assume strlen fits in int.
5896 (xic_create_fontsetname, x_window): Use ptrdiff_t, not int.
5897
4eab31dd
PE
5898 * xdisp.c (message_log_check_duplicate): Return intmax_t,
5899 not unsigned long, as we prefer signed integers. All callers changed.
5900 Detect integer overflow in repeat count.
5901 (message_dolog): Don't assume print length fits in 39 bytes.
df1f27af 5902 (display_mode_element): Don't assume strlen fits in int.
4eab31dd 5903
171e2a58
PE
5904 * termcap.c: Don't assume sizes fit in int and never overflow.
5905 (struct termcap_buffer, tgetent): Use ptrdiff_t, not int, for sizes.
5906 (gobble_line): Check for size-calculation overflow.
5907
ad39faca 5908 * minibuf.c (Fread_buffer):
6e5bb2dc 5909 * lread.c (intern, intern_c_string):
74ca2eb3
PE
5910 * image.c (xpm_scan) [HAVE_NS && !HAVE_XPM]:
5911 Don't assume string length fits in int.
5912
52c61c22 5913 * keyboard.c (parse_tool_bar_item):
9bda3520
PE
5914 * gtkutil.c (style_changed_cb): Avoid need for strlen.
5915
b5b8c9e5
PE
5916 * font.c: Don't assume string length fits in int.
5917 (font_parse_xlfd, font_parse_fcname, font_unparse_fcname):
5918 Use ptrdiff_t, not int.
ccd6111c
PE
5919 (font_intern_prop): Don't assume string length fits in int.
5920 Don't assume integer property fits in fixnum.
5921 * font.h (font_intern_prop): 2nd arg is now ptrdiff_t, not int.
b5b8c9e5 5922
882f0d81 5923 * filelock.c: Fix some buffer overrun and integer overflow issues.
51cab52b 5924 (get_boot_time): Don't assume gzip command string fits in 100 bytes.
882f0d81
PE
5925 Reformulate so as not to need the command string.
5926 Invoke gzip -cd rather than gunzip, as it's more portable.
5927 (lock_info_type, lock_file_1, lock_file):
5928 Don't assume pid_t and time_t fit in unsigned long.
5929 (LOCK_PID_MAX): Remove; we now use more-reliable bounds.
5930 (current_lock_owner): Prefer signed type for sizes.
5931 Use memcpy, not strncpy, where memcpy is what is really wanted.
5932 Don't assume (via atoi) that time_t and pid_t fit in int.
5933 Check for time_t and/or pid_t out of range, e.g., via a network share.
5934 Don't alloca where an auto var works fine.
5935
93f4cf88
PE
5936 * fileio.c: Fix some integer overflow issues.
5937 (file_name_as_directory, Fexpand_file_name, Fsubstitute_in_file_name):
5938 Don't assume string length fits in int.
5939 (directory_file_name): Don't assume string length fits in long.
5940 (make_temp_name): Don't assume pid fits in int, or that its print
5941 length is less than 20.
5942
f3e92b69
PE
5943 * data.c (Fsubr_name): Rewrite to avoid a strlen call.
5944
1bfdaf10
PE
5945 * coding.c (make_subsidiaries): Don't assume string length fits in int.
5946
35016e9a
PE
5947 * callproc.c (child_setup): Rewrite to avoid two strlen calls.
5948
3d1e65a1
PE
5949 * process.c (Fformat_network_address): Use EMACS_INT, not EMACS_UINT.
5950 We prefer signed integers, even for size calculations.
5951
0b963a93
PE
5952 * emacs.c: Don't assume string length fits in 'int'.
5953 (DEFINE_DUMMY_FUNCTION, sort_args): Use ptrdiff_t, not int.
5954 (main): Don't invoke strlen when not needed.
5955
573f4b54
PE
5956 * dbusbind.c (XD_ERROR): Don't arbitrarily truncate string.
5957 (XD_DEBUG_MESSAGE): Don't waste a byte.
5958
989f33ba
PE
5959 * callproc.c (getenv_internal_1, getenv_internal)
5960 (Fgetenv_internal):
965d34eb
PE
5961 * buffer.c (init_buffer): Don't assume string length fits in 'int'.
5962
e4d29b33
PE
5963 * lread.c (invalid_syntax): Omit length argument.
5964 All uses changed. This doesn't fix a bug, but it simplifies the
5965 code away from its former Hollerith-constant appearance, and it's
5966 one less 'int' to worry about when looking at integer-overflow issues.
51cab52b 5967 (string_to_number): Simplify 2011-04-26 change by invoking xsignal1.
e4d29b33 5968
eb49b136
PE
5969 * lisp.h (DEFUN): Remove bogus use of sizeof (struct Lisp_Subr).
5970 This didn't break anything, but it didn't help either.
5971 It's confusing to put a bogus integer in a place where the actual
5972 value does not matter.
9f62aeb1 5973 (LIST_END_P): Remove unused macro and its bogus comment.
cbeff735 5974 (make_fixnum_or_float): Remove unnecessary cast to EMACS_INT.
eb49b136 5975
15375a22
PE
5976 * lisp.h (union Lisp_Object.i): EMACS_INT, not EMACS_UINT.
5977 This is for consistency with the ordinary, non-USE_LISP_UNION_TYPE,
5978 implementation.
b61cc01c
PE
5979 (struct Lisp_Bool_Vector.size): EMACS_INT, not EMACS_UINT.
5980 We prefer signed types, and the value cannot exceed the EMACS_INT
5981 range anyway (because otherwise the length would not be representable).
9a8e8d9b
PE
5982 (XSET) [USE_LISP_UNION_TYPE]: Use uintptr_t and intptr_t,
5983 not EMACS_UINT and EMACS_INT, when converting pointer to integer.
5984 This avoids a GCC warning when WIDE_EMACS_INT.
15375a22 5985
53b2623d
PE
5986 * indent.c (sane_tab_width): New function.
5987 (current_column, scan_for_column, Findent_to, position_indentation)
5988 (compute_motion): Use it. This is just for clarity.
8fcaf9cc 5989 (Fcompute_motion): Don't assume hscroll and tab offset fit in int.
53b2623d 5990
51cab52b 5991 * image.c (xbm_image_p): Don't assume stated width, height fit in int.
45aebb64 5992
f2ed8a70
PE
5993 * lisp.h (lint_assume): New macro.
5994 * composite.c (composition_gstring_put_cache):
5995 * ftfont.c (ftfont_shape_by_flt): Use it to pacify GCC 4.6.0.
5996
abe80cc6
PE
5997 * editfns.c, insdel.c:
5998 Omit unnecessary forward decls, to simplify future changes.
a9e860e1 5999
b02c740e
PE
6000 * ftfont.c (ftfont_shape_by_flt): Use signed integers for lengths.
6001
ebc96716
PE
6002 * font.c (Ffont_shape_gstring): Don't assume glyph len fits in 'int'.
6003
b4e50fa0 6004 * fns.c (Ffillarray): Don't assume bool vector size fits in 'int'.
f03dc6ef 6005 Use much-faster test for byte-length change.
311d5d7c 6006 Don't assume string byte-length fits in 'int'.
a4cf38e4 6007 Check that character arg fits in 'int'.
85461888 6008 (mapcar1): Declare byte as byte, for clarity.
b4e50fa0 6009
c0c1ee9f
PE
6010 * alloc.c (Fmake_bool_vector): Avoid unnecessary multiplication.
6011
a498d7f4
PE
6012 * fns.c (concat): Catch string overflow earlier.
6013 Do not rely on integer wraparound.
6014
51cab52b
PE
6015 * dispextern.h (struct it.overlay_strings_charpos)
6016 (struct it.selective): Now EMACS_INT, not int.
87830974
PE
6017 * xdisp.c (forward_to_next_line_start)
6018 (back_to_previous_visible_line_start)
6019 (reseat_at_next_visible_line_start, next_element_from_buffer):
6020 Don't arbitrarily truncate the value of 'selective' to int.
6021
76031fad
PE
6022 * xdisp.c (init_iterator): Use XINT, not XFASTINT; it might be < 0.
6023
5eb55db9
PE
6024 * composite.c: Don't truncate sizes to 'int'.
6025 (composition_gstring_p, composition_reseat_it)
6026 (composition_adjust_point): Use EMACS_INT, not int.
7d100a81
PE
6027 (get_composition_id, composition_gstring_put_cache): Use EMACS_INT,
6028 not EMACS_UINT, for indexes.
5eb55db9 6029
0703a717
PE
6030 * category.h (CATEGORY_SET_P): Remove unnecessary cast to EMACS_INT.
6031
d6202519
PE
6032 * buffer.c: Include <verify.h>.
6033 (struct sortvec.priority, struct sortstr.priority):
8961a454 6034 Now EMACS_INT, not int.
c20998a7 6035 (compare_overlays, cmp_for_strings): Avoid subtraction overflow.
67c36fce
PE
6036 (struct sortstr.size, record_overlay_string)
6037 (struct sortstrlist.size, struct sortlist.used):
6038 Don't truncate size to int.
6039 (record_overlay_string): Check for size-calculation overflow.
d6202519 6040 (init_buffer_once): Check at compile-time, not run-time.
fadf4e30 6041
d5a19415
JM
60422011-06-22 Jim Meyering <meyering@redhat.com>
6043
029529ac 6044 Don't leak an XBM-image-sized buffer
d5a19415
JM
6045 * image.c (xbm_load): Free the image buffer after using it.
6046
a9041e6c
PE
60472011-06-21 Paul Eggert <eggert@cs.ucla.edu>
6048
6049 Port to Sun C.
6050 * composite.c (find_automatic_composition): Omit needless 'return 0;'
6051 that Sun C diagnosed.
6052 * fns.c (secure_hash): Fix pointer signedness issue.
6053 * intervals.c (static_offset_intervals): New function.
6054 (offset_intervals): Use it.
6055
7f3f739f
LL
60562011-06-21 Leo Liu <sdl.web@gmail.com>
6057
6058 * deps.mk (fns.o):
6059 * makefile.w32-in ($(BLD)/fns.$(O)): Include sha256.h and
6060 sha512.h.
6061
6062 * fns.c (secure_hash): Rename from crypto_hash_function and change
6063 the first arg to accept symbols.
5b66d427 6064 (Fsecure_hash): New primitive.
7f3f739f
LL
6065 (syms_of_fns): New symbols.
6066
76147d94
DD
60672011-06-20 Deniz Dogan <deniz@dogan.se>
6068
6069 * process.c (Fset_process_buffer): Clarify return value in
6070 docstring.
6071
7d7d0045
CY
60722011-06-18 Chong Yidong <cyd@stupidchicken.com>
6073
6074 * dispnew.c (add_window_display_history): Use BVAR.
6075
6076 * xdisp.c (debug_method_add): Use BVAR.
6077 (check_window_end, dump_glyph_matrix, dump_glyph)
6078 (dump_glyph_row, dump_glyph_string): Convert arglist to ANSI C.
6079
6080 * xfaces.c (check_lface_attrs, check_lface, dump_realized_face):
6081 Likewise.
6082
6083 * xfns.c (Fx_create_frame, x_create_tip_frame): Delay image cache
6084 check till after the cache is created in init_frame_faces.
6085
ff2bc410
SM
60862011-06-17 Stefan Monnier <monnier@iro.umontreal.ca>
6087
6088 * fns.c (Fsafe_length): Yet another int/Lisp_Object mixup.
6089
28177add
PE
60902011-06-16 Paul Eggert <eggert@cs.ucla.edu>
6091
dd3482fe
PE
6092 * lisp.h: Include <limits.h>, for INT_MAX, LONG_MAX, LLONG_MAX.
6093 Without this, prin1 mishandles Lisp_Misc_Save_Value printing on
6094 hosts with pre-C99 libraries, because pD is wrongly defined to "t".
6095
393d71f3 6096 Improve buffer-overflow checking (Bug#8873).
1c8e352f
PE
6097 * fileio.c (Finsert_file_contents):
6098 * insdel.c (insert_from_buffer_1, replace_range, replace_range_2):
6099 Remove the old (too-loose) buffer overflow checks.
6100 They weren't needed, since make_gap checks for buffer overflow.
6101 * insdel.c (make_gap_larger): Catch buffer overflows that were missed.
6102 The old code merely checked for Emacs fixnum overflow, and relied
6103 on undefined (wraparound) behavior. The new code avoids undefined
6104 behavior, and also checks for ptrdiff_t and/or size_t overflow.
6105
2e6813b0 6106 * editfns.c (Finsert_char): Don't dump core with very negative counts.
21d890a4
PE
6107 Tune. Don't use wider integers than needed. Don't use alloca.
6108 Use a bigger 'string' buffer. Rewrite to avoid 'n > 0' test.
2e6813b0 6109
599a9e4f
PE
6110 * insdel.c (replace_range): Fix buf overflow when insbytes < outgoing.
6111
99561444
PE
6112 * insdel.c, lisp.h (buffer_overflow): New function.
6113 (insert_from_buffer_1, replace_range, replace_range_2):
6114 * insdel.c (make_gap_larger):
6115 * editfns.c (Finsert_char):
6116 * fileio.c (Finsert_file_contents): Use it, to normalize wording.
6117
28177add
PE
6118 * buffer.h (BUF_BYTES_MAX): Cast to ptrdiff_t so that it's signed.
6119
e69dafad
PE
61202011-06-15 Paul Eggert <eggert@cs.ucla.edu>
6121
4baa020d 6122 Integer overflow and signedness fixes (Bug#8873, Bug#8828).
ff672d2c 6123
b1c46f02
PE
6124 * ccl.c (ASCENDING_ORDER): New macro, to work around GCC bug 43772.
6125 (GET_CCL_RANGE, IN_INT_RANGE): Use it.
6126
e69dafad
PE
6127 * fileio.c: Don't assume EMACS_INT fits in off_t.
6128 (emacs_lseek): New static function.
6129 (Finsert_file_contents, Fwrite_region): Use it.
6130 Use SEEK_SET, SEEK_CUR, SEEK_END as appropriate.
6131
566684ea
PE
6132 * fns.c (Fload_average): Don't assume 100 * load average fits in int.
6133
e6966cd6
PE
6134 * fns.c: Don't overflow int when computing a list length.
6135 * fns.c (QUIT_COUNT_HEURISTIC): New constant.
6136 (Flength, Fsafe_length): Use EMACS_INT, not int, to avoid unwanted
6137 truncation on 64-bit hosts. Check for QUIT every
6138 QUIT_COUNT_HEURISTIC entries rather than every other entry; that's
6139 faster and is responsive enough.
6140 (Flength): Report an error instead of overflowing an integer.
6141 (Fsafe_length): Return a float if the value is not representable
6142 as a fixnum. This shouldn't happen except in contrived situations.
6346d301 6143 (Fnthcdr, Fsort): Don't assume list length fits in int.
de41a810 6144 (Fcopy_sequence): Don't assume vector length fits in int.
00c604f2 6145
dd0b0efb
PE
6146 * alloc.c: Check that resized vectors' lengths fit in fixnums.
6147 (header_size, word_size): New constants.
6148 (allocate_vectorlike): Don't check size overflow here.
6149 (allocate_vector): Check it here instead, since this is the only
6150 caller of allocate_vectorlike that could cause overflow.
6151 Check that the new vector's length is representable as a fixnum.
6152
86fe5cfe
PE
6153 * fns.c (next_almost_prime): Don't return a multiple of 3 or 5.
6154 The previous code was bogus. For example, next_almost_prime (32)
6155 returned 39, which is undesirable as it is a multiple of 3; and
6156 next_almost_prime (24) returned 25, which is a multiple of 5 so
6157 why was the code bothering to check for multiples of 7?
6158
80e88859
PE
6159 * bytecode.c (exec_byte_code): Use ptrdiff_t, not int, for vector length.
6160
4a2f0ad6
PE
6161 * eval.c, doprnt.c (SIZE_MAX): Remove; inttypes.h defines this now.
6162
f66c7cf8
PE
6163 Variadic C functions now count arguments with ptrdiff_t.
6164 This partly undoes my 2011-03-30 change, which replaced int with size_t.
6165 Back then I didn't know that the Emacs coding style prefers signed int.
6166 Also, in the meantime I found a few more instances where arguments
4a2f0ad6
PE
6167 were being counted with int, which may truncate counts on 64-bit
6168 machines, or EMACS_INT, which may be unnecessarily wide.
f66c7cf8
PE
6169 * lisp.h (struct Lisp_Subr.function.aMANY)
6170 (DEFUN_ARGS_MANY, internal_condition_case_n, safe_call):
6171 Arg counts are now ptrdiff_t, not size_t.
6172 All variadic functions and their callers changed accordingly.
6173 (struct gcpro.nvars): Now size_t, not size_t. All uses changed.
6174 * bytecode.c (exec_byte_code): Check maxdepth for overflow,
6175 to avoid potential buffer overrun. Don't assume arg counts fit in 'int'.
6176 * callint.c (Fcall_interactively): Check arg count for overflow,
6177 to avoid potential buffer overrun. Use signed char, not 'int',
6178 for 'varies' array, so that we needn't bother to check its size
6179 calculation for overflow.
6180 * editfns.c (Fformat): Use ptrdiff_t, not EMACS_INT, to count args.
6181 * eval.c (apply_lambda):
6182 * fns.c (Fmapconcat): Use XFASTINT, not XINT, to get args length.
6183 (struct textprop_rec.argnum): Now ptrdiff_t, not int. All uses changed.
6184 (mapconcat): Use ptrdiff_t, not int and EMACS_INT, to count args.
6185
a1759b76
PE
6186 * callint.c (Fcall_interactively): Don't use index var as event count.
6187
d96be9fc
PE
6188 * vm-limit.c (check_memory_limits): Fix incorrect extern function decls.
6189 * mem-limits.h (SIZE): Remove; no longer used.
6190
a690a978 6191 * xterm.c (x_alloc_nearest_color_1): Prefer int to long when int works.
5efd304b 6192
578c21e6
PE
6193 Remove unnecessary casts.
6194 * xterm.c (x_term_init):
6195 * xfns.c (x_set_border_pixel):
6196 * widget.c (create_frame_gcs): Remove casts to unsigned long etc.
6197 These aren't needed now that we assume ANSI C.
6198
96f53c6c
PE
6199 * sound.c (Fplay_sound_internal): Remove cast to unsigned long.
6200 It's more likely to cause problems (due to unsigned overflow)
6201 than to cure them.
6202
83c77d31
PE
6203 * dired.c (Ffile_attributes): Don't use 32-bit hack on 64-bit hosts.
6204
ee2079f1
PE
6205 * unexelf.c (unexec): Don't assume BSS addr fits in unsigned.
6206
6da65536
PE
6207 * xterm.c (handle_one_xevent): Omit unnecessary casts to unsigned.
6208
7147c4a4
PE
6209 * keyboard.c (modify_event_symbol): Don't limit alist len to UINT_MAX.
6210
193e32d9
PE
6211 * lisp.h (CHAR_TABLE_SET): Omit now-redundant test.
6212
e5533da6
PE
6213 * lread.c (Fload): Don't compare a possibly-garbage time_t value.
6214
9910e595
PE
6215 GLYPH_CODE_FACE returns EMACS_INT, not int.
6216 * dispextern.h (merge_faces):
6217 * xfaces.c (merge_faces):
01103c44
PE
6218 * xdisp.c (get_next_display_element, next_element_from_display_vector):
6219 Don't assume EMACS_INT fits in int.
9910e595 6220
2638320e
PE
6221 * character.h (CHAR_VALID_P): Remove unused parameter.
6222 * fontset.c, lisp.h, xdisp.c: All uses changed.
6223
045eb8d9
PE
6224 * editfns.c (Ftranslate_region_internal): Omit redundant test.
6225
c1f134b5
PE
6226 * fns.c (concat): Minor tuning based on overflow analysis.
6227 This doesn't fix any bugs. Use int to hold character, instead
6228 of constantly refetching from Emacs object. Use XFASTINT, not
6229 XINT, for value known to be a character. Don't bother comparing
6230 a single byte to 0400, as it's always less.
6231
395fcb93 6232 * floatfns.c (Fexpt):
327eeec8
PE
6233 * fileio.c (make_temp_name): Omit unnecessary cast to unsigned.
6234
abbd3d23
PE
6235 * editfns.c (Ftranslate_region_internal): Use int, not EMACS_INT
6236 for characters.
6237
684a03ef
PE
6238 * doc.c (get_doc_string): Omit (unsigned)c that mishandled negatives.
6239
0fed43f3
PE
6240 * data.c (Faset): If ARRAY is a string, check that NEWELT is a char.
6241 Without this fix, on a 64-bit host (aset S 0 4294967386) would
6242 incorrectly succeed when S was a string, because 4294967386 was
6243 truncated before it was used.
6244
8fd02eb7
PE
6245 * chartab.c (Fchar_table_range): Use CHARACTERP to check range.
6246 Otherwise, an out-of-range integer could cause undefined behavior
6247 on a 64-bit host.
6248
f8c86b69
PE
6249 * composite.c: Use int, not EMACS_INT, for characters.
6250 (fill_gstring_body, composition_compute_stop_pos): Use int, not
6251 EMACS_INT, for values that are known to be in character range.
6252 This doesn't fix any bugs but is the usual style inside Emacs and
6253 may generate better code on 32-bit machines.
6254
34206dd2
PE
6255 Make sure a 64-bit char is never passed to ENCODE_CHAR.
6256 This is for reasons similar to the recent CHAR_STRING fix.
6257 * charset.c (Fencode_char): Check that character arg is actually
6258 a character. Pass an int to ENCODE_CHAR.
6259 * charset.h (ENCODE_CHAR): Verify that the character argument is no
6260 wider than 'int', as a compile-time check to prevent future regressions
6261 in this area.
6262
c5958d4c 6263 * character.c (char_string): Remove unnecessary casts.
13bdea59
PE
6264
6265 Make sure a 64-bit char is never passed to CHAR_STRING.
6266 Otherwise, CHAR_STRING would do the wrong thing on a 64-bit platform,
6267 by silently ignoring the top 32 bits, allowing some values
6268 that were far too large to be valid characters.
6269 * character.h: Include <verify.h>.
6270 (CHAR_STRING, CHAR_STRING_ADVANCE): Verify that the character
6271 arguments are no wider than unsigned, as a compile-time check
6272 to prevent future regressions in this area.
6273 * data.c (Faset):
01103c44 6274 * editfns.c (Fchar_to_string, general_insert_function, Finsert_char)
13bdea59
PE
6275 (Fsubst_char_in_region):
6276 * fns.c (concat):
6277 * xdisp.c (decode_mode_spec_coding):
6278 Adjust to CHAR_STRING's new requirement.
6279 * editfns.c (Finsert_char, Fsubst_char_in_region):
6280 * fns.c (concat): Check that character args are actually
6281 characters. Without this test, these functions did the wrong
6282 thing with wildly out-of-range values on 64-bit hosts.
6283
d37ca623
PE
6284 Remove incorrect casts to 'unsigned' that lose info on 64-bit hosts.
6285 These casts should not be needed on 32-bit hosts, either.
6286 * keyboard.c (read_char):
6287 * lread.c (Fload): Remove casts to unsigned.
6288
ea204efb
PE
6289 * lisp.h (UNSIGNED_CMP): New macro.
6290 This fixes comparison bugs on 64-bit hosts.
6291 (ASCII_CHAR_P): Use it.
6292 * casefiddle.c (casify_object):
01103c44 6293 * character.h (ASCII_BYTE_P, CHAR_VALID_P)
ea204efb
PE
6294 (SINGLE_BYTE_CHAR_P, CHAR_STRING):
6295 * composite.h (COMPOSITION_ENCODE_RULE_VALID):
6296 * dispextern.h (FACE_FROM_ID):
6297 * keyboard.c (read_char): Use UNSIGNED_CMP.
6298
41cb286c
PE
6299 * xmenu.c (dialog_selection_callback) [!USE_GTK]: Cast to intptr_t,
6300 not to EMACS_INT, to avoid GCC warning.
6301
4a1b9832
PE
6302 * xfns.c (x_set_scroll_bar_default_width): Remove unused 'int' locals.
6303
55daad71
PE
6304 * buffer.h (PTR_BYTE_POS, BUF_PTR_BYTE_POS): Remove harmful cast.
6305 The cast incorrectly truncated 64-bit byte offsets to 32 bits, and
6306 isn't needed on 32-bit machines.
8f95c75c 6307
01103c44
PE
6308 * buffer.c (Fgenerate_new_buffer_name):
6309 Use EMACS_INT for count, not int.
0ceccced 6310 (advance_to_char_boundary): Return EMACS_INT, not int.
e762cafe
PE
6311
6312 * data.c (Qcompiled_function): Now static.
6313
c6f072e7
PE
6314 * window.c (window_body_lines): Now static.
6315
20ce5912
PE
6316 * image.c (gif_load): Rename local to avoid shadowing.
6317
9c4c5f81
PE
6318 * lisp.h (SAFE_ALLOCA_LISP): Check for integer overflow.
6319 (struct Lisp_Save_Value): Use ptrdiff_t, not int, for 'integer' member.
6320 * alloc.c (make_save_value): Integer argument is now of type
6321 ptrdiff_t, not int.
6322 (mark_object): Use ptrdiff_t, not int.
6323 * lisp.h (pD): New macro.
6324 * print.c (print_object): Use it.
6325
c0c5c8ae
PE
6326 * alloc.c: Use EMACS_INT, not int, to count objects.
6327 (total_conses, total_markers, total_symbols, total_vector_size)
6328 (total_free_conses, total_free_markers, total_free_symbols)
01103c44
PE
6329 (total_free_floats, total_floats, total_free_intervals)
6330 (total_intervals, total_strings, total_free_strings):
c0c5c8ae
PE
6331 Now EMACS_INT, not int. All uses changed.
6332 (Fgarbage_collect): Compute overall total using a double, so that
6333 integer overflow is less likely to be a problem. Check for overflow
6334 when converting back to an integer.
5a25e253
PE
6335 (n_interval_blocks, n_string_blocks, n_float_blocks, n_cons_blocks)
6336 (n_vectors, n_symbol_blocks, n_marker_blocks): Remove.
6337 These were 'int' variables that could overflow on 64-bit hosts;
6338 they were never used, so remove them instead of repairing them.
211a0b2a 6339 (nzombies, ngcs, max_live, max_zombies): Now EMACS_INT, not 'int'.
6349ae4d
PE
6340 (inhibit_garbage_collection): Set gc_cons_threshold to max value.
6341 Previously, this ceilinged at INT_MAX, but that doesn't work on
6342 64-bit machines.
e46bb31a 6343 (allocate_pseudovector): Don't use EMACS_INT when int would do.
c0c5c8ae 6344
c78baabf 6345 * alloc.c (Fmake_bool_vector): Don't assume vector size fits in int.
86f61a15 6346 (allocate_vectorlike): Check for ptrdiff_t overflow.
b6439961
PE
6347 (mark_vectorlike, mark_char_table, mark_object): Avoid EMACS_UINT
6348 when a (possibly-narrower) signed value would do just as well.
6349 We prefer using signed arithmetic, to avoid comparison confusion.
c78baabf 6350
c9d624c6
PE
6351 * alloc.c: Catch some string size overflows that we were missing.
6352 (XMALLOC_OVERRUN_CHECK_SIZE) [!XMALLOC_OVERRUN_CHECK]: Define to 0,
6353 for convenience in STRING_BYTES_MAX.
6354 (STRING_BYTES_MAX): New macro, superseding the old one in lisp.h.
6355 The definition here is exact; the one in lisp.h was approximate.
6356 (allocate_string_data): Check for string overflow. This catches
6357 some instances we weren't catching before. Also, it catches
6358 size_t overflow on (unusual) hosts where SIZE_MAX <= min
6359 (PTRDIFF_MAX, MOST_POSITIVE_FIXNUM), e.g., when size_t is 32 bits
6360 and ptrdiff_t and EMACS_INT are both 64 bits.
c78baabf 6361
c9d624c6
PE
6362 * character.c, coding.c, doprnt.c, editfns.c, eval.c:
6363 All uses of STRING_BYTES_MAX replaced by STRING_BYTES_BOUND.
640c8776 6364 * lisp.h (STRING_BYTES_BOUND): Rename from STRING_BYTES_MAX.
c9d624c6 6365
353032ce
PE
6366 * character.c (string_escape_byte8): Fix nbytes/nchars typo.
6367
2bccce07
PE
6368 * alloc.c (Fmake_string): Check for out-of-range init.
6369
0ac30604
SM
63702011-06-15 Stefan Monnier <monnier@iro.umontreal.ca>
6371
6372 * eval.c (Fdefvaralias): Also mark the target as variable-special-p.
6373
c195f2de
JD
63742011-06-14 Jan Djärv <jan.h.d@swipnet.se>
6375
6376 * xfns.c (x_set_scroll_bar_default_width): Remove argument to
6377 xg_get_default_scrollbar_width.
6378
6379 * gtkutil.c: Include emacsgtkfixed.h if HAVE_GTK3.
6380 (int_gtk_range_get_value): Move to the scroll bar part of the file.
6381 (style_changed_cb): Call update_theme_scrollbar_width and call
6382 x_set_scroll_bar_default_width and xg_frame_set_char_size for
6383 all frames (Bug#8505).
6384 (xg_create_frame_widgets): Call emacs_fixed_new if HAVE_GTK3 (Bug#8505).
6385 Call gtk_window_set_resizable if HAVE_GTK3.
6386 (x_wm_set_size_hint): Call emacs_fixed_set_min_size with min width
6387 and height if HAVE_GTK3 (Bug#8505).
6388 (scroll_bar_width_for_theme): New variable.
6389 (update_theme_scrollbar_width): New function.
6390 (xg_get_default_scrollbar_width): Move code to
6391 update_theme_scrollbar_width, just return scroll_bar_width_for_theme.
6392 (xg_initialize): Call update_theme_scrollbar_width.
6393
6394 * gtkutil.h (xg_get_default_scrollbar_width): Remove argument.
6395
6396 * emacsgtkfixed.c, emacsgtkfixed.h: New files.
6397
e10ac9f1
MR
63982011-06-12 Martin Rudalics <rudalics@gmx.at>
6399
6400 * frame.c (make_frame): Call other_buffer_safely instead of
6401 other_buffer.
6402
6403 * window.c (temp_output_buffer_show): Call display_buffer with
6404 second argument Vtemp_buffer_show_specifiers and reset latter
6405 immediately after the call.
6406 (Vtemp_buffer_show_specifiers): New variable.
6407 (auto_window_vscroll_p, next_screen_context_lines)
6408 (Vscroll_preserve_screen_position): Remove leading asterisks from
6409 doc-strings.
6410
2d3c217e 64112011-06-12 Paul Eggert <eggert@cs.ucla.edu>
4475bec4 6412
7b7f97e8 6413 Fix minor problems found by GCC 4.6.0 static checking.
4475bec4
PE
6414 * buffer.c (Qclone_number): Remove for now, as it's unused.
6415 (record_buffer, Funrecord_buffer): Rename local to avoid shadowing.
6416 (record_buffer): Remove unused local.
6417 * frame.c (other_visible_frames, frame_buffer_list): Now static.
6418 (set_frame_buffer_list): Remove; unused.
6419 * frame.h (other_visible_frames): Remove decl.
6420 * keyboard.h (menu_items_inuse): Declare only if USE_GTK || USE_MOTIF.
6421 * lisp.h (frame_buffer_list, set_frame_buffer_list): Remove decls.
6422 (add_gpm_wait_descriptor, delete_gpm_wait_descriptor): Declare only
6423 if HAVE_GPM.
6424 * menu.c (menu_items_inuse): Now static unless USE_GTK || USE_MOTIF.
6425 * process.c (add_gpm_wait_descriptor, delete_gpm_wait_descriptor):
6426 Define only if HAVE_GPM.
6427 * widget.c (EmacsFrameResize, emacsFrameClassRec): Now static.
6428 (update_hints_inhibit): Remove; never set. All uses removed.
6429 * widgetprv.h (emacsFrameClassRec): Remove decl.
6430 * window.c (delete_deletable_window): Now returns void, since it
6431 wasn't returning anything.
6432 (compare_window_configurations): Remove unused locals.
6433 * xfns.c (x_set_scroll_bar_default_width): Remove unused locals.
6434 * xmenu.c (x_menu_set_in_use): Define only if USE_GTK || USE_MOTIF.
4475bec4
PE
6435 (dialog_selection_callback) [!USE_GTK]: Prefer intptr_t for integers
6436 the same widths as pointers. This follows up on the 2011-05-06 patch.
6437 * xterm.c (x_alloc_lighter_color_for_widget): Define only if USE_LUCID.
6438 * xterm.h: Likewise.
6439 (x_menu_set_in_use): Declare only if USE_GTK || USE_MOTIF.
6440
1384b89e
JB
64412011-06-12 Juanma Barranquero <lekktu@gmail.com>
6442
6443 * makefile.w32-in: Update dependencies.
6444 (LISP_H): Add lib/intprops.h.
6445
1100a63c
CY
64462011-06-11 Chong Yidong <cyd@stupidchicken.com>
6447
6448 * image.c (gif_load): Add animation frame delay to the metadata.
6449 (syms_of_image): Use DEFSYM. New symbol `delay'.
6450
6198ccd0
MR
64512011-06-11 Martin Rudalics <rudalics@gmx.at>
6452
6453 * window.c (delete_deletable_window): Re-add.
6454 (Fset_window_configuration): Rewrite to handle dead buffers and
6455 consequently deletable windows.
6456 (window_tree, Fwindow_tree): Remove. Supply functionality in
6457 window.el.
6458 (compare_window_configurations): Simplify code.
6459
b6e3633c
AS
64602011-06-11 Andreas Schwab <schwab@linux-m68k.org>
6461
1ab0dee5
AS
6462 * image.c (imagemagick_load_image): Fix type mismatch.
6463 (Fimagemagick_types): Likewise.
6464
b6e3633c
AS
6465 * window.h (replace_buffer_in_windows): Declare.
6466
9397e56f
MR
64672011-06-11 Martin Rudalics <rudalics@gmx.at>
6468
6469 * buffer.c: New Lisp objects Qbuffer_list_update_hook and
6470 Qclone_number. Remove external declaration of Qdelete_window.
6471 (Fbuffer_list): Rewrite doc-string. Minor restructuring of
6472 code.
640c8776
SM
6473 (Fget_buffer_create, Fmake_indirect_buffer, Frename_buffer):
6474 Run Qbuffer_list_update_hook if allowed.
9397e56f
MR
6475 (Fother_buffer): Rewrite doc-string. Major rewrite for new
6476 buffer list implementation.
6477 (other_buffer_safely): New function.
6478 (Fkill_buffer): Replace call to replace_buffer_in_all_windows by
6479 calls to replace_buffer_in_windows and
6480 replace_buffer_in_windows_safely. Run Qbuffer_list_update_hook
6481 if allowed.
6482 (record_buffer): Inhibit quitting and rewrite using quittable
6483 functions. Run Qbuffer_list_update_hook if allowed.
6484 (Frecord_buffer, Funrecord_buffer): New functions.
640c8776
SM
6485 (switch_to_buffer_1, Fswitch_to_buffer): Remove.
6486 Move switch-to-buffer to window.el.
9397e56f
MR
6487 (bury-buffer): Move to window.el.
6488 (Vbuffer_list_update_hook): New variable.
6489
6490 * lisp.h (other_buffer_safely): Add prototype in buffer.c
6491 section.
6492
6493 * window.h (resize_frame_windows): Move up in code.
6494 (Fwindow_frame): Remove EXFUN.
6495 (replace_buffer_in_all_windows): Remove prototype.
6496 (replace_buffer_in_windows_safely): Add prototype.
6497
6498 * window.c: Declare Qdelete_window static again. Move down
6499 declaration of select_count.
6500 (Fnext_window, Fprevious_window): Rewrite doc-strings.
6501 (Fother_window): Move to window.el.
6502 (window_loop): Remove DELETE_BUFFER_WINDOWS and UNSHOW_BUFFER
6503 cases. Add REPLACE_BUFFER_IN_WINDOWS_SAFELY case.
6504 (Fdelete_windows_on, Freplace_buffer_in_windows): Move to
6505 window.el.
6506 (replace_buffer_in_windows): Implement by calling
6507 Qreplace_buffer_in_windows.
6508 (replace_buffer_in_all_windows): Remove with some functionality
6509 moved into replace_buffer_in_windows_safely.
6510 (replace_buffer_in_windows_safely): New function.
6511 (select_window_norecord, select_frame_norecord): Move in front
6512 of run_window_configuration_change_hook. Remove now obsolete
6513 declarations.
640c8776
SM
6514 (Fset_window_buffer): Rewrite doc-string.
6515 Call Qrecord_window_buffer.
9397e56f
MR
6516 (keys_of_window): Move binding for other-window to window.el.
6517
b50691aa
CY
65182011-06-11 Chong Yidong <cyd@stupidchicken.com>
6519
6520 * dispextern.h (struct image): Replace data member, whose int_val
6521 and ptr_val fields were not used by anything, with a single
6522 lisp_val object.
6523
6524 * image.c (Fimage_metadata, make_image, mark_image, tiff_load)
6525 (gif_clear_image, gif_load, imagemagick_load_image)
6526 (gs_clear_image, gs_load): Callers changed.
6527
3f754b86
PE
65282011-06-10 Paul Eggert <eggert@cs.ucla.edu>
6529
cca69397
PE
6530 * buffer.h: Include <time.h>, for time_t.
6531 Needed to build on FreeBSD 8.2. Problem reported by Herbert J. Skuhra.
6532
109e28d0
PE
6533 Fix minor problems found by static checking.
6534
60737f02
PE
6535 * image.c (PixelGetMagickColor): Declare if ImageMagick headers don't.
6536
4b66faf3
PE
6537 Make identifiers static if they are not used in other modules.
6538 * data.c (Qcompiled_function, Qframe, Qvector):
6539 * image.c (QimageMagick, Qsvg):
6540 * minibuf.c (Qmetadata):
6541 * window.c (resize_window_check, resize_root_window): Now static.
6542 * window.h (resize_window_check, resize_root_window): Remove decls.
6543
109e28d0
PE
6544 * window.c (window_deletion_count, delete_deletable_window):
6545 Remove; unused.
46a4ce9e
PE
6546 (window_body_lines): Now static.
6547 (Fdelete_other_windows_internal): Mark vars as initialized.
6548 Make sure 'resize_failed' is initialized.
6549 (run_window_configuration_change_hook): Rename local to avoid shadowing.
6550 (resize_window_apply): Remove unused local.
6551 * window.h (delete_deletable_window): Remove decl.
6552
109e28d0 6553 * image.c (gif_load, svg_load_image): Rename locals to avoid shadowing.
33290528
PE
6554 (imagemagick_load_image): Fix pointer signedness problem by changing
6555 last arg from unsigned char * to char *. All uses changed.
6556 Also, fix a local for similar reasons.
6557 Remove unused locals. Remove locals to avoid shadowing.
6558 (fn_rsvg_handle_free): Remove; unused.
6559 (svg_load, svg_load_image): Fix pointer signedness problem.
f7e13da3 6560 (imagemagick_load_image): Don't use garbage pointer image_wand.
33290528 6561
3f754b86
PE
6562 * ftfont.c (ftfont_get_metrics, ftfont_drive_otf): Remove unused locals.
6563
2547adb1
CY
65642011-06-10 Chong Yidong <cyd@stupidchicken.com>
6565
6566 * image.c (gif_load): Fix omitted cast error introduced by
6567 2011-06-06 change.
6568
2c8e37d4
MR
65692011-06-10 Martin Rudalics <rudalics@gmx.at>
6570
6571 * window.h (resize_proportionally, orig_total_lines)
6572 (orig_top_line): Remove from window structure.
6573 (set_window_height, set_window_width, change_window_heights)
6574 (Fdelete_window): Remove prototypes.
6575 (resize_frame_windows): Remove duplicate declaration.
6576
440a42e3
EZ
65772011-06-10 Eli Zaretskii <eliz@gnu.org>
6578
6579 * window.h (resize_frame_windows, resize_window_check)
6580 (delete_deletable_window, resize_root_window)
6581 (resize_frame_windows): Declare prototypes.
6582
6583 * window.c (resize_window_apply): Make definition be "static" to
6584 match the prototype.
6585
562dd5e9
MR
65862011-06-10 Martin Rudalics <rudalics@gmx.at>
6587
6588 * window.c: Remove declarations of Qwindow_size_fixed,
6589 window_min_size_1, window_min_size_2, window_min_size,
6590 size_window, window_fixed_size_p, enlarge_window, delete_window.
6591 Remove static from declaration of Qdelete_window, it's
6592 temporarily needed by Fbury_buffer.
6593 (replace_window): Don't assign orig_top_line and
6594 orig_total_lines.
6595 (Fdelete_window, delete_window): Remove. Window deletion is
6596 handled by window.el.
640c8776
SM
6597 (window_loop): Remove DELETE_OTHER_WINDOWS case.
6598 Replace Fdelete_window calls with calls to Qdelete_window.
562dd5e9
MR
6599 (Fdelete_other_windows): Remove. Deleting other windows is
6600 handled by window.el.
6601 (window_fixed_size_p): Remove. Fixed-sizeness of windows is
6602 handled in window.el.
6603 (window_min_size_2, window_min_size_1, window_min_size): Remove.
6604 Window minimum sizes are handled in window.el.
6605 (shrink_windows, size_window, set_window_height)
6606 (set_window_width, change_window_heights, window_height)
6607 (window_width, CURBEG, CURSIZE, enlarge_window)
6608 (adjust_window_trailing_edge, Fadjust_window_trailing_edge)
6609 (Fenlarge_window, Fshrink_window): Remove. Window resizing is
6610 handled in window.el.
6611 (make_dummy_parent): Rename to make_parent_window and give it a
6612 second argument horflag.
6613 (make_window): Don't set resize_proportionally any more.
6614 (Fsplit_window): Remove. Windows are split in window.el.
6615 (save_restore_action, save_restore_orig_size)
6616 (shrink_window_lowest_first, save_restore_orig_size): Remove.
6617 Resize mini windows in window.el.
6618 (grow_mini_window, shrink_mini_window): Implement by calling
6619 Qresize_root_window_vertically, resize_window_check and
6620 resize_window_apply.
640c8776
SM
6621 (saved_window, Fset_window_configuration, save_window_save):
6622 Do not handle orig_top_line, orig_total_lines, and
562dd5e9
MR
6623 resize_proportionally.
6624 (window_min_height, window_min_width): Move to window.el.
6625 (keys_of_window): Move bindings for delete-other-windows,
6626 split-window, delete-window and enlarge-window to window.el.
6627
6628 * buffer.c: Temporarily extern Qdelete_window.
6629 (Fbury_buffer): Temporarily call Qdelete_window instead of
6630 Fdelete_window (Fbury_buffer will move to window.el soon).
6631
6632 * frame.c (set_menu_bar_lines_1): Remove code handling
6633 orig_top_line and orig_total_lines.
6634
6635 * dispnew.c (adjust_frame_glyphs_initially): Don't use
6636 set_window_height but set heights directly.
6637 (change_frame_size_1): Use resize_frame_windows.
6638
6639 * xdisp.c (init_xdisp): Don't use set_window_height but set
6640 heights directly.
6641
640c8776
SM
6642 * xfns.c (x_set_menu_bar_lines, x_set_tool_bar_lines):
6643 Use resize_frame_windows instead of change_window_heights and run
562dd5e9
MR
6644 run_window_configuration_change_hook.
6645
6646 * w32fns.c (x_set_tool_bar_lines): Use resize_frame_windows
6647 instead of change_window_heights and run
6648 run_window_configuration_change_hook.
6649
1a13852e
MR
66502011-06-09 Martin Rudalics <rudalics@gmx.at>
6651
6652 * window.c (replace_window): Rename second argument REPLACEMENT to
6653 NEW. New third argument SETFLAG. Rewrite.
6654 (delete_window, make_dummy_parent): Call replace_window with
6655 third argument 1.
6656 (window_list_1): Move down in code.
6657 (run_window_configuration_change_hook): Move set_buffer part
6658 before select_frame_norecord part in order to unwind correctly.
6659 Rename count1 to count.
6660 (recombine_windows, delete_deletable_window, resize_root_window)
6661 (Fdelete_other_windows_internal)
6662 (Frun_window_configuration_change_hook, make_parent_window)
6663 (resize_window_check, resize_window_apply, Fresize_window_apply)
6664 (resize_frame_windows, Fsplit_window_internal)
640c8776
SM
6665 (Fdelete_window_internal, Fresize_mini_window_internal):
6666 New functions.
1a13852e
MR
6667 (syms_of_window): New variables Vwindow_splits and Vwindow_nest.
6668
f3d1777e
MR
66692011-06-08 Martin Rudalics <rudalics@gmx.at>
6670
496e208e
MR
6671 * window.h (window): Add some new members to window structure -
6672 normal_lines, normal_cols, new_total, new_normal, clone_number,
6673 splits, nest, prev_buffers, next_buffers.
6674 (WINDOW_TOTAL_SIZE): Move here from window.c.
b9e809c2 6675 (MIN_SAFE_WINDOW_WIDTH, MIN_SAFE_WINDOW_HEIGHT): Define here.
496e208e 6676
f3d1777e
MR
6677 * window.c (Fwindow_height, Fwindow_width, Fwindow_full_width_p):
6678 Remove.
496e208e
MR
6679 (make_dummy_parent): Set new members of windows structure.
6680 (make_window): Move down in code. Handle new members of window
6681 structure.
6682 (Fwindow_clone_number, Fwindow_splits, Fset_window_splits)
6683 (Fwindow_nest, Fset_window_nest, Fwindow_new_total)
6684 (Fwindow_normal_size, Fwindow_new_normal, Fwindow_prev_buffers)
6685 (Fset_window_prev_buffers, Fwindow_next_buffers)
640c8776
SM
6686 (Fset_window_next_buffers, Fset_window_clone_number):
6687 New functions.
496e208e
MR
6688 (Fwindow_hscroll, Fwindow_at, Fwindow_point, Fwindow_start)
6689 (Fwindow_end, Fwindow_line_height, Fset_window_dedicated_p):
6690 Doc-string fixes.
6691 (Fwindow_parameters, Fwindow_parameter, Fset_window_parameter):
6692 Argument WINDOW can be now internal window too.
6693 (Fwindow_use_time): Move up in code.
6694 (Fget_buffer_window): Rename argument FRAME to ALL-FRAMES.
6695 Rewrite doc-string.
6696 (Fset_window_configuration, saved_window)
6697 (Fcurrent_window_configuration, save_window_save): Handle new
6698 members of window structure.
b9e809c2
MR
6699 (WINDOW_TOTAL_SIZE, MIN_SAFE_WINDOW_WIDTH)
6700 (MIN_SAFE_WINDOW_HEIGHT): Move to window.h.
6701 (syms_of_window): New Lisp objects Qrecord_window_buffer,
6702 Qwindow_deletable_p, Qdelete_window, Qreplace_buffer_in_windows,
6703 Qget_mru_window, Qresize_root_window,
6704 Qresize_root_window_vertically, Qsafe, Qabove, Qbelow,
6705 Qauto_buffer_name; staticpro them.
f3d1777e 6706
abde8f8c
MR
67072011-06-07 Martin Rudalics <rudalics@gmx.at>
6708
6709 * window.c (Fwindow_total_size, Fwindow_left_column)
6710 (Fwindow_top_line, window_body_lines, Fwindow_body_size)
6711 (Fwindow_list_1): New functions.
6712 (window_box_text_cols): Replace with window_body_cols.
640c8776
SM
6713 (Fwindow_width, Fscroll_left, Fscroll_right):
6714 Use window_body_cols instead of window_box_text_cols.
6715 (delete_window, Fset_window_configuration):
6716 Call delete_all_subwindows with window as argument.
fa8a67e6
MR
6717 (delete_all_subwindows): Take a window as argument and not a
6718 structure. Rewrite.
190b47e6
MR
6719 (window_loop): Remove handling of GET_LRU_WINDOW and
6720 GET_LARGEST_WINDOW.
6721 (Fget_lru_window, Fget_largest_window): Move to window.el.
abde8f8c
MR
6722
6723 * window.h: Extern window_body_cols instead of
fa8a67e6
MR
6724 window_box_text_cols. delete_all_subwindows now takes a
6725 Lisp_Object as argument.
abde8f8c 6726
640c8776
SM
6727 * indent.c (compute_motion, Fcompute_motion):
6728 Use window_body_cols instead of window_box_text_cols.
abde8f8c 6729
fa8a67e6
MR
6730 * frame.c (delete_frame): Call delete_all_subwindows with root
6731 window as argument.
6732
a54e3482
DC
67332011-06-07 Daniel Colascione <dan.colascione@gmail.com>
6734
6735 * fns.c (Fputhash): Document return value.
6736
60002bf5
CY
67372011-06-06 Chong Yidong <cyd@stupidchicken.com>
6738
6739 * image.c (gif_load): Implement gif89a spec "no disposal" method.
6740
0c671da6 67412011-06-06 Paul Eggert <eggert@cs.ucla.edu>
ccd9a01a 6742
b862a52a 6743 Cons<->int and similar integer overflow fixes (Bug#8794).
77984278 6744
be44ca6c
PE
6745 Check for overflow when converting integer to cons and back.
6746 * charset.c (Fdefine_charset_internal, Fdecode_char):
6747 Use cons_to_unsigned to catch overflow.
6748 (Fencode_char): Use INTEGER_TO_CONS.
6749 * composite.h (LGLYPH_CODE): Use cons_to_unsigned.
6750 (LGLYPH_SET_CODE): Use INTEGER_TO_CONS.
6751 * data.c (long_to_cons, cons_to_long): Remove.
6752 (cons_to_unsigned, cons_to_signed): New functions.
6753 These signal an error for invalid or out-of-range values.
6754 * dired.c (Ffile_attributes): Use INTEGER_TO_CONS.
6755 * fileio.c (Fset_visited_file_modtime): Use CONS_TO_INTEGER.
6756 * font.c (Ffont_variation_glyphs):
6757 * fontset.c (Finternal_char_font): Use INTEGER_TO_CONS.
6758 * lisp.h: Include <intprops.h>.
6759 (INTEGER_TO_CONS, CONS_TO_INTEGER): New macros.
6760 (cons_to_signed, cons_to_unsigned): New decls.
6761 (long_to_cons, cons_to_long): Remove decls.
6762 * undo.c (record_first_change): Use INTEGER_TO_CONS.
6763 (Fprimitive_undo): Use CONS_TO_INTEGER.
6764 * xfns.c (Fx_window_property): Likewise.
6765 * xselect.c: Include <limits.h>.
6766 (x_own_selection, selection_data_to_lisp_data):
6767 Use INTEGER_TO_CONS.
6768 (x_handle_selection_request, x_handle_selection_clear)
6769 (x_get_foreign_selection, Fx_disown_selection_internal)
6770 (Fx_get_atom_name, x_send_client_event): Use CONS_TO_INTEGER.
6771 (lisp_data_to_selection_data): Use cons_to_unsigned.
6772 (x_fill_property_data): Use cons_to_signed.
6773 Report values out of range.
6774
d1f3d2af
PE
6775 Check for buffer and string overflow more precisely.
6776 * buffer.h (BUF_BYTES_MAX): New macro.
6777 * lisp.h (STRING_BYTES_MAX): New macro.
6778 * alloc.c (Fmake_string):
6779 * character.c (string_escape_byte8):
6780 * coding.c (coding_alloc_by_realloc):
6781 * doprnt.c (doprnt):
6782 * editfns.c (Fformat):
6783 * eval.c (verror):
6784 Use STRING_BYTES_MAX, not MOST_POSITIVE_FIXNUM,
6785 since they may not be the same number.
6786 * editfns.c (Finsert_char):
6787 * fileio.c (Finsert_file_contents):
6788 Likewise for BUF_BYTES_MAX.
6789
dd52fcea
PE
6790 * image.c: Use ptrdiff_t, not int, for sizes.
6791 (slurp_file): Switch from int to ptrdiff_t.
6792 All uses changed.
6793 (slurp_file): Check that file size fits in both size_t (for
6794 malloc) and ptrdiff_t (for sanity and safety).
6795
7f9bbdbb
PE
6796 * fileio.c (Fverify_visited_file_modtime): Avoid time overflow
6797 if b->modtime has its maximal value.
6798
dfe18f82
PE
6799 * dired.c (Ffile_attributes): Don't assume EMACS_INT has >32 bits.
6800
84acfcf0
PE
6801 Don't assume time_t can fit into int.
6802 * buffer.h (struct buffer.modtime): Now time_t, not int.
6803 * fileio.c (Fvisited_file_modtime): No need for time_t cast now.
6804 * undo.c (Fprimitive_undo): Use time_t, not int, for time_t value.
6805
ccd9a01a
PE
6806 Minor fixes for signed vs unsigned integers.
6807 * character.h (MAYBE_UNIFY_CHAR):
6808 * charset.c (maybe_unify_char):
6809 * keyboard.c (read_char, reorder_modifiers):
6810 XINT -> XFASTINT, since the integer must be nonnegative.
6811 * ftfont.c (ftfont_spec_pattern):
6812 * keymap.c (access_keymap, silly_event_symbol_error):
6813 XUINT -> XFASTINT, since the integer must be nonnegative.
6814 (Fsingle_key_description, preferred_sequence_p): XUINT -> XINT,
6815 since it makes no difference and we prefer signed.
6816 * keyboard.c (record_char): Use XUINT when all the neighbors do.
6817 (access_keymap): NATNUMP -> INTEGERP, since the integer must be
6818 nonnegative.
6819
d6d100dd
SM
68202011-06-06 Stefan Monnier <monnier@iro.umontreal.ca>
6821
6822 * window.h (Fwindow_frame): Declare.
6823
2b6148e4
PE
68242011-06-06 Paul Eggert <eggert@cs.ucla.edu>
6825
6826 * alloc.c: Simplify handling of large-request failures (Bug#8800).
6827 (SPARE_MEMORY): Always define.
6828 (LARGE_REQUEST): Remove.
6829 (memory_full): Use SPARE_MEMORY rather than LARGE_REQUEST.
6830
f230ecc9
MR
68312011-06-06 Martin Rudalics <rudalics@gmx.at>
6832
727e958e
MR
6833 * lisp.h: Move EXFUNS for Fframe_root_window,
6834 Fframe_first_window and Fset_frame_selected_window to window.h.
6835
6836 * window.h: Move EXFUNS for Fframe_root_window,
6837 Fframe_first_window and Fset_frame_selected_window here from
6838 lisp.h.
6839
6840 * frame.c (Fwindow_frame, Fframe_first_window)
6841 (Fframe_root_window, Fframe_selected_window)
6842 (Fset_frame_selected_window): Move to window.c.
6843 (Factive_minibuffer_window): Move to minibuf.c.
6844 (Fother_visible_frames_p): New function.
6845
6846 * minibuf.c (Factive_minibuffer_window): Move here from frame.c.
6847
f230ecc9
MR
6848 * window.c (decode_window, decode_any_window): Move up in code.
6849 (Fwindowp, Fwindow_live_p): Rewrite doc-strings.
6850 (inhibit_frame_unsplittable): Remove unused variable.
bf60a96b
MR
6851 (Fwindow_buffer): Move up and rewrite doc-string.
6852 (Fwindow_parent, Fwindow_vchild, Fwindow_hchild, Fwindow_next)
6853 (Fwindow_prev): New functions.
727e958e
MR
6854 (Fwindow_frame): Move here from frame.c. Accept any window as
6855 argument.
6856 (Fframe_root_window, Fframe_first_window)
6857 (Fframe_selected_window): Move here from frame.c. Accept frame
6858 or arbitrary window as argument. Update doc-strings.
6859 (Fminibuffer_window): Move up in code.
6860 (Fwindow_minibuffer_p): Move up in code and simplify.
d6d100dd
SM
6861 (Fset_frame_selected_window): Move here from frame.c.
6862 Marginal rewrite.
727e958e
MR
6863 (Fselected_window, select_window, Fselect_window): Move up in
6864 code. Minor doc-string fixes.
f230ecc9 6865
4d09bcf6
PE
68662011-06-06 Paul Eggert <eggert@cs.ucla.edu>
6867
6868 * alloc.c (memory_full) [SYSTEM_MALLOC]: Port to MacOS (Bug#8800).
6869 Do not assume that spare memory exists; that assumption is valid
6870 only if SYSTEM_MALLOC.
6871 (LARGE_REQUEST): New macro, so that the issue of large requests
6872 is separated from the issue of spare memory.
6873
810928a2
AS
68742011-06-05 Andreas Schwab <schwab@linux-m68k.org>
6875
172418ad
AS
6876 * editfns.c (Fformat): Correctly handle zero flag with hexadecimal
6877 format. (Bug#8806)
6878
43f862f7
AS
6879 * gtkutil.c (xg_get_default_scrollbar_width): Avoid warning.
6880
810928a2
AS
6881 * xfns.c (x_set_scroll_bar_default_width): Move declarations
6882 before statements.
6883
a059fe24
JD
68842011-06-05 Jan Djärv <jan.h.d@swipnet.se>
6885
6886 * gtkutil.c (xg_get_default_scrollbar_width): New function.
6887
6888 * gtkutil.h: Declare xg_get_default_scrollbar_width.
6889
6890 * xfns.c (x_set_scroll_bar_default_width): If USE_GTK, get
6891 min width by calling x_set_scroll_bar_default_width (Bug#8505).
6892
989bf368
JB
68932011-06-05 Juanma Barranquero <lekktu@gmail.com>
6894
6895 * xdisp.c (single_display_spec_intangible_p): Remove declaration.
6896
4b80f674
CY
68972011-06-04 Chong Yidong <cyd@stupidchicken.com>
6898
6899 * xselect.c (x_clipboard_manager_save): Remove redundant arg.
6900 (x_clipboard_manager_save): Add return value.
d6d100dd
SM
6901 (x_clipboard_manager_error_1, x_clipboard_manager_error_2):
6902 New error handlers.
4b80f674
CY
6903 (x_clipboard_manager_save_frame, x_clipboard_manager_save_all):
6904 Obey Vx_select_enable_clipboard_manager. Catch errors in
6905 x_clipboard_manager_save (Bug#8779).
6906 (Vx_select_enable_clipboard_manager): New variable.
de65b42c 6907 (x_get_foreign_selection): Reduce scope of x_catch_errors (Bug#8790).
4b80f674 6908
99a33b77 69092011-06-04 Dan Nicolaescu <dann@ics.uci.edu>
8b3115e7
DN
6910
6911 * emacs.c (main): Warn when starting a GTK emacs in daemon mode.
6912
99a33b77 69132011-06-04 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
14eca62f
YM
6914
6915 * fringe.c (update_window_fringes): Don't update overlay arrow bitmap
6916 in the current matrix if keep_current_p is non-zero.
6917
8264569d
EZ
69182011-06-04 Eli Zaretskii <eliz@gnu.org>
6919
6920 * bidi.c (bidi_level_of_next_char): Fix last change.
6921
57f97249
EZ
69222011-06-03 Eli Zaretskii <eliz@gnu.org>
6923
fec2107c 6924 Support bidi reordering of text covered by display properties.
57f97249 6925
fec2107c
EZ
6926 * bidi.c (bidi_copy_it): Use offsetof instead of emulating it.
6927 (bidi_fetch_char, bidi_fetch_char_advance): New functions.
6928 (bidi_cache_search, bidi_cache_iterator_state)
6929 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak)
d6d100dd
SM
6930 (bidi_level_of_next_char, bidi_move_to_visually_next):
6931 Support character positions inside a run of characters covered by a
fec2107c
EZ
6932 display string.
6933 (bidi_paragraph_init, bidi_resolve_explicit_1)
6934 (bidi_level_of_next_char): Call bidi_fetch_char and
6935 bidi_fetch_char_advance instead of FETCH_CHAR and
6936 FETCH_CHAR_ADVANCE.
6937 (bidi_init_it): Initialize new members.
6938 (LRE_CHAR, RLE_CHAR, PDF_CHAR, LRO_CHAR, RLO_CHAR): Remove macro
6939 definitions.
6940 (bidi_explicit_dir_char): Lookup character type in bidi_type_table,
6941 instead of using explicit *_CHAR codes.
d6d100dd
SM
6942 (bidi_resolve_explicit, bidi_resolve_weak):
6943 Use FETCH_MULTIBYTE_CHAR instead of FETCH_CHAR, as reordering of
fec2107c
EZ
6944 bidirectional text is supported only in multibyte buffers.
6945 (bidi_init_it): Accept additional argument FRAME_WINDOW_P and use
6946 it to initialize the frame_window_p member of struct bidi_it.
6947 (bidi_cache_iterator_state, bidi_resolve_explicit_1)
6948 (bidi_resolve_explicit, bidi_resolve_weak)
6949 (bidi_level_of_next_char, bidi_move_to_visually_next): Abort if
6950 bidi_it->nchars is non-positive.
6951 (bidi_level_of_next_char): Don't try to lookup the cache for the
6952 next/previous character if nothing is cached there yet, or if we
6953 were just reseat()'ed to a new position.
c40e2fb2 6954
0e14fe90
EZ
6955 * xdisp.c (set_cursor_from_row): Set start and stop points
6956 according to the row's direction when priming the loop that looks
6957 for the glyph on which to display cursor.
6958 (single_display_spec_intangible_p): Function deleted.
6959 (display_prop_intangible_p): Reimplement to call
6960 handle_display_spec instead of single_display_spec_intangible_p.
d6d100dd
SM
6961 Accept 3 additional arguments needed by handle_display_spec.
6962 This fixes incorrect cursor motion across display property with complex
0e14fe90
EZ
6963 values: lists, `(when COND...)' forms, etc.
6964 (single_display_spec_string_p): Support property values that are
6965 lists with the argument STRING its top-level element.
6966 (display_prop_string_p): Fix the condition for processing a
6967 property that is a list to be consistent with handle_display_spec.
fec2107c 6968 (handle_display_spec): New function, refactored from the
fc6f18ce
EZ
6969 last portion of handle_display_prop.
6970 (compute_display_string_pos): Accept additional argument
6971 FRAME_WINDOW_P. Call handle_display_spec to determine whether the
6972 value of a `display' property is a "replacing spec".
6973 (handle_single_display_spec): Accept 2 additional arguments BUFPOS
6974 and FRAME_WINDOW_P. If IT is NULL, don't set up the iterator from
6975 the display property, but just return a value indicating whether
6976 the display property will replace the characters it covers.
6977 (Fcurrent_bidi_paragraph_direction): Initialize the nchars and
6978 frame_window_p members of struct bidi_it.
d6d100dd
SM
6979 (compute_display_string_pos, compute_display_string_end):
6980 New functions.
fec2107c
EZ
6981 (push_it): Accept second argument POSITION, where pop_it should
6982 jump to continue iteration.
6983 (reseat_1): Initialize bidi_it.disp_pos.
fc6f18ce 6984
fec2107c
EZ
6985 * keyboard.c (adjust_point_for_property): Adjust the call to
6986 display_prop_intangible_p to its new signature.
fc6f18ce
EZ
6987
6988 * dispextern.h (struct bidi_it): New member frame_window_p.
fec2107c
EZ
6989 (bidi_init_it): Update prototypes.
6990 (display_prop_intangible_p): Update prototype.
d6d100dd
SM
6991 (compute_display_string_pos, compute_display_string_end):
6992 Declare prototypes.
fec2107c
EZ
6993 (struct bidi_it): New members nchars and disp_pos. ch_len is now
6994 EMACS_INT.
fc6f18ce 6995
40087514 69962011-06-02 Paul Eggert <eggert@cs.ucla.edu>
0de4bb68 6997
57f53182
PE
6998 Malloc failure behavior now depends on size of allocation.
6999 * alloc.c (buffer_memory_full, memory_full): New arg NBYTES.
7000 * lisp.h: Change signatures accordingly.
7001 * alloc.c, buffer.c, editfns.c, menu.c, minibuf.c, xterm.c:
7002 All callers changed. (Bug#8762)
7003
7004 * gnutls.c: Use Emacs's memory allocators.
7005 Without this change, the gnutls library would invoke malloc etc.
7006 directly, which causes problems on non-SYNC_INPUT hosts, and which
7007 runs afoul of improving memory_full behavior. (Bug#8761)
7008 (fn_gnutls_global_set_mem_functions): New macro or function pointer.
7009 (emacs_gnutls_global_init): Use it to specify xmalloc, xrealloc,
7010 xfree instead of the default malloc, realloc, free.
7011 (Fgnutls_boot): No need to check for memory allocation failure,
7012 since xmalloc does that for us.
7013
ac32cd99 7014 Remove arbitrary limit of 2**31 entries in hash tables. (Bug#8771)
3870d916
PE
7015 * category.c (hash_get_category_set):
7016 * ccl.c (ccl_driver):
7017 * charset.c (Fdefine_charset_internal):
7018 * charset.h (struct charset.hash_index):
7019 * composite.c (get_composition_id, gstring_lookup_cache)
7020 (composition_gstring_put_cache):
7021 * composite.h (struct composition.hash_index):
7022 * dispextern.h (struct image.hash):
7023 * fns.c (next_almost_prime, larger_vector, cmpfn_eql)
7024 (cmpfn_equal, cmpfn_user_defined, hashfn_eq, hashfn_eql)
7025 (hashfn_equal, hashfn_user_defined, make_hash_table)
7026 (maybe_resize_hash_table, hash_lookup, hash_put)
7027 (hash_remove_from_table, hash_clear, sweep_weak_table, SXHASH_COMBINE)
7028 (sxhash_string, sxhash_list, sxhash_vector, sxhash_bool_vector)
7029 (Fsxhash, Fgethash, Fputhash, Fmaphash):
7030 * image.c (make_image, search_image_cache, lookup_image)
7031 (xpm_put_color_table_h):
7032 * lisp.h (struct Lisp_Hash_Table):
0de4bb68 7033 * minibuf.c (Ftry_completion, Fall_completions, Ftest_completion):
ac389d0c 7034 * print.c (print): Use 'EMACS_UINT' and 'EMACS_INT'
3870d916 7035 for hashes and hash indexes, instead of 'unsigned' and 'int'.
40087514
PE
7036 * alloc.c (allocate_vectorlike):
7037 Check for overflow in vector size calculations.
7038 * ccl.c (ccl_driver):
7039 Check for overflow when converting EMACS_INT to int.
0de4bb68
PE
7040 * fns.c, image.c: Remove unnecessary static decls that would otherwise
7041 need to be updated by these changes.
40087514
PE
7042 * fns.c (make_hash_table, maybe_resize_hash_table):
7043 Check for integer overflow with large hash tables.
0de4bb68
PE
7044 (make_hash_table, maybe_resize_hash_table, Fmake_hash_table):
7045 Prefer the faster XFLOAT_DATA to XFLOATINT where either will do.
7046 (SXHASH_REDUCE): New macro.
7047 (sxhash_string, sxhash_list, sxhash_vector, sxhash_bool_vector):
7048 Use it instead of discarding useful hash info with large hash values.
7049 (sxhash_float): New function.
7050 (sxhash): Use it. No more need for "& INTMASK" due to above changes.
7051 * lisp.h (FIXNUM_BITS): New macro, useful for SXHASH_REDUCE etc.
40087514
PE
7052 (MOST_NEGATIVE_FIXNUM, MOST_POSITIVE_FIXNUM, INTMASK):
7053 Rewrite to use FIXNUM_BITS, as this simplifies things.
0de4bb68
PE
7054 (next_almost_prime, larger_vector, sxhash, hash_lookup, hash_put):
7055 Adjust signatures to match updated version of code.
7056 (consing_since_gc): Now EMACS_INT, since a single hash table can
7057 use more than INT_MAX bytes.
7058
698d32e2
DN
70592011-06-01 Dan Nicolaescu <dann@ics.uci.edu>
7060
7061 Make it possible to build with GCC-4.6+ -O2 -flto.
7062
7063 * emacs.c (__malloc_initialize_hook): Mark as EXTERNALLY_VISIBLE.
7064
fd6fa53f
SM
70652011-06-01 Stefan Monnier <monnier@iro.umontreal.ca>
7066
7067 * minibuf.c (get_minibuffer, read_minibuf_unwind):
7068 Call minibuffer-inactive-mode.
7069
864db017
JB
70702011-05-31 Juanma Barranquero <lekktu@gmail.com>
7071
7072 * makefile.w32-in ($(BLD)/data.$(O), $(BLD)/editfns.$(O)):
7073 Update dependencies.
7074
2ad0baf4
DN
70752011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
7076
7077 * data.c (init_data): Remove code for UTS, this system is not
7078 supported anymore.
7079
4fcc2638
DN
70802011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
7081
7082 Don't force ./temacs to start in terminal mode.
7083
7084 * frame.c (make_initial_frame): Initialize faces in all cases, not
7085 only when CANNOT_DUMP is defined.
7086 * dispnew.c (init_display): Remove CANNOT_DUMP condition.
7087
c56e0fd5
DN
70882011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
7089
7090 * dispnew.c (add_window_display_history): Use const for the string
7091 pointer. Remove declaration, not needed.
7092
333d54da 70932011-05-31 Paul Eggert <eggert@cs.ucla.edu>
9cf9f756 7094
55d4c1b2 7095 Use 'inline', not 'INLINE'.
333d54da 7096 <http://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00914.html>
55d4c1b2
PE
7097 * alloc.c, fontset.c (INLINE): Remove.
7098 * alloc.c, bidi.c, charset.c, coding.c, dispnew.c, fns.c, image.c:
7099 * intervals.c, keyboard.c, process.c, syntax.c, textprop.c, w32term.c:
7100 * xdisp.c, xfaces.c, xterm.c: Replace all uses of INLINE with inline.
7101 * gmalloc.c (register_heapinfo): Use inline unconditionally.
7102 * lisp.h (LISP_MAKE_RVALUE): Use inline, not __inline__.
7103
738db178
DN
71042011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
7105
7106 Make it possible to run ./temacs.
7107
7108 * callproc.c (set_initial_environment): Remove CANNOT_DUMP code,
7109 syms_of_callproc does the same thing. Remove test for
7110 "initialized", do it in the caller.
7111 * emacs.c (main): Avoid calling set_initial_environment when dumping.
7112
620c53a6
SM
71132011-05-31 Stefan Monnier <monnier@iro.umontreal.ca>
7114
7115 * minibuf.c (Finternal_complete_buffer): Return `category' metadata.
7116 (read_minibuf): Use get_minibuffer.
7117 (syms_of_minibuf): Use DEFSYM.
7118 (Qmetadata): New var.
7119 * data.c (Qbuffer): Don't make it static.
7120 (syms_of_data): Use DEFSYM.
7121
e003a292
PE
71222011-05-31 Paul Eggert <eggert@cs.ucla.edu>
7123
7124 * ccl.c (CCL_CODE_RANGE): Allow negative numbers. (Bug#8751)
7125 (CCL_CODE_MIN): New macro.
7126
ed008a6d
PE
71272011-05-30 Paul Eggert <eggert@cs.ucla.edu>
7128
3687c2ef
PE
7129 * alloc.c (lisp_align_malloc): Omit unnecessary val==NULL tests.
7130
ed008a6d
PE
7131 * eval.c (Qdebug): Now static.
7132 * lisp.h (Qdebug): Remove decl. This reverts a part of the
7133 2011-04-26T11:26:05Z!dan.colascione@gmail.com that inadvertently undid part of
7134 2011-04-14T06:48:41Z!eggert@cs.ucla.edu.
7135
d66c4c7c
CY
71362011-05-29 Chong Yidong <cyd@stupidchicken.com>
7137
7138 * image.c: Various fixes to ImageMagick code comments.
7139 (Fimagemagick_types): Doc fix.
7140
5fbc2025
PE
71412011-05-29 Paul Eggert <eggert@cs.ucla.edu>
7142
0196f88a
PE
7143 Minor fixes prompted by GCC 4.6.0 warnings.
7144
7145 * xselect.c (converted_selections, conversion_fail_tag): Now static.
7146
5fbc2025
PE
7147 * emacs.c [HAVE_X_WINDOWS]: Include "xterm.h".
7148 (x_clipboard_manager_save_all): Move extern decl to ...
7149 * xterm.h: ... here, so that it can be checked for consistency.
7150
1dd3c2d9
CY
71512011-05-29 Chong Yidong <cyd@stupidchicken.com>
7152
7153 * xselect.c (x_clipboard_manager_save_frame)
7154 (x_clipboard_manager_save_all): New functions.
7155 (Fx_clipboard_manager_save): Lisp function deleted.
7156
7157 * emacs.c (Fkill_emacs): Call x_clipboard_manager_save_all.
7158 * frame.c (delete_frame): Call x_clipboard_manager_save_frame.
7159
7160 * xterm.h: Update prototype.
7161
5ba6571d
WX
71622011-05-28 William Xu <william.xwl@gmail.com>
7163
7164 * nsterm.m (ns_term_shutdown): Synchronize user defaults before
7165 exiting (Bug#8239).
7166
3eaff834
JM
71672011-05-28 Jim Meyering <meyering@redhat.com>
7168
e1900994 7169 Avoid a sign-extension bug in crypto_hash_function.
3eaff834
JM
7170 * fns.c (to_uchar): Define.
7171 (crypto_hash_function): Use it to convert some newly-signed
7172 variables to unsigned, to avoid sign-extension bugs. For example,
7173 without this change, (md5 "truc") would evaluate to
7174 45723a2aff78ff4fff7fff1114760e62 rather than the expected
7175 45723a2af3788c4ff17f8d1114760e62. Reported by Antoine Levitt in
e1900994 7176 https://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00883.html.
3eaff834 7177
0f6990a7
PE
71782011-05-27 Paul Eggert <eggert@cs.ucla.edu>
7179
7180 Integer overflow fixes.
c8a9ca5a 7181
08686060
PE
7182 * dbusbind.c: Serial number integer overflow fixes.
7183 (CHECK_DBUS_SERIAL_GET_SERIAL): New macro.
08686060
PE
7184 (Fdbus_call_method_asynchronously, xd_read_message_1): Use a float
7185 to hold a serial number that is too large for a fixnum.
7186 (Fdbus_method_return_internal, Fdbus_method_error_internal):
7187 Check for serial numbers out of range. Decode any serial number
59568bf0 7188 that was so large that it became a float. (Bug#8722)
08686060 7189
2d1fc3c7
PE
7190 * dbusbind.c: Use XFASTINT rather than XUINT, and check for nonneg.
7191 (Fdbus_call_method, Fdbus_call_method_asynchronously):
7192 Use XFASTINT rather than XUINT when numbers are nonnegative.
7193 (xd_append_arg, Fdbus_method_return_internal):
7194 (Fdbus_method_error_internal): Likewise. Also, for unsigned
7195 arguments, check that Lisp number is nonnegative, rather than
59568bf0 7196 silently wrapping negative numbers around. (Bug#8722)
30217ff0 7197 (xd_read_message_1): Don't assume dbus_uint32_t can fit in int.
59568bf0 7198 (Bug#8722)
2d1fc3c7 7199
c8a9ca5a
PE
7200 * data.c (arith_driver, Flsh): Avoid unnecessary casts to EMACS_UINT.
7201
519e1d69
PE
7202 * ccl.c (ccl_driver): Redo slightly to avoid the need for 'unsigned'.
7203
6df6ae42 7204 ccl: Add integer overflow checks.
30569699
PE
7205 * ccl.c (CCL_CODE_MAX, GET_CCL_RANGE, GET_CCL_CODE, GET_CCL_INT):
7206 (IN_INT_RANGE): New macros.
7207 (ccl_driver): Use them to check for integer overflow when
7208 decoding a CCL program. Many of the new checks are whether XINT (x)
7209 fits in int; it doesn't always, on 64-bit hosts. The new version
7210 doesn't catch all possible integer overflows, but it's an
847044ea 7211 improvement. (Bug#8719)
30569699 7212
c11285dc
PE
7213 * alloc.c (make_event_array): Use XINT, not XUINT.
7214 There's no need for unsigned here.
7215
fdccd48e
PE
7216 * mem-limits.h (EXCEEDS_LISP_PTR) [!USE_LSB_TAG]: EMACS_UINT -> uintptr_t
7217 This follows up to the 2011-05-06 change that substituted uintptr_t
7218 for EMACS_INT. This case wasn't caught back then.
7219
37910ab2
PE
7220 Rework Fformat to avoid integer overflow issues.
7221 * editfns.c: Include <float.h> unconditionally, as it's everywhere
7222 now (part of C89). Include <verify.h>.
7223 (MAX_10_EXP, CONVERTED_BYTE_SIZE): Remove; no longer needed.
7224 (pWIDE, pWIDElen, signed_wide, unsigned_wide): New defns.
7225 (Fformat): Avoid the prepass trying to compute sizes; it was only
7226 approximate and thus did not catch overflow reliably. Instead, walk
7227 through the format just once, formatting and computing sizes as we go,
7228 checking for integer overflow at every step, and allocating a larger
7229 buffer as needed. Keep track separately whether the format is
7230 multibyte. Keep only the most-recently calculated precision, rather
7231 than them all. Record whether each argument has been converted to
7232 string. Use EMACS_INT, not int, for byte and char and arg counts.
7233 Support field widths and precisions larger than INT_MAX. Avoid
7234 sprintf's undefined behavior with conversion specifications such as %#d
7235 and %.0c. Fix bug with strchr succeeding on '\0' when looking for
7236 flags. Fix bug with (format "%c" 256.0). Avoid integer overflow when
7237 formatting out-of-range floating point numbers with int
9173deec 7238 formats. (Bug#8668)
37910ab2 7239
2e6578fb
PE
7240 * lisp.h (FIXNUM_OVERFLOW_P): Work even if arg is a NaN.
7241
0ae6bdee
PE
7242 * data.c: Avoid integer truncation in expressions involving floats.
7243 * data.c: Include <intprops.h>.
7244 (arith_driver): When there's an integer overflow in an expression
7245 involving floating point, convert the integers to floating point
7246 so that the resulting value does not suffer from catastrophic
7247 integer truncation. For example, on a 64-bit host (* 4
7248 most-negative-fixnum 0.5) should yield about -4.6e+18, not zero.
7249 Do not rely on undefined behavior after integer overflow.
7250
de883a70
PE
7251 merge count_size_as_multibyte, parse_str_to_multibyte
7252 * character.c, character.h (count_size_as_multibyte):
fd6fa53f 7253 Rename from parse_str_to_multibyte; all uses changed.
de883a70
PE
7254 Check for integer overflow.
7255 * insdel.c, lisp.h (count_size_as_multibyte): Remove,
7256 since it's now a duplicate of the other. This is more of
7257 a character than a buffer op, so better that it's in character.c.
7258 * fns.c, print.c: Adjust to above changes.
7259
2ff916cb
PE
72602011-05-27 Stefan Monnier <monnier@iro.umontreal.ca>
7261
7262 * xselect.c (x_convert_selection): Yet another int/Lisp_Object mixup.
7263
f1b54466
PE
72642011-05-27 Paul Eggert <eggert@cs.ucla.edu>
7265
fb1ac845
PE
7266 * xselect.c: Fix minor problems prompted by GCC 4.6.0 warnings.
7267 (x_handle_selection_request, frame_for_x_selection): Remove unused vars.
7268 (x_clipboard_manager_save): Now static.
7269 (Fx_clipboard_manager_save): Rename local to avoid shadowing.
7270
f1b54466
PE
7271 * fns.c: Fix minor problems prompted by GCC 4.6.0 warnings.
7272 (crypto_hash_function): Now static.
7273 Fix pointer signedness problems. Avoid unnecessary initializations.
7274
a9f737ee
CY
72752011-05-27 Chong Yidong <cyd@stupidchicken.com>
7276
7277 * termhooks.h (Vselection_alist): Make it terminal-local.
7278
7279 * terminal.c (create_terminal): Initialize it.
7280
7281 * xselect.c: Support for clipboard managers.
7282 (Vselection_alist): Move to termhooks.h as terminal-local var.
7283 (LOCAL_SELECTION): New macro.
7284 (x_atom_to_symbol): Handle x_display_info_for_display fail case.
7285 (symbol_to_x_atom): Remove gratuitous arg.
7286 (x_handle_selection_request, lisp_data_to_selection_data)
7287 (x_get_foreign_selection, Fx_register_dnd_atom): Callers changed.
620c53a6
SM
7288 (x_own_selection, x_get_local_selection, x_convert_selection):
7289 New arg, specifying work frame. Use terminal-local Vselection_alist.
a9f737ee
CY
7290 (some_frame_on_display): Delete unused function.
7291 (Fx_own_selection_internal, Fx_get_selection_internal)
7292 (Fx_disown_selection_internal, Fx_selection_owner_p)
7293 (Fx_selection_exists_p): New optional frame arg.
7294 (frame_for_x_selection, Fx_clipboard_manager_save): New functions.
7295 (x_handle_selection_clear): Don't treat other terminals with the
7296 same keyboard specially. Use the terminal-local Vselection_alist.
7297 (x_clear_frame_selections): Use Frun_hook_with_args.
7298
7299 * xterm.c (x_term_init): Intern ATOM and CLIPBOARD_MANAGER atoms.
7300
7301 * xterm.h: Add support for those atoms.
7302
e067f0c1
CY
73032011-05-26 Chong Yidong <cyd@stupidchicken.com>
7304
7305 * xselect.c: ICCCM-compliant handling of MULTIPLE targets.
7306 (converted_selections, conversion_fail_tag): New global variables.
7307 (x_selection_request_lisp_error): Free the above.
7308 (x_get_local_selection): Remove unnecessary code.
7309 (x_reply_selection_request): Args changed; handle arbitrary array
620c53a6
SM
7310 of converted selections stored in converted_selections.
7311 Separate the XChangeProperty and SelectionNotify steps.
e067f0c1
CY
7312 (x_handle_selection_request): Rewrite to handle MULTIPLE target.
7313 (x_convert_selection): New function.
7314 (x_handle_selection_event): Simplify.
7315 (x_get_foreign_selection): Don't ignore incoming requests while
7316 waiting for an answer; this will fail when we implement
7317 SAVE_TARGETS, and seems unnecessary anyway.
7318 (selection_data_to_lisp_data): Recognize ATOM_PAIR type.
7319 (Vx_sent_selection_functions): Doc fix.
7320
0f4aebc0
LL
73212011-05-26 Leo Liu <sdl.web@gmail.com>
7322
7323 * editfns.c (Ftranspose_regions): Allow empty regions. (Bug#8699)
7324
e61124cd
YM
73252011-05-25 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
7326
7327 * dispextern.h (struct glyph_row): New member fringe_bitmap_periodic_p.
7328
7329 * dispnew.c (shift_glyph_matrix, scrolling_window): Mark scrolled row
7330 for fringe update if it has periodic bitmap.
ac389d0c 7331 (row_equal_p): Also compare left_fringe_offset, right_fringe_offset,
e61124cd
YM
7332 and fringe_bitmap_periodic_p.
7333
7334 * fringe.c (get_fringe_bitmap_data): New function.
7335 (draw_fringe_bitmap_1, update_window_fringes): Use it.
7336 (update_window_fringes): Record periodicity of fringe bitmap in glyph
7337 row. Mark glyph row for fringe update if periodicity changed.
7338
7339 * xdisp.c (try_window_reusing_current_matrix): Don't mark scrolled row
7340 for fringe update unless it has periodic bitmap.
7341
f16d9837
KH
73422011-05-25 Kenichi Handa <handa@m17n.org>
7343
7344 * xdisp.c (get_next_display_element): Set correct it->face_id for
7345 a static composition.
7346
e1b90ef6
LL
73472011-05-24 Leo Liu <sdl.web@gmail.com>
7348
7349 * deps.mk (fns.o):
7350 * makefile.w32-in ($(BLD)/fns.$(O)): Include sha1.h.
7351
7352 * fns.c (crypto_hash_function, Fsha1): New function.
7353 (Fmd5): Use crypto_hash_function.
7354 (syms_of_fns): Add Ssha1.
7355
7400048f
PE
73562011-05-22 Paul Eggert <eggert@cs.ucla.edu>
7357
7358 * gnutls.c: Remove unused macros.
7359 (fn_gnutls_transport_set_lowat, fn_gnutls_transport_set_pull_function):
7360 (fn_gnutls_transport_set_push_function) [!WINDOWSNT]:
7361 Remove macros that are defined and never used.
7362 Caught by gcc -Wunused-macros (GCC 4.6.0, Fedora 14).
7363
abb71cf4
CY
73642011-05-22 Chong Yidong <cyd@stupidchicken.com>
7365
7366 * xselect.c (syms_of_xselect): Remove unused symbol SAVE_TARGETS.
7367 (Fx_get_selection_internal): Minor cleanup.
7368 (Fx_own_selection_internal): Rename arguments for consistency with
7369 select.el.
7370
6307db39
PE
73712011-05-22 Paul Eggert <eggert@cs.ucla.edu>
7372
7373 * xselect.c (QSAVE_TARGETS): New static var, to fix build failure.
7374
f3d4e0a4
CY
73752011-05-22 Chong Yidong <cyd@stupidchicken.com>
7376
7377 * xselect.c (syms_of_xselect): Include character.h; use DEFSYM.
7378
4d8ade89
YM
73792011-05-21 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
7380
7381 * dispnew.c (scrolling_window): Don't exclude the case that the
7382 last enabled row in the desired matrix touches the bottom boundary.
7383
32078c8d
GM
73842011-05-21 Glenn Morris <rgm@gnu.org>
7385
7386 * Makefile.in ($(etc)/DOC): Make second command line even shorter.
33cf345f
GM
7387 (SOME_MACHINE_OBJECTS): Replace FONT_OBJ by its maximal expansion,
7388 and add some more files.
32078c8d 7389
7285dc67
EZ
73902011-05-20 Eli Zaretskii <eliz@gnu.org>
7391
7392 * callproc.c (Fcall_process) [MSDOS]: Fix arguments to
7393 report_file_error introduced by the change from 2011-05-07.
7394
89d1bd22
PE
73952011-05-20 Paul Eggert <eggert@cs.ucla.edu>
7396
7397 * systime.h (Time): Define only if emacs is defined.
7398 This is to allow ../lib-src/profile.c to be compiled on FreeBSD,
7399 where the include path doesn't have X11/X.h by default. See
7400 <http://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00561.html>.
7401
cd394be1 74022011-05-20 Kenichi Handa <handa@m17n.org>
31bfc35c
KH
7403
7404 * composite.c (find_automatic_composition): Fix previous change.
7405
b9704ad9
GM
74062011-05-20 Glenn Morris <rgm@gnu.org>
7407
7408 * lisp.mk: New file, split from Makefile.in.
7409 * Makefile.in (lisp): Move to separate file, inserted by @lisp_frag@.
7410 (shortlisp): Remove.
7411 ($(etc)/DOC): Edit lisp.mk rather than using $shortlisp.
7412
4a720484
GM
74132011-05-19 Glenn Morris <rgm@gnu.org>
7414
7415 * Makefile.in (MSDOS_SUPPORT_REAL, MSDOS_SUPPORT, NS_SUPPORT)
7416 (REAL_MOUSE_SUPPORT, GPM_MOUSE_SUPPORT, MOUSE_SUPPORT, TOOLTIP_SUPPORT)
7417 (BASE_WINDOW_SUPPORT, X_WINDOW_SUPPORT, WINDOW_SUPPORT): Remove.
7418 (lisp): Set the order to that of loadup.el.
7419 (shortlisp): Make it a copy of $lisp.
7420 (SOME_MACHINE_LISP): Remove.
7421 ($(etc)/DOC): Depend just on $lisp, not $SOME_MACHINE_LISP too.
7422 Use just $shortlisp, not $SOME_MACHINE_LISP too.
7423
a28d4396
KH
74242011-05-18 Kenichi Handa <handa@m17n.org>
7425
7426 * composite.c (CHAR_COMPOSABLE_P): Add more check for efficiency.
7427 (BACKWARD_CHAR): Wrap the arg STOP by parenthesis.
7428 (find_automatic_composition): Mostly rewrite for efficiency.
7429
a2b1fa8e
JB
74302011-05-18 Juanma Barranquero <lekktu@gmail.com>
7431
7432 * makefile.w32-in: Update dependencies.
7433
8e1f5610
CS
74342011-05-18 Christoph Scholtes <cschol2112@googlemail.com>
7435
7436 * menu.c: Include limits.h (fixes the MS-Windows build broken by
7d7d0045 7437 2011-06-18T18:49:19Z!cyd@stupidchicken.com).
8e1f5610 7438
7025ee00 74392011-05-18 Paul Eggert <eggert@cs.ucla.edu>
cb93f9be 7440
cdfa6eab
PE
7441 Fix some integer overflow issues, such as string length overflow.
7442
06d6db33
PE
7443 * insdel.c (count_size_as_multibyte): Check for string overflow.
7444
2b4560a8
PE
7445 * character.c (lisp_string_width): Check for string overflow.
7446 Use EMACS_INT, not int, for string indexes and lengths; in
7447 particular, 2nd arg is now EMACS_INT, not int. Do not crash if
7448 the resulting string length overflows an EMACS_INT; instead,
7449 report a string overflow if no precision given. When checking for
7450 precision exhaustion, use a check that cannot possibly have
7451 integer overflow. (Bug#8675)
7452 * character.h (lisp_string_width): Adjust to new signature.
7453
cb93f9be
PE
7454 * alloc.c (string_overflow): New function.
7455 (Fmake_string): Use it. This doesn't change behavior, but saves
7456 a few bytes and will simplify future changes.
7457 * character.c (string_escape_byte8): Likewise.
7458 * lisp.h (string_overflow): New decl.
7459
1a1f3366
PE
7460 Fixups, following up to the user-interface timestamp change.
7461 * nsterm.m (last_mouse_movement_time, ns_mouse_position): Use Time
7462 for UI timestamps, instead of unsigned long.
9fbd6841
PE
7463 * msdos.c (mouse_get_pos): Likewise.
7464 * w32inevt.c (movement_time, w32_console_mouse_position): Likewise.
1a1f3366
PE
7465 * w32gui.h (Time): Define by including "systime.h" rather than by
7466 declaring it ourselves. (Bug#8664)
7467
d4e3e4d3
PE
7468 * dispextern.h (struct image): Don't assume time_t <= unsigned long.
7469 * image.c (clear_image_cache): Likewise.
7470
f6a24d19
PE
7471 * term.c (term_mouse_position): Don't assume time_t wraparound.
7472
08dc5ae6
PE
7473 Be more systematic about user-interface timestamps.
7474 Before, the code sometimes used 'Time', sometimes 'unsigned long',
620c53a6
SM
7475 and sometimes 'EMACS_UINT', to represent these timestamps.
7476 This change causes it to use 'Time' uniformly, as that's what X uses.
08dc5ae6
PE
7477 This makes the code easier to follow, and makes it easier to catch
7478 integer overflow bugs such as Bug#8664.
7479 * frame.c (Fmouse_position, Fmouse_pixel_position):
7480 Use Time, not unsigned long, for user-interface timestamps.
7481 * keyboard.c (last_event_timestamp, kbd_buffer_get_event): Likewise.
7482 (button_down_time, make_lispy_position, make_lispy_movement): Likewise.
7483 * keyboard.h (last_event_timestamp): Likewise.
7484 * menu.c (Fx_popup_menu) [!HAVE_X_WINDOWS]: Likewise.
7485 * menu.h (xmenu_show): Likewise.
7486 * term.c (term_mouse_position): Likewise.
7487 * termhooks.h (struct input_event.timestamp): Likewise.
7488 (struct terminal.mouse_position_hook): Likewise.
7489 * xmenu.c (create_and_show_popup_menu, xmenu_show): Likewise.
7490 * xterm.c (XTmouse_position, x_scroll_bar_report_motion): Likewise.
7491 * systime.h (Time): New decl. Pull it in from <X11/X.h> if
7492 HAVE_X_WINDOWS, otherwise define it as unsigned long, which is
7493 what it was before.
7494 * menu.h, termhooks.h: Include "systime.h", for Time.
7495
8e55734a
PE
7496 * keyboard.c (make_lispy_event): Fix problem in integer overflow.
7497 Don't assume that the difference between two unsigned long values
7498 can fit into an integer. At this point, we know button_down_time
7499 <= event->timestamp, so the difference must be nonnegative, so
7500 there's no need to cast the result if double-click-time is
7501 nonnegative, as it should be; check that it's nonnegative, just in
7502 case. This bug is triggered when events are more than 2**31 ms
86db42d2 7503 apart (about 25 days). (Bug#8664)
8e55734a 7504
841f1b75 7505 * xselect.c (last_event_timestamp): Remove duplicate decl.
6434756c 7506 (x_own_selection): Remove needless cast to unsigned long.
841f1b75 7507
3e26f69c
PE
7508 * xmenu.c (set_frame_menubar): Use int, not EMACS_UINT, for indexes
7509 that always fit in int. Use a sentinel instead of a counter, to
7510 avoid a temp and to allay GCC's concerns about possible int overflow.
d230cb74
PE
7511 * frame.h (struct frame): Use int for menu_bar_items_used
7512 instead of EMACS_INT, since it always fits in int.
3e26f69c 7513
5cc152c0
PE
7514 * menu.c (grow_menu_items): Check for int overflow.
7515
d89eb65e
PE
7516 * xmenu.c (set_frame_menubar): Don't mishandle vectors with no nils.
7517
5235bd3e
PE
7518 * xterm.c: Use EMACS_INT for Emacs modifiers, and int for X modifiers.
7519 Before, the code was not consistent. These values cannot exceed
7520 2**31 - 1 so there's no need to make them unsigned.
7521 (x_x_to_emacs_modifiers): Accept int and return EMACS_INT.
7522 (x_emacs_to_x_modifiers): Accept EMACS_INT and return int.
7523 (x_x_to_emacs_modifiers, x_emacs_to_x_modifiers): Reject non-integers
7524 as modifiers.
7525 * xterm.h (x_x_to_emacs_modifiers): Adjust to signature change.
7526
bc827e23
PE
7527 * lisp.h (XINT) [USE_LISP_UNION_TYPE]: Cast to EMACS_INT.
7528 (XUINT) [USE_LISP_UNION_TYPE]: Cast to EMACS_UINT.
7529 Otherwise, GCC 4.6.0 warns about printf (pI, XINT (...)),
7530 presumably because the widths might not match.
7531
78eb494e
PE
7532 * window.c (size_window): Avoid needless test at loop start.
7533
04f2d78b
CB
75342011-05-18 Courtney Bane <emacs-bugs-7626@cbane.org> (tiny change)
7535
7536 * term.c (Fresume_tty): Restore hooks before reinitializing (bug#8687).
7537
d2fc7e3d 75382011-05-12 Drew Adams <drew.adams@oracle.com>
e531bdff
DA
7539
7540 * textprop.c (Fprevious_single_char_property_change): Doc fix (bug#8655).
7541
d2fc7e3d 75422011-05-12 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
7db47798
YM
7543
7544 * w32term.c (w32_draw_fringe_bitmap): Rename local vars `left' and
7545 `width' to `bar_area_x' and `bar_area_width', respectively.
7546 (x_scroll_run): Take account of fringe background extension.
7547
04f2d78b
CB
7548 * xterm.c (x_draw_fringe_bitmap) [USE_TOOLKIT_SCROLL_BARS]:
7549 Rename local vars `left' and `width' to `bar_area_x' and
7db47798
YM
7550 `bar_area_width', respectively.
7551 (x_scroll_run) [USE_TOOLKIT_SCROLL_BARS]: Take account of fringe
7552 background extension.
7553
79b70037
GM
75542011-05-10 Jim Meyering <meyering@redhat.com>
7555
7556 * xdisp.c (x_intersect_rectangles): Fix typo "the the -> the".
7557
2f142cc5
JB
75582011-05-10 Juanma Barranquero <lekktu@gmail.com>
7559
7560 * image.c (Finit_image_library): Return t for built-in image types,
7561 like pbm and xbm. (Bug#8640)
7562
57679c86
AS
75632011-05-09 Andreas Schwab <schwab@linux-m68k.org>
7564
7565 * w32menu.c (set_frame_menubar): Fix submenu allocation.
7566
888c9e86
EZ
75672011-05-07 Eli Zaretskii <eliz@gnu.org>
7568
b0512a1d
EZ
7569 * w32console.c (Fset_screen_color): Doc fix.
7570 (Fget_screen_color): New function.
7571 (syms_of_ntterm): Defsubr it.
7572
7285dc67
EZ
7573 * callproc.c (call_process_cleanup) [MSDOS]: Don't close and
7574 unlink the temporary file if Fcall_process didn't create it in the
7575 first place.
7576 (Fcall_process) [MSDOS]: Don't create tempfile if stdout of the
7577 child process will be redirected to a file specified with `:file'.
888c9e86
EZ
7578 Don't try to re-open tempfile in that case, and set fd[0] to -1 as
7579 cue to call_process_cleanup not to close that handle.
7580
4d3fcc8e
BK
75812011-05-07 Ben Key <bkey76@gmail.com>
7582
7583 * makefile.w32-in: The bootstrap-temacs rule now makes use of
7584 one of two shell specific rules, either bootstrap-temacs-CMD or
7585 bootstrap-temacs-SH. The bootstrap-temacs-SH rule is identical
7586 to the previous implementation of the bootstrap-temacs rule.
7587 The bootstrap-temacs-CMD rule is similar to the previous
7588 implementation of the bootstrap-temacs rule except that it
7589 makes use of the ESC_CFLAGS variable instead of the CFLAGS
7590 variable.
7591
7592 These changes, along with some changes to nt/configure.bat,
7593 nt/gmake.defs, and nt/nmake.defs, are required to extend my
7594 earlier fix to add support for --cflags and --ldflags options
7595 that include quotes so that it works whether make uses cmd or
7596 sh as the shell.
7597
b4289b64
MA
75982011-05-06 Michael Albinus <michael.albinus@gmx.de>
7599
7600 * dbusbind.c (QCdbus_type_unix_fd): Declare static.
7601 (xd_remove_watch): Don't check QCdbus_type_unix_fd for SYMBOLP, it
7602 is a constant.
7603 (Fdbus_init_bus, xd_read_queued_messages): Bus can be a symbol or
7604 a string. Handle both cases.
7605 (Fdbus_call_method_asynchronously, Fdbus_register_signal)
7606 (Fdbus_register_method): Use Qinvalid_function.
7607
af4c0e28
JB
76082011-05-06 Juanma Barranquero <lekktu@gmail.com>
7609
7610 * makefile.w32-in: Update dependencies.
7611 (LISP_H): Add inttypes.h and stdin.h.
7612 (PROCESS_H): Add unistd.h.
7613
c51453d9
EZ
76142011-05-06 Eli Zaretskii <eliz@gnu.org>
7615
7616 * lread.c: Include limits.h (fixes the MS-Windows build broken by
7617 2011-05-06T07:13:19Z!eggert@cs.ucla.edu).
7618
8ff0ac3c 76192011-05-06 Paul Eggert <eggert@cs.ucla.edu>
c032b5f8 7620
4c4b566b
PE
7621 * image.c (Finit_image_library) [!HAVE_NTGUI]: Omit unused local.
7622
aab2b9b5
PE
7623 * term.c (vfatal): Remove stray call to va_end.
7624 It's not needed and the C Standard doesn't allow it here anyway.
7625
c378da0b
PE
7626 Use C99's va_copy to avoid undefined behavior on x86-64 GNU/Linux.
7627 * eval.c (verror): doprnt a copy of ap, not the original. (Bug#8545)
7628
288b08c7
PE
7629 * eval.c (verror): OK to create a string of up to MOST_POSITIVE_FIXNUM
7630 bytes.
7631
e3601888
PE
7632 * term.c: Don't include <stdarg.h>, as <lisp.h> does that.
7633
db6c0e74
PE
7634 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork clobbering.
7635
dd5963ea
PE
7636 * process.c (Fformat_network_address): Fix typo: args2 -> *args2.
7637
88c9450f
PE
7638 * xmenu.c (set_frame_menubar): Fix typo: int * -> int (3 times).
7639
2f9442b8
PE
7640 * coding.c (detect_coding_charset): Fix typo: * 2 -> *4 (Bug#8601).
7641
c032b5f8
PE
7642 * charset.h (struct charset.code_space): Now has 15 elements, not 16.
7643 * charset.c (Fdefine_charset_internal): Don't initialize
7644 charset.code_space[15]. The value was garbage, on hosts with
2d38271b 7645 32-bit int (Bug#8600).
a108c10b
PE
7646
7647 * lread.c (read_integer): Be more consistent with string-to-number.
7648 Use string_to_number to do the actual conversion; this avoids
7649 rounding errors and fixes some other screwups. Without this fix,
7650 for example, #x1fffffffffffffff was misread as -2305843009213693952.
7651 (digit_to_number): Move earlier, for benefit of read_integer.
7652 Return -1 if the digit is out of range for the base, -2 if it is
48e400f0 7653 not a digit in any supported base. (Bug#8602)
a108c10b 7654
ad5f9eea
PE
7655 * doprnt.c (doprnt): Support arbitrary pI values, such as "I64".
7656
aec1708a
PE
7657 * dispnew.c (scrolling_window): Return 1 if we scrolled,
7658 to match comment at start of function. This also removes a
7659 GCC warning about overflow in a 32+64-bit port.
7660
47be4ab5
PE
7661 * lisp.h (EMACS_INT, EMACS_UINT, BITS_PER_EMACS_INT, pI): Simplify.
7662
371cac43
PE
7663 * dbusbind.c: Do not use XPNTR on a value that may be an integer.
7664 Reported by Stefan Monnier in
7665 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00919.html>.
04f2d78b
CB
7666 (xd_remove_watch, Fdbus_init_bus, xd_read_queued_messages):
7667 Use SYMBOLP-guarded XSYMBOL, not XPNTR.
371cac43 7668
d01a7826
PE
7669 * lisp.h (EMACS_INTPTR): Remove. All uses changed to intptr_t.
7670 (EMACS_UINTPTR): Likewise, with uintptr_t.
7671
7fd47d5c
PE
7672 * lisp.h: Prefer 64-bit EMACS_INT if available.
7673 (EMACS_INT, EMACS_UINT, BITS_PER_EMACS_INT, pI): Define to 64-bit
7674 on 32-bit hosts that have 64-bit int, so that they can access
7675 large files.
122b0c86
PE
7676 However, temporarily disable this change unless the temporary
7677 symbol WIDE_EMACS_INT is defined.
7fd47d5c 7678
8727937b
PE
7679 * lread.c, process.c: Do not include <inttypes.h>; lisp.h does it now.
7680
8ac068ac
PE
7681 Prefer intptr_t/uintptr_t for integers the same widths as pointers.
7682 This removes an assumption that EMACS_INT and long are the same
7683 width as pointers. The assumption is true for Emacs porting targets
7684 now, but we want to make other targets possible.
7685 * lisp.h: Include <inttypes.h>, for INTPTR_MAX, UINTPTR_MAX.
7686 (EMACS_INTPTR, EMACS_UINTPTR): New macros.
7687 In the rest of the code, change types of integers that hold casted
7688 pointers to EMACS_INTPTR and EMACS_UINTPTR, systematically
7689 replacing EMACS_INT, long, EMACS_UINT, and unsigned long.
7690 (XTYPE): Don't cast arg to EMACS_UINT; normally is not needed.
7691 (XSET): Cast type of XTYPE arg to EMACS_INTPTR; it is needed here.
7692 No need to cast type when ORing.
7693 (XPNTR): Return a value of type EMACS_INTPTR or EMACS_UINTPTR.
7694 * alloc.c (lisp_align_malloc): Remove a no-longer-needed cast.
7695 * doc.c (store_function_docstring): Use EMACS_INTPTR, so as not to
7696 assume EMACS_INT is the same width as char *.
7697 * gtkutil.c (xg_gtk_scroll_destroy, xg_tool_bar_button_cb):
7698 (xg_tool_bar_callback, xg_tool_bar_help_callback, xg_make_tool_item):
7699 Remove no-longer-needed casts.
7700 (xg_create_scroll_bar, xg_tool_bar_button_cb, xg_tool_bar_callback):
7701 (xg_tool_bar_help_callback, xg_make_tool_item):
7702 Use EMACS_INTPTR to hold an integer
7703 that will be cast to void *; this can avoid a GCC warning
7704 if EMACS_INT is not the same width as void *.
7705 * menu.c (find_and_call_menu_selection): Remove no-longer-needed cast.
7706 * xdisp.c (display_echo_area_1, resize_mini_window_1):
7707 (current_message_1, set_message_1):
7708 Use a local to convert to proper width without a cast.
7709 * xmenu.c (dialog_selection_callback): Likewise.
7710
ede49d71
PE
7711 * sysdep.c (get_random): Don't assume EMACS_INT is no wider than long.
7712 Also, don't assume VALBITS / RAND_BITS is less than 5,
7713 and don't rely on undefined behavior when shifting a 1 left into
7714 the sign bit.
7715 * lisp.h (get_random): Change signature to match.
7716
2f30ecd0
PE
7717 * lread.c (hash_string): Use size_t, not int, for hash computation.
7718 Normally we prefer signed values; but hashing is special, because
7719 it's better to use unsigned division on hash table sizes so that
7720 the remainder is nonnegative. Also, size_t is the natural width
7721 for hashing into memory. The previous code used 'int', which doesn't
7722 retain enough info to hash well into very large tables.
7723 (oblookup, oblookup_last_bucket_number, Funintern): Likewise.
7724
2a866e7b
PE
7725 * dbusbind.c: Don't possibly lose pointer info when converting.
7726 (xd_remove_watch, Fdbus_init_bus, xd_read_queued_messages):
7727 Use XPNTR rather than XHASH, so that the high-order bits of
7728 the pointer aren't lost when converting through void *.
7729
51639eac
PE
7730 * eval.c (Fautoload): Don't double-shift a pointer.
7731
92394119
PE
7732 * fns.c (Frandom): Let EMACS_UINT be wider than unsigned long.
7733
dbdb9a7c
JB
77342011-05-06 Juanma Barranquero <lekktu@gmail.com>
7735
7736 * gnutls.c (DEF_GNUTLS_FN):
7737 * image.c (DEF_IMGLIB_FN): Make function pointers static.
7738
db7a0b4f
AS
77392011-05-05 Andreas Schwab <schwab@linux-m68k.org>
7740
7741 * lread.c (lisp_file_lexically_bound_p): Stop scanning at end
7742 marker. (Bug#8610)
7743
cd394be1 77442011-05-05 Eli Zaretskii <eliz@gnu.org>
fab624aa
EZ
7745
7746 * w32heap.c (allocate_heap) [USE_LISP_UNION_TYPE || USE_LSB_TAG]:
7747 New version that can reserve upto 2GB of heap space.
7748
f7ff1b0f 77492011-05-05 Chong Yidong <cyd@stupidchicken.com>
45cb8994
CY
7750
7751 * nsfns.m (Fns_read_file_name): Doc fix (Bug#8534).
7752
639c109b
TZ
77532011-05-05 Teodor Zlatanov <tzz@lifelogs.com>
7754
7755 * gnutls.c (fn_gnutls_certificate_set_x509_key_file): Add alias to
7756 `gnutls_certificate_set_x509_key_file'.
7757
d2127135
JB
77582011-05-05 Juanma Barranquero <lekktu@gmail.com>
7759
7760 * makefile.w32-in ($(BLD)/image.$(O), $(BLD)/process.$(O)):
7761 Update dependencies.
7762
e968f4f3
JB
77632011-05-04 Juanma Barranquero <lekktu@gmail.com>
7764
7765 * gnutls.h (emacs_gnutls_write, emacs_gnutls_read):
7766 * gnutls.c (emacs_gnutls_write, emacs_gnutls_read):
7767 Remove unused parameter `fildes'.
7768 * process.c (read_process_output, send_process): Don't pass it.
7769
84d358f0
JB
77702011-05-04 Juanma Barranquero <lekktu@gmail.com>
7771
7772 Fix previous change: the library cache is defined in w32.c.
7773 * image.c (CACHE_IMAGE_TYPE) [!HAVE_NTGUI]: Define to noop.
7774 (Finit_image_library): Wrap Vlibrary_cache on "#ifdef HAVE_NTGUI".
7775
0898ca10
JB
77762011-05-04 Juanma Barranquero <lekktu@gmail.com>
7777
7778 Implement dynamic loading of GnuTLS on Windows.
7779
7780 * gnutls.h (GNUTLS_EMACS_ERROR_NOT_LOADED): New macro.
7781 (emacs_gnutls_write, emacs_gnutls_read): Mark as extern.
7782 (emacs_gnutls_record_check_pending, emacs_gnutls_transport_set_errno):
7783 Declare.
7784
7785 * gnutls.c (Qgnutls_dll): Define.
7786 (DEF_GNUTLS_FN, LOAD_GNUTLS_FN): New macros.
7787 (gnutls_*): Declare function pointers.
7788 (init_gnutls_functions): New function to initialize function pointers.
7789 (emacs_gnutls_handshake, Fgnutls_error_string, Fgnutls_deinit)
7790 (emacs_gnutls_global_init, Fgnutls_bye): Use function pointers.
7791 (emacs_gnutls_record_check_pending, emacs_gnutls_transport_set_errno):
7792 Wrappers for gnutls_record_check_pending and gnutls_transport_set_errno.
7793 (emacs_gnutls_write, emacs_gnutls_read)
7794 (emacs_gnutls_handle_error, Fgnutls_error_fatalp)
7795 (Fgnutls_available_p): New function.
7796 (Fgnutls_boot): Call Fgnutls_available_p. Use function pointers.
7797 (syms_of_gnutls) <Qgnutls_dll>: Initialize and staticpro it.
7798 (syms_of_gnutls) <Sgnutls_available_p>: defsubr it.
7799
7800 * image.c: Include w32.h.
7801 (Vimage_type_cache): Delete.
7802 (syms_of_image) <Vimage_type_cache>: Don't initialize and staticpro it.
7803 (CACHE_IMAGE_TYPE, Finit_image_library): Use Vlibrary_cache instead.
7804 (w32_delayed_load): Move to w32.c.
7805
7806 * w32.h (VlibraryCache, QCloaded_from, w32_delayed_load): Declare.
7807
7808 * w32.c (QCloaded_from, Vlibrary_cache): Define.
7809 (w32_delayed_load): Move from image.c. When loading a library, record
7810 its filename in the :loaded-from property of the library id.
7811 (globals_of_w32) <QCloaded_from, Vlibrary_cache>:
7812 Initialize and staticpro them.
7813 (emacs_gnutls_pull, emacs_gnutls_push): Call emacs_gnutls_* functions.
7814
7815 * process.c: Include lisp.h before w32.h, not after.
7816 (wait_reading_process_output): Call emacs_gnutls_record_check_pending
7817 instead of gnutls_record_check_pending.
7818
7819 * callproc.c, emacs.c: Include lisp.h before w32.h, not after.
7820
ff4de4aa
TZ
78212011-05-04 Teodor Zlatanov <tzz@lifelogs.com>
7822
7823 * gnutls.c (Fgnutls_boot): Support :keylist and :crlfiles options
7824 instead of :keyfiles. Give GnuTLS the keylist and the CRL lists
7825 as passed in.
7826
abe95abb
JD
78272011-05-03 Jan Djärv <jan.h.d@swipnet.se>
7828
7829 * xterm.c (x_set_frame_alpha): Do not set property on anything
7830 else than FRAME_X_OUTER_WINDOW (Bug#8608).
7831
e16e55d4
JB
78322011-05-02 Juanma Barranquero <lekktu@gmail.com>
7833
7834 * sysdep.c (get_tty_size) [WINDOWSNT]: Implement. (Bug#8596)
7835
bafcf6a5
JB
78362011-05-02 Juanma Barranquero <lekktu@gmail.com>
7837
7838 * gnutls.c (Qgnutls_log_level, Qgnutls_code, Qgnutls_anon)
7839 (Qgnutls_x509pki, Qgnutls_e_interrupted, Qgnutls_e_again)
7840 (Qgnutls_e_invalid_session, Qgnutls_e_not_ready_for_handshake)
7841 (gnutls_global_initialized, Qgnutls_bootprop_priority)
7842 (Qgnutls_bootprop_trustfiles, Qgnutls_bootprop_keyfiles)
7843 (Qgnutls_bootprop_callbacks, Qgnutls_bootprop_loglevel)
7844 (Qgnutls_bootprop_hostname, Qgnutls_bootprop_verify_flags)
7845 (Qgnutls_bootprop_verify_error, Qgnutls_bootprop_verify_hostname_error)
7846 (Qgnutls_bootprop_callbacks_verify): Make static.
7847
e7a6747f
AS
78482011-05-01 Andreas Schwab <schwab@linux-m68k.org>
7849
19ed11ba
AS
7850 * callproc.c: Indentation fixup.
7851
e7a6747f 7852 * sysdep.c (wait_for_termination_1): Make static.
04f2d78b
CB
7853 (wait_for_termination, interruptible_wait_for_termination):
7854 Move after wait_for_termination_1.
e7a6747f 7855
1ef14cb4
LMI
78562011-05-01 Lars Magne Ingebrigtsen <larsi@gnus.org>
7857
7858 * sysdep.c (interruptible_wait_for_termination): New function
7859 which is like wait_for_termination, but allows keyboard
7860 interruptions.
7861
7862 * callproc.c (Fcall_process): Add (:file "file") as an option for
7863 the STDOUT buffer.
7864 (Fcall_process_region): Ditto.
7865
330d880c
EZ
78662011-04-30 Eli Zaretskii <eliz@gnu.org>
7867
8db90b73
EZ
7868 * dosfns.c (Fint86, Fdos_memget, Fdos_memput): Use `ASIZE (FOO)'
7869 rather than `XVECTOR (FOO)->size'.
7870
330d880c
EZ
7871 * process.c: Remove HAVE_INTTYPES_H condition from inclusion of
7872 inttypes.h, as a gnulib replacement is used if it not available in
7873 system headers.
7874
15cbd324
EZ
78752011-04-21 Eli Zaretskii <eliz@gnu.org>
7876
7877 Lift the MOST_POSITIVE_FIXNUM/4 limitation on visited files.
7878 * fileio.c (Finsert_file_contents): Don't limit file size to 1/4
7879 of MOST_POSITIVE_FIXNUM. (Bug#8528)
7880
7881 * coding.c (coding_alloc_by_realloc): Error out if destination
7882 will grow beyond MOST_POSITIVE_FIXNUM.
7883 (decode_coding_emacs_mule): Abort if there isn't enough place in
7884 charbuf for the composition carryover bytes. Reserve an extra
7885 space for up to 2 characters produced in a loop.
7886 (decode_coding_iso_2022): Abort if there isn't enough place in
7887 charbuf for the composition carryover bytes.
7888
78892011-04-21 Eli Zaretskii <eliz@gnu.org>
afda1437 7890
ae940cca
EZ
7891 * doprnt.c (doprnt) [!HAVE_LONG_LONG_INT]: Error out instead of
7892 aborting when %lld or %lll format is passed.
7893 [!HAVE_UNSIGNED_LONG_LONG_INT]: Error out instead of aborting when
7894 %llo or %llx format is passed. (Bug#8545)
7895
03ab8921
EZ
7896 * window.c (window_scroll_line_based): Use a marker instead of
7897 simple variables to record original value of point. (Bug#7952)
7898
afda1437
EZ
7899 * doprnt.c (doprnt): Fix the case where a multibyte sequence
7900 produced by %s or %c overflows available buffer space. (Bug#8545)
7901
f76dee0c
PE
79022011-04-28 Paul Eggert <eggert@cs.ucla.edu>
7903
7904 * doprnt.c (doprnt): Omit useless test; int overflow check (Bug#8545).
283cdbef 7905 (SIZE_MAX): Move defn after all includes, as they might #define it.
f76dee0c 7906
fdc5744d
JB
79072011-04-28 Juanma Barranquero <lekktu@gmail.com>
7908
7909 * w32.c (init_environment): Warn about defaulting HOME to C:\.
7910
638f053a
JB
79112011-04-28 Juanma Barranquero <lekktu@gmail.com>
7912
7913 * keyboard.c (Qdelayed_warnings_hook): Define.
7914 (command_loop_1): Run `delayed-warnings-hook'
7915 if Vdelayed_warnings_list is non-nil.
7916 (syms_of_keyboard) <delayed-warnings-hook>: DEFSYM it.
7917 (syms_of_keyboard) <delayed-warnings-list>: DEFVAR_LISP it.
7918
d178f871
EZ
79192011-04-28 Eli Zaretskii <eliz@gnu.org>
7920
7921 * doprnt.c (doprnt): Don't return value smaller than the buffer
7922 size if the message was truncated. (Bug#8545).
7923
b124fd93
JB
79242011-04-28 Juanma Barranquero <lekktu@gmail.com>
7925
7926 * w32fns.c (Fx_change_window_property, Fx_delete_window_property)
7927 (Fx_window_property): #if-0 the whole functions, not just the bodies.
7928
e810457d
PE
79292011-04-27 Paul Eggert <eggert@cs.ucla.edu>
7930
7931 * doprnt.c (doprnt): Support "ll" length modifier, for long long.
7932
ea51cceb
JB
79332011-04-27 Juanma Barranquero <lekktu@gmail.com>
7934
7935 * makefile.w32-in: Update dependencies.
7936
94dcfacf
EZ
79372011-04-27 Eli Zaretskii <eliz@gnu.org>
7938
7939 Improve `doprnt' and its usage. (Bug#8545)
7940 * doprnt.c (doprnt): Make sure `format' is never accessed beyond
7941 `format_end'. Remove support for %l as a conversion specifier.
7942 Don't use xrealloc. Improve diagnostics when the %l size modifier
7943 is used. Update the commentary.
7944
7945 * eval.c (verror): Simplify calculation of size_t.
7946
7947 * coding.c (Ffind_operation_coding_system): Fix diagnostic error
7948 messages.
7949
f61f41d7
PE
79502011-04-27 Yoshiaki Kasahara <kasahara@nc.kyushu-u.ac.jp> (tiny change)
7951
7952 * buffer.c (init_buffer) [USE_MMAP_FOR_BUFFERS]: Adjust to aliasing
7953 change.
7954
96fb4434
PE
79552011-04-27 Paul Eggert <eggert@cs.ucla.edu>
7956
7957 * nsmenu.m: Replace all uses of XVECTOR with ASIZE and AREF.
7958 This makes this file independent of the recent pseudovector change.
7959
671875da 79602011-04-26 Paul Eggert <eggert@cs.ucla.edu>
eab3844f 7961
69e9b5a3
PE
7962 * keyboard.c (handle_user_signal): Fix pointer signedness problem.
7963
b5f869a7 7964 * gnutls.c (emacs_gnutls_handle_error): Remove unused local.
7754e151 7965 (Fgnutls_boot): gnutls_certificate_verify_peers2 wants unsigned *.
8d4c3955 7966 Remove unused local.
c8926152 7967 (emacs_gnutls_write): Don't use uninitialized rtnval if nbyte <= 0.
080e5a8d 7968
841a1577 7969 * lisp.h: Fix a problem with aliasing and vector headers. (Bug#8546)
04f2d78b
CB
7970 GCC 4.6.0 optimizes based on type-based alias analysis.
7971 For example, if b is of type struct buffer * and v of type struct
eab3844f
PE
7972 Lisp_Vector *, then gcc -O2 was incorrectly assuming that &b->size
7973 != &v->size, and therefore "v->size = 1; b->size = 2; return
7974 v->size;" must therefore return 1. This assumption is incorrect
7975 for Emacs, since it type-puns struct Lisp_Vector * with many other
7976 types. To fix this problem, this patch adds a new type struct
f904488f 7977 vectorlike_header that documents the constraints on layout of vectors
eab3844f
PE
7978 and pseudovectors, and helps optimizing compilers not get fooled
7979 by Emacs's type punning. It also adds the macros XSETTYPED_PVECTYPE
7980 XSETTYPED_PSEUDOVECTOR, TYPED_PSEUDOVECTORP, for similar reasons.
f904488f
PE
7981 * lisp.h (XSETTYPED_PVECTYPE): New macro, specifying the name of
7982 the size member.
eab3844f
PE
7983 (XSETPVECTYPE): Rewrite in terms of new macro.
7984 (XSETPVECTYPESIZE): New macro, specifying both type and size.
7985 This is a bit clearer, and further avoids the possibility of
7986 undesirable aliasing.
7987 (XSETTYPED_PSEUDOVECTOR): New macro, specifying the size.
f904488f 7988 (XSETPSEUDOVECTOR): Rewrite in terms of XSETTYPED_PSEUDOVECTOR.
eab3844f
PE
7989 (XSETSUBR): Rewrite in terms of XSETTYPED_PSEUDOVECTOR and XSIZE,
7990 since Lisp_Subr is a special case (no "next" field).
04f2d78b
CB
7991 (ASIZE): Now uses header.size rather than size.
7992 All previous uses of XVECTOR (foo)->size replaced to use this macro,
f904488f
PE
7993 to avoid the hassle of writing XVECTOR (foo)->header.size.
7994 (struct vectorlike_header): New type.
eab3844f
PE
7995 (TYPED_PSEUDOVECTORP): New macro, also specifying the C type of the
7996 object, to help avoid aliasing.
7997 (PSEUDOVECTORP): Rewrite in terms of TYPED_PSEUDOVECTORP.
7998 (SUBRP): Likewise, since Lisp_Subr is a special case.
7999 * lisp.h (struct Lisp_Vector, struct Lisp_Char_Table):
8000 (struct Lisp_Sub_Char_Table, struct Lisp_Bool_Vector):
8001 (struct Lisp_Hash_Table): Combine first two members into a single
f904488f 8002 struct vectorlike_header member. All uses of "size" and "next" members
eab3844f
PE
8003 changed to be "header.size" and "header.next".
8004 * buffer.h (struct buffer): Likewise.
8005 * font.h (struct font_spec, struct font_entity, struct font): Likewise.
8006 * frame.h (struct frame): Likewise.
8007 * process.h (struct Lisp_Process): Likewise.
8008 * termhooks.h (struct terminal): Likewise.
8009 * window.c (struct save_window_data, struct saved_window): Likewise.
8010 * window.h (struct window): Likewise.
8011 * alloc.c (allocate_buffer, Fmake_bool_vector, allocate_pseudovector):
8012 Use XSETPVECTYPESIZE, not XSETPVECTYPE, to avoid aliasing problems.
8013 * buffer.c (init_buffer_once): Likewise.
8014 * lread.c (defsubr): Use XSETTYPED_PVECTYPE, since Lisp_Subr is a
8015 special case.
8016 * process.c (Fformat_network_address): Use local var for size,
8017 for brevity.
8018
0df1eac5
PE
8019 * bytecode.c (exec_byte_code): Don't use XVECTOR before CHECK_VECTOR.
8020
847ab9d1 8021 Make the Lisp reader and string-to-float more consistent (Bug#8525)
452f4150
PE
8022 * data.c (atof): Remove decl; no longer used or needed.
8023 (digit_to_number): Move to lread.c.
8024 (Fstring_to_number): Use new string_to_number function, to be
8025 consistent with how the Lisp reader treats infinities and NaNs.
8026 Do not assume that floating-point numbers represent EMACS_INT
8027 without losing information; this is not true on most 64-bit hosts.
8028 Avoid double-rounding errors, by insisting on integers when
8029 parsing non-base-10 numbers, as the documentation specifies.
8030 * lisp.h (string_to_number): New decl, replacing ...
8031 (isfloat_string): Remove.
bc0a5c13 8032 * lread.c: Include <inttypes.h>, for uintmax_t and strtoumax.
d78050d6 8033 (read1): Do not accept +. and -. as integers; this
452f4150
PE
8034 appears to have been a coding error. Similarly, do not accept
8035 strings like +-1e0 as floating point numbers. Do not report
8036 overflow for integer overflows unless the base is not 10 which
8037 means we have no simple and reliable way to continue.
8038 Break out the floating-point parsing into a new
8039 function string_to_number, so that Fstring_to_number parses
8040 floating point numbers consistently with the Lisp reader.
04f2d78b 8041 (digit_to_number): Move here from data.c. Make it static inline.
452f4150
PE
8042 (E_CHAR, EXP_INT): Remove, replacing with ...
8043 (E_EXP): New macro, to solve the "1.0e+" problem mentioned below.
8044 (string_to_number): New function, replacing isfloat_string.
8045 This function checks for valid syntax and produces the resulting
8046 Lisp float number too. Rework it so that string-to-number
bc0a5c13 8047 no longer mishandles examples like "1.0e+". Use strtoumax,
d78050d6
PE
8048 so that overflow for non-base-10 numbers is reported only when
8049 there's no portable and simple way to convert to floating point.
452f4150 8050
67769ffc
PE
8051 * textprop.c (set_text_properties_1): Rewrite for clarity,
8052 and to avoid GCC warning about integer overflow.
8053
c20db43f
PE
8054 * intervals.h (struct interval): Use EMACS_INT for members
8055 where EMACS_UINT might cause problems. See
8056 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00514.html>.
8057 (CHECK_TOTAL_LENGTH): Remove cast to EMACS_INT; no longer needed.
8058 * intervals.c (interval_deletion_adjustment): Now returns EMACS_INT.
8059 All uses changed.
37aa2f85
PE
8060 (offset_intervals): Tell GCC not to worry about length overflow
8061 when negating a negative length.
c20db43f 8062
2538aa2f
PE
8063 * alloc.c (overrun_check_malloc, overrun_check_realloc): Now static.
8064 (overrun_check_free): Likewise.
8065
f2d3008d
PE
8066 * alloc.c (SDATA_SIZE) [!GC_CHECK_STRING_BYTES]: Avoid runtime check
8067 in the common case where SDATA_DATA_OFFSET is a multiple of Emacs
8068 word size.
8069
ec8df744
PE
8070 * gnutls.c: Fix problems found by GCC 4.6.0 on Ubuntu 10.10.
8071 (gnutls_make_error): Rename local to avoid shadowing.
8072 (gnutls_emacs_global_deinit): ifdef out; not used.
8073 (Fgnutls_boot): Use const for pointer to readonly storage.
8074 Comment out unused local. Fix pointer signedness problems.
8075
640ee02d
PE
8076 * lread.c (openp): Don't stuff size_t into an 'int'.
8077 Use <= on length, not < on length + 1, to avoid GCC 4.6.0 warning
8078 about possible signed overflow.
8079
6048fb2a
PE
8080 * gtkutil.c: Fix problems found by GCC 4.6.0 on Ubuntu 10.10.
8081 (GDK_KEY_g): Don't define if already defined.
8082 (xg_prepare_tooltip): Avoid pointer signedness problem.
8083 (xg_set_toolkit_scroll_bar_thumb): Redo to avoid two casts.
8084
fa3c87e1
PE
8085 * process.c (Fnetwork_interface_info): Avoid left-shift undefined
8086 behavior with 1 << 31. GCC 4.6.0 warns about this on 32-bit hosts.
8087
2172544b
PE
8088 * xfns.c (Fx_window_property): Simplify a bit,
8089 to make a bit faster and to avoid GCC 4.6.0 warning.
8090 * xselect.c (x_get_window_property, x_handle_dnd_message): Likewise.
8091
9b821a21
PE
8092 * fns.c (internal_equal): Don't assume size_t fits in int.
8093
3c616cfa
PE
8094 * alloc.c (compact_small_strings): Tighten assertion a little.
8095
c2982e87
PE
8096 Replace pEd with more-general pI, and fix some printf arg casts.
8097 * lisp.h (pI): New macro, generalizing old pEd macro to other
8098 conversion specifiers. For example, use "...%"pI"d..." rather
8099 than "...%"pEd"...".
8100 (pEd): Remove. All uses replaced with similar uses of pI.
61bdb816 8101 * m/amdx86-64.h, m/ia64.h, m/ibms390x.h: Likewise.
c2982e87
PE
8102 * alloc.c (check_pure_size): Don't overflow by converting size to int.
8103 * bidi.c (bidi_dump_cached_states): Use pI to avoid cast.
8104 * data.c (Fnumber_to_string): Use pI instead of if-then-else-abort.
8105 * dbusbind.c (xd_append_arg): Use pI to avoid cast.
8106 (Fdbus_method_return_internal, Fdbus_method_error_internal): Likewise.
8107 * font.c (font_unparse_xlfd): Avoid potential buffer overrun on
8108 64-bit hosts.
8109 (font_unparse_xlfd, font_unparse_fcname): Use pI to avoid casts.
8110 * keyboard.c (record_char, modify_event_symbol): Use pI to avoid casts.
8111 * print.c (safe_debug_print, print_object): Likewise.
8112 (print_object): Don't overflow by converting EMACS_INT or EMACS_UINT
8113 to int.
6f04d126
PE
8114 Use pI instead of if-then-else-abort. Use %p to avoid casts,
8115 avoiding the 0 flag, which is not portable.
c2982e87
PE
8116 * process.c (Fmake_network_process): Use pI to avoid cast.
8117 * region-cache.c (pp_cache): Likewise.
8118 * xdisp.c (decode_mode_spec): Likewise.
8119 * xrdb.c (x_load_resources) [USE_MOTIF]: Use pI to avoid undefined
8120 behavior on 64-bit hosts with printf arg.
6f04d126 8121 * xselect.c (x_queue_event): Use %p to avoid casts, avoiding 0 flag.
c2982e87
PE
8122 (x_stop_queuing_selection_requests): Likewise.
8123 (x_get_window_property): Don't truncate byte count to an 'int'
8124 when tracing.
0b432f21 8125
5e073ec7
PE
8126 * frame.c (frame_name_fnn_p): Get rid of strtol, which isn't right
8127 here, since it parses constructs like leading '-' and spaces,
8128 which are not wanted; and it overflows with large numbers.
8129 Instead, simply match F[0-9]+, which is what is wanted anyway.
8130
36372bf9
PE
8131 * alloc.c: Remove unportable assumptions about struct layout.
8132 (SDATA_SELECTOR, SDATA_DATA_OFFSET): New macros.
8133 (SDATA_OF_STRING, SDATA_SIZE, allocate_string_data):
8134 (allocate_vectorlike, make_pure_vector): Use the new macros,
8135 plus offsetof, to remove unportable assumptions about struct layout.
8136 These assumptions hold on all porting targets that I know of, but
8137 they are not guaranteed, they're easy to remove, and removing them
8138 makes further changes easier.
8139
0b432f21
PE
8140 * alloc.c (BLOCK BYTES): Fix typo by changing "ablock" to "ablocks".
8141 This doesn't fix a bug but makes the code clearer.
bfd1c781
PE
8142 (string_overrun_cookie): Now const. Use initializers that
8143 don't formally overflow signed char, to avoid warnings.
000098c1
PE
8144 (allocate_string_data) [GC_CHECK_STRING_OVERRUN]: Fix typo that
8145 can cause Emacs to crash when string overrun checking is enabled.
c7bda33c
PE
8146 (allocate_buffer): Don't assume sizeof (struct buffer) is a
8147 multiple of sizeof (EMACS_INT); it need not be, if
8148 alignof(EMACS_INT) < sizeof (EMACS_INT).
d0f4e1f5 8149 (check_sblock, check_string_bytes, check_string_free_list): Protoize.
0b432f21 8150
895009e1
JB
81512011-04-26 Juanma Barranquero <lekktu@gmail.com>
8152
8153 * keyboard.c (QCrtl): Rename from Qrtl. All uses changed.
8154
6a7a1b0b
TZ
81552011-04-26 Teodor Zlatanov <tzz@lifelogs.com>
8156
8157 * gnutls.c (emacs_gnutls_handshake): Return an error if we're not
b5f869a7 8158 supposed to be handshaking. (Bug#8556)
6a7a1b0b
TZ
8159 Reported by Paul Eggert <eggert@cs.ucla.edu>.
8160
841a1577 81612011-04-26 Daniel Colascione <dan.colascione@gmail.com>
0438ce91
DC
8162
8163 * lisp.h (Qdebug): List symbol.
895009e1 8164 * eval.c (Qdebug): Restore global linkage.
0438ce91
DC
8165 * keyboard.c (debug-on-event): New variable.
8166 (handle_user_signal): Break into debugger when debug-on-event
8167 matches the current signal symbol.
8168
f2d3ba6f
DN
81692011-04-25 Dan Nicolaescu <dann@ics.uci.edu>
8170
8171 * alloc.c (check_sblock, check_string_bytes)
8172 (check_string_free_list): Convert to standard C.
8173
42ce4c63
TZ
81742011-04-25 Teodor Zlatanov <tzz@lifelogs.com>
8175
8176 * w32.c (emacs_gnutls_push): Fix typo.
8177
825cd63c
EZ
81782011-04-25 Eli Zaretskii <eliz@gnu.org>
8179
fb11d64d
EZ
8180 * gnutls.c (emacs_gnutls_handshake): Avoid compiler warnings about
8181 "cast to pointer from integer of different size".
8182
825cd63c
EZ
8183 Improve doprnt and its use in verror. (Bug#8545)
8184 * doprnt.c (doprnt): Document the set of format control sequences
8185 supported by the function. Use SAFE_ALLOCA instead of always
8186 using `alloca'.
8187
8188 * eval.c (verror): Don't limit the buffer size at size_max-1, that
8189 is one byte too soon. Don't use xrealloc; instead xfree and
8190 xmalloc anew.
8191
e061a11b
TZ
81922011-04-24 Teodor Zlatanov <tzz@lifelogs.com>
8193
8194 * gnutls.h: Add GNUTLS_STAGE_CALLBACKS enum to denote we're in the
8195 callbacks stage.
8196
8197 * gnutls.c: Renamed global_initialized to
8198 gnutls_global_initialized. Added internals for the
8199 :verify-hostname-error, :verify-error, and :verify-flags
8200 parameters of `gnutls-boot' and documented those parameters in the
8201 docstring. Start callback support.
9173deec
JB
8202 (emacs_gnutls_handshake): Add Woe32 support. Retry handshake
8203 unless a fatal error occurred. Call gnutls_alert_send_appropriate
8204 on error. Return error code.
e061a11b
TZ
8205 (emacs_gnutls_write): Call emacs_gnutls_handle_error.
8206 (emacs_gnutls_read): Likewise.
8207 (Fgnutls_boot): Return handshake error code.
8208 (emacs_gnutls_handle_error): New function.
8209 (wsaerror_to_errno): Likewise.
8210
8211 * w32.h (emacs_gnutls_pull): Add prototype.
8212 (emacs_gnutls_push): Likewise.
8213
8214 * w32.c (emacs_gnutls_pull): New function for GnuTLS on Woe32.
8215 (emacs_gnutls_push): Likewise.
8216
82172011-04-24 Claudio Bley <claudio.bley@gmail.com> (tiny change)
8218
8219 * process.c (wait_reading_process_output): Check if GnuTLS
8220 buffered some data internally if no FDs are set for TLS
8221 connections.
8222
8223 * makefile.w32-in (OBJ2): Add gnutls.$(O).
8224 (LIBS): Link to USER_LIBS.
8225 ($(BLD)/gnutls.$(0)): New target.
8226
fa6996bc
EZ
82272011-04-24 Eli Zaretskii <eliz@gnu.org>
8228
eb35682e
EZ
8229 * xdisp.c (handle_single_display_spec): Rename the
8230 display_replaced_before_p argument into display_replaced_p, to
8231 make it consistent with the commentary. Fix typos in the
8232 commentary.
8233
e2ad650c
EZ
8234 * textprop.c (syms_of_textprop): Remove dead code.
8235 (copy_text_properties): Delete obsolete commentary about an
8236 interface that was deleted long ago. Fix typos in the description
8237 of arguments.
8238
1b2de274
EZ
8239 * msdos.c (XMenuActivate, XMenuAddSelection): Adjust argument list
8240 to changes in oldXMenu/XMenu.h from 2011-04-16.
8241 <menu_help_message, prev_menu_help_message>: Constify.
8242 (IT_menu_make_room): menu->help_text is now `const char **';
8243 adjust.
8244
8245 * msdos.h (XMenuActivate, XMenuAddSelection): Adjust prototypes
8246 to changes in oldXMenu/XMenu.h from 2011-04-16.
8247 (struct XMenu): Declare `help_text' `const char **'.
8248
8249 * xfaces.c <Qunspecified>: Make extern again.
8250
8251 * syntax.c: Include sys/types.h before including regex.h, as
75f1671a 8252 required by POSIX.
1b2de274 8253
762b15be
EZ
8254 * doc.c (get_doc_string): Improve the format passed to `error'.
8255
8256 * doprnt.c (doprnt): Improve commentary.
8257
8258 * term.c (init_tty) [MSDOS]: Fix 1st argument to maybe_fatal.
8259
8260 * Makefile.in (TAGS): Depend on $(M_FILE) and $(S_FILE), and scan
8261 them with etags.
8262
f1052e5d
EZ
8263 * makefile.w32-in (globals.h): Add a dummy recipe, to make any
8264 changes in globals.h immediately force recompilation.
762b15be
EZ
8265 (TAGS): Depend on $(CURDIR)/m/intel386.h and
8266 $(CURDIR)/s/ms-w32.h.
8267 (TAGS-gmake): Scan $(CURDIR)/m/intel386.h and $(CURDIR)/s/ms-w32.h.
f1052e5d 8268
fa6996bc
EZ
8269 * character.c (Fchar_direction): Function deleted.
8270 (syms_of_character): Don't defsubr it.
8271 <char-direction-table>: Deleted.
8272
e6c3da20
EZ
82732011-04-23 Eli Zaretskii <eliz@gnu.org>
8274
8275 Fix doprnt so it could be used again safely in `verror'. (Bug#8435)
8276 * doprnt.c: Include limits.h.
8277 (SIZE_MAX): New macro.
04f2d78b
CB
8278 (doprnt): Return a size_t value. 2nd arg is now size_t.
8279 Many local variables are now size_t instead of int or unsigned.
e6c3da20
EZ
8280 Improve overflow protection. Support `l' modifier for integer
8281 conversions. Support %l conversion. Don't assume an EMACS_INT
8282 argument for integer conversions and for %c.
8283
8284 * lisp.h (doprnt): Restore prototype.
8285
8286 * makefile.w32-in ($(BLD)/callint.$(O)): Depend on
8287 $(SRC)/character.h.
8288
8289 * Makefile.in (base_obj): Add back doprnt.o.
8290
8291 * deps.mk (doprnt.o): Add back prerequisites.
8292 (callint.o): Depend on character.h.
8293
8294 * eval.c (internal_lisp_condition_case): Include the handler
8295 representation in the error message.
8296 (verror): Call doprnt instead of vsnprintf. Fix an off-by-one bug
8297 when breaking from the loop.
8298
8299 * xdisp.c (vmessage): Call doprnt instead of vsnprintf.
8300
8301 * callint.c (Fcall_interactively): When displaying error message
8302 about invalid control letter, pass the character's codepoint, not
8303 a pointer to its multibyte form. Improve display of the character
8304 in octal and display also its hex code.
8305
8306 * character.c (char_string): Use %x to display the (unsigned)
8307 codepoint of an invalid character, to avoid displaying a bogus
8308 negative value.
8309
8310 * font.c (check_otf_features): Pass SDATA of SYMBOL_NAME to
8311 `error', not SYMBOL_NAME itself.
8312
8313 * coding.c (Fencode_sjis_char, Fencode_big5_char): Use %c for
8314 character arguments to `error'.
8315
8316 * charset.c (check_iso_charset_parameter): Fix incorrect argument
8317 to `error' in error message about FINAL_CHAR argument. Make sure
8318 FINAL_CHAR is a character, and use %c when it is passed as
8319 argument to `error'.
8320
4ffd0d6b 83212011-04-23 Eli Zaretskii <eliz@gnu.org>
97a93095
EZ
8322
8323 * s/ms-w32.h (localtime): Redirect to sys_localtime.
8324
8325 * w32.c: Include <time.h>.
8326 (sys_localtime): New function.
8327
4ffd0d6b 83282011-04-23 Chong Yidong <cyd@stupidchicken.com>
c17819f4
CY
8329
8330 * xdisp.c (init_xdisp): Initialize echo_area_window (Bug#6451).
8331
4ffd0d6b 8332 * buffer.c (syms_of_buffer): Doc fix (Bug#6902).
aac0c6e3 8333
4ffd0d6b 83342011-04-23 Samuel Thibault <sthibault@debian.org> (tiny change)
aac0c6e3 8335
4ffd0d6b
GM
8336 * sysdep.c (wait_for_termination): On GNU Hurd, kill returns -1 on
8337 zombies (Bug#8467).
aac0c6e3 8338
04c56954
EZ
83392011-04-19 Eli Zaretskii <eliz@gnu.org>
8340
8341 * syntax.h (SETUP_SYNTAX_TABLE_FOR_OBJECT): Fix setting of
8342 gl_state.e_property when gl_state.object is Qt.
8343
8344 * insdel.c (make_gap_larger): Remove limitation of buffer size
8345 to <= INT_MAX.
8346
16a43933
CY
83472011-04-18 Chong Yidong <cyd@stupidchicken.com>
8348
8349 * xdisp.c (lookup_glyphless_char_display)
8350 (produce_glyphless_glyph): Handle cons cell entry in
8351 glyphless-char-display.
8352 (Vglyphless_char_display): Document it.
8353
8354 * term.c (produce_glyphless_glyph): Handle cons cell entry in
8355 glyphless-char-display.
8356
4581706e
CY
83572011-04-17 Chong Yidong <cyd@stupidchicken.com>
8358
8359 * xdisp.c (get_next_display_element): Remove unnecessary ifdefs.
8360
8361 * termhooks.h (FRAME_WINDOW_P): Remove duplicated definitions.
8362
8363 * dispextern.h (FACE_SUITABLE_FOR_ASCII_CHAR_P): Add missing
8364 definition for no-X builds.
8365
4887c6e2 83662011-04-16 Paul Eggert <eggert@cs.ucla.edu>
764430a3 8367
fd35b6f9
PE
8368 Static checks with GCC 4.6.0 and non-default toolkits.
8369
5c1ccb01
PE
8370 * s/sol2-6.h, s/unixware.h (PTY_TTY_NAME_SPRINTF): Protoize decl.
8371
006c5daa
PE
8372 * process.c (keyboard_bit_set): Define only if SIGIO.
8373 (send_process_trap): Mark it with NO_RETURN if it doesn't return.
8374 (send_process): Repair possible setjmp clobbering.
8375
efc736d3
PE
8376 * s/usg5-4-common.h (SETUP_SLAVE_PTY): Don't pass extra arg to 'fatal'.
8377
4e2fe2e6
PE
8378 * eval.c: Include <stdio.h>, for vsnprintf on non-GNU/Linux hosts.
8379
f97334a2
PE
8380 * data.c (arith_error): Mark with NO_RETURN if it doesn't return.
8381
4e75f29d
PE
8382 * alloc.c (bytes_used_when_full, SPARE_MEMORY, BYTES_USED):
8383 Define only if needed.
8384
90efadd1
PE
8385 * sysdep.c (_FILE_OFFSET_BITS): Make this hack even uglier
8386 by pacifying GCC about it. Maybe it's time to retire it?
875975e9 8387 * xfaces.c (USG, __TIMEVAL__): Likewise.
90efadd1 8388
3c647824
PE
8389 * dispextern.h (struct redisplay_interface): Rename param
8390 to avoid shadowing.
e264f262 8391 * termhooks.h (struct terminal): Likewise.
761383f4 8392 * xterm.c (xembed_send_message): Likewise.
3c647824 8393
b58c5c4a
PE
8394 * insdel.c (make_gap_smaller): Define only if
8395 USE_MMAP_FOR_BUFFERS || REL_ALLOC || DOUG_LEA_MALLOC.
8396
cad59032
PE
8397 * keyboard.c (read_char): Make a var volatile so longjmp won't clobber
8398 it.
8399
c339dc2e
PE
8400 * emacs.c (MAX_HEAP_BSS_DIFF, my_edata): Move to where they're used,
8401 so that we aren't warned about unused symbols.
8402
91a3e27b
PE
8403 * xfns.c (Fx_file_dialog): Rename local to avoid shadowing.
8404
399c71d3 8405 * xdisp.c (x_produce_glyphs): Mark var as initialized (Bug#8512).
7a3fb125 8406
8ffc96f5
PE
8407 * xfns.c (x_real_positions): Mark locals as initialized.
8408
eef9bc79
PE
8409 * xmenu.c (xmenu_show): Don't use uninitialized vars.
8410
098db9dd
PE
8411 * xterm.c: Fix problems found by static analysis with other toolkits.
8412 (toolkit_scroll_bar_interaction): Define and use only if USE_X_TOOLKIT.
dda3aedd
PE
8413 (x_dispatch_event): Declare static if USE_GTK, and
8414 define if USE_GTK || USE_X_TOOLKIT.
098db9dd 8415 (SET_SAVED_BUTTON_EVENT): Define only if USE_X_TOOLKIT || USE_GTK.
dda3aedd 8416 * xterm.h (x_dispatch_event): Extern only if USE_X_TOOLKIT.
841a1577
JB
8417 * xterm.c, xterm.h (x_mouse_leave): Bring this function back, but only
8418 if defined HAVE_MENUS && !defined USE_X_TOOLKIT && !defined USE_GTK.
098db9dd 8419
eb18f6cc
PE
8420 * xmenu.c (menu_help_callback): Pointer type fixes.
8421 Use const pointers when pointing at readonly data. Avoid pointer
8422 signedness clashes.
8423 (FALSE): Remove unused macro.
8424 (update_frame_menubar): Remove unused decl.
8425
1fe72bf8
PE
8426 * xfns.c (Fx_hide_tip): Move locals to avoid shadowing.
8427
60d9e1db
PE
8428 * menu.c (push_submenu_start, push_submenu_end): Do not define unless
8429 USE_X_TOOLKIT || USE_GTK || HAVE_NS || defined HAVE_NTGUI.
8430 (single_menu_item): Rename local to avoid shadowing.
8431
39261c26
PE
8432 * keyboard.c (make_lispy_event): Remove unused local var.
8433
018c5e19
PE
8434 * frame.c, frame.h (x_get_resource_string): Bring this back, but
8435 only if HAVE_X_WINDOWS && !USE_X_TOOLKIT.
8436
63d2b86e
PE
8437 * bitmaps: Change bitmaps from unsigned char back to the X11
8438 compatible char. Avoid the old compiler warnings about
8439 out-of-range initializers by using, for example, '\xab' rather
8440 than 0xab.
8441
aefd87e1
PE
8442 * xgselect.c (xgselect_initialize): Check vs interface
8443 even if ! (defined (USE_GTK) || defined (HAVE_GCONF)).
8444
bf501fb9
PE
8445 * xmenu.c (xmenu_show): Rename parm to avoid shadowing.
8446
e9829fdf
PE
8447 * xterm.c (x_create_toolkit_scroll_bar): Use const * for pointers
8448 to read-only memory.
8449
1086c095
PE
8450 * fns.c (vector): Remove; this old hack is no longer needed.
8451
2baccd04 8452 * xsmfns.c (create_client_leader_window): Rename shadowing arg.
401f10cb 8453 Remove unused var.
dde42981 8454 (gdk_x11_set_sm_client_id) [!USE_GTK]: Don't define.
2baccd04 8455
72391843 8456 * xrdb.c (x_load_resources): Omit unused local.
3565b346 8457
436c16df 8458 * xfns.c (free_frame_menubar, atof): Remove duplicate decls.
8a94ea33 8459 (x_window): Rename locals to avoid shadowing.
dc5ddd85 8460 (USG): Use the kludged USG macro, to pacify gcc.
436c16df 8461
92bb796d 8462 * xterm.c (x_alloc_nearest_color_for_widget): Remove; unused.
bbbef9e1 8463 (x_term_init): Remove local to avoid shadowing.
92bb796d 8464
764430a3 8465 * xfns.c, xterm.c (_XEditResCheckMessages): Protoize decl.
4887c6e2
PE
8466
8467 * xdisp.c, dispextern.h (set_vertical_scroll_bar): Now extern if
8468 USE_TOOLKIT_SCROLL_BARS && !USE_GTK, as xterm.c needs it then.
8469
d1dfb56c
EZ
84702011-04-16 Eli Zaretskii <eliz@gnu.org>
8471
c4354cb4
EZ
8472 * gnutls.c (Fgnutls_boot): Don't pass Lisp_Object to `error'.
8473
d1dfb56c
EZ
8474 Fix regex.c, syntax.c and friends for buffers > 2GB.
8475 * syntax.h (struct gl_state_s): Declare character position members
8476 EMACS_INT.
8477
8478 * syntax.c (update_syntax_table): Declare 2nd argument EMACS_INT.
8479
04f2d78b
CB
8480 * textprop.c (verify_interval_modification, interval_of):
8481 Declare arguments EMACS_INT.
d1dfb56c
EZ
8482
8483 * intervals.c (adjust_intervals_for_insertion): Declare arguments
8484 EMACS_INT.
8485
8486 * intervals.h (CHECK_TOTAL_LENGTH): Cast to EMACS_INT, not `int'.
8487
8488 * indent.c (Fvertical_motion): Local variable it_start is now
8489 EMACS_INT.
8490
8491 * regex.c (re_match, re_match_2, re_match_2_internal)
8492 (bcmp_translate, regcomp, regexec, print_double_string)
8493 (group_in_compile_stack, re_search, re_search_2, regex_compile)
8494 (re_compile_pattern, re_exec): Declare arguments and local
8495 variables `size_t' and `ssize_t' and return values `regoff_t', as
8496 appropriate.
8497 (POP_FAILURE_REG_OR_COUNT) <pfreg>: Declare `long'.
8498 (CHECK_INFINITE_LOOP) <failure>: Declare `ssize_t'.
8499 <compile_stack_type>: `size' and `avail' are now `size_t'.
8500
8501 * regex.h <regoff_t>: Use ssize_t, not int.
8502 (re_search, re_search_2, re_match, re_match_2): Arguments that
8503 specify buffer/string position and length are now ssize_t and
8504 size_t. Return type is regoff_t.
8505
613052cd
BK
85062011-04-16 Ben Key <bkey76@gmail.com>
8507
8508 * nsfont.m: Fixed bugs in ns_get_family and
8509 ns_descriptor_to_entity that were caused by using free to
8510 deallocate memory blocks that were allocated by xmalloc (via
8511 xstrdup). This caused Emacs to crash when compiled with
8512 XMALLOC_OVERRUN_CHECK defined (when Emacs was configured with
8513 --enable-checking=xmallocoverrun). xfree is now used to
8514 deallocate these memory blocks.
8515
4170f62f 85162011-04-15 Paul Eggert <eggert@cs.ucla.edu>
3e047f51 8517
71b41406
PE
8518 * sysdep.c (emacs_read): Remove unnecessary check vs MAX_RW_COUNT.
8519
9587a89d
PE
8520 emacs_write: Accept and return EMACS_INT for sizes.
8521 See http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00514.html
8522 et seq.
8523 * gnutls.c, gnutls.h (emacs_gnutls_read, emacs_gnutls_write):
8524 Accept and return EMACS_INT.
8525 (emacs_gnutls_write): Return the number of bytes written on
8526 partial writes.
8527 * sysdep.c, lisp.h (emacs_read, emacs_write): Likewise.
273a5f82
PE
8528 (emacs_read, emacs_write): Remove check for negative size, as the
8529 Emacs source code has been audited now.
9587a89d
PE
8530 * sysdep.c (MAX_RW_COUNT): New macro, to work around kernel bugs.
8531 (emacs_read, emacs_write): Use it.
273a5f82
PE
8532 * process.c (send_process): Adjust to the new signatures of
8533 emacs_write and emacs_gnutls_write. Do not attempt to store
8534 a byte offset into an 'int'; it might overflow.
9587a89d 8535 See http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00483.html
273a5f82 8536
3e047f51
PE
8537 * sound.c: Don't assume sizes fit in 'int'.
8538 (struct sound_device.period_size, alsa_period_size):
9c3c56a7 8539 Return EMACS_INT, not int.
3e047f51 8540 (struct sound_device.write, vox_write, alsa_write):
9c3c56a7
PE
8541 Accept EMACS_INT, not int.
8542 (wav_play, au_play): Use EMACS_INT to store sizes and to
3e047f51
PE
8543 record read return values.
8544
cc39a9db
BK
85452011-04-15 Ben Key <bkey76@gmail.com>
8546
c9d0ec6d
JB
8547 * keyboard.c (Qundefined): Don't declare static since it is used
8548 in nsfns.m.
8549 * xfaces.c (Qbold, Qexpanded, Qitalic, Qcondensed): Don't declare
8550 static since they are used in nsfont.m.
cc39a9db 8551
6c60eb9f
SM
85522011-04-15 Stefan Monnier <monnier@iro.umontreal.ca>
8553
8554 * process.c (Qprocessp): Don't declare static.
8555 * lisp.h (Qprocessp): Declare again.
8556
7990b61a
JB
85572011-04-15 Juanma Barranquero <lekktu@gmail.com>
8558
8559 * font.c (Qopentype): Don't make static (used from w32uniscribe.c).
8560
5d4cb038
PE
85612011-04-14 Paul Eggert <eggert@cs.ucla.edu>
8562
8bd7b830 8563 Improve C-level modularity by making more things 'static'.
cd64ea1d 8564
e3b27b31
PE
8565 Don't publish debugger-only interfaces to other modules.
8566 * lisp.h (safe_debug_print, debug_output_compilation_hack):
8567 (verify_bytepos, count_markers): Move decls to the only modules
8568 that need them.
8569 * region-cache.h (pp_cache): Likewise.
8570 * window.h (check_all_windows): Likewise.
8571 * marker.c, print.c, region-cache.c, window.c: Decls moved here.
8572
5d4cb038
PE
8573 * sysdep.c (croak): Now static, if
8574 defined TIOCNOTTY || defined USG5 || defined CYGWIN.
8575 * syssignal.h (croak): Declare only if not static.
69003fd8
PE
8576
8577 * alloc.c (refill_memory_reserve): Now static if
8578 !defined REL_ALLOC || defined SYSTEM_MALLOC.
8579 * lisp.h (refill_memory_reserve): Declare only if not static.
93ea6e8f 8580
e87b6180
PE
8581 * xsettings.c, xsettings.h (xsettings_get_system_normal_font):
8582 Define only if USE_LUCID.
8583
ac64929e
PE
8584 * xrdb.c (x_customization_string, x_rm_string): Now static.
8585
6f37259d
PE
8586 * xmenu.c (x_menu_wait_for_event): Export only if USE_MOTIF.
8587 * xterm.h (x_menu_wait_for_event): Declare only if USE_MOTIF.
8588
1683e3ab
PE
8589 * xdisp.c (draw_row_with_mouse_face): Now static.
8590 * dispextern.h (draw_row_with_mouse_fave): Remove decl.
8591
de9c2632
PE
8592 * window.h (check_all_windows): Mark externally visible.
8593
2b96acb7
PE
8594 * window.c (window_deletion_count): Now static.
8595
8596 * undo.c: Make symbols static if they're not exported.
8597 (last_undo_buffer, last_boundary_position, pending_boundary):
8598 Now static.
8599
50436f33
PE
8600 * textprop.c (interval_insert_behind_hooks): Now static.
8601 (interval_insert_in_front_hooks): Likewise.
8602
64520e5c
PE
8603 * term.c: Make symbols static if they're not exported.
8604 (tty_turn_off_highlight, get_tty_terminal, max_frame_cols):
8605 (max_frame_lines, tty_set_terminal_modes):
8606 (tty_reset_terminal_modes, tty_turn_off_highlight):
8607 (get_tty_terminal): Now static.
8608 (term_mouse_moveto): Do not define if HAVE_WINDOW_SYSTEM.
8609 * termhooks.h (term_mouse_moveto): Do not declare if
8bd7b830 8610 HAVE_WINDOW_SYSTEM.
64520e5c
PE
8611 * dispextern.h (tty_set_terminal_modes, tty_reset_terminal_modes):
8612 (tty_turn_off_highlight, get_tty_terminal): Remove decls.
8613
1fa53021
PE
8614 * sysdep.c: Make symbols static if they're not exported.
8615 (emacs_get_tty, emacs_set_tty, old_fcntl_flags, old_fcntl_owner):
8616 Now static.
8617 (sigprocmask_set, full_mask): Remove; unused.
8618 (wait_debugging): Mark as visible.
8619 * syssignal.h (SIGFULLMASK, full_mask): Remove decls.
8620 * systty.h (emacs_get_tty, emacs_set_tty): Remove decls.
8621
d4b43b22
PE
8622 * syntax.c (syntax_temp): Define only if !__GNUC__.
8623
b7c513d0
PE
8624 * sound.c (current_sound_device, current_sound): Now static.
8625
989b29ad
PE
8626 * search.c (searchbufs, searchbuf_head): Now static.
8627
13a55a78
PE
8628 * scroll.c (scroll_cost): Remove; unused.
8629 * dispextern.h (scroll_cost): Remove decl.
8630
de68a1fc
PE
8631 * region-cache.h (pp_cache): Mark as externally visible.
8632
40ccffa6
PE
8633 * process.c: Make symbols static if they're not exported.
8634 (process_tick, update_tick, create_process, chan_process):
8635 (Vprocess_alist, proc_buffered_char, datagram_access):
8636 (fd_callback_data, send_process_frame, process_sent_to): Now static.
8637 (deactivate_process): Mark defn as static, as well as decl.
8638 * lisp.h (create_process): Remove decl.
8639 * process.h (chan_process, Vprocess_alist): Remove decls.
8640
ad64fc97
PE
8641 * print.c: Make symbols static if they're not exported.
8642 (print_depth, new_backquote_output, being_printed, print_buffer):
8643 (print_buffer_size, print_buffer_pos, print_buffer_pos_byte):
8644 (print_interval, print_number_index, initial_stderr_stream):
8645 Now static.
8646 * lisp.h (Fprinc): Remove decl.
8647 (debug_output_compilation_hack): Mark as externally visible.
8648
adddb265
PE
8649 * sysdep.c (croak): Move decl from here to syssignal.h.
8650 * syssignal.h (croak): Put it here, so the API can be checked when
8651 'croak' is called from dissociate_if_controlling_tty.
8652
1717ede2
PE
8653 * minibuf.c: Make symbols static if they're not exported.
8654 (minibuf_save_list, choose_minibuf_frame): Now static.
8655 * lisp.h (choose_minibuf_frame): Remove decl.
8656
fa5fb2bc
PE
8657 * lisp.h (verify_bytepos, count_markers): Mark as externally visible.
8658
1e3890d1
PE
8659 * lread.c: Make symbols static if they're not exported.
8660 (read_objects, initial_obarray, oblookup_last_bucket_number):
8661 Now static.
8662 (make_symbol): Remove; unused.
8663 * lisp.h (initial_obarray, make_symbol): Remove decls.
8664
8a1414fa
PE
8665 * keyboard.c: Make symbols static if they're not exported.
8666 (single_kboard, recent_keys_index, total_keys, recent_keys):
8667 (this_command_key_count_reset, raw_keybuf, raw_keybuf_count):
8668 (this_single_command_key_start, echoing, last_auto_save):
8669 (read_key_sequence_cmd, dribble, recursive_edit_unwind):
8670 (command_loop, echo_now, keyboard_init_hook, help_char_p):
8671 (quit_throw_to_read_char, command_loop_2, top_level_1, poll_timer):
8672 (Vlispy_mouse_stem, double_click_count):
8673 Now static.
8674 (force_auto_save_soon): Define only if SIGDANGER.
8675 (ignore_mouse_drag_p): Now static if
8676 !defined HAVE_WINDOW_SYSTEM || defined USE_GTK || defined HAVE_NS.
8677 (print_help): Remove; unused.
8678 (stop_character, last_timer_event): Mark as externally visible.
8679 * keyboard.h (ignore_mouse_drag_p): Declare only if
8680 defined HAVE_WINDOW_SYSTEM && !defined USE_GTK && !defined HAVE_NS.
8681 (echo_now, help_char_p, quit_throw_to_read_char): Remove decls.
8682 * lisp.h (echoing): Remove decl.
8683 (force_auto_save_soon): Declare only if SIGDANGER.
8684 * xdisp.c (redisplay_window): Simplify code, to make it more
8685 obvious that ignore_mouse_drag_p is not accessed if !defined
8686 USE_GTK && !defined HAVE_NS.
8687
93ea6e8f
PE
8688 * intervals.c: Make symbols static if they're not exported.
8689 (merge_properties_sticky, merge_interval_right, delete_interval):
8690 Now static.
8691 * intervals.h (merge_interval_right, delete_interval): Remove decls.
8692
77382fcc
PE
8693 * insdel.c: Make symbols static if they're not exported.
8694 However, leave prepare_to_modify_buffer alone. It's never
8695 called from outside this function, but that appears to be a bug.
8696 (combine_after_change_list, combine_after_change_buffer):
4889fc82 8697 (adjust_after_replace, signal_before_change): Now static.
77382fcc
PE
8698 (adjust_after_replace_noundo): Remove; unused.
8699 * lisp.h (adjust_after_replace, adjust_after_replace_noundo):
4889fc82 8700 (signal_before_change): Remove decls.
77382fcc 8701
9306c32e
PE
8702 * indent.c (val_compute_motion, val_vmotion): Now static.
8703
cd44d2eb
PE
8704 * image.c: Make symbols static if they're not exported.
8705 * dispextern.h (x_create_bitmap_from_xpm_data): Do not declare
8706 if USE_GTK.
8707 * image.c (x_create_bitmap_from_xpm_data): Do not define if USE_GTK.
8708 (xpm_color_cache, ct_table, ct_colors_allocated): Now static.
8709
ad9a7a06
PE
8710 * fringe.c (standard_bitmaps): Now static.
8711 (max_used_fringe_bitmap): Now static, unless HAVE_NS.
8712
81626931
PE
8713 * frame.c: Make symbols static if they're not exported.
8714 (x_report_frame_params, make_terminal_frame): Now static.
8715 (get_frame_param): Now static, unless HAVE_NS.
8716 (x_fullscreen_adjust): Define if WINDOWSNT, not if HAVE_WINDOW_SYSTEM.
8717 (x_get_resource_string): Remove; not used.
8718 * frame.h (make_terminal_frame, x_report_frame_params):
8719 (x_get_resource_string); Remove decls.
8720 (x_fullscreen_adjust): Declare only if WINDOWSNT.
8721 * lisp.h (get_frame_param): Declare only if HAVE_NS.
8722
239f9db9
PE
8723 * font.c, fontset.c: Make symbols static if they're not exported.
8724 * dispextern.h (FACE_SUITABLE_FOR_ASCII_CHAR_P): New macro.
8725 (FACE_SUITABLE_FOR_CHAR_P): Use it.
8726 * font.c (font_close_object): Now static.
8727 * font.h (font_close_object): Remove.
8728 * fontset.c (FONTSET_OBJLIST): Remove.
8729 (free_realized_fontset) #if-0 the body, which does nothing.
8730 (face_suitable_for_char_p): #if-0, as it's never called.
8731 * fontset.h (face_suitable_for_char_p): Remove decl.
04f2d78b
CB
8732 * xfaces.c (face_at_string_position):
8733 Use FACE_SUITABLE_FOR_ASCII_CHAR_P, not FACE_SUITABLE_FOR_CHAR_P,
239f9db9
PE
8734 since 0 is always ASCII.
8735
dfcf3579
PE
8736 * fns.c (weak_hash_tables): Now static.
8737
5045092b
PE
8738 * fileio.c: Make symbols static if they're not exported.
8739 (auto_saving, auto_save_mode_bits, auto_save_error_occurred):
8740 (Vwrite_region_annotation_buffers): Now static.
8741
57a96f5c
PE
8742 * eval.c: Make symbols static if they're not exported.
8743 (backtrace_list, lisp_eval_depth, when_entered_debugger): Now static.
8744 * lisp.h (backtrace_list): Remove decl.
8745
35f08c38
PE
8746 * emacs.c: Make symbols static if they're not exported.
8747 (malloc_state_ptr, malloc_using_checking, syms_of_emacs):
8748 (fatal_error_code, fatal_error_signal_hook, standard_args):
8749 Now static.
8750 (fatal_error_signal): Now static, unless FLOAT_CATCH_SIGKILL.
8751 (DEFINE_DUMMY_FUNCTION): Mark function as externally visible.
8752 (__CTOR_LIST__, __DTOR_LIST__): Now externally visible.
8753 * lisp.h (fatal_error_signal_hook): Remove decl.
8754 (fatal_error_signal): Declare only if FLOAT_CATCH_SIGKILL.
8755
f44bd759
PE
8756 * editfns.c: Move a (normally-unused) function to its only use.
8757 * editfns.c, lisp.h (get_operating_system_release): Remove.
8758 * process.c (init_process) [DARWIN_OS]: Do it inline, as it is not
8759 worth the hassle of breaking this out.
8760
b532497d
PE
8761 * xterm.c: Make symbols static if they're not exported.
8762 (x_raise_frame, x_lower_frame, x_wm_set_window_state):
8763 (x_wm_set_icon_pixmap, x_initialize, XTread_socket_fake_io_error):
8764 (x_destroy_window, x_delete_display):
8765 Now static.
8766 (x_dispatch_event): Now static if ! (USE_MOTIF || USE_X_TOOLKIT).
8767 (x_mouse_leave): Remove; unused.
8768 * xterm.h (x_display_info_for_name, x_raise_frame, x_lower_frame):
8769 (x_destroy_window, x_wm_set_window_state, x_wm_set_icon_pixmap):
8770 (x_delete_display, x_initialize, x_set_border_pixel, x_screen_planes):
8771 Remove decls.
8772 (x_mouse_leave): Declare only if WINDOWSNT.
8773 (x_dispatch_event): Declare only if USE_MOTIF or USE_X_TOOLKIT.
8774 (xic_create_fontsetname): Declare only if HAVE_X_WINDOWS &&
8775 USE_X_TOOLKIT.
8776
1675728f
PE
8777 * ftxfont.c: Make symbols static if they're not exported.
8778 (ftxfont_driver): Export only if !defined HAVE_XFT && def8ined
8779 HAVE_FREETYPE.
8780 * font.h (ftxfont_driver): Likewise.
8781
e4cebfca
PE
8782 * xfns.c: Make symbols static if they're not exported.
8783 (x_last_font_name, x_display_info_for_name):
8784 (x_set_foreground_color, x_set_background_color, x_set_mouse_color):
8785 (x_set_cursor_color, x_set_border_pixel, x_set_border_color):
8786 (x_set_cursor_type, x_set_icon_type, x_set_icon_name):
8787 (x_set_scroll_bar_foreground, x_set_scroll_bar_background):
8788 (x_explicitly_set_name, x_set_title, xic_defaut_fontset, tip_timer):
8789 (last_show_tip_args): Now static.
8790 (xic_defaut_fontset, xic_create_fontsetname): Define only if
8791 defined HAVE_X_WINDOWS && defined USE_X_TOOLKIT
8792 (x_screen_planes): Remove; unused.
8793 * dispextern.h (x_screen_planes): Remove decl.
8794
5bf46f05
PE
8795 * dispnew.c: Make symbols static if they're not exported.
8796 * dispextern.h (redraw_garbaged_frames, scrolling):
8797 (increment_row_positions): Remove.
8798 * dispnew.c (new_glyph_matrix, increment_row_positions, scrolling):
8799 (delayed_size_change, glyph_matrix_count, glyph_pool_count):
8800 Now static.
8801 (redraw_garbaged_frames): Remove; unused.
8802
435f4c28
PE
8803 * xfaces.c: Make symbols static if they're not exported.
8804 * dispextern.h (ascii_face_of_lisp_face, free_realized_face):
8805 Remove decls.
8806 * xterm.h (defined_color): Remove decls.
8807 (x_free_dpy_colors): Declare only if USE_X_TOOLKIT.
8808 * xfaces.c (tty_suppress_bold_inverse_default_colors_p):
8809 (menu_face_changed_default, defined_color, free_realized_face):
8810 (x_free_dpy_colors): Define only if USE_X_TOOLKIT.
8811 (ascii_face_of_lisp_face): Remove; unused.
8812
8524aef3
PE
8813 * xdisp.c: Make symbols static if they're not exported.
8814 * dispextern.h (scratch_glyph_row, window_box_edges):
8815 (glyph_to_pixel_coords, set_cursor_from_row):
8816 (get_next_display_element, set_iterator_to_next):
8817 (highlight_trailing_whitespace, frame_to_window_pixel_xy):
8818 (show_mouse_face): Remove decls
8819 * frame.h (message_buf_print): Likewise.
8820 * lisp.h (pop_message, set_message, check_point_in_composition):
8821 Likewise.
8822 * xterm.h (set_vertical_scroll_bar): Likewise.
8823 * xdisp.c (list_of_error, Vmessage_stack, line_number_displayed):
8824 (message_buf_print, scratch_glyph_row, displayed_buffer):
8825 (set_iterator_to_next, pop_message, set_message, set_cursor_from_row):
8826 (get_next_display_element, show_mouse_face, window_box_edges):
8827 (frame_to_window_pixel_xy, check_point_in_composition):
8828 (set_vertical_scroll_bar, highlight_trailing_whitespace): Now static.
8829 (glyph_to_pixel_coords): Remove; unused.
8830
16390cd2
PE
8831 * dired.c (file_name_completion): Now static.
8832
8833 * dbusbind.c (xd_in_read_queued_messages): Now static.
8834
a25f4dfa
PE
8835 * lisp.h (circular_list_error, FOREACH): Remove; unused.
8836 * data.c (circular_list_error): Remove.
8837
14a9c8df
PE
8838 * commands.h (last_point_position, last_point_position_buffer):
8839 (last_point_position_window): Remove decls.
8840 * keyboard.c: Make these variables static.
8841
04f2d78b
CB
8842 * coding.h (coding, code_convert_region, encode_coding_gap):
8843 Remove decls.
74ab6df5
PE
8844 * coding.c (Vsjis_coding_system, Vbig5_coding_system):
8845 (iso_code_class, detect_coding, code_convert_region): Now static.
8846 (encode_coding_gap): Remove; unused.
8847
38dfbee1
PE
8848 * chartab.c (chartab_chars, chartab_bits): Now static.
8849
a2cb4e63
PE
8850 * charset.h (charset_iso_8859_1): Remove decl.
8851 * charset.c (charset_iso_8859_1, charset_emacs, map_charset_for_dump):
8852 Now static.
8853
127198fd
PE
8854 * ccl.h (check_ccl_update, Vccl_program_table): Remove decls.
8855 * ccl.c (Vccl_program_table): Now static.
8856 (check_ccl_update): Remove; unused.
8857
d85b608f
PE
8858 * category.c (SET_CATEGORY_SET, set_category_set): Move here.
8859 * category.h: ... from here.
8860 * category.c (check_category_table, set_category_set): Now static.
8861
31cd66f3
PE
8862 * casetab.c (Vascii_upcase_table, Vascii_eqv_table): Now static.
8863 * lisp.h: Remove these decls.
8864
c358e587
PE
8865 * buffer.c (buffer_count): Remove unused var.
8866
e78aecca
PE
8867 * bidi.c (bidi_dump_cached_states): Mark as externally visible,
8868 so that it's not optimized away.
8869 (bidi_ignore_explicit_marks_for_paragraph_level): Likewise.
8870 * dispextern.h (bidi_dump_cached_states): Remove, since it's
8871 exported only to the debugger.
8872
e192d7d3 8873 * atimer.c (alarm_signal_handler, run_all_atimers): Now static.
04f2d78b 8874 * atimer.h (run_all_atimers): Remove; not exported.
e192d7d3 8875
92470028
PE
8876 font.c: Make copy_font_spec and merge_font_spec ordinary C functions.
8877 * font.c (copy_font_spec): Rename from Fcopy_font_spec, since it
8878 was inaccessible from Lisp.
8879 (merge_font_spec): Likewise, renaming from Fmerge_font_spec.
8880 * font.c, font.h, fontset.c, xfaces.c, xfont.c: Change all uses.
8881
244ed907
PE
8882 alloc.c: Import and export fewer symbols, and remove unused items.
8883 * lisp.h (suppress_checking, die): Declare only if ENABLE_CHECKING
8884 is defined.
8885 (suppress_checking): Add EXTERNALLY_VISIBLE attribute, so that
8886 it's not optimized away by whole-program optimization.
8887 (message_enable_multibyte, free_misc): Remove.
8888 (catchlist, handlerlist, mark_backtrace):
8889 Declare only if BYTE_MARK_STACK.
8890 (mark_byte_stack): Likewise, fixing a ifdef-vs-if typo.
8891 * alloc.c (pure): Export only if VIRT_ADDR_VARIES is defined.
8892 (message_enable_multibyte): Remove decl.
8893 (free_misc, interval_free_list, float_block, float_block_index):
8894 (n_float_blocks, float_free_list, cons_block, cons_block_index):
8895 (cons_free_list, last_marked_index):
8896 Now static.
8897 (suppress_checking, die): Define only if ENABLE_CHECKING is defined.
8898 * eval.c (catchlist, handlerlist): Export only if BYTE_MARK_STACK.
8899 (mark_backtrace): Define only if BYTE_MARK_STACK.
8900 * xdisp.c (message_enable_multibyte): Now static.
8901
61c2b50e 8902 Declare Lisp_Object Q* variables to be 'static' if not exported.
955cbe7b
PE
8903 This makes it easier for human readers (and static analyzers)
8904 to see whether these variables are used from other modules.
8905 * alloc.c, buffer.c, bytecode.c, callint.c, casetab.c, category.c:
8906 * ccl.c, character.c, charset.c, cmds.c, coding.c, composite.c:
8907 * data.c, dbusbind.c, dired.c, editfns.c, eval.c, fileio.c, fns.c:
8908 * font.c, frame.c, fringe.c, ftfont.c, image.c, keyboard.c, keymap.c:
8909 * lread.c, macros.c, minibuf.c, print.c, process.c, search.c:
8910 * sound.c, syntax.c, textprop.c, window.c, xdisp.c, xfaces.c, xfns.c:
8911 * xmenu.c, xselect.c:
8912 Declare Q* vars static if they are not used in other modules.
8913 * ccl.h, character.h, charset.h, coding.h, composite.h, font.h:
8914 * frame.h, intervals.h, keyboard.h, lisp.h, process.h, syntax.h:
8915 Remove decls of unexported vars.
8916 * keyboard.h (EVENT_HEAD_UNMODIFIED): Remove now-unused macro.
8917
95c82688
PE
8918 * lisp.h (DEFINE_FUNC): Make sname 'static'.
8919
16a97296
PE
8920 Make Emacs functions such as Fatom 'static' by default.
8921 This makes it easier for human readers (and static analyzers)
8922 to see whether these functions can be called from other modules.
8923 DEFUN now defines a static function. To make the function external
8924 so that it can be used in other C modules, use the new macro DEFUE.
8bd7b830
PE
8925 * lisp.h (Funibyte_char_to_multibyte, Fsyntax_table_p):
8926 (Finit_image_library):
16a97296
PE
8927 (Feval_region, Fbacktrace, Ffetch_bytecode, Fswitch_to_buffer):
8928 (Ffile_executable_p, Fmake_symbolic_link, Fcommand_execute):
8929 (Fget_process, Fdocumentation_property, Fbyte_code, Ffile_attributes):
8930 Remove decls, since these functions are now static.
8931 (Funintern, Fget_internal_run_time): New decls, since these functions
8932 were already external.
95c82688 8933
16a97296
PE
8934 * alloc.c, buffer.c, callint.c, callproc.c, casefiddle.c, casetab.c:
8935 * ccl.c, character.c, chartab.c, cmds.c, coding.c, data.c, dispnew.c:
8936 * doc.c, editfns.c, emacs.c, eval.c, fileio.c, filelock.c, floatfns.c:
8937 * fns.c, font.c, fontset.c, frame.c, image.c, indent.c:
8938 * keyboard.c, keymap.c, lread.c:
8939 * macros.c, marker.c, menu.c, minibuf.c, print.c, process.c, search.c:
8940 * syntax.c, term.c, terminal.c, textprop.c, undo.c:
8941 * window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xsettings.c:
8942 Mark functions with DEFUE instead of DEFUN,
8943 if they are used in other modules.
8944 * buffer.c (Fset_buffer_major_mode, Fdelete_overlay): New forward
8945 decls for now-static functions.
8946 * buffer.h (Fdelete_overlay): Remove decl.
8947 * callproc.c (Fgetenv_internal): Mark as internal.
8948 * composite.c (Fremove_list_of_text_properties): Remove decl.
8949 (Fcomposition_get_gstring): New forward static decl.
8950 * composite.h (Fcomposite_get_gstring): Remove decl.
8951 * dired.c (Ffile_attributes): New forward static decl.
8952 * doc.c (Fdocumntation_property): New forward static decl.
8953 * eval.c (Ffetch_bytecode): New forward static decl.
8954 (Funintern): Remove extern decl; now in .h file where it belongs.
8955 * fileio.c (Fmake_symbolic_link): New forward static decl.
8956 * image.c (Finit_image_library): New forward static decl.
8957 * insdel.c (Fcombine_after_change_execute): Make forward decl static.
8958 * intervals.h (Fprevious_property_change):
8959 (Fremove_list_of_text_properties): Remove decls.
8960 * keyboard.c (Fthis_command_keys): Remove decl.
8961 (Fcommand_execute): New forward static decl.
8962 * keymap.c (Flookup_key): New forward static decl.
8963 (Fcopy_keymap): Now static.
8964 * keymap.h (Flookup_key): Remove decl.
8965 * process.c (Fget_process): New forward static decl.
8966 (Fprocess_datagram_address): Mark as internal.
8967 * syntax.c (Fsyntax_table_p): New forward static decl.
8968 (skip_chars): Remove duplicate decl.
8969 * textprop.c (Fprevious_property_change): New forward static decl.
8970 * window.c (Fset_window_fringes, Fset_window_scroll_bars):
8971 Now internal.
8972 (Fset_window_margins, Fset_window_vscroll): New forward static decls.
8973 * window.h (Fset_window_vscroll, Fset_window_margins): Remove decls.
8974
785bbd42
PE
8975 * editfns.c (Fformat): Remove unreachable code.
8976
8b913b57
AS
89772011-04-14 Andreas Schwab <schwab@linux-m68k.org>
8978
8979 * fileio.c (Finsert_file_contents): Fix typo in 2005-05-13
8980 change. (Bug#8496)
8981
a6744a35
EZ
89822011-04-13 Eli Zaretskii <eliz@gnu.org>
8983
8984 * xdisp.c (handle_invisible_prop): Don't call bidi_paragraph_init
8985 when at ZV. (Bug#8487)
8986
e7974947
AS
89872011-04-12 Andreas Schwab <schwab@linux-m68k.org>
8988
baad03f0
AS
8989 * charset.c (Fclear_charset_maps): Use xfree instead of free.
8990 (Bug#8437)
8991 * keyboard.c (parse_tool_bar_item): Likewise.
8992 * sound.c (sound_cleanup, alsa_close): Likewise.
8993 * termcap.c (tgetent): Likewise.
8994 * xfns.c (x_default_font_parameter): Likewise.
8995 * xsettings.c (read_and_apply_settings): Likewise.
8996
e7974947
AS
8997 * alloc.c (overrun_check_malloc, overrun_check_realloc)
8998 (overrun_check_free): Protoize.
8999
28272684
PE
90002011-04-12 Paul Eggert <eggert@cs.ucla.edu>
9001
9002 * sysdep.c (emacs_read, emacs_write): Check for negative sizes
9003 since callers should never pass a negative size.
9004 Change the signature to match that of plain 'read' and 'write'; see
9005 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00397.html>.
9006 * lisp.h: Update prototypes of emacs_write and emacs_read.
9007
11997c76
EZ
90082011-04-11 Eli Zaretskii <eliz@gnu.org>
9009
9010 * xdisp.c (redisplay_window): Don't try to determine the character
9011 position of the scroll margin if the window start point w->startp
e896f03c 9012 is outside the buffer's accessible region. (Bug#8468)
11997c76 9013
8a2cbd72
EZ
90142011-04-10 Eli Zaretskii <eliz@gnu.org>
9015
9016 Fix write-region and its subroutines for buffers > 2GB.
9017 * fileio.c (a_write, e_write): Modify declaration of arguments and
9018 local variables to support buffers larger than 2GB.
9019 (Fcopy_file): Use EMACS_INT for return value of emacs_read.
9020
9021 * sysdep.c (emacs_write, emacs_read): Use ssize_t for last
9022 argument, local variables, and return value.
9023
9024 * lisp.h: Update prototypes of emacs_write and emacs_read.
9025
9026 * sound.c (vox_write): Use ssize_t for return value of emacs_write.
9027
4073e537 90282011-04-10 Paul Eggert <eggert@cs.ucla.edu>
eb3f1cc8 9029
1ebfdcb6
PE
9030 * xdisp.c (vmessage): Use memchr, not strnlen, which some hosts lack.
9031
b2ded58d
PE
9032 Fix more problems found by GCC 4.6.0's static checks.
9033
7d66342c
PE
9034 * xdisp.c (vmessage): Use a better test for character truncation.
9035
bbf47d44
PE
9036 * charset.c (load_charset_map): <, not <=, for optimization,
9037 and to avoid potential problems with integer overflow.
9248994d 9038 * chartab.c (sub_char_table_set_range, char_table_set_range): Likewise.
f9a68bc5 9039 * casetab.c (set_identity, shuffle): Likewise.
3ab1c7ce 9040 * editfns.c (Fformat): Likewise.
1e69125e 9041 * syntax.c (skip_chars): Likewise.
3befa583 9042
e3019616
PE
9043 * xmenu.c (set_frame_menubar): Allocate smaller local vectors.
9044 This also lets GCC 4.6.0 generate slightly better loop code.
9045
becfa255
PE
9046 * callint.c (Fcall_interactively): <, not <=, for optimization.
9047 (Fcall_interactively): Count the number of arguments produced,
9048 not the number of arguments given. This is simpler and lets GCC
9049 4.6.0 generate slightly better code.
9050
dae0cd48
PE
9051 * ftfont.c: Distingish more carefully between FcChar8 and char.
9052 The previous code passed unsigned char * to a functions like
9053 strlen and xstrcasecmp that expect char *, which does not
9054 conform to the C standard.
9055 (get_adstyle_property, ftfont_pattern_entity): Use FcChar8 for
9056 arguments to FcPatternGetString, and explicitly cast FcChar8 * to
9057 char * when the C standard requires it.
9058
76032d70
PE
9059 * keyboard.c (read_char): Remove unused var.
9060
eb3f1cc8
PE
9061 * eval.c: Port to Windows vsnprintf (Bug#8435).
9062 Include <limits.h>.
9063 (SIZE_MAX): Define if the headers do not.
9064 (verror): Do not give up if vsnprintf returns a negative count.
9065 Instead, grow the buffer. This ports to Windows vsnprintf, which
9066 does not conform to C99. Problem reported by Eli Zaretskii.
9067 Also, simplify the allocation scheme, by avoiding the need for
9068 calling realloc, and removing the ALLOCATED variable.
9069
70476b54
PE
9070 * eval.c (verror): Initial buffer size is 4000 (not 200) bytes.
9071
12020a9e
PE
9072 Remove invocations of doprnt, as Emacs now uses vsnprintf.
9073 But keep the doprint source code for now, as we might revamp it
9074 and use it again (Bug#8435).
ea6c7ae6
PE
9075 * lisp.h (doprnt): Remove.
9076 * Makefile.in (base_obj): Remove doprnt.o.
9077 * deps.mk (doprnt.o): Remove.
9078
5fdb398c
PE
9079 error: Print 32- and 64-bit integers portably (Bug#8435).
9080 Without this change, on typical 64-bit hosts error ("...%d...", N)
9081 was used to print both 32- and 64-bit integers N, which relied on
9082 undefined behavior.
61bdb816 9083 * lisp.h, m/amdx86-64.h, m/ia64.h, m/ibms390x.h (pEd): New macro.
5fdb398c
PE
9084 * lisp.h (error, verror): Mark as printf-like functions.
9085 * eval.c (verror): Use vsnprintf, not doprnt, to do the real work.
9086 Report overflow in size calculations when allocating printf buffer.
9087 Do not truncate output string at its first null byte.
9088 * xdisp.c (vmessage): Use vsnprintf, not doprnt, to do the real work.
9089 Truncate the output at a character boundary, since vsnprintf does not
9090 do that.
9091 * charset.c (check_iso_charset_parameter): Convert internal
9092 character to string before calling 'error', since %c now has the
9093 printf meaning.
9094 * coding.c (Fdecode_sjis_char, Fdecode_big5_char): Avoid int
9095 overflow when computing char to be passed to 'error'. Do not
9096 pass Lisp_Object to 'error'; pass the integer instead.
9097 * nsfns.m (Fns_do_applescript): Use int, not long, since it's
9098 formatted with plain %d.
9099
b189fa66
PE
9100 * eval.c (internal_lisp_condition_case): Don't pass spurious arg.
9101
bff87ef0
PE
9102 * keyboard.c (access_keymap_keyremap): Print func name, not garbage.
9103
7e2cac20
PE
9104 * coding.c (Fdecode_sjis_char): Don't assume CODE fits in int.
9105
ce4d90b5
PE
9106 * xterm.c (x_catch_errors): Remove duplicate declaration.
9107
266c9547
PE
9108 * term.c (maybe_fatal): Mark its 3rd arg as a printf format, too.
9109
79c49ad2
PE
9110 * xdisp.c, lisp.h (message_nolog): Remove; unused.
9111
368f4090
JM
91122011-04-10 Jim Meyering <meyering@redhat.com>
9113
9114 use ssize_t and size_t for read- and write-like emacs_gnutls_* functions
9115 * gnutls.c (emacs_gnutls_read): Adjust signature to be more read-like:
9116 return ssize_t not "int", and use size_t as the buffer length.
9117 (emacs_gnutls_write): Likewise, and make the buffer pointer "const".
9118 * gnutls.h: Update declarations.
9119 * process.c (read_process_output): Use ssize_t, to match.
9120 (send_process): Likewise.
9121
a32d4040
CY
91222011-04-09 Chong Yidong <cyd@stupidchicken.com>
9123
9124 * image.c (Fimagemagick_types): Doc fix, and comment cleanup.
9125
8546720e 91262011-04-09 Chong Yidong <cyd@stupidchicken.com>
aac0c6e3 9127
04f2d78b
CB
9128 * ftfont.c (get_adstyle_property, ftfont_pattern_entity):
9129 Use unsigned char, to match FcChar8 type definition.
aac0c6e3 9130
8546720e
GM
9131 * xterm.c (handle_one_xevent):
9132 * xmenu.c (create_and_show_popup_menu):
9133 * xselect.c (x_decline_selection_request)
9134 (x_reply_selection_request): Avoid type-punned deref of X events.
aac0c6e3 9135
0a2f5c1a 91362011-04-09 Eli Zaretskii <eliz@gnu.org>
a53e2e89
EZ
9137
9138 Fix some uses of `int' instead of EMACS_INT.
9139 * search.c (string_match_1, fast_string_match)
9140 (fast_c_string_match_ignore_case, fast_string_match_ignore_case)
9141 (scan_buffer, find_next_newline_no_quit)
9142 (find_before_next_newline, search_command, Freplace_match)
9143 (Fmatch_data): Make some `int' variables be EMACS_INT.
9144
9145 * xdisp.c (display_count_lines): 3rd argument and return value now
9146 EMACS_INT. All callers changed.
9147 (pint2hrstr): Last argument is now EMACS_INT.
9148
9149 * coding.c (detect_coding_utf_8, detect_coding_emacs_mule)
9150 (detect_coding_iso_2022, detect_coding_sjis, detect_coding_big5)
9151 (detect_coding_ccl, detect_coding_charset, decode_coding_utf_8)
9152 (decode_coding_utf_16, decode_coding_emacs_mule)
9153 (decode_coding_iso_2022, decode_coding_sjis, decode_coding_big5)
9154 (decode_coding_ccl, decode_coding_charset)
9155 <consumed_chars, consumed_chars_base>: Declare EMACS_INT.
9156 (decode_coding_iso_2022, decode_coding_emacs_mule)
9157 (decode_coding_sjis, decode_coding_big5, decode_coding_charset)
9158 <char_offset, last_offset>: Declare EMACS_INT.
9159 (encode_coding_utf_8, encode_coding_utf_16)
9160 (encode_coding_emacs_mule, encode_invocation_designation)
9161 (encode_designation_at_bol, encode_coding_iso_2022)
9162 (encode_coding_sjis, encode_coding_big5, encode_coding_ccl)
9163 (encode_coding_raw_text, encode_coding_charset) <produced_chars>:
9164 Declare EMACS_INT.
9165 (ASSURE_DESTINATION): Declare more_bytes EMACS_INT.
9166 (encode_invocation_designation): Last argument P_NCHARS is now
9167 EMACS_INT.
9168 (decode_eol): Declare pos_byte, pos, and pos_end EMACS_INT.
9169 (produce_chars): from_nchars and to_nchars are now EMACS_INT.
9170
9171 * coding.h (struct coding_system) <head_ascii>: Declare EMACS_INT.
9172 All users changed.
9173
9174 * ccl.c (Fccl_execute_on_string): Declare some variables
9175 EMACS_INT.
9176
8546720e 91772011-04-08 Samuel Thibault <sthibault@debian.org> (tiny change)
0080dc6b
SS
9178
9179 * term.c (init_tty): Fix incorrect ifdef placement (Bug#8450).
9180
4e19a977
CS
91812011-03-19 Christoph Scholtes <cschol2112@googlemail.com>
9182
9183 * process.c (Fformat_network_address): Doc fix.
9184
87302331
R
91852011-04-08 T.V. Raman <tv.raman.tv@gmail.com> (tiny change)
9186
ee7683eb 9187 * xml.c (parse_region): Avoid creating spurious whitespace nodes.
87302331 9188
cbb59342
CY
91892011-04-08 Chong Yidong <cyd@stupidchicken.com>
9190
9191 * keyboard.c (read_char): Call Lisp function help-form-show,
9192 instead of using internal_with_output_to_temp_buffer.
9193 (Qhelp_form_show): New var.
e0d38eeb 9194 (syms_of_keyboard): Use DEFSYM macro.
cbb59342
CY
9195
9196 * print.c (internal_with_output_to_temp_buffer): Function deleted.
9197
9198 * lisp.h (internal_with_output_to_temp_buffer): Remove prototype.
9199
e67a13ab
CY
92002011-04-06 Chong Yidong <cyd@stupidchicken.com>
9201
04f2d78b
CB
9202 * process.c (Flist_processes): Remove to Lisp.
9203 (list_processes_1): Delete.
e67a13ab 9204
973f782d
EZ
92052011-04-06 Eli Zaretskii <eliz@gnu.org>
9206
7c106b1e
EZ
9207 * msdos.c (careadlinkat, careadlinkatcwd): MS-DOS replacements.
9208
973f782d
EZ
9209 * w32.c (careadlinkat, careadlinkatcwd): New always-fail stubs.
9210
41cf7d1a 92112011-04-06 Paul Eggert <eggert@cs.ucla.edu>
27ccc379 9212
ca23cc88
PE
9213 Fix more problems found by GCC 4.6.0's static checks.
9214
f390e2d5
PE
9215 * xmenu.c (Fx_popup_dialog): Don't assume string is free of formats.
9216
42eea0d0
PE
9217 * menu.c (Fx_popup_menu): Don't assume error_name lacks printf formats.
9218
b69769da 9219 * lisp.h (message, message_nolog, fatal): Mark as printf-like.
1e973bc7 9220
f9541e84
PE
9221 * xdisp.c (vmessage): Mark as a printf-like function.
9222
13841b55
PE
9223 * term.c (vfatal, maybe_fatal): Mark as printf-like functions.
9224
c136c10f
PE
9225 * sound.c (sound_warning): Don't crash if arg contains a printf format.
9226
5e2d4a30
PE
9227 * image.c (tiff_error_handler, tiff_warning_handler): Mark as
9228 printf-like functions.
9229 (tiff_load): Add casts to remove these marks before passing them
9230 to system-supplied API.
9231
583f48b9
PE
9232 * eval.c (Fsignal): Remove excess argument to 'fatal'.
9233
b25d760e
PE
9234 * coding.c (EMIT_ONE_BYTE, EMIT_TWO_BYTES): Use unsigned, not int.
9235 This avoids several warnings with gcc -Wstrict-overflow.
d5efd1d1
PE
9236 (DECODE_COMPOSITION_RULE): If the rule is invalid, goto invalid_code
9237 directly, rather than having caller test rule sign. This avoids
9238 some unnecessary tests.
9239 * composite.h (COMPOSITION_ENCODE_RULE_VALID): New macro.
9240 (COMPOSITION_ENCODE_RULE): Arguments now must be valid. This
9241 affects only one use, in DECODE_COMPOSITION_RULE, which is changed.
b25d760e 9242
bc7b6697 9243 * xfont.c (xfont_text_extents): Remove var that was set but not used.
625a3eb1 9244 (xfont_open): Avoid unnecessary tests.
bc7b6697 9245
27ccc379
PE
9246 * composite.c (composition_gstring_put_cache): Use unsigned integer.
9247
dcd5c89a
PE
9248 * composite.h, composite.c (composition_gstring_put_cache):
9249 Use EMACS_INT, not int, for length.
9250
b13a45c6
PE
9251 * composite.h (COMPOSITION_DECODE_REFS): New macro,
9252 breaking out part of COMPOSITION_DECODE_RULE.
9253 (COMPOSITION_DECODE_RULE): Use it.
9254 * composite.c (get_composition_id): Remove unused local vars,
9255 by using the new macro.
9256
1e792e4d
PE
9257 * textprop.c (set_text_properties_1): Change while to do-while,
9258 since the condition is always true at first.
9259
dc6c6455 9260 * intervals.c (graft_intervals_into_buffer): Mark var as used.
aa86731f
PE
9261 (interval_deletion_adjustment): Return unsigned value.
9262 All uses changed.
dc6c6455 9263
aba7731a
PE
9264 * process.c (list_processes_1, create_pty, read_process_output):
9265 (exec_sentinel): Remove vars that were set but not used.
afd4052b 9266 (create_pty): Remove unnecessary "volatile"s.
bc57d757 9267 (Fnetwork_interface_info): Avoid possibility of int overflow.
82eaa333 9268 (read_process_output): Do adaptive read buffering even if carryover.
fe07cdfa 9269 (read_process_output): Simplify nbytes computation if buffered.
aba7731a 9270
fdfc4bf3
PE
9271 * bytecode.c (exec_byte_code): Rename local to avoid shadowing.
9272
fca8fe46 9273 * syntax.c (scan_words): Remove var that was set but not used.
12cbf13f 9274 (update_syntax_table): Use unsigned instead of int.
fca8fe46 9275
06a0259a 9276 * lread.c (lisp_file_lexically_bound_p): Use ints rather than endptrs.
3c346cc3 9277 (lisp_file_lexically_bound_p, read1): Use unsigned instead of int.
e6eb4e9e 9278 (safe_to_load_p): Make the end-of-loop test the inverse of the in-loop.
06a0259a 9279
e7b9e80f
PE
9280 * print.c (print_error_message): Avoid int overflow.
9281
56201685
PE
9282 * font.c (font_list_entities): Redo for clarity,
9283 so that reader need not know FONT_DPI_INDEX + 1 == FONT_SPACING_INDEX.
9284
78834453 9285 * font.c (font_find_for_lface, Ffont_get_glyphs): Remove unused vars.
790771b1 9286 (font_score): Avoid potential overflow in diff calculation.
78834453 9287
0bc0b309 9288 * fns.c (substring_both): Remove var that is set but not used.
8cd55cb4 9289 (sxhash): Redo loop for clarity and to avoid wraparound warning.
0bc0b309 9290
e610eaca
PE
9291 * eval.c (funcall_lambda): Rename local to avoid shadowing.
9292
b895abce
PE
9293 * alloc.c (mark_object_loop_halt, mark_object): Use size_t, not int.
9294 Otherwise, GCC 4.6.0 optimizes the loop check away since the check
9295 can always succeed if overflow has undefined behavior.
9296
1f1d9321 9297 * search.c (boyer_moore, wordify): Remove vars set but not used.
6f076cc7 9298 (wordify): Omit three unnecessary tests.
1f1d9321 9299
c59478bc
PE
9300 * indent.c (MULTIBYTE_BYTES_WIDTH): Don't compute wide_column.
9301 All callers changed. This avoids the need for an unused var.
9302
79b73827
PE
9303 * casefiddle.c (casify_region): Remove var that is set but not used.
9304
a4db5dfe
PE
9305 * dired.c (file_name_completion): Remove var that is set but not used.
9306
43aae36e
PE
9307 * fileio.c (Finsert_file_contents): Make EOF condition clearer.
9308
2a47c44d 9309 * fileio.c (Finsert_file_contents): Avoid signed integer overflow.
163c5f32 9310 (Finsert_file_contents): Remove unnecessary code checking fd.
2a47c44d 9311
a37c69bf
PE
9312 * minibuf.c (read_minibuf_noninteractive): Use size_t for sizes.
9313 Check for integer overflow on size calculations.
9314
328ab8e7
PE
9315 * buffer.c (Fprevious_overlay_change): Remove var that is set
9316 but not used.
9317
e5a2a5cb
PE
9318 * keyboard.c (menu_bar_items, read_char_minibuf_menu_prompt):
9319 Remove vars that are set but not used.
8d84a6eb 9320 (timer_check_2): Don't assume timer-list and idle-timer-list are lists.
6b043475 9321 (timer_check_2): Mark vars as initialized.
e5a2a5cb 9322
a60e5f68
PE
9323 * gtkutil.c (xg_get_file_with_chooser): Mark var as initialized.
9324
f661cb61 9325 * image.c (lookup_image): Remove var that is set but not used.
35fa624f 9326 (xbm_load): Use parse_p, for gcc -Werror=unused-but-set-variable.
f661cb61 9327
f0397f5a
PE
9328 * fontset.c (Finternal_char_font, Ffontset_info): Remove vars
9329 that are set but not used.
9330
8664db06 9331 * xfns.c (make_invisible_cursor): Don't return garbage
03733ee7 9332 if XCreateBitmapFromData fails (Bug#8410).
8664db06 9333
6abdaa4a
PE
9334 * xselect.c (x_get_local_selection, x_handle_property_notify):
9335 Remove vars that are set but not used.
9336
0ce7538d 9337 * xfns.c (x_create_tip_frame): Remove var that is set but not used.
6abdaa4a 9338 (make_invisible_cursor): Initialize a possibly-uninitialized variable.
0ce7538d 9339
9ae848fc
PE
9340 * xterm.c (x_scroll_bar_to_input_event) [!USE_GTK]:
9341 Remove var that is set but not used.
0b918413
PE
9342 (scroll_bar_windows_size): Now size_t, not int.
9343 (x_send_scroll_bar_event): Use size_t, not int, for sizes.
9344 Check for overflow.
9ae848fc 9345
a5a62657
PE
9346 * xfaces.c (realize_named_face): Remove vars that are set but not used.
9347 (map_tty_color) [!defined MSDOS]: Likewise.
9348
5c5cdd39
PE
9349 * term.c (tty_write_glyphs): Use size_t; this avoids overflow warning.
9350
66ebf983
PE
9351 * coding.c: Remove vars that are set but not used.
9352 (DECODE_COMPOSITION_RULE): Remove 2nd arg, which is unused.
9353 All callers changed.
9354 (decode_coding_utf_8, decode_coding_utf_16 decode_coding_emacs_mule):
9355 (decode_coding_iso_2022, encode_coding_sjis, encode_coding_big5):
9356 (decode_coding_charset): Remove vars that are set but not used.
9357
1be4d761
PE
9358 * bytecode.c (Fbyte_code) [!defined BYTE_CODE_SAFE]: Remove var
9359 that is set but not used.
9360
47553fa8
PE
9361 * print.c (print_object): Remove var that is set but not used.
9362
1f7196bf 9363 Replace 2 copies of readlink code with 1 gnulib version (Bug#8401).
d1fdcab7
PE
9364 The gnulib version avoids calling malloc in the usual case,
9365 and on 64-bit hosts doesn't have some arbitrary 32-bit limits.
9366 * fileio.c (Ffile_symlink_p): Use emacs_readlink.
9367 * filelock.c (current_lock_owner): Likewise.
9368 * lisp.h (READLINK_BUFSIZE, emacs_readlink): New function.
9369 * sysdep.c: Include allocator.h, careadlinkat.h.
9370 (emacs_no_realloc_allocator): New static constant.
9371 (emacs_readlink): New function.
fdb61804
PE
9372 * deps.mk (sysdep.o): Depend on ../lib/allocator.h and on
9373 ../lib/careadlinkat.h.
d1fdcab7 9374
f84c17c7
SM
93752011-04-04 Stefan Monnier <monnier@iro.umontreal.ca>
9376
9377 * keyboard.c (safe_run_hook_funcall): Fix last change (don't stop at the
9378 first non-nil return value).
9379
ef3862ad
JD
93802011-04-03 Jan Djärv <jan.h.d@swipnet.se>
9381
9382 * nsterm.m (ns_update_auto_hide_menu_bar): Define MAC_OS_X_VERSION_10_6
9383 if not defined (Bug#8403).
9384
376a7006
JB
93852011-04-02 Juanma Barranquero <lekktu@gmail.com>
9386
9387 * xdisp.c (display_count_lines): Remove parameter `start',
9388 unused since 1998-01-01T02:27:27Z!rms@gnu.org. All callers changed.
9389 (get_char_face_and_encoding): Remove parameter `multibyte_p',
9390 unused since 2008-05-14T01:40:23Z!handa@m17n.org. All callers changed.
9391 (fill_stretch_glyph_string): Remove parameters `row' and `area',
9392 unused at least since Kim's GUI unification at 2003-03-16T20:45:46Z!storm@cua.dk
9393 and thereabouts. All callers changed.
9394 (get_per_char_metric): Remove parameter `f', unused since
9395 2008-05-14T01:40:23Z!handa@m17n.org. All callers changed.
9396
6ca3801d
JM
93972011-04-02 Jim Meyering <meyering@redhat.com>
9398
9399 do not dereference NULL upon failed strdup
9400 * nsfont.m (ns_descriptor_to_entity): Use xstrdup, not strdup.
9401 (ns_get_family): Likewise.
9402
d8e2b5ba
JB
94032011-04-02 Juanma Barranquero <lekktu@gmail.com>
9404
9405 * eval.c (unwind_to_catch) [DEBUG_GCPRO]: Remove redundant assignment.
9406
8c74fcbd
JD
94072011-04-02 Jan Djärv <jan.h.d@swipnet.se>
9408
9409 * nsterm.m (ns_update_auto_hide_menu_bar): Only for OSX 10.6 or
9410 later (Bug#8403).
9411
7200d79c
SM
94122011-04-01 Stefan Monnier <monnier@iro.umontreal.ca>
9413
03408648 9414 Add lexical binding.
7200d79c 9415
03408648
SM
9416 * window.c (Ftemp_output_buffer_show): New fun.
9417 (Fsave_window_excursion):
9418 * print.c (Fwith_output_to_temp_buffer): Move to subr.el.
9419
9420 * lread.c (lisp_file_lexically_bound_p): New function.
9421 (Fload): Bind Qlexical_binding.
9422 (readevalloop): Remove `evalfun' arg.
9423 Bind Qinternal_interpreter_environment.
9424 (Feval_buffer): Bind Qlexical_binding.
9425 (defvar_int, defvar_bool, defvar_lisp_nopro, defvar_kboard):
9426 Mark as dynamic.
9427 (syms_of_lread): Declare `lexical-binding'.
9428
9429 * lisp.h (struct Lisp_Symbol): New field `declared_special'.
9430
9431 * keyboard.c (eval_dyn): New fun.
9432 (menu_item_eval_property): Use it.
ca105506
SM
9433
9434 * image.c (parse_image_spec): Use Ffunctionp.
ca105506 9435
03408648
SM
9436 * fns.c (concat, mapcar1): Accept byte-code-functions.
9437
9438 * eval.c (Fsetq): Handle lexical vars.
9439 (Fdefun, Fdefmacro, Ffunction): Make closures when needed.
9440 (Fdefconst, Fdefvaralias, Fdefvar): Mark as dynamic.
9441 (FletX, Flet): Obey lexical binding.
9442 (Fcommandp): Handle closures.
9443 (Feval): New `lexical' arg.
9444 (eval_sub): New function extracted from Feval. Use it almost
9445 everywhere where Feval was used. Look up vars in lexical env.
9446 Handle closures.
9447 (Ffunctionp): Move from subr.el.
9448 (Ffuncall): Handle closures.
9449 (apply_lambda): Remove `eval_flags'.
9450 (funcall_lambda): Handle closures and new byte-code-functions.
9451 (Fspecial_variable_p): New function.
9452 (syms_of_eval): Initialize the Vinternal_interpreter_environment var,
9453 but without exporting it to Lisp.
23aba0ea 9454
23aba0ea 9455 * doc.c (Fdocumentation, store_function_docstring):
03408648 9456 * data.c (Finteractive_form): Handle closures.
23aba0ea 9457
03408648
SM
9458 * callint.c (Fcall_interactively): Preserve lexical-binding mode for
9459 interactive spec.
ba83908c 9460
04f2d78b
CB
9461 * bytecode.c (Bstack_ref, Bstack_set, Bstack_set2, BdiscardN):
9462 New byte-codes.
03408648
SM
9463 (exec_byte_code): New function extracted from Fbyte_code to handle new
9464 calling convention for byte-code-functions. Add new byte-codes.
ba83908c 9465
03408648 9466 * buffer.c (defvar_per_buffer): Set new `declared_special' field.
e2abe5a1 9467
03408648 9468 * alloc.c (Fmake_symbol): Init new `declared_special' field.
e2abe5a1 9469
e2abce01
JB
94702011-03-31 Juanma Barranquero <lekktu@gmail.com>
9471
9472 * xdisp.c (redisplay_internal): Fix prototype.
9473
63696a73 94742011-03-31 Eli Zaretskii <eliz@gnu.org>
09725d26 9475
63696a73 9476 * xdisp.c (SCROLL_LIMIT): New macro.
04f2d78b
CB
9477 (try_scrolling): Use it when setting scroll_limit.
9478 Limit scrolling to 100 screen lines.
63696a73
EZ
9479 (redisplay_window): Even when falling back on "recentering",
9480 position point in the window according to scroll-conservatively,
9481 scroll-margin, and scroll-*-aggressively variables. (Bug#6671)
9482
9483 (try_scrolling): When point is above the window, allow searching
9484 as far as scroll_max, or one screenful, to compute vertical
9485 distance from PT to the scroll margin position. This prevents
9486 try_scrolling from unnecessarily failing when
9487 scroll-conservatively is set to a value slightly larger than the
9488 window height. Clean up the case of PT below the margin at bottom
9489 of window: scroll_max can no longer be INT_MAX. When aggressive
9490 scrolling is in use, don't let point enter the opposite scroll
9491 margin as result of the scroll.
9492 (syms_of_xdisp) <scroll-conservatively>: Document the
09725d26
EZ
9493 threshold of 100 lines for never-recentering scrolling.
9494
e4cc2dfc
JB
94952011-03-31 Juanma Barranquero <lekktu@gmail.com>
9496
9497 * dispextern.h (move_it_by_lines):
9498 * xdisp.c (move_it_by_lines): Remove parameter `need_y_p', unused
9499 since 2000-12-29T14:24:09Z!gerd@gnu.org. All callers changed.
9500 (message_log_check_duplicate): Remove parameters `prev_bol' and
9501 `this_bol', unused since 1998-01-01T02:27:27Z!rms@gnu.org. All callers changed.
9502 (redisplay_internal): Remove parameter `preserve_echo_area',
9503 unused since 1999-07-21T21:43:52Z!gerd@gnu.org. All callers changed.
9504
9505 * indent.c (Fvertical_motion):
9506 * window.c (window_scroll_pixel_based, Frecenter):
9507 Don't pass `need_y_p' to `move_it_by_lines'.
9508
1c470562
SM
95092011-03-30 Stefan Monnier <monnier@iro.umontreal.ca>
9510
44f230aa
SM
9511 * eval.c (struct backtrace): Don't cheat with negative numbers, but do
9512 steal a few bits to be more compact.
9513 (interactive_p, Fbacktrace, Fbacktrace_frame, mark_backtrace):
9514 Remove unneeded casts.
9515
1c470562
SM
9516 * bytecode.c (Fbyte_code): CAR and CDR can GC.
9517
888adce9
ZK
95182011-03-30 Zachary Kanfer <zkanfer@gmail.com> (tiny change)
9519
9520 * keyboard.c (Fexecute_extended_command): Do log the "suggest key
9521 binding" message (bug#7967).
9522
f838ed7b
PE
95232011-03-30 Paul Eggert <eggert@cs.ucla.edu>
9524
77861b95
PE
9525 Fix more problems found by GCC 4.6.0's static checks.
9526
de6dbc14
PE
9527 * unexelf.c (unexec) [! (defined _SYSTYPE_SYSV || defined __sgi)]:
9528 Remove unused local var.
9529
f838ed7b
PE
9530 * editfns.c (Fmessage_box): Remove unused local var.
9531
792c7b2b
PE
9532 * xdisp.c (try_window_reusing_current_matrix, x_produce_glyphs):
9533 (note_mode_line_or_margin_highlight, note_mouse_highlight):
9534 Omit unused local vars.
c499e557 9535 * window.c (shrink_windows): Omit unused local var.
b01a1c29 9536 * menu.c (digest_single_submenu): Omit unused local var.
0bc32927
PE
9537 * dispnew.c (update_window) [PERIODIC_PREEMPTION_CHECKING]:
9538 Omit unused local var.
9539
ba0165e1
PE
9540 * keyboard.c (parse_modifiers_uncached, parse_modifiers):
9541 Don't assume string length fits in int.
32ad8845 9542 (keyremap_step, read_key_sequence): Use size_t for sizes.
48011560 9543 (read_key_sequence): Don't check last_real_key_start redundantly.
ba0165e1 9544
3c59b4c9
PE
9545 * callproc.c (Fcall_process, Fcall_process_region): Use SAFE_ALLOCA
9546 instead of alloca (Bug#8344).
9547
a3eed478 9548 * eval.c (Fbacktrace): Don't assume nargs fits in int.
5d5d959d 9549 (Fbacktrace_frame): Don't assume nframes fits in int.
a3eed478 9550
eb4d412d
PE
9551 * syntax.c (scan_sexps_forward): Avoid pointer wraparound.
9552
1658b401
PE
9553 * xterm.c (x_make_frame_visible, same_x_server): Redo to avoid overflow
9554 concerns.
9555
9556 * term.c (produce_glyphless_glyph): Remove unnecessary test.
9557
9558 * cm.c (calccost): Turn while-do into do-while, for clarity.
44f730c8 9559
9a2c6e05
PE
9560 * keyboard.c (syms_of_keyboard): Use the same style as later
9561 in this function when indexing through an array. This also
9562 works around GCC bug 48267.
9563
03d0a109
PE
9564 * image.c (tiff_load): Fix off-by-one image count (Bug#8336).
9565
44f730c8
PE
9566 * xselect.c (x_check_property_data): Return correct size (Bug#8335).
9567
fe75f926
PE
9568 * chartab.c (sub_char_table_ref_and_range): Redo for slight
9569 efficiency gain, and to bypass a gcc -Wstrict-overflow warning.
9570
ffa8c828
PE
9571 * keyboard.c, keyboard.h (num_input_events): Now size_t.
9572 This avoids undefined behavior on integer overflow, and is a bit
9573 more convenient anyway since it is compared to a size_t variable.
9574
c5101a77
PE
9575 Variadic C functions now count arguments with size_t, not int.
9576 This avoids an unnecessary limitation on 64-bit machines, which
9577 caused (substring ...) to crash on large vectors (Bug#8344).
9578 * lisp.h (struct Lisp_Subr.function.aMANY): Now takes size_t, not int.
9579 (DEFUN_ARGS_MANY, internal_condition_case_n, safe_call): Likewise.
77861b95 9580 All variadic functions and their callers changed accordingly.
c5101a77
PE
9581 (struct gcpro.nvars): Now size_t, not int. All uses changed.
9582 * data.c (arith_driver, float_arith_driver): Likewise.
9583 * editfns.c (general_insert_function): Likewise.
9584 * eval.c (struct backtrace.nargs, interactive_p)
9585 (internal_condition_case_n, run_hook_with_args, apply_lambda)
9586 (funcall_lambda, mark_backtrace): Likewise.
9587 * fns.c (concat): Likewise.
9588 * frame.c (x_set_frame_parameters): Likewise.
9589 * fns.c (get_key_arg): Now accepts and returns size_t, and returns
9590 0 if not found, not -1. All callers changed.
9591
dd3f25f7
PE
9592 * alloc.c (garbage_collect): Don't assume stack size fits in int.
9593 (stack_copy_size): Now size_t, not int.
9594 (stack_copy, stack_copy_size): Define only if MAX_SAVE_STACK > 0.
9595
461c2ab9
JB
95962011-03-28 Juanma Barranquero <lekktu@gmail.com>
9597
9598 * coding.c (encode_designation_at_bol): Remove parameter `charbuf_end',
9599 unused since 2002-03-01T01:17:24Z!handa@m17n.org and 2008-02-01T16:01:31Z!miles@gnu.org.
9600 All callers changed.
9601
9602 * lisp.h (multibyte_char_to_unibyte):
9603 * character.c (multibyte_char_to_unibyte): Remove parameter `rev_tbl',
9604 unused since 2002-03-01T01:16:34Z!handa@m17n.org and 2008-02-01T16:01:31Z!miles@gnu.org.
9605 * character.h (CHAR_TO_BYTE8):
9606 * cmds.c (internal_self_insert):
9607 * editfns.c (general_insert_function):
9608 * keymap.c (push_key_description):
9609 * search.c (Freplace_match):
9610 * xdisp.c (message_dolog, set_message_1): All callers changed.
9611
f6d62986
SM
96122011-03-28 Stefan Monnier <monnier@iro.umontreal.ca>
9613
9614 * keyboard.c (safe_run_hook_funcall): New function.
9615 (safe_run_hooks_1, safe_run_hooks_error, safe_run_hooks): On error,
9616 don't set the hook to nil, but remove the offending function instead.
9617 (Qcommand_hook_internal): Remove, unused.
9618 (syms_of_keyboard): Don't initialize Qcommand_hook_internal nor define
9619 Vcommand_hook_internal.
9620
9621 * eval.c (enum run_hooks_condition): Remove.
9622 (funcall_nil, funcall_not): New functions.
9623 (run_hook_with_args): Call each function through a `funcall' argument.
9624 Remove `cond' argument, now redundant.
9625 (Frun_hooks, Frun_hook_with_args, Frun_hook_with_args_until_success)
9626 (Frun_hook_with_args_until_failure): Adjust accordingly.
9627 (run_hook_wrapped_funcall, Frun_hook_wrapped): New functions.
9628
1db5b1ad
JB
96292011-03-28 Juanma Barranquero <lekktu@gmail.com>
9630
9631 * dispextern.h (string_buffer_position): Remove declaration.
9632
9633 * print.c (strout): Remove parameter `multibyte', unused since
9634 1999-08-21T19:30:21Z!gerd@gnu.org. All callers changed.
9635
9636 * search.c (boyer_moore): Remove parameters `len', `pos' and `lim',
9637 never used since function introduction in 1998-02-08T21:33:56Z!rms@gnu.org.
9638 All callers changed.
9639
9640 * w32.c (_wsa_errlist): Use braces for struct initializers.
9641
9642 * xdisp.c (string_buffer_position_lim): Remove parameter `w',
9643 never used since function introduction in 2001-03-09T18:41:50Z!gerd@gnu.org.
9644 All callers changed.
9645 (string_buffer_position): Likewise. Also, make static (it's never
9646 used outside xdisp.c).
9647 (cursor_row_p): Remove parameter `w', unused since
9648 2000-10-17T16:08:57Z!gerd@gnu.org. All callers changed.
9649 (decode_mode_spec): Remove parameter `precision', introduced during
9650 Gerd Moellmann's rewrite at 1999-07-21T21:43:52Z!gerd@gnu.org, but never used.
9651 All callers changed.
9652
5ffb62aa
JD
96532011-03-27 Jan Djärv <jan.h.d@swipnet.se>
9654
9655 * nsterm.m (syms_of_nsterm): Use doc: for ns-auto-hide-menu-bar.
9656
461c2ab9 96572011-03-27 Anders Lindgren <andlind@gmail.com>
f0a1382a
JD
9658
9659 * nsterm.m (ns_menu_bar_is_hidden): New variable.
9660 (ns_constrain_all_frames, ns_menu_bar_should_be_hidden)
9661 (ns_update_auto_hide_menu_bar): New functions.
9662 (ns_update_begin): Call ns_update_auto_hide_menu_bar.
9663 (applicationDidBecomeActive): Call ns_update_auto_hide_menu_bar and
9664 ns_constrain_all_frames.
9665 (constrainFrameRect): Return at once if ns_menu_bar_should_be_hidden.
9666 (syms_of_nsterm): DEFVAR ns-auto-hide-menu-bar, init to Qnil.
9667
5c380ffb
JD
96682011-03-27 Jan Djärv <jan.h.d@swipnet.se>
9669
9670 * nsmenu.m (runDialogAt): Remove argument to timer_check.
9671
9af30bdf
GM
96722011-03-27 Glenn Morris <rgm@gnu.org>
9673
9674 * syssignal.h: Replace RETSIGTYPE with void.
9675 * atimer.c, data.c, dispnew.c, emacs.c, floatfns.c, keyboard.c:
9676 * keyboard.h, lisp.h, process.c, sysdep.c, xterm.c:
9677 Replace SIGTYPE with void everywhere.
9678 * s/usg5-4-common.h (SIGTYPE): Remove definition.
9679 * s/template.h (SIGTYPE): Remove commented out definition.
9680
e2abce01
JB
96812011-03-26 Eli Zaretskii <eliz@gnu.org>
9682
9683 * xdisp.c (redisplay_window): Don't check buffer's clip_changed
9684 flag as a prerequisite for invoking try_scrolling. (Bug#6671)
9685
f868cd8a
JB
96862011-03-26 Juanma Barranquero <lekktu@gmail.com>
9687
59eb0929
JB
9688 * w32.c (read_unc_volume): Use parameter `henum', instead of
9689 global variable `wget_enum_handle'.
9690
9691 * keymap.c (describe_vector): Remove parameters `indices' and
9692 `char_table_depth', unused since 2002-03-01T01:43:26Z!handa@m17n.org.
9693 (describe_map, Fdescribe_vector): Adjust calls to `describe_vector'.
9694
f868cd8a
JB
9695 * keyboard.h (timer_check, show_help_echo): Remove unused parameters.
9696
9697 * keyboard.c (timer_check): Remove parameter `do_it_now',
9698 unused since 1996-04-12T06:01:29Z!rms@gnu.org.
9699 (show_help_echo): Remove parameter `ok_to_overwrite_keystroke_echo',
9700 unused since 2008-04-19T19:30:53Z!monnier@iro.umontreal.ca.
9701
9702 * keyboard.c (read_char):
9703 * w32menu.c (w32_menu_display_help):
9704 * xmenu.c (show_help_event, menu_help_callback):
9705 Adjust calls to `show_help_echo'.
9706
9707 * gtkutil.c (xg_maybe_add_timer):
9708 * keyboard.c (readable_events):
9709 * process.c (wait_reading_process_output):
9710 * xmenu.c (x_menu_wait_for_event): Adjust calls to `timer_check'.
9711
9712 * insdel.c (adjust_markers_gap_motion):
9713 Remove; no-op since 1998-01-02T21:29:48Z!rms@gnu.org.
9714 (gap_left, gap_right): Don't call it.
9715
2ecf6fdb
CY
97162011-03-25 Chong Yidong <cyd@stupidchicken.com>
9717
9718 * xdisp.c (handle_fontified_prop): Discard changes to clip_changed
9719 incurred during fontification.
9720
6b1f9ba4
JB
97212011-03-25 Juanma Barranquero <lekktu@gmail.com>
9722
9723 * buffer.c (defvar_per_buffer): Remove unused parameter `doc'.
9724 (DEFVAR_PER_BUFFER): Don't pass it.
9725
9726 * dispnew.c (row_equal_p, add_row_entry): Remove unused parameter `w'.
9727 (scrolling_window): Don't pass it.
9728
0f4a96b5
JB
97292011-03-25 Juanma Barranquero <lekktu@gmail.com>
9730
9731 * dispextern.h (glyph_matric): Use #if GLYPH_DEBUG, not #ifdef.
9732
9733 * fileio.c (check_executable) [DOS_NT]: Remove unused variables `len'
9734 and `suffix'.
9735 (Fset_file_selinux_context) [HAVE_LIBSELINUX]: Move here declaration
9736 of variables specific to SELinux and computation of `encoded_absname'.
9737
9738 * image.c (XPutPixel): Remove unused variable `height'.
9739
9740 * keyboard.c (make_lispy_event): Remove unused variable `hpos'.
9741
9742 * unexw32.c (get_section_info): Remove unused variable `section'.
9743
9744 * w32.c (stat): Remove unused variables `drive_root' and `devtype'.
9745 (system_process_attributes): Remove unused variable `sess'.
9746 (sys_read): Remove unused variable `err'.
9747
9748 * w32fns.c (top): Wrap variables with #if GLYPH_DEBUG, not #ifdef.
9749 (w32_wnd_proc): Remove unused variable `isdead'.
9750 (unwind_create_frame): Use #if GLYPH_DEBUG, not #ifdef.
9751 (Fx_server_max_request_size): Remove unused variable `dpyinfo'.
9752 (x_create_tip_frame): Remove unused variable `tem'.
9753
9754 * w32inevt.c (w32_console_read_socket):
9755 Remove unused variable `no_events'.
9756
9757 * w32term.c (x_draw_composite_glyph_string_foreground):
9758 Remove unused variable `width'.
9759
1149507c
JB
97602011-03-24 Juanma Barranquero <lekktu@gmail.com>
9761
9762 * w32term.c (x_set_glyph_string_clipping):
9763 Don't pass uninitialized region to CombineRgn.
9764
9c88f339
JB
97652011-03-23 Juanma Barranquero <lekktu@gmail.com>
9766
9767 * w32fns.c (x_set_menu_bar_lines): Remove unused variable `olines'.
9768 (w32_wnd_proc): Pass NULL to Windows API, not uninitialized buffer.
9769 (Fx_close_connection): Remove unused variable `i'.
9770
9771 * w32font.c (w32font_draw): Return number of glyphs.
9772 (w32font_open_internal): Remove unused variable `i'.
9773 (w32font_driver): Add missing initializer.
9774
9775 * w32menu.c (utf8to16): Remove unused variable `utf16'.
9776 (fill_in_menu): Remove unused variable `items_added'.
9777
9778 * w32term.c (last_mouse_press_frame): Remove static global variable.
9779 (w32_clip_to_row): Remove unused variable `f'.
9780 (x_delete_terminal): Remove unused variable `i'.
9781
9782 * w32uniscribe.c (uniscribe_shape): Remove unused variable `nclusters'.
9783 (NOTHING): Remove unused static global variable.
9784 (uniscribe_check_otf): Remove unused variable `table'.
9785 (uniscribe_font_driver): Add missing initializers.
9786
dee091a3
JD
97872011-03-23 Julien Danjou <julien@danjou.info>
9788
9789 * term.c (Fsuspend_tty, Fresume_tty):
9790 * minibuf.c (read_minibuf, run_exit_minibuf_hook):
9791 * window.c (temp_output_buffer_show):
9792 * insdel.c (signal_before_change):
9793 * frame.c (Fhandle_switch_frame):
9794 * fileio.c (Fdo_auto_save):
9795 * emacs.c (Fkill_emacs):
9796 * editfns.c (save_excursion_restore):
9797 * cmds.c (internal_self_insert):
9798 * callint.c (Fcall_interactively):
9799 * buffer.c (Fkill_all_local_variables):
9800 * keyboard.c (Fcommand_execute, Fsuspend_emacs, safe_run_hooks_1):
9801 Use Frun_hooks.
0f4a96b5 9802 (command_loop_1): Use Frun_hooks. Call safe_run_hooks
e9fce1ac 9803 unconditionally since it does the check itself.
dee091a3 9804
2c520ab5 98052011-03-23 Paul Eggert <eggert@cs.ucla.edu>
f0641eff 9806
c9c49752
PE
9807 Fix more problems found by GCC 4.5.2's static checks.
9808
8abc3f12
PE
9809 * coding.c (encode_coding_raw_text): Avoid unnecessary test
9810 the first time through the loop, since we know p0 < p1 then.
9811 This also avoids a gcc -Wstrict-overflow warning.
9812
a2d26660
PE
9813 * lisp.h (SAFE_ALLOCA, SAFE_ALLOCA_LISP): Avoid 'int' overflow
9814 leading to a memory leak, possible in functions like
9815 load_charset_map_from_file that can allocate an unbounded number
b12ef411 9816 of objects (Bug#8318).
a2d26660 9817
916c72e9
PE
9818 * xmenu.c (set_frame_menubar): Use EMACS_UINT, not int, for indexes
9819 that could (at least in theory) be that large.
9820
19ab8a18
PE
9821 * xdisp.c (message_log_check_duplicate): Return unsigned long, not int.
9822 This is less likely to overflow, and avoids undefined behavior if
9823 overflow does occur. All callers changed. Use strtoul to scan
9824 for the unsigned long integer.
b7cbbd6f
PE
9825 (pint2hrstr): Simplify and tune code slightly.
9826 This also avoids a (bogus) GCC warning with gcc -Wstrict-overflow.
19ab8a18 9827
f0641eff
PE
9828 * scroll.c (do_scrolling): Work around GCC bug 48228.
9829 See <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48228>.
9830
7f650bb9
PE
9831 * frame.c (Fmodify_frame_parameters): Simplify loop counter.
9832 This also avoids a warning with gcc -Wstrict-overflow.
39f5e519
PE
9833 (validate_x_resource_name): Simplify count usage.
9834 This also avoids a warning with gcc -Wstrict-overflow.
7f650bb9 9835
37dd57d1
PE
9836 * fileio.c (Fcopy_file): Report error if fchown or fchmod
9837 fail (Bug#8306).
81e56e61 9838
699979fc 9839 * emacs.c (Fdaemon_initialized): Do not ignore I/O errors (Bug#8303).
dc1ca6a8 9840
401bf9b4
PE
9841 * process.c (Fmake_network_process): Use socklen_t, not int,
9842 where POSIX says socklen_t is required in portable programs.
9843 This fixes a porting bug on hosts like 64-bit HP-UX, where
591b2973 9844 socklen_t is wider than int (Bug#8277).
401bf9b4
PE
9845 (Fmake_network_process, server_accept_connection):
9846 (wait_reading_process_output, read_process_output):
9847 Likewise.
9848
b93aacde
PE
9849 * process.c: Rename or move locals to avoid shadowing.
9850 (list_processes_1, Fmake_network_process):
9851 (read_process_output_error_handler, exec_sentinel_error_handler):
9852 Rename or move locals.
4dc343ee 9853 (Fmake_network_process): Define label "retry_connect" only if needed.
0da49335 9854 (Fnetwork_interface_info): Fix pointer signedness.
f990b4e5 9855 (process_send_signal): Add cast to avoid pointer signedness problem.
7b808126 9856 (FIRST_PROC_DESC, IF_NON_BLOCKING_CONNECT): Remove unused macros.
c939f91b 9857 (create_process): Use 'volatile' to avoid vfork clobbering (Bug#8298).
b93aacde 9858
af8a867c 9859 Make tparam.h and terminfo.c consistent.
44f230aa
SM
9860 * cm.c (tputs, tgoto, BC, UP): Remove extern decls.
9861 Include tparam.h instead, since it declares them.
af8a867c
PE
9862 * cm.h (PC): Remove extern decl; tparam.h now does this.
9863 * deps.mk (cm.o, terminfo.o): Depend on tparam.h.
9864 * terminfo.c: Include tparam.h, to check interfaces.
9865 (tparm): Make 1st arg a const pointer in decl. Put it at top level.
9866 (tparam): Adjust signature to match interface in tparam.h;
9867 this removes some undefined behavior. Check that outstring and len
9868 are zero, which they always are with Emacs.
9869 * tparam.h (PC, BC, UP): New extern decls.
9870
0248044d 9871 * xftfont.c (xftfont_shape): Now static, and defined only if needed.
001a7ab4 9872 (xftfont_open): Rename locals to avoid shadowing.
0248044d 9873
8ff096c1 9874 * ftfont.c (ftfont_resolve_generic_family): Fix pointer signedness.
a00924bb
PE
9875 (ftfont_otf_capability, ftfont_shape): Omit decls if not needed.
9876 (OTF_TAG_SYM): Omit macro if not needed.
e932860f 9877 (ftfont_list): Remove unused local.
49eaafba
PE
9878 (get_adstyle_property, ftfont_pattern_entity):
9879 (ftfont_lookup_cache, ftfont_open, ftfont_anchor_point):
9880 Rename locals to avoid shadowing.
8ff096c1 9881
e2be39f6
PE
9882 * xfont.c (xfont_list_family): Mark var as initialized.
9883
c9735e30
PE
9884 * xml.c (make_dom): Now static.
9885
8f5201ae
PE
9886 * composite.c (composition_compute_stop_pos): Rename local to
9887 avoid shadowing.
b246f932
PE
9888 (composition_reseat_it): Remove unused locals.
9889 (find_automatic_composition, composition_adjust_point): Likewise.
80e079b2 9890 (composition_update_it): Mark var as initialized.
11b61122
PE
9891 (find_automatic_composition): Mark vars as initialized,
9892 with a FIXME (Bug#8290).
8f5201ae 9893
760fbc2c
PE
9894 character.h: Rename locals to avoid shadowing.
9895 * character.h (PREV_CHAR_BOUNDARY, FETCH_STRING_CHAR_ADVANCE):
9896 (FETCH_STRING_CHAR_AS_MULTIBYTE_ADVANCE, FETCH_CHAR_ADVANCE):
9897 (FETCH_CHAR_ADVANCE_NO_CHECK, INC_POS, DEC_POS, BUF_INC_POS):
9898 (BUF_DEC_POS): Be more systematic about renaming local temporaries
9899 to avoid shadowing.
9900
ff08eb85
PE
9901 * textprop.c (property_change_between_p): Remove; unused.
9902
fc7bf025
PE
9903 * intervals.c (interval_start_pos): Now static.
9904
235d7abc
PE
9905 * intervals.h (CHECK_TOTAL_LENGTH): Avoid empty "else".
9906
44f230aa
SM
9907 * atimer.c (start_atimer, append_atimer_lists, set_alarm):
9908 Rename locals to avoid shadowing.
3e7d6594 9909
50060332
PE
9910 * sound.c (wav_play, au_play, Fplay_sound_internal):
9911 Fix pointer signedness.
d01f234b 9912 (alsa_choose_format): Remove unused local var.
c83b8872
PE
9913 (wav_play): Initialize a variable to 0, to prevent undefined
9914 behavior (Bug#8278).
50060332 9915
c4fc4e30
PE
9916 * region-cache.c (insert_cache_boundary): Redo var to avoid shadowing.
9917
918436ed
PE
9918 * region-cache.h (pp_cache): New decl, for gcc -Wmissing-prototypes.
9919
c939f91b
PE
9920 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork
9921 clobbering (Bug#8298).
b9c7f648
PE
9922 * sysdep.c (sys_subshell): Likewise.
9923 Previously, the sys_subshell 'volatile' was incorrectly IF_LINTted out.
7e9123a2 9924
6bd8c144
PE
9925 * lisp.h (child_setup): Now NO_RETURN unless DOS_NT.
9926 This should get cleaned up, so that child_setup has the
9927 same signature on all platforms.
9928
7710357c 9929 * callproc.c (call_process_cleanup): Now static.
cb1d0ef7 9930 (relocate_fd): Rename locals to avoid shadowing.
7710357c 9931
c59da222
CY
99322011-03-22 Chong Yidong <cyd@stupidchicken.com>
9933
9934 * xterm.c (x_clear_frame): Remove XClearWindow call. This appears
9935 not to be necessary, and produces flickering.
9936
66b87493
GM
99372011-03-20 Glenn Morris <rgm@gnu.org>
9938
9939 * config.in: Remove file.
9940
45b6f6d5
JB
99412011-03-20 Juanma Barranquero <lekktu@gmail.com>
9942
9943 * minibuf.c (Vcompleting_read_function): Don't declare, global variables
9944 are now in src/globals.h.
9945 (syms_of_minibuf): Remove spurious & from previous change.
9946
cd394be1 99472011-03-20 Leo Liu <sdl.web@gmail.com>
3ec03f7e
LL
9948
9949 * minibuf.c (completing-read-function): New variable.
9950 (completing-read-default): Rename from completing-read.
9951 (completing-read): Call completing-read-function.
9952
b14e3e21
CY
99532011-03-19 Juanma Barranquero <lekktu@gmail.com>
9954
9955 * xfaces.c (Fx_load_color_file):
9956 Read color file from absolute filename (bug#8250).
9957
f2b726e6
JB
99582011-03-19 Juanma Barranquero <lekktu@gmail.com>
9959
9960 * makefile.w32-in: Update dependencies.
9961
09f6ff02
EZ
99622011-03-17 Eli Zaretskii <eliz@gnu.org>
9963
9964 * makefile.w32-in ($(BLD)/unexw32.$(O)): Depend on $(SRC)/unexec.h.
9965
29a6015a
PE
99662011-03-17 Paul Eggert <eggert@cs.ucla.edu>
9967
a3a6c54e
PE
9968 Fix more problems found by GCC 4.5.2's static checks.
9969
b766f867
PE
9970 * process.c (make_serial_process_unwind, send_process_trap):
9971 (sigchld_handler): Now static.
9972
be02381c
PE
9973 * process.c (allocate_pty): Let PTY_ITERATION declare iteration vars.
9974 That way, the code declares only the vars that it needs.
9975 * s/aix4-2.h (PTY_ITERATION): Declare iteration vars.
9976 * s/cygwin.h (PTY_ITERATION): Likewise.
9977 * s/darwin.h (PTY_ITERATION): Likewise.
9978 * s/gnu-linux.h (PTY_ITERATION): Likewise.
9979
57048744
PE
9980 * s/irix6-5.h (PTY_OPEN): Declare stb, to loosen coupling.
9981 * process.c (allocate_pty): Don't declare stb unless it's needed.
9982
7914961c 9983 * bytecode.c (MAYBE_GC): Rewrite so as not to use empty "else".
615f2d59
PE
9984 (CONSTANTLIM): Remove; unused.
9985 (METER_CODE, Bscan_buffer, Bread_char, Bset_mark):
9986 Define only if needed.
7914961c 9987
b3967b18
PE
9988 * unexelf.c (unexec): Name an expression,
9989 to avoid gcc -Wbad-function-cast warning.
9ae71512
PE
9990 Use a different way to cause a compilation error if anyone uses
9991 n rather than nn, a way that does not involve shadowing.
73366a00 9992 (ELF_BSS_SECTION_NAME, OLD_PROGRAM_H): Remove; unused.
b3967b18 9993
29a6015a
PE
9994 * deps.mk (unexalpha.o): Remove; unused.
9995
43cfc33e 9996 New file unexec.h, the (simple) interface for unexec (Bug#8267).
7feda0d2 9997 * unexec.h: New file.
ce701a33
PE
9998 * deps.mk (emacs.o, unexaix.o, unexcw.o, unexcoff.o, unexelf.o):
9999 (unexhp9k800.o, unexmacosx.o, unexsol.o, unexw32.o):
10000 Depend on unexec.h.
10001 * emacs.c [!defined CANNOT_DUMP]: Include unexec.h.
10002 * unexaix.c, unexcoff.c, unexcw.c, unexelf.c, unexhp9k800.c:
10003 * unexmacosx.c, unexsol.c, unexw32.c: Include unexec.h.
381259ef 10004 Change as necessary to match prototype in unexec.h.
ce701a33 10005
01f44d5a
PE
10006 * syntax.c (Fforward_comment, scan_lists): Rename locals to avoid
10007 shadowing.
4f63c6bb 10008 (back_comment, skip_chars): Mark vars as initialized.
01f44d5a 10009
a6670b0b
PE
10010 * character.h (FETCH_STRING_CHAR_ADVANCE_NO_CHECK, BUF_INC_POS):
10011 Rename locals to avoid shadowing.
10012
cef2010d 10013 * lread.c (read1): Rewrite so as not to use empty "else".
0902fe45 10014 (Fload, readevalloop, read1): Rename locals to avoid shadowing.
cef2010d 10015
d4d7173a
PE
10016 * print.c (Fredirect_debugging_output): Fix pointer signedess.
10017
f08b802a
PE
10018 * lisp.h (debug_output_compilation_hack): Add decl here, to avoid
10019 warning when compiling print.c.
10020
3ddb0639
PE
10021 * font.c (font_unparse_fcname): Abort in an "impossible" situation
10022 instead of using an uninitialized var.
5ad03b97 10023 (font_sort_entities): Mark var as initialized.
3ddb0639 10024
170a2692
PE
10025 * character.h (FETCH_CHAR_ADVANCE): Rename locals to avoid shadowing.
10026
e663c700
PE
10027 * font.c (font_unparse_xlfd): Don't mix pointers to variables with
10028 pointers to constants.
89bc529a 10029 (font_parse_fcname): Remove unused vars.
7b81e2d0 10030 (font_delete_unmatched): Now static.
ea838e10 10031 (font_get_spec): Remove; unused.
13a547c6
PE
10032 (font_style_to_value, font_prop_validate_style, font_unparse_fcname):
10033 (font_update_drivers, Ffont_get_glyphs, font_add_log):
10034 Rename or move locals to avoid shadowing.
e663c700 10035
2a80c887 10036 * fns.c (require_nesting_list, require_unwind): Now static.
612f56df 10037 (Ffillarray): Rename locals to avoid shadowing.
2a80c887 10038
1384fa33 10039 * floatfns.c (domain_error2): Define only if needed.
a885e2ed 10040 (Ffrexp, Fldexp): Rename locals to avoid shadowing.
1384fa33 10041
8b2c52e9
PE
10042 * alloc.c (mark_backtrace): Move decl from here ...
10043 * lisp.h: ... to here, so that it can be checked.
10044
475545b5 10045 * eval.c (call_debugger, do_debug_on_call, grow_specpdl): Now static.
d28a2170 10046 (Fdefvar): Rewrite so as not to use empty "else".
cfcbfb1a
PE
10047 (lisp_indirect_variable): Name an expression,
10048 to avoid gcc -Wbad-function-cast warning.
1faed8ae 10049 (Fdefvar): Rename locals to avoid shadowing.
475545b5 10050
b1349114 10051 * callint.c (quotify_arg, quotify_args): Now static.
a3e8cbda 10052 (Fcall_interactively): Rename locals to avoid shadowing.
b0e80955 10053 Use const pointer when appropriate.
b1349114 10054
a2928364
PE
10055 * lisp.h (get_system_name, get_operating_system_release):
10056 Move decls here, to check interfaces.
10057 * process.c (get_operating_system_release): Move decl to lisp.h.
10058 * xrdb.c (get_system_name): Likewise.
63c5d10b
PE
10059 * editfns.c (init_editfns, Fuser_login_name, Fuser_uid):
10060 (Fuser_real_uid, Fuser_full_name): Remove unnecessary casts,
10061 some of which prompt warnings from gcc -Wbad-function-cast.
545b49b4
PE
10062 (Fformat_time_string, Fencode_time, Finsert_char):
10063 (Ftranslate_region_internal, Fformat):
10064 Rename or remove local vars to avoid shadowing.
9710023e 10065 (Ftranslate_region_internal): Mark var as initialized.
63c5d10b 10066
a415e694
PE
10067 * doc.c (Fdocumentation, Fsnarf_documentation): Move locals to
10068 avoid shadowing.
10069
8ef4622d
PE
10070 * lisp.h (eassert): Check that the argument compiles, even if
10071 ENABLE_CHECKING is not defined.
10072
946f9a5b
PE
10073 * data.c (Findirect_variable): Name an expression, to avoid
10074 gcc -Wbad-function-cast warning.
112396d6 10075 (default_value, arithcompare, arith_driver, arith_error): Now static.
b9b84fa9 10076 (store_symval_forwarding): Rename local to avoid shadowing.
44f230aa
SM
10077 (Fmake_variable_buffer_local, Fmake_local_variable):
10078 Mark variables as initialized.
52746918 10079 (do_blv_forwarding, do_symval_forwarding): Remove; unused.
946f9a5b 10080
e5aab7e7 10081 * alloc.c (check_cons_list): Do not define unless GC_CHECK_CONS_LIST.
ae35e756
PE
10082 (Fmake_vector, Fvector, Fmake_byte_code, Fgarbage_collect):
10083 Rename locals to avoid shadowing.
dff45157
PE
10084 (mark_stack): Move local variables into the #ifdef region where
10085 they're used.
7bc26fdb
PE
10086 (BLOCK_INPUT_ALLOC, UNBLOCK_INPUT_ALLOC): Define only if
10087 ! defined SYSTEM_MALLOC && ! defined SYNC_INPUT, as they are not
10088 needed otherwise.
10089 (CHECK_ALLOCATED): Define only if GC_CHECK_MARKED_OBJECTS.
10090 (GC_STRING_CHARS): Remove; not used.
d40d4be1 10091 (Fmemory_limit): Cast sbrk's returned value to char *.
ae35e756 10092
e5aab7e7
PE
10093 * lisp.h (check_cons_list): Declare if GC_CHECK_CONS_LIST; this
10094 avoids undefined behavior in theory.
10095
4da60324
PE
10096 * regex.c (IF_LINT): Add defn, for benefit of ../lib-src.
10097
88043301
PE
10098 Use functions, not macros, for up- and down-casing (Bug#8254).
10099 * buffer.h (DOWNCASE_TABLE, UPCASE_TABLE, DOWNCASE, UPPERCASEP):
10100 (NOCASEP, LOWERCASEP, UPCASE, UPCASE1): Remove. All callers changed
10101 to use the following functions instead of these macros.
10102 (downcase): Adjust to lack of DOWNCASE_TABLE. Return int, not
10103 EMACS_INT, since callers assume the returned value fits in int.
10104 (upcase1): Likewise, for UPCASE_TABLE.
10105 (uppercasep, lowercasep, upcase): New static inline functions.
0da09c43 10106 * editfns.c (Fchar_equal): Remove no-longer-needed workaround for
db69b0cd 10107 the race-condition problem in the old DOWNCASE.
88043301 10108
19ed5445
PE
10109 * regex.c (CHARSET_LOOKUP_RANGE_TABLE_RAW, POP_FAILURE_REG_OR_COUNT):
10110 Rename locals to avoid shadowing.
10111 (regex_compile, re_match_2_internal): Move locals to avoid shadowing.
abbd1bcf
PE
10112 (regex_compile, re_search_2, re_match_2_internal):
10113 Remove unused local vars.
952db0d7
PE
10114 (FREE_VAR): Rewrite so as not to use empty "else",
10115 which gcc can warn about.
da053e48 10116 (regex_compile, re_match_2_internal): Mark locals as initialized.
b313f9d8
PE
10117 (RETALLOC_IF): Define only if needed.
10118 (WORDCHAR_P): Likewise. This one is never needed, but is used
10119 only in a comment talking about a compiler bug, so put inside
10120 the #if 0 of that comment.
10121 (CHARSET_LOOKUP_BITMAP, FAIL_STACK_FULL, RESET_FAIL_STACK):
10122 (PUSH_FAILURE_ELT, BUF_PUSH_3, STOP_ADDR_VSTRING):
10123 Remove; unused.
19ed5445 10124
1f3561e4 10125 * search.c (boyer_moore): Rename locals to avoid shadowing.
76ef09b7
PE
10126 * character.h (FETCH_STRING_CHAR_AS_MULTIBYTE_ADVANCE):
10127 (PREV_CHAR_BOUNDARY): Likewise.
1f3561e4 10128
ded6f8f7
PE
10129 * search.c (simple_search): Remove unused var.
10130
dbd37a95
PE
10131 * dired.c (compile_pattern): Move decl from here ...
10132 * lisp.h: ... to here, so that it can be checked.
10133 (struct re_registers): New forward decl.
10134
7e47afad
PE
10135 * character.h (INC_POS, DEC_POS): Rename locals to avoid shadowing.
10136
85f24f61
PE
10137 * indent.c (MULTIBYTE_BYTES_WIDTH): New args bytes, width.
10138 All uses changed.
10139 (MULTIBYTE_BYTES_WIDTH, scan_for_column, compute_motion):
10140 Rename locals to avoid shadowing.
5671df8f 10141 (Fvertical_motion): Mark locals as initialized.
85f24f61 10142
181aa2be 10143 * casefiddle.c (casify_object, casify_region): Now static.
e45a141a 10144 (casify_region): Mark local as initialized.
181aa2be 10145
930d429c
PE
10146 * cmds.c (internal_self_insert): Rename local to avoid shadowing.
10147
7082eac6
PE
10148 * lisp.h (GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR, GCPRO5_VAR, GCPRO6_VAR):
10149 New macros, so that the caller can use some names other than
10150 gcpro1, gcpro2, etc.
10151 (GCPRO2, GCPRO3, GCPRO4, GCPRO5, GCPRO6): Reimplement in terms
10152 of the new macros.
10153 (GCPRO1_VAR, UNGCPRO_VAR): Change the meaning of the second
10154 argument, for consistency with GCPRO2_VAR, etc: it is now the
10155 prefix of the variable, not the variable itself. All uses
10156 changed.
38b2c076
PE
10157 * dired.c (directory_files_internal, file_name_completion):
10158 Rename locals to avoid shadowing.
10159
15206ed9
PE
10160 Fix a race condition diagnosed by gcc -Wsequence-point (Bug#8254).
10161 An expression of the form (DOWNCASE (x) == DOWNCASE (y)), found in
10162 dired.c's scmp function, had undefined behavior.
10163 * lisp.h (DOWNCASE_TABLE, UPCASE_TABLE, DOWNCASE, UPPERCASEP):
10164 (NOCASEP, LOWERCASEP, UPCASE, UPCASE1): Move from here ...
10165 * buffer.h: ... to here, because these macros use current_buffer,
10166 and the new implementation with inline functions needs to have
10167 current_buffer in scope now, rather than later when the macros
10168 are used.
10169 (downcase, upcase1): New static inline functions.
10170 (DOWNCASE, UPCASE1): Reimplement using these functions.
10171 This avoids undefined behavior in expressions like
10172 DOWNCASE (x) == DOWNCASE (y), which previously suffered
10173 from race conditions in accessing the global variables
10174 case_temp1 and case_temp2.
10175 * casetab.c (case_temp1, case_temp2): Remove; no longer needed.
10176 * lisp.h (case_temp1, case_temp2): Remove their decls.
10177 * character.h (ASCII_CHAR_P): Move from here ...
10178 * lisp.h: ... to here, so that the inline functions mentioned
10179 above can use them.
10180
4a6bea26
PE
10181 * dired.c (directory_files_internal_unwind): Now static.
10182
f14b7e14
PE
10183 * fileio.c (file_name_as_directory, directory_file_name):
10184 (barf_or_query_if_file_exists, auto_save_error, auto_save_1):
10185 Now static.
2893f146
PE
10186 (file_name_as_directory): Use const pointers when appropriate.
10187 (Fexpand_file_name): Likewise. In particular, newdir might
10188 point at constant storage, so make it a const pointer.
fd4ead52 10189 (Fmake_directory_internal, Fread_file_name): Remove unused vars.
b14aac08
PE
10190 (Ffile_selinux_context, Fset_file_selinux_context): Fix pointer
10191 signedness issues.
f839df0c
PE
10192 (Fset_file_times, Finsert_file_contents, auto_save_error):
10193 Rename locals to avoid shadowing.
f14b7e14 10194
5716756e 10195 * minibuf.c (choose_minibuf_frame_1): Now static.
62137a95
PE
10196 (Ftry_completion, Fall_completions): Rename or remove locals
10197 to avoid shadowing.
5716756e 10198
b4c3046a
PE
10199 * marker.c (bytepos_to_charpos): Remove; unused.
10200
b45db522
PE
10201 * lisp.h (verify_bytepos, count_markers): New decls,
10202 so that gcc does not warn that these functions aren't declared.
10203
85876d07
PE
10204 * insdel.c (check_markers, make_gap_larger, make_gap_smaller):
10205 (reset_var_on_error, Fcombine_after_change_execute_1): Now static.
f0cb4a60 10206 (CHECK_MARKERS): Redo to avoid gcc -Wempty-body diagnostic.
40ef059e 10207 (copy_text): Remove unused local var.
85876d07 10208
03d78a21 10209 * filelock.c (within_one_second): Now static.
b3dd38ab 10210 (lock_file_1): Rename local to avoid shadowing.
03d78a21 10211
5df8f01b
PE
10212 * buffer.c (fix_overlays_before): Mark locals as initialized.
10213 (fix_start_end_in_overlays): Likewise. This function should be
10214 simplified by using pointers-to-pointers, but that's a different
10215 matter.
b1d876f1 10216 (switch_to_buffer_1): Now static.
8f54f30a
PE
10217 (Fkill_buffer, record_buffer, Fbury_buffer, Fset_buffer_multibyte):
10218 (report_overlay_modification): Rename locals to avoid shadowing.
c3bd59b5 10219
a70072c9 10220 * sysdep.c (system_process_attributes): Rename vars to avoid shadowing.
fbd02d7b 10221 Fix pointer signedness issue.
edced198
PE
10222 (sys_subshell): Mark local as volatile if checking for lint,
10223 to suppress a gcc -Wclobbered warning that does not seem to be right.
15dfd3d9 10224 (MAXPATHLEN): Define only if needed.
a70072c9 10225
a0977c44
PE
10226 * process.c (serial_open, serial_configure): Move decls from here ...
10227 * systty.h: ... to here, so that they can be checked.
10228
a884fdcc
PE
10229 * fns.c (get_random, seed_random): Move extern decls from here ...
10230 * lisp.h: ... to here, so that they can be checked.
10231
604efe86 10232 * sysdep.c (reset_io): Now static.
b8950c94 10233 (wait_for_termination_signal): Remove; unused.
604efe86 10234
38fc62d9
PE
10235 * keymap.c (keymap_parent, keymap_memberp, map_keymap_internal):
10236 (copy_keymap_item, append_key, push_text_char_description):
10237 Now static.
1004a21a 10238 (Fwhere_is_internal): Don't test CONSP (sequences) unnecessarily.
dbbb8427 10239 (DENSE_TABLE_SIZE): Remove; unused.
c1141155
PE
10240 (get_keymap, access_keymap, Fdefine_key, Fwhere_is_internal):
10241 (describe_map_tree):
10242 Rename locals to avoid shadowing.
38fc62d9 10243
2f2650da
PE
10244 * keyboard.c: Declare functions static if they are not used elsewhere.
10245 (echo_char, echo_dash, cmd_error, top_level_2):
10246 (poll_for_input, handle_async_input): Now static.
69a058fa
PE
10247 (read_char, kbd_buffer_get_event, make_lispy_position):
10248 (make_lispy_event, make_lispy_movement, apply_modifiers):
10249 (decode_keyboard_code, tty_read_avail_input, menu_bar_items):
10250 (parse_tool_bar_item, read_key_sequence, Fread_key_sequence):
10251 (Fread_key_sequence_vector): Rename locals to avoid shadowing.
c8a06054 10252 (read_key_sequence, read_char): Mark locals as initialized.
3ac94672 10253 (Fexit_recursive_edit, Fabort_recursive_edit): Mark with NO_RETURN.
2f2650da 10254
a053e86c 10255 * keyboard.h (make_ctrl_char): New decl.
da2f2dd9
PE
10256 (mark_kboards): Move decl here ...
10257 * alloc.c (mark_kboards): ... from here.
a053e86c 10258
4752793e
PE
10259 * lisp.h (force_auto_save_soon): New decl.
10260
74f10ca7 10261 * emacs.c (init_cmdargs): Rename local to avoid shadowing.
244fc23d
PE
10262 (DEFINE_DUMMY_FUNCTION): New macro.
10263 (__do_global_ctors, __do_global_ctors_aux, __do_global_dtors, __main):
10264 Use it.
c03cd23f
PE
10265 (main): Add casts to avoid warnings
10266 if GCC considers string literals to be constants.
74f10ca7 10267
022e70d4
PE
10268 * lisp.h (fatal_error_signal): Add decl, since it's exported.
10269
59d6fe83
PE
10270 * dbusbind.c: Pointer signedness fixes.
10271 (xd_signature, xd_append_arg, xd_initialize):
10272 (Fdbus_call_method, Fdbus_call_method_asynchronously):
10273 (Fdbus_method_return_internal, Fdbus_method_error_internal):
10274 (Fdbus_send_signal, xd_read_message_1, Fdbus_register_service):
10275 (Fdbus_register_signal): Use SSDATA when the context wants char *.
10276
78320123
PE
10277 * dbusbind.c (Fdbus_init_bus): Add cast to avoid warning
10278 if GCC considers string literals to be constants.
49cebcca 10279 (Fdbus_register_service, Fdbus_register_method): Remove unused vars.
78320123 10280
35ac2a97
SM
102812011-03-16 Stefan Monnier <monnier@iro.umontreal.ca>
10282
fb103ca9
SM
10283 * print.c (PRINT_CIRCLE_CANDIDATE_P): New macro.
10284 (print_preprocess, print_object): New macro to fix last change.
10285
35ac2a97
SM
10286 * print.c (print_preprocess): Don't forget font objects.
10287
62973b41
JB
102882011-03-16 Juanma Barranquero <lekktu@gmail.com>
10289
10290 * emacs.c (USAGE3): Doc fixes.
10291
0e48bb22
AS
102922011-03-15 Andreas Schwab <schwab@linux-m68k.org>
10293
10294 * coding.c (detect_coding_iso_2022): Reorganize code to clarify
10295 structure.
10296
7684e57b
JB
102972011-03-14 Juanma Barranquero <lekktu@gmail.com>
10298
10299 * lisp.h (VWindow_system, Qfile_name_history):
10300 * keyboard.h (lispy_function_keys) [WINDOWSNT]:
10301 * w32term.h (w32_system_caret_hwnd, w32_system_caret_height)
10302 (w32_system_caret_x, w32_system_caret_y): Declare extern.
10303
10304 * w32select.c: Don't #include "keyboard.h".
c96bbc66 10305 (run_protected): Add extern declaration for waiting_for_input.
7684e57b
JB
10306
10307 * w32.c (Qlocal, noninteractive1, inhibit_window_system):
10308 * w32console.c (detect_input_pending, read_input_pending)
10309 (encode_terminal_code):
10310 * w32fns.c (quit_char, lispy_function_keys, Qtooltip)
10311 (w32_system_caret_hwnd, w32_system_caret_height, w32_system_caret_x)
10312 (w32_system_caret_y, Qfile_name_history):
10313 * w32font.c (w32font_driver, QCantialias, QCotf, QClang):
10314 * w32inevt.c (reinvoke_input_signal, lispy_function_keys):
10315 * w32menu.c (Qmenu_bar, QCtoggle, QCradio, Qoverriding_local_map)
10316 (Qoverriding_terminal_local_map, Qmenu_bar_update_hook):
10317 * w32proc.c (Qlocal, report_file_error):
10318 * w32term.c (Vwindow_system, updating_frame):
10319 * w32uniscribe.c (initialized, uniscribe_font_driver):
10320 Remove unneeded extern declarations.
10321
2aa46d6c
CY
103222011-03-14 Chong Yidong <cyd@stupidchicken.com>
10323
c96bbc66 10324 * buffer.c (Fmake_indirect_buffer): Fix incorrect assertions.
2aa46d6c 10325
cffc6f3b
CY
103262011-03-13 Chong Yidong <cyd@stupidchicken.com>
10327
10328 * buffer.h (BUF_BEGV, BUF_BEGV_BYTE, BUF_ZV, BUF_ZV_BYTE, BUF_PT)
10329 (BUF_PT_BYTE): Rewrite to handle indirect buffers (Bug#8219).
10330 These macros can no longer be used for assignment.
10331
44f230aa
SM
10332 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer):
10333 Assign struct members directly, instead of using BUF_BEGV etc.
cffc6f3b
CY
10334 (record_buffer_markers, fetch_buffer_markers): New functions for
10335 recording and fetching special buffer markers.
10336 (set_buffer_internal_1, set_buffer_temp): Use them.
10337
10338 * lread.c (unreadchar): Use SET_BUF_PT_BOTH.
10339
10340 * insdel.c (adjust_point): Use SET_BUF_PT_BOTH.
10341
10342 * intervals.c (temp_set_point_both): Use SET_BUF_PT_BOTH.
10343 (get_local_map): Use SET_BUF_BEGV_BOTH and SET_BUF_ZV_BOTH.
10344
10345 * xdisp.c (hscroll_window_tree):
10346 (reconsider_clip_changes): Use PT instead of BUF_PT.
10347
d251f04b
EZ
103482011-03-13 Eli Zaretskii <eliz@gnu.org>
10349
10350 * makefile.w32-in ($(BLD)/editfns.$(O)): Depend on
10351 $(EMACS_ROOT)/lib/intprops.h.
10352
f0c77cd1
PE
103532011-03-13 Paul Eggert <eggert@cs.ucla.edu>
10354
3eca4629
PE
10355 Fix more problems found by GCC 4.5.2's static checks.
10356
7c86ee98
PE
10357 * gtkutil.c (xg_get_pixbuf_from_pixmap): Add cast from char *
10358 to unsigned char * to avoid compiler diagnostic.
b0afc268
PE
10359 (xg_free_frame_widgets): Make it clear that a local variable is
10360 needed only if USE_GTK_TOOLTIP.
01e0b5ad
PE
10361 (gdk_window_get_screen): Make it clear that this macro is needed
10362 only if USE_GTK_TOOLTIP.
1e5524e7
PE
10363 (int_gtk_range_get_value): New function, which avoids a diagnostic
10364 from gcc -Wbad-function-cast.
10365 (xg_set_toolkit_scroll_bar_thumb): Use it.
10366 (xg_tool_bar_callback, xg_tool_item_stale_p): Rewrite to avoid
10367 diagnostic from gcc -Wbad-function-cast.
65dc836c
PE
10368 (get_utf8_string, xg_get_file_with_chooser):
10369 Rename locals to avoid shadowing.
10370 (create_dialog): Move locals to avoid shadowing.
7c86ee98 10371
41729b81
PE
10372 * xgselect.c (xg_select): Remove unused var.
10373
f0c77cd1
PE
10374 * image.c (four_corners_best): Mark locals as initialized.
10375 (gif_load): Initialize transparent_p to zero (Bug#8238).
10376 Mark another local as initialized.
ec6cf4c6 10377 (my_png_error, my_error_exit): Mark with NO_RETURN.
f0c77cd1 10378
ce0ad53d 10379 * image.c (clear_image_cache): Now static.
d5d5a617 10380 (DIM, HAVE_STDLIB_H_1): Remove unused macros.
e22cffbc 10381 (xpm_load): Redo to avoid "discards qualifiers" gcc warning.
77a765fd
PE
10382 (x_edge_detection): Remove unnecessary cast that
10383 gcc -Wbad-function-cast diagnoses.
2037898d 10384 (gif_load): Fix pointer signedness.
6ae141d6
PE
10385 (clear_image_cache, xbm_read_bitmap_data, x_detect_edges):
10386 (jpeg_load, gif_load): Rename locals to avoid shadowing.
ce0ad53d 10387
33383987 103882011-03-12 Paul Eggert <eggert@cs.ucla.edu>
3eca4629 10389
d32df629
PE
10390 Improve quality of tests for time stamp overflow.
10391 For example, without this patch (encode-time 0 0 0 1 1
10392 1152921504606846976) returns the obviously-bogus value (-948597
10393 62170) on my RHEL 5.5 x86-64 host. With the patch, it correctly
10394 reports time overflow. See
10395 <http://lists.gnu.org/archive/html/emacs-devel/2011-03/msg00470.html>.
b8d9bd41
PE
10396 * deps.mk (editfns.o): Depend on ../lib/intprops.h.
10397 * editfns.c: Include limits.h and intprops.h.
10398 (TIME_T_MIN, TIME_T_MAX): New macros.
10399 (time_overflow): Move earlier, to before first use.
10400 (hi_time, lo_time): New functions, for an accurate test for
10401 out-of-range times.
10402 (Fcurrent_time, Fget_internal_run_time, make_time): Use them.
10403 (Fget_internal_run_time): Don't assume time_t fits in int.
10404 (make_time): Use list2 instead of Fcons twice.
10405 (Fdecode_time): More accurate test for out-of-range times.
10406 (check_tm_member): New function.
10407 (Fencode_time): Use it, to test for out-of-range times.
d32df629
PE
10408 (lisp_time_argument): Don't rely on undefined left-shift and
10409 right-shift behavior when checking for time stamp overflow.
8be6f318 10410
fe31d94c
PE
10411 * editfns.c (time_overflow): New function, refactoring common code.
10412 (Fformat_time_string, Fdecode_time, Fencode_time):
10413 (Fcurrent_time_string): Use it.
10414
8be6f318
PE
10415 Move 'make_time' to be next to its inverse 'lisp_time_argument'.
10416 * dired.c (make_time): Move to ...
10417 * editfns.c (make_time): ... here.
10418 * systime.h: Note the move.
10419
09d9db2c 104202011-03-12 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
c47cbdfd 10421
126bc0dc
YM
10422 * fringe.c (update_window_fringes): Remove unused variables.
10423
c47cbdfd
YM
10424 * unexmacosx.c (copy_data_segment): Also copy __got section.
10425 (Bug#8223)
10426
7ac80be9
EZ
104272011-03-12 Eli Zaretskii <eliz@gnu.org>
10428
c96bbc66 10429 * termcap.c [MSDOS]: Include "msdos.h".
058e5dad
EZ
10430 (find_capability, tgetnum, tgetflag, tgetstr, tputs, tgetent):
10431 Constify `char *' arguments and their references according to
10432 prototypes in tparam.h.
10433
ecb0f94d 10434 * deps.mk (termcap.o): Depend on tparam.h and msdos.h.
058e5dad 10435
7ac80be9
EZ
10436 * msdos.c (XMenuAddPane): 3rd argument is `const char *' now.
10437 Adapt all references accordingly.
10438
10439 * msdos.h (XMenuAddPane): 3rd argument is `const char *' now.
10440
ef1fd07e
TT
104412011-03-11 Tom Tromey <tromey@redhat.com>
10442
10443 * buffer.c (syms_of_buffer): Remove obsolete comment.
10444
7ef4b50c
EZ
104452011-03-11 Eli Zaretskii <eliz@gnu.org>
10446
10447 * termhooks.h (encode_terminal_code): Declare prototype.
10448
10449 * msdos.c (encode_terminal_code): Don't declare prototype.
10450
10451 * term.c (encode_terminal_code): Now external again, used by
10452 w32console.c and msdos.c.
10453
44f230aa
SM
10454 * makefile.w32-in ($(BLD)/term.$(O), ($(BLD)/tparam.$(O)):
10455 Depend on $(SRC)/tparam.h, see 2011-03-11T07:24:21Z!eggert@cs.ucla.edu.
7ef4b50c 10456
4b1ec863 104572011-03-11 Paul Eggert <eggert@cs.ucla.edu>
f78faa98 10458
1714f52b 10459 Fix some minor problems found by GCC 4.5.2's static checks.
83316bf4 10460
4b1ec863
PE
10461 * fringe.c (update_window_fringes): Mark locals as initialized
10462 (Bug#8227).
10463 (destroy_fringe_bitmap, init_fringe_bitmap): Now static.
bf60f616 10464
524c7aa6
PE
10465 * alloc.c (mark_fringe_data): Move decl from here ...
10466 * lisp.h (mark_fringe_data) [HAVE_WINDOW_SYSTEM]: ... to here,
10467 to check its interface.
10468 (init_fringe_once): Do not declare unless HAVE_WINDOW_SYSTEM.
10469
a5c0af81 10470 * fontset.c (free_realized_fontset): Now static.
7519b8cd 10471 (Fset_fontset_font): Rename local to avoid shadowing.
cc6e5db1 10472 (fontset_font): Mark local as initialized.
a9a06e0b 10473 (FONTSET_SPEC, FONTSET_REPERTORY, RFONT_DEF_REPERTORY): Remove; unused.
a5c0af81 10474
b4716021
PE
10475 * xrdb.c: Include "xterm.h", to check x_load_resources's interface.
10476
811e9bac 10477 * xselect.c (x_disown_buffer_selections): Remove; not used.
7b83e2f1 10478 (TRACE3) [!defined TRACE_SELECTION]: Remove; not used.
aa0daa9f
PE
10479 (x_own_selection, Fx_disown_selection_internal): Rename locals
10480 to avoid shadowing.
10481 (x_handle_dnd_message): Remove local to avoid shadowing.
811e9bac 10482
7e3ab302
PE
10483 * lisp.h (GCPRO1_VAR, UNGCPRO_VAR): New macros,
10484 so that the caller can use some name other than gcpro1.
10485 (GCPRO1, UNGCPRO): Reimplement in terms of the new macros.
58d2d479
PE
10486 * xfns.c (Fx_create_frame, x_create_tip_frame, Fx_show_tip):
10487 (Fx_backspace_delete_keys_p):
10488 Use them to avoid shadowing, and rename vars to avoid shadowing.
10489 (x_decode_color, x_set_name, x_window): Now static.
6b437900 10490 (Fx_create_frame): Add braces to silence GCC warning.
c0951e53 10491 (Fx_file_dialog, Fx_select_font): Fix pointer signedness.
06b0c8a0
PE
10492 (x_real_positions, xg_set_icon_from_xpm_data, x_create_tip_frame):
10493 Remove unused locals.
7e3ab302
PE
10494 (Fx_create_frame, x_create_tip_frame, Fx_show_tip):
10495 (Fx_backspace_delete_keys_p): Rename locals to avoid shadowing.
10496 Some of these renamings use the new GCPRO1_VAR and UNGCPRO_VAR
10497 macros.
f78faa98 10498
e2b13473
PE
10499 * xterm.h (x_mouse_leave): New decl.
10500
77f23912
PE
10501 * xterm.c (x_copy_dpy_color, x_focus_on_frame, x_unfocus_frame):
10502 Remove unused functions.
cdf4ba58
PE
10503 (x_shift_glyphs_for_insert, XTflash, XTring_bell):
10504 (x_calc_absolute_position): Now static.
7411c686 10505 (XTread_socket): Don't define label "out" unless it's used.
2b07bcff 10506 Don't declare local "event" unless it's used.
ed7bf3a5
PE
10507 (x_iconify_frame, x_free_frame_resources): Don't declare locals
10508 unless they are used.
38d0b34a
PE
10509 (XEMBED_VERSION, xembed_set_info): Don't define unless needed.
10510 (x_fatal_error_signal): Remove; not used.
a6067996
PE
10511 (x_draw_image_foreground, redo_mouse_highlight, XTmouse_position):
10512 (x_scroll_bar_report_motion, handle_one_xevent, x_draw_bar_cursor):
10513 (x_error_catcher, x_connection_closed, x_error_handler):
10514 (x_error_quitter, xembed_send_message, x_iconify_frame):
10515 (my_log_handler): Rename locals to avoid shadowing.
28f1c698 10516 (x_delete_glyphs, x_ins_del_lines): Mark with NO_RETURN.
2a8fade0 10517 (x_connection_closed): Tell GCC not to suggest NO_RETURN.
77f23912 10518
44f230aa
SM
10519 * xfaces.c (clear_face_cache, Fx_list_fonts, Fface_font):
10520 Rename or move locals to avoid shadowing.
6b463e58 10521 (tty_defined_color, merge_face_heights): Now static.
5967d051 10522 (free_realized_faces_for_fontset): Remove; not used.
1e9966ea
PE
10523 (Fx_list_fonts): Mark variable that gcc -Wuninitialized
10524 does not deduce is never used uninitialized.
73719eba
PE
10525 (STRDUPA, LSTRDUPA, FONT_POINT_SIZE_QUANTUM): Remove; not used.
10526 (LFACEP): Define only if XASSERTS, as it's not needed otherwise.
071048a3 10527
426994c3 10528 * terminal.c (store_terminal_param): Now static.
5489860b 10529
032f1620 10530 * xmenu.c (menu_highlight_callback): Now static.
9d66f88e 10531 (set_frame_menubar): Remove unused local.
d4323972 10532 (xmenu_show): Rename parameter to avoid shadowing.
6d1f7fee
PE
10533 (xmenu_show, xdialog_show, xmenu_show): Make local pointers "const"
10534 since they might point to immutable storage.
281585b0
PE
10535 (next_menubar_widget_id): Declare only if USE_X_TOOLKIT,
10536 since it's unused otherwise.
032f1620 10537
367c19e5 10538 * xdisp.c (produce_glyphless_glyph): Initialize lower_xoff.
53df7c11 10539 Add a FIXME, since the code still doesn't look right. (Bug#8215)
9f36b9fd
PE
10540 (Fcurrent_bidi_paragraph_direction): Simplify slightly; this
10541 avoids a gcc -Wuninitialized diagnostic.
0e086e8f 10542 (display_line, BUILD_COMPOSITE_GLYPH_STRING, draw_glyphs):
44a3a108
PE
10543 (note_mouse_highlight): Mark variables that gcc -Wuninitialized
10544 does not deduce are never used uninitialized.
70739cbe 10545
07b48fa9
PE
10546 * lisp.h (IF_LINT): New macro, copied from ../lib-src/emacsclient.c.
10547
8868a238 10548 * xdisp.c (redisplay_window): Rename local to avoid shadowing.
4554d213
PE
10549 * window.c (window_loop, size_window):
10550 (run_window_configuration_change_hook, enlarge_window): Likewise.
8868a238 10551
7e5cf297 10552 * window.c (display_buffer): Now static.
d6550a9f
PE
10553 (size_window): Mark variables that gcc -Wuninitialized
10554 does not deduce are never used uninitialized.
a586633d
PE
10555 * window.h (check_all_windows): New decl, to forestall
10556 gcc -Wmissing-prototypes diagnostic.
5b555da1 10557 * dispextern.h (bidi_dump_cached_states): Likewise.
7e5cf297 10558
f6095868
PE
10559 * charset.h (CHECK_CHARSET_GET_CHARSET): Rename locals to avoid
10560 shadowing.
10561 * charset.c (map_charset_for_dump, Fchar_charset): Likewise.
726929c4
PE
10562 Include <limits.h>.
10563 (Fsort_charsets): Redo min/max calculation to shorten the code a bit
10564 and to avoid gcc -Wuninitialized warning.
89ef49df
PE
10565 (load_charset_map): Mark variables that gcc -Wuninitialized
10566 does not deduce are never used uninitialized.
53df7c11 10567 (load_charset): Abort instead of using uninitialized var (Bug#8229).
f6095868 10568
f38b440c
PE
10569 * coding.c (coding_set_source, coding_set_destination):
10570 Use "else { /* comment */ }" rather than "else /* comment */;"
10571 for clarity, and to avoid gcc -Wempty-body warning.
2735d060
PE
10572 (Fdefine_coding_system_internal): Don't redeclare 'i' inside
10573 a block, when the outer 'i' will do.
10574 (decode_coding_utf_8, decode_coding_utf_16, detect_coding_emacs_mule):
10575 (emacs_mule_char, decode_coding_emacs_mule, detect_coding_iso_2022):
10576 (decode_coding_iso_2022, decode_coding_sjis, decode_coding_big5):
10577 (decode_coding_raw_text, decode_coding_charset, get_translation_table):
10578 (Fdecode_sjis_char, Fdefine_coding_system_internal):
10579 Rename locals to avoid shadowing.
10580 * character.h (FETCH_STRING_CHAR_ADVANCE): Likewise.
e2f1bab9
PE
10581 * coding.c (emacs_mule_char, encode_invocation_designation):
10582 Now static, since they're not used elsewhere.
413bb2db 10583 (decode_coding_iso_2022): Add "default: abort ();" as a safety check.
c4a63b12 10584 (decode_coding_object, encode_coding_object, detect_coding_system):
ee05f961
PE
10585 (decode_coding_emacs_mule): Mark variables that gcc
10586 -Wuninitialized does not deduce are never used uninitialized.
160b01f6
PE
10587 (detect_coding_iso_2022): Initialize a local variable that might
10588 be used uninitialized. Leave a FIXME because it's not clear that
53df7c11 10589 this initialization is needed. (Bug#8211)
5f58e762
PE
10590 (ISO_CODE_LF, ISO_CODE_CR, CODING_ISO_FLAG_EUC_TW_SHIFT):
10591 (ONE_MORE_BYTE_NO_CHECK, UTF_BOM, UTF_16_INVALID_P):
10592 (SHIFT_OUT_OK, ENCODE_CONTROL_SEQUENCE_INTRODUCER):
10593 (ENCODE_DIRECTION_R2L, ENCODE_DIRECTION_L2R):
10594 Remove unused macros.
f38b440c 10595
232b38b9 10596 * category.c (hash_get_category_set): Remove unused local var.
9f3b5e69 10597 (copy_category_table): Now static, since it's not used elsewhere.
d0891610 10598 * character.c (string_count_byte8): Likewise.
232b38b9 10599
fb90da1b
PE
10600 * ccl.c (CCL_WRITE_STRING, CCL_ENCODE_CHAR, Fccl_execute_on_string):
10601 (Fregister_code_conversion_map): Rename locals to avoid shadowing.
10602
fb93dbc2
PE
10603 * chartab.c (copy_sub_char_table): Now static, since it's not used
10604 elsewhere.
5c156ace
PE
10605 (sub_char_table_ref_and_range, char_table_ref_and_range):
10606 Rename locals to avoid shadowing.
bbcd0949 10607 (ASET_RANGE, GET_SUB_CHAR_TABLE): Remove unused macros.
fb93dbc2 10608
7d3b3862 10609 * bidi.c (bidi_check_type): Now static, since it's not used elsewhere.
630d6892 10610 (BIDI_BOB): Remove unused macro.
7d3b3862 10611
6be7d3da
PE
10612 * cm.c (cmgoto): Mark variables that gcc -Wuninitialized does not
10613 deduce are never used uninitialized.
c2ed9c8b 10614 * term.c (encode_terminal_code): Likewise.
6be7d3da 10615
75f8807f 10616 * term.c (encode_terminal_code): Now static. Remove unused local.
72abad34 10617
50938595
PE
10618 * tparam.h: New file.
10619 * term.c, tparam.h: Include it.
10620 * deps.mk (term.o, tparam.o): Depend on tparam.h.
10621 * term.c (tputs, tgetent, tgetflag, tgetnum, tparam, tgetstr):
10622 Move these decls to tparam.h, and make them agree with what
10623 is actually in tparam.c. The previous trick of using incompatible
10624 decls in different modules does not conform to the C standard.
10625 All callers of tparam changed to use tparam's actual API.
10626 * tparam.c (tparam1, tparam, tgoto):
10627 Use const pointers where appropriate.
10628
fbceeba2
PE
10629 * cm.c (calccost, cmgoto): Use const pointers where appropriate.
10630 * cm.h (struct cm): Likewise.
10631 * dispextern.h (do_line_insertion_deletion_costs): Likewise.
10632 * scroll.c (ins_del_costs, do_line_insertion_deletion_costs): Likewise.
10633 * term.c (tty_ins_del_lines, calculate_costs, struct fkey_table):
10634 (term_get_fkeys_1, append_glyphless_glyph, produce_glyphless_glyph):
10635 (turn_on_face, init_tty): Likewise.
10636 * termchar.h (struct tty_display_info): Likewise.
fbceeba2 10637
7f3f1250
PE
10638 * term.c (term_mouse_position): Rename local to avoid shadowing.
10639
e6ca6543
PE
10640 * alloc.c (mark_ttys): Move decl from here ...
10641 * lisp.h (mark_ttys): ... to here, so that it's checked against defn.
10642
c40f8d15
AS
106432011-03-11 Andreas Schwab <schwab@linux-m68k.org>
10644
10645 * .gdbinit (pwinx, xbuffer): Fix access to buffer name.
10646
cfe0661d
JB
106472011-03-09 Juanma Barranquero <lekktu@gmail.com>
10648
10649 * search.c (compile_pattern_1): Remove argument regp, unused since
10650 revid:rms@gnu.org-19941211082627-3x1g1wyqkjmwloig.
10651 (compile_pattern): Don't pass it.
10652
0afb4571
J
106532011-03-08 Jan Djärv <jan.h.d@swipnet.se>
10654
10655 * xterm.h (DEFAULT_GDK_DISPLAY): New define.
10656 (GDK_WINDOW_XID, gtk_widget_get_preferred_size): New defines
10657 for ! HAVE_GTK3.
10658 (GTK_WIDGET_TO_X_WIN): Use GDK_WINDOW_XID.
10659
10660 * xmenu.c (menu_position_func): Call gtk_widget_get_preferred_size.
10661
10662 * gtkutil.c: Include gtkx.h if HAVE_GTK3. If ! HAVE_GTK3, define
10663 gdk_window_get_screen, gdk_window_get_geometry,
10664 gdk_x11_window_lookup_for_display and GDK_KEY_g.
10665 (xg_set_screen): Use DEFAULT_GDK_DISPLAY.
10666 (xg_get_pixbuf_from_pixmap): New function.
10667 (xg_get_pixbuf_from_pix_and_mask): Change parameters from GdkPixmap
10668 to Pixmap, take frame as parameter, remove GdkColormap parameter.
10669 Call xg_get_pixbuf_from_pixmap instead of
10670 gdk_pixbuf_get_from_drawable.
10671 (xg_get_image_for_pixmap): Do not make GdkPixmaps, call
10672 xg_get_pixbuf_from_pix_and_mask with Pixmap parameters instead.
10673 (xg_check_special_colors): Use GtkStyleContext and its functions
10674 for HAVE_GTK3.
10675 (xg_prepare_tooltip, xg_hide_tooltip): Call gdk_window_get_screen.
10676 (xg_prepare_tooltip, create_dialog, menubar_map_cb)
10677 (xg_update_frame_menubar, xg_tool_bar_detach_callback)
44f230aa
SM
10678 (xg_tool_bar_attach_callback, xg_update_tool_bar_sizes):
10679 Call gtk_widget_get_preferred_size.
0afb4571
J
10680 (xg_frame_resized): gdk_window_get_geometry only takes 5
10681 parameters.
44f230aa
SM
10682 (xg_win_to_widget, xg_event_is_for_menubar):
10683 Call gdk_x11_window_lookup_for_display.
0afb4571
J
10684 (xg_set_widget_bg): New function.
10685 (delete_cb): New function.
895009e1 10686 (xg_create_frame_widgets): Connect delete-event to delete_cb.
5c32d3f2 10687 Call xg_set_widget_bg. Only set background pixmap for ! HAVE_GTK3
0afb4571
J
10688 (xg_set_background_color): Call xg_set_widget_bg.
10689 (xg_set_frame_icon): Call xg_get_pixbuf_from_pix_and_mask.
10690 (xg_create_scroll_bar): vadj is a GtkAdjustment for HAVE_GTK3.
10691 Only call gtk_range_set_update_policy if ! HAVE_GTK3.
10692 (xg_make_tool_item): Only connect xg_tool_bar_item_expose_callback
10693 if ! HAVE_GTK3.
10694 (update_frame_tool_bar): Call gtk_widget_hide.
10695 (xg_initialize): Use GDK_KEY_g.
10696
10697 * xsmfns.c (gdk_set_sm_client_id): Define to gdk_set_sm_client_id
10698 if ! HAVE_GTK3
10699 (x_session_initialize): Call gdk_x11_set_sm_client_id.
10700
10701 * xterm.c (XFillRectangle): Use cairo routines for HAVE_GTK3.
10702 (x_term_init): Disable Xinput(2) with GDK_CORE_DEVICE_EVENTS.
10703 Load ~/emacs.d/gtkrc only for ! HAVE_GTK3.
10704
1c2cc4ef
JB
107052011-03-08 Juanma Barranquero <lekktu@gmail.com>
10706
10707 * w32xfns.c (select_palette): Check success of RealizePalette against
10708 GDI_ERROR, not zero.
10709
33383987 10710See ChangeLog.11 for earlier changes.
aac0c6e3
MR
10711
10712;; Local Variables:
10713;; coding: utf-8
aac0c6e3
MR
10714;; End:
10715
2f097256 10716 Copyright (C) 2011-2012 Free Software Foundation, Inc.
aac0c6e3
MR
10717
10718 This file is part of GNU Emacs.
10719
10720 GNU Emacs is free software: you can redistribute it and/or modify
10721 it under the terms of the GNU General Public License as published by
10722 the Free Software Foundation, either version 3 of the License, or
10723 (at your option) any later version.
10724
10725 GNU Emacs is distributed in the hope that it will be useful,
10726 but WITHOUT ANY WARRANTY; without even the implied warranty of
10727 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10728 GNU General Public License for more details.
10729
10730 You should have received a copy of the GNU General Public License
10731 along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.