1 2012-05-25 Paul Eggert <eggert@cs.ucla.edu>
3 Fix integer width and related bugs (Bug#9874).
4 * process.h (struct Lisp_Process): Members tick and update_tick
5 are now of type EMACS_INT, not int.
6 * alloc.c (pure_bytes_used_lisp, pure_bytes_used_non_lisp):
7 (allocate_vectorlike, buffer_memory_full, struct sdata, SDATA_SIZE)
8 (string_bytes, check_sblock, allocate_string_data):
9 (compact_small_strings, Fmake_bool_vector, make_string)
10 (make_unibyte_string, make_multibyte_string)
11 (make_string_from_bytes, make_specified_string)
12 (allocate_vectorlike, Fmake_vector, find_string_data_in_pure)
13 (make_pure_string, make_pure_c_string, make_pure_vector, Fpurecopy)
15 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
16 (allocate_pseudovector):
17 Use int, not EMACS_INT, where int is wide enough.
18 (inhibit_garbage_collection, Fgarbage_collect):
19 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
20 * bidi.c (bidi_mirror_char): Use EMACS_INT, not int, where
21 int might not be wide enough.
22 (bidi_cache_search, bidi_cache_find, bidi_init_it)
23 (bidi_count_bytes, bidi_char_at_pos, bidi_fetch_char)
24 (bidi_at_paragraph_end, bidi_find_paragraph_start)
25 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak)
26 (bidi_level_of_next_char, bidi_move_to_visually_next):
27 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
28 * buffer.c (copy_overlays, Fgenerate_new_buffer_name)
29 (Fkill_buffer, Fset_buffer_major_mode)
30 (advance_to_char_boundary, Fbuffer_swap_text)
31 (Fset_buffer_multibyte, overlays_at, overlays_in)
32 (overlay_touches_p, struct sortvec, record_overlay_string)
33 (overlay_strings, recenter_overlay_lists)
34 (adjust_overlays_for_insert, adjust_overlays_for_delete)
35 (fix_start_end_in_overlays, fix_overlays_before, modify_overlay)
36 (Fmove_overlay, Fnext_overlay_change, Fprevious_overlay_change)
37 (Foverlay_recenter, last_overlay_modification_hooks_used)
38 (report_overlay_modification, evaporate_overlays, enlarge_buffer_text):
39 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
40 (validate_region): Omit unnecessary test for b <= e,
41 since that's guaranteed by the previous test.
42 (adjust_overlays_for_delete): Avoid pos + length overflow.
43 (Fmove_overlay, Fdelete_overlay, add_overlay_mod_hooklist)
44 (report_overlay_modification):
45 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
46 (Foverlays_at, Fnext_overlay_change, Fprevious_overlay_change):
47 Omit pointer cast, which isn't needed anyway, and doesn't work
48 after the EMACS_INT -> ptrdiff_t change.
49 * buffer.h: Adjust decls to match defn changes elsewhere.
50 (struct buffer_text, struct buffer):
51 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
52 Use EMACS_INT, not int, where int might not be wide enough.
53 * bytecode.c (unmark_byte_stack, exec_byte_code): Use ptrdiff_t,
54 not int, to avoid needless 32-bit limit on 64-bit hosts.
55 (exec_byte_code): Use tighter memory-full test, one that checks
56 for alloca overflow. Don't compute the address of the object just
57 before an array, as that's not portable. Use EMACS_INT, not
58 ptrdiff_t or int, where ptrdiff_t or int might not be wide enough.
59 * callint.c (Fcall_interactively):
60 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
61 * callproc.c (call_process_kill, Fcall_process):
62 Don't assume pid_t fits into an Emacs fixnum.
63 (call_process_cleanup, Fcall_process, child_setup):
64 Don't assume pid_t fits into int.
65 (call_process_cleanup, Fcall_process, delete_temp_file)
66 (Fcall_process_region):
67 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
68 (Fcall_process): Simplify handling of volatile integers.
69 Use int, not EMACS_INT, where int will do.
70 * casefiddle.c (casify_object, casify_region, operate_on_word)
71 (Fupcase_word, Fdowncase_word, Fcapitalize_word):
72 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
73 (casify_object): Avoid integer overflow when overallocating buffer.
74 * casetab.c (set_identity, shuffle): Prefer int to unsigned when
75 either works. Use lint_assume to convince GCC 4.6.1 that it's OK.
76 * category.c (Fchar_category_set): Don't assume fixnum fits in int.
77 * category.h (CATEGORYP): Don't assume arg is nonnegative.
78 * ccl.c (GET_CCL_INT): Remove; no longer needed, since the
79 integers are now checked earlier. All uses replaced with XINT.
81 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
82 For CCL_MapSingle, check that content and value are in int range.
83 (ccl_driver, Fregister_code_conversion_map):
84 Check that Vcode_version_map_vector is a vector.
85 (resolve_symbol_ccl_program): Check that vector header is in range.
86 Always copy the vector, so that we can check its contents reliably
87 now rather than having to recheck each instruction as it's being
88 executed. Check that vector words fit in 'int'.
89 (ccl_get_compiled_code, Fregister_ccl_program)
90 (Fregister_code_conversion_map): Use ptrdiff_t, not int, for
91 program indexes, to avoid needless 32-bit limit on 64-bit hosts.
92 (Fccl_execute, Fccl_execute_on_string): Check that initial reg
93 contents are in range.
94 (Fccl_execute_on_string): Check that status is in range.
95 * ccl.h (struct ccl_program.idx): Now ptrdiff_t, not int.
96 * character.c (char_resolve_modifier_mask, Fchar_resolve_modifiers):
97 Accept and return EMACS_INT, not int, because callers can pass values
99 (c_string_width, strwidth, lisp_string_width, chars_in_text)
100 (multibyte_chars_in_text, parse_str_as_multibyte)
101 (str_as_multibyte, count_size_as_multibyte, str_to_multibyte)
102 (str_as_unibyte, str_to_unibyte, string_count_byte8)
103 (string_escape_byte8, Fget_byte):
104 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
105 (Funibyte_string): Use CHECK_RANGED_INTEGER, not CHECK_NATNUM, to
106 avoid mishandling large integers.
107 * character.h: Adjust decls to match defn changes elsewhere.
108 * charset.c (load_charset_map_from_file, find_charsets_in_text)
109 (Ffind_charset_region):
110 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
111 (load_charset_map_from_file): Redo idx calculation to avoid overflow.
112 (load_charset_map_from_vector, Fdefine_charset_internal):
113 Don't assume fixnum fits in int.
114 (load_charset_map_from_vector, Fmap_charset_chars):
115 Remove now-unnecessary CHECK_NATNUMs.
116 (Fdefine_charset_internal): Check ranges here, more carefully.
117 Don't rely on undefined behavior with signed left shift overflow.
118 Don't assume unsigned int fits into fixnum, or that fixnum fits
119 into unsigned int. Don't require max_code to be a valid fixnum;
120 that's not true for gb10830 4-byte on a 32-bit host. Allow
121 invalid_code to be a cons, for the same reason. Require code_offset
122 to be a character. Avoid int overflow if max_char is close
124 (CODE_POINT_TO_INDEX): On 32-bit hosts, return int, not unsigned;
125 this is intended anyway and avoids some undefined behavior.
126 (load_charset_map): Pass unsigned, not int, as 2nd arg of
127 INDEX_TO_CODE_POINT, as that's what it expects.
128 (Funify_charset, encode_char): Don't stuff unsigned vals into int vars.
129 * charset.h (DECODE_CHAR): Return int, not unsigned;
130 this is what was intended anyway, and it avoids undefined behavior.
131 (CHARSET_OFFSET): Remove unused macro, instead of fixing its
132 integer-overflow issues.
133 (ENCODE_CHAR): Return unsigned on all hosts, not just on 32-bit hosts.
134 Formerly, it returned EMACS_INT on 64-bit hosts in the common case
135 where the argument is EMACS_INT, and this behavior is not intended.
136 * chartab.c (Fmake_char_table, Fset_char_table_range)
137 (uniprop_get_decoder, uniprop_get_encoder):
138 Don't assume fixnum fits in int.
139 * cmds.c (move_point): New function, that does the gist of
140 Fforward_char and Fbackward_char, but does so while checking
141 for integer overflow more accurately.
142 (Fforward_char, Fbackward_char): Use it.
143 (Fforward_line, Fend_of_line, internal_self_insert)
144 (internal_self_insert):
145 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
146 Fix a FIXME, by checking for integer overflow when calculating
147 target_clm and actual_clm.
148 * coding.c (detect_coding_XXX, encode_coding_XXX, CODING_DECODE_CHAR)
149 (CODING_ENCODE_CHAR, CODING_CHAR_CHARSET, CODING_CHAR_CHARSET_P)
150 (ASSURE_DESTINATION, coding_alloc_by_realloc)
151 (coding_alloc_by_making_gap, alloc_destination)
152 (detect_coding_utf_8, encode_coding_utf_8, decode_coding_utf_16)
153 (encode_coding_utf_16, detect_coding_emacs_mule)
154 (decode_coding_emacs_mule, encode_coding_emacs_mule)
155 (detect_coding_iso_2022, decode_coding_iso_2022)
156 (encode_invocation_designation, encode_designation_at_bol)
157 (encode_coding_iso_2022, detect_coding_sjis, detect_coding_big5)
158 (decode_coding_sjis, decode_coding_big5, encode_coding_sjis)
159 (encode_coding_big5, detect_coding_ccl, decode_coding_ccl)
160 (encode_coding_ccl, encode_coding_raw_text)
161 (detect_coding_charset, decode_coding_charset)
162 (encode_coding_charset, detect_eol, decode_eol, produce_chars)
163 (produce_composition, produce_charset, produce_annotation)
164 (decode_coding, handle_composition_annotation)
165 (handle_charset_annotation, consume_chars, decode_coding_gap)
166 (decode_coding_object, encode_coding_object, detect_coding_system)
167 (Ffind_coding_systems_region_internal, Fcheck_coding_systems_region)
168 (code_convert_region, code_convert_string)
169 (Fdefine_coding_system_internal)
170 (coding_set_source, coding_set_destination):
171 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
172 (setup_iso_safe_charsets, consume_chars, Funencodable_char_position)
173 (Fdefine_coding_system_internal):
174 Don't assume fixnums fit in int.
175 (decode_coding_gap, decode_coding_object, encode_coding_object)
176 (Fread_coding_system, Fdetect_coding_region)
177 (Funencodable_char_position, Fcheck_coding_systems_region)
178 (get_translation, handle_composition_annotation, consume_chars):
179 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
180 (consume_chars): Rewrite to not calculate an address outside buffer.
181 (Ffind_operation_coding_system): NATNUMP can eval its arg twice.
182 Don't access memory outside of the args array.
183 (Fdefine_coding_system_internal): Check for charset-id overflow.
184 (ENCODE_ISO_CHARACTER): Use unsigned, not int, to store the unsigned
185 result of ENCODE_CHAR.
186 * coding.h: Adjust decls to match defn changes elsewhere.
187 (struct coding_system):
188 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
189 * composite.c (get_composition_id, find_composition)
190 (run_composition_function, update_compositions)
191 (compose_text, composition_gstring_put_cache)
192 (composition_gstring_p, composition_gstring_width)
193 (fill_gstring_header, fill_gstring_body, autocmp_chars)
194 (composition_compute_stop_pos, composition_reseat_it)
195 (composition_update_it, struct position_record)
196 (find_automatic_composition, composition_adjust_point)
197 (Fcomposition_get_gstring, Ffind_composition_internal):
198 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
199 (update_compositions):
200 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
201 * composite.h: Adjust decls to match defn changes elsewhere.
202 (struct composition):
203 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
204 * data.c (let_shadows_buffer_binding_p, let_shadows_global_binding_p):
205 Do not attempt to compute the address of the object just before a
206 buffer; this is not portable.
208 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
209 (Faset): Use int, not EMACS_INT, where int is wide enough.
210 (Fstring_to_number): Don't assume fixnums fit in int.
211 (Frem): Don't assume arg is nonnegative.
212 * dbusbind.c (xd_append_arg): Check for integers out of range.
213 (Fdbus_call_method): Don't overflow the timeout int.
214 (extract_signed, extract_unsigned): New functions.
215 (XD_CHECK_DBUS_SERIAL): Remove; superseded by extract_unsigned.
216 (xd_get_connection_references): Return ptrdiff_t, not int.
218 (xd_signature, xd_append_arg, xd_retrieve_arg, Fdbus_message_internal)
220 Use int, not unsigned, where the dbus API uses int.
221 (Fdbus_message_internal): Don't overflow mtype.
222 (syms_of_dbusbind): Allocate right-sized buffer for integers.
223 * dired.c (directory_files_internal, file_name_completion, scmp)
224 (file_name_completion_stat):
225 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
226 (file_name_completion): Don't overflow matchcount.
227 (file_name_completion_stat): Use SAFE_ALLOCA, not alloca.
228 * dispextern.h: Adjust decls to match defn changes elsewhere.
229 (struct text_pos, struct glyph, struct bidi_saved_info)
230 (struct bidi_string_data, struct bidi_it, struct composition_it)
232 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
233 (struct display_pos, struct composition_it, struct it):
234 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
235 * dispnew.c (increment_matrix_positions)
236 (increment_row_positions, mode_line_string)
237 (marginal_area_string):
238 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
239 (change_frame_size_1, Fredisplay, Fframe_or_buffer_changed_p):
240 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
241 (duration_to_sec_usec): New function, to check for overflow better.
242 (Fsleep_for, sit_for): Use it.
243 * doc.c (get_doc_string, store_function_docstring):
244 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
245 (get_doc_string, Fsnarf_documentation):
246 Use int, not EMACS_INT, where int is wide enough.
248 Use SAFE_ALLOCA, not alloca.
249 Check for overflow when converting EMACS_INT to off_t.
251 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
252 * editfns.c (init_editfns, Fuser_uid, Fuser_real_uid):
253 Don't assume uid_t fits into fixnum.
254 (buildmark, Fgoto_char, overlays_around, find_field, Fdelete_field)
255 (Ffield_string, Ffield_string_no_properties, Ffield_beginning)
256 (Ffield_end, Fconstrain_to_field, Fline_beginning_position)
257 (Fline_end_position, Fprevious_char, Fchar_after, Fchar_before)
258 (general_insert_function)
259 (Finsert_char, make_buffer_string, make_buffer_string_both)
260 (update_buffer_properties, Fbuffer_substring)
261 (Fbuffer_substring_no_properties, Fcompare_buffer_substrings)
262 (Fsubst_char_in_region, check_translation)
263 (Ftranslate_region_internal, save_restriction_restore, Fformat)
264 (transpose_markers, Ftranspose_regions):
265 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
266 (clip_to_bounds): Move to lisp.h as an inline function).
267 (Fconstrain_to_field): Don't assume integers are nonnegative.
268 (Fline_beginning_position, Fsave_excursion, Fsave_current_buffer):
269 (Fsubst_char_in_region, Fsave_restriction):
270 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
271 (Femacs_pid): Don't assume pid_t fits into fixnum.
272 (lo_time): Use int, not EMACS_INT, when int suffices.
273 (lisp_time_argument): Check for usec out of range.
274 (Fencode_time): Don't assume fixnum fits in int.
275 (Fuser_login_name, Fuser_full_name): Signal an error
276 if a uid argument is out of range, rather than relying on
278 (Fformat_time_string): Remove now-unnecessary check.
279 lisp_time_argument checks for out-of-range usec now.
280 Use ptrdiff_t, not size_t, where ptrdiff_t will do.
281 * emacs.c (gdb_valbits, gdb_gctypebits): Now int, not EMACS_INT.
282 (gdb_data_seg_bits): Now uintptr_t, not EMACS_INT.
283 (PVEC_FLAG, gdb_array_mark_flag): Now ptrdiff_t, not EMACS_INT.
284 (init_cmdargs, Fdump_emacs):
285 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
286 (Fkill_emacs): Don't assume fixnum fits in int; instead, take just
287 the bottom (typically) 32 bits of the fixnum.
288 * eval.c (specpdl_size, call_debugger):
289 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
290 (when_entered_debugger, Fbacktrace_debug):
291 Don't assume fixnum can fit in int.
292 (Fdefvaralias, Fdefvar): Do not attempt to compute the address of
293 the object just before a buffer; this is not portable.
294 (FletX, Flet, Funwind_protect, do_autoload, Feval, funcall_lambda)
295 (grow_specpdl, unbind_to):
296 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
297 (Fapply, apply_lambda): Don't assume ptrdiff_t can hold fixnum.
298 (grow_specpdl): Simplify allocation by using xpalloc.
299 (Fprog1, Fprog2): Don't assume list length fits in int. Simplify.
300 * fileio.c (Ffind_file_name_handler, Fcopy_file, Frename_file)
301 (Finsert_file_contents, Fwrite_region, Fdo_auto_save):
302 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
303 (Ffind_file_name_handler, non_regular_inserted, Finsert_file_contents)
305 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
306 (Fcopy_file, non_regular_nbytes, read_non_regular)
307 (Finsert_file_contents):
308 Use int, not EMACS_INT, where int is wide enough.
309 (READ_BUF_SIZE): Verify that it fits in int.
310 (Finsert_file_contents): Check that counts are in proper range,
311 rather than assuming fixnums fit into ptrdiff_t etc.
312 Don't assume fixnums fit into int.
313 * floatfns.c (Fexpt): Avoid undefined signed * signed overflow.
314 * fns.c (Fcompare_strings, Fstring_lessp, struct textprop_rec, concat)
315 (string_char_byte_cache_charpos, string_char_byte_cache_bytepos)
316 (string_char_to_byte, string_byte_to_char)
317 (string_make_multibyte, string_to_multibyte)
318 (string_make_unibyte, Fstring_as_unibyte, Fstring_as_multibyte)
319 (Fstring_to_unibyte, Fsubstring, Fsubstring_no_properties)
320 (substring_both, Fdelete, internal_equal, Ffillarray)
321 (Fclear_string, mapcar1)
322 (Fbase64_encode_region, Fbase64_encode_string, base64_encode_1)
323 (Fbase64_decode_region, Fbase64_decode_string, base64_decode_1)
324 (larger_vector, make_hash_table, maybe_resize_hash_table)
325 (hash_lookup, hash_remove_from_table, hash_clear, sweep_weak_table)
326 (Fmaphash, secure_hash):
327 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
328 (concat): Check for string index and length overflow.
329 (Fmapconcat): Don't assume fixnums fit into ptrdiff_t.
331 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
332 (larger_vector): New API (vec, incr_min, size_max) replaces old
333 one (vec, new_size, init). This catches size overflow.
334 INIT was removed because it was always Qnil.
336 (INDEX_SIZE_BOUND): New macro, which calculates more precisely
337 the upper bound on a hash table index size.
338 (make_hash_table, maybe_resize_hash_table): Use it.
339 (secure_hash): Computer start_byte and end_byte only after
340 they're known to be in ptrdiff_t range.
341 * font.c (font_intern_prop, font_at, font_range, Ffont_shape_gstring)
342 (Ffont_get_glyphs, Ffont_at):
343 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
344 (font_style_to_value, font_prop_validate_style, font_expand_wildcards)
345 (Flist_fonts, Fopen_font):
346 Don't assume fixnum can fit in int.
347 (check_gstring): Don't assume index can fit in int.
348 (font_match_p): Check that fixnum is a character, not a nonnegative
349 fixnum, since the later code needs to stuff it into an int.
350 (font_find_for_lface): Use SAFE_ALLOCA_LISP, not alloca.
351 (font_fill_lglyph_metrics): Use unsigned, not EMACS_INT, to avoid
352 conversion overflow issues.
353 (Fopen_font): Check for integer out of range.
354 (Ffont_get_glyphs): Don't assume index can fit in int.
355 * font.h: Adjust decls to match defn changes elsewhere.
356 * fontset.c (reorder_font_vector): Redo score calculation to avoid
358 (num_auto_fontsets, fontset_from_font): Use ptrdiff_t, not
359 printmax_t, where ptrdiff_t is wide enough.
360 (Finternal_char_font):
361 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
362 * frame.c (Fset_mouse_position, Fset_mouse_pixel_position)
363 (Fset_frame_height, Fset_frame_width, Fset_frame_size)
364 (Fset_frame_position, x_set_frame_parameters)
365 (x_set_line_spacing, x_set_border_width)
366 (x_set_internal_border_width, x_set_alpha, x_figure_window_size):
367 Check that fixnums are in proper range for system types.
368 (frame_name_fnn_p, Fframe_parameter, Fmodify_frame_parameters):
369 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
370 (Fmodify_frame_parameters): Don't assume fixnum fits in int.
371 Use SAFE_ALLOCA_LISP, not alloca.
372 * frame.h (struct frame): Use intptr_t, not EMACS_INT, where
373 intptr_t is wide enough.
374 * fringe.c (lookup_fringe_bitmap, get_logical_fringe_bitmap)
375 (Fdefine_fringe_bitmap): Don't assume fixnum fits in int.
376 (Ffringe_bitmaps_at_pos): Don't assume index fits in int.
377 Check for fixnum out of range.
378 * ftfont.c (ftfont_list): Don't assume index fits in int.
379 Check that fixnums are in proper range for system types.
380 (ftfont_shape_by_flt):
381 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
382 * gnutls.c (emacs_gnutls_write, emacs_gnutls_read):
383 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
384 (Fgnutls_error_fatalp, Fgnutls_error_string, Fgnutls_boot):
385 Check that fixnums are in proper range for system types.
386 * gnutls.h: Adjust decls to match defn changes elsewhere.
387 * gtkutil.c (xg_dialog_run):
388 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
389 (update_frame_tool_bar):
390 Check that fixnums are in proper range for system types.
391 * image.c (parse_image_spec): Redo count calculation to avoid overflow.
392 (lookup_image): Check that fixnums are in range for system types.
393 * indent.c (last_known_column, last_known_column_point):
394 (current_column_bol_cache):
395 (skip_invisible, current_column, check_display_width):
396 (check_display_width, scan_for_column, current_column_1)
397 (Findent_to, Fcurrent_indentation, position_indentation)
398 (indented_beyond_p, Fmove_to_column, compute_motion):
399 (Fcompute_motion, Fvertical_motion):
400 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
401 (last_known_column_modified): Use EMACS_INT, not int.
402 (check_display_width):
404 Check that fixnums and floats are in proper range for system types.
405 (compute_motion): Don't assume index or fixnum fits in int.
406 (compute_motion, Fcompute_motion):
407 Use int, not EMACS_INT, when it is wide enough.
408 (vmotion): Omit local var start_hpos that is always 0; that way
409 we don't need to worry about overflow in expressions involving it.
410 * indent.h: Adjust decls to match defn changes elsewhere.
412 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
413 Use int, not EMACS_INT, where int is wide enough.
414 Remove unused members ovstring_chars_done and tab_offset;
416 * insdel.c (move_gap, move_gap_both, gap_left, gap_right)
417 (adjust_markers_for_delete, adjust_markers_for_insert, adjust_point)
418 (adjust_markers_for_replace, make_gap_larger, make_gap_smaller)
419 (make_gap, copy_text, insert, insert_and_inherit)
420 (insert_before_markers, insert_before_markers_and_inherit)
421 (insert_1, count_combining_before, count_combining_after)
422 (insert_1_both, insert_from_string)
423 (insert_from_string_before_markers, insert_from_string_1)
424 (insert_from_gap, insert_from_buffer, insert_from_buffer_1)
425 (adjust_after_replace, adjust_after_insert, replace_range)
426 (replace_range_2, del_range, del_range_1, del_range_byte)
427 (del_range_both, del_range_2, modify_region)
428 (prepare_to_modify_buffer, signal_before_change)
429 (signal_after_change, Fcombine_after_change_execute):
430 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
431 * intervals.c (traverse_intervals, rotate_right, rotate_left)
432 (balance_an_interval, split_interval_right, split_interval_left)
433 (find_interval, next_interval, update_interval)
434 (adjust_intervals_for_insertion, delete_node, delete_interval)
435 (interval_deletion_adjustment, adjust_intervals_for_deletion)
436 (static_offset_intervals, offset_intervals)
437 (merge_interval_right, merge_interval_left, make_new_interval)
438 (graft_intervals_into_buffer, temp_set_point_both)
439 (temp_set_point, set_point, adjust_for_invis_intang)
440 (set_point_both, move_if_not_intangible, get_property_and_range)
441 (get_local_map, copy_intervals, copy_intervals_to_string)
442 (compare_string_intervals, set_intervals_multibyte_1):
443 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
444 * intervals.h: Adjust decls to match defn changes elsewhere.
446 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
447 * keyboard.c (this_command_key_count, this_single_command_key_start)
448 (before_command_key_count, before_command_echo_length, echo_now)
449 (echo_length, recursive_edit_1, Frecursive_edit, Ftrack_mouse)
450 (command_loop_1, safe_run_hooks, read_char, timer_check_2)
451 (menu_item_eval_property, read_key_sequence, Fread_key_sequence)
452 (Fread_key_sequence_vector, Fexecute_extended_command, Fsuspend_emacs):
453 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
454 (last_non_minibuf_size, last_point_position, echo_truncate)
455 (command_loop_1, adjust_point_for_property, read_char, gen_help_event)
456 (make_lispy_position, make_lispy_event, parse_modifiers_uncached)
457 (parse_modifiers, modify_event_symbol, Fexecute_extended_command)
458 (stuff_buffered_input):
459 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
460 (last_auto_save, command_loop_1, read_char):
461 Use EMACS_INT, not int, to avoid integer overflow.
462 (record_char): Avoid overflow in total_keys computation.
463 (parse_modifiers_uncached): Redo index calculation to avoid overflow.
464 * keyboard.h: Adjust decls to match defn changes elsewhere.
465 * keymap.c (Fdefine_key, Fcurrent_active_maps, accessible_keymaps_1)
466 (Fkey_description, Fdescribe_vector, Flookup_key):
467 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
468 (click_position): New function, to check that positions are in range.
469 (Fcurrent_active_maps):
471 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
472 (Faccessible_keymaps, Fkey_description):
473 (preferred_sequence_p):
474 Don't assume fixnum can fit into int.
475 (Fkey_description): Use SAFE_ALLOCA_LISP, not alloca.
476 Check for integer overflow in size calculations.
477 (Ftext_char_description): Use CHECK_CHARACTER, not CHECK_NUMBER, to
478 avoid mishandling large integers.
479 * lisp.h: Adjust decls to match defn changes elsewhere.
480 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, struct Lisp_String)
481 (struct vectorlike_header, struct Lisp_Subr, struct Lisp_Hash_Table)
482 (struct Lisp_Marker):
483 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
484 (clip_to_bounds): Now an inline function, moved here from editfns.c.
485 (GLYPH_CODE_P): Check for overflow in system types, subsuming the
486 need for GLYPH_CODE_CHAR_VALID_P and doing proper checking ourselves.
488 (GLYPH_CODE_CHAR, GLYPH_CODE_FACE):
489 Assume the arg has valid form, since it always does.
490 (TYPE_RANGED_INTEGERP): Avoid bug when checking against a wide
491 unsigned integer system type.
492 (CHECK_RANGED_INTEGER, CHECK_TYPE_RANGED_INTEGER): New macros.
493 (struct catchtag, specpdl_size, SPECPDL_INDEX, USE_SAFE_ALLOCA):
494 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
495 (struct catchtag): Use EMACS_INT, not int, since it may be a fixnum.
496 (duration_to_sec_usec): New decl.
497 * lread.c (read_from_string_index, read_from_string_index_byte)
498 (read_from_string_limit, readchar, unreadchar, openp)
499 (read_internal_start, read1, oblookup):
500 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
501 (Fload, readevalloop, Feval_buffer, Feval_region):
502 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
503 (openp): Check for out-of-range argument to 'access'.
504 (read1): Use int, not EMACS_INT, where int is wide enough.
505 Don't assume fixnum fits into int.
506 Fix off-by-one error that can read outside a buffer.
507 (read_filtered_event): Use duration_to_sec_usec
508 to do proper overflow checking on durations.
509 * macros.c (Fstart_kbd_macro): Use xpalloc to check for overflow
511 (Fexecute_kbd_macro):
512 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
513 * marker.c (cached_charpos, cached_bytepos, CONSIDER)
514 (byte_char_debug_check, buf_charpos_to_bytepos, verify_bytepos)
515 (buf_bytepos_to_charpos, Fset_marker, set_marker_restricted)
516 (set_marker_both, set_marker_restricted_both, marker_position)
517 (marker_byte_position, Fbuffer_has_markers_at):
518 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
519 (Fset_marker, set_marker_restricted): Don't assume fixnum fits in int.
520 * menu.c (ensure_menu_items): Renamed from grow_menu_items.
521 It now merely ensures that the menu is large enough, without
522 necessarily growing it, as this avoids some integer overflow issues.
524 (keymap_panes, parse_single_submenu, Fx_popup_menu):
525 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
526 (parse_single_submenu, Fx_popup_menu): Don't assume fixnum fits in int.
527 Use SAFE_ALLOCA_LISP, not alloca.
528 (find_and_return_menu_selection): Avoid unnecessary casts of pointers
529 to EMACS_INT. Check that fixnums are in proper range for system types.
530 * minibuf.c (minibuf_prompt_width, string_to_object)
531 (Fminibuffer_contents, Fminibuffer_contents_no_properties)
532 (Fminibuffer_completion_contents, Ftry_completion, Fall_completions):
533 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
534 (get_minibuffer, read_minibuf_unwind):
535 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
536 (read_minibuf): Omit unnecessary arg BACKUP_N, which is always nil;
537 this simplifies overflow checking. All callers changed.
538 (read_minibuf, Fread_buffer, Ftry_completion, Fall_completions)
540 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
541 * nsfns.m (check_ns_display_info): Don't assume fixnum fits in long.
542 (x_set_menu_bar_lines, x_set_tool_bar_lines, Fx_create_frame):
543 Check that fixnums are in proper range for system types.
544 (Fx_create_frame, Fx_show_tip):
545 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
546 * nsfont.m (ns_findfonts, nsfont_list_family):
547 Don't assume fixnum fits in long.
548 * nsmenu.m (ns_update_menubar, ns_menu_show, ns_popup_dialog):
549 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
550 (ns_update_menubar): Use intptr_t, not EMACS_INT, when intptr_t is
552 * nsselect.m (ns_get_local_selection, clean_local_selection_data):
553 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
554 * print.c (print_buffer_size, print_buffer_pos, print_buffer_pos_byte)
555 (PRINTDECLARE, PRINTPREPARE):
556 (strout, print_string):
557 (print, print_preprocess, print_check_string_charset_prop)
559 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
561 (temp_output_buffer_setup, Fprin1_to_string, print_object):
562 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
563 (PRINTPREPARE): Use int, not ptrdiff_t, where int is wide enough.
564 (printchar, strout): Use xpalloc to catch size calculation overflow.
565 (Fexternal_debugging_output): Don't overflow EMACS_INT->int conversion.
566 (print_error_message): Use SAFE_ALLOCA, not alloca.
567 (print_object): Use int, not EMACS_INT, where int is wide enough.
568 (print_depth, new_backquote_output, print_number_index):
569 Use ptrdiff_t, not int, where int might not be wide enough.
570 * process.c (Fdelete_process): Don't assume pid fits into EMACS_INT.
571 (Fset_process_window_size, Fformat_network_address)
572 (get_lisp_to_sockaddr_size, set_socket_option, Fmake_network_process)
574 Check that fixnums are in proper range for system types.
575 (Fsignal_process): Simplify by avoiding a goto.
576 Check for process-ids out of pid_t range rather than relying on
578 (process_tick, update_tick): Use EMACS_INT, not int.
579 (Fformat_network_address, read_process_output, send_process)
580 (Fprocess_send_region, status_notify):
581 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
582 (Fformat_network_address, Fmake_serial_process, Fmake_network_process)
583 (wait_reading_process_output, read_process_output, exec_sentinel):
584 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
585 (conv_lisp_to_sockaddr): Don't assume fixnums fit into int.
586 (Faccept_process_output): Use duration_to_sec_usec to do proper
587 overflow checking on durations.
588 (emacs_get_tty_pgrp, Fprocess_running_child_p, process_send_signal):
589 Don't assume pid_t fits in int.
590 * puresize.h (PURESIZE_RATIO): Shrink this to 8/6 on 32-bit hosts
591 configured --with-wide-int.
592 * scroll.c (calculate_scrolling, calculate_direct_scrolling)
593 (line_ins_del): Use int, not EMACS_INT, where int is wide enough.
594 * search.c (looking_at_1, string_match_1):
595 (fast_string_match, fast_c_string_match_ignore_case)
596 (fast_string_match_ignore_case, fast_looking_at, scan_buffer)
597 (scan_newline, find_before_next_newline, search_command)
598 (trivial_regexp_p, search_buffer, simple_search, boyer_moore)
599 (set_search_regs, wordify):
602 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
603 (string_match_1, search_buffer, set_search_regs):
605 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
606 (wordify): Check for overflow in size calculation.
607 (Freplace_match): Avoid potential buffer overflow in search_regs.start.
608 (Fset_match_data): Don't assume fixnum fits in ptrdiff_t.
609 Check that fixnums are in proper range for system types.
610 * sound.c (struct sound_device)
611 (wav_play, au_play, vox_write, alsa_period_size, alsa_write):
612 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
613 (Fplay_sound_internal):
614 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
615 * syntax.c (struct lisp_parse_state, find_start_modiff)
616 (Finternal_describe_syntax_value, scan_lists, scan_sexps_forward):
617 (Fparse_partial_sexp):
618 Don't assume fixnums can fit in int.
619 (struct lisp_parse_state, find_start_pos, find_start_value)
620 (find_start_value_byte, find_start_begv)
621 (update_syntax_table, char_quoted, dec_bytepos)
622 (find_defun_start, prev_char_comend_first, back_comment):
623 (scan_words, skip_chars, skip_syntaxes, forw_comment, Fforward_comment)
624 (scan_lists, Fbackward_prefix_chars, scan_sexps_forward):
625 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
626 (Finternal_describe_syntax_value): Check that match_lisp is a
627 character, not an integer, since the code stuffs it into int.
628 (scan_words, scan_sexps_forward):
629 Check that fixnums are in proper range for system types.
631 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
632 (scan_sexps_forward):
633 Use CHARACTERP, not INTEGERP, since the value must fit into int.
634 (Fparse_partial_sexp): Fix doc; element 8 is not ignored.
635 * syntax.h: Adjust decls to match defn changes elsewhere.
637 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
638 (SETUP_SYNTAX_TABLE_FOR_OBJECT): Use PTRDIFF_MAX, not
639 MOST_POSITIVE_FIXNUM.
640 * sysdep.c (wait_for_termination_1, wait_for_termination)
641 (interruptible_wait_for_termination, mkdir):
642 Don't assume pid_t fits in int; on 64-bit AIX pid_t is 64-bit.
643 (emacs_read, emacs_write):
644 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
645 (system_process_attributes): Don't assume uid_t, gid_t, EMACS_INT,
646 and double all fit in int.
647 * term.c (set_tty_color_mode):
648 Check that fixnums are in proper range for system types.
649 * termhooks.h (struct input_event):
650 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
651 * textprop.c (validate_interval_range, interval_of)
652 (Fadd_text_properties, set_text_properties_1)
653 (Fremove_text_properties, Fremove_list_of_text_properties)
654 (Ftext_property_any, Ftext_property_not_all)
655 (copy_text_properties, text_property_list, extend_property_ranges)
656 (verify_interval_modification):
657 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
658 (Fnext_single_char_property_change)
659 (Fprevious_single_char_property_change):
660 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
661 (copy_text_properties):
662 Check for integer overflow in index calculation.
663 * undo.c (last_boundary_position, record_point, record_insert)
664 (record_delete, record_marker_adjustment, record_change)
665 (record_property_change):
666 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
667 (truncate_undo_list, Fprimitive_undo): Don't assume fixnum fits in int.
668 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
669 * w32fns.c (Fx_create_frame, x_create_tip_frame, Fx_show_tip)
670 (Fx_hide_tip, Fx_file_dialog):
671 * w32menu.c (set_frame_menubar):
672 Use ptrdiff_t, not int, for consistency with rest of code.
673 * window.c (window_scroll_preserve_hpos, window_scroll_preserve_vpos)
674 (select_window, Fdelete_other_windows_internal)
675 (window_scroll_pixel_based, window_scroll_line_based)
676 (Frecenter, Fset_window_configuration):
677 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
678 (Fset_window_hscroll, run_window_configuration_change_hook)
679 (set_window_buffer, temp_output_buffer_show, scroll_command)
680 (Fscroll_other_window, Frecenter):
681 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
682 (Fwindow_line_height, window_scroll, Fscroll_left, Fscroll_right):
683 Don't assume fixnum fits in int.
684 (Fset_window_scroll_bars):
685 Check that fixnums are in proper range for system types.
686 * xdisp.c (help_echo_pos, pos_visible_p, string_pos_nchars_ahead)
687 (string_pos, c_string_pos, number_of_chars, init_iterator)
688 (in_ellipses_for_invisible_text_p, init_from_display_pos)
689 (compute_stop_pos, next_overlay_change, compute_display_string_pos)
690 (compute_display_string_end, handle_face_prop)
691 (face_before_or_after_it_pos, handle_invisible_prop)
692 (handle_display_prop, handle_display_spec, handle_single_display_spec)
693 (display_prop_intangible_p, string_buffer_position_lim)
694 (string_buffer_position, handle_composition_prop, load_overlay_strings)
695 (get_overlay_strings_1, get_overlay_strings)
696 (iterate_out_of_display_property, forward_to_next_line_start)
697 (back_to_previous_visible_line_start, reseat, reseat_to_string)
698 (get_next_display_element, set_iterator_to_next)
699 (get_visually_first_element, compute_stop_pos_backwards)
700 (handle_stop_backwards, next_element_from_buffer)
701 (move_it_in_display_line_to, move_it_in_display_line)
702 (move_it_to, move_it_vertically_backward, move_it_by_lines)
703 (add_to_log, message_dolog, message_log_check_duplicate)
704 (message2, message2_nolog, message3, message3_nolog
705 (with_echo_area_buffer, display_echo_area_1, resize_mini_window_1)
706 (current_message_1, truncate_echo_area, truncate_message_1)
707 (set_message, set_message_1, store_mode_line_noprop)
708 (hscroll_window_tree, debug_delta, debug_delta_bytes, debug_end_vpos)
709 (text_outside_line_unchanged_p, check_point_in_composition)
710 (reconsider_clip_changes)
711 (redisplay_internal, set_cursor_from_row, try_scrolling)
712 (try_cursor_movement, set_vertical_scroll_bar, redisplay_window)
713 (redisplay_window, find_last_unchanged_at_beg_row)
714 (find_first_unchanged_at_end_row, row_containing_pos, try_window_id)
715 (trailing_whitespace_p, find_row_edges, display_line)
716 (RECORD_MAX_MIN_POS, Fcurrent_bidi_paragraph_direction)
717 (display_mode_element, store_mode_line_string)
718 (pint2str, pint2hrstr, decode_mode_spec)
719 (display_count_lines, display_string, draw_glyphs)
720 (x_produce_glyphs, x_insert_glyphs)
721 (rows_from_pos_range, mouse_face_from_buffer_pos)
722 (fast_find_string_pos, mouse_face_from_string_pos)
723 (note_mode_line_or_margin_highlight, note_mouse_highlight):
724 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
725 (safe_call, init_from_display_pos, handle_fontified_prop)
726 (handle_single_display_spec, load_overlay_strings)
727 (with_echo_area_buffer, setup_echo_area_for_printing)
728 (display_echo_area, echo_area_display)
729 (x_consider_frame_title, prepare_menu_bars, update_menu_bar)
730 (update_tool_bar, hscroll_window_tree, redisplay_internal)
731 (redisplay_window, dump_glyph_row, display_mode_line)
732 (Fformat_mode_line, decode_mode_spec, on_hot_spot_p):
733 (handle_display_spec, display_prop_string_p):
734 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
735 (handle_single_display_spec, build_desired_tool_bar_string)
736 (redisplay_tool_bar, scroll_window_tree, Fdump_glyph_matrix)
737 (get_specified_cursor_type):
738 Check that fixnums are in proper range for system types.
739 (struct overlay_entry, resize_mini_window, Fdump_glyph_row)
741 Don't assume fixnums fit in int.
742 (compare_overlay_entries):
743 Avoid mishandling comparisons due to subtraction overflow.
744 (load_overlay_strings): Use SAFE_NALLOCA, not alloca.
745 (last_escape_glyph_face_id, last_glyphless_glyph_face_id):
746 (handle_tool_bar_click):
747 Use int, not unsigned, since we prefer signed and the signedness
749 (get_next_display_element, next_element_from_display_vector):
750 Use int, not EMACS_INT, when int is wide enough.
751 (start_hourglass): Use duration_to_sec_usec to do proper
752 overflow checking on durations.
753 * xfaces.c (Fbitmap_spec_p):
754 Check that fixnums are in proper range for system types.
755 (compare_fonts_by_sort_order):
756 Avoid mishandling comparisons due to subtraction overflow.
757 (Fx_family_fonts, realize_basic_faces):
758 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
760 Don't assume fixnum fits in int.
761 Use SAFE_ALLOCA_LISP, not alloca.
762 (merge_face_heights): Remove unnecessary cast to EMACS_INT.
763 (Finternal_make_lisp_face): Don't allocate more than MAX_FACE_ID.
764 (face_at_buffer_position, face_for_overlay_string)
765 (face_at_string_position):
766 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
767 (merge_faces): Use int, not EMACS_INT, where int is wide enough.
768 * xfns.c (x_set_menu_bar_lines, x_set_tool_bar_lines, x_icon_verify)
770 Check that fixnums are in proper range for system types.
771 (Fx_create_frame, x_create_tip_frame, Fx_show_tip)
772 (Fx_hide_tip, Fx_file_dialog, Fx_select_font):
773 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
774 (Fx_change_window_property): Don't assume fixnums fit in int.
775 * xfont.c (xfont_chars_supported):
776 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
777 * xmenu.c (Fx_popup_dialog, set_frame_menubar)
778 (create_and_show_popup_menu, create_and_show_dialog, xmenu_show):
779 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
780 * xml.c (parse_region):
781 * xrdb.c (magic_file_p):
782 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
783 * xselect.c (TRACE1): Don't assume pid_t promotes to int.
784 (x_get_local_selection, x_reply_selection_request)
785 (x_handle_selection_request, wait_for_property_change):
786 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
787 (selection_data_to_lisp_data): Use short, not EMACS_INT, where
788 short is wide enough.
789 (x_send_client_event): Don't assume fixnum fits in int.
790 * xterm.c (x_x_to_emacs_modifiers):
791 Don't assume EMACS_INT overflows nicely into int.
792 (x_emacs_to_x_modifiers): Use EMACS_INT, not int, because values
794 (handle_one_xevent): NATNUMP can eval its arg twice.
795 (x_connection_closed):
796 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
797 * xterm.h: Adjust decls to match defn changes elsewhere.
798 (struct scroll_bar): Use struct vectorlike_header
799 rather than rolling our own approximation.
800 (SCROLL_BAR_VEC_SIZE): Remove; not used.
802 2012-05-25 Stefan Monnier <monnier@iro.umontreal.ca>
804 * fileio.c, character.h: Minor style tweaks.
806 2012-05-24 Dmitry Antipov <dmantipov@yandex.ru>
808 * window.h (clip_changed): Remove useless declaration.
810 2012-05-22 Juanma Barranquero <lekktu@gmail.com>
812 * makefile.w32-in: Follow-up to 2012-05-22T16:20:27Z!eggert@cs.ucla.edu.
813 (TAGS, TAGS-gmake, CONFIG_H): Remove further references to m/intel386.h.
815 2012-05-22 Paul Eggert <eggert@cs.ucla.edu>
818 This directory predates autoconf and is no longer needed nowadays.
819 Move its few remaining bits of functionality to where they're needed.
820 * m/README, m/alpha.h, m/amdx86-64.h, m/ia64.h, m/ibmrs6000.h:
821 * m/ibms390x.h, m/intel386.h, m/m68k.h, m/macppc.h, m/sparc.h:
822 * m/template.h: Remove.
823 * Makefile.in (M_FILE): Remove. All uses removed.
824 * alloc.c (POINTERS_MIGHT_HIDE_IN_OBJECTS):
825 * lisp.h (USE_LSB_TAG):
826 * mem-limits.h (EXCEEDS_LISP_PTR):
827 Use VAL_MAX, not VALBITS, in #if.
828 * lisp.h (EMACS_INT_MAX): New macro, useful in #if.
829 (EMACS_UINT): Define unconditionally now.
830 (BITS_PER_CHAR, BITS_PER_SHORT, BITS_PER_INT, BITS_PER_LONG)
831 (BITS_PER_EMACS_INT): New constants, replacing
832 what used to be in config.h, but not useful in #if.
833 (GCTYPEBITS, VALBITS): Define unconditionally, since m/* files don't
834 define them any more.
835 (VAL_MAX): New macro.
837 * puresize.h (PURESIZE_RATIO): Use EMACS_INT_MAX, not
838 BITS_PER_EMACS_INT, in #if.
839 * s/aix4-2.h (BROKEN_FIONREAD, BROKEN_SIGAIO, BROKEN_SIGPTY)
840 (BROKEN_SIGPOLL): Move here from m/ibmrs6000.h, which was removed.
841 * s/gnu-linux.h (ULIMIT_BREAK_VALUE) [__i386__]:
842 * s/ms-w32.h (DATA_START):
843 Move here from removed file m/intel386.h.
844 * s/gnu.h (NLIST_STRUCT): Remove undef; 'configure' does this.
845 * s/irix6-5.h (_LP64): Remove; lisp.h no longer needs this.
847 2012-05-21 Paul Eggert <eggert@cs.ucla.edu>
850 * alloc.c, buffer.c, lisp.h: Replace POINTER_TYPE with void.
851 * alloc.c (overrun_check_malloc, overrun_check_realloc, xmalloc)
853 * buffer.c (mmap_free_1, mmap_enlarge): Omit needless casts.
854 * editfns.c, fns.c, gmalloc.c, insdel.c, sysdep.c, termcap.c (NULL):
855 * textprop.c, tparam.c (NULL): Remove.
856 * ralloc.c, vm-limit.c (POINTER): Assume void * works.
857 * regex.c (SIGN_EXTEND_CHAR): Assume signed char works.
858 * regex.h (_RE_ARGS): Remove. All uses rewritten to use prototypes.
859 * unexelf.c (ElfBitsW): Assume c89 preprocessor or better.
860 * xterm.c (input_signal_count): Assume volatile works.
862 2012-05-21 Ken Brown <kbrown@cornell.edu>
864 * xgselect.c (xg_select): Fix first argument in call to 'select'
867 2012-05-20 Ken Brown <kbrown@cornell.edu>
869 * gmalloc.c (_free_internal_nolock, _realloc_internal_nolock)
870 [CYGWIN]: Cast ptr to (char *) before comparing to _heapbase.
872 2012-05-19 Ken Brown <kbrown@cornell.edu>
874 * xfns.c (x_in_use): Remove `static' qualifier.
875 * xterm.h (x_in_use): Declare.
876 * xgselect.c: Include xterm.h.
877 (xg_select): Test `x_in_use' instead of `inhibit_window_system'
878 and `display_arg' (bug#9754).
880 2012-05-19 Paul Eggert <eggert@cs.ucla.edu>
882 * s/ms-w32.h (HAVE_GETDOMAINNAME): Remove; not needed.
884 * m/vax.h: Remove; no longer needed since HAVE_FTIME is being removed.
885 * s/ms-w32.h (HAVE_FTIME): Remove; not needed.
887 2012-05-18 Eli Zaretskii <eliz@gnu.org>
889 Fix compilation with -DGLYPH_DEBUG=1 on MS-Windows.
891 * w32term.c [GLYPH_DEBUG]: Add prototype for x_check_font.
892 (x_check_font) [GLYPH_DEBUG]: New function, copied from xterm.c
894 * w32fns.c (unwind_create_frame) [GLYPH_DEBUG]: Fix broken
895 reference to image_cache->refcount.
896 (x_create_tip_frame): Fix broken use of FRAME_IMAGE_CACHE.
898 2012-05-17 Juri Linkov <juri@jurta.org>
900 * search.c (Fword_search_regexp, Fword_search_backward)
901 (Fword_search_forward, Fword_search_backward_lax)
902 (Fword_search_forward_lax): Move functions to isearch.el
903 (bug#10145, bug#11381).
905 2012-05-16 Paul Eggert <eggert@cs.ucla.edu>
907 * xgselect.c (xg_select): Just invoke 'select' if -nw (Bug#9754).
909 2012-05-15 Stefan Monnier <monnier@iro.umontreal.ca>
911 * lread.c (init_obarray): Declare Qt and Qnil as special.
913 2012-05-14 Glenn Morris <rgm@gnu.org>
915 * nsterm.m (ns_init_paths): Fix typo ("libexec" not "lib-exec").
916 Put "libexec" before "bin", for the sake of init_callproc_1.
918 2012-05-14 Paul Eggert <eggert@cs.ucla.edu>
920 * keyboard.c (kbd_buffer_get_event) [!HAVE_DBUS]: Omit unused local.
922 * unexaix.c: Port to more-recent AIX compilers.
923 (report_error, report_error_1, make_hdr, copy_sym)
924 (mark_x, adjust_lnnoptrs, unrelocate_symbols):
925 Make arguments const char *, not char *, to avoid violations of C
926 standard and to fix some AIX warnings reported by Gilles Pion.
928 2012-05-14 Eli Zaretskii <eliz@gnu.org>
930 * xdisp.c (handle_stop): Don't call get_overlay_strings_1 if we
931 already have overlays loaded.
932 (handle_single_display_spec): Before returning without displaying
933 fringe bitmap, synchronize the bidi iterator with the main display
934 iterator, by calling iterate_out_of_display_property.
935 (iterate_out_of_display_property): Detect buffer iteration by
936 testing that it->string is a Lisp string.
937 (get_next_display_element): When the current object is exhausted,
938 and there's something on it->stack, call set_iterator_to_next to
939 proceed with what's on the stack, instead of returning zero.
940 (set_iterator_to_next): If called at the end of a Lisp string,
941 proceed to consider_string_end without incrementing string
942 position. Don't increment display vector index past the end of
943 the display vector. (Bug#11417)
944 (pos_visible_p): Don't report a position visible when move_it_to
945 stopped at the last line of window, which happens to be scanned
946 backwards by the bidi iteration. (Bug#11464)
948 2012-05-14 Eli Zaretskii <eliz@gnu.org>
950 * xdisp.c (handle_single_display_spec): Return 1 for left-margin
951 and right-margin display specs even if the spec is invalid or we
952 are on a TTY, and thus unable to display on the fringes. That's
953 because the text with the property will not be displayed anyway,
954 so we need to signal to the caller that this is a "replacing"
955 display spec. This fixes display when the spec is invalid or we
958 2012-05-14 Paul Eggert <eggert@cs.ucla.edu>
960 * unexaix.c (make_hdr): Fix typo in prototype.
961 This bug broke the build on AIX. Problem reported by Gilles Pion.
963 2012-05-14 Michael Albinus <michael.albinus@gmx.de>
965 * keyboard.c (kbd_buffer_get_event): Read special events also in
966 batch mode. (Bug#11415)
968 2012-05-12 Glenn Morris <rgm@gnu.org>
970 * ns.mk: Update for ns_appbindir no longer having trailing "/".
972 2012-05-12 Eli Zaretskii <eliz@gnu.org>
974 * lisp.mk (lisp): Add newcomment.elc.
976 2012-05-12 Glenn Morris <rgm@gnu.org>
978 * Makefile.in (MKDIR_P): New, set by configure.
979 * ns.mk (${ns_appdir}, ${ns_appbindir}Emacs): Use $MKDIR_P.
981 2012-05-11 Paul Eggert <eggert@cs.ucla.edu>
983 Remove unused function hourglass_started.
984 * dispextern.h (hourglass_started):
985 * w32fns.c (hourglass_started):
986 * xdisp.c (hourglass_started): Remove.
988 2012-05-10 Juanma Barranquero <lekktu@gmail.com>
990 * makefile.w32-in ($(BLD)/gmalloc.$(O), $(BLD)/w32menu.$(O)):
993 2012-05-10 Paul Eggert <eggert@cs.ucla.edu>
995 * xgselect.c (xg_select): Put maxfds+1 into a var.
996 This is slightly clearer, and pacifies Ubuntu 12.04 gcc.
998 * sound.c (DEFAULT_ALSA_SOUND_DEVICE): Define only if HAVE_ALSA.
1000 2012-05-10 Dave Abrahams <dave@boostpro.com>
1002 * filelock.c (syms_of_filelock): New boolean create-lockfiles.
1003 (lock_file): If create_lockfiles is 0, do nothing. (Bug#11227)
1005 2012-05-09 Michael Albinus <michael.albinus@gmx.de>
1007 * dbusbind.c (xd_registered_buses): New internal Lisp object.
1008 Rename all occurences of Vdbus_registered_buses to xd_registered_buses.
1009 (syms_of_dbusbind): Remove declaration of Vdbus_registered_buses.
1010 Initialize xd_registered_buses.
1012 2012-05-09 Paul Eggert <eggert@cs.ucla.edu>
1014 Untag more efficiently if USE_LSB_TAG.
1015 This is based on a proposal by YAMAMOTO Mitsuharu in
1016 <http://lists.gnu.org/archive/html/emacs-devel/2008-01/msg01876.html>.
1017 For an admittedly artificial (nth 8000 longlist) benchmark on
1018 Fedora 15 x86-64, this yields a 25% CPU speedup. Also, it shrinks
1019 Emacs's overall text size by 1%.
1020 * lisp.h (XUNTAG): New macro.
1021 (XCONS, XVECTOR, XSTRING, XSYMBOL, XFLOAT, XMISC, XPROCESS, XWINDOW)
1022 (XTERMINAL, XSUBR, XBUFFER, XCHAR_TABLE, XSUB_CHAR_TABLE, XBOOL_VECTOR)
1023 (XSETTYPED_PSEUDOVECTOR, XHASH_TABLE, TYPED_PSEUDOVECTORP): Use it.
1024 * eval.c (Fautoload):
1025 * font.h (XFONT_SPEC, XFONT_ENTITY, XFONT_OBJECT):
1026 * frame.h (XFRAME): Use XUNTAG.
1028 Port recent dbusbind.c changes to 32-bit --with-wide-int.
1029 * dbusbind.c (xd_append_arg, xd_retrieve_arg, Fdbus_message_internal):
1030 Remove unportable assumptions about print widths of types like
1032 (xd_get_connection_address, Fdbus_init_bus): Cast Emacs integer to
1033 intptr_t when converting between pointer and integer, to avoid GCC
1034 warnings about wrong width.
1036 2012-05-09 Eli Zaretskii <eliz@gnu.org>
1038 * w32proc.c (new_child): Force Windows to reserve only 64KB of
1039 stack for each reader_thread, instead of defaulting to 8MB
1040 determined by the linker. This avoids failures in creating
1041 subprocesses on Windows 7, see the discussion in this thread:
1042 http://lists.gnu.org/archive/html/emacs-devel/2012-03/msg00119.html.
1044 2012-05-07 Jérémy Compostella <jeremy.compostella@gmail.com>
1046 Fix up display of the *Minibuf-0* buffer in the mini window.
1047 * keyboard.c (read_char): Don't clear the echo area if there's no
1049 * xdisp.c (redisplay_internal): Redisplay the mini window (with the
1050 contents of *Minibuf-0*) if there's no message displayed in its stead.
1052 2012-05-07 Michael Albinus <michael.albinus@gmx.de>
1054 * dbusbind.c (XD_DEBUG_MESSAGE): Don't print message twice in
1057 2012-05-06 Chong Yidong <cyd@gnu.org>
1059 * lisp.mk (lisp): Update.
1061 2012-05-05 Jim Meyering <meyering@redhat.com>
1063 * w32font.c (fill_in_logfont): NUL-terminate a string (Bug#11372).
1065 2012-05-04 Stefan Monnier <monnier@iro.umontreal.ca>
1067 * data.c (PUT_ERROR): New macro.
1068 (syms_of_data): Use it. Add new error type `user-error'.
1069 * undo.c (user_error): New function.
1070 (Fprimitive_undo): Use it.
1071 * print.c (print_error_message): Adjust print style for `user-error'.
1072 * keyboard.c (user_error): New function.
1073 (Fexit_recursive_edit, Fabort_recursive_edit): Use it.
1075 2012-05-03 Paul Eggert <eggert@cs.ucla.edu>
1077 Do not limit current-time-string to years 1000..9999.
1078 * editfns.c (TM_YEAR_IN_ASCTIME_RANGE): Remove.
1079 (Fcurrent_time_string): Support any year that is supported by the
1080 underlying localtime representation. Don't use asctime, as it
1081 has undefined behavior for years outside the range -999..9999.
1083 2012-05-02 Paul Eggert <eggert@cs.ucla.edu>
1085 Fix race conditions involving setenv, gmtime, localtime, asctime.
1086 Without this fix, interrupts could mess up code that uses these
1087 nonreentrant functions, since setting TZ invalidates existing
1088 tm_zone or tzname values, and since most of these functions return
1089 pointers to static storage.
1090 * editfns.c (format_time_string, Fdecode_time, Fencode_time)
1091 (Fcurrent_time_string, Fcurrent_time_zone, Fset_time_zone_rule):
1092 Grow the critical sections to include not just invoking
1093 localtime/gmtime, but also accessing these functions' results
1094 including their tm_zone values if any, and any related TZ setting.
1095 (format_time_string): Last arg is now struct tm *, not struct tm **,
1096 so that the struct tm is saved in the critical section.
1097 All callers changed. Simplify allocation of initial buffer, partly
1098 motivated by the fact that memory allocation needs to be outside
1099 the critical section.
1101 2012-05-02 Dmitry Antipov <dmantipov@yandex.ru>
1103 * intervals.c (adjust_intervals_for_insertion): Initialize `newi'
1104 with RESET_INTERVAL.
1106 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer):
1107 Remove duplicated buffer name initialization.
1109 2012-05-02 Jim Meyering <jim@meyering.net>
1111 * xterm.c (x_term_init): Use memcpy instead of strncpy (Bug#11373).
1113 * xfns.c (x_window): Use xstrdup (Bug#11375).
1115 2012-05-02 Eli Zaretskii <eliz@gnu.org>
1117 * xdisp.c (pos_visible_p): If already at a newline from the
1118 display string before the 'while' loop, don't walk back the glyphs
1119 from it3.glyph_row. Solves assertion violation when the display
1120 string begins with a newline (egg.el). (Bug#11367)
1122 2012-05-01 Stefan Monnier <monnier@iro.umontreal.ca>
1124 * keyboard.c (Fexecute_extended_command, Vsuggest_key_bindings):
1127 2012-05-01 Glenn Morris <rgm@gnu.org>
1129 * syssignal.h: Remove reference to BROKEN_SIGINFO (last used in
1130 s/ptx4.h), BROKEN_SIGTSTP (last used in m/ustation.h, m/dpx2.h),
1131 and BROKEN_SIGURG (was in s/gnu-linux.h prior to 2008-02-10).
1132 All were removed before 23.1.
1134 * dispnew.c: Remove HAVE_LIBNCURSES test;
1135 it is always true on relevant platforms.
1137 * Makefile.in (LD_SWITCH_X_SITE_RPATH):
1138 Rename from LD_SWITCH_X_SITE_AUX_RPATH.
1140 * Makefile.in (LD_SWITCH_X_SITE_AUX): Remove; no longer used.
1142 2012-04-30 Andreas Schwab <schwab@linux-m68k.org>
1144 * .gdbinit (xpr): Remove checks for no longer existing misc types.
1145 (xintfwd, xboolfwd, xobjfwd, xbufobjfwd, xkbobjfwd, xbuflocal):
1148 2012-04-28 Paul Eggert <eggert@cs.ucla.edu>
1150 Do not avoid creating empty evaporating overlays (Bug#9642).
1151 * buffer.c (Fmove_overlay): Revert the change of 2012-04-23.
1152 That is, do not delete an evaporating overlay if it becomes
1153 empty after its bounds are adjusted to fit within its buffer.
1154 This fix caused other problems, and I'm reverting it until we get
1155 to the bottom of them.
1157 2012-04-27 Chong Yidong <cyd@gnu.org>
1159 * xselect.c (x_convert_selection): Initialize a pointer (Bug#11315).
1161 2012-04-27 Eli Zaretskii <eliz@gnu.org>
1163 * xdisp.c (pos_visible_p): If the window start position is beyond
1164 ZV, start the display from buffer beginning. Prevents assertion
1165 violation in init_iterator when the minibuffer window is scrolled
1168 * window.c (window_scroll_pixel_based): Likewise.
1170 2012-04-27 Chong Yidong <cyd@gnu.org>
1172 * keymap.c (where_is_internal): Doc fix (Bug#10872).
1174 2012-04-27 Glenn Morris <rgm@gnu.org>
1176 * fileio.c (Fcopy_file, Fset_file_selinux_context):
1177 Ignore ENOTSUP failures from setfilecon functions. (Bug#11245)
1179 2012-04-27 Eli Zaretskii <eliz@gnu.org>
1181 * dispnew.c (swap_glyph_pointers, copy_row_except_pointers):
1182 Don't overrun array limits of glyph row's used[] array. (Bug#11288)
1184 2012-04-26 Eli Zaretskii <eliz@gnu.org>
1186 * xdisp.c (IT_DISPLAYING_WHITESPACE): In addition to the loaded
1187 display element, check also the underlying string or buffer
1188 character. (Bug#11341)
1190 * w32menu.c: Include w32heap.h.
1191 (add_menu_item): If the call to AppendMenuW (via
1192 unicode_append_menu) fails, disable Unicode menus only if we are
1193 running on Windows 9X/Me.
1195 2012-04-24 Andreas Schwab <schwab@linux-m68k.org>
1197 * .gdbinit (xpr): Handle USE_2_TAGS_FOR_INTS.
1198 (xgetint): Add missing shift for LSB tags.
1200 2012-04-24 Martin Rudalics <rudalics@gmx.at>
1202 * keyboard.c (read_char): Don't wipe echo area for select window
1203 events: These might get delayed via `mouse-autoselect-window'
1206 2012-04-24 Juanma Barranquero <lekktu@gmail.com>
1208 * gnutls.c (init_gnutls_functions): Protect against (unlikely)
1209 manipulation of :loaded-from data.
1211 2012-04-23 Juanma Barranquero <lekktu@gmail.com>
1213 * gnutls.c (init_gnutls_functions): The value of :loaded-from is
1214 now a cons (bug#11311).
1216 2012-04-23 Paul Eggert <eggert@cs.ucla.edu>
1218 Do not create empty overlays with the evaporate property (Bug#9642).
1219 * buffer.c (Fmove_overlay): Delete an evaporating overlay
1220 if it becomes empty after its bounds are adjusted to fit within
1221 its buffer. Without this fix, in a nonempty buffer (let ((o
1222 (make-overlay 1 2))) (overlay-put o 'evaporate t) (move-overlay o 0 1))
1223 yields an empty overlay that has the evaporate property, which is
1224 not supposed to happen.
1226 Fix minor GTK3 problems found by static checking.
1227 * emacsgtkfixed.c (EMACS_TYPE_FIXED, EMACS_FIXED, EmacsFixed)
1228 (EmacsFixedPrivate, EmacsFixedClass, struct _EmacsFixed)
1229 (struct _EmacsFixedClass, emacs_fixed_get_type):
1230 Move decls here from emacsgtkfixed.h, since they needn't be public.
1231 (emacs_fixed_get_type): Now static.
1232 (emacs_fixed_class_init): Omit unused local.
1233 (emacs_fixed_child_type): Remove; unused.
1234 * emacsgtkfixed.h (EMACS_TYPE_FIXED, EMACS_FIXED, EmacsFixed)
1235 (EmacsFixedPrivate, EmacsFixedClass, struct _EmacsFixed)
1236 (struct _EmacsFixedClass): Move to emacsgtkfixed.c.
1237 (EMACS_FIXED_CLASS, EMACS_IS_FIXED, EMACS_IS_FIXED_CLASS)
1238 (EMACS_FIXED_GET_CLASS): Remove; unused.
1239 * gtkutil.c (xg_create_frame_widgets) [!HAVE_GTK3]: Omit unused local.
1241 * keyboard.c (handle_async_input): Define only if SYNC_INPUT || SIGIO.
1242 Problem reported by Juanma Barranquero for Windows -Wunused-function.
1244 2012-04-22 Paul Eggert <eggert@cs.ucla.edu>
1246 Modernize and clean up gmalloc.c to assume C89 (Bug#9119).
1247 * gmalloc.c (_MALLOC_INTERNAL, _MALLOC_H, _PP, __ptr_t)
1248 (__malloc_size_t, __malloc_ptrdiff_t):
1249 Remove. All uses removed, replaced by the definiens if needed,
1250 since we can assume C89 or better now.
1251 Include <stdint.h>, for PTRDIFF_MAX, uintptr_t.
1252 (protect_malloc_state, align, get_contiguous_space)
1253 (malloc_atfork_handler_prepare, malloc_atfork_handler_parent)
1254 (malloc_atfork_handler_child, malloc_enable_thread)
1255 (malloc_initialize_1, __malloc_initialize, morecore_nolock)
1256 (_malloc_internal_nolock, _malloc_internal, malloc, _malloc)
1257 (_free, _realloc, _free_internal_nolock, _free_internal, free, cfree)
1258 (special_realloc, _realloc_internal_nolock, _realloc_internal)
1259 (realloc, calloc, __default_morecore, memalign, valloc, checkhdr)
1260 (freehook, mallochook, reallochook, mabort, mcheck, mprobe):
1261 Define using prototypes, not old style.
1262 (align, _malloc_internal_nolock, _free_internal_nolock, memalign):
1263 Don't assume ptrdiff_t and uintptr_t are no wider than unsigned long.
1264 (align): Don't assume that signed integer overflow wraps around.
1265 Omit unused local var.
1266 (malloc_initialize_1, morecore_nolock, _malloc_internal_nolock)
1267 (_free_internal_nolock, memalign, mallochook, reallochook):
1268 Omit no-longer-needed casts.
1269 (valloc): Use getpagesize, not __getpagesize.
1270 (MAGICWORD, MAGICFREE): Now randomish size_t values, not 32-bit.
1271 (struct hdr): The 'magic' member is now size_t, not unsigned long.
1273 * dbusbind.c (XD_DBUS_VALIDATE_OBJECT): Define only if needed.
1275 2012-04-22 Michael Albinus <michael.albinus@gmx.de>
1277 Move functions from C to Lisp. Make non-blocking method calls
1278 the default. Implement further D-Bus standard interfaces.
1280 * dbusbind.c (DBUS_NUM_MESSAGE_TYPES): Declare.
1281 (QCdbus_request_name_allow_replacement)
1282 (QCdbus_request_name_replace_existing)
1283 (QCdbus_request_name_do_not_queue)
1284 (QCdbus_request_name_reply_primary_owner)
1285 (QCdbus_request_name_reply_in_queue)
1286 (QCdbus_request_name_reply_exists)
1287 (QCdbus_request_name_reply_already_owner): Move to dbus.el.
1288 (QCdbus_registered_serial, QCdbus_registered_method)
1289 (QCdbus_registered_signal): New Lisp objects.
1290 (XD_DEBUG_MESSAGE): Use sizeof.
1291 (XD_MESSAGE_TYPE_TO_STRING, XD_OBJECT_TO_STRING)
1292 (XD_DBUS_VALIDATE_BUS_ADDRESS, XD_DBUS_VALIDATE_OBJECT)
1293 (XD_DBUS_VALIDATE_BUS_NAME, XD_DBUS_VALIDATE_PATH)
1294 (XD_DBUS_VALIDATE_INTERFACE, XD_DBUS_VALIDATE_MEMBER): New macros.
1295 (XD_CHECK_DBUS_SERIAL): Rename from CHECK_DBUS_SERIAL_GET_SERIAL.
1296 (xd_signature, xd_append_arg): Allow float for integer types.
1297 (xd_get_connection_references): New function.
1298 (xd_get_connection_address): Rename from xd_initialize.
1299 Return cached address.
1300 (xd_remove_watch): Do not unset $DBUS_SESSION_BUS_ADDRESS.
1301 (xd_close_bus): Rename from Fdbus_close_bus. Not needed on Lisp
1303 (Fdbus_init_bus): New optional arg PRIVATE. Cache address.
1304 Return number of refcounts.
1305 (Fdbus_get_unique_name): Make stronger parameter check.
1306 (Fdbus_message_internal): New defun.
1307 (Fdbus_call_method, Fdbus_call_method_asynchronously)
1308 (Fdbus_method_return_internal, Fdbus_method_error_internal)
1309 (Fdbus_send_signal, Fdbus_register_service)
1310 (Fdbus_register_signal, Fdbus_register_method): Move to dbus.el.
1311 (xd_read_message_1): Obey new structure of Vdbus_registered_objects.
1312 (xd_read_queued_messages): Obey new structure of Vdbus_registered_buses.
1313 (Vdbus_compiled_version, Vdbus_runtime_version)
1314 (Vdbus_message_type_invalid, Vdbus_message_type_method_call)
1315 (Vdbus_message_type_method_return, Vdbus_message_type_error)
1316 (Vdbus_message_type_signal): New defvars.
1317 (Vdbus_registered_buses, Vdbus_registered_objects_table):
1320 2012-04-22 Paul Eggert <eggert@cs.ucla.edu>
1322 Fix GC_MALLOC_CHECK debugging output on 64-bit hosts.
1323 * alloc.c (emacs_blocked_malloc) [GC_MALLOC_CHECK]:
1324 Do not assume ptrdiff_t is the same width as 'int'.
1326 * alloc.c: Handle unusual debugging option combinations.
1327 (GC_CHECK_MARKED_OBJECTS): Undef if ! GC_MARK_STACK,
1328 since the two debugging options are incompatible.
1329 (GC_MALLOC_CHECK): Similarly, undef if GC_CHECK_MARKED_OBJECTS
1331 (mem_init, mem_insert, mem_insert_fixup):
1332 Define if GC_MARK_STACK || GC_MALLOC_CHECK.
1333 (NEED_MEM_INSERT): Remove; no longer needed.
1335 2012-04-22 Leo Liu <sdl.web@gmail.com>
1337 * sysdep.c (list_system_processes): Support Darwin (Bug#5725).
1339 2012-04-22 Paul Eggert <eggert@cs.ucla.edu>
1341 * sysdep.c [__FreeBSD__]: Minor cleanups.
1342 (list_system_processes, system_process_attributes) [__FreeBSD__]:
1343 Use Emacs indenting style more consistently. Avoid some casts.
1344 Use 'double' consistently rather than mixing 'float' and 'double'.
1346 2012-04-21 Eduard Wiebe <usenet@pusto.de>
1348 * sysdep.c (list_system_processes, system_process_attributes):
1349 Add implementation for FreeBSD (Bug#5243).
1351 2012-04-21 Andreas Schwab <schwab@linux-m68k.org>
1353 * lisp.mk (lisp): Update.
1355 2012-04-20 Paul Eggert <eggert@cs.ucla.edu>
1357 * keyboard.c (process_pending_signals): Define only if SYNC_INPUT.
1358 It is never used otherwise.
1360 2012-04-20 Stefan Monnier <monnier@iro.umontreal.ca>
1362 * print.c (print_preprocess): Only check print_depth if print-circle
1364 (print_object): Check for cycles even when print-circle is nil and
1365 print-gensym is t, but only check print_depth if print-circle is nil.
1367 2012-04-20 Chong Yidong <cyd@gnu.org>
1369 * process.c (wait_reading_process_output): If EIO occurs on a pty,
1370 set the status to "failed" and ensure that sentinel is run.
1372 2012-04-20 Glenn Morris <rgm@gnu.org>
1374 * process.c (Fset_process_inherit_coding_system_flag)
1375 (Fset_process_query_on_exit_flag): Doc fix (mention return value).
1376 (Fmake_network_process, Fmake_serial_process): Doc fix.
1378 2012-04-20 Eli Zaretskii <eliz@gnu.org>
1380 * xdisp.c (string_buffer_position_lim): Limit starting position to
1382 (set_cursor_from_row): If called for a mode-line or header-line
1383 row, return zero immediately.
1384 (try_cursor_movement): If inside continuation line, don't back up
1385 farther than the first row after the header line, if any.
1386 Don't consider the header-line row as "partially visible", even if
1387 MATRIX_ROW_PARTIALLY_VISIBLE_P returns non-zero. (Bug#11261)
1389 2012-04-20 Atsuo Ohki <ohki@gssm.otsuka.tsukuba.ac.jp> (tiny change)
1391 * lread.c (lisp_file_lexically_bound_p): Fix hang at ";-*-\n"
1394 2012-04-20 Teodor Zlatanov <tzz@lifelogs.com>
1395 2012-04-18 Paul Eggert <eggert@cs.ucla.edu>
1397 configure: new option --enable-gcc-warnings (Bug#11207)
1398 * Makefile.in (C_WARNINGS_SWITCH): Remove.
1399 (WARN_CFLAGS, WERROR_CFLAGS): New macros.
1400 (ALL_CFLAGS): Use new macros rather than old.
1401 * process.c: Ignore -Wstrict-overflow to work around GCC bug 52904.
1402 * regex.c: Ignore -Wstrict-overflow. If !emacs, also ignore
1403 -Wunused-but-set-variable, -Wunused-function, -Wunused-macros,
1404 -Wunused-result, -Wunused-variable. This should go away once
1405 the Emacs and Gnulib regex code is merged.
1406 (xmalloc, xrealloc): Now static.
1408 2012-04-17 Paul Eggert <eggert@cs.ucla.edu>
1410 * dired.c (Fsystem_groups): Remove unused local.
1412 2012-04-17 Glenn Morris <rgm@gnu.org>
1414 * dired.c (Fsystem_users): Doc fix.
1416 2012-04-17 Dmitry Antipov <dmantipov@yandex.ru>
1418 * dired.c (Fsystem_users, Fsystem_groups): New functions. (Bug#7900)
1419 (syms_of_dired): Add them.
1421 2012-04-16 Paul Eggert <eggert@cs.ucla.edu>
1423 Fix minor alloc.c problems found by static checking.
1424 * alloc.c (_malloc_internal, _free_internal) [!DOUG_LEA_MALLOC]:
1425 New extern decls, to avoid calling undeclared functions.
1426 (dont_register_blocks): Define if ((!SYSTEM_MALLOC && !SYNC_INPUT)
1427 && GC_MALLOC_CHECK), not if ((GC_MARK_STACK || defined
1428 GC_MALLOC_CHECK) && GC_MALLOC_CHECK), to match when it's used.
1429 (NEED_MEM_INSERT): New macro.
1430 (mem_insert, mem_insert_fixup) [!NEED_MEM_INSERT]: Remove; unused.
1431 Remove one incorrect comment and fix another.
1433 Fix minor ralloc.c problems found by static checking.
1434 See http://lists.gnu.org/archive/html/emacs-devel/2011-12/msg00720.html
1435 * ralloc.c (ALIGNED, ROUND_TO_PAGE, HEAP_PTR_SIZE)
1436 (r_alloc_size_in_use, r_alloc_freeze, r_alloc_thaw): Remove; unused.
1437 (r_alloc_sbrk): Now static.
1439 Improve ralloc.c interface checking.
1440 See http://lists.gnu.org/archive/html/emacs-devel/2011-12/msg00720.html
1441 * buffer.c (ralloc_reset_variable, r_alloc, r_re_alloc)
1442 (r_alloc_free) [REL_ALLOC]: Move decls from here ...
1443 * lisp.h (r_alloc, r_alloc_free, r_re_alloc, r_alloc_reset_variable)
1444 [REL_ALLOC]: ... to here, to check interface.
1445 * m/ia64.h (r_alloc, r_alloc_free) [REL_ALLOC && !_MALLOC_INTERNAL]:
1446 Remove decls. This fixes an "It stinks!".
1448 * alloc.c (which_symbols): Fix alignment issue / type clash.
1450 2012-04-15 Andreas Schwab <schwab@linux-m68k.org>
1452 * lisp.h (struct Lisp_Symbol): Remove explicit padding.
1453 (struct Lisp_Misc_Any): Likewise.
1454 (struct Lisp_Free): Likewise.
1455 * alloc.c (union aligned_Lisp_Symbol): Define.
1456 (SYMBOL_BLOCK_SIZE, struct symbol_block): Use union
1457 aligned_Lisp_Symbol instead of struct Lisp_Symbol.
1458 (union aligned_Lisp_Misc): Define.
1459 (MARKER_BLOCK_SIZE, struct marker_block): Use union
1460 aligned_Lisp_Misc instead of union Lisp_Misc.
1461 (Fmake_symbol, allocate_misc, gc_sweep): Adjust.
1463 2012-04-14 Paul Eggert <eggert@cs.ucla.edu>
1465 Make GC_MAKE_GCPROS_NOOPS the default (Bug#9926).
1466 * lisp.h (GC_MARK_STACK): Default to GC_MAKE_GCPROS_NOOPS.
1467 * s/cygwin.h, s/darwin.h, s/freebsd.h, s/gnu.h, s/irix6-5.h, s/msdos.h:
1468 * s/netbsd.h, s/sol2-6.h:
1469 Remove definition of GC_MARK_STACK, since the default now works.
1470 * s/aix4-2.h, s/hpux10-20.h, s/unixware.h:
1471 Define GC_MARK_STACK to GC_USE_GCPROS_AS_BEFORE, since that's
1472 no longer the default.
1473 * s/gnu-linux.h (GC_MARK_STACK): Adjust to change in default.
1475 2012-04-14 Atsuo Ohki <ohki@gssm.otsuka.tsukuba.ac.jp> (tiny change)
1477 * lread.c (lisp_file_lexically_bound_p):
1478 Fix hang at ";-*-\n" (bug#11238).
1480 2012-04-14 Eli Zaretskii <eliz@gnu.org>
1482 * xdisp.c (find_last_unchanged_at_beg_row): Don't consider a row
1483 "unchanged" if its end.pos is beyond ZV. (Bug#11199)
1485 2012-04-14 Jan Djärv <jan.h.d@swipnet.se>
1487 * nsterm.m (constrainFrameRect): Always constrain when there is only
1488 one screen (Bug#10962).
1490 2012-04-13 Ken Brown <kbrown@cornell.edu>
1492 * s/cygwin.h (PTY_OPEN): Don't try to close a bogus file descriptor.
1494 2012-04-13 Reuben Thomas <rrt@sc3d.org>
1496 * indent.c (Fmove_to_column): Change interactive spec (Bug#739).
1498 2012-04-11 Daniel Colascione <dancol@dancol.org>
1500 * s/cygwin.h: The vfork the #define in cygwin.h was protecting
1501 against is gone. It's better to use vfork now so that when Cygwin
1502 gains a new, working vfork, we use it automatically (bug#10398).
1504 2012-04-11 Stefan Monnier <monnier@iro.umontreal.ca>
1506 * window.c (save_window_save): Obey window-point-insertion-type.
1508 2012-04-11 Glenn Morris <rgm@gnu.org>
1510 * Makefile.in (GNUSTEP_CFLAGS): Rename from C_SWITCH_X_SYSTEM.
1512 2012-04-11 Stefan Monnier <monnier@iro.umontreal.ca>
1514 * alloc.c (lisp_align_malloc): Remove unneeded prototype.
1516 2012-04-10 Jason S. Cornez <jcornez@ravenpack.com> (tiny change)
1518 * keyboard.c: Override inhibit-quit after the third C-g (bug#6585).
1519 (force_quit_count): New var.
1520 (handle_interrupt): Use it.
1522 2012-04-10 Juanma Barranquero <lekktu@gmail.com>
1524 * w32.c (w32_delayed_load): Record the full path of the library
1525 being loaded (bug#10424).
1527 2012-04-09 Glenn Morris <rgm@gnu.org>
1529 * doc.c (Fsnarf_documentation): Check variables, functions are bound,
1530 not just in the obarray, before snarfing them. (Bug#11036)
1532 * Makefile.in ($(leimdir)/leim-list.el):
1533 Pass EMACS rather than BUILT_EMACS.
1535 2012-04-09 Teodor Zlatanov <tzz@lifelogs.com>
1537 * process.c (make_process):
1538 * process.h: Add integer `gnutls_handshakes_tried' member to
1541 * gnutls.h: Add `GNUTLS_EMACS_HANDSHAKES_LIMIT' upper limit.
1542 Add convenience `GNUTLS_LOG2i' macro.
1544 * gnutls.c (gnutls_log_function2i): Convenience log function.
1545 (emacs_gnutls_read): Use new log functions,
1546 `gnutls_handshakes_tried' process member, and
1547 `GNUTLS_EMACS_HANDSHAKES_LIMIT' to limit the number of handshake
1548 attempts per process (connection).
1550 2012-04-09 Chong Yidong <cyd@gnu.org>
1552 * eval.c (Fuser_variable_p, user_variable_p_eh)
1553 (lisp_indirect_variable): Functions deleted.
1554 (Fdefvar): Caller changed.
1556 * callint.c (Finteractive, Fcall_interactively):
1557 * minibuf.c (Fread_variable): Callers changed.
1559 2012-04-09 Eli Zaretskii <eliz@gnu.org>
1561 * xdisp.c (set_cursor_from_row): If the display string appears in
1562 the buffer at position that is closer to point than the position
1563 after the display string, display the cursor on the first glyph of
1564 the display string. Fixes cursor display when a 'display' text
1565 property immediately follows invisible text. (Bug#11094)
1567 2012-04-09 Paul Eggert <eggert@cs.ucla.edu>
1569 composite.c: use 'double' consistently
1570 * composite.c (get_composition_id): Use 'double' consistently
1571 instead of converting 'float' to 'double' and vice versa; this is
1572 easier to understand and avoids a GCC warning.
1574 2012-04-09 Glenn Morris <rgm@gnu.org>
1576 * Makefile.in: Generate leim-list with bootstrap-emacs, in
1577 preparation for dumping it with emacs. (Bug#4789)
1578 (leimdir): New variable.
1579 ($(leimdir)/leim-list.el): New rule.
1580 (emacs$(EXEEXT)): Depend on leim-list.el.
1582 * buffer.c (Qucs_set_table_for_input): Remove. (Bug#9821)
1583 (Fget_buffer_create): Don't call Qucs_set_table_for_input.
1584 (init_buffer_once, syms_of_buffer): Remove Qucs_set_table_for_input.
1586 2012-04-08 Andreas Schwab <schwab@linux-m68k.org>
1588 * lisp.h (struct Lisp_Symbol): Add explicit padding to ensure
1591 2012-04-07 Juanma Barranquero <lekktu@gmail.com>
1593 * xml.c (init_libxml2_functions) [WINDOWSNT]:
1594 Remove unused local variable.
1596 2012-04-07 Paul Eggert <eggert@cs.ucla.edu>
1598 Avoid unnecessary pointer scanning in garbage collection (Bug#10780).
1599 * alloc.c (POINTERS_MIGHT_HIDE_IN_OBJECTS): New macro.
1600 (mark_memory): Mark Lisp_Objects only if pointers might hide in
1601 objects, as mark_maybe_pointer will catch them otherwise.
1602 (GC_LISP_OBJECT_ALIGNMENT): Remove; no longer needed.
1603 * s/gnu-linux.h (GC_LISP_OBJECT_ALIGNMENT) [__mc68000__]: Likewise.
1605 2012-04-07 Paul Eggert <eggert@cs.ucla.edu>
1607 Fix typo that broke non-Windows builds.
1608 * xml.c (libxml2_loaded_p) [!!WINDOWSNT]: 'inine' -> 'inline'.
1610 2012-04-07 Eli Zaretskii <eliz@gnu.org>
1612 Support building on MS-Windows with libxml2.
1614 * makefile.w32-in (OBJ2): Add xml.$(O).
1615 (GLOBAL_SOURCES): Add xml.c.
1616 ($(BLD)/xml.$(O)): New dependency list.
1618 * xml.c (DEF_XML2_FN, LOAD_XML2_FN) [WINDOWSNT]: New macros.
1619 (fn_htmlReadMemory, fn_xmlReadMemory, fn_xmlDocGetRootElement)
1620 (fn_xmlFreeDoc, fn_xmlCleanupParser, fn_xmlCheckVersion)
1621 [!WINDOWSNT]: New macros.
1622 (init_libxml2_functions, libxml2_loaded_p): New functions.
1623 (parse_region): Call fn_xmlCheckVersion instead of using the macro
1624 LIBXML_TEST_VERSION. Call libxml2 functions via the fn_* macros.
1625 (xml_cleanup_parser): New function, export for fn_xmlCleanupParser.
1626 Calls xmlCleanupParser only if libxml2 was loaded (or statically
1628 (Flibxml_parse_html_region, Flibxml_parse_xml_region):
1629 Call init_libxml2_functions before calling libxml2 functions.
1630 (syms_of_xml) <Qlibxml2_dll>: DEFSYM it.
1632 * emacs.c: Don't include libxml/parser.h.
1633 (shut_down_emacs): Call xml_cleanup_parser, instead of calling
1634 xmlCleanupParser directly.
1636 * lisp.h [HAVE_LIBXML2]: Add prototype for xml_cleanup_parser.
1638 2012-04-07 Eli Zaretskii <eliz@gnu.org>
1640 * indent.c (Fvertical_motion): If there is a display string at
1641 point, use it.vpos to compute how many lines to backtrack after
1642 move_it_to point. (Bug#11133)
1644 2012-04-06 Eli Zaretskii <eliz@gnu.org>
1646 * buffer.h (FETCH_CHAR, FETCH_MULTIBYTE_CHAR):
1647 * character.h (STRING_CHAR, STRING_CHAR_AND_LENGTH): Add comments
1648 about subtle differences between FETCH_CHAR* and STRING_CHAR*
1649 macros related to unification of CJK characters. For the details,
1650 see the discussion following the message here:
1651 http://debbugs.gnu.org/cgi/bugreport.cgi?bug=11073#14.
1653 2012-04-04 Chong Yidong <cyd@gnu.org>
1655 * keyboard.c (Vdelayed_warnings_list): Doc fix.
1657 2012-04-01 Eli Zaretskii <eliz@gnu.org>
1659 * w32menu.c (simple_dialog_show, add_menu_item): Use SAFE_ALLOCA
1660 instead of alloca. (Bug#11138)
1662 2012-04-01 Andreas Schwab <schwab@linux-m68k.org>
1664 * w32menu.c (is_simple_dialog): Properly check lisp types.
1667 2012-03-31 Eli Zaretskii <eliz@gnu.org>
1669 * xdisp.c (move_it_by_lines): When DVPOS is positive, and the
1670 position we get to after a call to move_it_to fails the
1671 IS_POS_VALID_AFTER_MOVE_P test, move to the next buffer position
1672 only if we wind up in a string from display property. (Bug#11063)
1674 * window.c (Fdelete_other_windows_internal): Invalidate the row
1675 and column information about mouse highlight, so that redisplay
1676 restores it after reallocating the glyph matrices. (Bug#7464)
1678 * xdisp.c (set_cursor_from_row): If `cursor' property on a display
1679 string comes from a `display' text property, use the buffer
1680 position of that property as if we actually saw that position in
1682 (move_it_by_lines): Remove the assertion that
1683 "it->current_x == 0 && it->hpos == 0" which can be legitimately
1684 violated when there's a before-string at the beginning of a line.
1687 2012-03-30 Eli Zaretskii <eliz@gnu.org>
1689 * xdisp.c (append_space_for_newline): If the default face was
1690 remapped, use the remapped face for the appended newline.
1691 (extend_face_to_end_of_line): Use the remapped default face for
1692 extending the face to the end of the line.
1693 (display_line): Call extend_face_to_end_of_line when the default
1694 face was remapped. (Bug#11068)
1696 2012-03-29 Eli Zaretskii <eliz@gnu.org>
1698 * s/ms-w32.h: Discourage from defining HAVE_GETCWD.
1700 2012-03-28 Stefan Monnier <monnier@iro.umontreal.ca>
1702 * keyboard.c (safe_run_hooks_error): Don't unquote strings.
1704 2012-03-27 Glenn Morris <rgm@gnu.org>
1706 * search.c (Fword_search_backward_lax, Fword_search_forward_lax):
1709 2012-03-26 Kenichi Handa <handa@m17n.org>
1711 * dispextern.h (struct glyph): Fix previous change. Change the
1712 bit length of glyphless.ch to 25 (Bug#11082).
1714 2012-03-26 Chong Yidong <cyd@gnu.org>
1716 * keyboard.c (Vselection_inhibit_update_commands): New variable.
1717 (command_loop_1): Use it; inhibit selection update for
1718 handle-select-window too (Bug#8996).
1720 2012-03-25 Fabrice Popineau <fabrice.popineau@supelec.fr>
1722 * w32heap.c (_heap_init, _heap_term): Remove dead MSVC-specific code.
1724 2012-03-25 Kenichi Handa <handa@m17n.org>
1726 * dispextern.h (struct glyph): Change the bit length of
1727 glyphless.ch to 22 to make the member glyphless fit in 32 bits.
1729 2012-03-24 Eli Zaretskii <eliz@gnu.org>
1731 * s/ms-w32.h (tzname): Include time.h before redirecting to
1732 _tzname. Fixes the MSVC build. (Bug#9960)
1734 2012-03-24 Andreas Schwab <schwab@linux-m68k.org>
1736 * xdisp.c (produce_glyphless_glyph): Limit length of acronym to 6
1739 * xterm.c (XTread_socket): Only modify handling_signal if
1740 !SYNC_INPUT. (Bug#11080)
1742 2012-03-23 Eli Zaretskii <eliz@gnu.org>
1744 * bidi.c (bidi_fetch_char): Use STRING_CHAR_AND_LENGTH instead of
1745 FETCH_MULTIBYTE_CHAR followed by CHAR_BYTES. Prevents crashes
1746 when fetching a multibyte character consumes more bytes than
1747 CHAR_BYTES returns, due to unification of CJK characters in
1748 string_char. (Bug#11073)
1750 2012-03-23 Troels Nielsen <bn.troels@gmail.com> (tiny change)
1752 * process.c (wait_reading_process_output): Handle pty disconnect
1753 by refraining from sending oneself a SIGCHLD (bug#10933).
1755 2012-03-22 Chong Yidong <cyd@gnu.org>
1757 * dispextern.h (struct it): New member string_from_prefix_prop_p.
1759 * xdisp.c (push_prefix_prop): Rename from push_display_prop.
1760 Mark string as coming from a prefix property.
1761 (handle_face_prop): Use default face for prefix strings (Bug#4281).
1762 (pop_it, reseat_1): Save and restore string_from_prefix_prop_p.
1764 2012-03-21 Chong Yidong <cyd@gnu.org>
1766 * xfaces.c (Vface_remapping_alist): Doc fix.
1768 2012-03-20 Eli Zaretskii <eliz@gnu.org>
1770 * w32proc.c (Fw32_set_console_codepage)
1771 (Fw32_set_console_output_codepage, Fw32_get_codepage_charset):
1774 2012-03-20 Chong Yidong <cyd@gnu.org>
1776 * dispnew.c (Fredisplay, Vredisplay_preemption_period): Update doc
1777 to reflect default non-nil value of redisplay-dont-pause.
1779 2012-03-19 Kenichi Handa <handa@m17n.org>
1781 * ftfont.c (ftfont_drive_otf): Mask bits of character code to make
1782 it fit in a valid range (Bug#11003).
1784 2012-03-18 Eli Zaretskii <eliz@gnu.org>
1786 * xdisp.c (cursor_row_p): Even if the glyph row ends in a string
1787 that is not from display property, accept the row as a "cursor
1788 row" if one of the string's character has a non-nil `cursor'
1789 property. Fixes cursor positioning when there are newlines in
1790 overlay strings, e.g. in icomplete.el. (Bug#11035)
1792 2012-03-12 Paul Eggert <eggert@cs.ucla.edu>
1794 * buffer.c (compare_overlays): Don't assume args differ (Bug#6830).
1796 2012-03-12 Chong Yidong <cyd@gnu.org>
1798 * eval.c (inhibit_lisp_code): Rename from
1799 inhibit_window_configuration_change_hook; move from window.c.
1801 * xfns.c (unwind_create_frame_1, Fx_create_frame):
1802 * window.c (run_window_configuration_change_hook)
1803 (syms_of_window): Callers changed.
1805 2012-03-11 Chong Yidong <cyd@gnu.org>
1807 * keymap.c (Fkey_description): Doc fix (Bug#9700).
1809 * editfns.c (Fconstrain_to_field): Doc fix (Bug#9452).
1811 2012-03-10 Chong Yidong <cyd@gnu.org>
1813 * frame.c (other_visible_frames): Don't assume the selected frame
1814 is visible (Bug#10955).
1816 2012-03-09 Stefan Monnier <monnier@iro.umontreal.ca>
1818 * buffer.c (compare_overlays): Avoid qsort's instability (bug#6830).
1820 2012-03-08 Jan Djärv <jan.h.d@swipnet.se>
1822 * gtkutil.c (x_wm_set_size_hint): Use one row in call to
1823 FRAME_TEXT_LINES_TO_PIXEL_HEIGHT so base_height is greater than
1826 2012-03-03 Glenn Morris <rgm@gnu.org>
1828 * alloc.c (Fgarbage_collect, misc-objects-consed): Doc fixes.
1830 2012-03-02 Eli Zaretskii <eliz@gnu.org>
1832 * xdisp.c (try_window_reusing_current_matrix): Don't move cursor
1833 position past the first glyph_row that ends at ZV. (Bug#10902)
1834 (redisplay_window, next_element_from_string): Fix typos in
1836 (redisplay_window): Pass to move_it_vertically the margin in
1837 pixels, not in screen lines.
1839 2012-03-02 Glenn Morris <rgm@gnu.org>
1841 * buffer.c (buffer-list-update-hook): Doc fix.
1843 2012-02-29 Eli Zaretskii <eliz@gnu.org>
1845 * xdisp.c (get_overlay_strings_1): Under bidi redisplay, call
1846 push_it before setting up the iterator for the first overlay
1847 string, even if we have an empty string loaded.
1848 (next_overlay_string): If there's an empty string on the iterator
1849 stack, pop the stack. (Bug#10903)
1851 2012-02-25 Paul Eggert <eggert@cs.ucla.edu>
1853 Generalize fix for crash due to non-contiguous EMACS_INT (Bug#10780).
1854 Suggested by Stefan Monnier in
1855 <http://lists.gnu.org/archive/html/emacs-devel/2012-02/msg00692.html>.
1856 * alloc.c (widen_to_Lisp_Object): New static function.
1857 (mark_memory): Also mark Lisp_Objects by fetching pointer words
1858 and widening them to Lisp_Objects. This would work even if
1859 USE_LSB_TAG is defined and wide integers are used, which might
1860 happen in a future version of Emacs.
1862 2012-02-25 Chong Yidong <cyd@gnu.org>
1864 * fileio.c (Ffile_selinux_context, Fset_file_selinux_context):
1867 * xselect.c (Fx_selection_exists_p): Doc fix.
1868 (x_clipboard_manager_save_all): Print an informative message
1869 before saving to clipboard manager.
1871 2012-02-24 Chong Yidong <cyd@gnu.org>
1873 * keyboard.c (process_special_events): Handle all X selection
1874 requests in kbd_buffer, not just the next one (Bug#8869).
1876 2012-02-23 Chong Yidong <cyd@gnu.org>
1878 * xfns.c (Fx_create_frame): Avoid window-configuration-change-hook
1879 call when setting menu-bar-lines and tool-bar-lines parameters.
1880 (unwind_create_frame_1): New helper function.
1882 * window.c (inhibit_window_configuration_change_hook): New var.
1883 (run_window_configuration_change_hook): Obey it.
1884 (syms_of_window): Initialize it.
1886 2012-02-22 Chong Yidong <cyd@gnu.org>
1888 * xterm.c (x_draw_image_relief): Add missing type check for
1889 Vtool_bar_button_margin (Bug#10743).
1891 2012-02-21 Chong Yidong <cyd@gnu.org>
1893 * fileio.c (Vfile_name_handler_alist): Doc fix.
1895 * buffer.c (Fget_file_buffer): Protect against invalid file
1896 handler return value.
1898 2012-02-20 Paul Eggert <eggert@cs.ucla.edu>
1900 * .gdbinit (xreload): Don't assume EMACS_INT fits in 'long'
1901 when computing $valmask.
1903 Fix crash due to non-contiguous EMACS_INT (Bug#10780).
1904 * lisp.h (VALBITS): Move definition up, so that USE_LSB_TAG can use it.
1905 (USE_LSB_TAG): Do not define if UINTPTR_MAX >> VALBITS == 0.
1906 It's useless in that case, and it can cause problems on hosts
1907 that allocate halves of EMACS_INT values separately.
1908 Reported by Dan Horák. Diagnosed by Andreas Schwab in
1909 <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=10780#30>.
1910 * mem-limits.h (EXCEEDS_LISP_PTR): Define to 0 on hosts where
1911 UINTPTR_MAX >> VALBITS == 0. This is required by the above change;
1912 it avoids undefined behavior on hosts where shifting right by more
1913 than the word width has undefined behavior.
1915 2012-02-19 Chong Yidong <cyd@gnu.org>
1917 * fileio.c (Ffile_name_directory, Ffile_name_nondirectory)
1918 (Funhandled_file_name_directory, Ffile_name_as_directory)
1919 (Fdirectory_file_name, Fexpand_file_name)
1920 (Fsubstitute_in_file_name): Protect against invalid file handler
1921 return values (Bug#10845).
1923 2012-02-18 Eli Zaretskii <eliz@gnu.org>
1925 * .gdbinit (pitx): Fix incorrect references to fields of the
1928 2012-02-17 Chong Yidong <cyd@gnu.org>
1930 * syntax.c (Fscan_lists): Doc fix (Bug#10833).
1932 2012-02-15 Paul Eggert <eggert@cs.ucla.edu>
1934 * image.c (MAX_IMAGE_SIZE): Increase from 6.0 to 10.0; see
1935 <http://lists.gnu.org/archive/html/emacs-devel/2012-02/msg00540.html>.
1937 2012-02-15 Chong Yidong <cyd@gnu.org>
1939 * eval.c (Fdefvar, Fdefconst): Doc fix; note that the variable is
1940 marked as special. Also, starting docstrings with * is obsolete.
1942 2012-02-13 Andreas Schwab <schwab@linux-m68k.org>
1944 * gnutls.c (emacs_gnutls_write): Fix last change.
1946 2012-02-13 Lars Ingebrigtsen <larsi@gnus.org>
1948 * gnutls.c (emacs_gnutls_write): Set errno appropriately for
1951 2012-02-13 Stefan Monnier <monnier@iro.umontreal.ca>
1953 * keymap.c (Fsingle_key_description): Handle char ranges.
1955 2012-02-12 Chong Yidong <cyd@gnu.org>
1957 * xdisp.c (handle_stop): Avoid assigning -1 to it->face_id here,
1958 as that creates a dangerous corner case.
1960 * window.c (Fdelete_window_internal): Invalidate the mouse
1961 highlight (Bug#9904).
1963 2012-02-12 Glenn Morris <rgm@gnu.org>
1965 * xselect.c (Fx_own_selection_internal)
1966 (Fx_get_selection_internal, Fx_disown_selection_internal)
1967 (Fx_selection_owner_p, Fx_selection_exists_p): Doc fixes.
1968 * nsselect.m (Fx_own_selection_internal)
1969 (Fx_disown_selection_internal, Fx_selection_exists_p)
1970 (Fx_selection_owner_p, Fx_get_selection_internal):
1971 Sync docs and argument specs with the xselect.c versions.
1973 2012-02-11 Lars Ingebrigtsen <larsi@gnus.org>
1975 * gnutls.c (emacs_gnutls_write): Don't infloop if sendto fails.
1977 2012-02-11 Eli Zaretskii <eliz@gnu.org>
1979 * w32select.c (Fx_selection_exists_p): Sync doc string and
1980 argument list with xselect.c. (Bug#10783)
1982 * w16select.c (Fx_selection_exists_p): Sync doc string and
1983 argument list with xselect.c. (Bug#10783)
1985 2012-02-10 Glenn Morris <rgm@gnu.org>
1987 * fns.c (Fsecure_hash): Doc fix.
1989 2012-02-09 Kenichi Handa <handa@m17n.org>
1991 * coding.c (produce_chars): Fix updating of src_end (Bug#10701).
1993 2012-02-07 Chong Yidong <cyd@gnu.org>
1995 * buffer.c (Fbuffer_local_variables)
1996 (buffer_lisp_local_variables): Handle unbound vars correctly;
1997 don't let Qunbound leak into Lisp.
1999 2012-02-07 Glenn Morris <rgm@gnu.org>
2001 * image.c (Fimagemagick_types): Doc fix.
2003 * image.c (imagemagick-render-type): Change it from a lisp object
2004 to an integer. Move the doc here from the lisp manual.
2005 Treat all values not equal to 0 the same.
2007 2012-02-06 Chong Yidong <cyd@gnu.org>
2009 * doc.c (store_function_docstring): Avoid applying docstring of
2010 alias to base function (Bug#2603).
2012 2012-02-04 Andreas Schwab <schwab@linux-m68k.org>
2014 * .gdbinit (pp1, pv1): Remove redundant defines.
2017 2012-02-04 Chong Yidong <cyd@gnu.org>
2019 * nsterm.m: Declare a global (Bug#10694).
2021 2012-02-04 Eli Zaretskii <eliz@gnu.org>
2023 * w32.c (get_emacs_configuration_options):
2024 Include --enable-checking, if specified, in the return value.
2026 2012-02-04 Martin Rudalics <rudalics@gmx.at>
2028 * dispnew.c (change_frame_size_1): Calculate new_frame_total_cols
2029 after rounding frame sizes. (Bug#9723)
2031 2012-02-04 Eli Zaretskii <eliz@gnu.org>
2033 * keyboard.c (adjust_point_for_property): Don't position point
2034 before BEGV. (Bug#10696)
2036 2012-02-03 Paul Eggert <eggert@cs.ucla.edu>
2038 Handle overflow when computing char display width (Bug#9496).
2039 * character.c (char_width): Return EMACS_INT, not int.
2040 (char_width, c_string_width): Check for overflow when
2041 computing the width; this is possible now that individual
2042 characters can have unbounded width. Problem introduced
2043 by merge from Emacs 23 on 2012-01-19.
2045 2012-02-02 Michael Albinus <michael.albinus@gmx.de>
2047 * dbusbind.c (Fdbus_register_method): Mention the return value
2048 :ignore in the docstring.
2050 2012-02-02 Glenn Morris <rgm@gnu.org>
2052 * callproc.c (Fcall_process, Fcall_process_region): Doc fix.
2054 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
2055 Unconditionally set to t. (Bug#10673)
2056 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
2057 * w32term.c (syms_of_w32term) <x-toolkit-scroll-bars>:
2058 * xterm.c (syms_of_xterm) <x-toolkit-scroll-bars>: Doc fix.
2060 2012-02-02 Kenichi Handa <handa@m17n.org>
2062 (x_produce_glyphs): Cancel previous change. If cmp->glyph_len is
2063 0, do not call append_composite_glyph.
2065 2012-02-02 Kenichi Handa <handa@m17n.org>
2067 * xdisp.c (BUILD_COMPOSITE_GLYPH_STRING): Initialize first_s to
2069 (x_produce_glyphs): If the component of a composition is a null
2070 string, set it->pixel_width to 1 to avoid zero-width glyph.
2072 2012-02-01 Eli Zaretskii <eliz@gnu.org>
2074 * ralloc.c (resize_bloc, r_alloc_sbrk): Don't call memmove if its
2075 first 2 arguments are identical. This makes inserting large
2076 output from a subprocess an order of magnitude faster on
2077 MS-Windows, where all sbrk'ed memory is always contiguous.
2079 2012-01-31 Glenn Morris <rgm@gnu.org>
2081 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
2082 * w32term.c (syms_of_w32term) <x-toolkit-scroll-bars>:
2083 * xterm.c (syms_of_xterm) <x-toolkit-scroll-bars>: Sync docs.
2085 2012-01-29 Glenn Morris <rgm@gnu.org>
2087 * gnutls.c (syms_of_gnutls): More doc (from etc/NEWS).
2089 2012-01-28 Samuel Thibault <sthibault@debian.org> (tiny change)
2091 * s/gnu.h: Define POSIX_SIGNALS (Bug#10552).
2093 2012-01-28 Chong Yidong <cyd@gnu.org>
2095 * minibuf.c (syms_of_minibuf): Doc fix (Bug#10550).
2097 2012-01-26 Chong Yidong <cyd@gnu.org>
2099 * keyboard.c (Vecho_keystrokes): Document zero value (Bug#10503).
2101 * search.c (Fsearch_forward, Fsearch_backward): Document negative
2102 repeat counts (Bug#10507).
2104 2012-01-26 Glenn Morris <rgm@gnu.org>
2106 * lread.c (syms_of_lread): Doc fix.
2108 2012-01-25 HIROSHI OOTA <nil@mad.dog.cx> (tiny change)
2110 * coding.c (encode_designation_at_bol): Change return value to
2113 2012-01-25 Chong Yidong <cyd@gnu.org>
2115 * eval.c (Fuser_variable_p): Doc fix; mention custom-variable-p.
2117 2012-01-21 Chong Yidong <cyd@gnu.org>
2119 * floatfns.c (Fcopysign): Make the second argument non-optional,
2120 since nil is not allowed anyway.
2122 2012-01-21 Andreas Schwab <schwab@linux-m68k.org>
2124 * process.c (read_process_output): Use p instead of XPROCESS (proc).
2125 (send_process): Likewise.
2127 2012-01-19 Martin Rudalics <rudalics@gmx.at>
2129 * window.c (save_window_save, Fcurrent_window_configuration)
2130 (Vwindow_persistent_parameters): Do not use Qstate.
2131 Rewrite doc-strings.
2133 2012-01-19 Kenichi Handa <handa@m17n.org>
2135 * character.c (char_width): New function.
2136 (Fchar_width, c_string_width, lisp_string_width):
2137 Use char_width (Bug#9496).
2139 2012-01-16 Martin Rudalics <rudalics@gmx.at>
2141 * window.c (Vwindow_persistent_parameters): New variable.
2142 (Fset_window_configuration, save_window_save): Handle persistent
2145 2012-01-14 Eli Zaretskii <eliz@gnu.org>
2147 * w32fns.c (signal_user_input): Don't do a QUIT, to avoid
2148 thrashing the stack of the thread. (Bug#9087)
2150 2012-01-12 Paul Eggert <eggert@cs.ucla.edu>
2152 * xdisp.c (rows_from_pos_range): Add parens as per gcc -Wparentheses.
2154 2012-01-11 Eli Zaretskii <eliz@gnu.org>
2156 * xdisp.c (rows_from_pos_range): Handle the case where the
2157 highlight ends on a newline. (Bug#10464)
2158 (mouse_face_from_buffer_pos): Fix off-by-one error in calculating
2159 he end column for display of highlight that ends on a newline
2162 2012-01-11 Glenn Morris <rgm@gnu.org>
2164 * lread.c (init_lread): If no-site-lisp, remove site-lisp dirs
2165 from load-path also when installation-directory is nil. (Bug#10208)
2167 2012-01-10 Glenn Morris <rgm@gnu.org>
2169 * emacs.c (syms_of_emacs) <installation-directory>: Doc fix.
2171 * epaths.in (PATH_LOADSEARCH, PATH_EXEC, PATH_DATA, PATH_DOC):
2172 Update template values to be closer to their typical values these days.
2174 2012-01-09 Eli Zaretskii <eliz@gnu.org>
2176 * xdisp.c (rows_from_pos_range): Accept additional argument
2177 DISP_STRING, and accept any glyph in a row whose object is that
2178 string as eligible for mouse highlight. Fixes mouse highlight of
2179 display strings from overlays. (Bug#10464)
2181 2012-01-07 Paul Eggert <eggert@cs.ucla.edu>
2183 emacs: fix an auto-save permissions race condition (Bug#10400)
2184 * fileio.c (auto_saving_dir_umask): New static var.
2185 (Fmake_directory_internal): Use it.
2186 (do_auto_save_make_dir): Set it, instead of invoking chmod after
2187 creating the directory. The old code temporarily assigns
2188 too-generous permissions to the directory.
2189 (do_auto_save_eh): Clear it.
2190 (Fdo_auto_save): Catch all errors, not just file errors, so
2191 that the var is always cleared.
2193 2012-01-07 Eli Zaretskii <eliz@gnu.org>
2195 * search.c (scan_buffer): Pass character positions to
2196 know_region_cache, not byte positions. (Bug#6540)
2198 2012-01-07 LynX <_LynX@bk.ru> (tiny change)
2200 * w32.c (sys_rename): Report EXDEV when rename of a directory
2201 fails because the target is on another logical disk. (Bug#10284)
2203 2012-01-07 David Benjamin <davidben@mit.edu> (tiny change)
2205 * xterm.c (x_embed_request_focus): New function.
2207 * xterm.h: Add prototype.
2209 * xfns.c (Fx_focus_frame): Use it for embedded frames (Bug#9977).
2211 2012-01-05 Glenn Morris <rgm@gnu.org>
2213 * emacs.c (emacs_copyright): Update short copyright year to 2012.
2215 2012-01-01 Eli Zaretskii <eliz@gnu.org>
2217 * gnutls.c (init_gnutls_functions): Load gnutls_check_version.
2218 Load gnutls_transport_set_lowat only if GnuTLS version is below
2220 (emacs_gnutls_handshake): Call gnutls_transport_set_lowat only for
2221 GnuTLS versions below 2.11.1.
2223 2011-12-31 Antoine Levitt <antoine.levitt@gmail.com>
2225 * xdisp.c (syms_of_xdisp) <window-scroll-functions>: Add warning
2226 to the doc string advising against its use for altering the way
2227 windows are scrolled.
2229 2011-12-28 Kenichi Handa <handa@m17n.org>
2231 * coding.c (Fdefine_coding_system_internal): Make an utf-8 base
2232 coding-system ASCII compatible only when it does not produce BOM
2233 on encoding (Bug#10383).
2235 2011-12-26 Jan Djärv <jan.h.d@swipnet.se>
2237 * xmenu.c (x_menu_wait_for_event): Use xg_select for Gtk3 so menus
2239 (create_and_show_popup_menu): Always use menu_position_func for
2242 2011-12-24 Andreas Schwab <schwab@linux-m68k.org>
2244 * callint.c (Fcall_interactively): Don't truncate prompt string.
2246 2011-12-23 Eli Zaretskii <eliz@gnu.org>
2248 * xdisp.c (handle_invisible_prop): Handle correctly an invisible
2249 property that ends at ZV, so that the bidi iteration could be
2250 resumed from there (after widening). (Bug#10360)
2252 2011-12-22 Jan Djärv <jan.h.d@swipnet.se>
2254 * nsfont.m (ns_spec_to_descriptor): Do not autorelease fdesc.
2256 2011-12-21 Jan Djärv <jan.h.d@swipnet.se>
2258 * nsterm.m (x_free_frame_resources):
2259 Release f->output_data.ns->miniimage.
2260 (ns_index_color): Fix indentation. Do not retain
2261 color_table->colors[i].
2263 * nsmenu.m (ns_update_menubar): Call free_menubar_widget_value_tree
2266 * nsfns.m (x_set_background_color): Assign return value from
2267 ns_index_color to face-background instead of NSColor*.
2268 (ns_implicitly_set_icon_type): Fix indentation.
2269 Change assignment in for loop to comparison.
2271 * emacs.c (ns_pool): New variable.
2272 (main): Assign ns_pool.
2273 (Fkill_emacs): Call ns_release_autorelease_pool.
2275 * nsfont.m (ns_spec_to_descriptor): Fix indentation,
2276 autorelease fdesc, release fdAttrs and tdict.
2277 (ns_get_covering_families): Release charset.
2278 (ns_findfonts): Release NSFontDescriptor created with new.
2279 (ns_uni_to_glyphs): Fix indentation.
2280 (setString): Release attrStr before assigning new value.
2282 2011-12-18 Jan Djärv <jan.h.d@swipnet.se>
2284 * nsmenu.m (NSMenuDidBeginTrackingNotification): Declare if OSX < 10.5
2286 (trackingNotification): Surround with ifdef NS_IMPL_COCOA.
2287 (syms_of_nsmenu): Set trackingMenu to 1 if not NS_IMPL_COCOA.
2289 2011-12-18 David Reitter <reitter@cmu.edu>
2291 * nsterm.m (ns_term_init): Subscribe for notifications
2292 NSMenuDidBeginTrackingNotification and NSMenuDidEndTrackingNotification
2293 to method trackingNotification in EmacsMenu.
2295 * nsmenu.m (trackingMenu): New variable.
2296 (trackingNotification): New method (from Aquamacs).
2297 (menuNeedsUpdate): Expand comment and return if trackingMenu is 0,
2298 from Aquamacs (Bug#7030).
2300 2011-12-18 Jan Djärv <jan.h.d@swipnet.se>
2302 * nsselect.m (CUT_BUFFER_SUPPORT): Remove define.
2303 (symbol_to_nsstring): Fix indentation.
2304 (ns_symbol_to_pb): New function.
2305 (Fns_get_selection_internal): Rename from Fns_get_cut_buffer_internal.
2306 (Fns_rotate_cut_buffers_internal): Remove.
2307 (Fns_store_selection_internal): Rename from
2308 Fns_store_cut_buffer_internal.
2309 (ns_get_foreign_selection, Fx_own_selection_internal)
2310 (Fx_disown_selection_internal, Fx_selection_exists_p)
2311 (Fns_get_selection_internal, Fns_store_selection_internal):
2312 Use ns_symbol_to_pb and check if return value is nil.
2313 (syms_of_nsselect): Remove ifdef CUT_BUFFER_SUPPORT. Remove defsubr
2314 Sns_rotate_cut_buffers_internal. Sns_get_cut_buffer_internal
2315 renamed to Sns_get_selection_internal, Sns_store_cut_buffer_internal
2316 renamed to Sns_store_selection_internal.
2317 (ns_handle_selection_request): Move code to Fx_own_selection_internal
2318 and remove this function.
2319 (ns_handle_selection_clear): Remove, never used.
2320 (Fx_own_selection_internal): Move code from ns_handle_selection_request
2323 2011-12-17 Ken Brown <kbrown@cornell.edu>
2325 * fileio.c (check_writable) [CYGWIN]: Return non-zero if UID or
2326 GID is unknown (Bug#10257).
2328 2011-12-17 Paul Eggert <eggert@cs.ucla.edu>
2330 * s/gnu-linux.h: Fix mark_memory typo (Bug#10286).
2331 (GC_MARK_SECONDARY_STACK): Omit removed 3rd arg to mark_memory,
2332 which caused a build failure on GNU/Linux IA-64. This problem was
2333 introduced by my 2011-10-07 patch.
2335 2011-12-15 Juri Linkov <juri@jurta.org>
2337 * image.c (imagemagick_error): New function. (Bug#10112)
2338 (imagemagick_load_image): Comment out `MagickSetResolution' call.
2339 Use `imagemagick_error' where ImageMagick functions return
2341 (Fimagemagick_types): Add `Fnreverse' to return the list in the
2344 2011-12-15 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
2346 * xftfont.c (xftfont_draw): Use the font metrics of s->font to
2347 fill background (Bug#8992).
2349 2011-12-13 Martin Rudalics <rudalics@gmx.at>
2351 * window.c (Vwindow_combination_resize)
2352 (Vwindow_combination_limit): Use t instead of non-nil in
2354 (Vrecenter_redisplay): Add first sentence of doc-string on
2356 (Frecenter): Fix doc-string typo.
2358 2011-12-11 Kenichi Handa <handa@m17n.org>
2360 * coding.c (Funencodable_char_position): Pay attention to the
2361 buffer text relocation (Bug#9389).
2363 2011-12-10 Jan Djärv <jan.h.d@swipnet.se>
2365 * xterm.c (x_term_init): Move call to gdk_window_add_filter before
2366 gtk_init (Bug#10100).
2368 2011-12-10 Eli Zaretskii <eliz@gnu.org>
2370 * xdisp.c (RECORD_MAX_MIN_POS): Use IT->cmp_it.charpos only if
2371 IT->string is nil. (Bug#10263)
2373 2011-12-10 Jan Djärv <jan.h.d@swipnet.se>
2375 * nsterm.h (x_free_frame_resources): Declare.
2377 * nsfns.m (ns_get_defaults_value): New function (Bug#10103).
2378 (Fns_get_resource, x_get_string_resource): Call ns_get_defaults_value.
2380 * nsterm.h (ns_get_defaults_value): Declare.
2382 * nsterm.m (ns_default): Call ns_get_defaults_value.
2384 2011-12-09 Eli Zaretskii <eliz@gnu.org>
2386 * xdisp.c (try_scrolling): Don't set scroll_down_p if dy is zero.
2389 2011-12-09 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
2391 * unexelf.c (unexec) [NS_IMPL_GNUSTEP]: Take account of the case
2392 that where the value of an _OBJC_* symbol points to is in the .bss
2393 section (Bug#10240).
2395 2011-12-08 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
2397 * coding.c (encode_coding_ccl): Check (charbuf < charbuf_end)
2398 after the loop to call ccl_driver at least once (Bug#8619).
2400 2011-12-08 Kenichi Handa <handa@m17n.org>
2402 * ftfont.c (get_adstyle_property): Fix previous change
2405 2011-12-07 Juanma Barranquero <lekktu@gmail.com>
2407 * w32.c (init_environment): If no_site_lisp, remove site-lisp
2408 dirs from the default value of EMACSLOADPATH (bug#10208).
2410 2011-12-07 Glenn Morris <rgm@gnu.org>
2412 * lread.c (init_lread): If no_site_lisp, exclude site-lisp/ in
2413 installation and source directories as well. (Bug#10208)
2415 2011-12-06 Chong Yidong <cyd@gnu.org>
2417 * minibuf.c (Fread_from_minibuffer): Doc fix (Bug#10228).
2419 2011-12-06 Glenn Morris <rgm@gnu.org>
2421 * process.c (start_process_unwind): Treat any pid <= 0, except -2,
2422 as an error, not just -1. (Bug#10217)
2424 2011-12-05 Chong Yidong <cyd@gnu.org>
2426 * keyboard.c (process_special_events): New function.
2427 (swallow_events, Finput_pending_p): Use it (Bug#10195).
2429 2011-12-05 Paul Eggert <eggert@cs.ucla.edu>
2431 * coding.c (encode_designation_at_bol): Don't use uninitialized
2432 local variable (Bug#9318).
2434 2011-12-05 Kenichi Handa <handa@m17n.org>
2436 * ftfont.c (get_adstyle_property): If the font is not BDF nor PCF,
2437 return Qnil (Bug#8046, Bug#10193).
2439 2011-12-05 Kenichi Handa <handa@m17n.org>
2441 * coding.c (encode_designation_at_bol): New args charbuf_end and
2442 dst. Return the number of produced bytes. Callers changed.
2443 (coding_set_source): Return how many bytes coding->source was
2445 (coding_set_destination): Return how many bytes
2446 coding->destination was relocated.
2447 (CODING_DECODE_CHAR, CODING_ENCODE_CHAR, CODING_CHAR_CHARSET)
2448 (CODING_CHAR_CHARSET_P): Adjust for the avove changes.
2450 2011-12-05 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
2452 * coding.c (CODING_CHAR_CHARSET_P): New macro.
2453 (encode_coding_emacs_mule, encode_coding_iso_2022): Use the above
2456 2011-12-05 Andreas Schwab <schwab@linux-m68k.org>
2458 The following changes are to fix Bug#9318.
2460 * coding.c (CODING_ENCODE_CHAR, CODING_CHAR_CHARSET): New macros.
2461 (encode_coding_emacs_mule, ENCODE_ISO_CHARACTER)
2462 (encode_coding_iso_2022, encode_coding_sjis)
2463 (encode_coding_big5, encode_coding_charset): Use the above macros.
2465 2011-12-05 Juanma Barranquero <lekktu@gmail.com>
2467 * lisp.h (process_quit_flag): Fix external declaration.
2469 2011-12-04 Stefan Monnier <monnier@iro.umontreal.ca>
2471 Don't macro-inline non-performance-critical code.
2472 * eval.c (process_quit_flag): New function.
2473 * lisp.h (QUIT): Use it.
2475 2011-12-04 Jan Djärv <jan.h.d@swipnet.se>
2477 * nsfns.m (get_geometry_from_preferences): New function.
2478 (Fx_create_frame): Call get_geometry_from_preferences (Bug#10103).
2480 2011-12-04 Andreas Schwab <schwab@linux-m68k.org>
2482 * emacs.c (Qkill_emacs): Define.
2483 (syms_of_emacs): Initialize it.
2484 * keyboard.c (interrupt_signal): Don't call Fkill_emacs here, set
2485 Qquit_flag to `kill-emacs' instead.
2486 (quit_throw_to_read_char): Add parameter `from_signal'.
2487 All callers changed. Call Fkill_emacs if requested and safe.
2488 * lisp.h (QUIT): Call Fkill_emacs if requested.
2490 2011-12-03 Jan Djärv <jan.h.d@swipnet.se>
2492 * widget.c (update_wm_hints): Return if wmshell is null.
2493 (widget_update_wm_size_hints): New function.
2495 * widget.h (widget_update_wm_size_hints): Declare.
2497 * xterm.c (x_wm_set_size_hint): If USE_X_TOOLKIT, call
2498 widget_update_wm_size_hints (Bug#10104).
2500 2011-12-03 Eli Zaretskii <eliz@gnu.org>
2502 * xdisp.c (handle_invisible_prop): If the invisible text ends just
2503 before a newline, prepare the bidi iterator for consuming the
2504 newline, and keep the current paragraph direction. (Bug#10183)
2505 (redisplay_window): Don't let `margin' become negative. (Bug#10192)
2507 2011-12-02 Juri Linkov <juri@jurta.org>
2509 * search.c (Fword_search_regexp): New Lisp function created from
2510 `wordify'. Change type of arg `lax' from `int' to `Lisp_Object'.
2511 (Fword_search_backward, Fword_search_forward)
2512 (Fword_search_backward_lax, Fword_search_forward_lax):
2513 Use `Fword_search_regexp' instead of `wordify'. Doc fix.
2514 (syms_of_search): Define `Sword_search_regexp'. (Bug#10145)
2516 2011-12-01 Stefan Monnier <monnier@iro.umontreal.ca>
2518 * fileio.c (Finsert_file_contents): Move after-change-function call
2519 to before the "handled:" label, since all "goto handled" appear in
2520 cases where the *-change-functions have already been properly called
2523 2011-12-01 Andreas Schwab <schwab@linux-m68k.org>
2525 * keyboard.c (interrupt_signal): Don't call kill-emacs when
2526 waiting for input. (Bug#10169)
2528 2011-11-30 Eli Zaretskii <eliz@gnu.org>
2530 * dispnew.c (adjust_glyph_matrix): Remove the assertion that
2531 verifies glyph row's hash code--we have just reallocated the
2532 glyphs, so their contents can be complete garbage. (Bug#10164)
2534 2011-11-30 Juanma Barranquero <lekktu@gmail.com>
2536 * dispnew.c (adjust_glyph_matrix) [XASSERTS]: Add missing check.
2538 2011-11-30 Eli Zaretskii <eliz@gnu.org>
2540 * dispnew.c (adjust_glyph_matrix) [XASSERTS]: Ensure ROW's
2541 attributes are tested _before_ calling verify_row_hash, to protect
2542 against GCC re-ordering of the tests. (Bug#10164)
2544 2011-11-29 Jan Djärv <jan.h.d@swipnet.se>
2546 * xterm.h (struct x_output): net_wm_state_hidden_seen is new.
2548 * xterm.c (handle_one_xevent): Only set async_visible and friends
2549 if net_wm_state_hidden_seen is non-zero (Bug#10002)
2550 (get_current_wm_state): Set net_wm_state_hidden_seen to 1 if
2551 _NET_WM_STATE_HIDDEN is in NET_WM_STATE.
2553 2011-11-28 Paul Eggert <eggert@cs.ucla.edu>
2555 Remove GCPRO-related macros that exist only to avoid shadowing locals.
2556 * lisp.h (GCPRO1_VAR, GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR, GCPRO5_VAR)
2557 (GCPRO6_VAR, UNGCPRO_VAR): Remove. See
2558 <http://lists.gnu.org/archive/html/emacs-diffs/2011-11/msg00265.html>.
2559 All uses changed to use GCPRO1 etc.
2560 (GCPRO1, GCPRO2, GCPRO3, GCPRO4, GCPRO5, GCPRO6, UNGCPRO):
2561 Revert to old implementation (i.e., before 2011-03-11).
2563 2011-11-28 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
2565 * dispnew.c (scrolling_window): Truncate overlaps in copy destination
2566 of scroll runs so as to avoid assigning disabled bogus rows and
2567 unnecessary graphics copy operations.
2569 2011-11-27 Eli Zaretskii <eliz@gnu.org>
2571 * s/ms-w32.h (utimbuf) [_MSC_VER]: Don't define.
2572 (snprintf) [_MSC_VER]: Redirect to _snprintf.
2573 (strtoll) [_MSC_VER]: Redirect to _strtoi64.
2574 (malloc, free, realloc, calloc): Redirect to e_* only when
2577 * lisp.h (GCTYPEBITS): Move before first use.
2578 (ALIGN_GCTYPEBITS) [_MSC_VER]: Define.
2579 (DECL_ALIGN) [_MSC_VER]: Use it, as MSVC doesn't like bit ops in
2580 this macro definition.
2582 * s/ms-w32.h (tzname): Redirect to _tzname for all values of
2585 2011-11-27 Jan Djärv <jan.h.d@swipnet.se>
2587 * gtkutil.c (xg_create_frame_widgets):
2588 Call gtk_window_set_has_resize_grip (FALSE) if that function is
2589 present with Gtk+ 2.0.
2591 2011-11-26 Paul Eggert <eggert@cs.ucla.edu>
2593 * fileio.c (Finsert_file_contents): Undo previous change; see
2594 <http://lists.gnu.org/archive/html/emacs-diffs/2011-11/msg00265.html>.
2596 2011-11-26 Paul Eggert <eggert@cs.ucla.edu>
2598 Rename locals to avoid shadowing.
2599 * fileio.c (Finsert_file_contents):
2600 Rename inner 'gcpro1' to 'inner_gcpro1' to avoid shadowing.
2601 * process.c (wait_reading_process_output):
2602 Rename inner 'proc' to 'p' to avoid shadowing.
2603 Indent for consistency with usual Emacs style.
2605 2011-11-25 Eli Zaretskii <eliz@gnu.org>
2607 * xdisp.c (redisplay_window): If cursor row is not fully visible
2608 after recentering, and scroll-conservatively is set to a large
2609 number, scroll window by a few more lines to make the cursor fully
2610 visible and out of scroll-margin. (Bug#10105)
2611 (start_display): Don't move to the next line if the display should
2612 start at a newline that is part of a display vector or an overlay
2615 2011-11-24 Juri Linkov <juri@jurta.org>
2617 * image.c (imagemagick_load_image): Move `MagickSetResolution' down
2618 after the `MagickPingImage' call. (Bug#10112)
2620 2011-11-23 Chong Yidong <cyd@gnu.org>
2622 * window.c (Fcoordinates_in_window_p): Accept only live windows.
2624 2011-11-23 Martin Rudalics <rudalics@gmx.at>
2626 * buffer.c (Fkill_buffer): Run replace_buffer_in_windows before
2627 making another buffer current. (Bug#10114)
2629 2011-11-23 Glenn Morris <rgm@gnu.org>
2631 * font.c (font_find_for_lface) [HAVE_NS]: Ignore case. (Bug#2526)
2633 2011-11-23 Chong Yidong <cyd@gnu.org>
2635 * xdisp.c (compute_stop_pos): Check validity of end_charpos before
2636 using it (Bug#5984).
2638 2011-11-22 Eli Zaretskii <eliz@gnu.org>
2640 * dispnew.c (adjust_glyph_matrix): Don't verify hash code of mode-
2641 and header-lines, as they don't have one computed for them.
2644 * .gdbinit (prow): Make displayed values more self-explaining.
2645 Add row's hash code.
2647 2011-11-21 Lars Magne Ingebrigtsen <larsi@gnus.org>
2649 * process.c (wait_reading_process_output): Fix asynchrounous
2650 GnuTLS socket handling on some versions of the GnuTLS library.
2651 (wait_reading_process_output): Add comment and URL.
2653 2011-11-21 Jan Djärv <jan.h.d@swipnet.se>
2655 * xterm.c (x_clear_frame): Reinstate the XClearWindow call.
2657 2011-11-21 Chong Yidong <cyd@gnu.org>
2659 * window.c (Fnext_window, Fprevious_window): Doc fix.
2661 2011-11-20 Stefan Monnier <monnier@iro.umontreal.ca>
2663 * window.c (get_phys_cursor_glyph): Fix Lisp_Object/int mixup.
2665 2011-11-20 Juanma Barranquero <lekktu@gmail.com>
2667 * nsfont.m (syms_of_nsfont) <ns-reg-to-script>: Fix typo.
2669 2011-11-20 Martin Rudalics <rudalics@gmx.at>
2671 * window.c (Fset_window_combination_limit): Rename argument
2673 (Vwindow_combination_limit): Remove "status" from doc-string.
2675 2011-11-20 Andreas Schwab <schwab@linux-m68k.org>
2677 * m/ibms390.h: Remove.
2678 * m/ibms390x.h: Don't include "ibms390.h".
2680 2011-11-20 Stefan Monnier <monnier@iro.umontreal.ca>
2682 * fileio.c (Finsert_file_contents): Add missing gcpro1 variable.
2683 Suggested by Dmitry Antipov <dmantipov@yandex.ru>.
2685 2011-11-20 Juanma Barranquero <lekktu@gmail.com>
2687 * casetab.c (Fset_case_table):
2688 * charset.c (Fcharset_after): Fix typos.
2690 2011-11-20 Paul Eggert <eggert@cs.ucla.edu>
2692 Standardize on VIRT_ADDR_VARIES behavior (Bug#10042).
2693 Otherwise, valgrind does not work on some platforms.
2694 Problem reported by Andreas Schwab in
2695 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00081.html>.
2696 * puresize.h (pure, PURE_P): Always behave as if VIRT_ADDR_VARIES
2697 is set, removing the need for VIRT_ADDRESS_VARIES.
2698 (PURE_P): Use a more-efficient implementation that needs just one
2699 comparison, not two: on x86-64 with GCC 4.6.2, this cut down the
2700 number of instructions from 6 (xorl, cmpq, jge, xorl, cmpq, setge)
2701 to 4 (xorl, subq, cmpq, setbe).
2702 * alloc.c (pure): Always extern now, since that's the
2703 VIRT_ADDR_VARIES behavior.
2704 (PURE_POINTER_P): Use a single comparison, not two, for
2705 consistency with the new puresize.h.
2706 * lisp.h (PNTR_COMPARISON_TYPE): Remove; no longer needed.
2707 * m/ibms390.h, m/intel386.h, m/template.h, s/cygwin.h, s/hpux10-20.h:
2708 Remove VIRT_ADDR_VARIES no longer needed.
2710 2011-11-19 Eli Zaretskii <eliz@gnu.org>
2712 * xdisp.c (x_write_glyphs, draw_phys_cursor_glyph)
2713 (erase_phys_cursor, update_window_cursor, show_mouse_face)
2714 (cursor_in_mouse_face_p): If the cursor position is out of bounds,
2715 behave as if the cursor position were at the window margin.
2717 * window.c (get_phys_cursor_glyph): If the window is hscrolled,
2718 and the cursor position is out of bounds, behave as if the cursor
2719 position were at the window margin. (Bug#10075)
2721 2011-11-18 Chong Yidong <cyd@gnu.org>
2723 * window.c (Fwindow_combination_limit): Make first argument
2724 non-optional, since it is meaningless for live windows like the
2727 2011-11-18 Dmitry Antipov <dmantipov@yandex.ru>
2729 * keymap.c (Fwhere_is_internal): Add missing RETURN_UNGCPROs.
2731 2011-11-18 Stefan Monnier <monnier@iro.umontreal.ca>
2733 * intervals.c: Fix grafting over the whole buffer (bug#10071).
2734 (graft_intervals_into_buffer): Simplify.
2736 2011-11-18 Eli Zaretskii <eliz@gnu.org>
2738 * dispnew.c (swap_glyph_pointers): Swap the used[] arrays and the
2739 hash values of the two rows.
2740 (copy_row_except_pointers): Preserve the used[] arrays and the
2741 hash values of the two rows. (Bug#10035)
2742 (add_row_entry): Add xassert to verify that ROW's hash code is valid.
2744 * xdisp.c (row_hash): New function, body extracted from
2745 compute_line_metrics.
2746 (compute_line_metrics): Call row_hash, instead of computing the
2749 * dispnew.c (verify_row_hash): Call row_hash for computing the
2750 hash code of a row, instead of duplicating code from xdisp.c.
2752 * dispextern.h (row_hash): Add prototype.
2754 2011-11-18 Tassilo Horn <tassilo@member.fsf.org>
2756 * frame.c (delete_frame): Don't delete the terminal when the last
2757 X frame is closed if emacs is built with GTK toolkit.
2759 2011-11-17 Juanma Barranquero <lekktu@gmail.com>
2761 * window.c (syms_of_window) <window-combination-resize>: Fix typo.
2763 2011-11-17 Martin Rudalics <rudalics@gmx.at>
2765 * window.c (Vwindow_splits): Rename to
2766 Vwindow_combination_resize. Suggested by Juri Linkov.
2767 (Fsplit_window_internal): Use Vwindow_combination_resize instead
2770 2011-11-16 Juanma Barranquero <lekktu@gmail.com>
2772 * nsfns.m (Fns_font_name):
2773 * window.c (syms_of_window) <window-combination-limit>: Fix typos.
2775 2011-11-16 Martin Rudalics <rudalics@gmx.at>
2777 * window.h (window): Rename slot "nest" to "combination_limit".
2778 * window.c (Fwindow_nest): Rename to Fwindow_combination_limit.
2779 (Fset_window_nest): Rename to Fset_window_combination_limit.
2780 (Vwindow_nest): Rename to Vwindow_combination_limit.
2781 (recombine_windows, make_parent_window, make_window)
2782 (Fsplit_window_internal, saved_window)
2783 (Fset_window_configuration, save_window_save): Rename all
2784 occurrences of window_nest to window_combination_limit.
2786 2011-11-15 Juanma Barranquero <lekktu@gmail.com>
2788 * image.c (imagemagick_load_image): Fix typo.
2790 2011-11-14 Eli Zaretskii <eliz@gnu.org>
2792 * xdisp.c (display_line): Move the call to
2793 highlight_trailing_whitespace before the call to
2794 compute_line_metrics, since the latter needs to see the final
2795 faces of all the glyphs to compute ROW's hash value.
2796 Fixes assertion violations in row_equal_p. (Bug#10035)
2798 2011-11-14 Juanma Barranquero <lekktu@gmail.com>
2800 * w32proc.c (reader_thread): Don't check pending input if cp->fd < 0,
2801 just return (bug#10044).
2803 2011-11-12 Eli Zaretskii <eliz@gnu.org>
2805 * makefile.w32-in (HEAPSIZE): New variable, allows to build temacs
2806 with user-defined heap size. Bump the default size of the temacs
2807 heap to 27MB, to avoid memory warning when running temacs.
2808 ($(TEMACS)): Use HEAPSIZE instead of a hardcoded value.
2810 * dispnew.c (scrolling_window): Fix incorrect indices in accessing
2811 current_matrix and desired_matrix. (Bug#9990)
2812 (verify_row_hash) [XASSERTS]: New function.
2813 (adjust_glyph_matrix, row_equal_p): Use it in xassert to verify
2814 that the hash value of glyph rows is correct.
2816 2011-11-12 Martin Rudalics <rudalics@gmx.at>
2818 * window.h (window): Remove splits slot.
2819 * window.c (Fwindow_splits, Fset_window_splits): Remove.
2820 (Fdelete_other_windows_internal, make_parent_window)
2821 (make_window, Fsplit_window_internal, Fdelete_window_internal)
2822 (Fset_window_configuration, save_window_save): Don't deal with
2823 split status of windows.
2824 (saved_window): Remove splits slot.
2825 (Vwindow_splits): Rewrite doc-string.
2827 2011-11-11 Jan Djärv <jan.h.d@swipnet.se>
2829 * xfns.c (unwind_create_frame):
2830 * nsfns.m (unwind_create_frame):
2831 * w32fns.c (unwind_create_frame): Use Fmemq to check if frame is in
2832 Vframe_list (Bug#9999).
2834 2011-11-11 Dmitry Antipov <dmantipov@yandex.ru>
2836 * xdisp.c (syms_of_xdisp): Remove duplicated definition of Qtext.
2838 2011-11-11 Kenichi Handa <handa@m17n.org>
2840 * callproc.c (Fcall_process): Set the member dst_multibyte of
2843 2011-11-11 Johan Bockgård <bojohan@gnu.org>
2845 * xdisp.c (fill_composite_glyph_string): Always set s->face, to
2846 avoid a crash (bug#9496).
2848 2011-11-09 Chong Yidong <cyd@gnu.org>
2850 * window.c (Fwindow_inside_edges, Fwindow_inside_pixel_edges)
2851 (Fwindow_inside_absolute_pixel_edges): Only allow live windows.
2853 2011-11-08 Paul Eggert <eggert@cs.ucla.edu>
2855 * s/gnu.h (GC_MARK_STACK): Define to GC_MAKE_GCPROS_NOOPS (Bug#9926).
2857 2011-11-08 Paul Eggert <eggert@cs.ucla.edu>
2859 Avoid some portability problems by eschewing 'extern inline' functions.
2860 The trivial performance wins aren't worth the portability hassles; see
2861 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00084.html>
2863 * dispextern.h (window_box, window_box_height, window_text_bottom_y)
2864 (window_box_width, window_box_left, window_box_left_offset)
2865 (window_box_right, window_box_right_offset): Undo previous change,
2866 by removing the "extern"s.
2867 * intervals.c (adjust_intervals_for_insertion)
2868 (adjust_intervals_for_deletion): Undo previous change,
2869 making these static again.
2870 (offset_intervals, temp_set_point_both, temp_set_point)
2871 (copy_intervals_to_string): No longer inline.
2872 * xdisp.c (window_text_bottom_y, window_box_width)
2873 (window_box_height, window_box_left_offset)
2874 (window_box_right_offset, window_box_left, window_box_right)
2875 (window_box): No longer inline.
2877 2011-11-08 Chong Yidong <cyd@gnu.org>
2879 * window.c (Fwindow_left_column, Fwindow_top_line): Doc fix.
2880 (Fwindow_body_height, Fwindow_body_width): Move from Lisp.
2881 Signal an error if not a live window.
2882 (Fwindow_total_width, Fwindow_total_height): Move from Lisp.
2883 (Fwindow_total_size, Fwindow_body_size): Move to Lisp.
2885 2011-11-07 Juanma Barranquero <lekktu@gmail.com>
2887 * lisp.h (syms_of_abbrev): Remove declaration.
2888 Reported by CHENG Gao <chenggao@royau.me>.
2890 2011-11-07 Eli Zaretskii <eliz@gnu.org>
2892 * w32.c (check_windows_init_file): Don't look for term/w32-win.el
2893 if Vpurify_flag is non-nil. Fixes a crash when running w32 build
2894 of temacs in GUI mode.
2896 2011-11-07 Martin Rudalics <rudalics@gmx.at>
2898 * window.h: Declare delete_all_child_windows instead of
2899 delete_all_subwindows.
2900 * window.c (Fwindow_nest, Fset_window_nest)
2901 (Fset_window_new_total, Fset_window_new_normal)
2902 (Fwindow_resize_apply): Don't use term subwindow in doc-strings.
2903 (delete_all_subwindows): Rename to delete_all_child_windows.
2904 (Fdelete_other_windows_internal, Fset_window_configuration):
2905 Call delete_all_child_windows instead of delete_all_subwindows.
2906 * frame.c (delete_frame): Call delete_all_child_windows instead
2907 of delete_all_subwindows.
2909 2011-11-07 Paul Eggert <eggert@cs.ucla.edu>
2911 * alloc.c (DEADP): New macro, for porting to GNU/Hurd (Bug#9926).
2912 This is also needed for porting to any host where GC_MARK_STACK is
2913 not GC_MAKE_GCPROS_NOOPS.
2914 (which_symbols): Use it.
2916 2011-11-07 Kenichi Handa <handa@m17n.org>
2918 * coding.c (coding_set_destination): Check coding->src_pos only
2919 when coding->src_object is a buffer (bug#9910).
2921 * process.c (send_process): Set the member src_multibyte of coding
2922 to 0 (bug#9911) when sending a unibyte text.
2924 * callproc.c (Fcall_process): Set the member src_multibyte of
2925 process_coding to 0 (bug#9912).
2927 2011-11-06 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
2929 * xmenu.c (cleanup_widget_value_tree): New function.
2930 (xmenu_show, xdialog_show): Use it in record_unwind_protect instead of
2931 calling free_menubar_widget_value_tree directly (Bug#9830).
2933 2011-11-06 Paul Eggert <eggert@cs.ucla.edu>
2935 Fix some portability problems with 'inline'.
2936 * dispextern.h (window_box, window_box_height, window_text_bottom_y)
2937 (window_box_width, window_box_left, window_box_left_offset)
2938 (window_box_right, window_box_right_offset): Declare extern.
2939 Otherwise, these inline functions do not conform to C99 and
2940 are miscompiled by Microsoft compilers. Reported by Eli Zaretskii in
2941 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00084.html>.
2942 * intervals.c (adjust_intervals_for_insertion)
2943 (adjust_intervals_for_deletion): Now extern, because otherwise the
2944 extern inline functions 'offset_intervals' couldn't refer to it.
2945 (static_offset_intervals): Remove.
2946 (offset_intervals): Rewrite using the old contents of
2947 static_offset_intervals. The old version didn't conform to C99
2948 because an extern inline function contained a reference to an
2949 identifier with static linkage.
2951 2011-11-06 Andreas Schwab <schwab@linux-m68k.org>
2953 * keyboard.c (interrupt_signal): Don't call kill-emacs while in
2956 2011-11-06 Eli Zaretskii <eliz@gnu.org>
2958 * xdisp.c (init_iterator, reseat_to_string): Don't set the
2959 iterator's bidi_p flag if Vpurify_flag is non-nil. (Bug#9963)
2960 (Fcurrent_bidi_paragraph_direction): If Vpurify_flag is non-nil,
2961 return Qleft_to_right.
2963 2011-11-06 Chong Yidong <cyd@gnu.org>
2965 * window.c (Fwindow_live_p, Fwindow_frame, Fframe_root_window)
2966 (Fminibuffer_window, Fwindow_buffer, Fwindow_splits)
2967 (Fset_window_splits, Fwindow_nest, Fset_window_nest)
2968 (Fwindow_use_time, Fwindow_total_size, Fwindow_normal_size)
2969 (Fwindow_new_normal, Fwindow_left_column, Fwindow_top_line)
2970 (Fwindow_margins, Fwindow_fringes, Fwindow_scroll_bars)
2971 (Fwindow_vscroll): Doc fix.
2972 (Fwindow_top_child, Fwindow_left_child): Eliminate a nil default
2973 argument, since it makes no sense to pass a live window and for
2974 consistency with window-child.
2976 2011-11-05 Christoph Scholtes <cschol2112@googlemail.com>
2978 * makefile.w32-in ($(TEMACS), (gl-stamp)): Use $(THISDIR) to
2981 2011-11-05 Jason Rumney <jasonr@gnu.org>
2983 * w32font.c (font_matches_spec): Filter out non-Japanese kana fonts.
2984 (add_font_entity_to_list): Filter out non-Japanese Shift-JIS
2986 (add_font_entity_to_list): Fix logic errors in mixed boolean and
2987 bitwise arithmetic preventing use of unicode-sip and non-truetype
2990 2011-11-05 Eli Zaretskii <eliz@gnu.org>
2992 * s/ms-w32.h (fstat, stat, utime): Move redirections to
2995 * w32fns.c (x_create_tip_frame, Fx_create_frame): Rearrange
2996 initialization code to keep similarity to xfns.c after changes
2999 2011-11-05 Jan Djärv <jan.h.d@swipnet.se>
3001 * nsfns.m: Declare image_cache_refcount if GLYPH_DEBUG.
3002 (unwind_create_frame): New function (Bug#9943).
3003 (Fx_create_frame): Restructure code to be more similar to the one in
3004 xfns.c. Call record_unwind_protect with unwind_create_frame (Bug#9943).
3005 Initialize image_cache_refcount if GLYPH_DEBUG (Bug#9943).
3006 Move terminal->reference_count++ just before making the frame official
3009 * nsterm.m (x_free_frame_resources): New function.
3010 (x_destroy_window): Move code to x_free_frame_resources.
3012 * xfns.c (unwind_create_frame): Fix comment.
3013 (Fx_create_frame, x_create_tip_frame):
3014 Move terminal->reference_count++ just before making the frame
3015 official. Move initialization of image_cache_refcount and
3016 dpyinfo_refcount before calling init_frame_faces (Bug#9943).
3018 2011-11-05 Eli Zaretskii <eliz@gnu.org>
3020 Support MSVC build with newer versions of Visual Studio.
3021 * makefile.w32-in (TAGS-gmake): Don't use $(patsubst ...), as
3022 Nmake barfs on that. Use $(OBJ*_c) variables instead, defined on
3025 * lisp.h (ENUM_BF): New macro, for enumerated types in bitfields,
3026 which are not supported by MSVC.
3027 (Lisp_Symbol, Lisp_Misc_Any, Lisp_Marker, Lisp_Misc_Overlay)
3028 (Lisp_Save_Value, Lisp_Free): Use ENUM_BF for enumerated types in
3030 (Lisp_Object) [USE_LISP_UNION_TYPE]: Use ENUM_BF for enumerated
3032 (DEFUN) [_MSC_VER]: Define in a different way for MSVC.
3034 * w32fns.c [_MSC_VER]: DECLARE_HANDLE for any MSVC version.
3036 2011-11-05 Fabrice Popineau <fabrice.popineau@supelec.fr> (tiny change)
3038 Support MSVC build with newer versions of Visual Studio.
3039 * w32.c: Don't include w32api.h for MSVC.
3040 (init_environment) [_MSC_VER]: Call sys_access, not _access.
3042 * s/ms-w32.h <sigset_t, ssize_t> [_MSC_VER]: Typedefs for MSVC.
3043 [_MSC_VER]: Include sys/timeb.h, sys/stat.h, and signal.h.
3044 (fstat, stat, utime) [_MSC_VER]: Redirect to their sys_* cousins.
3045 (malloc, free, realloc, calloc) [_MSC_VER]: Always redirect to the
3047 (alloca) [_MSC_VER]: Define to _alloca.
3049 * lisp.h (DECL_ALIGN) [_MSC_VER]: Define for MSVC.
3051 * regex.c <re_char> [_MSC_VER]: A separate definition for MSVC.
3053 2011-11-04 Eli Zaretskii <eliz@gnu.org>
3055 * xdisp.c (note_mouse_highlight): If either of
3056 previous/next-single-property-change returns nil, treat that as
3057 the beginning or the end of the buffer. (Bug#9955)
3059 2011-11-04 Jan Djärv <jan.h.d@swipnet.se>
3061 * gtkutil.c (xg_make_tool_item): Add callbacks if one of wimage or
3062 label is not null (Bug#9951).
3063 (xg_tool_item_stale_p): Handle the fact that wimage and/or wlbl
3066 2011-11-04 Eli Zaretskii <eliz@gnu.org>
3068 * window.c (Fwindow_body_size): Mention in the doc string that the
3069 return value is in frame's canonical units. (Bug#9949)
3071 2011-11-03 Eli Zaretskii <eliz@gnu.org>
3073 * xdisp.c (note_mouse_highlight): Initialize `area'. (Bug#9947)
3075 * w32fns.c (unwind_create_frame): If needed, free the glyph
3076 matrices of the partially constructed frame. (Bug#9943)
3077 * xfns.c (unwind_create_frame): Likewise.
3079 2011-11-01 Eli Zaretskii <eliz@gnu.org>
3081 * xdisp.c (mouse_face_from_buffer_pos): Fix a typo in a comment.
3082 Don't stop backward scan on the continuation glyph, even though
3083 its CHARPOS is positive.
3084 (mouse_face_from_buffer_pos, note_mouse_highlight):
3085 Rename cover_string to disp_string.
3087 2011-11-01 Martin Rudalics <rudalics@gmx.at>
3089 * window.c (temp_output_buffer_show): Don't use
3090 Vtemp_buffer_show_specifiers.
3091 (Vtemp_buffer_show_specifiers): Remove unused variable.
3093 2011-10-30 Eli Zaretskii <eliz@gnu.org>
3095 * xdisp.c (try_cursor_movement): Make sure ROW isn't decremented
3096 past the beginning of the current glyph matrix.
3098 2011-10-30 Adam Sjøgren <asjo@koldfront.dk> (tiny change)
3100 * xterm.c: Include X11/Xproto.h if HAVE_GTK3.
3101 (x_error_handler): Ignore BadMatch for X_SetInputFocus for
3102 HAVE_GTK3 (Bug#9869).
3104 * gtkutil.c (xg_win_to_widget, xg_event_is_for_menubar): Initialize
3105 type to GDK_NOTHING so valgrind does not complain (Bug#9901).
3107 * xterm.h (x_display_info): Add Xatom_net_wm_state_hidden (Bug#9893).
3109 * xterm.c: Declare x_handle_net_wm_state to return int.
3110 (handle_one_xevent): Check if we are iconified but don't have
3111 _NET_WM_STATE_HIDDEN. If do, treat as deiconify (Bug#9893).
3112 (get_current_wm_state): Return non-zero if not hidden,
3113 check for _NET_WM_STATE_HIDDEN (Bug#9893).
3114 (do_ewmh_fullscreen): Ignore return value from get_current_wm_state.
3115 (x_handle_net_wm_state): Return what get_current_wm_state returns.
3116 (x_term_init): Initialize dpyinfo->Xatom_net_wm_state_hidden.
3118 2011-10-29 Paul Eggert <eggert@cs.ucla.edu>
3120 * alloc.c (which_symbols): Declare EXTERNALLY_VISIBLE,
3121 so that this new function doesn't get optimized away by a
3122 whole-program optimizer. Make the 2nd arg EMACS_INT, not int.
3124 2011-10-29 Andreas Schwab <schwab@linux-m68k.org>
3126 * frame.h (MOUSE_HL_INFO): Remove excess parens.
3128 2011-10-29 Eli Zaretskii <eliz@gnu.org>
3130 Fix the `xbytecode' command.
3131 * .gdbinit (xprintbytestr): New command.
3132 (xwhichsymbols): Rename from `which'; all callers changed.
3133 (xbytecode): Print the byte-code string as well.
3135 2011-10-29 Kim Storm <storm@cua.dk>
3137 * alloc.c (which_symbols): New function.
3139 2011-10-29 Andreas Schwab <schwab@linux-m68k.org>
3141 * minibuf.c (read_minibuf_noninteractive): Allow reading empty
3144 2011-10-29 Glenn Morris <rgm@gnu.org>
3146 * process.c (wait_reading_process_output): Revert 2009-08-30 change.
3147 Not clear what it was for, and it causes various bugs. (Bug#9839)
3149 2011-10-28 Eli Zaretskii <eliz@gnu.org>
3151 * xdisp.c (note_mouse_highlight): Initialize `part', to avoid a
3152 possible random value that matches one of those tested as
3153 condition to clear the mouse face.
3155 2011-10-28 Chong Yidong <cyd@gnu.org>
3157 * xdisp.c (note_mouse_highlight): Fix use of uninitialized var.
3159 2011-10-28 Dan Nicolaescu <dann@ics.uci.edu>
3161 * window.c (make_window): Initialize phys_cursor_on_p.
3163 2011-10-28 Stefan Monnier <monnier@iro.umontreal.ca>
3165 * lisp.h (struct Lisp_Symbol): Update comments.
3167 2011-10-28 Juanma Barranquero <lekktu@gmail.com>
3169 * w32font.c (w32_load_unicows_or_gdi32): Add missing return.
3171 2011-10-28 Eli Zaretskii <eliz@gnu.org>
3173 Fix Emacs on Windows 9X (bug#8562). Thanks to oslsachem
3174 <oslsachem@gmail.com> for helping to debug this.
3176 * w32font.c (g_b_init_is_w9x, g_b_init_get_outline_metrics_w)
3177 (g_b_init_get_text_metrics_w, g_b_init_get_glyph_outline_w)
3178 (g_b_init_get_glyph_outline_w): New static variables.
3179 (GetOutlineTextMetricsW_Proc, GetTextMetricsW_Proc)
3180 (GetGlyphOutlineW_Proc): New typedefs.
3181 (w32_load_unicows_or_gdi32, get_outline_metrics_w)
3182 (get_text_metrics_w, get_glyph_outline_w, globals_of_w32font):
3184 (w32font_open_internal, compute_metrics):
3185 Call get_outline_metrics_w, get_text_metrics_w, and get_glyph_outline_w
3186 instead of calling the "wide" APIs directly.
3188 * emacs.c (main) [HAVE_NTGUI]: Call globals_of_w32font.
3190 * w32.h (syms_of_w32font): Add prototype.
3192 2011-10-27 Juanma Barranquero <lekktu@gmail.com>
3194 * window.c (Fframe_root_window, Fframe_first_window, Fwindow_end)
3195 (Fframe_selected_window, Ftemp_output_buffer_show, Fnext_window)
3196 (Fdelete_window_internal, Fwindow_parameters): Fix typos in docstrings.
3197 (Fmove_to_window_line): Doc fix.
3199 2011-10-27 Chong Yidong <cyd@gnu.org>
3201 * process.c (make_process): Set gnutls_state to NULL.
3203 * gnutls.c (emacs_gnutls_deinit): Deinit the gnutls_state if it is
3204 non-NULL, regardless of GNUTLS_INITSTAGE.
3205 (Fgnutls_boot): Cleanups. Call emacs_gnutls_deinit if we signal
3206 an error. Set process slots as soon as we allocate them.
3208 * gnutls.h (GNUTLS_LOG, GNUTLS_LOG2): Fix macros.
3210 2011-10-27 Chong Yidong <cyd@gnu.org>
3212 * gnutls.c (emacs_gnutls_deinit): New function.
3213 Deallocate credentials structures as well as calling gnutls_deinit.
3214 (Fgnutls_deinit, Fgnutls_boot): Use it.
3216 * process.c (make_process): Initialize GnuTLS credentials to NULL.
3217 (deactivate_process): Call emacs_gnutls_deinit.
3219 2011-10-27 Juanma Barranquero <lekktu@gmail.com>
3221 * image.c (x_create_x_image_and_pixmap):
3222 * w32.c (sys_rename, w32_delayed_load):
3223 * w32font.c (fill_in_logfont):
3224 * w32reg.c (x_get_string_resource): Silence compiler warnings.
3226 2011-10-26 Juanma Barranquero <lekktu@gmail.com>
3228 * w32fns.c (w32_default_color_map): New function,
3229 extracted from Fw32_default_color_map.
3230 (Fw32_default_color_map, Fx_open_connection): Use it. (Bug#9785)
3232 2011-10-25 Paul Eggert <eggert@cs.ucla.edu>
3234 * dispextern.h (Fcontrolling_tty_p): New decl (Bug#6649 part 2).
3236 2011-10-25 Stefan Monnier <monnier@iro.umontreal.ca>
3238 * keyboard.c (test_undefined): New function (bug#9751).
3239 (read_key_sequence): Use it to detect when a key is bound to `undefined'.
3241 2011-10-25 Enami Tsugutomo <tsugutomo.enami@jp.sony.com>
3243 * sysdep.c (init_sys_modes): Fix the check for the controlling
3244 terminal (Bug#6649).
3246 2011-10-20 Eli Zaretskii <eliz@gnu.org>
3248 * dispextern.h (struct bidi_it): New member next_en_type.
3250 * bidi.c (bidi_line_init): Initialize the next_en_type member.
3251 (bidi_resolve_explicit_1): When next_en_pos is valid for the
3252 current character, check also for next_en_type being WEAK_EN.
3253 (bidi_resolve_weak): Don't enter the expensive loop if the current
3254 position is before next_en_pos. Record the bidi type of the first
3255 non-ET, non-BN character we find, in addition to its position.
3256 (bidi_level_of_next_char): Invalidate next_en_type when
3257 next_en_pos is over-stepped.
3259 2011-10-20 Paul Eggert <eggert@cs.ucla.edu>
3261 Time zone name fixes for non-ASCII locales (Bug#641, Bug#9794)
3262 * editfns.c: Rewrite current-time-zone so that it invokes
3263 the equivalent of (format-time-string "%Z") to get the time zone name.
3264 This fixes a bug when the time zone name contains characters that
3265 need converting from the system time locale to Emacs internal format.
3266 This fixes a shortcoming that I introduced in my 1999-10-19 patch:
3267 that patch fixed format-time-string to do the conversion, but
3268 I forgot to fix current-time-zone.
3269 (format_time_string): New function, containing most of
3270 what Fformat_time_string used to contain.
3271 (Fformat_time_string): Rewrite in terms of format_time_string.
3272 This doesn't change this function's behavior.
3273 (current-time-zone): Rewrite to use format_time_string.
3274 This fixes the bug reported by Michael Schierl in
3275 <http://lists.gnu.org/archive/html/emacs-devel/2007-06/msg00334.html>.
3276 Jason Rumney's 2007-06-07 change worked around this bug, but
3278 * systime.h (tzname, timezone): Remove no-longer-used declarations.
3280 2011-10-19 Eli Zaretskii <eliz@gnu.org>
3282 * xdisp.c (start_display): If the character at POS is displayed
3283 via a display vector, reset IT->current.dpvec_index to zero.
3284 (try_window_reusing_current_matrix): If a line ends in a display
3285 vector or the next line starts in a display vector, continue
3286 redrawing the window even though the character position of
3287 start_row was reached.
3290 2011-10-18 Chong Yidong <cyd@gnu.org>
3292 * xdisp.c (get_next_display_element): Handle U+2010 and U+2011
3293 with nobreak-char-display too.
3295 2011-10-18 Eli Zaretskii <eliz@gnu.org>
3297 Fix part 3 of bug#9771.
3298 * bidi.c (bidi_line_init): Initialize next_en_pos to zero, not -1.
3299 (bidi_resolve_neutral): Don't enter the expensive loop looking for
3300 non-neutral characters if the current character is a paragraph
3301 separator (a.k.a. Newline). This avoids running the same
3302 expensive loop twice, once when we consume the preceding newline
3303 and the other time when the line actually needs to be displayed.
3304 Avoid the loop when we see neutrals on the base embedding level
3305 following a character whose directionality is the same as the
3306 paragraph's. This avoids running the expensive loop when a line
3307 ends in a long sequence of neutrals, like control characters.
3308 Add assertion against STRONG_AL type. Slightly rearrange code
3309 that determines the type of a neutral given the first non-neutral
3311 (bidi_level_of_next_char): Set next_en_pos to zero when
3312 invalidating its info.
3314 2011-10-17 Eli Zaretskii <eliz@gnu.org>
3316 * xdisp.c (push_display_prop): Determine whether to record string
3317 or buffer position by IT->string, not by IT->method. Allow
3318 GET_FROM_DISPLAY_VECTOR as IT->method on entry. (Bug#9771, part 4)
3319 (move_it_vertically_backward): Don't look for character position
3320 immediately after the newline when in a continuation line.
3323 2011-10-15 Martin Rudalics <rudalics@gmx.at>
3325 * window.c (coordinates_in_window): Rewrite and delabelize
3326 vertical border check. (Bug#5357) (Bug#9618)
3328 2011-10-14 Stefan Monnier <monnier@iro.umontreal.ca>
3330 * xterm.c (frame_highlight, frame_unhighlight): Ignore unexplained
3331 errors in XSetWindowBorder (bug#9310).
3333 2011-10-13 Dmitry Antipov <dmantipov@yandex.ru>
3335 * editfns.c (Fset_time_zone_rule): Replace free with xfree to
3336 avoid crash when xmalloc overrun checking is enabled.
3338 2011-10-13 Eli Zaretskii <eliz@gnu.org>
3340 * xdisp.c (Fcurrent_bidi_paragraph_direction): Initialize
3341 itb.paragraph_dir to NEUTRAL_DIR. Fixes an occasional incorrect
3342 cursor motion with <left> and <right> arrow keys.
3344 * bidi.c (bidi_init_it): Don't initialize paragraph_dir here, as
3345 some callers set that themselves.
3347 2011-10-12 Eli Zaretskii <eliz@gnu.org>
3349 * xdisp.c (find_row_edges): Handle the case where ROW comes from a
3350 display string and the previous row comes from the same string and
3351 is empty. (Bug#9739) (Bug#9738)
3353 2011-10-12 Stefan Monnier <monnier@iro.umontreal.ca>
3355 * doc.c (get_doc_string): Encode file name (bug#9735).
3357 2011-10-12 Eli Zaretskii <eliz@gnu.org>
3359 * bidi.c (bidi_level_of_next_char):
3360 * xdisp.c (get_visually_first_element): Remove old incorrect
3361 comments regarding the Unicode Line Separator character.
3363 * bidi.c (bidi_init_it): Initialize paragraph_dir to NEUTRAL_DIR.
3365 2011-10-12 Dmitry Antipov <dmantipov@yandex.ru>
3367 * alloc.c (Fgc_status): Do not access beyond zombies array
3368 boundary if nzombies > MAX_ZOMBIES.
3369 * alloc.c (dump_zombies): Add missing format specifier.
3371 2011-10-12 Paul Eggert <eggert@cs.ucla.edu>
3373 * xdisp.c (set_cursor_from_row): Simplify conditionals,
3374 to pacify GCC 4.6.1 x86-64 with -O2 -Wstrict-overflow.
3376 * lread.c (read_escape): Allow hex escapes as large as ?\xfffffff.
3377 Some packages use them to denote characters with modifiers.
3379 2011-10-11 Andreas Schwab <schwab@linux-m68k.org>
3381 * lisp.h (GCPRO1_VAR, GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR)
3382 (GCPRO5_VAR, GCPRO6_VAR, UNGCPRO_VAR): Add whitespace to avoid
3383 matching a pp-number. Rename parameter var to var1.
3385 2011-10-11 Stefan Monnier <monnier@iro.umontreal.ca>
3387 * minibuf.c (Finternal_complete_buffer): Fix last change (bug#9709).
3389 2011-10-08 Glenn Morris <rgm@gnu.org>
3391 * callint.c (Fcall_interactively): Give a more explicit error for the
3392 'c' case with a non-character input. (Bug#8479)
3394 2011-10-08 Eli Zaretskii <eliz@gnu.org>
3396 * xdisp.c (hscroll_window_tree): Support hscroll in right-to-left
3398 (set_cursor_from_row): Fix cursor positioning in mixed L2R+R2L
3399 lines that are hscrolled on the left.
3401 * dispnew.c (buffer_posn_from_coords): Account for a possible
3402 presence of header-line. (Bug#4426)
3404 2011-10-07 Stefan Monnier <monnier@iro.umontreal.ca>
3406 * buffer.c (syms_of_buffer) <enable-multibyte-characters>:
3407 Don't advertise functionality which we discourage or doesn't work.
3409 2011-10-07 Paul Eggert <eggert@cs.ucla.edu>
3411 * alloc.c (GC_LISP_OBJECT_ALIGNMENT): Use offsetof, not __alignof__
3412 or sizeof. __alignof__ gives the wrong answer on Fedora x86-64
3413 with GCC 4.6.1 when configured with CC='gcc -m32' --with-wide-int;
3414 this makes Emacs dump core during garbage collection on rare
3415 occasions. sizeof is obviously inferior to offsetof here, so
3416 stick with offsetof.
3417 (GC_POINTER_ALIGNMENT): New macro.
3418 (mark_memory): Omit 3rd (offset) arg; caller changed.
3419 Don't assume EMACS_INT alignment is the same as pointer alignment.
3421 2011-10-03 Stefan Monnier <monnier@iro.umontreal.ca>
3423 * keyboard.c (read_key_sequence_remapped): New var.
3424 (read_key_sequence): Compute remapping in the right buffer.
3425 (command_loop_1): Use read_key_sequence's remapping directly.
3427 2011-10-02 Stefan Monnier <monnier@iro.umontreal.ca>
3429 * dired.c (file_name_completion): Don't expand file name.
3430 (Ffile_name_completion, Ffile_name_all_completions): Expand file name
3431 before checking file name handler.
3433 * minibuf.c (Finternal_complete_buffer): Only show internal buffers if
3434 they've been requested explicitly (bug#9591).
3436 2011-10-01 Andreas Schwab <schwab@linux-m68k.org>
3438 * keymap.c (Fsingle_key_description): Use make_specified_string
3439 instead of build_string to build string from push_key_description.
3442 2011-09-30 Paul Eggert <eggert@cs.ucla.edu>
3444 * buffer.h (struct buffer): Use time_t, not int, for a time stamp.
3445 This fixes a Y2038 bug on 64-bit hosts.
3446 * buffer.c (reset_buffer):
3447 * fileio.c (Fdo_auto_save, Fset_buffer_auto_saved)
3448 (Fclear_buffer_auto_save_failure):
3449 Use 0, not -1, to represent an unset failure time, since time_t
3450 might not be signed.
3452 Remove dependency on glibc malloc internals.
3453 * alloc.c (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
3454 Move back here from lisp.h, but with their new implementations.
3455 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
3456 (XMALLOC_OVERRUN_SIZE_SIZE): Move these new lisp.h macros here.
3457 * charset.c (charset_table_init): New static var.
3458 (syms_of_charset): Use it instead of xmalloc. This removes a
3459 dependency on glibc malloc internals. See Eli Zaretskii's comment in
3460 <http://lists.gnu.org/archive/html/emacs-devel/2011-09/msg00815.html>.
3461 * lisp.h (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
3462 Move back to alloc.c.
3463 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
3464 (XMALLOC_OVERRUN_SIZE_SIZE): Move to alloc.c.
3466 2011-09-30 Jan Djärv <jan.h.d@swipnet.se>
3468 * nsterm.m (windowDidResize): Call x_set_window_size only when
3469 ns_in_resize is true. Otherwise set pixelwidth/height and
3470 call change_frame_size (Bug#9628).
3472 2011-09-30 Paul Eggert <eggert@cs.ucla.edu>
3474 Port --enable-checking=all to Fedora 14 x86-64.
3475 * charset.c (syms_of_charset): Also account for glibc malloc's
3476 internal overhead when calculating the initial malloc maximum.
3478 Port --enable-checking=all to Fedora 14 x86.
3479 * alloc.c (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
3481 (xmalloc_put_size, xmalloc_get_size, overrun_check_malloc)
3482 (overrun_check_realloc, overrun_check_free):
3483 Use XMALLOC_OVERRUN_SIZE_SIZE, not sizeof (size_t).
3484 That way, xmalloc returns a properly-aligned pointer even if
3485 XMALLOC_OVERRUN_CHECK is defined. The old debugging code happened
3486 to align OK on typical 64-bit hosts, but not on Fedora 14 x86.
3487 * charset.c (syms_of_charset): Take XMALLOC_OVERRUN_CHECK_OVERHEAD
3488 into account when calculating the initial malloc maximum.
3489 * lisp.h (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
3490 Move here from alloc.c, so that charset.c can use it too.
3491 Properly align; the old code wasn't right for common 32-bit hosts
3492 when configured with --enable-checking=all.
3493 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
3494 (XMALLOC_OVERRUN_SIZE_SIZE): New macros.
3496 2011-09-29 Eli Zaretskii <eliz@gnu.org>
3498 * sysdep.c (snprintf) [!EOVERFLOW]: If EOVERFLOW is not defined,
3501 2011-09-28 Eli Zaretskii <eliz@gnu.org>
3503 * xdisp.c (compute_display_string_end): If there's no display
3504 string at CHARPOS, return -1.
3506 * bidi.c (bidi_fetch_char): When compute_display_string_end
3507 returns a negative value, treat the character as a normal
3508 character not covered by a display string. (Bug#9624)
3510 2011-09-28 Juanma Barranquero <lekktu@gmail.com>
3512 * lread.c (Fread_from_string): Fix typo in docstring.
3514 2011-09-27 Eli Zaretskii <eliz@gnu.org>
3516 * xdisp.c (handle_invisible_prop): If invisible text ends on a
3517 newline, reseat the iterator instead of bidi-iterating there one
3518 character at a time. (Bug#9610)
3519 (BUFFER_POS_REACHED_P, move_it_in_display_line_to): Bail when past
3520 TO_CHARPOS if the bidi iterator is at base embedding level.
3522 2011-09-27 Andreas Schwab <schwab@linux-m68k.org>
3524 * lread.c (readevalloop): Use correct code for NBSP.
3525 (read1): Likewise. (Bug#9608)
3527 2011-09-25 Michael Albinus <michael.albinus@gmx.de>
3529 * dbusbind.c (Fdbus_register_signal): When service is not
3530 registered, use nil in Vdbus_registered_objects_table. (Bug#9581)
3532 2011-09-25 Glenn Morris <rgm@gnu.org>
3534 * buffer.c (truncate-lines): Doc fix.
3536 2011-09-24 Chong Yidong <cyd@stupidchicken.com>
3538 * window.c (Fwindow_prev_buffers, Fset_window_prev_buffers)
3539 (Fset_window_next_buffers): Doc fix.
3541 2011-09-24 Glenn Morris <rgm@gnu.org>
3543 * minibuf.c (read_minibuf): Disable line truncation. (Bug#5715)
3545 2011-09-24 Paul Eggert <eggert@cs.ucla.edu>
3547 Fix minor problems found by static checking.
3548 * xdisp.c (string_from_display_spec): Don't assume vecsize fits in int.
3549 * indent.c (Fvertical_motion): Fix == vs = typo.
3551 2011-09-24 Eli Zaretskii <eliz@gnu.org>
3553 * dispnew.c (syms_of_display) <redisplay-dont-pause>:
3554 Default value is now t. Doc fix.
3556 * indent.c (Fvertical_motion): Compute and apply the overshoot
3557 logic when moving up, not only when moving down. Fix the
3558 confusing name and values of the it_overshoot_expected variable;
3559 logic changes accordingly. (Bug#9254) (Bug#9549)
3561 * xdisp.c (pos_visible_p): Produce correct pixel coordinates when
3562 CHARPOS is covered by a display string which includes newlines.
3563 (move_it_vertically_backward): Avoid inflooping when START_CHARPOS
3564 is covered by a display string with embedded newlines.
3566 2011-09-24 Michael Albinus <michael.albinus@gmx.de>
3568 * dbusbind.c (Fdbus_register_signal): Add match rule to
3569 Vdbus_registered_objects_table. (Bug#9581)
3570 (Fdbus_register_method, Vdbus_registered_objects_table):
3573 2011-09-24 Jim Meyering <meyering@redhat.com>
3575 do not ignore write error for any output size
3576 The previous change was incomplete.
3577 While it makes emacs --batch detect the vast majority of stdout
3578 write failures, errors were still ignored whenever the output size is
3579 k * (BUFSIZ+1) - 4. E.g., on a system with BUFSIZ of 4096,
3580 $ emacs --batch --eval '(print (format "%4093d" 0))' > /dev/full \
3581 && echo FAIL: ignored write error
3582 FAIL: ignored write error
3583 $ emacs --batch --eval '(print (format "%20481d" 0))' > /dev/full \
3584 && echo FAIL: ignored write error
3585 FAIL: ignored write error
3586 * emacs.c (Fkill_emacs): Also test ferror. (Bug#9574)
3588 2011-09-23 Andreas Schwab <schwab@linux-m68k.org>
3590 * emacs.c (Fkill_emacs): In noninteractive mode exit
3591 non-successfully if a write error occurred on stdout. (Bug#9574)
3593 2011-09-21 Eli Zaretskii <eliz@gnu.org>
3595 * xdisp.c (pop_it): Allow it->object that is a cons cell to pass
3598 * dispextern.h (struct it): Update the comment documenting what
3601 2011-09-20 Eli Zaretskii <eliz@gnu.org>
3603 * xdisp.c (set_cursor_from_row): If the row ends in a newline from
3604 a display string, extend search for cursor position to end of row.
3605 (find_row_edges): If the row ends in a newline from a display
3606 string, increment its MATRIX_ROW_END_CHARPOS by one. (Bug#9549)
3607 Handle the case of a display string with multiple newlines.
3608 (Fcurrent_bidi_paragraph_direction): Fix search for previous
3609 non-empty line. Fixes confusing cursor motion with arrow keys at
3610 the beginning of a line that starts with whitespace.
3612 2011-09-19 Lars Magne Ingebrigtsen <larsi@gnus.org>
3614 * lread.c (Fread_from_string): Document what FINAL-STRING-INDEX is
3617 2011-09-18 Chong Yidong <cyd@stupidchicken.com>
3619 * xfns.c (Fx_create_frame): Handle the bitmapIcon resource as
3622 2011-09-18 Eli Zaretskii <eliz@gnu.org>
3624 * xdisp.c (display_line): Record maximum and minimum buffer
3625 positions even if no glyphs were produced (e.g., by a zero-width
3626 stretch). Fixes bug#9530 on a TTY. Under word-wrap, don't record
3627 buffer positions that will be removed from the glyph row because
3629 (produce_stretch_glyph): Fix a bug in :align-to on a TTY when the
3630 column is beyond frame width: don't subtract 1 "pixel" when
3631 computing width of the stretch.
3632 (reseat_at_next_visible_line_start): Undo the change made on
3633 2011-09-17 that saved paragraph information and restored it after
3634 the call to `reseat'. (Bug#9545)
3636 2011-09-18 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
3638 * xdisp.c (expose_window): Save original value of phys_cursor_on_p
3639 and turn window cursor on if cleared (Bug#9415).
3641 2011-09-18 Andreas Schwab <schwab@linux-m68k.org>
3643 * search.c (boyer_moore): Take unibyte characters from pattern
3644 literally. (Bug#9458)
3646 2011-09-18 Eli Zaretskii <eliz@gnu.org>
3648 * xdisp.c (reseat_at_next_visible_line_start): Fix last change.
3650 2011-09-18 Paul Eggert <eggert@cs.ucla.edu>
3652 Fix minor problem found by static checking.
3653 * xdisp.c (reseat_at_next_visible_line_start): Mark locals as
3654 initialized, to pacify gcc -Wuninitialized.
3656 * fileio.c: Report proper errno when syscall falls.
3657 (Finsert_file_contents): Save and restore errno,
3658 so that report_file_error outputs the correct diagnostic.
3659 (Fwrite_region) [CLASH_DETECTION]: Likewise.
3661 2011-09-18 Eli Zaretskii <eliz@gnu.org>
3663 * .gdbinit (pgx): Fix references to fields of `struct glyph'.
3665 2011-09-17 Eli Zaretskii <eliz@gnu.org>
3667 * xdisp.c (produce_stretch_glyph): Another fix for changes made on
3668 2011-08-30T17:32:44Z!eliz@gnu.org. (Bug#9530)
3670 2011-09-17 Eli Zaretskii <eliz@gnu.org>
3672 * xdisp.c (reseat_at_next_visible_line_start): Keep information
3673 about the current paragraph and restore it after the call to reseat.
3675 * bidi.c (MAX_PARAGRAPH_SEARCH): New macro.
3676 (bidi_find_paragraph_start): Search back for paragraph beginning
3677 at most MAX_PARAGRAPH_SEARCH lines; if not found, return BEGV_BYTE.
3678 (bidi_move_to_visually_next): Only trigger paragraph-related
3679 computations when the last character is a newline or at EOB, not
3680 just any NEUTRAL_B. (Bug#9470)
3682 * xdisp.c (set_cursor_from_row): Don't invoke special treatment of
3683 truncated lines if point is covered by a display string. (Bug#9524)
3685 2011-09-16 Paul Eggert <eggert@cs.ucla.edu>
3687 * xselect.c: Relax test for outgoing X longs (Bug#9498).
3688 (cons_to_x_long): New function.
3689 (lisp_data_to_selection_data): Use it. Correct the test for
3690 short-versus-long data; it was negated. Break out of vector
3691 loop, for efficiency, when a long datum is discovered.
3693 2011-09-16 Stefan Monnier <monnier@iro.umontreal.ca>
3695 * eval.c (Fquote): Document its non-consing behavior (bug#9482).
3697 2011-09-16 Eli Zaretskii <eliz@gnu.org>
3699 * image.c (tiff_handler): Work around a bug in MinGW GCC 3.x (see
3700 GCC PR/17406) by declaring this function with external scope.
3702 2011-09-15 Paul Eggert <eggert@cs.ucla.edu>
3704 * editfns.c (Fformat): Fix bug in text-property fix (Bug#9514).
3705 Don't mishandle (length (format "%%")) and (format "%4000s%%" "").
3707 2011-09-15 Andreas Schwab <schwab@linux-m68k.org>
3709 * editfns.c (Fformat): Correctly handle text properties on "%%".
3711 2011-09-15 Eli Zaretskii <eliz@gnu.org>
3713 * xterm.c (x_draw_composite_glyph_string_foreground):
3714 * w32term.c (x_draw_composite_glyph_string_foreground):
3715 * term.c (encode_terminal_code):
3716 * composite.c (composition_update_it, get_composition_id):
3717 * xdisp.c (get_next_display_element)
3718 (fill_composite_glyph_string): Add comments about special meaning
3719 of TAB characters in a composition.
3721 2011-09-15 Paul Eggert <eggert@cs.ucla.edu>
3723 * editfns.c (Fformat): Fix off-by-1 bug for "%%b" (Bug#9514).
3724 This occurs when processing a multibyte format.
3725 Problem reported by Wolfgang Jenker.
3727 2011-09-15 Johan Bockgård <bojohan@gnu.org>
3729 * xdisp.c (try_cursor_movement): Only check for exact match if
3730 cursor hpos found by set_cursor_from_row is valid. (Bug#9495)
3732 2011-09-14 Paul Eggert <eggert@cs.ucla.edu>
3734 Remove unused external symbols.
3735 * dispextern.h (calc_pixel_width_or_height): Remove decl.
3736 * xdisp.c (calc_pixel_width_or_height): Now static.
3737 * doprnt.c (exprintf) [! (HAVE_X_WINDOWS && USE_X_TOOLKIT)]: Remove.
3738 * indent.c (check_display_width):
3739 * w32term.c: Fix comment to match code.
3740 * xterm.c, xterm.h (x_catching_errors): Remove.
3742 2011-09-14 Paul Eggert <eggert@cs.ucla.edu>
3744 * xselect.c: Use signed conversions more consistently (Bug#9498).
3745 (selection_data_to_lisp_data): Assume incoming selection data are
3746 signed integers, not unsigned. This is to be consistent with
3747 outgoing selection data, which was modified to use signed integers
3748 in as part of the fix to Bug#9196 in response to Jan D.'s comment
3749 in <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9196#32> that X11
3750 expects long, not unsigned long.
3752 2011-09-14 Eli Zaretskii <eliz@gnu.org>
3754 * xdisp.c (try_window_reusing_current_matrix): Fix incorrect
3755 computation of loop end. Reported by Johan Bockgård
3758 2011-09-13 Chong Yidong <cyd@stupidchicken.com>
3760 * frame.c (Fother_visible_frames_p): Function deleted.
3762 2011-09-12 Eli Zaretskii <eliz@gnu.org>
3764 * indent.c (compute_motion): Process display vector front to back
3765 rather than the other way around. (Bug#2496)
3767 2011-09-12 Stefan Monnier <monnier@iro.umontreal.ca>
3769 * fileio.c (Finsert_file_contents): Don't assume beg_offset is 0.
3771 2011-09-11 Chong Yidong <cyd@stupidchicken.com>
3773 * minibuf.c (Fread_from_minibuffer): Doc fix.
3775 2011-09-11 Eli Zaretskii <eliz@gnu.org>
3777 * xdisp.c (produce_stretch_glyph): Fix a typo made in changes from
3778 2011-08-30T17:32:44Z!eliz@gnu.org. (Bug#9475)
3780 2011-09-11 Lars Magne Ingebrigtsen <larsi@gnus.org>
3782 * fileio.c (Fvisited_file_modtime): Document `(-1 65535)' as a
3783 value for non-existent files.
3785 2011-09-11 Eli Zaretskii <eliz@gnu.org>
3787 * fileio.c (Finsert_file_contents): If the file cannot be opened,
3788 set its "size" to -1. This will set the modtime_size field of
3789 the corresponding buffer to -1, which is what
3790 verify-visited-file-modtime expects for files that do not exist.
3793 2011-09-11 Paul Eggert <eggert@cs.ucla.edu>
3795 * keymap.h (KEY_DESCRIPTION_SIZE, push_key_description): Move decls
3797 * lisp.h: ... from here. push_key_description is no longer
3798 defined in keyboard.c, so its declaration should not be in
3799 lisp.h's "Defined in keyboard.c" section, and KEY_DESCRIPTION_SIZE
3800 logically belongs with push_key_description.
3802 2011-09-10 Paul Eggert <eggert@cs.ucla.edu>
3804 * buffer.h: Include <sys/types.h> instead of <time.h>.
3805 Otherwise, off_t wasn't defined on FreeBSD 9.0-BETA2 i386.
3806 Problem reported by Herbert J. Skuhra.
3808 2011-09-10 Lars Magne Ingebrigtsen <larsi@gnus.org>
3810 * xml.c (parse_region): Make the parsing work for
3811 non-comment-starting XML files again (bug#9144).
3813 2011-09-10 Andreas Schwab <schwab@linux-m68k.org>
3815 * image.c (gif_load): Fix calculation of bottom and right corner.
3818 2011-09-10 Eli Zaretskii <eliz@gnu.org>
3820 * xdisp.c (MAX_DISP_SCAN): Decrease to 250. Prevents sluggish
3821 redisplay in small windows.
3823 2011-09-09 Eli Zaretskii <eliz@gnu.org>
3825 * frame.c (x_report_frame_params): Cast to avoid compiler warnings.
3827 2011-09-08 Martin Rudalics <rudalics@gmx.at>
3829 * window.c (Fset_window_prev_buffers, Fset_window_next_buffers):
3830 Operate on live windows only.
3832 2011-09-08 Juanma Barranquero <lekktu@gmail.com>
3834 * emacs.c (my_heap_start): #ifdef to avoid warnings when unused.
3836 2011-09-07 Eli Zaretskii <eliz@gnu.org>
3838 * xdisp.c (move_it_in_display_line_to): Call RESTORE_IT on ppos_it
3839 only under bidi iteration.
3841 2011-09-07 Jan Djärv <jan.h.d@swipnet.se>
3843 * gtkutil.c (xg_make_tool_item): Insert comment about eventbox.
3845 2011-09-06 Paul Eggert <eggert@cs.ucla.edu>
3847 isnan: Fix porting problem to Solaris 10 with bundled gcc.
3848 Without this fix, the command to link temacs failed due to an
3849 undefined symbol __builtin_isnan. This is because
3850 /usr/include/iso/math_c99.h #defines isnan(x) to
3851 __builtin_isnan(x), but the bundled gcc, which identifies itself
3852 as gcc 3.4.3 (csl-sol210-3_4-branch+sol_rpath), does not have
3854 * floatfns.c (isnan): #undef, and then #define to a clone of
3856 (Fisnan): Always define, since it's always available now.
3857 (syms_of_floatfns): Always define isnan at the Lisp level.
3859 2011-09-06 Paul Eggert <eggert@cs.ucla.edu>
3861 * Makefile.in (gl-stamp): move-if-change now in build-aux (Bug#9169).
3863 2011-09-06 Paul Eggert <eggert@cs.ucla.edu>
3865 * fileio.c: Fix bugs with large file offsets (Bug#9428).
3866 The previous code assumed that file offsets (off_t values) fit in
3867 EMACS_INT variables, which is not true on typical 32-bit hosts.
3868 The code messed up by falsely reporting buffer overflow in cases
3869 such as (insert-file-contents "big" nil 1 2) into an empty buffer
3870 when "big" contains more than 2**29 bytes, even though this
3871 inserts just one byte and does not overflow the buffer.
3872 (Finsert_file_contents): Store file offsets as off_t
3873 values, not as EMACS_INT values. Check for overflow when
3874 converting between EMACS_INT and off_t. When checking for
3875 buffer overflow or for overlap, take the offsets into account.
3876 Don't use EMACS_INT for small values where int suffices.
3877 When checking for overlap, fix a typo: ZV was used where
3878 ZV_BYTE was intended.
3879 (Fwrite_region): Don't assume off_t fits into 'long'.
3880 * buffer.h (struct buffer.modtime_size): Now off_t, not EMACS_INT.
3882 2011-09-05 Michael Albinus <michael.albinus@gmx.de>
3884 * dbusbind.c (xd_signature_cat): Rename from signature_cat.
3886 2011-09-04 Paul Eggert <eggert@cs.ucla.edu>
3888 sprintf-related integer and memory overflow issues (Bug#9412).
3890 * doprnt.c (doprnt): Support printing ptrdiff_t and intmax_t values.
3891 (esprintf, exprintf, evxprintf): New functions.
3892 * keyboard.c (command_loop_level): Now EMACS_INT, not int.
3893 (cmd_error): Kbd macro iterations count is now EMACS_INT, not int.
3894 (modify_event_symbol): Do not assume that the length of
3895 name_alist_or_stem is safe to alloca and fits in int.
3896 (Fexecute_extended_command): Likewise for function name and binding.
3897 (Frecursion_depth): Wrap around reliably on integer overflow.
3898 * keymap.c (push_key_description): First arg is now EMACS_INT, not int,
3899 since some callers pass EMACS_INT values.
3900 (Fsingle_key_description): Don't crash if symbol name contains more
3901 than MAX_ALLOCA bytes.
3902 * minibuf.c (minibuf_level): Now EMACS_INT, not int.
3903 (get_minibuffer): Arg is now EMACS_INT, not int.
3904 * lisp.h (get_minibuffer, push_key_description): Reflect API changes.
3905 (esprintf, exprintf, evxprintf): New decls.
3906 * window.h (command_loop_level, minibuf_level): Reflect API changes.
3908 * dbusbind.c (signature_cat): New function.
3909 (xd_signature, Fdbus_register_signal):
3910 Do not overrun buffer; instead, report string overflow.
3912 * dispnew.c (add_window_display_history): Don't overrun buffer.
3913 Truncate instead; this is OK since it's just a log.
3915 * editfns.c (Fcurrent_time_zone): Don't overrun buffer
3916 even if the time zone offset is outlandishly large.
3917 Don't mishandle offset == INT_MIN.
3919 * emacs.c (main) [NS_IMPL_COCOA]: Don't overrun buffer
3920 when creating daemon; the previous buffer-overflow check was incorrect.
3922 * eval.c (verror): Simplify by rewriting in terms of evxprintf,
3923 which has the guts of the old verror function.
3925 * filelock.c (lock_file_1, lock_file): Don't blindly alloca long name;
3926 use SAFE_ALLOCA instead. Use esprintf to avoid int-overflow issues.
3928 * font.c: Include <float.h>, for DBL_MAX_10_EXP.
3929 (font_unparse_xlfd): Don't blindly alloca long strings.
3930 Don't assume XINT result fits in int, or that XFLOAT_DATA * 10
3931 fits in int, when using sprintf. Use single snprintf to count
3932 length of string rather than counting it via multiple sprintfs;
3933 that's simpler and more reliable.
3934 (font_unparse_fcname): Use it to avoid sprintf buffer overrun.
3935 (generate_otf_features) [0 && HAVE_LIBOTF]: Use esprintf, not
3936 sprintf, in case result does not fit in int.
3938 * fontset.c (num_auto_fontsets): Now printmax_t, not int.
3939 (fontset_from_font): Print it.
3941 * frame.c (tty_frame_count): Now printmax_t, not int.
3942 (make_terminal_frame, set_term_frame_name): Print it.
3943 (x_report_frame_params): In X, window IDs are unsigned long,
3944 not signed long, so print them as unsigned.
3945 (validate_x_resource_name): Check for implausibly long names,
3946 and don't assume name length fits in 'int'.
3947 (x_get_resource_string): Don't blindly alloca invocation name;
3948 use SAFE_ALLOCA. Use esprintf, not sprintf, in case result does
3951 * gtkutil.c: Include <float.h>, for DBL_MAX_10_EXP.
3952 (xg_check_special_colors, xg_set_geometry):
3953 Make sprintf buffers a bit bigger, to avoid potential buffer overrun.
3955 * lread.c (dir_warning): Don't blindly alloca buffer; use SAFE_ALLOCA.
3956 Use esprintf, not sprintf, in case result does not fit in int.
3958 * macros.c (executing_kbd_macro_iterations): Now EMACS_INT, not int.
3959 (Fend_kbd_macro): Don't mishandle MOST_NEGATIVE_FIXNUM by treating
3960 it as a large positive number.
3961 (Fexecute_kbd_macro): Don't assume repeat count fits in int.
3962 * macros.h (executing_kbd_macro_iterations): Now EMACS_INT, not int.
3964 * nsterm.m ((NSSize)windowWillResize): Use esprintf, not sprintf,
3965 in case result does not fit in int.
3967 * print.c (float_to_string): Detect width overflow more reliably.
3968 (print_object): Make sprintf buffer a bit bigger, to avoid potential
3969 buffer overrun. Don't assume list length fits in 'int'. Treat
3970 print length of 0 as 0, not as infinity; to be consistent with other
3971 uses of print length in this function. Don't overflow print length
3972 index. Don't assume hash table size fits in 'long', or that
3973 vectorlike size fits in 'unsigned long'.
3975 * process.c (make_process): Use printmax_t, not int, to format
3976 process-name gensyms.
3978 * sysdep.c (snprintf) [! HAVE_SNPRINTF]: New function.
3980 * term.c (produce_glyphless_glyph): Make sprintf buffer a bit bigger
3981 to avoid potential buffer overrun.
3983 * xfaces.c (x_update_menu_appearance): Don't overrun buffer
3984 if X resource line is longer than 512 bytes.
3986 * xfns.c (x_window): Make sprintf buffer a bit bigger
3987 to avoid potential buffer overrun.
3989 * xterm.c (x_io_error_quitter): Don't overrun sprintf buffer.
3991 * xterm.h (x_check_errors): Add ATTRIBUTE_FORMAT_PRINTF.
3993 2011-09-04 Paul Eggert <eggert@cs.ucla.edu>
3995 Integer overflow fixes for scrolling, etc.
3996 Without these, Emacs silently mishandles large integers sometimes.
3997 For example, "C-u 4294967297 M-x recenter" was treated as if
3998 it were "C-u 1 M-x recenter" on a typical 64-bit host.
4000 * xdisp.c (try_window_id): Check Emacs fixnum range before
4001 converting to 'int'.
4003 * window.c (window_scroll_line_based, Frecenter):
4004 Check that an Emacs fixnum is in range before assigning it to 'int'.
4005 (Frecenter, Fmove_to_window_line): Use EMACS_INT, not int, for
4006 values converted from Emacs fixnums.
4007 (Frecenter): Don't wrap around a line count if it is out of 'int'
4008 range; instead, treat it as an extreme value.
4009 (Fset_window_configuration, compare_window_configurations):
4010 Use ptrdiff_t, not int, for index that might exceed 2 GiB.
4012 * search.c (Freplace_match): Use ptrdiff_t, not int, for indexes
4013 that can exceed INT_MAX. Check that EMACS_INT value is in range
4014 before assigning it to the (possibly-narrower) index.
4015 (match_limit): Don't assume that a fixnum can fit in 'int'.
4017 * print.c (print_object): Use ptrdiff_t, not int, for index that can
4020 * indent.c (position_indentation): Now takes ptrdiff_t, not int.
4021 (Fvertical_motion): Don't wrap around LINES values that don't fit
4022 in 'int'. Instead, treat them as extreme values. This is good
4023 enough for windows, which can't have more than INT_MAX lines anyway.
4025 2011-09-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
4027 * Require libxml/parser.h to avoid compilation warning.
4029 * emacs.c (shut_down_emacs): Call xmlCleanupParser on shutdown.
4031 * xml.c (parse_region): Don't call xmlCleanupParser after parsing,
4032 since this reportedly can destroy thread storage.
4034 2011-08-30 Chong Yidong <cyd@stupidchicken.com>
4036 * syntax.c (find_defun_start): Update all cache variables if
4037 exiting early (Bug#9401).
4039 2011-08-30 Eli Zaretskii <eliz@gnu.org>
4041 * image.c (x_bitmap_pixmap): Cast to int to avoid compiler warnings.
4043 * xdisp.c (produce_stretch_glyph): No longer static, compiled also
4044 when HAVE_WINDOW_SYSTEM is not defined. Support both GUI and TTY
4045 frames. Call tty_append_glyph in the TTY case. (Bug#9402)
4047 * term.c (tty_append_glyph): New function.
4048 (produce_stretch_glyph): Static function and its prototype deleted.
4050 * dispextern.h (produce_stretch_glyph, tty_append_glyph):
4053 2011-08-29 Paul Eggert <eggert@cs.ucla.edu>
4055 * image.c (parse_image_spec): Check for nonnegative, not for positive,
4056 when checking :margin (Bug#9390).
4057 (IMAGE_NON_NEGATIVE_INTEGER_VALUE_OR_PAIR):
4058 Rename from IMAGE_POSITIVE_INTEGER_VALUE_OR_PAIR,
4059 so that the name doesn't mislead. All uses changed.
4061 2011-08-28 Johan Bockgård <bojohan@gnu.org>
4063 * term.c (init_tty) [HAVE_GPM]: Move mouse settings after
4066 2011-08-27 Eli Zaretskii <eliz@gnu.org>
4068 * xdisp.c (move_it_to): Don't bail out early when reaching
4069 position beyond to_charpos, if we are scanning backwards.
4070 (move_it_vertically_backward): When DY == 0, make sure we get to
4071 the first character in the line after the newline.
4073 2011-08-27 Paul Eggert <eggert@cs.ucla.edu>
4075 * ccl.c: Improve and simplify overflow checking (Bug#9196).
4076 (ccl_driver): Do not generate an out-of-range pointer.
4077 (Fccl_execute_on_string): Remove unnecessary check for
4078 integer overflow, noted by Stefan Monnier in
4079 <http://lists.gnu.org/archive/html/emacs-devel/2011-08/msg00979.html>.
4080 Remove a FIXME that didn't need fixing.
4081 Simplify the newly-introduced buffer reallocation code.
4083 2011-08-27 Juanma Barranquero <lekktu@gmail.com>
4085 * makefile.w32-in ($(BLD)/alloc.$(O)): Depend on lib/verify.h.
4087 2011-08-26 Paul Eggert <eggert@cs.ucla.edu>
4089 Integer and memory overflow issues (Bug#9196).
4091 * doc.c (get_doc_string): Rework so that
4092 get_doc_string_buffer_size is the actual buffer size, rather than
4093 being 1 less than the actual buffer size; this makes xpalloc more
4096 * image.c (x_allocate_bitmap_record, cache_image):
4097 * xselect.c (Fx_register_dnd_atom):
4098 Simplify previous changes by using xpalloc.
4100 * buffer.c (overlay_str_len): Now ptrdiff_t, not EMACS_INT,
4101 since either will do and ptrdiff_t is convenient with xpalloc.
4103 * charset.c (charset_table_size)
4104 (struct charset_sort_data.priority): Now ptrdiff_t.
4105 (charset_compare): Don't overflow if priorities differ greatly.
4106 (Fsort_charsets): Don't assume list length fits in int.
4107 Check for size-calculation overflow when allocating sort data.
4108 (syms_of_charset): Allocate an initial charset table that is
4109 just under 64 KiB, to avoid problems with glibc malloc and mmap.
4111 * cmds.c (internal_self_insert): Check for size-calculation overflow.
4113 * composite.h (struct composition.glyph_len): Now int, not unsigned.
4114 The actual value is always <= INT_MAX, and leaving it unsigned made
4115 overflow checking harder.
4117 * dispextern.h (struct glyph_matrix.rows_allocated)
4118 (struct face_cache.size): Now ptrdiff_t, for convenience in use
4119 with xpalloc. The values are still always <= INT_MAX.
4121 * indent.c (compute_motion): Adjust to region_cache_forward sig change.
4123 * lisp.h (xnmalloc, xnrealloc, xpalloc): New decls.
4124 (SAFE_NALLOCA): New macro.
4126 * region-cache.c (struct boundary.pos, find_cache_boundary)
4127 (move_cache_gap, insert_cache_boundary, delete_cache_boundaries)
4128 (set_cache_region, invalidate_region_cache)
4129 (revalidate_region_cache, know_region_cache, region_cache_forward)
4130 (region_cache_backward, pp_cache):
4131 Use ptrdiff_t, not EMACS_INT, since either will do. This is needed
4132 so that ptrdiff_t * can be passed to xpalloc.
4133 (struct region_cache): Similarly, for gap_start, gap_len, cache_len,
4134 beg_unchanged, end_unchanged, buffer_beg, buffer_end members.
4135 (pp_cache): Don't assume cache_len fits in int.
4136 * region-cache.h: Adjust extern decls to match.
4138 * search.c (scan_buffer, Freplace_match): Use ptrdiff_t, not
4139 EMACS_INT, since either will do, for xpalloc.
4141 * alloc.c: Include verify.h, and check that int fits in ptrdiff_t.
4142 (xnmalloc, xnrealloc, xpalloc): New functions.
4144 * bidi.c (bidi_shelve_header_size): New constant.
4145 (bidi_cache_ensure_space, bidi_shelve_cache): Use it.
4146 (bidi_cache_ensure_space): Avoid integer overflow when allocating.
4148 * bidi.c (bidi_cache_shrink):
4149 * buffer.c (overlays_at, overlays_in, record_overlay_string)
4151 Don't update size of array until after memory allocation succeeds,
4152 because xmalloc/xrealloc may not return.
4153 (struct sortstrlist.bytes): Now ptrdiff_t, as EMACS_INT doesn't help
4154 now that we have proper integer overflow checking.
4155 (record_overlay_string, overlay_strings): Catch overflows when
4156 calculating size of overlay_str_buf.
4158 * callproc.c (Fcall_process): Check for size overflow when
4159 calculating size of args2.
4160 (child_setup): Avoid overflow by using size_t rather than ptrdiff_t.
4161 Normally we prefer signed values, but sticking with ptrdiff_t would
4162 require adding more-complicated checks.
4164 * ccl.c (Fccl_execute_on_string): Check for memory overflow.
4165 Use ptrdiff_t rather than EMACS_INT where ptrdiff_t will do.
4166 Redo buffer-overflow calculations to avoid integer overflow.
4167 Add a FIXME comment where memory seems to be over-allocated.
4169 * character.c (Fstring): Check for size-calculation overflow.
4171 * coding.c (produce_chars): Redo buffer-overflow calculations to avoid
4172 unnecessary integer overflow. Check for size overflow.
4173 (encode_coding_object): Don't update size until xmalloc succeeds.
4175 * composite.c (get_composition_id): Check for overflow in glyph
4176 length calculations.
4178 Integer and memory overflow fixes for display code.
4179 * dispextern.h (struct glyph_pool.nglyphs): Now ptrdiff_t, not int.
4180 * dispnew.c (adjust_glyph_matrix, realloc_glyph_pool)
4181 (scrolling_window): Check for overflow in size calculations.
4182 (line_draw_cost, realloc_glyph_pool, add_row_entry):
4183 Don't assume glyph table len fits in int.
4184 (struct row_entry.bucket, row_entry_pool_size, row_entry_idx)
4185 (row_table_size): Now ptrdiff_t, not int.
4186 (scrolling_window): Avoid overflow in size calculations.
4187 Don't update size until allocation succeeds.
4188 * fns.c (concat): Check for overflow in size calculations.
4189 (next_almost_prime): Verify NEXT_ALMOST_PRIME_LIMIT.
4190 * lisp.h (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): New macros.
4191 (NEXT_ALMOST_PRIME_LIMIT): New constant.
4193 * doc.c (get_doc_string_buffer_size): Now ptrdiff_t, not int.
4194 (get_doc_string): Check for size calculation overflow.
4195 Don't update size until allocation succeeds.
4196 (get_doc_string, Fsubstitute_command_keys): Use ptrdiff_t, not
4197 EMACS_INT, where ptrdiff_t will do.
4198 (Fsubstitute_command_keys): Check for string overflow.
4200 * editfns.c (set_time_zone_rule): Don't assume environment length
4202 (message_length): Now ptrdiff_t, not int.
4203 (Fmessage_box): Don't update size until allocation succeeds.
4204 Don't assume message length fits in int.
4205 (Fformat): Use ptrdiff_t, not EMACS_INT, where ptrdiff_t will do.
4207 * emacs.c (main): Do not reallocate argv, since there is a null at
4208 the end that can be overwritten, and this way there's no need to
4209 worry about size-calculation overflow.
4210 (sort_args): Check for size-calculation overflow.
4212 * eval.c (init_eval_once, grow_specpdl): Don't update size until
4214 (call_debugger, grow_specpdl): Redo calculations to avoid overflow.
4216 * frame.c (set_menu_bar_lines, x_set_frame_parameters)
4217 (x_set_scroll_bar_width, x_figure_window_size):
4218 Check for integer overflow.
4219 (x_set_alpha): Do not assume XINT fits in int.
4221 * frame.h (struct frame): Use int, not EMACS_INT, where int works.
4222 This is for the members text_lines, text_cols, total_lines, total_cols,
4223 where the system imposes an 'int' limit.
4225 * fringe.c (Fdefine_fringe_bitmap):
4226 Don't update size until alloc works.
4228 * ftfont.c (ftfont_get_open_type_spec, setup_otf_gstring)
4229 (ftfont_shape_by_flt): Check for integer overflow in size calculations.
4231 * gtkutil.c (get_utf8_string, xg_store_widget_in_map):
4232 Check for size-calculation overflow.
4233 (get_utf8_string): Use ptrdiff_t, not size_t, where either will
4234 do, as we prefer signed integers.
4235 (id_to_widget.max_size, id_to_widget.used)
4236 (xg_store_widget_in_map, xg_remove_widget_from_map)
4237 (xg_get_widget_from_map, xg_get_scroll_id_for_window)
4238 (xg_remove_scroll_bar, xg_update_scrollbar_pos):
4239 Use and return ptrdiff_t, not int.
4240 (xg_gtk_scroll_destroy): Don't assume ptrdiff_t fits in int.
4241 * gtkutil.h: Change prototypes to match the above.
4243 * image.c (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): Remove; these
4244 are duplicate now that they've been promoted to lisp.h.
4245 (x_allocate_bitmap_record, x_alloc_image_color)
4246 (make_image_cache, cache_image, xpm_load):
4247 Don't update size until alloc is done.
4248 (xpm_load, lookup_rgb_color, lookup_pixel_color, x_to_xcolors)
4250 Check for size calculation overflow.
4251 (ct_colors_allocated_max): New constant.
4252 (x_to_xcolors, x_detect_edges): Reorder multiplicands to avoid
4255 * keyboard.c (read_char, menu_bar_items, tool_bar_items)
4256 (read_char_x_menu_prompt, read_char_minibuf_menu_width)
4257 (read_char_minibuf_menu_prompt, follow_key, read_key_sequence):
4258 Use ptrdiff_t, not int, to count maps.
4259 (read_char_minibuf_menu_prompt): Check for overflow in size
4260 calculations. Don't update size until allocation succeeds.
4261 Redo calculations to avoid overflow.
4262 * keyboard.h: Change prototypes to match the above.
4264 * keymap.c (cmm_size, current_minor_maps): Use ptrdiff_t, not int,
4266 (current_minor_maps): Check for size calculation overflow.
4267 * keymap.h: Change prototypes to match the above.
4269 * lread.c (read1, init_obarray): Don't update size until alloc done.
4271 * macros.c (Fstart_kbd_macro): Don't update size until alloc done.
4272 (store_kbd_macro_char): Reorder multiplicands to avoid overflow.
4274 * nsterm.h (struct ns_color_table.size, struct ns_color_table.avail):
4275 Now ptrdiff_t, not int.
4276 * nsterm.m (ns_index_color): Use ptrdiff_t, not int, for table indexes.
4277 (ns_draw_fringe_bitmap): Rewrite to avoid overflow.
4279 * process.c (Fnetwork_interface_list): Check for overflow
4280 in size calculation.
4282 * region-cache.c (move_cache_gap): Check for size calculation overflow.
4284 * scroll.c (do_line_insertion_deletion_costs): Check for size calc
4285 overflow. Don't bother calling xmalloc when xrealloc will do.
4287 * search.c (Freplace_match): Check for size calculation overflow.
4288 (Fset_match_data): Don't assume list lengths fit in 'int'.
4290 * sysdep.c (system_process_attributes): Use ptrdiff_t, not int,
4291 for command line length. Do not attempt to address one before the
4292 beginning of an array, as that's not portable.
4294 * term.c (max_frame_lines): Remove; unused.
4295 (encode_terminal_src_size, encode_terminal_dst_size): Now ptrdiff_t,
4297 (encode_terminal_code, calculate_costs): Check for size
4298 calculation overflow.
4299 (encode_terminal_code): Use ptrdiff_t, not int, to record glyph
4300 table lengths and related sizes. Don't update size until alloc
4301 done. Redo calculations to avoid overflow.
4302 (calculate_costs): Don't bother calling xmalloc when xrealloc will do.
4304 * termcap.c (tgetent): Use ptrdiff_t, not int, to record results of
4305 subtracting pointers.
4306 (gobble_line): Check for overflow more carefully. Don't update size
4309 * tparam.c (tparam1): Use ptrdiff_t, not int, for sizes.
4310 Don't update size until alloc done.
4311 Redo size calculations to avoid overflow.
4312 Check for size calculation overflow.
4313 (main) [DEBUG]: Fix typo in invoking tparam1.
4315 * xdisp.c (store_mode_line_noprop_char, x_consider_frame_title):
4316 Use ptrdiff_t, not int, for sizes.
4317 (store_mode_line_noprop_char): Don't update size until alloc done.
4319 * xfaces.c (lface_id_to_name_size, Finternal_make_lisp_face):
4320 Use ptrdiff_t, not int, for sizes.
4321 (Finternal_make_lisp_face, cache_face):
4322 Check for size calculation overflow.
4323 (cache_face): Treat size calculation overflows as if they were
4324 memory exhaustion (the usual treatment), rather than aborting.
4326 * xfns.c (x_encode_text, x_set_name_internal)
4327 (Fx_change_window_property): Use ptrdiff_t, not int, to count
4328 sizes, since they can exceed INT_MAX in size. Check for size
4329 calculation overflow.
4331 * xgselect.c (gfds_size): Now ptrdiff_t, for convenience with xpalloc.
4332 (xg_select): Check for size calculation overflow.
4333 Don't update size until alloc done.
4335 * xrdb.c (get_environ_db): Don't assume path length fits in int,
4336 as sprintf is limited to int lengths.
4338 * xselect.c (X_LONG_SIZE, X_SHRT_MAX, X_SHRT_MIN, X_LONG_MAX)
4339 (X_LONG_MIN): New macros.
4340 Use them to make the following changes clearer.
4341 (MAX_SELECTION_QUANTUM): Make the other bounds on this value clearer.
4342 This change doesn't affect the value now, but it may help remind
4343 future maintainers not to raise the value too much later.
4344 (SELECTION_QUANTUM): Remove, replacing with ...
4345 (selection_quantum): ... new function, which avoids overflow.
4347 (struct selection_data.size): Now ptrdiff_t, not int, to avoid
4348 assumption that selection length fits in 'int'.
4349 (x_reply_selection_request, x_handle_selection_request)
4350 (x_get_window_property, receive_incremental_selection)
4351 (x_get_window_property_as_lisp_data, selection_data_to_lisp_data)
4352 (lisp_data_to_selection_data, clean_local_selection_data):
4353 Use ptrdiff_t, not int, to record length of selection.
4354 (x_reply_selection_request, x_get_window_property)
4355 (receive_incremental_selection, x_property_data_to_lisp):
4356 Redo calculations to avoid overflow.
4357 (x_reply_selection_request): When sending hint, ceiling it at
4358 X_LONG_MAX rather than relying on wraparound overflow to send
4360 (x_get_window_property, receive_incremental_selection)
4361 (lisp_data_to_selection_data, x_property_data_to_lisp):
4362 Check for size-calculation overflow.
4363 (x_get_window_property, receive_incremental_selection)
4364 (lisp_data_to_selection_data, Fx_register_dnd_atom):
4365 Don't store size until memory allocation succeeds.
4366 (x_get_window_property): Plug memory leak on memory exhaustion.
4367 Don't double-block input; malloc is safe here. Don't assume 2**34
4368 - 4 fits in unsigned long. Add an xassert to check
4369 XGetWindowProperty overflow. Be more careful about overflow
4370 calculations, and distinguish size from memory overflow better.
4371 (receive_incremental_selection): When tracing, don't assume
4372 unsigned int is less than INT_MAX.
4373 (x_selection_data_to_lisp_data): Remove unnecessary (and in theory
4374 harmful) conversions of unsigned short to int.
4375 (lisp_data_to_selection_data): Don't assume that integers
4376 in the range -65535 through -1 fit in an X unsigned short.
4377 Don't assume that ULONG_MAX == X_ULONG_MAX. Don't store into
4378 result parameters unless successful. Rely on cons_to_unsigned
4379 to report problems with elements; the old code wasn't right anyway.
4380 (x_check_property_data): Check for int overflow; we cannot use
4381 a wider type due to X limits.
4382 (x_handle_dnd_message): Use unsigned int, to avoid int overflow.
4384 * xsmfns.c (smc_save_yourself_CB): Check for size calc overflow.
4386 * xterm.c (x_color_cells, x_send_scrollbar_event, handle_one_xevent)
4387 (x_term_init): Check for size calculation overflow.
4388 (x_color_cells): Don't store size until memory allocation succeeds.
4389 (handle_one_xevent): Use ptrdiff_t, not int, for byte counts.
4390 Don't assume alloca size is less than MAX_ALLOCA.
4391 (x_term_init): Don't assume length fits in int (sprintf is limited
4394 Use ptrdiff_t for composition IDs.
4395 * character.c (lisp_string_width):
4396 * composite.c (composition_table_size, n_compositions)
4397 (get_composition_id, composition_gstring_from_id):
4398 * dispextern.h (struct glyph_string.cmp_id, struct composition_it.id):
4399 * xdisp.c (BUILD_COMPOSITE_GLYPH_STRING):
4400 * window.c (Frecenter):
4401 Use ptrdiff_t, not int, for composition IDs.
4402 * composite.c (get_composition_id): Check for integer overflow.
4403 * composite.h: Adjust prototypes to match the above changes.
4405 Use ptrdiff_t for hash table indexes.
4406 * category.c (hash_get_category_set):
4407 * ccl.c (ccl_driver):
4408 * charset.h (struct charset.hash_index, CHECK_CHARSET_GET_ID):
4409 * coding.c (coding_system_charset_list, detect_coding_system):
4410 * coding.h (struct coding_system.id):
4411 * composite.c (get_composition_id, gstring_lookup_cache):
4412 * fns.c (hash_lookup, hash_put, Fgethash, Fputhash):
4413 * image.c (xpm_get_color_table_h):
4414 * lisp.h (hash_lookup, hash_put):
4415 * minibuf.c (Ftest_completion):
4416 Use ptrdiff_t for hash table indexes, not int (which is too
4417 narrow, on 64-bit hosts) or EMACS_INT (which is too wide, on
4418 32-bit --with-wide-int hosts).
4420 * charset.c (Fdefine_charset_internal): Check for integer overflow.
4421 Add a FIXME comment about memory leaks.
4422 (syms_of_charset): Don't assume xmalloc returns.
4424 Don't assume that stated character widths fit in int.
4425 * character.c (Fchar_width, c_string_width, lisp_string_width):
4426 * character.h (CHAR_WIDTH):
4427 * indent.c (MULTIBYTE_BYTES_WIDTH):
4428 Use sanitize_char_width to avoid undefined and/or bad behavior
4429 with outlandish widths.
4430 * character.h (sanitize_tab_width): Rename from sanitize_width,
4431 now that we have two such functions. All uses changed.
4432 (sanitize_char_width): New inline function.
4434 Don't assume that tab-width fits in int.
4435 * character.h (sanitize_width): New inline function.
4436 (SANE_TAB_WIDTH): New macro.
4437 (ASCII_CHAR_WIDTH): Use it.
4438 * indent.c (sane_tab_width): Remove. All uses replaced by
4439 SANE_TAB_WIDTH (current_buffer).
4440 * xdisp.c (init_iterator): Use SANE_TAB_WIDTH.
4442 * fileio.c: Integer overflow issues with file modes.
4443 (Fset_file_modes, auto_save_1): Don't assume EMACS_INT fits in int.
4445 * charset.c (read_hex): New arg OVERFLOW. All uses changed.
4446 Remove unreachable code.
4447 (read_hex, load_charset_map_from_file): Check for integer overflow.
4449 * xterm.c: Don't go over XClientMessageEvent limit.
4450 (scroll_bar_windows_size): Now ptrdiff_t, as we prefer signed.
4451 (x_send_scroll_bar_event): Likewise. Check that the size does not
4452 exceed limits imposed by XClientMessageEvent, as well as the usual
4453 ptrdiff_t and size_t limits.
4455 * keyboard.c: Overflow, signedness and related fixes.
4456 (make_lispy_movement): Use same integer type in forward decl
4457 that is used in the definition.
4458 (read_key_sequence, keyremap_step):
4459 Change bufsize argument back to int, undoing my 2011-03-30 change.
4460 We prefer signed types, and int is wide enough here.
4461 (parse_tool_bar_item): Don't assume tool_bar_max_label_size is less
4462 than TYPE_MAXIMUM (EMACS_INT) / 2. Don't let the label size grow
4463 larger than STRING_BYTES_BOUND. Use ptrdiff_t for Emacs string
4464 length, not size_t. Use ptrdiff_t for index, not int.
4465 (keyremap_step, read_key_sequence): Redo bufsize check to avoid
4466 possibility of integer overflow.
4468 Overflow, signedness and related fixes for images.
4470 * dispextern.h (struct it.stack[0].u.image.image_id)
4471 (struct_it.image_id, struct image.id, struct image_cache.size)
4472 (struct image_cache.used, struct image_cache.ref_count):
4473 * gtkutil.c (update_frame_tool_bar):
4474 * image.c (x_reference_bitmap, Fimage_size, Fimage_mask_p)
4475 (Fimage_metadata, free_image_cache, clear_image_cache, lookup_image)
4476 (cache_image, mark_image_cache, x_kill_gs_process, Flookup_image):
4477 * nsmenu.m (update_frame_tool_bar):
4478 * xdisp.c (calc_pixel_width_or_height):
4479 * xfns.c (image_cache_refcount):
4480 Image IDs are now ptrdiff_t, not int, to avoid arbitrary limits
4481 on typical 64-bit hosts.
4483 * image.c (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): New macros.
4484 (x_bitmap_pixmap, x_create_x_image_and_pixmap):
4485 Omit unnecessary casts to int.
4486 (parse_image_spec): Check that integers fall into 'int' range
4487 when the callers expect that.
4488 (image_ascent): Redo ascent calculation to avoid int overflow.
4489 (clear_image_cache): Avoid overflow when sqrt (INT_MAX) < nimages.
4490 (lookup_image): Remove unnecessary tests.
4491 (xbm_image_p): Locals are now of int, not EMACS_INT,
4492 since parse_image_check makes sure they fit into int.
4493 (png_load, gif_load, svg_load_image):
4494 Prefer int to unsigned where either will do.
4495 (tiff_handler): New function, combining the cores of the
4496 old tiff_error_handler and tiff_warning_handler.
4497 This function is rewritten to use vsnprintf and thereby avoid
4498 stack buffer overflows. It uses only the features of vsnprintf
4499 that are common to both POSIX and native Microsoft.
4500 (tiff_error_handler, tiff_warning_handler): Use it.
4501 (tiff_load, gif_load, imagemagick_load_image):
4502 Don't assume :index value fits in 'int'.
4503 (gif_load): Omit unnecessary cast to double, and avoid double-rounding.
4504 (imagemagick_load_image): Check that crop parameters fit into
4505 the integer types that MagickCropImage accepts. Don't assume
4506 Vimagemagick_render_type has a nonnegative value. Don't assume
4507 size_t fits in 'long'.
4508 (gs_load): Use printmax_t to print the widest integers possible.
4509 Check for integer overflow when computing image height and width.
4511 2011-08-26 Eli Zaretskii <eliz@gnu.org>
4513 * xdisp.c (redisplay_window): Don't force window start if point
4514 will be invisible in the resulting window. (Bug#9324)
4516 2011-08-25 Eli Zaretskii <eliz@gnu.org>
4518 * xdisp.c (compute_display_string_pos): Return 2 in DISP_PROP when
4519 the display spec is of the form `(space ...)'.
4520 (handle_display_spec): Return the value returned by
4521 handle_single_display_spec, not just 1 or zero.
4522 (handle_single_display_spec): If the display spec is of the form
4523 `(space ...)', and specifies display in the text area, return 2
4525 (try_cursor_movement): Check for the need to scroll more
4526 accurately, and prefer exact match for point under bidi.
4527 Don't advance `row' beyond the last row of the window.
4529 * dispextern.h (struct bidi_it): Rename the disp_prop_p member
4530 into disp_prop; all users changed.
4532 * bidi.c (bidi_fetch_char): If compute_display_string_pos returns
4533 DISP_PROP = 2, substitute the u+2029 PARAGRAPH SEPARATOR character
4534 for the text covered by the display property.
4536 2011-08-25 Chong Yidong <cyd@stupidchicken.com>
4538 * buffer.c (Fbury_buffer_internal): Rename from Funrecord_buffer.
4539 Change return value to nil.
4540 (Frecord_buffer): Delete unused function.
4542 2011-08-24 Eli Zaretskii <eliz@gnu.org>
4544 * xdisp.c (Fcurrent_bidi_paragraph_direction): For unibyte
4545 buffers, return left-to-right.
4546 (set_cursor_from_row): Consider candidate row a win if its glyph
4547 represents a newline and point is on that newline. Fixes cursor
4548 positioning on the newline at EOL of R2L text within L2R
4549 paragraph, and vice versa.
4550 (try_cursor_movement): Check continued rows, in addition to
4551 continuation rows. Fixes unwarranted scroll when point enters a
4552 continued line of R2L text within an L2R paragraph, or vice versa.
4553 (cursor_row_p): Consider the case of point being equal to
4554 MATRIX_ROW_END_CHARPOS. Prevents cursor being stuck when moving
4555 from the end of a short line to the beginning of a continued line
4556 of R2L text within L2R paragraph.
4557 (RECORD_MAX_MIN_POS): For max_pos, use IT_CHARPOS even for
4558 composed characters.
4560 * bidi.c (bidi_check_type): Use xassert.
4561 (bidi_cache_iterator_state): Update the disp_pos and disp_prop_p
4564 2011-08-23 Eli Zaretskii <eliz@gnu.org>
4566 * bidi.c (bidi_get_type): Abort if we get zero as the bidi type of
4569 2011-08-23 Chong Yidong <cyd@stupidchicken.com>
4571 * nsfont.m (ns_otf_to_script): Fix typo.
4573 2011-08-22 Kenichi Handa <handa@m17n.org>
4575 * chartab.c (Fset_char_table_extra_slot): Do not inhibit setting a
4576 extra slot even if the purpose is char-code-property-table.
4578 2011-08-23 Eli Zaretskii <eliz@gnu.org>
4580 * xdisp.c (redisplay_window): When computing centering_position,
4581 account for the height of the header line. (Bug#8874)
4583 * dispnew.c (buffer_posn_from_coords): Use buf_charpos_to_bytepos
4584 instead of CHAR_TO_BYTE. Fixes a crash when a completion
4585 candidate is selected by the mouse, and that candidate has a
4586 composed character under the mouse.
4588 * xdisp.c (x_produce_glyphs): Set it->nglyphs to 1. Fixes pixel
4589 coordinates reported by pos-visible-in-window-p for a composed
4590 character in column zero.
4592 2011-08-23 Stefan Monnier <monnier@iro.umontreal.ca>
4594 * cmds.c (Fself_insert_command): Mention post-self-insert-hook.
4596 2011-08-22 Eli Zaretskii <eliz@gnu.org>
4598 * xdisp.c (BUFFER_POS_REACHED_P): If this is a composition,
4599 consider it a hit if to_charpos is anywhere in the range of the
4600 composed buffer positions.
4602 2011-08-22 Chong Yidong <cyd@stupidchicken.com>
4604 * image.c (gif_load): Don't assume that each subimage has the same
4605 dimensions as the base image. Handle disposal method that is
4606 "undefined" by the gif spec (Bug#9335).
4608 2011-08-20 Chong Yidong <cyd@stupidchicken.com>
4610 * eval.c (Fsignal): Handle `debug' symbol in error handler (Bug#9329).
4611 (Fcondition_case): Document `debug' symbol in error handler.
4613 2011-08-19 Eli Zaretskii <eliz@gnu.org>
4615 * xfaces.c (face_at_buffer_position): Avoid repeated evaluation of
4616 face ID by FACE_FROM_ID, and avoid a crash when mouse is moved
4617 from an Org mode buffer to a Speedbar frame.
4619 * xdisp.c (RECORD_MAX_MIN_POS): If the display element comes from
4620 a composition, take its buffer position from IT->cmp_it.charpos.
4621 Fixes cursor positioning at the beginning of a line that begins
4622 with a composed character.
4624 2011-08-18 Eli Zaretskii <eliz@gnu.org>
4626 * bidi.c (bidi_get_type): If bidi_type_table reports zero as the
4627 character bidirectional type, use STRONG_L instead. Fixes crashes
4628 in a buffer produced by `describe-categories'.
4630 * dispextern.h (struct bidi_it): Move disp_pos and disp_prop_p
4631 members before the level stack, so they would be saved and
4632 restored when copying iterator state. Fixes incorrect reordering
4633 around TABs covered by display properties.
4635 2011-08-18 Andreas Schwab <schwab@linux-m68k.org>
4637 * process.c (Fnetwork_interface_list): Correctly determine buffer size.
4639 2011-08-17 Chong Yidong <cyd@stupidchicken.com>
4641 * eval.c (internal_condition_case, internal_condition_case_1)
4642 (internal_condition_case_2, internal_condition_case_n):
4643 Remove unnecessary aborts (Bug#9081).
4645 2011-08-17 Eli Zaretskii <eliz@gnu.org>
4647 * lread.c (Fload) [DOS_NT]: If `openp' returns -2, but the file
4648 has no `load' handler, try opening the file locally. (Bug#9311)
4650 2011-08-16 Ken Brown <kbrown@cornell.edu>
4652 * gmalloc.c: Expand comment.
4654 2011-08-16 Eli Zaretskii <eliz@gnu.org>
4656 * xdisp.c (set_cursor_from_row): Don't accept a previous candidate
4657 if it fails the cursor_row_p test. Fixes cursor positioning at ZV.
4659 2011-08-16 Ken Brown <kbrown@cornell.edu>
4661 Fix memory allocation problems in Cygwin build (Bug#9273).
4663 * unexcw.c ( __malloc_initialized): Declare external variable.
4664 (fixup_executable): Force the dumped emacs to reinitialize malloc.
4666 * gmalloc.c [CYGWIN] (bss_sbrk_heapbase, bss_sbrk_heapinfo):
4668 (malloc_initialize_1) [CYGWIN]: Prepare for reinitializing the
4670 (_free_internal_nolock) [CYGWIN]: Ignore requests to free storage
4672 [CYGWIN] (special_realloc): New function.
4673 (_realloc_internal_nolock) [CYGWIN]: Use the new function on
4674 requests to realloc storage in the static heap.
4676 2011-08-15 Paul Eggert <eggert@cs.ucla.edu>
4678 * bidi.c (bidi_initialize): Remove unused local.
4680 2011-08-15 Eli Zaretskii <eliz@gnu.org>
4683 * biditype.h: Remove file.
4684 * makefile.w32-in ($(BLD)/bidi.$(O)):
4685 * deps.mk (bidi.o): Remove biditype.h and bidimirror.h.
4687 * dispextern.h: Fix a typo in the comment to bidi_type_t.
4689 * chartab.c: Improve commentary for the uniprop_table API.
4691 * bidi.c (bidi_paragraph_init): Support zero value of
4692 bidi_ignore_explicit_marks_for_paragraph_level.
4693 (bidi_initialize): Use uniprop_table instead of including
4694 biditype.h and bidimirror.h.
4696 * xdisp.c (move_it_in_display_line_to): Don't reset pixel
4697 coordinates of the iterator when restoring from ppos_it.
4700 2011-08-14 Kenichi Handa <handa@m17n.org>
4702 * process.c (create_process): Call setup_process_coding_systems
4703 after the pid of the process is set to -1 (Bug#8162).
4705 2011-08-14 Eli Zaretskii <eliz@gnu.org>
4707 * xdisp.c (move_it_in_display_line_to): Don't invoke
4708 IT_RESET_X_ASCENT_DESCENT when iterator position was restored from
4709 ppos_it. Fixes vertical cursor motion when line beginning is
4710 covered by an image. (Bug#9296)
4712 2011-08-14 Jan Djärv <jan.h.d@swipnet.se>
4714 * nsterm.h (ns_run_ascript): Declare.
4715 (NSAPP_DATA2_RUNASSCRIPT): Define.
4717 * nsfns.m (as_script, as_result, as_status): New static variables.
4718 (ns_run_ascript): New function.
4719 (Fns_do_applescript): Set variables as_*. Make an NSApplicationDefined
4720 event with data2 set to NSAPP_DATA2_RUNASSCRIPT, post it and then start
4721 the event loop. Get status from as_status (Bug#7276).
4723 * nsterm.m (sendEvent): If event is NSApplicationDefined and
4724 data2 is NSAPP_DATA2_RUNASSCRIPT, call ns_run_ascript and then exit
4725 the event loop (Bug#7276).
4727 2011-08-14 Andreas Schwab <schwab@linux-m68k.org>
4729 * gnutls.c (QCgnutls_bootprop_priority)
4730 (QCgnutls_bootprop_trustfiles, QCgnutls_bootprop_keylist)
4731 (QCgnutls_bootprop_crlfiles, QCgnutls_bootprop_callbacks)
4732 (QCgnutls_bootprop_loglevel, QCgnutls_bootprop_hostname)
4733 (QCgnutls_bootprop_min_prime_bits, QCgnutls_bootprop_verify_flags)
4734 (QCgnutls_bootprop_verify_hostname_error)
4735 (QCgnutls_bootprop_callbacks_verify): Rename from
4736 Qgnutls_bootprop_..., all uses changed.
4738 * xfaces.c (QCignore_defface): Rename from Qignore_defface, all
4741 2011-08-14 Paul Eggert <eggert@cs.ucla.edu>
4743 * xfaces.c (Qframe_set_background_mode): Now static.
4744 * dispextern.h (Qframe_set_background_mode): Remove decl.
4746 * process.c (Fnetwork_interface_info): Declare local only if needed.
4748 2011-08-13 Jan Djärv <jan.h.d@swipnet.se>
4750 * process.c: Include ifaddrs.h and net/if_dl.h if available (Bug#8477).
4751 (Fnetwork_interface_list): Allocate in increments of bytes instead
4752 of sizeof (struct ifreq). Iterate over ifconf.ifc_req by counting
4753 bytes (Bug#8477). Count bytes correctly when ifr_addr is a struct
4755 (struct ifflag_def): notrailers is smart on OSX.
4756 (Fnetwork_interface_info): Handle case when ifr_flags is negative.
4757 Get hardware address with getifaddrs if available.
4759 2011-08-12 Eli Zaretskii <eliz@gnu.org>
4761 * xdisp.c (iterate_out_of_display_property): xassert that
4762 IT->position is set to within IT->object's boundaries. Break from
4763 the loop as soon as EOB is reached; avoids infloops in redisplay
4764 when IT->position is set up wrongly due to some bug.
4765 Set IT->current to match the bidi iterator unconditionally.
4766 (push_display_prop): Allow GET_FROM_STRING as IT->method on
4767 entry. Force push_it to save on the stack the current
4768 buffer/string position, to be restored by pop_it. Fix flags in
4769 the iterator structure wrt the object coming from a display
4770 property, as `line-prefix' and `wrap-prefix' are not ``replacing''
4771 properties. (Bug#9284)
4773 2011-08-09 Andreas Schwab <schwab@linux-m68k.org>
4775 * fontset.c (fontset_get_font_group): Add proper type checks.
4778 2011-08-09 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
4780 * unexmacosx.c (print_load_command_name): Add cases LC_FUNCTION_STARTS
4781 and LC_VERSION_MIN_MACOSX.
4782 (copy_linkedit_data) [LC_FUNCTION_STARTS]: New function.
4783 (dump_it) [LC_FUNCTION_STARTS]: Use it.
4785 2011-08-08 Eli Zaretskii <eliz@gnu.org>
4787 * xdisp.c (forward_to_next_line_start): Allow to use the
4788 no-display-properties-and-no-overlays under bidi display.
4789 Set disp_pos in the bidi iterator to avoid searches for display
4790 properties and overlays.
4792 2011-08-08 Chong Yidong <cyd@stupidchicken.com>
4794 * editfns.c (Fset_time_zone_rule): Document relationship with the
4797 * ftfont.c (ftfont_pattern_entity): Copy the extras argument to
4798 the font entity extracted from the cache (Bug#8109).
4800 2011-08-07 Chong Yidong <cyd@stupidchicken.com>
4802 * composite.c (autocmp_chars): Don't reset point. That is done by
4803 restore_point_unwind (Bug#5984).
4805 2011-08-07 Juri Linkov <juri@jurta.org>
4807 * editfns.c (Fformat_time_string): Doc fix, add tag `usage:'
4808 to show the arg `TIME' instead of `TIMEVAL'.
4810 2011-08-06 Eli Zaretskii <eliz@gnu.org>
4812 * xdisp.c (set_cursor_from_row): Fix cursor positioning when a
4813 display property strides EOL and includes a newline, as in
4814 longlines-mode. (Bug#9254)
4815 (move_it_in_display_line_to): Fix vertical-motion in a buffer with
4816 word-wrap under bidirectional display. (Bug#9224)
4818 * bidi.c (bidi_unshelve_cache): Don't reset the cache if JUST_FREE
4819 is non-zero, even if the data buffer is NULL. Fixes a crash in
4820 vertical-motion with longlines-mode. (Bug#9254)
4822 2011-08-05 Eli Zaretskii <eliz@gnu.org>
4824 * bidi.c <bidi_cache_total_alloc>: Now static.
4825 (bidi_initialize): Initialize bidi_cache_total_alloc.
4827 * xdisp.c (display_line): Release buffer allocated for shelved bidi
4830 * bidi.c (bidi_shelve_cache, bidi_unshelve_cache): Track total
4831 amount allocated this far in `bidi_cache_total_alloc'.
4832 (bidi_unshelve_cache): Accept an additional argument JUST_FREE; if
4833 non-zero, only free the data buffer without restoring the cache
4834 contents. All callers changed.
4836 * dispextern.h (bidi_unshelve_cache): Update prototype.
4838 * xdisp.c (SAVE_IT, pos_visible_p, move_it_in_display_line_to)
4839 (move_it_in_display_line, move_it_to)
4840 (move_it_vertically_backward, move_it_by_lines): Replace the call
4841 to xfree to an equivalent call to bidi_unshelve_cache.
4842 (move_it_in_display_line_to): Fix logic of returning
4843 MOVE_POS_MATCH_OR_ZV in the bidi case. (Bug#9224)
4845 2011-08-05 Eli Zaretskii <eliz@gnu.org>
4847 * xdisp.c (set_cursor_from_row): Prefer the candidate glyph that
4848 came from a string character with a `cursor' property. (Bug#9229)
4850 2011-08-04 Jan Djärv <jan.h.d@swipnet.se>
4852 * Makefile.in (LIB_PTHREAD): New variable.
4853 (LIBES): Add LIB_PTHREAD (Bug#9216).
4855 * alloc.c, emacs.c, gmalloc.c, gtkutil.c, keyboard.c, syssignal.h:
4856 Rename HAVE_GTK_AND_PTHREAD to HAVE_PTHREAD (Bug#9216).
4858 2011-08-04 Andreas Schwab <schwab@linux-m68k.org>
4860 * regex.c (re_iswctype): Remove some redundant boolean conversions.
4862 2011-08-04 Jan Djärv <jan.h.d@swipnet.se>
4864 * xterm.c (x_find_topmost_parent): New function.
4865 (x_set_frame_alpha): Find topmost parent window with
4866 x_find_topmost_parent and set the property there also (bug#9181).
4867 (handle_one_xevent): Call x_set_frame_alpha on ReparentNotify.
4869 2011-08-04 Paul Eggert <eggert@cs.ucla.edu>
4871 * callproc.c (Fcall_process): Avoid vfork clobbering
4872 the local vars buffer, coding_systems, current_dir.
4874 2011-08-03 Stefan Monnier <monnier@iro.umontreal.ca>
4876 * keymap.c (Fmake_composed_keymap): Move to subr.el.
4878 2011-08-03 Paul Eggert <eggert@cs.ucla.edu>
4880 * fontset.c (dump_fontset) [FONTSET_DEBUG]: Declare EXTERNALLY_VISIBLE
4881 so that it is not optimized away.
4883 * xdisp.c (compute_display_string_pos): Remove unused local.
4885 2011-08-02 Eli Zaretskii <eliz@gnu.org>
4887 Fix slow cursor motion and scrolling in large buffers with
4888 selective display, like Org Mode buffers. (Bug#9218)
4890 * dispextern.h (struct bidi_it): New member disp_prop_p.
4892 * xdisp.c: Remove one-slot cache of display string positions.
4893 (compute_display_string_pos): Accept an additional argument
4894 DISP_PROP_P; callers changed. Scan at most 5K characters forward
4895 for a display string or property. If found, set DISP_PROP_P
4898 * bidi.c (bidi_fetch_char): Accept an additional argument
4899 DISP_PROP_P, and pass it to compute_display_string_pos.
4900 Only handle text covered by a display string if DISP_PROP_P is returned
4901 non-zero. All callers of bidi_fetch_char changed.
4903 2011-08-02 Stefan Monnier <monnier@iro.umontreal.ca>
4905 * keymap.c (Fdefine_key): Fix Lisp_Object/int mixup; apply some CSE.
4907 2010-12-03 Don March <don@ohspite.net>
4909 * keymap.c (Fdefine_key): Fix non-prefix key error message when
4910 last character M-[char] is translated to ESC [char] (bug#7541).
4912 2011-08-02 Kenichi Handa <handa@m17n.org>
4914 * lisp.h (uniprop_table): Extern it.
4916 * chartab.c (uniprop_table): Make it non-static.
4918 2011-08-01 Eli Zaretskii <eliz@gnu.org>
4920 * xdisp.c (forward_to_next_line_start): Accept additional argument
4921 BIDI_IT_PREV, and store into it the state of the bidi iterator had
4923 (reseat_at_next_visible_line_start): Use the bidi iterator state
4924 returned by forward_to_next_line_start to restore the state of
4925 it->bidi_it after backing up to previous newline. (Bug#9212)
4927 2011-07-30 Andreas Schwab <schwab@linux-m68k.org>
4929 * regex.c (re_comp): Protoize.
4930 (re_exec): Fix return type.
4931 (regexec): Fix type of `ret'. (Bug#9203)
4933 2011-07-28 Paul Eggert <eggert@cs.ucla.edu>
4935 * image.c (check_image_size): Use 1024x1024 if unknown frame (Bug#9189).
4936 This is needed if max-image-size is a floating-point number.
4938 2011-07-28 Andreas Schwab <schwab@linux-m68k.org>
4940 * print.c (print_object): Print empty symbol as ##.
4942 * lread.c (read1): Read ## as empty symbol.
4944 2011-07-28 Alp Aker <alp.tekin.aker@gmail.com>
4946 * nsfns.m (x_set_foreground_color): Set f->foreground_pixel when
4947 setting frame foreground color (Bug#9175).
4948 (x_set_background_color): Likewise.
4950 * nsmenu.m (-setText): Size tooltip dimensions precisely to
4951 contents (Bug#9176).
4952 (EmacsTooltip -init): Remove bezels and add shadows to
4955 * nsterm.m (ns_dumpglyphs_stretch): Avoid overwriting left fringe
4956 or scroll bar (Bug#8470).
4958 * nsfont.m (nsfont_open): Remove assignment to voffset and
4959 unnecessary vars hshink, expand, hd, full_height, min_height.
4960 (nsfont_draw): Use s->ybase as baseline for glyph drawing (Bug#8913).
4962 * nsterm.h (nsfont_info): Remove voffset field.
4964 2011-07-28 Alp Aker <alp.tekin.aker@gmail.com>
4966 Implement strike-through and overline on NextStep (Bug#8863).
4968 * nsfont.m (nsfont_open): Use underline position provided by font,
4969 instead of hard-coded value of 2.
4970 (nsfont_draw): Call ns_draw_text_decoration instead.
4972 * nsterm.h: Add declaration for ns_draw_text_decoration.
4974 * nsterm.m (ns_draw_text_decoration): New function for drawing
4975 underline, overline, and strike-through.
4976 (ns_dumpglyphs_image, ns_dumpglyphs_stretch): Add call to
4977 ns_draw_text_decoration. Change treatment of cursor drawing to
4978 accommodate underlining, etc.
4980 2011-07-28 Eli Zaretskii <eliz@gnu.org>
4982 * buffer.c (init_buffer_once): Set bidi-display-reordering to t by
4985 2011-07-28 Paul Eggert <eggert@cs.ucla.edu>
4987 * alloc.c (memory_full) [!SYNC_INPUT]: Fix signal-related race.
4988 Without this fix, if a signal arrives just after memory fills up,
4989 'malloc' might be invoked reentrantly.
4991 * image.c (x_check_image_size) [!HAVE_X_WINDOWS]: Return 1.
4992 In other words, assume that every image size is allowed, on non-X
4993 hosts. This assumption is probably wrong, but it lets Emacs compile.
4995 2011-07-28 Andreas Schwab <schwab@linux-m68k.org>
4997 * regex.c (re_iswctype): Convert return values to boolean.
4999 2011-07-28 Eli Zaretskii <eliz@fencepost.gnu.org>
5001 * xdisp.c (compute_display_string_pos): Don't use cached display
5002 string position if the buffer had its restriction changed.
5005 2011-07-28 Paul Eggert <eggert@cs.ucla.edu>
5007 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork clobbering.
5009 2011-07-28 Paul Eggert <eggert@cs.ucla.edu>
5011 Integer signedness and overflow and related fixes. (Bug#9079)
5013 * bidi.c: Integer size and overflow fixes.
5014 (bidi_cache_size, bidi_cache_idx, bidi_cache_last_idx)
5015 (bidi_cache_start, bidi_cache_fetch_state, bidi_cache_search)
5016 (bidi_cache_find_level_change, bidi_cache_ensure_space)
5017 (bidi_cache_iterator_state, bidi_cache_find, bidi_cache_start_stack)
5018 (bidi_find_other_level_edge):
5019 Use ptrdiff_t instead of EMACS_INT where either will do.
5020 This works better on 32-bit hosts configured --with-wide-int.
5021 (bidi_cache_ensure_space): Check for size-calculation overflow.
5022 Use % rather than repeated addition, for better worst-case speed.
5023 Don't set bidi_cache_size until after xrealloc returns, because it
5025 (bidi_dump_cached_states): Use ptrdiff_t, not int, to avoid overflow.
5026 (bidi_cache_ensure_space): Also check that the bidi cache size
5027 does not exceed that of the largest Lisp string or buffer. See Eli
5028 Zaretskii in <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9079#29>.
5030 * alloc.c (__malloc_size_t): Remove.
5031 All uses replaced by size_t. See Andreas Schwab's note
5032 <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9079#8>.
5034 * image.c: Improve checking for integer overflow.
5035 (check_image_size): Assume that f is nonnull, since
5036 it is always nonnull in practice. This is one less thing to
5037 worry about when checking for integer overflow later.
5038 (x_check_image_size): New function, which checks for integer
5039 overflow issues inside X.
5040 (x_create_x_image_and_pixmap, xbm_read_bitmap_data): Use it.
5041 This removes the need for a memory_full check.
5042 (xbm_image_p): Rewrite to avoid integer multiplication overflow.
5043 (Create_Pixmap_From_Bitmap_Data, xbm_load): Use x_check_image_size.
5044 (xbm_read_bitmap_data): Change locals back to 'int', since
5045 their values must fit in 'int'.
5046 (xpm_load_image, png_load, tiff_load):
5047 Invoke x_create_x_image_and_pixmap earlier,
5048 to avoid much needless work if the image is too large.
5049 (tiff_load): Treat overly large images as if
5050 x_create_x_image_and_pixmap failed, not as malloc failures.
5051 (gs_load): Use x_check_image_size.
5053 * gtkutil.c: Omit integer casts.
5054 (xg_get_pixbuf_from_pixmap): Remove unnecessary cast.
5055 (xg_set_toolkit_scroll_bar_thumb): Rewrite to avoid need for cast.
5057 * image.c (png_load): Don't assume height * row_bytes fits in 'int'.
5059 * xfaces.c (Fbitmap_spec_p): Fix integer overflow bug.
5060 Without this fix, (bitmap-spec-p '(34359738368 1 "x"))
5061 would wrongly return t on a 64-bit host.
5063 * dispnew.c (init_display): Use *_RANGE_OVERFLOW macros.
5064 The plain *_OVERFLOW macros run afoul of GCC bug 49705
5065 <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49705>
5066 and therefore cause GCC to emit a bogus diagnostic in some cases.
5068 * image.c: Integer signedness and overflow and related fixes.
5069 This is not an exhaustive set of fixes, but it's time to
5070 record what I've got.
5071 (lookup_pixel_color, check_image_size): Remove redundant decls.
5072 (check_image_size): Don't assume that arbitrary EMACS_INT values
5073 fit in 'int', or that arbitrary 'double' values fit in 'int'.
5074 (x_alloc_image_color, x_create_x_image_and_pixmap, png_load)
5075 (tiff_load, imagemagick_load_image):
5076 Check for overflow in size calculations.
5077 (x_create_x_image_and_pixmap): Remove unnecessary test for
5078 xmalloc returning NULL; that can't happen.
5079 (xbm_read_bitmap_data): Don't assume sizes fit into 'int'.
5080 (xpm_color_bucket): Use better integer hashing function.
5081 (xpm_cache_color): Don't possibly over-allocate memory.
5082 (struct png_memory_storage, tiff_memory_source, tiff_seek_in_memory)
5083 (gif_memory_source):
5084 Use ptrdiff_t, not int or size_t, to record sizes.
5085 (png_load): Don't assume values greater than 2**31 fit in 'int'.
5086 (our_stdio_fill_input_buffer): Prefer ptrdiff_t to size_t when
5087 either works, as we prefer signed integers.
5088 (tiff_read_from_memory, tiff_write_from_memory):
5089 Return tsize_t, not size_t, since that's what the TIFF API wants.
5090 (tiff_read_from_memory): Don't fail simply because the read would
5091 go past EOF; instead, return a short read.
5092 (tiff_load): Omit no-longer-needed casts.
5093 (Fimagemagick_types): Don't assume size fits into 'int'.
5095 Improve hashing quality when configured --with-wide-int.
5096 * fns.c (hash_string): New function, taken from sxhash_string.
5097 Do not discard information about ASCII character case; this
5098 discarding is no longer needed.
5099 (sxhash-string): Use it. Change sig to match it. Caller changed.
5100 * lisp.h: Declare it.
5101 * lread.c (hash_string): Remove, since we now use fns.c's version.
5102 The fns.c version returns a wider integer if --with-wide-int is
5103 specified, so this should help the quality of the hashing a bit.
5105 * emacs.c: Integer overflow minor fix.
5106 (heap_bss_diff): Now uprintmax_t, not unsigned long. All used changed.
5107 Define only if GNU_LINUX.
5108 (main, Fdump_emacs): Set and use heap_bss_diff only if GNU_LINUX.
5110 * dispnew.c: Integer signedness and overflow fixes.
5111 Remove unnecessary forward decls, that were a maintenance hassle.
5112 (history_tick): Now uprintmax_t, so it's more likely to avoid overflow.
5114 (adjust_glyph_matrix, realloc_glyph_pool, adjust_frame_message_buffer)
5115 (scrolling_window): Use ptrdiff_t, not int, for byte count.
5116 (prepare_desired_row, line_draw_cost):
5117 Use int, not unsigned, where either works.
5118 (save_current_matrix, restore_current_matrix):
5119 Use ptrdiff_t, not size_t, where either works.
5120 (init_display): Check for overflow more accurately, and without
5121 relying on undefined behavior.
5123 * editfns.c (pWIDE, pWIDElen, signed_wide, unsigned_wide):
5124 Remove, replacing with the new symbols in lisp.h. All uses changed.
5125 * fileio.c (make_temp_name):
5126 * filelock.c (lock_file_1, lock_file):
5127 * xdisp.c (message_dolog):
5128 Don't assume PRIdMAX etc. works; this isn't portable to pre-C99 hosts.
5129 Use pMd etc. instead.
5130 * lisp.h (printmax_t, uprintmax_t, pMd, pMu): New types and macros,
5131 replacing the pWIDE etc. symbols removed from editfns.c.
5133 * keyboard.h (num_input_events): Now uintmax_t.
5134 This is (very slightly) less likely to mess up due to wraparound.
5137 * buffer.c: Integer signedness fixes.
5138 (alloc_buffer_text, enlarge_buffer_text):
5139 Use ptrdiff_t rather than size_t when either will do, as we prefer
5142 * alloc.c: Integer signedness and overflow fixes.
5143 Do not impose an arbitrary 32-bit limit on malloc sizes when debugging.
5144 (__malloc_size_t): Default to size_t, not to int.
5145 (pure_size, pure_bytes_used_before_overflow, stack_copy_size)
5146 (Fgarbage_collect, mark_object_loop_halt, mark_object):
5147 Prefer ptrdiff_t to size_t when either would do, as we prefer
5149 (XMALLOC_OVERRUN_CHECK_OVERHEAD): New macro.
5150 (xmalloc_overrun_check_header, xmalloc_overrun_check_trailer):
5151 Now const. Initialize with values that are in range even if char
5153 (XMALLOC_PUT_SIZE, XMALLOC_GET_SIZE): Remove, replacing with ...
5154 (xmalloc_put_size, xmalloc_get_size): New functions. All uses changed.
5155 These functions do the right thing with sizes > 2**32.
5156 (check_depth): Now ptrdiff_t, not int.
5157 (overrun_check_malloc, overrun_check_realloc, overrun_check_free):
5158 Adjust to new way of storing sizes. Check for size overflow bugs
5160 (STRING_BYTES_MAX): Adjust to new overheads. The old code was
5161 slightly wrong anyway, as it missed one instance of
5162 XMALLOC_OVERRUN_CHECK_OVERHEAD.
5163 (refill_memory_reserve): Omit needless cast to size_t.
5164 (mark_object_loop_halt): Mark as externally visible.
5166 * xselect.c: Integer signedness and overflow fixes.
5167 (Fx_register_dnd_atom, x_handle_dnd_message):
5168 Use ptrdiff_t, not size_t, since we prefer signed.
5169 (Fx_register_dnd_atom): Check for ptrdiff_t (and size_t) overflow.
5170 * xterm.h (struct x_display_info): Use ptrdiff_t, not size_t, for
5171 x_dnd_atoms_size and x_dnd_atoms_length.
5173 * doprnt.c: Prefer signed to unsigned when either works.
5175 * doprnt.c (doprnt):
5177 * xdisp.c (vmessage):
5178 Use ptrdiff_t, not size_t, when using or implementing doprnt,
5179 since the sizes cannot exceed ptrdiff_t bounds anyway, and we
5180 prefer signed arithmetic to avoid comparison confusion.
5181 * doprnt.c (doprnt): Avoid a "+ 1" that can't overflow,
5182 but is a bit tricky.
5184 Assume freestanding C89 headers, string.h, stdlib.h.
5185 * data.c, doprnt.c, floatfns.c, print.c:
5186 Include float.h unconditionally.
5187 * gmalloc.c: Assume C89-at-least behavior for preprocessor,
5188 limits.h, stddef.h, string.h. Use memset instead of 'flood'.
5189 * regex.c: Likewise for stddef.h, string.h.
5190 (ISASCII): Remove; can assume it returns 1 now. All uses removed.
5191 * s/aix4-2.h (HAVE_STRING_H): Remove obsolete undef.
5192 * s/ms-w32.h (HAVE_LIMITS_H, HAVE_STRING_H, HAVE_STDLIB_H)
5193 (STDC_HEADERS): Remove obsolete defines.
5194 * sysdep.c: Include limits.h unconditionally.
5196 Assume support for memcmp, memcpy, memmove, memset.
5197 * lisp.h, sysdep.c (memcmp, memcpy, memmove, memset):
5198 * regex.c (memcmp, memcpy):
5199 Remove; we assume C89 now.
5201 * gmalloc.c (memcpy, memset, memmove): Remove; we assume C89 now.
5202 (__malloc_safe_bcopy): Remove; no longer needed.
5204 * lisp.h (struct vectorlike_header, struct Lisp_Subr): Signed sizes.
5205 Use EMACS_INT, not EMACS_UINT, for sizes. The code works equally
5206 well either way, and we prefer signed to unsigned.
5208 2011-07-27 Lars Magne Ingebrigtsen <larsi@gnus.org>
5210 * gnutls.c (emacs_gnutls_read): Don't message anything if the peer
5211 closes the connection while we're reading (bug#9182).
5213 2011-07-25 Jan Djärv <jan.h.d@swipnet.se>
5215 * nsmenu.m (ns_popup_dialog): Add an "ok" button if no buttons
5216 are specified (Bug#9168).
5218 2011-07-25 Paul Eggert <eggert@cs.ucla.edu>
5220 * bidi.c (bidi_dump_cached_states): Fix printf format mismatch.
5221 Found by GCC static checking and --with-wide-int on a 32-bit host.
5223 2011-07-25 Eli Zaretskii <eliz@gnu.org>
5225 * xdisp.c (compute_display_string_pos): Fix logic of caching
5226 previous display string position. Initialize cached_prev_pos to
5227 -1. Fixes slow-down at the beginning of a buffer.
5229 2011-07-24 Eli Zaretskii <eliz@gnu.org>
5231 * xfaces.c (check_lface_attrs) [HAVE_WINDOW_SYSTEM]: Allow `nil'
5232 for attrs[LFACE_FONTSET_INDEX].
5234 2011-07-23 Paul Eggert <eggert@cs.ucla.edu>
5236 * xml.c (parse_region): Remove unused local
5237 that was recently introduced.
5239 2011-07-23 Eli Zaretskii <eliz@gnu.org>
5241 * xfns.c (unwind_create_frame) [GLYPH_DEBUG]: Adapt to changes in
5242 2008-02-22T17:42:09Z!monnier@iro.umontreal.ca.
5244 * xdisp.c (move_it_in_display_line_to): Record the best matching
5245 position for TO_CHARPOS while scanning the line, and restore it on
5246 exit if none of the characters scanned was an exact match.
5247 Fixes vertical-motion and pos-visible-in-window-p under bidi redisplay
5248 when exact match is impossible due to invisible text, and the
5249 lines are truncated.
5251 2011-07-23 Jan Djärv <jan.h.d@swipnet.se>
5253 * nsterm.m (initFrameFromEmacs): Set NSTitledWindowMask in styleMask
5256 2011-07-22 Eli Zaretskii <eliz@gnu.org>
5258 Fix a significant slow-down of cursor motion with C-n, C-p,
5259 C-f/C-b, and C-v/M-v that couldn't keep up with keyboard
5260 auto-repeat under bidi redisplay in fontified buffers.
5261 * xdisp.c (compute_stop_pos_backwards): New function.
5262 (next_element_from_buffer): Call compute_stop_pos_backwards to
5263 find a suitable prev_stop when we find ourselves before
5265 (reseat): Don't look for prev_stop, as that could mean a very long
5267 <cached_disp_pos, cached_disp_buffer, cached_disp_modiff>
5268 <cached_disp_overlay_modiff>: Cache for last found display string
5270 (compute_display_string_pos): Return the cached position if asked
5271 about the same buffer in the same area of character positions, and
5272 the buffer wasn't changed since the time the display string
5273 position was cached.
5275 2011-07-22 Eli Zaretskii <eliz@gnu.org>
5277 * xdisp.c (rows_from_pos_range): Don't ignore glyphs whose object
5278 is an integer, which is important for empty lines. (Bug#9149)
5280 2011-07-22 Chong Yidong <cyd@stupidchicken.com>
5282 * frame.c (Fmodify_frame_parameters): In tty case, update the
5283 default face if necessary (Bug#4238).
5285 2011-07-21 Chong Yidong <cyd@stupidchicken.com>
5287 * editfns.c (Fstring_to_char): No need to explain what a character
5288 is in the docstring (Bug#6576).
5290 2011-07-20 Lars Magne Ingebrigtsen <larsi@gnus.org>
5292 * xml.c (parse_region): Make sure we always return a tree.
5294 2011-07-20 HAMANO Kiyoto <khiker.mail@gmail.com>
5296 * xml.c (parse_region): If a document contains only comments,
5299 2011-07-20 Lars Magne Ingebrigtsen <larsi@gnus.org>
5301 * xml.c (make_dom): Return comments, too.
5303 2011-07-19 Paul Eggert <eggert@cs.ucla.edu>
5306 See http://lists.gnu.org/archive/html/emacs-devel/2011-07/msg00688.html
5307 and the surrounding thread.
5308 * minibuf.c (read_minibuf_noninteractive): Rewrite to use getchar
5309 rather than fgets, and retry after EINTR. Otherwise, 'emacs
5310 --batch -f byte-compile-file' fails on OpenBSD if an inactivity
5312 * s/openbsd.h (BROKEN_SIGIO): Define.
5313 * unexelf.c (unexec) [__OpenBSD__]:
5314 Don't update the .mdebug section of the Alpha COFF symbol table.
5316 2011-07-19 Lars Magne Ingebrigtsen <larsi@gnus.org>
5318 * lread.c (syms_of_lread): Clarify when `lexical-binding' is used
5321 2011-07-18 Paul Eggert <eggert@cs.ucla.edu>
5323 * fileio.c (Fcopy_file) [!MSDOS]: Tighten created file's mask.
5324 This fixes some race conditions on the permissions of any newly
5327 * alloc.c (valid_pointer_p): Use pipe, not open.
5328 This fixes some permissions issues when debugging.
5330 * fileio.c (Fcopy_file): Adjust mode if fchown fails. (Bug#9002)
5331 If fchown fails to set both uid and gid, try to set just gid,
5332 as that is sometimes allowed. Adjust the file's mode to eliminate
5333 setuid or setgid bits that are inappropriate if fchown fails.
5335 2011-07-18 Stefan Monnier <monnier@iro.umontreal.ca>
5337 * xdisp.c (next_element_from_string, next_element_from_buffer): Use EQ
5338 to compare Lisp_Objects.
5339 * gnutls.c (syms_of_gnutls): Rename Vgnutls_log_level to
5340 global_gnutls_log_level, don't mistake it for a Lisp_Object.
5341 (init_gnutls_functions, emacs_gnutls_handle_error): Fix up uses.
5343 2011-07-17 Andreas Schwab <schwab@linux-m68k.org>
5345 * lread.c (read_integer): Unread even EOF character.
5346 (read1): Likewise. Properly record start position of symbol.
5348 * lread.c (read1): Read `#:' as empty uninterned symbol if no
5349 symbol character follows.
5351 2011-07-17 Paul Eggert <eggert@cs.ucla.edu>
5353 * fileio.c (Fcopy_file): Pacify gcc re fchown. (Bug#9002)
5354 This works around a problem with the previous change to Fcopy_file.
5355 Recent glibc declares fchown with __attribute__((warn_unused_result)),
5356 and without this change, GCC might complain about discarding
5357 fchown's return value.
5359 2011-07-16 Juanma Barranquero <lekktu@gmail.com>
5361 * makefile.w32-in (GLOBAL_SOURCES): Add gnutls.c (followup to bug#9059).
5363 2011-07-16 Paul Eggert <eggert@cs.ucla.edu>
5365 * fileio.c (Fcopy_file): Don't diagnose fchown failures. (Bug#9002)
5367 2011-07-16 Lars Magne Ingebrigtsen <larsi@gnus.org>
5369 * gnutls.c (syms_of_gnutls): Define `gnutls-log-level' here, since
5370 it's used from the C level.
5372 * process.c: Use the same condition for POLL_FOR_INPUT in both
5373 keyboard.c and process.c (bug#1858).
5375 2011-07-09 Lawrence Mitchell <wence@gmx.li>
5377 * gnutls.c (Qgnutls_bootprop_min_prime_bits): New variable.
5378 (Fgnutls_boot): Use it.
5380 2011-07-15 Andreas Schwab <schwab@linux-m68k.org>
5382 * doc.c (Fsubstitute_command_keys): Revert last change.
5384 2011-07-15 Lars Magne Ingebrigtsen <larsi@gnus.org>
5386 * doc.c (Fsubstitute_command_keys): Clarify that \= really only
5387 quotes the next character, and doesn't affect other longer
5388 sequences (bug#8935).
5390 * lread.c (syms_of_lread): Clarify that is isn't only
5391 `eval-buffer' and `eval-defun' that's affected by
5392 `lexical-binding' (bug#8460).
5394 2011-07-15 Eli Zaretskii <eliz@gnu.org>
5396 * xdisp.c (move_it_in_display_line_to): Fix vertical motion with
5397 bidi redisplay when a line includes both an image and is truncated.
5399 2011-07-14 Paul Eggert <eggert@cs.ucla.edu>
5401 Fix minor problems found by static checking.
5402 * bidi.c (bidi_cache_size): Now EMACS_INT, not size_t.
5403 (elsz): Now a signed constant, not a size_t var. We prefer signed
5404 types to unsigned, to avoid integer comparison confusion. Without
5405 this change, GCC 4.6.1 with -Wunsafe-loop-optimizations complains
5406 "cannot optimize loop, the loop counter may overflow", a symptom
5408 * indent.c (Fvertical_motion): Mark locals as initialized.
5409 * xdisp.c (reseat_to_string): Fix pointer signedness issue.
5411 2011-07-14 Lars Magne Ingebrigtsen <larsi@gnus.org>
5413 * search.c (Fre_search_backward): Mention `case-fold-search' in
5414 all the re_search_* functions (bug#8138).
5416 * keyboard.c (Fopen_dribble_file): Document when the file is
5419 2011-07-14 Eli Zaretskii <eliz@gnu.org>
5421 * bidi.c (bidi_dump_cached_states): Fix format of displaying
5424 Support bidi reordering of display and overlay strings.
5425 * xdisp.c (compute_display_string_pos)
5426 (compute_display_string_end): Accept additional argument STRING.
5427 (init_iterator, reseat_1): Initialize bidi_it->string.s to NULL.
5428 (reseat_to_string): Initialize bidi_it->string.s and
5429 bidi_it->string.schars.
5430 (Fcurrent_bidi_paragraph_direction): Initialize itb.string.s to
5431 NULL (avoids a crash in bidi_paragraph_init).
5432 Initialize itb.string.lstring.
5433 (init_iterator): Call bidi_init_it only of a valid
5434 buffer position was specified. Initialize paragraph_embedding to
5436 (reseat_to_string): Initialize the bidi iterator.
5437 (display_string): If we need to ignore text properties of
5438 LISP_STRING, set IT->stop_charpos to IT->end_charpos. (The
5439 original value of -1 will not work with bidi.)
5440 (compute_display_string_pos): First arg is now struct
5441 `text_pos *'; all callers changed. Support display properties on
5443 (compute_display_string_end): Support display properties on Lisp
5445 (init_iterator, reseat_1, reseat_to_string): Initialize the
5446 string.bufpos member to 0 (zero, for compatibility with IT_CHARPOS
5447 when iterating on a string not from display properties).
5448 (compute_display_string_pos, compute_display_string_end):
5449 Fix calculation of the object to scan. Fixes an error when using
5451 (next_element_from_buffer): Don't abort when IT_CHARPOS is before
5452 base_level_stop; instead, set base_level_stop to BEGV.
5453 Fixes crashes in vertical-motion.
5454 (next_element_from_buffer): Improve commentary for when
5455 the iterator is before prev_stop.
5456 (init_iterator): Initialize bidi_p from the default value of
5457 bidi-display-reordering, not from buffer-local value. Use the
5458 buffer-local value only if initializing for buffer iteration.
5459 (handle_invisible_prop): Support invisible properties on strings
5460 that are being bidi-reordered.
5461 (set_iterator_to_next): Support bidi reordering of C strings and
5463 (next_element_from_string): Support bidi reordering of Lisp
5465 (handle_stop_backwards): Support Lisp strings as well.
5466 (display_string): Support display of R2L glyph rows.
5467 Use IT_STRING_CHARPOS when displaying from a Lisp string.
5468 (init_iterator): Don't initialize it->bidi_p for strings
5470 (reseat_to_string): Initialize it->bidi_p for strings here.
5471 (next_element_from_string, next_element_from_c_string)
5472 (next_element_from_buffer): Add xassert's for correspondence
5473 between IT's object being iterated and it->bidi_it.string
5475 (face_before_or_after_it_pos): Support bidi iteration.
5476 (next_element_from_c_string): Handle the case of the first string
5477 character that is not the first one in the visual order.
5478 (get_visually_first_element): New function, refactored from common
5479 parts of next_element_from_buffer, next_element_from_string, and
5480 next_element_from_c_string.
5481 (tool_bar_lines_needed, redisplay_tool_bar)
5482 (display_menu_bar): Force left-to-right direction. Add a FIXME
5483 comment for making that be controlled by a user option.
5484 (push_it, pop_it): Save and restore the state of the
5485 bidi iterator. Save and restore the bidi_p flag.
5486 (pop_it): Iterate out of display property for string iteration as
5488 (iterate_out_of_display_property): Support iteration over strings.
5489 (handle_single_display_spec): Set up it->bidi_it for iteration
5490 over a display string, and call bidi_init_it.
5491 (handle_single_display_spec, next_overlay_string)
5492 (get_overlay_strings_1, push_display_prop): Set up the bidi
5493 iterator for displaying display or overlay strings.
5494 (forward_to_next_line_start): Don't use the shortcut if
5496 (back_to_previous_visible_line_start): If handle_display_prop
5497 pushed the iterator stack, restore the internal state of the bidi
5498 iterator by calling bidi_pop_it same number of times.
5499 (reseat_at_next_visible_line_start): If ON_NEWLINE_P is non-zero,
5500 and we are bidi-iterating, don't decrement the iterator position;
5501 instead, set the first_elt flag in the bidi iterator, to produce
5503 (reseat_1): Remove redundant setting of string_from_display_prop_p.
5504 (push_display_prop): xassert that we are iterating a buffer.
5505 (push_it, pop_it): Save and restore paragraph_embedding member.
5506 (handle_single_display_spec, next_overlay_string)
5507 (get_overlay_strings_1, reseat_1, reseat_to_string)
5508 (push_display_prop): Set up the `unibyte' member of bidi_it.string
5509 correctly. Don't assume unibyte strings are not bidi-reordered.
5510 (compute_display_string_pos)
5511 (compute_display_string_end): Fix handling the case of C string.
5512 (push_it, pop_it): Save and restore from_disp_prop_p.
5513 (handle_single_display_spec, push_display_prop): Set the
5514 from_disp_prop_p flag.
5515 (get_overlay_strings_1): Reset the from_disp_prop_p flag.
5516 (pop_it): Call iterate_out_of_display_property only if we are
5517 popping after iteration over a string that came from a display
5518 property. Fix a typo in popping stretch info. Add an assertion
5519 for verifying that the iterator position is in sync with the bidi
5521 (handle_single_display_spec, get_overlay_strings_1)
5522 (push_display_prop): Fix initialization of paragraph direction for
5523 string when that of the parent object is not yet determined.
5524 (reseat_1): Call bidi_init_it to resync the bidi
5525 iterator with IT's position. (Bug#7616)
5526 (find_row_edges): If ROW->start.pos gives position
5527 smaller than min_pos, use it as ROW->minpos. (Bug#7616)
5528 (handle_stop, back_to_previous_visible_line_start, reseat_1):
5529 Reset the from_disp_prop_p flag.
5530 (SAVE_IT, RESTORE_IT): New macros.
5531 (pos_visible_p, face_before_or_after_it_pos)
5532 (back_to_previous_visible_line_start)
5533 (move_it_in_display_line_to, move_it_in_display_line)
5534 (move_it_to, move_it_vertically_backward, move_it_by_lines)
5535 (try_scrolling, redisplay_window, display_line): Use them when
5536 saving a temporary copy of the iterator and restoring it back.
5537 (back_to_previous_visible_line_start, reseat_1)
5538 (init_iterator): Empty the bidi cache "stack".
5539 (move_it_in_display_line_to): If iterator ended up at
5540 EOL, but we never saw any buffer positions smaller than
5541 to_charpos, return MOVE_POS_MATCH_OR_ZV. Fixes vertical cursor
5542 motion in bidi-reordered lines.
5543 (move_it_in_display_line_to): Record prev_method and prev_pos
5544 immediately before the call to set_iterator_to_next. Fixes cursor
5545 motion in bidi-reordered lines with stretch glyphs and strings
5546 displayed in margins. (Bug#8133) (Bug#8867)
5547 Return MOVE_POS_MATCH_OR_ZV only if iterator position is past
5549 (pos_visible_p): Support positions in bidi-reordered lines.
5550 Save and restore bidi cache.
5552 * bidi.c (bidi_level_of_next_char): clen should be EMACS_NT, not int.
5553 (bidi_paragraph_info): Delete unused struct.
5554 (bidi_cache_idx, bidi_cache_last_idx): Declare EMACS_INT.
5555 (bidi_cache_start): New variable.
5556 (bidi_cache_reset): Reset bidi_cache_idx to bidi_cache_start, not
5558 (bidi_cache_fetch_state, bidi_cache_search)
5559 (bidi_cache_find_level_change, bidi_cache_iterator_state)
5560 (bidi_cache_find, bidi_peek_at_next_level)
5561 (bidi_level_of_next_char, bidi_find_other_level_edge)
5562 (bidi_move_to_visually_next): Compare cache index with
5563 bidi_cache_start rather than with zero.
5564 (bidi_fetch_char): Accept new argument STRING; all callers
5565 changed. Support iteration over a string. Support strings with
5566 display properties. Support unibyte strings. Fix the type of
5567 `len' according to what STRING_CHAR_AND_LENGTH expects.
5568 (bidi_paragraph_init, bidi_resolve_explicit_1)
5569 (bidi_resolve_explicit, bidi_resolve_weak)
5570 (bidi_level_of_next_char, bidi_move_to_visually_next):
5571 Support iteration over a string.
5572 (bidi_set_sor_type, bidi_resolve_explicit_1)
5573 (bidi_resolve_explicit, bidi_type_of_next_char): ignore_bn_limit
5574 can now be zero (for strings); special values 0 and -1 were
5575 changed to -1 and -2, respectively.
5576 (bidi_char_at_pos): New function.
5577 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak):
5578 Call it instead of FETCH_MULTIBYTE_CHAR.
5579 (bidi_move_to_visually_next): Abort if charpos or bytepos were not
5580 initialized to valid values.
5581 (bidi_init_it): Don't initialize charpos and bytepos with invalid
5583 (bidi_level_of_next_char): Allow the sentinel "position" to pass
5584 the test for valid cached positions. Fix the logic for looking up
5585 the sentinel state in the cache. GCPRO the Lisp string we are
5587 (bidi_push_it, bidi_pop_it): New functions.
5588 (bidi_initialize): Initialize the bidi cache start stack pointer.
5589 (bidi_cache_ensure_space): New function, refactored from part of
5590 bidi_cache_iterator_state. Don't assume the required size is just
5591 one BIDI_CACHE_CHUNK away.
5592 (bidi_cache_start_stack, bidi_push_it): Use IT_STACK_SIZE.
5593 (bidi_count_bytes, bidi_char_at_pos): New functions.
5594 (bidi_cache_search): Don't assume bidi_cache_last_idx is
5595 always valid if bidi_cache_idx is valid.
5596 (bidi_cache_find_level_change): xassert that bidi_cache_last_idx
5597 is valid if it's going to be used.
5598 (bidi_shelve_cache, bidi_unshelve_cache): New functions.
5599 (bidi_cache_fetch_state, bidi_cache_search)
5600 (bidi_cache_find_level_change, bidi_cache_ensure_space)
5601 (bidi_cache_iterator_state, bidi_cache_find)
5602 (bidi_find_other_level_edge, bidi_cache_start_stack):
5603 All variables related to cache indices are now EMACS_INT.
5605 * dispextern.h (struct bidi_string_data): New structure.
5606 (struct bidi_it): New member `string'. Make flag members be 1-bit
5607 fields, and put them last in the struct.
5608 (compute_display_string_pos, compute_display_string_end):
5610 (bidi_push_it, bidi_pop_it): Add prototypes.
5611 (struct iterator_stack_entry): New members bidi_p,
5612 paragraph_embedding, and from_disp_prop_p.
5613 (struct it): Member bidi_p is now a bit field 1 bit wide.
5614 (bidi_shelve_cache, bidi_unshelve_cache):
5617 * .gdbinit (xvectype, xvector, xcompiled, xchartable, xboolvector)
5618 (xpr, xfont, xbacktrace): Use "header.size" when accessing vectors
5619 and vector-like objects.
5621 * dispnew.c (buffer_posn_from_coords): Save and restore the bidi
5622 cache around display iteration.
5624 * window.c (Fwindow_end, window_scroll_pixel_based)
5625 (displayed_window_lines, Frecenter): Save and restore the bidi
5626 cache around display iteration.
5628 2011-07-14 Lars Magne Ingebrigtsen <larsi@gnus.org>
5630 * editfns.c (Fdelete_region): Clarify the use of the named
5631 parameters (bug#6788).
5633 2011-07-14 Martin Rudalics <rudalics@gmx.at>
5635 * indent.c (Fvertical_motion): Set and restore w->pointm when
5636 saving and restoring the window's buffer (Bug#9006).
5638 2011-07-13 Lars Magne Ingebrigtsen <larsi@gnus.org>
5640 * editfns.c (Fstring_to_char): Clarify just what is returned
5641 (bug#6576). Text by Eli Zaretskii.
5643 2011-07-13 Juanma Barranquero <lekktu@gmail.com>
5645 * gnutls.c (init_gnutls_functions): Honor gnutls_log_level (bug#9059).
5647 2011-07-13 Eli Zaretskii <eliz@gnu.org>
5649 * buffer.c (mmap_find): Fix a typo.
5651 2011-07-13 Johan Bockgård <bojohan@gnu.org>
5653 Fix execution of x selection hooks.
5654 * xselect.c (Qx_lost_selection_functions)
5655 (Qx_sent_selection_functions): New vars.
5656 (syms_of_xselect): DEFSYM them.
5657 (x_handle_selection_request): Pass Qx_sent_selection_functions
5658 rather than Vx_sent_selection_functions to Frun_hook_with_args.
5659 (x_handle_selection_clear,x_clear_frame_selections):
5660 Pass Qx_lost_selection_functions rather than
5661 Vx_lost_selection_functions to Frun_hook_with_args.
5663 2011-07-13 Paul Eggert <eggert@cs.ucla.edu>
5665 * buffer.c (Fget_buffer_create): Initialize inhibit_shrinking.
5666 The old code sometimes used this field without initializing it.
5668 * alloc.c (gc_sweep): Don't read past end of array.
5669 In theory, the old code could also have corrupted Emacs internals,
5670 though it'd be very unlikely.
5672 2011-07-12 Andreas Schwab <schwab@linux-m68k.org>
5674 * character.c (Fcharacterp): Don't advertise optional ignored
5675 argument. (Bug#4026)
5677 2011-07-12 Lars Magne Ingebrigtsen <larsi@gnus.org>
5679 * keymap.c (syms_of_keymap): Clarify that "modifier" is "modifier
5682 * window.c (Fset_window_start): Doc fix (bug#4199).
5683 (Fset_window_hscroll): Ditto.
5685 2011-07-12 Paul Eggert <eggert@cs.ucla.edu>
5687 Fix minor new problems caught by GCC 4.6.1.
5688 * term.c (init_tty): Remove unused local.
5689 * xsettings.c (store_monospaced_changed): Define this function only
5690 if (defined HAVE_GSETTINGS || defined HAVE_GCONF), as it's
5693 2011-07-12 Chong Yidong <cyd@stupidchicken.com>
5695 * xdisp.c (Vresize_mini_windows): Minor doc fix (Bug#3300).
5697 2011-07-11 Lars Magne Ingebrigtsen <larsi@gnus.org>
5699 * xdisp.c (syms_of_xdisp): Make it explicit that the mini-windows
5700 are the mini-buffer and the echo area (bug#3320).
5702 * term.c (init_tty): Remove support for supdup, c10 and perq
5703 terminals, which are no longer supported (bug#1482).
5705 2011-07-10 Johan Bockgård <bojohan@gnu.org>
5707 * xdisp.c (Ftool_bar_lines_needed): Fix WINDOWP check.
5709 2011-07-10 Jan Djärv <jan.h.d@swipnet.se>
5711 * xmenu.c (menu_highlight_callback): Only pass frame to show_help_event
5712 for non-popups (Bug#3642).
5714 2011-07-10 Andreas Schwab <schwab@linux-m68k.org>
5716 * alloc.c (reset_malloc_hooks): Protoize.
5717 * buffer.c (mmap_init, mmap_find, mmap_free_1, mmap_enlarge)
5718 (mmap_set_vars, mmap_alloc, mmap_free, mmap_realloc): Likewise.
5719 * cm.c (losecursor): Likewise.
5720 * data.c (fmod): Likewise.
5721 * dispnew.c (swap_glyphs_in_rows): Likewise.
5722 * emacs.c (memory_warning_signal): Likewise.
5723 * floatfns.c (float_error): Likewise.
5724 * font.c (check_gstring, check_otf_features, otf_tag_symbol)
5725 (otf_open, font_otf_capability, generate_otf_features)
5726 (font_otf_DeviceTable, font_otf_ValueRecord, font_otf_Anchor):
5728 * image.c (pbm_read_file): Likewise.
5729 * indent.c (string_display_width): Likewise.
5730 * intervals.c (check_for_interval, search_for_interval)
5731 (inc_interval_count, count_intervals, root_interval)
5732 (adjust_intervals_for_insertion, make_new_interval): Likewise.
5733 * lread.c (defalias): Likewise.
5734 * ralloc.c (r_alloc_check): Likewise.
5735 * regex.c (set_image_of_range_1, set_image_of_range)
5736 (regex_grow_registers): Likewise.
5737 * sysdep.c (strerror): Likewise.
5738 * termcap.c (valid_filename_p, tprint, main): Likewise.
5739 * tparam.c (main): Likewise.
5740 * unexhp9k800.c (run_time_remap, save_data_space)
5741 (update_file_ptrs, read_header, write_header, calculate_checksum)
5742 (copy_file, copy_rest, display_header): Likewise.
5743 * widget.c (mark_shell_size_user_specified, create_frame_gcs):
5745 * xdisp.c (check_it): Likewise.
5746 * xfaces.c (register_color, unregister_color, unregister_colors):
5748 * xfns.c (print_fontset_result): Likewise.
5749 * xrdb.c (member, fatal, main): Likewise.
5751 2011-07-10 Paul Eggert <eggert@cs.ucla.edu>
5753 Fix minor problems found by static checking (Bug#9031).
5754 * chartab.c (char_table_set_range, map_sub_char_table):
5755 Remove unused locals.
5756 (uniprop_table): Now static.
5757 * composite.c (_work_char): Remove unused static var.
5759 2011-07-09 Juanma Barranquero <lekktu@gmail.com>
5761 * chartab.c (uniprop_table_uncompress): Remove unused local variable.
5763 2011-07-09 Jan Djärv <jan.h.d@swipnet.se>
5765 * gtkutil.c (qttip_cb): Remove code without function.
5767 2011-07-09 Eli Zaretskii <eliz@gnu.org>
5769 * w32.c (pthread_sigmask): New stub.
5771 2011-07-08 Paul Eggert <eggert@cs.ucla.edu>
5773 Use pthread_sigmask, not sigprocmask (Bug#9010).
5774 sigprocmask is portable only for single-threaded applications, and
5775 Emacs can be multi-threaded when it uses GTK.
5776 * Makefile.in (LIB_PTHREAD_SIGMASK): New macro.
5778 * callproc.c (Fcall_process):
5779 * process.c (create_process):
5780 * sysdep.c (sys_sigblock, sys_sigunblock, sys_sigsetmask):
5781 Use pthread_sigmask, not sigprocmask.
5783 2011-07-08 Jan Djärv <jan.h.d@swipnet.se>
5785 * gtkutil.c (qttip_cb): Set line wrap to FALSE for tooltip widget.
5786 (xg_prepare_tooltip): Revert text in x->ttip_lbl, margins was
5789 2011-07-08 Jan Djärv <jan.h.d@swipnet.se>
5791 * gtkutil.c (xg_prepare_tooltip): Fix indentation and comment.
5792 Put text in x->ttip_lbl instead of gtk_tooltip_set_text (Bug#8591).
5793 (xg_hide_tooltip): Fix comment.
5795 * nsterm.m (initFrameFromEmacs): Don't use ns_return_types
5796 in registerServicesMenuSendTypes.
5797 (validRequestorForSendType): Don't check ns_return_types.
5799 * nsfns.m (Fx_open_connection): Put NSStringPboardType into
5802 2011-07-08 Jason Rumney <jasonr@gnu.org>
5804 * w32term.c (x_make_frame_visible): Use SH_SHOWNORMAL rather than
5805 SH_SHOW for hidden windows (Bug#5482).
5807 * w32fns.c (w32_wnd_proc) [WM_TIMER, WM_SET_CURSOR]: Avoid using
5808 frame struct members of non-existent frames (Bug#6284).
5810 2011-07-08 Jan Djärv <jan.h.d@swipnet.se>
5812 * nsterm.m (keyDown): Call to wantsToDelayTextChangeNotifications and
5813 variable firstTime not needed on OSX >= 10.6.
5814 (setPosition): setFloatValue:knobProportion: is deprecated on OSX
5815 >= 10.5. Use setKnobProportion, setDoubleValue.
5817 * nsterm.h (MAC_OS_X_VERSION_10_3, MAC_OS_X_VERSION_10_4)
5818 (MAC_OS_X_VERSION_10_5): Define if not defined.
5819 (EmacsView, EmacsTooltip): Implements NSWindowDelegate on OSX >= 10.6.
5820 (EmacsMenu): Implements NSMenuDelegate on OSX >= 10.6.
5821 (EmacsToolbar): Implements NSToolbarDelegate on OSX >= 10.6.
5823 * nsselect.m (ns_string_from_pasteboard): Don't use deprecated methods
5824 cString and lossyCString on OSX >= 10.4
5826 * nsmenu.m (fillWithWidgetValue): Don't use deprecated method
5827 sizeToFit on OSX >= 10.2.
5829 * nsimage.m (allocInitFromFile): Don't use deprecated method
5830 bestRepresentationForDevice on OSX >= 10.6.
5832 * nsfns.m (check_ns_display_info): Cast to long and use %ld in error
5835 * emacs.c: Declare unexec_init_emacs_zone.
5837 * nsgui.h: Fix compiler warning about gnulib redefining verify.
5839 * nsselect.m (ns_get_local_selection): Change to extern (Bug#8842).
5841 * nsmenu.m (ns_update_menubar): Remove useless setDelegate call
5842 on svcsMenu (Bug#8842).
5844 * nsfns.m (Fx_open_connection): Remove NSStringPboardType from
5846 (Fns_list_services): Just return Qnil on 10.6, code not working there.
5848 * nsterm.m (QUTF8_STRING): Declare.
5849 (initFrameFromEmacs): Call registerServicesMenuSendTypes.
5850 (validRequestorForSendType): Return type is (id).
5851 Change indexOfObjectIdenticalTo to indexOfObject.
5852 Check if we have local selection before returning self (Bug#8842).
5853 (writeSelectionToPasteboard): Put local selection into paste board
5854 if we have a local selection (Bug#8842).
5855 (syms_of_nsterm): DEFSYM QUTF8_STRING.
5857 * nsterm.h (MAC_OS_X_VERSION_10_6): Define here instead of nsterm.m.
5858 (ns_get_local_selection): Declare.
5860 2011-07-07 Lars Magne Ingebrigtsen <larsi@gnus.org>
5862 * keymap.c (describe_map_tree): Don't insert a double newline at
5863 the end of the buffer (bug#1169) and return whether we inserted
5866 * callint.c (Fcall_interactively): Change "reading args" to
5867 "providing args" to try to clarify what it does (bug#1010).
5869 2011-07-07 Kenichi Handa <handa@m17n.org>
5871 * composite.c (composition_compute_stop_pos): Ignore a static
5872 composition starting before CHARPOS (Bug#8915).
5874 * xdisp.c (handle_composition_prop): Likewise.
5876 2011-07-07 Eli Zaretskii <eliz@gnu.org>
5878 * term.c (produce_glyphs) <xassert>: Allow IT_GLYPHLESS in it->what.
5881 2011-07-07 Kenichi Handa <handa@m17n.org>
5883 * character.h (unicode_category_t): New enum type.
5885 * chartab.c (uniprop_decoder_t, uniprop_encoder_t): New types.
5886 (Qchar_code_property_table): New variable.
5887 (UNIPROP_TABLE_P, UNIPROP_GET_DECODER)
5888 (UNIPROP_COMPRESSED_FORM_P): New macros.
5889 (char_table_ascii): Uncompress the compressed values.
5890 (sub_char_table_ref): New arg is_uniprop. Callers changed.
5891 Uncompress the compressed values.
5892 (sub_char_table_ref_and_range): Likewise.
5893 (char_table_ref_and_range): Uncompress the compressed values.
5894 (sub_char_table_set): New arg is_uniprop. Callers changed.
5895 Uncompress the compressed values.
5896 (sub_char_table_set_range): Args changed. Callers changed.
5897 (char_table_set_range): Adjuted for the above change.
5898 (map_sub_char_table): Delete args default_val and parent. Add arg
5899 top. Give decoded values to a Lisp function.
5900 (map_char_table): Adjust for the above change. Give decoded
5901 values to a Lisp function. Gcpro more variables.
5902 (uniprop_table_uncompress)
5903 (uniprop_decode_value_run_length): New functions.
5904 (uniprop_decoder, uniprop_decoder_count): New variables.
5905 (uniprop_get_decoder, uniprop_encode_value_character)
5906 (uniprop_encode_value_run_length, uniprop_encode_value_numeric):
5908 (uniprop_encoder, uniprop_encoder_count): New variables.
5909 (uniprop_get_encoder, uniprop_table)
5910 (Funicode_property_table_internal, Fget_unicode_property_internal)
5911 (Fput_unicode_property_internal): New functions.
5912 (syms_of_chartab): DEFSYM Qchar_code_property_table, defsubr
5913 Sunicode_property_table_internal, Sget_unicode_property_internal,
5914 and Sput_unicode_property_internal. Defvar_lisp
5915 char-code-property-alist.
5917 * composite.c (CHAR_COMPOSABLE_P): Adjust for the change of
5918 Vunicode_category_table.
5920 * font.c (font_range): Adjust for the change of
5921 Vunicode_category_table.
5923 2011-07-07 Dan Nicolaescu <dann@ics.uci.edu>
5925 * m/iris4d.h: Remove file, move contents ...
5926 * s/irix6-5.h: ... here.
5928 2011-07-06 Paul Eggert <eggert@cs.ucla.edu>
5930 Remove unportable assumption about struct layout (Bug#8884).
5931 * alloc.c (mark_buffer):
5932 * buffer.c (reset_buffer_local_variables, Fbuffer_local_variables)
5933 (clone_per_buffer_values): Don't assume that
5934 sizeof (struct buffer) is a multiple of sizeof (Lisp_Object).
5935 This isn't true in general, and it's particularly not true
5936 if Emacs is configured with --with-wide-int.
5937 * buffer.h (FIRST_FIELD_PER_BUFFER, LAST_FIELD_PER_BUFFER):
5938 New macros, used in the buffer.c change.
5940 2011-07-05 Jan Djärv <jan.h.d@swipnet.se>
5942 * xsettings.c: Use both GConf and GSettings if both are available.
5943 (store_config_changed_event): Add comment.
5944 (dpyinfo_valid, store_font_name_changed, map_tool_bar_style)
5945 (store_tool_bar_style_changed): New functions.
5946 (store_monospaced_changed): Add comment. Call dpyinfo_valid.
5947 (struct xsettings): Move font inside HAVE_XFT.
5948 (GSETTINGS_TOOL_BAR_STYLE, GSETTINGS_FONT_NAME): New defines.
5949 (GSETTINGS_MONO_FONT): Rename from SYSTEM_MONO_FONT.
5950 Move inside HAVE_XFT.
5951 (something_changed_gsettingsCB): Rename from something_changedCB.
5952 Check for changes in GSETTINGS_TOOL_BAR_STYLE and GSETTINGS_FONT_NAME
5954 (GCONF_TOOL_BAR_STYLE, GCONF_FONT_NAME): New defines.
5955 (GCONF_MONO_FONT): Rename from SYSTEM_MONO_FONT. Move inside HAVE_XFT.
5956 (something_changed_gconfCB): Rename from something_changedCB.
5957 Check for changes in GCONF_TOOL_BAR_STYLE and GCONF_FONT_NAME also.
5958 (parse_settings): Move check for font inside HAVE_XFT.
5959 (read_settings, apply_xft_settings): Add comment.
5960 (read_and_apply_settings): Add comment. Call map_tool_bar_style and
5961 store_tool_bar_style_changed. Move check for font inside HAVE_XFT and
5962 call store_font_name_changed.
5963 (xft_settings_event): Add comment.
5964 (init_gsettings): Add comment. Get values for GSETTINGS_TOOL_BAR_STYLE
5965 and GSETTINGS_FONT_NAME. Move check for fonts within HAVE_XFT.
5966 (init_gconf): Add comment. Get values for GCONF_TOOL_BAR_STYLE
5967 and GCONF_FONT_NAME. Move check for fonts within HAVE_XFT.
5968 (xsettings_initialize): Call init_gsettings last.
5969 (xsettings_get_system_font, xsettings_get_system_normal_font):
5972 2011-07-05 Paul Eggert <eggert@cs.ucla.edu>
5974 Random fixes. E.g., (random) never returned negative values.
5975 * fns.c (Frandom): Use GET_EMACS_TIME for random seed, and add the
5976 subseconds part to the entropy, as that's a bit more random.
5977 Prefer signed to unsigned, since the signedness doesn't matter and
5978 in general we prefer signed. When given a limit, use a
5979 denominator equal to INTMASK + 1, not to VALMASK + 1, because the
5980 latter isn't right if USE_2_TAGS_FOR_INTS.
5981 * sysdep.c (get_random): Return a value in the range 0..INTMASK,
5982 not 0..VALMASK. Don't discard "excess" bits that random () returns.
5984 2011-07-04 Stefan Monnier <monnier@iro.umontreal.ca>
5986 * textprop.c (text_property_stickiness):
5987 Obey Vtext_property_default_nonsticky.
5988 (syms_of_textprop): Add `display' to Vtext_property_default_nonsticky.
5989 * w32fns.c (syms_of_w32fns):
5990 * xfns.c (syms_of_xfns): Don't Add `display' since it's there by default.
5992 2011-07-04 Paul Eggert <eggert@cs.ucla.edu>
5994 * fileio.c (barf_or_query_if_file_exists): Use S_ISDIR.
5995 This is more efficient than Ffile_directory_p and avoids a minor race.
5997 2011-07-04 Lars Magne Ingebrigtsen <larsi@gnus.org>
5999 * buffer.c (Foverlay_put): Say what the return value is
6002 * fileio.c (barf_or_query_if_file_exists): Check first if the file
6003 is a directory before asking whether to use the file name
6005 (barf_or_query_if_file_exists): Make the "File is a directory"
6006 error be more correct.
6008 * fns.c (Frequire): Remove the mention of the .gz files, since
6009 that's installation-specific, but keep the mention of
6010 `get-load-suffixes'.
6012 2011-07-04 Paul Eggert <eggert@cs.ucla.edu>
6014 * editfns.c (Fformat_time_string): Don't assume strlen fits in int.
6015 Report string overflow if the output is too long.
6017 2011-07-04 Juanma Barranquero <lekktu@gmail.com>
6019 * gnutls.c (Fgnutls_boot): Don't mention :verify-error.
6020 (syms_of_gnutls): Remove duplicate DEFSYM for
6021 Qgnutls_bootprop_verify_hostname_error, an error for
6022 Qgnutls_bootprop_verify_error (which is no longer used).
6024 * eval.c (find_handler_clause): Remove parameters `sig' and `data',
6025 unused since 2011-01-26T20:02:07Z!monnier@iro.umontreal.ca. All callers changed.
6026 Also (re)move comments that are misplaced or no longer relevant.
6028 2011-07-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
6030 * callint.c (Finteractive): Clarify the meaning of "@" (bug#8813).
6032 2011-07-03 Chong Yidong <cyd@stupidchicken.com>
6034 * xfaces.c (Finternal_merge_in_global_face): Modify the foreground
6035 and background color parameters if they have been changed.
6037 2011-07-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
6039 * editfns.c (Fformat): Clarify the - and 0 flags (bug#6659).
6041 2011-07-03 Paul Eggert <eggert@cs.ucla.edu>
6043 * xsettings.c (SYSTEM_FONT): Define only when used.
6044 No need to define when HAVE_GSETTINGS || !HAVE_XFT.
6046 * keymap.c (access_keymap_1): Now static.
6048 2011-07-02 Chong Yidong <cyd@stupidchicken.com>
6050 * keyboard.c (command_loop_1): If a down-mouse event is unbound,
6051 leave any prefix arg for the up event (Bug#1586).
6053 2011-07-02 Lars Magne Ingebrigtsen <larsi@gnus.org>
6055 * lread.c (syms_of_lread): Mention single symbols defined by
6056 `defvar' or `defconst' (bug#7154).
6058 * fns.c (Frequire): Mention .el.gz files (bug#7314).
6059 (Frequire): Mention get-load-suffixes.
6061 2011-07-02 Martin Rudalics <rudalics@gmx.at>
6063 * window.h (window): Remove clone_number slot.
6064 * window.c (Fwindow_clone_number, Fset_window_clone_number):
6066 (make_parent_window, make_window, saved_window)
6067 (Fset_window_configuration, save_window_save): Don't deal with
6069 * buffer.c (Qclone_number): Remove declaration.
6070 (sort_overlays, overlay_strings): Don't deal with clone numbers.
6072 2011-07-02 Stefan Monnier <monnier@iro.umontreal.ca>
6074 Add multiple inheritance to keymaps.
6075 * keymap.c (Fmake_composed_keymap): New function.
6076 (Fset_keymap_parent): Simplify.
6077 (fix_submap_inheritance): Remove.
6078 (access_keymap_1): New function extracted from access_keymap to handle
6079 embedded parents and handle lists of maps.
6080 (access_keymap): Use it.
6081 (Fkeymap_prompt, map_keymap_internal, map_keymap, store_in_keymap)
6082 (Fcopy_keymap): Handle embedded parents.
6083 (Fcommand_remapping, define_as_prefix): Simplify.
6084 (Fkey_binding): Simplify.
6085 (syms_of_keymap): Move minibuffer-local-completion-map,
6086 minibuffer-local-filename-completion-map,
6087 minibuffer-local-must-match-map, and
6088 minibuffer-local-filename-must-match-map to Elisp.
6089 (syms_of_keymap): Defsubr make-composed-keymap.
6090 * keyboard.c (menu_bar_items): Use map_keymap_canonical.
6091 (parse_menu_item): Trivial simplification.
6093 2011-07-01 Glenn Morris <rgm@gnu.org>
6095 * Makefile.in (SETTINGS_LIBS): Fix typo.
6097 2011-07-01 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny patch)
6099 * coding.c (Fencode_coding_string): Record the last coding system
6100 used, as the function doc string says (bug#8738).
6102 2011-07-01 Jan Djärv <jan.h.d@swipnet.se>
6104 * xsettings.c (store_monospaced_changed): Take new font as arg and
6105 check for change against current_mono_font.
6106 (EMACS_TYPE_SETTINGS): Remove this and related defines.
6107 (emacs_settings_constructor, emacs_settings_get_property)
6108 (emacs_settings_set_property, emacs_settings_class_init)
6109 (emacs_settings_init, gsettings_obj): Remove.
6110 (something_changedCB): New function for HAVE_GSETTINGS.
6111 (something_changedCB): HAVE_GCONF: Call store_monospaced_changed
6112 with value as argument.
6113 (init_gsettings): Check that GSETTINGS_SCHEMA exists before calling
6114 g_settings_new (Bug#8967). Do not create gsettings_obj.
6115 Remove calls to g_settings_bind. Connect something_changedCB to
6118 * xgselect.c: Add defined (HAVE_GSETTINGS).
6119 (xgselect_initialize): Ditto.
6121 * process.c: Add defined (HAVE_GSETTINGS) for xgselect.h
6122 (wait_reading_process_output): Add defined (HAVE_GSETTINGS) for
6125 2011-07-01 Paul Eggert <eggert@cs.ucla.edu>
6127 * eval.c (struct backtrace): Simplify and port the data structure.
6128 Do not assume that "int nargs : BITS_PER_INT - 2;" produces a
6129 signed bit field, as this assumption is not portable and it makes
6130 Emacs crash when compiled with Sun C 5.8 on sparc. Do not use
6131 "char debug_on_exit : 1" as this is not portable either; instead,
6132 use the portable "unsigned int debug_on_exit : 1". Remove unused
6133 member evalargs. Remove obsolete comments about cc bombing out.
6135 2011-06-30 Jan Djärv <jan.h.d@swipnet.se>
6137 * xsettings.c: Include glib-object.h, gio/gio.h if HAVE_GSETTINGS.
6138 Let HAVE_GSETTINGS override HAVE_GCONF.
6139 (store_monospaced_changed): New function.
6140 (EMACS_SETTINGS): A new type derived from GObject to handle
6141 GSettings notifications.
6142 (emacs_settings_constructor, emacs_settings_get_property)
6143 (emacs_settings_set_property, emacs_settings_class_init):
6145 (gsettings_client, gsettings_obj): New variables.
6146 (GSETTINGS_SCHEMA): New define.
6147 (something_changedCB): Call store_monospaced_changed.
6148 (init_gsettings): New function.
6149 (xsettings_initialize): Call init_gsettings.
6150 (syms_of_xsettings): Initialize gsettings_client, gsettings_obj
6153 * Makefile.in (SETTINGS_CFLAGS, SETTINGS_LIBS): Rename from
6156 2011-06-29 Martin Rudalics <rudalics@gmx.at>
6158 * window.c (resize_root_window, grow_mini_window)
6159 (shrink_mini_window): Rename Qresize_root_window to
6160 Qwindow_resize_root_window and Qresize_root_window_vertically to
6161 Qwindow_resize_root_window_vertically.
6163 2011-06-28 Paul Eggert <eggert@cs.ucla.edu>
6165 * gnutls.c (Qgnutls_bootprop_verify_error): Remove unused var.
6167 2011-06-27 Juanma Barranquero <lekktu@gmail.com>
6169 * makefile.w32-in: Redesign dependencies so they reflect more
6170 clearly which files are directly included by each source file,
6171 and not through other includes.
6173 2011-06-27 Martin Rudalics <rudalics@gmx.at>
6175 * buffer.c (Qclone_number): Declare static and DEFSYM it.
6176 (sort_overlays, overlay_strings): When an overlay's clone number
6177 matches the window's clone number process the overlay even if
6178 the overlay's window property doesn't match the current window.
6180 * window.c (Fwindow_vchild): Rename to Fwindow_top_child.
6181 (Fwindow_hchild): Rename to Fwindow_left_child.
6182 (Fwindow_next): Rename to Fwindow_next_sibling.
6183 (Fwindow_prev): Rename to Fwindow_prev_sibling.
6184 (resize_window_check): Rename to window_resize_check.
6185 (resize_window_apply): Rename to window_resize_apply.
6186 (Fresize_window_apply): Rename to Fwindow_resize_apply.
6187 (Fdelete_other_windows_internal, resize_frame_windows)
6188 (Fsplit_window_internal, Fdelete_window_internal)
6189 (grow_mini_window, shrink_mini_window)
6190 (Fresize_mini_window_internal): Fix callers accordingly.
6192 2011-06-26 Jan Djärv <jan.h.d@swipnet.se>
6194 * emacsgtkfixed.h: State that this is only used with Gtk+3.
6195 (emacs_fixed_set_min_size): Remove.
6196 (emacs_fixed_new): Take frame as argument.
6198 * emacsgtkfixed.c: State that this is only used with Gtk+3.
6199 (_EmacsFixedPrivate): Remove minwidth/height.
6200 Add struct frame *f.
6201 (emacs_fixed_init): Initialize priv->f.
6202 (get_parent_class, emacs_fixed_set_min_size): Remove.
6203 (emacs_fixed_new): Set priv->f to argument.
6204 (emacs_fixed_get_preferred_width)
6205 (emacs_fixed_get_preferred_height): Use min_width/height from
6206 frames size_hint to set minimum and natural (Bug#8919).
6207 (XSetWMSizeHints, XSetWMNormalHints): Override these functions
6208 and use min_width/height from frames size_hint to set
6209 min_width/height (Bug#8919).
6211 * gtkutil.c (xg_create_frame_widgets): Pass f to emacs_fixed_new.
6212 (x_wm_set_size_hint): Remove call to emacs_fixed_set_min_size.
6215 2011-06-26 Eli Zaretskii <eliz@gnu.org>
6217 * bidi.c (bidi_paragraph_init): Test for ZV_BYTE before calling
6218 bidi_at_paragraph_end, since fast_looking_at doesn't like to be
6221 2011-06-26 Chong Yidong <cyd@stupidchicken.com>
6223 * process.c (wait_reading_process_output): Bypass select if
6224 waiting for a cell while ignoring keyboard input, and input is
6225 pending. Suggested by Jan Djärv (Bug#8869).
6227 2011-06-25 Paul Eggert <eggert@cs.ucla.edu>
6229 Use gnulib's dup2 module instead of rolling our own.
6230 * sysdep.c (dup2) [!HAVE_DUP2]: Remove; gnulib now does this.
6232 2011-06-25 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
6234 * dispnew.c (scrolling_window): Before scrolling, turn off a
6235 mouse-highlight in the window being scrolled.
6237 2011-06-24 Juanma Barranquero <lekktu@gmail.com>
6239 Move DEFSYM to lisp.h and use everywhere.
6241 * character.h (DEFSYM): Move declaration...
6242 * lisp.h (DEFSYM): ...here.
6248 * w32select.c: Don't include character.h.
6250 * alloc.c (syms_of_alloc):
6251 * buffer.c (syms_of_buffer):
6252 * bytecode.c (syms_of_bytecode):
6253 * callint.c (syms_of_callint):
6254 * casefiddle.c (syms_of_casefiddle):
6255 * casetab.c (init_casetab_once):
6256 * category.c (init_category_once, syms_of_category):
6257 * ccl.c (syms_of_ccl):
6258 * cmds.c (syms_of_cmds):
6259 * composite.c (syms_of_composite):
6260 * dbusbind.c (syms_of_dbusbind):
6261 * dired.c (syms_of_dired):
6262 * dispnew.c (syms_of_display):
6263 * doc.c (syms_of_doc):
6264 * editfns.c (syms_of_editfns):
6265 * emacs.c (syms_of_emacs):
6266 * eval.c (syms_of_eval):
6267 * fileio.c (syms_of_fileio):
6268 * fns.c (syms_of_fns):
6269 * frame.c (syms_of_frame):
6270 * fringe.c (syms_of_fringe):
6271 * insdel.c (syms_of_insdel):
6272 * keymap.c (syms_of_keymap):
6273 * lread.c (init_obarray, syms_of_lread):
6274 * macros.c (syms_of_macros):
6275 * msdos.c (syms_of_msdos):
6276 * print.c (syms_of_print):
6277 * process.c (syms_of_process):
6278 * search.c (syms_of_search):
6279 * sound.c (syms_of_sound):
6280 * syntax.c (init_syntax_once, syms_of_syntax):
6281 * terminal.c (syms_of_terminal):
6282 * textprop.c (syms_of_textprop):
6283 * undo.c (syms_of_undo):
6284 * w32.c (globals_of_w32):
6285 * window.c (syms_of_window):
6286 * xdisp.c (syms_of_xdisp):
6287 * xfaces.c (syms_of_xfaces):
6288 * xfns.c (syms_of_xfns):
6289 * xmenu.c (syms_of_xmenu):
6290 * xsettings.c (syms_of_xsettings):
6291 * xterm.c (syms_of_xterm): Use DEFSYM.
6293 2011-06-24 Teodor Zlatanov <tzz@lifelogs.com>
6295 * gnutls.c (syms_of_gnutls): Use the DEFSYM macro from character.h.
6297 2011-06-23 Paul Eggert <eggert@cs.ucla.edu>
6299 Integer and buffer overflow fixes (Bug#8873).
6301 * print.c (printchar, strout): Check for string overflow.
6302 (PRINTPREPARE, printchar, strout):
6303 Don't set size unless allocation succeeds.
6305 * minibuf.c (read_minibuf_noninteractive): Use ptrdiff_t, not int,
6306 for sizes. Check for string overflow more accurately.
6307 Simplify newline removal at end; this suppresses a GCC 4.6.0 warning.
6309 * macros.c: Integer and buffer overflow fixes.
6310 * keyboard.h (struct keyboard.kbd_macro_bufsize):
6311 * macros.c (Fstart_kbd_macro, store_kbd_macro_char):
6312 Use ptrdiff_t, not int, for sizes.
6313 Don't increment bufsize until after realloc succeeds.
6314 Check for size-calculation overflow.
6315 (Fstart_kbd_macro): Use EMACS_INT, not int, for XINT result.
6317 * lisp.h (DEFVAR_KBOARD): Use offsetof instead of char * finagling.
6319 * lread.c: Integer overflow fixes.
6320 (read_integer): Radix is now EMACS_INT, not int,
6321 to improve quality of diagnostics for out-of-range radices.
6322 Calculate buffer size correctly for out-of-range radices.
6323 (read1): Check for integer overflow in radices, and in
6324 read-circle numbers.
6325 (read_escape): Avoid int overflow.
6326 (Fload, openp, read_buffer_size, read1)
6327 (substitute_object_recurse, read_vector, read_list, map_obarray):
6328 Use ptrdiff_t, not int, for sizes.
6329 (read1): Use EMACS_INT, not int, for sizes.
6330 Check for size overflow.
6332 * image.c (cache_image): Check for size arithmetic overflow.
6334 * lread.c: Integer overflow issues.
6335 (saved_doc_string_size, saved_doc_string_length)
6336 (prev_saved_doc_string_size, prev_saved_doc_string_length):
6337 Now ptrdiff_t, not int.
6338 (read1): Don't assume doc string length fits in int. Check for
6339 out-of-range doc string lengths.
6340 (read_list): Don't assume file position fits in int.
6341 (read_escape): Check for hex character overflow.
6343 2011-06-22 Leo Liu <sdl.web@gmail.com>
6345 * minibuf.c (Fcompleting_read_default, Vcompleting_read_function):
6346 Move to minibuffer.el.
6348 2011-06-22 Paul Eggert <eggert@cs.ucla.edu>
6350 Fixes for GLYPH_DEBUG found by GCC 4.6.0 static checking.
6351 The following patches are for when GLYPH_DEBUG && !XASSERT.
6352 * dispextern.h (trace_redisplay_p, dump_glyph_string):
6353 * dispnew.c (flush_stdout):
6354 * xdisp.c (dump_glyph_row, dump_glyph_matrix, dump_glyph):
6355 Mark as externally visible.
6356 * dispnew.c (check_window_matrix_pointers): Now static.
6357 * dispnew.c (window_to_frame_vpos):
6358 * xfns.c (unwind_create_frame):
6359 * xterm.c (x_check_font): Remove unused local.
6360 * scroll.c (CHECK_BOUNDS):
6361 * xfaces.c (cache_fache): Rename local to avoid shadowing.
6362 * xfns.c, w32fns.c (image_cache_refcount, dpyinfo_refcount): Now static.
6363 * xdisp.c (check_window_end): Now a no-op if !XASSERTS.
6364 (debug_first_unchanged_at_end_vpos, debug_last_unchanged_at_beg_vpos)
6365 (debug_dvpos, debug_dy, debug_delta, debug_delta_bytes, debug_end_vpos):
6367 (debug_method_add): Use va_list and vsprintf rather than relying
6368 on undefined behavior with wrong number of arguments.
6369 (dump_glyph, dump_glyph_row, Fdump_glyph_matrix):
6370 Don't assume ptrdiff_t and EMACS_INT are the same width as int.
6371 In this code, it's OK to assume C99 behavior for ptrdiff_t formats
6372 since we're not interested in debugging glyphs with old libraries.
6373 * xfaces.c (cache_face): Move debugging code earlier; this pacifies
6374 GCC 4.6.0's static checking.
6376 2011-06-22 Paul Eggert <eggert@cs.ucla.edu>
6378 Integer overflow and signedness fixes (Bug#8873).
6379 A few related buffer overrun fixes, too.
6381 * font.c (font_score): Use EMACS_INT, not int, to store XINT value.
6383 * dispextern.h (struct face.stipple):
6384 * image.c (x_bitmap_height, x_bitmap_width, x_bitmap_pixmap)
6385 (x_bitmap_mask, x_allocate_bitmap_record)
6386 (x_create_bitmap_from_data, x_create_bitmap_from_file)
6387 (x_destroy_bitmap, x_destroy_all_bitmaps, x_create_bitmap_mask)
6388 (x_create_bitmap_from_xpm_data):
6389 * nsterm.h (struct ns_display_info.bitmaps_size, .bitmaps_last):
6390 * w32term.h (struct w32_display_info.icon_bitmap_id, .bitmaps_size)
6392 * xfaces.c (load_pixmap):
6393 * xterm.c (x_bitmap_icon, x_wm_set_icon_pixmap):
6394 * xterm.h (struct x_display_info.icon_bitmap_id, .bitmaps_size)
6395 (.bitmaps_last, struct x_output.icon_bitmap):
6396 Use ptrdiff_t, not int, for bitmap indexes.
6397 (x_allocate_bitmap_record): Check for size overflow.
6398 * dispextern.h, lisp.h: Adjust to API changes elsewhere.
6400 Use ptrdiff_t, not int, for overlay counts.
6401 * buffer.h (overlays_at, sort_overlays, GET_OVERLAYS_AT):
6402 * editfns.c (overlays_around, get_pos_property):
6403 * textprop.c (get_char_property_and_overlay):
6404 * xdisp.c (next_overlay_change, note_mouse_highlight):
6405 * xfaces.c (face_at_buffer_position):
6406 * buffer.c (OVERLAY_COUNT_MAX): New macro.
6407 (overlays_at, overlays_in, sort_overlays, Foverlays_at)
6408 (Fnext_overlay_change, Fprevious_overlay_change)
6409 (mouse_face_overlay_overlaps, Foverlays_in):
6410 Use ptrdiff_t, not int, for sizes.
6411 (overlays_at, overlays_in): Check for size-calculation overflow.
6413 * xterm.c (xim_initialize, same_x_server): Strlen may not fit in int.
6415 * xsmfns.c (smc_save_yourself_CB, x_session_initialize): Avoid strlen.
6416 (x_session_initialize): Do not assume string length fits in int.
6418 * xsettings.c (apply_xft_settings): Fix potential buffer overrun.
6419 This is unlikely, but can occur if DPI is outlandish.
6421 * xsettings.c (Ffont_get_system_normal_font, Ffont_get_system_font):
6422 * xselect.c (Fx_get_atom_name): Avoid need for strlen.
6424 * xrdb.c: Don't assume strlen fits in int; avoid some strlens.
6425 * xrdb.c (magic_file_p, search_magic_path):
6426 Omit last arg SUFFIX; it was always 0. All callers changed.
6427 (magic_file_p): Use ptrdiff_t, not int. Check for size overflow.
6429 * xfont.c (xfont_match): Avoid need for strlen.
6431 * xfns.c: Don't assume strlen fits in int.
6432 (xic_create_fontsetname, x_window): Use ptrdiff_t, not int.
6434 * xdisp.c (message_log_check_duplicate): Return intmax_t,
6435 not unsigned long, as we prefer signed integers. All callers changed.
6436 Detect integer overflow in repeat count.
6437 (message_dolog): Don't assume print length fits in 39 bytes.
6438 (display_mode_element): Don't assume strlen fits in int.
6440 * termcap.c: Don't assume sizes fit in int and never overflow.
6441 (struct termcap_buffer, tgetent): Use ptrdiff_t, not int, for sizes.
6442 (gobble_line): Check for size-calculation overflow.
6444 * minibuf.c (Fread_buffer):
6445 * lread.c (intern, intern_c_string):
6446 * image.c (xpm_scan) [HAVE_NS && !HAVE_XPM]:
6447 Don't assume string length fits in int.
6449 * keyboard.c (parse_tool_bar_item):
6450 * gtkutil.c (style_changed_cb): Avoid need for strlen.
6452 * font.c: Don't assume string length fits in int.
6453 (font_parse_xlfd, font_parse_fcname, font_unparse_fcname):
6454 Use ptrdiff_t, not int.
6455 (font_intern_prop): Don't assume string length fits in int.
6456 Don't assume integer property fits in fixnum.
6457 * font.h (font_intern_prop): 2nd arg is now ptrdiff_t, not int.
6459 * filelock.c: Fix some buffer overrun and integer overflow issues.
6460 (get_boot_time): Don't assume gzip command string fits in 100 bytes.
6461 Reformulate so as not to need the command string.
6462 Invoke gzip -cd rather than gunzip, as it's more portable.
6463 (lock_info_type, lock_file_1, lock_file):
6464 Don't assume pid_t and time_t fit in unsigned long.
6465 (LOCK_PID_MAX): Remove; we now use more-reliable bounds.
6466 (current_lock_owner): Prefer signed type for sizes.
6467 Use memcpy, not strncpy, where memcpy is what is really wanted.
6468 Don't assume (via atoi) that time_t and pid_t fit in int.
6469 Check for time_t and/or pid_t out of range, e.g., via a network share.
6470 Don't alloca where an auto var works fine.
6472 * fileio.c: Fix some integer overflow issues.
6473 (file_name_as_directory, Fexpand_file_name, Fsubstitute_in_file_name):
6474 Don't assume string length fits in int.
6475 (directory_file_name): Don't assume string length fits in long.
6476 (make_temp_name): Don't assume pid fits in int, or that its print
6477 length is less than 20.
6479 * data.c (Fsubr_name): Rewrite to avoid a strlen call.
6481 * coding.c (make_subsidiaries): Don't assume string length fits in int.
6483 * callproc.c (child_setup): Rewrite to avoid two strlen calls.
6485 * process.c (Fformat_network_address): Use EMACS_INT, not EMACS_UINT.
6486 We prefer signed integers, even for size calculations.
6488 * emacs.c: Don't assume string length fits in 'int'.
6489 (DEFINE_DUMMY_FUNCTION, sort_args): Use ptrdiff_t, not int.
6490 (main): Don't invoke strlen when not needed.
6492 * dbusbind.c (XD_ERROR): Don't arbitrarily truncate string.
6493 (XD_DEBUG_MESSAGE): Don't waste a byte.
6495 * callproc.c (getenv_internal_1, getenv_internal)
6497 * buffer.c (init_buffer): Don't assume string length fits in 'int'.
6499 * lread.c (invalid_syntax): Omit length argument.
6500 All uses changed. This doesn't fix a bug, but it simplifies the
6501 code away from its former Hollerith-constant appearance, and it's
6502 one less 'int' to worry about when looking at integer-overflow issues.
6503 (string_to_number): Simplify 2011-04-26 change by invoking xsignal1.
6505 * lisp.h (DEFUN): Remove bogus use of sizeof (struct Lisp_Subr).
6506 This didn't break anything, but it didn't help either.
6507 It's confusing to put a bogus integer in a place where the actual
6508 value does not matter.
6509 (LIST_END_P): Remove unused macro and its bogus comment.
6510 (make_fixnum_or_float): Remove unnecessary cast to EMACS_INT.
6512 * lisp.h (union Lisp_Object.i): EMACS_INT, not EMACS_UINT.
6513 This is for consistency with the ordinary, non-USE_LISP_UNION_TYPE,
6515 (struct Lisp_Bool_Vector.size): EMACS_INT, not EMACS_UINT.
6516 We prefer signed types, and the value cannot exceed the EMACS_INT
6517 range anyway (because otherwise the length would not be representable).
6518 (XSET) [USE_LISP_UNION_TYPE]: Use uintptr_t and intptr_t,
6519 not EMACS_UINT and EMACS_INT, when converting pointer to integer.
6520 This avoids a GCC warning when WIDE_EMACS_INT.
6522 * indent.c (sane_tab_width): New function.
6523 (current_column, scan_for_column, Findent_to, position_indentation)
6524 (compute_motion): Use it. This is just for clarity.
6525 (Fcompute_motion): Don't assume hscroll and tab offset fit in int.
6527 * image.c (xbm_image_p): Don't assume stated width, height fit in int.
6529 * lisp.h (lint_assume): New macro.
6530 * composite.c (composition_gstring_put_cache):
6531 * ftfont.c (ftfont_shape_by_flt): Use it to pacify GCC 4.6.0.
6533 * editfns.c, insdel.c:
6534 Omit unnecessary forward decls, to simplify future changes.
6536 * ftfont.c (ftfont_shape_by_flt): Use signed integers for lengths.
6538 * font.c (Ffont_shape_gstring): Don't assume glyph len fits in 'int'.
6540 * fns.c (Ffillarray): Don't assume bool vector size fits in 'int'.
6541 Use much-faster test for byte-length change.
6542 Don't assume string byte-length fits in 'int'.
6543 Check that character arg fits in 'int'.
6544 (mapcar1): Declare byte as byte, for clarity.
6546 * alloc.c (Fmake_bool_vector): Avoid unnecessary multiplication.
6548 * fns.c (concat): Catch string overflow earlier.
6549 Do not rely on integer wraparound.
6551 * dispextern.h (struct it.overlay_strings_charpos)
6552 (struct it.selective): Now EMACS_INT, not int.
6553 * xdisp.c (forward_to_next_line_start)
6554 (back_to_previous_visible_line_start)
6555 (reseat_at_next_visible_line_start, next_element_from_buffer):
6556 Don't arbitrarily truncate the value of 'selective' to int.
6558 * xdisp.c (init_iterator): Use XINT, not XFASTINT; it might be < 0.
6560 * composite.c: Don't truncate sizes to 'int'.
6561 (composition_gstring_p, composition_reseat_it)
6562 (composition_adjust_point): Use EMACS_INT, not int.
6563 (get_composition_id, composition_gstring_put_cache): Use EMACS_INT,
6564 not EMACS_UINT, for indexes.
6566 * category.h (CATEGORY_SET_P): Remove unnecessary cast to EMACS_INT.
6568 * buffer.c: Include <verify.h>.
6569 (struct sortvec.priority, struct sortstr.priority):
6570 Now EMACS_INT, not int.
6571 (compare_overlays, cmp_for_strings): Avoid subtraction overflow.
6572 (struct sortstr.size, record_overlay_string)
6573 (struct sortstrlist.size, struct sortlist.used):
6574 Don't truncate size to int.
6575 (record_overlay_string): Check for size-calculation overflow.
6576 (init_buffer_once): Check at compile-time, not run-time.
6578 2011-06-22 Jim Meyering <meyering@redhat.com>
6580 Don't leak an XBM-image-sized buffer
6581 * image.c (xbm_load): Free the image buffer after using it.
6583 2011-06-21 Paul Eggert <eggert@cs.ucla.edu>
6586 * composite.c (find_automatic_composition): Omit needless 'return 0;'
6587 that Sun C diagnosed.
6588 * fns.c (secure_hash): Fix pointer signedness issue.
6589 * intervals.c (static_offset_intervals): New function.
6590 (offset_intervals): Use it.
6592 2011-06-21 Leo Liu <sdl.web@gmail.com>
6595 * makefile.w32-in ($(BLD)/fns.$(O)): Include sha256.h and
6598 * fns.c (secure_hash): Rename from crypto_hash_function and change
6599 the first arg to accept symbols.
6600 (Fsecure_hash): New primitive.
6601 (syms_of_fns): New symbols.
6603 2011-06-20 Deniz Dogan <deniz@dogan.se>
6605 * process.c (Fset_process_buffer): Clarify return value in
6608 2011-06-18 Chong Yidong <cyd@stupidchicken.com>
6610 * dispnew.c (add_window_display_history): Use BVAR.
6612 * xdisp.c (debug_method_add): Use BVAR.
6613 (check_window_end, dump_glyph_matrix, dump_glyph)
6614 (dump_glyph_row, dump_glyph_string): Convert arglist to ANSI C.
6616 * xfaces.c (check_lface_attrs, check_lface, dump_realized_face):
6619 * xfns.c (Fx_create_frame, x_create_tip_frame): Delay image cache
6620 check till after the cache is created in init_frame_faces.
6622 2011-06-17 Stefan Monnier <monnier@iro.umontreal.ca>
6624 * fns.c (Fsafe_length): Yet another int/Lisp_Object mixup.
6626 2011-06-16 Paul Eggert <eggert@cs.ucla.edu>
6628 * lisp.h: Include <limits.h>, for INT_MAX, LONG_MAX, LLONG_MAX.
6629 Without this, prin1 mishandles Lisp_Misc_Save_Value printing on
6630 hosts with pre-C99 libraries, because pD is wrongly defined to "t".
6632 Improve buffer-overflow checking (Bug#8873).
6633 * fileio.c (Finsert_file_contents):
6634 * insdel.c (insert_from_buffer_1, replace_range, replace_range_2):
6635 Remove the old (too-loose) buffer overflow checks.
6636 They weren't needed, since make_gap checks for buffer overflow.
6637 * insdel.c (make_gap_larger): Catch buffer overflows that were missed.
6638 The old code merely checked for Emacs fixnum overflow, and relied
6639 on undefined (wraparound) behavior. The new code avoids undefined
6640 behavior, and also checks for ptrdiff_t and/or size_t overflow.
6642 * editfns.c (Finsert_char): Don't dump core with very negative counts.
6643 Tune. Don't use wider integers than needed. Don't use alloca.
6644 Use a bigger 'string' buffer. Rewrite to avoid 'n > 0' test.
6646 * insdel.c (replace_range): Fix buf overflow when insbytes < outgoing.
6648 * insdel.c, lisp.h (buffer_overflow): New function.
6649 (insert_from_buffer_1, replace_range, replace_range_2):
6650 * insdel.c (make_gap_larger):
6651 * editfns.c (Finsert_char):
6652 * fileio.c (Finsert_file_contents): Use it, to normalize wording.
6654 * buffer.h (BUF_BYTES_MAX): Cast to ptrdiff_t so that it's signed.
6656 2011-06-15 Paul Eggert <eggert@cs.ucla.edu>
6658 Integer overflow and signedness fixes (Bug#8873, Bug#8828).
6660 * ccl.c (ASCENDING_ORDER): New macro, to work around GCC bug 43772.
6661 (GET_CCL_RANGE, IN_INT_RANGE): Use it.
6663 * fileio.c: Don't assume EMACS_INT fits in off_t.
6664 (emacs_lseek): New static function.
6665 (Finsert_file_contents, Fwrite_region): Use it.
6666 Use SEEK_SET, SEEK_CUR, SEEK_END as appropriate.
6668 * fns.c (Fload_average): Don't assume 100 * load average fits in int.
6670 * fns.c: Don't overflow int when computing a list length.
6671 * fns.c (QUIT_COUNT_HEURISTIC): New constant.
6672 (Flength, Fsafe_length): Use EMACS_INT, not int, to avoid unwanted
6673 truncation on 64-bit hosts. Check for QUIT every
6674 QUIT_COUNT_HEURISTIC entries rather than every other entry; that's
6675 faster and is responsive enough.
6676 (Flength): Report an error instead of overflowing an integer.
6677 (Fsafe_length): Return a float if the value is not representable
6678 as a fixnum. This shouldn't happen except in contrived situations.
6679 (Fnthcdr, Fsort): Don't assume list length fits in int.
6680 (Fcopy_sequence): Don't assume vector length fits in int.
6682 * alloc.c: Check that resized vectors' lengths fit in fixnums.
6683 (header_size, word_size): New constants.
6684 (allocate_vectorlike): Don't check size overflow here.
6685 (allocate_vector): Check it here instead, since this is the only
6686 caller of allocate_vectorlike that could cause overflow.
6687 Check that the new vector's length is representable as a fixnum.
6689 * fns.c (next_almost_prime): Don't return a multiple of 3 or 5.
6690 The previous code was bogus. For example, next_almost_prime (32)
6691 returned 39, which is undesirable as it is a multiple of 3; and
6692 next_almost_prime (24) returned 25, which is a multiple of 5 so
6693 why was the code bothering to check for multiples of 7?
6695 * bytecode.c (exec_byte_code): Use ptrdiff_t, not int, for vector length.
6697 * eval.c, doprnt.c (SIZE_MAX): Remove; inttypes.h defines this now.
6699 Variadic C functions now count arguments with ptrdiff_t.
6700 This partly undoes my 2011-03-30 change, which replaced int with size_t.
6701 Back then I didn't know that the Emacs coding style prefers signed int.
6702 Also, in the meantime I found a few more instances where arguments
6703 were being counted with int, which may truncate counts on 64-bit
6704 machines, or EMACS_INT, which may be unnecessarily wide.
6705 * lisp.h (struct Lisp_Subr.function.aMANY)
6706 (DEFUN_ARGS_MANY, internal_condition_case_n, safe_call):
6707 Arg counts are now ptrdiff_t, not size_t.
6708 All variadic functions and their callers changed accordingly.
6709 (struct gcpro.nvars): Now size_t, not size_t. All uses changed.
6710 * bytecode.c (exec_byte_code): Check maxdepth for overflow,
6711 to avoid potential buffer overrun. Don't assume arg counts fit in 'int'.
6712 * callint.c (Fcall_interactively): Check arg count for overflow,
6713 to avoid potential buffer overrun. Use signed char, not 'int',
6714 for 'varies' array, so that we needn't bother to check its size
6715 calculation for overflow.
6716 * editfns.c (Fformat): Use ptrdiff_t, not EMACS_INT, to count args.
6717 * eval.c (apply_lambda):
6718 * fns.c (Fmapconcat): Use XFASTINT, not XINT, to get args length.
6719 (struct textprop_rec.argnum): Now ptrdiff_t, not int. All uses changed.
6720 (mapconcat): Use ptrdiff_t, not int and EMACS_INT, to count args.
6722 * callint.c (Fcall_interactively): Don't use index var as event count.
6724 * vm-limit.c (check_memory_limits): Fix incorrect extern function decls.
6725 * mem-limits.h (SIZE): Remove; no longer used.
6727 * xterm.c (x_alloc_nearest_color_1): Prefer int to long when int works.
6729 Remove unnecessary casts.
6730 * xterm.c (x_term_init):
6731 * xfns.c (x_set_border_pixel):
6732 * widget.c (create_frame_gcs): Remove casts to unsigned long etc.
6733 These aren't needed now that we assume ANSI C.
6735 * sound.c (Fplay_sound_internal): Remove cast to unsigned long.
6736 It's more likely to cause problems (due to unsigned overflow)
6739 * dired.c (Ffile_attributes): Don't use 32-bit hack on 64-bit hosts.
6741 * unexelf.c (unexec): Don't assume BSS addr fits in unsigned.
6743 * xterm.c (handle_one_xevent): Omit unnecessary casts to unsigned.
6745 * keyboard.c (modify_event_symbol): Don't limit alist len to UINT_MAX.
6747 * lisp.h (CHAR_TABLE_SET): Omit now-redundant test.
6749 * lread.c (Fload): Don't compare a possibly-garbage time_t value.
6751 GLYPH_CODE_FACE returns EMACS_INT, not int.
6752 * dispextern.h (merge_faces):
6753 * xfaces.c (merge_faces):
6754 * xdisp.c (get_next_display_element, next_element_from_display_vector):
6755 Don't assume EMACS_INT fits in int.
6757 * character.h (CHAR_VALID_P): Remove unused parameter.
6758 * fontset.c, lisp.h, xdisp.c: All uses changed.
6760 * editfns.c (Ftranslate_region_internal): Omit redundant test.
6762 * fns.c (concat): Minor tuning based on overflow analysis.
6763 This doesn't fix any bugs. Use int to hold character, instead
6764 of constantly refetching from Emacs object. Use XFASTINT, not
6765 XINT, for value known to be a character. Don't bother comparing
6766 a single byte to 0400, as it's always less.
6768 * floatfns.c (Fexpt):
6769 * fileio.c (make_temp_name): Omit unnecessary cast to unsigned.
6771 * editfns.c (Ftranslate_region_internal): Use int, not EMACS_INT
6774 * doc.c (get_doc_string): Omit (unsigned)c that mishandled negatives.
6776 * data.c (Faset): If ARRAY is a string, check that NEWELT is a char.
6777 Without this fix, on a 64-bit host (aset S 0 4294967386) would
6778 incorrectly succeed when S was a string, because 4294967386 was
6779 truncated before it was used.
6781 * chartab.c (Fchar_table_range): Use CHARACTERP to check range.
6782 Otherwise, an out-of-range integer could cause undefined behavior
6785 * composite.c: Use int, not EMACS_INT, for characters.
6786 (fill_gstring_body, composition_compute_stop_pos): Use int, not
6787 EMACS_INT, for values that are known to be in character range.
6788 This doesn't fix any bugs but is the usual style inside Emacs and
6789 may generate better code on 32-bit machines.
6791 Make sure a 64-bit char is never passed to ENCODE_CHAR.
6792 This is for reasons similar to the recent CHAR_STRING fix.
6793 * charset.c (Fencode_char): Check that character arg is actually
6794 a character. Pass an int to ENCODE_CHAR.
6795 * charset.h (ENCODE_CHAR): Verify that the character argument is no
6796 wider than 'int', as a compile-time check to prevent future regressions
6799 * character.c (char_string): Remove unnecessary casts.
6801 Make sure a 64-bit char is never passed to CHAR_STRING.
6802 Otherwise, CHAR_STRING would do the wrong thing on a 64-bit platform,
6803 by silently ignoring the top 32 bits, allowing some values
6804 that were far too large to be valid characters.
6805 * character.h: Include <verify.h>.
6806 (CHAR_STRING, CHAR_STRING_ADVANCE): Verify that the character
6807 arguments are no wider than unsigned, as a compile-time check
6808 to prevent future regressions in this area.
6810 * editfns.c (Fchar_to_string, general_insert_function, Finsert_char)
6811 (Fsubst_char_in_region):
6813 * xdisp.c (decode_mode_spec_coding):
6814 Adjust to CHAR_STRING's new requirement.
6815 * editfns.c (Finsert_char, Fsubst_char_in_region):
6816 * fns.c (concat): Check that character args are actually
6817 characters. Without this test, these functions did the wrong
6818 thing with wildly out-of-range values on 64-bit hosts.
6820 Remove incorrect casts to 'unsigned' that lose info on 64-bit hosts.
6821 These casts should not be needed on 32-bit hosts, either.
6822 * keyboard.c (read_char):
6823 * lread.c (Fload): Remove casts to unsigned.
6825 * lisp.h (UNSIGNED_CMP): New macro.
6826 This fixes comparison bugs on 64-bit hosts.
6827 (ASCII_CHAR_P): Use it.
6828 * casefiddle.c (casify_object):
6829 * character.h (ASCII_BYTE_P, CHAR_VALID_P)
6830 (SINGLE_BYTE_CHAR_P, CHAR_STRING):
6831 * composite.h (COMPOSITION_ENCODE_RULE_VALID):
6832 * dispextern.h (FACE_FROM_ID):
6833 * keyboard.c (read_char): Use UNSIGNED_CMP.
6835 * xmenu.c (dialog_selection_callback) [!USE_GTK]: Cast to intptr_t,
6836 not to EMACS_INT, to avoid GCC warning.
6838 * xfns.c (x_set_scroll_bar_default_width): Remove unused 'int' locals.
6840 * buffer.h (PTR_BYTE_POS, BUF_PTR_BYTE_POS): Remove harmful cast.
6841 The cast incorrectly truncated 64-bit byte offsets to 32 bits, and
6842 isn't needed on 32-bit machines.
6844 * buffer.c (Fgenerate_new_buffer_name):
6845 Use EMACS_INT for count, not int.
6846 (advance_to_char_boundary): Return EMACS_INT, not int.
6848 * data.c (Qcompiled_function): Now static.
6850 * window.c (window_body_lines): Now static.
6852 * image.c (gif_load): Rename local to avoid shadowing.
6854 * lisp.h (SAFE_ALLOCA_LISP): Check for integer overflow.
6855 (struct Lisp_Save_Value): Use ptrdiff_t, not int, for 'integer' member.
6856 * alloc.c (make_save_value): Integer argument is now of type
6858 (mark_object): Use ptrdiff_t, not int.
6859 * lisp.h (pD): New macro.
6860 * print.c (print_object): Use it.
6862 * alloc.c: Use EMACS_INT, not int, to count objects.
6863 (total_conses, total_markers, total_symbols, total_vector_size)
6864 (total_free_conses, total_free_markers, total_free_symbols)
6865 (total_free_floats, total_floats, total_free_intervals)
6866 (total_intervals, total_strings, total_free_strings):
6867 Now EMACS_INT, not int. All uses changed.
6868 (Fgarbage_collect): Compute overall total using a double, so that
6869 integer overflow is less likely to be a problem. Check for overflow
6870 when converting back to an integer.
6871 (n_interval_blocks, n_string_blocks, n_float_blocks, n_cons_blocks)
6872 (n_vectors, n_symbol_blocks, n_marker_blocks): Remove.
6873 These were 'int' variables that could overflow on 64-bit hosts;
6874 they were never used, so remove them instead of repairing them.
6875 (nzombies, ngcs, max_live, max_zombies): Now EMACS_INT, not 'int'.
6876 (inhibit_garbage_collection): Set gc_cons_threshold to max value.
6877 Previously, this ceilinged at INT_MAX, but that doesn't work on
6879 (allocate_pseudovector): Don't use EMACS_INT when int would do.
6881 * alloc.c (Fmake_bool_vector): Don't assume vector size fits in int.
6882 (allocate_vectorlike): Check for ptrdiff_t overflow.
6883 (mark_vectorlike, mark_char_table, mark_object): Avoid EMACS_UINT
6884 when a (possibly-narrower) signed value would do just as well.
6885 We prefer using signed arithmetic, to avoid comparison confusion.
6887 * alloc.c: Catch some string size overflows that we were missing.
6888 (XMALLOC_OVERRUN_CHECK_SIZE) [!XMALLOC_OVERRUN_CHECK]: Define to 0,
6889 for convenience in STRING_BYTES_MAX.
6890 (STRING_BYTES_MAX): New macro, superseding the old one in lisp.h.
6891 The definition here is exact; the one in lisp.h was approximate.
6892 (allocate_string_data): Check for string overflow. This catches
6893 some instances we weren't catching before. Also, it catches
6894 size_t overflow on (unusual) hosts where SIZE_MAX <= min
6895 (PTRDIFF_MAX, MOST_POSITIVE_FIXNUM), e.g., when size_t is 32 bits
6896 and ptrdiff_t and EMACS_INT are both 64 bits.
6898 * character.c, coding.c, doprnt.c, editfns.c, eval.c:
6899 All uses of STRING_BYTES_MAX replaced by STRING_BYTES_BOUND.
6900 * lisp.h (STRING_BYTES_BOUND): Rename from STRING_BYTES_MAX.
6902 * character.c (string_escape_byte8): Fix nbytes/nchars typo.
6904 * alloc.c (Fmake_string): Check for out-of-range init.
6906 2011-06-15 Stefan Monnier <monnier@iro.umontreal.ca>
6908 * eval.c (Fdefvaralias): Also mark the target as variable-special-p.
6910 2011-06-14 Jan Djärv <jan.h.d@swipnet.se>
6912 * xfns.c (x_set_scroll_bar_default_width): Remove argument to
6913 xg_get_default_scrollbar_width.
6915 * gtkutil.c: Include emacsgtkfixed.h if HAVE_GTK3.
6916 (int_gtk_range_get_value): Move to the scroll bar part of the file.
6917 (style_changed_cb): Call update_theme_scrollbar_width and call
6918 x_set_scroll_bar_default_width and xg_frame_set_char_size for
6919 all frames (Bug#8505).
6920 (xg_create_frame_widgets): Call emacs_fixed_new if HAVE_GTK3 (Bug#8505).
6921 Call gtk_window_set_resizable if HAVE_GTK3.
6922 (x_wm_set_size_hint): Call emacs_fixed_set_min_size with min width
6923 and height if HAVE_GTK3 (Bug#8505).
6924 (scroll_bar_width_for_theme): New variable.
6925 (update_theme_scrollbar_width): New function.
6926 (xg_get_default_scrollbar_width): Move code to
6927 update_theme_scrollbar_width, just return scroll_bar_width_for_theme.
6928 (xg_initialize): Call update_theme_scrollbar_width.
6930 * gtkutil.h (xg_get_default_scrollbar_width): Remove argument.
6932 * emacsgtkfixed.c, emacsgtkfixed.h: New files.
6934 2011-06-12 Martin Rudalics <rudalics@gmx.at>
6936 * frame.c (make_frame): Call other_buffer_safely instead of
6939 * window.c (temp_output_buffer_show): Call display_buffer with
6940 second argument Vtemp_buffer_show_specifiers and reset latter
6941 immediately after the call.
6942 (Vtemp_buffer_show_specifiers): New variable.
6943 (auto_window_vscroll_p, next_screen_context_lines)
6944 (Vscroll_preserve_screen_position): Remove leading asterisks from
6947 2011-06-12 Paul Eggert <eggert@cs.ucla.edu>
6949 Fix minor problems found by GCC 4.6.0 static checking.
6950 * buffer.c (Qclone_number): Remove for now, as it's unused.
6951 (record_buffer, Funrecord_buffer): Rename local to avoid shadowing.
6952 (record_buffer): Remove unused local.
6953 * frame.c (other_visible_frames, frame_buffer_list): Now static.
6954 (set_frame_buffer_list): Remove; unused.
6955 * frame.h (other_visible_frames): Remove decl.
6956 * keyboard.h (menu_items_inuse): Declare only if USE_GTK || USE_MOTIF.
6957 * lisp.h (frame_buffer_list, set_frame_buffer_list): Remove decls.
6958 (add_gpm_wait_descriptor, delete_gpm_wait_descriptor): Declare only
6960 * menu.c (menu_items_inuse): Now static unless USE_GTK || USE_MOTIF.
6961 * process.c (add_gpm_wait_descriptor, delete_gpm_wait_descriptor):
6962 Define only if HAVE_GPM.
6963 * widget.c (EmacsFrameResize, emacsFrameClassRec): Now static.
6964 (update_hints_inhibit): Remove; never set. All uses removed.
6965 * widgetprv.h (emacsFrameClassRec): Remove decl.
6966 * window.c (delete_deletable_window): Now returns void, since it
6967 wasn't returning anything.
6968 (compare_window_configurations): Remove unused locals.
6969 * xfns.c (x_set_scroll_bar_default_width): Remove unused locals.
6970 * xmenu.c (x_menu_set_in_use): Define only if USE_GTK || USE_MOTIF.
6971 (dialog_selection_callback) [!USE_GTK]: Prefer intptr_t for integers
6972 the same widths as pointers. This follows up on the 2011-05-06 patch.
6973 * xterm.c (x_alloc_lighter_color_for_widget): Define only if USE_LUCID.
6974 * xterm.h: Likewise.
6975 (x_menu_set_in_use): Declare only if USE_GTK || USE_MOTIF.
6977 2011-06-12 Juanma Barranquero <lekktu@gmail.com>
6979 * makefile.w32-in: Update dependencies.
6980 (LISP_H): Add lib/intprops.h.
6982 2011-06-11 Chong Yidong <cyd@stupidchicken.com>
6984 * image.c (gif_load): Add animation frame delay to the metadata.
6985 (syms_of_image): Use DEFSYM. New symbol `delay'.
6987 2011-06-11 Martin Rudalics <rudalics@gmx.at>
6989 * window.c (delete_deletable_window): Re-add.
6990 (Fset_window_configuration): Rewrite to handle dead buffers and
6991 consequently deletable windows.
6992 (window_tree, Fwindow_tree): Remove. Supply functionality in
6994 (compare_window_configurations): Simplify code.
6996 2011-06-11 Andreas Schwab <schwab@linux-m68k.org>
6998 * image.c (imagemagick_load_image): Fix type mismatch.
6999 (Fimagemagick_types): Likewise.
7001 * window.h (replace_buffer_in_windows): Declare.
7003 2011-06-11 Martin Rudalics <rudalics@gmx.at>
7005 * buffer.c: New Lisp objects Qbuffer_list_update_hook and
7006 Qclone_number. Remove external declaration of Qdelete_window.
7007 (Fbuffer_list): Rewrite doc-string. Minor restructuring of
7009 (Fget_buffer_create, Fmake_indirect_buffer, Frename_buffer):
7010 Run Qbuffer_list_update_hook if allowed.
7011 (Fother_buffer): Rewrite doc-string. Major rewrite for new
7012 buffer list implementation.
7013 (other_buffer_safely): New function.
7014 (Fkill_buffer): Replace call to replace_buffer_in_all_windows by
7015 calls to replace_buffer_in_windows and
7016 replace_buffer_in_windows_safely. Run Qbuffer_list_update_hook
7018 (record_buffer): Inhibit quitting and rewrite using quittable
7019 functions. Run Qbuffer_list_update_hook if allowed.
7020 (Frecord_buffer, Funrecord_buffer): New functions.
7021 (switch_to_buffer_1, Fswitch_to_buffer): Remove.
7022 Move switch-to-buffer to window.el.
7023 (bury-buffer): Move to window.el.
7024 (Vbuffer_list_update_hook): New variable.
7026 * lisp.h (other_buffer_safely): Add prototype in buffer.c
7029 * window.h (resize_frame_windows): Move up in code.
7030 (Fwindow_frame): Remove EXFUN.
7031 (replace_buffer_in_all_windows): Remove prototype.
7032 (replace_buffer_in_windows_safely): Add prototype.
7034 * window.c: Declare Qdelete_window static again. Move down
7035 declaration of select_count.
7036 (Fnext_window, Fprevious_window): Rewrite doc-strings.
7037 (Fother_window): Move to window.el.
7038 (window_loop): Remove DELETE_BUFFER_WINDOWS and UNSHOW_BUFFER
7039 cases. Add REPLACE_BUFFER_IN_WINDOWS_SAFELY case.
7040 (Fdelete_windows_on, Freplace_buffer_in_windows): Move to
7042 (replace_buffer_in_windows): Implement by calling
7043 Qreplace_buffer_in_windows.
7044 (replace_buffer_in_all_windows): Remove with some functionality
7045 moved into replace_buffer_in_windows_safely.
7046 (replace_buffer_in_windows_safely): New function.
7047 (select_window_norecord, select_frame_norecord): Move in front
7048 of run_window_configuration_change_hook. Remove now obsolete
7050 (Fset_window_buffer): Rewrite doc-string.
7051 Call Qrecord_window_buffer.
7052 (keys_of_window): Move binding for other-window to window.el.
7054 2011-06-11 Chong Yidong <cyd@stupidchicken.com>
7056 * dispextern.h (struct image): Replace data member, whose int_val
7057 and ptr_val fields were not used by anything, with a single
7060 * image.c (Fimage_metadata, make_image, mark_image, tiff_load)
7061 (gif_clear_image, gif_load, imagemagick_load_image)
7062 (gs_clear_image, gs_load): Callers changed.
7064 2011-06-10 Paul Eggert <eggert@cs.ucla.edu>
7066 * buffer.h: Include <time.h>, for time_t.
7067 Needed to build on FreeBSD 8.2. Problem reported by Herbert J. Skuhra.
7069 Fix minor problems found by static checking.
7071 * image.c (PixelGetMagickColor): Declare if ImageMagick headers don't.
7073 Make identifiers static if they are not used in other modules.
7074 * data.c (Qcompiled_function, Qframe, Qvector):
7075 * image.c (QimageMagick, Qsvg):
7076 * minibuf.c (Qmetadata):
7077 * window.c (resize_window_check, resize_root_window): Now static.
7078 * window.h (resize_window_check, resize_root_window): Remove decls.
7080 * window.c (window_deletion_count, delete_deletable_window):
7082 (window_body_lines): Now static.
7083 (Fdelete_other_windows_internal): Mark vars as initialized.
7084 Make sure 'resize_failed' is initialized.
7085 (run_window_configuration_change_hook): Rename local to avoid shadowing.
7086 (resize_window_apply): Remove unused local.
7087 * window.h (delete_deletable_window): Remove decl.
7089 * image.c (gif_load, svg_load_image): Rename locals to avoid shadowing.
7090 (imagemagick_load_image): Fix pointer signedness problem by changing
7091 last arg from unsigned char * to char *. All uses changed.
7092 Also, fix a local for similar reasons.
7093 Remove unused locals. Remove locals to avoid shadowing.
7094 (fn_rsvg_handle_free): Remove; unused.
7095 (svg_load, svg_load_image): Fix pointer signedness problem.
7096 (imagemagick_load_image): Don't use garbage pointer image_wand.
7098 * ftfont.c (ftfont_get_metrics, ftfont_drive_otf): Remove unused locals.
7100 2011-06-10 Chong Yidong <cyd@stupidchicken.com>
7102 * image.c (gif_load): Fix omitted cast error introduced by
7105 2011-06-10 Martin Rudalics <rudalics@gmx.at>
7107 * window.h (resize_proportionally, orig_total_lines)
7108 (orig_top_line): Remove from window structure.
7109 (set_window_height, set_window_width, change_window_heights)
7110 (Fdelete_window): Remove prototypes.
7111 (resize_frame_windows): Remove duplicate declaration.
7113 2011-06-10 Eli Zaretskii <eliz@gnu.org>
7115 * window.h (resize_frame_windows, resize_window_check)
7116 (delete_deletable_window, resize_root_window)
7117 (resize_frame_windows): Declare prototypes.
7119 * window.c (resize_window_apply): Make definition be "static" to
7120 match the prototype.
7122 2011-06-10 Martin Rudalics <rudalics@gmx.at>
7124 * window.c: Remove declarations of Qwindow_size_fixed,
7125 window_min_size_1, window_min_size_2, window_min_size,
7126 size_window, window_fixed_size_p, enlarge_window, delete_window.
7127 Remove static from declaration of Qdelete_window, it's
7128 temporarily needed by Fbury_buffer.
7129 (replace_window): Don't assign orig_top_line and
7131 (Fdelete_window, delete_window): Remove. Window deletion is
7132 handled by window.el.
7133 (window_loop): Remove DELETE_OTHER_WINDOWS case.
7134 Replace Fdelete_window calls with calls to Qdelete_window.
7135 (Fdelete_other_windows): Remove. Deleting other windows is
7136 handled by window.el.
7137 (window_fixed_size_p): Remove. Fixed-sizeness of windows is
7138 handled in window.el.
7139 (window_min_size_2, window_min_size_1, window_min_size): Remove.
7140 Window minimum sizes are handled in window.el.
7141 (shrink_windows, size_window, set_window_height)
7142 (set_window_width, change_window_heights, window_height)
7143 (window_width, CURBEG, CURSIZE, enlarge_window)
7144 (adjust_window_trailing_edge, Fadjust_window_trailing_edge)
7145 (Fenlarge_window, Fshrink_window): Remove. Window resizing is
7146 handled in window.el.
7147 (make_dummy_parent): Rename to make_parent_window and give it a
7148 second argument horflag.
7149 (make_window): Don't set resize_proportionally any more.
7150 (Fsplit_window): Remove. Windows are split in window.el.
7151 (save_restore_action, save_restore_orig_size)
7152 (shrink_window_lowest_first, save_restore_orig_size): Remove.
7153 Resize mini windows in window.el.
7154 (grow_mini_window, shrink_mini_window): Implement by calling
7155 Qresize_root_window_vertically, resize_window_check and
7156 resize_window_apply.
7157 (saved_window, Fset_window_configuration, save_window_save):
7158 Do not handle orig_top_line, orig_total_lines, and
7159 resize_proportionally.
7160 (window_min_height, window_min_width): Move to window.el.
7161 (keys_of_window): Move bindings for delete-other-windows,
7162 split-window, delete-window and enlarge-window to window.el.
7164 * buffer.c: Temporarily extern Qdelete_window.
7165 (Fbury_buffer): Temporarily call Qdelete_window instead of
7166 Fdelete_window (Fbury_buffer will move to window.el soon).
7168 * frame.c (set_menu_bar_lines_1): Remove code handling
7169 orig_top_line and orig_total_lines.
7171 * dispnew.c (adjust_frame_glyphs_initially): Don't use
7172 set_window_height but set heights directly.
7173 (change_frame_size_1): Use resize_frame_windows.
7175 * xdisp.c (init_xdisp): Don't use set_window_height but set
7178 * xfns.c (x_set_menu_bar_lines, x_set_tool_bar_lines):
7179 Use resize_frame_windows instead of change_window_heights and run
7180 run_window_configuration_change_hook.
7182 * w32fns.c (x_set_tool_bar_lines): Use resize_frame_windows
7183 instead of change_window_heights and run
7184 run_window_configuration_change_hook.
7186 2011-06-09 Martin Rudalics <rudalics@gmx.at>
7188 * window.c (replace_window): Rename second argument REPLACEMENT to
7189 NEW. New third argument SETFLAG. Rewrite.
7190 (delete_window, make_dummy_parent): Call replace_window with
7192 (window_list_1): Move down in code.
7193 (run_window_configuration_change_hook): Move set_buffer part
7194 before select_frame_norecord part in order to unwind correctly.
7195 Rename count1 to count.
7196 (recombine_windows, delete_deletable_window, resize_root_window)
7197 (Fdelete_other_windows_internal)
7198 (Frun_window_configuration_change_hook, make_parent_window)
7199 (resize_window_check, resize_window_apply, Fresize_window_apply)
7200 (resize_frame_windows, Fsplit_window_internal)
7201 (Fdelete_window_internal, Fresize_mini_window_internal):
7203 (syms_of_window): New variables Vwindow_splits and Vwindow_nest.
7205 2011-06-08 Martin Rudalics <rudalics@gmx.at>
7207 * window.h (window): Add some new members to window structure -
7208 normal_lines, normal_cols, new_total, new_normal, clone_number,
7209 splits, nest, prev_buffers, next_buffers.
7210 (WINDOW_TOTAL_SIZE): Move here from window.c.
7211 (MIN_SAFE_WINDOW_WIDTH, MIN_SAFE_WINDOW_HEIGHT): Define here.
7213 * window.c (Fwindow_height, Fwindow_width, Fwindow_full_width_p):
7215 (make_dummy_parent): Set new members of windows structure.
7216 (make_window): Move down in code. Handle new members of window
7218 (Fwindow_clone_number, Fwindow_splits, Fset_window_splits)
7219 (Fwindow_nest, Fset_window_nest, Fwindow_new_total)
7220 (Fwindow_normal_size, Fwindow_new_normal, Fwindow_prev_buffers)
7221 (Fset_window_prev_buffers, Fwindow_next_buffers)
7222 (Fset_window_next_buffers, Fset_window_clone_number):
7224 (Fwindow_hscroll, Fwindow_at, Fwindow_point, Fwindow_start)
7225 (Fwindow_end, Fwindow_line_height, Fset_window_dedicated_p):
7227 (Fwindow_parameters, Fwindow_parameter, Fset_window_parameter):
7228 Argument WINDOW can be now internal window too.
7229 (Fwindow_use_time): Move up in code.
7230 (Fget_buffer_window): Rename argument FRAME to ALL-FRAMES.
7232 (Fset_window_configuration, saved_window)
7233 (Fcurrent_window_configuration, save_window_save): Handle new
7234 members of window structure.
7235 (WINDOW_TOTAL_SIZE, MIN_SAFE_WINDOW_WIDTH)
7236 (MIN_SAFE_WINDOW_HEIGHT): Move to window.h.
7237 (syms_of_window): New Lisp objects Qrecord_window_buffer,
7238 Qwindow_deletable_p, Qdelete_window, Qreplace_buffer_in_windows,
7239 Qget_mru_window, Qresize_root_window,
7240 Qresize_root_window_vertically, Qsafe, Qabove, Qbelow,
7241 Qauto_buffer_name; staticpro them.
7243 2011-06-07 Martin Rudalics <rudalics@gmx.at>
7245 * window.c (Fwindow_total_size, Fwindow_left_column)
7246 (Fwindow_top_line, window_body_lines, Fwindow_body_size)
7247 (Fwindow_list_1): New functions.
7248 (window_box_text_cols): Replace with window_body_cols.
7249 (Fwindow_width, Fscroll_left, Fscroll_right):
7250 Use window_body_cols instead of window_box_text_cols.
7251 (delete_window, Fset_window_configuration):
7252 Call delete_all_subwindows with window as argument.
7253 (delete_all_subwindows): Take a window as argument and not a
7255 (window_loop): Remove handling of GET_LRU_WINDOW and
7257 (Fget_lru_window, Fget_largest_window): Move to window.el.
7259 * window.h: Extern window_body_cols instead of
7260 window_box_text_cols. delete_all_subwindows now takes a
7261 Lisp_Object as argument.
7263 * indent.c (compute_motion, Fcompute_motion):
7264 Use window_body_cols instead of window_box_text_cols.
7266 * frame.c (delete_frame): Call delete_all_subwindows with root
7269 2011-06-07 Daniel Colascione <dan.colascione@gmail.com>
7271 * fns.c (Fputhash): Document return value.
7273 2011-06-06 Chong Yidong <cyd@stupidchicken.com>
7275 * image.c (gif_load): Implement gif89a spec "no disposal" method.
7277 2011-06-06 Paul Eggert <eggert@cs.ucla.edu>
7279 Cons<->int and similar integer overflow fixes (Bug#8794).
7281 Check for overflow when converting integer to cons and back.
7282 * charset.c (Fdefine_charset_internal, Fdecode_char):
7283 Use cons_to_unsigned to catch overflow.
7284 (Fencode_char): Use INTEGER_TO_CONS.
7285 * composite.h (LGLYPH_CODE): Use cons_to_unsigned.
7286 (LGLYPH_SET_CODE): Use INTEGER_TO_CONS.
7287 * data.c (long_to_cons, cons_to_long): Remove.
7288 (cons_to_unsigned, cons_to_signed): New functions.
7289 These signal an error for invalid or out-of-range values.
7290 * dired.c (Ffile_attributes): Use INTEGER_TO_CONS.
7291 * fileio.c (Fset_visited_file_modtime): Use CONS_TO_INTEGER.
7292 * font.c (Ffont_variation_glyphs):
7293 * fontset.c (Finternal_char_font): Use INTEGER_TO_CONS.
7294 * lisp.h: Include <intprops.h>.
7295 (INTEGER_TO_CONS, CONS_TO_INTEGER): New macros.
7296 (cons_to_signed, cons_to_unsigned): New decls.
7297 (long_to_cons, cons_to_long): Remove decls.
7298 * undo.c (record_first_change): Use INTEGER_TO_CONS.
7299 (Fprimitive_undo): Use CONS_TO_INTEGER.
7300 * xfns.c (Fx_window_property): Likewise.
7301 * xselect.c: Include <limits.h>.
7302 (x_own_selection, selection_data_to_lisp_data):
7303 Use INTEGER_TO_CONS.
7304 (x_handle_selection_request, x_handle_selection_clear)
7305 (x_get_foreign_selection, Fx_disown_selection_internal)
7306 (Fx_get_atom_name, x_send_client_event): Use CONS_TO_INTEGER.
7307 (lisp_data_to_selection_data): Use cons_to_unsigned.
7308 (x_fill_property_data): Use cons_to_signed.
7309 Report values out of range.
7311 Check for buffer and string overflow more precisely.
7312 * buffer.h (BUF_BYTES_MAX): New macro.
7313 * lisp.h (STRING_BYTES_MAX): New macro.
7314 * alloc.c (Fmake_string):
7315 * character.c (string_escape_byte8):
7316 * coding.c (coding_alloc_by_realloc):
7317 * doprnt.c (doprnt):
7318 * editfns.c (Fformat):
7320 Use STRING_BYTES_MAX, not MOST_POSITIVE_FIXNUM,
7321 since they may not be the same number.
7322 * editfns.c (Finsert_char):
7323 * fileio.c (Finsert_file_contents):
7324 Likewise for BUF_BYTES_MAX.
7326 * image.c: Use ptrdiff_t, not int, for sizes.
7327 (slurp_file): Switch from int to ptrdiff_t.
7329 (slurp_file): Check that file size fits in both size_t (for
7330 malloc) and ptrdiff_t (for sanity and safety).
7332 * fileio.c (Fverify_visited_file_modtime): Avoid time overflow
7333 if b->modtime has its maximal value.
7335 * dired.c (Ffile_attributes): Don't assume EMACS_INT has >32 bits.
7337 Don't assume time_t can fit into int.
7338 * buffer.h (struct buffer.modtime): Now time_t, not int.
7339 * fileio.c (Fvisited_file_modtime): No need for time_t cast now.
7340 * undo.c (Fprimitive_undo): Use time_t, not int, for time_t value.
7342 Minor fixes for signed vs unsigned integers.
7343 * character.h (MAYBE_UNIFY_CHAR):
7344 * charset.c (maybe_unify_char):
7345 * keyboard.c (read_char, reorder_modifiers):
7346 XINT -> XFASTINT, since the integer must be nonnegative.
7347 * ftfont.c (ftfont_spec_pattern):
7348 * keymap.c (access_keymap, silly_event_symbol_error):
7349 XUINT -> XFASTINT, since the integer must be nonnegative.
7350 (Fsingle_key_description, preferred_sequence_p): XUINT -> XINT,
7351 since it makes no difference and we prefer signed.
7352 * keyboard.c (record_char): Use XUINT when all the neighbors do.
7353 (access_keymap): NATNUMP -> INTEGERP, since the integer must be
7356 2011-06-06 Stefan Monnier <monnier@iro.umontreal.ca>
7358 * window.h (Fwindow_frame): Declare.
7360 2011-06-06 Paul Eggert <eggert@cs.ucla.edu>
7362 * alloc.c: Simplify handling of large-request failures (Bug#8800).
7363 (SPARE_MEMORY): Always define.
7364 (LARGE_REQUEST): Remove.
7365 (memory_full): Use SPARE_MEMORY rather than LARGE_REQUEST.
7367 2011-06-06 Martin Rudalics <rudalics@gmx.at>
7369 * lisp.h: Move EXFUNS for Fframe_root_window,
7370 Fframe_first_window and Fset_frame_selected_window to window.h.
7372 * window.h: Move EXFUNS for Fframe_root_window,
7373 Fframe_first_window and Fset_frame_selected_window here from
7376 * frame.c (Fwindow_frame, Fframe_first_window)
7377 (Fframe_root_window, Fframe_selected_window)
7378 (Fset_frame_selected_window): Move to window.c.
7379 (Factive_minibuffer_window): Move to minibuf.c.
7380 (Fother_visible_frames_p): New function.
7382 * minibuf.c (Factive_minibuffer_window): Move here from frame.c.
7384 * window.c (decode_window, decode_any_window): Move up in code.
7385 (Fwindowp, Fwindow_live_p): Rewrite doc-strings.
7386 (inhibit_frame_unsplittable): Remove unused variable.
7387 (Fwindow_buffer): Move up and rewrite doc-string.
7388 (Fwindow_parent, Fwindow_vchild, Fwindow_hchild, Fwindow_next)
7389 (Fwindow_prev): New functions.
7390 (Fwindow_frame): Move here from frame.c. Accept any window as
7392 (Fframe_root_window, Fframe_first_window)
7393 (Fframe_selected_window): Move here from frame.c. Accept frame
7394 or arbitrary window as argument. Update doc-strings.
7395 (Fminibuffer_window): Move up in code.
7396 (Fwindow_minibuffer_p): Move up in code and simplify.
7397 (Fset_frame_selected_window): Move here from frame.c.
7399 (Fselected_window, select_window, Fselect_window): Move up in
7400 code. Minor doc-string fixes.
7402 2011-06-06 Paul Eggert <eggert@cs.ucla.edu>
7404 * alloc.c (memory_full) [SYSTEM_MALLOC]: Port to MacOS (Bug#8800).
7405 Do not assume that spare memory exists; that assumption is valid
7406 only if SYSTEM_MALLOC.
7407 (LARGE_REQUEST): New macro, so that the issue of large requests
7408 is separated from the issue of spare memory.
7410 2011-06-05 Andreas Schwab <schwab@linux-m68k.org>
7412 * editfns.c (Fformat): Correctly handle zero flag with hexadecimal
7415 * gtkutil.c (xg_get_default_scrollbar_width): Avoid warning.
7417 * xfns.c (x_set_scroll_bar_default_width): Move declarations
7420 2011-06-05 Jan Djärv <jan.h.d@swipnet.se>
7422 * gtkutil.c (xg_get_default_scrollbar_width): New function.
7424 * gtkutil.h: Declare xg_get_default_scrollbar_width.
7426 * xfns.c (x_set_scroll_bar_default_width): If USE_GTK, get
7427 min width by calling x_set_scroll_bar_default_width (Bug#8505).
7429 2011-06-05 Juanma Barranquero <lekktu@gmail.com>
7431 * xdisp.c (single_display_spec_intangible_p): Remove declaration.
7433 2011-06-04 Chong Yidong <cyd@stupidchicken.com>
7435 * xselect.c (x_clipboard_manager_save): Remove redundant arg.
7436 (x_clipboard_manager_save): Add return value.
7437 (x_clipboard_manager_error_1, x_clipboard_manager_error_2):
7439 (x_clipboard_manager_save_frame, x_clipboard_manager_save_all):
7440 Obey Vx_select_enable_clipboard_manager. Catch errors in
7441 x_clipboard_manager_save (Bug#8779).
7442 (Vx_select_enable_clipboard_manager): New variable.
7443 (x_get_foreign_selection): Reduce scope of x_catch_errors (Bug#8790).
7445 2011-06-04 Dan Nicolaescu <dann@ics.uci.edu>
7447 * emacs.c (main): Warn when starting a GTK emacs in daemon mode.
7449 2011-06-04 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
7451 * fringe.c (update_window_fringes): Don't update overlay arrow bitmap
7452 in the current matrix if keep_current_p is non-zero.
7454 2011-06-04 Eli Zaretskii <eliz@gnu.org>
7456 * bidi.c (bidi_level_of_next_char): Fix last change.
7458 2011-06-03 Eli Zaretskii <eliz@gnu.org>
7460 Support bidi reordering of text covered by display properties.
7462 * bidi.c (bidi_copy_it): Use offsetof instead of emulating it.
7463 (bidi_fetch_char, bidi_fetch_char_advance): New functions.
7464 (bidi_cache_search, bidi_cache_iterator_state)
7465 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak)
7466 (bidi_level_of_next_char, bidi_move_to_visually_next):
7467 Support character positions inside a run of characters covered by a
7469 (bidi_paragraph_init, bidi_resolve_explicit_1)
7470 (bidi_level_of_next_char): Call bidi_fetch_char and
7471 bidi_fetch_char_advance instead of FETCH_CHAR and
7473 (bidi_init_it): Initialize new members.
7474 (LRE_CHAR, RLE_CHAR, PDF_CHAR, LRO_CHAR, RLO_CHAR): Remove macro
7476 (bidi_explicit_dir_char): Lookup character type in bidi_type_table,
7477 instead of using explicit *_CHAR codes.
7478 (bidi_resolve_explicit, bidi_resolve_weak):
7479 Use FETCH_MULTIBYTE_CHAR instead of FETCH_CHAR, as reordering of
7480 bidirectional text is supported only in multibyte buffers.
7481 (bidi_init_it): Accept additional argument FRAME_WINDOW_P and use
7482 it to initialize the frame_window_p member of struct bidi_it.
7483 (bidi_cache_iterator_state, bidi_resolve_explicit_1)
7484 (bidi_resolve_explicit, bidi_resolve_weak)
7485 (bidi_level_of_next_char, bidi_move_to_visually_next): Abort if
7486 bidi_it->nchars is non-positive.
7487 (bidi_level_of_next_char): Don't try to lookup the cache for the
7488 next/previous character if nothing is cached there yet, or if we
7489 were just reseat()'ed to a new position.
7491 * xdisp.c (set_cursor_from_row): Set start and stop points
7492 according to the row's direction when priming the loop that looks
7493 for the glyph on which to display cursor.
7494 (single_display_spec_intangible_p): Function deleted.
7495 (display_prop_intangible_p): Reimplement to call
7496 handle_display_spec instead of single_display_spec_intangible_p.
7497 Accept 3 additional arguments needed by handle_display_spec.
7498 This fixes incorrect cursor motion across display property with complex
7499 values: lists, `(when COND...)' forms, etc.
7500 (single_display_spec_string_p): Support property values that are
7501 lists with the argument STRING its top-level element.
7502 (display_prop_string_p): Fix the condition for processing a
7503 property that is a list to be consistent with handle_display_spec.
7504 (handle_display_spec): New function, refactored from the
7505 last portion of handle_display_prop.
7506 (compute_display_string_pos): Accept additional argument
7507 FRAME_WINDOW_P. Call handle_display_spec to determine whether the
7508 value of a `display' property is a "replacing spec".
7509 (handle_single_display_spec): Accept 2 additional arguments BUFPOS
7510 and FRAME_WINDOW_P. If IT is NULL, don't set up the iterator from
7511 the display property, but just return a value indicating whether
7512 the display property will replace the characters it covers.
7513 (Fcurrent_bidi_paragraph_direction): Initialize the nchars and
7514 frame_window_p members of struct bidi_it.
7515 (compute_display_string_pos, compute_display_string_end):
7517 (push_it): Accept second argument POSITION, where pop_it should
7518 jump to continue iteration.
7519 (reseat_1): Initialize bidi_it.disp_pos.
7521 * keyboard.c (adjust_point_for_property): Adjust the call to
7522 display_prop_intangible_p to its new signature.
7524 * dispextern.h (struct bidi_it): New member frame_window_p.
7525 (bidi_init_it): Update prototypes.
7526 (display_prop_intangible_p): Update prototype.
7527 (compute_display_string_pos, compute_display_string_end):
7529 (struct bidi_it): New members nchars and disp_pos. ch_len is now
7532 2011-06-02 Paul Eggert <eggert@cs.ucla.edu>
7534 Malloc failure behavior now depends on size of allocation.
7535 * alloc.c (buffer_memory_full, memory_full): New arg NBYTES.
7536 * lisp.h: Change signatures accordingly.
7537 * alloc.c, buffer.c, editfns.c, menu.c, minibuf.c, xterm.c:
7538 All callers changed. (Bug#8762)
7540 * gnutls.c: Use Emacs's memory allocators.
7541 Without this change, the gnutls library would invoke malloc etc.
7542 directly, which causes problems on non-SYNC_INPUT hosts, and which
7543 runs afoul of improving memory_full behavior. (Bug#8761)
7544 (fn_gnutls_global_set_mem_functions): New macro or function pointer.
7545 (emacs_gnutls_global_init): Use it to specify xmalloc, xrealloc,
7546 xfree instead of the default malloc, realloc, free.
7547 (Fgnutls_boot): No need to check for memory allocation failure,
7548 since xmalloc does that for us.
7550 Remove arbitrary limit of 2**31 entries in hash tables. (Bug#8771)
7551 * category.c (hash_get_category_set):
7552 * ccl.c (ccl_driver):
7553 * charset.c (Fdefine_charset_internal):
7554 * charset.h (struct charset.hash_index):
7555 * composite.c (get_composition_id, gstring_lookup_cache)
7556 (composition_gstring_put_cache):
7557 * composite.h (struct composition.hash_index):
7558 * dispextern.h (struct image.hash):
7559 * fns.c (next_almost_prime, larger_vector, cmpfn_eql)
7560 (cmpfn_equal, cmpfn_user_defined, hashfn_eq, hashfn_eql)
7561 (hashfn_equal, hashfn_user_defined, make_hash_table)
7562 (maybe_resize_hash_table, hash_lookup, hash_put)
7563 (hash_remove_from_table, hash_clear, sweep_weak_table, SXHASH_COMBINE)
7564 (sxhash_string, sxhash_list, sxhash_vector, sxhash_bool_vector)
7565 (Fsxhash, Fgethash, Fputhash, Fmaphash):
7566 * image.c (make_image, search_image_cache, lookup_image)
7567 (xpm_put_color_table_h):
7568 * lisp.h (struct Lisp_Hash_Table):
7569 * minibuf.c (Ftry_completion, Fall_completions, Ftest_completion):
7570 * print.c (print): Use 'EMACS_UINT' and 'EMACS_INT'
7571 for hashes and hash indexes, instead of 'unsigned' and 'int'.
7572 * alloc.c (allocate_vectorlike):
7573 Check for overflow in vector size calculations.
7574 * ccl.c (ccl_driver):
7575 Check for overflow when converting EMACS_INT to int.
7576 * fns.c, image.c: Remove unnecessary static decls that would otherwise
7577 need to be updated by these changes.
7578 * fns.c (make_hash_table, maybe_resize_hash_table):
7579 Check for integer overflow with large hash tables.
7580 (make_hash_table, maybe_resize_hash_table, Fmake_hash_table):
7581 Prefer the faster XFLOAT_DATA to XFLOATINT where either will do.
7582 (SXHASH_REDUCE): New macro.
7583 (sxhash_string, sxhash_list, sxhash_vector, sxhash_bool_vector):
7584 Use it instead of discarding useful hash info with large hash values.
7585 (sxhash_float): New function.
7586 (sxhash): Use it. No more need for "& INTMASK" due to above changes.
7587 * lisp.h (FIXNUM_BITS): New macro, useful for SXHASH_REDUCE etc.
7588 (MOST_NEGATIVE_FIXNUM, MOST_POSITIVE_FIXNUM, INTMASK):
7589 Rewrite to use FIXNUM_BITS, as this simplifies things.
7590 (next_almost_prime, larger_vector, sxhash, hash_lookup, hash_put):
7591 Adjust signatures to match updated version of code.
7592 (consing_since_gc): Now EMACS_INT, since a single hash table can
7593 use more than INT_MAX bytes.
7595 2011-06-01 Dan Nicolaescu <dann@ics.uci.edu>
7597 Make it possible to build with GCC-4.6+ -O2 -flto.
7599 * emacs.c (__malloc_initialize_hook): Mark as EXTERNALLY_VISIBLE.
7601 2011-06-01 Stefan Monnier <monnier@iro.umontreal.ca>
7603 * minibuf.c (get_minibuffer, read_minibuf_unwind):
7604 Call minibuffer-inactive-mode.
7606 2011-05-31 Juanma Barranquero <lekktu@gmail.com>
7608 * makefile.w32-in ($(BLD)/data.$(O), $(BLD)/editfns.$(O)):
7609 Update dependencies.
7611 2011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
7613 * data.c (init_data): Remove code for UTS, this system is not
7616 2011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
7618 Don't force ./temacs to start in terminal mode.
7620 * frame.c (make_initial_frame): Initialize faces in all cases, not
7621 only when CANNOT_DUMP is defined.
7622 * dispnew.c (init_display): Remove CANNOT_DUMP condition.
7624 2011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
7626 * dispnew.c (add_window_display_history): Use const for the string
7627 pointer. Remove declaration, not needed.
7629 2011-05-31 Paul Eggert <eggert@cs.ucla.edu>
7631 Use 'inline', not 'INLINE'.
7632 <http://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00914.html>
7633 * alloc.c, fontset.c (INLINE): Remove.
7634 * alloc.c, bidi.c, charset.c, coding.c, dispnew.c, fns.c, image.c:
7635 * intervals.c, keyboard.c, process.c, syntax.c, textprop.c, w32term.c:
7636 * xdisp.c, xfaces.c, xterm.c: Replace all uses of INLINE with inline.
7637 * gmalloc.c (register_heapinfo): Use inline unconditionally.
7638 * lisp.h (LISP_MAKE_RVALUE): Use inline, not __inline__.
7640 2011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
7642 Make it possible to run ./temacs.
7644 * callproc.c (set_initial_environment): Remove CANNOT_DUMP code,
7645 syms_of_callproc does the same thing. Remove test for
7646 "initialized", do it in the caller.
7647 * emacs.c (main): Avoid calling set_initial_environment when dumping.
7649 2011-05-31 Stefan Monnier <monnier@iro.umontreal.ca>
7651 * minibuf.c (Finternal_complete_buffer): Return `category' metadata.
7652 (read_minibuf): Use get_minibuffer.
7653 (syms_of_minibuf): Use DEFSYM.
7654 (Qmetadata): New var.
7655 * data.c (Qbuffer): Don't make it static.
7656 (syms_of_data): Use DEFSYM.
7658 2011-05-31 Paul Eggert <eggert@cs.ucla.edu>
7660 * ccl.c (CCL_CODE_RANGE): Allow negative numbers. (Bug#8751)
7661 (CCL_CODE_MIN): New macro.
7663 2011-05-30 Paul Eggert <eggert@cs.ucla.edu>
7665 * alloc.c (lisp_align_malloc): Omit unnecessary val==NULL tests.
7667 * eval.c (Qdebug): Now static.
7668 * lisp.h (Qdebug): Remove decl. This reverts a part of the
7669 2011-04-26T11:26:05Z!dan.colascione@gmail.com that inadvertently undid part of
7670 2011-04-14T06:48:41Z!eggert@cs.ucla.edu.
7672 2011-05-29 Chong Yidong <cyd@stupidchicken.com>
7674 * image.c: Various fixes to ImageMagick code comments.
7675 (Fimagemagick_types): Doc fix.
7677 2011-05-29 Paul Eggert <eggert@cs.ucla.edu>
7679 Minor fixes prompted by GCC 4.6.0 warnings.
7681 * xselect.c (converted_selections, conversion_fail_tag): Now static.
7683 * emacs.c [HAVE_X_WINDOWS]: Include "xterm.h".
7684 (x_clipboard_manager_save_all): Move extern decl to ...
7685 * xterm.h: ... here, so that it can be checked for consistency.
7687 2011-05-29 Chong Yidong <cyd@stupidchicken.com>
7689 * xselect.c (x_clipboard_manager_save_frame)
7690 (x_clipboard_manager_save_all): New functions.
7691 (Fx_clipboard_manager_save): Lisp function deleted.
7693 * emacs.c (Fkill_emacs): Call x_clipboard_manager_save_all.
7694 * frame.c (delete_frame): Call x_clipboard_manager_save_frame.
7696 * xterm.h: Update prototype.
7698 2011-05-28 William Xu <william.xwl@gmail.com>
7700 * nsterm.m (ns_term_shutdown): Synchronize user defaults before
7703 2011-05-28 Jim Meyering <meyering@redhat.com>
7705 Avoid a sign-extension bug in crypto_hash_function.
7706 * fns.c (to_uchar): Define.
7707 (crypto_hash_function): Use it to convert some newly-signed
7708 variables to unsigned, to avoid sign-extension bugs. For example,
7709 without this change, (md5 "truc") would evaluate to
7710 45723a2aff78ff4fff7fff1114760e62 rather than the expected
7711 45723a2af3788c4ff17f8d1114760e62. Reported by Antoine Levitt in
7712 https://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00883.html.
7714 2011-05-27 Paul Eggert <eggert@cs.ucla.edu>
7716 Integer overflow fixes.
7718 * dbusbind.c: Serial number integer overflow fixes.
7719 (CHECK_DBUS_SERIAL_GET_SERIAL): New macro.
7720 (Fdbus_call_method_asynchronously, xd_read_message_1): Use a float
7721 to hold a serial number that is too large for a fixnum.
7722 (Fdbus_method_return_internal, Fdbus_method_error_internal):
7723 Check for serial numbers out of range. Decode any serial number
7724 that was so large that it became a float. (Bug#8722)
7726 * dbusbind.c: Use XFASTINT rather than XUINT, and check for nonneg.
7727 (Fdbus_call_method, Fdbus_call_method_asynchronously):
7728 Use XFASTINT rather than XUINT when numbers are nonnegative.
7729 (xd_append_arg, Fdbus_method_return_internal):
7730 (Fdbus_method_error_internal): Likewise. Also, for unsigned
7731 arguments, check that Lisp number is nonnegative, rather than
7732 silently wrapping negative numbers around. (Bug#8722)
7733 (xd_read_message_1): Don't assume dbus_uint32_t can fit in int.
7736 * data.c (arith_driver, Flsh): Avoid unnecessary casts to EMACS_UINT.
7738 * ccl.c (ccl_driver): Redo slightly to avoid the need for 'unsigned'.
7740 ccl: Add integer overflow checks.
7741 * ccl.c (CCL_CODE_MAX, GET_CCL_RANGE, GET_CCL_CODE, GET_CCL_INT):
7742 (IN_INT_RANGE): New macros.
7743 (ccl_driver): Use them to check for integer overflow when
7744 decoding a CCL program. Many of the new checks are whether XINT (x)
7745 fits in int; it doesn't always, on 64-bit hosts. The new version
7746 doesn't catch all possible integer overflows, but it's an
7747 improvement. (Bug#8719)
7749 * alloc.c (make_event_array): Use XINT, not XUINT.
7750 There's no need for unsigned here.
7752 * mem-limits.h (EXCEEDS_LISP_PTR) [!USE_LSB_TAG]: EMACS_UINT -> uintptr_t
7753 This follows up to the 2011-05-06 change that substituted uintptr_t
7754 for EMACS_INT. This case wasn't caught back then.
7756 Rework Fformat to avoid integer overflow issues.
7757 * editfns.c: Include <float.h> unconditionally, as it's everywhere
7758 now (part of C89). Include <verify.h>.
7759 (MAX_10_EXP, CONVERTED_BYTE_SIZE): Remove; no longer needed.
7760 (pWIDE, pWIDElen, signed_wide, unsigned_wide): New defns.
7761 (Fformat): Avoid the prepass trying to compute sizes; it was only
7762 approximate and thus did not catch overflow reliably. Instead, walk
7763 through the format just once, formatting and computing sizes as we go,
7764 checking for integer overflow at every step, and allocating a larger
7765 buffer as needed. Keep track separately whether the format is
7766 multibyte. Keep only the most-recently calculated precision, rather
7767 than them all. Record whether each argument has been converted to
7768 string. Use EMACS_INT, not int, for byte and char and arg counts.
7769 Support field widths and precisions larger than INT_MAX. Avoid
7770 sprintf's undefined behavior with conversion specifications such as %#d
7771 and %.0c. Fix bug with strchr succeeding on '\0' when looking for
7772 flags. Fix bug with (format "%c" 256.0). Avoid integer overflow when
7773 formatting out-of-range floating point numbers with int
7776 * lisp.h (FIXNUM_OVERFLOW_P): Work even if arg is a NaN.
7778 * data.c: Avoid integer truncation in expressions involving floats.
7779 * data.c: Include <intprops.h>.
7780 (arith_driver): When there's an integer overflow in an expression
7781 involving floating point, convert the integers to floating point
7782 so that the resulting value does not suffer from catastrophic
7783 integer truncation. For example, on a 64-bit host (* 4
7784 most-negative-fixnum 0.5) should yield about -4.6e+18, not zero.
7785 Do not rely on undefined behavior after integer overflow.
7787 merge count_size_as_multibyte, parse_str_to_multibyte
7788 * character.c, character.h (count_size_as_multibyte):
7789 Rename from parse_str_to_multibyte; all uses changed.
7790 Check for integer overflow.
7791 * insdel.c, lisp.h (count_size_as_multibyte): Remove,
7792 since it's now a duplicate of the other. This is more of
7793 a character than a buffer op, so better that it's in character.c.
7794 * fns.c, print.c: Adjust to above changes.
7796 2011-05-27 Stefan Monnier <monnier@iro.umontreal.ca>
7798 * xselect.c (x_convert_selection): Yet another int/Lisp_Object mixup.
7800 2011-05-27 Paul Eggert <eggert@cs.ucla.edu>
7802 * xselect.c: Fix minor problems prompted by GCC 4.6.0 warnings.
7803 (x_handle_selection_request, frame_for_x_selection): Remove unused vars.
7804 (x_clipboard_manager_save): Now static.
7805 (Fx_clipboard_manager_save): Rename local to avoid shadowing.
7807 * fns.c: Fix minor problems prompted by GCC 4.6.0 warnings.
7808 (crypto_hash_function): Now static.
7809 Fix pointer signedness problems. Avoid unnecessary initializations.
7811 2011-05-27 Chong Yidong <cyd@stupidchicken.com>
7813 * termhooks.h (Vselection_alist): Make it terminal-local.
7815 * terminal.c (create_terminal): Initialize it.
7817 * xselect.c: Support for clipboard managers.
7818 (Vselection_alist): Move to termhooks.h as terminal-local var.
7819 (LOCAL_SELECTION): New macro.
7820 (x_atom_to_symbol): Handle x_display_info_for_display fail case.
7821 (symbol_to_x_atom): Remove gratuitous arg.
7822 (x_handle_selection_request, lisp_data_to_selection_data)
7823 (x_get_foreign_selection, Fx_register_dnd_atom): Callers changed.
7824 (x_own_selection, x_get_local_selection, x_convert_selection):
7825 New arg, specifying work frame. Use terminal-local Vselection_alist.
7826 (some_frame_on_display): Delete unused function.
7827 (Fx_own_selection_internal, Fx_get_selection_internal)
7828 (Fx_disown_selection_internal, Fx_selection_owner_p)
7829 (Fx_selection_exists_p): New optional frame arg.
7830 (frame_for_x_selection, Fx_clipboard_manager_save): New functions.
7831 (x_handle_selection_clear): Don't treat other terminals with the
7832 same keyboard specially. Use the terminal-local Vselection_alist.
7833 (x_clear_frame_selections): Use Frun_hook_with_args.
7835 * xterm.c (x_term_init): Intern ATOM and CLIPBOARD_MANAGER atoms.
7837 * xterm.h: Add support for those atoms.
7839 2011-05-26 Chong Yidong <cyd@stupidchicken.com>
7841 * xselect.c: ICCCM-compliant handling of MULTIPLE targets.
7842 (converted_selections, conversion_fail_tag): New global variables.
7843 (x_selection_request_lisp_error): Free the above.
7844 (x_get_local_selection): Remove unnecessary code.
7845 (x_reply_selection_request): Args changed; handle arbitrary array
7846 of converted selections stored in converted_selections.
7847 Separate the XChangeProperty and SelectionNotify steps.
7848 (x_handle_selection_request): Rewrite to handle MULTIPLE target.
7849 (x_convert_selection): New function.
7850 (x_handle_selection_event): Simplify.
7851 (x_get_foreign_selection): Don't ignore incoming requests while
7852 waiting for an answer; this will fail when we implement
7853 SAVE_TARGETS, and seems unnecessary anyway.
7854 (selection_data_to_lisp_data): Recognize ATOM_PAIR type.
7855 (Vx_sent_selection_functions): Doc fix.
7857 2011-05-26 Leo Liu <sdl.web@gmail.com>
7859 * editfns.c (Ftranspose_regions): Allow empty regions. (Bug#8699)
7861 2011-05-25 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
7863 * dispextern.h (struct glyph_row): New member fringe_bitmap_periodic_p.
7865 * dispnew.c (shift_glyph_matrix, scrolling_window): Mark scrolled row
7866 for fringe update if it has periodic bitmap.
7867 (row_equal_p): Also compare left_fringe_offset, right_fringe_offset,
7868 and fringe_bitmap_periodic_p.
7870 * fringe.c (get_fringe_bitmap_data): New function.
7871 (draw_fringe_bitmap_1, update_window_fringes): Use it.
7872 (update_window_fringes): Record periodicity of fringe bitmap in glyph
7873 row. Mark glyph row for fringe update if periodicity changed.
7875 * xdisp.c (try_window_reusing_current_matrix): Don't mark scrolled row
7876 for fringe update unless it has periodic bitmap.
7878 2011-05-25 Kenichi Handa <handa@m17n.org>
7880 * xdisp.c (get_next_display_element): Set correct it->face_id for
7881 a static composition.
7883 2011-05-24 Leo Liu <sdl.web@gmail.com>
7886 * makefile.w32-in ($(BLD)/fns.$(O)): Include sha1.h.
7888 * fns.c (crypto_hash_function, Fsha1): New function.
7889 (Fmd5): Use crypto_hash_function.
7890 (syms_of_fns): Add Ssha1.
7892 2011-05-22 Paul Eggert <eggert@cs.ucla.edu>
7894 * gnutls.c: Remove unused macros.
7895 (fn_gnutls_transport_set_lowat, fn_gnutls_transport_set_pull_function):
7896 (fn_gnutls_transport_set_push_function) [!WINDOWSNT]:
7897 Remove macros that are defined and never used.
7898 Caught by gcc -Wunused-macros (GCC 4.6.0, Fedora 14).
7900 2011-05-22 Chong Yidong <cyd@stupidchicken.com>
7902 * xselect.c (syms_of_xselect): Remove unused symbol SAVE_TARGETS.
7903 (Fx_get_selection_internal): Minor cleanup.
7904 (Fx_own_selection_internal): Rename arguments for consistency with
7907 2011-05-22 Paul Eggert <eggert@cs.ucla.edu>
7909 * xselect.c (QSAVE_TARGETS): New static var, to fix build failure.
7911 2011-05-22 Chong Yidong <cyd@stupidchicken.com>
7913 * xselect.c (syms_of_xselect): Include character.h; use DEFSYM.
7915 2011-05-21 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
7917 * dispnew.c (scrolling_window): Don't exclude the case that the
7918 last enabled row in the desired matrix touches the bottom boundary.
7920 2011-05-21 Glenn Morris <rgm@gnu.org>
7922 * Makefile.in ($(etc)/DOC): Make second command line even shorter.
7923 (SOME_MACHINE_OBJECTS): Replace FONT_OBJ by its maximal expansion,
7924 and add some more files.
7926 2011-05-20 Eli Zaretskii <eliz@gnu.org>
7928 * callproc.c (Fcall_process) [MSDOS]: Fix arguments to
7929 report_file_error introduced by the change from 2011-05-07.
7931 2011-05-20 Paul Eggert <eggert@cs.ucla.edu>
7933 * systime.h (Time): Define only if emacs is defined.
7934 This is to allow ../lib-src/profile.c to be compiled on FreeBSD,
7935 where the include path doesn't have X11/X.h by default. See
7936 <http://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00561.html>.
7938 2011-05-20 Kenichi Handa <handa@m17n.org>
7940 * composite.c (find_automatic_composition): Fix previous change.
7942 2011-05-20 Glenn Morris <rgm@gnu.org>
7944 * lisp.mk: New file, split from Makefile.in.
7945 * Makefile.in (lisp): Move to separate file, inserted by @lisp_frag@.
7946 (shortlisp): Remove.
7947 ($(etc)/DOC): Edit lisp.mk rather than using $shortlisp.
7949 2011-05-19 Glenn Morris <rgm@gnu.org>
7951 * Makefile.in (MSDOS_SUPPORT_REAL, MSDOS_SUPPORT, NS_SUPPORT)
7952 (REAL_MOUSE_SUPPORT, GPM_MOUSE_SUPPORT, MOUSE_SUPPORT, TOOLTIP_SUPPORT)
7953 (BASE_WINDOW_SUPPORT, X_WINDOW_SUPPORT, WINDOW_SUPPORT): Remove.
7954 (lisp): Set the order to that of loadup.el.
7955 (shortlisp): Make it a copy of $lisp.
7956 (SOME_MACHINE_LISP): Remove.
7957 ($(etc)/DOC): Depend just on $lisp, not $SOME_MACHINE_LISP too.
7958 Use just $shortlisp, not $SOME_MACHINE_LISP too.
7960 2011-05-18 Kenichi Handa <handa@m17n.org>
7962 * composite.c (CHAR_COMPOSABLE_P): Add more check for efficiency.
7963 (BACKWARD_CHAR): Wrap the arg STOP by parenthesis.
7964 (find_automatic_composition): Mostly rewrite for efficiency.
7966 2011-05-18 Juanma Barranquero <lekktu@gmail.com>
7968 * makefile.w32-in: Update dependencies.
7970 2011-05-18 Christoph Scholtes <cschol2112@googlemail.com>
7972 * menu.c: Include limits.h (fixes the MS-Windows build broken by
7973 2011-06-18T18:49:19Z!cyd@stupidchicken.com).
7975 2011-05-18 Paul Eggert <eggert@cs.ucla.edu>
7977 Fix some integer overflow issues, such as string length overflow.
7979 * insdel.c (count_size_as_multibyte): Check for string overflow.
7981 * character.c (lisp_string_width): Check for string overflow.
7982 Use EMACS_INT, not int, for string indexes and lengths; in
7983 particular, 2nd arg is now EMACS_INT, not int. Do not crash if
7984 the resulting string length overflows an EMACS_INT; instead,
7985 report a string overflow if no precision given. When checking for
7986 precision exhaustion, use a check that cannot possibly have
7987 integer overflow. (Bug#8675)
7988 * character.h (lisp_string_width): Adjust to new signature.
7990 * alloc.c (string_overflow): New function.
7991 (Fmake_string): Use it. This doesn't change behavior, but saves
7992 a few bytes and will simplify future changes.
7993 * character.c (string_escape_byte8): Likewise.
7994 * lisp.h (string_overflow): New decl.
7996 Fixups, following up to the user-interface timestamp change.
7997 * nsterm.m (last_mouse_movement_time, ns_mouse_position): Use Time
7998 for UI timestamps, instead of unsigned long.
7999 * msdos.c (mouse_get_pos): Likewise.
8000 * w32inevt.c (movement_time, w32_console_mouse_position): Likewise.
8001 * w32gui.h (Time): Define by including "systime.h" rather than by
8002 declaring it ourselves. (Bug#8664)
8004 * dispextern.h (struct image): Don't assume time_t <= unsigned long.
8005 * image.c (clear_image_cache): Likewise.
8007 * term.c (term_mouse_position): Don't assume time_t wraparound.
8009 Be more systematic about user-interface timestamps.
8010 Before, the code sometimes used 'Time', sometimes 'unsigned long',
8011 and sometimes 'EMACS_UINT', to represent these timestamps.
8012 This change causes it to use 'Time' uniformly, as that's what X uses.
8013 This makes the code easier to follow, and makes it easier to catch
8014 integer overflow bugs such as Bug#8664.
8015 * frame.c (Fmouse_position, Fmouse_pixel_position):
8016 Use Time, not unsigned long, for user-interface timestamps.
8017 * keyboard.c (last_event_timestamp, kbd_buffer_get_event): Likewise.
8018 (button_down_time, make_lispy_position, make_lispy_movement): Likewise.
8019 * keyboard.h (last_event_timestamp): Likewise.
8020 * menu.c (Fx_popup_menu) [!HAVE_X_WINDOWS]: Likewise.
8021 * menu.h (xmenu_show): Likewise.
8022 * term.c (term_mouse_position): Likewise.
8023 * termhooks.h (struct input_event.timestamp): Likewise.
8024 (struct terminal.mouse_position_hook): Likewise.
8025 * xmenu.c (create_and_show_popup_menu, xmenu_show): Likewise.
8026 * xterm.c (XTmouse_position, x_scroll_bar_report_motion): Likewise.
8027 * systime.h (Time): New decl. Pull it in from <X11/X.h> if
8028 HAVE_X_WINDOWS, otherwise define it as unsigned long, which is
8030 * menu.h, termhooks.h: Include "systime.h", for Time.
8032 * keyboard.c (make_lispy_event): Fix problem in integer overflow.
8033 Don't assume that the difference between two unsigned long values
8034 can fit into an integer. At this point, we know button_down_time
8035 <= event->timestamp, so the difference must be nonnegative, so
8036 there's no need to cast the result if double-click-time is
8037 nonnegative, as it should be; check that it's nonnegative, just in
8038 case. This bug is triggered when events are more than 2**31 ms
8039 apart (about 25 days). (Bug#8664)
8041 * xselect.c (last_event_timestamp): Remove duplicate decl.
8042 (x_own_selection): Remove needless cast to unsigned long.
8044 * xmenu.c (set_frame_menubar): Use int, not EMACS_UINT, for indexes
8045 that always fit in int. Use a sentinel instead of a counter, to
8046 avoid a temp and to allay GCC's concerns about possible int overflow.
8047 * frame.h (struct frame): Use int for menu_bar_items_used
8048 instead of EMACS_INT, since it always fits in int.
8050 * menu.c (grow_menu_items): Check for int overflow.
8052 * xmenu.c (set_frame_menubar): Don't mishandle vectors with no nils.
8054 * xterm.c: Use EMACS_INT for Emacs modifiers, and int for X modifiers.
8055 Before, the code was not consistent. These values cannot exceed
8056 2**31 - 1 so there's no need to make them unsigned.
8057 (x_x_to_emacs_modifiers): Accept int and return EMACS_INT.
8058 (x_emacs_to_x_modifiers): Accept EMACS_INT and return int.
8059 (x_x_to_emacs_modifiers, x_emacs_to_x_modifiers): Reject non-integers
8061 * xterm.h (x_x_to_emacs_modifiers): Adjust to signature change.
8063 * lisp.h (XINT) [USE_LISP_UNION_TYPE]: Cast to EMACS_INT.
8064 (XUINT) [USE_LISP_UNION_TYPE]: Cast to EMACS_UINT.
8065 Otherwise, GCC 4.6.0 warns about printf (pI, XINT (...)),
8066 presumably because the widths might not match.
8068 * window.c (size_window): Avoid needless test at loop start.
8070 2011-05-18 Courtney Bane <emacs-bugs-7626@cbane.org> (tiny change)
8072 * term.c (Fresume_tty): Restore hooks before reinitializing (bug#8687).
8074 2011-05-12 Drew Adams <drew.adams@oracle.com>
8076 * textprop.c (Fprevious_single_char_property_change): Doc fix (bug#8655).
8078 2011-05-12 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
8080 * w32term.c (w32_draw_fringe_bitmap): Rename local vars `left' and
8081 `width' to `bar_area_x' and `bar_area_width', respectively.
8082 (x_scroll_run): Take account of fringe background extension.
8084 * xterm.c (x_draw_fringe_bitmap) [USE_TOOLKIT_SCROLL_BARS]:
8085 Rename local vars `left' and `width' to `bar_area_x' and
8086 `bar_area_width', respectively.
8087 (x_scroll_run) [USE_TOOLKIT_SCROLL_BARS]: Take account of fringe
8088 background extension.
8090 2011-05-10 Jim Meyering <meyering@redhat.com>
8092 * xdisp.c (x_intersect_rectangles): Fix typo "the the -> the".
8094 2011-05-10 Juanma Barranquero <lekktu@gmail.com>
8096 * image.c (Finit_image_library): Return t for built-in image types,
8097 like pbm and xbm. (Bug#8640)
8099 2011-05-09 Andreas Schwab <schwab@linux-m68k.org>
8101 * w32menu.c (set_frame_menubar): Fix submenu allocation.
8103 2011-05-07 Eli Zaretskii <eliz@gnu.org>
8105 * w32console.c (Fset_screen_color): Doc fix.
8106 (Fget_screen_color): New function.
8107 (syms_of_ntterm): Defsubr it.
8109 * callproc.c (call_process_cleanup) [MSDOS]: Don't close and
8110 unlink the temporary file if Fcall_process didn't create it in the
8112 (Fcall_process) [MSDOS]: Don't create tempfile if stdout of the
8113 child process will be redirected to a file specified with `:file'.
8114 Don't try to re-open tempfile in that case, and set fd[0] to -1 as
8115 cue to call_process_cleanup not to close that handle.
8117 2011-05-07 Ben Key <bkey76@gmail.com>
8119 * makefile.w32-in: The bootstrap-temacs rule now makes use of
8120 one of two shell specific rules, either bootstrap-temacs-CMD or
8121 bootstrap-temacs-SH. The bootstrap-temacs-SH rule is identical
8122 to the previous implementation of the bootstrap-temacs rule.
8123 The bootstrap-temacs-CMD rule is similar to the previous
8124 implementation of the bootstrap-temacs rule except that it
8125 makes use of the ESC_CFLAGS variable instead of the CFLAGS
8128 These changes, along with some changes to nt/configure.bat,
8129 nt/gmake.defs, and nt/nmake.defs, are required to extend my
8130 earlier fix to add support for --cflags and --ldflags options
8131 that include quotes so that it works whether make uses cmd or
8134 2011-05-06 Michael Albinus <michael.albinus@gmx.de>
8136 * dbusbind.c (QCdbus_type_unix_fd): Declare static.
8137 (xd_remove_watch): Don't check QCdbus_type_unix_fd for SYMBOLP, it
8139 (Fdbus_init_bus, xd_read_queued_messages): Bus can be a symbol or
8140 a string. Handle both cases.
8141 (Fdbus_call_method_asynchronously, Fdbus_register_signal)
8142 (Fdbus_register_method): Use Qinvalid_function.
8144 2011-05-06 Juanma Barranquero <lekktu@gmail.com>
8146 * makefile.w32-in: Update dependencies.
8147 (LISP_H): Add inttypes.h and stdin.h.
8148 (PROCESS_H): Add unistd.h.
8150 2011-05-06 Eli Zaretskii <eliz@gnu.org>
8152 * lread.c: Include limits.h (fixes the MS-Windows build broken by
8153 2011-05-06T07:13:19Z!eggert@cs.ucla.edu).
8155 2011-05-06 Paul Eggert <eggert@cs.ucla.edu>
8157 * image.c (Finit_image_library) [!HAVE_NTGUI]: Omit unused local.
8159 * term.c (vfatal): Remove stray call to va_end.
8160 It's not needed and the C Standard doesn't allow it here anyway.
8162 Use C99's va_copy to avoid undefined behavior on x86-64 GNU/Linux.
8163 * eval.c (verror): doprnt a copy of ap, not the original. (Bug#8545)
8165 * eval.c (verror): OK to create a string of up to MOST_POSITIVE_FIXNUM
8168 * term.c: Don't include <stdarg.h>, as <lisp.h> does that.
8170 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork clobbering.
8172 * process.c (Fformat_network_address): Fix typo: args2 -> *args2.
8174 * xmenu.c (set_frame_menubar): Fix typo: int * -> int (3 times).
8176 * coding.c (detect_coding_charset): Fix typo: * 2 -> *4 (Bug#8601).
8178 * charset.h (struct charset.code_space): Now has 15 elements, not 16.
8179 * charset.c (Fdefine_charset_internal): Don't initialize
8180 charset.code_space[15]. The value was garbage, on hosts with
8181 32-bit int (Bug#8600).
8183 * lread.c (read_integer): Be more consistent with string-to-number.
8184 Use string_to_number to do the actual conversion; this avoids
8185 rounding errors and fixes some other screwups. Without this fix,
8186 for example, #x1fffffffffffffff was misread as -2305843009213693952.
8187 (digit_to_number): Move earlier, for benefit of read_integer.
8188 Return -1 if the digit is out of range for the base, -2 if it is
8189 not a digit in any supported base. (Bug#8602)
8191 * doprnt.c (doprnt): Support arbitrary pI values, such as "I64".
8193 * dispnew.c (scrolling_window): Return 1 if we scrolled,
8194 to match comment at start of function. This also removes a
8195 GCC warning about overflow in a 32+64-bit port.
8197 * lisp.h (EMACS_INT, EMACS_UINT, BITS_PER_EMACS_INT, pI): Simplify.
8199 * dbusbind.c: Do not use XPNTR on a value that may be an integer.
8200 Reported by Stefan Monnier in
8201 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00919.html>.
8202 (xd_remove_watch, Fdbus_init_bus, xd_read_queued_messages):
8203 Use SYMBOLP-guarded XSYMBOL, not XPNTR.
8205 * lisp.h (EMACS_INTPTR): Remove. All uses changed to intptr_t.
8206 (EMACS_UINTPTR): Likewise, with uintptr_t.
8208 * lisp.h: Prefer 64-bit EMACS_INT if available.
8209 (EMACS_INT, EMACS_UINT, BITS_PER_EMACS_INT, pI): Define to 64-bit
8210 on 32-bit hosts that have 64-bit int, so that they can access
8212 However, temporarily disable this change unless the temporary
8213 symbol WIDE_EMACS_INT is defined.
8215 * lread.c, process.c: Do not include <inttypes.h>; lisp.h does it now.
8217 Prefer intptr_t/uintptr_t for integers the same widths as pointers.
8218 This removes an assumption that EMACS_INT and long are the same
8219 width as pointers. The assumption is true for Emacs porting targets
8220 now, but we want to make other targets possible.
8221 * lisp.h: Include <inttypes.h>, for INTPTR_MAX, UINTPTR_MAX.
8222 (EMACS_INTPTR, EMACS_UINTPTR): New macros.
8223 In the rest of the code, change types of integers that hold casted
8224 pointers to EMACS_INTPTR and EMACS_UINTPTR, systematically
8225 replacing EMACS_INT, long, EMACS_UINT, and unsigned long.
8226 (XTYPE): Don't cast arg to EMACS_UINT; normally is not needed.
8227 (XSET): Cast type of XTYPE arg to EMACS_INTPTR; it is needed here.
8228 No need to cast type when ORing.
8229 (XPNTR): Return a value of type EMACS_INTPTR or EMACS_UINTPTR.
8230 * alloc.c (lisp_align_malloc): Remove a no-longer-needed cast.
8231 * doc.c (store_function_docstring): Use EMACS_INTPTR, so as not to
8232 assume EMACS_INT is the same width as char *.
8233 * gtkutil.c (xg_gtk_scroll_destroy, xg_tool_bar_button_cb):
8234 (xg_tool_bar_callback, xg_tool_bar_help_callback, xg_make_tool_item):
8235 Remove no-longer-needed casts.
8236 (xg_create_scroll_bar, xg_tool_bar_button_cb, xg_tool_bar_callback):
8237 (xg_tool_bar_help_callback, xg_make_tool_item):
8238 Use EMACS_INTPTR to hold an integer
8239 that will be cast to void *; this can avoid a GCC warning
8240 if EMACS_INT is not the same width as void *.
8241 * menu.c (find_and_call_menu_selection): Remove no-longer-needed cast.
8242 * xdisp.c (display_echo_area_1, resize_mini_window_1):
8243 (current_message_1, set_message_1):
8244 Use a local to convert to proper width without a cast.
8245 * xmenu.c (dialog_selection_callback): Likewise.
8247 * sysdep.c (get_random): Don't assume EMACS_INT is no wider than long.
8248 Also, don't assume VALBITS / RAND_BITS is less than 5,
8249 and don't rely on undefined behavior when shifting a 1 left into
8251 * lisp.h (get_random): Change signature to match.
8253 * lread.c (hash_string): Use size_t, not int, for hash computation.
8254 Normally we prefer signed values; but hashing is special, because
8255 it's better to use unsigned division on hash table sizes so that
8256 the remainder is nonnegative. Also, size_t is the natural width
8257 for hashing into memory. The previous code used 'int', which doesn't
8258 retain enough info to hash well into very large tables.
8259 (oblookup, oblookup_last_bucket_number, Funintern): Likewise.
8261 * dbusbind.c: Don't possibly lose pointer info when converting.
8262 (xd_remove_watch, Fdbus_init_bus, xd_read_queued_messages):
8263 Use XPNTR rather than XHASH, so that the high-order bits of
8264 the pointer aren't lost when converting through void *.
8266 * eval.c (Fautoload): Don't double-shift a pointer.
8268 * fns.c (Frandom): Let EMACS_UINT be wider than unsigned long.
8270 2011-05-06 Juanma Barranquero <lekktu@gmail.com>
8272 * gnutls.c (DEF_GNUTLS_FN):
8273 * image.c (DEF_IMGLIB_FN): Make function pointers static.
8275 2011-05-05 Andreas Schwab <schwab@linux-m68k.org>
8277 * lread.c (lisp_file_lexically_bound_p): Stop scanning at end
8280 2011-05-05 Eli Zaretskii <eliz@gnu.org>
8282 * w32heap.c (allocate_heap) [USE_LISP_UNION_TYPE || USE_LSB_TAG]:
8283 New version that can reserve upto 2GB of heap space.
8285 2011-05-05 Chong Yidong <cyd@stupidchicken.com>
8287 * nsfns.m (Fns_read_file_name): Doc fix (Bug#8534).
8289 2011-05-05 Teodor Zlatanov <tzz@lifelogs.com>
8291 * gnutls.c (fn_gnutls_certificate_set_x509_key_file): Add alias to
8292 `gnutls_certificate_set_x509_key_file'.
8294 2011-05-05 Juanma Barranquero <lekktu@gmail.com>
8296 * makefile.w32-in ($(BLD)/image.$(O), $(BLD)/process.$(O)):
8297 Update dependencies.
8299 2011-05-04 Juanma Barranquero <lekktu@gmail.com>
8301 * gnutls.h (emacs_gnutls_write, emacs_gnutls_read):
8302 * gnutls.c (emacs_gnutls_write, emacs_gnutls_read):
8303 Remove unused parameter `fildes'.
8304 * process.c (read_process_output, send_process): Don't pass it.
8306 2011-05-04 Juanma Barranquero <lekktu@gmail.com>
8308 Fix previous change: the library cache is defined in w32.c.
8309 * image.c (CACHE_IMAGE_TYPE) [!HAVE_NTGUI]: Define to noop.
8310 (Finit_image_library): Wrap Vlibrary_cache on "#ifdef HAVE_NTGUI".
8312 2011-05-04 Juanma Barranquero <lekktu@gmail.com>
8314 Implement dynamic loading of GnuTLS on Windows.
8316 * gnutls.h (GNUTLS_EMACS_ERROR_NOT_LOADED): New macro.
8317 (emacs_gnutls_write, emacs_gnutls_read): Mark as extern.
8318 (emacs_gnutls_record_check_pending, emacs_gnutls_transport_set_errno):
8321 * gnutls.c (Qgnutls_dll): Define.
8322 (DEF_GNUTLS_FN, LOAD_GNUTLS_FN): New macros.
8323 (gnutls_*): Declare function pointers.
8324 (init_gnutls_functions): New function to initialize function pointers.
8325 (emacs_gnutls_handshake, Fgnutls_error_string, Fgnutls_deinit)
8326 (emacs_gnutls_global_init, Fgnutls_bye): Use function pointers.
8327 (emacs_gnutls_record_check_pending, emacs_gnutls_transport_set_errno):
8328 Wrappers for gnutls_record_check_pending and gnutls_transport_set_errno.
8329 (emacs_gnutls_write, emacs_gnutls_read)
8330 (emacs_gnutls_handle_error, Fgnutls_error_fatalp)
8331 (Fgnutls_available_p): New function.
8332 (Fgnutls_boot): Call Fgnutls_available_p. Use function pointers.
8333 (syms_of_gnutls) <Qgnutls_dll>: Initialize and staticpro it.
8334 (syms_of_gnutls) <Sgnutls_available_p>: defsubr it.
8336 * image.c: Include w32.h.
8337 (Vimage_type_cache): Delete.
8338 (syms_of_image) <Vimage_type_cache>: Don't initialize and staticpro it.
8339 (CACHE_IMAGE_TYPE, Finit_image_library): Use Vlibrary_cache instead.
8340 (w32_delayed_load): Move to w32.c.
8342 * w32.h (VlibraryCache, QCloaded_from, w32_delayed_load): Declare.
8344 * w32.c (QCloaded_from, Vlibrary_cache): Define.
8345 (w32_delayed_load): Move from image.c. When loading a library, record
8346 its filename in the :loaded-from property of the library id.
8347 (globals_of_w32) <QCloaded_from, Vlibrary_cache>:
8348 Initialize and staticpro them.
8349 (emacs_gnutls_pull, emacs_gnutls_push): Call emacs_gnutls_* functions.
8351 * process.c: Include lisp.h before w32.h, not after.
8352 (wait_reading_process_output): Call emacs_gnutls_record_check_pending
8353 instead of gnutls_record_check_pending.
8355 * callproc.c, emacs.c: Include lisp.h before w32.h, not after.
8357 2011-05-04 Teodor Zlatanov <tzz@lifelogs.com>
8359 * gnutls.c (Fgnutls_boot): Support :keylist and :crlfiles options
8360 instead of :keyfiles. Give GnuTLS the keylist and the CRL lists
8363 2011-05-03 Jan Djärv <jan.h.d@swipnet.se>
8365 * xterm.c (x_set_frame_alpha): Do not set property on anything
8366 else than FRAME_X_OUTER_WINDOW (Bug#8608).
8368 2011-05-02 Juanma Barranquero <lekktu@gmail.com>
8370 * sysdep.c (get_tty_size) [WINDOWSNT]: Implement. (Bug#8596)
8372 2011-05-02 Juanma Barranquero <lekktu@gmail.com>
8374 * gnutls.c (Qgnutls_log_level, Qgnutls_code, Qgnutls_anon)
8375 (Qgnutls_x509pki, Qgnutls_e_interrupted, Qgnutls_e_again)
8376 (Qgnutls_e_invalid_session, Qgnutls_e_not_ready_for_handshake)
8377 (gnutls_global_initialized, Qgnutls_bootprop_priority)
8378 (Qgnutls_bootprop_trustfiles, Qgnutls_bootprop_keyfiles)
8379 (Qgnutls_bootprop_callbacks, Qgnutls_bootprop_loglevel)
8380 (Qgnutls_bootprop_hostname, Qgnutls_bootprop_verify_flags)
8381 (Qgnutls_bootprop_verify_error, Qgnutls_bootprop_verify_hostname_error)
8382 (Qgnutls_bootprop_callbacks_verify): Make static.
8384 2011-05-01 Andreas Schwab <schwab@linux-m68k.org>
8386 * callproc.c: Indentation fixup.
8388 * sysdep.c (wait_for_termination_1): Make static.
8389 (wait_for_termination, interruptible_wait_for_termination):
8390 Move after wait_for_termination_1.
8392 2011-05-01 Lars Magne Ingebrigtsen <larsi@gnus.org>
8394 * sysdep.c (interruptible_wait_for_termination): New function
8395 which is like wait_for_termination, but allows keyboard
8398 * callproc.c (Fcall_process): Add (:file "file") as an option for
8400 (Fcall_process_region): Ditto.
8402 2011-04-30 Eli Zaretskii <eliz@gnu.org>
8404 * dosfns.c (Fint86, Fdos_memget, Fdos_memput): Use `ASIZE (FOO)'
8405 rather than `XVECTOR (FOO)->size'.
8407 * process.c: Remove HAVE_INTTYPES_H condition from inclusion of
8408 inttypes.h, as a gnulib replacement is used if it not available in
8411 2011-04-21 Eli Zaretskii <eliz@gnu.org>
8413 Lift the MOST_POSITIVE_FIXNUM/4 limitation on visited files.
8414 * fileio.c (Finsert_file_contents): Don't limit file size to 1/4
8415 of MOST_POSITIVE_FIXNUM. (Bug#8528)
8417 * coding.c (coding_alloc_by_realloc): Error out if destination
8418 will grow beyond MOST_POSITIVE_FIXNUM.
8419 (decode_coding_emacs_mule): Abort if there isn't enough place in
8420 charbuf for the composition carryover bytes. Reserve an extra
8421 space for up to 2 characters produced in a loop.
8422 (decode_coding_iso_2022): Abort if there isn't enough place in
8423 charbuf for the composition carryover bytes.
8425 2011-04-21 Eli Zaretskii <eliz@gnu.org>
8427 * doprnt.c (doprnt) [!HAVE_LONG_LONG_INT]: Error out instead of
8428 aborting when %lld or %lll format is passed.
8429 [!HAVE_UNSIGNED_LONG_LONG_INT]: Error out instead of aborting when
8430 %llo or %llx format is passed. (Bug#8545)
8432 * window.c (window_scroll_line_based): Use a marker instead of
8433 simple variables to record original value of point. (Bug#7952)
8435 * doprnt.c (doprnt): Fix the case where a multibyte sequence
8436 produced by %s or %c overflows available buffer space. (Bug#8545)
8438 2011-04-28 Paul Eggert <eggert@cs.ucla.edu>
8440 * doprnt.c (doprnt): Omit useless test; int overflow check (Bug#8545).
8441 (SIZE_MAX): Move defn after all includes, as they might #define it.
8443 2011-04-28 Juanma Barranquero <lekktu@gmail.com>
8445 * w32.c (init_environment): Warn about defaulting HOME to C:\.
8447 2011-04-28 Juanma Barranquero <lekktu@gmail.com>
8449 * keyboard.c (Qdelayed_warnings_hook): Define.
8450 (command_loop_1): Run `delayed-warnings-hook'
8451 if Vdelayed_warnings_list is non-nil.
8452 (syms_of_keyboard) <delayed-warnings-hook>: DEFSYM it.
8453 (syms_of_keyboard) <delayed-warnings-list>: DEFVAR_LISP it.
8455 2011-04-28 Eli Zaretskii <eliz@gnu.org>
8457 * doprnt.c (doprnt): Don't return value smaller than the buffer
8458 size if the message was truncated. (Bug#8545).
8460 2011-04-28 Juanma Barranquero <lekktu@gmail.com>
8462 * w32fns.c (Fx_change_window_property, Fx_delete_window_property)
8463 (Fx_window_property): #if-0 the whole functions, not just the bodies.
8465 2011-04-27 Paul Eggert <eggert@cs.ucla.edu>
8467 * doprnt.c (doprnt): Support "ll" length modifier, for long long.
8469 2011-04-27 Juanma Barranquero <lekktu@gmail.com>
8471 * makefile.w32-in: Update dependencies.
8473 2011-04-27 Eli Zaretskii <eliz@gnu.org>
8475 Improve `doprnt' and its usage. (Bug#8545)
8476 * doprnt.c (doprnt): Make sure `format' is never accessed beyond
8477 `format_end'. Remove support for %l as a conversion specifier.
8478 Don't use xrealloc. Improve diagnostics when the %l size modifier
8479 is used. Update the commentary.
8481 * eval.c (verror): Simplify calculation of size_t.
8483 * coding.c (Ffind_operation_coding_system): Fix diagnostic error
8486 2011-04-27 Yoshiaki Kasahara <kasahara@nc.kyushu-u.ac.jp> (tiny change)
8488 * buffer.c (init_buffer) [USE_MMAP_FOR_BUFFERS]: Adjust to aliasing
8491 2011-04-27 Paul Eggert <eggert@cs.ucla.edu>
8493 * nsmenu.m: Replace all uses of XVECTOR with ASIZE and AREF.
8494 This makes this file independent of the recent pseudovector change.
8496 2011-04-26 Paul Eggert <eggert@cs.ucla.edu>
8498 * keyboard.c (handle_user_signal): Fix pointer signedness problem.
8500 * gnutls.c (emacs_gnutls_handle_error): Remove unused local.
8501 (Fgnutls_boot): gnutls_certificate_verify_peers2 wants unsigned *.
8502 Remove unused local.
8503 (emacs_gnutls_write): Don't use uninitialized rtnval if nbyte <= 0.
8505 * lisp.h: Fix a problem with aliasing and vector headers. (Bug#8546)
8506 GCC 4.6.0 optimizes based on type-based alias analysis.
8507 For example, if b is of type struct buffer * and v of type struct
8508 Lisp_Vector *, then gcc -O2 was incorrectly assuming that &b->size
8509 != &v->size, and therefore "v->size = 1; b->size = 2; return
8510 v->size;" must therefore return 1. This assumption is incorrect
8511 for Emacs, since it type-puns struct Lisp_Vector * with many other
8512 types. To fix this problem, this patch adds a new type struct
8513 vectorlike_header that documents the constraints on layout of vectors
8514 and pseudovectors, and helps optimizing compilers not get fooled
8515 by Emacs's type punning. It also adds the macros XSETTYPED_PVECTYPE
8516 XSETTYPED_PSEUDOVECTOR, TYPED_PSEUDOVECTORP, for similar reasons.
8517 * lisp.h (XSETTYPED_PVECTYPE): New macro, specifying the name of
8519 (XSETPVECTYPE): Rewrite in terms of new macro.
8520 (XSETPVECTYPESIZE): New macro, specifying both type and size.
8521 This is a bit clearer, and further avoids the possibility of
8522 undesirable aliasing.
8523 (XSETTYPED_PSEUDOVECTOR): New macro, specifying the size.
8524 (XSETPSEUDOVECTOR): Rewrite in terms of XSETTYPED_PSEUDOVECTOR.
8525 (XSETSUBR): Rewrite in terms of XSETTYPED_PSEUDOVECTOR and XSIZE,
8526 since Lisp_Subr is a special case (no "next" field).
8527 (ASIZE): Now uses header.size rather than size.
8528 All previous uses of XVECTOR (foo)->size replaced to use this macro,
8529 to avoid the hassle of writing XVECTOR (foo)->header.size.
8530 (struct vectorlike_header): New type.
8531 (TYPED_PSEUDOVECTORP): New macro, also specifying the C type of the
8532 object, to help avoid aliasing.
8533 (PSEUDOVECTORP): Rewrite in terms of TYPED_PSEUDOVECTORP.
8534 (SUBRP): Likewise, since Lisp_Subr is a special case.
8535 * lisp.h (struct Lisp_Vector, struct Lisp_Char_Table):
8536 (struct Lisp_Sub_Char_Table, struct Lisp_Bool_Vector):
8537 (struct Lisp_Hash_Table): Combine first two members into a single
8538 struct vectorlike_header member. All uses of "size" and "next" members
8539 changed to be "header.size" and "header.next".
8540 * buffer.h (struct buffer): Likewise.
8541 * font.h (struct font_spec, struct font_entity, struct font): Likewise.
8542 * frame.h (struct frame): Likewise.
8543 * process.h (struct Lisp_Process): Likewise.
8544 * termhooks.h (struct terminal): Likewise.
8545 * window.c (struct save_window_data, struct saved_window): Likewise.
8546 * window.h (struct window): Likewise.
8547 * alloc.c (allocate_buffer, Fmake_bool_vector, allocate_pseudovector):
8548 Use XSETPVECTYPESIZE, not XSETPVECTYPE, to avoid aliasing problems.
8549 * buffer.c (init_buffer_once): Likewise.
8550 * lread.c (defsubr): Use XSETTYPED_PVECTYPE, since Lisp_Subr is a
8552 * process.c (Fformat_network_address): Use local var for size,
8555 * bytecode.c (exec_byte_code): Don't use XVECTOR before CHECK_VECTOR.
8557 Make the Lisp reader and string-to-float more consistent (Bug#8525)
8558 * data.c (atof): Remove decl; no longer used or needed.
8559 (digit_to_number): Move to lread.c.
8560 (Fstring_to_number): Use new string_to_number function, to be
8561 consistent with how the Lisp reader treats infinities and NaNs.
8562 Do not assume that floating-point numbers represent EMACS_INT
8563 without losing information; this is not true on most 64-bit hosts.
8564 Avoid double-rounding errors, by insisting on integers when
8565 parsing non-base-10 numbers, as the documentation specifies.
8566 * lisp.h (string_to_number): New decl, replacing ...
8567 (isfloat_string): Remove.
8568 * lread.c: Include <inttypes.h>, for uintmax_t and strtoumax.
8569 (read1): Do not accept +. and -. as integers; this
8570 appears to have been a coding error. Similarly, do not accept
8571 strings like +-1e0 as floating point numbers. Do not report
8572 overflow for integer overflows unless the base is not 10 which
8573 means we have no simple and reliable way to continue.
8574 Break out the floating-point parsing into a new
8575 function string_to_number, so that Fstring_to_number parses
8576 floating point numbers consistently with the Lisp reader.
8577 (digit_to_number): Move here from data.c. Make it static inline.
8578 (E_CHAR, EXP_INT): Remove, replacing with ...
8579 (E_EXP): New macro, to solve the "1.0e+" problem mentioned below.
8580 (string_to_number): New function, replacing isfloat_string.
8581 This function checks for valid syntax and produces the resulting
8582 Lisp float number too. Rework it so that string-to-number
8583 no longer mishandles examples like "1.0e+". Use strtoumax,
8584 so that overflow for non-base-10 numbers is reported only when
8585 there's no portable and simple way to convert to floating point.
8587 * textprop.c (set_text_properties_1): Rewrite for clarity,
8588 and to avoid GCC warning about integer overflow.
8590 * intervals.h (struct interval): Use EMACS_INT for members
8591 where EMACS_UINT might cause problems. See
8592 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00514.html>.
8593 (CHECK_TOTAL_LENGTH): Remove cast to EMACS_INT; no longer needed.
8594 * intervals.c (interval_deletion_adjustment): Now returns EMACS_INT.
8596 (offset_intervals): Tell GCC not to worry about length overflow
8597 when negating a negative length.
8599 * alloc.c (overrun_check_malloc, overrun_check_realloc): Now static.
8600 (overrun_check_free): Likewise.
8602 * alloc.c (SDATA_SIZE) [!GC_CHECK_STRING_BYTES]: Avoid runtime check
8603 in the common case where SDATA_DATA_OFFSET is a multiple of Emacs
8606 * gnutls.c: Fix problems found by GCC 4.6.0 on Ubuntu 10.10.
8607 (gnutls_make_error): Rename local to avoid shadowing.
8608 (gnutls_emacs_global_deinit): ifdef out; not used.
8609 (Fgnutls_boot): Use const for pointer to readonly storage.
8610 Comment out unused local. Fix pointer signedness problems.
8612 * lread.c (openp): Don't stuff size_t into an 'int'.
8613 Use <= on length, not < on length + 1, to avoid GCC 4.6.0 warning
8614 about possible signed overflow.
8616 * gtkutil.c: Fix problems found by GCC 4.6.0 on Ubuntu 10.10.
8617 (GDK_KEY_g): Don't define if already defined.
8618 (xg_prepare_tooltip): Avoid pointer signedness problem.
8619 (xg_set_toolkit_scroll_bar_thumb): Redo to avoid two casts.
8621 * process.c (Fnetwork_interface_info): Avoid left-shift undefined
8622 behavior with 1 << 31. GCC 4.6.0 warns about this on 32-bit hosts.
8624 * xfns.c (Fx_window_property): Simplify a bit,
8625 to make a bit faster and to avoid GCC 4.6.0 warning.
8626 * xselect.c (x_get_window_property, x_handle_dnd_message): Likewise.
8628 * fns.c (internal_equal): Don't assume size_t fits in int.
8630 * alloc.c (compact_small_strings): Tighten assertion a little.
8632 Replace pEd with more-general pI, and fix some printf arg casts.
8633 * lisp.h (pI): New macro, generalizing old pEd macro to other
8634 conversion specifiers. For example, use "...%"pI"d..." rather
8635 than "...%"pEd"...".
8636 (pEd): Remove. All uses replaced with similar uses of pI.
8637 * m/amdx86-64.h, m/ia64.h, m/ibms390x.h: Likewise.
8638 * alloc.c (check_pure_size): Don't overflow by converting size to int.
8639 * bidi.c (bidi_dump_cached_states): Use pI to avoid cast.
8640 * data.c (Fnumber_to_string): Use pI instead of if-then-else-abort.
8641 * dbusbind.c (xd_append_arg): Use pI to avoid cast.
8642 (Fdbus_method_return_internal, Fdbus_method_error_internal): Likewise.
8643 * font.c (font_unparse_xlfd): Avoid potential buffer overrun on
8645 (font_unparse_xlfd, font_unparse_fcname): Use pI to avoid casts.
8646 * keyboard.c (record_char, modify_event_symbol): Use pI to avoid casts.
8647 * print.c (safe_debug_print, print_object): Likewise.
8648 (print_object): Don't overflow by converting EMACS_INT or EMACS_UINT
8650 Use pI instead of if-then-else-abort. Use %p to avoid casts,
8651 avoiding the 0 flag, which is not portable.
8652 * process.c (Fmake_network_process): Use pI to avoid cast.
8653 * region-cache.c (pp_cache): Likewise.
8654 * xdisp.c (decode_mode_spec): Likewise.
8655 * xrdb.c (x_load_resources) [USE_MOTIF]: Use pI to avoid undefined
8656 behavior on 64-bit hosts with printf arg.
8657 * xselect.c (x_queue_event): Use %p to avoid casts, avoiding 0 flag.
8658 (x_stop_queuing_selection_requests): Likewise.
8659 (x_get_window_property): Don't truncate byte count to an 'int'
8662 * frame.c (frame_name_fnn_p): Get rid of strtol, which isn't right
8663 here, since it parses constructs like leading '-' and spaces,
8664 which are not wanted; and it overflows with large numbers.
8665 Instead, simply match F[0-9]+, which is what is wanted anyway.
8667 * alloc.c: Remove unportable assumptions about struct layout.
8668 (SDATA_SELECTOR, SDATA_DATA_OFFSET): New macros.
8669 (SDATA_OF_STRING, SDATA_SIZE, allocate_string_data):
8670 (allocate_vectorlike, make_pure_vector): Use the new macros,
8671 plus offsetof, to remove unportable assumptions about struct layout.
8672 These assumptions hold on all porting targets that I know of, but
8673 they are not guaranteed, they're easy to remove, and removing them
8674 makes further changes easier.
8676 * alloc.c (BLOCK BYTES): Fix typo by changing "ablock" to "ablocks".
8677 This doesn't fix a bug but makes the code clearer.
8678 (string_overrun_cookie): Now const. Use initializers that
8679 don't formally overflow signed char, to avoid warnings.
8680 (allocate_string_data) [GC_CHECK_STRING_OVERRUN]: Fix typo that
8681 can cause Emacs to crash when string overrun checking is enabled.
8682 (allocate_buffer): Don't assume sizeof (struct buffer) is a
8683 multiple of sizeof (EMACS_INT); it need not be, if
8684 alignof(EMACS_INT) < sizeof (EMACS_INT).
8685 (check_sblock, check_string_bytes, check_string_free_list): Protoize.
8687 2011-04-26 Juanma Barranquero <lekktu@gmail.com>
8689 * keyboard.c (QCrtl): Rename from Qrtl. All uses changed.
8691 2011-04-26 Teodor Zlatanov <tzz@lifelogs.com>
8693 * gnutls.c (emacs_gnutls_handshake): Return an error if we're not
8694 supposed to be handshaking. (Bug#8556)
8695 Reported by Paul Eggert <eggert@cs.ucla.edu>.
8697 2011-04-26 Daniel Colascione <dan.colascione@gmail.com>
8699 * lisp.h (Qdebug): List symbol.
8700 * eval.c (Qdebug): Restore global linkage.
8701 * keyboard.c (debug-on-event): New variable.
8702 (handle_user_signal): Break into debugger when debug-on-event
8703 matches the current signal symbol.
8705 2011-04-25 Dan Nicolaescu <dann@ics.uci.edu>
8707 * alloc.c (check_sblock, check_string_bytes)
8708 (check_string_free_list): Convert to standard C.
8710 2011-04-25 Teodor Zlatanov <tzz@lifelogs.com>
8712 * w32.c (emacs_gnutls_push): Fix typo.
8714 2011-04-25 Eli Zaretskii <eliz@gnu.org>
8716 * gnutls.c (emacs_gnutls_handshake): Avoid compiler warnings about
8717 "cast to pointer from integer of different size".
8719 Improve doprnt and its use in verror. (Bug#8545)
8720 * doprnt.c (doprnt): Document the set of format control sequences
8721 supported by the function. Use SAFE_ALLOCA instead of always
8724 * eval.c (verror): Don't limit the buffer size at size_max-1, that
8725 is one byte too soon. Don't use xrealloc; instead xfree and
8728 2011-04-24 Teodor Zlatanov <tzz@lifelogs.com>
8730 * gnutls.h: Add GNUTLS_STAGE_CALLBACKS enum to denote we're in the
8733 * gnutls.c: Renamed global_initialized to
8734 gnutls_global_initialized. Added internals for the
8735 :verify-hostname-error, :verify-error, and :verify-flags
8736 parameters of `gnutls-boot' and documented those parameters in the
8737 docstring. Start callback support.
8738 (emacs_gnutls_handshake): Add Woe32 support. Retry handshake
8739 unless a fatal error occurred. Call gnutls_alert_send_appropriate
8740 on error. Return error code.
8741 (emacs_gnutls_write): Call emacs_gnutls_handle_error.
8742 (emacs_gnutls_read): Likewise.
8743 (Fgnutls_boot): Return handshake error code.
8744 (emacs_gnutls_handle_error): New function.
8745 (wsaerror_to_errno): Likewise.
8747 * w32.h (emacs_gnutls_pull): Add prototype.
8748 (emacs_gnutls_push): Likewise.
8750 * w32.c (emacs_gnutls_pull): New function for GnuTLS on Woe32.
8751 (emacs_gnutls_push): Likewise.
8753 2011-04-24 Claudio Bley <claudio.bley@gmail.com> (tiny change)
8755 * process.c (wait_reading_process_output): Check if GnuTLS
8756 buffered some data internally if no FDs are set for TLS
8759 * makefile.w32-in (OBJ2): Add gnutls.$(O).
8760 (LIBS): Link to USER_LIBS.
8761 ($(BLD)/gnutls.$(0)): New target.
8763 2011-04-24 Eli Zaretskii <eliz@gnu.org>
8765 * xdisp.c (handle_single_display_spec): Rename the
8766 display_replaced_before_p argument into display_replaced_p, to
8767 make it consistent with the commentary. Fix typos in the
8770 * textprop.c (syms_of_textprop): Remove dead code.
8771 (copy_text_properties): Delete obsolete commentary about an
8772 interface that was deleted long ago. Fix typos in the description
8775 * msdos.c (XMenuActivate, XMenuAddSelection): Adjust argument list
8776 to changes in oldXMenu/XMenu.h from 2011-04-16.
8777 <menu_help_message, prev_menu_help_message>: Constify.
8778 (IT_menu_make_room): menu->help_text is now `const char **';
8781 * msdos.h (XMenuActivate, XMenuAddSelection): Adjust prototypes
8782 to changes in oldXMenu/XMenu.h from 2011-04-16.
8783 (struct XMenu): Declare `help_text' `const char **'.
8785 * xfaces.c <Qunspecified>: Make extern again.
8787 * syntax.c: Include sys/types.h before including regex.h, as
8790 * doc.c (get_doc_string): Improve the format passed to `error'.
8792 * doprnt.c (doprnt): Improve commentary.
8794 * term.c (init_tty) [MSDOS]: Fix 1st argument to maybe_fatal.
8796 * Makefile.in (TAGS): Depend on $(M_FILE) and $(S_FILE), and scan
8799 * makefile.w32-in (globals.h): Add a dummy recipe, to make any
8800 changes in globals.h immediately force recompilation.
8801 (TAGS): Depend on $(CURDIR)/m/intel386.h and
8802 $(CURDIR)/s/ms-w32.h.
8803 (TAGS-gmake): Scan $(CURDIR)/m/intel386.h and $(CURDIR)/s/ms-w32.h.
8805 * character.c (Fchar_direction): Function deleted.
8806 (syms_of_character): Don't defsubr it.
8807 <char-direction-table>: Deleted.
8809 2011-04-23 Eli Zaretskii <eliz@gnu.org>
8811 Fix doprnt so it could be used again safely in `verror'. (Bug#8435)
8812 * doprnt.c: Include limits.h.
8813 (SIZE_MAX): New macro.
8814 (doprnt): Return a size_t value. 2nd arg is now size_t.
8815 Many local variables are now size_t instead of int or unsigned.
8816 Improve overflow protection. Support `l' modifier for integer
8817 conversions. Support %l conversion. Don't assume an EMACS_INT
8818 argument for integer conversions and for %c.
8820 * lisp.h (doprnt): Restore prototype.
8822 * makefile.w32-in ($(BLD)/callint.$(O)): Depend on
8825 * Makefile.in (base_obj): Add back doprnt.o.
8827 * deps.mk (doprnt.o): Add back prerequisites.
8828 (callint.o): Depend on character.h.
8830 * eval.c (internal_lisp_condition_case): Include the handler
8831 representation in the error message.
8832 (verror): Call doprnt instead of vsnprintf. Fix an off-by-one bug
8833 when breaking from the loop.
8835 * xdisp.c (vmessage): Call doprnt instead of vsnprintf.
8837 * callint.c (Fcall_interactively): When displaying error message
8838 about invalid control letter, pass the character's codepoint, not
8839 a pointer to its multibyte form. Improve display of the character
8840 in octal and display also its hex code.
8842 * character.c (char_string): Use %x to display the (unsigned)
8843 codepoint of an invalid character, to avoid displaying a bogus
8846 * font.c (check_otf_features): Pass SDATA of SYMBOL_NAME to
8847 `error', not SYMBOL_NAME itself.
8849 * coding.c (Fencode_sjis_char, Fencode_big5_char): Use %c for
8850 character arguments to `error'.
8852 * charset.c (check_iso_charset_parameter): Fix incorrect argument
8853 to `error' in error message about FINAL_CHAR argument. Make sure
8854 FINAL_CHAR is a character, and use %c when it is passed as
8855 argument to `error'.
8857 2011-04-23 Eli Zaretskii <eliz@gnu.org>
8859 * s/ms-w32.h (localtime): Redirect to sys_localtime.
8861 * w32.c: Include <time.h>.
8862 (sys_localtime): New function.
8864 2011-04-23 Chong Yidong <cyd@stupidchicken.com>
8866 * xdisp.c (init_xdisp): Initialize echo_area_window (Bug#6451).
8868 * buffer.c (syms_of_buffer): Doc fix (Bug#6902).
8870 2011-04-23 Samuel Thibault <sthibault@debian.org> (tiny change)
8872 * sysdep.c (wait_for_termination): On GNU Hurd, kill returns -1 on
8875 2011-04-19 Eli Zaretskii <eliz@gnu.org>
8877 * syntax.h (SETUP_SYNTAX_TABLE_FOR_OBJECT): Fix setting of
8878 gl_state.e_property when gl_state.object is Qt.
8880 * insdel.c (make_gap_larger): Remove limitation of buffer size
8883 2011-04-18 Chong Yidong <cyd@stupidchicken.com>
8885 * xdisp.c (lookup_glyphless_char_display)
8886 (produce_glyphless_glyph): Handle cons cell entry in
8887 glyphless-char-display.
8888 (Vglyphless_char_display): Document it.
8890 * term.c (produce_glyphless_glyph): Handle cons cell entry in
8891 glyphless-char-display.
8893 2011-04-17 Chong Yidong <cyd@stupidchicken.com>
8895 * xdisp.c (get_next_display_element): Remove unnecessary ifdefs.
8897 * termhooks.h (FRAME_WINDOW_P): Remove duplicated definitions.
8899 * dispextern.h (FACE_SUITABLE_FOR_ASCII_CHAR_P): Add missing
8900 definition for no-X builds.
8902 2011-04-16 Paul Eggert <eggert@cs.ucla.edu>
8904 Static checks with GCC 4.6.0 and non-default toolkits.
8906 * s/sol2-6.h, s/unixware.h (PTY_TTY_NAME_SPRINTF): Protoize decl.
8908 * process.c (keyboard_bit_set): Define only if SIGIO.
8909 (send_process_trap): Mark it with NO_RETURN if it doesn't return.
8910 (send_process): Repair possible setjmp clobbering.
8912 * s/usg5-4-common.h (SETUP_SLAVE_PTY): Don't pass extra arg to 'fatal'.
8914 * eval.c: Include <stdio.h>, for vsnprintf on non-GNU/Linux hosts.
8916 * data.c (arith_error): Mark with NO_RETURN if it doesn't return.
8918 * alloc.c (bytes_used_when_full, SPARE_MEMORY, BYTES_USED):
8919 Define only if needed.
8921 * sysdep.c (_FILE_OFFSET_BITS): Make this hack even uglier
8922 by pacifying GCC about it. Maybe it's time to retire it?
8923 * xfaces.c (USG, __TIMEVAL__): Likewise.
8925 * dispextern.h (struct redisplay_interface): Rename param
8927 * termhooks.h (struct terminal): Likewise.
8928 * xterm.c (xembed_send_message): Likewise.
8930 * insdel.c (make_gap_smaller): Define only if
8931 USE_MMAP_FOR_BUFFERS || REL_ALLOC || DOUG_LEA_MALLOC.
8933 * keyboard.c (read_char): Make a var volatile so longjmp won't clobber
8936 * emacs.c (MAX_HEAP_BSS_DIFF, my_edata): Move to where they're used,
8937 so that we aren't warned about unused symbols.
8939 * xfns.c (Fx_file_dialog): Rename local to avoid shadowing.
8941 * xdisp.c (x_produce_glyphs): Mark var as initialized (Bug#8512).
8943 * xfns.c (x_real_positions): Mark locals as initialized.
8945 * xmenu.c (xmenu_show): Don't use uninitialized vars.
8947 * xterm.c: Fix problems found by static analysis with other toolkits.
8948 (toolkit_scroll_bar_interaction): Define and use only if USE_X_TOOLKIT.
8949 (x_dispatch_event): Declare static if USE_GTK, and
8950 define if USE_GTK || USE_X_TOOLKIT.
8951 (SET_SAVED_BUTTON_EVENT): Define only if USE_X_TOOLKIT || USE_GTK.
8952 * xterm.h (x_dispatch_event): Extern only if USE_X_TOOLKIT.
8953 * xterm.c, xterm.h (x_mouse_leave): Bring this function back, but only
8954 if defined HAVE_MENUS && !defined USE_X_TOOLKIT && !defined USE_GTK.
8956 * xmenu.c (menu_help_callback): Pointer type fixes.
8957 Use const pointers when pointing at readonly data. Avoid pointer
8959 (FALSE): Remove unused macro.
8960 (update_frame_menubar): Remove unused decl.
8962 * xfns.c (Fx_hide_tip): Move locals to avoid shadowing.
8964 * menu.c (push_submenu_start, push_submenu_end): Do not define unless
8965 USE_X_TOOLKIT || USE_GTK || HAVE_NS || defined HAVE_NTGUI.
8966 (single_menu_item): Rename local to avoid shadowing.
8968 * keyboard.c (make_lispy_event): Remove unused local var.
8970 * frame.c, frame.h (x_get_resource_string): Bring this back, but
8971 only if HAVE_X_WINDOWS && !USE_X_TOOLKIT.
8973 * bitmaps: Change bitmaps from unsigned char back to the X11
8974 compatible char. Avoid the old compiler warnings about
8975 out-of-range initializers by using, for example, '\xab' rather
8978 * xgselect.c (xgselect_initialize): Check vs interface
8979 even if ! (defined (USE_GTK) || defined (HAVE_GCONF)).
8981 * xmenu.c (xmenu_show): Rename parm to avoid shadowing.
8983 * xterm.c (x_create_toolkit_scroll_bar): Use const * for pointers
8984 to read-only memory.
8986 * fns.c (vector): Remove; this old hack is no longer needed.
8988 * xsmfns.c (create_client_leader_window): Rename shadowing arg.
8990 (gdk_x11_set_sm_client_id) [!USE_GTK]: Don't define.
8992 * xrdb.c (x_load_resources): Omit unused local.
8994 * xfns.c (free_frame_menubar, atof): Remove duplicate decls.
8995 (x_window): Rename locals to avoid shadowing.
8996 (USG): Use the kludged USG macro, to pacify gcc.
8998 * xterm.c (x_alloc_nearest_color_for_widget): Remove; unused.
8999 (x_term_init): Remove local to avoid shadowing.
9001 * xfns.c, xterm.c (_XEditResCheckMessages): Protoize decl.
9003 * xdisp.c, dispextern.h (set_vertical_scroll_bar): Now extern if
9004 USE_TOOLKIT_SCROLL_BARS && !USE_GTK, as xterm.c needs it then.
9006 2011-04-16 Eli Zaretskii <eliz@gnu.org>
9008 * gnutls.c (Fgnutls_boot): Don't pass Lisp_Object to `error'.
9010 Fix regex.c, syntax.c and friends for buffers > 2GB.
9011 * syntax.h (struct gl_state_s): Declare character position members
9014 * syntax.c (update_syntax_table): Declare 2nd argument EMACS_INT.
9016 * textprop.c (verify_interval_modification, interval_of):
9017 Declare arguments EMACS_INT.
9019 * intervals.c (adjust_intervals_for_insertion): Declare arguments
9022 * intervals.h (CHECK_TOTAL_LENGTH): Cast to EMACS_INT, not `int'.
9024 * indent.c (Fvertical_motion): Local variable it_start is now
9027 * regex.c (re_match, re_match_2, re_match_2_internal)
9028 (bcmp_translate, regcomp, regexec, print_double_string)
9029 (group_in_compile_stack, re_search, re_search_2, regex_compile)
9030 (re_compile_pattern, re_exec): Declare arguments and local
9031 variables `size_t' and `ssize_t' and return values `regoff_t', as
9033 (POP_FAILURE_REG_OR_COUNT) <pfreg>: Declare `long'.
9034 (CHECK_INFINITE_LOOP) <failure>: Declare `ssize_t'.
9035 <compile_stack_type>: `size' and `avail' are now `size_t'.
9037 * regex.h <regoff_t>: Use ssize_t, not int.
9038 (re_search, re_search_2, re_match, re_match_2): Arguments that
9039 specify buffer/string position and length are now ssize_t and
9040 size_t. Return type is regoff_t.
9042 2011-04-16 Ben Key <bkey76@gmail.com>
9044 * nsfont.m: Fixed bugs in ns_get_family and
9045 ns_descriptor_to_entity that were caused by using free to
9046 deallocate memory blocks that were allocated by xmalloc (via
9047 xstrdup). This caused Emacs to crash when compiled with
9048 XMALLOC_OVERRUN_CHECK defined (when Emacs was configured with
9049 --enable-checking=xmallocoverrun). xfree is now used to
9050 deallocate these memory blocks.
9052 2011-04-15 Paul Eggert <eggert@cs.ucla.edu>
9054 * sysdep.c (emacs_read): Remove unnecessary check vs MAX_RW_COUNT.
9056 emacs_write: Accept and return EMACS_INT for sizes.
9057 See http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00514.html
9059 * gnutls.c, gnutls.h (emacs_gnutls_read, emacs_gnutls_write):
9060 Accept and return EMACS_INT.
9061 (emacs_gnutls_write): Return the number of bytes written on
9063 * sysdep.c, lisp.h (emacs_read, emacs_write): Likewise.
9064 (emacs_read, emacs_write): Remove check for negative size, as the
9065 Emacs source code has been audited now.
9066 * sysdep.c (MAX_RW_COUNT): New macro, to work around kernel bugs.
9067 (emacs_read, emacs_write): Use it.
9068 * process.c (send_process): Adjust to the new signatures of
9069 emacs_write and emacs_gnutls_write. Do not attempt to store
9070 a byte offset into an 'int'; it might overflow.
9071 See http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00483.html
9073 * sound.c: Don't assume sizes fit in 'int'.
9074 (struct sound_device.period_size, alsa_period_size):
9075 Return EMACS_INT, not int.
9076 (struct sound_device.write, vox_write, alsa_write):
9077 Accept EMACS_INT, not int.
9078 (wav_play, au_play): Use EMACS_INT to store sizes and to
9079 record read return values.
9081 2011-04-15 Ben Key <bkey76@gmail.com>
9083 * keyboard.c (Qundefined): Don't declare static since it is used
9085 * xfaces.c (Qbold, Qexpanded, Qitalic, Qcondensed): Don't declare
9086 static since they are used in nsfont.m.
9088 2011-04-15 Stefan Monnier <monnier@iro.umontreal.ca>
9090 * process.c (Qprocessp): Don't declare static.
9091 * lisp.h (Qprocessp): Declare again.
9093 2011-04-15 Juanma Barranquero <lekktu@gmail.com>
9095 * font.c (Qopentype): Don't make static (used from w32uniscribe.c).
9097 2011-04-14 Paul Eggert <eggert@cs.ucla.edu>
9099 Improve C-level modularity by making more things 'static'.
9101 Don't publish debugger-only interfaces to other modules.
9102 * lisp.h (safe_debug_print, debug_output_compilation_hack):
9103 (verify_bytepos, count_markers): Move decls to the only modules
9105 * region-cache.h (pp_cache): Likewise.
9106 * window.h (check_all_windows): Likewise.
9107 * marker.c, print.c, region-cache.c, window.c: Decls moved here.
9109 * sysdep.c (croak): Now static, if
9110 defined TIOCNOTTY || defined USG5 || defined CYGWIN.
9111 * syssignal.h (croak): Declare only if not static.
9113 * alloc.c (refill_memory_reserve): Now static if
9114 !defined REL_ALLOC || defined SYSTEM_MALLOC.
9115 * lisp.h (refill_memory_reserve): Declare only if not static.
9117 * xsettings.c, xsettings.h (xsettings_get_system_normal_font):
9118 Define only if USE_LUCID.
9120 * xrdb.c (x_customization_string, x_rm_string): Now static.
9122 * xmenu.c (x_menu_wait_for_event): Export only if USE_MOTIF.
9123 * xterm.h (x_menu_wait_for_event): Declare only if USE_MOTIF.
9125 * xdisp.c (draw_row_with_mouse_face): Now static.
9126 * dispextern.h (draw_row_with_mouse_fave): Remove decl.
9128 * window.h (check_all_windows): Mark externally visible.
9130 * window.c (window_deletion_count): Now static.
9132 * undo.c: Make symbols static if they're not exported.
9133 (last_undo_buffer, last_boundary_position, pending_boundary):
9136 * textprop.c (interval_insert_behind_hooks): Now static.
9137 (interval_insert_in_front_hooks): Likewise.
9139 * term.c: Make symbols static if they're not exported.
9140 (tty_turn_off_highlight, get_tty_terminal, max_frame_cols):
9141 (max_frame_lines, tty_set_terminal_modes):
9142 (tty_reset_terminal_modes, tty_turn_off_highlight):
9143 (get_tty_terminal): Now static.
9144 (term_mouse_moveto): Do not define if HAVE_WINDOW_SYSTEM.
9145 * termhooks.h (term_mouse_moveto): Do not declare if
9147 * dispextern.h (tty_set_terminal_modes, tty_reset_terminal_modes):
9148 (tty_turn_off_highlight, get_tty_terminal): Remove decls.
9150 * sysdep.c: Make symbols static if they're not exported.
9151 (emacs_get_tty, emacs_set_tty, old_fcntl_flags, old_fcntl_owner):
9153 (sigprocmask_set, full_mask): Remove; unused.
9154 (wait_debugging): Mark as visible.
9155 * syssignal.h (SIGFULLMASK, full_mask): Remove decls.
9156 * systty.h (emacs_get_tty, emacs_set_tty): Remove decls.
9158 * syntax.c (syntax_temp): Define only if !__GNUC__.
9160 * sound.c (current_sound_device, current_sound): Now static.
9162 * search.c (searchbufs, searchbuf_head): Now static.
9164 * scroll.c (scroll_cost): Remove; unused.
9165 * dispextern.h (scroll_cost): Remove decl.
9167 * region-cache.h (pp_cache): Mark as externally visible.
9169 * process.c: Make symbols static if they're not exported.
9170 (process_tick, update_tick, create_process, chan_process):
9171 (Vprocess_alist, proc_buffered_char, datagram_access):
9172 (fd_callback_data, send_process_frame, process_sent_to): Now static.
9173 (deactivate_process): Mark defn as static, as well as decl.
9174 * lisp.h (create_process): Remove decl.
9175 * process.h (chan_process, Vprocess_alist): Remove decls.
9177 * print.c: Make symbols static if they're not exported.
9178 (print_depth, new_backquote_output, being_printed, print_buffer):
9179 (print_buffer_size, print_buffer_pos, print_buffer_pos_byte):
9180 (print_interval, print_number_index, initial_stderr_stream):
9182 * lisp.h (Fprinc): Remove decl.
9183 (debug_output_compilation_hack): Mark as externally visible.
9185 * sysdep.c (croak): Move decl from here to syssignal.h.
9186 * syssignal.h (croak): Put it here, so the API can be checked when
9187 'croak' is called from dissociate_if_controlling_tty.
9189 * minibuf.c: Make symbols static if they're not exported.
9190 (minibuf_save_list, choose_minibuf_frame): Now static.
9191 * lisp.h (choose_minibuf_frame): Remove decl.
9193 * lisp.h (verify_bytepos, count_markers): Mark as externally visible.
9195 * lread.c: Make symbols static if they're not exported.
9196 (read_objects, initial_obarray, oblookup_last_bucket_number):
9198 (make_symbol): Remove; unused.
9199 * lisp.h (initial_obarray, make_symbol): Remove decls.
9201 * keyboard.c: Make symbols static if they're not exported.
9202 (single_kboard, recent_keys_index, total_keys, recent_keys):
9203 (this_command_key_count_reset, raw_keybuf, raw_keybuf_count):
9204 (this_single_command_key_start, echoing, last_auto_save):
9205 (read_key_sequence_cmd, dribble, recursive_edit_unwind):
9206 (command_loop, echo_now, keyboard_init_hook, help_char_p):
9207 (quit_throw_to_read_char, command_loop_2, top_level_1, poll_timer):
9208 (Vlispy_mouse_stem, double_click_count):
9210 (force_auto_save_soon): Define only if SIGDANGER.
9211 (ignore_mouse_drag_p): Now static if
9212 !defined HAVE_WINDOW_SYSTEM || defined USE_GTK || defined HAVE_NS.
9213 (print_help): Remove; unused.
9214 (stop_character, last_timer_event): Mark as externally visible.
9215 * keyboard.h (ignore_mouse_drag_p): Declare only if
9216 defined HAVE_WINDOW_SYSTEM && !defined USE_GTK && !defined HAVE_NS.
9217 (echo_now, help_char_p, quit_throw_to_read_char): Remove decls.
9218 * lisp.h (echoing): Remove decl.
9219 (force_auto_save_soon): Declare only if SIGDANGER.
9220 * xdisp.c (redisplay_window): Simplify code, to make it more
9221 obvious that ignore_mouse_drag_p is not accessed if !defined
9222 USE_GTK && !defined HAVE_NS.
9224 * intervals.c: Make symbols static if they're not exported.
9225 (merge_properties_sticky, merge_interval_right, delete_interval):
9227 * intervals.h (merge_interval_right, delete_interval): Remove decls.
9229 * insdel.c: Make symbols static if they're not exported.
9230 However, leave prepare_to_modify_buffer alone. It's never
9231 called from outside this function, but that appears to be a bug.
9232 (combine_after_change_list, combine_after_change_buffer):
9233 (adjust_after_replace, signal_before_change): Now static.
9234 (adjust_after_replace_noundo): Remove; unused.
9235 * lisp.h (adjust_after_replace, adjust_after_replace_noundo):
9236 (signal_before_change): Remove decls.
9238 * indent.c (val_compute_motion, val_vmotion): Now static.
9240 * image.c: Make symbols static if they're not exported.
9241 * dispextern.h (x_create_bitmap_from_xpm_data): Do not declare
9243 * image.c (x_create_bitmap_from_xpm_data): Do not define if USE_GTK.
9244 (xpm_color_cache, ct_table, ct_colors_allocated): Now static.
9246 * fringe.c (standard_bitmaps): Now static.
9247 (max_used_fringe_bitmap): Now static, unless HAVE_NS.
9249 * frame.c: Make symbols static if they're not exported.
9250 (x_report_frame_params, make_terminal_frame): Now static.
9251 (get_frame_param): Now static, unless HAVE_NS.
9252 (x_fullscreen_adjust): Define if WINDOWSNT, not if HAVE_WINDOW_SYSTEM.
9253 (x_get_resource_string): Remove; not used.
9254 * frame.h (make_terminal_frame, x_report_frame_params):
9255 (x_get_resource_string); Remove decls.
9256 (x_fullscreen_adjust): Declare only if WINDOWSNT.
9257 * lisp.h (get_frame_param): Declare only if HAVE_NS.
9259 * font.c, fontset.c: Make symbols static if they're not exported.
9260 * dispextern.h (FACE_SUITABLE_FOR_ASCII_CHAR_P): New macro.
9261 (FACE_SUITABLE_FOR_CHAR_P): Use it.
9262 * font.c (font_close_object): Now static.
9263 * font.h (font_close_object): Remove.
9264 * fontset.c (FONTSET_OBJLIST): Remove.
9265 (free_realized_fontset) #if-0 the body, which does nothing.
9266 (face_suitable_for_char_p): #if-0, as it's never called.
9267 * fontset.h (face_suitable_for_char_p): Remove decl.
9268 * xfaces.c (face_at_string_position):
9269 Use FACE_SUITABLE_FOR_ASCII_CHAR_P, not FACE_SUITABLE_FOR_CHAR_P,
9270 since 0 is always ASCII.
9272 * fns.c (weak_hash_tables): Now static.
9274 * fileio.c: Make symbols static if they're not exported.
9275 (auto_saving, auto_save_mode_bits, auto_save_error_occurred):
9276 (Vwrite_region_annotation_buffers): Now static.
9278 * eval.c: Make symbols static if they're not exported.
9279 (backtrace_list, lisp_eval_depth, when_entered_debugger): Now static.
9280 * lisp.h (backtrace_list): Remove decl.
9282 * emacs.c: Make symbols static if they're not exported.
9283 (malloc_state_ptr, malloc_using_checking, syms_of_emacs):
9284 (fatal_error_code, fatal_error_signal_hook, standard_args):
9286 (fatal_error_signal): Now static, unless FLOAT_CATCH_SIGKILL.
9287 (DEFINE_DUMMY_FUNCTION): Mark function as externally visible.
9288 (__CTOR_LIST__, __DTOR_LIST__): Now externally visible.
9289 * lisp.h (fatal_error_signal_hook): Remove decl.
9290 (fatal_error_signal): Declare only if FLOAT_CATCH_SIGKILL.
9292 * editfns.c: Move a (normally-unused) function to its only use.
9293 * editfns.c, lisp.h (get_operating_system_release): Remove.
9294 * process.c (init_process) [DARWIN_OS]: Do it inline, as it is not
9295 worth the hassle of breaking this out.
9297 * xterm.c: Make symbols static if they're not exported.
9298 (x_raise_frame, x_lower_frame, x_wm_set_window_state):
9299 (x_wm_set_icon_pixmap, x_initialize, XTread_socket_fake_io_error):
9300 (x_destroy_window, x_delete_display):
9302 (x_dispatch_event): Now static if ! (USE_MOTIF || USE_X_TOOLKIT).
9303 (x_mouse_leave): Remove; unused.
9304 * xterm.h (x_display_info_for_name, x_raise_frame, x_lower_frame):
9305 (x_destroy_window, x_wm_set_window_state, x_wm_set_icon_pixmap):
9306 (x_delete_display, x_initialize, x_set_border_pixel, x_screen_planes):
9308 (x_mouse_leave): Declare only if WINDOWSNT.
9309 (x_dispatch_event): Declare only if USE_MOTIF or USE_X_TOOLKIT.
9310 (xic_create_fontsetname): Declare only if HAVE_X_WINDOWS &&
9313 * ftxfont.c: Make symbols static if they're not exported.
9314 (ftxfont_driver): Export only if !defined HAVE_XFT && def8ined
9316 * font.h (ftxfont_driver): Likewise.
9318 * xfns.c: Make symbols static if they're not exported.
9319 (x_last_font_name, x_display_info_for_name):
9320 (x_set_foreground_color, x_set_background_color, x_set_mouse_color):
9321 (x_set_cursor_color, x_set_border_pixel, x_set_border_color):
9322 (x_set_cursor_type, x_set_icon_type, x_set_icon_name):
9323 (x_set_scroll_bar_foreground, x_set_scroll_bar_background):
9324 (x_explicitly_set_name, x_set_title, xic_defaut_fontset, tip_timer):
9325 (last_show_tip_args): Now static.
9326 (xic_defaut_fontset, xic_create_fontsetname): Define only if
9327 defined HAVE_X_WINDOWS && defined USE_X_TOOLKIT
9328 (x_screen_planes): Remove; unused.
9329 * dispextern.h (x_screen_planes): Remove decl.
9331 * dispnew.c: Make symbols static if they're not exported.
9332 * dispextern.h (redraw_garbaged_frames, scrolling):
9333 (increment_row_positions): Remove.
9334 * dispnew.c (new_glyph_matrix, increment_row_positions, scrolling):
9335 (delayed_size_change, glyph_matrix_count, glyph_pool_count):
9337 (redraw_garbaged_frames): Remove; unused.
9339 * xfaces.c: Make symbols static if they're not exported.
9340 * dispextern.h (ascii_face_of_lisp_face, free_realized_face):
9342 * xterm.h (defined_color): Remove decls.
9343 (x_free_dpy_colors): Declare only if USE_X_TOOLKIT.
9344 * xfaces.c (tty_suppress_bold_inverse_default_colors_p):
9345 (menu_face_changed_default, defined_color, free_realized_face):
9346 (x_free_dpy_colors): Define only if USE_X_TOOLKIT.
9347 (ascii_face_of_lisp_face): Remove; unused.
9349 * xdisp.c: Make symbols static if they're not exported.
9350 * dispextern.h (scratch_glyph_row, window_box_edges):
9351 (glyph_to_pixel_coords, set_cursor_from_row):
9352 (get_next_display_element, set_iterator_to_next):
9353 (highlight_trailing_whitespace, frame_to_window_pixel_xy):
9354 (show_mouse_face): Remove decls
9355 * frame.h (message_buf_print): Likewise.
9356 * lisp.h (pop_message, set_message, check_point_in_composition):
9358 * xterm.h (set_vertical_scroll_bar): Likewise.
9359 * xdisp.c (list_of_error, Vmessage_stack, line_number_displayed):
9360 (message_buf_print, scratch_glyph_row, displayed_buffer):
9361 (set_iterator_to_next, pop_message, set_message, set_cursor_from_row):
9362 (get_next_display_element, show_mouse_face, window_box_edges):
9363 (frame_to_window_pixel_xy, check_point_in_composition):
9364 (set_vertical_scroll_bar, highlight_trailing_whitespace): Now static.
9365 (glyph_to_pixel_coords): Remove; unused.
9367 * dired.c (file_name_completion): Now static.
9369 * dbusbind.c (xd_in_read_queued_messages): Now static.
9371 * lisp.h (circular_list_error, FOREACH): Remove; unused.
9372 * data.c (circular_list_error): Remove.
9374 * commands.h (last_point_position, last_point_position_buffer):
9375 (last_point_position_window): Remove decls.
9376 * keyboard.c: Make these variables static.
9378 * coding.h (coding, code_convert_region, encode_coding_gap):
9380 * coding.c (Vsjis_coding_system, Vbig5_coding_system):
9381 (iso_code_class, detect_coding, code_convert_region): Now static.
9382 (encode_coding_gap): Remove; unused.
9384 * chartab.c (chartab_chars, chartab_bits): Now static.
9386 * charset.h (charset_iso_8859_1): Remove decl.
9387 * charset.c (charset_iso_8859_1, charset_emacs, map_charset_for_dump):
9390 * ccl.h (check_ccl_update, Vccl_program_table): Remove decls.
9391 * ccl.c (Vccl_program_table): Now static.
9392 (check_ccl_update): Remove; unused.
9394 * category.c (SET_CATEGORY_SET, set_category_set): Move here.
9395 * category.h: ... from here.
9396 * category.c (check_category_table, set_category_set): Now static.
9398 * casetab.c (Vascii_upcase_table, Vascii_eqv_table): Now static.
9399 * lisp.h: Remove these decls.
9401 * buffer.c (buffer_count): Remove unused var.
9403 * bidi.c (bidi_dump_cached_states): Mark as externally visible,
9404 so that it's not optimized away.
9405 (bidi_ignore_explicit_marks_for_paragraph_level): Likewise.
9406 * dispextern.h (bidi_dump_cached_states): Remove, since it's
9407 exported only to the debugger.
9409 * atimer.c (alarm_signal_handler, run_all_atimers): Now static.
9410 * atimer.h (run_all_atimers): Remove; not exported.
9412 font.c: Make copy_font_spec and merge_font_spec ordinary C functions.
9413 * font.c (copy_font_spec): Rename from Fcopy_font_spec, since it
9414 was inaccessible from Lisp.
9415 (merge_font_spec): Likewise, renaming from Fmerge_font_spec.
9416 * font.c, font.h, fontset.c, xfaces.c, xfont.c: Change all uses.
9418 alloc.c: Import and export fewer symbols, and remove unused items.
9419 * lisp.h (suppress_checking, die): Declare only if ENABLE_CHECKING
9421 (suppress_checking): Add EXTERNALLY_VISIBLE attribute, so that
9422 it's not optimized away by whole-program optimization.
9423 (message_enable_multibyte, free_misc): Remove.
9424 (catchlist, handlerlist, mark_backtrace):
9425 Declare only if BYTE_MARK_STACK.
9426 (mark_byte_stack): Likewise, fixing a ifdef-vs-if typo.
9427 * alloc.c (pure): Export only if VIRT_ADDR_VARIES is defined.
9428 (message_enable_multibyte): Remove decl.
9429 (free_misc, interval_free_list, float_block, float_block_index):
9430 (n_float_blocks, float_free_list, cons_block, cons_block_index):
9431 (cons_free_list, last_marked_index):
9433 (suppress_checking, die): Define only if ENABLE_CHECKING is defined.
9434 * eval.c (catchlist, handlerlist): Export only if BYTE_MARK_STACK.
9435 (mark_backtrace): Define only if BYTE_MARK_STACK.
9436 * xdisp.c (message_enable_multibyte): Now static.
9438 Declare Lisp_Object Q* variables to be 'static' if not exported.
9439 This makes it easier for human readers (and static analyzers)
9440 to see whether these variables are used from other modules.
9441 * alloc.c, buffer.c, bytecode.c, callint.c, casetab.c, category.c:
9442 * ccl.c, character.c, charset.c, cmds.c, coding.c, composite.c:
9443 * data.c, dbusbind.c, dired.c, editfns.c, eval.c, fileio.c, fns.c:
9444 * font.c, frame.c, fringe.c, ftfont.c, image.c, keyboard.c, keymap.c:
9445 * lread.c, macros.c, minibuf.c, print.c, process.c, search.c:
9446 * sound.c, syntax.c, textprop.c, window.c, xdisp.c, xfaces.c, xfns.c:
9447 * xmenu.c, xselect.c:
9448 Declare Q* vars static if they are not used in other modules.
9449 * ccl.h, character.h, charset.h, coding.h, composite.h, font.h:
9450 * frame.h, intervals.h, keyboard.h, lisp.h, process.h, syntax.h:
9451 Remove decls of unexported vars.
9452 * keyboard.h (EVENT_HEAD_UNMODIFIED): Remove now-unused macro.
9454 * lisp.h (DEFINE_FUNC): Make sname 'static'.
9456 Make Emacs functions such as Fatom 'static' by default.
9457 This makes it easier for human readers (and static analyzers)
9458 to see whether these functions can be called from other modules.
9459 DEFUN now defines a static function. To make the function external
9460 so that it can be used in other C modules, use the new macro DEFUE.
9461 * lisp.h (Funibyte_char_to_multibyte, Fsyntax_table_p):
9462 (Finit_image_library):
9463 (Feval_region, Fbacktrace, Ffetch_bytecode, Fswitch_to_buffer):
9464 (Ffile_executable_p, Fmake_symbolic_link, Fcommand_execute):
9465 (Fget_process, Fdocumentation_property, Fbyte_code, Ffile_attributes):
9466 Remove decls, since these functions are now static.
9467 (Funintern, Fget_internal_run_time): New decls, since these functions
9468 were already external.
9470 * alloc.c, buffer.c, callint.c, callproc.c, casefiddle.c, casetab.c:
9471 * ccl.c, character.c, chartab.c, cmds.c, coding.c, data.c, dispnew.c:
9472 * doc.c, editfns.c, emacs.c, eval.c, fileio.c, filelock.c, floatfns.c:
9473 * fns.c, font.c, fontset.c, frame.c, image.c, indent.c:
9474 * keyboard.c, keymap.c, lread.c:
9475 * macros.c, marker.c, menu.c, minibuf.c, print.c, process.c, search.c:
9476 * syntax.c, term.c, terminal.c, textprop.c, undo.c:
9477 * window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xsettings.c:
9478 Mark functions with DEFUE instead of DEFUN,
9479 if they are used in other modules.
9480 * buffer.c (Fset_buffer_major_mode, Fdelete_overlay): New forward
9481 decls for now-static functions.
9482 * buffer.h (Fdelete_overlay): Remove decl.
9483 * callproc.c (Fgetenv_internal): Mark as internal.
9484 * composite.c (Fremove_list_of_text_properties): Remove decl.
9485 (Fcomposition_get_gstring): New forward static decl.
9486 * composite.h (Fcomposite_get_gstring): Remove decl.
9487 * dired.c (Ffile_attributes): New forward static decl.
9488 * doc.c (Fdocumntation_property): New forward static decl.
9489 * eval.c (Ffetch_bytecode): New forward static decl.
9490 (Funintern): Remove extern decl; now in .h file where it belongs.
9491 * fileio.c (Fmake_symbolic_link): New forward static decl.
9492 * image.c (Finit_image_library): New forward static decl.
9493 * insdel.c (Fcombine_after_change_execute): Make forward decl static.
9494 * intervals.h (Fprevious_property_change):
9495 (Fremove_list_of_text_properties): Remove decls.
9496 * keyboard.c (Fthis_command_keys): Remove decl.
9497 (Fcommand_execute): New forward static decl.
9498 * keymap.c (Flookup_key): New forward static decl.
9499 (Fcopy_keymap): Now static.
9500 * keymap.h (Flookup_key): Remove decl.
9501 * process.c (Fget_process): New forward static decl.
9502 (Fprocess_datagram_address): Mark as internal.
9503 * syntax.c (Fsyntax_table_p): New forward static decl.
9504 (skip_chars): Remove duplicate decl.
9505 * textprop.c (Fprevious_property_change): New forward static decl.
9506 * window.c (Fset_window_fringes, Fset_window_scroll_bars):
9508 (Fset_window_margins, Fset_window_vscroll): New forward static decls.
9509 * window.h (Fset_window_vscroll, Fset_window_margins): Remove decls.
9511 * editfns.c (Fformat): Remove unreachable code.
9513 2011-04-14 Andreas Schwab <schwab@linux-m68k.org>
9515 * fileio.c (Finsert_file_contents): Fix typo in 2005-05-13
9518 2011-04-13 Eli Zaretskii <eliz@gnu.org>
9520 * xdisp.c (handle_invisible_prop): Don't call bidi_paragraph_init
9521 when at ZV. (Bug#8487)
9523 2011-04-12 Andreas Schwab <schwab@linux-m68k.org>
9525 * charset.c (Fclear_charset_maps): Use xfree instead of free.
9527 * keyboard.c (parse_tool_bar_item): Likewise.
9528 * sound.c (sound_cleanup, alsa_close): Likewise.
9529 * termcap.c (tgetent): Likewise.
9530 * xfns.c (x_default_font_parameter): Likewise.
9531 * xsettings.c (read_and_apply_settings): Likewise.
9533 * alloc.c (overrun_check_malloc, overrun_check_realloc)
9534 (overrun_check_free): Protoize.
9536 2011-04-12 Paul Eggert <eggert@cs.ucla.edu>
9538 * sysdep.c (emacs_read, emacs_write): Check for negative sizes
9539 since callers should never pass a negative size.
9540 Change the signature to match that of plain 'read' and 'write'; see
9541 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00397.html>.
9542 * lisp.h: Update prototypes of emacs_write and emacs_read.
9544 2011-04-11 Eli Zaretskii <eliz@gnu.org>
9546 * xdisp.c (redisplay_window): Don't try to determine the character
9547 position of the scroll margin if the window start point w->startp
9548 is outside the buffer's accessible region. (Bug#8468)
9550 2011-04-10 Eli Zaretskii <eliz@gnu.org>
9552 Fix write-region and its subroutines for buffers > 2GB.
9553 * fileio.c (a_write, e_write): Modify declaration of arguments and
9554 local variables to support buffers larger than 2GB.
9555 (Fcopy_file): Use EMACS_INT for return value of emacs_read.
9557 * sysdep.c (emacs_write, emacs_read): Use ssize_t for last
9558 argument, local variables, and return value.
9560 * lisp.h: Update prototypes of emacs_write and emacs_read.
9562 * sound.c (vox_write): Use ssize_t for return value of emacs_write.
9564 2011-04-10 Paul Eggert <eggert@cs.ucla.edu>
9566 * xdisp.c (vmessage): Use memchr, not strnlen, which some hosts lack.
9568 Fix more problems found by GCC 4.6.0's static checks.
9570 * xdisp.c (vmessage): Use a better test for character truncation.
9572 * charset.c (load_charset_map): <, not <=, for optimization,
9573 and to avoid potential problems with integer overflow.
9574 * chartab.c (sub_char_table_set_range, char_table_set_range): Likewise.
9575 * casetab.c (set_identity, shuffle): Likewise.
9576 * editfns.c (Fformat): Likewise.
9577 * syntax.c (skip_chars): Likewise.
9579 * xmenu.c (set_frame_menubar): Allocate smaller local vectors.
9580 This also lets GCC 4.6.0 generate slightly better loop code.
9582 * callint.c (Fcall_interactively): <, not <=, for optimization.
9583 (Fcall_interactively): Count the number of arguments produced,
9584 not the number of arguments given. This is simpler and lets GCC
9585 4.6.0 generate slightly better code.
9587 * ftfont.c: Distingish more carefully between FcChar8 and char.
9588 The previous code passed unsigned char * to a functions like
9589 strlen and xstrcasecmp that expect char *, which does not
9590 conform to the C standard.
9591 (get_adstyle_property, ftfont_pattern_entity): Use FcChar8 for
9592 arguments to FcPatternGetString, and explicitly cast FcChar8 * to
9593 char * when the C standard requires it.
9595 * keyboard.c (read_char): Remove unused var.
9597 * eval.c: Port to Windows vsnprintf (Bug#8435).
9599 (SIZE_MAX): Define if the headers do not.
9600 (verror): Do not give up if vsnprintf returns a negative count.
9601 Instead, grow the buffer. This ports to Windows vsnprintf, which
9602 does not conform to C99. Problem reported by Eli Zaretskii.
9603 Also, simplify the allocation scheme, by avoiding the need for
9604 calling realloc, and removing the ALLOCATED variable.
9606 * eval.c (verror): Initial buffer size is 4000 (not 200) bytes.
9608 Remove invocations of doprnt, as Emacs now uses vsnprintf.
9609 But keep the doprint source code for now, as we might revamp it
9610 and use it again (Bug#8435).
9611 * lisp.h (doprnt): Remove.
9612 * Makefile.in (base_obj): Remove doprnt.o.
9613 * deps.mk (doprnt.o): Remove.
9615 error: Print 32- and 64-bit integers portably (Bug#8435).
9616 Without this change, on typical 64-bit hosts error ("...%d...", N)
9617 was used to print both 32- and 64-bit integers N, which relied on
9619 * lisp.h, m/amdx86-64.h, m/ia64.h, m/ibms390x.h (pEd): New macro.
9620 * lisp.h (error, verror): Mark as printf-like functions.
9621 * eval.c (verror): Use vsnprintf, not doprnt, to do the real work.
9622 Report overflow in size calculations when allocating printf buffer.
9623 Do not truncate output string at its first null byte.
9624 * xdisp.c (vmessage): Use vsnprintf, not doprnt, to do the real work.
9625 Truncate the output at a character boundary, since vsnprintf does not
9627 * charset.c (check_iso_charset_parameter): Convert internal
9628 character to string before calling 'error', since %c now has the
9630 * coding.c (Fdecode_sjis_char, Fdecode_big5_char): Avoid int
9631 overflow when computing char to be passed to 'error'. Do not
9632 pass Lisp_Object to 'error'; pass the integer instead.
9633 * nsfns.m (Fns_do_applescript): Use int, not long, since it's
9634 formatted with plain %d.
9636 * eval.c (internal_lisp_condition_case): Don't pass spurious arg.
9638 * keyboard.c (access_keymap_keyremap): Print func name, not garbage.
9640 * coding.c (Fdecode_sjis_char): Don't assume CODE fits in int.
9642 * xterm.c (x_catch_errors): Remove duplicate declaration.
9644 * term.c (maybe_fatal): Mark its 3rd arg as a printf format, too.
9646 * xdisp.c, lisp.h (message_nolog): Remove; unused.
9648 2011-04-10 Jim Meyering <meyering@redhat.com>
9650 use ssize_t and size_t for read- and write-like emacs_gnutls_* functions
9651 * gnutls.c (emacs_gnutls_read): Adjust signature to be more read-like:
9652 return ssize_t not "int", and use size_t as the buffer length.
9653 (emacs_gnutls_write): Likewise, and make the buffer pointer "const".
9654 * gnutls.h: Update declarations.
9655 * process.c (read_process_output): Use ssize_t, to match.
9656 (send_process): Likewise.
9658 2011-04-09 Chong Yidong <cyd@stupidchicken.com>
9660 * image.c (Fimagemagick_types): Doc fix, and comment cleanup.
9662 2011-04-09 Chong Yidong <cyd@stupidchicken.com>
9664 * ftfont.c (get_adstyle_property, ftfont_pattern_entity):
9665 Use unsigned char, to match FcChar8 type definition.
9667 * xterm.c (handle_one_xevent):
9668 * xmenu.c (create_and_show_popup_menu):
9669 * xselect.c (x_decline_selection_request)
9670 (x_reply_selection_request): Avoid type-punned deref of X events.
9672 2011-04-09 Eli Zaretskii <eliz@gnu.org>
9674 Fix some uses of `int' instead of EMACS_INT.
9675 * search.c (string_match_1, fast_string_match)
9676 (fast_c_string_match_ignore_case, fast_string_match_ignore_case)
9677 (scan_buffer, find_next_newline_no_quit)
9678 (find_before_next_newline, search_command, Freplace_match)
9679 (Fmatch_data): Make some `int' variables be EMACS_INT.
9681 * xdisp.c (display_count_lines): 3rd argument and return value now
9682 EMACS_INT. All callers changed.
9683 (pint2hrstr): Last argument is now EMACS_INT.
9685 * coding.c (detect_coding_utf_8, detect_coding_emacs_mule)
9686 (detect_coding_iso_2022, detect_coding_sjis, detect_coding_big5)
9687 (detect_coding_ccl, detect_coding_charset, decode_coding_utf_8)
9688 (decode_coding_utf_16, decode_coding_emacs_mule)
9689 (decode_coding_iso_2022, decode_coding_sjis, decode_coding_big5)
9690 (decode_coding_ccl, decode_coding_charset)
9691 <consumed_chars, consumed_chars_base>: Declare EMACS_INT.
9692 (decode_coding_iso_2022, decode_coding_emacs_mule)
9693 (decode_coding_sjis, decode_coding_big5, decode_coding_charset)
9694 <char_offset, last_offset>: Declare EMACS_INT.
9695 (encode_coding_utf_8, encode_coding_utf_16)
9696 (encode_coding_emacs_mule, encode_invocation_designation)
9697 (encode_designation_at_bol, encode_coding_iso_2022)
9698 (encode_coding_sjis, encode_coding_big5, encode_coding_ccl)
9699 (encode_coding_raw_text, encode_coding_charset) <produced_chars>:
9701 (ASSURE_DESTINATION): Declare more_bytes EMACS_INT.
9702 (encode_invocation_designation): Last argument P_NCHARS is now
9704 (decode_eol): Declare pos_byte, pos, and pos_end EMACS_INT.
9705 (produce_chars): from_nchars and to_nchars are now EMACS_INT.
9707 * coding.h (struct coding_system) <head_ascii>: Declare EMACS_INT.
9710 * ccl.c (Fccl_execute_on_string): Declare some variables
9713 2011-04-08 Samuel Thibault <sthibault@debian.org> (tiny change)
9715 * term.c (init_tty): Fix incorrect ifdef placement (Bug#8450).
9717 2011-03-19 Christoph Scholtes <cschol2112@googlemail.com>
9719 * process.c (Fformat_network_address): Doc fix.
9721 2011-04-08 T.V. Raman <tv.raman.tv@gmail.com> (tiny change)
9723 * xml.c (parse_region): Avoid creating spurious whitespace nodes.
9725 2011-04-08 Chong Yidong <cyd@stupidchicken.com>
9727 * keyboard.c (read_char): Call Lisp function help-form-show,
9728 instead of using internal_with_output_to_temp_buffer.
9729 (Qhelp_form_show): New var.
9730 (syms_of_keyboard): Use DEFSYM macro.
9732 * print.c (internal_with_output_to_temp_buffer): Function deleted.
9734 * lisp.h (internal_with_output_to_temp_buffer): Remove prototype.
9736 2011-04-06 Chong Yidong <cyd@stupidchicken.com>
9738 * process.c (Flist_processes): Remove to Lisp.
9739 (list_processes_1): Delete.
9741 2011-04-06 Eli Zaretskii <eliz@gnu.org>
9743 * msdos.c (careadlinkat, careadlinkatcwd): MS-DOS replacements.
9745 * w32.c (careadlinkat, careadlinkatcwd): New always-fail stubs.
9747 2011-04-06 Paul Eggert <eggert@cs.ucla.edu>
9749 Fix more problems found by GCC 4.6.0's static checks.
9751 * xmenu.c (Fx_popup_dialog): Don't assume string is free of formats.
9753 * menu.c (Fx_popup_menu): Don't assume error_name lacks printf formats.
9755 * lisp.h (message, message_nolog, fatal): Mark as printf-like.
9757 * xdisp.c (vmessage): Mark as a printf-like function.
9759 * term.c (vfatal, maybe_fatal): Mark as printf-like functions.
9761 * sound.c (sound_warning): Don't crash if arg contains a printf format.
9763 * image.c (tiff_error_handler, tiff_warning_handler): Mark as
9764 printf-like functions.
9765 (tiff_load): Add casts to remove these marks before passing them
9766 to system-supplied API.
9768 * eval.c (Fsignal): Remove excess argument to 'fatal'.
9770 * coding.c (EMIT_ONE_BYTE, EMIT_TWO_BYTES): Use unsigned, not int.
9771 This avoids several warnings with gcc -Wstrict-overflow.
9772 (DECODE_COMPOSITION_RULE): If the rule is invalid, goto invalid_code
9773 directly, rather than having caller test rule sign. This avoids
9774 some unnecessary tests.
9775 * composite.h (COMPOSITION_ENCODE_RULE_VALID): New macro.
9776 (COMPOSITION_ENCODE_RULE): Arguments now must be valid. This
9777 affects only one use, in DECODE_COMPOSITION_RULE, which is changed.
9779 * xfont.c (xfont_text_extents): Remove var that was set but not used.
9780 (xfont_open): Avoid unnecessary tests.
9782 * composite.c (composition_gstring_put_cache): Use unsigned integer.
9784 * composite.h, composite.c (composition_gstring_put_cache):
9785 Use EMACS_INT, not int, for length.
9787 * composite.h (COMPOSITION_DECODE_REFS): New macro,
9788 breaking out part of COMPOSITION_DECODE_RULE.
9789 (COMPOSITION_DECODE_RULE): Use it.
9790 * composite.c (get_composition_id): Remove unused local vars,
9791 by using the new macro.
9793 * textprop.c (set_text_properties_1): Change while to do-while,
9794 since the condition is always true at first.
9796 * intervals.c (graft_intervals_into_buffer): Mark var as used.
9797 (interval_deletion_adjustment): Return unsigned value.
9800 * process.c (list_processes_1, create_pty, read_process_output):
9801 (exec_sentinel): Remove vars that were set but not used.
9802 (create_pty): Remove unnecessary "volatile"s.
9803 (Fnetwork_interface_info): Avoid possibility of int overflow.
9804 (read_process_output): Do adaptive read buffering even if carryover.
9805 (read_process_output): Simplify nbytes computation if buffered.
9807 * bytecode.c (exec_byte_code): Rename local to avoid shadowing.
9809 * syntax.c (scan_words): Remove var that was set but not used.
9810 (update_syntax_table): Use unsigned instead of int.
9812 * lread.c (lisp_file_lexically_bound_p): Use ints rather than endptrs.
9813 (lisp_file_lexically_bound_p, read1): Use unsigned instead of int.
9814 (safe_to_load_p): Make the end-of-loop test the inverse of the in-loop.
9816 * print.c (print_error_message): Avoid int overflow.
9818 * font.c (font_list_entities): Redo for clarity,
9819 so that reader need not know FONT_DPI_INDEX + 1 == FONT_SPACING_INDEX.
9821 * font.c (font_find_for_lface, Ffont_get_glyphs): Remove unused vars.
9822 (font_score): Avoid potential overflow in diff calculation.
9824 * fns.c (substring_both): Remove var that is set but not used.
9825 (sxhash): Redo loop for clarity and to avoid wraparound warning.
9827 * eval.c (funcall_lambda): Rename local to avoid shadowing.
9829 * alloc.c (mark_object_loop_halt, mark_object): Use size_t, not int.
9830 Otherwise, GCC 4.6.0 optimizes the loop check away since the check
9831 can always succeed if overflow has undefined behavior.
9833 * search.c (boyer_moore, wordify): Remove vars set but not used.
9834 (wordify): Omit three unnecessary tests.
9836 * indent.c (MULTIBYTE_BYTES_WIDTH): Don't compute wide_column.
9837 All callers changed. This avoids the need for an unused var.
9839 * casefiddle.c (casify_region): Remove var that is set but not used.
9841 * dired.c (file_name_completion): Remove var that is set but not used.
9843 * fileio.c (Finsert_file_contents): Make EOF condition clearer.
9845 * fileio.c (Finsert_file_contents): Avoid signed integer overflow.
9846 (Finsert_file_contents): Remove unnecessary code checking fd.
9848 * minibuf.c (read_minibuf_noninteractive): Use size_t for sizes.
9849 Check for integer overflow on size calculations.
9851 * buffer.c (Fprevious_overlay_change): Remove var that is set
9854 * keyboard.c (menu_bar_items, read_char_minibuf_menu_prompt):
9855 Remove vars that are set but not used.
9856 (timer_check_2): Don't assume timer-list and idle-timer-list are lists.
9857 (timer_check_2): Mark vars as initialized.
9859 * gtkutil.c (xg_get_file_with_chooser): Mark var as initialized.
9861 * image.c (lookup_image): Remove var that is set but not used.
9862 (xbm_load): Use parse_p, for gcc -Werror=unused-but-set-variable.
9864 * fontset.c (Finternal_char_font, Ffontset_info): Remove vars
9865 that are set but not used.
9867 * xfns.c (make_invisible_cursor): Don't return garbage
9868 if XCreateBitmapFromData fails (Bug#8410).
9870 * xselect.c (x_get_local_selection, x_handle_property_notify):
9871 Remove vars that are set but not used.
9873 * xfns.c (x_create_tip_frame): Remove var that is set but not used.
9874 (make_invisible_cursor): Initialize a possibly-uninitialized variable.
9876 * xterm.c (x_scroll_bar_to_input_event) [!USE_GTK]:
9877 Remove var that is set but not used.
9878 (scroll_bar_windows_size): Now size_t, not int.
9879 (x_send_scroll_bar_event): Use size_t, not int, for sizes.
9882 * xfaces.c (realize_named_face): Remove vars that are set but not used.
9883 (map_tty_color) [!defined MSDOS]: Likewise.
9885 * term.c (tty_write_glyphs): Use size_t; this avoids overflow warning.
9887 * coding.c: Remove vars that are set but not used.
9888 (DECODE_COMPOSITION_RULE): Remove 2nd arg, which is unused.
9889 All callers changed.
9890 (decode_coding_utf_8, decode_coding_utf_16 decode_coding_emacs_mule):
9891 (decode_coding_iso_2022, encode_coding_sjis, encode_coding_big5):
9892 (decode_coding_charset): Remove vars that are set but not used.
9894 * bytecode.c (Fbyte_code) [!defined BYTE_CODE_SAFE]: Remove var
9895 that is set but not used.
9897 * print.c (print_object): Remove var that is set but not used.
9899 Replace 2 copies of readlink code with 1 gnulib version (Bug#8401).
9900 The gnulib version avoids calling malloc in the usual case,
9901 and on 64-bit hosts doesn't have some arbitrary 32-bit limits.
9902 * fileio.c (Ffile_symlink_p): Use emacs_readlink.
9903 * filelock.c (current_lock_owner): Likewise.
9904 * lisp.h (READLINK_BUFSIZE, emacs_readlink): New function.
9905 * sysdep.c: Include allocator.h, careadlinkat.h.
9906 (emacs_no_realloc_allocator): New static constant.
9907 (emacs_readlink): New function.
9908 * deps.mk (sysdep.o): Depend on ../lib/allocator.h and on
9909 ../lib/careadlinkat.h.
9911 2011-04-04 Stefan Monnier <monnier@iro.umontreal.ca>
9913 * keyboard.c (safe_run_hook_funcall): Fix last change (don't stop at the
9914 first non-nil return value).
9916 2011-04-03 Jan Djärv <jan.h.d@swipnet.se>
9918 * nsterm.m (ns_update_auto_hide_menu_bar): Define MAC_OS_X_VERSION_10_6
9919 if not defined (Bug#8403).
9921 2011-04-02 Juanma Barranquero <lekktu@gmail.com>
9923 * xdisp.c (display_count_lines): Remove parameter `start',
9924 unused since 1998-01-01T02:27:27Z!rms@gnu.org. All callers changed.
9925 (get_char_face_and_encoding): Remove parameter `multibyte_p',
9926 unused since 2008-05-14T01:40:23Z!handa@m17n.org. All callers changed.
9927 (fill_stretch_glyph_string): Remove parameters `row' and `area',
9928 unused at least since Kim's GUI unification at 2003-03-16T20:45:46Z!storm@cua.dk
9929 and thereabouts. All callers changed.
9930 (get_per_char_metric): Remove parameter `f', unused since
9931 2008-05-14T01:40:23Z!handa@m17n.org. All callers changed.
9933 2011-04-02 Jim Meyering <meyering@redhat.com>
9935 do not dereference NULL upon failed strdup
9936 * nsfont.m (ns_descriptor_to_entity): Use xstrdup, not strdup.
9937 (ns_get_family): Likewise.
9939 2011-04-02 Juanma Barranquero <lekktu@gmail.com>
9941 * eval.c (unwind_to_catch) [DEBUG_GCPRO]: Remove redundant assignment.
9943 2011-04-02 Jan Djärv <jan.h.d@swipnet.se>
9945 * nsterm.m (ns_update_auto_hide_menu_bar): Only for OSX 10.6 or
9948 2011-04-01 Stefan Monnier <monnier@iro.umontreal.ca>
9950 Add lexical binding.
9952 * window.c (Ftemp_output_buffer_show): New fun.
9953 (Fsave_window_excursion):
9954 * print.c (Fwith_output_to_temp_buffer): Move to subr.el.
9956 * lread.c (lisp_file_lexically_bound_p): New function.
9957 (Fload): Bind Qlexical_binding.
9958 (readevalloop): Remove `evalfun' arg.
9959 Bind Qinternal_interpreter_environment.
9960 (Feval_buffer): Bind Qlexical_binding.
9961 (defvar_int, defvar_bool, defvar_lisp_nopro, defvar_kboard):
9963 (syms_of_lread): Declare `lexical-binding'.
9965 * lisp.h (struct Lisp_Symbol): New field `declared_special'.
9967 * keyboard.c (eval_dyn): New fun.
9968 (menu_item_eval_property): Use it.
9970 * image.c (parse_image_spec): Use Ffunctionp.
9972 * fns.c (concat, mapcar1): Accept byte-code-functions.
9974 * eval.c (Fsetq): Handle lexical vars.
9975 (Fdefun, Fdefmacro, Ffunction): Make closures when needed.
9976 (Fdefconst, Fdefvaralias, Fdefvar): Mark as dynamic.
9977 (FletX, Flet): Obey lexical binding.
9978 (Fcommandp): Handle closures.
9979 (Feval): New `lexical' arg.
9980 (eval_sub): New function extracted from Feval. Use it almost
9981 everywhere where Feval was used. Look up vars in lexical env.
9983 (Ffunctionp): Move from subr.el.
9984 (Ffuncall): Handle closures.
9985 (apply_lambda): Remove `eval_flags'.
9986 (funcall_lambda): Handle closures and new byte-code-functions.
9987 (Fspecial_variable_p): New function.
9988 (syms_of_eval): Initialize the Vinternal_interpreter_environment var,
9989 but without exporting it to Lisp.
9991 * doc.c (Fdocumentation, store_function_docstring):
9992 * data.c (Finteractive_form): Handle closures.
9994 * callint.c (Fcall_interactively): Preserve lexical-binding mode for
9997 * bytecode.c (Bstack_ref, Bstack_set, Bstack_set2, BdiscardN):
9999 (exec_byte_code): New function extracted from Fbyte_code to handle new
10000 calling convention for byte-code-functions. Add new byte-codes.
10002 * buffer.c (defvar_per_buffer): Set new `declared_special' field.
10004 * alloc.c (Fmake_symbol): Init new `declared_special' field.
10006 2011-03-31 Juanma Barranquero <lekktu@gmail.com>
10008 * xdisp.c (redisplay_internal): Fix prototype.
10010 2011-03-31 Eli Zaretskii <eliz@gnu.org>
10012 * xdisp.c (SCROLL_LIMIT): New macro.
10013 (try_scrolling): Use it when setting scroll_limit.
10014 Limit scrolling to 100 screen lines.
10015 (redisplay_window): Even when falling back on "recentering",
10016 position point in the window according to scroll-conservatively,
10017 scroll-margin, and scroll-*-aggressively variables. (Bug#6671)
10019 (try_scrolling): When point is above the window, allow searching
10020 as far as scroll_max, or one screenful, to compute vertical
10021 distance from PT to the scroll margin position. This prevents
10022 try_scrolling from unnecessarily failing when
10023 scroll-conservatively is set to a value slightly larger than the
10024 window height. Clean up the case of PT below the margin at bottom
10025 of window: scroll_max can no longer be INT_MAX. When aggressive
10026 scrolling is in use, don't let point enter the opposite scroll
10027 margin as result of the scroll.
10028 (syms_of_xdisp) <scroll-conservatively>: Document the
10029 threshold of 100 lines for never-recentering scrolling.
10031 2011-03-31 Juanma Barranquero <lekktu@gmail.com>
10033 * dispextern.h (move_it_by_lines):
10034 * xdisp.c (move_it_by_lines): Remove parameter `need_y_p', unused
10035 since 2000-12-29T14:24:09Z!gerd@gnu.org. All callers changed.
10036 (message_log_check_duplicate): Remove parameters `prev_bol' and
10037 `this_bol', unused since 1998-01-01T02:27:27Z!rms@gnu.org. All callers changed.
10038 (redisplay_internal): Remove parameter `preserve_echo_area',
10039 unused since 1999-07-21T21:43:52Z!gerd@gnu.org. All callers changed.
10041 * indent.c (Fvertical_motion):
10042 * window.c (window_scroll_pixel_based, Frecenter):
10043 Don't pass `need_y_p' to `move_it_by_lines'.
10045 2011-03-30 Stefan Monnier <monnier@iro.umontreal.ca>
10047 * eval.c (struct backtrace): Don't cheat with negative numbers, but do
10048 steal a few bits to be more compact.
10049 (interactive_p, Fbacktrace, Fbacktrace_frame, mark_backtrace):
10050 Remove unneeded casts.
10052 * bytecode.c (Fbyte_code): CAR and CDR can GC.
10054 2011-03-30 Zachary Kanfer <zkanfer@gmail.com> (tiny change)
10056 * keyboard.c (Fexecute_extended_command): Do log the "suggest key
10057 binding" message (bug#7967).
10059 2011-03-30 Paul Eggert <eggert@cs.ucla.edu>
10061 Fix more problems found by GCC 4.6.0's static checks.
10063 * unexelf.c (unexec) [! (defined _SYSTYPE_SYSV || defined __sgi)]:
10064 Remove unused local var.
10066 * editfns.c (Fmessage_box): Remove unused local var.
10068 * xdisp.c (try_window_reusing_current_matrix, x_produce_glyphs):
10069 (note_mode_line_or_margin_highlight, note_mouse_highlight):
10070 Omit unused local vars.
10071 * window.c (shrink_windows): Omit unused local var.
10072 * menu.c (digest_single_submenu): Omit unused local var.
10073 * dispnew.c (update_window) [PERIODIC_PREEMPTION_CHECKING]:
10074 Omit unused local var.
10076 * keyboard.c (parse_modifiers_uncached, parse_modifiers):
10077 Don't assume string length fits in int.
10078 (keyremap_step, read_key_sequence): Use size_t for sizes.
10079 (read_key_sequence): Don't check last_real_key_start redundantly.
10081 * callproc.c (Fcall_process, Fcall_process_region): Use SAFE_ALLOCA
10082 instead of alloca (Bug#8344).
10084 * eval.c (Fbacktrace): Don't assume nargs fits in int.
10085 (Fbacktrace_frame): Don't assume nframes fits in int.
10087 * syntax.c (scan_sexps_forward): Avoid pointer wraparound.
10089 * xterm.c (x_make_frame_visible, same_x_server): Redo to avoid overflow
10092 * term.c (produce_glyphless_glyph): Remove unnecessary test.
10094 * cm.c (calccost): Turn while-do into do-while, for clarity.
10096 * keyboard.c (syms_of_keyboard): Use the same style as later
10097 in this function when indexing through an array. This also
10098 works around GCC bug 48267.
10100 * image.c (tiff_load): Fix off-by-one image count (Bug#8336).
10102 * xselect.c (x_check_property_data): Return correct size (Bug#8335).
10104 * chartab.c (sub_char_table_ref_and_range): Redo for slight
10105 efficiency gain, and to bypass a gcc -Wstrict-overflow warning.
10107 * keyboard.c, keyboard.h (num_input_events): Now size_t.
10108 This avoids undefined behavior on integer overflow, and is a bit
10109 more convenient anyway since it is compared to a size_t variable.
10111 Variadic C functions now count arguments with size_t, not int.
10112 This avoids an unnecessary limitation on 64-bit machines, which
10113 caused (substring ...) to crash on large vectors (Bug#8344).
10114 * lisp.h (struct Lisp_Subr.function.aMANY): Now takes size_t, not int.
10115 (DEFUN_ARGS_MANY, internal_condition_case_n, safe_call): Likewise.
10116 All variadic functions and their callers changed accordingly.
10117 (struct gcpro.nvars): Now size_t, not int. All uses changed.
10118 * data.c (arith_driver, float_arith_driver): Likewise.
10119 * editfns.c (general_insert_function): Likewise.
10120 * eval.c (struct backtrace.nargs, interactive_p)
10121 (internal_condition_case_n, run_hook_with_args, apply_lambda)
10122 (funcall_lambda, mark_backtrace): Likewise.
10123 * fns.c (concat): Likewise.
10124 * frame.c (x_set_frame_parameters): Likewise.
10125 * fns.c (get_key_arg): Now accepts and returns size_t, and returns
10126 0 if not found, not -1. All callers changed.
10128 * alloc.c (garbage_collect): Don't assume stack size fits in int.
10129 (stack_copy_size): Now size_t, not int.
10130 (stack_copy, stack_copy_size): Define only if MAX_SAVE_STACK > 0.
10132 2011-03-28 Juanma Barranquero <lekktu@gmail.com>
10134 * coding.c (encode_designation_at_bol): Remove parameter `charbuf_end',
10135 unused since 2002-03-01T01:17:24Z!handa@m17n.org and 2008-02-01T16:01:31Z!miles@gnu.org.
10136 All callers changed.
10138 * lisp.h (multibyte_char_to_unibyte):
10139 * character.c (multibyte_char_to_unibyte): Remove parameter `rev_tbl',
10140 unused since 2002-03-01T01:16:34Z!handa@m17n.org and 2008-02-01T16:01:31Z!miles@gnu.org.
10141 * character.h (CHAR_TO_BYTE8):
10142 * cmds.c (internal_self_insert):
10143 * editfns.c (general_insert_function):
10144 * keymap.c (push_key_description):
10145 * search.c (Freplace_match):
10146 * xdisp.c (message_dolog, set_message_1): All callers changed.
10148 2011-03-28 Stefan Monnier <monnier@iro.umontreal.ca>
10150 * keyboard.c (safe_run_hook_funcall): New function.
10151 (safe_run_hooks_1, safe_run_hooks_error, safe_run_hooks): On error,
10152 don't set the hook to nil, but remove the offending function instead.
10153 (Qcommand_hook_internal): Remove, unused.
10154 (syms_of_keyboard): Don't initialize Qcommand_hook_internal nor define
10155 Vcommand_hook_internal.
10157 * eval.c (enum run_hooks_condition): Remove.
10158 (funcall_nil, funcall_not): New functions.
10159 (run_hook_with_args): Call each function through a `funcall' argument.
10160 Remove `cond' argument, now redundant.
10161 (Frun_hooks, Frun_hook_with_args, Frun_hook_with_args_until_success)
10162 (Frun_hook_with_args_until_failure): Adjust accordingly.
10163 (run_hook_wrapped_funcall, Frun_hook_wrapped): New functions.
10165 2011-03-28 Juanma Barranquero <lekktu@gmail.com>
10167 * dispextern.h (string_buffer_position): Remove declaration.
10169 * print.c (strout): Remove parameter `multibyte', unused since
10170 1999-08-21T19:30:21Z!gerd@gnu.org. All callers changed.
10172 * search.c (boyer_moore): Remove parameters `len', `pos' and `lim',
10173 never used since function introduction in 1998-02-08T21:33:56Z!rms@gnu.org.
10174 All callers changed.
10176 * w32.c (_wsa_errlist): Use braces for struct initializers.
10178 * xdisp.c (string_buffer_position_lim): Remove parameter `w',
10179 never used since function introduction in 2001-03-09T18:41:50Z!gerd@gnu.org.
10180 All callers changed.
10181 (string_buffer_position): Likewise. Also, make static (it's never
10182 used outside xdisp.c).
10183 (cursor_row_p): Remove parameter `w', unused since
10184 2000-10-17T16:08:57Z!gerd@gnu.org. All callers changed.
10185 (decode_mode_spec): Remove parameter `precision', introduced during
10186 Gerd Moellmann's rewrite at 1999-07-21T21:43:52Z!gerd@gnu.org, but never used.
10187 All callers changed.
10189 2011-03-27 Jan Djärv <jan.h.d@swipnet.se>
10191 * nsterm.m (syms_of_nsterm): Use doc: for ns-auto-hide-menu-bar.
10193 2011-03-27 Anders Lindgren <andlind@gmail.com>
10195 * nsterm.m (ns_menu_bar_is_hidden): New variable.
10196 (ns_constrain_all_frames, ns_menu_bar_should_be_hidden)
10197 (ns_update_auto_hide_menu_bar): New functions.
10198 (ns_update_begin): Call ns_update_auto_hide_menu_bar.
10199 (applicationDidBecomeActive): Call ns_update_auto_hide_menu_bar and
10200 ns_constrain_all_frames.
10201 (constrainFrameRect): Return at once if ns_menu_bar_should_be_hidden.
10202 (syms_of_nsterm): DEFVAR ns-auto-hide-menu-bar, init to Qnil.
10204 2011-03-27 Jan Djärv <jan.h.d@swipnet.se>
10206 * nsmenu.m (runDialogAt): Remove argument to timer_check.
10208 2011-03-27 Glenn Morris <rgm@gnu.org>
10210 * syssignal.h: Replace RETSIGTYPE with void.
10211 * atimer.c, data.c, dispnew.c, emacs.c, floatfns.c, keyboard.c:
10212 * keyboard.h, lisp.h, process.c, sysdep.c, xterm.c:
10213 Replace SIGTYPE with void everywhere.
10214 * s/usg5-4-common.h (SIGTYPE): Remove definition.
10215 * s/template.h (SIGTYPE): Remove commented out definition.
10217 2011-03-26 Eli Zaretskii <eliz@gnu.org>
10219 * xdisp.c (redisplay_window): Don't check buffer's clip_changed
10220 flag as a prerequisite for invoking try_scrolling. (Bug#6671)
10222 2011-03-26 Juanma Barranquero <lekktu@gmail.com>
10224 * w32.c (read_unc_volume): Use parameter `henum', instead of
10225 global variable `wget_enum_handle'.
10227 * keymap.c (describe_vector): Remove parameters `indices' and
10228 `char_table_depth', unused since 2002-03-01T01:43:26Z!handa@m17n.org.
10229 (describe_map, Fdescribe_vector): Adjust calls to `describe_vector'.
10231 * keyboard.h (timer_check, show_help_echo): Remove unused parameters.
10233 * keyboard.c (timer_check): Remove parameter `do_it_now',
10234 unused since 1996-04-12T06:01:29Z!rms@gnu.org.
10235 (show_help_echo): Remove parameter `ok_to_overwrite_keystroke_echo',
10236 unused since 2008-04-19T19:30:53Z!monnier@iro.umontreal.ca.
10238 * keyboard.c (read_char):
10239 * w32menu.c (w32_menu_display_help):
10240 * xmenu.c (show_help_event, menu_help_callback):
10241 Adjust calls to `show_help_echo'.
10243 * gtkutil.c (xg_maybe_add_timer):
10244 * keyboard.c (readable_events):
10245 * process.c (wait_reading_process_output):
10246 * xmenu.c (x_menu_wait_for_event): Adjust calls to `timer_check'.
10248 * insdel.c (adjust_markers_gap_motion):
10249 Remove; no-op since 1998-01-02T21:29:48Z!rms@gnu.org.
10250 (gap_left, gap_right): Don't call it.
10252 2011-03-25 Chong Yidong <cyd@stupidchicken.com>
10254 * xdisp.c (handle_fontified_prop): Discard changes to clip_changed
10255 incurred during fontification.
10257 2011-03-25 Juanma Barranquero <lekktu@gmail.com>
10259 * buffer.c (defvar_per_buffer): Remove unused parameter `doc'.
10260 (DEFVAR_PER_BUFFER): Don't pass it.
10262 * dispnew.c (row_equal_p, add_row_entry): Remove unused parameter `w'.
10263 (scrolling_window): Don't pass it.
10265 2011-03-25 Juanma Barranquero <lekktu@gmail.com>
10267 * dispextern.h (glyph_matric): Use #if GLYPH_DEBUG, not #ifdef.
10269 * fileio.c (check_executable) [DOS_NT]: Remove unused variables `len'
10271 (Fset_file_selinux_context) [HAVE_LIBSELINUX]: Move here declaration
10272 of variables specific to SELinux and computation of `encoded_absname'.
10274 * image.c (XPutPixel): Remove unused variable `height'.
10276 * keyboard.c (make_lispy_event): Remove unused variable `hpos'.
10278 * unexw32.c (get_section_info): Remove unused variable `section'.
10280 * w32.c (stat): Remove unused variables `drive_root' and `devtype'.
10281 (system_process_attributes): Remove unused variable `sess'.
10282 (sys_read): Remove unused variable `err'.
10284 * w32fns.c (top): Wrap variables with #if GLYPH_DEBUG, not #ifdef.
10285 (w32_wnd_proc): Remove unused variable `isdead'.
10286 (unwind_create_frame): Use #if GLYPH_DEBUG, not #ifdef.
10287 (Fx_server_max_request_size): Remove unused variable `dpyinfo'.
10288 (x_create_tip_frame): Remove unused variable `tem'.
10290 * w32inevt.c (w32_console_read_socket):
10291 Remove unused variable `no_events'.
10293 * w32term.c (x_draw_composite_glyph_string_foreground):
10294 Remove unused variable `width'.
10296 2011-03-24 Juanma Barranquero <lekktu@gmail.com>
10298 * w32term.c (x_set_glyph_string_clipping):
10299 Don't pass uninitialized region to CombineRgn.
10301 2011-03-23 Juanma Barranquero <lekktu@gmail.com>
10303 * w32fns.c (x_set_menu_bar_lines): Remove unused variable `olines'.
10304 (w32_wnd_proc): Pass NULL to Windows API, not uninitialized buffer.
10305 (Fx_close_connection): Remove unused variable `i'.
10307 * w32font.c (w32font_draw): Return number of glyphs.
10308 (w32font_open_internal): Remove unused variable `i'.
10309 (w32font_driver): Add missing initializer.
10311 * w32menu.c (utf8to16): Remove unused variable `utf16'.
10312 (fill_in_menu): Remove unused variable `items_added'.
10314 * w32term.c (last_mouse_press_frame): Remove static global variable.
10315 (w32_clip_to_row): Remove unused variable `f'.
10316 (x_delete_terminal): Remove unused variable `i'.
10318 * w32uniscribe.c (uniscribe_shape): Remove unused variable `nclusters'.
10319 (NOTHING): Remove unused static global variable.
10320 (uniscribe_check_otf): Remove unused variable `table'.
10321 (uniscribe_font_driver): Add missing initializers.
10323 2011-03-23 Julien Danjou <julien@danjou.info>
10325 * term.c (Fsuspend_tty, Fresume_tty):
10326 * minibuf.c (read_minibuf, run_exit_minibuf_hook):
10327 * window.c (temp_output_buffer_show):
10328 * insdel.c (signal_before_change):
10329 * frame.c (Fhandle_switch_frame):
10330 * fileio.c (Fdo_auto_save):
10331 * emacs.c (Fkill_emacs):
10332 * editfns.c (save_excursion_restore):
10333 * cmds.c (internal_self_insert):
10334 * callint.c (Fcall_interactively):
10335 * buffer.c (Fkill_all_local_variables):
10336 * keyboard.c (Fcommand_execute, Fsuspend_emacs, safe_run_hooks_1):
10338 (command_loop_1): Use Frun_hooks. Call safe_run_hooks
10339 unconditionally since it does the check itself.
10341 2011-03-23 Paul Eggert <eggert@cs.ucla.edu>
10343 Fix more problems found by GCC 4.5.2's static checks.
10345 * coding.c (encode_coding_raw_text): Avoid unnecessary test
10346 the first time through the loop, since we know p0 < p1 then.
10347 This also avoids a gcc -Wstrict-overflow warning.
10349 * lisp.h (SAFE_ALLOCA, SAFE_ALLOCA_LISP): Avoid 'int' overflow
10350 leading to a memory leak, possible in functions like
10351 load_charset_map_from_file that can allocate an unbounded number
10352 of objects (Bug#8318).
10354 * xmenu.c (set_frame_menubar): Use EMACS_UINT, not int, for indexes
10355 that could (at least in theory) be that large.
10357 * xdisp.c (message_log_check_duplicate): Return unsigned long, not int.
10358 This is less likely to overflow, and avoids undefined behavior if
10359 overflow does occur. All callers changed. Use strtoul to scan
10360 for the unsigned long integer.
10361 (pint2hrstr): Simplify and tune code slightly.
10362 This also avoids a (bogus) GCC warning with gcc -Wstrict-overflow.
10364 * scroll.c (do_scrolling): Work around GCC bug 48228.
10365 See <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48228>.
10367 * frame.c (Fmodify_frame_parameters): Simplify loop counter.
10368 This also avoids a warning with gcc -Wstrict-overflow.
10369 (validate_x_resource_name): Simplify count usage.
10370 This also avoids a warning with gcc -Wstrict-overflow.
10372 * fileio.c (Fcopy_file): Report error if fchown or fchmod
10375 * emacs.c (Fdaemon_initialized): Do not ignore I/O errors (Bug#8303).
10377 * process.c (Fmake_network_process): Use socklen_t, not int,
10378 where POSIX says socklen_t is required in portable programs.
10379 This fixes a porting bug on hosts like 64-bit HP-UX, where
10380 socklen_t is wider than int (Bug#8277).
10381 (Fmake_network_process, server_accept_connection):
10382 (wait_reading_process_output, read_process_output):
10385 * process.c: Rename or move locals to avoid shadowing.
10386 (list_processes_1, Fmake_network_process):
10387 (read_process_output_error_handler, exec_sentinel_error_handler):
10388 Rename or move locals.
10389 (Fmake_network_process): Define label "retry_connect" only if needed.
10390 (Fnetwork_interface_info): Fix pointer signedness.
10391 (process_send_signal): Add cast to avoid pointer signedness problem.
10392 (FIRST_PROC_DESC, IF_NON_BLOCKING_CONNECT): Remove unused macros.
10393 (create_process): Use 'volatile' to avoid vfork clobbering (Bug#8298).
10395 Make tparam.h and terminfo.c consistent.
10396 * cm.c (tputs, tgoto, BC, UP): Remove extern decls.
10397 Include tparam.h instead, since it declares them.
10398 * cm.h (PC): Remove extern decl; tparam.h now does this.
10399 * deps.mk (cm.o, terminfo.o): Depend on tparam.h.
10400 * terminfo.c: Include tparam.h, to check interfaces.
10401 (tparm): Make 1st arg a const pointer in decl. Put it at top level.
10402 (tparam): Adjust signature to match interface in tparam.h;
10403 this removes some undefined behavior. Check that outstring and len
10404 are zero, which they always are with Emacs.
10405 * tparam.h (PC, BC, UP): New extern decls.
10407 * xftfont.c (xftfont_shape): Now static, and defined only if needed.
10408 (xftfont_open): Rename locals to avoid shadowing.
10410 * ftfont.c (ftfont_resolve_generic_family): Fix pointer signedness.
10411 (ftfont_otf_capability, ftfont_shape): Omit decls if not needed.
10412 (OTF_TAG_SYM): Omit macro if not needed.
10413 (ftfont_list): Remove unused local.
10414 (get_adstyle_property, ftfont_pattern_entity):
10415 (ftfont_lookup_cache, ftfont_open, ftfont_anchor_point):
10416 Rename locals to avoid shadowing.
10418 * xfont.c (xfont_list_family): Mark var as initialized.
10420 * xml.c (make_dom): Now static.
10422 * composite.c (composition_compute_stop_pos): Rename local to
10424 (composition_reseat_it): Remove unused locals.
10425 (find_automatic_composition, composition_adjust_point): Likewise.
10426 (composition_update_it): Mark var as initialized.
10427 (find_automatic_composition): Mark vars as initialized,
10428 with a FIXME (Bug#8290).
10430 character.h: Rename locals to avoid shadowing.
10431 * character.h (PREV_CHAR_BOUNDARY, FETCH_STRING_CHAR_ADVANCE):
10432 (FETCH_STRING_CHAR_AS_MULTIBYTE_ADVANCE, FETCH_CHAR_ADVANCE):
10433 (FETCH_CHAR_ADVANCE_NO_CHECK, INC_POS, DEC_POS, BUF_INC_POS):
10434 (BUF_DEC_POS): Be more systematic about renaming local temporaries
10435 to avoid shadowing.
10437 * textprop.c (property_change_between_p): Remove; unused.
10439 * intervals.c (interval_start_pos): Now static.
10441 * intervals.h (CHECK_TOTAL_LENGTH): Avoid empty "else".
10443 * atimer.c (start_atimer, append_atimer_lists, set_alarm):
10444 Rename locals to avoid shadowing.
10446 * sound.c (wav_play, au_play, Fplay_sound_internal):
10447 Fix pointer signedness.
10448 (alsa_choose_format): Remove unused local var.
10449 (wav_play): Initialize a variable to 0, to prevent undefined
10450 behavior (Bug#8278).
10452 * region-cache.c (insert_cache_boundary): Redo var to avoid shadowing.
10454 * region-cache.h (pp_cache): New decl, for gcc -Wmissing-prototypes.
10456 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork
10457 clobbering (Bug#8298).
10458 * sysdep.c (sys_subshell): Likewise.
10459 Previously, the sys_subshell 'volatile' was incorrectly IF_LINTted out.
10461 * lisp.h (child_setup): Now NO_RETURN unless DOS_NT.
10462 This should get cleaned up, so that child_setup has the
10463 same signature on all platforms.
10465 * callproc.c (call_process_cleanup): Now static.
10466 (relocate_fd): Rename locals to avoid shadowing.
10468 2011-03-22 Chong Yidong <cyd@stupidchicken.com>
10470 * xterm.c (x_clear_frame): Remove XClearWindow call. This appears
10471 not to be necessary, and produces flickering.
10473 2011-03-20 Glenn Morris <rgm@gnu.org>
10475 * config.in: Remove file.
10477 2011-03-20 Juanma Barranquero <lekktu@gmail.com>
10479 * minibuf.c (Vcompleting_read_function): Don't declare, global variables
10480 are now in src/globals.h.
10481 (syms_of_minibuf): Remove spurious & from previous change.
10483 2011-03-20 Leo Liu <sdl.web@gmail.com>
10485 * minibuf.c (completing-read-function): New variable.
10486 (completing-read-default): Rename from completing-read.
10487 (completing-read): Call completing-read-function.
10489 2011-03-19 Juanma Barranquero <lekktu@gmail.com>
10491 * xfaces.c (Fx_load_color_file):
10492 Read color file from absolute filename (bug#8250).
10494 2011-03-19 Juanma Barranquero <lekktu@gmail.com>
10496 * makefile.w32-in: Update dependencies.
10498 2011-03-17 Eli Zaretskii <eliz@gnu.org>
10500 * makefile.w32-in ($(BLD)/unexw32.$(O)): Depend on $(SRC)/unexec.h.
10502 2011-03-17 Paul Eggert <eggert@cs.ucla.edu>
10504 Fix more problems found by GCC 4.5.2's static checks.
10506 * process.c (make_serial_process_unwind, send_process_trap):
10507 (sigchld_handler): Now static.
10509 * process.c (allocate_pty): Let PTY_ITERATION declare iteration vars.
10510 That way, the code declares only the vars that it needs.
10511 * s/aix4-2.h (PTY_ITERATION): Declare iteration vars.
10512 * s/cygwin.h (PTY_ITERATION): Likewise.
10513 * s/darwin.h (PTY_ITERATION): Likewise.
10514 * s/gnu-linux.h (PTY_ITERATION): Likewise.
10516 * s/irix6-5.h (PTY_OPEN): Declare stb, to loosen coupling.
10517 * process.c (allocate_pty): Don't declare stb unless it's needed.
10519 * bytecode.c (MAYBE_GC): Rewrite so as not to use empty "else".
10520 (CONSTANTLIM): Remove; unused.
10521 (METER_CODE, Bscan_buffer, Bread_char, Bset_mark):
10522 Define only if needed.
10524 * unexelf.c (unexec): Name an expression,
10525 to avoid gcc -Wbad-function-cast warning.
10526 Use a different way to cause a compilation error if anyone uses
10527 n rather than nn, a way that does not involve shadowing.
10528 (ELF_BSS_SECTION_NAME, OLD_PROGRAM_H): Remove; unused.
10530 * deps.mk (unexalpha.o): Remove; unused.
10532 New file unexec.h, the (simple) interface for unexec (Bug#8267).
10533 * unexec.h: New file.
10534 * deps.mk (emacs.o, unexaix.o, unexcw.o, unexcoff.o, unexelf.o):
10535 (unexhp9k800.o, unexmacosx.o, unexsol.o, unexw32.o):
10536 Depend on unexec.h.
10537 * emacs.c [!defined CANNOT_DUMP]: Include unexec.h.
10538 * unexaix.c, unexcoff.c, unexcw.c, unexelf.c, unexhp9k800.c:
10539 * unexmacosx.c, unexsol.c, unexw32.c: Include unexec.h.
10540 Change as necessary to match prototype in unexec.h.
10542 * syntax.c (Fforward_comment, scan_lists): Rename locals to avoid
10544 (back_comment, skip_chars): Mark vars as initialized.
10546 * character.h (FETCH_STRING_CHAR_ADVANCE_NO_CHECK, BUF_INC_POS):
10547 Rename locals to avoid shadowing.
10549 * lread.c (read1): Rewrite so as not to use empty "else".
10550 (Fload, readevalloop, read1): Rename locals to avoid shadowing.
10552 * print.c (Fredirect_debugging_output): Fix pointer signedess.
10554 * lisp.h (debug_output_compilation_hack): Add decl here, to avoid
10555 warning when compiling print.c.
10557 * font.c (font_unparse_fcname): Abort in an "impossible" situation
10558 instead of using an uninitialized var.
10559 (font_sort_entities): Mark var as initialized.
10561 * character.h (FETCH_CHAR_ADVANCE): Rename locals to avoid shadowing.
10563 * font.c (font_unparse_xlfd): Don't mix pointers to variables with
10564 pointers to constants.
10565 (font_parse_fcname): Remove unused vars.
10566 (font_delete_unmatched): Now static.
10567 (font_get_spec): Remove; unused.
10568 (font_style_to_value, font_prop_validate_style, font_unparse_fcname):
10569 (font_update_drivers, Ffont_get_glyphs, font_add_log):
10570 Rename or move locals to avoid shadowing.
10572 * fns.c (require_nesting_list, require_unwind): Now static.
10573 (Ffillarray): Rename locals to avoid shadowing.
10575 * floatfns.c (domain_error2): Define only if needed.
10576 (Ffrexp, Fldexp): Rename locals to avoid shadowing.
10578 * alloc.c (mark_backtrace): Move decl from here ...
10579 * lisp.h: ... to here, so that it can be checked.
10581 * eval.c (call_debugger, do_debug_on_call, grow_specpdl): Now static.
10582 (Fdefvar): Rewrite so as not to use empty "else".
10583 (lisp_indirect_variable): Name an expression,
10584 to avoid gcc -Wbad-function-cast warning.
10585 (Fdefvar): Rename locals to avoid shadowing.
10587 * callint.c (quotify_arg, quotify_args): Now static.
10588 (Fcall_interactively): Rename locals to avoid shadowing.
10589 Use const pointer when appropriate.
10591 * lisp.h (get_system_name, get_operating_system_release):
10592 Move decls here, to check interfaces.
10593 * process.c (get_operating_system_release): Move decl to lisp.h.
10594 * xrdb.c (get_system_name): Likewise.
10595 * editfns.c (init_editfns, Fuser_login_name, Fuser_uid):
10596 (Fuser_real_uid, Fuser_full_name): Remove unnecessary casts,
10597 some of which prompt warnings from gcc -Wbad-function-cast.
10598 (Fformat_time_string, Fencode_time, Finsert_char):
10599 (Ftranslate_region_internal, Fformat):
10600 Rename or remove local vars to avoid shadowing.
10601 (Ftranslate_region_internal): Mark var as initialized.
10603 * doc.c (Fdocumentation, Fsnarf_documentation): Move locals to
10606 * lisp.h (eassert): Check that the argument compiles, even if
10607 ENABLE_CHECKING is not defined.
10609 * data.c (Findirect_variable): Name an expression, to avoid
10610 gcc -Wbad-function-cast warning.
10611 (default_value, arithcompare, arith_driver, arith_error): Now static.
10612 (store_symval_forwarding): Rename local to avoid shadowing.
10613 (Fmake_variable_buffer_local, Fmake_local_variable):
10614 Mark variables as initialized.
10615 (do_blv_forwarding, do_symval_forwarding): Remove; unused.
10617 * alloc.c (check_cons_list): Do not define unless GC_CHECK_CONS_LIST.
10618 (Fmake_vector, Fvector, Fmake_byte_code, Fgarbage_collect):
10619 Rename locals to avoid shadowing.
10620 (mark_stack): Move local variables into the #ifdef region where
10622 (BLOCK_INPUT_ALLOC, UNBLOCK_INPUT_ALLOC): Define only if
10623 ! defined SYSTEM_MALLOC && ! defined SYNC_INPUT, as they are not
10625 (CHECK_ALLOCATED): Define only if GC_CHECK_MARKED_OBJECTS.
10626 (GC_STRING_CHARS): Remove; not used.
10627 (Fmemory_limit): Cast sbrk's returned value to char *.
10629 * lisp.h (check_cons_list): Declare if GC_CHECK_CONS_LIST; this
10630 avoids undefined behavior in theory.
10632 * regex.c (IF_LINT): Add defn, for benefit of ../lib-src.
10634 Use functions, not macros, for up- and down-casing (Bug#8254).
10635 * buffer.h (DOWNCASE_TABLE, UPCASE_TABLE, DOWNCASE, UPPERCASEP):
10636 (NOCASEP, LOWERCASEP, UPCASE, UPCASE1): Remove. All callers changed
10637 to use the following functions instead of these macros.
10638 (downcase): Adjust to lack of DOWNCASE_TABLE. Return int, not
10639 EMACS_INT, since callers assume the returned value fits in int.
10640 (upcase1): Likewise, for UPCASE_TABLE.
10641 (uppercasep, lowercasep, upcase): New static inline functions.
10642 * editfns.c (Fchar_equal): Remove no-longer-needed workaround for
10643 the race-condition problem in the old DOWNCASE.
10645 * regex.c (CHARSET_LOOKUP_RANGE_TABLE_RAW, POP_FAILURE_REG_OR_COUNT):
10646 Rename locals to avoid shadowing.
10647 (regex_compile, re_match_2_internal): Move locals to avoid shadowing.
10648 (regex_compile, re_search_2, re_match_2_internal):
10649 Remove unused local vars.
10650 (FREE_VAR): Rewrite so as not to use empty "else",
10651 which gcc can warn about.
10652 (regex_compile, re_match_2_internal): Mark locals as initialized.
10653 (RETALLOC_IF): Define only if needed.
10654 (WORDCHAR_P): Likewise. This one is never needed, but is used
10655 only in a comment talking about a compiler bug, so put inside
10656 the #if 0 of that comment.
10657 (CHARSET_LOOKUP_BITMAP, FAIL_STACK_FULL, RESET_FAIL_STACK):
10658 (PUSH_FAILURE_ELT, BUF_PUSH_3, STOP_ADDR_VSTRING):
10661 * search.c (boyer_moore): Rename locals to avoid shadowing.
10662 * character.h (FETCH_STRING_CHAR_AS_MULTIBYTE_ADVANCE):
10663 (PREV_CHAR_BOUNDARY): Likewise.
10665 * search.c (simple_search): Remove unused var.
10667 * dired.c (compile_pattern): Move decl from here ...
10668 * lisp.h: ... to here, so that it can be checked.
10669 (struct re_registers): New forward decl.
10671 * character.h (INC_POS, DEC_POS): Rename locals to avoid shadowing.
10673 * indent.c (MULTIBYTE_BYTES_WIDTH): New args bytes, width.
10675 (MULTIBYTE_BYTES_WIDTH, scan_for_column, compute_motion):
10676 Rename locals to avoid shadowing.
10677 (Fvertical_motion): Mark locals as initialized.
10679 * casefiddle.c (casify_object, casify_region): Now static.
10680 (casify_region): Mark local as initialized.
10682 * cmds.c (internal_self_insert): Rename local to avoid shadowing.
10684 * lisp.h (GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR, GCPRO5_VAR, GCPRO6_VAR):
10685 New macros, so that the caller can use some names other than
10686 gcpro1, gcpro2, etc.
10687 (GCPRO2, GCPRO3, GCPRO4, GCPRO5, GCPRO6): Reimplement in terms
10689 (GCPRO1_VAR, UNGCPRO_VAR): Change the meaning of the second
10690 argument, for consistency with GCPRO2_VAR, etc: it is now the
10691 prefix of the variable, not the variable itself. All uses
10693 * dired.c (directory_files_internal, file_name_completion):
10694 Rename locals to avoid shadowing.
10696 Fix a race condition diagnosed by gcc -Wsequence-point (Bug#8254).
10697 An expression of the form (DOWNCASE (x) == DOWNCASE (y)), found in
10698 dired.c's scmp function, had undefined behavior.
10699 * lisp.h (DOWNCASE_TABLE, UPCASE_TABLE, DOWNCASE, UPPERCASEP):
10700 (NOCASEP, LOWERCASEP, UPCASE, UPCASE1): Move from here ...
10701 * buffer.h: ... to here, because these macros use current_buffer,
10702 and the new implementation with inline functions needs to have
10703 current_buffer in scope now, rather than later when the macros
10705 (downcase, upcase1): New static inline functions.
10706 (DOWNCASE, UPCASE1): Reimplement using these functions.
10707 This avoids undefined behavior in expressions like
10708 DOWNCASE (x) == DOWNCASE (y), which previously suffered
10709 from race conditions in accessing the global variables
10710 case_temp1 and case_temp2.
10711 * casetab.c (case_temp1, case_temp2): Remove; no longer needed.
10712 * lisp.h (case_temp1, case_temp2): Remove their decls.
10713 * character.h (ASCII_CHAR_P): Move from here ...
10714 * lisp.h: ... to here, so that the inline functions mentioned
10715 above can use them.
10717 * dired.c (directory_files_internal_unwind): Now static.
10719 * fileio.c (file_name_as_directory, directory_file_name):
10720 (barf_or_query_if_file_exists, auto_save_error, auto_save_1):
10722 (file_name_as_directory): Use const pointers when appropriate.
10723 (Fexpand_file_name): Likewise. In particular, newdir might
10724 point at constant storage, so make it a const pointer.
10725 (Fmake_directory_internal, Fread_file_name): Remove unused vars.
10726 (Ffile_selinux_context, Fset_file_selinux_context): Fix pointer
10728 (Fset_file_times, Finsert_file_contents, auto_save_error):
10729 Rename locals to avoid shadowing.
10731 * minibuf.c (choose_minibuf_frame_1): Now static.
10732 (Ftry_completion, Fall_completions): Rename or remove locals
10733 to avoid shadowing.
10735 * marker.c (bytepos_to_charpos): Remove; unused.
10737 * lisp.h (verify_bytepos, count_markers): New decls,
10738 so that gcc does not warn that these functions aren't declared.
10740 * insdel.c (check_markers, make_gap_larger, make_gap_smaller):
10741 (reset_var_on_error, Fcombine_after_change_execute_1): Now static.
10742 (CHECK_MARKERS): Redo to avoid gcc -Wempty-body diagnostic.
10743 (copy_text): Remove unused local var.
10745 * filelock.c (within_one_second): Now static.
10746 (lock_file_1): Rename local to avoid shadowing.
10748 * buffer.c (fix_overlays_before): Mark locals as initialized.
10749 (fix_start_end_in_overlays): Likewise. This function should be
10750 simplified by using pointers-to-pointers, but that's a different
10752 (switch_to_buffer_1): Now static.
10753 (Fkill_buffer, record_buffer, Fbury_buffer, Fset_buffer_multibyte):
10754 (report_overlay_modification): Rename locals to avoid shadowing.
10756 * sysdep.c (system_process_attributes): Rename vars to avoid shadowing.
10757 Fix pointer signedness issue.
10758 (sys_subshell): Mark local as volatile if checking for lint,
10759 to suppress a gcc -Wclobbered warning that does not seem to be right.
10760 (MAXPATHLEN): Define only if needed.
10762 * process.c (serial_open, serial_configure): Move decls from here ...
10763 * systty.h: ... to here, so that they can be checked.
10765 * fns.c (get_random, seed_random): Move extern decls from here ...
10766 * lisp.h: ... to here, so that they can be checked.
10768 * sysdep.c (reset_io): Now static.
10769 (wait_for_termination_signal): Remove; unused.
10771 * keymap.c (keymap_parent, keymap_memberp, map_keymap_internal):
10772 (copy_keymap_item, append_key, push_text_char_description):
10774 (Fwhere_is_internal): Don't test CONSP (sequences) unnecessarily.
10775 (DENSE_TABLE_SIZE): Remove; unused.
10776 (get_keymap, access_keymap, Fdefine_key, Fwhere_is_internal):
10777 (describe_map_tree):
10778 Rename locals to avoid shadowing.
10780 * keyboard.c: Declare functions static if they are not used elsewhere.
10781 (echo_char, echo_dash, cmd_error, top_level_2):
10782 (poll_for_input, handle_async_input): Now static.
10783 (read_char, kbd_buffer_get_event, make_lispy_position):
10784 (make_lispy_event, make_lispy_movement, apply_modifiers):
10785 (decode_keyboard_code, tty_read_avail_input, menu_bar_items):
10786 (parse_tool_bar_item, read_key_sequence, Fread_key_sequence):
10787 (Fread_key_sequence_vector): Rename locals to avoid shadowing.
10788 (read_key_sequence, read_char): Mark locals as initialized.
10789 (Fexit_recursive_edit, Fabort_recursive_edit): Mark with NO_RETURN.
10791 * keyboard.h (make_ctrl_char): New decl.
10792 (mark_kboards): Move decl here ...
10793 * alloc.c (mark_kboards): ... from here.
10795 * lisp.h (force_auto_save_soon): New decl.
10797 * emacs.c (init_cmdargs): Rename local to avoid shadowing.
10798 (DEFINE_DUMMY_FUNCTION): New macro.
10799 (__do_global_ctors, __do_global_ctors_aux, __do_global_dtors, __main):
10801 (main): Add casts to avoid warnings
10802 if GCC considers string literals to be constants.
10804 * lisp.h (fatal_error_signal): Add decl, since it's exported.
10806 * dbusbind.c: Pointer signedness fixes.
10807 (xd_signature, xd_append_arg, xd_initialize):
10808 (Fdbus_call_method, Fdbus_call_method_asynchronously):
10809 (Fdbus_method_return_internal, Fdbus_method_error_internal):
10810 (Fdbus_send_signal, xd_read_message_1, Fdbus_register_service):
10811 (Fdbus_register_signal): Use SSDATA when the context wants char *.
10813 * dbusbind.c (Fdbus_init_bus): Add cast to avoid warning
10814 if GCC considers string literals to be constants.
10815 (Fdbus_register_service, Fdbus_register_method): Remove unused vars.
10817 2011-03-16 Stefan Monnier <monnier@iro.umontreal.ca>
10819 * print.c (PRINT_CIRCLE_CANDIDATE_P): New macro.
10820 (print_preprocess, print_object): New macro to fix last change.
10822 * print.c (print_preprocess): Don't forget font objects.
10824 2011-03-16 Juanma Barranquero <lekktu@gmail.com>
10826 * emacs.c (USAGE3): Doc fixes.
10828 2011-03-15 Andreas Schwab <schwab@linux-m68k.org>
10830 * coding.c (detect_coding_iso_2022): Reorganize code to clarify
10833 2011-03-14 Juanma Barranquero <lekktu@gmail.com>
10835 * lisp.h (VWindow_system, Qfile_name_history):
10836 * keyboard.h (lispy_function_keys) [WINDOWSNT]:
10837 * w32term.h (w32_system_caret_hwnd, w32_system_caret_height)
10838 (w32_system_caret_x, w32_system_caret_y): Declare extern.
10840 * w32select.c: Don't #include "keyboard.h".
10841 (run_protected): Add extern declaration for waiting_for_input.
10843 * w32.c (Qlocal, noninteractive1, inhibit_window_system):
10844 * w32console.c (detect_input_pending, read_input_pending)
10845 (encode_terminal_code):
10846 * w32fns.c (quit_char, lispy_function_keys, Qtooltip)
10847 (w32_system_caret_hwnd, w32_system_caret_height, w32_system_caret_x)
10848 (w32_system_caret_y, Qfile_name_history):
10849 * w32font.c (w32font_driver, QCantialias, QCotf, QClang):
10850 * w32inevt.c (reinvoke_input_signal, lispy_function_keys):
10851 * w32menu.c (Qmenu_bar, QCtoggle, QCradio, Qoverriding_local_map)
10852 (Qoverriding_terminal_local_map, Qmenu_bar_update_hook):
10853 * w32proc.c (Qlocal, report_file_error):
10854 * w32term.c (Vwindow_system, updating_frame):
10855 * w32uniscribe.c (initialized, uniscribe_font_driver):
10856 Remove unneeded extern declarations.
10858 2011-03-14 Chong Yidong <cyd@stupidchicken.com>
10860 * buffer.c (Fmake_indirect_buffer): Fix incorrect assertions.
10862 2011-03-13 Chong Yidong <cyd@stupidchicken.com>
10864 * buffer.h (BUF_BEGV, BUF_BEGV_BYTE, BUF_ZV, BUF_ZV_BYTE, BUF_PT)
10865 (BUF_PT_BYTE): Rewrite to handle indirect buffers (Bug#8219).
10866 These macros can no longer be used for assignment.
10868 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer):
10869 Assign struct members directly, instead of using BUF_BEGV etc.
10870 (record_buffer_markers, fetch_buffer_markers): New functions for
10871 recording and fetching special buffer markers.
10872 (set_buffer_internal_1, set_buffer_temp): Use them.
10874 * lread.c (unreadchar): Use SET_BUF_PT_BOTH.
10876 * insdel.c (adjust_point): Use SET_BUF_PT_BOTH.
10878 * intervals.c (temp_set_point_both): Use SET_BUF_PT_BOTH.
10879 (get_local_map): Use SET_BUF_BEGV_BOTH and SET_BUF_ZV_BOTH.
10881 * xdisp.c (hscroll_window_tree):
10882 (reconsider_clip_changes): Use PT instead of BUF_PT.
10884 2011-03-13 Eli Zaretskii <eliz@gnu.org>
10886 * makefile.w32-in ($(BLD)/editfns.$(O)): Depend on
10887 $(EMACS_ROOT)/lib/intprops.h.
10889 2011-03-13 Paul Eggert <eggert@cs.ucla.edu>
10891 Fix more problems found by GCC 4.5.2's static checks.
10893 * gtkutil.c (xg_get_pixbuf_from_pixmap): Add cast from char *
10894 to unsigned char * to avoid compiler diagnostic.
10895 (xg_free_frame_widgets): Make it clear that a local variable is
10896 needed only if USE_GTK_TOOLTIP.
10897 (gdk_window_get_screen): Make it clear that this macro is needed
10898 only if USE_GTK_TOOLTIP.
10899 (int_gtk_range_get_value): New function, which avoids a diagnostic
10900 from gcc -Wbad-function-cast.
10901 (xg_set_toolkit_scroll_bar_thumb): Use it.
10902 (xg_tool_bar_callback, xg_tool_item_stale_p): Rewrite to avoid
10903 diagnostic from gcc -Wbad-function-cast.
10904 (get_utf8_string, xg_get_file_with_chooser):
10905 Rename locals to avoid shadowing.
10906 (create_dialog): Move locals to avoid shadowing.
10908 * xgselect.c (xg_select): Remove unused var.
10910 * image.c (four_corners_best): Mark locals as initialized.
10911 (gif_load): Initialize transparent_p to zero (Bug#8238).
10912 Mark another local as initialized.
10913 (my_png_error, my_error_exit): Mark with NO_RETURN.
10915 * image.c (clear_image_cache): Now static.
10916 (DIM, HAVE_STDLIB_H_1): Remove unused macros.
10917 (xpm_load): Redo to avoid "discards qualifiers" gcc warning.
10918 (x_edge_detection): Remove unnecessary cast that
10919 gcc -Wbad-function-cast diagnoses.
10920 (gif_load): Fix pointer signedness.
10921 (clear_image_cache, xbm_read_bitmap_data, x_detect_edges):
10922 (jpeg_load, gif_load): Rename locals to avoid shadowing.
10924 2011-03-12 Paul Eggert <eggert@cs.ucla.edu>
10926 Improve quality of tests for time stamp overflow.
10927 For example, without this patch (encode-time 0 0 0 1 1
10928 1152921504606846976) returns the obviously-bogus value (-948597
10929 62170) on my RHEL 5.5 x86-64 host. With the patch, it correctly
10930 reports time overflow. See
10931 <http://lists.gnu.org/archive/html/emacs-devel/2011-03/msg00470.html>.
10932 * deps.mk (editfns.o): Depend on ../lib/intprops.h.
10933 * editfns.c: Include limits.h and intprops.h.
10934 (TIME_T_MIN, TIME_T_MAX): New macros.
10935 (time_overflow): Move earlier, to before first use.
10936 (hi_time, lo_time): New functions, for an accurate test for
10937 out-of-range times.
10938 (Fcurrent_time, Fget_internal_run_time, make_time): Use them.
10939 (Fget_internal_run_time): Don't assume time_t fits in int.
10940 (make_time): Use list2 instead of Fcons twice.
10941 (Fdecode_time): More accurate test for out-of-range times.
10942 (check_tm_member): New function.
10943 (Fencode_time): Use it, to test for out-of-range times.
10944 (lisp_time_argument): Don't rely on undefined left-shift and
10945 right-shift behavior when checking for time stamp overflow.
10947 * editfns.c (time_overflow): New function, refactoring common code.
10948 (Fformat_time_string, Fdecode_time, Fencode_time):
10949 (Fcurrent_time_string): Use it.
10951 Move 'make_time' to be next to its inverse 'lisp_time_argument'.
10952 * dired.c (make_time): Move to ...
10953 * editfns.c (make_time): ... here.
10954 * systime.h: Note the move.
10956 2011-03-12 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
10958 * fringe.c (update_window_fringes): Remove unused variables.
10960 * unexmacosx.c (copy_data_segment): Also copy __got section.
10963 2011-03-12 Eli Zaretskii <eliz@gnu.org>
10965 * termcap.c [MSDOS]: Include "msdos.h".
10966 (find_capability, tgetnum, tgetflag, tgetstr, tputs, tgetent):
10967 Constify `char *' arguments and their references according to
10968 prototypes in tparam.h.
10970 * deps.mk (termcap.o): Depend on tparam.h and msdos.h.
10972 * msdos.c (XMenuAddPane): 3rd argument is `const char *' now.
10973 Adapt all references accordingly.
10975 * msdos.h (XMenuAddPane): 3rd argument is `const char *' now.
10977 2011-03-11 Tom Tromey <tromey@redhat.com>
10979 * buffer.c (syms_of_buffer): Remove obsolete comment.
10981 2011-03-11 Eli Zaretskii <eliz@gnu.org>
10983 * termhooks.h (encode_terminal_code): Declare prototype.
10985 * msdos.c (encode_terminal_code): Don't declare prototype.
10987 * term.c (encode_terminal_code): Now external again, used by
10988 w32console.c and msdos.c.
10990 * makefile.w32-in ($(BLD)/term.$(O), ($(BLD)/tparam.$(O)):
10991 Depend on $(SRC)/tparam.h, see 2011-03-11T07:24:21Z!eggert@cs.ucla.edu.
10993 2011-03-11 Paul Eggert <eggert@cs.ucla.edu>
10995 Fix some minor problems found by GCC 4.5.2's static checks.
10997 * fringe.c (update_window_fringes): Mark locals as initialized
10999 (destroy_fringe_bitmap, init_fringe_bitmap): Now static.
11001 * alloc.c (mark_fringe_data): Move decl from here ...
11002 * lisp.h (mark_fringe_data) [HAVE_WINDOW_SYSTEM]: ... to here,
11003 to check its interface.
11004 (init_fringe_once): Do not declare unless HAVE_WINDOW_SYSTEM.
11006 * fontset.c (free_realized_fontset): Now static.
11007 (Fset_fontset_font): Rename local to avoid shadowing.
11008 (fontset_font): Mark local as initialized.
11009 (FONTSET_SPEC, FONTSET_REPERTORY, RFONT_DEF_REPERTORY): Remove; unused.
11011 * xrdb.c: Include "xterm.h", to check x_load_resources's interface.
11013 * xselect.c (x_disown_buffer_selections): Remove; not used.
11014 (TRACE3) [!defined TRACE_SELECTION]: Remove; not used.
11015 (x_own_selection, Fx_disown_selection_internal): Rename locals
11016 to avoid shadowing.
11017 (x_handle_dnd_message): Remove local to avoid shadowing.
11019 * lisp.h (GCPRO1_VAR, UNGCPRO_VAR): New macros,
11020 so that the caller can use some name other than gcpro1.
11021 (GCPRO1, UNGCPRO): Reimplement in terms of the new macros.
11022 * xfns.c (Fx_create_frame, x_create_tip_frame, Fx_show_tip):
11023 (Fx_backspace_delete_keys_p):
11024 Use them to avoid shadowing, and rename vars to avoid shadowing.
11025 (x_decode_color, x_set_name, x_window): Now static.
11026 (Fx_create_frame): Add braces to silence GCC warning.
11027 (Fx_file_dialog, Fx_select_font): Fix pointer signedness.
11028 (x_real_positions, xg_set_icon_from_xpm_data, x_create_tip_frame):
11029 Remove unused locals.
11030 (Fx_create_frame, x_create_tip_frame, Fx_show_tip):
11031 (Fx_backspace_delete_keys_p): Rename locals to avoid shadowing.
11032 Some of these renamings use the new GCPRO1_VAR and UNGCPRO_VAR
11035 * xterm.h (x_mouse_leave): New decl.
11037 * xterm.c (x_copy_dpy_color, x_focus_on_frame, x_unfocus_frame):
11038 Remove unused functions.
11039 (x_shift_glyphs_for_insert, XTflash, XTring_bell):
11040 (x_calc_absolute_position): Now static.
11041 (XTread_socket): Don't define label "out" unless it's used.
11042 Don't declare local "event" unless it's used.
11043 (x_iconify_frame, x_free_frame_resources): Don't declare locals
11044 unless they are used.
11045 (XEMBED_VERSION, xembed_set_info): Don't define unless needed.
11046 (x_fatal_error_signal): Remove; not used.
11047 (x_draw_image_foreground, redo_mouse_highlight, XTmouse_position):
11048 (x_scroll_bar_report_motion, handle_one_xevent, x_draw_bar_cursor):
11049 (x_error_catcher, x_connection_closed, x_error_handler):
11050 (x_error_quitter, xembed_send_message, x_iconify_frame):
11051 (my_log_handler): Rename locals to avoid shadowing.
11052 (x_delete_glyphs, x_ins_del_lines): Mark with NO_RETURN.
11053 (x_connection_closed): Tell GCC not to suggest NO_RETURN.
11055 * xfaces.c (clear_face_cache, Fx_list_fonts, Fface_font):
11056 Rename or move locals to avoid shadowing.
11057 (tty_defined_color, merge_face_heights): Now static.
11058 (free_realized_faces_for_fontset): Remove; not used.
11059 (Fx_list_fonts): Mark variable that gcc -Wuninitialized
11060 does not deduce is never used uninitialized.
11061 (STRDUPA, LSTRDUPA, FONT_POINT_SIZE_QUANTUM): Remove; not used.
11062 (LFACEP): Define only if XASSERTS, as it's not needed otherwise.
11064 * terminal.c (store_terminal_param): Now static.
11066 * xmenu.c (menu_highlight_callback): Now static.
11067 (set_frame_menubar): Remove unused local.
11068 (xmenu_show): Rename parameter to avoid shadowing.
11069 (xmenu_show, xdialog_show, xmenu_show): Make local pointers "const"
11070 since they might point to immutable storage.
11071 (next_menubar_widget_id): Declare only if USE_X_TOOLKIT,
11072 since it's unused otherwise.
11074 * xdisp.c (produce_glyphless_glyph): Initialize lower_xoff.
11075 Add a FIXME, since the code still doesn't look right. (Bug#8215)
11076 (Fcurrent_bidi_paragraph_direction): Simplify slightly; this
11077 avoids a gcc -Wuninitialized diagnostic.
11078 (display_line, BUILD_COMPOSITE_GLYPH_STRING, draw_glyphs):
11079 (note_mouse_highlight): Mark variables that gcc -Wuninitialized
11080 does not deduce are never used uninitialized.
11082 * lisp.h (IF_LINT): New macro, copied from ../lib-src/emacsclient.c.
11084 * xdisp.c (redisplay_window): Rename local to avoid shadowing.
11085 * window.c (window_loop, size_window):
11086 (run_window_configuration_change_hook, enlarge_window): Likewise.
11088 * window.c (display_buffer): Now static.
11089 (size_window): Mark variables that gcc -Wuninitialized
11090 does not deduce are never used uninitialized.
11091 * window.h (check_all_windows): New decl, to forestall
11092 gcc -Wmissing-prototypes diagnostic.
11093 * dispextern.h (bidi_dump_cached_states): Likewise.
11095 * charset.h (CHECK_CHARSET_GET_CHARSET): Rename locals to avoid
11097 * charset.c (map_charset_for_dump, Fchar_charset): Likewise.
11098 Include <limits.h>.
11099 (Fsort_charsets): Redo min/max calculation to shorten the code a bit
11100 and to avoid gcc -Wuninitialized warning.
11101 (load_charset_map): Mark variables that gcc -Wuninitialized
11102 does not deduce are never used uninitialized.
11103 (load_charset): Abort instead of using uninitialized var (Bug#8229).
11105 * coding.c (coding_set_source, coding_set_destination):
11106 Use "else { /* comment */ }" rather than "else /* comment */;"
11107 for clarity, and to avoid gcc -Wempty-body warning.
11108 (Fdefine_coding_system_internal): Don't redeclare 'i' inside
11109 a block, when the outer 'i' will do.
11110 (decode_coding_utf_8, decode_coding_utf_16, detect_coding_emacs_mule):
11111 (emacs_mule_char, decode_coding_emacs_mule, detect_coding_iso_2022):
11112 (decode_coding_iso_2022, decode_coding_sjis, decode_coding_big5):
11113 (decode_coding_raw_text, decode_coding_charset, get_translation_table):
11114 (Fdecode_sjis_char, Fdefine_coding_system_internal):
11115 Rename locals to avoid shadowing.
11116 * character.h (FETCH_STRING_CHAR_ADVANCE): Likewise.
11117 * coding.c (emacs_mule_char, encode_invocation_designation):
11118 Now static, since they're not used elsewhere.
11119 (decode_coding_iso_2022): Add "default: abort ();" as a safety check.
11120 (decode_coding_object, encode_coding_object, detect_coding_system):
11121 (decode_coding_emacs_mule): Mark variables that gcc
11122 -Wuninitialized does not deduce are never used uninitialized.
11123 (detect_coding_iso_2022): Initialize a local variable that might
11124 be used uninitialized. Leave a FIXME because it's not clear that
11125 this initialization is needed. (Bug#8211)
11126 (ISO_CODE_LF, ISO_CODE_CR, CODING_ISO_FLAG_EUC_TW_SHIFT):
11127 (ONE_MORE_BYTE_NO_CHECK, UTF_BOM, UTF_16_INVALID_P):
11128 (SHIFT_OUT_OK, ENCODE_CONTROL_SEQUENCE_INTRODUCER):
11129 (ENCODE_DIRECTION_R2L, ENCODE_DIRECTION_L2R):
11130 Remove unused macros.
11132 * category.c (hash_get_category_set): Remove unused local var.
11133 (copy_category_table): Now static, since it's not used elsewhere.
11134 * character.c (string_count_byte8): Likewise.
11136 * ccl.c (CCL_WRITE_STRING, CCL_ENCODE_CHAR, Fccl_execute_on_string):
11137 (Fregister_code_conversion_map): Rename locals to avoid shadowing.
11139 * chartab.c (copy_sub_char_table): Now static, since it's not used
11141 (sub_char_table_ref_and_range, char_table_ref_and_range):
11142 Rename locals to avoid shadowing.
11143 (ASET_RANGE, GET_SUB_CHAR_TABLE): Remove unused macros.
11145 * bidi.c (bidi_check_type): Now static, since it's not used elsewhere.
11146 (BIDI_BOB): Remove unused macro.
11148 * cm.c (cmgoto): Mark variables that gcc -Wuninitialized does not
11149 deduce are never used uninitialized.
11150 * term.c (encode_terminal_code): Likewise.
11152 * term.c (encode_terminal_code): Now static. Remove unused local.
11154 * tparam.h: New file.
11155 * term.c, tparam.h: Include it.
11156 * deps.mk (term.o, tparam.o): Depend on tparam.h.
11157 * term.c (tputs, tgetent, tgetflag, tgetnum, tparam, tgetstr):
11158 Move these decls to tparam.h, and make them agree with what
11159 is actually in tparam.c. The previous trick of using incompatible
11160 decls in different modules does not conform to the C standard.
11161 All callers of tparam changed to use tparam's actual API.
11162 * tparam.c (tparam1, tparam, tgoto):
11163 Use const pointers where appropriate.
11165 * cm.c (calccost, cmgoto): Use const pointers where appropriate.
11166 * cm.h (struct cm): Likewise.
11167 * dispextern.h (do_line_insertion_deletion_costs): Likewise.
11168 * scroll.c (ins_del_costs, do_line_insertion_deletion_costs): Likewise.
11169 * term.c (tty_ins_del_lines, calculate_costs, struct fkey_table):
11170 (term_get_fkeys_1, append_glyphless_glyph, produce_glyphless_glyph):
11171 (turn_on_face, init_tty): Likewise.
11172 * termchar.h (struct tty_display_info): Likewise.
11174 * term.c (term_mouse_position): Rename local to avoid shadowing.
11176 * alloc.c (mark_ttys): Move decl from here ...
11177 * lisp.h (mark_ttys): ... to here, so that it's checked against defn.
11179 2011-03-11 Andreas Schwab <schwab@linux-m68k.org>
11181 * .gdbinit (pwinx, xbuffer): Fix access to buffer name.
11183 2011-03-09 Juanma Barranquero <lekktu@gmail.com>
11185 * search.c (compile_pattern_1): Remove argument regp, unused since
11186 revid:rms@gnu.org-19941211082627-3x1g1wyqkjmwloig.
11187 (compile_pattern): Don't pass it.
11189 2011-03-08 Jan Djärv <jan.h.d@swipnet.se>
11191 * xterm.h (DEFAULT_GDK_DISPLAY): New define.
11192 (GDK_WINDOW_XID, gtk_widget_get_preferred_size): New defines
11194 (GTK_WIDGET_TO_X_WIN): Use GDK_WINDOW_XID.
11196 * xmenu.c (menu_position_func): Call gtk_widget_get_preferred_size.
11198 * gtkutil.c: Include gtkx.h if HAVE_GTK3. If ! HAVE_GTK3, define
11199 gdk_window_get_screen, gdk_window_get_geometry,
11200 gdk_x11_window_lookup_for_display and GDK_KEY_g.
11201 (xg_set_screen): Use DEFAULT_GDK_DISPLAY.
11202 (xg_get_pixbuf_from_pixmap): New function.
11203 (xg_get_pixbuf_from_pix_and_mask): Change parameters from GdkPixmap
11204 to Pixmap, take frame as parameter, remove GdkColormap parameter.
11205 Call xg_get_pixbuf_from_pixmap instead of
11206 gdk_pixbuf_get_from_drawable.
11207 (xg_get_image_for_pixmap): Do not make GdkPixmaps, call
11208 xg_get_pixbuf_from_pix_and_mask with Pixmap parameters instead.
11209 (xg_check_special_colors): Use GtkStyleContext and its functions
11211 (xg_prepare_tooltip, xg_hide_tooltip): Call gdk_window_get_screen.
11212 (xg_prepare_tooltip, create_dialog, menubar_map_cb)
11213 (xg_update_frame_menubar, xg_tool_bar_detach_callback)
11214 (xg_tool_bar_attach_callback, xg_update_tool_bar_sizes):
11215 Call gtk_widget_get_preferred_size.
11216 (xg_frame_resized): gdk_window_get_geometry only takes 5
11218 (xg_win_to_widget, xg_event_is_for_menubar):
11219 Call gdk_x11_window_lookup_for_display.
11220 (xg_set_widget_bg): New function.
11221 (delete_cb): New function.
11222 (xg_create_frame_widgets): Connect delete-event to delete_cb.
11223 Call xg_set_widget_bg. Only set background pixmap for ! HAVE_GTK3
11224 (xg_set_background_color): Call xg_set_widget_bg.
11225 (xg_set_frame_icon): Call xg_get_pixbuf_from_pix_and_mask.
11226 (xg_create_scroll_bar): vadj is a GtkAdjustment for HAVE_GTK3.
11227 Only call gtk_range_set_update_policy if ! HAVE_GTK3.
11228 (xg_make_tool_item): Only connect xg_tool_bar_item_expose_callback
11230 (update_frame_tool_bar): Call gtk_widget_hide.
11231 (xg_initialize): Use GDK_KEY_g.
11233 * xsmfns.c (gdk_set_sm_client_id): Define to gdk_set_sm_client_id
11235 (x_session_initialize): Call gdk_x11_set_sm_client_id.
11237 * xterm.c (XFillRectangle): Use cairo routines for HAVE_GTK3.
11238 (x_term_init): Disable Xinput(2) with GDK_CORE_DEVICE_EVENTS.
11239 Load ~/emacs.d/gtkrc only for ! HAVE_GTK3.
11241 2011-03-08 Juanma Barranquero <lekktu@gmail.com>
11243 * w32xfns.c (select_palette): Check success of RealizePalette against
11244 GDI_ERROR, not zero.
11246 See ChangeLog.11 for earlier changes.
11248 ;; Local Variables:
11252 Copyright (C) 2011-2012 Free Software Foundation, Inc.
11254 This file is part of GNU Emacs.
11256 GNU Emacs is free software: you can redistribute it and/or modify
11257 it under the terms of the GNU General Public License as published by
11258 the Free Software Foundation, either version 3 of the License, or
11259 (at your option) any later version.
11261 GNU Emacs is distributed in the hope that it will be useful,
11262 but WITHOUT ANY WARRANTY; without even the implied warranty of
11263 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11264 GNU General Public License for more details.
11266 You should have received a copy of the GNU General Public License
11267 along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.