]> code.delx.au - gnu-emacs/blob - src/ChangeLog
Merge from trunk.
[gnu-emacs] / src / ChangeLog
1 2012-05-25 Paul Eggert <eggert@cs.ucla.edu>
2
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)
14 (mark_vectorlike):
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.
80 (ccl_driver):
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
98 out of 'int' range.
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
123 to INT_MAX.
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.
207 (Faref, Faset):
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.
217 All uses changed.
218 (xd_signature, xd_append_arg, xd_retrieve_arg, Fdbus_message_internal)
219 (xd_read_message_1):
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)
231 (struct 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.
247 (get_doc_string):
248 Use SAFE_ALLOCA, not alloca.
249 Check for overflow when converting EMACS_INT to off_t.
250 * doprnt.c (doprnt):
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
277 undefined behavior.
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)
304 (a_write, e_write):
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.
330 (Frequire):
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.
335 All callers changed.
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
357 integer overflow.
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):
403 (Fcompute_motion):
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.
411 (struct position):
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;
415 all uses removed.
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.
445 (struct interval):
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):
470 (describe_command):
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.
487 All callers changed.
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
510 in size calculation.
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.
523 All callers changed.
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)
539 (Ftest_completion):
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
551 wide enough.
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)
558 (print_object):
559 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
560 (PRINTDECLARE):
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)
573 (sigchld_handler):
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
577 undefined behavior.
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):
600 (Freplace_match):
601 (Fmatch_data):
602 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
603 (string_match_1, search_buffer, set_search_regs):
604 (Fmatch_data):
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.
630 (Fforward_word):
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.
636 (struct gl_state_s):
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)
740 (Flookup_image_map):
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
748 doesn't matter here.
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.
759 (Fx_family_fonts):
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)
769 (Fx_show_tip):
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
793 may come from Lisp.
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.
801
802 2012-05-25 Glenn Morris <rgm@gnu.org>
803
804 * lisp.mk (lisp): Update for more files being compiled now.
805
806 2012-05-25 Stefan Monnier <monnier@iro.umontreal.ca>
807
808 * lread.c: Remove `read_pure' which makes no difference.
809 (read_pure): Remove var.
810 (unreadpure): Remove function.
811 (readevalloop): Don't call read_list with -1 flag.
812 (read1, read_vector): Don't test read_pure any more.
813 (read_list): Simplify.
814
815 * fileio.c, character.h: Minor style tweaks.
816
817 2012-05-24 Dmitry Antipov <dmantipov@yandex.ru>
818
819 * window.h (clip_changed): Remove useless declaration.
820
821 2012-05-22 Juanma Barranquero <lekktu@gmail.com>
822
823 * makefile.w32-in: Follow-up to 2012-05-22T16:20:27Z!eggert@cs.ucla.edu.
824 (TAGS, TAGS-gmake, CONFIG_H): Remove further references to m/intel386.h.
825
826 2012-05-22 Paul Eggert <eggert@cs.ucla.edu>
827
828 Remove src/m/*.
829 This directory predates autoconf and is no longer needed nowadays.
830 Move its few remaining bits of functionality to where they're needed.
831 * m/README, m/alpha.h, m/amdx86-64.h, m/ia64.h, m/ibmrs6000.h:
832 * m/ibms390x.h, m/intel386.h, m/m68k.h, m/macppc.h, m/sparc.h:
833 * m/template.h: Remove.
834 * Makefile.in (M_FILE): Remove. All uses removed.
835 * alloc.c (POINTERS_MIGHT_HIDE_IN_OBJECTS):
836 * lisp.h (USE_LSB_TAG):
837 * mem-limits.h (EXCEEDS_LISP_PTR):
838 Use VAL_MAX, not VALBITS, in #if.
839 * lisp.h (EMACS_INT_MAX): New macro, useful in #if.
840 (EMACS_UINT): Define unconditionally now.
841 (BITS_PER_CHAR, BITS_PER_SHORT, BITS_PER_INT, BITS_PER_LONG)
842 (BITS_PER_EMACS_INT): New constants, replacing
843 what used to be in config.h, but not useful in #if.
844 (GCTYPEBITS, VALBITS): Define unconditionally, since m/* files don't
845 define them any more.
846 (VAL_MAX): New macro.
847 (VALMASK): Use it.
848 * puresize.h (PURESIZE_RATIO): Use EMACS_INT_MAX, not
849 BITS_PER_EMACS_INT, in #if.
850 * s/aix4-2.h (BROKEN_FIONREAD, BROKEN_SIGAIO, BROKEN_SIGPTY)
851 (BROKEN_SIGPOLL): Move here from m/ibmrs6000.h, which was removed.
852 * s/gnu-linux.h (ULIMIT_BREAK_VALUE) [__i386__]:
853 * s/ms-w32.h (DATA_START):
854 Move here from removed file m/intel386.h.
855 * s/gnu.h (NLIST_STRUCT): Remove undef; 'configure' does this.
856 * s/irix6-5.h (_LP64): Remove; lisp.h no longer needs this.
857
858 2012-05-21 Paul Eggert <eggert@cs.ucla.edu>
859
860 Assume C89 or later.
861 * alloc.c, buffer.c, lisp.h: Replace POINTER_TYPE with void.
862 * alloc.c (overrun_check_malloc, overrun_check_realloc, xmalloc)
863 (xrealloc):
864 * buffer.c (mmap_free_1, mmap_enlarge): Omit needless casts.
865 * editfns.c, fns.c, gmalloc.c, insdel.c, sysdep.c, termcap.c (NULL):
866 * textprop.c, tparam.c (NULL): Remove.
867 * ralloc.c, vm-limit.c (POINTER): Assume void * works.
868 * regex.c (SIGN_EXTEND_CHAR): Assume signed char works.
869 * regex.h (_RE_ARGS): Remove. All uses rewritten to use prototypes.
870 * unexelf.c (ElfBitsW): Assume c89 preprocessor or better.
871 * xterm.c (input_signal_count): Assume volatile works.
872
873 2012-05-21 Ken Brown <kbrown@cornell.edu>
874
875 * xgselect.c (xg_select): Fix first argument in call to 'select'
876 (bug#11508).
877
878 2012-05-20 Ken Brown <kbrown@cornell.edu>
879
880 * gmalloc.c (_free_internal_nolock, _realloc_internal_nolock)
881 [CYGWIN]: Cast ptr to (char *) before comparing to _heapbase.
882
883 2012-05-19 Ken Brown <kbrown@cornell.edu>
884
885 * xfns.c (x_in_use): Remove `static' qualifier.
886 * xterm.h (x_in_use): Declare.
887 * xgselect.c: Include xterm.h.
888 (xg_select): Test `x_in_use' instead of `inhibit_window_system'
889 and `display_arg' (bug#9754).
890
891 2012-05-19 Paul Eggert <eggert@cs.ucla.edu>
892
893 * s/ms-w32.h (HAVE_GETDOMAINNAME): Remove; not needed.
894
895 * m/vax.h: Remove; no longer needed since HAVE_FTIME is being removed.
896 * s/ms-w32.h (HAVE_FTIME): Remove; not needed.
897
898 2012-05-18 Eli Zaretskii <eliz@gnu.org>
899
900 Fix compilation with -DGLYPH_DEBUG=1 on MS-Windows.
901
902 * w32term.c [GLYPH_DEBUG]: Add prototype for x_check_font.
903 (x_check_font) [GLYPH_DEBUG]: New function, copied from xterm.c
904
905 * w32fns.c (unwind_create_frame) [GLYPH_DEBUG]: Fix broken
906 reference to image_cache->refcount.
907 (x_create_tip_frame): Fix broken use of FRAME_IMAGE_CACHE.
908
909 2012-05-17 Juri Linkov <juri@jurta.org>
910
911 * search.c (Fword_search_regexp, Fword_search_backward)
912 (Fword_search_forward, Fword_search_backward_lax)
913 (Fword_search_forward_lax): Move functions to isearch.el
914 (bug#10145, bug#11381).
915
916 2012-05-16 Paul Eggert <eggert@cs.ucla.edu>
917
918 * xgselect.c (xg_select): Just invoke 'select' if -nw (Bug#9754).
919
920 2012-05-15 Stefan Monnier <monnier@iro.umontreal.ca>
921
922 * lread.c (init_obarray): Declare Qt and Qnil as special.
923
924 2012-05-14 Glenn Morris <rgm@gnu.org>
925
926 * nsterm.m (ns_init_paths): Fix typo ("libexec" not "lib-exec").
927 Put "libexec" before "bin", for the sake of init_callproc_1.
928
929 2012-05-14 Paul Eggert <eggert@cs.ucla.edu>
930
931 * keyboard.c (kbd_buffer_get_event) [!HAVE_DBUS]: Omit unused local.
932
933 * unexaix.c: Port to more-recent AIX compilers.
934 (report_error, report_error_1, make_hdr, copy_sym)
935 (mark_x, adjust_lnnoptrs, unrelocate_symbols):
936 Make arguments const char *, not char *, to avoid violations of C
937 standard and to fix some AIX warnings reported by Gilles Pion.
938
939 2012-05-14 Eli Zaretskii <eliz@gnu.org>
940
941 * xdisp.c (handle_stop): Don't call get_overlay_strings_1 if we
942 already have overlays loaded.
943 (handle_single_display_spec): Before returning without displaying
944 fringe bitmap, synchronize the bidi iterator with the main display
945 iterator, by calling iterate_out_of_display_property.
946 (iterate_out_of_display_property): Detect buffer iteration by
947 testing that it->string is a Lisp string.
948 (get_next_display_element): When the current object is exhausted,
949 and there's something on it->stack, call set_iterator_to_next to
950 proceed with what's on the stack, instead of returning zero.
951 (set_iterator_to_next): If called at the end of a Lisp string,
952 proceed to consider_string_end without incrementing string
953 position. Don't increment display vector index past the end of
954 the display vector. (Bug#11417)
955 (pos_visible_p): Don't report a position visible when move_it_to
956 stopped at the last line of window, which happens to be scanned
957 backwards by the bidi iteration. (Bug#11464)
958
959 2012-05-14 Eli Zaretskii <eliz@gnu.org>
960
961 * xdisp.c (handle_single_display_spec): Return 1 for left-margin
962 and right-margin display specs even if the spec is invalid or we
963 are on a TTY, and thus unable to display on the fringes. That's
964 because the text with the property will not be displayed anyway,
965 so we need to signal to the caller that this is a "replacing"
966 display spec. This fixes display when the spec is invalid or we
967 are on a TTY.
968
969 2012-05-14 Paul Eggert <eggert@cs.ucla.edu>
970
971 * unexaix.c (make_hdr): Fix typo in prototype.
972 This bug broke the build on AIX. Problem reported by Gilles Pion.
973
974 2012-05-14 Michael Albinus <michael.albinus@gmx.de>
975
976 * keyboard.c (kbd_buffer_get_event): Read special events also in
977 batch mode. (Bug#11415)
978
979 2012-05-12 Glenn Morris <rgm@gnu.org>
980
981 * ns.mk: Update for ns_appbindir no longer having trailing "/".
982
983 2012-05-12 Eli Zaretskii <eliz@gnu.org>
984
985 * lisp.mk (lisp): Add newcomment.elc.
986
987 2012-05-12 Glenn Morris <rgm@gnu.org>
988
989 * Makefile.in (MKDIR_P): New, set by configure.
990 * ns.mk (${ns_appdir}, ${ns_appbindir}Emacs): Use $MKDIR_P.
991
992 2012-05-11 Paul Eggert <eggert@cs.ucla.edu>
993
994 Remove unused function hourglass_started.
995 * dispextern.h (hourglass_started):
996 * w32fns.c (hourglass_started):
997 * xdisp.c (hourglass_started): Remove.
998
999 2012-05-10 Juanma Barranquero <lekktu@gmail.com>
1000
1001 * makefile.w32-in ($(BLD)/gmalloc.$(O), $(BLD)/w32menu.$(O)):
1002 Update dependencies.
1003
1004 2012-05-10 Paul Eggert <eggert@cs.ucla.edu>
1005
1006 * xgselect.c (xg_select): Put maxfds+1 into a var.
1007 This is slightly clearer, and pacifies Ubuntu 12.04 gcc.
1008
1009 * sound.c (DEFAULT_ALSA_SOUND_DEVICE): Define only if HAVE_ALSA.
1010
1011 2012-05-10 Dave Abrahams <dave@boostpro.com>
1012
1013 * filelock.c (syms_of_filelock): New boolean create-lockfiles.
1014 (lock_file): If create_lockfiles is 0, do nothing. (Bug#11227)
1015
1016 2012-05-09 Michael Albinus <michael.albinus@gmx.de>
1017
1018 * dbusbind.c (xd_registered_buses): New internal Lisp object.
1019 Rename all occurences of Vdbus_registered_buses to xd_registered_buses.
1020 (syms_of_dbusbind): Remove declaration of Vdbus_registered_buses.
1021 Initialize xd_registered_buses.
1022
1023 2012-05-09 Paul Eggert <eggert@cs.ucla.edu>
1024
1025 Untag more efficiently if USE_LSB_TAG.
1026 This is based on a proposal by YAMAMOTO Mitsuharu in
1027 <http://lists.gnu.org/archive/html/emacs-devel/2008-01/msg01876.html>.
1028 For an admittedly artificial (nth 8000 longlist) benchmark on
1029 Fedora 15 x86-64, this yields a 25% CPU speedup. Also, it shrinks
1030 Emacs's overall text size by 1%.
1031 * lisp.h (XUNTAG): New macro.
1032 (XCONS, XVECTOR, XSTRING, XSYMBOL, XFLOAT, XMISC, XPROCESS, XWINDOW)
1033 (XTERMINAL, XSUBR, XBUFFER, XCHAR_TABLE, XSUB_CHAR_TABLE, XBOOL_VECTOR)
1034 (XSETTYPED_PSEUDOVECTOR, XHASH_TABLE, TYPED_PSEUDOVECTORP): Use it.
1035 * eval.c (Fautoload):
1036 * font.h (XFONT_SPEC, XFONT_ENTITY, XFONT_OBJECT):
1037 * frame.h (XFRAME): Use XUNTAG.
1038
1039 Port recent dbusbind.c changes to 32-bit --with-wide-int.
1040 * dbusbind.c (xd_append_arg, xd_retrieve_arg, Fdbus_message_internal):
1041 Remove unportable assumptions about print widths of types like
1042 dbus_uint32_t.
1043 (xd_get_connection_address, Fdbus_init_bus): Cast Emacs integer to
1044 intptr_t when converting between pointer and integer, to avoid GCC
1045 warnings about wrong width.
1046
1047 2012-05-09 Eli Zaretskii <eliz@gnu.org>
1048
1049 * w32proc.c (new_child): Force Windows to reserve only 64KB of
1050 stack for each reader_thread, instead of defaulting to 8MB
1051 determined by the linker. This avoids failures in creating
1052 subprocesses on Windows 7, see the discussion in this thread:
1053 http://lists.gnu.org/archive/html/emacs-devel/2012-03/msg00119.html.
1054
1055 2012-05-07 Jérémy Compostella <jeremy.compostella@gmail.com>
1056
1057 Fix up display of the *Minibuf-0* buffer in the mini window.
1058 * keyboard.c (read_char): Don't clear the echo area if there's no
1059 message to clear.
1060 * xdisp.c (redisplay_internal): Redisplay the mini window (with the
1061 contents of *Minibuf-0*) if there's no message displayed in its stead.
1062
1063 2012-05-07 Michael Albinus <michael.albinus@gmx.de>
1064
1065 * dbusbind.c (XD_DEBUG_MESSAGE): Don't print message twice in
1066 batch mode.
1067
1068 2012-05-06 Chong Yidong <cyd@gnu.org>
1069
1070 * lisp.mk (lisp): Update.
1071
1072 2012-05-05 Jim Meyering <meyering@redhat.com>
1073
1074 * w32font.c (fill_in_logfont): NUL-terminate a string (Bug#11372).
1075
1076 2012-05-04 Stefan Monnier <monnier@iro.umontreal.ca>
1077
1078 * data.c (PUT_ERROR): New macro.
1079 (syms_of_data): Use it. Add new error type `user-error'.
1080 * undo.c (user_error): New function.
1081 (Fprimitive_undo): Use it.
1082 * print.c (print_error_message): Adjust print style for `user-error'.
1083 * keyboard.c (user_error): New function.
1084 (Fexit_recursive_edit, Fabort_recursive_edit): Use it.
1085
1086 2012-05-03 Paul Eggert <eggert@cs.ucla.edu>
1087
1088 Do not limit current-time-string to years 1000..9999.
1089 * editfns.c (TM_YEAR_IN_ASCTIME_RANGE): Remove.
1090 (Fcurrent_time_string): Support any year that is supported by the
1091 underlying localtime representation. Don't use asctime, as it
1092 has undefined behavior for years outside the range -999..9999.
1093
1094 2012-05-02 Paul Eggert <eggert@cs.ucla.edu>
1095
1096 Fix race conditions involving setenv, gmtime, localtime, asctime.
1097 Without this fix, interrupts could mess up code that uses these
1098 nonreentrant functions, since setting TZ invalidates existing
1099 tm_zone or tzname values, and since most of these functions return
1100 pointers to static storage.
1101 * editfns.c (format_time_string, Fdecode_time, Fencode_time)
1102 (Fcurrent_time_string, Fcurrent_time_zone, Fset_time_zone_rule):
1103 Grow the critical sections to include not just invoking
1104 localtime/gmtime, but also accessing these functions' results
1105 including their tm_zone values if any, and any related TZ setting.
1106 (format_time_string): Last arg is now struct tm *, not struct tm **,
1107 so that the struct tm is saved in the critical section.
1108 All callers changed. Simplify allocation of initial buffer, partly
1109 motivated by the fact that memory allocation needs to be outside
1110 the critical section.
1111
1112 2012-05-02 Dmitry Antipov <dmantipov@yandex.ru>
1113
1114 * intervals.c (adjust_intervals_for_insertion): Initialize `newi'
1115 with RESET_INTERVAL.
1116
1117 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer):
1118 Remove duplicated buffer name initialization.
1119
1120 2012-05-02 Jim Meyering <jim@meyering.net>
1121
1122 * xterm.c (x_term_init): Use memcpy instead of strncpy (Bug#11373).
1123
1124 * xfns.c (x_window): Use xstrdup (Bug#11375).
1125
1126 2012-05-02 Eli Zaretskii <eliz@gnu.org>
1127
1128 * xdisp.c (pos_visible_p): If already at a newline from the
1129 display string before the 'while' loop, don't walk back the glyphs
1130 from it3.glyph_row. Solves assertion violation when the display
1131 string begins with a newline (egg.el). (Bug#11367)
1132
1133 2012-05-01 Stefan Monnier <monnier@iro.umontreal.ca>
1134
1135 * keyboard.c (Fexecute_extended_command, Vsuggest_key_bindings):
1136 Move to simple.el.
1137
1138 2012-05-01 Glenn Morris <rgm@gnu.org>
1139
1140 * syssignal.h: Remove reference to BROKEN_SIGINFO (last used in
1141 s/ptx4.h), BROKEN_SIGTSTP (last used in m/ustation.h, m/dpx2.h),
1142 and BROKEN_SIGURG (was in s/gnu-linux.h prior to 2008-02-10).
1143 All were removed before 23.1.
1144
1145 * dispnew.c: Remove HAVE_LIBNCURSES test;
1146 it is always true on relevant platforms.
1147
1148 * Makefile.in (LD_SWITCH_X_SITE_RPATH):
1149 Rename from LD_SWITCH_X_SITE_AUX_RPATH.
1150
1151 * Makefile.in (LD_SWITCH_X_SITE_AUX): Remove; no longer used.
1152
1153 2012-04-30 Andreas Schwab <schwab@linux-m68k.org>
1154
1155 * .gdbinit (xpr): Remove checks for no longer existing misc types.
1156 (xintfwd, xboolfwd, xobjfwd, xbufobjfwd, xkbobjfwd, xbuflocal):
1157 Remove.
1158
1159 2012-04-28 Paul Eggert <eggert@cs.ucla.edu>
1160
1161 Do not avoid creating empty evaporating overlays (Bug#9642).
1162 * buffer.c (Fmove_overlay): Revert the change of 2012-04-23.
1163 That is, do not delete an evaporating overlay if it becomes
1164 empty after its bounds are adjusted to fit within its buffer.
1165 This fix caused other problems, and I'm reverting it until we get
1166 to the bottom of them.
1167
1168 2012-04-27 Chong Yidong <cyd@gnu.org>
1169
1170 * xselect.c (x_convert_selection): Initialize a pointer (Bug#11315).
1171
1172 2012-04-27 Eli Zaretskii <eliz@gnu.org>
1173
1174 * xdisp.c (pos_visible_p): If the window start position is beyond
1175 ZV, start the display from buffer beginning. Prevents assertion
1176 violation in init_iterator when the minibuffer window is scrolled
1177 via the scroll bar.
1178
1179 * window.c (window_scroll_pixel_based): Likewise.
1180
1181 2012-04-27 Chong Yidong <cyd@gnu.org>
1182
1183 * keymap.c (where_is_internal): Doc fix (Bug#10872).
1184
1185 2012-04-27 Glenn Morris <rgm@gnu.org>
1186
1187 * fileio.c (Fcopy_file, Fset_file_selinux_context):
1188 Ignore ENOTSUP failures from setfilecon functions. (Bug#11245)
1189
1190 2012-04-27 Eli Zaretskii <eliz@gnu.org>
1191
1192 * dispnew.c (swap_glyph_pointers, copy_row_except_pointers):
1193 Don't overrun array limits of glyph row's used[] array. (Bug#11288)
1194
1195 2012-04-26 Eli Zaretskii <eliz@gnu.org>
1196
1197 * xdisp.c (IT_DISPLAYING_WHITESPACE): In addition to the loaded
1198 display element, check also the underlying string or buffer
1199 character. (Bug#11341)
1200
1201 * w32menu.c: Include w32heap.h.
1202 (add_menu_item): If the call to AppendMenuW (via
1203 unicode_append_menu) fails, disable Unicode menus only if we are
1204 running on Windows 9X/Me.
1205
1206 2012-04-24 Andreas Schwab <schwab@linux-m68k.org>
1207
1208 * .gdbinit (xpr): Handle USE_2_TAGS_FOR_INTS.
1209 (xgetint): Add missing shift for LSB tags.
1210
1211 2012-04-24 Martin Rudalics <rudalics@gmx.at>
1212
1213 * keyboard.c (read_char): Don't wipe echo area for select window
1214 events: These might get delayed via `mouse-autoselect-window'
1215 (Bug#11304).
1216
1217 2012-04-24 Juanma Barranquero <lekktu@gmail.com>
1218
1219 * gnutls.c (init_gnutls_functions): Protect against (unlikely)
1220 manipulation of :loaded-from data.
1221
1222 2012-04-23 Juanma Barranquero <lekktu@gmail.com>
1223
1224 * gnutls.c (init_gnutls_functions): The value of :loaded-from is
1225 now a cons (bug#11311).
1226
1227 2012-04-23 Paul Eggert <eggert@cs.ucla.edu>
1228
1229 Do not create empty overlays with the evaporate property (Bug#9642).
1230 * buffer.c (Fmove_overlay): Delete an evaporating overlay
1231 if it becomes empty after its bounds are adjusted to fit within
1232 its buffer. Without this fix, in a nonempty buffer (let ((o
1233 (make-overlay 1 2))) (overlay-put o 'evaporate t) (move-overlay o 0 1))
1234 yields an empty overlay that has the evaporate property, which is
1235 not supposed to happen.
1236
1237 Fix minor GTK3 problems found by static checking.
1238 * emacsgtkfixed.c (EMACS_TYPE_FIXED, EMACS_FIXED, EmacsFixed)
1239 (EmacsFixedPrivate, EmacsFixedClass, struct _EmacsFixed)
1240 (struct _EmacsFixedClass, emacs_fixed_get_type):
1241 Move decls here from emacsgtkfixed.h, since they needn't be public.
1242 (emacs_fixed_get_type): Now static.
1243 (emacs_fixed_class_init): Omit unused local.
1244 (emacs_fixed_child_type): Remove; unused.
1245 * emacsgtkfixed.h (EMACS_TYPE_FIXED, EMACS_FIXED, EmacsFixed)
1246 (EmacsFixedPrivate, EmacsFixedClass, struct _EmacsFixed)
1247 (struct _EmacsFixedClass): Move to emacsgtkfixed.c.
1248 (EMACS_FIXED_CLASS, EMACS_IS_FIXED, EMACS_IS_FIXED_CLASS)
1249 (EMACS_FIXED_GET_CLASS): Remove; unused.
1250 * gtkutil.c (xg_create_frame_widgets) [!HAVE_GTK3]: Omit unused local.
1251
1252 * keyboard.c (handle_async_input): Define only if SYNC_INPUT || SIGIO.
1253 Problem reported by Juanma Barranquero for Windows -Wunused-function.
1254
1255 2012-04-22 Paul Eggert <eggert@cs.ucla.edu>
1256
1257 Modernize and clean up gmalloc.c to assume C89 (Bug#9119).
1258 * gmalloc.c (_MALLOC_INTERNAL, _MALLOC_H, _PP, __ptr_t)
1259 (__malloc_size_t, __malloc_ptrdiff_t):
1260 Remove. All uses removed, replaced by the definiens if needed,
1261 since we can assume C89 or better now.
1262 Include <stdint.h>, for PTRDIFF_MAX, uintptr_t.
1263 (protect_malloc_state, align, get_contiguous_space)
1264 (malloc_atfork_handler_prepare, malloc_atfork_handler_parent)
1265 (malloc_atfork_handler_child, malloc_enable_thread)
1266 (malloc_initialize_1, __malloc_initialize, morecore_nolock)
1267 (_malloc_internal_nolock, _malloc_internal, malloc, _malloc)
1268 (_free, _realloc, _free_internal_nolock, _free_internal, free, cfree)
1269 (special_realloc, _realloc_internal_nolock, _realloc_internal)
1270 (realloc, calloc, __default_morecore, memalign, valloc, checkhdr)
1271 (freehook, mallochook, reallochook, mabort, mcheck, mprobe):
1272 Define using prototypes, not old style.
1273 (align, _malloc_internal_nolock, _free_internal_nolock, memalign):
1274 Don't assume ptrdiff_t and uintptr_t are no wider than unsigned long.
1275 (align): Don't assume that signed integer overflow wraps around.
1276 Omit unused local var.
1277 (malloc_initialize_1, morecore_nolock, _malloc_internal_nolock)
1278 (_free_internal_nolock, memalign, mallochook, reallochook):
1279 Omit no-longer-needed casts.
1280 (valloc): Use getpagesize, not __getpagesize.
1281 (MAGICWORD, MAGICFREE): Now randomish size_t values, not 32-bit.
1282 (struct hdr): The 'magic' member is now size_t, not unsigned long.
1283
1284 * dbusbind.c (XD_DBUS_VALIDATE_OBJECT): Define only if needed.
1285
1286 2012-04-22 Michael Albinus <michael.albinus@gmx.de>
1287
1288 Move functions from C to Lisp. Make non-blocking method calls
1289 the default. Implement further D-Bus standard interfaces.
1290
1291 * dbusbind.c (DBUS_NUM_MESSAGE_TYPES): Declare.
1292 (QCdbus_request_name_allow_replacement)
1293 (QCdbus_request_name_replace_existing)
1294 (QCdbus_request_name_do_not_queue)
1295 (QCdbus_request_name_reply_primary_owner)
1296 (QCdbus_request_name_reply_in_queue)
1297 (QCdbus_request_name_reply_exists)
1298 (QCdbus_request_name_reply_already_owner): Move to dbus.el.
1299 (QCdbus_registered_serial, QCdbus_registered_method)
1300 (QCdbus_registered_signal): New Lisp objects.
1301 (XD_DEBUG_MESSAGE): Use sizeof.
1302 (XD_MESSAGE_TYPE_TO_STRING, XD_OBJECT_TO_STRING)
1303 (XD_DBUS_VALIDATE_BUS_ADDRESS, XD_DBUS_VALIDATE_OBJECT)
1304 (XD_DBUS_VALIDATE_BUS_NAME, XD_DBUS_VALIDATE_PATH)
1305 (XD_DBUS_VALIDATE_INTERFACE, XD_DBUS_VALIDATE_MEMBER): New macros.
1306 (XD_CHECK_DBUS_SERIAL): Rename from CHECK_DBUS_SERIAL_GET_SERIAL.
1307 (xd_signature, xd_append_arg): Allow float for integer types.
1308 (xd_get_connection_references): New function.
1309 (xd_get_connection_address): Rename from xd_initialize.
1310 Return cached address.
1311 (xd_remove_watch): Do not unset $DBUS_SESSION_BUS_ADDRESS.
1312 (xd_close_bus): Rename from Fdbus_close_bus. Not needed on Lisp
1313 level.
1314 (Fdbus_init_bus): New optional arg PRIVATE. Cache address.
1315 Return number of refcounts.
1316 (Fdbus_get_unique_name): Make stronger parameter check.
1317 (Fdbus_message_internal): New defun.
1318 (Fdbus_call_method, Fdbus_call_method_asynchronously)
1319 (Fdbus_method_return_internal, Fdbus_method_error_internal)
1320 (Fdbus_send_signal, Fdbus_register_service)
1321 (Fdbus_register_signal, Fdbus_register_method): Move to dbus.el.
1322 (xd_read_message_1): Obey new structure of Vdbus_registered_objects.
1323 (xd_read_queued_messages): Obey new structure of Vdbus_registered_buses.
1324 (Vdbus_compiled_version, Vdbus_runtime_version)
1325 (Vdbus_message_type_invalid, Vdbus_message_type_method_call)
1326 (Vdbus_message_type_method_return, Vdbus_message_type_error)
1327 (Vdbus_message_type_signal): New defvars.
1328 (Vdbus_registered_buses, Vdbus_registered_objects_table):
1329 Adapt docstring.
1330
1331 2012-04-22 Paul Eggert <eggert@cs.ucla.edu>
1332
1333 Fix GC_MALLOC_CHECK debugging output on 64-bit hosts.
1334 * alloc.c (emacs_blocked_malloc) [GC_MALLOC_CHECK]:
1335 Do not assume ptrdiff_t is the same width as 'int'.
1336
1337 * alloc.c: Handle unusual debugging option combinations.
1338 (GC_CHECK_MARKED_OBJECTS): Undef if ! GC_MARK_STACK,
1339 since the two debugging options are incompatible.
1340 (GC_MALLOC_CHECK): Similarly, undef if GC_CHECK_MARKED_OBJECTS
1341 is defined.
1342 (mem_init, mem_insert, mem_insert_fixup):
1343 Define if GC_MARK_STACK || GC_MALLOC_CHECK.
1344 (NEED_MEM_INSERT): Remove; no longer needed.
1345
1346 2012-04-22 Leo Liu <sdl.web@gmail.com>
1347
1348 * sysdep.c (list_system_processes): Support Darwin (Bug#5725).
1349
1350 2012-04-22 Paul Eggert <eggert@cs.ucla.edu>
1351
1352 * sysdep.c [__FreeBSD__]: Minor cleanups.
1353 (list_system_processes, system_process_attributes) [__FreeBSD__]:
1354 Use Emacs indenting style more consistently. Avoid some casts.
1355 Use 'double' consistently rather than mixing 'float' and 'double'.
1356
1357 2012-04-21 Eduard Wiebe <usenet@pusto.de>
1358
1359 * sysdep.c (list_system_processes, system_process_attributes):
1360 Add implementation for FreeBSD (Bug#5243).
1361
1362 2012-04-21 Andreas Schwab <schwab@linux-m68k.org>
1363
1364 * lisp.mk (lisp): Update.
1365
1366 2012-04-20 Paul Eggert <eggert@cs.ucla.edu>
1367
1368 * keyboard.c (process_pending_signals): Define only if SYNC_INPUT.
1369 It is never used otherwise.
1370
1371 2012-04-20 Stefan Monnier <monnier@iro.umontreal.ca>
1372
1373 * print.c (print_preprocess): Only check print_depth if print-circle
1374 is nil.
1375 (print_object): Check for cycles even when print-circle is nil and
1376 print-gensym is t, but only check print_depth if print-circle is nil.
1377
1378 2012-04-20 Chong Yidong <cyd@gnu.org>
1379
1380 * process.c (wait_reading_process_output): If EIO occurs on a pty,
1381 set the status to "failed" and ensure that sentinel is run.
1382
1383 2012-04-20 Glenn Morris <rgm@gnu.org>
1384
1385 * process.c (Fset_process_inherit_coding_system_flag)
1386 (Fset_process_query_on_exit_flag): Doc fix (mention return value).
1387 (Fmake_network_process, Fmake_serial_process): Doc fix.
1388
1389 2012-04-20 Eli Zaretskii <eliz@gnu.org>
1390
1391 * xdisp.c (string_buffer_position_lim): Limit starting position to
1392 BEGV.
1393 (set_cursor_from_row): If called for a mode-line or header-line
1394 row, return zero immediately.
1395 (try_cursor_movement): If inside continuation line, don't back up
1396 farther than the first row after the header line, if any.
1397 Don't consider the header-line row as "partially visible", even if
1398 MATRIX_ROW_PARTIALLY_VISIBLE_P returns non-zero. (Bug#11261)
1399
1400 2012-04-20 Atsuo Ohki <ohki@gssm.otsuka.tsukuba.ac.jp> (tiny change)
1401
1402 * lread.c (lisp_file_lexically_bound_p): Fix hang at ";-*-\n"
1403 (bug#11238).
1404
1405 2012-04-20 Teodor Zlatanov <tzz@lifelogs.com>
1406 2012-04-18 Paul Eggert <eggert@cs.ucla.edu>
1407
1408 configure: new option --enable-gcc-warnings (Bug#11207)
1409 * Makefile.in (C_WARNINGS_SWITCH): Remove.
1410 (WARN_CFLAGS, WERROR_CFLAGS): New macros.
1411 (ALL_CFLAGS): Use new macros rather than old.
1412 * process.c: Ignore -Wstrict-overflow to work around GCC bug 52904.
1413 * regex.c: Ignore -Wstrict-overflow. If !emacs, also ignore
1414 -Wunused-but-set-variable, -Wunused-function, -Wunused-macros,
1415 -Wunused-result, -Wunused-variable. This should go away once
1416 the Emacs and Gnulib regex code is merged.
1417 (xmalloc, xrealloc): Now static.
1418
1419 2012-04-17 Paul Eggert <eggert@cs.ucla.edu>
1420
1421 * dired.c (Fsystem_groups): Remove unused local.
1422
1423 2012-04-17 Glenn Morris <rgm@gnu.org>
1424
1425 * dired.c (Fsystem_users): Doc fix.
1426
1427 2012-04-17 Dmitry Antipov <dmantipov@yandex.ru>
1428
1429 * dired.c (Fsystem_users, Fsystem_groups): New functions. (Bug#7900)
1430 (syms_of_dired): Add them.
1431
1432 2012-04-16 Paul Eggert <eggert@cs.ucla.edu>
1433
1434 Fix minor alloc.c problems found by static checking.
1435 * alloc.c (_malloc_internal, _free_internal) [!DOUG_LEA_MALLOC]:
1436 New extern decls, to avoid calling undeclared functions.
1437 (dont_register_blocks): Define if ((!SYSTEM_MALLOC && !SYNC_INPUT)
1438 && GC_MALLOC_CHECK), not if ((GC_MARK_STACK || defined
1439 GC_MALLOC_CHECK) && GC_MALLOC_CHECK), to match when it's used.
1440 (NEED_MEM_INSERT): New macro.
1441 (mem_insert, mem_insert_fixup) [!NEED_MEM_INSERT]: Remove; unused.
1442 Remove one incorrect comment and fix another.
1443
1444 Fix minor ralloc.c problems found by static checking.
1445 See http://lists.gnu.org/archive/html/emacs-devel/2011-12/msg00720.html
1446 * ralloc.c (ALIGNED, ROUND_TO_PAGE, HEAP_PTR_SIZE)
1447 (r_alloc_size_in_use, r_alloc_freeze, r_alloc_thaw): Remove; unused.
1448 (r_alloc_sbrk): Now static.
1449
1450 Improve ralloc.c interface checking.
1451 See http://lists.gnu.org/archive/html/emacs-devel/2011-12/msg00720.html
1452 * buffer.c (ralloc_reset_variable, r_alloc, r_re_alloc)
1453 (r_alloc_free) [REL_ALLOC]: Move decls from here ...
1454 * lisp.h (r_alloc, r_alloc_free, r_re_alloc, r_alloc_reset_variable)
1455 [REL_ALLOC]: ... to here, to check interface.
1456 * m/ia64.h (r_alloc, r_alloc_free) [REL_ALLOC && !_MALLOC_INTERNAL]:
1457 Remove decls. This fixes an "It stinks!".
1458
1459 * alloc.c (which_symbols): Fix alignment issue / type clash.
1460
1461 2012-04-15 Andreas Schwab <schwab@linux-m68k.org>
1462
1463 * lisp.h (struct Lisp_Symbol): Remove explicit padding.
1464 (struct Lisp_Misc_Any): Likewise.
1465 (struct Lisp_Free): Likewise.
1466 * alloc.c (union aligned_Lisp_Symbol): Define.
1467 (SYMBOL_BLOCK_SIZE, struct symbol_block): Use union
1468 aligned_Lisp_Symbol instead of struct Lisp_Symbol.
1469 (union aligned_Lisp_Misc): Define.
1470 (MARKER_BLOCK_SIZE, struct marker_block): Use union
1471 aligned_Lisp_Misc instead of union Lisp_Misc.
1472 (Fmake_symbol, allocate_misc, gc_sweep): Adjust.
1473
1474 2012-04-14 Paul Eggert <eggert@cs.ucla.edu>
1475
1476 Make GC_MAKE_GCPROS_NOOPS the default (Bug#9926).
1477 * lisp.h (GC_MARK_STACK): Default to GC_MAKE_GCPROS_NOOPS.
1478 * s/cygwin.h, s/darwin.h, s/freebsd.h, s/gnu.h, s/irix6-5.h, s/msdos.h:
1479 * s/netbsd.h, s/sol2-6.h:
1480 Remove definition of GC_MARK_STACK, since the default now works.
1481 * s/aix4-2.h, s/hpux10-20.h, s/unixware.h:
1482 Define GC_MARK_STACK to GC_USE_GCPROS_AS_BEFORE, since that's
1483 no longer the default.
1484 * s/gnu-linux.h (GC_MARK_STACK): Adjust to change in default.
1485
1486 2012-04-14 Atsuo Ohki <ohki@gssm.otsuka.tsukuba.ac.jp> (tiny change)
1487
1488 * lread.c (lisp_file_lexically_bound_p):
1489 Fix hang at ";-*-\n" (bug#11238).
1490
1491 2012-04-14 Eli Zaretskii <eliz@gnu.org>
1492
1493 * xdisp.c (find_last_unchanged_at_beg_row): Don't consider a row
1494 "unchanged" if its end.pos is beyond ZV. (Bug#11199)
1495
1496 2012-04-14 Jan Djärv <jan.h.d@swipnet.se>
1497
1498 * nsterm.m (constrainFrameRect): Always constrain when there is only
1499 one screen (Bug#10962).
1500
1501 2012-04-13 Ken Brown <kbrown@cornell.edu>
1502
1503 * s/cygwin.h (PTY_OPEN): Don't try to close a bogus file descriptor.
1504
1505 2012-04-13 Reuben Thomas <rrt@sc3d.org>
1506
1507 * indent.c (Fmove_to_column): Change interactive spec (Bug#739).
1508
1509 2012-04-11 Daniel Colascione <dancol@dancol.org>
1510
1511 * s/cygwin.h: The vfork the #define in cygwin.h was protecting
1512 against is gone. It's better to use vfork now so that when Cygwin
1513 gains a new, working vfork, we use it automatically (bug#10398).
1514
1515 2012-04-11 Stefan Monnier <monnier@iro.umontreal.ca>
1516
1517 * window.c (save_window_save): Obey window-point-insertion-type.
1518
1519 2012-04-11 Glenn Morris <rgm@gnu.org>
1520
1521 * Makefile.in (GNUSTEP_CFLAGS): Rename from C_SWITCH_X_SYSTEM.
1522
1523 2012-04-11 Stefan Monnier <monnier@iro.umontreal.ca>
1524
1525 * alloc.c (lisp_align_malloc): Remove unneeded prototype.
1526
1527 2012-04-10 Jason S. Cornez <jcornez@ravenpack.com> (tiny change)
1528
1529 * keyboard.c: Override inhibit-quit after the third C-g (bug#6585).
1530 (force_quit_count): New var.
1531 (handle_interrupt): Use it.
1532
1533 2012-04-10 Juanma Barranquero <lekktu@gmail.com>
1534
1535 * w32.c (w32_delayed_load): Record the full path of the library
1536 being loaded (bug#10424).
1537
1538 2012-04-09 Glenn Morris <rgm@gnu.org>
1539
1540 * doc.c (Fsnarf_documentation): Check variables, functions are bound,
1541 not just in the obarray, before snarfing them. (Bug#11036)
1542
1543 * Makefile.in ($(leimdir)/leim-list.el):
1544 Pass EMACS rather than BUILT_EMACS.
1545
1546 2012-04-09 Teodor Zlatanov <tzz@lifelogs.com>
1547
1548 * process.c (make_process):
1549 * process.h: Add integer `gnutls_handshakes_tried' member to
1550 process struct.
1551
1552 * gnutls.h: Add `GNUTLS_EMACS_HANDSHAKES_LIMIT' upper limit.
1553 Add convenience `GNUTLS_LOG2i' macro.
1554
1555 * gnutls.c (gnutls_log_function2i): Convenience log function.
1556 (emacs_gnutls_read): Use new log functions,
1557 `gnutls_handshakes_tried' process member, and
1558 `GNUTLS_EMACS_HANDSHAKES_LIMIT' to limit the number of handshake
1559 attempts per process (connection).
1560
1561 2012-04-09 Chong Yidong <cyd@gnu.org>
1562
1563 * eval.c (Fuser_variable_p, user_variable_p_eh)
1564 (lisp_indirect_variable): Functions deleted.
1565 (Fdefvar): Caller changed.
1566
1567 * callint.c (Finteractive, Fcall_interactively):
1568 * minibuf.c (Fread_variable): Callers changed.
1569
1570 2012-04-09 Eli Zaretskii <eliz@gnu.org>
1571
1572 * xdisp.c (set_cursor_from_row): If the display string appears in
1573 the buffer at position that is closer to point than the position
1574 after the display string, display the cursor on the first glyph of
1575 the display string. Fixes cursor display when a 'display' text
1576 property immediately follows invisible text. (Bug#11094)
1577
1578 2012-04-09 Paul Eggert <eggert@cs.ucla.edu>
1579
1580 composite.c: use 'double' consistently
1581 * composite.c (get_composition_id): Use 'double' consistently
1582 instead of converting 'float' to 'double' and vice versa; this is
1583 easier to understand and avoids a GCC warning.
1584
1585 2012-04-09 Glenn Morris <rgm@gnu.org>
1586
1587 * Makefile.in: Generate leim-list with bootstrap-emacs, in
1588 preparation for dumping it with emacs. (Bug#4789)
1589 (leimdir): New variable.
1590 ($(leimdir)/leim-list.el): New rule.
1591 (emacs$(EXEEXT)): Depend on leim-list.el.
1592
1593 * buffer.c (Qucs_set_table_for_input): Remove. (Bug#9821)
1594 (Fget_buffer_create): Don't call Qucs_set_table_for_input.
1595 (init_buffer_once, syms_of_buffer): Remove Qucs_set_table_for_input.
1596
1597 2012-04-08 Andreas Schwab <schwab@linux-m68k.org>
1598
1599 * lisp.h (struct Lisp_Symbol): Add explicit padding to ensure
1600 proper alignment.
1601
1602 2012-04-07 Juanma Barranquero <lekktu@gmail.com>
1603
1604 * xml.c (init_libxml2_functions) [WINDOWSNT]:
1605 Remove unused local variable.
1606
1607 2012-04-07 Paul Eggert <eggert@cs.ucla.edu>
1608
1609 Avoid unnecessary pointer scanning in garbage collection (Bug#10780).
1610 * alloc.c (POINTERS_MIGHT_HIDE_IN_OBJECTS): New macro.
1611 (mark_memory): Mark Lisp_Objects only if pointers might hide in
1612 objects, as mark_maybe_pointer will catch them otherwise.
1613 (GC_LISP_OBJECT_ALIGNMENT): Remove; no longer needed.
1614 * s/gnu-linux.h (GC_LISP_OBJECT_ALIGNMENT) [__mc68000__]: Likewise.
1615
1616 2012-04-07 Paul Eggert <eggert@cs.ucla.edu>
1617
1618 Fix typo that broke non-Windows builds.
1619 * xml.c (libxml2_loaded_p) [!!WINDOWSNT]: 'inine' -> 'inline'.
1620
1621 2012-04-07 Eli Zaretskii <eliz@gnu.org>
1622
1623 Support building on MS-Windows with libxml2.
1624
1625 * makefile.w32-in (OBJ2): Add xml.$(O).
1626 (GLOBAL_SOURCES): Add xml.c.
1627 ($(BLD)/xml.$(O)): New dependency list.
1628
1629 * xml.c (DEF_XML2_FN, LOAD_XML2_FN) [WINDOWSNT]: New macros.
1630 (fn_htmlReadMemory, fn_xmlReadMemory, fn_xmlDocGetRootElement)
1631 (fn_xmlFreeDoc, fn_xmlCleanupParser, fn_xmlCheckVersion)
1632 [!WINDOWSNT]: New macros.
1633 (init_libxml2_functions, libxml2_loaded_p): New functions.
1634 (parse_region): Call fn_xmlCheckVersion instead of using the macro
1635 LIBXML_TEST_VERSION. Call libxml2 functions via the fn_* macros.
1636 (xml_cleanup_parser): New function, export for fn_xmlCleanupParser.
1637 Calls xmlCleanupParser only if libxml2 was loaded (or statically
1638 linked in).
1639 (Flibxml_parse_html_region, Flibxml_parse_xml_region):
1640 Call init_libxml2_functions before calling libxml2 functions.
1641 (syms_of_xml) <Qlibxml2_dll>: DEFSYM it.
1642
1643 * emacs.c: Don't include libxml/parser.h.
1644 (shut_down_emacs): Call xml_cleanup_parser, instead of calling
1645 xmlCleanupParser directly.
1646
1647 * lisp.h [HAVE_LIBXML2]: Add prototype for xml_cleanup_parser.
1648
1649 2012-04-07 Eli Zaretskii <eliz@gnu.org>
1650
1651 * indent.c (Fvertical_motion): If there is a display string at
1652 point, use it.vpos to compute how many lines to backtrack after
1653 move_it_to point. (Bug#11133)
1654
1655 2012-04-06 Eli Zaretskii <eliz@gnu.org>
1656
1657 * buffer.h (FETCH_CHAR, FETCH_MULTIBYTE_CHAR):
1658 * character.h (STRING_CHAR, STRING_CHAR_AND_LENGTH): Add comments
1659 about subtle differences between FETCH_CHAR* and STRING_CHAR*
1660 macros related to unification of CJK characters. For the details,
1661 see the discussion following the message here:
1662 http://debbugs.gnu.org/cgi/bugreport.cgi?bug=11073#14.
1663
1664 2012-04-04 Chong Yidong <cyd@gnu.org>
1665
1666 * keyboard.c (Vdelayed_warnings_list): Doc fix.
1667
1668 2012-04-01 Eli Zaretskii <eliz@gnu.org>
1669
1670 * w32menu.c (simple_dialog_show, add_menu_item): Use SAFE_ALLOCA
1671 instead of alloca. (Bug#11138)
1672
1673 2012-04-01 Andreas Schwab <schwab@linux-m68k.org>
1674
1675 * w32menu.c (is_simple_dialog): Properly check lisp types.
1676 (Bug#11141)
1677
1678 2012-03-31 Eli Zaretskii <eliz@gnu.org>
1679
1680 * xdisp.c (move_it_by_lines): When DVPOS is positive, and the
1681 position we get to after a call to move_it_to fails the
1682 IS_POS_VALID_AFTER_MOVE_P test, move to the next buffer position
1683 only if we wind up in a string from display property. (Bug#11063)
1684
1685 * window.c (Fdelete_other_windows_internal): Invalidate the row
1686 and column information about mouse highlight, so that redisplay
1687 restores it after reallocating the glyph matrices. (Bug#7464)
1688
1689 * xdisp.c (set_cursor_from_row): If `cursor' property on a display
1690 string comes from a `display' text property, use the buffer
1691 position of that property as if we actually saw that position in
1692 the row's glyphs.
1693 (move_it_by_lines): Remove the assertion that
1694 "it->current_x == 0 && it->hpos == 0" which can be legitimately
1695 violated when there's a before-string at the beginning of a line.
1696 (Bug#11063)
1697
1698 2012-03-30 Eli Zaretskii <eliz@gnu.org>
1699
1700 * xdisp.c (append_space_for_newline): If the default face was
1701 remapped, use the remapped face for the appended newline.
1702 (extend_face_to_end_of_line): Use the remapped default face for
1703 extending the face to the end of the line.
1704 (display_line): Call extend_face_to_end_of_line when the default
1705 face was remapped. (Bug#11068)
1706
1707 2012-03-29 Eli Zaretskii <eliz@gnu.org>
1708
1709 * s/ms-w32.h: Discourage from defining HAVE_GETCWD.
1710
1711 2012-03-28 Stefan Monnier <monnier@iro.umontreal.ca>
1712
1713 * keyboard.c (safe_run_hooks_error): Don't unquote strings.
1714
1715 2012-03-27 Glenn Morris <rgm@gnu.org>
1716
1717 * search.c (Fword_search_backward_lax, Fword_search_forward_lax):
1718 Doc fixes.
1719
1720 2012-03-26 Kenichi Handa <handa@m17n.org>
1721
1722 * dispextern.h (struct glyph): Fix previous change. Change the
1723 bit length of glyphless.ch to 25 (Bug#11082).
1724
1725 2012-03-26 Chong Yidong <cyd@gnu.org>
1726
1727 * keyboard.c (Vselection_inhibit_update_commands): New variable.
1728 (command_loop_1): Use it; inhibit selection update for
1729 handle-select-window too (Bug#8996).
1730
1731 2012-03-25 Fabrice Popineau <fabrice.popineau@supelec.fr>
1732
1733 * w32heap.c (_heap_init, _heap_term): Remove dead MSVC-specific code.
1734
1735 2012-03-25 Kenichi Handa <handa@m17n.org>
1736
1737 * dispextern.h (struct glyph): Change the bit length of
1738 glyphless.ch to 22 to make the member glyphless fit in 32 bits.
1739
1740 2012-03-24 Eli Zaretskii <eliz@gnu.org>
1741
1742 * s/ms-w32.h (tzname): Include time.h before redirecting to
1743 _tzname. Fixes the MSVC build. (Bug#9960)
1744
1745 2012-03-24 Andreas Schwab <schwab@linux-m68k.org>
1746
1747 * xdisp.c (produce_glyphless_glyph): Limit length of acronym to 6
1748 characters.
1749
1750 * xterm.c (XTread_socket): Only modify handling_signal if
1751 !SYNC_INPUT. (Bug#11080)
1752
1753 2012-03-23 Eli Zaretskii <eliz@gnu.org>
1754
1755 * bidi.c (bidi_fetch_char): Use STRING_CHAR_AND_LENGTH instead of
1756 FETCH_MULTIBYTE_CHAR followed by CHAR_BYTES. Prevents crashes
1757 when fetching a multibyte character consumes more bytes than
1758 CHAR_BYTES returns, due to unification of CJK characters in
1759 string_char. (Bug#11073)
1760
1761 2012-03-23 Troels Nielsen <bn.troels@gmail.com> (tiny change)
1762
1763 * process.c (wait_reading_process_output): Handle pty disconnect
1764 by refraining from sending oneself a SIGCHLD (bug#10933).
1765
1766 2012-03-22 Chong Yidong <cyd@gnu.org>
1767
1768 * dispextern.h (struct it): New member string_from_prefix_prop_p.
1769
1770 * xdisp.c (push_prefix_prop): Rename from push_display_prop.
1771 Mark string as coming from a prefix property.
1772 (handle_face_prop): Use default face for prefix strings (Bug#4281).
1773 (pop_it, reseat_1): Save and restore string_from_prefix_prop_p.
1774
1775 2012-03-21 Chong Yidong <cyd@gnu.org>
1776
1777 * xfaces.c (Vface_remapping_alist): Doc fix.
1778
1779 2012-03-20 Eli Zaretskii <eliz@gnu.org>
1780
1781 * w32proc.c (Fw32_set_console_codepage)
1782 (Fw32_set_console_output_codepage, Fw32_get_codepage_charset):
1783 Doc fixes.
1784
1785 2012-03-20 Chong Yidong <cyd@gnu.org>
1786
1787 * dispnew.c (Fredisplay, Vredisplay_preemption_period): Update doc
1788 to reflect default non-nil value of redisplay-dont-pause.
1789
1790 2012-03-19 Kenichi Handa <handa@m17n.org>
1791
1792 * ftfont.c (ftfont_drive_otf): Mask bits of character code to make
1793 it fit in a valid range (Bug#11003).
1794
1795 2012-03-18 Eli Zaretskii <eliz@gnu.org>
1796
1797 * xdisp.c (cursor_row_p): Even if the glyph row ends in a string
1798 that is not from display property, accept the row as a "cursor
1799 row" if one of the string's character has a non-nil `cursor'
1800 property. Fixes cursor positioning when there are newlines in
1801 overlay strings, e.g. in icomplete.el. (Bug#11035)
1802
1803 2012-03-12 Paul Eggert <eggert@cs.ucla.edu>
1804
1805 * buffer.c (compare_overlays): Don't assume args differ (Bug#6830).
1806
1807 2012-03-12 Chong Yidong <cyd@gnu.org>
1808
1809 * eval.c (inhibit_lisp_code): Rename from
1810 inhibit_window_configuration_change_hook; move from window.c.
1811
1812 * xfns.c (unwind_create_frame_1, Fx_create_frame):
1813 * window.c (run_window_configuration_change_hook)
1814 (syms_of_window): Callers changed.
1815
1816 2012-03-11 Chong Yidong <cyd@gnu.org>
1817
1818 * keymap.c (Fkey_description): Doc fix (Bug#9700).
1819
1820 * editfns.c (Fconstrain_to_field): Doc fix (Bug#9452).
1821
1822 2012-03-10 Chong Yidong <cyd@gnu.org>
1823
1824 * frame.c (other_visible_frames): Don't assume the selected frame
1825 is visible (Bug#10955).
1826
1827 2012-03-09 Stefan Monnier <monnier@iro.umontreal.ca>
1828
1829 * buffer.c (compare_overlays): Avoid qsort's instability (bug#6830).
1830
1831 2012-03-08 Jan Djärv <jan.h.d@swipnet.se>
1832
1833 * gtkutil.c (x_wm_set_size_hint): Use one row in call to
1834 FRAME_TEXT_LINES_TO_PIXEL_HEIGHT so base_height is greater than
1835 zero (Bug#10954).
1836
1837 2012-03-03 Glenn Morris <rgm@gnu.org>
1838
1839 * alloc.c (Fgarbage_collect, misc-objects-consed): Doc fixes.
1840
1841 2012-03-02 Eli Zaretskii <eliz@gnu.org>
1842
1843 * xdisp.c (try_window_reusing_current_matrix): Don't move cursor
1844 position past the first glyph_row that ends at ZV. (Bug#10902)
1845 (redisplay_window, next_element_from_string): Fix typos in
1846 comments.
1847 (redisplay_window): Pass to move_it_vertically the margin in
1848 pixels, not in screen lines.
1849
1850 2012-03-02 Glenn Morris <rgm@gnu.org>
1851
1852 * buffer.c (buffer-list-update-hook): Doc fix.
1853
1854 2012-02-29 Eli Zaretskii <eliz@gnu.org>
1855
1856 * xdisp.c (get_overlay_strings_1): Under bidi redisplay, call
1857 push_it before setting up the iterator for the first overlay
1858 string, even if we have an empty string loaded.
1859 (next_overlay_string): If there's an empty string on the iterator
1860 stack, pop the stack. (Bug#10903)
1861
1862 2012-02-25 Paul Eggert <eggert@cs.ucla.edu>
1863
1864 Generalize fix for crash due to non-contiguous EMACS_INT (Bug#10780).
1865 Suggested by Stefan Monnier in
1866 <http://lists.gnu.org/archive/html/emacs-devel/2012-02/msg00692.html>.
1867 * alloc.c (widen_to_Lisp_Object): New static function.
1868 (mark_memory): Also mark Lisp_Objects by fetching pointer words
1869 and widening them to Lisp_Objects. This would work even if
1870 USE_LSB_TAG is defined and wide integers are used, which might
1871 happen in a future version of Emacs.
1872
1873 2012-02-25 Chong Yidong <cyd@gnu.org>
1874
1875 * fileio.c (Ffile_selinux_context, Fset_file_selinux_context):
1876 Doc fix.
1877
1878 * xselect.c (Fx_selection_exists_p): Doc fix.
1879 (x_clipboard_manager_save_all): Print an informative message
1880 before saving to clipboard manager.
1881
1882 2012-02-24 Chong Yidong <cyd@gnu.org>
1883
1884 * keyboard.c (process_special_events): Handle all X selection
1885 requests in kbd_buffer, not just the next one (Bug#8869).
1886
1887 2012-02-23 Chong Yidong <cyd@gnu.org>
1888
1889 * xfns.c (Fx_create_frame): Avoid window-configuration-change-hook
1890 call when setting menu-bar-lines and tool-bar-lines parameters.
1891 (unwind_create_frame_1): New helper function.
1892
1893 * window.c (inhibit_window_configuration_change_hook): New var.
1894 (run_window_configuration_change_hook): Obey it.
1895 (syms_of_window): Initialize it.
1896
1897 2012-02-22 Chong Yidong <cyd@gnu.org>
1898
1899 * xterm.c (x_draw_image_relief): Add missing type check for
1900 Vtool_bar_button_margin (Bug#10743).
1901
1902 2012-02-21 Chong Yidong <cyd@gnu.org>
1903
1904 * fileio.c (Vfile_name_handler_alist): Doc fix.
1905
1906 * buffer.c (Fget_file_buffer): Protect against invalid file
1907 handler return value.
1908
1909 2012-02-20 Paul Eggert <eggert@cs.ucla.edu>
1910
1911 * .gdbinit (xreload): Don't assume EMACS_INT fits in 'long'
1912 when computing $valmask.
1913
1914 Fix crash due to non-contiguous EMACS_INT (Bug#10780).
1915 * lisp.h (VALBITS): Move definition up, so that USE_LSB_TAG can use it.
1916 (USE_LSB_TAG): Do not define if UINTPTR_MAX >> VALBITS == 0.
1917 It's useless in that case, and it can cause problems on hosts
1918 that allocate halves of EMACS_INT values separately.
1919 Reported by Dan Horák. Diagnosed by Andreas Schwab in
1920 <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=10780#30>.
1921 * mem-limits.h (EXCEEDS_LISP_PTR): Define to 0 on hosts where
1922 UINTPTR_MAX >> VALBITS == 0. This is required by the above change;
1923 it avoids undefined behavior on hosts where shifting right by more
1924 than the word width has undefined behavior.
1925
1926 2012-02-19 Chong Yidong <cyd@gnu.org>
1927
1928 * fileio.c (Ffile_name_directory, Ffile_name_nondirectory)
1929 (Funhandled_file_name_directory, Ffile_name_as_directory)
1930 (Fdirectory_file_name, Fexpand_file_name)
1931 (Fsubstitute_in_file_name): Protect against invalid file handler
1932 return values (Bug#10845).
1933
1934 2012-02-18 Eli Zaretskii <eliz@gnu.org>
1935
1936 * .gdbinit (pitx): Fix incorrect references to fields of the
1937 iterator stack.
1938
1939 2012-02-17 Chong Yidong <cyd@gnu.org>
1940
1941 * syntax.c (Fscan_lists): Doc fix (Bug#10833).
1942
1943 2012-02-15 Paul Eggert <eggert@cs.ucla.edu>
1944
1945 * image.c (MAX_IMAGE_SIZE): Increase from 6.0 to 10.0; see
1946 <http://lists.gnu.org/archive/html/emacs-devel/2012-02/msg00540.html>.
1947
1948 2012-02-15 Chong Yidong <cyd@gnu.org>
1949
1950 * eval.c (Fdefvar, Fdefconst): Doc fix; note that the variable is
1951 marked as special. Also, starting docstrings with * is obsolete.
1952
1953 2012-02-13 Andreas Schwab <schwab@linux-m68k.org>
1954
1955 * gnutls.c (emacs_gnutls_write): Fix last change.
1956
1957 2012-02-13 Lars Ingebrigtsen <larsi@gnus.org>
1958
1959 * gnutls.c (emacs_gnutls_write): Set errno appropriately for
1960 send_process.
1961
1962 2012-02-13 Stefan Monnier <monnier@iro.umontreal.ca>
1963
1964 * keymap.c (Fsingle_key_description): Handle char ranges.
1965
1966 2012-02-12 Chong Yidong <cyd@gnu.org>
1967
1968 * xdisp.c (handle_stop): Avoid assigning -1 to it->face_id here,
1969 as that creates a dangerous corner case.
1970
1971 * window.c (Fdelete_window_internal): Invalidate the mouse
1972 highlight (Bug#9904).
1973
1974 2012-02-12 Glenn Morris <rgm@gnu.org>
1975
1976 * xselect.c (Fx_own_selection_internal)
1977 (Fx_get_selection_internal, Fx_disown_selection_internal)
1978 (Fx_selection_owner_p, Fx_selection_exists_p): Doc fixes.
1979 * nsselect.m (Fx_own_selection_internal)
1980 (Fx_disown_selection_internal, Fx_selection_exists_p)
1981 (Fx_selection_owner_p, Fx_get_selection_internal):
1982 Sync docs and argument specs with the xselect.c versions.
1983
1984 2012-02-11 Lars Ingebrigtsen <larsi@gnus.org>
1985
1986 * gnutls.c (emacs_gnutls_write): Don't infloop if sendto fails.
1987
1988 2012-02-11 Eli Zaretskii <eliz@gnu.org>
1989
1990 * w32select.c (Fx_selection_exists_p): Sync doc string and
1991 argument list with xselect.c. (Bug#10783)
1992
1993 * w16select.c (Fx_selection_exists_p): Sync doc string and
1994 argument list with xselect.c. (Bug#10783)
1995
1996 2012-02-10 Glenn Morris <rgm@gnu.org>
1997
1998 * fns.c (Fsecure_hash): Doc fix.
1999
2000 2012-02-09 Kenichi Handa <handa@m17n.org>
2001
2002 * coding.c (produce_chars): Fix updating of src_end (Bug#10701).
2003
2004 2012-02-07 Chong Yidong <cyd@gnu.org>
2005
2006 * buffer.c (Fbuffer_local_variables)
2007 (buffer_lisp_local_variables): Handle unbound vars correctly;
2008 don't let Qunbound leak into Lisp.
2009
2010 2012-02-07 Glenn Morris <rgm@gnu.org>
2011
2012 * image.c (Fimagemagick_types): Doc fix.
2013
2014 * image.c (imagemagick-render-type): Change it from a lisp object
2015 to an integer. Move the doc here from the lisp manual.
2016 Treat all values not equal to 0 the same.
2017
2018 2012-02-06 Chong Yidong <cyd@gnu.org>
2019
2020 * doc.c (store_function_docstring): Avoid applying docstring of
2021 alias to base function (Bug#2603).
2022
2023 2012-02-04 Andreas Schwab <schwab@linux-m68k.org>
2024
2025 * .gdbinit (pp1, pv1): Remove redundant defines.
2026 (pr): Use pp.
2027
2028 2012-02-04 Chong Yidong <cyd@gnu.org>
2029
2030 * nsterm.m: Declare a global (Bug#10694).
2031
2032 2012-02-04 Eli Zaretskii <eliz@gnu.org>
2033
2034 * w32.c (get_emacs_configuration_options):
2035 Include --enable-checking, if specified, in the return value.
2036
2037 2012-02-04 Martin Rudalics <rudalics@gmx.at>
2038
2039 * dispnew.c (change_frame_size_1): Calculate new_frame_total_cols
2040 after rounding frame sizes. (Bug#9723)
2041
2042 2012-02-04 Eli Zaretskii <eliz@gnu.org>
2043
2044 * keyboard.c (adjust_point_for_property): Don't position point
2045 before BEGV. (Bug#10696)
2046
2047 2012-02-03 Paul Eggert <eggert@cs.ucla.edu>
2048
2049 Handle overflow when computing char display width (Bug#9496).
2050 * character.c (char_width): Return EMACS_INT, not int.
2051 (char_width, c_string_width): Check for overflow when
2052 computing the width; this is possible now that individual
2053 characters can have unbounded width. Problem introduced
2054 by merge from Emacs 23 on 2012-01-19.
2055
2056 2012-02-02 Michael Albinus <michael.albinus@gmx.de>
2057
2058 * dbusbind.c (Fdbus_register_method): Mention the return value
2059 :ignore in the docstring.
2060
2061 2012-02-02 Glenn Morris <rgm@gnu.org>
2062
2063 * callproc.c (Fcall_process, Fcall_process_region): Doc fix.
2064
2065 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
2066 Unconditionally set to t. (Bug#10673)
2067 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
2068 * w32term.c (syms_of_w32term) <x-toolkit-scroll-bars>:
2069 * xterm.c (syms_of_xterm) <x-toolkit-scroll-bars>: Doc fix.
2070
2071 2012-02-02 Kenichi Handa <handa@m17n.org>
2072
2073 (x_produce_glyphs): Cancel previous change. If cmp->glyph_len is
2074 0, do not call append_composite_glyph.
2075
2076 2012-02-02 Kenichi Handa <handa@m17n.org>
2077
2078 * xdisp.c (BUILD_COMPOSITE_GLYPH_STRING): Initialize first_s to
2079 NULL (Bug#6988).
2080 (x_produce_glyphs): If the component of a composition is a null
2081 string, set it->pixel_width to 1 to avoid zero-width glyph.
2082
2083 2012-02-01 Eli Zaretskii <eliz@gnu.org>
2084
2085 * ralloc.c (resize_bloc, r_alloc_sbrk): Don't call memmove if its
2086 first 2 arguments are identical. This makes inserting large
2087 output from a subprocess an order of magnitude faster on
2088 MS-Windows, where all sbrk'ed memory is always contiguous.
2089
2090 2012-01-31 Glenn Morris <rgm@gnu.org>
2091
2092 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
2093 * w32term.c (syms_of_w32term) <x-toolkit-scroll-bars>:
2094 * xterm.c (syms_of_xterm) <x-toolkit-scroll-bars>: Sync docs.
2095
2096 2012-01-29 Glenn Morris <rgm@gnu.org>
2097
2098 * gnutls.c (syms_of_gnutls): More doc (from etc/NEWS).
2099
2100 2012-01-28 Samuel Thibault <sthibault@debian.org> (tiny change)
2101
2102 * s/gnu.h: Define POSIX_SIGNALS (Bug#10552).
2103
2104 2012-01-28 Chong Yidong <cyd@gnu.org>
2105
2106 * minibuf.c (syms_of_minibuf): Doc fix (Bug#10550).
2107
2108 2012-01-26 Chong Yidong <cyd@gnu.org>
2109
2110 * keyboard.c (Vecho_keystrokes): Document zero value (Bug#10503).
2111
2112 * search.c (Fsearch_forward, Fsearch_backward): Document negative
2113 repeat counts (Bug#10507).
2114
2115 2012-01-26 Glenn Morris <rgm@gnu.org>
2116
2117 * lread.c (syms_of_lread): Doc fix.
2118
2119 2012-01-25 HIROSHI OOTA <nil@mad.dog.cx> (tiny change)
2120
2121 * coding.c (encode_designation_at_bol): Change return value to
2122 EMACS_INT.
2123
2124 2012-01-25 Chong Yidong <cyd@gnu.org>
2125
2126 * eval.c (Fuser_variable_p): Doc fix; mention custom-variable-p.
2127
2128 2012-01-21 Chong Yidong <cyd@gnu.org>
2129
2130 * floatfns.c (Fcopysign): Make the second argument non-optional,
2131 since nil is not allowed anyway.
2132
2133 2012-01-21 Andreas Schwab <schwab@linux-m68k.org>
2134
2135 * process.c (read_process_output): Use p instead of XPROCESS (proc).
2136 (send_process): Likewise.
2137
2138 2012-01-19 Martin Rudalics <rudalics@gmx.at>
2139
2140 * window.c (save_window_save, Fcurrent_window_configuration)
2141 (Vwindow_persistent_parameters): Do not use Qstate.
2142 Rewrite doc-strings.
2143
2144 2012-01-19 Kenichi Handa <handa@m17n.org>
2145
2146 * character.c (char_width): New function.
2147 (Fchar_width, c_string_width, lisp_string_width):
2148 Use char_width (Bug#9496).
2149
2150 2012-01-16 Martin Rudalics <rudalics@gmx.at>
2151
2152 * window.c (Vwindow_persistent_parameters): New variable.
2153 (Fset_window_configuration, save_window_save): Handle persistent
2154 window parameters.
2155
2156 2012-01-14 Eli Zaretskii <eliz@gnu.org>
2157
2158 * w32fns.c (signal_user_input): Don't do a QUIT, to avoid
2159 thrashing the stack of the thread. (Bug#9087)
2160
2161 2012-01-12 Paul Eggert <eggert@cs.ucla.edu>
2162
2163 * xdisp.c (rows_from_pos_range): Add parens as per gcc -Wparentheses.
2164
2165 2012-01-11 Eli Zaretskii <eliz@gnu.org>
2166
2167 * xdisp.c (rows_from_pos_range): Handle the case where the
2168 highlight ends on a newline. (Bug#10464)
2169 (mouse_face_from_buffer_pos): Fix off-by-one error in calculating
2170 he end column for display of highlight that ends on a newline
2171 before a R2L line.
2172
2173 2012-01-11 Glenn Morris <rgm@gnu.org>
2174
2175 * lread.c (init_lread): If no-site-lisp, remove site-lisp dirs
2176 from load-path also when installation-directory is nil. (Bug#10208)
2177
2178 2012-01-10 Glenn Morris <rgm@gnu.org>
2179
2180 * emacs.c (syms_of_emacs) <installation-directory>: Doc fix.
2181
2182 * epaths.in (PATH_LOADSEARCH, PATH_EXEC, PATH_DATA, PATH_DOC):
2183 Update template values to be closer to their typical values these days.
2184
2185 2012-01-09 Eli Zaretskii <eliz@gnu.org>
2186
2187 * xdisp.c (rows_from_pos_range): Accept additional argument
2188 DISP_STRING, and accept any glyph in a row whose object is that
2189 string as eligible for mouse highlight. Fixes mouse highlight of
2190 display strings from overlays. (Bug#10464)
2191
2192 2012-01-07 Paul Eggert <eggert@cs.ucla.edu>
2193
2194 emacs: fix an auto-save permissions race condition (Bug#10400)
2195 * fileio.c (auto_saving_dir_umask): New static var.
2196 (Fmake_directory_internal): Use it.
2197 (do_auto_save_make_dir): Set it, instead of invoking chmod after
2198 creating the directory. The old code temporarily assigns
2199 too-generous permissions to the directory.
2200 (do_auto_save_eh): Clear it.
2201 (Fdo_auto_save): Catch all errors, not just file errors, so
2202 that the var is always cleared.
2203
2204 2012-01-07 Eli Zaretskii <eliz@gnu.org>
2205
2206 * search.c (scan_buffer): Pass character positions to
2207 know_region_cache, not byte positions. (Bug#6540)
2208
2209 2012-01-07 LynX <_LynX@bk.ru> (tiny change)
2210
2211 * w32.c (sys_rename): Report EXDEV when rename of a directory
2212 fails because the target is on another logical disk. (Bug#10284)
2213
2214 2012-01-07 David Benjamin <davidben@mit.edu> (tiny change)
2215
2216 * xterm.c (x_embed_request_focus): New function.
2217
2218 * xterm.h: Add prototype.
2219
2220 * xfns.c (Fx_focus_frame): Use it for embedded frames (Bug#9977).
2221
2222 2012-01-05 Glenn Morris <rgm@gnu.org>
2223
2224 * emacs.c (emacs_copyright): Update short copyright year to 2012.
2225
2226 2012-01-01 Eli Zaretskii <eliz@gnu.org>
2227
2228 * gnutls.c (init_gnutls_functions): Load gnutls_check_version.
2229 Load gnutls_transport_set_lowat only if GnuTLS version is below
2230 2.11.1.
2231 (emacs_gnutls_handshake): Call gnutls_transport_set_lowat only for
2232 GnuTLS versions below 2.11.1.
2233
2234 2011-12-31 Antoine Levitt <antoine.levitt@gmail.com>
2235
2236 * xdisp.c (syms_of_xdisp) <window-scroll-functions>: Add warning
2237 to the doc string advising against its use for altering the way
2238 windows are scrolled.
2239
2240 2011-12-28 Kenichi Handa <handa@m17n.org>
2241
2242 * coding.c (Fdefine_coding_system_internal): Make an utf-8 base
2243 coding-system ASCII compatible only when it does not produce BOM
2244 on encoding (Bug#10383).
2245
2246 2011-12-26 Jan Djärv <jan.h.d@swipnet.se>
2247
2248 * xmenu.c (x_menu_wait_for_event): Use xg_select for Gtk3 so menus
2249 can scroll.
2250 (create_and_show_popup_menu): Always use menu_position_func for
2251 Gtk3 (Bug#10361).
2252
2253 2011-12-24 Andreas Schwab <schwab@linux-m68k.org>
2254
2255 * callint.c (Fcall_interactively): Don't truncate prompt string.
2256
2257 2011-12-23 Eli Zaretskii <eliz@gnu.org>
2258
2259 * xdisp.c (handle_invisible_prop): Handle correctly an invisible
2260 property that ends at ZV, so that the bidi iteration could be
2261 resumed from there (after widening). (Bug#10360)
2262
2263 2011-12-22 Jan Djärv <jan.h.d@swipnet.se>
2264
2265 * nsfont.m (ns_spec_to_descriptor): Do not autorelease fdesc.
2266
2267 2011-12-21 Jan Djärv <jan.h.d@swipnet.se>
2268
2269 * nsterm.m (x_free_frame_resources):
2270 Release f->output_data.ns->miniimage.
2271 (ns_index_color): Fix indentation. Do not retain
2272 color_table->colors[i].
2273
2274 * nsmenu.m (ns_update_menubar): Call free_menubar_widget_value_tree
2275 before returning.
2276
2277 * nsfns.m (x_set_background_color): Assign return value from
2278 ns_index_color to face-background instead of NSColor*.
2279 (ns_implicitly_set_icon_type): Fix indentation.
2280 Change assignment in for loop to comparison.
2281
2282 * emacs.c (ns_pool): New variable.
2283 (main): Assign ns_pool.
2284 (Fkill_emacs): Call ns_release_autorelease_pool.
2285
2286 * nsfont.m (ns_spec_to_descriptor): Fix indentation,
2287 autorelease fdesc, release fdAttrs and tdict.
2288 (ns_get_covering_families): Release charset.
2289 (ns_findfonts): Release NSFontDescriptor created with new.
2290 (ns_uni_to_glyphs): Fix indentation.
2291 (setString): Release attrStr before assigning new value.
2292
2293 2011-12-18 Jan Djärv <jan.h.d@swipnet.se>
2294
2295 * nsmenu.m (NSMenuDidBeginTrackingNotification): Declare if OSX < 10.5
2296 and NS_IMPL_COCOA.
2297 (trackingNotification): Surround with ifdef NS_IMPL_COCOA.
2298 (syms_of_nsmenu): Set trackingMenu to 1 if not NS_IMPL_COCOA.
2299
2300 2011-12-18 David Reitter <reitter@cmu.edu>
2301
2302 * nsterm.m (ns_term_init): Subscribe for notifications
2303 NSMenuDidBeginTrackingNotification and NSMenuDidEndTrackingNotification
2304 to method trackingNotification in EmacsMenu.
2305
2306 * nsmenu.m (trackingMenu): New variable.
2307 (trackingNotification): New method (from Aquamacs).
2308 (menuNeedsUpdate): Expand comment and return if trackingMenu is 0,
2309 from Aquamacs (Bug#7030).
2310
2311 2011-12-18 Jan Djärv <jan.h.d@swipnet.se>
2312
2313 * nsselect.m (CUT_BUFFER_SUPPORT): Remove define.
2314 (symbol_to_nsstring): Fix indentation.
2315 (ns_symbol_to_pb): New function.
2316 (Fns_get_selection_internal): Rename from Fns_get_cut_buffer_internal.
2317 (Fns_rotate_cut_buffers_internal): Remove.
2318 (Fns_store_selection_internal): Rename from
2319 Fns_store_cut_buffer_internal.
2320 (ns_get_foreign_selection, Fx_own_selection_internal)
2321 (Fx_disown_selection_internal, Fx_selection_exists_p)
2322 (Fns_get_selection_internal, Fns_store_selection_internal):
2323 Use ns_symbol_to_pb and check if return value is nil.
2324 (syms_of_nsselect): Remove ifdef CUT_BUFFER_SUPPORT. Remove defsubr
2325 Sns_rotate_cut_buffers_internal. Sns_get_cut_buffer_internal
2326 renamed to Sns_get_selection_internal, Sns_store_cut_buffer_internal
2327 renamed to Sns_store_selection_internal.
2328 (ns_handle_selection_request): Move code to Fx_own_selection_internal
2329 and remove this function.
2330 (ns_handle_selection_clear): Remove, never used.
2331 (Fx_own_selection_internal): Move code from ns_handle_selection_request
2332 here.
2333
2334 2011-12-17 Ken Brown <kbrown@cornell.edu>
2335
2336 * fileio.c (check_writable) [CYGWIN]: Return non-zero if UID or
2337 GID is unknown (Bug#10257).
2338
2339 2011-12-17 Paul Eggert <eggert@cs.ucla.edu>
2340
2341 * s/gnu-linux.h: Fix mark_memory typo (Bug#10286).
2342 (GC_MARK_SECONDARY_STACK): Omit removed 3rd arg to mark_memory,
2343 which caused a build failure on GNU/Linux IA-64. This problem was
2344 introduced by my 2011-10-07 patch.
2345
2346 2011-12-15 Juri Linkov <juri@jurta.org>
2347
2348 * image.c (imagemagick_error): New function. (Bug#10112)
2349 (imagemagick_load_image): Comment out `MagickSetResolution' call.
2350 Use `imagemagick_error' where ImageMagick functions return
2351 `MagickFalse'.
2352 (Fimagemagick_types): Add `Fnreverse' to return the list in the
2353 proper order.
2354
2355 2011-12-15 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
2356
2357 * xftfont.c (xftfont_draw): Use the font metrics of s->font to
2358 fill background (Bug#8992).
2359
2360 2011-12-13 Martin Rudalics <rudalics@gmx.at>
2361
2362 * window.c (Vwindow_combination_resize)
2363 (Vwindow_combination_limit): Use t instead of non-nil in
2364 doc-strings.
2365 (Vrecenter_redisplay): Add first sentence of doc-string on
2366 separate line.
2367 (Frecenter): Fix doc-string typo.
2368
2369 2011-12-11 Kenichi Handa <handa@m17n.org>
2370
2371 * coding.c (Funencodable_char_position): Pay attention to the
2372 buffer text relocation (Bug#9389).
2373
2374 2011-12-10 Jan Djärv <jan.h.d@swipnet.se>
2375
2376 * xterm.c (x_term_init): Move call to gdk_window_add_filter before
2377 gtk_init (Bug#10100).
2378
2379 2011-12-10 Eli Zaretskii <eliz@gnu.org>
2380
2381 * xdisp.c (RECORD_MAX_MIN_POS): Use IT->cmp_it.charpos only if
2382 IT->string is nil. (Bug#10263)
2383
2384 2011-12-10 Jan Djärv <jan.h.d@swipnet.se>
2385
2386 * nsterm.h (x_free_frame_resources): Declare.
2387
2388 * nsfns.m (ns_get_defaults_value): New function (Bug#10103).
2389 (Fns_get_resource, x_get_string_resource): Call ns_get_defaults_value.
2390
2391 * nsterm.h (ns_get_defaults_value): Declare.
2392
2393 * nsterm.m (ns_default): Call ns_get_defaults_value.
2394
2395 2011-12-09 Eli Zaretskii <eliz@gnu.org>
2396
2397 * xdisp.c (try_scrolling): Don't set scroll_down_p if dy is zero.
2398 (Bug#10170)
2399
2400 2011-12-09 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
2401
2402 * unexelf.c (unexec) [NS_IMPL_GNUSTEP]: Take account of the case
2403 that where the value of an _OBJC_* symbol points to is in the .bss
2404 section (Bug#10240).
2405
2406 2011-12-08 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
2407
2408 * coding.c (encode_coding_ccl): Check (charbuf < charbuf_end)
2409 after the loop to call ccl_driver at least once (Bug#8619).
2410
2411 2011-12-08 Kenichi Handa <handa@m17n.org>
2412
2413 * ftfont.c (get_adstyle_property): Fix previous change
2414 (Bug#10233).
2415
2416 2011-12-07 Juanma Barranquero <lekktu@gmail.com>
2417
2418 * w32.c (init_environment): If no_site_lisp, remove site-lisp
2419 dirs from the default value of EMACSLOADPATH (bug#10208).
2420
2421 2011-12-07 Glenn Morris <rgm@gnu.org>
2422
2423 * lread.c (init_lread): If no_site_lisp, exclude site-lisp/ in
2424 installation and source directories as well. (Bug#10208)
2425
2426 2011-12-06 Chong Yidong <cyd@gnu.org>
2427
2428 * minibuf.c (Fread_from_minibuffer): Doc fix (Bug#10228).
2429
2430 2011-12-06 Glenn Morris <rgm@gnu.org>
2431
2432 * process.c (start_process_unwind): Treat any pid <= 0, except -2,
2433 as an error, not just -1. (Bug#10217)
2434
2435 2011-12-05 Chong Yidong <cyd@gnu.org>
2436
2437 * keyboard.c (process_special_events): New function.
2438 (swallow_events, Finput_pending_p): Use it (Bug#10195).
2439
2440 2011-12-05 Paul Eggert <eggert@cs.ucla.edu>
2441
2442 * coding.c (encode_designation_at_bol): Don't use uninitialized
2443 local variable (Bug#9318).
2444
2445 2011-12-05 Kenichi Handa <handa@m17n.org>
2446
2447 * ftfont.c (get_adstyle_property): If the font is not BDF nor PCF,
2448 return Qnil (Bug#8046, Bug#10193).
2449
2450 2011-12-05 Kenichi Handa <handa@m17n.org>
2451
2452 * coding.c (encode_designation_at_bol): New args charbuf_end and
2453 dst. Return the number of produced bytes. Callers changed.
2454 (coding_set_source): Return how many bytes coding->source was
2455 relocated.
2456 (coding_set_destination): Return how many bytes
2457 coding->destination was relocated.
2458 (CODING_DECODE_CHAR, CODING_ENCODE_CHAR, CODING_CHAR_CHARSET)
2459 (CODING_CHAR_CHARSET_P): Adjust for the avove changes.
2460
2461 2011-12-05 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
2462
2463 * coding.c (CODING_CHAR_CHARSET_P): New macro.
2464 (encode_coding_emacs_mule, encode_coding_iso_2022): Use the above
2465 macro (Bug#9318).
2466
2467 2011-12-05 Andreas Schwab <schwab@linux-m68k.org>
2468
2469 The following changes are to fix Bug#9318.
2470
2471 * coding.c (CODING_ENCODE_CHAR, CODING_CHAR_CHARSET): New macros.
2472 (encode_coding_emacs_mule, ENCODE_ISO_CHARACTER)
2473 (encode_coding_iso_2022, encode_coding_sjis)
2474 (encode_coding_big5, encode_coding_charset): Use the above macros.
2475
2476 2011-12-05 Juanma Barranquero <lekktu@gmail.com>
2477
2478 * lisp.h (process_quit_flag): Fix external declaration.
2479
2480 2011-12-04 Stefan Monnier <monnier@iro.umontreal.ca>
2481
2482 Don't macro-inline non-performance-critical code.
2483 * eval.c (process_quit_flag): New function.
2484 * lisp.h (QUIT): Use it.
2485
2486 2011-12-04 Jan Djärv <jan.h.d@swipnet.se>
2487
2488 * nsfns.m (get_geometry_from_preferences): New function.
2489 (Fx_create_frame): Call get_geometry_from_preferences (Bug#10103).
2490
2491 2011-12-04 Andreas Schwab <schwab@linux-m68k.org>
2492
2493 * emacs.c (Qkill_emacs): Define.
2494 (syms_of_emacs): Initialize it.
2495 * keyboard.c (interrupt_signal): Don't call Fkill_emacs here, set
2496 Qquit_flag to `kill-emacs' instead.
2497 (quit_throw_to_read_char): Add parameter `from_signal'.
2498 All callers changed. Call Fkill_emacs if requested and safe.
2499 * lisp.h (QUIT): Call Fkill_emacs if requested.
2500
2501 2011-12-03 Jan Djärv <jan.h.d@swipnet.se>
2502
2503 * widget.c (update_wm_hints): Return if wmshell is null.
2504 (widget_update_wm_size_hints): New function.
2505
2506 * widget.h (widget_update_wm_size_hints): Declare.
2507
2508 * xterm.c (x_wm_set_size_hint): If USE_X_TOOLKIT, call
2509 widget_update_wm_size_hints (Bug#10104).
2510
2511 2011-12-03 Eli Zaretskii <eliz@gnu.org>
2512
2513 * xdisp.c (handle_invisible_prop): If the invisible text ends just
2514 before a newline, prepare the bidi iterator for consuming the
2515 newline, and keep the current paragraph direction. (Bug#10183)
2516 (redisplay_window): Don't let `margin' become negative. (Bug#10192)
2517
2518 2011-12-02 Juri Linkov <juri@jurta.org>
2519
2520 * search.c (Fword_search_regexp): New Lisp function created from
2521 `wordify'. Change type of arg `lax' from `int' to `Lisp_Object'.
2522 (Fword_search_backward, Fword_search_forward)
2523 (Fword_search_backward_lax, Fword_search_forward_lax):
2524 Use `Fword_search_regexp' instead of `wordify'. Doc fix.
2525 (syms_of_search): Define `Sword_search_regexp'. (Bug#10145)
2526
2527 2011-12-01 Stefan Monnier <monnier@iro.umontreal.ca>
2528
2529 * fileio.c (Finsert_file_contents): Move after-change-function call
2530 to before the "handled:" label, since all "goto handled" appear in
2531 cases where the *-change-functions have already been properly called
2532 (bug#10117).
2533
2534 2011-12-01 Andreas Schwab <schwab@linux-m68k.org>
2535
2536 * keyboard.c (interrupt_signal): Don't call kill-emacs when
2537 waiting for input. (Bug#10169)
2538
2539 2011-11-30 Eli Zaretskii <eliz@gnu.org>
2540
2541 * dispnew.c (adjust_glyph_matrix): Remove the assertion that
2542 verifies glyph row's hash code--we have just reallocated the
2543 glyphs, so their contents can be complete garbage. (Bug#10164)
2544
2545 2011-11-30 Juanma Barranquero <lekktu@gmail.com>
2546
2547 * dispnew.c (adjust_glyph_matrix) [XASSERTS]: Add missing check.
2548
2549 2011-11-30 Eli Zaretskii <eliz@gnu.org>
2550
2551 * dispnew.c (adjust_glyph_matrix) [XASSERTS]: Ensure ROW's
2552 attributes are tested _before_ calling verify_row_hash, to protect
2553 against GCC re-ordering of the tests. (Bug#10164)
2554
2555 2011-11-29 Jan Djärv <jan.h.d@swipnet.se>
2556
2557 * xterm.h (struct x_output): net_wm_state_hidden_seen is new.
2558
2559 * xterm.c (handle_one_xevent): Only set async_visible and friends
2560 if net_wm_state_hidden_seen is non-zero (Bug#10002)
2561 (get_current_wm_state): Set net_wm_state_hidden_seen to 1 if
2562 _NET_WM_STATE_HIDDEN is in NET_WM_STATE.
2563
2564 2011-11-28 Paul Eggert <eggert@cs.ucla.edu>
2565
2566 Remove GCPRO-related macros that exist only to avoid shadowing locals.
2567 * lisp.h (GCPRO1_VAR, GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR, GCPRO5_VAR)
2568 (GCPRO6_VAR, UNGCPRO_VAR): Remove. See
2569 <http://lists.gnu.org/archive/html/emacs-diffs/2011-11/msg00265.html>.
2570 All uses changed to use GCPRO1 etc.
2571 (GCPRO1, GCPRO2, GCPRO3, GCPRO4, GCPRO5, GCPRO6, UNGCPRO):
2572 Revert to old implementation (i.e., before 2011-03-11).
2573
2574 2011-11-28 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
2575
2576 * dispnew.c (scrolling_window): Truncate overlaps in copy destination
2577 of scroll runs so as to avoid assigning disabled bogus rows and
2578 unnecessary graphics copy operations.
2579
2580 2011-11-27 Eli Zaretskii <eliz@gnu.org>
2581
2582 * s/ms-w32.h (utimbuf) [_MSC_VER]: Don't define.
2583 (snprintf) [_MSC_VER]: Redirect to _snprintf.
2584 (strtoll) [_MSC_VER]: Redirect to _strtoi64.
2585 (malloc, free, realloc, calloc): Redirect to e_* only when
2586 compiling Emacs.
2587
2588 * lisp.h (GCTYPEBITS): Move before first use.
2589 (ALIGN_GCTYPEBITS) [_MSC_VER]: Define.
2590 (DECL_ALIGN) [_MSC_VER]: Use it, as MSVC doesn't like bit ops in
2591 this macro definition.
2592
2593 * s/ms-w32.h (tzname): Redirect to _tzname for all values of
2594 _MSC_VER.
2595
2596 2011-11-27 Jan Djärv <jan.h.d@swipnet.se>
2597
2598 * gtkutil.c (xg_create_frame_widgets):
2599 Call gtk_window_set_has_resize_grip (FALSE) if that function is
2600 present with Gtk+ 2.0.
2601
2602 2011-11-26 Paul Eggert <eggert@cs.ucla.edu>
2603
2604 * fileio.c (Finsert_file_contents): Undo previous change; see
2605 <http://lists.gnu.org/archive/html/emacs-diffs/2011-11/msg00265.html>.
2606
2607 2011-11-26 Paul Eggert <eggert@cs.ucla.edu>
2608
2609 Rename locals to avoid shadowing.
2610 * fileio.c (Finsert_file_contents):
2611 Rename inner 'gcpro1' to 'inner_gcpro1' to avoid shadowing.
2612 * process.c (wait_reading_process_output):
2613 Rename inner 'proc' to 'p' to avoid shadowing.
2614 Indent for consistency with usual Emacs style.
2615
2616 2011-11-25 Eli Zaretskii <eliz@gnu.org>
2617
2618 * xdisp.c (redisplay_window): If cursor row is not fully visible
2619 after recentering, and scroll-conservatively is set to a large
2620 number, scroll window by a few more lines to make the cursor fully
2621 visible and out of scroll-margin. (Bug#10105)
2622 (start_display): Don't move to the next line if the display should
2623 start at a newline that is part of a display vector or an overlay
2624 string. (Bug#10119)
2625
2626 2011-11-24 Juri Linkov <juri@jurta.org>
2627
2628 * image.c (imagemagick_load_image): Move `MagickSetResolution' down
2629 after the `MagickPingImage' call. (Bug#10112)
2630
2631 2011-11-23 Chong Yidong <cyd@gnu.org>
2632
2633 * window.c (Fcoordinates_in_window_p): Accept only live windows.
2634
2635 2011-11-23 Martin Rudalics <rudalics@gmx.at>
2636
2637 * buffer.c (Fkill_buffer): Run replace_buffer_in_windows before
2638 making another buffer current. (Bug#10114)
2639
2640 2011-11-23 Glenn Morris <rgm@gnu.org>
2641
2642 * font.c (font_find_for_lface) [HAVE_NS]: Ignore case. (Bug#2526)
2643
2644 2011-11-23 Chong Yidong <cyd@gnu.org>
2645
2646 * xdisp.c (compute_stop_pos): Check validity of end_charpos before
2647 using it (Bug#5984).
2648
2649 2011-11-22 Eli Zaretskii <eliz@gnu.org>
2650
2651 * dispnew.c (adjust_glyph_matrix): Don't verify hash code of mode-
2652 and header-lines, as they don't have one computed for them.
2653 (Bug#10098)
2654
2655 * .gdbinit (prow): Make displayed values more self-explaining.
2656 Add row's hash code.
2657
2658 2011-11-21 Lars Magne Ingebrigtsen <larsi@gnus.org>
2659
2660 * process.c (wait_reading_process_output): Fix asynchrounous
2661 GnuTLS socket handling on some versions of the GnuTLS library.
2662 (wait_reading_process_output): Add comment and URL.
2663
2664 2011-11-21 Jan Djärv <jan.h.d@swipnet.se>
2665
2666 * xterm.c (x_clear_frame): Reinstate the XClearWindow call.
2667
2668 2011-11-21 Chong Yidong <cyd@gnu.org>
2669
2670 * window.c (Fnext_window, Fprevious_window): Doc fix.
2671
2672 2011-11-20 Stefan Monnier <monnier@iro.umontreal.ca>
2673
2674 * window.c (get_phys_cursor_glyph): Fix Lisp_Object/int mixup.
2675
2676 2011-11-20 Juanma Barranquero <lekktu@gmail.com>
2677
2678 * nsfont.m (syms_of_nsfont) <ns-reg-to-script>: Fix typo.
2679
2680 2011-11-20 Martin Rudalics <rudalics@gmx.at>
2681
2682 * window.c (Fset_window_combination_limit): Rename argument
2683 STATUS to LIMIT.
2684 (Vwindow_combination_limit): Remove "status" from doc-string.
2685
2686 2011-11-20 Andreas Schwab <schwab@linux-m68k.org>
2687
2688 * m/ibms390.h: Remove.
2689 * m/ibms390x.h: Don't include "ibms390.h".
2690
2691 2011-11-20 Stefan Monnier <monnier@iro.umontreal.ca>
2692
2693 * fileio.c (Finsert_file_contents): Add missing gcpro1 variable.
2694 Suggested by Dmitry Antipov <dmantipov@yandex.ru>.
2695
2696 2011-11-20 Juanma Barranquero <lekktu@gmail.com>
2697
2698 * casetab.c (Fset_case_table):
2699 * charset.c (Fcharset_after): Fix typos.
2700
2701 2011-11-20 Paul Eggert <eggert@cs.ucla.edu>
2702
2703 Standardize on VIRT_ADDR_VARIES behavior (Bug#10042).
2704 Otherwise, valgrind does not work on some platforms.
2705 Problem reported by Andreas Schwab in
2706 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00081.html>.
2707 * puresize.h (pure, PURE_P): Always behave as if VIRT_ADDR_VARIES
2708 is set, removing the need for VIRT_ADDRESS_VARIES.
2709 (PURE_P): Use a more-efficient implementation that needs just one
2710 comparison, not two: on x86-64 with GCC 4.6.2, this cut down the
2711 number of instructions from 6 (xorl, cmpq, jge, xorl, cmpq, setge)
2712 to 4 (xorl, subq, cmpq, setbe).
2713 * alloc.c (pure): Always extern now, since that's the
2714 VIRT_ADDR_VARIES behavior.
2715 (PURE_POINTER_P): Use a single comparison, not two, for
2716 consistency with the new puresize.h.
2717 * lisp.h (PNTR_COMPARISON_TYPE): Remove; no longer needed.
2718 * m/ibms390.h, m/intel386.h, m/template.h, s/cygwin.h, s/hpux10-20.h:
2719 Remove VIRT_ADDR_VARIES no longer needed.
2720
2721 2011-11-19 Eli Zaretskii <eliz@gnu.org>
2722
2723 * xdisp.c (x_write_glyphs, draw_phys_cursor_glyph)
2724 (erase_phys_cursor, update_window_cursor, show_mouse_face)
2725 (cursor_in_mouse_face_p): If the cursor position is out of bounds,
2726 behave as if the cursor position were at the window margin.
2727
2728 * window.c (get_phys_cursor_glyph): If the window is hscrolled,
2729 and the cursor position is out of bounds, behave as if the cursor
2730 position were at the window margin. (Bug#10075)
2731
2732 2011-11-18 Chong Yidong <cyd@gnu.org>
2733
2734 * window.c (Fwindow_combination_limit): Make first argument
2735 non-optional, since it is meaningless for live windows like the
2736 selected window.
2737
2738 2011-11-18 Dmitry Antipov <dmantipov@yandex.ru>
2739
2740 * keymap.c (Fwhere_is_internal): Add missing RETURN_UNGCPROs.
2741
2742 2011-11-18 Stefan Monnier <monnier@iro.umontreal.ca>
2743
2744 * intervals.c: Fix grafting over the whole buffer (bug#10071).
2745 (graft_intervals_into_buffer): Simplify.
2746
2747 2011-11-18 Eli Zaretskii <eliz@gnu.org>
2748
2749 * dispnew.c (swap_glyph_pointers): Swap the used[] arrays and the
2750 hash values of the two rows.
2751 (copy_row_except_pointers): Preserve the used[] arrays and the
2752 hash values of the two rows. (Bug#10035)
2753 (add_row_entry): Add xassert to verify that ROW's hash code is valid.
2754
2755 * xdisp.c (row_hash): New function, body extracted from
2756 compute_line_metrics.
2757 (compute_line_metrics): Call row_hash, instead of computing the
2758 hash code inline.
2759
2760 * dispnew.c (verify_row_hash): Call row_hash for computing the
2761 hash code of a row, instead of duplicating code from xdisp.c.
2762
2763 * dispextern.h (row_hash): Add prototype.
2764
2765 2011-11-18 Tassilo Horn <tassilo@member.fsf.org>
2766
2767 * frame.c (delete_frame): Don't delete the terminal when the last
2768 X frame is closed if emacs is built with GTK toolkit.
2769
2770 2011-11-17 Juanma Barranquero <lekktu@gmail.com>
2771
2772 * window.c (syms_of_window) <window-combination-resize>: Fix typo.
2773
2774 2011-11-17 Martin Rudalics <rudalics@gmx.at>
2775
2776 * window.c (Vwindow_splits): Rename to
2777 Vwindow_combination_resize. Suggested by Juri Linkov.
2778 (Fsplit_window_internal): Use Vwindow_combination_resize instead
2779 of Vwindow_splits.
2780
2781 2011-11-16 Juanma Barranquero <lekktu@gmail.com>
2782
2783 * nsfns.m (Fns_font_name):
2784 * window.c (syms_of_window) <window-combination-limit>: Fix typos.
2785
2786 2011-11-16 Martin Rudalics <rudalics@gmx.at>
2787
2788 * window.h (window): Rename slot "nest" to "combination_limit".
2789 * window.c (Fwindow_nest): Rename to Fwindow_combination_limit.
2790 (Fset_window_nest): Rename to Fset_window_combination_limit.
2791 (Vwindow_nest): Rename to Vwindow_combination_limit.
2792 (recombine_windows, make_parent_window, make_window)
2793 (Fsplit_window_internal, saved_window)
2794 (Fset_window_configuration, save_window_save): Rename all
2795 occurrences of window_nest to window_combination_limit.
2796
2797 2011-11-15 Juanma Barranquero <lekktu@gmail.com>
2798
2799 * image.c (imagemagick_load_image): Fix typo.
2800
2801 2011-11-14 Eli Zaretskii <eliz@gnu.org>
2802
2803 * xdisp.c (display_line): Move the call to
2804 highlight_trailing_whitespace before the call to
2805 compute_line_metrics, since the latter needs to see the final
2806 faces of all the glyphs to compute ROW's hash value.
2807 Fixes assertion violations in row_equal_p. (Bug#10035)
2808
2809 2011-11-14 Juanma Barranquero <lekktu@gmail.com>
2810
2811 * w32proc.c (reader_thread): Don't check pending input if cp->fd < 0,
2812 just return (bug#10044).
2813
2814 2011-11-12 Eli Zaretskii <eliz@gnu.org>
2815
2816 * makefile.w32-in (HEAPSIZE): New variable, allows to build temacs
2817 with user-defined heap size. Bump the default size of the temacs
2818 heap to 27MB, to avoid memory warning when running temacs.
2819 ($(TEMACS)): Use HEAPSIZE instead of a hardcoded value.
2820
2821 * dispnew.c (scrolling_window): Fix incorrect indices in accessing
2822 current_matrix and desired_matrix. (Bug#9990)
2823 (verify_row_hash) [XASSERTS]: New function.
2824 (adjust_glyph_matrix, row_equal_p): Use it in xassert to verify
2825 that the hash value of glyph rows is correct.
2826
2827 2011-11-12 Martin Rudalics <rudalics@gmx.at>
2828
2829 * window.h (window): Remove splits slot.
2830 * window.c (Fwindow_splits, Fset_window_splits): Remove.
2831 (Fdelete_other_windows_internal, make_parent_window)
2832 (make_window, Fsplit_window_internal, Fdelete_window_internal)
2833 (Fset_window_configuration, save_window_save): Don't deal with
2834 split status of windows.
2835 (saved_window): Remove splits slot.
2836 (Vwindow_splits): Rewrite doc-string.
2837
2838 2011-11-11 Jan Djärv <jan.h.d@swipnet.se>
2839
2840 * xfns.c (unwind_create_frame):
2841 * nsfns.m (unwind_create_frame):
2842 * w32fns.c (unwind_create_frame): Use Fmemq to check if frame is in
2843 Vframe_list (Bug#9999).
2844
2845 2011-11-11 Dmitry Antipov <dmantipov@yandex.ru>
2846
2847 * xdisp.c (syms_of_xdisp): Remove duplicated definition of Qtext.
2848
2849 2011-11-11 Kenichi Handa <handa@m17n.org>
2850
2851 * callproc.c (Fcall_process): Set the member dst_multibyte of
2852 process_coding.
2853
2854 2011-11-11 Johan Bockgård <bojohan@gnu.org>
2855
2856 * xdisp.c (fill_composite_glyph_string): Always set s->face, to
2857 avoid a crash (bug#9496).
2858
2859 2011-11-09 Chong Yidong <cyd@gnu.org>
2860
2861 * window.c (Fwindow_inside_edges, Fwindow_inside_pixel_edges)
2862 (Fwindow_inside_absolute_pixel_edges): Only allow live windows.
2863
2864 2011-11-08 Paul Eggert <eggert@cs.ucla.edu>
2865
2866 * s/gnu.h (GC_MARK_STACK): Define to GC_MAKE_GCPROS_NOOPS (Bug#9926).
2867
2868 2011-11-08 Paul Eggert <eggert@cs.ucla.edu>
2869
2870 Avoid some portability problems by eschewing 'extern inline' functions.
2871 The trivial performance wins aren't worth the portability hassles; see
2872 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00084.html>
2873 et seq.
2874 * dispextern.h (window_box, window_box_height, window_text_bottom_y)
2875 (window_box_width, window_box_left, window_box_left_offset)
2876 (window_box_right, window_box_right_offset): Undo previous change,
2877 by removing the "extern"s.
2878 * intervals.c (adjust_intervals_for_insertion)
2879 (adjust_intervals_for_deletion): Undo previous change,
2880 making these static again.
2881 (offset_intervals, temp_set_point_both, temp_set_point)
2882 (copy_intervals_to_string): No longer inline.
2883 * xdisp.c (window_text_bottom_y, window_box_width)
2884 (window_box_height, window_box_left_offset)
2885 (window_box_right_offset, window_box_left, window_box_right)
2886 (window_box): No longer inline.
2887
2888 2011-11-08 Chong Yidong <cyd@gnu.org>
2889
2890 * window.c (Fwindow_left_column, Fwindow_top_line): Doc fix.
2891 (Fwindow_body_height, Fwindow_body_width): Move from Lisp.
2892 Signal an error if not a live window.
2893 (Fwindow_total_width, Fwindow_total_height): Move from Lisp.
2894 (Fwindow_total_size, Fwindow_body_size): Move to Lisp.
2895
2896 2011-11-07 Juanma Barranquero <lekktu@gmail.com>
2897
2898 * lisp.h (syms_of_abbrev): Remove declaration.
2899 Reported by CHENG Gao <chenggao@royau.me>.
2900
2901 2011-11-07 Eli Zaretskii <eliz@gnu.org>
2902
2903 * w32.c (check_windows_init_file): Don't look for term/w32-win.el
2904 if Vpurify_flag is non-nil. Fixes a crash when running w32 build
2905 of temacs in GUI mode.
2906
2907 2011-11-07 Martin Rudalics <rudalics@gmx.at>
2908
2909 * window.h: Declare delete_all_child_windows instead of
2910 delete_all_subwindows.
2911 * window.c (Fwindow_nest, Fset_window_nest)
2912 (Fset_window_new_total, Fset_window_new_normal)
2913 (Fwindow_resize_apply): Don't use term subwindow in doc-strings.
2914 (delete_all_subwindows): Rename to delete_all_child_windows.
2915 (Fdelete_other_windows_internal, Fset_window_configuration):
2916 Call delete_all_child_windows instead of delete_all_subwindows.
2917 * frame.c (delete_frame): Call delete_all_child_windows instead
2918 of delete_all_subwindows.
2919
2920 2011-11-07 Paul Eggert <eggert@cs.ucla.edu>
2921
2922 * alloc.c (DEADP): New macro, for porting to GNU/Hurd (Bug#9926).
2923 This is also needed for porting to any host where GC_MARK_STACK is
2924 not GC_MAKE_GCPROS_NOOPS.
2925 (which_symbols): Use it.
2926
2927 2011-11-07 Kenichi Handa <handa@m17n.org>
2928
2929 * coding.c (coding_set_destination): Check coding->src_pos only
2930 when coding->src_object is a buffer (bug#9910).
2931
2932 * process.c (send_process): Set the member src_multibyte of coding
2933 to 0 (bug#9911) when sending a unibyte text.
2934
2935 * callproc.c (Fcall_process): Set the member src_multibyte of
2936 process_coding to 0 (bug#9912).
2937
2938 2011-11-06 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
2939
2940 * xmenu.c (cleanup_widget_value_tree): New function.
2941 (xmenu_show, xdialog_show): Use it in record_unwind_protect instead of
2942 calling free_menubar_widget_value_tree directly (Bug#9830).
2943
2944 2011-11-06 Paul Eggert <eggert@cs.ucla.edu>
2945
2946 Fix some portability problems with 'inline'.
2947 * dispextern.h (window_box, window_box_height, window_text_bottom_y)
2948 (window_box_width, window_box_left, window_box_left_offset)
2949 (window_box_right, window_box_right_offset): Declare extern.
2950 Otherwise, these inline functions do not conform to C99 and
2951 are miscompiled by Microsoft compilers. Reported by Eli Zaretskii in
2952 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00084.html>.
2953 * intervals.c (adjust_intervals_for_insertion)
2954 (adjust_intervals_for_deletion): Now extern, because otherwise the
2955 extern inline functions 'offset_intervals' couldn't refer to it.
2956 (static_offset_intervals): Remove.
2957 (offset_intervals): Rewrite using the old contents of
2958 static_offset_intervals. The old version didn't conform to C99
2959 because an extern inline function contained a reference to an
2960 identifier with static linkage.
2961
2962 2011-11-06 Andreas Schwab <schwab@linux-m68k.org>
2963
2964 * keyboard.c (interrupt_signal): Don't call kill-emacs while in
2965 GC.
2966
2967 2011-11-06 Eli Zaretskii <eliz@gnu.org>
2968
2969 * xdisp.c (init_iterator, reseat_to_string): Don't set the
2970 iterator's bidi_p flag if Vpurify_flag is non-nil. (Bug#9963)
2971 (Fcurrent_bidi_paragraph_direction): If Vpurify_flag is non-nil,
2972 return Qleft_to_right.
2973
2974 2011-11-06 Chong Yidong <cyd@gnu.org>
2975
2976 * window.c (Fwindow_live_p, Fwindow_frame, Fframe_root_window)
2977 (Fminibuffer_window, Fwindow_buffer, Fwindow_splits)
2978 (Fset_window_splits, Fwindow_nest, Fset_window_nest)
2979 (Fwindow_use_time, Fwindow_total_size, Fwindow_normal_size)
2980 (Fwindow_new_normal, Fwindow_left_column, Fwindow_top_line)
2981 (Fwindow_margins, Fwindow_fringes, Fwindow_scroll_bars)
2982 (Fwindow_vscroll): Doc fix.
2983 (Fwindow_top_child, Fwindow_left_child): Eliminate a nil default
2984 argument, since it makes no sense to pass a live window and for
2985 consistency with window-child.
2986
2987 2011-11-05 Christoph Scholtes <cschol2112@googlemail.com>
2988
2989 * makefile.w32-in ($(TEMACS), (gl-stamp)): Use $(THISDIR) to
2990 support MSVC.
2991
2992 2011-11-05 Jason Rumney <jasonr@gnu.org>
2993
2994 * w32font.c (font_matches_spec): Filter out non-Japanese kana fonts.
2995 (add_font_entity_to_list): Filter out non-Japanese Shift-JIS
2996 fonts (Bug#6029).
2997 (add_font_entity_to_list): Fix logic errors in mixed boolean and
2998 bitwise arithmetic preventing use of unicode-sip and non-truetype
2999 opentype fonts.
3000
3001 2011-11-05 Eli Zaretskii <eliz@gnu.org>
3002
3003 * s/ms-w32.h (fstat, stat, utime): Move redirections to
3004 "emacs"-only part.
3005
3006 * w32fns.c (x_create_tip_frame, Fx_create_frame): Rearrange
3007 initialization code to keep similarity to xfns.c after changes
3008 from 2011-11-05.
3009
3010 2011-11-05 Jan Djärv <jan.h.d@swipnet.se>
3011
3012 * nsfns.m: Declare image_cache_refcount if GLYPH_DEBUG.
3013 (unwind_create_frame): New function (Bug#9943).
3014 (Fx_create_frame): Restructure code to be more similar to the one in
3015 xfns.c. Call record_unwind_protect with unwind_create_frame (Bug#9943).
3016 Initialize image_cache_refcount if GLYPH_DEBUG (Bug#9943).
3017 Move terminal->reference_count++ just before making the frame official
3018 (Bug#9943).
3019
3020 * nsterm.m (x_free_frame_resources): New function.
3021 (x_destroy_window): Move code to x_free_frame_resources.
3022
3023 * xfns.c (unwind_create_frame): Fix comment.
3024 (Fx_create_frame, x_create_tip_frame):
3025 Move terminal->reference_count++ just before making the frame
3026 official. Move initialization of image_cache_refcount and
3027 dpyinfo_refcount before calling init_frame_faces (Bug#9943).
3028
3029 2011-11-05 Eli Zaretskii <eliz@gnu.org>
3030
3031 Support MSVC build with newer versions of Visual Studio.
3032 * makefile.w32-in (TAGS-gmake): Don't use $(patsubst ...), as
3033 Nmake barfs on that. Use $(OBJ*_c) variables instead, defined on
3034 nt/gmake.defs.
3035
3036 * lisp.h (ENUM_BF): New macro, for enumerated types in bitfields,
3037 which are not supported by MSVC.
3038 (Lisp_Symbol, Lisp_Misc_Any, Lisp_Marker, Lisp_Misc_Overlay)
3039 (Lisp_Save_Value, Lisp_Free): Use ENUM_BF for enumerated types in
3040 bitfields.
3041 (Lisp_Object) [USE_LISP_UNION_TYPE]: Use ENUM_BF for enumerated
3042 types in bitfields.
3043 (DEFUN) [_MSC_VER]: Define in a different way for MSVC.
3044
3045 * w32fns.c [_MSC_VER]: DECLARE_HANDLE for any MSVC version.
3046
3047 2011-11-05 Fabrice Popineau <fabrice.popineau@supelec.fr> (tiny change)
3048
3049 Support MSVC build with newer versions of Visual Studio.
3050 * w32.c: Don't include w32api.h for MSVC.
3051 (init_environment) [_MSC_VER]: Call sys_access, not _access.
3052
3053 * s/ms-w32.h <sigset_t, ssize_t> [_MSC_VER]: Typedefs for MSVC.
3054 [_MSC_VER]: Include sys/timeb.h, sys/stat.h, and signal.h.
3055 (fstat, stat, utime) [_MSC_VER]: Redirect to their sys_* cousins.
3056 (malloc, free, realloc, calloc) [_MSC_VER]: Always redirect to the
3057 e_* cousins.
3058 (alloca) [_MSC_VER]: Define to _alloca.
3059
3060 * lisp.h (DECL_ALIGN) [_MSC_VER]: Define for MSVC.
3061
3062 * regex.c <re_char> [_MSC_VER]: A separate definition for MSVC.
3063
3064 2011-11-04 Eli Zaretskii <eliz@gnu.org>
3065
3066 * xdisp.c (note_mouse_highlight): If either of
3067 previous/next-single-property-change returns nil, treat that as
3068 the beginning or the end of the buffer. (Bug#9955)
3069
3070 2011-11-04 Jan Djärv <jan.h.d@swipnet.se>
3071
3072 * gtkutil.c (xg_make_tool_item): Add callbacks if one of wimage or
3073 label is not null (Bug#9951).
3074 (xg_tool_item_stale_p): Handle the fact that wimage and/or wlbl
3075 may be NULL.
3076
3077 2011-11-04 Eli Zaretskii <eliz@gnu.org>
3078
3079 * window.c (Fwindow_body_size): Mention in the doc string that the
3080 return value is in frame's canonical units. (Bug#9949)
3081
3082 2011-11-03 Eli Zaretskii <eliz@gnu.org>
3083
3084 * xdisp.c (note_mouse_highlight): Initialize `area'. (Bug#9947)
3085
3086 * w32fns.c (unwind_create_frame): If needed, free the glyph
3087 matrices of the partially constructed frame. (Bug#9943)
3088 * xfns.c (unwind_create_frame): Likewise.
3089
3090 2011-11-01 Eli Zaretskii <eliz@gnu.org>
3091
3092 * xdisp.c (mouse_face_from_buffer_pos): Fix a typo in a comment.
3093 Don't stop backward scan on the continuation glyph, even though
3094 its CHARPOS is positive.
3095 (mouse_face_from_buffer_pos, note_mouse_highlight):
3096 Rename cover_string to disp_string.
3097
3098 2011-11-01 Martin Rudalics <rudalics@gmx.at>
3099
3100 * window.c (temp_output_buffer_show): Don't use
3101 Vtemp_buffer_show_specifiers.
3102 (Vtemp_buffer_show_specifiers): Remove unused variable.
3103
3104 2011-10-30 Eli Zaretskii <eliz@gnu.org>
3105
3106 * xdisp.c (try_cursor_movement): Make sure ROW isn't decremented
3107 past the beginning of the current glyph matrix.
3108
3109 2011-10-30 Adam Sjøgren <asjo@koldfront.dk> (tiny change)
3110
3111 * xterm.c: Include X11/Xproto.h if HAVE_GTK3.
3112 (x_error_handler): Ignore BadMatch for X_SetInputFocus for
3113 HAVE_GTK3 (Bug#9869).
3114
3115 * gtkutil.c (xg_win_to_widget, xg_event_is_for_menubar): Initialize
3116 type to GDK_NOTHING so valgrind does not complain (Bug#9901).
3117
3118 * xterm.h (x_display_info): Add Xatom_net_wm_state_hidden (Bug#9893).
3119
3120 * xterm.c: Declare x_handle_net_wm_state to return int.
3121 (handle_one_xevent): Check if we are iconified but don't have
3122 _NET_WM_STATE_HIDDEN. If do, treat as deiconify (Bug#9893).
3123 (get_current_wm_state): Return non-zero if not hidden,
3124 check for _NET_WM_STATE_HIDDEN (Bug#9893).
3125 (do_ewmh_fullscreen): Ignore return value from get_current_wm_state.
3126 (x_handle_net_wm_state): Return what get_current_wm_state returns.
3127 (x_term_init): Initialize dpyinfo->Xatom_net_wm_state_hidden.
3128
3129 2011-10-29 Paul Eggert <eggert@cs.ucla.edu>
3130
3131 * alloc.c (which_symbols): Declare EXTERNALLY_VISIBLE,
3132 so that this new function doesn't get optimized away by a
3133 whole-program optimizer. Make the 2nd arg EMACS_INT, not int.
3134
3135 2011-10-29 Andreas Schwab <schwab@linux-m68k.org>
3136
3137 * frame.h (MOUSE_HL_INFO): Remove excess parens.
3138
3139 2011-10-29 Eli Zaretskii <eliz@gnu.org>
3140
3141 Fix the `xbytecode' command.
3142 * .gdbinit (xprintbytestr): New command.
3143 (xwhichsymbols): Rename from `which'; all callers changed.
3144 (xbytecode): Print the byte-code string as well.
3145
3146 2011-10-29 Kim Storm <storm@cua.dk>
3147
3148 * alloc.c (which_symbols): New function.
3149
3150 2011-10-29 Andreas Schwab <schwab@linux-m68k.org>
3151
3152 * minibuf.c (read_minibuf_noninteractive): Allow reading empty
3153 line. (Bug#9903)
3154
3155 2011-10-29 Glenn Morris <rgm@gnu.org>
3156
3157 * process.c (wait_reading_process_output): Revert 2009-08-30 change.
3158 Not clear what it was for, and it causes various bugs. (Bug#9839)
3159
3160 2011-10-28 Eli Zaretskii <eliz@gnu.org>
3161
3162 * xdisp.c (note_mouse_highlight): Initialize `part', to avoid a
3163 possible random value that matches one of those tested as
3164 condition to clear the mouse face.
3165
3166 2011-10-28 Chong Yidong <cyd@gnu.org>
3167
3168 * xdisp.c (note_mouse_highlight): Fix use of uninitialized var.
3169
3170 2011-10-28 Dan Nicolaescu <dann@ics.uci.edu>
3171
3172 * window.c (make_window): Initialize phys_cursor_on_p.
3173
3174 2011-10-28 Stefan Monnier <monnier@iro.umontreal.ca>
3175
3176 * lisp.h (struct Lisp_Symbol): Update comments.
3177
3178 2011-10-28 Juanma Barranquero <lekktu@gmail.com>
3179
3180 * w32font.c (w32_load_unicows_or_gdi32): Add missing return.
3181
3182 2011-10-28 Eli Zaretskii <eliz@gnu.org>
3183
3184 Fix Emacs on Windows 9X (bug#8562). Thanks to oslsachem
3185 <oslsachem@gmail.com> for helping to debug this.
3186
3187 * w32font.c (g_b_init_is_w9x, g_b_init_get_outline_metrics_w)
3188 (g_b_init_get_text_metrics_w, g_b_init_get_glyph_outline_w)
3189 (g_b_init_get_glyph_outline_w): New static variables.
3190 (GetOutlineTextMetricsW_Proc, GetTextMetricsW_Proc)
3191 (GetGlyphOutlineW_Proc): New typedefs.
3192 (w32_load_unicows_or_gdi32, get_outline_metrics_w)
3193 (get_text_metrics_w, get_glyph_outline_w, globals_of_w32font):
3194 New functions.
3195 (w32font_open_internal, compute_metrics):
3196 Call get_outline_metrics_w, get_text_metrics_w, and get_glyph_outline_w
3197 instead of calling the "wide" APIs directly.
3198
3199 * emacs.c (main) [HAVE_NTGUI]: Call globals_of_w32font.
3200
3201 * w32.h (syms_of_w32font): Add prototype.
3202
3203 2011-10-27 Juanma Barranquero <lekktu@gmail.com>
3204
3205 * window.c (Fframe_root_window, Fframe_first_window, Fwindow_end)
3206 (Fframe_selected_window, Ftemp_output_buffer_show, Fnext_window)
3207 (Fdelete_window_internal, Fwindow_parameters): Fix typos in docstrings.
3208 (Fmove_to_window_line): Doc fix.
3209
3210 2011-10-27 Chong Yidong <cyd@gnu.org>
3211
3212 * process.c (make_process): Set gnutls_state to NULL.
3213
3214 * gnutls.c (emacs_gnutls_deinit): Deinit the gnutls_state if it is
3215 non-NULL, regardless of GNUTLS_INITSTAGE.
3216 (Fgnutls_boot): Cleanups. Call emacs_gnutls_deinit if we signal
3217 an error. Set process slots as soon as we allocate them.
3218
3219 * gnutls.h (GNUTLS_LOG, GNUTLS_LOG2): Fix macros.
3220
3221 2011-10-27 Chong Yidong <cyd@gnu.org>
3222
3223 * gnutls.c (emacs_gnutls_deinit): New function.
3224 Deallocate credentials structures as well as calling gnutls_deinit.
3225 (Fgnutls_deinit, Fgnutls_boot): Use it.
3226
3227 * process.c (make_process): Initialize GnuTLS credentials to NULL.
3228 (deactivate_process): Call emacs_gnutls_deinit.
3229
3230 2011-10-27 Juanma Barranquero <lekktu@gmail.com>
3231
3232 * image.c (x_create_x_image_and_pixmap):
3233 * w32.c (sys_rename, w32_delayed_load):
3234 * w32font.c (fill_in_logfont):
3235 * w32reg.c (x_get_string_resource): Silence compiler warnings.
3236
3237 2011-10-26 Juanma Barranquero <lekktu@gmail.com>
3238
3239 * w32fns.c (w32_default_color_map): New function,
3240 extracted from Fw32_default_color_map.
3241 (Fw32_default_color_map, Fx_open_connection): Use it. (Bug#9785)
3242
3243 2011-10-25 Paul Eggert <eggert@cs.ucla.edu>
3244
3245 * dispextern.h (Fcontrolling_tty_p): New decl (Bug#6649 part 2).
3246
3247 2011-10-25 Stefan Monnier <monnier@iro.umontreal.ca>
3248
3249 * keyboard.c (test_undefined): New function (bug#9751).
3250 (read_key_sequence): Use it to detect when a key is bound to `undefined'.
3251
3252 2011-10-25 Enami Tsugutomo <tsugutomo.enami@jp.sony.com>
3253
3254 * sysdep.c (init_sys_modes): Fix the check for the controlling
3255 terminal (Bug#6649).
3256
3257 2011-10-20 Eli Zaretskii <eliz@gnu.org>
3258
3259 * dispextern.h (struct bidi_it): New member next_en_type.
3260
3261 * bidi.c (bidi_line_init): Initialize the next_en_type member.
3262 (bidi_resolve_explicit_1): When next_en_pos is valid for the
3263 current character, check also for next_en_type being WEAK_EN.
3264 (bidi_resolve_weak): Don't enter the expensive loop if the current
3265 position is before next_en_pos. Record the bidi type of the first
3266 non-ET, non-BN character we find, in addition to its position.
3267 (bidi_level_of_next_char): Invalidate next_en_type when
3268 next_en_pos is over-stepped.
3269
3270 2011-10-20 Paul Eggert <eggert@cs.ucla.edu>
3271
3272 Time zone name fixes for non-ASCII locales (Bug#641, Bug#9794)
3273 * editfns.c: Rewrite current-time-zone so that it invokes
3274 the equivalent of (format-time-string "%Z") to get the time zone name.
3275 This fixes a bug when the time zone name contains characters that
3276 need converting from the system time locale to Emacs internal format.
3277 This fixes a shortcoming that I introduced in my 1999-10-19 patch:
3278 that patch fixed format-time-string to do the conversion, but
3279 I forgot to fix current-time-zone.
3280 (format_time_string): New function, containing most of
3281 what Fformat_time_string used to contain.
3282 (Fformat_time_string): Rewrite in terms of format_time_string.
3283 This doesn't change this function's behavior.
3284 (current-time-zone): Rewrite to use format_time_string.
3285 This fixes the bug reported by Michael Schierl in
3286 <http://lists.gnu.org/archive/html/emacs-devel/2007-06/msg00334.html>.
3287 Jason Rumney's 2007-06-07 change worked around this bug, but
3288 didn't fix it.
3289 * systime.h (tzname, timezone): Remove no-longer-used declarations.
3290
3291 2011-10-19 Eli Zaretskii <eliz@gnu.org>
3292
3293 * xdisp.c (start_display): If the character at POS is displayed
3294 via a display vector, reset IT->current.dpvec_index to zero.
3295 (try_window_reusing_current_matrix): If a line ends in a display
3296 vector or the next line starts in a display vector, continue
3297 redrawing the window even though the character position of
3298 start_row was reached.
3299 (Bug#9771, part 2)
3300
3301 2011-10-18 Chong Yidong <cyd@gnu.org>
3302
3303 * xdisp.c (get_next_display_element): Handle U+2010 and U+2011
3304 with nobreak-char-display too.
3305
3306 2011-10-18 Eli Zaretskii <eliz@gnu.org>
3307
3308 Fix part 3 of bug#9771.
3309 * bidi.c (bidi_line_init): Initialize next_en_pos to zero, not -1.
3310 (bidi_resolve_neutral): Don't enter the expensive loop looking for
3311 non-neutral characters if the current character is a paragraph
3312 separator (a.k.a. Newline). This avoids running the same
3313 expensive loop twice, once when we consume the preceding newline
3314 and the other time when the line actually needs to be displayed.
3315 Avoid the loop when we see neutrals on the base embedding level
3316 following a character whose directionality is the same as the
3317 paragraph's. This avoids running the expensive loop when a line
3318 ends in a long sequence of neutrals, like control characters.
3319 Add assertion against STRONG_AL type. Slightly rearrange code
3320 that determines the type of a neutral given the first non-neutral
3321 that follows it.
3322 (bidi_level_of_next_char): Set next_en_pos to zero when
3323 invalidating its info.
3324
3325 2011-10-17 Eli Zaretskii <eliz@gnu.org>
3326
3327 * xdisp.c (push_display_prop): Determine whether to record string
3328 or buffer position by IT->string, not by IT->method. Allow
3329 GET_FROM_DISPLAY_VECTOR as IT->method on entry. (Bug#9771, part 4)
3330 (move_it_vertically_backward): Don't look for character position
3331 immediately after the newline when in a continuation line.
3332 (Bug#9771, part 1)
3333
3334 2011-10-15 Martin Rudalics <rudalics@gmx.at>
3335
3336 * window.c (coordinates_in_window): Rewrite and delabelize
3337 vertical border check. (Bug#5357) (Bug#9618)
3338
3339 2011-10-14 Stefan Monnier <monnier@iro.umontreal.ca>
3340
3341 * xterm.c (frame_highlight, frame_unhighlight): Ignore unexplained
3342 errors in XSetWindowBorder (bug#9310).
3343
3344 2011-10-13 Dmitry Antipov <dmantipov@yandex.ru>
3345
3346 * editfns.c (Fset_time_zone_rule): Replace free with xfree to
3347 avoid crash when xmalloc overrun checking is enabled.
3348
3349 2011-10-13 Eli Zaretskii <eliz@gnu.org>
3350
3351 * xdisp.c (Fcurrent_bidi_paragraph_direction): Initialize
3352 itb.paragraph_dir to NEUTRAL_DIR. Fixes an occasional incorrect
3353 cursor motion with <left> and <right> arrow keys.
3354
3355 * bidi.c (bidi_init_it): Don't initialize paragraph_dir here, as
3356 some callers set that themselves.
3357
3358 2011-10-12 Eli Zaretskii <eliz@gnu.org>
3359
3360 * xdisp.c (find_row_edges): Handle the case where ROW comes from a
3361 display string and the previous row comes from the same string and
3362 is empty. (Bug#9739) (Bug#9738)
3363
3364 2011-10-12 Stefan Monnier <monnier@iro.umontreal.ca>
3365
3366 * doc.c (get_doc_string): Encode file name (bug#9735).
3367
3368 2011-10-12 Eli Zaretskii <eliz@gnu.org>
3369
3370 * bidi.c (bidi_level_of_next_char):
3371 * xdisp.c (get_visually_first_element): Remove old incorrect
3372 comments regarding the Unicode Line Separator character.
3373
3374 * bidi.c (bidi_init_it): Initialize paragraph_dir to NEUTRAL_DIR.
3375
3376 2011-10-12 Dmitry Antipov <dmantipov@yandex.ru>
3377
3378 * alloc.c (Fgc_status): Do not access beyond zombies array
3379 boundary if nzombies > MAX_ZOMBIES.
3380 * alloc.c (dump_zombies): Add missing format specifier.
3381
3382 2011-10-12 Paul Eggert <eggert@cs.ucla.edu>
3383
3384 * xdisp.c (set_cursor_from_row): Simplify conditionals,
3385 to pacify GCC 4.6.1 x86-64 with -O2 -Wstrict-overflow.
3386
3387 * lread.c (read_escape): Allow hex escapes as large as ?\xfffffff.
3388 Some packages use them to denote characters with modifiers.
3389
3390 2011-10-11 Andreas Schwab <schwab@linux-m68k.org>
3391
3392 * lisp.h (GCPRO1_VAR, GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR)
3393 (GCPRO5_VAR, GCPRO6_VAR, UNGCPRO_VAR): Add whitespace to avoid
3394 matching a pp-number. Rename parameter var to var1.
3395
3396 2011-10-11 Stefan Monnier <monnier@iro.umontreal.ca>
3397
3398 * minibuf.c (Finternal_complete_buffer): Fix last change (bug#9709).
3399
3400 2011-10-08 Glenn Morris <rgm@gnu.org>
3401
3402 * callint.c (Fcall_interactively): Give a more explicit error for the
3403 'c' case with a non-character input. (Bug#8479)
3404
3405 2011-10-08 Eli Zaretskii <eliz@gnu.org>
3406
3407 * xdisp.c (hscroll_window_tree): Support hscroll in right-to-left
3408 lines.
3409 (set_cursor_from_row): Fix cursor positioning in mixed L2R+R2L
3410 lines that are hscrolled on the left.
3411
3412 * dispnew.c (buffer_posn_from_coords): Account for a possible
3413 presence of header-line. (Bug#4426)
3414
3415 2011-10-07 Stefan Monnier <monnier@iro.umontreal.ca>
3416
3417 * buffer.c (syms_of_buffer) <enable-multibyte-characters>:
3418 Don't advertise functionality which we discourage or doesn't work.
3419
3420 2011-10-07 Paul Eggert <eggert@cs.ucla.edu>
3421
3422 * alloc.c (GC_LISP_OBJECT_ALIGNMENT): Use offsetof, not __alignof__
3423 or sizeof. __alignof__ gives the wrong answer on Fedora x86-64
3424 with GCC 4.6.1 when configured with CC='gcc -m32' --with-wide-int;
3425 this makes Emacs dump core during garbage collection on rare
3426 occasions. sizeof is obviously inferior to offsetof here, so
3427 stick with offsetof.
3428 (GC_POINTER_ALIGNMENT): New macro.
3429 (mark_memory): Omit 3rd (offset) arg; caller changed.
3430 Don't assume EMACS_INT alignment is the same as pointer alignment.
3431
3432 2011-10-03 Stefan Monnier <monnier@iro.umontreal.ca>
3433
3434 * keyboard.c (read_key_sequence_remapped): New var.
3435 (read_key_sequence): Compute remapping in the right buffer.
3436 (command_loop_1): Use read_key_sequence's remapping directly.
3437
3438 2011-10-02 Stefan Monnier <monnier@iro.umontreal.ca>
3439
3440 * dired.c (file_name_completion): Don't expand file name.
3441 (Ffile_name_completion, Ffile_name_all_completions): Expand file name
3442 before checking file name handler.
3443
3444 * minibuf.c (Finternal_complete_buffer): Only show internal buffers if
3445 they've been requested explicitly (bug#9591).
3446
3447 2011-10-01 Andreas Schwab <schwab@linux-m68k.org>
3448
3449 * keymap.c (Fsingle_key_description): Use make_specified_string
3450 instead of build_string to build string from push_key_description.
3451 (Bug#5193)
3452
3453 2011-09-30 Paul Eggert <eggert@cs.ucla.edu>
3454
3455 * buffer.h (struct buffer): Use time_t, not int, for a time stamp.
3456 This fixes a Y2038 bug on 64-bit hosts.
3457 * buffer.c (reset_buffer):
3458 * fileio.c (Fdo_auto_save, Fset_buffer_auto_saved)
3459 (Fclear_buffer_auto_save_failure):
3460 Use 0, not -1, to represent an unset failure time, since time_t
3461 might not be signed.
3462
3463 Remove dependency on glibc malloc internals.
3464 * alloc.c (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
3465 Move back here from lisp.h, but with their new implementations.
3466 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
3467 (XMALLOC_OVERRUN_SIZE_SIZE): Move these new lisp.h macros here.
3468 * charset.c (charset_table_init): New static var.
3469 (syms_of_charset): Use it instead of xmalloc. This removes a
3470 dependency on glibc malloc internals. See Eli Zaretskii's comment in
3471 <http://lists.gnu.org/archive/html/emacs-devel/2011-09/msg00815.html>.
3472 * lisp.h (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
3473 Move back to alloc.c.
3474 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
3475 (XMALLOC_OVERRUN_SIZE_SIZE): Move to alloc.c.
3476
3477 2011-09-30 Jan Djärv <jan.h.d@swipnet.se>
3478
3479 * nsterm.m (windowDidResize): Call x_set_window_size only when
3480 ns_in_resize is true. Otherwise set pixelwidth/height and
3481 call change_frame_size (Bug#9628).
3482
3483 2011-09-30 Paul Eggert <eggert@cs.ucla.edu>
3484
3485 Port --enable-checking=all to Fedora 14 x86-64.
3486 * charset.c (syms_of_charset): Also account for glibc malloc's
3487 internal overhead when calculating the initial malloc maximum.
3488
3489 Port --enable-checking=all to Fedora 14 x86.
3490 * alloc.c (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
3491 Move to lisp.h.
3492 (xmalloc_put_size, xmalloc_get_size, overrun_check_malloc)
3493 (overrun_check_realloc, overrun_check_free):
3494 Use XMALLOC_OVERRUN_SIZE_SIZE, not sizeof (size_t).
3495 That way, xmalloc returns a properly-aligned pointer even if
3496 XMALLOC_OVERRUN_CHECK is defined. The old debugging code happened
3497 to align OK on typical 64-bit hosts, but not on Fedora 14 x86.
3498 * charset.c (syms_of_charset): Take XMALLOC_OVERRUN_CHECK_OVERHEAD
3499 into account when calculating the initial malloc maximum.
3500 * lisp.h (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
3501 Move here from alloc.c, so that charset.c can use it too.
3502 Properly align; the old code wasn't right for common 32-bit hosts
3503 when configured with --enable-checking=all.
3504 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
3505 (XMALLOC_OVERRUN_SIZE_SIZE): New macros.
3506
3507 2011-09-29 Eli Zaretskii <eliz@gnu.org>
3508
3509 * sysdep.c (snprintf) [!EOVERFLOW]: If EOVERFLOW is not defined,
3510 use EDOM.
3511
3512 2011-09-28 Eli Zaretskii <eliz@gnu.org>
3513
3514 * xdisp.c (compute_display_string_end): If there's no display
3515 string at CHARPOS, return -1.
3516
3517 * bidi.c (bidi_fetch_char): When compute_display_string_end
3518 returns a negative value, treat the character as a normal
3519 character not covered by a display string. (Bug#9624)
3520
3521 2011-09-28 Juanma Barranquero <lekktu@gmail.com>
3522
3523 * lread.c (Fread_from_string): Fix typo in docstring.
3524
3525 2011-09-27 Eli Zaretskii <eliz@gnu.org>
3526
3527 * xdisp.c (handle_invisible_prop): If invisible text ends on a
3528 newline, reseat the iterator instead of bidi-iterating there one
3529 character at a time. (Bug#9610)
3530 (BUFFER_POS_REACHED_P, move_it_in_display_line_to): Bail when past
3531 TO_CHARPOS if the bidi iterator is at base embedding level.
3532
3533 2011-09-27 Andreas Schwab <schwab@linux-m68k.org>
3534
3535 * lread.c (readevalloop): Use correct code for NBSP.
3536 (read1): Likewise. (Bug#9608)
3537
3538 2011-09-25 Michael Albinus <michael.albinus@gmx.de>
3539
3540 * dbusbind.c (Fdbus_register_signal): When service is not
3541 registered, use nil in Vdbus_registered_objects_table. (Bug#9581)
3542
3543 2011-09-25 Glenn Morris <rgm@gnu.org>
3544
3545 * buffer.c (truncate-lines): Doc fix.
3546
3547 2011-09-24 Chong Yidong <cyd@stupidchicken.com>
3548
3549 * window.c (Fwindow_prev_buffers, Fset_window_prev_buffers)
3550 (Fset_window_next_buffers): Doc fix.
3551
3552 2011-09-24 Glenn Morris <rgm@gnu.org>
3553
3554 * minibuf.c (read_minibuf): Disable line truncation. (Bug#5715)
3555
3556 2011-09-24 Paul Eggert <eggert@cs.ucla.edu>
3557
3558 Fix minor problems found by static checking.
3559 * xdisp.c (string_from_display_spec): Don't assume vecsize fits in int.
3560 * indent.c (Fvertical_motion): Fix == vs = typo.
3561
3562 2011-09-24 Eli Zaretskii <eliz@gnu.org>
3563
3564 * dispnew.c (syms_of_display) <redisplay-dont-pause>:
3565 Default value is now t. Doc fix.
3566
3567 * indent.c (Fvertical_motion): Compute and apply the overshoot
3568 logic when moving up, not only when moving down. Fix the
3569 confusing name and values of the it_overshoot_expected variable;
3570 logic changes accordingly. (Bug#9254) (Bug#9549)
3571
3572 * xdisp.c (pos_visible_p): Produce correct pixel coordinates when
3573 CHARPOS is covered by a display string which includes newlines.
3574 (move_it_vertically_backward): Avoid inflooping when START_CHARPOS
3575 is covered by a display string with embedded newlines.
3576
3577 2011-09-24 Michael Albinus <michael.albinus@gmx.de>
3578
3579 * dbusbind.c (Fdbus_register_signal): Add match rule to
3580 Vdbus_registered_objects_table. (Bug#9581)
3581 (Fdbus_register_method, Vdbus_registered_objects_table):
3582 Fix docstring.
3583
3584 2011-09-24 Jim Meyering <meyering@redhat.com>
3585
3586 do not ignore write error for any output size
3587 The previous change was incomplete.
3588 While it makes emacs --batch detect the vast majority of stdout
3589 write failures, errors were still ignored whenever the output size is
3590 k * (BUFSIZ+1) - 4. E.g., on a system with BUFSIZ of 4096,
3591 $ emacs --batch --eval '(print (format "%4093d" 0))' > /dev/full \
3592 && echo FAIL: ignored write error
3593 FAIL: ignored write error
3594 $ emacs --batch --eval '(print (format "%20481d" 0))' > /dev/full \
3595 && echo FAIL: ignored write error
3596 FAIL: ignored write error
3597 * emacs.c (Fkill_emacs): Also test ferror. (Bug#9574)
3598
3599 2011-09-23 Andreas Schwab <schwab@linux-m68k.org>
3600
3601 * emacs.c (Fkill_emacs): In noninteractive mode exit
3602 non-successfully if a write error occurred on stdout. (Bug#9574)
3603
3604 2011-09-21 Eli Zaretskii <eliz@gnu.org>
3605
3606 * xdisp.c (pop_it): Allow it->object that is a cons cell to pass
3607 the xassert test.
3608
3609 * dispextern.h (struct it): Update the comment documenting what
3610 can it->OBJECT be.
3611
3612 2011-09-20 Eli Zaretskii <eliz@gnu.org>
3613
3614 * xdisp.c (set_cursor_from_row): If the row ends in a newline from
3615 a display string, extend search for cursor position to end of row.
3616 (find_row_edges): If the row ends in a newline from a display
3617 string, increment its MATRIX_ROW_END_CHARPOS by one. (Bug#9549)
3618 Handle the case of a display string with multiple newlines.
3619 (Fcurrent_bidi_paragraph_direction): Fix search for previous
3620 non-empty line. Fixes confusing cursor motion with arrow keys at
3621 the beginning of a line that starts with whitespace.
3622
3623 2011-09-19 Lars Magne Ingebrigtsen <larsi@gnus.org>
3624
3625 * lread.c (Fread_from_string): Document what FINAL-STRING-INDEX is
3626 (bug#9493).
3627
3628 2011-09-18 Chong Yidong <cyd@stupidchicken.com>
3629
3630 * xfns.c (Fx_create_frame): Handle the bitmapIcon resource as
3631 boolean (Bug#9154).
3632
3633 2011-09-18 Eli Zaretskii <eliz@gnu.org>
3634
3635 * xdisp.c (display_line): Record maximum and minimum buffer
3636 positions even if no glyphs were produced (e.g., by a zero-width
3637 stretch). Fixes bug#9530 on a TTY. Under word-wrap, don't record
3638 buffer positions that will be removed from the glyph row because
3639 they don't fit.
3640 (produce_stretch_glyph): Fix a bug in :align-to on a TTY when the
3641 column is beyond frame width: don't subtract 1 "pixel" when
3642 computing width of the stretch.
3643 (reseat_at_next_visible_line_start): Undo the change made on
3644 2011-09-17 that saved paragraph information and restored it after
3645 the call to `reseat'. (Bug#9545)
3646
3647 2011-09-18 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
3648
3649 * xdisp.c (expose_window): Save original value of phys_cursor_on_p
3650 and turn window cursor on if cleared (Bug#9415).
3651
3652 2011-09-18 Andreas Schwab <schwab@linux-m68k.org>
3653
3654 * search.c (boyer_moore): Take unibyte characters from pattern
3655 literally. (Bug#9458)
3656
3657 2011-09-18 Eli Zaretskii <eliz@gnu.org>
3658
3659 * xdisp.c (reseat_at_next_visible_line_start): Fix last change.
3660
3661 2011-09-18 Paul Eggert <eggert@cs.ucla.edu>
3662
3663 Fix minor problem found by static checking.
3664 * xdisp.c (reseat_at_next_visible_line_start): Mark locals as
3665 initialized, to pacify gcc -Wuninitialized.
3666
3667 * fileio.c: Report proper errno when syscall falls.
3668 (Finsert_file_contents): Save and restore errno,
3669 so that report_file_error outputs the correct diagnostic.
3670 (Fwrite_region) [CLASH_DETECTION]: Likewise.
3671
3672 2011-09-18 Eli Zaretskii <eliz@gnu.org>
3673
3674 * .gdbinit (pgx): Fix references to fields of `struct glyph'.
3675
3676 2011-09-17 Eli Zaretskii <eliz@gnu.org>
3677
3678 * xdisp.c (produce_stretch_glyph): Another fix for changes made on
3679 2011-08-30T17:32:44Z!eliz@gnu.org. (Bug#9530)
3680
3681 2011-09-17 Eli Zaretskii <eliz@gnu.org>
3682
3683 * xdisp.c (reseat_at_next_visible_line_start): Keep information
3684 about the current paragraph and restore it after the call to reseat.
3685
3686 * bidi.c (MAX_PARAGRAPH_SEARCH): New macro.
3687 (bidi_find_paragraph_start): Search back for paragraph beginning
3688 at most MAX_PARAGRAPH_SEARCH lines; if not found, return BEGV_BYTE.
3689 (bidi_move_to_visually_next): Only trigger paragraph-related
3690 computations when the last character is a newline or at EOB, not
3691 just any NEUTRAL_B. (Bug#9470)
3692
3693 * xdisp.c (set_cursor_from_row): Don't invoke special treatment of
3694 truncated lines if point is covered by a display string. (Bug#9524)
3695
3696 2011-09-16 Paul Eggert <eggert@cs.ucla.edu>
3697
3698 * xselect.c: Relax test for outgoing X longs (Bug#9498).
3699 (cons_to_x_long): New function.
3700 (lisp_data_to_selection_data): Use it. Correct the test for
3701 short-versus-long data; it was negated. Break out of vector
3702 loop, for efficiency, when a long datum is discovered.
3703
3704 2011-09-16 Stefan Monnier <monnier@iro.umontreal.ca>
3705
3706 * eval.c (Fquote): Document its non-consing behavior (bug#9482).
3707
3708 2011-09-16 Eli Zaretskii <eliz@gnu.org>
3709
3710 * image.c (tiff_handler): Work around a bug in MinGW GCC 3.x (see
3711 GCC PR/17406) by declaring this function with external scope.
3712
3713 2011-09-15 Paul Eggert <eggert@cs.ucla.edu>
3714
3715 * editfns.c (Fformat): Fix bug in text-property fix (Bug#9514).
3716 Don't mishandle (length (format "%%")) and (format "%4000s%%" "").
3717
3718 2011-09-15 Andreas Schwab <schwab@linux-m68k.org>
3719
3720 * editfns.c (Fformat): Correctly handle text properties on "%%".
3721
3722 2011-09-15 Eli Zaretskii <eliz@gnu.org>
3723
3724 * xterm.c (x_draw_composite_glyph_string_foreground):
3725 * w32term.c (x_draw_composite_glyph_string_foreground):
3726 * term.c (encode_terminal_code):
3727 * composite.c (composition_update_it, get_composition_id):
3728 * xdisp.c (get_next_display_element)
3729 (fill_composite_glyph_string): Add comments about special meaning
3730 of TAB characters in a composition.
3731
3732 2011-09-15 Paul Eggert <eggert@cs.ucla.edu>
3733
3734 * editfns.c (Fformat): Fix off-by-1 bug for "%%b" (Bug#9514).
3735 This occurs when processing a multibyte format.
3736 Problem reported by Wolfgang Jenker.
3737
3738 2011-09-15 Johan Bockgård <bojohan@gnu.org>
3739
3740 * xdisp.c (try_cursor_movement): Only check for exact match if
3741 cursor hpos found by set_cursor_from_row is valid. (Bug#9495)
3742
3743 2011-09-14 Paul Eggert <eggert@cs.ucla.edu>
3744
3745 Remove unused external symbols.
3746 * dispextern.h (calc_pixel_width_or_height): Remove decl.
3747 * xdisp.c (calc_pixel_width_or_height): Now static.
3748 * doprnt.c (exprintf) [! (HAVE_X_WINDOWS && USE_X_TOOLKIT)]: Remove.
3749 * indent.c (check_display_width):
3750 * w32term.c: Fix comment to match code.
3751 * xterm.c, xterm.h (x_catching_errors): Remove.
3752
3753 2011-09-14 Paul Eggert <eggert@cs.ucla.edu>
3754
3755 * xselect.c: Use signed conversions more consistently (Bug#9498).
3756 (selection_data_to_lisp_data): Assume incoming selection data are
3757 signed integers, not unsigned. This is to be consistent with
3758 outgoing selection data, which was modified to use signed integers
3759 in as part of the fix to Bug#9196 in response to Jan D.'s comment
3760 in <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9196#32> that X11
3761 expects long, not unsigned long.
3762
3763 2011-09-14 Eli Zaretskii <eliz@gnu.org>
3764
3765 * xdisp.c (try_window_reusing_current_matrix): Fix incorrect
3766 computation of loop end. Reported by Johan Bockgård
3767 <bojohan@gnu.org>.
3768
3769 2011-09-13 Chong Yidong <cyd@stupidchicken.com>
3770
3771 * frame.c (Fother_visible_frames_p): Function deleted.
3772
3773 2011-09-12 Eli Zaretskii <eliz@gnu.org>
3774
3775 * indent.c (compute_motion): Process display vector front to back
3776 rather than the other way around. (Bug#2496)
3777
3778 2011-09-12 Stefan Monnier <monnier@iro.umontreal.ca>
3779
3780 * fileio.c (Finsert_file_contents): Don't assume beg_offset is 0.
3781
3782 2011-09-11 Chong Yidong <cyd@stupidchicken.com>
3783
3784 * minibuf.c (Fread_from_minibuffer): Doc fix.
3785
3786 2011-09-11 Eli Zaretskii <eliz@gnu.org>
3787
3788 * xdisp.c (produce_stretch_glyph): Fix a typo made in changes from
3789 2011-08-30T17:32:44Z!eliz@gnu.org. (Bug#9475)
3790
3791 2011-09-11 Lars Magne Ingebrigtsen <larsi@gnus.org>
3792
3793 * fileio.c (Fvisited_file_modtime): Document `(-1 65535)' as a
3794 value for non-existent files.
3795
3796 2011-09-11 Eli Zaretskii <eliz@gnu.org>
3797
3798 * fileio.c (Finsert_file_contents): If the file cannot be opened,
3799 set its "size" to -1. This will set the modtime_size field of
3800 the corresponding buffer to -1, which is what
3801 verify-visited-file-modtime expects for files that do not exist.
3802 (Bug#9139)
3803
3804 2011-09-11 Paul Eggert <eggert@cs.ucla.edu>
3805
3806 * keymap.h (KEY_DESCRIPTION_SIZE, push_key_description): Move decls
3807 here ...
3808 * lisp.h: ... from here. push_key_description is no longer
3809 defined in keyboard.c, so its declaration should not be in
3810 lisp.h's "Defined in keyboard.c" section, and KEY_DESCRIPTION_SIZE
3811 logically belongs with push_key_description.
3812
3813 2011-09-10 Paul Eggert <eggert@cs.ucla.edu>
3814
3815 * buffer.h: Include <sys/types.h> instead of <time.h>.
3816 Otherwise, off_t wasn't defined on FreeBSD 9.0-BETA2 i386.
3817 Problem reported by Herbert J. Skuhra.
3818
3819 2011-09-10 Lars Magne Ingebrigtsen <larsi@gnus.org>
3820
3821 * xml.c (parse_region): Make the parsing work for
3822 non-comment-starting XML files again (bug#9144).
3823
3824 2011-09-10 Andreas Schwab <schwab@linux-m68k.org>
3825
3826 * image.c (gif_load): Fix calculation of bottom and right corner.
3827 (Bug#9468)
3828
3829 2011-09-10 Eli Zaretskii <eliz@gnu.org>
3830
3831 * xdisp.c (MAX_DISP_SCAN): Decrease to 250. Prevents sluggish
3832 redisplay in small windows.
3833
3834 2011-09-09 Eli Zaretskii <eliz@gnu.org>
3835
3836 * frame.c (x_report_frame_params): Cast to avoid compiler warnings.
3837
3838 2011-09-08 Martin Rudalics <rudalics@gmx.at>
3839
3840 * window.c (Fset_window_prev_buffers, Fset_window_next_buffers):
3841 Operate on live windows only.
3842
3843 2011-09-08 Juanma Barranquero <lekktu@gmail.com>
3844
3845 * emacs.c (my_heap_start): #ifdef to avoid warnings when unused.
3846
3847 2011-09-07 Eli Zaretskii <eliz@gnu.org>
3848
3849 * xdisp.c (move_it_in_display_line_to): Call RESTORE_IT on ppos_it
3850 only under bidi iteration.
3851
3852 2011-09-07 Jan Djärv <jan.h.d@swipnet.se>
3853
3854 * gtkutil.c (xg_make_tool_item): Insert comment about eventbox.
3855
3856 2011-09-06 Paul Eggert <eggert@cs.ucla.edu>
3857
3858 isnan: Fix porting problem to Solaris 10 with bundled gcc.
3859 Without this fix, the command to link temacs failed due to an
3860 undefined symbol __builtin_isnan. This is because
3861 /usr/include/iso/math_c99.h #defines isnan(x) to
3862 __builtin_isnan(x), but the bundled gcc, which identifies itself
3863 as gcc 3.4.3 (csl-sol210-3_4-branch+sol_rpath), does not have
3864 a __builtin_isnan.
3865 * floatfns.c (isnan): #undef, and then #define to a clone of
3866 what's in data.c.
3867 (Fisnan): Always define, since it's always available now.
3868 (syms_of_floatfns): Always define isnan at the Lisp level.
3869
3870 2011-09-06 Paul Eggert <eggert@cs.ucla.edu>
3871
3872 * Makefile.in (gl-stamp): move-if-change now in build-aux (Bug#9169).
3873
3874 2011-09-06 Paul Eggert <eggert@cs.ucla.edu>
3875
3876 * fileio.c: Fix bugs with large file offsets (Bug#9428).
3877 The previous code assumed that file offsets (off_t values) fit in
3878 EMACS_INT variables, which is not true on typical 32-bit hosts.
3879 The code messed up by falsely reporting buffer overflow in cases
3880 such as (insert-file-contents "big" nil 1 2) into an empty buffer
3881 when "big" contains more than 2**29 bytes, even though this
3882 inserts just one byte and does not overflow the buffer.
3883 (Finsert_file_contents): Store file offsets as off_t
3884 values, not as EMACS_INT values. Check for overflow when
3885 converting between EMACS_INT and off_t. When checking for
3886 buffer overflow or for overlap, take the offsets into account.
3887 Don't use EMACS_INT for small values where int suffices.
3888 When checking for overlap, fix a typo: ZV was used where
3889 ZV_BYTE was intended.
3890 (Fwrite_region): Don't assume off_t fits into 'long'.
3891 * buffer.h (struct buffer.modtime_size): Now off_t, not EMACS_INT.
3892
3893 2011-09-05 Michael Albinus <michael.albinus@gmx.de>
3894
3895 * dbusbind.c (xd_signature_cat): Rename from signature_cat.
3896
3897 2011-09-04 Paul Eggert <eggert@cs.ucla.edu>
3898
3899 sprintf-related integer and memory overflow issues (Bug#9412).
3900
3901 * doprnt.c (doprnt): Support printing ptrdiff_t and intmax_t values.
3902 (esprintf, exprintf, evxprintf): New functions.
3903 * keyboard.c (command_loop_level): Now EMACS_INT, not int.
3904 (cmd_error): Kbd macro iterations count is now EMACS_INT, not int.
3905 (modify_event_symbol): Do not assume that the length of
3906 name_alist_or_stem is safe to alloca and fits in int.
3907 (Fexecute_extended_command): Likewise for function name and binding.
3908 (Frecursion_depth): Wrap around reliably on integer overflow.
3909 * keymap.c (push_key_description): First arg is now EMACS_INT, not int,
3910 since some callers pass EMACS_INT values.
3911 (Fsingle_key_description): Don't crash if symbol name contains more
3912 than MAX_ALLOCA bytes.
3913 * minibuf.c (minibuf_level): Now EMACS_INT, not int.
3914 (get_minibuffer): Arg is now EMACS_INT, not int.
3915 * lisp.h (get_minibuffer, push_key_description): Reflect API changes.
3916 (esprintf, exprintf, evxprintf): New decls.
3917 * window.h (command_loop_level, minibuf_level): Reflect API changes.
3918
3919 * dbusbind.c (signature_cat): New function.
3920 (xd_signature, Fdbus_register_signal):
3921 Do not overrun buffer; instead, report string overflow.
3922
3923 * dispnew.c (add_window_display_history): Don't overrun buffer.
3924 Truncate instead; this is OK since it's just a log.
3925
3926 * editfns.c (Fcurrent_time_zone): Don't overrun buffer
3927 even if the time zone offset is outlandishly large.
3928 Don't mishandle offset == INT_MIN.
3929
3930 * emacs.c (main) [NS_IMPL_COCOA]: Don't overrun buffer
3931 when creating daemon; the previous buffer-overflow check was incorrect.
3932
3933 * eval.c (verror): Simplify by rewriting in terms of evxprintf,
3934 which has the guts of the old verror function.
3935
3936 * filelock.c (lock_file_1, lock_file): Don't blindly alloca long name;
3937 use SAFE_ALLOCA instead. Use esprintf to avoid int-overflow issues.
3938
3939 * font.c: Include <float.h>, for DBL_MAX_10_EXP.
3940 (font_unparse_xlfd): Don't blindly alloca long strings.
3941 Don't assume XINT result fits in int, or that XFLOAT_DATA * 10
3942 fits in int, when using sprintf. Use single snprintf to count
3943 length of string rather than counting it via multiple sprintfs;
3944 that's simpler and more reliable.
3945 (font_unparse_fcname): Use it to avoid sprintf buffer overrun.
3946 (generate_otf_features) [0 && HAVE_LIBOTF]: Use esprintf, not
3947 sprintf, in case result does not fit in int.
3948
3949 * fontset.c (num_auto_fontsets): Now printmax_t, not int.
3950 (fontset_from_font): Print it.
3951
3952 * frame.c (tty_frame_count): Now printmax_t, not int.
3953 (make_terminal_frame, set_term_frame_name): Print it.
3954 (x_report_frame_params): In X, window IDs are unsigned long,
3955 not signed long, so print them as unsigned.
3956 (validate_x_resource_name): Check for implausibly long names,
3957 and don't assume name length fits in 'int'.
3958 (x_get_resource_string): Don't blindly alloca invocation name;
3959 use SAFE_ALLOCA. Use esprintf, not sprintf, in case result does
3960 not fit in int.
3961
3962 * gtkutil.c: Include <float.h>, for DBL_MAX_10_EXP.
3963 (xg_check_special_colors, xg_set_geometry):
3964 Make sprintf buffers a bit bigger, to avoid potential buffer overrun.
3965
3966 * lread.c (dir_warning): Don't blindly alloca buffer; use SAFE_ALLOCA.
3967 Use esprintf, not sprintf, in case result does not fit in int.
3968
3969 * macros.c (executing_kbd_macro_iterations): Now EMACS_INT, not int.
3970 (Fend_kbd_macro): Don't mishandle MOST_NEGATIVE_FIXNUM by treating
3971 it as a large positive number.
3972 (Fexecute_kbd_macro): Don't assume repeat count fits in int.
3973 * macros.h (executing_kbd_macro_iterations): Now EMACS_INT, not int.
3974
3975 * nsterm.m ((NSSize)windowWillResize): Use esprintf, not sprintf,
3976 in case result does not fit in int.
3977
3978 * print.c (float_to_string): Detect width overflow more reliably.
3979 (print_object): Make sprintf buffer a bit bigger, to avoid potential
3980 buffer overrun. Don't assume list length fits in 'int'. Treat
3981 print length of 0 as 0, not as infinity; to be consistent with other
3982 uses of print length in this function. Don't overflow print length
3983 index. Don't assume hash table size fits in 'long', or that
3984 vectorlike size fits in 'unsigned long'.
3985
3986 * process.c (make_process): Use printmax_t, not int, to format
3987 process-name gensyms.
3988
3989 * sysdep.c (snprintf) [! HAVE_SNPRINTF]: New function.
3990
3991 * term.c (produce_glyphless_glyph): Make sprintf buffer a bit bigger
3992 to avoid potential buffer overrun.
3993
3994 * xfaces.c (x_update_menu_appearance): Don't overrun buffer
3995 if X resource line is longer than 512 bytes.
3996
3997 * xfns.c (x_window): Make sprintf buffer a bit bigger
3998 to avoid potential buffer overrun.
3999
4000 * xterm.c (x_io_error_quitter): Don't overrun sprintf buffer.
4001
4002 * xterm.h (x_check_errors): Add ATTRIBUTE_FORMAT_PRINTF.
4003
4004 2011-09-04 Paul Eggert <eggert@cs.ucla.edu>
4005
4006 Integer overflow fixes for scrolling, etc.
4007 Without these, Emacs silently mishandles large integers sometimes.
4008 For example, "C-u 4294967297 M-x recenter" was treated as if
4009 it were "C-u 1 M-x recenter" on a typical 64-bit host.
4010
4011 * xdisp.c (try_window_id): Check Emacs fixnum range before
4012 converting to 'int'.
4013
4014 * window.c (window_scroll_line_based, Frecenter):
4015 Check that an Emacs fixnum is in range before assigning it to 'int'.
4016 (Frecenter, Fmove_to_window_line): Use EMACS_INT, not int, for
4017 values converted from Emacs fixnums.
4018 (Frecenter): Don't wrap around a line count if it is out of 'int'
4019 range; instead, treat it as an extreme value.
4020 (Fset_window_configuration, compare_window_configurations):
4021 Use ptrdiff_t, not int, for index that might exceed 2 GiB.
4022
4023 * search.c (Freplace_match): Use ptrdiff_t, not int, for indexes
4024 that can exceed INT_MAX. Check that EMACS_INT value is in range
4025 before assigning it to the (possibly-narrower) index.
4026 (match_limit): Don't assume that a fixnum can fit in 'int'.
4027
4028 * print.c (print_object): Use ptrdiff_t, not int, for index that can
4029 exceed INT_MAX.
4030
4031 * indent.c (position_indentation): Now takes ptrdiff_t, not int.
4032 (Fvertical_motion): Don't wrap around LINES values that don't fit
4033 in 'int'. Instead, treat them as extreme values. This is good
4034 enough for windows, which can't have more than INT_MAX lines anyway.
4035
4036 2011-09-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
4037
4038 * Require libxml/parser.h to avoid compilation warning.
4039
4040 * emacs.c (shut_down_emacs): Call xmlCleanupParser on shutdown.
4041
4042 * xml.c (parse_region): Don't call xmlCleanupParser after parsing,
4043 since this reportedly can destroy thread storage.
4044
4045 2011-08-30 Chong Yidong <cyd@stupidchicken.com>
4046
4047 * syntax.c (find_defun_start): Update all cache variables if
4048 exiting early (Bug#9401).
4049
4050 2011-08-30 Eli Zaretskii <eliz@gnu.org>
4051
4052 * image.c (x_bitmap_pixmap): Cast to int to avoid compiler warnings.
4053
4054 * xdisp.c (produce_stretch_glyph): No longer static, compiled also
4055 when HAVE_WINDOW_SYSTEM is not defined. Support both GUI and TTY
4056 frames. Call tty_append_glyph in the TTY case. (Bug#9402)
4057
4058 * term.c (tty_append_glyph): New function.
4059 (produce_stretch_glyph): Static function and its prototype deleted.
4060
4061 * dispextern.h (produce_stretch_glyph, tty_append_glyph):
4062 Add prototypes.
4063
4064 2011-08-29 Paul Eggert <eggert@cs.ucla.edu>
4065
4066 * image.c (parse_image_spec): Check for nonnegative, not for positive,
4067 when checking :margin (Bug#9390).
4068 (IMAGE_NON_NEGATIVE_INTEGER_VALUE_OR_PAIR):
4069 Rename from IMAGE_POSITIVE_INTEGER_VALUE_OR_PAIR,
4070 so that the name doesn't mislead. All uses changed.
4071
4072 2011-08-28 Johan Bockgård <bojohan@gnu.org>
4073
4074 * term.c (init_tty) [HAVE_GPM]: Move mouse settings after
4075 set_tty_hooks.
4076
4077 2011-08-27 Eli Zaretskii <eliz@gnu.org>
4078
4079 * xdisp.c (move_it_to): Don't bail out early when reaching
4080 position beyond to_charpos, if we are scanning backwards.
4081 (move_it_vertically_backward): When DY == 0, make sure we get to
4082 the first character in the line after the newline.
4083
4084 2011-08-27 Paul Eggert <eggert@cs.ucla.edu>
4085
4086 * ccl.c: Improve and simplify overflow checking (Bug#9196).
4087 (ccl_driver): Do not generate an out-of-range pointer.
4088 (Fccl_execute_on_string): Remove unnecessary check for
4089 integer overflow, noted by Stefan Monnier in
4090 <http://lists.gnu.org/archive/html/emacs-devel/2011-08/msg00979.html>.
4091 Remove a FIXME that didn't need fixing.
4092 Simplify the newly-introduced buffer reallocation code.
4093
4094 2011-08-27 Juanma Barranquero <lekktu@gmail.com>
4095
4096 * makefile.w32-in ($(BLD)/alloc.$(O)): Depend on lib/verify.h.
4097
4098 2011-08-26 Paul Eggert <eggert@cs.ucla.edu>
4099
4100 Integer and memory overflow issues (Bug#9196).
4101
4102 * doc.c (get_doc_string): Rework so that
4103 get_doc_string_buffer_size is the actual buffer size, rather than
4104 being 1 less than the actual buffer size; this makes xpalloc more
4105 convenient.
4106
4107 * image.c (x_allocate_bitmap_record, cache_image):
4108 * xselect.c (Fx_register_dnd_atom):
4109 Simplify previous changes by using xpalloc.
4110
4111 * buffer.c (overlay_str_len): Now ptrdiff_t, not EMACS_INT,
4112 since either will do and ptrdiff_t is convenient with xpalloc.
4113
4114 * charset.c (charset_table_size)
4115 (struct charset_sort_data.priority): Now ptrdiff_t.
4116 (charset_compare): Don't overflow if priorities differ greatly.
4117 (Fsort_charsets): Don't assume list length fits in int.
4118 Check for size-calculation overflow when allocating sort data.
4119 (syms_of_charset): Allocate an initial charset table that is
4120 just under 64 KiB, to avoid problems with glibc malloc and mmap.
4121
4122 * cmds.c (internal_self_insert): Check for size-calculation overflow.
4123
4124 * composite.h (struct composition.glyph_len): Now int, not unsigned.
4125 The actual value is always <= INT_MAX, and leaving it unsigned made
4126 overflow checking harder.
4127
4128 * dispextern.h (struct glyph_matrix.rows_allocated)
4129 (struct face_cache.size): Now ptrdiff_t, for convenience in use
4130 with xpalloc. The values are still always <= INT_MAX.
4131
4132 * indent.c (compute_motion): Adjust to region_cache_forward sig change.
4133
4134 * lisp.h (xnmalloc, xnrealloc, xpalloc): New decls.
4135 (SAFE_NALLOCA): New macro.
4136
4137 * region-cache.c (struct boundary.pos, find_cache_boundary)
4138 (move_cache_gap, insert_cache_boundary, delete_cache_boundaries)
4139 (set_cache_region, invalidate_region_cache)
4140 (revalidate_region_cache, know_region_cache, region_cache_forward)
4141 (region_cache_backward, pp_cache):
4142 Use ptrdiff_t, not EMACS_INT, since either will do. This is needed
4143 so that ptrdiff_t * can be passed to xpalloc.
4144 (struct region_cache): Similarly, for gap_start, gap_len, cache_len,
4145 beg_unchanged, end_unchanged, buffer_beg, buffer_end members.
4146 (pp_cache): Don't assume cache_len fits in int.
4147 * region-cache.h: Adjust extern decls to match.
4148
4149 * search.c (scan_buffer, Freplace_match): Use ptrdiff_t, not
4150 EMACS_INT, since either will do, for xpalloc.
4151
4152 * alloc.c: Include verify.h, and check that int fits in ptrdiff_t.
4153 (xnmalloc, xnrealloc, xpalloc): New functions.
4154
4155 * bidi.c (bidi_shelve_header_size): New constant.
4156 (bidi_cache_ensure_space, bidi_shelve_cache): Use it.
4157 (bidi_cache_ensure_space): Avoid integer overflow when allocating.
4158
4159 * bidi.c (bidi_cache_shrink):
4160 * buffer.c (overlays_at, overlays_in, record_overlay_string)
4161 (overlay_strings):
4162 Don't update size of array until after memory allocation succeeds,
4163 because xmalloc/xrealloc may not return.
4164 (struct sortstrlist.bytes): Now ptrdiff_t, as EMACS_INT doesn't help
4165 now that we have proper integer overflow checking.
4166 (record_overlay_string, overlay_strings): Catch overflows when
4167 calculating size of overlay_str_buf.
4168
4169 * callproc.c (Fcall_process): Check for size overflow when
4170 calculating size of args2.
4171 (child_setup): Avoid overflow by using size_t rather than ptrdiff_t.
4172 Normally we prefer signed values, but sticking with ptrdiff_t would
4173 require adding more-complicated checks.
4174
4175 * ccl.c (Fccl_execute_on_string): Check for memory overflow.
4176 Use ptrdiff_t rather than EMACS_INT where ptrdiff_t will do.
4177 Redo buffer-overflow calculations to avoid integer overflow.
4178 Add a FIXME comment where memory seems to be over-allocated.
4179
4180 * character.c (Fstring): Check for size-calculation overflow.
4181
4182 * coding.c (produce_chars): Redo buffer-overflow calculations to avoid
4183 unnecessary integer overflow. Check for size overflow.
4184 (encode_coding_object): Don't update size until xmalloc succeeds.
4185
4186 * composite.c (get_composition_id): Check for overflow in glyph
4187 length calculations.
4188
4189 Integer and memory overflow fixes for display code.
4190 * dispextern.h (struct glyph_pool.nglyphs): Now ptrdiff_t, not int.
4191 * dispnew.c (adjust_glyph_matrix, realloc_glyph_pool)
4192 (scrolling_window): Check for overflow in size calculations.
4193 (line_draw_cost, realloc_glyph_pool, add_row_entry):
4194 Don't assume glyph table len fits in int.
4195 (struct row_entry.bucket, row_entry_pool_size, row_entry_idx)
4196 (row_table_size): Now ptrdiff_t, not int.
4197 (scrolling_window): Avoid overflow in size calculations.
4198 Don't update size until allocation succeeds.
4199 * fns.c (concat): Check for overflow in size calculations.
4200 (next_almost_prime): Verify NEXT_ALMOST_PRIME_LIMIT.
4201 * lisp.h (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): New macros.
4202 (NEXT_ALMOST_PRIME_LIMIT): New constant.
4203
4204 * doc.c (get_doc_string_buffer_size): Now ptrdiff_t, not int.
4205 (get_doc_string): Check for size calculation overflow.
4206 Don't update size until allocation succeeds.
4207 (get_doc_string, Fsubstitute_command_keys): Use ptrdiff_t, not
4208 EMACS_INT, where ptrdiff_t will do.
4209 (Fsubstitute_command_keys): Check for string overflow.
4210
4211 * editfns.c (set_time_zone_rule): Don't assume environment length
4212 fits in int.
4213 (message_length): Now ptrdiff_t, not int.
4214 (Fmessage_box): Don't update size until allocation succeeds.
4215 Don't assume message length fits in int.
4216 (Fformat): Use ptrdiff_t, not EMACS_INT, where ptrdiff_t will do.
4217
4218 * emacs.c (main): Do not reallocate argv, since there is a null at
4219 the end that can be overwritten, and this way there's no need to
4220 worry about size-calculation overflow.
4221 (sort_args): Check for size-calculation overflow.
4222
4223 * eval.c (init_eval_once, grow_specpdl): Don't update size until
4224 alloc succeeds.
4225 (call_debugger, grow_specpdl): Redo calculations to avoid overflow.
4226
4227 * frame.c (set_menu_bar_lines, x_set_frame_parameters)
4228 (x_set_scroll_bar_width, x_figure_window_size):
4229 Check for integer overflow.
4230 (x_set_alpha): Do not assume XINT fits in int.
4231
4232 * frame.h (struct frame): Use int, not EMACS_INT, where int works.
4233 This is for the members text_lines, text_cols, total_lines, total_cols,
4234 where the system imposes an 'int' limit.
4235
4236 * fringe.c (Fdefine_fringe_bitmap):
4237 Don't update size until alloc works.
4238
4239 * ftfont.c (ftfont_get_open_type_spec, setup_otf_gstring)
4240 (ftfont_shape_by_flt): Check for integer overflow in size calculations.
4241
4242 * gtkutil.c (get_utf8_string, xg_store_widget_in_map):
4243 Check for size-calculation overflow.
4244 (get_utf8_string): Use ptrdiff_t, not size_t, where either will
4245 do, as we prefer signed integers.
4246 (id_to_widget.max_size, id_to_widget.used)
4247 (xg_store_widget_in_map, xg_remove_widget_from_map)
4248 (xg_get_widget_from_map, xg_get_scroll_id_for_window)
4249 (xg_remove_scroll_bar, xg_update_scrollbar_pos):
4250 Use and return ptrdiff_t, not int.
4251 (xg_gtk_scroll_destroy): Don't assume ptrdiff_t fits in int.
4252 * gtkutil.h: Change prototypes to match the above.
4253
4254 * image.c (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): Remove; these
4255 are duplicate now that they've been promoted to lisp.h.
4256 (x_allocate_bitmap_record, x_alloc_image_color)
4257 (make_image_cache, cache_image, xpm_load):
4258 Don't update size until alloc is done.
4259 (xpm_load, lookup_rgb_color, lookup_pixel_color, x_to_xcolors)
4260 (x_detect_edges):
4261 Check for size calculation overflow.
4262 (ct_colors_allocated_max): New constant.
4263 (x_to_xcolors, x_detect_edges): Reorder multiplicands to avoid
4264 overflow.
4265
4266 * keyboard.c (read_char, menu_bar_items, tool_bar_items)
4267 (read_char_x_menu_prompt, read_char_minibuf_menu_width)
4268 (read_char_minibuf_menu_prompt, follow_key, read_key_sequence):
4269 Use ptrdiff_t, not int, to count maps.
4270 (read_char_minibuf_menu_prompt): Check for overflow in size
4271 calculations. Don't update size until allocation succeeds.
4272 Redo calculations to avoid overflow.
4273 * keyboard.h: Change prototypes to match the above.
4274
4275 * keymap.c (cmm_size, current_minor_maps): Use ptrdiff_t, not int,
4276 to count maps.
4277 (current_minor_maps): Check for size calculation overflow.
4278 * keymap.h: Change prototypes to match the above.
4279
4280 * lread.c (read1, init_obarray): Don't update size until alloc done.
4281
4282 * macros.c (Fstart_kbd_macro): Don't update size until alloc done.
4283 (store_kbd_macro_char): Reorder multiplicands to avoid overflow.
4284
4285 * nsterm.h (struct ns_color_table.size, struct ns_color_table.avail):
4286 Now ptrdiff_t, not int.
4287 * nsterm.m (ns_index_color): Use ptrdiff_t, not int, for table indexes.
4288 (ns_draw_fringe_bitmap): Rewrite to avoid overflow.
4289
4290 * process.c (Fnetwork_interface_list): Check for overflow
4291 in size calculation.
4292
4293 * region-cache.c (move_cache_gap): Check for size calculation overflow.
4294
4295 * scroll.c (do_line_insertion_deletion_costs): Check for size calc
4296 overflow. Don't bother calling xmalloc when xrealloc will do.
4297
4298 * search.c (Freplace_match): Check for size calculation overflow.
4299 (Fset_match_data): Don't assume list lengths fit in 'int'.
4300
4301 * sysdep.c (system_process_attributes): Use ptrdiff_t, not int,
4302 for command line length. Do not attempt to address one before the
4303 beginning of an array, as that's not portable.
4304
4305 * term.c (max_frame_lines): Remove; unused.
4306 (encode_terminal_src_size, encode_terminal_dst_size): Now ptrdiff_t,
4307 not int.
4308 (encode_terminal_code, calculate_costs): Check for size
4309 calculation overflow.
4310 (encode_terminal_code): Use ptrdiff_t, not int, to record glyph
4311 table lengths and related sizes. Don't update size until alloc
4312 done. Redo calculations to avoid overflow.
4313 (calculate_costs): Don't bother calling xmalloc when xrealloc will do.
4314
4315 * termcap.c (tgetent): Use ptrdiff_t, not int, to record results of
4316 subtracting pointers.
4317 (gobble_line): Check for overflow more carefully. Don't update size
4318 until alloc done.
4319
4320 * tparam.c (tparam1): Use ptrdiff_t, not int, for sizes.
4321 Don't update size until alloc done.
4322 Redo size calculations to avoid overflow.
4323 Check for size calculation overflow.
4324 (main) [DEBUG]: Fix typo in invoking tparam1.
4325
4326 * xdisp.c (store_mode_line_noprop_char, x_consider_frame_title):
4327 Use ptrdiff_t, not int, for sizes.
4328 (store_mode_line_noprop_char): Don't update size until alloc done.
4329
4330 * xfaces.c (lface_id_to_name_size, Finternal_make_lisp_face):
4331 Use ptrdiff_t, not int, for sizes.
4332 (Finternal_make_lisp_face, cache_face):
4333 Check for size calculation overflow.
4334 (cache_face): Treat size calculation overflows as if they were
4335 memory exhaustion (the usual treatment), rather than aborting.
4336
4337 * xfns.c (x_encode_text, x_set_name_internal)
4338 (Fx_change_window_property): Use ptrdiff_t, not int, to count
4339 sizes, since they can exceed INT_MAX in size. Check for size
4340 calculation overflow.
4341
4342 * xgselect.c (gfds_size): Now ptrdiff_t, for convenience with xpalloc.
4343 (xg_select): Check for size calculation overflow.
4344 Don't update size until alloc done.
4345
4346 * xrdb.c (get_environ_db): Don't assume path length fits in int,
4347 as sprintf is limited to int lengths.
4348
4349 * xselect.c (X_LONG_SIZE, X_SHRT_MAX, X_SHRT_MIN, X_LONG_MAX)
4350 (X_LONG_MIN): New macros.
4351 Use them to make the following changes clearer.
4352 (MAX_SELECTION_QUANTUM): Make the other bounds on this value clearer.
4353 This change doesn't affect the value now, but it may help remind
4354 future maintainers not to raise the value too much later.
4355 (SELECTION_QUANTUM): Remove, replacing with ...
4356 (selection_quantum): ... new function, which avoids overflow.
4357 All uses changed.
4358 (struct selection_data.size): Now ptrdiff_t, not int, to avoid
4359 assumption that selection length fits in 'int'.
4360 (x_reply_selection_request, x_handle_selection_request)
4361 (x_get_window_property, receive_incremental_selection)
4362 (x_get_window_property_as_lisp_data, selection_data_to_lisp_data)
4363 (lisp_data_to_selection_data, clean_local_selection_data):
4364 Use ptrdiff_t, not int, to record length of selection.
4365 (x_reply_selection_request, x_get_window_property)
4366 (receive_incremental_selection, x_property_data_to_lisp):
4367 Redo calculations to avoid overflow.
4368 (x_reply_selection_request): When sending hint, ceiling it at
4369 X_LONG_MAX rather than relying on wraparound overflow to send
4370 something.
4371 (x_get_window_property, receive_incremental_selection)
4372 (lisp_data_to_selection_data, x_property_data_to_lisp):
4373 Check for size-calculation overflow.
4374 (x_get_window_property, receive_incremental_selection)
4375 (lisp_data_to_selection_data, Fx_register_dnd_atom):
4376 Don't store size until memory allocation succeeds.
4377 (x_get_window_property): Plug memory leak on memory exhaustion.
4378 Don't double-block input; malloc is safe here. Don't assume 2**34
4379 - 4 fits in unsigned long. Add an xassert to check
4380 XGetWindowProperty overflow. Be more careful about overflow
4381 calculations, and distinguish size from memory overflow better.
4382 (receive_incremental_selection): When tracing, don't assume
4383 unsigned int is less than INT_MAX.
4384 (x_selection_data_to_lisp_data): Remove unnecessary (and in theory
4385 harmful) conversions of unsigned short to int.
4386 (lisp_data_to_selection_data): Don't assume that integers
4387 in the range -65535 through -1 fit in an X unsigned short.
4388 Don't assume that ULONG_MAX == X_ULONG_MAX. Don't store into
4389 result parameters unless successful. Rely on cons_to_unsigned
4390 to report problems with elements; the old code wasn't right anyway.
4391 (x_check_property_data): Check for int overflow; we cannot use
4392 a wider type due to X limits.
4393 (x_handle_dnd_message): Use unsigned int, to avoid int overflow.
4394
4395 * xsmfns.c (smc_save_yourself_CB): Check for size calc overflow.
4396
4397 * xterm.c (x_color_cells, x_send_scrollbar_event, handle_one_xevent)
4398 (x_term_init): Check for size calculation overflow.
4399 (x_color_cells): Don't store size until memory allocation succeeds.
4400 (handle_one_xevent): Use ptrdiff_t, not int, for byte counts.
4401 Don't assume alloca size is less than MAX_ALLOCA.
4402 (x_term_init): Don't assume length fits in int (sprintf is limited
4403 to int size).
4404
4405 Use ptrdiff_t for composition IDs.
4406 * character.c (lisp_string_width):
4407 * composite.c (composition_table_size, n_compositions)
4408 (get_composition_id, composition_gstring_from_id):
4409 * dispextern.h (struct glyph_string.cmp_id, struct composition_it.id):
4410 * xdisp.c (BUILD_COMPOSITE_GLYPH_STRING):
4411 * window.c (Frecenter):
4412 Use ptrdiff_t, not int, for composition IDs.
4413 * composite.c (get_composition_id): Check for integer overflow.
4414 * composite.h: Adjust prototypes to match the above changes.
4415
4416 Use ptrdiff_t for hash table indexes.
4417 * category.c (hash_get_category_set):
4418 * ccl.c (ccl_driver):
4419 * charset.h (struct charset.hash_index, CHECK_CHARSET_GET_ID):
4420 * coding.c (coding_system_charset_list, detect_coding_system):
4421 * coding.h (struct coding_system.id):
4422 * composite.c (get_composition_id, gstring_lookup_cache):
4423 * fns.c (hash_lookup, hash_put, Fgethash, Fputhash):
4424 * image.c (xpm_get_color_table_h):
4425 * lisp.h (hash_lookup, hash_put):
4426 * minibuf.c (Ftest_completion):
4427 Use ptrdiff_t for hash table indexes, not int (which is too
4428 narrow, on 64-bit hosts) or EMACS_INT (which is too wide, on
4429 32-bit --with-wide-int hosts).
4430
4431 * charset.c (Fdefine_charset_internal): Check for integer overflow.
4432 Add a FIXME comment about memory leaks.
4433 (syms_of_charset): Don't assume xmalloc returns.
4434
4435 Don't assume that stated character widths fit in int.
4436 * character.c (Fchar_width, c_string_width, lisp_string_width):
4437 * character.h (CHAR_WIDTH):
4438 * indent.c (MULTIBYTE_BYTES_WIDTH):
4439 Use sanitize_char_width to avoid undefined and/or bad behavior
4440 with outlandish widths.
4441 * character.h (sanitize_tab_width): Rename from sanitize_width,
4442 now that we have two such functions. All uses changed.
4443 (sanitize_char_width): New inline function.
4444
4445 Don't assume that tab-width fits in int.
4446 * character.h (sanitize_width): New inline function.
4447 (SANE_TAB_WIDTH): New macro.
4448 (ASCII_CHAR_WIDTH): Use it.
4449 * indent.c (sane_tab_width): Remove. All uses replaced by
4450 SANE_TAB_WIDTH (current_buffer).
4451 * xdisp.c (init_iterator): Use SANE_TAB_WIDTH.
4452
4453 * fileio.c: Integer overflow issues with file modes.
4454 (Fset_file_modes, auto_save_1): Don't assume EMACS_INT fits in int.
4455
4456 * charset.c (read_hex): New arg OVERFLOW. All uses changed.
4457 Remove unreachable code.
4458 (read_hex, load_charset_map_from_file): Check for integer overflow.
4459
4460 * xterm.c: Don't go over XClientMessageEvent limit.
4461 (scroll_bar_windows_size): Now ptrdiff_t, as we prefer signed.
4462 (x_send_scroll_bar_event): Likewise. Check that the size does not
4463 exceed limits imposed by XClientMessageEvent, as well as the usual
4464 ptrdiff_t and size_t limits.
4465
4466 * keyboard.c: Overflow, signedness and related fixes.
4467 (make_lispy_movement): Use same integer type in forward decl
4468 that is used in the definition.
4469 (read_key_sequence, keyremap_step):
4470 Change bufsize argument back to int, undoing my 2011-03-30 change.
4471 We prefer signed types, and int is wide enough here.
4472 (parse_tool_bar_item): Don't assume tool_bar_max_label_size is less
4473 than TYPE_MAXIMUM (EMACS_INT) / 2. Don't let the label size grow
4474 larger than STRING_BYTES_BOUND. Use ptrdiff_t for Emacs string
4475 length, not size_t. Use ptrdiff_t for index, not int.
4476 (keyremap_step, read_key_sequence): Redo bufsize check to avoid
4477 possibility of integer overflow.
4478
4479 Overflow, signedness and related fixes for images.
4480
4481 * dispextern.h (struct it.stack[0].u.image.image_id)
4482 (struct_it.image_id, struct image.id, struct image_cache.size)
4483 (struct image_cache.used, struct image_cache.ref_count):
4484 * gtkutil.c (update_frame_tool_bar):
4485 * image.c (x_reference_bitmap, Fimage_size, Fimage_mask_p)
4486 (Fimage_metadata, free_image_cache, clear_image_cache, lookup_image)
4487 (cache_image, mark_image_cache, x_kill_gs_process, Flookup_image):
4488 * nsmenu.m (update_frame_tool_bar):
4489 * xdisp.c (calc_pixel_width_or_height):
4490 * xfns.c (image_cache_refcount):
4491 Image IDs are now ptrdiff_t, not int, to avoid arbitrary limits
4492 on typical 64-bit hosts.
4493
4494 * image.c (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): New macros.
4495 (x_bitmap_pixmap, x_create_x_image_and_pixmap):
4496 Omit unnecessary casts to int.
4497 (parse_image_spec): Check that integers fall into 'int' range
4498 when the callers expect that.
4499 (image_ascent): Redo ascent calculation to avoid int overflow.
4500 (clear_image_cache): Avoid overflow when sqrt (INT_MAX) < nimages.
4501 (lookup_image): Remove unnecessary tests.
4502 (xbm_image_p): Locals are now of int, not EMACS_INT,
4503 since parse_image_check makes sure they fit into int.
4504 (png_load, gif_load, svg_load_image):
4505 Prefer int to unsigned where either will do.
4506 (tiff_handler): New function, combining the cores of the
4507 old tiff_error_handler and tiff_warning_handler.
4508 This function is rewritten to use vsnprintf and thereby avoid
4509 stack buffer overflows. It uses only the features of vsnprintf
4510 that are common to both POSIX and native Microsoft.
4511 (tiff_error_handler, tiff_warning_handler): Use it.
4512 (tiff_load, gif_load, imagemagick_load_image):
4513 Don't assume :index value fits in 'int'.
4514 (gif_load): Omit unnecessary cast to double, and avoid double-rounding.
4515 (imagemagick_load_image): Check that crop parameters fit into
4516 the integer types that MagickCropImage accepts. Don't assume
4517 Vimagemagick_render_type has a nonnegative value. Don't assume
4518 size_t fits in 'long'.
4519 (gs_load): Use printmax_t to print the widest integers possible.
4520 Check for integer overflow when computing image height and width.
4521
4522 2011-08-26 Eli Zaretskii <eliz@gnu.org>
4523
4524 * xdisp.c (redisplay_window): Don't force window start if point
4525 will be invisible in the resulting window. (Bug#9324)
4526
4527 2011-08-25 Eli Zaretskii <eliz@gnu.org>
4528
4529 * xdisp.c (compute_display_string_pos): Return 2 in DISP_PROP when
4530 the display spec is of the form `(space ...)'.
4531 (handle_display_spec): Return the value returned by
4532 handle_single_display_spec, not just 1 or zero.
4533 (handle_single_display_spec): If the display spec is of the form
4534 `(space ...)', and specifies display in the text area, return 2
4535 rather than 1.
4536 (try_cursor_movement): Check for the need to scroll more
4537 accurately, and prefer exact match for point under bidi.
4538 Don't advance `row' beyond the last row of the window.
4539
4540 * dispextern.h (struct bidi_it): Rename the disp_prop_p member
4541 into disp_prop; all users changed.
4542
4543 * bidi.c (bidi_fetch_char): If compute_display_string_pos returns
4544 DISP_PROP = 2, substitute the u+2029 PARAGRAPH SEPARATOR character
4545 for the text covered by the display property.
4546
4547 2011-08-25 Chong Yidong <cyd@stupidchicken.com>
4548
4549 * buffer.c (Fbury_buffer_internal): Rename from Funrecord_buffer.
4550 Change return value to nil.
4551 (Frecord_buffer): Delete unused function.
4552
4553 2011-08-24 Eli Zaretskii <eliz@gnu.org>
4554
4555 * xdisp.c (Fcurrent_bidi_paragraph_direction): For unibyte
4556 buffers, return left-to-right.
4557 (set_cursor_from_row): Consider candidate row a win if its glyph
4558 represents a newline and point is on that newline. Fixes cursor
4559 positioning on the newline at EOL of R2L text within L2R
4560 paragraph, and vice versa.
4561 (try_cursor_movement): Check continued rows, in addition to
4562 continuation rows. Fixes unwarranted scroll when point enters a
4563 continued line of R2L text within an L2R paragraph, or vice versa.
4564 (cursor_row_p): Consider the case of point being equal to
4565 MATRIX_ROW_END_CHARPOS. Prevents cursor being stuck when moving
4566 from the end of a short line to the beginning of a continued line
4567 of R2L text within L2R paragraph.
4568 (RECORD_MAX_MIN_POS): For max_pos, use IT_CHARPOS even for
4569 composed characters.
4570
4571 * bidi.c (bidi_check_type): Use xassert.
4572 (bidi_cache_iterator_state): Update the disp_pos and disp_prop_p
4573 members.
4574
4575 2011-08-23 Eli Zaretskii <eliz@gnu.org>
4576
4577 * bidi.c (bidi_get_type): Abort if we get zero as the bidi type of
4578 a character.
4579
4580 2011-08-23 Chong Yidong <cyd@stupidchicken.com>
4581
4582 * nsfont.m (ns_otf_to_script): Fix typo.
4583
4584 2011-08-22 Kenichi Handa <handa@m17n.org>
4585
4586 * chartab.c (Fset_char_table_extra_slot): Do not inhibit setting a
4587 extra slot even if the purpose is char-code-property-table.
4588
4589 2011-08-23 Eli Zaretskii <eliz@gnu.org>
4590
4591 * xdisp.c (redisplay_window): When computing centering_position,
4592 account for the height of the header line. (Bug#8874)
4593
4594 * dispnew.c (buffer_posn_from_coords): Use buf_charpos_to_bytepos
4595 instead of CHAR_TO_BYTE. Fixes a crash when a completion
4596 candidate is selected by the mouse, and that candidate has a
4597 composed character under the mouse.
4598
4599 * xdisp.c (x_produce_glyphs): Set it->nglyphs to 1. Fixes pixel
4600 coordinates reported by pos-visible-in-window-p for a composed
4601 character in column zero.
4602
4603 2011-08-23 Stefan Monnier <monnier@iro.umontreal.ca>
4604
4605 * cmds.c (Fself_insert_command): Mention post-self-insert-hook.
4606
4607 2011-08-22 Eli Zaretskii <eliz@gnu.org>
4608
4609 * xdisp.c (BUFFER_POS_REACHED_P): If this is a composition,
4610 consider it a hit if to_charpos is anywhere in the range of the
4611 composed buffer positions.
4612
4613 2011-08-22 Chong Yidong <cyd@stupidchicken.com>
4614
4615 * image.c (gif_load): Don't assume that each subimage has the same
4616 dimensions as the base image. Handle disposal method that is
4617 "undefined" by the gif spec (Bug#9335).
4618
4619 2011-08-20 Chong Yidong <cyd@stupidchicken.com>
4620
4621 * eval.c (Fsignal): Handle `debug' symbol in error handler (Bug#9329).
4622 (Fcondition_case): Document `debug' symbol in error handler.
4623
4624 2011-08-19 Eli Zaretskii <eliz@gnu.org>
4625
4626 * xfaces.c (face_at_buffer_position): Avoid repeated evaluation of
4627 face ID by FACE_FROM_ID, and avoid a crash when mouse is moved
4628 from an Org mode buffer to a Speedbar frame.
4629
4630 * xdisp.c (RECORD_MAX_MIN_POS): If the display element comes from
4631 a composition, take its buffer position from IT->cmp_it.charpos.
4632 Fixes cursor positioning at the beginning of a line that begins
4633 with a composed character.
4634
4635 2011-08-18 Eli Zaretskii <eliz@gnu.org>
4636
4637 * bidi.c (bidi_get_type): If bidi_type_table reports zero as the
4638 character bidirectional type, use STRONG_L instead. Fixes crashes
4639 in a buffer produced by `describe-categories'.
4640
4641 * dispextern.h (struct bidi_it): Move disp_pos and disp_prop_p
4642 members before the level stack, so they would be saved and
4643 restored when copying iterator state. Fixes incorrect reordering
4644 around TABs covered by display properties.
4645
4646 2011-08-18 Andreas Schwab <schwab@linux-m68k.org>
4647
4648 * process.c (Fnetwork_interface_list): Correctly determine buffer size.
4649
4650 2011-08-17 Chong Yidong <cyd@stupidchicken.com>
4651
4652 * eval.c (internal_condition_case, internal_condition_case_1)
4653 (internal_condition_case_2, internal_condition_case_n):
4654 Remove unnecessary aborts (Bug#9081).
4655
4656 2011-08-17 Eli Zaretskii <eliz@gnu.org>
4657
4658 * lread.c (Fload) [DOS_NT]: If `openp' returns -2, but the file
4659 has no `load' handler, try opening the file locally. (Bug#9311)
4660
4661 2011-08-16 Ken Brown <kbrown@cornell.edu>
4662
4663 * gmalloc.c: Expand comment.
4664
4665 2011-08-16 Eli Zaretskii <eliz@gnu.org>
4666
4667 * xdisp.c (set_cursor_from_row): Don't accept a previous candidate
4668 if it fails the cursor_row_p test. Fixes cursor positioning at ZV.
4669
4670 2011-08-16 Ken Brown <kbrown@cornell.edu>
4671
4672 Fix memory allocation problems in Cygwin build (Bug#9273).
4673
4674 * unexcw.c ( __malloc_initialized): Declare external variable.
4675 (fixup_executable): Force the dumped emacs to reinitialize malloc.
4676
4677 * gmalloc.c [CYGWIN] (bss_sbrk_heapbase, bss_sbrk_heapinfo):
4678 New variables.
4679 (malloc_initialize_1) [CYGWIN]: Prepare for reinitializing the
4680 dumped emacs.
4681 (_free_internal_nolock) [CYGWIN]: Ignore requests to free storage
4682 in the static heap.
4683 [CYGWIN] (special_realloc): New function.
4684 (_realloc_internal_nolock) [CYGWIN]: Use the new function on
4685 requests to realloc storage in the static heap.
4686
4687 2011-08-15 Paul Eggert <eggert@cs.ucla.edu>
4688
4689 * bidi.c (bidi_initialize): Remove unused local.
4690
4691 2011-08-15 Eli Zaretskii <eliz@gnu.org>
4692
4693 * bidimirror.h:
4694 * biditype.h: Remove file.
4695 * makefile.w32-in ($(BLD)/bidi.$(O)):
4696 * deps.mk (bidi.o): Remove biditype.h and bidimirror.h.
4697
4698 * dispextern.h: Fix a typo in the comment to bidi_type_t.
4699
4700 * chartab.c: Improve commentary for the uniprop_table API.
4701
4702 * bidi.c (bidi_paragraph_init): Support zero value of
4703 bidi_ignore_explicit_marks_for_paragraph_level.
4704 (bidi_initialize): Use uniprop_table instead of including
4705 biditype.h and bidimirror.h.
4706
4707 * xdisp.c (move_it_in_display_line_to): Don't reset pixel
4708 coordinates of the iterator when restoring from ppos_it.
4709 (Bug#9296)
4710
4711 2011-08-14 Kenichi Handa <handa@m17n.org>
4712
4713 * process.c (create_process): Call setup_process_coding_systems
4714 after the pid of the process is set to -1 (Bug#8162).
4715
4716 2011-08-14 Eli Zaretskii <eliz@gnu.org>
4717
4718 * xdisp.c (move_it_in_display_line_to): Don't invoke
4719 IT_RESET_X_ASCENT_DESCENT when iterator position was restored from
4720 ppos_it. Fixes vertical cursor motion when line beginning is
4721 covered by an image. (Bug#9296)
4722
4723 2011-08-14 Jan Djärv <jan.h.d@swipnet.se>
4724
4725 * nsterm.h (ns_run_ascript): Declare.
4726 (NSAPP_DATA2_RUNASSCRIPT): Define.
4727
4728 * nsfns.m (as_script, as_result, as_status): New static variables.
4729 (ns_run_ascript): New function.
4730 (Fns_do_applescript): Set variables as_*. Make an NSApplicationDefined
4731 event with data2 set to NSAPP_DATA2_RUNASSCRIPT, post it and then start
4732 the event loop. Get status from as_status (Bug#7276).
4733
4734 * nsterm.m (sendEvent): If event is NSApplicationDefined and
4735 data2 is NSAPP_DATA2_RUNASSCRIPT, call ns_run_ascript and then exit
4736 the event loop (Bug#7276).
4737
4738 2011-08-14 Andreas Schwab <schwab@linux-m68k.org>
4739
4740 * gnutls.c (QCgnutls_bootprop_priority)
4741 (QCgnutls_bootprop_trustfiles, QCgnutls_bootprop_keylist)
4742 (QCgnutls_bootprop_crlfiles, QCgnutls_bootprop_callbacks)
4743 (QCgnutls_bootprop_loglevel, QCgnutls_bootprop_hostname)
4744 (QCgnutls_bootprop_min_prime_bits, QCgnutls_bootprop_verify_flags)
4745 (QCgnutls_bootprop_verify_hostname_error)
4746 (QCgnutls_bootprop_callbacks_verify): Rename from
4747 Qgnutls_bootprop_..., all uses changed.
4748
4749 * xfaces.c (QCignore_defface): Rename from Qignore_defface, all
4750 uses changed.
4751
4752 2011-08-14 Paul Eggert <eggert@cs.ucla.edu>
4753
4754 * xfaces.c (Qframe_set_background_mode): Now static.
4755 * dispextern.h (Qframe_set_background_mode): Remove decl.
4756
4757 * process.c (Fnetwork_interface_info): Declare local only if needed.
4758
4759 2011-08-13 Jan Djärv <jan.h.d@swipnet.se>
4760
4761 * process.c: Include ifaddrs.h and net/if_dl.h if available (Bug#8477).
4762 (Fnetwork_interface_list): Allocate in increments of bytes instead
4763 of sizeof (struct ifreq). Iterate over ifconf.ifc_req by counting
4764 bytes (Bug#8477). Count bytes correctly when ifr_addr is a struct
4765 sockaddr.
4766 (struct ifflag_def): notrailers is smart on OSX.
4767 (Fnetwork_interface_info): Handle case when ifr_flags is negative.
4768 Get hardware address with getifaddrs if available.
4769
4770 2011-08-12 Eli Zaretskii <eliz@gnu.org>
4771
4772 * xdisp.c (iterate_out_of_display_property): xassert that
4773 IT->position is set to within IT->object's boundaries. Break from
4774 the loop as soon as EOB is reached; avoids infloops in redisplay
4775 when IT->position is set up wrongly due to some bug.
4776 Set IT->current to match the bidi iterator unconditionally.
4777 (push_display_prop): Allow GET_FROM_STRING as IT->method on
4778 entry. Force push_it to save on the stack the current
4779 buffer/string position, to be restored by pop_it. Fix flags in
4780 the iterator structure wrt the object coming from a display
4781 property, as `line-prefix' and `wrap-prefix' are not ``replacing''
4782 properties. (Bug#9284)
4783
4784 2011-08-09 Andreas Schwab <schwab@linux-m68k.org>
4785
4786 * fontset.c (fontset_get_font_group): Add proper type checks.
4787 (Bug#9172)
4788
4789 2011-08-09 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
4790
4791 * unexmacosx.c (print_load_command_name): Add cases LC_FUNCTION_STARTS
4792 and LC_VERSION_MIN_MACOSX.
4793 (copy_linkedit_data) [LC_FUNCTION_STARTS]: New function.
4794 (dump_it) [LC_FUNCTION_STARTS]: Use it.
4795
4796 2011-08-08 Eli Zaretskii <eliz@gnu.org>
4797
4798 * xdisp.c (forward_to_next_line_start): Allow to use the
4799 no-display-properties-and-no-overlays under bidi display.
4800 Set disp_pos in the bidi iterator to avoid searches for display
4801 properties and overlays.
4802
4803 2011-08-08 Chong Yidong <cyd@stupidchicken.com>
4804
4805 * editfns.c (Fset_time_zone_rule): Document relationship with the
4806 setenv function.
4807
4808 * ftfont.c (ftfont_pattern_entity): Copy the extras argument to
4809 the font entity extracted from the cache (Bug#8109).
4810
4811 2011-08-07 Chong Yidong <cyd@stupidchicken.com>
4812
4813 * composite.c (autocmp_chars): Don't reset point. That is done by
4814 restore_point_unwind (Bug#5984).
4815
4816 2011-08-07 Juri Linkov <juri@jurta.org>
4817
4818 * editfns.c (Fformat_time_string): Doc fix, add tag `usage:'
4819 to show the arg `TIME' instead of `TIMEVAL'.
4820
4821 2011-08-06 Eli Zaretskii <eliz@gnu.org>
4822
4823 * xdisp.c (set_cursor_from_row): Fix cursor positioning when a
4824 display property strides EOL and includes a newline, as in
4825 longlines-mode. (Bug#9254)
4826 (move_it_in_display_line_to): Fix vertical-motion in a buffer with
4827 word-wrap under bidirectional display. (Bug#9224)
4828
4829 * bidi.c (bidi_unshelve_cache): Don't reset the cache if JUST_FREE
4830 is non-zero, even if the data buffer is NULL. Fixes a crash in
4831 vertical-motion with longlines-mode. (Bug#9254)
4832
4833 2011-08-05 Eli Zaretskii <eliz@gnu.org>
4834
4835 * bidi.c <bidi_cache_total_alloc>: Now static.
4836 (bidi_initialize): Initialize bidi_cache_total_alloc.
4837
4838 * xdisp.c (display_line): Release buffer allocated for shelved bidi
4839 cache. (Bug#9221)
4840
4841 * bidi.c (bidi_shelve_cache, bidi_unshelve_cache): Track total
4842 amount allocated this far in `bidi_cache_total_alloc'.
4843 (bidi_unshelve_cache): Accept an additional argument JUST_FREE; if
4844 non-zero, only free the data buffer without restoring the cache
4845 contents. All callers changed.
4846
4847 * dispextern.h (bidi_unshelve_cache): Update prototype.
4848
4849 * xdisp.c (SAVE_IT, pos_visible_p, move_it_in_display_line_to)
4850 (move_it_in_display_line, move_it_to)
4851 (move_it_vertically_backward, move_it_by_lines): Replace the call
4852 to xfree to an equivalent call to bidi_unshelve_cache.
4853 (move_it_in_display_line_to): Fix logic of returning
4854 MOVE_POS_MATCH_OR_ZV in the bidi case. (Bug#9224)
4855
4856 2011-08-05 Eli Zaretskii <eliz@gnu.org>
4857
4858 * xdisp.c (set_cursor_from_row): Prefer the candidate glyph that
4859 came from a string character with a `cursor' property. (Bug#9229)
4860
4861 2011-08-04 Jan Djärv <jan.h.d@swipnet.se>
4862
4863 * Makefile.in (LIB_PTHREAD): New variable.
4864 (LIBES): Add LIB_PTHREAD (Bug#9216).
4865
4866 * alloc.c, emacs.c, gmalloc.c, gtkutil.c, keyboard.c, syssignal.h:
4867 Rename HAVE_GTK_AND_PTHREAD to HAVE_PTHREAD (Bug#9216).
4868
4869 2011-08-04 Andreas Schwab <schwab@linux-m68k.org>
4870
4871 * regex.c (re_iswctype): Remove some redundant boolean conversions.
4872
4873 2011-08-04 Jan Djärv <jan.h.d@swipnet.se>
4874
4875 * xterm.c (x_find_topmost_parent): New function.
4876 (x_set_frame_alpha): Find topmost parent window with
4877 x_find_topmost_parent and set the property there also (bug#9181).
4878 (handle_one_xevent): Call x_set_frame_alpha on ReparentNotify.
4879
4880 2011-08-04 Paul Eggert <eggert@cs.ucla.edu>
4881
4882 * callproc.c (Fcall_process): Avoid vfork clobbering
4883 the local vars buffer, coding_systems, current_dir.
4884
4885 2011-08-03 Stefan Monnier <monnier@iro.umontreal.ca>
4886
4887 * keymap.c (Fmake_composed_keymap): Move to subr.el.
4888
4889 2011-08-03 Paul Eggert <eggert@cs.ucla.edu>
4890
4891 * fontset.c (dump_fontset) [FONTSET_DEBUG]: Declare EXTERNALLY_VISIBLE
4892 so that it is not optimized away.
4893
4894 * xdisp.c (compute_display_string_pos): Remove unused local.
4895
4896 2011-08-02 Eli Zaretskii <eliz@gnu.org>
4897
4898 Fix slow cursor motion and scrolling in large buffers with
4899 selective display, like Org Mode buffers. (Bug#9218)
4900
4901 * dispextern.h (struct bidi_it): New member disp_prop_p.
4902
4903 * xdisp.c: Remove one-slot cache of display string positions.
4904 (compute_display_string_pos): Accept an additional argument
4905 DISP_PROP_P; callers changed. Scan at most 5K characters forward
4906 for a display string or property. If found, set DISP_PROP_P
4907 non-zero.
4908
4909 * bidi.c (bidi_fetch_char): Accept an additional argument
4910 DISP_PROP_P, and pass it to compute_display_string_pos.
4911 Only handle text covered by a display string if DISP_PROP_P is returned
4912 non-zero. All callers of bidi_fetch_char changed.
4913
4914 2011-08-02 Stefan Monnier <monnier@iro.umontreal.ca>
4915
4916 * keymap.c (Fdefine_key): Fix Lisp_Object/int mixup; apply some CSE.
4917
4918 2010-12-03 Don March <don@ohspite.net>
4919
4920 * keymap.c (Fdefine_key): Fix non-prefix key error message when
4921 last character M-[char] is translated to ESC [char] (bug#7541).
4922
4923 2011-08-02 Kenichi Handa <handa@m17n.org>
4924
4925 * lisp.h (uniprop_table): Extern it.
4926
4927 * chartab.c (uniprop_table): Make it non-static.
4928
4929 2011-08-01 Eli Zaretskii <eliz@gnu.org>
4930
4931 * xdisp.c (forward_to_next_line_start): Accept additional argument
4932 BIDI_IT_PREV, and store into it the state of the bidi iterator had
4933 on the newline.
4934 (reseat_at_next_visible_line_start): Use the bidi iterator state
4935 returned by forward_to_next_line_start to restore the state of
4936 it->bidi_it after backing up to previous newline. (Bug#9212)
4937
4938 2011-07-30 Andreas Schwab <schwab@linux-m68k.org>
4939
4940 * regex.c (re_comp): Protoize.
4941 (re_exec): Fix return type.
4942 (regexec): Fix type of `ret'. (Bug#9203)
4943
4944 2011-07-28 Paul Eggert <eggert@cs.ucla.edu>
4945
4946 * image.c (check_image_size): Use 1024x1024 if unknown frame (Bug#9189).
4947 This is needed if max-image-size is a floating-point number.
4948
4949 2011-07-28 Andreas Schwab <schwab@linux-m68k.org>
4950
4951 * print.c (print_object): Print empty symbol as ##.
4952
4953 * lread.c (read1): Read ## as empty symbol.
4954
4955 2011-07-28 Alp Aker <alp.tekin.aker@gmail.com>
4956
4957 * nsfns.m (x_set_foreground_color): Set f->foreground_pixel when
4958 setting frame foreground color (Bug#9175).
4959 (x_set_background_color): Likewise.
4960
4961 * nsmenu.m (-setText): Size tooltip dimensions precisely to
4962 contents (Bug#9176).
4963 (EmacsTooltip -init): Remove bezels and add shadows to
4964 tooltip windows.
4965
4966 * nsterm.m (ns_dumpglyphs_stretch): Avoid overwriting left fringe
4967 or scroll bar (Bug#8470).
4968
4969 * nsfont.m (nsfont_open): Remove assignment to voffset and
4970 unnecessary vars hshink, expand, hd, full_height, min_height.
4971 (nsfont_draw): Use s->ybase as baseline for glyph drawing (Bug#8913).
4972
4973 * nsterm.h (nsfont_info): Remove voffset field.
4974
4975 2011-07-28 Alp Aker <alp.tekin.aker@gmail.com>
4976
4977 Implement strike-through and overline on NextStep (Bug#8863).
4978
4979 * nsfont.m (nsfont_open): Use underline position provided by font,
4980 instead of hard-coded value of 2.
4981 (nsfont_draw): Call ns_draw_text_decoration instead.
4982
4983 * nsterm.h: Add declaration for ns_draw_text_decoration.
4984
4985 * nsterm.m (ns_draw_text_decoration): New function for drawing
4986 underline, overline, and strike-through.
4987 (ns_dumpglyphs_image, ns_dumpglyphs_stretch): Add call to
4988 ns_draw_text_decoration. Change treatment of cursor drawing to
4989 accommodate underlining, etc.
4990
4991 2011-07-28 Eli Zaretskii <eliz@gnu.org>
4992
4993 * buffer.c (init_buffer_once): Set bidi-display-reordering to t by
4994 default.
4995
4996 2011-07-28 Paul Eggert <eggert@cs.ucla.edu>
4997
4998 * alloc.c (memory_full) [!SYNC_INPUT]: Fix signal-related race.
4999 Without this fix, if a signal arrives just after memory fills up,
5000 'malloc' might be invoked reentrantly.
5001
5002 * image.c (x_check_image_size) [!HAVE_X_WINDOWS]: Return 1.
5003 In other words, assume that every image size is allowed, on non-X
5004 hosts. This assumption is probably wrong, but it lets Emacs compile.
5005
5006 2011-07-28 Andreas Schwab <schwab@linux-m68k.org>
5007
5008 * regex.c (re_iswctype): Convert return values to boolean.
5009
5010 2011-07-28 Eli Zaretskii <eliz@fencepost.gnu.org>
5011
5012 * xdisp.c (compute_display_string_pos): Don't use cached display
5013 string position if the buffer had its restriction changed.
5014 (Bug#9184)
5015
5016 2011-07-28 Paul Eggert <eggert@cs.ucla.edu>
5017
5018 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork clobbering.
5019
5020 2011-07-28 Paul Eggert <eggert@cs.ucla.edu>
5021
5022 Integer signedness and overflow and related fixes. (Bug#9079)
5023
5024 * bidi.c: Integer size and overflow fixes.
5025 (bidi_cache_size, bidi_cache_idx, bidi_cache_last_idx)
5026 (bidi_cache_start, bidi_cache_fetch_state, bidi_cache_search)
5027 (bidi_cache_find_level_change, bidi_cache_ensure_space)
5028 (bidi_cache_iterator_state, bidi_cache_find, bidi_cache_start_stack)
5029 (bidi_find_other_level_edge):
5030 Use ptrdiff_t instead of EMACS_INT where either will do.
5031 This works better on 32-bit hosts configured --with-wide-int.
5032 (bidi_cache_ensure_space): Check for size-calculation overflow.
5033 Use % rather than repeated addition, for better worst-case speed.
5034 Don't set bidi_cache_size until after xrealloc returns, because it
5035 might not return.
5036 (bidi_dump_cached_states): Use ptrdiff_t, not int, to avoid overflow.
5037 (bidi_cache_ensure_space): Also check that the bidi cache size
5038 does not exceed that of the largest Lisp string or buffer. See Eli
5039 Zaretskii in <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9079#29>.
5040
5041 * alloc.c (__malloc_size_t): Remove.
5042 All uses replaced by size_t. See Andreas Schwab's note
5043 <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9079#8>.
5044
5045 * image.c: Improve checking for integer overflow.
5046 (check_image_size): Assume that f is nonnull, since
5047 it is always nonnull in practice. This is one less thing to
5048 worry about when checking for integer overflow later.
5049 (x_check_image_size): New function, which checks for integer
5050 overflow issues inside X.
5051 (x_create_x_image_and_pixmap, xbm_read_bitmap_data): Use it.
5052 This removes the need for a memory_full check.
5053 (xbm_image_p): Rewrite to avoid integer multiplication overflow.
5054 (Create_Pixmap_From_Bitmap_Data, xbm_load): Use x_check_image_size.
5055 (xbm_read_bitmap_data): Change locals back to 'int', since
5056 their values must fit in 'int'.
5057 (xpm_load_image, png_load, tiff_load):
5058 Invoke x_create_x_image_and_pixmap earlier,
5059 to avoid much needless work if the image is too large.
5060 (tiff_load): Treat overly large images as if
5061 x_create_x_image_and_pixmap failed, not as malloc failures.
5062 (gs_load): Use x_check_image_size.
5063
5064 * gtkutil.c: Omit integer casts.
5065 (xg_get_pixbuf_from_pixmap): Remove unnecessary cast.
5066 (xg_set_toolkit_scroll_bar_thumb): Rewrite to avoid need for cast.
5067
5068 * image.c (png_load): Don't assume height * row_bytes fits in 'int'.
5069
5070 * xfaces.c (Fbitmap_spec_p): Fix integer overflow bug.
5071 Without this fix, (bitmap-spec-p '(34359738368 1 "x"))
5072 would wrongly return t on a 64-bit host.
5073
5074 * dispnew.c (init_display): Use *_RANGE_OVERFLOW macros.
5075 The plain *_OVERFLOW macros run afoul of GCC bug 49705
5076 <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49705>
5077 and therefore cause GCC to emit a bogus diagnostic in some cases.
5078
5079 * image.c: Integer signedness and overflow and related fixes.
5080 This is not an exhaustive set of fixes, but it's time to
5081 record what I've got.
5082 (lookup_pixel_color, check_image_size): Remove redundant decls.
5083 (check_image_size): Don't assume that arbitrary EMACS_INT values
5084 fit in 'int', or that arbitrary 'double' values fit in 'int'.
5085 (x_alloc_image_color, x_create_x_image_and_pixmap, png_load)
5086 (tiff_load, imagemagick_load_image):
5087 Check for overflow in size calculations.
5088 (x_create_x_image_and_pixmap): Remove unnecessary test for
5089 xmalloc returning NULL; that can't happen.
5090 (xbm_read_bitmap_data): Don't assume sizes fit into 'int'.
5091 (xpm_color_bucket): Use better integer hashing function.
5092 (xpm_cache_color): Don't possibly over-allocate memory.
5093 (struct png_memory_storage, tiff_memory_source, tiff_seek_in_memory)
5094 (gif_memory_source):
5095 Use ptrdiff_t, not int or size_t, to record sizes.
5096 (png_load): Don't assume values greater than 2**31 fit in 'int'.
5097 (our_stdio_fill_input_buffer): Prefer ptrdiff_t to size_t when
5098 either works, as we prefer signed integers.
5099 (tiff_read_from_memory, tiff_write_from_memory):
5100 Return tsize_t, not size_t, since that's what the TIFF API wants.
5101 (tiff_read_from_memory): Don't fail simply because the read would
5102 go past EOF; instead, return a short read.
5103 (tiff_load): Omit no-longer-needed casts.
5104 (Fimagemagick_types): Don't assume size fits into 'int'.
5105
5106 Improve hashing quality when configured --with-wide-int.
5107 * fns.c (hash_string): New function, taken from sxhash_string.
5108 Do not discard information about ASCII character case; this
5109 discarding is no longer needed.
5110 (sxhash-string): Use it. Change sig to match it. Caller changed.
5111 * lisp.h: Declare it.
5112 * lread.c (hash_string): Remove, since we now use fns.c's version.
5113 The fns.c version returns a wider integer if --with-wide-int is
5114 specified, so this should help the quality of the hashing a bit.
5115
5116 * emacs.c: Integer overflow minor fix.
5117 (heap_bss_diff): Now uprintmax_t, not unsigned long. All used changed.
5118 Define only if GNU_LINUX.
5119 (main, Fdump_emacs): Set and use heap_bss_diff only if GNU_LINUX.
5120
5121 * dispnew.c: Integer signedness and overflow fixes.
5122 Remove unnecessary forward decls, that were a maintenance hassle.
5123 (history_tick): Now uprintmax_t, so it's more likely to avoid overflow.
5124 All uses changed.
5125 (adjust_glyph_matrix, realloc_glyph_pool, adjust_frame_message_buffer)
5126 (scrolling_window): Use ptrdiff_t, not int, for byte count.
5127 (prepare_desired_row, line_draw_cost):
5128 Use int, not unsigned, where either works.
5129 (save_current_matrix, restore_current_matrix):
5130 Use ptrdiff_t, not size_t, where either works.
5131 (init_display): Check for overflow more accurately, and without
5132 relying on undefined behavior.
5133
5134 * editfns.c (pWIDE, pWIDElen, signed_wide, unsigned_wide):
5135 Remove, replacing with the new symbols in lisp.h. All uses changed.
5136 * fileio.c (make_temp_name):
5137 * filelock.c (lock_file_1, lock_file):
5138 * xdisp.c (message_dolog):
5139 Don't assume PRIdMAX etc. works; this isn't portable to pre-C99 hosts.
5140 Use pMd etc. instead.
5141 * lisp.h (printmax_t, uprintmax_t, pMd, pMu): New types and macros,
5142 replacing the pWIDE etc. symbols removed from editfns.c.
5143
5144 * keyboard.h (num_input_events): Now uintmax_t.
5145 This is (very slightly) less likely to mess up due to wraparound.
5146 All uses changed.
5147
5148 * buffer.c: Integer signedness fixes.
5149 (alloc_buffer_text, enlarge_buffer_text):
5150 Use ptrdiff_t rather than size_t when either will do, as we prefer
5151 signed integers.
5152
5153 * alloc.c: Integer signedness and overflow fixes.
5154 Do not impose an arbitrary 32-bit limit on malloc sizes when debugging.
5155 (__malloc_size_t): Default to size_t, not to int.
5156 (pure_size, pure_bytes_used_before_overflow, stack_copy_size)
5157 (Fgarbage_collect, mark_object_loop_halt, mark_object):
5158 Prefer ptrdiff_t to size_t when either would do, as we prefer
5159 signed integers.
5160 (XMALLOC_OVERRUN_CHECK_OVERHEAD): New macro.
5161 (xmalloc_overrun_check_header, xmalloc_overrun_check_trailer):
5162 Now const. Initialize with values that are in range even if char
5163 is signed.
5164 (XMALLOC_PUT_SIZE, XMALLOC_GET_SIZE): Remove, replacing with ...
5165 (xmalloc_put_size, xmalloc_get_size): New functions. All uses changed.
5166 These functions do the right thing with sizes > 2**32.
5167 (check_depth): Now ptrdiff_t, not int.
5168 (overrun_check_malloc, overrun_check_realloc, overrun_check_free):
5169 Adjust to new way of storing sizes. Check for size overflow bugs
5170 in rest of code.
5171 (STRING_BYTES_MAX): Adjust to new overheads. The old code was
5172 slightly wrong anyway, as it missed one instance of
5173 XMALLOC_OVERRUN_CHECK_OVERHEAD.
5174 (refill_memory_reserve): Omit needless cast to size_t.
5175 (mark_object_loop_halt): Mark as externally visible.
5176
5177 * xselect.c: Integer signedness and overflow fixes.
5178 (Fx_register_dnd_atom, x_handle_dnd_message):
5179 Use ptrdiff_t, not size_t, since we prefer signed.
5180 (Fx_register_dnd_atom): Check for ptrdiff_t (and size_t) overflow.
5181 * xterm.h (struct x_display_info): Use ptrdiff_t, not size_t, for
5182 x_dnd_atoms_size and x_dnd_atoms_length.
5183
5184 * doprnt.c: Prefer signed to unsigned when either works.
5185 * eval.c (verror):
5186 * doprnt.c (doprnt):
5187 * lisp.h (doprnt):
5188 * xdisp.c (vmessage):
5189 Use ptrdiff_t, not size_t, when using or implementing doprnt,
5190 since the sizes cannot exceed ptrdiff_t bounds anyway, and we
5191 prefer signed arithmetic to avoid comparison confusion.
5192 * doprnt.c (doprnt): Avoid a "+ 1" that can't overflow,
5193 but is a bit tricky.
5194
5195 Assume freestanding C89 headers, string.h, stdlib.h.
5196 * data.c, doprnt.c, floatfns.c, print.c:
5197 Include float.h unconditionally.
5198 * gmalloc.c: Assume C89-at-least behavior for preprocessor,
5199 limits.h, stddef.h, string.h. Use memset instead of 'flood'.
5200 * regex.c: Likewise for stddef.h, string.h.
5201 (ISASCII): Remove; can assume it returns 1 now. All uses removed.
5202 * s/aix4-2.h (HAVE_STRING_H): Remove obsolete undef.
5203 * s/ms-w32.h (HAVE_LIMITS_H, HAVE_STRING_H, HAVE_STDLIB_H)
5204 (STDC_HEADERS): Remove obsolete defines.
5205 * sysdep.c: Include limits.h unconditionally.
5206
5207 Assume support for memcmp, memcpy, memmove, memset.
5208 * lisp.h, sysdep.c (memcmp, memcpy, memmove, memset):
5209 * regex.c (memcmp, memcpy):
5210 Remove; we assume C89 now.
5211
5212 * gmalloc.c (memcpy, memset, memmove): Remove; we assume C89 now.
5213 (__malloc_safe_bcopy): Remove; no longer needed.
5214
5215 * lisp.h (struct vectorlike_header, struct Lisp_Subr): Signed sizes.
5216 Use EMACS_INT, not EMACS_UINT, for sizes. The code works equally
5217 well either way, and we prefer signed to unsigned.
5218
5219 2011-07-27 Lars Magne Ingebrigtsen <larsi@gnus.org>
5220
5221 * gnutls.c (emacs_gnutls_read): Don't message anything if the peer
5222 closes the connection while we're reading (bug#9182).
5223
5224 2011-07-25 Jan Djärv <jan.h.d@swipnet.se>
5225
5226 * nsmenu.m (ns_popup_dialog): Add an "ok" button if no buttons
5227 are specified (Bug#9168).
5228
5229 2011-07-25 Paul Eggert <eggert@cs.ucla.edu>
5230
5231 * bidi.c (bidi_dump_cached_states): Fix printf format mismatch.
5232 Found by GCC static checking and --with-wide-int on a 32-bit host.
5233
5234 2011-07-25 Eli Zaretskii <eliz@gnu.org>
5235
5236 * xdisp.c (compute_display_string_pos): Fix logic of caching
5237 previous display string position. Initialize cached_prev_pos to
5238 -1. Fixes slow-down at the beginning of a buffer.
5239
5240 2011-07-24 Eli Zaretskii <eliz@gnu.org>
5241
5242 * xfaces.c (check_lface_attrs) [HAVE_WINDOW_SYSTEM]: Allow `nil'
5243 for attrs[LFACE_FONTSET_INDEX].
5244
5245 2011-07-23 Paul Eggert <eggert@cs.ucla.edu>
5246
5247 * xml.c (parse_region): Remove unused local
5248 that was recently introduced.
5249
5250 2011-07-23 Eli Zaretskii <eliz@gnu.org>
5251
5252 * xfns.c (unwind_create_frame) [GLYPH_DEBUG]: Adapt to changes in
5253 2008-02-22T17:42:09Z!monnier@iro.umontreal.ca.
5254
5255 * xdisp.c (move_it_in_display_line_to): Record the best matching
5256 position for TO_CHARPOS while scanning the line, and restore it on
5257 exit if none of the characters scanned was an exact match.
5258 Fixes vertical-motion and pos-visible-in-window-p under bidi redisplay
5259 when exact match is impossible due to invisible text, and the
5260 lines are truncated.
5261
5262 2011-07-23 Jan Djärv <jan.h.d@swipnet.se>
5263
5264 * nsterm.m (initFrameFromEmacs): Set NSTitledWindowMask in styleMask
5265 for OSX >= 10.7.
5266
5267 2011-07-22 Eli Zaretskii <eliz@gnu.org>
5268
5269 Fix a significant slow-down of cursor motion with C-n, C-p,
5270 C-f/C-b, and C-v/M-v that couldn't keep up with keyboard
5271 auto-repeat under bidi redisplay in fontified buffers.
5272 * xdisp.c (compute_stop_pos_backwards): New function.
5273 (next_element_from_buffer): Call compute_stop_pos_backwards to
5274 find a suitable prev_stop when we find ourselves before
5275 base_level_stop.
5276 (reseat): Don't look for prev_stop, as that could mean a very long
5277 run.
5278 <cached_disp_pos, cached_disp_buffer, cached_disp_modiff>
5279 <cached_disp_overlay_modiff>: Cache for last found display string
5280 position.
5281 (compute_display_string_pos): Return the cached position if asked
5282 about the same buffer in the same area of character positions, and
5283 the buffer wasn't changed since the time the display string
5284 position was cached.
5285
5286 2011-07-22 Eli Zaretskii <eliz@gnu.org>
5287
5288 * xdisp.c (rows_from_pos_range): Don't ignore glyphs whose object
5289 is an integer, which is important for empty lines. (Bug#9149)
5290
5291 2011-07-22 Chong Yidong <cyd@stupidchicken.com>
5292
5293 * frame.c (Fmodify_frame_parameters): In tty case, update the
5294 default face if necessary (Bug#4238).
5295
5296 2011-07-21 Chong Yidong <cyd@stupidchicken.com>
5297
5298 * editfns.c (Fstring_to_char): No need to explain what a character
5299 is in the docstring (Bug#6576).
5300
5301 2011-07-20 Lars Magne Ingebrigtsen <larsi@gnus.org>
5302
5303 * xml.c (parse_region): Make sure we always return a tree.
5304
5305 2011-07-20 HAMANO Kiyoto <khiker.mail@gmail.com>
5306
5307 * xml.c (parse_region): If a document contains only comments,
5308 return that, too.
5309
5310 2011-07-20 Lars Magne Ingebrigtsen <larsi@gnus.org>
5311
5312 * xml.c (make_dom): Return comments, too.
5313
5314 2011-07-19 Paul Eggert <eggert@cs.ucla.edu>
5315
5316 Port to OpenBSD.
5317 See http://lists.gnu.org/archive/html/emacs-devel/2011-07/msg00688.html
5318 and the surrounding thread.
5319 * minibuf.c (read_minibuf_noninteractive): Rewrite to use getchar
5320 rather than fgets, and retry after EINTR. Otherwise, 'emacs
5321 --batch -f byte-compile-file' fails on OpenBSD if an inactivity
5322 timer goes off.
5323 * s/openbsd.h (BROKEN_SIGIO): Define.
5324 * unexelf.c (unexec) [__OpenBSD__]:
5325 Don't update the .mdebug section of the Alpha COFF symbol table.
5326
5327 2011-07-19 Lars Magne Ingebrigtsen <larsi@gnus.org>
5328
5329 * lread.c (syms_of_lread): Clarify when `lexical-binding' is used
5330 (bug#8460).
5331
5332 2011-07-18 Paul Eggert <eggert@cs.ucla.edu>
5333
5334 * fileio.c (Fcopy_file) [!MSDOS]: Tighten created file's mask.
5335 This fixes some race conditions on the permissions of any newly
5336 created file.
5337
5338 * alloc.c (valid_pointer_p): Use pipe, not open.
5339 This fixes some permissions issues when debugging.
5340
5341 * fileio.c (Fcopy_file): Adjust mode if fchown fails. (Bug#9002)
5342 If fchown fails to set both uid and gid, try to set just gid,
5343 as that is sometimes allowed. Adjust the file's mode to eliminate
5344 setuid or setgid bits that are inappropriate if fchown fails.
5345
5346 2011-07-18 Stefan Monnier <monnier@iro.umontreal.ca>
5347
5348 * xdisp.c (next_element_from_string, next_element_from_buffer): Use EQ
5349 to compare Lisp_Objects.
5350 * gnutls.c (syms_of_gnutls): Rename Vgnutls_log_level to
5351 global_gnutls_log_level, don't mistake it for a Lisp_Object.
5352 (init_gnutls_functions, emacs_gnutls_handle_error): Fix up uses.
5353
5354 2011-07-17 Andreas Schwab <schwab@linux-m68k.org>
5355
5356 * lread.c (read_integer): Unread even EOF character.
5357 (read1): Likewise. Properly record start position of symbol.
5358
5359 * lread.c (read1): Read `#:' as empty uninterned symbol if no
5360 symbol character follows.
5361
5362 2011-07-17 Paul Eggert <eggert@cs.ucla.edu>
5363
5364 * fileio.c (Fcopy_file): Pacify gcc re fchown. (Bug#9002)
5365 This works around a problem with the previous change to Fcopy_file.
5366 Recent glibc declares fchown with __attribute__((warn_unused_result)),
5367 and without this change, GCC might complain about discarding
5368 fchown's return value.
5369
5370 2011-07-16 Juanma Barranquero <lekktu@gmail.com>
5371
5372 * makefile.w32-in (GLOBAL_SOURCES): Add gnutls.c (followup to bug#9059).
5373
5374 2011-07-16 Paul Eggert <eggert@cs.ucla.edu>
5375
5376 * fileio.c (Fcopy_file): Don't diagnose fchown failures. (Bug#9002)
5377
5378 2011-07-16 Lars Magne Ingebrigtsen <larsi@gnus.org>
5379
5380 * gnutls.c (syms_of_gnutls): Define `gnutls-log-level' here, since
5381 it's used from the C level.
5382
5383 * process.c: Use the same condition for POLL_FOR_INPUT in both
5384 keyboard.c and process.c (bug#1858).
5385
5386 2011-07-09 Lawrence Mitchell <wence@gmx.li>
5387
5388 * gnutls.c (Qgnutls_bootprop_min_prime_bits): New variable.
5389 (Fgnutls_boot): Use it.
5390
5391 2011-07-15 Andreas Schwab <schwab@linux-m68k.org>
5392
5393 * doc.c (Fsubstitute_command_keys): Revert last change.
5394
5395 2011-07-15 Lars Magne Ingebrigtsen <larsi@gnus.org>
5396
5397 * doc.c (Fsubstitute_command_keys): Clarify that \= really only
5398 quotes the next character, and doesn't affect other longer
5399 sequences (bug#8935).
5400
5401 * lread.c (syms_of_lread): Clarify that is isn't only
5402 `eval-buffer' and `eval-defun' that's affected by
5403 `lexical-binding' (bug#8460).
5404
5405 2011-07-15 Eli Zaretskii <eliz@gnu.org>
5406
5407 * xdisp.c (move_it_in_display_line_to): Fix vertical motion with
5408 bidi redisplay when a line includes both an image and is truncated.
5409
5410 2011-07-14 Paul Eggert <eggert@cs.ucla.edu>
5411
5412 Fix minor problems found by static checking.
5413 * bidi.c (bidi_cache_size): Now EMACS_INT, not size_t.
5414 (elsz): Now a signed constant, not a size_t var. We prefer signed
5415 types to unsigned, to avoid integer comparison confusion. Without
5416 this change, GCC 4.6.1 with -Wunsafe-loop-optimizations complains
5417 "cannot optimize loop, the loop counter may overflow", a symptom
5418 of the confusion.
5419 * indent.c (Fvertical_motion): Mark locals as initialized.
5420 * xdisp.c (reseat_to_string): Fix pointer signedness issue.
5421
5422 2011-07-14 Lars Magne Ingebrigtsen <larsi@gnus.org>
5423
5424 * search.c (Fre_search_backward): Mention `case-fold-search' in
5425 all the re_search_* functions (bug#8138).
5426
5427 * keyboard.c (Fopen_dribble_file): Document when the file is
5428 closed (bug#8056).
5429
5430 2011-07-14 Eli Zaretskii <eliz@gnu.org>
5431
5432 * bidi.c (bidi_dump_cached_states): Fix format of displaying
5433 bidi_cache_idx.
5434
5435 Support bidi reordering of display and overlay strings.
5436 * xdisp.c (compute_display_string_pos)
5437 (compute_display_string_end): Accept additional argument STRING.
5438 (init_iterator, reseat_1): Initialize bidi_it->string.s to NULL.
5439 (reseat_to_string): Initialize bidi_it->string.s and
5440 bidi_it->string.schars.
5441 (Fcurrent_bidi_paragraph_direction): Initialize itb.string.s to
5442 NULL (avoids a crash in bidi_paragraph_init).
5443 Initialize itb.string.lstring.
5444 (init_iterator): Call bidi_init_it only of a valid
5445 buffer position was specified. Initialize paragraph_embedding to
5446 L2R.
5447 (reseat_to_string): Initialize the bidi iterator.
5448 (display_string): If we need to ignore text properties of
5449 LISP_STRING, set IT->stop_charpos to IT->end_charpos. (The
5450 original value of -1 will not work with bidi.)
5451 (compute_display_string_pos): First arg is now struct
5452 `text_pos *'; all callers changed. Support display properties on
5453 Lisp strings.
5454 (compute_display_string_end): Support display properties on Lisp
5455 strings.
5456 (init_iterator, reseat_1, reseat_to_string): Initialize the
5457 string.bufpos member to 0 (zero, for compatibility with IT_CHARPOS
5458 when iterating on a string not from display properties).
5459 (compute_display_string_pos, compute_display_string_end):
5460 Fix calculation of the object to scan. Fixes an error when using
5461 arrow keys.
5462 (next_element_from_buffer): Don't abort when IT_CHARPOS is before
5463 base_level_stop; instead, set base_level_stop to BEGV.
5464 Fixes crashes in vertical-motion.
5465 (next_element_from_buffer): Improve commentary for when
5466 the iterator is before prev_stop.
5467 (init_iterator): Initialize bidi_p from the default value of
5468 bidi-display-reordering, not from buffer-local value. Use the
5469 buffer-local value only if initializing for buffer iteration.
5470 (handle_invisible_prop): Support invisible properties on strings
5471 that are being bidi-reordered.
5472 (set_iterator_to_next): Support bidi reordering of C strings and
5473 Lisp strings.
5474 (next_element_from_string): Support bidi reordering of Lisp
5475 strings.
5476 (handle_stop_backwards): Support Lisp strings as well.
5477 (display_string): Support display of R2L glyph rows.
5478 Use IT_STRING_CHARPOS when displaying from a Lisp string.
5479 (init_iterator): Don't initialize it->bidi_p for strings
5480 here.
5481 (reseat_to_string): Initialize it->bidi_p for strings here.
5482 (next_element_from_string, next_element_from_c_string)
5483 (next_element_from_buffer): Add xassert's for correspondence
5484 between IT's object being iterated and it->bidi_it.string
5485 structure.
5486 (face_before_or_after_it_pos): Support bidi iteration.
5487 (next_element_from_c_string): Handle the case of the first string
5488 character that is not the first one in the visual order.
5489 (get_visually_first_element): New function, refactored from common
5490 parts of next_element_from_buffer, next_element_from_string, and
5491 next_element_from_c_string.
5492 (tool_bar_lines_needed, redisplay_tool_bar)
5493 (display_menu_bar): Force left-to-right direction. Add a FIXME
5494 comment for making that be controlled by a user option.
5495 (push_it, pop_it): Save and restore the state of the
5496 bidi iterator. Save and restore the bidi_p flag.
5497 (pop_it): Iterate out of display property for string iteration as
5498 well.
5499 (iterate_out_of_display_property): Support iteration over strings.
5500 (handle_single_display_spec): Set up it->bidi_it for iteration
5501 over a display string, and call bidi_init_it.
5502 (handle_single_display_spec, next_overlay_string)
5503 (get_overlay_strings_1, push_display_prop): Set up the bidi
5504 iterator for displaying display or overlay strings.
5505 (forward_to_next_line_start): Don't use the shortcut if
5506 bidi-iterating.
5507 (back_to_previous_visible_line_start): If handle_display_prop
5508 pushed the iterator stack, restore the internal state of the bidi
5509 iterator by calling bidi_pop_it same number of times.
5510 (reseat_at_next_visible_line_start): If ON_NEWLINE_P is non-zero,
5511 and we are bidi-iterating, don't decrement the iterator position;
5512 instead, set the first_elt flag in the bidi iterator, to produce
5513 the same effect.
5514 (reseat_1): Remove redundant setting of string_from_display_prop_p.
5515 (push_display_prop): xassert that we are iterating a buffer.
5516 (push_it, pop_it): Save and restore paragraph_embedding member.
5517 (handle_single_display_spec, next_overlay_string)
5518 (get_overlay_strings_1, reseat_1, reseat_to_string)
5519 (push_display_prop): Set up the `unibyte' member of bidi_it.string
5520 correctly. Don't assume unibyte strings are not bidi-reordered.
5521 (compute_display_string_pos)
5522 (compute_display_string_end): Fix handling the case of C string.
5523 (push_it, pop_it): Save and restore from_disp_prop_p.
5524 (handle_single_display_spec, push_display_prop): Set the
5525 from_disp_prop_p flag.
5526 (get_overlay_strings_1): Reset the from_disp_prop_p flag.
5527 (pop_it): Call iterate_out_of_display_property only if we are
5528 popping after iteration over a string that came from a display
5529 property. Fix a typo in popping stretch info. Add an assertion
5530 for verifying that the iterator position is in sync with the bidi
5531 iterator.
5532 (handle_single_display_spec, get_overlay_strings_1)
5533 (push_display_prop): Fix initialization of paragraph direction for
5534 string when that of the parent object is not yet determined.
5535 (reseat_1): Call bidi_init_it to resync the bidi
5536 iterator with IT's position. (Bug#7616)
5537 (find_row_edges): If ROW->start.pos gives position
5538 smaller than min_pos, use it as ROW->minpos. (Bug#7616)
5539 (handle_stop, back_to_previous_visible_line_start, reseat_1):
5540 Reset the from_disp_prop_p flag.
5541 (SAVE_IT, RESTORE_IT): New macros.
5542 (pos_visible_p, face_before_or_after_it_pos)
5543 (back_to_previous_visible_line_start)
5544 (move_it_in_display_line_to, move_it_in_display_line)
5545 (move_it_to, move_it_vertically_backward, move_it_by_lines)
5546 (try_scrolling, redisplay_window, display_line): Use them when
5547 saving a temporary copy of the iterator and restoring it back.
5548 (back_to_previous_visible_line_start, reseat_1)
5549 (init_iterator): Empty the bidi cache "stack".
5550 (move_it_in_display_line_to): If iterator ended up at
5551 EOL, but we never saw any buffer positions smaller than
5552 to_charpos, return MOVE_POS_MATCH_OR_ZV. Fixes vertical cursor
5553 motion in bidi-reordered lines.
5554 (move_it_in_display_line_to): Record prev_method and prev_pos
5555 immediately before the call to set_iterator_to_next. Fixes cursor
5556 motion in bidi-reordered lines with stretch glyphs and strings
5557 displayed in margins. (Bug#8133) (Bug#8867)
5558 Return MOVE_POS_MATCH_OR_ZV only if iterator position is past
5559 TO_CHARPOS.
5560 (pos_visible_p): Support positions in bidi-reordered lines.
5561 Save and restore bidi cache.
5562
5563 * bidi.c (bidi_level_of_next_char): clen should be EMACS_NT, not int.
5564 (bidi_paragraph_info): Delete unused struct.
5565 (bidi_cache_idx, bidi_cache_last_idx): Declare EMACS_INT.
5566 (bidi_cache_start): New variable.
5567 (bidi_cache_reset): Reset bidi_cache_idx to bidi_cache_start, not
5568 to zero.
5569 (bidi_cache_fetch_state, bidi_cache_search)
5570 (bidi_cache_find_level_change, bidi_cache_iterator_state)
5571 (bidi_cache_find, bidi_peek_at_next_level)
5572 (bidi_level_of_next_char, bidi_find_other_level_edge)
5573 (bidi_move_to_visually_next): Compare cache index with
5574 bidi_cache_start rather than with zero.
5575 (bidi_fetch_char): Accept new argument STRING; all callers
5576 changed. Support iteration over a string. Support strings with
5577 display properties. Support unibyte strings. Fix the type of
5578 `len' according to what STRING_CHAR_AND_LENGTH expects.
5579 (bidi_paragraph_init, bidi_resolve_explicit_1)
5580 (bidi_resolve_explicit, bidi_resolve_weak)
5581 (bidi_level_of_next_char, bidi_move_to_visually_next):
5582 Support iteration over a string.
5583 (bidi_set_sor_type, bidi_resolve_explicit_1)
5584 (bidi_resolve_explicit, bidi_type_of_next_char): ignore_bn_limit
5585 can now be zero (for strings); special values 0 and -1 were
5586 changed to -1 and -2, respectively.
5587 (bidi_char_at_pos): New function.
5588 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak):
5589 Call it instead of FETCH_MULTIBYTE_CHAR.
5590 (bidi_move_to_visually_next): Abort if charpos or bytepos were not
5591 initialized to valid values.
5592 (bidi_init_it): Don't initialize charpos and bytepos with invalid
5593 values.
5594 (bidi_level_of_next_char): Allow the sentinel "position" to pass
5595 the test for valid cached positions. Fix the logic for looking up
5596 the sentinel state in the cache. GCPRO the Lisp string we are
5597 iterating.
5598 (bidi_push_it, bidi_pop_it): New functions.
5599 (bidi_initialize): Initialize the bidi cache start stack pointer.
5600 (bidi_cache_ensure_space): New function, refactored from part of
5601 bidi_cache_iterator_state. Don't assume the required size is just
5602 one BIDI_CACHE_CHUNK away.
5603 (bidi_cache_start_stack, bidi_push_it): Use IT_STACK_SIZE.
5604 (bidi_count_bytes, bidi_char_at_pos): New functions.
5605 (bidi_cache_search): Don't assume bidi_cache_last_idx is
5606 always valid if bidi_cache_idx is valid.
5607 (bidi_cache_find_level_change): xassert that bidi_cache_last_idx
5608 is valid if it's going to be used.
5609 (bidi_shelve_cache, bidi_unshelve_cache): New functions.
5610 (bidi_cache_fetch_state, bidi_cache_search)
5611 (bidi_cache_find_level_change, bidi_cache_ensure_space)
5612 (bidi_cache_iterator_state, bidi_cache_find)
5613 (bidi_find_other_level_edge, bidi_cache_start_stack):
5614 All variables related to cache indices are now EMACS_INT.
5615
5616 * dispextern.h (struct bidi_string_data): New structure.
5617 (struct bidi_it): New member `string'. Make flag members be 1-bit
5618 fields, and put them last in the struct.
5619 (compute_display_string_pos, compute_display_string_end):
5620 Update prototypes.
5621 (bidi_push_it, bidi_pop_it): Add prototypes.
5622 (struct iterator_stack_entry): New members bidi_p,
5623 paragraph_embedding, and from_disp_prop_p.
5624 (struct it): Member bidi_p is now a bit field 1 bit wide.
5625 (bidi_shelve_cache, bidi_unshelve_cache):
5626 Declare prototypes.
5627
5628 * .gdbinit (xvectype, xvector, xcompiled, xchartable, xboolvector)
5629 (xpr, xfont, xbacktrace): Use "header.size" when accessing vectors
5630 and vector-like objects.
5631
5632 * dispnew.c (buffer_posn_from_coords): Save and restore the bidi
5633 cache around display iteration.
5634
5635 * window.c (Fwindow_end, window_scroll_pixel_based)
5636 (displayed_window_lines, Frecenter): Save and restore the bidi
5637 cache around display iteration.
5638
5639 2011-07-14 Lars Magne Ingebrigtsen <larsi@gnus.org>
5640
5641 * editfns.c (Fdelete_region): Clarify the use of the named
5642 parameters (bug#6788).
5643
5644 2011-07-14 Martin Rudalics <rudalics@gmx.at>
5645
5646 * indent.c (Fvertical_motion): Set and restore w->pointm when
5647 saving and restoring the window's buffer (Bug#9006).
5648
5649 2011-07-13 Lars Magne Ingebrigtsen <larsi@gnus.org>
5650
5651 * editfns.c (Fstring_to_char): Clarify just what is returned
5652 (bug#6576). Text by Eli Zaretskii.
5653
5654 2011-07-13 Juanma Barranquero <lekktu@gmail.com>
5655
5656 * gnutls.c (init_gnutls_functions): Honor gnutls_log_level (bug#9059).
5657
5658 2011-07-13 Eli Zaretskii <eliz@gnu.org>
5659
5660 * buffer.c (mmap_find): Fix a typo.
5661
5662 2011-07-13 Johan Bockgård <bojohan@gnu.org>
5663
5664 Fix execution of x selection hooks.
5665 * xselect.c (Qx_lost_selection_functions)
5666 (Qx_sent_selection_functions): New vars.
5667 (syms_of_xselect): DEFSYM them.
5668 (x_handle_selection_request): Pass Qx_sent_selection_functions
5669 rather than Vx_sent_selection_functions to Frun_hook_with_args.
5670 (x_handle_selection_clear,x_clear_frame_selections):
5671 Pass Qx_lost_selection_functions rather than
5672 Vx_lost_selection_functions to Frun_hook_with_args.
5673
5674 2011-07-13 Paul Eggert <eggert@cs.ucla.edu>
5675
5676 * buffer.c (Fget_buffer_create): Initialize inhibit_shrinking.
5677 The old code sometimes used this field without initializing it.
5678
5679 * alloc.c (gc_sweep): Don't read past end of array.
5680 In theory, the old code could also have corrupted Emacs internals,
5681 though it'd be very unlikely.
5682
5683 2011-07-12 Andreas Schwab <schwab@linux-m68k.org>
5684
5685 * character.c (Fcharacterp): Don't advertise optional ignored
5686 argument. (Bug#4026)
5687
5688 2011-07-12 Lars Magne Ingebrigtsen <larsi@gnus.org>
5689
5690 * keymap.c (syms_of_keymap): Clarify that "modifier" is "modifier
5691 key" (bug#4257).
5692
5693 * window.c (Fset_window_start): Doc fix (bug#4199).
5694 (Fset_window_hscroll): Ditto.
5695
5696 2011-07-12 Paul Eggert <eggert@cs.ucla.edu>
5697
5698 Fix minor new problems caught by GCC 4.6.1.
5699 * term.c (init_tty): Remove unused local.
5700 * xsettings.c (store_monospaced_changed): Define this function only
5701 if (defined HAVE_GSETTINGS || defined HAVE_GCONF), as it's
5702 not used otherwise.
5703
5704 2011-07-12 Chong Yidong <cyd@stupidchicken.com>
5705
5706 * xdisp.c (Vresize_mini_windows): Minor doc fix (Bug#3300).
5707
5708 2011-07-11 Lars Magne Ingebrigtsen <larsi@gnus.org>
5709
5710 * xdisp.c (syms_of_xdisp): Make it explicit that the mini-windows
5711 are the mini-buffer and the echo area (bug#3320).
5712
5713 * term.c (init_tty): Remove support for supdup, c10 and perq
5714 terminals, which are no longer supported (bug#1482).
5715
5716 2011-07-10 Johan Bockgård <bojohan@gnu.org>
5717
5718 * xdisp.c (Ftool_bar_lines_needed): Fix WINDOWP check.
5719
5720 2011-07-10 Jan Djärv <jan.h.d@swipnet.se>
5721
5722 * xmenu.c (menu_highlight_callback): Only pass frame to show_help_event
5723 for non-popups (Bug#3642).
5724
5725 2011-07-10 Andreas Schwab <schwab@linux-m68k.org>
5726
5727 * alloc.c (reset_malloc_hooks): Protoize.
5728 * buffer.c (mmap_init, mmap_find, mmap_free_1, mmap_enlarge)
5729 (mmap_set_vars, mmap_alloc, mmap_free, mmap_realloc): Likewise.
5730 * cm.c (losecursor): Likewise.
5731 * data.c (fmod): Likewise.
5732 * dispnew.c (swap_glyphs_in_rows): Likewise.
5733 * emacs.c (memory_warning_signal): Likewise.
5734 * floatfns.c (float_error): Likewise.
5735 * font.c (check_gstring, check_otf_features, otf_tag_symbol)
5736 (otf_open, font_otf_capability, generate_otf_features)
5737 (font_otf_DeviceTable, font_otf_ValueRecord, font_otf_Anchor):
5738 Likewise.
5739 * image.c (pbm_read_file): Likewise.
5740 * indent.c (string_display_width): Likewise.
5741 * intervals.c (check_for_interval, search_for_interval)
5742 (inc_interval_count, count_intervals, root_interval)
5743 (adjust_intervals_for_insertion, make_new_interval): Likewise.
5744 * lread.c (defalias): Likewise.
5745 * ralloc.c (r_alloc_check): Likewise.
5746 * regex.c (set_image_of_range_1, set_image_of_range)
5747 (regex_grow_registers): Likewise.
5748 * sysdep.c (strerror): Likewise.
5749 * termcap.c (valid_filename_p, tprint, main): Likewise.
5750 * tparam.c (main): Likewise.
5751 * unexhp9k800.c (run_time_remap, save_data_space)
5752 (update_file_ptrs, read_header, write_header, calculate_checksum)
5753 (copy_file, copy_rest, display_header): Likewise.
5754 * widget.c (mark_shell_size_user_specified, create_frame_gcs):
5755 Likewise.
5756 * xdisp.c (check_it): Likewise.
5757 * xfaces.c (register_color, unregister_color, unregister_colors):
5758 Likewise.
5759 * xfns.c (print_fontset_result): Likewise.
5760 * xrdb.c (member, fatal, main): Likewise.
5761
5762 2011-07-10 Paul Eggert <eggert@cs.ucla.edu>
5763
5764 Fix minor problems found by static checking (Bug#9031).
5765 * chartab.c (char_table_set_range, map_sub_char_table):
5766 Remove unused locals.
5767 (uniprop_table): Now static.
5768 * composite.c (_work_char): Remove unused static var.
5769
5770 2011-07-09 Juanma Barranquero <lekktu@gmail.com>
5771
5772 * chartab.c (uniprop_table_uncompress): Remove unused local variable.
5773
5774 2011-07-09 Jan Djärv <jan.h.d@swipnet.se>
5775
5776 * gtkutil.c (qttip_cb): Remove code without function.
5777
5778 2011-07-09 Eli Zaretskii <eliz@gnu.org>
5779
5780 * w32.c (pthread_sigmask): New stub.
5781
5782 2011-07-08 Paul Eggert <eggert@cs.ucla.edu>
5783
5784 Use pthread_sigmask, not sigprocmask (Bug#9010).
5785 sigprocmask is portable only for single-threaded applications, and
5786 Emacs can be multi-threaded when it uses GTK.
5787 * Makefile.in (LIB_PTHREAD_SIGMASK): New macro.
5788 (LIBES): Use it.
5789 * callproc.c (Fcall_process):
5790 * process.c (create_process):
5791 * sysdep.c (sys_sigblock, sys_sigunblock, sys_sigsetmask):
5792 Use pthread_sigmask, not sigprocmask.
5793
5794 2011-07-08 Jan Djärv <jan.h.d@swipnet.se>
5795
5796 * gtkutil.c (qttip_cb): Set line wrap to FALSE for tooltip widget.
5797 (xg_prepare_tooltip): Revert text in x->ttip_lbl, margins was
5798 wrong (Bug#8591).
5799
5800 2011-07-08 Jan Djärv <jan.h.d@swipnet.se>
5801
5802 * gtkutil.c (xg_prepare_tooltip): Fix indentation and comment.
5803 Put text in x->ttip_lbl instead of gtk_tooltip_set_text (Bug#8591).
5804 (xg_hide_tooltip): Fix comment.
5805
5806 * nsterm.m (initFrameFromEmacs): Don't use ns_return_types
5807 in registerServicesMenuSendTypes.
5808 (validRequestorForSendType): Don't check ns_return_types.
5809
5810 * nsfns.m (Fx_open_connection): Put NSStringPboardType into
5811 ns_return_type.
5812
5813 2011-07-08 Jason Rumney <jasonr@gnu.org>
5814
5815 * w32term.c (x_make_frame_visible): Use SH_SHOWNORMAL rather than
5816 SH_SHOW for hidden windows (Bug#5482).
5817
5818 * w32fns.c (w32_wnd_proc) [WM_TIMER, WM_SET_CURSOR]: Avoid using
5819 frame struct members of non-existent frames (Bug#6284).
5820
5821 2011-07-08 Jan Djärv <jan.h.d@swipnet.se>
5822
5823 * nsterm.m (keyDown): Call to wantsToDelayTextChangeNotifications and
5824 variable firstTime not needed on OSX >= 10.6.
5825 (setPosition): setFloatValue:knobProportion: is deprecated on OSX
5826 >= 10.5. Use setKnobProportion, setDoubleValue.
5827
5828 * nsterm.h (MAC_OS_X_VERSION_10_3, MAC_OS_X_VERSION_10_4)
5829 (MAC_OS_X_VERSION_10_5): Define if not defined.
5830 (EmacsView, EmacsTooltip): Implements NSWindowDelegate on OSX >= 10.6.
5831 (EmacsMenu): Implements NSMenuDelegate on OSX >= 10.6.
5832 (EmacsToolbar): Implements NSToolbarDelegate on OSX >= 10.6.
5833
5834 * nsselect.m (ns_string_from_pasteboard): Don't use deprecated methods
5835 cString and lossyCString on OSX >= 10.4
5836
5837 * nsmenu.m (fillWithWidgetValue): Don't use deprecated method
5838 sizeToFit on OSX >= 10.2.
5839
5840 * nsimage.m (allocInitFromFile): Don't use deprecated method
5841 bestRepresentationForDevice on OSX >= 10.6.
5842
5843 * nsfns.m (check_ns_display_info): Cast to long and use %ld in error
5844 to avoid warning.
5845
5846 * emacs.c: Declare unexec_init_emacs_zone.
5847
5848 * nsgui.h: Fix compiler warning about gnulib redefining verify.
5849
5850 * nsselect.m (ns_get_local_selection): Change to extern (Bug#8842).
5851
5852 * nsmenu.m (ns_update_menubar): Remove useless setDelegate call
5853 on svcsMenu (Bug#8842).
5854
5855 * nsfns.m (Fx_open_connection): Remove NSStringPboardType from
5856 ns_return_types.
5857 (Fns_list_services): Just return Qnil on 10.6, code not working there.
5858
5859 * nsterm.m (QUTF8_STRING): Declare.
5860 (initFrameFromEmacs): Call registerServicesMenuSendTypes.
5861 (validRequestorForSendType): Return type is (id).
5862 Change indexOfObjectIdenticalTo to indexOfObject.
5863 Check if we have local selection before returning self (Bug#8842).
5864 (writeSelectionToPasteboard): Put local selection into paste board
5865 if we have a local selection (Bug#8842).
5866 (syms_of_nsterm): DEFSYM QUTF8_STRING.
5867
5868 * nsterm.h (MAC_OS_X_VERSION_10_6): Define here instead of nsterm.m.
5869 (ns_get_local_selection): Declare.
5870
5871 2011-07-07 Lars Magne Ingebrigtsen <larsi@gnus.org>
5872
5873 * keymap.c (describe_map_tree): Don't insert a double newline at
5874 the end of the buffer (bug#1169) and return whether we inserted
5875 something.
5876
5877 * callint.c (Fcall_interactively): Change "reading args" to
5878 "providing args" to try to clarify what it does (bug#1010).
5879
5880 2011-07-07 Kenichi Handa <handa@m17n.org>
5881
5882 * composite.c (composition_compute_stop_pos): Ignore a static
5883 composition starting before CHARPOS (Bug#8915).
5884
5885 * xdisp.c (handle_composition_prop): Likewise.
5886
5887 2011-07-07 Eli Zaretskii <eliz@gnu.org>
5888
5889 * term.c (produce_glyphs) <xassert>: Allow IT_GLYPHLESS in it->what.
5890 (Bug#9015)
5891
5892 2011-07-07 Kenichi Handa <handa@m17n.org>
5893
5894 * character.h (unicode_category_t): New enum type.
5895
5896 * chartab.c (uniprop_decoder_t, uniprop_encoder_t): New types.
5897 (Qchar_code_property_table): New variable.
5898 (UNIPROP_TABLE_P, UNIPROP_GET_DECODER)
5899 (UNIPROP_COMPRESSED_FORM_P): New macros.
5900 (char_table_ascii): Uncompress the compressed values.
5901 (sub_char_table_ref): New arg is_uniprop. Callers changed.
5902 Uncompress the compressed values.
5903 (sub_char_table_ref_and_range): Likewise.
5904 (char_table_ref_and_range): Uncompress the compressed values.
5905 (sub_char_table_set): New arg is_uniprop. Callers changed.
5906 Uncompress the compressed values.
5907 (sub_char_table_set_range): Args changed. Callers changed.
5908 (char_table_set_range): Adjuted for the above change.
5909 (map_sub_char_table): Delete args default_val and parent. Add arg
5910 top. Give decoded values to a Lisp function.
5911 (map_char_table): Adjust for the above change. Give decoded
5912 values to a Lisp function. Gcpro more variables.
5913 (uniprop_table_uncompress)
5914 (uniprop_decode_value_run_length): New functions.
5915 (uniprop_decoder, uniprop_decoder_count): New variables.
5916 (uniprop_get_decoder, uniprop_encode_value_character)
5917 (uniprop_encode_value_run_length, uniprop_encode_value_numeric):
5918 New functions.
5919 (uniprop_encoder, uniprop_encoder_count): New variables.
5920 (uniprop_get_encoder, uniprop_table)
5921 (Funicode_property_table_internal, Fget_unicode_property_internal)
5922 (Fput_unicode_property_internal): New functions.
5923 (syms_of_chartab): DEFSYM Qchar_code_property_table, defsubr
5924 Sunicode_property_table_internal, Sget_unicode_property_internal,
5925 and Sput_unicode_property_internal. Defvar_lisp
5926 char-code-property-alist.
5927
5928 * composite.c (CHAR_COMPOSABLE_P): Adjust for the change of
5929 Vunicode_category_table.
5930
5931 * font.c (font_range): Adjust for the change of
5932 Vunicode_category_table.
5933
5934 2011-07-07 Dan Nicolaescu <dann@ics.uci.edu>
5935
5936 * m/iris4d.h: Remove file, move contents ...
5937 * s/irix6-5.h: ... here.
5938
5939 2011-07-06 Paul Eggert <eggert@cs.ucla.edu>
5940
5941 Remove unportable assumption about struct layout (Bug#8884).
5942 * alloc.c (mark_buffer):
5943 * buffer.c (reset_buffer_local_variables, Fbuffer_local_variables)
5944 (clone_per_buffer_values): Don't assume that
5945 sizeof (struct buffer) is a multiple of sizeof (Lisp_Object).
5946 This isn't true in general, and it's particularly not true
5947 if Emacs is configured with --with-wide-int.
5948 * buffer.h (FIRST_FIELD_PER_BUFFER, LAST_FIELD_PER_BUFFER):
5949 New macros, used in the buffer.c change.
5950
5951 2011-07-05 Jan Djärv <jan.h.d@swipnet.se>
5952
5953 * xsettings.c: Use both GConf and GSettings if both are available.
5954 (store_config_changed_event): Add comment.
5955 (dpyinfo_valid, store_font_name_changed, map_tool_bar_style)
5956 (store_tool_bar_style_changed): New functions.
5957 (store_monospaced_changed): Add comment. Call dpyinfo_valid.
5958 (struct xsettings): Move font inside HAVE_XFT.
5959 (GSETTINGS_TOOL_BAR_STYLE, GSETTINGS_FONT_NAME): New defines.
5960 (GSETTINGS_MONO_FONT): Rename from SYSTEM_MONO_FONT.
5961 Move inside HAVE_XFT.
5962 (something_changed_gsettingsCB): Rename from something_changedCB.
5963 Check for changes in GSETTINGS_TOOL_BAR_STYLE and GSETTINGS_FONT_NAME
5964 also.
5965 (GCONF_TOOL_BAR_STYLE, GCONF_FONT_NAME): New defines.
5966 (GCONF_MONO_FONT): Rename from SYSTEM_MONO_FONT. Move inside HAVE_XFT.
5967 (something_changed_gconfCB): Rename from something_changedCB.
5968 Check for changes in GCONF_TOOL_BAR_STYLE and GCONF_FONT_NAME also.
5969 (parse_settings): Move check for font inside HAVE_XFT.
5970 (read_settings, apply_xft_settings): Add comment.
5971 (read_and_apply_settings): Add comment. Call map_tool_bar_style and
5972 store_tool_bar_style_changed. Move check for font inside HAVE_XFT and
5973 call store_font_name_changed.
5974 (xft_settings_event): Add comment.
5975 (init_gsettings): Add comment. Get values for GSETTINGS_TOOL_BAR_STYLE
5976 and GSETTINGS_FONT_NAME. Move check for fonts within HAVE_XFT.
5977 (init_gconf): Add comment. Get values for GCONF_TOOL_BAR_STYLE
5978 and GCONF_FONT_NAME. Move check for fonts within HAVE_XFT.
5979 (xsettings_initialize): Call init_gsettings last.
5980 (xsettings_get_system_font, xsettings_get_system_normal_font):
5981 Add comment.
5982
5983 2011-07-05 Paul Eggert <eggert@cs.ucla.edu>
5984
5985 Random fixes. E.g., (random) never returned negative values.
5986 * fns.c (Frandom): Use GET_EMACS_TIME for random seed, and add the
5987 subseconds part to the entropy, as that's a bit more random.
5988 Prefer signed to unsigned, since the signedness doesn't matter and
5989 in general we prefer signed. When given a limit, use a
5990 denominator equal to INTMASK + 1, not to VALMASK + 1, because the
5991 latter isn't right if USE_2_TAGS_FOR_INTS.
5992 * sysdep.c (get_random): Return a value in the range 0..INTMASK,
5993 not 0..VALMASK. Don't discard "excess" bits that random () returns.
5994
5995 2011-07-04 Stefan Monnier <monnier@iro.umontreal.ca>
5996
5997 * textprop.c (text_property_stickiness):
5998 Obey Vtext_property_default_nonsticky.
5999 (syms_of_textprop): Add `display' to Vtext_property_default_nonsticky.
6000 * w32fns.c (syms_of_w32fns):
6001 * xfns.c (syms_of_xfns): Don't Add `display' since it's there by default.
6002
6003 2011-07-04 Paul Eggert <eggert@cs.ucla.edu>
6004
6005 * fileio.c (barf_or_query_if_file_exists): Use S_ISDIR.
6006 This is more efficient than Ffile_directory_p and avoids a minor race.
6007
6008 2011-07-04 Lars Magne Ingebrigtsen <larsi@gnus.org>
6009
6010 * buffer.c (Foverlay_put): Say what the return value is
6011 (bug#7835).
6012
6013 * fileio.c (barf_or_query_if_file_exists): Check first if the file
6014 is a directory before asking whether to use the file name
6015 (bug#7564).
6016 (barf_or_query_if_file_exists): Make the "File is a directory"
6017 error be more correct.
6018
6019 * fns.c (Frequire): Remove the mention of the .gz files, since
6020 that's installation-specific, but keep the mention of
6021 `get-load-suffixes'.
6022
6023 2011-07-04 Paul Eggert <eggert@cs.ucla.edu>
6024
6025 * editfns.c (Fformat_time_string): Don't assume strlen fits in int.
6026 Report string overflow if the output is too long.
6027
6028 2011-07-04 Juanma Barranquero <lekktu@gmail.com>
6029
6030 * gnutls.c (Fgnutls_boot): Don't mention :verify-error.
6031 (syms_of_gnutls): Remove duplicate DEFSYM for
6032 Qgnutls_bootprop_verify_hostname_error, an error for
6033 Qgnutls_bootprop_verify_error (which is no longer used).
6034
6035 * eval.c (find_handler_clause): Remove parameters `sig' and `data',
6036 unused since 2011-01-26T20:02:07Z!monnier@iro.umontreal.ca. All callers changed.
6037 Also (re)move comments that are misplaced or no longer relevant.
6038
6039 2011-07-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
6040
6041 * callint.c (Finteractive): Clarify the meaning of "@" (bug#8813).
6042
6043 2011-07-03 Chong Yidong <cyd@stupidchicken.com>
6044
6045 * xfaces.c (Finternal_merge_in_global_face): Modify the foreground
6046 and background color parameters if they have been changed.
6047
6048 2011-07-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
6049
6050 * editfns.c (Fformat): Clarify the - and 0 flags (bug#6659).
6051
6052 2011-07-03 Paul Eggert <eggert@cs.ucla.edu>
6053
6054 * xsettings.c (SYSTEM_FONT): Define only when used.
6055 No need to define when HAVE_GSETTINGS || !HAVE_XFT.
6056
6057 * keymap.c (access_keymap_1): Now static.
6058
6059 2011-07-02 Chong Yidong <cyd@stupidchicken.com>
6060
6061 * keyboard.c (command_loop_1): If a down-mouse event is unbound,
6062 leave any prefix arg for the up event (Bug#1586).
6063
6064 2011-07-02 Lars Magne Ingebrigtsen <larsi@gnus.org>
6065
6066 * lread.c (syms_of_lread): Mention single symbols defined by
6067 `defvar' or `defconst' (bug#7154).
6068
6069 * fns.c (Frequire): Mention .el.gz files (bug#7314).
6070 (Frequire): Mention get-load-suffixes.
6071
6072 2011-07-02 Martin Rudalics <rudalics@gmx.at>
6073
6074 * window.h (window): Remove clone_number slot.
6075 * window.c (Fwindow_clone_number, Fset_window_clone_number):
6076 Remove.
6077 (make_parent_window, make_window, saved_window)
6078 (Fset_window_configuration, save_window_save): Don't deal with
6079 clone numbers.
6080 * buffer.c (Qclone_number): Remove declaration.
6081 (sort_overlays, overlay_strings): Don't deal with clone numbers.
6082
6083 2011-07-02 Stefan Monnier <monnier@iro.umontreal.ca>
6084
6085 Add multiple inheritance to keymaps.
6086 * keymap.c (Fmake_composed_keymap): New function.
6087 (Fset_keymap_parent): Simplify.
6088 (fix_submap_inheritance): Remove.
6089 (access_keymap_1): New function extracted from access_keymap to handle
6090 embedded parents and handle lists of maps.
6091 (access_keymap): Use it.
6092 (Fkeymap_prompt, map_keymap_internal, map_keymap, store_in_keymap)
6093 (Fcopy_keymap): Handle embedded parents.
6094 (Fcommand_remapping, define_as_prefix): Simplify.
6095 (Fkey_binding): Simplify.
6096 (syms_of_keymap): Move minibuffer-local-completion-map,
6097 minibuffer-local-filename-completion-map,
6098 minibuffer-local-must-match-map, and
6099 minibuffer-local-filename-must-match-map to Elisp.
6100 (syms_of_keymap): Defsubr make-composed-keymap.
6101 * keyboard.c (menu_bar_items): Use map_keymap_canonical.
6102 (parse_menu_item): Trivial simplification.
6103
6104 2011-07-01 Glenn Morris <rgm@gnu.org>
6105
6106 * Makefile.in (SETTINGS_LIBS): Fix typo.
6107
6108 2011-07-01 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny patch)
6109
6110 * coding.c (Fencode_coding_string): Record the last coding system
6111 used, as the function doc string says (bug#8738).
6112
6113 2011-07-01 Jan Djärv <jan.h.d@swipnet.se>
6114
6115 * xsettings.c (store_monospaced_changed): Take new font as arg and
6116 check for change against current_mono_font.
6117 (EMACS_TYPE_SETTINGS): Remove this and related defines.
6118 (emacs_settings_constructor, emacs_settings_get_property)
6119 (emacs_settings_set_property, emacs_settings_class_init)
6120 (emacs_settings_init, gsettings_obj): Remove.
6121 (something_changedCB): New function for HAVE_GSETTINGS.
6122 (something_changedCB): HAVE_GCONF: Call store_monospaced_changed
6123 with value as argument.
6124 (init_gsettings): Check that GSETTINGS_SCHEMA exists before calling
6125 g_settings_new (Bug#8967). Do not create gsettings_obj.
6126 Remove calls to g_settings_bind. Connect something_changedCB to
6127 "changed".
6128
6129 * xgselect.c: Add defined (HAVE_GSETTINGS).
6130 (xgselect_initialize): Ditto.
6131
6132 * process.c: Add defined (HAVE_GSETTINGS) for xgselect.h
6133 (wait_reading_process_output): Add defined (HAVE_GSETTINGS) for
6134 xg_select.
6135
6136 2011-07-01 Paul Eggert <eggert@cs.ucla.edu>
6137
6138 * eval.c (struct backtrace): Simplify and port the data structure.
6139 Do not assume that "int nargs : BITS_PER_INT - 2;" produces a
6140 signed bit field, as this assumption is not portable and it makes
6141 Emacs crash when compiled with Sun C 5.8 on sparc. Do not use
6142 "char debug_on_exit : 1" as this is not portable either; instead,
6143 use the portable "unsigned int debug_on_exit : 1". Remove unused
6144 member evalargs. Remove obsolete comments about cc bombing out.
6145
6146 2011-06-30 Jan Djärv <jan.h.d@swipnet.se>
6147
6148 * xsettings.c: Include glib-object.h, gio/gio.h if HAVE_GSETTINGS.
6149 Let HAVE_GSETTINGS override HAVE_GCONF.
6150 (store_monospaced_changed): New function.
6151 (EMACS_SETTINGS): A new type derived from GObject to handle
6152 GSettings notifications.
6153 (emacs_settings_constructor, emacs_settings_get_property)
6154 (emacs_settings_set_property, emacs_settings_class_init):
6155 New functions.
6156 (gsettings_client, gsettings_obj): New variables.
6157 (GSETTINGS_SCHEMA): New define.
6158 (something_changedCB): Call store_monospaced_changed.
6159 (init_gsettings): New function.
6160 (xsettings_initialize): Call init_gsettings.
6161 (syms_of_xsettings): Initialize gsettings_client, gsettings_obj
6162 to NULL.
6163
6164 * Makefile.in (SETTINGS_CFLAGS, SETTINGS_LIBS): Rename from
6165 GCONF_CFLAGS/LIBS.
6166
6167 2011-06-29 Martin Rudalics <rudalics@gmx.at>
6168
6169 * window.c (resize_root_window, grow_mini_window)
6170 (shrink_mini_window): Rename Qresize_root_window to
6171 Qwindow_resize_root_window and Qresize_root_window_vertically to
6172 Qwindow_resize_root_window_vertically.
6173
6174 2011-06-28 Paul Eggert <eggert@cs.ucla.edu>
6175
6176 * gnutls.c (Qgnutls_bootprop_verify_error): Remove unused var.
6177
6178 2011-06-27 Juanma Barranquero <lekktu@gmail.com>
6179
6180 * makefile.w32-in: Redesign dependencies so they reflect more
6181 clearly which files are directly included by each source file,
6182 and not through other includes.
6183
6184 2011-06-27 Martin Rudalics <rudalics@gmx.at>
6185
6186 * buffer.c (Qclone_number): Declare static and DEFSYM it.
6187 (sort_overlays, overlay_strings): When an overlay's clone number
6188 matches the window's clone number process the overlay even if
6189 the overlay's window property doesn't match the current window.
6190
6191 * window.c (Fwindow_vchild): Rename to Fwindow_top_child.
6192 (Fwindow_hchild): Rename to Fwindow_left_child.
6193 (Fwindow_next): Rename to Fwindow_next_sibling.
6194 (Fwindow_prev): Rename to Fwindow_prev_sibling.
6195 (resize_window_check): Rename to window_resize_check.
6196 (resize_window_apply): Rename to window_resize_apply.
6197 (Fresize_window_apply): Rename to Fwindow_resize_apply.
6198 (Fdelete_other_windows_internal, resize_frame_windows)
6199 (Fsplit_window_internal, Fdelete_window_internal)
6200 (grow_mini_window, shrink_mini_window)
6201 (Fresize_mini_window_internal): Fix callers accordingly.
6202
6203 2011-06-26 Jan Djärv <jan.h.d@swipnet.se>
6204
6205 * emacsgtkfixed.h: State that this is only used with Gtk+3.
6206 (emacs_fixed_set_min_size): Remove.
6207 (emacs_fixed_new): Take frame as argument.
6208
6209 * emacsgtkfixed.c: State that this is only used with Gtk+3.
6210 (_EmacsFixedPrivate): Remove minwidth/height.
6211 Add struct frame *f.
6212 (emacs_fixed_init): Initialize priv->f.
6213 (get_parent_class, emacs_fixed_set_min_size): Remove.
6214 (emacs_fixed_new): Set priv->f to argument.
6215 (emacs_fixed_get_preferred_width)
6216 (emacs_fixed_get_preferred_height): Use min_width/height from
6217 frames size_hint to set minimum and natural (Bug#8919).
6218 (XSetWMSizeHints, XSetWMNormalHints): Override these functions
6219 and use min_width/height from frames size_hint to set
6220 min_width/height (Bug#8919).
6221
6222 * gtkutil.c (xg_create_frame_widgets): Pass f to emacs_fixed_new.
6223 (x_wm_set_size_hint): Remove call to emacs_fixed_set_min_size.
6224 Fix indentation.
6225
6226 2011-06-26 Eli Zaretskii <eliz@gnu.org>
6227
6228 * bidi.c (bidi_paragraph_init): Test for ZV_BYTE before calling
6229 bidi_at_paragraph_end, since fast_looking_at doesn't like to be
6230 called at ZV.
6231
6232 2011-06-26 Chong Yidong <cyd@stupidchicken.com>
6233
6234 * process.c (wait_reading_process_output): Bypass select if
6235 waiting for a cell while ignoring keyboard input, and input is
6236 pending. Suggested by Jan Djärv (Bug#8869).
6237
6238 2011-06-25 Paul Eggert <eggert@cs.ucla.edu>
6239
6240 Use gnulib's dup2 module instead of rolling our own.
6241 * sysdep.c (dup2) [!HAVE_DUP2]: Remove; gnulib now does this.
6242
6243 2011-06-25 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
6244
6245 * dispnew.c (scrolling_window): Before scrolling, turn off a
6246 mouse-highlight in the window being scrolled.
6247
6248 2011-06-24 Juanma Barranquero <lekktu@gmail.com>
6249
6250 Move DEFSYM to lisp.h and use everywhere.
6251
6252 * character.h (DEFSYM): Move declaration...
6253 * lisp.h (DEFSYM): ...here.
6254
6255 * gnutls.c:
6256 * minibuf.c:
6257 * w32menu.c:
6258 * w32proc.c:
6259 * w32select.c: Don't include character.h.
6260
6261 * alloc.c (syms_of_alloc):
6262 * buffer.c (syms_of_buffer):
6263 * bytecode.c (syms_of_bytecode):
6264 * callint.c (syms_of_callint):
6265 * casefiddle.c (syms_of_casefiddle):
6266 * casetab.c (init_casetab_once):
6267 * category.c (init_category_once, syms_of_category):
6268 * ccl.c (syms_of_ccl):
6269 * cmds.c (syms_of_cmds):
6270 * composite.c (syms_of_composite):
6271 * dbusbind.c (syms_of_dbusbind):
6272 * dired.c (syms_of_dired):
6273 * dispnew.c (syms_of_display):
6274 * doc.c (syms_of_doc):
6275 * editfns.c (syms_of_editfns):
6276 * emacs.c (syms_of_emacs):
6277 * eval.c (syms_of_eval):
6278 * fileio.c (syms_of_fileio):
6279 * fns.c (syms_of_fns):
6280 * frame.c (syms_of_frame):
6281 * fringe.c (syms_of_fringe):
6282 * insdel.c (syms_of_insdel):
6283 * keymap.c (syms_of_keymap):
6284 * lread.c (init_obarray, syms_of_lread):
6285 * macros.c (syms_of_macros):
6286 * msdos.c (syms_of_msdos):
6287 * print.c (syms_of_print):
6288 * process.c (syms_of_process):
6289 * search.c (syms_of_search):
6290 * sound.c (syms_of_sound):
6291 * syntax.c (init_syntax_once, syms_of_syntax):
6292 * terminal.c (syms_of_terminal):
6293 * textprop.c (syms_of_textprop):
6294 * undo.c (syms_of_undo):
6295 * w32.c (globals_of_w32):
6296 * window.c (syms_of_window):
6297 * xdisp.c (syms_of_xdisp):
6298 * xfaces.c (syms_of_xfaces):
6299 * xfns.c (syms_of_xfns):
6300 * xmenu.c (syms_of_xmenu):
6301 * xsettings.c (syms_of_xsettings):
6302 * xterm.c (syms_of_xterm): Use DEFSYM.
6303
6304 2011-06-24 Teodor Zlatanov <tzz@lifelogs.com>
6305
6306 * gnutls.c (syms_of_gnutls): Use the DEFSYM macro from character.h.
6307
6308 2011-06-23 Paul Eggert <eggert@cs.ucla.edu>
6309
6310 Integer and buffer overflow fixes (Bug#8873).
6311
6312 * print.c (printchar, strout): Check for string overflow.
6313 (PRINTPREPARE, printchar, strout):
6314 Don't set size unless allocation succeeds.
6315
6316 * minibuf.c (read_minibuf_noninteractive): Use ptrdiff_t, not int,
6317 for sizes. Check for string overflow more accurately.
6318 Simplify newline removal at end; this suppresses a GCC 4.6.0 warning.
6319
6320 * macros.c: Integer and buffer overflow fixes.
6321 * keyboard.h (struct keyboard.kbd_macro_bufsize):
6322 * macros.c (Fstart_kbd_macro, store_kbd_macro_char):
6323 Use ptrdiff_t, not int, for sizes.
6324 Don't increment bufsize until after realloc succeeds.
6325 Check for size-calculation overflow.
6326 (Fstart_kbd_macro): Use EMACS_INT, not int, for XINT result.
6327
6328 * lisp.h (DEFVAR_KBOARD): Use offsetof instead of char * finagling.
6329
6330 * lread.c: Integer overflow fixes.
6331 (read_integer): Radix is now EMACS_INT, not int,
6332 to improve quality of diagnostics for out-of-range radices.
6333 Calculate buffer size correctly for out-of-range radices.
6334 (read1): Check for integer overflow in radices, and in
6335 read-circle numbers.
6336 (read_escape): Avoid int overflow.
6337 (Fload, openp, read_buffer_size, read1)
6338 (substitute_object_recurse, read_vector, read_list, map_obarray):
6339 Use ptrdiff_t, not int, for sizes.
6340 (read1): Use EMACS_INT, not int, for sizes.
6341 Check for size overflow.
6342
6343 * image.c (cache_image): Check for size arithmetic overflow.
6344
6345 * lread.c: Integer overflow issues.
6346 (saved_doc_string_size, saved_doc_string_length)
6347 (prev_saved_doc_string_size, prev_saved_doc_string_length):
6348 Now ptrdiff_t, not int.
6349 (read1): Don't assume doc string length fits in int. Check for
6350 out-of-range doc string lengths.
6351 (read_list): Don't assume file position fits in int.
6352 (read_escape): Check for hex character overflow.
6353
6354 2011-06-22 Leo Liu <sdl.web@gmail.com>
6355
6356 * minibuf.c (Fcompleting_read_default, Vcompleting_read_function):
6357 Move to minibuffer.el.
6358
6359 2011-06-22 Paul Eggert <eggert@cs.ucla.edu>
6360
6361 Fixes for GLYPH_DEBUG found by GCC 4.6.0 static checking.
6362 The following patches are for when GLYPH_DEBUG && !XASSERT.
6363 * dispextern.h (trace_redisplay_p, dump_glyph_string):
6364 * dispnew.c (flush_stdout):
6365 * xdisp.c (dump_glyph_row, dump_glyph_matrix, dump_glyph):
6366 Mark as externally visible.
6367 * dispnew.c (check_window_matrix_pointers): Now static.
6368 * dispnew.c (window_to_frame_vpos):
6369 * xfns.c (unwind_create_frame):
6370 * xterm.c (x_check_font): Remove unused local.
6371 * scroll.c (CHECK_BOUNDS):
6372 * xfaces.c (cache_fache): Rename local to avoid shadowing.
6373 * xfns.c, w32fns.c (image_cache_refcount, dpyinfo_refcount): Now static.
6374 * xdisp.c (check_window_end): Now a no-op if !XASSERTS.
6375 (debug_first_unchanged_at_end_vpos, debug_last_unchanged_at_beg_vpos)
6376 (debug_dvpos, debug_dy, debug_delta, debug_delta_bytes, debug_end_vpos):
6377 Now static.
6378 (debug_method_add): Use va_list and vsprintf rather than relying
6379 on undefined behavior with wrong number of arguments.
6380 (dump_glyph, dump_glyph_row, Fdump_glyph_matrix):
6381 Don't assume ptrdiff_t and EMACS_INT are the same width as int.
6382 In this code, it's OK to assume C99 behavior for ptrdiff_t formats
6383 since we're not interested in debugging glyphs with old libraries.
6384 * xfaces.c (cache_face): Move debugging code earlier; this pacifies
6385 GCC 4.6.0's static checking.
6386
6387 2011-06-22 Paul Eggert <eggert@cs.ucla.edu>
6388
6389 Integer overflow and signedness fixes (Bug#8873).
6390 A few related buffer overrun fixes, too.
6391
6392 * font.c (font_score): Use EMACS_INT, not int, to store XINT value.
6393
6394 * dispextern.h (struct face.stipple):
6395 * image.c (x_bitmap_height, x_bitmap_width, x_bitmap_pixmap)
6396 (x_bitmap_mask, x_allocate_bitmap_record)
6397 (x_create_bitmap_from_data, x_create_bitmap_from_file)
6398 (x_destroy_bitmap, x_destroy_all_bitmaps, x_create_bitmap_mask)
6399 (x_create_bitmap_from_xpm_data):
6400 * nsterm.h (struct ns_display_info.bitmaps_size, .bitmaps_last):
6401 * w32term.h (struct w32_display_info.icon_bitmap_id, .bitmaps_size)
6402 (.bitmaps_last):
6403 * xfaces.c (load_pixmap):
6404 * xterm.c (x_bitmap_icon, x_wm_set_icon_pixmap):
6405 * xterm.h (struct x_display_info.icon_bitmap_id, .bitmaps_size)
6406 (.bitmaps_last, struct x_output.icon_bitmap):
6407 Use ptrdiff_t, not int, for bitmap indexes.
6408 (x_allocate_bitmap_record): Check for size overflow.
6409 * dispextern.h, lisp.h: Adjust to API changes elsewhere.
6410
6411 Use ptrdiff_t, not int, for overlay counts.
6412 * buffer.h (overlays_at, sort_overlays, GET_OVERLAYS_AT):
6413 * editfns.c (overlays_around, get_pos_property):
6414 * textprop.c (get_char_property_and_overlay):
6415 * xdisp.c (next_overlay_change, note_mouse_highlight):
6416 * xfaces.c (face_at_buffer_position):
6417 * buffer.c (OVERLAY_COUNT_MAX): New macro.
6418 (overlays_at, overlays_in, sort_overlays, Foverlays_at)
6419 (Fnext_overlay_change, Fprevious_overlay_change)
6420 (mouse_face_overlay_overlaps, Foverlays_in):
6421 Use ptrdiff_t, not int, for sizes.
6422 (overlays_at, overlays_in): Check for size-calculation overflow.
6423
6424 * xterm.c (xim_initialize, same_x_server): Strlen may not fit in int.
6425
6426 * xsmfns.c (smc_save_yourself_CB, x_session_initialize): Avoid strlen.
6427 (x_session_initialize): Do not assume string length fits in int.
6428
6429 * xsettings.c (apply_xft_settings): Fix potential buffer overrun.
6430 This is unlikely, but can occur if DPI is outlandish.
6431
6432 * xsettings.c (Ffont_get_system_normal_font, Ffont_get_system_font):
6433 * xselect.c (Fx_get_atom_name): Avoid need for strlen.
6434
6435 * xrdb.c: Don't assume strlen fits in int; avoid some strlens.
6436 * xrdb.c (magic_file_p, search_magic_path):
6437 Omit last arg SUFFIX; it was always 0. All callers changed.
6438 (magic_file_p): Use ptrdiff_t, not int. Check for size overflow.
6439
6440 * xfont.c (xfont_match): Avoid need for strlen.
6441
6442 * xfns.c: Don't assume strlen fits in int.
6443 (xic_create_fontsetname, x_window): Use ptrdiff_t, not int.
6444
6445 * xdisp.c (message_log_check_duplicate): Return intmax_t,
6446 not unsigned long, as we prefer signed integers. All callers changed.
6447 Detect integer overflow in repeat count.
6448 (message_dolog): Don't assume print length fits in 39 bytes.
6449 (display_mode_element): Don't assume strlen fits in int.
6450
6451 * termcap.c: Don't assume sizes fit in int and never overflow.
6452 (struct termcap_buffer, tgetent): Use ptrdiff_t, not int, for sizes.
6453 (gobble_line): Check for size-calculation overflow.
6454
6455 * minibuf.c (Fread_buffer):
6456 * lread.c (intern, intern_c_string):
6457 * image.c (xpm_scan) [HAVE_NS && !HAVE_XPM]:
6458 Don't assume string length fits in int.
6459
6460 * keyboard.c (parse_tool_bar_item):
6461 * gtkutil.c (style_changed_cb): Avoid need for strlen.
6462
6463 * font.c: Don't assume string length fits in int.
6464 (font_parse_xlfd, font_parse_fcname, font_unparse_fcname):
6465 Use ptrdiff_t, not int.
6466 (font_intern_prop): Don't assume string length fits in int.
6467 Don't assume integer property fits in fixnum.
6468 * font.h (font_intern_prop): 2nd arg is now ptrdiff_t, not int.
6469
6470 * filelock.c: Fix some buffer overrun and integer overflow issues.
6471 (get_boot_time): Don't assume gzip command string fits in 100 bytes.
6472 Reformulate so as not to need the command string.
6473 Invoke gzip -cd rather than gunzip, as it's more portable.
6474 (lock_info_type, lock_file_1, lock_file):
6475 Don't assume pid_t and time_t fit in unsigned long.
6476 (LOCK_PID_MAX): Remove; we now use more-reliable bounds.
6477 (current_lock_owner): Prefer signed type for sizes.
6478 Use memcpy, not strncpy, where memcpy is what is really wanted.
6479 Don't assume (via atoi) that time_t and pid_t fit in int.
6480 Check for time_t and/or pid_t out of range, e.g., via a network share.
6481 Don't alloca where an auto var works fine.
6482
6483 * fileio.c: Fix some integer overflow issues.
6484 (file_name_as_directory, Fexpand_file_name, Fsubstitute_in_file_name):
6485 Don't assume string length fits in int.
6486 (directory_file_name): Don't assume string length fits in long.
6487 (make_temp_name): Don't assume pid fits in int, or that its print
6488 length is less than 20.
6489
6490 * data.c (Fsubr_name): Rewrite to avoid a strlen call.
6491
6492 * coding.c (make_subsidiaries): Don't assume string length fits in int.
6493
6494 * callproc.c (child_setup): Rewrite to avoid two strlen calls.
6495
6496 * process.c (Fformat_network_address): Use EMACS_INT, not EMACS_UINT.
6497 We prefer signed integers, even for size calculations.
6498
6499 * emacs.c: Don't assume string length fits in 'int'.
6500 (DEFINE_DUMMY_FUNCTION, sort_args): Use ptrdiff_t, not int.
6501 (main): Don't invoke strlen when not needed.
6502
6503 * dbusbind.c (XD_ERROR): Don't arbitrarily truncate string.
6504 (XD_DEBUG_MESSAGE): Don't waste a byte.
6505
6506 * callproc.c (getenv_internal_1, getenv_internal)
6507 (Fgetenv_internal):
6508 * buffer.c (init_buffer): Don't assume string length fits in 'int'.
6509
6510 * lread.c (invalid_syntax): Omit length argument.
6511 All uses changed. This doesn't fix a bug, but it simplifies the
6512 code away from its former Hollerith-constant appearance, and it's
6513 one less 'int' to worry about when looking at integer-overflow issues.
6514 (string_to_number): Simplify 2011-04-26 change by invoking xsignal1.
6515
6516 * lisp.h (DEFUN): Remove bogus use of sizeof (struct Lisp_Subr).
6517 This didn't break anything, but it didn't help either.
6518 It's confusing to put a bogus integer in a place where the actual
6519 value does not matter.
6520 (LIST_END_P): Remove unused macro and its bogus comment.
6521 (make_fixnum_or_float): Remove unnecessary cast to EMACS_INT.
6522
6523 * lisp.h (union Lisp_Object.i): EMACS_INT, not EMACS_UINT.
6524 This is for consistency with the ordinary, non-USE_LISP_UNION_TYPE,
6525 implementation.
6526 (struct Lisp_Bool_Vector.size): EMACS_INT, not EMACS_UINT.
6527 We prefer signed types, and the value cannot exceed the EMACS_INT
6528 range anyway (because otherwise the length would not be representable).
6529 (XSET) [USE_LISP_UNION_TYPE]: Use uintptr_t and intptr_t,
6530 not EMACS_UINT and EMACS_INT, when converting pointer to integer.
6531 This avoids a GCC warning when WIDE_EMACS_INT.
6532
6533 * indent.c (sane_tab_width): New function.
6534 (current_column, scan_for_column, Findent_to, position_indentation)
6535 (compute_motion): Use it. This is just for clarity.
6536 (Fcompute_motion): Don't assume hscroll and tab offset fit in int.
6537
6538 * image.c (xbm_image_p): Don't assume stated width, height fit in int.
6539
6540 * lisp.h (lint_assume): New macro.
6541 * composite.c (composition_gstring_put_cache):
6542 * ftfont.c (ftfont_shape_by_flt): Use it to pacify GCC 4.6.0.
6543
6544 * editfns.c, insdel.c:
6545 Omit unnecessary forward decls, to simplify future changes.
6546
6547 * ftfont.c (ftfont_shape_by_flt): Use signed integers for lengths.
6548
6549 * font.c (Ffont_shape_gstring): Don't assume glyph len fits in 'int'.
6550
6551 * fns.c (Ffillarray): Don't assume bool vector size fits in 'int'.
6552 Use much-faster test for byte-length change.
6553 Don't assume string byte-length fits in 'int'.
6554 Check that character arg fits in 'int'.
6555 (mapcar1): Declare byte as byte, for clarity.
6556
6557 * alloc.c (Fmake_bool_vector): Avoid unnecessary multiplication.
6558
6559 * fns.c (concat): Catch string overflow earlier.
6560 Do not rely on integer wraparound.
6561
6562 * dispextern.h (struct it.overlay_strings_charpos)
6563 (struct it.selective): Now EMACS_INT, not int.
6564 * xdisp.c (forward_to_next_line_start)
6565 (back_to_previous_visible_line_start)
6566 (reseat_at_next_visible_line_start, next_element_from_buffer):
6567 Don't arbitrarily truncate the value of 'selective' to int.
6568
6569 * xdisp.c (init_iterator): Use XINT, not XFASTINT; it might be < 0.
6570
6571 * composite.c: Don't truncate sizes to 'int'.
6572 (composition_gstring_p, composition_reseat_it)
6573 (composition_adjust_point): Use EMACS_INT, not int.
6574 (get_composition_id, composition_gstring_put_cache): Use EMACS_INT,
6575 not EMACS_UINT, for indexes.
6576
6577 * category.h (CATEGORY_SET_P): Remove unnecessary cast to EMACS_INT.
6578
6579 * buffer.c: Include <verify.h>.
6580 (struct sortvec.priority, struct sortstr.priority):
6581 Now EMACS_INT, not int.
6582 (compare_overlays, cmp_for_strings): Avoid subtraction overflow.
6583 (struct sortstr.size, record_overlay_string)
6584 (struct sortstrlist.size, struct sortlist.used):
6585 Don't truncate size to int.
6586 (record_overlay_string): Check for size-calculation overflow.
6587 (init_buffer_once): Check at compile-time, not run-time.
6588
6589 2011-06-22 Jim Meyering <meyering@redhat.com>
6590
6591 Don't leak an XBM-image-sized buffer
6592 * image.c (xbm_load): Free the image buffer after using it.
6593
6594 2011-06-21 Paul Eggert <eggert@cs.ucla.edu>
6595
6596 Port to Sun C.
6597 * composite.c (find_automatic_composition): Omit needless 'return 0;'
6598 that Sun C diagnosed.
6599 * fns.c (secure_hash): Fix pointer signedness issue.
6600 * intervals.c (static_offset_intervals): New function.
6601 (offset_intervals): Use it.
6602
6603 2011-06-21 Leo Liu <sdl.web@gmail.com>
6604
6605 * deps.mk (fns.o):
6606 * makefile.w32-in ($(BLD)/fns.$(O)): Include sha256.h and
6607 sha512.h.
6608
6609 * fns.c (secure_hash): Rename from crypto_hash_function and change
6610 the first arg to accept symbols.
6611 (Fsecure_hash): New primitive.
6612 (syms_of_fns): New symbols.
6613
6614 2011-06-20 Deniz Dogan <deniz@dogan.se>
6615
6616 * process.c (Fset_process_buffer): Clarify return value in
6617 docstring.
6618
6619 2011-06-18 Chong Yidong <cyd@stupidchicken.com>
6620
6621 * dispnew.c (add_window_display_history): Use BVAR.
6622
6623 * xdisp.c (debug_method_add): Use BVAR.
6624 (check_window_end, dump_glyph_matrix, dump_glyph)
6625 (dump_glyph_row, dump_glyph_string): Convert arglist to ANSI C.
6626
6627 * xfaces.c (check_lface_attrs, check_lface, dump_realized_face):
6628 Likewise.
6629
6630 * xfns.c (Fx_create_frame, x_create_tip_frame): Delay image cache
6631 check till after the cache is created in init_frame_faces.
6632
6633 2011-06-17 Stefan Monnier <monnier@iro.umontreal.ca>
6634
6635 * fns.c (Fsafe_length): Yet another int/Lisp_Object mixup.
6636
6637 2011-06-16 Paul Eggert <eggert@cs.ucla.edu>
6638
6639 * lisp.h: Include <limits.h>, for INT_MAX, LONG_MAX, LLONG_MAX.
6640 Without this, prin1 mishandles Lisp_Misc_Save_Value printing on
6641 hosts with pre-C99 libraries, because pD is wrongly defined to "t".
6642
6643 Improve buffer-overflow checking (Bug#8873).
6644 * fileio.c (Finsert_file_contents):
6645 * insdel.c (insert_from_buffer_1, replace_range, replace_range_2):
6646 Remove the old (too-loose) buffer overflow checks.
6647 They weren't needed, since make_gap checks for buffer overflow.
6648 * insdel.c (make_gap_larger): Catch buffer overflows that were missed.
6649 The old code merely checked for Emacs fixnum overflow, and relied
6650 on undefined (wraparound) behavior. The new code avoids undefined
6651 behavior, and also checks for ptrdiff_t and/or size_t overflow.
6652
6653 * editfns.c (Finsert_char): Don't dump core with very negative counts.
6654 Tune. Don't use wider integers than needed. Don't use alloca.
6655 Use a bigger 'string' buffer. Rewrite to avoid 'n > 0' test.
6656
6657 * insdel.c (replace_range): Fix buf overflow when insbytes < outgoing.
6658
6659 * insdel.c, lisp.h (buffer_overflow): New function.
6660 (insert_from_buffer_1, replace_range, replace_range_2):
6661 * insdel.c (make_gap_larger):
6662 * editfns.c (Finsert_char):
6663 * fileio.c (Finsert_file_contents): Use it, to normalize wording.
6664
6665 * buffer.h (BUF_BYTES_MAX): Cast to ptrdiff_t so that it's signed.
6666
6667 2011-06-15 Paul Eggert <eggert@cs.ucla.edu>
6668
6669 Integer overflow and signedness fixes (Bug#8873, Bug#8828).
6670
6671 * ccl.c (ASCENDING_ORDER): New macro, to work around GCC bug 43772.
6672 (GET_CCL_RANGE, IN_INT_RANGE): Use it.
6673
6674 * fileio.c: Don't assume EMACS_INT fits in off_t.
6675 (emacs_lseek): New static function.
6676 (Finsert_file_contents, Fwrite_region): Use it.
6677 Use SEEK_SET, SEEK_CUR, SEEK_END as appropriate.
6678
6679 * fns.c (Fload_average): Don't assume 100 * load average fits in int.
6680
6681 * fns.c: Don't overflow int when computing a list length.
6682 * fns.c (QUIT_COUNT_HEURISTIC): New constant.
6683 (Flength, Fsafe_length): Use EMACS_INT, not int, to avoid unwanted
6684 truncation on 64-bit hosts. Check for QUIT every
6685 QUIT_COUNT_HEURISTIC entries rather than every other entry; that's
6686 faster and is responsive enough.
6687 (Flength): Report an error instead of overflowing an integer.
6688 (Fsafe_length): Return a float if the value is not representable
6689 as a fixnum. This shouldn't happen except in contrived situations.
6690 (Fnthcdr, Fsort): Don't assume list length fits in int.
6691 (Fcopy_sequence): Don't assume vector length fits in int.
6692
6693 * alloc.c: Check that resized vectors' lengths fit in fixnums.
6694 (header_size, word_size): New constants.
6695 (allocate_vectorlike): Don't check size overflow here.
6696 (allocate_vector): Check it here instead, since this is the only
6697 caller of allocate_vectorlike that could cause overflow.
6698 Check that the new vector's length is representable as a fixnum.
6699
6700 * fns.c (next_almost_prime): Don't return a multiple of 3 or 5.
6701 The previous code was bogus. For example, next_almost_prime (32)
6702 returned 39, which is undesirable as it is a multiple of 3; and
6703 next_almost_prime (24) returned 25, which is a multiple of 5 so
6704 why was the code bothering to check for multiples of 7?
6705
6706 * bytecode.c (exec_byte_code): Use ptrdiff_t, not int, for vector length.
6707
6708 * eval.c, doprnt.c (SIZE_MAX): Remove; inttypes.h defines this now.
6709
6710 Variadic C functions now count arguments with ptrdiff_t.
6711 This partly undoes my 2011-03-30 change, which replaced int with size_t.
6712 Back then I didn't know that the Emacs coding style prefers signed int.
6713 Also, in the meantime I found a few more instances where arguments
6714 were being counted with int, which may truncate counts on 64-bit
6715 machines, or EMACS_INT, which may be unnecessarily wide.
6716 * lisp.h (struct Lisp_Subr.function.aMANY)
6717 (DEFUN_ARGS_MANY, internal_condition_case_n, safe_call):
6718 Arg counts are now ptrdiff_t, not size_t.
6719 All variadic functions and their callers changed accordingly.
6720 (struct gcpro.nvars): Now size_t, not size_t. All uses changed.
6721 * bytecode.c (exec_byte_code): Check maxdepth for overflow,
6722 to avoid potential buffer overrun. Don't assume arg counts fit in 'int'.
6723 * callint.c (Fcall_interactively): Check arg count for overflow,
6724 to avoid potential buffer overrun. Use signed char, not 'int',
6725 for 'varies' array, so that we needn't bother to check its size
6726 calculation for overflow.
6727 * editfns.c (Fformat): Use ptrdiff_t, not EMACS_INT, to count args.
6728 * eval.c (apply_lambda):
6729 * fns.c (Fmapconcat): Use XFASTINT, not XINT, to get args length.
6730 (struct textprop_rec.argnum): Now ptrdiff_t, not int. All uses changed.
6731 (mapconcat): Use ptrdiff_t, not int and EMACS_INT, to count args.
6732
6733 * callint.c (Fcall_interactively): Don't use index var as event count.
6734
6735 * vm-limit.c (check_memory_limits): Fix incorrect extern function decls.
6736 * mem-limits.h (SIZE): Remove; no longer used.
6737
6738 * xterm.c (x_alloc_nearest_color_1): Prefer int to long when int works.
6739
6740 Remove unnecessary casts.
6741 * xterm.c (x_term_init):
6742 * xfns.c (x_set_border_pixel):
6743 * widget.c (create_frame_gcs): Remove casts to unsigned long etc.
6744 These aren't needed now that we assume ANSI C.
6745
6746 * sound.c (Fplay_sound_internal): Remove cast to unsigned long.
6747 It's more likely to cause problems (due to unsigned overflow)
6748 than to cure them.
6749
6750 * dired.c (Ffile_attributes): Don't use 32-bit hack on 64-bit hosts.
6751
6752 * unexelf.c (unexec): Don't assume BSS addr fits in unsigned.
6753
6754 * xterm.c (handle_one_xevent): Omit unnecessary casts to unsigned.
6755
6756 * keyboard.c (modify_event_symbol): Don't limit alist len to UINT_MAX.
6757
6758 * lisp.h (CHAR_TABLE_SET): Omit now-redundant test.
6759
6760 * lread.c (Fload): Don't compare a possibly-garbage time_t value.
6761
6762 GLYPH_CODE_FACE returns EMACS_INT, not int.
6763 * dispextern.h (merge_faces):
6764 * xfaces.c (merge_faces):
6765 * xdisp.c (get_next_display_element, next_element_from_display_vector):
6766 Don't assume EMACS_INT fits in int.
6767
6768 * character.h (CHAR_VALID_P): Remove unused parameter.
6769 * fontset.c, lisp.h, xdisp.c: All uses changed.
6770
6771 * editfns.c (Ftranslate_region_internal): Omit redundant test.
6772
6773 * fns.c (concat): Minor tuning based on overflow analysis.
6774 This doesn't fix any bugs. Use int to hold character, instead
6775 of constantly refetching from Emacs object. Use XFASTINT, not
6776 XINT, for value known to be a character. Don't bother comparing
6777 a single byte to 0400, as it's always less.
6778
6779 * floatfns.c (Fexpt):
6780 * fileio.c (make_temp_name): Omit unnecessary cast to unsigned.
6781
6782 * editfns.c (Ftranslate_region_internal): Use int, not EMACS_INT
6783 for characters.
6784
6785 * doc.c (get_doc_string): Omit (unsigned)c that mishandled negatives.
6786
6787 * data.c (Faset): If ARRAY is a string, check that NEWELT is a char.
6788 Without this fix, on a 64-bit host (aset S 0 4294967386) would
6789 incorrectly succeed when S was a string, because 4294967386 was
6790 truncated before it was used.
6791
6792 * chartab.c (Fchar_table_range): Use CHARACTERP to check range.
6793 Otherwise, an out-of-range integer could cause undefined behavior
6794 on a 64-bit host.
6795
6796 * composite.c: Use int, not EMACS_INT, for characters.
6797 (fill_gstring_body, composition_compute_stop_pos): Use int, not
6798 EMACS_INT, for values that are known to be in character range.
6799 This doesn't fix any bugs but is the usual style inside Emacs and
6800 may generate better code on 32-bit machines.
6801
6802 Make sure a 64-bit char is never passed to ENCODE_CHAR.
6803 This is for reasons similar to the recent CHAR_STRING fix.
6804 * charset.c (Fencode_char): Check that character arg is actually
6805 a character. Pass an int to ENCODE_CHAR.
6806 * charset.h (ENCODE_CHAR): Verify that the character argument is no
6807 wider than 'int', as a compile-time check to prevent future regressions
6808 in this area.
6809
6810 * character.c (char_string): Remove unnecessary casts.
6811
6812 Make sure a 64-bit char is never passed to CHAR_STRING.
6813 Otherwise, CHAR_STRING would do the wrong thing on a 64-bit platform,
6814 by silently ignoring the top 32 bits, allowing some values
6815 that were far too large to be valid characters.
6816 * character.h: Include <verify.h>.
6817 (CHAR_STRING, CHAR_STRING_ADVANCE): Verify that the character
6818 arguments are no wider than unsigned, as a compile-time check
6819 to prevent future regressions in this area.
6820 * data.c (Faset):
6821 * editfns.c (Fchar_to_string, general_insert_function, Finsert_char)
6822 (Fsubst_char_in_region):
6823 * fns.c (concat):
6824 * xdisp.c (decode_mode_spec_coding):
6825 Adjust to CHAR_STRING's new requirement.
6826 * editfns.c (Finsert_char, Fsubst_char_in_region):
6827 * fns.c (concat): Check that character args are actually
6828 characters. Without this test, these functions did the wrong
6829 thing with wildly out-of-range values on 64-bit hosts.
6830
6831 Remove incorrect casts to 'unsigned' that lose info on 64-bit hosts.
6832 These casts should not be needed on 32-bit hosts, either.
6833 * keyboard.c (read_char):
6834 * lread.c (Fload): Remove casts to unsigned.
6835
6836 * lisp.h (UNSIGNED_CMP): New macro.
6837 This fixes comparison bugs on 64-bit hosts.
6838 (ASCII_CHAR_P): Use it.
6839 * casefiddle.c (casify_object):
6840 * character.h (ASCII_BYTE_P, CHAR_VALID_P)
6841 (SINGLE_BYTE_CHAR_P, CHAR_STRING):
6842 * composite.h (COMPOSITION_ENCODE_RULE_VALID):
6843 * dispextern.h (FACE_FROM_ID):
6844 * keyboard.c (read_char): Use UNSIGNED_CMP.
6845
6846 * xmenu.c (dialog_selection_callback) [!USE_GTK]: Cast to intptr_t,
6847 not to EMACS_INT, to avoid GCC warning.
6848
6849 * xfns.c (x_set_scroll_bar_default_width): Remove unused 'int' locals.
6850
6851 * buffer.h (PTR_BYTE_POS, BUF_PTR_BYTE_POS): Remove harmful cast.
6852 The cast incorrectly truncated 64-bit byte offsets to 32 bits, and
6853 isn't needed on 32-bit machines.
6854
6855 * buffer.c (Fgenerate_new_buffer_name):
6856 Use EMACS_INT for count, not int.
6857 (advance_to_char_boundary): Return EMACS_INT, not int.
6858
6859 * data.c (Qcompiled_function): Now static.
6860
6861 * window.c (window_body_lines): Now static.
6862
6863 * image.c (gif_load): Rename local to avoid shadowing.
6864
6865 * lisp.h (SAFE_ALLOCA_LISP): Check for integer overflow.
6866 (struct Lisp_Save_Value): Use ptrdiff_t, not int, for 'integer' member.
6867 * alloc.c (make_save_value): Integer argument is now of type
6868 ptrdiff_t, not int.
6869 (mark_object): Use ptrdiff_t, not int.
6870 * lisp.h (pD): New macro.
6871 * print.c (print_object): Use it.
6872
6873 * alloc.c: Use EMACS_INT, not int, to count objects.
6874 (total_conses, total_markers, total_symbols, total_vector_size)
6875 (total_free_conses, total_free_markers, total_free_symbols)
6876 (total_free_floats, total_floats, total_free_intervals)
6877 (total_intervals, total_strings, total_free_strings):
6878 Now EMACS_INT, not int. All uses changed.
6879 (Fgarbage_collect): Compute overall total using a double, so that
6880 integer overflow is less likely to be a problem. Check for overflow
6881 when converting back to an integer.
6882 (n_interval_blocks, n_string_blocks, n_float_blocks, n_cons_blocks)
6883 (n_vectors, n_symbol_blocks, n_marker_blocks): Remove.
6884 These were 'int' variables that could overflow on 64-bit hosts;
6885 they were never used, so remove them instead of repairing them.
6886 (nzombies, ngcs, max_live, max_zombies): Now EMACS_INT, not 'int'.
6887 (inhibit_garbage_collection): Set gc_cons_threshold to max value.
6888 Previously, this ceilinged at INT_MAX, but that doesn't work on
6889 64-bit machines.
6890 (allocate_pseudovector): Don't use EMACS_INT when int would do.
6891
6892 * alloc.c (Fmake_bool_vector): Don't assume vector size fits in int.
6893 (allocate_vectorlike): Check for ptrdiff_t overflow.
6894 (mark_vectorlike, mark_char_table, mark_object): Avoid EMACS_UINT
6895 when a (possibly-narrower) signed value would do just as well.
6896 We prefer using signed arithmetic, to avoid comparison confusion.
6897
6898 * alloc.c: Catch some string size overflows that we were missing.
6899 (XMALLOC_OVERRUN_CHECK_SIZE) [!XMALLOC_OVERRUN_CHECK]: Define to 0,
6900 for convenience in STRING_BYTES_MAX.
6901 (STRING_BYTES_MAX): New macro, superseding the old one in lisp.h.
6902 The definition here is exact; the one in lisp.h was approximate.
6903 (allocate_string_data): Check for string overflow. This catches
6904 some instances we weren't catching before. Also, it catches
6905 size_t overflow on (unusual) hosts where SIZE_MAX <= min
6906 (PTRDIFF_MAX, MOST_POSITIVE_FIXNUM), e.g., when size_t is 32 bits
6907 and ptrdiff_t and EMACS_INT are both 64 bits.
6908
6909 * character.c, coding.c, doprnt.c, editfns.c, eval.c:
6910 All uses of STRING_BYTES_MAX replaced by STRING_BYTES_BOUND.
6911 * lisp.h (STRING_BYTES_BOUND): Rename from STRING_BYTES_MAX.
6912
6913 * character.c (string_escape_byte8): Fix nbytes/nchars typo.
6914
6915 * alloc.c (Fmake_string): Check for out-of-range init.
6916
6917 2011-06-15 Stefan Monnier <monnier@iro.umontreal.ca>
6918
6919 * eval.c (Fdefvaralias): Also mark the target as variable-special-p.
6920
6921 2011-06-14 Jan Djärv <jan.h.d@swipnet.se>
6922
6923 * xfns.c (x_set_scroll_bar_default_width): Remove argument to
6924 xg_get_default_scrollbar_width.
6925
6926 * gtkutil.c: Include emacsgtkfixed.h if HAVE_GTK3.
6927 (int_gtk_range_get_value): Move to the scroll bar part of the file.
6928 (style_changed_cb): Call update_theme_scrollbar_width and call
6929 x_set_scroll_bar_default_width and xg_frame_set_char_size for
6930 all frames (Bug#8505).
6931 (xg_create_frame_widgets): Call emacs_fixed_new if HAVE_GTK3 (Bug#8505).
6932 Call gtk_window_set_resizable if HAVE_GTK3.
6933 (x_wm_set_size_hint): Call emacs_fixed_set_min_size with min width
6934 and height if HAVE_GTK3 (Bug#8505).
6935 (scroll_bar_width_for_theme): New variable.
6936 (update_theme_scrollbar_width): New function.
6937 (xg_get_default_scrollbar_width): Move code to
6938 update_theme_scrollbar_width, just return scroll_bar_width_for_theme.
6939 (xg_initialize): Call update_theme_scrollbar_width.
6940
6941 * gtkutil.h (xg_get_default_scrollbar_width): Remove argument.
6942
6943 * emacsgtkfixed.c, emacsgtkfixed.h: New files.
6944
6945 2011-06-12 Martin Rudalics <rudalics@gmx.at>
6946
6947 * frame.c (make_frame): Call other_buffer_safely instead of
6948 other_buffer.
6949
6950 * window.c (temp_output_buffer_show): Call display_buffer with
6951 second argument Vtemp_buffer_show_specifiers and reset latter
6952 immediately after the call.
6953 (Vtemp_buffer_show_specifiers): New variable.
6954 (auto_window_vscroll_p, next_screen_context_lines)
6955 (Vscroll_preserve_screen_position): Remove leading asterisks from
6956 doc-strings.
6957
6958 2011-06-12 Paul Eggert <eggert@cs.ucla.edu>
6959
6960 Fix minor problems found by GCC 4.6.0 static checking.
6961 * buffer.c (Qclone_number): Remove for now, as it's unused.
6962 (record_buffer, Funrecord_buffer): Rename local to avoid shadowing.
6963 (record_buffer): Remove unused local.
6964 * frame.c (other_visible_frames, frame_buffer_list): Now static.
6965 (set_frame_buffer_list): Remove; unused.
6966 * frame.h (other_visible_frames): Remove decl.
6967 * keyboard.h (menu_items_inuse): Declare only if USE_GTK || USE_MOTIF.
6968 * lisp.h (frame_buffer_list, set_frame_buffer_list): Remove decls.
6969 (add_gpm_wait_descriptor, delete_gpm_wait_descriptor): Declare only
6970 if HAVE_GPM.
6971 * menu.c (menu_items_inuse): Now static unless USE_GTK || USE_MOTIF.
6972 * process.c (add_gpm_wait_descriptor, delete_gpm_wait_descriptor):
6973 Define only if HAVE_GPM.
6974 * widget.c (EmacsFrameResize, emacsFrameClassRec): Now static.
6975 (update_hints_inhibit): Remove; never set. All uses removed.
6976 * widgetprv.h (emacsFrameClassRec): Remove decl.
6977 * window.c (delete_deletable_window): Now returns void, since it
6978 wasn't returning anything.
6979 (compare_window_configurations): Remove unused locals.
6980 * xfns.c (x_set_scroll_bar_default_width): Remove unused locals.
6981 * xmenu.c (x_menu_set_in_use): Define only if USE_GTK || USE_MOTIF.
6982 (dialog_selection_callback) [!USE_GTK]: Prefer intptr_t for integers
6983 the same widths as pointers. This follows up on the 2011-05-06 patch.
6984 * xterm.c (x_alloc_lighter_color_for_widget): Define only if USE_LUCID.
6985 * xterm.h: Likewise.
6986 (x_menu_set_in_use): Declare only if USE_GTK || USE_MOTIF.
6987
6988 2011-06-12 Juanma Barranquero <lekktu@gmail.com>
6989
6990 * makefile.w32-in: Update dependencies.
6991 (LISP_H): Add lib/intprops.h.
6992
6993 2011-06-11 Chong Yidong <cyd@stupidchicken.com>
6994
6995 * image.c (gif_load): Add animation frame delay to the metadata.
6996 (syms_of_image): Use DEFSYM. New symbol `delay'.
6997
6998 2011-06-11 Martin Rudalics <rudalics@gmx.at>
6999
7000 * window.c (delete_deletable_window): Re-add.
7001 (Fset_window_configuration): Rewrite to handle dead buffers and
7002 consequently deletable windows.
7003 (window_tree, Fwindow_tree): Remove. Supply functionality in
7004 window.el.
7005 (compare_window_configurations): Simplify code.
7006
7007 2011-06-11 Andreas Schwab <schwab@linux-m68k.org>
7008
7009 * image.c (imagemagick_load_image): Fix type mismatch.
7010 (Fimagemagick_types): Likewise.
7011
7012 * window.h (replace_buffer_in_windows): Declare.
7013
7014 2011-06-11 Martin Rudalics <rudalics@gmx.at>
7015
7016 * buffer.c: New Lisp objects Qbuffer_list_update_hook and
7017 Qclone_number. Remove external declaration of Qdelete_window.
7018 (Fbuffer_list): Rewrite doc-string. Minor restructuring of
7019 code.
7020 (Fget_buffer_create, Fmake_indirect_buffer, Frename_buffer):
7021 Run Qbuffer_list_update_hook if allowed.
7022 (Fother_buffer): Rewrite doc-string. Major rewrite for new
7023 buffer list implementation.
7024 (other_buffer_safely): New function.
7025 (Fkill_buffer): Replace call to replace_buffer_in_all_windows by
7026 calls to replace_buffer_in_windows and
7027 replace_buffer_in_windows_safely. Run Qbuffer_list_update_hook
7028 if allowed.
7029 (record_buffer): Inhibit quitting and rewrite using quittable
7030 functions. Run Qbuffer_list_update_hook if allowed.
7031 (Frecord_buffer, Funrecord_buffer): New functions.
7032 (switch_to_buffer_1, Fswitch_to_buffer): Remove.
7033 Move switch-to-buffer to window.el.
7034 (bury-buffer): Move to window.el.
7035 (Vbuffer_list_update_hook): New variable.
7036
7037 * lisp.h (other_buffer_safely): Add prototype in buffer.c
7038 section.
7039
7040 * window.h (resize_frame_windows): Move up in code.
7041 (Fwindow_frame): Remove EXFUN.
7042 (replace_buffer_in_all_windows): Remove prototype.
7043 (replace_buffer_in_windows_safely): Add prototype.
7044
7045 * window.c: Declare Qdelete_window static again. Move down
7046 declaration of select_count.
7047 (Fnext_window, Fprevious_window): Rewrite doc-strings.
7048 (Fother_window): Move to window.el.
7049 (window_loop): Remove DELETE_BUFFER_WINDOWS and UNSHOW_BUFFER
7050 cases. Add REPLACE_BUFFER_IN_WINDOWS_SAFELY case.
7051 (Fdelete_windows_on, Freplace_buffer_in_windows): Move to
7052 window.el.
7053 (replace_buffer_in_windows): Implement by calling
7054 Qreplace_buffer_in_windows.
7055 (replace_buffer_in_all_windows): Remove with some functionality
7056 moved into replace_buffer_in_windows_safely.
7057 (replace_buffer_in_windows_safely): New function.
7058 (select_window_norecord, select_frame_norecord): Move in front
7059 of run_window_configuration_change_hook. Remove now obsolete
7060 declarations.
7061 (Fset_window_buffer): Rewrite doc-string.
7062 Call Qrecord_window_buffer.
7063 (keys_of_window): Move binding for other-window to window.el.
7064
7065 2011-06-11 Chong Yidong <cyd@stupidchicken.com>
7066
7067 * dispextern.h (struct image): Replace data member, whose int_val
7068 and ptr_val fields were not used by anything, with a single
7069 lisp_val object.
7070
7071 * image.c (Fimage_metadata, make_image, mark_image, tiff_load)
7072 (gif_clear_image, gif_load, imagemagick_load_image)
7073 (gs_clear_image, gs_load): Callers changed.
7074
7075 2011-06-10 Paul Eggert <eggert@cs.ucla.edu>
7076
7077 * buffer.h: Include <time.h>, for time_t.
7078 Needed to build on FreeBSD 8.2. Problem reported by Herbert J. Skuhra.
7079
7080 Fix minor problems found by static checking.
7081
7082 * image.c (PixelGetMagickColor): Declare if ImageMagick headers don't.
7083
7084 Make identifiers static if they are not used in other modules.
7085 * data.c (Qcompiled_function, Qframe, Qvector):
7086 * image.c (QimageMagick, Qsvg):
7087 * minibuf.c (Qmetadata):
7088 * window.c (resize_window_check, resize_root_window): Now static.
7089 * window.h (resize_window_check, resize_root_window): Remove decls.
7090
7091 * window.c (window_deletion_count, delete_deletable_window):
7092 Remove; unused.
7093 (window_body_lines): Now static.
7094 (Fdelete_other_windows_internal): Mark vars as initialized.
7095 Make sure 'resize_failed' is initialized.
7096 (run_window_configuration_change_hook): Rename local to avoid shadowing.
7097 (resize_window_apply): Remove unused local.
7098 * window.h (delete_deletable_window): Remove decl.
7099
7100 * image.c (gif_load, svg_load_image): Rename locals to avoid shadowing.
7101 (imagemagick_load_image): Fix pointer signedness problem by changing
7102 last arg from unsigned char * to char *. All uses changed.
7103 Also, fix a local for similar reasons.
7104 Remove unused locals. Remove locals to avoid shadowing.
7105 (fn_rsvg_handle_free): Remove; unused.
7106 (svg_load, svg_load_image): Fix pointer signedness problem.
7107 (imagemagick_load_image): Don't use garbage pointer image_wand.
7108
7109 * ftfont.c (ftfont_get_metrics, ftfont_drive_otf): Remove unused locals.
7110
7111 2011-06-10 Chong Yidong <cyd@stupidchicken.com>
7112
7113 * image.c (gif_load): Fix omitted cast error introduced by
7114 2011-06-06 change.
7115
7116 2011-06-10 Martin Rudalics <rudalics@gmx.at>
7117
7118 * window.h (resize_proportionally, orig_total_lines)
7119 (orig_top_line): Remove from window structure.
7120 (set_window_height, set_window_width, change_window_heights)
7121 (Fdelete_window): Remove prototypes.
7122 (resize_frame_windows): Remove duplicate declaration.
7123
7124 2011-06-10 Eli Zaretskii <eliz@gnu.org>
7125
7126 * window.h (resize_frame_windows, resize_window_check)
7127 (delete_deletable_window, resize_root_window)
7128 (resize_frame_windows): Declare prototypes.
7129
7130 * window.c (resize_window_apply): Make definition be "static" to
7131 match the prototype.
7132
7133 2011-06-10 Martin Rudalics <rudalics@gmx.at>
7134
7135 * window.c: Remove declarations of Qwindow_size_fixed,
7136 window_min_size_1, window_min_size_2, window_min_size,
7137 size_window, window_fixed_size_p, enlarge_window, delete_window.
7138 Remove static from declaration of Qdelete_window, it's
7139 temporarily needed by Fbury_buffer.
7140 (replace_window): Don't assign orig_top_line and
7141 orig_total_lines.
7142 (Fdelete_window, delete_window): Remove. Window deletion is
7143 handled by window.el.
7144 (window_loop): Remove DELETE_OTHER_WINDOWS case.
7145 Replace Fdelete_window calls with calls to Qdelete_window.
7146 (Fdelete_other_windows): Remove. Deleting other windows is
7147 handled by window.el.
7148 (window_fixed_size_p): Remove. Fixed-sizeness of windows is
7149 handled in window.el.
7150 (window_min_size_2, window_min_size_1, window_min_size): Remove.
7151 Window minimum sizes are handled in window.el.
7152 (shrink_windows, size_window, set_window_height)
7153 (set_window_width, change_window_heights, window_height)
7154 (window_width, CURBEG, CURSIZE, enlarge_window)
7155 (adjust_window_trailing_edge, Fadjust_window_trailing_edge)
7156 (Fenlarge_window, Fshrink_window): Remove. Window resizing is
7157 handled in window.el.
7158 (make_dummy_parent): Rename to make_parent_window and give it a
7159 second argument horflag.
7160 (make_window): Don't set resize_proportionally any more.
7161 (Fsplit_window): Remove. Windows are split in window.el.
7162 (save_restore_action, save_restore_orig_size)
7163 (shrink_window_lowest_first, save_restore_orig_size): Remove.
7164 Resize mini windows in window.el.
7165 (grow_mini_window, shrink_mini_window): Implement by calling
7166 Qresize_root_window_vertically, resize_window_check and
7167 resize_window_apply.
7168 (saved_window, Fset_window_configuration, save_window_save):
7169 Do not handle orig_top_line, orig_total_lines, and
7170 resize_proportionally.
7171 (window_min_height, window_min_width): Move to window.el.
7172 (keys_of_window): Move bindings for delete-other-windows,
7173 split-window, delete-window and enlarge-window to window.el.
7174
7175 * buffer.c: Temporarily extern Qdelete_window.
7176 (Fbury_buffer): Temporarily call Qdelete_window instead of
7177 Fdelete_window (Fbury_buffer will move to window.el soon).
7178
7179 * frame.c (set_menu_bar_lines_1): Remove code handling
7180 orig_top_line and orig_total_lines.
7181
7182 * dispnew.c (adjust_frame_glyphs_initially): Don't use
7183 set_window_height but set heights directly.
7184 (change_frame_size_1): Use resize_frame_windows.
7185
7186 * xdisp.c (init_xdisp): Don't use set_window_height but set
7187 heights directly.
7188
7189 * xfns.c (x_set_menu_bar_lines, x_set_tool_bar_lines):
7190 Use resize_frame_windows instead of change_window_heights and run
7191 run_window_configuration_change_hook.
7192
7193 * w32fns.c (x_set_tool_bar_lines): Use resize_frame_windows
7194 instead of change_window_heights and run
7195 run_window_configuration_change_hook.
7196
7197 2011-06-09 Martin Rudalics <rudalics@gmx.at>
7198
7199 * window.c (replace_window): Rename second argument REPLACEMENT to
7200 NEW. New third argument SETFLAG. Rewrite.
7201 (delete_window, make_dummy_parent): Call replace_window with
7202 third argument 1.
7203 (window_list_1): Move down in code.
7204 (run_window_configuration_change_hook): Move set_buffer part
7205 before select_frame_norecord part in order to unwind correctly.
7206 Rename count1 to count.
7207 (recombine_windows, delete_deletable_window, resize_root_window)
7208 (Fdelete_other_windows_internal)
7209 (Frun_window_configuration_change_hook, make_parent_window)
7210 (resize_window_check, resize_window_apply, Fresize_window_apply)
7211 (resize_frame_windows, Fsplit_window_internal)
7212 (Fdelete_window_internal, Fresize_mini_window_internal):
7213 New functions.
7214 (syms_of_window): New variables Vwindow_splits and Vwindow_nest.
7215
7216 2011-06-08 Martin Rudalics <rudalics@gmx.at>
7217
7218 * window.h (window): Add some new members to window structure -
7219 normal_lines, normal_cols, new_total, new_normal, clone_number,
7220 splits, nest, prev_buffers, next_buffers.
7221 (WINDOW_TOTAL_SIZE): Move here from window.c.
7222 (MIN_SAFE_WINDOW_WIDTH, MIN_SAFE_WINDOW_HEIGHT): Define here.
7223
7224 * window.c (Fwindow_height, Fwindow_width, Fwindow_full_width_p):
7225 Remove.
7226 (make_dummy_parent): Set new members of windows structure.
7227 (make_window): Move down in code. Handle new members of window
7228 structure.
7229 (Fwindow_clone_number, Fwindow_splits, Fset_window_splits)
7230 (Fwindow_nest, Fset_window_nest, Fwindow_new_total)
7231 (Fwindow_normal_size, Fwindow_new_normal, Fwindow_prev_buffers)
7232 (Fset_window_prev_buffers, Fwindow_next_buffers)
7233 (Fset_window_next_buffers, Fset_window_clone_number):
7234 New functions.
7235 (Fwindow_hscroll, Fwindow_at, Fwindow_point, Fwindow_start)
7236 (Fwindow_end, Fwindow_line_height, Fset_window_dedicated_p):
7237 Doc-string fixes.
7238 (Fwindow_parameters, Fwindow_parameter, Fset_window_parameter):
7239 Argument WINDOW can be now internal window too.
7240 (Fwindow_use_time): Move up in code.
7241 (Fget_buffer_window): Rename argument FRAME to ALL-FRAMES.
7242 Rewrite doc-string.
7243 (Fset_window_configuration, saved_window)
7244 (Fcurrent_window_configuration, save_window_save): Handle new
7245 members of window structure.
7246 (WINDOW_TOTAL_SIZE, MIN_SAFE_WINDOW_WIDTH)
7247 (MIN_SAFE_WINDOW_HEIGHT): Move to window.h.
7248 (syms_of_window): New Lisp objects Qrecord_window_buffer,
7249 Qwindow_deletable_p, Qdelete_window, Qreplace_buffer_in_windows,
7250 Qget_mru_window, Qresize_root_window,
7251 Qresize_root_window_vertically, Qsafe, Qabove, Qbelow,
7252 Qauto_buffer_name; staticpro them.
7253
7254 2011-06-07 Martin Rudalics <rudalics@gmx.at>
7255
7256 * window.c (Fwindow_total_size, Fwindow_left_column)
7257 (Fwindow_top_line, window_body_lines, Fwindow_body_size)
7258 (Fwindow_list_1): New functions.
7259 (window_box_text_cols): Replace with window_body_cols.
7260 (Fwindow_width, Fscroll_left, Fscroll_right):
7261 Use window_body_cols instead of window_box_text_cols.
7262 (delete_window, Fset_window_configuration):
7263 Call delete_all_subwindows with window as argument.
7264 (delete_all_subwindows): Take a window as argument and not a
7265 structure. Rewrite.
7266 (window_loop): Remove handling of GET_LRU_WINDOW and
7267 GET_LARGEST_WINDOW.
7268 (Fget_lru_window, Fget_largest_window): Move to window.el.
7269
7270 * window.h: Extern window_body_cols instead of
7271 window_box_text_cols. delete_all_subwindows now takes a
7272 Lisp_Object as argument.
7273
7274 * indent.c (compute_motion, Fcompute_motion):
7275 Use window_body_cols instead of window_box_text_cols.
7276
7277 * frame.c (delete_frame): Call delete_all_subwindows with root
7278 window as argument.
7279
7280 2011-06-07 Daniel Colascione <dan.colascione@gmail.com>
7281
7282 * fns.c (Fputhash): Document return value.
7283
7284 2011-06-06 Chong Yidong <cyd@stupidchicken.com>
7285
7286 * image.c (gif_load): Implement gif89a spec "no disposal" method.
7287
7288 2011-06-06 Paul Eggert <eggert@cs.ucla.edu>
7289
7290 Cons<->int and similar integer overflow fixes (Bug#8794).
7291
7292 Check for overflow when converting integer to cons and back.
7293 * charset.c (Fdefine_charset_internal, Fdecode_char):
7294 Use cons_to_unsigned to catch overflow.
7295 (Fencode_char): Use INTEGER_TO_CONS.
7296 * composite.h (LGLYPH_CODE): Use cons_to_unsigned.
7297 (LGLYPH_SET_CODE): Use INTEGER_TO_CONS.
7298 * data.c (long_to_cons, cons_to_long): Remove.
7299 (cons_to_unsigned, cons_to_signed): New functions.
7300 These signal an error for invalid or out-of-range values.
7301 * dired.c (Ffile_attributes): Use INTEGER_TO_CONS.
7302 * fileio.c (Fset_visited_file_modtime): Use CONS_TO_INTEGER.
7303 * font.c (Ffont_variation_glyphs):
7304 * fontset.c (Finternal_char_font): Use INTEGER_TO_CONS.
7305 * lisp.h: Include <intprops.h>.
7306 (INTEGER_TO_CONS, CONS_TO_INTEGER): New macros.
7307 (cons_to_signed, cons_to_unsigned): New decls.
7308 (long_to_cons, cons_to_long): Remove decls.
7309 * undo.c (record_first_change): Use INTEGER_TO_CONS.
7310 (Fprimitive_undo): Use CONS_TO_INTEGER.
7311 * xfns.c (Fx_window_property): Likewise.
7312 * xselect.c: Include <limits.h>.
7313 (x_own_selection, selection_data_to_lisp_data):
7314 Use INTEGER_TO_CONS.
7315 (x_handle_selection_request, x_handle_selection_clear)
7316 (x_get_foreign_selection, Fx_disown_selection_internal)
7317 (Fx_get_atom_name, x_send_client_event): Use CONS_TO_INTEGER.
7318 (lisp_data_to_selection_data): Use cons_to_unsigned.
7319 (x_fill_property_data): Use cons_to_signed.
7320 Report values out of range.
7321
7322 Check for buffer and string overflow more precisely.
7323 * buffer.h (BUF_BYTES_MAX): New macro.
7324 * lisp.h (STRING_BYTES_MAX): New macro.
7325 * alloc.c (Fmake_string):
7326 * character.c (string_escape_byte8):
7327 * coding.c (coding_alloc_by_realloc):
7328 * doprnt.c (doprnt):
7329 * editfns.c (Fformat):
7330 * eval.c (verror):
7331 Use STRING_BYTES_MAX, not MOST_POSITIVE_FIXNUM,
7332 since they may not be the same number.
7333 * editfns.c (Finsert_char):
7334 * fileio.c (Finsert_file_contents):
7335 Likewise for BUF_BYTES_MAX.
7336
7337 * image.c: Use ptrdiff_t, not int, for sizes.
7338 (slurp_file): Switch from int to ptrdiff_t.
7339 All uses changed.
7340 (slurp_file): Check that file size fits in both size_t (for
7341 malloc) and ptrdiff_t (for sanity and safety).
7342
7343 * fileio.c (Fverify_visited_file_modtime): Avoid time overflow
7344 if b->modtime has its maximal value.
7345
7346 * dired.c (Ffile_attributes): Don't assume EMACS_INT has >32 bits.
7347
7348 Don't assume time_t can fit into int.
7349 * buffer.h (struct buffer.modtime): Now time_t, not int.
7350 * fileio.c (Fvisited_file_modtime): No need for time_t cast now.
7351 * undo.c (Fprimitive_undo): Use time_t, not int, for time_t value.
7352
7353 Minor fixes for signed vs unsigned integers.
7354 * character.h (MAYBE_UNIFY_CHAR):
7355 * charset.c (maybe_unify_char):
7356 * keyboard.c (read_char, reorder_modifiers):
7357 XINT -> XFASTINT, since the integer must be nonnegative.
7358 * ftfont.c (ftfont_spec_pattern):
7359 * keymap.c (access_keymap, silly_event_symbol_error):
7360 XUINT -> XFASTINT, since the integer must be nonnegative.
7361 (Fsingle_key_description, preferred_sequence_p): XUINT -> XINT,
7362 since it makes no difference and we prefer signed.
7363 * keyboard.c (record_char): Use XUINT when all the neighbors do.
7364 (access_keymap): NATNUMP -> INTEGERP, since the integer must be
7365 nonnegative.
7366
7367 2011-06-06 Stefan Monnier <monnier@iro.umontreal.ca>
7368
7369 * window.h (Fwindow_frame): Declare.
7370
7371 2011-06-06 Paul Eggert <eggert@cs.ucla.edu>
7372
7373 * alloc.c: Simplify handling of large-request failures (Bug#8800).
7374 (SPARE_MEMORY): Always define.
7375 (LARGE_REQUEST): Remove.
7376 (memory_full): Use SPARE_MEMORY rather than LARGE_REQUEST.
7377
7378 2011-06-06 Martin Rudalics <rudalics@gmx.at>
7379
7380 * lisp.h: Move EXFUNS for Fframe_root_window,
7381 Fframe_first_window and Fset_frame_selected_window to window.h.
7382
7383 * window.h: Move EXFUNS for Fframe_root_window,
7384 Fframe_first_window and Fset_frame_selected_window here from
7385 lisp.h.
7386
7387 * frame.c (Fwindow_frame, Fframe_first_window)
7388 (Fframe_root_window, Fframe_selected_window)
7389 (Fset_frame_selected_window): Move to window.c.
7390 (Factive_minibuffer_window): Move to minibuf.c.
7391 (Fother_visible_frames_p): New function.
7392
7393 * minibuf.c (Factive_minibuffer_window): Move here from frame.c.
7394
7395 * window.c (decode_window, decode_any_window): Move up in code.
7396 (Fwindowp, Fwindow_live_p): Rewrite doc-strings.
7397 (inhibit_frame_unsplittable): Remove unused variable.
7398 (Fwindow_buffer): Move up and rewrite doc-string.
7399 (Fwindow_parent, Fwindow_vchild, Fwindow_hchild, Fwindow_next)
7400 (Fwindow_prev): New functions.
7401 (Fwindow_frame): Move here from frame.c. Accept any window as
7402 argument.
7403 (Fframe_root_window, Fframe_first_window)
7404 (Fframe_selected_window): Move here from frame.c. Accept frame
7405 or arbitrary window as argument. Update doc-strings.
7406 (Fminibuffer_window): Move up in code.
7407 (Fwindow_minibuffer_p): Move up in code and simplify.
7408 (Fset_frame_selected_window): Move here from frame.c.
7409 Marginal rewrite.
7410 (Fselected_window, select_window, Fselect_window): Move up in
7411 code. Minor doc-string fixes.
7412
7413 2011-06-06 Paul Eggert <eggert@cs.ucla.edu>
7414
7415 * alloc.c (memory_full) [SYSTEM_MALLOC]: Port to MacOS (Bug#8800).
7416 Do not assume that spare memory exists; that assumption is valid
7417 only if SYSTEM_MALLOC.
7418 (LARGE_REQUEST): New macro, so that the issue of large requests
7419 is separated from the issue of spare memory.
7420
7421 2011-06-05 Andreas Schwab <schwab@linux-m68k.org>
7422
7423 * editfns.c (Fformat): Correctly handle zero flag with hexadecimal
7424 format. (Bug#8806)
7425
7426 * gtkutil.c (xg_get_default_scrollbar_width): Avoid warning.
7427
7428 * xfns.c (x_set_scroll_bar_default_width): Move declarations
7429 before statements.
7430
7431 2011-06-05 Jan Djärv <jan.h.d@swipnet.se>
7432
7433 * gtkutil.c (xg_get_default_scrollbar_width): New function.
7434
7435 * gtkutil.h: Declare xg_get_default_scrollbar_width.
7436
7437 * xfns.c (x_set_scroll_bar_default_width): If USE_GTK, get
7438 min width by calling x_set_scroll_bar_default_width (Bug#8505).
7439
7440 2011-06-05 Juanma Barranquero <lekktu@gmail.com>
7441
7442 * xdisp.c (single_display_spec_intangible_p): Remove declaration.
7443
7444 2011-06-04 Chong Yidong <cyd@stupidchicken.com>
7445
7446 * xselect.c (x_clipboard_manager_save): Remove redundant arg.
7447 (x_clipboard_manager_save): Add return value.
7448 (x_clipboard_manager_error_1, x_clipboard_manager_error_2):
7449 New error handlers.
7450 (x_clipboard_manager_save_frame, x_clipboard_manager_save_all):
7451 Obey Vx_select_enable_clipboard_manager. Catch errors in
7452 x_clipboard_manager_save (Bug#8779).
7453 (Vx_select_enable_clipboard_manager): New variable.
7454 (x_get_foreign_selection): Reduce scope of x_catch_errors (Bug#8790).
7455
7456 2011-06-04 Dan Nicolaescu <dann@ics.uci.edu>
7457
7458 * emacs.c (main): Warn when starting a GTK emacs in daemon mode.
7459
7460 2011-06-04 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
7461
7462 * fringe.c (update_window_fringes): Don't update overlay arrow bitmap
7463 in the current matrix if keep_current_p is non-zero.
7464
7465 2011-06-04 Eli Zaretskii <eliz@gnu.org>
7466
7467 * bidi.c (bidi_level_of_next_char): Fix last change.
7468
7469 2011-06-03 Eli Zaretskii <eliz@gnu.org>
7470
7471 Support bidi reordering of text covered by display properties.
7472
7473 * bidi.c (bidi_copy_it): Use offsetof instead of emulating it.
7474 (bidi_fetch_char, bidi_fetch_char_advance): New functions.
7475 (bidi_cache_search, bidi_cache_iterator_state)
7476 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak)
7477 (bidi_level_of_next_char, bidi_move_to_visually_next):
7478 Support character positions inside a run of characters covered by a
7479 display string.
7480 (bidi_paragraph_init, bidi_resolve_explicit_1)
7481 (bidi_level_of_next_char): Call bidi_fetch_char and
7482 bidi_fetch_char_advance instead of FETCH_CHAR and
7483 FETCH_CHAR_ADVANCE.
7484 (bidi_init_it): Initialize new members.
7485 (LRE_CHAR, RLE_CHAR, PDF_CHAR, LRO_CHAR, RLO_CHAR): Remove macro
7486 definitions.
7487 (bidi_explicit_dir_char): Lookup character type in bidi_type_table,
7488 instead of using explicit *_CHAR codes.
7489 (bidi_resolve_explicit, bidi_resolve_weak):
7490 Use FETCH_MULTIBYTE_CHAR instead of FETCH_CHAR, as reordering of
7491 bidirectional text is supported only in multibyte buffers.
7492 (bidi_init_it): Accept additional argument FRAME_WINDOW_P and use
7493 it to initialize the frame_window_p member of struct bidi_it.
7494 (bidi_cache_iterator_state, bidi_resolve_explicit_1)
7495 (bidi_resolve_explicit, bidi_resolve_weak)
7496 (bidi_level_of_next_char, bidi_move_to_visually_next): Abort if
7497 bidi_it->nchars is non-positive.
7498 (bidi_level_of_next_char): Don't try to lookup the cache for the
7499 next/previous character if nothing is cached there yet, or if we
7500 were just reseat()'ed to a new position.
7501
7502 * xdisp.c (set_cursor_from_row): Set start and stop points
7503 according to the row's direction when priming the loop that looks
7504 for the glyph on which to display cursor.
7505 (single_display_spec_intangible_p): Function deleted.
7506 (display_prop_intangible_p): Reimplement to call
7507 handle_display_spec instead of single_display_spec_intangible_p.
7508 Accept 3 additional arguments needed by handle_display_spec.
7509 This fixes incorrect cursor motion across display property with complex
7510 values: lists, `(when COND...)' forms, etc.
7511 (single_display_spec_string_p): Support property values that are
7512 lists with the argument STRING its top-level element.
7513 (display_prop_string_p): Fix the condition for processing a
7514 property that is a list to be consistent with handle_display_spec.
7515 (handle_display_spec): New function, refactored from the
7516 last portion of handle_display_prop.
7517 (compute_display_string_pos): Accept additional argument
7518 FRAME_WINDOW_P. Call handle_display_spec to determine whether the
7519 value of a `display' property is a "replacing spec".
7520 (handle_single_display_spec): Accept 2 additional arguments BUFPOS
7521 and FRAME_WINDOW_P. If IT is NULL, don't set up the iterator from
7522 the display property, but just return a value indicating whether
7523 the display property will replace the characters it covers.
7524 (Fcurrent_bidi_paragraph_direction): Initialize the nchars and
7525 frame_window_p members of struct bidi_it.
7526 (compute_display_string_pos, compute_display_string_end):
7527 New functions.
7528 (push_it): Accept second argument POSITION, where pop_it should
7529 jump to continue iteration.
7530 (reseat_1): Initialize bidi_it.disp_pos.
7531
7532 * keyboard.c (adjust_point_for_property): Adjust the call to
7533 display_prop_intangible_p to its new signature.
7534
7535 * dispextern.h (struct bidi_it): New member frame_window_p.
7536 (bidi_init_it): Update prototypes.
7537 (display_prop_intangible_p): Update prototype.
7538 (compute_display_string_pos, compute_display_string_end):
7539 Declare prototypes.
7540 (struct bidi_it): New members nchars and disp_pos. ch_len is now
7541 EMACS_INT.
7542
7543 2011-06-02 Paul Eggert <eggert@cs.ucla.edu>
7544
7545 Malloc failure behavior now depends on size of allocation.
7546 * alloc.c (buffer_memory_full, memory_full): New arg NBYTES.
7547 * lisp.h: Change signatures accordingly.
7548 * alloc.c, buffer.c, editfns.c, menu.c, minibuf.c, xterm.c:
7549 All callers changed. (Bug#8762)
7550
7551 * gnutls.c: Use Emacs's memory allocators.
7552 Without this change, the gnutls library would invoke malloc etc.
7553 directly, which causes problems on non-SYNC_INPUT hosts, and which
7554 runs afoul of improving memory_full behavior. (Bug#8761)
7555 (fn_gnutls_global_set_mem_functions): New macro or function pointer.
7556 (emacs_gnutls_global_init): Use it to specify xmalloc, xrealloc,
7557 xfree instead of the default malloc, realloc, free.
7558 (Fgnutls_boot): No need to check for memory allocation failure,
7559 since xmalloc does that for us.
7560
7561 Remove arbitrary limit of 2**31 entries in hash tables. (Bug#8771)
7562 * category.c (hash_get_category_set):
7563 * ccl.c (ccl_driver):
7564 * charset.c (Fdefine_charset_internal):
7565 * charset.h (struct charset.hash_index):
7566 * composite.c (get_composition_id, gstring_lookup_cache)
7567 (composition_gstring_put_cache):
7568 * composite.h (struct composition.hash_index):
7569 * dispextern.h (struct image.hash):
7570 * fns.c (next_almost_prime, larger_vector, cmpfn_eql)
7571 (cmpfn_equal, cmpfn_user_defined, hashfn_eq, hashfn_eql)
7572 (hashfn_equal, hashfn_user_defined, make_hash_table)
7573 (maybe_resize_hash_table, hash_lookup, hash_put)
7574 (hash_remove_from_table, hash_clear, sweep_weak_table, SXHASH_COMBINE)
7575 (sxhash_string, sxhash_list, sxhash_vector, sxhash_bool_vector)
7576 (Fsxhash, Fgethash, Fputhash, Fmaphash):
7577 * image.c (make_image, search_image_cache, lookup_image)
7578 (xpm_put_color_table_h):
7579 * lisp.h (struct Lisp_Hash_Table):
7580 * minibuf.c (Ftry_completion, Fall_completions, Ftest_completion):
7581 * print.c (print): Use 'EMACS_UINT' and 'EMACS_INT'
7582 for hashes and hash indexes, instead of 'unsigned' and 'int'.
7583 * alloc.c (allocate_vectorlike):
7584 Check for overflow in vector size calculations.
7585 * ccl.c (ccl_driver):
7586 Check for overflow when converting EMACS_INT to int.
7587 * fns.c, image.c: Remove unnecessary static decls that would otherwise
7588 need to be updated by these changes.
7589 * fns.c (make_hash_table, maybe_resize_hash_table):
7590 Check for integer overflow with large hash tables.
7591 (make_hash_table, maybe_resize_hash_table, Fmake_hash_table):
7592 Prefer the faster XFLOAT_DATA to XFLOATINT where either will do.
7593 (SXHASH_REDUCE): New macro.
7594 (sxhash_string, sxhash_list, sxhash_vector, sxhash_bool_vector):
7595 Use it instead of discarding useful hash info with large hash values.
7596 (sxhash_float): New function.
7597 (sxhash): Use it. No more need for "& INTMASK" due to above changes.
7598 * lisp.h (FIXNUM_BITS): New macro, useful for SXHASH_REDUCE etc.
7599 (MOST_NEGATIVE_FIXNUM, MOST_POSITIVE_FIXNUM, INTMASK):
7600 Rewrite to use FIXNUM_BITS, as this simplifies things.
7601 (next_almost_prime, larger_vector, sxhash, hash_lookup, hash_put):
7602 Adjust signatures to match updated version of code.
7603 (consing_since_gc): Now EMACS_INT, since a single hash table can
7604 use more than INT_MAX bytes.
7605
7606 2011-06-01 Dan Nicolaescu <dann@ics.uci.edu>
7607
7608 Make it possible to build with GCC-4.6+ -O2 -flto.
7609
7610 * emacs.c (__malloc_initialize_hook): Mark as EXTERNALLY_VISIBLE.
7611
7612 2011-06-01 Stefan Monnier <monnier@iro.umontreal.ca>
7613
7614 * minibuf.c (get_minibuffer, read_minibuf_unwind):
7615 Call minibuffer-inactive-mode.
7616
7617 2011-05-31 Juanma Barranquero <lekktu@gmail.com>
7618
7619 * makefile.w32-in ($(BLD)/data.$(O), $(BLD)/editfns.$(O)):
7620 Update dependencies.
7621
7622 2011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
7623
7624 * data.c (init_data): Remove code for UTS, this system is not
7625 supported anymore.
7626
7627 2011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
7628
7629 Don't force ./temacs to start in terminal mode.
7630
7631 * frame.c (make_initial_frame): Initialize faces in all cases, not
7632 only when CANNOT_DUMP is defined.
7633 * dispnew.c (init_display): Remove CANNOT_DUMP condition.
7634
7635 2011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
7636
7637 * dispnew.c (add_window_display_history): Use const for the string
7638 pointer. Remove declaration, not needed.
7639
7640 2011-05-31 Paul Eggert <eggert@cs.ucla.edu>
7641
7642 Use 'inline', not 'INLINE'.
7643 <http://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00914.html>
7644 * alloc.c, fontset.c (INLINE): Remove.
7645 * alloc.c, bidi.c, charset.c, coding.c, dispnew.c, fns.c, image.c:
7646 * intervals.c, keyboard.c, process.c, syntax.c, textprop.c, w32term.c:
7647 * xdisp.c, xfaces.c, xterm.c: Replace all uses of INLINE with inline.
7648 * gmalloc.c (register_heapinfo): Use inline unconditionally.
7649 * lisp.h (LISP_MAKE_RVALUE): Use inline, not __inline__.
7650
7651 2011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
7652
7653 Make it possible to run ./temacs.
7654
7655 * callproc.c (set_initial_environment): Remove CANNOT_DUMP code,
7656 syms_of_callproc does the same thing. Remove test for
7657 "initialized", do it in the caller.
7658 * emacs.c (main): Avoid calling set_initial_environment when dumping.
7659
7660 2011-05-31 Stefan Monnier <monnier@iro.umontreal.ca>
7661
7662 * minibuf.c (Finternal_complete_buffer): Return `category' metadata.
7663 (read_minibuf): Use get_minibuffer.
7664 (syms_of_minibuf): Use DEFSYM.
7665 (Qmetadata): New var.
7666 * data.c (Qbuffer): Don't make it static.
7667 (syms_of_data): Use DEFSYM.
7668
7669 2011-05-31 Paul Eggert <eggert@cs.ucla.edu>
7670
7671 * ccl.c (CCL_CODE_RANGE): Allow negative numbers. (Bug#8751)
7672 (CCL_CODE_MIN): New macro.
7673
7674 2011-05-30 Paul Eggert <eggert@cs.ucla.edu>
7675
7676 * alloc.c (lisp_align_malloc): Omit unnecessary val==NULL tests.
7677
7678 * eval.c (Qdebug): Now static.
7679 * lisp.h (Qdebug): Remove decl. This reverts a part of the
7680 2011-04-26T11:26:05Z!dan.colascione@gmail.com that inadvertently undid part of
7681 2011-04-14T06:48:41Z!eggert@cs.ucla.edu.
7682
7683 2011-05-29 Chong Yidong <cyd@stupidchicken.com>
7684
7685 * image.c: Various fixes to ImageMagick code comments.
7686 (Fimagemagick_types): Doc fix.
7687
7688 2011-05-29 Paul Eggert <eggert@cs.ucla.edu>
7689
7690 Minor fixes prompted by GCC 4.6.0 warnings.
7691
7692 * xselect.c (converted_selections, conversion_fail_tag): Now static.
7693
7694 * emacs.c [HAVE_X_WINDOWS]: Include "xterm.h".
7695 (x_clipboard_manager_save_all): Move extern decl to ...
7696 * xterm.h: ... here, so that it can be checked for consistency.
7697
7698 2011-05-29 Chong Yidong <cyd@stupidchicken.com>
7699
7700 * xselect.c (x_clipboard_manager_save_frame)
7701 (x_clipboard_manager_save_all): New functions.
7702 (Fx_clipboard_manager_save): Lisp function deleted.
7703
7704 * emacs.c (Fkill_emacs): Call x_clipboard_manager_save_all.
7705 * frame.c (delete_frame): Call x_clipboard_manager_save_frame.
7706
7707 * xterm.h: Update prototype.
7708
7709 2011-05-28 William Xu <william.xwl@gmail.com>
7710
7711 * nsterm.m (ns_term_shutdown): Synchronize user defaults before
7712 exiting (Bug#8239).
7713
7714 2011-05-28 Jim Meyering <meyering@redhat.com>
7715
7716 Avoid a sign-extension bug in crypto_hash_function.
7717 * fns.c (to_uchar): Define.
7718 (crypto_hash_function): Use it to convert some newly-signed
7719 variables to unsigned, to avoid sign-extension bugs. For example,
7720 without this change, (md5 "truc") would evaluate to
7721 45723a2aff78ff4fff7fff1114760e62 rather than the expected
7722 45723a2af3788c4ff17f8d1114760e62. Reported by Antoine Levitt in
7723 https://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00883.html.
7724
7725 2011-05-27 Paul Eggert <eggert@cs.ucla.edu>
7726
7727 Integer overflow fixes.
7728
7729 * dbusbind.c: Serial number integer overflow fixes.
7730 (CHECK_DBUS_SERIAL_GET_SERIAL): New macro.
7731 (Fdbus_call_method_asynchronously, xd_read_message_1): Use a float
7732 to hold a serial number that is too large for a fixnum.
7733 (Fdbus_method_return_internal, Fdbus_method_error_internal):
7734 Check for serial numbers out of range. Decode any serial number
7735 that was so large that it became a float. (Bug#8722)
7736
7737 * dbusbind.c: Use XFASTINT rather than XUINT, and check for nonneg.
7738 (Fdbus_call_method, Fdbus_call_method_asynchronously):
7739 Use XFASTINT rather than XUINT when numbers are nonnegative.
7740 (xd_append_arg, Fdbus_method_return_internal):
7741 (Fdbus_method_error_internal): Likewise. Also, for unsigned
7742 arguments, check that Lisp number is nonnegative, rather than
7743 silently wrapping negative numbers around. (Bug#8722)
7744 (xd_read_message_1): Don't assume dbus_uint32_t can fit in int.
7745 (Bug#8722)
7746
7747 * data.c (arith_driver, Flsh): Avoid unnecessary casts to EMACS_UINT.
7748
7749 * ccl.c (ccl_driver): Redo slightly to avoid the need for 'unsigned'.
7750
7751 ccl: Add integer overflow checks.
7752 * ccl.c (CCL_CODE_MAX, GET_CCL_RANGE, GET_CCL_CODE, GET_CCL_INT):
7753 (IN_INT_RANGE): New macros.
7754 (ccl_driver): Use them to check for integer overflow when
7755 decoding a CCL program. Many of the new checks are whether XINT (x)
7756 fits in int; it doesn't always, on 64-bit hosts. The new version
7757 doesn't catch all possible integer overflows, but it's an
7758 improvement. (Bug#8719)
7759
7760 * alloc.c (make_event_array): Use XINT, not XUINT.
7761 There's no need for unsigned here.
7762
7763 * mem-limits.h (EXCEEDS_LISP_PTR) [!USE_LSB_TAG]: EMACS_UINT -> uintptr_t
7764 This follows up to the 2011-05-06 change that substituted uintptr_t
7765 for EMACS_INT. This case wasn't caught back then.
7766
7767 Rework Fformat to avoid integer overflow issues.
7768 * editfns.c: Include <float.h> unconditionally, as it's everywhere
7769 now (part of C89). Include <verify.h>.
7770 (MAX_10_EXP, CONVERTED_BYTE_SIZE): Remove; no longer needed.
7771 (pWIDE, pWIDElen, signed_wide, unsigned_wide): New defns.
7772 (Fformat): Avoid the prepass trying to compute sizes; it was only
7773 approximate and thus did not catch overflow reliably. Instead, walk
7774 through the format just once, formatting and computing sizes as we go,
7775 checking for integer overflow at every step, and allocating a larger
7776 buffer as needed. Keep track separately whether the format is
7777 multibyte. Keep only the most-recently calculated precision, rather
7778 than them all. Record whether each argument has been converted to
7779 string. Use EMACS_INT, not int, for byte and char and arg counts.
7780 Support field widths and precisions larger than INT_MAX. Avoid
7781 sprintf's undefined behavior with conversion specifications such as %#d
7782 and %.0c. Fix bug with strchr succeeding on '\0' when looking for
7783 flags. Fix bug with (format "%c" 256.0). Avoid integer overflow when
7784 formatting out-of-range floating point numbers with int
7785 formats. (Bug#8668)
7786
7787 * lisp.h (FIXNUM_OVERFLOW_P): Work even if arg is a NaN.
7788
7789 * data.c: Avoid integer truncation in expressions involving floats.
7790 * data.c: Include <intprops.h>.
7791 (arith_driver): When there's an integer overflow in an expression
7792 involving floating point, convert the integers to floating point
7793 so that the resulting value does not suffer from catastrophic
7794 integer truncation. For example, on a 64-bit host (* 4
7795 most-negative-fixnum 0.5) should yield about -4.6e+18, not zero.
7796 Do not rely on undefined behavior after integer overflow.
7797
7798 merge count_size_as_multibyte, parse_str_to_multibyte
7799 * character.c, character.h (count_size_as_multibyte):
7800 Rename from parse_str_to_multibyte; all uses changed.
7801 Check for integer overflow.
7802 * insdel.c, lisp.h (count_size_as_multibyte): Remove,
7803 since it's now a duplicate of the other. This is more of
7804 a character than a buffer op, so better that it's in character.c.
7805 * fns.c, print.c: Adjust to above changes.
7806
7807 2011-05-27 Stefan Monnier <monnier@iro.umontreal.ca>
7808
7809 * xselect.c (x_convert_selection): Yet another int/Lisp_Object mixup.
7810
7811 2011-05-27 Paul Eggert <eggert@cs.ucla.edu>
7812
7813 * xselect.c: Fix minor problems prompted by GCC 4.6.0 warnings.
7814 (x_handle_selection_request, frame_for_x_selection): Remove unused vars.
7815 (x_clipboard_manager_save): Now static.
7816 (Fx_clipboard_manager_save): Rename local to avoid shadowing.
7817
7818 * fns.c: Fix minor problems prompted by GCC 4.6.0 warnings.
7819 (crypto_hash_function): Now static.
7820 Fix pointer signedness problems. Avoid unnecessary initializations.
7821
7822 2011-05-27 Chong Yidong <cyd@stupidchicken.com>
7823
7824 * termhooks.h (Vselection_alist): Make it terminal-local.
7825
7826 * terminal.c (create_terminal): Initialize it.
7827
7828 * xselect.c: Support for clipboard managers.
7829 (Vselection_alist): Move to termhooks.h as terminal-local var.
7830 (LOCAL_SELECTION): New macro.
7831 (x_atom_to_symbol): Handle x_display_info_for_display fail case.
7832 (symbol_to_x_atom): Remove gratuitous arg.
7833 (x_handle_selection_request, lisp_data_to_selection_data)
7834 (x_get_foreign_selection, Fx_register_dnd_atom): Callers changed.
7835 (x_own_selection, x_get_local_selection, x_convert_selection):
7836 New arg, specifying work frame. Use terminal-local Vselection_alist.
7837 (some_frame_on_display): Delete unused function.
7838 (Fx_own_selection_internal, Fx_get_selection_internal)
7839 (Fx_disown_selection_internal, Fx_selection_owner_p)
7840 (Fx_selection_exists_p): New optional frame arg.
7841 (frame_for_x_selection, Fx_clipboard_manager_save): New functions.
7842 (x_handle_selection_clear): Don't treat other terminals with the
7843 same keyboard specially. Use the terminal-local Vselection_alist.
7844 (x_clear_frame_selections): Use Frun_hook_with_args.
7845
7846 * xterm.c (x_term_init): Intern ATOM and CLIPBOARD_MANAGER atoms.
7847
7848 * xterm.h: Add support for those atoms.
7849
7850 2011-05-26 Chong Yidong <cyd@stupidchicken.com>
7851
7852 * xselect.c: ICCCM-compliant handling of MULTIPLE targets.
7853 (converted_selections, conversion_fail_tag): New global variables.
7854 (x_selection_request_lisp_error): Free the above.
7855 (x_get_local_selection): Remove unnecessary code.
7856 (x_reply_selection_request): Args changed; handle arbitrary array
7857 of converted selections stored in converted_selections.
7858 Separate the XChangeProperty and SelectionNotify steps.
7859 (x_handle_selection_request): Rewrite to handle MULTIPLE target.
7860 (x_convert_selection): New function.
7861 (x_handle_selection_event): Simplify.
7862 (x_get_foreign_selection): Don't ignore incoming requests while
7863 waiting for an answer; this will fail when we implement
7864 SAVE_TARGETS, and seems unnecessary anyway.
7865 (selection_data_to_lisp_data): Recognize ATOM_PAIR type.
7866 (Vx_sent_selection_functions): Doc fix.
7867
7868 2011-05-26 Leo Liu <sdl.web@gmail.com>
7869
7870 * editfns.c (Ftranspose_regions): Allow empty regions. (Bug#8699)
7871
7872 2011-05-25 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
7873
7874 * dispextern.h (struct glyph_row): New member fringe_bitmap_periodic_p.
7875
7876 * dispnew.c (shift_glyph_matrix, scrolling_window): Mark scrolled row
7877 for fringe update if it has periodic bitmap.
7878 (row_equal_p): Also compare left_fringe_offset, right_fringe_offset,
7879 and fringe_bitmap_periodic_p.
7880
7881 * fringe.c (get_fringe_bitmap_data): New function.
7882 (draw_fringe_bitmap_1, update_window_fringes): Use it.
7883 (update_window_fringes): Record periodicity of fringe bitmap in glyph
7884 row. Mark glyph row for fringe update if periodicity changed.
7885
7886 * xdisp.c (try_window_reusing_current_matrix): Don't mark scrolled row
7887 for fringe update unless it has periodic bitmap.
7888
7889 2011-05-25 Kenichi Handa <handa@m17n.org>
7890
7891 * xdisp.c (get_next_display_element): Set correct it->face_id for
7892 a static composition.
7893
7894 2011-05-24 Leo Liu <sdl.web@gmail.com>
7895
7896 * deps.mk (fns.o):
7897 * makefile.w32-in ($(BLD)/fns.$(O)): Include sha1.h.
7898
7899 * fns.c (crypto_hash_function, Fsha1): New function.
7900 (Fmd5): Use crypto_hash_function.
7901 (syms_of_fns): Add Ssha1.
7902
7903 2011-05-22 Paul Eggert <eggert@cs.ucla.edu>
7904
7905 * gnutls.c: Remove unused macros.
7906 (fn_gnutls_transport_set_lowat, fn_gnutls_transport_set_pull_function):
7907 (fn_gnutls_transport_set_push_function) [!WINDOWSNT]:
7908 Remove macros that are defined and never used.
7909 Caught by gcc -Wunused-macros (GCC 4.6.0, Fedora 14).
7910
7911 2011-05-22 Chong Yidong <cyd@stupidchicken.com>
7912
7913 * xselect.c (syms_of_xselect): Remove unused symbol SAVE_TARGETS.
7914 (Fx_get_selection_internal): Minor cleanup.
7915 (Fx_own_selection_internal): Rename arguments for consistency with
7916 select.el.
7917
7918 2011-05-22 Paul Eggert <eggert@cs.ucla.edu>
7919
7920 * xselect.c (QSAVE_TARGETS): New static var, to fix build failure.
7921
7922 2011-05-22 Chong Yidong <cyd@stupidchicken.com>
7923
7924 * xselect.c (syms_of_xselect): Include character.h; use DEFSYM.
7925
7926 2011-05-21 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
7927
7928 * dispnew.c (scrolling_window): Don't exclude the case that the
7929 last enabled row in the desired matrix touches the bottom boundary.
7930
7931 2011-05-21 Glenn Morris <rgm@gnu.org>
7932
7933 * Makefile.in ($(etc)/DOC): Make second command line even shorter.
7934 (SOME_MACHINE_OBJECTS): Replace FONT_OBJ by its maximal expansion,
7935 and add some more files.
7936
7937 2011-05-20 Eli Zaretskii <eliz@gnu.org>
7938
7939 * callproc.c (Fcall_process) [MSDOS]: Fix arguments to
7940 report_file_error introduced by the change from 2011-05-07.
7941
7942 2011-05-20 Paul Eggert <eggert@cs.ucla.edu>
7943
7944 * systime.h (Time): Define only if emacs is defined.
7945 This is to allow ../lib-src/profile.c to be compiled on FreeBSD,
7946 where the include path doesn't have X11/X.h by default. See
7947 <http://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00561.html>.
7948
7949 2011-05-20 Kenichi Handa <handa@m17n.org>
7950
7951 * composite.c (find_automatic_composition): Fix previous change.
7952
7953 2011-05-20 Glenn Morris <rgm@gnu.org>
7954
7955 * lisp.mk: New file, split from Makefile.in.
7956 * Makefile.in (lisp): Move to separate file, inserted by @lisp_frag@.
7957 (shortlisp): Remove.
7958 ($(etc)/DOC): Edit lisp.mk rather than using $shortlisp.
7959
7960 2011-05-19 Glenn Morris <rgm@gnu.org>
7961
7962 * Makefile.in (MSDOS_SUPPORT_REAL, MSDOS_SUPPORT, NS_SUPPORT)
7963 (REAL_MOUSE_SUPPORT, GPM_MOUSE_SUPPORT, MOUSE_SUPPORT, TOOLTIP_SUPPORT)
7964 (BASE_WINDOW_SUPPORT, X_WINDOW_SUPPORT, WINDOW_SUPPORT): Remove.
7965 (lisp): Set the order to that of loadup.el.
7966 (shortlisp): Make it a copy of $lisp.
7967 (SOME_MACHINE_LISP): Remove.
7968 ($(etc)/DOC): Depend just on $lisp, not $SOME_MACHINE_LISP too.
7969 Use just $shortlisp, not $SOME_MACHINE_LISP too.
7970
7971 2011-05-18 Kenichi Handa <handa@m17n.org>
7972
7973 * composite.c (CHAR_COMPOSABLE_P): Add more check for efficiency.
7974 (BACKWARD_CHAR): Wrap the arg STOP by parenthesis.
7975 (find_automatic_composition): Mostly rewrite for efficiency.
7976
7977 2011-05-18 Juanma Barranquero <lekktu@gmail.com>
7978
7979 * makefile.w32-in: Update dependencies.
7980
7981 2011-05-18 Christoph Scholtes <cschol2112@googlemail.com>
7982
7983 * menu.c: Include limits.h (fixes the MS-Windows build broken by
7984 2011-06-18T18:49:19Z!cyd@stupidchicken.com).
7985
7986 2011-05-18 Paul Eggert <eggert@cs.ucla.edu>
7987
7988 Fix some integer overflow issues, such as string length overflow.
7989
7990 * insdel.c (count_size_as_multibyte): Check for string overflow.
7991
7992 * character.c (lisp_string_width): Check for string overflow.
7993 Use EMACS_INT, not int, for string indexes and lengths; in
7994 particular, 2nd arg is now EMACS_INT, not int. Do not crash if
7995 the resulting string length overflows an EMACS_INT; instead,
7996 report a string overflow if no precision given. When checking for
7997 precision exhaustion, use a check that cannot possibly have
7998 integer overflow. (Bug#8675)
7999 * character.h (lisp_string_width): Adjust to new signature.
8000
8001 * alloc.c (string_overflow): New function.
8002 (Fmake_string): Use it. This doesn't change behavior, but saves
8003 a few bytes and will simplify future changes.
8004 * character.c (string_escape_byte8): Likewise.
8005 * lisp.h (string_overflow): New decl.
8006
8007 Fixups, following up to the user-interface timestamp change.
8008 * nsterm.m (last_mouse_movement_time, ns_mouse_position): Use Time
8009 for UI timestamps, instead of unsigned long.
8010 * msdos.c (mouse_get_pos): Likewise.
8011 * w32inevt.c (movement_time, w32_console_mouse_position): Likewise.
8012 * w32gui.h (Time): Define by including "systime.h" rather than by
8013 declaring it ourselves. (Bug#8664)
8014
8015 * dispextern.h (struct image): Don't assume time_t <= unsigned long.
8016 * image.c (clear_image_cache): Likewise.
8017
8018 * term.c (term_mouse_position): Don't assume time_t wraparound.
8019
8020 Be more systematic about user-interface timestamps.
8021 Before, the code sometimes used 'Time', sometimes 'unsigned long',
8022 and sometimes 'EMACS_UINT', to represent these timestamps.
8023 This change causes it to use 'Time' uniformly, as that's what X uses.
8024 This makes the code easier to follow, and makes it easier to catch
8025 integer overflow bugs such as Bug#8664.
8026 * frame.c (Fmouse_position, Fmouse_pixel_position):
8027 Use Time, not unsigned long, for user-interface timestamps.
8028 * keyboard.c (last_event_timestamp, kbd_buffer_get_event): Likewise.
8029 (button_down_time, make_lispy_position, make_lispy_movement): Likewise.
8030 * keyboard.h (last_event_timestamp): Likewise.
8031 * menu.c (Fx_popup_menu) [!HAVE_X_WINDOWS]: Likewise.
8032 * menu.h (xmenu_show): Likewise.
8033 * term.c (term_mouse_position): Likewise.
8034 * termhooks.h (struct input_event.timestamp): Likewise.
8035 (struct terminal.mouse_position_hook): Likewise.
8036 * xmenu.c (create_and_show_popup_menu, xmenu_show): Likewise.
8037 * xterm.c (XTmouse_position, x_scroll_bar_report_motion): Likewise.
8038 * systime.h (Time): New decl. Pull it in from <X11/X.h> if
8039 HAVE_X_WINDOWS, otherwise define it as unsigned long, which is
8040 what it was before.
8041 * menu.h, termhooks.h: Include "systime.h", for Time.
8042
8043 * keyboard.c (make_lispy_event): Fix problem in integer overflow.
8044 Don't assume that the difference between two unsigned long values
8045 can fit into an integer. At this point, we know button_down_time
8046 <= event->timestamp, so the difference must be nonnegative, so
8047 there's no need to cast the result if double-click-time is
8048 nonnegative, as it should be; check that it's nonnegative, just in
8049 case. This bug is triggered when events are more than 2**31 ms
8050 apart (about 25 days). (Bug#8664)
8051
8052 * xselect.c (last_event_timestamp): Remove duplicate decl.
8053 (x_own_selection): Remove needless cast to unsigned long.
8054
8055 * xmenu.c (set_frame_menubar): Use int, not EMACS_UINT, for indexes
8056 that always fit in int. Use a sentinel instead of a counter, to
8057 avoid a temp and to allay GCC's concerns about possible int overflow.
8058 * frame.h (struct frame): Use int for menu_bar_items_used
8059 instead of EMACS_INT, since it always fits in int.
8060
8061 * menu.c (grow_menu_items): Check for int overflow.
8062
8063 * xmenu.c (set_frame_menubar): Don't mishandle vectors with no nils.
8064
8065 * xterm.c: Use EMACS_INT for Emacs modifiers, and int for X modifiers.
8066 Before, the code was not consistent. These values cannot exceed
8067 2**31 - 1 so there's no need to make them unsigned.
8068 (x_x_to_emacs_modifiers): Accept int and return EMACS_INT.
8069 (x_emacs_to_x_modifiers): Accept EMACS_INT and return int.
8070 (x_x_to_emacs_modifiers, x_emacs_to_x_modifiers): Reject non-integers
8071 as modifiers.
8072 * xterm.h (x_x_to_emacs_modifiers): Adjust to signature change.
8073
8074 * lisp.h (XINT) [USE_LISP_UNION_TYPE]: Cast to EMACS_INT.
8075 (XUINT) [USE_LISP_UNION_TYPE]: Cast to EMACS_UINT.
8076 Otherwise, GCC 4.6.0 warns about printf (pI, XINT (...)),
8077 presumably because the widths might not match.
8078
8079 * window.c (size_window): Avoid needless test at loop start.
8080
8081 2011-05-18 Courtney Bane <emacs-bugs-7626@cbane.org> (tiny change)
8082
8083 * term.c (Fresume_tty): Restore hooks before reinitializing (bug#8687).
8084
8085 2011-05-12 Drew Adams <drew.adams@oracle.com>
8086
8087 * textprop.c (Fprevious_single_char_property_change): Doc fix (bug#8655).
8088
8089 2011-05-12 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
8090
8091 * w32term.c (w32_draw_fringe_bitmap): Rename local vars `left' and
8092 `width' to `bar_area_x' and `bar_area_width', respectively.
8093 (x_scroll_run): Take account of fringe background extension.
8094
8095 * xterm.c (x_draw_fringe_bitmap) [USE_TOOLKIT_SCROLL_BARS]:
8096 Rename local vars `left' and `width' to `bar_area_x' and
8097 `bar_area_width', respectively.
8098 (x_scroll_run) [USE_TOOLKIT_SCROLL_BARS]: Take account of fringe
8099 background extension.
8100
8101 2011-05-10 Jim Meyering <meyering@redhat.com>
8102
8103 * xdisp.c (x_intersect_rectangles): Fix typo "the the -> the".
8104
8105 2011-05-10 Juanma Barranquero <lekktu@gmail.com>
8106
8107 * image.c (Finit_image_library): Return t for built-in image types,
8108 like pbm and xbm. (Bug#8640)
8109
8110 2011-05-09 Andreas Schwab <schwab@linux-m68k.org>
8111
8112 * w32menu.c (set_frame_menubar): Fix submenu allocation.
8113
8114 2011-05-07 Eli Zaretskii <eliz@gnu.org>
8115
8116 * w32console.c (Fset_screen_color): Doc fix.
8117 (Fget_screen_color): New function.
8118 (syms_of_ntterm): Defsubr it.
8119
8120 * callproc.c (call_process_cleanup) [MSDOS]: Don't close and
8121 unlink the temporary file if Fcall_process didn't create it in the
8122 first place.
8123 (Fcall_process) [MSDOS]: Don't create tempfile if stdout of the
8124 child process will be redirected to a file specified with `:file'.
8125 Don't try to re-open tempfile in that case, and set fd[0] to -1 as
8126 cue to call_process_cleanup not to close that handle.
8127
8128 2011-05-07 Ben Key <bkey76@gmail.com>
8129
8130 * makefile.w32-in: The bootstrap-temacs rule now makes use of
8131 one of two shell specific rules, either bootstrap-temacs-CMD or
8132 bootstrap-temacs-SH. The bootstrap-temacs-SH rule is identical
8133 to the previous implementation of the bootstrap-temacs rule.
8134 The bootstrap-temacs-CMD rule is similar to the previous
8135 implementation of the bootstrap-temacs rule except that it
8136 makes use of the ESC_CFLAGS variable instead of the CFLAGS
8137 variable.
8138
8139 These changes, along with some changes to nt/configure.bat,
8140 nt/gmake.defs, and nt/nmake.defs, are required to extend my
8141 earlier fix to add support for --cflags and --ldflags options
8142 that include quotes so that it works whether make uses cmd or
8143 sh as the shell.
8144
8145 2011-05-06 Michael Albinus <michael.albinus@gmx.de>
8146
8147 * dbusbind.c (QCdbus_type_unix_fd): Declare static.
8148 (xd_remove_watch): Don't check QCdbus_type_unix_fd for SYMBOLP, it
8149 is a constant.
8150 (Fdbus_init_bus, xd_read_queued_messages): Bus can be a symbol or
8151 a string. Handle both cases.
8152 (Fdbus_call_method_asynchronously, Fdbus_register_signal)
8153 (Fdbus_register_method): Use Qinvalid_function.
8154
8155 2011-05-06 Juanma Barranquero <lekktu@gmail.com>
8156
8157 * makefile.w32-in: Update dependencies.
8158 (LISP_H): Add inttypes.h and stdin.h.
8159 (PROCESS_H): Add unistd.h.
8160
8161 2011-05-06 Eli Zaretskii <eliz@gnu.org>
8162
8163 * lread.c: Include limits.h (fixes the MS-Windows build broken by
8164 2011-05-06T07:13:19Z!eggert@cs.ucla.edu).
8165
8166 2011-05-06 Paul Eggert <eggert@cs.ucla.edu>
8167
8168 * image.c (Finit_image_library) [!HAVE_NTGUI]: Omit unused local.
8169
8170 * term.c (vfatal): Remove stray call to va_end.
8171 It's not needed and the C Standard doesn't allow it here anyway.
8172
8173 Use C99's va_copy to avoid undefined behavior on x86-64 GNU/Linux.
8174 * eval.c (verror): doprnt a copy of ap, not the original. (Bug#8545)
8175
8176 * eval.c (verror): OK to create a string of up to MOST_POSITIVE_FIXNUM
8177 bytes.
8178
8179 * term.c: Don't include <stdarg.h>, as <lisp.h> does that.
8180
8181 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork clobbering.
8182
8183 * process.c (Fformat_network_address): Fix typo: args2 -> *args2.
8184
8185 * xmenu.c (set_frame_menubar): Fix typo: int * -> int (3 times).
8186
8187 * coding.c (detect_coding_charset): Fix typo: * 2 -> *4 (Bug#8601).
8188
8189 * charset.h (struct charset.code_space): Now has 15 elements, not 16.
8190 * charset.c (Fdefine_charset_internal): Don't initialize
8191 charset.code_space[15]. The value was garbage, on hosts with
8192 32-bit int (Bug#8600).
8193
8194 * lread.c (read_integer): Be more consistent with string-to-number.
8195 Use string_to_number to do the actual conversion; this avoids
8196 rounding errors and fixes some other screwups. Without this fix,
8197 for example, #x1fffffffffffffff was misread as -2305843009213693952.
8198 (digit_to_number): Move earlier, for benefit of read_integer.
8199 Return -1 if the digit is out of range for the base, -2 if it is
8200 not a digit in any supported base. (Bug#8602)
8201
8202 * doprnt.c (doprnt): Support arbitrary pI values, such as "I64".
8203
8204 * dispnew.c (scrolling_window): Return 1 if we scrolled,
8205 to match comment at start of function. This also removes a
8206 GCC warning about overflow in a 32+64-bit port.
8207
8208 * lisp.h (EMACS_INT, EMACS_UINT, BITS_PER_EMACS_INT, pI): Simplify.
8209
8210 * dbusbind.c: Do not use XPNTR on a value that may be an integer.
8211 Reported by Stefan Monnier in
8212 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00919.html>.
8213 (xd_remove_watch, Fdbus_init_bus, xd_read_queued_messages):
8214 Use SYMBOLP-guarded XSYMBOL, not XPNTR.
8215
8216 * lisp.h (EMACS_INTPTR): Remove. All uses changed to intptr_t.
8217 (EMACS_UINTPTR): Likewise, with uintptr_t.
8218
8219 * lisp.h: Prefer 64-bit EMACS_INT if available.
8220 (EMACS_INT, EMACS_UINT, BITS_PER_EMACS_INT, pI): Define to 64-bit
8221 on 32-bit hosts that have 64-bit int, so that they can access
8222 large files.
8223 However, temporarily disable this change unless the temporary
8224 symbol WIDE_EMACS_INT is defined.
8225
8226 * lread.c, process.c: Do not include <inttypes.h>; lisp.h does it now.
8227
8228 Prefer intptr_t/uintptr_t for integers the same widths as pointers.
8229 This removes an assumption that EMACS_INT and long are the same
8230 width as pointers. The assumption is true for Emacs porting targets
8231 now, but we want to make other targets possible.
8232 * lisp.h: Include <inttypes.h>, for INTPTR_MAX, UINTPTR_MAX.
8233 (EMACS_INTPTR, EMACS_UINTPTR): New macros.
8234 In the rest of the code, change types of integers that hold casted
8235 pointers to EMACS_INTPTR and EMACS_UINTPTR, systematically
8236 replacing EMACS_INT, long, EMACS_UINT, and unsigned long.
8237 (XTYPE): Don't cast arg to EMACS_UINT; normally is not needed.
8238 (XSET): Cast type of XTYPE arg to EMACS_INTPTR; it is needed here.
8239 No need to cast type when ORing.
8240 (XPNTR): Return a value of type EMACS_INTPTR or EMACS_UINTPTR.
8241 * alloc.c (lisp_align_malloc): Remove a no-longer-needed cast.
8242 * doc.c (store_function_docstring): Use EMACS_INTPTR, so as not to
8243 assume EMACS_INT is the same width as char *.
8244 * gtkutil.c (xg_gtk_scroll_destroy, xg_tool_bar_button_cb):
8245 (xg_tool_bar_callback, xg_tool_bar_help_callback, xg_make_tool_item):
8246 Remove no-longer-needed casts.
8247 (xg_create_scroll_bar, xg_tool_bar_button_cb, xg_tool_bar_callback):
8248 (xg_tool_bar_help_callback, xg_make_tool_item):
8249 Use EMACS_INTPTR to hold an integer
8250 that will be cast to void *; this can avoid a GCC warning
8251 if EMACS_INT is not the same width as void *.
8252 * menu.c (find_and_call_menu_selection): Remove no-longer-needed cast.
8253 * xdisp.c (display_echo_area_1, resize_mini_window_1):
8254 (current_message_1, set_message_1):
8255 Use a local to convert to proper width without a cast.
8256 * xmenu.c (dialog_selection_callback): Likewise.
8257
8258 * sysdep.c (get_random): Don't assume EMACS_INT is no wider than long.
8259 Also, don't assume VALBITS / RAND_BITS is less than 5,
8260 and don't rely on undefined behavior when shifting a 1 left into
8261 the sign bit.
8262 * lisp.h (get_random): Change signature to match.
8263
8264 * lread.c (hash_string): Use size_t, not int, for hash computation.
8265 Normally we prefer signed values; but hashing is special, because
8266 it's better to use unsigned division on hash table sizes so that
8267 the remainder is nonnegative. Also, size_t is the natural width
8268 for hashing into memory. The previous code used 'int', which doesn't
8269 retain enough info to hash well into very large tables.
8270 (oblookup, oblookup_last_bucket_number, Funintern): Likewise.
8271
8272 * dbusbind.c: Don't possibly lose pointer info when converting.
8273 (xd_remove_watch, Fdbus_init_bus, xd_read_queued_messages):
8274 Use XPNTR rather than XHASH, so that the high-order bits of
8275 the pointer aren't lost when converting through void *.
8276
8277 * eval.c (Fautoload): Don't double-shift a pointer.
8278
8279 * fns.c (Frandom): Let EMACS_UINT be wider than unsigned long.
8280
8281 2011-05-06 Juanma Barranquero <lekktu@gmail.com>
8282
8283 * gnutls.c (DEF_GNUTLS_FN):
8284 * image.c (DEF_IMGLIB_FN): Make function pointers static.
8285
8286 2011-05-05 Andreas Schwab <schwab@linux-m68k.org>
8287
8288 * lread.c (lisp_file_lexically_bound_p): Stop scanning at end
8289 marker. (Bug#8610)
8290
8291 2011-05-05 Eli Zaretskii <eliz@gnu.org>
8292
8293 * w32heap.c (allocate_heap) [USE_LISP_UNION_TYPE || USE_LSB_TAG]:
8294 New version that can reserve upto 2GB of heap space.
8295
8296 2011-05-05 Chong Yidong <cyd@stupidchicken.com>
8297
8298 * nsfns.m (Fns_read_file_name): Doc fix (Bug#8534).
8299
8300 2011-05-05 Teodor Zlatanov <tzz@lifelogs.com>
8301
8302 * gnutls.c (fn_gnutls_certificate_set_x509_key_file): Add alias to
8303 `gnutls_certificate_set_x509_key_file'.
8304
8305 2011-05-05 Juanma Barranquero <lekktu@gmail.com>
8306
8307 * makefile.w32-in ($(BLD)/image.$(O), $(BLD)/process.$(O)):
8308 Update dependencies.
8309
8310 2011-05-04 Juanma Barranquero <lekktu@gmail.com>
8311
8312 * gnutls.h (emacs_gnutls_write, emacs_gnutls_read):
8313 * gnutls.c (emacs_gnutls_write, emacs_gnutls_read):
8314 Remove unused parameter `fildes'.
8315 * process.c (read_process_output, send_process): Don't pass it.
8316
8317 2011-05-04 Juanma Barranquero <lekktu@gmail.com>
8318
8319 Fix previous change: the library cache is defined in w32.c.
8320 * image.c (CACHE_IMAGE_TYPE) [!HAVE_NTGUI]: Define to noop.
8321 (Finit_image_library): Wrap Vlibrary_cache on "#ifdef HAVE_NTGUI".
8322
8323 2011-05-04 Juanma Barranquero <lekktu@gmail.com>
8324
8325 Implement dynamic loading of GnuTLS on Windows.
8326
8327 * gnutls.h (GNUTLS_EMACS_ERROR_NOT_LOADED): New macro.
8328 (emacs_gnutls_write, emacs_gnutls_read): Mark as extern.
8329 (emacs_gnutls_record_check_pending, emacs_gnutls_transport_set_errno):
8330 Declare.
8331
8332 * gnutls.c (Qgnutls_dll): Define.
8333 (DEF_GNUTLS_FN, LOAD_GNUTLS_FN): New macros.
8334 (gnutls_*): Declare function pointers.
8335 (init_gnutls_functions): New function to initialize function pointers.
8336 (emacs_gnutls_handshake, Fgnutls_error_string, Fgnutls_deinit)
8337 (emacs_gnutls_global_init, Fgnutls_bye): Use function pointers.
8338 (emacs_gnutls_record_check_pending, emacs_gnutls_transport_set_errno):
8339 Wrappers for gnutls_record_check_pending and gnutls_transport_set_errno.
8340 (emacs_gnutls_write, emacs_gnutls_read)
8341 (emacs_gnutls_handle_error, Fgnutls_error_fatalp)
8342 (Fgnutls_available_p): New function.
8343 (Fgnutls_boot): Call Fgnutls_available_p. Use function pointers.
8344 (syms_of_gnutls) <Qgnutls_dll>: Initialize and staticpro it.
8345 (syms_of_gnutls) <Sgnutls_available_p>: defsubr it.
8346
8347 * image.c: Include w32.h.
8348 (Vimage_type_cache): Delete.
8349 (syms_of_image) <Vimage_type_cache>: Don't initialize and staticpro it.
8350 (CACHE_IMAGE_TYPE, Finit_image_library): Use Vlibrary_cache instead.
8351 (w32_delayed_load): Move to w32.c.
8352
8353 * w32.h (VlibraryCache, QCloaded_from, w32_delayed_load): Declare.
8354
8355 * w32.c (QCloaded_from, Vlibrary_cache): Define.
8356 (w32_delayed_load): Move from image.c. When loading a library, record
8357 its filename in the :loaded-from property of the library id.
8358 (globals_of_w32) <QCloaded_from, Vlibrary_cache>:
8359 Initialize and staticpro them.
8360 (emacs_gnutls_pull, emacs_gnutls_push): Call emacs_gnutls_* functions.
8361
8362 * process.c: Include lisp.h before w32.h, not after.
8363 (wait_reading_process_output): Call emacs_gnutls_record_check_pending
8364 instead of gnutls_record_check_pending.
8365
8366 * callproc.c, emacs.c: Include lisp.h before w32.h, not after.
8367
8368 2011-05-04 Teodor Zlatanov <tzz@lifelogs.com>
8369
8370 * gnutls.c (Fgnutls_boot): Support :keylist and :crlfiles options
8371 instead of :keyfiles. Give GnuTLS the keylist and the CRL lists
8372 as passed in.
8373
8374 2011-05-03 Jan Djärv <jan.h.d@swipnet.se>
8375
8376 * xterm.c (x_set_frame_alpha): Do not set property on anything
8377 else than FRAME_X_OUTER_WINDOW (Bug#8608).
8378
8379 2011-05-02 Juanma Barranquero <lekktu@gmail.com>
8380
8381 * sysdep.c (get_tty_size) [WINDOWSNT]: Implement. (Bug#8596)
8382
8383 2011-05-02 Juanma Barranquero <lekktu@gmail.com>
8384
8385 * gnutls.c (Qgnutls_log_level, Qgnutls_code, Qgnutls_anon)
8386 (Qgnutls_x509pki, Qgnutls_e_interrupted, Qgnutls_e_again)
8387 (Qgnutls_e_invalid_session, Qgnutls_e_not_ready_for_handshake)
8388 (gnutls_global_initialized, Qgnutls_bootprop_priority)
8389 (Qgnutls_bootprop_trustfiles, Qgnutls_bootprop_keyfiles)
8390 (Qgnutls_bootprop_callbacks, Qgnutls_bootprop_loglevel)
8391 (Qgnutls_bootprop_hostname, Qgnutls_bootprop_verify_flags)
8392 (Qgnutls_bootprop_verify_error, Qgnutls_bootprop_verify_hostname_error)
8393 (Qgnutls_bootprop_callbacks_verify): Make static.
8394
8395 2011-05-01 Andreas Schwab <schwab@linux-m68k.org>
8396
8397 * callproc.c: Indentation fixup.
8398
8399 * sysdep.c (wait_for_termination_1): Make static.
8400 (wait_for_termination, interruptible_wait_for_termination):
8401 Move after wait_for_termination_1.
8402
8403 2011-05-01 Lars Magne Ingebrigtsen <larsi@gnus.org>
8404
8405 * sysdep.c (interruptible_wait_for_termination): New function
8406 which is like wait_for_termination, but allows keyboard
8407 interruptions.
8408
8409 * callproc.c (Fcall_process): Add (:file "file") as an option for
8410 the STDOUT buffer.
8411 (Fcall_process_region): Ditto.
8412
8413 2011-04-30 Eli Zaretskii <eliz@gnu.org>
8414
8415 * dosfns.c (Fint86, Fdos_memget, Fdos_memput): Use `ASIZE (FOO)'
8416 rather than `XVECTOR (FOO)->size'.
8417
8418 * process.c: Remove HAVE_INTTYPES_H condition from inclusion of
8419 inttypes.h, as a gnulib replacement is used if it not available in
8420 system headers.
8421
8422 2011-04-21 Eli Zaretskii <eliz@gnu.org>
8423
8424 Lift the MOST_POSITIVE_FIXNUM/4 limitation on visited files.
8425 * fileio.c (Finsert_file_contents): Don't limit file size to 1/4
8426 of MOST_POSITIVE_FIXNUM. (Bug#8528)
8427
8428 * coding.c (coding_alloc_by_realloc): Error out if destination
8429 will grow beyond MOST_POSITIVE_FIXNUM.
8430 (decode_coding_emacs_mule): Abort if there isn't enough place in
8431 charbuf for the composition carryover bytes. Reserve an extra
8432 space for up to 2 characters produced in a loop.
8433 (decode_coding_iso_2022): Abort if there isn't enough place in
8434 charbuf for the composition carryover bytes.
8435
8436 2011-04-21 Eli Zaretskii <eliz@gnu.org>
8437
8438 * doprnt.c (doprnt) [!HAVE_LONG_LONG_INT]: Error out instead of
8439 aborting when %lld or %lll format is passed.
8440 [!HAVE_UNSIGNED_LONG_LONG_INT]: Error out instead of aborting when
8441 %llo or %llx format is passed. (Bug#8545)
8442
8443 * window.c (window_scroll_line_based): Use a marker instead of
8444 simple variables to record original value of point. (Bug#7952)
8445
8446 * doprnt.c (doprnt): Fix the case where a multibyte sequence
8447 produced by %s or %c overflows available buffer space. (Bug#8545)
8448
8449 2011-04-28 Paul Eggert <eggert@cs.ucla.edu>
8450
8451 * doprnt.c (doprnt): Omit useless test; int overflow check (Bug#8545).
8452 (SIZE_MAX): Move defn after all includes, as they might #define it.
8453
8454 2011-04-28 Juanma Barranquero <lekktu@gmail.com>
8455
8456 * w32.c (init_environment): Warn about defaulting HOME to C:\.
8457
8458 2011-04-28 Juanma Barranquero <lekktu@gmail.com>
8459
8460 * keyboard.c (Qdelayed_warnings_hook): Define.
8461 (command_loop_1): Run `delayed-warnings-hook'
8462 if Vdelayed_warnings_list is non-nil.
8463 (syms_of_keyboard) <delayed-warnings-hook>: DEFSYM it.
8464 (syms_of_keyboard) <delayed-warnings-list>: DEFVAR_LISP it.
8465
8466 2011-04-28 Eli Zaretskii <eliz@gnu.org>
8467
8468 * doprnt.c (doprnt): Don't return value smaller than the buffer
8469 size if the message was truncated. (Bug#8545).
8470
8471 2011-04-28 Juanma Barranquero <lekktu@gmail.com>
8472
8473 * w32fns.c (Fx_change_window_property, Fx_delete_window_property)
8474 (Fx_window_property): #if-0 the whole functions, not just the bodies.
8475
8476 2011-04-27 Paul Eggert <eggert@cs.ucla.edu>
8477
8478 * doprnt.c (doprnt): Support "ll" length modifier, for long long.
8479
8480 2011-04-27 Juanma Barranquero <lekktu@gmail.com>
8481
8482 * makefile.w32-in: Update dependencies.
8483
8484 2011-04-27 Eli Zaretskii <eliz@gnu.org>
8485
8486 Improve `doprnt' and its usage. (Bug#8545)
8487 * doprnt.c (doprnt): Make sure `format' is never accessed beyond
8488 `format_end'. Remove support for %l as a conversion specifier.
8489 Don't use xrealloc. Improve diagnostics when the %l size modifier
8490 is used. Update the commentary.
8491
8492 * eval.c (verror): Simplify calculation of size_t.
8493
8494 * coding.c (Ffind_operation_coding_system): Fix diagnostic error
8495 messages.
8496
8497 2011-04-27 Yoshiaki Kasahara <kasahara@nc.kyushu-u.ac.jp> (tiny change)
8498
8499 * buffer.c (init_buffer) [USE_MMAP_FOR_BUFFERS]: Adjust to aliasing
8500 change.
8501
8502 2011-04-27 Paul Eggert <eggert@cs.ucla.edu>
8503
8504 * nsmenu.m: Replace all uses of XVECTOR with ASIZE and AREF.
8505 This makes this file independent of the recent pseudovector change.
8506
8507 2011-04-26 Paul Eggert <eggert@cs.ucla.edu>
8508
8509 * keyboard.c (handle_user_signal): Fix pointer signedness problem.
8510
8511 * gnutls.c (emacs_gnutls_handle_error): Remove unused local.
8512 (Fgnutls_boot): gnutls_certificate_verify_peers2 wants unsigned *.
8513 Remove unused local.
8514 (emacs_gnutls_write): Don't use uninitialized rtnval if nbyte <= 0.
8515
8516 * lisp.h: Fix a problem with aliasing and vector headers. (Bug#8546)
8517 GCC 4.6.0 optimizes based on type-based alias analysis.
8518 For example, if b is of type struct buffer * and v of type struct
8519 Lisp_Vector *, then gcc -O2 was incorrectly assuming that &b->size
8520 != &v->size, and therefore "v->size = 1; b->size = 2; return
8521 v->size;" must therefore return 1. This assumption is incorrect
8522 for Emacs, since it type-puns struct Lisp_Vector * with many other
8523 types. To fix this problem, this patch adds a new type struct
8524 vectorlike_header that documents the constraints on layout of vectors
8525 and pseudovectors, and helps optimizing compilers not get fooled
8526 by Emacs's type punning. It also adds the macros XSETTYPED_PVECTYPE
8527 XSETTYPED_PSEUDOVECTOR, TYPED_PSEUDOVECTORP, for similar reasons.
8528 * lisp.h (XSETTYPED_PVECTYPE): New macro, specifying the name of
8529 the size member.
8530 (XSETPVECTYPE): Rewrite in terms of new macro.
8531 (XSETPVECTYPESIZE): New macro, specifying both type and size.
8532 This is a bit clearer, and further avoids the possibility of
8533 undesirable aliasing.
8534 (XSETTYPED_PSEUDOVECTOR): New macro, specifying the size.
8535 (XSETPSEUDOVECTOR): Rewrite in terms of XSETTYPED_PSEUDOVECTOR.
8536 (XSETSUBR): Rewrite in terms of XSETTYPED_PSEUDOVECTOR and XSIZE,
8537 since Lisp_Subr is a special case (no "next" field).
8538 (ASIZE): Now uses header.size rather than size.
8539 All previous uses of XVECTOR (foo)->size replaced to use this macro,
8540 to avoid the hassle of writing XVECTOR (foo)->header.size.
8541 (struct vectorlike_header): New type.
8542 (TYPED_PSEUDOVECTORP): New macro, also specifying the C type of the
8543 object, to help avoid aliasing.
8544 (PSEUDOVECTORP): Rewrite in terms of TYPED_PSEUDOVECTORP.
8545 (SUBRP): Likewise, since Lisp_Subr is a special case.
8546 * lisp.h (struct Lisp_Vector, struct Lisp_Char_Table):
8547 (struct Lisp_Sub_Char_Table, struct Lisp_Bool_Vector):
8548 (struct Lisp_Hash_Table): Combine first two members into a single
8549 struct vectorlike_header member. All uses of "size" and "next" members
8550 changed to be "header.size" and "header.next".
8551 * buffer.h (struct buffer): Likewise.
8552 * font.h (struct font_spec, struct font_entity, struct font): Likewise.
8553 * frame.h (struct frame): Likewise.
8554 * process.h (struct Lisp_Process): Likewise.
8555 * termhooks.h (struct terminal): Likewise.
8556 * window.c (struct save_window_data, struct saved_window): Likewise.
8557 * window.h (struct window): Likewise.
8558 * alloc.c (allocate_buffer, Fmake_bool_vector, allocate_pseudovector):
8559 Use XSETPVECTYPESIZE, not XSETPVECTYPE, to avoid aliasing problems.
8560 * buffer.c (init_buffer_once): Likewise.
8561 * lread.c (defsubr): Use XSETTYPED_PVECTYPE, since Lisp_Subr is a
8562 special case.
8563 * process.c (Fformat_network_address): Use local var for size,
8564 for brevity.
8565
8566 * bytecode.c (exec_byte_code): Don't use XVECTOR before CHECK_VECTOR.
8567
8568 Make the Lisp reader and string-to-float more consistent (Bug#8525)
8569 * data.c (atof): Remove decl; no longer used or needed.
8570 (digit_to_number): Move to lread.c.
8571 (Fstring_to_number): Use new string_to_number function, to be
8572 consistent with how the Lisp reader treats infinities and NaNs.
8573 Do not assume that floating-point numbers represent EMACS_INT
8574 without losing information; this is not true on most 64-bit hosts.
8575 Avoid double-rounding errors, by insisting on integers when
8576 parsing non-base-10 numbers, as the documentation specifies.
8577 * lisp.h (string_to_number): New decl, replacing ...
8578 (isfloat_string): Remove.
8579 * lread.c: Include <inttypes.h>, for uintmax_t and strtoumax.
8580 (read1): Do not accept +. and -. as integers; this
8581 appears to have been a coding error. Similarly, do not accept
8582 strings like +-1e0 as floating point numbers. Do not report
8583 overflow for integer overflows unless the base is not 10 which
8584 means we have no simple and reliable way to continue.
8585 Break out the floating-point parsing into a new
8586 function string_to_number, so that Fstring_to_number parses
8587 floating point numbers consistently with the Lisp reader.
8588 (digit_to_number): Move here from data.c. Make it static inline.
8589 (E_CHAR, EXP_INT): Remove, replacing with ...
8590 (E_EXP): New macro, to solve the "1.0e+" problem mentioned below.
8591 (string_to_number): New function, replacing isfloat_string.
8592 This function checks for valid syntax and produces the resulting
8593 Lisp float number too. Rework it so that string-to-number
8594 no longer mishandles examples like "1.0e+". Use strtoumax,
8595 so that overflow for non-base-10 numbers is reported only when
8596 there's no portable and simple way to convert to floating point.
8597
8598 * textprop.c (set_text_properties_1): Rewrite for clarity,
8599 and to avoid GCC warning about integer overflow.
8600
8601 * intervals.h (struct interval): Use EMACS_INT for members
8602 where EMACS_UINT might cause problems. See
8603 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00514.html>.
8604 (CHECK_TOTAL_LENGTH): Remove cast to EMACS_INT; no longer needed.
8605 * intervals.c (interval_deletion_adjustment): Now returns EMACS_INT.
8606 All uses changed.
8607 (offset_intervals): Tell GCC not to worry about length overflow
8608 when negating a negative length.
8609
8610 * alloc.c (overrun_check_malloc, overrun_check_realloc): Now static.
8611 (overrun_check_free): Likewise.
8612
8613 * alloc.c (SDATA_SIZE) [!GC_CHECK_STRING_BYTES]: Avoid runtime check
8614 in the common case where SDATA_DATA_OFFSET is a multiple of Emacs
8615 word size.
8616
8617 * gnutls.c: Fix problems found by GCC 4.6.0 on Ubuntu 10.10.
8618 (gnutls_make_error): Rename local to avoid shadowing.
8619 (gnutls_emacs_global_deinit): ifdef out; not used.
8620 (Fgnutls_boot): Use const for pointer to readonly storage.
8621 Comment out unused local. Fix pointer signedness problems.
8622
8623 * lread.c (openp): Don't stuff size_t into an 'int'.
8624 Use <= on length, not < on length + 1, to avoid GCC 4.6.0 warning
8625 about possible signed overflow.
8626
8627 * gtkutil.c: Fix problems found by GCC 4.6.0 on Ubuntu 10.10.
8628 (GDK_KEY_g): Don't define if already defined.
8629 (xg_prepare_tooltip): Avoid pointer signedness problem.
8630 (xg_set_toolkit_scroll_bar_thumb): Redo to avoid two casts.
8631
8632 * process.c (Fnetwork_interface_info): Avoid left-shift undefined
8633 behavior with 1 << 31. GCC 4.6.0 warns about this on 32-bit hosts.
8634
8635 * xfns.c (Fx_window_property): Simplify a bit,
8636 to make a bit faster and to avoid GCC 4.6.0 warning.
8637 * xselect.c (x_get_window_property, x_handle_dnd_message): Likewise.
8638
8639 * fns.c (internal_equal): Don't assume size_t fits in int.
8640
8641 * alloc.c (compact_small_strings): Tighten assertion a little.
8642
8643 Replace pEd with more-general pI, and fix some printf arg casts.
8644 * lisp.h (pI): New macro, generalizing old pEd macro to other
8645 conversion specifiers. For example, use "...%"pI"d..." rather
8646 than "...%"pEd"...".
8647 (pEd): Remove. All uses replaced with similar uses of pI.
8648 * m/amdx86-64.h, m/ia64.h, m/ibms390x.h: Likewise.
8649 * alloc.c (check_pure_size): Don't overflow by converting size to int.
8650 * bidi.c (bidi_dump_cached_states): Use pI to avoid cast.
8651 * data.c (Fnumber_to_string): Use pI instead of if-then-else-abort.
8652 * dbusbind.c (xd_append_arg): Use pI to avoid cast.
8653 (Fdbus_method_return_internal, Fdbus_method_error_internal): Likewise.
8654 * font.c (font_unparse_xlfd): Avoid potential buffer overrun on
8655 64-bit hosts.
8656 (font_unparse_xlfd, font_unparse_fcname): Use pI to avoid casts.
8657 * keyboard.c (record_char, modify_event_symbol): Use pI to avoid casts.
8658 * print.c (safe_debug_print, print_object): Likewise.
8659 (print_object): Don't overflow by converting EMACS_INT or EMACS_UINT
8660 to int.
8661 Use pI instead of if-then-else-abort. Use %p to avoid casts,
8662 avoiding the 0 flag, which is not portable.
8663 * process.c (Fmake_network_process): Use pI to avoid cast.
8664 * region-cache.c (pp_cache): Likewise.
8665 * xdisp.c (decode_mode_spec): Likewise.
8666 * xrdb.c (x_load_resources) [USE_MOTIF]: Use pI to avoid undefined
8667 behavior on 64-bit hosts with printf arg.
8668 * xselect.c (x_queue_event): Use %p to avoid casts, avoiding 0 flag.
8669 (x_stop_queuing_selection_requests): Likewise.
8670 (x_get_window_property): Don't truncate byte count to an 'int'
8671 when tracing.
8672
8673 * frame.c (frame_name_fnn_p): Get rid of strtol, which isn't right
8674 here, since it parses constructs like leading '-' and spaces,
8675 which are not wanted; and it overflows with large numbers.
8676 Instead, simply match F[0-9]+, which is what is wanted anyway.
8677
8678 * alloc.c: Remove unportable assumptions about struct layout.
8679 (SDATA_SELECTOR, SDATA_DATA_OFFSET): New macros.
8680 (SDATA_OF_STRING, SDATA_SIZE, allocate_string_data):
8681 (allocate_vectorlike, make_pure_vector): Use the new macros,
8682 plus offsetof, to remove unportable assumptions about struct layout.
8683 These assumptions hold on all porting targets that I know of, but
8684 they are not guaranteed, they're easy to remove, and removing them
8685 makes further changes easier.
8686
8687 * alloc.c (BLOCK BYTES): Fix typo by changing "ablock" to "ablocks".
8688 This doesn't fix a bug but makes the code clearer.
8689 (string_overrun_cookie): Now const. Use initializers that
8690 don't formally overflow signed char, to avoid warnings.
8691 (allocate_string_data) [GC_CHECK_STRING_OVERRUN]: Fix typo that
8692 can cause Emacs to crash when string overrun checking is enabled.
8693 (allocate_buffer): Don't assume sizeof (struct buffer) is a
8694 multiple of sizeof (EMACS_INT); it need not be, if
8695 alignof(EMACS_INT) < sizeof (EMACS_INT).
8696 (check_sblock, check_string_bytes, check_string_free_list): Protoize.
8697
8698 2011-04-26 Juanma Barranquero <lekktu@gmail.com>
8699
8700 * keyboard.c (QCrtl): Rename from Qrtl. All uses changed.
8701
8702 2011-04-26 Teodor Zlatanov <tzz@lifelogs.com>
8703
8704 * gnutls.c (emacs_gnutls_handshake): Return an error if we're not
8705 supposed to be handshaking. (Bug#8556)
8706 Reported by Paul Eggert <eggert@cs.ucla.edu>.
8707
8708 2011-04-26 Daniel Colascione <dan.colascione@gmail.com>
8709
8710 * lisp.h (Qdebug): List symbol.
8711 * eval.c (Qdebug): Restore global linkage.
8712 * keyboard.c (debug-on-event): New variable.
8713 (handle_user_signal): Break into debugger when debug-on-event
8714 matches the current signal symbol.
8715
8716 2011-04-25 Dan Nicolaescu <dann@ics.uci.edu>
8717
8718 * alloc.c (check_sblock, check_string_bytes)
8719 (check_string_free_list): Convert to standard C.
8720
8721 2011-04-25 Teodor Zlatanov <tzz@lifelogs.com>
8722
8723 * w32.c (emacs_gnutls_push): Fix typo.
8724
8725 2011-04-25 Eli Zaretskii <eliz@gnu.org>
8726
8727 * gnutls.c (emacs_gnutls_handshake): Avoid compiler warnings about
8728 "cast to pointer from integer of different size".
8729
8730 Improve doprnt and its use in verror. (Bug#8545)
8731 * doprnt.c (doprnt): Document the set of format control sequences
8732 supported by the function. Use SAFE_ALLOCA instead of always
8733 using `alloca'.
8734
8735 * eval.c (verror): Don't limit the buffer size at size_max-1, that
8736 is one byte too soon. Don't use xrealloc; instead xfree and
8737 xmalloc anew.
8738
8739 2011-04-24 Teodor Zlatanov <tzz@lifelogs.com>
8740
8741 * gnutls.h: Add GNUTLS_STAGE_CALLBACKS enum to denote we're in the
8742 callbacks stage.
8743
8744 * gnutls.c: Renamed global_initialized to
8745 gnutls_global_initialized. Added internals for the
8746 :verify-hostname-error, :verify-error, and :verify-flags
8747 parameters of `gnutls-boot' and documented those parameters in the
8748 docstring. Start callback support.
8749 (emacs_gnutls_handshake): Add Woe32 support. Retry handshake
8750 unless a fatal error occurred. Call gnutls_alert_send_appropriate
8751 on error. Return error code.
8752 (emacs_gnutls_write): Call emacs_gnutls_handle_error.
8753 (emacs_gnutls_read): Likewise.
8754 (Fgnutls_boot): Return handshake error code.
8755 (emacs_gnutls_handle_error): New function.
8756 (wsaerror_to_errno): Likewise.
8757
8758 * w32.h (emacs_gnutls_pull): Add prototype.
8759 (emacs_gnutls_push): Likewise.
8760
8761 * w32.c (emacs_gnutls_pull): New function for GnuTLS on Woe32.
8762 (emacs_gnutls_push): Likewise.
8763
8764 2011-04-24 Claudio Bley <claudio.bley@gmail.com> (tiny change)
8765
8766 * process.c (wait_reading_process_output): Check if GnuTLS
8767 buffered some data internally if no FDs are set for TLS
8768 connections.
8769
8770 * makefile.w32-in (OBJ2): Add gnutls.$(O).
8771 (LIBS): Link to USER_LIBS.
8772 ($(BLD)/gnutls.$(0)): New target.
8773
8774 2011-04-24 Eli Zaretskii <eliz@gnu.org>
8775
8776 * xdisp.c (handle_single_display_spec): Rename the
8777 display_replaced_before_p argument into display_replaced_p, to
8778 make it consistent with the commentary. Fix typos in the
8779 commentary.
8780
8781 * textprop.c (syms_of_textprop): Remove dead code.
8782 (copy_text_properties): Delete obsolete commentary about an
8783 interface that was deleted long ago. Fix typos in the description
8784 of arguments.
8785
8786 * msdos.c (XMenuActivate, XMenuAddSelection): Adjust argument list
8787 to changes in oldXMenu/XMenu.h from 2011-04-16.
8788 <menu_help_message, prev_menu_help_message>: Constify.
8789 (IT_menu_make_room): menu->help_text is now `const char **';
8790 adjust.
8791
8792 * msdos.h (XMenuActivate, XMenuAddSelection): Adjust prototypes
8793 to changes in oldXMenu/XMenu.h from 2011-04-16.
8794 (struct XMenu): Declare `help_text' `const char **'.
8795
8796 * xfaces.c <Qunspecified>: Make extern again.
8797
8798 * syntax.c: Include sys/types.h before including regex.h, as
8799 required by POSIX.
8800
8801 * doc.c (get_doc_string): Improve the format passed to `error'.
8802
8803 * doprnt.c (doprnt): Improve commentary.
8804
8805 * term.c (init_tty) [MSDOS]: Fix 1st argument to maybe_fatal.
8806
8807 * Makefile.in (TAGS): Depend on $(M_FILE) and $(S_FILE), and scan
8808 them with etags.
8809
8810 * makefile.w32-in (globals.h): Add a dummy recipe, to make any
8811 changes in globals.h immediately force recompilation.
8812 (TAGS): Depend on $(CURDIR)/m/intel386.h and
8813 $(CURDIR)/s/ms-w32.h.
8814 (TAGS-gmake): Scan $(CURDIR)/m/intel386.h and $(CURDIR)/s/ms-w32.h.
8815
8816 * character.c (Fchar_direction): Function deleted.
8817 (syms_of_character): Don't defsubr it.
8818 <char-direction-table>: Deleted.
8819
8820 2011-04-23 Eli Zaretskii <eliz@gnu.org>
8821
8822 Fix doprnt so it could be used again safely in `verror'. (Bug#8435)
8823 * doprnt.c: Include limits.h.
8824 (SIZE_MAX): New macro.
8825 (doprnt): Return a size_t value. 2nd arg is now size_t.
8826 Many local variables are now size_t instead of int or unsigned.
8827 Improve overflow protection. Support `l' modifier for integer
8828 conversions. Support %l conversion. Don't assume an EMACS_INT
8829 argument for integer conversions and for %c.
8830
8831 * lisp.h (doprnt): Restore prototype.
8832
8833 * makefile.w32-in ($(BLD)/callint.$(O)): Depend on
8834 $(SRC)/character.h.
8835
8836 * Makefile.in (base_obj): Add back doprnt.o.
8837
8838 * deps.mk (doprnt.o): Add back prerequisites.
8839 (callint.o): Depend on character.h.
8840
8841 * eval.c (internal_lisp_condition_case): Include the handler
8842 representation in the error message.
8843 (verror): Call doprnt instead of vsnprintf. Fix an off-by-one bug
8844 when breaking from the loop.
8845
8846 * xdisp.c (vmessage): Call doprnt instead of vsnprintf.
8847
8848 * callint.c (Fcall_interactively): When displaying error message
8849 about invalid control letter, pass the character's codepoint, not
8850 a pointer to its multibyte form. Improve display of the character
8851 in octal and display also its hex code.
8852
8853 * character.c (char_string): Use %x to display the (unsigned)
8854 codepoint of an invalid character, to avoid displaying a bogus
8855 negative value.
8856
8857 * font.c (check_otf_features): Pass SDATA of SYMBOL_NAME to
8858 `error', not SYMBOL_NAME itself.
8859
8860 * coding.c (Fencode_sjis_char, Fencode_big5_char): Use %c for
8861 character arguments to `error'.
8862
8863 * charset.c (check_iso_charset_parameter): Fix incorrect argument
8864 to `error' in error message about FINAL_CHAR argument. Make sure
8865 FINAL_CHAR is a character, and use %c when it is passed as
8866 argument to `error'.
8867
8868 2011-04-23 Eli Zaretskii <eliz@gnu.org>
8869
8870 * s/ms-w32.h (localtime): Redirect to sys_localtime.
8871
8872 * w32.c: Include <time.h>.
8873 (sys_localtime): New function.
8874
8875 2011-04-23 Chong Yidong <cyd@stupidchicken.com>
8876
8877 * xdisp.c (init_xdisp): Initialize echo_area_window (Bug#6451).
8878
8879 * buffer.c (syms_of_buffer): Doc fix (Bug#6902).
8880
8881 2011-04-23 Samuel Thibault <sthibault@debian.org> (tiny change)
8882
8883 * sysdep.c (wait_for_termination): On GNU Hurd, kill returns -1 on
8884 zombies (Bug#8467).
8885
8886 2011-04-19 Eli Zaretskii <eliz@gnu.org>
8887
8888 * syntax.h (SETUP_SYNTAX_TABLE_FOR_OBJECT): Fix setting of
8889 gl_state.e_property when gl_state.object is Qt.
8890
8891 * insdel.c (make_gap_larger): Remove limitation of buffer size
8892 to <= INT_MAX.
8893
8894 2011-04-18 Chong Yidong <cyd@stupidchicken.com>
8895
8896 * xdisp.c (lookup_glyphless_char_display)
8897 (produce_glyphless_glyph): Handle cons cell entry in
8898 glyphless-char-display.
8899 (Vglyphless_char_display): Document it.
8900
8901 * term.c (produce_glyphless_glyph): Handle cons cell entry in
8902 glyphless-char-display.
8903
8904 2011-04-17 Chong Yidong <cyd@stupidchicken.com>
8905
8906 * xdisp.c (get_next_display_element): Remove unnecessary ifdefs.
8907
8908 * termhooks.h (FRAME_WINDOW_P): Remove duplicated definitions.
8909
8910 * dispextern.h (FACE_SUITABLE_FOR_ASCII_CHAR_P): Add missing
8911 definition for no-X builds.
8912
8913 2011-04-16 Paul Eggert <eggert@cs.ucla.edu>
8914
8915 Static checks with GCC 4.6.0 and non-default toolkits.
8916
8917 * s/sol2-6.h, s/unixware.h (PTY_TTY_NAME_SPRINTF): Protoize decl.
8918
8919 * process.c (keyboard_bit_set): Define only if SIGIO.
8920 (send_process_trap): Mark it with NO_RETURN if it doesn't return.
8921 (send_process): Repair possible setjmp clobbering.
8922
8923 * s/usg5-4-common.h (SETUP_SLAVE_PTY): Don't pass extra arg to 'fatal'.
8924
8925 * eval.c: Include <stdio.h>, for vsnprintf on non-GNU/Linux hosts.
8926
8927 * data.c (arith_error): Mark with NO_RETURN if it doesn't return.
8928
8929 * alloc.c (bytes_used_when_full, SPARE_MEMORY, BYTES_USED):
8930 Define only if needed.
8931
8932 * sysdep.c (_FILE_OFFSET_BITS): Make this hack even uglier
8933 by pacifying GCC about it. Maybe it's time to retire it?
8934 * xfaces.c (USG, __TIMEVAL__): Likewise.
8935
8936 * dispextern.h (struct redisplay_interface): Rename param
8937 to avoid shadowing.
8938 * termhooks.h (struct terminal): Likewise.
8939 * xterm.c (xembed_send_message): Likewise.
8940
8941 * insdel.c (make_gap_smaller): Define only if
8942 USE_MMAP_FOR_BUFFERS || REL_ALLOC || DOUG_LEA_MALLOC.
8943
8944 * keyboard.c (read_char): Make a var volatile so longjmp won't clobber
8945 it.
8946
8947 * emacs.c (MAX_HEAP_BSS_DIFF, my_edata): Move to where they're used,
8948 so that we aren't warned about unused symbols.
8949
8950 * xfns.c (Fx_file_dialog): Rename local to avoid shadowing.
8951
8952 * xdisp.c (x_produce_glyphs): Mark var as initialized (Bug#8512).
8953
8954 * xfns.c (x_real_positions): Mark locals as initialized.
8955
8956 * xmenu.c (xmenu_show): Don't use uninitialized vars.
8957
8958 * xterm.c: Fix problems found by static analysis with other toolkits.
8959 (toolkit_scroll_bar_interaction): Define and use only if USE_X_TOOLKIT.
8960 (x_dispatch_event): Declare static if USE_GTK, and
8961 define if USE_GTK || USE_X_TOOLKIT.
8962 (SET_SAVED_BUTTON_EVENT): Define only if USE_X_TOOLKIT || USE_GTK.
8963 * xterm.h (x_dispatch_event): Extern only if USE_X_TOOLKIT.
8964 * xterm.c, xterm.h (x_mouse_leave): Bring this function back, but only
8965 if defined HAVE_MENUS && !defined USE_X_TOOLKIT && !defined USE_GTK.
8966
8967 * xmenu.c (menu_help_callback): Pointer type fixes.
8968 Use const pointers when pointing at readonly data. Avoid pointer
8969 signedness clashes.
8970 (FALSE): Remove unused macro.
8971 (update_frame_menubar): Remove unused decl.
8972
8973 * xfns.c (Fx_hide_tip): Move locals to avoid shadowing.
8974
8975 * menu.c (push_submenu_start, push_submenu_end): Do not define unless
8976 USE_X_TOOLKIT || USE_GTK || HAVE_NS || defined HAVE_NTGUI.
8977 (single_menu_item): Rename local to avoid shadowing.
8978
8979 * keyboard.c (make_lispy_event): Remove unused local var.
8980
8981 * frame.c, frame.h (x_get_resource_string): Bring this back, but
8982 only if HAVE_X_WINDOWS && !USE_X_TOOLKIT.
8983
8984 * bitmaps: Change bitmaps from unsigned char back to the X11
8985 compatible char. Avoid the old compiler warnings about
8986 out-of-range initializers by using, for example, '\xab' rather
8987 than 0xab.
8988
8989 * xgselect.c (xgselect_initialize): Check vs interface
8990 even if ! (defined (USE_GTK) || defined (HAVE_GCONF)).
8991
8992 * xmenu.c (xmenu_show): Rename parm to avoid shadowing.
8993
8994 * xterm.c (x_create_toolkit_scroll_bar): Use const * for pointers
8995 to read-only memory.
8996
8997 * fns.c (vector): Remove; this old hack is no longer needed.
8998
8999 * xsmfns.c (create_client_leader_window): Rename shadowing arg.
9000 Remove unused var.
9001 (gdk_x11_set_sm_client_id) [!USE_GTK]: Don't define.
9002
9003 * xrdb.c (x_load_resources): Omit unused local.
9004
9005 * xfns.c (free_frame_menubar, atof): Remove duplicate decls.
9006 (x_window): Rename locals to avoid shadowing.
9007 (USG): Use the kludged USG macro, to pacify gcc.
9008
9009 * xterm.c (x_alloc_nearest_color_for_widget): Remove; unused.
9010 (x_term_init): Remove local to avoid shadowing.
9011
9012 * xfns.c, xterm.c (_XEditResCheckMessages): Protoize decl.
9013
9014 * xdisp.c, dispextern.h (set_vertical_scroll_bar): Now extern if
9015 USE_TOOLKIT_SCROLL_BARS && !USE_GTK, as xterm.c needs it then.
9016
9017 2011-04-16 Eli Zaretskii <eliz@gnu.org>
9018
9019 * gnutls.c (Fgnutls_boot): Don't pass Lisp_Object to `error'.
9020
9021 Fix regex.c, syntax.c and friends for buffers > 2GB.
9022 * syntax.h (struct gl_state_s): Declare character position members
9023 EMACS_INT.
9024
9025 * syntax.c (update_syntax_table): Declare 2nd argument EMACS_INT.
9026
9027 * textprop.c (verify_interval_modification, interval_of):
9028 Declare arguments EMACS_INT.
9029
9030 * intervals.c (adjust_intervals_for_insertion): Declare arguments
9031 EMACS_INT.
9032
9033 * intervals.h (CHECK_TOTAL_LENGTH): Cast to EMACS_INT, not `int'.
9034
9035 * indent.c (Fvertical_motion): Local variable it_start is now
9036 EMACS_INT.
9037
9038 * regex.c (re_match, re_match_2, re_match_2_internal)
9039 (bcmp_translate, regcomp, regexec, print_double_string)
9040 (group_in_compile_stack, re_search, re_search_2, regex_compile)
9041 (re_compile_pattern, re_exec): Declare arguments and local
9042 variables `size_t' and `ssize_t' and return values `regoff_t', as
9043 appropriate.
9044 (POP_FAILURE_REG_OR_COUNT) <pfreg>: Declare `long'.
9045 (CHECK_INFINITE_LOOP) <failure>: Declare `ssize_t'.
9046 <compile_stack_type>: `size' and `avail' are now `size_t'.
9047
9048 * regex.h <regoff_t>: Use ssize_t, not int.
9049 (re_search, re_search_2, re_match, re_match_2): Arguments that
9050 specify buffer/string position and length are now ssize_t and
9051 size_t. Return type is regoff_t.
9052
9053 2011-04-16 Ben Key <bkey76@gmail.com>
9054
9055 * nsfont.m: Fixed bugs in ns_get_family and
9056 ns_descriptor_to_entity that were caused by using free to
9057 deallocate memory blocks that were allocated by xmalloc (via
9058 xstrdup). This caused Emacs to crash when compiled with
9059 XMALLOC_OVERRUN_CHECK defined (when Emacs was configured with
9060 --enable-checking=xmallocoverrun). xfree is now used to
9061 deallocate these memory blocks.
9062
9063 2011-04-15 Paul Eggert <eggert@cs.ucla.edu>
9064
9065 * sysdep.c (emacs_read): Remove unnecessary check vs MAX_RW_COUNT.
9066
9067 emacs_write: Accept and return EMACS_INT for sizes.
9068 See http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00514.html
9069 et seq.
9070 * gnutls.c, gnutls.h (emacs_gnutls_read, emacs_gnutls_write):
9071 Accept and return EMACS_INT.
9072 (emacs_gnutls_write): Return the number of bytes written on
9073 partial writes.
9074 * sysdep.c, lisp.h (emacs_read, emacs_write): Likewise.
9075 (emacs_read, emacs_write): Remove check for negative size, as the
9076 Emacs source code has been audited now.
9077 * sysdep.c (MAX_RW_COUNT): New macro, to work around kernel bugs.
9078 (emacs_read, emacs_write): Use it.
9079 * process.c (send_process): Adjust to the new signatures of
9080 emacs_write and emacs_gnutls_write. Do not attempt to store
9081 a byte offset into an 'int'; it might overflow.
9082 See http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00483.html
9083
9084 * sound.c: Don't assume sizes fit in 'int'.
9085 (struct sound_device.period_size, alsa_period_size):
9086 Return EMACS_INT, not int.
9087 (struct sound_device.write, vox_write, alsa_write):
9088 Accept EMACS_INT, not int.
9089 (wav_play, au_play): Use EMACS_INT to store sizes and to
9090 record read return values.
9091
9092 2011-04-15 Ben Key <bkey76@gmail.com>
9093
9094 * keyboard.c (Qundefined): Don't declare static since it is used
9095 in nsfns.m.
9096 * xfaces.c (Qbold, Qexpanded, Qitalic, Qcondensed): Don't declare
9097 static since they are used in nsfont.m.
9098
9099 2011-04-15 Stefan Monnier <monnier@iro.umontreal.ca>
9100
9101 * process.c (Qprocessp): Don't declare static.
9102 * lisp.h (Qprocessp): Declare again.
9103
9104 2011-04-15 Juanma Barranquero <lekktu@gmail.com>
9105
9106 * font.c (Qopentype): Don't make static (used from w32uniscribe.c).
9107
9108 2011-04-14 Paul Eggert <eggert@cs.ucla.edu>
9109
9110 Improve C-level modularity by making more things 'static'.
9111
9112 Don't publish debugger-only interfaces to other modules.
9113 * lisp.h (safe_debug_print, debug_output_compilation_hack):
9114 (verify_bytepos, count_markers): Move decls to the only modules
9115 that need them.
9116 * region-cache.h (pp_cache): Likewise.
9117 * window.h (check_all_windows): Likewise.
9118 * marker.c, print.c, region-cache.c, window.c: Decls moved here.
9119
9120 * sysdep.c (croak): Now static, if
9121 defined TIOCNOTTY || defined USG5 || defined CYGWIN.
9122 * syssignal.h (croak): Declare only if not static.
9123
9124 * alloc.c (refill_memory_reserve): Now static if
9125 !defined REL_ALLOC || defined SYSTEM_MALLOC.
9126 * lisp.h (refill_memory_reserve): Declare only if not static.
9127
9128 * xsettings.c, xsettings.h (xsettings_get_system_normal_font):
9129 Define only if USE_LUCID.
9130
9131 * xrdb.c (x_customization_string, x_rm_string): Now static.
9132
9133 * xmenu.c (x_menu_wait_for_event): Export only if USE_MOTIF.
9134 * xterm.h (x_menu_wait_for_event): Declare only if USE_MOTIF.
9135
9136 * xdisp.c (draw_row_with_mouse_face): Now static.
9137 * dispextern.h (draw_row_with_mouse_fave): Remove decl.
9138
9139 * window.h (check_all_windows): Mark externally visible.
9140
9141 * window.c (window_deletion_count): Now static.
9142
9143 * undo.c: Make symbols static if they're not exported.
9144 (last_undo_buffer, last_boundary_position, pending_boundary):
9145 Now static.
9146
9147 * textprop.c (interval_insert_behind_hooks): Now static.
9148 (interval_insert_in_front_hooks): Likewise.
9149
9150 * term.c: Make symbols static if they're not exported.
9151 (tty_turn_off_highlight, get_tty_terminal, max_frame_cols):
9152 (max_frame_lines, tty_set_terminal_modes):
9153 (tty_reset_terminal_modes, tty_turn_off_highlight):
9154 (get_tty_terminal): Now static.
9155 (term_mouse_moveto): Do not define if HAVE_WINDOW_SYSTEM.
9156 * termhooks.h (term_mouse_moveto): Do not declare if
9157 HAVE_WINDOW_SYSTEM.
9158 * dispextern.h (tty_set_terminal_modes, tty_reset_terminal_modes):
9159 (tty_turn_off_highlight, get_tty_terminal): Remove decls.
9160
9161 * sysdep.c: Make symbols static if they're not exported.
9162 (emacs_get_tty, emacs_set_tty, old_fcntl_flags, old_fcntl_owner):
9163 Now static.
9164 (sigprocmask_set, full_mask): Remove; unused.
9165 (wait_debugging): Mark as visible.
9166 * syssignal.h (SIGFULLMASK, full_mask): Remove decls.
9167 * systty.h (emacs_get_tty, emacs_set_tty): Remove decls.
9168
9169 * syntax.c (syntax_temp): Define only if !__GNUC__.
9170
9171 * sound.c (current_sound_device, current_sound): Now static.
9172
9173 * search.c (searchbufs, searchbuf_head): Now static.
9174
9175 * scroll.c (scroll_cost): Remove; unused.
9176 * dispextern.h (scroll_cost): Remove decl.
9177
9178 * region-cache.h (pp_cache): Mark as externally visible.
9179
9180 * process.c: Make symbols static if they're not exported.
9181 (process_tick, update_tick, create_process, chan_process):
9182 (Vprocess_alist, proc_buffered_char, datagram_access):
9183 (fd_callback_data, send_process_frame, process_sent_to): Now static.
9184 (deactivate_process): Mark defn as static, as well as decl.
9185 * lisp.h (create_process): Remove decl.
9186 * process.h (chan_process, Vprocess_alist): Remove decls.
9187
9188 * print.c: Make symbols static if they're not exported.
9189 (print_depth, new_backquote_output, being_printed, print_buffer):
9190 (print_buffer_size, print_buffer_pos, print_buffer_pos_byte):
9191 (print_interval, print_number_index, initial_stderr_stream):
9192 Now static.
9193 * lisp.h (Fprinc): Remove decl.
9194 (debug_output_compilation_hack): Mark as externally visible.
9195
9196 * sysdep.c (croak): Move decl from here to syssignal.h.
9197 * syssignal.h (croak): Put it here, so the API can be checked when
9198 'croak' is called from dissociate_if_controlling_tty.
9199
9200 * minibuf.c: Make symbols static if they're not exported.
9201 (minibuf_save_list, choose_minibuf_frame): Now static.
9202 * lisp.h (choose_minibuf_frame): Remove decl.
9203
9204 * lisp.h (verify_bytepos, count_markers): Mark as externally visible.
9205
9206 * lread.c: Make symbols static if they're not exported.
9207 (read_objects, initial_obarray, oblookup_last_bucket_number):
9208 Now static.
9209 (make_symbol): Remove; unused.
9210 * lisp.h (initial_obarray, make_symbol): Remove decls.
9211
9212 * keyboard.c: Make symbols static if they're not exported.
9213 (single_kboard, recent_keys_index, total_keys, recent_keys):
9214 (this_command_key_count_reset, raw_keybuf, raw_keybuf_count):
9215 (this_single_command_key_start, echoing, last_auto_save):
9216 (read_key_sequence_cmd, dribble, recursive_edit_unwind):
9217 (command_loop, echo_now, keyboard_init_hook, help_char_p):
9218 (quit_throw_to_read_char, command_loop_2, top_level_1, poll_timer):
9219 (Vlispy_mouse_stem, double_click_count):
9220 Now static.
9221 (force_auto_save_soon): Define only if SIGDANGER.
9222 (ignore_mouse_drag_p): Now static if
9223 !defined HAVE_WINDOW_SYSTEM || defined USE_GTK || defined HAVE_NS.
9224 (print_help): Remove; unused.
9225 (stop_character, last_timer_event): Mark as externally visible.
9226 * keyboard.h (ignore_mouse_drag_p): Declare only if
9227 defined HAVE_WINDOW_SYSTEM && !defined USE_GTK && !defined HAVE_NS.
9228 (echo_now, help_char_p, quit_throw_to_read_char): Remove decls.
9229 * lisp.h (echoing): Remove decl.
9230 (force_auto_save_soon): Declare only if SIGDANGER.
9231 * xdisp.c (redisplay_window): Simplify code, to make it more
9232 obvious that ignore_mouse_drag_p is not accessed if !defined
9233 USE_GTK && !defined HAVE_NS.
9234
9235 * intervals.c: Make symbols static if they're not exported.
9236 (merge_properties_sticky, merge_interval_right, delete_interval):
9237 Now static.
9238 * intervals.h (merge_interval_right, delete_interval): Remove decls.
9239
9240 * insdel.c: Make symbols static if they're not exported.
9241 However, leave prepare_to_modify_buffer alone. It's never
9242 called from outside this function, but that appears to be a bug.
9243 (combine_after_change_list, combine_after_change_buffer):
9244 (adjust_after_replace, signal_before_change): Now static.
9245 (adjust_after_replace_noundo): Remove; unused.
9246 * lisp.h (adjust_after_replace, adjust_after_replace_noundo):
9247 (signal_before_change): Remove decls.
9248
9249 * indent.c (val_compute_motion, val_vmotion): Now static.
9250
9251 * image.c: Make symbols static if they're not exported.
9252 * dispextern.h (x_create_bitmap_from_xpm_data): Do not declare
9253 if USE_GTK.
9254 * image.c (x_create_bitmap_from_xpm_data): Do not define if USE_GTK.
9255 (xpm_color_cache, ct_table, ct_colors_allocated): Now static.
9256
9257 * fringe.c (standard_bitmaps): Now static.
9258 (max_used_fringe_bitmap): Now static, unless HAVE_NS.
9259
9260 * frame.c: Make symbols static if they're not exported.
9261 (x_report_frame_params, make_terminal_frame): Now static.
9262 (get_frame_param): Now static, unless HAVE_NS.
9263 (x_fullscreen_adjust): Define if WINDOWSNT, not if HAVE_WINDOW_SYSTEM.
9264 (x_get_resource_string): Remove; not used.
9265 * frame.h (make_terminal_frame, x_report_frame_params):
9266 (x_get_resource_string); Remove decls.
9267 (x_fullscreen_adjust): Declare only if WINDOWSNT.
9268 * lisp.h (get_frame_param): Declare only if HAVE_NS.
9269
9270 * font.c, fontset.c: Make symbols static if they're not exported.
9271 * dispextern.h (FACE_SUITABLE_FOR_ASCII_CHAR_P): New macro.
9272 (FACE_SUITABLE_FOR_CHAR_P): Use it.
9273 * font.c (font_close_object): Now static.
9274 * font.h (font_close_object): Remove.
9275 * fontset.c (FONTSET_OBJLIST): Remove.
9276 (free_realized_fontset) #if-0 the body, which does nothing.
9277 (face_suitable_for_char_p): #if-0, as it's never called.
9278 * fontset.h (face_suitable_for_char_p): Remove decl.
9279 * xfaces.c (face_at_string_position):
9280 Use FACE_SUITABLE_FOR_ASCII_CHAR_P, not FACE_SUITABLE_FOR_CHAR_P,
9281 since 0 is always ASCII.
9282
9283 * fns.c (weak_hash_tables): Now static.
9284
9285 * fileio.c: Make symbols static if they're not exported.
9286 (auto_saving, auto_save_mode_bits, auto_save_error_occurred):
9287 (Vwrite_region_annotation_buffers): Now static.
9288
9289 * eval.c: Make symbols static if they're not exported.
9290 (backtrace_list, lisp_eval_depth, when_entered_debugger): Now static.
9291 * lisp.h (backtrace_list): Remove decl.
9292
9293 * emacs.c: Make symbols static if they're not exported.
9294 (malloc_state_ptr, malloc_using_checking, syms_of_emacs):
9295 (fatal_error_code, fatal_error_signal_hook, standard_args):
9296 Now static.
9297 (fatal_error_signal): Now static, unless FLOAT_CATCH_SIGKILL.
9298 (DEFINE_DUMMY_FUNCTION): Mark function as externally visible.
9299 (__CTOR_LIST__, __DTOR_LIST__): Now externally visible.
9300 * lisp.h (fatal_error_signal_hook): Remove decl.
9301 (fatal_error_signal): Declare only if FLOAT_CATCH_SIGKILL.
9302
9303 * editfns.c: Move a (normally-unused) function to its only use.
9304 * editfns.c, lisp.h (get_operating_system_release): Remove.
9305 * process.c (init_process) [DARWIN_OS]: Do it inline, as it is not
9306 worth the hassle of breaking this out.
9307
9308 * xterm.c: Make symbols static if they're not exported.
9309 (x_raise_frame, x_lower_frame, x_wm_set_window_state):
9310 (x_wm_set_icon_pixmap, x_initialize, XTread_socket_fake_io_error):
9311 (x_destroy_window, x_delete_display):
9312 Now static.
9313 (x_dispatch_event): Now static if ! (USE_MOTIF || USE_X_TOOLKIT).
9314 (x_mouse_leave): Remove; unused.
9315 * xterm.h (x_display_info_for_name, x_raise_frame, x_lower_frame):
9316 (x_destroy_window, x_wm_set_window_state, x_wm_set_icon_pixmap):
9317 (x_delete_display, x_initialize, x_set_border_pixel, x_screen_planes):
9318 Remove decls.
9319 (x_mouse_leave): Declare only if WINDOWSNT.
9320 (x_dispatch_event): Declare only if USE_MOTIF or USE_X_TOOLKIT.
9321 (xic_create_fontsetname): Declare only if HAVE_X_WINDOWS &&
9322 USE_X_TOOLKIT.
9323
9324 * ftxfont.c: Make symbols static if they're not exported.
9325 (ftxfont_driver): Export only if !defined HAVE_XFT && def8ined
9326 HAVE_FREETYPE.
9327 * font.h (ftxfont_driver): Likewise.
9328
9329 * xfns.c: Make symbols static if they're not exported.
9330 (x_last_font_name, x_display_info_for_name):
9331 (x_set_foreground_color, x_set_background_color, x_set_mouse_color):
9332 (x_set_cursor_color, x_set_border_pixel, x_set_border_color):
9333 (x_set_cursor_type, x_set_icon_type, x_set_icon_name):
9334 (x_set_scroll_bar_foreground, x_set_scroll_bar_background):
9335 (x_explicitly_set_name, x_set_title, xic_defaut_fontset, tip_timer):
9336 (last_show_tip_args): Now static.
9337 (xic_defaut_fontset, xic_create_fontsetname): Define only if
9338 defined HAVE_X_WINDOWS && defined USE_X_TOOLKIT
9339 (x_screen_planes): Remove; unused.
9340 * dispextern.h (x_screen_planes): Remove decl.
9341
9342 * dispnew.c: Make symbols static if they're not exported.
9343 * dispextern.h (redraw_garbaged_frames, scrolling):
9344 (increment_row_positions): Remove.
9345 * dispnew.c (new_glyph_matrix, increment_row_positions, scrolling):
9346 (delayed_size_change, glyph_matrix_count, glyph_pool_count):
9347 Now static.
9348 (redraw_garbaged_frames): Remove; unused.
9349
9350 * xfaces.c: Make symbols static if they're not exported.
9351 * dispextern.h (ascii_face_of_lisp_face, free_realized_face):
9352 Remove decls.
9353 * xterm.h (defined_color): Remove decls.
9354 (x_free_dpy_colors): Declare only if USE_X_TOOLKIT.
9355 * xfaces.c (tty_suppress_bold_inverse_default_colors_p):
9356 (menu_face_changed_default, defined_color, free_realized_face):
9357 (x_free_dpy_colors): Define only if USE_X_TOOLKIT.
9358 (ascii_face_of_lisp_face): Remove; unused.
9359
9360 * xdisp.c: Make symbols static if they're not exported.
9361 * dispextern.h (scratch_glyph_row, window_box_edges):
9362 (glyph_to_pixel_coords, set_cursor_from_row):
9363 (get_next_display_element, set_iterator_to_next):
9364 (highlight_trailing_whitespace, frame_to_window_pixel_xy):
9365 (show_mouse_face): Remove decls
9366 * frame.h (message_buf_print): Likewise.
9367 * lisp.h (pop_message, set_message, check_point_in_composition):
9368 Likewise.
9369 * xterm.h (set_vertical_scroll_bar): Likewise.
9370 * xdisp.c (list_of_error, Vmessage_stack, line_number_displayed):
9371 (message_buf_print, scratch_glyph_row, displayed_buffer):
9372 (set_iterator_to_next, pop_message, set_message, set_cursor_from_row):
9373 (get_next_display_element, show_mouse_face, window_box_edges):
9374 (frame_to_window_pixel_xy, check_point_in_composition):
9375 (set_vertical_scroll_bar, highlight_trailing_whitespace): Now static.
9376 (glyph_to_pixel_coords): Remove; unused.
9377
9378 * dired.c (file_name_completion): Now static.
9379
9380 * dbusbind.c (xd_in_read_queued_messages): Now static.
9381
9382 * lisp.h (circular_list_error, FOREACH): Remove; unused.
9383 * data.c (circular_list_error): Remove.
9384
9385 * commands.h (last_point_position, last_point_position_buffer):
9386 (last_point_position_window): Remove decls.
9387 * keyboard.c: Make these variables static.
9388
9389 * coding.h (coding, code_convert_region, encode_coding_gap):
9390 Remove decls.
9391 * coding.c (Vsjis_coding_system, Vbig5_coding_system):
9392 (iso_code_class, detect_coding, code_convert_region): Now static.
9393 (encode_coding_gap): Remove; unused.
9394
9395 * chartab.c (chartab_chars, chartab_bits): Now static.
9396
9397 * charset.h (charset_iso_8859_1): Remove decl.
9398 * charset.c (charset_iso_8859_1, charset_emacs, map_charset_for_dump):
9399 Now static.
9400
9401 * ccl.h (check_ccl_update, Vccl_program_table): Remove decls.
9402 * ccl.c (Vccl_program_table): Now static.
9403 (check_ccl_update): Remove; unused.
9404
9405 * category.c (SET_CATEGORY_SET, set_category_set): Move here.
9406 * category.h: ... from here.
9407 * category.c (check_category_table, set_category_set): Now static.
9408
9409 * casetab.c (Vascii_upcase_table, Vascii_eqv_table): Now static.
9410 * lisp.h: Remove these decls.
9411
9412 * buffer.c (buffer_count): Remove unused var.
9413
9414 * bidi.c (bidi_dump_cached_states): Mark as externally visible,
9415 so that it's not optimized away.
9416 (bidi_ignore_explicit_marks_for_paragraph_level): Likewise.
9417 * dispextern.h (bidi_dump_cached_states): Remove, since it's
9418 exported only to the debugger.
9419
9420 * atimer.c (alarm_signal_handler, run_all_atimers): Now static.
9421 * atimer.h (run_all_atimers): Remove; not exported.
9422
9423 font.c: Make copy_font_spec and merge_font_spec ordinary C functions.
9424 * font.c (copy_font_spec): Rename from Fcopy_font_spec, since it
9425 was inaccessible from Lisp.
9426 (merge_font_spec): Likewise, renaming from Fmerge_font_spec.
9427 * font.c, font.h, fontset.c, xfaces.c, xfont.c: Change all uses.
9428
9429 alloc.c: Import and export fewer symbols, and remove unused items.
9430 * lisp.h (suppress_checking, die): Declare only if ENABLE_CHECKING
9431 is defined.
9432 (suppress_checking): Add EXTERNALLY_VISIBLE attribute, so that
9433 it's not optimized away by whole-program optimization.
9434 (message_enable_multibyte, free_misc): Remove.
9435 (catchlist, handlerlist, mark_backtrace):
9436 Declare only if BYTE_MARK_STACK.
9437 (mark_byte_stack): Likewise, fixing a ifdef-vs-if typo.
9438 * alloc.c (pure): Export only if VIRT_ADDR_VARIES is defined.
9439 (message_enable_multibyte): Remove decl.
9440 (free_misc, interval_free_list, float_block, float_block_index):
9441 (n_float_blocks, float_free_list, cons_block, cons_block_index):
9442 (cons_free_list, last_marked_index):
9443 Now static.
9444 (suppress_checking, die): Define only if ENABLE_CHECKING is defined.
9445 * eval.c (catchlist, handlerlist): Export only if BYTE_MARK_STACK.
9446 (mark_backtrace): Define only if BYTE_MARK_STACK.
9447 * xdisp.c (message_enable_multibyte): Now static.
9448
9449 Declare Lisp_Object Q* variables to be 'static' if not exported.
9450 This makes it easier for human readers (and static analyzers)
9451 to see whether these variables are used from other modules.
9452 * alloc.c, buffer.c, bytecode.c, callint.c, casetab.c, category.c:
9453 * ccl.c, character.c, charset.c, cmds.c, coding.c, composite.c:
9454 * data.c, dbusbind.c, dired.c, editfns.c, eval.c, fileio.c, fns.c:
9455 * font.c, frame.c, fringe.c, ftfont.c, image.c, keyboard.c, keymap.c:
9456 * lread.c, macros.c, minibuf.c, print.c, process.c, search.c:
9457 * sound.c, syntax.c, textprop.c, window.c, xdisp.c, xfaces.c, xfns.c:
9458 * xmenu.c, xselect.c:
9459 Declare Q* vars static if they are not used in other modules.
9460 * ccl.h, character.h, charset.h, coding.h, composite.h, font.h:
9461 * frame.h, intervals.h, keyboard.h, lisp.h, process.h, syntax.h:
9462 Remove decls of unexported vars.
9463 * keyboard.h (EVENT_HEAD_UNMODIFIED): Remove now-unused macro.
9464
9465 * lisp.h (DEFINE_FUNC): Make sname 'static'.
9466
9467 Make Emacs functions such as Fatom 'static' by default.
9468 This makes it easier for human readers (and static analyzers)
9469 to see whether these functions can be called from other modules.
9470 DEFUN now defines a static function. To make the function external
9471 so that it can be used in other C modules, use the new macro DEFUE.
9472 * lisp.h (Funibyte_char_to_multibyte, Fsyntax_table_p):
9473 (Finit_image_library):
9474 (Feval_region, Fbacktrace, Ffetch_bytecode, Fswitch_to_buffer):
9475 (Ffile_executable_p, Fmake_symbolic_link, Fcommand_execute):
9476 (Fget_process, Fdocumentation_property, Fbyte_code, Ffile_attributes):
9477 Remove decls, since these functions are now static.
9478 (Funintern, Fget_internal_run_time): New decls, since these functions
9479 were already external.
9480
9481 * alloc.c, buffer.c, callint.c, callproc.c, casefiddle.c, casetab.c:
9482 * ccl.c, character.c, chartab.c, cmds.c, coding.c, data.c, dispnew.c:
9483 * doc.c, editfns.c, emacs.c, eval.c, fileio.c, filelock.c, floatfns.c:
9484 * fns.c, font.c, fontset.c, frame.c, image.c, indent.c:
9485 * keyboard.c, keymap.c, lread.c:
9486 * macros.c, marker.c, menu.c, minibuf.c, print.c, process.c, search.c:
9487 * syntax.c, term.c, terminal.c, textprop.c, undo.c:
9488 * window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xsettings.c:
9489 Mark functions with DEFUE instead of DEFUN,
9490 if they are used in other modules.
9491 * buffer.c (Fset_buffer_major_mode, Fdelete_overlay): New forward
9492 decls for now-static functions.
9493 * buffer.h (Fdelete_overlay): Remove decl.
9494 * callproc.c (Fgetenv_internal): Mark as internal.
9495 * composite.c (Fremove_list_of_text_properties): Remove decl.
9496 (Fcomposition_get_gstring): New forward static decl.
9497 * composite.h (Fcomposite_get_gstring): Remove decl.
9498 * dired.c (Ffile_attributes): New forward static decl.
9499 * doc.c (Fdocumntation_property): New forward static decl.
9500 * eval.c (Ffetch_bytecode): New forward static decl.
9501 (Funintern): Remove extern decl; now in .h file where it belongs.
9502 * fileio.c (Fmake_symbolic_link): New forward static decl.
9503 * image.c (Finit_image_library): New forward static decl.
9504 * insdel.c (Fcombine_after_change_execute): Make forward decl static.
9505 * intervals.h (Fprevious_property_change):
9506 (Fremove_list_of_text_properties): Remove decls.
9507 * keyboard.c (Fthis_command_keys): Remove decl.
9508 (Fcommand_execute): New forward static decl.
9509 * keymap.c (Flookup_key): New forward static decl.
9510 (Fcopy_keymap): Now static.
9511 * keymap.h (Flookup_key): Remove decl.
9512 * process.c (Fget_process): New forward static decl.
9513 (Fprocess_datagram_address): Mark as internal.
9514 * syntax.c (Fsyntax_table_p): New forward static decl.
9515 (skip_chars): Remove duplicate decl.
9516 * textprop.c (Fprevious_property_change): New forward static decl.
9517 * window.c (Fset_window_fringes, Fset_window_scroll_bars):
9518 Now internal.
9519 (Fset_window_margins, Fset_window_vscroll): New forward static decls.
9520 * window.h (Fset_window_vscroll, Fset_window_margins): Remove decls.
9521
9522 * editfns.c (Fformat): Remove unreachable code.
9523
9524 2011-04-14 Andreas Schwab <schwab@linux-m68k.org>
9525
9526 * fileio.c (Finsert_file_contents): Fix typo in 2005-05-13
9527 change. (Bug#8496)
9528
9529 2011-04-13 Eli Zaretskii <eliz@gnu.org>
9530
9531 * xdisp.c (handle_invisible_prop): Don't call bidi_paragraph_init
9532 when at ZV. (Bug#8487)
9533
9534 2011-04-12 Andreas Schwab <schwab@linux-m68k.org>
9535
9536 * charset.c (Fclear_charset_maps): Use xfree instead of free.
9537 (Bug#8437)
9538 * keyboard.c (parse_tool_bar_item): Likewise.
9539 * sound.c (sound_cleanup, alsa_close): Likewise.
9540 * termcap.c (tgetent): Likewise.
9541 * xfns.c (x_default_font_parameter): Likewise.
9542 * xsettings.c (read_and_apply_settings): Likewise.
9543
9544 * alloc.c (overrun_check_malloc, overrun_check_realloc)
9545 (overrun_check_free): Protoize.
9546
9547 2011-04-12 Paul Eggert <eggert@cs.ucla.edu>
9548
9549 * sysdep.c (emacs_read, emacs_write): Check for negative sizes
9550 since callers should never pass a negative size.
9551 Change the signature to match that of plain 'read' and 'write'; see
9552 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00397.html>.
9553 * lisp.h: Update prototypes of emacs_write and emacs_read.
9554
9555 2011-04-11 Eli Zaretskii <eliz@gnu.org>
9556
9557 * xdisp.c (redisplay_window): Don't try to determine the character
9558 position of the scroll margin if the window start point w->startp
9559 is outside the buffer's accessible region. (Bug#8468)
9560
9561 2011-04-10 Eli Zaretskii <eliz@gnu.org>
9562
9563 Fix write-region and its subroutines for buffers > 2GB.
9564 * fileio.c (a_write, e_write): Modify declaration of arguments and
9565 local variables to support buffers larger than 2GB.
9566 (Fcopy_file): Use EMACS_INT for return value of emacs_read.
9567
9568 * sysdep.c (emacs_write, emacs_read): Use ssize_t for last
9569 argument, local variables, and return value.
9570
9571 * lisp.h: Update prototypes of emacs_write and emacs_read.
9572
9573 * sound.c (vox_write): Use ssize_t for return value of emacs_write.
9574
9575 2011-04-10 Paul Eggert <eggert@cs.ucla.edu>
9576
9577 * xdisp.c (vmessage): Use memchr, not strnlen, which some hosts lack.
9578
9579 Fix more problems found by GCC 4.6.0's static checks.
9580
9581 * xdisp.c (vmessage): Use a better test for character truncation.
9582
9583 * charset.c (load_charset_map): <, not <=, for optimization,
9584 and to avoid potential problems with integer overflow.
9585 * chartab.c (sub_char_table_set_range, char_table_set_range): Likewise.
9586 * casetab.c (set_identity, shuffle): Likewise.
9587 * editfns.c (Fformat): Likewise.
9588 * syntax.c (skip_chars): Likewise.
9589
9590 * xmenu.c (set_frame_menubar): Allocate smaller local vectors.
9591 This also lets GCC 4.6.0 generate slightly better loop code.
9592
9593 * callint.c (Fcall_interactively): <, not <=, for optimization.
9594 (Fcall_interactively): Count the number of arguments produced,
9595 not the number of arguments given. This is simpler and lets GCC
9596 4.6.0 generate slightly better code.
9597
9598 * ftfont.c: Distingish more carefully between FcChar8 and char.
9599 The previous code passed unsigned char * to a functions like
9600 strlen and xstrcasecmp that expect char *, which does not
9601 conform to the C standard.
9602 (get_adstyle_property, ftfont_pattern_entity): Use FcChar8 for
9603 arguments to FcPatternGetString, and explicitly cast FcChar8 * to
9604 char * when the C standard requires it.
9605
9606 * keyboard.c (read_char): Remove unused var.
9607
9608 * eval.c: Port to Windows vsnprintf (Bug#8435).
9609 Include <limits.h>.
9610 (SIZE_MAX): Define if the headers do not.
9611 (verror): Do not give up if vsnprintf returns a negative count.
9612 Instead, grow the buffer. This ports to Windows vsnprintf, which
9613 does not conform to C99. Problem reported by Eli Zaretskii.
9614 Also, simplify the allocation scheme, by avoiding the need for
9615 calling realloc, and removing the ALLOCATED variable.
9616
9617 * eval.c (verror): Initial buffer size is 4000 (not 200) bytes.
9618
9619 Remove invocations of doprnt, as Emacs now uses vsnprintf.
9620 But keep the doprint source code for now, as we might revamp it
9621 and use it again (Bug#8435).
9622 * lisp.h (doprnt): Remove.
9623 * Makefile.in (base_obj): Remove doprnt.o.
9624 * deps.mk (doprnt.o): Remove.
9625
9626 error: Print 32- and 64-bit integers portably (Bug#8435).
9627 Without this change, on typical 64-bit hosts error ("...%d...", N)
9628 was used to print both 32- and 64-bit integers N, which relied on
9629 undefined behavior.
9630 * lisp.h, m/amdx86-64.h, m/ia64.h, m/ibms390x.h (pEd): New macro.
9631 * lisp.h (error, verror): Mark as printf-like functions.
9632 * eval.c (verror): Use vsnprintf, not doprnt, to do the real work.
9633 Report overflow in size calculations when allocating printf buffer.
9634 Do not truncate output string at its first null byte.
9635 * xdisp.c (vmessage): Use vsnprintf, not doprnt, to do the real work.
9636 Truncate the output at a character boundary, since vsnprintf does not
9637 do that.
9638 * charset.c (check_iso_charset_parameter): Convert internal
9639 character to string before calling 'error', since %c now has the
9640 printf meaning.
9641 * coding.c (Fdecode_sjis_char, Fdecode_big5_char): Avoid int
9642 overflow when computing char to be passed to 'error'. Do not
9643 pass Lisp_Object to 'error'; pass the integer instead.
9644 * nsfns.m (Fns_do_applescript): Use int, not long, since it's
9645 formatted with plain %d.
9646
9647 * eval.c (internal_lisp_condition_case): Don't pass spurious arg.
9648
9649 * keyboard.c (access_keymap_keyremap): Print func name, not garbage.
9650
9651 * coding.c (Fdecode_sjis_char): Don't assume CODE fits in int.
9652
9653 * xterm.c (x_catch_errors): Remove duplicate declaration.
9654
9655 * term.c (maybe_fatal): Mark its 3rd arg as a printf format, too.
9656
9657 * xdisp.c, lisp.h (message_nolog): Remove; unused.
9658
9659 2011-04-10 Jim Meyering <meyering@redhat.com>
9660
9661 use ssize_t and size_t for read- and write-like emacs_gnutls_* functions
9662 * gnutls.c (emacs_gnutls_read): Adjust signature to be more read-like:
9663 return ssize_t not "int", and use size_t as the buffer length.
9664 (emacs_gnutls_write): Likewise, and make the buffer pointer "const".
9665 * gnutls.h: Update declarations.
9666 * process.c (read_process_output): Use ssize_t, to match.
9667 (send_process): Likewise.
9668
9669 2011-04-09 Chong Yidong <cyd@stupidchicken.com>
9670
9671 * image.c (Fimagemagick_types): Doc fix, and comment cleanup.
9672
9673 2011-04-09 Chong Yidong <cyd@stupidchicken.com>
9674
9675 * ftfont.c (get_adstyle_property, ftfont_pattern_entity):
9676 Use unsigned char, to match FcChar8 type definition.
9677
9678 * xterm.c (handle_one_xevent):
9679 * xmenu.c (create_and_show_popup_menu):
9680 * xselect.c (x_decline_selection_request)
9681 (x_reply_selection_request): Avoid type-punned deref of X events.
9682
9683 2011-04-09 Eli Zaretskii <eliz@gnu.org>
9684
9685 Fix some uses of `int' instead of EMACS_INT.
9686 * search.c (string_match_1, fast_string_match)
9687 (fast_c_string_match_ignore_case, fast_string_match_ignore_case)
9688 (scan_buffer, find_next_newline_no_quit)
9689 (find_before_next_newline, search_command, Freplace_match)
9690 (Fmatch_data): Make some `int' variables be EMACS_INT.
9691
9692 * xdisp.c (display_count_lines): 3rd argument and return value now
9693 EMACS_INT. All callers changed.
9694 (pint2hrstr): Last argument is now EMACS_INT.
9695
9696 * coding.c (detect_coding_utf_8, detect_coding_emacs_mule)
9697 (detect_coding_iso_2022, detect_coding_sjis, detect_coding_big5)
9698 (detect_coding_ccl, detect_coding_charset, decode_coding_utf_8)
9699 (decode_coding_utf_16, decode_coding_emacs_mule)
9700 (decode_coding_iso_2022, decode_coding_sjis, decode_coding_big5)
9701 (decode_coding_ccl, decode_coding_charset)
9702 <consumed_chars, consumed_chars_base>: Declare EMACS_INT.
9703 (decode_coding_iso_2022, decode_coding_emacs_mule)
9704 (decode_coding_sjis, decode_coding_big5, decode_coding_charset)
9705 <char_offset, last_offset>: Declare EMACS_INT.
9706 (encode_coding_utf_8, encode_coding_utf_16)
9707 (encode_coding_emacs_mule, encode_invocation_designation)
9708 (encode_designation_at_bol, encode_coding_iso_2022)
9709 (encode_coding_sjis, encode_coding_big5, encode_coding_ccl)
9710 (encode_coding_raw_text, encode_coding_charset) <produced_chars>:
9711 Declare EMACS_INT.
9712 (ASSURE_DESTINATION): Declare more_bytes EMACS_INT.
9713 (encode_invocation_designation): Last argument P_NCHARS is now
9714 EMACS_INT.
9715 (decode_eol): Declare pos_byte, pos, and pos_end EMACS_INT.
9716 (produce_chars): from_nchars and to_nchars are now EMACS_INT.
9717
9718 * coding.h (struct coding_system) <head_ascii>: Declare EMACS_INT.
9719 All users changed.
9720
9721 * ccl.c (Fccl_execute_on_string): Declare some variables
9722 EMACS_INT.
9723
9724 2011-04-08 Samuel Thibault <sthibault@debian.org> (tiny change)
9725
9726 * term.c (init_tty): Fix incorrect ifdef placement (Bug#8450).
9727
9728 2011-03-19 Christoph Scholtes <cschol2112@googlemail.com>
9729
9730 * process.c (Fformat_network_address): Doc fix.
9731
9732 2011-04-08 T.V. Raman <tv.raman.tv@gmail.com> (tiny change)
9733
9734 * xml.c (parse_region): Avoid creating spurious whitespace nodes.
9735
9736 2011-04-08 Chong Yidong <cyd@stupidchicken.com>
9737
9738 * keyboard.c (read_char): Call Lisp function help-form-show,
9739 instead of using internal_with_output_to_temp_buffer.
9740 (Qhelp_form_show): New var.
9741 (syms_of_keyboard): Use DEFSYM macro.
9742
9743 * print.c (internal_with_output_to_temp_buffer): Function deleted.
9744
9745 * lisp.h (internal_with_output_to_temp_buffer): Remove prototype.
9746
9747 2011-04-06 Chong Yidong <cyd@stupidchicken.com>
9748
9749 * process.c (Flist_processes): Remove to Lisp.
9750 (list_processes_1): Delete.
9751
9752 2011-04-06 Eli Zaretskii <eliz@gnu.org>
9753
9754 * msdos.c (careadlinkat, careadlinkatcwd): MS-DOS replacements.
9755
9756 * w32.c (careadlinkat, careadlinkatcwd): New always-fail stubs.
9757
9758 2011-04-06 Paul Eggert <eggert@cs.ucla.edu>
9759
9760 Fix more problems found by GCC 4.6.0's static checks.
9761
9762 * xmenu.c (Fx_popup_dialog): Don't assume string is free of formats.
9763
9764 * menu.c (Fx_popup_menu): Don't assume error_name lacks printf formats.
9765
9766 * lisp.h (message, message_nolog, fatal): Mark as printf-like.
9767
9768 * xdisp.c (vmessage): Mark as a printf-like function.
9769
9770 * term.c (vfatal, maybe_fatal): Mark as printf-like functions.
9771
9772 * sound.c (sound_warning): Don't crash if arg contains a printf format.
9773
9774 * image.c (tiff_error_handler, tiff_warning_handler): Mark as
9775 printf-like functions.
9776 (tiff_load): Add casts to remove these marks before passing them
9777 to system-supplied API.
9778
9779 * eval.c (Fsignal): Remove excess argument to 'fatal'.
9780
9781 * coding.c (EMIT_ONE_BYTE, EMIT_TWO_BYTES): Use unsigned, not int.
9782 This avoids several warnings with gcc -Wstrict-overflow.
9783 (DECODE_COMPOSITION_RULE): If the rule is invalid, goto invalid_code
9784 directly, rather than having caller test rule sign. This avoids
9785 some unnecessary tests.
9786 * composite.h (COMPOSITION_ENCODE_RULE_VALID): New macro.
9787 (COMPOSITION_ENCODE_RULE): Arguments now must be valid. This
9788 affects only one use, in DECODE_COMPOSITION_RULE, which is changed.
9789
9790 * xfont.c (xfont_text_extents): Remove var that was set but not used.
9791 (xfont_open): Avoid unnecessary tests.
9792
9793 * composite.c (composition_gstring_put_cache): Use unsigned integer.
9794
9795 * composite.h, composite.c (composition_gstring_put_cache):
9796 Use EMACS_INT, not int, for length.
9797
9798 * composite.h (COMPOSITION_DECODE_REFS): New macro,
9799 breaking out part of COMPOSITION_DECODE_RULE.
9800 (COMPOSITION_DECODE_RULE): Use it.
9801 * composite.c (get_composition_id): Remove unused local vars,
9802 by using the new macro.
9803
9804 * textprop.c (set_text_properties_1): Change while to do-while,
9805 since the condition is always true at first.
9806
9807 * intervals.c (graft_intervals_into_buffer): Mark var as used.
9808 (interval_deletion_adjustment): Return unsigned value.
9809 All uses changed.
9810
9811 * process.c (list_processes_1, create_pty, read_process_output):
9812 (exec_sentinel): Remove vars that were set but not used.
9813 (create_pty): Remove unnecessary "volatile"s.
9814 (Fnetwork_interface_info): Avoid possibility of int overflow.
9815 (read_process_output): Do adaptive read buffering even if carryover.
9816 (read_process_output): Simplify nbytes computation if buffered.
9817
9818 * bytecode.c (exec_byte_code): Rename local to avoid shadowing.
9819
9820 * syntax.c (scan_words): Remove var that was set but not used.
9821 (update_syntax_table): Use unsigned instead of int.
9822
9823 * lread.c (lisp_file_lexically_bound_p): Use ints rather than endptrs.
9824 (lisp_file_lexically_bound_p, read1): Use unsigned instead of int.
9825 (safe_to_load_p): Make the end-of-loop test the inverse of the in-loop.
9826
9827 * print.c (print_error_message): Avoid int overflow.
9828
9829 * font.c (font_list_entities): Redo for clarity,
9830 so that reader need not know FONT_DPI_INDEX + 1 == FONT_SPACING_INDEX.
9831
9832 * font.c (font_find_for_lface, Ffont_get_glyphs): Remove unused vars.
9833 (font_score): Avoid potential overflow in diff calculation.
9834
9835 * fns.c (substring_both): Remove var that is set but not used.
9836 (sxhash): Redo loop for clarity and to avoid wraparound warning.
9837
9838 * eval.c (funcall_lambda): Rename local to avoid shadowing.
9839
9840 * alloc.c (mark_object_loop_halt, mark_object): Use size_t, not int.
9841 Otherwise, GCC 4.6.0 optimizes the loop check away since the check
9842 can always succeed if overflow has undefined behavior.
9843
9844 * search.c (boyer_moore, wordify): Remove vars set but not used.
9845 (wordify): Omit three unnecessary tests.
9846
9847 * indent.c (MULTIBYTE_BYTES_WIDTH): Don't compute wide_column.
9848 All callers changed. This avoids the need for an unused var.
9849
9850 * casefiddle.c (casify_region): Remove var that is set but not used.
9851
9852 * dired.c (file_name_completion): Remove var that is set but not used.
9853
9854 * fileio.c (Finsert_file_contents): Make EOF condition clearer.
9855
9856 * fileio.c (Finsert_file_contents): Avoid signed integer overflow.
9857 (Finsert_file_contents): Remove unnecessary code checking fd.
9858
9859 * minibuf.c (read_minibuf_noninteractive): Use size_t for sizes.
9860 Check for integer overflow on size calculations.
9861
9862 * buffer.c (Fprevious_overlay_change): Remove var that is set
9863 but not used.
9864
9865 * keyboard.c (menu_bar_items, read_char_minibuf_menu_prompt):
9866 Remove vars that are set but not used.
9867 (timer_check_2): Don't assume timer-list and idle-timer-list are lists.
9868 (timer_check_2): Mark vars as initialized.
9869
9870 * gtkutil.c (xg_get_file_with_chooser): Mark var as initialized.
9871
9872 * image.c (lookup_image): Remove var that is set but not used.
9873 (xbm_load): Use parse_p, for gcc -Werror=unused-but-set-variable.
9874
9875 * fontset.c (Finternal_char_font, Ffontset_info): Remove vars
9876 that are set but not used.
9877
9878 * xfns.c (make_invisible_cursor): Don't return garbage
9879 if XCreateBitmapFromData fails (Bug#8410).
9880
9881 * xselect.c (x_get_local_selection, x_handle_property_notify):
9882 Remove vars that are set but not used.
9883
9884 * xfns.c (x_create_tip_frame): Remove var that is set but not used.
9885 (make_invisible_cursor): Initialize a possibly-uninitialized variable.
9886
9887 * xterm.c (x_scroll_bar_to_input_event) [!USE_GTK]:
9888 Remove var that is set but not used.
9889 (scroll_bar_windows_size): Now size_t, not int.
9890 (x_send_scroll_bar_event): Use size_t, not int, for sizes.
9891 Check for overflow.
9892
9893 * xfaces.c (realize_named_face): Remove vars that are set but not used.
9894 (map_tty_color) [!defined MSDOS]: Likewise.
9895
9896 * term.c (tty_write_glyphs): Use size_t; this avoids overflow warning.
9897
9898 * coding.c: Remove vars that are set but not used.
9899 (DECODE_COMPOSITION_RULE): Remove 2nd arg, which is unused.
9900 All callers changed.
9901 (decode_coding_utf_8, decode_coding_utf_16 decode_coding_emacs_mule):
9902 (decode_coding_iso_2022, encode_coding_sjis, encode_coding_big5):
9903 (decode_coding_charset): Remove vars that are set but not used.
9904
9905 * bytecode.c (Fbyte_code) [!defined BYTE_CODE_SAFE]: Remove var
9906 that is set but not used.
9907
9908 * print.c (print_object): Remove var that is set but not used.
9909
9910 Replace 2 copies of readlink code with 1 gnulib version (Bug#8401).
9911 The gnulib version avoids calling malloc in the usual case,
9912 and on 64-bit hosts doesn't have some arbitrary 32-bit limits.
9913 * fileio.c (Ffile_symlink_p): Use emacs_readlink.
9914 * filelock.c (current_lock_owner): Likewise.
9915 * lisp.h (READLINK_BUFSIZE, emacs_readlink): New function.
9916 * sysdep.c: Include allocator.h, careadlinkat.h.
9917 (emacs_no_realloc_allocator): New static constant.
9918 (emacs_readlink): New function.
9919 * deps.mk (sysdep.o): Depend on ../lib/allocator.h and on
9920 ../lib/careadlinkat.h.
9921
9922 2011-04-04 Stefan Monnier <monnier@iro.umontreal.ca>
9923
9924 * keyboard.c (safe_run_hook_funcall): Fix last change (don't stop at the
9925 first non-nil return value).
9926
9927 2011-04-03 Jan Djärv <jan.h.d@swipnet.se>
9928
9929 * nsterm.m (ns_update_auto_hide_menu_bar): Define MAC_OS_X_VERSION_10_6
9930 if not defined (Bug#8403).
9931
9932 2011-04-02 Juanma Barranquero <lekktu@gmail.com>
9933
9934 * xdisp.c (display_count_lines): Remove parameter `start',
9935 unused since 1998-01-01T02:27:27Z!rms@gnu.org. All callers changed.
9936 (get_char_face_and_encoding): Remove parameter `multibyte_p',
9937 unused since 2008-05-14T01:40:23Z!handa@m17n.org. All callers changed.
9938 (fill_stretch_glyph_string): Remove parameters `row' and `area',
9939 unused at least since Kim's GUI unification at 2003-03-16T20:45:46Z!storm@cua.dk
9940 and thereabouts. All callers changed.
9941 (get_per_char_metric): Remove parameter `f', unused since
9942 2008-05-14T01:40:23Z!handa@m17n.org. All callers changed.
9943
9944 2011-04-02 Jim Meyering <meyering@redhat.com>
9945
9946 do not dereference NULL upon failed strdup
9947 * nsfont.m (ns_descriptor_to_entity): Use xstrdup, not strdup.
9948 (ns_get_family): Likewise.
9949
9950 2011-04-02 Juanma Barranquero <lekktu@gmail.com>
9951
9952 * eval.c (unwind_to_catch) [DEBUG_GCPRO]: Remove redundant assignment.
9953
9954 2011-04-02 Jan Djärv <jan.h.d@swipnet.se>
9955
9956 * nsterm.m (ns_update_auto_hide_menu_bar): Only for OSX 10.6 or
9957 later (Bug#8403).
9958
9959 2011-04-01 Stefan Monnier <monnier@iro.umontreal.ca>
9960
9961 Add lexical binding.
9962
9963 * window.c (Ftemp_output_buffer_show): New fun.
9964 (Fsave_window_excursion):
9965 * print.c (Fwith_output_to_temp_buffer): Move to subr.el.
9966
9967 * lread.c (lisp_file_lexically_bound_p): New function.
9968 (Fload): Bind Qlexical_binding.
9969 (readevalloop): Remove `evalfun' arg.
9970 Bind Qinternal_interpreter_environment.
9971 (Feval_buffer): Bind Qlexical_binding.
9972 (defvar_int, defvar_bool, defvar_lisp_nopro, defvar_kboard):
9973 Mark as dynamic.
9974 (syms_of_lread): Declare `lexical-binding'.
9975
9976 * lisp.h (struct Lisp_Symbol): New field `declared_special'.
9977
9978 * keyboard.c (eval_dyn): New fun.
9979 (menu_item_eval_property): Use it.
9980
9981 * image.c (parse_image_spec): Use Ffunctionp.
9982
9983 * fns.c (concat, mapcar1): Accept byte-code-functions.
9984
9985 * eval.c (Fsetq): Handle lexical vars.
9986 (Fdefun, Fdefmacro, Ffunction): Make closures when needed.
9987 (Fdefconst, Fdefvaralias, Fdefvar): Mark as dynamic.
9988 (FletX, Flet): Obey lexical binding.
9989 (Fcommandp): Handle closures.
9990 (Feval): New `lexical' arg.
9991 (eval_sub): New function extracted from Feval. Use it almost
9992 everywhere where Feval was used. Look up vars in lexical env.
9993 Handle closures.
9994 (Ffunctionp): Move from subr.el.
9995 (Ffuncall): Handle closures.
9996 (apply_lambda): Remove `eval_flags'.
9997 (funcall_lambda): Handle closures and new byte-code-functions.
9998 (Fspecial_variable_p): New function.
9999 (syms_of_eval): Initialize the Vinternal_interpreter_environment var,
10000 but without exporting it to Lisp.
10001
10002 * doc.c (Fdocumentation, store_function_docstring):
10003 * data.c (Finteractive_form): Handle closures.
10004
10005 * callint.c (Fcall_interactively): Preserve lexical-binding mode for
10006 interactive spec.
10007
10008 * bytecode.c (Bstack_ref, Bstack_set, Bstack_set2, BdiscardN):
10009 New byte-codes.
10010 (exec_byte_code): New function extracted from Fbyte_code to handle new
10011 calling convention for byte-code-functions. Add new byte-codes.
10012
10013 * buffer.c (defvar_per_buffer): Set new `declared_special' field.
10014
10015 * alloc.c (Fmake_symbol): Init new `declared_special' field.
10016
10017 2011-03-31 Juanma Barranquero <lekktu@gmail.com>
10018
10019 * xdisp.c (redisplay_internal): Fix prototype.
10020
10021 2011-03-31 Eli Zaretskii <eliz@gnu.org>
10022
10023 * xdisp.c (SCROLL_LIMIT): New macro.
10024 (try_scrolling): Use it when setting scroll_limit.
10025 Limit scrolling to 100 screen lines.
10026 (redisplay_window): Even when falling back on "recentering",
10027 position point in the window according to scroll-conservatively,
10028 scroll-margin, and scroll-*-aggressively variables. (Bug#6671)
10029
10030 (try_scrolling): When point is above the window, allow searching
10031 as far as scroll_max, or one screenful, to compute vertical
10032 distance from PT to the scroll margin position. This prevents
10033 try_scrolling from unnecessarily failing when
10034 scroll-conservatively is set to a value slightly larger than the
10035 window height. Clean up the case of PT below the margin at bottom
10036 of window: scroll_max can no longer be INT_MAX. When aggressive
10037 scrolling is in use, don't let point enter the opposite scroll
10038 margin as result of the scroll.
10039 (syms_of_xdisp) <scroll-conservatively>: Document the
10040 threshold of 100 lines for never-recentering scrolling.
10041
10042 2011-03-31 Juanma Barranquero <lekktu@gmail.com>
10043
10044 * dispextern.h (move_it_by_lines):
10045 * xdisp.c (move_it_by_lines): Remove parameter `need_y_p', unused
10046 since 2000-12-29T14:24:09Z!gerd@gnu.org. All callers changed.
10047 (message_log_check_duplicate): Remove parameters `prev_bol' and
10048 `this_bol', unused since 1998-01-01T02:27:27Z!rms@gnu.org. All callers changed.
10049 (redisplay_internal): Remove parameter `preserve_echo_area',
10050 unused since 1999-07-21T21:43:52Z!gerd@gnu.org. All callers changed.
10051
10052 * indent.c (Fvertical_motion):
10053 * window.c (window_scroll_pixel_based, Frecenter):
10054 Don't pass `need_y_p' to `move_it_by_lines'.
10055
10056 2011-03-30 Stefan Monnier <monnier@iro.umontreal.ca>
10057
10058 * eval.c (struct backtrace): Don't cheat with negative numbers, but do
10059 steal a few bits to be more compact.
10060 (interactive_p, Fbacktrace, Fbacktrace_frame, mark_backtrace):
10061 Remove unneeded casts.
10062
10063 * bytecode.c (Fbyte_code): CAR and CDR can GC.
10064
10065 2011-03-30 Zachary Kanfer <zkanfer@gmail.com> (tiny change)
10066
10067 * keyboard.c (Fexecute_extended_command): Do log the "suggest key
10068 binding" message (bug#7967).
10069
10070 2011-03-30 Paul Eggert <eggert@cs.ucla.edu>
10071
10072 Fix more problems found by GCC 4.6.0's static checks.
10073
10074 * unexelf.c (unexec) [! (defined _SYSTYPE_SYSV || defined __sgi)]:
10075 Remove unused local var.
10076
10077 * editfns.c (Fmessage_box): Remove unused local var.
10078
10079 * xdisp.c (try_window_reusing_current_matrix, x_produce_glyphs):
10080 (note_mode_line_or_margin_highlight, note_mouse_highlight):
10081 Omit unused local vars.
10082 * window.c (shrink_windows): Omit unused local var.
10083 * menu.c (digest_single_submenu): Omit unused local var.
10084 * dispnew.c (update_window) [PERIODIC_PREEMPTION_CHECKING]:
10085 Omit unused local var.
10086
10087 * keyboard.c (parse_modifiers_uncached, parse_modifiers):
10088 Don't assume string length fits in int.
10089 (keyremap_step, read_key_sequence): Use size_t for sizes.
10090 (read_key_sequence): Don't check last_real_key_start redundantly.
10091
10092 * callproc.c (Fcall_process, Fcall_process_region): Use SAFE_ALLOCA
10093 instead of alloca (Bug#8344).
10094
10095 * eval.c (Fbacktrace): Don't assume nargs fits in int.
10096 (Fbacktrace_frame): Don't assume nframes fits in int.
10097
10098 * syntax.c (scan_sexps_forward): Avoid pointer wraparound.
10099
10100 * xterm.c (x_make_frame_visible, same_x_server): Redo to avoid overflow
10101 concerns.
10102
10103 * term.c (produce_glyphless_glyph): Remove unnecessary test.
10104
10105 * cm.c (calccost): Turn while-do into do-while, for clarity.
10106
10107 * keyboard.c (syms_of_keyboard): Use the same style as later
10108 in this function when indexing through an array. This also
10109 works around GCC bug 48267.
10110
10111 * image.c (tiff_load): Fix off-by-one image count (Bug#8336).
10112
10113 * xselect.c (x_check_property_data): Return correct size (Bug#8335).
10114
10115 * chartab.c (sub_char_table_ref_and_range): Redo for slight
10116 efficiency gain, and to bypass a gcc -Wstrict-overflow warning.
10117
10118 * keyboard.c, keyboard.h (num_input_events): Now size_t.
10119 This avoids undefined behavior on integer overflow, and is a bit
10120 more convenient anyway since it is compared to a size_t variable.
10121
10122 Variadic C functions now count arguments with size_t, not int.
10123 This avoids an unnecessary limitation on 64-bit machines, which
10124 caused (substring ...) to crash on large vectors (Bug#8344).
10125 * lisp.h (struct Lisp_Subr.function.aMANY): Now takes size_t, not int.
10126 (DEFUN_ARGS_MANY, internal_condition_case_n, safe_call): Likewise.
10127 All variadic functions and their callers changed accordingly.
10128 (struct gcpro.nvars): Now size_t, not int. All uses changed.
10129 * data.c (arith_driver, float_arith_driver): Likewise.
10130 * editfns.c (general_insert_function): Likewise.
10131 * eval.c (struct backtrace.nargs, interactive_p)
10132 (internal_condition_case_n, run_hook_with_args, apply_lambda)
10133 (funcall_lambda, mark_backtrace): Likewise.
10134 * fns.c (concat): Likewise.
10135 * frame.c (x_set_frame_parameters): Likewise.
10136 * fns.c (get_key_arg): Now accepts and returns size_t, and returns
10137 0 if not found, not -1. All callers changed.
10138
10139 * alloc.c (garbage_collect): Don't assume stack size fits in int.
10140 (stack_copy_size): Now size_t, not int.
10141 (stack_copy, stack_copy_size): Define only if MAX_SAVE_STACK > 0.
10142
10143 2011-03-28 Juanma Barranquero <lekktu@gmail.com>
10144
10145 * coding.c (encode_designation_at_bol): Remove parameter `charbuf_end',
10146 unused since 2002-03-01T01:17:24Z!handa@m17n.org and 2008-02-01T16:01:31Z!miles@gnu.org.
10147 All callers changed.
10148
10149 * lisp.h (multibyte_char_to_unibyte):
10150 * character.c (multibyte_char_to_unibyte): Remove parameter `rev_tbl',
10151 unused since 2002-03-01T01:16:34Z!handa@m17n.org and 2008-02-01T16:01:31Z!miles@gnu.org.
10152 * character.h (CHAR_TO_BYTE8):
10153 * cmds.c (internal_self_insert):
10154 * editfns.c (general_insert_function):
10155 * keymap.c (push_key_description):
10156 * search.c (Freplace_match):
10157 * xdisp.c (message_dolog, set_message_1): All callers changed.
10158
10159 2011-03-28 Stefan Monnier <monnier@iro.umontreal.ca>
10160
10161 * keyboard.c (safe_run_hook_funcall): New function.
10162 (safe_run_hooks_1, safe_run_hooks_error, safe_run_hooks): On error,
10163 don't set the hook to nil, but remove the offending function instead.
10164 (Qcommand_hook_internal): Remove, unused.
10165 (syms_of_keyboard): Don't initialize Qcommand_hook_internal nor define
10166 Vcommand_hook_internal.
10167
10168 * eval.c (enum run_hooks_condition): Remove.
10169 (funcall_nil, funcall_not): New functions.
10170 (run_hook_with_args): Call each function through a `funcall' argument.
10171 Remove `cond' argument, now redundant.
10172 (Frun_hooks, Frun_hook_with_args, Frun_hook_with_args_until_success)
10173 (Frun_hook_with_args_until_failure): Adjust accordingly.
10174 (run_hook_wrapped_funcall, Frun_hook_wrapped): New functions.
10175
10176 2011-03-28 Juanma Barranquero <lekktu@gmail.com>
10177
10178 * dispextern.h (string_buffer_position): Remove declaration.
10179
10180 * print.c (strout): Remove parameter `multibyte', unused since
10181 1999-08-21T19:30:21Z!gerd@gnu.org. All callers changed.
10182
10183 * search.c (boyer_moore): Remove parameters `len', `pos' and `lim',
10184 never used since function introduction in 1998-02-08T21:33:56Z!rms@gnu.org.
10185 All callers changed.
10186
10187 * w32.c (_wsa_errlist): Use braces for struct initializers.
10188
10189 * xdisp.c (string_buffer_position_lim): Remove parameter `w',
10190 never used since function introduction in 2001-03-09T18:41:50Z!gerd@gnu.org.
10191 All callers changed.
10192 (string_buffer_position): Likewise. Also, make static (it's never
10193 used outside xdisp.c).
10194 (cursor_row_p): Remove parameter `w', unused since
10195 2000-10-17T16:08:57Z!gerd@gnu.org. All callers changed.
10196 (decode_mode_spec): Remove parameter `precision', introduced during
10197 Gerd Moellmann's rewrite at 1999-07-21T21:43:52Z!gerd@gnu.org, but never used.
10198 All callers changed.
10199
10200 2011-03-27 Jan Djärv <jan.h.d@swipnet.se>
10201
10202 * nsterm.m (syms_of_nsterm): Use doc: for ns-auto-hide-menu-bar.
10203
10204 2011-03-27 Anders Lindgren <andlind@gmail.com>
10205
10206 * nsterm.m (ns_menu_bar_is_hidden): New variable.
10207 (ns_constrain_all_frames, ns_menu_bar_should_be_hidden)
10208 (ns_update_auto_hide_menu_bar): New functions.
10209 (ns_update_begin): Call ns_update_auto_hide_menu_bar.
10210 (applicationDidBecomeActive): Call ns_update_auto_hide_menu_bar and
10211 ns_constrain_all_frames.
10212 (constrainFrameRect): Return at once if ns_menu_bar_should_be_hidden.
10213 (syms_of_nsterm): DEFVAR ns-auto-hide-menu-bar, init to Qnil.
10214
10215 2011-03-27 Jan Djärv <jan.h.d@swipnet.se>
10216
10217 * nsmenu.m (runDialogAt): Remove argument to timer_check.
10218
10219 2011-03-27 Glenn Morris <rgm@gnu.org>
10220
10221 * syssignal.h: Replace RETSIGTYPE with void.
10222 * atimer.c, data.c, dispnew.c, emacs.c, floatfns.c, keyboard.c:
10223 * keyboard.h, lisp.h, process.c, sysdep.c, xterm.c:
10224 Replace SIGTYPE with void everywhere.
10225 * s/usg5-4-common.h (SIGTYPE): Remove definition.
10226 * s/template.h (SIGTYPE): Remove commented out definition.
10227
10228 2011-03-26 Eli Zaretskii <eliz@gnu.org>
10229
10230 * xdisp.c (redisplay_window): Don't check buffer's clip_changed
10231 flag as a prerequisite for invoking try_scrolling. (Bug#6671)
10232
10233 2011-03-26 Juanma Barranquero <lekktu@gmail.com>
10234
10235 * w32.c (read_unc_volume): Use parameter `henum', instead of
10236 global variable `wget_enum_handle'.
10237
10238 * keymap.c (describe_vector): Remove parameters `indices' and
10239 `char_table_depth', unused since 2002-03-01T01:43:26Z!handa@m17n.org.
10240 (describe_map, Fdescribe_vector): Adjust calls to `describe_vector'.
10241
10242 * keyboard.h (timer_check, show_help_echo): Remove unused parameters.
10243
10244 * keyboard.c (timer_check): Remove parameter `do_it_now',
10245 unused since 1996-04-12T06:01:29Z!rms@gnu.org.
10246 (show_help_echo): Remove parameter `ok_to_overwrite_keystroke_echo',
10247 unused since 2008-04-19T19:30:53Z!monnier@iro.umontreal.ca.
10248
10249 * keyboard.c (read_char):
10250 * w32menu.c (w32_menu_display_help):
10251 * xmenu.c (show_help_event, menu_help_callback):
10252 Adjust calls to `show_help_echo'.
10253
10254 * gtkutil.c (xg_maybe_add_timer):
10255 * keyboard.c (readable_events):
10256 * process.c (wait_reading_process_output):
10257 * xmenu.c (x_menu_wait_for_event): Adjust calls to `timer_check'.
10258
10259 * insdel.c (adjust_markers_gap_motion):
10260 Remove; no-op since 1998-01-02T21:29:48Z!rms@gnu.org.
10261 (gap_left, gap_right): Don't call it.
10262
10263 2011-03-25 Chong Yidong <cyd@stupidchicken.com>
10264
10265 * xdisp.c (handle_fontified_prop): Discard changes to clip_changed
10266 incurred during fontification.
10267
10268 2011-03-25 Juanma Barranquero <lekktu@gmail.com>
10269
10270 * buffer.c (defvar_per_buffer): Remove unused parameter `doc'.
10271 (DEFVAR_PER_BUFFER): Don't pass it.
10272
10273 * dispnew.c (row_equal_p, add_row_entry): Remove unused parameter `w'.
10274 (scrolling_window): Don't pass it.
10275
10276 2011-03-25 Juanma Barranquero <lekktu@gmail.com>
10277
10278 * dispextern.h (glyph_matric): Use #if GLYPH_DEBUG, not #ifdef.
10279
10280 * fileio.c (check_executable) [DOS_NT]: Remove unused variables `len'
10281 and `suffix'.
10282 (Fset_file_selinux_context) [HAVE_LIBSELINUX]: Move here declaration
10283 of variables specific to SELinux and computation of `encoded_absname'.
10284
10285 * image.c (XPutPixel): Remove unused variable `height'.
10286
10287 * keyboard.c (make_lispy_event): Remove unused variable `hpos'.
10288
10289 * unexw32.c (get_section_info): Remove unused variable `section'.
10290
10291 * w32.c (stat): Remove unused variables `drive_root' and `devtype'.
10292 (system_process_attributes): Remove unused variable `sess'.
10293 (sys_read): Remove unused variable `err'.
10294
10295 * w32fns.c (top): Wrap variables with #if GLYPH_DEBUG, not #ifdef.
10296 (w32_wnd_proc): Remove unused variable `isdead'.
10297 (unwind_create_frame): Use #if GLYPH_DEBUG, not #ifdef.
10298 (Fx_server_max_request_size): Remove unused variable `dpyinfo'.
10299 (x_create_tip_frame): Remove unused variable `tem'.
10300
10301 * w32inevt.c (w32_console_read_socket):
10302 Remove unused variable `no_events'.
10303
10304 * w32term.c (x_draw_composite_glyph_string_foreground):
10305 Remove unused variable `width'.
10306
10307 2011-03-24 Juanma Barranquero <lekktu@gmail.com>
10308
10309 * w32term.c (x_set_glyph_string_clipping):
10310 Don't pass uninitialized region to CombineRgn.
10311
10312 2011-03-23 Juanma Barranquero <lekktu@gmail.com>
10313
10314 * w32fns.c (x_set_menu_bar_lines): Remove unused variable `olines'.
10315 (w32_wnd_proc): Pass NULL to Windows API, not uninitialized buffer.
10316 (Fx_close_connection): Remove unused variable `i'.
10317
10318 * w32font.c (w32font_draw): Return number of glyphs.
10319 (w32font_open_internal): Remove unused variable `i'.
10320 (w32font_driver): Add missing initializer.
10321
10322 * w32menu.c (utf8to16): Remove unused variable `utf16'.
10323 (fill_in_menu): Remove unused variable `items_added'.
10324
10325 * w32term.c (last_mouse_press_frame): Remove static global variable.
10326 (w32_clip_to_row): Remove unused variable `f'.
10327 (x_delete_terminal): Remove unused variable `i'.
10328
10329 * w32uniscribe.c (uniscribe_shape): Remove unused variable `nclusters'.
10330 (NOTHING): Remove unused static global variable.
10331 (uniscribe_check_otf): Remove unused variable `table'.
10332 (uniscribe_font_driver): Add missing initializers.
10333
10334 2011-03-23 Julien Danjou <julien@danjou.info>
10335
10336 * term.c (Fsuspend_tty, Fresume_tty):
10337 * minibuf.c (read_minibuf, run_exit_minibuf_hook):
10338 * window.c (temp_output_buffer_show):
10339 * insdel.c (signal_before_change):
10340 * frame.c (Fhandle_switch_frame):
10341 * fileio.c (Fdo_auto_save):
10342 * emacs.c (Fkill_emacs):
10343 * editfns.c (save_excursion_restore):
10344 * cmds.c (internal_self_insert):
10345 * callint.c (Fcall_interactively):
10346 * buffer.c (Fkill_all_local_variables):
10347 * keyboard.c (Fcommand_execute, Fsuspend_emacs, safe_run_hooks_1):
10348 Use Frun_hooks.
10349 (command_loop_1): Use Frun_hooks. Call safe_run_hooks
10350 unconditionally since it does the check itself.
10351
10352 2011-03-23 Paul Eggert <eggert@cs.ucla.edu>
10353
10354 Fix more problems found by GCC 4.5.2's static checks.
10355
10356 * coding.c (encode_coding_raw_text): Avoid unnecessary test
10357 the first time through the loop, since we know p0 < p1 then.
10358 This also avoids a gcc -Wstrict-overflow warning.
10359
10360 * lisp.h (SAFE_ALLOCA, SAFE_ALLOCA_LISP): Avoid 'int' overflow
10361 leading to a memory leak, possible in functions like
10362 load_charset_map_from_file that can allocate an unbounded number
10363 of objects (Bug#8318).
10364
10365 * xmenu.c (set_frame_menubar): Use EMACS_UINT, not int, for indexes
10366 that could (at least in theory) be that large.
10367
10368 * xdisp.c (message_log_check_duplicate): Return unsigned long, not int.
10369 This is less likely to overflow, and avoids undefined behavior if
10370 overflow does occur. All callers changed. Use strtoul to scan
10371 for the unsigned long integer.
10372 (pint2hrstr): Simplify and tune code slightly.
10373 This also avoids a (bogus) GCC warning with gcc -Wstrict-overflow.
10374
10375 * scroll.c (do_scrolling): Work around GCC bug 48228.
10376 See <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48228>.
10377
10378 * frame.c (Fmodify_frame_parameters): Simplify loop counter.
10379 This also avoids a warning with gcc -Wstrict-overflow.
10380 (validate_x_resource_name): Simplify count usage.
10381 This also avoids a warning with gcc -Wstrict-overflow.
10382
10383 * fileio.c (Fcopy_file): Report error if fchown or fchmod
10384 fail (Bug#8306).
10385
10386 * emacs.c (Fdaemon_initialized): Do not ignore I/O errors (Bug#8303).
10387
10388 * process.c (Fmake_network_process): Use socklen_t, not int,
10389 where POSIX says socklen_t is required in portable programs.
10390 This fixes a porting bug on hosts like 64-bit HP-UX, where
10391 socklen_t is wider than int (Bug#8277).
10392 (Fmake_network_process, server_accept_connection):
10393 (wait_reading_process_output, read_process_output):
10394 Likewise.
10395
10396 * process.c: Rename or move locals to avoid shadowing.
10397 (list_processes_1, Fmake_network_process):
10398 (read_process_output_error_handler, exec_sentinel_error_handler):
10399 Rename or move locals.
10400 (Fmake_network_process): Define label "retry_connect" only if needed.
10401 (Fnetwork_interface_info): Fix pointer signedness.
10402 (process_send_signal): Add cast to avoid pointer signedness problem.
10403 (FIRST_PROC_DESC, IF_NON_BLOCKING_CONNECT): Remove unused macros.
10404 (create_process): Use 'volatile' to avoid vfork clobbering (Bug#8298).
10405
10406 Make tparam.h and terminfo.c consistent.
10407 * cm.c (tputs, tgoto, BC, UP): Remove extern decls.
10408 Include tparam.h instead, since it declares them.
10409 * cm.h (PC): Remove extern decl; tparam.h now does this.
10410 * deps.mk (cm.o, terminfo.o): Depend on tparam.h.
10411 * terminfo.c: Include tparam.h, to check interfaces.
10412 (tparm): Make 1st arg a const pointer in decl. Put it at top level.
10413 (tparam): Adjust signature to match interface in tparam.h;
10414 this removes some undefined behavior. Check that outstring and len
10415 are zero, which they always are with Emacs.
10416 * tparam.h (PC, BC, UP): New extern decls.
10417
10418 * xftfont.c (xftfont_shape): Now static, and defined only if needed.
10419 (xftfont_open): Rename locals to avoid shadowing.
10420
10421 * ftfont.c (ftfont_resolve_generic_family): Fix pointer signedness.
10422 (ftfont_otf_capability, ftfont_shape): Omit decls if not needed.
10423 (OTF_TAG_SYM): Omit macro if not needed.
10424 (ftfont_list): Remove unused local.
10425 (get_adstyle_property, ftfont_pattern_entity):
10426 (ftfont_lookup_cache, ftfont_open, ftfont_anchor_point):
10427 Rename locals to avoid shadowing.
10428
10429 * xfont.c (xfont_list_family): Mark var as initialized.
10430
10431 * xml.c (make_dom): Now static.
10432
10433 * composite.c (composition_compute_stop_pos): Rename local to
10434 avoid shadowing.
10435 (composition_reseat_it): Remove unused locals.
10436 (find_automatic_composition, composition_adjust_point): Likewise.
10437 (composition_update_it): Mark var as initialized.
10438 (find_automatic_composition): Mark vars as initialized,
10439 with a FIXME (Bug#8290).
10440
10441 character.h: Rename locals to avoid shadowing.
10442 * character.h (PREV_CHAR_BOUNDARY, FETCH_STRING_CHAR_ADVANCE):
10443 (FETCH_STRING_CHAR_AS_MULTIBYTE_ADVANCE, FETCH_CHAR_ADVANCE):
10444 (FETCH_CHAR_ADVANCE_NO_CHECK, INC_POS, DEC_POS, BUF_INC_POS):
10445 (BUF_DEC_POS): Be more systematic about renaming local temporaries
10446 to avoid shadowing.
10447
10448 * textprop.c (property_change_between_p): Remove; unused.
10449
10450 * intervals.c (interval_start_pos): Now static.
10451
10452 * intervals.h (CHECK_TOTAL_LENGTH): Avoid empty "else".
10453
10454 * atimer.c (start_atimer, append_atimer_lists, set_alarm):
10455 Rename locals to avoid shadowing.
10456
10457 * sound.c (wav_play, au_play, Fplay_sound_internal):
10458 Fix pointer signedness.
10459 (alsa_choose_format): Remove unused local var.
10460 (wav_play): Initialize a variable to 0, to prevent undefined
10461 behavior (Bug#8278).
10462
10463 * region-cache.c (insert_cache_boundary): Redo var to avoid shadowing.
10464
10465 * region-cache.h (pp_cache): New decl, for gcc -Wmissing-prototypes.
10466
10467 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork
10468 clobbering (Bug#8298).
10469 * sysdep.c (sys_subshell): Likewise.
10470 Previously, the sys_subshell 'volatile' was incorrectly IF_LINTted out.
10471
10472 * lisp.h (child_setup): Now NO_RETURN unless DOS_NT.
10473 This should get cleaned up, so that child_setup has the
10474 same signature on all platforms.
10475
10476 * callproc.c (call_process_cleanup): Now static.
10477 (relocate_fd): Rename locals to avoid shadowing.
10478
10479 2011-03-22 Chong Yidong <cyd@stupidchicken.com>
10480
10481 * xterm.c (x_clear_frame): Remove XClearWindow call. This appears
10482 not to be necessary, and produces flickering.
10483
10484 2011-03-20 Glenn Morris <rgm@gnu.org>
10485
10486 * config.in: Remove file.
10487
10488 2011-03-20 Juanma Barranquero <lekktu@gmail.com>
10489
10490 * minibuf.c (Vcompleting_read_function): Don't declare, global variables
10491 are now in src/globals.h.
10492 (syms_of_minibuf): Remove spurious & from previous change.
10493
10494 2011-03-20 Leo Liu <sdl.web@gmail.com>
10495
10496 * minibuf.c (completing-read-function): New variable.
10497 (completing-read-default): Rename from completing-read.
10498 (completing-read): Call completing-read-function.
10499
10500 2011-03-19 Juanma Barranquero <lekktu@gmail.com>
10501
10502 * xfaces.c (Fx_load_color_file):
10503 Read color file from absolute filename (bug#8250).
10504
10505 2011-03-19 Juanma Barranquero <lekktu@gmail.com>
10506
10507 * makefile.w32-in: Update dependencies.
10508
10509 2011-03-17 Eli Zaretskii <eliz@gnu.org>
10510
10511 * makefile.w32-in ($(BLD)/unexw32.$(O)): Depend on $(SRC)/unexec.h.
10512
10513 2011-03-17 Paul Eggert <eggert@cs.ucla.edu>
10514
10515 Fix more problems found by GCC 4.5.2's static checks.
10516
10517 * process.c (make_serial_process_unwind, send_process_trap):
10518 (sigchld_handler): Now static.
10519
10520 * process.c (allocate_pty): Let PTY_ITERATION declare iteration vars.
10521 That way, the code declares only the vars that it needs.
10522 * s/aix4-2.h (PTY_ITERATION): Declare iteration vars.
10523 * s/cygwin.h (PTY_ITERATION): Likewise.
10524 * s/darwin.h (PTY_ITERATION): Likewise.
10525 * s/gnu-linux.h (PTY_ITERATION): Likewise.
10526
10527 * s/irix6-5.h (PTY_OPEN): Declare stb, to loosen coupling.
10528 * process.c (allocate_pty): Don't declare stb unless it's needed.
10529
10530 * bytecode.c (MAYBE_GC): Rewrite so as not to use empty "else".
10531 (CONSTANTLIM): Remove; unused.
10532 (METER_CODE, Bscan_buffer, Bread_char, Bset_mark):
10533 Define only if needed.
10534
10535 * unexelf.c (unexec): Name an expression,
10536 to avoid gcc -Wbad-function-cast warning.
10537 Use a different way to cause a compilation error if anyone uses
10538 n rather than nn, a way that does not involve shadowing.
10539 (ELF_BSS_SECTION_NAME, OLD_PROGRAM_H): Remove; unused.
10540
10541 * deps.mk (unexalpha.o): Remove; unused.
10542
10543 New file unexec.h, the (simple) interface for unexec (Bug#8267).
10544 * unexec.h: New file.
10545 * deps.mk (emacs.o, unexaix.o, unexcw.o, unexcoff.o, unexelf.o):
10546 (unexhp9k800.o, unexmacosx.o, unexsol.o, unexw32.o):
10547 Depend on unexec.h.
10548 * emacs.c [!defined CANNOT_DUMP]: Include unexec.h.
10549 * unexaix.c, unexcoff.c, unexcw.c, unexelf.c, unexhp9k800.c:
10550 * unexmacosx.c, unexsol.c, unexw32.c: Include unexec.h.
10551 Change as necessary to match prototype in unexec.h.
10552
10553 * syntax.c (Fforward_comment, scan_lists): Rename locals to avoid
10554 shadowing.
10555 (back_comment, skip_chars): Mark vars as initialized.
10556
10557 * character.h (FETCH_STRING_CHAR_ADVANCE_NO_CHECK, BUF_INC_POS):
10558 Rename locals to avoid shadowing.
10559
10560 * lread.c (read1): Rewrite so as not to use empty "else".
10561 (Fload, readevalloop, read1): Rename locals to avoid shadowing.
10562
10563 * print.c (Fredirect_debugging_output): Fix pointer signedess.
10564
10565 * lisp.h (debug_output_compilation_hack): Add decl here, to avoid
10566 warning when compiling print.c.
10567
10568 * font.c (font_unparse_fcname): Abort in an "impossible" situation
10569 instead of using an uninitialized var.
10570 (font_sort_entities): Mark var as initialized.
10571
10572 * character.h (FETCH_CHAR_ADVANCE): Rename locals to avoid shadowing.
10573
10574 * font.c (font_unparse_xlfd): Don't mix pointers to variables with
10575 pointers to constants.
10576 (font_parse_fcname): Remove unused vars.
10577 (font_delete_unmatched): Now static.
10578 (font_get_spec): Remove; unused.
10579 (font_style_to_value, font_prop_validate_style, font_unparse_fcname):
10580 (font_update_drivers, Ffont_get_glyphs, font_add_log):
10581 Rename or move locals to avoid shadowing.
10582
10583 * fns.c (require_nesting_list, require_unwind): Now static.
10584 (Ffillarray): Rename locals to avoid shadowing.
10585
10586 * floatfns.c (domain_error2): Define only if needed.
10587 (Ffrexp, Fldexp): Rename locals to avoid shadowing.
10588
10589 * alloc.c (mark_backtrace): Move decl from here ...
10590 * lisp.h: ... to here, so that it can be checked.
10591
10592 * eval.c (call_debugger, do_debug_on_call, grow_specpdl): Now static.
10593 (Fdefvar): Rewrite so as not to use empty "else".
10594 (lisp_indirect_variable): Name an expression,
10595 to avoid gcc -Wbad-function-cast warning.
10596 (Fdefvar): Rename locals to avoid shadowing.
10597
10598 * callint.c (quotify_arg, quotify_args): Now static.
10599 (Fcall_interactively): Rename locals to avoid shadowing.
10600 Use const pointer when appropriate.
10601
10602 * lisp.h (get_system_name, get_operating_system_release):
10603 Move decls here, to check interfaces.
10604 * process.c (get_operating_system_release): Move decl to lisp.h.
10605 * xrdb.c (get_system_name): Likewise.
10606 * editfns.c (init_editfns, Fuser_login_name, Fuser_uid):
10607 (Fuser_real_uid, Fuser_full_name): Remove unnecessary casts,
10608 some of which prompt warnings from gcc -Wbad-function-cast.
10609 (Fformat_time_string, Fencode_time, Finsert_char):
10610 (Ftranslate_region_internal, Fformat):
10611 Rename or remove local vars to avoid shadowing.
10612 (Ftranslate_region_internal): Mark var as initialized.
10613
10614 * doc.c (Fdocumentation, Fsnarf_documentation): Move locals to
10615 avoid shadowing.
10616
10617 * lisp.h (eassert): Check that the argument compiles, even if
10618 ENABLE_CHECKING is not defined.
10619
10620 * data.c (Findirect_variable): Name an expression, to avoid
10621 gcc -Wbad-function-cast warning.
10622 (default_value, arithcompare, arith_driver, arith_error): Now static.
10623 (store_symval_forwarding): Rename local to avoid shadowing.
10624 (Fmake_variable_buffer_local, Fmake_local_variable):
10625 Mark variables as initialized.
10626 (do_blv_forwarding, do_symval_forwarding): Remove; unused.
10627
10628 * alloc.c (check_cons_list): Do not define unless GC_CHECK_CONS_LIST.
10629 (Fmake_vector, Fvector, Fmake_byte_code, Fgarbage_collect):
10630 Rename locals to avoid shadowing.
10631 (mark_stack): Move local variables into the #ifdef region where
10632 they're used.
10633 (BLOCK_INPUT_ALLOC, UNBLOCK_INPUT_ALLOC): Define only if
10634 ! defined SYSTEM_MALLOC && ! defined SYNC_INPUT, as they are not
10635 needed otherwise.
10636 (CHECK_ALLOCATED): Define only if GC_CHECK_MARKED_OBJECTS.
10637 (GC_STRING_CHARS): Remove; not used.
10638 (Fmemory_limit): Cast sbrk's returned value to char *.
10639
10640 * lisp.h (check_cons_list): Declare if GC_CHECK_CONS_LIST; this
10641 avoids undefined behavior in theory.
10642
10643 * regex.c (IF_LINT): Add defn, for benefit of ../lib-src.
10644
10645 Use functions, not macros, for up- and down-casing (Bug#8254).
10646 * buffer.h (DOWNCASE_TABLE, UPCASE_TABLE, DOWNCASE, UPPERCASEP):
10647 (NOCASEP, LOWERCASEP, UPCASE, UPCASE1): Remove. All callers changed
10648 to use the following functions instead of these macros.
10649 (downcase): Adjust to lack of DOWNCASE_TABLE. Return int, not
10650 EMACS_INT, since callers assume the returned value fits in int.
10651 (upcase1): Likewise, for UPCASE_TABLE.
10652 (uppercasep, lowercasep, upcase): New static inline functions.
10653 * editfns.c (Fchar_equal): Remove no-longer-needed workaround for
10654 the race-condition problem in the old DOWNCASE.
10655
10656 * regex.c (CHARSET_LOOKUP_RANGE_TABLE_RAW, POP_FAILURE_REG_OR_COUNT):
10657 Rename locals to avoid shadowing.
10658 (regex_compile, re_match_2_internal): Move locals to avoid shadowing.
10659 (regex_compile, re_search_2, re_match_2_internal):
10660 Remove unused local vars.
10661 (FREE_VAR): Rewrite so as not to use empty "else",
10662 which gcc can warn about.
10663 (regex_compile, re_match_2_internal): Mark locals as initialized.
10664 (RETALLOC_IF): Define only if needed.
10665 (WORDCHAR_P): Likewise. This one is never needed, but is used
10666 only in a comment talking about a compiler bug, so put inside
10667 the #if 0 of that comment.
10668 (CHARSET_LOOKUP_BITMAP, FAIL_STACK_FULL, RESET_FAIL_STACK):
10669 (PUSH_FAILURE_ELT, BUF_PUSH_3, STOP_ADDR_VSTRING):
10670 Remove; unused.
10671
10672 * search.c (boyer_moore): Rename locals to avoid shadowing.
10673 * character.h (FETCH_STRING_CHAR_AS_MULTIBYTE_ADVANCE):
10674 (PREV_CHAR_BOUNDARY): Likewise.
10675
10676 * search.c (simple_search): Remove unused var.
10677
10678 * dired.c (compile_pattern): Move decl from here ...
10679 * lisp.h: ... to here, so that it can be checked.
10680 (struct re_registers): New forward decl.
10681
10682 * character.h (INC_POS, DEC_POS): Rename locals to avoid shadowing.
10683
10684 * indent.c (MULTIBYTE_BYTES_WIDTH): New args bytes, width.
10685 All uses changed.
10686 (MULTIBYTE_BYTES_WIDTH, scan_for_column, compute_motion):
10687 Rename locals to avoid shadowing.
10688 (Fvertical_motion): Mark locals as initialized.
10689
10690 * casefiddle.c (casify_object, casify_region): Now static.
10691 (casify_region): Mark local as initialized.
10692
10693 * cmds.c (internal_self_insert): Rename local to avoid shadowing.
10694
10695 * lisp.h (GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR, GCPRO5_VAR, GCPRO6_VAR):
10696 New macros, so that the caller can use some names other than
10697 gcpro1, gcpro2, etc.
10698 (GCPRO2, GCPRO3, GCPRO4, GCPRO5, GCPRO6): Reimplement in terms
10699 of the new macros.
10700 (GCPRO1_VAR, UNGCPRO_VAR): Change the meaning of the second
10701 argument, for consistency with GCPRO2_VAR, etc: it is now the
10702 prefix of the variable, not the variable itself. All uses
10703 changed.
10704 * dired.c (directory_files_internal, file_name_completion):
10705 Rename locals to avoid shadowing.
10706
10707 Fix a race condition diagnosed by gcc -Wsequence-point (Bug#8254).
10708 An expression of the form (DOWNCASE (x) == DOWNCASE (y)), found in
10709 dired.c's scmp function, had undefined behavior.
10710 * lisp.h (DOWNCASE_TABLE, UPCASE_TABLE, DOWNCASE, UPPERCASEP):
10711 (NOCASEP, LOWERCASEP, UPCASE, UPCASE1): Move from here ...
10712 * buffer.h: ... to here, because these macros use current_buffer,
10713 and the new implementation with inline functions needs to have
10714 current_buffer in scope now, rather than later when the macros
10715 are used.
10716 (downcase, upcase1): New static inline functions.
10717 (DOWNCASE, UPCASE1): Reimplement using these functions.
10718 This avoids undefined behavior in expressions like
10719 DOWNCASE (x) == DOWNCASE (y), which previously suffered
10720 from race conditions in accessing the global variables
10721 case_temp1 and case_temp2.
10722 * casetab.c (case_temp1, case_temp2): Remove; no longer needed.
10723 * lisp.h (case_temp1, case_temp2): Remove their decls.
10724 * character.h (ASCII_CHAR_P): Move from here ...
10725 * lisp.h: ... to here, so that the inline functions mentioned
10726 above can use them.
10727
10728 * dired.c (directory_files_internal_unwind): Now static.
10729
10730 * fileio.c (file_name_as_directory, directory_file_name):
10731 (barf_or_query_if_file_exists, auto_save_error, auto_save_1):
10732 Now static.
10733 (file_name_as_directory): Use const pointers when appropriate.
10734 (Fexpand_file_name): Likewise. In particular, newdir might
10735 point at constant storage, so make it a const pointer.
10736 (Fmake_directory_internal, Fread_file_name): Remove unused vars.
10737 (Ffile_selinux_context, Fset_file_selinux_context): Fix pointer
10738 signedness issues.
10739 (Fset_file_times, Finsert_file_contents, auto_save_error):
10740 Rename locals to avoid shadowing.
10741
10742 * minibuf.c (choose_minibuf_frame_1): Now static.
10743 (Ftry_completion, Fall_completions): Rename or remove locals
10744 to avoid shadowing.
10745
10746 * marker.c (bytepos_to_charpos): Remove; unused.
10747
10748 * lisp.h (verify_bytepos, count_markers): New decls,
10749 so that gcc does not warn that these functions aren't declared.
10750
10751 * insdel.c (check_markers, make_gap_larger, make_gap_smaller):
10752 (reset_var_on_error, Fcombine_after_change_execute_1): Now static.
10753 (CHECK_MARKERS): Redo to avoid gcc -Wempty-body diagnostic.
10754 (copy_text): Remove unused local var.
10755
10756 * filelock.c (within_one_second): Now static.
10757 (lock_file_1): Rename local to avoid shadowing.
10758
10759 * buffer.c (fix_overlays_before): Mark locals as initialized.
10760 (fix_start_end_in_overlays): Likewise. This function should be
10761 simplified by using pointers-to-pointers, but that's a different
10762 matter.
10763 (switch_to_buffer_1): Now static.
10764 (Fkill_buffer, record_buffer, Fbury_buffer, Fset_buffer_multibyte):
10765 (report_overlay_modification): Rename locals to avoid shadowing.
10766
10767 * sysdep.c (system_process_attributes): Rename vars to avoid shadowing.
10768 Fix pointer signedness issue.
10769 (sys_subshell): Mark local as volatile if checking for lint,
10770 to suppress a gcc -Wclobbered warning that does not seem to be right.
10771 (MAXPATHLEN): Define only if needed.
10772
10773 * process.c (serial_open, serial_configure): Move decls from here ...
10774 * systty.h: ... to here, so that they can be checked.
10775
10776 * fns.c (get_random, seed_random): Move extern decls from here ...
10777 * lisp.h: ... to here, so that they can be checked.
10778
10779 * sysdep.c (reset_io): Now static.
10780 (wait_for_termination_signal): Remove; unused.
10781
10782 * keymap.c (keymap_parent, keymap_memberp, map_keymap_internal):
10783 (copy_keymap_item, append_key, push_text_char_description):
10784 Now static.
10785 (Fwhere_is_internal): Don't test CONSP (sequences) unnecessarily.
10786 (DENSE_TABLE_SIZE): Remove; unused.
10787 (get_keymap, access_keymap, Fdefine_key, Fwhere_is_internal):
10788 (describe_map_tree):
10789 Rename locals to avoid shadowing.
10790
10791 * keyboard.c: Declare functions static if they are not used elsewhere.
10792 (echo_char, echo_dash, cmd_error, top_level_2):
10793 (poll_for_input, handle_async_input): Now static.
10794 (read_char, kbd_buffer_get_event, make_lispy_position):
10795 (make_lispy_event, make_lispy_movement, apply_modifiers):
10796 (decode_keyboard_code, tty_read_avail_input, menu_bar_items):
10797 (parse_tool_bar_item, read_key_sequence, Fread_key_sequence):
10798 (Fread_key_sequence_vector): Rename locals to avoid shadowing.
10799 (read_key_sequence, read_char): Mark locals as initialized.
10800 (Fexit_recursive_edit, Fabort_recursive_edit): Mark with NO_RETURN.
10801
10802 * keyboard.h (make_ctrl_char): New decl.
10803 (mark_kboards): Move decl here ...
10804 * alloc.c (mark_kboards): ... from here.
10805
10806 * lisp.h (force_auto_save_soon): New decl.
10807
10808 * emacs.c (init_cmdargs): Rename local to avoid shadowing.
10809 (DEFINE_DUMMY_FUNCTION): New macro.
10810 (__do_global_ctors, __do_global_ctors_aux, __do_global_dtors, __main):
10811 Use it.
10812 (main): Add casts to avoid warnings
10813 if GCC considers string literals to be constants.
10814
10815 * lisp.h (fatal_error_signal): Add decl, since it's exported.
10816
10817 * dbusbind.c: Pointer signedness fixes.
10818 (xd_signature, xd_append_arg, xd_initialize):
10819 (Fdbus_call_method, Fdbus_call_method_asynchronously):
10820 (Fdbus_method_return_internal, Fdbus_method_error_internal):
10821 (Fdbus_send_signal, xd_read_message_1, Fdbus_register_service):
10822 (Fdbus_register_signal): Use SSDATA when the context wants char *.
10823
10824 * dbusbind.c (Fdbus_init_bus): Add cast to avoid warning
10825 if GCC considers string literals to be constants.
10826 (Fdbus_register_service, Fdbus_register_method): Remove unused vars.
10827
10828 2011-03-16 Stefan Monnier <monnier@iro.umontreal.ca>
10829
10830 * print.c (PRINT_CIRCLE_CANDIDATE_P): New macro.
10831 (print_preprocess, print_object): New macro to fix last change.
10832
10833 * print.c (print_preprocess): Don't forget font objects.
10834
10835 2011-03-16 Juanma Barranquero <lekktu@gmail.com>
10836
10837 * emacs.c (USAGE3): Doc fixes.
10838
10839 2011-03-15 Andreas Schwab <schwab@linux-m68k.org>
10840
10841 * coding.c (detect_coding_iso_2022): Reorganize code to clarify
10842 structure.
10843
10844 2011-03-14 Juanma Barranquero <lekktu@gmail.com>
10845
10846 * lisp.h (VWindow_system, Qfile_name_history):
10847 * keyboard.h (lispy_function_keys) [WINDOWSNT]:
10848 * w32term.h (w32_system_caret_hwnd, w32_system_caret_height)
10849 (w32_system_caret_x, w32_system_caret_y): Declare extern.
10850
10851 * w32select.c: Don't #include "keyboard.h".
10852 (run_protected): Add extern declaration for waiting_for_input.
10853
10854 * w32.c (Qlocal, noninteractive1, inhibit_window_system):
10855 * w32console.c (detect_input_pending, read_input_pending)
10856 (encode_terminal_code):
10857 * w32fns.c (quit_char, lispy_function_keys, Qtooltip)
10858 (w32_system_caret_hwnd, w32_system_caret_height, w32_system_caret_x)
10859 (w32_system_caret_y, Qfile_name_history):
10860 * w32font.c (w32font_driver, QCantialias, QCotf, QClang):
10861 * w32inevt.c (reinvoke_input_signal, lispy_function_keys):
10862 * w32menu.c (Qmenu_bar, QCtoggle, QCradio, Qoverriding_local_map)
10863 (Qoverriding_terminal_local_map, Qmenu_bar_update_hook):
10864 * w32proc.c (Qlocal, report_file_error):
10865 * w32term.c (Vwindow_system, updating_frame):
10866 * w32uniscribe.c (initialized, uniscribe_font_driver):
10867 Remove unneeded extern declarations.
10868
10869 2011-03-14 Chong Yidong <cyd@stupidchicken.com>
10870
10871 * buffer.c (Fmake_indirect_buffer): Fix incorrect assertions.
10872
10873 2011-03-13 Chong Yidong <cyd@stupidchicken.com>
10874
10875 * buffer.h (BUF_BEGV, BUF_BEGV_BYTE, BUF_ZV, BUF_ZV_BYTE, BUF_PT)
10876 (BUF_PT_BYTE): Rewrite to handle indirect buffers (Bug#8219).
10877 These macros can no longer be used for assignment.
10878
10879 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer):
10880 Assign struct members directly, instead of using BUF_BEGV etc.
10881 (record_buffer_markers, fetch_buffer_markers): New functions for
10882 recording and fetching special buffer markers.
10883 (set_buffer_internal_1, set_buffer_temp): Use them.
10884
10885 * lread.c (unreadchar): Use SET_BUF_PT_BOTH.
10886
10887 * insdel.c (adjust_point): Use SET_BUF_PT_BOTH.
10888
10889 * intervals.c (temp_set_point_both): Use SET_BUF_PT_BOTH.
10890 (get_local_map): Use SET_BUF_BEGV_BOTH and SET_BUF_ZV_BOTH.
10891
10892 * xdisp.c (hscroll_window_tree):
10893 (reconsider_clip_changes): Use PT instead of BUF_PT.
10894
10895 2011-03-13 Eli Zaretskii <eliz@gnu.org>
10896
10897 * makefile.w32-in ($(BLD)/editfns.$(O)): Depend on
10898 $(EMACS_ROOT)/lib/intprops.h.
10899
10900 2011-03-13 Paul Eggert <eggert@cs.ucla.edu>
10901
10902 Fix more problems found by GCC 4.5.2's static checks.
10903
10904 * gtkutil.c (xg_get_pixbuf_from_pixmap): Add cast from char *
10905 to unsigned char * to avoid compiler diagnostic.
10906 (xg_free_frame_widgets): Make it clear that a local variable is
10907 needed only if USE_GTK_TOOLTIP.
10908 (gdk_window_get_screen): Make it clear that this macro is needed
10909 only if USE_GTK_TOOLTIP.
10910 (int_gtk_range_get_value): New function, which avoids a diagnostic
10911 from gcc -Wbad-function-cast.
10912 (xg_set_toolkit_scroll_bar_thumb): Use it.
10913 (xg_tool_bar_callback, xg_tool_item_stale_p): Rewrite to avoid
10914 diagnostic from gcc -Wbad-function-cast.
10915 (get_utf8_string, xg_get_file_with_chooser):
10916 Rename locals to avoid shadowing.
10917 (create_dialog): Move locals to avoid shadowing.
10918
10919 * xgselect.c (xg_select): Remove unused var.
10920
10921 * image.c (four_corners_best): Mark locals as initialized.
10922 (gif_load): Initialize transparent_p to zero (Bug#8238).
10923 Mark another local as initialized.
10924 (my_png_error, my_error_exit): Mark with NO_RETURN.
10925
10926 * image.c (clear_image_cache): Now static.
10927 (DIM, HAVE_STDLIB_H_1): Remove unused macros.
10928 (xpm_load): Redo to avoid "discards qualifiers" gcc warning.
10929 (x_edge_detection): Remove unnecessary cast that
10930 gcc -Wbad-function-cast diagnoses.
10931 (gif_load): Fix pointer signedness.
10932 (clear_image_cache, xbm_read_bitmap_data, x_detect_edges):
10933 (jpeg_load, gif_load): Rename locals to avoid shadowing.
10934
10935 2011-03-12 Paul Eggert <eggert@cs.ucla.edu>
10936
10937 Improve quality of tests for time stamp overflow.
10938 For example, without this patch (encode-time 0 0 0 1 1
10939 1152921504606846976) returns the obviously-bogus value (-948597
10940 62170) on my RHEL 5.5 x86-64 host. With the patch, it correctly
10941 reports time overflow. See
10942 <http://lists.gnu.org/archive/html/emacs-devel/2011-03/msg00470.html>.
10943 * deps.mk (editfns.o): Depend on ../lib/intprops.h.
10944 * editfns.c: Include limits.h and intprops.h.
10945 (TIME_T_MIN, TIME_T_MAX): New macros.
10946 (time_overflow): Move earlier, to before first use.
10947 (hi_time, lo_time): New functions, for an accurate test for
10948 out-of-range times.
10949 (Fcurrent_time, Fget_internal_run_time, make_time): Use them.
10950 (Fget_internal_run_time): Don't assume time_t fits in int.
10951 (make_time): Use list2 instead of Fcons twice.
10952 (Fdecode_time): More accurate test for out-of-range times.
10953 (check_tm_member): New function.
10954 (Fencode_time): Use it, to test for out-of-range times.
10955 (lisp_time_argument): Don't rely on undefined left-shift and
10956 right-shift behavior when checking for time stamp overflow.
10957
10958 * editfns.c (time_overflow): New function, refactoring common code.
10959 (Fformat_time_string, Fdecode_time, Fencode_time):
10960 (Fcurrent_time_string): Use it.
10961
10962 Move 'make_time' to be next to its inverse 'lisp_time_argument'.
10963 * dired.c (make_time): Move to ...
10964 * editfns.c (make_time): ... here.
10965 * systime.h: Note the move.
10966
10967 2011-03-12 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
10968
10969 * fringe.c (update_window_fringes): Remove unused variables.
10970
10971 * unexmacosx.c (copy_data_segment): Also copy __got section.
10972 (Bug#8223)
10973
10974 2011-03-12 Eli Zaretskii <eliz@gnu.org>
10975
10976 * termcap.c [MSDOS]: Include "msdos.h".
10977 (find_capability, tgetnum, tgetflag, tgetstr, tputs, tgetent):
10978 Constify `char *' arguments and their references according to
10979 prototypes in tparam.h.
10980
10981 * deps.mk (termcap.o): Depend on tparam.h and msdos.h.
10982
10983 * msdos.c (XMenuAddPane): 3rd argument is `const char *' now.
10984 Adapt all references accordingly.
10985
10986 * msdos.h (XMenuAddPane): 3rd argument is `const char *' now.
10987
10988 2011-03-11 Tom Tromey <tromey@redhat.com>
10989
10990 * buffer.c (syms_of_buffer): Remove obsolete comment.
10991
10992 2011-03-11 Eli Zaretskii <eliz@gnu.org>
10993
10994 * termhooks.h (encode_terminal_code): Declare prototype.
10995
10996 * msdos.c (encode_terminal_code): Don't declare prototype.
10997
10998 * term.c (encode_terminal_code): Now external again, used by
10999 w32console.c and msdos.c.
11000
11001 * makefile.w32-in ($(BLD)/term.$(O), ($(BLD)/tparam.$(O)):
11002 Depend on $(SRC)/tparam.h, see 2011-03-11T07:24:21Z!eggert@cs.ucla.edu.
11003
11004 2011-03-11 Paul Eggert <eggert@cs.ucla.edu>
11005
11006 Fix some minor problems found by GCC 4.5.2's static checks.
11007
11008 * fringe.c (update_window_fringes): Mark locals as initialized
11009 (Bug#8227).
11010 (destroy_fringe_bitmap, init_fringe_bitmap): Now static.
11011
11012 * alloc.c (mark_fringe_data): Move decl from here ...
11013 * lisp.h (mark_fringe_data) [HAVE_WINDOW_SYSTEM]: ... to here,
11014 to check its interface.
11015 (init_fringe_once): Do not declare unless HAVE_WINDOW_SYSTEM.
11016
11017 * fontset.c (free_realized_fontset): Now static.
11018 (Fset_fontset_font): Rename local to avoid shadowing.
11019 (fontset_font): Mark local as initialized.
11020 (FONTSET_SPEC, FONTSET_REPERTORY, RFONT_DEF_REPERTORY): Remove; unused.
11021
11022 * xrdb.c: Include "xterm.h", to check x_load_resources's interface.
11023
11024 * xselect.c (x_disown_buffer_selections): Remove; not used.
11025 (TRACE3) [!defined TRACE_SELECTION]: Remove; not used.
11026 (x_own_selection, Fx_disown_selection_internal): Rename locals
11027 to avoid shadowing.
11028 (x_handle_dnd_message): Remove local to avoid shadowing.
11029
11030 * lisp.h (GCPRO1_VAR, UNGCPRO_VAR): New macros,
11031 so that the caller can use some name other than gcpro1.
11032 (GCPRO1, UNGCPRO): Reimplement in terms of the new macros.
11033 * xfns.c (Fx_create_frame, x_create_tip_frame, Fx_show_tip):
11034 (Fx_backspace_delete_keys_p):
11035 Use them to avoid shadowing, and rename vars to avoid shadowing.
11036 (x_decode_color, x_set_name, x_window): Now static.
11037 (Fx_create_frame): Add braces to silence GCC warning.
11038 (Fx_file_dialog, Fx_select_font): Fix pointer signedness.
11039 (x_real_positions, xg_set_icon_from_xpm_data, x_create_tip_frame):
11040 Remove unused locals.
11041 (Fx_create_frame, x_create_tip_frame, Fx_show_tip):
11042 (Fx_backspace_delete_keys_p): Rename locals to avoid shadowing.
11043 Some of these renamings use the new GCPRO1_VAR and UNGCPRO_VAR
11044 macros.
11045
11046 * xterm.h (x_mouse_leave): New decl.
11047
11048 * xterm.c (x_copy_dpy_color, x_focus_on_frame, x_unfocus_frame):
11049 Remove unused functions.
11050 (x_shift_glyphs_for_insert, XTflash, XTring_bell):
11051 (x_calc_absolute_position): Now static.
11052 (XTread_socket): Don't define label "out" unless it's used.
11053 Don't declare local "event" unless it's used.
11054 (x_iconify_frame, x_free_frame_resources): Don't declare locals
11055 unless they are used.
11056 (XEMBED_VERSION, xembed_set_info): Don't define unless needed.
11057 (x_fatal_error_signal): Remove; not used.
11058 (x_draw_image_foreground, redo_mouse_highlight, XTmouse_position):
11059 (x_scroll_bar_report_motion, handle_one_xevent, x_draw_bar_cursor):
11060 (x_error_catcher, x_connection_closed, x_error_handler):
11061 (x_error_quitter, xembed_send_message, x_iconify_frame):
11062 (my_log_handler): Rename locals to avoid shadowing.
11063 (x_delete_glyphs, x_ins_del_lines): Mark with NO_RETURN.
11064 (x_connection_closed): Tell GCC not to suggest NO_RETURN.
11065
11066 * xfaces.c (clear_face_cache, Fx_list_fonts, Fface_font):
11067 Rename or move locals to avoid shadowing.
11068 (tty_defined_color, merge_face_heights): Now static.
11069 (free_realized_faces_for_fontset): Remove; not used.
11070 (Fx_list_fonts): Mark variable that gcc -Wuninitialized
11071 does not deduce is never used uninitialized.
11072 (STRDUPA, LSTRDUPA, FONT_POINT_SIZE_QUANTUM): Remove; not used.
11073 (LFACEP): Define only if XASSERTS, as it's not needed otherwise.
11074
11075 * terminal.c (store_terminal_param): Now static.
11076
11077 * xmenu.c (menu_highlight_callback): Now static.
11078 (set_frame_menubar): Remove unused local.
11079 (xmenu_show): Rename parameter to avoid shadowing.
11080 (xmenu_show, xdialog_show, xmenu_show): Make local pointers "const"
11081 since they might point to immutable storage.
11082 (next_menubar_widget_id): Declare only if USE_X_TOOLKIT,
11083 since it's unused otherwise.
11084
11085 * xdisp.c (produce_glyphless_glyph): Initialize lower_xoff.
11086 Add a FIXME, since the code still doesn't look right. (Bug#8215)
11087 (Fcurrent_bidi_paragraph_direction): Simplify slightly; this
11088 avoids a gcc -Wuninitialized diagnostic.
11089 (display_line, BUILD_COMPOSITE_GLYPH_STRING, draw_glyphs):
11090 (note_mouse_highlight): Mark variables that gcc -Wuninitialized
11091 does not deduce are never used uninitialized.
11092
11093 * lisp.h (IF_LINT): New macro, copied from ../lib-src/emacsclient.c.
11094
11095 * xdisp.c (redisplay_window): Rename local to avoid shadowing.
11096 * window.c (window_loop, size_window):
11097 (run_window_configuration_change_hook, enlarge_window): Likewise.
11098
11099 * window.c (display_buffer): Now static.
11100 (size_window): Mark variables that gcc -Wuninitialized
11101 does not deduce are never used uninitialized.
11102 * window.h (check_all_windows): New decl, to forestall
11103 gcc -Wmissing-prototypes diagnostic.
11104 * dispextern.h (bidi_dump_cached_states): Likewise.
11105
11106 * charset.h (CHECK_CHARSET_GET_CHARSET): Rename locals to avoid
11107 shadowing.
11108 * charset.c (map_charset_for_dump, Fchar_charset): Likewise.
11109 Include <limits.h>.
11110 (Fsort_charsets): Redo min/max calculation to shorten the code a bit
11111 and to avoid gcc -Wuninitialized warning.
11112 (load_charset_map): Mark variables that gcc -Wuninitialized
11113 does not deduce are never used uninitialized.
11114 (load_charset): Abort instead of using uninitialized var (Bug#8229).
11115
11116 * coding.c (coding_set_source, coding_set_destination):
11117 Use "else { /* comment */ }" rather than "else /* comment */;"
11118 for clarity, and to avoid gcc -Wempty-body warning.
11119 (Fdefine_coding_system_internal): Don't redeclare 'i' inside
11120 a block, when the outer 'i' will do.
11121 (decode_coding_utf_8, decode_coding_utf_16, detect_coding_emacs_mule):
11122 (emacs_mule_char, decode_coding_emacs_mule, detect_coding_iso_2022):
11123 (decode_coding_iso_2022, decode_coding_sjis, decode_coding_big5):
11124 (decode_coding_raw_text, decode_coding_charset, get_translation_table):
11125 (Fdecode_sjis_char, Fdefine_coding_system_internal):
11126 Rename locals to avoid shadowing.
11127 * character.h (FETCH_STRING_CHAR_ADVANCE): Likewise.
11128 * coding.c (emacs_mule_char, encode_invocation_designation):
11129 Now static, since they're not used elsewhere.
11130 (decode_coding_iso_2022): Add "default: abort ();" as a safety check.
11131 (decode_coding_object, encode_coding_object, detect_coding_system):
11132 (decode_coding_emacs_mule): Mark variables that gcc
11133 -Wuninitialized does not deduce are never used uninitialized.
11134 (detect_coding_iso_2022): Initialize a local variable that might
11135 be used uninitialized. Leave a FIXME because it's not clear that
11136 this initialization is needed. (Bug#8211)
11137 (ISO_CODE_LF, ISO_CODE_CR, CODING_ISO_FLAG_EUC_TW_SHIFT):
11138 (ONE_MORE_BYTE_NO_CHECK, UTF_BOM, UTF_16_INVALID_P):
11139 (SHIFT_OUT_OK, ENCODE_CONTROL_SEQUENCE_INTRODUCER):
11140 (ENCODE_DIRECTION_R2L, ENCODE_DIRECTION_L2R):
11141 Remove unused macros.
11142
11143 * category.c (hash_get_category_set): Remove unused local var.
11144 (copy_category_table): Now static, since it's not used elsewhere.
11145 * character.c (string_count_byte8): Likewise.
11146
11147 * ccl.c (CCL_WRITE_STRING, CCL_ENCODE_CHAR, Fccl_execute_on_string):
11148 (Fregister_code_conversion_map): Rename locals to avoid shadowing.
11149
11150 * chartab.c (copy_sub_char_table): Now static, since it's not used
11151 elsewhere.
11152 (sub_char_table_ref_and_range, char_table_ref_and_range):
11153 Rename locals to avoid shadowing.
11154 (ASET_RANGE, GET_SUB_CHAR_TABLE): Remove unused macros.
11155
11156 * bidi.c (bidi_check_type): Now static, since it's not used elsewhere.
11157 (BIDI_BOB): Remove unused macro.
11158
11159 * cm.c (cmgoto): Mark variables that gcc -Wuninitialized does not
11160 deduce are never used uninitialized.
11161 * term.c (encode_terminal_code): Likewise.
11162
11163 * term.c (encode_terminal_code): Now static. Remove unused local.
11164
11165 * tparam.h: New file.
11166 * term.c, tparam.h: Include it.
11167 * deps.mk (term.o, tparam.o): Depend on tparam.h.
11168 * term.c (tputs, tgetent, tgetflag, tgetnum, tparam, tgetstr):
11169 Move these decls to tparam.h, and make them agree with what
11170 is actually in tparam.c. The previous trick of using incompatible
11171 decls in different modules does not conform to the C standard.
11172 All callers of tparam changed to use tparam's actual API.
11173 * tparam.c (tparam1, tparam, tgoto):
11174 Use const pointers where appropriate.
11175
11176 * cm.c (calccost, cmgoto): Use const pointers where appropriate.
11177 * cm.h (struct cm): Likewise.
11178 * dispextern.h (do_line_insertion_deletion_costs): Likewise.
11179 * scroll.c (ins_del_costs, do_line_insertion_deletion_costs): Likewise.
11180 * term.c (tty_ins_del_lines, calculate_costs, struct fkey_table):
11181 (term_get_fkeys_1, append_glyphless_glyph, produce_glyphless_glyph):
11182 (turn_on_face, init_tty): Likewise.
11183 * termchar.h (struct tty_display_info): Likewise.
11184
11185 * term.c (term_mouse_position): Rename local to avoid shadowing.
11186
11187 * alloc.c (mark_ttys): Move decl from here ...
11188 * lisp.h (mark_ttys): ... to here, so that it's checked against defn.
11189
11190 2011-03-11 Andreas Schwab <schwab@linux-m68k.org>
11191
11192 * .gdbinit (pwinx, xbuffer): Fix access to buffer name.
11193
11194 2011-03-09 Juanma Barranquero <lekktu@gmail.com>
11195
11196 * search.c (compile_pattern_1): Remove argument regp, unused since
11197 revid:rms@gnu.org-19941211082627-3x1g1wyqkjmwloig.
11198 (compile_pattern): Don't pass it.
11199
11200 2011-03-08 Jan Djärv <jan.h.d@swipnet.se>
11201
11202 * xterm.h (DEFAULT_GDK_DISPLAY): New define.
11203 (GDK_WINDOW_XID, gtk_widget_get_preferred_size): New defines
11204 for ! HAVE_GTK3.
11205 (GTK_WIDGET_TO_X_WIN): Use GDK_WINDOW_XID.
11206
11207 * xmenu.c (menu_position_func): Call gtk_widget_get_preferred_size.
11208
11209 * gtkutil.c: Include gtkx.h if HAVE_GTK3. If ! HAVE_GTK3, define
11210 gdk_window_get_screen, gdk_window_get_geometry,
11211 gdk_x11_window_lookup_for_display and GDK_KEY_g.
11212 (xg_set_screen): Use DEFAULT_GDK_DISPLAY.
11213 (xg_get_pixbuf_from_pixmap): New function.
11214 (xg_get_pixbuf_from_pix_and_mask): Change parameters from GdkPixmap
11215 to Pixmap, take frame as parameter, remove GdkColormap parameter.
11216 Call xg_get_pixbuf_from_pixmap instead of
11217 gdk_pixbuf_get_from_drawable.
11218 (xg_get_image_for_pixmap): Do not make GdkPixmaps, call
11219 xg_get_pixbuf_from_pix_and_mask with Pixmap parameters instead.
11220 (xg_check_special_colors): Use GtkStyleContext and its functions
11221 for HAVE_GTK3.
11222 (xg_prepare_tooltip, xg_hide_tooltip): Call gdk_window_get_screen.
11223 (xg_prepare_tooltip, create_dialog, menubar_map_cb)
11224 (xg_update_frame_menubar, xg_tool_bar_detach_callback)
11225 (xg_tool_bar_attach_callback, xg_update_tool_bar_sizes):
11226 Call gtk_widget_get_preferred_size.
11227 (xg_frame_resized): gdk_window_get_geometry only takes 5
11228 parameters.
11229 (xg_win_to_widget, xg_event_is_for_menubar):
11230 Call gdk_x11_window_lookup_for_display.
11231 (xg_set_widget_bg): New function.
11232 (delete_cb): New function.
11233 (xg_create_frame_widgets): Connect delete-event to delete_cb.
11234 Call xg_set_widget_bg. Only set background pixmap for ! HAVE_GTK3
11235 (xg_set_background_color): Call xg_set_widget_bg.
11236 (xg_set_frame_icon): Call xg_get_pixbuf_from_pix_and_mask.
11237 (xg_create_scroll_bar): vadj is a GtkAdjustment for HAVE_GTK3.
11238 Only call gtk_range_set_update_policy if ! HAVE_GTK3.
11239 (xg_make_tool_item): Only connect xg_tool_bar_item_expose_callback
11240 if ! HAVE_GTK3.
11241 (update_frame_tool_bar): Call gtk_widget_hide.
11242 (xg_initialize): Use GDK_KEY_g.
11243
11244 * xsmfns.c (gdk_set_sm_client_id): Define to gdk_set_sm_client_id
11245 if ! HAVE_GTK3
11246 (x_session_initialize): Call gdk_x11_set_sm_client_id.
11247
11248 * xterm.c (XFillRectangle): Use cairo routines for HAVE_GTK3.
11249 (x_term_init): Disable Xinput(2) with GDK_CORE_DEVICE_EVENTS.
11250 Load ~/emacs.d/gtkrc only for ! HAVE_GTK3.
11251
11252 2011-03-08 Juanma Barranquero <lekktu@gmail.com>
11253
11254 * w32xfns.c (select_palette): Check success of RealizePalette against
11255 GDI_ERROR, not zero.
11256
11257 See ChangeLog.11 for earlier changes.
11258
11259 ;; Local Variables:
11260 ;; coding: utf-8
11261 ;; End:
11262
11263 Copyright (C) 2011-2012 Free Software Foundation, Inc.
11264
11265 This file is part of GNU Emacs.
11266
11267 GNU Emacs is free software: you can redistribute it and/or modify
11268 it under the terms of the GNU General Public License as published by
11269 the Free Software Foundation, either version 3 of the License, or
11270 (at your option) any later version.
11271
11272 GNU Emacs is distributed in the hope that it will be useful,
11273 but WITHOUT ANY WARRANTY; without even the implied warranty of
11274 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11275 GNU General Public License for more details.
11276
11277 You should have received a copy of the GNU General Public License
11278 along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.