1 2012-04-22 Paul Eggert <eggert@cs.ucla.edu>
3 Fix integer width and related bugs (Bug#9874).
4 * alloc.c (pure_bytes_used_lisp, pure_bytes_used_non_lisp):
5 (allocate_vectorlike, buffer_memory_full, struct sdata, SDATA_SIZE)
6 (string_bytes, check_sblock, allocate_string_data):
7 (compact_small_strings, Fmake_bool_vector, make_string)
8 (make_unibyte_string, make_multibyte_string)
9 (make_string_from_bytes, make_specified_string)
10 (allocate_vectorlike, Fmake_vector, find_string_data_in_pure)
11 (make_pure_string, make_pure_c_string, make_pure_vector, Fpurecopy)
13 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
14 (allocate_pseudovector):
15 Use int, not EMACS_INT, where int is wide enough.
16 (inhibit_garbage_collection, Fgarbage_collect):
17 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
18 * bidi.c (bidi_mirror_char): Use EMACS_INT, not int, where
19 int might not be wide enough.
20 (bidi_cache_search, bidi_cache_find, bidi_init_it)
21 (bidi_count_bytes, bidi_char_at_pos, bidi_fetch_char)
22 (bidi_at_paragraph_end, bidi_find_paragraph_start)
23 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak)
24 (bidi_level_of_next_char, bidi_move_to_visually_next):
25 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
26 * buffer.c (copy_overlays, Fgenerate_new_buffer_name)
27 (Fkill_buffer, Fset_buffer_major_mode)
28 (advance_to_char_boundary, Fbuffer_swap_text)
29 (Fset_buffer_multibyte, overlays_at, overlays_in)
30 (overlay_touches_p, struct sortvec, record_overlay_string)
31 (overlay_strings, recenter_overlay_lists)
32 (adjust_overlays_for_insert, adjust_overlays_for_delete)
33 (fix_start_end_in_overlays, fix_overlays_before, modify_overlay)
34 (Fmove_overlay, Fnext_overlay_change, Fprevious_overlay_change)
35 (Foverlay_recenter, last_overlay_modification_hooks_used)
36 (report_overlay_modification, evaporate_overlays, enlarge_buffer_text):
37 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
38 (validate_region): Omit unnecessary test for b <= e,
39 since that's guaranteed by the previous test.
40 (adjust_overlays_for_delete): Avoid pos + length overflow.
41 (Fmove_overlay, Fdelete_overlay, add_overlay_mod_hooklist)
42 (report_overlay_modification):
43 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
44 (Foverlays_at, Fnext_overlay_change, Fprevious_overlay_change):
45 Omit pointer cast, which isn't needed anyway, and doesn't work
46 after the EMACS_INT -> ptrdiff_t change.
47 (Fmove_overlay): Delete an evaporating overlay
48 if it becomes empty after its bounds are adjusted to fit within
49 its buffer. Without this fix, in a nonempty buffer (let ((o
50 (make-overlay 1 2))) (overlay-put o 'evaporate t) (move-overlay o 0 1))
51 yields an empty overlay that has the evaporate property, which is
52 not supposed to happen. (Bug#9642)
53 * buffer.h: Adjust decls to match defn changes elsewhere.
54 (struct buffer_text, struct buffer):
55 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
56 Use EMACS_INT, not int, where int might not be wide enough.
57 * bytecode.c (unmark_byte_stack, exec_byte_code): Use ptrdiff_t,
58 not int, to avoid needless 32-bit limit on 64-bit hosts.
59 (exec_byte_code): Use tighter memory-full test, one that checks
60 for alloca overflow. Don't compute the address of the object just
61 before an array, as that's not portable. Use EMACS_INT, not
62 ptrdiff_t or int, where ptrdiff_t or int might not be wide enough.
63 * callint.c (Fcall_interactively):
64 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
65 * callproc.c (call_process_kill, Fcall_process):
66 Don't assume pid_t fits into an Emacs fixnum.
67 (call_process_cleanup, Fcall_process, child_setup):
68 Don't assume pid_t fits into int.
69 (call_process_cleanup, Fcall_process, delete_temp_file)
70 (Fcall_process_region):
71 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
72 (Fcall_process): Simplify handling of volatile integers.
73 Use int, not EMACS_INT, where int will do.
74 * casefiddle.c (casify_object, casify_region, operate_on_word)
75 (Fupcase_word, Fdowncase_word, Fcapitalize_word):
76 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
77 (casify_object): Avoid integer overflow when overallocating buffer.
78 * casetab.c (set_identity, shuffle): Prefer int to unsigned when
79 either works. Use lint_assume to convince GCC 4.6.1 that it's OK.
80 * category.c (Fchar_category_set): Don't assume fixnum fits in int.
81 * category.h (CATEGORYP): Don't assume arg is nonnegative.
82 * ccl.c (GET_CCL_INT): Remove; no longer needed, since the
83 integers are now checked earlier. All uses replaced with XINT.
85 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
86 For CCL_MapSingle, check that content and value are in int range.
87 (ccl_driver, Fregister_code_conversion_map):
88 Check that Vcode_version_map_vector is a vector.
89 (resolve_symbol_ccl_program): Check that vector header is in range.
90 Always copy the vector, so that we can check its contents reliably
91 now rather than having to recheck each instruction as it's being
92 executed. Check that vector words fit in 'int'.
93 (ccl_get_compiled_code, Fregister_ccl_program)
94 (Fregister_code_conversion_map): Use ptrdiff_t, not int, for
95 program indexes, to avoid needless 32-bit limit on 64-bit hosts.
96 (Fccl_execute, Fccl_execute_on_string): Check that initial reg
97 contents are in range.
98 (Fccl_execute_on_string): Check that status is in range.
99 * ccl.h (struct ccl_program.idx): Now ptrdiff_t, not int.
100 * character.c (char_resolve_modifier_mask, Fchar_resolve_modifiers):
101 Accept and return EMACS_INT, not int, because callers can pass values
103 (c_string_width, strwidth, lisp_string_width, chars_in_text)
104 (multibyte_chars_in_text, parse_str_as_multibyte)
105 (str_as_multibyte, count_size_as_multibyte, str_to_multibyte)
106 (str_as_unibyte, str_to_unibyte, string_count_byte8)
107 (string_escape_byte8, Fget_byte):
108 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
109 (Funibyte_string): Use CHECK_RANGED_INTEGER, not CHECK_NATNUM, to
110 avoid mishandling large integers.
111 * character.h: Adjust decls to match defn changes elsewhere.
112 * charset.c (load_charset_map_from_file, find_charsets_in_text)
113 (Ffind_charset_region):
114 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
115 (load_charset_map_from_file): Redo idx calculation to avoid overflow.
116 (load_charset_map_from_vector, Fdefine_charset_internal):
117 Don't assume fixnum fits in int.
118 (load_charset_map_from_vector, Fmap_charset_chars):
119 Remove now-unnecessary CHECK_NATNUMs.
120 (Fdefine_charset_internal): Check ranges here, more carefully.
121 Don't rely on undefined behavior with signed left shift overflow.
122 Don't assume unsigned int fits into fixnum, or that fixnum fits
123 into unsigned int. Don't require max_code to be a valid fixnum;
124 that's not true for gb10830 4-byte on a 32-bit host. Allow
125 invalid_code to be a cons, for the same reason. Require code_offset
126 to be a character. Avoid int overflow if max_char is close
128 (CODE_POINT_TO_INDEX): On 32-bit hosts, return int, not unsigned;
129 this is intended anyway and avoids some undefined behavior.
130 (load_charset_map): Pass unsigned, not int, as 2nd arg of
131 INDEX_TO_CODE_POINT, as that's what it expects.
132 (Funify_charset, encode_char): Don't stuff unsigned vals into int vars.
133 * charset.h (DECODE_CHAR): Return int, not unsigned;
134 this is what was intended anyway, and it avoids undefined behavior.
135 (CHARSET_OFFSET): Remove unused macro, instead of fixing its
136 integer-overflow issues.
137 (ENCODE_CHAR): Return unsigned on all hosts, not just on 32-bit hosts.
138 Formerly, it returned EMACS_INT on 64-bit hosts in the common case
139 where the argument is EMACS_INT, and this behavior is not intended.
140 * chartab.c (Fmake_char_table, Fset_char_table_range)
141 (uniprop_get_decoder, uniprop_get_encoder):
142 Don't assume fixnum fits in int.
143 * cmds.c (move_point): New function, that does the gist of
144 Fforward_char and Fbackward_char, but does so while checking
145 for integer overflow more accurately.
146 (Fforward_char, Fbackward_char): Use it.
147 (Fforward_line, Fend_of_line, internal_self_insert)
148 (internal_self_insert):
149 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
150 Fix a FIXME, by checking for integer overflow when calculating
151 target_clm and actual_clm.
152 * coding.c (detect_coding_XXX, encode_coding_XXX, CODING_DECODE_CHAR)
153 (CODING_ENCODE_CHAR, CODING_CHAR_CHARSET, CODING_CHAR_CHARSET_P)
154 (ASSURE_DESTINATION, coding_alloc_by_realloc)
155 (coding_alloc_by_making_gap, alloc_destination)
156 (detect_coding_utf_8, encode_coding_utf_8, decode_coding_utf_16)
157 (encode_coding_utf_16, detect_coding_emacs_mule)
158 (decode_coding_emacs_mule, encode_coding_emacs_mule)
159 (detect_coding_iso_2022, decode_coding_iso_2022)
160 (encode_invocation_designation, encode_designation_at_bol)
161 (encode_coding_iso_2022, detect_coding_sjis, detect_coding_big5)
162 (decode_coding_sjis, decode_coding_big5, encode_coding_sjis)
163 (encode_coding_big5, detect_coding_ccl, decode_coding_ccl)
164 (encode_coding_ccl, encode_coding_raw_text)
165 (detect_coding_charset, decode_coding_charset)
166 (encode_coding_charset, detect_eol, decode_eol, produce_chars)
167 (produce_composition, produce_charset, produce_annotation)
168 (decode_coding, handle_composition_annotation)
169 (handle_charset_annotation, consume_chars, decode_coding_gap)
170 (decode_coding_object, encode_coding_object, detect_coding_system)
171 (Ffind_coding_systems_region_internal, Fcheck_coding_systems_region)
172 (code_convert_region, code_convert_string)
173 (Fdefine_coding_system_internal)
174 (coding_set_source, coding_set_destination):
175 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
176 (setup_iso_safe_charsets, consume_chars, Funencodable_char_position)
177 (Fdefine_coding_system_internal):
178 Don't assume fixnums fit in int.
179 (decode_coding_gap, decode_coding_object, encode_coding_object)
180 (Fread_coding_system, Fdetect_coding_region)
181 (Funencodable_char_position, Fcheck_coding_systems_region)
182 (get_translation, handle_composition_annotation, consume_chars):
183 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
184 (consume_chars): Rewrite to not calculate an address outside buffer.
185 (Ffind_operation_coding_system): NATNUMP can eval its arg twice.
186 Don't access memory outside of the args array.
187 (Fdefine_coding_system_internal): Check for charset-id overflow.
188 (ENCODE_ISO_CHARACTER): Use unsigned, not int, to store the unsigned
189 result of ENCODE_CHAR.
190 * coding.h: Adjust decls to match defn changes elsewhere.
191 (struct coding_system):
192 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
193 * composite.c (get_composition_id, find_composition)
194 (run_composition_function, update_compositions)
195 (compose_text, composition_gstring_put_cache)
196 (composition_gstring_p, composition_gstring_width)
197 (fill_gstring_header, fill_gstring_body, autocmp_chars)
198 (composition_compute_stop_pos, composition_reseat_it)
199 (composition_update_it, struct position_record)
200 (find_automatic_composition, composition_adjust_point)
201 (Fcomposition_get_gstring, Ffind_composition_internal):
202 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
203 (update_compositions):
204 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
205 * composite.h: Adjust decls to match defn changes elsewhere.
206 (struct composition):
207 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
208 * data.c (let_shadows_buffer_binding_p, let_shadows_global_binding_p):
209 Do not attempt to compute the address of the object just before a
210 buffer; this is not portable.
212 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
213 (Faset): Use int, not EMACS_INT, where int is wide enough.
214 (Fstring_to_number): Don't assume fixnums fit in int.
215 (Frem): Don't assume arg is nonnegative.
216 * dbusbind.c (xd_append_arg): Check for integers out of range.
217 (Fdbus_call_method): Don't overflow the timeout int.
218 * dired.c (directory_files_internal, file_name_completion, scmp)
219 (file_name_completion_stat):
220 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
221 (file_name_completion): Don't overflow matchcount.
222 (file_name_completion_stat): Use SAFE_ALLOCA, not alloca.
223 * dispextern.h: Adjust decls to match defn changes elsewhere.
224 (struct text_pos, struct glyph, struct bidi_saved_info)
225 (struct bidi_string_data, struct bidi_it, struct composition_it)
227 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
228 (struct display_pos, struct composition_it, struct it):
229 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
230 * dispnew.c (increment_matrix_positions)
231 (increment_row_positions, mode_line_string)
232 (marginal_area_string):
233 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
234 (change_frame_size_1, Fredisplay, Fframe_or_buffer_changed_p):
235 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
236 (duration_to_sec_usec): New function, to check for overflow better.
237 (Fsleep_for, sit_for): Use it.
238 * doc.c (get_doc_string, store_function_docstring):
239 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
240 (get_doc_string, Fsnarf_documentation):
241 Use int, not EMACS_INT, where int is wide enough.
243 Use SAFE_ALLOCA, not alloca.
244 Check for overflow when converting EMACS_INT to off_t.
246 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
247 * editfns.c (init_editfns, Fuser_uid, Fuser_real_uid):
248 Don't assume uid_t fits into fixnum.
249 (buildmark, Fgoto_char, overlays_around, find_field, Fdelete_field)
250 (Ffield_string, Ffield_string_no_properties, Ffield_beginning)
251 (Ffield_end, Fconstrain_to_field, Fline_beginning_position)
252 (Fline_end_position, Fprevious_char, Fchar_after, Fchar_before)
253 (general_insert_function)
254 (Finsert_char, make_buffer_string, make_buffer_string_both)
255 (update_buffer_properties, Fbuffer_substring)
256 (Fbuffer_substring_no_properties, Fcompare_buffer_substrings)
257 (Fsubst_char_in_region, check_translation)
258 (Ftranslate_region_internal, save_restriction_restore, Fformat)
259 (transpose_markers, Ftranspose_regions):
260 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
261 (clip_to_bounds): Move to lisp.h as an inline function).
262 (Fconstrain_to_field): Don't assume integers are nonnegative.
263 (Fline_beginning_position, Fsave_excursion, Fsave_current_buffer):
264 (Fsubst_char_in_region, Fsave_restriction):
265 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
266 (Femacs_pid): Don't assume pid_t fits into fixnum.
267 (lo_time): Use int, not EMACS_INT, when int suffices.
268 (lisp_time_argument): Check for usec out of range.
269 (Fencode_time): Don't assume fixnum fits in int.
270 (Fuser_login_name, Fuser_full_name): Signal an error
271 if a uid argument is out of range, rather than relying on
273 (Fformat_time_string): Remove now-unnecessary check.
274 lisp_time_argument checks for out-of-range usec now.
275 * emacs.c (gdb_valbits, gdb_gctypebits): Now int, not EMACS_INT.
276 (gdb_data_seg_bits): Now uintptr_t, not EMACS_INT.
277 (PVEC_FLAG, gdb_array_mark_flag): Now ptrdiff_t, not EMACS_INT.
278 (init_cmdargs, Fdump_emacs):
279 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
280 (Fkill_emacs): Don't assume fixnum fits in int; instead, take just
281 the bottom (typically) 32 bits of the fixnum.
282 * eval.c (specpdl_size, call_debugger):
283 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
284 (when_entered_debugger, Fbacktrace_debug):
285 Don't assume fixnum can fit in int.
286 (Fdefvaralias, Fdefvar): Do not attempt to compute the address of
287 the object just before a buffer; this is not portable.
288 (FletX, Flet, Funwind_protect, do_autoload, Feval, funcall_lambda)
289 (grow_specpdl, unbind_to):
290 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
291 (Fapply, apply_lambda): Don't assume ptrdiff_t can hold fixnum.
292 (grow_specpdl): Simplify allocation by using xpalloc.
293 (Fprog1, Fprog2): Don't assume list length fits in int. Simplify.
294 * fileio.c (Ffind_file_name_handler, Fcopy_file, Frename_file)
295 (Finsert_file_contents, Fwrite_region, Fdo_auto_save):
296 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
297 (Ffind_file_name_handler, non_regular_inserted, Finsert_file_contents)
299 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
300 (Fcopy_file, non_regular_nbytes, read_non_regular)
301 (Finsert_file_contents):
302 Use int, not EMACS_INT, where int is wide enough.
303 (READ_BUF_SIZE): Verify that it fits in int.
304 (Finsert_file_contents): Check that counts are in proper range,
305 rather than assuming fixnums fit into ptrdiff_t etc.
306 Don't assume fixnums fit into int.
307 * floatfns.c (Fexpt): Avoid undefined signed * signed overflow.
308 * fns.c (Fcompare_strings, Fstring_lessp, struct textprop_rec, concat)
309 (string_char_byte_cache_charpos, string_char_byte_cache_bytepos)
310 (string_char_to_byte, string_byte_to_char)
311 (string_make_multibyte, string_to_multibyte)
312 (string_make_unibyte, Fstring_as_unibyte, Fstring_as_multibyte)
313 (Fstring_to_unibyte, Fsubstring, Fsubstring_no_properties)
314 (substring_both, Fdelete, internal_equal, Ffillarray)
315 (Fclear_string, mapcar1)
316 (Fbase64_encode_region, Fbase64_encode_string, base64_encode_1)
317 (Fbase64_decode_region, Fbase64_decode_string, base64_decode_1)
318 (larger_vector, make_hash_table, maybe_resize_hash_table)
319 (hash_lookup, hash_remove_from_table, hash_clear, sweep_weak_table)
320 (Fmaphash, secure_hash):
321 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
322 (concat): Check for string index and length overflow.
323 (Fmapconcat): Don't assume fixnums fit into ptrdiff_t.
325 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
326 (larger_vector): New API (vec, incr_min, size_max) replaces old
327 one (vec, new_size, init). This catches size overflow.
328 INIT was removed because it was always Qnil.
330 (INDEX_SIZE_BOUND): New macro, which calculates more precisely
331 the upper bound on a hash table index size.
332 (make_hash_table, maybe_resize_hash_table): Use it.
333 (secure_hash): Computer start_byte and end_byte only after
334 they're known to be in ptrdiff_t range.
335 * font.c (font_intern_prop, font_at, font_range, Ffont_shape_gstring)
336 (Ffont_get_glyphs, Ffont_at):
337 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
338 (font_style_to_value, font_prop_validate_style, font_expand_wildcards)
339 (Flist_fonts, Fopen_font):
340 Don't assume fixnum can fit in int.
341 (check_gstring): Don't assume index can fit in int.
342 (font_match_p): Check that fixnum is a character, not a nonnegative
343 fixnum, since the later code needs to stuff it into an int.
344 (font_find_for_lface): Use SAFE_ALLOCA_LISP, not alloca.
345 (font_fill_lglyph_metrics): Use unsigned, not EMACS_INT, to avoid
346 conversion overflow issues.
347 (Fopen_font): Check for integer out of range.
348 (Ffont_get_glyphs): Don't assume index can fit in int.
349 * font.h: Adjust decls to match defn changes elsewhere.
350 * fontset.c (reorder_font_vector): Redo score calculation to avoid
352 (num_auto_fontsets, fontset_from_font): Use ptrdiff_t, not
353 printmax_t, where ptrdiff_t is wide enough.
354 (Finternal_char_font):
355 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
356 * frame.c (Fset_mouse_position, Fset_mouse_pixel_position)
357 (Fset_frame_height, Fset_frame_width, Fset_frame_size)
358 (Fset_frame_position, x_set_frame_parameters)
359 (x_set_line_spacing, x_set_border_width)
360 (x_set_internal_border_width, x_set_alpha, x_figure_window_size):
361 Check that fixnums are in proper range for system types.
362 (frame_name_fnn_p, Fframe_parameter, Fmodify_frame_parameters):
363 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
364 (Fmodify_frame_parameters): Don't assume fixnum fits in int.
365 Use SAFE_ALLOCA_LISP, not alloca.
366 * frame.h (struct frame): Use intptr_t, not EMACS_INT, where
367 intptr_t is wide enough.
368 * fringe.c (lookup_fringe_bitmap, get_logical_fringe_bitmap)
369 (Fdefine_fringe_bitmap): Don't assume fixnum fits in int.
370 (Ffringe_bitmaps_at_pos): Don't assume index fits in int.
371 Check for fixnum out of range.
372 * ftfont.c (ftfont_list): Don't assume index fits in int.
373 Check that fixnums are in proper range for system types.
374 (ftfont_shape_by_flt):
375 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
376 * gnutls.c (emacs_gnutls_write, emacs_gnutls_read):
377 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
378 (Fgnutls_error_fatalp, Fgnutls_error_string, Fgnutls_boot):
379 Check that fixnums are in proper range for system types.
380 * gnutls.h: Adjust decls to match defn changes elsewhere.
381 * gtkutil.c (xg_dialog_run):
382 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
383 (update_frame_tool_bar):
384 Check that fixnums are in proper range for system types.
385 * image.c (parse_image_spec): Redo count calculation to avoid overflow.
386 (lookup_image): Check that fixnums are in range for system types.
387 * indent.c (last_known_column, last_known_column_point):
388 (current_column_bol_cache):
389 (skip_invisible, current_column, check_display_width):
390 (check_display_width, scan_for_column, current_column_1)
391 (Findent_to, Fcurrent_indentation, position_indentation)
392 (indented_beyond_p, Fmove_to_column, compute_motion):
393 (Fcompute_motion, Fvertical_motion):
394 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
395 (last_known_column_modified): Use EMACS_INT, not int.
396 (check_display_width):
398 Check that fixnums and floats are in proper range for system types.
399 (compute_motion): Don't assume index or fixnum fits in int.
400 (compute_motion, Fcompute_motion):
401 Use int, not EMACS_INT, when it is wide enough.
402 (vmotion): Omit local var start_hpos that is always 0; that way
403 we don't need to worry about overflow in expressions involving it.
404 * indent.h: Adjust decls to match defn changes elsewhere.
406 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
407 Use int, not EMACS_INT, where int is wide enough.
408 Remove unused members ovstring_chars_done and tab_offset;
410 * insdel.c (move_gap, move_gap_both, gap_left, gap_right)
411 (adjust_markers_for_delete, adjust_markers_for_insert, adjust_point)
412 (adjust_markers_for_replace, make_gap_larger, make_gap_smaller)
413 (make_gap, copy_text, insert, insert_and_inherit)
414 (insert_before_markers, insert_before_markers_and_inherit)
415 (insert_1, count_combining_before, count_combining_after)
416 (insert_1_both, insert_from_string)
417 (insert_from_string_before_markers, insert_from_string_1)
418 (insert_from_gap, insert_from_buffer, insert_from_buffer_1)
419 (adjust_after_replace, adjust_after_insert, replace_range)
420 (replace_range_2, del_range, del_range_1, del_range_byte)
421 (del_range_both, del_range_2, modify_region)
422 (prepare_to_modify_buffer, signal_before_change)
423 (signal_after_change, Fcombine_after_change_execute):
424 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
425 * intervals.c (traverse_intervals, rotate_right, rotate_left)
426 (balance_an_interval, split_interval_right, split_interval_left)
427 (find_interval, next_interval, update_interval)
428 (adjust_intervals_for_insertion, delete_node, delete_interval)
429 (interval_deletion_adjustment, adjust_intervals_for_deletion)
430 (static_offset_intervals, offset_intervals)
431 (merge_interval_right, merge_interval_left, make_new_interval)
432 (graft_intervals_into_buffer, temp_set_point_both)
433 (temp_set_point, set_point, adjust_for_invis_intang)
434 (set_point_both, move_if_not_intangible, get_property_and_range)
435 (get_local_map, copy_intervals, copy_intervals_to_string)
436 (compare_string_intervals, set_intervals_multibyte_1):
437 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
438 * intervals.h: Adjust decls to match defn changes elsewhere.
440 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
441 * keyboard.c (this_command_key_count, this_single_command_key_start)
442 (before_command_key_count, before_command_echo_length, echo_now)
443 (echo_length, recursive_edit_1, Frecursive_edit, Ftrack_mouse)
444 (command_loop_1, safe_run_hooks, read_char, timer_check_2)
445 (menu_item_eval_property, read_key_sequence, Fread_key_sequence)
446 (Fread_key_sequence_vector, Fexecute_extended_command, Fsuspend_emacs):
447 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
448 (last_non_minibuf_size, last_point_position, echo_truncate)
449 (command_loop_1, adjust_point_for_property, read_char, gen_help_event)
450 (make_lispy_position, make_lispy_event, parse_modifiers_uncached)
451 (parse_modifiers, modify_event_symbol, Fexecute_extended_command)
452 (stuff_buffered_input):
453 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
454 (last_auto_save, command_loop_1, read_char):
455 Use EMACS_INT, not int, to avoid integer overflow.
456 (record_char): Avoid overflow in total_keys computation.
457 (parse_modifiers_uncached): Redo index calculation to avoid overflow.
458 * keyboard.h: Adjust decls to match defn changes elsewhere.
459 * keymap.c (Fdefine_key, Fcurrent_active_maps, accessible_keymaps_1)
460 (Fkey_description, Fdescribe_vector, Flookup_key):
461 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
462 (click_position): New function, to check that positions are in range.
463 (Fcurrent_active_maps):
465 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
466 (Faccessible_keymaps, Fkey_description):
467 (preferred_sequence_p):
468 Don't assume fixnum can fit into int.
469 (Fkey_description): Use SAFE_ALLOCA_LISP, not alloca.
470 Check for integer overflow in size calculations.
471 (Ftext_char_description): Use CHECK_CHARACTER, not CHECK_NUMBER, to
472 avoid mishandling large integers.
473 * lisp.h: Adjust decls to match defn changes elsewhere.
474 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, struct Lisp_String)
475 (struct vectorlike_header, struct Lisp_Subr, struct Lisp_Hash_Table)
476 (struct Lisp_Marker):
477 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
478 (clip_to_bounds): Now an inline function, moved here from editfns.c.
479 (GLYPH_CODE_P): Check for overflow in system types, subsuming the
480 need for GLYPH_CODE_CHAR_VALID_P and doing proper checking ourselves.
482 (GLYPH_CODE_CHAR, GLYPH_CODE_FACE):
483 Assume the arg has valid form, since it always does.
484 (TYPE_RANGED_INTEGERP): Avoid bug when checking against a wide
485 unsigned integer system type.
486 (CHECK_RANGED_INTEGER, CHECK_TYPE_RANGED_INTEGER): New macros.
487 (struct catchtag, specpdl_size, SPECPDL_INDEX, USE_SAFE_ALLOCA):
488 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
489 (struct catchtag): Use EMACS_INT, not int, since it may be a fixnum.
490 (duration_to_sec_usec): New decl.
491 * lread.c (read_from_string_index, read_from_string_index_byte)
492 (read_from_string_limit, readchar, unreadchar, openp)
493 (read_internal_start, read1, oblookup):
494 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
495 (Fload, readevalloop, Feval_buffer, Feval_region):
496 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
497 (openp): Check for out-of-range argument to 'access'.
498 (read1): Use int, not EMACS_INT, where int is wide enough.
499 Don't assume fixnum fits into int.
500 Fix off-by-one error that can read outside a buffer.
501 (read_filtered_event): Use duration_to_sec_usec
502 to do proper overflow checking on durations.
503 * macros.c (Fstart_kbd_macro): Use xpalloc to check for overflow
505 (Fexecute_kbd_macro):
506 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
507 * marker.c (cached_charpos, cached_bytepos, CONSIDER)
508 (byte_char_debug_check, buf_charpos_to_bytepos, verify_bytepos)
509 (buf_bytepos_to_charpos, Fset_marker, set_marker_restricted)
510 (set_marker_both, set_marker_restricted_both, marker_position)
511 (marker_byte_position, Fbuffer_has_markers_at):
512 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
513 (Fset_marker, set_marker_restricted): Don't assume fixnum fits in int.
514 * menu.c (ensure_menu_items): Renamed from grow_menu_items.
515 It now merely ensures that the menu is large enough, without
516 necessarily growing it, as this avoids some integer overflow issues.
518 (keymap_panes, parse_single_submenu, Fx_popup_menu):
519 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
520 (parse_single_submenu, Fx_popup_menu): Don't assume fixnum fits in int.
521 Use SAFE_ALLOCA_LISP, not alloca.
522 (find_and_return_menu_selection): Avoid unnecessary casts of pointers
523 to EMACS_INT. Check that fixnums are in proper range for system types.
524 * minibuf.c (minibuf_prompt_width, string_to_object)
525 (Fminibuffer_contents, Fminibuffer_contents_no_properties)
526 (Fminibuffer_completion_contents, Ftry_completion, Fall_completions):
527 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
528 (get_minibuffer, read_minibuf_unwind):
529 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
530 (read_minibuf): Omit unnecessary arg BACKUP_N, which is always nil;
531 this simplifies overflow checking. All callers changed.
532 (read_minibuf, Fread_buffer, Ftry_completion, Fall_completions)
534 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
535 * nsfns.m (check_ns_display_info): Don't assume fixnum fits in long.
536 (x_set_menu_bar_lines, x_set_tool_bar_lines, Fx_create_frame):
537 Check that fixnums are in proper range for system types.
538 (Fx_create_frame, Fx_show_tip):
539 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
540 * nsfont.m (ns_findfonts, nsfont_list_family):
541 Don't assume fixnum fits in long.
542 * nsmenu.m (ns_update_menubar, ns_menu_show, ns_popup_dialog):
543 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
544 (ns_update_menubar): Use intptr_t, not EMACS_INT, when intptr_t is
546 * nsselect.m (ns_get_local_selection, clean_local_selection_data):
547 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
548 * print.c (print_buffer_size, print_buffer_pos, print_buffer_pos_byte)
549 (PRINTDECLARE, PRINTPREPARE):
550 (strout, print_string):
551 (print, print_preprocess, print_check_string_charset_prop)
553 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
555 (temp_output_buffer_setup, Fprin1_to_string, print_object):
556 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
557 (PRINTPREPARE): Use int, not ptrdiff_t, where int is wide enough.
558 (printchar, strout): Use xpalloc to catch size calculation overflow.
559 (Fexternal_debugging_output): Don't overflow EMACS_INT->int conversion.
560 (print_error_message): Use SAFE_ALLOCA, not alloca.
561 (print_object): Use int, not EMACS_INT, where int is wide enough.
562 (print_depth, new_backquote_output, print_number_index):
563 Use ptrdiff_t, not int, where int might not be wide enough.
564 * process.c (Fdelete_process): Don't assume pid fits into EMACS_INT.
565 (Fset_process_window_size, Fformat_network_address)
566 (get_lisp_to_sockaddr_size, set_socket_option, Fmake_network_process)
568 Check that fixnums are in proper range for system types.
569 (Fsignal_process): Simplify by avoiding a goto.
570 Check for process-ids out of pid_t range rather than relying on
572 (Fformat_network_address, read_process_output, send_process)
573 (Fprocess_send_region, status_notify):
574 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
575 (Fformat_network_address, Fmake_serial_process, Fmake_network_process)
576 (wait_reading_process_output, read_process_output, exec_sentinel):
577 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
578 (conv_lisp_to_sockaddr): Don't assume fixnums fit into int.
579 (Faccept_process_output): Use duration_to_sec_usec to do proper
580 overflow checking on durations.
581 (emacs_get_tty_pgrp, Fprocess_running_child_p, process_send_signal):
582 Don't assume pid_t fits in int.
583 * puresize.h (PURESIZE_RATIO): Shrink this to 8/6 on 32-bit hosts
584 configured --with-wide-int.
585 * scroll.c (calculate_scrolling, calculate_direct_scrolling)
586 (line_ins_del): Use int, not EMACS_INT, where int is wide enough.
587 * search.c (looking_at_1, string_match_1):
588 (fast_string_match, fast_c_string_match_ignore_case)
589 (fast_string_match_ignore_case, fast_looking_at, scan_buffer)
590 (scan_newline, find_before_next_newline, search_command)
591 (trivial_regexp_p, search_buffer, simple_search, boyer_moore)
592 (set_search_regs, wordify):
595 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
596 (string_match_1, search_buffer, set_search_regs):
598 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
599 (wordify): Check for overflow in size calculation.
600 (Freplace_match): Avoid potential buffer overflow in search_regs.start.
601 (Fset_match_data): Don't assume fixnum fits in ptrdiff_t.
602 Check that fixnums are in proper range for system types.
603 * sound.c (struct sound_device)
604 (wav_play, au_play, vox_write, alsa_period_size, alsa_write):
605 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
606 (Fplay_sound_internal):
607 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
608 * syntax.c (struct lisp_parse_state, find_start_modiff)
609 (Finternal_describe_syntax_value, scan_lists, scan_sexps_forward):
610 (Fparse_partial_sexp):
611 Don't assume fixnums can fit in int.
612 (struct lisp_parse_state, find_start_pos, find_start_value)
613 (find_start_value_byte, find_start_begv)
614 (update_syntax_table, char_quoted, dec_bytepos)
615 (find_defun_start, prev_char_comend_first, back_comment):
616 (scan_words, skip_chars, skip_syntaxes, forw_comment, Fforward_comment)
617 (scan_lists, Fbackward_prefix_chars, scan_sexps_forward):
618 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
619 (Finternal_describe_syntax_value): Check that match_lisp is a
620 character, not an integer, since the code stuffs it into int.
621 (scan_words, scan_sexps_forward):
622 Check that fixnums are in proper range for system types.
624 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
625 (scan_sexps_forward):
626 Use CHARACTERP, not INTEGERP, since the value must fit into int.
627 (Fparse_partial_sexp): Fix doc; element 8 is not ignored.
628 * syntax.h: Adjust decls to match defn changes elsewhere.
630 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
631 (SETUP_SYNTAX_TABLE_FOR_OBJECT): Use PTRDIFF_MAX, not
632 MOST_POSITIVE_FIXNUM.
633 * sysdep.c (wait_for_termination_1, wait_for_termination)
634 (interruptible_wait_for_termination, mkdir):
635 Don't assume pid_t fits in int; on 64-bit AIX pid_t is 64-bit.
636 (emacs_read, emacs_write):
637 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
638 (system_process_attributes): Don't assume uid_t, gid_t, EMACS_INT,
639 and double all fit in int.
640 * term.c (set_tty_color_mode):
641 Check that fixnums are in proper range for system types.
642 * termhooks.h (struct input_event):
643 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
644 * textprop.c (validate_interval_range, interval_of)
645 (Fadd_text_properties, set_text_properties_1)
646 (Fremove_text_properties, Fremove_list_of_text_properties)
647 (Ftext_property_any, Ftext_property_not_all)
648 (copy_text_properties, text_property_list, extend_property_ranges)
649 (verify_interval_modification):
650 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
651 (Fnext_single_char_property_change)
652 (Fprevious_single_char_property_change):
653 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
654 (copy_text_properties):
655 Check for integer overflow in index calculation.
656 * undo.c (last_boundary_position, record_point, record_insert)
657 (record_delete, record_marker_adjustment, record_change)
658 (record_property_change):
659 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
660 (truncate_undo_list, Fprimitive_undo): Don't assume fixnum fits in int.
661 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
662 * w32fns.c (Fx_create_frame, x_create_tip_frame, Fx_show_tip)
663 (Fx_hide_tip, Fx_file_dialog):
664 * w32menu.c (set_frame_menubar):
665 Use ptrdiff_t, not int, for consistency with rest of code.
666 * window.c (window_scroll_preserve_hpos, window_scroll_preserve_vpos)
667 (select_window, Fdelete_other_windows_internal)
668 (window_scroll_pixel_based, window_scroll_line_based)
669 (Frecenter, Fset_window_configuration):
670 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
671 (Fset_window_hscroll, run_window_configuration_change_hook)
672 (set_window_buffer, temp_output_buffer_show, scroll_command)
673 (Fscroll_other_window, Frecenter):
674 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
675 (Fwindow_line_height, window_scroll, Fscroll_left, Fscroll_right):
676 Don't assume fixnum fits in int.
677 (Fset_window_scroll_bars):
678 Check that fixnums are in proper range for system types.
679 * xdisp.c (help_echo_pos, pos_visible_p, string_pos_nchars_ahead)
680 (string_pos, c_string_pos, number_of_chars, init_iterator)
681 (in_ellipses_for_invisible_text_p, init_from_display_pos)
682 (compute_stop_pos, next_overlay_change, compute_display_string_pos)
683 (compute_display_string_end, handle_face_prop)
684 (face_before_or_after_it_pos, handle_invisible_prop)
685 (handle_display_prop, handle_display_spec, handle_single_display_spec)
686 (display_prop_intangible_p, string_buffer_position_lim)
687 (string_buffer_position, handle_composition_prop, load_overlay_strings)
688 (get_overlay_strings_1, get_overlay_strings)
689 (iterate_out_of_display_property, forward_to_next_line_start)
690 (back_to_previous_visible_line_start, reseat, reseat_to_string)
691 (get_next_display_element, set_iterator_to_next)
692 (get_visually_first_element, compute_stop_pos_backwards)
693 (handle_stop_backwards, next_element_from_buffer)
694 (move_it_in_display_line_to, move_it_in_display_line)
695 (move_it_to, move_it_vertically_backward, move_it_by_lines)
696 (add_to_log, message_dolog, message_log_check_duplicate)
697 (message2, message2_nolog, message3, message3_nolog
698 (with_echo_area_buffer, display_echo_area_1, resize_mini_window_1)
699 (current_message_1, truncate_echo_area, truncate_message_1)
700 (set_message, set_message_1, store_mode_line_noprop)
701 (hscroll_window_tree, debug_delta, debug_delta_bytes, debug_end_vpos)
702 (text_outside_line_unchanged_p, check_point_in_composition)
703 (reconsider_clip_changes)
704 (redisplay_internal, set_cursor_from_row, try_scrolling)
705 (try_cursor_movement, set_vertical_scroll_bar, redisplay_window)
706 (redisplay_window, find_last_unchanged_at_beg_row)
707 (find_first_unchanged_at_end_row, row_containing_pos, try_window_id)
708 (trailing_whitespace_p, find_row_edges, display_line)
709 (RECORD_MAX_MIN_POS, Fcurrent_bidi_paragraph_direction)
710 (display_mode_element, store_mode_line_string)
711 (pint2str, pint2hrstr, decode_mode_spec)
712 (display_count_lines, display_string, draw_glyphs)
713 (x_produce_glyphs, x_insert_glyphs)
714 (rows_from_pos_range, mouse_face_from_buffer_pos)
715 (fast_find_string_pos, mouse_face_from_string_pos)
716 (note_mode_line_or_margin_highlight, note_mouse_highlight):
717 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
718 (safe_call, init_from_display_pos, handle_fontified_prop)
719 (handle_single_display_spec, load_overlay_strings)
720 (with_echo_area_buffer, setup_echo_area_for_printing)
721 (display_echo_area, echo_area_display)
722 (x_consider_frame_title, prepare_menu_bars, update_menu_bar)
723 (update_tool_bar, hscroll_window_tree, redisplay_internal)
724 (redisplay_window, dump_glyph_row, display_mode_line)
725 (Fformat_mode_line, decode_mode_spec, on_hot_spot_p):
726 (handle_display_spec, display_prop_string_p):
727 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
728 (handle_single_display_spec, build_desired_tool_bar_string)
729 (redisplay_tool_bar, scroll_window_tree, Fdump_glyph_matrix)
730 (get_specified_cursor_type):
731 Check that fixnums are in proper range for system types.
732 (struct overlay_entry, resize_mini_window, Fdump_glyph_row)
734 Don't assume fixnums fit in int.
735 (compare_overlay_entries):
736 Avoid mishandling comparisons due to subtraction overflow.
737 (load_overlay_strings): Use SAFE_NALLOCA, not alloca.
738 (last_escape_glyph_face_id, last_glyphless_glyph_face_id):
739 (handle_tool_bar_click):
740 Use int, not unsigned, since we prefer signed and the signedness
742 (get_next_display_element, next_element_from_display_vector):
743 Use int, not EMACS_INT, when int is wide enough.
744 (start_hourglass): Use duration_to_sec_usec to do proper
745 overflow checking on durations.
746 * xfaces.c (Fbitmap_spec_p):
747 Check that fixnums are in proper range for system types.
748 (compare_fonts_by_sort_order):
749 Avoid mishandling comparisons due to subtraction overflow.
750 (Fx_family_fonts, realize_basic_faces):
751 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
753 Don't assume fixnum fits in int.
754 Use SAFE_ALLOCA_LISP, not alloca.
755 (merge_face_heights): Remove unnecessary cast to EMACS_INT.
756 (Finternal_make_lisp_face): Don't allocate more than MAX_FACE_ID.
757 (face_at_buffer_position, face_for_overlay_string)
758 (face_at_string_position):
759 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
760 (merge_faces): Use int, not EMACS_INT, where int is wide enough.
761 * xfns.c (x_set_menu_bar_lines, x_set_tool_bar_lines, x_icon_verify)
763 Check that fixnums are in proper range for system types.
764 (Fx_create_frame, x_create_tip_frame, Fx_show_tip)
765 (Fx_hide_tip, Fx_file_dialog, Fx_select_font):
766 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
767 (Fx_change_window_property): Don't assume fixnums fit in int.
768 * xfont.c (xfont_chars_supported):
769 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
770 * xmenu.c (Fx_popup_dialog, set_frame_menubar)
771 (create_and_show_popup_menu, create_and_show_dialog, xmenu_show):
772 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
773 * xml.c (parse_region):
774 * xrdb.c (magic_file_p):
775 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
776 * xselect.c (TRACE1): Don't assume pid_t promotes to int.
777 (x_get_local_selection, x_reply_selection_request)
778 (x_handle_selection_request, wait_for_property_change):
779 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
780 (selection_data_to_lisp_data): Use short, not EMACS_INT, where
781 short is wide enough.
782 (x_send_client_event): Don't assume fixnum fits in int.
783 * xterm.c (x_x_to_emacs_modifiers):
784 Don't assume EMACS_INT overflows nicely into int.
785 (x_emacs_to_x_modifiers): Use EMACS_INT, not int, because values
787 (handle_one_xevent): NATNUMP can eval its arg twice.
788 (x_connection_closed):
789 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
790 * xterm.h: Adjust decls to match defn changes elsewhere.
791 (struct scroll_bar): Use struct vectorlike_header
792 rather than rolling our own approximation.
793 (SCROLL_BAR_VEC_SIZE): Remove; not used.
795 2012-04-22 Leo Liu <sdl.web@gmail.com>
797 * sysdep.c (list_system_processes): Support Darwin (Bug#5725).
799 2012-04-22 Paul Eggert <eggert@cs.ucla.edu>
801 * sysdep.c [__FreeBSD__]: Minor cleanups.
802 (list_system_processes, system_process_attributes) [__FreeBSD__]:
803 Use Emacs indenting style more consistently. Avoid some casts.
804 Use 'double' consistently rather than mixing 'float' and 'double'.
806 2012-04-21 Eduard Wiebe <usenet@pusto.de>
808 * sysdep.c (list_system_processes, system_process_attributes): Add
809 implementation for FreeBSD (Bug#5243).
811 2012-04-21 Andreas Schwab <schwab@linux-m68k.org>
813 * lisp.mk (lisp): Update.
815 2012-04-20 Paul Eggert <eggert@cs.ucla.edu>
817 * keyboard.c (process_pending_signals): Define only if SYNC_INPUT.
818 It is never used otherwise.
820 2012-04-20 Stefan Monnier <monnier@iro.umontreal.ca>
822 * print.c (print_preprocess): Only check print_depth if print-circle
824 (print_object): Check for cycles even when print-circle is nil and
825 print-gensym is t, but only check print_depth if print-circle is nil.
827 2012-04-20 Chong Yidong <cyd@gnu.org>
829 * process.c (wait_reading_process_output): If EIO occurs on a pty,
830 set the status to "failed" and ensure that sentinel is run.
832 2012-04-20 Glenn Morris <rgm@gnu.org>
834 * process.c (Fset_process_inherit_coding_system_flag)
835 (Fset_process_query_on_exit_flag): Doc fix (mention return value).
836 (Fmake_network_process, Fmake_serial_process): Doc fix.
838 2012-04-20 Eli Zaretskii <eliz@gnu.org>
840 * xdisp.c (string_buffer_position_lim): Limit starting position to
842 (set_cursor_from_row): If called for a mode-line or header-line
843 row, return zero immediately.
844 (try_cursor_movement): If inside continuation line, don't back up
845 farther than the first row after the header line, if any.
846 Don't consider the header-line row as "partially visible", even if
847 MATRIX_ROW_PARTIALLY_VISIBLE_P returns non-zero. (Bug#11261)
849 2012-04-20 Atsuo Ohki <ohki@gssm.otsuka.tsukuba.ac.jp> (tiny change)
851 * lread.c (lisp_file_lexically_bound_p): Fix hang at ";-*-\n"
854 2012-04-20 Teodor Zlatanov <tzz@lifelogs.com>
855 2012-04-18 Paul Eggert <eggert@cs.ucla.edu>
857 configure: new option --enable-gcc-warnings (Bug#11207)
858 * Makefile.in (C_WARNINGS_SWITCH): Remove.
859 (WARN_CFLAGS, WERROR_CFLAGS): New macros.
860 (ALL_CFLAGS): Use new macros rather than old.
861 * process.c: Ignore -Wstrict-overflow to work around GCC bug 52904.
862 * regex.c: Ignore -Wstrict-overflow. If !emacs, also ignore
863 -Wunused-but-set-variable, -Wunused-function, -Wunused-macros,
864 -Wunused-result, -Wunused-variable. This should go away once
865 the Emacs and Gnulib regex code is merged.
866 (xmalloc, xrealloc): Now static.
868 2012-04-17 Paul Eggert <eggert@cs.ucla.edu>
870 * dired.c (Fsystem_groups): Remove unused local.
872 2012-04-17 Glenn Morris <rgm@gnu.org>
874 * dired.c (Fsystem_users): Doc fix.
876 2012-04-17 Dmitry Antipov <dmantipov@yandex.ru>
878 * dired.c (Fsystem_users, Fsystem_groups): New functions. (Bug#7900)
879 (syms_of_dired): Add them.
881 2012-04-16 Paul Eggert <eggert@cs.ucla.edu>
883 Fix minor alloc.c problems found by static checking.
884 * alloc.c (_malloc_internal, _free_internal) [!DOUG_LEA_MALLOC]:
885 New extern decls, to avoid calling undeclared functions.
886 (dont_register_blocks): Define if ((!SYSTEM_MALLOC && !SYNC_INPUT)
887 && GC_MALLOC_CHECK), not if ((GC_MARK_STACK || defined
888 GC_MALLOC_CHECK) && GC_MALLOC_CHECK), to match when it's used.
889 (NEED_MEM_INSERT): New macro.
890 (mem_insert, mem_insert_fixup) [!NEED_MEM_INSERT]: Remove; unused.
891 Remove one incorrect comment and fix another.
893 Fix minor ralloc.c problems found by static checking.
894 See http://lists.gnu.org/archive/html/emacs-devel/2011-12/msg00720.html
895 * ralloc.c (ALIGNED, ROUND_TO_PAGE, HEAP_PTR_SIZE)
896 (r_alloc_size_in_use, r_alloc_freeze, r_alloc_thaw): Remove; unused.
897 (r_alloc_sbrk): Now static.
899 Improve ralloc.c interface checking.
900 See http://lists.gnu.org/archive/html/emacs-devel/2011-12/msg00720.html
901 * buffer.c (ralloc_reset_variable, r_alloc, r_re_alloc)
902 (r_alloc_free) [REL_ALLOC]: Move decls from here ...
903 * lisp.h (r_alloc, r_alloc_free, r_re_alloc, r_alloc_reset_variable)
904 [REL_ALLOC]: ... to here, to check interface.
905 * m/ia64.h (r_alloc, r_alloc_free) [REL_ALLOC && !_MALLOC_INTERNAL]:
906 Remove decls. This fixes an "It stinks!".
908 * alloc.c (which_symbols): Fix alignment issue / type clash.
910 2012-04-15 Andreas Schwab <schwab@linux-m68k.org>
912 * lisp.h (struct Lisp_Symbol): Remove explicit padding.
913 (struct Lisp_Misc_Any): Likewise.
914 (struct Lisp_Free): Likewise.
915 * alloc.c (union aligned_Lisp_Symbol): Define.
916 (SYMBOL_BLOCK_SIZE, struct symbol_block): Use union
917 aligned_Lisp_Symbol instead of struct Lisp_Symbol.
918 (union aligned_Lisp_Misc): Define.
919 (MARKER_BLOCK_SIZE, struct marker_block): Use union
920 aligned_Lisp_Misc instead of union Lisp_Misc.
921 (Fmake_symbol, allocate_misc, gc_sweep): Adjust.
923 2012-04-14 Paul Eggert <eggert@cs.ucla.edu>
925 Make GC_MAKE_GCPROS_NOOPS the default (Bug#9926).
926 * lisp.h (GC_MARK_STACK): Default to GC_MAKE_GCPROS_NOOPS.
927 * s/cygwin.h, s/darwin.h, s/freebsd.h, s/gnu.h, s/irix6-5.h, s/msdos.h:
928 * s/netbsd.h, s/sol2-6.h:
929 Remove definition of GC_MARK_STACK, since the default now works.
930 * s/aix4-2.h, s/hpux10-20.h, s/unixware.h:
931 Define GC_MARK_STACK to GC_USE_GCPROS_AS_BEFORE, since that's
932 no longer the default.
933 * s/gnu-linux.h (GC_MARK_STACK): Adjust to change in default.
935 2012-04-14 Atsuo Ohki <ohki@gssm.otsuka.tsukuba.ac.jp> (tiny change)
937 * lread.c (lisp_file_lexically_bound_p):
938 Fix hang at ";-*-\n" (bug#11238).
940 2012-04-14 Eli Zaretskii <eliz@gnu.org>
942 * xdisp.c (find_last_unchanged_at_beg_row): Don't consider a row
943 "unchanged" if its end.pos is beyond ZV. (Bug#11199)
945 2012-04-14 Jan Djärv <jan.h.d@swipnet.se>
947 * nsterm.m (constrainFrameRect): Always constrain when there is only
948 one screen (Bug#10962).
950 2012-04-13 Ken Brown <kbrown@cornell.edu>
952 * s/cygwin.h (PTY_OPEN): Don't try to close a bogus file descriptor.
954 2012-04-13 Reuben Thomas <rrt@sc3d.org>
956 * indent.c (Fmove_to_column): Change interactive spec (Bug#739).
958 2012-04-11 Daniel Colascione <dancol@dancol.org>
960 * s/cygwin.h: The vfork the #define in cygwin.h was protecting
961 against is gone. It's better to use vfork now so that when Cygwin
962 gains a new, working vfork, we use it automatically (bug#10398).
964 2012-04-11 Stefan Monnier <monnier@iro.umontreal.ca>
966 * window.c (save_window_save): Obey window-point-insertion-type.
968 2012-04-11 Glenn Morris <rgm@gnu.org>
970 * Makefile.in (GNUSTEP_CFLAGS): Rename from C_SWITCH_X_SYSTEM.
972 2012-04-11 Stefan Monnier <monnier@iro.umontreal.ca>
974 * alloc.c (lisp_align_malloc): Remove unneeded prototype.
976 2012-04-10 Jason S. Cornez <jcornez@ravenpack.com> (tiny change)
978 * keyboard.c: Override inhibit-quit after the third C-g (bug#6585).
979 (force_quit_count): New var.
980 (handle_interrupt): Use it.
982 2012-04-10 Juanma Barranquero <lekktu@gmail.com>
984 * w32.c (w32_delayed_load): Record the full path of the library
985 being loaded (bug#10424).
987 2012-04-09 Glenn Morris <rgm@gnu.org>
989 * doc.c (Fsnarf_documentation): Check variables, functions are bound,
990 not just in the obarray, before snarfing them. (Bug#11036)
992 * Makefile.in ($(leimdir)/leim-list.el):
993 Pass EMACS rather than BUILT_EMACS.
995 2012-04-09 Teodor Zlatanov <tzz@lifelogs.com>
997 * process.c (make_process):
998 * process.h: Add integer `gnutls_handshakes_tried' member to
1001 * gnutls.h: Add `GNUTLS_EMACS_HANDSHAKES_LIMIT' upper limit.
1002 Add convenience `GNUTLS_LOG2i' macro.
1004 * gnutls.c (gnutls_log_function2i): Convenience log function.
1005 (emacs_gnutls_read): Use new log functions,
1006 `gnutls_handshakes_tried' process member, and
1007 `GNUTLS_EMACS_HANDSHAKES_LIMIT' to limit the number of handshake
1008 attempts per process (connection).
1010 2012-04-09 Chong Yidong <cyd@gnu.org>
1012 * eval.c (Fuser_variable_p, user_variable_p_eh)
1013 (lisp_indirect_variable): Functions deleted.
1014 (Fdefvar): Caller changed.
1016 * callint.c (Finteractive, Fcall_interactively):
1017 * minibuf.c (Fread_variable): Callers changed.
1019 2012-04-09 Eli Zaretskii <eliz@gnu.org>
1021 * xdisp.c (set_cursor_from_row): If the display string appears in
1022 the buffer at position that is closer to point than the position
1023 after the display string, display the cursor on the first glyph of
1024 the display string. Fixes cursor display when a 'display' text
1025 property immediately follows invisible text. (Bug#11094)
1027 2012-04-09 Paul Eggert <eggert@cs.ucla.edu>
1029 composite.c: use 'double' consistently
1030 * composite.c (get_composition_id): Use 'double' consistently
1031 instead of converting 'float' to 'double' and vice versa; this is
1032 easier to understand and avoids a GCC warning.
1034 2012-04-09 Glenn Morris <rgm@gnu.org>
1036 * Makefile.in: Generate leim-list with bootstrap-emacs, in
1037 preparation for dumping it with emacs. (Bug#4789)
1038 (leimdir): New variable.
1039 ($(leimdir)/leim-list.el): New rule.
1040 (emacs$(EXEEXT)): Depend on leim-list.el.
1042 * buffer.c (Qucs_set_table_for_input): Remove. (Bug#9821)
1043 (Fget_buffer_create): Don't call Qucs_set_table_for_input.
1044 (init_buffer_once, syms_of_buffer): Remove Qucs_set_table_for_input.
1046 2012-04-08 Andreas Schwab <schwab@linux-m68k.org>
1048 * lisp.h (struct Lisp_Symbol): Add explicit padding to ensure
1051 2012-04-07 Juanma Barranquero <lekktu@gmail.com>
1053 * xml.c (init_libxml2_functions) [WINDOWSNT]:
1054 Remove unused local variable.
1056 2012-04-07 Paul Eggert <eggert@cs.ucla.edu>
1058 Avoid unnecessary pointer scanning in garbage collection (Bug#10780).
1059 * alloc.c (POINTERS_MIGHT_HIDE_IN_OBJECTS): New macro.
1060 (mark_memory): Mark Lisp_Objects only if pointers might hide in
1061 objects, as mark_maybe_pointer will catch them otherwise.
1062 (GC_LISP_OBJECT_ALIGNMENT): Remove; no longer needed.
1063 * s/gnu-linux.h (GC_LISP_OBJECT_ALIGNMENT) [__mc68000__]: Likewise.
1065 2012-04-07 Paul Eggert <eggert@cs.ucla.edu>
1067 Fix typo that broke non-Windows builds.
1068 * xml.c (libxml2_loaded_p) [!!WINDOWSNT]: 'inine' -> 'inline'.
1070 2012-04-07 Eli Zaretskii <eliz@gnu.org>
1072 Support building on MS-Windows with libxml2.
1074 * makefile.w32-in (OBJ2): Add xml.$(O).
1075 (GLOBAL_SOURCES): Add xml.c.
1076 ($(BLD)/xml.$(O)): New dependency list.
1078 * xml.c (DEF_XML2_FN, LOAD_XML2_FN) [WINDOWSNT]: New macros.
1079 (fn_htmlReadMemory, fn_xmlReadMemory, fn_xmlDocGetRootElement)
1080 (fn_xmlFreeDoc, fn_xmlCleanupParser, fn_xmlCheckVersion)
1081 [!WINDOWSNT]: New macros.
1082 (init_libxml2_functions, libxml2_loaded_p): New functions.
1083 (parse_region): Call fn_xmlCheckVersion instead of using the macro
1084 LIBXML_TEST_VERSION. Call libxml2 functions via the fn_* macros.
1085 (xml_cleanup_parser): New function, export for fn_xmlCleanupParser.
1086 Calls xmlCleanupParser only if libxml2 was loaded (or statically
1088 (Flibxml_parse_html_region, Flibxml_parse_xml_region):
1089 Call init_libxml2_functions before calling libxml2 functions.
1090 (syms_of_xml) <Qlibxml2_dll>: DEFSYM it.
1092 * emacs.c: Don't include libxml/parser.h.
1093 (shut_down_emacs): Call xml_cleanup_parser, instead of calling
1094 xmlCleanupParser directly.
1096 * lisp.h [HAVE_LIBXML2]: Add prototype for xml_cleanup_parser.
1098 2012-04-07 Eli Zaretskii <eliz@gnu.org>
1100 * indent.c (Fvertical_motion): If there is a display string at
1101 point, use it.vpos to compute how many lines to backtrack after
1102 move_it_to point. (Bug#11133)
1104 2012-04-06 Eli Zaretskii <eliz@gnu.org>
1106 * buffer.h (FETCH_CHAR, FETCH_MULTIBYTE_CHAR):
1107 * character.h (STRING_CHAR, STRING_CHAR_AND_LENGTH): Add comments
1108 about subtle differences between FETCH_CHAR* and STRING_CHAR*
1109 macros related to unification of CJK characters. For the details,
1110 see the discussion following the message here:
1111 http://debbugs.gnu.org/cgi/bugreport.cgi?bug=11073#14.
1113 2012-04-04 Chong Yidong <cyd@gnu.org>
1115 * keyboard.c (Vdelayed_warnings_list): Doc fix.
1117 2012-04-01 Eli Zaretskii <eliz@gnu.org>
1119 * w32menu.c (simple_dialog_show, add_menu_item): Use SAFE_ALLOCA
1120 instead of alloca. (Bug#11138)
1122 2012-04-01 Andreas Schwab <schwab@linux-m68k.org>
1124 * w32menu.c (is_simple_dialog): Properly check lisp types.
1127 2012-03-31 Eli Zaretskii <eliz@gnu.org>
1129 * xdisp.c (move_it_by_lines): When DVPOS is positive, and the
1130 position we get to after a call to move_it_to fails the
1131 IS_POS_VALID_AFTER_MOVE_P test, move to the next buffer position
1132 only if we wind up in a string from display property. (Bug#11063)
1134 * window.c (Fdelete_other_windows_internal): Invalidate the row
1135 and column information about mouse highlight, so that redisplay
1136 restores it after reallocating the glyph matrices. (Bug#7464)
1138 * xdisp.c (set_cursor_from_row): If `cursor' property on a display
1139 string comes from a `display' text property, use the buffer
1140 position of that property as if we actually saw that position in
1142 (move_it_by_lines): Remove the assertion that
1143 "it->current_x == 0 && it->hpos == 0" which can be legitimately
1144 violated when there's a before-string at the beginning of a line.
1147 2012-03-30 Eli Zaretskii <eliz@gnu.org>
1149 * xdisp.c (append_space_for_newline): If the default face was
1150 remapped, use the remapped face for the appended newline.
1151 (extend_face_to_end_of_line): Use the remapped default face for
1152 extending the face to the end of the line.
1153 (display_line): Call extend_face_to_end_of_line when the default
1154 face was remapped. (Bug#11068)
1156 2012-03-29 Eli Zaretskii <eliz@gnu.org>
1158 * s/ms-w32.h: Discourage from defining HAVE_GETCWD.
1160 2012-03-28 Stefan Monnier <monnier@iro.umontreal.ca>
1162 * keyboard.c (safe_run_hooks_error): Don't unquote strings.
1164 2012-03-27 Glenn Morris <rgm@gnu.org>
1166 * search.c (Fword_search_backward_lax, Fword_search_forward_lax):
1169 2012-03-26 Kenichi Handa <handa@m17n.org>
1171 * dispextern.h (struct glyph): Fix previous change. Change the
1172 bit length of glyphless.ch to 25 (Bug#11082).
1174 2012-03-26 Chong Yidong <cyd@gnu.org>
1176 * keyboard.c (Vselection_inhibit_update_commands): New variable.
1177 (command_loop_1): Use it; inhibit selection update for
1178 handle-select-window too (Bug#8996).
1180 2012-03-25 Fabrice Popineau <fabrice.popineau@supelec.fr>
1182 * w32heap.c (_heap_init, _heap_term): Remove dead MSVC-specific code.
1184 2012-03-25 Kenichi Handa <handa@m17n.org>
1186 * dispextern.h (struct glyph): Change the bit length of
1187 glyphless.ch to 22 to make the member glyphless fit in 32 bits.
1189 2012-03-24 Eli Zaretskii <eliz@gnu.org>
1191 * s/ms-w32.h (tzname): Include time.h before redirecting to
1192 _tzname. Fixes the MSVC build. (Bug#9960)
1194 2012-03-24 Andreas Schwab <schwab@linux-m68k.org>
1196 * xdisp.c (produce_glyphless_glyph): Limit length of acronym to 6
1199 * xterm.c (XTread_socket): Only modify handling_signal if
1200 !SYNC_INPUT. (Bug#11080)
1202 2012-03-23 Eli Zaretskii <eliz@gnu.org>
1204 * bidi.c (bidi_fetch_char): Use STRING_CHAR_AND_LENGTH instead of
1205 FETCH_MULTIBYTE_CHAR followed by CHAR_BYTES. Prevents crashes
1206 when fetching a multibyte character consumes more bytes than
1207 CHAR_BYTES returns, due to unification of CJK characters in
1208 string_char. (Bug#11073)
1210 2012-03-23 Troels Nielsen <bn.troels@gmail.com> (tiny change)
1212 * process.c (wait_reading_process_output): Handle pty disconnect
1213 by refraining from sending oneself a SIGCHLD (bug#10933).
1215 2012-03-22 Chong Yidong <cyd@gnu.org>
1217 * dispextern.h (struct it): New member string_from_prefix_prop_p.
1219 * xdisp.c (push_prefix_prop): Rename from push_display_prop.
1220 Mark string as coming from a prefix property.
1221 (handle_face_prop): Use default face for prefix strings (Bug#4281).
1222 (pop_it, reseat_1): Save and restore string_from_prefix_prop_p.
1224 2012-03-21 Chong Yidong <cyd@gnu.org>
1226 * xfaces.c (Vface_remapping_alist): Doc fix.
1228 2012-03-20 Eli Zaretskii <eliz@gnu.org>
1230 * w32proc.c (Fw32_set_console_codepage)
1231 (Fw32_set_console_output_codepage, Fw32_get_codepage_charset):
1234 2012-03-20 Chong Yidong <cyd@gnu.org>
1236 * dispnew.c (Fredisplay, Vredisplay_preemption_period): Update doc
1237 to reflect default non-nil value of redisplay-dont-pause.
1239 2012-03-19 Kenichi Handa <handa@m17n.org>
1241 * ftfont.c (ftfont_drive_otf): Mask bits of character code to make
1242 it fit in a valid range (Bug#11003).
1244 2012-03-18 Eli Zaretskii <eliz@gnu.org>
1246 * xdisp.c (cursor_row_p): Even if the glyph row ends in a string
1247 that is not from display property, accept the row as a "cursor
1248 row" if one of the string's character has a non-nil `cursor'
1249 property. Fixes cursor positioning when there are newlines in
1250 overlay strings, e.g. in icomplete.el. (Bug#11035)
1252 2012-03-12 Paul Eggert <eggert@cs.ucla.edu>
1254 * buffer.c (compare_overlays): Don't assume args differ (Bug#6830).
1256 2012-03-12 Chong Yidong <cyd@gnu.org>
1258 * eval.c (inhibit_lisp_code): Rename from
1259 inhibit_window_configuration_change_hook; move from window.c.
1261 * xfns.c (unwind_create_frame_1, Fx_create_frame):
1262 * window.c (run_window_configuration_change_hook)
1263 (syms_of_window): Callers changed.
1265 2012-03-11 Chong Yidong <cyd@gnu.org>
1267 * keymap.c (Fkey_description): Doc fix (Bug#9700).
1269 * editfns.c (Fconstrain_to_field): Doc fix (Bug#9452).
1271 2012-03-10 Chong Yidong <cyd@gnu.org>
1273 * frame.c (other_visible_frames): Don't assume the selected frame
1274 is visible (Bug#10955).
1276 2012-03-09 Stefan Monnier <monnier@iro.umontreal.ca>
1278 * buffer.c (compare_overlays): Avoid qsort's instability (bug#6830).
1280 2012-03-08 Jan Djärv <jan.h.d@swipnet.se>
1282 * gtkutil.c (x_wm_set_size_hint): Use one row in call to
1283 FRAME_TEXT_LINES_TO_PIXEL_HEIGHT so base_height is greater than
1286 2012-03-03 Glenn Morris <rgm@gnu.org>
1288 * alloc.c (Fgarbage_collect, misc-objects-consed): Doc fixes.
1290 2012-03-02 Eli Zaretskii <eliz@gnu.org>
1292 * xdisp.c (try_window_reusing_current_matrix): Don't move cursor
1293 position past the first glyph_row that ends at ZV. (Bug#10902)
1294 (redisplay_window, next_element_from_string): Fix typos in
1296 (redisplay_window): Pass to move_it_vertically the margin in
1297 pixels, not in screen lines.
1299 2012-03-02 Glenn Morris <rgm@gnu.org>
1301 * buffer.c (buffer-list-update-hook): Doc fix.
1303 2012-02-29 Eli Zaretskii <eliz@gnu.org>
1305 * xdisp.c (get_overlay_strings_1): Under bidi redisplay, call
1306 push_it before setting up the iterator for the first overlay
1307 string, even if we have an empty string loaded.
1308 (next_overlay_string): If there's an empty string on the iterator
1309 stack, pop the stack. (Bug#10903)
1311 2012-02-25 Paul Eggert <eggert@cs.ucla.edu>
1313 Generalize fix for crash due to non-contiguous EMACS_INT (Bug#10780).
1314 Suggested by Stefan Monnier in
1315 <http://lists.gnu.org/archive/html/emacs-devel/2012-02/msg00692.html>.
1316 * alloc.c (widen_to_Lisp_Object): New static function.
1317 (mark_memory): Also mark Lisp_Objects by fetching pointer words
1318 and widening them to Lisp_Objects. This would work even if
1319 USE_LSB_TAG is defined and wide integers are used, which might
1320 happen in a future version of Emacs.
1322 2012-02-25 Chong Yidong <cyd@gnu.org>
1324 * fileio.c (Ffile_selinux_context, Fset_file_selinux_context):
1327 * xselect.c (Fx_selection_exists_p): Doc fix.
1328 (x_clipboard_manager_save_all): Print an informative message
1329 before saving to clipboard manager.
1331 2012-02-24 Chong Yidong <cyd@gnu.org>
1333 * keyboard.c (process_special_events): Handle all X selection
1334 requests in kbd_buffer, not just the next one (Bug#8869).
1336 2012-02-23 Chong Yidong <cyd@gnu.org>
1338 * xfns.c (Fx_create_frame): Avoid window-configuration-change-hook
1339 call when setting menu-bar-lines and tool-bar-lines parameters.
1340 (unwind_create_frame_1): New helper function.
1342 * window.c (inhibit_window_configuration_change_hook): New var.
1343 (run_window_configuration_change_hook): Obey it.
1344 (syms_of_window): Initialize it.
1346 2012-02-22 Chong Yidong <cyd@gnu.org>
1348 * xterm.c (x_draw_image_relief): Add missing type check for
1349 Vtool_bar_button_margin (Bug#10743).
1351 2012-02-21 Chong Yidong <cyd@gnu.org>
1353 * fileio.c (Vfile_name_handler_alist): Doc fix.
1355 * buffer.c (Fget_file_buffer): Protect against invalid file
1356 handler return value.
1358 2012-02-20 Paul Eggert <eggert@cs.ucla.edu>
1360 * .gdbinit (xreload): Don't assume EMACS_INT fits in 'long'
1361 when computing $valmask.
1363 Fix crash due to non-contiguous EMACS_INT (Bug#10780).
1364 * lisp.h (VALBITS): Move definition up, so that USE_LSB_TAG can use it.
1365 (USE_LSB_TAG): Do not define if UINTPTR_MAX >> VALBITS == 0.
1366 It's useless in that case, and it can cause problems on hosts
1367 that allocate halves of EMACS_INT values separately.
1368 Reported by Dan Horák. Diagnosed by Andreas Schwab in
1369 <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=10780#30>.
1370 * mem-limits.h (EXCEEDS_LISP_PTR): Define to 0 on hosts where
1371 UINTPTR_MAX >> VALBITS == 0. This is required by the above change;
1372 it avoids undefined behavior on hosts where shifting right by more
1373 than the word width has undefined behavior.
1375 2012-02-19 Chong Yidong <cyd@gnu.org>
1377 * fileio.c (Ffile_name_directory, Ffile_name_nondirectory)
1378 (Funhandled_file_name_directory, Ffile_name_as_directory)
1379 (Fdirectory_file_name, Fexpand_file_name)
1380 (Fsubstitute_in_file_name): Protect against invalid file handler
1381 return values (Bug#10845).
1383 2012-02-18 Eli Zaretskii <eliz@gnu.org>
1385 * .gdbinit (pitx): Fix incorrect references to fields of the
1388 2012-02-17 Chong Yidong <cyd@gnu.org>
1390 * syntax.c (Fscan_lists): Doc fix (Bug#10833).
1392 2012-02-15 Paul Eggert <eggert@cs.ucla.edu>
1394 * image.c (MAX_IMAGE_SIZE): Increase from 6.0 to 10.0; see
1395 <http://lists.gnu.org/archive/html/emacs-devel/2012-02/msg00540.html>.
1397 2012-02-15 Chong Yidong <cyd@gnu.org>
1399 * eval.c (Fdefvar, Fdefconst): Doc fix; note that the variable is
1400 marked as special. Also, starting docstrings with * is obsolete.
1402 2012-02-13 Andreas Schwab <schwab@linux-m68k.org>
1404 * gnutls.c (emacs_gnutls_write): Fix last change.
1406 2012-02-13 Lars Ingebrigtsen <larsi@gnus.org>
1408 * gnutls.c (emacs_gnutls_write): Set errno appropriately for
1411 2012-02-13 Stefan Monnier <monnier@iro.umontreal.ca>
1413 * keymap.c (Fsingle_key_description): Handle char ranges.
1415 2012-02-12 Chong Yidong <cyd@gnu.org>
1417 * xdisp.c (handle_stop): Avoid assigning -1 to it->face_id here,
1418 as that creates a dangerous corner case.
1420 * window.c (Fdelete_window_internal): Invalidate the mouse
1421 highlight (Bug#9904).
1423 2012-02-12 Glenn Morris <rgm@gnu.org>
1425 * xselect.c (Fx_own_selection_internal)
1426 (Fx_get_selection_internal, Fx_disown_selection_internal)
1427 (Fx_selection_owner_p, Fx_selection_exists_p): Doc fixes.
1428 * nsselect.m (Fx_own_selection_internal)
1429 (Fx_disown_selection_internal, Fx_selection_exists_p)
1430 (Fx_selection_owner_p, Fx_get_selection_internal):
1431 Sync docs and argument specs with the xselect.c versions.
1433 2012-02-11 Lars Ingebrigtsen <larsi@gnus.org>
1435 * gnutls.c (emacs_gnutls_write): Don't infloop if sendto fails.
1437 2012-02-11 Eli Zaretskii <eliz@gnu.org>
1439 * w32select.c (Fx_selection_exists_p): Sync doc string and
1440 argument list with xselect.c. (Bug#10783)
1442 * w16select.c (Fx_selection_exists_p): Sync doc string and
1443 argument list with xselect.c. (Bug#10783)
1445 2012-02-10 Glenn Morris <rgm@gnu.org>
1447 * fns.c (Fsecure_hash): Doc fix.
1449 2012-02-09 Kenichi Handa <handa@m17n.org>
1451 * coding.c (produce_chars): Fix updating of src_end (Bug#10701).
1453 2012-02-07 Chong Yidong <cyd@gnu.org>
1455 * buffer.c (Fbuffer_local_variables)
1456 (buffer_lisp_local_variables): Handle unbound vars correctly;
1457 don't let Qunbound leak into Lisp.
1459 2012-02-07 Glenn Morris <rgm@gnu.org>
1461 * image.c (Fimagemagick_types): Doc fix.
1463 * image.c (imagemagick-render-type): Change it from a lisp object
1464 to an integer. Move the doc here from the lisp manual.
1465 Treat all values not equal to 0 the same.
1467 2012-02-06 Chong Yidong <cyd@gnu.org>
1469 * doc.c (store_function_docstring): Avoid applying docstring of
1470 alias to base function (Bug#2603).
1472 2012-02-04 Andreas Schwab <schwab@linux-m68k.org>
1474 * .gdbinit (pp1, pv1): Remove redundant defines.
1477 2012-02-04 Chong Yidong <cyd@gnu.org>
1479 * nsterm.m: Declare a global (Bug#10694).
1481 2012-02-04 Eli Zaretskii <eliz@gnu.org>
1483 * w32.c (get_emacs_configuration_options):
1484 Include --enable-checking, if specified, in the return value.
1486 2012-02-04 Martin Rudalics <rudalics@gmx.at>
1488 * dispnew.c (change_frame_size_1): Calculate new_frame_total_cols
1489 after rounding frame sizes. (Bug#9723)
1491 2012-02-04 Eli Zaretskii <eliz@gnu.org>
1493 * keyboard.c (adjust_point_for_property): Don't position point
1494 before BEGV. (Bug#10696)
1496 2012-02-03 Paul Eggert <eggert@cs.ucla.edu>
1498 Handle overflow when computing char display width (Bug#9496).
1499 * character.c (char_width): Return EMACS_INT, not int.
1500 (char_width, c_string_width): Check for overflow when
1501 computing the width; this is possible now that individual
1502 characters can have unbounded width. Problem introduced
1503 by merge from Emacs 23 on 2012-01-19.
1505 2012-02-02 Michael Albinus <michael.albinus@gmx.de>
1507 * dbusbind.c (Fdbus_register_method): Mention the return value
1508 :ignore in the docstring.
1510 2012-02-02 Glenn Morris <rgm@gnu.org>
1512 * callproc.c (Fcall_process, Fcall_process_region): Doc fix.
1514 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
1515 Unconditionally set to t. (Bug#10673)
1516 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
1517 * w32term.c (syms_of_w32term) <x-toolkit-scroll-bars>:
1518 * xterm.c (syms_of_xterm) <x-toolkit-scroll-bars>: Doc fix.
1520 2012-02-02 Kenichi Handa <handa@m17n.org>
1522 (x_produce_glyphs): Cancel previous change. If cmp->glyph_len is
1523 0, do not call append_composite_glyph.
1525 2012-02-02 Kenichi Handa <handa@m17n.org>
1527 * xdisp.c (BUILD_COMPOSITE_GLYPH_STRING): Initialize first_s to
1529 (x_produce_glyphs): If the component of a composition is a null
1530 string, set it->pixel_width to 1 to avoid zero-width glyph.
1532 2012-02-01 Eli Zaretskii <eliz@gnu.org>
1534 * ralloc.c (resize_bloc, r_alloc_sbrk): Don't call memmove if its
1535 first 2 arguments are identical. This makes inserting large
1536 output from a subprocess an order of magnitude faster on
1537 MS-Windows, where all sbrk'ed memory is always contiguous.
1539 2012-01-31 Glenn Morris <rgm@gnu.org>
1541 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
1542 * w32term.c (syms_of_w32term) <x-toolkit-scroll-bars>:
1543 * xterm.c (syms_of_xterm) <x-toolkit-scroll-bars>: Sync docs.
1545 2012-01-29 Glenn Morris <rgm@gnu.org>
1547 * gnutls.c (syms_of_gnutls): More doc (from etc/NEWS).
1549 2012-01-28 Samuel Thibault <sthibault@debian.org> (tiny change)
1551 * s/gnu.h: Define POSIX_SIGNALS (Bug#10552).
1553 2012-01-28 Chong Yidong <cyd@gnu.org>
1555 * minibuf.c (syms_of_minibuf): Doc fix (Bug#10550).
1557 2012-01-26 Chong Yidong <cyd@gnu.org>
1559 * keyboard.c (Vecho_keystrokes): Document zero value (Bug#10503).
1561 * search.c (Fsearch_forward, Fsearch_backward): Document negative
1562 repeat counts (Bug#10507).
1564 2012-01-26 Glenn Morris <rgm@gnu.org>
1566 * lread.c (syms_of_lread): Doc fix.
1568 2012-01-25 HIROSHI OOTA <nil@mad.dog.cx> (tiny change)
1570 * coding.c (encode_designation_at_bol): Change return value to
1573 2012-01-25 Chong Yidong <cyd@gnu.org>
1575 * eval.c (Fuser_variable_p): Doc fix; mention custom-variable-p.
1577 2012-01-21 Chong Yidong <cyd@gnu.org>
1579 * floatfns.c (Fcopysign): Make the second argument non-optional,
1580 since nil is not allowed anyway.
1582 2012-01-21 Andreas Schwab <schwab@linux-m68k.org>
1584 * process.c (read_process_output): Use p instead of XPROCESS (proc).
1585 (send_process): Likewise.
1587 2012-01-19 Martin Rudalics <rudalics@gmx.at>
1589 * window.c (save_window_save, Fcurrent_window_configuration)
1590 (Vwindow_persistent_parameters): Do not use Qstate.
1591 Rewrite doc-strings.
1593 2012-01-19 Kenichi Handa <handa@m17n.org>
1595 * character.c (char_width): New function.
1596 (Fchar_width, c_string_width, lisp_string_width):
1597 Use char_width (Bug#9496).
1599 2012-01-16 Martin Rudalics <rudalics@gmx.at>
1601 * window.c (Vwindow_persistent_parameters): New variable.
1602 (Fset_window_configuration, save_window_save): Handle persistent
1605 2012-01-14 Eli Zaretskii <eliz@gnu.org>
1607 * w32fns.c (signal_user_input): Don't do a QUIT, to avoid
1608 thrashing the stack of the thread. (Bug#9087)
1610 2012-01-12 Paul Eggert <eggert@cs.ucla.edu>
1612 * xdisp.c (rows_from_pos_range): Add parens as per gcc -Wparentheses.
1614 2012-01-11 Eli Zaretskii <eliz@gnu.org>
1616 * xdisp.c (rows_from_pos_range): Handle the case where the
1617 highlight ends on a newline. (Bug#10464)
1618 (mouse_face_from_buffer_pos): Fix off-by-one error in calculating
1619 he end column for display of highlight that ends on a newline
1622 2012-01-11 Glenn Morris <rgm@gnu.org>
1624 * lread.c (init_lread): If no-site-lisp, remove site-lisp dirs
1625 from load-path also when installation-directory is nil. (Bug#10208)
1627 2012-01-10 Glenn Morris <rgm@gnu.org>
1629 * emacs.c (syms_of_emacs) <installation-directory>: Doc fix.
1631 * epaths.in (PATH_LOADSEARCH, PATH_EXEC, PATH_DATA, PATH_DOC):
1632 Update template values to be closer to their typical values these days.
1634 2012-01-09 Eli Zaretskii <eliz@gnu.org>
1636 * xdisp.c (rows_from_pos_range): Accept additional argument
1637 DISP_STRING, and accept any glyph in a row whose object is that
1638 string as eligible for mouse highlight. Fixes mouse highlight of
1639 display strings from overlays. (Bug#10464)
1641 2012-01-07 Paul Eggert <eggert@cs.ucla.edu>
1643 emacs: fix an auto-save permissions race condition (Bug#10400)
1644 * fileio.c (auto_saving_dir_umask): New static var.
1645 (Fmake_directory_internal): Use it.
1646 (do_auto_save_make_dir): Set it, instead of invoking chmod after
1647 creating the directory. The old code temporarily assigns
1648 too-generous permissions to the directory.
1649 (do_auto_save_eh): Clear it.
1650 (Fdo_auto_save): Catch all errors, not just file errors, so
1651 that the var is always cleared.
1653 2012-01-07 Eli Zaretskii <eliz@gnu.org>
1655 * search.c (scan_buffer): Pass character positions to
1656 know_region_cache, not byte positions. (Bug#6540)
1658 2012-01-07 LynX <_LynX@bk.ru> (tiny change)
1660 * w32.c (sys_rename): Report EXDEV when rename of a directory
1661 fails because the target is on another logical disk. (Bug#10284)
1663 2012-01-07 David Benjamin <davidben@mit.edu> (tiny change)
1665 * xterm.c (x_embed_request_focus): New function.
1667 * xterm.h: Add prototype.
1669 * xfns.c (Fx_focus_frame): Use it for embedded frames (Bug#9977).
1671 2012-01-05 Glenn Morris <rgm@gnu.org>
1673 * emacs.c (emacs_copyright): Update short copyright year to 2012.
1675 2012-01-01 Eli Zaretskii <eliz@gnu.org>
1677 * gnutls.c (init_gnutls_functions): Load gnutls_check_version.
1678 Load gnutls_transport_set_lowat only if GnuTLS version is below
1680 (emacs_gnutls_handshake): Call gnutls_transport_set_lowat only for
1681 GnuTLS versions below 2.11.1.
1683 2011-12-31 Antoine Levitt <antoine.levitt@gmail.com>
1685 * xdisp.c (syms_of_xdisp) <window-scroll-functions>: Add warning
1686 to the doc string advising against its use for altering the way
1687 windows are scrolled.
1689 2011-12-28 Kenichi Handa <handa@m17n.org>
1691 * coding.c (Fdefine_coding_system_internal): Make an utf-8 base
1692 coding-system ASCII compatible only when it does not produce BOM
1693 on encoding (Bug#10383).
1695 2011-12-26 Jan Djärv <jan.h.d@swipnet.se>
1697 * xmenu.c (x_menu_wait_for_event): Use xg_select for Gtk3 so menus
1699 (create_and_show_popup_menu): Always use menu_position_func for
1702 2011-12-24 Andreas Schwab <schwab@linux-m68k.org>
1704 * callint.c (Fcall_interactively): Don't truncate prompt string.
1706 2011-12-23 Eli Zaretskii <eliz@gnu.org>
1708 * xdisp.c (handle_invisible_prop): Handle correctly an invisible
1709 property that ends at ZV, so that the bidi iteration could be
1710 resumed from there (after widening). (Bug#10360)
1712 2011-12-22 Jan Djärv <jan.h.d@swipnet.se>
1714 * nsfont.m (ns_spec_to_descriptor): Do not autorelease fdesc.
1716 2011-12-21 Jan Djärv <jan.h.d@swipnet.se>
1718 * nsterm.m (x_free_frame_resources):
1719 Release f->output_data.ns->miniimage.
1720 (ns_index_color): Fix indentation. Do not retain
1721 color_table->colors[i].
1723 * nsmenu.m (ns_update_menubar): Call free_menubar_widget_value_tree
1726 * nsfns.m (x_set_background_color): Assign return value from
1727 ns_index_color to face-background instead of NSColor*.
1728 (ns_implicitly_set_icon_type): Fix indentation.
1729 Change assignment in for loop to comparison.
1731 * emacs.c (ns_pool): New variable.
1732 (main): Assign ns_pool.
1733 (Fkill_emacs): Call ns_release_autorelease_pool.
1735 * nsfont.m (ns_spec_to_descriptor): Fix indentation,
1736 autorelease fdesc, release fdAttrs and tdict.
1737 (ns_get_covering_families): Release charset.
1738 (ns_findfonts): Release NSFontDescriptor created with new.
1739 (ns_uni_to_glyphs): Fix indentation.
1740 (setString): Release attrStr before assigning new value.
1742 2011-12-18 Jan Djärv <jan.h.d@swipnet.se>
1744 * nsmenu.m (NSMenuDidBeginTrackingNotification): Declare if OSX < 10.5
1746 (trackingNotification): Surround with ifdef NS_IMPL_COCOA.
1747 (syms_of_nsmenu): Set trackingMenu to 1 if not NS_IMPL_COCOA.
1749 2011-12-18 David Reitter <reitter@cmu.edu>
1751 * nsterm.m (ns_term_init): Subscribe for notifications
1752 NSMenuDidBeginTrackingNotification and NSMenuDidEndTrackingNotification
1753 to method trackingNotification in EmacsMenu.
1755 * nsmenu.m (trackingMenu): New variable.
1756 (trackingNotification): New method (from Aquamacs).
1757 (menuNeedsUpdate): Expand comment and return if trackingMenu is 0,
1758 from Aquamacs (Bug#7030).
1760 2011-12-18 Jan Djärv <jan.h.d@swipnet.se>
1762 * nsselect.m (CUT_BUFFER_SUPPORT): Remove define.
1763 (symbol_to_nsstring): Fix indentation.
1764 (ns_symbol_to_pb): New function.
1765 (Fns_get_selection_internal): Rename from Fns_get_cut_buffer_internal.
1766 (Fns_rotate_cut_buffers_internal): Remove.
1767 (Fns_store_selection_internal): Rename from
1768 Fns_store_cut_buffer_internal.
1769 (ns_get_foreign_selection, Fx_own_selection_internal)
1770 (Fx_disown_selection_internal, Fx_selection_exists_p)
1771 (Fns_get_selection_internal, Fns_store_selection_internal):
1772 Use ns_symbol_to_pb and check if return value is nil.
1773 (syms_of_nsselect): Remove ifdef CUT_BUFFER_SUPPORT. Remove defsubr
1774 Sns_rotate_cut_buffers_internal. Sns_get_cut_buffer_internal
1775 renamed to Sns_get_selection_internal, Sns_store_cut_buffer_internal
1776 renamed to Sns_store_selection_internal.
1777 (ns_handle_selection_request): Move code to Fx_own_selection_internal
1778 and remove this function.
1779 (ns_handle_selection_clear): Remove, never used.
1780 (Fx_own_selection_internal): Move code from ns_handle_selection_request
1783 2011-12-17 Ken Brown <kbrown@cornell.edu>
1785 * fileio.c (check_writable) [CYGWIN]: Return non-zero if UID or
1786 GID is unknown (Bug#10257).
1788 2011-12-17 Paul Eggert <eggert@cs.ucla.edu>
1790 * s/gnu-linux.h: Fix mark_memory typo (Bug#10286).
1791 (GC_MARK_SECONDARY_STACK): Omit removed 3rd arg to mark_memory,
1792 which caused a build failure on GNU/Linux IA-64. This problem was
1793 introduced by my 2011-10-07 patch.
1795 2011-12-15 Juri Linkov <juri@jurta.org>
1797 * image.c (imagemagick_error): New function. (Bug#10112)
1798 (imagemagick_load_image): Comment out `MagickSetResolution' call.
1799 Use `imagemagick_error' where ImageMagick functions return
1801 (Fimagemagick_types): Add `Fnreverse' to return the list in the
1804 2011-12-15 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
1806 * xftfont.c (xftfont_draw): Use the font metrics of s->font to
1807 fill background (Bug#8992).
1809 2011-12-13 Martin Rudalics <rudalics@gmx.at>
1811 * window.c (Vwindow_combination_resize)
1812 (Vwindow_combination_limit): Use t instead of non-nil in
1814 (Vrecenter_redisplay): Add first sentence of doc-string on
1816 (Frecenter): Fix doc-string typo.
1818 2011-12-11 Kenichi Handa <handa@m17n.org>
1820 * coding.c (Funencodable_char_position): Pay attention to the
1821 buffer text relocation (Bug#9389).
1823 2011-12-10 Jan Djärv <jan.h.d@swipnet.se>
1825 * xterm.c (x_term_init): Move call to gdk_window_add_filter before
1826 gtk_init (Bug#10100).
1828 2011-12-10 Eli Zaretskii <eliz@gnu.org>
1830 * xdisp.c (RECORD_MAX_MIN_POS): Use IT->cmp_it.charpos only if
1831 IT->string is nil. (Bug#10263)
1833 2011-12-10 Jan Djärv <jan.h.d@swipnet.se>
1835 * nsterm.h (x_free_frame_resources): Declare.
1837 * nsfns.m (ns_get_defaults_value): New function (Bug#10103).
1838 (Fns_get_resource, x_get_string_resource): Call ns_get_defaults_value.
1840 * nsterm.h (ns_get_defaults_value): Declare.
1842 * nsterm.m (ns_default): Call ns_get_defaults_value.
1844 2011-12-09 Eli Zaretskii <eliz@gnu.org>
1846 * xdisp.c (try_scrolling): Don't set scroll_down_p if dy is zero.
1849 2011-12-09 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
1851 * unexelf.c (unexec) [NS_IMPL_GNUSTEP]: Take account of the case
1852 that where the value of an _OBJC_* symbol points to is in the .bss
1853 section (Bug#10240).
1855 2011-12-08 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
1857 * coding.c (encode_coding_ccl): Check (charbuf < charbuf_end)
1858 after the loop to call ccl_driver at least once (Bug#8619).
1860 2011-12-08 Kenichi Handa <handa@m17n.org>
1862 * ftfont.c (get_adstyle_property): Fix previous change
1865 2011-12-07 Juanma Barranquero <lekktu@gmail.com>
1867 * w32.c (init_environment): If no_site_lisp, remove site-lisp
1868 dirs from the default value of EMACSLOADPATH (bug#10208).
1870 2011-12-07 Glenn Morris <rgm@gnu.org>
1872 * lread.c (init_lread): If no_site_lisp, exclude site-lisp/ in
1873 installation and source directories as well. (Bug#10208)
1875 2011-12-06 Chong Yidong <cyd@gnu.org>
1877 * minibuf.c (Fread_from_minibuffer): Doc fix (Bug#10228).
1879 2011-12-06 Glenn Morris <rgm@gnu.org>
1881 * process.c (start_process_unwind): Treat any pid <= 0, except -2,
1882 as an error, not just -1. (Bug#10217)
1884 2011-12-05 Chong Yidong <cyd@gnu.org>
1886 * keyboard.c (process_special_events): New function.
1887 (swallow_events, Finput_pending_p): Use it (Bug#10195).
1889 2011-12-05 Paul Eggert <eggert@cs.ucla.edu>
1891 * coding.c (encode_designation_at_bol): Don't use uninitialized
1892 local variable (Bug#9318).
1894 2011-12-05 Kenichi Handa <handa@m17n.org>
1896 * ftfont.c (get_adstyle_property): If the font is not BDF nor PCF,
1897 return Qnil (Bug#8046, Bug#10193).
1899 2011-12-05 Kenichi Handa <handa@m17n.org>
1901 * coding.c (encode_designation_at_bol): New args charbuf_end and
1902 dst. Return the number of produced bytes. Callers changed.
1903 (coding_set_source): Return how many bytes coding->source was
1905 (coding_set_destination): Return how many bytes
1906 coding->destination was relocated.
1907 (CODING_DECODE_CHAR, CODING_ENCODE_CHAR, CODING_CHAR_CHARSET)
1908 (CODING_CHAR_CHARSET_P): Adjust for the avove changes.
1910 2011-12-05 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
1912 * coding.c (CODING_CHAR_CHARSET_P): New macro.
1913 (encode_coding_emacs_mule, encode_coding_iso_2022): Use the above
1916 2011-12-05 Andreas Schwab <schwab@linux-m68k.org>
1918 The following changes are to fix Bug#9318.
1920 * coding.c (CODING_ENCODE_CHAR, CODING_CHAR_CHARSET): New macros.
1921 (encode_coding_emacs_mule, ENCODE_ISO_CHARACTER)
1922 (encode_coding_iso_2022, encode_coding_sjis)
1923 (encode_coding_big5, encode_coding_charset): Use the above macros.
1925 2011-12-05 Juanma Barranquero <lekktu@gmail.com>
1927 * lisp.h (process_quit_flag): Fix external declaration.
1929 2011-12-04 Stefan Monnier <monnier@iro.umontreal.ca>
1931 Don't macro-inline non-performance-critical code.
1932 * eval.c (process_quit_flag): New function.
1933 * lisp.h (QUIT): Use it.
1935 2011-12-04 Jan Djärv <jan.h.d@swipnet.se>
1937 * nsfns.m (get_geometry_from_preferences): New function.
1938 (Fx_create_frame): Call get_geometry_from_preferences (Bug#10103).
1940 2011-12-04 Andreas Schwab <schwab@linux-m68k.org>
1942 * emacs.c (Qkill_emacs): Define.
1943 (syms_of_emacs): Initialize it.
1944 * keyboard.c (interrupt_signal): Don't call Fkill_emacs here, set
1945 Qquit_flag to `kill-emacs' instead.
1946 (quit_throw_to_read_char): Add parameter `from_signal'.
1947 All callers changed. Call Fkill_emacs if requested and safe.
1948 * lisp.h (QUIT): Call Fkill_emacs if requested.
1950 2011-12-03 Jan Djärv <jan.h.d@swipnet.se>
1952 * widget.c (update_wm_hints): Return if wmshell is null.
1953 (widget_update_wm_size_hints): New function.
1955 * widget.h (widget_update_wm_size_hints): Declare.
1957 * xterm.c (x_wm_set_size_hint): If USE_X_TOOLKIT, call
1958 widget_update_wm_size_hints (Bug#10104).
1960 2011-12-03 Eli Zaretskii <eliz@gnu.org>
1962 * xdisp.c (handle_invisible_prop): If the invisible text ends just
1963 before a newline, prepare the bidi iterator for consuming the
1964 newline, and keep the current paragraph direction. (Bug#10183)
1965 (redisplay_window): Don't let `margin' become negative. (Bug#10192)
1967 2011-12-02 Juri Linkov <juri@jurta.org>
1969 * search.c (Fword_search_regexp): New Lisp function created from
1970 `wordify'. Change type of arg `lax' from `int' to `Lisp_Object'.
1971 (Fword_search_backward, Fword_search_forward)
1972 (Fword_search_backward_lax, Fword_search_forward_lax):
1973 Use `Fword_search_regexp' instead of `wordify'. Doc fix.
1974 (syms_of_search): Define `Sword_search_regexp'. (Bug#10145)
1976 2011-12-01 Stefan Monnier <monnier@iro.umontreal.ca>
1978 * fileio.c (Finsert_file_contents): Move after-change-function call
1979 to before the "handled:" label, since all "goto handled" appear in
1980 cases where the *-change-functions have already been properly called
1983 2011-12-01 Andreas Schwab <schwab@linux-m68k.org>
1985 * keyboard.c (interrupt_signal): Don't call kill-emacs when
1986 waiting for input. (Bug#10169)
1988 2011-11-30 Eli Zaretskii <eliz@gnu.org>
1990 * dispnew.c (adjust_glyph_matrix): Remove the assertion that
1991 verifies glyph row's hash code--we have just reallocated the
1992 glyphs, so their contents can be complete garbage. (Bug#10164)
1994 2011-11-30 Juanma Barranquero <lekktu@gmail.com>
1996 * dispnew.c (adjust_glyph_matrix) [XASSERTS]: Add missing check.
1998 2011-11-30 Eli Zaretskii <eliz@gnu.org>
2000 * dispnew.c (adjust_glyph_matrix) [XASSERTS]: Ensure ROW's
2001 attributes are tested _before_ calling verify_row_hash, to protect
2002 against GCC re-ordering of the tests. (Bug#10164)
2004 2011-11-29 Jan Djärv <jan.h.d@swipnet.se>
2006 * xterm.h (struct x_output): net_wm_state_hidden_seen is new.
2008 * xterm.c (handle_one_xevent): Only set async_visible and friends
2009 if net_wm_state_hidden_seen is non-zero (Bug#10002)
2010 (get_current_wm_state): Set net_wm_state_hidden_seen to 1 if
2011 _NET_WM_STATE_HIDDEN is in NET_WM_STATE.
2013 2011-11-28 Paul Eggert <eggert@cs.ucla.edu>
2015 Remove GCPRO-related macros that exist only to avoid shadowing locals.
2016 * lisp.h (GCPRO1_VAR, GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR, GCPRO5_VAR)
2017 (GCPRO6_VAR, UNGCPRO_VAR): Remove. See
2018 <http://lists.gnu.org/archive/html/emacs-diffs/2011-11/msg00265.html>.
2019 All uses changed to use GCPRO1 etc.
2020 (GCPRO1, GCPRO2, GCPRO3, GCPRO4, GCPRO5, GCPRO6, UNGCPRO):
2021 Revert to old implementation (i.e., before 2011-03-11).
2023 2011-11-28 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
2025 * dispnew.c (scrolling_window): Truncate overlaps in copy destination
2026 of scroll runs so as to avoid assigning disabled bogus rows and
2027 unnecessary graphics copy operations.
2029 2011-11-27 Eli Zaretskii <eliz@gnu.org>
2031 * s/ms-w32.h (utimbuf) [_MSC_VER]: Don't define.
2032 (snprintf) [_MSC_VER]: Redirect to _snprintf.
2033 (strtoll) [_MSC_VER]: Redirect to _strtoi64.
2034 (malloc, free, realloc, calloc): Redirect to e_* only when
2037 * lisp.h (GCTYPEBITS): Move before first use.
2038 (ALIGN_GCTYPEBITS) [_MSC_VER]: Define.
2039 (DECL_ALIGN) [_MSC_VER]: Use it, as MSVC doesn't like bit ops in
2040 this macro definition.
2042 * s/ms-w32.h (tzname): Redirect to _tzname for all values of
2045 2011-11-27 Jan Djärv <jan.h.d@swipnet.se>
2047 * gtkutil.c (xg_create_frame_widgets):
2048 Call gtk_window_set_has_resize_grip (FALSE) if that function is
2049 present with Gtk+ 2.0.
2051 2011-11-26 Paul Eggert <eggert@cs.ucla.edu>
2053 * fileio.c (Finsert_file_contents): Undo previous change; see
2054 <http://lists.gnu.org/archive/html/emacs-diffs/2011-11/msg00265.html>.
2056 2011-11-26 Paul Eggert <eggert@cs.ucla.edu>
2058 Rename locals to avoid shadowing.
2059 * fileio.c (Finsert_file_contents):
2060 Rename inner 'gcpro1' to 'inner_gcpro1' to avoid shadowing.
2061 * process.c (wait_reading_process_output):
2062 Rename inner 'proc' to 'p' to avoid shadowing.
2063 Indent for consistency with usual Emacs style.
2065 2011-11-25 Eli Zaretskii <eliz@gnu.org>
2067 * xdisp.c (redisplay_window): If cursor row is not fully visible
2068 after recentering, and scroll-conservatively is set to a large
2069 number, scroll window by a few more lines to make the cursor fully
2070 visible and out of scroll-margin. (Bug#10105)
2071 (start_display): Don't move to the next line if the display should
2072 start at a newline that is part of a display vector or an overlay
2075 2011-11-24 Juri Linkov <juri@jurta.org>
2077 * image.c (imagemagick_load_image): Move `MagickSetResolution' down
2078 after the `MagickPingImage' call. (Bug#10112)
2080 2011-11-23 Chong Yidong <cyd@gnu.org>
2082 * window.c (Fcoordinates_in_window_p): Accept only live windows.
2084 2011-11-23 Martin Rudalics <rudalics@gmx.at>
2086 * buffer.c (Fkill_buffer): Run replace_buffer_in_windows before
2087 making another buffer current. (Bug#10114)
2089 2011-11-23 Glenn Morris <rgm@gnu.org>
2091 * font.c (font_find_for_lface) [HAVE_NS]: Ignore case. (Bug#2526)
2093 2011-11-23 Chong Yidong <cyd@gnu.org>
2095 * xdisp.c (compute_stop_pos): Check validity of end_charpos before
2096 using it (Bug#5984).
2098 2011-11-22 Eli Zaretskii <eliz@gnu.org>
2100 * dispnew.c (adjust_glyph_matrix): Don't verify hash code of mode-
2101 and header-lines, as they don't have one computed for them.
2104 * .gdbinit (prow): Make displayed values more self-explaining.
2105 Add row's hash code.
2107 2011-11-21 Lars Magne Ingebrigtsen <larsi@gnus.org>
2109 * process.c (wait_reading_process_output): Fix asynchrounous
2110 GnuTLS socket handling on some versions of the GnuTLS library.
2111 (wait_reading_process_output): Add comment and URL.
2113 2011-11-21 Jan Djärv <jan.h.d@swipnet.se>
2115 * xterm.c (x_clear_frame): Reinstate the XClearWindow call.
2117 2011-11-21 Chong Yidong <cyd@gnu.org>
2119 * window.c (Fnext_window, Fprevious_window): Doc fix.
2121 2011-11-20 Stefan Monnier <monnier@iro.umontreal.ca>
2123 * window.c (get_phys_cursor_glyph): Fix Lisp_Object/int mixup.
2125 2011-11-20 Juanma Barranquero <lekktu@gmail.com>
2127 * nsfont.m (syms_of_nsfont) <ns-reg-to-script>: Fix typo.
2129 2011-11-20 Martin Rudalics <rudalics@gmx.at>
2131 * window.c (Fset_window_combination_limit): Rename argument
2133 (Vwindow_combination_limit): Remove "status" from doc-string.
2135 2011-11-20 Andreas Schwab <schwab@linux-m68k.org>
2137 * m/ibms390.h: Remove.
2138 * m/ibms390x.h: Don't include "ibms390.h".
2140 2011-11-20 Stefan Monnier <monnier@iro.umontreal.ca>
2142 * fileio.c (Finsert_file_contents): Add missing gcpro1 variable.
2143 Suggested by Dmitry Antipov <dmantipov@yandex.ru>.
2145 2011-11-20 Juanma Barranquero <lekktu@gmail.com>
2147 * casetab.c (Fset_case_table):
2148 * charset.c (Fcharset_after): Fix typos.
2150 2011-11-20 Paul Eggert <eggert@cs.ucla.edu>
2152 Standardize on VIRT_ADDR_VARIES behavior (Bug#10042).
2153 Otherwise, valgrind does not work on some platforms.
2154 Problem reported by Andreas Schwab in
2155 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00081.html>.
2156 * puresize.h (pure, PURE_P): Always behave as if VIRT_ADDR_VARIES
2157 is set, removing the need for VIRT_ADDRESS_VARIES.
2158 (PURE_P): Use a more-efficient implementation that needs just one
2159 comparison, not two: on x86-64 with GCC 4.6.2, this cut down the
2160 number of instructions from 6 (xorl, cmpq, jge, xorl, cmpq, setge)
2161 to 4 (xorl, subq, cmpq, setbe).
2162 * alloc.c (pure): Always extern now, since that's the
2163 VIRT_ADDR_VARIES behavior.
2164 (PURE_POINTER_P): Use a single comparison, not two, for
2165 consistency with the new puresize.h.
2166 * lisp.h (PNTR_COMPARISON_TYPE): Remove; no longer needed.
2167 * m/ibms390.h, m/intel386.h, m/template.h, s/cygwin.h, s/hpux10-20.h:
2168 Remove VIRT_ADDR_VARIES no longer needed.
2170 2011-11-19 Eli Zaretskii <eliz@gnu.org>
2172 * xdisp.c (x_write_glyphs, draw_phys_cursor_glyph)
2173 (erase_phys_cursor, update_window_cursor, show_mouse_face)
2174 (cursor_in_mouse_face_p): If the cursor position is out of bounds,
2175 behave as if the cursor position were at the window margin.
2177 * window.c (get_phys_cursor_glyph): If the window is hscrolled,
2178 and the cursor position is out of bounds, behave as if the cursor
2179 position were at the window margin. (Bug#10075)
2181 2011-11-18 Chong Yidong <cyd@gnu.org>
2183 * window.c (Fwindow_combination_limit): Make first argument
2184 non-optional, since it is meaningless for live windows like the
2187 2011-11-18 Dmitry Antipov <dmantipov@yandex.ru>
2189 * keymap.c (Fwhere_is_internal): Add missing RETURN_UNGCPROs.
2191 2011-11-18 Stefan Monnier <monnier@iro.umontreal.ca>
2193 * intervals.c: Fix grafting over the whole buffer (bug#10071).
2194 (graft_intervals_into_buffer): Simplify.
2196 2011-11-18 Eli Zaretskii <eliz@gnu.org>
2198 * dispnew.c (swap_glyph_pointers): Swap the used[] arrays and the
2199 hash values of the two rows.
2200 (copy_row_except_pointers): Preserve the used[] arrays and the
2201 hash values of the two rows. (Bug#10035)
2202 (add_row_entry): Add xassert to verify that ROW's hash code is valid.
2204 * xdisp.c (row_hash): New function, body extracted from
2205 compute_line_metrics.
2206 (compute_line_metrics): Call row_hash, instead of computing the
2209 * dispnew.c (verify_row_hash): Call row_hash for computing the
2210 hash code of a row, instead of duplicating code from xdisp.c.
2212 * dispextern.h (row_hash): Add prototype.
2214 2011-11-18 Tassilo Horn <tassilo@member.fsf.org>
2216 * frame.c (delete_frame): Don't delete the terminal when the last
2217 X frame is closed if emacs is built with GTK toolkit.
2219 2011-11-17 Juanma Barranquero <lekktu@gmail.com>
2221 * window.c (syms_of_window) <window-combination-resize>: Fix typo.
2223 2011-11-17 Martin Rudalics <rudalics@gmx.at>
2225 * window.c (Vwindow_splits): Rename to
2226 Vwindow_combination_resize. Suggested by Juri Linkov.
2227 (Fsplit_window_internal): Use Vwindow_combination_resize instead
2230 2011-11-16 Juanma Barranquero <lekktu@gmail.com>
2232 * nsfns.m (Fns_font_name):
2233 * window.c (syms_of_window) <window-combination-limit>: Fix typos.
2235 2011-11-16 Martin Rudalics <rudalics@gmx.at>
2237 * window.h (window): Rename slot "nest" to "combination_limit".
2238 * window.c (Fwindow_nest): Rename to Fwindow_combination_limit.
2239 (Fset_window_nest): Rename to Fset_window_combination_limit.
2240 (Vwindow_nest): Rename to Vwindow_combination_limit.
2241 (recombine_windows, make_parent_window, make_window)
2242 (Fsplit_window_internal, saved_window)
2243 (Fset_window_configuration, save_window_save): Rename all
2244 occurrences of window_nest to window_combination_limit.
2246 2011-11-15 Juanma Barranquero <lekktu@gmail.com>
2248 * image.c (imagemagick_load_image): Fix typo.
2250 2011-11-14 Eli Zaretskii <eliz@gnu.org>
2252 * xdisp.c (display_line): Move the call to
2253 highlight_trailing_whitespace before the call to
2254 compute_line_metrics, since the latter needs to see the final
2255 faces of all the glyphs to compute ROW's hash value.
2256 Fixes assertion violations in row_equal_p. (Bug#10035)
2258 2011-11-14 Juanma Barranquero <lekktu@gmail.com>
2260 * w32proc.c (reader_thread): Don't check pending input if cp->fd < 0,
2261 just return (bug#10044).
2263 2011-11-12 Eli Zaretskii <eliz@gnu.org>
2265 * makefile.w32-in (HEAPSIZE): New variable, allows to build temacs
2266 with user-defined heap size. Bump the default size of the temacs
2267 heap to 27MB, to avoid memory warning when running temacs.
2268 ($(TEMACS)): Use HEAPSIZE instead of a hardcoded value.
2270 * dispnew.c (scrolling_window): Fix incorrect indices in accessing
2271 current_matrix and desired_matrix. (Bug#9990)
2272 (verify_row_hash) [XASSERTS]: New function.
2273 (adjust_glyph_matrix, row_equal_p): Use it in xassert to verify
2274 that the hash value of glyph rows is correct.
2276 2011-11-12 Martin Rudalics <rudalics@gmx.at>
2278 * window.h (window): Remove splits slot.
2279 * window.c (Fwindow_splits, Fset_window_splits): Remove.
2280 (Fdelete_other_windows_internal, make_parent_window)
2281 (make_window, Fsplit_window_internal, Fdelete_window_internal)
2282 (Fset_window_configuration, save_window_save): Don't deal with
2283 split status of windows.
2284 (saved_window): Remove splits slot.
2285 (Vwindow_splits): Rewrite doc-string.
2287 2011-11-11 Jan Djärv <jan.h.d@swipnet.se>
2289 * xfns.c (unwind_create_frame):
2290 * nsfns.m (unwind_create_frame):
2291 * w32fns.c (unwind_create_frame): Use Fmemq to check if frame is in
2292 Vframe_list (Bug#9999).
2294 2011-11-11 Dmitry Antipov <dmantipov@yandex.ru>
2296 * xdisp.c (syms_of_xdisp): Remove duplicated definition of Qtext.
2298 2011-11-11 Kenichi Handa <handa@m17n.org>
2300 * callproc.c (Fcall_process): Set the member dst_multibyte of
2303 2011-11-11 Johan Bockgård <bojohan@gnu.org>
2305 * xdisp.c (fill_composite_glyph_string): Always set s->face, to
2306 avoid a crash (bug#9496).
2308 2011-11-09 Chong Yidong <cyd@gnu.org>
2310 * window.c (Fwindow_inside_edges, Fwindow_inside_pixel_edges)
2311 (Fwindow_inside_absolute_pixel_edges): Only allow live windows.
2313 2011-11-08 Paul Eggert <eggert@cs.ucla.edu>
2315 * s/gnu.h (GC_MARK_STACK): Define to GC_MAKE_GCPROS_NOOPS (Bug#9926).
2317 2011-11-08 Paul Eggert <eggert@cs.ucla.edu>
2319 Avoid some portability problems by eschewing 'extern inline' functions.
2320 The trivial performance wins aren't worth the portability hassles; see
2321 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00084.html>
2323 * dispextern.h (window_box, window_box_height, window_text_bottom_y)
2324 (window_box_width, window_box_left, window_box_left_offset)
2325 (window_box_right, window_box_right_offset): Undo previous change,
2326 by removing the "extern"s.
2327 * intervals.c (adjust_intervals_for_insertion)
2328 (adjust_intervals_for_deletion): Undo previous change,
2329 making these static again.
2330 (offset_intervals, temp_set_point_both, temp_set_point)
2331 (copy_intervals_to_string): No longer inline.
2332 * xdisp.c (window_text_bottom_y, window_box_width)
2333 (window_box_height, window_box_left_offset)
2334 (window_box_right_offset, window_box_left, window_box_right)
2335 (window_box): No longer inline.
2337 2011-11-08 Chong Yidong <cyd@gnu.org>
2339 * window.c (Fwindow_left_column, Fwindow_top_line): Doc fix.
2340 (Fwindow_body_height, Fwindow_body_width): Move from Lisp.
2341 Signal an error if not a live window.
2342 (Fwindow_total_width, Fwindow_total_height): Move from Lisp.
2343 (Fwindow_total_size, Fwindow_body_size): Move to Lisp.
2345 2011-11-07 Juanma Barranquero <lekktu@gmail.com>
2347 * lisp.h (syms_of_abbrev): Remove declaration.
2348 Reported by CHENG Gao <chenggao@royau.me>.
2350 2011-11-07 Eli Zaretskii <eliz@gnu.org>
2352 * w32.c (check_windows_init_file): Don't look for term/w32-win.el
2353 if Vpurify_flag is non-nil. Fixes a crash when running w32 build
2354 of temacs in GUI mode.
2356 2011-11-07 Martin Rudalics <rudalics@gmx.at>
2358 * window.h: Declare delete_all_child_windows instead of
2359 delete_all_subwindows.
2360 * window.c (Fwindow_nest, Fset_window_nest)
2361 (Fset_window_new_total, Fset_window_new_normal)
2362 (Fwindow_resize_apply): Don't use term subwindow in doc-strings.
2363 (delete_all_subwindows): Rename to delete_all_child_windows.
2364 (Fdelete_other_windows_internal, Fset_window_configuration):
2365 Call delete_all_child_windows instead of delete_all_subwindows.
2366 * frame.c (delete_frame): Call delete_all_child_windows instead
2367 of delete_all_subwindows.
2369 2011-11-07 Paul Eggert <eggert@cs.ucla.edu>
2371 * alloc.c (DEADP): New macro, for porting to GNU/Hurd (Bug#9926).
2372 This is also needed for porting to any host where GC_MARK_STACK is
2373 not GC_MAKE_GCPROS_NOOPS.
2374 (which_symbols): Use it.
2376 2011-11-07 Kenichi Handa <handa@m17n.org>
2378 * coding.c (coding_set_destination): Check coding->src_pos only
2379 when coding->src_object is a buffer (bug#9910).
2381 * process.c (send_process): Set the member src_multibyte of coding
2382 to 0 (bug#9911) when sending a unibyte text.
2384 * callproc.c (Fcall_process): Set the member src_multibyte of
2385 process_coding to 0 (bug#9912).
2387 2011-11-06 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
2389 * xmenu.c (cleanup_widget_value_tree): New function.
2390 (xmenu_show, xdialog_show): Use it in record_unwind_protect instead of
2391 calling free_menubar_widget_value_tree directly (Bug#9830).
2393 2011-11-06 Paul Eggert <eggert@cs.ucla.edu>
2395 Fix some portability problems with 'inline'.
2396 * dispextern.h (window_box, window_box_height, window_text_bottom_y)
2397 (window_box_width, window_box_left, window_box_left_offset)
2398 (window_box_right, window_box_right_offset): Declare extern.
2399 Otherwise, these inline functions do not conform to C99 and
2400 are miscompiled by Microsoft compilers. Reported by Eli Zaretskii in
2401 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00084.html>.
2402 * intervals.c (adjust_intervals_for_insertion)
2403 (adjust_intervals_for_deletion): Now extern, because otherwise the
2404 extern inline functions 'offset_intervals' couldn't refer to it.
2405 (static_offset_intervals): Remove.
2406 (offset_intervals): Rewrite using the old contents of
2407 static_offset_intervals. The old version didn't conform to C99
2408 because an extern inline function contained a reference to an
2409 identifier with static linkage.
2411 2011-11-06 Andreas Schwab <schwab@linux-m68k.org>
2413 * keyboard.c (interrupt_signal): Don't call kill-emacs while in
2416 2011-11-06 Eli Zaretskii <eliz@gnu.org>
2418 * xdisp.c (init_iterator, reseat_to_string): Don't set the
2419 iterator's bidi_p flag if Vpurify_flag is non-nil. (Bug#9963)
2420 (Fcurrent_bidi_paragraph_direction): If Vpurify_flag is non-nil,
2421 return Qleft_to_right.
2423 2011-11-06 Chong Yidong <cyd@gnu.org>
2425 * window.c (Fwindow_live_p, Fwindow_frame, Fframe_root_window)
2426 (Fminibuffer_window, Fwindow_buffer, Fwindow_splits)
2427 (Fset_window_splits, Fwindow_nest, Fset_window_nest)
2428 (Fwindow_use_time, Fwindow_total_size, Fwindow_normal_size)
2429 (Fwindow_new_normal, Fwindow_left_column, Fwindow_top_line)
2430 (Fwindow_margins, Fwindow_fringes, Fwindow_scroll_bars)
2431 (Fwindow_vscroll): Doc fix.
2432 (Fwindow_top_child, Fwindow_left_child): Eliminate a nil default
2433 argument, since it makes no sense to pass a live window and for
2434 consistency with window-child.
2436 2011-11-05 Christoph Scholtes <cschol2112@googlemail.com>
2438 * makefile.w32-in ($(TEMACS), (gl-stamp)): Use $(THISDIR) to
2441 2011-11-05 Jason Rumney <jasonr@gnu.org>
2443 * w32font.c (font_matches_spec): Filter out non-Japanese kana fonts.
2444 (add_font_entity_to_list): Filter out non-Japanese Shift-JIS
2446 (add_font_entity_to_list): Fix logic errors in mixed boolean and
2447 bitwise arithmetic preventing use of unicode-sip and non-truetype
2450 2011-11-05 Eli Zaretskii <eliz@gnu.org>
2452 * s/ms-w32.h (fstat, stat, utime): Move redirections to
2455 * w32fns.c (x_create_tip_frame, Fx_create_frame): Rearrange
2456 initialization code to keep similarity to xfns.c after changes
2459 2011-11-05 Jan Djärv <jan.h.d@swipnet.se>
2461 * nsfns.m: Declare image_cache_refcount if GLYPH_DEBUG.
2462 (unwind_create_frame): New function (Bug#9943).
2463 (Fx_create_frame): Restructure code to be more similar to the one in
2464 xfns.c. Call record_unwind_protect with unwind_create_frame (Bug#9943).
2465 Initialize image_cache_refcount if GLYPH_DEBUG (Bug#9943).
2466 Move terminal->reference_count++ just before making the frame official
2469 * nsterm.m (x_free_frame_resources): New function.
2470 (x_destroy_window): Move code to x_free_frame_resources.
2472 * xfns.c (unwind_create_frame): Fix comment.
2473 (Fx_create_frame, x_create_tip_frame):
2474 Move terminal->reference_count++ just before making the frame
2475 official. Move initialization of image_cache_refcount and
2476 dpyinfo_refcount before calling init_frame_faces (Bug#9943).
2478 2011-11-05 Eli Zaretskii <eliz@gnu.org>
2480 Support MSVC build with newer versions of Visual Studio.
2481 * makefile.w32-in (TAGS-gmake): Don't use $(patsubst ...), as
2482 Nmake barfs on that. Use $(OBJ*_c) variables instead, defined on
2485 * lisp.h (ENUM_BF): New macro, for enumerated types in bitfields,
2486 which are not supported by MSVC.
2487 (Lisp_Symbol, Lisp_Misc_Any, Lisp_Marker, Lisp_Misc_Overlay)
2488 (Lisp_Save_Value, Lisp_Free): Use ENUM_BF for enumerated types in
2490 (Lisp_Object) [USE_LISP_UNION_TYPE]: Use ENUM_BF for enumerated
2492 (DEFUN) [_MSC_VER]: Define in a different way for MSVC.
2494 * w32fns.c [_MSC_VER]: DECLARE_HANDLE for any MSVC version.
2496 2011-11-05 Fabrice Popineau <fabrice.popineau@supelec.fr> (tiny change)
2498 Support MSVC build with newer versions of Visual Studio.
2499 * w32.c: Don't include w32api.h for MSVC.
2500 (init_environment) [_MSC_VER]: Call sys_access, not _access.
2502 * s/ms-w32.h <sigset_t, ssize_t> [_MSC_VER]: Typedefs for MSVC.
2503 [_MSC_VER]: Include sys/timeb.h, sys/stat.h, and signal.h.
2504 (fstat, stat, utime) [_MSC_VER]: Redirect to their sys_* cousins.
2505 (malloc, free, realloc, calloc) [_MSC_VER]: Always redirect to the
2507 (alloca) [_MSC_VER]: Define to _alloca.
2509 * lisp.h (DECL_ALIGN) [_MSC_VER]: Define for MSVC.
2511 * regex.c <re_char> [_MSC_VER]: A separate definition for MSVC.
2513 2011-11-04 Eli Zaretskii <eliz@gnu.org>
2515 * xdisp.c (note_mouse_highlight): If either of
2516 previous/next-single-property-change returns nil, treat that as
2517 the beginning or the end of the buffer. (Bug#9955)
2519 2011-11-04 Jan Djärv <jan.h.d@swipnet.se>
2521 * gtkutil.c (xg_make_tool_item): Add callbacks if one of wimage or
2522 label is not null (Bug#9951).
2523 (xg_tool_item_stale_p): Handle the fact that wimage and/or wlbl
2526 2011-11-04 Eli Zaretskii <eliz@gnu.org>
2528 * window.c (Fwindow_body_size): Mention in the doc string that the
2529 return value is in frame's canonical units. (Bug#9949)
2531 2011-11-03 Eli Zaretskii <eliz@gnu.org>
2533 * xdisp.c (note_mouse_highlight): Initialize `area'. (Bug#9947)
2535 * w32fns.c (unwind_create_frame): If needed, free the glyph
2536 matrices of the partially constructed frame. (Bug#9943)
2537 * xfns.c (unwind_create_frame): Likewise.
2539 2011-11-01 Eli Zaretskii <eliz@gnu.org>
2541 * xdisp.c (mouse_face_from_buffer_pos): Fix a typo in a comment.
2542 Don't stop backward scan on the continuation glyph, even though
2543 its CHARPOS is positive.
2544 (mouse_face_from_buffer_pos, note_mouse_highlight):
2545 Rename cover_string to disp_string.
2547 2011-11-01 Martin Rudalics <rudalics@gmx.at>
2549 * window.c (temp_output_buffer_show): Don't use
2550 Vtemp_buffer_show_specifiers.
2551 (Vtemp_buffer_show_specifiers): Remove unused variable.
2553 2011-10-30 Eli Zaretskii <eliz@gnu.org>
2555 * xdisp.c (try_cursor_movement): Make sure ROW isn't decremented
2556 past the beginning of the current glyph matrix.
2558 2011-10-30 Adam Sjøgren <asjo@koldfront.dk> (tiny change)
2560 * xterm.c: Include X11/Xproto.h if HAVE_GTK3.
2561 (x_error_handler): Ignore BadMatch for X_SetInputFocus for
2562 HAVE_GTK3 (Bug#9869).
2564 * gtkutil.c (xg_win_to_widget, xg_event_is_for_menubar): Initialize
2565 type to GDK_NOTHING so valgrind does not complain (Bug#9901).
2567 * xterm.h (x_display_info): Add Xatom_net_wm_state_hidden (Bug#9893).
2569 * xterm.c: Declare x_handle_net_wm_state to return int.
2570 (handle_one_xevent): Check if we are iconified but don't have
2571 _NET_WM_STATE_HIDDEN. If do, treat as deiconify (Bug#9893).
2572 (get_current_wm_state): Return non-zero if not hidden,
2573 check for _NET_WM_STATE_HIDDEN (Bug#9893).
2574 (do_ewmh_fullscreen): Ignore return value from get_current_wm_state.
2575 (x_handle_net_wm_state): Return what get_current_wm_state returns.
2576 (x_term_init): Initialize dpyinfo->Xatom_net_wm_state_hidden.
2578 2011-10-29 Paul Eggert <eggert@cs.ucla.edu>
2580 * alloc.c (which_symbols): Declare EXTERNALLY_VISIBLE,
2581 so that this new function doesn't get optimized away by a
2582 whole-program optimizer. Make the 2nd arg EMACS_INT, not int.
2584 2011-10-29 Andreas Schwab <schwab@linux-m68k.org>
2586 * frame.h (MOUSE_HL_INFO): Remove excess parens.
2588 2011-10-29 Eli Zaretskii <eliz@gnu.org>
2590 Fix the `xbytecode' command.
2591 * .gdbinit (xprintbytestr): New command.
2592 (xwhichsymbols): Rename from `which'; all callers changed.
2593 (xbytecode): Print the byte-code string as well.
2595 2011-10-29 Kim Storm <storm@cua.dk>
2597 * alloc.c (which_symbols): New function.
2599 2011-10-29 Andreas Schwab <schwab@linux-m68k.org>
2601 * minibuf.c (read_minibuf_noninteractive): Allow reading empty
2604 2011-10-29 Glenn Morris <rgm@gnu.org>
2606 * process.c (wait_reading_process_output): Revert 2009-08-30 change.
2607 Not clear what it was for, and it causes various bugs. (Bug#9839)
2609 2011-10-28 Eli Zaretskii <eliz@gnu.org>
2611 * xdisp.c (note_mouse_highlight): Initialize `part', to avoid a
2612 possible random value that matches one of those tested as
2613 condition to clear the mouse face.
2615 2011-10-28 Chong Yidong <cyd@gnu.org>
2617 * xdisp.c (note_mouse_highlight): Fix use of uninitialized var.
2619 2011-10-28 Dan Nicolaescu <dann@ics.uci.edu>
2621 * window.c (make_window): Initialize phys_cursor_on_p.
2623 2011-10-28 Stefan Monnier <monnier@iro.umontreal.ca>
2625 * lisp.h (struct Lisp_Symbol): Update comments.
2627 2011-10-28 Juanma Barranquero <lekktu@gmail.com>
2629 * w32font.c (w32_load_unicows_or_gdi32): Add missing return.
2631 2011-10-28 Eli Zaretskii <eliz@gnu.org>
2633 Fix Emacs on Windows 9X (bug#8562). Thanks to oslsachem
2634 <oslsachem@gmail.com> for helping to debug this.
2636 * w32font.c (g_b_init_is_w9x, g_b_init_get_outline_metrics_w)
2637 (g_b_init_get_text_metrics_w, g_b_init_get_glyph_outline_w)
2638 (g_b_init_get_glyph_outline_w): New static variables.
2639 (GetOutlineTextMetricsW_Proc, GetTextMetricsW_Proc)
2640 (GetGlyphOutlineW_Proc): New typedefs.
2641 (w32_load_unicows_or_gdi32, get_outline_metrics_w)
2642 (get_text_metrics_w, get_glyph_outline_w, globals_of_w32font):
2644 (w32font_open_internal, compute_metrics):
2645 Call get_outline_metrics_w, get_text_metrics_w, and get_glyph_outline_w
2646 instead of calling the "wide" APIs directly.
2648 * emacs.c (main) [HAVE_NTGUI]: Call globals_of_w32font.
2650 * w32.h (syms_of_w32font): Add prototype.
2652 2011-10-27 Juanma Barranquero <lekktu@gmail.com>
2654 * window.c (Fframe_root_window, Fframe_first_window, Fwindow_end)
2655 (Fframe_selected_window, Ftemp_output_buffer_show, Fnext_window)
2656 (Fdelete_window_internal, Fwindow_parameters): Fix typos in docstrings.
2657 (Fmove_to_window_line): Doc fix.
2659 2011-10-27 Chong Yidong <cyd@gnu.org>
2661 * process.c (make_process): Set gnutls_state to NULL.
2663 * gnutls.c (emacs_gnutls_deinit): Deinit the gnutls_state if it is
2664 non-NULL, regardless of GNUTLS_INITSTAGE.
2665 (Fgnutls_boot): Cleanups. Call emacs_gnutls_deinit if we signal
2666 an error. Set process slots as soon as we allocate them.
2668 * gnutls.h (GNUTLS_LOG, GNUTLS_LOG2): Fix macros.
2670 2011-10-27 Chong Yidong <cyd@gnu.org>
2672 * gnutls.c (emacs_gnutls_deinit): New function.
2673 Deallocate credentials structures as well as calling gnutls_deinit.
2674 (Fgnutls_deinit, Fgnutls_boot): Use it.
2676 * process.c (make_process): Initialize GnuTLS credentials to NULL.
2677 (deactivate_process): Call emacs_gnutls_deinit.
2679 2011-10-27 Juanma Barranquero <lekktu@gmail.com>
2681 * image.c (x_create_x_image_and_pixmap):
2682 * w32.c (sys_rename, w32_delayed_load):
2683 * w32font.c (fill_in_logfont):
2684 * w32reg.c (x_get_string_resource): Silence compiler warnings.
2686 2011-10-26 Juanma Barranquero <lekktu@gmail.com>
2688 * w32fns.c (w32_default_color_map): New function,
2689 extracted from Fw32_default_color_map.
2690 (Fw32_default_color_map, Fx_open_connection): Use it. (Bug#9785)
2692 2011-10-25 Paul Eggert <eggert@cs.ucla.edu>
2694 * dispextern.h (Fcontrolling_tty_p): New decl (Bug#6649 part 2).
2696 2011-10-25 Stefan Monnier <monnier@iro.umontreal.ca>
2698 * keyboard.c (test_undefined): New function (bug#9751).
2699 (read_key_sequence): Use it to detect when a key is bound to `undefined'.
2701 2011-10-25 Enami Tsugutomo <tsugutomo.enami@jp.sony.com>
2703 * sysdep.c (init_sys_modes): Fix the check for the controlling
2704 terminal (Bug#6649).
2706 2011-10-20 Eli Zaretskii <eliz@gnu.org>
2708 * dispextern.h (struct bidi_it): New member next_en_type.
2710 * bidi.c (bidi_line_init): Initialize the next_en_type member.
2711 (bidi_resolve_explicit_1): When next_en_pos is valid for the
2712 current character, check also for next_en_type being WEAK_EN.
2713 (bidi_resolve_weak): Don't enter the expensive loop if the current
2714 position is before next_en_pos. Record the bidi type of the first
2715 non-ET, non-BN character we find, in addition to its position.
2716 (bidi_level_of_next_char): Invalidate next_en_type when
2717 next_en_pos is over-stepped.
2719 2011-10-20 Paul Eggert <eggert@cs.ucla.edu>
2721 Time zone name fixes for non-ASCII locales (Bug#641, Bug#9794)
2722 * editfns.c: Rewrite current-time-zone so that it invokes
2723 the equivalent of (format-time-string "%Z") to get the time zone name.
2724 This fixes a bug when the time zone name contains characters that
2725 need converting from the system time locale to Emacs internal format.
2726 This fixes a shortcoming that I introduced in my 1999-10-19 patch:
2727 that patch fixed format-time-string to do the conversion, but
2728 I forgot to fix current-time-zone.
2729 (format_time_string): New function, containing most of
2730 what Fformat_time_string used to contain.
2731 (Fformat_time_string): Rewrite in terms of format_time_string.
2732 This doesn't change this function's behavior.
2733 (current-time-zone): Rewrite to use format_time_string.
2734 This fixes the bug reported by Michael Schierl in
2735 <http://lists.gnu.org/archive/html/emacs-devel/2007-06/msg00334.html>.
2736 Jason Rumney's 2007-06-07 change worked around this bug, but
2738 * systime.h (tzname, timezone): Remove no-longer-used declarations.
2740 2011-10-19 Eli Zaretskii <eliz@gnu.org>
2742 * xdisp.c (start_display): If the character at POS is displayed
2743 via a display vector, reset IT->current.dpvec_index to zero.
2744 (try_window_reusing_current_matrix): If a line ends in a display
2745 vector or the next line starts in a display vector, continue
2746 redrawing the window even though the character position of
2747 start_row was reached.
2750 2011-10-18 Chong Yidong <cyd@gnu.org>
2752 * xdisp.c (get_next_display_element): Handle U+2010 and U+2011
2753 with nobreak-char-display too.
2755 2011-10-18 Eli Zaretskii <eliz@gnu.org>
2757 Fix part 3 of bug#9771.
2758 * bidi.c (bidi_line_init): Initialize next_en_pos to zero, not -1.
2759 (bidi_resolve_neutral): Don't enter the expensive loop looking for
2760 non-neutral characters if the current character is a paragraph
2761 separator (a.k.a. Newline). This avoids running the same
2762 expensive loop twice, once when we consume the preceding newline
2763 and the other time when the line actually needs to be displayed.
2764 Avoid the loop when we see neutrals on the base embedding level
2765 following a character whose directionality is the same as the
2766 paragraph's. This avoids running the expensive loop when a line
2767 ends in a long sequence of neutrals, like control characters.
2768 Add assertion against STRONG_AL type. Slightly rearrange code
2769 that determines the type of a neutral given the first non-neutral
2771 (bidi_level_of_next_char): Set next_en_pos to zero when
2772 invalidating its info.
2774 2011-10-17 Eli Zaretskii <eliz@gnu.org>
2776 * xdisp.c (push_display_prop): Determine whether to record string
2777 or buffer position by IT->string, not by IT->method. Allow
2778 GET_FROM_DISPLAY_VECTOR as IT->method on entry. (Bug#9771, part 4)
2779 (move_it_vertically_backward): Don't look for character position
2780 immediately after the newline when in a continuation line.
2783 2011-10-15 Martin Rudalics <rudalics@gmx.at>
2785 * window.c (coordinates_in_window): Rewrite and delabelize
2786 vertical border check. (Bug#5357) (Bug#9618)
2788 2011-10-14 Stefan Monnier <monnier@iro.umontreal.ca>
2790 * xterm.c (frame_highlight, frame_unhighlight): Ignore unexplained
2791 errors in XSetWindowBorder (bug#9310).
2793 2011-10-13 Dmitry Antipov <dmantipov@yandex.ru>
2795 * editfns.c (Fset_time_zone_rule): Replace free with xfree to
2796 avoid crash when xmalloc overrun checking is enabled.
2798 2011-10-13 Eli Zaretskii <eliz@gnu.org>
2800 * xdisp.c (Fcurrent_bidi_paragraph_direction): Initialize
2801 itb.paragraph_dir to NEUTRAL_DIR. Fixes an occasional incorrect
2802 cursor motion with <left> and <right> arrow keys.
2804 * bidi.c (bidi_init_it): Don't initialize paragraph_dir here, as
2805 some callers set that themselves.
2807 2011-10-12 Eli Zaretskii <eliz@gnu.org>
2809 * xdisp.c (find_row_edges): Handle the case where ROW comes from a
2810 display string and the previous row comes from the same string and
2811 is empty. (Bug#9739) (Bug#9738)
2813 2011-10-12 Stefan Monnier <monnier@iro.umontreal.ca>
2815 * doc.c (get_doc_string): Encode file name (bug#9735).
2817 2011-10-12 Eli Zaretskii <eliz@gnu.org>
2819 * bidi.c (bidi_level_of_next_char):
2820 * xdisp.c (get_visually_first_element): Remove old incorrect
2821 comments regarding the Unicode Line Separator character.
2823 * bidi.c (bidi_init_it): Initialize paragraph_dir to NEUTRAL_DIR.
2825 2011-10-12 Dmitry Antipov <dmantipov@yandex.ru>
2827 * alloc.c (Fgc_status): Do not access beyond zombies array
2828 boundary if nzombies > MAX_ZOMBIES.
2829 * alloc.c (dump_zombies): Add missing format specifier.
2831 2011-10-12 Paul Eggert <eggert@cs.ucla.edu>
2833 * xdisp.c (set_cursor_from_row): Simplify conditionals,
2834 to pacify GCC 4.6.1 x86-64 with -O2 -Wstrict-overflow.
2836 * lread.c (read_escape): Allow hex escapes as large as ?\xfffffff.
2837 Some packages use them to denote characters with modifiers.
2839 2011-10-11 Andreas Schwab <schwab@linux-m68k.org>
2841 * lisp.h (GCPRO1_VAR, GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR)
2842 (GCPRO5_VAR, GCPRO6_VAR, UNGCPRO_VAR): Add whitespace to avoid
2843 matching a pp-number. Rename parameter var to var1.
2845 2011-10-11 Stefan Monnier <monnier@iro.umontreal.ca>
2847 * minibuf.c (Finternal_complete_buffer): Fix last change (bug#9709).
2849 2011-10-08 Glenn Morris <rgm@gnu.org>
2851 * callint.c (Fcall_interactively): Give a more explicit error for the
2852 'c' case with a non-character input. (Bug#8479)
2854 2011-10-08 Eli Zaretskii <eliz@gnu.org>
2856 * xdisp.c (hscroll_window_tree): Support hscroll in right-to-left
2858 (set_cursor_from_row): Fix cursor positioning in mixed L2R+R2L
2859 lines that are hscrolled on the left.
2861 * dispnew.c (buffer_posn_from_coords): Account for a possible
2862 presence of header-line. (Bug#4426)
2864 2011-10-07 Stefan Monnier <monnier@iro.umontreal.ca>
2866 * buffer.c (syms_of_buffer) <enable-multibyte-characters>:
2867 Don't advertise functionality which we discourage or doesn't work.
2869 2011-10-07 Paul Eggert <eggert@cs.ucla.edu>
2871 * alloc.c (GC_LISP_OBJECT_ALIGNMENT): Use offsetof, not __alignof__
2872 or sizeof. __alignof__ gives the wrong answer on Fedora x86-64
2873 with GCC 4.6.1 when configured with CC='gcc -m32' --with-wide-int;
2874 this makes Emacs dump core during garbage collection on rare
2875 occasions. sizeof is obviously inferior to offsetof here, so
2876 stick with offsetof.
2877 (GC_POINTER_ALIGNMENT): New macro.
2878 (mark_memory): Omit 3rd (offset) arg; caller changed.
2879 Don't assume EMACS_INT alignment is the same as pointer alignment.
2881 2011-10-03 Stefan Monnier <monnier@iro.umontreal.ca>
2883 * keyboard.c (read_key_sequence_remapped): New var.
2884 (read_key_sequence): Compute remapping in the right buffer.
2885 (command_loop_1): Use read_key_sequence's remapping directly.
2887 2011-10-02 Stefan Monnier <monnier@iro.umontreal.ca>
2889 * dired.c (file_name_completion): Don't expand file name.
2890 (Ffile_name_completion, Ffile_name_all_completions): Expand file name
2891 before checking file name handler.
2893 * minibuf.c (Finternal_complete_buffer): Only show internal buffers if
2894 they've been requested explicitly (bug#9591).
2896 2011-10-01 Andreas Schwab <schwab@linux-m68k.org>
2898 * keymap.c (Fsingle_key_description): Use make_specified_string
2899 instead of build_string to build string from push_key_description.
2902 2011-09-30 Paul Eggert <eggert@cs.ucla.edu>
2904 * buffer.h (struct buffer): Use time_t, not int, for a time stamp.
2905 This fixes a Y2038 bug on 64-bit hosts.
2906 * buffer.c (reset_buffer):
2907 * fileio.c (Fdo_auto_save, Fset_buffer_auto_saved)
2908 (Fclear_buffer_auto_save_failure):
2909 Use 0, not -1, to represent an unset failure time, since time_t
2910 might not be signed.
2912 Remove dependency on glibc malloc internals.
2913 * alloc.c (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
2914 Move back here from lisp.h, but with their new implementations.
2915 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
2916 (XMALLOC_OVERRUN_SIZE_SIZE): Move these new lisp.h macros here.
2917 * charset.c (charset_table_init): New static var.
2918 (syms_of_charset): Use it instead of xmalloc. This removes a
2919 dependency on glibc malloc internals. See Eli Zaretskii's comment in
2920 <http://lists.gnu.org/archive/html/emacs-devel/2011-09/msg00815.html>.
2921 * lisp.h (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
2922 Move back to alloc.c.
2923 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
2924 (XMALLOC_OVERRUN_SIZE_SIZE): Move to alloc.c.
2926 2011-09-30 Jan Djärv <jan.h.d@swipnet.se>
2928 * nsterm.m (windowDidResize): Call x_set_window_size only when
2929 ns_in_resize is true. Otherwise set pixelwidth/height and
2930 call change_frame_size (Bug#9628).
2932 2011-09-30 Paul Eggert <eggert@cs.ucla.edu>
2934 Port --enable-checking=all to Fedora 14 x86-64.
2935 * charset.c (syms_of_charset): Also account for glibc malloc's
2936 internal overhead when calculating the initial malloc maximum.
2938 Port --enable-checking=all to Fedora 14 x86.
2939 * alloc.c (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
2941 (xmalloc_put_size, xmalloc_get_size, overrun_check_malloc)
2942 (overrun_check_realloc, overrun_check_free):
2943 Use XMALLOC_OVERRUN_SIZE_SIZE, not sizeof (size_t).
2944 That way, xmalloc returns a properly-aligned pointer even if
2945 XMALLOC_OVERRUN_CHECK is defined. The old debugging code happened
2946 to align OK on typical 64-bit hosts, but not on Fedora 14 x86.
2947 * charset.c (syms_of_charset): Take XMALLOC_OVERRUN_CHECK_OVERHEAD
2948 into account when calculating the initial malloc maximum.
2949 * lisp.h (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
2950 Move here from alloc.c, so that charset.c can use it too.
2951 Properly align; the old code wasn't right for common 32-bit hosts
2952 when configured with --enable-checking=all.
2953 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
2954 (XMALLOC_OVERRUN_SIZE_SIZE): New macros.
2956 2011-09-29 Eli Zaretskii <eliz@gnu.org>
2958 * sysdep.c (snprintf) [!EOVERFLOW]: If EOVERFLOW is not defined,
2961 2011-09-28 Eli Zaretskii <eliz@gnu.org>
2963 * xdisp.c (compute_display_string_end): If there's no display
2964 string at CHARPOS, return -1.
2966 * bidi.c (bidi_fetch_char): When compute_display_string_end
2967 returns a negative value, treat the character as a normal
2968 character not covered by a display string. (Bug#9624)
2970 2011-09-28 Juanma Barranquero <lekktu@gmail.com>
2972 * lread.c (Fread_from_string): Fix typo in docstring.
2974 2011-09-27 Eli Zaretskii <eliz@gnu.org>
2976 * xdisp.c (handle_invisible_prop): If invisible text ends on a
2977 newline, reseat the iterator instead of bidi-iterating there one
2978 character at a time. (Bug#9610)
2979 (BUFFER_POS_REACHED_P, move_it_in_display_line_to): Bail when past
2980 TO_CHARPOS if the bidi iterator is at base embedding level.
2982 2011-09-27 Andreas Schwab <schwab@linux-m68k.org>
2984 * lread.c (readevalloop): Use correct code for NBSP.
2985 (read1): Likewise. (Bug#9608)
2987 2011-09-25 Michael Albinus <michael.albinus@gmx.de>
2989 * dbusbind.c (Fdbus_register_signal): When service is not
2990 registered, use nil in Vdbus_registered_objects_table. (Bug#9581)
2992 2011-09-25 Glenn Morris <rgm@gnu.org>
2994 * buffer.c (truncate-lines): Doc fix.
2996 2011-09-24 Chong Yidong <cyd@stupidchicken.com>
2998 * window.c (Fwindow_prev_buffers, Fset_window_prev_buffers)
2999 (Fset_window_next_buffers): Doc fix.
3001 2011-09-24 Glenn Morris <rgm@gnu.org>
3003 * minibuf.c (read_minibuf): Disable line truncation. (Bug#5715)
3005 2011-09-24 Paul Eggert <eggert@cs.ucla.edu>
3007 Fix minor problems found by static checking.
3008 * xdisp.c (string_from_display_spec): Don't assume vecsize fits in int.
3009 * indent.c (Fvertical_motion): Fix == vs = typo.
3011 2011-09-24 Eli Zaretskii <eliz@gnu.org>
3013 * dispnew.c (syms_of_display) <redisplay-dont-pause>:
3014 Default value is now t. Doc fix.
3016 * indent.c (Fvertical_motion): Compute and apply the overshoot
3017 logic when moving up, not only when moving down. Fix the
3018 confusing name and values of the it_overshoot_expected variable;
3019 logic changes accordingly. (Bug#9254) (Bug#9549)
3021 * xdisp.c (pos_visible_p): Produce correct pixel coordinates when
3022 CHARPOS is covered by a display string which includes newlines.
3023 (move_it_vertically_backward): Avoid inflooping when START_CHARPOS
3024 is covered by a display string with embedded newlines.
3026 2011-09-24 Michael Albinus <michael.albinus@gmx.de>
3028 * dbusbind.c (Fdbus_register_signal): Add match rule to
3029 Vdbus_registered_objects_table. (Bug#9581)
3030 (Fdbus_register_method, Vdbus_registered_objects_table):
3033 2011-09-24 Jim Meyering <meyering@redhat.com>
3035 do not ignore write error for any output size
3036 The previous change was incomplete.
3037 While it makes emacs --batch detect the vast majority of stdout
3038 write failures, errors were still ignored whenever the output size is
3039 k * (BUFSIZ+1) - 4. E.g., on a system with BUFSIZ of 4096,
3040 $ emacs --batch --eval '(print (format "%4093d" 0))' > /dev/full \
3041 && echo FAIL: ignored write error
3042 FAIL: ignored write error
3043 $ emacs --batch --eval '(print (format "%20481d" 0))' > /dev/full \
3044 && echo FAIL: ignored write error
3045 FAIL: ignored write error
3046 * emacs.c (Fkill_emacs): Also test ferror. (Bug#9574)
3048 2011-09-23 Andreas Schwab <schwab@linux-m68k.org>
3050 * emacs.c (Fkill_emacs): In noninteractive mode exit
3051 non-successfully if a write error occurred on stdout. (Bug#9574)
3053 2011-09-21 Eli Zaretskii <eliz@gnu.org>
3055 * xdisp.c (pop_it): Allow it->object that is a cons cell to pass
3058 * dispextern.h (struct it): Update the comment documenting what
3061 2011-09-20 Eli Zaretskii <eliz@gnu.org>
3063 * xdisp.c (set_cursor_from_row): If the row ends in a newline from
3064 a display string, extend search for cursor position to end of row.
3065 (find_row_edges): If the row ends in a newline from a display
3066 string, increment its MATRIX_ROW_END_CHARPOS by one. (Bug#9549)
3067 Handle the case of a display string with multiple newlines.
3068 (Fcurrent_bidi_paragraph_direction): Fix search for previous
3069 non-empty line. Fixes confusing cursor motion with arrow keys at
3070 the beginning of a line that starts with whitespace.
3072 2011-09-19 Lars Magne Ingebrigtsen <larsi@gnus.org>
3074 * lread.c (Fread_from_string): Document what FINAL-STRING-INDEX is
3077 2011-09-18 Chong Yidong <cyd@stupidchicken.com>
3079 * xfns.c (Fx_create_frame): Handle the bitmapIcon resource as
3082 2011-09-18 Eli Zaretskii <eliz@gnu.org>
3084 * xdisp.c (display_line): Record maximum and minimum buffer
3085 positions even if no glyphs were produced (e.g., by a zero-width
3086 stretch). Fixes bug#9530 on a TTY. Under word-wrap, don't record
3087 buffer positions that will be removed from the glyph row because
3089 (produce_stretch_glyph): Fix a bug in :align-to on a TTY when the
3090 column is beyond frame width: don't subtract 1 "pixel" when
3091 computing width of the stretch.
3092 (reseat_at_next_visible_line_start): Undo the change made on
3093 2011-09-17 that saved paragraph information and restored it after
3094 the call to `reseat'. (Bug#9545)
3096 2011-09-18 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
3098 * xdisp.c (expose_window): Save original value of phys_cursor_on_p
3099 and turn window cursor on if cleared (Bug#9415).
3101 2011-09-18 Andreas Schwab <schwab@linux-m68k.org>
3103 * search.c (boyer_moore): Take unibyte characters from pattern
3104 literally. (Bug#9458)
3106 2011-09-18 Eli Zaretskii <eliz@gnu.org>
3108 * xdisp.c (reseat_at_next_visible_line_start): Fix last change.
3110 2011-09-18 Paul Eggert <eggert@cs.ucla.edu>
3112 Fix minor problem found by static checking.
3113 * xdisp.c (reseat_at_next_visible_line_start): Mark locals as
3114 initialized, to pacify gcc -Wuninitialized.
3116 * fileio.c: Report proper errno when syscall falls.
3117 (Finsert_file_contents): Save and restore errno,
3118 so that report_file_error outputs the correct diagnostic.
3119 (Fwrite_region) [CLASH_DETECTION]: Likewise.
3121 2011-09-18 Eli Zaretskii <eliz@gnu.org>
3123 * .gdbinit (pgx): Fix references to fields of `struct glyph'.
3125 2011-09-17 Eli Zaretskii <eliz@gnu.org>
3127 * xdisp.c (produce_stretch_glyph): Another fix for changes made on
3128 2011-08-30T17:32:44Z!eliz@gnu.org. (Bug#9530)
3130 2011-09-17 Eli Zaretskii <eliz@gnu.org>
3132 * xdisp.c (reseat_at_next_visible_line_start): Keep information
3133 about the current paragraph and restore it after the call to reseat.
3135 * bidi.c (MAX_PARAGRAPH_SEARCH): New macro.
3136 (bidi_find_paragraph_start): Search back for paragraph beginning
3137 at most MAX_PARAGRAPH_SEARCH lines; if not found, return BEGV_BYTE.
3138 (bidi_move_to_visually_next): Only trigger paragraph-related
3139 computations when the last character is a newline or at EOB, not
3140 just any NEUTRAL_B. (Bug#9470)
3142 * xdisp.c (set_cursor_from_row): Don't invoke special treatment of
3143 truncated lines if point is covered by a display string. (Bug#9524)
3145 2011-09-16 Paul Eggert <eggert@cs.ucla.edu>
3147 * xselect.c: Relax test for outgoing X longs (Bug#9498).
3148 (cons_to_x_long): New function.
3149 (lisp_data_to_selection_data): Use it. Correct the test for
3150 short-versus-long data; it was negated. Break out of vector
3151 loop, for efficiency, when a long datum is discovered.
3153 2011-09-16 Stefan Monnier <monnier@iro.umontreal.ca>
3155 * eval.c (Fquote): Document its non-consing behavior (bug#9482).
3157 2011-09-16 Eli Zaretskii <eliz@gnu.org>
3159 * image.c (tiff_handler): Work around a bug in MinGW GCC 3.x (see
3160 GCC PR/17406) by declaring this function with external scope.
3162 2011-09-15 Paul Eggert <eggert@cs.ucla.edu>
3164 * editfns.c (Fformat): Fix bug in text-property fix (Bug#9514).
3165 Don't mishandle (length (format "%%")) and (format "%4000s%%" "").
3167 2011-09-15 Andreas Schwab <schwab@linux-m68k.org>
3169 * editfns.c (Fformat): Correctly handle text properties on "%%".
3171 2011-09-15 Eli Zaretskii <eliz@gnu.org>
3173 * xterm.c (x_draw_composite_glyph_string_foreground):
3174 * w32term.c (x_draw_composite_glyph_string_foreground):
3175 * term.c (encode_terminal_code):
3176 * composite.c (composition_update_it, get_composition_id):
3177 * xdisp.c (get_next_display_element)
3178 (fill_composite_glyph_string): Add comments about special meaning
3179 of TAB characters in a composition.
3181 2011-09-15 Paul Eggert <eggert@cs.ucla.edu>
3183 * editfns.c (Fformat): Fix off-by-1 bug for "%%b" (Bug#9514).
3184 This occurs when processing a multibyte format.
3185 Problem reported by Wolfgang Jenker.
3187 2011-09-15 Johan Bockgård <bojohan@gnu.org>
3189 * xdisp.c (try_cursor_movement): Only check for exact match if
3190 cursor hpos found by set_cursor_from_row is valid. (Bug#9495)
3192 2011-09-14 Paul Eggert <eggert@cs.ucla.edu>
3194 Remove unused external symbols.
3195 * dispextern.h (calc_pixel_width_or_height): Remove decl.
3196 * xdisp.c (calc_pixel_width_or_height): Now static.
3197 * doprnt.c (exprintf) [! (HAVE_X_WINDOWS && USE_X_TOOLKIT)]: Remove.
3198 * indent.c (check_display_width):
3199 * w32term.c: Fix comment to match code.
3200 * xterm.c, xterm.h (x_catching_errors): Remove.
3202 2011-09-14 Paul Eggert <eggert@cs.ucla.edu>
3204 * xselect.c: Use signed conversions more consistently (Bug#9498).
3205 (selection_data_to_lisp_data): Assume incoming selection data are
3206 signed integers, not unsigned. This is to be consistent with
3207 outgoing selection data, which was modified to use signed integers
3208 in as part of the fix to Bug#9196 in response to Jan D.'s comment
3209 in <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9196#32> that X11
3210 expects long, not unsigned long.
3212 2011-09-14 Eli Zaretskii <eliz@gnu.org>
3214 * xdisp.c (try_window_reusing_current_matrix): Fix incorrect
3215 computation of loop end. Reported by Johan Bockgård
3218 2011-09-13 Chong Yidong <cyd@stupidchicken.com>
3220 * frame.c (Fother_visible_frames_p): Function deleted.
3222 2011-09-12 Eli Zaretskii <eliz@gnu.org>
3224 * indent.c (compute_motion): Process display vector front to back
3225 rather than the other way around. (Bug#2496)
3227 2011-09-12 Stefan Monnier <monnier@iro.umontreal.ca>
3229 * fileio.c (Finsert_file_contents): Don't assume beg_offset is 0.
3231 2011-09-11 Chong Yidong <cyd@stupidchicken.com>
3233 * minibuf.c (Fread_from_minibuffer): Doc fix.
3235 2011-09-11 Eli Zaretskii <eliz@gnu.org>
3237 * xdisp.c (produce_stretch_glyph): Fix a typo made in changes from
3238 2011-08-30T17:32:44Z!eliz@gnu.org. (Bug#9475)
3240 2011-09-11 Lars Magne Ingebrigtsen <larsi@gnus.org>
3242 * fileio.c (Fvisited_file_modtime): Document `(-1 65535)' as a
3243 value for non-existent files.
3245 2011-09-11 Eli Zaretskii <eliz@gnu.org>
3247 * fileio.c (Finsert_file_contents): If the file cannot be opened,
3248 set its "size" to -1. This will set the modtime_size field of
3249 the corresponding buffer to -1, which is what
3250 verify-visited-file-modtime expects for files that do not exist.
3253 2011-09-11 Paul Eggert <eggert@cs.ucla.edu>
3255 * keymap.h (KEY_DESCRIPTION_SIZE, push_key_description): Move decls
3257 * lisp.h: ... from here. push_key_description is no longer
3258 defined in keyboard.c, so its declaration should not be in
3259 lisp.h's "Defined in keyboard.c" section, and KEY_DESCRIPTION_SIZE
3260 logically belongs with push_key_description.
3262 2011-09-10 Paul Eggert <eggert@cs.ucla.edu>
3264 * buffer.h: Include <sys/types.h> instead of <time.h>.
3265 Otherwise, off_t wasn't defined on FreeBSD 9.0-BETA2 i386.
3266 Problem reported by Herbert J. Skuhra.
3268 2011-09-10 Lars Magne Ingebrigtsen <larsi@gnus.org>
3270 * xml.c (parse_region): Make the parsing work for
3271 non-comment-starting XML files again (bug#9144).
3273 2011-09-10 Andreas Schwab <schwab@linux-m68k.org>
3275 * image.c (gif_load): Fix calculation of bottom and right corner.
3278 2011-09-10 Eli Zaretskii <eliz@gnu.org>
3280 * xdisp.c (MAX_DISP_SCAN): Decrease to 250. Prevents sluggish
3281 redisplay in small windows.
3283 2011-09-09 Eli Zaretskii <eliz@gnu.org>
3285 * frame.c (x_report_frame_params): Cast to avoid compiler warnings.
3287 2011-09-08 Martin Rudalics <rudalics@gmx.at>
3289 * window.c (Fset_window_prev_buffers, Fset_window_next_buffers):
3290 Operate on live windows only.
3292 2011-09-08 Juanma Barranquero <lekktu@gmail.com>
3294 * emacs.c (my_heap_start): #ifdef to avoid warnings when unused.
3296 2011-09-07 Eli Zaretskii <eliz@gnu.org>
3298 * xdisp.c (move_it_in_display_line_to): Call RESTORE_IT on ppos_it
3299 only under bidi iteration.
3301 2011-09-07 Jan Djärv <jan.h.d@swipnet.se>
3303 * gtkutil.c (xg_make_tool_item): Insert comment about eventbox.
3305 2011-09-06 Paul Eggert <eggert@cs.ucla.edu>
3307 isnan: Fix porting problem to Solaris 10 with bundled gcc.
3308 Without this fix, the command to link temacs failed due to an
3309 undefined symbol __builtin_isnan. This is because
3310 /usr/include/iso/math_c99.h #defines isnan(x) to
3311 __builtin_isnan(x), but the bundled gcc, which identifies itself
3312 as gcc 3.4.3 (csl-sol210-3_4-branch+sol_rpath), does not have
3314 * floatfns.c (isnan): #undef, and then #define to a clone of
3316 (Fisnan): Always define, since it's always available now.
3317 (syms_of_floatfns): Always define isnan at the Lisp level.
3319 2011-09-06 Paul Eggert <eggert@cs.ucla.edu>
3321 * Makefile.in (gl-stamp): move-if-change now in build-aux (Bug#9169).
3323 2011-09-06 Paul Eggert <eggert@cs.ucla.edu>
3325 * fileio.c: Fix bugs with large file offsets (Bug#9428).
3326 The previous code assumed that file offsets (off_t values) fit in
3327 EMACS_INT variables, which is not true on typical 32-bit hosts.
3328 The code messed up by falsely reporting buffer overflow in cases
3329 such as (insert-file-contents "big" nil 1 2) into an empty buffer
3330 when "big" contains more than 2**29 bytes, even though this
3331 inserts just one byte and does not overflow the buffer.
3332 (Finsert_file_contents): Store file offsets as off_t
3333 values, not as EMACS_INT values. Check for overflow when
3334 converting between EMACS_INT and off_t. When checking for
3335 buffer overflow or for overlap, take the offsets into account.
3336 Don't use EMACS_INT for small values where int suffices.
3337 When checking for overlap, fix a typo: ZV was used where
3338 ZV_BYTE was intended.
3339 (Fwrite_region): Don't assume off_t fits into 'long'.
3340 * buffer.h (struct buffer.modtime_size): Now off_t, not EMACS_INT.
3342 2011-09-05 Michael Albinus <michael.albinus@gmx.de>
3344 * dbusbind.c (xd_signature_cat): Rename from signature_cat.
3346 2011-09-04 Paul Eggert <eggert@cs.ucla.edu>
3348 sprintf-related integer and memory overflow issues (Bug#9412).
3350 * doprnt.c (doprnt): Support printing ptrdiff_t and intmax_t values.
3351 (esprintf, exprintf, evxprintf): New functions.
3352 * keyboard.c (command_loop_level): Now EMACS_INT, not int.
3353 (cmd_error): Kbd macro iterations count is now EMACS_INT, not int.
3354 (modify_event_symbol): Do not assume that the length of
3355 name_alist_or_stem is safe to alloca and fits in int.
3356 (Fexecute_extended_command): Likewise for function name and binding.
3357 (Frecursion_depth): Wrap around reliably on integer overflow.
3358 * keymap.c (push_key_description): First arg is now EMACS_INT, not int,
3359 since some callers pass EMACS_INT values.
3360 (Fsingle_key_description): Don't crash if symbol name contains more
3361 than MAX_ALLOCA bytes.
3362 * minibuf.c (minibuf_level): Now EMACS_INT, not int.
3363 (get_minibuffer): Arg is now EMACS_INT, not int.
3364 * lisp.h (get_minibuffer, push_key_description): Reflect API changes.
3365 (esprintf, exprintf, evxprintf): New decls.
3366 * window.h (command_loop_level, minibuf_level): Reflect API changes.
3368 * dbusbind.c (signature_cat): New function.
3369 (xd_signature, Fdbus_register_signal):
3370 Do not overrun buffer; instead, report string overflow.
3372 * dispnew.c (add_window_display_history): Don't overrun buffer.
3373 Truncate instead; this is OK since it's just a log.
3375 * editfns.c (Fcurrent_time_zone): Don't overrun buffer
3376 even if the time zone offset is outlandishly large.
3377 Don't mishandle offset == INT_MIN.
3379 * emacs.c (main) [NS_IMPL_COCOA]: Don't overrun buffer
3380 when creating daemon; the previous buffer-overflow check was incorrect.
3382 * eval.c (verror): Simplify by rewriting in terms of evxprintf,
3383 which has the guts of the old verror function.
3385 * filelock.c (lock_file_1, lock_file): Don't blindly alloca long name;
3386 use SAFE_ALLOCA instead. Use esprintf to avoid int-overflow issues.
3388 * font.c: Include <float.h>, for DBL_MAX_10_EXP.
3389 (font_unparse_xlfd): Don't blindly alloca long strings.
3390 Don't assume XINT result fits in int, or that XFLOAT_DATA * 10
3391 fits in int, when using sprintf. Use single snprintf to count
3392 length of string rather than counting it via multiple sprintfs;
3393 that's simpler and more reliable.
3394 (font_unparse_fcname): Use it to avoid sprintf buffer overrun.
3395 (generate_otf_features) [0 && HAVE_LIBOTF]: Use esprintf, not
3396 sprintf, in case result does not fit in int.
3398 * fontset.c (num_auto_fontsets): Now printmax_t, not int.
3399 (fontset_from_font): Print it.
3401 * frame.c (tty_frame_count): Now printmax_t, not int.
3402 (make_terminal_frame, set_term_frame_name): Print it.
3403 (x_report_frame_params): In X, window IDs are unsigned long,
3404 not signed long, so print them as unsigned.
3405 (validate_x_resource_name): Check for implausibly long names,
3406 and don't assume name length fits in 'int'.
3407 (x_get_resource_string): Don't blindly alloca invocation name;
3408 use SAFE_ALLOCA. Use esprintf, not sprintf, in case result does
3411 * gtkutil.c: Include <float.h>, for DBL_MAX_10_EXP.
3412 (xg_check_special_colors, xg_set_geometry):
3413 Make sprintf buffers a bit bigger, to avoid potential buffer overrun.
3415 * lread.c (dir_warning): Don't blindly alloca buffer; use SAFE_ALLOCA.
3416 Use esprintf, not sprintf, in case result does not fit in int.
3418 * macros.c (executing_kbd_macro_iterations): Now EMACS_INT, not int.
3419 (Fend_kbd_macro): Don't mishandle MOST_NEGATIVE_FIXNUM by treating
3420 it as a large positive number.
3421 (Fexecute_kbd_macro): Don't assume repeat count fits in int.
3422 * macros.h (executing_kbd_macro_iterations): Now EMACS_INT, not int.
3424 * nsterm.m ((NSSize)windowWillResize): Use esprintf, not sprintf,
3425 in case result does not fit in int.
3427 * print.c (float_to_string): Detect width overflow more reliably.
3428 (print_object): Make sprintf buffer a bit bigger, to avoid potential
3429 buffer overrun. Don't assume list length fits in 'int'. Treat
3430 print length of 0 as 0, not as infinity; to be consistent with other
3431 uses of print length in this function. Don't overflow print length
3432 index. Don't assume hash table size fits in 'long', or that
3433 vectorlike size fits in 'unsigned long'.
3435 * process.c (make_process): Use printmax_t, not int, to format
3436 process-name gensyms.
3438 * sysdep.c (snprintf) [! HAVE_SNPRINTF]: New function.
3440 * term.c (produce_glyphless_glyph): Make sprintf buffer a bit bigger
3441 to avoid potential buffer overrun.
3443 * xfaces.c (x_update_menu_appearance): Don't overrun buffer
3444 if X resource line is longer than 512 bytes.
3446 * xfns.c (x_window): Make sprintf buffer a bit bigger
3447 to avoid potential buffer overrun.
3449 * xterm.c (x_io_error_quitter): Don't overrun sprintf buffer.
3451 * xterm.h (x_check_errors): Add ATTRIBUTE_FORMAT_PRINTF.
3453 2011-09-04 Paul Eggert <eggert@cs.ucla.edu>
3455 Integer overflow fixes for scrolling, etc.
3456 Without these, Emacs silently mishandles large integers sometimes.
3457 For example, "C-u 4294967297 M-x recenter" was treated as if
3458 it were "C-u 1 M-x recenter" on a typical 64-bit host.
3460 * xdisp.c (try_window_id): Check Emacs fixnum range before
3461 converting to 'int'.
3463 * window.c (window_scroll_line_based, Frecenter):
3464 Check that an Emacs fixnum is in range before assigning it to 'int'.
3465 (Frecenter, Fmove_to_window_line): Use EMACS_INT, not int, for
3466 values converted from Emacs fixnums.
3467 (Frecenter): Don't wrap around a line count if it is out of 'int'
3468 range; instead, treat it as an extreme value.
3469 (Fset_window_configuration, compare_window_configurations):
3470 Use ptrdiff_t, not int, for index that might exceed 2 GiB.
3472 * search.c (Freplace_match): Use ptrdiff_t, not int, for indexes
3473 that can exceed INT_MAX. Check that EMACS_INT value is in range
3474 before assigning it to the (possibly-narrower) index.
3475 (match_limit): Don't assume that a fixnum can fit in 'int'.
3477 * print.c (print_object): Use ptrdiff_t, not int, for index that can
3480 * indent.c (position_indentation): Now takes ptrdiff_t, not int.
3481 (Fvertical_motion): Don't wrap around LINES values that don't fit
3482 in 'int'. Instead, treat them as extreme values. This is good
3483 enough for windows, which can't have more than INT_MAX lines anyway.
3485 2011-09-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
3487 * Require libxml/parser.h to avoid compilation warning.
3489 * emacs.c (shut_down_emacs): Call xmlCleanupParser on shutdown.
3491 * xml.c (parse_region): Don't call xmlCleanupParser after parsing,
3492 since this reportedly can destroy thread storage.
3494 2011-08-30 Chong Yidong <cyd@stupidchicken.com>
3496 * syntax.c (find_defun_start): Update all cache variables if
3497 exiting early (Bug#9401).
3499 2011-08-30 Eli Zaretskii <eliz@gnu.org>
3501 * image.c (x_bitmap_pixmap): Cast to int to avoid compiler warnings.
3503 * xdisp.c (produce_stretch_glyph): No longer static, compiled also
3504 when HAVE_WINDOW_SYSTEM is not defined. Support both GUI and TTY
3505 frames. Call tty_append_glyph in the TTY case. (Bug#9402)
3507 * term.c (tty_append_glyph): New function.
3508 (produce_stretch_glyph): Static function and its prototype deleted.
3510 * dispextern.h (produce_stretch_glyph, tty_append_glyph):
3513 2011-08-29 Paul Eggert <eggert@cs.ucla.edu>
3515 * image.c (parse_image_spec): Check for nonnegative, not for positive,
3516 when checking :margin (Bug#9390).
3517 (IMAGE_NON_NEGATIVE_INTEGER_VALUE_OR_PAIR):
3518 Rename from IMAGE_POSITIVE_INTEGER_VALUE_OR_PAIR,
3519 so that the name doesn't mislead. All uses changed.
3521 2011-08-28 Johan Bockgård <bojohan@gnu.org>
3523 * term.c (init_tty) [HAVE_GPM]: Move mouse settings after
3526 2011-08-27 Eli Zaretskii <eliz@gnu.org>
3528 * xdisp.c (move_it_to): Don't bail out early when reaching
3529 position beyond to_charpos, if we are scanning backwards.
3530 (move_it_vertically_backward): When DY == 0, make sure we get to
3531 the first character in the line after the newline.
3533 2011-08-27 Paul Eggert <eggert@cs.ucla.edu>
3535 * ccl.c: Improve and simplify overflow checking (Bug#9196).
3536 (ccl_driver): Do not generate an out-of-range pointer.
3537 (Fccl_execute_on_string): Remove unnecessary check for
3538 integer overflow, noted by Stefan Monnier in
3539 <http://lists.gnu.org/archive/html/emacs-devel/2011-08/msg00979.html>.
3540 Remove a FIXME that didn't need fixing.
3541 Simplify the newly-introduced buffer reallocation code.
3543 2011-08-27 Juanma Barranquero <lekktu@gmail.com>
3545 * makefile.w32-in ($(BLD)/alloc.$(O)): Depend on lib/verify.h.
3547 2011-08-26 Paul Eggert <eggert@cs.ucla.edu>
3549 Integer and memory overflow issues (Bug#9196).
3551 * doc.c (get_doc_string): Rework so that
3552 get_doc_string_buffer_size is the actual buffer size, rather than
3553 being 1 less than the actual buffer size; this makes xpalloc more
3556 * image.c (x_allocate_bitmap_record, cache_image):
3557 * xselect.c (Fx_register_dnd_atom):
3558 Simplify previous changes by using xpalloc.
3560 * buffer.c (overlay_str_len): Now ptrdiff_t, not EMACS_INT,
3561 since either will do and ptrdiff_t is convenient with xpalloc.
3563 * charset.c (charset_table_size)
3564 (struct charset_sort_data.priority): Now ptrdiff_t.
3565 (charset_compare): Don't overflow if priorities differ greatly.
3566 (Fsort_charsets): Don't assume list length fits in int.
3567 Check for size-calculation overflow when allocating sort data.
3568 (syms_of_charset): Allocate an initial charset table that is
3569 just under 64 KiB, to avoid problems with glibc malloc and mmap.
3571 * cmds.c (internal_self_insert): Check for size-calculation overflow.
3573 * composite.h (struct composition.glyph_len): Now int, not unsigned.
3574 The actual value is always <= INT_MAX, and leaving it unsigned made
3575 overflow checking harder.
3577 * dispextern.h (struct glyph_matrix.rows_allocated)
3578 (struct face_cache.size): Now ptrdiff_t, for convenience in use
3579 with xpalloc. The values are still always <= INT_MAX.
3581 * indent.c (compute_motion): Adjust to region_cache_forward sig change.
3583 * lisp.h (xnmalloc, xnrealloc, xpalloc): New decls.
3584 (SAFE_NALLOCA): New macro.
3586 * region-cache.c (struct boundary.pos, find_cache_boundary)
3587 (move_cache_gap, insert_cache_boundary, delete_cache_boundaries)
3588 (set_cache_region, invalidate_region_cache)
3589 (revalidate_region_cache, know_region_cache, region_cache_forward)
3590 (region_cache_backward, pp_cache):
3591 Use ptrdiff_t, not EMACS_INT, since either will do. This is needed
3592 so that ptrdiff_t * can be passed to xpalloc.
3593 (struct region_cache): Similarly, for gap_start, gap_len, cache_len,
3594 beg_unchanged, end_unchanged, buffer_beg, buffer_end members.
3595 (pp_cache): Don't assume cache_len fits in int.
3596 * region-cache.h: Adjust extern decls to match.
3598 * search.c (scan_buffer, Freplace_match): Use ptrdiff_t, not
3599 EMACS_INT, since either will do, for xpalloc.
3601 * alloc.c: Include verify.h, and check that int fits in ptrdiff_t.
3602 (xnmalloc, xnrealloc, xpalloc): New functions.
3604 * bidi.c (bidi_shelve_header_size): New constant.
3605 (bidi_cache_ensure_space, bidi_shelve_cache): Use it.
3606 (bidi_cache_ensure_space): Avoid integer overflow when allocating.
3608 * bidi.c (bidi_cache_shrink):
3609 * buffer.c (overlays_at, overlays_in, record_overlay_string)
3611 Don't update size of array until after memory allocation succeeds,
3612 because xmalloc/xrealloc may not return.
3613 (struct sortstrlist.bytes): Now ptrdiff_t, as EMACS_INT doesn't help
3614 now that we have proper integer overflow checking.
3615 (record_overlay_string, overlay_strings): Catch overflows when
3616 calculating size of overlay_str_buf.
3618 * callproc.c (Fcall_process): Check for size overflow when
3619 calculating size of args2.
3620 (child_setup): Avoid overflow by using size_t rather than ptrdiff_t.
3621 Normally we prefer signed values, but sticking with ptrdiff_t would
3622 require adding more-complicated checks.
3624 * ccl.c (Fccl_execute_on_string): Check for memory overflow.
3625 Use ptrdiff_t rather than EMACS_INT where ptrdiff_t will do.
3626 Redo buffer-overflow calculations to avoid integer overflow.
3627 Add a FIXME comment where memory seems to be over-allocated.
3629 * character.c (Fstring): Check for size-calculation overflow.
3631 * coding.c (produce_chars): Redo buffer-overflow calculations to avoid
3632 unnecessary integer overflow. Check for size overflow.
3633 (encode_coding_object): Don't update size until xmalloc succeeds.
3635 * composite.c (get_composition_id): Check for overflow in glyph
3636 length calculations.
3638 Integer and memory overflow fixes for display code.
3639 * dispextern.h (struct glyph_pool.nglyphs): Now ptrdiff_t, not int.
3640 * dispnew.c (adjust_glyph_matrix, realloc_glyph_pool)
3641 (scrolling_window): Check for overflow in size calculations.
3642 (line_draw_cost, realloc_glyph_pool, add_row_entry):
3643 Don't assume glyph table len fits in int.
3644 (struct row_entry.bucket, row_entry_pool_size, row_entry_idx)
3645 (row_table_size): Now ptrdiff_t, not int.
3646 (scrolling_window): Avoid overflow in size calculations.
3647 Don't update size until allocation succeeds.
3648 * fns.c (concat): Check for overflow in size calculations.
3649 (next_almost_prime): Verify NEXT_ALMOST_PRIME_LIMIT.
3650 * lisp.h (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): New macros.
3651 (NEXT_ALMOST_PRIME_LIMIT): New constant.
3653 * doc.c (get_doc_string_buffer_size): Now ptrdiff_t, not int.
3654 (get_doc_string): Check for size calculation overflow.
3655 Don't update size until allocation succeeds.
3656 (get_doc_string, Fsubstitute_command_keys): Use ptrdiff_t, not
3657 EMACS_INT, where ptrdiff_t will do.
3658 (Fsubstitute_command_keys): Check for string overflow.
3660 * editfns.c (set_time_zone_rule): Don't assume environment length
3662 (message_length): Now ptrdiff_t, not int.
3663 (Fmessage_box): Don't update size until allocation succeeds.
3664 Don't assume message length fits in int.
3665 (Fformat): Use ptrdiff_t, not EMACS_INT, where ptrdiff_t will do.
3667 * emacs.c (main): Do not reallocate argv, since there is a null at
3668 the end that can be overwritten, and this way there's no need to
3669 worry about size-calculation overflow.
3670 (sort_args): Check for size-calculation overflow.
3672 * eval.c (init_eval_once, grow_specpdl): Don't update size until
3674 (call_debugger, grow_specpdl): Redo calculations to avoid overflow.
3676 * frame.c (set_menu_bar_lines, x_set_frame_parameters)
3677 (x_set_scroll_bar_width, x_figure_window_size):
3678 Check for integer overflow.
3679 (x_set_alpha): Do not assume XINT fits in int.
3681 * frame.h (struct frame): Use int, not EMACS_INT, where int works.
3682 This is for the members text_lines, text_cols, total_lines, total_cols,
3683 where the system imposes an 'int' limit.
3685 * fringe.c (Fdefine_fringe_bitmap):
3686 Don't update size until alloc works.
3688 * ftfont.c (ftfont_get_open_type_spec, setup_otf_gstring)
3689 (ftfont_shape_by_flt): Check for integer overflow in size calculations.
3691 * gtkutil.c (get_utf8_string, xg_store_widget_in_map):
3692 Check for size-calculation overflow.
3693 (get_utf8_string): Use ptrdiff_t, not size_t, where either will
3694 do, as we prefer signed integers.
3695 (id_to_widget.max_size, id_to_widget.used)
3696 (xg_store_widget_in_map, xg_remove_widget_from_map)
3697 (xg_get_widget_from_map, xg_get_scroll_id_for_window)
3698 (xg_remove_scroll_bar, xg_update_scrollbar_pos):
3699 Use and return ptrdiff_t, not int.
3700 (xg_gtk_scroll_destroy): Don't assume ptrdiff_t fits in int.
3701 * gtkutil.h: Change prototypes to match the above.
3703 * image.c (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): Remove; these
3704 are duplicate now that they've been promoted to lisp.h.
3705 (x_allocate_bitmap_record, x_alloc_image_color)
3706 (make_image_cache, cache_image, xpm_load):
3707 Don't update size until alloc is done.
3708 (xpm_load, lookup_rgb_color, lookup_pixel_color, x_to_xcolors)
3710 Check for size calculation overflow.
3711 (ct_colors_allocated_max): New constant.
3712 (x_to_xcolors, x_detect_edges): Reorder multiplicands to avoid
3715 * keyboard.c (read_char, menu_bar_items, tool_bar_items)
3716 (read_char_x_menu_prompt, read_char_minibuf_menu_width)
3717 (read_char_minibuf_menu_prompt, follow_key, read_key_sequence):
3718 Use ptrdiff_t, not int, to count maps.
3719 (read_char_minibuf_menu_prompt): Check for overflow in size
3720 calculations. Don't update size until allocation succeeds.
3721 Redo calculations to avoid overflow.
3722 * keyboard.h: Change prototypes to match the above.
3724 * keymap.c (cmm_size, current_minor_maps): Use ptrdiff_t, not int,
3726 (current_minor_maps): Check for size calculation overflow.
3727 * keymap.h: Change prototypes to match the above.
3729 * lread.c (read1, init_obarray): Don't update size until alloc done.
3731 * macros.c (Fstart_kbd_macro): Don't update size until alloc done.
3732 (store_kbd_macro_char): Reorder multiplicands to avoid overflow.
3734 * nsterm.h (struct ns_color_table.size, struct ns_color_table.avail):
3735 Now ptrdiff_t, not int.
3736 * nsterm.m (ns_index_color): Use ptrdiff_t, not int, for table indexes.
3737 (ns_draw_fringe_bitmap): Rewrite to avoid overflow.
3739 * process.c (Fnetwork_interface_list): Check for overflow
3740 in size calculation.
3742 * region-cache.c (move_cache_gap): Check for size calculation overflow.
3744 * scroll.c (do_line_insertion_deletion_costs): Check for size calc
3745 overflow. Don't bother calling xmalloc when xrealloc will do.
3747 * search.c (Freplace_match): Check for size calculation overflow.
3748 (Fset_match_data): Don't assume list lengths fit in 'int'.
3750 * sysdep.c (system_process_attributes): Use ptrdiff_t, not int,
3751 for command line length. Do not attempt to address one before the
3752 beginning of an array, as that's not portable.
3754 * term.c (max_frame_lines): Remove; unused.
3755 (encode_terminal_src_size, encode_terminal_dst_size): Now ptrdiff_t,
3757 (encode_terminal_code, calculate_costs): Check for size
3758 calculation overflow.
3759 (encode_terminal_code): Use ptrdiff_t, not int, to record glyph
3760 table lengths and related sizes. Don't update size until alloc
3761 done. Redo calculations to avoid overflow.
3762 (calculate_costs): Don't bother calling xmalloc when xrealloc will do.
3764 * termcap.c (tgetent): Use ptrdiff_t, not int, to record results of
3765 subtracting pointers.
3766 (gobble_line): Check for overflow more carefully. Don't update size
3769 * tparam.c (tparam1): Use ptrdiff_t, not int, for sizes.
3770 Don't update size until alloc done.
3771 Redo size calculations to avoid overflow.
3772 Check for size calculation overflow.
3773 (main) [DEBUG]: Fix typo in invoking tparam1.
3775 * xdisp.c (store_mode_line_noprop_char, x_consider_frame_title):
3776 Use ptrdiff_t, not int, for sizes.
3777 (store_mode_line_noprop_char): Don't update size until alloc done.
3779 * xfaces.c (lface_id_to_name_size, Finternal_make_lisp_face):
3780 Use ptrdiff_t, not int, for sizes.
3781 (Finternal_make_lisp_face, cache_face):
3782 Check for size calculation overflow.
3783 (cache_face): Treat size calculation overflows as if they were
3784 memory exhaustion (the usual treatment), rather than aborting.
3786 * xfns.c (x_encode_text, x_set_name_internal)
3787 (Fx_change_window_property): Use ptrdiff_t, not int, to count
3788 sizes, since they can exceed INT_MAX in size. Check for size
3789 calculation overflow.
3791 * xgselect.c (gfds_size): Now ptrdiff_t, for convenience with xpalloc.
3792 (xg_select): Check for size calculation overflow.
3793 Don't update size until alloc done.
3795 * xrdb.c (get_environ_db): Don't assume path length fits in int,
3796 as sprintf is limited to int lengths.
3798 * xselect.c (X_LONG_SIZE, X_SHRT_MAX, X_SHRT_MIN, X_LONG_MAX)
3799 (X_LONG_MIN): New macros.
3800 Use them to make the following changes clearer.
3801 (MAX_SELECTION_QUANTUM): Make the other bounds on this value clearer.
3802 This change doesn't affect the value now, but it may help remind
3803 future maintainers not to raise the value too much later.
3804 (SELECTION_QUANTUM): Remove, replacing with ...
3805 (selection_quantum): ... new function, which avoids overflow.
3807 (struct selection_data.size): Now ptrdiff_t, not int, to avoid
3808 assumption that selection length fits in 'int'.
3809 (x_reply_selection_request, x_handle_selection_request)
3810 (x_get_window_property, receive_incremental_selection)
3811 (x_get_window_property_as_lisp_data, selection_data_to_lisp_data)
3812 (lisp_data_to_selection_data, clean_local_selection_data):
3813 Use ptrdiff_t, not int, to record length of selection.
3814 (x_reply_selection_request, x_get_window_property)
3815 (receive_incremental_selection, x_property_data_to_lisp):
3816 Redo calculations to avoid overflow.
3817 (x_reply_selection_request): When sending hint, ceiling it at
3818 X_LONG_MAX rather than relying on wraparound overflow to send
3820 (x_get_window_property, receive_incremental_selection)
3821 (lisp_data_to_selection_data, x_property_data_to_lisp):
3822 Check for size-calculation overflow.
3823 (x_get_window_property, receive_incremental_selection)
3824 (lisp_data_to_selection_data, Fx_register_dnd_atom):
3825 Don't store size until memory allocation succeeds.
3826 (x_get_window_property): Plug memory leak on memory exhaustion.
3827 Don't double-block input; malloc is safe here. Don't assume 2**34
3828 - 4 fits in unsigned long. Add an xassert to check
3829 XGetWindowProperty overflow. Be more careful about overflow
3830 calculations, and distinguish size from memory overflow better.
3831 (receive_incremental_selection): When tracing, don't assume
3832 unsigned int is less than INT_MAX.
3833 (x_selection_data_to_lisp_data): Remove unnecessary (and in theory
3834 harmful) conversions of unsigned short to int.
3835 (lisp_data_to_selection_data): Don't assume that integers
3836 in the range -65535 through -1 fit in an X unsigned short.
3837 Don't assume that ULONG_MAX == X_ULONG_MAX. Don't store into
3838 result parameters unless successful. Rely on cons_to_unsigned
3839 to report problems with elements; the old code wasn't right anyway.
3840 (x_check_property_data): Check for int overflow; we cannot use
3841 a wider type due to X limits.
3842 (x_handle_dnd_message): Use unsigned int, to avoid int overflow.
3844 * xsmfns.c (smc_save_yourself_CB): Check for size calc overflow.
3846 * xterm.c (x_color_cells, x_send_scrollbar_event, handle_one_xevent)
3847 (x_term_init): Check for size calculation overflow.
3848 (x_color_cells): Don't store size until memory allocation succeeds.
3849 (handle_one_xevent): Use ptrdiff_t, not int, for byte counts.
3850 Don't assume alloca size is less than MAX_ALLOCA.
3851 (x_term_init): Don't assume length fits in int (sprintf is limited
3854 Use ptrdiff_t for composition IDs.
3855 * character.c (lisp_string_width):
3856 * composite.c (composition_table_size, n_compositions)
3857 (get_composition_id, composition_gstring_from_id):
3858 * dispextern.h (struct glyph_string.cmp_id, struct composition_it.id):
3859 * xdisp.c (BUILD_COMPOSITE_GLYPH_STRING):
3860 * window.c (Frecenter):
3861 Use ptrdiff_t, not int, for composition IDs.
3862 * composite.c (get_composition_id): Check for integer overflow.
3863 * composite.h: Adjust prototypes to match the above changes.
3865 Use ptrdiff_t for hash table indexes.
3866 * category.c (hash_get_category_set):
3867 * ccl.c (ccl_driver):
3868 * charset.h (struct charset.hash_index, CHECK_CHARSET_GET_ID):
3869 * coding.c (coding_system_charset_list, detect_coding_system):
3870 * coding.h (struct coding_system.id):
3871 * composite.c (get_composition_id, gstring_lookup_cache):
3872 * fns.c (hash_lookup, hash_put, Fgethash, Fputhash):
3873 * image.c (xpm_get_color_table_h):
3874 * lisp.h (hash_lookup, hash_put):
3875 * minibuf.c (Ftest_completion):
3876 Use ptrdiff_t for hash table indexes, not int (which is too
3877 narrow, on 64-bit hosts) or EMACS_INT (which is too wide, on
3878 32-bit --with-wide-int hosts).
3880 * charset.c (Fdefine_charset_internal): Check for integer overflow.
3881 Add a FIXME comment about memory leaks.
3882 (syms_of_charset): Don't assume xmalloc returns.
3884 Don't assume that stated character widths fit in int.
3885 * character.c (Fchar_width, c_string_width, lisp_string_width):
3886 * character.h (CHAR_WIDTH):
3887 * indent.c (MULTIBYTE_BYTES_WIDTH):
3888 Use sanitize_char_width to avoid undefined and/or bad behavior
3889 with outlandish widths.
3890 * character.h (sanitize_tab_width): Rename from sanitize_width,
3891 now that we have two such functions. All uses changed.
3892 (sanitize_char_width): New inline function.
3894 Don't assume that tab-width fits in int.
3895 * character.h (sanitize_width): New inline function.
3896 (SANE_TAB_WIDTH): New macro.
3897 (ASCII_CHAR_WIDTH): Use it.
3898 * indent.c (sane_tab_width): Remove. All uses replaced by
3899 SANE_TAB_WIDTH (current_buffer).
3900 * xdisp.c (init_iterator): Use SANE_TAB_WIDTH.
3902 * fileio.c: Integer overflow issues with file modes.
3903 (Fset_file_modes, auto_save_1): Don't assume EMACS_INT fits in int.
3905 * charset.c (read_hex): New arg OVERFLOW. All uses changed.
3906 Remove unreachable code.
3907 (read_hex, load_charset_map_from_file): Check for integer overflow.
3909 * xterm.c: Don't go over XClientMessageEvent limit.
3910 (scroll_bar_windows_size): Now ptrdiff_t, as we prefer signed.
3911 (x_send_scroll_bar_event): Likewise. Check that the size does not
3912 exceed limits imposed by XClientMessageEvent, as well as the usual
3913 ptrdiff_t and size_t limits.
3915 * keyboard.c: Overflow, signedness and related fixes.
3916 (make_lispy_movement): Use same integer type in forward decl
3917 that is used in the definition.
3918 (read_key_sequence, keyremap_step):
3919 Change bufsize argument back to int, undoing my 2011-03-30 change.
3920 We prefer signed types, and int is wide enough here.
3921 (parse_tool_bar_item): Don't assume tool_bar_max_label_size is less
3922 than TYPE_MAXIMUM (EMACS_INT) / 2. Don't let the label size grow
3923 larger than STRING_BYTES_BOUND. Use ptrdiff_t for Emacs string
3924 length, not size_t. Use ptrdiff_t for index, not int.
3925 (keyremap_step, read_key_sequence): Redo bufsize check to avoid
3926 possibility of integer overflow.
3928 Overflow, signedness and related fixes for images.
3930 * dispextern.h (struct it.stack[0].u.image.image_id)
3931 (struct_it.image_id, struct image.id, struct image_cache.size)
3932 (struct image_cache.used, struct image_cache.ref_count):
3933 * gtkutil.c (update_frame_tool_bar):
3934 * image.c (x_reference_bitmap, Fimage_size, Fimage_mask_p)
3935 (Fimage_metadata, free_image_cache, clear_image_cache, lookup_image)
3936 (cache_image, mark_image_cache, x_kill_gs_process, Flookup_image):
3937 * nsmenu.m (update_frame_tool_bar):
3938 * xdisp.c (calc_pixel_width_or_height):
3939 * xfns.c (image_cache_refcount):
3940 Image IDs are now ptrdiff_t, not int, to avoid arbitrary limits
3941 on typical 64-bit hosts.
3943 * image.c (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): New macros.
3944 (x_bitmap_pixmap, x_create_x_image_and_pixmap):
3945 Omit unnecessary casts to int.
3946 (parse_image_spec): Check that integers fall into 'int' range
3947 when the callers expect that.
3948 (image_ascent): Redo ascent calculation to avoid int overflow.
3949 (clear_image_cache): Avoid overflow when sqrt (INT_MAX) < nimages.
3950 (lookup_image): Remove unnecessary tests.
3951 (xbm_image_p): Locals are now of int, not EMACS_INT,
3952 since parse_image_check makes sure they fit into int.
3953 (png_load, gif_load, svg_load_image):
3954 Prefer int to unsigned where either will do.
3955 (tiff_handler): New function, combining the cores of the
3956 old tiff_error_handler and tiff_warning_handler.
3957 This function is rewritten to use vsnprintf and thereby avoid
3958 stack buffer overflows. It uses only the features of vsnprintf
3959 that are common to both POSIX and native Microsoft.
3960 (tiff_error_handler, tiff_warning_handler): Use it.
3961 (tiff_load, gif_load, imagemagick_load_image):
3962 Don't assume :index value fits in 'int'.
3963 (gif_load): Omit unnecessary cast to double, and avoid double-rounding.
3964 (imagemagick_load_image): Check that crop parameters fit into
3965 the integer types that MagickCropImage accepts. Don't assume
3966 Vimagemagick_render_type has a nonnegative value. Don't assume
3967 size_t fits in 'long'.
3968 (gs_load): Use printmax_t to print the widest integers possible.
3969 Check for integer overflow when computing image height and width.
3971 2011-08-26 Eli Zaretskii <eliz@gnu.org>
3973 * xdisp.c (redisplay_window): Don't force window start if point
3974 will be invisible in the resulting window. (Bug#9324)
3976 2011-08-25 Eli Zaretskii <eliz@gnu.org>
3978 * xdisp.c (compute_display_string_pos): Return 2 in DISP_PROP when
3979 the display spec is of the form `(space ...)'.
3980 (handle_display_spec): Return the value returned by
3981 handle_single_display_spec, not just 1 or zero.
3982 (handle_single_display_spec): If the display spec is of the form
3983 `(space ...)', and specifies display in the text area, return 2
3985 (try_cursor_movement): Check for the need to scroll more
3986 accurately, and prefer exact match for point under bidi.
3987 Don't advance `row' beyond the last row of the window.
3989 * dispextern.h (struct bidi_it): Rename the disp_prop_p member
3990 into disp_prop; all users changed.
3992 * bidi.c (bidi_fetch_char): If compute_display_string_pos returns
3993 DISP_PROP = 2, substitute the u+2029 PARAGRAPH SEPARATOR character
3994 for the text covered by the display property.
3996 2011-08-25 Chong Yidong <cyd@stupidchicken.com>
3998 * buffer.c (Fbury_buffer_internal): Rename from Funrecord_buffer.
3999 Change return value to nil.
4000 (Frecord_buffer): Delete unused function.
4002 2011-08-24 Eli Zaretskii <eliz@gnu.org>
4004 * xdisp.c (Fcurrent_bidi_paragraph_direction): For unibyte
4005 buffers, return left-to-right.
4006 (set_cursor_from_row): Consider candidate row a win if its glyph
4007 represents a newline and point is on that newline. Fixes cursor
4008 positioning on the newline at EOL of R2L text within L2R
4009 paragraph, and vice versa.
4010 (try_cursor_movement): Check continued rows, in addition to
4011 continuation rows. Fixes unwarranted scroll when point enters a
4012 continued line of R2L text within an L2R paragraph, or vice versa.
4013 (cursor_row_p): Consider the case of point being equal to
4014 MATRIX_ROW_END_CHARPOS. Prevents cursor being stuck when moving
4015 from the end of a short line to the beginning of a continued line
4016 of R2L text within L2R paragraph.
4017 (RECORD_MAX_MIN_POS): For max_pos, use IT_CHARPOS even for
4018 composed characters.
4020 * bidi.c (bidi_check_type): Use xassert.
4021 (bidi_cache_iterator_state): Update the disp_pos and disp_prop_p
4024 2011-08-23 Eli Zaretskii <eliz@gnu.org>
4026 * bidi.c (bidi_get_type): Abort if we get zero as the bidi type of
4029 2011-08-23 Chong Yidong <cyd@stupidchicken.com>
4031 * nsfont.m (ns_otf_to_script): Fix typo.
4033 2011-08-22 Kenichi Handa <handa@m17n.org>
4035 * chartab.c (Fset_char_table_extra_slot): Do not inhibit setting a
4036 extra slot even if the purpose is char-code-property-table.
4038 2011-08-23 Eli Zaretskii <eliz@gnu.org>
4040 * xdisp.c (redisplay_window): When computing centering_position,
4041 account for the height of the header line. (Bug#8874)
4043 * dispnew.c (buffer_posn_from_coords): Use buf_charpos_to_bytepos
4044 instead of CHAR_TO_BYTE. Fixes a crash when a completion
4045 candidate is selected by the mouse, and that candidate has a
4046 composed character under the mouse.
4048 * xdisp.c (x_produce_glyphs): Set it->nglyphs to 1. Fixes pixel
4049 coordinates reported by pos-visible-in-window-p for a composed
4050 character in column zero.
4052 2011-08-23 Stefan Monnier <monnier@iro.umontreal.ca>
4054 * cmds.c (Fself_insert_command): Mention post-self-insert-hook.
4056 2011-08-22 Eli Zaretskii <eliz@gnu.org>
4058 * xdisp.c (BUFFER_POS_REACHED_P): If this is a composition,
4059 consider it a hit if to_charpos is anywhere in the range of the
4060 composed buffer positions.
4062 2011-08-22 Chong Yidong <cyd@stupidchicken.com>
4064 * image.c (gif_load): Don't assume that each subimage has the same
4065 dimensions as the base image. Handle disposal method that is
4066 "undefined" by the gif spec (Bug#9335).
4068 2011-08-20 Chong Yidong <cyd@stupidchicken.com>
4070 * eval.c (Fsignal): Handle `debug' symbol in error handler (Bug#9329).
4071 (Fcondition_case): Document `debug' symbol in error handler.
4073 2011-08-19 Eli Zaretskii <eliz@gnu.org>
4075 * xfaces.c (face_at_buffer_position): Avoid repeated evaluation of
4076 face ID by FACE_FROM_ID, and avoid a crash when mouse is moved
4077 from an Org mode buffer to a Speedbar frame.
4079 * xdisp.c (RECORD_MAX_MIN_POS): If the display element comes from
4080 a composition, take its buffer position from IT->cmp_it.charpos.
4081 Fixes cursor positioning at the beginning of a line that begins
4082 with a composed character.
4084 2011-08-18 Eli Zaretskii <eliz@gnu.org>
4086 * bidi.c (bidi_get_type): If bidi_type_table reports zero as the
4087 character bidirectional type, use STRONG_L instead. Fixes crashes
4088 in a buffer produced by `describe-categories'.
4090 * dispextern.h (struct bidi_it): Move disp_pos and disp_prop_p
4091 members before the level stack, so they would be saved and
4092 restored when copying iterator state. Fixes incorrect reordering
4093 around TABs covered by display properties.
4095 2011-08-18 Andreas Schwab <schwab@linux-m68k.org>
4097 * process.c (Fnetwork_interface_list): Correctly determine buffer size.
4099 2011-08-17 Chong Yidong <cyd@stupidchicken.com>
4101 * eval.c (internal_condition_case, internal_condition_case_1)
4102 (internal_condition_case_2, internal_condition_case_n):
4103 Remove unnecessary aborts (Bug#9081).
4105 2011-08-17 Eli Zaretskii <eliz@gnu.org>
4107 * lread.c (Fload) [DOS_NT]: If `openp' returns -2, but the file
4108 has no `load' handler, try opening the file locally. (Bug#9311)
4110 2011-08-16 Ken Brown <kbrown@cornell.edu>
4112 * gmalloc.c: Expand comment.
4114 2011-08-16 Eli Zaretskii <eliz@gnu.org>
4116 * xdisp.c (set_cursor_from_row): Don't accept a previous candidate
4117 if it fails the cursor_row_p test. Fixes cursor positioning at ZV.
4119 2011-08-16 Ken Brown <kbrown@cornell.edu>
4121 Fix memory allocation problems in Cygwin build (Bug#9273).
4123 * unexcw.c ( __malloc_initialized): Declare external variable.
4124 (fixup_executable): Force the dumped emacs to reinitialize malloc.
4126 * gmalloc.c [CYGWIN] (bss_sbrk_heapbase, bss_sbrk_heapinfo):
4128 (malloc_initialize_1) [CYGWIN]: Prepare for reinitializing the
4130 (_free_internal_nolock) [CYGWIN]: Ignore requests to free storage
4132 [CYGWIN] (special_realloc): New function.
4133 (_realloc_internal_nolock) [CYGWIN]: Use the new function on
4134 requests to realloc storage in the static heap.
4136 2011-08-15 Paul Eggert <eggert@cs.ucla.edu>
4138 * bidi.c (bidi_initialize): Remove unused local.
4140 2011-08-15 Eli Zaretskii <eliz@gnu.org>
4143 * biditype.h: Remove file.
4144 * makefile.w32-in ($(BLD)/bidi.$(O)):
4145 * deps.mk (bidi.o): Remove biditype.h and bidimirror.h.
4147 * dispextern.h: Fix a typo in the comment to bidi_type_t.
4149 * chartab.c: Improve commentary for the uniprop_table API.
4151 * bidi.c (bidi_paragraph_init): Support zero value of
4152 bidi_ignore_explicit_marks_for_paragraph_level.
4153 (bidi_initialize): Use uniprop_table instead of including
4154 biditype.h and bidimirror.h.
4156 * xdisp.c (move_it_in_display_line_to): Don't reset pixel
4157 coordinates of the iterator when restoring from ppos_it.
4160 2011-08-14 Kenichi Handa <handa@m17n.org>
4162 * process.c (create_process): Call setup_process_coding_systems
4163 after the pid of the process is set to -1 (Bug#8162).
4165 2011-08-14 Eli Zaretskii <eliz@gnu.org>
4167 * xdisp.c (move_it_in_display_line_to): Don't invoke
4168 IT_RESET_X_ASCENT_DESCENT when iterator position was restored from
4169 ppos_it. Fixes vertical cursor motion when line beginning is
4170 covered by an image. (Bug#9296)
4172 2011-08-14 Jan Djärv <jan.h.d@swipnet.se>
4174 * nsterm.h (ns_run_ascript): Declare.
4175 (NSAPP_DATA2_RUNASSCRIPT): Define.
4177 * nsfns.m (as_script, as_result, as_status): New static variables.
4178 (ns_run_ascript): New function.
4179 (Fns_do_applescript): Set variables as_*. Make an NSApplicationDefined
4180 event with data2 set to NSAPP_DATA2_RUNASSCRIPT, post it and then start
4181 the event loop. Get status from as_status (Bug#7276).
4183 * nsterm.m (sendEvent): If event is NSApplicationDefined and
4184 data2 is NSAPP_DATA2_RUNASSCRIPT, call ns_run_ascript and then exit
4185 the event loop (Bug#7276).
4187 2011-08-14 Andreas Schwab <schwab@linux-m68k.org>
4189 * gnutls.c (QCgnutls_bootprop_priority)
4190 (QCgnutls_bootprop_trustfiles, QCgnutls_bootprop_keylist)
4191 (QCgnutls_bootprop_crlfiles, QCgnutls_bootprop_callbacks)
4192 (QCgnutls_bootprop_loglevel, QCgnutls_bootprop_hostname)
4193 (QCgnutls_bootprop_min_prime_bits, QCgnutls_bootprop_verify_flags)
4194 (QCgnutls_bootprop_verify_hostname_error)
4195 (QCgnutls_bootprop_callbacks_verify): Rename from
4196 Qgnutls_bootprop_..., all uses changed.
4198 * xfaces.c (QCignore_defface): Rename from Qignore_defface, all
4201 2011-08-14 Paul Eggert <eggert@cs.ucla.edu>
4203 * xfaces.c (Qframe_set_background_mode): Now static.
4204 * dispextern.h (Qframe_set_background_mode): Remove decl.
4206 * process.c (Fnetwork_interface_info): Declare local only if needed.
4208 2011-08-13 Jan Djärv <jan.h.d@swipnet.se>
4210 * process.c: Include ifaddrs.h and net/if_dl.h if available (Bug#8477).
4211 (Fnetwork_interface_list): Allocate in increments of bytes instead
4212 of sizeof (struct ifreq). Iterate over ifconf.ifc_req by counting
4213 bytes (Bug#8477). Count bytes correctly when ifr_addr is a struct
4215 (struct ifflag_def): notrailers is smart on OSX.
4216 (Fnetwork_interface_info): Handle case when ifr_flags is negative.
4217 Get hardware address with getifaddrs if available.
4219 2011-08-12 Eli Zaretskii <eliz@gnu.org>
4221 * xdisp.c (iterate_out_of_display_property): xassert that
4222 IT->position is set to within IT->object's boundaries. Break from
4223 the loop as soon as EOB is reached; avoids infloops in redisplay
4224 when IT->position is set up wrongly due to some bug.
4225 Set IT->current to match the bidi iterator unconditionally.
4226 (push_display_prop): Allow GET_FROM_STRING as IT->method on
4227 entry. Force push_it to save on the stack the current
4228 buffer/string position, to be restored by pop_it. Fix flags in
4229 the iterator structure wrt the object coming from a display
4230 property, as `line-prefix' and `wrap-prefix' are not ``replacing''
4231 properties. (Bug#9284)
4233 2011-08-09 Andreas Schwab <schwab@linux-m68k.org>
4235 * fontset.c (fontset_get_font_group): Add proper type checks.
4238 2011-08-09 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
4240 * unexmacosx.c (print_load_command_name): Add cases LC_FUNCTION_STARTS
4241 and LC_VERSION_MIN_MACOSX.
4242 (copy_linkedit_data) [LC_FUNCTION_STARTS]: New function.
4243 (dump_it) [LC_FUNCTION_STARTS]: Use it.
4245 2011-08-08 Eli Zaretskii <eliz@gnu.org>
4247 * xdisp.c (forward_to_next_line_start): Allow to use the
4248 no-display-properties-and-no-overlays under bidi display.
4249 Set disp_pos in the bidi iterator to avoid searches for display
4250 properties and overlays.
4252 2011-08-08 Chong Yidong <cyd@stupidchicken.com>
4254 * editfns.c (Fset_time_zone_rule): Document relationship with the
4257 * ftfont.c (ftfont_pattern_entity): Copy the extras argument to
4258 the font entity extracted from the cache (Bug#8109).
4260 2011-08-07 Chong Yidong <cyd@stupidchicken.com>
4262 * composite.c (autocmp_chars): Don't reset point. That is done by
4263 restore_point_unwind (Bug#5984).
4265 2011-08-07 Juri Linkov <juri@jurta.org>
4267 * editfns.c (Fformat_time_string): Doc fix, add tag `usage:'
4268 to show the arg `TIME' instead of `TIMEVAL'.
4270 2011-08-06 Eli Zaretskii <eliz@gnu.org>
4272 * xdisp.c (set_cursor_from_row): Fix cursor positioning when a
4273 display property strides EOL and includes a newline, as in
4274 longlines-mode. (Bug#9254)
4275 (move_it_in_display_line_to): Fix vertical-motion in a buffer with
4276 word-wrap under bidirectional display. (Bug#9224)
4278 * bidi.c (bidi_unshelve_cache): Don't reset the cache if JUST_FREE
4279 is non-zero, even if the data buffer is NULL. Fixes a crash in
4280 vertical-motion with longlines-mode. (Bug#9254)
4282 2011-08-05 Eli Zaretskii <eliz@gnu.org>
4284 * bidi.c <bidi_cache_total_alloc>: Now static.
4285 (bidi_initialize): Initialize bidi_cache_total_alloc.
4287 * xdisp.c (display_line): Release buffer allocated for shelved bidi
4290 * bidi.c (bidi_shelve_cache, bidi_unshelve_cache): Track total
4291 amount allocated this far in `bidi_cache_total_alloc'.
4292 (bidi_unshelve_cache): Accept an additional argument JUST_FREE; if
4293 non-zero, only free the data buffer without restoring the cache
4294 contents. All callers changed.
4296 * dispextern.h (bidi_unshelve_cache): Update prototype.
4298 * xdisp.c (SAVE_IT, pos_visible_p, move_it_in_display_line_to)
4299 (move_it_in_display_line, move_it_to)
4300 (move_it_vertically_backward, move_it_by_lines): Replace the call
4301 to xfree to an equivalent call to bidi_unshelve_cache.
4302 (move_it_in_display_line_to): Fix logic of returning
4303 MOVE_POS_MATCH_OR_ZV in the bidi case. (Bug#9224)
4305 2011-08-05 Eli Zaretskii <eliz@gnu.org>
4307 * xdisp.c (set_cursor_from_row): Prefer the candidate glyph that
4308 came from a string character with a `cursor' property. (Bug#9229)
4310 2011-08-04 Jan Djärv <jan.h.d@swipnet.se>
4312 * Makefile.in (LIB_PTHREAD): New variable.
4313 (LIBES): Add LIB_PTHREAD (Bug#9216).
4315 * alloc.c, emacs.c, gmalloc.c, gtkutil.c, keyboard.c, syssignal.h:
4316 Rename HAVE_GTK_AND_PTHREAD to HAVE_PTHREAD (Bug#9216).
4318 2011-08-04 Andreas Schwab <schwab@linux-m68k.org>
4320 * regex.c (re_iswctype): Remove some redundant boolean conversions.
4322 2011-08-04 Jan Djärv <jan.h.d@swipnet.se>
4324 * xterm.c (x_find_topmost_parent): New function.
4325 (x_set_frame_alpha): Find topmost parent window with
4326 x_find_topmost_parent and set the property there also (bug#9181).
4327 (handle_one_xevent): Call x_set_frame_alpha on ReparentNotify.
4329 2011-08-04 Paul Eggert <eggert@cs.ucla.edu>
4331 * callproc.c (Fcall_process): Avoid vfork clobbering
4332 the local vars buffer, coding_systems, current_dir.
4334 2011-08-03 Stefan Monnier <monnier@iro.umontreal.ca>
4336 * keymap.c (Fmake_composed_keymap): Move to subr.el.
4338 2011-08-03 Paul Eggert <eggert@cs.ucla.edu>
4340 * fontset.c (dump_fontset) [FONTSET_DEBUG]: Declare EXTERNALLY_VISIBLE
4341 so that it is not optimized away.
4343 * xdisp.c (compute_display_string_pos): Remove unused local.
4345 2011-08-02 Eli Zaretskii <eliz@gnu.org>
4347 Fix slow cursor motion and scrolling in large buffers with
4348 selective display, like Org Mode buffers. (Bug#9218)
4350 * dispextern.h (struct bidi_it): New member disp_prop_p.
4352 * xdisp.c: Remove one-slot cache of display string positions.
4353 (compute_display_string_pos): Accept an additional argument
4354 DISP_PROP_P; callers changed. Scan at most 5K characters forward
4355 for a display string or property. If found, set DISP_PROP_P
4358 * bidi.c (bidi_fetch_char): Accept an additional argument
4359 DISP_PROP_P, and pass it to compute_display_string_pos.
4360 Only handle text covered by a display string if DISP_PROP_P is returned
4361 non-zero. All callers of bidi_fetch_char changed.
4363 2011-08-02 Stefan Monnier <monnier@iro.umontreal.ca>
4365 * keymap.c (Fdefine_key): Fix Lisp_Object/int mixup; apply some CSE.
4367 2010-12-03 Don March <don@ohspite.net>
4369 * keymap.c (Fdefine_key): Fix non-prefix key error message when
4370 last character M-[char] is translated to ESC [char] (bug#7541).
4372 2011-08-02 Kenichi Handa <handa@m17n.org>
4374 * lisp.h (uniprop_table): Extern it.
4376 * chartab.c (uniprop_table): Make it non-static.
4378 2011-08-01 Eli Zaretskii <eliz@gnu.org>
4380 * xdisp.c (forward_to_next_line_start): Accept additional argument
4381 BIDI_IT_PREV, and store into it the state of the bidi iterator had
4383 (reseat_at_next_visible_line_start): Use the bidi iterator state
4384 returned by forward_to_next_line_start to restore the state of
4385 it->bidi_it after backing up to previous newline. (Bug#9212)
4387 2011-07-30 Andreas Schwab <schwab@linux-m68k.org>
4389 * regex.c (re_comp): Protoize.
4390 (re_exec): Fix return type.
4391 (regexec): Fix type of `ret'. (Bug#9203)
4393 2011-07-28 Paul Eggert <eggert@cs.ucla.edu>
4395 * image.c (check_image_size): Use 1024x1024 if unknown frame (Bug#9189).
4396 This is needed if max-image-size is a floating-point number.
4398 2011-07-28 Andreas Schwab <schwab@linux-m68k.org>
4400 * print.c (print_object): Print empty symbol as ##.
4402 * lread.c (read1): Read ## as empty symbol.
4404 2011-07-28 Alp Aker <alp.tekin.aker@gmail.com>
4406 * nsfns.m (x_set_foreground_color): Set f->foreground_pixel when
4407 setting frame foreground color (Bug#9175).
4408 (x_set_background_color): Likewise.
4410 * nsmenu.m (-setText): Size tooltip dimensions precisely to
4411 contents (Bug#9176).
4412 (EmacsTooltip -init): Remove bezels and add shadows to
4415 * nsterm.m (ns_dumpglyphs_stretch): Avoid overwriting left fringe
4416 or scroll bar (Bug#8470).
4418 * nsfont.m (nsfont_open): Remove assignment to voffset and
4419 unnecessary vars hshink, expand, hd, full_height, min_height.
4420 (nsfont_draw): Use s->ybase as baseline for glyph drawing (Bug#8913).
4422 * nsterm.h (nsfont_info): Remove voffset field.
4424 2011-07-28 Alp Aker <alp.tekin.aker@gmail.com>
4426 Implement strike-through and overline on NextStep (Bug#8863).
4428 * nsfont.m (nsfont_open): Use underline position provided by font,
4429 instead of hard-coded value of 2.
4430 (nsfont_draw): Call ns_draw_text_decoration instead.
4432 * nsterm.h: Add declaration for ns_draw_text_decoration.
4434 * nsterm.m (ns_draw_text_decoration): New function for drawing
4435 underline, overline, and strike-through.
4436 (ns_dumpglyphs_image, ns_dumpglyphs_stretch): Add call to
4437 ns_draw_text_decoration. Change treatment of cursor drawing to
4438 accommodate underlining, etc.
4440 2011-07-28 Eli Zaretskii <eliz@gnu.org>
4442 * buffer.c (init_buffer_once): Set bidi-display-reordering to t by
4445 2011-07-28 Paul Eggert <eggert@cs.ucla.edu>
4447 * alloc.c (memory_full) [!SYNC_INPUT]: Fix signal-related race.
4448 Without this fix, if a signal arrives just after memory fills up,
4449 'malloc' might be invoked reentrantly.
4451 * image.c (x_check_image_size) [!HAVE_X_WINDOWS]: Return 1.
4452 In other words, assume that every image size is allowed, on non-X
4453 hosts. This assumption is probably wrong, but it lets Emacs compile.
4455 2011-07-28 Andreas Schwab <schwab@linux-m68k.org>
4457 * regex.c (re_iswctype): Convert return values to boolean.
4459 2011-07-28 Eli Zaretskii <eliz@fencepost.gnu.org>
4461 * xdisp.c (compute_display_string_pos): Don't use cached display
4462 string position if the buffer had its restriction changed.
4465 2011-07-28 Paul Eggert <eggert@cs.ucla.edu>
4467 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork clobbering.
4469 2011-07-28 Paul Eggert <eggert@cs.ucla.edu>
4471 Integer signedness and overflow and related fixes. (Bug#9079)
4473 * bidi.c: Integer size and overflow fixes.
4474 (bidi_cache_size, bidi_cache_idx, bidi_cache_last_idx)
4475 (bidi_cache_start, bidi_cache_fetch_state, bidi_cache_search)
4476 (bidi_cache_find_level_change, bidi_cache_ensure_space)
4477 (bidi_cache_iterator_state, bidi_cache_find, bidi_cache_start_stack)
4478 (bidi_find_other_level_edge):
4479 Use ptrdiff_t instead of EMACS_INT where either will do.
4480 This works better on 32-bit hosts configured --with-wide-int.
4481 (bidi_cache_ensure_space): Check for size-calculation overflow.
4482 Use % rather than repeated addition, for better worst-case speed.
4483 Don't set bidi_cache_size until after xrealloc returns, because it
4485 (bidi_dump_cached_states): Use ptrdiff_t, not int, to avoid overflow.
4486 (bidi_cache_ensure_space): Also check that the bidi cache size
4487 does not exceed that of the largest Lisp string or buffer. See Eli
4488 Zaretskii in <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9079#29>.
4490 * alloc.c (__malloc_size_t): Remove.
4491 All uses replaced by size_t. See Andreas Schwab's note
4492 <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9079#8>.
4494 * image.c: Improve checking for integer overflow.
4495 (check_image_size): Assume that f is nonnull, since
4496 it is always nonnull in practice. This is one less thing to
4497 worry about when checking for integer overflow later.
4498 (x_check_image_size): New function, which checks for integer
4499 overflow issues inside X.
4500 (x_create_x_image_and_pixmap, xbm_read_bitmap_data): Use it.
4501 This removes the need for a memory_full check.
4502 (xbm_image_p): Rewrite to avoid integer multiplication overflow.
4503 (Create_Pixmap_From_Bitmap_Data, xbm_load): Use x_check_image_size.
4504 (xbm_read_bitmap_data): Change locals back to 'int', since
4505 their values must fit in 'int'.
4506 (xpm_load_image, png_load, tiff_load):
4507 Invoke x_create_x_image_and_pixmap earlier,
4508 to avoid much needless work if the image is too large.
4509 (tiff_load): Treat overly large images as if
4510 x_create_x_image_and_pixmap failed, not as malloc failures.
4511 (gs_load): Use x_check_image_size.
4513 * gtkutil.c: Omit integer casts.
4514 (xg_get_pixbuf_from_pixmap): Remove unnecessary cast.
4515 (xg_set_toolkit_scroll_bar_thumb): Rewrite to avoid need for cast.
4517 * image.c (png_load): Don't assume height * row_bytes fits in 'int'.
4519 * xfaces.c (Fbitmap_spec_p): Fix integer overflow bug.
4520 Without this fix, (bitmap-spec-p '(34359738368 1 "x"))
4521 would wrongly return t on a 64-bit host.
4523 * dispnew.c (init_display): Use *_RANGE_OVERFLOW macros.
4524 The plain *_OVERFLOW macros run afoul of GCC bug 49705
4525 <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49705>
4526 and therefore cause GCC to emit a bogus diagnostic in some cases.
4528 * image.c: Integer signedness and overflow and related fixes.
4529 This is not an exhaustive set of fixes, but it's time to
4530 record what I've got.
4531 (lookup_pixel_color, check_image_size): Remove redundant decls.
4532 (check_image_size): Don't assume that arbitrary EMACS_INT values
4533 fit in 'int', or that arbitrary 'double' values fit in 'int'.
4534 (x_alloc_image_color, x_create_x_image_and_pixmap, png_load)
4535 (tiff_load, imagemagick_load_image):
4536 Check for overflow in size calculations.
4537 (x_create_x_image_and_pixmap): Remove unnecessary test for
4538 xmalloc returning NULL; that can't happen.
4539 (xbm_read_bitmap_data): Don't assume sizes fit into 'int'.
4540 (xpm_color_bucket): Use better integer hashing function.
4541 (xpm_cache_color): Don't possibly over-allocate memory.
4542 (struct png_memory_storage, tiff_memory_source, tiff_seek_in_memory)
4543 (gif_memory_source):
4544 Use ptrdiff_t, not int or size_t, to record sizes.
4545 (png_load): Don't assume values greater than 2**31 fit in 'int'.
4546 (our_stdio_fill_input_buffer): Prefer ptrdiff_t to size_t when
4547 either works, as we prefer signed integers.
4548 (tiff_read_from_memory, tiff_write_from_memory):
4549 Return tsize_t, not size_t, since that's what the TIFF API wants.
4550 (tiff_read_from_memory): Don't fail simply because the read would
4551 go past EOF; instead, return a short read.
4552 (tiff_load): Omit no-longer-needed casts.
4553 (Fimagemagick_types): Don't assume size fits into 'int'.
4555 Improve hashing quality when configured --with-wide-int.
4556 * fns.c (hash_string): New function, taken from sxhash_string.
4557 Do not discard information about ASCII character case; this
4558 discarding is no longer needed.
4559 (sxhash-string): Use it. Change sig to match it. Caller changed.
4560 * lisp.h: Declare it.
4561 * lread.c (hash_string): Remove, since we now use fns.c's version.
4562 The fns.c version returns a wider integer if --with-wide-int is
4563 specified, so this should help the quality of the hashing a bit.
4565 * emacs.c: Integer overflow minor fix.
4566 (heap_bss_diff): Now uprintmax_t, not unsigned long. All used changed.
4567 Define only if GNU_LINUX.
4568 (main, Fdump_emacs): Set and use heap_bss_diff only if GNU_LINUX.
4570 * dispnew.c: Integer signedness and overflow fixes.
4571 Remove unnecessary forward decls, that were a maintenance hassle.
4572 (history_tick): Now uprintmax_t, so it's more likely to avoid overflow.
4574 (adjust_glyph_matrix, realloc_glyph_pool, adjust_frame_message_buffer)
4575 (scrolling_window): Use ptrdiff_t, not int, for byte count.
4576 (prepare_desired_row, line_draw_cost):
4577 Use int, not unsigned, where either works.
4578 (save_current_matrix, restore_current_matrix):
4579 Use ptrdiff_t, not size_t, where either works.
4580 (init_display): Check for overflow more accurately, and without
4581 relying on undefined behavior.
4583 * editfns.c (pWIDE, pWIDElen, signed_wide, unsigned_wide):
4584 Remove, replacing with the new symbols in lisp.h. All uses changed.
4585 * fileio.c (make_temp_name):
4586 * filelock.c (lock_file_1, lock_file):
4587 * xdisp.c (message_dolog):
4588 Don't assume PRIdMAX etc. works; this isn't portable to pre-C99 hosts.
4589 Use pMd etc. instead.
4590 * lisp.h (printmax_t, uprintmax_t, pMd, pMu): New types and macros,
4591 replacing the pWIDE etc. symbols removed from editfns.c.
4593 * keyboard.h (num_input_events): Now uintmax_t.
4594 This is (very slightly) less likely to mess up due to wraparound.
4597 * buffer.c: Integer signedness fixes.
4598 (alloc_buffer_text, enlarge_buffer_text):
4599 Use ptrdiff_t rather than size_t when either will do, as we prefer
4602 * alloc.c: Integer signedness and overflow fixes.
4603 Do not impose an arbitrary 32-bit limit on malloc sizes when debugging.
4604 (__malloc_size_t): Default to size_t, not to int.
4605 (pure_size, pure_bytes_used_before_overflow, stack_copy_size)
4606 (Fgarbage_collect, mark_object_loop_halt, mark_object):
4607 Prefer ptrdiff_t to size_t when either would do, as we prefer
4609 (XMALLOC_OVERRUN_CHECK_OVERHEAD): New macro.
4610 (xmalloc_overrun_check_header, xmalloc_overrun_check_trailer):
4611 Now const. Initialize with values that are in range even if char
4613 (XMALLOC_PUT_SIZE, XMALLOC_GET_SIZE): Remove, replacing with ...
4614 (xmalloc_put_size, xmalloc_get_size): New functions. All uses changed.
4615 These functions do the right thing with sizes > 2**32.
4616 (check_depth): Now ptrdiff_t, not int.
4617 (overrun_check_malloc, overrun_check_realloc, overrun_check_free):
4618 Adjust to new way of storing sizes. Check for size overflow bugs
4620 (STRING_BYTES_MAX): Adjust to new overheads. The old code was
4621 slightly wrong anyway, as it missed one instance of
4622 XMALLOC_OVERRUN_CHECK_OVERHEAD.
4623 (refill_memory_reserve): Omit needless cast to size_t.
4624 (mark_object_loop_halt): Mark as externally visible.
4626 * xselect.c: Integer signedness and overflow fixes.
4627 (Fx_register_dnd_atom, x_handle_dnd_message):
4628 Use ptrdiff_t, not size_t, since we prefer signed.
4629 (Fx_register_dnd_atom): Check for ptrdiff_t (and size_t) overflow.
4630 * xterm.h (struct x_display_info): Use ptrdiff_t, not size_t, for
4631 x_dnd_atoms_size and x_dnd_atoms_length.
4633 * doprnt.c: Prefer signed to unsigned when either works.
4635 * doprnt.c (doprnt):
4637 * xdisp.c (vmessage):
4638 Use ptrdiff_t, not size_t, when using or implementing doprnt,
4639 since the sizes cannot exceed ptrdiff_t bounds anyway, and we
4640 prefer signed arithmetic to avoid comparison confusion.
4641 * doprnt.c (doprnt): Avoid a "+ 1" that can't overflow,
4642 but is a bit tricky.
4644 Assume freestanding C89 headers, string.h, stdlib.h.
4645 * data.c, doprnt.c, floatfns.c, print.c:
4646 Include float.h unconditionally.
4647 * gmalloc.c: Assume C89-at-least behavior for preprocessor,
4648 limits.h, stddef.h, string.h. Use memset instead of 'flood'.
4649 * regex.c: Likewise for stddef.h, string.h.
4650 (ISASCII): Remove; can assume it returns 1 now. All uses removed.
4651 * s/aix4-2.h (HAVE_STRING_H): Remove obsolete undef.
4652 * s/ms-w32.h (HAVE_LIMITS_H, HAVE_STRING_H, HAVE_STDLIB_H)
4653 (STDC_HEADERS): Remove obsolete defines.
4654 * sysdep.c: Include limits.h unconditionally.
4656 Assume support for memcmp, memcpy, memmove, memset.
4657 * lisp.h, sysdep.c (memcmp, memcpy, memmove, memset):
4658 * regex.c (memcmp, memcpy):
4659 Remove; we assume C89 now.
4661 * gmalloc.c (memcpy, memset, memmove): Remove; we assume C89 now.
4662 (__malloc_safe_bcopy): Remove; no longer needed.
4664 * lisp.h (struct vectorlike_header, struct Lisp_Subr): Signed sizes.
4665 Use EMACS_INT, not EMACS_UINT, for sizes. The code works equally
4666 well either way, and we prefer signed to unsigned.
4668 2011-07-27 Lars Magne Ingebrigtsen <larsi@gnus.org>
4670 * gnutls.c (emacs_gnutls_read): Don't message anything if the peer
4671 closes the connection while we're reading (bug#9182).
4673 2011-07-25 Jan Djärv <jan.h.d@swipnet.se>
4675 * nsmenu.m (ns_popup_dialog): Add an "ok" button if no buttons
4676 are specified (Bug#9168).
4678 2011-07-25 Paul Eggert <eggert@cs.ucla.edu>
4680 * bidi.c (bidi_dump_cached_states): Fix printf format mismatch.
4681 Found by GCC static checking and --with-wide-int on a 32-bit host.
4683 2011-07-25 Eli Zaretskii <eliz@gnu.org>
4685 * xdisp.c (compute_display_string_pos): Fix logic of caching
4686 previous display string position. Initialize cached_prev_pos to
4687 -1. Fixes slow-down at the beginning of a buffer.
4689 2011-07-24 Eli Zaretskii <eliz@gnu.org>
4691 * xfaces.c (check_lface_attrs) [HAVE_WINDOW_SYSTEM]: Allow `nil'
4692 for attrs[LFACE_FONTSET_INDEX].
4694 2011-07-23 Paul Eggert <eggert@cs.ucla.edu>
4696 * xml.c (parse_region): Remove unused local
4697 that was recently introduced.
4699 2011-07-23 Eli Zaretskii <eliz@gnu.org>
4701 * xfns.c (unwind_create_frame) [GLYPH_DEBUG]: Adapt to changes in
4702 2008-02-22T17:42:09Z!monnier@iro.umontreal.ca.
4704 * xdisp.c (move_it_in_display_line_to): Record the best matching
4705 position for TO_CHARPOS while scanning the line, and restore it on
4706 exit if none of the characters scanned was an exact match.
4707 Fixes vertical-motion and pos-visible-in-window-p under bidi redisplay
4708 when exact match is impossible due to invisible text, and the
4709 lines are truncated.
4711 2011-07-23 Jan Djärv <jan.h.d@swipnet.se>
4713 * nsterm.m (initFrameFromEmacs): Set NSTitledWindowMask in styleMask
4716 2011-07-22 Eli Zaretskii <eliz@gnu.org>
4718 Fix a significant slow-down of cursor motion with C-n, C-p,
4719 C-f/C-b, and C-v/M-v that couldn't keep up with keyboard
4720 auto-repeat under bidi redisplay in fontified buffers.
4721 * xdisp.c (compute_stop_pos_backwards): New function.
4722 (next_element_from_buffer): Call compute_stop_pos_backwards to
4723 find a suitable prev_stop when we find ourselves before
4725 (reseat): Don't look for prev_stop, as that could mean a very long
4727 <cached_disp_pos, cached_disp_buffer, cached_disp_modiff>
4728 <cached_disp_overlay_modiff>: Cache for last found display string
4730 (compute_display_string_pos): Return the cached position if asked
4731 about the same buffer in the same area of character positions, and
4732 the buffer wasn't changed since the time the display string
4733 position was cached.
4735 2011-07-22 Eli Zaretskii <eliz@gnu.org>
4737 * xdisp.c (rows_from_pos_range): Don't ignore glyphs whose object
4738 is an integer, which is important for empty lines. (Bug#9149)
4740 2011-07-22 Chong Yidong <cyd@stupidchicken.com>
4742 * frame.c (Fmodify_frame_parameters): In tty case, update the
4743 default face if necessary (Bug#4238).
4745 2011-07-21 Chong Yidong <cyd@stupidchicken.com>
4747 * editfns.c (Fstring_to_char): No need to explain what a character
4748 is in the docstring (Bug#6576).
4750 2011-07-20 Lars Magne Ingebrigtsen <larsi@gnus.org>
4752 * xml.c (parse_region): Make sure we always return a tree.
4754 2011-07-20 HAMANO Kiyoto <khiker.mail@gmail.com>
4756 * xml.c (parse_region): If a document contains only comments,
4759 2011-07-20 Lars Magne Ingebrigtsen <larsi@gnus.org>
4761 * xml.c (make_dom): Return comments, too.
4763 2011-07-19 Paul Eggert <eggert@cs.ucla.edu>
4766 See http://lists.gnu.org/archive/html/emacs-devel/2011-07/msg00688.html
4767 and the surrounding thread.
4768 * minibuf.c (read_minibuf_noninteractive): Rewrite to use getchar
4769 rather than fgets, and retry after EINTR. Otherwise, 'emacs
4770 --batch -f byte-compile-file' fails on OpenBSD if an inactivity
4772 * s/openbsd.h (BROKEN_SIGIO): Define.
4773 * unexelf.c (unexec) [__OpenBSD__]:
4774 Don't update the .mdebug section of the Alpha COFF symbol table.
4776 2011-07-19 Lars Magne Ingebrigtsen <larsi@gnus.org>
4778 * lread.c (syms_of_lread): Clarify when `lexical-binding' is used
4781 2011-07-18 Paul Eggert <eggert@cs.ucla.edu>
4783 * fileio.c (Fcopy_file) [!MSDOS]: Tighten created file's mask.
4784 This fixes some race conditions on the permissions of any newly
4787 * alloc.c (valid_pointer_p): Use pipe, not open.
4788 This fixes some permissions issues when debugging.
4790 * fileio.c (Fcopy_file): Adjust mode if fchown fails. (Bug#9002)
4791 If fchown fails to set both uid and gid, try to set just gid,
4792 as that is sometimes allowed. Adjust the file's mode to eliminate
4793 setuid or setgid bits that are inappropriate if fchown fails.
4795 2011-07-18 Stefan Monnier <monnier@iro.umontreal.ca>
4797 * xdisp.c (next_element_from_string, next_element_from_buffer): Use EQ
4798 to compare Lisp_Objects.
4799 * gnutls.c (syms_of_gnutls): Rename Vgnutls_log_level to
4800 global_gnutls_log_level, don't mistake it for a Lisp_Object.
4801 (init_gnutls_functions, emacs_gnutls_handle_error): Fix up uses.
4803 2011-07-17 Andreas Schwab <schwab@linux-m68k.org>
4805 * lread.c (read_integer): Unread even EOF character.
4806 (read1): Likewise. Properly record start position of symbol.
4808 * lread.c (read1): Read `#:' as empty uninterned symbol if no
4809 symbol character follows.
4811 2011-07-17 Paul Eggert <eggert@cs.ucla.edu>
4813 * fileio.c (Fcopy_file): Pacify gcc re fchown. (Bug#9002)
4814 This works around a problem with the previous change to Fcopy_file.
4815 Recent glibc declares fchown with __attribute__((warn_unused_result)),
4816 and without this change, GCC might complain about discarding
4817 fchown's return value.
4819 2011-07-16 Juanma Barranquero <lekktu@gmail.com>
4821 * makefile.w32-in (GLOBAL_SOURCES): Add gnutls.c (followup to bug#9059).
4823 2011-07-16 Paul Eggert <eggert@cs.ucla.edu>
4825 * fileio.c (Fcopy_file): Don't diagnose fchown failures. (Bug#9002)
4827 2011-07-16 Lars Magne Ingebrigtsen <larsi@gnus.org>
4829 * gnutls.c (syms_of_gnutls): Define `gnutls-log-level' here, since
4830 it's used from the C level.
4832 * process.c: Use the same condition for POLL_FOR_INPUT in both
4833 keyboard.c and process.c (bug#1858).
4835 2011-07-09 Lawrence Mitchell <wence@gmx.li>
4837 * gnutls.c (Qgnutls_bootprop_min_prime_bits): New variable.
4838 (Fgnutls_boot): Use it.
4840 2011-07-15 Andreas Schwab <schwab@linux-m68k.org>
4842 * doc.c (Fsubstitute_command_keys): Revert last change.
4844 2011-07-15 Lars Magne Ingebrigtsen <larsi@gnus.org>
4846 * doc.c (Fsubstitute_command_keys): Clarify that \= really only
4847 quotes the next character, and doesn't affect other longer
4848 sequences (bug#8935).
4850 * lread.c (syms_of_lread): Clarify that is isn't only
4851 `eval-buffer' and `eval-defun' that's affected by
4852 `lexical-binding' (bug#8460).
4854 2011-07-15 Eli Zaretskii <eliz@gnu.org>
4856 * xdisp.c (move_it_in_display_line_to): Fix vertical motion with
4857 bidi redisplay when a line includes both an image and is truncated.
4859 2011-07-14 Paul Eggert <eggert@cs.ucla.edu>
4861 Fix minor problems found by static checking.
4862 * bidi.c (bidi_cache_size): Now EMACS_INT, not size_t.
4863 (elsz): Now a signed constant, not a size_t var. We prefer signed
4864 types to unsigned, to avoid integer comparison confusion. Without
4865 this change, GCC 4.6.1 with -Wunsafe-loop-optimizations complains
4866 "cannot optimize loop, the loop counter may overflow", a symptom
4868 * indent.c (Fvertical_motion): Mark locals as initialized.
4869 * xdisp.c (reseat_to_string): Fix pointer signedness issue.
4871 2011-07-14 Lars Magne Ingebrigtsen <larsi@gnus.org>
4873 * search.c (Fre_search_backward): Mention `case-fold-search' in
4874 all the re_search_* functions (bug#8138).
4876 * keyboard.c (Fopen_dribble_file): Document when the file is
4879 2011-07-14 Eli Zaretskii <eliz@gnu.org>
4881 * bidi.c (bidi_dump_cached_states): Fix format of displaying
4884 Support bidi reordering of display and overlay strings.
4885 * xdisp.c (compute_display_string_pos)
4886 (compute_display_string_end): Accept additional argument STRING.
4887 (init_iterator, reseat_1): Initialize bidi_it->string.s to NULL.
4888 (reseat_to_string): Initialize bidi_it->string.s and
4889 bidi_it->string.schars.
4890 (Fcurrent_bidi_paragraph_direction): Initialize itb.string.s to
4891 NULL (avoids a crash in bidi_paragraph_init).
4892 Initialize itb.string.lstring.
4893 (init_iterator): Call bidi_init_it only of a valid
4894 buffer position was specified. Initialize paragraph_embedding to
4896 (reseat_to_string): Initialize the bidi iterator.
4897 (display_string): If we need to ignore text properties of
4898 LISP_STRING, set IT->stop_charpos to IT->end_charpos. (The
4899 original value of -1 will not work with bidi.)
4900 (compute_display_string_pos): First arg is now struct
4901 `text_pos *'; all callers changed. Support display properties on
4903 (compute_display_string_end): Support display properties on Lisp
4905 (init_iterator, reseat_1, reseat_to_string): Initialize the
4906 string.bufpos member to 0 (zero, for compatibility with IT_CHARPOS
4907 when iterating on a string not from display properties).
4908 (compute_display_string_pos, compute_display_string_end):
4909 Fix calculation of the object to scan. Fixes an error when using
4911 (next_element_from_buffer): Don't abort when IT_CHARPOS is before
4912 base_level_stop; instead, set base_level_stop to BEGV.
4913 Fixes crashes in vertical-motion.
4914 (next_element_from_buffer): Improve commentary for when
4915 the iterator is before prev_stop.
4916 (init_iterator): Initialize bidi_p from the default value of
4917 bidi-display-reordering, not from buffer-local value. Use the
4918 buffer-local value only if initializing for buffer iteration.
4919 (handle_invisible_prop): Support invisible properties on strings
4920 that are being bidi-reordered.
4921 (set_iterator_to_next): Support bidi reordering of C strings and
4923 (next_element_from_string): Support bidi reordering of Lisp
4925 (handle_stop_backwards): Support Lisp strings as well.
4926 (display_string): Support display of R2L glyph rows.
4927 Use IT_STRING_CHARPOS when displaying from a Lisp string.
4928 (init_iterator): Don't initialize it->bidi_p for strings
4930 (reseat_to_string): Initialize it->bidi_p for strings here.
4931 (next_element_from_string, next_element_from_c_string)
4932 (next_element_from_buffer): Add xassert's for correspondence
4933 between IT's object being iterated and it->bidi_it.string
4935 (face_before_or_after_it_pos): Support bidi iteration.
4936 (next_element_from_c_string): Handle the case of the first string
4937 character that is not the first one in the visual order.
4938 (get_visually_first_element): New function, refactored from common
4939 parts of next_element_from_buffer, next_element_from_string, and
4940 next_element_from_c_string.
4941 (tool_bar_lines_needed, redisplay_tool_bar)
4942 (display_menu_bar): Force left-to-right direction. Add a FIXME
4943 comment for making that be controlled by a user option.
4944 (push_it, pop_it): Save and restore the state of the
4945 bidi iterator. Save and restore the bidi_p flag.
4946 (pop_it): Iterate out of display property for string iteration as
4948 (iterate_out_of_display_property): Support iteration over strings.
4949 (handle_single_display_spec): Set up it->bidi_it for iteration
4950 over a display string, and call bidi_init_it.
4951 (handle_single_display_spec, next_overlay_string)
4952 (get_overlay_strings_1, push_display_prop): Set up the bidi
4953 iterator for displaying display or overlay strings.
4954 (forward_to_next_line_start): Don't use the shortcut if
4956 (back_to_previous_visible_line_start): If handle_display_prop
4957 pushed the iterator stack, restore the internal state of the bidi
4958 iterator by calling bidi_pop_it same number of times.
4959 (reseat_at_next_visible_line_start): If ON_NEWLINE_P is non-zero,
4960 and we are bidi-iterating, don't decrement the iterator position;
4961 instead, set the first_elt flag in the bidi iterator, to produce
4963 (reseat_1): Remove redundant setting of string_from_display_prop_p.
4964 (push_display_prop): xassert that we are iterating a buffer.
4965 (push_it, pop_it): Save and restore paragraph_embedding member.
4966 (handle_single_display_spec, next_overlay_string)
4967 (get_overlay_strings_1, reseat_1, reseat_to_string)
4968 (push_display_prop): Set up the `unibyte' member of bidi_it.string
4969 correctly. Don't assume unibyte strings are not bidi-reordered.
4970 (compute_display_string_pos)
4971 (compute_display_string_end): Fix handling the case of C string.
4972 (push_it, pop_it): Save and restore from_disp_prop_p.
4973 (handle_single_display_spec, push_display_prop): Set the
4974 from_disp_prop_p flag.
4975 (get_overlay_strings_1): Reset the from_disp_prop_p flag.
4976 (pop_it): Call iterate_out_of_display_property only if we are
4977 popping after iteration over a string that came from a display
4978 property. Fix a typo in popping stretch info. Add an assertion
4979 for verifying that the iterator position is in sync with the bidi
4981 (handle_single_display_spec, get_overlay_strings_1)
4982 (push_display_prop): Fix initialization of paragraph direction for
4983 string when that of the parent object is not yet determined.
4984 (reseat_1): Call bidi_init_it to resync the bidi
4985 iterator with IT's position. (Bug#7616)
4986 (find_row_edges): If ROW->start.pos gives position
4987 smaller than min_pos, use it as ROW->minpos. (Bug#7616)
4988 (handle_stop, back_to_previous_visible_line_start, reseat_1):
4989 Reset the from_disp_prop_p flag.
4990 (SAVE_IT, RESTORE_IT): New macros.
4991 (pos_visible_p, face_before_or_after_it_pos)
4992 (back_to_previous_visible_line_start)
4993 (move_it_in_display_line_to, move_it_in_display_line)
4994 (move_it_to, move_it_vertically_backward, move_it_by_lines)
4995 (try_scrolling, redisplay_window, display_line): Use them when
4996 saving a temporary copy of the iterator and restoring it back.
4997 (back_to_previous_visible_line_start, reseat_1)
4998 (init_iterator): Empty the bidi cache "stack".
4999 (move_it_in_display_line_to): If iterator ended up at
5000 EOL, but we never saw any buffer positions smaller than
5001 to_charpos, return MOVE_POS_MATCH_OR_ZV. Fixes vertical cursor
5002 motion in bidi-reordered lines.
5003 (move_it_in_display_line_to): Record prev_method and prev_pos
5004 immediately before the call to set_iterator_to_next. Fixes cursor
5005 motion in bidi-reordered lines with stretch glyphs and strings
5006 displayed in margins. (Bug#8133) (Bug#8867)
5007 Return MOVE_POS_MATCH_OR_ZV only if iterator position is past
5009 (pos_visible_p): Support positions in bidi-reordered lines.
5010 Save and restore bidi cache.
5012 * bidi.c (bidi_level_of_next_char): clen should be EMACS_NT, not int.
5013 (bidi_paragraph_info): Delete unused struct.
5014 (bidi_cache_idx, bidi_cache_last_idx): Declare EMACS_INT.
5015 (bidi_cache_start): New variable.
5016 (bidi_cache_reset): Reset bidi_cache_idx to bidi_cache_start, not
5018 (bidi_cache_fetch_state, bidi_cache_search)
5019 (bidi_cache_find_level_change, bidi_cache_iterator_state)
5020 (bidi_cache_find, bidi_peek_at_next_level)
5021 (bidi_level_of_next_char, bidi_find_other_level_edge)
5022 (bidi_move_to_visually_next): Compare cache index with
5023 bidi_cache_start rather than with zero.
5024 (bidi_fetch_char): Accept new argument STRING; all callers
5025 changed. Support iteration over a string. Support strings with
5026 display properties. Support unibyte strings. Fix the type of
5027 `len' according to what STRING_CHAR_AND_LENGTH expects.
5028 (bidi_paragraph_init, bidi_resolve_explicit_1)
5029 (bidi_resolve_explicit, bidi_resolve_weak)
5030 (bidi_level_of_next_char, bidi_move_to_visually_next):
5031 Support iteration over a string.
5032 (bidi_set_sor_type, bidi_resolve_explicit_1)
5033 (bidi_resolve_explicit, bidi_type_of_next_char): ignore_bn_limit
5034 can now be zero (for strings); special values 0 and -1 were
5035 changed to -1 and -2, respectively.
5036 (bidi_char_at_pos): New function.
5037 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak):
5038 Call it instead of FETCH_MULTIBYTE_CHAR.
5039 (bidi_move_to_visually_next): Abort if charpos or bytepos were not
5040 initialized to valid values.
5041 (bidi_init_it): Don't initialize charpos and bytepos with invalid
5043 (bidi_level_of_next_char): Allow the sentinel "position" to pass
5044 the test for valid cached positions. Fix the logic for looking up
5045 the sentinel state in the cache. GCPRO the Lisp string we are
5047 (bidi_push_it, bidi_pop_it): New functions.
5048 (bidi_initialize): Initialize the bidi cache start stack pointer.
5049 (bidi_cache_ensure_space): New function, refactored from part of
5050 bidi_cache_iterator_state. Don't assume the required size is just
5051 one BIDI_CACHE_CHUNK away.
5052 (bidi_cache_start_stack, bidi_push_it): Use IT_STACK_SIZE.
5053 (bidi_count_bytes, bidi_char_at_pos): New functions.
5054 (bidi_cache_search): Don't assume bidi_cache_last_idx is
5055 always valid if bidi_cache_idx is valid.
5056 (bidi_cache_find_level_change): xassert that bidi_cache_last_idx
5057 is valid if it's going to be used.
5058 (bidi_shelve_cache, bidi_unshelve_cache): New functions.
5059 (bidi_cache_fetch_state, bidi_cache_search)
5060 (bidi_cache_find_level_change, bidi_cache_ensure_space)
5061 (bidi_cache_iterator_state, bidi_cache_find)
5062 (bidi_find_other_level_edge, bidi_cache_start_stack):
5063 All variables related to cache indices are now EMACS_INT.
5065 * dispextern.h (struct bidi_string_data): New structure.
5066 (struct bidi_it): New member `string'. Make flag members be 1-bit
5067 fields, and put them last in the struct.
5068 (compute_display_string_pos, compute_display_string_end):
5070 (bidi_push_it, bidi_pop_it): Add prototypes.
5071 (struct iterator_stack_entry): New members bidi_p,
5072 paragraph_embedding, and from_disp_prop_p.
5073 (struct it): Member bidi_p is now a bit field 1 bit wide.
5074 (bidi_shelve_cache, bidi_unshelve_cache):
5077 * .gdbinit (xvectype, xvector, xcompiled, xchartable, xboolvector)
5078 (xpr, xfont, xbacktrace): Use "header.size" when accessing vectors
5079 and vector-like objects.
5081 * dispnew.c (buffer_posn_from_coords): Save and restore the bidi
5082 cache around display iteration.
5084 * window.c (Fwindow_end, window_scroll_pixel_based)
5085 (displayed_window_lines, Frecenter): Save and restore the bidi
5086 cache around display iteration.
5088 2011-07-14 Lars Magne Ingebrigtsen <larsi@gnus.org>
5090 * editfns.c (Fdelete_region): Clarify the use of the named
5091 parameters (bug#6788).
5093 2011-07-14 Martin Rudalics <rudalics@gmx.at>
5095 * indent.c (Fvertical_motion): Set and restore w->pointm when
5096 saving and restoring the window's buffer (Bug#9006).
5098 2011-07-13 Lars Magne Ingebrigtsen <larsi@gnus.org>
5100 * editfns.c (Fstring_to_char): Clarify just what is returned
5101 (bug#6576). Text by Eli Zaretskii.
5103 2011-07-13 Juanma Barranquero <lekktu@gmail.com>
5105 * gnutls.c (init_gnutls_functions): Honor gnutls_log_level (bug#9059).
5107 2011-07-13 Eli Zaretskii <eliz@gnu.org>
5109 * buffer.c (mmap_find): Fix a typo.
5111 2011-07-13 Johan Bockgård <bojohan@gnu.org>
5113 Fix execution of x selection hooks.
5114 * xselect.c (Qx_lost_selection_functions)
5115 (Qx_sent_selection_functions): New vars.
5116 (syms_of_xselect): DEFSYM them.
5117 (x_handle_selection_request): Pass Qx_sent_selection_functions
5118 rather than Vx_sent_selection_functions to Frun_hook_with_args.
5119 (x_handle_selection_clear,x_clear_frame_selections):
5120 Pass Qx_lost_selection_functions rather than
5121 Vx_lost_selection_functions to Frun_hook_with_args.
5123 2011-07-13 Paul Eggert <eggert@cs.ucla.edu>
5125 * buffer.c (Fget_buffer_create): Initialize inhibit_shrinking.
5126 The old code sometimes used this field without initializing it.
5128 * alloc.c (gc_sweep): Don't read past end of array.
5129 In theory, the old code could also have corrupted Emacs internals,
5130 though it'd be very unlikely.
5132 2011-07-12 Andreas Schwab <schwab@linux-m68k.org>
5134 * character.c (Fcharacterp): Don't advertise optional ignored
5135 argument. (Bug#4026)
5137 2011-07-12 Lars Magne Ingebrigtsen <larsi@gnus.org>
5139 * keymap.c (syms_of_keymap): Clarify that "modifier" is "modifier
5142 * window.c (Fset_window_start): Doc fix (bug#4199).
5143 (Fset_window_hscroll): Ditto.
5145 2011-07-12 Paul Eggert <eggert@cs.ucla.edu>
5147 Fix minor new problems caught by GCC 4.6.1.
5148 * term.c (init_tty): Remove unused local.
5149 * xsettings.c (store_monospaced_changed): Define this function only
5150 if (defined HAVE_GSETTINGS || defined HAVE_GCONF), as it's
5153 2011-07-12 Chong Yidong <cyd@stupidchicken.com>
5155 * xdisp.c (Vresize_mini_windows): Minor doc fix (Bug#3300).
5157 2011-07-11 Lars Magne Ingebrigtsen <larsi@gnus.org>
5159 * xdisp.c (syms_of_xdisp): Make it explicit that the mini-windows
5160 are the mini-buffer and the echo area (bug#3320).
5162 * term.c (init_tty): Remove support for supdup, c10 and perq
5163 terminals, which are no longer supported (bug#1482).
5165 2011-07-10 Johan Bockgård <bojohan@gnu.org>
5167 * xdisp.c (Ftool_bar_lines_needed): Fix WINDOWP check.
5169 2011-07-10 Jan Djärv <jan.h.d@swipnet.se>
5171 * xmenu.c (menu_highlight_callback): Only pass frame to show_help_event
5172 for non-popups (Bug#3642).
5174 2011-07-10 Andreas Schwab <schwab@linux-m68k.org>
5176 * alloc.c (reset_malloc_hooks): Protoize.
5177 * buffer.c (mmap_init, mmap_find, mmap_free_1, mmap_enlarge)
5178 (mmap_set_vars, mmap_alloc, mmap_free, mmap_realloc): Likewise.
5179 * cm.c (losecursor): Likewise.
5180 * data.c (fmod): Likewise.
5181 * dispnew.c (swap_glyphs_in_rows): Likewise.
5182 * emacs.c (memory_warning_signal): Likewise.
5183 * floatfns.c (float_error): Likewise.
5184 * font.c (check_gstring, check_otf_features, otf_tag_symbol)
5185 (otf_open, font_otf_capability, generate_otf_features)
5186 (font_otf_DeviceTable, font_otf_ValueRecord, font_otf_Anchor):
5188 * image.c (pbm_read_file): Likewise.
5189 * indent.c (string_display_width): Likewise.
5190 * intervals.c (check_for_interval, search_for_interval)
5191 (inc_interval_count, count_intervals, root_interval)
5192 (adjust_intervals_for_insertion, make_new_interval): Likewise.
5193 * lread.c (defalias): Likewise.
5194 * ralloc.c (r_alloc_check): Likewise.
5195 * regex.c (set_image_of_range_1, set_image_of_range)
5196 (regex_grow_registers): Likewise.
5197 * sysdep.c (strerror): Likewise.
5198 * termcap.c (valid_filename_p, tprint, main): Likewise.
5199 * tparam.c (main): Likewise.
5200 * unexhp9k800.c (run_time_remap, save_data_space)
5201 (update_file_ptrs, read_header, write_header, calculate_checksum)
5202 (copy_file, copy_rest, display_header): Likewise.
5203 * widget.c (mark_shell_size_user_specified, create_frame_gcs):
5205 * xdisp.c (check_it): Likewise.
5206 * xfaces.c (register_color, unregister_color, unregister_colors):
5208 * xfns.c (print_fontset_result): Likewise.
5209 * xrdb.c (member, fatal, main): Likewise.
5211 2011-07-10 Paul Eggert <eggert@cs.ucla.edu>
5213 Fix minor problems found by static checking (Bug#9031).
5214 * chartab.c (char_table_set_range, map_sub_char_table):
5215 Remove unused locals.
5216 (uniprop_table): Now static.
5217 * composite.c (_work_char): Remove unused static var.
5219 2011-07-09 Juanma Barranquero <lekktu@gmail.com>
5221 * chartab.c (uniprop_table_uncompress): Remove unused local variable.
5223 2011-07-09 Jan Djärv <jan.h.d@swipnet.se>
5225 * gtkutil.c (qttip_cb): Remove code without function.
5227 2011-07-09 Eli Zaretskii <eliz@gnu.org>
5229 * w32.c (pthread_sigmask): New stub.
5231 2011-07-08 Paul Eggert <eggert@cs.ucla.edu>
5233 Use pthread_sigmask, not sigprocmask (Bug#9010).
5234 sigprocmask is portable only for single-threaded applications, and
5235 Emacs can be multi-threaded when it uses GTK.
5236 * Makefile.in (LIB_PTHREAD_SIGMASK): New macro.
5238 * callproc.c (Fcall_process):
5239 * process.c (create_process):
5240 * sysdep.c (sys_sigblock, sys_sigunblock, sys_sigsetmask):
5241 Use pthread_sigmask, not sigprocmask.
5243 2011-07-08 Jan Djärv <jan.h.d@swipnet.se>
5245 * gtkutil.c (qttip_cb): Set line wrap to FALSE for tooltip widget.
5246 (xg_prepare_tooltip): Revert text in x->ttip_lbl, margins was
5249 2011-07-08 Jan Djärv <jan.h.d@swipnet.se>
5251 * gtkutil.c (xg_prepare_tooltip): Fix indentation and comment.
5252 Put text in x->ttip_lbl instead of gtk_tooltip_set_text (Bug#8591).
5253 (xg_hide_tooltip): Fix comment.
5255 * nsterm.m (initFrameFromEmacs): Don't use ns_return_types
5256 in registerServicesMenuSendTypes.
5257 (validRequestorForSendType): Don't check ns_return_types.
5259 * nsfns.m (Fx_open_connection): Put NSStringPboardType into
5262 2011-07-08 Jason Rumney <jasonr@gnu.org>
5264 * w32term.c (x_make_frame_visible): Use SH_SHOWNORMAL rather than
5265 SH_SHOW for hidden windows (Bug#5482).
5267 * w32fns.c (w32_wnd_proc) [WM_TIMER, WM_SET_CURSOR]: Avoid using
5268 frame struct members of non-existent frames (Bug#6284).
5270 2011-07-08 Jan Djärv <jan.h.d@swipnet.se>
5272 * nsterm.m (keyDown): Call to wantsToDelayTextChangeNotifications and
5273 variable firstTime not needed on OSX >= 10.6.
5274 (setPosition): setFloatValue:knobProportion: is deprecated on OSX
5275 >= 10.5. Use setKnobProportion, setDoubleValue.
5277 * nsterm.h (MAC_OS_X_VERSION_10_3, MAC_OS_X_VERSION_10_4)
5278 (MAC_OS_X_VERSION_10_5): Define if not defined.
5279 (EmacsView, EmacsTooltip): Implements NSWindowDelegate on OSX >= 10.6.
5280 (EmacsMenu): Implements NSMenuDelegate on OSX >= 10.6.
5281 (EmacsToolbar): Implements NSToolbarDelegate on OSX >= 10.6.
5283 * nsselect.m (ns_string_from_pasteboard): Don't use deprecated methods
5284 cString and lossyCString on OSX >= 10.4
5286 * nsmenu.m (fillWithWidgetValue): Don't use deprecated method
5287 sizeToFit on OSX >= 10.2.
5289 * nsimage.m (allocInitFromFile): Don't use deprecated method
5290 bestRepresentationForDevice on OSX >= 10.6.
5292 * nsfns.m (check_ns_display_info): Cast to long and use %ld in error
5295 * emacs.c: Declare unexec_init_emacs_zone.
5297 * nsgui.h: Fix compiler warning about gnulib redefining verify.
5299 * nsselect.m (ns_get_local_selection): Change to extern (Bug#8842).
5301 * nsmenu.m (ns_update_menubar): Remove useless setDelegate call
5302 on svcsMenu (Bug#8842).
5304 * nsfns.m (Fx_open_connection): Remove NSStringPboardType from
5306 (Fns_list_services): Just return Qnil on 10.6, code not working there.
5308 * nsterm.m (QUTF8_STRING): Declare.
5309 (initFrameFromEmacs): Call registerServicesMenuSendTypes.
5310 (validRequestorForSendType): Return type is (id).
5311 Change indexOfObjectIdenticalTo to indexOfObject.
5312 Check if we have local selection before returning self (Bug#8842).
5313 (writeSelectionToPasteboard): Put local selection into paste board
5314 if we have a local selection (Bug#8842).
5315 (syms_of_nsterm): DEFSYM QUTF8_STRING.
5317 * nsterm.h (MAC_OS_X_VERSION_10_6): Define here instead of nsterm.m.
5318 (ns_get_local_selection): Declare.
5320 2011-07-07 Lars Magne Ingebrigtsen <larsi@gnus.org>
5322 * keymap.c (describe_map_tree): Don't insert a double newline at
5323 the end of the buffer (bug#1169) and return whether we inserted
5326 * callint.c (Fcall_interactively): Change "reading args" to
5327 "providing args" to try to clarify what it does (bug#1010).
5329 2011-07-07 Kenichi Handa <handa@m17n.org>
5331 * composite.c (composition_compute_stop_pos): Ignore a static
5332 composition starting before CHARPOS (Bug#8915).
5334 * xdisp.c (handle_composition_prop): Likewise.
5336 2011-07-07 Eli Zaretskii <eliz@gnu.org>
5338 * term.c (produce_glyphs) <xassert>: Allow IT_GLYPHLESS in it->what.
5341 2011-07-07 Kenichi Handa <handa@m17n.org>
5343 * character.h (unicode_category_t): New enum type.
5345 * chartab.c (uniprop_decoder_t, uniprop_encoder_t): New types.
5346 (Qchar_code_property_table): New variable.
5347 (UNIPROP_TABLE_P, UNIPROP_GET_DECODER)
5348 (UNIPROP_COMPRESSED_FORM_P): New macros.
5349 (char_table_ascii): Uncompress the compressed values.
5350 (sub_char_table_ref): New arg is_uniprop. Callers changed.
5351 Uncompress the compressed values.
5352 (sub_char_table_ref_and_range): Likewise.
5353 (char_table_ref_and_range): Uncompress the compressed values.
5354 (sub_char_table_set): New arg is_uniprop. Callers changed.
5355 Uncompress the compressed values.
5356 (sub_char_table_set_range): Args changed. Callers changed.
5357 (char_table_set_range): Adjuted for the above change.
5358 (map_sub_char_table): Delete args default_val and parent. Add arg
5359 top. Give decoded values to a Lisp function.
5360 (map_char_table): Adjust for the above change. Give decoded
5361 values to a Lisp function. Gcpro more variables.
5362 (uniprop_table_uncompress)
5363 (uniprop_decode_value_run_length): New functions.
5364 (uniprop_decoder, uniprop_decoder_count): New variables.
5365 (uniprop_get_decoder, uniprop_encode_value_character)
5366 (uniprop_encode_value_run_length, uniprop_encode_value_numeric):
5368 (uniprop_encoder, uniprop_encoder_count): New variables.
5369 (uniprop_get_encoder, uniprop_table)
5370 (Funicode_property_table_internal, Fget_unicode_property_internal)
5371 (Fput_unicode_property_internal): New functions.
5372 (syms_of_chartab): DEFSYM Qchar_code_property_table, defsubr
5373 Sunicode_property_table_internal, Sget_unicode_property_internal,
5374 and Sput_unicode_property_internal. Defvar_lisp
5375 char-code-property-alist.
5377 * composite.c (CHAR_COMPOSABLE_P): Adjust for the change of
5378 Vunicode_category_table.
5380 * font.c (font_range): Adjust for the change of
5381 Vunicode_category_table.
5383 2011-07-07 Dan Nicolaescu <dann@ics.uci.edu>
5385 * m/iris4d.h: Remove file, move contents ...
5386 * s/irix6-5.h: ... here.
5388 2011-07-06 Paul Eggert <eggert@cs.ucla.edu>
5390 Remove unportable assumption about struct layout (Bug#8884).
5391 * alloc.c (mark_buffer):
5392 * buffer.c (reset_buffer_local_variables, Fbuffer_local_variables)
5393 (clone_per_buffer_values): Don't assume that
5394 sizeof (struct buffer) is a multiple of sizeof (Lisp_Object).
5395 This isn't true in general, and it's particularly not true
5396 if Emacs is configured with --with-wide-int.
5397 * buffer.h (FIRST_FIELD_PER_BUFFER, LAST_FIELD_PER_BUFFER):
5398 New macros, used in the buffer.c change.
5400 2011-07-05 Jan Djärv <jan.h.d@swipnet.se>
5402 * xsettings.c: Use both GConf and GSettings if both are available.
5403 (store_config_changed_event): Add comment.
5404 (dpyinfo_valid, store_font_name_changed, map_tool_bar_style)
5405 (store_tool_bar_style_changed): New functions.
5406 (store_monospaced_changed): Add comment. Call dpyinfo_valid.
5407 (struct xsettings): Move font inside HAVE_XFT.
5408 (GSETTINGS_TOOL_BAR_STYLE, GSETTINGS_FONT_NAME): New defines.
5409 (GSETTINGS_MONO_FONT): Rename from SYSTEM_MONO_FONT.
5410 Move inside HAVE_XFT.
5411 (something_changed_gsettingsCB): Rename from something_changedCB.
5412 Check for changes in GSETTINGS_TOOL_BAR_STYLE and GSETTINGS_FONT_NAME
5414 (GCONF_TOOL_BAR_STYLE, GCONF_FONT_NAME): New defines.
5415 (GCONF_MONO_FONT): Rename from SYSTEM_MONO_FONT. Move inside HAVE_XFT.
5416 (something_changed_gconfCB): Rename from something_changedCB.
5417 Check for changes in GCONF_TOOL_BAR_STYLE and GCONF_FONT_NAME also.
5418 (parse_settings): Move check for font inside HAVE_XFT.
5419 (read_settings, apply_xft_settings): Add comment.
5420 (read_and_apply_settings): Add comment. Call map_tool_bar_style and
5421 store_tool_bar_style_changed. Move check for font inside HAVE_XFT and
5422 call store_font_name_changed.
5423 (xft_settings_event): Add comment.
5424 (init_gsettings): Add comment. Get values for GSETTINGS_TOOL_BAR_STYLE
5425 and GSETTINGS_FONT_NAME. Move check for fonts within HAVE_XFT.
5426 (init_gconf): Add comment. Get values for GCONF_TOOL_BAR_STYLE
5427 and GCONF_FONT_NAME. Move check for fonts within HAVE_XFT.
5428 (xsettings_initialize): Call init_gsettings last.
5429 (xsettings_get_system_font, xsettings_get_system_normal_font):
5432 2011-07-05 Paul Eggert <eggert@cs.ucla.edu>
5434 Random fixes. E.g., (random) never returned negative values.
5435 * fns.c (Frandom): Use GET_EMACS_TIME for random seed, and add the
5436 subseconds part to the entropy, as that's a bit more random.
5437 Prefer signed to unsigned, since the signedness doesn't matter and
5438 in general we prefer signed. When given a limit, use a
5439 denominator equal to INTMASK + 1, not to VALMASK + 1, because the
5440 latter isn't right if USE_2_TAGS_FOR_INTS.
5441 * sysdep.c (get_random): Return a value in the range 0..INTMASK,
5442 not 0..VALMASK. Don't discard "excess" bits that random () returns.
5444 2011-07-04 Stefan Monnier <monnier@iro.umontreal.ca>
5446 * textprop.c (text_property_stickiness):
5447 Obey Vtext_property_default_nonsticky.
5448 (syms_of_textprop): Add `display' to Vtext_property_default_nonsticky.
5449 * w32fns.c (syms_of_w32fns):
5450 * xfns.c (syms_of_xfns): Don't Add `display' since it's there by default.
5452 2011-07-04 Paul Eggert <eggert@cs.ucla.edu>
5454 * fileio.c (barf_or_query_if_file_exists): Use S_ISDIR.
5455 This is more efficient than Ffile_directory_p and avoids a minor race.
5457 2011-07-04 Lars Magne Ingebrigtsen <larsi@gnus.org>
5459 * buffer.c (Foverlay_put): Say what the return value is
5462 * fileio.c (barf_or_query_if_file_exists): Check first if the file
5463 is a directory before asking whether to use the file name
5465 (barf_or_query_if_file_exists): Make the "File is a directory"
5466 error be more correct.
5468 * fns.c (Frequire): Remove the mention of the .gz files, since
5469 that's installation-specific, but keep the mention of
5470 `get-load-suffixes'.
5472 2011-07-04 Paul Eggert <eggert@cs.ucla.edu>
5474 * editfns.c (Fformat_time_string): Don't assume strlen fits in int.
5475 Report string overflow if the output is too long.
5477 2011-07-04 Juanma Barranquero <lekktu@gmail.com>
5479 * gnutls.c (Fgnutls_boot): Don't mention :verify-error.
5480 (syms_of_gnutls): Remove duplicate DEFSYM for
5481 Qgnutls_bootprop_verify_hostname_error, an error for
5482 Qgnutls_bootprop_verify_error (which is no longer used).
5484 * eval.c (find_handler_clause): Remove parameters `sig' and `data',
5485 unused since 2011-01-26T20:02:07Z!monnier@iro.umontreal.ca. All callers changed.
5486 Also (re)move comments that are misplaced or no longer relevant.
5488 2011-07-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
5490 * callint.c (Finteractive): Clarify the meaning of "@" (bug#8813).
5492 2011-07-03 Chong Yidong <cyd@stupidchicken.com>
5494 * xfaces.c (Finternal_merge_in_global_face): Modify the foreground
5495 and background color parameters if they have been changed.
5497 2011-07-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
5499 * editfns.c (Fformat): Clarify the - and 0 flags (bug#6659).
5501 2011-07-03 Paul Eggert <eggert@cs.ucla.edu>
5503 * xsettings.c (SYSTEM_FONT): Define only when used.
5504 No need to define when HAVE_GSETTINGS || !HAVE_XFT.
5506 * keymap.c (access_keymap_1): Now static.
5508 2011-07-02 Chong Yidong <cyd@stupidchicken.com>
5510 * keyboard.c (command_loop_1): If a down-mouse event is unbound,
5511 leave any prefix arg for the up event (Bug#1586).
5513 2011-07-02 Lars Magne Ingebrigtsen <larsi@gnus.org>
5515 * lread.c (syms_of_lread): Mention single symbols defined by
5516 `defvar' or `defconst' (bug#7154).
5518 * fns.c (Frequire): Mention .el.gz files (bug#7314).
5519 (Frequire): Mention get-load-suffixes.
5521 2011-07-02 Martin Rudalics <rudalics@gmx.at>
5523 * window.h (window): Remove clone_number slot.
5524 * window.c (Fwindow_clone_number, Fset_window_clone_number):
5526 (make_parent_window, make_window, saved_window)
5527 (Fset_window_configuration, save_window_save): Don't deal with
5529 * buffer.c (Qclone_number): Remove declaration.
5530 (sort_overlays, overlay_strings): Don't deal with clone numbers.
5532 2011-07-02 Stefan Monnier <monnier@iro.umontreal.ca>
5534 Add multiple inheritance to keymaps.
5535 * keymap.c (Fmake_composed_keymap): New function.
5536 (Fset_keymap_parent): Simplify.
5537 (fix_submap_inheritance): Remove.
5538 (access_keymap_1): New function extracted from access_keymap to handle
5539 embedded parents and handle lists of maps.
5540 (access_keymap): Use it.
5541 (Fkeymap_prompt, map_keymap_internal, map_keymap, store_in_keymap)
5542 (Fcopy_keymap): Handle embedded parents.
5543 (Fcommand_remapping, define_as_prefix): Simplify.
5544 (Fkey_binding): Simplify.
5545 (syms_of_keymap): Move minibuffer-local-completion-map,
5546 minibuffer-local-filename-completion-map,
5547 minibuffer-local-must-match-map, and
5548 minibuffer-local-filename-must-match-map to Elisp.
5549 (syms_of_keymap): Defsubr make-composed-keymap.
5550 * keyboard.c (menu_bar_items): Use map_keymap_canonical.
5551 (parse_menu_item): Trivial simplification.
5553 2011-07-01 Glenn Morris <rgm@gnu.org>
5555 * Makefile.in (SETTINGS_LIBS): Fix typo.
5557 2011-07-01 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny patch)
5559 * coding.c (Fencode_coding_string): Record the last coding system
5560 used, as the function doc string says (bug#8738).
5562 2011-07-01 Jan Djärv <jan.h.d@swipnet.se>
5564 * xsettings.c (store_monospaced_changed): Take new font as arg and
5565 check for change against current_mono_font.
5566 (EMACS_TYPE_SETTINGS): Remove this and related defines.
5567 (emacs_settings_constructor, emacs_settings_get_property)
5568 (emacs_settings_set_property, emacs_settings_class_init)
5569 (emacs_settings_init, gsettings_obj): Remove.
5570 (something_changedCB): New function for HAVE_GSETTINGS.
5571 (something_changedCB): HAVE_GCONF: Call store_monospaced_changed
5572 with value as argument.
5573 (init_gsettings): Check that GSETTINGS_SCHEMA exists before calling
5574 g_settings_new (Bug#8967). Do not create gsettings_obj.
5575 Remove calls to g_settings_bind. Connect something_changedCB to
5578 * xgselect.c: Add defined (HAVE_GSETTINGS).
5579 (xgselect_initialize): Ditto.
5581 * process.c: Add defined (HAVE_GSETTINGS) for xgselect.h
5582 (wait_reading_process_output): Add defined (HAVE_GSETTINGS) for
5585 2011-07-01 Paul Eggert <eggert@cs.ucla.edu>
5587 * eval.c (struct backtrace): Simplify and port the data structure.
5588 Do not assume that "int nargs : BITS_PER_INT - 2;" produces a
5589 signed bit field, as this assumption is not portable and it makes
5590 Emacs crash when compiled with Sun C 5.8 on sparc. Do not use
5591 "char debug_on_exit : 1" as this is not portable either; instead,
5592 use the portable "unsigned int debug_on_exit : 1". Remove unused
5593 member evalargs. Remove obsolete comments about cc bombing out.
5595 2011-06-30 Jan Djärv <jan.h.d@swipnet.se>
5597 * xsettings.c: Include glib-object.h, gio/gio.h if HAVE_GSETTINGS.
5598 Let HAVE_GSETTINGS override HAVE_GCONF.
5599 (store_monospaced_changed): New function.
5600 (EMACS_SETTINGS): A new type derived from GObject to handle
5601 GSettings notifications.
5602 (emacs_settings_constructor, emacs_settings_get_property)
5603 (emacs_settings_set_property, emacs_settings_class_init):
5605 (gsettings_client, gsettings_obj): New variables.
5606 (GSETTINGS_SCHEMA): New define.
5607 (something_changedCB): Call store_monospaced_changed.
5608 (init_gsettings): New function.
5609 (xsettings_initialize): Call init_gsettings.
5610 (syms_of_xsettings): Initialize gsettings_client, gsettings_obj
5613 * Makefile.in (SETTINGS_CFLAGS, SETTINGS_LIBS): Rename from
5616 2011-06-29 Martin Rudalics <rudalics@gmx.at>
5618 * window.c (resize_root_window, grow_mini_window)
5619 (shrink_mini_window): Rename Qresize_root_window to
5620 Qwindow_resize_root_window and Qresize_root_window_vertically to
5621 Qwindow_resize_root_window_vertically.
5623 2011-06-28 Paul Eggert <eggert@cs.ucla.edu>
5625 * gnutls.c (Qgnutls_bootprop_verify_error): Remove unused var.
5627 2011-06-27 Juanma Barranquero <lekktu@gmail.com>
5629 * makefile.w32-in: Redesign dependencies so they reflect more
5630 clearly which files are directly included by each source file,
5631 and not through other includes.
5633 2011-06-27 Martin Rudalics <rudalics@gmx.at>
5635 * buffer.c (Qclone_number): Declare static and DEFSYM it.
5636 (sort_overlays, overlay_strings): When an overlay's clone number
5637 matches the window's clone number process the overlay even if
5638 the overlay's window property doesn't match the current window.
5640 * window.c (Fwindow_vchild): Rename to Fwindow_top_child.
5641 (Fwindow_hchild): Rename to Fwindow_left_child.
5642 (Fwindow_next): Rename to Fwindow_next_sibling.
5643 (Fwindow_prev): Rename to Fwindow_prev_sibling.
5644 (resize_window_check): Rename to window_resize_check.
5645 (resize_window_apply): Rename to window_resize_apply.
5646 (Fresize_window_apply): Rename to Fwindow_resize_apply.
5647 (Fdelete_other_windows_internal, resize_frame_windows)
5648 (Fsplit_window_internal, Fdelete_window_internal)
5649 (grow_mini_window, shrink_mini_window)
5650 (Fresize_mini_window_internal): Fix callers accordingly.
5652 2011-06-26 Jan Djärv <jan.h.d@swipnet.se>
5654 * emacsgtkfixed.h: State that this is only used with Gtk+3.
5655 (emacs_fixed_set_min_size): Remove.
5656 (emacs_fixed_new): Take frame as argument.
5658 * emacsgtkfixed.c: State that this is only used with Gtk+3.
5659 (_EmacsFixedPrivate): Remove minwidth/height.
5660 Add struct frame *f.
5661 (emacs_fixed_init): Initialize priv->f.
5662 (get_parent_class, emacs_fixed_set_min_size): Remove.
5663 (emacs_fixed_new): Set priv->f to argument.
5664 (emacs_fixed_get_preferred_width)
5665 (emacs_fixed_get_preferred_height): Use min_width/height from
5666 frames size_hint to set minimum and natural (Bug#8919).
5667 (XSetWMSizeHints, XSetWMNormalHints): Override these functions
5668 and use min_width/height from frames size_hint to set
5669 min_width/height (Bug#8919).
5671 * gtkutil.c (xg_create_frame_widgets): Pass f to emacs_fixed_new.
5672 (x_wm_set_size_hint): Remove call to emacs_fixed_set_min_size.
5675 2011-06-26 Eli Zaretskii <eliz@gnu.org>
5677 * bidi.c (bidi_paragraph_init): Test for ZV_BYTE before calling
5678 bidi_at_paragraph_end, since fast_looking_at doesn't like to be
5681 2011-06-26 Chong Yidong <cyd@stupidchicken.com>
5683 * process.c (wait_reading_process_output): Bypass select if
5684 waiting for a cell while ignoring keyboard input, and input is
5685 pending. Suggested by Jan Djärv (Bug#8869).
5687 2011-06-25 Paul Eggert <eggert@cs.ucla.edu>
5689 Use gnulib's dup2 module instead of rolling our own.
5690 * sysdep.c (dup2) [!HAVE_DUP2]: Remove; gnulib now does this.
5692 2011-06-25 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
5694 * dispnew.c (scrolling_window): Before scrolling, turn off a
5695 mouse-highlight in the window being scrolled.
5697 2011-06-24 Juanma Barranquero <lekktu@gmail.com>
5699 Move DEFSYM to lisp.h and use everywhere.
5701 * character.h (DEFSYM): Move declaration...
5702 * lisp.h (DEFSYM): ...here.
5708 * w32select.c: Don't include character.h.
5710 * alloc.c (syms_of_alloc):
5711 * buffer.c (syms_of_buffer):
5712 * bytecode.c (syms_of_bytecode):
5713 * callint.c (syms_of_callint):
5714 * casefiddle.c (syms_of_casefiddle):
5715 * casetab.c (init_casetab_once):
5716 * category.c (init_category_once, syms_of_category):
5717 * ccl.c (syms_of_ccl):
5718 * cmds.c (syms_of_cmds):
5719 * composite.c (syms_of_composite):
5720 * dbusbind.c (syms_of_dbusbind):
5721 * dired.c (syms_of_dired):
5722 * dispnew.c (syms_of_display):
5723 * doc.c (syms_of_doc):
5724 * editfns.c (syms_of_editfns):
5725 * emacs.c (syms_of_emacs):
5726 * eval.c (syms_of_eval):
5727 * fileio.c (syms_of_fileio):
5728 * fns.c (syms_of_fns):
5729 * frame.c (syms_of_frame):
5730 * fringe.c (syms_of_fringe):
5731 * insdel.c (syms_of_insdel):
5732 * keymap.c (syms_of_keymap):
5733 * lread.c (init_obarray, syms_of_lread):
5734 * macros.c (syms_of_macros):
5735 * msdos.c (syms_of_msdos):
5736 * print.c (syms_of_print):
5737 * process.c (syms_of_process):
5738 * search.c (syms_of_search):
5739 * sound.c (syms_of_sound):
5740 * syntax.c (init_syntax_once, syms_of_syntax):
5741 * terminal.c (syms_of_terminal):
5742 * textprop.c (syms_of_textprop):
5743 * undo.c (syms_of_undo):
5744 * w32.c (globals_of_w32):
5745 * window.c (syms_of_window):
5746 * xdisp.c (syms_of_xdisp):
5747 * xfaces.c (syms_of_xfaces):
5748 * xfns.c (syms_of_xfns):
5749 * xmenu.c (syms_of_xmenu):
5750 * xsettings.c (syms_of_xsettings):
5751 * xterm.c (syms_of_xterm): Use DEFSYM.
5753 2011-06-24 Teodor Zlatanov <tzz@lifelogs.com>
5755 * gnutls.c (syms_of_gnutls): Use the DEFSYM macro from character.h.
5757 2011-06-23 Paul Eggert <eggert@cs.ucla.edu>
5759 Integer and buffer overflow fixes (Bug#8873).
5761 * print.c (printchar, strout): Check for string overflow.
5762 (PRINTPREPARE, printchar, strout):
5763 Don't set size unless allocation succeeds.
5765 * minibuf.c (read_minibuf_noninteractive): Use ptrdiff_t, not int,
5766 for sizes. Check for string overflow more accurately.
5767 Simplify newline removal at end; this suppresses a GCC 4.6.0 warning.
5769 * macros.c: Integer and buffer overflow fixes.
5770 * keyboard.h (struct keyboard.kbd_macro_bufsize):
5771 * macros.c (Fstart_kbd_macro, store_kbd_macro_char):
5772 Use ptrdiff_t, not int, for sizes.
5773 Don't increment bufsize until after realloc succeeds.
5774 Check for size-calculation overflow.
5775 (Fstart_kbd_macro): Use EMACS_INT, not int, for XINT result.
5777 * lisp.h (DEFVAR_KBOARD): Use offsetof instead of char * finagling.
5779 * lread.c: Integer overflow fixes.
5780 (read_integer): Radix is now EMACS_INT, not int,
5781 to improve quality of diagnostics for out-of-range radices.
5782 Calculate buffer size correctly for out-of-range radices.
5783 (read1): Check for integer overflow in radices, and in
5784 read-circle numbers.
5785 (read_escape): Avoid int overflow.
5786 (Fload, openp, read_buffer_size, read1)
5787 (substitute_object_recurse, read_vector, read_list, map_obarray):
5788 Use ptrdiff_t, not int, for sizes.
5789 (read1): Use EMACS_INT, not int, for sizes.
5790 Check for size overflow.
5792 * image.c (cache_image): Check for size arithmetic overflow.
5794 * lread.c: Integer overflow issues.
5795 (saved_doc_string_size, saved_doc_string_length)
5796 (prev_saved_doc_string_size, prev_saved_doc_string_length):
5797 Now ptrdiff_t, not int.
5798 (read1): Don't assume doc string length fits in int. Check for
5799 out-of-range doc string lengths.
5800 (read_list): Don't assume file position fits in int.
5801 (read_escape): Check for hex character overflow.
5803 2011-06-22 Leo Liu <sdl.web@gmail.com>
5805 * minibuf.c (Fcompleting_read_default, Vcompleting_read_function):
5806 Move to minibuffer.el.
5808 2011-06-22 Paul Eggert <eggert@cs.ucla.edu>
5810 Fixes for GLYPH_DEBUG found by GCC 4.6.0 static checking.
5811 The following patches are for when GLYPH_DEBUG && !XASSERT.
5812 * dispextern.h (trace_redisplay_p, dump_glyph_string):
5813 * dispnew.c (flush_stdout):
5814 * xdisp.c (dump_glyph_row, dump_glyph_matrix, dump_glyph):
5815 Mark as externally visible.
5816 * dispnew.c (check_window_matrix_pointers): Now static.
5817 * dispnew.c (window_to_frame_vpos):
5818 * xfns.c (unwind_create_frame):
5819 * xterm.c (x_check_font): Remove unused local.
5820 * scroll.c (CHECK_BOUNDS):
5821 * xfaces.c (cache_fache): Rename local to avoid shadowing.
5822 * xfns.c, w32fns.c (image_cache_refcount, dpyinfo_refcount): Now static.
5823 * xdisp.c (check_window_end): Now a no-op if !XASSERTS.
5824 (debug_first_unchanged_at_end_vpos, debug_last_unchanged_at_beg_vpos)
5825 (debug_dvpos, debug_dy, debug_delta, debug_delta_bytes, debug_end_vpos):
5827 (debug_method_add): Use va_list and vsprintf rather than relying
5828 on undefined behavior with wrong number of arguments.
5829 (dump_glyph, dump_glyph_row, Fdump_glyph_matrix):
5830 Don't assume ptrdiff_t and EMACS_INT are the same width as int.
5831 In this code, it's OK to assume C99 behavior for ptrdiff_t formats
5832 since we're not interested in debugging glyphs with old libraries.
5833 * xfaces.c (cache_face): Move debugging code earlier; this pacifies
5834 GCC 4.6.0's static checking.
5836 2011-06-22 Paul Eggert <eggert@cs.ucla.edu>
5838 Integer overflow and signedness fixes (Bug#8873).
5839 A few related buffer overrun fixes, too.
5841 * font.c (font_score): Use EMACS_INT, not int, to store XINT value.
5843 * dispextern.h (struct face.stipple):
5844 * image.c (x_bitmap_height, x_bitmap_width, x_bitmap_pixmap)
5845 (x_bitmap_mask, x_allocate_bitmap_record)
5846 (x_create_bitmap_from_data, x_create_bitmap_from_file)
5847 (x_destroy_bitmap, x_destroy_all_bitmaps, x_create_bitmap_mask)
5848 (x_create_bitmap_from_xpm_data):
5849 * nsterm.h (struct ns_display_info.bitmaps_size, .bitmaps_last):
5850 * w32term.h (struct w32_display_info.icon_bitmap_id, .bitmaps_size)
5852 * xfaces.c (load_pixmap):
5853 * xterm.c (x_bitmap_icon, x_wm_set_icon_pixmap):
5854 * xterm.h (struct x_display_info.icon_bitmap_id, .bitmaps_size)
5855 (.bitmaps_last, struct x_output.icon_bitmap):
5856 Use ptrdiff_t, not int, for bitmap indexes.
5857 (x_allocate_bitmap_record): Check for size overflow.
5858 * dispextern.h, lisp.h: Adjust to API changes elsewhere.
5860 Use ptrdiff_t, not int, for overlay counts.
5861 * buffer.h (overlays_at, sort_overlays, GET_OVERLAYS_AT):
5862 * editfns.c (overlays_around, get_pos_property):
5863 * textprop.c (get_char_property_and_overlay):
5864 * xdisp.c (next_overlay_change, note_mouse_highlight):
5865 * xfaces.c (face_at_buffer_position):
5866 * buffer.c (OVERLAY_COUNT_MAX): New macro.
5867 (overlays_at, overlays_in, sort_overlays, Foverlays_at)
5868 (Fnext_overlay_change, Fprevious_overlay_change)
5869 (mouse_face_overlay_overlaps, Foverlays_in):
5870 Use ptrdiff_t, not int, for sizes.
5871 (overlays_at, overlays_in): Check for size-calculation overflow.
5873 * xterm.c (xim_initialize, same_x_server): Strlen may not fit in int.
5875 * xsmfns.c (smc_save_yourself_CB, x_session_initialize): Avoid strlen.
5876 (x_session_initialize): Do not assume string length fits in int.
5878 * xsettings.c (apply_xft_settings): Fix potential buffer overrun.
5879 This is unlikely, but can occur if DPI is outlandish.
5881 * xsettings.c (Ffont_get_system_normal_font, Ffont_get_system_font):
5882 * xselect.c (Fx_get_atom_name): Avoid need for strlen.
5884 * xrdb.c: Don't assume strlen fits in int; avoid some strlens.
5885 * xrdb.c (magic_file_p, search_magic_path):
5886 Omit last arg SUFFIX; it was always 0. All callers changed.
5887 (magic_file_p): Use ptrdiff_t, not int. Check for size overflow.
5889 * xfont.c (xfont_match): Avoid need for strlen.
5891 * xfns.c: Don't assume strlen fits in int.
5892 (xic_create_fontsetname, x_window): Use ptrdiff_t, not int.
5894 * xdisp.c (message_log_check_duplicate): Return intmax_t,
5895 not unsigned long, as we prefer signed integers. All callers changed.
5896 Detect integer overflow in repeat count.
5897 (message_dolog): Don't assume print length fits in 39 bytes.
5898 (display_mode_element): Don't assume strlen fits in int.
5900 * termcap.c: Don't assume sizes fit in int and never overflow.
5901 (struct termcap_buffer, tgetent): Use ptrdiff_t, not int, for sizes.
5902 (gobble_line): Check for size-calculation overflow.
5904 * minibuf.c (Fread_buffer):
5905 * lread.c (intern, intern_c_string):
5906 * image.c (xpm_scan) [HAVE_NS && !HAVE_XPM]:
5907 Don't assume string length fits in int.
5909 * keyboard.c (parse_tool_bar_item):
5910 * gtkutil.c (style_changed_cb): Avoid need for strlen.
5912 * font.c: Don't assume string length fits in int.
5913 (font_parse_xlfd, font_parse_fcname, font_unparse_fcname):
5914 Use ptrdiff_t, not int.
5915 (font_intern_prop): Don't assume string length fits in int.
5916 Don't assume integer property fits in fixnum.
5917 * font.h (font_intern_prop): 2nd arg is now ptrdiff_t, not int.
5919 * filelock.c: Fix some buffer overrun and integer overflow issues.
5920 (get_boot_time): Don't assume gzip command string fits in 100 bytes.
5921 Reformulate so as not to need the command string.
5922 Invoke gzip -cd rather than gunzip, as it's more portable.
5923 (lock_info_type, lock_file_1, lock_file):
5924 Don't assume pid_t and time_t fit in unsigned long.
5925 (LOCK_PID_MAX): Remove; we now use more-reliable bounds.
5926 (current_lock_owner): Prefer signed type for sizes.
5927 Use memcpy, not strncpy, where memcpy is what is really wanted.
5928 Don't assume (via atoi) that time_t and pid_t fit in int.
5929 Check for time_t and/or pid_t out of range, e.g., via a network share.
5930 Don't alloca where an auto var works fine.
5932 * fileio.c: Fix some integer overflow issues.
5933 (file_name_as_directory, Fexpand_file_name, Fsubstitute_in_file_name):
5934 Don't assume string length fits in int.
5935 (directory_file_name): Don't assume string length fits in long.
5936 (make_temp_name): Don't assume pid fits in int, or that its print
5937 length is less than 20.
5939 * data.c (Fsubr_name): Rewrite to avoid a strlen call.
5941 * coding.c (make_subsidiaries): Don't assume string length fits in int.
5943 * callproc.c (child_setup): Rewrite to avoid two strlen calls.
5945 * process.c (Fformat_network_address): Use EMACS_INT, not EMACS_UINT.
5946 We prefer signed integers, even for size calculations.
5948 * emacs.c: Don't assume string length fits in 'int'.
5949 (DEFINE_DUMMY_FUNCTION, sort_args): Use ptrdiff_t, not int.
5950 (main): Don't invoke strlen when not needed.
5952 * dbusbind.c (XD_ERROR): Don't arbitrarily truncate string.
5953 (XD_DEBUG_MESSAGE): Don't waste a byte.
5955 * callproc.c (getenv_internal_1, getenv_internal)
5957 * buffer.c (init_buffer): Don't assume string length fits in 'int'.
5959 * lread.c (invalid_syntax): Omit length argument.
5960 All uses changed. This doesn't fix a bug, but it simplifies the
5961 code away from its former Hollerith-constant appearance, and it's
5962 one less 'int' to worry about when looking at integer-overflow issues.
5963 (string_to_number): Simplify 2011-04-26 change by invoking xsignal1.
5965 * lisp.h (DEFUN): Remove bogus use of sizeof (struct Lisp_Subr).
5966 This didn't break anything, but it didn't help either.
5967 It's confusing to put a bogus integer in a place where the actual
5968 value does not matter.
5969 (LIST_END_P): Remove unused macro and its bogus comment.
5970 (make_fixnum_or_float): Remove unnecessary cast to EMACS_INT.
5972 * lisp.h (union Lisp_Object.i): EMACS_INT, not EMACS_UINT.
5973 This is for consistency with the ordinary, non-USE_LISP_UNION_TYPE,
5975 (struct Lisp_Bool_Vector.size): EMACS_INT, not EMACS_UINT.
5976 We prefer signed types, and the value cannot exceed the EMACS_INT
5977 range anyway (because otherwise the length would not be representable).
5978 (XSET) [USE_LISP_UNION_TYPE]: Use uintptr_t and intptr_t,
5979 not EMACS_UINT and EMACS_INT, when converting pointer to integer.
5980 This avoids a GCC warning when WIDE_EMACS_INT.
5982 * indent.c (sane_tab_width): New function.
5983 (current_column, scan_for_column, Findent_to, position_indentation)
5984 (compute_motion): Use it. This is just for clarity.
5985 (Fcompute_motion): Don't assume hscroll and tab offset fit in int.
5987 * image.c (xbm_image_p): Don't assume stated width, height fit in int.
5989 * lisp.h (lint_assume): New macro.
5990 * composite.c (composition_gstring_put_cache):
5991 * ftfont.c (ftfont_shape_by_flt): Use it to pacify GCC 4.6.0.
5993 * editfns.c, insdel.c:
5994 Omit unnecessary forward decls, to simplify future changes.
5996 * ftfont.c (ftfont_shape_by_flt): Use signed integers for lengths.
5998 * font.c (Ffont_shape_gstring): Don't assume glyph len fits in 'int'.
6000 * fns.c (Ffillarray): Don't assume bool vector size fits in 'int'.
6001 Use much-faster test for byte-length change.
6002 Don't assume string byte-length fits in 'int'.
6003 Check that character arg fits in 'int'.
6004 (mapcar1): Declare byte as byte, for clarity.
6006 * alloc.c (Fmake_bool_vector): Avoid unnecessary multiplication.
6008 * fns.c (concat): Catch string overflow earlier.
6009 Do not rely on integer wraparound.
6011 * dispextern.h (struct it.overlay_strings_charpos)
6012 (struct it.selective): Now EMACS_INT, not int.
6013 * xdisp.c (forward_to_next_line_start)
6014 (back_to_previous_visible_line_start)
6015 (reseat_at_next_visible_line_start, next_element_from_buffer):
6016 Don't arbitrarily truncate the value of 'selective' to int.
6018 * xdisp.c (init_iterator): Use XINT, not XFASTINT; it might be < 0.
6020 * composite.c: Don't truncate sizes to 'int'.
6021 (composition_gstring_p, composition_reseat_it)
6022 (composition_adjust_point): Use EMACS_INT, not int.
6023 (get_composition_id, composition_gstring_put_cache): Use EMACS_INT,
6024 not EMACS_UINT, for indexes.
6026 * category.h (CATEGORY_SET_P): Remove unnecessary cast to EMACS_INT.
6028 * buffer.c: Include <verify.h>.
6029 (struct sortvec.priority, struct sortstr.priority):
6030 Now EMACS_INT, not int.
6031 (compare_overlays, cmp_for_strings): Avoid subtraction overflow.
6032 (struct sortstr.size, record_overlay_string)
6033 (struct sortstrlist.size, struct sortlist.used):
6034 Don't truncate size to int.
6035 (record_overlay_string): Check for size-calculation overflow.
6036 (init_buffer_once): Check at compile-time, not run-time.
6038 2011-06-22 Jim Meyering <meyering@redhat.com>
6040 Don't leak an XBM-image-sized buffer
6041 * image.c (xbm_load): Free the image buffer after using it.
6043 2011-06-21 Paul Eggert <eggert@cs.ucla.edu>
6046 * composite.c (find_automatic_composition): Omit needless 'return 0;'
6047 that Sun C diagnosed.
6048 * fns.c (secure_hash): Fix pointer signedness issue.
6049 * intervals.c (static_offset_intervals): New function.
6050 (offset_intervals): Use it.
6052 2011-06-21 Leo Liu <sdl.web@gmail.com>
6055 * makefile.w32-in ($(BLD)/fns.$(O)): Include sha256.h and
6058 * fns.c (secure_hash): Rename from crypto_hash_function and change
6059 the first arg to accept symbols.
6060 (Fsecure_hash): New primitive.
6061 (syms_of_fns): New symbols.
6063 2011-06-20 Deniz Dogan <deniz@dogan.se>
6065 * process.c (Fset_process_buffer): Clarify return value in
6068 2011-06-18 Chong Yidong <cyd@stupidchicken.com>
6070 * dispnew.c (add_window_display_history): Use BVAR.
6072 * xdisp.c (debug_method_add): Use BVAR.
6073 (check_window_end, dump_glyph_matrix, dump_glyph)
6074 (dump_glyph_row, dump_glyph_string): Convert arglist to ANSI C.
6076 * xfaces.c (check_lface_attrs, check_lface, dump_realized_face):
6079 * xfns.c (Fx_create_frame, x_create_tip_frame): Delay image cache
6080 check till after the cache is created in init_frame_faces.
6082 2011-06-17 Stefan Monnier <monnier@iro.umontreal.ca>
6084 * fns.c (Fsafe_length): Yet another int/Lisp_Object mixup.
6086 2011-06-16 Paul Eggert <eggert@cs.ucla.edu>
6088 * lisp.h: Include <limits.h>, for INT_MAX, LONG_MAX, LLONG_MAX.
6089 Without this, prin1 mishandles Lisp_Misc_Save_Value printing on
6090 hosts with pre-C99 libraries, because pD is wrongly defined to "t".
6092 Improve buffer-overflow checking (Bug#8873).
6093 * fileio.c (Finsert_file_contents):
6094 * insdel.c (insert_from_buffer_1, replace_range, replace_range_2):
6095 Remove the old (too-loose) buffer overflow checks.
6096 They weren't needed, since make_gap checks for buffer overflow.
6097 * insdel.c (make_gap_larger): Catch buffer overflows that were missed.
6098 The old code merely checked for Emacs fixnum overflow, and relied
6099 on undefined (wraparound) behavior. The new code avoids undefined
6100 behavior, and also checks for ptrdiff_t and/or size_t overflow.
6102 * editfns.c (Finsert_char): Don't dump core with very negative counts.
6103 Tune. Don't use wider integers than needed. Don't use alloca.
6104 Use a bigger 'string' buffer. Rewrite to avoid 'n > 0' test.
6106 * insdel.c (replace_range): Fix buf overflow when insbytes < outgoing.
6108 * insdel.c, lisp.h (buffer_overflow): New function.
6109 (insert_from_buffer_1, replace_range, replace_range_2):
6110 * insdel.c (make_gap_larger):
6111 * editfns.c (Finsert_char):
6112 * fileio.c (Finsert_file_contents): Use it, to normalize wording.
6114 * buffer.h (BUF_BYTES_MAX): Cast to ptrdiff_t so that it's signed.
6116 2011-06-15 Paul Eggert <eggert@cs.ucla.edu>
6118 Integer overflow and signedness fixes (Bug#8873, Bug#8828).
6120 * ccl.c (ASCENDING_ORDER): New macro, to work around GCC bug 43772.
6121 (GET_CCL_RANGE, IN_INT_RANGE): Use it.
6123 * fileio.c: Don't assume EMACS_INT fits in off_t.
6124 (emacs_lseek): New static function.
6125 (Finsert_file_contents, Fwrite_region): Use it.
6126 Use SEEK_SET, SEEK_CUR, SEEK_END as appropriate.
6128 * fns.c (Fload_average): Don't assume 100 * load average fits in int.
6130 * fns.c: Don't overflow int when computing a list length.
6131 * fns.c (QUIT_COUNT_HEURISTIC): New constant.
6132 (Flength, Fsafe_length): Use EMACS_INT, not int, to avoid unwanted
6133 truncation on 64-bit hosts. Check for QUIT every
6134 QUIT_COUNT_HEURISTIC entries rather than every other entry; that's
6135 faster and is responsive enough.
6136 (Flength): Report an error instead of overflowing an integer.
6137 (Fsafe_length): Return a float if the value is not representable
6138 as a fixnum. This shouldn't happen except in contrived situations.
6139 (Fnthcdr, Fsort): Don't assume list length fits in int.
6140 (Fcopy_sequence): Don't assume vector length fits in int.
6142 * alloc.c: Check that resized vectors' lengths fit in fixnums.
6143 (header_size, word_size): New constants.
6144 (allocate_vectorlike): Don't check size overflow here.
6145 (allocate_vector): Check it here instead, since this is the only
6146 caller of allocate_vectorlike that could cause overflow.
6147 Check that the new vector's length is representable as a fixnum.
6149 * fns.c (next_almost_prime): Don't return a multiple of 3 or 5.
6150 The previous code was bogus. For example, next_almost_prime (32)
6151 returned 39, which is undesirable as it is a multiple of 3; and
6152 next_almost_prime (24) returned 25, which is a multiple of 5 so
6153 why was the code bothering to check for multiples of 7?
6155 * bytecode.c (exec_byte_code): Use ptrdiff_t, not int, for vector length.
6157 * eval.c, doprnt.c (SIZE_MAX): Remove; inttypes.h defines this now.
6159 Variadic C functions now count arguments with ptrdiff_t.
6160 This partly undoes my 2011-03-30 change, which replaced int with size_t.
6161 Back then I didn't know that the Emacs coding style prefers signed int.
6162 Also, in the meantime I found a few more instances where arguments
6163 were being counted with int, which may truncate counts on 64-bit
6164 machines, or EMACS_INT, which may be unnecessarily wide.
6165 * lisp.h (struct Lisp_Subr.function.aMANY)
6166 (DEFUN_ARGS_MANY, internal_condition_case_n, safe_call):
6167 Arg counts are now ptrdiff_t, not size_t.
6168 All variadic functions and their callers changed accordingly.
6169 (struct gcpro.nvars): Now size_t, not size_t. All uses changed.
6170 * bytecode.c (exec_byte_code): Check maxdepth for overflow,
6171 to avoid potential buffer overrun. Don't assume arg counts fit in 'int'.
6172 * callint.c (Fcall_interactively): Check arg count for overflow,
6173 to avoid potential buffer overrun. Use signed char, not 'int',
6174 for 'varies' array, so that we needn't bother to check its size
6175 calculation for overflow.
6176 * editfns.c (Fformat): Use ptrdiff_t, not EMACS_INT, to count args.
6177 * eval.c (apply_lambda):
6178 * fns.c (Fmapconcat): Use XFASTINT, not XINT, to get args length.
6179 (struct textprop_rec.argnum): Now ptrdiff_t, not int. All uses changed.
6180 (mapconcat): Use ptrdiff_t, not int and EMACS_INT, to count args.
6182 * callint.c (Fcall_interactively): Don't use index var as event count.
6184 * vm-limit.c (check_memory_limits): Fix incorrect extern function decls.
6185 * mem-limits.h (SIZE): Remove; no longer used.
6187 * xterm.c (x_alloc_nearest_color_1): Prefer int to long when int works.
6189 Remove unnecessary casts.
6190 * xterm.c (x_term_init):
6191 * xfns.c (x_set_border_pixel):
6192 * widget.c (create_frame_gcs): Remove casts to unsigned long etc.
6193 These aren't needed now that we assume ANSI C.
6195 * sound.c (Fplay_sound_internal): Remove cast to unsigned long.
6196 It's more likely to cause problems (due to unsigned overflow)
6199 * dired.c (Ffile_attributes): Don't use 32-bit hack on 64-bit hosts.
6201 * unexelf.c (unexec): Don't assume BSS addr fits in unsigned.
6203 * xterm.c (handle_one_xevent): Omit unnecessary casts to unsigned.
6205 * keyboard.c (modify_event_symbol): Don't limit alist len to UINT_MAX.
6207 * lisp.h (CHAR_TABLE_SET): Omit now-redundant test.
6209 * lread.c (Fload): Don't compare a possibly-garbage time_t value.
6211 GLYPH_CODE_FACE returns EMACS_INT, not int.
6212 * dispextern.h (merge_faces):
6213 * xfaces.c (merge_faces):
6214 * xdisp.c (get_next_display_element, next_element_from_display_vector):
6215 Don't assume EMACS_INT fits in int.
6217 * character.h (CHAR_VALID_P): Remove unused parameter.
6218 * fontset.c, lisp.h, xdisp.c: All uses changed.
6220 * editfns.c (Ftranslate_region_internal): Omit redundant test.
6222 * fns.c (concat): Minor tuning based on overflow analysis.
6223 This doesn't fix any bugs. Use int to hold character, instead
6224 of constantly refetching from Emacs object. Use XFASTINT, not
6225 XINT, for value known to be a character. Don't bother comparing
6226 a single byte to 0400, as it's always less.
6228 * floatfns.c (Fexpt):
6229 * fileio.c (make_temp_name): Omit unnecessary cast to unsigned.
6231 * editfns.c (Ftranslate_region_internal): Use int, not EMACS_INT
6234 * doc.c (get_doc_string): Omit (unsigned)c that mishandled negatives.
6236 * data.c (Faset): If ARRAY is a string, check that NEWELT is a char.
6237 Without this fix, on a 64-bit host (aset S 0 4294967386) would
6238 incorrectly succeed when S was a string, because 4294967386 was
6239 truncated before it was used.
6241 * chartab.c (Fchar_table_range): Use CHARACTERP to check range.
6242 Otherwise, an out-of-range integer could cause undefined behavior
6245 * composite.c: Use int, not EMACS_INT, for characters.
6246 (fill_gstring_body, composition_compute_stop_pos): Use int, not
6247 EMACS_INT, for values that are known to be in character range.
6248 This doesn't fix any bugs but is the usual style inside Emacs and
6249 may generate better code on 32-bit machines.
6251 Make sure a 64-bit char is never passed to ENCODE_CHAR.
6252 This is for reasons similar to the recent CHAR_STRING fix.
6253 * charset.c (Fencode_char): Check that character arg is actually
6254 a character. Pass an int to ENCODE_CHAR.
6255 * charset.h (ENCODE_CHAR): Verify that the character argument is no
6256 wider than 'int', as a compile-time check to prevent future regressions
6259 * character.c (char_string): Remove unnecessary casts.
6261 Make sure a 64-bit char is never passed to CHAR_STRING.
6262 Otherwise, CHAR_STRING would do the wrong thing on a 64-bit platform,
6263 by silently ignoring the top 32 bits, allowing some values
6264 that were far too large to be valid characters.
6265 * character.h: Include <verify.h>.
6266 (CHAR_STRING, CHAR_STRING_ADVANCE): Verify that the character
6267 arguments are no wider than unsigned, as a compile-time check
6268 to prevent future regressions in this area.
6270 * editfns.c (Fchar_to_string, general_insert_function, Finsert_char)
6271 (Fsubst_char_in_region):
6273 * xdisp.c (decode_mode_spec_coding):
6274 Adjust to CHAR_STRING's new requirement.
6275 * editfns.c (Finsert_char, Fsubst_char_in_region):
6276 * fns.c (concat): Check that character args are actually
6277 characters. Without this test, these functions did the wrong
6278 thing with wildly out-of-range values on 64-bit hosts.
6280 Remove incorrect casts to 'unsigned' that lose info on 64-bit hosts.
6281 These casts should not be needed on 32-bit hosts, either.
6282 * keyboard.c (read_char):
6283 * lread.c (Fload): Remove casts to unsigned.
6285 * lisp.h (UNSIGNED_CMP): New macro.
6286 This fixes comparison bugs on 64-bit hosts.
6287 (ASCII_CHAR_P): Use it.
6288 * casefiddle.c (casify_object):
6289 * character.h (ASCII_BYTE_P, CHAR_VALID_P)
6290 (SINGLE_BYTE_CHAR_P, CHAR_STRING):
6291 * composite.h (COMPOSITION_ENCODE_RULE_VALID):
6292 * dispextern.h (FACE_FROM_ID):
6293 * keyboard.c (read_char): Use UNSIGNED_CMP.
6295 * xmenu.c (dialog_selection_callback) [!USE_GTK]: Cast to intptr_t,
6296 not to EMACS_INT, to avoid GCC warning.
6298 * xfns.c (x_set_scroll_bar_default_width): Remove unused 'int' locals.
6300 * buffer.h (PTR_BYTE_POS, BUF_PTR_BYTE_POS): Remove harmful cast.
6301 The cast incorrectly truncated 64-bit byte offsets to 32 bits, and
6302 isn't needed on 32-bit machines.
6304 * buffer.c (Fgenerate_new_buffer_name):
6305 Use EMACS_INT for count, not int.
6306 (advance_to_char_boundary): Return EMACS_INT, not int.
6308 * data.c (Qcompiled_function): Now static.
6310 * window.c (window_body_lines): Now static.
6312 * image.c (gif_load): Rename local to avoid shadowing.
6314 * lisp.h (SAFE_ALLOCA_LISP): Check for integer overflow.
6315 (struct Lisp_Save_Value): Use ptrdiff_t, not int, for 'integer' member.
6316 * alloc.c (make_save_value): Integer argument is now of type
6318 (mark_object): Use ptrdiff_t, not int.
6319 * lisp.h (pD): New macro.
6320 * print.c (print_object): Use it.
6322 * alloc.c: Use EMACS_INT, not int, to count objects.
6323 (total_conses, total_markers, total_symbols, total_vector_size)
6324 (total_free_conses, total_free_markers, total_free_symbols)
6325 (total_free_floats, total_floats, total_free_intervals)
6326 (total_intervals, total_strings, total_free_strings):
6327 Now EMACS_INT, not int. All uses changed.
6328 (Fgarbage_collect): Compute overall total using a double, so that
6329 integer overflow is less likely to be a problem. Check for overflow
6330 when converting back to an integer.
6331 (n_interval_blocks, n_string_blocks, n_float_blocks, n_cons_blocks)
6332 (n_vectors, n_symbol_blocks, n_marker_blocks): Remove.
6333 These were 'int' variables that could overflow on 64-bit hosts;
6334 they were never used, so remove them instead of repairing them.
6335 (nzombies, ngcs, max_live, max_zombies): Now EMACS_INT, not 'int'.
6336 (inhibit_garbage_collection): Set gc_cons_threshold to max value.
6337 Previously, this ceilinged at INT_MAX, but that doesn't work on
6339 (allocate_pseudovector): Don't use EMACS_INT when int would do.
6341 * alloc.c (Fmake_bool_vector): Don't assume vector size fits in int.
6342 (allocate_vectorlike): Check for ptrdiff_t overflow.
6343 (mark_vectorlike, mark_char_table, mark_object): Avoid EMACS_UINT
6344 when a (possibly-narrower) signed value would do just as well.
6345 We prefer using signed arithmetic, to avoid comparison confusion.
6347 * alloc.c: Catch some string size overflows that we were missing.
6348 (XMALLOC_OVERRUN_CHECK_SIZE) [!XMALLOC_OVERRUN_CHECK]: Define to 0,
6349 for convenience in STRING_BYTES_MAX.
6350 (STRING_BYTES_MAX): New macro, superseding the old one in lisp.h.
6351 The definition here is exact; the one in lisp.h was approximate.
6352 (allocate_string_data): Check for string overflow. This catches
6353 some instances we weren't catching before. Also, it catches
6354 size_t overflow on (unusual) hosts where SIZE_MAX <= min
6355 (PTRDIFF_MAX, MOST_POSITIVE_FIXNUM), e.g., when size_t is 32 bits
6356 and ptrdiff_t and EMACS_INT are both 64 bits.
6358 * character.c, coding.c, doprnt.c, editfns.c, eval.c:
6359 All uses of STRING_BYTES_MAX replaced by STRING_BYTES_BOUND.
6360 * lisp.h (STRING_BYTES_BOUND): Rename from STRING_BYTES_MAX.
6362 * character.c (string_escape_byte8): Fix nbytes/nchars typo.
6364 * alloc.c (Fmake_string): Check for out-of-range init.
6366 2011-06-15 Stefan Monnier <monnier@iro.umontreal.ca>
6368 * eval.c (Fdefvaralias): Also mark the target as variable-special-p.
6370 2011-06-14 Jan Djärv <jan.h.d@swipnet.se>
6372 * xfns.c (x_set_scroll_bar_default_width): Remove argument to
6373 xg_get_default_scrollbar_width.
6375 * gtkutil.c: Include emacsgtkfixed.h if HAVE_GTK3.
6376 (int_gtk_range_get_value): Move to the scroll bar part of the file.
6377 (style_changed_cb): Call update_theme_scrollbar_width and call
6378 x_set_scroll_bar_default_width and xg_frame_set_char_size for
6379 all frames (Bug#8505).
6380 (xg_create_frame_widgets): Call emacs_fixed_new if HAVE_GTK3 (Bug#8505).
6381 Call gtk_window_set_resizable if HAVE_GTK3.
6382 (x_wm_set_size_hint): Call emacs_fixed_set_min_size with min width
6383 and height if HAVE_GTK3 (Bug#8505).
6384 (scroll_bar_width_for_theme): New variable.
6385 (update_theme_scrollbar_width): New function.
6386 (xg_get_default_scrollbar_width): Move code to
6387 update_theme_scrollbar_width, just return scroll_bar_width_for_theme.
6388 (xg_initialize): Call update_theme_scrollbar_width.
6390 * gtkutil.h (xg_get_default_scrollbar_width): Remove argument.
6392 * emacsgtkfixed.c, emacsgtkfixed.h: New files.
6394 2011-06-12 Martin Rudalics <rudalics@gmx.at>
6396 * frame.c (make_frame): Call other_buffer_safely instead of
6399 * window.c (temp_output_buffer_show): Call display_buffer with
6400 second argument Vtemp_buffer_show_specifiers and reset latter
6401 immediately after the call.
6402 (Vtemp_buffer_show_specifiers): New variable.
6403 (auto_window_vscroll_p, next_screen_context_lines)
6404 (Vscroll_preserve_screen_position): Remove leading asterisks from
6407 2011-06-12 Paul Eggert <eggert@cs.ucla.edu>
6409 Fix minor problems found by GCC 4.6.0 static checking.
6410 * buffer.c (Qclone_number): Remove for now, as it's unused.
6411 (record_buffer, Funrecord_buffer): Rename local to avoid shadowing.
6412 (record_buffer): Remove unused local.
6413 * frame.c (other_visible_frames, frame_buffer_list): Now static.
6414 (set_frame_buffer_list): Remove; unused.
6415 * frame.h (other_visible_frames): Remove decl.
6416 * keyboard.h (menu_items_inuse): Declare only if USE_GTK || USE_MOTIF.
6417 * lisp.h (frame_buffer_list, set_frame_buffer_list): Remove decls.
6418 (add_gpm_wait_descriptor, delete_gpm_wait_descriptor): Declare only
6420 * menu.c (menu_items_inuse): Now static unless USE_GTK || USE_MOTIF.
6421 * process.c (add_gpm_wait_descriptor, delete_gpm_wait_descriptor):
6422 Define only if HAVE_GPM.
6423 * widget.c (EmacsFrameResize, emacsFrameClassRec): Now static.
6424 (update_hints_inhibit): Remove; never set. All uses removed.
6425 * widgetprv.h (emacsFrameClassRec): Remove decl.
6426 * window.c (delete_deletable_window): Now returns void, since it
6427 wasn't returning anything.
6428 (compare_window_configurations): Remove unused locals.
6429 * xfns.c (x_set_scroll_bar_default_width): Remove unused locals.
6430 * xmenu.c (x_menu_set_in_use): Define only if USE_GTK || USE_MOTIF.
6431 (dialog_selection_callback) [!USE_GTK]: Prefer intptr_t for integers
6432 the same widths as pointers. This follows up on the 2011-05-06 patch.
6433 * xterm.c (x_alloc_lighter_color_for_widget): Define only if USE_LUCID.
6434 * xterm.h: Likewise.
6435 (x_menu_set_in_use): Declare only if USE_GTK || USE_MOTIF.
6437 2011-06-12 Juanma Barranquero <lekktu@gmail.com>
6439 * makefile.w32-in: Update dependencies.
6440 (LISP_H): Add lib/intprops.h.
6442 2011-06-11 Chong Yidong <cyd@stupidchicken.com>
6444 * image.c (gif_load): Add animation frame delay to the metadata.
6445 (syms_of_image): Use DEFSYM. New symbol `delay'.
6447 2011-06-11 Martin Rudalics <rudalics@gmx.at>
6449 * window.c (delete_deletable_window): Re-add.
6450 (Fset_window_configuration): Rewrite to handle dead buffers and
6451 consequently deletable windows.
6452 (window_tree, Fwindow_tree): Remove. Supply functionality in
6454 (compare_window_configurations): Simplify code.
6456 2011-06-11 Andreas Schwab <schwab@linux-m68k.org>
6458 * image.c (imagemagick_load_image): Fix type mismatch.
6459 (Fimagemagick_types): Likewise.
6461 * window.h (replace_buffer_in_windows): Declare.
6463 2011-06-11 Martin Rudalics <rudalics@gmx.at>
6465 * buffer.c: New Lisp objects Qbuffer_list_update_hook and
6466 Qclone_number. Remove external declaration of Qdelete_window.
6467 (Fbuffer_list): Rewrite doc-string. Minor restructuring of
6469 (Fget_buffer_create, Fmake_indirect_buffer, Frename_buffer):
6470 Run Qbuffer_list_update_hook if allowed.
6471 (Fother_buffer): Rewrite doc-string. Major rewrite for new
6472 buffer list implementation.
6473 (other_buffer_safely): New function.
6474 (Fkill_buffer): Replace call to replace_buffer_in_all_windows by
6475 calls to replace_buffer_in_windows and
6476 replace_buffer_in_windows_safely. Run Qbuffer_list_update_hook
6478 (record_buffer): Inhibit quitting and rewrite using quittable
6479 functions. Run Qbuffer_list_update_hook if allowed.
6480 (Frecord_buffer, Funrecord_buffer): New functions.
6481 (switch_to_buffer_1, Fswitch_to_buffer): Remove.
6482 Move switch-to-buffer to window.el.
6483 (bury-buffer): Move to window.el.
6484 (Vbuffer_list_update_hook): New variable.
6486 * lisp.h (other_buffer_safely): Add prototype in buffer.c
6489 * window.h (resize_frame_windows): Move up in code.
6490 (Fwindow_frame): Remove EXFUN.
6491 (replace_buffer_in_all_windows): Remove prototype.
6492 (replace_buffer_in_windows_safely): Add prototype.
6494 * window.c: Declare Qdelete_window static again. Move down
6495 declaration of select_count.
6496 (Fnext_window, Fprevious_window): Rewrite doc-strings.
6497 (Fother_window): Move to window.el.
6498 (window_loop): Remove DELETE_BUFFER_WINDOWS and UNSHOW_BUFFER
6499 cases. Add REPLACE_BUFFER_IN_WINDOWS_SAFELY case.
6500 (Fdelete_windows_on, Freplace_buffer_in_windows): Move to
6502 (replace_buffer_in_windows): Implement by calling
6503 Qreplace_buffer_in_windows.
6504 (replace_buffer_in_all_windows): Remove with some functionality
6505 moved into replace_buffer_in_windows_safely.
6506 (replace_buffer_in_windows_safely): New function.
6507 (select_window_norecord, select_frame_norecord): Move in front
6508 of run_window_configuration_change_hook. Remove now obsolete
6510 (Fset_window_buffer): Rewrite doc-string.
6511 Call Qrecord_window_buffer.
6512 (keys_of_window): Move binding for other-window to window.el.
6514 2011-06-11 Chong Yidong <cyd@stupidchicken.com>
6516 * dispextern.h (struct image): Replace data member, whose int_val
6517 and ptr_val fields were not used by anything, with a single
6520 * image.c (Fimage_metadata, make_image, mark_image, tiff_load)
6521 (gif_clear_image, gif_load, imagemagick_load_image)
6522 (gs_clear_image, gs_load): Callers changed.
6524 2011-06-10 Paul Eggert <eggert@cs.ucla.edu>
6526 * buffer.h: Include <time.h>, for time_t.
6527 Needed to build on FreeBSD 8.2. Problem reported by Herbert J. Skuhra.
6529 Fix minor problems found by static checking.
6531 * image.c (PixelGetMagickColor): Declare if ImageMagick headers don't.
6533 Make identifiers static if they are not used in other modules.
6534 * data.c (Qcompiled_function, Qframe, Qvector):
6535 * image.c (QimageMagick, Qsvg):
6536 * minibuf.c (Qmetadata):
6537 * window.c (resize_window_check, resize_root_window): Now static.
6538 * window.h (resize_window_check, resize_root_window): Remove decls.
6540 * window.c (window_deletion_count, delete_deletable_window):
6542 (window_body_lines): Now static.
6543 (Fdelete_other_windows_internal): Mark vars as initialized.
6544 Make sure 'resize_failed' is initialized.
6545 (run_window_configuration_change_hook): Rename local to avoid shadowing.
6546 (resize_window_apply): Remove unused local.
6547 * window.h (delete_deletable_window): Remove decl.
6549 * image.c (gif_load, svg_load_image): Rename locals to avoid shadowing.
6550 (imagemagick_load_image): Fix pointer signedness problem by changing
6551 last arg from unsigned char * to char *. All uses changed.
6552 Also, fix a local for similar reasons.
6553 Remove unused locals. Remove locals to avoid shadowing.
6554 (fn_rsvg_handle_free): Remove; unused.
6555 (svg_load, svg_load_image): Fix pointer signedness problem.
6556 (imagemagick_load_image): Don't use garbage pointer image_wand.
6558 * ftfont.c (ftfont_get_metrics, ftfont_drive_otf): Remove unused locals.
6560 2011-06-10 Chong Yidong <cyd@stupidchicken.com>
6562 * image.c (gif_load): Fix omitted cast error introduced by
6565 2011-06-10 Martin Rudalics <rudalics@gmx.at>
6567 * window.h (resize_proportionally, orig_total_lines)
6568 (orig_top_line): Remove from window structure.
6569 (set_window_height, set_window_width, change_window_heights)
6570 (Fdelete_window): Remove prototypes.
6571 (resize_frame_windows): Remove duplicate declaration.
6573 2011-06-10 Eli Zaretskii <eliz@gnu.org>
6575 * window.h (resize_frame_windows, resize_window_check)
6576 (delete_deletable_window, resize_root_window)
6577 (resize_frame_windows): Declare prototypes.
6579 * window.c (resize_window_apply): Make definition be "static" to
6580 match the prototype.
6582 2011-06-10 Martin Rudalics <rudalics@gmx.at>
6584 * window.c: Remove declarations of Qwindow_size_fixed,
6585 window_min_size_1, window_min_size_2, window_min_size,
6586 size_window, window_fixed_size_p, enlarge_window, delete_window.
6587 Remove static from declaration of Qdelete_window, it's
6588 temporarily needed by Fbury_buffer.
6589 (replace_window): Don't assign orig_top_line and
6591 (Fdelete_window, delete_window): Remove. Window deletion is
6592 handled by window.el.
6593 (window_loop): Remove DELETE_OTHER_WINDOWS case.
6594 Replace Fdelete_window calls with calls to Qdelete_window.
6595 (Fdelete_other_windows): Remove. Deleting other windows is
6596 handled by window.el.
6597 (window_fixed_size_p): Remove. Fixed-sizeness of windows is
6598 handled in window.el.
6599 (window_min_size_2, window_min_size_1, window_min_size): Remove.
6600 Window minimum sizes are handled in window.el.
6601 (shrink_windows, size_window, set_window_height)
6602 (set_window_width, change_window_heights, window_height)
6603 (window_width, CURBEG, CURSIZE, enlarge_window)
6604 (adjust_window_trailing_edge, Fadjust_window_trailing_edge)
6605 (Fenlarge_window, Fshrink_window): Remove. Window resizing is
6606 handled in window.el.
6607 (make_dummy_parent): Rename to make_parent_window and give it a
6608 second argument horflag.
6609 (make_window): Don't set resize_proportionally any more.
6610 (Fsplit_window): Remove. Windows are split in window.el.
6611 (save_restore_action, save_restore_orig_size)
6612 (shrink_window_lowest_first, save_restore_orig_size): Remove.
6613 Resize mini windows in window.el.
6614 (grow_mini_window, shrink_mini_window): Implement by calling
6615 Qresize_root_window_vertically, resize_window_check and
6616 resize_window_apply.
6617 (saved_window, Fset_window_configuration, save_window_save):
6618 Do not handle orig_top_line, orig_total_lines, and
6619 resize_proportionally.
6620 (window_min_height, window_min_width): Move to window.el.
6621 (keys_of_window): Move bindings for delete-other-windows,
6622 split-window, delete-window and enlarge-window to window.el.
6624 * buffer.c: Temporarily extern Qdelete_window.
6625 (Fbury_buffer): Temporarily call Qdelete_window instead of
6626 Fdelete_window (Fbury_buffer will move to window.el soon).
6628 * frame.c (set_menu_bar_lines_1): Remove code handling
6629 orig_top_line and orig_total_lines.
6631 * dispnew.c (adjust_frame_glyphs_initially): Don't use
6632 set_window_height but set heights directly.
6633 (change_frame_size_1): Use resize_frame_windows.
6635 * xdisp.c (init_xdisp): Don't use set_window_height but set
6638 * xfns.c (x_set_menu_bar_lines, x_set_tool_bar_lines):
6639 Use resize_frame_windows instead of change_window_heights and run
6640 run_window_configuration_change_hook.
6642 * w32fns.c (x_set_tool_bar_lines): Use resize_frame_windows
6643 instead of change_window_heights and run
6644 run_window_configuration_change_hook.
6646 2011-06-09 Martin Rudalics <rudalics@gmx.at>
6648 * window.c (replace_window): Rename second argument REPLACEMENT to
6649 NEW. New third argument SETFLAG. Rewrite.
6650 (delete_window, make_dummy_parent): Call replace_window with
6652 (window_list_1): Move down in code.
6653 (run_window_configuration_change_hook): Move set_buffer part
6654 before select_frame_norecord part in order to unwind correctly.
6655 Rename count1 to count.
6656 (recombine_windows, delete_deletable_window, resize_root_window)
6657 (Fdelete_other_windows_internal)
6658 (Frun_window_configuration_change_hook, make_parent_window)
6659 (resize_window_check, resize_window_apply, Fresize_window_apply)
6660 (resize_frame_windows, Fsplit_window_internal)
6661 (Fdelete_window_internal, Fresize_mini_window_internal):
6663 (syms_of_window): New variables Vwindow_splits and Vwindow_nest.
6665 2011-06-08 Martin Rudalics <rudalics@gmx.at>
6667 * window.h (window): Add some new members to window structure -
6668 normal_lines, normal_cols, new_total, new_normal, clone_number,
6669 splits, nest, prev_buffers, next_buffers.
6670 (WINDOW_TOTAL_SIZE): Move here from window.c.
6671 (MIN_SAFE_WINDOW_WIDTH, MIN_SAFE_WINDOW_HEIGHT): Define here.
6673 * window.c (Fwindow_height, Fwindow_width, Fwindow_full_width_p):
6675 (make_dummy_parent): Set new members of windows structure.
6676 (make_window): Move down in code. Handle new members of window
6678 (Fwindow_clone_number, Fwindow_splits, Fset_window_splits)
6679 (Fwindow_nest, Fset_window_nest, Fwindow_new_total)
6680 (Fwindow_normal_size, Fwindow_new_normal, Fwindow_prev_buffers)
6681 (Fset_window_prev_buffers, Fwindow_next_buffers)
6682 (Fset_window_next_buffers, Fset_window_clone_number):
6684 (Fwindow_hscroll, Fwindow_at, Fwindow_point, Fwindow_start)
6685 (Fwindow_end, Fwindow_line_height, Fset_window_dedicated_p):
6687 (Fwindow_parameters, Fwindow_parameter, Fset_window_parameter):
6688 Argument WINDOW can be now internal window too.
6689 (Fwindow_use_time): Move up in code.
6690 (Fget_buffer_window): Rename argument FRAME to ALL-FRAMES.
6692 (Fset_window_configuration, saved_window)
6693 (Fcurrent_window_configuration, save_window_save): Handle new
6694 members of window structure.
6695 (WINDOW_TOTAL_SIZE, MIN_SAFE_WINDOW_WIDTH)
6696 (MIN_SAFE_WINDOW_HEIGHT): Move to window.h.
6697 (syms_of_window): New Lisp objects Qrecord_window_buffer,
6698 Qwindow_deletable_p, Qdelete_window, Qreplace_buffer_in_windows,
6699 Qget_mru_window, Qresize_root_window,
6700 Qresize_root_window_vertically, Qsafe, Qabove, Qbelow,
6701 Qauto_buffer_name; staticpro them.
6703 2011-06-07 Martin Rudalics <rudalics@gmx.at>
6705 * window.c (Fwindow_total_size, Fwindow_left_column)
6706 (Fwindow_top_line, window_body_lines, Fwindow_body_size)
6707 (Fwindow_list_1): New functions.
6708 (window_box_text_cols): Replace with window_body_cols.
6709 (Fwindow_width, Fscroll_left, Fscroll_right):
6710 Use window_body_cols instead of window_box_text_cols.
6711 (delete_window, Fset_window_configuration):
6712 Call delete_all_subwindows with window as argument.
6713 (delete_all_subwindows): Take a window as argument and not a
6715 (window_loop): Remove handling of GET_LRU_WINDOW and
6717 (Fget_lru_window, Fget_largest_window): Move to window.el.
6719 * window.h: Extern window_body_cols instead of
6720 window_box_text_cols. delete_all_subwindows now takes a
6721 Lisp_Object as argument.
6723 * indent.c (compute_motion, Fcompute_motion):
6724 Use window_body_cols instead of window_box_text_cols.
6726 * frame.c (delete_frame): Call delete_all_subwindows with root
6729 2011-06-07 Daniel Colascione <dan.colascione@gmail.com>
6731 * fns.c (Fputhash): Document return value.
6733 2011-06-06 Chong Yidong <cyd@stupidchicken.com>
6735 * image.c (gif_load): Implement gif89a spec "no disposal" method.
6737 2011-06-06 Paul Eggert <eggert@cs.ucla.edu>
6739 Cons<->int and similar integer overflow fixes (Bug#8794).
6741 Check for overflow when converting integer to cons and back.
6742 * charset.c (Fdefine_charset_internal, Fdecode_char):
6743 Use cons_to_unsigned to catch overflow.
6744 (Fencode_char): Use INTEGER_TO_CONS.
6745 * composite.h (LGLYPH_CODE): Use cons_to_unsigned.
6746 (LGLYPH_SET_CODE): Use INTEGER_TO_CONS.
6747 * data.c (long_to_cons, cons_to_long): Remove.
6748 (cons_to_unsigned, cons_to_signed): New functions.
6749 These signal an error for invalid or out-of-range values.
6750 * dired.c (Ffile_attributes): Use INTEGER_TO_CONS.
6751 * fileio.c (Fset_visited_file_modtime): Use CONS_TO_INTEGER.
6752 * font.c (Ffont_variation_glyphs):
6753 * fontset.c (Finternal_char_font): Use INTEGER_TO_CONS.
6754 * lisp.h: Include <intprops.h>.
6755 (INTEGER_TO_CONS, CONS_TO_INTEGER): New macros.
6756 (cons_to_signed, cons_to_unsigned): New decls.
6757 (long_to_cons, cons_to_long): Remove decls.
6758 * undo.c (record_first_change): Use INTEGER_TO_CONS.
6759 (Fprimitive_undo): Use CONS_TO_INTEGER.
6760 * xfns.c (Fx_window_property): Likewise.
6761 * xselect.c: Include <limits.h>.
6762 (x_own_selection, selection_data_to_lisp_data):
6763 Use INTEGER_TO_CONS.
6764 (x_handle_selection_request, x_handle_selection_clear)
6765 (x_get_foreign_selection, Fx_disown_selection_internal)
6766 (Fx_get_atom_name, x_send_client_event): Use CONS_TO_INTEGER.
6767 (lisp_data_to_selection_data): Use cons_to_unsigned.
6768 (x_fill_property_data): Use cons_to_signed.
6769 Report values out of range.
6771 Check for buffer and string overflow more precisely.
6772 * buffer.h (BUF_BYTES_MAX): New macro.
6773 * lisp.h (STRING_BYTES_MAX): New macro.
6774 * alloc.c (Fmake_string):
6775 * character.c (string_escape_byte8):
6776 * coding.c (coding_alloc_by_realloc):
6777 * doprnt.c (doprnt):
6778 * editfns.c (Fformat):
6780 Use STRING_BYTES_MAX, not MOST_POSITIVE_FIXNUM,
6781 since they may not be the same number.
6782 * editfns.c (Finsert_char):
6783 * fileio.c (Finsert_file_contents):
6784 Likewise for BUF_BYTES_MAX.
6786 * image.c: Use ptrdiff_t, not int, for sizes.
6787 (slurp_file): Switch from int to ptrdiff_t.
6789 (slurp_file): Check that file size fits in both size_t (for
6790 malloc) and ptrdiff_t (for sanity and safety).
6792 * fileio.c (Fverify_visited_file_modtime): Avoid time overflow
6793 if b->modtime has its maximal value.
6795 * dired.c (Ffile_attributes): Don't assume EMACS_INT has >32 bits.
6797 Don't assume time_t can fit into int.
6798 * buffer.h (struct buffer.modtime): Now time_t, not int.
6799 * fileio.c (Fvisited_file_modtime): No need for time_t cast now.
6800 * undo.c (Fprimitive_undo): Use time_t, not int, for time_t value.
6802 Minor fixes for signed vs unsigned integers.
6803 * character.h (MAYBE_UNIFY_CHAR):
6804 * charset.c (maybe_unify_char):
6805 * keyboard.c (read_char, reorder_modifiers):
6806 XINT -> XFASTINT, since the integer must be nonnegative.
6807 * ftfont.c (ftfont_spec_pattern):
6808 * keymap.c (access_keymap, silly_event_symbol_error):
6809 XUINT -> XFASTINT, since the integer must be nonnegative.
6810 (Fsingle_key_description, preferred_sequence_p): XUINT -> XINT,
6811 since it makes no difference and we prefer signed.
6812 * keyboard.c (record_char): Use XUINT when all the neighbors do.
6813 (access_keymap): NATNUMP -> INTEGERP, since the integer must be
6816 2011-06-06 Stefan Monnier <monnier@iro.umontreal.ca>
6818 * window.h (Fwindow_frame): Declare.
6820 2011-06-06 Paul Eggert <eggert@cs.ucla.edu>
6822 * alloc.c: Simplify handling of large-request failures (Bug#8800).
6823 (SPARE_MEMORY): Always define.
6824 (LARGE_REQUEST): Remove.
6825 (memory_full): Use SPARE_MEMORY rather than LARGE_REQUEST.
6827 2011-06-06 Martin Rudalics <rudalics@gmx.at>
6829 * lisp.h: Move EXFUNS for Fframe_root_window,
6830 Fframe_first_window and Fset_frame_selected_window to window.h.
6832 * window.h: Move EXFUNS for Fframe_root_window,
6833 Fframe_first_window and Fset_frame_selected_window here from
6836 * frame.c (Fwindow_frame, Fframe_first_window)
6837 (Fframe_root_window, Fframe_selected_window)
6838 (Fset_frame_selected_window): Move to window.c.
6839 (Factive_minibuffer_window): Move to minibuf.c.
6840 (Fother_visible_frames_p): New function.
6842 * minibuf.c (Factive_minibuffer_window): Move here from frame.c.
6844 * window.c (decode_window, decode_any_window): Move up in code.
6845 (Fwindowp, Fwindow_live_p): Rewrite doc-strings.
6846 (inhibit_frame_unsplittable): Remove unused variable.
6847 (Fwindow_buffer): Move up and rewrite doc-string.
6848 (Fwindow_parent, Fwindow_vchild, Fwindow_hchild, Fwindow_next)
6849 (Fwindow_prev): New functions.
6850 (Fwindow_frame): Move here from frame.c. Accept any window as
6852 (Fframe_root_window, Fframe_first_window)
6853 (Fframe_selected_window): Move here from frame.c. Accept frame
6854 or arbitrary window as argument. Update doc-strings.
6855 (Fminibuffer_window): Move up in code.
6856 (Fwindow_minibuffer_p): Move up in code and simplify.
6857 (Fset_frame_selected_window): Move here from frame.c.
6859 (Fselected_window, select_window, Fselect_window): Move up in
6860 code. Minor doc-string fixes.
6862 2011-06-06 Paul Eggert <eggert@cs.ucla.edu>
6864 * alloc.c (memory_full) [SYSTEM_MALLOC]: Port to MacOS (Bug#8800).
6865 Do not assume that spare memory exists; that assumption is valid
6866 only if SYSTEM_MALLOC.
6867 (LARGE_REQUEST): New macro, so that the issue of large requests
6868 is separated from the issue of spare memory.
6870 2011-06-05 Andreas Schwab <schwab@linux-m68k.org>
6872 * editfns.c (Fformat): Correctly handle zero flag with hexadecimal
6875 * gtkutil.c (xg_get_default_scrollbar_width): Avoid warning.
6877 * xfns.c (x_set_scroll_bar_default_width): Move declarations
6880 2011-06-05 Jan Djärv <jan.h.d@swipnet.se>
6882 * gtkutil.c (xg_get_default_scrollbar_width): New function.
6884 * gtkutil.h: Declare xg_get_default_scrollbar_width.
6886 * xfns.c (x_set_scroll_bar_default_width): If USE_GTK, get
6887 min width by calling x_set_scroll_bar_default_width (Bug#8505).
6889 2011-06-05 Juanma Barranquero <lekktu@gmail.com>
6891 * xdisp.c (single_display_spec_intangible_p): Remove declaration.
6893 2011-06-04 Chong Yidong <cyd@stupidchicken.com>
6895 * xselect.c (x_clipboard_manager_save): Remove redundant arg.
6896 (x_clipboard_manager_save): Add return value.
6897 (x_clipboard_manager_error_1, x_clipboard_manager_error_2):
6899 (x_clipboard_manager_save_frame, x_clipboard_manager_save_all):
6900 Obey Vx_select_enable_clipboard_manager. Catch errors in
6901 x_clipboard_manager_save (Bug#8779).
6902 (Vx_select_enable_clipboard_manager): New variable.
6903 (x_get_foreign_selection): Reduce scope of x_catch_errors (Bug#8790).
6905 2011-06-04 Dan Nicolaescu <dann@ics.uci.edu>
6907 * emacs.c (main): Warn when starting a GTK emacs in daemon mode.
6909 2011-06-04 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
6911 * fringe.c (update_window_fringes): Don't update overlay arrow bitmap
6912 in the current matrix if keep_current_p is non-zero.
6914 2011-06-04 Eli Zaretskii <eliz@gnu.org>
6916 * bidi.c (bidi_level_of_next_char): Fix last change.
6918 2011-06-03 Eli Zaretskii <eliz@gnu.org>
6920 Support bidi reordering of text covered by display properties.
6922 * bidi.c (bidi_copy_it): Use offsetof instead of emulating it.
6923 (bidi_fetch_char, bidi_fetch_char_advance): New functions.
6924 (bidi_cache_search, bidi_cache_iterator_state)
6925 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak)
6926 (bidi_level_of_next_char, bidi_move_to_visually_next):
6927 Support character positions inside a run of characters covered by a
6929 (bidi_paragraph_init, bidi_resolve_explicit_1)
6930 (bidi_level_of_next_char): Call bidi_fetch_char and
6931 bidi_fetch_char_advance instead of FETCH_CHAR and
6933 (bidi_init_it): Initialize new members.
6934 (LRE_CHAR, RLE_CHAR, PDF_CHAR, LRO_CHAR, RLO_CHAR): Remove macro
6936 (bidi_explicit_dir_char): Lookup character type in bidi_type_table,
6937 instead of using explicit *_CHAR codes.
6938 (bidi_resolve_explicit, bidi_resolve_weak):
6939 Use FETCH_MULTIBYTE_CHAR instead of FETCH_CHAR, as reordering of
6940 bidirectional text is supported only in multibyte buffers.
6941 (bidi_init_it): Accept additional argument FRAME_WINDOW_P and use
6942 it to initialize the frame_window_p member of struct bidi_it.
6943 (bidi_cache_iterator_state, bidi_resolve_explicit_1)
6944 (bidi_resolve_explicit, bidi_resolve_weak)
6945 (bidi_level_of_next_char, bidi_move_to_visually_next): Abort if
6946 bidi_it->nchars is non-positive.
6947 (bidi_level_of_next_char): Don't try to lookup the cache for the
6948 next/previous character if nothing is cached there yet, or if we
6949 were just reseat()'ed to a new position.
6951 * xdisp.c (set_cursor_from_row): Set start and stop points
6952 according to the row's direction when priming the loop that looks
6953 for the glyph on which to display cursor.
6954 (single_display_spec_intangible_p): Function deleted.
6955 (display_prop_intangible_p): Reimplement to call
6956 handle_display_spec instead of single_display_spec_intangible_p.
6957 Accept 3 additional arguments needed by handle_display_spec.
6958 This fixes incorrect cursor motion across display property with complex
6959 values: lists, `(when COND...)' forms, etc.
6960 (single_display_spec_string_p): Support property values that are
6961 lists with the argument STRING its top-level element.
6962 (display_prop_string_p): Fix the condition for processing a
6963 property that is a list to be consistent with handle_display_spec.
6964 (handle_display_spec): New function, refactored from the
6965 last portion of handle_display_prop.
6966 (compute_display_string_pos): Accept additional argument
6967 FRAME_WINDOW_P. Call handle_display_spec to determine whether the
6968 value of a `display' property is a "replacing spec".
6969 (handle_single_display_spec): Accept 2 additional arguments BUFPOS
6970 and FRAME_WINDOW_P. If IT is NULL, don't set up the iterator from
6971 the display property, but just return a value indicating whether
6972 the display property will replace the characters it covers.
6973 (Fcurrent_bidi_paragraph_direction): Initialize the nchars and
6974 frame_window_p members of struct bidi_it.
6975 (compute_display_string_pos, compute_display_string_end):
6977 (push_it): Accept second argument POSITION, where pop_it should
6978 jump to continue iteration.
6979 (reseat_1): Initialize bidi_it.disp_pos.
6981 * keyboard.c (adjust_point_for_property): Adjust the call to
6982 display_prop_intangible_p to its new signature.
6984 * dispextern.h (struct bidi_it): New member frame_window_p.
6985 (bidi_init_it): Update prototypes.
6986 (display_prop_intangible_p): Update prototype.
6987 (compute_display_string_pos, compute_display_string_end):
6989 (struct bidi_it): New members nchars and disp_pos. ch_len is now
6992 2011-06-02 Paul Eggert <eggert@cs.ucla.edu>
6994 Malloc failure behavior now depends on size of allocation.
6995 * alloc.c (buffer_memory_full, memory_full): New arg NBYTES.
6996 * lisp.h: Change signatures accordingly.
6997 * alloc.c, buffer.c, editfns.c, menu.c, minibuf.c, xterm.c:
6998 All callers changed. (Bug#8762)
7000 * gnutls.c: Use Emacs's memory allocators.
7001 Without this change, the gnutls library would invoke malloc etc.
7002 directly, which causes problems on non-SYNC_INPUT hosts, and which
7003 runs afoul of improving memory_full behavior. (Bug#8761)
7004 (fn_gnutls_global_set_mem_functions): New macro or function pointer.
7005 (emacs_gnutls_global_init): Use it to specify xmalloc, xrealloc,
7006 xfree instead of the default malloc, realloc, free.
7007 (Fgnutls_boot): No need to check for memory allocation failure,
7008 since xmalloc does that for us.
7010 Remove arbitrary limit of 2**31 entries in hash tables. (Bug#8771)
7011 * category.c (hash_get_category_set):
7012 * ccl.c (ccl_driver):
7013 * charset.c (Fdefine_charset_internal):
7014 * charset.h (struct charset.hash_index):
7015 * composite.c (get_composition_id, gstring_lookup_cache)
7016 (composition_gstring_put_cache):
7017 * composite.h (struct composition.hash_index):
7018 * dispextern.h (struct image.hash):
7019 * fns.c (next_almost_prime, larger_vector, cmpfn_eql)
7020 (cmpfn_equal, cmpfn_user_defined, hashfn_eq, hashfn_eql)
7021 (hashfn_equal, hashfn_user_defined, make_hash_table)
7022 (maybe_resize_hash_table, hash_lookup, hash_put)
7023 (hash_remove_from_table, hash_clear, sweep_weak_table, SXHASH_COMBINE)
7024 (sxhash_string, sxhash_list, sxhash_vector, sxhash_bool_vector)
7025 (Fsxhash, Fgethash, Fputhash, Fmaphash):
7026 * image.c (make_image, search_image_cache, lookup_image)
7027 (xpm_put_color_table_h):
7028 * lisp.h (struct Lisp_Hash_Table):
7029 * minibuf.c (Ftry_completion, Fall_completions, Ftest_completion):
7030 * print.c (print): Use 'EMACS_UINT' and 'EMACS_INT'
7031 for hashes and hash indexes, instead of 'unsigned' and 'int'.
7032 * alloc.c (allocate_vectorlike):
7033 Check for overflow in vector size calculations.
7034 * ccl.c (ccl_driver):
7035 Check for overflow when converting EMACS_INT to int.
7036 * fns.c, image.c: Remove unnecessary static decls that would otherwise
7037 need to be updated by these changes.
7038 * fns.c (make_hash_table, maybe_resize_hash_table):
7039 Check for integer overflow with large hash tables.
7040 (make_hash_table, maybe_resize_hash_table, Fmake_hash_table):
7041 Prefer the faster XFLOAT_DATA to XFLOATINT where either will do.
7042 (SXHASH_REDUCE): New macro.
7043 (sxhash_string, sxhash_list, sxhash_vector, sxhash_bool_vector):
7044 Use it instead of discarding useful hash info with large hash values.
7045 (sxhash_float): New function.
7046 (sxhash): Use it. No more need for "& INTMASK" due to above changes.
7047 * lisp.h (FIXNUM_BITS): New macro, useful for SXHASH_REDUCE etc.
7048 (MOST_NEGATIVE_FIXNUM, MOST_POSITIVE_FIXNUM, INTMASK):
7049 Rewrite to use FIXNUM_BITS, as this simplifies things.
7050 (next_almost_prime, larger_vector, sxhash, hash_lookup, hash_put):
7051 Adjust signatures to match updated version of code.
7052 (consing_since_gc): Now EMACS_INT, since a single hash table can
7053 use more than INT_MAX bytes.
7055 2011-06-01 Dan Nicolaescu <dann@ics.uci.edu>
7057 Make it possible to build with GCC-4.6+ -O2 -flto.
7059 * emacs.c (__malloc_initialize_hook): Mark as EXTERNALLY_VISIBLE.
7061 2011-06-01 Stefan Monnier <monnier@iro.umontreal.ca>
7063 * minibuf.c (get_minibuffer, read_minibuf_unwind):
7064 Call minibuffer-inactive-mode.
7066 2011-05-31 Juanma Barranquero <lekktu@gmail.com>
7068 * makefile.w32-in ($(BLD)/data.$(O), $(BLD)/editfns.$(O)):
7069 Update dependencies.
7071 2011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
7073 * data.c (init_data): Remove code for UTS, this system is not
7076 2011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
7078 Don't force ./temacs to start in terminal mode.
7080 * frame.c (make_initial_frame): Initialize faces in all cases, not
7081 only when CANNOT_DUMP is defined.
7082 * dispnew.c (init_display): Remove CANNOT_DUMP condition.
7084 2011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
7086 * dispnew.c (add_window_display_history): Use const for the string
7087 pointer. Remove declaration, not needed.
7089 2011-05-31 Paul Eggert <eggert@cs.ucla.edu>
7091 Use 'inline', not 'INLINE'.
7092 <http://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00914.html>
7093 * alloc.c, fontset.c (INLINE): Remove.
7094 * alloc.c, bidi.c, charset.c, coding.c, dispnew.c, fns.c, image.c:
7095 * intervals.c, keyboard.c, process.c, syntax.c, textprop.c, w32term.c:
7096 * xdisp.c, xfaces.c, xterm.c: Replace all uses of INLINE with inline.
7097 * gmalloc.c (register_heapinfo): Use inline unconditionally.
7098 * lisp.h (LISP_MAKE_RVALUE): Use inline, not __inline__.
7100 2011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
7102 Make it possible to run ./temacs.
7104 * callproc.c (set_initial_environment): Remove CANNOT_DUMP code,
7105 syms_of_callproc does the same thing. Remove test for
7106 "initialized", do it in the caller.
7107 * emacs.c (main): Avoid calling set_initial_environment when dumping.
7109 2011-05-31 Stefan Monnier <monnier@iro.umontreal.ca>
7111 * minibuf.c (Finternal_complete_buffer): Return `category' metadata.
7112 (read_minibuf): Use get_minibuffer.
7113 (syms_of_minibuf): Use DEFSYM.
7114 (Qmetadata): New var.
7115 * data.c (Qbuffer): Don't make it static.
7116 (syms_of_data): Use DEFSYM.
7118 2011-05-31 Paul Eggert <eggert@cs.ucla.edu>
7120 * ccl.c (CCL_CODE_RANGE): Allow negative numbers. (Bug#8751)
7121 (CCL_CODE_MIN): New macro.
7123 2011-05-30 Paul Eggert <eggert@cs.ucla.edu>
7125 * alloc.c (lisp_align_malloc): Omit unnecessary val==NULL tests.
7127 * eval.c (Qdebug): Now static.
7128 * lisp.h (Qdebug): Remove decl. This reverts a part of the
7129 2011-04-26T11:26:05Z!dan.colascione@gmail.com that inadvertently undid part of
7130 2011-04-14T06:48:41Z!eggert@cs.ucla.edu.
7132 2011-05-29 Chong Yidong <cyd@stupidchicken.com>
7134 * image.c: Various fixes to ImageMagick code comments.
7135 (Fimagemagick_types): Doc fix.
7137 2011-05-29 Paul Eggert <eggert@cs.ucla.edu>
7139 Minor fixes prompted by GCC 4.6.0 warnings.
7141 * xselect.c (converted_selections, conversion_fail_tag): Now static.
7143 * emacs.c [HAVE_X_WINDOWS]: Include "xterm.h".
7144 (x_clipboard_manager_save_all): Move extern decl to ...
7145 * xterm.h: ... here, so that it can be checked for consistency.
7147 2011-05-29 Chong Yidong <cyd@stupidchicken.com>
7149 * xselect.c (x_clipboard_manager_save_frame)
7150 (x_clipboard_manager_save_all): New functions.
7151 (Fx_clipboard_manager_save): Lisp function deleted.
7153 * emacs.c (Fkill_emacs): Call x_clipboard_manager_save_all.
7154 * frame.c (delete_frame): Call x_clipboard_manager_save_frame.
7156 * xterm.h: Update prototype.
7158 2011-05-28 William Xu <william.xwl@gmail.com>
7160 * nsterm.m (ns_term_shutdown): Synchronize user defaults before
7163 2011-05-28 Jim Meyering <meyering@redhat.com>
7165 Avoid a sign-extension bug in crypto_hash_function.
7166 * fns.c (to_uchar): Define.
7167 (crypto_hash_function): Use it to convert some newly-signed
7168 variables to unsigned, to avoid sign-extension bugs. For example,
7169 without this change, (md5 "truc") would evaluate to
7170 45723a2aff78ff4fff7fff1114760e62 rather than the expected
7171 45723a2af3788c4ff17f8d1114760e62. Reported by Antoine Levitt in
7172 https://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00883.html.
7174 2011-05-27 Paul Eggert <eggert@cs.ucla.edu>
7176 Integer overflow fixes.
7178 * dbusbind.c: Serial number integer overflow fixes.
7179 (CHECK_DBUS_SERIAL_GET_SERIAL): New macro.
7180 (Fdbus_call_method_asynchronously, xd_read_message_1): Use a float
7181 to hold a serial number that is too large for a fixnum.
7182 (Fdbus_method_return_internal, Fdbus_method_error_internal):
7183 Check for serial numbers out of range. Decode any serial number
7184 that was so large that it became a float. (Bug#8722)
7186 * dbusbind.c: Use XFASTINT rather than XUINT, and check for nonneg.
7187 (Fdbus_call_method, Fdbus_call_method_asynchronously):
7188 Use XFASTINT rather than XUINT when numbers are nonnegative.
7189 (xd_append_arg, Fdbus_method_return_internal):
7190 (Fdbus_method_error_internal): Likewise. Also, for unsigned
7191 arguments, check that Lisp number is nonnegative, rather than
7192 silently wrapping negative numbers around. (Bug#8722)
7193 (xd_read_message_1): Don't assume dbus_uint32_t can fit in int.
7196 * data.c (arith_driver, Flsh): Avoid unnecessary casts to EMACS_UINT.
7198 * ccl.c (ccl_driver): Redo slightly to avoid the need for 'unsigned'.
7200 ccl: Add integer overflow checks.
7201 * ccl.c (CCL_CODE_MAX, GET_CCL_RANGE, GET_CCL_CODE, GET_CCL_INT):
7202 (IN_INT_RANGE): New macros.
7203 (ccl_driver): Use them to check for integer overflow when
7204 decoding a CCL program. Many of the new checks are whether XINT (x)
7205 fits in int; it doesn't always, on 64-bit hosts. The new version
7206 doesn't catch all possible integer overflows, but it's an
7207 improvement. (Bug#8719)
7209 * alloc.c (make_event_array): Use XINT, not XUINT.
7210 There's no need for unsigned here.
7212 * mem-limits.h (EXCEEDS_LISP_PTR) [!USE_LSB_TAG]: EMACS_UINT -> uintptr_t
7213 This follows up to the 2011-05-06 change that substituted uintptr_t
7214 for EMACS_INT. This case wasn't caught back then.
7216 Rework Fformat to avoid integer overflow issues.
7217 * editfns.c: Include <float.h> unconditionally, as it's everywhere
7218 now (part of C89). Include <verify.h>.
7219 (MAX_10_EXP, CONVERTED_BYTE_SIZE): Remove; no longer needed.
7220 (pWIDE, pWIDElen, signed_wide, unsigned_wide): New defns.
7221 (Fformat): Avoid the prepass trying to compute sizes; it was only
7222 approximate and thus did not catch overflow reliably. Instead, walk
7223 through the format just once, formatting and computing sizes as we go,
7224 checking for integer overflow at every step, and allocating a larger
7225 buffer as needed. Keep track separately whether the format is
7226 multibyte. Keep only the most-recently calculated precision, rather
7227 than them all. Record whether each argument has been converted to
7228 string. Use EMACS_INT, not int, for byte and char and arg counts.
7229 Support field widths and precisions larger than INT_MAX. Avoid
7230 sprintf's undefined behavior with conversion specifications such as %#d
7231 and %.0c. Fix bug with strchr succeeding on '\0' when looking for
7232 flags. Fix bug with (format "%c" 256.0). Avoid integer overflow when
7233 formatting out-of-range floating point numbers with int
7236 * lisp.h (FIXNUM_OVERFLOW_P): Work even if arg is a NaN.
7238 * data.c: Avoid integer truncation in expressions involving floats.
7239 * data.c: Include <intprops.h>.
7240 (arith_driver): When there's an integer overflow in an expression
7241 involving floating point, convert the integers to floating point
7242 so that the resulting value does not suffer from catastrophic
7243 integer truncation. For example, on a 64-bit host (* 4
7244 most-negative-fixnum 0.5) should yield about -4.6e+18, not zero.
7245 Do not rely on undefined behavior after integer overflow.
7247 merge count_size_as_multibyte, parse_str_to_multibyte
7248 * character.c, character.h (count_size_as_multibyte):
7249 Rename from parse_str_to_multibyte; all uses changed.
7250 Check for integer overflow.
7251 * insdel.c, lisp.h (count_size_as_multibyte): Remove,
7252 since it's now a duplicate of the other. This is more of
7253 a character than a buffer op, so better that it's in character.c.
7254 * fns.c, print.c: Adjust to above changes.
7256 2011-05-27 Stefan Monnier <monnier@iro.umontreal.ca>
7258 * xselect.c (x_convert_selection): Yet another int/Lisp_Object mixup.
7260 2011-05-27 Paul Eggert <eggert@cs.ucla.edu>
7262 * xselect.c: Fix minor problems prompted by GCC 4.6.0 warnings.
7263 (x_handle_selection_request, frame_for_x_selection): Remove unused vars.
7264 (x_clipboard_manager_save): Now static.
7265 (Fx_clipboard_manager_save): Rename local to avoid shadowing.
7267 * fns.c: Fix minor problems prompted by GCC 4.6.0 warnings.
7268 (crypto_hash_function): Now static.
7269 Fix pointer signedness problems. Avoid unnecessary initializations.
7271 2011-05-27 Chong Yidong <cyd@stupidchicken.com>
7273 * termhooks.h (Vselection_alist): Make it terminal-local.
7275 * terminal.c (create_terminal): Initialize it.
7277 * xselect.c: Support for clipboard managers.
7278 (Vselection_alist): Move to termhooks.h as terminal-local var.
7279 (LOCAL_SELECTION): New macro.
7280 (x_atom_to_symbol): Handle x_display_info_for_display fail case.
7281 (symbol_to_x_atom): Remove gratuitous arg.
7282 (x_handle_selection_request, lisp_data_to_selection_data)
7283 (x_get_foreign_selection, Fx_register_dnd_atom): Callers changed.
7284 (x_own_selection, x_get_local_selection, x_convert_selection):
7285 New arg, specifying work frame. Use terminal-local Vselection_alist.
7286 (some_frame_on_display): Delete unused function.
7287 (Fx_own_selection_internal, Fx_get_selection_internal)
7288 (Fx_disown_selection_internal, Fx_selection_owner_p)
7289 (Fx_selection_exists_p): New optional frame arg.
7290 (frame_for_x_selection, Fx_clipboard_manager_save): New functions.
7291 (x_handle_selection_clear): Don't treat other terminals with the
7292 same keyboard specially. Use the terminal-local Vselection_alist.
7293 (x_clear_frame_selections): Use Frun_hook_with_args.
7295 * xterm.c (x_term_init): Intern ATOM and CLIPBOARD_MANAGER atoms.
7297 * xterm.h: Add support for those atoms.
7299 2011-05-26 Chong Yidong <cyd@stupidchicken.com>
7301 * xselect.c: ICCCM-compliant handling of MULTIPLE targets.
7302 (converted_selections, conversion_fail_tag): New global variables.
7303 (x_selection_request_lisp_error): Free the above.
7304 (x_get_local_selection): Remove unnecessary code.
7305 (x_reply_selection_request): Args changed; handle arbitrary array
7306 of converted selections stored in converted_selections.
7307 Separate the XChangeProperty and SelectionNotify steps.
7308 (x_handle_selection_request): Rewrite to handle MULTIPLE target.
7309 (x_convert_selection): New function.
7310 (x_handle_selection_event): Simplify.
7311 (x_get_foreign_selection): Don't ignore incoming requests while
7312 waiting for an answer; this will fail when we implement
7313 SAVE_TARGETS, and seems unnecessary anyway.
7314 (selection_data_to_lisp_data): Recognize ATOM_PAIR type.
7315 (Vx_sent_selection_functions): Doc fix.
7317 2011-05-26 Leo Liu <sdl.web@gmail.com>
7319 * editfns.c (Ftranspose_regions): Allow empty regions. (Bug#8699)
7321 2011-05-25 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
7323 * dispextern.h (struct glyph_row): New member fringe_bitmap_periodic_p.
7325 * dispnew.c (shift_glyph_matrix, scrolling_window): Mark scrolled row
7326 for fringe update if it has periodic bitmap.
7327 (row_equal_p): Also compare left_fringe_offset, right_fringe_offset,
7328 and fringe_bitmap_periodic_p.
7330 * fringe.c (get_fringe_bitmap_data): New function.
7331 (draw_fringe_bitmap_1, update_window_fringes): Use it.
7332 (update_window_fringes): Record periodicity of fringe bitmap in glyph
7333 row. Mark glyph row for fringe update if periodicity changed.
7335 * xdisp.c (try_window_reusing_current_matrix): Don't mark scrolled row
7336 for fringe update unless it has periodic bitmap.
7338 2011-05-25 Kenichi Handa <handa@m17n.org>
7340 * xdisp.c (get_next_display_element): Set correct it->face_id for
7341 a static composition.
7343 2011-05-24 Leo Liu <sdl.web@gmail.com>
7346 * makefile.w32-in ($(BLD)/fns.$(O)): Include sha1.h.
7348 * fns.c (crypto_hash_function, Fsha1): New function.
7349 (Fmd5): Use crypto_hash_function.
7350 (syms_of_fns): Add Ssha1.
7352 2011-05-22 Paul Eggert <eggert@cs.ucla.edu>
7354 * gnutls.c: Remove unused macros.
7355 (fn_gnutls_transport_set_lowat, fn_gnutls_transport_set_pull_function):
7356 (fn_gnutls_transport_set_push_function) [!WINDOWSNT]:
7357 Remove macros that are defined and never used.
7358 Caught by gcc -Wunused-macros (GCC 4.6.0, Fedora 14).
7360 2011-05-22 Chong Yidong <cyd@stupidchicken.com>
7362 * xselect.c (syms_of_xselect): Remove unused symbol SAVE_TARGETS.
7363 (Fx_get_selection_internal): Minor cleanup.
7364 (Fx_own_selection_internal): Rename arguments for consistency with
7367 2011-05-22 Paul Eggert <eggert@cs.ucla.edu>
7369 * xselect.c (QSAVE_TARGETS): New static var, to fix build failure.
7371 2011-05-22 Chong Yidong <cyd@stupidchicken.com>
7373 * xselect.c (syms_of_xselect): Include character.h; use DEFSYM.
7375 2011-05-21 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
7377 * dispnew.c (scrolling_window): Don't exclude the case that the
7378 last enabled row in the desired matrix touches the bottom boundary.
7380 2011-05-21 Glenn Morris <rgm@gnu.org>
7382 * Makefile.in ($(etc)/DOC): Make second command line even shorter.
7383 (SOME_MACHINE_OBJECTS): Replace FONT_OBJ by its maximal expansion,
7384 and add some more files.
7386 2011-05-20 Eli Zaretskii <eliz@gnu.org>
7388 * callproc.c (Fcall_process) [MSDOS]: Fix arguments to
7389 report_file_error introduced by the change from 2011-05-07.
7391 2011-05-20 Paul Eggert <eggert@cs.ucla.edu>
7393 * systime.h (Time): Define only if emacs is defined.
7394 This is to allow ../lib-src/profile.c to be compiled on FreeBSD,
7395 where the include path doesn't have X11/X.h by default. See
7396 <http://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00561.html>.
7398 2011-05-20 Kenichi Handa <handa@m17n.org>
7400 * composite.c (find_automatic_composition): Fix previous change.
7402 2011-05-20 Glenn Morris <rgm@gnu.org>
7404 * lisp.mk: New file, split from Makefile.in.
7405 * Makefile.in (lisp): Move to separate file, inserted by @lisp_frag@.
7406 (shortlisp): Remove.
7407 ($(etc)/DOC): Edit lisp.mk rather than using $shortlisp.
7409 2011-05-19 Glenn Morris <rgm@gnu.org>
7411 * Makefile.in (MSDOS_SUPPORT_REAL, MSDOS_SUPPORT, NS_SUPPORT)
7412 (REAL_MOUSE_SUPPORT, GPM_MOUSE_SUPPORT, MOUSE_SUPPORT, TOOLTIP_SUPPORT)
7413 (BASE_WINDOW_SUPPORT, X_WINDOW_SUPPORT, WINDOW_SUPPORT): Remove.
7414 (lisp): Set the order to that of loadup.el.
7415 (shortlisp): Make it a copy of $lisp.
7416 (SOME_MACHINE_LISP): Remove.
7417 ($(etc)/DOC): Depend just on $lisp, not $SOME_MACHINE_LISP too.
7418 Use just $shortlisp, not $SOME_MACHINE_LISP too.
7420 2011-05-18 Kenichi Handa <handa@m17n.org>
7422 * composite.c (CHAR_COMPOSABLE_P): Add more check for efficiency.
7423 (BACKWARD_CHAR): Wrap the arg STOP by parenthesis.
7424 (find_automatic_composition): Mostly rewrite for efficiency.
7426 2011-05-18 Juanma Barranquero <lekktu@gmail.com>
7428 * makefile.w32-in: Update dependencies.
7430 2011-05-18 Christoph Scholtes <cschol2112@googlemail.com>
7432 * menu.c: Include limits.h (fixes the MS-Windows build broken by
7433 2011-06-18T18:49:19Z!cyd@stupidchicken.com).
7435 2011-05-18 Paul Eggert <eggert@cs.ucla.edu>
7437 Fix some integer overflow issues, such as string length overflow.
7439 * insdel.c (count_size_as_multibyte): Check for string overflow.
7441 * character.c (lisp_string_width): Check for string overflow.
7442 Use EMACS_INT, not int, for string indexes and lengths; in
7443 particular, 2nd arg is now EMACS_INT, not int. Do not crash if
7444 the resulting string length overflows an EMACS_INT; instead,
7445 report a string overflow if no precision given. When checking for
7446 precision exhaustion, use a check that cannot possibly have
7447 integer overflow. (Bug#8675)
7448 * character.h (lisp_string_width): Adjust to new signature.
7450 * alloc.c (string_overflow): New function.
7451 (Fmake_string): Use it. This doesn't change behavior, but saves
7452 a few bytes and will simplify future changes.
7453 * character.c (string_escape_byte8): Likewise.
7454 * lisp.h (string_overflow): New decl.
7456 Fixups, following up to the user-interface timestamp change.
7457 * nsterm.m (last_mouse_movement_time, ns_mouse_position): Use Time
7458 for UI timestamps, instead of unsigned long.
7459 * msdos.c (mouse_get_pos): Likewise.
7460 * w32inevt.c (movement_time, w32_console_mouse_position): Likewise.
7461 * w32gui.h (Time): Define by including "systime.h" rather than by
7462 declaring it ourselves. (Bug#8664)
7464 * dispextern.h (struct image): Don't assume time_t <= unsigned long.
7465 * image.c (clear_image_cache): Likewise.
7467 * term.c (term_mouse_position): Don't assume time_t wraparound.
7469 Be more systematic about user-interface timestamps.
7470 Before, the code sometimes used 'Time', sometimes 'unsigned long',
7471 and sometimes 'EMACS_UINT', to represent these timestamps.
7472 This change causes it to use 'Time' uniformly, as that's what X uses.
7473 This makes the code easier to follow, and makes it easier to catch
7474 integer overflow bugs such as Bug#8664.
7475 * frame.c (Fmouse_position, Fmouse_pixel_position):
7476 Use Time, not unsigned long, for user-interface timestamps.
7477 * keyboard.c (last_event_timestamp, kbd_buffer_get_event): Likewise.
7478 (button_down_time, make_lispy_position, make_lispy_movement): Likewise.
7479 * keyboard.h (last_event_timestamp): Likewise.
7480 * menu.c (Fx_popup_menu) [!HAVE_X_WINDOWS]: Likewise.
7481 * menu.h (xmenu_show): Likewise.
7482 * term.c (term_mouse_position): Likewise.
7483 * termhooks.h (struct input_event.timestamp): Likewise.
7484 (struct terminal.mouse_position_hook): Likewise.
7485 * xmenu.c (create_and_show_popup_menu, xmenu_show): Likewise.
7486 * xterm.c (XTmouse_position, x_scroll_bar_report_motion): Likewise.
7487 * systime.h (Time): New decl. Pull it in from <X11/X.h> if
7488 HAVE_X_WINDOWS, otherwise define it as unsigned long, which is
7490 * menu.h, termhooks.h: Include "systime.h", for Time.
7492 * keyboard.c (make_lispy_event): Fix problem in integer overflow.
7493 Don't assume that the difference between two unsigned long values
7494 can fit into an integer. At this point, we know button_down_time
7495 <= event->timestamp, so the difference must be nonnegative, so
7496 there's no need to cast the result if double-click-time is
7497 nonnegative, as it should be; check that it's nonnegative, just in
7498 case. This bug is triggered when events are more than 2**31 ms
7499 apart (about 25 days). (Bug#8664)
7501 * xselect.c (last_event_timestamp): Remove duplicate decl.
7502 (x_own_selection): Remove needless cast to unsigned long.
7504 * xmenu.c (set_frame_menubar): Use int, not EMACS_UINT, for indexes
7505 that always fit in int. Use a sentinel instead of a counter, to
7506 avoid a temp and to allay GCC's concerns about possible int overflow.
7507 * frame.h (struct frame): Use int for menu_bar_items_used
7508 instead of EMACS_INT, since it always fits in int.
7510 * menu.c (grow_menu_items): Check for int overflow.
7512 * xmenu.c (set_frame_menubar): Don't mishandle vectors with no nils.
7514 * xterm.c: Use EMACS_INT for Emacs modifiers, and int for X modifiers.
7515 Before, the code was not consistent. These values cannot exceed
7516 2**31 - 1 so there's no need to make them unsigned.
7517 (x_x_to_emacs_modifiers): Accept int and return EMACS_INT.
7518 (x_emacs_to_x_modifiers): Accept EMACS_INT and return int.
7519 (x_x_to_emacs_modifiers, x_emacs_to_x_modifiers): Reject non-integers
7521 * xterm.h (x_x_to_emacs_modifiers): Adjust to signature change.
7523 * lisp.h (XINT) [USE_LISP_UNION_TYPE]: Cast to EMACS_INT.
7524 (XUINT) [USE_LISP_UNION_TYPE]: Cast to EMACS_UINT.
7525 Otherwise, GCC 4.6.0 warns about printf (pI, XINT (...)),
7526 presumably because the widths might not match.
7528 * window.c (size_window): Avoid needless test at loop start.
7530 2011-05-18 Courtney Bane <emacs-bugs-7626@cbane.org> (tiny change)
7532 * term.c (Fresume_tty): Restore hooks before reinitializing (bug#8687).
7534 2011-05-12 Drew Adams <drew.adams@oracle.com>
7536 * textprop.c (Fprevious_single_char_property_change): Doc fix (bug#8655).
7538 2011-05-12 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
7540 * w32term.c (w32_draw_fringe_bitmap): Rename local vars `left' and
7541 `width' to `bar_area_x' and `bar_area_width', respectively.
7542 (x_scroll_run): Take account of fringe background extension.
7544 * xterm.c (x_draw_fringe_bitmap) [USE_TOOLKIT_SCROLL_BARS]:
7545 Rename local vars `left' and `width' to `bar_area_x' and
7546 `bar_area_width', respectively.
7547 (x_scroll_run) [USE_TOOLKIT_SCROLL_BARS]: Take account of fringe
7548 background extension.
7550 2011-05-10 Jim Meyering <meyering@redhat.com>
7552 * xdisp.c (x_intersect_rectangles): Fix typo "the the -> the".
7554 2011-05-10 Juanma Barranquero <lekktu@gmail.com>
7556 * image.c (Finit_image_library): Return t for built-in image types,
7557 like pbm and xbm. (Bug#8640)
7559 2011-05-09 Andreas Schwab <schwab@linux-m68k.org>
7561 * w32menu.c (set_frame_menubar): Fix submenu allocation.
7563 2011-05-07 Eli Zaretskii <eliz@gnu.org>
7565 * w32console.c (Fset_screen_color): Doc fix.
7566 (Fget_screen_color): New function.
7567 (syms_of_ntterm): Defsubr it.
7569 * callproc.c (call_process_cleanup) [MSDOS]: Don't close and
7570 unlink the temporary file if Fcall_process didn't create it in the
7572 (Fcall_process) [MSDOS]: Don't create tempfile if stdout of the
7573 child process will be redirected to a file specified with `:file'.
7574 Don't try to re-open tempfile in that case, and set fd[0] to -1 as
7575 cue to call_process_cleanup not to close that handle.
7577 2011-05-07 Ben Key <bkey76@gmail.com>
7579 * makefile.w32-in: The bootstrap-temacs rule now makes use of
7580 one of two shell specific rules, either bootstrap-temacs-CMD or
7581 bootstrap-temacs-SH. The bootstrap-temacs-SH rule is identical
7582 to the previous implementation of the bootstrap-temacs rule.
7583 The bootstrap-temacs-CMD rule is similar to the previous
7584 implementation of the bootstrap-temacs rule except that it
7585 makes use of the ESC_CFLAGS variable instead of the CFLAGS
7588 These changes, along with some changes to nt/configure.bat,
7589 nt/gmake.defs, and nt/nmake.defs, are required to extend my
7590 earlier fix to add support for --cflags and --ldflags options
7591 that include quotes so that it works whether make uses cmd or
7594 2011-05-06 Michael Albinus <michael.albinus@gmx.de>
7596 * dbusbind.c (QCdbus_type_unix_fd): Declare static.
7597 (xd_remove_watch): Don't check QCdbus_type_unix_fd for SYMBOLP, it
7599 (Fdbus_init_bus, xd_read_queued_messages): Bus can be a symbol or
7600 a string. Handle both cases.
7601 (Fdbus_call_method_asynchronously, Fdbus_register_signal)
7602 (Fdbus_register_method): Use Qinvalid_function.
7604 2011-05-06 Juanma Barranquero <lekktu@gmail.com>
7606 * makefile.w32-in: Update dependencies.
7607 (LISP_H): Add inttypes.h and stdin.h.
7608 (PROCESS_H): Add unistd.h.
7610 2011-05-06 Eli Zaretskii <eliz@gnu.org>
7612 * lread.c: Include limits.h (fixes the MS-Windows build broken by
7613 2011-05-06T07:13:19Z!eggert@cs.ucla.edu).
7615 2011-05-06 Paul Eggert <eggert@cs.ucla.edu>
7617 * image.c (Finit_image_library) [!HAVE_NTGUI]: Omit unused local.
7619 * term.c (vfatal): Remove stray call to va_end.
7620 It's not needed and the C Standard doesn't allow it here anyway.
7622 Use C99's va_copy to avoid undefined behavior on x86-64 GNU/Linux.
7623 * eval.c (verror): doprnt a copy of ap, not the original. (Bug#8545)
7625 * eval.c (verror): OK to create a string of up to MOST_POSITIVE_FIXNUM
7628 * term.c: Don't include <stdarg.h>, as <lisp.h> does that.
7630 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork clobbering.
7632 * process.c (Fformat_network_address): Fix typo: args2 -> *args2.
7634 * xmenu.c (set_frame_menubar): Fix typo: int * -> int (3 times).
7636 * coding.c (detect_coding_charset): Fix typo: * 2 -> *4 (Bug#8601).
7638 * charset.h (struct charset.code_space): Now has 15 elements, not 16.
7639 * charset.c (Fdefine_charset_internal): Don't initialize
7640 charset.code_space[15]. The value was garbage, on hosts with
7641 32-bit int (Bug#8600).
7643 * lread.c (read_integer): Be more consistent with string-to-number.
7644 Use string_to_number to do the actual conversion; this avoids
7645 rounding errors and fixes some other screwups. Without this fix,
7646 for example, #x1fffffffffffffff was misread as -2305843009213693952.
7647 (digit_to_number): Move earlier, for benefit of read_integer.
7648 Return -1 if the digit is out of range for the base, -2 if it is
7649 not a digit in any supported base. (Bug#8602)
7651 * doprnt.c (doprnt): Support arbitrary pI values, such as "I64".
7653 * dispnew.c (scrolling_window): Return 1 if we scrolled,
7654 to match comment at start of function. This also removes a
7655 GCC warning about overflow in a 32+64-bit port.
7657 * lisp.h (EMACS_INT, EMACS_UINT, BITS_PER_EMACS_INT, pI): Simplify.
7659 * dbusbind.c: Do not use XPNTR on a value that may be an integer.
7660 Reported by Stefan Monnier in
7661 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00919.html>.
7662 (xd_remove_watch, Fdbus_init_bus, xd_read_queued_messages):
7663 Use SYMBOLP-guarded XSYMBOL, not XPNTR.
7665 * lisp.h (EMACS_INTPTR): Remove. All uses changed to intptr_t.
7666 (EMACS_UINTPTR): Likewise, with uintptr_t.
7668 * lisp.h: Prefer 64-bit EMACS_INT if available.
7669 (EMACS_INT, EMACS_UINT, BITS_PER_EMACS_INT, pI): Define to 64-bit
7670 on 32-bit hosts that have 64-bit int, so that they can access
7672 However, temporarily disable this change unless the temporary
7673 symbol WIDE_EMACS_INT is defined.
7675 * lread.c, process.c: Do not include <inttypes.h>; lisp.h does it now.
7677 Prefer intptr_t/uintptr_t for integers the same widths as pointers.
7678 This removes an assumption that EMACS_INT and long are the same
7679 width as pointers. The assumption is true for Emacs porting targets
7680 now, but we want to make other targets possible.
7681 * lisp.h: Include <inttypes.h>, for INTPTR_MAX, UINTPTR_MAX.
7682 (EMACS_INTPTR, EMACS_UINTPTR): New macros.
7683 In the rest of the code, change types of integers that hold casted
7684 pointers to EMACS_INTPTR and EMACS_UINTPTR, systematically
7685 replacing EMACS_INT, long, EMACS_UINT, and unsigned long.
7686 (XTYPE): Don't cast arg to EMACS_UINT; normally is not needed.
7687 (XSET): Cast type of XTYPE arg to EMACS_INTPTR; it is needed here.
7688 No need to cast type when ORing.
7689 (XPNTR): Return a value of type EMACS_INTPTR or EMACS_UINTPTR.
7690 * alloc.c (lisp_align_malloc): Remove a no-longer-needed cast.
7691 * doc.c (store_function_docstring): Use EMACS_INTPTR, so as not to
7692 assume EMACS_INT is the same width as char *.
7693 * gtkutil.c (xg_gtk_scroll_destroy, xg_tool_bar_button_cb):
7694 (xg_tool_bar_callback, xg_tool_bar_help_callback, xg_make_tool_item):
7695 Remove no-longer-needed casts.
7696 (xg_create_scroll_bar, xg_tool_bar_button_cb, xg_tool_bar_callback):
7697 (xg_tool_bar_help_callback, xg_make_tool_item):
7698 Use EMACS_INTPTR to hold an integer
7699 that will be cast to void *; this can avoid a GCC warning
7700 if EMACS_INT is not the same width as void *.
7701 * menu.c (find_and_call_menu_selection): Remove no-longer-needed cast.
7702 * xdisp.c (display_echo_area_1, resize_mini_window_1):
7703 (current_message_1, set_message_1):
7704 Use a local to convert to proper width without a cast.
7705 * xmenu.c (dialog_selection_callback): Likewise.
7707 * sysdep.c (get_random): Don't assume EMACS_INT is no wider than long.
7708 Also, don't assume VALBITS / RAND_BITS is less than 5,
7709 and don't rely on undefined behavior when shifting a 1 left into
7711 * lisp.h (get_random): Change signature to match.
7713 * lread.c (hash_string): Use size_t, not int, for hash computation.
7714 Normally we prefer signed values; but hashing is special, because
7715 it's better to use unsigned division on hash table sizes so that
7716 the remainder is nonnegative. Also, size_t is the natural width
7717 for hashing into memory. The previous code used 'int', which doesn't
7718 retain enough info to hash well into very large tables.
7719 (oblookup, oblookup_last_bucket_number, Funintern): Likewise.
7721 * dbusbind.c: Don't possibly lose pointer info when converting.
7722 (xd_remove_watch, Fdbus_init_bus, xd_read_queued_messages):
7723 Use XPNTR rather than XHASH, so that the high-order bits of
7724 the pointer aren't lost when converting through void *.
7726 * eval.c (Fautoload): Don't double-shift a pointer.
7728 * fns.c (Frandom): Let EMACS_UINT be wider than unsigned long.
7730 2011-05-06 Juanma Barranquero <lekktu@gmail.com>
7732 * gnutls.c (DEF_GNUTLS_FN):
7733 * image.c (DEF_IMGLIB_FN): Make function pointers static.
7735 2011-05-05 Andreas Schwab <schwab@linux-m68k.org>
7737 * lread.c (lisp_file_lexically_bound_p): Stop scanning at end
7740 2011-05-05 Eli Zaretskii <eliz@gnu.org>
7742 * w32heap.c (allocate_heap) [USE_LISP_UNION_TYPE || USE_LSB_TAG]:
7743 New version that can reserve upto 2GB of heap space.
7745 2011-05-05 Chong Yidong <cyd@stupidchicken.com>
7747 * nsfns.m (Fns_read_file_name): Doc fix (Bug#8534).
7749 2011-05-05 Teodor Zlatanov <tzz@lifelogs.com>
7751 * gnutls.c (fn_gnutls_certificate_set_x509_key_file): Add alias to
7752 `gnutls_certificate_set_x509_key_file'.
7754 2011-05-05 Juanma Barranquero <lekktu@gmail.com>
7756 * makefile.w32-in ($(BLD)/image.$(O), $(BLD)/process.$(O)):
7757 Update dependencies.
7759 2011-05-04 Juanma Barranquero <lekktu@gmail.com>
7761 * gnutls.h (emacs_gnutls_write, emacs_gnutls_read):
7762 * gnutls.c (emacs_gnutls_write, emacs_gnutls_read):
7763 Remove unused parameter `fildes'.
7764 * process.c (read_process_output, send_process): Don't pass it.
7766 2011-05-04 Juanma Barranquero <lekktu@gmail.com>
7768 Fix previous change: the library cache is defined in w32.c.
7769 * image.c (CACHE_IMAGE_TYPE) [!HAVE_NTGUI]: Define to noop.
7770 (Finit_image_library): Wrap Vlibrary_cache on "#ifdef HAVE_NTGUI".
7772 2011-05-04 Juanma Barranquero <lekktu@gmail.com>
7774 Implement dynamic loading of GnuTLS on Windows.
7776 * gnutls.h (GNUTLS_EMACS_ERROR_NOT_LOADED): New macro.
7777 (emacs_gnutls_write, emacs_gnutls_read): Mark as extern.
7778 (emacs_gnutls_record_check_pending, emacs_gnutls_transport_set_errno):
7781 * gnutls.c (Qgnutls_dll): Define.
7782 (DEF_GNUTLS_FN, LOAD_GNUTLS_FN): New macros.
7783 (gnutls_*): Declare function pointers.
7784 (init_gnutls_functions): New function to initialize function pointers.
7785 (emacs_gnutls_handshake, Fgnutls_error_string, Fgnutls_deinit)
7786 (emacs_gnutls_global_init, Fgnutls_bye): Use function pointers.
7787 (emacs_gnutls_record_check_pending, emacs_gnutls_transport_set_errno):
7788 Wrappers for gnutls_record_check_pending and gnutls_transport_set_errno.
7789 (emacs_gnutls_write, emacs_gnutls_read)
7790 (emacs_gnutls_handle_error, Fgnutls_error_fatalp)
7791 (Fgnutls_available_p): New function.
7792 (Fgnutls_boot): Call Fgnutls_available_p. Use function pointers.
7793 (syms_of_gnutls) <Qgnutls_dll>: Initialize and staticpro it.
7794 (syms_of_gnutls) <Sgnutls_available_p>: defsubr it.
7796 * image.c: Include w32.h.
7797 (Vimage_type_cache): Delete.
7798 (syms_of_image) <Vimage_type_cache>: Don't initialize and staticpro it.
7799 (CACHE_IMAGE_TYPE, Finit_image_library): Use Vlibrary_cache instead.
7800 (w32_delayed_load): Move to w32.c.
7802 * w32.h (VlibraryCache, QCloaded_from, w32_delayed_load): Declare.
7804 * w32.c (QCloaded_from, Vlibrary_cache): Define.
7805 (w32_delayed_load): Move from image.c. When loading a library, record
7806 its filename in the :loaded-from property of the library id.
7807 (globals_of_w32) <QCloaded_from, Vlibrary_cache>:
7808 Initialize and staticpro them.
7809 (emacs_gnutls_pull, emacs_gnutls_push): Call emacs_gnutls_* functions.
7811 * process.c: Include lisp.h before w32.h, not after.
7812 (wait_reading_process_output): Call emacs_gnutls_record_check_pending
7813 instead of gnutls_record_check_pending.
7815 * callproc.c, emacs.c: Include lisp.h before w32.h, not after.
7817 2011-05-04 Teodor Zlatanov <tzz@lifelogs.com>
7819 * gnutls.c (Fgnutls_boot): Support :keylist and :crlfiles options
7820 instead of :keyfiles. Give GnuTLS the keylist and the CRL lists
7823 2011-05-03 Jan Djärv <jan.h.d@swipnet.se>
7825 * xterm.c (x_set_frame_alpha): Do not set property on anything
7826 else than FRAME_X_OUTER_WINDOW (Bug#8608).
7828 2011-05-02 Juanma Barranquero <lekktu@gmail.com>
7830 * sysdep.c (get_tty_size) [WINDOWSNT]: Implement. (Bug#8596)
7832 2011-05-02 Juanma Barranquero <lekktu@gmail.com>
7834 * gnutls.c (Qgnutls_log_level, Qgnutls_code, Qgnutls_anon)
7835 (Qgnutls_x509pki, Qgnutls_e_interrupted, Qgnutls_e_again)
7836 (Qgnutls_e_invalid_session, Qgnutls_e_not_ready_for_handshake)
7837 (gnutls_global_initialized, Qgnutls_bootprop_priority)
7838 (Qgnutls_bootprop_trustfiles, Qgnutls_bootprop_keyfiles)
7839 (Qgnutls_bootprop_callbacks, Qgnutls_bootprop_loglevel)
7840 (Qgnutls_bootprop_hostname, Qgnutls_bootprop_verify_flags)
7841 (Qgnutls_bootprop_verify_error, Qgnutls_bootprop_verify_hostname_error)
7842 (Qgnutls_bootprop_callbacks_verify): Make static.
7844 2011-05-01 Andreas Schwab <schwab@linux-m68k.org>
7846 * callproc.c: Indentation fixup.
7848 * sysdep.c (wait_for_termination_1): Make static.
7849 (wait_for_termination, interruptible_wait_for_termination):
7850 Move after wait_for_termination_1.
7852 2011-05-01 Lars Magne Ingebrigtsen <larsi@gnus.org>
7854 * sysdep.c (interruptible_wait_for_termination): New function
7855 which is like wait_for_termination, but allows keyboard
7858 * callproc.c (Fcall_process): Add (:file "file") as an option for
7860 (Fcall_process_region): Ditto.
7862 2011-04-30 Eli Zaretskii <eliz@gnu.org>
7864 * dosfns.c (Fint86, Fdos_memget, Fdos_memput): Use `ASIZE (FOO)'
7865 rather than `XVECTOR (FOO)->size'.
7867 * process.c: Remove HAVE_INTTYPES_H condition from inclusion of
7868 inttypes.h, as a gnulib replacement is used if it not available in
7871 2011-04-21 Eli Zaretskii <eliz@gnu.org>
7873 Lift the MOST_POSITIVE_FIXNUM/4 limitation on visited files.
7874 * fileio.c (Finsert_file_contents): Don't limit file size to 1/4
7875 of MOST_POSITIVE_FIXNUM. (Bug#8528)
7877 * coding.c (coding_alloc_by_realloc): Error out if destination
7878 will grow beyond MOST_POSITIVE_FIXNUM.
7879 (decode_coding_emacs_mule): Abort if there isn't enough place in
7880 charbuf for the composition carryover bytes. Reserve an extra
7881 space for up to 2 characters produced in a loop.
7882 (decode_coding_iso_2022): Abort if there isn't enough place in
7883 charbuf for the composition carryover bytes.
7885 2011-04-21 Eli Zaretskii <eliz@gnu.org>
7887 * doprnt.c (doprnt) [!HAVE_LONG_LONG_INT]: Error out instead of
7888 aborting when %lld or %lll format is passed.
7889 [!HAVE_UNSIGNED_LONG_LONG_INT]: Error out instead of aborting when
7890 %llo or %llx format is passed. (Bug#8545)
7892 * window.c (window_scroll_line_based): Use a marker instead of
7893 simple variables to record original value of point. (Bug#7952)
7895 * doprnt.c (doprnt): Fix the case where a multibyte sequence
7896 produced by %s or %c overflows available buffer space. (Bug#8545)
7898 2011-04-28 Paul Eggert <eggert@cs.ucla.edu>
7900 * doprnt.c (doprnt): Omit useless test; int overflow check (Bug#8545).
7901 (SIZE_MAX): Move defn after all includes, as they might #define it.
7903 2011-04-28 Juanma Barranquero <lekktu@gmail.com>
7905 * w32.c (init_environment): Warn about defaulting HOME to C:\.
7907 2011-04-28 Juanma Barranquero <lekktu@gmail.com>
7909 * keyboard.c (Qdelayed_warnings_hook): Define.
7910 (command_loop_1): Run `delayed-warnings-hook'
7911 if Vdelayed_warnings_list is non-nil.
7912 (syms_of_keyboard) <delayed-warnings-hook>: DEFSYM it.
7913 (syms_of_keyboard) <delayed-warnings-list>: DEFVAR_LISP it.
7915 2011-04-28 Eli Zaretskii <eliz@gnu.org>
7917 * doprnt.c (doprnt): Don't return value smaller than the buffer
7918 size if the message was truncated. (Bug#8545).
7920 2011-04-28 Juanma Barranquero <lekktu@gmail.com>
7922 * w32fns.c (Fx_change_window_property, Fx_delete_window_property)
7923 (Fx_window_property): #if-0 the whole functions, not just the bodies.
7925 2011-04-27 Paul Eggert <eggert@cs.ucla.edu>
7927 * doprnt.c (doprnt): Support "ll" length modifier, for long long.
7929 2011-04-27 Juanma Barranquero <lekktu@gmail.com>
7931 * makefile.w32-in: Update dependencies.
7933 2011-04-27 Eli Zaretskii <eliz@gnu.org>
7935 Improve `doprnt' and its usage. (Bug#8545)
7936 * doprnt.c (doprnt): Make sure `format' is never accessed beyond
7937 `format_end'. Remove support for %l as a conversion specifier.
7938 Don't use xrealloc. Improve diagnostics when the %l size modifier
7939 is used. Update the commentary.
7941 * eval.c (verror): Simplify calculation of size_t.
7943 * coding.c (Ffind_operation_coding_system): Fix diagnostic error
7946 2011-04-27 Yoshiaki Kasahara <kasahara@nc.kyushu-u.ac.jp> (tiny change)
7948 * buffer.c (init_buffer) [USE_MMAP_FOR_BUFFERS]: Adjust to aliasing
7951 2011-04-27 Paul Eggert <eggert@cs.ucla.edu>
7953 * nsmenu.m: Replace all uses of XVECTOR with ASIZE and AREF.
7954 This makes this file independent of the recent pseudovector change.
7956 2011-04-26 Paul Eggert <eggert@cs.ucla.edu>
7958 * keyboard.c (handle_user_signal): Fix pointer signedness problem.
7960 * gnutls.c (emacs_gnutls_handle_error): Remove unused local.
7961 (Fgnutls_boot): gnutls_certificate_verify_peers2 wants unsigned *.
7962 Remove unused local.
7963 (emacs_gnutls_write): Don't use uninitialized rtnval if nbyte <= 0.
7965 * lisp.h: Fix a problem with aliasing and vector headers. (Bug#8546)
7966 GCC 4.6.0 optimizes based on type-based alias analysis.
7967 For example, if b is of type struct buffer * and v of type struct
7968 Lisp_Vector *, then gcc -O2 was incorrectly assuming that &b->size
7969 != &v->size, and therefore "v->size = 1; b->size = 2; return
7970 v->size;" must therefore return 1. This assumption is incorrect
7971 for Emacs, since it type-puns struct Lisp_Vector * with many other
7972 types. To fix this problem, this patch adds a new type struct
7973 vectorlike_header that documents the constraints on layout of vectors
7974 and pseudovectors, and helps optimizing compilers not get fooled
7975 by Emacs's type punning. It also adds the macros XSETTYPED_PVECTYPE
7976 XSETTYPED_PSEUDOVECTOR, TYPED_PSEUDOVECTORP, for similar reasons.
7977 * lisp.h (XSETTYPED_PVECTYPE): New macro, specifying the name of
7979 (XSETPVECTYPE): Rewrite in terms of new macro.
7980 (XSETPVECTYPESIZE): New macro, specifying both type and size.
7981 This is a bit clearer, and further avoids the possibility of
7982 undesirable aliasing.
7983 (XSETTYPED_PSEUDOVECTOR): New macro, specifying the size.
7984 (XSETPSEUDOVECTOR): Rewrite in terms of XSETTYPED_PSEUDOVECTOR.
7985 (XSETSUBR): Rewrite in terms of XSETTYPED_PSEUDOVECTOR and XSIZE,
7986 since Lisp_Subr is a special case (no "next" field).
7987 (ASIZE): Now uses header.size rather than size.
7988 All previous uses of XVECTOR (foo)->size replaced to use this macro,
7989 to avoid the hassle of writing XVECTOR (foo)->header.size.
7990 (struct vectorlike_header): New type.
7991 (TYPED_PSEUDOVECTORP): New macro, also specifying the C type of the
7992 object, to help avoid aliasing.
7993 (PSEUDOVECTORP): Rewrite in terms of TYPED_PSEUDOVECTORP.
7994 (SUBRP): Likewise, since Lisp_Subr is a special case.
7995 * lisp.h (struct Lisp_Vector, struct Lisp_Char_Table):
7996 (struct Lisp_Sub_Char_Table, struct Lisp_Bool_Vector):
7997 (struct Lisp_Hash_Table): Combine first two members into a single
7998 struct vectorlike_header member. All uses of "size" and "next" members
7999 changed to be "header.size" and "header.next".
8000 * buffer.h (struct buffer): Likewise.
8001 * font.h (struct font_spec, struct font_entity, struct font): Likewise.
8002 * frame.h (struct frame): Likewise.
8003 * process.h (struct Lisp_Process): Likewise.
8004 * termhooks.h (struct terminal): Likewise.
8005 * window.c (struct save_window_data, struct saved_window): Likewise.
8006 * window.h (struct window): Likewise.
8007 * alloc.c (allocate_buffer, Fmake_bool_vector, allocate_pseudovector):
8008 Use XSETPVECTYPESIZE, not XSETPVECTYPE, to avoid aliasing problems.
8009 * buffer.c (init_buffer_once): Likewise.
8010 * lread.c (defsubr): Use XSETTYPED_PVECTYPE, since Lisp_Subr is a
8012 * process.c (Fformat_network_address): Use local var for size,
8015 * bytecode.c (exec_byte_code): Don't use XVECTOR before CHECK_VECTOR.
8017 Make the Lisp reader and string-to-float more consistent (Bug#8525)
8018 * data.c (atof): Remove decl; no longer used or needed.
8019 (digit_to_number): Move to lread.c.
8020 (Fstring_to_number): Use new string_to_number function, to be
8021 consistent with how the Lisp reader treats infinities and NaNs.
8022 Do not assume that floating-point numbers represent EMACS_INT
8023 without losing information; this is not true on most 64-bit hosts.
8024 Avoid double-rounding errors, by insisting on integers when
8025 parsing non-base-10 numbers, as the documentation specifies.
8026 * lisp.h (string_to_number): New decl, replacing ...
8027 (isfloat_string): Remove.
8028 * lread.c: Include <inttypes.h>, for uintmax_t and strtoumax.
8029 (read1): Do not accept +. and -. as integers; this
8030 appears to have been a coding error. Similarly, do not accept
8031 strings like +-1e0 as floating point numbers. Do not report
8032 overflow for integer overflows unless the base is not 10 which
8033 means we have no simple and reliable way to continue.
8034 Break out the floating-point parsing into a new
8035 function string_to_number, so that Fstring_to_number parses
8036 floating point numbers consistently with the Lisp reader.
8037 (digit_to_number): Move here from data.c. Make it static inline.
8038 (E_CHAR, EXP_INT): Remove, replacing with ...
8039 (E_EXP): New macro, to solve the "1.0e+" problem mentioned below.
8040 (string_to_number): New function, replacing isfloat_string.
8041 This function checks for valid syntax and produces the resulting
8042 Lisp float number too. Rework it so that string-to-number
8043 no longer mishandles examples like "1.0e+". Use strtoumax,
8044 so that overflow for non-base-10 numbers is reported only when
8045 there's no portable and simple way to convert to floating point.
8047 * textprop.c (set_text_properties_1): Rewrite for clarity,
8048 and to avoid GCC warning about integer overflow.
8050 * intervals.h (struct interval): Use EMACS_INT for members
8051 where EMACS_UINT might cause problems. See
8052 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00514.html>.
8053 (CHECK_TOTAL_LENGTH): Remove cast to EMACS_INT; no longer needed.
8054 * intervals.c (interval_deletion_adjustment): Now returns EMACS_INT.
8056 (offset_intervals): Tell GCC not to worry about length overflow
8057 when negating a negative length.
8059 * alloc.c (overrun_check_malloc, overrun_check_realloc): Now static.
8060 (overrun_check_free): Likewise.
8062 * alloc.c (SDATA_SIZE) [!GC_CHECK_STRING_BYTES]: Avoid runtime check
8063 in the common case where SDATA_DATA_OFFSET is a multiple of Emacs
8066 * gnutls.c: Fix problems found by GCC 4.6.0 on Ubuntu 10.10.
8067 (gnutls_make_error): Rename local to avoid shadowing.
8068 (gnutls_emacs_global_deinit): ifdef out; not used.
8069 (Fgnutls_boot): Use const for pointer to readonly storage.
8070 Comment out unused local. Fix pointer signedness problems.
8072 * lread.c (openp): Don't stuff size_t into an 'int'.
8073 Use <= on length, not < on length + 1, to avoid GCC 4.6.0 warning
8074 about possible signed overflow.
8076 * gtkutil.c: Fix problems found by GCC 4.6.0 on Ubuntu 10.10.
8077 (GDK_KEY_g): Don't define if already defined.
8078 (xg_prepare_tooltip): Avoid pointer signedness problem.
8079 (xg_set_toolkit_scroll_bar_thumb): Redo to avoid two casts.
8081 * process.c (Fnetwork_interface_info): Avoid left-shift undefined
8082 behavior with 1 << 31. GCC 4.6.0 warns about this on 32-bit hosts.
8084 * xfns.c (Fx_window_property): Simplify a bit,
8085 to make a bit faster and to avoid GCC 4.6.0 warning.
8086 * xselect.c (x_get_window_property, x_handle_dnd_message): Likewise.
8088 * fns.c (internal_equal): Don't assume size_t fits in int.
8090 * alloc.c (compact_small_strings): Tighten assertion a little.
8092 Replace pEd with more-general pI, and fix some printf arg casts.
8093 * lisp.h (pI): New macro, generalizing old pEd macro to other
8094 conversion specifiers. For example, use "...%"pI"d..." rather
8095 than "...%"pEd"...".
8096 (pEd): Remove. All uses replaced with similar uses of pI.
8097 * m/amdx86-64.h, m/ia64.h, m/ibms390x.h: Likewise.
8098 * alloc.c (check_pure_size): Don't overflow by converting size to int.
8099 * bidi.c (bidi_dump_cached_states): Use pI to avoid cast.
8100 * data.c (Fnumber_to_string): Use pI instead of if-then-else-abort.
8101 * dbusbind.c (xd_append_arg): Use pI to avoid cast.
8102 (Fdbus_method_return_internal, Fdbus_method_error_internal): Likewise.
8103 * font.c (font_unparse_xlfd): Avoid potential buffer overrun on
8105 (font_unparse_xlfd, font_unparse_fcname): Use pI to avoid casts.
8106 * keyboard.c (record_char, modify_event_symbol): Use pI to avoid casts.
8107 * print.c (safe_debug_print, print_object): Likewise.
8108 (print_object): Don't overflow by converting EMACS_INT or EMACS_UINT
8110 Use pI instead of if-then-else-abort. Use %p to avoid casts,
8111 avoiding the 0 flag, which is not portable.
8112 * process.c (Fmake_network_process): Use pI to avoid cast.
8113 * region-cache.c (pp_cache): Likewise.
8114 * xdisp.c (decode_mode_spec): Likewise.
8115 * xrdb.c (x_load_resources) [USE_MOTIF]: Use pI to avoid undefined
8116 behavior on 64-bit hosts with printf arg.
8117 * xselect.c (x_queue_event): Use %p to avoid casts, avoiding 0 flag.
8118 (x_stop_queuing_selection_requests): Likewise.
8119 (x_get_window_property): Don't truncate byte count to an 'int'
8122 * frame.c (frame_name_fnn_p): Get rid of strtol, which isn't right
8123 here, since it parses constructs like leading '-' and spaces,
8124 which are not wanted; and it overflows with large numbers.
8125 Instead, simply match F[0-9]+, which is what is wanted anyway.
8127 * alloc.c: Remove unportable assumptions about struct layout.
8128 (SDATA_SELECTOR, SDATA_DATA_OFFSET): New macros.
8129 (SDATA_OF_STRING, SDATA_SIZE, allocate_string_data):
8130 (allocate_vectorlike, make_pure_vector): Use the new macros,
8131 plus offsetof, to remove unportable assumptions about struct layout.
8132 These assumptions hold on all porting targets that I know of, but
8133 they are not guaranteed, they're easy to remove, and removing them
8134 makes further changes easier.
8136 * alloc.c (BLOCK BYTES): Fix typo by changing "ablock" to "ablocks".
8137 This doesn't fix a bug but makes the code clearer.
8138 (string_overrun_cookie): Now const. Use initializers that
8139 don't formally overflow signed char, to avoid warnings.
8140 (allocate_string_data) [GC_CHECK_STRING_OVERRUN]: Fix typo that
8141 can cause Emacs to crash when string overrun checking is enabled.
8142 (allocate_buffer): Don't assume sizeof (struct buffer) is a
8143 multiple of sizeof (EMACS_INT); it need not be, if
8144 alignof(EMACS_INT) < sizeof (EMACS_INT).
8145 (check_sblock, check_string_bytes, check_string_free_list): Protoize.
8147 2011-04-26 Juanma Barranquero <lekktu@gmail.com>
8149 * keyboard.c (QCrtl): Rename from Qrtl. All uses changed.
8151 2011-04-26 Teodor Zlatanov <tzz@lifelogs.com>
8153 * gnutls.c (emacs_gnutls_handshake): Return an error if we're not
8154 supposed to be handshaking. (Bug#8556)
8155 Reported by Paul Eggert <eggert@cs.ucla.edu>.
8157 2011-04-26 Daniel Colascione <dan.colascione@gmail.com>
8159 * lisp.h (Qdebug): List symbol.
8160 * eval.c (Qdebug): Restore global linkage.
8161 * keyboard.c (debug-on-event): New variable.
8162 (handle_user_signal): Break into debugger when debug-on-event
8163 matches the current signal symbol.
8165 2011-04-25 Dan Nicolaescu <dann@ics.uci.edu>
8167 * alloc.c (check_sblock, check_string_bytes)
8168 (check_string_free_list): Convert to standard C.
8170 2011-04-25 Teodor Zlatanov <tzz@lifelogs.com>
8172 * w32.c (emacs_gnutls_push): Fix typo.
8174 2011-04-25 Eli Zaretskii <eliz@gnu.org>
8176 * gnutls.c (emacs_gnutls_handshake): Avoid compiler warnings about
8177 "cast to pointer from integer of different size".
8179 Improve doprnt and its use in verror. (Bug#8545)
8180 * doprnt.c (doprnt): Document the set of format control sequences
8181 supported by the function. Use SAFE_ALLOCA instead of always
8184 * eval.c (verror): Don't limit the buffer size at size_max-1, that
8185 is one byte too soon. Don't use xrealloc; instead xfree and
8188 2011-04-24 Teodor Zlatanov <tzz@lifelogs.com>
8190 * gnutls.h: Add GNUTLS_STAGE_CALLBACKS enum to denote we're in the
8193 * gnutls.c: Renamed global_initialized to
8194 gnutls_global_initialized. Added internals for the
8195 :verify-hostname-error, :verify-error, and :verify-flags
8196 parameters of `gnutls-boot' and documented those parameters in the
8197 docstring. Start callback support.
8198 (emacs_gnutls_handshake): Add Woe32 support. Retry handshake
8199 unless a fatal error occurred. Call gnutls_alert_send_appropriate
8200 on error. Return error code.
8201 (emacs_gnutls_write): Call emacs_gnutls_handle_error.
8202 (emacs_gnutls_read): Likewise.
8203 (Fgnutls_boot): Return handshake error code.
8204 (emacs_gnutls_handle_error): New function.
8205 (wsaerror_to_errno): Likewise.
8207 * w32.h (emacs_gnutls_pull): Add prototype.
8208 (emacs_gnutls_push): Likewise.
8210 * w32.c (emacs_gnutls_pull): New function for GnuTLS on Woe32.
8211 (emacs_gnutls_push): Likewise.
8213 2011-04-24 Claudio Bley <claudio.bley@gmail.com> (tiny change)
8215 * process.c (wait_reading_process_output): Check if GnuTLS
8216 buffered some data internally if no FDs are set for TLS
8219 * makefile.w32-in (OBJ2): Add gnutls.$(O).
8220 (LIBS): Link to USER_LIBS.
8221 ($(BLD)/gnutls.$(0)): New target.
8223 2011-04-24 Eli Zaretskii <eliz@gnu.org>
8225 * xdisp.c (handle_single_display_spec): Rename the
8226 display_replaced_before_p argument into display_replaced_p, to
8227 make it consistent with the commentary. Fix typos in the
8230 * textprop.c (syms_of_textprop): Remove dead code.
8231 (copy_text_properties): Delete obsolete commentary about an
8232 interface that was deleted long ago. Fix typos in the description
8235 * msdos.c (XMenuActivate, XMenuAddSelection): Adjust argument list
8236 to changes in oldXMenu/XMenu.h from 2011-04-16.
8237 <menu_help_message, prev_menu_help_message>: Constify.
8238 (IT_menu_make_room): menu->help_text is now `const char **';
8241 * msdos.h (XMenuActivate, XMenuAddSelection): Adjust prototypes
8242 to changes in oldXMenu/XMenu.h from 2011-04-16.
8243 (struct XMenu): Declare `help_text' `const char **'.
8245 * xfaces.c <Qunspecified>: Make extern again.
8247 * syntax.c: Include sys/types.h before including regex.h, as
8250 * doc.c (get_doc_string): Improve the format passed to `error'.
8252 * doprnt.c (doprnt): Improve commentary.
8254 * term.c (init_tty) [MSDOS]: Fix 1st argument to maybe_fatal.
8256 * Makefile.in (TAGS): Depend on $(M_FILE) and $(S_FILE), and scan
8259 * makefile.w32-in (globals.h): Add a dummy recipe, to make any
8260 changes in globals.h immediately force recompilation.
8261 (TAGS): Depend on $(CURDIR)/m/intel386.h and
8262 $(CURDIR)/s/ms-w32.h.
8263 (TAGS-gmake): Scan $(CURDIR)/m/intel386.h and $(CURDIR)/s/ms-w32.h.
8265 * character.c (Fchar_direction): Function deleted.
8266 (syms_of_character): Don't defsubr it.
8267 <char-direction-table>: Deleted.
8269 2011-04-23 Eli Zaretskii <eliz@gnu.org>
8271 Fix doprnt so it could be used again safely in `verror'. (Bug#8435)
8272 * doprnt.c: Include limits.h.
8273 (SIZE_MAX): New macro.
8274 (doprnt): Return a size_t value. 2nd arg is now size_t.
8275 Many local variables are now size_t instead of int or unsigned.
8276 Improve overflow protection. Support `l' modifier for integer
8277 conversions. Support %l conversion. Don't assume an EMACS_INT
8278 argument for integer conversions and for %c.
8280 * lisp.h (doprnt): Restore prototype.
8282 * makefile.w32-in ($(BLD)/callint.$(O)): Depend on
8285 * Makefile.in (base_obj): Add back doprnt.o.
8287 * deps.mk (doprnt.o): Add back prerequisites.
8288 (callint.o): Depend on character.h.
8290 * eval.c (internal_lisp_condition_case): Include the handler
8291 representation in the error message.
8292 (verror): Call doprnt instead of vsnprintf. Fix an off-by-one bug
8293 when breaking from the loop.
8295 * xdisp.c (vmessage): Call doprnt instead of vsnprintf.
8297 * callint.c (Fcall_interactively): When displaying error message
8298 about invalid control letter, pass the character's codepoint, not
8299 a pointer to its multibyte form. Improve display of the character
8300 in octal and display also its hex code.
8302 * character.c (char_string): Use %x to display the (unsigned)
8303 codepoint of an invalid character, to avoid displaying a bogus
8306 * font.c (check_otf_features): Pass SDATA of SYMBOL_NAME to
8307 `error', not SYMBOL_NAME itself.
8309 * coding.c (Fencode_sjis_char, Fencode_big5_char): Use %c for
8310 character arguments to `error'.
8312 * charset.c (check_iso_charset_parameter): Fix incorrect argument
8313 to `error' in error message about FINAL_CHAR argument. Make sure
8314 FINAL_CHAR is a character, and use %c when it is passed as
8315 argument to `error'.
8317 2011-04-23 Eli Zaretskii <eliz@gnu.org>
8319 * s/ms-w32.h (localtime): Redirect to sys_localtime.
8321 * w32.c: Include <time.h>.
8322 (sys_localtime): New function.
8324 2011-04-23 Chong Yidong <cyd@stupidchicken.com>
8326 * xdisp.c (init_xdisp): Initialize echo_area_window (Bug#6451).
8328 * buffer.c (syms_of_buffer): Doc fix (Bug#6902).
8330 2011-04-23 Samuel Thibault <sthibault@debian.org> (tiny change)
8332 * sysdep.c (wait_for_termination): On GNU Hurd, kill returns -1 on
8335 2011-04-19 Eli Zaretskii <eliz@gnu.org>
8337 * syntax.h (SETUP_SYNTAX_TABLE_FOR_OBJECT): Fix setting of
8338 gl_state.e_property when gl_state.object is Qt.
8340 * insdel.c (make_gap_larger): Remove limitation of buffer size
8343 2011-04-18 Chong Yidong <cyd@stupidchicken.com>
8345 * xdisp.c (lookup_glyphless_char_display)
8346 (produce_glyphless_glyph): Handle cons cell entry in
8347 glyphless-char-display.
8348 (Vglyphless_char_display): Document it.
8350 * term.c (produce_glyphless_glyph): Handle cons cell entry in
8351 glyphless-char-display.
8353 2011-04-17 Chong Yidong <cyd@stupidchicken.com>
8355 * xdisp.c (get_next_display_element): Remove unnecessary ifdefs.
8357 * termhooks.h (FRAME_WINDOW_P): Remove duplicated definitions.
8359 * dispextern.h (FACE_SUITABLE_FOR_ASCII_CHAR_P): Add missing
8360 definition for no-X builds.
8362 2011-04-16 Paul Eggert <eggert@cs.ucla.edu>
8364 Static checks with GCC 4.6.0 and non-default toolkits.
8366 * s/sol2-6.h, s/unixware.h (PTY_TTY_NAME_SPRINTF): Protoize decl.
8368 * process.c (keyboard_bit_set): Define only if SIGIO.
8369 (send_process_trap): Mark it with NO_RETURN if it doesn't return.
8370 (send_process): Repair possible setjmp clobbering.
8372 * s/usg5-4-common.h (SETUP_SLAVE_PTY): Don't pass extra arg to 'fatal'.
8374 * eval.c: Include <stdio.h>, for vsnprintf on non-GNU/Linux hosts.
8376 * data.c (arith_error): Mark with NO_RETURN if it doesn't return.
8378 * alloc.c (bytes_used_when_full, SPARE_MEMORY, BYTES_USED):
8379 Define only if needed.
8381 * sysdep.c (_FILE_OFFSET_BITS): Make this hack even uglier
8382 by pacifying GCC about it. Maybe it's time to retire it?
8383 * xfaces.c (USG, __TIMEVAL__): Likewise.
8385 * dispextern.h (struct redisplay_interface): Rename param
8387 * termhooks.h (struct terminal): Likewise.
8388 * xterm.c (xembed_send_message): Likewise.
8390 * insdel.c (make_gap_smaller): Define only if
8391 USE_MMAP_FOR_BUFFERS || REL_ALLOC || DOUG_LEA_MALLOC.
8393 * keyboard.c (read_char): Make a var volatile so longjmp won't clobber
8396 * emacs.c (MAX_HEAP_BSS_DIFF, my_edata): Move to where they're used,
8397 so that we aren't warned about unused symbols.
8399 * xfns.c (Fx_file_dialog): Rename local to avoid shadowing.
8401 * xdisp.c (x_produce_glyphs): Mark var as initialized (Bug#8512).
8403 * xfns.c (x_real_positions): Mark locals as initialized.
8405 * xmenu.c (xmenu_show): Don't use uninitialized vars.
8407 * xterm.c: Fix problems found by static analysis with other toolkits.
8408 (toolkit_scroll_bar_interaction): Define and use only if USE_X_TOOLKIT.
8409 (x_dispatch_event): Declare static if USE_GTK, and
8410 define if USE_GTK || USE_X_TOOLKIT.
8411 (SET_SAVED_BUTTON_EVENT): Define only if USE_X_TOOLKIT || USE_GTK.
8412 * xterm.h (x_dispatch_event): Extern only if USE_X_TOOLKIT.
8413 * xterm.c, xterm.h (x_mouse_leave): Bring this function back, but only
8414 if defined HAVE_MENUS && !defined USE_X_TOOLKIT && !defined USE_GTK.
8416 * xmenu.c (menu_help_callback): Pointer type fixes.
8417 Use const pointers when pointing at readonly data. Avoid pointer
8419 (FALSE): Remove unused macro.
8420 (update_frame_menubar): Remove unused decl.
8422 * xfns.c (Fx_hide_tip): Move locals to avoid shadowing.
8424 * menu.c (push_submenu_start, push_submenu_end): Do not define unless
8425 USE_X_TOOLKIT || USE_GTK || HAVE_NS || defined HAVE_NTGUI.
8426 (single_menu_item): Rename local to avoid shadowing.
8428 * keyboard.c (make_lispy_event): Remove unused local var.
8430 * frame.c, frame.h (x_get_resource_string): Bring this back, but
8431 only if HAVE_X_WINDOWS && !USE_X_TOOLKIT.
8433 * bitmaps: Change bitmaps from unsigned char back to the X11
8434 compatible char. Avoid the old compiler warnings about
8435 out-of-range initializers by using, for example, '\xab' rather
8438 * xgselect.c (xgselect_initialize): Check vs interface
8439 even if ! (defined (USE_GTK) || defined (HAVE_GCONF)).
8441 * xmenu.c (xmenu_show): Rename parm to avoid shadowing.
8443 * xterm.c (x_create_toolkit_scroll_bar): Use const * for pointers
8444 to read-only memory.
8446 * fns.c (vector): Remove; this old hack is no longer needed.
8448 * xsmfns.c (create_client_leader_window): Rename shadowing arg.
8450 (gdk_x11_set_sm_client_id) [!USE_GTK]: Don't define.
8452 * xrdb.c (x_load_resources): Omit unused local.
8454 * xfns.c (free_frame_menubar, atof): Remove duplicate decls.
8455 (x_window): Rename locals to avoid shadowing.
8456 (USG): Use the kludged USG macro, to pacify gcc.
8458 * xterm.c (x_alloc_nearest_color_for_widget): Remove; unused.
8459 (x_term_init): Remove local to avoid shadowing.
8461 * xfns.c, xterm.c (_XEditResCheckMessages): Protoize decl.
8463 * xdisp.c, dispextern.h (set_vertical_scroll_bar): Now extern if
8464 USE_TOOLKIT_SCROLL_BARS && !USE_GTK, as xterm.c needs it then.
8466 2011-04-16 Eli Zaretskii <eliz@gnu.org>
8468 * gnutls.c (Fgnutls_boot): Don't pass Lisp_Object to `error'.
8470 Fix regex.c, syntax.c and friends for buffers > 2GB.
8471 * syntax.h (struct gl_state_s): Declare character position members
8474 * syntax.c (update_syntax_table): Declare 2nd argument EMACS_INT.
8476 * textprop.c (verify_interval_modification, interval_of):
8477 Declare arguments EMACS_INT.
8479 * intervals.c (adjust_intervals_for_insertion): Declare arguments
8482 * intervals.h (CHECK_TOTAL_LENGTH): Cast to EMACS_INT, not `int'.
8484 * indent.c (Fvertical_motion): Local variable it_start is now
8487 * regex.c (re_match, re_match_2, re_match_2_internal)
8488 (bcmp_translate, regcomp, regexec, print_double_string)
8489 (group_in_compile_stack, re_search, re_search_2, regex_compile)
8490 (re_compile_pattern, re_exec): Declare arguments and local
8491 variables `size_t' and `ssize_t' and return values `regoff_t', as
8493 (POP_FAILURE_REG_OR_COUNT) <pfreg>: Declare `long'.
8494 (CHECK_INFINITE_LOOP) <failure>: Declare `ssize_t'.
8495 <compile_stack_type>: `size' and `avail' are now `size_t'.
8497 * regex.h <regoff_t>: Use ssize_t, not int.
8498 (re_search, re_search_2, re_match, re_match_2): Arguments that
8499 specify buffer/string position and length are now ssize_t and
8500 size_t. Return type is regoff_t.
8502 2011-04-16 Ben Key <bkey76@gmail.com>
8504 * nsfont.m: Fixed bugs in ns_get_family and
8505 ns_descriptor_to_entity that were caused by using free to
8506 deallocate memory blocks that were allocated by xmalloc (via
8507 xstrdup). This caused Emacs to crash when compiled with
8508 XMALLOC_OVERRUN_CHECK defined (when Emacs was configured with
8509 --enable-checking=xmallocoverrun). xfree is now used to
8510 deallocate these memory blocks.
8512 2011-04-15 Paul Eggert <eggert@cs.ucla.edu>
8514 * sysdep.c (emacs_read): Remove unnecessary check vs MAX_RW_COUNT.
8516 emacs_write: Accept and return EMACS_INT for sizes.
8517 See http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00514.html
8519 * gnutls.c, gnutls.h (emacs_gnutls_read, emacs_gnutls_write):
8520 Accept and return EMACS_INT.
8521 (emacs_gnutls_write): Return the number of bytes written on
8523 * sysdep.c, lisp.h (emacs_read, emacs_write): Likewise.
8524 (emacs_read, emacs_write): Remove check for negative size, as the
8525 Emacs source code has been audited now.
8526 * sysdep.c (MAX_RW_COUNT): New macro, to work around kernel bugs.
8527 (emacs_read, emacs_write): Use it.
8528 * process.c (send_process): Adjust to the new signatures of
8529 emacs_write and emacs_gnutls_write. Do not attempt to store
8530 a byte offset into an 'int'; it might overflow.
8531 See http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00483.html
8533 * sound.c: Don't assume sizes fit in 'int'.
8534 (struct sound_device.period_size, alsa_period_size):
8535 Return EMACS_INT, not int.
8536 (struct sound_device.write, vox_write, alsa_write):
8537 Accept EMACS_INT, not int.
8538 (wav_play, au_play): Use EMACS_INT to store sizes and to
8539 record read return values.
8541 2011-04-15 Ben Key <bkey76@gmail.com>
8543 * keyboard.c (Qundefined): Don't declare static since it is used
8545 * xfaces.c (Qbold, Qexpanded, Qitalic, Qcondensed): Don't declare
8546 static since they are used in nsfont.m.
8548 2011-04-15 Stefan Monnier <monnier@iro.umontreal.ca>
8550 * process.c (Qprocessp): Don't declare static.
8551 * lisp.h (Qprocessp): Declare again.
8553 2011-04-15 Juanma Barranquero <lekktu@gmail.com>
8555 * font.c (Qopentype): Don't make static (used from w32uniscribe.c).
8557 2011-04-14 Paul Eggert <eggert@cs.ucla.edu>
8559 Improve C-level modularity by making more things 'static'.
8561 Don't publish debugger-only interfaces to other modules.
8562 * lisp.h (safe_debug_print, debug_output_compilation_hack):
8563 (verify_bytepos, count_markers): Move decls to the only modules
8565 * region-cache.h (pp_cache): Likewise.
8566 * window.h (check_all_windows): Likewise.
8567 * marker.c, print.c, region-cache.c, window.c: Decls moved here.
8569 * sysdep.c (croak): Now static, if
8570 defined TIOCNOTTY || defined USG5 || defined CYGWIN.
8571 * syssignal.h (croak): Declare only if not static.
8573 * alloc.c (refill_memory_reserve): Now static if
8574 !defined REL_ALLOC || defined SYSTEM_MALLOC.
8575 * lisp.h (refill_memory_reserve): Declare only if not static.
8577 * xsettings.c, xsettings.h (xsettings_get_system_normal_font):
8578 Define only if USE_LUCID.
8580 * xrdb.c (x_customization_string, x_rm_string): Now static.
8582 * xmenu.c (x_menu_wait_for_event): Export only if USE_MOTIF.
8583 * xterm.h (x_menu_wait_for_event): Declare only if USE_MOTIF.
8585 * xdisp.c (draw_row_with_mouse_face): Now static.
8586 * dispextern.h (draw_row_with_mouse_fave): Remove decl.
8588 * window.h (check_all_windows): Mark externally visible.
8590 * window.c (window_deletion_count): Now static.
8592 * undo.c: Make symbols static if they're not exported.
8593 (last_undo_buffer, last_boundary_position, pending_boundary):
8596 * textprop.c (interval_insert_behind_hooks): Now static.
8597 (interval_insert_in_front_hooks): Likewise.
8599 * term.c: Make symbols static if they're not exported.
8600 (tty_turn_off_highlight, get_tty_terminal, max_frame_cols):
8601 (max_frame_lines, tty_set_terminal_modes):
8602 (tty_reset_terminal_modes, tty_turn_off_highlight):
8603 (get_tty_terminal): Now static.
8604 (term_mouse_moveto): Do not define if HAVE_WINDOW_SYSTEM.
8605 * termhooks.h (term_mouse_moveto): Do not declare if
8607 * dispextern.h (tty_set_terminal_modes, tty_reset_terminal_modes):
8608 (tty_turn_off_highlight, get_tty_terminal): Remove decls.
8610 * sysdep.c: Make symbols static if they're not exported.
8611 (emacs_get_tty, emacs_set_tty, old_fcntl_flags, old_fcntl_owner):
8613 (sigprocmask_set, full_mask): Remove; unused.
8614 (wait_debugging): Mark as visible.
8615 * syssignal.h (SIGFULLMASK, full_mask): Remove decls.
8616 * systty.h (emacs_get_tty, emacs_set_tty): Remove decls.
8618 * syntax.c (syntax_temp): Define only if !__GNUC__.
8620 * sound.c (current_sound_device, current_sound): Now static.
8622 * search.c (searchbufs, searchbuf_head): Now static.
8624 * scroll.c (scroll_cost): Remove; unused.
8625 * dispextern.h (scroll_cost): Remove decl.
8627 * region-cache.h (pp_cache): Mark as externally visible.
8629 * process.c: Make symbols static if they're not exported.
8630 (process_tick, update_tick, create_process, chan_process):
8631 (Vprocess_alist, proc_buffered_char, datagram_access):
8632 (fd_callback_data, send_process_frame, process_sent_to): Now static.
8633 (deactivate_process): Mark defn as static, as well as decl.
8634 * lisp.h (create_process): Remove decl.
8635 * process.h (chan_process, Vprocess_alist): Remove decls.
8637 * print.c: Make symbols static if they're not exported.
8638 (print_depth, new_backquote_output, being_printed, print_buffer):
8639 (print_buffer_size, print_buffer_pos, print_buffer_pos_byte):
8640 (print_interval, print_number_index, initial_stderr_stream):
8642 * lisp.h (Fprinc): Remove decl.
8643 (debug_output_compilation_hack): Mark as externally visible.
8645 * sysdep.c (croak): Move decl from here to syssignal.h.
8646 * syssignal.h (croak): Put it here, so the API can be checked when
8647 'croak' is called from dissociate_if_controlling_tty.
8649 * minibuf.c: Make symbols static if they're not exported.
8650 (minibuf_save_list, choose_minibuf_frame): Now static.
8651 * lisp.h (choose_minibuf_frame): Remove decl.
8653 * lisp.h (verify_bytepos, count_markers): Mark as externally visible.
8655 * lread.c: Make symbols static if they're not exported.
8656 (read_objects, initial_obarray, oblookup_last_bucket_number):
8658 (make_symbol): Remove; unused.
8659 * lisp.h (initial_obarray, make_symbol): Remove decls.
8661 * keyboard.c: Make symbols static if they're not exported.
8662 (single_kboard, recent_keys_index, total_keys, recent_keys):
8663 (this_command_key_count_reset, raw_keybuf, raw_keybuf_count):
8664 (this_single_command_key_start, echoing, last_auto_save):
8665 (read_key_sequence_cmd, dribble, recursive_edit_unwind):
8666 (command_loop, echo_now, keyboard_init_hook, help_char_p):
8667 (quit_throw_to_read_char, command_loop_2, top_level_1, poll_timer):
8668 (Vlispy_mouse_stem, double_click_count):
8670 (force_auto_save_soon): Define only if SIGDANGER.
8671 (ignore_mouse_drag_p): Now static if
8672 !defined HAVE_WINDOW_SYSTEM || defined USE_GTK || defined HAVE_NS.
8673 (print_help): Remove; unused.
8674 (stop_character, last_timer_event): Mark as externally visible.
8675 * keyboard.h (ignore_mouse_drag_p): Declare only if
8676 defined HAVE_WINDOW_SYSTEM && !defined USE_GTK && !defined HAVE_NS.
8677 (echo_now, help_char_p, quit_throw_to_read_char): Remove decls.
8678 * lisp.h (echoing): Remove decl.
8679 (force_auto_save_soon): Declare only if SIGDANGER.
8680 * xdisp.c (redisplay_window): Simplify code, to make it more
8681 obvious that ignore_mouse_drag_p is not accessed if !defined
8682 USE_GTK && !defined HAVE_NS.
8684 * intervals.c: Make symbols static if they're not exported.
8685 (merge_properties_sticky, merge_interval_right, delete_interval):
8687 * intervals.h (merge_interval_right, delete_interval): Remove decls.
8689 * insdel.c: Make symbols static if they're not exported.
8690 However, leave prepare_to_modify_buffer alone. It's never
8691 called from outside this function, but that appears to be a bug.
8692 (combine_after_change_list, combine_after_change_buffer):
8693 (adjust_after_replace, signal_before_change): Now static.
8694 (adjust_after_replace_noundo): Remove; unused.
8695 * lisp.h (adjust_after_replace, adjust_after_replace_noundo):
8696 (signal_before_change): Remove decls.
8698 * indent.c (val_compute_motion, val_vmotion): Now static.
8700 * image.c: Make symbols static if they're not exported.
8701 * dispextern.h (x_create_bitmap_from_xpm_data): Do not declare
8703 * image.c (x_create_bitmap_from_xpm_data): Do not define if USE_GTK.
8704 (xpm_color_cache, ct_table, ct_colors_allocated): Now static.
8706 * fringe.c (standard_bitmaps): Now static.
8707 (max_used_fringe_bitmap): Now static, unless HAVE_NS.
8709 * frame.c: Make symbols static if they're not exported.
8710 (x_report_frame_params, make_terminal_frame): Now static.
8711 (get_frame_param): Now static, unless HAVE_NS.
8712 (x_fullscreen_adjust): Define if WINDOWSNT, not if HAVE_WINDOW_SYSTEM.
8713 (x_get_resource_string): Remove; not used.
8714 * frame.h (make_terminal_frame, x_report_frame_params):
8715 (x_get_resource_string); Remove decls.
8716 (x_fullscreen_adjust): Declare only if WINDOWSNT.
8717 * lisp.h (get_frame_param): Declare only if HAVE_NS.
8719 * font.c, fontset.c: Make symbols static if they're not exported.
8720 * dispextern.h (FACE_SUITABLE_FOR_ASCII_CHAR_P): New macro.
8721 (FACE_SUITABLE_FOR_CHAR_P): Use it.
8722 * font.c (font_close_object): Now static.
8723 * font.h (font_close_object): Remove.
8724 * fontset.c (FONTSET_OBJLIST): Remove.
8725 (free_realized_fontset) #if-0 the body, which does nothing.
8726 (face_suitable_for_char_p): #if-0, as it's never called.
8727 * fontset.h (face_suitable_for_char_p): Remove decl.
8728 * xfaces.c (face_at_string_position):
8729 Use FACE_SUITABLE_FOR_ASCII_CHAR_P, not FACE_SUITABLE_FOR_CHAR_P,
8730 since 0 is always ASCII.
8732 * fns.c (weak_hash_tables): Now static.
8734 * fileio.c: Make symbols static if they're not exported.
8735 (auto_saving, auto_save_mode_bits, auto_save_error_occurred):
8736 (Vwrite_region_annotation_buffers): Now static.
8738 * eval.c: Make symbols static if they're not exported.
8739 (backtrace_list, lisp_eval_depth, when_entered_debugger): Now static.
8740 * lisp.h (backtrace_list): Remove decl.
8742 * emacs.c: Make symbols static if they're not exported.
8743 (malloc_state_ptr, malloc_using_checking, syms_of_emacs):
8744 (fatal_error_code, fatal_error_signal_hook, standard_args):
8746 (fatal_error_signal): Now static, unless FLOAT_CATCH_SIGKILL.
8747 (DEFINE_DUMMY_FUNCTION): Mark function as externally visible.
8748 (__CTOR_LIST__, __DTOR_LIST__): Now externally visible.
8749 * lisp.h (fatal_error_signal_hook): Remove decl.
8750 (fatal_error_signal): Declare only if FLOAT_CATCH_SIGKILL.
8752 * editfns.c: Move a (normally-unused) function to its only use.
8753 * editfns.c, lisp.h (get_operating_system_release): Remove.
8754 * process.c (init_process) [DARWIN_OS]: Do it inline, as it is not
8755 worth the hassle of breaking this out.
8757 * xterm.c: Make symbols static if they're not exported.
8758 (x_raise_frame, x_lower_frame, x_wm_set_window_state):
8759 (x_wm_set_icon_pixmap, x_initialize, XTread_socket_fake_io_error):
8760 (x_destroy_window, x_delete_display):
8762 (x_dispatch_event): Now static if ! (USE_MOTIF || USE_X_TOOLKIT).
8763 (x_mouse_leave): Remove; unused.
8764 * xterm.h (x_display_info_for_name, x_raise_frame, x_lower_frame):
8765 (x_destroy_window, x_wm_set_window_state, x_wm_set_icon_pixmap):
8766 (x_delete_display, x_initialize, x_set_border_pixel, x_screen_planes):
8768 (x_mouse_leave): Declare only if WINDOWSNT.
8769 (x_dispatch_event): Declare only if USE_MOTIF or USE_X_TOOLKIT.
8770 (xic_create_fontsetname): Declare only if HAVE_X_WINDOWS &&
8773 * ftxfont.c: Make symbols static if they're not exported.
8774 (ftxfont_driver): Export only if !defined HAVE_XFT && def8ined
8776 * font.h (ftxfont_driver): Likewise.
8778 * xfns.c: Make symbols static if they're not exported.
8779 (x_last_font_name, x_display_info_for_name):
8780 (x_set_foreground_color, x_set_background_color, x_set_mouse_color):
8781 (x_set_cursor_color, x_set_border_pixel, x_set_border_color):
8782 (x_set_cursor_type, x_set_icon_type, x_set_icon_name):
8783 (x_set_scroll_bar_foreground, x_set_scroll_bar_background):
8784 (x_explicitly_set_name, x_set_title, xic_defaut_fontset, tip_timer):
8785 (last_show_tip_args): Now static.
8786 (xic_defaut_fontset, xic_create_fontsetname): Define only if
8787 defined HAVE_X_WINDOWS && defined USE_X_TOOLKIT
8788 (x_screen_planes): Remove; unused.
8789 * dispextern.h (x_screen_planes): Remove decl.
8791 * dispnew.c: Make symbols static if they're not exported.
8792 * dispextern.h (redraw_garbaged_frames, scrolling):
8793 (increment_row_positions): Remove.
8794 * dispnew.c (new_glyph_matrix, increment_row_positions, scrolling):
8795 (delayed_size_change, glyph_matrix_count, glyph_pool_count):
8797 (redraw_garbaged_frames): Remove; unused.
8799 * xfaces.c: Make symbols static if they're not exported.
8800 * dispextern.h (ascii_face_of_lisp_face, free_realized_face):
8802 * xterm.h (defined_color): Remove decls.
8803 (x_free_dpy_colors): Declare only if USE_X_TOOLKIT.
8804 * xfaces.c (tty_suppress_bold_inverse_default_colors_p):
8805 (menu_face_changed_default, defined_color, free_realized_face):
8806 (x_free_dpy_colors): Define only if USE_X_TOOLKIT.
8807 (ascii_face_of_lisp_face): Remove; unused.
8809 * xdisp.c: Make symbols static if they're not exported.
8810 * dispextern.h (scratch_glyph_row, window_box_edges):
8811 (glyph_to_pixel_coords, set_cursor_from_row):
8812 (get_next_display_element, set_iterator_to_next):
8813 (highlight_trailing_whitespace, frame_to_window_pixel_xy):
8814 (show_mouse_face): Remove decls
8815 * frame.h (message_buf_print): Likewise.
8816 * lisp.h (pop_message, set_message, check_point_in_composition):
8818 * xterm.h (set_vertical_scroll_bar): Likewise.
8819 * xdisp.c (list_of_error, Vmessage_stack, line_number_displayed):
8820 (message_buf_print, scratch_glyph_row, displayed_buffer):
8821 (set_iterator_to_next, pop_message, set_message, set_cursor_from_row):
8822 (get_next_display_element, show_mouse_face, window_box_edges):
8823 (frame_to_window_pixel_xy, check_point_in_composition):
8824 (set_vertical_scroll_bar, highlight_trailing_whitespace): Now static.
8825 (glyph_to_pixel_coords): Remove; unused.
8827 * dired.c (file_name_completion): Now static.
8829 * dbusbind.c (xd_in_read_queued_messages): Now static.
8831 * lisp.h (circular_list_error, FOREACH): Remove; unused.
8832 * data.c (circular_list_error): Remove.
8834 * commands.h (last_point_position, last_point_position_buffer):
8835 (last_point_position_window): Remove decls.
8836 * keyboard.c: Make these variables static.
8838 * coding.h (coding, code_convert_region, encode_coding_gap):
8840 * coding.c (Vsjis_coding_system, Vbig5_coding_system):
8841 (iso_code_class, detect_coding, code_convert_region): Now static.
8842 (encode_coding_gap): Remove; unused.
8844 * chartab.c (chartab_chars, chartab_bits): Now static.
8846 * charset.h (charset_iso_8859_1): Remove decl.
8847 * charset.c (charset_iso_8859_1, charset_emacs, map_charset_for_dump):
8850 * ccl.h (check_ccl_update, Vccl_program_table): Remove decls.
8851 * ccl.c (Vccl_program_table): Now static.
8852 (check_ccl_update): Remove; unused.
8854 * category.c (SET_CATEGORY_SET, set_category_set): Move here.
8855 * category.h: ... from here.
8856 * category.c (check_category_table, set_category_set): Now static.
8858 * casetab.c (Vascii_upcase_table, Vascii_eqv_table): Now static.
8859 * lisp.h: Remove these decls.
8861 * buffer.c (buffer_count): Remove unused var.
8863 * bidi.c (bidi_dump_cached_states): Mark as externally visible,
8864 so that it's not optimized away.
8865 (bidi_ignore_explicit_marks_for_paragraph_level): Likewise.
8866 * dispextern.h (bidi_dump_cached_states): Remove, since it's
8867 exported only to the debugger.
8869 * atimer.c (alarm_signal_handler, run_all_atimers): Now static.
8870 * atimer.h (run_all_atimers): Remove; not exported.
8872 font.c: Make copy_font_spec and merge_font_spec ordinary C functions.
8873 * font.c (copy_font_spec): Rename from Fcopy_font_spec, since it
8874 was inaccessible from Lisp.
8875 (merge_font_spec): Likewise, renaming from Fmerge_font_spec.
8876 * font.c, font.h, fontset.c, xfaces.c, xfont.c: Change all uses.
8878 alloc.c: Import and export fewer symbols, and remove unused items.
8879 * lisp.h (suppress_checking, die): Declare only if ENABLE_CHECKING
8881 (suppress_checking): Add EXTERNALLY_VISIBLE attribute, so that
8882 it's not optimized away by whole-program optimization.
8883 (message_enable_multibyte, free_misc): Remove.
8884 (catchlist, handlerlist, mark_backtrace):
8885 Declare only if BYTE_MARK_STACK.
8886 (mark_byte_stack): Likewise, fixing a ifdef-vs-if typo.
8887 * alloc.c (pure): Export only if VIRT_ADDR_VARIES is defined.
8888 (message_enable_multibyte): Remove decl.
8889 (free_misc, interval_free_list, float_block, float_block_index):
8890 (n_float_blocks, float_free_list, cons_block, cons_block_index):
8891 (cons_free_list, last_marked_index):
8893 (suppress_checking, die): Define only if ENABLE_CHECKING is defined.
8894 * eval.c (catchlist, handlerlist): Export only if BYTE_MARK_STACK.
8895 (mark_backtrace): Define only if BYTE_MARK_STACK.
8896 * xdisp.c (message_enable_multibyte): Now static.
8898 Declare Lisp_Object Q* variables to be 'static' if not exported.
8899 This makes it easier for human readers (and static analyzers)
8900 to see whether these variables are used from other modules.
8901 * alloc.c, buffer.c, bytecode.c, callint.c, casetab.c, category.c:
8902 * ccl.c, character.c, charset.c, cmds.c, coding.c, composite.c:
8903 * data.c, dbusbind.c, dired.c, editfns.c, eval.c, fileio.c, fns.c:
8904 * font.c, frame.c, fringe.c, ftfont.c, image.c, keyboard.c, keymap.c:
8905 * lread.c, macros.c, minibuf.c, print.c, process.c, search.c:
8906 * sound.c, syntax.c, textprop.c, window.c, xdisp.c, xfaces.c, xfns.c:
8907 * xmenu.c, xselect.c:
8908 Declare Q* vars static if they are not used in other modules.
8909 * ccl.h, character.h, charset.h, coding.h, composite.h, font.h:
8910 * frame.h, intervals.h, keyboard.h, lisp.h, process.h, syntax.h:
8911 Remove decls of unexported vars.
8912 * keyboard.h (EVENT_HEAD_UNMODIFIED): Remove now-unused macro.
8914 * lisp.h (DEFINE_FUNC): Make sname 'static'.
8916 Make Emacs functions such as Fatom 'static' by default.
8917 This makes it easier for human readers (and static analyzers)
8918 to see whether these functions can be called from other modules.
8919 DEFUN now defines a static function. To make the function external
8920 so that it can be used in other C modules, use the new macro DEFUE.
8921 * lisp.h (Funibyte_char_to_multibyte, Fsyntax_table_p):
8922 (Finit_image_library):
8923 (Feval_region, Fbacktrace, Ffetch_bytecode, Fswitch_to_buffer):
8924 (Ffile_executable_p, Fmake_symbolic_link, Fcommand_execute):
8925 (Fget_process, Fdocumentation_property, Fbyte_code, Ffile_attributes):
8926 Remove decls, since these functions are now static.
8927 (Funintern, Fget_internal_run_time): New decls, since these functions
8928 were already external.
8930 * alloc.c, buffer.c, callint.c, callproc.c, casefiddle.c, casetab.c:
8931 * ccl.c, character.c, chartab.c, cmds.c, coding.c, data.c, dispnew.c:
8932 * doc.c, editfns.c, emacs.c, eval.c, fileio.c, filelock.c, floatfns.c:
8933 * fns.c, font.c, fontset.c, frame.c, image.c, indent.c:
8934 * keyboard.c, keymap.c, lread.c:
8935 * macros.c, marker.c, menu.c, minibuf.c, print.c, process.c, search.c:
8936 * syntax.c, term.c, terminal.c, textprop.c, undo.c:
8937 * window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xsettings.c:
8938 Mark functions with DEFUE instead of DEFUN,
8939 if they are used in other modules.
8940 * buffer.c (Fset_buffer_major_mode, Fdelete_overlay): New forward
8941 decls for now-static functions.
8942 * buffer.h (Fdelete_overlay): Remove decl.
8943 * callproc.c (Fgetenv_internal): Mark as internal.
8944 * composite.c (Fremove_list_of_text_properties): Remove decl.
8945 (Fcomposition_get_gstring): New forward static decl.
8946 * composite.h (Fcomposite_get_gstring): Remove decl.
8947 * dired.c (Ffile_attributes): New forward static decl.
8948 * doc.c (Fdocumntation_property): New forward static decl.
8949 * eval.c (Ffetch_bytecode): New forward static decl.
8950 (Funintern): Remove extern decl; now in .h file where it belongs.
8951 * fileio.c (Fmake_symbolic_link): New forward static decl.
8952 * image.c (Finit_image_library): New forward static decl.
8953 * insdel.c (Fcombine_after_change_execute): Make forward decl static.
8954 * intervals.h (Fprevious_property_change):
8955 (Fremove_list_of_text_properties): Remove decls.
8956 * keyboard.c (Fthis_command_keys): Remove decl.
8957 (Fcommand_execute): New forward static decl.
8958 * keymap.c (Flookup_key): New forward static decl.
8959 (Fcopy_keymap): Now static.
8960 * keymap.h (Flookup_key): Remove decl.
8961 * process.c (Fget_process): New forward static decl.
8962 (Fprocess_datagram_address): Mark as internal.
8963 * syntax.c (Fsyntax_table_p): New forward static decl.
8964 (skip_chars): Remove duplicate decl.
8965 * textprop.c (Fprevious_property_change): New forward static decl.
8966 * window.c (Fset_window_fringes, Fset_window_scroll_bars):
8968 (Fset_window_margins, Fset_window_vscroll): New forward static decls.
8969 * window.h (Fset_window_vscroll, Fset_window_margins): Remove decls.
8971 * editfns.c (Fformat): Remove unreachable code.
8973 2011-04-14 Andreas Schwab <schwab@linux-m68k.org>
8975 * fileio.c (Finsert_file_contents): Fix typo in 2005-05-13
8978 2011-04-13 Eli Zaretskii <eliz@gnu.org>
8980 * xdisp.c (handle_invisible_prop): Don't call bidi_paragraph_init
8981 when at ZV. (Bug#8487)
8983 2011-04-12 Andreas Schwab <schwab@linux-m68k.org>
8985 * charset.c (Fclear_charset_maps): Use xfree instead of free.
8987 * keyboard.c (parse_tool_bar_item): Likewise.
8988 * sound.c (sound_cleanup, alsa_close): Likewise.
8989 * termcap.c (tgetent): Likewise.
8990 * xfns.c (x_default_font_parameter): Likewise.
8991 * xsettings.c (read_and_apply_settings): Likewise.
8993 * alloc.c (overrun_check_malloc, overrun_check_realloc)
8994 (overrun_check_free): Protoize.
8996 2011-04-12 Paul Eggert <eggert@cs.ucla.edu>
8998 * sysdep.c (emacs_read, emacs_write): Check for negative sizes
8999 since callers should never pass a negative size.
9000 Change the signature to match that of plain 'read' and 'write'; see
9001 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00397.html>.
9002 * lisp.h: Update prototypes of emacs_write and emacs_read.
9004 2011-04-11 Eli Zaretskii <eliz@gnu.org>
9006 * xdisp.c (redisplay_window): Don't try to determine the character
9007 position of the scroll margin if the window start point w->startp
9008 is outside the buffer's accessible region. (Bug#8468)
9010 2011-04-10 Eli Zaretskii <eliz@gnu.org>
9012 Fix write-region and its subroutines for buffers > 2GB.
9013 * fileio.c (a_write, e_write): Modify declaration of arguments and
9014 local variables to support buffers larger than 2GB.
9015 (Fcopy_file): Use EMACS_INT for return value of emacs_read.
9017 * sysdep.c (emacs_write, emacs_read): Use ssize_t for last
9018 argument, local variables, and return value.
9020 * lisp.h: Update prototypes of emacs_write and emacs_read.
9022 * sound.c (vox_write): Use ssize_t for return value of emacs_write.
9024 2011-04-10 Paul Eggert <eggert@cs.ucla.edu>
9026 * xdisp.c (vmessage): Use memchr, not strnlen, which some hosts lack.
9028 Fix more problems found by GCC 4.6.0's static checks.
9030 * xdisp.c (vmessage): Use a better test for character truncation.
9032 * charset.c (load_charset_map): <, not <=, for optimization,
9033 and to avoid potential problems with integer overflow.
9034 * chartab.c (sub_char_table_set_range, char_table_set_range): Likewise.
9035 * casetab.c (set_identity, shuffle): Likewise.
9036 * editfns.c (Fformat): Likewise.
9037 * syntax.c (skip_chars): Likewise.
9039 * xmenu.c (set_frame_menubar): Allocate smaller local vectors.
9040 This also lets GCC 4.6.0 generate slightly better loop code.
9042 * callint.c (Fcall_interactively): <, not <=, for optimization.
9043 (Fcall_interactively): Count the number of arguments produced,
9044 not the number of arguments given. This is simpler and lets GCC
9045 4.6.0 generate slightly better code.
9047 * ftfont.c: Distingish more carefully between FcChar8 and char.
9048 The previous code passed unsigned char * to a functions like
9049 strlen and xstrcasecmp that expect char *, which does not
9050 conform to the C standard.
9051 (get_adstyle_property, ftfont_pattern_entity): Use FcChar8 for
9052 arguments to FcPatternGetString, and explicitly cast FcChar8 * to
9053 char * when the C standard requires it.
9055 * keyboard.c (read_char): Remove unused var.
9057 * eval.c: Port to Windows vsnprintf (Bug#8435).
9059 (SIZE_MAX): Define if the headers do not.
9060 (verror): Do not give up if vsnprintf returns a negative count.
9061 Instead, grow the buffer. This ports to Windows vsnprintf, which
9062 does not conform to C99. Problem reported by Eli Zaretskii.
9063 Also, simplify the allocation scheme, by avoiding the need for
9064 calling realloc, and removing the ALLOCATED variable.
9066 * eval.c (verror): Initial buffer size is 4000 (not 200) bytes.
9068 Remove invocations of doprnt, as Emacs now uses vsnprintf.
9069 But keep the doprint source code for now, as we might revamp it
9070 and use it again (Bug#8435).
9071 * lisp.h (doprnt): Remove.
9072 * Makefile.in (base_obj): Remove doprnt.o.
9073 * deps.mk (doprnt.o): Remove.
9075 error: Print 32- and 64-bit integers portably (Bug#8435).
9076 Without this change, on typical 64-bit hosts error ("...%d...", N)
9077 was used to print both 32- and 64-bit integers N, which relied on
9079 * lisp.h, m/amdx86-64.h, m/ia64.h, m/ibms390x.h (pEd): New macro.
9080 * lisp.h (error, verror): Mark as printf-like functions.
9081 * eval.c (verror): Use vsnprintf, not doprnt, to do the real work.
9082 Report overflow in size calculations when allocating printf buffer.
9083 Do not truncate output string at its first null byte.
9084 * xdisp.c (vmessage): Use vsnprintf, not doprnt, to do the real work.
9085 Truncate the output at a character boundary, since vsnprintf does not
9087 * charset.c (check_iso_charset_parameter): Convert internal
9088 character to string before calling 'error', since %c now has the
9090 * coding.c (Fdecode_sjis_char, Fdecode_big5_char): Avoid int
9091 overflow when computing char to be passed to 'error'. Do not
9092 pass Lisp_Object to 'error'; pass the integer instead.
9093 * nsfns.m (Fns_do_applescript): Use int, not long, since it's
9094 formatted with plain %d.
9096 * eval.c (internal_lisp_condition_case): Don't pass spurious arg.
9098 * keyboard.c (access_keymap_keyremap): Print func name, not garbage.
9100 * coding.c (Fdecode_sjis_char): Don't assume CODE fits in int.
9102 * xterm.c (x_catch_errors): Remove duplicate declaration.
9104 * term.c (maybe_fatal): Mark its 3rd arg as a printf format, too.
9106 * xdisp.c, lisp.h (message_nolog): Remove; unused.
9108 2011-04-10 Jim Meyering <meyering@redhat.com>
9110 use ssize_t and size_t for read- and write-like emacs_gnutls_* functions
9111 * gnutls.c (emacs_gnutls_read): Adjust signature to be more read-like:
9112 return ssize_t not "int", and use size_t as the buffer length.
9113 (emacs_gnutls_write): Likewise, and make the buffer pointer "const".
9114 * gnutls.h: Update declarations.
9115 * process.c (read_process_output): Use ssize_t, to match.
9116 (send_process): Likewise.
9118 2011-04-09 Chong Yidong <cyd@stupidchicken.com>
9120 * image.c (Fimagemagick_types): Doc fix, and comment cleanup.
9122 2011-04-09 Chong Yidong <cyd@stupidchicken.com>
9124 * ftfont.c (get_adstyle_property, ftfont_pattern_entity):
9125 Use unsigned char, to match FcChar8 type definition.
9127 * xterm.c (handle_one_xevent):
9128 * xmenu.c (create_and_show_popup_menu):
9129 * xselect.c (x_decline_selection_request)
9130 (x_reply_selection_request): Avoid type-punned deref of X events.
9132 2011-04-09 Eli Zaretskii <eliz@gnu.org>
9134 Fix some uses of `int' instead of EMACS_INT.
9135 * search.c (string_match_1, fast_string_match)
9136 (fast_c_string_match_ignore_case, fast_string_match_ignore_case)
9137 (scan_buffer, find_next_newline_no_quit)
9138 (find_before_next_newline, search_command, Freplace_match)
9139 (Fmatch_data): Make some `int' variables be EMACS_INT.
9141 * xdisp.c (display_count_lines): 3rd argument and return value now
9142 EMACS_INT. All callers changed.
9143 (pint2hrstr): Last argument is now EMACS_INT.
9145 * coding.c (detect_coding_utf_8, detect_coding_emacs_mule)
9146 (detect_coding_iso_2022, detect_coding_sjis, detect_coding_big5)
9147 (detect_coding_ccl, detect_coding_charset, decode_coding_utf_8)
9148 (decode_coding_utf_16, decode_coding_emacs_mule)
9149 (decode_coding_iso_2022, decode_coding_sjis, decode_coding_big5)
9150 (decode_coding_ccl, decode_coding_charset)
9151 <consumed_chars, consumed_chars_base>: Declare EMACS_INT.
9152 (decode_coding_iso_2022, decode_coding_emacs_mule)
9153 (decode_coding_sjis, decode_coding_big5, decode_coding_charset)
9154 <char_offset, last_offset>: Declare EMACS_INT.
9155 (encode_coding_utf_8, encode_coding_utf_16)
9156 (encode_coding_emacs_mule, encode_invocation_designation)
9157 (encode_designation_at_bol, encode_coding_iso_2022)
9158 (encode_coding_sjis, encode_coding_big5, encode_coding_ccl)
9159 (encode_coding_raw_text, encode_coding_charset) <produced_chars>:
9161 (ASSURE_DESTINATION): Declare more_bytes EMACS_INT.
9162 (encode_invocation_designation): Last argument P_NCHARS is now
9164 (decode_eol): Declare pos_byte, pos, and pos_end EMACS_INT.
9165 (produce_chars): from_nchars and to_nchars are now EMACS_INT.
9167 * coding.h (struct coding_system) <head_ascii>: Declare EMACS_INT.
9170 * ccl.c (Fccl_execute_on_string): Declare some variables
9173 2011-04-08 Samuel Thibault <sthibault@debian.org> (tiny change)
9175 * term.c (init_tty): Fix incorrect ifdef placement (Bug#8450).
9177 2011-03-19 Christoph Scholtes <cschol2112@googlemail.com>
9179 * process.c (Fformat_network_address): Doc fix.
9181 2011-04-08 T.V. Raman <tv.raman.tv@gmail.com> (tiny change)
9183 * xml.c (parse_region): Avoid creating spurious whitespace nodes.
9185 2011-04-08 Chong Yidong <cyd@stupidchicken.com>
9187 * keyboard.c (read_char): Call Lisp function help-form-show,
9188 instead of using internal_with_output_to_temp_buffer.
9189 (Qhelp_form_show): New var.
9190 (syms_of_keyboard): Use DEFSYM macro.
9192 * print.c (internal_with_output_to_temp_buffer): Function deleted.
9194 * lisp.h (internal_with_output_to_temp_buffer): Remove prototype.
9196 2011-04-06 Chong Yidong <cyd@stupidchicken.com>
9198 * process.c (Flist_processes): Remove to Lisp.
9199 (list_processes_1): Delete.
9201 2011-04-06 Eli Zaretskii <eliz@gnu.org>
9203 * msdos.c (careadlinkat, careadlinkatcwd): MS-DOS replacements.
9205 * w32.c (careadlinkat, careadlinkatcwd): New always-fail stubs.
9207 2011-04-06 Paul Eggert <eggert@cs.ucla.edu>
9209 Fix more problems found by GCC 4.6.0's static checks.
9211 * xmenu.c (Fx_popup_dialog): Don't assume string is free of formats.
9213 * menu.c (Fx_popup_menu): Don't assume error_name lacks printf formats.
9215 * lisp.h (message, message_nolog, fatal): Mark as printf-like.
9217 * xdisp.c (vmessage): Mark as a printf-like function.
9219 * term.c (vfatal, maybe_fatal): Mark as printf-like functions.
9221 * sound.c (sound_warning): Don't crash if arg contains a printf format.
9223 * image.c (tiff_error_handler, tiff_warning_handler): Mark as
9224 printf-like functions.
9225 (tiff_load): Add casts to remove these marks before passing them
9226 to system-supplied API.
9228 * eval.c (Fsignal): Remove excess argument to 'fatal'.
9230 * coding.c (EMIT_ONE_BYTE, EMIT_TWO_BYTES): Use unsigned, not int.
9231 This avoids several warnings with gcc -Wstrict-overflow.
9232 (DECODE_COMPOSITION_RULE): If the rule is invalid, goto invalid_code
9233 directly, rather than having caller test rule sign. This avoids
9234 some unnecessary tests.
9235 * composite.h (COMPOSITION_ENCODE_RULE_VALID): New macro.
9236 (COMPOSITION_ENCODE_RULE): Arguments now must be valid. This
9237 affects only one use, in DECODE_COMPOSITION_RULE, which is changed.
9239 * xfont.c (xfont_text_extents): Remove var that was set but not used.
9240 (xfont_open): Avoid unnecessary tests.
9242 * composite.c (composition_gstring_put_cache): Use unsigned integer.
9244 * composite.h, composite.c (composition_gstring_put_cache):
9245 Use EMACS_INT, not int, for length.
9247 * composite.h (COMPOSITION_DECODE_REFS): New macro,
9248 breaking out part of COMPOSITION_DECODE_RULE.
9249 (COMPOSITION_DECODE_RULE): Use it.
9250 * composite.c (get_composition_id): Remove unused local vars,
9251 by using the new macro.
9253 * textprop.c (set_text_properties_1): Change while to do-while,
9254 since the condition is always true at first.
9256 * intervals.c (graft_intervals_into_buffer): Mark var as used.
9257 (interval_deletion_adjustment): Return unsigned value.
9260 * process.c (list_processes_1, create_pty, read_process_output):
9261 (exec_sentinel): Remove vars that were set but not used.
9262 (create_pty): Remove unnecessary "volatile"s.
9263 (Fnetwork_interface_info): Avoid possibility of int overflow.
9264 (read_process_output): Do adaptive read buffering even if carryover.
9265 (read_process_output): Simplify nbytes computation if buffered.
9267 * bytecode.c (exec_byte_code): Rename local to avoid shadowing.
9269 * syntax.c (scan_words): Remove var that was set but not used.
9270 (update_syntax_table): Use unsigned instead of int.
9272 * lread.c (lisp_file_lexically_bound_p): Use ints rather than endptrs.
9273 (lisp_file_lexically_bound_p, read1): Use unsigned instead of int.
9274 (safe_to_load_p): Make the end-of-loop test the inverse of the in-loop.
9276 * print.c (print_error_message): Avoid int overflow.
9278 * font.c (font_list_entities): Redo for clarity,
9279 so that reader need not know FONT_DPI_INDEX + 1 == FONT_SPACING_INDEX.
9281 * font.c (font_find_for_lface, Ffont_get_glyphs): Remove unused vars.
9282 (font_score): Avoid potential overflow in diff calculation.
9284 * fns.c (substring_both): Remove var that is set but not used.
9285 (sxhash): Redo loop for clarity and to avoid wraparound warning.
9287 * eval.c (funcall_lambda): Rename local to avoid shadowing.
9289 * alloc.c (mark_object_loop_halt, mark_object): Use size_t, not int.
9290 Otherwise, GCC 4.6.0 optimizes the loop check away since the check
9291 can always succeed if overflow has undefined behavior.
9293 * search.c (boyer_moore, wordify): Remove vars set but not used.
9294 (wordify): Omit three unnecessary tests.
9296 * indent.c (MULTIBYTE_BYTES_WIDTH): Don't compute wide_column.
9297 All callers changed. This avoids the need for an unused var.
9299 * casefiddle.c (casify_region): Remove var that is set but not used.
9301 * dired.c (file_name_completion): Remove var that is set but not used.
9303 * fileio.c (Finsert_file_contents): Make EOF condition clearer.
9305 * fileio.c (Finsert_file_contents): Avoid signed integer overflow.
9306 (Finsert_file_contents): Remove unnecessary code checking fd.
9308 * minibuf.c (read_minibuf_noninteractive): Use size_t for sizes.
9309 Check for integer overflow on size calculations.
9311 * buffer.c (Fprevious_overlay_change): Remove var that is set
9314 * keyboard.c (menu_bar_items, read_char_minibuf_menu_prompt):
9315 Remove vars that are set but not used.
9316 (timer_check_2): Don't assume timer-list and idle-timer-list are lists.
9317 (timer_check_2): Mark vars as initialized.
9319 * gtkutil.c (xg_get_file_with_chooser): Mark var as initialized.
9321 * image.c (lookup_image): Remove var that is set but not used.
9322 (xbm_load): Use parse_p, for gcc -Werror=unused-but-set-variable.
9324 * fontset.c (Finternal_char_font, Ffontset_info): Remove vars
9325 that are set but not used.
9327 * xfns.c (make_invisible_cursor): Don't return garbage
9328 if XCreateBitmapFromData fails (Bug#8410).
9330 * xselect.c (x_get_local_selection, x_handle_property_notify):
9331 Remove vars that are set but not used.
9333 * xfns.c (x_create_tip_frame): Remove var that is set but not used.
9334 (make_invisible_cursor): Initialize a possibly-uninitialized variable.
9336 * xterm.c (x_scroll_bar_to_input_event) [!USE_GTK]:
9337 Remove var that is set but not used.
9338 (scroll_bar_windows_size): Now size_t, not int.
9339 (x_send_scroll_bar_event): Use size_t, not int, for sizes.
9342 * xfaces.c (realize_named_face): Remove vars that are set but not used.
9343 (map_tty_color) [!defined MSDOS]: Likewise.
9345 * term.c (tty_write_glyphs): Use size_t; this avoids overflow warning.
9347 * coding.c: Remove vars that are set but not used.
9348 (DECODE_COMPOSITION_RULE): Remove 2nd arg, which is unused.
9349 All callers changed.
9350 (decode_coding_utf_8, decode_coding_utf_16 decode_coding_emacs_mule):
9351 (decode_coding_iso_2022, encode_coding_sjis, encode_coding_big5):
9352 (decode_coding_charset): Remove vars that are set but not used.
9354 * bytecode.c (Fbyte_code) [!defined BYTE_CODE_SAFE]: Remove var
9355 that is set but not used.
9357 * print.c (print_object): Remove var that is set but not used.
9359 Replace 2 copies of readlink code with 1 gnulib version (Bug#8401).
9360 The gnulib version avoids calling malloc in the usual case,
9361 and on 64-bit hosts doesn't have some arbitrary 32-bit limits.
9362 * fileio.c (Ffile_symlink_p): Use emacs_readlink.
9363 * filelock.c (current_lock_owner): Likewise.
9364 * lisp.h (READLINK_BUFSIZE, emacs_readlink): New function.
9365 * sysdep.c: Include allocator.h, careadlinkat.h.
9366 (emacs_no_realloc_allocator): New static constant.
9367 (emacs_readlink): New function.
9368 * deps.mk (sysdep.o): Depend on ../lib/allocator.h and on
9369 ../lib/careadlinkat.h.
9371 2011-04-04 Stefan Monnier <monnier@iro.umontreal.ca>
9373 * keyboard.c (safe_run_hook_funcall): Fix last change (don't stop at the
9374 first non-nil return value).
9376 2011-04-03 Jan Djärv <jan.h.d@swipnet.se>
9378 * nsterm.m (ns_update_auto_hide_menu_bar): Define MAC_OS_X_VERSION_10_6
9379 if not defined (Bug#8403).
9381 2011-04-02 Juanma Barranquero <lekktu@gmail.com>
9383 * xdisp.c (display_count_lines): Remove parameter `start',
9384 unused since 1998-01-01T02:27:27Z!rms@gnu.org. All callers changed.
9385 (get_char_face_and_encoding): Remove parameter `multibyte_p',
9386 unused since 2008-05-14T01:40:23Z!handa@m17n.org. All callers changed.
9387 (fill_stretch_glyph_string): Remove parameters `row' and `area',
9388 unused at least since Kim's GUI unification at 2003-03-16T20:45:46Z!storm@cua.dk
9389 and thereabouts. All callers changed.
9390 (get_per_char_metric): Remove parameter `f', unused since
9391 2008-05-14T01:40:23Z!handa@m17n.org. All callers changed.
9393 2011-04-02 Jim Meyering <meyering@redhat.com>
9395 do not dereference NULL upon failed strdup
9396 * nsfont.m (ns_descriptor_to_entity): Use xstrdup, not strdup.
9397 (ns_get_family): Likewise.
9399 2011-04-02 Juanma Barranquero <lekktu@gmail.com>
9401 * eval.c (unwind_to_catch) [DEBUG_GCPRO]: Remove redundant assignment.
9403 2011-04-02 Jan Djärv <jan.h.d@swipnet.se>
9405 * nsterm.m (ns_update_auto_hide_menu_bar): Only for OSX 10.6 or
9408 2011-04-01 Stefan Monnier <monnier@iro.umontreal.ca>
9410 Add lexical binding.
9412 * window.c (Ftemp_output_buffer_show): New fun.
9413 (Fsave_window_excursion):
9414 * print.c (Fwith_output_to_temp_buffer): Move to subr.el.
9416 * lread.c (lisp_file_lexically_bound_p): New function.
9417 (Fload): Bind Qlexical_binding.
9418 (readevalloop): Remove `evalfun' arg.
9419 Bind Qinternal_interpreter_environment.
9420 (Feval_buffer): Bind Qlexical_binding.
9421 (defvar_int, defvar_bool, defvar_lisp_nopro, defvar_kboard):
9423 (syms_of_lread): Declare `lexical-binding'.
9425 * lisp.h (struct Lisp_Symbol): New field `declared_special'.
9427 * keyboard.c (eval_dyn): New fun.
9428 (menu_item_eval_property): Use it.
9430 * image.c (parse_image_spec): Use Ffunctionp.
9432 * fns.c (concat, mapcar1): Accept byte-code-functions.
9434 * eval.c (Fsetq): Handle lexical vars.
9435 (Fdefun, Fdefmacro, Ffunction): Make closures when needed.
9436 (Fdefconst, Fdefvaralias, Fdefvar): Mark as dynamic.
9437 (FletX, Flet): Obey lexical binding.
9438 (Fcommandp): Handle closures.
9439 (Feval): New `lexical' arg.
9440 (eval_sub): New function extracted from Feval. Use it almost
9441 everywhere where Feval was used. Look up vars in lexical env.
9443 (Ffunctionp): Move from subr.el.
9444 (Ffuncall): Handle closures.
9445 (apply_lambda): Remove `eval_flags'.
9446 (funcall_lambda): Handle closures and new byte-code-functions.
9447 (Fspecial_variable_p): New function.
9448 (syms_of_eval): Initialize the Vinternal_interpreter_environment var,
9449 but without exporting it to Lisp.
9451 * doc.c (Fdocumentation, store_function_docstring):
9452 * data.c (Finteractive_form): Handle closures.
9454 * callint.c (Fcall_interactively): Preserve lexical-binding mode for
9457 * bytecode.c (Bstack_ref, Bstack_set, Bstack_set2, BdiscardN):
9459 (exec_byte_code): New function extracted from Fbyte_code to handle new
9460 calling convention for byte-code-functions. Add new byte-codes.
9462 * buffer.c (defvar_per_buffer): Set new `declared_special' field.
9464 * alloc.c (Fmake_symbol): Init new `declared_special' field.
9466 2011-03-31 Juanma Barranquero <lekktu@gmail.com>
9468 * xdisp.c (redisplay_internal): Fix prototype.
9470 2011-03-31 Eli Zaretskii <eliz@gnu.org>
9472 * xdisp.c (SCROLL_LIMIT): New macro.
9473 (try_scrolling): Use it when setting scroll_limit.
9474 Limit scrolling to 100 screen lines.
9475 (redisplay_window): Even when falling back on "recentering",
9476 position point in the window according to scroll-conservatively,
9477 scroll-margin, and scroll-*-aggressively variables. (Bug#6671)
9479 (try_scrolling): When point is above the window, allow searching
9480 as far as scroll_max, or one screenful, to compute vertical
9481 distance from PT to the scroll margin position. This prevents
9482 try_scrolling from unnecessarily failing when
9483 scroll-conservatively is set to a value slightly larger than the
9484 window height. Clean up the case of PT below the margin at bottom
9485 of window: scroll_max can no longer be INT_MAX. When aggressive
9486 scrolling is in use, don't let point enter the opposite scroll
9487 margin as result of the scroll.
9488 (syms_of_xdisp) <scroll-conservatively>: Document the
9489 threshold of 100 lines for never-recentering scrolling.
9491 2011-03-31 Juanma Barranquero <lekktu@gmail.com>
9493 * dispextern.h (move_it_by_lines):
9494 * xdisp.c (move_it_by_lines): Remove parameter `need_y_p', unused
9495 since 2000-12-29T14:24:09Z!gerd@gnu.org. All callers changed.
9496 (message_log_check_duplicate): Remove parameters `prev_bol' and
9497 `this_bol', unused since 1998-01-01T02:27:27Z!rms@gnu.org. All callers changed.
9498 (redisplay_internal): Remove parameter `preserve_echo_area',
9499 unused since 1999-07-21T21:43:52Z!gerd@gnu.org. All callers changed.
9501 * indent.c (Fvertical_motion):
9502 * window.c (window_scroll_pixel_based, Frecenter):
9503 Don't pass `need_y_p' to `move_it_by_lines'.
9505 2011-03-30 Stefan Monnier <monnier@iro.umontreal.ca>
9507 * eval.c (struct backtrace): Don't cheat with negative numbers, but do
9508 steal a few bits to be more compact.
9509 (interactive_p, Fbacktrace, Fbacktrace_frame, mark_backtrace):
9510 Remove unneeded casts.
9512 * bytecode.c (Fbyte_code): CAR and CDR can GC.
9514 2011-03-30 Zachary Kanfer <zkanfer@gmail.com> (tiny change)
9516 * keyboard.c (Fexecute_extended_command): Do log the "suggest key
9517 binding" message (bug#7967).
9519 2011-03-30 Paul Eggert <eggert@cs.ucla.edu>
9521 Fix more problems found by GCC 4.6.0's static checks.
9523 * unexelf.c (unexec) [! (defined _SYSTYPE_SYSV || defined __sgi)]:
9524 Remove unused local var.
9526 * editfns.c (Fmessage_box): Remove unused local var.
9528 * xdisp.c (try_window_reusing_current_matrix, x_produce_glyphs):
9529 (note_mode_line_or_margin_highlight, note_mouse_highlight):
9530 Omit unused local vars.
9531 * window.c (shrink_windows): Omit unused local var.
9532 * menu.c (digest_single_submenu): Omit unused local var.
9533 * dispnew.c (update_window) [PERIODIC_PREEMPTION_CHECKING]:
9534 Omit unused local var.
9536 * keyboard.c (parse_modifiers_uncached, parse_modifiers):
9537 Don't assume string length fits in int.
9538 (keyremap_step, read_key_sequence): Use size_t for sizes.
9539 (read_key_sequence): Don't check last_real_key_start redundantly.
9541 * callproc.c (Fcall_process, Fcall_process_region): Use SAFE_ALLOCA
9542 instead of alloca (Bug#8344).
9544 * eval.c (Fbacktrace): Don't assume nargs fits in int.
9545 (Fbacktrace_frame): Don't assume nframes fits in int.
9547 * syntax.c (scan_sexps_forward): Avoid pointer wraparound.
9549 * xterm.c (x_make_frame_visible, same_x_server): Redo to avoid overflow
9552 * term.c (produce_glyphless_glyph): Remove unnecessary test.
9554 * cm.c (calccost): Turn while-do into do-while, for clarity.
9556 * keyboard.c (syms_of_keyboard): Use the same style as later
9557 in this function when indexing through an array. This also
9558 works around GCC bug 48267.
9560 * image.c (tiff_load): Fix off-by-one image count (Bug#8336).
9562 * xselect.c (x_check_property_data): Return correct size (Bug#8335).
9564 * chartab.c (sub_char_table_ref_and_range): Redo for slight
9565 efficiency gain, and to bypass a gcc -Wstrict-overflow warning.
9567 * keyboard.c, keyboard.h (num_input_events): Now size_t.
9568 This avoids undefined behavior on integer overflow, and is a bit
9569 more convenient anyway since it is compared to a size_t variable.
9571 Variadic C functions now count arguments with size_t, not int.
9572 This avoids an unnecessary limitation on 64-bit machines, which
9573 caused (substring ...) to crash on large vectors (Bug#8344).
9574 * lisp.h (struct Lisp_Subr.function.aMANY): Now takes size_t, not int.
9575 (DEFUN_ARGS_MANY, internal_condition_case_n, safe_call): Likewise.
9576 All variadic functions and their callers changed accordingly.
9577 (struct gcpro.nvars): Now size_t, not int. All uses changed.
9578 * data.c (arith_driver, float_arith_driver): Likewise.
9579 * editfns.c (general_insert_function): Likewise.
9580 * eval.c (struct backtrace.nargs, interactive_p)
9581 (internal_condition_case_n, run_hook_with_args, apply_lambda)
9582 (funcall_lambda, mark_backtrace): Likewise.
9583 * fns.c (concat): Likewise.
9584 * frame.c (x_set_frame_parameters): Likewise.
9585 * fns.c (get_key_arg): Now accepts and returns size_t, and returns
9586 0 if not found, not -1. All callers changed.
9588 * alloc.c (garbage_collect): Don't assume stack size fits in int.
9589 (stack_copy_size): Now size_t, not int.
9590 (stack_copy, stack_copy_size): Define only if MAX_SAVE_STACK > 0.
9592 2011-03-28 Juanma Barranquero <lekktu@gmail.com>
9594 * coding.c (encode_designation_at_bol): Remove parameter `charbuf_end',
9595 unused since 2002-03-01T01:17:24Z!handa@m17n.org and 2008-02-01T16:01:31Z!miles@gnu.org.
9596 All callers changed.
9598 * lisp.h (multibyte_char_to_unibyte):
9599 * character.c (multibyte_char_to_unibyte): Remove parameter `rev_tbl',
9600 unused since 2002-03-01T01:16:34Z!handa@m17n.org and 2008-02-01T16:01:31Z!miles@gnu.org.
9601 * character.h (CHAR_TO_BYTE8):
9602 * cmds.c (internal_self_insert):
9603 * editfns.c (general_insert_function):
9604 * keymap.c (push_key_description):
9605 * search.c (Freplace_match):
9606 * xdisp.c (message_dolog, set_message_1): All callers changed.
9608 2011-03-28 Stefan Monnier <monnier@iro.umontreal.ca>
9610 * keyboard.c (safe_run_hook_funcall): New function.
9611 (safe_run_hooks_1, safe_run_hooks_error, safe_run_hooks): On error,
9612 don't set the hook to nil, but remove the offending function instead.
9613 (Qcommand_hook_internal): Remove, unused.
9614 (syms_of_keyboard): Don't initialize Qcommand_hook_internal nor define
9615 Vcommand_hook_internal.
9617 * eval.c (enum run_hooks_condition): Remove.
9618 (funcall_nil, funcall_not): New functions.
9619 (run_hook_with_args): Call each function through a `funcall' argument.
9620 Remove `cond' argument, now redundant.
9621 (Frun_hooks, Frun_hook_with_args, Frun_hook_with_args_until_success)
9622 (Frun_hook_with_args_until_failure): Adjust accordingly.
9623 (run_hook_wrapped_funcall, Frun_hook_wrapped): New functions.
9625 2011-03-28 Juanma Barranquero <lekktu@gmail.com>
9627 * dispextern.h (string_buffer_position): Remove declaration.
9629 * print.c (strout): Remove parameter `multibyte', unused since
9630 1999-08-21T19:30:21Z!gerd@gnu.org. All callers changed.
9632 * search.c (boyer_moore): Remove parameters `len', `pos' and `lim',
9633 never used since function introduction in 1998-02-08T21:33:56Z!rms@gnu.org.
9634 All callers changed.
9636 * w32.c (_wsa_errlist): Use braces for struct initializers.
9638 * xdisp.c (string_buffer_position_lim): Remove parameter `w',
9639 never used since function introduction in 2001-03-09T18:41:50Z!gerd@gnu.org.
9640 All callers changed.
9641 (string_buffer_position): Likewise. Also, make static (it's never
9642 used outside xdisp.c).
9643 (cursor_row_p): Remove parameter `w', unused since
9644 2000-10-17T16:08:57Z!gerd@gnu.org. All callers changed.
9645 (decode_mode_spec): Remove parameter `precision', introduced during
9646 Gerd Moellmann's rewrite at 1999-07-21T21:43:52Z!gerd@gnu.org, but never used.
9647 All callers changed.
9649 2011-03-27 Jan Djärv <jan.h.d@swipnet.se>
9651 * nsterm.m (syms_of_nsterm): Use doc: for ns-auto-hide-menu-bar.
9653 2011-03-27 Anders Lindgren <andlind@gmail.com>
9655 * nsterm.m (ns_menu_bar_is_hidden): New variable.
9656 (ns_constrain_all_frames, ns_menu_bar_should_be_hidden)
9657 (ns_update_auto_hide_menu_bar): New functions.
9658 (ns_update_begin): Call ns_update_auto_hide_menu_bar.
9659 (applicationDidBecomeActive): Call ns_update_auto_hide_menu_bar and
9660 ns_constrain_all_frames.
9661 (constrainFrameRect): Return at once if ns_menu_bar_should_be_hidden.
9662 (syms_of_nsterm): DEFVAR ns-auto-hide-menu-bar, init to Qnil.
9664 2011-03-27 Jan Djärv <jan.h.d@swipnet.se>
9666 * nsmenu.m (runDialogAt): Remove argument to timer_check.
9668 2011-03-27 Glenn Morris <rgm@gnu.org>
9670 * syssignal.h: Replace RETSIGTYPE with void.
9671 * atimer.c, data.c, dispnew.c, emacs.c, floatfns.c, keyboard.c:
9672 * keyboard.h, lisp.h, process.c, sysdep.c, xterm.c:
9673 Replace SIGTYPE with void everywhere.
9674 * s/usg5-4-common.h (SIGTYPE): Remove definition.
9675 * s/template.h (SIGTYPE): Remove commented out definition.
9677 2011-03-26 Eli Zaretskii <eliz@gnu.org>
9679 * xdisp.c (redisplay_window): Don't check buffer's clip_changed
9680 flag as a prerequisite for invoking try_scrolling. (Bug#6671)
9682 2011-03-26 Juanma Barranquero <lekktu@gmail.com>
9684 * w32.c (read_unc_volume): Use parameter `henum', instead of
9685 global variable `wget_enum_handle'.
9687 * keymap.c (describe_vector): Remove parameters `indices' and
9688 `char_table_depth', unused since 2002-03-01T01:43:26Z!handa@m17n.org.
9689 (describe_map, Fdescribe_vector): Adjust calls to `describe_vector'.
9691 * keyboard.h (timer_check, show_help_echo): Remove unused parameters.
9693 * keyboard.c (timer_check): Remove parameter `do_it_now',
9694 unused since 1996-04-12T06:01:29Z!rms@gnu.org.
9695 (show_help_echo): Remove parameter `ok_to_overwrite_keystroke_echo',
9696 unused since 2008-04-19T19:30:53Z!monnier@iro.umontreal.ca.
9698 * keyboard.c (read_char):
9699 * w32menu.c (w32_menu_display_help):
9700 * xmenu.c (show_help_event, menu_help_callback):
9701 Adjust calls to `show_help_echo'.
9703 * gtkutil.c (xg_maybe_add_timer):
9704 * keyboard.c (readable_events):
9705 * process.c (wait_reading_process_output):
9706 * xmenu.c (x_menu_wait_for_event): Adjust calls to `timer_check'.
9708 * insdel.c (adjust_markers_gap_motion):
9709 Remove; no-op since 1998-01-02T21:29:48Z!rms@gnu.org.
9710 (gap_left, gap_right): Don't call it.
9712 2011-03-25 Chong Yidong <cyd@stupidchicken.com>
9714 * xdisp.c (handle_fontified_prop): Discard changes to clip_changed
9715 incurred during fontification.
9717 2011-03-25 Juanma Barranquero <lekktu@gmail.com>
9719 * buffer.c (defvar_per_buffer): Remove unused parameter `doc'.
9720 (DEFVAR_PER_BUFFER): Don't pass it.
9722 * dispnew.c (row_equal_p, add_row_entry): Remove unused parameter `w'.
9723 (scrolling_window): Don't pass it.
9725 2011-03-25 Juanma Barranquero <lekktu@gmail.com>
9727 * dispextern.h (glyph_matric): Use #if GLYPH_DEBUG, not #ifdef.
9729 * fileio.c (check_executable) [DOS_NT]: Remove unused variables `len'
9731 (Fset_file_selinux_context) [HAVE_LIBSELINUX]: Move here declaration
9732 of variables specific to SELinux and computation of `encoded_absname'.
9734 * image.c (XPutPixel): Remove unused variable `height'.
9736 * keyboard.c (make_lispy_event): Remove unused variable `hpos'.
9738 * unexw32.c (get_section_info): Remove unused variable `section'.
9740 * w32.c (stat): Remove unused variables `drive_root' and `devtype'.
9741 (system_process_attributes): Remove unused variable `sess'.
9742 (sys_read): Remove unused variable `err'.
9744 * w32fns.c (top): Wrap variables with #if GLYPH_DEBUG, not #ifdef.
9745 (w32_wnd_proc): Remove unused variable `isdead'.
9746 (unwind_create_frame): Use #if GLYPH_DEBUG, not #ifdef.
9747 (Fx_server_max_request_size): Remove unused variable `dpyinfo'.
9748 (x_create_tip_frame): Remove unused variable `tem'.
9750 * w32inevt.c (w32_console_read_socket):
9751 Remove unused variable `no_events'.
9753 * w32term.c (x_draw_composite_glyph_string_foreground):
9754 Remove unused variable `width'.
9756 2011-03-24 Juanma Barranquero <lekktu@gmail.com>
9758 * w32term.c (x_set_glyph_string_clipping):
9759 Don't pass uninitialized region to CombineRgn.
9761 2011-03-23 Juanma Barranquero <lekktu@gmail.com>
9763 * w32fns.c (x_set_menu_bar_lines): Remove unused variable `olines'.
9764 (w32_wnd_proc): Pass NULL to Windows API, not uninitialized buffer.
9765 (Fx_close_connection): Remove unused variable `i'.
9767 * w32font.c (w32font_draw): Return number of glyphs.
9768 (w32font_open_internal): Remove unused variable `i'.
9769 (w32font_driver): Add missing initializer.
9771 * w32menu.c (utf8to16): Remove unused variable `utf16'.
9772 (fill_in_menu): Remove unused variable `items_added'.
9774 * w32term.c (last_mouse_press_frame): Remove static global variable.
9775 (w32_clip_to_row): Remove unused variable `f'.
9776 (x_delete_terminal): Remove unused variable `i'.
9778 * w32uniscribe.c (uniscribe_shape): Remove unused variable `nclusters'.
9779 (NOTHING): Remove unused static global variable.
9780 (uniscribe_check_otf): Remove unused variable `table'.
9781 (uniscribe_font_driver): Add missing initializers.
9783 2011-03-23 Julien Danjou <julien@danjou.info>
9785 * term.c (Fsuspend_tty, Fresume_tty):
9786 * minibuf.c (read_minibuf, run_exit_minibuf_hook):
9787 * window.c (temp_output_buffer_show):
9788 * insdel.c (signal_before_change):
9789 * frame.c (Fhandle_switch_frame):
9790 * fileio.c (Fdo_auto_save):
9791 * emacs.c (Fkill_emacs):
9792 * editfns.c (save_excursion_restore):
9793 * cmds.c (internal_self_insert):
9794 * callint.c (Fcall_interactively):
9795 * buffer.c (Fkill_all_local_variables):
9796 * keyboard.c (Fcommand_execute, Fsuspend_emacs, safe_run_hooks_1):
9798 (command_loop_1): Use Frun_hooks. Call safe_run_hooks
9799 unconditionally since it does the check itself.
9801 2011-03-23 Paul Eggert <eggert@cs.ucla.edu>
9803 Fix more problems found by GCC 4.5.2's static checks.
9805 * coding.c (encode_coding_raw_text): Avoid unnecessary test
9806 the first time through the loop, since we know p0 < p1 then.
9807 This also avoids a gcc -Wstrict-overflow warning.
9809 * lisp.h (SAFE_ALLOCA, SAFE_ALLOCA_LISP): Avoid 'int' overflow
9810 leading to a memory leak, possible in functions like
9811 load_charset_map_from_file that can allocate an unbounded number
9812 of objects (Bug#8318).
9814 * xmenu.c (set_frame_menubar): Use EMACS_UINT, not int, for indexes
9815 that could (at least in theory) be that large.
9817 * xdisp.c (message_log_check_duplicate): Return unsigned long, not int.
9818 This is less likely to overflow, and avoids undefined behavior if
9819 overflow does occur. All callers changed. Use strtoul to scan
9820 for the unsigned long integer.
9821 (pint2hrstr): Simplify and tune code slightly.
9822 This also avoids a (bogus) GCC warning with gcc -Wstrict-overflow.
9824 * scroll.c (do_scrolling): Work around GCC bug 48228.
9825 See <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48228>.
9827 * frame.c (Fmodify_frame_parameters): Simplify loop counter.
9828 This also avoids a warning with gcc -Wstrict-overflow.
9829 (validate_x_resource_name): Simplify count usage.
9830 This also avoids a warning with gcc -Wstrict-overflow.
9832 * fileio.c (Fcopy_file): Report error if fchown or fchmod
9835 * emacs.c (Fdaemon_initialized): Do not ignore I/O errors (Bug#8303).
9837 * process.c (Fmake_network_process): Use socklen_t, not int,
9838 where POSIX says socklen_t is required in portable programs.
9839 This fixes a porting bug on hosts like 64-bit HP-UX, where
9840 socklen_t is wider than int (Bug#8277).
9841 (Fmake_network_process, server_accept_connection):
9842 (wait_reading_process_output, read_process_output):
9845 * process.c: Rename or move locals to avoid shadowing.
9846 (list_processes_1, Fmake_network_process):
9847 (read_process_output_error_handler, exec_sentinel_error_handler):
9848 Rename or move locals.
9849 (Fmake_network_process): Define label "retry_connect" only if needed.
9850 (Fnetwork_interface_info): Fix pointer signedness.
9851 (process_send_signal): Add cast to avoid pointer signedness problem.
9852 (FIRST_PROC_DESC, IF_NON_BLOCKING_CONNECT): Remove unused macros.
9853 (create_process): Use 'volatile' to avoid vfork clobbering (Bug#8298).
9855 Make tparam.h and terminfo.c consistent.
9856 * cm.c (tputs, tgoto, BC, UP): Remove extern decls.
9857 Include tparam.h instead, since it declares them.
9858 * cm.h (PC): Remove extern decl; tparam.h now does this.
9859 * deps.mk (cm.o, terminfo.o): Depend on tparam.h.
9860 * terminfo.c: Include tparam.h, to check interfaces.
9861 (tparm): Make 1st arg a const pointer in decl. Put it at top level.
9862 (tparam): Adjust signature to match interface in tparam.h;
9863 this removes some undefined behavior. Check that outstring and len
9864 are zero, which they always are with Emacs.
9865 * tparam.h (PC, BC, UP): New extern decls.
9867 * xftfont.c (xftfont_shape): Now static, and defined only if needed.
9868 (xftfont_open): Rename locals to avoid shadowing.
9870 * ftfont.c (ftfont_resolve_generic_family): Fix pointer signedness.
9871 (ftfont_otf_capability, ftfont_shape): Omit decls if not needed.
9872 (OTF_TAG_SYM): Omit macro if not needed.
9873 (ftfont_list): Remove unused local.
9874 (get_adstyle_property, ftfont_pattern_entity):
9875 (ftfont_lookup_cache, ftfont_open, ftfont_anchor_point):
9876 Rename locals to avoid shadowing.
9878 * xfont.c (xfont_list_family): Mark var as initialized.
9880 * xml.c (make_dom): Now static.
9882 * composite.c (composition_compute_stop_pos): Rename local to
9884 (composition_reseat_it): Remove unused locals.
9885 (find_automatic_composition, composition_adjust_point): Likewise.
9886 (composition_update_it): Mark var as initialized.
9887 (find_automatic_composition): Mark vars as initialized,
9888 with a FIXME (Bug#8290).
9890 character.h: Rename locals to avoid shadowing.
9891 * character.h (PREV_CHAR_BOUNDARY, FETCH_STRING_CHAR_ADVANCE):
9892 (FETCH_STRING_CHAR_AS_MULTIBYTE_ADVANCE, FETCH_CHAR_ADVANCE):
9893 (FETCH_CHAR_ADVANCE_NO_CHECK, INC_POS, DEC_POS, BUF_INC_POS):
9894 (BUF_DEC_POS): Be more systematic about renaming local temporaries
9897 * textprop.c (property_change_between_p): Remove; unused.
9899 * intervals.c (interval_start_pos): Now static.
9901 * intervals.h (CHECK_TOTAL_LENGTH): Avoid empty "else".
9903 * atimer.c (start_atimer, append_atimer_lists, set_alarm):
9904 Rename locals to avoid shadowing.
9906 * sound.c (wav_play, au_play, Fplay_sound_internal):
9907 Fix pointer signedness.
9908 (alsa_choose_format): Remove unused local var.
9909 (wav_play): Initialize a variable to 0, to prevent undefined
9910 behavior (Bug#8278).
9912 * region-cache.c (insert_cache_boundary): Redo var to avoid shadowing.
9914 * region-cache.h (pp_cache): New decl, for gcc -Wmissing-prototypes.
9916 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork
9917 clobbering (Bug#8298).
9918 * sysdep.c (sys_subshell): Likewise.
9919 Previously, the sys_subshell 'volatile' was incorrectly IF_LINTted out.
9921 * lisp.h (child_setup): Now NO_RETURN unless DOS_NT.
9922 This should get cleaned up, so that child_setup has the
9923 same signature on all platforms.
9925 * callproc.c (call_process_cleanup): Now static.
9926 (relocate_fd): Rename locals to avoid shadowing.
9928 2011-03-22 Chong Yidong <cyd@stupidchicken.com>
9930 * xterm.c (x_clear_frame): Remove XClearWindow call. This appears
9931 not to be necessary, and produces flickering.
9933 2011-03-20 Glenn Morris <rgm@gnu.org>
9935 * config.in: Remove file.
9937 2011-03-20 Juanma Barranquero <lekktu@gmail.com>
9939 * minibuf.c (Vcompleting_read_function): Don't declare, global variables
9940 are now in src/globals.h.
9941 (syms_of_minibuf): Remove spurious & from previous change.
9943 2011-03-20 Leo Liu <sdl.web@gmail.com>
9945 * minibuf.c (completing-read-function): New variable.
9946 (completing-read-default): Rename from completing-read.
9947 (completing-read): Call completing-read-function.
9949 2011-03-19 Juanma Barranquero <lekktu@gmail.com>
9951 * xfaces.c (Fx_load_color_file):
9952 Read color file from absolute filename (bug#8250).
9954 2011-03-19 Juanma Barranquero <lekktu@gmail.com>
9956 * makefile.w32-in: Update dependencies.
9958 2011-03-17 Eli Zaretskii <eliz@gnu.org>
9960 * makefile.w32-in ($(BLD)/unexw32.$(O)): Depend on $(SRC)/unexec.h.
9962 2011-03-17 Paul Eggert <eggert@cs.ucla.edu>
9964 Fix more problems found by GCC 4.5.2's static checks.
9966 * process.c (make_serial_process_unwind, send_process_trap):
9967 (sigchld_handler): Now static.
9969 * process.c (allocate_pty): Let PTY_ITERATION declare iteration vars.
9970 That way, the code declares only the vars that it needs.
9971 * s/aix4-2.h (PTY_ITERATION): Declare iteration vars.
9972 * s/cygwin.h (PTY_ITERATION): Likewise.
9973 * s/darwin.h (PTY_ITERATION): Likewise.
9974 * s/gnu-linux.h (PTY_ITERATION): Likewise.
9976 * s/irix6-5.h (PTY_OPEN): Declare stb, to loosen coupling.
9977 * process.c (allocate_pty): Don't declare stb unless it's needed.
9979 * bytecode.c (MAYBE_GC): Rewrite so as not to use empty "else".
9980 (CONSTANTLIM): Remove; unused.
9981 (METER_CODE, Bscan_buffer, Bread_char, Bset_mark):
9982 Define only if needed.
9984 * unexelf.c (unexec): Name an expression,
9985 to avoid gcc -Wbad-function-cast warning.
9986 Use a different way to cause a compilation error if anyone uses
9987 n rather than nn, a way that does not involve shadowing.
9988 (ELF_BSS_SECTION_NAME, OLD_PROGRAM_H): Remove; unused.
9990 * deps.mk (unexalpha.o): Remove; unused.
9992 New file unexec.h, the (simple) interface for unexec (Bug#8267).
9993 * unexec.h: New file.
9994 * deps.mk (emacs.o, unexaix.o, unexcw.o, unexcoff.o, unexelf.o):
9995 (unexhp9k800.o, unexmacosx.o, unexsol.o, unexw32.o):
9997 * emacs.c [!defined CANNOT_DUMP]: Include unexec.h.
9998 * unexaix.c, unexcoff.c, unexcw.c, unexelf.c, unexhp9k800.c:
9999 * unexmacosx.c, unexsol.c, unexw32.c: Include unexec.h.
10000 Change as necessary to match prototype in unexec.h.
10002 * syntax.c (Fforward_comment, scan_lists): Rename locals to avoid
10004 (back_comment, skip_chars): Mark vars as initialized.
10006 * character.h (FETCH_STRING_CHAR_ADVANCE_NO_CHECK, BUF_INC_POS):
10007 Rename locals to avoid shadowing.
10009 * lread.c (read1): Rewrite so as not to use empty "else".
10010 (Fload, readevalloop, read1): Rename locals to avoid shadowing.
10012 * print.c (Fredirect_debugging_output): Fix pointer signedess.
10014 * lisp.h (debug_output_compilation_hack): Add decl here, to avoid
10015 warning when compiling print.c.
10017 * font.c (font_unparse_fcname): Abort in an "impossible" situation
10018 instead of using an uninitialized var.
10019 (font_sort_entities): Mark var as initialized.
10021 * character.h (FETCH_CHAR_ADVANCE): Rename locals to avoid shadowing.
10023 * font.c (font_unparse_xlfd): Don't mix pointers to variables with
10024 pointers to constants.
10025 (font_parse_fcname): Remove unused vars.
10026 (font_delete_unmatched): Now static.
10027 (font_get_spec): Remove; unused.
10028 (font_style_to_value, font_prop_validate_style, font_unparse_fcname):
10029 (font_update_drivers, Ffont_get_glyphs, font_add_log):
10030 Rename or move locals to avoid shadowing.
10032 * fns.c (require_nesting_list, require_unwind): Now static.
10033 (Ffillarray): Rename locals to avoid shadowing.
10035 * floatfns.c (domain_error2): Define only if needed.
10036 (Ffrexp, Fldexp): Rename locals to avoid shadowing.
10038 * alloc.c (mark_backtrace): Move decl from here ...
10039 * lisp.h: ... to here, so that it can be checked.
10041 * eval.c (call_debugger, do_debug_on_call, grow_specpdl): Now static.
10042 (Fdefvar): Rewrite so as not to use empty "else".
10043 (lisp_indirect_variable): Name an expression,
10044 to avoid gcc -Wbad-function-cast warning.
10045 (Fdefvar): Rename locals to avoid shadowing.
10047 * callint.c (quotify_arg, quotify_args): Now static.
10048 (Fcall_interactively): Rename locals to avoid shadowing.
10049 Use const pointer when appropriate.
10051 * lisp.h (get_system_name, get_operating_system_release):
10052 Move decls here, to check interfaces.
10053 * process.c (get_operating_system_release): Move decl to lisp.h.
10054 * xrdb.c (get_system_name): Likewise.
10055 * editfns.c (init_editfns, Fuser_login_name, Fuser_uid):
10056 (Fuser_real_uid, Fuser_full_name): Remove unnecessary casts,
10057 some of which prompt warnings from gcc -Wbad-function-cast.
10058 (Fformat_time_string, Fencode_time, Finsert_char):
10059 (Ftranslate_region_internal, Fformat):
10060 Rename or remove local vars to avoid shadowing.
10061 (Ftranslate_region_internal): Mark var as initialized.
10063 * doc.c (Fdocumentation, Fsnarf_documentation): Move locals to
10066 * lisp.h (eassert): Check that the argument compiles, even if
10067 ENABLE_CHECKING is not defined.
10069 * data.c (Findirect_variable): Name an expression, to avoid
10070 gcc -Wbad-function-cast warning.
10071 (default_value, arithcompare, arith_driver, arith_error): Now static.
10072 (store_symval_forwarding): Rename local to avoid shadowing.
10073 (Fmake_variable_buffer_local, Fmake_local_variable):
10074 Mark variables as initialized.
10075 (do_blv_forwarding, do_symval_forwarding): Remove; unused.
10077 * alloc.c (check_cons_list): Do not define unless GC_CHECK_CONS_LIST.
10078 (Fmake_vector, Fvector, Fmake_byte_code, Fgarbage_collect):
10079 Rename locals to avoid shadowing.
10080 (mark_stack): Move local variables into the #ifdef region where
10082 (BLOCK_INPUT_ALLOC, UNBLOCK_INPUT_ALLOC): Define only if
10083 ! defined SYSTEM_MALLOC && ! defined SYNC_INPUT, as they are not
10085 (CHECK_ALLOCATED): Define only if GC_CHECK_MARKED_OBJECTS.
10086 (GC_STRING_CHARS): Remove; not used.
10087 (Fmemory_limit): Cast sbrk's returned value to char *.
10089 * lisp.h (check_cons_list): Declare if GC_CHECK_CONS_LIST; this
10090 avoids undefined behavior in theory.
10092 * regex.c (IF_LINT): Add defn, for benefit of ../lib-src.
10094 Use functions, not macros, for up- and down-casing (Bug#8254).
10095 * buffer.h (DOWNCASE_TABLE, UPCASE_TABLE, DOWNCASE, UPPERCASEP):
10096 (NOCASEP, LOWERCASEP, UPCASE, UPCASE1): Remove. All callers changed
10097 to use the following functions instead of these macros.
10098 (downcase): Adjust to lack of DOWNCASE_TABLE. Return int, not
10099 EMACS_INT, since callers assume the returned value fits in int.
10100 (upcase1): Likewise, for UPCASE_TABLE.
10101 (uppercasep, lowercasep, upcase): New static inline functions.
10102 * editfns.c (Fchar_equal): Remove no-longer-needed workaround for
10103 the race-condition problem in the old DOWNCASE.
10105 * regex.c (CHARSET_LOOKUP_RANGE_TABLE_RAW, POP_FAILURE_REG_OR_COUNT):
10106 Rename locals to avoid shadowing.
10107 (regex_compile, re_match_2_internal): Move locals to avoid shadowing.
10108 (regex_compile, re_search_2, re_match_2_internal):
10109 Remove unused local vars.
10110 (FREE_VAR): Rewrite so as not to use empty "else",
10111 which gcc can warn about.
10112 (regex_compile, re_match_2_internal): Mark locals as initialized.
10113 (RETALLOC_IF): Define only if needed.
10114 (WORDCHAR_P): Likewise. This one is never needed, but is used
10115 only in a comment talking about a compiler bug, so put inside
10116 the #if 0 of that comment.
10117 (CHARSET_LOOKUP_BITMAP, FAIL_STACK_FULL, RESET_FAIL_STACK):
10118 (PUSH_FAILURE_ELT, BUF_PUSH_3, STOP_ADDR_VSTRING):
10121 * search.c (boyer_moore): Rename locals to avoid shadowing.
10122 * character.h (FETCH_STRING_CHAR_AS_MULTIBYTE_ADVANCE):
10123 (PREV_CHAR_BOUNDARY): Likewise.
10125 * search.c (simple_search): Remove unused var.
10127 * dired.c (compile_pattern): Move decl from here ...
10128 * lisp.h: ... to here, so that it can be checked.
10129 (struct re_registers): New forward decl.
10131 * character.h (INC_POS, DEC_POS): Rename locals to avoid shadowing.
10133 * indent.c (MULTIBYTE_BYTES_WIDTH): New args bytes, width.
10135 (MULTIBYTE_BYTES_WIDTH, scan_for_column, compute_motion):
10136 Rename locals to avoid shadowing.
10137 (Fvertical_motion): Mark locals as initialized.
10139 * casefiddle.c (casify_object, casify_region): Now static.
10140 (casify_region): Mark local as initialized.
10142 * cmds.c (internal_self_insert): Rename local to avoid shadowing.
10144 * lisp.h (GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR, GCPRO5_VAR, GCPRO6_VAR):
10145 New macros, so that the caller can use some names other than
10146 gcpro1, gcpro2, etc.
10147 (GCPRO2, GCPRO3, GCPRO4, GCPRO5, GCPRO6): Reimplement in terms
10149 (GCPRO1_VAR, UNGCPRO_VAR): Change the meaning of the second
10150 argument, for consistency with GCPRO2_VAR, etc: it is now the
10151 prefix of the variable, not the variable itself. All uses
10153 * dired.c (directory_files_internal, file_name_completion):
10154 Rename locals to avoid shadowing.
10156 Fix a race condition diagnosed by gcc -Wsequence-point (Bug#8254).
10157 An expression of the form (DOWNCASE (x) == DOWNCASE (y)), found in
10158 dired.c's scmp function, had undefined behavior.
10159 * lisp.h (DOWNCASE_TABLE, UPCASE_TABLE, DOWNCASE, UPPERCASEP):
10160 (NOCASEP, LOWERCASEP, UPCASE, UPCASE1): Move from here ...
10161 * buffer.h: ... to here, because these macros use current_buffer,
10162 and the new implementation with inline functions needs to have
10163 current_buffer in scope now, rather than later when the macros
10165 (downcase, upcase1): New static inline functions.
10166 (DOWNCASE, UPCASE1): Reimplement using these functions.
10167 This avoids undefined behavior in expressions like
10168 DOWNCASE (x) == DOWNCASE (y), which previously suffered
10169 from race conditions in accessing the global variables
10170 case_temp1 and case_temp2.
10171 * casetab.c (case_temp1, case_temp2): Remove; no longer needed.
10172 * lisp.h (case_temp1, case_temp2): Remove their decls.
10173 * character.h (ASCII_CHAR_P): Move from here ...
10174 * lisp.h: ... to here, so that the inline functions mentioned
10175 above can use them.
10177 * dired.c (directory_files_internal_unwind): Now static.
10179 * fileio.c (file_name_as_directory, directory_file_name):
10180 (barf_or_query_if_file_exists, auto_save_error, auto_save_1):
10182 (file_name_as_directory): Use const pointers when appropriate.
10183 (Fexpand_file_name): Likewise. In particular, newdir might
10184 point at constant storage, so make it a const pointer.
10185 (Fmake_directory_internal, Fread_file_name): Remove unused vars.
10186 (Ffile_selinux_context, Fset_file_selinux_context): Fix pointer
10188 (Fset_file_times, Finsert_file_contents, auto_save_error):
10189 Rename locals to avoid shadowing.
10191 * minibuf.c (choose_minibuf_frame_1): Now static.
10192 (Ftry_completion, Fall_completions): Rename or remove locals
10193 to avoid shadowing.
10195 * marker.c (bytepos_to_charpos): Remove; unused.
10197 * lisp.h (verify_bytepos, count_markers): New decls,
10198 so that gcc does not warn that these functions aren't declared.
10200 * insdel.c (check_markers, make_gap_larger, make_gap_smaller):
10201 (reset_var_on_error, Fcombine_after_change_execute_1): Now static.
10202 (CHECK_MARKERS): Redo to avoid gcc -Wempty-body diagnostic.
10203 (copy_text): Remove unused local var.
10205 * filelock.c (within_one_second): Now static.
10206 (lock_file_1): Rename local to avoid shadowing.
10208 * buffer.c (fix_overlays_before): Mark locals as initialized.
10209 (fix_start_end_in_overlays): Likewise. This function should be
10210 simplified by using pointers-to-pointers, but that's a different
10212 (switch_to_buffer_1): Now static.
10213 (Fkill_buffer, record_buffer, Fbury_buffer, Fset_buffer_multibyte):
10214 (report_overlay_modification): Rename locals to avoid shadowing.
10216 * sysdep.c (system_process_attributes): Rename vars to avoid shadowing.
10217 Fix pointer signedness issue.
10218 (sys_subshell): Mark local as volatile if checking for lint,
10219 to suppress a gcc -Wclobbered warning that does not seem to be right.
10220 (MAXPATHLEN): Define only if needed.
10222 * process.c (serial_open, serial_configure): Move decls from here ...
10223 * systty.h: ... to here, so that they can be checked.
10225 * fns.c (get_random, seed_random): Move extern decls from here ...
10226 * lisp.h: ... to here, so that they can be checked.
10228 * sysdep.c (reset_io): Now static.
10229 (wait_for_termination_signal): Remove; unused.
10231 * keymap.c (keymap_parent, keymap_memberp, map_keymap_internal):
10232 (copy_keymap_item, append_key, push_text_char_description):
10234 (Fwhere_is_internal): Don't test CONSP (sequences) unnecessarily.
10235 (DENSE_TABLE_SIZE): Remove; unused.
10236 (get_keymap, access_keymap, Fdefine_key, Fwhere_is_internal):
10237 (describe_map_tree):
10238 Rename locals to avoid shadowing.
10240 * keyboard.c: Declare functions static if they are not used elsewhere.
10241 (echo_char, echo_dash, cmd_error, top_level_2):
10242 (poll_for_input, handle_async_input): Now static.
10243 (read_char, kbd_buffer_get_event, make_lispy_position):
10244 (make_lispy_event, make_lispy_movement, apply_modifiers):
10245 (decode_keyboard_code, tty_read_avail_input, menu_bar_items):
10246 (parse_tool_bar_item, read_key_sequence, Fread_key_sequence):
10247 (Fread_key_sequence_vector): Rename locals to avoid shadowing.
10248 (read_key_sequence, read_char): Mark locals as initialized.
10249 (Fexit_recursive_edit, Fabort_recursive_edit): Mark with NO_RETURN.
10251 * keyboard.h (make_ctrl_char): New decl.
10252 (mark_kboards): Move decl here ...
10253 * alloc.c (mark_kboards): ... from here.
10255 * lisp.h (force_auto_save_soon): New decl.
10257 * emacs.c (init_cmdargs): Rename local to avoid shadowing.
10258 (DEFINE_DUMMY_FUNCTION): New macro.
10259 (__do_global_ctors, __do_global_ctors_aux, __do_global_dtors, __main):
10261 (main): Add casts to avoid warnings
10262 if GCC considers string literals to be constants.
10264 * lisp.h (fatal_error_signal): Add decl, since it's exported.
10266 * dbusbind.c: Pointer signedness fixes.
10267 (xd_signature, xd_append_arg, xd_initialize):
10268 (Fdbus_call_method, Fdbus_call_method_asynchronously):
10269 (Fdbus_method_return_internal, Fdbus_method_error_internal):
10270 (Fdbus_send_signal, xd_read_message_1, Fdbus_register_service):
10271 (Fdbus_register_signal): Use SSDATA when the context wants char *.
10273 * dbusbind.c (Fdbus_init_bus): Add cast to avoid warning
10274 if GCC considers string literals to be constants.
10275 (Fdbus_register_service, Fdbus_register_method): Remove unused vars.
10277 2011-03-16 Stefan Monnier <monnier@iro.umontreal.ca>
10279 * print.c (PRINT_CIRCLE_CANDIDATE_P): New macro.
10280 (print_preprocess, print_object): New macro to fix last change.
10282 * print.c (print_preprocess): Don't forget font objects.
10284 2011-03-16 Juanma Barranquero <lekktu@gmail.com>
10286 * emacs.c (USAGE3): Doc fixes.
10288 2011-03-15 Andreas Schwab <schwab@linux-m68k.org>
10290 * coding.c (detect_coding_iso_2022): Reorganize code to clarify
10293 2011-03-14 Juanma Barranquero <lekktu@gmail.com>
10295 * lisp.h (VWindow_system, Qfile_name_history):
10296 * keyboard.h (lispy_function_keys) [WINDOWSNT]:
10297 * w32term.h (w32_system_caret_hwnd, w32_system_caret_height)
10298 (w32_system_caret_x, w32_system_caret_y): Declare extern.
10300 * w32select.c: Don't #include "keyboard.h".
10301 (run_protected): Add extern declaration for waiting_for_input.
10303 * w32.c (Qlocal, noninteractive1, inhibit_window_system):
10304 * w32console.c (detect_input_pending, read_input_pending)
10305 (encode_terminal_code):
10306 * w32fns.c (quit_char, lispy_function_keys, Qtooltip)
10307 (w32_system_caret_hwnd, w32_system_caret_height, w32_system_caret_x)
10308 (w32_system_caret_y, Qfile_name_history):
10309 * w32font.c (w32font_driver, QCantialias, QCotf, QClang):
10310 * w32inevt.c (reinvoke_input_signal, lispy_function_keys):
10311 * w32menu.c (Qmenu_bar, QCtoggle, QCradio, Qoverriding_local_map)
10312 (Qoverriding_terminal_local_map, Qmenu_bar_update_hook):
10313 * w32proc.c (Qlocal, report_file_error):
10314 * w32term.c (Vwindow_system, updating_frame):
10315 * w32uniscribe.c (initialized, uniscribe_font_driver):
10316 Remove unneeded extern declarations.
10318 2011-03-14 Chong Yidong <cyd@stupidchicken.com>
10320 * buffer.c (Fmake_indirect_buffer): Fix incorrect assertions.
10322 2011-03-13 Chong Yidong <cyd@stupidchicken.com>
10324 * buffer.h (BUF_BEGV, BUF_BEGV_BYTE, BUF_ZV, BUF_ZV_BYTE, BUF_PT)
10325 (BUF_PT_BYTE): Rewrite to handle indirect buffers (Bug#8219).
10326 These macros can no longer be used for assignment.
10328 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer):
10329 Assign struct members directly, instead of using BUF_BEGV etc.
10330 (record_buffer_markers, fetch_buffer_markers): New functions for
10331 recording and fetching special buffer markers.
10332 (set_buffer_internal_1, set_buffer_temp): Use them.
10334 * lread.c (unreadchar): Use SET_BUF_PT_BOTH.
10336 * insdel.c (adjust_point): Use SET_BUF_PT_BOTH.
10338 * intervals.c (temp_set_point_both): Use SET_BUF_PT_BOTH.
10339 (get_local_map): Use SET_BUF_BEGV_BOTH and SET_BUF_ZV_BOTH.
10341 * xdisp.c (hscroll_window_tree):
10342 (reconsider_clip_changes): Use PT instead of BUF_PT.
10344 2011-03-13 Eli Zaretskii <eliz@gnu.org>
10346 * makefile.w32-in ($(BLD)/editfns.$(O)): Depend on
10347 $(EMACS_ROOT)/lib/intprops.h.
10349 2011-03-13 Paul Eggert <eggert@cs.ucla.edu>
10351 Fix more problems found by GCC 4.5.2's static checks.
10353 * gtkutil.c (xg_get_pixbuf_from_pixmap): Add cast from char *
10354 to unsigned char * to avoid compiler diagnostic.
10355 (xg_free_frame_widgets): Make it clear that a local variable is
10356 needed only if USE_GTK_TOOLTIP.
10357 (gdk_window_get_screen): Make it clear that this macro is needed
10358 only if USE_GTK_TOOLTIP.
10359 (int_gtk_range_get_value): New function, which avoids a diagnostic
10360 from gcc -Wbad-function-cast.
10361 (xg_set_toolkit_scroll_bar_thumb): Use it.
10362 (xg_tool_bar_callback, xg_tool_item_stale_p): Rewrite to avoid
10363 diagnostic from gcc -Wbad-function-cast.
10364 (get_utf8_string, xg_get_file_with_chooser):
10365 Rename locals to avoid shadowing.
10366 (create_dialog): Move locals to avoid shadowing.
10368 * xgselect.c (xg_select): Remove unused var.
10370 * image.c (four_corners_best): Mark locals as initialized.
10371 (gif_load): Initialize transparent_p to zero (Bug#8238).
10372 Mark another local as initialized.
10373 (my_png_error, my_error_exit): Mark with NO_RETURN.
10375 * image.c (clear_image_cache): Now static.
10376 (DIM, HAVE_STDLIB_H_1): Remove unused macros.
10377 (xpm_load): Redo to avoid "discards qualifiers" gcc warning.
10378 (x_edge_detection): Remove unnecessary cast that
10379 gcc -Wbad-function-cast diagnoses.
10380 (gif_load): Fix pointer signedness.
10381 (clear_image_cache, xbm_read_bitmap_data, x_detect_edges):
10382 (jpeg_load, gif_load): Rename locals to avoid shadowing.
10384 2011-03-12 Paul Eggert <eggert@cs.ucla.edu>
10386 Improve quality of tests for time stamp overflow.
10387 For example, without this patch (encode-time 0 0 0 1 1
10388 1152921504606846976) returns the obviously-bogus value (-948597
10389 62170) on my RHEL 5.5 x86-64 host. With the patch, it correctly
10390 reports time overflow. See
10391 <http://lists.gnu.org/archive/html/emacs-devel/2011-03/msg00470.html>.
10392 * deps.mk (editfns.o): Depend on ../lib/intprops.h.
10393 * editfns.c: Include limits.h and intprops.h.
10394 (TIME_T_MIN, TIME_T_MAX): New macros.
10395 (time_overflow): Move earlier, to before first use.
10396 (hi_time, lo_time): New functions, for an accurate test for
10397 out-of-range times.
10398 (Fcurrent_time, Fget_internal_run_time, make_time): Use them.
10399 (Fget_internal_run_time): Don't assume time_t fits in int.
10400 (make_time): Use list2 instead of Fcons twice.
10401 (Fdecode_time): More accurate test for out-of-range times.
10402 (check_tm_member): New function.
10403 (Fencode_time): Use it, to test for out-of-range times.
10404 (lisp_time_argument): Don't rely on undefined left-shift and
10405 right-shift behavior when checking for time stamp overflow.
10407 * editfns.c (time_overflow): New function, refactoring common code.
10408 (Fformat_time_string, Fdecode_time, Fencode_time):
10409 (Fcurrent_time_string): Use it.
10411 Move 'make_time' to be next to its inverse 'lisp_time_argument'.
10412 * dired.c (make_time): Move to ...
10413 * editfns.c (make_time): ... here.
10414 * systime.h: Note the move.
10416 2011-03-12 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
10418 * fringe.c (update_window_fringes): Remove unused variables.
10420 * unexmacosx.c (copy_data_segment): Also copy __got section.
10423 2011-03-12 Eli Zaretskii <eliz@gnu.org>
10425 * termcap.c [MSDOS]: Include "msdos.h".
10426 (find_capability, tgetnum, tgetflag, tgetstr, tputs, tgetent):
10427 Constify `char *' arguments and their references according to
10428 prototypes in tparam.h.
10430 * deps.mk (termcap.o): Depend on tparam.h and msdos.h.
10432 * msdos.c (XMenuAddPane): 3rd argument is `const char *' now.
10433 Adapt all references accordingly.
10435 * msdos.h (XMenuAddPane): 3rd argument is `const char *' now.
10437 2011-03-11 Tom Tromey <tromey@redhat.com>
10439 * buffer.c (syms_of_buffer): Remove obsolete comment.
10441 2011-03-11 Eli Zaretskii <eliz@gnu.org>
10443 * termhooks.h (encode_terminal_code): Declare prototype.
10445 * msdos.c (encode_terminal_code): Don't declare prototype.
10447 * term.c (encode_terminal_code): Now external again, used by
10448 w32console.c and msdos.c.
10450 * makefile.w32-in ($(BLD)/term.$(O), ($(BLD)/tparam.$(O)):
10451 Depend on $(SRC)/tparam.h, see 2011-03-11T07:24:21Z!eggert@cs.ucla.edu.
10453 2011-03-11 Paul Eggert <eggert@cs.ucla.edu>
10455 Fix some minor problems found by GCC 4.5.2's static checks.
10457 * fringe.c (update_window_fringes): Mark locals as initialized
10459 (destroy_fringe_bitmap, init_fringe_bitmap): Now static.
10461 * alloc.c (mark_fringe_data): Move decl from here ...
10462 * lisp.h (mark_fringe_data) [HAVE_WINDOW_SYSTEM]: ... to here,
10463 to check its interface.
10464 (init_fringe_once): Do not declare unless HAVE_WINDOW_SYSTEM.
10466 * fontset.c (free_realized_fontset): Now static.
10467 (Fset_fontset_font): Rename local to avoid shadowing.
10468 (fontset_font): Mark local as initialized.
10469 (FONTSET_SPEC, FONTSET_REPERTORY, RFONT_DEF_REPERTORY): Remove; unused.
10471 * xrdb.c: Include "xterm.h", to check x_load_resources's interface.
10473 * xselect.c (x_disown_buffer_selections): Remove; not used.
10474 (TRACE3) [!defined TRACE_SELECTION]: Remove; not used.
10475 (x_own_selection, Fx_disown_selection_internal): Rename locals
10476 to avoid shadowing.
10477 (x_handle_dnd_message): Remove local to avoid shadowing.
10479 * lisp.h (GCPRO1_VAR, UNGCPRO_VAR): New macros,
10480 so that the caller can use some name other than gcpro1.
10481 (GCPRO1, UNGCPRO): Reimplement in terms of the new macros.
10482 * xfns.c (Fx_create_frame, x_create_tip_frame, Fx_show_tip):
10483 (Fx_backspace_delete_keys_p):
10484 Use them to avoid shadowing, and rename vars to avoid shadowing.
10485 (x_decode_color, x_set_name, x_window): Now static.
10486 (Fx_create_frame): Add braces to silence GCC warning.
10487 (Fx_file_dialog, Fx_select_font): Fix pointer signedness.
10488 (x_real_positions, xg_set_icon_from_xpm_data, x_create_tip_frame):
10489 Remove unused locals.
10490 (Fx_create_frame, x_create_tip_frame, Fx_show_tip):
10491 (Fx_backspace_delete_keys_p): Rename locals to avoid shadowing.
10492 Some of these renamings use the new GCPRO1_VAR and UNGCPRO_VAR
10495 * xterm.h (x_mouse_leave): New decl.
10497 * xterm.c (x_copy_dpy_color, x_focus_on_frame, x_unfocus_frame):
10498 Remove unused functions.
10499 (x_shift_glyphs_for_insert, XTflash, XTring_bell):
10500 (x_calc_absolute_position): Now static.
10501 (XTread_socket): Don't define label "out" unless it's used.
10502 Don't declare local "event" unless it's used.
10503 (x_iconify_frame, x_free_frame_resources): Don't declare locals
10504 unless they are used.
10505 (XEMBED_VERSION, xembed_set_info): Don't define unless needed.
10506 (x_fatal_error_signal): Remove; not used.
10507 (x_draw_image_foreground, redo_mouse_highlight, XTmouse_position):
10508 (x_scroll_bar_report_motion, handle_one_xevent, x_draw_bar_cursor):
10509 (x_error_catcher, x_connection_closed, x_error_handler):
10510 (x_error_quitter, xembed_send_message, x_iconify_frame):
10511 (my_log_handler): Rename locals to avoid shadowing.
10512 (x_delete_glyphs, x_ins_del_lines): Mark with NO_RETURN.
10513 (x_connection_closed): Tell GCC not to suggest NO_RETURN.
10515 * xfaces.c (clear_face_cache, Fx_list_fonts, Fface_font):
10516 Rename or move locals to avoid shadowing.
10517 (tty_defined_color, merge_face_heights): Now static.
10518 (free_realized_faces_for_fontset): Remove; not used.
10519 (Fx_list_fonts): Mark variable that gcc -Wuninitialized
10520 does not deduce is never used uninitialized.
10521 (STRDUPA, LSTRDUPA, FONT_POINT_SIZE_QUANTUM): Remove; not used.
10522 (LFACEP): Define only if XASSERTS, as it's not needed otherwise.
10524 * terminal.c (store_terminal_param): Now static.
10526 * xmenu.c (menu_highlight_callback): Now static.
10527 (set_frame_menubar): Remove unused local.
10528 (xmenu_show): Rename parameter to avoid shadowing.
10529 (xmenu_show, xdialog_show, xmenu_show): Make local pointers "const"
10530 since they might point to immutable storage.
10531 (next_menubar_widget_id): Declare only if USE_X_TOOLKIT,
10532 since it's unused otherwise.
10534 * xdisp.c (produce_glyphless_glyph): Initialize lower_xoff.
10535 Add a FIXME, since the code still doesn't look right. (Bug#8215)
10536 (Fcurrent_bidi_paragraph_direction): Simplify slightly; this
10537 avoids a gcc -Wuninitialized diagnostic.
10538 (display_line, BUILD_COMPOSITE_GLYPH_STRING, draw_glyphs):
10539 (note_mouse_highlight): Mark variables that gcc -Wuninitialized
10540 does not deduce are never used uninitialized.
10542 * lisp.h (IF_LINT): New macro, copied from ../lib-src/emacsclient.c.
10544 * xdisp.c (redisplay_window): Rename local to avoid shadowing.
10545 * window.c (window_loop, size_window):
10546 (run_window_configuration_change_hook, enlarge_window): Likewise.
10548 * window.c (display_buffer): Now static.
10549 (size_window): Mark variables that gcc -Wuninitialized
10550 does not deduce are never used uninitialized.
10551 * window.h (check_all_windows): New decl, to forestall
10552 gcc -Wmissing-prototypes diagnostic.
10553 * dispextern.h (bidi_dump_cached_states): Likewise.
10555 * charset.h (CHECK_CHARSET_GET_CHARSET): Rename locals to avoid
10557 * charset.c (map_charset_for_dump, Fchar_charset): Likewise.
10558 Include <limits.h>.
10559 (Fsort_charsets): Redo min/max calculation to shorten the code a bit
10560 and to avoid gcc -Wuninitialized warning.
10561 (load_charset_map): Mark variables that gcc -Wuninitialized
10562 does not deduce are never used uninitialized.
10563 (load_charset): Abort instead of using uninitialized var (Bug#8229).
10565 * coding.c (coding_set_source, coding_set_destination):
10566 Use "else { /* comment */ }" rather than "else /* comment */;"
10567 for clarity, and to avoid gcc -Wempty-body warning.
10568 (Fdefine_coding_system_internal): Don't redeclare 'i' inside
10569 a block, when the outer 'i' will do.
10570 (decode_coding_utf_8, decode_coding_utf_16, detect_coding_emacs_mule):
10571 (emacs_mule_char, decode_coding_emacs_mule, detect_coding_iso_2022):
10572 (decode_coding_iso_2022, decode_coding_sjis, decode_coding_big5):
10573 (decode_coding_raw_text, decode_coding_charset, get_translation_table):
10574 (Fdecode_sjis_char, Fdefine_coding_system_internal):
10575 Rename locals to avoid shadowing.
10576 * character.h (FETCH_STRING_CHAR_ADVANCE): Likewise.
10577 * coding.c (emacs_mule_char, encode_invocation_designation):
10578 Now static, since they're not used elsewhere.
10579 (decode_coding_iso_2022): Add "default: abort ();" as a safety check.
10580 (decode_coding_object, encode_coding_object, detect_coding_system):
10581 (decode_coding_emacs_mule): Mark variables that gcc
10582 -Wuninitialized does not deduce are never used uninitialized.
10583 (detect_coding_iso_2022): Initialize a local variable that might
10584 be used uninitialized. Leave a FIXME because it's not clear that
10585 this initialization is needed. (Bug#8211)
10586 (ISO_CODE_LF, ISO_CODE_CR, CODING_ISO_FLAG_EUC_TW_SHIFT):
10587 (ONE_MORE_BYTE_NO_CHECK, UTF_BOM, UTF_16_INVALID_P):
10588 (SHIFT_OUT_OK, ENCODE_CONTROL_SEQUENCE_INTRODUCER):
10589 (ENCODE_DIRECTION_R2L, ENCODE_DIRECTION_L2R):
10590 Remove unused macros.
10592 * category.c (hash_get_category_set): Remove unused local var.
10593 (copy_category_table): Now static, since it's not used elsewhere.
10594 * character.c (string_count_byte8): Likewise.
10596 * ccl.c (CCL_WRITE_STRING, CCL_ENCODE_CHAR, Fccl_execute_on_string):
10597 (Fregister_code_conversion_map): Rename locals to avoid shadowing.
10599 * chartab.c (copy_sub_char_table): Now static, since it's not used
10601 (sub_char_table_ref_and_range, char_table_ref_and_range):
10602 Rename locals to avoid shadowing.
10603 (ASET_RANGE, GET_SUB_CHAR_TABLE): Remove unused macros.
10605 * bidi.c (bidi_check_type): Now static, since it's not used elsewhere.
10606 (BIDI_BOB): Remove unused macro.
10608 * cm.c (cmgoto): Mark variables that gcc -Wuninitialized does not
10609 deduce are never used uninitialized.
10610 * term.c (encode_terminal_code): Likewise.
10612 * term.c (encode_terminal_code): Now static. Remove unused local.
10614 * tparam.h: New file.
10615 * term.c, tparam.h: Include it.
10616 * deps.mk (term.o, tparam.o): Depend on tparam.h.
10617 * term.c (tputs, tgetent, tgetflag, tgetnum, tparam, tgetstr):
10618 Move these decls to tparam.h, and make them agree with what
10619 is actually in tparam.c. The previous trick of using incompatible
10620 decls in different modules does not conform to the C standard.
10621 All callers of tparam changed to use tparam's actual API.
10622 * tparam.c (tparam1, tparam, tgoto):
10623 Use const pointers where appropriate.
10625 * cm.c (calccost, cmgoto): Use const pointers where appropriate.
10626 * cm.h (struct cm): Likewise.
10627 * dispextern.h (do_line_insertion_deletion_costs): Likewise.
10628 * scroll.c (ins_del_costs, do_line_insertion_deletion_costs): Likewise.
10629 * term.c (tty_ins_del_lines, calculate_costs, struct fkey_table):
10630 (term_get_fkeys_1, append_glyphless_glyph, produce_glyphless_glyph):
10631 (turn_on_face, init_tty): Likewise.
10632 * termchar.h (struct tty_display_info): Likewise.
10634 * term.c (term_mouse_position): Rename local to avoid shadowing.
10636 * alloc.c (mark_ttys): Move decl from here ...
10637 * lisp.h (mark_ttys): ... to here, so that it's checked against defn.
10639 2011-03-11 Andreas Schwab <schwab@linux-m68k.org>
10641 * .gdbinit (pwinx, xbuffer): Fix access to buffer name.
10643 2011-03-09 Juanma Barranquero <lekktu@gmail.com>
10645 * search.c (compile_pattern_1): Remove argument regp, unused since
10646 revid:rms@gnu.org-19941211082627-3x1g1wyqkjmwloig.
10647 (compile_pattern): Don't pass it.
10649 2011-03-08 Jan Djärv <jan.h.d@swipnet.se>
10651 * xterm.h (DEFAULT_GDK_DISPLAY): New define.
10652 (GDK_WINDOW_XID, gtk_widget_get_preferred_size): New defines
10654 (GTK_WIDGET_TO_X_WIN): Use GDK_WINDOW_XID.
10656 * xmenu.c (menu_position_func): Call gtk_widget_get_preferred_size.
10658 * gtkutil.c: Include gtkx.h if HAVE_GTK3. If ! HAVE_GTK3, define
10659 gdk_window_get_screen, gdk_window_get_geometry,
10660 gdk_x11_window_lookup_for_display and GDK_KEY_g.
10661 (xg_set_screen): Use DEFAULT_GDK_DISPLAY.
10662 (xg_get_pixbuf_from_pixmap): New function.
10663 (xg_get_pixbuf_from_pix_and_mask): Change parameters from GdkPixmap
10664 to Pixmap, take frame as parameter, remove GdkColormap parameter.
10665 Call xg_get_pixbuf_from_pixmap instead of
10666 gdk_pixbuf_get_from_drawable.
10667 (xg_get_image_for_pixmap): Do not make GdkPixmaps, call
10668 xg_get_pixbuf_from_pix_and_mask with Pixmap parameters instead.
10669 (xg_check_special_colors): Use GtkStyleContext and its functions
10671 (xg_prepare_tooltip, xg_hide_tooltip): Call gdk_window_get_screen.
10672 (xg_prepare_tooltip, create_dialog, menubar_map_cb)
10673 (xg_update_frame_menubar, xg_tool_bar_detach_callback)
10674 (xg_tool_bar_attach_callback, xg_update_tool_bar_sizes):
10675 Call gtk_widget_get_preferred_size.
10676 (xg_frame_resized): gdk_window_get_geometry only takes 5
10678 (xg_win_to_widget, xg_event_is_for_menubar):
10679 Call gdk_x11_window_lookup_for_display.
10680 (xg_set_widget_bg): New function.
10681 (delete_cb): New function.
10682 (xg_create_frame_widgets): Connect delete-event to delete_cb.
10683 Call xg_set_widget_bg. Only set background pixmap for ! HAVE_GTK3
10684 (xg_set_background_color): Call xg_set_widget_bg.
10685 (xg_set_frame_icon): Call xg_get_pixbuf_from_pix_and_mask.
10686 (xg_create_scroll_bar): vadj is a GtkAdjustment for HAVE_GTK3.
10687 Only call gtk_range_set_update_policy if ! HAVE_GTK3.
10688 (xg_make_tool_item): Only connect xg_tool_bar_item_expose_callback
10690 (update_frame_tool_bar): Call gtk_widget_hide.
10691 (xg_initialize): Use GDK_KEY_g.
10693 * xsmfns.c (gdk_set_sm_client_id): Define to gdk_set_sm_client_id
10695 (x_session_initialize): Call gdk_x11_set_sm_client_id.
10697 * xterm.c (XFillRectangle): Use cairo routines for HAVE_GTK3.
10698 (x_term_init): Disable Xinput(2) with GDK_CORE_DEVICE_EVENTS.
10699 Load ~/emacs.d/gtkrc only for ! HAVE_GTK3.
10701 2011-03-08 Juanma Barranquero <lekktu@gmail.com>
10703 * w32xfns.c (select_palette): Check success of RealizePalette against
10704 GDI_ERROR, not zero.
10706 See ChangeLog.11 for earlier changes.
10708 ;; Local Variables:
10712 Copyright (C) 2011-2012 Free Software Foundation, Inc.
10714 This file is part of GNU Emacs.
10716 GNU Emacs is free software: you can redistribute it and/or modify
10717 it under the terms of the GNU General Public License as published by
10718 the Free Software Foundation, either version 3 of the License, or
10719 (at your option) any later version.
10721 GNU Emacs is distributed in the hope that it will be useful,
10722 but WITHOUT ANY WARRANTY; without even the implied warranty of
10723 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10724 GNU General Public License for more details.
10726 You should have received a copy of the GNU General Public License
10727 along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.