Merge from trunk.
[bpt/emacs.git] / src / ChangeLog
CommitLineData
1c262cae
PE
12011-09-04 Paul Eggert <eggert@cs.ucla.edu>
2
3 * Makefile.in (gl-stamp): move-if-change now in build-aux (Bug#9169).
4
6511acf2 52011-09-04 Paul Eggert <eggert@cs.ucla.edu>
61bfeeb7 6
0999621a 7 sprintf-related integer and memory overflow issues (Bug#9412).
62f19c19
PE
8
9 * doprnt.c (doprnt): Support printing ptrdiff_t and intmax_t values.
8666506e 10 (esprintf, exprintf, evxprintf): New functions.
62f19c19
PE
11 * keyboard.c (command_loop_level): Now EMACS_INT, not int.
12 (cmd_error): kbd macro iterations count is now EMACS_INT, not int.
13 (modify_event_symbol): Do not assume that the length of
14 name_alist_or_stem is safe to alloca and fits in int.
15 (Fexecute_extended_command): Likewise for function name and binding.
16 (Frecursion_depth): Wrap around reliably on integer overflow.
17 * keymap.c (push_key_description): First arg is now EMACS_INT, not int,
18 since some callers pass EMACS_INT values.
19 (Fsingle_key_description): Don't crash if symbol name contains more
20 than MAX_ALLOCA bytes.
21 * minibuf.c (minibuf_level): Now EMACS_INT, not int.
22 (get_minibuffer): Arg is now EMACS_INT, not int.
23 * lisp.h (get_minibuffer, push_key_description): Reflect API changes.
8666506e 24 (esprintf, exprintf, evxprintf): New decls.
62f19c19
PE
25 * window.h (command_loop_level, minibuf_level): Reflect API changes.
26
2be7d702
PE
27 * dbusbind.c (signature_cat): New function.
28 (xd_signature, Fdbus_register_signal):
2ea16b89
PE
29 Do not overrun buffer; instead, report string overflow.
30
9d1df220
PE
31 * dispnew.c (add_window_display_history): Don't overrun buffer.
32 Truncate instead; this is OK since it's just a log.
33
33ef5c64
PE
34 * editfns.c (Fcurrent_time_zone): Don't overrun buffer
35 even if the time zone offset is outlandishly large.
36 Don't mishandle offset == INT_MIN.
37
66c6fdd5
PE
38 * emacs.c (main) [NS_IMPL_COCOA]: Don't overrun buffer
39 when creating daemon; the previous buffer-overflow check was incorrect.
40
d749b01b
PE
41 * eval.c (verror): Simplify by rewriting in terms of evxprintf,
42 which has the guts of the old verror function.
43
b5cd1905
PE
44 * filelock.c (lock_file_1, lock_file): Don't blindly alloca long name;
45 use SAFE_ALLOCA instead. Use esprintf to avoid int-overflow issues.
46
6e1a67fb
PE
47 * font.c: Include <float.h>, for DBL_MAX_10_EXP.
48 (font_unparse_xlfd): Don't blindly alloca long strings.
c21721cc 49 Don't assume XINT result fits in int, or that XFLOAT_DATA * 10
8666506e 50 fits in int, when using sprintf. Use single snprintf to count
c21721cc
PE
51 length of string rather than counting it via multiple sprintfs;
52 that's simpler and more reliable.
c21721cc
PE
53 (font_unparse_fcname): Use it to avoid sprintf buffer overrun.
54 (generate_otf_features) [0 && HAVE_LIBOTF]: Use esprintf, not
55 sprintf, in case result does not fit in int.
56
c57b67fc
PE
57 * fontset.c (num_auto_fontsets): Now printmax_t, not int.
58 (fontset_from_font): Print it.
59
8a401434
PE
60 * frame.c (tty_frame_count): Now printmax_t, not int.
61 (make_terminal_frame, set_term_frame_name): Print it.
62 (x_report_frame_params): In X, window IDs are unsigned long,
63 not signed long, so print them as unsigned.
64 (validate_x_resource_name): Check for implausibly long names,
65 and don't assume name length fits in 'int'.
66 (x_get_resource_string): Don't blindly alloca invocation name;
67 use SAFE_ALLOCA. Use esprintf, not sprintf, in case result does
68 not fit in int.
69
6e1a67fb
PE
70 * gtkutil.c: Include <float.h>, for DBL_MAX_10_EXP.
71 (xg_check_special_colors, xg_set_geometry):
84722b3d
PE
72 Make sprintf buffers a bit bigger, to avoid potential buffer overrun.
73
0df02bf3
PE
74 * lread.c (dir_warning): Don't blindly alloca buffer; use SAFE_ALLOCA.
75 Use esprintf, not sprintf, in case result does not fit in int.
76
48e30793
PE
77 * macros.c (executing_kbd_macro_iterations): Now EMACS_INT, not int.
78 (Fend_kbd_macro): Don't mishandle MOST_NEGATIVE_FIXNUM by treating
79 it as a large positive number.
80 (Fexecute_kbd_macro): Don't assume repeat count fits in int.
81 * macros.h (executing_kbd_macro_iterations): Now EMACS_INT, not int.
82
a66ff6d8
PE
83 * nsterm.m ((NSSize)windowWillResize): Use esprintf, not sprintf,
84 in case result does not fit in int.
85
aca216ff
PE
86 * print.c (float_to_string): Detect width overflow more reliably.
87 (print_object): Make sprintf buffer a bit bigger, to avoid potential
88 buffer overrun. Don't assume list length fits in 'int'. Treat
89 print length of 0 as 0, not as infinity; to be consistent with other
90 uses of print length in this function. Don't overflow print length
91 index. Don't assume hash table size fits in 'long', or that
92 vectorlike size fits in 'unsigned long'.
93
31c286f7
PE
94 * process.c (make_process): Use printmax_t, not int, to format
95 process-name gensyms.
96
55e5faa1
PE
97 * sysdep.c (snprintf) [! HAVE_SNPRINTF]: New function.
98
80f2e268
PE
99 * term.c (produce_glyphless_glyph): Make sprintf buffer a bit bigger
100 to avoid potential buffer overrun.
101
670741ab
PE
102 * xfaces.c (x_update_menu_appearance): Don't overrun buffer
103 if X resource line is longer than 512 bytes.
104
b7163a50
PE
105 * xfns.c (x_window): Make sprintf buffer a bit bigger
106 to avoid potential buffer overrun.
107
ae58ff1f
PE
108 * xterm.c (x_io_error_quitter): Don't overrun sprintf buffer.
109
c43c8a6a
PE
110 * xterm.h (x_check_errors): Add ATTRIBUTE_FORMAT_PRINTF.
111
3f8236f4
PE
1122011-09-04 Paul Eggert <eggert@cs.ucla.edu>
113
53e9fe90 114 Integer overflow fixes for scrolling, etc.
6511acf2
PE
115 Without these, Emacs silently mishandles large integers sometimes.
116 For example, "C-u 4294967297 M-x recenter" was treated as if
53e9fe90
PE
117 it were "C-u 1 M-x recenter" on a typical 64-bit host.
118
6511acf2
PE
119 * xdisp.c (try_window_id): Check Emacs fixnum range before
120 converting to 'int'.
806add1d 121
6511acf2 122 * window.c (window_scroll_line_based, Frecenter):
71f02bc5
PE
123 Check that an Emacs fixnum is in range before assigning it to 'int'.
124 (Frecenter, Fmove_to_window_line): Use EMACS_INT, not int, for
125 values converted from Emacs fixnums.
126 (Frecenter): Don't wrap around a line count if it is out of 'int'
127 range; instead, treat it as an extreme value.
128 (Fset_window_configuration, compare_window_configurations):
129 Use ptrdiff_t, not int, for index that might exceed 2 GiB.
130
6511acf2
PE
131 * search.c (Freplace_match): Use ptrdiff_t, not int, for indexes
132 that can exceed INT_MAX. Check that EMACS_INT value is in range
133 before assigning it to the (possibly-narrower) index.
a0efffc8
PE
134 (match_limit): Don't assume that a fixnum can fit in 'int'.
135
6511acf2 136 * print.c (print_object): Use ptrdiff_t, not int, for index that can
29ebea3b
PE
137 exceed INT_MAX.
138
6511acf2 139 * indent.c (position_indentation): Now takes ptrdiff_t, not int.
3f8236f4
PE
140 (Fvertical_motion): Don't wrap around LINES values that don't fit
141 in 'int'. Instead, treat them as extreme values. This is good
142 enough for windows, which can't have more than INT_MAX lines anyway.
143
fcb901a7
LMI
1442011-09-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
145
0f2f6b6d
LMI
146 * Require libxml/parser.h to avoid compilation warning.
147
fcb901a7
LMI
148 * emacs.c (shut_down_emacs): Call xmlCleanupParser on shutdown.
149
150 * xml.c (parse_region): Don't call xmlCleanupParser after parsing,
151 since this reportedly can destroy thread storage.
152
6e20a0d4
CY
1532011-08-30 Chong Yidong <cyd@stupidchicken.com>
154
155 * syntax.c (find_defun_start): Update all cache variables if
156 exiting early (Bug#9401).
157
148ae00e
EZ
1582011-08-30 Eli Zaretskii <eliz@gnu.org>
159
f6cfbd8f
EZ
160 * image.c (x_bitmap_pixmap): Cast to int to avoid compiler warnings.
161
148ae00e
EZ
162 * xdisp.c (produce_stretch_glyph): No longer static, compiled also
163 when HAVE_WINDOW_SYSTEM is not defined. Support both GUI and TTY
164 frames. Call tty_append_glyph in the TTY case. (Bug#9402)
165
166 * term.c (tty_append_glyph): New function.
167 (produce_stretch_glyph): Static function and its prototype deleted.
168
169 * dispextern.h (produce_stretch_glyph, tty_append_glyph): Add
170 prototypes.
171
c4a07a4c
PE
1722011-08-29 Paul Eggert <eggert@cs.ucla.edu>
173
174 * image.c (parse_image_spec): Check for nonnegative, not for positive,
175 when checking :margin (Bug#9390).
176 (IMAGE_NON_NEGATIVE_INTEGER_VALUE_OR_PAIR):
177 Renamed from IMAGE_POSITIVE_INTEGER_VALUE_OR_PAIR,
178 so that the name doesn't mislead. All uses changed.
179
6bc8cd65
JB
1802011-08-28 Johan Bockgård <bojohan@gnu.org>
181
182 * term.c (init_tty) [HAVE_GPM]: Move mouse settings after
183 set_tty_hooks.
184
dca4927e
EZ
1852011-08-27 Eli Zaretskii <eliz@gnu.org>
186
187 * xdisp.c (move_it_to): Don't bail out early when reaching
188 position beyond to_charpos, if we are scanning backwards.
189 (move_it_vertically_backward): When DY == 0, make sure we get to
190 the first character in the line after the newline.
191
f2cad773
PE
1922011-08-27 Paul Eggert <eggert@cs.ucla.edu>
193
194 * ccl.c: Improve and simplify overflow checking (Bug#9196).
195 (ccl_driver): Do not generate an out-of-range pointer.
196 (Fccl_execute_on_string): Remove unnecessary check for
197 integer overflow, noted by Stefan Monnier in
198 <http://lists.gnu.org/archive/html/emacs-devel/2011-08/msg00979.html>.
199 Remove a FIXME that didn't need fixing.
200 Simplify the newly-introduced buffer reallocation code.
201
0cae2cdb
JB
2022011-08-27 Juanma Barranquero <lekktu@gmail.com>
203
204 * makefile.w32-in ($(BLD)/alloc.$(O)): Depend on lib/verify.h.
205
5fc295a4 2062011-08-26 Paul Eggert <eggert@cs.ucla.edu>
ddff3151 207
70c60eb2 208 Integer and memory overflow issues (Bug#9196).
726e0ab1 209
d31850da
PE
210 * doc.c (get_doc_string): Rework so that
211 get_doc_string_buffer_size is the actual buffer size, rather than
212 being 1 less than the actual buffer size; this makes xpalloc more
213 convenient.
214
a69fbedb
PE
215 * image.c (x_allocate_bitmap_record, cache_image):
216 * xselect.c (Fx_register_dnd_atom):
217 Simplify previous changes by using xpalloc.
218
fe5c5d37
PE
219 * buffer.c (overlay_str_len): Now ptrdiff_t, not EMACS_INT,
220 since either will do and ptrdiff_t is convenient with xpalloc.
221
0065d054
PE
222 * charset.c (charset_table_size)
223 (struct charset_sort_data.priority): Now ptrdiff_t.
224 (charset_compare): Don't overflow if priorities differ greatly.
225 (Fsort_charsets): Don't assume list length fits in int.
226 Check for size-calculation overflow when allocating sort data.
227 (syms_of_charset): Allocate an initial charset table that is
228 just under 64 KiB, to avoid problems with glibc malloc and mmap.
229
230 * cmds.c (internal_self_insert): Check for size-calculation overflow.
231
232 * composite.h (struct composition.glyph_len): Now int, not unsigned.
233 The actual value is always <= INT_MAX, and leaving it unsigned made
234 overflow checking harder.
235
236 * dispextern.h (struct glyph_matrix.rows_allocated)
237 (struct face_cache.size): Now ptrdiff_t, for convenience in use
238 with xpalloc. The values are still always <= INT_MAX.
239
240 * indent.c (compute_motion): Adjust to region_cache_forward sig change.
241
242 * lisp.h (xnmalloc, xnrealloc, xpalloc): New decls.
243 (SAFE_NALLOCA): New macro.
244
245 * region-cache.c (struct boundary.pos, find_cache_boundary)
246 (move_cache_gap, insert_cache_boundary, delete_cache_boundaries)
247 (set_cache_region, invalidate_region_cache)
248 (revalidate_region_cache, know_region_cache, region_cache_forward)
249 (region_cache_backward, pp_cache):
250 Use ptrdiff_t, not EMACS_INT, since either will do. This is needed
251 so that ptrdiff_t * can be passed to xpalloc.
252 (struct region_cache): Similarly, for gap_start, gap_len, cache_len,
253 beg_unchanged, end_unchanged, buffer_beg, buffer_end members.
254 (pp_cache): Don't assume cache_len fits in int.
255 * region-cache.h: Adjust extern decls to match.
256
257 * search.c (scan_buffer, Freplace_match): Use ptrdiff_t, not
258 EMACS_INT, since either will do, for xpalloc.
259
260 * alloc.c: Include verify.h, and check that int fits in ptrdiff_t.
261 (xnmalloc, xnrealloc, xpalloc): New functions.
262
726e0ab1
PE
263 * bidi.c (bidi_shelve_header_size): New constant.
264 (bidi_cache_ensure_space, bidi_shelve_cache): Use it.
265 (bidi_cache_ensure_space): Avoid integer overflow when allocating.
266
51f30bc5 267 * bidi.c (bidi_cache_shrink):
726e0ab1
PE
268 * buffer.c (overlays_at, overlays_in, record_overlay_string)
269 (overlay_strings):
270 Don't update size of array until after memory allocation succeeds,
271 because xmalloc/xrealloc may not return.
0065d054
PE
272 (struct sortstrlist.bytes): Now ptrdiff_t, as EMACS_INT doesn't help
273 now that we have proper integer overflow checking.
274 (record_overlay_string, overlay_strings): Catch overflows when
275 calculating size of overlay_str_buf.
726e0ab1 276
0065d054
PE
277 * callproc.c (Fcall_process): Check for size overflow when
278 calculating size of args2.
279 (child_setup): Avoid overflow by using size_t rather than ptrdiff_t.
280 Normally we prefer signed values, but sticking with ptrdiff_t would
281 require adding more-complicated checks.
726e0ab1
PE
282
283 * ccl.c (Fccl_execute_on_string): Check for memory overflow.
284 Use ptrdiff_t rather than EMACS_INT where ptrdiff_t will do.
285 Redo buffer-overflow calculations to avoid integer overflow.
0065d054 286 Add a FIXME comment where memory seems to be over-allocated.
726e0ab1
PE
287
288 * character.c (Fstring): Check for size-calculation overflow.
289
290 * coding.c (produce_chars): Redo buffer-overflow calculations to avoid
291 unnecessary integer overflow. Check for size overflow.
292 (encode_coding_object): Don't update size until xmalloc succeeds.
293
294 * composite.c (get_composition_id): Check for overflow in glyph
295 length calculations.
296
297 Integer and memory overflow fixes for display code.
298 * dispextern.h (struct glyph_pool.nglyphs): Now ptrdiff_t, not int.
299 * dispnew.c (adjust_glyph_matrix, realloc_glyph_pool)
300 (scrolling_window): Check for overflow in size calculations.
301 (line_draw_cost, realloc_glyph_pool, add_row_entry):
302 Don't assume glyph table len fits in int.
303 (struct row_entry.bucket, row_entry_pool_size, row_entry_idx)
304 (row_table_size): Now ptrdiff_t, not int.
305 (scrolling_window): Avoid overflow in size calculations.
306 Don't update size until allocation succeeds.
307 * fns.c (concat): Check for overflow in size calculations.
308 (next_almost_prime): Verify NEXT_ALMOST_PRIME_LIMIT.
309 * lisp.h (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): New macros.
310 (NEXT_ALMOST_PRIME_LIMIT): New constant.
311
312 * doc.c (get_doc_string_buffer_size): Now ptrdiff_t, not int.
313 (get_doc_string): Check for size calculation overflow.
314 Don't update size until allocation succeeds.
315 (get_doc_string, Fsubstitute_command_keys): Use ptrdiff_t, not
316 EMACS_INT, where ptrdiff_t will do.
317 (Fsubstitute_command_keys): Check for string overflow.
318
319 * editfns.c (set_time_zone_rule): Don't assume environment length
320 fits in int.
321 (message_length): Now ptrdiff_t, not int.
322 (Fmessage_box): Don't update size until allocation succeeds.
323 Don't assume message length fits in int.
324 (Fformat): Use ptrdiff_t, not EMACS_INT, where ptrdiff_t will do.
325
0065d054
PE
326 * emacs.c (main): Do not reallocate argv, since there is a null at
327 the end that can be overwritten, and this way there's no need to
328 worry about size-calculation overflow.
329 (sort_args): Check for size-calculation overflow.
726e0ab1
PE
330
331 * eval.c (init_eval_once, grow_specpdl): Don't update size until
332 alloc succeeds.
333 (call_debugger, grow_specpdl): Redo calculations to avoid overflow.
334
335 * frame.c (set_menu_bar_lines, x_set_frame_parameters)
336 (x_set_scroll_bar_width, x_figure_window_size):
337 Check for integer overflow.
338 (x_set_alpha): Do not assume XINT fits in int.
339
340 * frame.h (struct frame): Use int, not EMACS_INT, where int works.
341 This is for the members text_lines, text_cols, total_lines, total_cols,
342 where the system imposes an 'int' limit.
343
344 * fringe.c (Fdefine_fringe_bitmap):
345 Don't update size until alloc works.
346
347 * ftfont.c (ftfont_get_open_type_spec, setup_otf_gstring)
348 (ftfont_shape_by_flt): Check for integer overflow in size calculations.
349
350 * gtkutil.c (get_utf8_string, xg_store_widget_in_map):
351 Check for size-calculation overflow.
352 (get_utf8_string): Use ptrdiff_t, not size_t, where either will
353 do, as we prefer signed integers.
354 (id_to_widget.max_size, id_to_widget.used)
355 (xg_store_widget_in_map, xg_remove_widget_from_map)
356 (xg_get_widget_from_map, xg_get_scroll_id_for_window)
357 (xg_remove_scroll_bar, xg_update_scrollbar_pos):
358 Use and return ptrdiff_t, not int.
359 (xg_gtk_scroll_destroy): Don't assume ptrdiff_t fits in int.
360 * gtkutil.h: Change prototypes to match the above.
361
362 * image.c (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): Remove; these
363 are duplicate now that they've been promoted to lisp.h.
364 (x_allocate_bitmap_record, x_alloc_image_color)
365 (make_image_cache, cache_image, xpm_load):
366 Don't update size until alloc is done.
367 (xpm_load, lookup_rgb_color, lookup_pixel_color, x_to_xcolors)
368 (x_detect_edges):
3256efce 369 Check for size calculation overflow.
726e0ab1
PE
370 (ct_colors_allocated_max): New constant.
371 (x_to_xcolors, x_detect_edges): Reorder multiplicands to avoid
372 overflow.
3256efce 373
726e0ab1
PE
374 * keyboard.c (read_char, menu_bar_items, tool_bar_items)
375 (read_char_x_menu_prompt, read_char_minibuf_menu_width)
376 (read_char_minibuf_menu_prompt, follow_key, read_key_sequence):
377 Use ptrdiff_t, not int, to count maps.
378 (read_char_minibuf_menu_prompt): Check for overflow in size
379 calculations. Don't update size until allocation succeeds. Redo
380 calculations to avoid overflow.
381 * keyboard.h: Change prototypes to match the above.
382
383 * keymap.c (cmm_size, current_minor_maps): Use ptrdiff_t, not int,
384 to count maps.
385 (current_minor_maps): Check for size calculation overflow.
386 * keymap.h: Change prototypes to match the above.
387
388 * lread.c (read1, init_obarray): Don't update size until alloc done.
389
390 * macros.c (Fstart_kbd_macro): Don't update size until alloc done.
391 (store_kbd_macro_char): Reorder multiplicands to avoid overflow.
392
726e0ab1
PE
393 * nsterm.h (struct ns_color_table.size, struct ns_color_table.avail):
394 Now ptrdiff_t, not int.
395 * nsterm.m (ns_index_color): Use ptrdiff_t, not int, for table indexes.
396 (ns_draw_fringe_bitmap): Rewrite to avoid overflow.
397
398 * process.c (Fnetwork_interface_list): Check for overflow
399 in size calculation.
400
401 * region-cache.c (move_cache_gap): Check for size calculation overflow.
402
403 * scroll.c (do_line_insertion_deletion_costs): Check for size calc
404 overflow. Don't bother calling xmalloc when xrealloc will do.
405
406 * search.c (Freplace_match): Check for size calculation overflow.
407 (Fset_match_data): Don't assume list lengths fit in 'int'.
408
409 * sysdep.c (system_process_attributes): Use ptrdiff_t, not int,
410 for command line length. Do not attempt to address one before the
411 beginning of an array, as that's not portable.
412
413 * term.c (max_frame_lines): Remove; unused.
414 (encode_terminal_src_size, encode_terminal_dst_size): Now ptrdiff_t,
415 not int.
416 (encode_terminal_code, calculate_costs): Check for size
417 calculation overflow.
418 (encode_terminal_code): Use ptrdiff_t, not int, to record glyph
419 table lengths and related sizes. Don't update size until alloc
420 done. Redo calculations to avoid overflow.
421 (calculate_costs): Don't bother calling xmalloc when xrealloc will do.
422
423 * termcap.c (tgetent): Use ptrdiff_t, not int, to record results of
424 subtracting pointers.
425 (gobble_line): Check for overflow more carefully. Don't update size
426 until alloc done.
427
428 * tparam.c (tparam1): Use ptrdiff_t, not int, for sizes.
429 Don't update size until alloc done.
430 Redo size calculations to avoid overflow.
431 Check for size calculation overflow.
0065d054 432 (main) [DEBUG]: Fix typo in invoking tparam1.
726e0ab1
PE
433
434 * xdisp.c (store_mode_line_noprop_char, x_consider_frame_title):
435 Use ptrdiff_t, not int, for sizes.
436 (store_mode_line_noprop_char): Don't update size until alloc done.
437
0065d054
PE
438 * xfaces.c (lface_id_to_name_size, Finternal_make_lisp_face):
439 Use ptrdiff_t, not int, for sizes.
440 (Finternal_make_lisp_face, cache_face):
441 Check for size calculation overflow.
442 (cache_face): Treat size calculation overflows as if they were
443 memory exhaustion (the usual treatment), rather than aborting.
726e0ab1
PE
444
445 * xfns.c (x_encode_text, x_set_name_internal)
446 (Fx_change_window_property): Use ptrdiff_t, not int, to count
447 sizes, since they can exceed INT_MAX in size. Check for size
448 calculation overflow.
449
0065d054
PE
450 * xgselect.c (gfds_size): Now ptrdiff_t, for convenience with xpalloc.
451 (xg_select): Check for size calculation overflow.
726e0ab1
PE
452 Don't update size until alloc done.
453
0065d054 454 * xrdb.c (get_environ_db): Don't assume path length fits in int,
726e0ab1 455 as sprintf is limited to int lengths.
1d526e2f 456
252c5ee1
PE
457 * xselect.c (X_LONG_SIZE, X_SHRT_MAX, X_SHRT_MIN, X_LONG_MAX)
458 (X_LONG_MIN): New macros.
864d7ce7
PE
459 Use them to make the following changes clearer.
460 (MAX_SELECTION_QUANTUM): Make the other bounds on this value clearer.
461 This change doesn't affect the value now, but it may help remind
462 future maintainers not to raise the value too much later.
463 (SELECTION_QUANTUM): Remove, replacing with ...
464 (selection_quantum): ... new function, which avoids overflow.
465 All uses changed.
466 (struct selection_data.size): Now ptrdiff_t, not int, to avoid
467 assumption that selection length fits in 'int'.
468 (x_reply_selection_request, x_handle_selection_request)
469 (x_get_window_property, receive_incremental_selection)
470 (x_get_window_property_as_lisp_data, selection_data_to_lisp_data)
471 (lisp_data_to_selection_data, clean_local_selection_data):
472 Use ptrdiff_t, not int, to record length of selection.
473 (x_reply_selection_request, x_get_window_property)
474 (receive_incremental_selection, x_property_data_to_lisp):
475 Redo calculations to avoid overflow.
476 (x_reply_selection_request): When sending hint, ceiling it at
252c5ee1 477 X_LONG_MAX rather than relying on wraparound overflow to send
864d7ce7
PE
478 something.
479 (x_get_window_property, receive_incremental_selection)
480 (lisp_data_to_selection_data, x_property_data_to_lisp):
481 Check for size-calculation overflow.
482 (x_get_window_property, receive_incremental_selection)
483 (lisp_data_to_selection_data, Fx_register_dnd_atom):
484 Don't store size until memory allocation succeeds.
485 (x_get_window_property): Plug memory leak on memory exhaustion.
486 Don't double-block input; malloc is safe here. Don't assume 2**34
487 - 4 fits in unsigned long. Add an xassert to check
488 XGetWindowProperty overflow. Be more careful about overflow
489 calculations, and distinguish size from memory overflow better.
490 (receive_incremental_selection): When tracing, don't assume
491 unsigned int is less than INT_MAX.
492 (x_selection_data_to_lisp_data): Remove unnecessary (and in theory
493 harmful) conversions of unsigned short to int.
494 (lisp_data_to_selection_data): Don't assume that integers
495 in the range -65535 through -1 fit in an X unsigned short.
496 Don't assume that ULONG_MAX == X_ULONG_MAX. Don't store into
497 result parameters unless successful. Rely on cons_to_unsigned
498 to report problems with elements; the old code wasn't right anyway.
499 (x_check_property_data): Check for int overflow; we cannot use
500 a wider type due to X limits.
501 (x_handle_dnd_message): Use unsigned int, to avoid int overflow.
502
726e0ab1 503 * xsmfns.c (smc_save_yourself_CB): Check for size calc overflow.
34db673b 504
0065d054
PE
505 * xterm.c (x_color_cells, x_send_scrollbar_event, handle_one_xevent)
506 (x_term_init): Check for size calculation overflow.
726e0ab1
PE
507 (x_color_cells): Don't store size until memory allocation succeeds.
508 (handle_one_xevent): Use ptrdiff_t, not int, for byte counts.
0065d054 509 Don't assume alloca size is less than MAX_ALLOCA.
726e0ab1
PE
510 (x_term_init): Don't assume length fits in int (sprintf is limited
511 to int size).
bc18e09d 512
ebfa62c0
PE
513 Use ptrdiff_t for composition IDs.
514 * character.c (lisp_string_width):
515 * composite.c (composition_table_size, n_compositions)
516 (get_composition_id, composition_gstring_from_id):
517 * dispextern.h (struct glyph_string.cmp_id, struct composition_it.id):
518 * xdisp.c (BUILD_COMPOSITE_GLYPH_STRING):
519 * window.c (Frecenter):
520 Use ptrdiff_t, not int, for composition IDs.
521 * composite.c (get_composition_id): Check for integer overflow.
522 * composite.h: Adjust prototypes to match the above changes.
523
d3411f89
PE
524 Use ptrdiff_t for hash table indexes.
525 * category.c (hash_get_category_set):
526 * ccl.c (ccl_driver):
527 * charset.h (struct charset.hash_index, CHECK_CHARSET_GET_ID):
528 * coding.c (coding_system_charset_list, detect_coding_system):
529 * coding.h (struct coding_system.id):
530 * composite.c (get_composition_id, gstring_lookup_cache):
531 * fns.c (hash_lookup, hash_put, Fgethash, Fputhash):
532 * image.c (xpm_get_color_table_h):
533 * lisp.h (hash_lookup, hash_put):
534 * minibuf.c (Ftest_completion):
535 Use ptrdiff_t for hash table indexes, not int (which is too
536 narrow, on 64-bit hosts) or EMACS_INT (which is too wide, on
537 32-bit --with-wide-int hosts).
538
e097a6fa
PE
539 * charset.c (Fdefine_charset_internal): Check for integer overflow.
540 Add a FIXME comment about memory leaks.
541 (syms_of_charset): Don't assume xmalloc returns.
542
5637687f
PE
543 Don't assume that stated character widths fit in int.
544 * character.c (Fchar_width, c_string_width, lisp_string_width):
545 * character.h (CHAR_WIDTH):
546 * indent.c (MULTIBYTE_BYTES_WIDTH):
547 Use sanitize_char_width to avoid undefined and/or bad behavior
548 with outlandish widths.
549 * character.h (sanitize_tab_width): Renamed from sanitize_width,
550 now that we have two such functions. All uses changed.
551 (sanitize_char_width): New inline function.
552
a2271ba2
PE
553 Don't assume that tab-width fits in int.
554 * character.h (sanitize_width): New inline function.
555 (SANE_TAB_WIDTH): New macro.
556 (ASCII_CHAR_WIDTH): Use it.
557 * indent.c (sane_tab_width): Remove. All uses replaced by
558 SANE_TAB_WIDTH (current_buffer).
559 * xdisp.c (init_iterator): Use SANE_TAB_WIDTH.
560
18c52557
PE
561 * fileio.c: Integer overflow issues with file modes.
562 (Fset_file_modes, auto_save_1): Don't assume EMACS_INT fits in int.
563
caeeedc1
PE
564 * charset.c (read_hex): New arg OVERFLOW. All uses changed.
565 Remove unreachable code.
566 (read_hex, load_charset_map_from_file): Check for integer overflow.
567
50849c52
PE
568 * xterm.c: don't go over XClientMessageEvent limit
569 (scroll_bar_windows_size): Now ptrdiff_t, as we prefer signed.
570 (x_send_scroll_bar_event): Likewise. Check that the size does not
571 exceed limits imposed by XClientMessageEvent, as well as the usual
572 ptrdiff_t and size_t limits.
573
b13995db
PE
574 * keyboard.c: Overflow, signedness and related fixes.
575 (make_lispy_movement): Use same integer type in forward decl
576 that is used in the definition.
577 (read_key_sequence, keyremap_step):
578 Change bufsize argument back to int, undoing my 2011-03-30 change.
579 We prefer signed types, and int is wide enough here.
580 (parse_tool_bar_item): Don't assume tool_bar_max_label_size is less
581 than TYPE_MAXIMUM (EMACS_INT) / 2. Don't let the label size grow
582 larger than STRING_BYTES_BOUND. Use ptrdiff_t for Emacs string
583 length, not size_t. Use ptrdiff_t for index, not int.
584 (keyremap_step, read_key_sequence): Redo bufsize check to avoid
585 possibility of integer overflow.
586
13464394
PE
587 Overflow, signedness and related fixes for images.
588
589 * dispextern.h (struct it.stack[0].u.image.image_id)
590 (struct_it.image_id, struct image.id, struct image_cache.size)
591 (struct image_cache.used, struct image_cache.ref_count):
592 * gtkutil.c (update_frame_tool_bar):
593 * image.c (x_reference_bitmap, Fimage_size, Fimage_mask_p)
594 (Fimage_metadata, free_image_cache, clear_image_cache, lookup_image)
595 (cache_image, mark_image_cache, x_kill_gs_process, Flookup_image):
596 * nsmenu.m (update_frame_tool_bar):
597 * xdisp.c (calc_pixel_width_or_height):
598 * xfns.c (image_cache_refcount):
599 Image IDs are now ptrdiff_t, not int, to avoid arbitrary limits
600 on typical 64-bit hosts.
601
602 * image.c (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): New macros.
603 (x_bitmap_pixmap, x_create_x_image_and_pixmap):
604 Omit unnecessary casts to int.
605 (parse_image_spec): Check that integers fall into 'int' range
606 when the callers expect that.
607 (image_ascent): Redo ascent calculation to avoid int overflow.
608 (clear_image_cache): Avoid overflow when sqrt (INT_MAX) < nimages.
609 (lookup_image): Remove unnecessary tests.
610 (xbm_image_p): Locals are now of int, not EMACS_INT,
611 since parse_image_check makes sure they fit into int.
612 (png_load, gif_load, svg_load_image):
613 Prefer int to unsigned where either will do.
614 (tiff_handler): New function, combining the cores of the
615 old tiff_error_handler and tiff_warning_handler. This
616 function is rewritten to use vsnprintf and thereby avoid
617 stack buffer overflows. It uses only the features of vsnprintf
618 that are common to both POSIX and native Microsoft.
619 (tiff_error_handler, tiff_warning_handler): Use it.
620 (tiff_load, gif_load, imagemagick_load_image):
621 Don't assume :index value fits in 'int'.
622 (gif_load): Omit unnecessary cast to double, and avoid double-rounding.
623 (imagemagick_load_image): Check that crop parameters fit into
624 the integer types that MagickCropImage accepts. Don't assume
625 Vimagemagick_render_type has a nonnegative value. Don't assume
626 size_t fits in 'long'.
627 (gs_load): Use printmax_t to print the widest integers possible.
628 Check for integer overflow when computing image height and width.
629
c11821d4
EZ
6302011-08-26 Eli Zaretskii <eliz@gnu.org>
631
632 * xdisp.c (redisplay_window): Don't force window start if point
633 will be invisible in the resulting window. (Bug#9324)
634
0c95fcf7
EZ
6352011-08-25 Eli Zaretskii <eliz@gnu.org>
636
637 * xdisp.c (compute_display_string_pos): Return 2 in DISP_PROP when
638 the display spec is of the form `(space ...)'.
639 (handle_display_spec): Return the value returned by
640 handle_single_display_spec, not just 1 or zero.
641 (handle_single_display_spec): If the display spec is of the form
642 `(space ...)', and specifies display in the text area, return 2
643 rather than 1.
fee65a97 644 (try_cursor_movement): Check for the need to scroll more
e25be792
EZ
645 accurately, and prefer exact match for point under bidi. Don't
646 advance `row' beyond the last row of the window.
0c95fcf7
EZ
647
648 * dispextern.h (struct bidi_it): Rename the disp_prop_p member
649 into disp_prop; all users changed.
650
651 * bidi.c (bidi_fetch_char): If compute_display_string_pos returns
652 DISP_PROP = 2, substitute the u+2029 PARAGRAPH SEPARATOR character
653 for the text covered by the display property.
654
e4ed06f1
CY
6552011-08-25 Chong Yidong <cyd@stupidchicken.com>
656
657 * buffer.c (Fbury_buffer_internal): Rename from Funrecord_buffer.
658 Change return value to nil.
659 (Frecord_buffer): Delete unused function.
660
f67cdd7f
EZ
6612011-08-24 Eli Zaretskii <eliz@gnu.org>
662
5980d4c6
EZ
663 * xdisp.c (Fcurrent_bidi_paragraph_direction): For unibyte
664 buffers, return left-to-right.
8610fe8b
EZ
665 (set_cursor_from_row): Consider candidate row a win if its glyph
666 represents a newline and point is on that newline. Fixes cursor
667 positioning on the newline at EOL of R2L text within L2R
668 paragraph, and vice versa.
669 (try_cursor_movement): Check continued rows, in addition to
670 continuation rows. Fixes unwarranted scroll when point enters a
671 continued line of R2L text within an L2R paragraph, or vice versa.
672 (cursor_row_p): Consider the case of point being equal to
673 MATRIX_ROW_END_CHARPOS. Prevents cursor being stuck when moving
674 from the end of a short line to the beginning of a continued line
675 of R2L text within L2R paragraph.
676 (RECORD_MAX_MIN_POS): For max_pos, use IT_CHARPOS even for
677 composed characters.
5980d4c6 678
f67cdd7f
EZ
679 * bidi.c (bidi_check_type): Use xassert.
680 (bidi_cache_iterator_state): Update the disp_pos and disp_prop_p
681 members.
682
bca633fb
EZ
6832011-08-23 Eli Zaretskii <eliz@gnu.org>
684
685 * bidi.c (bidi_get_type): Abort if we get zero as the bidi type of
686 a character.
687
4a5885a7
CY
6882011-08-23 Chong Yidong <cyd@stupidchicken.com>
689
690 * nsfont.m (ns_otf_to_script): Fix typo.
691
0902a04e
KH
6922011-08-22 Kenichi Handa <handa@m17n.org>
693
694 * chartab.c (Fset_char_table_extra_slot): Do not inhibit setting a
695 extra slot even if the purpose is char-code-property-table.
696
1a2e6670
EZ
6972011-08-23 Eli Zaretskii <eliz@gnu.org>
698
8ddde651
EZ
699 * xdisp.c (redisplay_window): When computing centering_position,
700 account for the height of the header line. (Bug#8874)
701
425cc014
EZ
702 * dispnew.c (buffer_posn_from_coords): Use buf_charpos_to_bytepos
703 instead of CHAR_TO_BYTE. Fixes a crash when a completion
704 candidate is selected by the mouse, and that candidate has a
705 composed character under the mouse.
706
1a2e6670
EZ
707 * xdisp.c (x_produce_glyphs): Set it->nglyphs to 1. Fixes pixel
708 coordinates reported by pos-visible-in-window-p for a composed
709 character in column zero.
710
8b76d6f8
SM
7112011-08-23 Stefan Monnier <monnier@iro.umontreal.ca>
712
713 * cmds.c (Fself_insert_command): Mention post-self-insert-hook.
714
dac347dd
EZ
7152011-08-22 Eli Zaretskii <eliz@gnu.org>
716
717 * xdisp.c (BUFFER_POS_REACHED_P): If this is a composition,
718 consider it a hit if to_charpos is anywhere in the range of the
719 composed buffer positions.
720
e013fb34
CY
7212011-08-22 Chong Yidong <cyd@stupidchicken.com>
722
723 * image.c (gif_load): Don't assume that each subimage has the same
724 dimensions as the base image. Handle disposal method that is
725 "undefined" by the gif spec (Bug#9335).
726
bd1ba3e8
CY
7272011-08-20 Chong Yidong <cyd@stupidchicken.com>
728
729 * eval.c (Fsignal): Handle `debug' symbol in error handler (Bug#9329).
024a2d76 730 (Fcondition_case): Document `debug' symbol in error handler.
bd1ba3e8 731
54a1215b
EZ
7322011-08-19 Eli Zaretskii <eliz@gnu.org>
733
823564e5
EZ
734 * xfaces.c (face_at_buffer_position): Avoid repeated evaluation of
735 face ID by FACE_FROM_ID, and avoid a crash when mouse is moved
736 from an Org mode buffer to a Speedbar frame.
737
54a1215b
EZ
738 * xdisp.c (RECORD_MAX_MIN_POS): If the display element comes from
739 a composition, take its buffer position from IT->cmp_it.charpos.
740 Fixes cursor positioning at the beginning of a line that begins
741 with a composed character.
742
9778ebcc
EZ
7432011-08-18 Eli Zaretskii <eliz@gnu.org>
744
0be6ee06
EZ
745 * bidi.c (bidi_get_type): If bidi_type_table reports zero as the
746 character bidirectional type, use STRONG_L instead. Fixes crashes
747 in a buffer produced by `describe-categories'.
748
9778ebcc
EZ
749 * dispextern.h (struct bidi_it): Move disp_pos and disp_prop_p
750 members before the level stack, so they would be saved and
751 restored when copying iterator state. Fixes incorrect reordering
752 around TABs covered by display properties.
753
156bffbe
AS
7542011-08-18 Andreas Schwab <schwab@linux-m68k.org>
755
756 * process.c (Fnetwork_interface_list): Correctly determine buffer
757 size.
758
72ad093b
CY
7592011-08-17 Chong Yidong <cyd@stupidchicken.com>
760
761 * eval.c (internal_condition_case, internal_condition_case_1)
8b76d6f8
SM
762 (internal_condition_case_2, internal_condition_case_n):
763 Remove unnecessary aborts (Bug#9081).
72ad093b 764
35774242
EZ
7652011-08-17 Eli Zaretskii <eliz@gnu.org>
766
767 * lread.c (Fload) [DOS_NT]: If `openp' returns -2, but the file
768 has no `load' handler, try opening the file locally. (Bug#9311)
769
db76dd85
KB
7702011-08-16 Ken Brown <kbrown@cornell.edu>
771
772 * gmalloc.c: Expand comment.
773
b215eee5
EZ
7742011-08-16 Eli Zaretskii <eliz@gnu.org>
775
776 * xdisp.c (set_cursor_from_row): Don't accept a previous candidate
777 if it fails the cursor_row_p test. Fixes cursor positioning at ZV.
778
a4579d33
KB
7792011-08-16 Ken Brown <kbrown@cornell.edu>
780
781 Fix memory allocation problems in Cygwin build (Bug#9273).
782
783 * unexcw.c ( __malloc_initialized): Declare external variable.
784 (fixup_executable): Force the dumped emacs to reinitialize malloc.
785
8b76d6f8
SM
786 * gmalloc.c [CYGWIN] (bss_sbrk_heapbase, bss_sbrk_heapinfo):
787 New variables.
a4579d33
KB
788 (malloc_initialize_1) [CYGWIN]: Prepare for reinitializing the
789 dumped emacs.
790 (_free_internal_nolock) [CYGWIN]: Ignore requests to free storage
791 in the static heap.
792 [CYGWIN] (special_realloc): New function.
793 (_realloc_internal_nolock) [CYGWIN]: Use the new function on
794 requests to realloc storage in the static heap.
795
3ebec551
PE
7962011-08-15 Paul Eggert <eggert@cs.ucla.edu>
797
798 * bidi.c (bidi_initialize): Remove unused local.
799
9fd8be00
EZ
8002011-08-15 Eli Zaretskii <eliz@gnu.org>
801
474a8465
EZ
802 * biditype.h: File removed.
803
804 * bidimirror.h: File removed.
805
806 * deps.mk (bidi.o): Remove biditype.h and
807 bidimirror.h.
808
809 * makefile.w32-in ($(BLD)/bidi.$(O)): Remove biditype.h and
810 bidimirror.h.
811
812 * dispextern.h: Fix a typo in the comment to bidi_type_t.
813
814 * chartab.c: Improve commentary for the uniprop_table API.
815
32413314
EZ
816 * bidi.c (bidi_paragraph_init): Support zero value of
817 bidi_ignore_explicit_marks_for_paragraph_level.
474a8465
EZ
818 (bidi_initialize): Use uniprop_table instead of including
819 biditype.h and bidimirror.h.
32413314 820
9fd8be00
EZ
821 * xdisp.c (move_it_in_display_line_to): Don't reset pixel
822 coordinates of the iterator when restoring from ppos_it.
823 (Bug#9296)
824
5cf2b69b
KH
8252011-08-14 Kenichi Handa <handa@m17n.org>
826
827 * process.c (create_process): Call setup_process_coding_systems
72ad093b 828 after the pid of the process is set to -1 (Bug#8162).
5cf2b69b 829
daf17d00
EZ
8302011-08-14 Eli Zaretskii <eliz@gnu.org>
831
832 * xdisp.c (move_it_in_display_line_to): Don't invoke
833 IT_RESET_X_ASCENT_DESCENT when iterator position was restored from
834 ppos_it. Fixes vertical cursor motion when line beginning is
835 covered by an image. (Bug#9296)
836
08e3161a
JD
8372011-08-14 Jan Djärv <jan.h.d@swipnet.se>
838
839 * nsterm.h (ns_run_ascript): Declare.
840 (NSAPP_DATA2_RUNASSCRIPT): Define.
841
842 * nsfns.m (as_script, as_result, as_status): New static variables.
843 (ns_run_ascript): New function.
844 (Fns_do_applescript): Set variables as_*. Make an NSApplicationDefined
845 event with data2 set to NSAPP_DATA2_RUNASSCRIPT, post it and then start
846 the event loop. Get status from as_status (Bug#7276).
847
848 * nsterm.m (sendEvent): If event is NSApplicationDefined and
849 data2 is NSAPP_DATA2_RUNASSCRIPT, call ns_run_ascript and then exit
850 the event loop (Bug#7276).
851
a3720aa2
AS
8522011-08-14 Andreas Schwab <schwab@linux-m68k.org>
853
854 * gnutls.c (QCgnutls_bootprop_priority)
855 (QCgnutls_bootprop_trustfiles, QCgnutls_bootprop_keylist)
856 (QCgnutls_bootprop_crlfiles, QCgnutls_bootprop_callbacks)
857 (QCgnutls_bootprop_loglevel, QCgnutls_bootprop_hostname)
858 (QCgnutls_bootprop_min_prime_bits, QCgnutls_bootprop_verify_flags)
859 (QCgnutls_bootprop_verify_hostname_error)
860 (QCgnutls_bootprop_callbacks_verify): Rename from
861 Qgnutls_bootprop_..., all uses changed.
862
863 * xfaces.c (QCignore_defface): Rename from Qignore_defface, all
864 uses changed.
865
0a0d27fb
PE
8662011-08-14 Paul Eggert <eggert@cs.ucla.edu>
867
19d5c50c
PE
868 * xfaces.c (Qframe_set_background_mode): Now static.
869 * dispextern.h (Qframe_set_background_mode): Remove decl.
870
0a0d27fb
PE
871 * process.c (Fnetwork_interface_info): Declare local only if needed.
872
377538cb
JD
8732011-08-13 Jan Djärv <jan.h.d@swipnet.se>
874
875 * process.c: Include ifaddrs.h and net/if_dl.h if available (Bug#8477).
876 (Fnetwork_interface_list): Allocate in increments of bytes instead
877 of sizeof (struct ifreq). Iterate over ifconf.ifc_req by counting
878 bytes (Bug#8477). Count bytes correctly when ifr_addr is a struct
879 sockaddr.
880 (struct ifflag_def): notrailers is smart on OSX.
881 (Fnetwork_interface_info): Handle case when ifr_flags is negative.
882 Get hardware address with getifaddrs if available.
883
08fff70c
EZ
8842011-08-12 Eli Zaretskii <eliz@gnu.org>
885
886 * xdisp.c (iterate_out_of_display_property): xassert that
887 IT->position is set to within IT->object's boundaries. Break from
888 the loop as soon as EOB is reached; avoids infloops in redisplay
8b76d6f8
SM
889 when IT->position is set up wrongly due to some bug.
890 Set IT->current to match the bidi iterator unconditionally.
08fff70c
EZ
891 (push_display_prop): Allow GET_FROM_STRING as IT->method on
892 entry. Force push_it to save on the stack the current
893 buffer/string position, to be restored by pop_it. Fix flags in
894 the iterator structure wrt the object coming from a display
895 property, as `line-prefix' and `wrap-prefix' are not ``replacing''
896 properties. (Bug#9284)
897
7be1c708 8982011-08-09 Andreas Schwab <schwab@linux-m68k.org>
aac0c6e3 899
7be1c708
CY
900 * fontset.c (fontset_get_font_group): Add proper type checks.
901 (Bug#9172)
aac0c6e3 902
7be1c708 9032011-08-09 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
aac0c6e3 904
7be1c708
CY
905 * unexmacosx.c (print_load_command_name): Add cases LC_FUNCTION_STARTS
906 and LC_VERSION_MIN_MACOSX.
907 (copy_linkedit_data) [LC_FUNCTION_STARTS]: New function.
908 (dump_it) [LC_FUNCTION_STARTS]: Use it.
aac0c6e3 909
97bb72a6
EZ
9102011-08-08 Eli Zaretskii <eliz@gnu.org>
911
912 * xdisp.c (forward_to_next_line_start): Allow to use the
8b76d6f8
SM
913 no-display-properties-and-no-overlays under bidi display.
914 Set disp_pos in the bidi iterator to avoid searches for display
757664a4 915 properties and overlays.
97bb72a6 916
d5617611
CY
9172011-08-08 Chong Yidong <cyd@stupidchicken.com>
918
37e11a63
CY
919 * editfns.c (Fset_time_zone_rule): Document relationship with the
920 setenv function.
921
d5617611
CY
922 * ftfont.c (ftfont_pattern_entity): Copy the extras argument to
923 the font entity extracted from the cache (Bug#8109).
924
58872834
CY
9252011-08-07 Chong Yidong <cyd@stupidchicken.com>
926
927 * composite.c (autocmp_chars): Don't reset point. That is done by
928 restore_point_unwind (Bug#5984).
929
75bfc667
JL
9302011-08-07 Juri Linkov <juri@jurta.org>
931
932 * editfns.c (Fformat_time_string): Doc fix, add tag `usage:'
933 to show the arg `TIME' instead of `TIMEVAL'.
934
d1410150
EZ
9352011-08-06 Eli Zaretskii <eliz@gnu.org>
936
937 * xdisp.c (set_cursor_from_row): Fix cursor positioning when a
938 display property strides EOL and includes a newline, as in
939 longlines-mode. (Bug#9254)
75b771e4
EZ
940 (move_it_in_display_line_to): Fix vertical-motion in a buffer with
941 word-wrap under bidirectional display. (Bug#9224)
d1410150
EZ
942
943 * bidi.c (bidi_unshelve_cache): Don't reset the cache if JUST_FREE
944 is non-zero, even if the data buffer is NULL. Fixes a crash in
945 vertical-motion with longlines-mode. (Bug#9254)
946
35928349
EZ
9472011-08-05 Eli Zaretskii <eliz@gnu.org>
948
ec7cc85b
EZ
949 * bidi.c <bidi_cache_total_alloc>: Now static.
950 (bidi_initialize): Initialize bidi_cache_total_alloc.
951
8b76d6f8 952 * xdisp.c (display_line): Release buffer allocated for shelved bidi
35928349
EZ
953 cache. (Bug#9221)
954
955 * bidi.c (bidi_shelve_cache, bidi_unshelve_cache): Track total
956 amount allocated this far in `bidi_cache_total_alloc'.
957 (bidi_unshelve_cache): Accept an additional argument JUST_FREE; if
958 non-zero, only free the data buffer without restoring the cache
959 contents. All callers changed.
960
961 * dispextern.h (bidi_unshelve_cache): Update prototype.
962
963 * xdisp.c (SAVE_IT, pos_visible_p, move_it_in_display_line_to)
964 (move_it_in_display_line, move_it_to)
965 (move_it_vertically_backward, move_it_by_lines): Replace the call
966 to xfree to an equivalent call to bidi_unshelve_cache.
967 (move_it_in_display_line_to): Fix logic of returning
412b6358 968 MOVE_POS_MATCH_OR_ZV in the bidi case. (Bug#9224)
35928349 969
e2e2423b
EZ
9702011-08-05 Eli Zaretskii <eliz@gnu.org>
971
972 * xdisp.c (set_cursor_from_row): Prefer the candidate glyph that
973 came from a string character with a `cursor' property. (Bug#9229)
974
ae9e757a
JD
9752011-08-04 Jan Djärv <jan.h.d@swipnet.se>
976
977 * Makefile.in (LIB_PTHREAD): New variable.
978 (LIBES): Add LIB_PTHREAD (Bug#9216).
979
980 * alloc.c, emacs.c, gmalloc.c, gtkutil.c, keyboard.c, syssignal.h:
981 Rename HAVE_GTK_AND_PTHREAD to HAVE_PTHREAD (Bug#9216).
982
213bd7f2
AS
9832011-08-04 Andreas Schwab <schwab@linux-m68k.org>
984
985 * regex.c (re_iswctype): Remove some redundant boolean
986 conversions.
987
99aaf75f
JD
9882011-08-04 Jan Djärv <jan.h.d@swipnet.se>
989
990 * xterm.c (x_find_topmost_parent): New function.
991 (x_set_frame_alpha): Find topmost parent window with
992 x_find_topmost_parent and set the property there also (bug#9181).
993 (handle_one_xevent): Call x_set_frame_alpha on ReparentNotify.
994
c74e9d86
PE
9952011-08-04 Paul Eggert <eggert@cs.ucla.edu>
996
997 * callproc.c (Fcall_process): Avoid vfork clobbering
998 the local vars buffer, coding_systems, current_dir.
999
640c8776
SM
10002011-08-03 Stefan Monnier <monnier@iro.umontreal.ca>
1001
1002 * keymap.c (Fmake_composed_keymap): Move to subr.el.
1003
f26d0e4c
PE
10042011-08-03 Paul Eggert <eggert@cs.ucla.edu>
1005
8a10d76c
PE
1006 * fontset.c (dump_fontset) [FONTSET_DEBUG]: Declare EXTERNALLY_VISIBLE
1007 so that it is not optimized away.
1008
f26d0e4c
PE
1009 * xdisp.c (compute_display_string_pos): Remove unused local.
1010
55439c61
EZ
10112011-08-02 Eli Zaretskii <eliz@gnu.org>
1012
1013 Fix slow cursor motion and scrolling in large buffers with
1014 selective display, like Org Mode buffers. (Bug#9218)
1015
1016 * dispextern.h (struct bidi_it): New member disp_prop_p.
1017
1018 * xdisp.c: Remove one-slot cache of display string positions.
1019 (compute_display_string_pos): Accept an additional argument
1020 DISP_PROP_P; callers changed. Scan at most 5K characters forward
1021 for a display string or property. If found, set DISP_PROP_P
1022 non-zero.
1023
1024 * bidi.c (bidi_fetch_char): Accept an additional argument
640c8776
SM
1025 DISP_PROP_P, and pass it to compute_display_string_pos.
1026 Only handle text covered by a display string if DISP_PROP_P is returned
55439c61
EZ
1027 non-zero. All callers of bidi_fetch_char changed.
1028
fb33fa43
SM
10292011-08-02 Stefan Monnier <monnier@iro.umontreal.ca>
1030
1031 * keymap.c (Fdefine_key): Fix Lisp_Object/int mixup; apply some CSE.
1032
b099e063
DM
10332010-12-03 Don March <don@ohspite.net>
1034
1035 * keymap.c (Fdefine_key): Fix non-prefix key error message when
1036 last character M-[char] is translated to ESC [char] (bug#7541).
1037
5cc7f7af
KH
10382011-08-02 Kenichi Handa <handa@m17n.org>
1039
d0fffa3f 1040 * lisp.h (uniprop_table): Extern it.
5cc7f7af
KH
1041
1042 * chartab.c (uniprop_table): Make it non-static.
1043
525d5e6e
EZ
10442011-08-01 Eli Zaretskii <eliz@gnu.org>
1045
1046 * xdisp.c (forward_to_next_line_start): Accept additional argument
1047 BIDI_IT_PREV, and store into it the state of the bidi iterator had
1048 on the newline.
1049 (reseat_at_next_visible_line_start): Use the bidi iterator state
1050 returned by forward_to_next_line_start to restore the state of
1051 it->bidi_it after backing up to previous newline. (Bug#9212)
1052
31011111
AS
10532011-07-30 Andreas Schwab <schwab@linux-m68k.org>
1054
1055 * regex.c (re_comp): Protoize.
1056 (re_exec): Fix return type.
1057 (regexec): Fix type of `ret'. (Bug#9203)
1058
476371c4
PE
10592011-07-28 Paul Eggert <eggert@cs.ucla.edu>
1060
e5d76069
PE
1061 * image.c (check_image_size): Use 1024x1024 if unknown frame (Bug#9189).
1062 This is needed if max-image-size is a floating-point number.
1063
9a79b20c
AS
10642011-07-28 Andreas Schwab <schwab@linux-m68k.org>
1065
1066 * print.c (print_object): Print empty symbol as ##.
1067
1068 * lread.c (read1): Read ## as empty symbol.
1069
d8c2fa78
AA
10702011-07-28 Alp Aker <alp.tekin.aker@gmail.com>
1071
1072 * nsfns.m (x_set_foreground_color): Set f->foreground_pixel when
1073 setting frame foreground color (Bug#9175).
1074 (x_set_background_color): Likewise.
1075
ffe57a7a
AA
1076 * nsmenu.m (-setText): Size tooltip dimensions precisely to
1077 contents (Bug#9176).
1078 (EmacsTooltip -init): Remove bezels and add shadows to
1079 tooltip windows.
1080
bf3492a5
AA
1081 * nsterm.m (ns_dumpglyphs_stretch): Avoid overwriting left fringe
1082 or scroll bar (Bug#8470).
1083
d55e9c53
AA
1084 * nsfont.m (nsfont_open): Remove assignment to voffset and
1085 unnecessary vars hshink, expand, hd, full_height, min_height.
1086 (nsfont_draw): Use s->ybase as baseline for glyph drawing (Bug#8913).
1087
1088 * nsterm.h (nsfont_info): Remove voffset field.
1089
d8c2fa78 10902011-07-28 Alp Aker <alp.tekin.aker@gmail.com>
4843aac3
AA
1091
1092 Implement strike-through and overline on NextStep (Bug#8863).
1093
1094 * nsfont.m (nsfont_open): Use underline position provided by font,
1095 instead of hard-coded value of 2.
1096 (nsfont_draw): Call ns_draw_text_decoration instead.
1097
1098 * nsterm.h: Add declaration for ns_draw_text_decoration.
1099
1100 * nsterm.m (ns_draw_text_decoration): New function for drawing
1101 underline, overline, and strike-through.
1102 (ns_dumpglyphs_image, ns_dumpglyphs_stretch): Add call to
1103 ns_draw_text_decoration. Change treatment of cursor drawing to
1104 accomodate underlining, etc.
1105
4cc60b9b
EZ
11062011-07-28 Eli Zaretskii <eliz@gnu.org>
1107
bc7ece87
EZ
1108 * buffer.c (init_buffer_once): Set bidi-display-reordering to t by
1109 default.
4cc60b9b 1110
476371c4
PE
11112011-07-28 Paul Eggert <eggert@cs.ucla.edu>
1112
66606eea
PE
1113 * alloc.c (memory_full) [!SYNC_INPUT]: Fix signal-related race.
1114 Without this fix, if a signal arrives just after memory fills up,
1115 'malloc' might be invoked reentrantly.
1116
476371c4
PE
1117 * image.c (x_check_image_size) [!HAVE_X_WINDOWS]: Return 1.
1118 In other words, assume that every image size is allowed, on non-X
1119 hosts. This assumption is probably wrong, but it lets Emacs compile.
1120
f3fcc40d
AS
11212011-07-28 Andreas Schwab <schwab@linux-m68k.org>
1122
1123 * regex.c (re_iswctype): Convert return values to boolean.
1124
350c992f
EZ
11252011-07-28 Eli Zaretskii <eliz@fencepost.gnu.org>
1126
1127 * xdisp.c (compute_display_string_pos): Don't use cached display
1128 string position if the buffer had its restriction changed.
1129 (Bug#9184)
1130
5266b4bb
PE
11312011-07-28 Paul Eggert <eggert@cs.ucla.edu>
1132
1133 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork clobbering.
1134
2573a837 11352011-07-28 Paul Eggert <eggert@cs.ucla.edu>
ca4aa935 1136
41f55ccd 1137 Integer signedness and overflow and related fixes. (Bug#9079)
cf950e6b 1138
39e378da
PE
1139 * bidi.c: Integer size and overflow fixes.
1140 (bidi_cache_size, bidi_cache_idx, bidi_cache_last_idx)
1141 (bidi_cache_start, bidi_cache_fetch_state, bidi_cache_search)
1142 (bidi_cache_find_level_change, bidi_cache_ensure_space)
1143 (bidi_cache_iterator_state, bidi_cache_find, bidi_cache_start_stack)
1144 (bidi_find_other_level_edge):
1145 Use ptrdiff_t instead of EMACS_INT where either will do.
1146 This works better on 32-bit hosts configured --with-wide-int.
1147 (bidi_cache_ensure_space): Check for size-calculation overflow.
1148 Use % rather than repeated addition, for better worst-case speed.
1149 Don't set bidi_cache_size until after xrealloc returns, because it
1150 might not return.
1151 (bidi_dump_cached_states): Use ptrdiff_t, not int, to avoid overflow.
f0eb61e9
PE
1152 (bidi_cache_ensure_space): Also check that the bidi cache size
1153 does not exceed that of the largest Lisp string or buffer. See Eli
1154 Zaretskii in <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9079#29>.
39e378da 1155
5e927815
PE
1156 * alloc.c (__malloc_size_t): Remove.
1157 All uses replaced by size_t. See Andreas Schwab's note
1158 <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9079#8>.
1159
ca4aa935
PE
1160 * image.c: Improve checking for integer overflow.
1161 (check_image_size): Assume that f is nonnull, since
1162 it is always nonnull in practice. This is one less thing to
1163 worry about when checking for integer overflow later.
1164 (x_check_image_size): New function, which checks for integer
1165 overflow issues inside X.
1166 (x_create_x_image_and_pixmap, xbm_read_bitmap_data): Use it.
1167 This removes the need for a memory_full check.
1168 (xbm_image_p): Rewrite to avoid integer multiplication overflow.
1169 (Create_Pixmap_From_Bitmap_Data, xbm_load): Use x_check_image_size.
1170 (xbm_read_bitmap_data): Change locals back to 'int', since
1171 their values must fit in 'int'.
1172 (xpm_load_image, png_load, tiff_load):
1173 Invoke x_create_x_image_and_pixmap earlier,
1174 to avoid much needless work if the image is too large.
1175 (tiff_load): Treat overly large images as if
1176 x_create_x_image_and_pixmap failed, not as malloc failures.
1177 (gs_load): Use x_check_image_size.
1178
5f8f9cc2
PE
1179 * gtkutil.c: Omit integer casts.
1180 (xg_get_pixbuf_from_pixmap): Remove unnecessary cast.
1181 (xg_set_toolkit_scroll_bar_thumb): Rewrite to avoid need for cast.
1182
5adf60bc
PE
1183 * image.c (png_load): Don't assume height * row_bytes fits in 'int'.
1184
c8907a93
PE
1185 * xfaces.c (Fbitmap_spec_p): Fix integer overflow bug.
1186 Without this fix, (bitmap-spec-p '(34359738368 1 "x"))
1187 would wrongly return t on a 64-bit host.
1188
e3c25c68
PE
1189 * dispnew.c (init_display): Use *_RANGE_OVERFLOW macros.
1190 The plain *_OVERFLOW macros run afoul of GCC bug 49705
1191 <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49705>
1192 and therefore cause GCC to emit a bogus diagnostic in some cases.
1193
3f791afe
PE
1194 * image.c: Integer signedness and overflow and related fixes.
1195 This is not an exhaustive set of fixes, but it's time to
1196 record what I've got.
1197 (lookup_pixel_color, check_image_size): Remove redundant decls.
1198 (check_image_size): Don't assume that arbitrary EMACS_INT values
1199 fit in 'int', or that arbitrary 'double' values fit in 'int'.
1200 (x_alloc_image_color, x_create_x_image_and_pixmap, png_load)
1201 (tiff_load, imagemagick_load_image):
1202 Check for overflow in size calculations.
1203 (x_create_x_image_and_pixmap): Remove unnecessary test for
1204 xmalloc returning NULL; that can't happen.
1205 (xbm_read_bitmap_data): Don't assume sizes fit into 'int'.
1206 (xpm_color_bucket): Use better integer hashing function.
1207 (xpm_cache_color): Don't possibly over-allocate memory.
1208 (struct png_memory_storage, tiff_memory_source, tiff_seek_in_memory)
1209 (gif_memory_source):
1210 Use ptrdiff_t, not int or size_t, to record sizes.
1211 (png_load): Don't assume values greater than 2**31 fit in 'int'.
1212 (our_stdio_fill_input_buffer): Prefer ptrdiff_t to size_t when
1213 either works, as we prefer signed integers.
1214 (tiff_read_from_memory, tiff_write_from_memory):
1215 Return tsize_t, not size_t, since that's what the TIFF API wants.
1216 (tiff_read_from_memory): Don't fail simply because the read would
1217 go past EOF; instead, return a short read.
1218 (tiff_load): Omit no-longer-needed casts.
1219 (Fimagemagick_types): Don't assume size fits into 'int'.
1220
3cc5a532
PE
1221 Improve hashing quality when configured --with-wide-int.
1222 * fns.c (hash_string): New function, taken from sxhash_string.
1223 Do not discard information about ASCII character case; this
1224 discarding is no longer needed.
1225 (sxhash-string): Use it. Change sig to match it. Caller changed.
1226 * lisp.h: Declare it.
1227 * lread.c (hash_string): Remove, since we now use fns.c's version.
1228 The fns.c version returns a wider integer if --with-wide-int is
1229 specified, so this should help the quality of the hashing a bit.
1230
b312a492
PE
1231 * emacs.c: Integer overflow minor fix.
1232 (heap_bss_diff): Now uprintmax_t, not unsigned long. All used changed.
1233 Define only if GNU_LINUX.
1234 (main, Fdump_emacs): Set and use heap_bss_diff only if GNU_LINUX.
1235
dfd153ae
PE
1236 * dispnew.c: Integer signedness and overflow fixes.
1237 Remove unnecessary forward decls, that were a maintenance hassle.
1238 (history_tick): Now uprintmax_t, so it's more likely to avoid overflow.
1239 All uses changed.
1240 (adjust_glyph_matrix, realloc_glyph_pool, adjust_frame_message_buffer)
1241 (scrolling_window): Use ptrdiff_t, not int, for byte count.
1242 (prepare_desired_row, line_draw_cost):
1243 Use int, not unsigned, where either works.
1244 (save_current_matrix, restore_current_matrix):
1245 Use ptrdiff_t, not size_t, where either works.
1246 (init_display): Check for overflow more accurately, and without
1247 relying on undefined behavior.
1248
a81d11a3
PE
1249 * editfns.c (pWIDE, pWIDElen, signed_wide, unsigned_wide):
1250 Remove, replacing with the new symbols in lisp.h. All uses changed.
1251 * fileio.c (make_temp_name):
1252 * filelock.c (lock_file_1, lock_file):
1253 * xdisp.c (message_dolog):
1254 Don't assume PRIdMAX etc. works; this isn't portable to pre-C99 hosts.
1255 Use pMd etc. instead.
1256 * lisp.h (printmax_t, uprintmax_t, pMd, pMu): New types and macros,
1257 replacing the pWIDE etc. symbols removed from editfns.c.
1258
3300e6fd
PE
1259 * keyboard.h (num_input_events): Now uintmax_t.
1260 This is (very slightly) less likely to mess up due to wraparound.
1261 All uses changed.
1262
fd05c7e9
PE
1263 * buffer.c: Integer signedness fixes.
1264 (alloc_buffer_text, enlarge_buffer_text):
1265 Use ptrdiff_t rather than size_t when either will do, as we prefer
1266 signed integers.
1267
903fe15d
PE
1268 * alloc.c: Integer signedness and overflow fixes.
1269 Do not impose an arbitrary 32-bit limit on malloc sizes when debugging.
1270 (__malloc_size_t): Default to size_t, not to int.
1271 (pure_size, pure_bytes_used_before_overflow, stack_copy_size)
1272 (Fgarbage_collect, mark_object_loop_halt, mark_object):
1273 Prefer ptrdiff_t to size_t when either would do, as we prefer
1274 signed integers.
1275 (XMALLOC_OVERRUN_CHECK_OVERHEAD): New macro.
1276 (xmalloc_overrun_check_header, xmalloc_overrun_check_trailer):
1277 Now const. Initialize with values that are in range even if char
1278 is signed.
1279 (XMALLOC_PUT_SIZE, XMALLOC_GET_SIZE): Remove, replacing with ...
1280 (xmalloc_put_size, xmalloc_get_size): New functions. All uses changed.
1281 These functions do the right thing with sizes > 2**32.
1282 (check_depth): Now ptrdiff_t, not int.
1283 (overrun_check_malloc, overrun_check_realloc, overrun_check_free):
1284 Adjust to new way of storing sizes. Check for size overflow bugs
1285 in rest of code.
1286 (STRING_BYTES_MAX): Adjust to new overheads. The old code was
1287 slightly wrong anyway, as it missed one instance of
1288 XMALLOC_OVERRUN_CHECK_OVERHEAD.
1289 (refill_memory_reserve): Omit needless cast to size_t.
1290 (mark_object_loop_halt): Mark as externally visible.
1291
ac82cc6a
PE
1292 * xselect.c: Integer signedness and overflow fixes.
1293 (Fx_register_dnd_atom, x_handle_dnd_message):
1294 Use ptrdiff_t, not size_t, since we prefer signed.
1295 (Fx_register_dnd_atom): Check for ptrdiff_t (and size_t) overflow.
1296 * xterm.h (struct x_display_info): Use ptrdiff_t, not size_t, for
1297 x_dnd_atoms_size and x_dnd_atoms_length.
1298
c2d1e36d
PE
1299 * doprnt.c: Prefer signed to unsigned when either works.
1300 * eval.c (verror):
1301 * doprnt.c (doprnt):
1302 * lisp.h (doprnt):
1303 * xdisp.c (vmessage):
1304 Use ptrdiff_t, not size_t, when using or implementing doprnt,
1305 since the sizes cannot exceed ptrdiff_t bounds anyway, and we
1306 prefer signed arithmetic to avoid comparison confusion.
1307 * doprnt.c (doprnt): Avoid a "+ 1" that can't overflow,
1308 but is a bit tricky.
1309
0e926e56
PE
1310 Assume freestanding C89 headers, string.h, stdlib.h.
1311 * data.c, doprnt.c, floatfns.c, print.c:
1312 Include float.h unconditionally.
1313 * gmalloc.c: Assume C89-at-least behavior for preprocessor,
1314 limits.h, stddef.h, string.h. Use memset instead of 'flood'.
1315 * regex.c: Likewise for stddef.h, string.h.
1316 (ISASCII): Remove; can assume it returns 1 now. All uses removed.
1317 * s/aix4-2.h (HAVE_STRING_H): Remove obsolete undef.
1318 * s/ms-w32.h (HAVE_LIMITS_H, HAVE_STRING_H, HAVE_STDLIB_H)
1319 (STDC_HEADERS): Remove obsolete defines.
1320 * sysdep.c: Include limits.h unconditionally.
1321
9cfdb3ec
PE
1322 Assume support for memcmp, memcpy, memmove, memset.
1323 * lisp.h, sysdep.c (memcmp, memcpy, memmove, memset):
1324 * regex.c (memcmp, memcpy):
1325 Remove; we assume C89 now.
1326
1327 * gmalloc.c (memcpy, memset, memmove): Remove; we assume C89 now.
1328 (__malloc_safe_bcopy): Remove; no longer needed.
1329
cf950e6b 1330 * lisp.h (struct vectorlike_header, struct Lisp_Subr): Signed sizes.
6089c567
PE
1331 Use EMACS_INT, not EMACS_UINT, for sizes. The code works equally
1332 well either way, and we prefer signed to unsigned.
1333
dbf38e02
LMI
13342011-07-27 Lars Magne Ingebrigtsen <larsi@gnus.org>
1335
1336 * gnutls.c (emacs_gnutls_read): Don't message anything if the peer
1337 closes the connection while we're reading (bug#9182).
1338
d6f0886c 13392011-07-25 Jan Djärv <jan.h.d@swipnet.se>
24e0f6b1 1340
d6f0886c
JD
1341 * nsmenu.m (ns_popup_dialog): Add an "ok" button if no buttons
1342 are specified (Bug#9168).
24e0f6b1 1343
2eb1f9e6
PE
13442011-07-25 Paul Eggert <eggert@cs.ucla.edu>
1345
1346 * bidi.c (bidi_dump_cached_states): Fix printf format mismatch.
1347 Found by GCC static checking and --with-wide-int on a 32-bit host.
1348
22381272 13492011-07-25 Eli Zaretskii <eliz@gnu.org>
7daee910
EZ
1350
1351 * xdisp.c (compute_display_string_pos): Fix logic of caching
1352 previous display string position. Initialize cached_prev_pos to
1353 -1. Fixes slow-down at the beginning of a buffer.
1354
f25e39b4
EZ
13552011-07-24 Eli Zaretskii <eliz@gnu.org>
1356
1357 * xfaces.c (check_lface_attrs) [HAVE_WINDOW_SYSTEM]: Allow `nil'
1358 for attrs[LFACE_FONTSET_INDEX].
1359
04c4b52e
PE
13602011-07-23 Paul Eggert <eggert@cs.ucla.edu>
1361
1362 * xml.c (parse_region): Remove unused local
1363 that was recently introduced.
1364
c1734fbd
EZ
13652011-07-23 Eli Zaretskii <eliz@gnu.org>
1366
be18c5a5
EZ
1367 * xfns.c (unwind_create_frame) [GLYPH_DEBUG]: Adapt to changes in
1368 2008-02-22T17:42:09Z!monnier@iro.umontreal.ca.
1369
c1734fbd
EZ
1370 * xdisp.c (move_it_in_display_line_to): Record the best matching
1371 position for TO_CHARPOS while scanning the line, and restore it on
640c8776
SM
1372 exit if none of the characters scanned was an exact match.
1373 Fixes vertical-motion and pos-visible-in-window-p under bidi redisplay
a9269c18
EZ
1374 when exact match is impossible due to invisible text, and the
1375 lines are truncated.
1376
a258d627
JD
13772011-07-23 Jan Djärv <jan.h.d@swipnet.se>
1378
1379 * nsterm.m (initFrameFromEmacs): Set NSTitledWindowMask in styleMask
1380 for OSX >= 10.7.
1381
b6d5a689
EZ
13822011-07-22 Eli Zaretskii <eliz@gnu.org>
1383
0f74f785
EZ
1384 Fix a significant slow-down of cursor motion with C-n, C-p,
1385 C-f/C-b, and C-v/M-v that couldn't keep up with keyboard
1386 auto-repeat under bidi redisplay in fontified buffers.
b6d5a689 1387 * xdisp.c (compute_stop_pos_backwards): New function.
b6d5a689
EZ
1388 (next_element_from_buffer): Call compute_stop_pos_backwards to
1389 find a suitable prev_stop when we find ourselves before
0f74f785
EZ
1390 base_level_stop.
1391 (reseat): Don't look for prev_stop, as that could mean a very long
1392 run.
1393 <cached_disp_pos, cached_disp_buffer, cached_disp_modiff>
1394 <cached_disp_overlay_modiff>: Cache for last found display string
1395 position.
551918c1 1396 (compute_display_string_pos): Return the cached position if asked
0f74f785
EZ
1397 about the same buffer in the same area of character positions, and
1398 the buffer wasn't changed since the time the display string
1399 position was cached.
551918c1 1400
b2d0c91a
EZ
14012011-07-22 Eli Zaretskii <eliz@gnu.org>
1402
1403 * xdisp.c (rows_from_pos_range): Don't ignore glyphs whose object
1404 is an integer, which is important for empty lines. (Bug#9149)
1405
043604ee
CY
14062011-07-22 Chong Yidong <cyd@stupidchicken.com>
1407
1408 * frame.c (Fmodify_frame_parameters): In tty case, update the
1409 default face if necessary (Bug#4238).
1410
da4adb04
CY
14112011-07-21 Chong Yidong <cyd@stupidchicken.com>
1412
1413 * editfns.c (Fstring_to_char): No need to explain what a character
1414 is in the docstring (Bug#6576).
1415
9abd0532
LMI
14162011-07-20 Lars Magne Ingebrigtsen <larsi@gnus.org>
1417
1418 * xml.c (parse_region): Make sure we always return a tree.
1419
36881d16
HK
14202011-07-20 HAMANO Kiyoto <khiker.mail@gmail.com>
1421
1422 * xml.c (parse_region): If a document contains only comments,
1423 return that, too.
1424
1e98674d
LMI
14252011-07-20 Lars Magne Ingebrigtsen <larsi@gnus.org>
1426
1427 * xml.c (make_dom): Return comments, too.
1428
590bd467
PE
14292011-07-19 Paul Eggert <eggert@cs.ucla.edu>
1430
1431 Port to OpenBSD.
1432 See http://lists.gnu.org/archive/html/emacs-devel/2011-07/msg00688.html
1433 and the surrounding thread.
1434 * minibuf.c (read_minibuf_noninteractive): Rewrite to use getchar
1435 rather than fgets, and retry after EINTR. Otherwise, 'emacs
1436 --batch -f byte-compile-file' fails on OpenBSD if an inactivity
1437 timer goes off.
1438 * s/openbsd.h (BROKEN_SIGIO): Define.
1439 * unexelf.c (unexec) [__OpenBSD__]:
1440 Don't update the .mdebug section of the Alpha COFF symbol table.
1441
f41628b2
LMI
14422011-07-19 Lars Magne Ingebrigtsen <larsi@gnus.org>
1443
1444 * lread.c (syms_of_lread): Clarify when `lexical-binding' is used
1445 (bug#8460).
1446
b59b67c5
PE
14472011-07-18 Paul Eggert <eggert@cs.ucla.edu>
1448
15e3a074
PE
1449 * fileio.c (Fcopy_file) [!MSDOS]: Tighten created file's mask.
1450 This fixes some race conditions on the permissions of any newly
1451 created file.
1452
41bed37d
PE
1453 * alloc.c (valid_pointer_p): Use pipe, not open.
1454 This fixes some permissions issues when debugging.
1455
b59b67c5
PE
1456 * fileio.c (Fcopy_file): Adjust mode if fchown fails. (Bug#9002)
1457 If fchown fails to set both uid and gid, try to set just gid,
1458 as that is sometimes allowed. Adjust the file's mode to eliminate
1459 setuid or setgid bits that are inappropriate if fchown fails.
1460
925a6be7
SM
14612011-07-18 Stefan Monnier <monnier@iro.umontreal.ca>
1462
1463 * xdisp.c (next_element_from_string, next_element_from_buffer): Use EQ
1464 to compare Lisp_Objects.
1465 * gnutls.c (syms_of_gnutls): Rename Vgnutls_log_level to
1466 global_gnutls_log_level, don't mistake it for a Lisp_Object.
1467 (init_gnutls_functions, emacs_gnutls_handle_error): Fix up uses.
1468
52968808
AS
14692011-07-17 Andreas Schwab <schwab@linux-m68k.org>
1470
0a6a104b
AS
1471 * lread.c (read_integer): Unread even EOF character.
1472 (read1): Likewise. Properly record start position of symbol.
1473
52968808
AS
1474 * lread.c (read1): Read `#:' as empty uninterned symbol if no
1475 symbol character follows.
1476
9e381cdd
PE
14772011-07-17 Paul Eggert <eggert@cs.ucla.edu>
1478
1479 * fileio.c (Fcopy_file): Pacify gcc re fchown. (Bug#9002)
1480 This works around a problem with the previous change to Fcopy_file.
1481 Recent glibc declares fchown with __attribute__((warn_unused_result)),
1482 and without this change, GCC might complain about discarding
1483 fchown's return value.
1484
b5641435
JB
14852011-07-16 Juanma Barranquero <lekktu@gmail.com>
1486
1487 * makefile.w32-in (GLOBAL_SOURCES): Add gnutls.c (followup to bug#9059).
1488
a8031457
PE
14892011-07-16 Paul Eggert <eggert@cs.ucla.edu>
1490
1491 * fileio.c (Fcopy_file): Don't diagnose fchown failures. (Bug#9002)
1492
dd889327
LMI
14932011-07-16 Lars Magne Ingebrigtsen <larsi@gnus.org>
1494
750c33f7
LMI
1495 * gnutls.c (syms_of_gnutls): Define `gnutls-log-level' here, since
1496 it's used from the C level.
1497
dd889327
LMI
1498 * process.c: Use the same condition for POLL_FOR_INPUT in both
1499 keyboard.c and process.c (bug#1858).
1500
87e86684
LM
15012011-07-09 Lawrence Mitchell <wence@gmx.li>
1502
1503 * gnutls.c (Qgnutls_bootprop_min_prime_bits): New variable.
1504 (Fgnutls_boot): Use it.
1505
64348f40
AS
15062011-07-15 Andreas Schwab <schwab@linux-m68k.org>
1507
1508 * doc.c (Fsubstitute_command_keys): Revert last change.
1509
1d698799
LMI
15102011-07-15 Lars Magne Ingebrigtsen <larsi@gnus.org>
1511
f863868c
LMI
1512 * doc.c (Fsubstitute_command_keys): Clarify that \= really only
1513 quotes the next character, and doesn't affect other longer
1514 sequences (bug#8935).
1515
1d698799
LMI
1516 * lread.c (syms_of_lread): Clarify that is isn't only
1517 `eval-buffer' and `eval-defun' that's affected by
1518 `lexical-binding' (bug#8460).
1519
aa4b6df6
EZ
15202011-07-15 Eli Zaretskii <eliz@gnu.org>
1521
1522 * xdisp.c (move_it_in_display_line_to): Fix vertical motion with
1523 bidi redisplay when a line includes both an image and is
1524 truncated.
1525
5d856da6
PE
15262011-07-14 Paul Eggert <eggert@cs.ucla.edu>
1527
ad6042bb
PE
1528 Fix minor problems found by static checking.
1529 * bidi.c (bidi_cache_size): Now EMACS_INT, not size_t.
1530 (elsz): Now a signed constant, not a size_t var. We prefer signed
1531 types to unsigned, to avoid integer comparison confusion. Without
1532 this change, GCC 4.6.1 with -Wunsafe-loop-optimizations complains
1533 "cannot optimize loop, the loop counter may overflow", a symptom
1534 of the confusion.
f00bbb22 1535 * indent.c (Fvertical_motion): Mark locals as initialized.
5d856da6
PE
1536 * xdisp.c (reseat_to_string): Fix pointer signedness issue.
1537
6468f31c
LMI
15382011-07-14 Lars Magne Ingebrigtsen <larsi@gnus.org>
1539
49080b10
LMI
1540 * search.c (Fre_search_backward): Mention `case-fold-search' in
1541 all the re_search_* functions (bug#8138).
1542
6468f31c
LMI
1543 * keyboard.c (Fopen_dribble_file): Document when the file is
1544 closed (bug#8056).
1545
c965adc5
EZ
15462011-07-14 Eli Zaretskii <eliz@gnu.org>
1547
df9733bf
EZ
1548 * bidi.c (bidi_dump_cached_states): Fix format of displaying
1549 bidi_cache_idx.
1550
0bb23927
EZ
1551 Support bidi reordering of display and overlay strings.
1552 * xdisp.c (compute_display_string_pos)
1553 (compute_display_string_end): Accept additional argument STRING.
1554 (init_iterator, reseat_1): Initialize bidi_it->string.s to NULL.
1555 (reseat_to_string): Initialize bidi_it->string.s and
1556 bidi_it->string.schars.
1557 (Fcurrent_bidi_paragraph_direction): Initialize itb.string.s to
640c8776
SM
1558 NULL (avoids a crash in bidi_paragraph_init).
1559 Initialize itb.string.lstring.
0bb23927
EZ
1560 (init_iterator): Call bidi_init_it only of a valid
1561 buffer position was specified. Initialize paragraph_embedding to
1562 L2R.
1563 (reseat_to_string): Initialize the bidi iterator.
1564 (display_string): If we need to ignore text properties of
1565 LISP_STRING, set IT->stop_charpos to IT->end_charpos. (The
1566 original value of -1 will not work with bidi.)
1567 (compute_display_string_pos): First arg is now struct
1568 `text_pos *'; all callers changed. Support display properties on
1569 Lisp strings.
1570 (compute_display_string_end): Support display properties on Lisp
1571 strings.
1572 (init_iterator, reseat_1, reseat_to_string): Initialize the
1573 string.bufpos member to 0 (zero, for compatibility with IT_CHARPOS
1574 when iterating on a string not from display properties).
640c8776
SM
1575 (compute_display_string_pos, compute_display_string_end):
1576 Fix calculation of the object to scan. Fixes an error when using
0bb23927
EZ
1577 arrow keys.
1578 (next_element_from_buffer): Don't abort when IT_CHARPOS is before
640c8776
SM
1579 base_level_stop; instead, set base_level_stop to BEGV.
1580 Fixes crashes in vertical-motion.
0bb23927
EZ
1581 (next_element_from_buffer): Improve commentary for when
1582 the iterator is before prev_stop.
1583 (init_iterator): Initialize bidi_p from the default value of
1584 bidi-display-reordering, not from buffer-local value. Use the
1585 buffer-local value only if initializing for buffer iteration.
1586 (handle_invisible_prop): Support invisible properties on strings
1587 that are being bidi-reordered.
1588 (set_iterator_to_next): Support bidi reordering of C strings and
1589 Lisp strings.
1590 (next_element_from_string): Support bidi reordering of Lisp
1591 strings.
1592 (handle_stop_backwards): Support Lisp strings as well.
640c8776
SM
1593 (display_string): Support display of R2L glyph rows.
1594 Use IT_STRING_CHARPOS when displaying from a Lisp string.
0bb23927
EZ
1595 (init_iterator): Don't initialize it->bidi_p for strings
1596 here.
1597 (reseat_to_string): Initialize it->bidi_p for strings here.
1598 (next_element_from_string, next_element_from_c_string)
1599 (next_element_from_buffer): Add xassert's for correspondence
1600 between IT's object being iterated and it->bidi_it.string
1601 structure.
1602 (face_before_or_after_it_pos): Support bidi iteration.
1603 (next_element_from_c_string): Handle the case of the first string
1604 character that is not the first one in the visual order.
1605 (get_visually_first_element): New function, refactored from common
1606 parts of next_element_from_buffer, next_element_from_string, and
1607 next_element_from_c_string.
1608 (tool_bar_lines_needed, redisplay_tool_bar)
1609 (display_menu_bar): Force left-to-right direction. Add a FIXME
1610 comment for making that be controlled by a user option.
1611 (push_it, pop_it): Save and restore the state of the
1612 bidi iterator. Save and restore the bidi_p flag.
1613 (pop_it): Iterate out of display property for string iteration as
1614 well.
1615 (iterate_out_of_display_property): Support iteration over strings.
1616 (handle_single_display_spec): Set up it->bidi_it for iteration
1617 over a display string, and call bidi_init_it.
1618 (handle_single_display_spec, next_overlay_string)
1619 (get_overlay_strings_1, push_display_prop): Set up the bidi
1620 iterator for displaying display or overlay strings.
1621 (forward_to_next_line_start): Don't use the shortcut if
1622 bidi-iterating.
1623 (back_to_previous_visible_line_start): If handle_display_prop
1624 pushed the iterator stack, restore the internal state of the bidi
1625 iterator by calling bidi_pop_it same number of times.
1626 (reseat_at_next_visible_line_start): If ON_NEWLINE_P is non-zero,
1627 and we are bidi-iterating, don't decrement the iterator position;
1628 instead, set the first_elt flag in the bidi iterator, to produce
1629 the same effect.
1630 (reseat_1): Remove redundant setting of string_from_display_prop_p.
1631 (push_display_prop): xassert that we are iterating a buffer.
1632 (push_it, pop_it): Save and restore paragraph_embedding member.
1633 (handle_single_display_spec, next_overlay_string)
1634 (get_overlay_strings_1, reseat_1, reseat_to_string)
1635 (push_display_prop): Set up the `unibyte' member of bidi_it.string
1636 correctly. Don't assume unibyte strings are not bidi-reordered.
1637 (compute_display_string_pos)
1638 (compute_display_string_end): Fix handling the case of C string.
1639 (push_it, pop_it): Save and restore from_disp_prop_p.
1640 (handle_single_display_spec, push_display_prop): Set the
1641 from_disp_prop_p flag.
1642 (get_overlay_strings_1): Reset the from_disp_prop_p flag.
1643 (pop_it): Call iterate_out_of_display_property only if we are
1644 popping after iteration over a string that came from a display
1645 property. Fix a typo in popping stretch info. Add an assertion
1646 for verifying that the iterator position is in sync with the bidi
1647 iterator.
1648 (handle_single_display_spec, get_overlay_strings_1)
1649 (push_display_prop): Fix initialization of paragraph direction for
1650 string when that of the parent object is not yet determined.
1651 (reseat_1): Call bidi_init_it to resync the bidi
1652 iterator with IT's position. (Bug#7616)
1653 (find_row_edges): If ROW->start.pos gives position
1654 smaller than min_pos, use it as ROW->minpos. (Bug#7616)
1655 (handle_stop, back_to_previous_visible_line_start, reseat_1):
1656 Reset the from_disp_prop_p flag.
1657 (SAVE_IT, RESTORE_IT): New macros.
1658 (pos_visible_p, face_before_or_after_it_pos)
1659 (back_to_previous_visible_line_start)
1660 (move_it_in_display_line_to, move_it_in_display_line)
1661 (move_it_to, move_it_vertically_backward, move_it_by_lines)
1662 (try_scrolling, redisplay_window, display_line): Use them when
1663 saving a temporary copy of the iterator and restoring it back.
1664 (back_to_previous_visible_line_start, reseat_1)
1665 (init_iterator): Empty the bidi cache "stack".
1666 (move_it_in_display_line_to): If iterator ended up at
1667 EOL, but we never saw any buffer positions smaller than
1668 to_charpos, return MOVE_POS_MATCH_OR_ZV. Fixes vertical cursor
1669 motion in bidi-reordered lines.
1670 (move_it_in_display_line_to): Record prev_method and prev_pos
1671 immediately before the call to set_iterator_to_next. Fixes cursor
1672 motion in bidi-reordered lines with stretch glyphs and strings
1673 displayed in margins. (Bug#8133) (Bug#8867)
1674 Return MOVE_POS_MATCH_OR_ZV only if iterator position is past
1675 TO_CHARPOS.
640c8776
SM
1676 (pos_visible_p): Support positions in bidi-reordered lines.
1677 Save and restore bidi cache.
0bb23927
EZ
1678
1679 * bidi.c (bidi_level_of_next_char): clen should be EMACS_NT, not int.
1680 (bidi_paragraph_info): Delete unused struct.
1681 (bidi_cache_idx, bidi_cache_last_idx): Declare EMACS_INT.
1682 (bidi_cache_start): New variable.
1683 (bidi_cache_reset): Reset bidi_cache_idx to bidi_cache_start, not
1684 to zero.
1685 (bidi_cache_fetch_state, bidi_cache_search)
1686 (bidi_cache_find_level_change, bidi_cache_iterator_state)
1687 (bidi_cache_find, bidi_peek_at_next_level)
1688 (bidi_level_of_next_char, bidi_find_other_level_edge)
1689 (bidi_move_to_visually_next): Compare cache index with
1690 bidi_cache_start rather than with zero.
1691 (bidi_fetch_char): Accept new argument STRING; all callers
1692 changed. Support iteration over a string. Support strings with
1693 display properties. Support unibyte strings. Fix the type of
1694 `len' according to what STRING_CHAR_AND_LENGTH expects.
1695 (bidi_paragraph_init, bidi_resolve_explicit_1)
1696 (bidi_resolve_explicit, bidi_resolve_weak)
640c8776
SM
1697 (bidi_level_of_next_char, bidi_move_to_visually_next):
1698 Support iteration over a string.
0bb23927
EZ
1699 (bidi_set_sor_type, bidi_resolve_explicit_1)
1700 (bidi_resolve_explicit, bidi_type_of_next_char): ignore_bn_limit
1701 can now be zero (for strings); special values 0 and -1 were
1702 changed to -1 and -2, respectively.
1703 (bidi_char_at_pos): New function.
1704 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak):
1705 Call it instead of FETCH_MULTIBYTE_CHAR.
1706 (bidi_move_to_visually_next): Abort if charpos or bytepos were not
1707 initialized to valid values.
1708 (bidi_init_it): Don't initialize charpos and bytepos with invalid
1709 values.
1710 (bidi_level_of_next_char): Allow the sentinel "position" to pass
1711 the test for valid cached positions. Fix the logic for looking up
1712 the sentinel state in the cache. GCPRO the Lisp string we are
1713 iterating.
1714 (bidi_push_it, bidi_pop_it): New functions.
1715 (bidi_initialize): Initialize the bidi cache start stack pointer.
1716 (bidi_cache_ensure_space): New function, refactored from part of
1717 bidi_cache_iterator_state. Don't assume the required size is just
1718 one BIDI_CACHE_CHUNK away.
1719 (bidi_cache_start_stack, bidi_push_it): Use IT_STACK_SIZE.
1720 (bidi_count_bytes, bidi_char_at_pos): New functions.
1721 (bidi_cache_search): Don't assume bidi_cache_last_idx is
1722 always valid if bidi_cache_idx is valid.
1723 (bidi_cache_find_level_change): xassert that bidi_cache_last_idx
1724 is valid if it's going to be used.
1725 (bidi_shelve_cache, bidi_unshelve_cache): New functions.
1726 (bidi_cache_fetch_state, bidi_cache_search)
c965adc5
EZ
1727 (bidi_cache_find_level_change, bidi_cache_ensure_space)
1728 (bidi_cache_iterator_state, bidi_cache_find)
640c8776
SM
1729 (bidi_find_other_level_edge, bidi_cache_start_stack):
1730 All variables related to cache indices are now EMACS_INT.
c965adc5 1731
0bb23927
EZ
1732 * dispextern.h (struct bidi_string_data): New structure.
1733 (struct bidi_it): New member `string'. Make flag members be 1-bit
1734 fields, and put them last in the struct.
640c8776
SM
1735 (compute_display_string_pos, compute_display_string_end):
1736 Update prototypes.
0bb23927
EZ
1737 (bidi_push_it, bidi_pop_it): Add prototypes.
1738 (struct iterator_stack_entry): New members bidi_p,
1739 paragraph_embedding, and from_disp_prop_p.
1740 (struct it): Member bidi_p is now a bit field 1 bit wide.
640c8776
SM
1741 (bidi_shelve_cache, bidi_unshelve_cache):
1742 Declare prototypes.
0bb23927
EZ
1743
1744 * .gdbinit (xvectype, xvector, xcompiled, xchartable, xboolvector)
1745 (xpr, xfont, xbacktrace): Use "header.size" when accessing vectors
1746 and vector-like objects.
1747
1748 * dispnew.c (buffer_posn_from_coords): Save and restore the bidi
1749 cache around display iteration.
1750
1751 * window.c (Fwindow_end, window_scroll_pixel_based)
1752 (displayed_window_lines, Frecenter): Save and restore the bidi
1753 cache around display iteration.
1754
3bbd2265
LMI
17552011-07-14 Lars Magne Ingebrigtsen <larsi@gnus.org>
1756
1757 * editfns.c (Fdelete_region): Clarify the use of the named
1758 parameters (bug#6788).
1759
adc47434
MR
17602011-07-14 Martin Rudalics <rudalics@gmx.at>
1761
1762 * indent.c (Fvertical_motion): Set and restore w->pointm when
1763 saving and restoring the window's buffer (Bug#9006).
1764
837c31f8
LMI
17652011-07-13 Lars Magne Ingebrigtsen <larsi@gnus.org>
1766
1767 * editfns.c (Fstring_to_char): Clarify just what is returned
1768 (bug#6576). Text by Eli Zaretskii.
1769
ac389d0c
JB
17702011-07-13 Juanma Barranquero <lekktu@gmail.com>
1771
1772 * gnutls.c (init_gnutls_functions): Honor gnutls_log_level (bug#9059).
1773
0be0ce47
EZ
17742011-07-13 Eli Zaretskii <eliz@gnu.org>
1775
1776 * buffer.c (mmap_find): Fix a typo.
1777
cd18e7e3
JB
17782011-07-13 Johan Bockgård <bojohan@gnu.org>
1779
1780 Fix execution of x selection hooks.
1781 * xselect.c (Qx_lost_selection_functions)
1782 (Qx_sent_selection_functions): New vars.
1783 (syms_of_xselect): DEFSYM them.
1784 (x_handle_selection_request): Pass Qx_sent_selection_functions
1785 rather than Vx_sent_selection_functions to Frun_hook_with_args.
1786 (x_handle_selection_clear,x_clear_frame_selections):
1787 Pass Qx_lost_selection_functions rather than
1788 Vx_lost_selection_functions to Frun_hook_with_args.
1789
47ea7f44
PE
17902011-07-13 Paul Eggert <eggert@cs.ucla.edu>
1791
ac389d0c 1792 * buffer.c (Fget_buffer_create): Initialize inhibit_shrinking.
2941c447
PE
1793 The old code sometimes used this field without initializing it.
1794
47ea7f44
PE
1795 * alloc.c (gc_sweep): Don't read past end of array.
1796 In theory, the old code could also have corrupted Emacs internals,
1797 though it'd be very unlikely.
1798
bc985c87
AS
17992011-07-12 Andreas Schwab <schwab@linux-m68k.org>
1800
1801 * character.c (Fcharacterp): Don't advertise optional ignored
ac389d0c 1802 argument. (Bug#4026)
bc985c87 1803
0cf34688
LMI
18042011-07-12 Lars Magne Ingebrigtsen <larsi@gnus.org>
1805
b3dadd76
LMI
1806 * keymap.c (syms_of_keymap): Clarify that "modifier" is "modifier
1807 key" (bug#4257).
1808
0cf34688
LMI
1809 * window.c (Fset_window_start): Doc fix (bug#4199).
1810 (Fset_window_hscroll): Ditto.
1811
270768cd
PE
18122011-07-12 Paul Eggert <eggert@cs.ucla.edu>
1813
077e3dda 1814 Fix minor new problems caught by GCC 4.6.1.
270768cd 1815 * term.c (init_tty): Remove unused local.
490011a6 1816 * xsettings.c (store_monospaced_changed): Define this function only
077e3dda 1817 if (defined HAVE_GSETTINGS || defined HAVE_GCONF), as it's
490011a6 1818 not used otherwise.
270768cd 1819
b1f58454
CY
18202011-07-12 Chong Yidong <cyd@stupidchicken.com>
1821
1822 * xdisp.c (Vresize_mini_windows): Minor doc fix (Bug#3300).
1823
22b9578d
LMI
18242011-07-11 Lars Magne Ingebrigtsen <larsi@gnus.org>
1825
6e70ab07
LMI
1826 * xdisp.c (syms_of_xdisp): Make it explicit that the mini-windows
1827 are the mini-buffer and the echo area (bug#3320).
1828
22b9578d
LMI
1829 * term.c (init_tty): Remove support for supdup, c10 and perq
1830 terminals, which are no longer supported (bug#1482).
1831
8974cc9f
JB
18322011-07-10 Johan Bockgård <bojohan@gnu.org>
1833
1834 * xdisp.c (Ftool_bar_lines_needed): Fix WINDOWP check.
1835
a560d974
JD
18362011-07-10 Jan Djärv <jan.h.d@swipnet.se>
1837
1838 * xmenu.c (menu_highlight_callback): Only pass frame to show_help_event
1839 for non-popups (Bug#3642).
1840
1dae0f0a
AS
18412011-07-10 Andreas Schwab <schwab@linux-m68k.org>
1842
268c2c36 1843 * alloc.c (reset_malloc_hooks): Protoize.
1dae0f0a 1844 * buffer.c (mmap_init, mmap_find, mmap_free_1, mmap_enlarge)
268c2c36
AS
1845 (mmap_set_vars, mmap_alloc, mmap_free, mmap_realloc): Likewise.
1846 * cm.c (losecursor): Likewise.
1dae0f0a
AS
1847 * data.c (fmod): Likewise.
1848 * dispnew.c (swap_glyphs_in_rows): Likewise.
1849 * emacs.c (memory_warning_signal): Likewise.
1850 * floatfns.c (float_error): Likewise.
1851 * font.c (check_gstring, check_otf_features, otf_tag_symbol)
1852 (otf_open, font_otf_capability, generate_otf_features)
1853 (font_otf_DeviceTable, font_otf_ValueRecord, font_otf_Anchor):
1854 Likewise.
1855 * image.c (pbm_read_file): Likewise.
1856 * indent.c (string_display_width): Likewise.
1857 * intervals.c (check_for_interval, search_for_interval)
1858 (inc_interval_count, count_intervals, root_interval)
1859 (adjust_intervals_for_insertion, make_new_interval): Likewise.
1860 * lread.c (defalias): Likewise.
268c2c36 1861 * ralloc.c (r_alloc_check): Likewise.
1dae0f0a
AS
1862 * regex.c (set_image_of_range_1, set_image_of_range)
1863 (regex_grow_registers): Likewise.
1864 * sysdep.c (strerror): Likewise.
1865 * termcap.c (valid_filename_p, tprint, main): Likewise.
1866 * tparam.c (main): Likewise.
1867 * unexhp9k800.c (run_time_remap, save_data_space)
1868 (update_file_ptrs, read_header, write_header, calculate_checksum)
1869 (copy_file, copy_rest, display_header): Likewise.
1870 * widget.c (mark_shell_size_user_specified, create_frame_gcs):
1871 Likewise.
1872 * xdisp.c (check_it): Likewise.
1873 * xfaces.c (register_color, unregister_color, unregister_colors):
1874 Likewise.
1875 * xfns.c (print_fontset_result): Likewise.
1876 * xrdb.c (member, fatal, main): Likewise.
1877
99033785
PE
18782011-07-10 Paul Eggert <eggert@cs.ucla.edu>
1879
1880 Fix minor problems found by static checking (Bug#9031).
1881 * chartab.c (char_table_set_range, map_sub_char_table):
1882 Remove unused locals.
1883 (uniprop_table): Now static.
1884 * composite.c (_work_char): Remove unused static var.
1885
9cb2ac56
JB
18862011-07-09 Juanma Barranquero <lekktu@gmail.com>
1887
1888 * chartab.c (uniprop_table_uncompress): Remove unused local variable.
1889
f25661f0
JD
18902011-07-09 Jan Djärv <jan.h.d@swipnet.se>
1891
1892 * gtkutil.c (qttip_cb): Remove code without function.
1893
8278c4fe
EZ
18942011-07-09 Eli Zaretskii <eliz@gnu.org>
1895
1896 * w32.c (pthread_sigmask): New stub.
1897
1692ae2d 18982011-07-08 Paul Eggert <eggert@cs.ucla.edu>
123403e4 1899
8a6ebd58 1900 Use pthread_sigmask, not sigprocmask (Bug#9010).
123403e4
PE
1901 sigprocmask is portable only for single-threaded applications, and
1902 Emacs can be multi-threaded when it uses GTK.
1301ac26
PE
1903 * Makefile.in (LIB_PTHREAD_SIGMASK): New macro.
1904 (LIBES): Use it.
1905 * callproc.c (Fcall_process):
1906 * process.c (create_process):
1907 * sysdep.c (sys_sigblock, sys_sigunblock, sys_sigsetmask):
1908 Use pthread_sigmask, not sigprocmask.
123403e4 1909
1b854618
JD
19102011-07-08 Jan Djärv <jan.h.d@swipnet.se>
1911
1912 * gtkutil.c (qttip_cb): Set line wrap to FALSE for tooltip widget.
1913 (xg_prepare_tooltip): Revert text in x->ttip_lbl, margins was
1914 wrong (Bug#8591).
1915
3fe4b549
JD
19162011-07-08 Jan Djärv <jan.h.d@swipnet.se>
1917
0ce7e563
JD
1918 * gtkutil.c (xg_prepare_tooltip): Fix indentation and comment.
1919 Put text in x->ttip_lbl instead of gtk_tooltip_set_text (Bug#8591).
1920 (xg_hide_tooltip): Fix comment.
1921
3fe4b549
JD
1922 * nsterm.m (initFrameFromEmacs): Don't use ns_return_types
1923 in registerServicesMenuSendTypes.
1924 (validRequestorForSendType): Don't check ns_return_types.
1925
1926 * nsfns.m (Fx_open_connection): Put NSStringPboardType into
1927 ns_return_type.
1928
5df75e47
JR
19292011-07-08 Jason Rumney <jasonr@gnu.org>
1930
1931 * w32fns.c (w32_wnd_proc) [WM_TIMER, WM_SET_CURSOR]: Avoid using
1932 frame struct members of non-existent frames (Bug#6284).
1933
699c10bd
JD
19342011-07-08 Jan Djärv <jan.h.d@swipnet.se>
1935
4393663b
JD
1936 * nsterm.m (keyDown): Call to wantsToDelayTextChangeNotifications and
1937 variable firstTime not needed on OSX >= 10.6.
1938 (setPosition): setFloatValue:knobProportion: is deprecated on OSX
1939 >= 10.5. Use setKnobProportion, setDoubleValue.
1940
1941 * nsterm.h (MAC_OS_X_VERSION_10_3, MAC_OS_X_VERSION_10_4)
1942 (MAC_OS_X_VERSION_10_5): Define if not defined.
1943 (EmacsView, EmacsTooltip): Implements NSWindowDelegate on OSX >= 10.6.
1944 (EmacsMenu): Implements NSMenuDelegate on OSX >= 10.6.
1945 (EmacsToolbar): Implements NSToolbarDelegate on OSX >= 10.6.
1946
1947 * nsselect.m (ns_string_from_pasteboard): Don't use deprecated methods
1948 cString and lossyCString on OSX >= 10.4
1949
1950 * nsmenu.m (fillWithWidgetValue): Don't use depercated method
1951 sizeToFit on OSX >= 10.2.
1952
1953 * nsimage.m (allocInitFromFile): Don't use deprecated method
1954 bestRepresentationForDevice on OSX >= 10.6.
1955
1956 * nsfns.m (check_ns_display_info): Cast to long and use %ld in error
1957 to avoid warning.
1958
1959 * emacs.c: Declare unexec_init_emacs_zone.
1960
a63e0781
JD
1961 * nsgui.h: Fix compiler warning about gnulib redefining verify.
1962
699c10bd
JD
1963 * nsselect.m (ns_get_local_selection): Change to extern (Bug#8842).
1964
1965 * nsmenu.m (ns_update_menubar): Remove useless setDelegate call
1966 on svcsMenu (Bug#8842).
1967
1968 * nsfns.m (Fx_open_connection): Remove NSStringPboardType from
1969 ns_return_types.
1970 (Fns_list_services): Just return Qnil on 10.6, code not working there.
1971
1972 * nsterm.m (QUTF8_STRING): Declare.
1973 (initFrameFromEmacs): Call registerServicesMenuSendTypes.
1974 (validRequestorForSendType): Return type is (id).
1975 Change indexOfObjectIdenticalTo to indexOfObject.
1976 Check if we have local selection before returning self (Bug#8842).
1977 (writeSelectionToPasteboard): Put local selection into paste board
1978 if we have a local selection (Bug#8842).
1979 (syms_of_nsterm): DEFSYM QUTF8_STRING.
1980
1981 * nsterm.h (MAC_OS_X_VERSION_10_6): Define here instead of nsterm.m.
1982 (ns_get_local_selection): Declare.
1983
54e10184
LMI
19842011-07-07 Lars Magne Ingebrigtsen <larsi@gnus.org>
1985
9888ff71
LMI
1986 * keymap.c (describe_map_tree): Don't insert a double newline at
1987 the end of the buffer (bug#1169) and return whether we inserted
1988 something.
1989
54e10184
LMI
1990 * callint.c (Fcall_interactively): Change "reading args" to
1991 "providing args" to try to clarify what it does (bug#1010).
1992
15fa4783
KH
19932011-07-07 Kenichi Handa <handa@m17n.org>
1994
1995 * composite.c (composition_compute_stop_pos): Ignore a static
1996 composition starting before CHARPOS (Bug#8915).
1997
1998 * xdisp.c (handle_composition_prop): Likewise.
1999
a8815b00
EZ
20002011-07-07 Eli Zaretskii <eliz@gnu.org>
2001
2002 * term.c (produce_glyphs) <xassert>: Allow IT_GLYPHLESS in it->what.
2003 (Bug#9015)
2004
ef7b981d 20052011-07-07 Kenichi Handa <handa@m17n.org>
c805dec0
KH
2006
2007 * character.h (unicode_category_t): New enum type.
2008
2009 * chartab.c (uniprop_decoder_t, uniprop_encoder_t): New types.
2010 (Qchar_code_property_table): New variable.
2011 (UNIPROP_TABLE_P, UNIPROP_GET_DECODER)
2012 (UNIPROP_COMPRESSED_FORM_P): New macros.
2013 (char_table_ascii): Uncompress the compressed values.
2014 (sub_char_table_ref): New arg is_uniprop. Callers changed.
2015 Uncompress the compressed values.
ac389d0c 2016 (sub_char_table_ref_and_range): Likewise.
c805dec0
KH
2017 (char_table_ref_and_range): Uncompress the compressed values.
2018 (sub_char_table_set): New arg is_uniprop. Callers changed.
2019 Uncompress the compressed values.
2020 (sub_char_table_set_range): Args changed. Callers changed.
2021 (char_table_set_range): Adjuted for the above change.
2022 (map_sub_char_table): Delete args default_val and parent. Add arg
2023 top. Give decoded values to a Lisp function.
640c8776 2024 (map_char_table): Adjust for the above change. Give decoded
c805dec0
KH
2025 values to a Lisp function. Gcpro more variables.
2026 (uniprop_table_uncompress)
2027 (uniprop_decode_value_run_length): New functions.
2028 (uniprop_decoder, uniprop_decoder_count): New variables.
2029 (uniprop_get_decoder, uniprop_encode_value_character)
2030 (uniprop_encode_value_run_length, uniprop_encode_value_numeric):
2031 New functions.
2032 (uniprop_encoder, uniprop_encoder_count): New variables.
2033 (uniprop_get_encoder, uniprop_table)
2034 (Funicode_property_table_internal, Fget_unicode_property_internal)
2035 (Fput_unicode_property_internal): New functions.
2036 (syms_of_chartab): DEFSYM Qchar_code_property_table, defsubr
2037 Sunicode_property_table_internal, Sget_unicode_property_internal,
2038 and Sput_unicode_property_internal. Defvar_lisp
2039 char-code-property-alist.
2040
640c8776 2041 * composite.c (CHAR_COMPOSABLE_P): Adjust for the change of
c805dec0
KH
2042 Vunicode_category_table.
2043
640c8776 2044 * font.c (font_range): Adjust for the change of
c805dec0
KH
2045 Vunicode_category_table.
2046
76b397fb
DN
20472011-07-07 Dan Nicolaescu <dann@ics.uci.edu>
2048
2049 * m/iris4d.h: Remove file, move contents ...
2050 * s/irix6-5.h: ... here.
2051
22b4128e
PE
20522011-07-06 Paul Eggert <eggert@cs.ucla.edu>
2053
2054 Remove unportable assumption about struct layout (Bug#8884).
8a5c77bb
PE
2055 * alloc.c (mark_buffer):
2056 * buffer.c (reset_buffer_local_variables, Fbuffer_local_variables)
2057 (clone_per_buffer_values): Don't assume that
22b4128e
PE
2058 sizeof (struct buffer) is a multiple of sizeof (Lisp_Object).
2059 This isn't true in general, and it's particularly not true
2060 if Emacs is configured with --with-wide-int.
2061 * buffer.h (FIRST_FIELD_PER_BUFFER, LAST_FIELD_PER_BUFFER):
2062 New macros, used in the buffer.c change.
2063
869795d6
JD
20642011-07-05 Jan Djärv <jan.h.d@swipnet.se>
2065
2066 * xsettings.c: Use both GConf and GSettings if both are available.
2067 (store_config_changed_event): Add comment.
2068 (dpyinfo_valid, store_font_name_changed, map_tool_bar_style)
2069 (store_tool_bar_style_changed): New functions.
2070 (store_monospaced_changed): Add comment. Call dpyinfo_valid.
2071 (struct xsettings): Move font inside HAVE_XFT.
2072 (GSETTINGS_TOOL_BAR_STYLE, GSETTINGS_FONT_NAME): New defines.
640c8776 2073 (GSETTINGS_MONO_FONT): Rename from SYSTEM_MONO_FONT.
869795d6 2074 Move inside HAVE_XFT.
640c8776 2075 (something_changed_gsettingsCB): Rename from something_changedCB.
869795d6
JD
2076 Check for changes in GSETTINGS_TOOL_BAR_STYLE and GSETTINGS_FONT_NAME
2077 also.
2078 (GCONF_TOOL_BAR_STYLE, GCONF_FONT_NAME): New defines.
640c8776
SM
2079 (GCONF_MONO_FONT): Rename from SYSTEM_MONO_FONT. Move inside HAVE_XFT.
2080 (something_changed_gconfCB): Rename from something_changedCB.
869795d6
JD
2081 Check for changes in GCONF_TOOL_BAR_STYLE and GCONF_FONT_NAME also.
2082 (parse_settings): Move check for font inside HAVE_XFT.
2083 (read_settings, apply_xft_settings): Add comment.
2084 (read_and_apply_settings): Add comment. Call map_tool_bar_style and
2085 store_tool_bar_style_changed. Move check for font inside HAVE_XFT and
2086 call store_font_name_changed.
2087 (xft_settings_event): Add comment.
2088 (init_gsettings): Add comment. Get values for GSETTINGS_TOOL_BAR_STYLE
2089 and GSETTINGS_FONT_NAME. Move check for fonts within HAVE_XFT.
2090 (init_gconf): Add comment. Get values for GCONF_TOOL_BAR_STYLE
2091 and GCONF_FONT_NAME. Move check for fonts within HAVE_XFT.
2092 (xsettings_initialize): Call init_gsettings last.
640c8776
SM
2093 (xsettings_get_system_font, xsettings_get_system_normal_font):
2094 Add comment.
869795d6 2095
d8ed26bd
PE
20962011-07-05 Paul Eggert <eggert@cs.ucla.edu>
2097
2098 Random fixes. E.g., (random) never returned negative values.
2099 * fns.c (Frandom): Use GET_EMACS_TIME for random seed, and add the
2100 subseconds part to the entropy, as that's a bit more random.
2101 Prefer signed to unsigned, since the signedness doesn't matter and
2102 in general we prefer signed. When given a limit, use a
2103 denominator equal to INTMASK + 1, not to VALMASK + 1, because the
2104 latter isn't right if USE_2_TAGS_FOR_INTS.
2105 * sysdep.c (get_random): Return a value in the range 0..INTMASK,
2106 not 0..VALMASK. Don't discard "excess" bits that random () returns.
2107
cabf1cac
SM
21082011-07-04 Stefan Monnier <monnier@iro.umontreal.ca>
2109
2110 * textprop.c (text_property_stickiness):
2111 Obey Vtext_property_default_nonsticky.
2112 (syms_of_textprop): Add `display' to Vtext_property_default_nonsticky.
2113 * w32fns.c (syms_of_w32fns):
2114 * xfns.c (syms_of_xfns): Don't Add `display' since it's there by default.
2115
6e9b2be9
PE
21162011-07-04 Paul Eggert <eggert@cs.ucla.edu>
2117
2118 * fileio.c (barf_or_query_if_file_exists): Use S_ISDIR.
2119 This is more efficient than Ffile_directory_p and avoids a minor race.
2120
90186c68
LMI
21212011-07-04 Lars Magne Ingebrigtsen <larsi@gnus.org>
2122
7c301272
LMI
2123 * buffer.c (Foverlay_put): Say what the return value is
2124 (bug#7835).
2125
c4f2d8d4
LMI
2126 * fileio.c (barf_or_query_if_file_exists): Check first if the file
2127 is a directory before asking whether to use the file name
2128 (bug#7564).
ad637907
LMI
2129 (barf_or_query_if_file_exists): Make the "File is a directory"
2130 error be more correct.
c4f2d8d4 2131
90186c68
LMI
2132 * fns.c (Frequire): Remove the mention of the .gz files, since
2133 that's installation-specific, but keep the mention of
2134 `get-load-suffixes'.
2135
da64016e
PE
21362011-07-04 Paul Eggert <eggert@cs.ucla.edu>
2137
2138 * editfns.c (Fformat_time_string): Don't assume strlen fits in int.
2139 Report string overflow if the output is too long.
2140
7d47b580
JB
21412011-07-04 Juanma Barranquero <lekktu@gmail.com>
2142
a555cb87
JB
2143 * gnutls.c (Fgnutls_boot): Don't mention :verify-error.
2144 (syms_of_gnutls): Remove duplicate DEFSYM for
2145 Qgnutls_bootprop_verify_hostname_error, an error for
2146 Qgnutls_bootprop_verify_error (which is no longer used).
2147
7d47b580
JB
2148 * eval.c (find_handler_clause): Remove parameters `sig' and `data',
2149 unused since 2011-01-26T20:02:07Z!monnier@iro.umontreal.ca. All callers changed.
2150 Also (re)move comments that are misplaced or no longer relevant.
2151
1e49bfab
LMI
21522011-07-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
2153
2154 * callint.c (Finteractive): Clarify the meaning of "@" (bug#8813).
2155
1485f4c0
CY
21562011-07-03 Chong Yidong <cyd@stupidchicken.com>
2157
2158 * xfaces.c (Finternal_merge_in_global_face): Modify the foreground
2159 and background color parameters if they have been changed.
2160
a9ab721e
LMI
21612011-07-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
2162
2163 * editfns.c (Fformat): Clarify the - and 0 flags (bug#6659).
2164
cf7cff57
PE
21652011-07-03 Paul Eggert <eggert@cs.ucla.edu>
2166
2e13213d
PE
2167 * xsettings.c (SYSTEM_FONT): Define only when used.
2168 No need to define when HAVE_GSETTINGS || !HAVE_XFT.
2169
cf7cff57
PE
2170 * keymap.c (access_keymap_1): Now static.
2171
7a8e04f7
CY
21722011-07-02 Chong Yidong <cyd@stupidchicken.com>
2173
2174 * keyboard.c (command_loop_1): If a down-mouse event is unbound,
2175 leave any prefix arg for the up event (Bug#1586).
2176
61352f62
LMI
21772011-07-02 Lars Magne Ingebrigtsen <larsi@gnus.org>
2178
69bb1ef7
LMI
2179 * lread.c (syms_of_lread): Mention single symbols defined by
2180 `defvar' or `defconst' (bug#7154).
2181
61352f62 2182 * fns.c (Frequire): Mention .el.gz files (bug#7314).
7b3747f9 2183 (Frequire): Mention get-load-suffixes.
61352f62 2184
28545e04
MR
21852011-07-02 Martin Rudalics <rudalics@gmx.at>
2186
2187 * window.h (window): Remove clone_number slot.
2188 * window.c (Fwindow_clone_number, Fset_window_clone_number):
2189 Remove.
2190 (make_parent_window, make_window, saved_window)
2191 (Fset_window_configuration, save_window_save): Don't deal with
2192 clone numbers.
2193 * buffer.c (Qclone_number): Remove declaration.
2194 (sort_overlays, overlay_strings): Don't deal with clone numbers.
2195
3349e122
SM
21962011-07-02 Stefan Monnier <monnier@iro.umontreal.ca>
2197
2198 Add multiple inheritance to keymaps.
2199 * keymap.c (Fmake_composed_keymap): New function.
2200 (Fset_keymap_parent): Simplify.
2201 (fix_submap_inheritance): Remove.
2202 (access_keymap_1): New function extracted from access_keymap to handle
2203 embedded parents and handle lists of maps.
2204 (access_keymap): Use it.
2205 (Fkeymap_prompt, map_keymap_internal, map_keymap, store_in_keymap)
2206 (Fcopy_keymap): Handle embedded parents.
2207 (Fcommand_remapping, define_as_prefix): Simplify.
2208 (Fkey_binding): Simplify.
2209 (syms_of_keymap): Move minibuffer-local-completion-map,
2210 minibuffer-local-filename-completion-map,
2211 minibuffer-local-must-match-map, and
2212 minibuffer-local-filename-must-match-map to Elisp.
2213 (syms_of_keymap): Defsubr make-composed-keymap.
2214 * keyboard.c (menu_bar_items): Use map_keymap_canonical.
2215 (parse_menu_item): Trivial simplification.
2216
3279eb87
GM
22172011-07-01 Glenn Morris <rgm@gnu.org>
2218
2219 * Makefile.in (SETTINGS_LIBS): Fix typo.
2220
4550efdf
KI
22212011-07-01 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny patch)
2222
2223 * coding.c (Fencode_coding_string): Record the last coding system
2224 used, as the function doc string says (bug#8738).
2225
0949d2b6
JD
22262011-07-01 Jan Djärv <jan.h.d@swipnet.se>
2227
2228 * xsettings.c (store_monospaced_changed): Take new font as arg and
2229 check for change against current_mono_font.
2230 (EMACS_TYPE_SETTINGS): Remove this and related defines.
2231 (emacs_settings_constructor, emacs_settings_get_property)
2232 (emacs_settings_set_property, emacs_settings_class_init)
2233 (emacs_settings_init, gsettings_obj): Remove.
2234 (something_changedCB): New function for HAVE_GSETTINGS.
2235 (something_changedCB): HAVE_GCONF: Call store_monospaced_changed
2236 with value as argument.
2237 (init_gsettings): Check that GSETTINGS_SCHEMA exists before calling
2238 g_settings_new (Bug#8967). Do not create gsettings_obj.
9173deec 2239 Remove calls to g_settings_bind. Connect something_changedCB to
0949d2b6
JD
2240 "changed".
2241
2242 * xgselect.c: Add defined (HAVE_GSETTINGS).
2243 (xgselect_initialize): Ditto.
2244
2245 * process.c: Add defined (HAVE_GSETTINGS) for xgselect.h
2246 (wait_reading_process_output): Add defined (HAVE_GSETTINGS) for
2247 xg_select.
2248
bbc6b304
PE
22492011-07-01 Paul Eggert <eggert@cs.ucla.edu>
2250
2251 * eval.c (struct backtrace): Simplify and port the data structure.
2252 Do not assume that "int nargs : BITS_PER_INT - 2;" produces a
2253 signed bit field, as this assumption is not portable and it makes
2254 Emacs crash when compiled with Sun C 5.8 on sparc. Do not use
2255 "char debug_on_exit : 1" as this is not portable either; instead,
2256 use the portable "unsigned int debug_on_exit : 1". Remove unused
2257 member evalargs. Remove obsolete comments about cc bombing out.
2258
9851bfc5
JD
22592011-06-30 Jan Djärv <jan.h.d@swipnet.se>
2260
51bb811f 2261 * xsettings.c: Include glib-object.h, gio/gio.h if HAVE_GSETTINGS.
9851bfc5
JD
2262 Let HAVE_GSETTINGS override HAVE_GCONF.
2263 (store_monospaced_changed): New function.
2264 (EMACS_SETTINGS): A new type derived from GObject to handle
2265 GSettings notifications.
2266 (emacs_settings_constructor, emacs_settings_get_property)
2267 (emacs_settings_set_property, emacs_settings_class_init):
2268 New functions.
2269 (gsettings_client, gsettings_obj): New variables.
2270 (GSETTINGS_SCHEMA): New define.
2271 (something_changedCB): Call store_monospaced_changed.
2272 (init_gsettings): New function.
2273 (xsettings_initialize): Call init_gsettings.
2274 (syms_of_xsettings): Initialize gsettings_client, gsettings_obj
2275 to NULL.
2276
640c8776 2277 * Makefile.in (SETTINGS_CFLAGS, SETTINGS_LIBS): Rename from
9851bfc5
JD
2278 GCONF_CFLAGS/LIBS.
2279
5386012d
MR
22802011-06-29 Martin Rudalics <rudalics@gmx.at>
2281
2282 * window.c (resize_root_window, grow_mini_window)
2283 (shrink_mini_window): Rename Qresize_root_window to
2284 Qwindow_resize_root_window and Qresize_root_window_vertically to
2285 Qwindow_resize_root_window_vertically.
2286
f13e0b08
PE
22872011-06-28 Paul Eggert <eggert@cs.ucla.edu>
2288
2289 * gnutls.c (Qgnutls_bootprop_verify_error): Remove unused var.
2290
94515237
JB
22912011-06-27 Juanma Barranquero <lekktu@gmail.com>
2292
2293 * makefile.w32-in: Redesign dependencies so they reflect more
2294 clearly which files are directly included by each source file,
2295 and not through other includes.
2296
e43b6e43
MR
22972011-06-27 Martin Rudalics <rudalics@gmx.at>
2298
2299 * buffer.c (Qclone_number): Declare static and DEFSYM it.
2300 (sort_overlays, overlay_strings): When an overlay's clone number
2301 matches the window's clone number process the overlay even if
2302 the overlay's window property doesn't match the current window.
2303
d68443dc
MR
2304 * window.c (Fwindow_vchild): Rename to Fwindow_top_child.
2305 (Fwindow_hchild): Rename to Fwindow_left_child.
2306 (Fwindow_next): Rename to Fwindow_next_sibling.
2307 (Fwindow_prev): Rename to Fwindow_prev_sibling.
d615d6d2
MR
2308 (resize_window_check): Rename to window_resize_check.
2309 (resize_window_apply): Rename to window_resize_apply.
2310 (Fresize_window_apply): Rename to Fwindow_resize_apply.
2311 (Fdelete_other_windows_internal, resize_frame_windows)
2312 (Fsplit_window_internal, Fdelete_window_internal)
2313 (grow_mini_window, shrink_mini_window)
2314 (Fresize_mini_window_internal): Fix callers accordingly.
d68443dc 2315
c7e73be5
JD
23162011-06-26 Jan Djärv <jan.h.d@swipnet.se>
2317
2318 * emacsgtkfixed.h: State that this is only used with Gtk+3.
2319 (emacs_fixed_set_min_size): Remove.
2320 (emacs_fixed_new): Take frame as argument.
2321
2322 * emacsgtkfixed.c: State that this is only used with Gtk+3.
2323 (_EmacsFixedPrivate): Remove minwidth/height.
2324 Add struct frame *f.
2325 (emacs_fixed_init): Initialize priv->f.
2326 (get_parent_class, emacs_fixed_set_min_size): Remove.
2327 (emacs_fixed_new): Set priv->f to argument.
2328 (emacs_fixed_get_preferred_width)
2329 (emacs_fixed_get_preferred_height): Use min_width/height from
2330 frames size_hint to set minimum and natural (Bug#8919).
2331 (XSetWMSizeHints, XSetWMNormalHints): Override these functions
2332 and use min_width/height from frames size_hint to set
2333 min_width/height (Bug#8919).
2334
2335 * gtkutil.c (xg_create_frame_widgets): Pass f to emacs_fixed_new.
9173deec
JB
2336 (x_wm_set_size_hint): Remove call to emacs_fixed_set_min_size.
2337 Fix indentation.
c7e73be5 2338
cf99dcf8
EZ
23392011-06-26 Eli Zaretskii <eliz@gnu.org>
2340
2341 * bidi.c (bidi_paragraph_init): Test for ZV_BYTE before calling
2342 bidi_at_paragraph_end, since fast_looking_at doesn't like to be
2343 called at ZV.
2344
029529ac
CY
23452011-06-26 Chong Yidong <cyd@stupidchicken.com>
2346
2347 * process.c (wait_reading_process_output): Bypass select if
2348 waiting for a cell while ignoring keyboard input, and input is
2349 pending. Suggested by Jan Djärv (Bug#8869).
2350
7a7ef429
PE
23512011-06-25 Paul Eggert <eggert@cs.ucla.edu>
2352
2353 Use gnulib's dup2 module instead of rolling our own.
2354 * sysdep.c (dup2) [!HAVE_DUP2]: Remove; gnulib now does this.
2355
11fdef7d 23562011-06-25 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
989b42d2
YM
2357
2358 * dispnew.c (scrolling_window): Before scrolling, turn off a
2359 mouse-highlight in the window being scrolled.
2360
cd3520a4
JB
23612011-06-24 Juanma Barranquero <lekktu@gmail.com>
2362
2363 Move DEFSYM to lisp.h and use everywhere.
2364
2365 * character.h (DEFSYM): Move declaration...
2366 * lisp.h (DEFSYM): ...here.
2367
2368 * gnutls.c:
2369 * minibuf.c:
2370 * w32menu.c:
2371 * w32proc.c:
2372 * w32select.c: Don't include character.h.
2373
2374 * alloc.c (syms_of_alloc):
2375 * buffer.c (syms_of_buffer):
2376 * bytecode.c (syms_of_bytecode):
2377 * callint.c (syms_of_callint):
2378 * casefiddle.c (syms_of_casefiddle):
2379 * casetab.c (init_casetab_once):
2380 * category.c (init_category_once, syms_of_category):
2381 * ccl.c (syms_of_ccl):
2382 * cmds.c (syms_of_cmds):
2383 * composite.c (syms_of_composite):
2384 * dbusbind.c (syms_of_dbusbind):
2385 * dired.c (syms_of_dired):
2386 * dispnew.c (syms_of_display):
2387 * doc.c (syms_of_doc):
2388 * editfns.c (syms_of_editfns):
2389 * emacs.c (syms_of_emacs):
2390 * eval.c (syms_of_eval):
2391 * fileio.c (syms_of_fileio):
2392 * fns.c (syms_of_fns):
2393 * frame.c (syms_of_frame):
2394 * fringe.c (syms_of_fringe):
2395 * insdel.c (syms_of_insdel):
2396 * keymap.c (syms_of_keymap):
2397 * lread.c (init_obarray, syms_of_lread):
2398 * macros.c (syms_of_macros):
2399 * msdos.c (syms_of_msdos):
2400 * print.c (syms_of_print):
2401 * process.c (syms_of_process):
2402 * search.c (syms_of_search):
2403 * sound.c (syms_of_sound):
2404 * syntax.c (init_syntax_once, syms_of_syntax):
2405 * terminal.c (syms_of_terminal):
2406 * textprop.c (syms_of_textprop):
2407 * undo.c (syms_of_undo):
2408 * w32.c (globals_of_w32):
2409 * window.c (syms_of_window):
2410 * xdisp.c (syms_of_xdisp):
2411 * xfaces.c (syms_of_xfaces):
2412 * xfns.c (syms_of_xfns):
2413 * xmenu.c (syms_of_xmenu):
2414 * xsettings.c (syms_of_xsettings):
2415 * xterm.c (syms_of_xterm): Use DEFSYM.
2416
4228cf16
TZ
24172011-06-24 Teodor Zlatanov <tzz@lifelogs.com>
2418
cd3520a4 2419 * gnutls.c (syms_of_gnutls): Use the DEFSYM macro from character.h.
4228cf16 2420
7fcccf1e
PE
24212011-06-23 Paul Eggert <eggert@cs.ucla.edu>
2422
7efb4e0e
PE
2423 Integer and buffer overflow fixes (Bug#8873).
2424
ff5844ad
PE
2425 * print.c (printchar, strout): Check for string overflow.
2426 (PRINTPREPARE, printchar, strout):
2427 Don't set size unless allocation succeeds.
2428
90532f02
PE
2429 * minibuf.c (read_minibuf_noninteractive): Use ptrdiff_t, not int,
2430 for sizes. Check for string overflow more accurately.
2431 Simplify newline removal at end; this suppresses a GCC 4.6.0 warning.
2432
6d84508d
PE
2433 * macros.c: Integer and buffer overflow fixes.
2434 * keyboard.h (struct keyboard.kbd_macro_bufsize):
2435 * macros.c (Fstart_kbd_macro, store_kbd_macro_char):
2436 Use ptrdiff_t, not int, for sizes.
2437 Don't increment bufsize until after realloc succeeds.
2438 Check for size-calculation overflow.
2439 (Fstart_kbd_macro): Use EMACS_INT, not int, for XINT result.
2440
437b2cb4
PE
2441 * lisp.h (DEFVAR_KBOARD): Use offsetof instead of char * finagling.
2442
8b9ac8b4
PE
2443 * lread.c: Integer overflow fixes.
2444 (read_integer): Radix is now EMACS_INT, not int,
2445 to improve quality of diagnostics for out-of-range radices.
2446 Calculate buffer size correctly for out-of-range radices.
2447 (read1): Check for integer overflow in radices, and in
2448 read-circle numbers.
82cb60d3
PE
2449 (read_escape): Avoid int overflow.
2450 (Fload, openp, read_buffer_size, read1)
2451 (substitute_object_recurse, read_vector, read_list, map_obarray):
2452 Use ptrdiff_t, not int, for sizes.
2453 (read1): Use EMACS_INT, not int, for sizes.
20270765 2454 Check for size overflow.
8b9ac8b4 2455
7fcccf1e
PE
2456 * image.c (cache_image): Check for size arithmetic overflow.
2457
bfbbd7e7
PE
2458 * lread.c: Integer overflow issues.
2459 (saved_doc_string_size, saved_doc_string_length)
2460 (prev_saved_doc_string_size, prev_saved_doc_string_length):
2461 Now ptrdiff_t, not int.
2462 (read1): Don't assume doc string length fits in int. Check for
2463 out-of-range doc string lengths.
2464 (read_list): Don't assume file position fits in int.
39019e54 2465 (read_escape): Check for hex character overflow.
bfbbd7e7 2466
4e323265
LL
24672011-06-22 Leo Liu <sdl.web@gmail.com>
2468
2469 * minibuf.c (Fcompleting_read_default, Vcompleting_read_function):
2470 Move to minibuffer.el.
2471
85fece3e
PE
24722011-06-22 Paul Eggert <eggert@cs.ucla.edu>
2473
20b84ce9 2474 Fixes for GLYPH_DEBUG found by GCC 4.6.0 static checking.
85fece3e
PE
2475 The following patches are for when GLYPH_DEBUG && !XASSERT.
2476 * dispextern.h (trace_redisplay_p, dump_glyph_string):
2477 * dispnew.c (flush_stdout):
2478 * xdisp.c (dump_glyph_row, dump_glyph_matrix, dump_glyph):
2479 Mark as externally visible.
2480 * dispnew.c (check_window_matrix_pointers): Now static.
2481 * dispnew.c (window_to_frame_vpos):
2482 * xfns.c (unwind_create_frame):
2483 * xterm.c (x_check_font): Remove unused local.
2484 * scroll.c (CHECK_BOUNDS):
2485 * xfaces.c (cache_fache): Rename local to avoid shadowing.
2486 * xfns.c, w32fns.c (image_cache_refcount, dpyinfo_refcount): Now static.
2487 * xdisp.c (check_window_end): Now a no-op if !XASSERTS.
2488 (debug_first_unchanged_at_end_vpos, debug_last_unchanged_at_beg_vpos)
2489 (debug_dvpos, debug_dy, debug_delta, debug_delta_bytes, debug_end_vpos):
2490 Now static.
2491 (debug_method_add): Use va_list and vsprintf rather than relying
2492 on undefined behavior with wrong number of arguments.
2493 (dump_glyph, dump_glyph_row, Fdump_glyph_matrix):
2494 Don't assume ptrdiff_t and EMACS_INT are the same width as int.
2495 In this code, it's OK to assume C99 behavior for ptrdiff_t formats
2496 since we're not interested in debugging glyphs with old libraries.
2497 * xfaces.c (cache_face): Move debugging code earlier; this pacifies
2498 GCC 4.6.0's static checking.
2499
0766b489
PE
25002011-06-22 Paul Eggert <eggert@cs.ucla.edu>
2501
31fd4b32
PE
2502 Integer overflow and signedness fixes (Bug#8873).
2503 A few related buffer overrun fixes, too.
2504
b79e8648
PE
2505 * font.c (font_score): Use EMACS_INT, not int, to store XINT value.
2506
0766b489
PE
2507 * dispextern.h (struct face.stipple):
2508 * image.c (x_bitmap_height, x_bitmap_width, x_bitmap_pixmap)
2509 (x_bitmap_mask, x_allocate_bitmap_record)
2510 (x_create_bitmap_from_data, x_create_bitmap_from_file)
2511 (x_destroy_bitmap, x_destroy_all_bitmaps, x_create_bitmap_mask)
2512 (x_create_bitmap_from_xpm_data):
2513 * nsterm.h (struct ns_display_info.bitmaps_size, .bitmaps_last):
2514 * w32term.h (struct w32_display_info.icon_bitmap_id, .bitmaps_size)
2515 (.bitmaps_last):
2516 * xfaces.c (load_pixmap):
2517 * xterm.c (x_bitmap_icon, x_wm_set_icon_pixmap):
2518 * xterm.h (struct x_display_info.icon_bitmap_id, .bitmaps_size)
2519 (.bitmaps_last, struct x_output.icon_bitmap):
2520 Use ptrdiff_t, not int, for bitmap indexes.
2521 (x_allocate_bitmap_record): Check for size overflow.
2522 * dispextern.h, lisp.h: Adjust to API changes elsewhere.
2523
b081724f
PE
2524 Use ptrdiff_t, not int, for overlay counts.
2525 * buffer.h (overlays_at, sort_overlays, GET_OVERLAYS_AT):
2526 * editfns.c (overlays_around, get_pos_property):
2527 * textprop.c (get_char_property_and_overlay):
2528 * xdisp.c (next_overlay_change, note_mouse_highlight):
2529 * xfaces.c (face_at_buffer_position):
21514da7
PE
2530 * buffer.c (OVERLAY_COUNT_MAX): New macro.
2531 (overlays_at, overlays_in, sort_overlays, Foverlays_at)
2532 (Fnext_overlay_change, Fprevious_overlay_change)
2533 (mouse_face_overlay_overlaps, Foverlays_in):
b081724f 2534 Use ptrdiff_t, not int, for sizes.
21514da7 2535 (overlays_at, overlays_in): Check for size-calculation overflow.
b081724f 2536
3de73e5e
PE
2537 * xterm.c (xim_initialize, same_x_server): Strlen may not fit in int.
2538
2606c57b
PE
2539 * xsmfns.c (smc_save_yourself_CB, x_session_initialize): Avoid strlen.
2540 (x_session_initialize): Do not assume string length fits in int.
2541
aaafe47a
PE
2542 * xsettings.c (apply_xft_settings): Fix potential buffer overrun.
2543 This is unlikely, but can occur if DPI is outlandish.
2544
2674ddc8 2545 * xsettings.c (Ffont_get_system_normal_font, Ffont_get_system_font):
3a5077c5
PE
2546 * xselect.c (Fx_get_atom_name): Avoid need for strlen.
2547
28154962
PE
2548 * xrdb.c: Don't assume strlen fits in int; avoid some strlens.
2549 * xrdb.c (magic_file_p, search_magic_path):
2550 Omit last arg SUFFIX; it was always 0. All callers changed.
2551 (magic_file_p): Use ptrdiff_t, not int. Check for size overflow.
2552
7de51af5
PE
2553 * xfont.c (xfont_match): Avoid need for strlen.
2554
25ed6cc3
PE
2555 * xfns.c: Don't assume strlen fits in int.
2556 (xic_create_fontsetname, x_window): Use ptrdiff_t, not int.
2557
4eab31dd
PE
2558 * xdisp.c (message_log_check_duplicate): Return intmax_t,
2559 not unsigned long, as we prefer signed integers. All callers changed.
2560 Detect integer overflow in repeat count.
2561 (message_dolog): Don't assume print length fits in 39 bytes.
df1f27af 2562 (display_mode_element): Don't assume strlen fits in int.
4eab31dd 2563
171e2a58
PE
2564 * termcap.c: Don't assume sizes fit in int and never overflow.
2565 (struct termcap_buffer, tgetent): Use ptrdiff_t, not int, for sizes.
2566 (gobble_line): Check for size-calculation overflow.
2567
ad39faca 2568 * minibuf.c (Fread_buffer):
6e5bb2dc 2569 * lread.c (intern, intern_c_string):
74ca2eb3
PE
2570 * image.c (xpm_scan) [HAVE_NS && !HAVE_XPM]:
2571 Don't assume string length fits in int.
2572
52c61c22 2573 * keyboard.c (parse_tool_bar_item):
9bda3520
PE
2574 * gtkutil.c (style_changed_cb): Avoid need for strlen.
2575
b5b8c9e5
PE
2576 * font.c: Don't assume string length fits in int.
2577 (font_parse_xlfd, font_parse_fcname, font_unparse_fcname):
2578 Use ptrdiff_t, not int.
ccd6111c
PE
2579 (font_intern_prop): Don't assume string length fits in int.
2580 Don't assume integer property fits in fixnum.
2581 * font.h (font_intern_prop): 2nd arg is now ptrdiff_t, not int.
b5b8c9e5 2582
882f0d81 2583 * filelock.c: Fix some buffer overrun and integer overflow issues.
51cab52b 2584 (get_boot_time): Don't assume gzip command string fits in 100 bytes.
882f0d81
PE
2585 Reformulate so as not to need the command string.
2586 Invoke gzip -cd rather than gunzip, as it's more portable.
2587 (lock_info_type, lock_file_1, lock_file):
2588 Don't assume pid_t and time_t fit in unsigned long.
2589 (LOCK_PID_MAX): Remove; we now use more-reliable bounds.
2590 (current_lock_owner): Prefer signed type for sizes.
2591 Use memcpy, not strncpy, where memcpy is what is really wanted.
2592 Don't assume (via atoi) that time_t and pid_t fit in int.
2593 Check for time_t and/or pid_t out of range, e.g., via a network share.
2594 Don't alloca where an auto var works fine.
2595
93f4cf88
PE
2596 * fileio.c: Fix some integer overflow issues.
2597 (file_name_as_directory, Fexpand_file_name, Fsubstitute_in_file_name):
2598 Don't assume string length fits in int.
2599 (directory_file_name): Don't assume string length fits in long.
2600 (make_temp_name): Don't assume pid fits in int, or that its print
2601 length is less than 20.
2602
f3e92b69
PE
2603 * data.c (Fsubr_name): Rewrite to avoid a strlen call.
2604
1bfdaf10
PE
2605 * coding.c (make_subsidiaries): Don't assume string length fits in int.
2606
35016e9a
PE
2607 * callproc.c (child_setup): Rewrite to avoid two strlen calls.
2608
3d1e65a1
PE
2609 * process.c (Fformat_network_address): Use EMACS_INT, not EMACS_UINT.
2610 We prefer signed integers, even for size calculations.
2611
0b963a93
PE
2612 * emacs.c: Don't assume string length fits in 'int'.
2613 (DEFINE_DUMMY_FUNCTION, sort_args): Use ptrdiff_t, not int.
2614 (main): Don't invoke strlen when not needed.
2615
573f4b54
PE
2616 * dbusbind.c (XD_ERROR): Don't arbitrarily truncate string.
2617 (XD_DEBUG_MESSAGE): Don't waste a byte.
2618
989f33ba
PE
2619 * callproc.c (getenv_internal_1, getenv_internal)
2620 (Fgetenv_internal):
965d34eb
PE
2621 * buffer.c (init_buffer): Don't assume string length fits in 'int'.
2622
e4d29b33
PE
2623 * lread.c (invalid_syntax): Omit length argument.
2624 All uses changed. This doesn't fix a bug, but it simplifies the
2625 code away from its former Hollerith-constant appearance, and it's
2626 one less 'int' to worry about when looking at integer-overflow issues.
51cab52b 2627 (string_to_number): Simplify 2011-04-26 change by invoking xsignal1.
e4d29b33 2628
eb49b136
PE
2629 * lisp.h (DEFUN): Remove bogus use of sizeof (struct Lisp_Subr).
2630 This didn't break anything, but it didn't help either.
2631 It's confusing to put a bogus integer in a place where the actual
2632 value does not matter.
9f62aeb1 2633 (LIST_END_P): Remove unused macro and its bogus comment.
cbeff735 2634 (make_fixnum_or_float): Remove unnecessary cast to EMACS_INT.
eb49b136 2635
15375a22
PE
2636 * lisp.h (union Lisp_Object.i): EMACS_INT, not EMACS_UINT.
2637 This is for consistency with the ordinary, non-USE_LISP_UNION_TYPE,
2638 implementation.
b61cc01c
PE
2639 (struct Lisp_Bool_Vector.size): EMACS_INT, not EMACS_UINT.
2640 We prefer signed types, and the value cannot exceed the EMACS_INT
2641 range anyway (because otherwise the length would not be representable).
9a8e8d9b
PE
2642 (XSET) [USE_LISP_UNION_TYPE]: Use uintptr_t and intptr_t,
2643 not EMACS_UINT and EMACS_INT, when converting pointer to integer.
2644 This avoids a GCC warning when WIDE_EMACS_INT.
15375a22 2645
53b2623d
PE
2646 * indent.c (sane_tab_width): New function.
2647 (current_column, scan_for_column, Findent_to, position_indentation)
2648 (compute_motion): Use it. This is just for clarity.
8fcaf9cc 2649 (Fcompute_motion): Don't assume hscroll and tab offset fit in int.
53b2623d 2650
51cab52b 2651 * image.c (xbm_image_p): Don't assume stated width, height fit in int.
45aebb64 2652
f2ed8a70
PE
2653 * lisp.h (lint_assume): New macro.
2654 * composite.c (composition_gstring_put_cache):
2655 * ftfont.c (ftfont_shape_by_flt): Use it to pacify GCC 4.6.0.
2656
abe80cc6
PE
2657 * editfns.c, insdel.c:
2658 Omit unnecessary forward decls, to simplify future changes.
a9e860e1 2659
b02c740e
PE
2660 * ftfont.c (ftfont_shape_by_flt): Use signed integers for lengths.
2661
ebc96716
PE
2662 * font.c (Ffont_shape_gstring): Don't assume glyph len fits in 'int'.
2663
b4e50fa0 2664 * fns.c (Ffillarray): Don't assume bool vector size fits in 'int'.
f03dc6ef 2665 Use much-faster test for byte-length change.
311d5d7c 2666 Don't assume string byte-length fits in 'int'.
a4cf38e4 2667 Check that character arg fits in 'int'.
85461888 2668 (mapcar1): Declare byte as byte, for clarity.
b4e50fa0 2669
c0c1ee9f
PE
2670 * alloc.c (Fmake_bool_vector): Avoid unnecessary multiplication.
2671
a498d7f4
PE
2672 * fns.c (concat): Catch string overflow earlier.
2673 Do not rely on integer wraparound.
2674
51cab52b
PE
2675 * dispextern.h (struct it.overlay_strings_charpos)
2676 (struct it.selective): Now EMACS_INT, not int.
87830974
PE
2677 * xdisp.c (forward_to_next_line_start)
2678 (back_to_previous_visible_line_start)
2679 (reseat_at_next_visible_line_start, next_element_from_buffer):
2680 Don't arbitrarily truncate the value of 'selective' to int.
2681
76031fad
PE
2682 * xdisp.c (init_iterator): Use XINT, not XFASTINT; it might be < 0.
2683
5eb55db9
PE
2684 * composite.c: Don't truncate sizes to 'int'.
2685 (composition_gstring_p, composition_reseat_it)
2686 (composition_adjust_point): Use EMACS_INT, not int.
7d100a81
PE
2687 (get_composition_id, composition_gstring_put_cache): Use EMACS_INT,
2688 not EMACS_UINT, for indexes.
5eb55db9 2689
0703a717
PE
2690 * category.h (CATEGORY_SET_P): Remove unnecessary cast to EMACS_INT.
2691
d6202519
PE
2692 * buffer.c: Include <verify.h>.
2693 (struct sortvec.priority, struct sortstr.priority):
8961a454 2694 Now EMACS_INT, not int.
c20998a7 2695 (compare_overlays, cmp_for_strings): Avoid subtraction overflow.
67c36fce
PE
2696 (struct sortstr.size, record_overlay_string)
2697 (struct sortstrlist.size, struct sortlist.used):
2698 Don't truncate size to int.
2699 (record_overlay_string): Check for size-calculation overflow.
d6202519 2700 (init_buffer_once): Check at compile-time, not run-time.
fadf4e30 2701
d5a19415
JM
27022011-06-22 Jim Meyering <meyering@redhat.com>
2703
029529ac 2704 Don't leak an XBM-image-sized buffer
d5a19415
JM
2705 * image.c (xbm_load): Free the image buffer after using it.
2706
a9041e6c
PE
27072011-06-21 Paul Eggert <eggert@cs.ucla.edu>
2708
2709 Port to Sun C.
2710 * composite.c (find_automatic_composition): Omit needless 'return 0;'
2711 that Sun C diagnosed.
2712 * fns.c (secure_hash): Fix pointer signedness issue.
2713 * intervals.c (static_offset_intervals): New function.
2714 (offset_intervals): Use it.
2715
7f3f739f
LL
27162011-06-21 Leo Liu <sdl.web@gmail.com>
2717
2718 * deps.mk (fns.o):
2719 * makefile.w32-in ($(BLD)/fns.$(O)): Include sha256.h and
2720 sha512.h.
2721
2722 * fns.c (secure_hash): Rename from crypto_hash_function and change
2723 the first arg to accept symbols.
5b66d427 2724 (Fsecure_hash): New primitive.
7f3f739f
LL
2725 (syms_of_fns): New symbols.
2726
76147d94
DD
27272011-06-20 Deniz Dogan <deniz@dogan.se>
2728
2729 * process.c (Fset_process_buffer): Clarify return value in
2730 docstring.
2731
7d7d0045
CY
27322011-06-18 Chong Yidong <cyd@stupidchicken.com>
2733
2734 * dispnew.c (add_window_display_history): Use BVAR.
2735
2736 * xdisp.c (debug_method_add): Use BVAR.
2737 (check_window_end, dump_glyph_matrix, dump_glyph)
2738 (dump_glyph_row, dump_glyph_string): Convert arglist to ANSI C.
2739
2740 * xfaces.c (check_lface_attrs, check_lface, dump_realized_face):
2741 Likewise.
2742
2743 * xfns.c (Fx_create_frame, x_create_tip_frame): Delay image cache
2744 check till after the cache is created in init_frame_faces.
2745
ff2bc410
SM
27462011-06-17 Stefan Monnier <monnier@iro.umontreal.ca>
2747
2748 * fns.c (Fsafe_length): Yet another int/Lisp_Object mixup.
2749
28177add
PE
27502011-06-16 Paul Eggert <eggert@cs.ucla.edu>
2751
dd3482fe
PE
2752 * lisp.h: Include <limits.h>, for INT_MAX, LONG_MAX, LLONG_MAX.
2753 Without this, prin1 mishandles Lisp_Misc_Save_Value printing on
2754 hosts with pre-C99 libraries, because pD is wrongly defined to "t".
2755
393d71f3 2756 Improve buffer-overflow checking (Bug#8873).
1c8e352f
PE
2757 * fileio.c (Finsert_file_contents):
2758 * insdel.c (insert_from_buffer_1, replace_range, replace_range_2):
2759 Remove the old (too-loose) buffer overflow checks.
2760 They weren't needed, since make_gap checks for buffer overflow.
2761 * insdel.c (make_gap_larger): Catch buffer overflows that were missed.
2762 The old code merely checked for Emacs fixnum overflow, and relied
2763 on undefined (wraparound) behavior. The new code avoids undefined
2764 behavior, and also checks for ptrdiff_t and/or size_t overflow.
2765
2e6813b0 2766 * editfns.c (Finsert_char): Don't dump core with very negative counts.
21d890a4
PE
2767 Tune. Don't use wider integers than needed. Don't use alloca.
2768 Use a bigger 'string' buffer. Rewrite to avoid 'n > 0' test.
2e6813b0 2769
599a9e4f
PE
2770 * insdel.c (replace_range): Fix buf overflow when insbytes < outgoing.
2771
99561444
PE
2772 * insdel.c, lisp.h (buffer_overflow): New function.
2773 (insert_from_buffer_1, replace_range, replace_range_2):
2774 * insdel.c (make_gap_larger):
2775 * editfns.c (Finsert_char):
2776 * fileio.c (Finsert_file_contents): Use it, to normalize wording.
2777
28177add
PE
2778 * buffer.h (BUF_BYTES_MAX): Cast to ptrdiff_t so that it's signed.
2779
e69dafad
PE
27802011-06-15 Paul Eggert <eggert@cs.ucla.edu>
2781
a7af7fde 2782 Integer overflow and signedness fixes (Bug#8873).
ff672d2c 2783
b1c46f02
PE
2784 * ccl.c (ASCENDING_ORDER): New macro, to work around GCC bug 43772.
2785 (GET_CCL_RANGE, IN_INT_RANGE): Use it.
2786
e69dafad
PE
2787 * fileio.c: Don't assume EMACS_INT fits in off_t.
2788 (emacs_lseek): New static function.
2789 (Finsert_file_contents, Fwrite_region): Use it.
2790 Use SEEK_SET, SEEK_CUR, SEEK_END as appropriate.
2791
566684ea
PE
2792 * fns.c (Fload_average): Don't assume 100 * load average fits in int.
2793
e6966cd6
PE
2794 * fns.c: Don't overflow int when computing a list length.
2795 * fns.c (QUIT_COUNT_HEURISTIC): New constant.
2796 (Flength, Fsafe_length): Use EMACS_INT, not int, to avoid unwanted
2797 truncation on 64-bit hosts. Check for QUIT every
2798 QUIT_COUNT_HEURISTIC entries rather than every other entry; that's
2799 faster and is responsive enough.
2800 (Flength): Report an error instead of overflowing an integer.
2801 (Fsafe_length): Return a float if the value is not representable
2802 as a fixnum. This shouldn't happen except in contrived situations.
6346d301 2803 (Fnthcdr, Fsort): Don't assume list length fits in int.
de41a810 2804 (Fcopy_sequence): Don't assume vector length fits in int.
00c604f2 2805
dd0b0efb
PE
2806 * alloc.c: Check that resized vectors' lengths fit in fixnums.
2807 (header_size, word_size): New constants.
2808 (allocate_vectorlike): Don't check size overflow here.
2809 (allocate_vector): Check it here instead, since this is the only
2810 caller of allocate_vectorlike that could cause overflow.
2811 Check that the new vector's length is representable as a fixnum.
2812
86fe5cfe
PE
2813 * fns.c (next_almost_prime): Don't return a multiple of 3 or 5.
2814 The previous code was bogus. For example, next_almost_prime (32)
2815 returned 39, which is undesirable as it is a multiple of 3; and
2816 next_almost_prime (24) returned 25, which is a multiple of 5 so
2817 why was the code bothering to check for multiples of 7?
2818
80e88859
PE
2819 * bytecode.c (exec_byte_code): Use ptrdiff_t, not int, for vector length.
2820
4a2f0ad6
PE
2821 * eval.c, doprnt.c (SIZE_MAX): Remove; inttypes.h defines this now.
2822
f66c7cf8
PE
2823 Variadic C functions now count arguments with ptrdiff_t.
2824 This partly undoes my 2011-03-30 change, which replaced int with size_t.
2825 Back then I didn't know that the Emacs coding style prefers signed int.
2826 Also, in the meantime I found a few more instances where arguments
4a2f0ad6
PE
2827 were being counted with int, which may truncate counts on 64-bit
2828 machines, or EMACS_INT, which may be unnecessarily wide.
f66c7cf8
PE
2829 * lisp.h (struct Lisp_Subr.function.aMANY)
2830 (DEFUN_ARGS_MANY, internal_condition_case_n, safe_call):
2831 Arg counts are now ptrdiff_t, not size_t.
2832 All variadic functions and their callers changed accordingly.
2833 (struct gcpro.nvars): Now size_t, not size_t. All uses changed.
2834 * bytecode.c (exec_byte_code): Check maxdepth for overflow,
2835 to avoid potential buffer overrun. Don't assume arg counts fit in 'int'.
2836 * callint.c (Fcall_interactively): Check arg count for overflow,
2837 to avoid potential buffer overrun. Use signed char, not 'int',
2838 for 'varies' array, so that we needn't bother to check its size
2839 calculation for overflow.
2840 * editfns.c (Fformat): Use ptrdiff_t, not EMACS_INT, to count args.
2841 * eval.c (apply_lambda):
2842 * fns.c (Fmapconcat): Use XFASTINT, not XINT, to get args length.
2843 (struct textprop_rec.argnum): Now ptrdiff_t, not int. All uses changed.
2844 (mapconcat): Use ptrdiff_t, not int and EMACS_INT, to count args.
2845
a1759b76
PE
2846 * callint.c (Fcall_interactively): Don't use index var as event count.
2847
d96be9fc
PE
2848 * vm-limit.c (check_memory_limits): Fix incorrect extern function decls.
2849 * mem-limits.h (SIZE): Remove; no longer used.
2850
a690a978 2851 * xterm.c (x_alloc_nearest_color_1): Prefer int to long when int works.
5efd304b 2852
578c21e6
PE
2853 Remove unnecessary casts.
2854 * xterm.c (x_term_init):
2855 * xfns.c (x_set_border_pixel):
2856 * widget.c (create_frame_gcs): Remove casts to unsigned long etc.
2857 These aren't needed now that we assume ANSI C.
2858
96f53c6c
PE
2859 * sound.c (Fplay_sound_internal): Remove cast to unsigned long.
2860 It's more likely to cause problems (due to unsigned overflow)
2861 than to cure them.
2862
83c77d31
PE
2863 * dired.c (Ffile_attributes): Don't use 32-bit hack on 64-bit hosts.
2864
ee2079f1
PE
2865 * unexelf.c (unexec): Don't assume BSS addr fits in unsigned.
2866
6da65536
PE
2867 * xterm.c (handle_one_xevent): Omit unnecessary casts to unsigned.
2868
7147c4a4
PE
2869 * keyboard.c (modify_event_symbol): Don't limit alist len to UINT_MAX.
2870
193e32d9
PE
2871 * lisp.h (CHAR_TABLE_SET): Omit now-redundant test.
2872
e5533da6
PE
2873 * lread.c (Fload): Don't compare a possibly-garbage time_t value.
2874
9910e595
PE
2875 GLYPH_CODE_FACE returns EMACS_INT, not int.
2876 * dispextern.h (merge_faces):
2877 * xfaces.c (merge_faces):
01103c44
PE
2878 * xdisp.c (get_next_display_element, next_element_from_display_vector):
2879 Don't assume EMACS_INT fits in int.
9910e595 2880
2638320e
PE
2881 * character.h (CHAR_VALID_P): Remove unused parameter.
2882 * fontset.c, lisp.h, xdisp.c: All uses changed.
2883
045eb8d9
PE
2884 * editfns.c (Ftranslate_region_internal): Omit redundant test.
2885
c1f134b5
PE
2886 * fns.c (concat): Minor tuning based on overflow analysis.
2887 This doesn't fix any bugs. Use int to hold character, instead
2888 of constantly refetching from Emacs object. Use XFASTINT, not
2889 XINT, for value known to be a character. Don't bother comparing
2890 a single byte to 0400, as it's always less.
2891
395fcb93 2892 * floatfns.c (Fexpt):
327eeec8
PE
2893 * fileio.c (make_temp_name): Omit unnecessary cast to unsigned.
2894
abbd3d23
PE
2895 * editfns.c (Ftranslate_region_internal): Use int, not EMACS_INT
2896 for characters.
2897
684a03ef
PE
2898 * doc.c (get_doc_string): Omit (unsigned)c that mishandled negatives.
2899
0fed43f3
PE
2900 * data.c (Faset): If ARRAY is a string, check that NEWELT is a char.
2901 Without this fix, on a 64-bit host (aset S 0 4294967386) would
2902 incorrectly succeed when S was a string, because 4294967386 was
2903 truncated before it was used.
2904
8fd02eb7
PE
2905 * chartab.c (Fchar_table_range): Use CHARACTERP to check range.
2906 Otherwise, an out-of-range integer could cause undefined behavior
2907 on a 64-bit host.
2908
f8c86b69
PE
2909 * composite.c: Use int, not EMACS_INT, for characters.
2910 (fill_gstring_body, composition_compute_stop_pos): Use int, not
2911 EMACS_INT, for values that are known to be in character range.
2912 This doesn't fix any bugs but is the usual style inside Emacs and
2913 may generate better code on 32-bit machines.
2914
34206dd2
PE
2915 Make sure a 64-bit char is never passed to ENCODE_CHAR.
2916 This is for reasons similar to the recent CHAR_STRING fix.
2917 * charset.c (Fencode_char): Check that character arg is actually
2918 a character. Pass an int to ENCODE_CHAR.
2919 * charset.h (ENCODE_CHAR): Verify that the character argument is no
2920 wider than 'int', as a compile-time check to prevent future regressions
2921 in this area.
2922
c5958d4c 2923 * character.c (char_string): Remove unnecessary casts.
13bdea59
PE
2924
2925 Make sure a 64-bit char is never passed to CHAR_STRING.
2926 Otherwise, CHAR_STRING would do the wrong thing on a 64-bit platform,
2927 by silently ignoring the top 32 bits, allowing some values
2928 that were far too large to be valid characters.
2929 * character.h: Include <verify.h>.
2930 (CHAR_STRING, CHAR_STRING_ADVANCE): Verify that the character
2931 arguments are no wider than unsigned, as a compile-time check
2932 to prevent future regressions in this area.
2933 * data.c (Faset):
01103c44 2934 * editfns.c (Fchar_to_string, general_insert_function, Finsert_char)
13bdea59
PE
2935 (Fsubst_char_in_region):
2936 * fns.c (concat):
2937 * xdisp.c (decode_mode_spec_coding):
2938 Adjust to CHAR_STRING's new requirement.
2939 * editfns.c (Finsert_char, Fsubst_char_in_region):
2940 * fns.c (concat): Check that character args are actually
2941 characters. Without this test, these functions did the wrong
2942 thing with wildly out-of-range values on 64-bit hosts.
2943
d37ca623
PE
2944 Remove incorrect casts to 'unsigned' that lose info on 64-bit hosts.
2945 These casts should not be needed on 32-bit hosts, either.
2946 * keyboard.c (read_char):
2947 * lread.c (Fload): Remove casts to unsigned.
2948
ea204efb
PE
2949 * lisp.h (UNSIGNED_CMP): New macro.
2950 This fixes comparison bugs on 64-bit hosts.
2951 (ASCII_CHAR_P): Use it.
2952 * casefiddle.c (casify_object):
01103c44 2953 * character.h (ASCII_BYTE_P, CHAR_VALID_P)
ea204efb
PE
2954 (SINGLE_BYTE_CHAR_P, CHAR_STRING):
2955 * composite.h (COMPOSITION_ENCODE_RULE_VALID):
2956 * dispextern.h (FACE_FROM_ID):
2957 * keyboard.c (read_char): Use UNSIGNED_CMP.
2958
41cb286c
PE
2959 * xmenu.c (dialog_selection_callback) [!USE_GTK]: Cast to intptr_t,
2960 not to EMACS_INT, to avoid GCC warning.
2961
4a1b9832
PE
2962 * xfns.c (x_set_scroll_bar_default_width): Remove unused 'int' locals.
2963
55daad71
PE
2964 * buffer.h (PTR_BYTE_POS, BUF_PTR_BYTE_POS): Remove harmful cast.
2965 The cast incorrectly truncated 64-bit byte offsets to 32 bits, and
2966 isn't needed on 32-bit machines.
8f95c75c 2967
01103c44
PE
2968 * buffer.c (Fgenerate_new_buffer_name):
2969 Use EMACS_INT for count, not int.
0ceccced 2970 (advance_to_char_boundary): Return EMACS_INT, not int.
e762cafe
PE
2971
2972 * data.c (Qcompiled_function): Now static.
2973
c6f072e7
PE
2974 * window.c (window_body_lines): Now static.
2975
20ce5912
PE
2976 * image.c (gif_load): Rename local to avoid shadowing.
2977
9c4c5f81
PE
2978 * lisp.h (SAFE_ALLOCA_LISP): Check for integer overflow.
2979 (struct Lisp_Save_Value): Use ptrdiff_t, not int, for 'integer' member.
2980 * alloc.c (make_save_value): Integer argument is now of type
2981 ptrdiff_t, not int.
2982 (mark_object): Use ptrdiff_t, not int.
2983 * lisp.h (pD): New macro.
2984 * print.c (print_object): Use it.
2985
c0c5c8ae
PE
2986 * alloc.c: Use EMACS_INT, not int, to count objects.
2987 (total_conses, total_markers, total_symbols, total_vector_size)
2988 (total_free_conses, total_free_markers, total_free_symbols)
01103c44
PE
2989 (total_free_floats, total_floats, total_free_intervals)
2990 (total_intervals, total_strings, total_free_strings):
c0c5c8ae
PE
2991 Now EMACS_INT, not int. All uses changed.
2992 (Fgarbage_collect): Compute overall total using a double, so that
2993 integer overflow is less likely to be a problem. Check for overflow
2994 when converting back to an integer.
5a25e253
PE
2995 (n_interval_blocks, n_string_blocks, n_float_blocks, n_cons_blocks)
2996 (n_vectors, n_symbol_blocks, n_marker_blocks): Remove.
2997 These were 'int' variables that could overflow on 64-bit hosts;
2998 they were never used, so remove them instead of repairing them.
211a0b2a 2999 (nzombies, ngcs, max_live, max_zombies): Now EMACS_INT, not 'int'.
6349ae4d
PE
3000 (inhibit_garbage_collection): Set gc_cons_threshold to max value.
3001 Previously, this ceilinged at INT_MAX, but that doesn't work on
3002 64-bit machines.
e46bb31a 3003 (allocate_pseudovector): Don't use EMACS_INT when int would do.
c0c5c8ae 3004
c78baabf 3005 * alloc.c (Fmake_bool_vector): Don't assume vector size fits in int.
86f61a15 3006 (allocate_vectorlike): Check for ptrdiff_t overflow.
b6439961
PE
3007 (mark_vectorlike, mark_char_table, mark_object): Avoid EMACS_UINT
3008 when a (possibly-narrower) signed value would do just as well.
3009 We prefer using signed arithmetic, to avoid comparison confusion.
c78baabf 3010
c9d624c6
PE
3011 * alloc.c: Catch some string size overflows that we were missing.
3012 (XMALLOC_OVERRUN_CHECK_SIZE) [!XMALLOC_OVERRUN_CHECK]: Define to 0,
3013 for convenience in STRING_BYTES_MAX.
3014 (STRING_BYTES_MAX): New macro, superseding the old one in lisp.h.
3015 The definition here is exact; the one in lisp.h was approximate.
3016 (allocate_string_data): Check for string overflow. This catches
3017 some instances we weren't catching before. Also, it catches
3018 size_t overflow on (unusual) hosts where SIZE_MAX <= min
3019 (PTRDIFF_MAX, MOST_POSITIVE_FIXNUM), e.g., when size_t is 32 bits
3020 and ptrdiff_t and EMACS_INT are both 64 bits.
c78baabf 3021
c9d624c6
PE
3022 * character.c, coding.c, doprnt.c, editfns.c, eval.c:
3023 All uses of STRING_BYTES_MAX replaced by STRING_BYTES_BOUND.
640c8776 3024 * lisp.h (STRING_BYTES_BOUND): Rename from STRING_BYTES_MAX.
c9d624c6 3025
353032ce
PE
3026 * character.c (string_escape_byte8): Fix nbytes/nchars typo.
3027
2bccce07
PE
3028 * alloc.c (Fmake_string): Check for out-of-range init.
3029
0ac30604
SM
30302011-06-15 Stefan Monnier <monnier@iro.umontreal.ca>
3031
3032 * eval.c (Fdefvaralias): Also mark the target as variable-special-p.
3033
c195f2de
JD
30342011-06-14 Jan Djärv <jan.h.d@swipnet.se>
3035
3036 * xfns.c (x_set_scroll_bar_default_width): Remove argument to
3037 xg_get_default_scrollbar_width.
3038
3039 * gtkutil.c: Include emacsgtkfixed.h if HAVE_GTK3.
3040 (int_gtk_range_get_value): Move to the scroll bar part of the file.
3041 (style_changed_cb): Call update_theme_scrollbar_width and call
3042 x_set_scroll_bar_default_width and xg_frame_set_char_size for
3043 all frames (Bug#8505).
3044 (xg_create_frame_widgets): Call emacs_fixed_new if HAVE_GTK3 (Bug#8505).
3045 Call gtk_window_set_resizable if HAVE_GTK3.
3046 (x_wm_set_size_hint): Call emacs_fixed_set_min_size with min width
3047 and height if HAVE_GTK3 (Bug#8505).
3048 (scroll_bar_width_for_theme): New variable.
3049 (update_theme_scrollbar_width): New function.
3050 (xg_get_default_scrollbar_width): Move code to
3051 update_theme_scrollbar_width, just return scroll_bar_width_for_theme.
3052 (xg_initialize): Call update_theme_scrollbar_width.
3053
3054 * gtkutil.h (xg_get_default_scrollbar_width): Remove argument.
3055
3056 * emacsgtkfixed.c, emacsgtkfixed.h: New files.
3057
e10ac9f1
MR
30582011-06-12 Martin Rudalics <rudalics@gmx.at>
3059
3060 * frame.c (make_frame): Call other_buffer_safely instead of
3061 other_buffer.
3062
3063 * window.c (temp_output_buffer_show): Call display_buffer with
3064 second argument Vtemp_buffer_show_specifiers and reset latter
3065 immediately after the call.
3066 (Vtemp_buffer_show_specifiers): New variable.
3067 (auto_window_vscroll_p, next_screen_context_lines)
3068 (Vscroll_preserve_screen_position): Remove leading asterisks from
3069 doc-strings.
3070
2d3c217e 30712011-06-12 Paul Eggert <eggert@cs.ucla.edu>
4475bec4 3072
7b7f97e8 3073 Fix minor problems found by GCC 4.6.0 static checking.
4475bec4
PE
3074 * buffer.c (Qclone_number): Remove for now, as it's unused.
3075 (record_buffer, Funrecord_buffer): Rename local to avoid shadowing.
3076 (record_buffer): Remove unused local.
3077 * frame.c (other_visible_frames, frame_buffer_list): Now static.
3078 (set_frame_buffer_list): Remove; unused.
3079 * frame.h (other_visible_frames): Remove decl.
3080 * keyboard.h (menu_items_inuse): Declare only if USE_GTK || USE_MOTIF.
3081 * lisp.h (frame_buffer_list, set_frame_buffer_list): Remove decls.
3082 (add_gpm_wait_descriptor, delete_gpm_wait_descriptor): Declare only
3083 if HAVE_GPM.
3084 * menu.c (menu_items_inuse): Now static unless USE_GTK || USE_MOTIF.
3085 * process.c (add_gpm_wait_descriptor, delete_gpm_wait_descriptor):
3086 Define only if HAVE_GPM.
3087 * widget.c (EmacsFrameResize, emacsFrameClassRec): Now static.
3088 (update_hints_inhibit): Remove; never set. All uses removed.
3089 * widgetprv.h (emacsFrameClassRec): Remove decl.
3090 * window.c (delete_deletable_window): Now returns void, since it
3091 wasn't returning anything.
3092 (compare_window_configurations): Remove unused locals.
3093 * xfns.c (x_set_scroll_bar_default_width): Remove unused locals.
3094 * xmenu.c (x_menu_set_in_use): Define only if USE_GTK || USE_MOTIF.
4475bec4
PE
3095 (dialog_selection_callback) [!USE_GTK]: Prefer intptr_t for integers
3096 the same widths as pointers. This follows up on the 2011-05-06 patch.
3097 * xterm.c (x_alloc_lighter_color_for_widget): Define only if USE_LUCID.
3098 * xterm.h: Likewise.
3099 (x_menu_set_in_use): Declare only if USE_GTK || USE_MOTIF.
3100
1384b89e
JB
31012011-06-12 Juanma Barranquero <lekktu@gmail.com>
3102
3103 * makefile.w32-in: Update dependencies.
3104 (LISP_H): Add lib/intprops.h.
3105
1100a63c
CY
31062011-06-11 Chong Yidong <cyd@stupidchicken.com>
3107
3108 * image.c (gif_load): Add animation frame delay to the metadata.
3109 (syms_of_image): Use DEFSYM. New symbol `delay'.
3110
6198ccd0
MR
31112011-06-11 Martin Rudalics <rudalics@gmx.at>
3112
3113 * window.c (delete_deletable_window): Re-add.
3114 (Fset_window_configuration): Rewrite to handle dead buffers and
3115 consequently deletable windows.
3116 (window_tree, Fwindow_tree): Remove. Supply functionality in
3117 window.el.
3118 (compare_window_configurations): Simplify code.
3119
b6e3633c
AS
31202011-06-11 Andreas Schwab <schwab@linux-m68k.org>
3121
1ab0dee5
AS
3122 * image.c (imagemagick_load_image): Fix type mismatch.
3123 (Fimagemagick_types): Likewise.
3124
b6e3633c
AS
3125 * window.h (replace_buffer_in_windows): Declare.
3126
9397e56f
MR
31272011-06-11 Martin Rudalics <rudalics@gmx.at>
3128
3129 * buffer.c: New Lisp objects Qbuffer_list_update_hook and
3130 Qclone_number. Remove external declaration of Qdelete_window.
3131 (Fbuffer_list): Rewrite doc-string. Minor restructuring of
3132 code.
640c8776
SM
3133 (Fget_buffer_create, Fmake_indirect_buffer, Frename_buffer):
3134 Run Qbuffer_list_update_hook if allowed.
9397e56f
MR
3135 (Fother_buffer): Rewrite doc-string. Major rewrite for new
3136 buffer list implementation.
3137 (other_buffer_safely): New function.
3138 (Fkill_buffer): Replace call to replace_buffer_in_all_windows by
3139 calls to replace_buffer_in_windows and
3140 replace_buffer_in_windows_safely. Run Qbuffer_list_update_hook
3141 if allowed.
3142 (record_buffer): Inhibit quitting and rewrite using quittable
3143 functions. Run Qbuffer_list_update_hook if allowed.
3144 (Frecord_buffer, Funrecord_buffer): New functions.
640c8776
SM
3145 (switch_to_buffer_1, Fswitch_to_buffer): Remove.
3146 Move switch-to-buffer to window.el.
9397e56f
MR
3147 (bury-buffer): Move to window.el.
3148 (Vbuffer_list_update_hook): New variable.
3149
3150 * lisp.h (other_buffer_safely): Add prototype in buffer.c
3151 section.
3152
3153 * window.h (resize_frame_windows): Move up in code.
3154 (Fwindow_frame): Remove EXFUN.
3155 (replace_buffer_in_all_windows): Remove prototype.
3156 (replace_buffer_in_windows_safely): Add prototype.
3157
3158 * window.c: Declare Qdelete_window static again. Move down
3159 declaration of select_count.
3160 (Fnext_window, Fprevious_window): Rewrite doc-strings.
3161 (Fother_window): Move to window.el.
3162 (window_loop): Remove DELETE_BUFFER_WINDOWS and UNSHOW_BUFFER
3163 cases. Add REPLACE_BUFFER_IN_WINDOWS_SAFELY case.
3164 (Fdelete_windows_on, Freplace_buffer_in_windows): Move to
3165 window.el.
3166 (replace_buffer_in_windows): Implement by calling
3167 Qreplace_buffer_in_windows.
3168 (replace_buffer_in_all_windows): Remove with some functionality
3169 moved into replace_buffer_in_windows_safely.
3170 (replace_buffer_in_windows_safely): New function.
3171 (select_window_norecord, select_frame_norecord): Move in front
3172 of run_window_configuration_change_hook. Remove now obsolete
3173 declarations.
640c8776
SM
3174 (Fset_window_buffer): Rewrite doc-string.
3175 Call Qrecord_window_buffer.
9397e56f
MR
3176 (keys_of_window): Move binding for other-window to window.el.
3177
b50691aa
CY
31782011-06-11 Chong Yidong <cyd@stupidchicken.com>
3179
3180 * dispextern.h (struct image): Replace data member, whose int_val
3181 and ptr_val fields were not used by anything, with a single
3182 lisp_val object.
3183
3184 * image.c (Fimage_metadata, make_image, mark_image, tiff_load)
3185 (gif_clear_image, gif_load, imagemagick_load_image)
3186 (gs_clear_image, gs_load): Callers changed.
3187
3f754b86
PE
31882011-06-10 Paul Eggert <eggert@cs.ucla.edu>
3189
cca69397
PE
3190 * buffer.h: Include <time.h>, for time_t.
3191 Needed to build on FreeBSD 8.2. Problem reported by Herbert J. Skuhra.
3192
109e28d0
PE
3193 Fix minor problems found by static checking.
3194
60737f02
PE
3195 * image.c (PixelGetMagickColor): Declare if ImageMagick headers don't.
3196
4b66faf3
PE
3197 Make identifiers static if they are not used in other modules.
3198 * data.c (Qcompiled_function, Qframe, Qvector):
3199 * image.c (QimageMagick, Qsvg):
3200 * minibuf.c (Qmetadata):
3201 * window.c (resize_window_check, resize_root_window): Now static.
3202 * window.h (resize_window_check, resize_root_window): Remove decls.
3203
109e28d0
PE
3204 * window.c (window_deletion_count, delete_deletable_window):
3205 Remove; unused.
46a4ce9e
PE
3206 (window_body_lines): Now static.
3207 (Fdelete_other_windows_internal): Mark vars as initialized.
3208 Make sure 'resize_failed' is initialized.
3209 (run_window_configuration_change_hook): Rename local to avoid shadowing.
3210 (resize_window_apply): Remove unused local.
3211 * window.h (delete_deletable_window): Remove decl.
3212
109e28d0 3213 * image.c (gif_load, svg_load_image): Rename locals to avoid shadowing.
33290528
PE
3214 (imagemagick_load_image): Fix pointer signedness problem by changing
3215 last arg from unsigned char * to char *. All uses changed.
3216 Also, fix a local for similar reasons.
3217 Remove unused locals. Remove locals to avoid shadowing.
3218 (fn_rsvg_handle_free): Remove; unused.
3219 (svg_load, svg_load_image): Fix pointer signedness problem.
f7e13da3 3220 (imagemagick_load_image): Don't use garbage pointer image_wand.
33290528 3221
3f754b86
PE
3222 * ftfont.c (ftfont_get_metrics, ftfont_drive_otf): Remove unused locals.
3223
2547adb1
CY
32242011-06-10 Chong Yidong <cyd@stupidchicken.com>
3225
3226 * image.c (gif_load): Fix omitted cast error introduced by
3227 2011-06-06 change.
3228
2c8e37d4
MR
32292011-06-10 Martin Rudalics <rudalics@gmx.at>
3230
3231 * window.h (resize_proportionally, orig_total_lines)
3232 (orig_top_line): Remove from window structure.
3233 (set_window_height, set_window_width, change_window_heights)
3234 (Fdelete_window): Remove prototypes.
3235 (resize_frame_windows): Remove duplicate declaration.
3236
440a42e3
EZ
32372011-06-10 Eli Zaretskii <eliz@gnu.org>
3238
3239 * window.h (resize_frame_windows, resize_window_check)
3240 (delete_deletable_window, resize_root_window)
3241 (resize_frame_windows): Declare prototypes.
3242
3243 * window.c (resize_window_apply): Make definition be "static" to
3244 match the prototype.
3245
562dd5e9
MR
32462011-06-10 Martin Rudalics <rudalics@gmx.at>
3247
3248 * window.c: Remove declarations of Qwindow_size_fixed,
3249 window_min_size_1, window_min_size_2, window_min_size,
3250 size_window, window_fixed_size_p, enlarge_window, delete_window.
3251 Remove static from declaration of Qdelete_window, it's
3252 temporarily needed by Fbury_buffer.
3253 (replace_window): Don't assign orig_top_line and
3254 orig_total_lines.
3255 (Fdelete_window, delete_window): Remove. Window deletion is
3256 handled by window.el.
640c8776
SM
3257 (window_loop): Remove DELETE_OTHER_WINDOWS case.
3258 Replace Fdelete_window calls with calls to Qdelete_window.
562dd5e9
MR
3259 (Fdelete_other_windows): Remove. Deleting other windows is
3260 handled by window.el.
3261 (window_fixed_size_p): Remove. Fixed-sizeness of windows is
3262 handled in window.el.
3263 (window_min_size_2, window_min_size_1, window_min_size): Remove.
3264 Window minimum sizes are handled in window.el.
3265 (shrink_windows, size_window, set_window_height)
3266 (set_window_width, change_window_heights, window_height)
3267 (window_width, CURBEG, CURSIZE, enlarge_window)
3268 (adjust_window_trailing_edge, Fadjust_window_trailing_edge)
3269 (Fenlarge_window, Fshrink_window): Remove. Window resizing is
3270 handled in window.el.
3271 (make_dummy_parent): Rename to make_parent_window and give it a
3272 second argument horflag.
3273 (make_window): Don't set resize_proportionally any more.
3274 (Fsplit_window): Remove. Windows are split in window.el.
3275 (save_restore_action, save_restore_orig_size)
3276 (shrink_window_lowest_first, save_restore_orig_size): Remove.
3277 Resize mini windows in window.el.
3278 (grow_mini_window, shrink_mini_window): Implement by calling
3279 Qresize_root_window_vertically, resize_window_check and
3280 resize_window_apply.
640c8776
SM
3281 (saved_window, Fset_window_configuration, save_window_save):
3282 Do not handle orig_top_line, orig_total_lines, and
562dd5e9
MR
3283 resize_proportionally.
3284 (window_min_height, window_min_width): Move to window.el.
3285 (keys_of_window): Move bindings for delete-other-windows,
3286 split-window, delete-window and enlarge-window to window.el.
3287
3288 * buffer.c: Temporarily extern Qdelete_window.
3289 (Fbury_buffer): Temporarily call Qdelete_window instead of
3290 Fdelete_window (Fbury_buffer will move to window.el soon).
3291
3292 * frame.c (set_menu_bar_lines_1): Remove code handling
3293 orig_top_line and orig_total_lines.
3294
3295 * dispnew.c (adjust_frame_glyphs_initially): Don't use
3296 set_window_height but set heights directly.
3297 (change_frame_size_1): Use resize_frame_windows.
3298
3299 * xdisp.c (init_xdisp): Don't use set_window_height but set
3300 heights directly.
3301
640c8776
SM
3302 * xfns.c (x_set_menu_bar_lines, x_set_tool_bar_lines):
3303 Use resize_frame_windows instead of change_window_heights and run
562dd5e9
MR
3304 run_window_configuration_change_hook.
3305
3306 * w32fns.c (x_set_tool_bar_lines): Use resize_frame_windows
3307 instead of change_window_heights and run
3308 run_window_configuration_change_hook.
3309
1a13852e
MR
33102011-06-09 Martin Rudalics <rudalics@gmx.at>
3311
3312 * window.c (replace_window): Rename second argument REPLACEMENT to
3313 NEW. New third argument SETFLAG. Rewrite.
3314 (delete_window, make_dummy_parent): Call replace_window with
3315 third argument 1.
3316 (window_list_1): Move down in code.
3317 (run_window_configuration_change_hook): Move set_buffer part
3318 before select_frame_norecord part in order to unwind correctly.
3319 Rename count1 to count.
3320 (recombine_windows, delete_deletable_window, resize_root_window)
3321 (Fdelete_other_windows_internal)
3322 (Frun_window_configuration_change_hook, make_parent_window)
3323 (resize_window_check, resize_window_apply, Fresize_window_apply)
3324 (resize_frame_windows, Fsplit_window_internal)
640c8776
SM
3325 (Fdelete_window_internal, Fresize_mini_window_internal):
3326 New functions.
1a13852e
MR
3327 (syms_of_window): New variables Vwindow_splits and Vwindow_nest.
3328
f3d1777e
MR
33292011-06-08 Martin Rudalics <rudalics@gmx.at>
3330
496e208e
MR
3331 * window.h (window): Add some new members to window structure -
3332 normal_lines, normal_cols, new_total, new_normal, clone_number,
3333 splits, nest, prev_buffers, next_buffers.
3334 (WINDOW_TOTAL_SIZE): Move here from window.c.
b9e809c2 3335 (MIN_SAFE_WINDOW_WIDTH, MIN_SAFE_WINDOW_HEIGHT): Define here.
496e208e 3336
f3d1777e
MR
3337 * window.c (Fwindow_height, Fwindow_width, Fwindow_full_width_p):
3338 Remove.
496e208e
MR
3339 (make_dummy_parent): Set new members of windows structure.
3340 (make_window): Move down in code. Handle new members of window
3341 structure.
3342 (Fwindow_clone_number, Fwindow_splits, Fset_window_splits)
3343 (Fwindow_nest, Fset_window_nest, Fwindow_new_total)
3344 (Fwindow_normal_size, Fwindow_new_normal, Fwindow_prev_buffers)
3345 (Fset_window_prev_buffers, Fwindow_next_buffers)
640c8776
SM
3346 (Fset_window_next_buffers, Fset_window_clone_number):
3347 New functions.
496e208e
MR
3348 (Fwindow_hscroll, Fwindow_at, Fwindow_point, Fwindow_start)
3349 (Fwindow_end, Fwindow_line_height, Fset_window_dedicated_p):
3350 Doc-string fixes.
3351 (Fwindow_parameters, Fwindow_parameter, Fset_window_parameter):
3352 Argument WINDOW can be now internal window too.
3353 (Fwindow_use_time): Move up in code.
3354 (Fget_buffer_window): Rename argument FRAME to ALL-FRAMES.
3355 Rewrite doc-string.
3356 (Fset_window_configuration, saved_window)
3357 (Fcurrent_window_configuration, save_window_save): Handle new
3358 members of window structure.
b9e809c2
MR
3359 (WINDOW_TOTAL_SIZE, MIN_SAFE_WINDOW_WIDTH)
3360 (MIN_SAFE_WINDOW_HEIGHT): Move to window.h.
3361 (syms_of_window): New Lisp objects Qrecord_window_buffer,
3362 Qwindow_deletable_p, Qdelete_window, Qreplace_buffer_in_windows,
3363 Qget_mru_window, Qresize_root_window,
3364 Qresize_root_window_vertically, Qsafe, Qabove, Qbelow,
3365 Qauto_buffer_name; staticpro them.
f3d1777e 3366
abde8f8c
MR
33672011-06-07 Martin Rudalics <rudalics@gmx.at>
3368
3369 * window.c (Fwindow_total_size, Fwindow_left_column)
3370 (Fwindow_top_line, window_body_lines, Fwindow_body_size)
3371 (Fwindow_list_1): New functions.
3372 (window_box_text_cols): Replace with window_body_cols.
640c8776
SM
3373 (Fwindow_width, Fscroll_left, Fscroll_right):
3374 Use window_body_cols instead of window_box_text_cols.
3375 (delete_window, Fset_window_configuration):
3376 Call delete_all_subwindows with window as argument.
fa8a67e6
MR
3377 (delete_all_subwindows): Take a window as argument and not a
3378 structure. Rewrite.
190b47e6
MR
3379 (window_loop): Remove handling of GET_LRU_WINDOW and
3380 GET_LARGEST_WINDOW.
3381 (Fget_lru_window, Fget_largest_window): Move to window.el.
abde8f8c
MR
3382
3383 * window.h: Extern window_body_cols instead of
fa8a67e6
MR
3384 window_box_text_cols. delete_all_subwindows now takes a
3385 Lisp_Object as argument.
abde8f8c 3386
640c8776
SM
3387 * indent.c (compute_motion, Fcompute_motion):
3388 Use window_body_cols instead of window_box_text_cols.
abde8f8c 3389
fa8a67e6
MR
3390 * frame.c (delete_frame): Call delete_all_subwindows with root
3391 window as argument.
3392
a54e3482
DC
33932011-06-07 Daniel Colascione <dan.colascione@gmail.com>
3394
3395 * fns.c (Fputhash): Document return value.
3396
60002bf5
CY
33972011-06-06 Chong Yidong <cyd@stupidchicken.com>
3398
3399 * image.c (gif_load): Implement gif89a spec "no disposal" method.
3400
0c671da6 34012011-06-06 Paul Eggert <eggert@cs.ucla.edu>
ccd9a01a 3402
b862a52a 3403 Cons<->int and similar integer overflow fixes (Bug#8794).
77984278 3404
be44ca6c
PE
3405 Check for overflow when converting integer to cons and back.
3406 * charset.c (Fdefine_charset_internal, Fdecode_char):
3407 Use cons_to_unsigned to catch overflow.
3408 (Fencode_char): Use INTEGER_TO_CONS.
3409 * composite.h (LGLYPH_CODE): Use cons_to_unsigned.
3410 (LGLYPH_SET_CODE): Use INTEGER_TO_CONS.
3411 * data.c (long_to_cons, cons_to_long): Remove.
3412 (cons_to_unsigned, cons_to_signed): New functions.
3413 These signal an error for invalid or out-of-range values.
3414 * dired.c (Ffile_attributes): Use INTEGER_TO_CONS.
3415 * fileio.c (Fset_visited_file_modtime): Use CONS_TO_INTEGER.
3416 * font.c (Ffont_variation_glyphs):
3417 * fontset.c (Finternal_char_font): Use INTEGER_TO_CONS.
3418 * lisp.h: Include <intprops.h>.
3419 (INTEGER_TO_CONS, CONS_TO_INTEGER): New macros.
3420 (cons_to_signed, cons_to_unsigned): New decls.
3421 (long_to_cons, cons_to_long): Remove decls.
3422 * undo.c (record_first_change): Use INTEGER_TO_CONS.
3423 (Fprimitive_undo): Use CONS_TO_INTEGER.
3424 * xfns.c (Fx_window_property): Likewise.
3425 * xselect.c: Include <limits.h>.
3426 (x_own_selection, selection_data_to_lisp_data):
3427 Use INTEGER_TO_CONS.
3428 (x_handle_selection_request, x_handle_selection_clear)
3429 (x_get_foreign_selection, Fx_disown_selection_internal)
3430 (Fx_get_atom_name, x_send_client_event): Use CONS_TO_INTEGER.
3431 (lisp_data_to_selection_data): Use cons_to_unsigned.
3432 (x_fill_property_data): Use cons_to_signed.
3433 Report values out of range.
3434
d1f3d2af
PE
3435 Check for buffer and string overflow more precisely.
3436 * buffer.h (BUF_BYTES_MAX): New macro.
3437 * lisp.h (STRING_BYTES_MAX): New macro.
3438 * alloc.c (Fmake_string):
3439 * character.c (string_escape_byte8):
3440 * coding.c (coding_alloc_by_realloc):
3441 * doprnt.c (doprnt):
3442 * editfns.c (Fformat):
3443 * eval.c (verror):
3444 Use STRING_BYTES_MAX, not MOST_POSITIVE_FIXNUM,
3445 since they may not be the same number.
3446 * editfns.c (Finsert_char):
3447 * fileio.c (Finsert_file_contents):
3448 Likewise for BUF_BYTES_MAX.
3449
dd52fcea
PE
3450 * image.c: Use ptrdiff_t, not int, for sizes.
3451 (slurp_file): Switch from int to ptrdiff_t.
3452 All uses changed.
3453 (slurp_file): Check that file size fits in both size_t (for
3454 malloc) and ptrdiff_t (for sanity and safety).
3455
7f9bbdbb
PE
3456 * fileio.c (Fverify_visited_file_modtime): Avoid time overflow
3457 if b->modtime has its maximal value.
3458
dfe18f82
PE
3459 * dired.c (Ffile_attributes): Don't assume EMACS_INT has >32 bits.
3460
84acfcf0
PE
3461 Don't assume time_t can fit into int.
3462 * buffer.h (struct buffer.modtime): Now time_t, not int.
3463 * fileio.c (Fvisited_file_modtime): No need for time_t cast now.
3464 * undo.c (Fprimitive_undo): Use time_t, not int, for time_t value.
3465
ccd9a01a
PE
3466 Minor fixes for signed vs unsigned integers.
3467 * character.h (MAYBE_UNIFY_CHAR):
3468 * charset.c (maybe_unify_char):
3469 * keyboard.c (read_char, reorder_modifiers):
3470 XINT -> XFASTINT, since the integer must be nonnegative.
3471 * ftfont.c (ftfont_spec_pattern):
3472 * keymap.c (access_keymap, silly_event_symbol_error):
3473 XUINT -> XFASTINT, since the integer must be nonnegative.
3474 (Fsingle_key_description, preferred_sequence_p): XUINT -> XINT,
3475 since it makes no difference and we prefer signed.
3476 * keyboard.c (record_char): Use XUINT when all the neighbors do.
3477 (access_keymap): NATNUMP -> INTEGERP, since the integer must be
3478 nonnegative.
3479
d6d100dd
SM
34802011-06-06 Stefan Monnier <monnier@iro.umontreal.ca>
3481
3482 * window.h (Fwindow_frame): Declare.
3483
2b6148e4
PE
34842011-06-06 Paul Eggert <eggert@cs.ucla.edu>
3485
3486 * alloc.c: Simplify handling of large-request failures (Bug#8800).
3487 (SPARE_MEMORY): Always define.
3488 (LARGE_REQUEST): Remove.
3489 (memory_full): Use SPARE_MEMORY rather than LARGE_REQUEST.
3490
f230ecc9
MR
34912011-06-06 Martin Rudalics <rudalics@gmx.at>
3492
727e958e
MR
3493 * lisp.h: Move EXFUNS for Fframe_root_window,
3494 Fframe_first_window and Fset_frame_selected_window to window.h.
3495
3496 * window.h: Move EXFUNS for Fframe_root_window,
3497 Fframe_first_window and Fset_frame_selected_window here from
3498 lisp.h.
3499
3500 * frame.c (Fwindow_frame, Fframe_first_window)
3501 (Fframe_root_window, Fframe_selected_window)
3502 (Fset_frame_selected_window): Move to window.c.
3503 (Factive_minibuffer_window): Move to minibuf.c.
3504 (Fother_visible_frames_p): New function.
3505
3506 * minibuf.c (Factive_minibuffer_window): Move here from frame.c.
3507
f230ecc9
MR
3508 * window.c (decode_window, decode_any_window): Move up in code.
3509 (Fwindowp, Fwindow_live_p): Rewrite doc-strings.
3510 (inhibit_frame_unsplittable): Remove unused variable.
bf60a96b
MR
3511 (Fwindow_buffer): Move up and rewrite doc-string.
3512 (Fwindow_parent, Fwindow_vchild, Fwindow_hchild, Fwindow_next)
3513 (Fwindow_prev): New functions.
727e958e
MR
3514 (Fwindow_frame): Move here from frame.c. Accept any window as
3515 argument.
3516 (Fframe_root_window, Fframe_first_window)
3517 (Fframe_selected_window): Move here from frame.c. Accept frame
3518 or arbitrary window as argument. Update doc-strings.
3519 (Fminibuffer_window): Move up in code.
3520 (Fwindow_minibuffer_p): Move up in code and simplify.
d6d100dd
SM
3521 (Fset_frame_selected_window): Move here from frame.c.
3522 Marginal rewrite.
727e958e
MR
3523 (Fselected_window, select_window, Fselect_window): Move up in
3524 code. Minor doc-string fixes.
f230ecc9 3525
4d09bcf6
PE
35262011-06-06 Paul Eggert <eggert@cs.ucla.edu>
3527
3528 * alloc.c (memory_full) [SYSTEM_MALLOC]: Port to MacOS (Bug#8800).
3529 Do not assume that spare memory exists; that assumption is valid
3530 only if SYSTEM_MALLOC.
3531 (LARGE_REQUEST): New macro, so that the issue of large requests
3532 is separated from the issue of spare memory.
3533
810928a2
AS
35342011-06-05 Andreas Schwab <schwab@linux-m68k.org>
3535
172418ad
AS
3536 * editfns.c (Fformat): Correctly handle zero flag with hexadecimal
3537 format. (Bug#8806)
3538
43f862f7
AS
3539 * gtkutil.c (xg_get_default_scrollbar_width): Avoid warning.
3540
810928a2
AS
3541 * xfns.c (x_set_scroll_bar_default_width): Move declarations
3542 before statements.
3543
a059fe24
JD
35442011-06-05 Jan Djärv <jan.h.d@swipnet.se>
3545
3546 * gtkutil.c (xg_get_default_scrollbar_width): New function.
3547
3548 * gtkutil.h: Declare xg_get_default_scrollbar_width.
3549
3550 * xfns.c (x_set_scroll_bar_default_width): If USE_GTK, get
3551 min width by calling x_set_scroll_bar_default_width (Bug#8505).
3552
989bf368
JB
35532011-06-05 Juanma Barranquero <lekktu@gmail.com>
3554
3555 * xdisp.c (single_display_spec_intangible_p): Remove declaration.
3556
4b80f674
CY
35572011-06-04 Chong Yidong <cyd@stupidchicken.com>
3558
3559 * xselect.c (x_clipboard_manager_save): Remove redundant arg.
3560 (x_clipboard_manager_save): Add return value.
d6d100dd
SM
3561 (x_clipboard_manager_error_1, x_clipboard_manager_error_2):
3562 New error handlers.
4b80f674
CY
3563 (x_clipboard_manager_save_frame, x_clipboard_manager_save_all):
3564 Obey Vx_select_enable_clipboard_manager. Catch errors in
3565 x_clipboard_manager_save (Bug#8779).
3566 (Vx_select_enable_clipboard_manager): New variable.
de65b42c 3567 (x_get_foreign_selection): Reduce scope of x_catch_errors (Bug#8790).
4b80f674 3568
99a33b77 35692011-06-04 Dan Nicolaescu <dann@ics.uci.edu>
8b3115e7
DN
3570
3571 * emacs.c (main): Warn when starting a GTK emacs in daemon mode.
3572
99a33b77 35732011-06-04 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
14eca62f
YM
3574
3575 * fringe.c (update_window_fringes): Don't update overlay arrow bitmap
3576 in the current matrix if keep_current_p is non-zero.
3577
8264569d
EZ
35782011-06-04 Eli Zaretskii <eliz@gnu.org>
3579
3580 * bidi.c (bidi_level_of_next_char): Fix last change.
3581
57f97249
EZ
35822011-06-03 Eli Zaretskii <eliz@gnu.org>
3583
fec2107c 3584 Support bidi reordering of text covered by display properties.
57f97249 3585
fec2107c
EZ
3586 * bidi.c (bidi_copy_it): Use offsetof instead of emulating it.
3587 (bidi_fetch_char, bidi_fetch_char_advance): New functions.
3588 (bidi_cache_search, bidi_cache_iterator_state)
3589 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak)
d6d100dd
SM
3590 (bidi_level_of_next_char, bidi_move_to_visually_next):
3591 Support character positions inside a run of characters covered by a
fec2107c
EZ
3592 display string.
3593 (bidi_paragraph_init, bidi_resolve_explicit_1)
3594 (bidi_level_of_next_char): Call bidi_fetch_char and
3595 bidi_fetch_char_advance instead of FETCH_CHAR and
3596 FETCH_CHAR_ADVANCE.
3597 (bidi_init_it): Initialize new members.
3598 (LRE_CHAR, RLE_CHAR, PDF_CHAR, LRO_CHAR, RLO_CHAR): Remove macro
3599 definitions.
3600 (bidi_explicit_dir_char): Lookup character type in bidi_type_table,
3601 instead of using explicit *_CHAR codes.
d6d100dd
SM
3602 (bidi_resolve_explicit, bidi_resolve_weak):
3603 Use FETCH_MULTIBYTE_CHAR instead of FETCH_CHAR, as reordering of
fec2107c
EZ
3604 bidirectional text is supported only in multibyte buffers.
3605 (bidi_init_it): Accept additional argument FRAME_WINDOW_P and use
3606 it to initialize the frame_window_p member of struct bidi_it.
3607 (bidi_cache_iterator_state, bidi_resolve_explicit_1)
3608 (bidi_resolve_explicit, bidi_resolve_weak)
3609 (bidi_level_of_next_char, bidi_move_to_visually_next): Abort if
3610 bidi_it->nchars is non-positive.
3611 (bidi_level_of_next_char): Don't try to lookup the cache for the
3612 next/previous character if nothing is cached there yet, or if we
3613 were just reseat()'ed to a new position.
c40e2fb2 3614
0e14fe90
EZ
3615 * xdisp.c (set_cursor_from_row): Set start and stop points
3616 according to the row's direction when priming the loop that looks
3617 for the glyph on which to display cursor.
3618 (single_display_spec_intangible_p): Function deleted.
3619 (display_prop_intangible_p): Reimplement to call
3620 handle_display_spec instead of single_display_spec_intangible_p.
d6d100dd
SM
3621 Accept 3 additional arguments needed by handle_display_spec.
3622 This fixes incorrect cursor motion across display property with complex
0e14fe90
EZ
3623 values: lists, `(when COND...)' forms, etc.
3624 (single_display_spec_string_p): Support property values that are
3625 lists with the argument STRING its top-level element.
3626 (display_prop_string_p): Fix the condition for processing a
3627 property that is a list to be consistent with handle_display_spec.
fec2107c 3628 (handle_display_spec): New function, refactored from the
fc6f18ce
EZ
3629 last portion of handle_display_prop.
3630 (compute_display_string_pos): Accept additional argument
3631 FRAME_WINDOW_P. Call handle_display_spec to determine whether the
3632 value of a `display' property is a "replacing spec".
3633 (handle_single_display_spec): Accept 2 additional arguments BUFPOS
3634 and FRAME_WINDOW_P. If IT is NULL, don't set up the iterator from
3635 the display property, but just return a value indicating whether
3636 the display property will replace the characters it covers.
3637 (Fcurrent_bidi_paragraph_direction): Initialize the nchars and
3638 frame_window_p members of struct bidi_it.
d6d100dd
SM
3639 (compute_display_string_pos, compute_display_string_end):
3640 New functions.
fec2107c
EZ
3641 (push_it): Accept second argument POSITION, where pop_it should
3642 jump to continue iteration.
3643 (reseat_1): Initialize bidi_it.disp_pos.
fc6f18ce 3644
fec2107c
EZ
3645 * keyboard.c (adjust_point_for_property): Adjust the call to
3646 display_prop_intangible_p to its new signature.
fc6f18ce
EZ
3647
3648 * dispextern.h (struct bidi_it): New member frame_window_p.
fec2107c
EZ
3649 (bidi_init_it): Update prototypes.
3650 (display_prop_intangible_p): Update prototype.
d6d100dd
SM
3651 (compute_display_string_pos, compute_display_string_end):
3652 Declare prototypes.
fec2107c
EZ
3653 (struct bidi_it): New members nchars and disp_pos. ch_len is now
3654 EMACS_INT.
fc6f18ce 3655
40087514 36562011-06-02 Paul Eggert <eggert@cs.ucla.edu>
0de4bb68 3657
57f53182
PE
3658 Malloc failure behavior now depends on size of allocation.
3659 * alloc.c (buffer_memory_full, memory_full): New arg NBYTES.
3660 * lisp.h: Change signatures accordingly.
3661 * alloc.c, buffer.c, editfns.c, menu.c, minibuf.c, xterm.c:
3662 All callers changed. (Bug#8762)
3663
3664 * gnutls.c: Use Emacs's memory allocators.
3665 Without this change, the gnutls library would invoke malloc etc.
3666 directly, which causes problems on non-SYNC_INPUT hosts, and which
3667 runs afoul of improving memory_full behavior. (Bug#8761)
3668 (fn_gnutls_global_set_mem_functions): New macro or function pointer.
3669 (emacs_gnutls_global_init): Use it to specify xmalloc, xrealloc,
3670 xfree instead of the default malloc, realloc, free.
3671 (Fgnutls_boot): No need to check for memory allocation failure,
3672 since xmalloc does that for us.
3673
ac32cd99 3674 Remove arbitrary limit of 2**31 entries in hash tables. (Bug#8771)
3870d916
PE
3675 * category.c (hash_get_category_set):
3676 * ccl.c (ccl_driver):
3677 * charset.c (Fdefine_charset_internal):
3678 * charset.h (struct charset.hash_index):
3679 * composite.c (get_composition_id, gstring_lookup_cache)
3680 (composition_gstring_put_cache):
3681 * composite.h (struct composition.hash_index):
3682 * dispextern.h (struct image.hash):
3683 * fns.c (next_almost_prime, larger_vector, cmpfn_eql)
3684 (cmpfn_equal, cmpfn_user_defined, hashfn_eq, hashfn_eql)
3685 (hashfn_equal, hashfn_user_defined, make_hash_table)
3686 (maybe_resize_hash_table, hash_lookup, hash_put)
3687 (hash_remove_from_table, hash_clear, sweep_weak_table, SXHASH_COMBINE)
3688 (sxhash_string, sxhash_list, sxhash_vector, sxhash_bool_vector)
3689 (Fsxhash, Fgethash, Fputhash, Fmaphash):
3690 * image.c (make_image, search_image_cache, lookup_image)
3691 (xpm_put_color_table_h):
3692 * lisp.h (struct Lisp_Hash_Table):
0de4bb68 3693 * minibuf.c (Ftry_completion, Fall_completions, Ftest_completion):
ac389d0c 3694 * print.c (print): Use 'EMACS_UINT' and 'EMACS_INT'
3870d916 3695 for hashes and hash indexes, instead of 'unsigned' and 'int'.
40087514
PE
3696 * alloc.c (allocate_vectorlike):
3697 Check for overflow in vector size calculations.
3698 * ccl.c (ccl_driver):
3699 Check for overflow when converting EMACS_INT to int.
0de4bb68
PE
3700 * fns.c, image.c: Remove unnecessary static decls that would otherwise
3701 need to be updated by these changes.
40087514
PE
3702 * fns.c (make_hash_table, maybe_resize_hash_table):
3703 Check for integer overflow with large hash tables.
0de4bb68
PE
3704 (make_hash_table, maybe_resize_hash_table, Fmake_hash_table):
3705 Prefer the faster XFLOAT_DATA to XFLOATINT where either will do.
3706 (SXHASH_REDUCE): New macro.
3707 (sxhash_string, sxhash_list, sxhash_vector, sxhash_bool_vector):
3708 Use it instead of discarding useful hash info with large hash values.
3709 (sxhash_float): New function.
3710 (sxhash): Use it. No more need for "& INTMASK" due to above changes.
3711 * lisp.h (FIXNUM_BITS): New macro, useful for SXHASH_REDUCE etc.
40087514
PE
3712 (MOST_NEGATIVE_FIXNUM, MOST_POSITIVE_FIXNUM, INTMASK):
3713 Rewrite to use FIXNUM_BITS, as this simplifies things.
0de4bb68
PE
3714 (next_almost_prime, larger_vector, sxhash, hash_lookup, hash_put):
3715 Adjust signatures to match updated version of code.
3716 (consing_since_gc): Now EMACS_INT, since a single hash table can
3717 use more than INT_MAX bytes.
3718
698d32e2
DN
37192011-06-01 Dan Nicolaescu <dann@ics.uci.edu>
3720
3721 Make it possible to build with GCC-4.6+ -O2 -flto.
3722
3723 * emacs.c (__malloc_initialize_hook): Mark as EXTERNALLY_VISIBLE.
3724
fd6fa53f
SM
37252011-06-01 Stefan Monnier <monnier@iro.umontreal.ca>
3726
3727 * minibuf.c (get_minibuffer, read_minibuf_unwind):
3728 Call minibuffer-inactive-mode.
3729
864db017
JB
37302011-05-31 Juanma Barranquero <lekktu@gmail.com>
3731
3732 * makefile.w32-in ($(BLD)/data.$(O), $(BLD)/editfns.$(O)):
3733 Update dependencies.
3734
2ad0baf4
DN
37352011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
3736
3737 * data.c (init_data): Remove code for UTS, this system is not
3738 supported anymore.
3739
4fcc2638
DN
37402011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
3741
3742 Don't force ./temacs to start in terminal mode.
3743
3744 * frame.c (make_initial_frame): Initialize faces in all cases, not
3745 only when CANNOT_DUMP is defined.
3746 * dispnew.c (init_display): Remove CANNOT_DUMP condition.
3747
c56e0fd5
DN
37482011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
3749
3750 * dispnew.c (add_window_display_history): Use const for the string
3751 pointer. Remove declaration, not needed.
3752
333d54da 37532011-05-31 Paul Eggert <eggert@cs.ucla.edu>
9cf9f756 3754
55d4c1b2 3755 Use 'inline', not 'INLINE'.
333d54da 3756 <http://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00914.html>
55d4c1b2
PE
3757 * alloc.c, fontset.c (INLINE): Remove.
3758 * alloc.c, bidi.c, charset.c, coding.c, dispnew.c, fns.c, image.c:
3759 * intervals.c, keyboard.c, process.c, syntax.c, textprop.c, w32term.c:
3760 * xdisp.c, xfaces.c, xterm.c: Replace all uses of INLINE with inline.
3761 * gmalloc.c (register_heapinfo): Use inline unconditionally.
3762 * lisp.h (LISP_MAKE_RVALUE): Use inline, not __inline__.
3763
738db178
DN
37642011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
3765
3766 Make it possible to run ./temacs.
3767
3768 * callproc.c (set_initial_environment): Remove CANNOT_DUMP code,
3769 syms_of_callproc does the same thing. Remove test for
3770 "initialized", do it in the caller.
3771 * emacs.c (main): Avoid calling set_initial_environment when dumping.
3772
620c53a6
SM
37732011-05-31 Stefan Monnier <monnier@iro.umontreal.ca>
3774
3775 * minibuf.c (Finternal_complete_buffer): Return `category' metadata.
3776 (read_minibuf): Use get_minibuffer.
3777 (syms_of_minibuf): Use DEFSYM.
3778 (Qmetadata): New var.
3779 * data.c (Qbuffer): Don't make it static.
3780 (syms_of_data): Use DEFSYM.
3781
e003a292
PE
37822011-05-31 Paul Eggert <eggert@cs.ucla.edu>
3783
3784 * ccl.c (CCL_CODE_RANGE): Allow negative numbers. (Bug#8751)
3785 (CCL_CODE_MIN): New macro.
3786
ed008a6d
PE
37872011-05-30 Paul Eggert <eggert@cs.ucla.edu>
3788
3687c2ef
PE
3789 * alloc.c (lisp_align_malloc): Omit unnecessary val==NULL tests.
3790
ed008a6d
PE
3791 * eval.c (Qdebug): Now static.
3792 * lisp.h (Qdebug): Remove decl. This reverts a part of the
3793 2011-04-26T11:26:05Z!dan.colascione@gmail.com that inadvertently undid part of
3794 2011-04-14T06:48:41Z!eggert@cs.ucla.edu.
3795
d66c4c7c
CY
37962011-05-29 Chong Yidong <cyd@stupidchicken.com>
3797
3798 * image.c: Various fixes to ImageMagick code comments.
3799 (Fimagemagick_types): Doc fix.
3800
5fbc2025
PE
38012011-05-29 Paul Eggert <eggert@cs.ucla.edu>
3802
0196f88a
PE
3803 Minor fixes prompted by GCC 4.6.0 warnings.
3804
3805 * xselect.c (converted_selections, conversion_fail_tag): Now static.
3806
5fbc2025
PE
3807 * emacs.c [HAVE_X_WINDOWS]: Include "xterm.h".
3808 (x_clipboard_manager_save_all): Move extern decl to ...
3809 * xterm.h: ... here, so that it can be checked for consistency.
3810
1dd3c2d9
CY
38112011-05-29 Chong Yidong <cyd@stupidchicken.com>
3812
3813 * xselect.c (x_clipboard_manager_save_frame)
3814 (x_clipboard_manager_save_all): New functions.
3815 (Fx_clipboard_manager_save): Lisp function deleted.
3816
3817 * emacs.c (Fkill_emacs): Call x_clipboard_manager_save_all.
3818 * frame.c (delete_frame): Call x_clipboard_manager_save_frame.
3819
3820 * xterm.h: Update prototype.
3821
5ba6571d
WX
38222011-05-28 William Xu <william.xwl@gmail.com>
3823
3824 * nsterm.m (ns_term_shutdown): Synchronize user defaults before
3825 exiting (Bug#8239).
3826
3eaff834
JM
38272011-05-28 Jim Meyering <meyering@redhat.com>
3828
e1900994 3829 Avoid a sign-extension bug in crypto_hash_function.
3eaff834
JM
3830 * fns.c (to_uchar): Define.
3831 (crypto_hash_function): Use it to convert some newly-signed
3832 variables to unsigned, to avoid sign-extension bugs. For example,
3833 without this change, (md5 "truc") would evaluate to
3834 45723a2aff78ff4fff7fff1114760e62 rather than the expected
3835 45723a2af3788c4ff17f8d1114760e62. Reported by Antoine Levitt in
e1900994 3836 https://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00883.html.
3eaff834 3837
0f6990a7
PE
38382011-05-27 Paul Eggert <eggert@cs.ucla.edu>
3839
3840 Integer overflow fixes.
c8a9ca5a 3841
08686060
PE
3842 * dbusbind.c: Serial number integer overflow fixes.
3843 (CHECK_DBUS_SERIAL_GET_SERIAL): New macro.
08686060
PE
3844 (Fdbus_call_method_asynchronously, xd_read_message_1): Use a float
3845 to hold a serial number that is too large for a fixnum.
3846 (Fdbus_method_return_internal, Fdbus_method_error_internal):
3847 Check for serial numbers out of range. Decode any serial number
59568bf0 3848 that was so large that it became a float. (Bug#8722)
08686060 3849
2d1fc3c7
PE
3850 * dbusbind.c: Use XFASTINT rather than XUINT, and check for nonneg.
3851 (Fdbus_call_method, Fdbus_call_method_asynchronously):
3852 Use XFASTINT rather than XUINT when numbers are nonnegative.
3853 (xd_append_arg, Fdbus_method_return_internal):
3854 (Fdbus_method_error_internal): Likewise. Also, for unsigned
3855 arguments, check that Lisp number is nonnegative, rather than
59568bf0 3856 silently wrapping negative numbers around. (Bug#8722)
30217ff0 3857 (xd_read_message_1): Don't assume dbus_uint32_t can fit in int.
59568bf0 3858 (Bug#8722)
2d1fc3c7 3859
c8a9ca5a
PE
3860 * data.c (arith_driver, Flsh): Avoid unnecessary casts to EMACS_UINT.
3861
519e1d69
PE
3862 * ccl.c (ccl_driver): Redo slightly to avoid the need for 'unsigned'.
3863
30569699
PE
3864 ccl: add integer overflow checks
3865 * ccl.c (CCL_CODE_MAX, GET_CCL_RANGE, GET_CCL_CODE, GET_CCL_INT):
3866 (IN_INT_RANGE): New macros.
3867 (ccl_driver): Use them to check for integer overflow when
3868 decoding a CCL program. Many of the new checks are whether XINT (x)
3869 fits in int; it doesn't always, on 64-bit hosts. The new version
3870 doesn't catch all possible integer overflows, but it's an
847044ea 3871 improvement. (Bug#8719)
30569699 3872
c11285dc
PE
3873 * alloc.c (make_event_array): Use XINT, not XUINT.
3874 There's no need for unsigned here.
3875
fdccd48e
PE
3876 * mem-limits.h (EXCEEDS_LISP_PTR) [!USE_LSB_TAG]: EMACS_UINT -> uintptr_t
3877 This follows up to the 2011-05-06 change that substituted uintptr_t
3878 for EMACS_INT. This case wasn't caught back then.
3879
37910ab2
PE
3880 Rework Fformat to avoid integer overflow issues.
3881 * editfns.c: Include <float.h> unconditionally, as it's everywhere
3882 now (part of C89). Include <verify.h>.
3883 (MAX_10_EXP, CONVERTED_BYTE_SIZE): Remove; no longer needed.
3884 (pWIDE, pWIDElen, signed_wide, unsigned_wide): New defns.
3885 (Fformat): Avoid the prepass trying to compute sizes; it was only
3886 approximate and thus did not catch overflow reliably. Instead, walk
3887 through the format just once, formatting and computing sizes as we go,
3888 checking for integer overflow at every step, and allocating a larger
3889 buffer as needed. Keep track separately whether the format is
3890 multibyte. Keep only the most-recently calculated precision, rather
3891 than them all. Record whether each argument has been converted to
3892 string. Use EMACS_INT, not int, for byte and char and arg counts.
3893 Support field widths and precisions larger than INT_MAX. Avoid
3894 sprintf's undefined behavior with conversion specifications such as %#d
3895 and %.0c. Fix bug with strchr succeeding on '\0' when looking for
3896 flags. Fix bug with (format "%c" 256.0). Avoid integer overflow when
3897 formatting out-of-range floating point numbers with int
9173deec 3898 formats. (Bug#8668)
37910ab2 3899
2e6578fb
PE
3900 * lisp.h (FIXNUM_OVERFLOW_P): Work even if arg is a NaN.
3901
0ae6bdee
PE
3902 * data.c: Avoid integer truncation in expressions involving floats.
3903 * data.c: Include <intprops.h>.
3904 (arith_driver): When there's an integer overflow in an expression
3905 involving floating point, convert the integers to floating point
3906 so that the resulting value does not suffer from catastrophic
3907 integer truncation. For example, on a 64-bit host (* 4
3908 most-negative-fixnum 0.5) should yield about -4.6e+18, not zero.
3909 Do not rely on undefined behavior after integer overflow.
3910
de883a70
PE
3911 merge count_size_as_multibyte, parse_str_to_multibyte
3912 * character.c, character.h (count_size_as_multibyte):
fd6fa53f 3913 Rename from parse_str_to_multibyte; all uses changed.
de883a70
PE
3914 Check for integer overflow.
3915 * insdel.c, lisp.h (count_size_as_multibyte): Remove,
3916 since it's now a duplicate of the other. This is more of
3917 a character than a buffer op, so better that it's in character.c.
3918 * fns.c, print.c: Adjust to above changes.
3919
2ff916cb
PE
39202011-05-27 Stefan Monnier <monnier@iro.umontreal.ca>
3921
3922 * xselect.c (x_convert_selection): Yet another int/Lisp_Object mixup.
3923
f1b54466
PE
39242011-05-27 Paul Eggert <eggert@cs.ucla.edu>
3925
fb1ac845
PE
3926 * xselect.c: Fix minor problems prompted by GCC 4.6.0 warnings.
3927 (x_handle_selection_request, frame_for_x_selection): Remove unused vars.
3928 (x_clipboard_manager_save): Now static.
3929 (Fx_clipboard_manager_save): Rename local to avoid shadowing.
3930
f1b54466
PE
3931 * fns.c: Fix minor problems prompted by GCC 4.6.0 warnings.
3932 (crypto_hash_function): Now static.
3933 Fix pointer signedness problems. Avoid unnecessary initializations.
3934
a9f737ee
CY
39352011-05-27 Chong Yidong <cyd@stupidchicken.com>
3936
3937 * termhooks.h (Vselection_alist): Make it terminal-local.
3938
3939 * terminal.c (create_terminal): Initialize it.
3940
3941 * xselect.c: Support for clipboard managers.
3942 (Vselection_alist): Move to termhooks.h as terminal-local var.
3943 (LOCAL_SELECTION): New macro.
3944 (x_atom_to_symbol): Handle x_display_info_for_display fail case.
3945 (symbol_to_x_atom): Remove gratuitous arg.
3946 (x_handle_selection_request, lisp_data_to_selection_data)
3947 (x_get_foreign_selection, Fx_register_dnd_atom): Callers changed.
620c53a6
SM
3948 (x_own_selection, x_get_local_selection, x_convert_selection):
3949 New arg, specifying work frame. Use terminal-local Vselection_alist.
a9f737ee
CY
3950 (some_frame_on_display): Delete unused function.
3951 (Fx_own_selection_internal, Fx_get_selection_internal)
3952 (Fx_disown_selection_internal, Fx_selection_owner_p)
3953 (Fx_selection_exists_p): New optional frame arg.
3954 (frame_for_x_selection, Fx_clipboard_manager_save): New functions.
3955 (x_handle_selection_clear): Don't treat other terminals with the
3956 same keyboard specially. Use the terminal-local Vselection_alist.
3957 (x_clear_frame_selections): Use Frun_hook_with_args.
3958
3959 * xterm.c (x_term_init): Intern ATOM and CLIPBOARD_MANAGER atoms.
3960
3961 * xterm.h: Add support for those atoms.
3962
e067f0c1
CY
39632011-05-26 Chong Yidong <cyd@stupidchicken.com>
3964
3965 * xselect.c: ICCCM-compliant handling of MULTIPLE targets.
3966 (converted_selections, conversion_fail_tag): New global variables.
3967 (x_selection_request_lisp_error): Free the above.
3968 (x_get_local_selection): Remove unnecessary code.
3969 (x_reply_selection_request): Args changed; handle arbitrary array
620c53a6
SM
3970 of converted selections stored in converted_selections.
3971 Separate the XChangeProperty and SelectionNotify steps.
e067f0c1
CY
3972 (x_handle_selection_request): Rewrite to handle MULTIPLE target.
3973 (x_convert_selection): New function.
3974 (x_handle_selection_event): Simplify.
3975 (x_get_foreign_selection): Don't ignore incoming requests while
3976 waiting for an answer; this will fail when we implement
3977 SAVE_TARGETS, and seems unnecessary anyway.
3978 (selection_data_to_lisp_data): Recognize ATOM_PAIR type.
3979 (Vx_sent_selection_functions): Doc fix.
3980
0f4aebc0
LL
39812011-05-26 Leo Liu <sdl.web@gmail.com>
3982
3983 * editfns.c (Ftranspose_regions): Allow empty regions. (Bug#8699)
3984
e61124cd
YM
39852011-05-25 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
3986
3987 * dispextern.h (struct glyph_row): New member fringe_bitmap_periodic_p.
3988
3989 * dispnew.c (shift_glyph_matrix, scrolling_window): Mark scrolled row
3990 for fringe update if it has periodic bitmap.
ac389d0c 3991 (row_equal_p): Also compare left_fringe_offset, right_fringe_offset,
e61124cd
YM
3992 and fringe_bitmap_periodic_p.
3993
3994 * fringe.c (get_fringe_bitmap_data): New function.
3995 (draw_fringe_bitmap_1, update_window_fringes): Use it.
3996 (update_window_fringes): Record periodicity of fringe bitmap in glyph
3997 row. Mark glyph row for fringe update if periodicity changed.
3998
3999 * xdisp.c (try_window_reusing_current_matrix): Don't mark scrolled row
4000 for fringe update unless it has periodic bitmap.
4001
f16d9837
KH
40022011-05-25 Kenichi Handa <handa@m17n.org>
4003
4004 * xdisp.c (get_next_display_element): Set correct it->face_id for
4005 a static composition.
4006
e1b90ef6
LL
40072011-05-24 Leo Liu <sdl.web@gmail.com>
4008
4009 * deps.mk (fns.o):
4010 * makefile.w32-in ($(BLD)/fns.$(O)): Include sha1.h.
4011
4012 * fns.c (crypto_hash_function, Fsha1): New function.
4013 (Fmd5): Use crypto_hash_function.
4014 (syms_of_fns): Add Ssha1.
4015
7400048f
PE
40162011-05-22 Paul Eggert <eggert@cs.ucla.edu>
4017
4018 * gnutls.c: Remove unused macros.
4019 (fn_gnutls_transport_set_lowat, fn_gnutls_transport_set_pull_function):
4020 (fn_gnutls_transport_set_push_function) [!WINDOWSNT]:
4021 Remove macros that are defined and never used.
4022 Caught by gcc -Wunused-macros (GCC 4.6.0, Fedora 14).
4023
abb71cf4
CY
40242011-05-22 Chong Yidong <cyd@stupidchicken.com>
4025
4026 * xselect.c (syms_of_xselect): Remove unused symbol SAVE_TARGETS.
4027 (Fx_get_selection_internal): Minor cleanup.
4028 (Fx_own_selection_internal): Rename arguments for consistency with
4029 select.el.
4030
6307db39
PE
40312011-05-22 Paul Eggert <eggert@cs.ucla.edu>
4032
4033 * xselect.c (QSAVE_TARGETS): New static var, to fix build failure.
4034
f3d4e0a4
CY
40352011-05-22 Chong Yidong <cyd@stupidchicken.com>
4036
4037 * xselect.c (syms_of_xselect): Include character.h; use DEFSYM.
4038
4d8ade89
YM
40392011-05-21 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
4040
4041 * dispnew.c (scrolling_window): Don't exclude the case that the
4042 last enabled row in the desired matrix touches the bottom boundary.
4043
32078c8d
GM
40442011-05-21 Glenn Morris <rgm@gnu.org>
4045
4046 * Makefile.in ($(etc)/DOC): Make second command line even shorter.
33cf345f
GM
4047 (SOME_MACHINE_OBJECTS): Replace FONT_OBJ by its maximal expansion,
4048 and add some more files.
32078c8d 4049
7285dc67
EZ
40502011-05-20 Eli Zaretskii <eliz@gnu.org>
4051
4052 * callproc.c (Fcall_process) [MSDOS]: Fix arguments to
4053 report_file_error introduced by the change from 2011-05-07.
4054
89d1bd22
PE
40552011-05-20 Paul Eggert <eggert@cs.ucla.edu>
4056
4057 * systime.h (Time): Define only if emacs is defined.
4058 This is to allow ../lib-src/profile.c to be compiled on FreeBSD,
4059 where the include path doesn't have X11/X.h by default. See
4060 <http://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00561.html>.
4061
e23640bb 40622011-05-20 Kenichi Handa <handa@m17n.org>
31bfc35c
KH
4063
4064 * composite.c (find_automatic_composition): Fix previous change.
4065
b9704ad9
GM
40662011-05-20 Glenn Morris <rgm@gnu.org>
4067
4068 * lisp.mk: New file, split from Makefile.in.
4069 * Makefile.in (lisp): Move to separate file, inserted by @lisp_frag@.
4070 (shortlisp): Remove.
4071 ($(etc)/DOC): Edit lisp.mk rather than using $shortlisp.
4072
4a720484
GM
40732011-05-19 Glenn Morris <rgm@gnu.org>
4074
4075 * Makefile.in (MSDOS_SUPPORT_REAL, MSDOS_SUPPORT, NS_SUPPORT)
4076 (REAL_MOUSE_SUPPORT, GPM_MOUSE_SUPPORT, MOUSE_SUPPORT, TOOLTIP_SUPPORT)
4077 (BASE_WINDOW_SUPPORT, X_WINDOW_SUPPORT, WINDOW_SUPPORT): Remove.
4078 (lisp): Set the order to that of loadup.el.
4079 (shortlisp): Make it a copy of $lisp.
4080 (SOME_MACHINE_LISP): Remove.
4081 ($(etc)/DOC): Depend just on $lisp, not $SOME_MACHINE_LISP too.
4082 Use just $shortlisp, not $SOME_MACHINE_LISP too.
4083
a28d4396
KH
40842011-05-18 Kenichi Handa <handa@m17n.org>
4085
4086 * composite.c (CHAR_COMPOSABLE_P): Add more check for efficiency.
4087 (BACKWARD_CHAR): Wrap the arg STOP by parenthesis.
4088 (find_automatic_composition): Mostly rewrite for efficiency.
4089
a2b1fa8e
JB
40902011-05-18 Juanma Barranquero <lekktu@gmail.com>
4091
4092 * makefile.w32-in: Update dependencies.
4093
8e1f5610
CS
40942011-05-18 Christoph Scholtes <cschol2112@googlemail.com>
4095
4096 * menu.c: Include limits.h (fixes the MS-Windows build broken by
7d7d0045 4097 2011-06-18T18:49:19Z!cyd@stupidchicken.com).
8e1f5610 4098
7025ee00 40992011-05-18 Paul Eggert <eggert@cs.ucla.edu>
cb93f9be 4100
cdfa6eab
PE
4101 Fix some integer overflow issues, such as string length overflow.
4102
06d6db33
PE
4103 * insdel.c (count_size_as_multibyte): Check for string overflow.
4104
2b4560a8
PE
4105 * character.c (lisp_string_width): Check for string overflow.
4106 Use EMACS_INT, not int, for string indexes and lengths; in
4107 particular, 2nd arg is now EMACS_INT, not int. Do not crash if
4108 the resulting string length overflows an EMACS_INT; instead,
4109 report a string overflow if no precision given. When checking for
4110 precision exhaustion, use a check that cannot possibly have
4111 integer overflow. (Bug#8675)
4112 * character.h (lisp_string_width): Adjust to new signature.
4113
cb93f9be
PE
4114 * alloc.c (string_overflow): New function.
4115 (Fmake_string): Use it. This doesn't change behavior, but saves
4116 a few bytes and will simplify future changes.
4117 * character.c (string_escape_byte8): Likewise.
4118 * lisp.h (string_overflow): New decl.
4119
1a1f3366
PE
4120 Fixups, following up to the user-interface timestamp change.
4121 * nsterm.m (last_mouse_movement_time, ns_mouse_position): Use Time
4122 for UI timestamps, instead of unsigned long.
9fbd6841
PE
4123 * msdos.c (mouse_get_pos): Likewise.
4124 * w32inevt.c (movement_time, w32_console_mouse_position): Likewise.
1a1f3366
PE
4125 * w32gui.h (Time): Define by including "systime.h" rather than by
4126 declaring it ourselves. (Bug#8664)
4127
d4e3e4d3
PE
4128 * dispextern.h (struct image): Don't assume time_t <= unsigned long.
4129 * image.c (clear_image_cache): Likewise.
4130
f6a24d19
PE
4131 * term.c (term_mouse_position): Don't assume time_t wraparound.
4132
08dc5ae6
PE
4133 Be more systematic about user-interface timestamps.
4134 Before, the code sometimes used 'Time', sometimes 'unsigned long',
620c53a6
SM
4135 and sometimes 'EMACS_UINT', to represent these timestamps.
4136 This change causes it to use 'Time' uniformly, as that's what X uses.
08dc5ae6
PE
4137 This makes the code easier to follow, and makes it easier to catch
4138 integer overflow bugs such as Bug#8664.
4139 * frame.c (Fmouse_position, Fmouse_pixel_position):
4140 Use Time, not unsigned long, for user-interface timestamps.
4141 * keyboard.c (last_event_timestamp, kbd_buffer_get_event): Likewise.
4142 (button_down_time, make_lispy_position, make_lispy_movement): Likewise.
4143 * keyboard.h (last_event_timestamp): Likewise.
4144 * menu.c (Fx_popup_menu) [!HAVE_X_WINDOWS]: Likewise.
4145 * menu.h (xmenu_show): Likewise.
4146 * term.c (term_mouse_position): Likewise.
4147 * termhooks.h (struct input_event.timestamp): Likewise.
4148 (struct terminal.mouse_position_hook): Likewise.
4149 * xmenu.c (create_and_show_popup_menu, xmenu_show): Likewise.
4150 * xterm.c (XTmouse_position, x_scroll_bar_report_motion): Likewise.
4151 * systime.h (Time): New decl. Pull it in from <X11/X.h> if
4152 HAVE_X_WINDOWS, otherwise define it as unsigned long, which is
4153 what it was before.
4154 * menu.h, termhooks.h: Include "systime.h", for Time.
4155
8e55734a
PE
4156 * keyboard.c (make_lispy_event): Fix problem in integer overflow.
4157 Don't assume that the difference between two unsigned long values
4158 can fit into an integer. At this point, we know button_down_time
4159 <= event->timestamp, so the difference must be nonnegative, so
4160 there's no need to cast the result if double-click-time is
4161 nonnegative, as it should be; check that it's nonnegative, just in
4162 case. This bug is triggered when events are more than 2**31 ms
86db42d2 4163 apart (about 25 days). (Bug#8664)
8e55734a 4164
841f1b75 4165 * xselect.c (last_event_timestamp): Remove duplicate decl.
6434756c 4166 (x_own_selection): Remove needless cast to unsigned long.
841f1b75 4167
3e26f69c
PE
4168 * xmenu.c (set_frame_menubar): Use int, not EMACS_UINT, for indexes
4169 that always fit in int. Use a sentinel instead of a counter, to
4170 avoid a temp and to allay GCC's concerns about possible int overflow.
d230cb74
PE
4171 * frame.h (struct frame): Use int for menu_bar_items_used
4172 instead of EMACS_INT, since it always fits in int.
3e26f69c 4173
5cc152c0
PE
4174 * menu.c (grow_menu_items): Check for int overflow.
4175
d89eb65e
PE
4176 * xmenu.c (set_frame_menubar): Don't mishandle vectors with no nils.
4177
5235bd3e
PE
4178 * xterm.c: Use EMACS_INT for Emacs modifiers, and int for X modifiers.
4179 Before, the code was not consistent. These values cannot exceed
4180 2**31 - 1 so there's no need to make them unsigned.
4181 (x_x_to_emacs_modifiers): Accept int and return EMACS_INT.
4182 (x_emacs_to_x_modifiers): Accept EMACS_INT and return int.
4183 (x_x_to_emacs_modifiers, x_emacs_to_x_modifiers): Reject non-integers
4184 as modifiers.
4185 * xterm.h (x_x_to_emacs_modifiers): Adjust to signature change.
4186
bc827e23
PE
4187 * lisp.h (XINT) [USE_LISP_UNION_TYPE]: Cast to EMACS_INT.
4188 (XUINT) [USE_LISP_UNION_TYPE]: Cast to EMACS_UINT.
4189 Otherwise, GCC 4.6.0 warns about printf (pI, XINT (...)),
4190 presumably because the widths might not match.
4191
78eb494e
PE
4192 * window.c (size_window): Avoid needless test at loop start.
4193
04f2d78b
CB
41942011-05-18 Courtney Bane <emacs-bugs-7626@cbane.org> (tiny change)
4195
4196 * term.c (Fresume_tty): Restore hooks before reinitializing (bug#8687).
4197
d2fc7e3d 41982011-05-12 Drew Adams <drew.adams@oracle.com>
e531bdff
DA
4199
4200 * textprop.c (Fprevious_single_char_property_change): Doc fix (bug#8655).
4201
d2fc7e3d 42022011-05-12 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
7db47798
YM
4203
4204 * w32term.c (w32_draw_fringe_bitmap): Rename local vars `left' and
4205 `width' to `bar_area_x' and `bar_area_width', respectively.
4206 (x_scroll_run): Take account of fringe background extension.
4207
04f2d78b
CB
4208 * xterm.c (x_draw_fringe_bitmap) [USE_TOOLKIT_SCROLL_BARS]:
4209 Rename local vars `left' and `width' to `bar_area_x' and
7db47798
YM
4210 `bar_area_width', respectively.
4211 (x_scroll_run) [USE_TOOLKIT_SCROLL_BARS]: Take account of fringe
4212 background extension.
4213
79b70037
GM
42142011-05-10 Jim Meyering <meyering@redhat.com>
4215
4216 * xdisp.c (x_intersect_rectangles): Fix typo "the the -> the".
4217
2f142cc5
JB
42182011-05-10 Juanma Barranquero <lekktu@gmail.com>
4219
4220 * image.c (Finit_image_library): Return t for built-in image types,
4221 like pbm and xbm. (Bug#8640)
4222
57679c86
AS
42232011-05-09 Andreas Schwab <schwab@linux-m68k.org>
4224
4225 * w32menu.c (set_frame_menubar): Fix submenu allocation.
4226
888c9e86
EZ
42272011-05-07 Eli Zaretskii <eliz@gnu.org>
4228
b0512a1d
EZ
4229 * w32console.c (Fset_screen_color): Doc fix.
4230 (Fget_screen_color): New function.
4231 (syms_of_ntterm): Defsubr it.
4232
7285dc67
EZ
4233 * callproc.c (call_process_cleanup) [MSDOS]: Don't close and
4234 unlink the temporary file if Fcall_process didn't create it in the
4235 first place.
4236 (Fcall_process) [MSDOS]: Don't create tempfile if stdout of the
4237 child process will be redirected to a file specified with `:file'.
888c9e86
EZ
4238 Don't try to re-open tempfile in that case, and set fd[0] to -1 as
4239 cue to call_process_cleanup not to close that handle.
4240
4d3fcc8e
BK
42412011-05-07 Ben Key <bkey76@gmail.com>
4242
4243 * makefile.w32-in: The bootstrap-temacs rule now makes use of
4244 one of two shell specific rules, either bootstrap-temacs-CMD or
4245 bootstrap-temacs-SH. The bootstrap-temacs-SH rule is identical
4246 to the previous implementation of the bootstrap-temacs rule.
4247 The bootstrap-temacs-CMD rule is similar to the previous
4248 implementation of the bootstrap-temacs rule except that it
4249 makes use of the ESC_CFLAGS variable instead of the CFLAGS
4250 variable.
4251
4252 These changes, along with some changes to nt/configure.bat,
4253 nt/gmake.defs, and nt/nmake.defs, are required to extend my
4254 earlier fix to add support for --cflags and --ldflags options
4255 that include quotes so that it works whether make uses cmd or
4256 sh as the shell.
4257
b4289b64
MA
42582011-05-06 Michael Albinus <michael.albinus@gmx.de>
4259
4260 * dbusbind.c (QCdbus_type_unix_fd): Declare static.
4261 (xd_remove_watch): Don't check QCdbus_type_unix_fd for SYMBOLP, it
4262 is a constant.
4263 (Fdbus_init_bus, xd_read_queued_messages): Bus can be a symbol or
4264 a string. Handle both cases.
4265 (Fdbus_call_method_asynchronously, Fdbus_register_signal)
4266 (Fdbus_register_method): Use Qinvalid_function.
4267
af4c0e28
JB
42682011-05-06 Juanma Barranquero <lekktu@gmail.com>
4269
4270 * makefile.w32-in: Update dependencies.
4271 (LISP_H): Add inttypes.h and stdin.h.
4272 (PROCESS_H): Add unistd.h.
4273
c51453d9
EZ
42742011-05-06 Eli Zaretskii <eliz@gnu.org>
4275
4276 * lread.c: Include limits.h (fixes the MS-Windows build broken by
4277 2011-05-06T07:13:19Z!eggert@cs.ucla.edu).
4278
8ff0ac3c 42792011-05-06 Paul Eggert <eggert@cs.ucla.edu>
c032b5f8 4280
4c4b566b
PE
4281 * image.c (Finit_image_library) [!HAVE_NTGUI]: Omit unused local.
4282
aab2b9b5
PE
4283 * term.c (vfatal): Remove stray call to va_end.
4284 It's not needed and the C Standard doesn't allow it here anyway.
4285
c378da0b
PE
4286 Use C99's va_copy to avoid undefined behavior on x86-64 GNU/Linux.
4287 * eval.c (verror): doprnt a copy of ap, not the original. (Bug#8545)
4288
288b08c7
PE
4289 * eval.c (verror): OK to create a string of up to MOST_POSITIVE_FIXNUM
4290 bytes.
4291
e3601888
PE
4292 * term.c: Don't include <stdarg.h>, as <lisp.h> does that.
4293
db6c0e74
PE
4294 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork clobbering.
4295
dd5963ea
PE
4296 * process.c (Fformat_network_address): Fix typo: args2 -> *args2.
4297
88c9450f
PE
4298 * xmenu.c (set_frame_menubar): Fix typo: int * -> int (3 times).
4299
2f9442b8
PE
4300 * coding.c (detect_coding_charset): Fix typo: * 2 -> *4 (Bug#8601).
4301
c032b5f8
PE
4302 * charset.h (struct charset.code_space): Now has 15 elements, not 16.
4303 * charset.c (Fdefine_charset_internal): Don't initialize
4304 charset.code_space[15]. The value was garbage, on hosts with
2d38271b 4305 32-bit int (Bug#8600).
a108c10b
PE
4306
4307 * lread.c (read_integer): Be more consistent with string-to-number.
4308 Use string_to_number to do the actual conversion; this avoids
4309 rounding errors and fixes some other screwups. Without this fix,
4310 for example, #x1fffffffffffffff was misread as -2305843009213693952.
4311 (digit_to_number): Move earlier, for benefit of read_integer.
4312 Return -1 if the digit is out of range for the base, -2 if it is
48e400f0 4313 not a digit in any supported base. (Bug#8602)
a108c10b 4314
ad5f9eea
PE
4315 * doprnt.c (doprnt): Support arbitrary pI values, such as "I64".
4316
aec1708a
PE
4317 * dispnew.c (scrolling_window): Return 1 if we scrolled,
4318 to match comment at start of function. This also removes a
4319 GCC warning about overflow in a 32+64-bit port.
4320
47be4ab5
PE
4321 * lisp.h (EMACS_INT, EMACS_UINT, BITS_PER_EMACS_INT, pI): Simplify.
4322
371cac43
PE
4323 * dbusbind.c: Do not use XPNTR on a value that may be an integer.
4324 Reported by Stefan Monnier in
4325 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00919.html>.
04f2d78b
CB
4326 (xd_remove_watch, Fdbus_init_bus, xd_read_queued_messages):
4327 Use SYMBOLP-guarded XSYMBOL, not XPNTR.
371cac43 4328
d01a7826
PE
4329 * lisp.h (EMACS_INTPTR): Remove. All uses changed to intptr_t.
4330 (EMACS_UINTPTR): Likewise, with uintptr_t.
4331
7fd47d5c
PE
4332 * lisp.h: Prefer 64-bit EMACS_INT if available.
4333 (EMACS_INT, EMACS_UINT, BITS_PER_EMACS_INT, pI): Define to 64-bit
4334 on 32-bit hosts that have 64-bit int, so that they can access
4335 large files.
122b0c86
PE
4336 However, temporarily disable this change unless the temporary
4337 symbol WIDE_EMACS_INT is defined.
7fd47d5c 4338
8727937b
PE
4339 * lread.c, process.c: Do not include <inttypes.h>; lisp.h does it now.
4340
8ac068ac
PE
4341 Prefer intptr_t/uintptr_t for integers the same widths as pointers.
4342 This removes an assumption that EMACS_INT and long are the same
4343 width as pointers. The assumption is true for Emacs porting targets
4344 now, but we want to make other targets possible.
4345 * lisp.h: Include <inttypes.h>, for INTPTR_MAX, UINTPTR_MAX.
4346 (EMACS_INTPTR, EMACS_UINTPTR): New macros.
4347 In the rest of the code, change types of integers that hold casted
4348 pointers to EMACS_INTPTR and EMACS_UINTPTR, systematically
4349 replacing EMACS_INT, long, EMACS_UINT, and unsigned long.
4350 (XTYPE): Don't cast arg to EMACS_UINT; normally is not needed.
4351 (XSET): Cast type of XTYPE arg to EMACS_INTPTR; it is needed here.
4352 No need to cast type when ORing.
4353 (XPNTR): Return a value of type EMACS_INTPTR or EMACS_UINTPTR.
4354 * alloc.c (lisp_align_malloc): Remove a no-longer-needed cast.
4355 * doc.c (store_function_docstring): Use EMACS_INTPTR, so as not to
4356 assume EMACS_INT is the same width as char *.
4357 * gtkutil.c (xg_gtk_scroll_destroy, xg_tool_bar_button_cb):
4358 (xg_tool_bar_callback, xg_tool_bar_help_callback, xg_make_tool_item):
4359 Remove no-longer-needed casts.
4360 (xg_create_scroll_bar, xg_tool_bar_button_cb, xg_tool_bar_callback):
4361 (xg_tool_bar_help_callback, xg_make_tool_item):
4362 Use EMACS_INTPTR to hold an integer
4363 that will be cast to void *; this can avoid a GCC warning
4364 if EMACS_INT is not the same width as void *.
4365 * menu.c (find_and_call_menu_selection): Remove no-longer-needed cast.
4366 * xdisp.c (display_echo_area_1, resize_mini_window_1):
4367 (current_message_1, set_message_1):
4368 Use a local to convert to proper width without a cast.
4369 * xmenu.c (dialog_selection_callback): Likewise.
4370
ede49d71
PE
4371 * sysdep.c (get_random): Don't assume EMACS_INT is no wider than long.
4372 Also, don't assume VALBITS / RAND_BITS is less than 5,
4373 and don't rely on undefined behavior when shifting a 1 left into
4374 the sign bit.
4375 * lisp.h (get_random): Change signature to match.
4376
2f30ecd0
PE
4377 * lread.c (hash_string): Use size_t, not int, for hash computation.
4378 Normally we prefer signed values; but hashing is special, because
4379 it's better to use unsigned division on hash table sizes so that
4380 the remainder is nonnegative. Also, size_t is the natural width
4381 for hashing into memory. The previous code used 'int', which doesn't
4382 retain enough info to hash well into very large tables.
4383 (oblookup, oblookup_last_bucket_number, Funintern): Likewise.
4384
2a866e7b
PE
4385 * dbusbind.c: Don't possibly lose pointer info when converting.
4386 (xd_remove_watch, Fdbus_init_bus, xd_read_queued_messages):
4387 Use XPNTR rather than XHASH, so that the high-order bits of
4388 the pointer aren't lost when converting through void *.
4389
51639eac
PE
4390 * eval.c (Fautoload): Don't double-shift a pointer.
4391
92394119
PE
4392 * fns.c (Frandom): Let EMACS_UINT be wider than unsigned long.
4393
dbdb9a7c
JB
43942011-05-06 Juanma Barranquero <lekktu@gmail.com>
4395
4396 * gnutls.c (DEF_GNUTLS_FN):
4397 * image.c (DEF_IMGLIB_FN): Make function pointers static.
4398
db7a0b4f
AS
43992011-05-05 Andreas Schwab <schwab@linux-m68k.org>
4400
4401 * lread.c (lisp_file_lexically_bound_p): Stop scanning at end
4402 marker. (Bug#8610)
4403
f7ff1b0f 44042011-05-05 Eli Zaretskii <eliz@gnu.org>
fab624aa
EZ
4405
4406 * w32heap.c (allocate_heap) [USE_LISP_UNION_TYPE || USE_LSB_TAG]:
4407 New version that can reserve upto 2GB of heap space.
4408
f7ff1b0f 44092011-05-05 Chong Yidong <cyd@stupidchicken.com>
45cb8994
CY
4410
4411 * nsfns.m (Fns_read_file_name): Doc fix (Bug#8534).
4412
639c109b
TZ
44132011-05-05 Teodor Zlatanov <tzz@lifelogs.com>
4414
4415 * gnutls.c (fn_gnutls_certificate_set_x509_key_file): Add alias to
4416 `gnutls_certificate_set_x509_key_file'.
4417
d2127135
JB
44182011-05-05 Juanma Barranquero <lekktu@gmail.com>
4419
4420 * makefile.w32-in ($(BLD)/image.$(O), $(BLD)/process.$(O)):
4421 Update dependencies.
4422
e968f4f3
JB
44232011-05-04 Juanma Barranquero <lekktu@gmail.com>
4424
4425 * gnutls.h (emacs_gnutls_write, emacs_gnutls_read):
4426 * gnutls.c (emacs_gnutls_write, emacs_gnutls_read):
4427 Remove unused parameter `fildes'.
4428 * process.c (read_process_output, send_process): Don't pass it.
4429
84d358f0
JB
44302011-05-04 Juanma Barranquero <lekktu@gmail.com>
4431
4432 Fix previous change: the library cache is defined in w32.c.
4433 * image.c (CACHE_IMAGE_TYPE) [!HAVE_NTGUI]: Define to noop.
4434 (Finit_image_library): Wrap Vlibrary_cache on "#ifdef HAVE_NTGUI".
4435
0898ca10
JB
44362011-05-04 Juanma Barranquero <lekktu@gmail.com>
4437
4438 Implement dynamic loading of GnuTLS on Windows.
4439
4440 * gnutls.h (GNUTLS_EMACS_ERROR_NOT_LOADED): New macro.
4441 (emacs_gnutls_write, emacs_gnutls_read): Mark as extern.
4442 (emacs_gnutls_record_check_pending, emacs_gnutls_transport_set_errno):
4443 Declare.
4444
4445 * gnutls.c (Qgnutls_dll): Define.
4446 (DEF_GNUTLS_FN, LOAD_GNUTLS_FN): New macros.
4447 (gnutls_*): Declare function pointers.
4448 (init_gnutls_functions): New function to initialize function pointers.
4449 (emacs_gnutls_handshake, Fgnutls_error_string, Fgnutls_deinit)
4450 (emacs_gnutls_global_init, Fgnutls_bye): Use function pointers.
4451 (emacs_gnutls_record_check_pending, emacs_gnutls_transport_set_errno):
4452 Wrappers for gnutls_record_check_pending and gnutls_transport_set_errno.
4453 (emacs_gnutls_write, emacs_gnutls_read)
4454 (emacs_gnutls_handle_error, Fgnutls_error_fatalp)
4455 (Fgnutls_available_p): New function.
4456 (Fgnutls_boot): Call Fgnutls_available_p. Use function pointers.
4457 (syms_of_gnutls) <Qgnutls_dll>: Initialize and staticpro it.
4458 (syms_of_gnutls) <Sgnutls_available_p>: defsubr it.
4459
4460 * image.c: Include w32.h.
4461 (Vimage_type_cache): Delete.
4462 (syms_of_image) <Vimage_type_cache>: Don't initialize and staticpro it.
4463 (CACHE_IMAGE_TYPE, Finit_image_library): Use Vlibrary_cache instead.
4464 (w32_delayed_load): Move to w32.c.
4465
4466 * w32.h (VlibraryCache, QCloaded_from, w32_delayed_load): Declare.
4467
4468 * w32.c (QCloaded_from, Vlibrary_cache): Define.
4469 (w32_delayed_load): Move from image.c. When loading a library, record
4470 its filename in the :loaded-from property of the library id.
4471 (globals_of_w32) <QCloaded_from, Vlibrary_cache>:
4472 Initialize and staticpro them.
4473 (emacs_gnutls_pull, emacs_gnutls_push): Call emacs_gnutls_* functions.
4474
4475 * process.c: Include lisp.h before w32.h, not after.
4476 (wait_reading_process_output): Call emacs_gnutls_record_check_pending
4477 instead of gnutls_record_check_pending.
4478
4479 * callproc.c, emacs.c: Include lisp.h before w32.h, not after.
4480
ff4de4aa
TZ
44812011-05-04 Teodor Zlatanov <tzz@lifelogs.com>
4482
4483 * gnutls.c (Fgnutls_boot): Support :keylist and :crlfiles options
4484 instead of :keyfiles. Give GnuTLS the keylist and the CRL lists
4485 as passed in.
4486
abe95abb
JD
44872011-05-03 Jan Djärv <jan.h.d@swipnet.se>
4488
4489 * xterm.c (x_set_frame_alpha): Do not set property on anything
4490 else than FRAME_X_OUTER_WINDOW (Bug#8608).
4491
e16e55d4
JB
44922011-05-02 Juanma Barranquero <lekktu@gmail.com>
4493
4494 * sysdep.c (get_tty_size) [WINDOWSNT]: Implement. (Bug#8596)
4495
bafcf6a5
JB
44962011-05-02 Juanma Barranquero <lekktu@gmail.com>
4497
4498 * gnutls.c (Qgnutls_log_level, Qgnutls_code, Qgnutls_anon)
4499 (Qgnutls_x509pki, Qgnutls_e_interrupted, Qgnutls_e_again)
4500 (Qgnutls_e_invalid_session, Qgnutls_e_not_ready_for_handshake)
4501 (gnutls_global_initialized, Qgnutls_bootprop_priority)
4502 (Qgnutls_bootprop_trustfiles, Qgnutls_bootprop_keyfiles)
4503 (Qgnutls_bootprop_callbacks, Qgnutls_bootprop_loglevel)
4504 (Qgnutls_bootprop_hostname, Qgnutls_bootprop_verify_flags)
4505 (Qgnutls_bootprop_verify_error, Qgnutls_bootprop_verify_hostname_error)
4506 (Qgnutls_bootprop_callbacks_verify): Make static.
4507
e7a6747f
AS
45082011-05-01 Andreas Schwab <schwab@linux-m68k.org>
4509
19ed11ba
AS
4510 * callproc.c: Indentation fixup.
4511
e7a6747f 4512 * sysdep.c (wait_for_termination_1): Make static.
04f2d78b
CB
4513 (wait_for_termination, interruptible_wait_for_termination):
4514 Move after wait_for_termination_1.
e7a6747f 4515
1ef14cb4
LMI
45162011-05-01 Lars Magne Ingebrigtsen <larsi@gnus.org>
4517
4518 * sysdep.c (interruptible_wait_for_termination): New function
4519 which is like wait_for_termination, but allows keyboard
4520 interruptions.
4521
4522 * callproc.c (Fcall_process): Add (:file "file") as an option for
4523 the STDOUT buffer.
4524 (Fcall_process_region): Ditto.
4525
330d880c
EZ
45262011-04-30 Eli Zaretskii <eliz@gnu.org>
4527
8db90b73
EZ
4528 * dosfns.c (Fint86, Fdos_memget, Fdos_memput): Use `ASIZE (FOO)'
4529 rather than `XVECTOR (FOO)->size'.
4530
330d880c
EZ
4531 * process.c: Remove HAVE_INTTYPES_H condition from inclusion of
4532 inttypes.h, as a gnulib replacement is used if it not available in
4533 system headers.
4534
15cbd324
EZ
45352011-04-21 Eli Zaretskii <eliz@gnu.org>
4536
4537 Lift the MOST_POSITIVE_FIXNUM/4 limitation on visited files.
4538 * fileio.c (Finsert_file_contents): Don't limit file size to 1/4
4539 of MOST_POSITIVE_FIXNUM. (Bug#8528)
4540
4541 * coding.c (coding_alloc_by_realloc): Error out if destination
4542 will grow beyond MOST_POSITIVE_FIXNUM.
4543 (decode_coding_emacs_mule): Abort if there isn't enough place in
4544 charbuf for the composition carryover bytes. Reserve an extra
4545 space for up to 2 characters produced in a loop.
4546 (decode_coding_iso_2022): Abort if there isn't enough place in
4547 charbuf for the composition carryover bytes.
4548
45492011-04-21 Eli Zaretskii <eliz@gnu.org>
afda1437 4550
ae940cca
EZ
4551 * doprnt.c (doprnt) [!HAVE_LONG_LONG_INT]: Error out instead of
4552 aborting when %lld or %lll format is passed.
4553 [!HAVE_UNSIGNED_LONG_LONG_INT]: Error out instead of aborting when
4554 %llo or %llx format is passed. (Bug#8545)
4555
03ab8921
EZ
4556 * window.c (window_scroll_line_based): Use a marker instead of
4557 simple variables to record original value of point. (Bug#7952)
4558
afda1437
EZ
4559 * doprnt.c (doprnt): Fix the case where a multibyte sequence
4560 produced by %s or %c overflows available buffer space. (Bug#8545)
4561
f76dee0c
PE
45622011-04-28 Paul Eggert <eggert@cs.ucla.edu>
4563
4564 * doprnt.c (doprnt): Omit useless test; int overflow check (Bug#8545).
283cdbef 4565 (SIZE_MAX): Move defn after all includes, as they might #define it.
f76dee0c 4566
fdc5744d
JB
45672011-04-28 Juanma Barranquero <lekktu@gmail.com>
4568
4569 * w32.c (init_environment): Warn about defaulting HOME to C:\.
4570
638f053a
JB
45712011-04-28 Juanma Barranquero <lekktu@gmail.com>
4572
4573 * keyboard.c (Qdelayed_warnings_hook): Define.
4574 (command_loop_1): Run `delayed-warnings-hook'
4575 if Vdelayed_warnings_list is non-nil.
4576 (syms_of_keyboard) <delayed-warnings-hook>: DEFSYM it.
4577 (syms_of_keyboard) <delayed-warnings-list>: DEFVAR_LISP it.
4578
d178f871
EZ
45792011-04-28 Eli Zaretskii <eliz@gnu.org>
4580
4581 * doprnt.c (doprnt): Don't return value smaller than the buffer
4582 size if the message was truncated. (Bug#8545).
4583
b124fd93
JB
45842011-04-28 Juanma Barranquero <lekktu@gmail.com>
4585
4586 * w32fns.c (Fx_change_window_property, Fx_delete_window_property)
4587 (Fx_window_property): #if-0 the whole functions, not just the bodies.
4588
e810457d
PE
45892011-04-27 Paul Eggert <eggert@cs.ucla.edu>
4590
4591 * doprnt.c (doprnt): Support "ll" length modifier, for long long.
4592
ea51cceb
JB
45932011-04-27 Juanma Barranquero <lekktu@gmail.com>
4594
4595 * makefile.w32-in: Update dependencies.
4596
94dcfacf
EZ
45972011-04-27 Eli Zaretskii <eliz@gnu.org>
4598
4599 Improve `doprnt' and its usage. (Bug#8545)
4600 * doprnt.c (doprnt): Make sure `format' is never accessed beyond
4601 `format_end'. Remove support for %l as a conversion specifier.
4602 Don't use xrealloc. Improve diagnostics when the %l size modifier
4603 is used. Update the commentary.
4604
4605 * eval.c (verror): Simplify calculation of size_t.
4606
4607 * coding.c (Ffind_operation_coding_system): Fix diagnostic error
4608 messages.
4609
f61f41d7
PE
46102011-04-27 Yoshiaki Kasahara <kasahara@nc.kyushu-u.ac.jp> (tiny change)
4611
4612 * buffer.c (init_buffer) [USE_MMAP_FOR_BUFFERS]: Adjust to aliasing
4613 change.
4614
96fb4434
PE
46152011-04-27 Paul Eggert <eggert@cs.ucla.edu>
4616
4617 * nsmenu.m: Replace all uses of XVECTOR with ASIZE and AREF.
4618 This makes this file independent of the recent pseudovector change.
4619
671875da 46202011-04-26 Paul Eggert <eggert@cs.ucla.edu>
eab3844f 4621
69e9b5a3
PE
4622 * keyboard.c (handle_user_signal): Fix pointer signedness problem.
4623
b5f869a7 4624 * gnutls.c (emacs_gnutls_handle_error): Remove unused local.
7754e151 4625 (Fgnutls_boot): gnutls_certificate_verify_peers2 wants unsigned *.
8d4c3955 4626 Remove unused local.
c8926152 4627 (emacs_gnutls_write): Don't use uninitialized rtnval if nbyte <= 0.
080e5a8d 4628
841a1577 4629 * lisp.h: Fix a problem with aliasing and vector headers. (Bug#8546)
04f2d78b
CB
4630 GCC 4.6.0 optimizes based on type-based alias analysis.
4631 For example, if b is of type struct buffer * and v of type struct
eab3844f
PE
4632 Lisp_Vector *, then gcc -O2 was incorrectly assuming that &b->size
4633 != &v->size, and therefore "v->size = 1; b->size = 2; return
4634 v->size;" must therefore return 1. This assumption is incorrect
4635 for Emacs, since it type-puns struct Lisp_Vector * with many other
4636 types. To fix this problem, this patch adds a new type struct
f904488f 4637 vectorlike_header that documents the constraints on layout of vectors
eab3844f
PE
4638 and pseudovectors, and helps optimizing compilers not get fooled
4639 by Emacs's type punning. It also adds the macros XSETTYPED_PVECTYPE
4640 XSETTYPED_PSEUDOVECTOR, TYPED_PSEUDOVECTORP, for similar reasons.
f904488f
PE
4641 * lisp.h (XSETTYPED_PVECTYPE): New macro, specifying the name of
4642 the size member.
eab3844f
PE
4643 (XSETPVECTYPE): Rewrite in terms of new macro.
4644 (XSETPVECTYPESIZE): New macro, specifying both type and size.
4645 This is a bit clearer, and further avoids the possibility of
4646 undesirable aliasing.
4647 (XSETTYPED_PSEUDOVECTOR): New macro, specifying the size.
f904488f 4648 (XSETPSEUDOVECTOR): Rewrite in terms of XSETTYPED_PSEUDOVECTOR.
eab3844f
PE
4649 (XSETSUBR): Rewrite in terms of XSETTYPED_PSEUDOVECTOR and XSIZE,
4650 since Lisp_Subr is a special case (no "next" field).
04f2d78b
CB
4651 (ASIZE): Now uses header.size rather than size.
4652 All previous uses of XVECTOR (foo)->size replaced to use this macro,
f904488f
PE
4653 to avoid the hassle of writing XVECTOR (foo)->header.size.
4654 (struct vectorlike_header): New type.
eab3844f
PE
4655 (TYPED_PSEUDOVECTORP): New macro, also specifying the C type of the
4656 object, to help avoid aliasing.
4657 (PSEUDOVECTORP): Rewrite in terms of TYPED_PSEUDOVECTORP.
4658 (SUBRP): Likewise, since Lisp_Subr is a special case.
4659 * lisp.h (struct Lisp_Vector, struct Lisp_Char_Table):
4660 (struct Lisp_Sub_Char_Table, struct Lisp_Bool_Vector):
4661 (struct Lisp_Hash_Table): Combine first two members into a single
f904488f 4662 struct vectorlike_header member. All uses of "size" and "next" members
eab3844f
PE
4663 changed to be "header.size" and "header.next".
4664 * buffer.h (struct buffer): Likewise.
4665 * font.h (struct font_spec, struct font_entity, struct font): Likewise.
4666 * frame.h (struct frame): Likewise.
4667 * process.h (struct Lisp_Process): Likewise.
4668 * termhooks.h (struct terminal): Likewise.
4669 * window.c (struct save_window_data, struct saved_window): Likewise.
4670 * window.h (struct window): Likewise.
4671 * alloc.c (allocate_buffer, Fmake_bool_vector, allocate_pseudovector):
4672 Use XSETPVECTYPESIZE, not XSETPVECTYPE, to avoid aliasing problems.
4673 * buffer.c (init_buffer_once): Likewise.
4674 * lread.c (defsubr): Use XSETTYPED_PVECTYPE, since Lisp_Subr is a
4675 special case.
4676 * process.c (Fformat_network_address): Use local var for size,
4677 for brevity.
4678
0df1eac5
PE
4679 * bytecode.c (exec_byte_code): Don't use XVECTOR before CHECK_VECTOR.
4680
847ab9d1 4681 Make the Lisp reader and string-to-float more consistent (Bug#8525)
452f4150
PE
4682 * data.c (atof): Remove decl; no longer used or needed.
4683 (digit_to_number): Move to lread.c.
4684 (Fstring_to_number): Use new string_to_number function, to be
4685 consistent with how the Lisp reader treats infinities and NaNs.
4686 Do not assume that floating-point numbers represent EMACS_INT
4687 without losing information; this is not true on most 64-bit hosts.
4688 Avoid double-rounding errors, by insisting on integers when
4689 parsing non-base-10 numbers, as the documentation specifies.
4690 * lisp.h (string_to_number): New decl, replacing ...
4691 (isfloat_string): Remove.
bc0a5c13 4692 * lread.c: Include <inttypes.h>, for uintmax_t and strtoumax.
d78050d6 4693 (read1): Do not accept +. and -. as integers; this
452f4150
PE
4694 appears to have been a coding error. Similarly, do not accept
4695 strings like +-1e0 as floating point numbers. Do not report
4696 overflow for integer overflows unless the base is not 10 which
4697 means we have no simple and reliable way to continue.
4698 Break out the floating-point parsing into a new
4699 function string_to_number, so that Fstring_to_number parses
4700 floating point numbers consistently with the Lisp reader.
04f2d78b 4701 (digit_to_number): Move here from data.c. Make it static inline.
452f4150
PE
4702 (E_CHAR, EXP_INT): Remove, replacing with ...
4703 (E_EXP): New macro, to solve the "1.0e+" problem mentioned below.
4704 (string_to_number): New function, replacing isfloat_string.
4705 This function checks for valid syntax and produces the resulting
4706 Lisp float number too. Rework it so that string-to-number
bc0a5c13 4707 no longer mishandles examples like "1.0e+". Use strtoumax,
d78050d6
PE
4708 so that overflow for non-base-10 numbers is reported only when
4709 there's no portable and simple way to convert to floating point.
452f4150 4710
67769ffc
PE
4711 * textprop.c (set_text_properties_1): Rewrite for clarity,
4712 and to avoid GCC warning about integer overflow.
4713
c20db43f
PE
4714 * intervals.h (struct interval): Use EMACS_INT for members
4715 where EMACS_UINT might cause problems. See
4716 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00514.html>.
4717 (CHECK_TOTAL_LENGTH): Remove cast to EMACS_INT; no longer needed.
4718 * intervals.c (interval_deletion_adjustment): Now returns EMACS_INT.
4719 All uses changed.
37aa2f85
PE
4720 (offset_intervals): Tell GCC not to worry about length overflow
4721 when negating a negative length.
c20db43f 4722
2538aa2f
PE
4723 * alloc.c (overrun_check_malloc, overrun_check_realloc): Now static.
4724 (overrun_check_free): Likewise.
4725
f2d3008d
PE
4726 * alloc.c (SDATA_SIZE) [!GC_CHECK_STRING_BYTES]: Avoid runtime check
4727 in the common case where SDATA_DATA_OFFSET is a multiple of Emacs
4728 word size.
4729
ec8df744
PE
4730 * gnutls.c: Fix problems found by GCC 4.6.0 on Ubuntu 10.10.
4731 (gnutls_make_error): Rename local to avoid shadowing.
4732 (gnutls_emacs_global_deinit): ifdef out; not used.
4733 (Fgnutls_boot): Use const for pointer to readonly storage.
4734 Comment out unused local. Fix pointer signedness problems.
4735
640ee02d
PE
4736 * lread.c (openp): Don't stuff size_t into an 'int'.
4737 Use <= on length, not < on length + 1, to avoid GCC 4.6.0 warning
4738 about possible signed overflow.
4739
6048fb2a
PE
4740 * gtkutil.c: Fix problems found by GCC 4.6.0 on Ubuntu 10.10.
4741 (GDK_KEY_g): Don't define if already defined.
4742 (xg_prepare_tooltip): Avoid pointer signedness problem.
4743 (xg_set_toolkit_scroll_bar_thumb): Redo to avoid two casts.
4744
fa3c87e1
PE
4745 * process.c (Fnetwork_interface_info): Avoid left-shift undefined
4746 behavior with 1 << 31. GCC 4.6.0 warns about this on 32-bit hosts.
4747
2172544b
PE
4748 * xfns.c (Fx_window_property): Simplify a bit,
4749 to make a bit faster and to avoid GCC 4.6.0 warning.
4750 * xselect.c (x_get_window_property, x_handle_dnd_message): Likewise.
4751
9b821a21
PE
4752 * fns.c (internal_equal): Don't assume size_t fits in int.
4753
3c616cfa
PE
4754 * alloc.c (compact_small_strings): Tighten assertion a little.
4755
c2982e87
PE
4756 Replace pEd with more-general pI, and fix some printf arg casts.
4757 * lisp.h (pI): New macro, generalizing old pEd macro to other
4758 conversion specifiers. For example, use "...%"pI"d..." rather
4759 than "...%"pEd"...".
4760 (pEd): Remove. All uses replaced with similar uses of pI.
4761 * src/m/amdx86-64.h, src/m/ia64.h, src/m/ibms390x.h: Likewise.
4762 * alloc.c (check_pure_size): Don't overflow by converting size to int.
4763 * bidi.c (bidi_dump_cached_states): Use pI to avoid cast.
4764 * data.c (Fnumber_to_string): Use pI instead of if-then-else-abort.
4765 * dbusbind.c (xd_append_arg): Use pI to avoid cast.
4766 (Fdbus_method_return_internal, Fdbus_method_error_internal): Likewise.
4767 * font.c (font_unparse_xlfd): Avoid potential buffer overrun on
4768 64-bit hosts.
4769 (font_unparse_xlfd, font_unparse_fcname): Use pI to avoid casts.
4770 * keyboard.c (record_char, modify_event_symbol): Use pI to avoid casts.
4771 * print.c (safe_debug_print, print_object): Likewise.
4772 (print_object): Don't overflow by converting EMACS_INT or EMACS_UINT
4773 to int.
6f04d126
PE
4774 Use pI instead of if-then-else-abort. Use %p to avoid casts,
4775 avoiding the 0 flag, which is not portable.
c2982e87
PE
4776 * process.c (Fmake_network_process): Use pI to avoid cast.
4777 * region-cache.c (pp_cache): Likewise.
4778 * xdisp.c (decode_mode_spec): Likewise.
4779 * xrdb.c (x_load_resources) [USE_MOTIF]: Use pI to avoid undefined
4780 behavior on 64-bit hosts with printf arg.
6f04d126 4781 * xselect.c (x_queue_event): Use %p to avoid casts, avoiding 0 flag.
c2982e87
PE
4782 (x_stop_queuing_selection_requests): Likewise.
4783 (x_get_window_property): Don't truncate byte count to an 'int'
4784 when tracing.
0b432f21 4785
5e073ec7
PE
4786 * frame.c (frame_name_fnn_p): Get rid of strtol, which isn't right
4787 here, since it parses constructs like leading '-' and spaces,
4788 which are not wanted; and it overflows with large numbers.
4789 Instead, simply match F[0-9]+, which is what is wanted anyway.
4790
36372bf9
PE
4791 * alloc.c: Remove unportable assumptions about struct layout.
4792 (SDATA_SELECTOR, SDATA_DATA_OFFSET): New macros.
4793 (SDATA_OF_STRING, SDATA_SIZE, allocate_string_data):
4794 (allocate_vectorlike, make_pure_vector): Use the new macros,
4795 plus offsetof, to remove unportable assumptions about struct layout.
4796 These assumptions hold on all porting targets that I know of, but
4797 they are not guaranteed, they're easy to remove, and removing them
4798 makes further changes easier.
4799
0b432f21
PE
4800 * alloc.c (BLOCK BYTES): Fix typo by changing "ablock" to "ablocks".
4801 This doesn't fix a bug but makes the code clearer.
bfd1c781
PE
4802 (string_overrun_cookie): Now const. Use initializers that
4803 don't formally overflow signed char, to avoid warnings.
000098c1
PE
4804 (allocate_string_data) [GC_CHECK_STRING_OVERRUN]: Fix typo that
4805 can cause Emacs to crash when string overrun checking is enabled.
c7bda33c
PE
4806 (allocate_buffer): Don't assume sizeof (struct buffer) is a
4807 multiple of sizeof (EMACS_INT); it need not be, if
4808 alignof(EMACS_INT) < sizeof (EMACS_INT).
d0f4e1f5 4809 (check_sblock, check_string_bytes, check_string_free_list): Protoize.
0b432f21 4810
895009e1
JB
48112011-04-26 Juanma Barranquero <lekktu@gmail.com>
4812
4813 * keyboard.c (QCrtl): Rename from Qrtl. All uses changed.
4814
6a7a1b0b
TZ
48152011-04-26 Teodor Zlatanov <tzz@lifelogs.com>
4816
4817 * gnutls.c (emacs_gnutls_handshake): Return an error if we're not
b5f869a7 4818 supposed to be handshaking. (Bug#8556)
6a7a1b0b
TZ
4819 Reported by Paul Eggert <eggert@cs.ucla.edu>.
4820
841a1577 48212011-04-26 Daniel Colascione <dan.colascione@gmail.com>
0438ce91
DC
4822
4823 * lisp.h (Qdebug): List symbol.
895009e1 4824 * eval.c (Qdebug): Restore global linkage.
0438ce91
DC
4825 * keyboard.c (debug-on-event): New variable.
4826 (handle_user_signal): Break into debugger when debug-on-event
4827 matches the current signal symbol.
4828
f2d3ba6f
DN
48292011-04-25 Dan Nicolaescu <dann@ics.uci.edu>
4830
4831 * alloc.c (check_sblock, check_string_bytes)
4832 (check_string_free_list): Convert to standard C.
4833
42ce4c63
TZ
48342011-04-25 Teodor Zlatanov <tzz@lifelogs.com>
4835
4836 * w32.c (emacs_gnutls_push): Fix typo.
4837
825cd63c
EZ
48382011-04-25 Eli Zaretskii <eliz@gnu.org>
4839
fb11d64d
EZ
4840 * gnutls.c (emacs_gnutls_handshake): Avoid compiler warnings about
4841 "cast to pointer from integer of different size".
4842
825cd63c
EZ
4843 Improve doprnt and its use in verror. (Bug#8545)
4844 * doprnt.c (doprnt): Document the set of format control sequences
4845 supported by the function. Use SAFE_ALLOCA instead of always
4846 using `alloca'.
4847
4848 * eval.c (verror): Don't limit the buffer size at size_max-1, that
4849 is one byte too soon. Don't use xrealloc; instead xfree and
4850 xmalloc anew.
4851
e061a11b
TZ
48522011-04-24 Teodor Zlatanov <tzz@lifelogs.com>
4853
4854 * gnutls.h: Add GNUTLS_STAGE_CALLBACKS enum to denote we're in the
4855 callbacks stage.
4856
4857 * gnutls.c: Renamed global_initialized to
4858 gnutls_global_initialized. Added internals for the
4859 :verify-hostname-error, :verify-error, and :verify-flags
4860 parameters of `gnutls-boot' and documented those parameters in the
4861 docstring. Start callback support.
9173deec
JB
4862 (emacs_gnutls_handshake): Add Woe32 support. Retry handshake
4863 unless a fatal error occurred. Call gnutls_alert_send_appropriate
4864 on error. Return error code.
e061a11b
TZ
4865 (emacs_gnutls_write): Call emacs_gnutls_handle_error.
4866 (emacs_gnutls_read): Likewise.
4867 (Fgnutls_boot): Return handshake error code.
4868 (emacs_gnutls_handle_error): New function.
4869 (wsaerror_to_errno): Likewise.
4870
4871 * w32.h (emacs_gnutls_pull): Add prototype.
4872 (emacs_gnutls_push): Likewise.
4873
4874 * w32.c (emacs_gnutls_pull): New function for GnuTLS on Woe32.
4875 (emacs_gnutls_push): Likewise.
4876
48772011-04-24 Claudio Bley <claudio.bley@gmail.com> (tiny change)
4878
4879 * process.c (wait_reading_process_output): Check if GnuTLS
4880 buffered some data internally if no FDs are set for TLS
4881 connections.
4882
4883 * makefile.w32-in (OBJ2): Add gnutls.$(O).
4884 (LIBS): Link to USER_LIBS.
4885 ($(BLD)/gnutls.$(0)): New target.
4886
fa6996bc
EZ
48872011-04-24 Eli Zaretskii <eliz@gnu.org>
4888
eb35682e
EZ
4889 * xdisp.c (handle_single_display_spec): Rename the
4890 display_replaced_before_p argument into display_replaced_p, to
4891 make it consistent with the commentary. Fix typos in the
4892 commentary.
4893
e2ad650c
EZ
4894 * textprop.c (syms_of_textprop): Remove dead code.
4895 (copy_text_properties): Delete obsolete commentary about an
4896 interface that was deleted long ago. Fix typos in the description
4897 of arguments.
4898
1b2de274
EZ
4899 * msdos.c (XMenuActivate, XMenuAddSelection): Adjust argument list
4900 to changes in oldXMenu/XMenu.h from 2011-04-16.
4901 <menu_help_message, prev_menu_help_message>: Constify.
4902 (IT_menu_make_room): menu->help_text is now `const char **';
4903 adjust.
4904
4905 * msdos.h (XMenuActivate, XMenuAddSelection): Adjust prototypes
4906 to changes in oldXMenu/XMenu.h from 2011-04-16.
4907 (struct XMenu): Declare `help_text' `const char **'.
4908
4909 * xfaces.c <Qunspecified>: Make extern again.
4910
4911 * syntax.c: Include sys/types.h before including regex.h, as
4912 required by Posix.
4913
762b15be
EZ
4914 * doc.c (get_doc_string): Improve the format passed to `error'.
4915
4916 * doprnt.c (doprnt): Improve commentary.
4917
4918 * term.c (init_tty) [MSDOS]: Fix 1st argument to maybe_fatal.
4919
4920 * Makefile.in (TAGS): Depend on $(M_FILE) and $(S_FILE), and scan
4921 them with etags.
4922
f1052e5d
EZ
4923 * makefile.w32-in (globals.h): Add a dummy recipe, to make any
4924 changes in globals.h immediately force recompilation.
762b15be
EZ
4925 (TAGS): Depend on $(CURDIR)/m/intel386.h and
4926 $(CURDIR)/s/ms-w32.h.
4927 (TAGS-gmake): Scan $(CURDIR)/m/intel386.h and $(CURDIR)/s/ms-w32.h.
f1052e5d 4928
fa6996bc
EZ
4929 * character.c (Fchar_direction): Function deleted.
4930 (syms_of_character): Don't defsubr it.
4931 <char-direction-table>: Deleted.
4932
e6c3da20
EZ
49332011-04-23 Eli Zaretskii <eliz@gnu.org>
4934
4935 Fix doprnt so it could be used again safely in `verror'. (Bug#8435)
4936 * doprnt.c: Include limits.h.
4937 (SIZE_MAX): New macro.
04f2d78b
CB
4938 (doprnt): Return a size_t value. 2nd arg is now size_t.
4939 Many local variables are now size_t instead of int or unsigned.
e6c3da20
EZ
4940 Improve overflow protection. Support `l' modifier for integer
4941 conversions. Support %l conversion. Don't assume an EMACS_INT
4942 argument for integer conversions and for %c.
4943
4944 * lisp.h (doprnt): Restore prototype.
4945
4946 * makefile.w32-in ($(BLD)/callint.$(O)): Depend on
4947 $(SRC)/character.h.
4948
4949 * Makefile.in (base_obj): Add back doprnt.o.
4950
4951 * deps.mk (doprnt.o): Add back prerequisites.
4952 (callint.o): Depend on character.h.
4953
4954 * eval.c (internal_lisp_condition_case): Include the handler
4955 representation in the error message.
4956 (verror): Call doprnt instead of vsnprintf. Fix an off-by-one bug
4957 when breaking from the loop.
4958
4959 * xdisp.c (vmessage): Call doprnt instead of vsnprintf.
4960
4961 * callint.c (Fcall_interactively): When displaying error message
4962 about invalid control letter, pass the character's codepoint, not
4963 a pointer to its multibyte form. Improve display of the character
4964 in octal and display also its hex code.
4965
4966 * character.c (char_string): Use %x to display the (unsigned)
4967 codepoint of an invalid character, to avoid displaying a bogus
4968 negative value.
4969
4970 * font.c (check_otf_features): Pass SDATA of SYMBOL_NAME to
4971 `error', not SYMBOL_NAME itself.
4972
4973 * coding.c (Fencode_sjis_char, Fencode_big5_char): Use %c for
4974 character arguments to `error'.
4975
4976 * charset.c (check_iso_charset_parameter): Fix incorrect argument
4977 to `error' in error message about FINAL_CHAR argument. Make sure
4978 FINAL_CHAR is a character, and use %c when it is passed as
4979 argument to `error'.
4980
4ffd0d6b 49812011-04-23 Eli Zaretskii <eliz@gnu.org>
97a93095
EZ
4982
4983 * s/ms-w32.h (localtime): Redirect to sys_localtime.
4984
4985 * w32.c: Include <time.h>.
4986 (sys_localtime): New function.
4987
4ffd0d6b 49882011-04-23 Chong Yidong <cyd@stupidchicken.com>
c17819f4
CY
4989
4990 * xdisp.c (init_xdisp): Initialize echo_area_window (Bug#6451).
4991
4ffd0d6b 4992 * buffer.c (syms_of_buffer): Doc fix (Bug#6902).
aac0c6e3 4993
4ffd0d6b 49942011-04-23 Samuel Thibault <sthibault@debian.org> (tiny change)
aac0c6e3 4995
4ffd0d6b
GM
4996 * sysdep.c (wait_for_termination): On GNU Hurd, kill returns -1 on
4997 zombies (Bug#8467).
aac0c6e3 4998
04c56954
EZ
49992011-04-19 Eli Zaretskii <eliz@gnu.org>
5000
5001 * syntax.h (SETUP_SYNTAX_TABLE_FOR_OBJECT): Fix setting of
5002 gl_state.e_property when gl_state.object is Qt.
5003
5004 * insdel.c (make_gap_larger): Remove limitation of buffer size
5005 to <= INT_MAX.
5006
16a43933
CY
50072011-04-18 Chong Yidong <cyd@stupidchicken.com>
5008
5009 * xdisp.c (lookup_glyphless_char_display)
5010 (produce_glyphless_glyph): Handle cons cell entry in
5011 glyphless-char-display.
5012 (Vglyphless_char_display): Document it.
5013
5014 * term.c (produce_glyphless_glyph): Handle cons cell entry in
5015 glyphless-char-display.
5016
4581706e
CY
50172011-04-17 Chong Yidong <cyd@stupidchicken.com>
5018
5019 * xdisp.c (get_next_display_element): Remove unnecessary ifdefs.
5020
5021 * termhooks.h (FRAME_WINDOW_P): Remove duplicated definitions.
5022
5023 * dispextern.h (FACE_SUITABLE_FOR_ASCII_CHAR_P): Add missing
5024 definition for no-X builds.
5025
4887c6e2 50262011-04-16 Paul Eggert <eggert@cs.ucla.edu>
764430a3 5027
fd35b6f9
PE
5028 Static checks with GCC 4.6.0 and non-default toolkits.
5029
5c1ccb01
PE
5030 * s/sol2-6.h, s/unixware.h (PTY_TTY_NAME_SPRINTF): Protoize decl.
5031
006c5daa
PE
5032 * process.c (keyboard_bit_set): Define only if SIGIO.
5033 (send_process_trap): Mark it with NO_RETURN if it doesn't return.
5034 (send_process): Repair possible setjmp clobbering.
5035
efc736d3
PE
5036 * s/usg5-4-common.h (SETUP_SLAVE_PTY): Don't pass extra arg to 'fatal'.
5037
4e2fe2e6
PE
5038 * eval.c: Include <stdio.h>, for vsnprintf on non-GNU/Linux hosts.
5039
f97334a2
PE
5040 * data.c (arith_error): Mark with NO_RETURN if it doesn't return.
5041
4e75f29d
PE
5042 * alloc.c (bytes_used_when_full, SPARE_MEMORY, BYTES_USED):
5043 Define only if needed.
5044
90efadd1
PE
5045 * sysdep.c (_FILE_OFFSET_BITS): Make this hack even uglier
5046 by pacifying GCC about it. Maybe it's time to retire it?
875975e9 5047 * xfaces.c (USG, __TIMEVAL__): Likewise.
90efadd1 5048
3c647824
PE
5049 * dispextern.h (struct redisplay_interface): Rename param
5050 to avoid shadowing.
e264f262 5051 * termhooks.h (struct terminal): Likewise.
761383f4 5052 * xterm.c (xembed_send_message): Likewise.
3c647824 5053
b58c5c4a
PE
5054 * insdel.c (make_gap_smaller): Define only if
5055 USE_MMAP_FOR_BUFFERS || REL_ALLOC || DOUG_LEA_MALLOC.
5056
cad59032
PE
5057 * keyboard.c (read_char): Make a var volatile so longjmp won't clobber
5058 it.
5059
c339dc2e
PE
5060 * emacs.c (MAX_HEAP_BSS_DIFF, my_edata): Move to where they're used,
5061 so that we aren't warned about unused symbols.
5062
91a3e27b
PE
5063 * xfns.c (Fx_file_dialog): Rename local to avoid shadowing.
5064
399c71d3 5065 * xdisp.c (x_produce_glyphs): Mark var as initialized (Bug#8512).
7a3fb125 5066
8ffc96f5
PE
5067 * xfns.c (x_real_positions): Mark locals as initialized.
5068
eef9bc79
PE
5069 * xmenu.c (xmenu_show): Don't use uninitialized vars.
5070
098db9dd
PE
5071 * xterm.c: Fix problems found by static analysis with other toolkits.
5072 (toolkit_scroll_bar_interaction): Define and use only if USE_X_TOOLKIT.
dda3aedd
PE
5073 (x_dispatch_event): Declare static if USE_GTK, and
5074 define if USE_GTK || USE_X_TOOLKIT.
098db9dd 5075 (SET_SAVED_BUTTON_EVENT): Define only if USE_X_TOOLKIT || USE_GTK.
dda3aedd 5076 * xterm.h (x_dispatch_event): Extern only if USE_X_TOOLKIT.
841a1577
JB
5077 * xterm.c, xterm.h (x_mouse_leave): Bring this function back, but only
5078 if defined HAVE_MENUS && !defined USE_X_TOOLKIT && !defined USE_GTK.
098db9dd 5079
eb18f6cc
PE
5080 * xmenu.c (menu_help_callback): Pointer type fixes.
5081 Use const pointers when pointing at readonly data. Avoid pointer
5082 signedness clashes.
5083 (FALSE): Remove unused macro.
5084 (update_frame_menubar): Remove unused decl.
5085
1fe72bf8
PE
5086 * xfns.c (Fx_hide_tip): Move locals to avoid shadowing.
5087
60d9e1db
PE
5088 * menu.c (push_submenu_start, push_submenu_end): Do not define unless
5089 USE_X_TOOLKIT || USE_GTK || HAVE_NS || defined HAVE_NTGUI.
5090 (single_menu_item): Rename local to avoid shadowing.
5091
39261c26
PE
5092 * keyboard.c (make_lispy_event): Remove unused local var.
5093
018c5e19
PE
5094 * frame.c, frame.h (x_get_resource_string): Bring this back, but
5095 only if HAVE_X_WINDOWS && !USE_X_TOOLKIT.
5096
63d2b86e
PE
5097 * bitmaps: Change bitmaps from unsigned char back to the X11
5098 compatible char. Avoid the old compiler warnings about
5099 out-of-range initializers by using, for example, '\xab' rather
5100 than 0xab.
5101
aefd87e1
PE
5102 * xgselect.c (xgselect_initialize): Check vs interface
5103 even if ! (defined (USE_GTK) || defined (HAVE_GCONF)).
5104
bf501fb9
PE
5105 * xmenu.c (xmenu_show): Rename parm to avoid shadowing.
5106
e9829fdf
PE
5107 * xterm.c (x_create_toolkit_scroll_bar): Use const * for pointers
5108 to read-only memory.
5109
1086c095
PE
5110 * fns.c (vector): Remove; this old hack is no longer needed.
5111
2baccd04 5112 * xsmfns.c (create_client_leader_window): Rename shadowing arg.
401f10cb 5113 Remove unused var.
dde42981 5114 (gdk_x11_set_sm_client_id) [!USE_GTK]: Don't define.
2baccd04 5115
72391843 5116 * xrdb.c (x_load_resources): Omit unused local.
3565b346 5117
436c16df 5118 * xfns.c (free_frame_menubar, atof): Remove duplicate decls.
8a94ea33 5119 (x_window): Rename locals to avoid shadowing.
dc5ddd85 5120 (USG): Use the kludged USG macro, to pacify gcc.
436c16df 5121
92bb796d 5122 * xterm.c (x_alloc_nearest_color_for_widget): Remove; unused.
bbbef9e1 5123 (x_term_init): Remove local to avoid shadowing.
92bb796d 5124
764430a3 5125 * xfns.c, xterm.c (_XEditResCheckMessages): Protoize decl.
4887c6e2
PE
5126
5127 * xdisp.c, dispextern.h (set_vertical_scroll_bar): Now extern if
5128 USE_TOOLKIT_SCROLL_BARS && !USE_GTK, as xterm.c needs it then.
5129
d1dfb56c
EZ
51302011-04-16 Eli Zaretskii <eliz@gnu.org>
5131
c4354cb4
EZ
5132 * gnutls.c (Fgnutls_boot): Don't pass Lisp_Object to `error'.
5133
d1dfb56c
EZ
5134 Fix regex.c, syntax.c and friends for buffers > 2GB.
5135 * syntax.h (struct gl_state_s): Declare character position members
5136 EMACS_INT.
5137
5138 * syntax.c (update_syntax_table): Declare 2nd argument EMACS_INT.
5139
04f2d78b
CB
5140 * textprop.c (verify_interval_modification, interval_of):
5141 Declare arguments EMACS_INT.
d1dfb56c
EZ
5142
5143 * intervals.c (adjust_intervals_for_insertion): Declare arguments
5144 EMACS_INT.
5145
5146 * intervals.h (CHECK_TOTAL_LENGTH): Cast to EMACS_INT, not `int'.
5147
5148 * indent.c (Fvertical_motion): Local variable it_start is now
5149 EMACS_INT.
5150
5151 * regex.c (re_match, re_match_2, re_match_2_internal)
5152 (bcmp_translate, regcomp, regexec, print_double_string)
5153 (group_in_compile_stack, re_search, re_search_2, regex_compile)
5154 (re_compile_pattern, re_exec): Declare arguments and local
5155 variables `size_t' and `ssize_t' and return values `regoff_t', as
5156 appropriate.
5157 (POP_FAILURE_REG_OR_COUNT) <pfreg>: Declare `long'.
5158 (CHECK_INFINITE_LOOP) <failure>: Declare `ssize_t'.
5159 <compile_stack_type>: `size' and `avail' are now `size_t'.
5160
5161 * regex.h <regoff_t>: Use ssize_t, not int.
5162 (re_search, re_search_2, re_match, re_match_2): Arguments that
5163 specify buffer/string position and length are now ssize_t and
5164 size_t. Return type is regoff_t.
5165
613052cd
BK
51662011-04-16 Ben Key <bkey76@gmail.com>
5167
5168 * nsfont.m: Fixed bugs in ns_get_family and
5169 ns_descriptor_to_entity that were caused by using free to
5170 deallocate memory blocks that were allocated by xmalloc (via
5171 xstrdup). This caused Emacs to crash when compiled with
5172 XMALLOC_OVERRUN_CHECK defined (when Emacs was configured with
5173 --enable-checking=xmallocoverrun). xfree is now used to
5174 deallocate these memory blocks.
5175
4170f62f 51762011-04-15 Paul Eggert <eggert@cs.ucla.edu>
3e047f51 5177
71b41406
PE
5178 * sysdep.c (emacs_read): Remove unnecessary check vs MAX_RW_COUNT.
5179
9587a89d
PE
5180 emacs_write: Accept and return EMACS_INT for sizes.
5181 See http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00514.html
5182 et seq.
5183 * gnutls.c, gnutls.h (emacs_gnutls_read, emacs_gnutls_write):
5184 Accept and return EMACS_INT.
5185 (emacs_gnutls_write): Return the number of bytes written on
5186 partial writes.
5187 * sysdep.c, lisp.h (emacs_read, emacs_write): Likewise.
273a5f82
PE
5188 (emacs_read, emacs_write): Remove check for negative size, as the
5189 Emacs source code has been audited now.
9587a89d
PE
5190 * sysdep.c (MAX_RW_COUNT): New macro, to work around kernel bugs.
5191 (emacs_read, emacs_write): Use it.
273a5f82
PE
5192 * process.c (send_process): Adjust to the new signatures of
5193 emacs_write and emacs_gnutls_write. Do not attempt to store
5194 a byte offset into an 'int'; it might overflow.
9587a89d 5195 See http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00483.html
273a5f82 5196
3e047f51
PE
5197 * sound.c: Don't assume sizes fit in 'int'.
5198 (struct sound_device.period_size, alsa_period_size):
9c3c56a7 5199 Return EMACS_INT, not int.
3e047f51 5200 (struct sound_device.write, vox_write, alsa_write):
9c3c56a7
PE
5201 Accept EMACS_INT, not int.
5202 (wav_play, au_play): Use EMACS_INT to store sizes and to
3e047f51
PE
5203 record read return values.
5204
cc39a9db
BK
52052011-04-15 Ben Key <bkey76@gmail.com>
5206
c9d0ec6d
JB
5207 * keyboard.c (Qundefined): Don't declare static since it is used
5208 in nsfns.m.
5209 * xfaces.c (Qbold, Qexpanded, Qitalic, Qcondensed): Don't declare
5210 static since they are used in nsfont.m.
cc39a9db 5211
6c60eb9f
SM
52122011-04-15 Stefan Monnier <monnier@iro.umontreal.ca>
5213
5214 * process.c (Qprocessp): Don't declare static.
5215 * lisp.h (Qprocessp): Declare again.
5216
7990b61a
JB
52172011-04-15 Juanma Barranquero <lekktu@gmail.com>
5218
5219 * font.c (Qopentype): Don't make static (used from w32uniscribe.c).
5220
5d4cb038
PE
52212011-04-14 Paul Eggert <eggert@cs.ucla.edu>
5222
8bd7b830 5223 Improve C-level modularity by making more things 'static'.
cd64ea1d 5224
e3b27b31
PE
5225 Don't publish debugger-only interfaces to other modules.
5226 * lisp.h (safe_debug_print, debug_output_compilation_hack):
5227 (verify_bytepos, count_markers): Move decls to the only modules
5228 that need them.
5229 * region-cache.h (pp_cache): Likewise.
5230 * window.h (check_all_windows): Likewise.
5231 * marker.c, print.c, region-cache.c, window.c: Decls moved here.
5232
5d4cb038
PE
5233 * sysdep.c (croak): Now static, if
5234 defined TIOCNOTTY || defined USG5 || defined CYGWIN.
5235 * syssignal.h (croak): Declare only if not static.
69003fd8
PE
5236
5237 * alloc.c (refill_memory_reserve): Now static if
5238 !defined REL_ALLOC || defined SYSTEM_MALLOC.
5239 * lisp.h (refill_memory_reserve): Declare only if not static.
93ea6e8f 5240
e87b6180
PE
5241 * xsettings.c, xsettings.h (xsettings_get_system_normal_font):
5242 Define only if USE_LUCID.
5243
ac64929e
PE
5244 * xrdb.c (x_customization_string, x_rm_string): Now static.
5245
6f37259d
PE
5246 * xmenu.c (x_menu_wait_for_event): Export only if USE_MOTIF.
5247 * xterm.h (x_menu_wait_for_event): Declare only if USE_MOTIF.
5248
1683e3ab
PE
5249 * xdisp.c (draw_row_with_mouse_face): Now static.
5250 * dispextern.h (draw_row_with_mouse_fave): Remove decl.
5251
de9c2632
PE
5252 * window.h (check_all_windows): Mark externally visible.
5253
2b96acb7
PE
5254 * window.c (window_deletion_count): Now static.
5255
5256 * undo.c: Make symbols static if they're not exported.
5257 (last_undo_buffer, last_boundary_position, pending_boundary):
5258 Now static.
5259
50436f33
PE
5260 * textprop.c (interval_insert_behind_hooks): Now static.
5261 (interval_insert_in_front_hooks): Likewise.
5262
64520e5c
PE
5263 * term.c: Make symbols static if they're not exported.
5264 (tty_turn_off_highlight, get_tty_terminal, max_frame_cols):
5265 (max_frame_lines, tty_set_terminal_modes):
5266 (tty_reset_terminal_modes, tty_turn_off_highlight):
5267 (get_tty_terminal): Now static.
5268 (term_mouse_moveto): Do not define if HAVE_WINDOW_SYSTEM.
5269 * termhooks.h (term_mouse_moveto): Do not declare if
8bd7b830 5270 HAVE_WINDOW_SYSTEM.
64520e5c
PE
5271 * dispextern.h (tty_set_terminal_modes, tty_reset_terminal_modes):
5272 (tty_turn_off_highlight, get_tty_terminal): Remove decls.
5273
1fa53021
PE
5274 * sysdep.c: Make symbols static if they're not exported.
5275 (emacs_get_tty, emacs_set_tty, old_fcntl_flags, old_fcntl_owner):
5276 Now static.
5277 (sigprocmask_set, full_mask): Remove; unused.
5278 (wait_debugging): Mark as visible.
5279 * syssignal.h (SIGFULLMASK, full_mask): Remove decls.
5280 * systty.h (emacs_get_tty, emacs_set_tty): Remove decls.
5281
d4b43b22
PE
5282 * syntax.c (syntax_temp): Define only if !__GNUC__.
5283
b7c513d0
PE
5284 * sound.c (current_sound_device, current_sound): Now static.
5285
989b29ad
PE
5286 * search.c (searchbufs, searchbuf_head): Now static.
5287
13a55a78
PE
5288 * scroll.c (scroll_cost): Remove; unused.
5289 * dispextern.h (scroll_cost): Remove decl.
5290
de68a1fc
PE
5291 * region-cache.h (pp_cache): Mark as externally visible.
5292
40ccffa6
PE
5293 * process.c: Make symbols static if they're not exported.
5294 (process_tick, update_tick, create_process, chan_process):
5295 (Vprocess_alist, proc_buffered_char, datagram_access):
5296 (fd_callback_data, send_process_frame, process_sent_to): Now static.
5297 (deactivate_process): Mark defn as static, as well as decl.
5298 * lisp.h (create_process): Remove decl.
5299 * process.h (chan_process, Vprocess_alist): Remove decls.
5300
ad64fc97
PE
5301 * print.c: Make symbols static if they're not exported.
5302 (print_depth, new_backquote_output, being_printed, print_buffer):
5303 (print_buffer_size, print_buffer_pos, print_buffer_pos_byte):
5304 (print_interval, print_number_index, initial_stderr_stream):
5305 Now static.
5306 * lisp.h (Fprinc): Remove decl.
5307 (debug_output_compilation_hack): Mark as externally visible.
5308
adddb265
PE
5309 * sysdep.c (croak): Move decl from here to syssignal.h.
5310 * syssignal.h (croak): Put it here, so the API can be checked when
5311 'croak' is called from dissociate_if_controlling_tty.
5312
1717ede2
PE
5313 * minibuf.c: Make symbols static if they're not exported.
5314 (minibuf_save_list, choose_minibuf_frame): Now static.
5315 * lisp.h (choose_minibuf_frame): Remove decl.
5316
fa5fb2bc
PE
5317 * lisp.h (verify_bytepos, count_markers): Mark as externally visible.
5318
1e3890d1
PE
5319 * lread.c: Make symbols static if they're not exported.
5320 (read_objects, initial_obarray, oblookup_last_bucket_number):
5321 Now static.
5322 (make_symbol): Remove; unused.
5323 * lisp.h (initial_obarray, make_symbol): Remove decls.
5324
8a1414fa
PE
5325 * keyboard.c: Make symbols static if they're not exported.
5326 (single_kboard, recent_keys_index, total_keys, recent_keys):
5327 (this_command_key_count_reset, raw_keybuf, raw_keybuf_count):
5328 (this_single_command_key_start, echoing, last_auto_save):
5329 (read_key_sequence_cmd, dribble, recursive_edit_unwind):
5330 (command_loop, echo_now, keyboard_init_hook, help_char_p):
5331 (quit_throw_to_read_char, command_loop_2, top_level_1, poll_timer):
5332 (Vlispy_mouse_stem, double_click_count):
5333 Now static.
5334 (force_auto_save_soon): Define only if SIGDANGER.
5335 (ignore_mouse_drag_p): Now static if
5336 !defined HAVE_WINDOW_SYSTEM || defined USE_GTK || defined HAVE_NS.
5337 (print_help): Remove; unused.
5338 (stop_character, last_timer_event): Mark as externally visible.
5339 * keyboard.h (ignore_mouse_drag_p): Declare only if
5340 defined HAVE_WINDOW_SYSTEM && !defined USE_GTK && !defined HAVE_NS.
5341 (echo_now, help_char_p, quit_throw_to_read_char): Remove decls.
5342 * lisp.h (echoing): Remove decl.
5343 (force_auto_save_soon): Declare only if SIGDANGER.
5344 * xdisp.c (redisplay_window): Simplify code, to make it more
5345 obvious that ignore_mouse_drag_p is not accessed if !defined
5346 USE_GTK && !defined HAVE_NS.
5347
93ea6e8f
PE
5348 * intervals.c: Make symbols static if they're not exported.
5349 (merge_properties_sticky, merge_interval_right, delete_interval):
5350 Now static.
5351 * intervals.h (merge_interval_right, delete_interval): Remove decls.
5352
77382fcc
PE
5353 * insdel.c: Make symbols static if they're not exported.
5354 However, leave prepare_to_modify_buffer alone. It's never
5355 called from outside this function, but that appears to be a bug.
5356 (combine_after_change_list, combine_after_change_buffer):
4889fc82 5357 (adjust_after_replace, signal_before_change): Now static.
77382fcc
PE
5358 (adjust_after_replace_noundo): Remove; unused.
5359 * lisp.h (adjust_after_replace, adjust_after_replace_noundo):
4889fc82 5360 (signal_before_change): Remove decls.
77382fcc 5361
9306c32e
PE
5362 * indent.c (val_compute_motion, val_vmotion): Now static.
5363
cd44d2eb
PE
5364 * image.c: Make symbols static if they're not exported.
5365 * dispextern.h (x_create_bitmap_from_xpm_data): Do not declare
5366 if USE_GTK.
5367 * image.c (x_create_bitmap_from_xpm_data): Do not define if USE_GTK.
5368 (xpm_color_cache, ct_table, ct_colors_allocated): Now static.
5369
ad9a7a06
PE
5370 * fringe.c (standard_bitmaps): Now static.
5371 (max_used_fringe_bitmap): Now static, unless HAVE_NS.
5372
81626931
PE
5373 * frame.c: Make symbols static if they're not exported.
5374 (x_report_frame_params, make_terminal_frame): Now static.
5375 (get_frame_param): Now static, unless HAVE_NS.
5376 (x_fullscreen_adjust): Define if WINDOWSNT, not if HAVE_WINDOW_SYSTEM.
5377 (x_get_resource_string): Remove; not used.
5378 * frame.h (make_terminal_frame, x_report_frame_params):
5379 (x_get_resource_string); Remove decls.
5380 (x_fullscreen_adjust): Declare only if WINDOWSNT.
5381 * lisp.h (get_frame_param): Declare only if HAVE_NS.
5382
239f9db9
PE
5383 * font.c, fontset.c: Make symbols static if they're not exported.
5384 * dispextern.h (FACE_SUITABLE_FOR_ASCII_CHAR_P): New macro.
5385 (FACE_SUITABLE_FOR_CHAR_P): Use it.
5386 * font.c (font_close_object): Now static.
5387 * font.h (font_close_object): Remove.
5388 * fontset.c (FONTSET_OBJLIST): Remove.
5389 (free_realized_fontset) #if-0 the body, which does nothing.
5390 (face_suitable_for_char_p): #if-0, as it's never called.
5391 * fontset.h (face_suitable_for_char_p): Remove decl.
04f2d78b
CB
5392 * xfaces.c (face_at_string_position):
5393 Use FACE_SUITABLE_FOR_ASCII_CHAR_P, not FACE_SUITABLE_FOR_CHAR_P,
239f9db9
PE
5394 since 0 is always ASCII.
5395
dfcf3579
PE
5396 * fns.c (weak_hash_tables): Now static.
5397
5045092b
PE
5398 * fileio.c: Make symbols static if they're not exported.
5399 (auto_saving, auto_save_mode_bits, auto_save_error_occurred):
5400 (Vwrite_region_annotation_buffers): Now static.
5401
57a96f5c
PE
5402 * eval.c: Make symbols static if they're not exported.
5403 (backtrace_list, lisp_eval_depth, when_entered_debugger): Now static.
5404 * lisp.h (backtrace_list): Remove decl.
5405
35f08c38
PE
5406 * emacs.c: Make symbols static if they're not exported.
5407 (malloc_state_ptr, malloc_using_checking, syms_of_emacs):
5408 (fatal_error_code, fatal_error_signal_hook, standard_args):
5409 Now static.
5410 (fatal_error_signal): Now static, unless FLOAT_CATCH_SIGKILL.
5411 (DEFINE_DUMMY_FUNCTION): Mark function as externally visible.
5412 (__CTOR_LIST__, __DTOR_LIST__): Now externally visible.
5413 * lisp.h (fatal_error_signal_hook): Remove decl.
5414 (fatal_error_signal): Declare only if FLOAT_CATCH_SIGKILL.
5415
f44bd759
PE
5416 * editfns.c: Move a (normally-unused) function to its only use.
5417 * editfns.c, lisp.h (get_operating_system_release): Remove.
5418 * process.c (init_process) [DARWIN_OS]: Do it inline, as it is not
5419 worth the hassle of breaking this out.
5420
b532497d
PE
5421 * xterm.c: Make symbols static if they're not exported.
5422 (x_raise_frame, x_lower_frame, x_wm_set_window_state):
5423 (x_wm_set_icon_pixmap, x_initialize, XTread_socket_fake_io_error):
5424 (x_destroy_window, x_delete_display):
5425 Now static.
5426 (x_dispatch_event): Now static if ! (USE_MOTIF || USE_X_TOOLKIT).
5427 (x_mouse_leave): Remove; unused.
5428 * xterm.h (x_display_info_for_name, x_raise_frame, x_lower_frame):
5429 (x_destroy_window, x_wm_set_window_state, x_wm_set_icon_pixmap):
5430 (x_delete_display, x_initialize, x_set_border_pixel, x_screen_planes):
5431 Remove decls.
5432 (x_mouse_leave): Declare only if WINDOWSNT.
5433 (x_dispatch_event): Declare only if USE_MOTIF or USE_X_TOOLKIT.
5434 (xic_create_fontsetname): Declare only if HAVE_X_WINDOWS &&
5435 USE_X_TOOLKIT.
5436
1675728f
PE
5437 * ftxfont.c: Make symbols static if they're not exported.
5438 (ftxfont_driver): Export only if !defined HAVE_XFT && def8ined
5439 HAVE_FREETYPE.
5440 * font.h (ftxfont_driver): Likewise.
5441
e4cebfca
PE
5442 * xfns.c: Make symbols static if they're not exported.
5443 (x_last_font_name, x_display_info_for_name):
5444 (x_set_foreground_color, x_set_background_color, x_set_mouse_color):
5445 (x_set_cursor_color, x_set_border_pixel, x_set_border_color):
5446 (x_set_cursor_type, x_set_icon_type, x_set_icon_name):
5447 (x_set_scroll_bar_foreground, x_set_scroll_bar_background):
5448 (x_explicitly_set_name, x_set_title, xic_defaut_fontset, tip_timer):
5449 (last_show_tip_args): Now static.
5450 (xic_defaut_fontset, xic_create_fontsetname): Define only if
5451 defined HAVE_X_WINDOWS && defined USE_X_TOOLKIT
5452 (x_screen_planes): Remove; unused.
5453 * dispextern.h (x_screen_planes): Remove decl.
5454
5bf46f05
PE
5455 * dispnew.c: Make symbols static if they're not exported.
5456 * dispextern.h (redraw_garbaged_frames, scrolling):
5457 (increment_row_positions): Remove.
5458 * dispnew.c (new_glyph_matrix, increment_row_positions, scrolling):
5459 (delayed_size_change, glyph_matrix_count, glyph_pool_count):
5460 Now static.
5461 (redraw_garbaged_frames): Remove; unused.
5462
435f4c28
PE
5463 * xfaces.c: Make symbols static if they're not exported.
5464 * dispextern.h (ascii_face_of_lisp_face, free_realized_face):
5465 Remove decls.
5466 * xterm.h (defined_color): Remove decls.
5467 (x_free_dpy_colors): Declare only if USE_X_TOOLKIT.
5468 * xfaces.c (tty_suppress_bold_inverse_default_colors_p):
5469 (menu_face_changed_default, defined_color, free_realized_face):
5470 (x_free_dpy_colors): Define only if USE_X_TOOLKIT.
5471 (ascii_face_of_lisp_face): Remove; unused.
5472
8524aef3
PE
5473 * xdisp.c: Make symbols static if they're not exported.
5474 * dispextern.h (scratch_glyph_row, window_box_edges):
5475 (glyph_to_pixel_coords, set_cursor_from_row):
5476 (get_next_display_element, set_iterator_to_next):
5477 (highlight_trailing_whitespace, frame_to_window_pixel_xy):
5478 (show_mouse_face): Remove decls
5479 * frame.h (message_buf_print): Likewise.
5480 * lisp.h (pop_message, set_message, check_point_in_composition):
5481 Likewise.
5482 * xterm.h (set_vertical_scroll_bar): Likewise.
5483 * xdisp.c (list_of_error, Vmessage_stack, line_number_displayed):
5484 (message_buf_print, scratch_glyph_row, displayed_buffer):
5485 (set_iterator_to_next, pop_message, set_message, set_cursor_from_row):
5486 (get_next_display_element, show_mouse_face, window_box_edges):
5487 (frame_to_window_pixel_xy, check_point_in_composition):
5488 (set_vertical_scroll_bar, highlight_trailing_whitespace): Now static.
5489 (glyph_to_pixel_coords): Remove; unused.
5490
16390cd2
PE
5491 * dired.c (file_name_completion): Now static.
5492
5493 * dbusbind.c (xd_in_read_queued_messages): Now static.
5494
a25f4dfa
PE
5495 * lisp.h (circular_list_error, FOREACH): Remove; unused.
5496 * data.c (circular_list_error): Remove.
5497
14a9c8df
PE
5498 * commands.h (last_point_position, last_point_position_buffer):
5499 (last_point_position_window): Remove decls.
5500 * keyboard.c: Make these variables static.
5501
04f2d78b
CB
5502 * coding.h (coding, code_convert_region, encode_coding_gap):
5503 Remove decls.
74ab6df5
PE
5504 * coding.c (Vsjis_coding_system, Vbig5_coding_system):
5505 (iso_code_class, detect_coding, code_convert_region): Now static.
5506 (encode_coding_gap): Remove; unused.
5507
38dfbee1
PE
5508 * chartab.c (chartab_chars, chartab_bits): Now static.
5509
a2cb4e63
PE
5510 * charset.h (charset_iso_8859_1): Remove decl.
5511 * charset.c (charset_iso_8859_1, charset_emacs, map_charset_for_dump):
5512 Now static.
5513
127198fd
PE
5514 * ccl.h (check_ccl_update, Vccl_program_table): Remove decls.
5515 * ccl.c (Vccl_program_table): Now static.
5516 (check_ccl_update): Remove; unused.
5517
d85b608f
PE
5518 * category.c (SET_CATEGORY_SET, set_category_set): Move here.
5519 * category.h: ... from here.
5520 * category.c (check_category_table, set_category_set): Now static.
5521
31cd66f3
PE
5522 * casetab.c (Vascii_upcase_table, Vascii_eqv_table): Now static.
5523 * lisp.h: Remove these decls.
5524
c358e587
PE
5525 * buffer.c (buffer_count): Remove unused var.
5526
e78aecca
PE
5527 * bidi.c (bidi_dump_cached_states): Mark as externally visible,
5528 so that it's not optimized away.
5529 (bidi_ignore_explicit_marks_for_paragraph_level): Likewise.
5530 * dispextern.h (bidi_dump_cached_states): Remove, since it's
5531 exported only to the debugger.
5532
e192d7d3 5533 * atimer.c (alarm_signal_handler, run_all_atimers): Now static.
04f2d78b 5534 * atimer.h (run_all_atimers): Remove; not exported.
e192d7d3 5535
92470028
PE
5536 font.c: Make copy_font_spec and merge_font_spec ordinary C functions.
5537 * font.c (copy_font_spec): Rename from Fcopy_font_spec, since it
5538 was inaccessible from Lisp.
5539 (merge_font_spec): Likewise, renaming from Fmerge_font_spec.
5540 * font.c, font.h, fontset.c, xfaces.c, xfont.c: Change all uses.
5541
244ed907
PE
5542 alloc.c: Import and export fewer symbols, and remove unused items.
5543 * lisp.h (suppress_checking, die): Declare only if ENABLE_CHECKING
5544 is defined.
5545 (suppress_checking): Add EXTERNALLY_VISIBLE attribute, so that
5546 it's not optimized away by whole-program optimization.
5547 (message_enable_multibyte, free_misc): Remove.
5548 (catchlist, handlerlist, mark_backtrace):
5549 Declare only if BYTE_MARK_STACK.
5550 (mark_byte_stack): Likewise, fixing a ifdef-vs-if typo.
5551 * alloc.c (pure): Export only if VIRT_ADDR_VARIES is defined.
5552 (message_enable_multibyte): Remove decl.
5553 (free_misc, interval_free_list, float_block, float_block_index):
5554 (n_float_blocks, float_free_list, cons_block, cons_block_index):
5555 (cons_free_list, last_marked_index):
5556 Now static.
5557 (suppress_checking, die): Define only if ENABLE_CHECKING is defined.
5558 * eval.c (catchlist, handlerlist): Export only if BYTE_MARK_STACK.
5559 (mark_backtrace): Define only if BYTE_MARK_STACK.
5560 * xdisp.c (message_enable_multibyte): Now static.
5561
61c2b50e 5562 Declare Lisp_Object Q* variables to be 'static' if not exported.
955cbe7b
PE
5563 This makes it easier for human readers (and static analyzers)
5564 to see whether these variables are used from other modules.
5565 * alloc.c, buffer.c, bytecode.c, callint.c, casetab.c, category.c:
5566 * ccl.c, character.c, charset.c, cmds.c, coding.c, composite.c:
5567 * data.c, dbusbind.c, dired.c, editfns.c, eval.c, fileio.c, fns.c:
5568 * font.c, frame.c, fringe.c, ftfont.c, image.c, keyboard.c, keymap.c:
5569 * lread.c, macros.c, minibuf.c, print.c, process.c, search.c:
5570 * sound.c, syntax.c, textprop.c, window.c, xdisp.c, xfaces.c, xfns.c:
5571 * xmenu.c, xselect.c:
5572 Declare Q* vars static if they are not used in other modules.
5573 * ccl.h, character.h, charset.h, coding.h, composite.h, font.h:
5574 * frame.h, intervals.h, keyboard.h, lisp.h, process.h, syntax.h:
5575 Remove decls of unexported vars.
5576 * keyboard.h (EVENT_HEAD_UNMODIFIED): Remove now-unused macro.
5577
95c82688
PE
5578 * lisp.h (DEFINE_FUNC): Make sname 'static'.
5579
16a97296
PE
5580 Make Emacs functions such as Fatom 'static' by default.
5581 This makes it easier for human readers (and static analyzers)
5582 to see whether these functions can be called from other modules.
5583 DEFUN now defines a static function. To make the function external
5584 so that it can be used in other C modules, use the new macro DEFUE.
8bd7b830
PE
5585 * lisp.h (Funibyte_char_to_multibyte, Fsyntax_table_p):
5586 (Finit_image_library):
16a97296
PE
5587 (Feval_region, Fbacktrace, Ffetch_bytecode, Fswitch_to_buffer):
5588 (Ffile_executable_p, Fmake_symbolic_link, Fcommand_execute):
5589 (Fget_process, Fdocumentation_property, Fbyte_code, Ffile_attributes):
5590 Remove decls, since these functions are now static.
5591 (Funintern, Fget_internal_run_time): New decls, since these functions
5592 were already external.
95c82688 5593
16a97296
PE
5594 * alloc.c, buffer.c, callint.c, callproc.c, casefiddle.c, casetab.c:
5595 * ccl.c, character.c, chartab.c, cmds.c, coding.c, data.c, dispnew.c:
5596 * doc.c, editfns.c, emacs.c, eval.c, fileio.c, filelock.c, floatfns.c:
5597 * fns.c, font.c, fontset.c, frame.c, image.c, indent.c:
5598 * keyboard.c, keymap.c, lread.c:
5599 * macros.c, marker.c, menu.c, minibuf.c, print.c, process.c, search.c:
5600 * syntax.c, term.c, terminal.c, textprop.c, undo.c:
5601 * window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xsettings.c:
5602 Mark functions with DEFUE instead of DEFUN,
5603 if they are used in other modules.
5604 * buffer.c (Fset_buffer_major_mode, Fdelete_overlay): New forward
5605 decls for now-static functions.
5606 * buffer.h (Fdelete_overlay): Remove decl.
5607 * callproc.c (Fgetenv_internal): Mark as internal.
5608 * composite.c (Fremove_list_of_text_properties): Remove decl.
5609 (Fcomposition_get_gstring): New forward static decl.
5610 * composite.h (Fcomposite_get_gstring): Remove decl.
5611 * dired.c (Ffile_attributes): New forward static decl.
5612 * doc.c (Fdocumntation_property): New forward static decl.
5613 * eval.c (Ffetch_bytecode): New forward static decl.
5614 (Funintern): Remove extern decl; now in .h file where it belongs.
5615 * fileio.c (Fmake_symbolic_link): New forward static decl.
5616 * image.c (Finit_image_library): New forward static decl.
5617 * insdel.c (Fcombine_after_change_execute): Make forward decl static.
5618 * intervals.h (Fprevious_property_change):
5619 (Fremove_list_of_text_properties): Remove decls.
5620 * keyboard.c (Fthis_command_keys): Remove decl.
5621 (Fcommand_execute): New forward static decl.
5622 * keymap.c (Flookup_key): New forward static decl.
5623 (Fcopy_keymap): Now static.
5624 * keymap.h (Flookup_key): Remove decl.
5625 * process.c (Fget_process): New forward static decl.
5626 (Fprocess_datagram_address): Mark as internal.
5627 * syntax.c (Fsyntax_table_p): New forward static decl.
5628 (skip_chars): Remove duplicate decl.
5629 * textprop.c (Fprevious_property_change): New forward static decl.
5630 * window.c (Fset_window_fringes, Fset_window_scroll_bars):
5631 Now internal.
5632 (Fset_window_margins, Fset_window_vscroll): New forward static decls.
5633 * window.h (Fset_window_vscroll, Fset_window_margins): Remove decls.
5634
785bbd42
PE
5635 * editfns.c (Fformat): Remove unreachable code.
5636
8b913b57
AS
56372011-04-14 Andreas Schwab <schwab@linux-m68k.org>
5638
5639 * fileio.c (Finsert_file_contents): Fix typo in 2005-05-13
5640 change. (Bug#8496)
5641
a6744a35
EZ
56422011-04-13 Eli Zaretskii <eliz@gnu.org>
5643
5644 * xdisp.c (handle_invisible_prop): Don't call bidi_paragraph_init
5645 when at ZV. (Bug#8487)
5646
e7974947
AS
56472011-04-12 Andreas Schwab <schwab@linux-m68k.org>
5648
baad03f0
AS
5649 * charset.c (Fclear_charset_maps): Use xfree instead of free.
5650 (Bug#8437)
5651 * keyboard.c (parse_tool_bar_item): Likewise.
5652 * sound.c (sound_cleanup, alsa_close): Likewise.
5653 * termcap.c (tgetent): Likewise.
5654 * xfns.c (x_default_font_parameter): Likewise.
5655 * xsettings.c (read_and_apply_settings): Likewise.
5656
e7974947
AS
5657 * alloc.c (overrun_check_malloc, overrun_check_realloc)
5658 (overrun_check_free): Protoize.
5659
28272684
PE
56602011-04-12 Paul Eggert <eggert@cs.ucla.edu>
5661
5662 * sysdep.c (emacs_read, emacs_write): Check for negative sizes
5663 since callers should never pass a negative size.
5664 Change the signature to match that of plain 'read' and 'write'; see
5665 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00397.html>.
5666 * lisp.h: Update prototypes of emacs_write and emacs_read.
5667
11997c76
EZ
56682011-04-11 Eli Zaretskii <eliz@gnu.org>
5669
5670 * xdisp.c (redisplay_window): Don't try to determine the character
5671 position of the scroll margin if the window start point w->startp
e896f03c 5672 is outside the buffer's accessible region. (Bug#8468)
11997c76 5673
8a2cbd72
EZ
56742011-04-10 Eli Zaretskii <eliz@gnu.org>
5675
5676 Fix write-region and its subroutines for buffers > 2GB.
5677 * fileio.c (a_write, e_write): Modify declaration of arguments and
5678 local variables to support buffers larger than 2GB.
5679 (Fcopy_file): Use EMACS_INT for return value of emacs_read.
5680
5681 * sysdep.c (emacs_write, emacs_read): Use ssize_t for last
5682 argument, local variables, and return value.
5683
5684 * lisp.h: Update prototypes of emacs_write and emacs_read.
5685
5686 * sound.c (vox_write): Use ssize_t for return value of emacs_write.
5687
4073e537 56882011-04-10 Paul Eggert <eggert@cs.ucla.edu>
eb3f1cc8 5689
1ebfdcb6
PE
5690 * xdisp.c (vmessage): Use memchr, not strnlen, which some hosts lack.
5691
b2ded58d
PE
5692 Fix more problems found by GCC 4.6.0's static checks.
5693
7d66342c
PE
5694 * xdisp.c (vmessage): Use a better test for character truncation.
5695
bbf47d44
PE
5696 * charset.c (load_charset_map): <, not <=, for optimization,
5697 and to avoid potential problems with integer overflow.
9248994d 5698 * chartab.c (sub_char_table_set_range, char_table_set_range): Likewise.
f9a68bc5 5699 * casetab.c (set_identity, shuffle): Likewise.
3ab1c7ce 5700 * editfns.c (Fformat): Likewise.
1e69125e 5701 * syntax.c (skip_chars): Likewise.
3befa583 5702
e3019616
PE
5703 * xmenu.c (set_frame_menubar): Allocate smaller local vectors.
5704 This also lets GCC 4.6.0 generate slightly better loop code.
5705
becfa255
PE
5706 * callint.c (Fcall_interactively): <, not <=, for optimization.
5707 (Fcall_interactively): Count the number of arguments produced,
5708 not the number of arguments given. This is simpler and lets GCC
5709 4.6.0 generate slightly better code.
5710
dae0cd48
PE
5711 * ftfont.c: Distingish more carefully between FcChar8 and char.
5712 The previous code passed unsigned char * to a functions like
5713 strlen and xstrcasecmp that expect char *, which does not
5714 conform to the C standard.
5715 (get_adstyle_property, ftfont_pattern_entity): Use FcChar8 for
5716 arguments to FcPatternGetString, and explicitly cast FcChar8 * to
5717 char * when the C standard requires it.
5718
76032d70
PE
5719 * keyboard.c (read_char): Remove unused var.
5720
eb3f1cc8
PE
5721 * eval.c: Port to Windows vsnprintf (Bug#8435).
5722 Include <limits.h>.
5723 (SIZE_MAX): Define if the headers do not.
5724 (verror): Do not give up if vsnprintf returns a negative count.
5725 Instead, grow the buffer. This ports to Windows vsnprintf, which
5726 does not conform to C99. Problem reported by Eli Zaretskii.
5727 Also, simplify the allocation scheme, by avoiding the need for
5728 calling realloc, and removing the ALLOCATED variable.
5729
70476b54
PE
5730 * eval.c (verror): Initial buffer size is 4000 (not 200) bytes.
5731
12020a9e
PE
5732 Remove invocations of doprnt, as Emacs now uses vsnprintf.
5733 But keep the doprint source code for now, as we might revamp it
5734 and use it again (Bug#8435).
ea6c7ae6
PE
5735 * lisp.h (doprnt): Remove.
5736 * Makefile.in (base_obj): Remove doprnt.o.
5737 * deps.mk (doprnt.o): Remove.
5738
5fdb398c
PE
5739 error: Print 32- and 64-bit integers portably (Bug#8435).
5740 Without this change, on typical 64-bit hosts error ("...%d...", N)
5741 was used to print both 32- and 64-bit integers N, which relied on
5742 undefined behavior.
5743 * lisp.h, src/m/amdx86-64.h, src/m/ia64.h, src/m/ibms390x.h (pEd):
5744 New macro.
5745 * lisp.h (error, verror): Mark as printf-like functions.
5746 * eval.c (verror): Use vsnprintf, not doprnt, to do the real work.
5747 Report overflow in size calculations when allocating printf buffer.
5748 Do not truncate output string at its first null byte.
5749 * xdisp.c (vmessage): Use vsnprintf, not doprnt, to do the real work.
5750 Truncate the output at a character boundary, since vsnprintf does not
5751 do that.
5752 * charset.c (check_iso_charset_parameter): Convert internal
5753 character to string before calling 'error', since %c now has the
5754 printf meaning.
5755 * coding.c (Fdecode_sjis_char, Fdecode_big5_char): Avoid int
5756 overflow when computing char to be passed to 'error'. Do not
5757 pass Lisp_Object to 'error'; pass the integer instead.
5758 * nsfns.m (Fns_do_applescript): Use int, not long, since it's
5759 formatted with plain %d.
5760
b189fa66
PE
5761 * eval.c (internal_lisp_condition_case): Don't pass spurious arg.
5762
bff87ef0
PE
5763 * keyboard.c (access_keymap_keyremap): Print func name, not garbage.
5764
7e2cac20
PE
5765 * coding.c (Fdecode_sjis_char): Don't assume CODE fits in int.
5766
ce4d90b5
PE
5767 * xterm.c (x_catch_errors): Remove duplicate declaration.
5768
266c9547
PE
5769 * term.c (maybe_fatal): Mark its 3rd arg as a printf format, too.
5770
79c49ad2
PE
5771 * xdisp.c, lisp.h (message_nolog): Remove; unused.
5772
368f4090
JM
57732011-04-10 Jim Meyering <meyering@redhat.com>
5774
5775 use ssize_t and size_t for read- and write-like emacs_gnutls_* functions
5776 * gnutls.c (emacs_gnutls_read): Adjust signature to be more read-like:
5777 return ssize_t not "int", and use size_t as the buffer length.
5778 (emacs_gnutls_write): Likewise, and make the buffer pointer "const".
5779 * gnutls.h: Update declarations.
5780 * process.c (read_process_output): Use ssize_t, to match.
5781 (send_process): Likewise.
5782
a32d4040
CY
57832011-04-09 Chong Yidong <cyd@stupidchicken.com>
5784
5785 * image.c (Fimagemagick_types): Doc fix, and comment cleanup.
5786
8546720e 57872011-04-09 Chong Yidong <cyd@stupidchicken.com>
aac0c6e3 5788
04f2d78b
CB
5789 * ftfont.c (get_adstyle_property, ftfont_pattern_entity):
5790 Use unsigned char, to match FcChar8 type definition.
aac0c6e3 5791
8546720e
GM
5792 * xterm.c (handle_one_xevent):
5793 * xmenu.c (create_and_show_popup_menu):
5794 * xselect.c (x_decline_selection_request)
5795 (x_reply_selection_request): Avoid type-punned deref of X events.
aac0c6e3 5796
0a2f5c1a 57972011-04-09 Eli Zaretskii <eliz@gnu.org>
a53e2e89
EZ
5798
5799 Fix some uses of `int' instead of EMACS_INT.
5800 * search.c (string_match_1, fast_string_match)
5801 (fast_c_string_match_ignore_case, fast_string_match_ignore_case)
5802 (scan_buffer, find_next_newline_no_quit)
5803 (find_before_next_newline, search_command, Freplace_match)
5804 (Fmatch_data): Make some `int' variables be EMACS_INT.
5805
5806 * xdisp.c (display_count_lines): 3rd argument and return value now
5807 EMACS_INT. All callers changed.
5808 (pint2hrstr): Last argument is now EMACS_INT.
5809
5810 * coding.c (detect_coding_utf_8, detect_coding_emacs_mule)
5811 (detect_coding_iso_2022, detect_coding_sjis, detect_coding_big5)
5812 (detect_coding_ccl, detect_coding_charset, decode_coding_utf_8)
5813 (decode_coding_utf_16, decode_coding_emacs_mule)
5814 (decode_coding_iso_2022, decode_coding_sjis, decode_coding_big5)
5815 (decode_coding_ccl, decode_coding_charset)
5816 <consumed_chars, consumed_chars_base>: Declare EMACS_INT.
5817 (decode_coding_iso_2022, decode_coding_emacs_mule)
5818 (decode_coding_sjis, decode_coding_big5, decode_coding_charset)
5819 <char_offset, last_offset>: Declare EMACS_INT.
5820 (encode_coding_utf_8, encode_coding_utf_16)
5821 (encode_coding_emacs_mule, encode_invocation_designation)
5822 (encode_designation_at_bol, encode_coding_iso_2022)
5823 (encode_coding_sjis, encode_coding_big5, encode_coding_ccl)
5824 (encode_coding_raw_text, encode_coding_charset) <produced_chars>:
5825 Declare EMACS_INT.
5826 (ASSURE_DESTINATION): Declare more_bytes EMACS_INT.
5827 (encode_invocation_designation): Last argument P_NCHARS is now
5828 EMACS_INT.
5829 (decode_eol): Declare pos_byte, pos, and pos_end EMACS_INT.
5830 (produce_chars): from_nchars and to_nchars are now EMACS_INT.
5831
5832 * coding.h (struct coding_system) <head_ascii>: Declare EMACS_INT.
5833 All users changed.
5834
5835 * ccl.c (Fccl_execute_on_string): Declare some variables
5836 EMACS_INT.
5837
8546720e 58382011-04-08 Samuel Thibault <sthibault@debian.org> (tiny change)
0080dc6b
SS
5839
5840 * term.c (init_tty): Fix incorrect ifdef placement (Bug#8450).
5841
4e19a977
CS
58422011-03-19 Christoph Scholtes <cschol2112@googlemail.com>
5843
5844 * process.c (Fformat_network_address): Doc fix.
5845
87302331
R
58462011-04-08 T.V. Raman <tv.raman.tv@gmail.com> (tiny change)
5847
5848 * xml.c (parse_region): Avoid creating spurious whiespace nodes.
5849
cbb59342
CY
58502011-04-08 Chong Yidong <cyd@stupidchicken.com>
5851
5852 * keyboard.c (read_char): Call Lisp function help-form-show,
5853 instead of using internal_with_output_to_temp_buffer.
5854 (Qhelp_form_show): New var.
e0d38eeb 5855 (syms_of_keyboard): Use DEFSYM macro.
cbb59342
CY
5856
5857 * print.c (internal_with_output_to_temp_buffer): Function deleted.
5858
5859 * lisp.h (internal_with_output_to_temp_buffer): Remove prototype.
5860
e67a13ab
CY
58612011-04-06 Chong Yidong <cyd@stupidchicken.com>
5862
04f2d78b
CB
5863 * process.c (Flist_processes): Remove to Lisp.
5864 (list_processes_1): Delete.
e67a13ab 5865
973f782d
EZ
58662011-04-06 Eli Zaretskii <eliz@gnu.org>
5867
7c106b1e
EZ
5868 * msdos.c (careadlinkat, careadlinkatcwd): MS-DOS replacements.
5869
973f782d
EZ
5870 * w32.c (careadlinkat, careadlinkatcwd): New always-fail stubs.
5871
41cf7d1a 58722011-04-06 Paul Eggert <eggert@cs.ucla.edu>
27ccc379 5873
ca23cc88
PE
5874 Fix more problems found by GCC 4.6.0's static checks.
5875
f390e2d5
PE
5876 * xmenu.c (Fx_popup_dialog): Don't assume string is free of formats.
5877
42eea0d0
PE
5878 * menu.c (Fx_popup_menu): Don't assume error_name lacks printf formats.
5879
b69769da 5880 * lisp.h (message, message_nolog, fatal): Mark as printf-like.
1e973bc7 5881
f9541e84
PE
5882 * xdisp.c (vmessage): Mark as a printf-like function.
5883
13841b55
PE
5884 * term.c (vfatal, maybe_fatal): Mark as printf-like functions.
5885
c136c10f
PE
5886 * sound.c (sound_warning): Don't crash if arg contains a printf format.
5887
5e2d4a30
PE
5888 * image.c (tiff_error_handler, tiff_warning_handler): Mark as
5889 printf-like functions.
5890 (tiff_load): Add casts to remove these marks before passing them
5891 to system-supplied API.
5892
583f48b9
PE
5893 * eval.c (Fsignal): Remove excess argument to 'fatal'.
5894
b25d760e
PE
5895 * coding.c (EMIT_ONE_BYTE, EMIT_TWO_BYTES): Use unsigned, not int.
5896 This avoids several warnings with gcc -Wstrict-overflow.
d5efd1d1
PE
5897 (DECODE_COMPOSITION_RULE): If the rule is invalid, goto invalid_code
5898 directly, rather than having caller test rule sign. This avoids
5899 some unnecessary tests.
5900 * composite.h (COMPOSITION_ENCODE_RULE_VALID): New macro.
5901 (COMPOSITION_ENCODE_RULE): Arguments now must be valid. This
5902 affects only one use, in DECODE_COMPOSITION_RULE, which is changed.
b25d760e 5903
bc7b6697 5904 * xfont.c (xfont_text_extents): Remove var that was set but not used.
625a3eb1 5905 (xfont_open): Avoid unnecessary tests.
bc7b6697 5906
27ccc379
PE
5907 * composite.c (composition_gstring_put_cache): Use unsigned integer.
5908
dcd5c89a
PE
5909 * composite.h, composite.c (composition_gstring_put_cache):
5910 Use EMACS_INT, not int, for length.
5911
b13a45c6
PE
5912 * composite.h (COMPOSITION_DECODE_REFS): New macro,
5913 breaking out part of COMPOSITION_DECODE_RULE.
5914 (COMPOSITION_DECODE_RULE): Use it.
5915 * composite.c (get_composition_id): Remove unused local vars,
5916 by using the new macro.
5917
1e792e4d
PE
5918 * textprop.c (set_text_properties_1): Change while to do-while,
5919 since the condition is always true at first.
5920
dc6c6455 5921 * intervals.c (graft_intervals_into_buffer): Mark var as used.
aa86731f
PE
5922 (interval_deletion_adjustment): Return unsigned value.
5923 All uses changed.
dc6c6455 5924
aba7731a
PE
5925 * process.c (list_processes_1, create_pty, read_process_output):
5926 (exec_sentinel): Remove vars that were set but not used.
afd4052b 5927 (create_pty): Remove unnecessary "volatile"s.
bc57d757 5928 (Fnetwork_interface_info): Avoid possibility of int overflow.
82eaa333 5929 (read_process_output): Do adaptive read buffering even if carryover.
fe07cdfa 5930 (read_process_output): Simplify nbytes computation if buffered.
aba7731a 5931
fdfc4bf3
PE
5932 * bytecode.c (exec_byte_code): Rename local to avoid shadowing.
5933
fca8fe46 5934 * syntax.c (scan_words): Remove var that was set but not used.
12cbf13f 5935 (update_syntax_table): Use unsigned instead of int.
fca8fe46 5936
06a0259a 5937 * lread.c (lisp_file_lexically_bound_p): Use ints rather than endptrs.
3c346cc3 5938 (lisp_file_lexically_bound_p, read1): Use unsigned instead of int.
e6eb4e9e 5939 (safe_to_load_p): Make the end-of-loop test the inverse of the in-loop.
06a0259a 5940
e7b9e80f
PE
5941 * print.c (print_error_message): Avoid int overflow.
5942
56201685
PE
5943 * font.c (font_list_entities): Redo for clarity,
5944 so that reader need not know FONT_DPI_INDEX + 1 == FONT_SPACING_INDEX.
5945
78834453 5946 * font.c (font_find_for_lface, Ffont_get_glyphs): Remove unused vars.
790771b1 5947 (font_score): Avoid potential overflow in diff calculation.
78834453 5948
0bc0b309 5949 * fns.c (substring_both): Remove var that is set but not used.
8cd55cb4 5950 (sxhash): Redo loop for clarity and to avoid wraparound warning.
0bc0b309 5951
e610eaca
PE
5952 * eval.c (funcall_lambda): Rename local to avoid shadowing.
5953
b895abce
PE
5954 * alloc.c (mark_object_loop_halt, mark_object): Use size_t, not int.
5955 Otherwise, GCC 4.6.0 optimizes the loop check away since the check
5956 can always succeed if overflow has undefined behavior.
5957
1f1d9321 5958 * search.c (boyer_moore, wordify): Remove vars set but not used.
6f076cc7 5959 (wordify): Omit three unnecessary tests.
1f1d9321 5960
c59478bc
PE
5961 * indent.c (MULTIBYTE_BYTES_WIDTH): Don't compute wide_column.
5962 All callers changed. This avoids the need for an unused var.
5963
79b73827
PE
5964 * casefiddle.c (casify_region): Remove var that is set but not used.
5965
a4db5dfe
PE
5966 * dired.c (file_name_completion): Remove var that is set but not used.
5967
43aae36e
PE
5968 * fileio.c (Finsert_file_contents): Make EOF condition clearer.
5969
2a47c44d 5970 * fileio.c (Finsert_file_contents): Avoid signed integer overflow.
163c5f32 5971 (Finsert_file_contents): Remove unnecessary code checking fd.
2a47c44d 5972
a37c69bf
PE
5973 * minibuf.c (read_minibuf_noninteractive): Use size_t for sizes.
5974 Check for integer overflow on size calculations.
5975
328ab8e7
PE
5976 * buffer.c (Fprevious_overlay_change): Remove var that is set
5977 but not used.
5978
e5a2a5cb
PE
5979 * keyboard.c (menu_bar_items, read_char_minibuf_menu_prompt):
5980 Remove vars that are set but not used.
8d84a6eb 5981 (timer_check_2): Don't assume timer-list and idle-timer-list are lists.
6b043475 5982 (timer_check_2): Mark vars as initialized.
e5a2a5cb 5983
a60e5f68
PE
5984 * gtkutil.c (xg_get_file_with_chooser): Mark var as initialized.
5985
f661cb61 5986 * image.c (lookup_image): Remove var that is set but not used.
35fa624f 5987 (xbm_load): Use parse_p, for gcc -Werror=unused-but-set-variable.
f661cb61 5988
f0397f5a
PE
5989 * fontset.c (Finternal_char_font, Ffontset_info): Remove vars
5990 that are set but not used.
5991
8664db06 5992 * xfns.c (make_invisible_cursor): Don't return garbage
03733ee7 5993 if XCreateBitmapFromData fails (Bug#8410).
8664db06 5994
6abdaa4a
PE
5995 * xselect.c (x_get_local_selection, x_handle_property_notify):
5996 Remove vars that are set but not used.
5997
0ce7538d 5998 * xfns.c (x_create_tip_frame): Remove var that is set but not used.
6abdaa4a 5999 (make_invisible_cursor): Initialize a possibly-uninitialized variable.
0ce7538d 6000
9ae848fc
PE
6001 * xterm.c (x_scroll_bar_to_input_event) [!USE_GTK]:
6002 Remove var that is set but not used.
0b918413
PE
6003 (scroll_bar_windows_size): Now size_t, not int.
6004 (x_send_scroll_bar_event): Use size_t, not int, for sizes.
6005 Check for overflow.
9ae848fc 6006
a5a62657
PE
6007 * xfaces.c (realize_named_face): Remove vars that are set but not used.
6008 (map_tty_color) [!defined MSDOS]: Likewise.
6009
5c5cdd39
PE
6010 * term.c (tty_write_glyphs): Use size_t; this avoids overflow warning.
6011
66ebf983
PE
6012 * coding.c: Remove vars that are set but not used.
6013 (DECODE_COMPOSITION_RULE): Remove 2nd arg, which is unused.
6014 All callers changed.
6015 (decode_coding_utf_8, decode_coding_utf_16 decode_coding_emacs_mule):
6016 (decode_coding_iso_2022, encode_coding_sjis, encode_coding_big5):
6017 (decode_coding_charset): Remove vars that are set but not used.
6018
1be4d761
PE
6019 * bytecode.c (Fbyte_code) [!defined BYTE_CODE_SAFE]: Remove var
6020 that is set but not used.
6021
47553fa8
PE
6022 * print.c (print_object): Remove var that is set but not used.
6023
1f7196bf 6024 Replace 2 copies of readlink code with 1 gnulib version (Bug#8401).
d1fdcab7
PE
6025 The gnulib version avoids calling malloc in the usual case,
6026 and on 64-bit hosts doesn't have some arbitrary 32-bit limits.
6027 * fileio.c (Ffile_symlink_p): Use emacs_readlink.
6028 * filelock.c (current_lock_owner): Likewise.
6029 * lisp.h (READLINK_BUFSIZE, emacs_readlink): New function.
6030 * sysdep.c: Include allocator.h, careadlinkat.h.
6031 (emacs_no_realloc_allocator): New static constant.
6032 (emacs_readlink): New function.
fdb61804
PE
6033 * deps.mk (sysdep.o): Depend on ../lib/allocator.h and on
6034 ../lib/careadlinkat.h.
d1fdcab7 6035
f84c17c7
SM
60362011-04-04 Stefan Monnier <monnier@iro.umontreal.ca>
6037
6038 * keyboard.c (safe_run_hook_funcall): Fix last change (don't stop at the
6039 first non-nil return value).
6040
ef3862ad
JD
60412011-04-03 Jan Djärv <jan.h.d@swipnet.se>
6042
6043 * nsterm.m (ns_update_auto_hide_menu_bar): Define MAC_OS_X_VERSION_10_6
6044 if not defined (Bug#8403).
6045
376a7006
JB
60462011-04-02 Juanma Barranquero <lekktu@gmail.com>
6047
6048 * xdisp.c (display_count_lines): Remove parameter `start',
6049 unused since 1998-01-01T02:27:27Z!rms@gnu.org. All callers changed.
6050 (get_char_face_and_encoding): Remove parameter `multibyte_p',
6051 unused since 2008-05-14T01:40:23Z!handa@m17n.org. All callers changed.
6052 (fill_stretch_glyph_string): Remove parameters `row' and `area',
6053 unused at least since Kim's GUI unification at 2003-03-16T20:45:46Z!storm@cua.dk
6054 and thereabouts. All callers changed.
6055 (get_per_char_metric): Remove parameter `f', unused since
6056 2008-05-14T01:40:23Z!handa@m17n.org. All callers changed.
6057
6ca3801d
JM
60582011-04-02 Jim Meyering <meyering@redhat.com>
6059
6060 do not dereference NULL upon failed strdup
6061 * nsfont.m (ns_descriptor_to_entity): Use xstrdup, not strdup.
6062 (ns_get_family): Likewise.
6063
d8e2b5ba
JB
60642011-04-02 Juanma Barranquero <lekktu@gmail.com>
6065
6066 * eval.c (unwind_to_catch) [DEBUG_GCPRO]: Remove redundant assignment.
6067
8c74fcbd
JD
60682011-04-02 Jan Djärv <jan.h.d@swipnet.se>
6069
6070 * nsterm.m (ns_update_auto_hide_menu_bar): Only for OSX 10.6 or
6071 later (Bug#8403).
6072
7200d79c
SM
60732011-04-01 Stefan Monnier <monnier@iro.umontreal.ca>
6074
03408648 6075 Add lexical binding.
7200d79c 6076
03408648
SM
6077 * window.c (Ftemp_output_buffer_show): New fun.
6078 (Fsave_window_excursion):
6079 * print.c (Fwith_output_to_temp_buffer): Move to subr.el.
6080
6081 * lread.c (lisp_file_lexically_bound_p): New function.
6082 (Fload): Bind Qlexical_binding.
6083 (readevalloop): Remove `evalfun' arg.
6084 Bind Qinternal_interpreter_environment.
6085 (Feval_buffer): Bind Qlexical_binding.
6086 (defvar_int, defvar_bool, defvar_lisp_nopro, defvar_kboard):
6087 Mark as dynamic.
6088 (syms_of_lread): Declare `lexical-binding'.
6089
6090 * lisp.h (struct Lisp_Symbol): New field `declared_special'.
6091
6092 * keyboard.c (eval_dyn): New fun.
6093 (menu_item_eval_property): Use it.
ca105506
SM
6094
6095 * image.c (parse_image_spec): Use Ffunctionp.
ca105506 6096
03408648
SM
6097 * fns.c (concat, mapcar1): Accept byte-code-functions.
6098
6099 * eval.c (Fsetq): Handle lexical vars.
6100 (Fdefun, Fdefmacro, Ffunction): Make closures when needed.
6101 (Fdefconst, Fdefvaralias, Fdefvar): Mark as dynamic.
6102 (FletX, Flet): Obey lexical binding.
6103 (Fcommandp): Handle closures.
6104 (Feval): New `lexical' arg.
6105 (eval_sub): New function extracted from Feval. Use it almost
6106 everywhere where Feval was used. Look up vars in lexical env.
6107 Handle closures.
6108 (Ffunctionp): Move from subr.el.
6109 (Ffuncall): Handle closures.
6110 (apply_lambda): Remove `eval_flags'.
6111 (funcall_lambda): Handle closures and new byte-code-functions.
6112 (Fspecial_variable_p): New function.
6113 (syms_of_eval): Initialize the Vinternal_interpreter_environment var,
6114 but without exporting it to Lisp.
23aba0ea 6115
23aba0ea 6116 * doc.c (Fdocumentation, store_function_docstring):
03408648 6117 * data.c (Finteractive_form): Handle closures.
23aba0ea 6118
03408648
SM
6119 * callint.c (Fcall_interactively): Preserve lexical-binding mode for
6120 interactive spec.
ba83908c 6121
04f2d78b
CB
6122 * bytecode.c (Bstack_ref, Bstack_set, Bstack_set2, BdiscardN):
6123 New byte-codes.
03408648
SM
6124 (exec_byte_code): New function extracted from Fbyte_code to handle new
6125 calling convention for byte-code-functions. Add new byte-codes.
ba83908c 6126
03408648 6127 * buffer.c (defvar_per_buffer): Set new `declared_special' field.
e2abe5a1 6128
03408648 6129 * alloc.c (Fmake_symbol): Init new `declared_special' field.
e2abe5a1 6130
e2abce01
JB
61312011-03-31 Juanma Barranquero <lekktu@gmail.com>
6132
6133 * xdisp.c (redisplay_internal): Fix prototype.
6134
63696a73 61352011-03-31 Eli Zaretskii <eliz@gnu.org>
09725d26 6136
63696a73 6137 * xdisp.c (SCROLL_LIMIT): New macro.
04f2d78b
CB
6138 (try_scrolling): Use it when setting scroll_limit.
6139 Limit scrolling to 100 screen lines.
63696a73
EZ
6140 (redisplay_window): Even when falling back on "recentering",
6141 position point in the window according to scroll-conservatively,
6142 scroll-margin, and scroll-*-aggressively variables. (Bug#6671)
6143
6144 (try_scrolling): When point is above the window, allow searching
6145 as far as scroll_max, or one screenful, to compute vertical
6146 distance from PT to the scroll margin position. This prevents
6147 try_scrolling from unnecessarily failing when
6148 scroll-conservatively is set to a value slightly larger than the
6149 window height. Clean up the case of PT below the margin at bottom
6150 of window: scroll_max can no longer be INT_MAX. When aggressive
6151 scrolling is in use, don't let point enter the opposite scroll
6152 margin as result of the scroll.
6153 (syms_of_xdisp) <scroll-conservatively>: Document the
09725d26
EZ
6154 threshold of 100 lines for never-recentering scrolling.
6155
e4cc2dfc
JB
61562011-03-31 Juanma Barranquero <lekktu@gmail.com>
6157
6158 * dispextern.h (move_it_by_lines):
6159 * xdisp.c (move_it_by_lines): Remove parameter `need_y_p', unused
6160 since 2000-12-29T14:24:09Z!gerd@gnu.org. All callers changed.
6161 (message_log_check_duplicate): Remove parameters `prev_bol' and
6162 `this_bol', unused since 1998-01-01T02:27:27Z!rms@gnu.org. All callers changed.
6163 (redisplay_internal): Remove parameter `preserve_echo_area',
6164 unused since 1999-07-21T21:43:52Z!gerd@gnu.org. All callers changed.
6165
6166 * indent.c (Fvertical_motion):
6167 * window.c (window_scroll_pixel_based, Frecenter):
6168 Don't pass `need_y_p' to `move_it_by_lines'.
6169
1c470562
SM
61702011-03-30 Stefan Monnier <monnier@iro.umontreal.ca>
6171
44f230aa
SM
6172 * eval.c (struct backtrace): Don't cheat with negative numbers, but do
6173 steal a few bits to be more compact.
6174 (interactive_p, Fbacktrace, Fbacktrace_frame, mark_backtrace):
6175 Remove unneeded casts.
6176
1c470562
SM
6177 * bytecode.c (Fbyte_code): CAR and CDR can GC.
6178
888adce9
ZK
61792011-03-30 Zachary Kanfer <zkanfer@gmail.com> (tiny change)
6180
6181 * keyboard.c (Fexecute_extended_command): Do log the "suggest key
6182 binding" message (bug#7967).
6183
f838ed7b
PE
61842011-03-30 Paul Eggert <eggert@cs.ucla.edu>
6185
77861b95
PE
6186 Fix more problems found by GCC 4.6.0's static checks.
6187
de6dbc14
PE
6188 * unexelf.c (unexec) [! (defined _SYSTYPE_SYSV || defined __sgi)]:
6189 Remove unused local var.
6190
f838ed7b
PE
6191 * editfns.c (Fmessage_box): Remove unused local var.
6192
792c7b2b
PE
6193 * xdisp.c (try_window_reusing_current_matrix, x_produce_glyphs):
6194 (note_mode_line_or_margin_highlight, note_mouse_highlight):
6195 Omit unused local vars.
c499e557 6196 * window.c (shrink_windows): Omit unused local var.
b01a1c29 6197 * menu.c (digest_single_submenu): Omit unused local var.
0bc32927
PE
6198 * dispnew.c (update_window) [PERIODIC_PREEMPTION_CHECKING]:
6199 Omit unused local var.
6200
ba0165e1
PE
6201 * keyboard.c (parse_modifiers_uncached, parse_modifiers):
6202 Don't assume string length fits in int.
32ad8845 6203 (keyremap_step, read_key_sequence): Use size_t for sizes.
48011560 6204 (read_key_sequence): Don't check last_real_key_start redundantly.
ba0165e1 6205
3c59b4c9
PE
6206 * callproc.c (Fcall_process, Fcall_process_region): Use SAFE_ALLOCA
6207 instead of alloca (Bug#8344).
6208
a3eed478 6209 * eval.c (Fbacktrace): Don't assume nargs fits in int.
5d5d959d 6210 (Fbacktrace_frame): Don't assume nframes fits in int.
a3eed478 6211
eb4d412d
PE
6212 * syntax.c (scan_sexps_forward): Avoid pointer wraparound.
6213
1658b401
PE
6214 * xterm.c (x_make_frame_visible, same_x_server): Redo to avoid overflow
6215 concerns.
6216
6217 * term.c (produce_glyphless_glyph): Remove unnecessary test.
6218
6219 * cm.c (calccost): Turn while-do into do-while, for clarity.
44f730c8 6220
9a2c6e05
PE
6221 * keyboard.c (syms_of_keyboard): Use the same style as later
6222 in this function when indexing through an array. This also
6223 works around GCC bug 48267.
6224
03d0a109
PE
6225 * image.c (tiff_load): Fix off-by-one image count (Bug#8336).
6226
44f730c8
PE
6227 * xselect.c (x_check_property_data): Return correct size (Bug#8335).
6228
fe75f926
PE
6229 * chartab.c (sub_char_table_ref_and_range): Redo for slight
6230 efficiency gain, and to bypass a gcc -Wstrict-overflow warning.
6231
ffa8c828
PE
6232 * keyboard.c, keyboard.h (num_input_events): Now size_t.
6233 This avoids undefined behavior on integer overflow, and is a bit
6234 more convenient anyway since it is compared to a size_t variable.
6235
c5101a77
PE
6236 Variadic C functions now count arguments with size_t, not int.
6237 This avoids an unnecessary limitation on 64-bit machines, which
6238 caused (substring ...) to crash on large vectors (Bug#8344).
6239 * lisp.h (struct Lisp_Subr.function.aMANY): Now takes size_t, not int.
6240 (DEFUN_ARGS_MANY, internal_condition_case_n, safe_call): Likewise.
77861b95 6241 All variadic functions and their callers changed accordingly.
c5101a77
PE
6242 (struct gcpro.nvars): Now size_t, not int. All uses changed.
6243 * data.c (arith_driver, float_arith_driver): Likewise.
6244 * editfns.c (general_insert_function): Likewise.
6245 * eval.c (struct backtrace.nargs, interactive_p)
6246 (internal_condition_case_n, run_hook_with_args, apply_lambda)
6247 (funcall_lambda, mark_backtrace): Likewise.
6248 * fns.c (concat): Likewise.
6249 * frame.c (x_set_frame_parameters): Likewise.
6250 * fns.c (get_key_arg): Now accepts and returns size_t, and returns
6251 0 if not found, not -1. All callers changed.
6252
dd3f25f7
PE
6253 * alloc.c (garbage_collect): Don't assume stack size fits in int.
6254 (stack_copy_size): Now size_t, not int.
6255 (stack_copy, stack_copy_size): Define only if MAX_SAVE_STACK > 0.
6256
461c2ab9
JB
62572011-03-28 Juanma Barranquero <lekktu@gmail.com>
6258
6259 * coding.c (encode_designation_at_bol): Remove parameter `charbuf_end',
6260 unused since 2002-03-01T01:17:24Z!handa@m17n.org and 2008-02-01T16:01:31Z!miles@gnu.org.
6261 All callers changed.
6262
6263 * lisp.h (multibyte_char_to_unibyte):
6264 * character.c (multibyte_char_to_unibyte): Remove parameter `rev_tbl',
6265 unused since 2002-03-01T01:16:34Z!handa@m17n.org and 2008-02-01T16:01:31Z!miles@gnu.org.
6266 * character.h (CHAR_TO_BYTE8):
6267 * cmds.c (internal_self_insert):
6268 * editfns.c (general_insert_function):
6269 * keymap.c (push_key_description):
6270 * search.c (Freplace_match):
6271 * xdisp.c (message_dolog, set_message_1): All callers changed.
6272
f6d62986
SM
62732011-03-28 Stefan Monnier <monnier@iro.umontreal.ca>
6274
6275 * keyboard.c (safe_run_hook_funcall): New function.
6276 (safe_run_hooks_1, safe_run_hooks_error, safe_run_hooks): On error,
6277 don't set the hook to nil, but remove the offending function instead.
6278 (Qcommand_hook_internal): Remove, unused.
6279 (syms_of_keyboard): Don't initialize Qcommand_hook_internal nor define
6280 Vcommand_hook_internal.
6281
6282 * eval.c (enum run_hooks_condition): Remove.
6283 (funcall_nil, funcall_not): New functions.
6284 (run_hook_with_args): Call each function through a `funcall' argument.
6285 Remove `cond' argument, now redundant.
6286 (Frun_hooks, Frun_hook_with_args, Frun_hook_with_args_until_success)
6287 (Frun_hook_with_args_until_failure): Adjust accordingly.
6288 (run_hook_wrapped_funcall, Frun_hook_wrapped): New functions.
6289
1db5b1ad
JB
62902011-03-28 Juanma Barranquero <lekktu@gmail.com>
6291
6292 * dispextern.h (string_buffer_position): Remove declaration.
6293
6294 * print.c (strout): Remove parameter `multibyte', unused since
6295 1999-08-21T19:30:21Z!gerd@gnu.org. All callers changed.
6296
6297 * search.c (boyer_moore): Remove parameters `len', `pos' and `lim',
6298 never used since function introduction in 1998-02-08T21:33:56Z!rms@gnu.org.
6299 All callers changed.
6300
6301 * w32.c (_wsa_errlist): Use braces for struct initializers.
6302
6303 * xdisp.c (string_buffer_position_lim): Remove parameter `w',
6304 never used since function introduction in 2001-03-09T18:41:50Z!gerd@gnu.org.
6305 All callers changed.
6306 (string_buffer_position): Likewise. Also, make static (it's never
6307 used outside xdisp.c).
6308 (cursor_row_p): Remove parameter `w', unused since
6309 2000-10-17T16:08:57Z!gerd@gnu.org. All callers changed.
6310 (decode_mode_spec): Remove parameter `precision', introduced during
6311 Gerd Moellmann's rewrite at 1999-07-21T21:43:52Z!gerd@gnu.org, but never used.
6312 All callers changed.
6313
5ffb62aa
JD
63142011-03-27 Jan Djärv <jan.h.d@swipnet.se>
6315
6316 * nsterm.m (syms_of_nsterm): Use doc: for ns-auto-hide-menu-bar.
6317
461c2ab9 63182011-03-27 Anders Lindgren <andlind@gmail.com>
f0a1382a
JD
6319
6320 * nsterm.m (ns_menu_bar_is_hidden): New variable.
6321 (ns_constrain_all_frames, ns_menu_bar_should_be_hidden)
6322 (ns_update_auto_hide_menu_bar): New functions.
6323 (ns_update_begin): Call ns_update_auto_hide_menu_bar.
6324 (applicationDidBecomeActive): Call ns_update_auto_hide_menu_bar and
6325 ns_constrain_all_frames.
6326 (constrainFrameRect): Return at once if ns_menu_bar_should_be_hidden.
6327 (syms_of_nsterm): DEFVAR ns-auto-hide-menu-bar, init to Qnil.
6328
5c380ffb
JD
63292011-03-27 Jan Djärv <jan.h.d@swipnet.se>
6330
6331 * nsmenu.m (runDialogAt): Remove argument to timer_check.
6332
9af30bdf
GM
63332011-03-27 Glenn Morris <rgm@gnu.org>
6334
6335 * syssignal.h: Replace RETSIGTYPE with void.
6336 * atimer.c, data.c, dispnew.c, emacs.c, floatfns.c, keyboard.c:
6337 * keyboard.h, lisp.h, process.c, sysdep.c, xterm.c:
6338 Replace SIGTYPE with void everywhere.
6339 * s/usg5-4-common.h (SIGTYPE): Remove definition.
6340 * s/template.h (SIGTYPE): Remove commented out definition.
6341
e2abce01
JB
63422011-03-26 Eli Zaretskii <eliz@gnu.org>
6343
6344 * xdisp.c (redisplay_window): Don't check buffer's clip_changed
6345 flag as a prerequisite for invoking try_scrolling. (Bug#6671)
6346
f868cd8a
JB
63472011-03-26 Juanma Barranquero <lekktu@gmail.com>
6348
59eb0929
JB
6349 * w32.c (read_unc_volume): Use parameter `henum', instead of
6350 global variable `wget_enum_handle'.
6351
6352 * keymap.c (describe_vector): Remove parameters `indices' and
6353 `char_table_depth', unused since 2002-03-01T01:43:26Z!handa@m17n.org.
6354 (describe_map, Fdescribe_vector): Adjust calls to `describe_vector'.
6355
f868cd8a
JB
6356 * keyboard.h (timer_check, show_help_echo): Remove unused parameters.
6357
6358 * keyboard.c (timer_check): Remove parameter `do_it_now',
6359 unused since 1996-04-12T06:01:29Z!rms@gnu.org.
6360 (show_help_echo): Remove parameter `ok_to_overwrite_keystroke_echo',
6361 unused since 2008-04-19T19:30:53Z!monnier@iro.umontreal.ca.
6362
6363 * keyboard.c (read_char):
6364 * w32menu.c (w32_menu_display_help):
6365 * xmenu.c (show_help_event, menu_help_callback):
6366 Adjust calls to `show_help_echo'.
6367
6368 * gtkutil.c (xg_maybe_add_timer):
6369 * keyboard.c (readable_events):
6370 * process.c (wait_reading_process_output):
6371 * xmenu.c (x_menu_wait_for_event): Adjust calls to `timer_check'.
6372
6373 * insdel.c (adjust_markers_gap_motion):
6374 Remove; no-op since 1998-01-02T21:29:48Z!rms@gnu.org.
6375 (gap_left, gap_right): Don't call it.
6376
2ecf6fdb
CY
63772011-03-25 Chong Yidong <cyd@stupidchicken.com>
6378
6379 * xdisp.c (handle_fontified_prop): Discard changes to clip_changed
6380 incurred during fontification.
6381
6b1f9ba4
JB
63822011-03-25 Juanma Barranquero <lekktu@gmail.com>
6383
6384 * buffer.c (defvar_per_buffer): Remove unused parameter `doc'.
6385 (DEFVAR_PER_BUFFER): Don't pass it.
6386
6387 * dispnew.c (row_equal_p, add_row_entry): Remove unused parameter `w'.
6388 (scrolling_window): Don't pass it.
6389
0f4a96b5
JB
63902011-03-25 Juanma Barranquero <lekktu@gmail.com>
6391
6392 * dispextern.h (glyph_matric): Use #if GLYPH_DEBUG, not #ifdef.
6393
6394 * fileio.c (check_executable) [DOS_NT]: Remove unused variables `len'
6395 and `suffix'.
6396 (Fset_file_selinux_context) [HAVE_LIBSELINUX]: Move here declaration
6397 of variables specific to SELinux and computation of `encoded_absname'.
6398
6399 * image.c (XPutPixel): Remove unused variable `height'.
6400
6401 * keyboard.c (make_lispy_event): Remove unused variable `hpos'.
6402
6403 * unexw32.c (get_section_info): Remove unused variable `section'.
6404
6405 * w32.c (stat): Remove unused variables `drive_root' and `devtype'.
6406 (system_process_attributes): Remove unused variable `sess'.
6407 (sys_read): Remove unused variable `err'.
6408
6409 * w32fns.c (top): Wrap variables with #if GLYPH_DEBUG, not #ifdef.
6410 (w32_wnd_proc): Remove unused variable `isdead'.
6411 (unwind_create_frame): Use #if GLYPH_DEBUG, not #ifdef.
6412 (Fx_server_max_request_size): Remove unused variable `dpyinfo'.
6413 (x_create_tip_frame): Remove unused variable `tem'.
6414
6415 * w32inevt.c (w32_console_read_socket):
6416 Remove unused variable `no_events'.
6417
6418 * w32term.c (x_draw_composite_glyph_string_foreground):
6419 Remove unused variable `width'.
6420
1149507c
JB
64212011-03-24 Juanma Barranquero <lekktu@gmail.com>
6422
6423 * w32term.c (x_set_glyph_string_clipping):
6424 Don't pass uninitialized region to CombineRgn.
6425
9c88f339
JB
64262011-03-23 Juanma Barranquero <lekktu@gmail.com>
6427
6428 * w32fns.c (x_set_menu_bar_lines): Remove unused variable `olines'.
6429 (w32_wnd_proc): Pass NULL to Windows API, not uninitialized buffer.
6430 (Fx_close_connection): Remove unused variable `i'.
6431
6432 * w32font.c (w32font_draw): Return number of glyphs.
6433 (w32font_open_internal): Remove unused variable `i'.
6434 (w32font_driver): Add missing initializer.
6435
6436 * w32menu.c (utf8to16): Remove unused variable `utf16'.
6437 (fill_in_menu): Remove unused variable `items_added'.
6438
6439 * w32term.c (last_mouse_press_frame): Remove static global variable.
6440 (w32_clip_to_row): Remove unused variable `f'.
6441 (x_delete_terminal): Remove unused variable `i'.
6442
6443 * w32uniscribe.c (uniscribe_shape): Remove unused variable `nclusters'.
6444 (NOTHING): Remove unused static global variable.
6445 (uniscribe_check_otf): Remove unused variable `table'.
6446 (uniscribe_font_driver): Add missing initializers.
6447
dee091a3
JD
64482011-03-23 Julien Danjou <julien@danjou.info>
6449
6450 * term.c (Fsuspend_tty, Fresume_tty):
6451 * minibuf.c (read_minibuf, run_exit_minibuf_hook):
6452 * window.c (temp_output_buffer_show):
6453 * insdel.c (signal_before_change):
6454 * frame.c (Fhandle_switch_frame):
6455 * fileio.c (Fdo_auto_save):
6456 * emacs.c (Fkill_emacs):
6457 * editfns.c (save_excursion_restore):
6458 * cmds.c (internal_self_insert):
6459 * callint.c (Fcall_interactively):
6460 * buffer.c (Fkill_all_local_variables):
6461 * keyboard.c (Fcommand_execute, Fsuspend_emacs, safe_run_hooks_1):
6462 Use Frun_hooks.
0f4a96b5 6463 (command_loop_1): Use Frun_hooks. Call safe_run_hooks
dee091a3
JD
6464 unconditionnaly since it does the check itself.
6465
2c520ab5 64662011-03-23 Paul Eggert <eggert@cs.ucla.edu>
f0641eff 6467
c9c49752
PE
6468 Fix more problems found by GCC 4.5.2's static checks.
6469
8abc3f12
PE
6470 * coding.c (encode_coding_raw_text): Avoid unnecessary test
6471 the first time through the loop, since we know p0 < p1 then.
6472 This also avoids a gcc -Wstrict-overflow warning.
6473
a2d26660
PE
6474 * lisp.h (SAFE_ALLOCA, SAFE_ALLOCA_LISP): Avoid 'int' overflow
6475 leading to a memory leak, possible in functions like
6476 load_charset_map_from_file that can allocate an unbounded number
b12ef411 6477 of objects (Bug#8318).
a2d26660 6478
916c72e9
PE
6479 * xmenu.c (set_frame_menubar): Use EMACS_UINT, not int, for indexes
6480 that could (at least in theory) be that large.
6481
19ab8a18
PE
6482 * xdisp.c (message_log_check_duplicate): Return unsigned long, not int.
6483 This is less likely to overflow, and avoids undefined behavior if
6484 overflow does occur. All callers changed. Use strtoul to scan
6485 for the unsigned long integer.
b7cbbd6f
PE
6486 (pint2hrstr): Simplify and tune code slightly.
6487 This also avoids a (bogus) GCC warning with gcc -Wstrict-overflow.
19ab8a18 6488
f0641eff
PE
6489 * scroll.c (do_scrolling): Work around GCC bug 48228.
6490 See <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48228>.
6491
7f650bb9
PE
6492 * frame.c (Fmodify_frame_parameters): Simplify loop counter.
6493 This also avoids a warning with gcc -Wstrict-overflow.
39f5e519
PE
6494 (validate_x_resource_name): Simplify count usage.
6495 This also avoids a warning with gcc -Wstrict-overflow.
7f650bb9 6496
37dd57d1
PE
6497 * fileio.c (Fcopy_file): Report error if fchown or fchmod
6498 fail (Bug#8306).
81e56e61 6499
699979fc 6500 * emacs.c (Fdaemon_initialized): Do not ignore I/O errors (Bug#8303).
dc1ca6a8 6501
401bf9b4
PE
6502 * process.c (Fmake_network_process): Use socklen_t, not int,
6503 where POSIX says socklen_t is required in portable programs.
6504 This fixes a porting bug on hosts like 64-bit HP-UX, where
591b2973 6505 socklen_t is wider than int (Bug#8277).
401bf9b4
PE
6506 (Fmake_network_process, server_accept_connection):
6507 (wait_reading_process_output, read_process_output):
6508 Likewise.
6509
b93aacde
PE
6510 * process.c: Rename or move locals to avoid shadowing.
6511 (list_processes_1, Fmake_network_process):
6512 (read_process_output_error_handler, exec_sentinel_error_handler):
6513 Rename or move locals.
4dc343ee 6514 (Fmake_network_process): Define label "retry_connect" only if needed.
0da49335 6515 (Fnetwork_interface_info): Fix pointer signedness.
f990b4e5 6516 (process_send_signal): Add cast to avoid pointer signedness problem.
7b808126 6517 (FIRST_PROC_DESC, IF_NON_BLOCKING_CONNECT): Remove unused macros.
c939f91b 6518 (create_process): Use 'volatile' to avoid vfork clobbering (Bug#8298).
b93aacde 6519
af8a867c 6520 Make tparam.h and terminfo.c consistent.
44f230aa
SM
6521 * cm.c (tputs, tgoto, BC, UP): Remove extern decls.
6522 Include tparam.h instead, since it declares them.
af8a867c
PE
6523 * cm.h (PC): Remove extern decl; tparam.h now does this.
6524 * deps.mk (cm.o, terminfo.o): Depend on tparam.h.
6525 * terminfo.c: Include tparam.h, to check interfaces.
6526 (tparm): Make 1st arg a const pointer in decl. Put it at top level.
6527 (tparam): Adjust signature to match interface in tparam.h;
6528 this removes some undefined behavior. Check that outstring and len
6529 are zero, which they always are with Emacs.
6530 * tparam.h (PC, BC, UP): New extern decls.
6531
0248044d 6532 * xftfont.c (xftfont_shape): Now static, and defined only if needed.
001a7ab4 6533 (xftfont_open): Rename locals to avoid shadowing.
0248044d 6534
8ff096c1 6535 * ftfont.c (ftfont_resolve_generic_family): Fix pointer signedness.
a00924bb
PE
6536 (ftfont_otf_capability, ftfont_shape): Omit decls if not needed.
6537 (OTF_TAG_SYM): Omit macro if not needed.
e932860f 6538 (ftfont_list): Remove unused local.
49eaafba
PE
6539 (get_adstyle_property, ftfont_pattern_entity):
6540 (ftfont_lookup_cache, ftfont_open, ftfont_anchor_point):
6541 Rename locals to avoid shadowing.
8ff096c1 6542
e2be39f6
PE
6543 * xfont.c (xfont_list_family): Mark var as initialized.
6544
c9735e30
PE
6545 * xml.c (make_dom): Now static.
6546
8f5201ae
PE
6547 * composite.c (composition_compute_stop_pos): Rename local to
6548 avoid shadowing.
b246f932
PE
6549 (composition_reseat_it): Remove unused locals.
6550 (find_automatic_composition, composition_adjust_point): Likewise.
80e079b2 6551 (composition_update_it): Mark var as initialized.
11b61122
PE
6552 (find_automatic_composition): Mark vars as initialized,
6553 with a FIXME (Bug#8290).
8f5201ae 6554
760fbc2c
PE
6555 character.h: Rename locals to avoid shadowing.
6556 * character.h (PREV_CHAR_BOUNDARY, FETCH_STRING_CHAR_ADVANCE):
6557 (FETCH_STRING_CHAR_AS_MULTIBYTE_ADVANCE, FETCH_CHAR_ADVANCE):
6558 (FETCH_CHAR_ADVANCE_NO_CHECK, INC_POS, DEC_POS, BUF_INC_POS):
6559 (BUF_DEC_POS): Be more systematic about renaming local temporaries
6560 to avoid shadowing.
6561
ff08eb85
PE
6562 * textprop.c (property_change_between_p): Remove; unused.
6563
fc7bf025
PE
6564 * intervals.c (interval_start_pos): Now static.
6565
235d7abc
PE
6566 * intervals.h (CHECK_TOTAL_LENGTH): Avoid empty "else".
6567
44f230aa
SM
6568 * atimer.c (start_atimer, append_atimer_lists, set_alarm):
6569 Rename locals to avoid shadowing.
3e7d6594 6570
50060332
PE
6571 * sound.c (wav_play, au_play, Fplay_sound_internal):
6572 Fix pointer signedness.
d01f234b 6573 (alsa_choose_format): Remove unused local var.
c83b8872
PE
6574 (wav_play): Initialize a variable to 0, to prevent undefined
6575 behavior (Bug#8278).
50060332 6576
c4fc4e30
PE
6577 * region-cache.c (insert_cache_boundary): Redo var to avoid shadowing.
6578
918436ed
PE
6579 * region-cache.h (pp_cache): New decl, for gcc -Wmissing-prototypes.
6580
c939f91b
PE
6581 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork
6582 clobbering (Bug#8298).
b9c7f648
PE
6583 * sysdep.c (sys_subshell): Likewise.
6584 Previously, the sys_subshell 'volatile' was incorrectly IF_LINTted out.
7e9123a2 6585
6bd8c144
PE
6586 * lisp.h (child_setup): Now NO_RETURN unless DOS_NT.
6587 This should get cleaned up, so that child_setup has the
6588 same signature on all platforms.
6589
7710357c 6590 * callproc.c (call_process_cleanup): Now static.
cb1d0ef7 6591 (relocate_fd): Rename locals to avoid shadowing.
7710357c 6592
c59da222
CY
65932011-03-22 Chong Yidong <cyd@stupidchicken.com>
6594
6595 * xterm.c (x_clear_frame): Remove XClearWindow call. This appears
6596 not to be necessary, and produces flickering.
6597
66b87493
GM
65982011-03-20 Glenn Morris <rgm@gnu.org>
6599
6600 * config.in: Remove file.
6601
45b6f6d5
JB
66022011-03-20 Juanma Barranquero <lekktu@gmail.com>
6603
6604 * minibuf.c (Vcompleting_read_function): Don't declare, global variables
6605 are now in src/globals.h.
6606 (syms_of_minibuf): Remove spurious & from previous change.
6607
3ec03f7e
LL
66082011-03-20 Leo <sdl.web@gmail.com>
6609
6610 * minibuf.c (completing-read-function): New variable.
6611 (completing-read-default): Rename from completing-read.
6612 (completing-read): Call completing-read-function.
6613
b14e3e21
CY
66142011-03-19 Juanma Barranquero <lekktu@gmail.com>
6615
6616 * xfaces.c (Fx_load_color_file):
6617 Read color file from absolute filename (bug#8250).
6618
f2b726e6
JB
66192011-03-19 Juanma Barranquero <lekktu@gmail.com>
6620
6621 * makefile.w32-in: Update dependencies.
6622
09f6ff02
EZ
66232011-03-17 Eli Zaretskii <eliz@gnu.org>
6624
6625 * makefile.w32-in ($(BLD)/unexw32.$(O)): Depend on $(SRC)/unexec.h.
6626
29a6015a
PE
66272011-03-17 Paul Eggert <eggert@cs.ucla.edu>
6628
a3a6c54e
PE
6629 Fix more problems found by GCC 4.5.2's static checks.
6630
b766f867
PE
6631 * process.c (make_serial_process_unwind, send_process_trap):
6632 (sigchld_handler): Now static.
6633
be02381c
PE
6634 * process.c (allocate_pty): Let PTY_ITERATION declare iteration vars.
6635 That way, the code declares only the vars that it needs.
6636 * s/aix4-2.h (PTY_ITERATION): Declare iteration vars.
6637 * s/cygwin.h (PTY_ITERATION): Likewise.
6638 * s/darwin.h (PTY_ITERATION): Likewise.
6639 * s/gnu-linux.h (PTY_ITERATION): Likewise.
6640
57048744
PE
6641 * s/irix6-5.h (PTY_OPEN): Declare stb, to loosen coupling.
6642 * process.c (allocate_pty): Don't declare stb unless it's needed.
6643
7914961c 6644 * bytecode.c (MAYBE_GC): Rewrite so as not to use empty "else".
615f2d59
PE
6645 (CONSTANTLIM): Remove; unused.
6646 (METER_CODE, Bscan_buffer, Bread_char, Bset_mark):
6647 Define only if needed.
7914961c 6648
b3967b18
PE
6649 * unexelf.c (unexec): Name an expression,
6650 to avoid gcc -Wbad-function-cast warning.
9ae71512
PE
6651 Use a different way to cause a compilation error if anyone uses
6652 n rather than nn, a way that does not involve shadowing.
73366a00 6653 (ELF_BSS_SECTION_NAME, OLD_PROGRAM_H): Remove; unused.
b3967b18 6654
29a6015a
PE
6655 * deps.mk (unexalpha.o): Remove; unused.
6656
43cfc33e 6657 New file unexec.h, the (simple) interface for unexec (Bug#8267).
7feda0d2 6658 * unexec.h: New file.
ce701a33
PE
6659 * deps.mk (emacs.o, unexaix.o, unexcw.o, unexcoff.o, unexelf.o):
6660 (unexhp9k800.o, unexmacosx.o, unexsol.o, unexw32.o):
6661 Depend on unexec.h.
6662 * emacs.c [!defined CANNOT_DUMP]: Include unexec.h.
6663 * unexaix.c, unexcoff.c, unexcw.c, unexelf.c, unexhp9k800.c:
6664 * unexmacosx.c, unexsol.c, unexw32.c: Include unexec.h.
381259ef 6665 Change as necessary to match prototype in unexec.h.
ce701a33 6666
01f44d5a
PE
6667 * syntax.c (Fforward_comment, scan_lists): Rename locals to avoid
6668 shadowing.
4f63c6bb 6669 (back_comment, skip_chars): Mark vars as initialized.
01f44d5a 6670
a6670b0b
PE
6671 * character.h (FETCH_STRING_CHAR_ADVANCE_NO_CHECK, BUF_INC_POS):
6672 Rename locals to avoid shadowing.
6673
cef2010d 6674 * lread.c (read1): Rewrite so as not to use empty "else".
0902fe45 6675 (Fload, readevalloop, read1): Rename locals to avoid shadowing.
cef2010d 6676
d4d7173a
PE
6677 * print.c (Fredirect_debugging_output): Fix pointer signedess.
6678
f08b802a
PE
6679 * lisp.h (debug_output_compilation_hack): Add decl here, to avoid
6680 warning when compiling print.c.
6681
3ddb0639
PE
6682 * font.c (font_unparse_fcname): Abort in an "impossible" situation
6683 instead of using an uninitialized var.
5ad03b97 6684 (font_sort_entities): Mark var as initialized.
3ddb0639 6685
170a2692
PE
6686 * character.h (FETCH_CHAR_ADVANCE): Rename locals to avoid shadowing.
6687
e663c700
PE
6688 * font.c (font_unparse_xlfd): Don't mix pointers to variables with
6689 pointers to constants.
89bc529a 6690 (font_parse_fcname): Remove unused vars.
7b81e2d0 6691 (font_delete_unmatched): Now static.
ea838e10 6692 (font_get_spec): Remove; unused.
13a547c6
PE
6693 (font_style_to_value, font_prop_validate_style, font_unparse_fcname):
6694 (font_update_drivers, Ffont_get_glyphs, font_add_log):
6695 Rename or move locals to avoid shadowing.
e663c700 6696
2a80c887 6697 * fns.c (require_nesting_list, require_unwind): Now static.
612f56df 6698 (Ffillarray): Rename locals to avoid shadowing.
2a80c887 6699
1384fa33 6700 * floatfns.c (domain_error2): Define only if needed.
a885e2ed 6701 (Ffrexp, Fldexp): Rename locals to avoid shadowing.
1384fa33 6702
8b2c52e9
PE
6703 * alloc.c (mark_backtrace): Move decl from here ...
6704 * lisp.h: ... to here, so that it can be checked.
6705
475545b5 6706 * eval.c (call_debugger, do_debug_on_call, grow_specpdl): Now static.
d28a2170 6707 (Fdefvar): Rewrite so as not to use empty "else".
cfcbfb1a
PE
6708 (lisp_indirect_variable): Name an expression,
6709 to avoid gcc -Wbad-function-cast warning.
1faed8ae 6710 (Fdefvar): Rename locals to avoid shadowing.
475545b5 6711
b1349114 6712 * callint.c (quotify_arg, quotify_args): Now static.
a3e8cbda 6713 (Fcall_interactively): Rename locals to avoid shadowing.
b0e80955 6714 Use const pointer when appropriate.
b1349114 6715
a2928364
PE
6716 * lisp.h (get_system_name, get_operating_system_release):
6717 Move decls here, to check interfaces.
6718 * process.c (get_operating_system_release): Move decl to lisp.h.
6719 * xrdb.c (get_system_name): Likewise.
63c5d10b
PE
6720 * editfns.c (init_editfns, Fuser_login_name, Fuser_uid):
6721 (Fuser_real_uid, Fuser_full_name): Remove unnecessary casts,
6722 some of which prompt warnings from gcc -Wbad-function-cast.
545b49b4
PE
6723 (Fformat_time_string, Fencode_time, Finsert_char):
6724 (Ftranslate_region_internal, Fformat):
6725 Rename or remove local vars to avoid shadowing.
9710023e 6726 (Ftranslate_region_internal): Mark var as initialized.
63c5d10b 6727
a415e694
PE
6728 * doc.c (Fdocumentation, Fsnarf_documentation): Move locals to
6729 avoid shadowing.
6730
8ef4622d
PE
6731 * lisp.h (eassert): Check that the argument compiles, even if
6732 ENABLE_CHECKING is not defined.
6733
946f9a5b
PE
6734 * data.c (Findirect_variable): Name an expression, to avoid
6735 gcc -Wbad-function-cast warning.
112396d6 6736 (default_value, arithcompare, arith_driver, arith_error): Now static.
b9b84fa9 6737 (store_symval_forwarding): Rename local to avoid shadowing.
44f230aa
SM
6738 (Fmake_variable_buffer_local, Fmake_local_variable):
6739 Mark variables as initialized.
52746918 6740 (do_blv_forwarding, do_symval_forwarding): Remove; unused.
946f9a5b 6741
e5aab7e7 6742 * alloc.c (check_cons_list): Do not define unless GC_CHECK_CONS_LIST.
ae35e756
PE
6743 (Fmake_vector, Fvector, Fmake_byte_code, Fgarbage_collect):
6744 Rename locals to avoid shadowing.
dff45157
PE
6745 (mark_stack): Move local variables into the #ifdef region where
6746 they're used.
7bc26fdb
PE
6747 (BLOCK_INPUT_ALLOC, UNBLOCK_INPUT_ALLOC): Define only if
6748 ! defined SYSTEM_MALLOC && ! defined SYNC_INPUT, as they are not
6749 needed otherwise.
6750 (CHECK_ALLOCATED): Define only if GC_CHECK_MARKED_OBJECTS.
6751 (GC_STRING_CHARS): Remove; not used.
d40d4be1 6752 (Fmemory_limit): Cast sbrk's returned value to char *.
ae35e756 6753
e5aab7e7
PE
6754 * lisp.h (check_cons_list): Declare if GC_CHECK_CONS_LIST; this
6755 avoids undefined behavior in theory.
6756
4da60324
PE
6757 * regex.c (IF_LINT): Add defn, for benefit of ../lib-src.
6758
88043301
PE
6759 Use functions, not macros, for up- and down-casing (Bug#8254).
6760 * buffer.h (DOWNCASE_TABLE, UPCASE_TABLE, DOWNCASE, UPPERCASEP):
6761 (NOCASEP, LOWERCASEP, UPCASE, UPCASE1): Remove. All callers changed
6762 to use the following functions instead of these macros.
6763 (downcase): Adjust to lack of DOWNCASE_TABLE. Return int, not
6764 EMACS_INT, since callers assume the returned value fits in int.
6765 (upcase1): Likewise, for UPCASE_TABLE.
6766 (uppercasep, lowercasep, upcase): New static inline functions.
0da09c43 6767 * editfns.c (Fchar_equal): Remove no-longer-needed workaround for
db69b0cd 6768 the race-condition problem in the old DOWNCASE.
88043301 6769
19ed5445
PE
6770 * regex.c (CHARSET_LOOKUP_RANGE_TABLE_RAW, POP_FAILURE_REG_OR_COUNT):
6771 Rename locals to avoid shadowing.
6772 (regex_compile, re_match_2_internal): Move locals to avoid shadowing.
abbd1bcf
PE
6773 (regex_compile, re_search_2, re_match_2_internal):
6774 Remove unused local vars.
952db0d7
PE
6775 (FREE_VAR): Rewrite so as not to use empty "else",
6776 which gcc can warn about.
da053e48 6777 (regex_compile, re_match_2_internal): Mark locals as initialized.
b313f9d8
PE
6778 (RETALLOC_IF): Define only if needed.
6779 (WORDCHAR_P): Likewise. This one is never needed, but is used
6780 only in a comment talking about a compiler bug, so put inside
6781 the #if 0 of that comment.
6782 (CHARSET_LOOKUP_BITMAP, FAIL_STACK_FULL, RESET_FAIL_STACK):
6783 (PUSH_FAILURE_ELT, BUF_PUSH_3, STOP_ADDR_VSTRING):
6784 Remove; unused.
19ed5445 6785
1f3561e4 6786 * search.c (boyer_moore): Rename locals to avoid shadowing.
76ef09b7
PE
6787 * character.h (FETCH_STRING_CHAR_AS_MULTIBYTE_ADVANCE):
6788 (PREV_CHAR_BOUNDARY): Likewise.
1f3561e4 6789
ded6f8f7
PE
6790 * search.c (simple_search): Remove unused var.
6791
dbd37a95
PE
6792 * dired.c (compile_pattern): Move decl from here ...
6793 * lisp.h: ... to here, so that it can be checked.
6794 (struct re_registers): New forward decl.
6795
7e47afad
PE
6796 * character.h (INC_POS, DEC_POS): Rename locals to avoid shadowing.
6797
85f24f61
PE
6798 * indent.c (MULTIBYTE_BYTES_WIDTH): New args bytes, width.
6799 All uses changed.
6800 (MULTIBYTE_BYTES_WIDTH, scan_for_column, compute_motion):
6801 Rename locals to avoid shadowing.
5671df8f 6802 (Fvertical_motion): Mark locals as initialized.
85f24f61 6803
181aa2be 6804 * casefiddle.c (casify_object, casify_region): Now static.
e45a141a 6805 (casify_region): Mark local as initialized.
181aa2be 6806
930d429c
PE
6807 * cmds.c (internal_self_insert): Rename local to avoid shadowing.
6808
7082eac6
PE
6809 * lisp.h (GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR, GCPRO5_VAR, GCPRO6_VAR):
6810 New macros, so that the caller can use some names other than
6811 gcpro1, gcpro2, etc.
6812 (GCPRO2, GCPRO3, GCPRO4, GCPRO5, GCPRO6): Reimplement in terms
6813 of the new macros.
6814 (GCPRO1_VAR, UNGCPRO_VAR): Change the meaning of the second
6815 argument, for consistency with GCPRO2_VAR, etc: it is now the
6816 prefix of the variable, not the variable itself. All uses
6817 changed.
38b2c076
PE
6818 * dired.c (directory_files_internal, file_name_completion):
6819 Rename locals to avoid shadowing.
6820
15206ed9
PE
6821 Fix a race condition diagnosed by gcc -Wsequence-point (Bug#8254).
6822 An expression of the form (DOWNCASE (x) == DOWNCASE (y)), found in
6823 dired.c's scmp function, had undefined behavior.
6824 * lisp.h (DOWNCASE_TABLE, UPCASE_TABLE, DOWNCASE, UPPERCASEP):
6825 (NOCASEP, LOWERCASEP, UPCASE, UPCASE1): Move from here ...
6826 * buffer.h: ... to here, because these macros use current_buffer,
6827 and the new implementation with inline functions needs to have
6828 current_buffer in scope now, rather than later when the macros
6829 are used.
6830 (downcase, upcase1): New static inline functions.
6831 (DOWNCASE, UPCASE1): Reimplement using these functions.
6832 This avoids undefined behavior in expressions like
6833 DOWNCASE (x) == DOWNCASE (y), which previously suffered
6834 from race conditions in accessing the global variables
6835 case_temp1 and case_temp2.
6836 * casetab.c (case_temp1, case_temp2): Remove; no longer needed.
6837 * lisp.h (case_temp1, case_temp2): Remove their decls.
6838 * character.h (ASCII_CHAR_P): Move from here ...
6839 * lisp.h: ... to here, so that the inline functions mentioned
6840 above can use them.
6841
4a6bea26
PE
6842 * dired.c (directory_files_internal_unwind): Now static.
6843
f14b7e14
PE
6844 * fileio.c (file_name_as_directory, directory_file_name):
6845 (barf_or_query_if_file_exists, auto_save_error, auto_save_1):
6846 Now static.
2893f146
PE
6847 (file_name_as_directory): Use const pointers when appropriate.
6848 (Fexpand_file_name): Likewise. In particular, newdir might
6849 point at constant storage, so make it a const pointer.
fd4ead52 6850 (Fmake_directory_internal, Fread_file_name): Remove unused vars.
b14aac08
PE
6851 (Ffile_selinux_context, Fset_file_selinux_context): Fix pointer
6852 signedness issues.
f839df0c
PE
6853 (Fset_file_times, Finsert_file_contents, auto_save_error):
6854 Rename locals to avoid shadowing.
f14b7e14 6855
5716756e 6856 * minibuf.c (choose_minibuf_frame_1): Now static.
62137a95
PE
6857 (Ftry_completion, Fall_completions): Rename or remove locals
6858 to avoid shadowing.
5716756e 6859
b4c3046a
PE
6860 * marker.c (bytepos_to_charpos): Remove; unused.
6861
b45db522
PE
6862 * lisp.h (verify_bytepos, count_markers): New decls,
6863 so that gcc does not warn that these functions aren't declared.
6864
85876d07
PE
6865 * insdel.c (check_markers, make_gap_larger, make_gap_smaller):
6866 (reset_var_on_error, Fcombine_after_change_execute_1): Now static.
f0cb4a60 6867 (CHECK_MARKERS): Redo to avoid gcc -Wempty-body diagnostic.
40ef059e 6868 (copy_text): Remove unused local var.
85876d07 6869
03d78a21 6870 * filelock.c (within_one_second): Now static.
b3dd38ab 6871 (lock_file_1): Rename local to avoid shadowing.
03d78a21 6872
5df8f01b
PE
6873 * buffer.c (fix_overlays_before): Mark locals as initialized.
6874 (fix_start_end_in_overlays): Likewise. This function should be
6875 simplified by using pointers-to-pointers, but that's a different
6876 matter.
b1d876f1 6877 (switch_to_buffer_1): Now static.
8f54f30a
PE
6878 (Fkill_buffer, record_buffer, Fbury_buffer, Fset_buffer_multibyte):
6879 (report_overlay_modification): Rename locals to avoid shadowing.
c3bd59b5 6880
a70072c9 6881 * sysdep.c (system_process_attributes): Rename vars to avoid shadowing.
fbd02d7b 6882 Fix pointer signedness issue.
edced198
PE
6883 (sys_subshell): Mark local as volatile if checking for lint,
6884 to suppress a gcc -Wclobbered warning that does not seem to be right.
15dfd3d9 6885 (MAXPATHLEN): Define only if needed.
a70072c9 6886
a0977c44
PE
6887 * process.c (serial_open, serial_configure): Move decls from here ...
6888 * systty.h: ... to here, so that they can be checked.
6889
a884fdcc
PE
6890 * fns.c (get_random, seed_random): Move extern decls from here ...
6891 * lisp.h: ... to here, so that they can be checked.
6892
604efe86 6893 * sysdep.c (reset_io): Now static.
b8950c94 6894 (wait_for_termination_signal): Remove; unused.
604efe86 6895
38fc62d9
PE
6896 * keymap.c (keymap_parent, keymap_memberp, map_keymap_internal):
6897 (copy_keymap_item, append_key, push_text_char_description):
6898 Now static.
1004a21a 6899 (Fwhere_is_internal): Don't test CONSP (sequences) unnecessarily.
dbbb8427 6900 (DENSE_TABLE_SIZE): Remove; unused.
c1141155
PE
6901 (get_keymap, access_keymap, Fdefine_key, Fwhere_is_internal):
6902 (describe_map_tree):
6903 Rename locals to avoid shadowing.
38fc62d9 6904
2f2650da
PE
6905 * keyboard.c: Declare functions static if they are not used elsewhere.
6906 (echo_char, echo_dash, cmd_error, top_level_2):
6907 (poll_for_input, handle_async_input): Now static.
69a058fa
PE
6908 (read_char, kbd_buffer_get_event, make_lispy_position):
6909 (make_lispy_event, make_lispy_movement, apply_modifiers):
6910 (decode_keyboard_code, tty_read_avail_input, menu_bar_items):
6911 (parse_tool_bar_item, read_key_sequence, Fread_key_sequence):
6912 (Fread_key_sequence_vector): Rename locals to avoid shadowing.
c8a06054 6913 (read_key_sequence, read_char): Mark locals as initialized.
3ac94672 6914 (Fexit_recursive_edit, Fabort_recursive_edit): Mark with NO_RETURN.
2f2650da 6915
a053e86c 6916 * keyboard.h (make_ctrl_char): New decl.
da2f2dd9
PE
6917 (mark_kboards): Move decl here ...
6918 * alloc.c (mark_kboards): ... from here.
a053e86c 6919
4752793e
PE
6920 * lisp.h (force_auto_save_soon): New decl.
6921
74f10ca7 6922 * emacs.c (init_cmdargs): Rename local to avoid shadowing.
244fc23d
PE
6923 (DEFINE_DUMMY_FUNCTION): New macro.
6924 (__do_global_ctors, __do_global_ctors_aux, __do_global_dtors, __main):
6925 Use it.
c03cd23f
PE
6926 (main): Add casts to avoid warnings
6927 if GCC considers string literals to be constants.
74f10ca7 6928
022e70d4
PE
6929 * lisp.h (fatal_error_signal): Add decl, since it's exported.
6930
59d6fe83
PE
6931 * dbusbind.c: Pointer signedness fixes.
6932 (xd_signature, xd_append_arg, xd_initialize):
6933 (Fdbus_call_method, Fdbus_call_method_asynchronously):
6934 (Fdbus_method_return_internal, Fdbus_method_error_internal):
6935 (Fdbus_send_signal, xd_read_message_1, Fdbus_register_service):
6936 (Fdbus_register_signal): Use SSDATA when the context wants char *.
6937
78320123
PE
6938 * dbusbind.c (Fdbus_init_bus): Add cast to avoid warning
6939 if GCC considers string literals to be constants.
49cebcca 6940 (Fdbus_register_service, Fdbus_register_method): Remove unused vars.
78320123 6941
35ac2a97
SM
69422011-03-16 Stefan Monnier <monnier@iro.umontreal.ca>
6943
fb103ca9
SM
6944 * print.c (PRINT_CIRCLE_CANDIDATE_P): New macro.
6945 (print_preprocess, print_object): New macro to fix last change.
6946
35ac2a97
SM
6947 * print.c (print_preprocess): Don't forget font objects.
6948
62973b41
JB
69492011-03-16 Juanma Barranquero <lekktu@gmail.com>
6950
6951 * emacs.c (USAGE3): Doc fixes.
6952
0e48bb22
AS
69532011-03-15 Andreas Schwab <schwab@linux-m68k.org>
6954
6955 * coding.c (detect_coding_iso_2022): Reorganize code to clarify
6956 structure.
6957
7684e57b
JB
69582011-03-14 Juanma Barranquero <lekktu@gmail.com>
6959
6960 * lisp.h (VWindow_system, Qfile_name_history):
6961 * keyboard.h (lispy_function_keys) [WINDOWSNT]:
6962 * w32term.h (w32_system_caret_hwnd, w32_system_caret_height)
6963 (w32_system_caret_x, w32_system_caret_y): Declare extern.
6964
6965 * w32select.c: Don't #include "keyboard.h".
c96bbc66 6966 (run_protected): Add extern declaration for waiting_for_input.
7684e57b
JB
6967
6968 * w32.c (Qlocal, noninteractive1, inhibit_window_system):
6969 * w32console.c (detect_input_pending, read_input_pending)
6970 (encode_terminal_code):
6971 * w32fns.c (quit_char, lispy_function_keys, Qtooltip)
6972 (w32_system_caret_hwnd, w32_system_caret_height, w32_system_caret_x)
6973 (w32_system_caret_y, Qfile_name_history):
6974 * w32font.c (w32font_driver, QCantialias, QCotf, QClang):
6975 * w32inevt.c (reinvoke_input_signal, lispy_function_keys):
6976 * w32menu.c (Qmenu_bar, QCtoggle, QCradio, Qoverriding_local_map)
6977 (Qoverriding_terminal_local_map, Qmenu_bar_update_hook):
6978 * w32proc.c (Qlocal, report_file_error):
6979 * w32term.c (Vwindow_system, updating_frame):
6980 * w32uniscribe.c (initialized, uniscribe_font_driver):
6981 Remove unneeded extern declarations.
6982
2aa46d6c
CY
69832011-03-14 Chong Yidong <cyd@stupidchicken.com>
6984
c96bbc66 6985 * buffer.c (Fmake_indirect_buffer): Fix incorrect assertions.
2aa46d6c 6986
cffc6f3b
CY
69872011-03-13 Chong Yidong <cyd@stupidchicken.com>
6988
6989 * buffer.h (BUF_BEGV, BUF_BEGV_BYTE, BUF_ZV, BUF_ZV_BYTE, BUF_PT)
6990 (BUF_PT_BYTE): Rewrite to handle indirect buffers (Bug#8219).
6991 These macros can no longer be used for assignment.
6992
44f230aa
SM
6993 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer):
6994 Assign struct members directly, instead of using BUF_BEGV etc.
cffc6f3b
CY
6995 (record_buffer_markers, fetch_buffer_markers): New functions for
6996 recording and fetching special buffer markers.
6997 (set_buffer_internal_1, set_buffer_temp): Use them.
6998
6999 * lread.c (unreadchar): Use SET_BUF_PT_BOTH.
7000
7001 * insdel.c (adjust_point): Use SET_BUF_PT_BOTH.
7002
7003 * intervals.c (temp_set_point_both): Use SET_BUF_PT_BOTH.
7004 (get_local_map): Use SET_BUF_BEGV_BOTH and SET_BUF_ZV_BOTH.
7005
7006 * xdisp.c (hscroll_window_tree):
7007 (reconsider_clip_changes): Use PT instead of BUF_PT.
7008
d251f04b
EZ
70092011-03-13 Eli Zaretskii <eliz@gnu.org>
7010
7011 * makefile.w32-in ($(BLD)/editfns.$(O)): Depend on
7012 $(EMACS_ROOT)/lib/intprops.h.
7013
f0c77cd1
PE
70142011-03-13 Paul Eggert <eggert@cs.ucla.edu>
7015
3eca4629
PE
7016 Fix more problems found by GCC 4.5.2's static checks.
7017
7c86ee98
PE
7018 * gtkutil.c (xg_get_pixbuf_from_pixmap): Add cast from char *
7019 to unsigned char * to avoid compiler diagnostic.
b0afc268
PE
7020 (xg_free_frame_widgets): Make it clear that a local variable is
7021 needed only if USE_GTK_TOOLTIP.
01e0b5ad
PE
7022 (gdk_window_get_screen): Make it clear that this macro is needed
7023 only if USE_GTK_TOOLTIP.
1e5524e7
PE
7024 (int_gtk_range_get_value): New function, which avoids a diagnostic
7025 from gcc -Wbad-function-cast.
7026 (xg_set_toolkit_scroll_bar_thumb): Use it.
7027 (xg_tool_bar_callback, xg_tool_item_stale_p): Rewrite to avoid
7028 diagnostic from gcc -Wbad-function-cast.
65dc836c
PE
7029 (get_utf8_string, xg_get_file_with_chooser):
7030 Rename locals to avoid shadowing.
7031 (create_dialog): Move locals to avoid shadowing.
7c86ee98 7032
41729b81
PE
7033 * xgselect.c (xg_select): Remove unused var.
7034
f0c77cd1
PE
7035 * image.c (four_corners_best): Mark locals as initialized.
7036 (gif_load): Initialize transparent_p to zero (Bug#8238).
7037 Mark another local as initialized.
ec6cf4c6 7038 (my_png_error, my_error_exit): Mark with NO_RETURN.
f0c77cd1 7039
ce0ad53d 7040 * image.c (clear_image_cache): Now static.
d5d5a617 7041 (DIM, HAVE_STDLIB_H_1): Remove unused macros.
e22cffbc 7042 (xpm_load): Redo to avoid "discards qualifiers" gcc warning.
77a765fd
PE
7043 (x_edge_detection): Remove unnecessary cast that
7044 gcc -Wbad-function-cast diagnoses.
2037898d 7045 (gif_load): Fix pointer signedness.
6ae141d6
PE
7046 (clear_image_cache, xbm_read_bitmap_data, x_detect_edges):
7047 (jpeg_load, gif_load): Rename locals to avoid shadowing.
ce0ad53d 7048
33383987 70492011-03-12 Paul Eggert <eggert@cs.ucla.edu>
3eca4629 7050
d32df629
PE
7051 Improve quality of tests for time stamp overflow.
7052 For example, without this patch (encode-time 0 0 0 1 1
7053 1152921504606846976) returns the obviously-bogus value (-948597
7054 62170) on my RHEL 5.5 x86-64 host. With the patch, it correctly
7055 reports time overflow. See
7056 <http://lists.gnu.org/archive/html/emacs-devel/2011-03/msg00470.html>.
b8d9bd41
PE
7057 * deps.mk (editfns.o): Depend on ../lib/intprops.h.
7058 * editfns.c: Include limits.h and intprops.h.
7059 (TIME_T_MIN, TIME_T_MAX): New macros.
7060 (time_overflow): Move earlier, to before first use.
7061 (hi_time, lo_time): New functions, for an accurate test for
7062 out-of-range times.
7063 (Fcurrent_time, Fget_internal_run_time, make_time): Use them.
7064 (Fget_internal_run_time): Don't assume time_t fits in int.
7065 (make_time): Use list2 instead of Fcons twice.
7066 (Fdecode_time): More accurate test for out-of-range times.
7067 (check_tm_member): New function.
7068 (Fencode_time): Use it, to test for out-of-range times.
d32df629
PE
7069 (lisp_time_argument): Don't rely on undefined left-shift and
7070 right-shift behavior when checking for time stamp overflow.
8be6f318 7071
fe31d94c
PE
7072 * editfns.c (time_overflow): New function, refactoring common code.
7073 (Fformat_time_string, Fdecode_time, Fencode_time):
7074 (Fcurrent_time_string): Use it.
7075
8be6f318
PE
7076 Move 'make_time' to be next to its inverse 'lisp_time_argument'.
7077 * dired.c (make_time): Move to ...
7078 * editfns.c (make_time): ... here.
7079 * systime.h: Note the move.
7080
09d9db2c 70812011-03-12 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
c47cbdfd 7082
126bc0dc
YM
7083 * fringe.c (update_window_fringes): Remove unused variables.
7084
c47cbdfd
YM
7085 * unexmacosx.c (copy_data_segment): Also copy __got section.
7086 (Bug#8223)
7087
7ac80be9
EZ
70882011-03-12 Eli Zaretskii <eliz@gnu.org>
7089
c96bbc66 7090 * termcap.c [MSDOS]: Include "msdos.h".
058e5dad
EZ
7091 (find_capability, tgetnum, tgetflag, tgetstr, tputs, tgetent):
7092 Constify `char *' arguments and their references according to
7093 prototypes in tparam.h.
7094
ecb0f94d 7095 * deps.mk (termcap.o): Depend on tparam.h and msdos.h.
058e5dad 7096
7ac80be9
EZ
7097 * msdos.c (XMenuAddPane): 3rd argument is `const char *' now.
7098 Adapt all references accordingly.
7099
7100 * msdos.h (XMenuAddPane): 3rd argument is `const char *' now.
7101
ef1fd07e
TT
71022011-03-11 Tom Tromey <tromey@redhat.com>
7103
7104 * buffer.c (syms_of_buffer): Remove obsolete comment.
7105
7ef4b50c
EZ
71062011-03-11 Eli Zaretskii <eliz@gnu.org>
7107
7108 * termhooks.h (encode_terminal_code): Declare prototype.
7109
7110 * msdos.c (encode_terminal_code): Don't declare prototype.
7111
7112 * term.c (encode_terminal_code): Now external again, used by
7113 w32console.c and msdos.c.
7114
44f230aa
SM
7115 * makefile.w32-in ($(BLD)/term.$(O), ($(BLD)/tparam.$(O)):
7116 Depend on $(SRC)/tparam.h, see 2011-03-11T07:24:21Z!eggert@cs.ucla.edu.
7ef4b50c 7117
4b1ec863 71182011-03-11 Paul Eggert <eggert@cs.ucla.edu>
f78faa98 7119
1714f52b 7120 Fix some minor problems found by GCC 4.5.2's static checks.
83316bf4 7121
4b1ec863
PE
7122 * fringe.c (update_window_fringes): Mark locals as initialized
7123 (Bug#8227).
7124 (destroy_fringe_bitmap, init_fringe_bitmap): Now static.
bf60f616 7125
524c7aa6
PE
7126 * alloc.c (mark_fringe_data): Move decl from here ...
7127 * lisp.h (mark_fringe_data) [HAVE_WINDOW_SYSTEM]: ... to here,
7128 to check its interface.
7129 (init_fringe_once): Do not declare unless HAVE_WINDOW_SYSTEM.
7130
a5c0af81 7131 * fontset.c (free_realized_fontset): Now static.
7519b8cd 7132 (Fset_fontset_font): Rename local to avoid shadowing.
cc6e5db1 7133 (fontset_font): Mark local as initialized.
a9a06e0b 7134 (FONTSET_SPEC, FONTSET_REPERTORY, RFONT_DEF_REPERTORY): Remove; unused.
a5c0af81 7135
b4716021
PE
7136 * xrdb.c: Include "xterm.h", to check x_load_resources's interface.
7137
811e9bac 7138 * xselect.c (x_disown_buffer_selections): Remove; not used.
7b83e2f1 7139 (TRACE3) [!defined TRACE_SELECTION]: Remove; not used.
aa0daa9f
PE
7140 (x_own_selection, Fx_disown_selection_internal): Rename locals
7141 to avoid shadowing.
7142 (x_handle_dnd_message): Remove local to avoid shadowing.
811e9bac 7143
7e3ab302
PE
7144 * lisp.h (GCPRO1_VAR, UNGCPRO_VAR): New macros,
7145 so that the caller can use some name other than gcpro1.
7146 (GCPRO1, UNGCPRO): Reimplement in terms of the new macros.
58d2d479
PE
7147 * xfns.c (Fx_create_frame, x_create_tip_frame, Fx_show_tip):
7148 (Fx_backspace_delete_keys_p):
7149 Use them to avoid shadowing, and rename vars to avoid shadowing.
7150 (x_decode_color, x_set_name, x_window): Now static.
6b437900 7151 (Fx_create_frame): Add braces to silence GCC warning.
c0951e53 7152 (Fx_file_dialog, Fx_select_font): Fix pointer signedness.
06b0c8a0
PE
7153 (x_real_positions, xg_set_icon_from_xpm_data, x_create_tip_frame):
7154 Remove unused locals.
7e3ab302
PE
7155 (Fx_create_frame, x_create_tip_frame, Fx_show_tip):
7156 (Fx_backspace_delete_keys_p): Rename locals to avoid shadowing.
7157 Some of these renamings use the new GCPRO1_VAR and UNGCPRO_VAR
7158 macros.
f78faa98 7159
e2b13473
PE
7160 * xterm.h (x_mouse_leave): New decl.
7161
77f23912
PE
7162 * xterm.c (x_copy_dpy_color, x_focus_on_frame, x_unfocus_frame):
7163 Remove unused functions.
cdf4ba58
PE
7164 (x_shift_glyphs_for_insert, XTflash, XTring_bell):
7165 (x_calc_absolute_position): Now static.
7411c686 7166 (XTread_socket): Don't define label "out" unless it's used.
2b07bcff 7167 Don't declare local "event" unless it's used.
ed7bf3a5
PE
7168 (x_iconify_frame, x_free_frame_resources): Don't declare locals
7169 unless they are used.
38d0b34a
PE
7170 (XEMBED_VERSION, xembed_set_info): Don't define unless needed.
7171 (x_fatal_error_signal): Remove; not used.
a6067996
PE
7172 (x_draw_image_foreground, redo_mouse_highlight, XTmouse_position):
7173 (x_scroll_bar_report_motion, handle_one_xevent, x_draw_bar_cursor):
7174 (x_error_catcher, x_connection_closed, x_error_handler):
7175 (x_error_quitter, xembed_send_message, x_iconify_frame):
7176 (my_log_handler): Rename locals to avoid shadowing.
28f1c698 7177 (x_delete_glyphs, x_ins_del_lines): Mark with NO_RETURN.
2a8fade0 7178 (x_connection_closed): Tell GCC not to suggest NO_RETURN.
77f23912 7179
44f230aa
SM
7180 * xfaces.c (clear_face_cache, Fx_list_fonts, Fface_font):
7181 Rename or move locals to avoid shadowing.
6b463e58 7182 (tty_defined_color, merge_face_heights): Now static.
5967d051 7183 (free_realized_faces_for_fontset): Remove; not used.
1e9966ea
PE
7184 (Fx_list_fonts): Mark variable that gcc -Wuninitialized
7185 does not deduce is never used uninitialized.
73719eba
PE
7186 (STRDUPA, LSTRDUPA, FONT_POINT_SIZE_QUANTUM): Remove; not used.
7187 (LFACEP): Define only if XASSERTS, as it's not needed otherwise.
071048a3 7188
426994c3 7189 * terminal.c (store_terminal_param): Now static.
5489860b 7190
032f1620 7191 * xmenu.c (menu_highlight_callback): Now static.
9d66f88e 7192 (set_frame_menubar): Remove unused local.
d4323972 7193 (xmenu_show): Rename parameter to avoid shadowing.
6d1f7fee
PE
7194 (xmenu_show, xdialog_show, xmenu_show): Make local pointers "const"
7195 since they might point to immutable storage.
281585b0
PE
7196 (next_menubar_widget_id): Declare only if USE_X_TOOLKIT,
7197 since it's unused otherwise.
032f1620 7198
367c19e5 7199 * xdisp.c (produce_glyphless_glyph): Initialize lower_xoff.
53df7c11 7200 Add a FIXME, since the code still doesn't look right. (Bug#8215)
9f36b9fd
PE
7201 (Fcurrent_bidi_paragraph_direction): Simplify slightly; this
7202 avoids a gcc -Wuninitialized diagnostic.
0e086e8f 7203 (display_line, BUILD_COMPOSITE_GLYPH_STRING, draw_glyphs):
44a3a108
PE
7204 (note_mouse_highlight): Mark variables that gcc -Wuninitialized
7205 does not deduce are never used uninitialized.
70739cbe 7206
07b48fa9
PE
7207 * lisp.h (IF_LINT): New macro, copied from ../lib-src/emacsclient.c.
7208
8868a238 7209 * xdisp.c (redisplay_window): Rename local to avoid shadowing.
4554d213
PE
7210 * window.c (window_loop, size_window):
7211 (run_window_configuration_change_hook, enlarge_window): Likewise.
8868a238 7212
7e5cf297 7213 * window.c (display_buffer): Now static.
d6550a9f
PE
7214 (size_window): Mark variables that gcc -Wuninitialized
7215 does not deduce are never used uninitialized.
a586633d
PE
7216 * window.h (check_all_windows): New decl, to forestall
7217 gcc -Wmissing-prototypes diagnostic.
5b555da1 7218 * dispextern.h (bidi_dump_cached_states): Likewise.
7e5cf297 7219
f6095868
PE
7220 * charset.h (CHECK_CHARSET_GET_CHARSET): Rename locals to avoid
7221 shadowing.
7222 * charset.c (map_charset_for_dump, Fchar_charset): Likewise.
726929c4
PE
7223 Include <limits.h>.
7224 (Fsort_charsets): Redo min/max calculation to shorten the code a bit
7225 and to avoid gcc -Wuninitialized warning.
89ef49df
PE
7226 (load_charset_map): Mark variables that gcc -Wuninitialized
7227 does not deduce are never used uninitialized.
53df7c11 7228 (load_charset): Abort instead of using uninitialized var (Bug#8229).
f6095868 7229
f38b440c
PE
7230 * coding.c (coding_set_source, coding_set_destination):
7231 Use "else { /* comment */ }" rather than "else /* comment */;"
7232 for clarity, and to avoid gcc -Wempty-body warning.
2735d060
PE
7233 (Fdefine_coding_system_internal): Don't redeclare 'i' inside
7234 a block, when the outer 'i' will do.
7235 (decode_coding_utf_8, decode_coding_utf_16, detect_coding_emacs_mule):
7236 (emacs_mule_char, decode_coding_emacs_mule, detect_coding_iso_2022):
7237 (decode_coding_iso_2022, decode_coding_sjis, decode_coding_big5):
7238 (decode_coding_raw_text, decode_coding_charset, get_translation_table):
7239 (Fdecode_sjis_char, Fdefine_coding_system_internal):
7240 Rename locals to avoid shadowing.
7241 * character.h (FETCH_STRING_CHAR_ADVANCE): Likewise.
e2f1bab9
PE
7242 * coding.c (emacs_mule_char, encode_invocation_designation):
7243 Now static, since they're not used elsewhere.
413bb2db 7244 (decode_coding_iso_2022): Add "default: abort ();" as a safety check.
c4a63b12 7245 (decode_coding_object, encode_coding_object, detect_coding_system):
ee05f961
PE
7246 (decode_coding_emacs_mule): Mark variables that gcc
7247 -Wuninitialized does not deduce are never used uninitialized.
160b01f6
PE
7248 (detect_coding_iso_2022): Initialize a local variable that might
7249 be used uninitialized. Leave a FIXME because it's not clear that
53df7c11 7250 this initialization is needed. (Bug#8211)
5f58e762
PE
7251 (ISO_CODE_LF, ISO_CODE_CR, CODING_ISO_FLAG_EUC_TW_SHIFT):
7252 (ONE_MORE_BYTE_NO_CHECK, UTF_BOM, UTF_16_INVALID_P):
7253 (SHIFT_OUT_OK, ENCODE_CONTROL_SEQUENCE_INTRODUCER):
7254 (ENCODE_DIRECTION_R2L, ENCODE_DIRECTION_L2R):
7255 Remove unused macros.
f38b440c 7256
232b38b9 7257 * category.c (hash_get_category_set): Remove unused local var.
9f3b5e69 7258 (copy_category_table): Now static, since it's not used elsewhere.
d0891610 7259 * character.c (string_count_byte8): Likewise.
232b38b9 7260
fb90da1b
PE
7261 * ccl.c (CCL_WRITE_STRING, CCL_ENCODE_CHAR, Fccl_execute_on_string):
7262 (Fregister_code_conversion_map): Rename locals to avoid shadowing.
7263
fb93dbc2
PE
7264 * chartab.c (copy_sub_char_table): Now static, since it's not used
7265 elsewhere.
5c156ace
PE
7266 (sub_char_table_ref_and_range, char_table_ref_and_range):
7267 Rename locals to avoid shadowing.
bbcd0949 7268 (ASET_RANGE, GET_SUB_CHAR_TABLE): Remove unused macros.
fb93dbc2 7269
7d3b3862 7270 * bidi.c (bidi_check_type): Now static, since it's not used elsewhere.
630d6892 7271 (BIDI_BOB): Remove unused macro.
7d3b3862 7272
6be7d3da
PE
7273 * cm.c (cmgoto): Mark variables that gcc -Wuninitialized does not
7274 deduce are never used uninitialized.
c2ed9c8b 7275 * term.c (encode_terminal_code): Likewise.
6be7d3da 7276
75f8807f 7277 * term.c (encode_terminal_code): Now static. Remove unused local.
72abad34 7278
50938595
PE
7279 * tparam.h: New file.
7280 * term.c, tparam.h: Include it.
7281 * deps.mk (term.o, tparam.o): Depend on tparam.h.
7282 * term.c (tputs, tgetent, tgetflag, tgetnum, tparam, tgetstr):
7283 Move these decls to tparam.h, and make them agree with what
7284 is actually in tparam.c. The previous trick of using incompatible
7285 decls in different modules does not conform to the C standard.
7286 All callers of tparam changed to use tparam's actual API.
7287 * tparam.c (tparam1, tparam, tgoto):
7288 Use const pointers where appropriate.
7289
fbceeba2
PE
7290 * cm.c (calccost, cmgoto): Use const pointers where appropriate.
7291 * cm.h (struct cm): Likewise.
7292 * dispextern.h (do_line_insertion_deletion_costs): Likewise.
7293 * scroll.c (ins_del_costs, do_line_insertion_deletion_costs): Likewise.
7294 * term.c (tty_ins_del_lines, calculate_costs, struct fkey_table):
7295 (term_get_fkeys_1, append_glyphless_glyph, produce_glyphless_glyph):
7296 (turn_on_face, init_tty): Likewise.
7297 * termchar.h (struct tty_display_info): Likewise.
fbceeba2 7298
7f3f1250
PE
7299 * term.c (term_mouse_position): Rename local to avoid shadowing.
7300
e6ca6543
PE
7301 * alloc.c (mark_ttys): Move decl from here ...
7302 * lisp.h (mark_ttys): ... to here, so that it's checked against defn.
7303
c40f8d15
AS
73042011-03-11 Andreas Schwab <schwab@linux-m68k.org>
7305
7306 * .gdbinit (pwinx, xbuffer): Fix access to buffer name.
7307
cfe0661d
JB
73082011-03-09 Juanma Barranquero <lekktu@gmail.com>
7309
7310 * search.c (compile_pattern_1): Remove argument regp, unused since
7311 revid:rms@gnu.org-19941211082627-3x1g1wyqkjmwloig.
7312 (compile_pattern): Don't pass it.
7313
0afb4571
J
73142011-03-08 Jan Djärv <jan.h.d@swipnet.se>
7315
7316 * xterm.h (DEFAULT_GDK_DISPLAY): New define.
7317 (GDK_WINDOW_XID, gtk_widget_get_preferred_size): New defines
7318 for ! HAVE_GTK3.
7319 (GTK_WIDGET_TO_X_WIN): Use GDK_WINDOW_XID.
7320
7321 * xmenu.c (menu_position_func): Call gtk_widget_get_preferred_size.
7322
7323 * gtkutil.c: Include gtkx.h if HAVE_GTK3. If ! HAVE_GTK3, define
7324 gdk_window_get_screen, gdk_window_get_geometry,
7325 gdk_x11_window_lookup_for_display and GDK_KEY_g.
7326 (xg_set_screen): Use DEFAULT_GDK_DISPLAY.
7327 (xg_get_pixbuf_from_pixmap): New function.
7328 (xg_get_pixbuf_from_pix_and_mask): Change parameters from GdkPixmap
7329 to Pixmap, take frame as parameter, remove GdkColormap parameter.
7330 Call xg_get_pixbuf_from_pixmap instead of
7331 gdk_pixbuf_get_from_drawable.
7332 (xg_get_image_for_pixmap): Do not make GdkPixmaps, call
7333 xg_get_pixbuf_from_pix_and_mask with Pixmap parameters instead.
7334 (xg_check_special_colors): Use GtkStyleContext and its functions
7335 for HAVE_GTK3.
7336 (xg_prepare_tooltip, xg_hide_tooltip): Call gdk_window_get_screen.
7337 (xg_prepare_tooltip, create_dialog, menubar_map_cb)
7338 (xg_update_frame_menubar, xg_tool_bar_detach_callback)
44f230aa
SM
7339 (xg_tool_bar_attach_callback, xg_update_tool_bar_sizes):
7340 Call gtk_widget_get_preferred_size.
0afb4571
J
7341 (xg_frame_resized): gdk_window_get_geometry only takes 5
7342 parameters.
44f230aa
SM
7343 (xg_win_to_widget, xg_event_is_for_menubar):
7344 Call gdk_x11_window_lookup_for_display.
0afb4571
J
7345 (xg_set_widget_bg): New function.
7346 (delete_cb): New function.
895009e1 7347 (xg_create_frame_widgets): Connect delete-event to delete_cb.
0afb4571
J
7348 Call xg_set_widget_bg. Only set backgrund pixmap for ! HAVE_GTK3
7349 (xg_set_background_color): Call xg_set_widget_bg.
7350 (xg_set_frame_icon): Call xg_get_pixbuf_from_pix_and_mask.
7351 (xg_create_scroll_bar): vadj is a GtkAdjustment for HAVE_GTK3.
7352 Only call gtk_range_set_update_policy if ! HAVE_GTK3.
7353 (xg_make_tool_item): Only connect xg_tool_bar_item_expose_callback
7354 if ! HAVE_GTK3.
7355 (update_frame_tool_bar): Call gtk_widget_hide.
7356 (xg_initialize): Use GDK_KEY_g.
7357
7358 * xsmfns.c (gdk_set_sm_client_id): Define to gdk_set_sm_client_id
7359 if ! HAVE_GTK3
7360 (x_session_initialize): Call gdk_x11_set_sm_client_id.
7361
7362 * xterm.c (XFillRectangle): Use cairo routines for HAVE_GTK3.
7363 (x_term_init): Disable Xinput(2) with GDK_CORE_DEVICE_EVENTS.
7364 Load ~/emacs.d/gtkrc only for ! HAVE_GTK3.
7365
1c2cc4ef
JB
73662011-03-08 Juanma Barranquero <lekktu@gmail.com>
7367
7368 * w32xfns.c (select_palette): Check success of RealizePalette against
7369 GDI_ERROR, not zero.
7370
33383987 7371See ChangeLog.11 for earlier changes.
aac0c6e3
MR
7372
7373;; Local Variables:
7374;; coding: utf-8
aac0c6e3
MR
7375;; End:
7376
33383987 7377 Copyright (C) 2011 Free Software Foundation, Inc.
aac0c6e3
MR
7378
7379 This file is part of GNU Emacs.
7380
7381 GNU Emacs is free software: you can redistribute it and/or modify
7382 it under the terms of the GNU General Public License as published by
7383 the Free Software Foundation, either version 3 of the License, or
7384 (at your option) any later version.
7385
7386 GNU Emacs is distributed in the hope that it will be useful,
7387 but WITHOUT ANY WARRANTY; without even the implied warranty of
7388 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
7389 GNU General Public License for more details.
7390
7391 You should have received a copy of the GNU General Public License
7392 along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.