Fix ChangeLog entry by negating its 1st sentence.
[bpt/emacs.git] / src / ChangeLog
CommitLineData
471fe23d
TN
12012-05-29 Troels Nielsen <bn.troels@gmail.com>
2
934f3f58 3 Do not create empty overlays with the evaporate property (Bug#9642).
471fe23d
TN
4 * buffer.c (Fmove_overlay): Reinstate the earlier fix for
5 Bug#9642, but explicitly check that the buffer the overlay would
6 be moved to is live and rearrange lines to make sure that errors
7 will not put the overlay in an inconsistent state.
8 (Fdelete_overlay): Cosmetics.
9
85d0efd1
EZ
102012-05-28 Eli Zaretskii <eliz@gnu.org>
11
12 * w32term.c (my_bring_window_to_top): New function.
13 (x_raise_frame): Use handle returned by DeferWindowPos, which
14 could be different from the original one. Call
15 my_bring_window_to_top instead of my_set_foreground_window.
16 (Bug#11513)
17
18 * w32fns.c (w32_wnd_proc): Accept and process WM_EMACS_BRINGTOTOP
19 by calling BringWindowToTop.
20
21 * w32term.h (WM_EMACS_BRINGTOTOP): New message.
22 (WM_EMACS_END): Increase by one.
23
da92a98c
PE
242012-05-28 Paul Eggert <eggert@cs.ucla.edu>
25
26 * bidi.c (bidi_mirror_char): Put eassert before conversion to int.
27 This avoids undefined behavior that might cause the eassert
28 to not catch an out-of-range value.
29
74d1f848
JB
302012-05-28 Juanma Barranquero <lekktu@gmail.com>
31
32 * makefile.w32-in ($(BLD)/w32inevt.$(O), $(BLD)/w32console.$(O)):
33 Update dependencies.
34
9e1a06fc
EZ
352012-05-27 Eli Zaretskii <eliz@gnu.org>
36
37 * bidi.c (bidi_mirror_char): Fix last change.
38
f3dd7312
AS
392012-05-27 Andreas Schwab <schwab@linux-m68k.org>
40
41 * unexmacosx.c (copy_data_segment): Truncate after 16 characters
42 when referring to sectname field in printf format.
43
81899c91
PE
442012-05-27 Paul Eggert <eggert@cs.ucla.edu>
45
57b81a9f
PE
46 * lisp.h [REL_ALLOC]: Omit duplicate prototypes.
47 Only r_alloc_inhibit_buffer_relocation needed to be added;
48 the others were already declared.
49
81899c91
PE
50 * bidi.c (bidi_mirror_char): Don't possibly truncate the integer
51 before checking whether it's out of range. Put the check inside
52 eassert. See
53 <http://lists.gnu.org/archive/html/emacs-devel/2012-05/msg00485.html>.
54
33017faf 552012-05-27 Ken Brown <kbrown@cornell.edu>
2f9b9adb
KB
56
57 * callproc.c (Fcall_process): Restore a line that was accidentally
58 commented out in the 2011-02-13 change (bug#11547).
59
33017faf 602012-05-27 Eli Zaretskii <eliz@gnu.org>
52c55cc7
EZ
61
62 * lisp.h [REL_ALLOC]: Add prototypes for external functions
63 defined on ralloc.c.
64
65 * buffer.c [REL_ALLOC]: Remove prototypes of
66 r_alloc_reset_variable, r_alloc, r_re_alloc, and r_alloc_free,
67 they are now on lisp.h.
68
69 * ralloc.c (r_alloc_inhibit_buffer_relocation): New function.
70
71 * search.c (search_buffer): Use it to inhibit relocation of buffer
72 text while re_search_2 is doing its job, because re_search_2 is
73 passed C pointers to buffer text. (Bug#11519)
74
23415acf
EZ
75 * msdos.c (internal_terminal_init) <Vwindow_system_version>:
76 Update value to 24.
77
44e27368
EZ
78 * xdisp.c (move_it_to): Under MOVE_TO_Y, when restoring iterator
79 state after an additional call to move_it_in_display_line_to, keep
80 the values of it->max_ascent and it->max_descent found for the
81 entire line.
82 (pos_visible_p): Revert the comparison against bottom_y to what it
83 was in revid eliz@gnu.org-20120513182235-4p6386j761ld0nwb.
84 (Bug#11464)
85
c1892f11
PE
862012-05-26 Paul Eggert <eggert@cs.ucla.edu>
87
88 Fix coding-related core dumps with gcc -ftrapv.
89 The code was computing A - B, where A and B are pointers, and B is
90 random garbage. This can lead to core dumps on platforms that
91 have special pointer registers, and it also leads to core dumps on
92 x86-64 when compiled with gcc -ftrapv. The fix is to compute
93 A - B only when B is initialized properly.
94 * coding.c (coding_set_source, coding_set_destination): Return void.
95 (coding_change_source, coding_change_destinations): New functions,
96 with the old behaviors of coding_set_source and coding_set_destination.
97 All callers that need an offset changed to use these new functions.
98
eb7afdad
GM
992012-05-26 Glenn Morris <rgm@gnu.org>
100
101 * nsterm.m (ns_init_paths): Don't mess with INFOPATH. (Bug#2791)
102
f12fdf02
EZ
1032012-05-26 Eli Zaretskii <eliz@gnu.org>
104
53a63be6 105 Extend mouse support on W32 text-mode console.
eb3f6f01
EZ
106 * xdisp.c (draw_row_with_mouse_face): Call
107 tty_draw_row_with_mouse_face for WINDOWSNT as well.
108
eb3f6f01
EZ
109 * w32console.c: Include window.h.
110 (w32con_write_glyphs_with_face, tty_draw_row_with_mouse_face): New
111 functions.
112 (initialize_w32_display): Initialize mouse-highlight data.
113
53a63be6
EZ
114 * w32inevt.c: Include termchar.h and window.h.
115 (do_mouse_event): Support mouse-autoselect-window. When the mouse
116 moves, call note_mouse_highlight. If help_echo changed, call
117 gen_help_event to produce help-echo message in the echo area.
118 Call clear_mouse_face if mouse_face_hidden is set in the mouse
119 highlight info.
120
4cfd81f6
PE
1212012-05-26 Paul Eggert <eggert@cs.ucla.edu>
122
123 * lread.c (read1): Simplify slightly to avoid an overflow warning
124 with GCC 4.7.0 on x86-64.
125
4446092a
EZ
1262012-05-26 Eli Zaretskii <eliz@gnu.org>
127
128 * bidi.c (bidi_mirror_char): Revert last change: an int is
129 definitely wide enough here.
130
42b2a986 1312012-05-25 Paul Eggert <eggert@cs.ucla.edu>
3164aeac 132
42b2a986 133 Fix integer width and related bugs (Bug#9874).
eb106a49 134 * alloc.c (pure_bytes_used_lisp, pure_bytes_used_non_lisp):
d311d28c
PE
135 (allocate_vectorlike, buffer_memory_full, struct sdata, SDATA_SIZE)
136 (string_bytes, check_sblock, allocate_string_data):
137 (compact_small_strings, Fmake_bool_vector, make_string)
138 (make_unibyte_string, make_multibyte_string)
139 (make_string_from_bytes, make_specified_string)
140 (allocate_vectorlike, Fmake_vector, find_string_data_in_pure)
141 (make_pure_string, make_pure_c_string, make_pure_vector, Fpurecopy)
142 (mark_vectorlike):
143 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
144 (allocate_pseudovector):
145 Use int, not EMACS_INT, where int is wide enough.
146 (inhibit_garbage_collection, Fgarbage_collect):
147 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
148 * bidi.c (bidi_mirror_char): Use EMACS_INT, not int, where
149 int might not be wide enough.
150 (bidi_cache_search, bidi_cache_find, bidi_init_it)
151 (bidi_count_bytes, bidi_char_at_pos, bidi_fetch_char)
152 (bidi_at_paragraph_end, bidi_find_paragraph_start)
153 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak)
154 (bidi_level_of_next_char, bidi_move_to_visually_next):
155 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
156 * buffer.c (copy_overlays, Fgenerate_new_buffer_name)
157 (Fkill_buffer, Fset_buffer_major_mode)
158 (advance_to_char_boundary, Fbuffer_swap_text)
159 (Fset_buffer_multibyte, overlays_at, overlays_in)
160 (overlay_touches_p, struct sortvec, record_overlay_string)
161 (overlay_strings, recenter_overlay_lists)
162 (adjust_overlays_for_insert, adjust_overlays_for_delete)
163 (fix_start_end_in_overlays, fix_overlays_before, modify_overlay)
164 (Fmove_overlay, Fnext_overlay_change, Fprevious_overlay_change)
165 (Foverlay_recenter, last_overlay_modification_hooks_used)
166 (report_overlay_modification, evaporate_overlays, enlarge_buffer_text):
167 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
977b0e45
PE
168 (validate_region): Omit unnecessary test for b <= e,
169 since that's guaranteed by the previous test.
d311d28c
PE
170 (adjust_overlays_for_delete): Avoid pos + length overflow.
171 (Fmove_overlay, Fdelete_overlay, add_overlay_mod_hooklist)
172 (report_overlay_modification):
173 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
174 (Foverlays_at, Fnext_overlay_change, Fprevious_overlay_change):
175 Omit pointer cast, which isn't needed anyway, and doesn't work
176 after the EMACS_INT -> ptrdiff_t change.
02481186 177 (Fmove_overlay): Clip BEG and END to ptrdiff_t to avoid overflow.
d311d28c
PE
178 * buffer.h: Adjust decls to match defn changes elsewhere.
179 (struct buffer_text, struct buffer):
180 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
181 Use EMACS_INT, not int, where int might not be wide enough.
39b5db3b
PE
182 * bytecode.c (unmark_byte_stack, exec_byte_code): Use ptrdiff_t,
183 not int, to avoid needless 32-bit limit on 64-bit hosts.
184 (exec_byte_code): Use tighter memory-full test, one that checks
185 for alloca overflow. Don't compute the address of the object just
186 before an array, as that's not portable. Use EMACS_INT, not
187 ptrdiff_t or int, where ptrdiff_t or int might not be wide enough.
d311d28c
PE
188 * callint.c (Fcall_interactively):
189 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
190 * callproc.c (call_process_kill, Fcall_process):
191 Don't assume pid_t fits into an Emacs fixnum.
192 (call_process_cleanup, Fcall_process, child_setup):
193 Don't assume pid_t fits into int.
194 (call_process_cleanup, Fcall_process, delete_temp_file)
195 (Fcall_process_region):
196 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
197 (Fcall_process): Simplify handling of volatile integers.
198 Use int, not EMACS_INT, where int will do.
199 * casefiddle.c (casify_object, casify_region, operate_on_word)
200 (Fupcase_word, Fdowncase_word, Fcapitalize_word):
201 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
202 (casify_object): Avoid integer overflow when overallocating buffer.
203 * casetab.c (set_identity, shuffle): Prefer int to unsigned when
45c2afd6 204 either works. Use lint_assume to convince GCC 4.6.1 that it's OK.
d311d28c
PE
205 * category.c (Fchar_category_set): Don't assume fixnum fits in int.
206 * category.h (CATEGORYP): Don't assume arg is nonnegative.
207 * ccl.c (GET_CCL_INT): Remove; no longer needed, since the
208 integers are now checked earlier. All uses replaced with XINT.
209 (ccl_driver):
210 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
211 For CCL_MapSingle, check that content and value are in int range.
c801946a
PE
212 (ccl_driver, Fregister_code_conversion_map):
213 Check that Vcode_version_map_vector is a vector.
d311d28c
PE
214 (resolve_symbol_ccl_program): Check that vector header is in range.
215 Always copy the vector, so that we can check its contents reliably
216 now rather than having to recheck each instruction as it's being
217 executed. Check that vector words fit in 'int'.
218 (ccl_get_compiled_code, Fregister_ccl_program)
219 (Fregister_code_conversion_map): Use ptrdiff_t, not int, for
220 program indexes, to avoid needless 32-bit limit on 64-bit hosts.
221 (Fccl_execute, Fccl_execute_on_string): Check that initial reg
222 contents are in range.
223 (Fccl_execute_on_string): Check that status is in range.
224 * ccl.h (struct ccl_program.idx): Now ptrdiff_t, not int.
225 * character.c (char_resolve_modifier_mask, Fchar_resolve_modifiers):
226 Accept and return EMACS_INT, not int, because callers can pass values
227 out of 'int' range.
228 (c_string_width, strwidth, lisp_string_width, chars_in_text)
229 (multibyte_chars_in_text, parse_str_as_multibyte)
230 (str_as_multibyte, count_size_as_multibyte, str_to_multibyte)
231 (str_as_unibyte, str_to_unibyte, string_count_byte8)
232 (string_escape_byte8, Fget_byte):
233 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
a14e1568 234 (Funibyte_string): Use CHECK_RANGED_INTEGER, not CHECK_NATNUM, to
d311d28c
PE
235 avoid mishandling large integers.
236 * character.h: Adjust decls to match defn changes elsewhere.
237 * charset.c (load_charset_map_from_file, find_charsets_in_text)
238 (Ffind_charset_region):
239 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
240 (load_charset_map_from_file): Redo idx calculation to avoid overflow.
241 (load_charset_map_from_vector, Fdefine_charset_internal):
3c7649c1 242 Don't assume fixnum fits in int.
d311d28c
PE
243 (load_charset_map_from_vector, Fmap_charset_chars):
244 Remove now-unnecessary CHECK_NATNUMs.
245 (Fdefine_charset_internal): Check ranges here, more carefully.
3c7649c1
PE
246 Don't rely on undefined behavior with signed left shift overflow.
247 Don't assume unsigned int fits into fixnum, or that fixnum fits
248 into unsigned int. Don't require max_code to be a valid fixnum;
249 that's not true for gb10830 4-byte on a 32-bit host. Allow
250 invalid_code to be a cons, for the same reason. Require code_offset
251 to be a character. Avoid int overflow if max_char is close
252 to INT_MAX.
253 (CODE_POINT_TO_INDEX): On 32-bit hosts, return int, not unsigned;
254 this is intended anyway and avoids some undefined behavior.
255 (load_charset_map): Pass unsigned, not int, as 2nd arg of
256 INDEX_TO_CODE_POINT, as that's what it expects.
257 (Funify_charset, encode_char): Don't stuff unsigned vals into int vars.
60ad3eab
PE
258 * charset.h (DECODE_CHAR): Return int, not unsigned;
259 this is what was intended anyway, and it avoids undefined behavior.
260 (CHARSET_OFFSET): Remove unused macro, instead of fixing its
261 integer-overflow issues.
262 (ENCODE_CHAR): Return unsigned on all hosts, not just on 32-bit hosts.
263 Formerly, it returned EMACS_INT on 64-bit hosts in the common case
264 where the argument is EMACS_INT, and this behavior is not intended.
d311d28c
PE
265 * chartab.c (Fmake_char_table, Fset_char_table_range)
266 (uniprop_get_decoder, uniprop_get_encoder):
267 Don't assume fixnum fits in int.
268 * cmds.c (move_point): New function, that does the gist of
269 Fforward_char and Fbackward_char, but does so while checking
270 for integer overflow more accurately.
c96e5d6a 271 (Fforward_char, Fbackward_char): Use it.
d311d28c
PE
272 (Fforward_line, Fend_of_line, internal_self_insert)
273 (internal_self_insert):
274 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
275 Fix a FIXME, by checking for integer overflow when calculating
276 target_clm and actual_clm.
277 * coding.c (detect_coding_XXX, encode_coding_XXX, CODING_DECODE_CHAR)
8f50130c 278 (CODING_ENCODE_CHAR, CODING_CHAR_CHARSET, CODING_CHAR_CHARSET_P)
d311d28c
PE
279 (ASSURE_DESTINATION, coding_alloc_by_realloc)
280 (coding_alloc_by_making_gap, alloc_destination)
281 (detect_coding_utf_8, encode_coding_utf_8, decode_coding_utf_16)
282 (encode_coding_utf_16, detect_coding_emacs_mule)
283 (decode_coding_emacs_mule, encode_coding_emacs_mule)
284 (detect_coding_iso_2022, decode_coding_iso_2022)
285 (encode_invocation_designation, encode_designation_at_bol)
286 (encode_coding_iso_2022, detect_coding_sjis, detect_coding_big5)
287 (decode_coding_sjis, decode_coding_big5, encode_coding_sjis)
288 (encode_coding_big5, detect_coding_ccl, decode_coding_ccl)
289 (encode_coding_ccl, encode_coding_raw_text)
290 (detect_coding_charset, decode_coding_charset)
291 (encode_coding_charset, detect_eol, decode_eol, produce_chars)
292 (produce_composition, produce_charset, produce_annotation)
293 (decode_coding, handle_composition_annotation)
294 (handle_charset_annotation, consume_chars, decode_coding_gap)
295 (decode_coding_object, encode_coding_object, detect_coding_system)
296 (Ffind_coding_systems_region_internal, Fcheck_coding_systems_region)
297 (code_convert_region, code_convert_string)
8f50130c
PE
298 (Fdefine_coding_system_internal)
299 (coding_set_source, coding_set_destination):
d311d28c
PE
300 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
301 (setup_iso_safe_charsets, consume_chars, Funencodable_char_position)
302 (Fdefine_coding_system_internal):
303 Don't assume fixnums fit in int.
304 (decode_coding_gap, decode_coding_object, encode_coding_object)
5895d7b9 305 (Fread_coding_system, Fdetect_coding_region)
2c6a9faa
PE
306 (Funencodable_char_position, Fcheck_coding_systems_region)
307 (get_translation, handle_composition_annotation, consume_chars):
d311d28c 308 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
977b0e45 309 (consume_chars): Rewrite to not calculate an address outside buffer.
d311d28c 310 (Ffind_operation_coding_system): NATNUMP can eval its arg twice.
7b09a37a 311 Don't access memory outside of the args array.
d311d28c 312 (Fdefine_coding_system_internal): Check for charset-id overflow.
47664caa
PE
313 (ENCODE_ISO_CHARACTER): Use unsigned, not int, to store the unsigned
314 result of ENCODE_CHAR.
d311d28c
PE
315 * coding.h: Adjust decls to match defn changes elsewhere.
316 (struct coding_system):
317 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
318 * composite.c (get_composition_id, find_composition)
319 (run_composition_function, update_compositions)
320 (compose_text, composition_gstring_put_cache)
321 (composition_gstring_p, composition_gstring_width)
322 (fill_gstring_header, fill_gstring_body, autocmp_chars)
323 (composition_compute_stop_pos, composition_reseat_it)
324 (composition_update_it, struct position_record)
325 (find_automatic_composition, composition_adjust_point)
326 (Fcomposition_get_gstring, Ffind_composition_internal):
327 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
328 (update_compositions):
329 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
330 * composite.h: Adjust decls to match defn changes elsewhere.
331 (struct composition):
332 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
333 * data.c (let_shadows_buffer_binding_p, let_shadows_global_binding_p):
334 Do not attempt to compute the address of the object just before a
335 buffer; this is not portable.
336 (Faref, Faset):
337 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
338 (Faset): Use int, not EMACS_INT, where int is wide enough.
339 (Fstring_to_number): Don't assume fixnums fit in int.
340 (Frem): Don't assume arg is nonnegative.
341 * dbusbind.c (xd_append_arg): Check for integers out of range.
342 (Fdbus_call_method): Don't overflow the timeout int.
42b2a986 343 (extract_signed, extract_unsigned): New functions.
243e0530
PE
344 (XD_CHECK_DBUS_SERIAL): Remove; superseded by extract_unsigned.
345 (xd_get_connection_references): Return ptrdiff_t, not int.
346 All uses changed.
347 (xd_signature, xd_append_arg, xd_retrieve_arg, Fdbus_message_internal)
348 (xd_read_message_1):
349 Use int, not unsigned, where the dbus API uses int.
350 (Fdbus_message_internal): Don't overflow mtype.
351 (syms_of_dbusbind): Allocate right-sized buffer for integers.
d311d28c
PE
352 * dired.c (directory_files_internal, file_name_completion, scmp)
353 (file_name_completion_stat):
354 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
355 (file_name_completion): Don't overflow matchcount.
356 (file_name_completion_stat): Use SAFE_ALLOCA, not alloca.
357 * dispextern.h: Adjust decls to match defn changes elsewhere.
358 (struct text_pos, struct glyph, struct bidi_saved_info)
359 (struct bidi_string_data, struct bidi_it, struct composition_it)
360 (struct it):
361 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
362 (struct display_pos, struct composition_it, struct it):
363 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
364 * dispnew.c (increment_matrix_positions)
365 (increment_row_positions, mode_line_string)
366 (marginal_area_string):
367 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
54e1617f 368 (change_frame_size_1, Fredisplay, Fframe_or_buffer_changed_p):
d311d28c
PE
369 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
370 (duration_to_sec_usec): New function, to check for overflow better.
371 (Fsleep_for, sit_for): Use it.
372 * doc.c (get_doc_string, store_function_docstring):
373 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
374 (get_doc_string, Fsnarf_documentation):
375 Use int, not EMACS_INT, where int is wide enough.
376 (get_doc_string):
377 Use SAFE_ALLOCA, not alloca.
378 Check for overflow when converting EMACS_INT to off_t.
379 * doprnt.c (doprnt):
380 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
381 * editfns.c (init_editfns, Fuser_uid, Fuser_real_uid):
382 Don't assume uid_t fits into fixnum.
383 (buildmark, Fgoto_char, overlays_around, find_field, Fdelete_field)
384 (Ffield_string, Ffield_string_no_properties, Ffield_beginning)
385 (Ffield_end, Fconstrain_to_field, Fline_beginning_position)
386 (Fline_end_position, Fprevious_char, Fchar_after, Fchar_before)
387 (general_insert_function)
388 (Finsert_char, make_buffer_string, make_buffer_string_both)
389 (update_buffer_properties, Fbuffer_substring)
390 (Fbuffer_substring_no_properties, Fcompare_buffer_substrings)
391 (Fsubst_char_in_region, check_translation)
392 (Ftranslate_region_internal, save_restriction_restore, Fformat)
393 (transpose_markers, Ftranspose_regions):
394 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
395 (clip_to_bounds): Move to lisp.h as an inline function).
396 (Fconstrain_to_field): Don't assume integers are nonnegative.
397 (Fline_beginning_position, Fsave_excursion, Fsave_current_buffer):
398 (Fsubst_char_in_region, Fsave_restriction):
399 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
400 (Femacs_pid): Don't assume pid_t fits into fixnum.
401 (lo_time): Use int, not EMACS_INT, when int suffices.
402 (lisp_time_argument): Check for usec out of range.
403 (Fencode_time): Don't assume fixnum fits in int.
3f4eabd1
PE
404 (Fuser_login_name, Fuser_full_name): Signal an error
405 if a uid argument is out of range, rather than relying on
406 undefined behavior.
c8d5c857
PE
407 (Fformat_time_string): Remove now-unnecessary check.
408 lisp_time_argument checks for out-of-range usec now.
243e0530 409 Use ptrdiff_t, not size_t, where ptrdiff_t will do.
d311d28c
PE
410 * emacs.c (gdb_valbits, gdb_gctypebits): Now int, not EMACS_INT.
411 (gdb_data_seg_bits): Now uintptr_t, not EMACS_INT.
412 (PVEC_FLAG, gdb_array_mark_flag): Now ptrdiff_t, not EMACS_INT.
413 (init_cmdargs, Fdump_emacs):
414 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
415 (Fkill_emacs): Don't assume fixnum fits in int; instead, take just
416 the bottom (typically) 32 bits of the fixnum.
417 * eval.c (specpdl_size, call_debugger):
418 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
419 (when_entered_debugger, Fbacktrace_debug):
420 Don't assume fixnum can fit in int.
421 (Fdefvaralias, Fdefvar): Do not attempt to compute the address of
422 the object just before a buffer; this is not portable.
423 (FletX, Flet, Funwind_protect, do_autoload, Feval, funcall_lambda)
424 (grow_specpdl, unbind_to):
425 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
426 (Fapply, apply_lambda): Don't assume ptrdiff_t can hold fixnum.
427 (grow_specpdl): Simplify allocation by using xpalloc.
856bbc81 428 (Fprog1, Fprog2): Don't assume list length fits in int. Simplify.
d311d28c
PE
429 * fileio.c (Ffind_file_name_handler, Fcopy_file, Frename_file)
430 (Finsert_file_contents, Fwrite_region, Fdo_auto_save):
431 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
432 (Ffind_file_name_handler, non_regular_inserted, Finsert_file_contents)
433 (a_write, e_write):
434 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
435 (Fcopy_file, non_regular_nbytes, read_non_regular)
436 (Finsert_file_contents):
437 Use int, not EMACS_INT, where int is wide enough.
438 (READ_BUF_SIZE): Verify that it fits in int.
439 (Finsert_file_contents): Check that counts are in proper range,
440 rather than assuming fixnums fit into ptrdiff_t etc.
441 Don't assume fixnums fit into int.
125b3835 442 * floatfns.c (Fexpt): Avoid undefined signed * signed overflow.
5895d7b9
PE
443 * fns.c (Fcompare_strings, Fstring_lessp, struct textprop_rec, concat)
444 (string_char_byte_cache_charpos, string_char_byte_cache_bytepos)
d311d28c
PE
445 (string_char_to_byte, string_byte_to_char)
446 (string_make_multibyte, string_to_multibyte)
447 (string_make_unibyte, Fstring_as_unibyte, Fstring_as_multibyte)
448 (Fstring_to_unibyte, Fsubstring, Fsubstring_no_properties)
449 (substring_both, Fdelete, internal_equal, Ffillarray)
450 (Fclear_string, mapcar1)
451 (Fbase64_encode_region, Fbase64_encode_string, base64_encode_1)
452 (Fbase64_decode_region, Fbase64_decode_string, base64_decode_1)
453 (larger_vector, make_hash_table, maybe_resize_hash_table)
454 (hash_lookup, hash_remove_from_table, hash_clear, sweep_weak_table)
455 (Fmaphash, secure_hash):
456 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
457 (concat): Check for string index and length overflow.
458 (Fmapconcat): Don't assume fixnums fit into ptrdiff_t.
459 (Frequire):
460 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
461 (larger_vector): New API (vec, incr_min, size_max) replaces old
462 one (vec, new_size, init). This catches size overflow.
463 INIT was removed because it was always Qnil.
464 All callers changed.
465 (INDEX_SIZE_BOUND): New macro, which calculates more precisely
466 the upper bound on a hash table index size.
467 (make_hash_table, maybe_resize_hash_table): Use it.
468 (secure_hash): Computer start_byte and end_byte only after
469 they're known to be in ptrdiff_t range.
470 * font.c (font_intern_prop, font_at, font_range, Ffont_shape_gstring)
471 (Ffont_get_glyphs, Ffont_at):
472 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
473 (font_style_to_value, font_prop_validate_style, font_expand_wildcards)
474 (Flist_fonts, Fopen_font):
475 Don't assume fixnum can fit in int.
476 (check_gstring): Don't assume index can fit in int.
477 (font_match_p): Check that fixnum is a character, not a nonnegative
478 fixnum, since the later code needs to stuff it into an int.
479 (font_find_for_lface): Use SAFE_ALLOCA_LISP, not alloca.
480 (font_fill_lglyph_metrics): Use unsigned, not EMACS_INT, to avoid
481 conversion overflow issues.
482 (Fopen_font): Check for integer out of range.
483 (Ffont_get_glyphs): Don't assume index can fit in int.
484 * font.h: Adjust decls to match defn changes elsewhere.
485 * fontset.c (reorder_font_vector): Redo score calculation to avoid
486 integer overflow.
487 (num_auto_fontsets, fontset_from_font): Use ptrdiff_t, not
488 printmax_t, where ptrdiff_t is wide enough.
489 (Finternal_char_font):
490 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
491 * frame.c (Fset_mouse_position, Fset_mouse_pixel_position)
492 (Fset_frame_height, Fset_frame_width, Fset_frame_size)
493 (Fset_frame_position, x_set_frame_parameters)
494 (x_set_line_spacing, x_set_border_width)
495 (x_set_internal_border_width, x_set_alpha, x_figure_window_size):
496 Check that fixnums are in proper range for system types.
497 (frame_name_fnn_p, Fframe_parameter, Fmodify_frame_parameters):
498 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
499 (Fmodify_frame_parameters): Don't assume fixnum fits in int.
500 Use SAFE_ALLOCA_LISP, not alloca.
501 * frame.h (struct frame): Use intptr_t, not EMACS_INT, where
502 intptr_t is wide enough.
503 * fringe.c (lookup_fringe_bitmap, get_logical_fringe_bitmap)
504 (Fdefine_fringe_bitmap): Don't assume fixnum fits in int.
505 (Ffringe_bitmaps_at_pos): Don't assume index fits in int.
506 Check for fixnum out of range.
507 * ftfont.c (ftfont_list): Don't assume index fits in int.
508 Check that fixnums are in proper range for system types.
509 (ftfont_shape_by_flt):
510 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
d311d28c
PE
511 * gnutls.c (emacs_gnutls_write, emacs_gnutls_read):
512 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
513 (Fgnutls_error_fatalp, Fgnutls_error_string, Fgnutls_boot):
514 Check that fixnums are in proper range for system types.
515 * gnutls.h: Adjust decls to match defn changes elsewhere.
516 * gtkutil.c (xg_dialog_run):
517 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
518 (update_frame_tool_bar):
519 Check that fixnums are in proper range for system types.
520 * image.c (parse_image_spec): Redo count calculation to avoid overflow.
5895d7b9 521 (lookup_image): Check that fixnums are in range for system types.
d311d28c
PE
522 * indent.c (last_known_column, last_known_column_point):
523 (current_column_bol_cache):
524 (skip_invisible, current_column, check_display_width):
525 (check_display_width, scan_for_column, current_column_1)
526 (Findent_to, Fcurrent_indentation, position_indentation)
527 (indented_beyond_p, Fmove_to_column, compute_motion):
528 (Fcompute_motion, Fvertical_motion):
529 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
530 (last_known_column_modified): Use EMACS_INT, not int.
531 (check_display_width):
532 (Fcompute_motion):
533 Check that fixnums and floats are in proper range for system types.
534 (compute_motion): Don't assume index or fixnum fits in int.
535 (compute_motion, Fcompute_motion):
536 Use int, not EMACS_INT, when it is wide enough.
537 (vmotion): Omit local var start_hpos that is always 0; that way
538 we don't need to worry about overflow in expressions involving it.
539 * indent.h: Adjust decls to match defn changes elsewhere.
540 (struct position):
541 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
542 Use int, not EMACS_INT, where int is wide enough.
543 Remove unused members ovstring_chars_done and tab_offset;
544 all uses removed.
545 * insdel.c (move_gap, move_gap_both, gap_left, gap_right)
546 (adjust_markers_for_delete, adjust_markers_for_insert, adjust_point)
547 (adjust_markers_for_replace, make_gap_larger, make_gap_smaller)
548 (make_gap, copy_text, insert, insert_and_inherit)
549 (insert_before_markers, insert_before_markers_and_inherit)
550 (insert_1, count_combining_before, count_combining_after)
551 (insert_1_both, insert_from_string)
552 (insert_from_string_before_markers, insert_from_string_1)
553 (insert_from_gap, insert_from_buffer, insert_from_buffer_1)
554 (adjust_after_replace, adjust_after_insert, replace_range)
555 (replace_range_2, del_range, del_range_1, del_range_byte)
556 (del_range_both, del_range_2, modify_region)
557 (prepare_to_modify_buffer, signal_before_change)
558 (signal_after_change, Fcombine_after_change_execute):
559 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
560 * intervals.c (traverse_intervals, rotate_right, rotate_left)
561 (balance_an_interval, split_interval_right, split_interval_left)
562 (find_interval, next_interval, update_interval)
563 (adjust_intervals_for_insertion, delete_node, delete_interval)
564 (interval_deletion_adjustment, adjust_intervals_for_deletion)
565 (static_offset_intervals, offset_intervals)
566 (merge_interval_right, merge_interval_left, make_new_interval)
567 (graft_intervals_into_buffer, temp_set_point_both)
568 (temp_set_point, set_point, adjust_for_invis_intang)
569 (set_point_both, move_if_not_intangible, get_property_and_range)
570 (get_local_map, copy_intervals, copy_intervals_to_string)
571 (compare_string_intervals, set_intervals_multibyte_1):
572 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
573 * intervals.h: Adjust decls to match defn changes elsewhere.
574 (struct interval):
575 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
576 * keyboard.c (this_command_key_count, this_single_command_key_start)
577 (before_command_key_count, before_command_echo_length, echo_now)
578 (echo_length, recursive_edit_1, Frecursive_edit, Ftrack_mouse)
579 (command_loop_1, safe_run_hooks, read_char, timer_check_2)
580 (menu_item_eval_property, read_key_sequence, Fread_key_sequence)
581 (Fread_key_sequence_vector, Fexecute_extended_command, Fsuspend_emacs):
582 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
583 (last_non_minibuf_size, last_point_position, echo_truncate)
584 (command_loop_1, adjust_point_for_property, read_char, gen_help_event)
585 (make_lispy_position, make_lispy_event, parse_modifiers_uncached)
586 (parse_modifiers, modify_event_symbol, Fexecute_extended_command)
587 (stuff_buffered_input):
588 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
589 (last_auto_save, command_loop_1, read_char):
590 Use EMACS_INT, not int, to avoid integer overflow.
591 (record_char): Avoid overflow in total_keys computation.
592 (parse_modifiers_uncached): Redo index calculation to avoid overflow.
593 * keyboard.h: Adjust decls to match defn changes elsewhere.
594 * keymap.c (Fdefine_key, Fcurrent_active_maps, accessible_keymaps_1)
595 (Fkey_description, Fdescribe_vector, Flookup_key):
596 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
597 (click_position): New function, to check that positions are in range.
598 (Fcurrent_active_maps):
599 (describe_command):
600 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
601 (Faccessible_keymaps, Fkey_description):
602 (preferred_sequence_p):
603 Don't assume fixnum can fit into int.
604 (Fkey_description): Use SAFE_ALLOCA_LISP, not alloca.
605 Check for integer overflow in size calculations.
606 (Ftext_char_description): Use CHECK_CHARACTER, not CHECK_NUMBER, to
607 avoid mishandling large integers.
608 * lisp.h: Adjust decls to match defn changes elsewhere.
609 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, struct Lisp_String)
610 (struct vectorlike_header, struct Lisp_Subr, struct Lisp_Hash_Table)
611 (struct Lisp_Marker):
612 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
613 (clip_to_bounds): Now an inline function, moved here from editfns.c.
d311d28c
PE
614 (GLYPH_CODE_P): Check for overflow in system types, subsuming the
615 need for GLYPH_CODE_CHAR_VALID_P and doing proper checking ourselves.
616 All callers changed.
617 (GLYPH_CODE_CHAR, GLYPH_CODE_FACE):
618 Assume the arg has valid form, since it always does.
619 (TYPE_RANGED_INTEGERP): Avoid bug when checking against a wide
620 unsigned integer system type.
621 (CHECK_RANGED_INTEGER, CHECK_TYPE_RANGED_INTEGER): New macros.
622 (struct catchtag, specpdl_size, SPECPDL_INDEX, USE_SAFE_ALLOCA):
623 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
624 (struct catchtag): Use EMACS_INT, not int, since it may be a fixnum.
625 (duration_to_sec_usec): New decl.
626 * lread.c (read_from_string_index, read_from_string_index_byte)
627 (read_from_string_limit, readchar, unreadchar, openp)
628 (read_internal_start, read1, oblookup):
629 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
630 (Fload, readevalloop, Feval_buffer, Feval_region):
631 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
632 (openp): Check for out-of-range argument to 'access'.
633 (read1): Use int, not EMACS_INT, where int is wide enough.
634 Don't assume fixnum fits into int.
6efdadfd 635 Fix off-by-one error that can read outside a buffer.
1ab7b8ac
PE
636 (read_filtered_event): Use duration_to_sec_usec
637 to do proper overflow checking on durations.
d311d28c
PE
638 * macros.c (Fstart_kbd_macro): Use xpalloc to check for overflow
639 in size calculation.
640 (Fexecute_kbd_macro):
641 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
642 * marker.c (cached_charpos, cached_bytepos, CONSIDER)
643 (byte_char_debug_check, buf_charpos_to_bytepos, verify_bytepos)
644 (buf_bytepos_to_charpos, Fset_marker, set_marker_restricted)
645 (set_marker_both, set_marker_restricted_both, marker_position)
646 (marker_byte_position, Fbuffer_has_markers_at):
647 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
648 (Fset_marker, set_marker_restricted): Don't assume fixnum fits in int.
649 * menu.c (ensure_menu_items): Renamed from grow_menu_items.
650 It now merely ensures that the menu is large enough, without
651 necessarily growing it, as this avoids some integer overflow issues.
652 All callers changed.
653 (keymap_panes, parse_single_submenu, Fx_popup_menu):
654 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
655 (parse_single_submenu, Fx_popup_menu): Don't assume fixnum fits in int.
656 Use SAFE_ALLOCA_LISP, not alloca.
657 (find_and_return_menu_selection): Avoid unnecessary casts of pointers
658 to EMACS_INT. Check that fixnums are in proper range for system types.
659 * minibuf.c (minibuf_prompt_width, string_to_object)
660 (Fminibuffer_contents, Fminibuffer_contents_no_properties)
661 (Fminibuffer_completion_contents, Ftry_completion, Fall_completions):
662 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
663 (get_minibuffer, read_minibuf_unwind):
664 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
665 (read_minibuf): Omit unnecessary arg BACKUP_N, which is always nil;
666 this simplifies overflow checking. All callers changed.
667 (read_minibuf, Fread_buffer, Ftry_completion, Fall_completions)
668 (Ftest_completion):
669 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
670 * nsfns.m (check_ns_display_info): Don't assume fixnum fits in long.
671 (x_set_menu_bar_lines, x_set_tool_bar_lines, Fx_create_frame):
672 Check that fixnums are in proper range for system types.
673 (Fx_create_frame, Fx_show_tip):
674 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
675 * nsfont.m (ns_findfonts, nsfont_list_family):
676 Don't assume fixnum fits in long.
677 * nsmenu.m (ns_update_menubar, ns_menu_show, ns_popup_dialog):
678 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
679 (ns_update_menubar): Use intptr_t, not EMACS_INT, when intptr_t is
680 wide enough.
17fdb222 681 * nsselect.m (ns_get_local_selection, clean_local_selection_data):
d311d28c
PE
682 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
683 * print.c (print_buffer_size, print_buffer_pos, print_buffer_pos_byte)
684 (PRINTDECLARE, PRINTPREPARE):
685 (strout, print_string):
686 (print, print_preprocess, print_check_string_charset_prop)
687 (print_object):
688 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
689 (PRINTDECLARE):
690 (temp_output_buffer_setup, Fprin1_to_string, print_object):
691 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
692 (PRINTPREPARE): Use int, not ptrdiff_t, where int is wide enough.
d311d28c 693 (printchar, strout): Use xpalloc to catch size calculation overflow.
0fd11aa5 694 (Fexternal_debugging_output): Don't overflow EMACS_INT->int conversion.
d311d28c
PE
695 (print_error_message): Use SAFE_ALLOCA, not alloca.
696 (print_object): Use int, not EMACS_INT, where int is wide enough.
a8b7caa3
PE
697 (print_depth, new_backquote_output, print_number_index):
698 Use ptrdiff_t, not int, where int might not be wide enough.
d311d28c
PE
699 * process.c (Fdelete_process): Don't assume pid fits into EMACS_INT.
700 (Fset_process_window_size, Fformat_network_address)
701 (get_lisp_to_sockaddr_size, set_socket_option, Fmake_network_process)
d44287d4 702 (sigchld_handler):
d311d28c 703 Check that fixnums are in proper range for system types.
d44287d4 704 (Fsignal_process): Simplify by avoiding a goto.
d83cf4cc
PE
705 Check for process-ids out of pid_t range rather than relying on
706 undefined behavior.
e4d81efc 707 (process_tick, update_tick): Use EMACS_INT, not int.
d311d28c
PE
708 (Fformat_network_address, read_process_output, send_process)
709 (Fprocess_send_region, status_notify):
710 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
711 (Fformat_network_address, Fmake_serial_process, Fmake_network_process)
712 (wait_reading_process_output, read_process_output, exec_sentinel):
713 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
714 (conv_lisp_to_sockaddr): Don't assume fixnums fit into int.
715 (Faccept_process_output): Use duration_to_sec_usec to do proper
716 overflow checking on durations.
dde14581
PE
717 (emacs_get_tty_pgrp, Fprocess_running_child_p, process_send_signal):
718 Don't assume pid_t fits in int.
02481186
PE
719 * process.h (struct Lisp_Process): Members tick and update_tick
720 are now of type EMACS_INT, not int.
b62b53e8
PE
721 * puresize.h (PURESIZE_RATIO): Shrink this to 8/6 on 32-bit hosts
722 configured --with-wide-int.
d311d28c
PE
723 * scroll.c (calculate_scrolling, calculate_direct_scrolling)
724 (line_ins_del): Use int, not EMACS_INT, where int is wide enough.
725 * search.c (looking_at_1, string_match_1):
726 (fast_string_match, fast_c_string_match_ignore_case)
727 (fast_string_match_ignore_case, fast_looking_at, scan_buffer)
728 (scan_newline, find_before_next_newline, search_command)
729 (trivial_regexp_p, search_buffer, simple_search, boyer_moore)
730 (set_search_regs, wordify):
731 (Freplace_match):
732 (Fmatch_data):
733 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
734 (string_match_1, search_buffer, set_search_regs):
735 (Fmatch_data):
736 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
737 (wordify): Check for overflow in size calculation.
738 (Freplace_match): Avoid potential buffer overflow in search_regs.start.
739 (Fset_match_data): Don't assume fixnum fits in ptrdiff_t.
740 Check that fixnums are in proper range for system types.
741 * sound.c (struct sound_device)
742 (wav_play, au_play, vox_write, alsa_period_size, alsa_write):
743 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
744 (Fplay_sound_internal):
745 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
eacd378d 746 * syntax.c (struct lisp_parse_state, find_start_modiff)
d311d28c
PE
747 (Finternal_describe_syntax_value, scan_lists, scan_sexps_forward):
748 (Fparse_partial_sexp):
749 Don't assume fixnums can fit in int.
750 (struct lisp_parse_state, find_start_pos, find_start_value)
751 (find_start_value_byte, find_start_begv)
752 (update_syntax_table, char_quoted, dec_bytepos)
753 (find_defun_start, prev_char_comend_first, back_comment):
754 (scan_words, skip_chars, skip_syntaxes, forw_comment, Fforward_comment)
755 (scan_lists, Fbackward_prefix_chars, scan_sexps_forward):
756 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
757 (Finternal_describe_syntax_value): Check that match_lisp is a
758 character, not an integer, since the code stuffs it into int.
759 (scan_words, scan_sexps_forward):
760 Check that fixnums are in proper range for system types.
761 (Fforward_word):
762 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
763 (scan_sexps_forward):
764 Use CHARACTERP, not INTEGERP, since the value must fit into int.
765 (Fparse_partial_sexp): Fix doc; element 8 is not ignored.
766 * syntax.h: Adjust decls to match defn changes elsewhere.
767 (struct gl_state_s):
768 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
e4ecdc9c
PE
769 (SETUP_SYNTAX_TABLE_FOR_OBJECT): Use PTRDIFF_MAX, not
770 MOST_POSITIVE_FIXNUM.
d311d28c
PE
771 * sysdep.c (wait_for_termination_1, wait_for_termination)
772 (interruptible_wait_for_termination, mkdir):
773 Don't assume pid_t fits in int; on 64-bit AIX pid_t is 64-bit.
774 (emacs_read, emacs_write):
775 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
225a2cff
PE
776 (system_process_attributes): Don't assume uid_t, gid_t, EMACS_INT,
777 and double all fit in int.
d311d28c
PE
778 * term.c (set_tty_color_mode):
779 Check that fixnums are in proper range for system types.
780 * termhooks.h (struct input_event):
781 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
782 * textprop.c (validate_interval_range, interval_of)
783 (Fadd_text_properties, set_text_properties_1)
784 (Fremove_text_properties, Fremove_list_of_text_properties)
785 (Ftext_property_any, Ftext_property_not_all)
786 (copy_text_properties, text_property_list, extend_property_ranges)
787 (verify_interval_modification):
788 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
789 (Fnext_single_char_property_change)
790 (Fprevious_single_char_property_change):
791 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5895d7b9
PE
792 (copy_text_properties):
793 Check for integer overflow in index calculation.
d311d28c
PE
794 * undo.c (last_boundary_position, record_point, record_insert)
795 (record_delete, record_marker_adjustment, record_change)
796 (record_property_change):
797 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
798 (truncate_undo_list, Fprimitive_undo): Don't assume fixnum fits in int.
799 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
800 * w32fns.c (Fx_create_frame, x_create_tip_frame, Fx_show_tip)
801 (Fx_hide_tip, Fx_file_dialog):
802 * w32menu.c (set_frame_menubar):
803 Use ptrdiff_t, not int, for consistency with rest of code.
804 * window.c (window_scroll_preserve_hpos, window_scroll_preserve_vpos)
805 (select_window, Fdelete_other_windows_internal)
806 (window_scroll_pixel_based, window_scroll_line_based)
807 (Frecenter, Fset_window_configuration):
808 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
809 (Fset_window_hscroll, run_window_configuration_change_hook)
810 (set_window_buffer, temp_output_buffer_show, scroll_command)
5895d7b9 811 (Fscroll_other_window, Frecenter):
d311d28c
PE
812 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
813 (Fwindow_line_height, window_scroll, Fscroll_left, Fscroll_right):
814 Don't assume fixnum fits in int.
815 (Fset_window_scroll_bars):
816 Check that fixnums are in proper range for system types.
817 * xdisp.c (help_echo_pos, pos_visible_p, string_pos_nchars_ahead)
818 (string_pos, c_string_pos, number_of_chars, init_iterator)
819 (in_ellipses_for_invisible_text_p, init_from_display_pos)
820 (compute_stop_pos, next_overlay_change, compute_display_string_pos)
821 (compute_display_string_end, handle_face_prop)
5895d7b9
PE
822 (face_before_or_after_it_pos, handle_invisible_prop)
823 (handle_display_prop, handle_display_spec, handle_single_display_spec)
d311d28c
PE
824 (display_prop_intangible_p, string_buffer_position_lim)
825 (string_buffer_position, handle_composition_prop, load_overlay_strings)
826 (get_overlay_strings_1, get_overlay_strings)
827 (iterate_out_of_display_property, forward_to_next_line_start)
828 (back_to_previous_visible_line_start, reseat, reseat_to_string)
829 (get_next_display_element, set_iterator_to_next)
830 (get_visually_first_element, compute_stop_pos_backwards)
831 (handle_stop_backwards, next_element_from_buffer)
832 (move_it_in_display_line_to, move_it_in_display_line)
833 (move_it_to, move_it_vertically_backward, move_it_by_lines)
834 (add_to_log, message_dolog, message_log_check_duplicate)
835 (message2, message2_nolog, message3, message3_nolog
836 (with_echo_area_buffer, display_echo_area_1, resize_mini_window_1)
837 (current_message_1, truncate_echo_area, truncate_message_1)
838 (set_message, set_message_1, store_mode_line_noprop)
839 (hscroll_window_tree, debug_delta, debug_delta_bytes, debug_end_vpos)
840 (text_outside_line_unchanged_p, check_point_in_composition)
841 (reconsider_clip_changes)
842 (redisplay_internal, set_cursor_from_row, try_scrolling)
843 (try_cursor_movement, set_vertical_scroll_bar, redisplay_window)
844 (redisplay_window, find_last_unchanged_at_beg_row)
845 (find_first_unchanged_at_end_row, row_containing_pos, try_window_id)
846 (trailing_whitespace_p, find_row_edges, display_line)
847 (RECORD_MAX_MIN_POS, Fcurrent_bidi_paragraph_direction)
848 (display_mode_element, store_mode_line_string)
849 (pint2str, pint2hrstr, decode_mode_spec)
850 (display_count_lines, display_string, draw_glyphs)
851 (x_produce_glyphs, x_insert_glyphs)
852 (rows_from_pos_range, mouse_face_from_buffer_pos)
853 (fast_find_string_pos, mouse_face_from_string_pos)
854 (note_mode_line_or_margin_highlight, note_mouse_highlight):
855 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
856 (safe_call, init_from_display_pos, handle_fontified_prop)
857 (handle_single_display_spec, load_overlay_strings)
858 (with_echo_area_buffer, setup_echo_area_for_printing)
859 (display_echo_area, echo_area_display)
860 (x_consider_frame_title, prepare_menu_bars, update_menu_bar)
861 (update_tool_bar, hscroll_window_tree, redisplay_internal)
5895d7b9
PE
862 (redisplay_window, dump_glyph_row, display_mode_line)
863 (Fformat_mode_line, decode_mode_spec, on_hot_spot_p):
43ad2e9a 864 (handle_display_spec, display_prop_string_p):
d311d28c
PE
865 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
866 (handle_single_display_spec, build_desired_tool_bar_string)
867 (redisplay_tool_bar, scroll_window_tree, Fdump_glyph_matrix)
868 (get_specified_cursor_type):
869 Check that fixnums are in proper range for system types.
870 (struct overlay_entry, resize_mini_window, Fdump_glyph_row)
871 (Flookup_image_map):
872 Don't assume fixnums fit in int.
873 (compare_overlay_entries):
874 Avoid mishandling comparisons due to subtraction overflow.
875 (load_overlay_strings): Use SAFE_NALLOCA, not alloca.
876 (last_escape_glyph_face_id, last_glyphless_glyph_face_id):
877 (handle_tool_bar_click):
878 Use int, not unsigned, since we prefer signed and the signedness
879 doesn't matter here.
880 (get_next_display_element, next_element_from_display_vector):
881 Use int, not EMACS_INT, when int is wide enough.
882 (start_hourglass): Use duration_to_sec_usec to do proper
883 overflow checking on durations.
884 * xfaces.c (Fbitmap_spec_p):
885 Check that fixnums are in proper range for system types.
886 (compare_fonts_by_sort_order):
887 Avoid mishandling comparisons due to subtraction overflow.
888 (Fx_family_fonts, realize_basic_faces):
889 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
890 (Fx_family_fonts):
891 Don't assume fixnum fits in int.
892 Use SAFE_ALLOCA_LISP, not alloca.
893 (merge_face_heights): Remove unnecessary cast to EMACS_INT.
894 (Finternal_make_lisp_face): Don't allocate more than MAX_FACE_ID.
895 (face_at_buffer_position, face_for_overlay_string)
896 (face_at_string_position):
897 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
898 (merge_faces): Use int, not EMACS_INT, where int is wide enough.
899 * xfns.c (x_set_menu_bar_lines, x_set_tool_bar_lines, x_icon_verify)
900 (Fx_show_tip):
901 Check that fixnums are in proper range for system types.
902 (Fx_create_frame, x_create_tip_frame, Fx_show_tip)
903 (Fx_hide_tip, Fx_file_dialog, Fx_select_font):
904 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
905 (Fx_change_window_property): Don't assume fixnums fit in int.
906 * xfont.c (xfont_chars_supported):
907 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
908 * xmenu.c (Fx_popup_dialog, set_frame_menubar)
909 (create_and_show_popup_menu, create_and_show_dialog, xmenu_show):
910 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
911 * xml.c (parse_region):
912 * xrdb.c (magic_file_p):
913 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
914 * xselect.c (TRACE1): Don't assume pid_t promotes to int.
915 (x_get_local_selection, x_reply_selection_request)
916 (x_handle_selection_request, wait_for_property_change):
917 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
918 (selection_data_to_lisp_data): Use short, not EMACS_INT, where
919 short is wide enough.
920 (x_send_client_event): Don't assume fixnum fits in int.
921 * xterm.c (x_x_to_emacs_modifiers):
922 Don't assume EMACS_INT overflows nicely into int.
923 (x_emacs_to_x_modifiers): Use EMACS_INT, not int, because values
924 may come from Lisp.
925 (handle_one_xevent): NATNUMP can eval its arg twice.
926 (x_connection_closed):
927 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
928 * xterm.h: Adjust decls to match defn changes elsewhere.
929 (struct scroll_bar): Use struct vectorlike_header
930 rather than rolling our own approximation.
931 (SCROLL_BAR_VEC_SIZE): Remove; not used.
932
c6574eb5
GM
9332012-05-25 Glenn Morris <rgm@gnu.org>
934
935 * lisp.mk (lisp): Update for more files being compiled now.
936
e8d32c7e
SM
9372012-05-25 Stefan Monnier <monnier@iro.umontreal.ca>
938
48def666
SM
939 * lread.c: Remove `read_pure' which makes no difference.
940 (read_pure): Remove var.
941 (unreadpure): Remove function.
942 (readevalloop): Don't call read_list with -1 flag.
943 (read1, read_vector): Don't test read_pure any more.
944 (read_list): Simplify.
945
e8d32c7e
SM
946 * fileio.c, character.h: Minor style tweaks.
947
4b2addb7
DA
9482012-05-24 Dmitry Antipov <dmantipov@yandex.ru>
949
950 * window.h (clip_changed): Remove useless declaration.
951
584461b2
JB
9522012-05-22 Juanma Barranquero <lekktu@gmail.com>
953
954 * makefile.w32-in: Follow-up to 2012-05-22T16:20:27Z!eggert@cs.ucla.edu.
955 (TAGS, TAGS-gmake, CONFIG_H): Remove further references to m/intel386.h.
956
34374650
PE
9572012-05-22 Paul Eggert <eggert@cs.ucla.edu>
958
959 Remove src/m/*.
960 This directory predates autoconf and is no longer needed nowadays.
961 Move its few remaining bits of functionality to where they're needed.
962 * m/README, m/alpha.h, m/amdx86-64.h, m/ia64.h, m/ibmrs6000.h:
963 * m/ibms390x.h, m/intel386.h, m/m68k.h, m/macppc.h, m/sparc.h:
964 * m/template.h: Remove.
965 * Makefile.in (M_FILE): Remove. All uses removed.
966 * alloc.c (POINTERS_MIGHT_HIDE_IN_OBJECTS):
967 * lisp.h (USE_LSB_TAG):
968 * mem-limits.h (EXCEEDS_LISP_PTR):
969 Use VAL_MAX, not VALBITS, in #if.
970 * lisp.h (EMACS_INT_MAX): New macro, useful in #if.
971 (EMACS_UINT): Define unconditionally now.
972 (BITS_PER_CHAR, BITS_PER_SHORT, BITS_PER_INT, BITS_PER_LONG)
973 (BITS_PER_EMACS_INT): New constants, replacing
974 what used to be in config.h, but not useful in #if.
975 (GCTYPEBITS, VALBITS): Define unconditionally, since m/* files don't
976 define them any more.
977 (VAL_MAX): New macro.
978 (VALMASK): Use it.
979 * puresize.h (PURESIZE_RATIO): Use EMACS_INT_MAX, not
980 BITS_PER_EMACS_INT, in #if.
981 * s/aix4-2.h (BROKEN_FIONREAD, BROKEN_SIGAIO, BROKEN_SIGPTY)
982 (BROKEN_SIGPOLL): Move here from m/ibmrs6000.h, which was removed.
983 * s/gnu-linux.h (ULIMIT_BREAK_VALUE) [__i386__]:
984 * s/ms-w32.h (DATA_START):
985 Move here from removed file m/intel386.h.
986 * s/gnu.h (NLIST_STRUCT): Remove undef; 'configure' does this.
987 * s/irix6-5.h (_LP64): Remove; lisp.h no longer needs this.
988
261cb4bb
PE
9892012-05-21 Paul Eggert <eggert@cs.ucla.edu>
990
991 Assume C89 or later.
992 * alloc.c, buffer.c, lisp.h: Replace POINTER_TYPE with void.
993 * alloc.c (overrun_check_malloc, overrun_check_realloc, xmalloc)
994 (xrealloc):
995 * buffer.c (mmap_free_1, mmap_enlarge): Omit needless casts.
996 * editfns.c, fns.c, gmalloc.c, insdel.c, sysdep.c, termcap.c (NULL):
997 * textprop.c, tparam.c (NULL): Remove.
998 * ralloc.c, vm-limit.c (POINTER): Assume void * works.
999 * regex.c (SIGN_EXTEND_CHAR): Assume signed char works.
1000 * regex.h (_RE_ARGS): Remove. All uses rewritten to use prototypes.
1001 * unexelf.c (ElfBitsW): Assume c89 preprocessor or better.
1002 * xterm.c (input_signal_count): Assume volatile works.
1003
ff23cd9f
KB
10042012-05-21 Ken Brown <kbrown@cornell.edu>
1005
1006 * xgselect.c (xg_select): Fix first argument in call to 'select'
1007 (bug#11508).
1008
1b170bc6
KB
10092012-05-20 Ken Brown <kbrown@cornell.edu>
1010
1011 * gmalloc.c (_free_internal_nolock, _realloc_internal_nolock)
bd7239f5 1012 [CYGWIN]: Cast ptr to (char *) before comparing to _heapbase.
1b170bc6 1013
b2f4d39f
KB
10142012-05-19 Ken Brown <kbrown@cornell.edu>
1015
1016 * xfns.c (x_in_use): Remove `static' qualifier.
1017 * xterm.h (x_in_use): Declare.
1018 * xgselect.c: Include xterm.h.
1019 (xg_select): Test `x_in_use' instead of `inhibit_window_system'
1020 and `display_arg' (bug#9754).
1021
003fdae2
PE
10222012-05-19 Paul Eggert <eggert@cs.ucla.edu>
1023
9232a6d9
PE
1024 * s/ms-w32.h (HAVE_GETDOMAINNAME): Remove; not needed.
1025
003fdae2
PE
1026 * m/vax.h: Remove; no longer needed since HAVE_FTIME is being removed.
1027 * s/ms-w32.h (HAVE_FTIME): Remove; not needed.
1028
784b56e2
EZ
10292012-05-18 Eli Zaretskii <eliz@gnu.org>
1030
1031 Fix compilation with -DGLYPH_DEBUG=1 on MS-Windows.
1032
1033 * w32term.c [GLYPH_DEBUG]: Add prototype for x_check_font.
1034 (x_check_font) [GLYPH_DEBUG]: New function, copied from xterm.c
1035
1036 * w32fns.c (unwind_create_frame) [GLYPH_DEBUG]: Fix broken
1037 reference to image_cache->refcount.
1038 (x_create_tip_frame): Fix broken use of FRAME_IMAGE_CACHE.
1039
a0a79cde
JL
10402012-05-17 Juri Linkov <juri@jurta.org>
1041
1042 * search.c (Fword_search_regexp, Fword_search_backward)
1043 (Fword_search_forward, Fword_search_backward_lax)
1044 (Fword_search_forward_lax): Move functions to isearch.el
1045 (bug#10145, bug#11381).
1046
b0572523
PE
10472012-05-16 Paul Eggert <eggert@cs.ucla.edu>
1048
1049 * xgselect.c (xg_select): Just invoke 'select' if -nw (Bug#9754).
1050
9660f5fc
SM
10512012-05-15 Stefan Monnier <monnier@iro.umontreal.ca>
1052
1053 * lread.c (init_obarray): Declare Qt and Qnil as special.
1054
4374de83
GM
10552012-05-14 Glenn Morris <rgm@gnu.org>
1056
1057 * nsterm.m (ns_init_paths): Fix typo ("libexec" not "lib-exec").
985584ae 1058 Put "libexec" before "bin", for the sake of init_callproc_1.
4374de83 1059
dc44c39a
PE
10602012-05-14 Paul Eggert <eggert@cs.ucla.edu>
1061
078c97cb
PE
1062 * keyboard.c (kbd_buffer_get_event) [!HAVE_DBUS]: Omit unused local.
1063
dc44c39a
PE
1064 * unexaix.c: Port to more-recent AIX compilers.
1065 (report_error, report_error_1, make_hdr, copy_sym)
1066 (mark_x, adjust_lnnoptrs, unrelocate_symbols):
1067 Make arguments const char *, not char *, to avoid violations of C
1068 standard and to fix some AIX warnings reported by Gilles Pion.
1069
e18afed7 10702012-05-14 Eli Zaretskii <eliz@gnu.org>
ac268e67
EZ
1071
1072 * xdisp.c (handle_stop): Don't call get_overlay_strings_1 if we
1073 already have overlays loaded.
1074 (handle_single_display_spec): Before returning without displaying
1075 fringe bitmap, synchronize the bidi iterator with the main display
1076 iterator, by calling iterate_out_of_display_property.
1077 (iterate_out_of_display_property): Detect buffer iteration by
1078 testing that it->string is a Lisp string.
1079 (get_next_display_element): When the current object is exhausted,
1080 and there's something on it->stack, call set_iterator_to_next to
1081 proceed with what's on the stack, instead of returning zero.
1082 (set_iterator_to_next): If called at the end of a Lisp string,
1083 proceed to consider_string_end without incrementing string
1084 position. Don't increment display vector index past the end of
1085 the display vector. (Bug#11417)
c8fb9dc6
EZ
1086 (pos_visible_p): Don't report a position visible when move_it_to
1087 stopped at the last line of window, which happens to be scanned
1088 backwards by the bidi iteration. (Bug#11464)
ac268e67 1089
e18afed7 10902012-05-14 Eli Zaretskii <eliz@gnu.org>
82f9b393
EZ
1091
1092 * xdisp.c (handle_single_display_spec): Return 1 for left-margin
1093 and right-margin display specs even if the spec is invalid or we
1094 are on a TTY, and thus unable to display on the fringes. That's
1095 because the text with the property will not be displayed anyway,
1096 so we need to signal to the caller that this is a "replacing"
1097 display spec. This fixes display when the spec is invalid or we
1098 are on a TTY.
1099
e18afed7 11002012-05-14 Paul Eggert <eggert@cs.ucla.edu>
297834cd
PE
1101
1102 * unexaix.c (make_hdr): Fix typo in prototype.
1103 This bug broke the build on AIX. Problem reported by Gilles Pion.
1104
9d0a235a
MA
11052012-05-14 Michael Albinus <michael.albinus@gmx.de>
1106
1107 * keyboard.c (kbd_buffer_get_event): Read special events also in
1108 batch mode. (Bug#11415)
1109
9e6b06ed
GM
11102012-05-12 Glenn Morris <rgm@gnu.org>
1111
1112 * ns.mk: Update for ns_appbindir no longer having trailing "/".
1113
c1a1d7a3
EZ
11142012-05-12 Eli Zaretskii <eliz@gnu.org>
1115
1116 * lisp.mk (lisp): Add newcomment.elc.
1117
3fe7cdc8
GM
11182012-05-12 Glenn Morris <rgm@gnu.org>
1119
1120 * Makefile.in (MKDIR_P): New, set by configure.
1121 * ns.mk (${ns_appdir}, ${ns_appbindir}Emacs): Use $MKDIR_P.
1122
53f7d2c0
PE
11232012-05-11 Paul Eggert <eggert@cs.ucla.edu>
1124
1125 Remove unused function hourglass_started.
1126 * dispextern.h (hourglass_started):
1127 * w32fns.c (hourglass_started):
1128 * xdisp.c (hourglass_started): Remove.
1129
75aafb17
JB
11302012-05-10 Juanma Barranquero <lekktu@gmail.com>
1131
1132 * makefile.w32-in ($(BLD)/gmalloc.$(O), $(BLD)/w32menu.$(O)):
1133 Update dependencies.
1134
12959e8e
PE
11352012-05-10 Paul Eggert <eggert@cs.ucla.edu>
1136
97107e2e
PE
1137 * xgselect.c (xg_select): Put maxfds+1 into a var.
1138 This is slightly clearer, and pacifies Ubuntu 12.04 gcc.
1139
12959e8e
PE
1140 * sound.c (DEFAULT_ALSA_SOUND_DEVICE): Define only if HAVE_ALSA.
1141
836d29b3
DA
11422012-05-10 Dave Abrahams <dave@boostpro.com>
1143
1144 * filelock.c (syms_of_filelock): New boolean create-lockfiles.
1145 (lock_file): If create_lockfiles is 0, do nothing. (Bug#11227)
1146
5cb67954
MA
11472012-05-09 Michael Albinus <michael.albinus@gmx.de>
1148
1149 * dbusbind.c (xd_registered_buses): New internal Lisp object.
1150 Rename all occurences of Vdbus_registered_buses to xd_registered_buses.
1151 (syms_of_dbusbind): Remove declaration of Vdbus_registered_buses.
1152 Initialize xd_registered_buses.
1153
3478ec45
PE
11542012-05-09 Paul Eggert <eggert@cs.ucla.edu>
1155
b263a6b0
PE
1156 Untag more efficiently if USE_LSB_TAG.
1157 This is based on a proposal by YAMAMOTO Mitsuharu in
1158 <http://lists.gnu.org/archive/html/emacs-devel/2008-01/msg01876.html>.
1159 For an admittedly artificial (nth 8000 longlist) benchmark on
1160 Fedora 15 x86-64, this yields a 25% CPU speedup. Also, it shrinks
1161 Emacs's overall text size by 1%.
1162 * lisp.h (XUNTAG): New macro.
1163 (XCONS, XVECTOR, XSTRING, XSYMBOL, XFLOAT, XMISC, XPROCESS, XWINDOW)
1164 (XTERMINAL, XSUBR, XBUFFER, XCHAR_TABLE, XSUB_CHAR_TABLE, XBOOL_VECTOR)
1165 (XSETTYPED_PSEUDOVECTOR, XHASH_TABLE, TYPED_PSEUDOVECTORP): Use it.
1166 * eval.c (Fautoload):
1167 * font.h (XFONT_SPEC, XFONT_ENTITY, XFONT_OBJECT):
1168 * frame.h (XFRAME): Use XUNTAG.
1169
3478ec45
PE
1170 Port recent dbusbind.c changes to 32-bit --with-wide-int.
1171 * dbusbind.c (xd_append_arg, xd_retrieve_arg, Fdbus_message_internal):
1172 Remove unportable assumptions about print widths of types like
1173 dbus_uint32_t.
1174 (xd_get_connection_address, Fdbus_init_bus): Cast Emacs integer to
1175 intptr_t when converting between pointer and integer, to avoid GCC
1176 warnings about wrong width.
1177
666b903b 11782012-05-09 Eli Zaretskii <eliz@gnu.org>
0d887c7d
EZ
1179
1180 * w32proc.c (new_child): Force Windows to reserve only 64KB of
1181 stack for each reader_thread, instead of defaulting to 8MB
1182 determined by the linker. This avoids failures in creating
1183 subprocesses on Windows 7, see the discussion in this thread:
1184 http://lists.gnu.org/archive/html/emacs-devel/2012-03/msg00119.html.
1185
b120cc17
JC
11862012-05-07 Jérémy Compostella <jeremy.compostella@gmail.com>
1187
1188 Fix up display of the *Minibuf-0* buffer in the mini window.
1189 * keyboard.c (read_char): Don't clear the echo area if there's no
1190 message to clear.
1191 * xdisp.c (redisplay_internal): Redisplay the mini window (with the
2fed2689 1192 contents of *Minibuf-0*) if there's no message displayed in its stead.
b120cc17 1193
9a4b36f8
MA
11942012-05-07 Michael Albinus <michael.albinus@gmx.de>
1195
1196 * dbusbind.c (XD_DEBUG_MESSAGE): Don't print message twice in
1197 batch mode.
1198
e5f9458f
CY
11992012-05-06 Chong Yidong <cyd@gnu.org>
1200
1201 * lisp.mk (lisp): Update.
1202
eceeb5fc 12032012-05-05 Jim Meyering <meyering@redhat.com>
bf98199c
JM
1204
1205 * w32font.c (fill_in_logfont): NUL-terminate a string (Bug#11372).
1206
71873e2b
SM
12072012-05-04 Stefan Monnier <monnier@iro.umontreal.ca>
1208
1209 * data.c (PUT_ERROR): New macro.
1210 (syms_of_data): Use it. Add new error type `user-error'.
1211 * undo.c (user_error): New function.
1212 (Fprimitive_undo): Use it.
1213 * print.c (print_error_message): Adjust print style for `user-error'.
1214 * keyboard.c (user_error): New function.
1215 (Fexit_recursive_edit, Fabort_recursive_edit): Use it.
1216
ab0fa4e4
PE
12172012-05-03 Paul Eggert <eggert@cs.ucla.edu>
1218
1219 Do not limit current-time-string to years 1000..9999.
1220 * editfns.c (TM_YEAR_IN_ASCTIME_RANGE): Remove.
1221 (Fcurrent_time_string): Support any year that is supported by the
1222 underlying localtime representation. Don't use asctime, as it
1223 has undefined behavior for years outside the range -999..9999.
1224
7ed806a7
PE
12252012-05-02 Paul Eggert <eggert@cs.ucla.edu>
1226
1227 Fix race conditions involving setenv, gmtime, localtime, asctime.
1228 Without this fix, interrupts could mess up code that uses these
1229 nonreentrant functions, since setting TZ invalidates existing
1230 tm_zone or tzname values, and since most of these functions return
1231 pointers to static storage.
1232 * editfns.c (format_time_string, Fdecode_time, Fencode_time)
1233 (Fcurrent_time_string, Fcurrent_time_zone, Fset_time_zone_rule):
1234 Grow the critical sections to include not just invoking
1235 localtime/gmtime, but also accessing these functions' results
1236 including their tm_zone values if any, and any related TZ setting.
1237 (format_time_string): Last arg is now struct tm *, not struct tm **,
71873e2b
SM
1238 so that the struct tm is saved in the critical section.
1239 All callers changed. Simplify allocation of initial buffer, partly
7ed806a7
PE
1240 motivated by the fact that memory allocation needs to be outside
1241 the critical section.
1242
0c16dfed
DA
12432012-05-02 Dmitry Antipov <dmantipov@yandex.ru>
1244
1245 * intervals.c (adjust_intervals_for_insertion): Initialize `newi'
1246 with RESET_INTERVAL.
1247
1248 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer):
1249 Remove duplicated buffer name initialization.
1250
3f83ace8
JM
12512012-05-02 Jim Meyering <jim@meyering.net>
1252
1253 * xterm.c (x_term_init): Use memcpy instead of strncpy (Bug#11373).
1254
c7b8541e
JM
1255 * xfns.c (x_window): Use xstrdup (Bug#11375).
1256
90207a15 12572012-05-02 Eli Zaretskii <eliz@gnu.org>
2fa85638
EZ
1258
1259 * xdisp.c (pos_visible_p): If already at a newline from the
1260 display string before the 'while' loop, don't walk back the glyphs
1261 from it3.glyph_row. Solves assertion violation when the display
1262 string begins with a newline (egg.el). (Bug#11367)
1263
b593d6a9
AH
12642012-05-01 Stefan Monnier <monnier@iro.umontreal.ca>
1265
1266 * keyboard.c (Fexecute_extended_command, Vsuggest_key_bindings):
1267 Move to simple.el.
1268
4737362e
GM
12692012-05-01 Glenn Morris <rgm@gnu.org>
1270
99cf43f9
GM
1271 * syssignal.h: Remove reference to BROKEN_SIGINFO (last used in
1272 s/ptx4.h), BROKEN_SIGTSTP (last used in m/ustation.h, m/dpx2.h),
1273 and BROKEN_SIGURG (was in s/gnu-linux.h prior to 2008-02-10).
1274 All were removed before 23.1.
1275
9311dcff
GM
1276 * dispnew.c: Remove HAVE_LIBNCURSES test;
1277 it is always true on relevant platforms.
1278
4d5c6349
GM
1279 * Makefile.in (LD_SWITCH_X_SITE_RPATH):
1280 Rename from LD_SWITCH_X_SITE_AUX_RPATH.
1281
4737362e
GM
1282 * Makefile.in (LD_SWITCH_X_SITE_AUX): Remove; no longer used.
1283
74dd3a6b
AS
12842012-04-30 Andreas Schwab <schwab@linux-m68k.org>
1285
1286 * .gdbinit (xpr): Remove checks for no longer existing misc types.
1287 (xintfwd, xboolfwd, xobjfwd, xbufobjfwd, xkbobjfwd, xbuflocal):
1288 Remove.
1289
13c379ee
PE
12902012-04-28 Paul Eggert <eggert@cs.ucla.edu>
1291
1292 Do not avoid creating empty evaporating overlays (Bug#9642).
1293 * buffer.c (Fmove_overlay): Revert the change of 2012-04-23.
1294 That is, do not delete an evaporating overlay if it becomes
1295 empty after its bounds are adjusted to fit within its buffer.
1296 This fix caused other problems, and I'm reverting it until we get
1297 to the bottom of them.
1298
a8e7d6d7 12992012-04-27 Chong Yidong <cyd@gnu.org>
9be2fd9b
CY
1300
1301 * xselect.c (x_convert_selection): Initialize a pointer (Bug#11315).
1302
a8e7d6d7 13032012-04-27 Eli Zaretskii <eliz@gnu.org>
f0ee99a0
EZ
1304
1305 * xdisp.c (pos_visible_p): If the window start position is beyond
1306 ZV, start the display from buffer beginning. Prevents assertion
1307 violation in init_iterator when the minibuffer window is scrolled
1308 via the scroll bar.
1309
1310 * window.c (window_scroll_pixel_based): Likewise.
1311
a8e7d6d7 13122012-04-27 Chong Yidong <cyd@gnu.org>
9ec7751f
CY
1313
1314 * keymap.c (where_is_internal): Doc fix (Bug#10872).
1315
a8e7d6d7 13162012-04-27 Glenn Morris <rgm@gnu.org>
24c51a09
GM
1317
1318 * fileio.c (Fcopy_file, Fset_file_selinux_context):
1319 Ignore ENOTSUP failures from setfilecon functions. (Bug#11245)
1320
a8e7d6d7 13212012-04-27 Eli Zaretskii <eliz@gnu.org>
73055685 1322
b593d6a9
AH
1323 * dispnew.c (swap_glyph_pointers, copy_row_except_pointers):
1324 Don't overrun array limits of glyph row's used[] array. (Bug#11288)
73055685 1325
1c6900d9
EZ
13262012-04-26 Eli Zaretskii <eliz@gnu.org>
1327
4c3fa1d9
EZ
1328 * xdisp.c (IT_DISPLAYING_WHITESPACE): In addition to the loaded
1329 display element, check also the underlying string or buffer
1330 character. (Bug#11341)
1331
1c6900d9
EZ
1332 * w32menu.c: Include w32heap.h.
1333 (add_menu_item): If the call to AppendMenuW (via
1334 unicode_append_menu) fails, disable Unicode menus only if we are
1335 running on Windows 9X/Me.
1336
42bf8205
AS
13372012-04-24 Andreas Schwab <schwab@linux-m68k.org>
1338
1339 * .gdbinit (xpr): Handle USE_2_TAGS_FOR_INTS.
1340 (xgetint): Add missing shift for LSB tags.
1341
b1bac16e
MR
13422012-04-24 Martin Rudalics <rudalics@gmx.at>
1343
1344 * keyboard.c (read_char): Don't wipe echo area for select window
1345 events: These might get delayed via `mouse-autoselect-window'
1346 (Bug#11304).
1347
d69621cc
JB
13482012-04-24 Juanma Barranquero <lekktu@gmail.com>
1349
1350 * gnutls.c (init_gnutls_functions): Protect against (unlikely)
1351 manipulation of :loaded-from data.
1352
02fd101b
JB
13532012-04-23 Juanma Barranquero <lekktu@gmail.com>
1354
1355 * gnutls.c (init_gnutls_functions): The value of :loaded-from is
1356 now a cons (bug#11311).
1357
888bec30
PE
13582012-04-23 Paul Eggert <eggert@cs.ucla.edu>
1359
89a438bd
PE
1360 Do not create empty overlays with the evaporate property (Bug#9642).
1361 * buffer.c (Fmove_overlay): Delete an evaporating overlay
1362 if it becomes empty after its bounds are adjusted to fit within
1363 its buffer. Without this fix, in a nonempty buffer (let ((o
1364 (make-overlay 1 2))) (overlay-put o 'evaporate t) (move-overlay o 0 1))
1365 yields an empty overlay that has the evaporate property, which is
1366 not supposed to happen.
1367
1068fe4d
PE
1368 Fix minor GTK3 problems found by static checking.
1369 * emacsgtkfixed.c (EMACS_TYPE_FIXED, EMACS_FIXED, EmacsFixed)
1370 (EmacsFixedPrivate, EmacsFixedClass, struct _EmacsFixed)
1371 (struct _EmacsFixedClass, emacs_fixed_get_type):
1372 Move decls here from emacsgtkfixed.h, since they needn't be public.
1373 (emacs_fixed_get_type): Now static.
1374 (emacs_fixed_class_init): Omit unused local.
1375 (emacs_fixed_child_type): Remove; unused.
1376 * emacsgtkfixed.h (EMACS_TYPE_FIXED, EMACS_FIXED, EmacsFixed)
1377 (EmacsFixedPrivate, EmacsFixedClass, struct _EmacsFixed)
1378 (struct _EmacsFixedClass): Move to emacsgtkfixed.c.
1379 (EMACS_FIXED_CLASS, EMACS_IS_FIXED, EMACS_IS_FIXED_CLASS)
1380 (EMACS_FIXED_GET_CLASS): Remove; unused.
1381 * gtkutil.c (xg_create_frame_widgets) [!HAVE_GTK3]: Omit unused local.
1382
888bec30
PE
1383 * keyboard.c (handle_async_input): Define only if SYNC_INPUT || SIGIO.
1384 Problem reported by Juanma Barranquero for Windows -Wunused-function.
1385
de85e130
PE
13862012-04-22 Paul Eggert <eggert@cs.ucla.edu>
1387
d0baac98 1388 Modernize and clean up gmalloc.c to assume C89 (Bug#9119).
bd7239f5 1389 * gmalloc.c (_MALLOC_INTERNAL, _MALLOC_H, _PP, __ptr_t)
d0baac98
PE
1390 (__malloc_size_t, __malloc_ptrdiff_t):
1391 Remove. All uses removed, replaced by the definiens if needed,
1392 since we can assume C89 or better now.
1393 Include <stdint.h>, for PTRDIFF_MAX, uintptr_t.
1394 (protect_malloc_state, align, get_contiguous_space)
1395 (malloc_atfork_handler_prepare, malloc_atfork_handler_parent)
1396 (malloc_atfork_handler_child, malloc_enable_thread)
1397 (malloc_initialize_1, __malloc_initialize, morecore_nolock)
1398 (_malloc_internal_nolock, _malloc_internal, malloc, _malloc)
1399 (_free, _realloc, _free_internal_nolock, _free_internal, free, cfree)
1400 (special_realloc, _realloc_internal_nolock, _realloc_internal)
1401 (realloc, calloc, __default_morecore, memalign, valloc, checkhdr)
1402 (freehook, mallochook, reallochook, mabort, mcheck, mprobe):
1403 Define using prototypes, not old style.
1404 (align, _malloc_internal_nolock, _free_internal_nolock, memalign):
1405 Don't assume ptrdiff_t and uintptr_t are no wider than unsigned long.
1406 (align): Don't assume that signed integer overflow wraps around.
1407 Omit unused local var.
1408 (malloc_initialize_1, morecore_nolock, _malloc_internal_nolock)
1409 (_free_internal_nolock, memalign, mallochook, reallochook):
1410 Omit no-longer-needed casts.
1411 (valloc): Use getpagesize, not __getpagesize.
1412 (MAGICWORD, MAGICFREE): Now randomish size_t values, not 32-bit.
1413 (struct hdr): The 'magic' member is now size_t, not unsigned long.
1414
de85e130
PE
1415 * dbusbind.c (XD_DBUS_VALIDATE_OBJECT): Define only if needed.
1416
dcbf5805
MA
14172012-04-22 Michael Albinus <michael.albinus@gmx.de>
1418
1419 Move functions from C to Lisp. Make non-blocking method calls
1420 the default. Implement further D-Bus standard interfaces.
1421
1422 * dbusbind.c (DBUS_NUM_MESSAGE_TYPES): Declare.
1423 (QCdbus_request_name_allow_replacement)
1424 (QCdbus_request_name_replace_existing)
1425 (QCdbus_request_name_do_not_queue)
1426 (QCdbus_request_name_reply_primary_owner)
1427 (QCdbus_request_name_reply_in_queue)
1428 (QCdbus_request_name_reply_exists)
1429 (QCdbus_request_name_reply_already_owner): Move to dbus.el.
1430 (QCdbus_registered_serial, QCdbus_registered_method)
1431 (QCdbus_registered_signal): New Lisp objects.
1432 (XD_DEBUG_MESSAGE): Use sizeof.
1433 (XD_MESSAGE_TYPE_TO_STRING, XD_OBJECT_TO_STRING)
1434 (XD_DBUS_VALIDATE_BUS_ADDRESS, XD_DBUS_VALIDATE_OBJECT)
1435 (XD_DBUS_VALIDATE_BUS_NAME, XD_DBUS_VALIDATE_PATH)
1436 (XD_DBUS_VALIDATE_INTERFACE, XD_DBUS_VALIDATE_MEMBER): New macros.
1437 (XD_CHECK_DBUS_SERIAL): Rename from CHECK_DBUS_SERIAL_GET_SERIAL.
1438 (xd_signature, xd_append_arg): Allow float for integer types.
1439 (xd_get_connection_references): New function.
b593d6a9
AH
1440 (xd_get_connection_address): Rename from xd_initialize.
1441 Return cached address.
dcbf5805
MA
1442 (xd_remove_watch): Do not unset $DBUS_SESSION_BUS_ADDRESS.
1443 (xd_close_bus): Rename from Fdbus_close_bus. Not needed on Lisp
1444 level.
1445 (Fdbus_init_bus): New optional arg PRIVATE. Cache address.
9a4b36f8 1446 Return number of refcounts.
dcbf5805
MA
1447 (Fdbus_get_unique_name): Make stronger parameter check.
1448 (Fdbus_message_internal): New defun.
1449 (Fdbus_call_method, Fdbus_call_method_asynchronously)
1450 (Fdbus_method_return_internal, Fdbus_method_error_internal)
1451 (Fdbus_send_signal, Fdbus_register_service)
1452 (Fdbus_register_signal, Fdbus_register_method): Move to dbus.el.
1453 (xd_read_message_1): Obey new structure of Vdbus_registered_objects.
1454 (xd_read_queued_messages): Obey new structure of Vdbus_registered_buses.
1455 (Vdbus_compiled_version, Vdbus_runtime_version)
1456 (Vdbus_message_type_invalid, Vdbus_message_type_method_call)
1457 (Vdbus_message_type_method_return, Vdbus_message_type_error)
1458 (Vdbus_message_type_signal): New defvars.
b593d6a9
AH
1459 (Vdbus_registered_buses, Vdbus_registered_objects_table):
1460 Adapt docstring.
dcbf5805 1461
52828e02
PE
14622012-04-22 Paul Eggert <eggert@cs.ucla.edu>
1463
da05bc4c
PE
1464 Fix GC_MALLOC_CHECK debugging output on 64-bit hosts.
1465 * alloc.c (emacs_blocked_malloc) [GC_MALLOC_CHECK]:
1466 Do not assume ptrdiff_t is the same width as 'int'.
1467
52828e02
PE
1468 * alloc.c: Handle unusual debugging option combinations.
1469 (GC_CHECK_MARKED_OBJECTS): Undef if ! GC_MARK_STACK,
1470 since the two debugging options are incompatible.
1471 (GC_MALLOC_CHECK): Similarly, undef if GC_CHECK_MARKED_OBJECTS
1472 is defined.
1473 (mem_init, mem_insert, mem_insert_fixup):
1474 Define if GC_MARK_STACK || GC_MALLOC_CHECK.
1475 (NEED_MEM_INSERT): Remove; no longer needed.
1476
f01769f9
LL
14772012-04-22 Leo Liu <sdl.web@gmail.com>
1478
1479 * sysdep.c (list_system_processes): Support Darwin (Bug#5725).
1480
5790543d
PE
14812012-04-22 Paul Eggert <eggert@cs.ucla.edu>
1482
1483 * sysdep.c [__FreeBSD__]: Minor cleanups.
1484 (list_system_processes, system_process_attributes) [__FreeBSD__]:
1485 Use Emacs indenting style more consistently. Avoid some casts.
1486 Use 'double' consistently rather than mixing 'float' and 'double'.
1487
b91b7e4d
EW
14882012-04-21 Eduard Wiebe <usenet@pusto.de>
1489
b593d6a9
AH
1490 * sysdep.c (list_system_processes, system_process_attributes):
1491 Add implementation for FreeBSD (Bug#5243).
b91b7e4d 1492
6114eb15
AS
14932012-04-21 Andreas Schwab <schwab@linux-m68k.org>
1494
1495 * lisp.mk (lisp): Update.
1496
2f38dff7
PE
14972012-04-20 Paul Eggert <eggert@cs.ucla.edu>
1498
1499 * keyboard.c (process_pending_signals): Define only if SYNC_INPUT.
1500 It is never used otherwise.
1501
4ae29f89
SM
15022012-04-20 Stefan Monnier <monnier@iro.umontreal.ca>
1503
1504 * print.c (print_preprocess): Only check print_depth if print-circle
1505 is nil.
1506 (print_object): Check for cycles even when print-circle is nil and
1507 print-gensym is t, but only check print_depth if print-circle is nil.
1508
f30d612a
CY
15092012-04-20 Chong Yidong <cyd@gnu.org>
1510
1511 * process.c (wait_reading_process_output): If EIO occurs on a pty,
1512 set the status to "failed" and ensure that sentinel is run.
1513
c07a4c0b 15142012-04-20 Glenn Morris <rgm@gnu.org>
016a35df
GM
1515
1516 * process.c (Fset_process_inherit_coding_system_flag)
1517 (Fset_process_query_on_exit_flag): Doc fix (mention return value).
4373fd43 1518 (Fmake_network_process, Fmake_serial_process): Doc fix.
016a35df 1519
c07a4c0b 15202012-04-20 Eli Zaretskii <eliz@gnu.org>
20a68157
EZ
1521
1522 * xdisp.c (string_buffer_position_lim): Limit starting position to
1523 BEGV.
1524 (set_cursor_from_row): If called for a mode-line or header-line
1525 row, return zero immediately.
1526 (try_cursor_movement): If inside continuation line, don't back up
4ae29f89
SM
1527 farther than the first row after the header line, if any.
1528 Don't consider the header-line row as "partially visible", even if
20a68157
EZ
1529 MATRIX_ROW_PARTIALLY_VISIBLE_P returns non-zero. (Bug#11261)
1530
c07a4c0b 15312012-04-20 Atsuo Ohki <ohki@gssm.otsuka.tsukuba.ac.jp> (tiny change)
ad3a2b41 1532
4ae29f89
SM
1533 * lread.c (lisp_file_lexically_bound_p): Fix hang at ";-*-\n"
1534 (bug#11238).
ad3a2b41 1535
c07a4c0b 15362012-04-20 Teodor Zlatanov <tzz@lifelogs.com>
6c94c34f 15372012-04-18 Paul Eggert <eggert@cs.ucla.edu>
ae6e112d
PE
1538
1539 configure: new option --enable-gcc-warnings (Bug#11207)
1540 * Makefile.in (C_WARNINGS_SWITCH): Remove.
1541 (WARN_CFLAGS, WERROR_CFLAGS): New macros.
1542 (ALL_CFLAGS): Use new macros rather than old.
1543 * process.c: Ignore -Wstrict-overflow to work around GCC bug 52904.
1544 * regex.c: Ignore -Wstrict-overflow. If !emacs, also ignore
1545 -Wunused-but-set-variable, -Wunused-function, -Wunused-macros,
1546 -Wunused-result, -Wunused-variable. This should go away once
1547 the Emacs and Gnulib regex code is merged.
1548 (xmalloc, xrealloc): Now static.
1549
aba027e8
PE
15502012-04-17 Paul Eggert <eggert@cs.ucla.edu>
1551
1552 * dired.c (Fsystem_groups): Remove unused local.
1553
e5a36063
GM
15542012-04-17 Glenn Morris <rgm@gnu.org>
1555
1556 * dired.c (Fsystem_users): Doc fix.
1557
316411f0
DA
15582012-04-17 Dmitry Antipov <dmantipov@yandex.ru>
1559
1560 * dired.c (Fsystem_users, Fsystem_groups): New functions. (Bug#7900)
1561 (syms_of_dired): Add them.
1562
9426aba4
PE
15632012-04-16 Paul Eggert <eggert@cs.ucla.edu>
1564
b62a57be
PE
1565 Fix minor alloc.c problems found by static checking.
1566 * alloc.c (_malloc_internal, _free_internal) [!DOUG_LEA_MALLOC]:
1567 New extern decls, to avoid calling undeclared functions.
1568 (dont_register_blocks): Define if ((!SYSTEM_MALLOC && !SYNC_INPUT)
1569 && GC_MALLOC_CHECK), not if ((GC_MARK_STACK || defined
1570 GC_MALLOC_CHECK) && GC_MALLOC_CHECK), to match when it's used.
1571 (NEED_MEM_INSERT): New macro.
1572 (mem_insert, mem_insert_fixup) [!NEED_MEM_INSERT]: Remove; unused.
4b5afbb0 1573 Remove one incorrect comment and fix another.
b62a57be 1574
3539f31f
PE
1575 Fix minor ralloc.c problems found by static checking.
1576 See http://lists.gnu.org/archive/html/emacs-devel/2011-12/msg00720.html
1577 * ralloc.c (ALIGNED, ROUND_TO_PAGE, HEAP_PTR_SIZE)
1578 (r_alloc_size_in_use, r_alloc_freeze, r_alloc_thaw): Remove; unused.
1579 (r_alloc_sbrk): Now static.
1580
a041960a
PE
1581 Improve ralloc.c interface checking.
1582 See http://lists.gnu.org/archive/html/emacs-devel/2011-12/msg00720.html
1583 * buffer.c (ralloc_reset_variable, r_alloc, r_re_alloc)
1584 (r_alloc_free) [REL_ALLOC]: Move decls from here ...
1585 * lisp.h (r_alloc, r_alloc_free, r_re_alloc, r_alloc_reset_variable)
1586 [REL_ALLOC]: ... to here, to check interface.
1587 * m/ia64.h (r_alloc, r_alloc_free) [REL_ALLOC && !_MALLOC_INTERNAL]:
1588 Remove decls. This fixes an "It stinks!".
1589
9426aba4
PE
1590 * alloc.c (which_symbols): Fix alignment issue / type clash.
1591
d55c12ed
AS
15922012-04-15 Andreas Schwab <schwab@linux-m68k.org>
1593
1594 * lisp.h (struct Lisp_Symbol): Remove explicit padding.
1595 (struct Lisp_Misc_Any): Likewise.
1596 (struct Lisp_Free): Likewise.
1597 * alloc.c (union aligned_Lisp_Symbol): Define.
1598 (SYMBOL_BLOCK_SIZE, struct symbol_block): Use union
1599 aligned_Lisp_Symbol instead of struct Lisp_Symbol.
1600 (union aligned_Lisp_Misc): Define.
1601 (MARKER_BLOCK_SIZE, struct marker_block): Use union
1602 aligned_Lisp_Misc instead of union Lisp_Misc.
4ae29f89 1603 (Fmake_symbol, allocate_misc, gc_sweep): Adjust.
d55c12ed 1604
b948ce8b
PE
16052012-04-14 Paul Eggert <eggert@cs.ucla.edu>
1606
1607 Make GC_MAKE_GCPROS_NOOPS the default (Bug#9926).
1608 * lisp.h (GC_MARK_STACK): Default to GC_MAKE_GCPROS_NOOPS.
1609 * s/cygwin.h, s/darwin.h, s/freebsd.h, s/gnu.h, s/irix6-5.h, s/msdos.h:
1610 * s/netbsd.h, s/sol2-6.h:
1611 Remove definition of GC_MARK_STACK, since the default now works.
1612 * s/aix4-2.h, s/hpux10-20.h, s/unixware.h:
1613 Define GC_MARK_STACK to GC_USE_GCPROS_AS_BEFORE, since that's
1614 no longer the default.
1615 * s/gnu-linux.h (GC_MARK_STACK): Adjust to change in default.
1616
35dc09a1 16172012-04-14 Atsuo Ohki <ohki@gssm.otsuka.tsukuba.ac.jp> (tiny change)
ad3a2b41 1618
35dc09a1
GM
1619 * lread.c (lisp_file_lexically_bound_p):
1620 Fix hang at ";-*-\n" (bug#11238).
ad3a2b41 1621
35dc09a1
GM
16222012-04-14 Eli Zaretskii <eliz@gnu.org>
1623
1624 * xdisp.c (find_last_unchanged_at_beg_row): Don't consider a row
1625 "unchanged" if its end.pos is beyond ZV. (Bug#11199)
1626
16272012-04-14 Jan Djärv <jan.h.d@swipnet.se>
1628
1629 * nsterm.m (constrainFrameRect): Always constrain when there is only
1630 one screen (Bug#10962).
1631
bcd86815
KB
16322012-04-13 Ken Brown <kbrown@cornell.edu>
1633
1634 * s/cygwin.h (PTY_OPEN): Don't try to close a bogus file descriptor.
1635
c25df26e
RT
16362012-04-13 Reuben Thomas <rrt@sc3d.org>
1637
1638 * indent.c (Fmove_to_column): Change interactive spec (Bug#739).
1639
0fc59f1e
DC
16402012-04-11 Daniel Colascione <dancol@dancol.org>
1641
1642 * s/cygwin.h: The vfork the #define in cygwin.h was protecting
1643 against is gone. It's better to use vfork now so that when Cygwin
1644 gains a new, working vfork, we use it automatically (bug#10398).
1645
de8c03dc
SM
16462012-04-11 Stefan Monnier <monnier@iro.umontreal.ca>
1647
1648 * window.c (save_window_save): Obey window-point-insertion-type.
1649
2f097256
GM
16502012-04-11 Glenn Morris <rgm@gnu.org>
1651
1652 * Makefile.in (GNUSTEP_CFLAGS): Rename from C_SWITCH_X_SYSTEM.
1653
453b951e
SM
16542012-04-11 Stefan Monnier <monnier@iro.umontreal.ca>
1655
1656 * alloc.c (lisp_align_malloc): Remove unneeded prototype.
1657
75f1671a 16582012-04-10 Jason S. Cornez <jcornez@ravenpack.com> (tiny change)
6bbef4e5
JC
1659
1660 * keyboard.c: Override inhibit-quit after the third C-g (bug#6585).
1661 (force_quit_count): New var.
1662 (handle_interrupt): Use it.
1663
2a8ce227
JB
16642012-04-10 Juanma Barranquero <lekktu@gmail.com>
1665
1666 * w32.c (w32_delayed_load): Record the full path of the library
1667 being loaded (bug#10424).
1668
935396c0
GM
16692012-04-09 Glenn Morris <rgm@gnu.org>
1670
05920a43
GM
1671 * doc.c (Fsnarf_documentation): Check variables, functions are bound,
1672 not just in the obarray, before snarfing them. (Bug#11036)
1673
935396c0
GM
1674 * Makefile.in ($(leimdir)/leim-list.el):
1675 Pass EMACS rather than BUILT_EMACS.
1676
a18ecafa
TZ
16772012-04-09 Teodor Zlatanov <tzz@lifelogs.com>
1678
1679 * process.c (make_process):
1680 * process.h: Add integer `gnutls_handshakes_tried' member to
1681 process struct.
1682
6bbef4e5
JC
1683 * gnutls.h: Add `GNUTLS_EMACS_HANDSHAKES_LIMIT' upper limit.
1684 Add convenience `GNUTLS_LOG2i' macro.
a18ecafa
TZ
1685
1686 * gnutls.c (gnutls_log_function2i): Convenience log function.
1687 (emacs_gnutls_read): Use new log functions,
1688 `gnutls_handshakes_tried' process member, and
1689 `GNUTLS_EMACS_HANDSHAKES_LIMIT' to limit the number of handshake
1690 attempts per process (connection).
1691
b4d3bc10
CY
16922012-04-09 Chong Yidong <cyd@gnu.org>
1693
1694 * eval.c (Fuser_variable_p, user_variable_p_eh)
1695 (lisp_indirect_variable): Functions deleted.
1696 (Fdefvar): Caller changed.
1697
1698 * callint.c (Finteractive, Fcall_interactively):
1699 * minibuf.c (Fread_variable): Callers changed.
1700
70f4d973
EZ
17012012-04-09 Eli Zaretskii <eliz@gnu.org>
1702
1703 * xdisp.c (set_cursor_from_row): If the display string appears in
1704 the buffer at position that is closer to point than the position
1705 after the display string, display the cursor on the first glyph of
1706 the display string. Fixes cursor display when a 'display' text
1707 property immediately follows invisible text. (Bug#11094)
1708
cb3c2e3e
PE
17092012-04-09 Paul Eggert <eggert@cs.ucla.edu>
1710
1711 composite.c: use 'double' consistently
1712 * composite.c (get_composition_id): Use 'double' consistently
1713 instead of converting 'float' to 'double' and vice versa; this is
1714 easier to understand and avoids a GCC warning.
1715
fd06db5d
GM
17162012-04-09 Glenn Morris <rgm@gnu.org>
1717
50fe702a
GM
1718 * Makefile.in: Generate leim-list with bootstrap-emacs, in
1719 preparation for dumping it with emacs. (Bug#4789)
1720 (leimdir): New variable.
1721 ($(leimdir)/leim-list.el): New rule.
1722 (emacs$(EXEEXT)): Depend on leim-list.el.
1723
fd06db5d
GM
1724 * buffer.c (Qucs_set_table_for_input): Remove. (Bug#9821)
1725 (Fget_buffer_create): Don't call Qucs_set_table_for_input.
1726 (init_buffer_once, syms_of_buffer): Remove Qucs_set_table_for_input.
1727
55c131ee
AS
17282012-04-08 Andreas Schwab <schwab@linux-m68k.org>
1729
1730 * lisp.h (struct Lisp_Symbol): Add explicit padding to ensure
1731 proper alignment.
1732
9209588f
JB
17332012-04-07 Juanma Barranquero <lekktu@gmail.com>
1734
1735 * xml.c (init_libxml2_functions) [WINDOWSNT]:
1736 Remove unused local variable.
1737
e3fb2efb
PE
17382012-04-07 Paul Eggert <eggert@cs.ucla.edu>
1739
1740 Avoid unnecessary pointer scanning in garbage collection (Bug#10780).
1741 * alloc.c (POINTERS_MIGHT_HIDE_IN_OBJECTS): New macro.
1742 (mark_memory): Mark Lisp_Objects only if pointers might hide in
1743 objects, as mark_maybe_pointer will catch them otherwise.
1744 (GC_LISP_OBJECT_ALIGNMENT): Remove; no longer needed.
1745 * s/gnu-linux.h (GC_LISP_OBJECT_ALIGNMENT) [__mc68000__]: Likewise.
1746
b5385551
PE
17472012-04-07 Paul Eggert <eggert@cs.ucla.edu>
1748
1749 Fix typo that broke non-Windows builds.
1750 * xml.c (libxml2_loaded_p) [!!WINDOWSNT]: 'inine' -> 'inline'.
1751
9078ead6
EZ
17522012-04-07 Eli Zaretskii <eliz@gnu.org>
1753
1754 Support building on MS-Windows with libxml2.
1755
1756 * makefile.w32-in (OBJ2): Add xml.$(O).
1757 (GLOBAL_SOURCES): Add xml.c.
1758 ($(BLD)/xml.$(O)): New dependency list.
1759
1760 * xml.c (DEF_XML2_FN, LOAD_XML2_FN) [WINDOWSNT]: New macros.
1761 (fn_htmlReadMemory, fn_xmlReadMemory, fn_xmlDocGetRootElement)
1762 (fn_xmlFreeDoc, fn_xmlCleanupParser, fn_xmlCheckVersion)
1763 [!WINDOWSNT]: New macros.
1764 (init_libxml2_functions, libxml2_loaded_p): New functions.
1765 (parse_region): Call fn_xmlCheckVersion instead of using the macro
1766 LIBXML_TEST_VERSION. Call libxml2 functions via the fn_* macros.
1767 (xml_cleanup_parser): New function, export for fn_xmlCleanupParser.
1768 Calls xmlCleanupParser only if libxml2 was loaded (or statically
1769 linked in).
6bbef4e5
JC
1770 (Flibxml_parse_html_region, Flibxml_parse_xml_region):
1771 Call init_libxml2_functions before calling libxml2 functions.
9078ead6
EZ
1772 (syms_of_xml) <Qlibxml2_dll>: DEFSYM it.
1773
1774 * emacs.c: Don't include libxml/parser.h.
1775 (shut_down_emacs): Call xml_cleanup_parser, instead of calling
1776 xmlCleanupParser directly.
1777
1778 * lisp.h [HAVE_LIBXML2]: Add prototype for xml_cleanup_parser.
1779
3811fdf3
EZ
17802012-04-07 Eli Zaretskii <eliz@gnu.org>
1781
1782 * indent.c (Fvertical_motion): If there is a display string at
1783 point, use it.vpos to compute how many lines to backtrack after
1784 move_it_to point. (Bug#11133)
1785
2f8e16b2
EZ
17862012-04-06 Eli Zaretskii <eliz@gnu.org>
1787
1788 * buffer.h (FETCH_CHAR, FETCH_MULTIBYTE_CHAR):
1789 * character.h (STRING_CHAR, STRING_CHAR_AND_LENGTH): Add comments
1790 about subtle differences between FETCH_CHAR* and STRING_CHAR*
1791 macros related to unification of CJK characters. For the details,
1792 see the discussion following the message here:
1793 http://debbugs.gnu.org/cgi/bugreport.cgi?bug=11073#14.
1794
3d439cd1
CY
17952012-04-04 Chong Yidong <cyd@gnu.org>
1796
1797 * keyboard.c (Vdelayed_warnings_list): Doc fix.
1798
8bc53d00
EZ
17992012-04-01 Eli Zaretskii <eliz@gnu.org>
1800
1801 * w32menu.c (simple_dialog_show, add_menu_item): Use SAFE_ALLOCA
1802 instead of alloca. (Bug#11138)
1803
3b0512a3
AS
18042012-04-01 Andreas Schwab <schwab@linux-m68k.org>
1805
1806 * w32menu.c (is_simple_dialog): Properly check lisp types.
1807 (Bug#11141)
1808
8427ddd2
EZ
18092012-03-31 Eli Zaretskii <eliz@gnu.org>
1810
979022ef
EZ
1811 * xdisp.c (move_it_by_lines): When DVPOS is positive, and the
1812 position we get to after a call to move_it_to fails the
1813 IS_POS_VALID_AFTER_MOVE_P test, move to the next buffer position
1814 only if we wind up in a string from display property. (Bug#11063)
1815
a6b1c7cc
EZ
1816 * window.c (Fdelete_other_windows_internal): Invalidate the row
1817 and column information about mouse highlight, so that redisplay
1818 restores it after reallocating the glyph matrices. (Bug#7464)
1819
8427ddd2
EZ
1820 * xdisp.c (set_cursor_from_row): If `cursor' property on a display
1821 string comes from a `display' text property, use the buffer
1822 position of that property as if we actually saw that position in
1823 the row's glyphs.
697ba24b
EZ
1824 (move_it_by_lines): Remove the assertion that
1825 "it->current_x == 0 && it->hpos == 0" which can be legitimately
1826 violated when there's a before-string at the beginning of a line.
1827 (Bug#11063)
8427ddd2 1828
65a0a738
EZ
18292012-03-30 Eli Zaretskii <eliz@gnu.org>
1830
1831 * xdisp.c (append_space_for_newline): If the default face was
1832 remapped, use the remapped face for the appended newline.
1833 (extend_face_to_end_of_line): Use the remapped default face for
1834 extending the face to the end of the line.
1835 (display_line): Call extend_face_to_end_of_line when the default
1836 face was remapped. (Bug#11068)
1837
581355cc
EZ
18382012-03-29 Eli Zaretskii <eliz@gnu.org>
1839
1840 * s/ms-w32.h: Discourage from defining HAVE_GETCWD.
1841
e8fc049f
SM
18422012-03-28 Stefan Monnier <monnier@iro.umontreal.ca>
1843
1844 * keyboard.c (safe_run_hooks_error): Don't unquote strings.
1845
4fb9a543
GM
18462012-03-27 Glenn Morris <rgm@gnu.org>
1847
1848 * search.c (Fword_search_backward_lax, Fword_search_forward_lax):
1849 Doc fixes.
1850
679910f1
KH
18512012-03-26 Kenichi Handa <handa@m17n.org>
1852
1853 * dispextern.h (struct glyph): Fix previous change. Change the
1854 bit length of glyphless.ch to 25 (Bug#11082).
1855
90d49b7f
CY
18562012-03-26 Chong Yidong <cyd@gnu.org>
1857
1858 * keyboard.c (Vselection_inhibit_update_commands): New variable.
1859 (command_loop_1): Use it; inhibit selection update for
1860 handle-select-window too (Bug#8996).
1861
f514f6f0
FP
18622012-03-25 Fabrice Popineau <fabrice.popineau@supelec.fr>
1863
e8fc049f 1864 * w32heap.c (_heap_init, _heap_term): Remove dead MSVC-specific code.
f514f6f0 1865
bf43fa51
KH
18662012-03-25 Kenichi Handa <handa@m17n.org>
1867
1868 * dispextern.h (struct glyph): Change the bit length of
1869 glyphless.ch to 22 to make the member glyphless fit in 32 bits.
1870
8a0c01dd
EZ
18712012-03-24 Eli Zaretskii <eliz@gnu.org>
1872
1873 * s/ms-w32.h (tzname): Include time.h before redirecting to
1874 _tzname. Fixes the MSVC build. (Bug#9960)
1875
7d1c3a76
AS
18762012-03-24 Andreas Schwab <schwab@linux-m68k.org>
1877
8ed79523
AS
1878 * xdisp.c (produce_glyphless_glyph): Limit length of acronym to 6
1879 characters.
1880
7d1c3a76
AS
1881 * xterm.c (XTread_socket): Only modify handling_signal if
1882 !SYNC_INPUT. (Bug#11080)
1883
e99a9b8b
EZ
18842012-03-23 Eli Zaretskii <eliz@gnu.org>
1885
1886 * bidi.c (bidi_fetch_char): Use STRING_CHAR_AND_LENGTH instead of
1887 FETCH_MULTIBYTE_CHAR followed by CHAR_BYTES. Prevents crashes
1888 when fetching a multibyte character consumes more bytes than
1889 CHAR_BYTES returns, due to unification of CJK characters in
1890 string_char. (Bug#11073)
1891
5063c0e1
TN
18922012-03-23 Troels Nielsen <bn.troels@gmail.com> (tiny change)
1893
1894 * process.c (wait_reading_process_output): Handle pty disconnect
1895 by refraining from sending oneself a SIGCHLD (bug#10933).
1896
9f851fbd
CY
18972012-03-22 Chong Yidong <cyd@gnu.org>
1898
1899 * dispextern.h (struct it): New member string_from_prefix_prop_p.
1900
5063c0e1 1901 * xdisp.c (push_prefix_prop): Rename from push_display_prop.
9f851fbd
CY
1902 Mark string as coming from a prefix property.
1903 (handle_face_prop): Use default face for prefix strings (Bug#4281).
1904 (pop_it, reseat_1): Save and restore string_from_prefix_prop_p.
1905
fb5b8aca
CY
19062012-03-21 Chong Yidong <cyd@gnu.org>
1907
1908 * xfaces.c (Vface_remapping_alist): Doc fix.
1909
62356a1b
EZ
19102012-03-20 Eli Zaretskii <eliz@gnu.org>
1911
1912 * w32proc.c (Fw32_set_console_codepage)
5063c0e1
TN
1913 (Fw32_set_console_output_codepage, Fw32_get_codepage_charset):
1914 Doc fixes.
62356a1b 1915
025de85b
CY
19162012-03-20 Chong Yidong <cyd@gnu.org>
1917
1918 * dispnew.c (Fredisplay, Vredisplay_preemption_period): Update doc
1919 to reflect default non-nil value of redisplay-dont-pause.
1920
4827f94e
KH
19212012-03-19 Kenichi Handa <handa@m17n.org>
1922
1923 * ftfont.c (ftfont_drive_otf): Mask bits of character code to make
1924 it fit in a valid range (Bug#11003).
1925
e50a24a2
EZ
19262012-03-18 Eli Zaretskii <eliz@gnu.org>
1927
1928 * xdisp.c (cursor_row_p): Even if the glyph row ends in a string
1929 that is not from display property, accept the row as a "cursor
1930 row" if one of the string's character has a non-nil `cursor'
1931 property. Fixes cursor positioning when there are newlines in
1932 overlay strings, e.g. in icomplete.el. (Bug#11035)
1933
9af5ed87
PE
19342012-03-12 Paul Eggert <eggert@cs.ucla.edu>
1935
1936 * buffer.c (compare_overlays): Don't assume args differ (Bug#6830).
1937
d1f55f16
CY
19382012-03-12 Chong Yidong <cyd@gnu.org>
1939
1940 * eval.c (inhibit_lisp_code): Rename from
1941 inhibit_window_configuration_change_hook; move from window.c.
1942
1943 * xfns.c (unwind_create_frame_1, Fx_create_frame):
1944 * window.c (run_window_configuration_change_hook)
1945 (syms_of_window): Callers changed.
1946
66c5eebd
CY
19472012-03-11 Chong Yidong <cyd@gnu.org>
1948
413df973
CY
1949 * keymap.c (Fkey_description): Doc fix (Bug#9700).
1950
66c5eebd
CY
1951 * editfns.c (Fconstrain_to_field): Doc fix (Bug#9452).
1952
1de11f56
CY
19532012-03-10 Chong Yidong <cyd@gnu.org>
1954
1955 * frame.c (other_visible_frames): Don't assume the selected frame
1956 is visible (Bug#10955).
1957
cae07000
SM
19582012-03-09 Stefan Monnier <monnier@iro.umontreal.ca>
1959
1960 * buffer.c (compare_overlays): Avoid qsort's instability (bug#6830).
1961
89c94350
JD
19622012-03-08 Jan Djärv <jan.h.d@swipnet.se>
1963
1964 * gtkutil.c (x_wm_set_size_hint): Use one row in call to
1965 FRAME_TEXT_LINES_TO_PIXEL_HEIGHT so base_height is greater than
1966 zero (Bug#10954).
1967
999dd333
GM
19682012-03-03 Glenn Morris <rgm@gnu.org>
1969
01a6dcc8 1970 * alloc.c (Fgarbage_collect, misc-objects-consed): Doc fixes.
999dd333 1971
de0100f2
EZ
19722012-03-02 Eli Zaretskii <eliz@gnu.org>
1973
1974 * xdisp.c (try_window_reusing_current_matrix): Don't move cursor
1975 position past the first glyph_row that ends at ZV. (Bug#10902)
b8456c5c
EZ
1976 (redisplay_window, next_element_from_string): Fix typos in
1977 comments.
3e441275
EZ
1978 (redisplay_window): Pass to move_it_vertically the margin in
1979 pixels, not in screen lines.
de0100f2 1980
96a72ee9
GM
19812012-03-02 Glenn Morris <rgm@gnu.org>
1982
1983 * buffer.c (buffer-list-update-hook): Doc fix.
1984
312508d7
EZ
19852012-02-29 Eli Zaretskii <eliz@gnu.org>
1986
1987 * xdisp.c (get_overlay_strings_1): Under bidi redisplay, call
1988 push_it before setting up the iterator for the first overlay
1989 string, even if we have an empty string loaded.
1990 (next_overlay_string): If there's an empty string on the iterator
1991 stack, pop the stack. (Bug#10903)
1992
27f3c637
PE
19932012-02-25 Paul Eggert <eggert@cs.ucla.edu>
1994
1995 Generalize fix for crash due to non-contiguous EMACS_INT (Bug#10780).
1996 Suggested by Stefan Monnier in
1997 <http://lists.gnu.org/archive/html/emacs-devel/2012-02/msg00692.html>.
1998 * alloc.c (widen_to_Lisp_Object): New static function.
1999 (mark_memory): Also mark Lisp_Objects by fetching pointer words
2000 and widening them to Lisp_Objects. This would work even if
2001 USE_LSB_TAG is defined and wide integers are used, which might
2002 happen in a future version of Emacs.
2003
3c9dfce6
CY
20042012-02-25 Chong Yidong <cyd@gnu.org>
2005
fa74b241
CY
2006 * fileio.c (Ffile_selinux_context, Fset_file_selinux_context):
2007 Doc fix.
2008
3c9dfce6
CY
2009 * xselect.c (Fx_selection_exists_p): Doc fix.
2010 (x_clipboard_manager_save_all): Print an informative message
2011 before saving to clipboard manager.
2012
9486df08
CY
20132012-02-24 Chong Yidong <cyd@gnu.org>
2014
2015 * keyboard.c (process_special_events): Handle all X selection
2016 requests in kbd_buffer, not just the next one (Bug#8869).
2017
f01d3321
CY
20182012-02-23 Chong Yidong <cyd@gnu.org>
2019
2020 * xfns.c (Fx_create_frame): Avoid window-configuration-change-hook
2021 call when setting menu-bar-lines and tool-bar-lines parameters.
2022 (unwind_create_frame_1): New helper function.
2023
2024 * window.c (inhibit_window_configuration_change_hook): New var.
2025 (run_window_configuration_change_hook): Obey it.
b2e4ca7d 2026 (syms_of_window): Initialize it.
f01d3321 2027
86b847b6
CY
20282012-02-22 Chong Yidong <cyd@gnu.org>
2029
2030 * xterm.c (x_draw_image_relief): Add missing type check for
2031 Vtool_bar_button_margin (Bug#10743).
2032
a59225b1
CY
20332012-02-21 Chong Yidong <cyd@gnu.org>
2034
2035 * fileio.c (Vfile_name_handler_alist): Doc fix.
2036
2037 * buffer.c (Fget_file_buffer): Protect against invalid file
2038 handler return value.
2039
310f5bd4
PE
20402012-02-20 Paul Eggert <eggert@cs.ucla.edu>
2041
cb3a28cc
PE
2042 * .gdbinit (xreload): Don't assume EMACS_INT fits in 'long'
2043 when computing $valmask.
2044
310f5bd4
PE
2045 Fix crash due to non-contiguous EMACS_INT (Bug#10780).
2046 * lisp.h (VALBITS): Move definition up, so that USE_LSB_TAG can use it.
2047 (USE_LSB_TAG): Do not define if UINTPTR_MAX >> VALBITS == 0.
2048 It's useless in that case, and it can cause problems on hosts
2049 that allocate halves of EMACS_INT values separately.
2050 Reported by Dan Horák. Diagnosed by Andreas Schwab in
2051 <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=10780#30>.
2052 * mem-limits.h (EXCEEDS_LISP_PTR): Define to 0 on hosts where
2053 UINTPTR_MAX >> VALBITS == 0. This is required by the above change;
2054 it avoids undefined behavior on hosts where shifting right by more
2055 than the word width has undefined behavior.
2056
2375c96a
CY
20572012-02-19 Chong Yidong <cyd@gnu.org>
2058
2059 * fileio.c (Ffile_name_directory, Ffile_name_nondirectory)
2060 (Funhandled_file_name_directory, Ffile_name_as_directory)
2061 (Fdirectory_file_name, Fexpand_file_name)
2062 (Fsubstitute_in_file_name): Protect against invalid file handler
2063 return values (Bug#10845).
2064
3eb49e71
EZ
20652012-02-18 Eli Zaretskii <eliz@gnu.org>
2066
2067 * .gdbinit (pitx): Fix incorrect references to fields of the
2068 iterator stack.
2069
7b926f3f
CY
20702012-02-17 Chong Yidong <cyd@gnu.org>
2071
2072 * syntax.c (Fscan_lists): Doc fix (Bug#10833).
2073
11273115
PE
20742012-02-15 Paul Eggert <eggert@cs.ucla.edu>
2075
2076 * image.c (MAX_IMAGE_SIZE): Increase from 6.0 to 10.0; see
2077 <http://lists.gnu.org/archive/html/emacs-devel/2012-02/msg00540.html>.
2078
c3a70e2b
CY
20792012-02-15 Chong Yidong <cyd@gnu.org>
2080
2081 * eval.c (Fdefvar, Fdefconst): Doc fix; note that the variable is
2082 marked as special. Also, starting docstrings with * is obsolete.
2083
0ca43699
AS
20842012-02-13 Andreas Schwab <schwab@linux-m68k.org>
2085
2086 * gnutls.c (emacs_gnutls_write): Fix last change.
2087
2e8f3c56
LI
20882012-02-13 Lars Ingebrigtsen <larsi@gnus.org>
2089
2090 * gnutls.c (emacs_gnutls_write): Set errno appropriately for
2091 send_process.
2092
af70074f
SM
20932012-02-13 Stefan Monnier <monnier@iro.umontreal.ca>
2094
2095 * keymap.c (Fsingle_key_description): Handle char ranges.
2096
95986d52
CY
20972012-02-12 Chong Yidong <cyd@gnu.org>
2098
afd83bd1
CY
2099 * xdisp.c (handle_stop): Avoid assigning -1 to it->face_id here,
2100 as that creates a dangerous corner case.
2101
95986d52
CY
2102 * window.c (Fdelete_window_internal): Invalidate the mouse
2103 highlight (Bug#9904).
2104
bd7da63e
GM
21052012-02-12 Glenn Morris <rgm@gnu.org>
2106
2107 * xselect.c (Fx_own_selection_internal)
2108 (Fx_get_selection_internal, Fx_disown_selection_internal)
2109 (Fx_selection_owner_p, Fx_selection_exists_p): Doc fixes.
2110 * nsselect.m (Fx_own_selection_internal)
2111 (Fx_disown_selection_internal, Fx_selection_exists_p)
2112 (Fx_selection_owner_p, Fx_get_selection_internal):
2113 Sync docs and argument specs with the xselect.c versions.
2114
77abcbc2
LI
21152012-02-11 Lars Ingebrigtsen <larsi@gnus.org>
2116
2117 * gnutls.c (emacs_gnutls_write): Don't infloop if sendto fails.
2118
90b671e2
EZ
21192012-02-11 Eli Zaretskii <eliz@gnu.org>
2120
1c0ca0b7
EZ
2121 * w32select.c (Fx_selection_exists_p): Sync doc string and
2122 argument list with xselect.c. (Bug#10783)
2123
2124 * w16select.c (Fx_selection_exists_p): Sync doc string and
2125 argument list with xselect.c. (Bug#10783)
90b671e2 2126
49241268
GM
21272012-02-10 Glenn Morris <rgm@gnu.org>
2128
2129 * fns.c (Fsecure_hash): Doc fix.
2130
f998bbe7 21312012-02-09 Kenichi Handa <handa@m17n.org>
5c1ca13d
KH
2132
2133 * coding.c (produce_chars): Fix updating of src_end (Bug#10701).
2134
0992bd9c
CY
21352012-02-07 Chong Yidong <cyd@gnu.org>
2136
2137 * buffer.c (Fbuffer_local_variables)
2138 (buffer_lisp_local_variables): Handle unbound vars correctly;
2139 don't let Qunbound leak into Lisp.
2140
af008560
GM
21412012-02-07 Glenn Morris <rgm@gnu.org>
2142
dd605cc4
GM
2143 * image.c (Fimagemagick_types): Doc fix.
2144
af008560
GM
2145 * image.c (imagemagick-render-type): Change it from a lisp object
2146 to an integer. Move the doc here from the lisp manual.
2147 Treat all values not equal to 0 the same.
2148
1449fa1d
CY
21492012-02-06 Chong Yidong <cyd@gnu.org>
2150
2151 * doc.c (store_function_docstring): Avoid applying docstring of
2152 alias to base function (Bug#2603).
2153
3723ec07
AS
21542012-02-04 Andreas Schwab <schwab@linux-m68k.org>
2155
2156 * .gdbinit (pp1, pv1): Remove redundant defines.
2157 (pr): Use pp.
2158
79c1cc1e
CY
21592012-02-04 Chong Yidong <cyd@gnu.org>
2160
2161 * nsterm.m: Declare a global (Bug#10694).
2162
d7f29f8e
EZ
21632012-02-04 Eli Zaretskii <eliz@gnu.org>
2164
cae07000
SM
2165 * w32.c (get_emacs_configuration_options):
2166 Include --enable-checking, if specified, in the return value.
d7f29f8e 2167
3b95a6f9
MR
21682012-02-04 Martin Rudalics <rudalics@gmx.at>
2169
2170 * dispnew.c (change_frame_size_1): Calculate new_frame_total_cols
2171 after rounding frame sizes. (Bug#9723)
2172
d6fa96a6
EZ
21732012-02-04 Eli Zaretskii <eliz@gnu.org>
2174
2175 * keyboard.c (adjust_point_for_property): Don't position point
2176 before BEGV. (Bug#10696)
2177
df0b2940
PE
21782012-02-03 Paul Eggert <eggert@cs.ucla.edu>
2179
2180 Handle overflow when computing char display width (Bug#9496).
2181 * character.c (char_width): Return EMACS_INT, not int.
2182 (char_width, c_string_width): Check for overflow when
2183 computing the width; this is possible now that individual
2184 characters can have unbounded width. Problem introduced
2185 by merge from Emacs 23 on 2012-01-19.
2186
6bee44d6
MA
21872012-02-02 Michael Albinus <michael.albinus@gmx.de>
2188
2189 * dbusbind.c (Fdbus_register_method): Mention the return value
2190 :ignore in the docstring.
2191
44f92739
GM
21922012-02-02 Glenn Morris <rgm@gnu.org>
2193
1b9f60cc
GM
2194 * callproc.c (Fcall_process, Fcall_process_region): Doc fix.
2195
44f92739
GM
2196 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
2197 Unconditionally set to t. (Bug#10673)
2198 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
2199 * w32term.c (syms_of_w32term) <x-toolkit-scroll-bars>:
2200 * xterm.c (syms_of_xterm) <x-toolkit-scroll-bars>: Doc fix.
2201
c5d3843c
KH
22022012-02-02 Kenichi Handa <handa@m17n.org>
2203
2204 (x_produce_glyphs): Cancel previous change. If cmp->glyph_len is
2205 0, do not call append_composite_glyph.
2206
159462d4 22072012-02-02 Kenichi Handa <handa@m17n.org>
d2a51fd7
KH
2208
2209 * xdisp.c (BUILD_COMPOSITE_GLYPH_STRING): Initialize first_s to
2210 NULL (Bug#6988).
2211 (x_produce_glyphs): If the component of a composition is a null
2212 string, set it->pixel_width to 1 to avoid zero-width glyph.
2213
78cef877
EZ
22142012-02-01 Eli Zaretskii <eliz@gnu.org>
2215
2216 * ralloc.c (resize_bloc, r_alloc_sbrk): Don't call memmove if its
2217 first 2 arguments are identical. This makes inserting large
2218 output from a subprocess an order of magnitude faster on
2219 MS-Windows, where all sbrk'ed memory is always contiguous.
2220
97897668
GM
22212012-01-31 Glenn Morris <rgm@gnu.org>
2222
2223 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
c78c6e0b 2224 * w32term.c (syms_of_w32term) <x-toolkit-scroll-bars>:
97897668
GM
2225 * xterm.c (syms_of_xterm) <x-toolkit-scroll-bars>: Sync docs.
2226
31fd3586
GM
22272012-01-29 Glenn Morris <rgm@gnu.org>
2228
2229 * gnutls.c (syms_of_gnutls): More doc (from etc/NEWS).
2230
0e24a8b2
CY
22312012-01-28 Samuel Thibault <sthibault@debian.org> (tiny change)
2232
2233 * s/gnu.h: Define POSIX_SIGNALS (Bug#10552).
2234
cc0adcb0
CY
22352012-01-28 Chong Yidong <cyd@gnu.org>
2236
2237 * minibuf.c (syms_of_minibuf): Doc fix (Bug#10550).
2238
acc28cb9
CY
22392012-01-26 Chong Yidong <cyd@gnu.org>
2240
9c69cfb7
CY
2241 * keyboard.c (Vecho_keystrokes): Document zero value (Bug#10503).
2242
acc28cb9
CY
2243 * search.c (Fsearch_forward, Fsearch_backward): Document negative
2244 repeat counts (Bug#10507).
2245
48da7392
GM
22462012-01-26 Glenn Morris <rgm@gnu.org>
2247
2248 * lread.c (syms_of_lread): Doc fix.
2249
14af5f7f
CY
22502012-01-25 HIROSHI OOTA <nil@mad.dog.cx> (tiny change)
2251
2252 * coding.c (encode_designation_at_bol): Change return value to
2253 EMACS_INT.
2254
0b21c100
CY
22552012-01-25 Chong Yidong <cyd@gnu.org>
2256
2257 * eval.c (Fuser_variable_p): Doc fix; mention custom-variable-p.
2258
3c2907f7
CY
22592012-01-21 Chong Yidong <cyd@gnu.org>
2260
2261 * floatfns.c (Fcopysign): Make the second argument non-optional,
2262 since nil is not allowed anyway.
2263
959ad23f
AS
22642012-01-21 Andreas Schwab <schwab@linux-m68k.org>
2265
2266 * process.c (read_process_output): Use p instead of XPROCESS (proc).
2267 (send_process): Likewise.
2268
34a02f46
MR
22692012-01-19 Martin Rudalics <rudalics@gmx.at>
2270
2271 * window.c (save_window_save, Fcurrent_window_configuration)
cae07000
SM
2272 (Vwindow_persistent_parameters): Do not use Qstate.
2273 Rewrite doc-strings.
34a02f46 2274
1259009a 22752012-01-19 Kenichi Handa <handa@m17n.org>
25ed9e61
KH
2276
2277 * character.c (char_width): New function.
70d4fdf6
GM
2278 (Fchar_width, c_string_width, lisp_string_width):
2279 Use char_width (Bug#9496).
25ed9e61 2280
6a6ee00d
MR
22812012-01-16 Martin Rudalics <rudalics@gmx.at>
2282
2283 * window.c (Vwindow_persistent_parameters): New variable.
2284 (Fset_window_configuration, save_window_save): Handle persistent
2285 window parameters.
2286
c85efaf7
EZ
22872012-01-14 Eli Zaretskii <eliz@gnu.org>
2288
2289 * w32fns.c (signal_user_input): Don't do a QUIT, to avoid
2290 thrashing the stack of the thread. (Bug#9087)
2291
5944709e
PE
22922012-01-12 Paul Eggert <eggert@cs.ucla.edu>
2293
2294 * xdisp.c (rows_from_pos_range): Add parens as per gcc -Wparentheses.
2295
e71f5d99
EZ
22962012-01-11 Eli Zaretskii <eliz@gnu.org>
2297
2298 * xdisp.c (rows_from_pos_range): Handle the case where the
2299 highlight ends on a newline. (Bug#10464)
2300 (mouse_face_from_buffer_pos): Fix off-by-one error in calculating
2301 he end column for display of highlight that ends on a newline
2302 before a R2L line.
2303
ce316182
GM
23042012-01-11 Glenn Morris <rgm@gnu.org>
2305
2306 * lread.c (init_lread): If no-site-lisp, remove site-lisp dirs
2307 from load-path also when installation-directory is nil. (Bug#10208)
2308
5b43da69
GM
23092012-01-10 Glenn Morris <rgm@gnu.org>
2310
74cc8ff9
GM
2311 * emacs.c (syms_of_emacs) <installation-directory>: Doc fix.
2312
7d8d6e4e
GM
2313 * epaths.in (PATH_LOADSEARCH, PATH_EXEC, PATH_DATA, PATH_DOC):
2314 Update template values to be closer to their typical values these days.
5b43da69 2315
a0db8d43
EZ
23162012-01-09 Eli Zaretskii <eliz@gnu.org>
2317
2318 * xdisp.c (rows_from_pos_range): Accept additional argument
2319 DISP_STRING, and accept any glyph in a row whose object is that
2320 string as eligible for mouse highlight. Fixes mouse highlight of
2321 display strings from overlays. (Bug#10464)
2322
9a0115ab 23232012-01-07 Paul Eggert <eggert@cs.ucla.edu>
09450bae 2324
b9110d6a 2325 emacs: fix an auto-save permissions race condition (Bug#10400)
09450bae
PE
2326 * fileio.c (auto_saving_dir_umask): New static var.
2327 (Fmake_directory_internal): Use it.
2328 (do_auto_save_make_dir): Set it, instead of invoking chmod after
2329 creating the directory. The old code temporarily assigns
2330 too-generous permissions to the directory.
2331 (do_auto_save_eh): Clear it.
b9110d6a 2332 (Fdo_auto_save): Catch all errors, not just file errors, so
09450bae
PE
2333 that the var is always cleared.
2334
6c1bd3f3
EZ
23352012-01-07 Eli Zaretskii <eliz@gnu.org>
2336
2337 * search.c (scan_buffer): Pass character positions to
2338 know_region_cache, not byte positions. (Bug#6540)
2339
069d2b50
L
23402012-01-07 LynX <_LynX@bk.ru> (tiny change)
2341
2342 * w32.c (sys_rename): Report EXDEV when rename of a directory
2343 fails because the target is on another logical disk. (Bug#10284)
2344
75bf0d33
DB
23452012-01-07 David Benjamin <davidben@mit.edu> (tiny change)
2346
2347 * xterm.c (x_embed_request_focus): New function.
2348
2349 * xterm.h: Add prototype.
2350
2351 * xfns.c (Fx_focus_frame): Use it for embedded frames (Bug#9977).
2352
1c6e5a32
GM
23532012-01-05 Glenn Morris <rgm@gnu.org>
2354
2355 * emacs.c (emacs_copyright): Update short copyright year to 2012.
2356
651e947e
EZ
23572012-01-01 Eli Zaretskii <eliz@gnu.org>
2358
2359 * gnutls.c (init_gnutls_functions): Load gnutls_check_version.
2360 Load gnutls_transport_set_lowat only if GnuTLS version is below
2361 2.11.1.
2362 (emacs_gnutls_handshake): Call gnutls_transport_set_lowat only for
2363 GnuTLS versions below 2.11.1.
2364
3778cdd8
AL
23652011-12-31 Antoine Levitt <antoine.levitt@gmail.com>
2366
2367 * xdisp.c (syms_of_xdisp) <window-scroll-functions>: Add warning
2368 to the doc string advising against its use for altering the way
2369 windows are scrolled.
2370
0e5317f7
KH
23712011-12-28 Kenichi Handa <handa@m17n.org>
2372
2373 * coding.c (Fdefine_coding_system_internal): Make an utf-8 base
2374 coding-system ASCII compatible only when it does not produce BOM
2375 on encoding (Bug#10383).
2376
93d5ca1f
JD
23772011-12-26 Jan Djärv <jan.h.d@swipnet.se>
2378
2379 * xmenu.c (x_menu_wait_for_event): Use xg_select for Gtk3 so menus
2380 can scroll.
2381 (create_and_show_popup_menu): Always use menu_position_func for
2382 Gtk3 (Bug#10361).
2383
ca22b785
AS
23842011-12-24 Andreas Schwab <schwab@linux-m68k.org>
2385
2386 * callint.c (Fcall_interactively): Don't truncate prompt string.
2387
d048e1e6
EZ
23882011-12-23 Eli Zaretskii <eliz@gnu.org>
2389
2390 * xdisp.c (handle_invisible_prop): Handle correctly an invisible
2391 property that ends at ZV, so that the bidi iteration could be
3ba1a2ad 2392 resumed from there (after widening). (Bug#10360)
d048e1e6 2393
5ccaba1f
JD
23942011-12-22 Jan Djärv <jan.h.d@swipnet.se>
2395
2396 * nsfont.m (ns_spec_to_descriptor): Do not autorelease fdesc.
2397
204ee57f
JD
23982011-12-21 Jan Djärv <jan.h.d@swipnet.se>
2399
b81d40f0
JB
2400 * nsterm.m (x_free_frame_resources):
2401 Release f->output_data.ns->miniimage.
204ee57f
JD
2402 (ns_index_color): Fix indentation. Do not retain
2403 color_table->colors[i].
2404
2405 * nsmenu.m (ns_update_menubar): Call free_menubar_widget_value_tree
2406 before returning.
2407
2408 * nsfns.m (x_set_background_color): Assign return value from
2409 ns_index_color to face-background instead of NSColor*.
2410 (ns_implicitly_set_icon_type): Fix indentation.
2411 Change assignment in for loop to comparison.
2412
2413 * emacs.c (ns_pool): New variable.
2414 (main): Assign ns_pool.
2415 (Fkill_emacs): Call ns_release_autorelease_pool.
2416
2417 * nsfont.m (ns_spec_to_descriptor): Fix indentation,
2418 autorelease fdesc, release fdAttrs and tdict.
2419 (ns_get_covering_families): Release charset.
2420 (ns_findfonts): Release NSFontDescriptor created with new.
2421 (ns_uni_to_glyphs): Fix indentation.
2422 (setString): Release attrStr before assigning new value.
2423
c803b2b7
JD
24242011-12-18 Jan Djärv <jan.h.d@swipnet.se>
2425
678f4426
JD
2426 * nsmenu.m (NSMenuDidBeginTrackingNotification): Declare if OSX < 10.5
2427 and NS_IMPL_COCOA.
2428 (trackingNotification): Surround with ifdef NS_IMPL_COCOA.
2429 (syms_of_nsmenu): Set trackingMenu to 1 if not NS_IMPL_COCOA.
2430
cd394be1 24312011-12-18 David Reitter <reitter@cmu.edu>
678f4426 2432
5fecd5fc
JD
2433 * nsterm.m (ns_term_init): Subscribe for notifications
2434 NSMenuDidBeginTrackingNotification and NSMenuDidEndTrackingNotification
2435 to method trackingNotification in EmacsMenu.
2436
2437 * nsmenu.m (trackingMenu): New variable.
3771cb17 2438 (trackingNotification): New method (from Aquamacs).
5fecd5fc 2439 (menuNeedsUpdate): Expand comment and return if trackingMenu is 0,
3771cb17 2440 from Aquamacs (Bug#7030).
678f4426
JD
2441
24422011-12-18 Jan Djärv <jan.h.d@swipnet.se>
5fecd5fc 2443
c803b2b7
JD
2444 * nsselect.m (CUT_BUFFER_SUPPORT): Remove define.
2445 (symbol_to_nsstring): Fix indentation.
2446 (ns_symbol_to_pb): New function.
cae07000
SM
2447 (Fns_get_selection_internal): Rename from Fns_get_cut_buffer_internal.
2448 (Fns_rotate_cut_buffers_internal): Remove.
2449 (Fns_store_selection_internal): Rename from
c803b2b7
JD
2450 Fns_store_cut_buffer_internal.
2451 (ns_get_foreign_selection, Fx_own_selection_internal)
2452 (Fx_disown_selection_internal, Fx_selection_exists_p)
b81d40f0
JB
2453 (Fns_get_selection_internal, Fns_store_selection_internal):
2454 Use ns_symbol_to_pb and check if return value is nil.
2455 (syms_of_nsselect): Remove ifdef CUT_BUFFER_SUPPORT. Remove defsubr
2456 Sns_rotate_cut_buffers_internal. Sns_get_cut_buffer_internal
c803b2b7
JD
2457 renamed to Sns_get_selection_internal, Sns_store_cut_buffer_internal
2458 renamed to Sns_store_selection_internal.
2459 (ns_handle_selection_request): Move code to Fx_own_selection_internal
2460 and remove this function.
2461 (ns_handle_selection_clear): Remove, never used.
2462 (Fx_own_selection_internal): Move code from ns_handle_selection_request
2463 here.
2464
e1b01a3a
KB
24652011-12-17 Ken Brown <kbrown@cornell.edu>
2466
2467 * fileio.c (check_writable) [CYGWIN]: Return non-zero if UID or
2468 GID is unknown (Bug#10257).
2469
2adb6e85
PE
24702011-12-17 Paul Eggert <eggert@cs.ucla.edu>
2471
2472 * s/gnu-linux.h: Fix mark_memory typo (Bug#10286).
2473 (GC_MARK_SECONDARY_STACK): Omit removed 3rd arg to mark_memory,
2474 which caused a build failure on GNU/Linux IA-64. This problem was
2475 introduced by my 2011-10-07 patch.
2476
d1d7b339
JL
24772011-12-15 Juri Linkov <juri@jurta.org>
2478
2479 * image.c (imagemagick_error): New function. (Bug#10112)
2480 (imagemagick_load_image): Comment out `MagickSetResolution' call.
2481 Use `imagemagick_error' where ImageMagick functions return
2482 `MagickFalse'.
2483 (Fimagemagick_types): Add `Fnreverse' to return the list in the
2484 proper order.
2485
100d5755
KH
24862011-12-15 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
2487
2488 * xftfont.c (xftfont_draw): Use the font metrics of s->font to
2489 fill background (Bug#8992).
2490
454592a6
MR
24912011-12-13 Martin Rudalics <rudalics@gmx.at>
2492
2493 * window.c (Vwindow_combination_resize)
2494 (Vwindow_combination_limit): Use t instead of non-nil in
2495 doc-strings.
61d4b438
MR
2496 (Vrecenter_redisplay): Add first sentence of doc-string on
2497 separate line.
53524d93 2498 (Frecenter): Fix doc-string typo.
454592a6 2499
3633e3aa
KH
25002011-12-11 Kenichi Handa <handa@m17n.org>
2501
2502 * coding.c (Funencodable_char_position): Pay attention to the
2503 buffer text relocation (Bug#9389).
2504
7b9d523a 25052011-12-10 Jan Djärv <jan.h.d@swipnet.se>
61ccba97 2506
7b9d523a
JD
2507 * xterm.c (x_term_init): Move call to gdk_window_add_filter before
2508 gtk_init (Bug#10100).
2509
b73189c6
EZ
25102011-12-10 Eli Zaretskii <eliz@gnu.org>
2511
2512 * xdisp.c (RECORD_MAX_MIN_POS): Use IT->cmp_it.charpos only if
2513 IT->string is nil. (Bug#10263)
2514
f7dfe5d6
JD
25152011-12-10 Jan Djärv <jan.h.d@swipnet.se>
2516
83faebb4
JD
2517 * nsterm.h (x_free_frame_resources): Declare.
2518
f7dfe5d6
JD
2519 * nsfns.m (ns_get_defaults_value): New function (Bug#10103).
2520 (Fns_get_resource, x_get_string_resource): Call ns_get_defaults_value.
2521
2522 * nsterm.h (ns_get_defaults_value): Declare.
2523
2524 * nsterm.m (ns_default): Call ns_get_defaults_value.
2525
7cd4e72c
EZ
25262011-12-09 Eli Zaretskii <eliz@gnu.org>
2527
2528 * xdisp.c (try_scrolling): Don't set scroll_down_p if dy is zero.
2529 (Bug#10170)
2530
b34d7317
YM
25312011-12-09 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
2532
2533 * unexelf.c (unexec) [NS_IMPL_GNUSTEP]: Take account of the case
2534 that where the value of an _OBJC_* symbol points to is in the .bss
2535 section (Bug#10240).
2536
76470ad1
KH
25372011-12-08 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
2538
2539 * coding.c (encode_coding_ccl): Check (charbuf < charbuf_end)
2fac8180 2540 after the loop to call ccl_driver at least once (Bug#8619).
76470ad1 2541
745fff94
KH
25422011-12-08 Kenichi Handa <handa@m17n.org>
2543
2544 * ftfont.c (get_adstyle_property): Fix previous change
2545 (Bug#10233).
2546
6e44397c
JB
25472011-12-07 Juanma Barranquero <lekktu@gmail.com>
2548
2549 * w32.c (init_environment): If no_site_lisp, remove site-lisp
2550 dirs from the default value of EMACSLOADPATH (bug#10208).
2551
7efa6272
GM
25522011-12-07 Glenn Morris <rgm@gnu.org>
2553
2554 * lread.c (init_lread): If no_site_lisp, exclude site-lisp/ in
2555 installation and source directories as well. (Bug#10208)
2556
f6fc4d87
CY
25572011-12-06 Chong Yidong <cyd@gnu.org>
2558
2559 * minibuf.c (Fread_from_minibuffer): Doc fix (Bug#10228).
2560
2bf26180
GM
25612011-12-06 Glenn Morris <rgm@gnu.org>
2562
2563 * process.c (start_process_unwind): Treat any pid <= 0, except -2,
2564 as an error, not just -1. (Bug#10217)
2565
3a6ad4f0
CY
25662011-12-05 Chong Yidong <cyd@gnu.org>
2567
2568 * keyboard.c (process_special_events): New function.
2569 (swallow_events, Finput_pending_p): Use it (Bug#10195).
2570
75a3b399
PE
25712011-12-05 Paul Eggert <eggert@cs.ucla.edu>
2572
2573 * coding.c (encode_designation_at_bol): Don't use uninitialized
2574 local variable (Bug#9318).
2575
c3c9e25e
KH
25762011-12-05 Kenichi Handa <handa@m17n.org>
2577
2578 * ftfont.c (get_adstyle_property): If the font is not BDF nor PCF,
2579 return Qnil (Bug#8046, Bug#10193).
2580
5eb05ea3
KH
25812011-12-05 Kenichi Handa <handa@m17n.org>
2582
2583 * coding.c (encode_designation_at_bol): New args charbuf_end and
2584 dst. Return the number of produced bytes. Callers changed.
a79703f5
KH
2585 (coding_set_source): Return how many bytes coding->source was
2586 relocated.
2587 (coding_set_destination): Return how many bytes
2588 coding->destination was relocated.
2589 (CODING_DECODE_CHAR, CODING_ENCODE_CHAR, CODING_CHAR_CHARSET)
cae07000 2590 (CODING_CHAR_CHARSET_P): Adjust for the avove changes.
5eb05ea3
KH
2591
25922011-12-05 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
2593
2594 * coding.c (CODING_CHAR_CHARSET_P): New macro.
2595 (encode_coding_emacs_mule, encode_coding_iso_2022): Use the above
2596 macro (Bug#9318).
2597
25982011-12-05 Andreas Schwab <schwab@linux-m68k.org>
2599
2600 The following changes are to fix Bug#9318.
2601
a79703f5 2602 * coding.c (CODING_ENCODE_CHAR, CODING_CHAR_CHARSET): New macros.
5eb05ea3
KH
2603 (encode_coding_emacs_mule, ENCODE_ISO_CHARACTER)
2604 (encode_coding_iso_2022, encode_coding_sjis)
a79703f5 2605 (encode_coding_big5, encode_coding_charset): Use the above macros.
5eb05ea3 2606
7dbda6df
JB
26072011-12-05 Juanma Barranquero <lekktu@gmail.com>
2608
2609 * lisp.h (process_quit_flag): Fix external declaration.
2610
6d5eb5b0
SM
26112011-12-04 Stefan Monnier <monnier@iro.umontreal.ca>
2612
2613 Don't macro-inline non-performance-critical code.
2614 * eval.c (process_quit_flag): New function.
2615 * lisp.h (QUIT): Use it.
2616
a0c3fad0
JD
26172011-12-04 Jan Djärv <jan.h.d@swipnet.se>
2618
2619 * nsfns.m (get_geometry_from_preferences): New function.
2620 (Fx_create_frame): Call get_geometry_from_preferences (Bug#10103).
2621
6c07aac2
AS
26222011-12-04 Andreas Schwab <schwab@linux-m68k.org>
2623
2624 * emacs.c (Qkill_emacs): Define.
2625 (syms_of_emacs): Initialize it.
2626 * keyboard.c (interrupt_signal): Don't call Fkill_emacs here, set
2627 Qquit_flag to `kill-emacs' instead.
6d5eb5b0
SM
2628 (quit_throw_to_read_char): Add parameter `from_signal'.
2629 All callers changed. Call Fkill_emacs if requested and safe.
6c07aac2
AS
2630 * lisp.h (QUIT): Call Fkill_emacs if requested.
2631
c052ead4
JD
26322011-12-03 Jan Djärv <jan.h.d@swipnet.se>
2633
2634 * widget.c (update_wm_hints): Return if wmshell is null.
2635 (widget_update_wm_size_hints): New function.
2636
2637 * widget.h (widget_update_wm_size_hints): Declare.
2638
2639 * xterm.c (x_wm_set_size_hint): If USE_X_TOOLKIT, call
2640 widget_update_wm_size_hints (Bug#10104).
2641
9e49252b
EZ
26422011-12-03 Eli Zaretskii <eliz@gnu.org>
2643
2644 * xdisp.c (handle_invisible_prop): If the invisible text ends just
2645 before a newline, prepare the bidi iterator for consuming the
2646 newline, and keep the current paragraph direction. (Bug#10183)
e9a49426 2647 (redisplay_window): Don't let `margin' become negative. (Bug#10192)
9e49252b 2648
02b16839
JL
26492011-12-02 Juri Linkov <juri@jurta.org>
2650
2651 * search.c (Fword_search_regexp): New Lisp function created from
2652 `wordify'. Change type of arg `lax' from `int' to `Lisp_Object'.
2653 (Fword_search_backward, Fword_search_forward)
2654 (Fword_search_backward_lax, Fword_search_forward_lax):
2655 Use `Fword_search_regexp' instead of `wordify'. Doc fix.
2656 (syms_of_search): Define `Sword_search_regexp'. (Bug#10145)
2657
0068070e
SM
26582011-12-01 Stefan Monnier <monnier@iro.umontreal.ca>
2659
2660 * fileio.c (Finsert_file_contents): Move after-change-function call
2661 to before the "handled:" label, since all "goto handled" appear in
2662 cases where the *-change-functions have already been properly called
2663 (bug#10117).
2664
3360a3fc
AS
26652011-12-01 Andreas Schwab <schwab@linux-m68k.org>
2666
2667 * keyboard.c (interrupt_signal): Don't call kill-emacs when
2668 waiting for input. (Bug#10169)
2669
73d6c093
EZ
26702011-11-30 Eli Zaretskii <eliz@gnu.org>
2671
2672 * dispnew.c (adjust_glyph_matrix): Remove the assertion that
2673 verifies glyph row's hash code--we have just reallocated the
2674 glyphs, so their contents can be complete garbage. (Bug#10164)
2675
febe6bea
JB
26762011-11-30 Juanma Barranquero <lekktu@gmail.com>
2677
2678 * dispnew.c (adjust_glyph_matrix) [XASSERTS]: Add missing check.
2679
801a4313
EZ
26802011-11-30 Eli Zaretskii <eliz@gnu.org>
2681
2682 * dispnew.c (adjust_glyph_matrix) [XASSERTS]: Ensure ROW's
2683 attributes are tested _before_ calling verify_row_hash, to protect
2684 against GCC re-ordering of the tests. (Bug#10164)
2685
2b56b87e
JD
26862011-11-29 Jan Djärv <jan.h.d@swipnet.se>
2687
2688 * xterm.h (struct x_output): net_wm_state_hidden_seen is new.
2689
2690 * xterm.c (handle_one_xevent): Only set async_visible and friends
2691 if net_wm_state_hidden_seen is non-zero (Bug#10002)
7dbda6df 2692 (get_current_wm_state): Set net_wm_state_hidden_seen to 1 if
2b56b87e
JD
2693 _NET_WM_STATE_HIDDEN is in NET_WM_STATE.
2694
dbf31225
PE
26952011-11-28 Paul Eggert <eggert@cs.ucla.edu>
2696
2697 Remove GCPRO-related macros that exist only to avoid shadowing locals.
2698 * lisp.h (GCPRO1_VAR, GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR, GCPRO5_VAR)
2699 (GCPRO6_VAR, UNGCPRO_VAR): Remove. See
2700 <http://lists.gnu.org/archive/html/emacs-diffs/2011-11/msg00265.html>.
2701 All uses changed to use GCPRO1 etc.
2702 (GCPRO1, GCPRO2, GCPRO3, GCPRO4, GCPRO5, GCPRO6, UNGCPRO):
2703 Revert to old implementation (i.e., before 2011-03-11).
2704
1305621b
YM
27052011-11-28 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
2706
2707 * dispnew.c (scrolling_window): Truncate overlaps in copy destination
2708 of scroll runs so as to avoid assigning disabled bogus rows and
2709 unnecessary graphics copy operations.
2710
8c9afb46
EZ
27112011-11-27 Eli Zaretskii <eliz@gnu.org>
2712
2713 * s/ms-w32.h (utimbuf) [_MSC_VER]: Don't define.
2714 (snprintf) [_MSC_VER]: Redirect to _snprintf.
2715 (strtoll) [_MSC_VER]: Redirect to _strtoi64.
2716 (malloc, free, realloc, calloc): Redirect to e_* only when
2717 compiling Emacs.
2718
2719 * lisp.h (GCTYPEBITS): Move before first use.
2720 (ALIGN_GCTYPEBITS) [_MSC_VER]: Define.
2721 (DECL_ALIGN) [_MSC_VER]: Use it, as MSVC doesn't like bit ops in
2722 this macro definition.
2723
2724 * s/ms-w32.h (tzname): Redirect to _tzname for all values of
2725 _MSC_VER.
2726
54e9e3bf
JD
27272011-11-27 Jan Djärv <jan.h.d@swipnet.se>
2728
6d5eb5b0
SM
2729 * gtkutil.c (xg_create_frame_widgets):
2730 Call gtk_window_set_has_resize_grip (FALSE) if that function is
54e9e3bf
JD
2731 present with Gtk+ 2.0.
2732
83aca1cb
PE
27332011-11-26 Paul Eggert <eggert@cs.ucla.edu>
2734
2735 * fileio.c (Finsert_file_contents): Undo previous change; see
2736 <http://lists.gnu.org/archive/html/emacs-diffs/2011-11/msg00265.html>.
2737
5b76caa4
PE
27382011-11-26 Paul Eggert <eggert@cs.ucla.edu>
2739
2740 Rename locals to avoid shadowing.
2741 * fileio.c (Finsert_file_contents):
2742 Rename inner 'gcpro1' to 'inner_gcpro1' to avoid shadowing.
2743 * process.c (wait_reading_process_output):
2744 Rename inner 'proc' to 'p' to avoid shadowing.
2745 Indent for consistency with usual Emacs style.
2746
8c535114
EZ
27472011-11-25 Eli Zaretskii <eliz@gnu.org>
2748
2749 * xdisp.c (redisplay_window): If cursor row is not fully visible
2750 after recentering, and scroll-conservatively is set to a large
2751 number, scroll window by a few more lines to make the cursor fully
2752 visible and out of scroll-margin. (Bug#10105)
91b4a718
EZ
2753 (start_display): Don't move to the next line if the display should
2754 start at a newline that is part of a display vector or an overlay
2755 string. (Bug#10119)
8c535114 2756
fa4fdb5c
JL
27572011-11-24 Juri Linkov <juri@jurta.org>
2758
2759 * image.c (imagemagick_load_image): Move `MagickSetResolution' down
2760 after the `MagickPingImage' call. (Bug#10112)
2761
90ec88df
CY
27622011-11-23 Chong Yidong <cyd@gnu.org>
2763
2764 * window.c (Fcoordinates_in_window_p): Accept only live windows.
2765
56e2e794
MR
27662011-11-23 Martin Rudalics <rudalics@gmx.at>
2767
2768 * buffer.c (Fkill_buffer): Run replace_buffer_in_windows before
2769 making another buffer current. (Bug#10114)
2770
b6e64c41
GM
27712011-11-23 Glenn Morris <rgm@gnu.org>
2772
2773 * font.c (font_find_for_lface) [HAVE_NS]: Ignore case. (Bug#2526)
2774
6b21de18
CY
27752011-11-23 Chong Yidong <cyd@gnu.org>
2776
2777 * xdisp.c (compute_stop_pos): Check validity of end_charpos before
2778 using it (Bug#5984).
2779
b12cd789
EZ
27802011-11-22 Eli Zaretskii <eliz@gnu.org>
2781
2782 * dispnew.c (adjust_glyph_matrix): Don't verify hash code of mode-
2783 and header-lines, as they don't have one computed for them.
2784 (Bug#10098)
2785
2786 * .gdbinit (prow): Make displayed values more self-explaining.
2787 Add row's hash code.
2788
261b6fd4
LMI
27892011-11-21 Lars Magne Ingebrigtsen <larsi@gnus.org>
2790
2791 * process.c (wait_reading_process_output): Fix asynchrounous
2792 GnuTLS socket handling on some versions of the GnuTLS library.
16c1ad08 2793 (wait_reading_process_output): Add comment and URL.
261b6fd4 2794
e7cfd277
JD
27952011-11-21 Jan Djärv <jan.h.d@swipnet.se>
2796
2797 * xterm.c (x_clear_frame): Reinstate the XClearWindow call.
2798
a9b9b7f5
CY
27992011-11-21 Chong Yidong <cyd@gnu.org>
2800
2801 * window.c (Fnext_window, Fprevious_window): Doc fix.
2802
b0d15b4f
SM
28032011-11-20 Stefan Monnier <monnier@iro.umontreal.ca>
2804
2805 * window.c (get_phys_cursor_glyph): Fix Lisp_Object/int mixup.
2806
fe7a3057
JB
28072011-11-20 Juanma Barranquero <lekktu@gmail.com>
2808
2809 * nsfont.m (syms_of_nsfont) <ns-reg-to-script>: Fix typo.
2810
d2999b1a
MR
28112011-11-20 Martin Rudalics <rudalics@gmx.at>
2812
2813 * window.c (Fset_window_combination_limit): Rename argument
2814 STATUS to LIMIT.
2815 (Vwindow_combination_limit): Remove "status" from doc-string.
2816
d5ff9cd0
AS
28172011-11-20 Andreas Schwab <schwab@linux-m68k.org>
2818
2819 * m/ibms390.h: Remove.
2820 * m/ibms390x.h: Don't include "ibms390.h".
2821
a5bb9bd3
SM
28222011-11-20 Stefan Monnier <monnier@iro.umontreal.ca>
2823
2824 * fileio.c (Finsert_file_contents): Add missing gcpro1 variable.
2825 Suggested by Dmitry Antipov <dmantipov@yandex.ru>.
2826
cd1181db
JB
28272011-11-20 Juanma Barranquero <lekktu@gmail.com>
2828
2829 * casetab.c (Fset_case_table):
2830 * charset.c (Fcharset_after): Fix typos.
2831
615a3b8d 28322011-11-20 Paul Eggert <eggert@cs.ucla.edu>
6a0bf43d 2833
17e845af
PE
2834 Standardize on VIRT_ADDR_VARIES behavior (Bug#10042).
2835 Otherwise, valgrind does not work on some platforms.
2836 Problem reported by Andreas Schwab in
6a0bf43d
PE
2837 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00081.html>.
2838 * puresize.h (pure, PURE_P): Always behave as if VIRT_ADDR_VARIES
2839 is set, removing the need for VIRT_ADDRESS_VARIES.
2840 (PURE_P): Use a more-efficient implementation that needs just one
2841 comparison, not two: on x86-64 with GCC 4.6.2, this cut down the
2842 number of instructions from 6 (xorl, cmpq, jge, xorl, cmpq, setge)
2843 to 4 (xorl, subq, cmpq, setbe).
2844 * alloc.c (pure): Always extern now, since that's the
2845 VIRT_ADDR_VARIES behavior.
2846 (PURE_POINTER_P): Use a single comparison, not two, for
2847 consistency with the new puresize.h.
2848 * lisp.h (PNTR_COMPARISON_TYPE): Remove; no longer needed.
2849 * m/ibms390.h, m/intel386.h, m/template.h, s/cygwin.h, s/hpux10-20.h:
2850 Remove VIRT_ADDR_VARIES no longer needed.
2851
f8fe6f96
EZ
28522011-11-19 Eli Zaretskii <eliz@gnu.org>
2853
2854 * xdisp.c (x_write_glyphs, draw_phys_cursor_glyph)
2855 (erase_phys_cursor, update_window_cursor, show_mouse_face)
2856 (cursor_in_mouse_face_p): If the cursor position is out of bounds,
2857 behave as if the cursor position were at the window margin.
2858
2859 * window.c (get_phys_cursor_glyph): If the window is hscrolled,
2860 and the cursor position is out of bounds, behave as if the cursor
2861 position were at the window margin. (Bug#10075)
2862
df05a53c
CY
28632011-11-18 Chong Yidong <cyd@gnu.org>
2864
2865 * window.c (Fwindow_combination_limit): Make first argument
2866 non-optional, since it is meaningless for live windows like the
2867 selected window.
61ccba97 2868
2071918e
DA
28692011-11-18 Dmitry Antipov <dmantipov@yandex.ru>
2870
2871 * keymap.c (Fwhere_is_internal): Add missing RETURN_UNGCPROs.
2872
b50a28de
SM
28732011-11-18 Stefan Monnier <monnier@iro.umontreal.ca>
2874
2875 * intervals.c: Fix grafting over the whole buffer (bug#10071).
2876 (graft_intervals_into_buffer): Simplify.
2877
015137db
EZ
28782011-11-18 Eli Zaretskii <eliz@gnu.org>
2879
2880 * dispnew.c (swap_glyph_pointers): Swap the used[] arrays and the
2881 hash values of the two rows.
2882 (copy_row_except_pointers): Preserve the used[] arrays and the
2883 hash values of the two rows. (Bug#10035)
68c95424 2884 (add_row_entry): Add xassert to verify that ROW's hash code is valid.
015137db
EZ
2885
2886 * xdisp.c (row_hash): New function, body extracted from
2887 compute_line_metrics.
2888 (compute_line_metrics): Call row_hash, instead of computing the
2889 hash code inline.
2890
2891 * dispnew.c (verify_row_hash): Call row_hash for computing the
2892 hash code of a row, instead of duplicating code from xdisp.c.
2893
2894 * dispextern.h (row_hash): Add prototype.
2895
a2addb04
TH
28962011-11-18 Tassilo Horn <tassilo@member.fsf.org>
2897
2898 * frame.c (delete_frame): Don't delete the terminal when the last
2899 X frame is closed if emacs is built with GTK toolkit.
2900
df85d315
JB
29012011-11-17 Juanma Barranquero <lekktu@gmail.com>
2902
2903 * window.c (syms_of_window) <window-combination-resize>: Fix typo.
2904
a0c2d0ae
MR
29052011-11-17 Martin Rudalics <rudalics@gmx.at>
2906
2907 * window.c (Vwindow_splits): Rename to
2908 Vwindow_combination_resize. Suggested by Juri Linkov.
2909 (Fsplit_window_internal): Use Vwindow_combination_resize instead
2910 of Vwindow_splits.
2911
58179cce
JB
29122011-11-16 Juanma Barranquero <lekktu@gmail.com>
2913
7877f373
JB
2914 * nsfns.m (Fns_font_name):
2915 * window.c (syms_of_window) <window-combination-limit>: Fix typos.
58179cce 2916
b6f67890
MR
29172011-11-16 Martin Rudalics <rudalics@gmx.at>
2918
2919 * window.h (window): Rename slot "nest" to "combination_limit".
2920 * window.c (Fwindow_nest): Rename to Fwindow_combination_limit.
2921 (Fset_window_nest): Rename to Fset_window_combination_limit.
2922 (Vwindow_nest): Rename to Vwindow_combination_limit.
2923 (recombine_windows, make_parent_window, make_window)
2924 (Fsplit_window_internal, saved_window)
2925 (Fset_window_configuration, save_window_save): Rename all
2926 occurrences of window_nest to window_combination_limit.
2927
c7015153
JB
29282011-11-15 Juanma Barranquero <lekktu@gmail.com>
2929
2930 * image.c (imagemagick_load_image): Fix typo.
2931
322ad6ec
EZ
29322011-11-14 Eli Zaretskii <eliz@gnu.org>
2933
2934 * xdisp.c (display_line): Move the call to
2935 highlight_trailing_whitespace before the call to
2936 compute_line_metrics, since the latter needs to see the final
6d5eb5b0
SM
2937 faces of all the glyphs to compute ROW's hash value.
2938 Fixes assertion violations in row_equal_p. (Bug#10035)
322ad6ec 2939
f067b8ec
JB
29402011-11-14 Juanma Barranquero <lekktu@gmail.com>
2941
2942 * w32proc.c (reader_thread): Don't check pending input if cp->fd < 0,
2943 just return (bug#10044).
2944
1e5b2111
EZ
29452011-11-12 Eli Zaretskii <eliz@gnu.org>
2946
7ef3cbd5
EZ
2947 * makefile.w32-in (HEAPSIZE): New variable, allows to build temacs
2948 with user-defined heap size. Bump the default size of the temacs
2949 heap to 27MB, to avoid memory warning when running temacs.
2950 ($(TEMACS)): Use HEAPSIZE instead of a hardcoded value.
2951
1e5b2111
EZ
2952 * dispnew.c (scrolling_window): Fix incorrect indices in accessing
2953 current_matrix and desired_matrix. (Bug#9990)
7a7270dd
EZ
2954 (verify_row_hash) [XASSERTS]: New function.
2955 (adjust_glyph_matrix, row_equal_p): Use it in xassert to verify
2956 that the hash value of glyph rows is correct.
1e5b2111 2957
89d61221
MR
29582011-11-12 Martin Rudalics <rudalics@gmx.at>
2959
2960 * window.h (window): Remove splits slot.
2961 * window.c (Fwindow_splits, Fset_window_splits): Remove.
2962 (Fdelete_other_windows_internal, make_parent_window)
2963 (make_window, Fsplit_window_internal, Fdelete_window_internal)
2964 (Fset_window_configuration, save_window_save): Don't deal with
2965 split status of windows.
2966 (saved_window): Remove splits slot.
2967 (Vwindow_splits): Rewrite doc-string.
2968
97f18cc8
JD
29692011-11-11 Jan Djärv <jan.h.d@swipnet.se>
2970
2971 * xfns.c (unwind_create_frame):
2972 * nsfns.m (unwind_create_frame):
2973 * w32fns.c (unwind_create_frame): Use Fmemq to check if frame is in
2974 Vframe_list (Bug#9999).
2975
22a648b4
DA
29762011-11-11 Dmitry Antipov <dmantipov@yandex.ru>
2977
0b381c7e 2978 * xdisp.c (syms_of_xdisp): Remove duplicated definition of Qtext.
22a648b4 2979
659afede
KH
29802011-11-11 Kenichi Handa <handa@m17n.org>
2981
2982 * callproc.c (Fcall_process): Set the member dst_multibyte of
2983 process_coding.
2984
9ac0394b
KH
29852011-11-11 Johan Bockgård <bojohan@gnu.org>
2986
2987 * xdisp.c (fill_composite_glyph_string): Always set s->face, to
2988 avoid a crash (bug#9496).
2989
2fbdc249
CY
29902011-11-09 Chong Yidong <cyd@gnu.org>
2991
2992 * window.c (Fwindow_inside_edges, Fwindow_inside_pixel_edges)
2993 (Fwindow_inside_absolute_pixel_edges): Only allow live windows.
2994
ac6b1f81
PE
29952011-11-08 Paul Eggert <eggert@cs.ucla.edu>
2996
2997 * s/gnu.h (GC_MARK_STACK): Define to GC_MAKE_GCPROS_NOOPS (Bug#9926).
2998
09db192c
PE
29992011-11-08 Paul Eggert <eggert@cs.ucla.edu>
3000
3001 Avoid some portability problems by eschewing 'extern inline' functions.
3002 The trivial performance wins aren't worth the portability hassles; see
3003 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00084.html>
3004 et seq.
3005 * dispextern.h (window_box, window_box_height, window_text_bottom_y)
3006 (window_box_width, window_box_left, window_box_left_offset)
3007 (window_box_right, window_box_right_offset): Undo previous change,
3008 by removing the "extern"s.
3009 * intervals.c (adjust_intervals_for_insertion)
3010 (adjust_intervals_for_deletion): Undo previous change,
3011 making these static again.
3012 (offset_intervals, temp_set_point_both, temp_set_point)
3013 (copy_intervals_to_string): No longer inline.
3014 * xdisp.c (window_text_bottom_y, window_box_width)
3015 (window_box_height, window_box_left_offset)
3016 (window_box_right_offset, window_box_left, window_box_right)
3017 (window_box): No longer inline.
3018
105216ed
CY
30192011-11-08 Chong Yidong <cyd@gnu.org>
3020
3021 * window.c (Fwindow_left_column, Fwindow_top_line): Doc fix.
6d5eb5b0
SM
3022 (Fwindow_body_height, Fwindow_body_width): Move from Lisp.
3023 Signal an error if not a live window.
105216ed
CY
3024 (Fwindow_total_width, Fwindow_total_height): Move from Lisp.
3025 (Fwindow_total_size, Fwindow_body_size): Move to Lisp.
3026
ae9e237f
JB
30272011-11-07 Juanma Barranquero <lekktu@gmail.com>
3028
3029 * lisp.h (syms_of_abbrev): Remove declaration.
3030 Reported by CHENG Gao <chenggao@royau.me>.
3031
c7aa8333
EZ
30322011-11-07 Eli Zaretskii <eliz@gnu.org>
3033
3034 * w32.c (check_windows_init_file): Don't look for term/w32-win.el
3035 if Vpurify_flag is non-nil. Fixes a crash when running w32 build
3036 of temacs in GUI mode.
3037
be7f5545
MR
30382011-11-07 Martin Rudalics <rudalics@gmx.at>
3039
3040 * window.h: Declare delete_all_child_windows instead of
3041 delete_all_subwindows.
3042 * window.c (Fwindow_nest, Fset_window_nest)
3043 (Fset_window_new_total, Fset_window_new_normal)
3044 (Fwindow_resize_apply): Don't use term subwindow in doc-strings.
3045 (delete_all_subwindows): Rename to delete_all_child_windows.
3046 (Fdelete_other_windows_internal, Fset_window_configuration):
3047 Call delete_all_child_windows instead of delete_all_subwindows.
3048 * frame.c (delete_frame): Call delete_all_child_windows instead
3049 of delete_all_subwindows.
3050
ca78dc43
PE
30512011-11-07 Paul Eggert <eggert@cs.ucla.edu>
3052
3053 * alloc.c (DEADP): New macro, for porting to GNU/Hurd (Bug#9926).
3054 This is also needed for porting to any host where GC_MARK_STACK is
3055 not GC_MAKE_GCPROS_NOOPS.
3056 (which_symbols): Use it.
3057
a0241d01
KH
30582011-11-07 Kenichi Handa <handa@m17n.org>
3059
3060 * coding.c (coding_set_destination): Check coding->src_pos only
3061 when coding->src_object is a buffer (bug#9910).
3062
3063 * process.c (send_process): Set the member src_multibyte of coding
3064 to 0 (bug#9911) when sending a unibyte text.
3065
3066 * callproc.c (Fcall_process): Set the member src_multibyte of
3067 process_coding to 0 (bug#9912).
3068
a64bfdfa 30692011-11-06 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
ba24cea2
YM
3070
3071 * xmenu.c (cleanup_widget_value_tree): New function.
3072 (xmenu_show, xdialog_show): Use it in record_unwind_protect instead of
3073 calling free_menubar_widget_value_tree directly (Bug#9830).
3074
cb41b32a
PE
30752011-11-06 Paul Eggert <eggert@cs.ucla.edu>
3076
3077 Fix some portability problems with 'inline'.
3078 * dispextern.h (window_box, window_box_height, window_text_bottom_y)
3079 (window_box_width, window_box_left, window_box_left_offset)
3080 (window_box_right, window_box_right_offset): Declare extern.
3081 Otherwise, these inline functions do not conform to C99 and
3082 are miscompiled by Microsoft compilers. Reported by Eli Zaretskii in
3083 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00084.html>.
3084 * intervals.c (adjust_intervals_for_insertion)
3085 (adjust_intervals_for_deletion): Now extern, because otherwise the
3086 extern inline functions 'offset_intervals' couldn't refer to it.
3087 (static_offset_intervals): Remove.
3088 (offset_intervals): Rewrite using the old contents of
3089 static_offset_intervals. The old version didn't conform to C99
3090 because an extern inline function contained a reference to an
3091 identifier with static linkage.
3092
b7041366
AS
30932011-11-06 Andreas Schwab <schwab@linux-m68k.org>
3094
3095 * keyboard.c (interrupt_signal): Don't call kill-emacs while in
3096 GC.
3097
88a37c4d
EZ
30982011-11-06 Eli Zaretskii <eliz@gnu.org>
3099
3100 * xdisp.c (init_iterator, reseat_to_string): Don't set the
3101 iterator's bidi_p flag if Vpurify_flag is non-nil. (Bug#9963)
3102 (Fcurrent_bidi_paragraph_direction): If Vpurify_flag is non-nil,
3103 return Qleft_to_right.
3104
49745b39
CY
31052011-11-06 Chong Yidong <cyd@gnu.org>
3106
3107 * window.c (Fwindow_live_p, Fwindow_frame, Fframe_root_window)
3108 (Fminibuffer_window, Fwindow_buffer, Fwindow_splits)
3109 (Fset_window_splits, Fwindow_nest, Fset_window_nest)
3110 (Fwindow_use_time, Fwindow_total_size, Fwindow_normal_size)
3111 (Fwindow_new_normal, Fwindow_left_column, Fwindow_top_line)
3112 (Fwindow_margins, Fwindow_fringes, Fwindow_scroll_bars)
3113 (Fwindow_vscroll): Doc fix.
3114 (Fwindow_top_child, Fwindow_left_child): Eliminate a nil default
3115 argument, since it makes no sense to pass a live window and for
3116 consistency with window-child.
3117
1f05cd82
CS
31182011-11-05 Christoph Scholtes <cschol2112@googlemail.com>
3119
3120 * makefile.w32-in ($(TEMACS), (gl-stamp)): Use $(THISDIR) to
3121 support MSVC.
3122
22610910
JR
31232011-11-05 Jason Rumney <jasonr@gnu.org>
3124
3125 * w32font.c (font_matches_spec): Filter out non-Japanese kana fonts.
3126 (add_font_entity_to_list): Filter out non-Japanese Shift-JIS
3127 fonts (Bug#6029).
3128 (add_font_entity_to_list): Fix logic errors in mixed boolean and
3129 bitwise arithmetic preventing use of unicode-sip and non-truetype
3130 opentype fonts.
3131
a06776b2
EZ
31322011-11-05 Eli Zaretskii <eliz@gnu.org>
3133
3ad924ba
EZ
3134 * s/ms-w32.h (fstat, stat, utime): Move redirections to
3135 "emacs"-only part.
3136
a06776b2
EZ
3137 * w32fns.c (x_create_tip_frame, Fx_create_frame): Rearrange
3138 initialization code to keep similarity to xfns.c after changes
3139 from 2011-11-05.
3140
c9e7db78
JD
31412011-11-05 Jan Djärv <jan.h.d@swipnet.se>
3142
a97f8f3f
JD
3143 * nsfns.m: Declare image_cache_refcount if GLYPH_DEBUG.
3144 (unwind_create_frame): New function (Bug#9943).
3145 (Fx_create_frame): Restructure code to be more similar to the one in
3146 xfns.c. Call record_unwind_protect with unwind_create_frame (Bug#9943).
3147 Initialize image_cache_refcount if GLYPH_DEBUG (Bug#9943).
3148 Move terminal->reference_count++ just before making the frame official
3149 (Bug#9943).
3150
3151 * nsterm.m (x_free_frame_resources): New function.
3152 (x_destroy_window): Move code to x_free_frame_resources.
3153
c9e7db78 3154 * xfns.c (unwind_create_frame): Fix comment.
6d5eb5b0
SM
3155 (Fx_create_frame, x_create_tip_frame):
3156 Move terminal->reference_count++ just before making the frame
75f1671a 3157 official. Move initialization of image_cache_refcount and
c9e7db78
JD
3158 dpyinfo_refcount before calling init_frame_faces (Bug#9943).
3159
a6fc3b5c
EZ
31602011-11-05 Eli Zaretskii <eliz@gnu.org>
3161
3162 Support MSVC build with newer versions of Visual Studio.
3163 * makefile.w32-in (TAGS-gmake): Don't use $(patsubst ...), as
3164 Nmake barfs on that. Use $(OBJ*_c) variables instead, defined on
3165 nt/gmake.defs.
3166
3167 * lisp.h (ENUM_BF): New macro, for enumerated types in bitfields,
3168 which are not supported by MSVC.
3169 (Lisp_Symbol, Lisp_Misc_Any, Lisp_Marker, Lisp_Misc_Overlay)
3170 (Lisp_Save_Value, Lisp_Free): Use ENUM_BF for enumerated types in
3171 bitfields.
3172 (Lisp_Object) [USE_LISP_UNION_TYPE]: Use ENUM_BF for enumerated
3173 types in bitfields.
3174 (DEFUN) [_MSC_VER]: Define in a different way for MSVC.
3175
3176 * w32fns.c [_MSC_VER]: DECLARE_HANDLE for any MSVC version.
3177
58179cce 31782011-11-05 Fabrice Popineau <fabrice.popineau@supelec.fr> (tiny change)
a6fc3b5c
EZ
3179
3180 Support MSVC build with newer versions of Visual Studio.
3181 * w32.c: Don't include w32api.h for MSVC.
3182 (init_environment) [_MSC_VER]: Call sys_access, not _access.
3183
3184 * s/ms-w32.h <sigset_t, ssize_t> [_MSC_VER]: Typedefs for MSVC.
3185 [_MSC_VER]: Include sys/timeb.h, sys/stat.h, and signal.h.
3186 (fstat, stat, utime) [_MSC_VER]: Redirect to their sys_* cousins.
3187 (malloc, free, realloc, calloc) [_MSC_VER]: Always redirect to the
3188 e_* cousins.
3189 (alloca) [_MSC_VER]: Define to _alloca.
3190
3191 * lisp.h (DECL_ALIGN) [_MSC_VER]: Define for MSVC.
3192
3193 * regex.c <re_char> [_MSC_VER]: A separate definition for MSVC.
3194
a58c13ed
EZ
31952011-11-04 Eli Zaretskii <eliz@gnu.org>
3196
3197 * xdisp.c (note_mouse_highlight): If either of
3198 previous/next-single-property-change returns nil, treat that as
3199 the beginning or the end of the buffer. (Bug#9955)
3200
fe0b6370
JD
32012011-11-04 Jan Djärv <jan.h.d@swipnet.se>
3202
a58c13ed 3203 * gtkutil.c (xg_make_tool_item): Add callbacks if one of wimage or
fe0b6370
JD
3204 label is not null (Bug#9951).
3205 (xg_tool_item_stale_p): Handle the fact that wimage and/or wlbl
3206 may be NULL.
3207
89bd5ee1
EZ
32082011-11-04 Eli Zaretskii <eliz@gnu.org>
3209
3210 * window.c (Fwindow_body_size): Mention in the doc string that the
3211 return value is in frame's canonical units. (Bug#9949)
3212
84c3edb9
EZ
32132011-11-03 Eli Zaretskii <eliz@gnu.org>
3214
4e2fb5c7
EZ
3215 * xdisp.c (note_mouse_highlight): Initialize `area'. (Bug#9947)
3216
84c3edb9 3217 * w32fns.c (unwind_create_frame): If needed, free the glyph
3ab15fd6 3218 matrices of the partially constructed frame. (Bug#9943)
2a58bbc1 3219 * xfns.c (unwind_create_frame): Likewise.
84c3edb9 3220
bc17a887
EZ
32212011-11-01 Eli Zaretskii <eliz@gnu.org>
3222
3223 * xdisp.c (mouse_face_from_buffer_pos): Fix a typo in a comment.
3224 Don't stop backward scan on the continuation glyph, even though
3225 its CHARPOS is positive.
6d5eb5b0
SM
3226 (mouse_face_from_buffer_pos, note_mouse_highlight):
3227 Rename cover_string to disp_string.
bc17a887 3228
4ee88440
MR
32292011-11-01 Martin Rudalics <rudalics@gmx.at>
3230
3231 * window.c (temp_output_buffer_show): Don't use
3232 Vtemp_buffer_show_specifiers.
3233 (Vtemp_buffer_show_specifiers): Remove unused variable.
3234
c2ff3c02
EZ
32352011-10-30 Eli Zaretskii <eliz@gnu.org>
3236
3237 * xdisp.c (try_cursor_movement): Make sure ROW isn't decremented
3238 past the beginning of the current glyph matrix.
3239
58179cce 32402011-10-30 Adam Sjøgren <asjo@koldfront.dk> (tiny change)
6e56383b
JD
3241
3242 * xterm.c: Include X11/Xproto.h if HAVE_GTK3.
3243 (x_error_handler): Ignore BadMatch for X_SetInputFocus for
3244 HAVE_GTK3 (Bug#9869).
b77a6a7f 3245
3b574623
JD
3246 * gtkutil.c (xg_win_to_widget, xg_event_is_for_menubar): Initialize
3247 type to GDK_NOTHING so valgrind does not complain (Bug#9901).
3248
b77a6a7f
JD
3249 * xterm.h (x_display_info): Add Xatom_net_wm_state_hidden (Bug#9893).
3250
3251 * xterm.c: Declare x_handle_net_wm_state to return int.
3252 (handle_one_xevent): Check if we are iconified but don't have
3253 _NET_WM_STATE_HIDDEN. If do, treat as deiconify (Bug#9893).
3254 (get_current_wm_state): Return non-zero if not hidden,
3255 check for _NET_WM_STATE_HIDDEN (Bug#9893).
3256 (do_ewmh_fullscreen): Ignore return value from get_current_wm_state.
3257 (x_handle_net_wm_state): Return what get_current_wm_state returns.
3258 (x_term_init): Initialize dpyinfo->Xatom_net_wm_state_hidden.
3259
196e41e4
PE
32602011-10-29 Paul Eggert <eggert@cs.ucla.edu>
3261
3262 * alloc.c (which_symbols): Declare EXTERNALLY_VISIBLE,
3263 so that this new function doesn't get optimized away by a
3264 whole-program optimizer. Make the 2nd arg EMACS_INT, not int.
3265
021f2e1a
AS
32662011-10-29 Andreas Schwab <schwab@linux-m68k.org>
3267
3268 * frame.h (MOUSE_HL_INFO): Remove excess parens.
3269
8b058d44
EZ
32702011-10-29 Eli Zaretskii <eliz@gnu.org>
3271
3272 Fix the `xbytecode' command.
3273 * .gdbinit (xprintbytestr): New command.
b50a28de 3274 (xwhichsymbols): Rename from `which'; all callers changed.
8b058d44
EZ
3275 (xbytecode): Print the byte-code string as well.
3276
4452fb80
EZ
32772011-10-29 Kim Storm <storm@cua.dk>
3278
8b058d44
EZ
3279 * alloc.c (which_symbols): New function.
3280
21b72067
AS
32812011-10-29 Andreas Schwab <schwab@linux-m68k.org>
3282
3283 * minibuf.c (read_minibuf_noninteractive): Allow reading empty
3284 line. (Bug#9903)
3285
83ed7b5c
GM
32862011-10-29 Glenn Morris <rgm@gnu.org>
3287
3288 * process.c (wait_reading_process_output): Revert 2009-08-30 change.
3289 Not clear what it was for, and it causes various bugs. (Bug#9839)
3290
5a7a728b
EZ
32912011-10-28 Eli Zaretskii <eliz@gnu.org>
3292
3293 * xdisp.c (note_mouse_highlight): Initialize `part', to avoid a
3294 possible random value that matches one of those tested as
3295 condition to clear the mouse face.
3296
d3d0842f
CY
32972011-10-28 Chong Yidong <cyd@gnu.org>
3298
3299 * xdisp.c (note_mouse_highlight): Fix use of uninitialized var.
3300
31b39d13
DN
33012011-10-28 Dan Nicolaescu <dann@ics.uci.edu>
3302
3303 * window.c (make_window): Initialize phys_cursor_on_p.
3304
9aba6043
SM
33052011-10-28 Stefan Monnier <monnier@iro.umontreal.ca>
3306
3307 * lisp.h (struct Lisp_Symbol): Update comments.
3308
c20992f4
JB
33092011-10-28 Juanma Barranquero <lekktu@gmail.com>
3310
3311 * w32font.c (w32_load_unicows_or_gdi32): Add missing return.
3312
db4f02f2
EZ
33132011-10-28 Eli Zaretskii <eliz@gnu.org>
3314
3315 Fix Emacs on Windows 9X (bug#8562). Thanks to oslsachem
3316 <oslsachem@gmail.com> for helping to debug this.
3317
3318 * w32font.c (g_b_init_is_w9x, g_b_init_get_outline_metrics_w)
3319 (g_b_init_get_text_metrics_w, g_b_init_get_glyph_outline_w)
3320 (g_b_init_get_glyph_outline_w): New static variables.
3321 (GetOutlineTextMetricsW_Proc, GetTextMetricsW_Proc)
3322 (GetGlyphOutlineW_Proc): New typedefs.
3323 (w32_load_unicows_or_gdi32, get_outline_metrics_w)
9aba6043
SM
3324 (get_text_metrics_w, get_glyph_outline_w, globals_of_w32font):
3325 New functions.
3326 (w32font_open_internal, compute_metrics):
3327 Call get_outline_metrics_w, get_text_metrics_w, and get_glyph_outline_w
db4f02f2
EZ
3328 instead of calling the "wide" APIs directly.
3329
3330 * emacs.c (main) [HAVE_NTGUI]: Call globals_of_w32font.
3331
3332 * w32.h (syms_of_w32font): Add prototype.
3333
87e68db4
JB
33342011-10-27 Juanma Barranquero <lekktu@gmail.com>
3335
3336 * window.c (Fframe_root_window, Fframe_first_window, Fwindow_end)
3337 (Fframe_selected_window, Ftemp_output_buffer_show, Fnext_window)
3338 (Fdelete_window_internal, Fwindow_parameters): Fix typos in docstrings.
3339 (Fmove_to_window_line): Doc fix.
3340
435c1d67
CY
33412011-10-27 Chong Yidong <cyd@gnu.org>
3342
3343 * process.c (make_process): Set gnutls_state to NULL.
3344
3345 * gnutls.c (emacs_gnutls_deinit): Deinit the gnutls_state if it is
3346 non-NULL, regardless of GNUTLS_INITSTAGE.
3347 (Fgnutls_boot): Cleanups. Call emacs_gnutls_deinit if we signal
3348 an error. Set process slots as soon as we allocate them.
3349
3350 * gnutls.h (GNUTLS_LOG, GNUTLS_LOG2): Fix macros.
3351
9c6c6f49
CY
33522011-10-27 Chong Yidong <cyd@gnu.org>
3353
9aba6043
SM
3354 * gnutls.c (emacs_gnutls_deinit): New function.
3355 Deallocate credentials structures as well as calling gnutls_deinit.
9c6c6f49
CY
3356 (Fgnutls_deinit, Fgnutls_boot): Use it.
3357
3358 * process.c (make_process): Initialize GnuTLS credentials to NULL.
3359 (deactivate_process): Call emacs_gnutls_deinit.
3360
657d08d3
JB
33612011-10-27 Juanma Barranquero <lekktu@gmail.com>
3362
3363 * image.c (x_create_x_image_and_pixmap):
3364 * w32.c (sys_rename, w32_delayed_load):
3365 * w32font.c (fill_in_logfont):
3366 * w32reg.c (x_get_string_resource): Silence compiler warnings.
3367
5430d399
JB
33682011-10-26 Juanma Barranquero <lekktu@gmail.com>
3369
3370 * w32fns.c (w32_default_color_map): New function,
3371 extracted from Fw32_default_color_map.
a7ef684b 3372 (Fw32_default_color_map, Fx_open_connection): Use it. (Bug#9785)
5430d399 3373
fe0055fa
PE
33742011-10-25 Paul Eggert <eggert@cs.ucla.edu>
3375
3376 * dispextern.h (Fcontrolling_tty_p): New decl (Bug#6649 part 2).
3377
e6346438
SM
33782011-10-25 Stefan Monnier <monnier@iro.umontreal.ca>
3379
3380 * keyboard.c (test_undefined): New function (bug#9751).
3381 (read_key_sequence): Use it to detect when a key is bound to `undefined'.
3382
e112cc37
ET
33832011-10-25 Enami Tsugutomo <tsugutomo.enami@jp.sony.com>
3384
3385 * sysdep.c (init_sys_modes): Fix the check for the controlling
3386 terminal (Bug#6649).
3387
7b5d6677
EZ
33882011-10-20 Eli Zaretskii <eliz@gnu.org>
3389
3390 * dispextern.h (struct bidi_it): New member next_en_type.
3391
3392 * bidi.c (bidi_line_init): Initialize the next_en_type member.
3393 (bidi_resolve_explicit_1): When next_en_pos is valid for the
3394 current character, check also for next_en_type being WEAK_EN.
3395 (bidi_resolve_weak): Don't enter the expensive loop if the current
3396 position is before next_en_pos. Record the bidi type of the first
3397 non-ET, non-BN character we find, in addition to its position.
3398 (bidi_level_of_next_char): Invalidate next_en_type when
3399 next_en_pos is over-stepped.
3400
7da0b018
PE
34012011-10-20 Paul Eggert <eggert@cs.ucla.edu>
3402
3403 Time zone name fixes for non-ASCII locales (Bug#641, Bug#9794)
3404 * editfns.c: Rewrite current-time-zone so that it invokes
3405 the equivalent of (format-time-string "%Z") to get the time zone name.
3406 This fixes a bug when the time zone name contains characters that
3407 need converting from the system time locale to Emacs internal format.
3408 This fixes a shortcoming that I introduced in my 1999-10-19 patch:
3409 that patch fixed format-time-string to do the conversion, but
3410 I forgot to fix current-time-zone.
3411 (format_time_string): New function, containing most of
3412 what Fformat_time_string used to contain.
3413 (Fformat_time_string): Rewrite in terms of format_time_string.
3414 This doesn't change this function's behavior.
3415 (current-time-zone): Rewrite to use format_time_string.
3416 This fixes the bug reported by Michael Schierl in
3417 <http://lists.gnu.org/archive/html/emacs-devel/2007-06/msg00334.html>.
3418 Jason Rumney's 2007-06-07 change worked around this bug, but
3419 didn't fix it.
3420 * systime.h (tzname, timezone): Remove no-longer-used declarations.
3421
8547b010
EZ
34222011-10-19 Eli Zaretskii <eliz@gnu.org>
3423
3424 * xdisp.c (start_display): If the character at POS is displayed
3425 via a display vector, reset IT->current.dpvec_index to zero.
12b32963
EZ
3426 (try_window_reusing_current_matrix): If a line ends in a display
3427 vector or the next line starts in a display vector, continue
3428 redrawing the window even though the character position of
3429 start_row was reached.
8547b010
EZ
3430 (Bug#9771, part 2)
3431
4e948d15
CY
34322011-10-18 Chong Yidong <cyd@gnu.org>
3433
3434 * xdisp.c (get_next_display_element): Handle U+2010 and U+2011
3435 with nobreak-char-display too.
3436
4787455f
EZ
34372011-10-18 Eli Zaretskii <eliz@gnu.org>
3438
3439 Fix part 3 of bug#9771.
3440 * bidi.c (bidi_line_init): Initialize next_en_pos to zero, not -1.
3441 (bidi_resolve_neutral): Don't enter the expensive loop looking for
3442 non-neutral characters if the current character is a paragraph
3443 separator (a.k.a. Newline). This avoids running the same
3444 expensive loop twice, once when we consume the preceding newline
3445 and the other time when the line actually needs to be displayed.
3446 Avoid the loop when we see neutrals on the base embedding level
3447 following a character whose directionality is the same as the
3448 paragraph's. This avoids running the expensive loop when a line
3449 ends in a long sequence of neutrals, like control characters.
3450 Add assertion against STRONG_AL type. Slightly rearrange code
3451 that determines the type of a neutral given the first non-neutral
3452 that follows it.
3453 (bidi_level_of_next_char): Set next_en_pos to zero when
3454 invalidating its info.
3455
2c91f553
EZ
34562011-10-17 Eli Zaretskii <eliz@gnu.org>
3457
3458 * xdisp.c (push_display_prop): Determine whether to record string
3459 or buffer position by IT->string, not by IT->method. Allow
3460 GET_FROM_DISPLAY_VECTOR as IT->method on entry. (Bug#9771, part 4)
f2ff9e88
EZ
3461 (move_it_vertically_backward): Don't look for character position
3462 immediately after the newline when in a continuation line.
3463 (Bug#9771, part 1)
2c91f553 3464
c7b08b0d
MR
34652011-10-15 Martin Rudalics <rudalics@gmx.at>
3466
3467 * window.c (coordinates_in_window): Rewrite and delabelize
3468 vertical border check. (Bug#5357) (Bug#9618)
3469
6b02f655
SM
34702011-10-14 Stefan Monnier <monnier@iro.umontreal.ca>
3471
3472 * xterm.c (frame_highlight, frame_unhighlight): Ignore unexplained
3473 errors in XSetWindowBorder (bug#9310).
3474
81d40c92
DA
34752011-10-13 Dmitry Antipov <dmantipov@yandex.ru>
3476
3477 * editfns.c (Fset_time_zone_rule): Replace free with xfree to
3478 avoid crash when xmalloc overrun checking is enabled.
3479
d4172c3b
EZ
34802011-10-13 Eli Zaretskii <eliz@gnu.org>
3481
3482 * xdisp.c (Fcurrent_bidi_paragraph_direction): Initialize
3483 itb.paragraph_dir to NEUTRAL_DIR. Fixes an occasional incorrect
3484 cursor motion with <left> and <right> arrow keys.
3485
3486 * bidi.c (bidi_init_it): Don't initialize paragraph_dir here, as
3487 some callers set that themselves.
3488
b00eea75
EZ
34892011-10-12 Eli Zaretskii <eliz@gnu.org>
3490
3491 * xdisp.c (find_row_edges): Handle the case where ROW comes from a
3492 display string and the previous row comes from the same string and
3493 is empty. (Bug#9739) (Bug#9738)
3494
8fe012c4
SM
34952011-10-12 Stefan Monnier <monnier@iro.umontreal.ca>
3496
3497 * doc.c (get_doc_string): Encode file name (bug#9735).
3498
0074aef2
EZ
34992011-10-12 Eli Zaretskii <eliz@gnu.org>
3500
79beb178
EZ
3501 * bidi.c (bidi_level_of_next_char):
3502 * xdisp.c (get_visually_first_element): Remove old incorrect
3503 comments regarding the Unicode Line Separator character.
3504
0074aef2
EZ
3505 * bidi.c (bidi_init_it): Initialize paragraph_dir to NEUTRAL_DIR.
3506
6e4b3fbe
DA
35072011-10-12 Dmitry Antipov <dmantipov@yandex.ru>
3508
3509 * alloc.c (Fgc_status): Do not access beyond zombies array
3510 boundary if nzombies > MAX_ZOMBIES.
3511 * alloc.c (dump_zombies): Add missing format specifier.
3512
0324f3af
PE
35132011-10-12 Paul Eggert <eggert@cs.ucla.edu>
3514
b5525cac
PE
3515 * xdisp.c (set_cursor_from_row): Simplify conditionals,
3516 to pacify GCC 4.6.1 x86-64 with -O2 -Wstrict-overflow.
3517
0324f3af
PE
3518 * lread.c (read_escape): Allow hex escapes as large as ?\xfffffff.
3519 Some packages use them to denote characters with modifiers.
3520
e9b5f888
AS
35212011-10-11 Andreas Schwab <schwab@linux-m68k.org>
3522
3523 * lisp.h (GCPRO1_VAR, GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR)
3524 (GCPRO5_VAR, GCPRO6_VAR, UNGCPRO_VAR): Add whitespace to avoid
3525 matching a pp-number. Rename parameter var to var1.
3526
127827c0
SM
35272011-10-11 Stefan Monnier <monnier@iro.umontreal.ca>
3528
3529 * minibuf.c (Finternal_complete_buffer): Fix last change (bug#9709).
3530
c8fd3bd0
GM
35312011-10-08 Glenn Morris <rgm@gnu.org>
3532
3533 * callint.c (Fcall_interactively): Give a more explicit error for the
3534 'c' case with a non-character input. (Bug#8479)
3535
352ec8ff
EZ
35362011-10-08 Eli Zaretskii <eliz@gnu.org>
3537
03669ccb
EZ
3538 * xdisp.c (hscroll_window_tree): Support hscroll in right-to-left
3539 lines.
7061c986
EZ
3540 (set_cursor_from_row): Fix cursor positioning in mixed L2R+R2L
3541 lines that are hscrolled on the left.
03669ccb 3542
352ec8ff
EZ
3543 * dispnew.c (buffer_posn_from_coords): Account for a possible
3544 presence of header-line. (Bug#4426)
3545
a66cfb1c
SM
35462011-10-07 Stefan Monnier <monnier@iro.umontreal.ca>
3547
6b02f655
SM
3548 * buffer.c (syms_of_buffer) <enable-multibyte-characters>:
3549 Don't advertise functionality which we discourage or doesn't work.
a66cfb1c 3550
7c5ee88e
PE
35512011-10-07 Paul Eggert <eggert@cs.ucla.edu>
3552
3553 * alloc.c (GC_LISP_OBJECT_ALIGNMENT): Use offsetof, not __alignof__
3554 or sizeof. __alignof__ gives the wrong answer on Fedora x86-64
3555 with GCC 4.6.1 when configured with CC='gcc -m32' --with-wide-int;
3556 this makes Emacs dump core during garbage collection on rare
3557 occasions. sizeof is obviously inferior to offsetof here, so
3558 stick with offsetof.
3559 (GC_POINTER_ALIGNMENT): New macro.
3560 (mark_memory): Omit 3rd (offset) arg; caller changed.
3561 Don't assume EMACS_INT alignment is the same as pointer alignment.
3562
df1bbe5b
SM
35632011-10-03 Stefan Monnier <monnier@iro.umontreal.ca>
3564
3565 * keyboard.c (read_key_sequence_remapped): New var.
3566 (read_key_sequence): Compute remapping in the right buffer.
3567 (command_loop_1): Use read_key_sequence's remapping directly.
3568
51553db6
SM
35692011-10-02 Stefan Monnier <monnier@iro.umontreal.ca>
3570
32c1fffd
SM
3571 * dired.c (file_name_completion): Don't expand file name.
3572 (Ffile_name_completion, Ffile_name_all_completions): Expand file name
3573 before checking file name handler.
3574
51553db6
SM
3575 * minibuf.c (Finternal_complete_buffer): Only show internal buffers if
3576 they've been requested explicitly (bug#9591).
3577
b6bd1599 35782011-10-01 Andreas Schwab <schwab@linux-m68k.org>
fa2ec41f
AS
3579
3580 * keymap.c (Fsingle_key_description): Use make_specified_string
3581 instead of build_string to build string from push_key_description.
3582 (Bug#5193)
3583
f701dc2a
PE
35842011-09-30 Paul Eggert <eggert@cs.ucla.edu>
3585
4222c55d
PE
3586 * buffer.h (struct buffer): Use time_t, not int, for a time stamp.
3587 This fixes a Y2038 bug on 64-bit hosts.
3588 * buffer.c (reset_buffer):
3589 * fileio.c (Fdo_auto_save, Fset_buffer_auto_saved)
3590 (Fclear_buffer_auto_save_failure):
3591 Use 0, not -1, to represent an unset failure time, since time_t
3592 might not be signed.
3593
f701dc2a
PE
3594 Remove dependency on glibc malloc internals.
3595 * alloc.c (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
3596 Move back here from lisp.h, but with their new implementations.
3597 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
3598 (XMALLOC_OVERRUN_SIZE_SIZE): Move these new lisp.h macros here.
3599 * charset.c (charset_table_init): New static var.
3600 (syms_of_charset): Use it instead of xmalloc. This removes a
3601 dependency on glibc malloc internals. See Eli Zaretskii's comment in
3602 <http://lists.gnu.org/archive/html/emacs-devel/2011-09/msg00815.html>.
3603 * lisp.h (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
3604 Move back to alloc.c.
3605 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
3606 (XMALLOC_OVERRUN_SIZE_SIZE): Move to alloc.c.
3607
9ceebf39
JD
36082011-09-30 Jan Djärv <jan.h.d@swipnet.se>
3609
3610 * nsterm.m (windowDidResize): Call x_set_window_size only when
3611 ns_in_resize is true. Otherwise set pixelwidth/height and
3612 call change_frame_size (Bug#9628).
3613
cb993c58
PE
36142011-09-30 Paul Eggert <eggert@cs.ucla.edu>
3615
3930c88b
PE
3616 Port --enable-checking=all to Fedora 14 x86-64.
3617 * charset.c (syms_of_charset): Also account for glibc malloc's
3618 internal overhead when calculating the initial malloc maximum.
3619
cb993c58
PE
3620 Port --enable-checking=all to Fedora 14 x86.
3621 * alloc.c (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
3622 Move to lisp.h.
3623 (xmalloc_put_size, xmalloc_get_size, overrun_check_malloc)
3624 (overrun_check_realloc, overrun_check_free):
3625 Use XMALLOC_OVERRUN_SIZE_SIZE, not sizeof (size_t).
3626 That way, xmalloc returns a properly-aligned pointer even if
3627 XMALLOC_OVERRUN_CHECK is defined. The old debugging code happened
3628 to align OK on typical 64-bit hosts, but not on Fedora 14 x86.
3629 * charset.c (syms_of_charset): Take XMALLOC_OVERRUN_CHECK_OVERHEAD
3630 into account when calculating the initial malloc maximum.
3631 * lisp.h (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
3632 Move here from alloc.c, so that charset.c can use it too.
3633 Properly align; the old code wasn't right for common 32-bit hosts
3634 when configured with --enable-checking=all.
3635 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
3636 (XMALLOC_OVERRUN_SIZE_SIZE): New macros.
3637
31bed486
EZ
36382011-09-29 Eli Zaretskii <eliz@gnu.org>
3639
04c70788 3640 * sysdep.c (snprintf) [!EOVERFLOW]: If EOVERFLOW is not defined,
31bed486
EZ
3641 use EDOM.
3642
fbcaa2f3
EZ
36432011-09-28 Eli Zaretskii <eliz@gnu.org>
3644
3645 * xdisp.c (compute_display_string_end): If there's no display
3646 string at CHARPOS, return -1.
3647
3648 * bidi.c (bidi_fetch_char): When compute_display_string_end
3649 returns a negative value, treat the character as a normal
3650 character not covered by a display string. (Bug#9624)
3651
a239d4e9
JB
36522011-09-28 Juanma Barranquero <lekktu@gmail.com>
3653
3654 * lread.c (Fread_from_string): Fix typo in docstring.
3655
88652fd5
EZ
36562011-09-27 Eli Zaretskii <eliz@gnu.org>
3657
3658 * xdisp.c (handle_invisible_prop): If invisible text ends on a
3659 newline, reseat the iterator instead of bidi-iterating there one
3660 character at a time. (Bug#9610)
32c1fffd
SM
3661 (BUFFER_POS_REACHED_P, move_it_in_display_line_to): Bail when past
3662 TO_CHARPOS if the bidi iterator is at base embedding level.
88652fd5 3663
ed497dd4
AS
36642011-09-27 Andreas Schwab <schwab@linux-m68k.org>
3665
3666 * lread.c (readevalloop): Use correct code for NBSP.
3667 (read1): Likewise. (Bug#9608)
3668
b2bf61aa
MA
36692011-09-25 Michael Albinus <michael.albinus@gmx.de>
3670
3671 * dbusbind.c (Fdbus_register_signal): When service is not
3672 registered, use nil in Vdbus_registered_objects_table. (Bug#9581)
3673
32bbb17c
GM
36742011-09-25 Glenn Morris <rgm@gnu.org>
3675
3676 * buffer.c (truncate-lines): Doc fix.
3677
94e0933e
CY
36782011-09-24 Chong Yidong <cyd@stupidchicken.com>
3679
3680 * window.c (Fwindow_prev_buffers, Fset_window_prev_buffers)
3681 (Fset_window_next_buffers): Doc fix.
3682
cddde921
GM
36832011-09-24 Glenn Morris <rgm@gnu.org>
3684
3685 * minibuf.c (read_minibuf): Disable line truncation. (Bug#5715)
3686
1260aef1
PE
36872011-09-24 Paul Eggert <eggert@cs.ucla.edu>
3688
25b4bfa0
PE
3689 Fix minor problems found by static checking.
3690 * xdisp.c (string_from_display_spec): Don't assume vecsize fits in int.
1260aef1
PE
3691 * indent.c (Fvertical_motion): Fix == vs = typo.
3692
e3cbd34b
EZ
36932011-09-24 Eli Zaretskii <eliz@gnu.org>
3694
a66cfb1c
SM
3695 * dispnew.c (syms_of_display) <redisplay-dont-pause>:
3696 Default value is now t. Doc fix.
6bf7006f 3697
e3cbd34b 3698 * indent.c (Fvertical_motion): Compute and apply the overshoot
32c1fffd 3699 logic when moving up, not only when moving down. Fix the
e3cbd34b 3700 confusing name and values of the it_overshoot_expected variable;
32c1fffd 3701 logic changes accordingly. (Bug#9254) (Bug#9549)
e3cbd34b
EZ
3702
3703 * xdisp.c (pos_visible_p): Produce correct pixel coordinates when
3704 CHARPOS is covered by a display string which includes newlines.
3705 (move_it_vertically_backward): Avoid inflooping when START_CHARPOS
3706 is covered by a display string with embedded newlines.
3707
a3de0cbd
MA
37082011-09-24 Michael Albinus <michael.albinus@gmx.de>
3709
3710 * dbusbind.c (Fdbus_register_signal): Add match rule to
3711 Vdbus_registered_objects_table. (Bug#9581)
a66cfb1c
SM
3712 (Fdbus_register_method, Vdbus_registered_objects_table):
3713 Fix docstring.
a3de0cbd 3714
b260039d
JM
37152011-09-24 Jim Meyering <meyering@redhat.com>
3716
32c1fffd 3717 do not ignore write error for any output size
b260039d
JM
3718 The previous change was incomplete.
3719 While it makes emacs --batch detect the vast majority of stdout
3720 write failures, errors were still ignored whenever the output size is
3721 k * (BUFSIZ+1) - 4. E.g., on a system with BUFSIZ of 4096,
3722 $ emacs --batch --eval '(print (format "%4093d" 0))' > /dev/full \
3723 && echo FAIL: ignored write error
3724 FAIL: ignored write error
3725 $ emacs --batch --eval '(print (format "%20481d" 0))' > /dev/full \
3726 && echo FAIL: ignored write error
3727 FAIL: ignored write error
3728 * emacs.c (Fkill_emacs): Also test ferror. (Bug#9574)
3729
8eca8a7c
AS
37302011-09-23 Andreas Schwab <schwab@linux-m68k.org>
3731
3732 * emacs.c (Fkill_emacs): In noninteractive mode exit
3733 non-successfully if a write error occurred on stdout. (Bug#9574)
3734
3341db62
EZ
37352011-09-21 Eli Zaretskii <eliz@gnu.org>
3736
3737 * xdisp.c (pop_it): Allow it->object that is a cons cell to pass
3738 the xassert test.
3739
3740 * dispextern.h (struct it): Update the comment documenting what
3741 can it->OBJECT be.
3742
8c203dbf
EZ
37432011-09-20 Eli Zaretskii <eliz@gnu.org>
3744
3745 * xdisp.c (set_cursor_from_row): If the row ends in a newline from
3746 a display string, extend search for cursor position to end of row.
3747 (find_row_edges): If the row ends in a newline from a display
3748 string, increment its MATRIX_ROW_END_CHARPOS by one. (Bug#9549)
3749 Handle the case of a display string with multiple newlines.
fd317ddf
EZ
3750 (Fcurrent_bidi_paragraph_direction): Fix search for previous
3751 non-empty line. Fixes confusing cursor motion with arrow keys at
3752 the beginning of a line that starts with whitespace.
8c203dbf 3753
a4824228
LMI
37542011-09-19 Lars Magne Ingebrigtsen <larsi@gnus.org>
3755
3756 * lread.c (Fread_from_string): Document what FINAL-STRING-INDEX is
3757 (bug#9493).
3758
33ed493b
CY
37592011-09-18 Chong Yidong <cyd@stupidchicken.com>
3760
3761 * xfns.c (Fx_create_frame): Handle the bitmapIcon resource as
3762 boolean (Bug#9154).
3763
56cd55c8
EZ
37642011-09-18 Eli Zaretskii <eliz@gnu.org>
3765
3766 * xdisp.c (display_line): Record maximum and minimum buffer
3767 positions even if no glyphs were produced (e.g., by a zero-width
3768 stretch). Fixes bug#9530 on a TTY. Under word-wrap, don't record
3769 buffer positions that will be removed from the glyph row because
3770 they don't fit.
c02dcedf
EZ
3771 (produce_stretch_glyph): Fix a bug in :align-to on a TTY when the
3772 column is beyond frame width: don't subtract 1 "pixel" when
3773 computing width of the stretch.
3e62b7e0
EZ
3774 (reseat_at_next_visible_line_start): Undo the change made on
3775 2011-09-17 that saved paragraph information and restored it after
3776 the call to `reseat'. (Bug#9545)
56cd55c8 3777
5ed99d36 37782011-09-18 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
3390454c
YM
3779
3780 * xdisp.c (expose_window): Save original value of phys_cursor_on_p
3781 and turn window cursor on if cleared (Bug#9415).
3782
5ed99d36 37832011-09-18 Andreas Schwab <schwab@linux-m68k.org>
edb7b4dc
AS
3784
3785 * search.c (boyer_moore): Take unibyte characters from pattern
3786 literally. (Bug#9458)
3787
9bade7b2
EZ
37882011-09-18 Eli Zaretskii <eliz@gnu.org>
3789
3790 * xdisp.c (reseat_at_next_visible_line_start): Fix last change.
3791
e5e9d610
PE
37922011-09-18 Paul Eggert <eggert@cs.ucla.edu>
3793
87e4427a
PE
3794 Fix minor problem found by static checking.
3795 * xdisp.c (reseat_at_next_visible_line_start): Mark locals as
3796 initialized, to pacify gcc -Wuninitialized.
3797
e5e9d610
PE
3798 * fileio.c: Report proper errno when syscall falls.
3799 (Finsert_file_contents): Save and restore errno,
3800 so that report_file_error outputs the correct diagnostic.
3801 (Fwrite_region) [CLASH_DETECTION]: Likewise.
3802
a1674f0b
EZ
38032011-09-18 Eli Zaretskii <eliz@gnu.org>
3804
3805 * .gdbinit (pgx): Fix references to fields of `struct glyph'.
3806
fbfb6dd4
EZ
38072011-09-17 Eli Zaretskii <eliz@gnu.org>
3808
3809 * xdisp.c (produce_stretch_glyph): Another fix for changes made on
3810 2011-08-30T17:32:44Z!eliz@gnu.org. (Bug#9530)
3811
bb187662
EZ
38122011-09-17 Eli Zaretskii <eliz@gnu.org>
3813
1137e8b8 3814 * xdisp.c (reseat_at_next_visible_line_start): Keep information
6b02f655 3815 about the current paragraph and restore it after the call to reseat.
1137e8b8
EZ
3816
3817 * bidi.c (MAX_PARAGRAPH_SEARCH): New macro.
3818 (bidi_find_paragraph_start): Search back for paragraph beginning
3819 at most MAX_PARAGRAPH_SEARCH lines; if not found, return BEGV_BYTE.
3820 (bidi_move_to_visually_next): Only trigger paragraph-related
3821 computations when the last character is a newline or at EOB, not
3822 just any NEUTRAL_B. (Bug#9470)
3823
bb187662
EZ
3824 * xdisp.c (set_cursor_from_row): Don't invoke special treatment of
3825 truncated lines if point is covered by a display string. (Bug#9524)
3826
2e621251
PE
38272011-09-16 Paul Eggert <eggert@cs.ucla.edu>
3828
3829 * xselect.c: Relax test for outgoing X longs (Bug#9498).
3830 (cons_to_x_long): New function.
3831 (lisp_data_to_selection_data): Use it. Correct the test for
3832 short-versus-long data; it was negated. Break out of vector
3833 loop, for efficiency, when a long datum is discovered.
3834
91a15bc6
SM
38352011-09-16 Stefan Monnier <monnier@iro.umontreal.ca>
3836
3837 * eval.c (Fquote): Document its non-consing behavior (bug#9482).
3838
b41c3a35
EZ
38392011-09-16 Eli Zaretskii <eliz@gnu.org>
3840
3841 * image.c (tiff_handler): Work around a bug in MinGW GCC 3.x (see
3842 GCC PR/17406) by declaring this function with external scope.
3843
7812ba2d
PE
38442011-09-15 Paul Eggert <eggert@cs.ucla.edu>
3845
3846 * editfns.c (Fformat): Fix bug in text-property fix (Bug#9514).
3847 Don't mishandle (length (format "%%")) and (format "%4000s%%" "").
3848
cf7edc2a
AS
38492011-09-15 Andreas Schwab <schwab@linux-m68k.org>
3850
3851 * editfns.c (Fformat): Correctly handle text properties on "%%".
3852
bd01620e
EZ
38532011-09-15 Eli Zaretskii <eliz@gnu.org>
3854
3855 * xterm.c (x_draw_composite_glyph_string_foreground):
3856 * w32term.c (x_draw_composite_glyph_string_foreground):
3857 * term.c (encode_terminal_code):
3858 * composite.c (composition_update_it, get_composition_id):
3859 * xdisp.c (get_next_display_element)
3860 (fill_composite_glyph_string): Add comments about special meaning
3861 of TAB characters in a composition.
3862
a02719a3
PE
38632011-09-15 Paul Eggert <eggert@cs.ucla.edu>
3864
3865 * editfns.c (Fformat): Fix off-by-1 bug for "%%b" (Bug#9514).
4c122725
PE
3866 This occurs when processing a multibyte format.
3867 Problem reported by Wolfgang Jenker.
a02719a3 3868
72589a3c
JB
38692011-09-15 Johan Bockgård <bojohan@gnu.org>
3870
3871 * xdisp.c (try_cursor_movement): Only check for exact match if
3872 cursor hpos found by set_cursor_from_row is valid. (Bug#9495)
3873
1c14176c
PE
38742011-09-14 Paul Eggert <eggert@cs.ucla.edu>
3875
3876 Remove unused external symbols.
3877 * dispextern.h (calc_pixel_width_or_height): Remove decl.
3878 * xdisp.c (calc_pixel_width_or_height): Now static.
3879 * doprnt.c (exprintf) [! (HAVE_X_WINDOWS && USE_X_TOOLKIT)]: Remove.
3880 * indent.c (check_display_width):
3881 * w32term.c: Fix comment to match code.
3882 * xterm.c, xterm.h (x_catching_errors): Remove.
3883
d2eea5b5
PE
38842011-09-14 Paul Eggert <eggert@cs.ucla.edu>
3885
3886 * xselect.c: Use signed conversions more consistently (Bug#9498).
3887 (selection_data_to_lisp_data): Assume incoming selection data are
3888 signed integers, not unsigned. This is to be consistent with
3889 outgoing selection data, which was modified to use signed integers
3890 in as part of the fix to Bug#9196 in response to Jan D.'s comment
3891 in <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9196#32> that X11
3892 expects long, not unsigned long.
3893
46888499
EZ
38942011-09-14 Eli Zaretskii <eliz@gnu.org>
3895
3896 * xdisp.c (try_window_reusing_current_matrix): Fix incorrect
3897 computation of loop end. Reported by Johan Bockgård
3898 <bojohan@gnu.org>.
3899
ef8ef9fb
CY
39002011-09-13 Chong Yidong <cyd@stupidchicken.com>
3901
3902 * frame.c (Fother_visible_frames_p): Function deleted.
3903
fa819fed
EZ
39042011-09-12 Eli Zaretskii <eliz@gnu.org>
3905
3906 * indent.c (compute_motion): Process display vector front to back
3907 rather than the other way around. (Bug#2496)
3908
2ba8e008
SM
39092011-09-12 Stefan Monnier <monnier@iro.umontreal.ca>
3910
3911 * fileio.c (Finsert_file_contents): Don't assume beg_offset is 0.
3912
20f53c69
CY
39132011-09-11 Chong Yidong <cyd@stupidchicken.com>
3914
3915 * minibuf.c (Fread_from_minibuffer): Doc fix.
3916
d562d7a4
EZ
39172011-09-11 Eli Zaretskii <eliz@gnu.org>
3918
3919 * xdisp.c (produce_stretch_glyph): Fix a typo made in changes from
3920 2011-08-30T17:32:44Z!eliz@gnu.org. (Bug#9475)
3921
1c4d7f3d
LMI
39222011-09-11 Lars Magne Ingebrigtsen <larsi@gnus.org>
3923
3924 * fileio.c (Fvisited_file_modtime): Document `(-1 65535)' as a
3925 value for non-existent files.
3926
b885bf36
EZ
39272011-09-11 Eli Zaretskii <eliz@gnu.org>
3928
3929 * fileio.c (Finsert_file_contents): If the file cannot be opened,
3930 set its "size" to -1. This will set the modtime_size field of
3931 the corresponding buffer to -1, which is what
3932 verify-visited-file-modtime expects for files that do not exist.
3933 (Bug#9139)
3934
6612f0bf
PE
39352011-09-11 Paul Eggert <eggert@cs.ucla.edu>
3936
3937 * keymap.h (KEY_DESCRIPTION_SIZE, push_key_description): Move decls
3938 here ...
3939 * lisp.h: ... from here. push_key_description is no longer
3940 defined in keyboard.c, so its declaration should not be in
3941 lisp.h's "Defined in keyboard.c" section, and KEY_DESCRIPTION_SIZE
3942 logically belongs with push_key_description.
3943
dfb3f755
PE
39442011-09-10 Paul Eggert <eggert@cs.ucla.edu>
3945
3946 * buffer.h: Include <sys/types.h> instead of <time.h>.
3947 Otherwise, off_t wasn't defined on FreeBSD 9.0-BETA2 i386.
3948 Problem reported by Herbert J. Skuhra.
3949
3134906c
LMI
39502011-09-10 Lars Magne Ingebrigtsen <larsi@gnus.org>
3951
3952 * xml.c (parse_region): Make the parsing work for
3953 non-comment-starting XML files again (bug#9144).
3954
8d903f4e
AS
39552011-09-10 Andreas Schwab <schwab@linux-m68k.org>
3956
3957 * image.c (gif_load): Fix calculation of bottom and right corner.
3958 (Bug#9468)
3959
80ad64f4
EZ
39602011-09-10 Eli Zaretskii <eliz@gnu.org>
3961
3962 * xdisp.c (MAX_DISP_SCAN): Decrease to 250. Prevents sluggish
3963 redisplay in small windows.
3964
208a048d
EZ
39652011-09-09 Eli Zaretskii <eliz@gnu.org>
3966
3967 * frame.c (x_report_frame_params): Cast to avoid compiler warnings.
3968
9b1c252e
MR
39692011-09-08 Martin Rudalics <rudalics@gmx.at>
3970
3971 * window.c (Fset_window_prev_buffers, Fset_window_next_buffers):
3972 Operate on live windows only.
3973
2949f33b
JB
39742011-09-08 Juanma Barranquero <lekktu@gmail.com>
3975
3976 * emacs.c (my_heap_start): #ifdef to avoid warnings when unused.
3977
e08dcafd
EZ
39782011-09-07 Eli Zaretskii <eliz@gnu.org>
3979
3980 * xdisp.c (move_it_in_display_line_to): Call RESTORE_IT on ppos_it
3981 only under bidi iteration.
3982
115b96bd
JD
39832011-09-07 Jan Djärv <jan.h.d@swipnet.se>
3984
3985 * gtkutil.c (xg_make_tool_item): Insert comment about eventbox.
3986
c8199d0f
PE
39872011-09-06 Paul Eggert <eggert@cs.ucla.edu>
3988
3989 isnan: Fix porting problem to Solaris 10 with bundled gcc.
3990 Without this fix, the command to link temacs failed due to an
3991 undefined symbol __builtin_isnan. This is because
3992 /usr/include/iso/math_c99.h #defines isnan(x) to
3993 __builtin_isnan(x), but the bundled gcc, which identifies itself
3994 as gcc 3.4.3 (csl-sol210-3_4-branch+sol_rpath), does not have
3995 a __builtin_isnan.
3996 * floatfns.c (isnan): #undef, and then #define to a clone of
3997 what's in data.c.
3998 (Fisnan): Always define, since it's always available now.
3999 (syms_of_floatfns): Always define isnan at the Lisp level.
4000
e39b275c 40012011-09-06 Paul Eggert <eggert@cs.ucla.edu>
1c262cae
PE
4002
4003 * Makefile.in (gl-stamp): move-if-change now in build-aux (Bug#9169).
4004
b2db44d9 40052011-09-06 Paul Eggert <eggert@cs.ucla.edu>
728f8f0a 4006
f4af5137 4007 * fileio.c: Fix bugs with large file offsets (Bug#9428).
728f8f0a
PE
4008 The previous code assumed that file offsets (off_t values) fit in
4009 EMACS_INT variables, which is not true on typical 32-bit hosts.
4010 The code messed up by falsely reporting buffer overflow in cases
4011 such as (insert-file-contents "big" nil 1 2) into an empty buffer
4012 when "big" contains more than 2**29 bytes, even though this
4013 inserts just one byte and does not overflow the buffer.
4014 (Finsert_file_contents): Store file offsets as off_t
4015 values, not as EMACS_INT values. Check for overflow when
4016 converting between EMACS_INT and off_t. When checking for
4017 buffer overflow or for overlap, take the offsets into account.
4018 Don't use EMACS_INT for small values where int suffices.
4019 When checking for overlap, fix a typo: ZV was used where
4020 ZV_BYTE was intended.
4021 (Fwrite_region): Don't assume off_t fits into 'long'.
4022 * buffer.h (struct buffer.modtime_size): Now off_t, not EMACS_INT.
4023
ecfc0a49
MA
40242011-09-05 Michael Albinus <michael.albinus@gmx.de>
4025
4026 * dbusbind.c (xd_signature_cat): Rename from signature_cat.
4027
6511acf2 40282011-09-04 Paul Eggert <eggert@cs.ucla.edu>
61bfeeb7 4029
0999621a 4030 sprintf-related integer and memory overflow issues (Bug#9412).
62f19c19
PE
4031
4032 * doprnt.c (doprnt): Support printing ptrdiff_t and intmax_t values.
8666506e 4033 (esprintf, exprintf, evxprintf): New functions.
62f19c19 4034 * keyboard.c (command_loop_level): Now EMACS_INT, not int.
6b02f655 4035 (cmd_error): Kbd macro iterations count is now EMACS_INT, not int.
62f19c19
PE
4036 (modify_event_symbol): Do not assume that the length of
4037 name_alist_or_stem is safe to alloca and fits in int.
4038 (Fexecute_extended_command): Likewise for function name and binding.
4039 (Frecursion_depth): Wrap around reliably on integer overflow.
4040 * keymap.c (push_key_description): First arg is now EMACS_INT, not int,
4041 since some callers pass EMACS_INT values.
4042 (Fsingle_key_description): Don't crash if symbol name contains more
4043 than MAX_ALLOCA bytes.
4044 * minibuf.c (minibuf_level): Now EMACS_INT, not int.
4045 (get_minibuffer): Arg is now EMACS_INT, not int.
4046 * lisp.h (get_minibuffer, push_key_description): Reflect API changes.
8666506e 4047 (esprintf, exprintf, evxprintf): New decls.
62f19c19
PE
4048 * window.h (command_loop_level, minibuf_level): Reflect API changes.
4049
2be7d702
PE
4050 * dbusbind.c (signature_cat): New function.
4051 (xd_signature, Fdbus_register_signal):
2ea16b89
PE
4052 Do not overrun buffer; instead, report string overflow.
4053
9d1df220
PE
4054 * dispnew.c (add_window_display_history): Don't overrun buffer.
4055 Truncate instead; this is OK since it's just a log.
4056
33ef5c64
PE
4057 * editfns.c (Fcurrent_time_zone): Don't overrun buffer
4058 even if the time zone offset is outlandishly large.
4059 Don't mishandle offset == INT_MIN.
4060
66c6fdd5
PE
4061 * emacs.c (main) [NS_IMPL_COCOA]: Don't overrun buffer
4062 when creating daemon; the previous buffer-overflow check was incorrect.
4063
d749b01b
PE
4064 * eval.c (verror): Simplify by rewriting in terms of evxprintf,
4065 which has the guts of the old verror function.
4066
b5cd1905
PE
4067 * filelock.c (lock_file_1, lock_file): Don't blindly alloca long name;
4068 use SAFE_ALLOCA instead. Use esprintf to avoid int-overflow issues.
4069
6e1a67fb
PE
4070 * font.c: Include <float.h>, for DBL_MAX_10_EXP.
4071 (font_unparse_xlfd): Don't blindly alloca long strings.
c21721cc 4072 Don't assume XINT result fits in int, or that XFLOAT_DATA * 10
8666506e 4073 fits in int, when using sprintf. Use single snprintf to count
c21721cc
PE
4074 length of string rather than counting it via multiple sprintfs;
4075 that's simpler and more reliable.
c21721cc
PE
4076 (font_unparse_fcname): Use it to avoid sprintf buffer overrun.
4077 (generate_otf_features) [0 && HAVE_LIBOTF]: Use esprintf, not
4078 sprintf, in case result does not fit in int.
4079
c57b67fc
PE
4080 * fontset.c (num_auto_fontsets): Now printmax_t, not int.
4081 (fontset_from_font): Print it.
4082
8a401434
PE
4083 * frame.c (tty_frame_count): Now printmax_t, not int.
4084 (make_terminal_frame, set_term_frame_name): Print it.
4085 (x_report_frame_params): In X, window IDs are unsigned long,
4086 not signed long, so print them as unsigned.
4087 (validate_x_resource_name): Check for implausibly long names,
4088 and don't assume name length fits in 'int'.
4089 (x_get_resource_string): Don't blindly alloca invocation name;
4090 use SAFE_ALLOCA. Use esprintf, not sprintf, in case result does
4091 not fit in int.
4092
6e1a67fb
PE
4093 * gtkutil.c: Include <float.h>, for DBL_MAX_10_EXP.
4094 (xg_check_special_colors, xg_set_geometry):
84722b3d
PE
4095 Make sprintf buffers a bit bigger, to avoid potential buffer overrun.
4096
0df02bf3
PE
4097 * lread.c (dir_warning): Don't blindly alloca buffer; use SAFE_ALLOCA.
4098 Use esprintf, not sprintf, in case result does not fit in int.
4099
48e30793
PE
4100 * macros.c (executing_kbd_macro_iterations): Now EMACS_INT, not int.
4101 (Fend_kbd_macro): Don't mishandle MOST_NEGATIVE_FIXNUM by treating
4102 it as a large positive number.
4103 (Fexecute_kbd_macro): Don't assume repeat count fits in int.
4104 * macros.h (executing_kbd_macro_iterations): Now EMACS_INT, not int.
4105
a66ff6d8
PE
4106 * nsterm.m ((NSSize)windowWillResize): Use esprintf, not sprintf,
4107 in case result does not fit in int.
4108
aca216ff
PE
4109 * print.c (float_to_string): Detect width overflow more reliably.
4110 (print_object): Make sprintf buffer a bit bigger, to avoid potential
4111 buffer overrun. Don't assume list length fits in 'int'. Treat
4112 print length of 0 as 0, not as infinity; to be consistent with other
4113 uses of print length in this function. Don't overflow print length
4114 index. Don't assume hash table size fits in 'long', or that
4115 vectorlike size fits in 'unsigned long'.
4116
31c286f7
PE
4117 * process.c (make_process): Use printmax_t, not int, to format
4118 process-name gensyms.
4119
55e5faa1
PE
4120 * sysdep.c (snprintf) [! HAVE_SNPRINTF]: New function.
4121
80f2e268
PE
4122 * term.c (produce_glyphless_glyph): Make sprintf buffer a bit bigger
4123 to avoid potential buffer overrun.
4124
670741ab
PE
4125 * xfaces.c (x_update_menu_appearance): Don't overrun buffer
4126 if X resource line is longer than 512 bytes.
4127
b7163a50
PE
4128 * xfns.c (x_window): Make sprintf buffer a bit bigger
4129 to avoid potential buffer overrun.
4130
ae58ff1f
PE
4131 * xterm.c (x_io_error_quitter): Don't overrun sprintf buffer.
4132
c43c8a6a
PE
4133 * xterm.h (x_check_errors): Add ATTRIBUTE_FORMAT_PRINTF.
4134
3f8236f4
PE
41352011-09-04 Paul Eggert <eggert@cs.ucla.edu>
4136
53e9fe90 4137 Integer overflow fixes for scrolling, etc.
6511acf2
PE
4138 Without these, Emacs silently mishandles large integers sometimes.
4139 For example, "C-u 4294967297 M-x recenter" was treated as if
53e9fe90
PE
4140 it were "C-u 1 M-x recenter" on a typical 64-bit host.
4141
6511acf2
PE
4142 * xdisp.c (try_window_id): Check Emacs fixnum range before
4143 converting to 'int'.
806add1d 4144
6511acf2 4145 * window.c (window_scroll_line_based, Frecenter):
71f02bc5
PE
4146 Check that an Emacs fixnum is in range before assigning it to 'int'.
4147 (Frecenter, Fmove_to_window_line): Use EMACS_INT, not int, for
4148 values converted from Emacs fixnums.
4149 (Frecenter): Don't wrap around a line count if it is out of 'int'
4150 range; instead, treat it as an extreme value.
4151 (Fset_window_configuration, compare_window_configurations):
4152 Use ptrdiff_t, not int, for index that might exceed 2 GiB.
4153
6511acf2
PE
4154 * search.c (Freplace_match): Use ptrdiff_t, not int, for indexes
4155 that can exceed INT_MAX. Check that EMACS_INT value is in range
4156 before assigning it to the (possibly-narrower) index.
a0efffc8
PE
4157 (match_limit): Don't assume that a fixnum can fit in 'int'.
4158
6511acf2 4159 * print.c (print_object): Use ptrdiff_t, not int, for index that can
29ebea3b
PE
4160 exceed INT_MAX.
4161
6511acf2 4162 * indent.c (position_indentation): Now takes ptrdiff_t, not int.
3f8236f4
PE
4163 (Fvertical_motion): Don't wrap around LINES values that don't fit
4164 in 'int'. Instead, treat them as extreme values. This is good
4165 enough for windows, which can't have more than INT_MAX lines anyway.
4166
fcb901a7
LMI
41672011-09-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
4168
0f2f6b6d
LMI
4169 * Require libxml/parser.h to avoid compilation warning.
4170
fcb901a7
LMI
4171 * emacs.c (shut_down_emacs): Call xmlCleanupParser on shutdown.
4172
4173 * xml.c (parse_region): Don't call xmlCleanupParser after parsing,
4174 since this reportedly can destroy thread storage.
4175
6e20a0d4
CY
41762011-08-30 Chong Yidong <cyd@stupidchicken.com>
4177
4178 * syntax.c (find_defun_start): Update all cache variables if
4179 exiting early (Bug#9401).
4180
148ae00e
EZ
41812011-08-30 Eli Zaretskii <eliz@gnu.org>
4182
f6cfbd8f
EZ
4183 * image.c (x_bitmap_pixmap): Cast to int to avoid compiler warnings.
4184
148ae00e
EZ
4185 * xdisp.c (produce_stretch_glyph): No longer static, compiled also
4186 when HAVE_WINDOW_SYSTEM is not defined. Support both GUI and TTY
4187 frames. Call tty_append_glyph in the TTY case. (Bug#9402)
4188
4189 * term.c (tty_append_glyph): New function.
4190 (produce_stretch_glyph): Static function and its prototype deleted.
4191
a66cfb1c
SM
4192 * dispextern.h (produce_stretch_glyph, tty_append_glyph):
4193 Add prototypes.
148ae00e 4194
c4a07a4c
PE
41952011-08-29 Paul Eggert <eggert@cs.ucla.edu>
4196
4197 * image.c (parse_image_spec): Check for nonnegative, not for positive,
4198 when checking :margin (Bug#9390).
4199 (IMAGE_NON_NEGATIVE_INTEGER_VALUE_OR_PAIR):
a66cfb1c 4200 Rename from IMAGE_POSITIVE_INTEGER_VALUE_OR_PAIR,
c4a07a4c
PE
4201 so that the name doesn't mislead. All uses changed.
4202
6bc8cd65
JB
42032011-08-28 Johan Bockgård <bojohan@gnu.org>
4204
4205 * term.c (init_tty) [HAVE_GPM]: Move mouse settings after
4206 set_tty_hooks.
4207
dca4927e
EZ
42082011-08-27 Eli Zaretskii <eliz@gnu.org>
4209
4210 * xdisp.c (move_it_to): Don't bail out early when reaching
4211 position beyond to_charpos, if we are scanning backwards.
4212 (move_it_vertically_backward): When DY == 0, make sure we get to
4213 the first character in the line after the newline.
4214
f2cad773
PE
42152011-08-27 Paul Eggert <eggert@cs.ucla.edu>
4216
4217 * ccl.c: Improve and simplify overflow checking (Bug#9196).
4218 (ccl_driver): Do not generate an out-of-range pointer.
4219 (Fccl_execute_on_string): Remove unnecessary check for
4220 integer overflow, noted by Stefan Monnier in
4221 <http://lists.gnu.org/archive/html/emacs-devel/2011-08/msg00979.html>.
4222 Remove a FIXME that didn't need fixing.
4223 Simplify the newly-introduced buffer reallocation code.
4224
0cae2cdb
JB
42252011-08-27 Juanma Barranquero <lekktu@gmail.com>
4226
4227 * makefile.w32-in ($(BLD)/alloc.$(O)): Depend on lib/verify.h.
4228
5fc295a4 42292011-08-26 Paul Eggert <eggert@cs.ucla.edu>
ddff3151 4230
70c60eb2 4231 Integer and memory overflow issues (Bug#9196).
726e0ab1 4232
d31850da
PE
4233 * doc.c (get_doc_string): Rework so that
4234 get_doc_string_buffer_size is the actual buffer size, rather than
4235 being 1 less than the actual buffer size; this makes xpalloc more
4236 convenient.
4237
a69fbedb
PE
4238 * image.c (x_allocate_bitmap_record, cache_image):
4239 * xselect.c (Fx_register_dnd_atom):
4240 Simplify previous changes by using xpalloc.
4241
fe5c5d37
PE
4242 * buffer.c (overlay_str_len): Now ptrdiff_t, not EMACS_INT,
4243 since either will do and ptrdiff_t is convenient with xpalloc.
4244
0065d054
PE
4245 * charset.c (charset_table_size)
4246 (struct charset_sort_data.priority): Now ptrdiff_t.
4247 (charset_compare): Don't overflow if priorities differ greatly.
4248 (Fsort_charsets): Don't assume list length fits in int.
4249 Check for size-calculation overflow when allocating sort data.
4250 (syms_of_charset): Allocate an initial charset table that is
4251 just under 64 KiB, to avoid problems with glibc malloc and mmap.
4252
4253 * cmds.c (internal_self_insert): Check for size-calculation overflow.
4254
4255 * composite.h (struct composition.glyph_len): Now int, not unsigned.
4256 The actual value is always <= INT_MAX, and leaving it unsigned made
4257 overflow checking harder.
4258
4259 * dispextern.h (struct glyph_matrix.rows_allocated)
4260 (struct face_cache.size): Now ptrdiff_t, for convenience in use
4261 with xpalloc. The values are still always <= INT_MAX.
4262
4263 * indent.c (compute_motion): Adjust to region_cache_forward sig change.
4264
4265 * lisp.h (xnmalloc, xnrealloc, xpalloc): New decls.
4266 (SAFE_NALLOCA): New macro.
4267
4268 * region-cache.c (struct boundary.pos, find_cache_boundary)
4269 (move_cache_gap, insert_cache_boundary, delete_cache_boundaries)
4270 (set_cache_region, invalidate_region_cache)
4271 (revalidate_region_cache, know_region_cache, region_cache_forward)
4272 (region_cache_backward, pp_cache):
4273 Use ptrdiff_t, not EMACS_INT, since either will do. This is needed
4274 so that ptrdiff_t * can be passed to xpalloc.
4275 (struct region_cache): Similarly, for gap_start, gap_len, cache_len,
4276 beg_unchanged, end_unchanged, buffer_beg, buffer_end members.
4277 (pp_cache): Don't assume cache_len fits in int.
4278 * region-cache.h: Adjust extern decls to match.
4279
4280 * search.c (scan_buffer, Freplace_match): Use ptrdiff_t, not
4281 EMACS_INT, since either will do, for xpalloc.
4282
4283 * alloc.c: Include verify.h, and check that int fits in ptrdiff_t.
4284 (xnmalloc, xnrealloc, xpalloc): New functions.
4285
726e0ab1
PE
4286 * bidi.c (bidi_shelve_header_size): New constant.
4287 (bidi_cache_ensure_space, bidi_shelve_cache): Use it.
4288 (bidi_cache_ensure_space): Avoid integer overflow when allocating.
4289
51f30bc5 4290 * bidi.c (bidi_cache_shrink):
726e0ab1
PE
4291 * buffer.c (overlays_at, overlays_in, record_overlay_string)
4292 (overlay_strings):
4293 Don't update size of array until after memory allocation succeeds,
4294 because xmalloc/xrealloc may not return.
0065d054
PE
4295 (struct sortstrlist.bytes): Now ptrdiff_t, as EMACS_INT doesn't help
4296 now that we have proper integer overflow checking.
4297 (record_overlay_string, overlay_strings): Catch overflows when
4298 calculating size of overlay_str_buf.
726e0ab1 4299
0065d054
PE
4300 * callproc.c (Fcall_process): Check for size overflow when
4301 calculating size of args2.
4302 (child_setup): Avoid overflow by using size_t rather than ptrdiff_t.
4303 Normally we prefer signed values, but sticking with ptrdiff_t would
4304 require adding more-complicated checks.
726e0ab1
PE
4305
4306 * ccl.c (Fccl_execute_on_string): Check for memory overflow.
4307 Use ptrdiff_t rather than EMACS_INT where ptrdiff_t will do.
4308 Redo buffer-overflow calculations to avoid integer overflow.
0065d054 4309 Add a FIXME comment where memory seems to be over-allocated.
726e0ab1
PE
4310
4311 * character.c (Fstring): Check for size-calculation overflow.
4312
4313 * coding.c (produce_chars): Redo buffer-overflow calculations to avoid
4314 unnecessary integer overflow. Check for size overflow.
4315 (encode_coding_object): Don't update size until xmalloc succeeds.
4316
4317 * composite.c (get_composition_id): Check for overflow in glyph
4318 length calculations.
4319
4320 Integer and memory overflow fixes for display code.
4321 * dispextern.h (struct glyph_pool.nglyphs): Now ptrdiff_t, not int.
4322 * dispnew.c (adjust_glyph_matrix, realloc_glyph_pool)
4323 (scrolling_window): Check for overflow in size calculations.
4324 (line_draw_cost, realloc_glyph_pool, add_row_entry):
4325 Don't assume glyph table len fits in int.
4326 (struct row_entry.bucket, row_entry_pool_size, row_entry_idx)
4327 (row_table_size): Now ptrdiff_t, not int.
4328 (scrolling_window): Avoid overflow in size calculations.
4329 Don't update size until allocation succeeds.
4330 * fns.c (concat): Check for overflow in size calculations.
4331 (next_almost_prime): Verify NEXT_ALMOST_PRIME_LIMIT.
4332 * lisp.h (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): New macros.
4333 (NEXT_ALMOST_PRIME_LIMIT): New constant.
4334
4335 * doc.c (get_doc_string_buffer_size): Now ptrdiff_t, not int.
4336 (get_doc_string): Check for size calculation overflow.
4337 Don't update size until allocation succeeds.
4338 (get_doc_string, Fsubstitute_command_keys): Use ptrdiff_t, not
4339 EMACS_INT, where ptrdiff_t will do.
4340 (Fsubstitute_command_keys): Check for string overflow.
4341
4342 * editfns.c (set_time_zone_rule): Don't assume environment length
4343 fits in int.
4344 (message_length): Now ptrdiff_t, not int.
4345 (Fmessage_box): Don't update size until allocation succeeds.
4346 Don't assume message length fits in int.
4347 (Fformat): Use ptrdiff_t, not EMACS_INT, where ptrdiff_t will do.
4348
0065d054
PE
4349 * emacs.c (main): Do not reallocate argv, since there is a null at
4350 the end that can be overwritten, and this way there's no need to
4351 worry about size-calculation overflow.
4352 (sort_args): Check for size-calculation overflow.
726e0ab1
PE
4353
4354 * eval.c (init_eval_once, grow_specpdl): Don't update size until
4355 alloc succeeds.
4356 (call_debugger, grow_specpdl): Redo calculations to avoid overflow.
4357
4358 * frame.c (set_menu_bar_lines, x_set_frame_parameters)
4359 (x_set_scroll_bar_width, x_figure_window_size):
4360 Check for integer overflow.
4361 (x_set_alpha): Do not assume XINT fits in int.
4362
4363 * frame.h (struct frame): Use int, not EMACS_INT, where int works.
4364 This is for the members text_lines, text_cols, total_lines, total_cols,
4365 where the system imposes an 'int' limit.
4366
4367 * fringe.c (Fdefine_fringe_bitmap):
4368 Don't update size until alloc works.
4369
4370 * ftfont.c (ftfont_get_open_type_spec, setup_otf_gstring)
4371 (ftfont_shape_by_flt): Check for integer overflow in size calculations.
4372
4373 * gtkutil.c (get_utf8_string, xg_store_widget_in_map):
4374 Check for size-calculation overflow.
4375 (get_utf8_string): Use ptrdiff_t, not size_t, where either will
4376 do, as we prefer signed integers.
4377 (id_to_widget.max_size, id_to_widget.used)
4378 (xg_store_widget_in_map, xg_remove_widget_from_map)
4379 (xg_get_widget_from_map, xg_get_scroll_id_for_window)
4380 (xg_remove_scroll_bar, xg_update_scrollbar_pos):
4381 Use and return ptrdiff_t, not int.
4382 (xg_gtk_scroll_destroy): Don't assume ptrdiff_t fits in int.
4383 * gtkutil.h: Change prototypes to match the above.
4384
4385 * image.c (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): Remove; these
4386 are duplicate now that they've been promoted to lisp.h.
4387 (x_allocate_bitmap_record, x_alloc_image_color)
4388 (make_image_cache, cache_image, xpm_load):
4389 Don't update size until alloc is done.
4390 (xpm_load, lookup_rgb_color, lookup_pixel_color, x_to_xcolors)
4391 (x_detect_edges):
3256efce 4392 Check for size calculation overflow.
726e0ab1
PE
4393 (ct_colors_allocated_max): New constant.
4394 (x_to_xcolors, x_detect_edges): Reorder multiplicands to avoid
4395 overflow.
3256efce 4396
726e0ab1
PE
4397 * keyboard.c (read_char, menu_bar_items, tool_bar_items)
4398 (read_char_x_menu_prompt, read_char_minibuf_menu_width)
4399 (read_char_minibuf_menu_prompt, follow_key, read_key_sequence):
4400 Use ptrdiff_t, not int, to count maps.
4401 (read_char_minibuf_menu_prompt): Check for overflow in size
a66cfb1c
SM
4402 calculations. Don't update size until allocation succeeds.
4403 Redo calculations to avoid overflow.
726e0ab1
PE
4404 * keyboard.h: Change prototypes to match the above.
4405
4406 * keymap.c (cmm_size, current_minor_maps): Use ptrdiff_t, not int,
4407 to count maps.
4408 (current_minor_maps): Check for size calculation overflow.
4409 * keymap.h: Change prototypes to match the above.
4410
4411 * lread.c (read1, init_obarray): Don't update size until alloc done.
4412
4413 * macros.c (Fstart_kbd_macro): Don't update size until alloc done.
4414 (store_kbd_macro_char): Reorder multiplicands to avoid overflow.
4415
726e0ab1
PE
4416 * nsterm.h (struct ns_color_table.size, struct ns_color_table.avail):
4417 Now ptrdiff_t, not int.
4418 * nsterm.m (ns_index_color): Use ptrdiff_t, not int, for table indexes.
4419 (ns_draw_fringe_bitmap): Rewrite to avoid overflow.
4420
4421 * process.c (Fnetwork_interface_list): Check for overflow
4422 in size calculation.
4423
4424 * region-cache.c (move_cache_gap): Check for size calculation overflow.
4425
4426 * scroll.c (do_line_insertion_deletion_costs): Check for size calc
4427 overflow. Don't bother calling xmalloc when xrealloc will do.
4428
4429 * search.c (Freplace_match): Check for size calculation overflow.
4430 (Fset_match_data): Don't assume list lengths fit in 'int'.
4431
4432 * sysdep.c (system_process_attributes): Use ptrdiff_t, not int,
4433 for command line length. Do not attempt to address one before the
4434 beginning of an array, as that's not portable.
4435
4436 * term.c (max_frame_lines): Remove; unused.
4437 (encode_terminal_src_size, encode_terminal_dst_size): Now ptrdiff_t,
4438 not int.
4439 (encode_terminal_code, calculate_costs): Check for size
4440 calculation overflow.
4441 (encode_terminal_code): Use ptrdiff_t, not int, to record glyph
4442 table lengths and related sizes. Don't update size until alloc
4443 done. Redo calculations to avoid overflow.
4444 (calculate_costs): Don't bother calling xmalloc when xrealloc will do.
4445
4446 * termcap.c (tgetent): Use ptrdiff_t, not int, to record results of
4447 subtracting pointers.
4448 (gobble_line): Check for overflow more carefully. Don't update size
4449 until alloc done.
4450
4451 * tparam.c (tparam1): Use ptrdiff_t, not int, for sizes.
4452 Don't update size until alloc done.
4453 Redo size calculations to avoid overflow.
4454 Check for size calculation overflow.
0065d054 4455 (main) [DEBUG]: Fix typo in invoking tparam1.
726e0ab1
PE
4456
4457 * xdisp.c (store_mode_line_noprop_char, x_consider_frame_title):
4458 Use ptrdiff_t, not int, for sizes.
4459 (store_mode_line_noprop_char): Don't update size until alloc done.
4460
0065d054
PE
4461 * xfaces.c (lface_id_to_name_size, Finternal_make_lisp_face):
4462 Use ptrdiff_t, not int, for sizes.
4463 (Finternal_make_lisp_face, cache_face):
4464 Check for size calculation overflow.
4465 (cache_face): Treat size calculation overflows as if they were
4466 memory exhaustion (the usual treatment), rather than aborting.
726e0ab1
PE
4467
4468 * xfns.c (x_encode_text, x_set_name_internal)
4469 (Fx_change_window_property): Use ptrdiff_t, not int, to count
4470 sizes, since they can exceed INT_MAX in size. Check for size
4471 calculation overflow.
4472
0065d054
PE
4473 * xgselect.c (gfds_size): Now ptrdiff_t, for convenience with xpalloc.
4474 (xg_select): Check for size calculation overflow.
726e0ab1
PE
4475 Don't update size until alloc done.
4476
0065d054 4477 * xrdb.c (get_environ_db): Don't assume path length fits in int,
726e0ab1 4478 as sprintf is limited to int lengths.
1d526e2f 4479
252c5ee1
PE
4480 * xselect.c (X_LONG_SIZE, X_SHRT_MAX, X_SHRT_MIN, X_LONG_MAX)
4481 (X_LONG_MIN): New macros.
864d7ce7
PE
4482 Use them to make the following changes clearer.
4483 (MAX_SELECTION_QUANTUM): Make the other bounds on this value clearer.
4484 This change doesn't affect the value now, but it may help remind
4485 future maintainers not to raise the value too much later.
4486 (SELECTION_QUANTUM): Remove, replacing with ...
4487 (selection_quantum): ... new function, which avoids overflow.
4488 All uses changed.
4489 (struct selection_data.size): Now ptrdiff_t, not int, to avoid
4490 assumption that selection length fits in 'int'.
4491 (x_reply_selection_request, x_handle_selection_request)
4492 (x_get_window_property, receive_incremental_selection)
4493 (x_get_window_property_as_lisp_data, selection_data_to_lisp_data)
4494 (lisp_data_to_selection_data, clean_local_selection_data):
4495 Use ptrdiff_t, not int, to record length of selection.
4496 (x_reply_selection_request, x_get_window_property)
4497 (receive_incremental_selection, x_property_data_to_lisp):
4498 Redo calculations to avoid overflow.
4499 (x_reply_selection_request): When sending hint, ceiling it at
252c5ee1 4500 X_LONG_MAX rather than relying on wraparound overflow to send
864d7ce7
PE
4501 something.
4502 (x_get_window_property, receive_incremental_selection)
4503 (lisp_data_to_selection_data, x_property_data_to_lisp):
4504 Check for size-calculation overflow.
4505 (x_get_window_property, receive_incremental_selection)
4506 (lisp_data_to_selection_data, Fx_register_dnd_atom):
4507 Don't store size until memory allocation succeeds.
4508 (x_get_window_property): Plug memory leak on memory exhaustion.
4509 Don't double-block input; malloc is safe here. Don't assume 2**34
4510 - 4 fits in unsigned long. Add an xassert to check
4511 XGetWindowProperty overflow. Be more careful about overflow
4512 calculations, and distinguish size from memory overflow better.
4513 (receive_incremental_selection): When tracing, don't assume
4514 unsigned int is less than INT_MAX.
4515 (x_selection_data_to_lisp_data): Remove unnecessary (and in theory
4516 harmful) conversions of unsigned short to int.
4517 (lisp_data_to_selection_data): Don't assume that integers
4518 in the range -65535 through -1 fit in an X unsigned short.
4519 Don't assume that ULONG_MAX == X_ULONG_MAX. Don't store into
4520 result parameters unless successful. Rely on cons_to_unsigned
4521 to report problems with elements; the old code wasn't right anyway.
4522 (x_check_property_data): Check for int overflow; we cannot use
4523 a wider type due to X limits.
4524 (x_handle_dnd_message): Use unsigned int, to avoid int overflow.
4525
726e0ab1 4526 * xsmfns.c (smc_save_yourself_CB): Check for size calc overflow.
34db673b 4527
0065d054
PE
4528 * xterm.c (x_color_cells, x_send_scrollbar_event, handle_one_xevent)
4529 (x_term_init): Check for size calculation overflow.
726e0ab1
PE
4530 (x_color_cells): Don't store size until memory allocation succeeds.
4531 (handle_one_xevent): Use ptrdiff_t, not int, for byte counts.
0065d054 4532 Don't assume alloca size is less than MAX_ALLOCA.
726e0ab1
PE
4533 (x_term_init): Don't assume length fits in int (sprintf is limited
4534 to int size).
bc18e09d 4535
ebfa62c0
PE
4536 Use ptrdiff_t for composition IDs.
4537 * character.c (lisp_string_width):
4538 * composite.c (composition_table_size, n_compositions)
4539 (get_composition_id, composition_gstring_from_id):
4540 * dispextern.h (struct glyph_string.cmp_id, struct composition_it.id):
4541 * xdisp.c (BUILD_COMPOSITE_GLYPH_STRING):
4542 * window.c (Frecenter):
4543 Use ptrdiff_t, not int, for composition IDs.
4544 * composite.c (get_composition_id): Check for integer overflow.
4545 * composite.h: Adjust prototypes to match the above changes.
4546
d3411f89
PE
4547 Use ptrdiff_t for hash table indexes.
4548 * category.c (hash_get_category_set):
4549 * ccl.c (ccl_driver):
4550 * charset.h (struct charset.hash_index, CHECK_CHARSET_GET_ID):
4551 * coding.c (coding_system_charset_list, detect_coding_system):
4552 * coding.h (struct coding_system.id):
4553 * composite.c (get_composition_id, gstring_lookup_cache):
4554 * fns.c (hash_lookup, hash_put, Fgethash, Fputhash):
4555 * image.c (xpm_get_color_table_h):
4556 * lisp.h (hash_lookup, hash_put):
4557 * minibuf.c (Ftest_completion):
4558 Use ptrdiff_t for hash table indexes, not int (which is too
4559 narrow, on 64-bit hosts) or EMACS_INT (which is too wide, on
4560 32-bit --with-wide-int hosts).
4561
e097a6fa
PE
4562 * charset.c (Fdefine_charset_internal): Check for integer overflow.
4563 Add a FIXME comment about memory leaks.
4564 (syms_of_charset): Don't assume xmalloc returns.
4565
5637687f
PE
4566 Don't assume that stated character widths fit in int.
4567 * character.c (Fchar_width, c_string_width, lisp_string_width):
4568 * character.h (CHAR_WIDTH):
4569 * indent.c (MULTIBYTE_BYTES_WIDTH):
4570 Use sanitize_char_width to avoid undefined and/or bad behavior
4571 with outlandish widths.
a66cfb1c 4572 * character.h (sanitize_tab_width): Rename from sanitize_width,
5637687f
PE
4573 now that we have two such functions. All uses changed.
4574 (sanitize_char_width): New inline function.
4575
a2271ba2
PE
4576 Don't assume that tab-width fits in int.
4577 * character.h (sanitize_width): New inline function.
4578 (SANE_TAB_WIDTH): New macro.
4579 (ASCII_CHAR_WIDTH): Use it.
4580 * indent.c (sane_tab_width): Remove. All uses replaced by
4581 SANE_TAB_WIDTH (current_buffer).
4582 * xdisp.c (init_iterator): Use SANE_TAB_WIDTH.
4583
18c52557
PE
4584 * fileio.c: Integer overflow issues with file modes.
4585 (Fset_file_modes, auto_save_1): Don't assume EMACS_INT fits in int.
4586
caeeedc1
PE
4587 * charset.c (read_hex): New arg OVERFLOW. All uses changed.
4588 Remove unreachable code.
4589 (read_hex, load_charset_map_from_file): Check for integer overflow.
4590
6df6ae42 4591 * xterm.c: Don't go over XClientMessageEvent limit.
50849c52
PE
4592 (scroll_bar_windows_size): Now ptrdiff_t, as we prefer signed.
4593 (x_send_scroll_bar_event): Likewise. Check that the size does not
4594 exceed limits imposed by XClientMessageEvent, as well as the usual
4595 ptrdiff_t and size_t limits.
4596
b13995db
PE
4597 * keyboard.c: Overflow, signedness and related fixes.
4598 (make_lispy_movement): Use same integer type in forward decl
4599 that is used in the definition.
4600 (read_key_sequence, keyremap_step):
4601 Change bufsize argument back to int, undoing my 2011-03-30 change.
4602 We prefer signed types, and int is wide enough here.
4603 (parse_tool_bar_item): Don't assume tool_bar_max_label_size is less
4604 than TYPE_MAXIMUM (EMACS_INT) / 2. Don't let the label size grow
4605 larger than STRING_BYTES_BOUND. Use ptrdiff_t for Emacs string
4606 length, not size_t. Use ptrdiff_t for index, not int.
4607 (keyremap_step, read_key_sequence): Redo bufsize check to avoid
4608 possibility of integer overflow.
4609
13464394
PE
4610 Overflow, signedness and related fixes for images.
4611
4612 * dispextern.h (struct it.stack[0].u.image.image_id)
4613 (struct_it.image_id, struct image.id, struct image_cache.size)
4614 (struct image_cache.used, struct image_cache.ref_count):
4615 * gtkutil.c (update_frame_tool_bar):
4616 * image.c (x_reference_bitmap, Fimage_size, Fimage_mask_p)
4617 (Fimage_metadata, free_image_cache, clear_image_cache, lookup_image)
4618 (cache_image, mark_image_cache, x_kill_gs_process, Flookup_image):
4619 * nsmenu.m (update_frame_tool_bar):
4620 * xdisp.c (calc_pixel_width_or_height):
4621 * xfns.c (image_cache_refcount):
4622 Image IDs are now ptrdiff_t, not int, to avoid arbitrary limits
4623 on typical 64-bit hosts.
4624
4625 * image.c (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): New macros.
4626 (x_bitmap_pixmap, x_create_x_image_and_pixmap):
4627 Omit unnecessary casts to int.
4628 (parse_image_spec): Check that integers fall into 'int' range
4629 when the callers expect that.
4630 (image_ascent): Redo ascent calculation to avoid int overflow.
4631 (clear_image_cache): Avoid overflow when sqrt (INT_MAX) < nimages.
4632 (lookup_image): Remove unnecessary tests.
4633 (xbm_image_p): Locals are now of int, not EMACS_INT,
4634 since parse_image_check makes sure they fit into int.
4635 (png_load, gif_load, svg_load_image):
4636 Prefer int to unsigned where either will do.
4637 (tiff_handler): New function, combining the cores of the
a66cfb1c
SM
4638 old tiff_error_handler and tiff_warning_handler.
4639 This function is rewritten to use vsnprintf and thereby avoid
13464394
PE
4640 stack buffer overflows. It uses only the features of vsnprintf
4641 that are common to both POSIX and native Microsoft.
4642 (tiff_error_handler, tiff_warning_handler): Use it.
4643 (tiff_load, gif_load, imagemagick_load_image):
4644 Don't assume :index value fits in 'int'.
4645 (gif_load): Omit unnecessary cast to double, and avoid double-rounding.
4646 (imagemagick_load_image): Check that crop parameters fit into
4647 the integer types that MagickCropImage accepts. Don't assume
4648 Vimagemagick_render_type has a nonnegative value. Don't assume
4649 size_t fits in 'long'.
4650 (gs_load): Use printmax_t to print the widest integers possible.
4651 Check for integer overflow when computing image height and width.
4652
c11821d4
EZ
46532011-08-26 Eli Zaretskii <eliz@gnu.org>
4654
4655 * xdisp.c (redisplay_window): Don't force window start if point
4656 will be invisible in the resulting window. (Bug#9324)
4657
0c95fcf7
EZ
46582011-08-25 Eli Zaretskii <eliz@gnu.org>
4659
4660 * xdisp.c (compute_display_string_pos): Return 2 in DISP_PROP when
4661 the display spec is of the form `(space ...)'.
4662 (handle_display_spec): Return the value returned by
4663 handle_single_display_spec, not just 1 or zero.
4664 (handle_single_display_spec): If the display spec is of the form
4665 `(space ...)', and specifies display in the text area, return 2
4666 rather than 1.
fee65a97 4667 (try_cursor_movement): Check for the need to scroll more
a66cfb1c
SM
4668 accurately, and prefer exact match for point under bidi.
4669 Don't advance `row' beyond the last row of the window.
0c95fcf7
EZ
4670
4671 * dispextern.h (struct bidi_it): Rename the disp_prop_p member
4672 into disp_prop; all users changed.
4673
4674 * bidi.c (bidi_fetch_char): If compute_display_string_pos returns
4675 DISP_PROP = 2, substitute the u+2029 PARAGRAPH SEPARATOR character
4676 for the text covered by the display property.
4677
e4ed06f1
CY
46782011-08-25 Chong Yidong <cyd@stupidchicken.com>
4679
4680 * buffer.c (Fbury_buffer_internal): Rename from Funrecord_buffer.
4681 Change return value to nil.
4682 (Frecord_buffer): Delete unused function.
4683
f67cdd7f
EZ
46842011-08-24 Eli Zaretskii <eliz@gnu.org>
4685
5980d4c6
EZ
4686 * xdisp.c (Fcurrent_bidi_paragraph_direction): For unibyte
4687 buffers, return left-to-right.
8610fe8b
EZ
4688 (set_cursor_from_row): Consider candidate row a win if its glyph
4689 represents a newline and point is on that newline. Fixes cursor
4690 positioning on the newline at EOL of R2L text within L2R
4691 paragraph, and vice versa.
4692 (try_cursor_movement): Check continued rows, in addition to
4693 continuation rows. Fixes unwarranted scroll when point enters a
4694 continued line of R2L text within an L2R paragraph, or vice versa.
4695 (cursor_row_p): Consider the case of point being equal to
4696 MATRIX_ROW_END_CHARPOS. Prevents cursor being stuck when moving
4697 from the end of a short line to the beginning of a continued line
4698 of R2L text within L2R paragraph.
4699 (RECORD_MAX_MIN_POS): For max_pos, use IT_CHARPOS even for
4700 composed characters.
5980d4c6 4701
f67cdd7f
EZ
4702 * bidi.c (bidi_check_type): Use xassert.
4703 (bidi_cache_iterator_state): Update the disp_pos and disp_prop_p
4704 members.
4705
bca633fb
EZ
47062011-08-23 Eli Zaretskii <eliz@gnu.org>
4707
4708 * bidi.c (bidi_get_type): Abort if we get zero as the bidi type of
4709 a character.
4710
4a5885a7
CY
47112011-08-23 Chong Yidong <cyd@stupidchicken.com>
4712
4713 * nsfont.m (ns_otf_to_script): Fix typo.
4714
0902a04e
KH
47152011-08-22 Kenichi Handa <handa@m17n.org>
4716
4717 * chartab.c (Fset_char_table_extra_slot): Do not inhibit setting a
4718 extra slot even if the purpose is char-code-property-table.
4719
1a2e6670
EZ
47202011-08-23 Eli Zaretskii <eliz@gnu.org>
4721
8ddde651
EZ
4722 * xdisp.c (redisplay_window): When computing centering_position,
4723 account for the height of the header line. (Bug#8874)
4724
425cc014
EZ
4725 * dispnew.c (buffer_posn_from_coords): Use buf_charpos_to_bytepos
4726 instead of CHAR_TO_BYTE. Fixes a crash when a completion
4727 candidate is selected by the mouse, and that candidate has a
4728 composed character under the mouse.
4729
1a2e6670
EZ
4730 * xdisp.c (x_produce_glyphs): Set it->nglyphs to 1. Fixes pixel
4731 coordinates reported by pos-visible-in-window-p for a composed
4732 character in column zero.
4733
8b76d6f8
SM
47342011-08-23 Stefan Monnier <monnier@iro.umontreal.ca>
4735
4736 * cmds.c (Fself_insert_command): Mention post-self-insert-hook.
4737
dac347dd
EZ
47382011-08-22 Eli Zaretskii <eliz@gnu.org>
4739
4740 * xdisp.c (BUFFER_POS_REACHED_P): If this is a composition,
4741 consider it a hit if to_charpos is anywhere in the range of the
4742 composed buffer positions.
4743
e013fb34
CY
47442011-08-22 Chong Yidong <cyd@stupidchicken.com>
4745
4746 * image.c (gif_load): Don't assume that each subimage has the same
4747 dimensions as the base image. Handle disposal method that is
4748 "undefined" by the gif spec (Bug#9335).
4749
bd1ba3e8
CY
47502011-08-20 Chong Yidong <cyd@stupidchicken.com>
4751
4752 * eval.c (Fsignal): Handle `debug' symbol in error handler (Bug#9329).
024a2d76 4753 (Fcondition_case): Document `debug' symbol in error handler.
bd1ba3e8 4754
54a1215b
EZ
47552011-08-19 Eli Zaretskii <eliz@gnu.org>
4756
823564e5
EZ
4757 * xfaces.c (face_at_buffer_position): Avoid repeated evaluation of
4758 face ID by FACE_FROM_ID, and avoid a crash when mouse is moved
4759 from an Org mode buffer to a Speedbar frame.
4760
54a1215b
EZ
4761 * xdisp.c (RECORD_MAX_MIN_POS): If the display element comes from
4762 a composition, take its buffer position from IT->cmp_it.charpos.
4763 Fixes cursor positioning at the beginning of a line that begins
4764 with a composed character.
4765
9778ebcc
EZ
47662011-08-18 Eli Zaretskii <eliz@gnu.org>
4767
0be6ee06
EZ
4768 * bidi.c (bidi_get_type): If bidi_type_table reports zero as the
4769 character bidirectional type, use STRONG_L instead. Fixes crashes
4770 in a buffer produced by `describe-categories'.
4771
9778ebcc
EZ
4772 * dispextern.h (struct bidi_it): Move disp_pos and disp_prop_p
4773 members before the level stack, so they would be saved and
4774 restored when copying iterator state. Fixes incorrect reordering
4775 around TABs covered by display properties.
4776
156bffbe
AS
47772011-08-18 Andreas Schwab <schwab@linux-m68k.org>
4778
6b02f655 4779 * process.c (Fnetwork_interface_list): Correctly determine buffer size.
156bffbe 4780
72ad093b
CY
47812011-08-17 Chong Yidong <cyd@stupidchicken.com>
4782
4783 * eval.c (internal_condition_case, internal_condition_case_1)
8b76d6f8
SM
4784 (internal_condition_case_2, internal_condition_case_n):
4785 Remove unnecessary aborts (Bug#9081).
72ad093b 4786
35774242
EZ
47872011-08-17 Eli Zaretskii <eliz@gnu.org>
4788
4789 * lread.c (Fload) [DOS_NT]: If `openp' returns -2, but the file
4790 has no `load' handler, try opening the file locally. (Bug#9311)
4791
db76dd85
KB
47922011-08-16 Ken Brown <kbrown@cornell.edu>
4793
4794 * gmalloc.c: Expand comment.
4795
b215eee5
EZ
47962011-08-16 Eli Zaretskii <eliz@gnu.org>
4797
4798 * xdisp.c (set_cursor_from_row): Don't accept a previous candidate
4799 if it fails the cursor_row_p test. Fixes cursor positioning at ZV.
4800
a4579d33
KB
48012011-08-16 Ken Brown <kbrown@cornell.edu>
4802
4803 Fix memory allocation problems in Cygwin build (Bug#9273).
4804
4805 * unexcw.c ( __malloc_initialized): Declare external variable.
4806 (fixup_executable): Force the dumped emacs to reinitialize malloc.
4807
8b76d6f8
SM
4808 * gmalloc.c [CYGWIN] (bss_sbrk_heapbase, bss_sbrk_heapinfo):
4809 New variables.
a4579d33
KB
4810 (malloc_initialize_1) [CYGWIN]: Prepare for reinitializing the
4811 dumped emacs.
4812 (_free_internal_nolock) [CYGWIN]: Ignore requests to free storage
4813 in the static heap.
4814 [CYGWIN] (special_realloc): New function.
4815 (_realloc_internal_nolock) [CYGWIN]: Use the new function on
4816 requests to realloc storage in the static heap.
4817
3ebec551
PE
48182011-08-15 Paul Eggert <eggert@cs.ucla.edu>
4819
4820 * bidi.c (bidi_initialize): Remove unused local.
4821
9fd8be00
EZ
48222011-08-15 Eli Zaretskii <eliz@gnu.org>
4823
6b02f655
SM
4824 * bidimirror.h:
4825 * biditype.h: Remove file.
4826 * makefile.w32-in ($(BLD)/bidi.$(O)):
4827 * deps.mk (bidi.o): Remove biditype.h and bidimirror.h.
474a8465
EZ
4828
4829 * dispextern.h: Fix a typo in the comment to bidi_type_t.
4830
4831 * chartab.c: Improve commentary for the uniprop_table API.
4832
32413314
EZ
4833 * bidi.c (bidi_paragraph_init): Support zero value of
4834 bidi_ignore_explicit_marks_for_paragraph_level.
474a8465
EZ
4835 (bidi_initialize): Use uniprop_table instead of including
4836 biditype.h and bidimirror.h.
32413314 4837
9fd8be00
EZ
4838 * xdisp.c (move_it_in_display_line_to): Don't reset pixel
4839 coordinates of the iterator when restoring from ppos_it.
4840 (Bug#9296)
4841
5cf2b69b
KH
48422011-08-14 Kenichi Handa <handa@m17n.org>
4843
4844 * process.c (create_process): Call setup_process_coding_systems
72ad093b 4845 after the pid of the process is set to -1 (Bug#8162).
5cf2b69b 4846
daf17d00
EZ
48472011-08-14 Eli Zaretskii <eliz@gnu.org>
4848
4849 * xdisp.c (move_it_in_display_line_to): Don't invoke
4850 IT_RESET_X_ASCENT_DESCENT when iterator position was restored from
4851 ppos_it. Fixes vertical cursor motion when line beginning is
4852 covered by an image. (Bug#9296)
4853
08e3161a
JD
48542011-08-14 Jan Djärv <jan.h.d@swipnet.se>
4855
4856 * nsterm.h (ns_run_ascript): Declare.
4857 (NSAPP_DATA2_RUNASSCRIPT): Define.
4858
4859 * nsfns.m (as_script, as_result, as_status): New static variables.
4860 (ns_run_ascript): New function.
5e617bc2 4861 (Fns_do_applescript): Set variables as_*. Make an NSApplicationDefined
08e3161a
JD
4862 event with data2 set to NSAPP_DATA2_RUNASSCRIPT, post it and then start
4863 the event loop. Get status from as_status (Bug#7276).
4864
4865 * nsterm.m (sendEvent): If event is NSApplicationDefined and
4866 data2 is NSAPP_DATA2_RUNASSCRIPT, call ns_run_ascript and then exit
4867 the event loop (Bug#7276).
4868
a3720aa2
AS
48692011-08-14 Andreas Schwab <schwab@linux-m68k.org>
4870
4871 * gnutls.c (QCgnutls_bootprop_priority)
4872 (QCgnutls_bootprop_trustfiles, QCgnutls_bootprop_keylist)
4873 (QCgnutls_bootprop_crlfiles, QCgnutls_bootprop_callbacks)
4874 (QCgnutls_bootprop_loglevel, QCgnutls_bootprop_hostname)
4875 (QCgnutls_bootprop_min_prime_bits, QCgnutls_bootprop_verify_flags)
4876 (QCgnutls_bootprop_verify_hostname_error)
4877 (QCgnutls_bootprop_callbacks_verify): Rename from
4878 Qgnutls_bootprop_..., all uses changed.
4879
4880 * xfaces.c (QCignore_defface): Rename from Qignore_defface, all
4881 uses changed.
4882
0a0d27fb
PE
48832011-08-14 Paul Eggert <eggert@cs.ucla.edu>
4884
19d5c50c
PE
4885 * xfaces.c (Qframe_set_background_mode): Now static.
4886 * dispextern.h (Qframe_set_background_mode): Remove decl.
4887
0a0d27fb
PE
4888 * process.c (Fnetwork_interface_info): Declare local only if needed.
4889
377538cb
JD
48902011-08-13 Jan Djärv <jan.h.d@swipnet.se>
4891
4892 * process.c: Include ifaddrs.h and net/if_dl.h if available (Bug#8477).
4893 (Fnetwork_interface_list): Allocate in increments of bytes instead
4894 of sizeof (struct ifreq). Iterate over ifconf.ifc_req by counting
4895 bytes (Bug#8477). Count bytes correctly when ifr_addr is a struct
4896 sockaddr.
4897 (struct ifflag_def): notrailers is smart on OSX.
4898 (Fnetwork_interface_info): Handle case when ifr_flags is negative.
4899 Get hardware address with getifaddrs if available.
4900
08fff70c
EZ
49012011-08-12 Eli Zaretskii <eliz@gnu.org>
4902
4903 * xdisp.c (iterate_out_of_display_property): xassert that
4904 IT->position is set to within IT->object's boundaries. Break from
4905 the loop as soon as EOB is reached; avoids infloops in redisplay
8b76d6f8
SM
4906 when IT->position is set up wrongly due to some bug.
4907 Set IT->current to match the bidi iterator unconditionally.
08fff70c
EZ
4908 (push_display_prop): Allow GET_FROM_STRING as IT->method on
4909 entry. Force push_it to save on the stack the current
4910 buffer/string position, to be restored by pop_it. Fix flags in
4911 the iterator structure wrt the object coming from a display
4912 property, as `line-prefix' and `wrap-prefix' are not ``replacing''
4913 properties. (Bug#9284)
4914
7be1c708 49152011-08-09 Andreas Schwab <schwab@linux-m68k.org>
aac0c6e3 4916
7be1c708
CY
4917 * fontset.c (fontset_get_font_group): Add proper type checks.
4918 (Bug#9172)
aac0c6e3 4919
7be1c708 49202011-08-09 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
aac0c6e3 4921
7be1c708
CY
4922 * unexmacosx.c (print_load_command_name): Add cases LC_FUNCTION_STARTS
4923 and LC_VERSION_MIN_MACOSX.
4924 (copy_linkedit_data) [LC_FUNCTION_STARTS]: New function.
4925 (dump_it) [LC_FUNCTION_STARTS]: Use it.
aac0c6e3 4926
97bb72a6
EZ
49272011-08-08 Eli Zaretskii <eliz@gnu.org>
4928
4929 * xdisp.c (forward_to_next_line_start): Allow to use the
8b76d6f8
SM
4930 no-display-properties-and-no-overlays under bidi display.
4931 Set disp_pos in the bidi iterator to avoid searches for display
757664a4 4932 properties and overlays.
97bb72a6 4933
d5617611
CY
49342011-08-08 Chong Yidong <cyd@stupidchicken.com>
4935
37e11a63
CY
4936 * editfns.c (Fset_time_zone_rule): Document relationship with the
4937 setenv function.
4938
d5617611
CY
4939 * ftfont.c (ftfont_pattern_entity): Copy the extras argument to
4940 the font entity extracted from the cache (Bug#8109).
4941
58872834
CY
49422011-08-07 Chong Yidong <cyd@stupidchicken.com>
4943
4944 * composite.c (autocmp_chars): Don't reset point. That is done by
4945 restore_point_unwind (Bug#5984).
4946
75bfc667
JL
49472011-08-07 Juri Linkov <juri@jurta.org>
4948
4949 * editfns.c (Fformat_time_string): Doc fix, add tag `usage:'
4950 to show the arg `TIME' instead of `TIMEVAL'.
4951
d1410150
EZ
49522011-08-06 Eli Zaretskii <eliz@gnu.org>
4953
4954 * xdisp.c (set_cursor_from_row): Fix cursor positioning when a
4955 display property strides EOL and includes a newline, as in
4956 longlines-mode. (Bug#9254)
75b771e4
EZ
4957 (move_it_in_display_line_to): Fix vertical-motion in a buffer with
4958 word-wrap under bidirectional display. (Bug#9224)
d1410150
EZ
4959
4960 * bidi.c (bidi_unshelve_cache): Don't reset the cache if JUST_FREE
4961 is non-zero, even if the data buffer is NULL. Fixes a crash in
4962 vertical-motion with longlines-mode. (Bug#9254)
4963
35928349
EZ
49642011-08-05 Eli Zaretskii <eliz@gnu.org>
4965
ec7cc85b
EZ
4966 * bidi.c <bidi_cache_total_alloc>: Now static.
4967 (bidi_initialize): Initialize bidi_cache_total_alloc.
4968
8b76d6f8 4969 * xdisp.c (display_line): Release buffer allocated for shelved bidi
35928349
EZ
4970 cache. (Bug#9221)
4971
4972 * bidi.c (bidi_shelve_cache, bidi_unshelve_cache): Track total
4973 amount allocated this far in `bidi_cache_total_alloc'.
4974 (bidi_unshelve_cache): Accept an additional argument JUST_FREE; if
4975 non-zero, only free the data buffer without restoring the cache
4976 contents. All callers changed.
4977
4978 * dispextern.h (bidi_unshelve_cache): Update prototype.
4979
4980 * xdisp.c (SAVE_IT, pos_visible_p, move_it_in_display_line_to)
4981 (move_it_in_display_line, move_it_to)
4982 (move_it_vertically_backward, move_it_by_lines): Replace the call
4983 to xfree to an equivalent call to bidi_unshelve_cache.
4984 (move_it_in_display_line_to): Fix logic of returning
412b6358 4985 MOVE_POS_MATCH_OR_ZV in the bidi case. (Bug#9224)
35928349 4986
e2e2423b
EZ
49872011-08-05 Eli Zaretskii <eliz@gnu.org>
4988
4989 * xdisp.c (set_cursor_from_row): Prefer the candidate glyph that
4990 came from a string character with a `cursor' property. (Bug#9229)
4991
ae9e757a
JD
49922011-08-04 Jan Djärv <jan.h.d@swipnet.se>
4993
4994 * Makefile.in (LIB_PTHREAD): New variable.
4995 (LIBES): Add LIB_PTHREAD (Bug#9216).
4996
4997 * alloc.c, emacs.c, gmalloc.c, gtkutil.c, keyboard.c, syssignal.h:
4998 Rename HAVE_GTK_AND_PTHREAD to HAVE_PTHREAD (Bug#9216).
4999
213bd7f2
AS
50002011-08-04 Andreas Schwab <schwab@linux-m68k.org>
5001
6b02f655 5002 * regex.c (re_iswctype): Remove some redundant boolean conversions.
213bd7f2 5003
99aaf75f
JD
50042011-08-04 Jan Djärv <jan.h.d@swipnet.se>
5005
5006 * xterm.c (x_find_topmost_parent): New function.
5007 (x_set_frame_alpha): Find topmost parent window with
5008 x_find_topmost_parent and set the property there also (bug#9181).
5009 (handle_one_xevent): Call x_set_frame_alpha on ReparentNotify.
5010
c74e9d86
PE
50112011-08-04 Paul Eggert <eggert@cs.ucla.edu>
5012
5013 * callproc.c (Fcall_process): Avoid vfork clobbering
5014 the local vars buffer, coding_systems, current_dir.
5015
640c8776
SM
50162011-08-03 Stefan Monnier <monnier@iro.umontreal.ca>
5017
5018 * keymap.c (Fmake_composed_keymap): Move to subr.el.
5019
f26d0e4c
PE
50202011-08-03 Paul Eggert <eggert@cs.ucla.edu>
5021
8a10d76c
PE
5022 * fontset.c (dump_fontset) [FONTSET_DEBUG]: Declare EXTERNALLY_VISIBLE
5023 so that it is not optimized away.
5024
f26d0e4c
PE
5025 * xdisp.c (compute_display_string_pos): Remove unused local.
5026
55439c61
EZ
50272011-08-02 Eli Zaretskii <eliz@gnu.org>
5028
5029 Fix slow cursor motion and scrolling in large buffers with
5030 selective display, like Org Mode buffers. (Bug#9218)
5031
5032 * dispextern.h (struct bidi_it): New member disp_prop_p.
5033
5034 * xdisp.c: Remove one-slot cache of display string positions.
5035 (compute_display_string_pos): Accept an additional argument
5e617bc2 5036 DISP_PROP_P; callers changed. Scan at most 5K characters forward
55439c61
EZ
5037 for a display string or property. If found, set DISP_PROP_P
5038 non-zero.
5039
5040 * bidi.c (bidi_fetch_char): Accept an additional argument
640c8776
SM
5041 DISP_PROP_P, and pass it to compute_display_string_pos.
5042 Only handle text covered by a display string if DISP_PROP_P is returned
55439c61
EZ
5043 non-zero. All callers of bidi_fetch_char changed.
5044
fb33fa43
SM
50452011-08-02 Stefan Monnier <monnier@iro.umontreal.ca>
5046
5047 * keymap.c (Fdefine_key): Fix Lisp_Object/int mixup; apply some CSE.
5048
b099e063
DM
50492010-12-03 Don March <don@ohspite.net>
5050
5051 * keymap.c (Fdefine_key): Fix non-prefix key error message when
5052 last character M-[char] is translated to ESC [char] (bug#7541).
5053
5cc7f7af
KH
50542011-08-02 Kenichi Handa <handa@m17n.org>
5055
d0fffa3f 5056 * lisp.h (uniprop_table): Extern it.
5cc7f7af
KH
5057
5058 * chartab.c (uniprop_table): Make it non-static.
5059
525d5e6e
EZ
50602011-08-01 Eli Zaretskii <eliz@gnu.org>
5061
5062 * xdisp.c (forward_to_next_line_start): Accept additional argument
5063 BIDI_IT_PREV, and store into it the state of the bidi iterator had
5064 on the newline.
5065 (reseat_at_next_visible_line_start): Use the bidi iterator state
5066 returned by forward_to_next_line_start to restore the state of
5067 it->bidi_it after backing up to previous newline. (Bug#9212)
5068
31011111
AS
50692011-07-30 Andreas Schwab <schwab@linux-m68k.org>
5070
5071 * regex.c (re_comp): Protoize.
5072 (re_exec): Fix return type.
5073 (regexec): Fix type of `ret'. (Bug#9203)
5074
476371c4
PE
50752011-07-28 Paul Eggert <eggert@cs.ucla.edu>
5076
e5d76069
PE
5077 * image.c (check_image_size): Use 1024x1024 if unknown frame (Bug#9189).
5078 This is needed if max-image-size is a floating-point number.
5079
9a79b20c
AS
50802011-07-28 Andreas Schwab <schwab@linux-m68k.org>
5081
5082 * print.c (print_object): Print empty symbol as ##.
5083
5084 * lread.c (read1): Read ## as empty symbol.
5085
d8c2fa78
AA
50862011-07-28 Alp Aker <alp.tekin.aker@gmail.com>
5087
5088 * nsfns.m (x_set_foreground_color): Set f->foreground_pixel when
5089 setting frame foreground color (Bug#9175).
5090 (x_set_background_color): Likewise.
5091
ffe57a7a
AA
5092 * nsmenu.m (-setText): Size tooltip dimensions precisely to
5093 contents (Bug#9176).
5094 (EmacsTooltip -init): Remove bezels and add shadows to
5095 tooltip windows.
5096
bf3492a5
AA
5097 * nsterm.m (ns_dumpglyphs_stretch): Avoid overwriting left fringe
5098 or scroll bar (Bug#8470).
5099
d55e9c53
AA
5100 * nsfont.m (nsfont_open): Remove assignment to voffset and
5101 unnecessary vars hshink, expand, hd, full_height, min_height.
5102 (nsfont_draw): Use s->ybase as baseline for glyph drawing (Bug#8913).
5103
5104 * nsterm.h (nsfont_info): Remove voffset field.
5105
d8c2fa78 51062011-07-28 Alp Aker <alp.tekin.aker@gmail.com>
4843aac3
AA
5107
5108 Implement strike-through and overline on NextStep (Bug#8863).
5109
5110 * nsfont.m (nsfont_open): Use underline position provided by font,
5111 instead of hard-coded value of 2.
5112 (nsfont_draw): Call ns_draw_text_decoration instead.
5113
5114 * nsterm.h: Add declaration for ns_draw_text_decoration.
5115
5116 * nsterm.m (ns_draw_text_decoration): New function for drawing
5117 underline, overline, and strike-through.
5118 (ns_dumpglyphs_image, ns_dumpglyphs_stretch): Add call to
5119 ns_draw_text_decoration. Change treatment of cursor drawing to
8d5ed899 5120 accommodate underlining, etc.
4843aac3 5121
4cc60b9b
EZ
51222011-07-28 Eli Zaretskii <eliz@gnu.org>
5123
bc7ece87
EZ
5124 * buffer.c (init_buffer_once): Set bidi-display-reordering to t by
5125 default.
4cc60b9b 5126
476371c4
PE
51272011-07-28 Paul Eggert <eggert@cs.ucla.edu>
5128
66606eea
PE
5129 * alloc.c (memory_full) [!SYNC_INPUT]: Fix signal-related race.
5130 Without this fix, if a signal arrives just after memory fills up,
5131 'malloc' might be invoked reentrantly.
5132
476371c4
PE
5133 * image.c (x_check_image_size) [!HAVE_X_WINDOWS]: Return 1.
5134 In other words, assume that every image size is allowed, on non-X
5135 hosts. This assumption is probably wrong, but it lets Emacs compile.
5136
f3fcc40d
AS
51372011-07-28 Andreas Schwab <schwab@linux-m68k.org>
5138
5139 * regex.c (re_iswctype): Convert return values to boolean.
5140
350c992f
EZ
51412011-07-28 Eli Zaretskii <eliz@fencepost.gnu.org>
5142
5143 * xdisp.c (compute_display_string_pos): Don't use cached display
5144 string position if the buffer had its restriction changed.
5145 (Bug#9184)
5146
5266b4bb
PE
51472011-07-28 Paul Eggert <eggert@cs.ucla.edu>
5148
5149 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork clobbering.
5150
2573a837 51512011-07-28 Paul Eggert <eggert@cs.ucla.edu>
ca4aa935 5152
41f55ccd 5153 Integer signedness and overflow and related fixes. (Bug#9079)
cf950e6b 5154
39e378da
PE
5155 * bidi.c: Integer size and overflow fixes.
5156 (bidi_cache_size, bidi_cache_idx, bidi_cache_last_idx)
5157 (bidi_cache_start, bidi_cache_fetch_state, bidi_cache_search)
5158 (bidi_cache_find_level_change, bidi_cache_ensure_space)
5159 (bidi_cache_iterator_state, bidi_cache_find, bidi_cache_start_stack)
5160 (bidi_find_other_level_edge):
5161 Use ptrdiff_t instead of EMACS_INT where either will do.
5162 This works better on 32-bit hosts configured --with-wide-int.
5163 (bidi_cache_ensure_space): Check for size-calculation overflow.
5164 Use % rather than repeated addition, for better worst-case speed.
5165 Don't set bidi_cache_size until after xrealloc returns, because it
5166 might not return.
5167 (bidi_dump_cached_states): Use ptrdiff_t, not int, to avoid overflow.
f0eb61e9
PE
5168 (bidi_cache_ensure_space): Also check that the bidi cache size
5169 does not exceed that of the largest Lisp string or buffer. See Eli
5170 Zaretskii in <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9079#29>.
39e378da 5171
5e927815
PE
5172 * alloc.c (__malloc_size_t): Remove.
5173 All uses replaced by size_t. See Andreas Schwab's note
5174 <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9079#8>.
5175
ca4aa935
PE
5176 * image.c: Improve checking for integer overflow.
5177 (check_image_size): Assume that f is nonnull, since
5178 it is always nonnull in practice. This is one less thing to
5179 worry about when checking for integer overflow later.
5180 (x_check_image_size): New function, which checks for integer
5181 overflow issues inside X.
5182 (x_create_x_image_and_pixmap, xbm_read_bitmap_data): Use it.
5183 This removes the need for a memory_full check.
5184 (xbm_image_p): Rewrite to avoid integer multiplication overflow.
5185 (Create_Pixmap_From_Bitmap_Data, xbm_load): Use x_check_image_size.
5186 (xbm_read_bitmap_data): Change locals back to 'int', since
5187 their values must fit in 'int'.
5188 (xpm_load_image, png_load, tiff_load):
5189 Invoke x_create_x_image_and_pixmap earlier,
5190 to avoid much needless work if the image is too large.
5191 (tiff_load): Treat overly large images as if
5192 x_create_x_image_and_pixmap failed, not as malloc failures.
5193 (gs_load): Use x_check_image_size.
5194
5f8f9cc2
PE
5195 * gtkutil.c: Omit integer casts.
5196 (xg_get_pixbuf_from_pixmap): Remove unnecessary cast.
5197 (xg_set_toolkit_scroll_bar_thumb): Rewrite to avoid need for cast.
5198
5adf60bc
PE
5199 * image.c (png_load): Don't assume height * row_bytes fits in 'int'.
5200
c8907a93
PE
5201 * xfaces.c (Fbitmap_spec_p): Fix integer overflow bug.
5202 Without this fix, (bitmap-spec-p '(34359738368 1 "x"))
5203 would wrongly return t on a 64-bit host.
5204
e3c25c68
PE
5205 * dispnew.c (init_display): Use *_RANGE_OVERFLOW macros.
5206 The plain *_OVERFLOW macros run afoul of GCC bug 49705
5207 <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49705>
5208 and therefore cause GCC to emit a bogus diagnostic in some cases.
5209
3f791afe
PE
5210 * image.c: Integer signedness and overflow and related fixes.
5211 This is not an exhaustive set of fixes, but it's time to
5212 record what I've got.
5213 (lookup_pixel_color, check_image_size): Remove redundant decls.
5214 (check_image_size): Don't assume that arbitrary EMACS_INT values
5215 fit in 'int', or that arbitrary 'double' values fit in 'int'.
5216 (x_alloc_image_color, x_create_x_image_and_pixmap, png_load)
5217 (tiff_load, imagemagick_load_image):
5218 Check for overflow in size calculations.
5219 (x_create_x_image_and_pixmap): Remove unnecessary test for
5220 xmalloc returning NULL; that can't happen.
5221 (xbm_read_bitmap_data): Don't assume sizes fit into 'int'.
5222 (xpm_color_bucket): Use better integer hashing function.
5223 (xpm_cache_color): Don't possibly over-allocate memory.
5224 (struct png_memory_storage, tiff_memory_source, tiff_seek_in_memory)
5225 (gif_memory_source):
5226 Use ptrdiff_t, not int or size_t, to record sizes.
5227 (png_load): Don't assume values greater than 2**31 fit in 'int'.
5228 (our_stdio_fill_input_buffer): Prefer ptrdiff_t to size_t when
5229 either works, as we prefer signed integers.
5230 (tiff_read_from_memory, tiff_write_from_memory):
5231 Return tsize_t, not size_t, since that's what the TIFF API wants.
5232 (tiff_read_from_memory): Don't fail simply because the read would
5233 go past EOF; instead, return a short read.
5234 (tiff_load): Omit no-longer-needed casts.
5235 (Fimagemagick_types): Don't assume size fits into 'int'.
5236
3cc5a532
PE
5237 Improve hashing quality when configured --with-wide-int.
5238 * fns.c (hash_string): New function, taken from sxhash_string.
5239 Do not discard information about ASCII character case; this
5240 discarding is no longer needed.
5241 (sxhash-string): Use it. Change sig to match it. Caller changed.
5242 * lisp.h: Declare it.
5243 * lread.c (hash_string): Remove, since we now use fns.c's version.
5244 The fns.c version returns a wider integer if --with-wide-int is
5245 specified, so this should help the quality of the hashing a bit.
5246
b312a492
PE
5247 * emacs.c: Integer overflow minor fix.
5248 (heap_bss_diff): Now uprintmax_t, not unsigned long. All used changed.
5249 Define only if GNU_LINUX.
5250 (main, Fdump_emacs): Set and use heap_bss_diff only if GNU_LINUX.
5251
dfd153ae
PE
5252 * dispnew.c: Integer signedness and overflow fixes.
5253 Remove unnecessary forward decls, that were a maintenance hassle.
5254 (history_tick): Now uprintmax_t, so it's more likely to avoid overflow.
5255 All uses changed.
5256 (adjust_glyph_matrix, realloc_glyph_pool, adjust_frame_message_buffer)
5257 (scrolling_window): Use ptrdiff_t, not int, for byte count.
5258 (prepare_desired_row, line_draw_cost):
5259 Use int, not unsigned, where either works.
5260 (save_current_matrix, restore_current_matrix):
5261 Use ptrdiff_t, not size_t, where either works.
5262 (init_display): Check for overflow more accurately, and without
5263 relying on undefined behavior.
5264
a81d11a3
PE
5265 * editfns.c (pWIDE, pWIDElen, signed_wide, unsigned_wide):
5266 Remove, replacing with the new symbols in lisp.h. All uses changed.
5267 * fileio.c (make_temp_name):
5268 * filelock.c (lock_file_1, lock_file):
5269 * xdisp.c (message_dolog):
5270 Don't assume PRIdMAX etc. works; this isn't portable to pre-C99 hosts.
5271 Use pMd etc. instead.
5272 * lisp.h (printmax_t, uprintmax_t, pMd, pMu): New types and macros,
5273 replacing the pWIDE etc. symbols removed from editfns.c.
5274
3300e6fd
PE
5275 * keyboard.h (num_input_events): Now uintmax_t.
5276 This is (very slightly) less likely to mess up due to wraparound.
5277 All uses changed.
5278
fd05c7e9
PE
5279 * buffer.c: Integer signedness fixes.
5280 (alloc_buffer_text, enlarge_buffer_text):
5281 Use ptrdiff_t rather than size_t when either will do, as we prefer
5282 signed integers.
5283
903fe15d
PE
5284 * alloc.c: Integer signedness and overflow fixes.
5285 Do not impose an arbitrary 32-bit limit on malloc sizes when debugging.
5286 (__malloc_size_t): Default to size_t, not to int.
5287 (pure_size, pure_bytes_used_before_overflow, stack_copy_size)
5288 (Fgarbage_collect, mark_object_loop_halt, mark_object):
5289 Prefer ptrdiff_t to size_t when either would do, as we prefer
5290 signed integers.
5291 (XMALLOC_OVERRUN_CHECK_OVERHEAD): New macro.
5292 (xmalloc_overrun_check_header, xmalloc_overrun_check_trailer):
5293 Now const. Initialize with values that are in range even if char
5294 is signed.
5295 (XMALLOC_PUT_SIZE, XMALLOC_GET_SIZE): Remove, replacing with ...
5296 (xmalloc_put_size, xmalloc_get_size): New functions. All uses changed.
5297 These functions do the right thing with sizes > 2**32.
5298 (check_depth): Now ptrdiff_t, not int.
5299 (overrun_check_malloc, overrun_check_realloc, overrun_check_free):
5300 Adjust to new way of storing sizes. Check for size overflow bugs
5301 in rest of code.
5302 (STRING_BYTES_MAX): Adjust to new overheads. The old code was
5303 slightly wrong anyway, as it missed one instance of
5304 XMALLOC_OVERRUN_CHECK_OVERHEAD.
5305 (refill_memory_reserve): Omit needless cast to size_t.
5306 (mark_object_loop_halt): Mark as externally visible.
5307
ac82cc6a
PE
5308 * xselect.c: Integer signedness and overflow fixes.
5309 (Fx_register_dnd_atom, x_handle_dnd_message):
5310 Use ptrdiff_t, not size_t, since we prefer signed.
5311 (Fx_register_dnd_atom): Check for ptrdiff_t (and size_t) overflow.
5312 * xterm.h (struct x_display_info): Use ptrdiff_t, not size_t, for
5313 x_dnd_atoms_size and x_dnd_atoms_length.
5314
c2d1e36d
PE
5315 * doprnt.c: Prefer signed to unsigned when either works.
5316 * eval.c (verror):
5317 * doprnt.c (doprnt):
5318 * lisp.h (doprnt):
5319 * xdisp.c (vmessage):
5320 Use ptrdiff_t, not size_t, when using or implementing doprnt,
5321 since the sizes cannot exceed ptrdiff_t bounds anyway, and we
5322 prefer signed arithmetic to avoid comparison confusion.
5323 * doprnt.c (doprnt): Avoid a "+ 1" that can't overflow,
5324 but is a bit tricky.
5325
0e926e56
PE
5326 Assume freestanding C89 headers, string.h, stdlib.h.
5327 * data.c, doprnt.c, floatfns.c, print.c:
5328 Include float.h unconditionally.
5329 * gmalloc.c: Assume C89-at-least behavior for preprocessor,
5330 limits.h, stddef.h, string.h. Use memset instead of 'flood'.
5331 * regex.c: Likewise for stddef.h, string.h.
5332 (ISASCII): Remove; can assume it returns 1 now. All uses removed.
5333 * s/aix4-2.h (HAVE_STRING_H): Remove obsolete undef.
5334 * s/ms-w32.h (HAVE_LIMITS_H, HAVE_STRING_H, HAVE_STDLIB_H)
5335 (STDC_HEADERS): Remove obsolete defines.
5336 * sysdep.c: Include limits.h unconditionally.
5337
9cfdb3ec
PE
5338 Assume support for memcmp, memcpy, memmove, memset.
5339 * lisp.h, sysdep.c (memcmp, memcpy, memmove, memset):
5340 * regex.c (memcmp, memcpy):
5341 Remove; we assume C89 now.
5342
5343 * gmalloc.c (memcpy, memset, memmove): Remove; we assume C89 now.
5344 (__malloc_safe_bcopy): Remove; no longer needed.
5345
cf950e6b 5346 * lisp.h (struct vectorlike_header, struct Lisp_Subr): Signed sizes.
6089c567
PE
5347 Use EMACS_INT, not EMACS_UINT, for sizes. The code works equally
5348 well either way, and we prefer signed to unsigned.
5349
dbf38e02
LMI
53502011-07-27 Lars Magne Ingebrigtsen <larsi@gnus.org>
5351
5352 * gnutls.c (emacs_gnutls_read): Don't message anything if the peer
5353 closes the connection while we're reading (bug#9182).
5354
d6f0886c 53552011-07-25 Jan Djärv <jan.h.d@swipnet.se>
24e0f6b1 5356
d6f0886c
JD
5357 * nsmenu.m (ns_popup_dialog): Add an "ok" button if no buttons
5358 are specified (Bug#9168).
24e0f6b1 5359
2eb1f9e6
PE
53602011-07-25 Paul Eggert <eggert@cs.ucla.edu>
5361
5362 * bidi.c (bidi_dump_cached_states): Fix printf format mismatch.
5363 Found by GCC static checking and --with-wide-int on a 32-bit host.
5364
22381272 53652011-07-25 Eli Zaretskii <eliz@gnu.org>
7daee910
EZ
5366
5367 * xdisp.c (compute_display_string_pos): Fix logic of caching
5368 previous display string position. Initialize cached_prev_pos to
5369 -1. Fixes slow-down at the beginning of a buffer.
5370
f25e39b4
EZ
53712011-07-24 Eli Zaretskii <eliz@gnu.org>
5372
5373 * xfaces.c (check_lface_attrs) [HAVE_WINDOW_SYSTEM]: Allow `nil'
5374 for attrs[LFACE_FONTSET_INDEX].
5375
04c4b52e
PE
53762011-07-23 Paul Eggert <eggert@cs.ucla.edu>
5377
5378 * xml.c (parse_region): Remove unused local
5379 that was recently introduced.
5380
c1734fbd
EZ
53812011-07-23 Eli Zaretskii <eliz@gnu.org>
5382
be18c5a5
EZ
5383 * xfns.c (unwind_create_frame) [GLYPH_DEBUG]: Adapt to changes in
5384 2008-02-22T17:42:09Z!monnier@iro.umontreal.ca.
5385
c1734fbd
EZ
5386 * xdisp.c (move_it_in_display_line_to): Record the best matching
5387 position for TO_CHARPOS while scanning the line, and restore it on
640c8776
SM
5388 exit if none of the characters scanned was an exact match.
5389 Fixes vertical-motion and pos-visible-in-window-p under bidi redisplay
a9269c18
EZ
5390 when exact match is impossible due to invisible text, and the
5391 lines are truncated.
5392
a258d627
JD
53932011-07-23 Jan Djärv <jan.h.d@swipnet.se>
5394
5395 * nsterm.m (initFrameFromEmacs): Set NSTitledWindowMask in styleMask
5396 for OSX >= 10.7.
5397
b6d5a689
EZ
53982011-07-22 Eli Zaretskii <eliz@gnu.org>
5399
0f74f785
EZ
5400 Fix a significant slow-down of cursor motion with C-n, C-p,
5401 C-f/C-b, and C-v/M-v that couldn't keep up with keyboard
5402 auto-repeat under bidi redisplay in fontified buffers.
b6d5a689 5403 * xdisp.c (compute_stop_pos_backwards): New function.
b6d5a689
EZ
5404 (next_element_from_buffer): Call compute_stop_pos_backwards to
5405 find a suitable prev_stop when we find ourselves before
0f74f785
EZ
5406 base_level_stop.
5407 (reseat): Don't look for prev_stop, as that could mean a very long
5408 run.
5409 <cached_disp_pos, cached_disp_buffer, cached_disp_modiff>
5410 <cached_disp_overlay_modiff>: Cache for last found display string
5411 position.
551918c1 5412 (compute_display_string_pos): Return the cached position if asked
0f74f785
EZ
5413 about the same buffer in the same area of character positions, and
5414 the buffer wasn't changed since the time the display string
5415 position was cached.
551918c1 5416
b2d0c91a
EZ
54172011-07-22 Eli Zaretskii <eliz@gnu.org>
5418
5419 * xdisp.c (rows_from_pos_range): Don't ignore glyphs whose object
5420 is an integer, which is important for empty lines. (Bug#9149)
5421
043604ee
CY
54222011-07-22 Chong Yidong <cyd@stupidchicken.com>
5423
5424 * frame.c (Fmodify_frame_parameters): In tty case, update the
5425 default face if necessary (Bug#4238).
5426
da4adb04
CY
54272011-07-21 Chong Yidong <cyd@stupidchicken.com>
5428
5429 * editfns.c (Fstring_to_char): No need to explain what a character
5430 is in the docstring (Bug#6576).
5431
9abd0532
LMI
54322011-07-20 Lars Magne Ingebrigtsen <larsi@gnus.org>
5433
5434 * xml.c (parse_region): Make sure we always return a tree.
5435
36881d16
HK
54362011-07-20 HAMANO Kiyoto <khiker.mail@gmail.com>
5437
5438 * xml.c (parse_region): If a document contains only comments,
5439 return that, too.
5440
1e98674d
LMI
54412011-07-20 Lars Magne Ingebrigtsen <larsi@gnus.org>
5442
5443 * xml.c (make_dom): Return comments, too.
5444
590bd467
PE
54452011-07-19 Paul Eggert <eggert@cs.ucla.edu>
5446
5447 Port to OpenBSD.
5448 See http://lists.gnu.org/archive/html/emacs-devel/2011-07/msg00688.html
5449 and the surrounding thread.
5450 * minibuf.c (read_minibuf_noninteractive): Rewrite to use getchar
5451 rather than fgets, and retry after EINTR. Otherwise, 'emacs
5452 --batch -f byte-compile-file' fails on OpenBSD if an inactivity
5453 timer goes off.
5454 * s/openbsd.h (BROKEN_SIGIO): Define.
5455 * unexelf.c (unexec) [__OpenBSD__]:
5456 Don't update the .mdebug section of the Alpha COFF symbol table.
5457
f41628b2
LMI
54582011-07-19 Lars Magne Ingebrigtsen <larsi@gnus.org>
5459
5460 * lread.c (syms_of_lread): Clarify when `lexical-binding' is used
5461 (bug#8460).
5462
b59b67c5
PE
54632011-07-18 Paul Eggert <eggert@cs.ucla.edu>
5464
15e3a074
PE
5465 * fileio.c (Fcopy_file) [!MSDOS]: Tighten created file's mask.
5466 This fixes some race conditions on the permissions of any newly
5467 created file.
5468
41bed37d
PE
5469 * alloc.c (valid_pointer_p): Use pipe, not open.
5470 This fixes some permissions issues when debugging.
5471
b59b67c5
PE
5472 * fileio.c (Fcopy_file): Adjust mode if fchown fails. (Bug#9002)
5473 If fchown fails to set both uid and gid, try to set just gid,
5474 as that is sometimes allowed. Adjust the file's mode to eliminate
5475 setuid or setgid bits that are inappropriate if fchown fails.
5476
925a6be7
SM
54772011-07-18 Stefan Monnier <monnier@iro.umontreal.ca>
5478
5479 * xdisp.c (next_element_from_string, next_element_from_buffer): Use EQ
5480 to compare Lisp_Objects.
5481 * gnutls.c (syms_of_gnutls): Rename Vgnutls_log_level to
5482 global_gnutls_log_level, don't mistake it for a Lisp_Object.
5483 (init_gnutls_functions, emacs_gnutls_handle_error): Fix up uses.
5484
52968808
AS
54852011-07-17 Andreas Schwab <schwab@linux-m68k.org>
5486
0a6a104b
AS
5487 * lread.c (read_integer): Unread even EOF character.
5488 (read1): Likewise. Properly record start position of symbol.
5489
52968808
AS
5490 * lread.c (read1): Read `#:' as empty uninterned symbol if no
5491 symbol character follows.
5492
9e381cdd
PE
54932011-07-17 Paul Eggert <eggert@cs.ucla.edu>
5494
5495 * fileio.c (Fcopy_file): Pacify gcc re fchown. (Bug#9002)
5496 This works around a problem with the previous change to Fcopy_file.
5497 Recent glibc declares fchown with __attribute__((warn_unused_result)),
5498 and without this change, GCC might complain about discarding
5499 fchown's return value.
5500
b5641435
JB
55012011-07-16 Juanma Barranquero <lekktu@gmail.com>
5502
5503 * makefile.w32-in (GLOBAL_SOURCES): Add gnutls.c (followup to bug#9059).
5504
a8031457
PE
55052011-07-16 Paul Eggert <eggert@cs.ucla.edu>
5506
5507 * fileio.c (Fcopy_file): Don't diagnose fchown failures. (Bug#9002)
5508
dd889327
LMI
55092011-07-16 Lars Magne Ingebrigtsen <larsi@gnus.org>
5510
750c33f7
LMI
5511 * gnutls.c (syms_of_gnutls): Define `gnutls-log-level' here, since
5512 it's used from the C level.
5513
dd889327
LMI
5514 * process.c: Use the same condition for POLL_FOR_INPUT in both
5515 keyboard.c and process.c (bug#1858).
5516
87e86684
LM
55172011-07-09 Lawrence Mitchell <wence@gmx.li>
5518
5519 * gnutls.c (Qgnutls_bootprop_min_prime_bits): New variable.
5520 (Fgnutls_boot): Use it.
5521
64348f40
AS
55222011-07-15 Andreas Schwab <schwab@linux-m68k.org>
5523
5524 * doc.c (Fsubstitute_command_keys): Revert last change.
5525
1d698799
LMI
55262011-07-15 Lars Magne Ingebrigtsen <larsi@gnus.org>
5527
f863868c
LMI
5528 * doc.c (Fsubstitute_command_keys): Clarify that \= really only
5529 quotes the next character, and doesn't affect other longer
5530 sequences (bug#8935).
5531
1d698799
LMI
5532 * lread.c (syms_of_lread): Clarify that is isn't only
5533 `eval-buffer' and `eval-defun' that's affected by
5534 `lexical-binding' (bug#8460).
5535
aa4b6df6
EZ
55362011-07-15 Eli Zaretskii <eliz@gnu.org>
5537
5538 * xdisp.c (move_it_in_display_line_to): Fix vertical motion with
6b02f655 5539 bidi redisplay when a line includes both an image and is truncated.
aa4b6df6 5540
5d856da6
PE
55412011-07-14 Paul Eggert <eggert@cs.ucla.edu>
5542
ad6042bb
PE
5543 Fix minor problems found by static checking.
5544 * bidi.c (bidi_cache_size): Now EMACS_INT, not size_t.
5545 (elsz): Now a signed constant, not a size_t var. We prefer signed
5546 types to unsigned, to avoid integer comparison confusion. Without
5547 this change, GCC 4.6.1 with -Wunsafe-loop-optimizations complains
5548 "cannot optimize loop, the loop counter may overflow", a symptom
5549 of the confusion.
f00bbb22 5550 * indent.c (Fvertical_motion): Mark locals as initialized.
5d856da6
PE
5551 * xdisp.c (reseat_to_string): Fix pointer signedness issue.
5552
6468f31c
LMI
55532011-07-14 Lars Magne Ingebrigtsen <larsi@gnus.org>
5554
49080b10
LMI
5555 * search.c (Fre_search_backward): Mention `case-fold-search' in
5556 all the re_search_* functions (bug#8138).
5557
6468f31c
LMI
5558 * keyboard.c (Fopen_dribble_file): Document when the file is
5559 closed (bug#8056).
5560
c965adc5
EZ
55612011-07-14 Eli Zaretskii <eliz@gnu.org>
5562
df9733bf
EZ
5563 * bidi.c (bidi_dump_cached_states): Fix format of displaying
5564 bidi_cache_idx.
5565
0bb23927
EZ
5566 Support bidi reordering of display and overlay strings.
5567 * xdisp.c (compute_display_string_pos)
5568 (compute_display_string_end): Accept additional argument STRING.
5569 (init_iterator, reseat_1): Initialize bidi_it->string.s to NULL.
5570 (reseat_to_string): Initialize bidi_it->string.s and
5571 bidi_it->string.schars.
5572 (Fcurrent_bidi_paragraph_direction): Initialize itb.string.s to
640c8776
SM
5573 NULL (avoids a crash in bidi_paragraph_init).
5574 Initialize itb.string.lstring.
0bb23927
EZ
5575 (init_iterator): Call bidi_init_it only of a valid
5576 buffer position was specified. Initialize paragraph_embedding to
5577 L2R.
5578 (reseat_to_string): Initialize the bidi iterator.
5579 (display_string): If we need to ignore text properties of
5580 LISP_STRING, set IT->stop_charpos to IT->end_charpos. (The
5581 original value of -1 will not work with bidi.)
5582 (compute_display_string_pos): First arg is now struct
5583 `text_pos *'; all callers changed. Support display properties on
5584 Lisp strings.
5585 (compute_display_string_end): Support display properties on Lisp
5586 strings.
5587 (init_iterator, reseat_1, reseat_to_string): Initialize the
5588 string.bufpos member to 0 (zero, for compatibility with IT_CHARPOS
5589 when iterating on a string not from display properties).
640c8776
SM
5590 (compute_display_string_pos, compute_display_string_end):
5591 Fix calculation of the object to scan. Fixes an error when using
0bb23927
EZ
5592 arrow keys.
5593 (next_element_from_buffer): Don't abort when IT_CHARPOS is before
640c8776
SM
5594 base_level_stop; instead, set base_level_stop to BEGV.
5595 Fixes crashes in vertical-motion.
0bb23927
EZ
5596 (next_element_from_buffer): Improve commentary for when
5597 the iterator is before prev_stop.
5598 (init_iterator): Initialize bidi_p from the default value of
5599 bidi-display-reordering, not from buffer-local value. Use the
5600 buffer-local value only if initializing for buffer iteration.
5601 (handle_invisible_prop): Support invisible properties on strings
5602 that are being bidi-reordered.
5603 (set_iterator_to_next): Support bidi reordering of C strings and
5604 Lisp strings.
5605 (next_element_from_string): Support bidi reordering of Lisp
5606 strings.
5607 (handle_stop_backwards): Support Lisp strings as well.
640c8776
SM
5608 (display_string): Support display of R2L glyph rows.
5609 Use IT_STRING_CHARPOS when displaying from a Lisp string.
0bb23927
EZ
5610 (init_iterator): Don't initialize it->bidi_p for strings
5611 here.
5612 (reseat_to_string): Initialize it->bidi_p for strings here.
5613 (next_element_from_string, next_element_from_c_string)
5614 (next_element_from_buffer): Add xassert's for correspondence
5615 between IT's object being iterated and it->bidi_it.string
5616 structure.
5617 (face_before_or_after_it_pos): Support bidi iteration.
5618 (next_element_from_c_string): Handle the case of the first string
5619 character that is not the first one in the visual order.
5620 (get_visually_first_element): New function, refactored from common
5621 parts of next_element_from_buffer, next_element_from_string, and
5622 next_element_from_c_string.
5623 (tool_bar_lines_needed, redisplay_tool_bar)
5624 (display_menu_bar): Force left-to-right direction. Add a FIXME
5625 comment for making that be controlled by a user option.
5626 (push_it, pop_it): Save and restore the state of the
5627 bidi iterator. Save and restore the bidi_p flag.
5628 (pop_it): Iterate out of display property for string iteration as
5629 well.
5630 (iterate_out_of_display_property): Support iteration over strings.
5631 (handle_single_display_spec): Set up it->bidi_it for iteration
5632 over a display string, and call bidi_init_it.
5633 (handle_single_display_spec, next_overlay_string)
5634 (get_overlay_strings_1, push_display_prop): Set up the bidi
5635 iterator for displaying display or overlay strings.
5636 (forward_to_next_line_start): Don't use the shortcut if
5637 bidi-iterating.
5638 (back_to_previous_visible_line_start): If handle_display_prop
5639 pushed the iterator stack, restore the internal state of the bidi
5640 iterator by calling bidi_pop_it same number of times.
5641 (reseat_at_next_visible_line_start): If ON_NEWLINE_P is non-zero,
5642 and we are bidi-iterating, don't decrement the iterator position;
5643 instead, set the first_elt flag in the bidi iterator, to produce
5644 the same effect.
5645 (reseat_1): Remove redundant setting of string_from_display_prop_p.
5646 (push_display_prop): xassert that we are iterating a buffer.
5647 (push_it, pop_it): Save and restore paragraph_embedding member.
5648 (handle_single_display_spec, next_overlay_string)
5649 (get_overlay_strings_1, reseat_1, reseat_to_string)
5650 (push_display_prop): Set up the `unibyte' member of bidi_it.string
5651 correctly. Don't assume unibyte strings are not bidi-reordered.
5652 (compute_display_string_pos)
5653 (compute_display_string_end): Fix handling the case of C string.
5654 (push_it, pop_it): Save and restore from_disp_prop_p.
5655 (handle_single_display_spec, push_display_prop): Set the
5656 from_disp_prop_p flag.
5657 (get_overlay_strings_1): Reset the from_disp_prop_p flag.
5658 (pop_it): Call iterate_out_of_display_property only if we are
5659 popping after iteration over a string that came from a display
5660 property. Fix a typo in popping stretch info. Add an assertion
5661 for verifying that the iterator position is in sync with the bidi
5662 iterator.
5663 (handle_single_display_spec, get_overlay_strings_1)
5664 (push_display_prop): Fix initialization of paragraph direction for
5665 string when that of the parent object is not yet determined.
5666 (reseat_1): Call bidi_init_it to resync the bidi
5667 iterator with IT's position. (Bug#7616)
5668 (find_row_edges): If ROW->start.pos gives position
5669 smaller than min_pos, use it as ROW->minpos. (Bug#7616)
5670 (handle_stop, back_to_previous_visible_line_start, reseat_1):
5671 Reset the from_disp_prop_p flag.
5672 (SAVE_IT, RESTORE_IT): New macros.
5673 (pos_visible_p, face_before_or_after_it_pos)
5674 (back_to_previous_visible_line_start)
5675 (move_it_in_display_line_to, move_it_in_display_line)
5676 (move_it_to, move_it_vertically_backward, move_it_by_lines)
5677 (try_scrolling, redisplay_window, display_line): Use them when
5678 saving a temporary copy of the iterator and restoring it back.
5679 (back_to_previous_visible_line_start, reseat_1)
5680 (init_iterator): Empty the bidi cache "stack".
5681 (move_it_in_display_line_to): If iterator ended up at
5682 EOL, but we never saw any buffer positions smaller than
5683 to_charpos, return MOVE_POS_MATCH_OR_ZV. Fixes vertical cursor
5684 motion in bidi-reordered lines.
5685 (move_it_in_display_line_to): Record prev_method and prev_pos
5686 immediately before the call to set_iterator_to_next. Fixes cursor
5687 motion in bidi-reordered lines with stretch glyphs and strings
5688 displayed in margins. (Bug#8133) (Bug#8867)
5689 Return MOVE_POS_MATCH_OR_ZV only if iterator position is past
5690 TO_CHARPOS.
640c8776
SM
5691 (pos_visible_p): Support positions in bidi-reordered lines.
5692 Save and restore bidi cache.
0bb23927
EZ
5693
5694 * bidi.c (bidi_level_of_next_char): clen should be EMACS_NT, not int.
5695 (bidi_paragraph_info): Delete unused struct.
5696 (bidi_cache_idx, bidi_cache_last_idx): Declare EMACS_INT.
5697 (bidi_cache_start): New variable.
5698 (bidi_cache_reset): Reset bidi_cache_idx to bidi_cache_start, not
5699 to zero.
5700 (bidi_cache_fetch_state, bidi_cache_search)
5701 (bidi_cache_find_level_change, bidi_cache_iterator_state)
5702 (bidi_cache_find, bidi_peek_at_next_level)
5703 (bidi_level_of_next_char, bidi_find_other_level_edge)
5704 (bidi_move_to_visually_next): Compare cache index with
5705 bidi_cache_start rather than with zero.
5706 (bidi_fetch_char): Accept new argument STRING; all callers
5707 changed. Support iteration over a string. Support strings with
5708 display properties. Support unibyte strings. Fix the type of
5709 `len' according to what STRING_CHAR_AND_LENGTH expects.
5710 (bidi_paragraph_init, bidi_resolve_explicit_1)
5711 (bidi_resolve_explicit, bidi_resolve_weak)
640c8776
SM
5712 (bidi_level_of_next_char, bidi_move_to_visually_next):
5713 Support iteration over a string.
0bb23927
EZ
5714 (bidi_set_sor_type, bidi_resolve_explicit_1)
5715 (bidi_resolve_explicit, bidi_type_of_next_char): ignore_bn_limit
5716 can now be zero (for strings); special values 0 and -1 were
5717 changed to -1 and -2, respectively.
5718 (bidi_char_at_pos): New function.
5719 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak):
5720 Call it instead of FETCH_MULTIBYTE_CHAR.
5721 (bidi_move_to_visually_next): Abort if charpos or bytepos were not
5722 initialized to valid values.
5723 (bidi_init_it): Don't initialize charpos and bytepos with invalid
5724 values.
5725 (bidi_level_of_next_char): Allow the sentinel "position" to pass
5726 the test for valid cached positions. Fix the logic for looking up
5727 the sentinel state in the cache. GCPRO the Lisp string we are
5728 iterating.
5729 (bidi_push_it, bidi_pop_it): New functions.
5730 (bidi_initialize): Initialize the bidi cache start stack pointer.
5731 (bidi_cache_ensure_space): New function, refactored from part of
5732 bidi_cache_iterator_state. Don't assume the required size is just
5733 one BIDI_CACHE_CHUNK away.
5734 (bidi_cache_start_stack, bidi_push_it): Use IT_STACK_SIZE.
5735 (bidi_count_bytes, bidi_char_at_pos): New functions.
5736 (bidi_cache_search): Don't assume bidi_cache_last_idx is
5737 always valid if bidi_cache_idx is valid.
5738 (bidi_cache_find_level_change): xassert that bidi_cache_last_idx
5739 is valid if it's going to be used.
5740 (bidi_shelve_cache, bidi_unshelve_cache): New functions.
5741 (bidi_cache_fetch_state, bidi_cache_search)
c965adc5
EZ
5742 (bidi_cache_find_level_change, bidi_cache_ensure_space)
5743 (bidi_cache_iterator_state, bidi_cache_find)
640c8776
SM
5744 (bidi_find_other_level_edge, bidi_cache_start_stack):
5745 All variables related to cache indices are now EMACS_INT.
c965adc5 5746
0bb23927
EZ
5747 * dispextern.h (struct bidi_string_data): New structure.
5748 (struct bidi_it): New member `string'. Make flag members be 1-bit
5749 fields, and put them last in the struct.
640c8776
SM
5750 (compute_display_string_pos, compute_display_string_end):
5751 Update prototypes.
0bb23927
EZ
5752 (bidi_push_it, bidi_pop_it): Add prototypes.
5753 (struct iterator_stack_entry): New members bidi_p,
5754 paragraph_embedding, and from_disp_prop_p.
5755 (struct it): Member bidi_p is now a bit field 1 bit wide.
640c8776
SM
5756 (bidi_shelve_cache, bidi_unshelve_cache):
5757 Declare prototypes.
0bb23927
EZ
5758
5759 * .gdbinit (xvectype, xvector, xcompiled, xchartable, xboolvector)
5760 (xpr, xfont, xbacktrace): Use "header.size" when accessing vectors
5761 and vector-like objects.
5762
5763 * dispnew.c (buffer_posn_from_coords): Save and restore the bidi
5764 cache around display iteration.
5765
5766 * window.c (Fwindow_end, window_scroll_pixel_based)
5767 (displayed_window_lines, Frecenter): Save and restore the bidi
5768 cache around display iteration.
5769
3bbd2265
LMI
57702011-07-14 Lars Magne Ingebrigtsen <larsi@gnus.org>
5771
5772 * editfns.c (Fdelete_region): Clarify the use of the named
5773 parameters (bug#6788).
5774
adc47434
MR
57752011-07-14 Martin Rudalics <rudalics@gmx.at>
5776
5777 * indent.c (Fvertical_motion): Set and restore w->pointm when
5778 saving and restoring the window's buffer (Bug#9006).
5779
837c31f8
LMI
57802011-07-13 Lars Magne Ingebrigtsen <larsi@gnus.org>
5781
5782 * editfns.c (Fstring_to_char): Clarify just what is returned
5783 (bug#6576). Text by Eli Zaretskii.
5784
ac389d0c
JB
57852011-07-13 Juanma Barranquero <lekktu@gmail.com>
5786
5787 * gnutls.c (init_gnutls_functions): Honor gnutls_log_level (bug#9059).
5788
0be0ce47
EZ
57892011-07-13 Eli Zaretskii <eliz@gnu.org>
5790
5791 * buffer.c (mmap_find): Fix a typo.
5792
cd18e7e3
JB
57932011-07-13 Johan Bockgård <bojohan@gnu.org>
5794
5795 Fix execution of x selection hooks.
5796 * xselect.c (Qx_lost_selection_functions)
5797 (Qx_sent_selection_functions): New vars.
5798 (syms_of_xselect): DEFSYM them.
5799 (x_handle_selection_request): Pass Qx_sent_selection_functions
5800 rather than Vx_sent_selection_functions to Frun_hook_with_args.
5801 (x_handle_selection_clear,x_clear_frame_selections):
5802 Pass Qx_lost_selection_functions rather than
5803 Vx_lost_selection_functions to Frun_hook_with_args.
5804
47ea7f44
PE
58052011-07-13 Paul Eggert <eggert@cs.ucla.edu>
5806
ac389d0c 5807 * buffer.c (Fget_buffer_create): Initialize inhibit_shrinking.
2941c447
PE
5808 The old code sometimes used this field without initializing it.
5809
47ea7f44
PE
5810 * alloc.c (gc_sweep): Don't read past end of array.
5811 In theory, the old code could also have corrupted Emacs internals,
5812 though it'd be very unlikely.
5813
bc985c87
AS
58142011-07-12 Andreas Schwab <schwab@linux-m68k.org>
5815
5816 * character.c (Fcharacterp): Don't advertise optional ignored
ac389d0c 5817 argument. (Bug#4026)
bc985c87 5818
0cf34688
LMI
58192011-07-12 Lars Magne Ingebrigtsen <larsi@gnus.org>
5820
b3dadd76
LMI
5821 * keymap.c (syms_of_keymap): Clarify that "modifier" is "modifier
5822 key" (bug#4257).
5823
0cf34688
LMI
5824 * window.c (Fset_window_start): Doc fix (bug#4199).
5825 (Fset_window_hscroll): Ditto.
5826
270768cd
PE
58272011-07-12 Paul Eggert <eggert@cs.ucla.edu>
5828
077e3dda 5829 Fix minor new problems caught by GCC 4.6.1.
270768cd 5830 * term.c (init_tty): Remove unused local.
490011a6 5831 * xsettings.c (store_monospaced_changed): Define this function only
077e3dda 5832 if (defined HAVE_GSETTINGS || defined HAVE_GCONF), as it's
490011a6 5833 not used otherwise.
270768cd 5834
b1f58454
CY
58352011-07-12 Chong Yidong <cyd@stupidchicken.com>
5836
5837 * xdisp.c (Vresize_mini_windows): Minor doc fix (Bug#3300).
5838
22b9578d
LMI
58392011-07-11 Lars Magne Ingebrigtsen <larsi@gnus.org>
5840
6e70ab07
LMI
5841 * xdisp.c (syms_of_xdisp): Make it explicit that the mini-windows
5842 are the mini-buffer and the echo area (bug#3320).
5843
22b9578d
LMI
5844 * term.c (init_tty): Remove support for supdup, c10 and perq
5845 terminals, which are no longer supported (bug#1482).
5846
8974cc9f
JB
58472011-07-10 Johan Bockgård <bojohan@gnu.org>
5848
5849 * xdisp.c (Ftool_bar_lines_needed): Fix WINDOWP check.
5850
a560d974
JD
58512011-07-10 Jan Djärv <jan.h.d@swipnet.se>
5852
5853 * xmenu.c (menu_highlight_callback): Only pass frame to show_help_event
5854 for non-popups (Bug#3642).
5855
1dae0f0a
AS
58562011-07-10 Andreas Schwab <schwab@linux-m68k.org>
5857
268c2c36 5858 * alloc.c (reset_malloc_hooks): Protoize.
1dae0f0a 5859 * buffer.c (mmap_init, mmap_find, mmap_free_1, mmap_enlarge)
268c2c36
AS
5860 (mmap_set_vars, mmap_alloc, mmap_free, mmap_realloc): Likewise.
5861 * cm.c (losecursor): Likewise.
1dae0f0a
AS
5862 * data.c (fmod): Likewise.
5863 * dispnew.c (swap_glyphs_in_rows): Likewise.
5864 * emacs.c (memory_warning_signal): Likewise.
5865 * floatfns.c (float_error): Likewise.
5866 * font.c (check_gstring, check_otf_features, otf_tag_symbol)
5867 (otf_open, font_otf_capability, generate_otf_features)
5868 (font_otf_DeviceTable, font_otf_ValueRecord, font_otf_Anchor):
5869 Likewise.
5870 * image.c (pbm_read_file): Likewise.
5871 * indent.c (string_display_width): Likewise.
5872 * intervals.c (check_for_interval, search_for_interval)
5873 (inc_interval_count, count_intervals, root_interval)
5874 (adjust_intervals_for_insertion, make_new_interval): Likewise.
5875 * lread.c (defalias): Likewise.
268c2c36 5876 * ralloc.c (r_alloc_check): Likewise.
1dae0f0a
AS
5877 * regex.c (set_image_of_range_1, set_image_of_range)
5878 (regex_grow_registers): Likewise.
5879 * sysdep.c (strerror): Likewise.
5880 * termcap.c (valid_filename_p, tprint, main): Likewise.
5881 * tparam.c (main): Likewise.
5882 * unexhp9k800.c (run_time_remap, save_data_space)
5883 (update_file_ptrs, read_header, write_header, calculate_checksum)
5884 (copy_file, copy_rest, display_header): Likewise.
5885 * widget.c (mark_shell_size_user_specified, create_frame_gcs):
5886 Likewise.
5887 * xdisp.c (check_it): Likewise.
5888 * xfaces.c (register_color, unregister_color, unregister_colors):
5889 Likewise.
5890 * xfns.c (print_fontset_result): Likewise.
5891 * xrdb.c (member, fatal, main): Likewise.
5892
99033785
PE
58932011-07-10 Paul Eggert <eggert@cs.ucla.edu>
5894
5895 Fix minor problems found by static checking (Bug#9031).
5896 * chartab.c (char_table_set_range, map_sub_char_table):
5897 Remove unused locals.
5898 (uniprop_table): Now static.
5899 * composite.c (_work_char): Remove unused static var.
5900
9cb2ac56
JB
59012011-07-09 Juanma Barranquero <lekktu@gmail.com>
5902
5903 * chartab.c (uniprop_table_uncompress): Remove unused local variable.
5904
f25661f0
JD
59052011-07-09 Jan Djärv <jan.h.d@swipnet.se>
5906
5907 * gtkutil.c (qttip_cb): Remove code without function.
5908
8278c4fe
EZ
59092011-07-09 Eli Zaretskii <eliz@gnu.org>
5910
5911 * w32.c (pthread_sigmask): New stub.
5912
1692ae2d 59132011-07-08 Paul Eggert <eggert@cs.ucla.edu>
123403e4 5914
8a6ebd58 5915 Use pthread_sigmask, not sigprocmask (Bug#9010).
123403e4
PE
5916 sigprocmask is portable only for single-threaded applications, and
5917 Emacs can be multi-threaded when it uses GTK.
1301ac26
PE
5918 * Makefile.in (LIB_PTHREAD_SIGMASK): New macro.
5919 (LIBES): Use it.
5920 * callproc.c (Fcall_process):
5921 * process.c (create_process):
5922 * sysdep.c (sys_sigblock, sys_sigunblock, sys_sigsetmask):
5923 Use pthread_sigmask, not sigprocmask.
123403e4 5924
1b854618
JD
59252011-07-08 Jan Djärv <jan.h.d@swipnet.se>
5926
5927 * gtkutil.c (qttip_cb): Set line wrap to FALSE for tooltip widget.
5928 (xg_prepare_tooltip): Revert text in x->ttip_lbl, margins was
5929 wrong (Bug#8591).
5930
3fe4b549
JD
59312011-07-08 Jan Djärv <jan.h.d@swipnet.se>
5932
0ce7e563
JD
5933 * gtkutil.c (xg_prepare_tooltip): Fix indentation and comment.
5934 Put text in x->ttip_lbl instead of gtk_tooltip_set_text (Bug#8591).
5935 (xg_hide_tooltip): Fix comment.
5936
3fe4b549
JD
5937 * nsterm.m (initFrameFromEmacs): Don't use ns_return_types
5938 in registerServicesMenuSendTypes.
5939 (validRequestorForSendType): Don't check ns_return_types.
5940
5941 * nsfns.m (Fx_open_connection): Put NSStringPboardType into
5942 ns_return_type.
5943
5df75e47
JR
59442011-07-08 Jason Rumney <jasonr@gnu.org>
5945
22610910
JR
5946 * w32term.c (x_make_frame_visible): Use SH_SHOWNORMAL rather than
5947 SH_SHOW for hidden windows (Bug#5482).
5948
5df75e47
JR
5949 * w32fns.c (w32_wnd_proc) [WM_TIMER, WM_SET_CURSOR]: Avoid using
5950 frame struct members of non-existent frames (Bug#6284).
5951
699c10bd
JD
59522011-07-08 Jan Djärv <jan.h.d@swipnet.se>
5953
4393663b
JD
5954 * nsterm.m (keyDown): Call to wantsToDelayTextChangeNotifications and
5955 variable firstTime not needed on OSX >= 10.6.
5956 (setPosition): setFloatValue:knobProportion: is deprecated on OSX
5957 >= 10.5. Use setKnobProportion, setDoubleValue.
5958
5959 * nsterm.h (MAC_OS_X_VERSION_10_3, MAC_OS_X_VERSION_10_4)
5960 (MAC_OS_X_VERSION_10_5): Define if not defined.
5961 (EmacsView, EmacsTooltip): Implements NSWindowDelegate on OSX >= 10.6.
5962 (EmacsMenu): Implements NSMenuDelegate on OSX >= 10.6.
5963 (EmacsToolbar): Implements NSToolbarDelegate on OSX >= 10.6.
5964
5965 * nsselect.m (ns_string_from_pasteboard): Don't use deprecated methods
5966 cString and lossyCString on OSX >= 10.4
5967
58179cce 5968 * nsmenu.m (fillWithWidgetValue): Don't use deprecated method
4393663b
JD
5969 sizeToFit on OSX >= 10.2.
5970
5971 * nsimage.m (allocInitFromFile): Don't use deprecated method
5972 bestRepresentationForDevice on OSX >= 10.6.
5973
5974 * nsfns.m (check_ns_display_info): Cast to long and use %ld in error
5975 to avoid warning.
5976
5977 * emacs.c: Declare unexec_init_emacs_zone.
5978
a63e0781
JD
5979 * nsgui.h: Fix compiler warning about gnulib redefining verify.
5980
699c10bd
JD
5981 * nsselect.m (ns_get_local_selection): Change to extern (Bug#8842).
5982
5983 * nsmenu.m (ns_update_menubar): Remove useless setDelegate call
5984 on svcsMenu (Bug#8842).
5985
5986 * nsfns.m (Fx_open_connection): Remove NSStringPboardType from
5987 ns_return_types.
5988 (Fns_list_services): Just return Qnil on 10.6, code not working there.
5989
5990 * nsterm.m (QUTF8_STRING): Declare.
5991 (initFrameFromEmacs): Call registerServicesMenuSendTypes.
5992 (validRequestorForSendType): Return type is (id).
5993 Change indexOfObjectIdenticalTo to indexOfObject.
5994 Check if we have local selection before returning self (Bug#8842).
5995 (writeSelectionToPasteboard): Put local selection into paste board
5996 if we have a local selection (Bug#8842).
5997 (syms_of_nsterm): DEFSYM QUTF8_STRING.
5998
5999 * nsterm.h (MAC_OS_X_VERSION_10_6): Define here instead of nsterm.m.
6000 (ns_get_local_selection): Declare.
6001
54e10184
LMI
60022011-07-07 Lars Magne Ingebrigtsen <larsi@gnus.org>
6003
9888ff71
LMI
6004 * keymap.c (describe_map_tree): Don't insert a double newline at
6005 the end of the buffer (bug#1169) and return whether we inserted
6006 something.
6007
54e10184
LMI
6008 * callint.c (Fcall_interactively): Change "reading args" to
6009 "providing args" to try to clarify what it does (bug#1010).
6010
15fa4783
KH
60112011-07-07 Kenichi Handa <handa@m17n.org>
6012
6013 * composite.c (composition_compute_stop_pos): Ignore a static
6014 composition starting before CHARPOS (Bug#8915).
6015
6016 * xdisp.c (handle_composition_prop): Likewise.
6017
a8815b00
EZ
60182011-07-07 Eli Zaretskii <eliz@gnu.org>
6019
6020 * term.c (produce_glyphs) <xassert>: Allow IT_GLYPHLESS in it->what.
6021 (Bug#9015)
6022
ef7b981d 60232011-07-07 Kenichi Handa <handa@m17n.org>
c805dec0
KH
6024
6025 * character.h (unicode_category_t): New enum type.
6026
6027 * chartab.c (uniprop_decoder_t, uniprop_encoder_t): New types.
6028 (Qchar_code_property_table): New variable.
6029 (UNIPROP_TABLE_P, UNIPROP_GET_DECODER)
6030 (UNIPROP_COMPRESSED_FORM_P): New macros.
6031 (char_table_ascii): Uncompress the compressed values.
6032 (sub_char_table_ref): New arg is_uniprop. Callers changed.
6033 Uncompress the compressed values.
ac389d0c 6034 (sub_char_table_ref_and_range): Likewise.
c805dec0
KH
6035 (char_table_ref_and_range): Uncompress the compressed values.
6036 (sub_char_table_set): New arg is_uniprop. Callers changed.
6037 Uncompress the compressed values.
6038 (sub_char_table_set_range): Args changed. Callers changed.
6039 (char_table_set_range): Adjuted for the above change.
6040 (map_sub_char_table): Delete args default_val and parent. Add arg
6041 top. Give decoded values to a Lisp function.
640c8776 6042 (map_char_table): Adjust for the above change. Give decoded
c805dec0
KH
6043 values to a Lisp function. Gcpro more variables.
6044 (uniprop_table_uncompress)
6045 (uniprop_decode_value_run_length): New functions.
6046 (uniprop_decoder, uniprop_decoder_count): New variables.
6047 (uniprop_get_decoder, uniprop_encode_value_character)
6048 (uniprop_encode_value_run_length, uniprop_encode_value_numeric):
6049 New functions.
6050 (uniprop_encoder, uniprop_encoder_count): New variables.
6051 (uniprop_get_encoder, uniprop_table)
6052 (Funicode_property_table_internal, Fget_unicode_property_internal)
6053 (Fput_unicode_property_internal): New functions.
6054 (syms_of_chartab): DEFSYM Qchar_code_property_table, defsubr
6055 Sunicode_property_table_internal, Sget_unicode_property_internal,
5e617bc2 6056 and Sput_unicode_property_internal. Defvar_lisp
c805dec0
KH
6057 char-code-property-alist.
6058
640c8776 6059 * composite.c (CHAR_COMPOSABLE_P): Adjust for the change of
c805dec0
KH
6060 Vunicode_category_table.
6061
640c8776 6062 * font.c (font_range): Adjust for the change of
c805dec0
KH
6063 Vunicode_category_table.
6064
76b397fb
DN
60652011-07-07 Dan Nicolaescu <dann@ics.uci.edu>
6066
6067 * m/iris4d.h: Remove file, move contents ...
6068 * s/irix6-5.h: ... here.
6069
22b4128e
PE
60702011-07-06 Paul Eggert <eggert@cs.ucla.edu>
6071
6072 Remove unportable assumption about struct layout (Bug#8884).
8a5c77bb
PE
6073 * alloc.c (mark_buffer):
6074 * buffer.c (reset_buffer_local_variables, Fbuffer_local_variables)
6075 (clone_per_buffer_values): Don't assume that
22b4128e
PE
6076 sizeof (struct buffer) is a multiple of sizeof (Lisp_Object).
6077 This isn't true in general, and it's particularly not true
6078 if Emacs is configured with --with-wide-int.
6079 * buffer.h (FIRST_FIELD_PER_BUFFER, LAST_FIELD_PER_BUFFER):
6080 New macros, used in the buffer.c change.
6081
869795d6
JD
60822011-07-05 Jan Djärv <jan.h.d@swipnet.se>
6083
6084 * xsettings.c: Use both GConf and GSettings if both are available.
6085 (store_config_changed_event): Add comment.
6086 (dpyinfo_valid, store_font_name_changed, map_tool_bar_style)
6087 (store_tool_bar_style_changed): New functions.
5e617bc2 6088 (store_monospaced_changed): Add comment. Call dpyinfo_valid.
869795d6
JD
6089 (struct xsettings): Move font inside HAVE_XFT.
6090 (GSETTINGS_TOOL_BAR_STYLE, GSETTINGS_FONT_NAME): New defines.
640c8776 6091 (GSETTINGS_MONO_FONT): Rename from SYSTEM_MONO_FONT.
869795d6 6092 Move inside HAVE_XFT.
640c8776 6093 (something_changed_gsettingsCB): Rename from something_changedCB.
869795d6
JD
6094 Check for changes in GSETTINGS_TOOL_BAR_STYLE and GSETTINGS_FONT_NAME
6095 also.
6096 (GCONF_TOOL_BAR_STYLE, GCONF_FONT_NAME): New defines.
5e617bc2 6097 (GCONF_MONO_FONT): Rename from SYSTEM_MONO_FONT. Move inside HAVE_XFT.
640c8776 6098 (something_changed_gconfCB): Rename from something_changedCB.
869795d6
JD
6099 Check for changes in GCONF_TOOL_BAR_STYLE and GCONF_FONT_NAME also.
6100 (parse_settings): Move check for font inside HAVE_XFT.
6101 (read_settings, apply_xft_settings): Add comment.
6102 (read_and_apply_settings): Add comment. Call map_tool_bar_style and
6103 store_tool_bar_style_changed. Move check for font inside HAVE_XFT and
6104 call store_font_name_changed.
6105 (xft_settings_event): Add comment.
6106 (init_gsettings): Add comment. Get values for GSETTINGS_TOOL_BAR_STYLE
6107 and GSETTINGS_FONT_NAME. Move check for fonts within HAVE_XFT.
6108 (init_gconf): Add comment. Get values for GCONF_TOOL_BAR_STYLE
6109 and GCONF_FONT_NAME. Move check for fonts within HAVE_XFT.
6110 (xsettings_initialize): Call init_gsettings last.
640c8776
SM
6111 (xsettings_get_system_font, xsettings_get_system_normal_font):
6112 Add comment.
869795d6 6113
d8ed26bd
PE
61142011-07-05 Paul Eggert <eggert@cs.ucla.edu>
6115
6116 Random fixes. E.g., (random) never returned negative values.
6117 * fns.c (Frandom): Use GET_EMACS_TIME for random seed, and add the
6118 subseconds part to the entropy, as that's a bit more random.
6119 Prefer signed to unsigned, since the signedness doesn't matter and
6120 in general we prefer signed. When given a limit, use a
6121 denominator equal to INTMASK + 1, not to VALMASK + 1, because the
6122 latter isn't right if USE_2_TAGS_FOR_INTS.
6123 * sysdep.c (get_random): Return a value in the range 0..INTMASK,
6124 not 0..VALMASK. Don't discard "excess" bits that random () returns.
6125
cabf1cac
SM
61262011-07-04 Stefan Monnier <monnier@iro.umontreal.ca>
6127
6128 * textprop.c (text_property_stickiness):
6129 Obey Vtext_property_default_nonsticky.
6130 (syms_of_textprop): Add `display' to Vtext_property_default_nonsticky.
6131 * w32fns.c (syms_of_w32fns):
6132 * xfns.c (syms_of_xfns): Don't Add `display' since it's there by default.
6133
6e9b2be9
PE
61342011-07-04 Paul Eggert <eggert@cs.ucla.edu>
6135
6136 * fileio.c (barf_or_query_if_file_exists): Use S_ISDIR.
6137 This is more efficient than Ffile_directory_p and avoids a minor race.
6138
90186c68
LMI
61392011-07-04 Lars Magne Ingebrigtsen <larsi@gnus.org>
6140
7c301272
LMI
6141 * buffer.c (Foverlay_put): Say what the return value is
6142 (bug#7835).
6143
c4f2d8d4
LMI
6144 * fileio.c (barf_or_query_if_file_exists): Check first if the file
6145 is a directory before asking whether to use the file name
6146 (bug#7564).
ad637907
LMI
6147 (barf_or_query_if_file_exists): Make the "File is a directory"
6148 error be more correct.
c4f2d8d4 6149
90186c68
LMI
6150 * fns.c (Frequire): Remove the mention of the .gz files, since
6151 that's installation-specific, but keep the mention of
6152 `get-load-suffixes'.
6153
da64016e
PE
61542011-07-04 Paul Eggert <eggert@cs.ucla.edu>
6155
6156 * editfns.c (Fformat_time_string): Don't assume strlen fits in int.
6157 Report string overflow if the output is too long.
6158
7d47b580
JB
61592011-07-04 Juanma Barranquero <lekktu@gmail.com>
6160
a555cb87
JB
6161 * gnutls.c (Fgnutls_boot): Don't mention :verify-error.
6162 (syms_of_gnutls): Remove duplicate DEFSYM for
6163 Qgnutls_bootprop_verify_hostname_error, an error for
6164 Qgnutls_bootprop_verify_error (which is no longer used).
6165
7d47b580
JB
6166 * eval.c (find_handler_clause): Remove parameters `sig' and `data',
6167 unused since 2011-01-26T20:02:07Z!monnier@iro.umontreal.ca. All callers changed.
6168 Also (re)move comments that are misplaced or no longer relevant.
6169
1e49bfab
LMI
61702011-07-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
6171
6172 * callint.c (Finteractive): Clarify the meaning of "@" (bug#8813).
6173
1485f4c0
CY
61742011-07-03 Chong Yidong <cyd@stupidchicken.com>
6175
6176 * xfaces.c (Finternal_merge_in_global_face): Modify the foreground
6177 and background color parameters if they have been changed.
6178
a9ab721e
LMI
61792011-07-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
6180
6181 * editfns.c (Fformat): Clarify the - and 0 flags (bug#6659).
6182
cf7cff57
PE
61832011-07-03 Paul Eggert <eggert@cs.ucla.edu>
6184
2e13213d
PE
6185 * xsettings.c (SYSTEM_FONT): Define only when used.
6186 No need to define when HAVE_GSETTINGS || !HAVE_XFT.
6187
cf7cff57
PE
6188 * keymap.c (access_keymap_1): Now static.
6189
7a8e04f7
CY
61902011-07-02 Chong Yidong <cyd@stupidchicken.com>
6191
6192 * keyboard.c (command_loop_1): If a down-mouse event is unbound,
6193 leave any prefix arg for the up event (Bug#1586).
6194
61352f62
LMI
61952011-07-02 Lars Magne Ingebrigtsen <larsi@gnus.org>
6196
69bb1ef7
LMI
6197 * lread.c (syms_of_lread): Mention single symbols defined by
6198 `defvar' or `defconst' (bug#7154).
6199
61352f62 6200 * fns.c (Frequire): Mention .el.gz files (bug#7314).
7b3747f9 6201 (Frequire): Mention get-load-suffixes.
61352f62 6202
28545e04
MR
62032011-07-02 Martin Rudalics <rudalics@gmx.at>
6204
6205 * window.h (window): Remove clone_number slot.
6206 * window.c (Fwindow_clone_number, Fset_window_clone_number):
6207 Remove.
6208 (make_parent_window, make_window, saved_window)
6209 (Fset_window_configuration, save_window_save): Don't deal with
6210 clone numbers.
6211 * buffer.c (Qclone_number): Remove declaration.
6212 (sort_overlays, overlay_strings): Don't deal with clone numbers.
6213
3349e122
SM
62142011-07-02 Stefan Monnier <monnier@iro.umontreal.ca>
6215
6216 Add multiple inheritance to keymaps.
6217 * keymap.c (Fmake_composed_keymap): New function.
6218 (Fset_keymap_parent): Simplify.
6219 (fix_submap_inheritance): Remove.
6220 (access_keymap_1): New function extracted from access_keymap to handle
6221 embedded parents and handle lists of maps.
6222 (access_keymap): Use it.
6223 (Fkeymap_prompt, map_keymap_internal, map_keymap, store_in_keymap)
6224 (Fcopy_keymap): Handle embedded parents.
6225 (Fcommand_remapping, define_as_prefix): Simplify.
6226 (Fkey_binding): Simplify.
6227 (syms_of_keymap): Move minibuffer-local-completion-map,
6228 minibuffer-local-filename-completion-map,
6229 minibuffer-local-must-match-map, and
6230 minibuffer-local-filename-must-match-map to Elisp.
6231 (syms_of_keymap): Defsubr make-composed-keymap.
6232 * keyboard.c (menu_bar_items): Use map_keymap_canonical.
6233 (parse_menu_item): Trivial simplification.
6234
3279eb87
GM
62352011-07-01 Glenn Morris <rgm@gnu.org>
6236
6237 * Makefile.in (SETTINGS_LIBS): Fix typo.
6238
4550efdf
KI
62392011-07-01 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny patch)
6240
6241 * coding.c (Fencode_coding_string): Record the last coding system
6242 used, as the function doc string says (bug#8738).
6243
0949d2b6
JD
62442011-07-01 Jan Djärv <jan.h.d@swipnet.se>
6245
6246 * xsettings.c (store_monospaced_changed): Take new font as arg and
6247 check for change against current_mono_font.
6248 (EMACS_TYPE_SETTINGS): Remove this and related defines.
6249 (emacs_settings_constructor, emacs_settings_get_property)
6250 (emacs_settings_set_property, emacs_settings_class_init)
6251 (emacs_settings_init, gsettings_obj): Remove.
6252 (something_changedCB): New function for HAVE_GSETTINGS.
6253 (something_changedCB): HAVE_GCONF: Call store_monospaced_changed
6254 with value as argument.
6255 (init_gsettings): Check that GSETTINGS_SCHEMA exists before calling
6256 g_settings_new (Bug#8967). Do not create gsettings_obj.
9173deec 6257 Remove calls to g_settings_bind. Connect something_changedCB to
0949d2b6
JD
6258 "changed".
6259
6260 * xgselect.c: Add defined (HAVE_GSETTINGS).
6261 (xgselect_initialize): Ditto.
6262
6263 * process.c: Add defined (HAVE_GSETTINGS) for xgselect.h
6264 (wait_reading_process_output): Add defined (HAVE_GSETTINGS) for
6265 xg_select.
6266
bbc6b304
PE
62672011-07-01 Paul Eggert <eggert@cs.ucla.edu>
6268
6269 * eval.c (struct backtrace): Simplify and port the data structure.
6270 Do not assume that "int nargs : BITS_PER_INT - 2;" produces a
6271 signed bit field, as this assumption is not portable and it makes
6272 Emacs crash when compiled with Sun C 5.8 on sparc. Do not use
6273 "char debug_on_exit : 1" as this is not portable either; instead,
6274 use the portable "unsigned int debug_on_exit : 1". Remove unused
6275 member evalargs. Remove obsolete comments about cc bombing out.
6276
9851bfc5
JD
62772011-06-30 Jan Djärv <jan.h.d@swipnet.se>
6278
51bb811f 6279 * xsettings.c: Include glib-object.h, gio/gio.h if HAVE_GSETTINGS.
9851bfc5
JD
6280 Let HAVE_GSETTINGS override HAVE_GCONF.
6281 (store_monospaced_changed): New function.
6282 (EMACS_SETTINGS): A new type derived from GObject to handle
6283 GSettings notifications.
6284 (emacs_settings_constructor, emacs_settings_get_property)
6285 (emacs_settings_set_property, emacs_settings_class_init):
6286 New functions.
6287 (gsettings_client, gsettings_obj): New variables.
6288 (GSETTINGS_SCHEMA): New define.
6289 (something_changedCB): Call store_monospaced_changed.
6290 (init_gsettings): New function.
6291 (xsettings_initialize): Call init_gsettings.
6292 (syms_of_xsettings): Initialize gsettings_client, gsettings_obj
6293 to NULL.
6294
640c8776 6295 * Makefile.in (SETTINGS_CFLAGS, SETTINGS_LIBS): Rename from
9851bfc5
JD
6296 GCONF_CFLAGS/LIBS.
6297
5386012d
MR
62982011-06-29 Martin Rudalics <rudalics@gmx.at>
6299
6300 * window.c (resize_root_window, grow_mini_window)
6301 (shrink_mini_window): Rename Qresize_root_window to
6302 Qwindow_resize_root_window and Qresize_root_window_vertically to
6303 Qwindow_resize_root_window_vertically.
6304
f13e0b08
PE
63052011-06-28 Paul Eggert <eggert@cs.ucla.edu>
6306
6307 * gnutls.c (Qgnutls_bootprop_verify_error): Remove unused var.
6308
94515237
JB
63092011-06-27 Juanma Barranquero <lekktu@gmail.com>
6310
6311 * makefile.w32-in: Redesign dependencies so they reflect more
6312 clearly which files are directly included by each source file,
6313 and not through other includes.
6314
e43b6e43
MR
63152011-06-27 Martin Rudalics <rudalics@gmx.at>
6316
6317 * buffer.c (Qclone_number): Declare static and DEFSYM it.
6318 (sort_overlays, overlay_strings): When an overlay's clone number
6319 matches the window's clone number process the overlay even if
6320 the overlay's window property doesn't match the current window.
6321
d68443dc
MR
6322 * window.c (Fwindow_vchild): Rename to Fwindow_top_child.
6323 (Fwindow_hchild): Rename to Fwindow_left_child.
6324 (Fwindow_next): Rename to Fwindow_next_sibling.
6325 (Fwindow_prev): Rename to Fwindow_prev_sibling.
d615d6d2
MR
6326 (resize_window_check): Rename to window_resize_check.
6327 (resize_window_apply): Rename to window_resize_apply.
6328 (Fresize_window_apply): Rename to Fwindow_resize_apply.
6329 (Fdelete_other_windows_internal, resize_frame_windows)
6330 (Fsplit_window_internal, Fdelete_window_internal)
6331 (grow_mini_window, shrink_mini_window)
6332 (Fresize_mini_window_internal): Fix callers accordingly.
d68443dc 6333
c7e73be5
JD
63342011-06-26 Jan Djärv <jan.h.d@swipnet.se>
6335
6336 * emacsgtkfixed.h: State that this is only used with Gtk+3.
6337 (emacs_fixed_set_min_size): Remove.
6338 (emacs_fixed_new): Take frame as argument.
6339
6340 * emacsgtkfixed.c: State that this is only used with Gtk+3.
6341 (_EmacsFixedPrivate): Remove minwidth/height.
6342 Add struct frame *f.
6343 (emacs_fixed_init): Initialize priv->f.
6344 (get_parent_class, emacs_fixed_set_min_size): Remove.
6345 (emacs_fixed_new): Set priv->f to argument.
6346 (emacs_fixed_get_preferred_width)
6347 (emacs_fixed_get_preferred_height): Use min_width/height from
6348 frames size_hint to set minimum and natural (Bug#8919).
6349 (XSetWMSizeHints, XSetWMNormalHints): Override these functions
6350 and use min_width/height from frames size_hint to set
6351 min_width/height (Bug#8919).
6352
6353 * gtkutil.c (xg_create_frame_widgets): Pass f to emacs_fixed_new.
9173deec
JB
6354 (x_wm_set_size_hint): Remove call to emacs_fixed_set_min_size.
6355 Fix indentation.
c7e73be5 6356
cf99dcf8
EZ
63572011-06-26 Eli Zaretskii <eliz@gnu.org>
6358
6359 * bidi.c (bidi_paragraph_init): Test for ZV_BYTE before calling
6360 bidi_at_paragraph_end, since fast_looking_at doesn't like to be
6361 called at ZV.
6362
029529ac
CY
63632011-06-26 Chong Yidong <cyd@stupidchicken.com>
6364
6365 * process.c (wait_reading_process_output): Bypass select if
6366 waiting for a cell while ignoring keyboard input, and input is
6367 pending. Suggested by Jan Djärv (Bug#8869).
6368
7a7ef429
PE
63692011-06-25 Paul Eggert <eggert@cs.ucla.edu>
6370
6371 Use gnulib's dup2 module instead of rolling our own.
6372 * sysdep.c (dup2) [!HAVE_DUP2]: Remove; gnulib now does this.
6373
11fdef7d 63742011-06-25 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
989b42d2
YM
6375
6376 * dispnew.c (scrolling_window): Before scrolling, turn off a
6377 mouse-highlight in the window being scrolled.
6378
cd3520a4
JB
63792011-06-24 Juanma Barranquero <lekktu@gmail.com>
6380
6381 Move DEFSYM to lisp.h and use everywhere.
6382
6383 * character.h (DEFSYM): Move declaration...
6384 * lisp.h (DEFSYM): ...here.
6385
6386 * gnutls.c:
6387 * minibuf.c:
6388 * w32menu.c:
6389 * w32proc.c:
6390 * w32select.c: Don't include character.h.
6391
6392 * alloc.c (syms_of_alloc):
6393 * buffer.c (syms_of_buffer):
6394 * bytecode.c (syms_of_bytecode):
6395 * callint.c (syms_of_callint):
6396 * casefiddle.c (syms_of_casefiddle):
6397 * casetab.c (init_casetab_once):
6398 * category.c (init_category_once, syms_of_category):
6399 * ccl.c (syms_of_ccl):
6400 * cmds.c (syms_of_cmds):
6401 * composite.c (syms_of_composite):
6402 * dbusbind.c (syms_of_dbusbind):
6403 * dired.c (syms_of_dired):
6404 * dispnew.c (syms_of_display):
6405 * doc.c (syms_of_doc):
6406 * editfns.c (syms_of_editfns):
6407 * emacs.c (syms_of_emacs):
6408 * eval.c (syms_of_eval):
6409 * fileio.c (syms_of_fileio):
6410 * fns.c (syms_of_fns):
6411 * frame.c (syms_of_frame):
6412 * fringe.c (syms_of_fringe):
6413 * insdel.c (syms_of_insdel):
6414 * keymap.c (syms_of_keymap):
6415 * lread.c (init_obarray, syms_of_lread):
6416 * macros.c (syms_of_macros):
6417 * msdos.c (syms_of_msdos):
6418 * print.c (syms_of_print):
6419 * process.c (syms_of_process):
6420 * search.c (syms_of_search):
6421 * sound.c (syms_of_sound):
6422 * syntax.c (init_syntax_once, syms_of_syntax):
6423 * terminal.c (syms_of_terminal):
6424 * textprop.c (syms_of_textprop):
6425 * undo.c (syms_of_undo):
6426 * w32.c (globals_of_w32):
6427 * window.c (syms_of_window):
6428 * xdisp.c (syms_of_xdisp):
6429 * xfaces.c (syms_of_xfaces):
6430 * xfns.c (syms_of_xfns):
6431 * xmenu.c (syms_of_xmenu):
6432 * xsettings.c (syms_of_xsettings):
6433 * xterm.c (syms_of_xterm): Use DEFSYM.
6434
4228cf16
TZ
64352011-06-24 Teodor Zlatanov <tzz@lifelogs.com>
6436
cd3520a4 6437 * gnutls.c (syms_of_gnutls): Use the DEFSYM macro from character.h.
4228cf16 6438
7fcccf1e
PE
64392011-06-23 Paul Eggert <eggert@cs.ucla.edu>
6440
7efb4e0e
PE
6441 Integer and buffer overflow fixes (Bug#8873).
6442
ff5844ad
PE
6443 * print.c (printchar, strout): Check for string overflow.
6444 (PRINTPREPARE, printchar, strout):
6445 Don't set size unless allocation succeeds.
6446
90532f02
PE
6447 * minibuf.c (read_minibuf_noninteractive): Use ptrdiff_t, not int,
6448 for sizes. Check for string overflow more accurately.
6449 Simplify newline removal at end; this suppresses a GCC 4.6.0 warning.
6450
6d84508d
PE
6451 * macros.c: Integer and buffer overflow fixes.
6452 * keyboard.h (struct keyboard.kbd_macro_bufsize):
6453 * macros.c (Fstart_kbd_macro, store_kbd_macro_char):
6454 Use ptrdiff_t, not int, for sizes.
6455 Don't increment bufsize until after realloc succeeds.
6456 Check for size-calculation overflow.
6457 (Fstart_kbd_macro): Use EMACS_INT, not int, for XINT result.
6458
437b2cb4
PE
6459 * lisp.h (DEFVAR_KBOARD): Use offsetof instead of char * finagling.
6460
8b9ac8b4
PE
6461 * lread.c: Integer overflow fixes.
6462 (read_integer): Radix is now EMACS_INT, not int,
6463 to improve quality of diagnostics for out-of-range radices.
6464 Calculate buffer size correctly for out-of-range radices.
6465 (read1): Check for integer overflow in radices, and in
6466 read-circle numbers.
82cb60d3
PE
6467 (read_escape): Avoid int overflow.
6468 (Fload, openp, read_buffer_size, read1)
6469 (substitute_object_recurse, read_vector, read_list, map_obarray):
6470 Use ptrdiff_t, not int, for sizes.
6471 (read1): Use EMACS_INT, not int, for sizes.
20270765 6472 Check for size overflow.
8b9ac8b4 6473
7fcccf1e
PE
6474 * image.c (cache_image): Check for size arithmetic overflow.
6475
bfbbd7e7
PE
6476 * lread.c: Integer overflow issues.
6477 (saved_doc_string_size, saved_doc_string_length)
6478 (prev_saved_doc_string_size, prev_saved_doc_string_length):
6479 Now ptrdiff_t, not int.
6480 (read1): Don't assume doc string length fits in int. Check for
6481 out-of-range doc string lengths.
6482 (read_list): Don't assume file position fits in int.
39019e54 6483 (read_escape): Check for hex character overflow.
bfbbd7e7 6484
4e323265
LL
64852011-06-22 Leo Liu <sdl.web@gmail.com>
6486
6487 * minibuf.c (Fcompleting_read_default, Vcompleting_read_function):
6488 Move to minibuffer.el.
6489
85fece3e
PE
64902011-06-22 Paul Eggert <eggert@cs.ucla.edu>
6491
20b84ce9 6492 Fixes for GLYPH_DEBUG found by GCC 4.6.0 static checking.
85fece3e
PE
6493 The following patches are for when GLYPH_DEBUG && !XASSERT.
6494 * dispextern.h (trace_redisplay_p, dump_glyph_string):
6495 * dispnew.c (flush_stdout):
6496 * xdisp.c (dump_glyph_row, dump_glyph_matrix, dump_glyph):
6497 Mark as externally visible.
6498 * dispnew.c (check_window_matrix_pointers): Now static.
6499 * dispnew.c (window_to_frame_vpos):
6500 * xfns.c (unwind_create_frame):
6501 * xterm.c (x_check_font): Remove unused local.
6502 * scroll.c (CHECK_BOUNDS):
6503 * xfaces.c (cache_fache): Rename local to avoid shadowing.
6504 * xfns.c, w32fns.c (image_cache_refcount, dpyinfo_refcount): Now static.
6505 * xdisp.c (check_window_end): Now a no-op if !XASSERTS.
6506 (debug_first_unchanged_at_end_vpos, debug_last_unchanged_at_beg_vpos)
6507 (debug_dvpos, debug_dy, debug_delta, debug_delta_bytes, debug_end_vpos):
6508 Now static.
6509 (debug_method_add): Use va_list and vsprintf rather than relying
6510 on undefined behavior with wrong number of arguments.
6511 (dump_glyph, dump_glyph_row, Fdump_glyph_matrix):
6512 Don't assume ptrdiff_t and EMACS_INT are the same width as int.
6513 In this code, it's OK to assume C99 behavior for ptrdiff_t formats
6514 since we're not interested in debugging glyphs with old libraries.
6515 * xfaces.c (cache_face): Move debugging code earlier; this pacifies
6516 GCC 4.6.0's static checking.
6517
0766b489
PE
65182011-06-22 Paul Eggert <eggert@cs.ucla.edu>
6519
31fd4b32
PE
6520 Integer overflow and signedness fixes (Bug#8873).
6521 A few related buffer overrun fixes, too.
6522
b79e8648
PE
6523 * font.c (font_score): Use EMACS_INT, not int, to store XINT value.
6524
0766b489
PE
6525 * dispextern.h (struct face.stipple):
6526 * image.c (x_bitmap_height, x_bitmap_width, x_bitmap_pixmap)
6527 (x_bitmap_mask, x_allocate_bitmap_record)
6528 (x_create_bitmap_from_data, x_create_bitmap_from_file)
6529 (x_destroy_bitmap, x_destroy_all_bitmaps, x_create_bitmap_mask)
6530 (x_create_bitmap_from_xpm_data):
6531 * nsterm.h (struct ns_display_info.bitmaps_size, .bitmaps_last):
6532 * w32term.h (struct w32_display_info.icon_bitmap_id, .bitmaps_size)
6533 (.bitmaps_last):
6534 * xfaces.c (load_pixmap):
6535 * xterm.c (x_bitmap_icon, x_wm_set_icon_pixmap):
6536 * xterm.h (struct x_display_info.icon_bitmap_id, .bitmaps_size)
6537 (.bitmaps_last, struct x_output.icon_bitmap):
6538 Use ptrdiff_t, not int, for bitmap indexes.
6539 (x_allocate_bitmap_record): Check for size overflow.
6540 * dispextern.h, lisp.h: Adjust to API changes elsewhere.
6541
b081724f
PE
6542 Use ptrdiff_t, not int, for overlay counts.
6543 * buffer.h (overlays_at, sort_overlays, GET_OVERLAYS_AT):
6544 * editfns.c (overlays_around, get_pos_property):
6545 * textprop.c (get_char_property_and_overlay):
6546 * xdisp.c (next_overlay_change, note_mouse_highlight):
6547 * xfaces.c (face_at_buffer_position):
21514da7
PE
6548 * buffer.c (OVERLAY_COUNT_MAX): New macro.
6549 (overlays_at, overlays_in, sort_overlays, Foverlays_at)
6550 (Fnext_overlay_change, Fprevious_overlay_change)
6551 (mouse_face_overlay_overlaps, Foverlays_in):
b081724f 6552 Use ptrdiff_t, not int, for sizes.
21514da7 6553 (overlays_at, overlays_in): Check for size-calculation overflow.
b081724f 6554
3de73e5e
PE
6555 * xterm.c (xim_initialize, same_x_server): Strlen may not fit in int.
6556
2606c57b
PE
6557 * xsmfns.c (smc_save_yourself_CB, x_session_initialize): Avoid strlen.
6558 (x_session_initialize): Do not assume string length fits in int.
6559
aaafe47a
PE
6560 * xsettings.c (apply_xft_settings): Fix potential buffer overrun.
6561 This is unlikely, but can occur if DPI is outlandish.
6562
2674ddc8 6563 * xsettings.c (Ffont_get_system_normal_font, Ffont_get_system_font):
3a5077c5
PE
6564 * xselect.c (Fx_get_atom_name): Avoid need for strlen.
6565
28154962
PE
6566 * xrdb.c: Don't assume strlen fits in int; avoid some strlens.
6567 * xrdb.c (magic_file_p, search_magic_path):
6568 Omit last arg SUFFIX; it was always 0. All callers changed.
6569 (magic_file_p): Use ptrdiff_t, not int. Check for size overflow.
6570
7de51af5
PE
6571 * xfont.c (xfont_match): Avoid need for strlen.
6572
25ed6cc3
PE
6573 * xfns.c: Don't assume strlen fits in int.
6574 (xic_create_fontsetname, x_window): Use ptrdiff_t, not int.
6575
4eab31dd
PE
6576 * xdisp.c (message_log_check_duplicate): Return intmax_t,
6577 not unsigned long, as we prefer signed integers. All callers changed.
6578 Detect integer overflow in repeat count.
6579 (message_dolog): Don't assume print length fits in 39 bytes.
df1f27af 6580 (display_mode_element): Don't assume strlen fits in int.
4eab31dd 6581
171e2a58
PE
6582 * termcap.c: Don't assume sizes fit in int and never overflow.
6583 (struct termcap_buffer, tgetent): Use ptrdiff_t, not int, for sizes.
6584 (gobble_line): Check for size-calculation overflow.
6585
ad39faca 6586 * minibuf.c (Fread_buffer):
6e5bb2dc 6587 * lread.c (intern, intern_c_string):
74ca2eb3
PE
6588 * image.c (xpm_scan) [HAVE_NS && !HAVE_XPM]:
6589 Don't assume string length fits in int.
6590
52c61c22 6591 * keyboard.c (parse_tool_bar_item):
9bda3520
PE
6592 * gtkutil.c (style_changed_cb): Avoid need for strlen.
6593
b5b8c9e5
PE
6594 * font.c: Don't assume string length fits in int.
6595 (font_parse_xlfd, font_parse_fcname, font_unparse_fcname):
6596 Use ptrdiff_t, not int.
ccd6111c
PE
6597 (font_intern_prop): Don't assume string length fits in int.
6598 Don't assume integer property fits in fixnum.
6599 * font.h (font_intern_prop): 2nd arg is now ptrdiff_t, not int.
b5b8c9e5 6600
882f0d81 6601 * filelock.c: Fix some buffer overrun and integer overflow issues.
51cab52b 6602 (get_boot_time): Don't assume gzip command string fits in 100 bytes.
882f0d81
PE
6603 Reformulate so as not to need the command string.
6604 Invoke gzip -cd rather than gunzip, as it's more portable.
6605 (lock_info_type, lock_file_1, lock_file):
6606 Don't assume pid_t and time_t fit in unsigned long.
6607 (LOCK_PID_MAX): Remove; we now use more-reliable bounds.
6608 (current_lock_owner): Prefer signed type for sizes.
6609 Use memcpy, not strncpy, where memcpy is what is really wanted.
6610 Don't assume (via atoi) that time_t and pid_t fit in int.
6611 Check for time_t and/or pid_t out of range, e.g., via a network share.
6612 Don't alloca where an auto var works fine.
6613
93f4cf88
PE
6614 * fileio.c: Fix some integer overflow issues.
6615 (file_name_as_directory, Fexpand_file_name, Fsubstitute_in_file_name):
6616 Don't assume string length fits in int.
6617 (directory_file_name): Don't assume string length fits in long.
6618 (make_temp_name): Don't assume pid fits in int, or that its print
6619 length is less than 20.
6620
f3e92b69
PE
6621 * data.c (Fsubr_name): Rewrite to avoid a strlen call.
6622
1bfdaf10
PE
6623 * coding.c (make_subsidiaries): Don't assume string length fits in int.
6624
35016e9a
PE
6625 * callproc.c (child_setup): Rewrite to avoid two strlen calls.
6626
3d1e65a1
PE
6627 * process.c (Fformat_network_address): Use EMACS_INT, not EMACS_UINT.
6628 We prefer signed integers, even for size calculations.
6629
0b963a93
PE
6630 * emacs.c: Don't assume string length fits in 'int'.
6631 (DEFINE_DUMMY_FUNCTION, sort_args): Use ptrdiff_t, not int.
6632 (main): Don't invoke strlen when not needed.
6633
573f4b54
PE
6634 * dbusbind.c (XD_ERROR): Don't arbitrarily truncate string.
6635 (XD_DEBUG_MESSAGE): Don't waste a byte.
6636
989f33ba
PE
6637 * callproc.c (getenv_internal_1, getenv_internal)
6638 (Fgetenv_internal):
965d34eb
PE
6639 * buffer.c (init_buffer): Don't assume string length fits in 'int'.
6640
e4d29b33
PE
6641 * lread.c (invalid_syntax): Omit length argument.
6642 All uses changed. This doesn't fix a bug, but it simplifies the
6643 code away from its former Hollerith-constant appearance, and it's
6644 one less 'int' to worry about when looking at integer-overflow issues.
51cab52b 6645 (string_to_number): Simplify 2011-04-26 change by invoking xsignal1.
e4d29b33 6646
eb49b136
PE
6647 * lisp.h (DEFUN): Remove bogus use of sizeof (struct Lisp_Subr).
6648 This didn't break anything, but it didn't help either.
6649 It's confusing to put a bogus integer in a place where the actual
6650 value does not matter.
9f62aeb1 6651 (LIST_END_P): Remove unused macro and its bogus comment.
cbeff735 6652 (make_fixnum_or_float): Remove unnecessary cast to EMACS_INT.
eb49b136 6653
15375a22
PE
6654 * lisp.h (union Lisp_Object.i): EMACS_INT, not EMACS_UINT.
6655 This is for consistency with the ordinary, non-USE_LISP_UNION_TYPE,
6656 implementation.
b61cc01c
PE
6657 (struct Lisp_Bool_Vector.size): EMACS_INT, not EMACS_UINT.
6658 We prefer signed types, and the value cannot exceed the EMACS_INT
6659 range anyway (because otherwise the length would not be representable).
9a8e8d9b
PE
6660 (XSET) [USE_LISP_UNION_TYPE]: Use uintptr_t and intptr_t,
6661 not EMACS_UINT and EMACS_INT, when converting pointer to integer.
6662 This avoids a GCC warning when WIDE_EMACS_INT.
15375a22 6663
53b2623d
PE
6664 * indent.c (sane_tab_width): New function.
6665 (current_column, scan_for_column, Findent_to, position_indentation)
6666 (compute_motion): Use it. This is just for clarity.
8fcaf9cc 6667 (Fcompute_motion): Don't assume hscroll and tab offset fit in int.
53b2623d 6668
51cab52b 6669 * image.c (xbm_image_p): Don't assume stated width, height fit in int.
45aebb64 6670
f2ed8a70
PE
6671 * lisp.h (lint_assume): New macro.
6672 * composite.c (composition_gstring_put_cache):
6673 * ftfont.c (ftfont_shape_by_flt): Use it to pacify GCC 4.6.0.
6674
abe80cc6
PE
6675 * editfns.c, insdel.c:
6676 Omit unnecessary forward decls, to simplify future changes.
a9e860e1 6677
b02c740e
PE
6678 * ftfont.c (ftfont_shape_by_flt): Use signed integers for lengths.
6679
ebc96716
PE
6680 * font.c (Ffont_shape_gstring): Don't assume glyph len fits in 'int'.
6681
b4e50fa0 6682 * fns.c (Ffillarray): Don't assume bool vector size fits in 'int'.
f03dc6ef 6683 Use much-faster test for byte-length change.
311d5d7c 6684 Don't assume string byte-length fits in 'int'.
a4cf38e4 6685 Check that character arg fits in 'int'.
85461888 6686 (mapcar1): Declare byte as byte, for clarity.
b4e50fa0 6687
c0c1ee9f
PE
6688 * alloc.c (Fmake_bool_vector): Avoid unnecessary multiplication.
6689
a498d7f4
PE
6690 * fns.c (concat): Catch string overflow earlier.
6691 Do not rely on integer wraparound.
6692
51cab52b
PE
6693 * dispextern.h (struct it.overlay_strings_charpos)
6694 (struct it.selective): Now EMACS_INT, not int.
87830974
PE
6695 * xdisp.c (forward_to_next_line_start)
6696 (back_to_previous_visible_line_start)
6697 (reseat_at_next_visible_line_start, next_element_from_buffer):
6698 Don't arbitrarily truncate the value of 'selective' to int.
6699
76031fad
PE
6700 * xdisp.c (init_iterator): Use XINT, not XFASTINT; it might be < 0.
6701
5eb55db9
PE
6702 * composite.c: Don't truncate sizes to 'int'.
6703 (composition_gstring_p, composition_reseat_it)
6704 (composition_adjust_point): Use EMACS_INT, not int.
7d100a81
PE
6705 (get_composition_id, composition_gstring_put_cache): Use EMACS_INT,
6706 not EMACS_UINT, for indexes.
5eb55db9 6707
0703a717
PE
6708 * category.h (CATEGORY_SET_P): Remove unnecessary cast to EMACS_INT.
6709
d6202519
PE
6710 * buffer.c: Include <verify.h>.
6711 (struct sortvec.priority, struct sortstr.priority):
8961a454 6712 Now EMACS_INT, not int.
c20998a7 6713 (compare_overlays, cmp_for_strings): Avoid subtraction overflow.
67c36fce
PE
6714 (struct sortstr.size, record_overlay_string)
6715 (struct sortstrlist.size, struct sortlist.used):
6716 Don't truncate size to int.
6717 (record_overlay_string): Check for size-calculation overflow.
d6202519 6718 (init_buffer_once): Check at compile-time, not run-time.
fadf4e30 6719
d5a19415
JM
67202011-06-22 Jim Meyering <meyering@redhat.com>
6721
029529ac 6722 Don't leak an XBM-image-sized buffer
d5a19415
JM
6723 * image.c (xbm_load): Free the image buffer after using it.
6724
a9041e6c
PE
67252011-06-21 Paul Eggert <eggert@cs.ucla.edu>
6726
6727 Port to Sun C.
6728 * composite.c (find_automatic_composition): Omit needless 'return 0;'
6729 that Sun C diagnosed.
6730 * fns.c (secure_hash): Fix pointer signedness issue.
6731 * intervals.c (static_offset_intervals): New function.
6732 (offset_intervals): Use it.
6733
7f3f739f
LL
67342011-06-21 Leo Liu <sdl.web@gmail.com>
6735
6736 * deps.mk (fns.o):
6737 * makefile.w32-in ($(BLD)/fns.$(O)): Include sha256.h and
6738 sha512.h.
6739
6740 * fns.c (secure_hash): Rename from crypto_hash_function and change
6741 the first arg to accept symbols.
5b66d427 6742 (Fsecure_hash): New primitive.
7f3f739f
LL
6743 (syms_of_fns): New symbols.
6744
76147d94
DD
67452011-06-20 Deniz Dogan <deniz@dogan.se>
6746
6747 * process.c (Fset_process_buffer): Clarify return value in
6748 docstring.
6749
7d7d0045
CY
67502011-06-18 Chong Yidong <cyd@stupidchicken.com>
6751
6752 * dispnew.c (add_window_display_history): Use BVAR.
6753
6754 * xdisp.c (debug_method_add): Use BVAR.
6755 (check_window_end, dump_glyph_matrix, dump_glyph)
6756 (dump_glyph_row, dump_glyph_string): Convert arglist to ANSI C.
6757
6758 * xfaces.c (check_lface_attrs, check_lface, dump_realized_face):
6759 Likewise.
6760
6761 * xfns.c (Fx_create_frame, x_create_tip_frame): Delay image cache
6762 check till after the cache is created in init_frame_faces.
6763
ff2bc410
SM
67642011-06-17 Stefan Monnier <monnier@iro.umontreal.ca>
6765
6766 * fns.c (Fsafe_length): Yet another int/Lisp_Object mixup.
6767
28177add
PE
67682011-06-16 Paul Eggert <eggert@cs.ucla.edu>
6769
dd3482fe
PE
6770 * lisp.h: Include <limits.h>, for INT_MAX, LONG_MAX, LLONG_MAX.
6771 Without this, prin1 mishandles Lisp_Misc_Save_Value printing on
6772 hosts with pre-C99 libraries, because pD is wrongly defined to "t".
6773
393d71f3 6774 Improve buffer-overflow checking (Bug#8873).
1c8e352f
PE
6775 * fileio.c (Finsert_file_contents):
6776 * insdel.c (insert_from_buffer_1, replace_range, replace_range_2):
6777 Remove the old (too-loose) buffer overflow checks.
6778 They weren't needed, since make_gap checks for buffer overflow.
6779 * insdel.c (make_gap_larger): Catch buffer overflows that were missed.
6780 The old code merely checked for Emacs fixnum overflow, and relied
6781 on undefined (wraparound) behavior. The new code avoids undefined
6782 behavior, and also checks for ptrdiff_t and/or size_t overflow.
6783
2e6813b0 6784 * editfns.c (Finsert_char): Don't dump core with very negative counts.
21d890a4
PE
6785 Tune. Don't use wider integers than needed. Don't use alloca.
6786 Use a bigger 'string' buffer. Rewrite to avoid 'n > 0' test.
2e6813b0 6787
599a9e4f
PE
6788 * insdel.c (replace_range): Fix buf overflow when insbytes < outgoing.
6789
99561444
PE
6790 * insdel.c, lisp.h (buffer_overflow): New function.
6791 (insert_from_buffer_1, replace_range, replace_range_2):
6792 * insdel.c (make_gap_larger):
6793 * editfns.c (Finsert_char):
6794 * fileio.c (Finsert_file_contents): Use it, to normalize wording.
6795
28177add
PE
6796 * buffer.h (BUF_BYTES_MAX): Cast to ptrdiff_t so that it's signed.
6797
e69dafad
PE
67982011-06-15 Paul Eggert <eggert@cs.ucla.edu>
6799
4baa020d 6800 Integer overflow and signedness fixes (Bug#8873, Bug#8828).
ff672d2c 6801
b1c46f02
PE
6802 * ccl.c (ASCENDING_ORDER): New macro, to work around GCC bug 43772.
6803 (GET_CCL_RANGE, IN_INT_RANGE): Use it.
6804
e69dafad
PE
6805 * fileio.c: Don't assume EMACS_INT fits in off_t.
6806 (emacs_lseek): New static function.
6807 (Finsert_file_contents, Fwrite_region): Use it.
6808 Use SEEK_SET, SEEK_CUR, SEEK_END as appropriate.
6809
566684ea
PE
6810 * fns.c (Fload_average): Don't assume 100 * load average fits in int.
6811
e6966cd6
PE
6812 * fns.c: Don't overflow int when computing a list length.
6813 * fns.c (QUIT_COUNT_HEURISTIC): New constant.
6814 (Flength, Fsafe_length): Use EMACS_INT, not int, to avoid unwanted
6815 truncation on 64-bit hosts. Check for QUIT every
6816 QUIT_COUNT_HEURISTIC entries rather than every other entry; that's
6817 faster and is responsive enough.
6818 (Flength): Report an error instead of overflowing an integer.
6819 (Fsafe_length): Return a float if the value is not representable
6820 as a fixnum. This shouldn't happen except in contrived situations.
6346d301 6821 (Fnthcdr, Fsort): Don't assume list length fits in int.
de41a810 6822 (Fcopy_sequence): Don't assume vector length fits in int.
00c604f2 6823
dd0b0efb
PE
6824 * alloc.c: Check that resized vectors' lengths fit in fixnums.
6825 (header_size, word_size): New constants.
6826 (allocate_vectorlike): Don't check size overflow here.
6827 (allocate_vector): Check it here instead, since this is the only
6828 caller of allocate_vectorlike that could cause overflow.
6829 Check that the new vector's length is representable as a fixnum.
6830
86fe5cfe
PE
6831 * fns.c (next_almost_prime): Don't return a multiple of 3 or 5.
6832 The previous code was bogus. For example, next_almost_prime (32)
6833 returned 39, which is undesirable as it is a multiple of 3; and
6834 next_almost_prime (24) returned 25, which is a multiple of 5 so
6835 why was the code bothering to check for multiples of 7?
6836
80e88859
PE
6837 * bytecode.c (exec_byte_code): Use ptrdiff_t, not int, for vector length.
6838
4a2f0ad6
PE
6839 * eval.c, doprnt.c (SIZE_MAX): Remove; inttypes.h defines this now.
6840
f66c7cf8
PE
6841 Variadic C functions now count arguments with ptrdiff_t.
6842 This partly undoes my 2011-03-30 change, which replaced int with size_t.
6843 Back then I didn't know that the Emacs coding style prefers signed int.
6844 Also, in the meantime I found a few more instances where arguments
4a2f0ad6
PE
6845 were being counted with int, which may truncate counts on 64-bit
6846 machines, or EMACS_INT, which may be unnecessarily wide.
f66c7cf8
PE
6847 * lisp.h (struct Lisp_Subr.function.aMANY)
6848 (DEFUN_ARGS_MANY, internal_condition_case_n, safe_call):
6849 Arg counts are now ptrdiff_t, not size_t.
6850 All variadic functions and their callers changed accordingly.
6851 (struct gcpro.nvars): Now size_t, not size_t. All uses changed.
6852 * bytecode.c (exec_byte_code): Check maxdepth for overflow,
6853 to avoid potential buffer overrun. Don't assume arg counts fit in 'int'.
6854 * callint.c (Fcall_interactively): Check arg count for overflow,
6855 to avoid potential buffer overrun. Use signed char, not 'int',
6856 for 'varies' array, so that we needn't bother to check its size
6857 calculation for overflow.
6858 * editfns.c (Fformat): Use ptrdiff_t, not EMACS_INT, to count args.
6859 * eval.c (apply_lambda):
6860 * fns.c (Fmapconcat): Use XFASTINT, not XINT, to get args length.
6861 (struct textprop_rec.argnum): Now ptrdiff_t, not int. All uses changed.
6862 (mapconcat): Use ptrdiff_t, not int and EMACS_INT, to count args.
6863
a1759b76
PE
6864 * callint.c (Fcall_interactively): Don't use index var as event count.
6865
d96be9fc
PE
6866 * vm-limit.c (check_memory_limits): Fix incorrect extern function decls.
6867 * mem-limits.h (SIZE): Remove; no longer used.
6868
a690a978 6869 * xterm.c (x_alloc_nearest_color_1): Prefer int to long when int works.
5efd304b 6870
578c21e6
PE
6871 Remove unnecessary casts.
6872 * xterm.c (x_term_init):
6873 * xfns.c (x_set_border_pixel):
6874 * widget.c (create_frame_gcs): Remove casts to unsigned long etc.
6875 These aren't needed now that we assume ANSI C.
6876
96f53c6c
PE
6877 * sound.c (Fplay_sound_internal): Remove cast to unsigned long.
6878 It's more likely to cause problems (due to unsigned overflow)
6879 than to cure them.
6880
83c77d31
PE
6881 * dired.c (Ffile_attributes): Don't use 32-bit hack on 64-bit hosts.
6882
ee2079f1
PE
6883 * unexelf.c (unexec): Don't assume BSS addr fits in unsigned.
6884
6da65536
PE
6885 * xterm.c (handle_one_xevent): Omit unnecessary casts to unsigned.
6886
7147c4a4
PE
6887 * keyboard.c (modify_event_symbol): Don't limit alist len to UINT_MAX.
6888
193e32d9
PE
6889 * lisp.h (CHAR_TABLE_SET): Omit now-redundant test.
6890
e5533da6
PE
6891 * lread.c (Fload): Don't compare a possibly-garbage time_t value.
6892
9910e595
PE
6893 GLYPH_CODE_FACE returns EMACS_INT, not int.
6894 * dispextern.h (merge_faces):
6895 * xfaces.c (merge_faces):
01103c44
PE
6896 * xdisp.c (get_next_display_element, next_element_from_display_vector):
6897 Don't assume EMACS_INT fits in int.
9910e595 6898
2638320e
PE
6899 * character.h (CHAR_VALID_P): Remove unused parameter.
6900 * fontset.c, lisp.h, xdisp.c: All uses changed.
6901
045eb8d9
PE
6902 * editfns.c (Ftranslate_region_internal): Omit redundant test.
6903
c1f134b5
PE
6904 * fns.c (concat): Minor tuning based on overflow analysis.
6905 This doesn't fix any bugs. Use int to hold character, instead
6906 of constantly refetching from Emacs object. Use XFASTINT, not
6907 XINT, for value known to be a character. Don't bother comparing
6908 a single byte to 0400, as it's always less.
6909
395fcb93 6910 * floatfns.c (Fexpt):
327eeec8
PE
6911 * fileio.c (make_temp_name): Omit unnecessary cast to unsigned.
6912
abbd3d23
PE
6913 * editfns.c (Ftranslate_region_internal): Use int, not EMACS_INT
6914 for characters.
6915
684a03ef
PE
6916 * doc.c (get_doc_string): Omit (unsigned)c that mishandled negatives.
6917
0fed43f3
PE
6918 * data.c (Faset): If ARRAY is a string, check that NEWELT is a char.
6919 Without this fix, on a 64-bit host (aset S 0 4294967386) would
6920 incorrectly succeed when S was a string, because 4294967386 was
6921 truncated before it was used.
6922
8fd02eb7
PE
6923 * chartab.c (Fchar_table_range): Use CHARACTERP to check range.
6924 Otherwise, an out-of-range integer could cause undefined behavior
6925 on a 64-bit host.
6926
f8c86b69
PE
6927 * composite.c: Use int, not EMACS_INT, for characters.
6928 (fill_gstring_body, composition_compute_stop_pos): Use int, not
6929 EMACS_INT, for values that are known to be in character range.
6930 This doesn't fix any bugs but is the usual style inside Emacs and
6931 may generate better code on 32-bit machines.
6932
34206dd2
PE
6933 Make sure a 64-bit char is never passed to ENCODE_CHAR.
6934 This is for reasons similar to the recent CHAR_STRING fix.
6935 * charset.c (Fencode_char): Check that character arg is actually
6936 a character. Pass an int to ENCODE_CHAR.
6937 * charset.h (ENCODE_CHAR): Verify that the character argument is no
6938 wider than 'int', as a compile-time check to prevent future regressions
6939 in this area.
6940
c5958d4c 6941 * character.c (char_string): Remove unnecessary casts.
13bdea59
PE
6942
6943 Make sure a 64-bit char is never passed to CHAR_STRING.
6944 Otherwise, CHAR_STRING would do the wrong thing on a 64-bit platform,
6945 by silently ignoring the top 32 bits, allowing some values
6946 that were far too large to be valid characters.
6947 * character.h: Include <verify.h>.
6948 (CHAR_STRING, CHAR_STRING_ADVANCE): Verify that the character
6949 arguments are no wider than unsigned, as a compile-time check
6950 to prevent future regressions in this area.
6951 * data.c (Faset):
01103c44 6952 * editfns.c (Fchar_to_string, general_insert_function, Finsert_char)
13bdea59
PE
6953 (Fsubst_char_in_region):
6954 * fns.c (concat):
6955 * xdisp.c (decode_mode_spec_coding):
6956 Adjust to CHAR_STRING's new requirement.
6957 * editfns.c (Finsert_char, Fsubst_char_in_region):
6958 * fns.c (concat): Check that character args are actually
6959 characters. Without this test, these functions did the wrong
6960 thing with wildly out-of-range values on 64-bit hosts.
6961
d37ca623
PE
6962 Remove incorrect casts to 'unsigned' that lose info on 64-bit hosts.
6963 These casts should not be needed on 32-bit hosts, either.
6964 * keyboard.c (read_char):
6965 * lread.c (Fload): Remove casts to unsigned.
6966
ea204efb
PE
6967 * lisp.h (UNSIGNED_CMP): New macro.
6968 This fixes comparison bugs on 64-bit hosts.
6969 (ASCII_CHAR_P): Use it.
6970 * casefiddle.c (casify_object):
01103c44 6971 * character.h (ASCII_BYTE_P, CHAR_VALID_P)
ea204efb
PE
6972 (SINGLE_BYTE_CHAR_P, CHAR_STRING):
6973 * composite.h (COMPOSITION_ENCODE_RULE_VALID):
6974 * dispextern.h (FACE_FROM_ID):
6975 * keyboard.c (read_char): Use UNSIGNED_CMP.
6976
41cb286c
PE
6977 * xmenu.c (dialog_selection_callback) [!USE_GTK]: Cast to intptr_t,
6978 not to EMACS_INT, to avoid GCC warning.
6979
4a1b9832
PE
6980 * xfns.c (x_set_scroll_bar_default_width): Remove unused 'int' locals.
6981
55daad71
PE
6982 * buffer.h (PTR_BYTE_POS, BUF_PTR_BYTE_POS): Remove harmful cast.
6983 The cast incorrectly truncated 64-bit byte offsets to 32 bits, and
6984 isn't needed on 32-bit machines.
8f95c75c 6985
01103c44
PE
6986 * buffer.c (Fgenerate_new_buffer_name):
6987 Use EMACS_INT for count, not int.
0ceccced 6988 (advance_to_char_boundary): Return EMACS_INT, not int.
e762cafe
PE
6989
6990 * data.c (Qcompiled_function): Now static.
6991
c6f072e7
PE
6992 * window.c (window_body_lines): Now static.
6993
20ce5912
PE
6994 * image.c (gif_load): Rename local to avoid shadowing.
6995
9c4c5f81
PE
6996 * lisp.h (SAFE_ALLOCA_LISP): Check for integer overflow.
6997 (struct Lisp_Save_Value): Use ptrdiff_t, not int, for 'integer' member.
6998 * alloc.c (make_save_value): Integer argument is now of type
6999 ptrdiff_t, not int.
7000 (mark_object): Use ptrdiff_t, not int.
7001 * lisp.h (pD): New macro.
7002 * print.c (print_object): Use it.
7003
c0c5c8ae
PE
7004 * alloc.c: Use EMACS_INT, not int, to count objects.
7005 (total_conses, total_markers, total_symbols, total_vector_size)
7006 (total_free_conses, total_free_markers, total_free_symbols)
01103c44
PE
7007 (total_free_floats, total_floats, total_free_intervals)
7008 (total_intervals, total_strings, total_free_strings):
c0c5c8ae
PE
7009 Now EMACS_INT, not int. All uses changed.
7010 (Fgarbage_collect): Compute overall total using a double, so that
7011 integer overflow is less likely to be a problem. Check for overflow
7012 when converting back to an integer.
5a25e253
PE
7013 (n_interval_blocks, n_string_blocks, n_float_blocks, n_cons_blocks)
7014 (n_vectors, n_symbol_blocks, n_marker_blocks): Remove.
7015 These were 'int' variables that could overflow on 64-bit hosts;
7016 they were never used, so remove them instead of repairing them.
211a0b2a 7017 (nzombies, ngcs, max_live, max_zombies): Now EMACS_INT, not 'int'.
6349ae4d
PE
7018 (inhibit_garbage_collection): Set gc_cons_threshold to max value.
7019 Previously, this ceilinged at INT_MAX, but that doesn't work on
7020 64-bit machines.
e46bb31a 7021 (allocate_pseudovector): Don't use EMACS_INT when int would do.
c0c5c8ae 7022
c78baabf 7023 * alloc.c (Fmake_bool_vector): Don't assume vector size fits in int.
86f61a15 7024 (allocate_vectorlike): Check for ptrdiff_t overflow.
b6439961
PE
7025 (mark_vectorlike, mark_char_table, mark_object): Avoid EMACS_UINT
7026 when a (possibly-narrower) signed value would do just as well.
7027 We prefer using signed arithmetic, to avoid comparison confusion.
c78baabf 7028
c9d624c6
PE
7029 * alloc.c: Catch some string size overflows that we were missing.
7030 (XMALLOC_OVERRUN_CHECK_SIZE) [!XMALLOC_OVERRUN_CHECK]: Define to 0,
7031 for convenience in STRING_BYTES_MAX.
7032 (STRING_BYTES_MAX): New macro, superseding the old one in lisp.h.
7033 The definition here is exact; the one in lisp.h was approximate.
7034 (allocate_string_data): Check for string overflow. This catches
7035 some instances we weren't catching before. Also, it catches
7036 size_t overflow on (unusual) hosts where SIZE_MAX <= min
7037 (PTRDIFF_MAX, MOST_POSITIVE_FIXNUM), e.g., when size_t is 32 bits
7038 and ptrdiff_t and EMACS_INT are both 64 bits.
c78baabf 7039
c9d624c6
PE
7040 * character.c, coding.c, doprnt.c, editfns.c, eval.c:
7041 All uses of STRING_BYTES_MAX replaced by STRING_BYTES_BOUND.
640c8776 7042 * lisp.h (STRING_BYTES_BOUND): Rename from STRING_BYTES_MAX.
c9d624c6 7043
353032ce
PE
7044 * character.c (string_escape_byte8): Fix nbytes/nchars typo.
7045
2bccce07
PE
7046 * alloc.c (Fmake_string): Check for out-of-range init.
7047
0ac30604
SM
70482011-06-15 Stefan Monnier <monnier@iro.umontreal.ca>
7049
7050 * eval.c (Fdefvaralias): Also mark the target as variable-special-p.
7051
c195f2de
JD
70522011-06-14 Jan Djärv <jan.h.d@swipnet.se>
7053
7054 * xfns.c (x_set_scroll_bar_default_width): Remove argument to
7055 xg_get_default_scrollbar_width.
7056
7057 * gtkutil.c: Include emacsgtkfixed.h if HAVE_GTK3.
7058 (int_gtk_range_get_value): Move to the scroll bar part of the file.
7059 (style_changed_cb): Call update_theme_scrollbar_width and call
7060 x_set_scroll_bar_default_width and xg_frame_set_char_size for
7061 all frames (Bug#8505).
7062 (xg_create_frame_widgets): Call emacs_fixed_new if HAVE_GTK3 (Bug#8505).
7063 Call gtk_window_set_resizable if HAVE_GTK3.
7064 (x_wm_set_size_hint): Call emacs_fixed_set_min_size with min width
7065 and height if HAVE_GTK3 (Bug#8505).
7066 (scroll_bar_width_for_theme): New variable.
7067 (update_theme_scrollbar_width): New function.
7068 (xg_get_default_scrollbar_width): Move code to
7069 update_theme_scrollbar_width, just return scroll_bar_width_for_theme.
7070 (xg_initialize): Call update_theme_scrollbar_width.
7071
7072 * gtkutil.h (xg_get_default_scrollbar_width): Remove argument.
7073
7074 * emacsgtkfixed.c, emacsgtkfixed.h: New files.
7075
e10ac9f1
MR
70762011-06-12 Martin Rudalics <rudalics@gmx.at>
7077
7078 * frame.c (make_frame): Call other_buffer_safely instead of
7079 other_buffer.
7080
7081 * window.c (temp_output_buffer_show): Call display_buffer with
7082 second argument Vtemp_buffer_show_specifiers and reset latter
7083 immediately after the call.
7084 (Vtemp_buffer_show_specifiers): New variable.
7085 (auto_window_vscroll_p, next_screen_context_lines)
7086 (Vscroll_preserve_screen_position): Remove leading asterisks from
7087 doc-strings.
7088
2d3c217e 70892011-06-12 Paul Eggert <eggert@cs.ucla.edu>
4475bec4 7090
7b7f97e8 7091 Fix minor problems found by GCC 4.6.0 static checking.
4475bec4
PE
7092 * buffer.c (Qclone_number): Remove for now, as it's unused.
7093 (record_buffer, Funrecord_buffer): Rename local to avoid shadowing.
7094 (record_buffer): Remove unused local.
7095 * frame.c (other_visible_frames, frame_buffer_list): Now static.
7096 (set_frame_buffer_list): Remove; unused.
7097 * frame.h (other_visible_frames): Remove decl.
7098 * keyboard.h (menu_items_inuse): Declare only if USE_GTK || USE_MOTIF.
7099 * lisp.h (frame_buffer_list, set_frame_buffer_list): Remove decls.
7100 (add_gpm_wait_descriptor, delete_gpm_wait_descriptor): Declare only
7101 if HAVE_GPM.
7102 * menu.c (menu_items_inuse): Now static unless USE_GTK || USE_MOTIF.
7103 * process.c (add_gpm_wait_descriptor, delete_gpm_wait_descriptor):
7104 Define only if HAVE_GPM.
7105 * widget.c (EmacsFrameResize, emacsFrameClassRec): Now static.
7106 (update_hints_inhibit): Remove; never set. All uses removed.
7107 * widgetprv.h (emacsFrameClassRec): Remove decl.
7108 * window.c (delete_deletable_window): Now returns void, since it
7109 wasn't returning anything.
7110 (compare_window_configurations): Remove unused locals.
7111 * xfns.c (x_set_scroll_bar_default_width): Remove unused locals.
7112 * xmenu.c (x_menu_set_in_use): Define only if USE_GTK || USE_MOTIF.
4475bec4
PE
7113 (dialog_selection_callback) [!USE_GTK]: Prefer intptr_t for integers
7114 the same widths as pointers. This follows up on the 2011-05-06 patch.
7115 * xterm.c (x_alloc_lighter_color_for_widget): Define only if USE_LUCID.
7116 * xterm.h: Likewise.
7117 (x_menu_set_in_use): Declare only if USE_GTK || USE_MOTIF.
7118
1384b89e
JB
71192011-06-12 Juanma Barranquero <lekktu@gmail.com>
7120
7121 * makefile.w32-in: Update dependencies.
7122 (LISP_H): Add lib/intprops.h.
7123
1100a63c
CY
71242011-06-11 Chong Yidong <cyd@stupidchicken.com>
7125
7126 * image.c (gif_load): Add animation frame delay to the metadata.
7127 (syms_of_image): Use DEFSYM. New symbol `delay'.
7128
6198ccd0
MR
71292011-06-11 Martin Rudalics <rudalics@gmx.at>
7130
7131 * window.c (delete_deletable_window): Re-add.
7132 (Fset_window_configuration): Rewrite to handle dead buffers and
7133 consequently deletable windows.
7134 (window_tree, Fwindow_tree): Remove. Supply functionality in
7135 window.el.
7136 (compare_window_configurations): Simplify code.
7137
b6e3633c
AS
71382011-06-11 Andreas Schwab <schwab@linux-m68k.org>
7139
1ab0dee5
AS
7140 * image.c (imagemagick_load_image): Fix type mismatch.
7141 (Fimagemagick_types): Likewise.
7142
b6e3633c
AS
7143 * window.h (replace_buffer_in_windows): Declare.
7144
9397e56f
MR
71452011-06-11 Martin Rudalics <rudalics@gmx.at>
7146
7147 * buffer.c: New Lisp objects Qbuffer_list_update_hook and
7148 Qclone_number. Remove external declaration of Qdelete_window.
7149 (Fbuffer_list): Rewrite doc-string. Minor restructuring of
7150 code.
640c8776
SM
7151 (Fget_buffer_create, Fmake_indirect_buffer, Frename_buffer):
7152 Run Qbuffer_list_update_hook if allowed.
9397e56f
MR
7153 (Fother_buffer): Rewrite doc-string. Major rewrite for new
7154 buffer list implementation.
7155 (other_buffer_safely): New function.
7156 (Fkill_buffer): Replace call to replace_buffer_in_all_windows by
7157 calls to replace_buffer_in_windows and
7158 replace_buffer_in_windows_safely. Run Qbuffer_list_update_hook
7159 if allowed.
7160 (record_buffer): Inhibit quitting and rewrite using quittable
7161 functions. Run Qbuffer_list_update_hook if allowed.
7162 (Frecord_buffer, Funrecord_buffer): New functions.
640c8776
SM
7163 (switch_to_buffer_1, Fswitch_to_buffer): Remove.
7164 Move switch-to-buffer to window.el.
9397e56f
MR
7165 (bury-buffer): Move to window.el.
7166 (Vbuffer_list_update_hook): New variable.
7167
7168 * lisp.h (other_buffer_safely): Add prototype in buffer.c
7169 section.
7170
7171 * window.h (resize_frame_windows): Move up in code.
7172 (Fwindow_frame): Remove EXFUN.
7173 (replace_buffer_in_all_windows): Remove prototype.
7174 (replace_buffer_in_windows_safely): Add prototype.
7175
7176 * window.c: Declare Qdelete_window static again. Move down
7177 declaration of select_count.
7178 (Fnext_window, Fprevious_window): Rewrite doc-strings.
7179 (Fother_window): Move to window.el.
7180 (window_loop): Remove DELETE_BUFFER_WINDOWS and UNSHOW_BUFFER
7181 cases. Add REPLACE_BUFFER_IN_WINDOWS_SAFELY case.
7182 (Fdelete_windows_on, Freplace_buffer_in_windows): Move to
7183 window.el.
7184 (replace_buffer_in_windows): Implement by calling
7185 Qreplace_buffer_in_windows.
7186 (replace_buffer_in_all_windows): Remove with some functionality
7187 moved into replace_buffer_in_windows_safely.
7188 (replace_buffer_in_windows_safely): New function.
7189 (select_window_norecord, select_frame_norecord): Move in front
7190 of run_window_configuration_change_hook. Remove now obsolete
7191 declarations.
640c8776
SM
7192 (Fset_window_buffer): Rewrite doc-string.
7193 Call Qrecord_window_buffer.
9397e56f
MR
7194 (keys_of_window): Move binding for other-window to window.el.
7195
b50691aa
CY
71962011-06-11 Chong Yidong <cyd@stupidchicken.com>
7197
7198 * dispextern.h (struct image): Replace data member, whose int_val
7199 and ptr_val fields were not used by anything, with a single
7200 lisp_val object.
7201
7202 * image.c (Fimage_metadata, make_image, mark_image, tiff_load)
7203 (gif_clear_image, gif_load, imagemagick_load_image)
7204 (gs_clear_image, gs_load): Callers changed.
7205
3f754b86
PE
72062011-06-10 Paul Eggert <eggert@cs.ucla.edu>
7207
cca69397
PE
7208 * buffer.h: Include <time.h>, for time_t.
7209 Needed to build on FreeBSD 8.2. Problem reported by Herbert J. Skuhra.
7210
109e28d0
PE
7211 Fix minor problems found by static checking.
7212
60737f02
PE
7213 * image.c (PixelGetMagickColor): Declare if ImageMagick headers don't.
7214
4b66faf3
PE
7215 Make identifiers static if they are not used in other modules.
7216 * data.c (Qcompiled_function, Qframe, Qvector):
7217 * image.c (QimageMagick, Qsvg):
7218 * minibuf.c (Qmetadata):
7219 * window.c (resize_window_check, resize_root_window): Now static.
7220 * window.h (resize_window_check, resize_root_window): Remove decls.
7221
109e28d0
PE
7222 * window.c (window_deletion_count, delete_deletable_window):
7223 Remove; unused.
46a4ce9e
PE
7224 (window_body_lines): Now static.
7225 (Fdelete_other_windows_internal): Mark vars as initialized.
7226 Make sure 'resize_failed' is initialized.
7227 (run_window_configuration_change_hook): Rename local to avoid shadowing.
7228 (resize_window_apply): Remove unused local.
7229 * window.h (delete_deletable_window): Remove decl.
7230
109e28d0 7231 * image.c (gif_load, svg_load_image): Rename locals to avoid shadowing.
33290528
PE
7232 (imagemagick_load_image): Fix pointer signedness problem by changing
7233 last arg from unsigned char * to char *. All uses changed.
7234 Also, fix a local for similar reasons.
7235 Remove unused locals. Remove locals to avoid shadowing.
7236 (fn_rsvg_handle_free): Remove; unused.
7237 (svg_load, svg_load_image): Fix pointer signedness problem.
f7e13da3 7238 (imagemagick_load_image): Don't use garbage pointer image_wand.
33290528 7239
3f754b86
PE
7240 * ftfont.c (ftfont_get_metrics, ftfont_drive_otf): Remove unused locals.
7241
2547adb1
CY
72422011-06-10 Chong Yidong <cyd@stupidchicken.com>
7243
7244 * image.c (gif_load): Fix omitted cast error introduced by
7245 2011-06-06 change.
7246
2c8e37d4
MR
72472011-06-10 Martin Rudalics <rudalics@gmx.at>
7248
7249 * window.h (resize_proportionally, orig_total_lines)
7250 (orig_top_line): Remove from window structure.
7251 (set_window_height, set_window_width, change_window_heights)
7252 (Fdelete_window): Remove prototypes.
7253 (resize_frame_windows): Remove duplicate declaration.
7254
440a42e3
EZ
72552011-06-10 Eli Zaretskii <eliz@gnu.org>
7256
7257 * window.h (resize_frame_windows, resize_window_check)
7258 (delete_deletable_window, resize_root_window)
7259 (resize_frame_windows): Declare prototypes.
7260
7261 * window.c (resize_window_apply): Make definition be "static" to
7262 match the prototype.
7263
562dd5e9
MR
72642011-06-10 Martin Rudalics <rudalics@gmx.at>
7265
7266 * window.c: Remove declarations of Qwindow_size_fixed,
7267 window_min_size_1, window_min_size_2, window_min_size,
7268 size_window, window_fixed_size_p, enlarge_window, delete_window.
7269 Remove static from declaration of Qdelete_window, it's
7270 temporarily needed by Fbury_buffer.
7271 (replace_window): Don't assign orig_top_line and
7272 orig_total_lines.
7273 (Fdelete_window, delete_window): Remove. Window deletion is
7274 handled by window.el.
640c8776
SM
7275 (window_loop): Remove DELETE_OTHER_WINDOWS case.
7276 Replace Fdelete_window calls with calls to Qdelete_window.
562dd5e9
MR
7277 (Fdelete_other_windows): Remove. Deleting other windows is
7278 handled by window.el.
7279 (window_fixed_size_p): Remove. Fixed-sizeness of windows is
7280 handled in window.el.
7281 (window_min_size_2, window_min_size_1, window_min_size): Remove.
7282 Window minimum sizes are handled in window.el.
7283 (shrink_windows, size_window, set_window_height)
7284 (set_window_width, change_window_heights, window_height)
7285 (window_width, CURBEG, CURSIZE, enlarge_window)
7286 (adjust_window_trailing_edge, Fadjust_window_trailing_edge)
7287 (Fenlarge_window, Fshrink_window): Remove. Window resizing is
7288 handled in window.el.
7289 (make_dummy_parent): Rename to make_parent_window and give it a
7290 second argument horflag.
7291 (make_window): Don't set resize_proportionally any more.
7292 (Fsplit_window): Remove. Windows are split in window.el.
7293 (save_restore_action, save_restore_orig_size)
7294 (shrink_window_lowest_first, save_restore_orig_size): Remove.
7295 Resize mini windows in window.el.
7296 (grow_mini_window, shrink_mini_window): Implement by calling
7297 Qresize_root_window_vertically, resize_window_check and
7298 resize_window_apply.
640c8776
SM
7299 (saved_window, Fset_window_configuration, save_window_save):
7300 Do not handle orig_top_line, orig_total_lines, and
562dd5e9
MR
7301 resize_proportionally.
7302 (window_min_height, window_min_width): Move to window.el.
7303 (keys_of_window): Move bindings for delete-other-windows,
7304 split-window, delete-window and enlarge-window to window.el.
7305
7306 * buffer.c: Temporarily extern Qdelete_window.
7307 (Fbury_buffer): Temporarily call Qdelete_window instead of
7308 Fdelete_window (Fbury_buffer will move to window.el soon).
7309
7310 * frame.c (set_menu_bar_lines_1): Remove code handling
7311 orig_top_line and orig_total_lines.
7312
7313 * dispnew.c (adjust_frame_glyphs_initially): Don't use
7314 set_window_height but set heights directly.
7315 (change_frame_size_1): Use resize_frame_windows.
7316
7317 * xdisp.c (init_xdisp): Don't use set_window_height but set
7318 heights directly.
7319
640c8776
SM
7320 * xfns.c (x_set_menu_bar_lines, x_set_tool_bar_lines):
7321 Use resize_frame_windows instead of change_window_heights and run
562dd5e9
MR
7322 run_window_configuration_change_hook.
7323
7324 * w32fns.c (x_set_tool_bar_lines): Use resize_frame_windows
7325 instead of change_window_heights and run
7326 run_window_configuration_change_hook.
7327
1a13852e
MR
73282011-06-09 Martin Rudalics <rudalics@gmx.at>
7329
7330 * window.c (replace_window): Rename second argument REPLACEMENT to
7331 NEW. New third argument SETFLAG. Rewrite.
7332 (delete_window, make_dummy_parent): Call replace_window with
7333 third argument 1.
7334 (window_list_1): Move down in code.
7335 (run_window_configuration_change_hook): Move set_buffer part
7336 before select_frame_norecord part in order to unwind correctly.
7337 Rename count1 to count.
7338 (recombine_windows, delete_deletable_window, resize_root_window)
7339 (Fdelete_other_windows_internal)
7340 (Frun_window_configuration_change_hook, make_parent_window)
7341 (resize_window_check, resize_window_apply, Fresize_window_apply)
7342 (resize_frame_windows, Fsplit_window_internal)
640c8776
SM
7343 (Fdelete_window_internal, Fresize_mini_window_internal):
7344 New functions.
1a13852e
MR
7345 (syms_of_window): New variables Vwindow_splits and Vwindow_nest.
7346
f3d1777e
MR
73472011-06-08 Martin Rudalics <rudalics@gmx.at>
7348
496e208e
MR
7349 * window.h (window): Add some new members to window structure -
7350 normal_lines, normal_cols, new_total, new_normal, clone_number,
7351 splits, nest, prev_buffers, next_buffers.
7352 (WINDOW_TOTAL_SIZE): Move here from window.c.
b9e809c2 7353 (MIN_SAFE_WINDOW_WIDTH, MIN_SAFE_WINDOW_HEIGHT): Define here.
496e208e 7354
f3d1777e
MR
7355 * window.c (Fwindow_height, Fwindow_width, Fwindow_full_width_p):
7356 Remove.
496e208e
MR
7357 (make_dummy_parent): Set new members of windows structure.
7358 (make_window): Move down in code. Handle new members of window
7359 structure.
7360 (Fwindow_clone_number, Fwindow_splits, Fset_window_splits)
7361 (Fwindow_nest, Fset_window_nest, Fwindow_new_total)
7362 (Fwindow_normal_size, Fwindow_new_normal, Fwindow_prev_buffers)
7363 (Fset_window_prev_buffers, Fwindow_next_buffers)
640c8776
SM
7364 (Fset_window_next_buffers, Fset_window_clone_number):
7365 New functions.
496e208e
MR
7366 (Fwindow_hscroll, Fwindow_at, Fwindow_point, Fwindow_start)
7367 (Fwindow_end, Fwindow_line_height, Fset_window_dedicated_p):
7368 Doc-string fixes.
7369 (Fwindow_parameters, Fwindow_parameter, Fset_window_parameter):
7370 Argument WINDOW can be now internal window too.
7371 (Fwindow_use_time): Move up in code.
7372 (Fget_buffer_window): Rename argument FRAME to ALL-FRAMES.
7373 Rewrite doc-string.
7374 (Fset_window_configuration, saved_window)
7375 (Fcurrent_window_configuration, save_window_save): Handle new
7376 members of window structure.
b9e809c2
MR
7377 (WINDOW_TOTAL_SIZE, MIN_SAFE_WINDOW_WIDTH)
7378 (MIN_SAFE_WINDOW_HEIGHT): Move to window.h.
7379 (syms_of_window): New Lisp objects Qrecord_window_buffer,
7380 Qwindow_deletable_p, Qdelete_window, Qreplace_buffer_in_windows,
7381 Qget_mru_window, Qresize_root_window,
7382 Qresize_root_window_vertically, Qsafe, Qabove, Qbelow,
7383 Qauto_buffer_name; staticpro them.
f3d1777e 7384
abde8f8c
MR
73852011-06-07 Martin Rudalics <rudalics@gmx.at>
7386
7387 * window.c (Fwindow_total_size, Fwindow_left_column)
7388 (Fwindow_top_line, window_body_lines, Fwindow_body_size)
7389 (Fwindow_list_1): New functions.
7390 (window_box_text_cols): Replace with window_body_cols.
640c8776
SM
7391 (Fwindow_width, Fscroll_left, Fscroll_right):
7392 Use window_body_cols instead of window_box_text_cols.
7393 (delete_window, Fset_window_configuration):
7394 Call delete_all_subwindows with window as argument.
fa8a67e6
MR
7395 (delete_all_subwindows): Take a window as argument and not a
7396 structure. Rewrite.
190b47e6
MR
7397 (window_loop): Remove handling of GET_LRU_WINDOW and
7398 GET_LARGEST_WINDOW.
7399 (Fget_lru_window, Fget_largest_window): Move to window.el.
abde8f8c
MR
7400
7401 * window.h: Extern window_body_cols instead of
fa8a67e6
MR
7402 window_box_text_cols. delete_all_subwindows now takes a
7403 Lisp_Object as argument.
abde8f8c 7404
640c8776
SM
7405 * indent.c (compute_motion, Fcompute_motion):
7406 Use window_body_cols instead of window_box_text_cols.
abde8f8c 7407
fa8a67e6
MR
7408 * frame.c (delete_frame): Call delete_all_subwindows with root
7409 window as argument.
7410
a54e3482
DC
74112011-06-07 Daniel Colascione <dan.colascione@gmail.com>
7412
7413 * fns.c (Fputhash): Document return value.
7414
60002bf5
CY
74152011-06-06 Chong Yidong <cyd@stupidchicken.com>
7416
7417 * image.c (gif_load): Implement gif89a spec "no disposal" method.
7418
0c671da6 74192011-06-06 Paul Eggert <eggert@cs.ucla.edu>
ccd9a01a 7420
b862a52a 7421 Cons<->int and similar integer overflow fixes (Bug#8794).
77984278 7422
be44ca6c
PE
7423 Check for overflow when converting integer to cons and back.
7424 * charset.c (Fdefine_charset_internal, Fdecode_char):
7425 Use cons_to_unsigned to catch overflow.
7426 (Fencode_char): Use INTEGER_TO_CONS.
7427 * composite.h (LGLYPH_CODE): Use cons_to_unsigned.
7428 (LGLYPH_SET_CODE): Use INTEGER_TO_CONS.
7429 * data.c (long_to_cons, cons_to_long): Remove.
7430 (cons_to_unsigned, cons_to_signed): New functions.
7431 These signal an error for invalid or out-of-range values.
7432 * dired.c (Ffile_attributes): Use INTEGER_TO_CONS.
7433 * fileio.c (Fset_visited_file_modtime): Use CONS_TO_INTEGER.
7434 * font.c (Ffont_variation_glyphs):
7435 * fontset.c (Finternal_char_font): Use INTEGER_TO_CONS.
7436 * lisp.h: Include <intprops.h>.
7437 (INTEGER_TO_CONS, CONS_TO_INTEGER): New macros.
7438 (cons_to_signed, cons_to_unsigned): New decls.
7439 (long_to_cons, cons_to_long): Remove decls.
7440 * undo.c (record_first_change): Use INTEGER_TO_CONS.
7441 (Fprimitive_undo): Use CONS_TO_INTEGER.
7442 * xfns.c (Fx_window_property): Likewise.
7443 * xselect.c: Include <limits.h>.
7444 (x_own_selection, selection_data_to_lisp_data):
7445 Use INTEGER_TO_CONS.
7446 (x_handle_selection_request, x_handle_selection_clear)
7447 (x_get_foreign_selection, Fx_disown_selection_internal)
7448 (Fx_get_atom_name, x_send_client_event): Use CONS_TO_INTEGER.
7449 (lisp_data_to_selection_data): Use cons_to_unsigned.
7450 (x_fill_property_data): Use cons_to_signed.
7451 Report values out of range.
7452
d1f3d2af
PE
7453 Check for buffer and string overflow more precisely.
7454 * buffer.h (BUF_BYTES_MAX): New macro.
7455 * lisp.h (STRING_BYTES_MAX): New macro.
7456 * alloc.c (Fmake_string):
7457 * character.c (string_escape_byte8):
7458 * coding.c (coding_alloc_by_realloc):
7459 * doprnt.c (doprnt):
7460 * editfns.c (Fformat):
7461 * eval.c (verror):
7462 Use STRING_BYTES_MAX, not MOST_POSITIVE_FIXNUM,
7463 since they may not be the same number.
7464 * editfns.c (Finsert_char):
7465 * fileio.c (Finsert_file_contents):
7466 Likewise for BUF_BYTES_MAX.
7467
dd52fcea
PE
7468 * image.c: Use ptrdiff_t, not int, for sizes.
7469 (slurp_file): Switch from int to ptrdiff_t.
7470 All uses changed.
7471 (slurp_file): Check that file size fits in both size_t (for
7472 malloc) and ptrdiff_t (for sanity and safety).
7473
7f9bbdbb
PE
7474 * fileio.c (Fverify_visited_file_modtime): Avoid time overflow
7475 if b->modtime has its maximal value.
7476
dfe18f82
PE
7477 * dired.c (Ffile_attributes): Don't assume EMACS_INT has >32 bits.
7478
84acfcf0
PE
7479 Don't assume time_t can fit into int.
7480 * buffer.h (struct buffer.modtime): Now time_t, not int.
7481 * fileio.c (Fvisited_file_modtime): No need for time_t cast now.
7482 * undo.c (Fprimitive_undo): Use time_t, not int, for time_t value.
7483
ccd9a01a
PE
7484 Minor fixes for signed vs unsigned integers.
7485 * character.h (MAYBE_UNIFY_CHAR):
7486 * charset.c (maybe_unify_char):
7487 * keyboard.c (read_char, reorder_modifiers):
7488 XINT -> XFASTINT, since the integer must be nonnegative.
7489 * ftfont.c (ftfont_spec_pattern):
7490 * keymap.c (access_keymap, silly_event_symbol_error):
7491 XUINT -> XFASTINT, since the integer must be nonnegative.
7492 (Fsingle_key_description, preferred_sequence_p): XUINT -> XINT,
7493 since it makes no difference and we prefer signed.
7494 * keyboard.c (record_char): Use XUINT when all the neighbors do.
7495 (access_keymap): NATNUMP -> INTEGERP, since the integer must be
7496 nonnegative.
7497
d6d100dd
SM
74982011-06-06 Stefan Monnier <monnier@iro.umontreal.ca>
7499
7500 * window.h (Fwindow_frame): Declare.
7501
2b6148e4
PE
75022011-06-06 Paul Eggert <eggert@cs.ucla.edu>
7503
7504 * alloc.c: Simplify handling of large-request failures (Bug#8800).
7505 (SPARE_MEMORY): Always define.
7506 (LARGE_REQUEST): Remove.
7507 (memory_full): Use SPARE_MEMORY rather than LARGE_REQUEST.
7508
f230ecc9
MR
75092011-06-06 Martin Rudalics <rudalics@gmx.at>
7510
727e958e
MR
7511 * lisp.h: Move EXFUNS for Fframe_root_window,
7512 Fframe_first_window and Fset_frame_selected_window to window.h.
7513
7514 * window.h: Move EXFUNS for Fframe_root_window,
7515 Fframe_first_window and Fset_frame_selected_window here from
7516 lisp.h.
7517
7518 * frame.c (Fwindow_frame, Fframe_first_window)
7519 (Fframe_root_window, Fframe_selected_window)
7520 (Fset_frame_selected_window): Move to window.c.
7521 (Factive_minibuffer_window): Move to minibuf.c.
7522 (Fother_visible_frames_p): New function.
7523
7524 * minibuf.c (Factive_minibuffer_window): Move here from frame.c.
7525
f230ecc9
MR
7526 * window.c (decode_window, decode_any_window): Move up in code.
7527 (Fwindowp, Fwindow_live_p): Rewrite doc-strings.
7528 (inhibit_frame_unsplittable): Remove unused variable.
bf60a96b
MR
7529 (Fwindow_buffer): Move up and rewrite doc-string.
7530 (Fwindow_parent, Fwindow_vchild, Fwindow_hchild, Fwindow_next)
7531 (Fwindow_prev): New functions.
727e958e
MR
7532 (Fwindow_frame): Move here from frame.c. Accept any window as
7533 argument.
7534 (Fframe_root_window, Fframe_first_window)
7535 (Fframe_selected_window): Move here from frame.c. Accept frame
7536 or arbitrary window as argument. Update doc-strings.
7537 (Fminibuffer_window): Move up in code.
7538 (Fwindow_minibuffer_p): Move up in code and simplify.
d6d100dd
SM
7539 (Fset_frame_selected_window): Move here from frame.c.
7540 Marginal rewrite.
727e958e
MR
7541 (Fselected_window, select_window, Fselect_window): Move up in
7542 code. Minor doc-string fixes.
f230ecc9 7543
4d09bcf6
PE
75442011-06-06 Paul Eggert <eggert@cs.ucla.edu>
7545
7546 * alloc.c (memory_full) [SYSTEM_MALLOC]: Port to MacOS (Bug#8800).
7547 Do not assume that spare memory exists; that assumption is valid
7548 only if SYSTEM_MALLOC.
7549 (LARGE_REQUEST): New macro, so that the issue of large requests
7550 is separated from the issue of spare memory.
7551
810928a2
AS
75522011-06-05 Andreas Schwab <schwab@linux-m68k.org>
7553
172418ad
AS
7554 * editfns.c (Fformat): Correctly handle zero flag with hexadecimal
7555 format. (Bug#8806)
7556
43f862f7
AS
7557 * gtkutil.c (xg_get_default_scrollbar_width): Avoid warning.
7558
810928a2
AS
7559 * xfns.c (x_set_scroll_bar_default_width): Move declarations
7560 before statements.
7561
a059fe24
JD
75622011-06-05 Jan Djärv <jan.h.d@swipnet.se>
7563
7564 * gtkutil.c (xg_get_default_scrollbar_width): New function.
7565
7566 * gtkutil.h: Declare xg_get_default_scrollbar_width.
7567
7568 * xfns.c (x_set_scroll_bar_default_width): If USE_GTK, get
7569 min width by calling x_set_scroll_bar_default_width (Bug#8505).
7570
989bf368
JB
75712011-06-05 Juanma Barranquero <lekktu@gmail.com>
7572
7573 * xdisp.c (single_display_spec_intangible_p): Remove declaration.
7574
4b80f674
CY
75752011-06-04 Chong Yidong <cyd@stupidchicken.com>
7576
7577 * xselect.c (x_clipboard_manager_save): Remove redundant arg.
7578 (x_clipboard_manager_save): Add return value.
d6d100dd
SM
7579 (x_clipboard_manager_error_1, x_clipboard_manager_error_2):
7580 New error handlers.
4b80f674
CY
7581 (x_clipboard_manager_save_frame, x_clipboard_manager_save_all):
7582 Obey Vx_select_enable_clipboard_manager. Catch errors in
7583 x_clipboard_manager_save (Bug#8779).
7584 (Vx_select_enable_clipboard_manager): New variable.
de65b42c 7585 (x_get_foreign_selection): Reduce scope of x_catch_errors (Bug#8790).
4b80f674 7586
99a33b77 75872011-06-04 Dan Nicolaescu <dann@ics.uci.edu>
8b3115e7
DN
7588
7589 * emacs.c (main): Warn when starting a GTK emacs in daemon mode.
7590
99a33b77 75912011-06-04 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
14eca62f
YM
7592
7593 * fringe.c (update_window_fringes): Don't update overlay arrow bitmap
7594 in the current matrix if keep_current_p is non-zero.
7595
8264569d
EZ
75962011-06-04 Eli Zaretskii <eliz@gnu.org>
7597
7598 * bidi.c (bidi_level_of_next_char): Fix last change.
7599
57f97249
EZ
76002011-06-03 Eli Zaretskii <eliz@gnu.org>
7601
fec2107c 7602 Support bidi reordering of text covered by display properties.
57f97249 7603
fec2107c
EZ
7604 * bidi.c (bidi_copy_it): Use offsetof instead of emulating it.
7605 (bidi_fetch_char, bidi_fetch_char_advance): New functions.
7606 (bidi_cache_search, bidi_cache_iterator_state)
7607 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak)
d6d100dd
SM
7608 (bidi_level_of_next_char, bidi_move_to_visually_next):
7609 Support character positions inside a run of characters covered by a
fec2107c
EZ
7610 display string.
7611 (bidi_paragraph_init, bidi_resolve_explicit_1)
7612 (bidi_level_of_next_char): Call bidi_fetch_char and
7613 bidi_fetch_char_advance instead of FETCH_CHAR and
7614 FETCH_CHAR_ADVANCE.
7615 (bidi_init_it): Initialize new members.
7616 (LRE_CHAR, RLE_CHAR, PDF_CHAR, LRO_CHAR, RLO_CHAR): Remove macro
7617 definitions.
7618 (bidi_explicit_dir_char): Lookup character type in bidi_type_table,
7619 instead of using explicit *_CHAR codes.
d6d100dd
SM
7620 (bidi_resolve_explicit, bidi_resolve_weak):
7621 Use FETCH_MULTIBYTE_CHAR instead of FETCH_CHAR, as reordering of
fec2107c
EZ
7622 bidirectional text is supported only in multibyte buffers.
7623 (bidi_init_it): Accept additional argument FRAME_WINDOW_P and use
7624 it to initialize the frame_window_p member of struct bidi_it.
7625 (bidi_cache_iterator_state, bidi_resolve_explicit_1)
7626 (bidi_resolve_explicit, bidi_resolve_weak)
7627 (bidi_level_of_next_char, bidi_move_to_visually_next): Abort if
7628 bidi_it->nchars is non-positive.
7629 (bidi_level_of_next_char): Don't try to lookup the cache for the
7630 next/previous character if nothing is cached there yet, or if we
7631 were just reseat()'ed to a new position.
c40e2fb2 7632
0e14fe90
EZ
7633 * xdisp.c (set_cursor_from_row): Set start and stop points
7634 according to the row's direction when priming the loop that looks
7635 for the glyph on which to display cursor.
7636 (single_display_spec_intangible_p): Function deleted.
7637 (display_prop_intangible_p): Reimplement to call
7638 handle_display_spec instead of single_display_spec_intangible_p.
d6d100dd
SM
7639 Accept 3 additional arguments needed by handle_display_spec.
7640 This fixes incorrect cursor motion across display property with complex
0e14fe90
EZ
7641 values: lists, `(when COND...)' forms, etc.
7642 (single_display_spec_string_p): Support property values that are
7643 lists with the argument STRING its top-level element.
7644 (display_prop_string_p): Fix the condition for processing a
7645 property that is a list to be consistent with handle_display_spec.
fec2107c 7646 (handle_display_spec): New function, refactored from the
fc6f18ce
EZ
7647 last portion of handle_display_prop.
7648 (compute_display_string_pos): Accept additional argument
7649 FRAME_WINDOW_P. Call handle_display_spec to determine whether the
7650 value of a `display' property is a "replacing spec".
7651 (handle_single_display_spec): Accept 2 additional arguments BUFPOS
7652 and FRAME_WINDOW_P. If IT is NULL, don't set up the iterator from
7653 the display property, but just return a value indicating whether
7654 the display property will replace the characters it covers.
7655 (Fcurrent_bidi_paragraph_direction): Initialize the nchars and
7656 frame_window_p members of struct bidi_it.
d6d100dd
SM
7657 (compute_display_string_pos, compute_display_string_end):
7658 New functions.
fec2107c
EZ
7659 (push_it): Accept second argument POSITION, where pop_it should
7660 jump to continue iteration.
7661 (reseat_1): Initialize bidi_it.disp_pos.
fc6f18ce 7662
fec2107c
EZ
7663 * keyboard.c (adjust_point_for_property): Adjust the call to
7664 display_prop_intangible_p to its new signature.
fc6f18ce
EZ
7665
7666 * dispextern.h (struct bidi_it): New member frame_window_p.
fec2107c
EZ
7667 (bidi_init_it): Update prototypes.
7668 (display_prop_intangible_p): Update prototype.
d6d100dd
SM
7669 (compute_display_string_pos, compute_display_string_end):
7670 Declare prototypes.
fec2107c
EZ
7671 (struct bidi_it): New members nchars and disp_pos. ch_len is now
7672 EMACS_INT.
fc6f18ce 7673
40087514 76742011-06-02 Paul Eggert <eggert@cs.ucla.edu>
0de4bb68 7675
57f53182
PE
7676 Malloc failure behavior now depends on size of allocation.
7677 * alloc.c (buffer_memory_full, memory_full): New arg NBYTES.
7678 * lisp.h: Change signatures accordingly.
7679 * alloc.c, buffer.c, editfns.c, menu.c, minibuf.c, xterm.c:
7680 All callers changed. (Bug#8762)
7681
7682 * gnutls.c: Use Emacs's memory allocators.
7683 Without this change, the gnutls library would invoke malloc etc.
7684 directly, which causes problems on non-SYNC_INPUT hosts, and which
7685 runs afoul of improving memory_full behavior. (Bug#8761)
7686 (fn_gnutls_global_set_mem_functions): New macro or function pointer.
7687 (emacs_gnutls_global_init): Use it to specify xmalloc, xrealloc,
7688 xfree instead of the default malloc, realloc, free.
7689 (Fgnutls_boot): No need to check for memory allocation failure,
7690 since xmalloc does that for us.
7691
ac32cd99 7692 Remove arbitrary limit of 2**31 entries in hash tables. (Bug#8771)
3870d916
PE
7693 * category.c (hash_get_category_set):
7694 * ccl.c (ccl_driver):
7695 * charset.c (Fdefine_charset_internal):
7696 * charset.h (struct charset.hash_index):
7697 * composite.c (get_composition_id, gstring_lookup_cache)
7698 (composition_gstring_put_cache):
7699 * composite.h (struct composition.hash_index):
7700 * dispextern.h (struct image.hash):
7701 * fns.c (next_almost_prime, larger_vector, cmpfn_eql)
7702 (cmpfn_equal, cmpfn_user_defined, hashfn_eq, hashfn_eql)
7703 (hashfn_equal, hashfn_user_defined, make_hash_table)
7704 (maybe_resize_hash_table, hash_lookup, hash_put)
7705 (hash_remove_from_table, hash_clear, sweep_weak_table, SXHASH_COMBINE)
7706 (sxhash_string, sxhash_list, sxhash_vector, sxhash_bool_vector)
7707 (Fsxhash, Fgethash, Fputhash, Fmaphash):
7708 * image.c (make_image, search_image_cache, lookup_image)
7709 (xpm_put_color_table_h):
7710 * lisp.h (struct Lisp_Hash_Table):
0de4bb68 7711 * minibuf.c (Ftry_completion, Fall_completions, Ftest_completion):
ac389d0c 7712 * print.c (print): Use 'EMACS_UINT' and 'EMACS_INT'
3870d916 7713 for hashes and hash indexes, instead of 'unsigned' and 'int'.
40087514
PE
7714 * alloc.c (allocate_vectorlike):
7715 Check for overflow in vector size calculations.
7716 * ccl.c (ccl_driver):
7717 Check for overflow when converting EMACS_INT to int.
0de4bb68
PE
7718 * fns.c, image.c: Remove unnecessary static decls that would otherwise
7719 need to be updated by these changes.
40087514
PE
7720 * fns.c (make_hash_table, maybe_resize_hash_table):
7721 Check for integer overflow with large hash tables.
0de4bb68
PE
7722 (make_hash_table, maybe_resize_hash_table, Fmake_hash_table):
7723 Prefer the faster XFLOAT_DATA to XFLOATINT where either will do.
7724 (SXHASH_REDUCE): New macro.
7725 (sxhash_string, sxhash_list, sxhash_vector, sxhash_bool_vector):
7726 Use it instead of discarding useful hash info with large hash values.
7727 (sxhash_float): New function.
7728 (sxhash): Use it. No more need for "& INTMASK" due to above changes.
7729 * lisp.h (FIXNUM_BITS): New macro, useful for SXHASH_REDUCE etc.
40087514
PE
7730 (MOST_NEGATIVE_FIXNUM, MOST_POSITIVE_FIXNUM, INTMASK):
7731 Rewrite to use FIXNUM_BITS, as this simplifies things.
0de4bb68
PE
7732 (next_almost_prime, larger_vector, sxhash, hash_lookup, hash_put):
7733 Adjust signatures to match updated version of code.
7734 (consing_since_gc): Now EMACS_INT, since a single hash table can
7735 use more than INT_MAX bytes.
7736
698d32e2
DN
77372011-06-01 Dan Nicolaescu <dann@ics.uci.edu>
7738
7739 Make it possible to build with GCC-4.6+ -O2 -flto.
7740
7741 * emacs.c (__malloc_initialize_hook): Mark as EXTERNALLY_VISIBLE.
7742
fd6fa53f
SM
77432011-06-01 Stefan Monnier <monnier@iro.umontreal.ca>
7744
7745 * minibuf.c (get_minibuffer, read_minibuf_unwind):
7746 Call minibuffer-inactive-mode.
7747
864db017
JB
77482011-05-31 Juanma Barranquero <lekktu@gmail.com>
7749
7750 * makefile.w32-in ($(BLD)/data.$(O), $(BLD)/editfns.$(O)):
7751 Update dependencies.
7752
2ad0baf4
DN
77532011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
7754
7755 * data.c (init_data): Remove code for UTS, this system is not
7756 supported anymore.
7757
4fcc2638
DN
77582011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
7759
7760 Don't force ./temacs to start in terminal mode.
7761
7762 * frame.c (make_initial_frame): Initialize faces in all cases, not
7763 only when CANNOT_DUMP is defined.
7764 * dispnew.c (init_display): Remove CANNOT_DUMP condition.
7765
c56e0fd5
DN
77662011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
7767
7768 * dispnew.c (add_window_display_history): Use const for the string
7769 pointer. Remove declaration, not needed.
7770
333d54da 77712011-05-31 Paul Eggert <eggert@cs.ucla.edu>
9cf9f756 7772
55d4c1b2 7773 Use 'inline', not 'INLINE'.
333d54da 7774 <http://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00914.html>
55d4c1b2
PE
7775 * alloc.c, fontset.c (INLINE): Remove.
7776 * alloc.c, bidi.c, charset.c, coding.c, dispnew.c, fns.c, image.c:
7777 * intervals.c, keyboard.c, process.c, syntax.c, textprop.c, w32term.c:
7778 * xdisp.c, xfaces.c, xterm.c: Replace all uses of INLINE with inline.
7779 * gmalloc.c (register_heapinfo): Use inline unconditionally.
7780 * lisp.h (LISP_MAKE_RVALUE): Use inline, not __inline__.
7781
738db178
DN
77822011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
7783
7784 Make it possible to run ./temacs.
7785
7786 * callproc.c (set_initial_environment): Remove CANNOT_DUMP code,
7787 syms_of_callproc does the same thing. Remove test for
7788 "initialized", do it in the caller.
7789 * emacs.c (main): Avoid calling set_initial_environment when dumping.
7790
620c53a6
SM
77912011-05-31 Stefan Monnier <monnier@iro.umontreal.ca>
7792
7793 * minibuf.c (Finternal_complete_buffer): Return `category' metadata.
7794 (read_minibuf): Use get_minibuffer.
7795 (syms_of_minibuf): Use DEFSYM.
7796 (Qmetadata): New var.
7797 * data.c (Qbuffer): Don't make it static.
7798 (syms_of_data): Use DEFSYM.
7799
e003a292
PE
78002011-05-31 Paul Eggert <eggert@cs.ucla.edu>
7801
7802 * ccl.c (CCL_CODE_RANGE): Allow negative numbers. (Bug#8751)
7803 (CCL_CODE_MIN): New macro.
7804
ed008a6d
PE
78052011-05-30 Paul Eggert <eggert@cs.ucla.edu>
7806
3687c2ef
PE
7807 * alloc.c (lisp_align_malloc): Omit unnecessary val==NULL tests.
7808
ed008a6d
PE
7809 * eval.c (Qdebug): Now static.
7810 * lisp.h (Qdebug): Remove decl. This reverts a part of the
7811 2011-04-26T11:26:05Z!dan.colascione@gmail.com that inadvertently undid part of
7812 2011-04-14T06:48:41Z!eggert@cs.ucla.edu.
7813
d66c4c7c
CY
78142011-05-29 Chong Yidong <cyd@stupidchicken.com>
7815
7816 * image.c: Various fixes to ImageMagick code comments.
7817 (Fimagemagick_types): Doc fix.
7818
5fbc2025
PE
78192011-05-29 Paul Eggert <eggert@cs.ucla.edu>
7820
0196f88a
PE
7821 Minor fixes prompted by GCC 4.6.0 warnings.
7822
7823 * xselect.c (converted_selections, conversion_fail_tag): Now static.
7824
5fbc2025
PE
7825 * emacs.c [HAVE_X_WINDOWS]: Include "xterm.h".
7826 (x_clipboard_manager_save_all): Move extern decl to ...
7827 * xterm.h: ... here, so that it can be checked for consistency.
7828
1dd3c2d9
CY
78292011-05-29 Chong Yidong <cyd@stupidchicken.com>
7830
7831 * xselect.c (x_clipboard_manager_save_frame)
7832 (x_clipboard_manager_save_all): New functions.
7833 (Fx_clipboard_manager_save): Lisp function deleted.
7834
7835 * emacs.c (Fkill_emacs): Call x_clipboard_manager_save_all.
7836 * frame.c (delete_frame): Call x_clipboard_manager_save_frame.
7837
7838 * xterm.h: Update prototype.
7839
5ba6571d
WX
78402011-05-28 William Xu <william.xwl@gmail.com>
7841
7842 * nsterm.m (ns_term_shutdown): Synchronize user defaults before
7843 exiting (Bug#8239).
7844
3eaff834
JM
78452011-05-28 Jim Meyering <meyering@redhat.com>
7846
e1900994 7847 Avoid a sign-extension bug in crypto_hash_function.
3eaff834
JM
7848 * fns.c (to_uchar): Define.
7849 (crypto_hash_function): Use it to convert some newly-signed
7850 variables to unsigned, to avoid sign-extension bugs. For example,
7851 without this change, (md5 "truc") would evaluate to
7852 45723a2aff78ff4fff7fff1114760e62 rather than the expected
7853 45723a2af3788c4ff17f8d1114760e62. Reported by Antoine Levitt in
e1900994 7854 https://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00883.html.
3eaff834 7855
0f6990a7
PE
78562011-05-27 Paul Eggert <eggert@cs.ucla.edu>
7857
7858 Integer overflow fixes.
c8a9ca5a 7859
08686060
PE
7860 * dbusbind.c: Serial number integer overflow fixes.
7861 (CHECK_DBUS_SERIAL_GET_SERIAL): New macro.
08686060
PE
7862 (Fdbus_call_method_asynchronously, xd_read_message_1): Use a float
7863 to hold a serial number that is too large for a fixnum.
7864 (Fdbus_method_return_internal, Fdbus_method_error_internal):
7865 Check for serial numbers out of range. Decode any serial number
59568bf0 7866 that was so large that it became a float. (Bug#8722)
08686060 7867
2d1fc3c7
PE
7868 * dbusbind.c: Use XFASTINT rather than XUINT, and check for nonneg.
7869 (Fdbus_call_method, Fdbus_call_method_asynchronously):
7870 Use XFASTINT rather than XUINT when numbers are nonnegative.
7871 (xd_append_arg, Fdbus_method_return_internal):
7872 (Fdbus_method_error_internal): Likewise. Also, for unsigned
7873 arguments, check that Lisp number is nonnegative, rather than
59568bf0 7874 silently wrapping negative numbers around. (Bug#8722)
30217ff0 7875 (xd_read_message_1): Don't assume dbus_uint32_t can fit in int.
59568bf0 7876 (Bug#8722)
2d1fc3c7 7877
c8a9ca5a
PE
7878 * data.c (arith_driver, Flsh): Avoid unnecessary casts to EMACS_UINT.
7879
519e1d69
PE
7880 * ccl.c (ccl_driver): Redo slightly to avoid the need for 'unsigned'.
7881
6df6ae42 7882 ccl: Add integer overflow checks.
30569699
PE
7883 * ccl.c (CCL_CODE_MAX, GET_CCL_RANGE, GET_CCL_CODE, GET_CCL_INT):
7884 (IN_INT_RANGE): New macros.
7885 (ccl_driver): Use them to check for integer overflow when
7886 decoding a CCL program. Many of the new checks are whether XINT (x)
7887 fits in int; it doesn't always, on 64-bit hosts. The new version
7888 doesn't catch all possible integer overflows, but it's an
847044ea 7889 improvement. (Bug#8719)
30569699 7890
c11285dc
PE
7891 * alloc.c (make_event_array): Use XINT, not XUINT.
7892 There's no need for unsigned here.
7893
fdccd48e
PE
7894 * mem-limits.h (EXCEEDS_LISP_PTR) [!USE_LSB_TAG]: EMACS_UINT -> uintptr_t
7895 This follows up to the 2011-05-06 change that substituted uintptr_t
7896 for EMACS_INT. This case wasn't caught back then.
7897
37910ab2
PE
7898 Rework Fformat to avoid integer overflow issues.
7899 * editfns.c: Include <float.h> unconditionally, as it's everywhere
7900 now (part of C89). Include <verify.h>.
7901 (MAX_10_EXP, CONVERTED_BYTE_SIZE): Remove; no longer needed.
7902 (pWIDE, pWIDElen, signed_wide, unsigned_wide): New defns.
7903 (Fformat): Avoid the prepass trying to compute sizes; it was only
7904 approximate and thus did not catch overflow reliably. Instead, walk
7905 through the format just once, formatting and computing sizes as we go,
7906 checking for integer overflow at every step, and allocating a larger
7907 buffer as needed. Keep track separately whether the format is
7908 multibyte. Keep only the most-recently calculated precision, rather
7909 than them all. Record whether each argument has been converted to
7910 string. Use EMACS_INT, not int, for byte and char and arg counts.
7911 Support field widths and precisions larger than INT_MAX. Avoid
7912 sprintf's undefined behavior with conversion specifications such as %#d
7913 and %.0c. Fix bug with strchr succeeding on '\0' when looking for
7914 flags. Fix bug with (format "%c" 256.0). Avoid integer overflow when
7915 formatting out-of-range floating point numbers with int
9173deec 7916 formats. (Bug#8668)
37910ab2 7917
2e6578fb
PE
7918 * lisp.h (FIXNUM_OVERFLOW_P): Work even if arg is a NaN.
7919
0ae6bdee
PE
7920 * data.c: Avoid integer truncation in expressions involving floats.
7921 * data.c: Include <intprops.h>.
7922 (arith_driver): When there's an integer overflow in an expression
7923 involving floating point, convert the integers to floating point
7924 so that the resulting value does not suffer from catastrophic
7925 integer truncation. For example, on a 64-bit host (* 4
7926 most-negative-fixnum 0.5) should yield about -4.6e+18, not zero.
7927 Do not rely on undefined behavior after integer overflow.
7928
de883a70
PE
7929 merge count_size_as_multibyte, parse_str_to_multibyte
7930 * character.c, character.h (count_size_as_multibyte):
fd6fa53f 7931 Rename from parse_str_to_multibyte; all uses changed.
de883a70
PE
7932 Check for integer overflow.
7933 * insdel.c, lisp.h (count_size_as_multibyte): Remove,
7934 since it's now a duplicate of the other. This is more of
7935 a character than a buffer op, so better that it's in character.c.
7936 * fns.c, print.c: Adjust to above changes.
7937
2ff916cb
PE
79382011-05-27 Stefan Monnier <monnier@iro.umontreal.ca>
7939
7940 * xselect.c (x_convert_selection): Yet another int/Lisp_Object mixup.
7941
f1b54466
PE
79422011-05-27 Paul Eggert <eggert@cs.ucla.edu>
7943
fb1ac845
PE
7944 * xselect.c: Fix minor problems prompted by GCC 4.6.0 warnings.
7945 (x_handle_selection_request, frame_for_x_selection): Remove unused vars.
7946 (x_clipboard_manager_save): Now static.
7947 (Fx_clipboard_manager_save): Rename local to avoid shadowing.
7948
f1b54466
PE
7949 * fns.c: Fix minor problems prompted by GCC 4.6.0 warnings.
7950 (crypto_hash_function): Now static.
7951 Fix pointer signedness problems. Avoid unnecessary initializations.
7952
a9f737ee
CY
79532011-05-27 Chong Yidong <cyd@stupidchicken.com>
7954
7955 * termhooks.h (Vselection_alist): Make it terminal-local.
7956
7957 * terminal.c (create_terminal): Initialize it.
7958
7959 * xselect.c: Support for clipboard managers.
7960 (Vselection_alist): Move to termhooks.h as terminal-local var.
7961 (LOCAL_SELECTION): New macro.
7962 (x_atom_to_symbol): Handle x_display_info_for_display fail case.
7963 (symbol_to_x_atom): Remove gratuitous arg.
7964 (x_handle_selection_request, lisp_data_to_selection_data)
7965 (x_get_foreign_selection, Fx_register_dnd_atom): Callers changed.
620c53a6
SM
7966 (x_own_selection, x_get_local_selection, x_convert_selection):
7967 New arg, specifying work frame. Use terminal-local Vselection_alist.
a9f737ee
CY
7968 (some_frame_on_display): Delete unused function.
7969 (Fx_own_selection_internal, Fx_get_selection_internal)
7970 (Fx_disown_selection_internal, Fx_selection_owner_p)
7971 (Fx_selection_exists_p): New optional frame arg.
7972 (frame_for_x_selection, Fx_clipboard_manager_save): New functions.
7973 (x_handle_selection_clear): Don't treat other terminals with the
7974 same keyboard specially. Use the terminal-local Vselection_alist.
7975 (x_clear_frame_selections): Use Frun_hook_with_args.
7976
7977 * xterm.c (x_term_init): Intern ATOM and CLIPBOARD_MANAGER atoms.
7978
7979 * xterm.h: Add support for those atoms.
7980
e067f0c1
CY
79812011-05-26 Chong Yidong <cyd@stupidchicken.com>
7982
7983 * xselect.c: ICCCM-compliant handling of MULTIPLE targets.
7984 (converted_selections, conversion_fail_tag): New global variables.
7985 (x_selection_request_lisp_error): Free the above.
7986 (x_get_local_selection): Remove unnecessary code.
7987 (x_reply_selection_request): Args changed; handle arbitrary array
620c53a6
SM
7988 of converted selections stored in converted_selections.
7989 Separate the XChangeProperty and SelectionNotify steps.
e067f0c1
CY
7990 (x_handle_selection_request): Rewrite to handle MULTIPLE target.
7991 (x_convert_selection): New function.
7992 (x_handle_selection_event): Simplify.
7993 (x_get_foreign_selection): Don't ignore incoming requests while
7994 waiting for an answer; this will fail when we implement
7995 SAVE_TARGETS, and seems unnecessary anyway.
7996 (selection_data_to_lisp_data): Recognize ATOM_PAIR type.
7997 (Vx_sent_selection_functions): Doc fix.
7998
0f4aebc0
LL
79992011-05-26 Leo Liu <sdl.web@gmail.com>
8000
8001 * editfns.c (Ftranspose_regions): Allow empty regions. (Bug#8699)
8002
e61124cd
YM
80032011-05-25 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
8004
8005 * dispextern.h (struct glyph_row): New member fringe_bitmap_periodic_p.
8006
8007 * dispnew.c (shift_glyph_matrix, scrolling_window): Mark scrolled row
8008 for fringe update if it has periodic bitmap.
ac389d0c 8009 (row_equal_p): Also compare left_fringe_offset, right_fringe_offset,
e61124cd
YM
8010 and fringe_bitmap_periodic_p.
8011
8012 * fringe.c (get_fringe_bitmap_data): New function.
8013 (draw_fringe_bitmap_1, update_window_fringes): Use it.
8014 (update_window_fringes): Record periodicity of fringe bitmap in glyph
8015 row. Mark glyph row for fringe update if periodicity changed.
8016
8017 * xdisp.c (try_window_reusing_current_matrix): Don't mark scrolled row
8018 for fringe update unless it has periodic bitmap.
8019
f16d9837
KH
80202011-05-25 Kenichi Handa <handa@m17n.org>
8021
8022 * xdisp.c (get_next_display_element): Set correct it->face_id for
8023 a static composition.
8024
e1b90ef6
LL
80252011-05-24 Leo Liu <sdl.web@gmail.com>
8026
8027 * deps.mk (fns.o):
8028 * makefile.w32-in ($(BLD)/fns.$(O)): Include sha1.h.
8029
8030 * fns.c (crypto_hash_function, Fsha1): New function.
8031 (Fmd5): Use crypto_hash_function.
8032 (syms_of_fns): Add Ssha1.
8033
7400048f
PE
80342011-05-22 Paul Eggert <eggert@cs.ucla.edu>
8035
8036 * gnutls.c: Remove unused macros.
8037 (fn_gnutls_transport_set_lowat, fn_gnutls_transport_set_pull_function):
8038 (fn_gnutls_transport_set_push_function) [!WINDOWSNT]:
8039 Remove macros that are defined and never used.
8040 Caught by gcc -Wunused-macros (GCC 4.6.0, Fedora 14).
8041
abb71cf4
CY
80422011-05-22 Chong Yidong <cyd@stupidchicken.com>
8043
8044 * xselect.c (syms_of_xselect): Remove unused symbol SAVE_TARGETS.
8045 (Fx_get_selection_internal): Minor cleanup.
8046 (Fx_own_selection_internal): Rename arguments for consistency with
8047 select.el.
8048
6307db39
PE
80492011-05-22 Paul Eggert <eggert@cs.ucla.edu>
8050
8051 * xselect.c (QSAVE_TARGETS): New static var, to fix build failure.
8052
f3d4e0a4
CY
80532011-05-22 Chong Yidong <cyd@stupidchicken.com>
8054
8055 * xselect.c (syms_of_xselect): Include character.h; use DEFSYM.
8056
4d8ade89
YM
80572011-05-21 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
8058
8059 * dispnew.c (scrolling_window): Don't exclude the case that the
8060 last enabled row in the desired matrix touches the bottom boundary.
8061
32078c8d
GM
80622011-05-21 Glenn Morris <rgm@gnu.org>
8063
8064 * Makefile.in ($(etc)/DOC): Make second command line even shorter.
33cf345f
GM
8065 (SOME_MACHINE_OBJECTS): Replace FONT_OBJ by its maximal expansion,
8066 and add some more files.
32078c8d 8067
7285dc67
EZ
80682011-05-20 Eli Zaretskii <eliz@gnu.org>
8069
8070 * callproc.c (Fcall_process) [MSDOS]: Fix arguments to
8071 report_file_error introduced by the change from 2011-05-07.
8072
89d1bd22
PE
80732011-05-20 Paul Eggert <eggert@cs.ucla.edu>
8074
8075 * systime.h (Time): Define only if emacs is defined.
8076 This is to allow ../lib-src/profile.c to be compiled on FreeBSD,
8077 where the include path doesn't have X11/X.h by default. See
8078 <http://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00561.html>.
8079
cd394be1 80802011-05-20 Kenichi Handa <handa@m17n.org>
31bfc35c
KH
8081
8082 * composite.c (find_automatic_composition): Fix previous change.
8083
b9704ad9
GM
80842011-05-20 Glenn Morris <rgm@gnu.org>
8085
8086 * lisp.mk: New file, split from Makefile.in.
8087 * Makefile.in (lisp): Move to separate file, inserted by @lisp_frag@.
8088 (shortlisp): Remove.
8089 ($(etc)/DOC): Edit lisp.mk rather than using $shortlisp.
8090
4a720484
GM
80912011-05-19 Glenn Morris <rgm@gnu.org>
8092
8093 * Makefile.in (MSDOS_SUPPORT_REAL, MSDOS_SUPPORT, NS_SUPPORT)
8094 (REAL_MOUSE_SUPPORT, GPM_MOUSE_SUPPORT, MOUSE_SUPPORT, TOOLTIP_SUPPORT)
8095 (BASE_WINDOW_SUPPORT, X_WINDOW_SUPPORT, WINDOW_SUPPORT): Remove.
8096 (lisp): Set the order to that of loadup.el.
8097 (shortlisp): Make it a copy of $lisp.
8098 (SOME_MACHINE_LISP): Remove.
8099 ($(etc)/DOC): Depend just on $lisp, not $SOME_MACHINE_LISP too.
8100 Use just $shortlisp, not $SOME_MACHINE_LISP too.
8101
a28d4396
KH
81022011-05-18 Kenichi Handa <handa@m17n.org>
8103
8104 * composite.c (CHAR_COMPOSABLE_P): Add more check for efficiency.
8105 (BACKWARD_CHAR): Wrap the arg STOP by parenthesis.
8106 (find_automatic_composition): Mostly rewrite for efficiency.
8107
a2b1fa8e
JB
81082011-05-18 Juanma Barranquero <lekktu@gmail.com>
8109
8110 * makefile.w32-in: Update dependencies.
8111
8e1f5610
CS
81122011-05-18 Christoph Scholtes <cschol2112@googlemail.com>
8113
8114 * menu.c: Include limits.h (fixes the MS-Windows build broken by
7d7d0045 8115 2011-06-18T18:49:19Z!cyd@stupidchicken.com).
8e1f5610 8116
7025ee00 81172011-05-18 Paul Eggert <eggert@cs.ucla.edu>
cb93f9be 8118
cdfa6eab
PE
8119 Fix some integer overflow issues, such as string length overflow.
8120
06d6db33
PE
8121 * insdel.c (count_size_as_multibyte): Check for string overflow.
8122
2b4560a8
PE
8123 * character.c (lisp_string_width): Check for string overflow.
8124 Use EMACS_INT, not int, for string indexes and lengths; in
8125 particular, 2nd arg is now EMACS_INT, not int. Do not crash if
8126 the resulting string length overflows an EMACS_INT; instead,
8127 report a string overflow if no precision given. When checking for
8128 precision exhaustion, use a check that cannot possibly have
8129 integer overflow. (Bug#8675)
8130 * character.h (lisp_string_width): Adjust to new signature.
8131
cb93f9be
PE
8132 * alloc.c (string_overflow): New function.
8133 (Fmake_string): Use it. This doesn't change behavior, but saves
8134 a few bytes and will simplify future changes.
8135 * character.c (string_escape_byte8): Likewise.
8136 * lisp.h (string_overflow): New decl.
8137
1a1f3366
PE
8138 Fixups, following up to the user-interface timestamp change.
8139 * nsterm.m (last_mouse_movement_time, ns_mouse_position): Use Time
8140 for UI timestamps, instead of unsigned long.
9fbd6841
PE
8141 * msdos.c (mouse_get_pos): Likewise.
8142 * w32inevt.c (movement_time, w32_console_mouse_position): Likewise.
1a1f3366
PE
8143 * w32gui.h (Time): Define by including "systime.h" rather than by
8144 declaring it ourselves. (Bug#8664)
8145
d4e3e4d3
PE
8146 * dispextern.h (struct image): Don't assume time_t <= unsigned long.
8147 * image.c (clear_image_cache): Likewise.
8148
f6a24d19
PE
8149 * term.c (term_mouse_position): Don't assume time_t wraparound.
8150
08dc5ae6
PE
8151 Be more systematic about user-interface timestamps.
8152 Before, the code sometimes used 'Time', sometimes 'unsigned long',
620c53a6
SM
8153 and sometimes 'EMACS_UINT', to represent these timestamps.
8154 This change causes it to use 'Time' uniformly, as that's what X uses.
08dc5ae6
PE
8155 This makes the code easier to follow, and makes it easier to catch
8156 integer overflow bugs such as Bug#8664.
8157 * frame.c (Fmouse_position, Fmouse_pixel_position):
8158 Use Time, not unsigned long, for user-interface timestamps.
8159 * keyboard.c (last_event_timestamp, kbd_buffer_get_event): Likewise.
8160 (button_down_time, make_lispy_position, make_lispy_movement): Likewise.
8161 * keyboard.h (last_event_timestamp): Likewise.
8162 * menu.c (Fx_popup_menu) [!HAVE_X_WINDOWS]: Likewise.
8163 * menu.h (xmenu_show): Likewise.
8164 * term.c (term_mouse_position): Likewise.
8165 * termhooks.h (struct input_event.timestamp): Likewise.
8166 (struct terminal.mouse_position_hook): Likewise.
8167 * xmenu.c (create_and_show_popup_menu, xmenu_show): Likewise.
8168 * xterm.c (XTmouse_position, x_scroll_bar_report_motion): Likewise.
8169 * systime.h (Time): New decl. Pull it in from <X11/X.h> if
8170 HAVE_X_WINDOWS, otherwise define it as unsigned long, which is
8171 what it was before.
8172 * menu.h, termhooks.h: Include "systime.h", for Time.
8173
8e55734a
PE
8174 * keyboard.c (make_lispy_event): Fix problem in integer overflow.
8175 Don't assume that the difference between two unsigned long values
8176 can fit into an integer. At this point, we know button_down_time
8177 <= event->timestamp, so the difference must be nonnegative, so
8178 there's no need to cast the result if double-click-time is
8179 nonnegative, as it should be; check that it's nonnegative, just in
8180 case. This bug is triggered when events are more than 2**31 ms
86db42d2 8181 apart (about 25 days). (Bug#8664)
8e55734a 8182
841f1b75 8183 * xselect.c (last_event_timestamp): Remove duplicate decl.
6434756c 8184 (x_own_selection): Remove needless cast to unsigned long.
841f1b75 8185
3e26f69c
PE
8186 * xmenu.c (set_frame_menubar): Use int, not EMACS_UINT, for indexes
8187 that always fit in int. Use a sentinel instead of a counter, to
8188 avoid a temp and to allay GCC's concerns about possible int overflow.
d230cb74
PE
8189 * frame.h (struct frame): Use int for menu_bar_items_used
8190 instead of EMACS_INT, since it always fits in int.
3e26f69c 8191
5cc152c0
PE
8192 * menu.c (grow_menu_items): Check for int overflow.
8193
d89eb65e
PE
8194 * xmenu.c (set_frame_menubar): Don't mishandle vectors with no nils.
8195
5235bd3e
PE
8196 * xterm.c: Use EMACS_INT for Emacs modifiers, and int for X modifiers.
8197 Before, the code was not consistent. These values cannot exceed
8198 2**31 - 1 so there's no need to make them unsigned.
8199 (x_x_to_emacs_modifiers): Accept int and return EMACS_INT.
8200 (x_emacs_to_x_modifiers): Accept EMACS_INT and return int.
8201 (x_x_to_emacs_modifiers, x_emacs_to_x_modifiers): Reject non-integers
8202 as modifiers.
8203 * xterm.h (x_x_to_emacs_modifiers): Adjust to signature change.
8204
bc827e23
PE
8205 * lisp.h (XINT) [USE_LISP_UNION_TYPE]: Cast to EMACS_INT.
8206 (XUINT) [USE_LISP_UNION_TYPE]: Cast to EMACS_UINT.
8207 Otherwise, GCC 4.6.0 warns about printf (pI, XINT (...)),
8208 presumably because the widths might not match.
8209
78eb494e
PE
8210 * window.c (size_window): Avoid needless test at loop start.
8211
04f2d78b
CB
82122011-05-18 Courtney Bane <emacs-bugs-7626@cbane.org> (tiny change)
8213
8214 * term.c (Fresume_tty): Restore hooks before reinitializing (bug#8687).
8215
d2fc7e3d 82162011-05-12 Drew Adams <drew.adams@oracle.com>
e531bdff
DA
8217
8218 * textprop.c (Fprevious_single_char_property_change): Doc fix (bug#8655).
8219
d2fc7e3d 82202011-05-12 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
7db47798
YM
8221
8222 * w32term.c (w32_draw_fringe_bitmap): Rename local vars `left' and
8223 `width' to `bar_area_x' and `bar_area_width', respectively.
8224 (x_scroll_run): Take account of fringe background extension.
8225
04f2d78b
CB
8226 * xterm.c (x_draw_fringe_bitmap) [USE_TOOLKIT_SCROLL_BARS]:
8227 Rename local vars `left' and `width' to `bar_area_x' and
7db47798
YM
8228 `bar_area_width', respectively.
8229 (x_scroll_run) [USE_TOOLKIT_SCROLL_BARS]: Take account of fringe
8230 background extension.
8231
79b70037
GM
82322011-05-10 Jim Meyering <meyering@redhat.com>
8233
8234 * xdisp.c (x_intersect_rectangles): Fix typo "the the -> the".
8235
2f142cc5
JB
82362011-05-10 Juanma Barranquero <lekktu@gmail.com>
8237
8238 * image.c (Finit_image_library): Return t for built-in image types,
8239 like pbm and xbm. (Bug#8640)
8240
57679c86
AS
82412011-05-09 Andreas Schwab <schwab@linux-m68k.org>
8242
8243 * w32menu.c (set_frame_menubar): Fix submenu allocation.
8244
888c9e86
EZ
82452011-05-07 Eli Zaretskii <eliz@gnu.org>
8246
b0512a1d
EZ
8247 * w32console.c (Fset_screen_color): Doc fix.
8248 (Fget_screen_color): New function.
8249 (syms_of_ntterm): Defsubr it.
8250
7285dc67
EZ
8251 * callproc.c (call_process_cleanup) [MSDOS]: Don't close and
8252 unlink the temporary file if Fcall_process didn't create it in the
8253 first place.
8254 (Fcall_process) [MSDOS]: Don't create tempfile if stdout of the
8255 child process will be redirected to a file specified with `:file'.
888c9e86
EZ
8256 Don't try to re-open tempfile in that case, and set fd[0] to -1 as
8257 cue to call_process_cleanup not to close that handle.
8258
4d3fcc8e
BK
82592011-05-07 Ben Key <bkey76@gmail.com>
8260
8261 * makefile.w32-in: The bootstrap-temacs rule now makes use of
8262 one of two shell specific rules, either bootstrap-temacs-CMD or
8263 bootstrap-temacs-SH. The bootstrap-temacs-SH rule is identical
8264 to the previous implementation of the bootstrap-temacs rule.
8265 The bootstrap-temacs-CMD rule is similar to the previous
8266 implementation of the bootstrap-temacs rule except that it
8267 makes use of the ESC_CFLAGS variable instead of the CFLAGS
8268 variable.
8269
8270 These changes, along with some changes to nt/configure.bat,
8271 nt/gmake.defs, and nt/nmake.defs, are required to extend my
8272 earlier fix to add support for --cflags and --ldflags options
8273 that include quotes so that it works whether make uses cmd or
8274 sh as the shell.
8275
b4289b64
MA
82762011-05-06 Michael Albinus <michael.albinus@gmx.de>
8277
8278 * dbusbind.c (QCdbus_type_unix_fd): Declare static.
8279 (xd_remove_watch): Don't check QCdbus_type_unix_fd for SYMBOLP, it
8280 is a constant.
8281 (Fdbus_init_bus, xd_read_queued_messages): Bus can be a symbol or
8282 a string. Handle both cases.
8283 (Fdbus_call_method_asynchronously, Fdbus_register_signal)
8284 (Fdbus_register_method): Use Qinvalid_function.
8285
af4c0e28
JB
82862011-05-06 Juanma Barranquero <lekktu@gmail.com>
8287
8288 * makefile.w32-in: Update dependencies.
8289 (LISP_H): Add inttypes.h and stdin.h.
8290 (PROCESS_H): Add unistd.h.
8291
c51453d9
EZ
82922011-05-06 Eli Zaretskii <eliz@gnu.org>
8293
8294 * lread.c: Include limits.h (fixes the MS-Windows build broken by
8295 2011-05-06T07:13:19Z!eggert@cs.ucla.edu).
8296
8ff0ac3c 82972011-05-06 Paul Eggert <eggert@cs.ucla.edu>
c032b5f8 8298
4c4b566b
PE
8299 * image.c (Finit_image_library) [!HAVE_NTGUI]: Omit unused local.
8300
aab2b9b5
PE
8301 * term.c (vfatal): Remove stray call to va_end.
8302 It's not needed and the C Standard doesn't allow it here anyway.
8303
c378da0b
PE
8304 Use C99's va_copy to avoid undefined behavior on x86-64 GNU/Linux.
8305 * eval.c (verror): doprnt a copy of ap, not the original. (Bug#8545)
8306
288b08c7
PE
8307 * eval.c (verror): OK to create a string of up to MOST_POSITIVE_FIXNUM
8308 bytes.
8309
e3601888
PE
8310 * term.c: Don't include <stdarg.h>, as <lisp.h> does that.
8311
db6c0e74
PE
8312 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork clobbering.
8313
dd5963ea
PE
8314 * process.c (Fformat_network_address): Fix typo: args2 -> *args2.
8315
88c9450f
PE
8316 * xmenu.c (set_frame_menubar): Fix typo: int * -> int (3 times).
8317
2f9442b8
PE
8318 * coding.c (detect_coding_charset): Fix typo: * 2 -> *4 (Bug#8601).
8319
c032b5f8
PE
8320 * charset.h (struct charset.code_space): Now has 15 elements, not 16.
8321 * charset.c (Fdefine_charset_internal): Don't initialize
8322 charset.code_space[15]. The value was garbage, on hosts with
2d38271b 8323 32-bit int (Bug#8600).
a108c10b
PE
8324
8325 * lread.c (read_integer): Be more consistent with string-to-number.
8326 Use string_to_number to do the actual conversion; this avoids
8327 rounding errors and fixes some other screwups. Without this fix,
8328 for example, #x1fffffffffffffff was misread as -2305843009213693952.
8329 (digit_to_number): Move earlier, for benefit of read_integer.
8330 Return -1 if the digit is out of range for the base, -2 if it is
48e400f0 8331 not a digit in any supported base. (Bug#8602)
a108c10b 8332
ad5f9eea
PE
8333 * doprnt.c (doprnt): Support arbitrary pI values, such as "I64".
8334
aec1708a
PE
8335 * dispnew.c (scrolling_window): Return 1 if we scrolled,
8336 to match comment at start of function. This also removes a
8337 GCC warning about overflow in a 32+64-bit port.
8338
47be4ab5
PE
8339 * lisp.h (EMACS_INT, EMACS_UINT, BITS_PER_EMACS_INT, pI): Simplify.
8340
371cac43
PE
8341 * dbusbind.c: Do not use XPNTR on a value that may be an integer.
8342 Reported by Stefan Monnier in
8343 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00919.html>.
04f2d78b
CB
8344 (xd_remove_watch, Fdbus_init_bus, xd_read_queued_messages):
8345 Use SYMBOLP-guarded XSYMBOL, not XPNTR.
371cac43 8346
d01a7826
PE
8347 * lisp.h (EMACS_INTPTR): Remove. All uses changed to intptr_t.
8348 (EMACS_UINTPTR): Likewise, with uintptr_t.
8349
7fd47d5c
PE
8350 * lisp.h: Prefer 64-bit EMACS_INT if available.
8351 (EMACS_INT, EMACS_UINT, BITS_PER_EMACS_INT, pI): Define to 64-bit
8352 on 32-bit hosts that have 64-bit int, so that they can access
8353 large files.
122b0c86
PE
8354 However, temporarily disable this change unless the temporary
8355 symbol WIDE_EMACS_INT is defined.
7fd47d5c 8356
8727937b
PE
8357 * lread.c, process.c: Do not include <inttypes.h>; lisp.h does it now.
8358
8ac068ac
PE
8359 Prefer intptr_t/uintptr_t for integers the same widths as pointers.
8360 This removes an assumption that EMACS_INT and long are the same
8361 width as pointers. The assumption is true for Emacs porting targets
8362 now, but we want to make other targets possible.
8363 * lisp.h: Include <inttypes.h>, for INTPTR_MAX, UINTPTR_MAX.
8364 (EMACS_INTPTR, EMACS_UINTPTR): New macros.
8365 In the rest of the code, change types of integers that hold casted
8366 pointers to EMACS_INTPTR and EMACS_UINTPTR, systematically
8367 replacing EMACS_INT, long, EMACS_UINT, and unsigned long.
8368 (XTYPE): Don't cast arg to EMACS_UINT; normally is not needed.
8369 (XSET): Cast type of XTYPE arg to EMACS_INTPTR; it is needed here.
8370 No need to cast type when ORing.
8371 (XPNTR): Return a value of type EMACS_INTPTR or EMACS_UINTPTR.
8372 * alloc.c (lisp_align_malloc): Remove a no-longer-needed cast.
8373 * doc.c (store_function_docstring): Use EMACS_INTPTR, so as not to
8374 assume EMACS_INT is the same width as char *.
8375 * gtkutil.c (xg_gtk_scroll_destroy, xg_tool_bar_button_cb):
8376 (xg_tool_bar_callback, xg_tool_bar_help_callback, xg_make_tool_item):
8377 Remove no-longer-needed casts.
8378 (xg_create_scroll_bar, xg_tool_bar_button_cb, xg_tool_bar_callback):
8379 (xg_tool_bar_help_callback, xg_make_tool_item):
8380 Use EMACS_INTPTR to hold an integer
8381 that will be cast to void *; this can avoid a GCC warning
8382 if EMACS_INT is not the same width as void *.
8383 * menu.c (find_and_call_menu_selection): Remove no-longer-needed cast.
8384 * xdisp.c (display_echo_area_1, resize_mini_window_1):
8385 (current_message_1, set_message_1):
8386 Use a local to convert to proper width without a cast.
8387 * xmenu.c (dialog_selection_callback): Likewise.
8388
ede49d71
PE
8389 * sysdep.c (get_random): Don't assume EMACS_INT is no wider than long.
8390 Also, don't assume VALBITS / RAND_BITS is less than 5,
8391 and don't rely on undefined behavior when shifting a 1 left into
8392 the sign bit.
8393 * lisp.h (get_random): Change signature to match.
8394
2f30ecd0
PE
8395 * lread.c (hash_string): Use size_t, not int, for hash computation.
8396 Normally we prefer signed values; but hashing is special, because
8397 it's better to use unsigned division on hash table sizes so that
8398 the remainder is nonnegative. Also, size_t is the natural width
8399 for hashing into memory. The previous code used 'int', which doesn't
8400 retain enough info to hash well into very large tables.
8401 (oblookup, oblookup_last_bucket_number, Funintern): Likewise.
8402
2a866e7b
PE
8403 * dbusbind.c: Don't possibly lose pointer info when converting.
8404 (xd_remove_watch, Fdbus_init_bus, xd_read_queued_messages):
8405 Use XPNTR rather than XHASH, so that the high-order bits of
8406 the pointer aren't lost when converting through void *.
8407
51639eac
PE
8408 * eval.c (Fautoload): Don't double-shift a pointer.
8409
92394119
PE
8410 * fns.c (Frandom): Let EMACS_UINT be wider than unsigned long.
8411
dbdb9a7c
JB
84122011-05-06 Juanma Barranquero <lekktu@gmail.com>
8413
8414 * gnutls.c (DEF_GNUTLS_FN):
8415 * image.c (DEF_IMGLIB_FN): Make function pointers static.
8416
db7a0b4f
AS
84172011-05-05 Andreas Schwab <schwab@linux-m68k.org>
8418
8419 * lread.c (lisp_file_lexically_bound_p): Stop scanning at end
8420 marker. (Bug#8610)
8421
cd394be1 84222011-05-05 Eli Zaretskii <eliz@gnu.org>
fab624aa
EZ
8423
8424 * w32heap.c (allocate_heap) [USE_LISP_UNION_TYPE || USE_LSB_TAG]:
8425 New version that can reserve upto 2GB of heap space.
8426
f7ff1b0f 84272011-05-05 Chong Yidong <cyd@stupidchicken.com>
45cb8994
CY
8428
8429 * nsfns.m (Fns_read_file_name): Doc fix (Bug#8534).
8430
639c109b
TZ
84312011-05-05 Teodor Zlatanov <tzz@lifelogs.com>
8432
8433 * gnutls.c (fn_gnutls_certificate_set_x509_key_file): Add alias to
8434 `gnutls_certificate_set_x509_key_file'.
8435
d2127135
JB
84362011-05-05 Juanma Barranquero <lekktu@gmail.com>
8437
8438 * makefile.w32-in ($(BLD)/image.$(O), $(BLD)/process.$(O)):
8439 Update dependencies.
8440
e968f4f3
JB
84412011-05-04 Juanma Barranquero <lekktu@gmail.com>
8442
8443 * gnutls.h (emacs_gnutls_write, emacs_gnutls_read):
8444 * gnutls.c (emacs_gnutls_write, emacs_gnutls_read):
8445 Remove unused parameter `fildes'.
8446 * process.c (read_process_output, send_process): Don't pass it.
8447
84d358f0
JB
84482011-05-04 Juanma Barranquero <lekktu@gmail.com>
8449
8450 Fix previous change: the library cache is defined in w32.c.
8451 * image.c (CACHE_IMAGE_TYPE) [!HAVE_NTGUI]: Define to noop.
8452 (Finit_image_library): Wrap Vlibrary_cache on "#ifdef HAVE_NTGUI".
8453
0898ca10
JB
84542011-05-04 Juanma Barranquero <lekktu@gmail.com>
8455
8456 Implement dynamic loading of GnuTLS on Windows.
8457
8458 * gnutls.h (GNUTLS_EMACS_ERROR_NOT_LOADED): New macro.
8459 (emacs_gnutls_write, emacs_gnutls_read): Mark as extern.
8460 (emacs_gnutls_record_check_pending, emacs_gnutls_transport_set_errno):
8461 Declare.
8462
8463 * gnutls.c (Qgnutls_dll): Define.
8464 (DEF_GNUTLS_FN, LOAD_GNUTLS_FN): New macros.
8465 (gnutls_*): Declare function pointers.
8466 (init_gnutls_functions): New function to initialize function pointers.
8467 (emacs_gnutls_handshake, Fgnutls_error_string, Fgnutls_deinit)
8468 (emacs_gnutls_global_init, Fgnutls_bye): Use function pointers.
8469 (emacs_gnutls_record_check_pending, emacs_gnutls_transport_set_errno):
8470 Wrappers for gnutls_record_check_pending and gnutls_transport_set_errno.
8471 (emacs_gnutls_write, emacs_gnutls_read)
8472 (emacs_gnutls_handle_error, Fgnutls_error_fatalp)
8473 (Fgnutls_available_p): New function.
8474 (Fgnutls_boot): Call Fgnutls_available_p. Use function pointers.
8475 (syms_of_gnutls) <Qgnutls_dll>: Initialize and staticpro it.
8476 (syms_of_gnutls) <Sgnutls_available_p>: defsubr it.
8477
8478 * image.c: Include w32.h.
8479 (Vimage_type_cache): Delete.
8480 (syms_of_image) <Vimage_type_cache>: Don't initialize and staticpro it.
8481 (CACHE_IMAGE_TYPE, Finit_image_library): Use Vlibrary_cache instead.
8482 (w32_delayed_load): Move to w32.c.
8483
8484 * w32.h (VlibraryCache, QCloaded_from, w32_delayed_load): Declare.
8485
8486 * w32.c (QCloaded_from, Vlibrary_cache): Define.
8487 (w32_delayed_load): Move from image.c. When loading a library, record
8488 its filename in the :loaded-from property of the library id.
8489 (globals_of_w32) <QCloaded_from, Vlibrary_cache>:
8490 Initialize and staticpro them.
8491 (emacs_gnutls_pull, emacs_gnutls_push): Call emacs_gnutls_* functions.
8492
8493 * process.c: Include lisp.h before w32.h, not after.
8494 (wait_reading_process_output): Call emacs_gnutls_record_check_pending
8495 instead of gnutls_record_check_pending.
8496
8497 * callproc.c, emacs.c: Include lisp.h before w32.h, not after.
8498
ff4de4aa
TZ
84992011-05-04 Teodor Zlatanov <tzz@lifelogs.com>
8500
8501 * gnutls.c (Fgnutls_boot): Support :keylist and :crlfiles options
8502 instead of :keyfiles. Give GnuTLS the keylist and the CRL lists
8503 as passed in.
8504
abe95abb
JD
85052011-05-03 Jan Djärv <jan.h.d@swipnet.se>
8506
8507 * xterm.c (x_set_frame_alpha): Do not set property on anything
8508 else than FRAME_X_OUTER_WINDOW (Bug#8608).
8509
e16e55d4
JB
85102011-05-02 Juanma Barranquero <lekktu@gmail.com>
8511
8512 * sysdep.c (get_tty_size) [WINDOWSNT]: Implement. (Bug#8596)
8513
bafcf6a5
JB
85142011-05-02 Juanma Barranquero <lekktu@gmail.com>
8515
8516 * gnutls.c (Qgnutls_log_level, Qgnutls_code, Qgnutls_anon)
8517 (Qgnutls_x509pki, Qgnutls_e_interrupted, Qgnutls_e_again)
8518 (Qgnutls_e_invalid_session, Qgnutls_e_not_ready_for_handshake)
8519 (gnutls_global_initialized, Qgnutls_bootprop_priority)
8520 (Qgnutls_bootprop_trustfiles, Qgnutls_bootprop_keyfiles)
8521 (Qgnutls_bootprop_callbacks, Qgnutls_bootprop_loglevel)
8522 (Qgnutls_bootprop_hostname, Qgnutls_bootprop_verify_flags)
8523 (Qgnutls_bootprop_verify_error, Qgnutls_bootprop_verify_hostname_error)
8524 (Qgnutls_bootprop_callbacks_verify): Make static.
8525
e7a6747f
AS
85262011-05-01 Andreas Schwab <schwab@linux-m68k.org>
8527
19ed11ba
AS
8528 * callproc.c: Indentation fixup.
8529
e7a6747f 8530 * sysdep.c (wait_for_termination_1): Make static.
04f2d78b
CB
8531 (wait_for_termination, interruptible_wait_for_termination):
8532 Move after wait_for_termination_1.
e7a6747f 8533
1ef14cb4
LMI
85342011-05-01 Lars Magne Ingebrigtsen <larsi@gnus.org>
8535
8536 * sysdep.c (interruptible_wait_for_termination): New function
8537 which is like wait_for_termination, but allows keyboard
8538 interruptions.
8539
8540 * callproc.c (Fcall_process): Add (:file "file") as an option for
8541 the STDOUT buffer.
8542 (Fcall_process_region): Ditto.
8543
330d880c
EZ
85442011-04-30 Eli Zaretskii <eliz@gnu.org>
8545
8db90b73
EZ
8546 * dosfns.c (Fint86, Fdos_memget, Fdos_memput): Use `ASIZE (FOO)'
8547 rather than `XVECTOR (FOO)->size'.
8548
330d880c
EZ
8549 * process.c: Remove HAVE_INTTYPES_H condition from inclusion of
8550 inttypes.h, as a gnulib replacement is used if it not available in
8551 system headers.
8552
15cbd324
EZ
85532011-04-21 Eli Zaretskii <eliz@gnu.org>
8554
8555 Lift the MOST_POSITIVE_FIXNUM/4 limitation on visited files.
8556 * fileio.c (Finsert_file_contents): Don't limit file size to 1/4
8557 of MOST_POSITIVE_FIXNUM. (Bug#8528)
8558
8559 * coding.c (coding_alloc_by_realloc): Error out if destination
8560 will grow beyond MOST_POSITIVE_FIXNUM.
8561 (decode_coding_emacs_mule): Abort if there isn't enough place in
8562 charbuf for the composition carryover bytes. Reserve an extra
8563 space for up to 2 characters produced in a loop.
8564 (decode_coding_iso_2022): Abort if there isn't enough place in
8565 charbuf for the composition carryover bytes.
8566
85672011-04-21 Eli Zaretskii <eliz@gnu.org>
afda1437 8568
ae940cca
EZ
8569 * doprnt.c (doprnt) [!HAVE_LONG_LONG_INT]: Error out instead of
8570 aborting when %lld or %lll format is passed.
8571 [!HAVE_UNSIGNED_LONG_LONG_INT]: Error out instead of aborting when
8572 %llo or %llx format is passed. (Bug#8545)
8573
03ab8921
EZ
8574 * window.c (window_scroll_line_based): Use a marker instead of
8575 simple variables to record original value of point. (Bug#7952)
8576
afda1437
EZ
8577 * doprnt.c (doprnt): Fix the case where a multibyte sequence
8578 produced by %s or %c overflows available buffer space. (Bug#8545)
8579
f76dee0c
PE
85802011-04-28 Paul Eggert <eggert@cs.ucla.edu>
8581
8582 * doprnt.c (doprnt): Omit useless test; int overflow check (Bug#8545).
283cdbef 8583 (SIZE_MAX): Move defn after all includes, as they might #define it.
f76dee0c 8584
fdc5744d
JB
85852011-04-28 Juanma Barranquero <lekktu@gmail.com>
8586
8587 * w32.c (init_environment): Warn about defaulting HOME to C:\.
8588
638f053a
JB
85892011-04-28 Juanma Barranquero <lekktu@gmail.com>
8590
8591 * keyboard.c (Qdelayed_warnings_hook): Define.
8592 (command_loop_1): Run `delayed-warnings-hook'
8593 if Vdelayed_warnings_list is non-nil.
8594 (syms_of_keyboard) <delayed-warnings-hook>: DEFSYM it.
8595 (syms_of_keyboard) <delayed-warnings-list>: DEFVAR_LISP it.
8596
d178f871
EZ
85972011-04-28 Eli Zaretskii <eliz@gnu.org>
8598
8599 * doprnt.c (doprnt): Don't return value smaller than the buffer
8600 size if the message was truncated. (Bug#8545).
8601
b124fd93
JB
86022011-04-28 Juanma Barranquero <lekktu@gmail.com>
8603
8604 * w32fns.c (Fx_change_window_property, Fx_delete_window_property)
8605 (Fx_window_property): #if-0 the whole functions, not just the bodies.
8606
e810457d
PE
86072011-04-27 Paul Eggert <eggert@cs.ucla.edu>
8608
8609 * doprnt.c (doprnt): Support "ll" length modifier, for long long.
8610
ea51cceb
JB
86112011-04-27 Juanma Barranquero <lekktu@gmail.com>
8612
8613 * makefile.w32-in: Update dependencies.
8614
94dcfacf
EZ
86152011-04-27 Eli Zaretskii <eliz@gnu.org>
8616
8617 Improve `doprnt' and its usage. (Bug#8545)
8618 * doprnt.c (doprnt): Make sure `format' is never accessed beyond
8619 `format_end'. Remove support for %l as a conversion specifier.
8620 Don't use xrealloc. Improve diagnostics when the %l size modifier
8621 is used. Update the commentary.
8622
8623 * eval.c (verror): Simplify calculation of size_t.
8624
8625 * coding.c (Ffind_operation_coding_system): Fix diagnostic error
8626 messages.
8627
f61f41d7
PE
86282011-04-27 Yoshiaki Kasahara <kasahara@nc.kyushu-u.ac.jp> (tiny change)
8629
8630 * buffer.c (init_buffer) [USE_MMAP_FOR_BUFFERS]: Adjust to aliasing
8631 change.
8632
96fb4434
PE
86332011-04-27 Paul Eggert <eggert@cs.ucla.edu>
8634
8635 * nsmenu.m: Replace all uses of XVECTOR with ASIZE and AREF.
8636 This makes this file independent of the recent pseudovector change.
8637
671875da 86382011-04-26 Paul Eggert <eggert@cs.ucla.edu>
eab3844f 8639
69e9b5a3
PE
8640 * keyboard.c (handle_user_signal): Fix pointer signedness problem.
8641
b5f869a7 8642 * gnutls.c (emacs_gnutls_handle_error): Remove unused local.
7754e151 8643 (Fgnutls_boot): gnutls_certificate_verify_peers2 wants unsigned *.
8d4c3955 8644 Remove unused local.
c8926152 8645 (emacs_gnutls_write): Don't use uninitialized rtnval if nbyte <= 0.
080e5a8d 8646
841a1577 8647 * lisp.h: Fix a problem with aliasing and vector headers. (Bug#8546)
04f2d78b
CB
8648 GCC 4.6.0 optimizes based on type-based alias analysis.
8649 For example, if b is of type struct buffer * and v of type struct
eab3844f
PE
8650 Lisp_Vector *, then gcc -O2 was incorrectly assuming that &b->size
8651 != &v->size, and therefore "v->size = 1; b->size = 2; return
8652 v->size;" must therefore return 1. This assumption is incorrect
8653 for Emacs, since it type-puns struct Lisp_Vector * with many other
8654 types. To fix this problem, this patch adds a new type struct
f904488f 8655 vectorlike_header that documents the constraints on layout of vectors
eab3844f
PE
8656 and pseudovectors, and helps optimizing compilers not get fooled
8657 by Emacs's type punning. It also adds the macros XSETTYPED_PVECTYPE
8658 XSETTYPED_PSEUDOVECTOR, TYPED_PSEUDOVECTORP, for similar reasons.
f904488f
PE
8659 * lisp.h (XSETTYPED_PVECTYPE): New macro, specifying the name of
8660 the size member.
eab3844f
PE
8661 (XSETPVECTYPE): Rewrite in terms of new macro.
8662 (XSETPVECTYPESIZE): New macro, specifying both type and size.
8663 This is a bit clearer, and further avoids the possibility of
8664 undesirable aliasing.
8665 (XSETTYPED_PSEUDOVECTOR): New macro, specifying the size.
f904488f 8666 (XSETPSEUDOVECTOR): Rewrite in terms of XSETTYPED_PSEUDOVECTOR.
eab3844f
PE
8667 (XSETSUBR): Rewrite in terms of XSETTYPED_PSEUDOVECTOR and XSIZE,
8668 since Lisp_Subr is a special case (no "next" field).
04f2d78b
CB
8669 (ASIZE): Now uses header.size rather than size.
8670 All previous uses of XVECTOR (foo)->size replaced to use this macro,
f904488f
PE
8671 to avoid the hassle of writing XVECTOR (foo)->header.size.
8672 (struct vectorlike_header): New type.
eab3844f
PE
8673 (TYPED_PSEUDOVECTORP): New macro, also specifying the C type of the
8674 object, to help avoid aliasing.
8675 (PSEUDOVECTORP): Rewrite in terms of TYPED_PSEUDOVECTORP.
8676 (SUBRP): Likewise, since Lisp_Subr is a special case.
8677 * lisp.h (struct Lisp_Vector, struct Lisp_Char_Table):
8678 (struct Lisp_Sub_Char_Table, struct Lisp_Bool_Vector):
8679 (struct Lisp_Hash_Table): Combine first two members into a single
f904488f 8680 struct vectorlike_header member. All uses of "size" and "next" members
eab3844f
PE
8681 changed to be "header.size" and "header.next".
8682 * buffer.h (struct buffer): Likewise.
8683 * font.h (struct font_spec, struct font_entity, struct font): Likewise.
8684 * frame.h (struct frame): Likewise.
8685 * process.h (struct Lisp_Process): Likewise.
8686 * termhooks.h (struct terminal): Likewise.
8687 * window.c (struct save_window_data, struct saved_window): Likewise.
8688 * window.h (struct window): Likewise.
8689 * alloc.c (allocate_buffer, Fmake_bool_vector, allocate_pseudovector):
8690 Use XSETPVECTYPESIZE, not XSETPVECTYPE, to avoid aliasing problems.
8691 * buffer.c (init_buffer_once): Likewise.
8692 * lread.c (defsubr): Use XSETTYPED_PVECTYPE, since Lisp_Subr is a
8693 special case.
8694 * process.c (Fformat_network_address): Use local var for size,
8695 for brevity.
8696
0df1eac5
PE
8697 * bytecode.c (exec_byte_code): Don't use XVECTOR before CHECK_VECTOR.
8698
847ab9d1 8699 Make the Lisp reader and string-to-float more consistent (Bug#8525)
452f4150
PE
8700 * data.c (atof): Remove decl; no longer used or needed.
8701 (digit_to_number): Move to lread.c.
8702 (Fstring_to_number): Use new string_to_number function, to be
8703 consistent with how the Lisp reader treats infinities and NaNs.
8704 Do not assume that floating-point numbers represent EMACS_INT
8705 without losing information; this is not true on most 64-bit hosts.
8706 Avoid double-rounding errors, by insisting on integers when
8707 parsing non-base-10 numbers, as the documentation specifies.
8708 * lisp.h (string_to_number): New decl, replacing ...
8709 (isfloat_string): Remove.
bc0a5c13 8710 * lread.c: Include <inttypes.h>, for uintmax_t and strtoumax.
d78050d6 8711 (read1): Do not accept +. and -. as integers; this
452f4150
PE
8712 appears to have been a coding error. Similarly, do not accept
8713 strings like +-1e0 as floating point numbers. Do not report
8714 overflow for integer overflows unless the base is not 10 which
8715 means we have no simple and reliable way to continue.
8716 Break out the floating-point parsing into a new
8717 function string_to_number, so that Fstring_to_number parses
8718 floating point numbers consistently with the Lisp reader.
04f2d78b 8719 (digit_to_number): Move here from data.c. Make it static inline.
452f4150
PE
8720 (E_CHAR, EXP_INT): Remove, replacing with ...
8721 (E_EXP): New macro, to solve the "1.0e+" problem mentioned below.
8722 (string_to_number): New function, replacing isfloat_string.
8723 This function checks for valid syntax and produces the resulting
8724 Lisp float number too. Rework it so that string-to-number
bc0a5c13 8725 no longer mishandles examples like "1.0e+". Use strtoumax,
d78050d6
PE
8726 so that overflow for non-base-10 numbers is reported only when
8727 there's no portable and simple way to convert to floating point.
452f4150 8728
67769ffc
PE
8729 * textprop.c (set_text_properties_1): Rewrite for clarity,
8730 and to avoid GCC warning about integer overflow.
8731
c20db43f
PE
8732 * intervals.h (struct interval): Use EMACS_INT for members
8733 where EMACS_UINT might cause problems. See
8734 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00514.html>.
8735 (CHECK_TOTAL_LENGTH): Remove cast to EMACS_INT; no longer needed.
8736 * intervals.c (interval_deletion_adjustment): Now returns EMACS_INT.
8737 All uses changed.
37aa2f85
PE
8738 (offset_intervals): Tell GCC not to worry about length overflow
8739 when negating a negative length.
c20db43f 8740
2538aa2f
PE
8741 * alloc.c (overrun_check_malloc, overrun_check_realloc): Now static.
8742 (overrun_check_free): Likewise.
8743
f2d3008d
PE
8744 * alloc.c (SDATA_SIZE) [!GC_CHECK_STRING_BYTES]: Avoid runtime check
8745 in the common case where SDATA_DATA_OFFSET is a multiple of Emacs
8746 word size.
8747
ec8df744
PE
8748 * gnutls.c: Fix problems found by GCC 4.6.0 on Ubuntu 10.10.
8749 (gnutls_make_error): Rename local to avoid shadowing.
8750 (gnutls_emacs_global_deinit): ifdef out; not used.
8751 (Fgnutls_boot): Use const for pointer to readonly storage.
8752 Comment out unused local. Fix pointer signedness problems.
8753
640ee02d
PE
8754 * lread.c (openp): Don't stuff size_t into an 'int'.
8755 Use <= on length, not < on length + 1, to avoid GCC 4.6.0 warning
8756 about possible signed overflow.
8757
6048fb2a
PE
8758 * gtkutil.c: Fix problems found by GCC 4.6.0 on Ubuntu 10.10.
8759 (GDK_KEY_g): Don't define if already defined.
8760 (xg_prepare_tooltip): Avoid pointer signedness problem.
8761 (xg_set_toolkit_scroll_bar_thumb): Redo to avoid two casts.
8762
fa3c87e1
PE
8763 * process.c (Fnetwork_interface_info): Avoid left-shift undefined
8764 behavior with 1 << 31. GCC 4.6.0 warns about this on 32-bit hosts.
8765
2172544b
PE
8766 * xfns.c (Fx_window_property): Simplify a bit,
8767 to make a bit faster and to avoid GCC 4.6.0 warning.
8768 * xselect.c (x_get_window_property, x_handle_dnd_message): Likewise.
8769
9b821a21
PE
8770 * fns.c (internal_equal): Don't assume size_t fits in int.
8771
3c616cfa
PE
8772 * alloc.c (compact_small_strings): Tighten assertion a little.
8773
c2982e87
PE
8774 Replace pEd with more-general pI, and fix some printf arg casts.
8775 * lisp.h (pI): New macro, generalizing old pEd macro to other
8776 conversion specifiers. For example, use "...%"pI"d..." rather
8777 than "...%"pEd"...".
8778 (pEd): Remove. All uses replaced with similar uses of pI.
61bdb816 8779 * m/amdx86-64.h, m/ia64.h, m/ibms390x.h: Likewise.
c2982e87
PE
8780 * alloc.c (check_pure_size): Don't overflow by converting size to int.
8781 * bidi.c (bidi_dump_cached_states): Use pI to avoid cast.
8782 * data.c (Fnumber_to_string): Use pI instead of if-then-else-abort.
8783 * dbusbind.c (xd_append_arg): Use pI to avoid cast.
8784 (Fdbus_method_return_internal, Fdbus_method_error_internal): Likewise.
8785 * font.c (font_unparse_xlfd): Avoid potential buffer overrun on
8786 64-bit hosts.
8787 (font_unparse_xlfd, font_unparse_fcname): Use pI to avoid casts.
8788 * keyboard.c (record_char, modify_event_symbol): Use pI to avoid casts.
8789 * print.c (safe_debug_print, print_object): Likewise.
8790 (print_object): Don't overflow by converting EMACS_INT or EMACS_UINT
8791 to int.
6f04d126
PE
8792 Use pI instead of if-then-else-abort. Use %p to avoid casts,
8793 avoiding the 0 flag, which is not portable.
c2982e87
PE
8794 * process.c (Fmake_network_process): Use pI to avoid cast.
8795 * region-cache.c (pp_cache): Likewise.
8796 * xdisp.c (decode_mode_spec): Likewise.
8797 * xrdb.c (x_load_resources) [USE_MOTIF]: Use pI to avoid undefined
8798 behavior on 64-bit hosts with printf arg.
6f04d126 8799 * xselect.c (x_queue_event): Use %p to avoid casts, avoiding 0 flag.
c2982e87
PE
8800 (x_stop_queuing_selection_requests): Likewise.
8801 (x_get_window_property): Don't truncate byte count to an 'int'
8802 when tracing.
0b432f21 8803
5e073ec7
PE
8804 * frame.c (frame_name_fnn_p): Get rid of strtol, which isn't right
8805 here, since it parses constructs like leading '-' and spaces,
8806 which are not wanted; and it overflows with large numbers.
8807 Instead, simply match F[0-9]+, which is what is wanted anyway.
8808
36372bf9
PE
8809 * alloc.c: Remove unportable assumptions about struct layout.
8810 (SDATA_SELECTOR, SDATA_DATA_OFFSET): New macros.
8811 (SDATA_OF_STRING, SDATA_SIZE, allocate_string_data):
8812 (allocate_vectorlike, make_pure_vector): Use the new macros,
8813 plus offsetof, to remove unportable assumptions about struct layout.
8814 These assumptions hold on all porting targets that I know of, but
8815 they are not guaranteed, they're easy to remove, and removing them
8816 makes further changes easier.
8817
0b432f21
PE
8818 * alloc.c (BLOCK BYTES): Fix typo by changing "ablock" to "ablocks".
8819 This doesn't fix a bug but makes the code clearer.
bfd1c781
PE
8820 (string_overrun_cookie): Now const. Use initializers that
8821 don't formally overflow signed char, to avoid warnings.
000098c1
PE
8822 (allocate_string_data) [GC_CHECK_STRING_OVERRUN]: Fix typo that
8823 can cause Emacs to crash when string overrun checking is enabled.
c7bda33c
PE
8824 (allocate_buffer): Don't assume sizeof (struct buffer) is a
8825 multiple of sizeof (EMACS_INT); it need not be, if
8826 alignof(EMACS_INT) < sizeof (EMACS_INT).
d0f4e1f5 8827 (check_sblock, check_string_bytes, check_string_free_list): Protoize.
0b432f21 8828
895009e1
JB
88292011-04-26 Juanma Barranquero <lekktu@gmail.com>
8830
8831 * keyboard.c (QCrtl): Rename from Qrtl. All uses changed.
8832
6a7a1b0b
TZ
88332011-04-26 Teodor Zlatanov <tzz@lifelogs.com>
8834
8835 * gnutls.c (emacs_gnutls_handshake): Return an error if we're not
b5f869a7 8836 supposed to be handshaking. (Bug#8556)
6a7a1b0b
TZ
8837 Reported by Paul Eggert <eggert@cs.ucla.edu>.
8838
841a1577 88392011-04-26 Daniel Colascione <dan.colascione@gmail.com>
0438ce91
DC
8840
8841 * lisp.h (Qdebug): List symbol.
895009e1 8842 * eval.c (Qdebug): Restore global linkage.
0438ce91
DC
8843 * keyboard.c (debug-on-event): New variable.
8844 (handle_user_signal): Break into debugger when debug-on-event
8845 matches the current signal symbol.
8846
f2d3ba6f
DN
88472011-04-25 Dan Nicolaescu <dann@ics.uci.edu>
8848
8849 * alloc.c (check_sblock, check_string_bytes)
8850 (check_string_free_list): Convert to standard C.
8851
42ce4c63
TZ
88522011-04-25 Teodor Zlatanov <tzz@lifelogs.com>
8853
8854 * w32.c (emacs_gnutls_push): Fix typo.
8855
825cd63c
EZ
88562011-04-25 Eli Zaretskii <eliz@gnu.org>
8857
fb11d64d
EZ
8858 * gnutls.c (emacs_gnutls_handshake): Avoid compiler warnings about
8859 "cast to pointer from integer of different size".
8860
825cd63c
EZ
8861 Improve doprnt and its use in verror. (Bug#8545)
8862 * doprnt.c (doprnt): Document the set of format control sequences
8863 supported by the function. Use SAFE_ALLOCA instead of always
8864 using `alloca'.
8865
8866 * eval.c (verror): Don't limit the buffer size at size_max-1, that
8867 is one byte too soon. Don't use xrealloc; instead xfree and
8868 xmalloc anew.
8869
e061a11b
TZ
88702011-04-24 Teodor Zlatanov <tzz@lifelogs.com>
8871
8872 * gnutls.h: Add GNUTLS_STAGE_CALLBACKS enum to denote we're in the
8873 callbacks stage.
8874
8875 * gnutls.c: Renamed global_initialized to
8876 gnutls_global_initialized. Added internals for the
8877 :verify-hostname-error, :verify-error, and :verify-flags
8878 parameters of `gnutls-boot' and documented those parameters in the
8879 docstring. Start callback support.
9173deec
JB
8880 (emacs_gnutls_handshake): Add Woe32 support. Retry handshake
8881 unless a fatal error occurred. Call gnutls_alert_send_appropriate
8882 on error. Return error code.
e061a11b
TZ
8883 (emacs_gnutls_write): Call emacs_gnutls_handle_error.
8884 (emacs_gnutls_read): Likewise.
8885 (Fgnutls_boot): Return handshake error code.
8886 (emacs_gnutls_handle_error): New function.
8887 (wsaerror_to_errno): Likewise.
8888
8889 * w32.h (emacs_gnutls_pull): Add prototype.
8890 (emacs_gnutls_push): Likewise.
8891
8892 * w32.c (emacs_gnutls_pull): New function for GnuTLS on Woe32.
8893 (emacs_gnutls_push): Likewise.
8894
88952011-04-24 Claudio Bley <claudio.bley@gmail.com> (tiny change)
8896
8897 * process.c (wait_reading_process_output): Check if GnuTLS
8898 buffered some data internally if no FDs are set for TLS
8899 connections.
8900
8901 * makefile.w32-in (OBJ2): Add gnutls.$(O).
8902 (LIBS): Link to USER_LIBS.
8903 ($(BLD)/gnutls.$(0)): New target.
8904
fa6996bc
EZ
89052011-04-24 Eli Zaretskii <eliz@gnu.org>
8906
eb35682e
EZ
8907 * xdisp.c (handle_single_display_spec): Rename the
8908 display_replaced_before_p argument into display_replaced_p, to
8909 make it consistent with the commentary. Fix typos in the
8910 commentary.
8911
e2ad650c
EZ
8912 * textprop.c (syms_of_textprop): Remove dead code.
8913 (copy_text_properties): Delete obsolete commentary about an
8914 interface that was deleted long ago. Fix typos in the description
8915 of arguments.
8916
1b2de274
EZ
8917 * msdos.c (XMenuActivate, XMenuAddSelection): Adjust argument list
8918 to changes in oldXMenu/XMenu.h from 2011-04-16.
8919 <menu_help_message, prev_menu_help_message>: Constify.
8920 (IT_menu_make_room): menu->help_text is now `const char **';
8921 adjust.
8922
8923 * msdos.h (XMenuActivate, XMenuAddSelection): Adjust prototypes
8924 to changes in oldXMenu/XMenu.h from 2011-04-16.
8925 (struct XMenu): Declare `help_text' `const char **'.
8926
8927 * xfaces.c <Qunspecified>: Make extern again.
8928
8929 * syntax.c: Include sys/types.h before including regex.h, as
75f1671a 8930 required by POSIX.
1b2de274 8931
762b15be
EZ
8932 * doc.c (get_doc_string): Improve the format passed to `error'.
8933
8934 * doprnt.c (doprnt): Improve commentary.
8935
8936 * term.c (init_tty) [MSDOS]: Fix 1st argument to maybe_fatal.
8937
8938 * Makefile.in (TAGS): Depend on $(M_FILE) and $(S_FILE), and scan
8939 them with etags.
8940
f1052e5d
EZ
8941 * makefile.w32-in (globals.h): Add a dummy recipe, to make any
8942 changes in globals.h immediately force recompilation.
762b15be
EZ
8943 (TAGS): Depend on $(CURDIR)/m/intel386.h and
8944 $(CURDIR)/s/ms-w32.h.
8945 (TAGS-gmake): Scan $(CURDIR)/m/intel386.h and $(CURDIR)/s/ms-w32.h.
f1052e5d 8946
fa6996bc
EZ
8947 * character.c (Fchar_direction): Function deleted.
8948 (syms_of_character): Don't defsubr it.
8949 <char-direction-table>: Deleted.
8950
e6c3da20
EZ
89512011-04-23 Eli Zaretskii <eliz@gnu.org>
8952
8953 Fix doprnt so it could be used again safely in `verror'. (Bug#8435)
8954 * doprnt.c: Include limits.h.
8955 (SIZE_MAX): New macro.
04f2d78b
CB
8956 (doprnt): Return a size_t value. 2nd arg is now size_t.
8957 Many local variables are now size_t instead of int or unsigned.
e6c3da20
EZ
8958 Improve overflow protection. Support `l' modifier for integer
8959 conversions. Support %l conversion. Don't assume an EMACS_INT
8960 argument for integer conversions and for %c.
8961
8962 * lisp.h (doprnt): Restore prototype.
8963
8964 * makefile.w32-in ($(BLD)/callint.$(O)): Depend on
8965 $(SRC)/character.h.
8966
8967 * Makefile.in (base_obj): Add back doprnt.o.
8968
8969 * deps.mk (doprnt.o): Add back prerequisites.
8970 (callint.o): Depend on character.h.
8971
8972 * eval.c (internal_lisp_condition_case): Include the handler
8973 representation in the error message.
8974 (verror): Call doprnt instead of vsnprintf. Fix an off-by-one bug
8975 when breaking from the loop.
8976
8977 * xdisp.c (vmessage): Call doprnt instead of vsnprintf.
8978
8979 * callint.c (Fcall_interactively): When displaying error message
8980 about invalid control letter, pass the character's codepoint, not
8981 a pointer to its multibyte form. Improve display of the character
8982 in octal and display also its hex code.
8983
8984 * character.c (char_string): Use %x to display the (unsigned)
8985 codepoint of an invalid character, to avoid displaying a bogus
8986 negative value.
8987
8988 * font.c (check_otf_features): Pass SDATA of SYMBOL_NAME to
8989 `error', not SYMBOL_NAME itself.
8990
8991 * coding.c (Fencode_sjis_char, Fencode_big5_char): Use %c for
8992 character arguments to `error'.
8993
8994 * charset.c (check_iso_charset_parameter): Fix incorrect argument
8995 to `error' in error message about FINAL_CHAR argument. Make sure
8996 FINAL_CHAR is a character, and use %c when it is passed as
8997 argument to `error'.
8998
4ffd0d6b 89992011-04-23 Eli Zaretskii <eliz@gnu.org>
97a93095
EZ
9000
9001 * s/ms-w32.h (localtime): Redirect to sys_localtime.
9002
9003 * w32.c: Include <time.h>.
9004 (sys_localtime): New function.
9005
4ffd0d6b 90062011-04-23 Chong Yidong <cyd@stupidchicken.com>
c17819f4
CY
9007
9008 * xdisp.c (init_xdisp): Initialize echo_area_window (Bug#6451).
9009
4ffd0d6b 9010 * buffer.c (syms_of_buffer): Doc fix (Bug#6902).
aac0c6e3 9011
4ffd0d6b 90122011-04-23 Samuel Thibault <sthibault@debian.org> (tiny change)
aac0c6e3 9013
4ffd0d6b
GM
9014 * sysdep.c (wait_for_termination): On GNU Hurd, kill returns -1 on
9015 zombies (Bug#8467).
aac0c6e3 9016
04c56954
EZ
90172011-04-19 Eli Zaretskii <eliz@gnu.org>
9018
9019 * syntax.h (SETUP_SYNTAX_TABLE_FOR_OBJECT): Fix setting of
9020 gl_state.e_property when gl_state.object is Qt.
9021
9022 * insdel.c (make_gap_larger): Remove limitation of buffer size
9023 to <= INT_MAX.
9024
16a43933
CY
90252011-04-18 Chong Yidong <cyd@stupidchicken.com>
9026
9027 * xdisp.c (lookup_glyphless_char_display)
9028 (produce_glyphless_glyph): Handle cons cell entry in
9029 glyphless-char-display.
9030 (Vglyphless_char_display): Document it.
9031
9032 * term.c (produce_glyphless_glyph): Handle cons cell entry in
9033 glyphless-char-display.
9034
4581706e
CY
90352011-04-17 Chong Yidong <cyd@stupidchicken.com>
9036
9037 * xdisp.c (get_next_display_element): Remove unnecessary ifdefs.
9038
9039 * termhooks.h (FRAME_WINDOW_P): Remove duplicated definitions.
9040
9041 * dispextern.h (FACE_SUITABLE_FOR_ASCII_CHAR_P): Add missing
9042 definition for no-X builds.
9043
4887c6e2 90442011-04-16 Paul Eggert <eggert@cs.ucla.edu>
764430a3 9045
fd35b6f9
PE
9046 Static checks with GCC 4.6.0 and non-default toolkits.
9047
5c1ccb01
PE
9048 * s/sol2-6.h, s/unixware.h (PTY_TTY_NAME_SPRINTF): Protoize decl.
9049
006c5daa
PE
9050 * process.c (keyboard_bit_set): Define only if SIGIO.
9051 (send_process_trap): Mark it with NO_RETURN if it doesn't return.
9052 (send_process): Repair possible setjmp clobbering.
9053
efc736d3
PE
9054 * s/usg5-4-common.h (SETUP_SLAVE_PTY): Don't pass extra arg to 'fatal'.
9055
4e2fe2e6
PE
9056 * eval.c: Include <stdio.h>, for vsnprintf on non-GNU/Linux hosts.
9057
f97334a2
PE
9058 * data.c (arith_error): Mark with NO_RETURN if it doesn't return.
9059
4e75f29d
PE
9060 * alloc.c (bytes_used_when_full, SPARE_MEMORY, BYTES_USED):
9061 Define only if needed.
9062
90efadd1
PE
9063 * sysdep.c (_FILE_OFFSET_BITS): Make this hack even uglier
9064 by pacifying GCC about it. Maybe it's time to retire it?
875975e9 9065 * xfaces.c (USG, __TIMEVAL__): Likewise.
90efadd1 9066
3c647824
PE
9067 * dispextern.h (struct redisplay_interface): Rename param
9068 to avoid shadowing.
e264f262 9069 * termhooks.h (struct terminal): Likewise.
761383f4 9070 * xterm.c (xembed_send_message): Likewise.
3c647824 9071
b58c5c4a
PE
9072 * insdel.c (make_gap_smaller): Define only if
9073 USE_MMAP_FOR_BUFFERS || REL_ALLOC || DOUG_LEA_MALLOC.
9074
cad59032
PE
9075 * keyboard.c (read_char): Make a var volatile so longjmp won't clobber
9076 it.
9077
c339dc2e
PE
9078 * emacs.c (MAX_HEAP_BSS_DIFF, my_edata): Move to where they're used,
9079 so that we aren't warned about unused symbols.
9080
91a3e27b
PE
9081 * xfns.c (Fx_file_dialog): Rename local to avoid shadowing.
9082
399c71d3 9083 * xdisp.c (x_produce_glyphs): Mark var as initialized (Bug#8512).
7a3fb125 9084
8ffc96f5
PE
9085 * xfns.c (x_real_positions): Mark locals as initialized.
9086
eef9bc79
PE
9087 * xmenu.c (xmenu_show): Don't use uninitialized vars.
9088
098db9dd
PE
9089 * xterm.c: Fix problems found by static analysis with other toolkits.
9090 (toolkit_scroll_bar_interaction): Define and use only if USE_X_TOOLKIT.
dda3aedd
PE
9091 (x_dispatch_event): Declare static if USE_GTK, and
9092 define if USE_GTK || USE_X_TOOLKIT.
098db9dd 9093 (SET_SAVED_BUTTON_EVENT): Define only if USE_X_TOOLKIT || USE_GTK.
dda3aedd 9094 * xterm.h (x_dispatch_event): Extern only if USE_X_TOOLKIT.
841a1577
JB
9095 * xterm.c, xterm.h (x_mouse_leave): Bring this function back, but only
9096 if defined HAVE_MENUS && !defined USE_X_TOOLKIT && !defined USE_GTK.
098db9dd 9097
eb18f6cc
PE
9098 * xmenu.c (menu_help_callback): Pointer type fixes.
9099 Use const pointers when pointing at readonly data. Avoid pointer
9100 signedness clashes.
9101 (FALSE): Remove unused macro.
9102 (update_frame_menubar): Remove unused decl.
9103
1fe72bf8
PE
9104 * xfns.c (Fx_hide_tip): Move locals to avoid shadowing.
9105
60d9e1db
PE
9106 * menu.c (push_submenu_start, push_submenu_end): Do not define unless
9107 USE_X_TOOLKIT || USE_GTK || HAVE_NS || defined HAVE_NTGUI.
9108 (single_menu_item): Rename local to avoid shadowing.
9109
39261c26
PE
9110 * keyboard.c (make_lispy_event): Remove unused local var.
9111
018c5e19
PE
9112 * frame.c, frame.h (x_get_resource_string): Bring this back, but
9113 only if HAVE_X_WINDOWS && !USE_X_TOOLKIT.
9114
63d2b86e
PE
9115 * bitmaps: Change bitmaps from unsigned char back to the X11
9116 compatible char. Avoid the old compiler warnings about
9117 out-of-range initializers by using, for example, '\xab' rather
9118 than 0xab.
9119
aefd87e1
PE
9120 * xgselect.c (xgselect_initialize): Check vs interface
9121 even if ! (defined (USE_GTK) || defined (HAVE_GCONF)).
9122
bf501fb9
PE
9123 * xmenu.c (xmenu_show): Rename parm to avoid shadowing.
9124
e9829fdf
PE
9125 * xterm.c (x_create_toolkit_scroll_bar): Use const * for pointers
9126 to read-only memory.
9127
1086c095
PE
9128 * fns.c (vector): Remove; this old hack is no longer needed.
9129
2baccd04 9130 * xsmfns.c (create_client_leader_window): Rename shadowing arg.
401f10cb 9131 Remove unused var.
dde42981 9132 (gdk_x11_set_sm_client_id) [!USE_GTK]: Don't define.
2baccd04 9133
72391843 9134 * xrdb.c (x_load_resources): Omit unused local.
3565b346 9135
436c16df 9136 * xfns.c (free_frame_menubar, atof): Remove duplicate decls.
8a94ea33 9137 (x_window): Rename locals to avoid shadowing.
dc5ddd85 9138 (USG): Use the kludged USG macro, to pacify gcc.
436c16df 9139
92bb796d 9140 * xterm.c (x_alloc_nearest_color_for_widget): Remove; unused.
bbbef9e1 9141 (x_term_init): Remove local to avoid shadowing.
92bb796d 9142
764430a3 9143 * xfns.c, xterm.c (_XEditResCheckMessages): Protoize decl.
4887c6e2
PE
9144
9145 * xdisp.c, dispextern.h (set_vertical_scroll_bar): Now extern if
9146 USE_TOOLKIT_SCROLL_BARS && !USE_GTK, as xterm.c needs it then.
9147
d1dfb56c
EZ
91482011-04-16 Eli Zaretskii <eliz@gnu.org>
9149
c4354cb4
EZ
9150 * gnutls.c (Fgnutls_boot): Don't pass Lisp_Object to `error'.
9151
d1dfb56c
EZ
9152 Fix regex.c, syntax.c and friends for buffers > 2GB.
9153 * syntax.h (struct gl_state_s): Declare character position members
9154 EMACS_INT.
9155
9156 * syntax.c (update_syntax_table): Declare 2nd argument EMACS_INT.
9157
04f2d78b
CB
9158 * textprop.c (verify_interval_modification, interval_of):
9159 Declare arguments EMACS_INT.
d1dfb56c
EZ
9160
9161 * intervals.c (adjust_intervals_for_insertion): Declare arguments
9162 EMACS_INT.
9163
9164 * intervals.h (CHECK_TOTAL_LENGTH): Cast to EMACS_INT, not `int'.
9165
9166 * indent.c (Fvertical_motion): Local variable it_start is now
9167 EMACS_INT.
9168
9169 * regex.c (re_match, re_match_2, re_match_2_internal)
9170 (bcmp_translate, regcomp, regexec, print_double_string)
9171 (group_in_compile_stack, re_search, re_search_2, regex_compile)
9172 (re_compile_pattern, re_exec): Declare arguments and local
9173 variables `size_t' and `ssize_t' and return values `regoff_t', as
9174 appropriate.
9175 (POP_FAILURE_REG_OR_COUNT) <pfreg>: Declare `long'.
9176 (CHECK_INFINITE_LOOP) <failure>: Declare `ssize_t'.
9177 <compile_stack_type>: `size' and `avail' are now `size_t'.
9178
9179 * regex.h <regoff_t>: Use ssize_t, not int.
9180 (re_search, re_search_2, re_match, re_match_2): Arguments that
9181 specify buffer/string position and length are now ssize_t and
9182 size_t. Return type is regoff_t.
9183
613052cd
BK
91842011-04-16 Ben Key <bkey76@gmail.com>
9185
9186 * nsfont.m: Fixed bugs in ns_get_family and
9187 ns_descriptor_to_entity that were caused by using free to
9188 deallocate memory blocks that were allocated by xmalloc (via
9189 xstrdup). This caused Emacs to crash when compiled with
9190 XMALLOC_OVERRUN_CHECK defined (when Emacs was configured with
9191 --enable-checking=xmallocoverrun). xfree is now used to
9192 deallocate these memory blocks.
9193
4170f62f 91942011-04-15 Paul Eggert <eggert@cs.ucla.edu>
3e047f51 9195
71b41406
PE
9196 * sysdep.c (emacs_read): Remove unnecessary check vs MAX_RW_COUNT.
9197
9587a89d
PE
9198 emacs_write: Accept and return EMACS_INT for sizes.
9199 See http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00514.html
9200 et seq.
9201 * gnutls.c, gnutls.h (emacs_gnutls_read, emacs_gnutls_write):
9202 Accept and return EMACS_INT.
9203 (emacs_gnutls_write): Return the number of bytes written on
9204 partial writes.
9205 * sysdep.c, lisp.h (emacs_read, emacs_write): Likewise.
273a5f82
PE
9206 (emacs_read, emacs_write): Remove check for negative size, as the
9207 Emacs source code has been audited now.
9587a89d
PE
9208 * sysdep.c (MAX_RW_COUNT): New macro, to work around kernel bugs.
9209 (emacs_read, emacs_write): Use it.
273a5f82
PE
9210 * process.c (send_process): Adjust to the new signatures of
9211 emacs_write and emacs_gnutls_write. Do not attempt to store
9212 a byte offset into an 'int'; it might overflow.
9587a89d 9213 See http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00483.html
273a5f82 9214
3e047f51
PE
9215 * sound.c: Don't assume sizes fit in 'int'.
9216 (struct sound_device.period_size, alsa_period_size):
9c3c56a7 9217 Return EMACS_INT, not int.
3e047f51 9218 (struct sound_device.write, vox_write, alsa_write):
9c3c56a7
PE
9219 Accept EMACS_INT, not int.
9220 (wav_play, au_play): Use EMACS_INT to store sizes and to
3e047f51
PE
9221 record read return values.
9222
cc39a9db
BK
92232011-04-15 Ben Key <bkey76@gmail.com>
9224
c9d0ec6d
JB
9225 * keyboard.c (Qundefined): Don't declare static since it is used
9226 in nsfns.m.
9227 * xfaces.c (Qbold, Qexpanded, Qitalic, Qcondensed): Don't declare
9228 static since they are used in nsfont.m.
cc39a9db 9229
6c60eb9f
SM
92302011-04-15 Stefan Monnier <monnier@iro.umontreal.ca>
9231
9232 * process.c (Qprocessp): Don't declare static.
9233 * lisp.h (Qprocessp): Declare again.
9234
7990b61a
JB
92352011-04-15 Juanma Barranquero <lekktu@gmail.com>
9236
9237 * font.c (Qopentype): Don't make static (used from w32uniscribe.c).
9238
5d4cb038
PE
92392011-04-14 Paul Eggert <eggert@cs.ucla.edu>
9240
8bd7b830 9241 Improve C-level modularity by making more things 'static'.
cd64ea1d 9242
e3b27b31
PE
9243 Don't publish debugger-only interfaces to other modules.
9244 * lisp.h (safe_debug_print, debug_output_compilation_hack):
9245 (verify_bytepos, count_markers): Move decls to the only modules
9246 that need them.
9247 * region-cache.h (pp_cache): Likewise.
9248 * window.h (check_all_windows): Likewise.
9249 * marker.c, print.c, region-cache.c, window.c: Decls moved here.
9250
5d4cb038
PE
9251 * sysdep.c (croak): Now static, if
9252 defined TIOCNOTTY || defined USG5 || defined CYGWIN.
9253 * syssignal.h (croak): Declare only if not static.
69003fd8
PE
9254
9255 * alloc.c (refill_memory_reserve): Now static if
9256 !defined REL_ALLOC || defined SYSTEM_MALLOC.
9257 * lisp.h (refill_memory_reserve): Declare only if not static.
93ea6e8f 9258
e87b6180
PE
9259 * xsettings.c, xsettings.h (xsettings_get_system_normal_font):
9260 Define only if USE_LUCID.
9261
ac64929e
PE
9262 * xrdb.c (x_customization_string, x_rm_string): Now static.
9263
6f37259d
PE
9264 * xmenu.c (x_menu_wait_for_event): Export only if USE_MOTIF.
9265 * xterm.h (x_menu_wait_for_event): Declare only if USE_MOTIF.
9266
1683e3ab
PE
9267 * xdisp.c (draw_row_with_mouse_face): Now static.
9268 * dispextern.h (draw_row_with_mouse_fave): Remove decl.
9269
de9c2632
PE
9270 * window.h (check_all_windows): Mark externally visible.
9271
2b96acb7
PE
9272 * window.c (window_deletion_count): Now static.
9273
9274 * undo.c: Make symbols static if they're not exported.
9275 (last_undo_buffer, last_boundary_position, pending_boundary):
9276 Now static.
9277
50436f33
PE
9278 * textprop.c (interval_insert_behind_hooks): Now static.
9279 (interval_insert_in_front_hooks): Likewise.
9280
64520e5c
PE
9281 * term.c: Make symbols static if they're not exported.
9282 (tty_turn_off_highlight, get_tty_terminal, max_frame_cols):
9283 (max_frame_lines, tty_set_terminal_modes):
9284 (tty_reset_terminal_modes, tty_turn_off_highlight):
9285 (get_tty_terminal): Now static.
9286 (term_mouse_moveto): Do not define if HAVE_WINDOW_SYSTEM.
9287 * termhooks.h (term_mouse_moveto): Do not declare if
8bd7b830 9288 HAVE_WINDOW_SYSTEM.
64520e5c
PE
9289 * dispextern.h (tty_set_terminal_modes, tty_reset_terminal_modes):
9290 (tty_turn_off_highlight, get_tty_terminal): Remove decls.
9291
1fa53021
PE
9292 * sysdep.c: Make symbols static if they're not exported.
9293 (emacs_get_tty, emacs_set_tty, old_fcntl_flags, old_fcntl_owner):
9294 Now static.
9295 (sigprocmask_set, full_mask): Remove; unused.
9296 (wait_debugging): Mark as visible.
9297 * syssignal.h (SIGFULLMASK, full_mask): Remove decls.
9298 * systty.h (emacs_get_tty, emacs_set_tty): Remove decls.
9299
d4b43b22
PE
9300 * syntax.c (syntax_temp): Define only if !__GNUC__.
9301
b7c513d0
PE
9302 * sound.c (current_sound_device, current_sound): Now static.
9303
989b29ad
PE
9304 * search.c (searchbufs, searchbuf_head): Now static.
9305
13a55a78
PE
9306 * scroll.c (scroll_cost): Remove; unused.
9307 * dispextern.h (scroll_cost): Remove decl.
9308
de68a1fc
PE
9309 * region-cache.h (pp_cache): Mark as externally visible.
9310
40ccffa6
PE
9311 * process.c: Make symbols static if they're not exported.
9312 (process_tick, update_tick, create_process, chan_process):
9313 (Vprocess_alist, proc_buffered_char, datagram_access):
9314 (fd_callback_data, send_process_frame, process_sent_to): Now static.
9315 (deactivate_process): Mark defn as static, as well as decl.
9316 * lisp.h (create_process): Remove decl.
9317 * process.h (chan_process, Vprocess_alist): Remove decls.
9318
ad64fc97
PE
9319 * print.c: Make symbols static if they're not exported.
9320 (print_depth, new_backquote_output, being_printed, print_buffer):
9321 (print_buffer_size, print_buffer_pos, print_buffer_pos_byte):
9322 (print_interval, print_number_index, initial_stderr_stream):
9323 Now static.
9324 * lisp.h (Fprinc): Remove decl.
9325 (debug_output_compilation_hack): Mark as externally visible.
9326
adddb265
PE
9327 * sysdep.c (croak): Move decl from here to syssignal.h.
9328 * syssignal.h (croak): Put it here, so the API can be checked when
9329 'croak' is called from dissociate_if_controlling_tty.
9330
1717ede2
PE
9331 * minibuf.c: Make symbols static if they're not exported.
9332 (minibuf_save_list, choose_minibuf_frame): Now static.
9333 * lisp.h (choose_minibuf_frame): Remove decl.
9334
fa5fb2bc
PE
9335 * lisp.h (verify_bytepos, count_markers): Mark as externally visible.
9336
1e3890d1
PE
9337 * lread.c: Make symbols static if they're not exported.
9338 (read_objects, initial_obarray, oblookup_last_bucket_number):
9339 Now static.
9340 (make_symbol): Remove; unused.
9341 * lisp.h (initial_obarray, make_symbol): Remove decls.
9342
8a1414fa
PE
9343 * keyboard.c: Make symbols static if they're not exported.
9344 (single_kboard, recent_keys_index, total_keys, recent_keys):
9345 (this_command_key_count_reset, raw_keybuf, raw_keybuf_count):
9346 (this_single_command_key_start, echoing, last_auto_save):
9347 (read_key_sequence_cmd, dribble, recursive_edit_unwind):
9348 (command_loop, echo_now, keyboard_init_hook, help_char_p):
9349 (quit_throw_to_read_char, command_loop_2, top_level_1, poll_timer):
9350 (Vlispy_mouse_stem, double_click_count):
9351 Now static.
9352 (force_auto_save_soon): Define only if SIGDANGER.
9353 (ignore_mouse_drag_p): Now static if
9354 !defined HAVE_WINDOW_SYSTEM || defined USE_GTK || defined HAVE_NS.
9355 (print_help): Remove; unused.
9356 (stop_character, last_timer_event): Mark as externally visible.
9357 * keyboard.h (ignore_mouse_drag_p): Declare only if
9358 defined HAVE_WINDOW_SYSTEM && !defined USE_GTK && !defined HAVE_NS.
9359 (echo_now, help_char_p, quit_throw_to_read_char): Remove decls.
9360 * lisp.h (echoing): Remove decl.
9361 (force_auto_save_soon): Declare only if SIGDANGER.
9362 * xdisp.c (redisplay_window): Simplify code, to make it more
9363 obvious that ignore_mouse_drag_p is not accessed if !defined
9364 USE_GTK && !defined HAVE_NS.
9365
93ea6e8f
PE
9366 * intervals.c: Make symbols static if they're not exported.
9367 (merge_properties_sticky, merge_interval_right, delete_interval):
9368 Now static.
9369 * intervals.h (merge_interval_right, delete_interval): Remove decls.
9370
77382fcc
PE
9371 * insdel.c: Make symbols static if they're not exported.
9372 However, leave prepare_to_modify_buffer alone. It's never
9373 called from outside this function, but that appears to be a bug.
9374 (combine_after_change_list, combine_after_change_buffer):
4889fc82 9375 (adjust_after_replace, signal_before_change): Now static.
77382fcc
PE
9376 (adjust_after_replace_noundo): Remove; unused.
9377 * lisp.h (adjust_after_replace, adjust_after_replace_noundo):
4889fc82 9378 (signal_before_change): Remove decls.
77382fcc 9379
9306c32e
PE
9380 * indent.c (val_compute_motion, val_vmotion): Now static.
9381
cd44d2eb
PE
9382 * image.c: Make symbols static if they're not exported.
9383 * dispextern.h (x_create_bitmap_from_xpm_data): Do not declare
9384 if USE_GTK.
9385 * image.c (x_create_bitmap_from_xpm_data): Do not define if USE_GTK.
9386 (xpm_color_cache, ct_table, ct_colors_allocated): Now static.
9387
ad9a7a06
PE
9388 * fringe.c (standard_bitmaps): Now static.
9389 (max_used_fringe_bitmap): Now static, unless HAVE_NS.
9390
81626931
PE
9391 * frame.c: Make symbols static if they're not exported.
9392 (x_report_frame_params, make_terminal_frame): Now static.
9393 (get_frame_param): Now static, unless HAVE_NS.
9394 (x_fullscreen_adjust): Define if WINDOWSNT, not if HAVE_WINDOW_SYSTEM.
9395 (x_get_resource_string): Remove; not used.
9396 * frame.h (make_terminal_frame, x_report_frame_params):
9397 (x_get_resource_string); Remove decls.
9398 (x_fullscreen_adjust): Declare only if WINDOWSNT.
9399 * lisp.h (get_frame_param): Declare only if HAVE_NS.
9400
239f9db9
PE
9401 * font.c, fontset.c: Make symbols static if they're not exported.
9402 * dispextern.h (FACE_SUITABLE_FOR_ASCII_CHAR_P): New macro.
9403 (FACE_SUITABLE_FOR_CHAR_P): Use it.
9404 * font.c (font_close_object): Now static.
9405 * font.h (font_close_object): Remove.
9406 * fontset.c (FONTSET_OBJLIST): Remove.
9407 (free_realized_fontset) #if-0 the body, which does nothing.
9408 (face_suitable_for_char_p): #if-0, as it's never called.
9409 * fontset.h (face_suitable_for_char_p): Remove decl.
04f2d78b
CB
9410 * xfaces.c (face_at_string_position):
9411 Use FACE_SUITABLE_FOR_ASCII_CHAR_P, not FACE_SUITABLE_FOR_CHAR_P,
239f9db9
PE
9412 since 0 is always ASCII.
9413
dfcf3579
PE
9414 * fns.c (weak_hash_tables): Now static.
9415
5045092b
PE
9416 * fileio.c: Make symbols static if they're not exported.
9417 (auto_saving, auto_save_mode_bits, auto_save_error_occurred):
9418 (Vwrite_region_annotation_buffers): Now static.
9419
57a96f5c
PE
9420 * eval.c: Make symbols static if they're not exported.
9421 (backtrace_list, lisp_eval_depth, when_entered_debugger): Now static.
9422 * lisp.h (backtrace_list): Remove decl.
9423
35f08c38
PE
9424 * emacs.c: Make symbols static if they're not exported.
9425 (malloc_state_ptr, malloc_using_checking, syms_of_emacs):
9426 (fatal_error_code, fatal_error_signal_hook, standard_args):
9427 Now static.
9428 (fatal_error_signal): Now static, unless FLOAT_CATCH_SIGKILL.
9429 (DEFINE_DUMMY_FUNCTION): Mark function as externally visible.
9430 (__CTOR_LIST__, __DTOR_LIST__): Now externally visible.
9431 * lisp.h (fatal_error_signal_hook): Remove decl.
9432 (fatal_error_signal): Declare only if FLOAT_CATCH_SIGKILL.
9433
f44bd759
PE
9434 * editfns.c: Move a (normally-unused) function to its only use.
9435 * editfns.c, lisp.h (get_operating_system_release): Remove.
9436 * process.c (init_process) [DARWIN_OS]: Do it inline, as it is not
9437 worth the hassle of breaking this out.
9438
b532497d
PE
9439 * xterm.c: Make symbols static if they're not exported.
9440 (x_raise_frame, x_lower_frame, x_wm_set_window_state):
9441 (x_wm_set_icon_pixmap, x_initialize, XTread_socket_fake_io_error):
9442 (x_destroy_window, x_delete_display):
9443 Now static.
9444 (x_dispatch_event): Now static if ! (USE_MOTIF || USE_X_TOOLKIT).
9445 (x_mouse_leave): Remove; unused.
9446 * xterm.h (x_display_info_for_name, x_raise_frame, x_lower_frame):
9447 (x_destroy_window, x_wm_set_window_state, x_wm_set_icon_pixmap):
9448 (x_delete_display, x_initialize, x_set_border_pixel, x_screen_planes):
9449 Remove decls.
9450 (x_mouse_leave): Declare only if WINDOWSNT.
9451 (x_dispatch_event): Declare only if USE_MOTIF or USE_X_TOOLKIT.
9452 (xic_create_fontsetname): Declare only if HAVE_X_WINDOWS &&
9453 USE_X_TOOLKIT.
9454
1675728f
PE
9455 * ftxfont.c: Make symbols static if they're not exported.
9456 (ftxfont_driver): Export only if !defined HAVE_XFT && def8ined
9457 HAVE_FREETYPE.
9458 * font.h (ftxfont_driver): Likewise.
9459
e4cebfca
PE
9460 * xfns.c: Make symbols static if they're not exported.
9461 (x_last_font_name, x_display_info_for_name):
9462 (x_set_foreground_color, x_set_background_color, x_set_mouse_color):
9463 (x_set_cursor_color, x_set_border_pixel, x_set_border_color):
9464 (x_set_cursor_type, x_set_icon_type, x_set_icon_name):
9465 (x_set_scroll_bar_foreground, x_set_scroll_bar_background):
9466 (x_explicitly_set_name, x_set_title, xic_defaut_fontset, tip_timer):
9467 (last_show_tip_args): Now static.
9468 (xic_defaut_fontset, xic_create_fontsetname): Define only if
9469 defined HAVE_X_WINDOWS && defined USE_X_TOOLKIT
9470 (x_screen_planes): Remove; unused.
9471 * dispextern.h (x_screen_planes): Remove decl.
9472
5bf46f05
PE
9473 * dispnew.c: Make symbols static if they're not exported.
9474 * dispextern.h (redraw_garbaged_frames, scrolling):
9475 (increment_row_positions): Remove.
9476 * dispnew.c (new_glyph_matrix, increment_row_positions, scrolling):
9477 (delayed_size_change, glyph_matrix_count, glyph_pool_count):
9478 Now static.
9479 (redraw_garbaged_frames): Remove; unused.
9480
435f4c28
PE
9481 * xfaces.c: Make symbols static if they're not exported.
9482 * dispextern.h (ascii_face_of_lisp_face, free_realized_face):
9483 Remove decls.
9484 * xterm.h (defined_color): Remove decls.
9485 (x_free_dpy_colors): Declare only if USE_X_TOOLKIT.
9486 * xfaces.c (tty_suppress_bold_inverse_default_colors_p):
9487 (menu_face_changed_default, defined_color, free_realized_face):
9488 (x_free_dpy_colors): Define only if USE_X_TOOLKIT.
9489 (ascii_face_of_lisp_face): Remove; unused.
9490
8524aef3
PE
9491 * xdisp.c: Make symbols static if they're not exported.
9492 * dispextern.h (scratch_glyph_row, window_box_edges):
9493 (glyph_to_pixel_coords, set_cursor_from_row):
9494 (get_next_display_element, set_iterator_to_next):
9495 (highlight_trailing_whitespace, frame_to_window_pixel_xy):
9496 (show_mouse_face): Remove decls
9497 * frame.h (message_buf_print): Likewise.
9498 * lisp.h (pop_message, set_message, check_point_in_composition):
9499 Likewise.
9500 * xterm.h (set_vertical_scroll_bar): Likewise.
9501 * xdisp.c (list_of_error, Vmessage_stack, line_number_displayed):
9502 (message_buf_print, scratch_glyph_row, displayed_buffer):
9503 (set_iterator_to_next, pop_message, set_message, set_cursor_from_row):
9504 (get_next_display_element, show_mouse_face, window_box_edges):
9505 (frame_to_window_pixel_xy, check_point_in_composition):
9506 (set_vertical_scroll_bar, highlight_trailing_whitespace): Now static.
9507 (glyph_to_pixel_coords): Remove; unused.
9508
16390cd2
PE
9509 * dired.c (file_name_completion): Now static.
9510
9511 * dbusbind.c (xd_in_read_queued_messages): Now static.
9512
a25f4dfa
PE
9513 * lisp.h (circular_list_error, FOREACH): Remove; unused.
9514 * data.c (circular_list_error): Remove.
9515
14a9c8df
PE
9516 * commands.h (last_point_position, last_point_position_buffer):
9517 (last_point_position_window): Remove decls.
9518 * keyboard.c: Make these variables static.
9519
04f2d78b
CB
9520 * coding.h (coding, code_convert_region, encode_coding_gap):
9521 Remove decls.
74ab6df5
PE
9522 * coding.c (Vsjis_coding_system, Vbig5_coding_system):
9523 (iso_code_class, detect_coding, code_convert_region): Now static.
9524 (encode_coding_gap): Remove; unused.
9525
38dfbee1
PE
9526 * chartab.c (chartab_chars, chartab_bits): Now static.
9527
a2cb4e63
PE
9528 * charset.h (charset_iso_8859_1): Remove decl.
9529 * charset.c (charset_iso_8859_1, charset_emacs, map_charset_for_dump):
9530 Now static.
9531
127198fd
PE
9532 * ccl.h (check_ccl_update, Vccl_program_table): Remove decls.
9533 * ccl.c (Vccl_program_table): Now static.
9534 (check_ccl_update): Remove; unused.
9535
d85b608f
PE
9536 * category.c (SET_CATEGORY_SET, set_category_set): Move here.
9537 * category.h: ... from here.
9538 * category.c (check_category_table, set_category_set): Now static.
9539
31cd66f3
PE
9540 * casetab.c (Vascii_upcase_table, Vascii_eqv_table): Now static.
9541 * lisp.h: Remove these decls.
9542
c358e587
PE
9543 * buffer.c (buffer_count): Remove unused var.
9544
e78aecca
PE
9545 * bidi.c (bidi_dump_cached_states): Mark as externally visible,
9546 so that it's not optimized away.
9547 (bidi_ignore_explicit_marks_for_paragraph_level): Likewise.
9548 * dispextern.h (bidi_dump_cached_states): Remove, since it's
9549 exported only to the debugger.
9550
e192d7d3 9551 * atimer.c (alarm_signal_handler, run_all_atimers): Now static.
04f2d78b 9552 * atimer.h (run_all_atimers): Remove; not exported.
e192d7d3 9553
92470028
PE
9554 font.c: Make copy_font_spec and merge_font_spec ordinary C functions.
9555 * font.c (copy_font_spec): Rename from Fcopy_font_spec, since it
9556 was inaccessible from Lisp.
9557 (merge_font_spec): Likewise, renaming from Fmerge_font_spec.
9558 * font.c, font.h, fontset.c, xfaces.c, xfont.c: Change all uses.
9559
244ed907
PE
9560 alloc.c: Import and export fewer symbols, and remove unused items.
9561 * lisp.h (suppress_checking, die): Declare only if ENABLE_CHECKING
9562 is defined.
9563 (suppress_checking): Add EXTERNALLY_VISIBLE attribute, so that
9564 it's not optimized away by whole-program optimization.
9565 (message_enable_multibyte, free_misc): Remove.
9566 (catchlist, handlerlist, mark_backtrace):
9567 Declare only if BYTE_MARK_STACK.
9568 (mark_byte_stack): Likewise, fixing a ifdef-vs-if typo.
9569 * alloc.c (pure): Export only if VIRT_ADDR_VARIES is defined.
9570 (message_enable_multibyte): Remove decl.
9571 (free_misc, interval_free_list, float_block, float_block_index):
9572 (n_float_blocks, float_free_list, cons_block, cons_block_index):
9573 (cons_free_list, last_marked_index):
9574 Now static.
9575 (suppress_checking, die): Define only if ENABLE_CHECKING is defined.
9576 * eval.c (catchlist, handlerlist): Export only if BYTE_MARK_STACK.
9577 (mark_backtrace): Define only if BYTE_MARK_STACK.
9578 * xdisp.c (message_enable_multibyte): Now static.
9579
61c2b50e 9580 Declare Lisp_Object Q* variables to be 'static' if not exported.
955cbe7b
PE
9581 This makes it easier for human readers (and static analyzers)
9582 to see whether these variables are used from other modules.
9583 * alloc.c, buffer.c, bytecode.c, callint.c, casetab.c, category.c:
9584 * ccl.c, character.c, charset.c, cmds.c, coding.c, composite.c:
9585 * data.c, dbusbind.c, dired.c, editfns.c, eval.c, fileio.c, fns.c:
9586 * font.c, frame.c, fringe.c, ftfont.c, image.c, keyboard.c, keymap.c:
9587 * lread.c, macros.c, minibuf.c, print.c, process.c, search.c:
9588 * sound.c, syntax.c, textprop.c, window.c, xdisp.c, xfaces.c, xfns.c:
9589 * xmenu.c, xselect.c:
9590 Declare Q* vars static if they are not used in other modules.
9591 * ccl.h, character.h, charset.h, coding.h, composite.h, font.h:
9592 * frame.h, intervals.h, keyboard.h, lisp.h, process.h, syntax.h:
9593 Remove decls of unexported vars.
9594 * keyboard.h (EVENT_HEAD_UNMODIFIED): Remove now-unused macro.
9595
95c82688
PE
9596 * lisp.h (DEFINE_FUNC): Make sname 'static'.
9597
16a97296
PE
9598 Make Emacs functions such as Fatom 'static' by default.
9599 This makes it easier for human readers (and static analyzers)
9600 to see whether these functions can be called from other modules.
9601 DEFUN now defines a static function. To make the function external
9602 so that it can be used in other C modules, use the new macro DEFUE.
8bd7b830
PE
9603 * lisp.h (Funibyte_char_to_multibyte, Fsyntax_table_p):
9604 (Finit_image_library):
16a97296
PE
9605 (Feval_region, Fbacktrace, Ffetch_bytecode, Fswitch_to_buffer):
9606 (Ffile_executable_p, Fmake_symbolic_link, Fcommand_execute):
9607 (Fget_process, Fdocumentation_property, Fbyte_code, Ffile_attributes):
9608 Remove decls, since these functions are now static.
9609 (Funintern, Fget_internal_run_time): New decls, since these functions
9610 were already external.
95c82688 9611
16a97296
PE
9612 * alloc.c, buffer.c, callint.c, callproc.c, casefiddle.c, casetab.c:
9613 * ccl.c, character.c, chartab.c, cmds.c, coding.c, data.c, dispnew.c:
9614 * doc.c, editfns.c, emacs.c, eval.c, fileio.c, filelock.c, floatfns.c:
9615 * fns.c, font.c, fontset.c, frame.c, image.c, indent.c:
9616 * keyboard.c, keymap.c, lread.c:
9617 * macros.c, marker.c, menu.c, minibuf.c, print.c, process.c, search.c:
9618 * syntax.c, term.c, terminal.c, textprop.c, undo.c:
9619 * window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xsettings.c:
9620 Mark functions with DEFUE instead of DEFUN,
9621 if they are used in other modules.
9622 * buffer.c (Fset_buffer_major_mode, Fdelete_overlay): New forward
9623 decls for now-static functions.
9624 * buffer.h (Fdelete_overlay): Remove decl.
9625 * callproc.c (Fgetenv_internal): Mark as internal.
9626 * composite.c (Fremove_list_of_text_properties): Remove decl.
9627 (Fcomposition_get_gstring): New forward static decl.
9628 * composite.h (Fcomposite_get_gstring): Remove decl.
9629 * dired.c (Ffile_attributes): New forward static decl.
9630 * doc.c (Fdocumntation_property): New forward static decl.
9631 * eval.c (Ffetch_bytecode): New forward static decl.
9632 (Funintern): Remove extern decl; now in .h file where it belongs.
9633 * fileio.c (Fmake_symbolic_link): New forward static decl.
9634 * image.c (Finit_image_library): New forward static decl.
9635 * insdel.c (Fcombine_after_change_execute): Make forward decl static.
9636 * intervals.h (Fprevious_property_change):
9637 (Fremove_list_of_text_properties): Remove decls.
9638 * keyboard.c (Fthis_command_keys): Remove decl.
9639 (Fcommand_execute): New forward static decl.
9640 * keymap.c (Flookup_key): New forward static decl.
9641 (Fcopy_keymap): Now static.
9642 * keymap.h (Flookup_key): Remove decl.
9643 * process.c (Fget_process): New forward static decl.
9644 (Fprocess_datagram_address): Mark as internal.
9645 * syntax.c (Fsyntax_table_p): New forward static decl.
9646 (skip_chars): Remove duplicate decl.
9647 * textprop.c (Fprevious_property_change): New forward static decl.
9648 * window.c (Fset_window_fringes, Fset_window_scroll_bars):
9649 Now internal.
9650 (Fset_window_margins, Fset_window_vscroll): New forward static decls.
9651 * window.h (Fset_window_vscroll, Fset_window_margins): Remove decls.
9652
785bbd42
PE
9653 * editfns.c (Fformat): Remove unreachable code.
9654
8b913b57
AS
96552011-04-14 Andreas Schwab <schwab@linux-m68k.org>
9656
9657 * fileio.c (Finsert_file_contents): Fix typo in 2005-05-13
9658 change. (Bug#8496)
9659
a6744a35
EZ
96602011-04-13 Eli Zaretskii <eliz@gnu.org>
9661
9662 * xdisp.c (handle_invisible_prop): Don't call bidi_paragraph_init
9663 when at ZV. (Bug#8487)
9664
e7974947
AS
96652011-04-12 Andreas Schwab <schwab@linux-m68k.org>
9666
baad03f0
AS
9667 * charset.c (Fclear_charset_maps): Use xfree instead of free.
9668 (Bug#8437)
9669 * keyboard.c (parse_tool_bar_item): Likewise.
9670 * sound.c (sound_cleanup, alsa_close): Likewise.
9671 * termcap.c (tgetent): Likewise.
9672 * xfns.c (x_default_font_parameter): Likewise.
9673 * xsettings.c (read_and_apply_settings): Likewise.
9674
e7974947
AS
9675 * alloc.c (overrun_check_malloc, overrun_check_realloc)
9676 (overrun_check_free): Protoize.
9677
28272684
PE
96782011-04-12 Paul Eggert <eggert@cs.ucla.edu>
9679
9680 * sysdep.c (emacs_read, emacs_write): Check for negative sizes
9681 since callers should never pass a negative size.
9682 Change the signature to match that of plain 'read' and 'write'; see
9683 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00397.html>.
9684 * lisp.h: Update prototypes of emacs_write and emacs_read.
9685
11997c76
EZ
96862011-04-11 Eli Zaretskii <eliz@gnu.org>
9687
9688 * xdisp.c (redisplay_window): Don't try to determine the character
9689 position of the scroll margin if the window start point w->startp
e896f03c 9690 is outside the buffer's accessible region. (Bug#8468)
11997c76 9691
8a2cbd72
EZ
96922011-04-10 Eli Zaretskii <eliz@gnu.org>
9693
9694 Fix write-region and its subroutines for buffers > 2GB.
9695 * fileio.c (a_write, e_write): Modify declaration of arguments and
9696 local variables to support buffers larger than 2GB.
9697 (Fcopy_file): Use EMACS_INT for return value of emacs_read.
9698
9699 * sysdep.c (emacs_write, emacs_read): Use ssize_t for last
9700 argument, local variables, and return value.
9701
9702 * lisp.h: Update prototypes of emacs_write and emacs_read.
9703
9704 * sound.c (vox_write): Use ssize_t for return value of emacs_write.
9705
4073e537 97062011-04-10 Paul Eggert <eggert@cs.ucla.edu>
eb3f1cc8 9707
1ebfdcb6
PE
9708 * xdisp.c (vmessage): Use memchr, not strnlen, which some hosts lack.
9709
b2ded58d
PE
9710 Fix more problems found by GCC 4.6.0's static checks.
9711
7d66342c
PE
9712 * xdisp.c (vmessage): Use a better test for character truncation.
9713
bbf47d44
PE
9714 * charset.c (load_charset_map): <, not <=, for optimization,
9715 and to avoid potential problems with integer overflow.
9248994d 9716 * chartab.c (sub_char_table_set_range, char_table_set_range): Likewise.
f9a68bc5 9717 * casetab.c (set_identity, shuffle): Likewise.
3ab1c7ce 9718 * editfns.c (Fformat): Likewise.
1e69125e 9719 * syntax.c (skip_chars): Likewise.
3befa583 9720
e3019616
PE
9721 * xmenu.c (set_frame_menubar): Allocate smaller local vectors.
9722 This also lets GCC 4.6.0 generate slightly better loop code.
9723
becfa255
PE
9724 * callint.c (Fcall_interactively): <, not <=, for optimization.
9725 (Fcall_interactively): Count the number of arguments produced,
9726 not the number of arguments given. This is simpler and lets GCC
9727 4.6.0 generate slightly better code.
9728
dae0cd48
PE
9729 * ftfont.c: Distingish more carefully between FcChar8 and char.
9730 The previous code passed unsigned char * to a functions like
9731 strlen and xstrcasecmp that expect char *, which does not
9732 conform to the C standard.
9733 (get_adstyle_property, ftfont_pattern_entity): Use FcChar8 for
9734 arguments to FcPatternGetString, and explicitly cast FcChar8 * to
9735 char * when the C standard requires it.
9736
76032d70
PE
9737 * keyboard.c (read_char): Remove unused var.
9738
eb3f1cc8
PE
9739 * eval.c: Port to Windows vsnprintf (Bug#8435).
9740 Include <limits.h>.
9741 (SIZE_MAX): Define if the headers do not.
9742 (verror): Do not give up if vsnprintf returns a negative count.
9743 Instead, grow the buffer. This ports to Windows vsnprintf, which
9744 does not conform to C99. Problem reported by Eli Zaretskii.
9745 Also, simplify the allocation scheme, by avoiding the need for
9746 calling realloc, and removing the ALLOCATED variable.
9747
70476b54
PE
9748 * eval.c (verror): Initial buffer size is 4000 (not 200) bytes.
9749
12020a9e
PE
9750 Remove invocations of doprnt, as Emacs now uses vsnprintf.
9751 But keep the doprint source code for now, as we might revamp it
9752 and use it again (Bug#8435).
ea6c7ae6
PE
9753 * lisp.h (doprnt): Remove.
9754 * Makefile.in (base_obj): Remove doprnt.o.
9755 * deps.mk (doprnt.o): Remove.
9756
5fdb398c
PE
9757 error: Print 32- and 64-bit integers portably (Bug#8435).
9758 Without this change, on typical 64-bit hosts error ("...%d...", N)
9759 was used to print both 32- and 64-bit integers N, which relied on
9760 undefined behavior.
61bdb816 9761 * lisp.h, m/amdx86-64.h, m/ia64.h, m/ibms390x.h (pEd): New macro.
5fdb398c
PE
9762 * lisp.h (error, verror): Mark as printf-like functions.
9763 * eval.c (verror): Use vsnprintf, not doprnt, to do the real work.
9764 Report overflow in size calculations when allocating printf buffer.
9765 Do not truncate output string at its first null byte.
9766 * xdisp.c (vmessage): Use vsnprintf, not doprnt, to do the real work.
9767 Truncate the output at a character boundary, since vsnprintf does not
9768 do that.
9769 * charset.c (check_iso_charset_parameter): Convert internal
9770 character to string before calling 'error', since %c now has the
9771 printf meaning.
9772 * coding.c (Fdecode_sjis_char, Fdecode_big5_char): Avoid int
9773 overflow when computing char to be passed to 'error'. Do not
9774 pass Lisp_Object to 'error'; pass the integer instead.
9775 * nsfns.m (Fns_do_applescript): Use int, not long, since it's
9776 formatted with plain %d.
9777
b189fa66
PE
9778 * eval.c (internal_lisp_condition_case): Don't pass spurious arg.
9779
bff87ef0
PE
9780 * keyboard.c (access_keymap_keyremap): Print func name, not garbage.
9781
7e2cac20
PE
9782 * coding.c (Fdecode_sjis_char): Don't assume CODE fits in int.
9783
ce4d90b5
PE
9784 * xterm.c (x_catch_errors): Remove duplicate declaration.
9785
266c9547
PE
9786 * term.c (maybe_fatal): Mark its 3rd arg as a printf format, too.
9787
79c49ad2
PE
9788 * xdisp.c, lisp.h (message_nolog): Remove; unused.
9789
368f4090
JM
97902011-04-10 Jim Meyering <meyering@redhat.com>
9791
9792 use ssize_t and size_t for read- and write-like emacs_gnutls_* functions
9793 * gnutls.c (emacs_gnutls_read): Adjust signature to be more read-like:
9794 return ssize_t not "int", and use size_t as the buffer length.
9795 (emacs_gnutls_write): Likewise, and make the buffer pointer "const".
9796 * gnutls.h: Update declarations.
9797 * process.c (read_process_output): Use ssize_t, to match.
9798 (send_process): Likewise.
9799
a32d4040
CY
98002011-04-09 Chong Yidong <cyd@stupidchicken.com>
9801
9802 * image.c (Fimagemagick_types): Doc fix, and comment cleanup.
9803
8546720e 98042011-04-09 Chong Yidong <cyd@stupidchicken.com>
aac0c6e3 9805
04f2d78b
CB
9806 * ftfont.c (get_adstyle_property, ftfont_pattern_entity):
9807 Use unsigned char, to match FcChar8 type definition.
aac0c6e3 9808
8546720e
GM
9809 * xterm.c (handle_one_xevent):
9810 * xmenu.c (create_and_show_popup_menu):
9811 * xselect.c (x_decline_selection_request)
9812 (x_reply_selection_request): Avoid type-punned deref of X events.
aac0c6e3 9813
0a2f5c1a 98142011-04-09 Eli Zaretskii <eliz@gnu.org>
a53e2e89
EZ
9815
9816 Fix some uses of `int' instead of EMACS_INT.
9817 * search.c (string_match_1, fast_string_match)
9818 (fast_c_string_match_ignore_case, fast_string_match_ignore_case)
9819 (scan_buffer, find_next_newline_no_quit)
9820 (find_before_next_newline, search_command, Freplace_match)
9821 (Fmatch_data): Make some `int' variables be EMACS_INT.
9822
9823 * xdisp.c (display_count_lines): 3rd argument and return value now
9824 EMACS_INT. All callers changed.
9825 (pint2hrstr): Last argument is now EMACS_INT.
9826
9827 * coding.c (detect_coding_utf_8, detect_coding_emacs_mule)
9828 (detect_coding_iso_2022, detect_coding_sjis, detect_coding_big5)
9829 (detect_coding_ccl, detect_coding_charset, decode_coding_utf_8)
9830 (decode_coding_utf_16, decode_coding_emacs_mule)
9831 (decode_coding_iso_2022, decode_coding_sjis, decode_coding_big5)
9832 (decode_coding_ccl, decode_coding_charset)
9833 <consumed_chars, consumed_chars_base>: Declare EMACS_INT.
9834 (decode_coding_iso_2022, decode_coding_emacs_mule)
9835 (decode_coding_sjis, decode_coding_big5, decode_coding_charset)
9836 <char_offset, last_offset>: Declare EMACS_INT.
9837 (encode_coding_utf_8, encode_coding_utf_16)
9838 (encode_coding_emacs_mule, encode_invocation_designation)
9839 (encode_designation_at_bol, encode_coding_iso_2022)
9840 (encode_coding_sjis, encode_coding_big5, encode_coding_ccl)
9841 (encode_coding_raw_text, encode_coding_charset) <produced_chars>:
9842 Declare EMACS_INT.
9843 (ASSURE_DESTINATION): Declare more_bytes EMACS_INT.
9844 (encode_invocation_designation): Last argument P_NCHARS is now
9845 EMACS_INT.
9846 (decode_eol): Declare pos_byte, pos, and pos_end EMACS_INT.
9847 (produce_chars): from_nchars and to_nchars are now EMACS_INT.
9848
9849 * coding.h (struct coding_system) <head_ascii>: Declare EMACS_INT.
9850 All users changed.
9851
9852 * ccl.c (Fccl_execute_on_string): Declare some variables
9853 EMACS_INT.
9854
8546720e 98552011-04-08 Samuel Thibault <sthibault@debian.org> (tiny change)
0080dc6b
SS
9856
9857 * term.c (init_tty): Fix incorrect ifdef placement (Bug#8450).
9858
4e19a977
CS
98592011-03-19 Christoph Scholtes <cschol2112@googlemail.com>
9860
9861 * process.c (Fformat_network_address): Doc fix.
9862
87302331
R
98632011-04-08 T.V. Raman <tv.raman.tv@gmail.com> (tiny change)
9864
ee7683eb 9865 * xml.c (parse_region): Avoid creating spurious whitespace nodes.
87302331 9866
cbb59342
CY
98672011-04-08 Chong Yidong <cyd@stupidchicken.com>
9868
9869 * keyboard.c (read_char): Call Lisp function help-form-show,
9870 instead of using internal_with_output_to_temp_buffer.
9871 (Qhelp_form_show): New var.
e0d38eeb 9872 (syms_of_keyboard): Use DEFSYM macro.
cbb59342
CY
9873
9874 * print.c (internal_with_output_to_temp_buffer): Function deleted.
9875
9876 * lisp.h (internal_with_output_to_temp_buffer): Remove prototype.
9877
e67a13ab
CY
98782011-04-06 Chong Yidong <cyd@stupidchicken.com>
9879
04f2d78b
CB
9880 * process.c (Flist_processes): Remove to Lisp.
9881 (list_processes_1): Delete.
e67a13ab 9882
973f782d
EZ
98832011-04-06 Eli Zaretskii <eliz@gnu.org>
9884
7c106b1e
EZ
9885 * msdos.c (careadlinkat, careadlinkatcwd): MS-DOS replacements.
9886
973f782d
EZ
9887 * w32.c (careadlinkat, careadlinkatcwd): New always-fail stubs.
9888
41cf7d1a 98892011-04-06 Paul Eggert <eggert@cs.ucla.edu>
27ccc379 9890
ca23cc88
PE
9891 Fix more problems found by GCC 4.6.0's static checks.
9892
f390e2d5
PE
9893 * xmenu.c (Fx_popup_dialog): Don't assume string is free of formats.
9894
42eea0d0
PE
9895 * menu.c (Fx_popup_menu): Don't assume error_name lacks printf formats.
9896
b69769da 9897 * lisp.h (message, message_nolog, fatal): Mark as printf-like.
1e973bc7 9898
f9541e84
PE
9899 * xdisp.c (vmessage): Mark as a printf-like function.
9900
13841b55
PE
9901 * term.c (vfatal, maybe_fatal): Mark as printf-like functions.
9902
c136c10f
PE
9903 * sound.c (sound_warning): Don't crash if arg contains a printf format.
9904
5e2d4a30
PE
9905 * image.c (tiff_error_handler, tiff_warning_handler): Mark as
9906 printf-like functions.
9907 (tiff_load): Add casts to remove these marks before passing them
9908 to system-supplied API.
9909
583f48b9
PE
9910 * eval.c (Fsignal): Remove excess argument to 'fatal'.
9911
b25d760e
PE
9912 * coding.c (EMIT_ONE_BYTE, EMIT_TWO_BYTES): Use unsigned, not int.
9913 This avoids several warnings with gcc -Wstrict-overflow.
d5efd1d1
PE
9914 (DECODE_COMPOSITION_RULE): If the rule is invalid, goto invalid_code
9915 directly, rather than having caller test rule sign. This avoids
9916 some unnecessary tests.
9917 * composite.h (COMPOSITION_ENCODE_RULE_VALID): New macro.
9918 (COMPOSITION_ENCODE_RULE): Arguments now must be valid. This
9919 affects only one use, in DECODE_COMPOSITION_RULE, which is changed.
b25d760e 9920
bc7b6697 9921 * xfont.c (xfont_text_extents): Remove var that was set but not used.
625a3eb1 9922 (xfont_open): Avoid unnecessary tests.
bc7b6697 9923
27ccc379
PE
9924 * composite.c (composition_gstring_put_cache): Use unsigned integer.
9925
dcd5c89a
PE
9926 * composite.h, composite.c (composition_gstring_put_cache):
9927 Use EMACS_INT, not int, for length.
9928
b13a45c6
PE
9929 * composite.h (COMPOSITION_DECODE_REFS): New macro,
9930 breaking out part of COMPOSITION_DECODE_RULE.
9931 (COMPOSITION_DECODE_RULE): Use it.
9932 * composite.c (get_composition_id): Remove unused local vars,
9933 by using the new macro.
9934
1e792e4d
PE
9935 * textprop.c (set_text_properties_1): Change while to do-while,
9936 since the condition is always true at first.
9937
dc6c6455 9938 * intervals.c (graft_intervals_into_buffer): Mark var as used.
aa86731f
PE
9939 (interval_deletion_adjustment): Return unsigned value.
9940 All uses changed.
dc6c6455 9941
aba7731a
PE
9942 * process.c (list_processes_1, create_pty, read_process_output):
9943 (exec_sentinel): Remove vars that were set but not used.
afd4052b 9944 (create_pty): Remove unnecessary "volatile"s.
bc57d757 9945 (Fnetwork_interface_info): Avoid possibility of int overflow.
82eaa333 9946 (read_process_output): Do adaptive read buffering even if carryover.
fe07cdfa 9947 (read_process_output): Simplify nbytes computation if buffered.
aba7731a 9948
fdfc4bf3
PE
9949 * bytecode.c (exec_byte_code): Rename local to avoid shadowing.
9950
fca8fe46 9951 * syntax.c (scan_words): Remove var that was set but not used.
12cbf13f 9952 (update_syntax_table): Use unsigned instead of int.
fca8fe46 9953
06a0259a 9954 * lread.c (lisp_file_lexically_bound_p): Use ints rather than endptrs.
3c346cc3 9955 (lisp_file_lexically_bound_p, read1): Use unsigned instead of int.
e6eb4e9e 9956 (safe_to_load_p): Make the end-of-loop test the inverse of the in-loop.
06a0259a 9957
e7b9e80f
PE
9958 * print.c (print_error_message): Avoid int overflow.
9959
56201685
PE
9960 * font.c (font_list_entities): Redo for clarity,
9961 so that reader need not know FONT_DPI_INDEX + 1 == FONT_SPACING_INDEX.
9962
78834453 9963 * font.c (font_find_for_lface, Ffont_get_glyphs): Remove unused vars.
790771b1 9964 (font_score): Avoid potential overflow in diff calculation.
78834453 9965
0bc0b309 9966 * fns.c (substring_both): Remove var that is set but not used.
8cd55cb4 9967 (sxhash): Redo loop for clarity and to avoid wraparound warning.
0bc0b309 9968
e610eaca
PE
9969 * eval.c (funcall_lambda): Rename local to avoid shadowing.
9970
b895abce
PE
9971 * alloc.c (mark_object_loop_halt, mark_object): Use size_t, not int.
9972 Otherwise, GCC 4.6.0 optimizes the loop check away since the check
9973 can always succeed if overflow has undefined behavior.
9974
1f1d9321 9975 * search.c (boyer_moore, wordify): Remove vars set but not used.
6f076cc7 9976 (wordify): Omit three unnecessary tests.
1f1d9321 9977
c59478bc
PE
9978 * indent.c (MULTIBYTE_BYTES_WIDTH): Don't compute wide_column.
9979 All callers changed. This avoids the need for an unused var.
9980
79b73827
PE
9981 * casefiddle.c (casify_region): Remove var that is set but not used.
9982
a4db5dfe
PE
9983 * dired.c (file_name_completion): Remove var that is set but not used.
9984
43aae36e
PE
9985 * fileio.c (Finsert_file_contents): Make EOF condition clearer.
9986
2a47c44d 9987 * fileio.c (Finsert_file_contents): Avoid signed integer overflow.
163c5f32 9988 (Finsert_file_contents): Remove unnecessary code checking fd.
2a47c44d 9989
a37c69bf
PE
9990 * minibuf.c (read_minibuf_noninteractive): Use size_t for sizes.
9991 Check for integer overflow on size calculations.
9992
328ab8e7
PE
9993 * buffer.c (Fprevious_overlay_change): Remove var that is set
9994 but not used.
9995
e5a2a5cb
PE
9996 * keyboard.c (menu_bar_items, read_char_minibuf_menu_prompt):
9997 Remove vars that are set but not used.
8d84a6eb 9998 (timer_check_2): Don't assume timer-list and idle-timer-list are lists.
6b043475 9999 (timer_check_2): Mark vars as initialized.
e5a2a5cb 10000
a60e5f68
PE
10001 * gtkutil.c (xg_get_file_with_chooser): Mark var as initialized.
10002
f661cb61 10003 * image.c (lookup_image): Remove var that is set but not used.
35fa624f 10004 (xbm_load): Use parse_p, for gcc -Werror=unused-but-set-variable.
f661cb61 10005
f0397f5a
PE
10006 * fontset.c (Finternal_char_font, Ffontset_info): Remove vars
10007 that are set but not used.
10008
8664db06 10009 * xfns.c (make_invisible_cursor): Don't return garbage
03733ee7 10010 if XCreateBitmapFromData fails (Bug#8410).
8664db06 10011
6abdaa4a
PE
10012 * xselect.c (x_get_local_selection, x_handle_property_notify):
10013 Remove vars that are set but not used.
10014
0ce7538d 10015 * xfns.c (x_create_tip_frame): Remove var that is set but not used.
6abdaa4a 10016 (make_invisible_cursor): Initialize a possibly-uninitialized variable.
0ce7538d 10017
9ae848fc
PE
10018 * xterm.c (x_scroll_bar_to_input_event) [!USE_GTK]:
10019 Remove var that is set but not used.
0b918413
PE
10020 (scroll_bar_windows_size): Now size_t, not int.
10021 (x_send_scroll_bar_event): Use size_t, not int, for sizes.
10022 Check for overflow.
9ae848fc 10023
a5a62657
PE
10024 * xfaces.c (realize_named_face): Remove vars that are set but not used.
10025 (map_tty_color) [!defined MSDOS]: Likewise.
10026
5c5cdd39
PE
10027 * term.c (tty_write_glyphs): Use size_t; this avoids overflow warning.
10028
66ebf983
PE
10029 * coding.c: Remove vars that are set but not used.
10030 (DECODE_COMPOSITION_RULE): Remove 2nd arg, which is unused.
10031 All callers changed.
10032 (decode_coding_utf_8, decode_coding_utf_16 decode_coding_emacs_mule):
10033 (decode_coding_iso_2022, encode_coding_sjis, encode_coding_big5):
10034 (decode_coding_charset): Remove vars that are set but not used.
10035
1be4d761
PE
10036 * bytecode.c (Fbyte_code) [!defined BYTE_CODE_SAFE]: Remove var
10037 that is set but not used.
10038
47553fa8
PE
10039 * print.c (print_object): Remove var that is set but not used.
10040
1f7196bf 10041 Replace 2 copies of readlink code with 1 gnulib version (Bug#8401).
d1fdcab7
PE
10042 The gnulib version avoids calling malloc in the usual case,
10043 and on 64-bit hosts doesn't have some arbitrary 32-bit limits.
10044 * fileio.c (Ffile_symlink_p): Use emacs_readlink.
10045 * filelock.c (current_lock_owner): Likewise.
10046 * lisp.h (READLINK_BUFSIZE, emacs_readlink): New function.
10047 * sysdep.c: Include allocator.h, careadlinkat.h.
10048 (emacs_no_realloc_allocator): New static constant.
10049 (emacs_readlink): New function.
fdb61804
PE
10050 * deps.mk (sysdep.o): Depend on ../lib/allocator.h and on
10051 ../lib/careadlinkat.h.
d1fdcab7 10052
f84c17c7
SM
100532011-04-04 Stefan Monnier <monnier@iro.umontreal.ca>
10054
10055 * keyboard.c (safe_run_hook_funcall): Fix last change (don't stop at the
10056 first non-nil return value).
10057
ef3862ad
JD
100582011-04-03 Jan Djärv <jan.h.d@swipnet.se>
10059
10060 * nsterm.m (ns_update_auto_hide_menu_bar): Define MAC_OS_X_VERSION_10_6
10061 if not defined (Bug#8403).
10062
376a7006
JB
100632011-04-02 Juanma Barranquero <lekktu@gmail.com>
10064
10065 * xdisp.c (display_count_lines): Remove parameter `start',
10066 unused since 1998-01-01T02:27:27Z!rms@gnu.org. All callers changed.
10067 (get_char_face_and_encoding): Remove parameter `multibyte_p',
10068 unused since 2008-05-14T01:40:23Z!handa@m17n.org. All callers changed.
10069 (fill_stretch_glyph_string): Remove parameters `row' and `area',
10070 unused at least since Kim's GUI unification at 2003-03-16T20:45:46Z!storm@cua.dk
10071 and thereabouts. All callers changed.
10072 (get_per_char_metric): Remove parameter `f', unused since
10073 2008-05-14T01:40:23Z!handa@m17n.org. All callers changed.
10074
6ca3801d
JM
100752011-04-02 Jim Meyering <meyering@redhat.com>
10076
10077 do not dereference NULL upon failed strdup
10078 * nsfont.m (ns_descriptor_to_entity): Use xstrdup, not strdup.
10079 (ns_get_family): Likewise.
10080
d8e2b5ba
JB
100812011-04-02 Juanma Barranquero <lekktu@gmail.com>
10082
10083 * eval.c (unwind_to_catch) [DEBUG_GCPRO]: Remove redundant assignment.
10084
8c74fcbd
JD
100852011-04-02 Jan Djärv <jan.h.d@swipnet.se>
10086
10087 * nsterm.m (ns_update_auto_hide_menu_bar): Only for OSX 10.6 or
10088 later (Bug#8403).
10089
7200d79c
SM
100902011-04-01 Stefan Monnier <monnier@iro.umontreal.ca>
10091
03408648 10092 Add lexical binding.
7200d79c 10093
03408648
SM
10094 * window.c (Ftemp_output_buffer_show): New fun.
10095 (Fsave_window_excursion):
10096 * print.c (Fwith_output_to_temp_buffer): Move to subr.el.
10097
10098 * lread.c (lisp_file_lexically_bound_p): New function.
10099 (Fload): Bind Qlexical_binding.
10100 (readevalloop): Remove `evalfun' arg.
10101 Bind Qinternal_interpreter_environment.
10102 (Feval_buffer): Bind Qlexical_binding.
10103 (defvar_int, defvar_bool, defvar_lisp_nopro, defvar_kboard):
10104 Mark as dynamic.
10105 (syms_of_lread): Declare `lexical-binding'.
10106
10107 * lisp.h (struct Lisp_Symbol): New field `declared_special'.
10108
10109 * keyboard.c (eval_dyn): New fun.
10110 (menu_item_eval_property): Use it.
ca105506
SM
10111
10112 * image.c (parse_image_spec): Use Ffunctionp.
ca105506 10113
03408648
SM
10114 * fns.c (concat, mapcar1): Accept byte-code-functions.
10115
10116 * eval.c (Fsetq): Handle lexical vars.
10117 (Fdefun, Fdefmacro, Ffunction): Make closures when needed.
10118 (Fdefconst, Fdefvaralias, Fdefvar): Mark as dynamic.
10119 (FletX, Flet): Obey lexical binding.
10120 (Fcommandp): Handle closures.
10121 (Feval): New `lexical' arg.
10122 (eval_sub): New function extracted from Feval. Use it almost
10123 everywhere where Feval was used. Look up vars in lexical env.
10124 Handle closures.
10125 (Ffunctionp): Move from subr.el.
10126 (Ffuncall): Handle closures.
10127 (apply_lambda): Remove `eval_flags'.
10128 (funcall_lambda): Handle closures and new byte-code-functions.
10129 (Fspecial_variable_p): New function.
10130 (syms_of_eval): Initialize the Vinternal_interpreter_environment var,
10131 but without exporting it to Lisp.
23aba0ea 10132
23aba0ea 10133 * doc.c (Fdocumentation, store_function_docstring):
03408648 10134 * data.c (Finteractive_form): Handle closures.
23aba0ea 10135
03408648
SM
10136 * callint.c (Fcall_interactively): Preserve lexical-binding mode for
10137 interactive spec.
ba83908c 10138
04f2d78b
CB
10139 * bytecode.c (Bstack_ref, Bstack_set, Bstack_set2, BdiscardN):
10140 New byte-codes.
03408648
SM
10141 (exec_byte_code): New function extracted from Fbyte_code to handle new
10142 calling convention for byte-code-functions. Add new byte-codes.
ba83908c 10143
03408648 10144 * buffer.c (defvar_per_buffer): Set new `declared_special' field.
e2abe5a1 10145
03408648 10146 * alloc.c (Fmake_symbol): Init new `declared_special' field.
e2abe5a1 10147
e2abce01
JB
101482011-03-31 Juanma Barranquero <lekktu@gmail.com>
10149
10150 * xdisp.c (redisplay_internal): Fix prototype.
10151
63696a73 101522011-03-31 Eli Zaretskii <eliz@gnu.org>
09725d26 10153
63696a73 10154 * xdisp.c (SCROLL_LIMIT): New macro.
04f2d78b
CB
10155 (try_scrolling): Use it when setting scroll_limit.
10156 Limit scrolling to 100 screen lines.
63696a73
EZ
10157 (redisplay_window): Even when falling back on "recentering",
10158 position point in the window according to scroll-conservatively,
10159 scroll-margin, and scroll-*-aggressively variables. (Bug#6671)
10160
10161 (try_scrolling): When point is above the window, allow searching
10162 as far as scroll_max, or one screenful, to compute vertical
10163 distance from PT to the scroll margin position. This prevents
10164 try_scrolling from unnecessarily failing when
10165 scroll-conservatively is set to a value slightly larger than the
10166 window height. Clean up the case of PT below the margin at bottom
10167 of window: scroll_max can no longer be INT_MAX. When aggressive
10168 scrolling is in use, don't let point enter the opposite scroll
10169 margin as result of the scroll.
10170 (syms_of_xdisp) <scroll-conservatively>: Document the
09725d26
EZ
10171 threshold of 100 lines for never-recentering scrolling.
10172
e4cc2dfc
JB
101732011-03-31 Juanma Barranquero <lekktu@gmail.com>
10174
10175 * dispextern.h (move_it_by_lines):
10176 * xdisp.c (move_it_by_lines): Remove parameter `need_y_p', unused
10177 since 2000-12-29T14:24:09Z!gerd@gnu.org. All callers changed.
10178 (message_log_check_duplicate): Remove parameters `prev_bol' and
10179 `this_bol', unused since 1998-01-01T02:27:27Z!rms@gnu.org. All callers changed.
10180 (redisplay_internal): Remove parameter `preserve_echo_area',
10181 unused since 1999-07-21T21:43:52Z!gerd@gnu.org. All callers changed.
10182
10183 * indent.c (Fvertical_motion):
10184 * window.c (window_scroll_pixel_based, Frecenter):
10185 Don't pass `need_y_p' to `move_it_by_lines'.
10186
1c470562
SM
101872011-03-30 Stefan Monnier <monnier@iro.umontreal.ca>
10188
44f230aa
SM
10189 * eval.c (struct backtrace): Don't cheat with negative numbers, but do
10190 steal a few bits to be more compact.
10191 (interactive_p, Fbacktrace, Fbacktrace_frame, mark_backtrace):
10192 Remove unneeded casts.
10193
1c470562
SM
10194 * bytecode.c (Fbyte_code): CAR and CDR can GC.
10195
888adce9
ZK
101962011-03-30 Zachary Kanfer <zkanfer@gmail.com> (tiny change)
10197
10198 * keyboard.c (Fexecute_extended_command): Do log the "suggest key
10199 binding" message (bug#7967).
10200
f838ed7b
PE
102012011-03-30 Paul Eggert <eggert@cs.ucla.edu>
10202
77861b95
PE
10203 Fix more problems found by GCC 4.6.0's static checks.
10204
de6dbc14
PE
10205 * unexelf.c (unexec) [! (defined _SYSTYPE_SYSV || defined __sgi)]:
10206 Remove unused local var.
10207
f838ed7b
PE
10208 * editfns.c (Fmessage_box): Remove unused local var.
10209
792c7b2b
PE
10210 * xdisp.c (try_window_reusing_current_matrix, x_produce_glyphs):
10211 (note_mode_line_or_margin_highlight, note_mouse_highlight):
10212 Omit unused local vars.
c499e557 10213 * window.c (shrink_windows): Omit unused local var.
b01a1c29 10214 * menu.c (digest_single_submenu): Omit unused local var.
0bc32927
PE
10215 * dispnew.c (update_window) [PERIODIC_PREEMPTION_CHECKING]:
10216 Omit unused local var.
10217
ba0165e1
PE
10218 * keyboard.c (parse_modifiers_uncached, parse_modifiers):
10219 Don't assume string length fits in int.
32ad8845 10220 (keyremap_step, read_key_sequence): Use size_t for sizes.
48011560 10221 (read_key_sequence): Don't check last_real_key_start redundantly.
ba0165e1 10222
3c59b4c9
PE
10223 * callproc.c (Fcall_process, Fcall_process_region): Use SAFE_ALLOCA
10224 instead of alloca (Bug#8344).
10225
a3eed478 10226 * eval.c (Fbacktrace): Don't assume nargs fits in int.
5d5d959d 10227 (Fbacktrace_frame): Don't assume nframes fits in int.
a3eed478 10228
eb4d412d
PE
10229 * syntax.c (scan_sexps_forward): Avoid pointer wraparound.
10230
1658b401
PE
10231 * xterm.c (x_make_frame_visible, same_x_server): Redo to avoid overflow
10232 concerns.
10233
10234 * term.c (produce_glyphless_glyph): Remove unnecessary test.
10235
10236 * cm.c (calccost): Turn while-do into do-while, for clarity.
44f730c8 10237
9a2c6e05
PE
10238 * keyboard.c (syms_of_keyboard): Use the same style as later
10239 in this function when indexing through an array. This also
10240 works around GCC bug 48267.
10241
03d0a109
PE
10242 * image.c (tiff_load): Fix off-by-one image count (Bug#8336).
10243
44f730c8
PE
10244 * xselect.c (x_check_property_data): Return correct size (Bug#8335).
10245
fe75f926
PE
10246 * chartab.c (sub_char_table_ref_and_range): Redo for slight
10247 efficiency gain, and to bypass a gcc -Wstrict-overflow warning.
10248
ffa8c828
PE
10249 * keyboard.c, keyboard.h (num_input_events): Now size_t.
10250 This avoids undefined behavior on integer overflow, and is a bit
10251 more convenient anyway since it is compared to a size_t variable.
10252
c5101a77
PE
10253 Variadic C functions now count arguments with size_t, not int.
10254 This avoids an unnecessary limitation on 64-bit machines, which
10255 caused (substring ...) to crash on large vectors (Bug#8344).
10256 * lisp.h (struct Lisp_Subr.function.aMANY): Now takes size_t, not int.
10257 (DEFUN_ARGS_MANY, internal_condition_case_n, safe_call): Likewise.
77861b95 10258 All variadic functions and their callers changed accordingly.
c5101a77
PE
10259 (struct gcpro.nvars): Now size_t, not int. All uses changed.
10260 * data.c (arith_driver, float_arith_driver): Likewise.
10261 * editfns.c (general_insert_function): Likewise.
10262 * eval.c (struct backtrace.nargs, interactive_p)
10263 (internal_condition_case_n, run_hook_with_args, apply_lambda)
10264 (funcall_lambda, mark_backtrace): Likewise.
10265 * fns.c (concat): Likewise.
10266 * frame.c (x_set_frame_parameters): Likewise.
10267 * fns.c (get_key_arg): Now accepts and returns size_t, and returns
10268 0 if not found, not -1. All callers changed.
10269
dd3f25f7
PE
10270 * alloc.c (garbage_collect): Don't assume stack size fits in int.
10271 (stack_copy_size): Now size_t, not int.
10272 (stack_copy, stack_copy_size): Define only if MAX_SAVE_STACK > 0.
10273
461c2ab9
JB
102742011-03-28 Juanma Barranquero <lekktu@gmail.com>
10275
10276 * coding.c (encode_designation_at_bol): Remove parameter `charbuf_end',
10277 unused since 2002-03-01T01:17:24Z!handa@m17n.org and 2008-02-01T16:01:31Z!miles@gnu.org.
10278 All callers changed.
10279
10280 * lisp.h (multibyte_char_to_unibyte):
10281 * character.c (multibyte_char_to_unibyte): Remove parameter `rev_tbl',
10282 unused since 2002-03-01T01:16:34Z!handa@m17n.org and 2008-02-01T16:01:31Z!miles@gnu.org.
10283 * character.h (CHAR_TO_BYTE8):
10284 * cmds.c (internal_self_insert):
10285 * editfns.c (general_insert_function):
10286 * keymap.c (push_key_description):
10287 * search.c (Freplace_match):
10288 * xdisp.c (message_dolog, set_message_1): All callers changed.
10289
f6d62986
SM
102902011-03-28 Stefan Monnier <monnier@iro.umontreal.ca>
10291
10292 * keyboard.c (safe_run_hook_funcall): New function.
10293 (safe_run_hooks_1, safe_run_hooks_error, safe_run_hooks): On error,
10294 don't set the hook to nil, but remove the offending function instead.
10295 (Qcommand_hook_internal): Remove, unused.
10296 (syms_of_keyboard): Don't initialize Qcommand_hook_internal nor define
10297 Vcommand_hook_internal.
10298
10299 * eval.c (enum run_hooks_condition): Remove.
10300 (funcall_nil, funcall_not): New functions.
10301 (run_hook_with_args): Call each function through a `funcall' argument.
10302 Remove `cond' argument, now redundant.
10303 (Frun_hooks, Frun_hook_with_args, Frun_hook_with_args_until_success)
10304 (Frun_hook_with_args_until_failure): Adjust accordingly.
10305 (run_hook_wrapped_funcall, Frun_hook_wrapped): New functions.
10306
1db5b1ad
JB
103072011-03-28 Juanma Barranquero <lekktu@gmail.com>
10308
10309 * dispextern.h (string_buffer_position): Remove declaration.
10310
10311 * print.c (strout): Remove parameter `multibyte', unused since
10312 1999-08-21T19:30:21Z!gerd@gnu.org. All callers changed.
10313
10314 * search.c (boyer_moore): Remove parameters `len', `pos' and `lim',
10315 never used since function introduction in 1998-02-08T21:33:56Z!rms@gnu.org.
10316 All callers changed.
10317
10318 * w32.c (_wsa_errlist): Use braces for struct initializers.
10319
10320 * xdisp.c (string_buffer_position_lim): Remove parameter `w',
10321 never used since function introduction in 2001-03-09T18:41:50Z!gerd@gnu.org.
10322 All callers changed.
10323 (string_buffer_position): Likewise. Also, make static (it's never
10324 used outside xdisp.c).
10325 (cursor_row_p): Remove parameter `w', unused since
10326 2000-10-17T16:08:57Z!gerd@gnu.org. All callers changed.
10327 (decode_mode_spec): Remove parameter `precision', introduced during
10328 Gerd Moellmann's rewrite at 1999-07-21T21:43:52Z!gerd@gnu.org, but never used.
10329 All callers changed.
10330
5ffb62aa
JD
103312011-03-27 Jan Djärv <jan.h.d@swipnet.se>
10332
10333 * nsterm.m (syms_of_nsterm): Use doc: for ns-auto-hide-menu-bar.
10334
461c2ab9 103352011-03-27 Anders Lindgren <andlind@gmail.com>
f0a1382a
JD
10336
10337 * nsterm.m (ns_menu_bar_is_hidden): New variable.
10338 (ns_constrain_all_frames, ns_menu_bar_should_be_hidden)
10339 (ns_update_auto_hide_menu_bar): New functions.
10340 (ns_update_begin): Call ns_update_auto_hide_menu_bar.
10341 (applicationDidBecomeActive): Call ns_update_auto_hide_menu_bar and
10342 ns_constrain_all_frames.
10343 (constrainFrameRect): Return at once if ns_menu_bar_should_be_hidden.
10344 (syms_of_nsterm): DEFVAR ns-auto-hide-menu-bar, init to Qnil.
10345
5c380ffb
JD
103462011-03-27 Jan Djärv <jan.h.d@swipnet.se>
10347
10348 * nsmenu.m (runDialogAt): Remove argument to timer_check.
10349
9af30bdf
GM
103502011-03-27 Glenn Morris <rgm@gnu.org>
10351
10352 * syssignal.h: Replace RETSIGTYPE with void.
10353 * atimer.c, data.c, dispnew.c, emacs.c, floatfns.c, keyboard.c:
10354 * keyboard.h, lisp.h, process.c, sysdep.c, xterm.c:
10355 Replace SIGTYPE with void everywhere.
10356 * s/usg5-4-common.h (SIGTYPE): Remove definition.
10357 * s/template.h (SIGTYPE): Remove commented out definition.
10358
e2abce01
JB
103592011-03-26 Eli Zaretskii <eliz@gnu.org>
10360
10361 * xdisp.c (redisplay_window): Don't check buffer's clip_changed
10362 flag as a prerequisite for invoking try_scrolling. (Bug#6671)
10363
f868cd8a
JB
103642011-03-26 Juanma Barranquero <lekktu@gmail.com>
10365
59eb0929
JB
10366 * w32.c (read_unc_volume): Use parameter `henum', instead of
10367 global variable `wget_enum_handle'.
10368
10369 * keymap.c (describe_vector): Remove parameters `indices' and
10370 `char_table_depth', unused since 2002-03-01T01:43:26Z!handa@m17n.org.
10371 (describe_map, Fdescribe_vector): Adjust calls to `describe_vector'.
10372
f868cd8a
JB
10373 * keyboard.h (timer_check, show_help_echo): Remove unused parameters.
10374
10375 * keyboard.c (timer_check): Remove parameter `do_it_now',
10376 unused since 1996-04-12T06:01:29Z!rms@gnu.org.
10377 (show_help_echo): Remove parameter `ok_to_overwrite_keystroke_echo',
10378 unused since 2008-04-19T19:30:53Z!monnier@iro.umontreal.ca.
10379
10380 * keyboard.c (read_char):
10381 * w32menu.c (w32_menu_display_help):
10382 * xmenu.c (show_help_event, menu_help_callback):
10383 Adjust calls to `show_help_echo'.
10384
10385 * gtkutil.c (xg_maybe_add_timer):
10386 * keyboard.c (readable_events):
10387 * process.c (wait_reading_process_output):
10388 * xmenu.c (x_menu_wait_for_event): Adjust calls to `timer_check'.
10389
10390 * insdel.c (adjust_markers_gap_motion):
10391 Remove; no-op since 1998-01-02T21:29:48Z!rms@gnu.org.
10392 (gap_left, gap_right): Don't call it.
10393
2ecf6fdb
CY
103942011-03-25 Chong Yidong <cyd@stupidchicken.com>
10395
10396 * xdisp.c (handle_fontified_prop): Discard changes to clip_changed
10397 incurred during fontification.
10398
6b1f9ba4
JB
103992011-03-25 Juanma Barranquero <lekktu@gmail.com>
10400
10401 * buffer.c (defvar_per_buffer): Remove unused parameter `doc'.
10402 (DEFVAR_PER_BUFFER): Don't pass it.
10403
10404 * dispnew.c (row_equal_p, add_row_entry): Remove unused parameter `w'.
10405 (scrolling_window): Don't pass it.
10406
0f4a96b5
JB
104072011-03-25 Juanma Barranquero <lekktu@gmail.com>
10408
10409 * dispextern.h (glyph_matric): Use #if GLYPH_DEBUG, not #ifdef.
10410
10411 * fileio.c (check_executable) [DOS_NT]: Remove unused variables `len'
10412 and `suffix'.
10413 (Fset_file_selinux_context) [HAVE_LIBSELINUX]: Move here declaration
10414 of variables specific to SELinux and computation of `encoded_absname'.
10415
10416 * image.c (XPutPixel): Remove unused variable `height'.
10417
10418 * keyboard.c (make_lispy_event): Remove unused variable `hpos'.
10419
10420 * unexw32.c (get_section_info): Remove unused variable `section'.
10421
10422 * w32.c (stat): Remove unused variables `drive_root' and `devtype'.
10423 (system_process_attributes): Remove unused variable `sess'.
10424 (sys_read): Remove unused variable `err'.
10425
10426 * w32fns.c (top): Wrap variables with #if GLYPH_DEBUG, not #ifdef.
10427 (w32_wnd_proc): Remove unused variable `isdead'.
10428 (unwind_create_frame): Use #if GLYPH_DEBUG, not #ifdef.
10429 (Fx_server_max_request_size): Remove unused variable `dpyinfo'.
10430 (x_create_tip_frame): Remove unused variable `tem'.
10431
10432 * w32inevt.c (w32_console_read_socket):
10433 Remove unused variable `no_events'.
10434
10435 * w32term.c (x_draw_composite_glyph_string_foreground):
10436 Remove unused variable `width'.
10437
1149507c
JB
104382011-03-24 Juanma Barranquero <lekktu@gmail.com>
10439
10440 * w32term.c (x_set_glyph_string_clipping):
10441 Don't pass uninitialized region to CombineRgn.
10442
9c88f339
JB
104432011-03-23 Juanma Barranquero <lekktu@gmail.com>
10444
10445 * w32fns.c (x_set_menu_bar_lines): Remove unused variable `olines'.
10446 (w32_wnd_proc): Pass NULL to Windows API, not uninitialized buffer.
10447 (Fx_close_connection): Remove unused variable `i'.
10448
10449 * w32font.c (w32font_draw): Return number of glyphs.
10450 (w32font_open_internal): Remove unused variable `i'.
10451 (w32font_driver): Add missing initializer.
10452
10453 * w32menu.c (utf8to16): Remove unused variable `utf16'.
10454 (fill_in_menu): Remove unused variable `items_added'.
10455
10456 * w32term.c (last_mouse_press_frame): Remove static global variable.
10457 (w32_clip_to_row): Remove unused variable `f'.
10458 (x_delete_terminal): Remove unused variable `i'.
10459
10460 * w32uniscribe.c (uniscribe_shape): Remove unused variable `nclusters'.
10461 (NOTHING): Remove unused static global variable.
10462 (uniscribe_check_otf): Remove unused variable `table'.
10463 (uniscribe_font_driver): Add missing initializers.
10464
dee091a3
JD
104652011-03-23 Julien Danjou <julien@danjou.info>
10466
10467 * term.c (Fsuspend_tty, Fresume_tty):
10468 * minibuf.c (read_minibuf, run_exit_minibuf_hook):
10469 * window.c (temp_output_buffer_show):
10470 * insdel.c (signal_before_change):
10471 * frame.c (Fhandle_switch_frame):
10472 * fileio.c (Fdo_auto_save):
10473 * emacs.c (Fkill_emacs):
10474 * editfns.c (save_excursion_restore):
10475 * cmds.c (internal_self_insert):
10476 * callint.c (Fcall_interactively):
10477 * buffer.c (Fkill_all_local_variables):
10478 * keyboard.c (Fcommand_execute, Fsuspend_emacs, safe_run_hooks_1):
10479 Use Frun_hooks.
0f4a96b5 10480 (command_loop_1): Use Frun_hooks. Call safe_run_hooks
e9fce1ac 10481 unconditionally since it does the check itself.
dee091a3 10482
2c520ab5 104832011-03-23 Paul Eggert <eggert@cs.ucla.edu>
f0641eff 10484
c9c49752
PE
10485 Fix more problems found by GCC 4.5.2's static checks.
10486
8abc3f12
PE
10487 * coding.c (encode_coding_raw_text): Avoid unnecessary test
10488 the first time through the loop, since we know p0 < p1 then.
10489 This also avoids a gcc -Wstrict-overflow warning.
10490
a2d26660
PE
10491 * lisp.h (SAFE_ALLOCA, SAFE_ALLOCA_LISP): Avoid 'int' overflow
10492 leading to a memory leak, possible in functions like
10493 load_charset_map_from_file that can allocate an unbounded number
b12ef411 10494 of objects (Bug#8318).
a2d26660 10495
916c72e9
PE
10496 * xmenu.c (set_frame_menubar): Use EMACS_UINT, not int, for indexes
10497 that could (at least in theory) be that large.
10498
19ab8a18
PE
10499 * xdisp.c (message_log_check_duplicate): Return unsigned long, not int.
10500 This is less likely to overflow, and avoids undefined behavior if
10501 overflow does occur. All callers changed. Use strtoul to scan
10502 for the unsigned long integer.
b7cbbd6f
PE
10503 (pint2hrstr): Simplify and tune code slightly.
10504 This also avoids a (bogus) GCC warning with gcc -Wstrict-overflow.
19ab8a18 10505
f0641eff
PE
10506 * scroll.c (do_scrolling): Work around GCC bug 48228.
10507 See <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48228>.
10508
7f650bb9
PE
10509 * frame.c (Fmodify_frame_parameters): Simplify loop counter.
10510 This also avoids a warning with gcc -Wstrict-overflow.
39f5e519
PE
10511 (validate_x_resource_name): Simplify count usage.
10512 This also avoids a warning with gcc -Wstrict-overflow.
7f650bb9 10513
37dd57d1
PE
10514 * fileio.c (Fcopy_file): Report error if fchown or fchmod
10515 fail (Bug#8306).
81e56e61 10516
699979fc 10517 * emacs.c (Fdaemon_initialized): Do not ignore I/O errors (Bug#8303).
dc1ca6a8 10518
401bf9b4
PE
10519 * process.c (Fmake_network_process): Use socklen_t, not int,
10520 where POSIX says socklen_t is required in portable programs.
10521 This fixes a porting bug on hosts like 64-bit HP-UX, where
591b2973 10522 socklen_t is wider than int (Bug#8277).
401bf9b4
PE
10523 (Fmake_network_process, server_accept_connection):
10524 (wait_reading_process_output, read_process_output):
10525 Likewise.
10526
b93aacde
PE
10527 * process.c: Rename or move locals to avoid shadowing.
10528 (list_processes_1, Fmake_network_process):
10529 (read_process_output_error_handler, exec_sentinel_error_handler):
10530 Rename or move locals.
4dc343ee 10531 (Fmake_network_process): Define label "retry_connect" only if needed.
0da49335 10532 (Fnetwork_interface_info): Fix pointer signedness.
f990b4e5 10533 (process_send_signal): Add cast to avoid pointer signedness problem.
7b808126 10534 (FIRST_PROC_DESC, IF_NON_BLOCKING_CONNECT): Remove unused macros.
c939f91b 10535 (create_process): Use 'volatile' to avoid vfork clobbering (Bug#8298).
b93aacde 10536
af8a867c 10537 Make tparam.h and terminfo.c consistent.
44f230aa
SM
10538 * cm.c (tputs, tgoto, BC, UP): Remove extern decls.
10539 Include tparam.h instead, since it declares them.
af8a867c
PE
10540 * cm.h (PC): Remove extern decl; tparam.h now does this.
10541 * deps.mk (cm.o, terminfo.o): Depend on tparam.h.
10542 * terminfo.c: Include tparam.h, to check interfaces.
10543 (tparm): Make 1st arg a const pointer in decl. Put it at top level.
10544 (tparam): Adjust signature to match interface in tparam.h;
10545 this removes some undefined behavior. Check that outstring and len
10546 are zero, which they always are with Emacs.
10547 * tparam.h (PC, BC, UP): New extern decls.
10548
0248044d 10549 * xftfont.c (xftfont_shape): Now static, and defined only if needed.
001a7ab4 10550 (xftfont_open): Rename locals to avoid shadowing.
0248044d 10551
8ff096c1 10552 * ftfont.c (ftfont_resolve_generic_family): Fix pointer signedness.
a00924bb
PE
10553 (ftfont_otf_capability, ftfont_shape): Omit decls if not needed.
10554 (OTF_TAG_SYM): Omit macro if not needed.
e932860f 10555 (ftfont_list): Remove unused local.
49eaafba
PE
10556 (get_adstyle_property, ftfont_pattern_entity):
10557 (ftfont_lookup_cache, ftfont_open, ftfont_anchor_point):
10558 Rename locals to avoid shadowing.
8ff096c1 10559
e2be39f6
PE
10560 * xfont.c (xfont_list_family): Mark var as initialized.
10561
c9735e30
PE
10562 * xml.c (make_dom): Now static.
10563
8f5201ae
PE
10564 * composite.c (composition_compute_stop_pos): Rename local to
10565 avoid shadowing.
b246f932
PE
10566 (composition_reseat_it): Remove unused locals.
10567 (find_automatic_composition, composition_adjust_point): Likewise.
80e079b2 10568 (composition_update_it): Mark var as initialized.
11b61122
PE
10569 (find_automatic_composition): Mark vars as initialized,
10570 with a FIXME (Bug#8290).
8f5201ae 10571
760fbc2c
PE
10572 character.h: Rename locals to avoid shadowing.
10573 * character.h (PREV_CHAR_BOUNDARY, FETCH_STRING_CHAR_ADVANCE):
10574 (FETCH_STRING_CHAR_AS_MULTIBYTE_ADVANCE, FETCH_CHAR_ADVANCE):
10575 (FETCH_CHAR_ADVANCE_NO_CHECK, INC_POS, DEC_POS, BUF_INC_POS):
10576 (BUF_DEC_POS): Be more systematic about renaming local temporaries
10577 to avoid shadowing.
10578
ff08eb85
PE
10579 * textprop.c (property_change_between_p): Remove; unused.
10580
fc7bf025
PE
10581 * intervals.c (interval_start_pos): Now static.
10582
235d7abc
PE
10583 * intervals.h (CHECK_TOTAL_LENGTH): Avoid empty "else".
10584
44f230aa
SM
10585 * atimer.c (start_atimer, append_atimer_lists, set_alarm):
10586 Rename locals to avoid shadowing.
3e7d6594 10587
50060332
PE
10588 * sound.c (wav_play, au_play, Fplay_sound_internal):
10589 Fix pointer signedness.
d01f234b 10590 (alsa_choose_format): Remove unused local var.
c83b8872
PE
10591 (wav_play): Initialize a variable to 0, to prevent undefined
10592 behavior (Bug#8278).
50060332 10593
c4fc4e30
PE
10594 * region-cache.c (insert_cache_boundary): Redo var to avoid shadowing.
10595
918436ed
PE
10596 * region-cache.h (pp_cache): New decl, for gcc -Wmissing-prototypes.
10597
c939f91b
PE
10598 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork
10599 clobbering (Bug#8298).
b9c7f648
PE
10600 * sysdep.c (sys_subshell): Likewise.
10601 Previously, the sys_subshell 'volatile' was incorrectly IF_LINTted out.
7e9123a2 10602
6bd8c144
PE
10603 * lisp.h (child_setup): Now NO_RETURN unless DOS_NT.
10604 This should get cleaned up, so that child_setup has the
10605 same signature on all platforms.
10606
7710357c 10607 * callproc.c (call_process_cleanup): Now static.
cb1d0ef7 10608 (relocate_fd): Rename locals to avoid shadowing.
7710357c 10609
c59da222
CY
106102011-03-22 Chong Yidong <cyd@stupidchicken.com>
10611
10612 * xterm.c (x_clear_frame): Remove XClearWindow call. This appears
10613 not to be necessary, and produces flickering.
10614
66b87493
GM
106152011-03-20 Glenn Morris <rgm@gnu.org>
10616
10617 * config.in: Remove file.
10618
45b6f6d5
JB
106192011-03-20 Juanma Barranquero <lekktu@gmail.com>
10620
10621 * minibuf.c (Vcompleting_read_function): Don't declare, global variables
10622 are now in src/globals.h.
10623 (syms_of_minibuf): Remove spurious & from previous change.
10624
cd394be1 106252011-03-20 Leo Liu <sdl.web@gmail.com>
3ec03f7e
LL
10626
10627 * minibuf.c (completing-read-function): New variable.
10628 (completing-read-default): Rename from completing-read.
10629 (completing-read): Call completing-read-function.
10630
b14e3e21
CY
106312011-03-19 Juanma Barranquero <lekktu@gmail.com>
10632
10633 * xfaces.c (Fx_load_color_file):
10634 Read color file from absolute filename (bug#8250).
10635
f2b726e6
JB
106362011-03-19 Juanma Barranquero <lekktu@gmail.com>
10637
10638 * makefile.w32-in: Update dependencies.
10639
09f6ff02
EZ
106402011-03-17 Eli Zaretskii <eliz@gnu.org>
10641
10642 * makefile.w32-in ($(BLD)/unexw32.$(O)): Depend on $(SRC)/unexec.h.
10643
29a6015a
PE
106442011-03-17 Paul Eggert <eggert@cs.ucla.edu>
10645
a3a6c54e
PE
10646 Fix more problems found by GCC 4.5.2's static checks.
10647
b766f867
PE
10648 * process.c (make_serial_process_unwind, send_process_trap):
10649 (sigchld_handler): Now static.
10650
be02381c
PE
10651 * process.c (allocate_pty): Let PTY_ITERATION declare iteration vars.
10652 That way, the code declares only the vars that it needs.
10653 * s/aix4-2.h (PTY_ITERATION): Declare iteration vars.
10654 * s/cygwin.h (PTY_ITERATION): Likewise.
10655 * s/darwin.h (PTY_ITERATION): Likewise.
10656 * s/gnu-linux.h (PTY_ITERATION): Likewise.
10657
57048744
PE
10658 * s/irix6-5.h (PTY_OPEN): Declare stb, to loosen coupling.
10659 * process.c (allocate_pty): Don't declare stb unless it's needed.
10660
7914961c 10661 * bytecode.c (MAYBE_GC): Rewrite so as not to use empty "else".
615f2d59
PE
10662 (CONSTANTLIM): Remove; unused.
10663 (METER_CODE, Bscan_buffer, Bread_char, Bset_mark):
10664 Define only if needed.
7914961c 10665
b3967b18
PE
10666 * unexelf.c (unexec): Name an expression,
10667 to avoid gcc -Wbad-function-cast warning.
9ae71512
PE
10668 Use a different way to cause a compilation error if anyone uses
10669 n rather than nn, a way that does not involve shadowing.
73366a00 10670 (ELF_BSS_SECTION_NAME, OLD_PROGRAM_H): Remove; unused.
b3967b18 10671
29a6015a
PE
10672 * deps.mk (unexalpha.o): Remove; unused.
10673
43cfc33e 10674 New file unexec.h, the (simple) interface for unexec (Bug#8267).
7feda0d2 10675 * unexec.h: New file.
ce701a33
PE
10676 * deps.mk (emacs.o, unexaix.o, unexcw.o, unexcoff.o, unexelf.o):
10677 (unexhp9k800.o, unexmacosx.o, unexsol.o, unexw32.o):
10678 Depend on unexec.h.
10679 * emacs.c [!defined CANNOT_DUMP]: Include unexec.h.
10680 * unexaix.c, unexcoff.c, unexcw.c, unexelf.c, unexhp9k800.c:
10681 * unexmacosx.c, unexsol.c, unexw32.c: Include unexec.h.
381259ef 10682 Change as necessary to match prototype in unexec.h.
ce701a33 10683
01f44d5a
PE
10684 * syntax.c (Fforward_comment, scan_lists): Rename locals to avoid
10685 shadowing.
4f63c6bb 10686 (back_comment, skip_chars): Mark vars as initialized.
01f44d5a 10687
a6670b0b
PE
10688 * character.h (FETCH_STRING_CHAR_ADVANCE_NO_CHECK, BUF_INC_POS):
10689 Rename locals to avoid shadowing.
10690
cef2010d 10691 * lread.c (read1): Rewrite so as not to use empty "else".
0902fe45 10692 (Fload, readevalloop, read1): Rename locals to avoid shadowing.
cef2010d 10693
d4d7173a
PE
10694 * print.c (Fredirect_debugging_output): Fix pointer signedess.
10695
f08b802a
PE
10696 * lisp.h (debug_output_compilation_hack): Add decl here, to avoid
10697 warning when compiling print.c.
10698
3ddb0639
PE
10699 * font.c (font_unparse_fcname): Abort in an "impossible" situation
10700 instead of using an uninitialized var.
5ad03b97 10701 (font_sort_entities): Mark var as initialized.
3ddb0639 10702
170a2692
PE
10703 * character.h (FETCH_CHAR_ADVANCE): Rename locals to avoid shadowing.
10704
e663c700
PE
10705 * font.c (font_unparse_xlfd): Don't mix pointers to variables with
10706 pointers to constants.
89bc529a 10707 (font_parse_fcname): Remove unused vars.
7b81e2d0 10708 (font_delete_unmatched): Now static.
ea838e10 10709 (font_get_spec): Remove; unused.
13a547c6
PE
10710 (font_style_to_value, font_prop_validate_style, font_unparse_fcname):
10711 (font_update_drivers, Ffont_get_glyphs, font_add_log):
10712 Rename or move locals to avoid shadowing.
e663c700 10713
2a80c887 10714 * fns.c (require_nesting_list, require_unwind): Now static.
612f56df 10715 (Ffillarray): Rename locals to avoid shadowing.
2a80c887 10716
1384fa33 10717 * floatfns.c (domain_error2): Define only if needed.
a885e2ed 10718 (Ffrexp, Fldexp): Rename locals to avoid shadowing.
1384fa33 10719
8b2c52e9
PE
10720 * alloc.c (mark_backtrace): Move decl from here ...
10721 * lisp.h: ... to here, so that it can be checked.
10722
475545b5 10723 * eval.c (call_debugger, do_debug_on_call, grow_specpdl): Now static.
d28a2170 10724 (Fdefvar): Rewrite so as not to use empty "else".
cfcbfb1a
PE
10725 (lisp_indirect_variable): Name an expression,
10726 to avoid gcc -Wbad-function-cast warning.
1faed8ae 10727 (Fdefvar): Rename locals to avoid shadowing.
475545b5 10728
b1349114 10729 * callint.c (quotify_arg, quotify_args): Now static.
a3e8cbda 10730 (Fcall_interactively): Rename locals to avoid shadowing.
b0e80955 10731 Use const pointer when appropriate.
b1349114 10732
a2928364
PE
10733 * lisp.h (get_system_name, get_operating_system_release):
10734 Move decls here, to check interfaces.
10735 * process.c (get_operating_system_release): Move decl to lisp.h.
10736 * xrdb.c (get_system_name): Likewise.
63c5d10b
PE
10737 * editfns.c (init_editfns, Fuser_login_name, Fuser_uid):
10738 (Fuser_real_uid, Fuser_full_name): Remove unnecessary casts,
10739 some of which prompt warnings from gcc -Wbad-function-cast.
545b49b4
PE
10740 (Fformat_time_string, Fencode_time, Finsert_char):
10741 (Ftranslate_region_internal, Fformat):
10742 Rename or remove local vars to avoid shadowing.
9710023e 10743 (Ftranslate_region_internal): Mark var as initialized.
63c5d10b 10744
a415e694
PE
10745 * doc.c (Fdocumentation, Fsnarf_documentation): Move locals to
10746 avoid shadowing.
10747
8ef4622d
PE
10748 * lisp.h (eassert): Check that the argument compiles, even if
10749 ENABLE_CHECKING is not defined.
10750
946f9a5b
PE
10751 * data.c (Findirect_variable): Name an expression, to avoid
10752 gcc -Wbad-function-cast warning.
112396d6 10753 (default_value, arithcompare, arith_driver, arith_error): Now static.
b9b84fa9 10754 (store_symval_forwarding): Rename local to avoid shadowing.
44f230aa
SM
10755 (Fmake_variable_buffer_local, Fmake_local_variable):
10756 Mark variables as initialized.
52746918 10757 (do_blv_forwarding, do_symval_forwarding): Remove; unused.
946f9a5b 10758
e5aab7e7 10759 * alloc.c (check_cons_list): Do not define unless GC_CHECK_CONS_LIST.
ae35e756
PE
10760 (Fmake_vector, Fvector, Fmake_byte_code, Fgarbage_collect):
10761 Rename locals to avoid shadowing.
dff45157
PE
10762 (mark_stack): Move local variables into the #ifdef region where
10763 they're used.
7bc26fdb
PE
10764 (BLOCK_INPUT_ALLOC, UNBLOCK_INPUT_ALLOC): Define only if
10765 ! defined SYSTEM_MALLOC && ! defined SYNC_INPUT, as they are not
10766 needed otherwise.
10767 (CHECK_ALLOCATED): Define only if GC_CHECK_MARKED_OBJECTS.
10768 (GC_STRING_CHARS): Remove; not used.
d40d4be1 10769 (Fmemory_limit): Cast sbrk's returned value to char *.
ae35e756 10770
e5aab7e7
PE
10771 * lisp.h (check_cons_list): Declare if GC_CHECK_CONS_LIST; this
10772 avoids undefined behavior in theory.
10773
4da60324
PE
10774 * regex.c (IF_LINT): Add defn, for benefit of ../lib-src.
10775
88043301
PE
10776 Use functions, not macros, for up- and down-casing (Bug#8254).
10777 * buffer.h (DOWNCASE_TABLE, UPCASE_TABLE, DOWNCASE, UPPERCASEP):
10778 (NOCASEP, LOWERCASEP, UPCASE, UPCASE1): Remove. All callers changed
10779 to use the following functions instead of these macros.
10780 (downcase): Adjust to lack of DOWNCASE_TABLE. Return int, not
10781 EMACS_INT, since callers assume the returned value fits in int.
10782 (upcase1): Likewise, for UPCASE_TABLE.
10783 (uppercasep, lowercasep, upcase): New static inline functions.
0da09c43 10784 * editfns.c (Fchar_equal): Remove no-longer-needed workaround for
db69b0cd 10785 the race-condition problem in the old DOWNCASE.
88043301 10786
19ed5445
PE
10787 * regex.c (CHARSET_LOOKUP_RANGE_TABLE_RAW, POP_FAILURE_REG_OR_COUNT):
10788 Rename locals to avoid shadowing.
10789 (regex_compile, re_match_2_internal): Move locals to avoid shadowing.
abbd1bcf
PE
10790 (regex_compile, re_search_2, re_match_2_internal):
10791 Remove unused local vars.
952db0d7
PE
10792 (FREE_VAR): Rewrite so as not to use empty "else",
10793 which gcc can warn about.
da053e48 10794 (regex_compile, re_match_2_internal): Mark locals as initialized.
b313f9d8
PE
10795 (RETALLOC_IF): Define only if needed.
10796 (WORDCHAR_P): Likewise. This one is never needed, but is used
10797 only in a comment talking about a compiler bug, so put inside
10798 the #if 0 of that comment.
10799 (CHARSET_LOOKUP_BITMAP, FAIL_STACK_FULL, RESET_FAIL_STACK):
10800 (PUSH_FAILURE_ELT, BUF_PUSH_3, STOP_ADDR_VSTRING):
10801 Remove; unused.
19ed5445 10802
1f3561e4 10803 * search.c (boyer_moore): Rename locals to avoid shadowing.
76ef09b7
PE
10804 * character.h (FETCH_STRING_CHAR_AS_MULTIBYTE_ADVANCE):
10805 (PREV_CHAR_BOUNDARY): Likewise.
1f3561e4 10806
ded6f8f7
PE
10807 * search.c (simple_search): Remove unused var.
10808
dbd37a95
PE
10809 * dired.c (compile_pattern): Move decl from here ...
10810 * lisp.h: ... to here, so that it can be checked.
10811 (struct re_registers): New forward decl.
10812
7e47afad
PE
10813 * character.h (INC_POS, DEC_POS): Rename locals to avoid shadowing.
10814
85f24f61
PE
10815 * indent.c (MULTIBYTE_BYTES_WIDTH): New args bytes, width.
10816 All uses changed.
10817 (MULTIBYTE_BYTES_WIDTH, scan_for_column, compute_motion):
10818 Rename locals to avoid shadowing.
5671df8f 10819 (Fvertical_motion): Mark locals as initialized.
85f24f61 10820
181aa2be 10821 * casefiddle.c (casify_object, casify_region): Now static.
e45a141a 10822 (casify_region): Mark local as initialized.
181aa2be 10823
930d429c
PE
10824 * cmds.c (internal_self_insert): Rename local to avoid shadowing.
10825
7082eac6
PE
10826 * lisp.h (GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR, GCPRO5_VAR, GCPRO6_VAR):
10827 New macros, so that the caller can use some names other than
10828 gcpro1, gcpro2, etc.
10829 (GCPRO2, GCPRO3, GCPRO4, GCPRO5, GCPRO6): Reimplement in terms
10830 of the new macros.
10831 (GCPRO1_VAR, UNGCPRO_VAR): Change the meaning of the second
10832 argument, for consistency with GCPRO2_VAR, etc: it is now the
10833 prefix of the variable, not the variable itself. All uses
10834 changed.
38b2c076
PE
10835 * dired.c (directory_files_internal, file_name_completion):
10836 Rename locals to avoid shadowing.
10837
15206ed9
PE
10838 Fix a race condition diagnosed by gcc -Wsequence-point (Bug#8254).
10839 An expression of the form (DOWNCASE (x) == DOWNCASE (y)), found in
10840 dired.c's scmp function, had undefined behavior.
10841 * lisp.h (DOWNCASE_TABLE, UPCASE_TABLE, DOWNCASE, UPPERCASEP):
10842 (NOCASEP, LOWERCASEP, UPCASE, UPCASE1): Move from here ...
10843 * buffer.h: ... to here, because these macros use current_buffer,
10844 and the new implementation with inline functions needs to have
10845 current_buffer in scope now, rather than later when the macros
10846 are used.
10847 (downcase, upcase1): New static inline functions.
10848 (DOWNCASE, UPCASE1): Reimplement using these functions.
10849 This avoids undefined behavior in expressions like
10850 DOWNCASE (x) == DOWNCASE (y), which previously suffered
10851 from race conditions in accessing the global variables
10852 case_temp1 and case_temp2.
10853 * casetab.c (case_temp1, case_temp2): Remove; no longer needed.
10854 * lisp.h (case_temp1, case_temp2): Remove their decls.
10855 * character.h (ASCII_CHAR_P): Move from here ...
10856 * lisp.h: ... to here, so that the inline functions mentioned
10857 above can use them.
10858
4a6bea26
PE
10859 * dired.c (directory_files_internal_unwind): Now static.
10860
f14b7e14
PE
10861 * fileio.c (file_name_as_directory, directory_file_name):
10862 (barf_or_query_if_file_exists, auto_save_error, auto_save_1):
10863 Now static.
2893f146
PE
10864 (file_name_as_directory): Use const pointers when appropriate.
10865 (Fexpand_file_name): Likewise. In particular, newdir might
10866 point at constant storage, so make it a const pointer.
fd4ead52 10867 (Fmake_directory_internal, Fread_file_name): Remove unused vars.
b14aac08
PE
10868 (Ffile_selinux_context, Fset_file_selinux_context): Fix pointer
10869 signedness issues.
f839df0c
PE
10870 (Fset_file_times, Finsert_file_contents, auto_save_error):
10871 Rename locals to avoid shadowing.
f14b7e14 10872
5716756e 10873 * minibuf.c (choose_minibuf_frame_1): Now static.
62137a95
PE
10874 (Ftry_completion, Fall_completions): Rename or remove locals
10875 to avoid shadowing.
5716756e 10876
b4c3046a
PE
10877 * marker.c (bytepos_to_charpos): Remove; unused.
10878
b45db522
PE
10879 * lisp.h (verify_bytepos, count_markers): New decls,
10880 so that gcc does not warn that these functions aren't declared.
10881
85876d07
PE
10882 * insdel.c (check_markers, make_gap_larger, make_gap_smaller):
10883 (reset_var_on_error, Fcombine_after_change_execute_1): Now static.
f0cb4a60 10884 (CHECK_MARKERS): Redo to avoid gcc -Wempty-body diagnostic.
40ef059e 10885 (copy_text): Remove unused local var.
85876d07 10886
03d78a21 10887 * filelock.c (within_one_second): Now static.
b3dd38ab 10888 (lock_file_1): Rename local to avoid shadowing.
03d78a21 10889
5df8f01b
PE
10890 * buffer.c (fix_overlays_before): Mark locals as initialized.
10891 (fix_start_end_in_overlays): Likewise. This function should be
10892 simplified by using pointers-to-pointers, but that's a different
10893 matter.
b1d876f1 10894 (switch_to_buffer_1): Now static.
8f54f30a
PE
10895 (Fkill_buffer, record_buffer, Fbury_buffer, Fset_buffer_multibyte):
10896 (report_overlay_modification): Rename locals to avoid shadowing.
c3bd59b5 10897
a70072c9 10898 * sysdep.c (system_process_attributes): Rename vars to avoid shadowing.
fbd02d7b 10899 Fix pointer signedness issue.
edced198
PE
10900 (sys_subshell): Mark local as volatile if checking for lint,
10901 to suppress a gcc -Wclobbered warning that does not seem to be right.
15dfd3d9 10902 (MAXPATHLEN): Define only if needed.
a70072c9 10903
a0977c44
PE
10904 * process.c (serial_open, serial_configure): Move decls from here ...
10905 * systty.h: ... to here, so that they can be checked.
10906
a884fdcc
PE
10907 * fns.c (get_random, seed_random): Move extern decls from here ...
10908 * lisp.h: ... to here, so that they can be checked.
10909
604efe86 10910 * sysdep.c (reset_io): Now static.
b8950c94 10911 (wait_for_termination_signal): Remove; unused.
604efe86 10912
38fc62d9
PE
10913 * keymap.c (keymap_parent, keymap_memberp, map_keymap_internal):
10914 (copy_keymap_item, append_key, push_text_char_description):
10915 Now static.
1004a21a 10916 (Fwhere_is_internal): Don't test CONSP (sequences) unnecessarily.
dbbb8427 10917 (DENSE_TABLE_SIZE): Remove; unused.
c1141155
PE
10918 (get_keymap, access_keymap, Fdefine_key, Fwhere_is_internal):
10919 (describe_map_tree):
10920 Rename locals to avoid shadowing.
38fc62d9 10921
2f2650da
PE
10922 * keyboard.c: Declare functions static if they are not used elsewhere.
10923 (echo_char, echo_dash, cmd_error, top_level_2):
10924 (poll_for_input, handle_async_input): Now static.
69a058fa
PE
10925 (read_char, kbd_buffer_get_event, make_lispy_position):
10926 (make_lispy_event, make_lispy_movement, apply_modifiers):
10927 (decode_keyboard_code, tty_read_avail_input, menu_bar_items):
10928 (parse_tool_bar_item, read_key_sequence, Fread_key_sequence):
10929 (Fread_key_sequence_vector): Rename locals to avoid shadowing.
c8a06054 10930 (read_key_sequence, read_char): Mark locals as initialized.
3ac94672 10931 (Fexit_recursive_edit, Fabort_recursive_edit): Mark with NO_RETURN.
2f2650da 10932
a053e86c 10933 * keyboard.h (make_ctrl_char): New decl.
da2f2dd9
PE
10934 (mark_kboards): Move decl here ...
10935 * alloc.c (mark_kboards): ... from here.
a053e86c 10936
4752793e
PE
10937 * lisp.h (force_auto_save_soon): New decl.
10938
74f10ca7 10939 * emacs.c (init_cmdargs): Rename local to avoid shadowing.
244fc23d
PE
10940 (DEFINE_DUMMY_FUNCTION): New macro.
10941 (__do_global_ctors, __do_global_ctors_aux, __do_global_dtors, __main):
10942 Use it.
c03cd23f
PE
10943 (main): Add casts to avoid warnings
10944 if GCC considers string literals to be constants.
74f10ca7 10945
022e70d4
PE
10946 * lisp.h (fatal_error_signal): Add decl, since it's exported.
10947
59d6fe83
PE
10948 * dbusbind.c: Pointer signedness fixes.
10949 (xd_signature, xd_append_arg, xd_initialize):
10950 (Fdbus_call_method, Fdbus_call_method_asynchronously):
10951 (Fdbus_method_return_internal, Fdbus_method_error_internal):
10952 (Fdbus_send_signal, xd_read_message_1, Fdbus_register_service):
10953 (Fdbus_register_signal): Use SSDATA when the context wants char *.
10954
78320123
PE
10955 * dbusbind.c (Fdbus_init_bus): Add cast to avoid warning
10956 if GCC considers string literals to be constants.
49cebcca 10957 (Fdbus_register_service, Fdbus_register_method): Remove unused vars.
78320123 10958
35ac2a97
SM
109592011-03-16 Stefan Monnier <monnier@iro.umontreal.ca>
10960
fb103ca9
SM
10961 * print.c (PRINT_CIRCLE_CANDIDATE_P): New macro.
10962 (print_preprocess, print_object): New macro to fix last change.
10963
35ac2a97
SM
10964 * print.c (print_preprocess): Don't forget font objects.
10965
62973b41
JB
109662011-03-16 Juanma Barranquero <lekktu@gmail.com>
10967
10968 * emacs.c (USAGE3): Doc fixes.
10969
0e48bb22
AS
109702011-03-15 Andreas Schwab <schwab@linux-m68k.org>
10971
10972 * coding.c (detect_coding_iso_2022): Reorganize code to clarify
10973 structure.
10974
7684e57b
JB
109752011-03-14 Juanma Barranquero <lekktu@gmail.com>
10976
10977 * lisp.h (VWindow_system, Qfile_name_history):
10978 * keyboard.h (lispy_function_keys) [WINDOWSNT]:
10979 * w32term.h (w32_system_caret_hwnd, w32_system_caret_height)
10980 (w32_system_caret_x, w32_system_caret_y): Declare extern.
10981
10982 * w32select.c: Don't #include "keyboard.h".
c96bbc66 10983 (run_protected): Add extern declaration for waiting_for_input.
7684e57b
JB
10984
10985 * w32.c (Qlocal, noninteractive1, inhibit_window_system):
10986 * w32console.c (detect_input_pending, read_input_pending)
10987 (encode_terminal_code):
10988 * w32fns.c (quit_char, lispy_function_keys, Qtooltip)
10989 (w32_system_caret_hwnd, w32_system_caret_height, w32_system_caret_x)
10990 (w32_system_caret_y, Qfile_name_history):
10991 * w32font.c (w32font_driver, QCantialias, QCotf, QClang):
10992 * w32inevt.c (reinvoke_input_signal, lispy_function_keys):
10993 * w32menu.c (Qmenu_bar, QCtoggle, QCradio, Qoverriding_local_map)
10994 (Qoverriding_terminal_local_map, Qmenu_bar_update_hook):
10995 * w32proc.c (Qlocal, report_file_error):
10996 * w32term.c (Vwindow_system, updating_frame):
10997 * w32uniscribe.c (initialized, uniscribe_font_driver):
10998 Remove unneeded extern declarations.
10999
2aa46d6c
CY
110002011-03-14 Chong Yidong <cyd@stupidchicken.com>
11001
c96bbc66 11002 * buffer.c (Fmake_indirect_buffer): Fix incorrect assertions.
2aa46d6c 11003
cffc6f3b
CY
110042011-03-13 Chong Yidong <cyd@stupidchicken.com>
11005
11006 * buffer.h (BUF_BEGV, BUF_BEGV_BYTE, BUF_ZV, BUF_ZV_BYTE, BUF_PT)
11007 (BUF_PT_BYTE): Rewrite to handle indirect buffers (Bug#8219).
11008 These macros can no longer be used for assignment.
11009
44f230aa
SM
11010 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer):
11011 Assign struct members directly, instead of using BUF_BEGV etc.
cffc6f3b
CY
11012 (record_buffer_markers, fetch_buffer_markers): New functions for
11013 recording and fetching special buffer markers.
11014 (set_buffer_internal_1, set_buffer_temp): Use them.
11015
11016 * lread.c (unreadchar): Use SET_BUF_PT_BOTH.
11017
11018 * insdel.c (adjust_point): Use SET_BUF_PT_BOTH.
11019
11020 * intervals.c (temp_set_point_both): Use SET_BUF_PT_BOTH.
11021 (get_local_map): Use SET_BUF_BEGV_BOTH and SET_BUF_ZV_BOTH.
11022
11023 * xdisp.c (hscroll_window_tree):
11024 (reconsider_clip_changes): Use PT instead of BUF_PT.
11025
d251f04b
EZ
110262011-03-13 Eli Zaretskii <eliz@gnu.org>
11027
11028 * makefile.w32-in ($(BLD)/editfns.$(O)): Depend on
11029 $(EMACS_ROOT)/lib/intprops.h.
11030
f0c77cd1
PE
110312011-03-13 Paul Eggert <eggert@cs.ucla.edu>
11032
3eca4629
PE
11033 Fix more problems found by GCC 4.5.2's static checks.
11034
7c86ee98
PE
11035 * gtkutil.c (xg_get_pixbuf_from_pixmap): Add cast from char *
11036 to unsigned char * to avoid compiler diagnostic.
b0afc268
PE
11037 (xg_free_frame_widgets): Make it clear that a local variable is
11038 needed only if USE_GTK_TOOLTIP.
01e0b5ad
PE
11039 (gdk_window_get_screen): Make it clear that this macro is needed
11040 only if USE_GTK_TOOLTIP.
1e5524e7
PE
11041 (int_gtk_range_get_value): New function, which avoids a diagnostic
11042 from gcc -Wbad-function-cast.
11043 (xg_set_toolkit_scroll_bar_thumb): Use it.
11044 (xg_tool_bar_callback, xg_tool_item_stale_p): Rewrite to avoid
11045 diagnostic from gcc -Wbad-function-cast.
65dc836c
PE
11046 (get_utf8_string, xg_get_file_with_chooser):
11047 Rename locals to avoid shadowing.
11048 (create_dialog): Move locals to avoid shadowing.
7c86ee98 11049
41729b81
PE
11050 * xgselect.c (xg_select): Remove unused var.
11051
f0c77cd1
PE
11052 * image.c (four_corners_best): Mark locals as initialized.
11053 (gif_load): Initialize transparent_p to zero (Bug#8238).
11054 Mark another local as initialized.
ec6cf4c6 11055 (my_png_error, my_error_exit): Mark with NO_RETURN.
f0c77cd1 11056
ce0ad53d 11057 * image.c (clear_image_cache): Now static.
d5d5a617 11058 (DIM, HAVE_STDLIB_H_1): Remove unused macros.
e22cffbc 11059 (xpm_load): Redo to avoid "discards qualifiers" gcc warning.
77a765fd
PE
11060 (x_edge_detection): Remove unnecessary cast that
11061 gcc -Wbad-function-cast diagnoses.
2037898d 11062 (gif_load): Fix pointer signedness.
6ae141d6
PE
11063 (clear_image_cache, xbm_read_bitmap_data, x_detect_edges):
11064 (jpeg_load, gif_load): Rename locals to avoid shadowing.
ce0ad53d 11065
33383987 110662011-03-12 Paul Eggert <eggert@cs.ucla.edu>
3eca4629 11067
d32df629
PE
11068 Improve quality of tests for time stamp overflow.
11069 For example, without this patch (encode-time 0 0 0 1 1
11070 1152921504606846976) returns the obviously-bogus value (-948597
11071 62170) on my RHEL 5.5 x86-64 host. With the patch, it correctly
11072 reports time overflow. See
11073 <http://lists.gnu.org/archive/html/emacs-devel/2011-03/msg00470.html>.
b8d9bd41
PE
11074 * deps.mk (editfns.o): Depend on ../lib/intprops.h.
11075 * editfns.c: Include limits.h and intprops.h.
11076 (TIME_T_MIN, TIME_T_MAX): New macros.
11077 (time_overflow): Move earlier, to before first use.
11078 (hi_time, lo_time): New functions, for an accurate test for
11079 out-of-range times.
11080 (Fcurrent_time, Fget_internal_run_time, make_time): Use them.
11081 (Fget_internal_run_time): Don't assume time_t fits in int.
11082 (make_time): Use list2 instead of Fcons twice.
11083 (Fdecode_time): More accurate test for out-of-range times.
11084 (check_tm_member): New function.
11085 (Fencode_time): Use it, to test for out-of-range times.
d32df629
PE
11086 (lisp_time_argument): Don't rely on undefined left-shift and
11087 right-shift behavior when checking for time stamp overflow.
8be6f318 11088
fe31d94c
PE
11089 * editfns.c (time_overflow): New function, refactoring common code.
11090 (Fformat_time_string, Fdecode_time, Fencode_time):
11091 (Fcurrent_time_string): Use it.
11092
8be6f318
PE
11093 Move 'make_time' to be next to its inverse 'lisp_time_argument'.
11094 * dired.c (make_time): Move to ...
11095 * editfns.c (make_time): ... here.
11096 * systime.h: Note the move.
11097
09d9db2c 110982011-03-12 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
c47cbdfd 11099
126bc0dc
YM
11100 * fringe.c (update_window_fringes): Remove unused variables.
11101
c47cbdfd
YM
11102 * unexmacosx.c (copy_data_segment): Also copy __got section.
11103 (Bug#8223)
11104
7ac80be9
EZ
111052011-03-12 Eli Zaretskii <eliz@gnu.org>
11106
c96bbc66 11107 * termcap.c [MSDOS]: Include "msdos.h".
058e5dad
EZ
11108 (find_capability, tgetnum, tgetflag, tgetstr, tputs, tgetent):
11109 Constify `char *' arguments and their references according to
11110 prototypes in tparam.h.
11111
ecb0f94d 11112 * deps.mk (termcap.o): Depend on tparam.h and msdos.h.
058e5dad 11113
7ac80be9
EZ
11114 * msdos.c (XMenuAddPane): 3rd argument is `const char *' now.
11115 Adapt all references accordingly.
11116
11117 * msdos.h (XMenuAddPane): 3rd argument is `const char *' now.
11118
ef1fd07e
TT
111192011-03-11 Tom Tromey <tromey@redhat.com>
11120
11121 * buffer.c (syms_of_buffer): Remove obsolete comment.
11122
7ef4b50c
EZ
111232011-03-11 Eli Zaretskii <eliz@gnu.org>
11124
11125 * termhooks.h (encode_terminal_code): Declare prototype.
11126
11127 * msdos.c (encode_terminal_code): Don't declare prototype.
11128
11129 * term.c (encode_terminal_code): Now external again, used by
11130 w32console.c and msdos.c.
11131
44f230aa
SM
11132 * makefile.w32-in ($(BLD)/term.$(O), ($(BLD)/tparam.$(O)):
11133 Depend on $(SRC)/tparam.h, see 2011-03-11T07:24:21Z!eggert@cs.ucla.edu.
7ef4b50c 11134
4b1ec863 111352011-03-11 Paul Eggert <eggert@cs.ucla.edu>
f78faa98 11136
1714f52b 11137 Fix some minor problems found by GCC 4.5.2's static checks.
83316bf4 11138
4b1ec863
PE
11139 * fringe.c (update_window_fringes): Mark locals as initialized
11140 (Bug#8227).
11141 (destroy_fringe_bitmap, init_fringe_bitmap): Now static.
bf60f616 11142
524c7aa6
PE
11143 * alloc.c (mark_fringe_data): Move decl from here ...
11144 * lisp.h (mark_fringe_data) [HAVE_WINDOW_SYSTEM]: ... to here,
11145 to check its interface.
11146 (init_fringe_once): Do not declare unless HAVE_WINDOW_SYSTEM.
11147
a5c0af81 11148 * fontset.c (free_realized_fontset): Now static.
7519b8cd 11149 (Fset_fontset_font): Rename local to avoid shadowing.
cc6e5db1 11150 (fontset_font): Mark local as initialized.
a9a06e0b 11151 (FONTSET_SPEC, FONTSET_REPERTORY, RFONT_DEF_REPERTORY): Remove; unused.
a5c0af81 11152
b4716021
PE
11153 * xrdb.c: Include "xterm.h", to check x_load_resources's interface.
11154
811e9bac 11155 * xselect.c (x_disown_buffer_selections): Remove; not used.
7b83e2f1 11156 (TRACE3) [!defined TRACE_SELECTION]: Remove; not used.
aa0daa9f
PE
11157 (x_own_selection, Fx_disown_selection_internal): Rename locals
11158 to avoid shadowing.
11159 (x_handle_dnd_message): Remove local to avoid shadowing.
811e9bac 11160
7e3ab302
PE
11161 * lisp.h (GCPRO1_VAR, UNGCPRO_VAR): New macros,
11162 so that the caller can use some name other than gcpro1.
11163 (GCPRO1, UNGCPRO): Reimplement in terms of the new macros.
58d2d479
PE
11164 * xfns.c (Fx_create_frame, x_create_tip_frame, Fx_show_tip):
11165 (Fx_backspace_delete_keys_p):
11166 Use them to avoid shadowing, and rename vars to avoid shadowing.
11167 (x_decode_color, x_set_name, x_window): Now static.
6b437900 11168 (Fx_create_frame): Add braces to silence GCC warning.
c0951e53 11169 (Fx_file_dialog, Fx_select_font): Fix pointer signedness.
06b0c8a0
PE
11170 (x_real_positions, xg_set_icon_from_xpm_data, x_create_tip_frame):
11171 Remove unused locals.
7e3ab302
PE
11172 (Fx_create_frame, x_create_tip_frame, Fx_show_tip):
11173 (Fx_backspace_delete_keys_p): Rename locals to avoid shadowing.
11174 Some of these renamings use the new GCPRO1_VAR and UNGCPRO_VAR
11175 macros.
f78faa98 11176
e2b13473
PE
11177 * xterm.h (x_mouse_leave): New decl.
11178
77f23912
PE
11179 * xterm.c (x_copy_dpy_color, x_focus_on_frame, x_unfocus_frame):
11180 Remove unused functions.
cdf4ba58
PE
11181 (x_shift_glyphs_for_insert, XTflash, XTring_bell):
11182 (x_calc_absolute_position): Now static.
7411c686 11183 (XTread_socket): Don't define label "out" unless it's used.
2b07bcff 11184 Don't declare local "event" unless it's used.
ed7bf3a5
PE
11185 (x_iconify_frame, x_free_frame_resources): Don't declare locals
11186 unless they are used.
38d0b34a
PE
11187 (XEMBED_VERSION, xembed_set_info): Don't define unless needed.
11188 (x_fatal_error_signal): Remove; not used.
a6067996
PE
11189 (x_draw_image_foreground, redo_mouse_highlight, XTmouse_position):
11190 (x_scroll_bar_report_motion, handle_one_xevent, x_draw_bar_cursor):
11191 (x_error_catcher, x_connection_closed, x_error_handler):
11192 (x_error_quitter, xembed_send_message, x_iconify_frame):
11193 (my_log_handler): Rename locals to avoid shadowing.
28f1c698 11194 (x_delete_glyphs, x_ins_del_lines): Mark with NO_RETURN.
2a8fade0 11195 (x_connection_closed): Tell GCC not to suggest NO_RETURN.
77f23912 11196
44f230aa
SM
11197 * xfaces.c (clear_face_cache, Fx_list_fonts, Fface_font):
11198 Rename or move locals to avoid shadowing.
6b463e58 11199 (tty_defined_color, merge_face_heights): Now static.
5967d051 11200 (free_realized_faces_for_fontset): Remove; not used.
1e9966ea
PE
11201 (Fx_list_fonts): Mark variable that gcc -Wuninitialized
11202 does not deduce is never used uninitialized.
73719eba
PE
11203 (STRDUPA, LSTRDUPA, FONT_POINT_SIZE_QUANTUM): Remove; not used.
11204 (LFACEP): Define only if XASSERTS, as it's not needed otherwise.
071048a3 11205
426994c3 11206 * terminal.c (store_terminal_param): Now static.
5489860b 11207
032f1620 11208 * xmenu.c (menu_highlight_callback): Now static.
9d66f88e 11209 (set_frame_menubar): Remove unused local.
d4323972 11210 (xmenu_show): Rename parameter to avoid shadowing.
6d1f7fee
PE
11211 (xmenu_show, xdialog_show, xmenu_show): Make local pointers "const"
11212 since they might point to immutable storage.
281585b0
PE
11213 (next_menubar_widget_id): Declare only if USE_X_TOOLKIT,
11214 since it's unused otherwise.
032f1620 11215
367c19e5 11216 * xdisp.c (produce_glyphless_glyph): Initialize lower_xoff.
53df7c11 11217 Add a FIXME, since the code still doesn't look right. (Bug#8215)
9f36b9fd
PE
11218 (Fcurrent_bidi_paragraph_direction): Simplify slightly; this
11219 avoids a gcc -Wuninitialized diagnostic.
0e086e8f 11220 (display_line, BUILD_COMPOSITE_GLYPH_STRING, draw_glyphs):
44a3a108
PE
11221 (note_mouse_highlight): Mark variables that gcc -Wuninitialized
11222 does not deduce are never used uninitialized.
70739cbe 11223
07b48fa9
PE
11224 * lisp.h (IF_LINT): New macro, copied from ../lib-src/emacsclient.c.
11225
8868a238 11226 * xdisp.c (redisplay_window): Rename local to avoid shadowing.
4554d213
PE
11227 * window.c (window_loop, size_window):
11228 (run_window_configuration_change_hook, enlarge_window): Likewise.
8868a238 11229
7e5cf297 11230 * window.c (display_buffer): Now static.
d6550a9f
PE
11231 (size_window): Mark variables that gcc -Wuninitialized
11232 does not deduce are never used uninitialized.
a586633d
PE
11233 * window.h (check_all_windows): New decl, to forestall
11234 gcc -Wmissing-prototypes diagnostic.
5b555da1 11235 * dispextern.h (bidi_dump_cached_states): Likewise.
7e5cf297 11236
f6095868
PE
11237 * charset.h (CHECK_CHARSET_GET_CHARSET): Rename locals to avoid
11238 shadowing.
11239 * charset.c (map_charset_for_dump, Fchar_charset): Likewise.
726929c4
PE
11240 Include <limits.h>.
11241 (Fsort_charsets): Redo min/max calculation to shorten the code a bit
11242 and to avoid gcc -Wuninitialized warning.
89ef49df
PE
11243 (load_charset_map): Mark variables that gcc -Wuninitialized
11244 does not deduce are never used uninitialized.
53df7c11 11245 (load_charset): Abort instead of using uninitialized var (Bug#8229).
f6095868 11246
f38b440c
PE
11247 * coding.c (coding_set_source, coding_set_destination):
11248 Use "else { /* comment */ }" rather than "else /* comment */;"
11249 for clarity, and to avoid gcc -Wempty-body warning.
2735d060
PE
11250 (Fdefine_coding_system_internal): Don't redeclare 'i' inside
11251 a block, when the outer 'i' will do.
11252 (decode_coding_utf_8, decode_coding_utf_16, detect_coding_emacs_mule):
11253 (emacs_mule_char, decode_coding_emacs_mule, detect_coding_iso_2022):
11254 (decode_coding_iso_2022, decode_coding_sjis, decode_coding_big5):
11255 (decode_coding_raw_text, decode_coding_charset, get_translation_table):
11256 (Fdecode_sjis_char, Fdefine_coding_system_internal):
11257 Rename locals to avoid shadowing.
11258 * character.h (FETCH_STRING_CHAR_ADVANCE): Likewise.
e2f1bab9
PE
11259 * coding.c (emacs_mule_char, encode_invocation_designation):
11260 Now static, since they're not used elsewhere.
413bb2db 11261 (decode_coding_iso_2022): Add "default: abort ();" as a safety check.
c4a63b12 11262 (decode_coding_object, encode_coding_object, detect_coding_system):
ee05f961
PE
11263 (decode_coding_emacs_mule): Mark variables that gcc
11264 -Wuninitialized does not deduce are never used uninitialized.
160b01f6
PE
11265 (detect_coding_iso_2022): Initialize a local variable that might
11266 be used uninitialized. Leave a FIXME because it's not clear that
53df7c11 11267 this initialization is needed. (Bug#8211)
5f58e762
PE
11268 (ISO_CODE_LF, ISO_CODE_CR, CODING_ISO_FLAG_EUC_TW_SHIFT):
11269 (ONE_MORE_BYTE_NO_CHECK, UTF_BOM, UTF_16_INVALID_P):
11270 (SHIFT_OUT_OK, ENCODE_CONTROL_SEQUENCE_INTRODUCER):
11271 (ENCODE_DIRECTION_R2L, ENCODE_DIRECTION_L2R):
11272 Remove unused macros.
f38b440c 11273
232b38b9 11274 * category.c (hash_get_category_set): Remove unused local var.
9f3b5e69 11275 (copy_category_table): Now static, since it's not used elsewhere.
d0891610 11276 * character.c (string_count_byte8): Likewise.
232b38b9 11277
fb90da1b
PE
11278 * ccl.c (CCL_WRITE_STRING, CCL_ENCODE_CHAR, Fccl_execute_on_string):
11279 (Fregister_code_conversion_map): Rename locals to avoid shadowing.
11280
fb93dbc2
PE
11281 * chartab.c (copy_sub_char_table): Now static, since it's not used
11282 elsewhere.
5c156ace
PE
11283 (sub_char_table_ref_and_range, char_table_ref_and_range):
11284 Rename locals to avoid shadowing.
bbcd0949 11285 (ASET_RANGE, GET_SUB_CHAR_TABLE): Remove unused macros.
fb93dbc2 11286
7d3b3862 11287 * bidi.c (bidi_check_type): Now static, since it's not used elsewhere.
630d6892 11288 (BIDI_BOB): Remove unused macro.
7d3b3862 11289
6be7d3da
PE
11290 * cm.c (cmgoto): Mark variables that gcc -Wuninitialized does not
11291 deduce are never used uninitialized.
c2ed9c8b 11292 * term.c (encode_terminal_code): Likewise.
6be7d3da 11293
75f8807f 11294 * term.c (encode_terminal_code): Now static. Remove unused local.
72abad34 11295
50938595
PE
11296 * tparam.h: New file.
11297 * term.c, tparam.h: Include it.
11298 * deps.mk (term.o, tparam.o): Depend on tparam.h.
11299 * term.c (tputs, tgetent, tgetflag, tgetnum, tparam, tgetstr):
11300 Move these decls to tparam.h, and make them agree with what
11301 is actually in tparam.c. The previous trick of using incompatible
11302 decls in different modules does not conform to the C standard.
11303 All callers of tparam changed to use tparam's actual API.
11304 * tparam.c (tparam1, tparam, tgoto):
11305 Use const pointers where appropriate.
11306
fbceeba2
PE
11307 * cm.c (calccost, cmgoto): Use const pointers where appropriate.
11308 * cm.h (struct cm): Likewise.
11309 * dispextern.h (do_line_insertion_deletion_costs): Likewise.
11310 * scroll.c (ins_del_costs, do_line_insertion_deletion_costs): Likewise.
11311 * term.c (tty_ins_del_lines, calculate_costs, struct fkey_table):
11312 (term_get_fkeys_1, append_glyphless_glyph, produce_glyphless_glyph):
11313 (turn_on_face, init_tty): Likewise.
11314 * termchar.h (struct tty_display_info): Likewise.
fbceeba2 11315
7f3f1250
PE
11316 * term.c (term_mouse_position): Rename local to avoid shadowing.
11317
e6ca6543
PE
11318 * alloc.c (mark_ttys): Move decl from here ...
11319 * lisp.h (mark_ttys): ... to here, so that it's checked against defn.
11320
c40f8d15
AS
113212011-03-11 Andreas Schwab <schwab@linux-m68k.org>
11322
11323 * .gdbinit (pwinx, xbuffer): Fix access to buffer name.
11324
cfe0661d
JB
113252011-03-09 Juanma Barranquero <lekktu@gmail.com>
11326
11327 * search.c (compile_pattern_1): Remove argument regp, unused since
11328 revid:rms@gnu.org-19941211082627-3x1g1wyqkjmwloig.
11329 (compile_pattern): Don't pass it.
11330
0afb4571
J
113312011-03-08 Jan Djärv <jan.h.d@swipnet.se>
11332
11333 * xterm.h (DEFAULT_GDK_DISPLAY): New define.
11334 (GDK_WINDOW_XID, gtk_widget_get_preferred_size): New defines
11335 for ! HAVE_GTK3.
11336 (GTK_WIDGET_TO_X_WIN): Use GDK_WINDOW_XID.
11337
11338 * xmenu.c (menu_position_func): Call gtk_widget_get_preferred_size.
11339
11340 * gtkutil.c: Include gtkx.h if HAVE_GTK3. If ! HAVE_GTK3, define
11341 gdk_window_get_screen, gdk_window_get_geometry,
11342 gdk_x11_window_lookup_for_display and GDK_KEY_g.
11343 (xg_set_screen): Use DEFAULT_GDK_DISPLAY.
11344 (xg_get_pixbuf_from_pixmap): New function.
11345 (xg_get_pixbuf_from_pix_and_mask): Change parameters from GdkPixmap
11346 to Pixmap, take frame as parameter, remove GdkColormap parameter.
11347 Call xg_get_pixbuf_from_pixmap instead of
11348 gdk_pixbuf_get_from_drawable.
11349 (xg_get_image_for_pixmap): Do not make GdkPixmaps, call
11350 xg_get_pixbuf_from_pix_and_mask with Pixmap parameters instead.
11351 (xg_check_special_colors): Use GtkStyleContext and its functions
11352 for HAVE_GTK3.
11353 (xg_prepare_tooltip, xg_hide_tooltip): Call gdk_window_get_screen.
11354 (xg_prepare_tooltip, create_dialog, menubar_map_cb)
11355 (xg_update_frame_menubar, xg_tool_bar_detach_callback)
44f230aa
SM
11356 (xg_tool_bar_attach_callback, xg_update_tool_bar_sizes):
11357 Call gtk_widget_get_preferred_size.
0afb4571
J
11358 (xg_frame_resized): gdk_window_get_geometry only takes 5
11359 parameters.
44f230aa
SM
11360 (xg_win_to_widget, xg_event_is_for_menubar):
11361 Call gdk_x11_window_lookup_for_display.
0afb4571
J
11362 (xg_set_widget_bg): New function.
11363 (delete_cb): New function.
895009e1 11364 (xg_create_frame_widgets): Connect delete-event to delete_cb.
5c32d3f2 11365 Call xg_set_widget_bg. Only set background pixmap for ! HAVE_GTK3
0afb4571
J
11366 (xg_set_background_color): Call xg_set_widget_bg.
11367 (xg_set_frame_icon): Call xg_get_pixbuf_from_pix_and_mask.
11368 (xg_create_scroll_bar): vadj is a GtkAdjustment for HAVE_GTK3.
11369 Only call gtk_range_set_update_policy if ! HAVE_GTK3.
11370 (xg_make_tool_item): Only connect xg_tool_bar_item_expose_callback
11371 if ! HAVE_GTK3.
11372 (update_frame_tool_bar): Call gtk_widget_hide.
11373 (xg_initialize): Use GDK_KEY_g.
11374
11375 * xsmfns.c (gdk_set_sm_client_id): Define to gdk_set_sm_client_id
11376 if ! HAVE_GTK3
11377 (x_session_initialize): Call gdk_x11_set_sm_client_id.
11378
11379 * xterm.c (XFillRectangle): Use cairo routines for HAVE_GTK3.
11380 (x_term_init): Disable Xinput(2) with GDK_CORE_DEVICE_EVENTS.
11381 Load ~/emacs.d/gtkrc only for ! HAVE_GTK3.
11382
1c2cc4ef
JB
113832011-03-08 Juanma Barranquero <lekktu@gmail.com>
11384
11385 * w32xfns.c (select_palette): Check success of RealizePalette against
11386 GDI_ERROR, not zero.
11387
33383987 11388See ChangeLog.11 for earlier changes.
aac0c6e3
MR
11389
11390;; Local Variables:
11391;; coding: utf-8
aac0c6e3
MR
11392;; End:
11393
2f097256 11394 Copyright (C) 2011-2012 Free Software Foundation, Inc.
aac0c6e3
MR
11395
11396 This file is part of GNU Emacs.
11397
11398 GNU Emacs is free software: you can redistribute it and/or modify
11399 it under the terms of the GNU General Public License as published by
11400 the Free Software Foundation, either version 3 of the License, or
11401 (at your option) any later version.
11402
11403 GNU Emacs is distributed in the hope that it will be useful,
11404 but WITHOUT ANY WARRANTY; without even the implied warranty of
11405 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11406 GNU General Public License for more details.
11407
11408 You should have received a copy of the GNU General Public License
11409 along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.