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