* charset.c (Fdefine_charset_internal): Check for integer overflow.
[bpt/emacs.git] / src / ChangeLog
1 2011-07-19 Paul Eggert <eggert@cs.ucla.edu>
2
3 * charset.c (Fdefine_charset_internal): Check for integer overflow.
4 Add a FIXME comment about memory leaks.
5 (syms_of_charset): Don't assume xmalloc returns.
6
7 Don't assume that stated character widths fit in int.
8 * character.c (Fchar_width, c_string_width, lisp_string_width):
9 * character.h (CHAR_WIDTH):
10 * indent.c (MULTIBYTE_BYTES_WIDTH):
11 Use sanitize_char_width to avoid undefined and/or bad behavior
12 with outlandish widths.
13 * character.h (sanitize_tab_width): Renamed from sanitize_width,
14 now that we have two such functions. All uses changed.
15 (sanitize_char_width): New inline function.
16
17 2011-07-18 Paul Eggert <eggert@cs.ucla.edu>
18
19 Don't assume that tab-width fits in int.
20 * character.h (sanitize_width): New inline function.
21 (SANE_TAB_WIDTH): New macro.
22 (ASCII_CHAR_WIDTH): Use it.
23 * indent.c (sane_tab_width): Remove. All uses replaced by
24 SANE_TAB_WIDTH (current_buffer).
25 * xdisp.c (init_iterator): Use SANE_TAB_WIDTH.
26
27 * fileio.c: Integer overflow issues with file modes.
28 (Fset_file_modes, auto_save_1): Don't assume EMACS_INT fits in int.
29
30 * charset.c (read_hex): New arg OVERFLOW. All uses changed.
31 Remove unreachable code.
32 (read_hex, load_charset_map_from_file): Check for integer overflow.
33
34 2011-07-17 Paul Eggert <eggert@cs.ucla.edu>
35
36 * xterm.c: don't go over XClientMessageEvent limit
37 (scroll_bar_windows_size): Now ptrdiff_t, as we prefer signed.
38 (x_send_scroll_bar_event): Likewise. Check that the size does not
39 exceed limits imposed by XClientMessageEvent, as well as the usual
40 ptrdiff_t and size_t limits.
41
42 * keyboard.c: Overflow, signedness and related fixes.
43 (make_lispy_movement): Use same integer type in forward decl
44 that is used in the definition.
45 (read_key_sequence, keyremap_step):
46 Change bufsize argument back to int, undoing my 2011-03-30 change.
47 We prefer signed types, and int is wide enough here.
48 (parse_tool_bar_item): Don't assume tool_bar_max_label_size is less
49 than TYPE_MAXIMUM (EMACS_INT) / 2. Don't let the label size grow
50 larger than STRING_BYTES_BOUND. Use ptrdiff_t for Emacs string
51 length, not size_t. Use ptrdiff_t for index, not int.
52 (keyremap_step, read_key_sequence): Redo bufsize check to avoid
53 possibility of integer overflow.
54
55 Overflow, signedness and related fixes for images.
56
57 * dispextern.h (struct it.stack[0].u.image.image_id)
58 (struct_it.image_id, struct image.id, struct image_cache.size)
59 (struct image_cache.used, struct image_cache.ref_count):
60 * gtkutil.c (update_frame_tool_bar):
61 * image.c (x_reference_bitmap, Fimage_size, Fimage_mask_p)
62 (Fimage_metadata, free_image_cache, clear_image_cache, lookup_image)
63 (cache_image, mark_image_cache, x_kill_gs_process, Flookup_image):
64 * nsmenu.m (update_frame_tool_bar):
65 * xdisp.c (calc_pixel_width_or_height):
66 * xfns.c (image_cache_refcount):
67 Image IDs are now ptrdiff_t, not int, to avoid arbitrary limits
68 on typical 64-bit hosts.
69
70 * image.c (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): New macros.
71 (x_bitmap_pixmap, x_create_x_image_and_pixmap):
72 Omit unnecessary casts to int.
73 (parse_image_spec): Check that integers fall into 'int' range
74 when the callers expect that.
75 (image_ascent): Redo ascent calculation to avoid int overflow.
76 (clear_image_cache): Avoid overflow when sqrt (INT_MAX) < nimages.
77 (lookup_image): Remove unnecessary tests.
78 (xbm_image_p): Locals are now of int, not EMACS_INT,
79 since parse_image_check makes sure they fit into int.
80 (png_load, gif_load, svg_load_image):
81 Prefer int to unsigned where either will do.
82 (tiff_handler): New function, combining the cores of the
83 old tiff_error_handler and tiff_warning_handler. This
84 function is rewritten to use vsnprintf and thereby avoid
85 stack buffer overflows. It uses only the features of vsnprintf
86 that are common to both POSIX and native Microsoft.
87 (tiff_error_handler, tiff_warning_handler): Use it.
88 (tiff_load, gif_load, imagemagick_load_image):
89 Don't assume :index value fits in 'int'.
90 (gif_load): Omit unnecessary cast to double, and avoid double-rounding.
91 (imagemagick_load_image): Check that crop parameters fit into
92 the integer types that MagickCropImage accepts. Don't assume
93 Vimagemagick_render_type has a nonnegative value. Don't assume
94 size_t fits in 'long'.
95 (gs_load): Use printmax_t to print the widest integers possible.
96 Check for integer overflow when computing image height and width.
97
98 2011-07-17 Paul Eggert <eggert@cs.ucla.edu>
99
100 Integer signedness and overflow and related fixes. (Bug#9079)
101
102 * bidi.c: Integer size and overflow fixes.
103 (bidi_cache_size, bidi_cache_idx, bidi_cache_last_idx)
104 (bidi_cache_start, bidi_cache_fetch_state, bidi_cache_search)
105 (bidi_cache_find_level_change, bidi_cache_ensure_space)
106 (bidi_cache_iterator_state, bidi_cache_find, bidi_cache_start_stack)
107 (bidi_find_other_level_edge):
108 Use ptrdiff_t instead of EMACS_INT where either will do.
109 This works better on 32-bit hosts configured --with-wide-int.
110 (bidi_cache_ensure_space): Check for size-calculation overflow.
111 Use % rather than repeated addition, for better worst-case speed.
112 Don't set bidi_cache_size until after xrealloc returns, because it
113 might not return.
114 (bidi_dump_cached_states): Use ptrdiff_t, not int, to avoid overflow.
115 (bidi_cache_ensure_space): Also check that the bidi cache size
116 does not exceed that of the largest Lisp string or buffer. See Eli
117 Zaretskii in <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9079#29>.
118
119 * alloc.c (__malloc_size_t): Remove.
120 All uses replaced by size_t. See Andreas Schwab's note
121 <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9079#8>.
122
123 * image.c: Improve checking for integer overflow.
124 (check_image_size): Assume that f is nonnull, since
125 it is always nonnull in practice. This is one less thing to
126 worry about when checking for integer overflow later.
127 (x_check_image_size): New function, which checks for integer
128 overflow issues inside X.
129 (x_create_x_image_and_pixmap, xbm_read_bitmap_data): Use it.
130 This removes the need for a memory_full check.
131 (xbm_image_p): Rewrite to avoid integer multiplication overflow.
132 (Create_Pixmap_From_Bitmap_Data, xbm_load): Use x_check_image_size.
133 (xbm_read_bitmap_data): Change locals back to 'int', since
134 their values must fit in 'int'.
135 (xpm_load_image, png_load, tiff_load):
136 Invoke x_create_x_image_and_pixmap earlier,
137 to avoid much needless work if the image is too large.
138 (tiff_load): Treat overly large images as if
139 x_create_x_image_and_pixmap failed, not as malloc failures.
140 (gs_load): Use x_check_image_size.
141
142 * gtkutil.c: Omit integer casts.
143 (xg_get_pixbuf_from_pixmap): Remove unnecessary cast.
144 (xg_set_toolkit_scroll_bar_thumb): Rewrite to avoid need for cast.
145
146 * image.c (png_load): Don't assume height * row_bytes fits in 'int'.
147
148 * xfaces.c (Fbitmap_spec_p): Fix integer overflow bug.
149 Without this fix, (bitmap-spec-p '(34359738368 1 "x"))
150 would wrongly return t on a 64-bit host.
151
152 * dispnew.c (init_display): Use *_RANGE_OVERFLOW macros.
153 The plain *_OVERFLOW macros run afoul of GCC bug 49705
154 <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49705>
155 and therefore cause GCC to emit a bogus diagnostic in some cases.
156
157 * image.c: Integer signedness and overflow and related fixes.
158 This is not an exhaustive set of fixes, but it's time to
159 record what I've got.
160 (lookup_pixel_color, check_image_size): Remove redundant decls.
161 (check_image_size): Don't assume that arbitrary EMACS_INT values
162 fit in 'int', or that arbitrary 'double' values fit in 'int'.
163 (x_alloc_image_color, x_create_x_image_and_pixmap, png_load)
164 (tiff_load, imagemagick_load_image):
165 Check for overflow in size calculations.
166 (x_create_x_image_and_pixmap): Remove unnecessary test for
167 xmalloc returning NULL; that can't happen.
168 (xbm_read_bitmap_data): Don't assume sizes fit into 'int'.
169 (xpm_color_bucket): Use better integer hashing function.
170 (xpm_cache_color): Don't possibly over-allocate memory.
171 (struct png_memory_storage, tiff_memory_source, tiff_seek_in_memory)
172 (gif_memory_source):
173 Use ptrdiff_t, not int or size_t, to record sizes.
174 (png_load): Don't assume values greater than 2**31 fit in 'int'.
175 (our_stdio_fill_input_buffer): Prefer ptrdiff_t to size_t when
176 either works, as we prefer signed integers.
177 (tiff_read_from_memory, tiff_write_from_memory):
178 Return tsize_t, not size_t, since that's what the TIFF API wants.
179 (tiff_read_from_memory): Don't fail simply because the read would
180 go past EOF; instead, return a short read.
181 (tiff_load): Omit no-longer-needed casts.
182 (Fimagemagick_types): Don't assume size fits into 'int'.
183
184 Improve hashing quality when configured --with-wide-int.
185 * fns.c (hash_string): New function, taken from sxhash_string.
186 Do not discard information about ASCII character case; this
187 discarding is no longer needed.
188 (sxhash-string): Use it. Change sig to match it. Caller changed.
189 * lisp.h: Declare it.
190 * lread.c (hash_string): Remove, since we now use fns.c's version.
191 The fns.c version returns a wider integer if --with-wide-int is
192 specified, so this should help the quality of the hashing a bit.
193
194 * emacs.c: Integer overflow minor fix.
195 (heap_bss_diff): Now uprintmax_t, not unsigned long. All used changed.
196 Define only if GNU_LINUX.
197 (main, Fdump_emacs): Set and use heap_bss_diff only if GNU_LINUX.
198
199 * dispnew.c: Integer signedness and overflow fixes.
200 Remove unnecessary forward decls, that were a maintenance hassle.
201 (history_tick): Now uprintmax_t, so it's more likely to avoid overflow.
202 All uses changed.
203 (adjust_glyph_matrix, realloc_glyph_pool, adjust_frame_message_buffer)
204 (scrolling_window): Use ptrdiff_t, not int, for byte count.
205 (prepare_desired_row, line_draw_cost):
206 Use int, not unsigned, where either works.
207 (save_current_matrix, restore_current_matrix):
208 Use ptrdiff_t, not size_t, where either works.
209 (init_display): Check for overflow more accurately, and without
210 relying on undefined behavior.
211
212 * editfns.c (pWIDE, pWIDElen, signed_wide, unsigned_wide):
213 Remove, replacing with the new symbols in lisp.h. All uses changed.
214 * fileio.c (make_temp_name):
215 * filelock.c (lock_file_1, lock_file):
216 * xdisp.c (message_dolog):
217 Don't assume PRIdMAX etc. works; this isn't portable to pre-C99 hosts.
218 Use pMd etc. instead.
219 * lisp.h (printmax_t, uprintmax_t, pMd, pMu): New types and macros,
220 replacing the pWIDE etc. symbols removed from editfns.c.
221
222 * keyboard.h (num_input_events): Now uintmax_t.
223 This is (very slightly) less likely to mess up due to wraparound.
224 All uses changed.
225
226 * buffer.c: Integer signedness fixes.
227 (alloc_buffer_text, enlarge_buffer_text):
228 Use ptrdiff_t rather than size_t when either will do, as we prefer
229 signed integers.
230
231 * alloc.c: Integer signedness and overflow fixes.
232 Do not impose an arbitrary 32-bit limit on malloc sizes when debugging.
233 (__malloc_size_t): Default to size_t, not to int.
234 (pure_size, pure_bytes_used_before_overflow, stack_copy_size)
235 (Fgarbage_collect, mark_object_loop_halt, mark_object):
236 Prefer ptrdiff_t to size_t when either would do, as we prefer
237 signed integers.
238 (XMALLOC_OVERRUN_CHECK_OVERHEAD): New macro.
239 (xmalloc_overrun_check_header, xmalloc_overrun_check_trailer):
240 Now const. Initialize with values that are in range even if char
241 is signed.
242 (XMALLOC_PUT_SIZE, XMALLOC_GET_SIZE): Remove, replacing with ...
243 (xmalloc_put_size, xmalloc_get_size): New functions. All uses changed.
244 These functions do the right thing with sizes > 2**32.
245 (check_depth): Now ptrdiff_t, not int.
246 (overrun_check_malloc, overrun_check_realloc, overrun_check_free):
247 Adjust to new way of storing sizes. Check for size overflow bugs
248 in rest of code.
249 (STRING_BYTES_MAX): Adjust to new overheads. The old code was
250 slightly wrong anyway, as it missed one instance of
251 XMALLOC_OVERRUN_CHECK_OVERHEAD.
252 (refill_memory_reserve): Omit needless cast to size_t.
253 (mark_object_loop_halt): Mark as externally visible.
254
255 * xselect.c: Integer signedness and overflow fixes.
256 (Fx_register_dnd_atom, x_handle_dnd_message):
257 Use ptrdiff_t, not size_t, since we prefer signed.
258 (Fx_register_dnd_atom): Check for ptrdiff_t (and size_t) overflow.
259 * xterm.h (struct x_display_info): Use ptrdiff_t, not size_t, for
260 x_dnd_atoms_size and x_dnd_atoms_length.
261
262 * doprnt.c: Prefer signed to unsigned when either works.
263 * eval.c (verror):
264 * doprnt.c (doprnt):
265 * lisp.h (doprnt):
266 * xdisp.c (vmessage):
267 Use ptrdiff_t, not size_t, when using or implementing doprnt,
268 since the sizes cannot exceed ptrdiff_t bounds anyway, and we
269 prefer signed arithmetic to avoid comparison confusion.
270 * doprnt.c (doprnt): Avoid a "+ 1" that can't overflow,
271 but is a bit tricky.
272
273 Assume freestanding C89 headers, string.h, stdlib.h.
274 * data.c, doprnt.c, floatfns.c, print.c:
275 Include float.h unconditionally.
276 * gmalloc.c: Assume C89-at-least behavior for preprocessor,
277 limits.h, stddef.h, string.h. Use memset instead of 'flood'.
278 * regex.c: Likewise for stddef.h, string.h.
279 (ISASCII): Remove; can assume it returns 1 now. All uses removed.
280 * s/aix4-2.h (HAVE_STRING_H): Remove obsolete undef.
281 * s/ms-w32.h (HAVE_LIMITS_H, HAVE_STRING_H, HAVE_STDLIB_H)
282 (STDC_HEADERS): Remove obsolete defines.
283 * sysdep.c: Include limits.h unconditionally.
284
285 Assume support for memcmp, memcpy, memmove, memset.
286 * lisp.h, sysdep.c (memcmp, memcpy, memmove, memset):
287 * regex.c (memcmp, memcpy):
288 Remove; we assume C89 now.
289
290 * gmalloc.c (memcpy, memset, memmove): Remove; we assume C89 now.
291 (__malloc_safe_bcopy): Remove; no longer needed.
292
293 * lisp.h (struct vectorlike_header, struct Lisp_Subr): Signed sizes.
294 Use EMACS_INT, not EMACS_UINT, for sizes. The code works equally
295 well either way, and we prefer signed to unsigned.
296
297 2011-07-17 Paul Eggert <eggert@cs.ucla.edu>
298
299 * fileio.c (Fcopy_file): Pacify gcc re fchown. (Bug#9002)
300 This works around a problem with the previous change to Fcopy_file.
301 Recent glibc declares fchown with __attribute__((warn_unused_result)),
302 and without this change, GCC might complain about discarding
303 fchown's return value.
304
305 2011-07-16 Juanma Barranquero <lekktu@gmail.com>
306
307 * makefile.w32-in (GLOBAL_SOURCES): Add gnutls.c (followup to bug#9059).
308
309 2011-07-16 Paul Eggert <eggert@cs.ucla.edu>
310
311 * fileio.c (Fcopy_file): Don't diagnose fchown failures. (Bug#9002)
312
313 2011-07-16 Lars Magne Ingebrigtsen <larsi@gnus.org>
314
315 * gnutls.c (syms_of_gnutls): Define `gnutls-log-level' here, since
316 it's used from the C level.
317
318 * process.c: Use the same condition for POLL_FOR_INPUT in both
319 keyboard.c and process.c (bug#1858).
320
321 2011-07-09 Lawrence Mitchell <wence@gmx.li>
322
323 * gnutls.c (Qgnutls_bootprop_min_prime_bits): New variable.
324 (Fgnutls_boot): Use it.
325
326 2011-07-15 Andreas Schwab <schwab@linux-m68k.org>
327
328 * doc.c (Fsubstitute_command_keys): Revert last change.
329
330 2011-07-15 Lars Magne Ingebrigtsen <larsi@gnus.org>
331
332 * doc.c (Fsubstitute_command_keys): Clarify that \= really only
333 quotes the next character, and doesn't affect other longer
334 sequences (bug#8935).
335
336 * lread.c (syms_of_lread): Clarify that is isn't only
337 `eval-buffer' and `eval-defun' that's affected by
338 `lexical-binding' (bug#8460).
339
340 2011-07-15 Eli Zaretskii <eliz@gnu.org>
341
342 * xdisp.c (move_it_in_display_line_to): Fix vertical motion with
343 bidi redisplay when a line includes both an image and is
344 truncated.
345
346 2011-07-14 Paul Eggert <eggert@cs.ucla.edu>
347
348 Fix minor problems found by static checking.
349 * bidi.c (bidi_cache_size): Now EMACS_INT, not size_t.
350 (elsz): Now a signed constant, not a size_t var. We prefer signed
351 types to unsigned, to avoid integer comparison confusion. Without
352 this change, GCC 4.6.1 with -Wunsafe-loop-optimizations complains
353 "cannot optimize loop, the loop counter may overflow", a symptom
354 of the confusion.
355 * indent.c (Fvertical_motion): Mark locals as initialized.
356 * xdisp.c (reseat_to_string): Fix pointer signedness issue.
357
358 2011-07-14 Lars Magne Ingebrigtsen <larsi@gnus.org>
359
360 * search.c (Fre_search_backward): Mention `case-fold-search' in
361 all the re_search_* functions (bug#8138).
362
363 * keyboard.c (Fopen_dribble_file): Document when the file is
364 closed (bug#8056).
365
366 2011-07-14 Eli Zaretskii <eliz@gnu.org>
367
368 * bidi.c (bidi_dump_cached_states): Fix format of displaying
369 bidi_cache_idx.
370
371 Support bidi reordering of display and overlay strings.
372 * xdisp.c (compute_display_string_pos)
373 (compute_display_string_end): Accept additional argument STRING.
374 (init_iterator, reseat_1): Initialize bidi_it->string.s to NULL.
375 (reseat_to_string): Initialize bidi_it->string.s and
376 bidi_it->string.schars.
377 (Fcurrent_bidi_paragraph_direction): Initialize itb.string.s to
378 NULL (avoids a crash in bidi_paragraph_init). Initialize
379 itb.string.lstring.
380 (init_iterator): Call bidi_init_it only of a valid
381 buffer position was specified. Initialize paragraph_embedding to
382 L2R.
383 (reseat_to_string): Initialize the bidi iterator.
384 (display_string): If we need to ignore text properties of
385 LISP_STRING, set IT->stop_charpos to IT->end_charpos. (The
386 original value of -1 will not work with bidi.)
387 (compute_display_string_pos): First arg is now struct
388 `text_pos *'; all callers changed. Support display properties on
389 Lisp strings.
390 (compute_display_string_end): Support display properties on Lisp
391 strings.
392 (init_iterator, reseat_1, reseat_to_string): Initialize the
393 string.bufpos member to 0 (zero, for compatibility with IT_CHARPOS
394 when iterating on a string not from display properties).
395 (compute_display_string_pos, compute_display_string_end): Fix
396 calculation of the object to scan. Fixes an error when using
397 arrow keys.
398 (next_element_from_buffer): Don't abort when IT_CHARPOS is before
399 base_level_stop; instead, set base_level_stop to BEGV. Fixes
400 crashes in vertical-motion.
401 (next_element_from_buffer): Improve commentary for when
402 the iterator is before prev_stop.
403 (init_iterator): Initialize bidi_p from the default value of
404 bidi-display-reordering, not from buffer-local value. Use the
405 buffer-local value only if initializing for buffer iteration.
406 (handle_invisible_prop): Support invisible properties on strings
407 that are being bidi-reordered.
408 (set_iterator_to_next): Support bidi reordering of C strings and
409 Lisp strings.
410 (next_element_from_string): Support bidi reordering of Lisp
411 strings.
412 (handle_stop_backwards): Support Lisp strings as well.
413 (display_string): Support display of R2L glyph rows. Use
414 IT_STRING_CHARPOS when displaying from a Lisp string.
415 (init_iterator): Don't initialize it->bidi_p for strings
416 here.
417 (reseat_to_string): Initialize it->bidi_p for strings here.
418 (next_element_from_string, next_element_from_c_string)
419 (next_element_from_buffer): Add xassert's for correspondence
420 between IT's object being iterated and it->bidi_it.string
421 structure.
422 (face_before_or_after_it_pos): Support bidi iteration.
423 (next_element_from_c_string): Handle the case of the first string
424 character that is not the first one in the visual order.
425 (get_visually_first_element): New function, refactored from common
426 parts of next_element_from_buffer, next_element_from_string, and
427 next_element_from_c_string.
428 (tool_bar_lines_needed, redisplay_tool_bar)
429 (display_menu_bar): Force left-to-right direction. Add a FIXME
430 comment for making that be controlled by a user option.
431 (push_it, pop_it): Save and restore the state of the
432 bidi iterator. Save and restore the bidi_p flag.
433 (pop_it): Iterate out of display property for string iteration as
434 well.
435 (iterate_out_of_display_property): Support iteration over strings.
436 (handle_single_display_spec): Set up it->bidi_it for iteration
437 over a display string, and call bidi_init_it.
438 (handle_single_display_spec, next_overlay_string)
439 (get_overlay_strings_1, push_display_prop): Set up the bidi
440 iterator for displaying display or overlay strings.
441 (forward_to_next_line_start): Don't use the shortcut if
442 bidi-iterating.
443 (back_to_previous_visible_line_start): If handle_display_prop
444 pushed the iterator stack, restore the internal state of the bidi
445 iterator by calling bidi_pop_it same number of times.
446 (reseat_at_next_visible_line_start): If ON_NEWLINE_P is non-zero,
447 and we are bidi-iterating, don't decrement the iterator position;
448 instead, set the first_elt flag in the bidi iterator, to produce
449 the same effect.
450 (reseat_1): Remove redundant setting of string_from_display_prop_p.
451 (push_display_prop): xassert that we are iterating a buffer.
452 (push_it, pop_it): Save and restore paragraph_embedding member.
453 (handle_single_display_spec, next_overlay_string)
454 (get_overlay_strings_1, reseat_1, reseat_to_string)
455 (push_display_prop): Set up the `unibyte' member of bidi_it.string
456 correctly. Don't assume unibyte strings are not bidi-reordered.
457 (compute_display_string_pos)
458 (compute_display_string_end): Fix handling the case of C string.
459 (push_it, pop_it): Save and restore from_disp_prop_p.
460 (handle_single_display_spec, push_display_prop): Set the
461 from_disp_prop_p flag.
462 (get_overlay_strings_1): Reset the from_disp_prop_p flag.
463 (pop_it): Call iterate_out_of_display_property only if we are
464 popping after iteration over a string that came from a display
465 property. Fix a typo in popping stretch info. Add an assertion
466 for verifying that the iterator position is in sync with the bidi
467 iterator.
468 (handle_single_display_spec, get_overlay_strings_1)
469 (push_display_prop): Fix initialization of paragraph direction for
470 string when that of the parent object is not yet determined.
471 (reseat_1): Call bidi_init_it to resync the bidi
472 iterator with IT's position. (Bug#7616)
473 (find_row_edges): If ROW->start.pos gives position
474 smaller than min_pos, use it as ROW->minpos. (Bug#7616)
475 (handle_stop, back_to_previous_visible_line_start, reseat_1):
476 Reset the from_disp_prop_p flag.
477 (SAVE_IT, RESTORE_IT): New macros.
478 (pos_visible_p, face_before_or_after_it_pos)
479 (back_to_previous_visible_line_start)
480 (move_it_in_display_line_to, move_it_in_display_line)
481 (move_it_to, move_it_vertically_backward, move_it_by_lines)
482 (try_scrolling, redisplay_window, display_line): Use them when
483 saving a temporary copy of the iterator and restoring it back.
484 (back_to_previous_visible_line_start, reseat_1)
485 (init_iterator): Empty the bidi cache "stack".
486 (move_it_in_display_line_to): If iterator ended up at
487 EOL, but we never saw any buffer positions smaller than
488 to_charpos, return MOVE_POS_MATCH_OR_ZV. Fixes vertical cursor
489 motion in bidi-reordered lines.
490 (move_it_in_display_line_to): Record prev_method and prev_pos
491 immediately before the call to set_iterator_to_next. Fixes cursor
492 motion in bidi-reordered lines with stretch glyphs and strings
493 displayed in margins. (Bug#8133) (Bug#8867)
494 Return MOVE_POS_MATCH_OR_ZV only if iterator position is past
495 TO_CHARPOS.
496 (pos_visible_p): Support positions in bidi-reordered lines. Save
497 and restore bidi cache.
498
499 * bidi.c (bidi_level_of_next_char): clen should be EMACS_NT, not int.
500 (bidi_paragraph_info): Delete unused struct.
501 (bidi_cache_idx, bidi_cache_last_idx): Declare EMACS_INT.
502 (bidi_cache_start): New variable.
503 (bidi_cache_reset): Reset bidi_cache_idx to bidi_cache_start, not
504 to zero.
505 (bidi_cache_fetch_state, bidi_cache_search)
506 (bidi_cache_find_level_change, bidi_cache_iterator_state)
507 (bidi_cache_find, bidi_peek_at_next_level)
508 (bidi_level_of_next_char, bidi_find_other_level_edge)
509 (bidi_move_to_visually_next): Compare cache index with
510 bidi_cache_start rather than with zero.
511 (bidi_fetch_char): Accept new argument STRING; all callers
512 changed. Support iteration over a string. Support strings with
513 display properties. Support unibyte strings. Fix the type of
514 `len' according to what STRING_CHAR_AND_LENGTH expects.
515 (bidi_paragraph_init, bidi_resolve_explicit_1)
516 (bidi_resolve_explicit, bidi_resolve_weak)
517 (bidi_level_of_next_char, bidi_move_to_visually_next): Support
518 iteration over a string.
519 (bidi_set_sor_type, bidi_resolve_explicit_1)
520 (bidi_resolve_explicit, bidi_type_of_next_char): ignore_bn_limit
521 can now be zero (for strings); special values 0 and -1 were
522 changed to -1 and -2, respectively.
523 (bidi_char_at_pos): New function.
524 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak):
525 Call it instead of FETCH_MULTIBYTE_CHAR.
526 (bidi_move_to_visually_next): Abort if charpos or bytepos were not
527 initialized to valid values.
528 (bidi_init_it): Don't initialize charpos and bytepos with invalid
529 values.
530 (bidi_level_of_next_char): Allow the sentinel "position" to pass
531 the test for valid cached positions. Fix the logic for looking up
532 the sentinel state in the cache. GCPRO the Lisp string we are
533 iterating.
534 (bidi_push_it, bidi_pop_it): New functions.
535 (bidi_initialize): Initialize the bidi cache start stack pointer.
536 (bidi_cache_ensure_space): New function, refactored from part of
537 bidi_cache_iterator_state. Don't assume the required size is just
538 one BIDI_CACHE_CHUNK away.
539 (bidi_cache_start_stack, bidi_push_it): Use IT_STACK_SIZE.
540 (bidi_count_bytes, bidi_char_at_pos): New functions.
541 (bidi_cache_search): Don't assume bidi_cache_last_idx is
542 always valid if bidi_cache_idx is valid.
543 (bidi_cache_find_level_change): xassert that bidi_cache_last_idx
544 is valid if it's going to be used.
545 (bidi_shelve_cache, bidi_unshelve_cache): New functions.
546 (bidi_cache_fetch_state, bidi_cache_search)
547 (bidi_cache_find_level_change, bidi_cache_ensure_space)
548 (bidi_cache_iterator_state, bidi_cache_find)
549 (bidi_find_other_level_edge, bidi_cache_start_stack): All
550 variables related to cache indices are now EMACS_INT.
551
552 * dispextern.h (struct bidi_string_data): New structure.
553 (struct bidi_it): New member `string'. Make flag members be 1-bit
554 fields, and put them last in the struct.
555 (compute_display_string_pos, compute_display_string_end): Update
556 prototypes.
557 (bidi_push_it, bidi_pop_it): Add prototypes.
558 (struct iterator_stack_entry): New members bidi_p,
559 paragraph_embedding, and from_disp_prop_p.
560 (struct it): Member bidi_p is now a bit field 1 bit wide.
561 (bidi_shelve_cache, bidi_unshelve_cache): Declare
562 prototypes.
563
564 * .gdbinit (xvectype, xvector, xcompiled, xchartable, xboolvector)
565 (xpr, xfont, xbacktrace): Use "header.size" when accessing vectors
566 and vector-like objects.
567
568 * dispnew.c (buffer_posn_from_coords): Save and restore the bidi
569 cache around display iteration.
570
571 * window.c (Fwindow_end, window_scroll_pixel_based)
572 (displayed_window_lines, Frecenter): Save and restore the bidi
573 cache around display iteration.
574
575 2011-07-14 Lars Magne Ingebrigtsen <larsi@gnus.org>
576
577 * editfns.c (Fdelete_region): Clarify the use of the named
578 parameters (bug#6788).
579
580 2011-07-14 Martin Rudalics <rudalics@gmx.at>
581
582 * indent.c (Fvertical_motion): Set and restore w->pointm when
583 saving and restoring the window's buffer (Bug#9006).
584
585 2011-07-13 Lars Magne Ingebrigtsen <larsi@gnus.org>
586
587 * editfns.c (Fstring_to_char): Clarify just what is returned
588 (bug#6576). Text by Eli Zaretskii.
589
590 2011-07-13 Juanma Barranquero <lekktu@gmail.com>
591
592 * gnutls.c (init_gnutls_functions): Honor gnutls_log_level (bug#9059).
593
594 2011-07-13 Eli Zaretskii <eliz@gnu.org>
595
596 * buffer.c (mmap_find): Fix a typo.
597
598 2011-07-13 Johan Bockgård <bojohan@gnu.org>
599
600 Fix execution of x selection hooks.
601 * xselect.c (Qx_lost_selection_functions)
602 (Qx_sent_selection_functions): New vars.
603 (syms_of_xselect): DEFSYM them.
604 (x_handle_selection_request): Pass Qx_sent_selection_functions
605 rather than Vx_sent_selection_functions to Frun_hook_with_args.
606 (x_handle_selection_clear,x_clear_frame_selections):
607 Pass Qx_lost_selection_functions rather than
608 Vx_lost_selection_functions to Frun_hook_with_args.
609
610 2011-07-13 Paul Eggert <eggert@cs.ucla.edu>
611
612 * buffer.c (Fget_buffer_create): Initialize inhibit_shrinking.
613 The old code sometimes used this field without initializing it.
614
615 * alloc.c (gc_sweep): Don't read past end of array.
616 In theory, the old code could also have corrupted Emacs internals,
617 though it'd be very unlikely.
618
619 2011-07-12 Andreas Schwab <schwab@linux-m68k.org>
620
621 * character.c (Fcharacterp): Don't advertise optional ignored
622 argument. (Bug#4026)
623
624 2011-07-12 Lars Magne Ingebrigtsen <larsi@gnus.org>
625
626 * keymap.c (syms_of_keymap): Clarify that "modifier" is "modifier
627 key" (bug#4257).
628
629 * window.c (Fset_window_start): Doc fix (bug#4199).
630 (Fset_window_hscroll): Ditto.
631
632 2011-07-12 Paul Eggert <eggert@cs.ucla.edu>
633
634 Fix minor new problems caught by GCC 4.6.1.
635 * term.c (init_tty): Remove unused local.
636 * xsettings.c (store_monospaced_changed): Define this function only
637 if (defined HAVE_GSETTINGS || defined HAVE_GCONF), as it's
638 not used otherwise.
639
640 2011-07-12 Chong Yidong <cyd@stupidchicken.com>
641
642 * xdisp.c (Vresize_mini_windows): Minor doc fix (Bug#3300).
643
644 2011-07-11 Lars Magne Ingebrigtsen <larsi@gnus.org>
645
646 * xdisp.c (syms_of_xdisp): Make it explicit that the mini-windows
647 are the mini-buffer and the echo area (bug#3320).
648
649 * term.c (init_tty): Remove support for supdup, c10 and perq
650 terminals, which are no longer supported (bug#1482).
651
652 2011-07-10 Johan Bockgård <bojohan@gnu.org>
653
654 * xdisp.c (Ftool_bar_lines_needed): Fix WINDOWP check.
655
656 2011-07-10 Jan Djärv <jan.h.d@swipnet.se>
657
658 * xmenu.c (menu_highlight_callback): Only pass frame to show_help_event
659 for non-popups (Bug#3642).
660
661 2011-07-10 Andreas Schwab <schwab@linux-m68k.org>
662
663 * alloc.c (reset_malloc_hooks): Protoize.
664 * buffer.c (mmap_init, mmap_find, mmap_free_1, mmap_enlarge)
665 (mmap_set_vars, mmap_alloc, mmap_free, mmap_realloc): Likewise.
666 * cm.c (losecursor): Likewise.
667 * data.c (fmod): Likewise.
668 * dispnew.c (swap_glyphs_in_rows): Likewise.
669 * emacs.c (memory_warning_signal): Likewise.
670 * floatfns.c (float_error): Likewise.
671 * font.c (check_gstring, check_otf_features, otf_tag_symbol)
672 (otf_open, font_otf_capability, generate_otf_features)
673 (font_otf_DeviceTable, font_otf_ValueRecord, font_otf_Anchor):
674 Likewise.
675 * image.c (pbm_read_file): Likewise.
676 * indent.c (string_display_width): Likewise.
677 * intervals.c (check_for_interval, search_for_interval)
678 (inc_interval_count, count_intervals, root_interval)
679 (adjust_intervals_for_insertion, make_new_interval): Likewise.
680 * lread.c (defalias): Likewise.
681 * ralloc.c (r_alloc_check): Likewise.
682 * regex.c (set_image_of_range_1, set_image_of_range)
683 (regex_grow_registers): Likewise.
684 * sysdep.c (strerror): Likewise.
685 * termcap.c (valid_filename_p, tprint, main): Likewise.
686 * tparam.c (main): Likewise.
687 * unexhp9k800.c (run_time_remap, save_data_space)
688 (update_file_ptrs, read_header, write_header, calculate_checksum)
689 (copy_file, copy_rest, display_header): Likewise.
690 * widget.c (mark_shell_size_user_specified, create_frame_gcs):
691 Likewise.
692 * xdisp.c (check_it): Likewise.
693 * xfaces.c (register_color, unregister_color, unregister_colors):
694 Likewise.
695 * xfns.c (print_fontset_result): Likewise.
696 * xrdb.c (member, fatal, main): Likewise.
697
698 2011-07-10 Paul Eggert <eggert@cs.ucla.edu>
699
700 Fix minor problems found by static checking (Bug#9031).
701 * chartab.c (char_table_set_range, map_sub_char_table):
702 Remove unused locals.
703 (uniprop_table): Now static.
704 * composite.c (_work_char): Remove unused static var.
705
706 2011-07-09 Juanma Barranquero <lekktu@gmail.com>
707
708 * chartab.c (uniprop_table_uncompress): Remove unused local variable.
709
710 2011-07-09 Jan Djärv <jan.h.d@swipnet.se>
711
712 * gtkutil.c (qttip_cb): Remove code without function.
713
714 2011-07-09 Eli Zaretskii <eliz@gnu.org>
715
716 * w32.c (pthread_sigmask): New stub.
717
718 2011-07-08 Paul Eggert <eggert@cs.ucla.edu>
719
720 Use pthread_sigmask, not sigprocmask (Bug#9010).
721 sigprocmask is portable only for single-threaded applications, and
722 Emacs can be multi-threaded when it uses GTK.
723 * Makefile.in (LIB_PTHREAD_SIGMASK): New macro.
724 (LIBES): Use it.
725 * callproc.c (Fcall_process):
726 * process.c (create_process):
727 * sysdep.c (sys_sigblock, sys_sigunblock, sys_sigsetmask):
728 Use pthread_sigmask, not sigprocmask.
729
730 2011-07-08 Jan Djärv <jan.h.d@swipnet.se>
731
732 * gtkutil.c (qttip_cb): Set line wrap to FALSE for tooltip widget.
733 (xg_prepare_tooltip): Revert text in x->ttip_lbl, margins was
734 wrong (Bug#8591).
735
736 2011-07-08 Jan Djärv <jan.h.d@swipnet.se>
737
738 * gtkutil.c (xg_prepare_tooltip): Fix indentation and comment.
739 Put text in x->ttip_lbl instead of gtk_tooltip_set_text (Bug#8591).
740 (xg_hide_tooltip): Fix comment.
741
742 * nsterm.m (initFrameFromEmacs): Don't use ns_return_types
743 in registerServicesMenuSendTypes.
744 (validRequestorForSendType): Don't check ns_return_types.
745
746 * nsfns.m (Fx_open_connection): Put NSStringPboardType into
747 ns_return_type.
748
749 2011-07-08 Jason Rumney <jasonr@gnu.org>
750
751 * w32fns.c (w32_wnd_proc) [WM_TIMER, WM_SET_CURSOR]: Avoid using
752 frame struct members of non-existent frames (Bug#6284).
753
754 2011-07-08 Jan Djärv <jan.h.d@swipnet.se>
755
756 * nsterm.m (keyDown): Call to wantsToDelayTextChangeNotifications and
757 variable firstTime not needed on OSX >= 10.6.
758 (setPosition): setFloatValue:knobProportion: is deprecated on OSX
759 >= 10.5. Use setKnobProportion, setDoubleValue.
760
761 * nsterm.h (MAC_OS_X_VERSION_10_3, MAC_OS_X_VERSION_10_4)
762 (MAC_OS_X_VERSION_10_5): Define if not defined.
763 (EmacsView, EmacsTooltip): Implements NSWindowDelegate on OSX >= 10.6.
764 (EmacsMenu): Implements NSMenuDelegate on OSX >= 10.6.
765 (EmacsToolbar): Implements NSToolbarDelegate on OSX >= 10.6.
766
767 * nsselect.m (ns_string_from_pasteboard): Don't use deprecated methods
768 cString and lossyCString on OSX >= 10.4
769
770 * nsmenu.m (fillWithWidgetValue): Don't use depercated method
771 sizeToFit on OSX >= 10.2.
772
773 * nsimage.m (allocInitFromFile): Don't use deprecated method
774 bestRepresentationForDevice on OSX >= 10.6.
775
776 * nsfns.m (check_ns_display_info): Cast to long and use %ld in error
777 to avoid warning.
778
779 * emacs.c: Declare unexec_init_emacs_zone.
780
781 * nsgui.h: Fix compiler warning about gnulib redefining verify.
782
783 * nsselect.m (ns_get_local_selection): Change to extern (Bug#8842).
784
785 * nsmenu.m (ns_update_menubar): Remove useless setDelegate call
786 on svcsMenu (Bug#8842).
787
788 * nsfns.m (Fx_open_connection): Remove NSStringPboardType from
789 ns_return_types.
790 (Fns_list_services): Just return Qnil on 10.6, code not working there.
791
792 * nsterm.m (QUTF8_STRING): Declare.
793 (initFrameFromEmacs): Call registerServicesMenuSendTypes.
794 (validRequestorForSendType): Return type is (id).
795 Change indexOfObjectIdenticalTo to indexOfObject.
796 Check if we have local selection before returning self (Bug#8842).
797 (writeSelectionToPasteboard): Put local selection into paste board
798 if we have a local selection (Bug#8842).
799 (syms_of_nsterm): DEFSYM QUTF8_STRING.
800
801 * nsterm.h (MAC_OS_X_VERSION_10_6): Define here instead of nsterm.m.
802 (ns_get_local_selection): Declare.
803
804 2011-07-07 Lars Magne Ingebrigtsen <larsi@gnus.org>
805
806 * keymap.c (describe_map_tree): Don't insert a double newline at
807 the end of the buffer (bug#1169) and return whether we inserted
808 something.
809
810 * callint.c (Fcall_interactively): Change "reading args" to
811 "providing args" to try to clarify what it does (bug#1010).
812
813 2011-07-07 Kenichi Handa <handa@m17n.org>
814
815 * composite.c (composition_compute_stop_pos): Ignore a static
816 composition starting before CHARPOS (Bug#8915).
817
818 * xdisp.c (handle_composition_prop): Likewise.
819
820 2011-07-07 Eli Zaretskii <eliz@gnu.org>
821
822 * term.c (produce_glyphs) <xassert>: Allow IT_GLYPHLESS in it->what.
823 (Bug#9015)
824
825 2011-07-07 Kenichi Handa <handa@m17n.org>
826
827 * character.h (unicode_category_t): New enum type.
828
829 * chartab.c (uniprop_decoder_t, uniprop_encoder_t): New types.
830 (Qchar_code_property_table): New variable.
831 (UNIPROP_TABLE_P, UNIPROP_GET_DECODER)
832 (UNIPROP_COMPRESSED_FORM_P): New macros.
833 (char_table_ascii): Uncompress the compressed values.
834 (sub_char_table_ref): New arg is_uniprop. Callers changed.
835 Uncompress the compressed values.
836 (sub_char_table_ref_and_range): Likewise.
837 (char_table_ref_and_range): Uncompress the compressed values.
838 (sub_char_table_set): New arg is_uniprop. Callers changed.
839 Uncompress the compressed values.
840 (sub_char_table_set_range): Args changed. Callers changed.
841 (char_table_set_range): Adjuted for the above change.
842 (map_sub_char_table): Delete args default_val and parent. Add arg
843 top. Give decoded values to a Lisp function.
844 (map_char_table): Adjusted for the above change. Give decoded
845 values to a Lisp function. Gcpro more variables.
846 (uniprop_table_uncompress)
847 (uniprop_decode_value_run_length): New functions.
848 (uniprop_decoder, uniprop_decoder_count): New variables.
849 (uniprop_get_decoder, uniprop_encode_value_character)
850 (uniprop_encode_value_run_length, uniprop_encode_value_numeric):
851 New functions.
852 (uniprop_encoder, uniprop_encoder_count): New variables.
853 (uniprop_get_encoder, uniprop_table)
854 (Funicode_property_table_internal, Fget_unicode_property_internal)
855 (Fput_unicode_property_internal): New functions.
856 (syms_of_chartab): DEFSYM Qchar_code_property_table, defsubr
857 Sunicode_property_table_internal, Sget_unicode_property_internal,
858 and Sput_unicode_property_internal. Defvar_lisp
859 char-code-property-alist.
860
861 * composite.c (CHAR_COMPOSABLE_P): Adjusted for the change of
862 Vunicode_category_table.
863
864 * font.c (font_range): Adjusted for the change of
865 Vunicode_category_table.
866
867 2011-07-07 Dan Nicolaescu <dann@ics.uci.edu>
868
869 * m/iris4d.h: Remove file, move contents ...
870 * s/irix6-5.h: ... here.
871
872 2011-07-06 Paul Eggert <eggert@cs.ucla.edu>
873
874 Remove unportable assumption about struct layout (Bug#8884).
875 * alloc.c (mark_buffer):
876 * buffer.c (reset_buffer_local_variables, Fbuffer_local_variables)
877 (clone_per_buffer_values): Don't assume that
878 sizeof (struct buffer) is a multiple of sizeof (Lisp_Object).
879 This isn't true in general, and it's particularly not true
880 if Emacs is configured with --with-wide-int.
881 * buffer.h (FIRST_FIELD_PER_BUFFER, LAST_FIELD_PER_BUFFER):
882 New macros, used in the buffer.c change.
883
884 2011-07-05 Jan Djärv <jan.h.d@swipnet.se>
885
886 * xsettings.c: Use both GConf and GSettings if both are available.
887 (store_config_changed_event): Add comment.
888 (dpyinfo_valid, store_font_name_changed, map_tool_bar_style)
889 (store_tool_bar_style_changed): New functions.
890 (store_monospaced_changed): Add comment. Call dpyinfo_valid.
891 (struct xsettings): Move font inside HAVE_XFT.
892 (GSETTINGS_TOOL_BAR_STYLE, GSETTINGS_FONT_NAME): New defines.
893 (GSETTINGS_MONO_FONT): Renamed from SYSTEM_MONO_FONT.
894 Move inside HAVE_XFT.
895 (something_changed_gsettingsCB): Renamed from something_changedCB.
896 Check for changes in GSETTINGS_TOOL_BAR_STYLE and GSETTINGS_FONT_NAME
897 also.
898 (GCONF_TOOL_BAR_STYLE, GCONF_FONT_NAME): New defines.
899 (GCONF_MONO_FONT): Renamed from SYSTEM_MONO_FONT. Move inside HAVE_XFT.
900 (something_changed_gconfCB): Renamed from something_changedCB.
901 Check for changes in GCONF_TOOL_BAR_STYLE and GCONF_FONT_NAME also.
902 (parse_settings): Move check for font inside HAVE_XFT.
903 (read_settings, apply_xft_settings): Add comment.
904 (read_and_apply_settings): Add comment. Call map_tool_bar_style and
905 store_tool_bar_style_changed. Move check for font inside HAVE_XFT and
906 call store_font_name_changed.
907 (xft_settings_event): Add comment.
908 (init_gsettings): Add comment. Get values for GSETTINGS_TOOL_BAR_STYLE
909 and GSETTINGS_FONT_NAME. Move check for fonts within HAVE_XFT.
910 (init_gconf): Add comment. Get values for GCONF_TOOL_BAR_STYLE
911 and GCONF_FONT_NAME. Move check for fonts within HAVE_XFT.
912 (xsettings_initialize): Call init_gsettings last.
913 (xsettings_get_system_font, xsettings_get_system_normal_font): Add
914 comment.
915
916 2011-07-05 Paul Eggert <eggert@cs.ucla.edu>
917
918 Random fixes. E.g., (random) never returned negative values.
919 * fns.c (Frandom): Use GET_EMACS_TIME for random seed, and add the
920 subseconds part to the entropy, as that's a bit more random.
921 Prefer signed to unsigned, since the signedness doesn't matter and
922 in general we prefer signed. When given a limit, use a
923 denominator equal to INTMASK + 1, not to VALMASK + 1, because the
924 latter isn't right if USE_2_TAGS_FOR_INTS.
925 * sysdep.c (get_random): Return a value in the range 0..INTMASK,
926 not 0..VALMASK. Don't discard "excess" bits that random () returns.
927
928 2011-07-04 Stefan Monnier <monnier@iro.umontreal.ca>
929
930 * textprop.c (text_property_stickiness):
931 Obey Vtext_property_default_nonsticky.
932 (syms_of_textprop): Add `display' to Vtext_property_default_nonsticky.
933 * w32fns.c (syms_of_w32fns):
934 * xfns.c (syms_of_xfns): Don't Add `display' since it's there by default.
935
936 2011-07-04 Paul Eggert <eggert@cs.ucla.edu>
937
938 * fileio.c (barf_or_query_if_file_exists): Use S_ISDIR.
939 This is more efficient than Ffile_directory_p and avoids a minor race.
940
941 2011-07-04 Lars Magne Ingebrigtsen <larsi@gnus.org>
942
943 * buffer.c (Foverlay_put): Say what the return value is
944 (bug#7835).
945
946 * fileio.c (barf_or_query_if_file_exists): Check first if the file
947 is a directory before asking whether to use the file name
948 (bug#7564).
949 (barf_or_query_if_file_exists): Make the "File is a directory"
950 error be more correct.
951
952 * fns.c (Frequire): Remove the mention of the .gz files, since
953 that's installation-specific, but keep the mention of
954 `get-load-suffixes'.
955
956 2011-07-04 Paul Eggert <eggert@cs.ucla.edu>
957
958 * editfns.c (Fformat_time_string): Don't assume strlen fits in int.
959 Report string overflow if the output is too long.
960
961 2011-07-04 Juanma Barranquero <lekktu@gmail.com>
962
963 * gnutls.c (Fgnutls_boot): Don't mention :verify-error.
964 (syms_of_gnutls): Remove duplicate DEFSYM for
965 Qgnutls_bootprop_verify_hostname_error, an error for
966 Qgnutls_bootprop_verify_error (which is no longer used).
967
968 * eval.c (find_handler_clause): Remove parameters `sig' and `data',
969 unused since 2011-01-26T20:02:07Z!monnier@iro.umontreal.ca. All callers changed.
970 Also (re)move comments that are misplaced or no longer relevant.
971
972 2011-07-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
973
974 * callint.c (Finteractive): Clarify the meaning of "@" (bug#8813).
975
976 2011-07-03 Chong Yidong <cyd@stupidchicken.com>
977
978 * xfaces.c (Finternal_merge_in_global_face): Modify the foreground
979 and background color parameters if they have been changed.
980
981 2011-07-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
982
983 * editfns.c (Fformat): Clarify the - and 0 flags (bug#6659).
984
985 2011-07-03 Paul Eggert <eggert@cs.ucla.edu>
986
987 * xsettings.c (SYSTEM_FONT): Define only when used.
988 No need to define when HAVE_GSETTINGS || !HAVE_XFT.
989
990 * keymap.c (access_keymap_1): Now static.
991
992 2011-07-02 Chong Yidong <cyd@stupidchicken.com>
993
994 * keyboard.c (command_loop_1): If a down-mouse event is unbound,
995 leave any prefix arg for the up event (Bug#1586).
996
997 2011-07-02 Lars Magne Ingebrigtsen <larsi@gnus.org>
998
999 * lread.c (syms_of_lread): Mention single symbols defined by
1000 `defvar' or `defconst' (bug#7154).
1001
1002 * fns.c (Frequire): Mention .el.gz files (bug#7314).
1003 (Frequire): Mention get-load-suffixes.
1004
1005 2011-07-02 Martin Rudalics <rudalics@gmx.at>
1006
1007 * window.h (window): Remove clone_number slot.
1008 * window.c (Fwindow_clone_number, Fset_window_clone_number):
1009 Remove.
1010 (make_parent_window, make_window, saved_window)
1011 (Fset_window_configuration, save_window_save): Don't deal with
1012 clone numbers.
1013 * buffer.c (Qclone_number): Remove declaration.
1014 (sort_overlays, overlay_strings): Don't deal with clone numbers.
1015
1016 2011-07-02 Stefan Monnier <monnier@iro.umontreal.ca>
1017
1018 Add multiple inheritance to keymaps.
1019 * keymap.c (Fmake_composed_keymap): New function.
1020 (Fset_keymap_parent): Simplify.
1021 (fix_submap_inheritance): Remove.
1022 (access_keymap_1): New function extracted from access_keymap to handle
1023 embedded parents and handle lists of maps.
1024 (access_keymap): Use it.
1025 (Fkeymap_prompt, map_keymap_internal, map_keymap, store_in_keymap)
1026 (Fcopy_keymap): Handle embedded parents.
1027 (Fcommand_remapping, define_as_prefix): Simplify.
1028 (Fkey_binding): Simplify.
1029 (syms_of_keymap): Move minibuffer-local-completion-map,
1030 minibuffer-local-filename-completion-map,
1031 minibuffer-local-must-match-map, and
1032 minibuffer-local-filename-must-match-map to Elisp.
1033 (syms_of_keymap): Defsubr make-composed-keymap.
1034 * keyboard.c (menu_bar_items): Use map_keymap_canonical.
1035 (parse_menu_item): Trivial simplification.
1036
1037 2011-07-01 Glenn Morris <rgm@gnu.org>
1038
1039 * Makefile.in (SETTINGS_LIBS): Fix typo.
1040
1041 2011-07-01 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny patch)
1042
1043 * coding.c (Fencode_coding_string): Record the last coding system
1044 used, as the function doc string says (bug#8738).
1045
1046 2011-07-01 Jan Djärv <jan.h.d@swipnet.se>
1047
1048 * xsettings.c (store_monospaced_changed): Take new font as arg and
1049 check for change against current_mono_font.
1050 (EMACS_TYPE_SETTINGS): Remove this and related defines.
1051 (emacs_settings_constructor, emacs_settings_get_property)
1052 (emacs_settings_set_property, emacs_settings_class_init)
1053 (emacs_settings_init, gsettings_obj): Remove.
1054 (something_changedCB): New function for HAVE_GSETTINGS.
1055 (something_changedCB): HAVE_GCONF: Call store_monospaced_changed
1056 with value as argument.
1057 (init_gsettings): Check that GSETTINGS_SCHEMA exists before calling
1058 g_settings_new (Bug#8967). Do not create gsettings_obj.
1059 Remove calls to g_settings_bind. Connect something_changedCB to
1060 "changed".
1061
1062 * xgselect.c: Add defined (HAVE_GSETTINGS).
1063 (xgselect_initialize): Ditto.
1064
1065 * process.c: Add defined (HAVE_GSETTINGS) for xgselect.h
1066 (wait_reading_process_output): Add defined (HAVE_GSETTINGS) for
1067 xg_select.
1068
1069 2011-07-01 Paul Eggert <eggert@cs.ucla.edu>
1070
1071 * eval.c (struct backtrace): Simplify and port the data structure.
1072 Do not assume that "int nargs : BITS_PER_INT - 2;" produces a
1073 signed bit field, as this assumption is not portable and it makes
1074 Emacs crash when compiled with Sun C 5.8 on sparc. Do not use
1075 "char debug_on_exit : 1" as this is not portable either; instead,
1076 use the portable "unsigned int debug_on_exit : 1". Remove unused
1077 member evalargs. Remove obsolete comments about cc bombing out.
1078
1079 2011-06-30 Jan Djärv <jan.h.d@swipnet.se>
1080
1081 * xsettings.c: Include glib-object.h, gio/gio.h if HAVE_GSETTINGS.
1082 Let HAVE_GSETTINGS override HAVE_GCONF.
1083 (store_monospaced_changed): New function.
1084 (EMACS_SETTINGS): A new type derived from GObject to handle
1085 GSettings notifications.
1086 (emacs_settings_constructor, emacs_settings_get_property)
1087 (emacs_settings_set_property, emacs_settings_class_init):
1088 New functions.
1089 (gsettings_client, gsettings_obj): New variables.
1090 (GSETTINGS_SCHEMA): New define.
1091 (something_changedCB): Call store_monospaced_changed.
1092 (init_gsettings): New function.
1093 (xsettings_initialize): Call init_gsettings.
1094 (syms_of_xsettings): Initialize gsettings_client, gsettings_obj
1095 to NULL.
1096
1097 * Makefile.in (SETTINGS_CFLAGS, SETTINGS_LIBS): Renamed from
1098 GCONF_CFLAGS/LIBS.
1099
1100 2011-06-29 Martin Rudalics <rudalics@gmx.at>
1101
1102 * window.c (resize_root_window, grow_mini_window)
1103 (shrink_mini_window): Rename Qresize_root_window to
1104 Qwindow_resize_root_window and Qresize_root_window_vertically to
1105 Qwindow_resize_root_window_vertically.
1106
1107 2011-06-28 Paul Eggert <eggert@cs.ucla.edu>
1108
1109 * gnutls.c (Qgnutls_bootprop_verify_error): Remove unused var.
1110
1111 2011-06-27 Juanma Barranquero <lekktu@gmail.com>
1112
1113 * makefile.w32-in: Redesign dependencies so they reflect more
1114 clearly which files are directly included by each source file,
1115 and not through other includes.
1116
1117 2011-06-27 Martin Rudalics <rudalics@gmx.at>
1118
1119 * buffer.c (Qclone_number): Declare static and DEFSYM it.
1120 (sort_overlays, overlay_strings): When an overlay's clone number
1121 matches the window's clone number process the overlay even if
1122 the overlay's window property doesn't match the current window.
1123
1124 * window.c (Fwindow_vchild): Rename to Fwindow_top_child.
1125 (Fwindow_hchild): Rename to Fwindow_left_child.
1126 (Fwindow_next): Rename to Fwindow_next_sibling.
1127 (Fwindow_prev): Rename to Fwindow_prev_sibling.
1128 (resize_window_check): Rename to window_resize_check.
1129 (resize_window_apply): Rename to window_resize_apply.
1130 (Fresize_window_apply): Rename to Fwindow_resize_apply.
1131 (Fdelete_other_windows_internal, resize_frame_windows)
1132 (Fsplit_window_internal, Fdelete_window_internal)
1133 (grow_mini_window, shrink_mini_window)
1134 (Fresize_mini_window_internal): Fix callers accordingly.
1135
1136 2011-06-26 Jan Djärv <jan.h.d@swipnet.se>
1137
1138 * emacsgtkfixed.h: State that this is only used with Gtk+3.
1139 (emacs_fixed_set_min_size): Remove.
1140 (emacs_fixed_new): Take frame as argument.
1141
1142 * emacsgtkfixed.c: State that this is only used with Gtk+3.
1143 (_EmacsFixedPrivate): Remove minwidth/height.
1144 Add struct frame *f.
1145 (emacs_fixed_init): Initialize priv->f.
1146 (get_parent_class, emacs_fixed_set_min_size): Remove.
1147 (emacs_fixed_new): Set priv->f to argument.
1148 (emacs_fixed_get_preferred_width)
1149 (emacs_fixed_get_preferred_height): Use min_width/height from
1150 frames size_hint to set minimum and natural (Bug#8919).
1151 (XSetWMSizeHints, XSetWMNormalHints): Override these functions
1152 and use min_width/height from frames size_hint to set
1153 min_width/height (Bug#8919).
1154
1155 * gtkutil.c (xg_create_frame_widgets): Pass f to emacs_fixed_new.
1156 (x_wm_set_size_hint): Remove call to emacs_fixed_set_min_size.
1157 Fix indentation.
1158
1159 2011-06-26 Eli Zaretskii <eliz@gnu.org>
1160
1161 * bidi.c (bidi_paragraph_init): Test for ZV_BYTE before calling
1162 bidi_at_paragraph_end, since fast_looking_at doesn't like to be
1163 called at ZV.
1164
1165 2011-06-26 Chong Yidong <cyd@stupidchicken.com>
1166
1167 * process.c (wait_reading_process_output): Bypass select if
1168 waiting for a cell while ignoring keyboard input, and input is
1169 pending. Suggested by Jan Djärv (Bug#8869).
1170
1171 2011-06-25 Paul Eggert <eggert@cs.ucla.edu>
1172
1173 Use gnulib's dup2 module instead of rolling our own.
1174 * sysdep.c (dup2) [!HAVE_DUP2]: Remove; gnulib now does this.
1175
1176 2011-06-25 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
1177
1178 * dispnew.c (scrolling_window): Before scrolling, turn off a
1179 mouse-highlight in the window being scrolled.
1180
1181 2011-06-24 Juanma Barranquero <lekktu@gmail.com>
1182
1183 Move DEFSYM to lisp.h and use everywhere.
1184
1185 * character.h (DEFSYM): Move declaration...
1186 * lisp.h (DEFSYM): ...here.
1187
1188 * gnutls.c:
1189 * minibuf.c:
1190 * w32menu.c:
1191 * w32proc.c:
1192 * w32select.c: Don't include character.h.
1193
1194 * alloc.c (syms_of_alloc):
1195 * buffer.c (syms_of_buffer):
1196 * bytecode.c (syms_of_bytecode):
1197 * callint.c (syms_of_callint):
1198 * casefiddle.c (syms_of_casefiddle):
1199 * casetab.c (init_casetab_once):
1200 * category.c (init_category_once, syms_of_category):
1201 * ccl.c (syms_of_ccl):
1202 * cmds.c (syms_of_cmds):
1203 * composite.c (syms_of_composite):
1204 * dbusbind.c (syms_of_dbusbind):
1205 * dired.c (syms_of_dired):
1206 * dispnew.c (syms_of_display):
1207 * doc.c (syms_of_doc):
1208 * editfns.c (syms_of_editfns):
1209 * emacs.c (syms_of_emacs):
1210 * eval.c (syms_of_eval):
1211 * fileio.c (syms_of_fileio):
1212 * fns.c (syms_of_fns):
1213 * frame.c (syms_of_frame):
1214 * fringe.c (syms_of_fringe):
1215 * insdel.c (syms_of_insdel):
1216 * keymap.c (syms_of_keymap):
1217 * lread.c (init_obarray, syms_of_lread):
1218 * macros.c (syms_of_macros):
1219 * msdos.c (syms_of_msdos):
1220 * print.c (syms_of_print):
1221 * process.c (syms_of_process):
1222 * search.c (syms_of_search):
1223 * sound.c (syms_of_sound):
1224 * syntax.c (init_syntax_once, syms_of_syntax):
1225 * terminal.c (syms_of_terminal):
1226 * textprop.c (syms_of_textprop):
1227 * undo.c (syms_of_undo):
1228 * w32.c (globals_of_w32):
1229 * window.c (syms_of_window):
1230 * xdisp.c (syms_of_xdisp):
1231 * xfaces.c (syms_of_xfaces):
1232 * xfns.c (syms_of_xfns):
1233 * xmenu.c (syms_of_xmenu):
1234 * xsettings.c (syms_of_xsettings):
1235 * xterm.c (syms_of_xterm): Use DEFSYM.
1236
1237 2011-06-24 Teodor Zlatanov <tzz@lifelogs.com>
1238
1239 * gnutls.c (syms_of_gnutls): Use the DEFSYM macro from character.h.
1240
1241 2011-06-23 Paul Eggert <eggert@cs.ucla.edu>
1242
1243 Integer and buffer overflow fixes (Bug#8873).
1244
1245 * print.c (printchar, strout): Check for string overflow.
1246 (PRINTPREPARE, printchar, strout):
1247 Don't set size unless allocation succeeds.
1248
1249 * minibuf.c (read_minibuf_noninteractive): Use ptrdiff_t, not int,
1250 for sizes. Check for string overflow more accurately.
1251 Simplify newline removal at end; this suppresses a GCC 4.6.0 warning.
1252
1253 * macros.c: Integer and buffer overflow fixes.
1254 * keyboard.h (struct keyboard.kbd_macro_bufsize):
1255 * macros.c (Fstart_kbd_macro, store_kbd_macro_char):
1256 Use ptrdiff_t, not int, for sizes.
1257 Don't increment bufsize until after realloc succeeds.
1258 Check for size-calculation overflow.
1259 (Fstart_kbd_macro): Use EMACS_INT, not int, for XINT result.
1260
1261 * lisp.h (DEFVAR_KBOARD): Use offsetof instead of char * finagling.
1262
1263 * lread.c: Integer overflow fixes.
1264 (read_integer): Radix is now EMACS_INT, not int,
1265 to improve quality of diagnostics for out-of-range radices.
1266 Calculate buffer size correctly for out-of-range radices.
1267 (read1): Check for integer overflow in radices, and in
1268 read-circle numbers.
1269 (read_escape): Avoid int overflow.
1270 (Fload, openp, read_buffer_size, read1)
1271 (substitute_object_recurse, read_vector, read_list, map_obarray):
1272 Use ptrdiff_t, not int, for sizes.
1273 (read1): Use EMACS_INT, not int, for sizes.
1274 Check for size overflow.
1275
1276 * image.c (cache_image): Check for size arithmetic overflow.
1277
1278 * lread.c: Integer overflow issues.
1279 (saved_doc_string_size, saved_doc_string_length)
1280 (prev_saved_doc_string_size, prev_saved_doc_string_length):
1281 Now ptrdiff_t, not int.
1282 (read1): Don't assume doc string length fits in int. Check for
1283 out-of-range doc string lengths.
1284 (read_list): Don't assume file position fits in int.
1285 (read_escape): Check for hex character overflow.
1286
1287 2011-06-22 Leo Liu <sdl.web@gmail.com>
1288
1289 * minibuf.c (Fcompleting_read_default, Vcompleting_read_function):
1290 Move to minibuffer.el.
1291
1292 2011-06-22 Paul Eggert <eggert@cs.ucla.edu>
1293
1294 Fixes for GLYPH_DEBUG found by GCC 4.6.0 static checking.
1295 The following patches are for when GLYPH_DEBUG && !XASSERT.
1296 * dispextern.h (trace_redisplay_p, dump_glyph_string):
1297 * dispnew.c (flush_stdout):
1298 * xdisp.c (dump_glyph_row, dump_glyph_matrix, dump_glyph):
1299 Mark as externally visible.
1300 * dispnew.c (check_window_matrix_pointers): Now static.
1301 * dispnew.c (window_to_frame_vpos):
1302 * xfns.c (unwind_create_frame):
1303 * xterm.c (x_check_font): Remove unused local.
1304 * scroll.c (CHECK_BOUNDS):
1305 * xfaces.c (cache_fache): Rename local to avoid shadowing.
1306 * xfns.c, w32fns.c (image_cache_refcount, dpyinfo_refcount): Now static.
1307 * xdisp.c (check_window_end): Now a no-op if !XASSERTS.
1308 (debug_first_unchanged_at_end_vpos, debug_last_unchanged_at_beg_vpos)
1309 (debug_dvpos, debug_dy, debug_delta, debug_delta_bytes, debug_end_vpos):
1310 Now static.
1311 (debug_method_add): Use va_list and vsprintf rather than relying
1312 on undefined behavior with wrong number of arguments.
1313 (dump_glyph, dump_glyph_row, Fdump_glyph_matrix):
1314 Don't assume ptrdiff_t and EMACS_INT are the same width as int.
1315 In this code, it's OK to assume C99 behavior for ptrdiff_t formats
1316 since we're not interested in debugging glyphs with old libraries.
1317 * xfaces.c (cache_face): Move debugging code earlier; this pacifies
1318 GCC 4.6.0's static checking.
1319
1320 2011-06-22 Paul Eggert <eggert@cs.ucla.edu>
1321
1322 Integer overflow and signedness fixes (Bug#8873).
1323 A few related buffer overrun fixes, too.
1324
1325 * font.c (font_score): Use EMACS_INT, not int, to store XINT value.
1326
1327 * dispextern.h (struct face.stipple):
1328 * image.c (x_bitmap_height, x_bitmap_width, x_bitmap_pixmap)
1329 (x_bitmap_mask, x_allocate_bitmap_record)
1330 (x_create_bitmap_from_data, x_create_bitmap_from_file)
1331 (x_destroy_bitmap, x_destroy_all_bitmaps, x_create_bitmap_mask)
1332 (x_create_bitmap_from_xpm_data):
1333 * nsterm.h (struct ns_display_info.bitmaps_size, .bitmaps_last):
1334 * w32term.h (struct w32_display_info.icon_bitmap_id, .bitmaps_size)
1335 (.bitmaps_last):
1336 * xfaces.c (load_pixmap):
1337 * xterm.c (x_bitmap_icon, x_wm_set_icon_pixmap):
1338 * xterm.h (struct x_display_info.icon_bitmap_id, .bitmaps_size)
1339 (.bitmaps_last, struct x_output.icon_bitmap):
1340 Use ptrdiff_t, not int, for bitmap indexes.
1341 (x_allocate_bitmap_record): Check for size overflow.
1342 * dispextern.h, lisp.h: Adjust to API changes elsewhere.
1343
1344 Use ptrdiff_t, not int, for overlay counts.
1345 * buffer.h (overlays_at, sort_overlays, GET_OVERLAYS_AT):
1346 * editfns.c (overlays_around, get_pos_property):
1347 * textprop.c (get_char_property_and_overlay):
1348 * xdisp.c (next_overlay_change, note_mouse_highlight):
1349 * xfaces.c (face_at_buffer_position):
1350 * buffer.c (OVERLAY_COUNT_MAX): New macro.
1351 (overlays_at, overlays_in, sort_overlays, Foverlays_at)
1352 (Fnext_overlay_change, Fprevious_overlay_change)
1353 (mouse_face_overlay_overlaps, Foverlays_in):
1354 Use ptrdiff_t, not int, for sizes.
1355 (overlays_at, overlays_in): Check for size-calculation overflow.
1356
1357 * xterm.c (xim_initialize, same_x_server): Strlen may not fit in int.
1358
1359 * xsmfns.c (smc_save_yourself_CB, x_session_initialize): Avoid strlen.
1360 (x_session_initialize): Do not assume string length fits in int.
1361
1362 * xsettings.c (apply_xft_settings): Fix potential buffer overrun.
1363 This is unlikely, but can occur if DPI is outlandish.
1364
1365 * xsettings.c (Ffont_get_system_normal_font, Ffont_get_system_font):
1366 * xselect.c (Fx_get_atom_name): Avoid need for strlen.
1367
1368 * xrdb.c: Don't assume strlen fits in int; avoid some strlens.
1369 * xrdb.c (magic_file_p, search_magic_path):
1370 Omit last arg SUFFIX; it was always 0. All callers changed.
1371 (magic_file_p): Use ptrdiff_t, not int. Check for size overflow.
1372
1373 * xfont.c (xfont_match): Avoid need for strlen.
1374
1375 * xfns.c: Don't assume strlen fits in int.
1376 (xic_create_fontsetname, x_window): Use ptrdiff_t, not int.
1377
1378 * xdisp.c (message_log_check_duplicate): Return intmax_t,
1379 not unsigned long, as we prefer signed integers. All callers changed.
1380 Detect integer overflow in repeat count.
1381 (message_dolog): Don't assume print length fits in 39 bytes.
1382 (display_mode_element): Don't assume strlen fits in int.
1383
1384 * termcap.c: Don't assume sizes fit in int and never overflow.
1385 (struct termcap_buffer, tgetent): Use ptrdiff_t, not int, for sizes.
1386 (gobble_line): Check for size-calculation overflow.
1387
1388 * minibuf.c (Fread_buffer):
1389 * lread.c (intern, intern_c_string):
1390 * image.c (xpm_scan) [HAVE_NS && !HAVE_XPM]:
1391 Don't assume string length fits in int.
1392
1393 * keyboard.c (parse_tool_bar_item):
1394 * gtkutil.c (style_changed_cb): Avoid need for strlen.
1395
1396 * font.c: Don't assume string length fits in int.
1397 (font_parse_xlfd, font_parse_fcname, font_unparse_fcname):
1398 Use ptrdiff_t, not int.
1399 (font_intern_prop): Don't assume string length fits in int.
1400 Don't assume integer property fits in fixnum.
1401 * font.h (font_intern_prop): 2nd arg is now ptrdiff_t, not int.
1402
1403 * filelock.c: Fix some buffer overrun and integer overflow issues.
1404 (get_boot_time): Don't assume gzip command string fits in 100 bytes.
1405 Reformulate so as not to need the command string.
1406 Invoke gzip -cd rather than gunzip, as it's more portable.
1407 (lock_info_type, lock_file_1, lock_file):
1408 Don't assume pid_t and time_t fit in unsigned long.
1409 (LOCK_PID_MAX): Remove; we now use more-reliable bounds.
1410 (current_lock_owner): Prefer signed type for sizes.
1411 Use memcpy, not strncpy, where memcpy is what is really wanted.
1412 Don't assume (via atoi) that time_t and pid_t fit in int.
1413 Check for time_t and/or pid_t out of range, e.g., via a network share.
1414 Don't alloca where an auto var works fine.
1415
1416 * fileio.c: Fix some integer overflow issues.
1417 (file_name_as_directory, Fexpand_file_name, Fsubstitute_in_file_name):
1418 Don't assume string length fits in int.
1419 (directory_file_name): Don't assume string length fits in long.
1420 (make_temp_name): Don't assume pid fits in int, or that its print
1421 length is less than 20.
1422
1423 * data.c (Fsubr_name): Rewrite to avoid a strlen call.
1424
1425 * coding.c (make_subsidiaries): Don't assume string length fits in int.
1426
1427 * callproc.c (child_setup): Rewrite to avoid two strlen calls.
1428
1429 * process.c (Fformat_network_address): Use EMACS_INT, not EMACS_UINT.
1430 We prefer signed integers, even for size calculations.
1431
1432 * emacs.c: Don't assume string length fits in 'int'.
1433 (DEFINE_DUMMY_FUNCTION, sort_args): Use ptrdiff_t, not int.
1434 (main): Don't invoke strlen when not needed.
1435
1436 * dbusbind.c (XD_ERROR): Don't arbitrarily truncate string.
1437 (XD_DEBUG_MESSAGE): Don't waste a byte.
1438
1439 * callproc.c (getenv_internal_1, getenv_internal)
1440 (Fgetenv_internal):
1441 * buffer.c (init_buffer): Don't assume string length fits in 'int'.
1442
1443 * lread.c (invalid_syntax): Omit length argument.
1444 All uses changed. This doesn't fix a bug, but it simplifies the
1445 code away from its former Hollerith-constant appearance, and it's
1446 one less 'int' to worry about when looking at integer-overflow issues.
1447 (string_to_number): Simplify 2011-04-26 change by invoking xsignal1.
1448
1449 * lisp.h (DEFUN): Remove bogus use of sizeof (struct Lisp_Subr).
1450 This didn't break anything, but it didn't help either.
1451 It's confusing to put a bogus integer in a place where the actual
1452 value does not matter.
1453 (LIST_END_P): Remove unused macro and its bogus comment.
1454 (make_fixnum_or_float): Remove unnecessary cast to EMACS_INT.
1455
1456 * lisp.h (union Lisp_Object.i): EMACS_INT, not EMACS_UINT.
1457 This is for consistency with the ordinary, non-USE_LISP_UNION_TYPE,
1458 implementation.
1459 (struct Lisp_Bool_Vector.size): EMACS_INT, not EMACS_UINT.
1460 We prefer signed types, and the value cannot exceed the EMACS_INT
1461 range anyway (because otherwise the length would not be representable).
1462 (XSET) [USE_LISP_UNION_TYPE]: Use uintptr_t and intptr_t,
1463 not EMACS_UINT and EMACS_INT, when converting pointer to integer.
1464 This avoids a GCC warning when WIDE_EMACS_INT.
1465
1466 * indent.c (sane_tab_width): New function.
1467 (current_column, scan_for_column, Findent_to, position_indentation)
1468 (compute_motion): Use it. This is just for clarity.
1469 (Fcompute_motion): Don't assume hscroll and tab offset fit in int.
1470
1471 * image.c (xbm_image_p): Don't assume stated width, height fit in int.
1472
1473 * lisp.h (lint_assume): New macro.
1474 * composite.c (composition_gstring_put_cache):
1475 * ftfont.c (ftfont_shape_by_flt): Use it to pacify GCC 4.6.0.
1476
1477 * editfns.c, insdel.c:
1478 Omit unnecessary forward decls, to simplify future changes.
1479
1480 * ftfont.c (ftfont_shape_by_flt): Use signed integers for lengths.
1481
1482 * font.c (Ffont_shape_gstring): Don't assume glyph len fits in 'int'.
1483
1484 * fns.c (Ffillarray): Don't assume bool vector size fits in 'int'.
1485 Use much-faster test for byte-length change.
1486 Don't assume string byte-length fits in 'int'.
1487 Check that character arg fits in 'int'.
1488 (mapcar1): Declare byte as byte, for clarity.
1489
1490 * alloc.c (Fmake_bool_vector): Avoid unnecessary multiplication.
1491
1492 * fns.c (concat): Catch string overflow earlier.
1493 Do not rely on integer wraparound.
1494
1495 * dispextern.h (struct it.overlay_strings_charpos)
1496 (struct it.selective): Now EMACS_INT, not int.
1497 * xdisp.c (forward_to_next_line_start)
1498 (back_to_previous_visible_line_start)
1499 (reseat_at_next_visible_line_start, next_element_from_buffer):
1500 Don't arbitrarily truncate the value of 'selective' to int.
1501
1502 * xdisp.c (init_iterator): Use XINT, not XFASTINT; it might be < 0.
1503
1504 * composite.c: Don't truncate sizes to 'int'.
1505 (composition_gstring_p, composition_reseat_it)
1506 (composition_adjust_point): Use EMACS_INT, not int.
1507 (get_composition_id, composition_gstring_put_cache): Use EMACS_INT,
1508 not EMACS_UINT, for indexes.
1509
1510 * category.h (CATEGORY_SET_P): Remove unnecessary cast to EMACS_INT.
1511
1512 * buffer.c: Include <verify.h>.
1513 (struct sortvec.priority, struct sortstr.priority):
1514 Now EMACS_INT, not int.
1515 (compare_overlays, cmp_for_strings): Avoid subtraction overflow.
1516 (struct sortstr.size, record_overlay_string)
1517 (struct sortstrlist.size, struct sortlist.used):
1518 Don't truncate size to int.
1519 (record_overlay_string): Check for size-calculation overflow.
1520 (init_buffer_once): Check at compile-time, not run-time.
1521
1522 2011-06-22 Jim Meyering <meyering@redhat.com>
1523
1524 Don't leak an XBM-image-sized buffer
1525 * image.c (xbm_load): Free the image buffer after using it.
1526
1527 2011-06-21 Paul Eggert <eggert@cs.ucla.edu>
1528
1529 Port to Sun C.
1530 * composite.c (find_automatic_composition): Omit needless 'return 0;'
1531 that Sun C diagnosed.
1532 * fns.c (secure_hash): Fix pointer signedness issue.
1533 * intervals.c (static_offset_intervals): New function.
1534 (offset_intervals): Use it.
1535
1536 2011-06-21 Leo Liu <sdl.web@gmail.com>
1537
1538 * deps.mk (fns.o):
1539 * makefile.w32-in ($(BLD)/fns.$(O)): Include sha256.h and
1540 sha512.h.
1541
1542 * fns.c (secure_hash): Rename from crypto_hash_function and change
1543 the first arg to accept symbols.
1544 (Fsecure_hash): New primitive.
1545 (syms_of_fns): New symbols.
1546
1547 2011-06-20 Deniz Dogan <deniz@dogan.se>
1548
1549 * process.c (Fset_process_buffer): Clarify return value in
1550 docstring.
1551
1552 2011-06-18 Chong Yidong <cyd@stupidchicken.com>
1553
1554 * dispnew.c (add_window_display_history): Use BVAR.
1555
1556 * xdisp.c (debug_method_add): Use BVAR.
1557 (check_window_end, dump_glyph_matrix, dump_glyph)
1558 (dump_glyph_row, dump_glyph_string): Convert arglist to ANSI C.
1559
1560 * xfaces.c (check_lface_attrs, check_lface, dump_realized_face):
1561 Likewise.
1562
1563 * xfns.c (Fx_create_frame, x_create_tip_frame): Delay image cache
1564 check till after the cache is created in init_frame_faces.
1565
1566 2011-06-17 Stefan Monnier <monnier@iro.umontreal.ca>
1567
1568 * fns.c (Fsafe_length): Yet another int/Lisp_Object mixup.
1569
1570 2011-06-16 Paul Eggert <eggert@cs.ucla.edu>
1571
1572 * lisp.h: Include <limits.h>, for INT_MAX, LONG_MAX, LLONG_MAX.
1573 Without this, prin1 mishandles Lisp_Misc_Save_Value printing on
1574 hosts with pre-C99 libraries, because pD is wrongly defined to "t".
1575
1576 Improve buffer-overflow checking (Bug#8873).
1577 * fileio.c (Finsert_file_contents):
1578 * insdel.c (insert_from_buffer_1, replace_range, replace_range_2):
1579 Remove the old (too-loose) buffer overflow checks.
1580 They weren't needed, since make_gap checks for buffer overflow.
1581 * insdel.c (make_gap_larger): Catch buffer overflows that were missed.
1582 The old code merely checked for Emacs fixnum overflow, and relied
1583 on undefined (wraparound) behavior. The new code avoids undefined
1584 behavior, and also checks for ptrdiff_t and/or size_t overflow.
1585
1586 * editfns.c (Finsert_char): Don't dump core with very negative counts.
1587 Tune. Don't use wider integers than needed. Don't use alloca.
1588 Use a bigger 'string' buffer. Rewrite to avoid 'n > 0' test.
1589
1590 * insdel.c (replace_range): Fix buf overflow when insbytes < outgoing.
1591
1592 * insdel.c, lisp.h (buffer_overflow): New function.
1593 (insert_from_buffer_1, replace_range, replace_range_2):
1594 * insdel.c (make_gap_larger):
1595 * editfns.c (Finsert_char):
1596 * fileio.c (Finsert_file_contents): Use it, to normalize wording.
1597
1598 * buffer.h (BUF_BYTES_MAX): Cast to ptrdiff_t so that it's signed.
1599
1600 2011-06-15 Paul Eggert <eggert@cs.ucla.edu>
1601
1602 Integer overflow and signedness fixes (Bug#8873).
1603
1604 * ccl.c (ASCENDING_ORDER): New macro, to work around GCC bug 43772.
1605 (GET_CCL_RANGE, IN_INT_RANGE): Use it.
1606
1607 * fileio.c: Don't assume EMACS_INT fits in off_t.
1608 (emacs_lseek): New static function.
1609 (Finsert_file_contents, Fwrite_region): Use it.
1610 Use SEEK_SET, SEEK_CUR, SEEK_END as appropriate.
1611
1612 * fns.c (Fload_average): Don't assume 100 * load average fits in int.
1613
1614 * fns.c: Don't overflow int when computing a list length.
1615 * fns.c (QUIT_COUNT_HEURISTIC): New constant.
1616 (Flength, Fsafe_length): Use EMACS_INT, not int, to avoid unwanted
1617 truncation on 64-bit hosts. Check for QUIT every
1618 QUIT_COUNT_HEURISTIC entries rather than every other entry; that's
1619 faster and is responsive enough.
1620 (Flength): Report an error instead of overflowing an integer.
1621 (Fsafe_length): Return a float if the value is not representable
1622 as a fixnum. This shouldn't happen except in contrived situations.
1623 (Fnthcdr, Fsort): Don't assume list length fits in int.
1624 (Fcopy_sequence): Don't assume vector length fits in int.
1625
1626 * alloc.c: Check that resized vectors' lengths fit in fixnums.
1627 (header_size, word_size): New constants.
1628 (allocate_vectorlike): Don't check size overflow here.
1629 (allocate_vector): Check it here instead, since this is the only
1630 caller of allocate_vectorlike that could cause overflow.
1631 Check that the new vector's length is representable as a fixnum.
1632
1633 * fns.c (next_almost_prime): Don't return a multiple of 3 or 5.
1634 The previous code was bogus. For example, next_almost_prime (32)
1635 returned 39, which is undesirable as it is a multiple of 3; and
1636 next_almost_prime (24) returned 25, which is a multiple of 5 so
1637 why was the code bothering to check for multiples of 7?
1638
1639 * bytecode.c (exec_byte_code): Use ptrdiff_t, not int, for vector length.
1640
1641 * eval.c, doprnt.c (SIZE_MAX): Remove; inttypes.h defines this now.
1642
1643 Variadic C functions now count arguments with ptrdiff_t.
1644 This partly undoes my 2011-03-30 change, which replaced int with size_t.
1645 Back then I didn't know that the Emacs coding style prefers signed int.
1646 Also, in the meantime I found a few more instances where arguments
1647 were being counted with int, which may truncate counts on 64-bit
1648 machines, or EMACS_INT, which may be unnecessarily wide.
1649 * lisp.h (struct Lisp_Subr.function.aMANY)
1650 (DEFUN_ARGS_MANY, internal_condition_case_n, safe_call):
1651 Arg counts are now ptrdiff_t, not size_t.
1652 All variadic functions and their callers changed accordingly.
1653 (struct gcpro.nvars): Now size_t, not size_t. All uses changed.
1654 * bytecode.c (exec_byte_code): Check maxdepth for overflow,
1655 to avoid potential buffer overrun. Don't assume arg counts fit in 'int'.
1656 * callint.c (Fcall_interactively): Check arg count for overflow,
1657 to avoid potential buffer overrun. Use signed char, not 'int',
1658 for 'varies' array, so that we needn't bother to check its size
1659 calculation for overflow.
1660 * editfns.c (Fformat): Use ptrdiff_t, not EMACS_INT, to count args.
1661 * eval.c (apply_lambda):
1662 * fns.c (Fmapconcat): Use XFASTINT, not XINT, to get args length.
1663 (struct textprop_rec.argnum): Now ptrdiff_t, not int. All uses changed.
1664 (mapconcat): Use ptrdiff_t, not int and EMACS_INT, to count args.
1665
1666 * callint.c (Fcall_interactively): Don't use index var as event count.
1667
1668 * vm-limit.c (check_memory_limits): Fix incorrect extern function decls.
1669 * mem-limits.h (SIZE): Remove; no longer used.
1670
1671 * xterm.c (x_alloc_nearest_color_1): Prefer int to long when int works.
1672
1673 Remove unnecessary casts.
1674 * xterm.c (x_term_init):
1675 * xfns.c (x_set_border_pixel):
1676 * widget.c (create_frame_gcs): Remove casts to unsigned long etc.
1677 These aren't needed now that we assume ANSI C.
1678
1679 * sound.c (Fplay_sound_internal): Remove cast to unsigned long.
1680 It's more likely to cause problems (due to unsigned overflow)
1681 than to cure them.
1682
1683 * dired.c (Ffile_attributes): Don't use 32-bit hack on 64-bit hosts.
1684
1685 * unexelf.c (unexec): Don't assume BSS addr fits in unsigned.
1686
1687 * xterm.c (handle_one_xevent): Omit unnecessary casts to unsigned.
1688
1689 * keyboard.c (modify_event_symbol): Don't limit alist len to UINT_MAX.
1690
1691 * lisp.h (CHAR_TABLE_SET): Omit now-redundant test.
1692
1693 * lread.c (Fload): Don't compare a possibly-garbage time_t value.
1694
1695 GLYPH_CODE_FACE returns EMACS_INT, not int.
1696 * dispextern.h (merge_faces):
1697 * xfaces.c (merge_faces):
1698 * xdisp.c (get_next_display_element, next_element_from_display_vector):
1699 Don't assume EMACS_INT fits in int.
1700
1701 * character.h (CHAR_VALID_P): Remove unused parameter.
1702 * fontset.c, lisp.h, xdisp.c: All uses changed.
1703
1704 * editfns.c (Ftranslate_region_internal): Omit redundant test.
1705
1706 * fns.c (concat): Minor tuning based on overflow analysis.
1707 This doesn't fix any bugs. Use int to hold character, instead
1708 of constantly refetching from Emacs object. Use XFASTINT, not
1709 XINT, for value known to be a character. Don't bother comparing
1710 a single byte to 0400, as it's always less.
1711
1712 * floatfns.c (Fexpt):
1713 * fileio.c (make_temp_name): Omit unnecessary cast to unsigned.
1714
1715 * editfns.c (Ftranslate_region_internal): Use int, not EMACS_INT
1716 for characters.
1717
1718 * doc.c (get_doc_string): Omit (unsigned)c that mishandled negatives.
1719
1720 * data.c (Faset): If ARRAY is a string, check that NEWELT is a char.
1721 Without this fix, on a 64-bit host (aset S 0 4294967386) would
1722 incorrectly succeed when S was a string, because 4294967386 was
1723 truncated before it was used.
1724
1725 * chartab.c (Fchar_table_range): Use CHARACTERP to check range.
1726 Otherwise, an out-of-range integer could cause undefined behavior
1727 on a 64-bit host.
1728
1729 * composite.c: Use int, not EMACS_INT, for characters.
1730 (fill_gstring_body, composition_compute_stop_pos): Use int, not
1731 EMACS_INT, for values that are known to be in character range.
1732 This doesn't fix any bugs but is the usual style inside Emacs and
1733 may generate better code on 32-bit machines.
1734
1735 Make sure a 64-bit char is never passed to ENCODE_CHAR.
1736 This is for reasons similar to the recent CHAR_STRING fix.
1737 * charset.c (Fencode_char): Check that character arg is actually
1738 a character. Pass an int to ENCODE_CHAR.
1739 * charset.h (ENCODE_CHAR): Verify that the character argument is no
1740 wider than 'int', as a compile-time check to prevent future regressions
1741 in this area.
1742
1743 * character.c (char_string): Remove unnecessary casts.
1744
1745 Make sure a 64-bit char is never passed to CHAR_STRING.
1746 Otherwise, CHAR_STRING would do the wrong thing on a 64-bit platform,
1747 by silently ignoring the top 32 bits, allowing some values
1748 that were far too large to be valid characters.
1749 * character.h: Include <verify.h>.
1750 (CHAR_STRING, CHAR_STRING_ADVANCE): Verify that the character
1751 arguments are no wider than unsigned, as a compile-time check
1752 to prevent future regressions in this area.
1753 * data.c (Faset):
1754 * editfns.c (Fchar_to_string, general_insert_function, Finsert_char)
1755 (Fsubst_char_in_region):
1756 * fns.c (concat):
1757 * xdisp.c (decode_mode_spec_coding):
1758 Adjust to CHAR_STRING's new requirement.
1759 * editfns.c (Finsert_char, Fsubst_char_in_region):
1760 * fns.c (concat): Check that character args are actually
1761 characters. Without this test, these functions did the wrong
1762 thing with wildly out-of-range values on 64-bit hosts.
1763
1764 Remove incorrect casts to 'unsigned' that lose info on 64-bit hosts.
1765 These casts should not be needed on 32-bit hosts, either.
1766 * keyboard.c (read_char):
1767 * lread.c (Fload): Remove casts to unsigned.
1768
1769 * lisp.h (UNSIGNED_CMP): New macro.
1770 This fixes comparison bugs on 64-bit hosts.
1771 (ASCII_CHAR_P): Use it.
1772 * casefiddle.c (casify_object):
1773 * character.h (ASCII_BYTE_P, CHAR_VALID_P)
1774 (SINGLE_BYTE_CHAR_P, CHAR_STRING):
1775 * composite.h (COMPOSITION_ENCODE_RULE_VALID):
1776 * dispextern.h (FACE_FROM_ID):
1777 * keyboard.c (read_char): Use UNSIGNED_CMP.
1778
1779 * xmenu.c (dialog_selection_callback) [!USE_GTK]: Cast to intptr_t,
1780 not to EMACS_INT, to avoid GCC warning.
1781
1782 * xfns.c (x_set_scroll_bar_default_width): Remove unused 'int' locals.
1783
1784 * buffer.h (PTR_BYTE_POS, BUF_PTR_BYTE_POS): Remove harmful cast.
1785 The cast incorrectly truncated 64-bit byte offsets to 32 bits, and
1786 isn't needed on 32-bit machines.
1787
1788 * buffer.c (Fgenerate_new_buffer_name):
1789 Use EMACS_INT for count, not int.
1790 (advance_to_char_boundary): Return EMACS_INT, not int.
1791
1792 * data.c (Qcompiled_function): Now static.
1793
1794 * window.c (window_body_lines): Now static.
1795
1796 * image.c (gif_load): Rename local to avoid shadowing.
1797
1798 * lisp.h (SAFE_ALLOCA_LISP): Check for integer overflow.
1799 (struct Lisp_Save_Value): Use ptrdiff_t, not int, for 'integer' member.
1800 * alloc.c (make_save_value): Integer argument is now of type
1801 ptrdiff_t, not int.
1802 (mark_object): Use ptrdiff_t, not int.
1803 * lisp.h (pD): New macro.
1804 * print.c (print_object): Use it.
1805
1806 * alloc.c: Use EMACS_INT, not int, to count objects.
1807 (total_conses, total_markers, total_symbols, total_vector_size)
1808 (total_free_conses, total_free_markers, total_free_symbols)
1809 (total_free_floats, total_floats, total_free_intervals)
1810 (total_intervals, total_strings, total_free_strings):
1811 Now EMACS_INT, not int. All uses changed.
1812 (Fgarbage_collect): Compute overall total using a double, so that
1813 integer overflow is less likely to be a problem. Check for overflow
1814 when converting back to an integer.
1815 (n_interval_blocks, n_string_blocks, n_float_blocks, n_cons_blocks)
1816 (n_vectors, n_symbol_blocks, n_marker_blocks): Remove.
1817 These were 'int' variables that could overflow on 64-bit hosts;
1818 they were never used, so remove them instead of repairing them.
1819 (nzombies, ngcs, max_live, max_zombies): Now EMACS_INT, not 'int'.
1820 (inhibit_garbage_collection): Set gc_cons_threshold to max value.
1821 Previously, this ceilinged at INT_MAX, but that doesn't work on
1822 64-bit machines.
1823 (allocate_pseudovector): Don't use EMACS_INT when int would do.
1824
1825 * alloc.c (Fmake_bool_vector): Don't assume vector size fits in int.
1826 (allocate_vectorlike): Check for ptrdiff_t overflow.
1827 (mark_vectorlike, mark_char_table, mark_object): Avoid EMACS_UINT
1828 when a (possibly-narrower) signed value would do just as well.
1829 We prefer using signed arithmetic, to avoid comparison confusion.
1830
1831 * alloc.c: Catch some string size overflows that we were missing.
1832 (XMALLOC_OVERRUN_CHECK_SIZE) [!XMALLOC_OVERRUN_CHECK]: Define to 0,
1833 for convenience in STRING_BYTES_MAX.
1834 (STRING_BYTES_MAX): New macro, superseding the old one in lisp.h.
1835 The definition here is exact; the one in lisp.h was approximate.
1836 (allocate_string_data): Check for string overflow. This catches
1837 some instances we weren't catching before. Also, it catches
1838 size_t overflow on (unusual) hosts where SIZE_MAX <= min
1839 (PTRDIFF_MAX, MOST_POSITIVE_FIXNUM), e.g., when size_t is 32 bits
1840 and ptrdiff_t and EMACS_INT are both 64 bits.
1841
1842 * character.c, coding.c, doprnt.c, editfns.c, eval.c:
1843 All uses of STRING_BYTES_MAX replaced by STRING_BYTES_BOUND.
1844 * lisp.h (STRING_BYTES_BOUND): Renamed from STRING_BYTES_MAX.
1845
1846 * character.c (string_escape_byte8): Fix nbytes/nchars typo.
1847
1848 * alloc.c (Fmake_string): Check for out-of-range init.
1849
1850 2011-06-15 Stefan Monnier <monnier@iro.umontreal.ca>
1851
1852 * eval.c (Fdefvaralias): Also mark the target as variable-special-p.
1853
1854 2011-06-14 Jan Djärv <jan.h.d@swipnet.se>
1855
1856 * xfns.c (x_set_scroll_bar_default_width): Remove argument to
1857 xg_get_default_scrollbar_width.
1858
1859 * gtkutil.c: Include emacsgtkfixed.h if HAVE_GTK3.
1860 (int_gtk_range_get_value): Move to the scroll bar part of the file.
1861 (style_changed_cb): Call update_theme_scrollbar_width and call
1862 x_set_scroll_bar_default_width and xg_frame_set_char_size for
1863 all frames (Bug#8505).
1864 (xg_create_frame_widgets): Call emacs_fixed_new if HAVE_GTK3 (Bug#8505).
1865 Call gtk_window_set_resizable if HAVE_GTK3.
1866 (x_wm_set_size_hint): Call emacs_fixed_set_min_size with min width
1867 and height if HAVE_GTK3 (Bug#8505).
1868 (scroll_bar_width_for_theme): New variable.
1869 (update_theme_scrollbar_width): New function.
1870 (xg_get_default_scrollbar_width): Move code to
1871 update_theme_scrollbar_width, just return scroll_bar_width_for_theme.
1872 (xg_initialize): Call update_theme_scrollbar_width.
1873
1874 * gtkutil.h (xg_get_default_scrollbar_width): Remove argument.
1875
1876 * emacsgtkfixed.c, emacsgtkfixed.h: New files.
1877
1878 2011-06-12 Martin Rudalics <rudalics@gmx.at>
1879
1880 * frame.c (make_frame): Call other_buffer_safely instead of
1881 other_buffer.
1882
1883 * window.c (temp_output_buffer_show): Call display_buffer with
1884 second argument Vtemp_buffer_show_specifiers and reset latter
1885 immediately after the call.
1886 (Vtemp_buffer_show_specifiers): New variable.
1887 (auto_window_vscroll_p, next_screen_context_lines)
1888 (Vscroll_preserve_screen_position): Remove leading asterisks from
1889 doc-strings.
1890
1891 2011-06-12 Paul Eggert <eggert@cs.ucla.edu>
1892
1893 Fix minor problems found by GCC 4.6.0 static checking.
1894 * buffer.c (Qclone_number): Remove for now, as it's unused.
1895 (record_buffer, Funrecord_buffer): Rename local to avoid shadowing.
1896 (record_buffer): Remove unused local.
1897 * frame.c (other_visible_frames, frame_buffer_list): Now static.
1898 (set_frame_buffer_list): Remove; unused.
1899 * frame.h (other_visible_frames): Remove decl.
1900 * keyboard.h (menu_items_inuse): Declare only if USE_GTK || USE_MOTIF.
1901 * lisp.h (frame_buffer_list, set_frame_buffer_list): Remove decls.
1902 (add_gpm_wait_descriptor, delete_gpm_wait_descriptor): Declare only
1903 if HAVE_GPM.
1904 * menu.c (menu_items_inuse): Now static unless USE_GTK || USE_MOTIF.
1905 * process.c (add_gpm_wait_descriptor, delete_gpm_wait_descriptor):
1906 Define only if HAVE_GPM.
1907 * widget.c (EmacsFrameResize, emacsFrameClassRec): Now static.
1908 (update_hints_inhibit): Remove; never set. All uses removed.
1909 * widgetprv.h (emacsFrameClassRec): Remove decl.
1910 * window.c (delete_deletable_window): Now returns void, since it
1911 wasn't returning anything.
1912 (compare_window_configurations): Remove unused locals.
1913 * xfns.c (x_set_scroll_bar_default_width): Remove unused locals.
1914 * xmenu.c (x_menu_set_in_use): Define only if USE_GTK || USE_MOTIF.
1915 (dialog_selection_callback) [!USE_GTK]: Prefer intptr_t for integers
1916 the same widths as pointers. This follows up on the 2011-05-06 patch.
1917 * xterm.c (x_alloc_lighter_color_for_widget): Define only if USE_LUCID.
1918 * xterm.h: Likewise.
1919 (x_menu_set_in_use): Declare only if USE_GTK || USE_MOTIF.
1920
1921 2011-06-12 Juanma Barranquero <lekktu@gmail.com>
1922
1923 * makefile.w32-in: Update dependencies.
1924 (LISP_H): Add lib/intprops.h.
1925
1926 2011-06-11 Chong Yidong <cyd@stupidchicken.com>
1927
1928 * image.c (gif_load): Add animation frame delay to the metadata.
1929 (syms_of_image): Use DEFSYM. New symbol `delay'.
1930
1931 2011-06-11 Martin Rudalics <rudalics@gmx.at>
1932
1933 * window.c (delete_deletable_window): Re-add.
1934 (Fset_window_configuration): Rewrite to handle dead buffers and
1935 consequently deletable windows.
1936 (window_tree, Fwindow_tree): Remove. Supply functionality in
1937 window.el.
1938 (compare_window_configurations): Simplify code.
1939
1940 2011-06-11 Andreas Schwab <schwab@linux-m68k.org>
1941
1942 * image.c (imagemagick_load_image): Fix type mismatch.
1943 (Fimagemagick_types): Likewise.
1944
1945 * window.h (replace_buffer_in_windows): Declare.
1946
1947 2011-06-11 Martin Rudalics <rudalics@gmx.at>
1948
1949 * buffer.c: New Lisp objects Qbuffer_list_update_hook and
1950 Qclone_number. Remove external declaration of Qdelete_window.
1951 (Fbuffer_list): Rewrite doc-string. Minor restructuring of
1952 code.
1953 (Fget_buffer_create, Fmake_indirect_buffer, Frename_buffer): Run
1954 Qbuffer_list_update_hook if allowed.
1955 (Fother_buffer): Rewrite doc-string. Major rewrite for new
1956 buffer list implementation.
1957 (other_buffer_safely): New function.
1958 (Fkill_buffer): Replace call to replace_buffer_in_all_windows by
1959 calls to replace_buffer_in_windows and
1960 replace_buffer_in_windows_safely. Run Qbuffer_list_update_hook
1961 if allowed.
1962 (record_buffer): Inhibit quitting and rewrite using quittable
1963 functions. Run Qbuffer_list_update_hook if allowed.
1964 (Frecord_buffer, Funrecord_buffer): New functions.
1965 (switch_to_buffer_1, Fswitch_to_buffer): Remove. Move
1966 switch-to-buffer to window.el.
1967 (bury-buffer): Move to window.el.
1968 (Vbuffer_list_update_hook): New variable.
1969
1970 * lisp.h (other_buffer_safely): Add prototype in buffer.c
1971 section.
1972
1973 * window.h (resize_frame_windows): Move up in code.
1974 (Fwindow_frame): Remove EXFUN.
1975 (replace_buffer_in_all_windows): Remove prototype.
1976 (replace_buffer_in_windows_safely): Add prototype.
1977
1978 * window.c: Declare Qdelete_window static again. Move down
1979 declaration of select_count.
1980 (Fnext_window, Fprevious_window): Rewrite doc-strings.
1981 (Fother_window): Move to window.el.
1982 (window_loop): Remove DELETE_BUFFER_WINDOWS and UNSHOW_BUFFER
1983 cases. Add REPLACE_BUFFER_IN_WINDOWS_SAFELY case.
1984 (Fdelete_windows_on, Freplace_buffer_in_windows): Move to
1985 window.el.
1986 (replace_buffer_in_windows): Implement by calling
1987 Qreplace_buffer_in_windows.
1988 (replace_buffer_in_all_windows): Remove with some functionality
1989 moved into replace_buffer_in_windows_safely.
1990 (replace_buffer_in_windows_safely): New function.
1991 (select_window_norecord, select_frame_norecord): Move in front
1992 of run_window_configuration_change_hook. Remove now obsolete
1993 declarations.
1994 (Fset_window_buffer): Rewrite doc-string. Call
1995 Qrecord_window_buffer.
1996 (keys_of_window): Move binding for other-window to window.el.
1997
1998 2011-06-11 Chong Yidong <cyd@stupidchicken.com>
1999
2000 * dispextern.h (struct image): Replace data member, whose int_val
2001 and ptr_val fields were not used by anything, with a single
2002 lisp_val object.
2003
2004 * image.c (Fimage_metadata, make_image, mark_image, tiff_load)
2005 (gif_clear_image, gif_load, imagemagick_load_image)
2006 (gs_clear_image, gs_load): Callers changed.
2007
2008 2011-06-10 Paul Eggert <eggert@cs.ucla.edu>
2009
2010 * buffer.h: Include <time.h>, for time_t.
2011 Needed to build on FreeBSD 8.2. Problem reported by Herbert J. Skuhra.
2012
2013 Fix minor problems found by static checking.
2014
2015 * image.c (PixelGetMagickColor): Declare if ImageMagick headers don't.
2016
2017 Make identifiers static if they are not used in other modules.
2018 * data.c (Qcompiled_function, Qframe, Qvector):
2019 * image.c (QimageMagick, Qsvg):
2020 * minibuf.c (Qmetadata):
2021 * window.c (resize_window_check, resize_root_window): Now static.
2022 * window.h (resize_window_check, resize_root_window): Remove decls.
2023
2024 * window.c (window_deletion_count, delete_deletable_window):
2025 Remove; unused.
2026 (window_body_lines): Now static.
2027 (Fdelete_other_windows_internal): Mark vars as initialized.
2028 Make sure 'resize_failed' is initialized.
2029 (run_window_configuration_change_hook): Rename local to avoid shadowing.
2030 (resize_window_apply): Remove unused local.
2031 * window.h (delete_deletable_window): Remove decl.
2032
2033 * image.c (gif_load, svg_load_image): Rename locals to avoid shadowing.
2034 (imagemagick_load_image): Fix pointer signedness problem by changing
2035 last arg from unsigned char * to char *. All uses changed.
2036 Also, fix a local for similar reasons.
2037 Remove unused locals. Remove locals to avoid shadowing.
2038 (fn_rsvg_handle_free): Remove; unused.
2039 (svg_load, svg_load_image): Fix pointer signedness problem.
2040 (imagemagick_load_image): Don't use garbage pointer image_wand.
2041
2042 * ftfont.c (ftfont_get_metrics, ftfont_drive_otf): Remove unused locals.
2043
2044 2011-06-10 Chong Yidong <cyd@stupidchicken.com>
2045
2046 * image.c (gif_load): Fix omitted cast error introduced by
2047 2011-06-06 change.
2048
2049 2011-06-10 Martin Rudalics <rudalics@gmx.at>
2050
2051 * window.h (resize_proportionally, orig_total_lines)
2052 (orig_top_line): Remove from window structure.
2053 (set_window_height, set_window_width, change_window_heights)
2054 (Fdelete_window): Remove prototypes.
2055 (resize_frame_windows): Remove duplicate declaration.
2056
2057 2011-06-10 Eli Zaretskii <eliz@gnu.org>
2058
2059 * window.h (resize_frame_windows, resize_window_check)
2060 (delete_deletable_window, resize_root_window)
2061 (resize_frame_windows): Declare prototypes.
2062
2063 * window.c (resize_window_apply): Make definition be "static" to
2064 match the prototype.
2065
2066 2011-06-10 Martin Rudalics <rudalics@gmx.at>
2067
2068 * window.c: Remove declarations of Qwindow_size_fixed,
2069 window_min_size_1, window_min_size_2, window_min_size,
2070 size_window, window_fixed_size_p, enlarge_window, delete_window.
2071 Remove static from declaration of Qdelete_window, it's
2072 temporarily needed by Fbury_buffer.
2073 (replace_window): Don't assign orig_top_line and
2074 orig_total_lines.
2075 (Fdelete_window, delete_window): Remove. Window deletion is
2076 handled by window.el.
2077 (window_loop): Remove DELETE_OTHER_WINDOWS case. Replace
2078 Fdelete_window calls with calls to Qdelete_window.
2079 (Fdelete_other_windows): Remove. Deleting other windows is
2080 handled by window.el.
2081 (window_fixed_size_p): Remove. Fixed-sizeness of windows is
2082 handled in window.el.
2083 (window_min_size_2, window_min_size_1, window_min_size): Remove.
2084 Window minimum sizes are handled in window.el.
2085 (shrink_windows, size_window, set_window_height)
2086 (set_window_width, change_window_heights, window_height)
2087 (window_width, CURBEG, CURSIZE, enlarge_window)
2088 (adjust_window_trailing_edge, Fadjust_window_trailing_edge)
2089 (Fenlarge_window, Fshrink_window): Remove. Window resizing is
2090 handled in window.el.
2091 (make_dummy_parent): Rename to make_parent_window and give it a
2092 second argument horflag.
2093 (make_window): Don't set resize_proportionally any more.
2094 (Fsplit_window): Remove. Windows are split in window.el.
2095 (save_restore_action, save_restore_orig_size)
2096 (shrink_window_lowest_first, save_restore_orig_size): Remove.
2097 Resize mini windows in window.el.
2098 (grow_mini_window, shrink_mini_window): Implement by calling
2099 Qresize_root_window_vertically, resize_window_check and
2100 resize_window_apply.
2101 (saved_window, Fset_window_configuration, save_window_save): Do
2102 not handle orig_top_line, orig_total_lines, and
2103 resize_proportionally.
2104 (window_min_height, window_min_width): Move to window.el.
2105 (keys_of_window): Move bindings for delete-other-windows,
2106 split-window, delete-window and enlarge-window to window.el.
2107
2108 * buffer.c: Temporarily extern Qdelete_window.
2109 (Fbury_buffer): Temporarily call Qdelete_window instead of
2110 Fdelete_window (Fbury_buffer will move to window.el soon).
2111
2112 * frame.c (set_menu_bar_lines_1): Remove code handling
2113 orig_top_line and orig_total_lines.
2114
2115 * dispnew.c (adjust_frame_glyphs_initially): Don't use
2116 set_window_height but set heights directly.
2117 (change_frame_size_1): Use resize_frame_windows.
2118
2119 * xdisp.c (init_xdisp): Don't use set_window_height but set
2120 heights directly.
2121
2122 * xfns.c (x_set_menu_bar_lines, x_set_tool_bar_lines): Use
2123 resize_frame_windows instead of change_window_heights and run
2124 run_window_configuration_change_hook.
2125
2126 * w32fns.c (x_set_tool_bar_lines): Use resize_frame_windows
2127 instead of change_window_heights and run
2128 run_window_configuration_change_hook.
2129
2130 2011-06-09 Martin Rudalics <rudalics@gmx.at>
2131
2132 * window.c (replace_window): Rename second argument REPLACEMENT to
2133 NEW. New third argument SETFLAG. Rewrite.
2134 (delete_window, make_dummy_parent): Call replace_window with
2135 third argument 1.
2136 (window_list_1): Move down in code.
2137 (run_window_configuration_change_hook): Move set_buffer part
2138 before select_frame_norecord part in order to unwind correctly.
2139 Rename count1 to count.
2140 (recombine_windows, delete_deletable_window, resize_root_window)
2141 (Fdelete_other_windows_internal)
2142 (Frun_window_configuration_change_hook, make_parent_window)
2143 (resize_window_check, resize_window_apply, Fresize_window_apply)
2144 (resize_frame_windows, Fsplit_window_internal)
2145 (Fdelete_window_internal, Fresize_mini_window_internal): New
2146 functions.
2147 (syms_of_window): New variables Vwindow_splits and Vwindow_nest.
2148
2149 2011-06-08 Martin Rudalics <rudalics@gmx.at>
2150
2151 * window.h (window): Add some new members to window structure -
2152 normal_lines, normal_cols, new_total, new_normal, clone_number,
2153 splits, nest, prev_buffers, next_buffers.
2154 (WINDOW_TOTAL_SIZE): Move here from window.c.
2155 (MIN_SAFE_WINDOW_WIDTH, MIN_SAFE_WINDOW_HEIGHT): Define here.
2156
2157 * window.c (Fwindow_height, Fwindow_width, Fwindow_full_width_p):
2158 Remove.
2159 (make_dummy_parent): Set new members of windows structure.
2160 (make_window): Move down in code. Handle new members of window
2161 structure.
2162 (Fwindow_clone_number, Fwindow_splits, Fset_window_splits)
2163 (Fwindow_nest, Fset_window_nest, Fwindow_new_total)
2164 (Fwindow_normal_size, Fwindow_new_normal, Fwindow_prev_buffers)
2165 (Fset_window_prev_buffers, Fwindow_next_buffers)
2166 (Fset_window_next_buffers, Fset_window_clone_number): New
2167 functions.
2168 (Fwindow_hscroll, Fwindow_at, Fwindow_point, Fwindow_start)
2169 (Fwindow_end, Fwindow_line_height, Fset_window_dedicated_p):
2170 Doc-string fixes.
2171 (Fwindow_parameters, Fwindow_parameter, Fset_window_parameter):
2172 Argument WINDOW can be now internal window too.
2173 (Fwindow_use_time): Move up in code.
2174 (Fget_buffer_window): Rename argument FRAME to ALL-FRAMES.
2175 Rewrite doc-string.
2176 (Fset_window_configuration, saved_window)
2177 (Fcurrent_window_configuration, save_window_save): Handle new
2178 members of window structure.
2179 (WINDOW_TOTAL_SIZE, MIN_SAFE_WINDOW_WIDTH)
2180 (MIN_SAFE_WINDOW_HEIGHT): Move to window.h.
2181 (syms_of_window): New Lisp objects Qrecord_window_buffer,
2182 Qwindow_deletable_p, Qdelete_window, Qreplace_buffer_in_windows,
2183 Qget_mru_window, Qresize_root_window,
2184 Qresize_root_window_vertically, Qsafe, Qabove, Qbelow,
2185 Qauto_buffer_name; staticpro them.
2186
2187 2011-06-07 Martin Rudalics <rudalics@gmx.at>
2188
2189 * window.c (Fwindow_total_size, Fwindow_left_column)
2190 (Fwindow_top_line, window_body_lines, Fwindow_body_size)
2191 (Fwindow_list_1): New functions.
2192 (window_box_text_cols): Replace with window_body_cols.
2193 (Fwindow_width, Fscroll_left, Fscroll_right): Use
2194 window_body_cols instead of window_box_text_cols.
2195 (delete_window, Fset_window_configuration): Call
2196 delete_all_subwindows with window as argument.
2197 (delete_all_subwindows): Take a window as argument and not a
2198 structure. Rewrite.
2199 (window_loop): Remove handling of GET_LRU_WINDOW and
2200 GET_LARGEST_WINDOW.
2201 (Fget_lru_window, Fget_largest_window): Move to window.el.
2202
2203 * window.h: Extern window_body_cols instead of
2204 window_box_text_cols. delete_all_subwindows now takes a
2205 Lisp_Object as argument.
2206
2207 * indent.c (compute_motion, Fcompute_motion): Use
2208 window_body_cols instead of window_box_text_cols.
2209
2210 * frame.c (delete_frame): Call delete_all_subwindows with root
2211 window as argument.
2212
2213 2011-06-07 Daniel Colascione <dan.colascione@gmail.com>
2214
2215 * fns.c (Fputhash): Document return value.
2216
2217 2011-06-06 Chong Yidong <cyd@stupidchicken.com>
2218
2219 * image.c (gif_load): Implement gif89a spec "no disposal" method.
2220
2221 2011-06-06 Paul Eggert <eggert@cs.ucla.edu>
2222
2223 Cons<->int and similar integer overflow fixes (Bug#8794).
2224
2225 Check for overflow when converting integer to cons and back.
2226 * charset.c (Fdefine_charset_internal, Fdecode_char):
2227 Use cons_to_unsigned to catch overflow.
2228 (Fencode_char): Use INTEGER_TO_CONS.
2229 * composite.h (LGLYPH_CODE): Use cons_to_unsigned.
2230 (LGLYPH_SET_CODE): Use INTEGER_TO_CONS.
2231 * data.c (long_to_cons, cons_to_long): Remove.
2232 (cons_to_unsigned, cons_to_signed): New functions.
2233 These signal an error for invalid or out-of-range values.
2234 * dired.c (Ffile_attributes): Use INTEGER_TO_CONS.
2235 * fileio.c (Fset_visited_file_modtime): Use CONS_TO_INTEGER.
2236 * font.c (Ffont_variation_glyphs):
2237 * fontset.c (Finternal_char_font): Use INTEGER_TO_CONS.
2238 * lisp.h: Include <intprops.h>.
2239 (INTEGER_TO_CONS, CONS_TO_INTEGER): New macros.
2240 (cons_to_signed, cons_to_unsigned): New decls.
2241 (long_to_cons, cons_to_long): Remove decls.
2242 * undo.c (record_first_change): Use INTEGER_TO_CONS.
2243 (Fprimitive_undo): Use CONS_TO_INTEGER.
2244 * xfns.c (Fx_window_property): Likewise.
2245 * xselect.c: Include <limits.h>.
2246 (x_own_selection, selection_data_to_lisp_data):
2247 Use INTEGER_TO_CONS.
2248 (x_handle_selection_request, x_handle_selection_clear)
2249 (x_get_foreign_selection, Fx_disown_selection_internal)
2250 (Fx_get_atom_name, x_send_client_event): Use CONS_TO_INTEGER.
2251 (lisp_data_to_selection_data): Use cons_to_unsigned.
2252 (x_fill_property_data): Use cons_to_signed.
2253 Report values out of range.
2254
2255 Check for buffer and string overflow more precisely.
2256 * buffer.h (BUF_BYTES_MAX): New macro.
2257 * lisp.h (STRING_BYTES_MAX): New macro.
2258 * alloc.c (Fmake_string):
2259 * character.c (string_escape_byte8):
2260 * coding.c (coding_alloc_by_realloc):
2261 * doprnt.c (doprnt):
2262 * editfns.c (Fformat):
2263 * eval.c (verror):
2264 Use STRING_BYTES_MAX, not MOST_POSITIVE_FIXNUM,
2265 since they may not be the same number.
2266 * editfns.c (Finsert_char):
2267 * fileio.c (Finsert_file_contents):
2268 Likewise for BUF_BYTES_MAX.
2269
2270 * image.c: Use ptrdiff_t, not int, for sizes.
2271 (slurp_file): Switch from int to ptrdiff_t.
2272 All uses changed.
2273 (slurp_file): Check that file size fits in both size_t (for
2274 malloc) and ptrdiff_t (for sanity and safety).
2275
2276 * fileio.c (Fverify_visited_file_modtime): Avoid time overflow
2277 if b->modtime has its maximal value.
2278
2279 * dired.c (Ffile_attributes): Don't assume EMACS_INT has >32 bits.
2280
2281 Don't assume time_t can fit into int.
2282 * buffer.h (struct buffer.modtime): Now time_t, not int.
2283 * fileio.c (Fvisited_file_modtime): No need for time_t cast now.
2284 * undo.c (Fprimitive_undo): Use time_t, not int, for time_t value.
2285
2286 Minor fixes for signed vs unsigned integers.
2287 * character.h (MAYBE_UNIFY_CHAR):
2288 * charset.c (maybe_unify_char):
2289 * keyboard.c (read_char, reorder_modifiers):
2290 XINT -> XFASTINT, since the integer must be nonnegative.
2291 * ftfont.c (ftfont_spec_pattern):
2292 * keymap.c (access_keymap, silly_event_symbol_error):
2293 XUINT -> XFASTINT, since the integer must be nonnegative.
2294 (Fsingle_key_description, preferred_sequence_p): XUINT -> XINT,
2295 since it makes no difference and we prefer signed.
2296 * keyboard.c (record_char): Use XUINT when all the neighbors do.
2297 (access_keymap): NATNUMP -> INTEGERP, since the integer must be
2298 nonnegative.
2299
2300 2011-06-06 Stefan Monnier <monnier@iro.umontreal.ca>
2301
2302 * window.h (Fwindow_frame): Declare.
2303
2304 2011-06-06 Paul Eggert <eggert@cs.ucla.edu>
2305
2306 * alloc.c: Simplify handling of large-request failures (Bug#8800).
2307 (SPARE_MEMORY): Always define.
2308 (LARGE_REQUEST): Remove.
2309 (memory_full): Use SPARE_MEMORY rather than LARGE_REQUEST.
2310
2311 2011-06-06 Martin Rudalics <rudalics@gmx.at>
2312
2313 * lisp.h: Move EXFUNS for Fframe_root_window,
2314 Fframe_first_window and Fset_frame_selected_window to window.h.
2315
2316 * window.h: Move EXFUNS for Fframe_root_window,
2317 Fframe_first_window and Fset_frame_selected_window here from
2318 lisp.h.
2319
2320 * frame.c (Fwindow_frame, Fframe_first_window)
2321 (Fframe_root_window, Fframe_selected_window)
2322 (Fset_frame_selected_window): Move to window.c.
2323 (Factive_minibuffer_window): Move to minibuf.c.
2324 (Fother_visible_frames_p): New function.
2325
2326 * minibuf.c (Factive_minibuffer_window): Move here from frame.c.
2327
2328 * window.c (decode_window, decode_any_window): Move up in code.
2329 (Fwindowp, Fwindow_live_p): Rewrite doc-strings.
2330 (inhibit_frame_unsplittable): Remove unused variable.
2331 (Fwindow_buffer): Move up and rewrite doc-string.
2332 (Fwindow_parent, Fwindow_vchild, Fwindow_hchild, Fwindow_next)
2333 (Fwindow_prev): New functions.
2334 (Fwindow_frame): Move here from frame.c. Accept any window as
2335 argument.
2336 (Fframe_root_window, Fframe_first_window)
2337 (Fframe_selected_window): Move here from frame.c. Accept frame
2338 or arbitrary window as argument. Update doc-strings.
2339 (Fminibuffer_window): Move up in code.
2340 (Fwindow_minibuffer_p): Move up in code and simplify.
2341 (Fset_frame_selected_window): Move here from frame.c.
2342 Marginal rewrite.
2343 (Fselected_window, select_window, Fselect_window): Move up in
2344 code. Minor doc-string fixes.
2345
2346 2011-06-06 Paul Eggert <eggert@cs.ucla.edu>
2347
2348 * alloc.c (memory_full) [SYSTEM_MALLOC]: Port to MacOS (Bug#8800).
2349 Do not assume that spare memory exists; that assumption is valid
2350 only if SYSTEM_MALLOC.
2351 (LARGE_REQUEST): New macro, so that the issue of large requests
2352 is separated from the issue of spare memory.
2353
2354 2011-06-05 Andreas Schwab <schwab@linux-m68k.org>
2355
2356 * editfns.c (Fformat): Correctly handle zero flag with hexadecimal
2357 format. (Bug#8806)
2358
2359 * gtkutil.c (xg_get_default_scrollbar_width): Avoid warning.
2360
2361 * xfns.c (x_set_scroll_bar_default_width): Move declarations
2362 before statements.
2363
2364 2011-06-05 Jan Djärv <jan.h.d@swipnet.se>
2365
2366 * gtkutil.c (xg_get_default_scrollbar_width): New function.
2367
2368 * gtkutil.h: Declare xg_get_default_scrollbar_width.
2369
2370 * xfns.c (x_set_scroll_bar_default_width): If USE_GTK, get
2371 min width by calling x_set_scroll_bar_default_width (Bug#8505).
2372
2373 2011-06-05 Juanma Barranquero <lekktu@gmail.com>
2374
2375 * xdisp.c (single_display_spec_intangible_p): Remove declaration.
2376
2377 2011-06-04 Chong Yidong <cyd@stupidchicken.com>
2378
2379 * xselect.c (x_clipboard_manager_save): Remove redundant arg.
2380 (x_clipboard_manager_save): Add return value.
2381 (x_clipboard_manager_error_1, x_clipboard_manager_error_2):
2382 New error handlers.
2383 (x_clipboard_manager_save_frame, x_clipboard_manager_save_all):
2384 Obey Vx_select_enable_clipboard_manager. Catch errors in
2385 x_clipboard_manager_save (Bug#8779).
2386 (Vx_select_enable_clipboard_manager): New variable.
2387 (x_get_foreign_selection): Reduce scope of x_catch_errors (Bug#8790).
2388
2389 2011-06-04 Dan Nicolaescu <dann@ics.uci.edu>
2390
2391 * emacs.c (main): Warn when starting a GTK emacs in daemon mode.
2392
2393 2011-06-04 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
2394
2395 * fringe.c (update_window_fringes): Don't update overlay arrow bitmap
2396 in the current matrix if keep_current_p is non-zero.
2397
2398 2011-06-04 Eli Zaretskii <eliz@gnu.org>
2399
2400 * bidi.c (bidi_level_of_next_char): Fix last change.
2401
2402 2011-06-03 Eli Zaretskii <eliz@gnu.org>
2403
2404 Support bidi reordering of text covered by display properties.
2405
2406 * bidi.c (bidi_copy_it): Use offsetof instead of emulating it.
2407 (bidi_fetch_char, bidi_fetch_char_advance): New functions.
2408 (bidi_cache_search, bidi_cache_iterator_state)
2409 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak)
2410 (bidi_level_of_next_char, bidi_move_to_visually_next):
2411 Support character positions inside a run of characters covered by a
2412 display string.
2413 (bidi_paragraph_init, bidi_resolve_explicit_1)
2414 (bidi_level_of_next_char): Call bidi_fetch_char and
2415 bidi_fetch_char_advance instead of FETCH_CHAR and
2416 FETCH_CHAR_ADVANCE.
2417 (bidi_init_it): Initialize new members.
2418 (LRE_CHAR, RLE_CHAR, PDF_CHAR, LRO_CHAR, RLO_CHAR): Remove macro
2419 definitions.
2420 (bidi_explicit_dir_char): Lookup character type in bidi_type_table,
2421 instead of using explicit *_CHAR codes.
2422 (bidi_resolve_explicit, bidi_resolve_weak):
2423 Use FETCH_MULTIBYTE_CHAR instead of FETCH_CHAR, as reordering of
2424 bidirectional text is supported only in multibyte buffers.
2425 (bidi_init_it): Accept additional argument FRAME_WINDOW_P and use
2426 it to initialize the frame_window_p member of struct bidi_it.
2427 (bidi_cache_iterator_state, bidi_resolve_explicit_1)
2428 (bidi_resolve_explicit, bidi_resolve_weak)
2429 (bidi_level_of_next_char, bidi_move_to_visually_next): Abort if
2430 bidi_it->nchars is non-positive.
2431 (bidi_level_of_next_char): Don't try to lookup the cache for the
2432 next/previous character if nothing is cached there yet, or if we
2433 were just reseat()'ed to a new position.
2434
2435 * xdisp.c (set_cursor_from_row): Set start and stop points
2436 according to the row's direction when priming the loop that looks
2437 for the glyph on which to display cursor.
2438 (single_display_spec_intangible_p): Function deleted.
2439 (display_prop_intangible_p): Reimplement to call
2440 handle_display_spec instead of single_display_spec_intangible_p.
2441 Accept 3 additional arguments needed by handle_display_spec.
2442 This fixes incorrect cursor motion across display property with complex
2443 values: lists, `(when COND...)' forms, etc.
2444 (single_display_spec_string_p): Support property values that are
2445 lists with the argument STRING its top-level element.
2446 (display_prop_string_p): Fix the condition for processing a
2447 property that is a list to be consistent with handle_display_spec.
2448 (handle_display_spec): New function, refactored from the
2449 last portion of handle_display_prop.
2450 (compute_display_string_pos): Accept additional argument
2451 FRAME_WINDOW_P. Call handle_display_spec to determine whether the
2452 value of a `display' property is a "replacing spec".
2453 (handle_single_display_spec): Accept 2 additional arguments BUFPOS
2454 and FRAME_WINDOW_P. If IT is NULL, don't set up the iterator from
2455 the display property, but just return a value indicating whether
2456 the display property will replace the characters it covers.
2457 (Fcurrent_bidi_paragraph_direction): Initialize the nchars and
2458 frame_window_p members of struct bidi_it.
2459 (compute_display_string_pos, compute_display_string_end):
2460 New functions.
2461 (push_it): Accept second argument POSITION, where pop_it should
2462 jump to continue iteration.
2463 (reseat_1): Initialize bidi_it.disp_pos.
2464
2465 * keyboard.c (adjust_point_for_property): Adjust the call to
2466 display_prop_intangible_p to its new signature.
2467
2468 * dispextern.h (struct bidi_it): New member frame_window_p.
2469 (bidi_init_it): Update prototypes.
2470 (display_prop_intangible_p): Update prototype.
2471 (compute_display_string_pos, compute_display_string_end):
2472 Declare prototypes.
2473 (struct bidi_it): New members nchars and disp_pos. ch_len is now
2474 EMACS_INT.
2475
2476 2011-06-02 Paul Eggert <eggert@cs.ucla.edu>
2477
2478 Malloc failure behavior now depends on size of allocation.
2479 * alloc.c (buffer_memory_full, memory_full): New arg NBYTES.
2480 * lisp.h: Change signatures accordingly.
2481 * alloc.c, buffer.c, editfns.c, menu.c, minibuf.c, xterm.c:
2482 All callers changed. (Bug#8762)
2483
2484 * gnutls.c: Use Emacs's memory allocators.
2485 Without this change, the gnutls library would invoke malloc etc.
2486 directly, which causes problems on non-SYNC_INPUT hosts, and which
2487 runs afoul of improving memory_full behavior. (Bug#8761)
2488 (fn_gnutls_global_set_mem_functions): New macro or function pointer.
2489 (emacs_gnutls_global_init): Use it to specify xmalloc, xrealloc,
2490 xfree instead of the default malloc, realloc, free.
2491 (Fgnutls_boot): No need to check for memory allocation failure,
2492 since xmalloc does that for us.
2493
2494 Remove arbitrary limit of 2**31 entries in hash tables. (Bug#8771)
2495 * category.c (hash_get_category_set):
2496 * ccl.c (ccl_driver):
2497 * charset.c (Fdefine_charset_internal):
2498 * charset.h (struct charset.hash_index):
2499 * composite.c (get_composition_id, gstring_lookup_cache)
2500 (composition_gstring_put_cache):
2501 * composite.h (struct composition.hash_index):
2502 * dispextern.h (struct image.hash):
2503 * fns.c (next_almost_prime, larger_vector, cmpfn_eql)
2504 (cmpfn_equal, cmpfn_user_defined, hashfn_eq, hashfn_eql)
2505 (hashfn_equal, hashfn_user_defined, make_hash_table)
2506 (maybe_resize_hash_table, hash_lookup, hash_put)
2507 (hash_remove_from_table, hash_clear, sweep_weak_table, SXHASH_COMBINE)
2508 (sxhash_string, sxhash_list, sxhash_vector, sxhash_bool_vector)
2509 (Fsxhash, Fgethash, Fputhash, Fmaphash):
2510 * image.c (make_image, search_image_cache, lookup_image)
2511 (xpm_put_color_table_h):
2512 * lisp.h (struct Lisp_Hash_Table):
2513 * minibuf.c (Ftry_completion, Fall_completions, Ftest_completion):
2514 * print.c (print): Use 'EMACS_UINT' and 'EMACS_INT'
2515 for hashes and hash indexes, instead of 'unsigned' and 'int'.
2516 * alloc.c (allocate_vectorlike):
2517 Check for overflow in vector size calculations.
2518 * ccl.c (ccl_driver):
2519 Check for overflow when converting EMACS_INT to int.
2520 * fns.c, image.c: Remove unnecessary static decls that would otherwise
2521 need to be updated by these changes.
2522 * fns.c (make_hash_table, maybe_resize_hash_table):
2523 Check for integer overflow with large hash tables.
2524 (make_hash_table, maybe_resize_hash_table, Fmake_hash_table):
2525 Prefer the faster XFLOAT_DATA to XFLOATINT where either will do.
2526 (SXHASH_REDUCE): New macro.
2527 (sxhash_string, sxhash_list, sxhash_vector, sxhash_bool_vector):
2528 Use it instead of discarding useful hash info with large hash values.
2529 (sxhash_float): New function.
2530 (sxhash): Use it. No more need for "& INTMASK" due to above changes.
2531 * lisp.h (FIXNUM_BITS): New macro, useful for SXHASH_REDUCE etc.
2532 (MOST_NEGATIVE_FIXNUM, MOST_POSITIVE_FIXNUM, INTMASK):
2533 Rewrite to use FIXNUM_BITS, as this simplifies things.
2534 (next_almost_prime, larger_vector, sxhash, hash_lookup, hash_put):
2535 Adjust signatures to match updated version of code.
2536 (consing_since_gc): Now EMACS_INT, since a single hash table can
2537 use more than INT_MAX bytes.
2538
2539 2011-06-01 Dan Nicolaescu <dann@ics.uci.edu>
2540
2541 Make it possible to build with GCC-4.6+ -O2 -flto.
2542
2543 * emacs.c (__malloc_initialize_hook): Mark as EXTERNALLY_VISIBLE.
2544
2545 2011-06-01 Stefan Monnier <monnier@iro.umontreal.ca>
2546
2547 * minibuf.c (get_minibuffer, read_minibuf_unwind):
2548 Call minibuffer-inactive-mode.
2549
2550 2011-05-31 Juanma Barranquero <lekktu@gmail.com>
2551
2552 * makefile.w32-in ($(BLD)/data.$(O), $(BLD)/editfns.$(O)):
2553 Update dependencies.
2554
2555 2011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
2556
2557 * data.c (init_data): Remove code for UTS, this system is not
2558 supported anymore.
2559
2560 2011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
2561
2562 Don't force ./temacs to start in terminal mode.
2563
2564 * frame.c (make_initial_frame): Initialize faces in all cases, not
2565 only when CANNOT_DUMP is defined.
2566 * dispnew.c (init_display): Remove CANNOT_DUMP condition.
2567
2568 2011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
2569
2570 * dispnew.c (add_window_display_history): Use const for the string
2571 pointer. Remove declaration, not needed.
2572
2573 2011-05-31 Paul Eggert <eggert@cs.ucla.edu>
2574
2575 Use 'inline', not 'INLINE'.
2576 <http://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00914.html>
2577 * alloc.c, fontset.c (INLINE): Remove.
2578 * alloc.c, bidi.c, charset.c, coding.c, dispnew.c, fns.c, image.c:
2579 * intervals.c, keyboard.c, process.c, syntax.c, textprop.c, w32term.c:
2580 * xdisp.c, xfaces.c, xterm.c: Replace all uses of INLINE with inline.
2581 * gmalloc.c (register_heapinfo): Use inline unconditionally.
2582 * lisp.h (LISP_MAKE_RVALUE): Use inline, not __inline__.
2583
2584 2011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
2585
2586 Make it possible to run ./temacs.
2587
2588 * callproc.c (set_initial_environment): Remove CANNOT_DUMP code,
2589 syms_of_callproc does the same thing. Remove test for
2590 "initialized", do it in the caller.
2591 * emacs.c (main): Avoid calling set_initial_environment when dumping.
2592
2593 2011-05-31 Stefan Monnier <monnier@iro.umontreal.ca>
2594
2595 * minibuf.c (Finternal_complete_buffer): Return `category' metadata.
2596 (read_minibuf): Use get_minibuffer.
2597 (syms_of_minibuf): Use DEFSYM.
2598 (Qmetadata): New var.
2599 * data.c (Qbuffer): Don't make it static.
2600 (syms_of_data): Use DEFSYM.
2601
2602 2011-05-31 Paul Eggert <eggert@cs.ucla.edu>
2603
2604 * ccl.c (CCL_CODE_RANGE): Allow negative numbers. (Bug#8751)
2605 (CCL_CODE_MIN): New macro.
2606
2607 2011-05-30 Paul Eggert <eggert@cs.ucla.edu>
2608
2609 * alloc.c (lisp_align_malloc): Omit unnecessary val==NULL tests.
2610
2611 * eval.c (Qdebug): Now static.
2612 * lisp.h (Qdebug): Remove decl. This reverts a part of the
2613 2011-04-26T11:26:05Z!dan.colascione@gmail.com that inadvertently undid part of
2614 2011-04-14T06:48:41Z!eggert@cs.ucla.edu.
2615
2616 2011-05-29 Chong Yidong <cyd@stupidchicken.com>
2617
2618 * image.c: Various fixes to ImageMagick code comments.
2619 (Fimagemagick_types): Doc fix.
2620
2621 2011-05-29 Paul Eggert <eggert@cs.ucla.edu>
2622
2623 Minor fixes prompted by GCC 4.6.0 warnings.
2624
2625 * xselect.c (converted_selections, conversion_fail_tag): Now static.
2626
2627 * emacs.c [HAVE_X_WINDOWS]: Include "xterm.h".
2628 (x_clipboard_manager_save_all): Move extern decl to ...
2629 * xterm.h: ... here, so that it can be checked for consistency.
2630
2631 2011-05-29 Chong Yidong <cyd@stupidchicken.com>
2632
2633 * xselect.c (x_clipboard_manager_save_frame)
2634 (x_clipboard_manager_save_all): New functions.
2635 (Fx_clipboard_manager_save): Lisp function deleted.
2636
2637 * emacs.c (Fkill_emacs): Call x_clipboard_manager_save_all.
2638 * frame.c (delete_frame): Call x_clipboard_manager_save_frame.
2639
2640 * xterm.h: Update prototype.
2641
2642 2011-05-28 William Xu <william.xwl@gmail.com>
2643
2644 * nsterm.m (ns_term_shutdown): Synchronize user defaults before
2645 exiting (Bug#8239).
2646
2647 2011-05-28 Jim Meyering <meyering@redhat.com>
2648
2649 Avoid a sign-extension bug in crypto_hash_function.
2650 * fns.c (to_uchar): Define.
2651 (crypto_hash_function): Use it to convert some newly-signed
2652 variables to unsigned, to avoid sign-extension bugs. For example,
2653 without this change, (md5 "truc") would evaluate to
2654 45723a2aff78ff4fff7fff1114760e62 rather than the expected
2655 45723a2af3788c4ff17f8d1114760e62. Reported by Antoine Levitt in
2656 https://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00883.html.
2657
2658 2011-05-27 Paul Eggert <eggert@cs.ucla.edu>
2659
2660 Integer overflow fixes.
2661
2662 * dbusbind.c: Serial number integer overflow fixes.
2663 (CHECK_DBUS_SERIAL_GET_SERIAL): New macro.
2664 (Fdbus_call_method_asynchronously, xd_read_message_1): Use a float
2665 to hold a serial number that is too large for a fixnum.
2666 (Fdbus_method_return_internal, Fdbus_method_error_internal):
2667 Check for serial numbers out of range. Decode any serial number
2668 that was so large that it became a float. (Bug#8722)
2669
2670 * dbusbind.c: Use XFASTINT rather than XUINT, and check for nonneg.
2671 (Fdbus_call_method, Fdbus_call_method_asynchronously):
2672 Use XFASTINT rather than XUINT when numbers are nonnegative.
2673 (xd_append_arg, Fdbus_method_return_internal):
2674 (Fdbus_method_error_internal): Likewise. Also, for unsigned
2675 arguments, check that Lisp number is nonnegative, rather than
2676 silently wrapping negative numbers around. (Bug#8722)
2677 (xd_read_message_1): Don't assume dbus_uint32_t can fit in int.
2678 (Bug#8722)
2679
2680 * data.c (arith_driver, Flsh): Avoid unnecessary casts to EMACS_UINT.
2681
2682 * ccl.c (ccl_driver): Redo slightly to avoid the need for 'unsigned'.
2683
2684 ccl: add integer overflow checks
2685 * ccl.c (CCL_CODE_MAX, GET_CCL_RANGE, GET_CCL_CODE, GET_CCL_INT):
2686 (IN_INT_RANGE): New macros.
2687 (ccl_driver): Use them to check for integer overflow when
2688 decoding a CCL program. Many of the new checks are whether XINT (x)
2689 fits in int; it doesn't always, on 64-bit hosts. The new version
2690 doesn't catch all possible integer overflows, but it's an
2691 improvement. (Bug#8719)
2692
2693 * alloc.c (make_event_array): Use XINT, not XUINT.
2694 There's no need for unsigned here.
2695
2696 * mem-limits.h (EXCEEDS_LISP_PTR) [!USE_LSB_TAG]: EMACS_UINT -> uintptr_t
2697 This follows up to the 2011-05-06 change that substituted uintptr_t
2698 for EMACS_INT. This case wasn't caught back then.
2699
2700 Rework Fformat to avoid integer overflow issues.
2701 * editfns.c: Include <float.h> unconditionally, as it's everywhere
2702 now (part of C89). Include <verify.h>.
2703 (MAX_10_EXP, CONVERTED_BYTE_SIZE): Remove; no longer needed.
2704 (pWIDE, pWIDElen, signed_wide, unsigned_wide): New defns.
2705 (Fformat): Avoid the prepass trying to compute sizes; it was only
2706 approximate and thus did not catch overflow reliably. Instead, walk
2707 through the format just once, formatting and computing sizes as we go,
2708 checking for integer overflow at every step, and allocating a larger
2709 buffer as needed. Keep track separately whether the format is
2710 multibyte. Keep only the most-recently calculated precision, rather
2711 than them all. Record whether each argument has been converted to
2712 string. Use EMACS_INT, not int, for byte and char and arg counts.
2713 Support field widths and precisions larger than INT_MAX. Avoid
2714 sprintf's undefined behavior with conversion specifications such as %#d
2715 and %.0c. Fix bug with strchr succeeding on '\0' when looking for
2716 flags. Fix bug with (format "%c" 256.0). Avoid integer overflow when
2717 formatting out-of-range floating point numbers with int
2718 formats. (Bug#8668)
2719
2720 * lisp.h (FIXNUM_OVERFLOW_P): Work even if arg is a NaN.
2721
2722 * data.c: Avoid integer truncation in expressions involving floats.
2723 * data.c: Include <intprops.h>.
2724 (arith_driver): When there's an integer overflow in an expression
2725 involving floating point, convert the integers to floating point
2726 so that the resulting value does not suffer from catastrophic
2727 integer truncation. For example, on a 64-bit host (* 4
2728 most-negative-fixnum 0.5) should yield about -4.6e+18, not zero.
2729 Do not rely on undefined behavior after integer overflow.
2730
2731 merge count_size_as_multibyte, parse_str_to_multibyte
2732 * character.c, character.h (count_size_as_multibyte):
2733 Rename from parse_str_to_multibyte; all uses changed.
2734 Check for integer overflow.
2735 * insdel.c, lisp.h (count_size_as_multibyte): Remove,
2736 since it's now a duplicate of the other. This is more of
2737 a character than a buffer op, so better that it's in character.c.
2738 * fns.c, print.c: Adjust to above changes.
2739
2740 2011-05-27 Stefan Monnier <monnier@iro.umontreal.ca>
2741
2742 * xselect.c (x_convert_selection): Yet another int/Lisp_Object mixup.
2743
2744 2011-05-27 Paul Eggert <eggert@cs.ucla.edu>
2745
2746 * xselect.c: Fix minor problems prompted by GCC 4.6.0 warnings.
2747 (x_handle_selection_request, frame_for_x_selection): Remove unused vars.
2748 (x_clipboard_manager_save): Now static.
2749 (Fx_clipboard_manager_save): Rename local to avoid shadowing.
2750
2751 * fns.c: Fix minor problems prompted by GCC 4.6.0 warnings.
2752 (crypto_hash_function): Now static.
2753 Fix pointer signedness problems. Avoid unnecessary initializations.
2754
2755 2011-05-27 Chong Yidong <cyd@stupidchicken.com>
2756
2757 * termhooks.h (Vselection_alist): Make it terminal-local.
2758
2759 * terminal.c (create_terminal): Initialize it.
2760
2761 * xselect.c: Support for clipboard managers.
2762 (Vselection_alist): Move to termhooks.h as terminal-local var.
2763 (LOCAL_SELECTION): New macro.
2764 (x_atom_to_symbol): Handle x_display_info_for_display fail case.
2765 (symbol_to_x_atom): Remove gratuitous arg.
2766 (x_handle_selection_request, lisp_data_to_selection_data)
2767 (x_get_foreign_selection, Fx_register_dnd_atom): Callers changed.
2768 (x_own_selection, x_get_local_selection, x_convert_selection):
2769 New arg, specifying work frame. Use terminal-local Vselection_alist.
2770 (some_frame_on_display): Delete unused function.
2771 (Fx_own_selection_internal, Fx_get_selection_internal)
2772 (Fx_disown_selection_internal, Fx_selection_owner_p)
2773 (Fx_selection_exists_p): New optional frame arg.
2774 (frame_for_x_selection, Fx_clipboard_manager_save): New functions.
2775 (x_handle_selection_clear): Don't treat other terminals with the
2776 same keyboard specially. Use the terminal-local Vselection_alist.
2777 (x_clear_frame_selections): Use Frun_hook_with_args.
2778
2779 * xterm.c (x_term_init): Intern ATOM and CLIPBOARD_MANAGER atoms.
2780
2781 * xterm.h: Add support for those atoms.
2782
2783 2011-05-26 Chong Yidong <cyd@stupidchicken.com>
2784
2785 * xselect.c: ICCCM-compliant handling of MULTIPLE targets.
2786 (converted_selections, conversion_fail_tag): New global variables.
2787 (x_selection_request_lisp_error): Free the above.
2788 (x_get_local_selection): Remove unnecessary code.
2789 (x_reply_selection_request): Args changed; handle arbitrary array
2790 of converted selections stored in converted_selections.
2791 Separate the XChangeProperty and SelectionNotify steps.
2792 (x_handle_selection_request): Rewrite to handle MULTIPLE target.
2793 (x_convert_selection): New function.
2794 (x_handle_selection_event): Simplify.
2795 (x_get_foreign_selection): Don't ignore incoming requests while
2796 waiting for an answer; this will fail when we implement
2797 SAVE_TARGETS, and seems unnecessary anyway.
2798 (selection_data_to_lisp_data): Recognize ATOM_PAIR type.
2799 (Vx_sent_selection_functions): Doc fix.
2800
2801 2011-05-26 Leo Liu <sdl.web@gmail.com>
2802
2803 * editfns.c (Ftranspose_regions): Allow empty regions. (Bug#8699)
2804
2805 2011-05-25 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
2806
2807 * dispextern.h (struct glyph_row): New member fringe_bitmap_periodic_p.
2808
2809 * dispnew.c (shift_glyph_matrix, scrolling_window): Mark scrolled row
2810 for fringe update if it has periodic bitmap.
2811 (row_equal_p): Also compare left_fringe_offset, right_fringe_offset,
2812 and fringe_bitmap_periodic_p.
2813
2814 * fringe.c (get_fringe_bitmap_data): New function.
2815 (draw_fringe_bitmap_1, update_window_fringes): Use it.
2816 (update_window_fringes): Record periodicity of fringe bitmap in glyph
2817 row. Mark glyph row for fringe update if periodicity changed.
2818
2819 * xdisp.c (try_window_reusing_current_matrix): Don't mark scrolled row
2820 for fringe update unless it has periodic bitmap.
2821
2822 2011-05-25 Kenichi Handa <handa@m17n.org>
2823
2824 * xdisp.c (get_next_display_element): Set correct it->face_id for
2825 a static composition.
2826
2827 2011-05-24 Leo Liu <sdl.web@gmail.com>
2828
2829 * deps.mk (fns.o):
2830 * makefile.w32-in ($(BLD)/fns.$(O)): Include sha1.h.
2831
2832 * fns.c (crypto_hash_function, Fsha1): New function.
2833 (Fmd5): Use crypto_hash_function.
2834 (syms_of_fns): Add Ssha1.
2835
2836 2011-05-22 Paul Eggert <eggert@cs.ucla.edu>
2837
2838 * gnutls.c: Remove unused macros.
2839 (fn_gnutls_transport_set_lowat, fn_gnutls_transport_set_pull_function):
2840 (fn_gnutls_transport_set_push_function) [!WINDOWSNT]:
2841 Remove macros that are defined and never used.
2842 Caught by gcc -Wunused-macros (GCC 4.6.0, Fedora 14).
2843
2844 2011-05-22 Chong Yidong <cyd@stupidchicken.com>
2845
2846 * xselect.c (syms_of_xselect): Remove unused symbol SAVE_TARGETS.
2847 (Fx_get_selection_internal): Minor cleanup.
2848 (Fx_own_selection_internal): Rename arguments for consistency with
2849 select.el.
2850
2851 2011-05-22 Paul Eggert <eggert@cs.ucla.edu>
2852
2853 * xselect.c (QSAVE_TARGETS): New static var, to fix build failure.
2854
2855 2011-05-22 Chong Yidong <cyd@stupidchicken.com>
2856
2857 * xselect.c (syms_of_xselect): Include character.h; use DEFSYM.
2858
2859 2011-05-21 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
2860
2861 * dispnew.c (scrolling_window): Don't exclude the case that the
2862 last enabled row in the desired matrix touches the bottom boundary.
2863
2864 2011-05-21 Glenn Morris <rgm@gnu.org>
2865
2866 * Makefile.in ($(etc)/DOC): Make second command line even shorter.
2867 (SOME_MACHINE_OBJECTS): Replace FONT_OBJ by its maximal expansion,
2868 and add some more files.
2869
2870 2011-05-20 Eli Zaretskii <eliz@gnu.org>
2871
2872 * callproc.c (Fcall_process) [MSDOS]: Fix arguments to
2873 report_file_error introduced by the change from 2011-05-07.
2874
2875 2011-05-20 Paul Eggert <eggert@cs.ucla.edu>
2876
2877 * systime.h (Time): Define only if emacs is defined.
2878 This is to allow ../lib-src/profile.c to be compiled on FreeBSD,
2879 where the include path doesn't have X11/X.h by default. See
2880 <http://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00561.html>.
2881
2882 2011-05-20 Kenichi Handa <handa@m17n.org>
2883
2884 * composite.c (find_automatic_composition): Fix previous change.
2885
2886 2011-05-20 Glenn Morris <rgm@gnu.org>
2887
2888 * lisp.mk: New file, split from Makefile.in.
2889 * Makefile.in (lisp): Move to separate file, inserted by @lisp_frag@.
2890 (shortlisp): Remove.
2891 ($(etc)/DOC): Edit lisp.mk rather than using $shortlisp.
2892
2893 2011-05-19 Glenn Morris <rgm@gnu.org>
2894
2895 * Makefile.in (MSDOS_SUPPORT_REAL, MSDOS_SUPPORT, NS_SUPPORT)
2896 (REAL_MOUSE_SUPPORT, GPM_MOUSE_SUPPORT, MOUSE_SUPPORT, TOOLTIP_SUPPORT)
2897 (BASE_WINDOW_SUPPORT, X_WINDOW_SUPPORT, WINDOW_SUPPORT): Remove.
2898 (lisp): Set the order to that of loadup.el.
2899 (shortlisp): Make it a copy of $lisp.
2900 (SOME_MACHINE_LISP): Remove.
2901 ($(etc)/DOC): Depend just on $lisp, not $SOME_MACHINE_LISP too.
2902 Use just $shortlisp, not $SOME_MACHINE_LISP too.
2903
2904 2011-05-18 Kenichi Handa <handa@m17n.org>
2905
2906 * composite.c (CHAR_COMPOSABLE_P): Add more check for efficiency.
2907 (BACKWARD_CHAR): Wrap the arg STOP by parenthesis.
2908 (find_automatic_composition): Mostly rewrite for efficiency.
2909
2910 2011-05-18 Juanma Barranquero <lekktu@gmail.com>
2911
2912 * makefile.w32-in: Update dependencies.
2913
2914 2011-05-18 Christoph Scholtes <cschol2112@googlemail.com>
2915
2916 * menu.c: Include limits.h (fixes the MS-Windows build broken by
2917 2011-06-18T18:49:19Z!cyd@stupidchicken.com).
2918
2919 2011-05-18 Paul Eggert <eggert@cs.ucla.edu>
2920
2921 Fix some integer overflow issues, such as string length overflow.
2922
2923 * insdel.c (count_size_as_multibyte): Check for string overflow.
2924
2925 * character.c (lisp_string_width): Check for string overflow.
2926 Use EMACS_INT, not int, for string indexes and lengths; in
2927 particular, 2nd arg is now EMACS_INT, not int. Do not crash if
2928 the resulting string length overflows an EMACS_INT; instead,
2929 report a string overflow if no precision given. When checking for
2930 precision exhaustion, use a check that cannot possibly have
2931 integer overflow. (Bug#8675)
2932 * character.h (lisp_string_width): Adjust to new signature.
2933
2934 * alloc.c (string_overflow): New function.
2935 (Fmake_string): Use it. This doesn't change behavior, but saves
2936 a few bytes and will simplify future changes.
2937 * character.c (string_escape_byte8): Likewise.
2938 * lisp.h (string_overflow): New decl.
2939
2940 Fixups, following up to the user-interface timestamp change.
2941 * nsterm.m (last_mouse_movement_time, ns_mouse_position): Use Time
2942 for UI timestamps, instead of unsigned long.
2943 * msdos.c (mouse_get_pos): Likewise.
2944 * w32inevt.c (movement_time, w32_console_mouse_position): Likewise.
2945 * w32gui.h (Time): Define by including "systime.h" rather than by
2946 declaring it ourselves. (Bug#8664)
2947
2948 * dispextern.h (struct image): Don't assume time_t <= unsigned long.
2949 * image.c (clear_image_cache): Likewise.
2950
2951 * term.c (term_mouse_position): Don't assume time_t wraparound.
2952
2953 Be more systematic about user-interface timestamps.
2954 Before, the code sometimes used 'Time', sometimes 'unsigned long',
2955 and sometimes 'EMACS_UINT', to represent these timestamps.
2956 This change causes it to use 'Time' uniformly, as that's what X uses.
2957 This makes the code easier to follow, and makes it easier to catch
2958 integer overflow bugs such as Bug#8664.
2959 * frame.c (Fmouse_position, Fmouse_pixel_position):
2960 Use Time, not unsigned long, for user-interface timestamps.
2961 * keyboard.c (last_event_timestamp, kbd_buffer_get_event): Likewise.
2962 (button_down_time, make_lispy_position, make_lispy_movement): Likewise.
2963 * keyboard.h (last_event_timestamp): Likewise.
2964 * menu.c (Fx_popup_menu) [!HAVE_X_WINDOWS]: Likewise.
2965 * menu.h (xmenu_show): Likewise.
2966 * term.c (term_mouse_position): Likewise.
2967 * termhooks.h (struct input_event.timestamp): Likewise.
2968 (struct terminal.mouse_position_hook): Likewise.
2969 * xmenu.c (create_and_show_popup_menu, xmenu_show): Likewise.
2970 * xterm.c (XTmouse_position, x_scroll_bar_report_motion): Likewise.
2971 * systime.h (Time): New decl. Pull it in from <X11/X.h> if
2972 HAVE_X_WINDOWS, otherwise define it as unsigned long, which is
2973 what it was before.
2974 * menu.h, termhooks.h: Include "systime.h", for Time.
2975
2976 * keyboard.c (make_lispy_event): Fix problem in integer overflow.
2977 Don't assume that the difference between two unsigned long values
2978 can fit into an integer. At this point, we know button_down_time
2979 <= event->timestamp, so the difference must be nonnegative, so
2980 there's no need to cast the result if double-click-time is
2981 nonnegative, as it should be; check that it's nonnegative, just in
2982 case. This bug is triggered when events are more than 2**31 ms
2983 apart (about 25 days). (Bug#8664)
2984
2985 * xselect.c (last_event_timestamp): Remove duplicate decl.
2986 (x_own_selection): Remove needless cast to unsigned long.
2987
2988 * xmenu.c (set_frame_menubar): Use int, not EMACS_UINT, for indexes
2989 that always fit in int. Use a sentinel instead of a counter, to
2990 avoid a temp and to allay GCC's concerns about possible int overflow.
2991 * frame.h (struct frame): Use int for menu_bar_items_used
2992 instead of EMACS_INT, since it always fits in int.
2993
2994 * menu.c (grow_menu_items): Check for int overflow.
2995
2996 * xmenu.c (set_frame_menubar): Don't mishandle vectors with no nils.
2997
2998 * xterm.c: Use EMACS_INT for Emacs modifiers, and int for X modifiers.
2999 Before, the code was not consistent. These values cannot exceed
3000 2**31 - 1 so there's no need to make them unsigned.
3001 (x_x_to_emacs_modifiers): Accept int and return EMACS_INT.
3002 (x_emacs_to_x_modifiers): Accept EMACS_INT and return int.
3003 (x_x_to_emacs_modifiers, x_emacs_to_x_modifiers): Reject non-integers
3004 as modifiers.
3005 * xterm.h (x_x_to_emacs_modifiers): Adjust to signature change.
3006
3007 * lisp.h (XINT) [USE_LISP_UNION_TYPE]: Cast to EMACS_INT.
3008 (XUINT) [USE_LISP_UNION_TYPE]: Cast to EMACS_UINT.
3009 Otherwise, GCC 4.6.0 warns about printf (pI, XINT (...)),
3010 presumably because the widths might not match.
3011
3012 * window.c (size_window): Avoid needless test at loop start.
3013
3014 2011-05-18 Courtney Bane <emacs-bugs-7626@cbane.org> (tiny change)
3015
3016 * term.c (Fresume_tty): Restore hooks before reinitializing (bug#8687).
3017
3018 2011-05-12 Drew Adams <drew.adams@oracle.com>
3019
3020 * textprop.c (Fprevious_single_char_property_change): Doc fix (bug#8655).
3021
3022 2011-05-12 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
3023
3024 * w32term.c (w32_draw_fringe_bitmap): Rename local vars `left' and
3025 `width' to `bar_area_x' and `bar_area_width', respectively.
3026 (x_scroll_run): Take account of fringe background extension.
3027
3028 * xterm.c (x_draw_fringe_bitmap) [USE_TOOLKIT_SCROLL_BARS]:
3029 Rename local vars `left' and `width' to `bar_area_x' and
3030 `bar_area_width', respectively.
3031 (x_scroll_run) [USE_TOOLKIT_SCROLL_BARS]: Take account of fringe
3032 background extension.
3033
3034 2011-05-10 Jim Meyering <meyering@redhat.com>
3035
3036 * xdisp.c (x_intersect_rectangles): Fix typo "the the -> the".
3037
3038 2011-05-10 Juanma Barranquero <lekktu@gmail.com>
3039
3040 * image.c (Finit_image_library): Return t for built-in image types,
3041 like pbm and xbm. (Bug#8640)
3042
3043 2011-05-09 Andreas Schwab <schwab@linux-m68k.org>
3044
3045 * w32menu.c (set_frame_menubar): Fix submenu allocation.
3046
3047 2011-05-07 Eli Zaretskii <eliz@gnu.org>
3048
3049 * w32console.c (Fset_screen_color): Doc fix.
3050 (Fget_screen_color): New function.
3051 (syms_of_ntterm): Defsubr it.
3052
3053 * callproc.c (call_process_cleanup) [MSDOS]: Don't close and
3054 unlink the temporary file if Fcall_process didn't create it in the
3055 first place.
3056 (Fcall_process) [MSDOS]: Don't create tempfile if stdout of the
3057 child process will be redirected to a file specified with `:file'.
3058 Don't try to re-open tempfile in that case, and set fd[0] to -1 as
3059 cue to call_process_cleanup not to close that handle.
3060
3061 2011-05-07 Ben Key <bkey76@gmail.com>
3062
3063 * makefile.w32-in: The bootstrap-temacs rule now makes use of
3064 one of two shell specific rules, either bootstrap-temacs-CMD or
3065 bootstrap-temacs-SH. The bootstrap-temacs-SH rule is identical
3066 to the previous implementation of the bootstrap-temacs rule.
3067 The bootstrap-temacs-CMD rule is similar to the previous
3068 implementation of the bootstrap-temacs rule except that it
3069 makes use of the ESC_CFLAGS variable instead of the CFLAGS
3070 variable.
3071
3072 These changes, along with some changes to nt/configure.bat,
3073 nt/gmake.defs, and nt/nmake.defs, are required to extend my
3074 earlier fix to add support for --cflags and --ldflags options
3075 that include quotes so that it works whether make uses cmd or
3076 sh as the shell.
3077
3078 2011-05-06 Michael Albinus <michael.albinus@gmx.de>
3079
3080 * dbusbind.c (QCdbus_type_unix_fd): Declare static.
3081 (xd_remove_watch): Don't check QCdbus_type_unix_fd for SYMBOLP, it
3082 is a constant.
3083 (Fdbus_init_bus, xd_read_queued_messages): Bus can be a symbol or
3084 a string. Handle both cases.
3085 (Fdbus_call_method_asynchronously, Fdbus_register_signal)
3086 (Fdbus_register_method): Use Qinvalid_function.
3087
3088 2011-05-06 Juanma Barranquero <lekktu@gmail.com>
3089
3090 * makefile.w32-in: Update dependencies.
3091 (LISP_H): Add inttypes.h and stdin.h.
3092 (PROCESS_H): Add unistd.h.
3093
3094 2011-05-06 Eli Zaretskii <eliz@gnu.org>
3095
3096 * lread.c: Include limits.h (fixes the MS-Windows build broken by
3097 2011-05-06T07:13:19Z!eggert@cs.ucla.edu).
3098
3099 2011-05-06 Paul Eggert <eggert@cs.ucla.edu>
3100
3101 * image.c (Finit_image_library) [!HAVE_NTGUI]: Omit unused local.
3102
3103 * term.c (vfatal): Remove stray call to va_end.
3104 It's not needed and the C Standard doesn't allow it here anyway.
3105
3106 Use C99's va_copy to avoid undefined behavior on x86-64 GNU/Linux.
3107 * eval.c (verror): doprnt a copy of ap, not the original. (Bug#8545)
3108
3109 * eval.c (verror): OK to create a string of up to MOST_POSITIVE_FIXNUM
3110 bytes.
3111
3112 * term.c: Don't include <stdarg.h>, as <lisp.h> does that.
3113
3114 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork clobbering.
3115
3116 * process.c (Fformat_network_address): Fix typo: args2 -> *args2.
3117
3118 * xmenu.c (set_frame_menubar): Fix typo: int * -> int (3 times).
3119
3120 * coding.c (detect_coding_charset): Fix typo: * 2 -> *4 (Bug#8601).
3121
3122 * charset.h (struct charset.code_space): Now has 15 elements, not 16.
3123 * charset.c (Fdefine_charset_internal): Don't initialize
3124 charset.code_space[15]. The value was garbage, on hosts with
3125 32-bit int (Bug#8600).
3126
3127 * lread.c (read_integer): Be more consistent with string-to-number.
3128 Use string_to_number to do the actual conversion; this avoids
3129 rounding errors and fixes some other screwups. Without this fix,
3130 for example, #x1fffffffffffffff was misread as -2305843009213693952.
3131 (digit_to_number): Move earlier, for benefit of read_integer.
3132 Return -1 if the digit is out of range for the base, -2 if it is
3133 not a digit in any supported base. (Bug#8602)
3134
3135 * doprnt.c (doprnt): Support arbitrary pI values, such as "I64".
3136
3137 * dispnew.c (scrolling_window): Return 1 if we scrolled,
3138 to match comment at start of function. This also removes a
3139 GCC warning about overflow in a 32+64-bit port.
3140
3141 * lisp.h (EMACS_INT, EMACS_UINT, BITS_PER_EMACS_INT, pI): Simplify.
3142
3143 * dbusbind.c: Do not use XPNTR on a value that may be an integer.
3144 Reported by Stefan Monnier in
3145 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00919.html>.
3146 (xd_remove_watch, Fdbus_init_bus, xd_read_queued_messages):
3147 Use SYMBOLP-guarded XSYMBOL, not XPNTR.
3148
3149 * lisp.h (EMACS_INTPTR): Remove. All uses changed to intptr_t.
3150 (EMACS_UINTPTR): Likewise, with uintptr_t.
3151
3152 * lisp.h: Prefer 64-bit EMACS_INT if available.
3153 (EMACS_INT, EMACS_UINT, BITS_PER_EMACS_INT, pI): Define to 64-bit
3154 on 32-bit hosts that have 64-bit int, so that they can access
3155 large files.
3156 However, temporarily disable this change unless the temporary
3157 symbol WIDE_EMACS_INT is defined.
3158
3159 * lread.c, process.c: Do not include <inttypes.h>; lisp.h does it now.
3160
3161 Prefer intptr_t/uintptr_t for integers the same widths as pointers.
3162 This removes an assumption that EMACS_INT and long are the same
3163 width as pointers. The assumption is true for Emacs porting targets
3164 now, but we want to make other targets possible.
3165 * lisp.h: Include <inttypes.h>, for INTPTR_MAX, UINTPTR_MAX.
3166 (EMACS_INTPTR, EMACS_UINTPTR): New macros.
3167 In the rest of the code, change types of integers that hold casted
3168 pointers to EMACS_INTPTR and EMACS_UINTPTR, systematically
3169 replacing EMACS_INT, long, EMACS_UINT, and unsigned long.
3170 (XTYPE): Don't cast arg to EMACS_UINT; normally is not needed.
3171 (XSET): Cast type of XTYPE arg to EMACS_INTPTR; it is needed here.
3172 No need to cast type when ORing.
3173 (XPNTR): Return a value of type EMACS_INTPTR or EMACS_UINTPTR.
3174 * alloc.c (lisp_align_malloc): Remove a no-longer-needed cast.
3175 * doc.c (store_function_docstring): Use EMACS_INTPTR, so as not to
3176 assume EMACS_INT is the same width as char *.
3177 * gtkutil.c (xg_gtk_scroll_destroy, xg_tool_bar_button_cb):
3178 (xg_tool_bar_callback, xg_tool_bar_help_callback, xg_make_tool_item):
3179 Remove no-longer-needed casts.
3180 (xg_create_scroll_bar, xg_tool_bar_button_cb, xg_tool_bar_callback):
3181 (xg_tool_bar_help_callback, xg_make_tool_item):
3182 Use EMACS_INTPTR to hold an integer
3183 that will be cast to void *; this can avoid a GCC warning
3184 if EMACS_INT is not the same width as void *.
3185 * menu.c (find_and_call_menu_selection): Remove no-longer-needed cast.
3186 * xdisp.c (display_echo_area_1, resize_mini_window_1):
3187 (current_message_1, set_message_1):
3188 Use a local to convert to proper width without a cast.
3189 * xmenu.c (dialog_selection_callback): Likewise.
3190
3191 * sysdep.c (get_random): Don't assume EMACS_INT is no wider than long.
3192 Also, don't assume VALBITS / RAND_BITS is less than 5,
3193 and don't rely on undefined behavior when shifting a 1 left into
3194 the sign bit.
3195 * lisp.h (get_random): Change signature to match.
3196
3197 * lread.c (hash_string): Use size_t, not int, for hash computation.
3198 Normally we prefer signed values; but hashing is special, because
3199 it's better to use unsigned division on hash table sizes so that
3200 the remainder is nonnegative. Also, size_t is the natural width
3201 for hashing into memory. The previous code used 'int', which doesn't
3202 retain enough info to hash well into very large tables.
3203 (oblookup, oblookup_last_bucket_number, Funintern): Likewise.
3204
3205 * dbusbind.c: Don't possibly lose pointer info when converting.
3206 (xd_remove_watch, Fdbus_init_bus, xd_read_queued_messages):
3207 Use XPNTR rather than XHASH, so that the high-order bits of
3208 the pointer aren't lost when converting through void *.
3209
3210 * eval.c (Fautoload): Don't double-shift a pointer.
3211
3212 * fns.c (Frandom): Let EMACS_UINT be wider than unsigned long.
3213
3214 2011-05-06 Juanma Barranquero <lekktu@gmail.com>
3215
3216 * gnutls.c (DEF_GNUTLS_FN):
3217 * image.c (DEF_IMGLIB_FN): Make function pointers static.
3218
3219 2011-05-05 Andreas Schwab <schwab@linux-m68k.org>
3220
3221 * lread.c (lisp_file_lexically_bound_p): Stop scanning at end
3222 marker. (Bug#8610)
3223
3224 2011-05-05 Eli Zaretskii <eliz@gnu.org>
3225
3226 * w32heap.c (allocate_heap) [USE_LISP_UNION_TYPE || USE_LSB_TAG]:
3227 New version that can reserve upto 2GB of heap space.
3228
3229 2011-05-05 Chong Yidong <cyd@stupidchicken.com>
3230
3231 * nsfns.m (Fns_read_file_name): Doc fix (Bug#8534).
3232
3233 2011-05-05 Teodor Zlatanov <tzz@lifelogs.com>
3234
3235 * gnutls.c (fn_gnutls_certificate_set_x509_key_file): Add alias to
3236 `gnutls_certificate_set_x509_key_file'.
3237
3238 2011-05-05 Juanma Barranquero <lekktu@gmail.com>
3239
3240 * makefile.w32-in ($(BLD)/image.$(O), $(BLD)/process.$(O)):
3241 Update dependencies.
3242
3243 2011-05-04 Juanma Barranquero <lekktu@gmail.com>
3244
3245 * gnutls.h (emacs_gnutls_write, emacs_gnutls_read):
3246 * gnutls.c (emacs_gnutls_write, emacs_gnutls_read):
3247 Remove unused parameter `fildes'.
3248 * process.c (read_process_output, send_process): Don't pass it.
3249
3250 2011-05-04 Juanma Barranquero <lekktu@gmail.com>
3251
3252 Fix previous change: the library cache is defined in w32.c.
3253 * image.c (CACHE_IMAGE_TYPE) [!HAVE_NTGUI]: Define to noop.
3254 (Finit_image_library): Wrap Vlibrary_cache on "#ifdef HAVE_NTGUI".
3255
3256 2011-05-04 Juanma Barranquero <lekktu@gmail.com>
3257
3258 Implement dynamic loading of GnuTLS on Windows.
3259
3260 * gnutls.h (GNUTLS_EMACS_ERROR_NOT_LOADED): New macro.
3261 (emacs_gnutls_write, emacs_gnutls_read): Mark as extern.
3262 (emacs_gnutls_record_check_pending, emacs_gnutls_transport_set_errno):
3263 Declare.
3264
3265 * gnutls.c (Qgnutls_dll): Define.
3266 (DEF_GNUTLS_FN, LOAD_GNUTLS_FN): New macros.
3267 (gnutls_*): Declare function pointers.
3268 (init_gnutls_functions): New function to initialize function pointers.
3269 (emacs_gnutls_handshake, Fgnutls_error_string, Fgnutls_deinit)
3270 (emacs_gnutls_global_init, Fgnutls_bye): Use function pointers.
3271 (emacs_gnutls_record_check_pending, emacs_gnutls_transport_set_errno):
3272 Wrappers for gnutls_record_check_pending and gnutls_transport_set_errno.
3273 (emacs_gnutls_write, emacs_gnutls_read)
3274 (emacs_gnutls_handle_error, Fgnutls_error_fatalp)
3275 (Fgnutls_available_p): New function.
3276 (Fgnutls_boot): Call Fgnutls_available_p. Use function pointers.
3277 (syms_of_gnutls) <Qgnutls_dll>: Initialize and staticpro it.
3278 (syms_of_gnutls) <Sgnutls_available_p>: defsubr it.
3279
3280 * image.c: Include w32.h.
3281 (Vimage_type_cache): Delete.
3282 (syms_of_image) <Vimage_type_cache>: Don't initialize and staticpro it.
3283 (CACHE_IMAGE_TYPE, Finit_image_library): Use Vlibrary_cache instead.
3284 (w32_delayed_load): Move to w32.c.
3285
3286 * w32.h (VlibraryCache, QCloaded_from, w32_delayed_load): Declare.
3287
3288 * w32.c (QCloaded_from, Vlibrary_cache): Define.
3289 (w32_delayed_load): Move from image.c. When loading a library, record
3290 its filename in the :loaded-from property of the library id.
3291 (globals_of_w32) <QCloaded_from, Vlibrary_cache>:
3292 Initialize and staticpro them.
3293 (emacs_gnutls_pull, emacs_gnutls_push): Call emacs_gnutls_* functions.
3294
3295 * process.c: Include lisp.h before w32.h, not after.
3296 (wait_reading_process_output): Call emacs_gnutls_record_check_pending
3297 instead of gnutls_record_check_pending.
3298
3299 * callproc.c, emacs.c: Include lisp.h before w32.h, not after.
3300
3301 2011-05-04 Teodor Zlatanov <tzz@lifelogs.com>
3302
3303 * gnutls.c (Fgnutls_boot): Support :keylist and :crlfiles options
3304 instead of :keyfiles. Give GnuTLS the keylist and the CRL lists
3305 as passed in.
3306
3307 2011-05-03 Jan Djärv <jan.h.d@swipnet.se>
3308
3309 * xterm.c (x_set_frame_alpha): Do not set property on anything
3310 else than FRAME_X_OUTER_WINDOW (Bug#8608).
3311
3312 2011-05-02 Juanma Barranquero <lekktu@gmail.com>
3313
3314 * sysdep.c (get_tty_size) [WINDOWSNT]: Implement. (Bug#8596)
3315
3316 2011-05-02 Juanma Barranquero <lekktu@gmail.com>
3317
3318 * gnutls.c (Qgnutls_log_level, Qgnutls_code, Qgnutls_anon)
3319 (Qgnutls_x509pki, Qgnutls_e_interrupted, Qgnutls_e_again)
3320 (Qgnutls_e_invalid_session, Qgnutls_e_not_ready_for_handshake)
3321 (gnutls_global_initialized, Qgnutls_bootprop_priority)
3322 (Qgnutls_bootprop_trustfiles, Qgnutls_bootprop_keyfiles)
3323 (Qgnutls_bootprop_callbacks, Qgnutls_bootprop_loglevel)
3324 (Qgnutls_bootprop_hostname, Qgnutls_bootprop_verify_flags)
3325 (Qgnutls_bootprop_verify_error, Qgnutls_bootprop_verify_hostname_error)
3326 (Qgnutls_bootprop_callbacks_verify): Make static.
3327
3328 2011-05-01 Andreas Schwab <schwab@linux-m68k.org>
3329
3330 * callproc.c: Indentation fixup.
3331
3332 * sysdep.c (wait_for_termination_1): Make static.
3333 (wait_for_termination, interruptible_wait_for_termination):
3334 Move after wait_for_termination_1.
3335
3336 2011-05-01 Lars Magne Ingebrigtsen <larsi@gnus.org>
3337
3338 * sysdep.c (interruptible_wait_for_termination): New function
3339 which is like wait_for_termination, but allows keyboard
3340 interruptions.
3341
3342 * callproc.c (Fcall_process): Add (:file "file") as an option for
3343 the STDOUT buffer.
3344 (Fcall_process_region): Ditto.
3345
3346 2011-04-30 Eli Zaretskii <eliz@gnu.org>
3347
3348 * dosfns.c (Fint86, Fdos_memget, Fdos_memput): Use `ASIZE (FOO)'
3349 rather than `XVECTOR (FOO)->size'.
3350
3351 * process.c: Remove HAVE_INTTYPES_H condition from inclusion of
3352 inttypes.h, as a gnulib replacement is used if it not available in
3353 system headers.
3354
3355 2011-04-21 Eli Zaretskii <eliz@gnu.org>
3356
3357 Lift the MOST_POSITIVE_FIXNUM/4 limitation on visited files.
3358 * fileio.c (Finsert_file_contents): Don't limit file size to 1/4
3359 of MOST_POSITIVE_FIXNUM. (Bug#8528)
3360
3361 * coding.c (coding_alloc_by_realloc): Error out if destination
3362 will grow beyond MOST_POSITIVE_FIXNUM.
3363 (decode_coding_emacs_mule): Abort if there isn't enough place in
3364 charbuf for the composition carryover bytes. Reserve an extra
3365 space for up to 2 characters produced in a loop.
3366 (decode_coding_iso_2022): Abort if there isn't enough place in
3367 charbuf for the composition carryover bytes.
3368
3369 2011-04-21 Eli Zaretskii <eliz@gnu.org>
3370
3371 * doprnt.c (doprnt) [!HAVE_LONG_LONG_INT]: Error out instead of
3372 aborting when %lld or %lll format is passed.
3373 [!HAVE_UNSIGNED_LONG_LONG_INT]: Error out instead of aborting when
3374 %llo or %llx format is passed. (Bug#8545)
3375
3376 * window.c (window_scroll_line_based): Use a marker instead of
3377 simple variables to record original value of point. (Bug#7952)
3378
3379 * doprnt.c (doprnt): Fix the case where a multibyte sequence
3380 produced by %s or %c overflows available buffer space. (Bug#8545)
3381
3382 2011-04-28 Paul Eggert <eggert@cs.ucla.edu>
3383
3384 * doprnt.c (doprnt): Omit useless test; int overflow check (Bug#8545).
3385 (SIZE_MAX): Move defn after all includes, as they might #define it.
3386
3387 2011-04-28 Juanma Barranquero <lekktu@gmail.com>
3388
3389 * w32.c (init_environment): Warn about defaulting HOME to C:\.
3390
3391 2011-04-28 Juanma Barranquero <lekktu@gmail.com>
3392
3393 * keyboard.c (Qdelayed_warnings_hook): Define.
3394 (command_loop_1): Run `delayed-warnings-hook'
3395 if Vdelayed_warnings_list is non-nil.
3396 (syms_of_keyboard) <delayed-warnings-hook>: DEFSYM it.
3397 (syms_of_keyboard) <delayed-warnings-list>: DEFVAR_LISP it.
3398
3399 2011-04-28 Eli Zaretskii <eliz@gnu.org>
3400
3401 * doprnt.c (doprnt): Don't return value smaller than the buffer
3402 size if the message was truncated. (Bug#8545).
3403
3404 2011-04-28 Juanma Barranquero <lekktu@gmail.com>
3405
3406 * w32fns.c (Fx_change_window_property, Fx_delete_window_property)
3407 (Fx_window_property): #if-0 the whole functions, not just the bodies.
3408
3409 2011-04-27 Paul Eggert <eggert@cs.ucla.edu>
3410
3411 * doprnt.c (doprnt): Support "ll" length modifier, for long long.
3412
3413 2011-04-27 Juanma Barranquero <lekktu@gmail.com>
3414
3415 * makefile.w32-in: Update dependencies.
3416
3417 2011-04-27 Eli Zaretskii <eliz@gnu.org>
3418
3419 Improve `doprnt' and its usage. (Bug#8545)
3420 * doprnt.c (doprnt): Make sure `format' is never accessed beyond
3421 `format_end'. Remove support for %l as a conversion specifier.
3422 Don't use xrealloc. Improve diagnostics when the %l size modifier
3423 is used. Update the commentary.
3424
3425 * eval.c (verror): Simplify calculation of size_t.
3426
3427 * coding.c (Ffind_operation_coding_system): Fix diagnostic error
3428 messages.
3429
3430 2011-04-27 Yoshiaki Kasahara <kasahara@nc.kyushu-u.ac.jp> (tiny change)
3431
3432 * buffer.c (init_buffer) [USE_MMAP_FOR_BUFFERS]: Adjust to aliasing
3433 change.
3434
3435 2011-04-27 Paul Eggert <eggert@cs.ucla.edu>
3436
3437 * nsmenu.m: Replace all uses of XVECTOR with ASIZE and AREF.
3438 This makes this file independent of the recent pseudovector change.
3439
3440 2011-04-26 Paul Eggert <eggert@cs.ucla.edu>
3441
3442 * keyboard.c (handle_user_signal): Fix pointer signedness problem.
3443
3444 * gnutls.c (emacs_gnutls_handle_error): Remove unused local.
3445 (Fgnutls_boot): gnutls_certificate_verify_peers2 wants unsigned *.
3446 Remove unused local.
3447 (emacs_gnutls_write): Don't use uninitialized rtnval if nbyte <= 0.
3448
3449 * lisp.h: Fix a problem with aliasing and vector headers. (Bug#8546)
3450 GCC 4.6.0 optimizes based on type-based alias analysis.
3451 For example, if b is of type struct buffer * and v of type struct
3452 Lisp_Vector *, then gcc -O2 was incorrectly assuming that &b->size
3453 != &v->size, and therefore "v->size = 1; b->size = 2; return
3454 v->size;" must therefore return 1. This assumption is incorrect
3455 for Emacs, since it type-puns struct Lisp_Vector * with many other
3456 types. To fix this problem, this patch adds a new type struct
3457 vectorlike_header that documents the constraints on layout of vectors
3458 and pseudovectors, and helps optimizing compilers not get fooled
3459 by Emacs's type punning. It also adds the macros XSETTYPED_PVECTYPE
3460 XSETTYPED_PSEUDOVECTOR, TYPED_PSEUDOVECTORP, for similar reasons.
3461 * lisp.h (XSETTYPED_PVECTYPE): New macro, specifying the name of
3462 the size member.
3463 (XSETPVECTYPE): Rewrite in terms of new macro.
3464 (XSETPVECTYPESIZE): New macro, specifying both type and size.
3465 This is a bit clearer, and further avoids the possibility of
3466 undesirable aliasing.
3467 (XSETTYPED_PSEUDOVECTOR): New macro, specifying the size.
3468 (XSETPSEUDOVECTOR): Rewrite in terms of XSETTYPED_PSEUDOVECTOR.
3469 (XSETSUBR): Rewrite in terms of XSETTYPED_PSEUDOVECTOR and XSIZE,
3470 since Lisp_Subr is a special case (no "next" field).
3471 (ASIZE): Now uses header.size rather than size.
3472 All previous uses of XVECTOR (foo)->size replaced to use this macro,
3473 to avoid the hassle of writing XVECTOR (foo)->header.size.
3474 (struct vectorlike_header): New type.
3475 (TYPED_PSEUDOVECTORP): New macro, also specifying the C type of the
3476 object, to help avoid aliasing.
3477 (PSEUDOVECTORP): Rewrite in terms of TYPED_PSEUDOVECTORP.
3478 (SUBRP): Likewise, since Lisp_Subr is a special case.
3479 * lisp.h (struct Lisp_Vector, struct Lisp_Char_Table):
3480 (struct Lisp_Sub_Char_Table, struct Lisp_Bool_Vector):
3481 (struct Lisp_Hash_Table): Combine first two members into a single
3482 struct vectorlike_header member. All uses of "size" and "next" members
3483 changed to be "header.size" and "header.next".
3484 * buffer.h (struct buffer): Likewise.
3485 * font.h (struct font_spec, struct font_entity, struct font): Likewise.
3486 * frame.h (struct frame): Likewise.
3487 * process.h (struct Lisp_Process): Likewise.
3488 * termhooks.h (struct terminal): Likewise.
3489 * window.c (struct save_window_data, struct saved_window): Likewise.
3490 * window.h (struct window): Likewise.
3491 * alloc.c (allocate_buffer, Fmake_bool_vector, allocate_pseudovector):
3492 Use XSETPVECTYPESIZE, not XSETPVECTYPE, to avoid aliasing problems.
3493 * buffer.c (init_buffer_once): Likewise.
3494 * lread.c (defsubr): Use XSETTYPED_PVECTYPE, since Lisp_Subr is a
3495 special case.
3496 * process.c (Fformat_network_address): Use local var for size,
3497 for brevity.
3498
3499 * bytecode.c (exec_byte_code): Don't use XVECTOR before CHECK_VECTOR.
3500
3501 Make the Lisp reader and string-to-float more consistent (Bug#8525)
3502 * data.c (atof): Remove decl; no longer used or needed.
3503 (digit_to_number): Move to lread.c.
3504 (Fstring_to_number): Use new string_to_number function, to be
3505 consistent with how the Lisp reader treats infinities and NaNs.
3506 Do not assume that floating-point numbers represent EMACS_INT
3507 without losing information; this is not true on most 64-bit hosts.
3508 Avoid double-rounding errors, by insisting on integers when
3509 parsing non-base-10 numbers, as the documentation specifies.
3510 * lisp.h (string_to_number): New decl, replacing ...
3511 (isfloat_string): Remove.
3512 * lread.c: Include <inttypes.h>, for uintmax_t and strtoumax.
3513 (read1): Do not accept +. and -. as integers; this
3514 appears to have been a coding error. Similarly, do not accept
3515 strings like +-1e0 as floating point numbers. Do not report
3516 overflow for integer overflows unless the base is not 10 which
3517 means we have no simple and reliable way to continue.
3518 Break out the floating-point parsing into a new
3519 function string_to_number, so that Fstring_to_number parses
3520 floating point numbers consistently with the Lisp reader.
3521 (digit_to_number): Move here from data.c. Make it static inline.
3522 (E_CHAR, EXP_INT): Remove, replacing with ...
3523 (E_EXP): New macro, to solve the "1.0e+" problem mentioned below.
3524 (string_to_number): New function, replacing isfloat_string.
3525 This function checks for valid syntax and produces the resulting
3526 Lisp float number too. Rework it so that string-to-number
3527 no longer mishandles examples like "1.0e+". Use strtoumax,
3528 so that overflow for non-base-10 numbers is reported only when
3529 there's no portable and simple way to convert to floating point.
3530
3531 * textprop.c (set_text_properties_1): Rewrite for clarity,
3532 and to avoid GCC warning about integer overflow.
3533
3534 * intervals.h (struct interval): Use EMACS_INT for members
3535 where EMACS_UINT might cause problems. See
3536 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00514.html>.
3537 (CHECK_TOTAL_LENGTH): Remove cast to EMACS_INT; no longer needed.
3538 * intervals.c (interval_deletion_adjustment): Now returns EMACS_INT.
3539 All uses changed.
3540 (offset_intervals): Tell GCC not to worry about length overflow
3541 when negating a negative length.
3542
3543 * alloc.c (overrun_check_malloc, overrun_check_realloc): Now static.
3544 (overrun_check_free): Likewise.
3545
3546 * alloc.c (SDATA_SIZE) [!GC_CHECK_STRING_BYTES]: Avoid runtime check
3547 in the common case where SDATA_DATA_OFFSET is a multiple of Emacs
3548 word size.
3549
3550 * gnutls.c: Fix problems found by GCC 4.6.0 on Ubuntu 10.10.
3551 (gnutls_make_error): Rename local to avoid shadowing.
3552 (gnutls_emacs_global_deinit): ifdef out; not used.
3553 (Fgnutls_boot): Use const for pointer to readonly storage.
3554 Comment out unused local. Fix pointer signedness problems.
3555
3556 * lread.c (openp): Don't stuff size_t into an 'int'.
3557 Use <= on length, not < on length + 1, to avoid GCC 4.6.0 warning
3558 about possible signed overflow.
3559
3560 * gtkutil.c: Fix problems found by GCC 4.6.0 on Ubuntu 10.10.
3561 (GDK_KEY_g): Don't define if already defined.
3562 (xg_prepare_tooltip): Avoid pointer signedness problem.
3563 (xg_set_toolkit_scroll_bar_thumb): Redo to avoid two casts.
3564
3565 * process.c (Fnetwork_interface_info): Avoid left-shift undefined
3566 behavior with 1 << 31. GCC 4.6.0 warns about this on 32-bit hosts.
3567
3568 * xfns.c (Fx_window_property): Simplify a bit,
3569 to make a bit faster and to avoid GCC 4.6.0 warning.
3570 * xselect.c (x_get_window_property, x_handle_dnd_message): Likewise.
3571
3572 * fns.c (internal_equal): Don't assume size_t fits in int.
3573
3574 * alloc.c (compact_small_strings): Tighten assertion a little.
3575
3576 Replace pEd with more-general pI, and fix some printf arg casts.
3577 * lisp.h (pI): New macro, generalizing old pEd macro to other
3578 conversion specifiers. For example, use "...%"pI"d..." rather
3579 than "...%"pEd"...".
3580 (pEd): Remove. All uses replaced with similar uses of pI.
3581 * src/m/amdx86-64.h, src/m/ia64.h, src/m/ibms390x.h: Likewise.
3582 * alloc.c (check_pure_size): Don't overflow by converting size to int.
3583 * bidi.c (bidi_dump_cached_states): Use pI to avoid cast.
3584 * data.c (Fnumber_to_string): Use pI instead of if-then-else-abort.
3585 * dbusbind.c (xd_append_arg): Use pI to avoid cast.
3586 (Fdbus_method_return_internal, Fdbus_method_error_internal): Likewise.
3587 * font.c (font_unparse_xlfd): Avoid potential buffer overrun on
3588 64-bit hosts.
3589 (font_unparse_xlfd, font_unparse_fcname): Use pI to avoid casts.
3590 * keyboard.c (record_char, modify_event_symbol): Use pI to avoid casts.
3591 * print.c (safe_debug_print, print_object): Likewise.
3592 (print_object): Don't overflow by converting EMACS_INT or EMACS_UINT
3593 to int.
3594 Use pI instead of if-then-else-abort. Use %p to avoid casts,
3595 avoiding the 0 flag, which is not portable.
3596 * process.c (Fmake_network_process): Use pI to avoid cast.
3597 * region-cache.c (pp_cache): Likewise.
3598 * xdisp.c (decode_mode_spec): Likewise.
3599 * xrdb.c (x_load_resources) [USE_MOTIF]: Use pI to avoid undefined
3600 behavior on 64-bit hosts with printf arg.
3601 * xselect.c (x_queue_event): Use %p to avoid casts, avoiding 0 flag.
3602 (x_stop_queuing_selection_requests): Likewise.
3603 (x_get_window_property): Don't truncate byte count to an 'int'
3604 when tracing.
3605
3606 * frame.c (frame_name_fnn_p): Get rid of strtol, which isn't right
3607 here, since it parses constructs like leading '-' and spaces,
3608 which are not wanted; and it overflows with large numbers.
3609 Instead, simply match F[0-9]+, which is what is wanted anyway.
3610
3611 * alloc.c: Remove unportable assumptions about struct layout.
3612 (SDATA_SELECTOR, SDATA_DATA_OFFSET): New macros.
3613 (SDATA_OF_STRING, SDATA_SIZE, allocate_string_data):
3614 (allocate_vectorlike, make_pure_vector): Use the new macros,
3615 plus offsetof, to remove unportable assumptions about struct layout.
3616 These assumptions hold on all porting targets that I know of, but
3617 they are not guaranteed, they're easy to remove, and removing them
3618 makes further changes easier.
3619
3620 * alloc.c (BLOCK BYTES): Fix typo by changing "ablock" to "ablocks".
3621 This doesn't fix a bug but makes the code clearer.
3622 (string_overrun_cookie): Now const. Use initializers that
3623 don't formally overflow signed char, to avoid warnings.
3624 (allocate_string_data) [GC_CHECK_STRING_OVERRUN]: Fix typo that
3625 can cause Emacs to crash when string overrun checking is enabled.
3626 (allocate_buffer): Don't assume sizeof (struct buffer) is a
3627 multiple of sizeof (EMACS_INT); it need not be, if
3628 alignof(EMACS_INT) < sizeof (EMACS_INT).
3629 (check_sblock, check_string_bytes, check_string_free_list): Protoize.
3630
3631 2011-04-26 Juanma Barranquero <lekktu@gmail.com>
3632
3633 * keyboard.c (QCrtl): Rename from Qrtl. All uses changed.
3634
3635 2011-04-26 Teodor Zlatanov <tzz@lifelogs.com>
3636
3637 * gnutls.c (emacs_gnutls_handshake): Return an error if we're not
3638 supposed to be handshaking. (Bug#8556)
3639 Reported by Paul Eggert <eggert@cs.ucla.edu>.
3640
3641 2011-04-26 Daniel Colascione <dan.colascione@gmail.com>
3642
3643 * lisp.h (Qdebug): List symbol.
3644 * eval.c (Qdebug): Restore global linkage.
3645 * keyboard.c (debug-on-event): New variable.
3646 (handle_user_signal): Break into debugger when debug-on-event
3647 matches the current signal symbol.
3648
3649 2011-04-25 Dan Nicolaescu <dann@ics.uci.edu>
3650
3651 * alloc.c (check_sblock, check_string_bytes)
3652 (check_string_free_list): Convert to standard C.
3653
3654 2011-04-25 Teodor Zlatanov <tzz@lifelogs.com>
3655
3656 * w32.c (emacs_gnutls_push): Fix typo.
3657
3658 2011-04-25 Eli Zaretskii <eliz@gnu.org>
3659
3660 * gnutls.c (emacs_gnutls_handshake): Avoid compiler warnings about
3661 "cast to pointer from integer of different size".
3662
3663 Improve doprnt and its use in verror. (Bug#8545)
3664 * doprnt.c (doprnt): Document the set of format control sequences
3665 supported by the function. Use SAFE_ALLOCA instead of always
3666 using `alloca'.
3667
3668 * eval.c (verror): Don't limit the buffer size at size_max-1, that
3669 is one byte too soon. Don't use xrealloc; instead xfree and
3670 xmalloc anew.
3671
3672 2011-04-24 Teodor Zlatanov <tzz@lifelogs.com>
3673
3674 * gnutls.h: Add GNUTLS_STAGE_CALLBACKS enum to denote we're in the
3675 callbacks stage.
3676
3677 * gnutls.c: Renamed global_initialized to
3678 gnutls_global_initialized. Added internals for the
3679 :verify-hostname-error, :verify-error, and :verify-flags
3680 parameters of `gnutls-boot' and documented those parameters in the
3681 docstring. Start callback support.
3682 (emacs_gnutls_handshake): Add Woe32 support. Retry handshake
3683 unless a fatal error occurred. Call gnutls_alert_send_appropriate
3684 on error. Return error code.
3685 (emacs_gnutls_write): Call emacs_gnutls_handle_error.
3686 (emacs_gnutls_read): Likewise.
3687 (Fgnutls_boot): Return handshake error code.
3688 (emacs_gnutls_handle_error): New function.
3689 (wsaerror_to_errno): Likewise.
3690
3691 * w32.h (emacs_gnutls_pull): Add prototype.
3692 (emacs_gnutls_push): Likewise.
3693
3694 * w32.c (emacs_gnutls_pull): New function for GnuTLS on Woe32.
3695 (emacs_gnutls_push): Likewise.
3696
3697 2011-04-24 Claudio Bley <claudio.bley@gmail.com> (tiny change)
3698
3699 * process.c (wait_reading_process_output): Check if GnuTLS
3700 buffered some data internally if no FDs are set for TLS
3701 connections.
3702
3703 * makefile.w32-in (OBJ2): Add gnutls.$(O).
3704 (LIBS): Link to USER_LIBS.
3705 ($(BLD)/gnutls.$(0)): New target.
3706
3707 2011-04-24 Eli Zaretskii <eliz@gnu.org>
3708
3709 * xdisp.c (handle_single_display_spec): Rename the
3710 display_replaced_before_p argument into display_replaced_p, to
3711 make it consistent with the commentary. Fix typos in the
3712 commentary.
3713
3714 * textprop.c (syms_of_textprop): Remove dead code.
3715 (copy_text_properties): Delete obsolete commentary about an
3716 interface that was deleted long ago. Fix typos in the description
3717 of arguments.
3718
3719 * msdos.c (XMenuActivate, XMenuAddSelection): Adjust argument list
3720 to changes in oldXMenu/XMenu.h from 2011-04-16.
3721 <menu_help_message, prev_menu_help_message>: Constify.
3722 (IT_menu_make_room): menu->help_text is now `const char **';
3723 adjust.
3724
3725 * msdos.h (XMenuActivate, XMenuAddSelection): Adjust prototypes
3726 to changes in oldXMenu/XMenu.h from 2011-04-16.
3727 (struct XMenu): Declare `help_text' `const char **'.
3728
3729 * xfaces.c <Qunspecified>: Make extern again.
3730
3731 * syntax.c: Include sys/types.h before including regex.h, as
3732 required by Posix.
3733
3734 * doc.c (get_doc_string): Improve the format passed to `error'.
3735
3736 * doprnt.c (doprnt): Improve commentary.
3737
3738 * term.c (init_tty) [MSDOS]: Fix 1st argument to maybe_fatal.
3739
3740 * Makefile.in (TAGS): Depend on $(M_FILE) and $(S_FILE), and scan
3741 them with etags.
3742
3743 * makefile.w32-in (globals.h): Add a dummy recipe, to make any
3744 changes in globals.h immediately force recompilation.
3745 (TAGS): Depend on $(CURDIR)/m/intel386.h and
3746 $(CURDIR)/s/ms-w32.h.
3747 (TAGS-gmake): Scan $(CURDIR)/m/intel386.h and $(CURDIR)/s/ms-w32.h.
3748
3749 * character.c (Fchar_direction): Function deleted.
3750 (syms_of_character): Don't defsubr it.
3751 <char-direction-table>: Deleted.
3752
3753 2011-04-23 Eli Zaretskii <eliz@gnu.org>
3754
3755 Fix doprnt so it could be used again safely in `verror'. (Bug#8435)
3756 * doprnt.c: Include limits.h.
3757 (SIZE_MAX): New macro.
3758 (doprnt): Return a size_t value. 2nd arg is now size_t.
3759 Many local variables are now size_t instead of int or unsigned.
3760 Improve overflow protection. Support `l' modifier for integer
3761 conversions. Support %l conversion. Don't assume an EMACS_INT
3762 argument for integer conversions and for %c.
3763
3764 * lisp.h (doprnt): Restore prototype.
3765
3766 * makefile.w32-in ($(BLD)/callint.$(O)): Depend on
3767 $(SRC)/character.h.
3768
3769 * Makefile.in (base_obj): Add back doprnt.o.
3770
3771 * deps.mk (doprnt.o): Add back prerequisites.
3772 (callint.o): Depend on character.h.
3773
3774 * eval.c (internal_lisp_condition_case): Include the handler
3775 representation in the error message.
3776 (verror): Call doprnt instead of vsnprintf. Fix an off-by-one bug
3777 when breaking from the loop.
3778
3779 * xdisp.c (vmessage): Call doprnt instead of vsnprintf.
3780
3781 * callint.c (Fcall_interactively): When displaying error message
3782 about invalid control letter, pass the character's codepoint, not
3783 a pointer to its multibyte form. Improve display of the character
3784 in octal and display also its hex code.
3785
3786 * character.c (char_string): Use %x to display the (unsigned)
3787 codepoint of an invalid character, to avoid displaying a bogus
3788 negative value.
3789
3790 * font.c (check_otf_features): Pass SDATA of SYMBOL_NAME to
3791 `error', not SYMBOL_NAME itself.
3792
3793 * coding.c (Fencode_sjis_char, Fencode_big5_char): Use %c for
3794 character arguments to `error'.
3795
3796 * charset.c (check_iso_charset_parameter): Fix incorrect argument
3797 to `error' in error message about FINAL_CHAR argument. Make sure
3798 FINAL_CHAR is a character, and use %c when it is passed as
3799 argument to `error'.
3800
3801 2011-04-23 Eli Zaretskii <eliz@gnu.org>
3802
3803 * s/ms-w32.h (localtime): Redirect to sys_localtime.
3804
3805 * w32.c: Include <time.h>.
3806 (sys_localtime): New function.
3807
3808 2011-04-23 Chong Yidong <cyd@stupidchicken.com>
3809
3810 * xdisp.c (init_xdisp): Initialize echo_area_window (Bug#6451).
3811
3812 * buffer.c (syms_of_buffer): Doc fix (Bug#6902).
3813
3814 2011-04-23 Samuel Thibault <sthibault@debian.org> (tiny change)
3815
3816 * sysdep.c (wait_for_termination): On GNU Hurd, kill returns -1 on
3817 zombies (Bug#8467).
3818
3819 2011-04-19 Eli Zaretskii <eliz@gnu.org>
3820
3821 * syntax.h (SETUP_SYNTAX_TABLE_FOR_OBJECT): Fix setting of
3822 gl_state.e_property when gl_state.object is Qt.
3823
3824 * insdel.c (make_gap_larger): Remove limitation of buffer size
3825 to <= INT_MAX.
3826
3827 2011-04-18 Chong Yidong <cyd@stupidchicken.com>
3828
3829 * xdisp.c (lookup_glyphless_char_display)
3830 (produce_glyphless_glyph): Handle cons cell entry in
3831 glyphless-char-display.
3832 (Vglyphless_char_display): Document it.
3833
3834 * term.c (produce_glyphless_glyph): Handle cons cell entry in
3835 glyphless-char-display.
3836
3837 2011-04-17 Chong Yidong <cyd@stupidchicken.com>
3838
3839 * xdisp.c (get_next_display_element): Remove unnecessary ifdefs.
3840
3841 * termhooks.h (FRAME_WINDOW_P): Remove duplicated definitions.
3842
3843 * dispextern.h (FACE_SUITABLE_FOR_ASCII_CHAR_P): Add missing
3844 definition for no-X builds.
3845
3846 2011-04-16 Paul Eggert <eggert@cs.ucla.edu>
3847
3848 Static checks with GCC 4.6.0 and non-default toolkits.
3849
3850 * s/sol2-6.h, s/unixware.h (PTY_TTY_NAME_SPRINTF): Protoize decl.
3851
3852 * process.c (keyboard_bit_set): Define only if SIGIO.
3853 (send_process_trap): Mark it with NO_RETURN if it doesn't return.
3854 (send_process): Repair possible setjmp clobbering.
3855
3856 * s/usg5-4-common.h (SETUP_SLAVE_PTY): Don't pass extra arg to 'fatal'.
3857
3858 * eval.c: Include <stdio.h>, for vsnprintf on non-GNU/Linux hosts.
3859
3860 * data.c (arith_error): Mark with NO_RETURN if it doesn't return.
3861
3862 * alloc.c (bytes_used_when_full, SPARE_MEMORY, BYTES_USED):
3863 Define only if needed.
3864
3865 * sysdep.c (_FILE_OFFSET_BITS): Make this hack even uglier
3866 by pacifying GCC about it. Maybe it's time to retire it?
3867 * xfaces.c (USG, __TIMEVAL__): Likewise.
3868
3869 * dispextern.h (struct redisplay_interface): Rename param
3870 to avoid shadowing.
3871 * termhooks.h (struct terminal): Likewise.
3872 * xterm.c (xembed_send_message): Likewise.
3873
3874 * insdel.c (make_gap_smaller): Define only if
3875 USE_MMAP_FOR_BUFFERS || REL_ALLOC || DOUG_LEA_MALLOC.
3876
3877 * keyboard.c (read_char): Make a var volatile so longjmp won't clobber
3878 it.
3879
3880 * emacs.c (MAX_HEAP_BSS_DIFF, my_edata): Move to where they're used,
3881 so that we aren't warned about unused symbols.
3882
3883 * xfns.c (Fx_file_dialog): Rename local to avoid shadowing.
3884
3885 * xdisp.c (x_produce_glyphs): Mark var as initialized (Bug#8512).
3886
3887 * xfns.c (x_real_positions): Mark locals as initialized.
3888
3889 * xmenu.c (xmenu_show): Don't use uninitialized vars.
3890
3891 * xterm.c: Fix problems found by static analysis with other toolkits.
3892 (toolkit_scroll_bar_interaction): Define and use only if USE_X_TOOLKIT.
3893 (x_dispatch_event): Declare static if USE_GTK, and
3894 define if USE_GTK || USE_X_TOOLKIT.
3895 (SET_SAVED_BUTTON_EVENT): Define only if USE_X_TOOLKIT || USE_GTK.
3896 * xterm.h (x_dispatch_event): Extern only if USE_X_TOOLKIT.
3897 * xterm.c, xterm.h (x_mouse_leave): Bring this function back, but only
3898 if defined HAVE_MENUS && !defined USE_X_TOOLKIT && !defined USE_GTK.
3899
3900 * xmenu.c (menu_help_callback): Pointer type fixes.
3901 Use const pointers when pointing at readonly data. Avoid pointer
3902 signedness clashes.
3903 (FALSE): Remove unused macro.
3904 (update_frame_menubar): Remove unused decl.
3905
3906 * xfns.c (Fx_hide_tip): Move locals to avoid shadowing.
3907
3908 * menu.c (push_submenu_start, push_submenu_end): Do not define unless
3909 USE_X_TOOLKIT || USE_GTK || HAVE_NS || defined HAVE_NTGUI.
3910 (single_menu_item): Rename local to avoid shadowing.
3911
3912 * keyboard.c (make_lispy_event): Remove unused local var.
3913
3914 * frame.c, frame.h (x_get_resource_string): Bring this back, but
3915 only if HAVE_X_WINDOWS && !USE_X_TOOLKIT.
3916
3917 * bitmaps: Change bitmaps from unsigned char back to the X11
3918 compatible char. Avoid the old compiler warnings about
3919 out-of-range initializers by using, for example, '\xab' rather
3920 than 0xab.
3921
3922 * xgselect.c (xgselect_initialize): Check vs interface
3923 even if ! (defined (USE_GTK) || defined (HAVE_GCONF)).
3924
3925 * xmenu.c (xmenu_show): Rename parm to avoid shadowing.
3926
3927 * xterm.c (x_create_toolkit_scroll_bar): Use const * for pointers
3928 to read-only memory.
3929
3930 * fns.c (vector): Remove; this old hack is no longer needed.
3931
3932 * xsmfns.c (create_client_leader_window): Rename shadowing arg.
3933 Remove unused var.
3934 (gdk_x11_set_sm_client_id) [!USE_GTK]: Don't define.
3935
3936 * xrdb.c (x_load_resources): Omit unused local.
3937
3938 * xfns.c (free_frame_menubar, atof): Remove duplicate decls.
3939 (x_window): Rename locals to avoid shadowing.
3940 (USG): Use the kludged USG macro, to pacify gcc.
3941
3942 * xterm.c (x_alloc_nearest_color_for_widget): Remove; unused.
3943 (x_term_init): Remove local to avoid shadowing.
3944
3945 * xfns.c, xterm.c (_XEditResCheckMessages): Protoize decl.
3946
3947 * xdisp.c, dispextern.h (set_vertical_scroll_bar): Now extern if
3948 USE_TOOLKIT_SCROLL_BARS && !USE_GTK, as xterm.c needs it then.
3949
3950 2011-04-16 Eli Zaretskii <eliz@gnu.org>
3951
3952 * gnutls.c (Fgnutls_boot): Don't pass Lisp_Object to `error'.
3953
3954 Fix regex.c, syntax.c and friends for buffers > 2GB.
3955 * syntax.h (struct gl_state_s): Declare character position members
3956 EMACS_INT.
3957
3958 * syntax.c (update_syntax_table): Declare 2nd argument EMACS_INT.
3959
3960 * textprop.c (verify_interval_modification, interval_of):
3961 Declare arguments EMACS_INT.
3962
3963 * intervals.c (adjust_intervals_for_insertion): Declare arguments
3964 EMACS_INT.
3965
3966 * intervals.h (CHECK_TOTAL_LENGTH): Cast to EMACS_INT, not `int'.
3967
3968 * indent.c (Fvertical_motion): Local variable it_start is now
3969 EMACS_INT.
3970
3971 * regex.c (re_match, re_match_2, re_match_2_internal)
3972 (bcmp_translate, regcomp, regexec, print_double_string)
3973 (group_in_compile_stack, re_search, re_search_2, regex_compile)
3974 (re_compile_pattern, re_exec): Declare arguments and local
3975 variables `size_t' and `ssize_t' and return values `regoff_t', as
3976 appropriate.
3977 (POP_FAILURE_REG_OR_COUNT) <pfreg>: Declare `long'.
3978 (CHECK_INFINITE_LOOP) <failure>: Declare `ssize_t'.
3979 <compile_stack_type>: `size' and `avail' are now `size_t'.
3980
3981 * regex.h <regoff_t>: Use ssize_t, not int.
3982 (re_search, re_search_2, re_match, re_match_2): Arguments that
3983 specify buffer/string position and length are now ssize_t and
3984 size_t. Return type is regoff_t.
3985
3986 2011-04-16 Ben Key <bkey76@gmail.com>
3987
3988 * nsfont.m: Fixed bugs in ns_get_family and
3989 ns_descriptor_to_entity that were caused by using free to
3990 deallocate memory blocks that were allocated by xmalloc (via
3991 xstrdup). This caused Emacs to crash when compiled with
3992 XMALLOC_OVERRUN_CHECK defined (when Emacs was configured with
3993 --enable-checking=xmallocoverrun). xfree is now used to
3994 deallocate these memory blocks.
3995
3996 2011-04-15 Paul Eggert <eggert@cs.ucla.edu>
3997
3998 * sysdep.c (emacs_read): Remove unnecessary check vs MAX_RW_COUNT.
3999
4000 emacs_write: Accept and return EMACS_INT for sizes.
4001 See http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00514.html
4002 et seq.
4003 * gnutls.c, gnutls.h (emacs_gnutls_read, emacs_gnutls_write):
4004 Accept and return EMACS_INT.
4005 (emacs_gnutls_write): Return the number of bytes written on
4006 partial writes.
4007 * sysdep.c, lisp.h (emacs_read, emacs_write): Likewise.
4008 (emacs_read, emacs_write): Remove check for negative size, as the
4009 Emacs source code has been audited now.
4010 * sysdep.c (MAX_RW_COUNT): New macro, to work around kernel bugs.
4011 (emacs_read, emacs_write): Use it.
4012 * process.c (send_process): Adjust to the new signatures of
4013 emacs_write and emacs_gnutls_write. Do not attempt to store
4014 a byte offset into an 'int'; it might overflow.
4015 See http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00483.html
4016
4017 * sound.c: Don't assume sizes fit in 'int'.
4018 (struct sound_device.period_size, alsa_period_size):
4019 Return EMACS_INT, not int.
4020 (struct sound_device.write, vox_write, alsa_write):
4021 Accept EMACS_INT, not int.
4022 (wav_play, au_play): Use EMACS_INT to store sizes and to
4023 record read return values.
4024
4025 2011-04-15 Ben Key <bkey76@gmail.com>
4026
4027 * keyboard.c (Qundefined): Don't declare static since it is used
4028 in nsfns.m.
4029 * xfaces.c (Qbold, Qexpanded, Qitalic, Qcondensed): Don't declare
4030 static since they are used in nsfont.m.
4031
4032 2011-04-15 Stefan Monnier <monnier@iro.umontreal.ca>
4033
4034 * process.c (Qprocessp): Don't declare static.
4035 * lisp.h (Qprocessp): Declare again.
4036
4037 2011-04-15 Juanma Barranquero <lekktu@gmail.com>
4038
4039 * font.c (Qopentype): Don't make static (used from w32uniscribe.c).
4040
4041 2011-04-14 Paul Eggert <eggert@cs.ucla.edu>
4042
4043 Improve C-level modularity by making more things 'static'.
4044
4045 Don't publish debugger-only interfaces to other modules.
4046 * lisp.h (safe_debug_print, debug_output_compilation_hack):
4047 (verify_bytepos, count_markers): Move decls to the only modules
4048 that need them.
4049 * region-cache.h (pp_cache): Likewise.
4050 * window.h (check_all_windows): Likewise.
4051 * marker.c, print.c, region-cache.c, window.c: Decls moved here.
4052
4053 * sysdep.c (croak): Now static, if
4054 defined TIOCNOTTY || defined USG5 || defined CYGWIN.
4055 * syssignal.h (croak): Declare only if not static.
4056
4057 * alloc.c (refill_memory_reserve): Now static if
4058 !defined REL_ALLOC || defined SYSTEM_MALLOC.
4059 * lisp.h (refill_memory_reserve): Declare only if not static.
4060
4061 * xsettings.c, xsettings.h (xsettings_get_system_normal_font):
4062 Define only if USE_LUCID.
4063
4064 * xrdb.c (x_customization_string, x_rm_string): Now static.
4065
4066 * xmenu.c (x_menu_wait_for_event): Export only if USE_MOTIF.
4067 * xterm.h (x_menu_wait_for_event): Declare only if USE_MOTIF.
4068
4069 * xdisp.c (draw_row_with_mouse_face): Now static.
4070 * dispextern.h (draw_row_with_mouse_fave): Remove decl.
4071
4072 * window.h (check_all_windows): Mark externally visible.
4073
4074 * window.c (window_deletion_count): Now static.
4075
4076 * undo.c: Make symbols static if they're not exported.
4077 (last_undo_buffer, last_boundary_position, pending_boundary):
4078 Now static.
4079
4080 * textprop.c (interval_insert_behind_hooks): Now static.
4081 (interval_insert_in_front_hooks): Likewise.
4082
4083 * term.c: Make symbols static if they're not exported.
4084 (tty_turn_off_highlight, get_tty_terminal, max_frame_cols):
4085 (max_frame_lines, tty_set_terminal_modes):
4086 (tty_reset_terminal_modes, tty_turn_off_highlight):
4087 (get_tty_terminal): Now static.
4088 (term_mouse_moveto): Do not define if HAVE_WINDOW_SYSTEM.
4089 * termhooks.h (term_mouse_moveto): Do not declare if
4090 HAVE_WINDOW_SYSTEM.
4091 * dispextern.h (tty_set_terminal_modes, tty_reset_terminal_modes):
4092 (tty_turn_off_highlight, get_tty_terminal): Remove decls.
4093
4094 * sysdep.c: Make symbols static if they're not exported.
4095 (emacs_get_tty, emacs_set_tty, old_fcntl_flags, old_fcntl_owner):
4096 Now static.
4097 (sigprocmask_set, full_mask): Remove; unused.
4098 (wait_debugging): Mark as visible.
4099 * syssignal.h (SIGFULLMASK, full_mask): Remove decls.
4100 * systty.h (emacs_get_tty, emacs_set_tty): Remove decls.
4101
4102 * syntax.c (syntax_temp): Define only if !__GNUC__.
4103
4104 * sound.c (current_sound_device, current_sound): Now static.
4105
4106 * search.c (searchbufs, searchbuf_head): Now static.
4107
4108 * scroll.c (scroll_cost): Remove; unused.
4109 * dispextern.h (scroll_cost): Remove decl.
4110
4111 * region-cache.h (pp_cache): Mark as externally visible.
4112
4113 * process.c: Make symbols static if they're not exported.
4114 (process_tick, update_tick, create_process, chan_process):
4115 (Vprocess_alist, proc_buffered_char, datagram_access):
4116 (fd_callback_data, send_process_frame, process_sent_to): Now static.
4117 (deactivate_process): Mark defn as static, as well as decl.
4118 * lisp.h (create_process): Remove decl.
4119 * process.h (chan_process, Vprocess_alist): Remove decls.
4120
4121 * print.c: Make symbols static if they're not exported.
4122 (print_depth, new_backquote_output, being_printed, print_buffer):
4123 (print_buffer_size, print_buffer_pos, print_buffer_pos_byte):
4124 (print_interval, print_number_index, initial_stderr_stream):
4125 Now static.
4126 * lisp.h (Fprinc): Remove decl.
4127 (debug_output_compilation_hack): Mark as externally visible.
4128
4129 * sysdep.c (croak): Move decl from here to syssignal.h.
4130 * syssignal.h (croak): Put it here, so the API can be checked when
4131 'croak' is called from dissociate_if_controlling_tty.
4132
4133 * minibuf.c: Make symbols static if they're not exported.
4134 (minibuf_save_list, choose_minibuf_frame): Now static.
4135 * lisp.h (choose_minibuf_frame): Remove decl.
4136
4137 * lisp.h (verify_bytepos, count_markers): Mark as externally visible.
4138
4139 * lread.c: Make symbols static if they're not exported.
4140 (read_objects, initial_obarray, oblookup_last_bucket_number):
4141 Now static.
4142 (make_symbol): Remove; unused.
4143 * lisp.h (initial_obarray, make_symbol): Remove decls.
4144
4145 * keyboard.c: Make symbols static if they're not exported.
4146 (single_kboard, recent_keys_index, total_keys, recent_keys):
4147 (this_command_key_count_reset, raw_keybuf, raw_keybuf_count):
4148 (this_single_command_key_start, echoing, last_auto_save):
4149 (read_key_sequence_cmd, dribble, recursive_edit_unwind):
4150 (command_loop, echo_now, keyboard_init_hook, help_char_p):
4151 (quit_throw_to_read_char, command_loop_2, top_level_1, poll_timer):
4152 (Vlispy_mouse_stem, double_click_count):
4153 Now static.
4154 (force_auto_save_soon): Define only if SIGDANGER.
4155 (ignore_mouse_drag_p): Now static if
4156 !defined HAVE_WINDOW_SYSTEM || defined USE_GTK || defined HAVE_NS.
4157 (print_help): Remove; unused.
4158 (stop_character, last_timer_event): Mark as externally visible.
4159 * keyboard.h (ignore_mouse_drag_p): Declare only if
4160 defined HAVE_WINDOW_SYSTEM && !defined USE_GTK && !defined HAVE_NS.
4161 (echo_now, help_char_p, quit_throw_to_read_char): Remove decls.
4162 * lisp.h (echoing): Remove decl.
4163 (force_auto_save_soon): Declare only if SIGDANGER.
4164 * xdisp.c (redisplay_window): Simplify code, to make it more
4165 obvious that ignore_mouse_drag_p is not accessed if !defined
4166 USE_GTK && !defined HAVE_NS.
4167
4168 * intervals.c: Make symbols static if they're not exported.
4169 (merge_properties_sticky, merge_interval_right, delete_interval):
4170 Now static.
4171 * intervals.h (merge_interval_right, delete_interval): Remove decls.
4172
4173 * insdel.c: Make symbols static if they're not exported.
4174 However, leave prepare_to_modify_buffer alone. It's never
4175 called from outside this function, but that appears to be a bug.
4176 (combine_after_change_list, combine_after_change_buffer):
4177 (adjust_after_replace, signal_before_change): Now static.
4178 (adjust_after_replace_noundo): Remove; unused.
4179 * lisp.h (adjust_after_replace, adjust_after_replace_noundo):
4180 (signal_before_change): Remove decls.
4181
4182 * indent.c (val_compute_motion, val_vmotion): Now static.
4183
4184 * image.c: Make symbols static if they're not exported.
4185 * dispextern.h (x_create_bitmap_from_xpm_data): Do not declare
4186 if USE_GTK.
4187 * image.c (x_create_bitmap_from_xpm_data): Do not define if USE_GTK.
4188 (xpm_color_cache, ct_table, ct_colors_allocated): Now static.
4189
4190 * fringe.c (standard_bitmaps): Now static.
4191 (max_used_fringe_bitmap): Now static, unless HAVE_NS.
4192
4193 * frame.c: Make symbols static if they're not exported.
4194 (x_report_frame_params, make_terminal_frame): Now static.
4195 (get_frame_param): Now static, unless HAVE_NS.
4196 (x_fullscreen_adjust): Define if WINDOWSNT, not if HAVE_WINDOW_SYSTEM.
4197 (x_get_resource_string): Remove; not used.
4198 * frame.h (make_terminal_frame, x_report_frame_params):
4199 (x_get_resource_string); Remove decls.
4200 (x_fullscreen_adjust): Declare only if WINDOWSNT.
4201 * lisp.h (get_frame_param): Declare only if HAVE_NS.
4202
4203 * font.c, fontset.c: Make symbols static if they're not exported.
4204 * dispextern.h (FACE_SUITABLE_FOR_ASCII_CHAR_P): New macro.
4205 (FACE_SUITABLE_FOR_CHAR_P): Use it.
4206 * font.c (font_close_object): Now static.
4207 * font.h (font_close_object): Remove.
4208 * fontset.c (FONTSET_OBJLIST): Remove.
4209 (free_realized_fontset) #if-0 the body, which does nothing.
4210 (face_suitable_for_char_p): #if-0, as it's never called.
4211 * fontset.h (face_suitable_for_char_p): Remove decl.
4212 * xfaces.c (face_at_string_position):
4213 Use FACE_SUITABLE_FOR_ASCII_CHAR_P, not FACE_SUITABLE_FOR_CHAR_P,
4214 since 0 is always ASCII.
4215
4216 * fns.c (weak_hash_tables): Now static.
4217
4218 * fileio.c: Make symbols static if they're not exported.
4219 (auto_saving, auto_save_mode_bits, auto_save_error_occurred):
4220 (Vwrite_region_annotation_buffers): Now static.
4221
4222 * eval.c: Make symbols static if they're not exported.
4223 (backtrace_list, lisp_eval_depth, when_entered_debugger): Now static.
4224 * lisp.h (backtrace_list): Remove decl.
4225
4226 * emacs.c: Make symbols static if they're not exported.
4227 (malloc_state_ptr, malloc_using_checking, syms_of_emacs):
4228 (fatal_error_code, fatal_error_signal_hook, standard_args):
4229 Now static.
4230 (fatal_error_signal): Now static, unless FLOAT_CATCH_SIGKILL.
4231 (DEFINE_DUMMY_FUNCTION): Mark function as externally visible.
4232 (__CTOR_LIST__, __DTOR_LIST__): Now externally visible.
4233 * lisp.h (fatal_error_signal_hook): Remove decl.
4234 (fatal_error_signal): Declare only if FLOAT_CATCH_SIGKILL.
4235
4236 * editfns.c: Move a (normally-unused) function to its only use.
4237 * editfns.c, lisp.h (get_operating_system_release): Remove.
4238 * process.c (init_process) [DARWIN_OS]: Do it inline, as it is not
4239 worth the hassle of breaking this out.
4240
4241 * xterm.c: Make symbols static if they're not exported.
4242 (x_raise_frame, x_lower_frame, x_wm_set_window_state):
4243 (x_wm_set_icon_pixmap, x_initialize, XTread_socket_fake_io_error):
4244 (x_destroy_window, x_delete_display):
4245 Now static.
4246 (x_dispatch_event): Now static if ! (USE_MOTIF || USE_X_TOOLKIT).
4247 (x_mouse_leave): Remove; unused.
4248 * xterm.h (x_display_info_for_name, x_raise_frame, x_lower_frame):
4249 (x_destroy_window, x_wm_set_window_state, x_wm_set_icon_pixmap):
4250 (x_delete_display, x_initialize, x_set_border_pixel, x_screen_planes):
4251 Remove decls.
4252 (x_mouse_leave): Declare only if WINDOWSNT.
4253 (x_dispatch_event): Declare only if USE_MOTIF or USE_X_TOOLKIT.
4254 (xic_create_fontsetname): Declare only if HAVE_X_WINDOWS &&
4255 USE_X_TOOLKIT.
4256
4257 * ftxfont.c: Make symbols static if they're not exported.
4258 (ftxfont_driver): Export only if !defined HAVE_XFT && def8ined
4259 HAVE_FREETYPE.
4260 * font.h (ftxfont_driver): Likewise.
4261
4262 * xfns.c: Make symbols static if they're not exported.
4263 (x_last_font_name, x_display_info_for_name):
4264 (x_set_foreground_color, x_set_background_color, x_set_mouse_color):
4265 (x_set_cursor_color, x_set_border_pixel, x_set_border_color):
4266 (x_set_cursor_type, x_set_icon_type, x_set_icon_name):
4267 (x_set_scroll_bar_foreground, x_set_scroll_bar_background):
4268 (x_explicitly_set_name, x_set_title, xic_defaut_fontset, tip_timer):
4269 (last_show_tip_args): Now static.
4270 (xic_defaut_fontset, xic_create_fontsetname): Define only if
4271 defined HAVE_X_WINDOWS && defined USE_X_TOOLKIT
4272 (x_screen_planes): Remove; unused.
4273 * dispextern.h (x_screen_planes): Remove decl.
4274
4275 * dispnew.c: Make symbols static if they're not exported.
4276 * dispextern.h (redraw_garbaged_frames, scrolling):
4277 (increment_row_positions): Remove.
4278 * dispnew.c (new_glyph_matrix, increment_row_positions, scrolling):
4279 (delayed_size_change, glyph_matrix_count, glyph_pool_count):
4280 Now static.
4281 (redraw_garbaged_frames): Remove; unused.
4282
4283 * xfaces.c: Make symbols static if they're not exported.
4284 * dispextern.h (ascii_face_of_lisp_face, free_realized_face):
4285 Remove decls.
4286 * xterm.h (defined_color): Remove decls.
4287 (x_free_dpy_colors): Declare only if USE_X_TOOLKIT.
4288 * xfaces.c (tty_suppress_bold_inverse_default_colors_p):
4289 (menu_face_changed_default, defined_color, free_realized_face):
4290 (x_free_dpy_colors): Define only if USE_X_TOOLKIT.
4291 (ascii_face_of_lisp_face): Remove; unused.
4292
4293 * xdisp.c: Make symbols static if they're not exported.
4294 * dispextern.h (scratch_glyph_row, window_box_edges):
4295 (glyph_to_pixel_coords, set_cursor_from_row):
4296 (get_next_display_element, set_iterator_to_next):
4297 (highlight_trailing_whitespace, frame_to_window_pixel_xy):
4298 (show_mouse_face): Remove decls
4299 * frame.h (message_buf_print): Likewise.
4300 * lisp.h (pop_message, set_message, check_point_in_composition):
4301 Likewise.
4302 * xterm.h (set_vertical_scroll_bar): Likewise.
4303 * xdisp.c (list_of_error, Vmessage_stack, line_number_displayed):
4304 (message_buf_print, scratch_glyph_row, displayed_buffer):
4305 (set_iterator_to_next, pop_message, set_message, set_cursor_from_row):
4306 (get_next_display_element, show_mouse_face, window_box_edges):
4307 (frame_to_window_pixel_xy, check_point_in_composition):
4308 (set_vertical_scroll_bar, highlight_trailing_whitespace): Now static.
4309 (glyph_to_pixel_coords): Remove; unused.
4310
4311 * dired.c (file_name_completion): Now static.
4312
4313 * dbusbind.c (xd_in_read_queued_messages): Now static.
4314
4315 * lisp.h (circular_list_error, FOREACH): Remove; unused.
4316 * data.c (circular_list_error): Remove.
4317
4318 * commands.h (last_point_position, last_point_position_buffer):
4319 (last_point_position_window): Remove decls.
4320 * keyboard.c: Make these variables static.
4321
4322 * coding.h (coding, code_convert_region, encode_coding_gap):
4323 Remove decls.
4324 * coding.c (Vsjis_coding_system, Vbig5_coding_system):
4325 (iso_code_class, detect_coding, code_convert_region): Now static.
4326 (encode_coding_gap): Remove; unused.
4327
4328 * chartab.c (chartab_chars, chartab_bits): Now static.
4329
4330 * charset.h (charset_iso_8859_1): Remove decl.
4331 * charset.c (charset_iso_8859_1, charset_emacs, map_charset_for_dump):
4332 Now static.
4333
4334 * ccl.h (check_ccl_update, Vccl_program_table): Remove decls.
4335 * ccl.c (Vccl_program_table): Now static.
4336 (check_ccl_update): Remove; unused.
4337
4338 * category.c (SET_CATEGORY_SET, set_category_set): Move here.
4339 * category.h: ... from here.
4340 * category.c (check_category_table, set_category_set): Now static.
4341
4342 * casetab.c (Vascii_upcase_table, Vascii_eqv_table): Now static.
4343 * lisp.h: Remove these decls.
4344
4345 * buffer.c (buffer_count): Remove unused var.
4346
4347 * bidi.c (bidi_dump_cached_states): Mark as externally visible,
4348 so that it's not optimized away.
4349 (bidi_ignore_explicit_marks_for_paragraph_level): Likewise.
4350 * dispextern.h (bidi_dump_cached_states): Remove, since it's
4351 exported only to the debugger.
4352
4353 * atimer.c (alarm_signal_handler, run_all_atimers): Now static.
4354 * atimer.h (run_all_atimers): Remove; not exported.
4355
4356 font.c: Make copy_font_spec and merge_font_spec ordinary C functions.
4357 * font.c (copy_font_spec): Rename from Fcopy_font_spec, since it
4358 was inaccessible from Lisp.
4359 (merge_font_spec): Likewise, renaming from Fmerge_font_spec.
4360 * font.c, font.h, fontset.c, xfaces.c, xfont.c: Change all uses.
4361
4362 alloc.c: Import and export fewer symbols, and remove unused items.
4363 * lisp.h (suppress_checking, die): Declare only if ENABLE_CHECKING
4364 is defined.
4365 (suppress_checking): Add EXTERNALLY_VISIBLE attribute, so that
4366 it's not optimized away by whole-program optimization.
4367 (message_enable_multibyte, free_misc): Remove.
4368 (catchlist, handlerlist, mark_backtrace):
4369 Declare only if BYTE_MARK_STACK.
4370 (mark_byte_stack): Likewise, fixing a ifdef-vs-if typo.
4371 * alloc.c (pure): Export only if VIRT_ADDR_VARIES is defined.
4372 (message_enable_multibyte): Remove decl.
4373 (free_misc, interval_free_list, float_block, float_block_index):
4374 (n_float_blocks, float_free_list, cons_block, cons_block_index):
4375 (cons_free_list, last_marked_index):
4376 Now static.
4377 (suppress_checking, die): Define only if ENABLE_CHECKING is defined.
4378 * eval.c (catchlist, handlerlist): Export only if BYTE_MARK_STACK.
4379 (mark_backtrace): Define only if BYTE_MARK_STACK.
4380 * xdisp.c (message_enable_multibyte): Now static.
4381
4382 Declare Lisp_Object Q* variables to be 'static' if not exported.
4383 This makes it easier for human readers (and static analyzers)
4384 to see whether these variables are used from other modules.
4385 * alloc.c, buffer.c, bytecode.c, callint.c, casetab.c, category.c:
4386 * ccl.c, character.c, charset.c, cmds.c, coding.c, composite.c:
4387 * data.c, dbusbind.c, dired.c, editfns.c, eval.c, fileio.c, fns.c:
4388 * font.c, frame.c, fringe.c, ftfont.c, image.c, keyboard.c, keymap.c:
4389 * lread.c, macros.c, minibuf.c, print.c, process.c, search.c:
4390 * sound.c, syntax.c, textprop.c, window.c, xdisp.c, xfaces.c, xfns.c:
4391 * xmenu.c, xselect.c:
4392 Declare Q* vars static if they are not used in other modules.
4393 * ccl.h, character.h, charset.h, coding.h, composite.h, font.h:
4394 * frame.h, intervals.h, keyboard.h, lisp.h, process.h, syntax.h:
4395 Remove decls of unexported vars.
4396 * keyboard.h (EVENT_HEAD_UNMODIFIED): Remove now-unused macro.
4397
4398 * lisp.h (DEFINE_FUNC): Make sname 'static'.
4399
4400 Make Emacs functions such as Fatom 'static' by default.
4401 This makes it easier for human readers (and static analyzers)
4402 to see whether these functions can be called from other modules.
4403 DEFUN now defines a static function. To make the function external
4404 so that it can be used in other C modules, use the new macro DEFUE.
4405 * lisp.h (Funibyte_char_to_multibyte, Fsyntax_table_p):
4406 (Finit_image_library):
4407 (Feval_region, Fbacktrace, Ffetch_bytecode, Fswitch_to_buffer):
4408 (Ffile_executable_p, Fmake_symbolic_link, Fcommand_execute):
4409 (Fget_process, Fdocumentation_property, Fbyte_code, Ffile_attributes):
4410 Remove decls, since these functions are now static.
4411 (Funintern, Fget_internal_run_time): New decls, since these functions
4412 were already external.
4413
4414 * alloc.c, buffer.c, callint.c, callproc.c, casefiddle.c, casetab.c:
4415 * ccl.c, character.c, chartab.c, cmds.c, coding.c, data.c, dispnew.c:
4416 * doc.c, editfns.c, emacs.c, eval.c, fileio.c, filelock.c, floatfns.c:
4417 * fns.c, font.c, fontset.c, frame.c, image.c, indent.c:
4418 * keyboard.c, keymap.c, lread.c:
4419 * macros.c, marker.c, menu.c, minibuf.c, print.c, process.c, search.c:
4420 * syntax.c, term.c, terminal.c, textprop.c, undo.c:
4421 * window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xsettings.c:
4422 Mark functions with DEFUE instead of DEFUN,
4423 if they are used in other modules.
4424 * buffer.c (Fset_buffer_major_mode, Fdelete_overlay): New forward
4425 decls for now-static functions.
4426 * buffer.h (Fdelete_overlay): Remove decl.
4427 * callproc.c (Fgetenv_internal): Mark as internal.
4428 * composite.c (Fremove_list_of_text_properties): Remove decl.
4429 (Fcomposition_get_gstring): New forward static decl.
4430 * composite.h (Fcomposite_get_gstring): Remove decl.
4431 * dired.c (Ffile_attributes): New forward static decl.
4432 * doc.c (Fdocumntation_property): New forward static decl.
4433 * eval.c (Ffetch_bytecode): New forward static decl.
4434 (Funintern): Remove extern decl; now in .h file where it belongs.
4435 * fileio.c (Fmake_symbolic_link): New forward static decl.
4436 * image.c (Finit_image_library): New forward static decl.
4437 * insdel.c (Fcombine_after_change_execute): Make forward decl static.
4438 * intervals.h (Fprevious_property_change):
4439 (Fremove_list_of_text_properties): Remove decls.
4440 * keyboard.c (Fthis_command_keys): Remove decl.
4441 (Fcommand_execute): New forward static decl.
4442 * keymap.c (Flookup_key): New forward static decl.
4443 (Fcopy_keymap): Now static.
4444 * keymap.h (Flookup_key): Remove decl.
4445 * process.c (Fget_process): New forward static decl.
4446 (Fprocess_datagram_address): Mark as internal.
4447 * syntax.c (Fsyntax_table_p): New forward static decl.
4448 (skip_chars): Remove duplicate decl.
4449 * textprop.c (Fprevious_property_change): New forward static decl.
4450 * window.c (Fset_window_fringes, Fset_window_scroll_bars):
4451 Now internal.
4452 (Fset_window_margins, Fset_window_vscroll): New forward static decls.
4453 * window.h (Fset_window_vscroll, Fset_window_margins): Remove decls.
4454
4455 * editfns.c (Fformat): Remove unreachable code.
4456
4457 2011-04-14 Andreas Schwab <schwab@linux-m68k.org>
4458
4459 * fileio.c (Finsert_file_contents): Fix typo in 2005-05-13
4460 change. (Bug#8496)
4461
4462 2011-04-13 Eli Zaretskii <eliz@gnu.org>
4463
4464 * xdisp.c (handle_invisible_prop): Don't call bidi_paragraph_init
4465 when at ZV. (Bug#8487)
4466
4467 2011-04-12 Andreas Schwab <schwab@linux-m68k.org>
4468
4469 * charset.c (Fclear_charset_maps): Use xfree instead of free.
4470 (Bug#8437)
4471 * keyboard.c (parse_tool_bar_item): Likewise.
4472 * sound.c (sound_cleanup, alsa_close): Likewise.
4473 * termcap.c (tgetent): Likewise.
4474 * xfns.c (x_default_font_parameter): Likewise.
4475 * xsettings.c (read_and_apply_settings): Likewise.
4476
4477 * alloc.c (overrun_check_malloc, overrun_check_realloc)
4478 (overrun_check_free): Protoize.
4479
4480 2011-04-12 Paul Eggert <eggert@cs.ucla.edu>
4481
4482 * sysdep.c (emacs_read, emacs_write): Check for negative sizes
4483 since callers should never pass a negative size.
4484 Change the signature to match that of plain 'read' and 'write'; see
4485 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00397.html>.
4486 * lisp.h: Update prototypes of emacs_write and emacs_read.
4487
4488 2011-04-11 Eli Zaretskii <eliz@gnu.org>
4489
4490 * xdisp.c (redisplay_window): Don't try to determine the character
4491 position of the scroll margin if the window start point w->startp
4492 is outside the buffer's accessible region. (Bug#8468)
4493
4494 2011-04-10 Eli Zaretskii <eliz@gnu.org>
4495
4496 Fix write-region and its subroutines for buffers > 2GB.
4497 * fileio.c (a_write, e_write): Modify declaration of arguments and
4498 local variables to support buffers larger than 2GB.
4499 (Fcopy_file): Use EMACS_INT for return value of emacs_read.
4500
4501 * sysdep.c (emacs_write, emacs_read): Use ssize_t for last
4502 argument, local variables, and return value.
4503
4504 * lisp.h: Update prototypes of emacs_write and emacs_read.
4505
4506 * sound.c (vox_write): Use ssize_t for return value of emacs_write.
4507
4508 2011-04-10 Paul Eggert <eggert@cs.ucla.edu>
4509
4510 * xdisp.c (vmessage): Use memchr, not strnlen, which some hosts lack.
4511
4512 Fix more problems found by GCC 4.6.0's static checks.
4513
4514 * xdisp.c (vmessage): Use a better test for character truncation.
4515
4516 * charset.c (load_charset_map): <, not <=, for optimization,
4517 and to avoid potential problems with integer overflow.
4518 * chartab.c (sub_char_table_set_range, char_table_set_range): Likewise.
4519 * casetab.c (set_identity, shuffle): Likewise.
4520 * editfns.c (Fformat): Likewise.
4521 * syntax.c (skip_chars): Likewise.
4522
4523 * xmenu.c (set_frame_menubar): Allocate smaller local vectors.
4524 This also lets GCC 4.6.0 generate slightly better loop code.
4525
4526 * callint.c (Fcall_interactively): <, not <=, for optimization.
4527 (Fcall_interactively): Count the number of arguments produced,
4528 not the number of arguments given. This is simpler and lets GCC
4529 4.6.0 generate slightly better code.
4530
4531 * ftfont.c: Distingish more carefully between FcChar8 and char.
4532 The previous code passed unsigned char * to a functions like
4533 strlen and xstrcasecmp that expect char *, which does not
4534 conform to the C standard.
4535 (get_adstyle_property, ftfont_pattern_entity): Use FcChar8 for
4536 arguments to FcPatternGetString, and explicitly cast FcChar8 * to
4537 char * when the C standard requires it.
4538
4539 * keyboard.c (read_char): Remove unused var.
4540
4541 * eval.c: Port to Windows vsnprintf (Bug#8435).
4542 Include <limits.h>.
4543 (SIZE_MAX): Define if the headers do not.
4544 (verror): Do not give up if vsnprintf returns a negative count.
4545 Instead, grow the buffer. This ports to Windows vsnprintf, which
4546 does not conform to C99. Problem reported by Eli Zaretskii.
4547 Also, simplify the allocation scheme, by avoiding the need for
4548 calling realloc, and removing the ALLOCATED variable.
4549
4550 * eval.c (verror): Initial buffer size is 4000 (not 200) bytes.
4551
4552 Remove invocations of doprnt, as Emacs now uses vsnprintf.
4553 But keep the doprint source code for now, as we might revamp it
4554 and use it again (Bug#8435).
4555 * lisp.h (doprnt): Remove.
4556 * Makefile.in (base_obj): Remove doprnt.o.
4557 * deps.mk (doprnt.o): Remove.
4558
4559 error: Print 32- and 64-bit integers portably (Bug#8435).
4560 Without this change, on typical 64-bit hosts error ("...%d...", N)
4561 was used to print both 32- and 64-bit integers N, which relied on
4562 undefined behavior.
4563 * lisp.h, src/m/amdx86-64.h, src/m/ia64.h, src/m/ibms390x.h (pEd):
4564 New macro.
4565 * lisp.h (error, verror): Mark as printf-like functions.
4566 * eval.c (verror): Use vsnprintf, not doprnt, to do the real work.
4567 Report overflow in size calculations when allocating printf buffer.
4568 Do not truncate output string at its first null byte.
4569 * xdisp.c (vmessage): Use vsnprintf, not doprnt, to do the real work.
4570 Truncate the output at a character boundary, since vsnprintf does not
4571 do that.
4572 * charset.c (check_iso_charset_parameter): Convert internal
4573 character to string before calling 'error', since %c now has the
4574 printf meaning.
4575 * coding.c (Fdecode_sjis_char, Fdecode_big5_char): Avoid int
4576 overflow when computing char to be passed to 'error'. Do not
4577 pass Lisp_Object to 'error'; pass the integer instead.
4578 * nsfns.m (Fns_do_applescript): Use int, not long, since it's
4579 formatted with plain %d.
4580
4581 * eval.c (internal_lisp_condition_case): Don't pass spurious arg.
4582
4583 * keyboard.c (access_keymap_keyremap): Print func name, not garbage.
4584
4585 * coding.c (Fdecode_sjis_char): Don't assume CODE fits in int.
4586
4587 * xterm.c (x_catch_errors): Remove duplicate declaration.
4588
4589 * term.c (maybe_fatal): Mark its 3rd arg as a printf format, too.
4590
4591 * xdisp.c, lisp.h (message_nolog): Remove; unused.
4592
4593 2011-04-10 Jim Meyering <meyering@redhat.com>
4594
4595 use ssize_t and size_t for read- and write-like emacs_gnutls_* functions
4596 * gnutls.c (emacs_gnutls_read): Adjust signature to be more read-like:
4597 return ssize_t not "int", and use size_t as the buffer length.
4598 (emacs_gnutls_write): Likewise, and make the buffer pointer "const".
4599 * gnutls.h: Update declarations.
4600 * process.c (read_process_output): Use ssize_t, to match.
4601 (send_process): Likewise.
4602
4603 2011-04-09 Chong Yidong <cyd@stupidchicken.com>
4604
4605 * image.c (Fimagemagick_types): Doc fix, and comment cleanup.
4606
4607 2011-04-09 Chong Yidong <cyd@stupidchicken.com>
4608
4609 * ftfont.c (get_adstyle_property, ftfont_pattern_entity):
4610 Use unsigned char, to match FcChar8 type definition.
4611
4612 * xterm.c (handle_one_xevent):
4613 * xmenu.c (create_and_show_popup_menu):
4614 * xselect.c (x_decline_selection_request)
4615 (x_reply_selection_request): Avoid type-punned deref of X events.
4616
4617 2011-04-09 Eli Zaretskii <eliz@gnu.org>
4618
4619 Fix some uses of `int' instead of EMACS_INT.
4620 * search.c (string_match_1, fast_string_match)
4621 (fast_c_string_match_ignore_case, fast_string_match_ignore_case)
4622 (scan_buffer, find_next_newline_no_quit)
4623 (find_before_next_newline, search_command, Freplace_match)
4624 (Fmatch_data): Make some `int' variables be EMACS_INT.
4625
4626 * xdisp.c (display_count_lines): 3rd argument and return value now
4627 EMACS_INT. All callers changed.
4628 (pint2hrstr): Last argument is now EMACS_INT.
4629
4630 * coding.c (detect_coding_utf_8, detect_coding_emacs_mule)
4631 (detect_coding_iso_2022, detect_coding_sjis, detect_coding_big5)
4632 (detect_coding_ccl, detect_coding_charset, decode_coding_utf_8)
4633 (decode_coding_utf_16, decode_coding_emacs_mule)
4634 (decode_coding_iso_2022, decode_coding_sjis, decode_coding_big5)
4635 (decode_coding_ccl, decode_coding_charset)
4636 <consumed_chars, consumed_chars_base>: Declare EMACS_INT.
4637 (decode_coding_iso_2022, decode_coding_emacs_mule)
4638 (decode_coding_sjis, decode_coding_big5, decode_coding_charset)
4639 <char_offset, last_offset>: Declare EMACS_INT.
4640 (encode_coding_utf_8, encode_coding_utf_16)
4641 (encode_coding_emacs_mule, encode_invocation_designation)
4642 (encode_designation_at_bol, encode_coding_iso_2022)
4643 (encode_coding_sjis, encode_coding_big5, encode_coding_ccl)
4644 (encode_coding_raw_text, encode_coding_charset) <produced_chars>:
4645 Declare EMACS_INT.
4646 (ASSURE_DESTINATION): Declare more_bytes EMACS_INT.
4647 (encode_invocation_designation): Last argument P_NCHARS is now
4648 EMACS_INT.
4649 (decode_eol): Declare pos_byte, pos, and pos_end EMACS_INT.
4650 (produce_chars): from_nchars and to_nchars are now EMACS_INT.
4651
4652 * coding.h (struct coding_system) <head_ascii>: Declare EMACS_INT.
4653 All users changed.
4654
4655 * ccl.c (Fccl_execute_on_string): Declare some variables
4656 EMACS_INT.
4657
4658 2011-04-08 Samuel Thibault <sthibault@debian.org> (tiny change)
4659
4660 * term.c (init_tty): Fix incorrect ifdef placement (Bug#8450).
4661
4662 2011-03-19 Christoph Scholtes <cschol2112@googlemail.com>
4663
4664 * process.c (Fformat_network_address): Doc fix.
4665
4666 2011-04-08 T.V. Raman <tv.raman.tv@gmail.com> (tiny change)
4667
4668 * xml.c (parse_region): Avoid creating spurious whiespace nodes.
4669
4670 2011-04-08 Chong Yidong <cyd@stupidchicken.com>
4671
4672 * keyboard.c (read_char): Call Lisp function help-form-show,
4673 instead of using internal_with_output_to_temp_buffer.
4674 (Qhelp_form_show): New var.
4675 (syms_of_keyboard): Use DEFSYM macro.
4676
4677 * print.c (internal_with_output_to_temp_buffer): Function deleted.
4678
4679 * lisp.h (internal_with_output_to_temp_buffer): Remove prototype.
4680
4681 2011-04-06 Chong Yidong <cyd@stupidchicken.com>
4682
4683 * process.c (Flist_processes): Remove to Lisp.
4684 (list_processes_1): Delete.
4685
4686 2011-04-06 Eli Zaretskii <eliz@gnu.org>
4687
4688 * msdos.c (careadlinkat, careadlinkatcwd): MS-DOS replacements.
4689
4690 * w32.c (careadlinkat, careadlinkatcwd): New always-fail stubs.
4691
4692 2011-04-06 Paul Eggert <eggert@cs.ucla.edu>
4693
4694 Fix more problems found by GCC 4.6.0's static checks.
4695
4696 * xmenu.c (Fx_popup_dialog): Don't assume string is free of formats.
4697
4698 * menu.c (Fx_popup_menu): Don't assume error_name lacks printf formats.
4699
4700 * lisp.h (message, message_nolog, fatal): Mark as printf-like.
4701
4702 * xdisp.c (vmessage): Mark as a printf-like function.
4703
4704 * term.c (vfatal, maybe_fatal): Mark as printf-like functions.
4705
4706 * sound.c (sound_warning): Don't crash if arg contains a printf format.
4707
4708 * image.c (tiff_error_handler, tiff_warning_handler): Mark as
4709 printf-like functions.
4710 (tiff_load): Add casts to remove these marks before passing them
4711 to system-supplied API.
4712
4713 * eval.c (Fsignal): Remove excess argument to 'fatal'.
4714
4715 * coding.c (EMIT_ONE_BYTE, EMIT_TWO_BYTES): Use unsigned, not int.
4716 This avoids several warnings with gcc -Wstrict-overflow.
4717 (DECODE_COMPOSITION_RULE): If the rule is invalid, goto invalid_code
4718 directly, rather than having caller test rule sign. This avoids
4719 some unnecessary tests.
4720 * composite.h (COMPOSITION_ENCODE_RULE_VALID): New macro.
4721 (COMPOSITION_ENCODE_RULE): Arguments now must be valid. This
4722 affects only one use, in DECODE_COMPOSITION_RULE, which is changed.
4723
4724 * xfont.c (xfont_text_extents): Remove var that was set but not used.
4725 (xfont_open): Avoid unnecessary tests.
4726
4727 * composite.c (composition_gstring_put_cache): Use unsigned integer.
4728
4729 * composite.h, composite.c (composition_gstring_put_cache):
4730 Use EMACS_INT, not int, for length.
4731
4732 * composite.h (COMPOSITION_DECODE_REFS): New macro,
4733 breaking out part of COMPOSITION_DECODE_RULE.
4734 (COMPOSITION_DECODE_RULE): Use it.
4735 * composite.c (get_composition_id): Remove unused local vars,
4736 by using the new macro.
4737
4738 * textprop.c (set_text_properties_1): Change while to do-while,
4739 since the condition is always true at first.
4740
4741 * intervals.c (graft_intervals_into_buffer): Mark var as used.
4742 (interval_deletion_adjustment): Return unsigned value.
4743 All uses changed.
4744
4745 * process.c (list_processes_1, create_pty, read_process_output):
4746 (exec_sentinel): Remove vars that were set but not used.
4747 (create_pty): Remove unnecessary "volatile"s.
4748 (Fnetwork_interface_info): Avoid possibility of int overflow.
4749 (read_process_output): Do adaptive read buffering even if carryover.
4750 (read_process_output): Simplify nbytes computation if buffered.
4751
4752 * bytecode.c (exec_byte_code): Rename local to avoid shadowing.
4753
4754 * syntax.c (scan_words): Remove var that was set but not used.
4755 (update_syntax_table): Use unsigned instead of int.
4756
4757 * lread.c (lisp_file_lexically_bound_p): Use ints rather than endptrs.
4758 (lisp_file_lexically_bound_p, read1): Use unsigned instead of int.
4759 (safe_to_load_p): Make the end-of-loop test the inverse of the in-loop.
4760
4761 * print.c (print_error_message): Avoid int overflow.
4762
4763 * font.c (font_list_entities): Redo for clarity,
4764 so that reader need not know FONT_DPI_INDEX + 1 == FONT_SPACING_INDEX.
4765
4766 * font.c (font_find_for_lface, Ffont_get_glyphs): Remove unused vars.
4767 (font_score): Avoid potential overflow in diff calculation.
4768
4769 * fns.c (substring_both): Remove var that is set but not used.
4770 (sxhash): Redo loop for clarity and to avoid wraparound warning.
4771
4772 * eval.c (funcall_lambda): Rename local to avoid shadowing.
4773
4774 * alloc.c (mark_object_loop_halt, mark_object): Use size_t, not int.
4775 Otherwise, GCC 4.6.0 optimizes the loop check away since the check
4776 can always succeed if overflow has undefined behavior.
4777
4778 * search.c (boyer_moore, wordify): Remove vars set but not used.
4779 (wordify): Omit three unnecessary tests.
4780
4781 * indent.c (MULTIBYTE_BYTES_WIDTH): Don't compute wide_column.
4782 All callers changed. This avoids the need for an unused var.
4783
4784 * casefiddle.c (casify_region): Remove var that is set but not used.
4785
4786 * dired.c (file_name_completion): Remove var that is set but not used.
4787
4788 * fileio.c (Finsert_file_contents): Make EOF condition clearer.
4789
4790 * fileio.c (Finsert_file_contents): Avoid signed integer overflow.
4791 (Finsert_file_contents): Remove unnecessary code checking fd.
4792
4793 * minibuf.c (read_minibuf_noninteractive): Use size_t for sizes.
4794 Check for integer overflow on size calculations.
4795
4796 * buffer.c (Fprevious_overlay_change): Remove var that is set
4797 but not used.
4798
4799 * keyboard.c (menu_bar_items, read_char_minibuf_menu_prompt):
4800 Remove vars that are set but not used.
4801 (timer_check_2): Don't assume timer-list and idle-timer-list are lists.
4802 (timer_check_2): Mark vars as initialized.
4803
4804 * gtkutil.c (xg_get_file_with_chooser): Mark var as initialized.
4805
4806 * image.c (lookup_image): Remove var that is set but not used.
4807 (xbm_load): Use parse_p, for gcc -Werror=unused-but-set-variable.
4808
4809 * fontset.c (Finternal_char_font, Ffontset_info): Remove vars
4810 that are set but not used.
4811
4812 * xfns.c (make_invisible_cursor): Don't return garbage
4813 if XCreateBitmapFromData fails (Bug#8410).
4814
4815 * xselect.c (x_get_local_selection, x_handle_property_notify):
4816 Remove vars that are set but not used.
4817
4818 * xfns.c (x_create_tip_frame): Remove var that is set but not used.
4819 (make_invisible_cursor): Initialize a possibly-uninitialized variable.
4820
4821 * xterm.c (x_scroll_bar_to_input_event) [!USE_GTK]:
4822 Remove var that is set but not used.
4823 (scroll_bar_windows_size): Now size_t, not int.
4824 (x_send_scroll_bar_event): Use size_t, not int, for sizes.
4825 Check for overflow.
4826
4827 * xfaces.c (realize_named_face): Remove vars that are set but not used.
4828 (map_tty_color) [!defined MSDOS]: Likewise.
4829
4830 * term.c (tty_write_glyphs): Use size_t; this avoids overflow warning.
4831
4832 * coding.c: Remove vars that are set but not used.
4833 (DECODE_COMPOSITION_RULE): Remove 2nd arg, which is unused.
4834 All callers changed.
4835 (decode_coding_utf_8, decode_coding_utf_16 decode_coding_emacs_mule):
4836 (decode_coding_iso_2022, encode_coding_sjis, encode_coding_big5):
4837 (decode_coding_charset): Remove vars that are set but not used.
4838
4839 * bytecode.c (Fbyte_code) [!defined BYTE_CODE_SAFE]: Remove var
4840 that is set but not used.
4841
4842 * print.c (print_object): Remove var that is set but not used.
4843
4844 Replace 2 copies of readlink code with 1 gnulib version (Bug#8401).
4845 The gnulib version avoids calling malloc in the usual case,
4846 and on 64-bit hosts doesn't have some arbitrary 32-bit limits.
4847 * fileio.c (Ffile_symlink_p): Use emacs_readlink.
4848 * filelock.c (current_lock_owner): Likewise.
4849 * lisp.h (READLINK_BUFSIZE, emacs_readlink): New function.
4850 * sysdep.c: Include allocator.h, careadlinkat.h.
4851 (emacs_no_realloc_allocator): New static constant.
4852 (emacs_readlink): New function.
4853 * deps.mk (sysdep.o): Depend on ../lib/allocator.h and on
4854 ../lib/careadlinkat.h.
4855
4856 2011-04-04 Stefan Monnier <monnier@iro.umontreal.ca>
4857
4858 * keyboard.c (safe_run_hook_funcall): Fix last change (don't stop at the
4859 first non-nil return value).
4860
4861 2011-04-03 Jan Djärv <jan.h.d@swipnet.se>
4862
4863 * nsterm.m (ns_update_auto_hide_menu_bar): Define MAC_OS_X_VERSION_10_6
4864 if not defined (Bug#8403).
4865
4866 2011-04-02 Juanma Barranquero <lekktu@gmail.com>
4867
4868 * xdisp.c (display_count_lines): Remove parameter `start',
4869 unused since 1998-01-01T02:27:27Z!rms@gnu.org. All callers changed.
4870 (get_char_face_and_encoding): Remove parameter `multibyte_p',
4871 unused since 2008-05-14T01:40:23Z!handa@m17n.org. All callers changed.
4872 (fill_stretch_glyph_string): Remove parameters `row' and `area',
4873 unused at least since Kim's GUI unification at 2003-03-16T20:45:46Z!storm@cua.dk
4874 and thereabouts. All callers changed.
4875 (get_per_char_metric): Remove parameter `f', unused since
4876 2008-05-14T01:40:23Z!handa@m17n.org. All callers changed.
4877
4878 2011-04-02 Jim Meyering <meyering@redhat.com>
4879
4880 do not dereference NULL upon failed strdup
4881 * nsfont.m (ns_descriptor_to_entity): Use xstrdup, not strdup.
4882 (ns_get_family): Likewise.
4883
4884 2011-04-02 Juanma Barranquero <lekktu@gmail.com>
4885
4886 * eval.c (unwind_to_catch) [DEBUG_GCPRO]: Remove redundant assignment.
4887
4888 2011-04-02 Jan Djärv <jan.h.d@swipnet.se>
4889
4890 * nsterm.m (ns_update_auto_hide_menu_bar): Only for OSX 10.6 or
4891 later (Bug#8403).
4892
4893 2011-04-01 Stefan Monnier <monnier@iro.umontreal.ca>
4894
4895 Add lexical binding.
4896
4897 * window.c (Ftemp_output_buffer_show): New fun.
4898 (Fsave_window_excursion):
4899 * print.c (Fwith_output_to_temp_buffer): Move to subr.el.
4900
4901 * lread.c (lisp_file_lexically_bound_p): New function.
4902 (Fload): Bind Qlexical_binding.
4903 (readevalloop): Remove `evalfun' arg.
4904 Bind Qinternal_interpreter_environment.
4905 (Feval_buffer): Bind Qlexical_binding.
4906 (defvar_int, defvar_bool, defvar_lisp_nopro, defvar_kboard):
4907 Mark as dynamic.
4908 (syms_of_lread): Declare `lexical-binding'.
4909
4910 * lisp.h (struct Lisp_Symbol): New field `declared_special'.
4911
4912 * keyboard.c (eval_dyn): New fun.
4913 (menu_item_eval_property): Use it.
4914
4915 * image.c (parse_image_spec): Use Ffunctionp.
4916
4917 * fns.c (concat, mapcar1): Accept byte-code-functions.
4918
4919 * eval.c (Fsetq): Handle lexical vars.
4920 (Fdefun, Fdefmacro, Ffunction): Make closures when needed.
4921 (Fdefconst, Fdefvaralias, Fdefvar): Mark as dynamic.
4922 (FletX, Flet): Obey lexical binding.
4923 (Fcommandp): Handle closures.
4924 (Feval): New `lexical' arg.
4925 (eval_sub): New function extracted from Feval. Use it almost
4926 everywhere where Feval was used. Look up vars in lexical env.
4927 Handle closures.
4928 (Ffunctionp): Move from subr.el.
4929 (Ffuncall): Handle closures.
4930 (apply_lambda): Remove `eval_flags'.
4931 (funcall_lambda): Handle closures and new byte-code-functions.
4932 (Fspecial_variable_p): New function.
4933 (syms_of_eval): Initialize the Vinternal_interpreter_environment var,
4934 but without exporting it to Lisp.
4935
4936 * doc.c (Fdocumentation, store_function_docstring):
4937 * data.c (Finteractive_form): Handle closures.
4938
4939 * callint.c (Fcall_interactively): Preserve lexical-binding mode for
4940 interactive spec.
4941
4942 * bytecode.c (Bstack_ref, Bstack_set, Bstack_set2, BdiscardN):
4943 New byte-codes.
4944 (exec_byte_code): New function extracted from Fbyte_code to handle new
4945 calling convention for byte-code-functions. Add new byte-codes.
4946
4947 * buffer.c (defvar_per_buffer): Set new `declared_special' field.
4948
4949 * alloc.c (Fmake_symbol): Init new `declared_special' field.
4950
4951 2011-03-31 Juanma Barranquero <lekktu@gmail.com>
4952
4953 * xdisp.c (redisplay_internal): Fix prototype.
4954
4955 2011-03-31 Eli Zaretskii <eliz@gnu.org>
4956
4957 * xdisp.c (SCROLL_LIMIT): New macro.
4958 (try_scrolling): Use it when setting scroll_limit.
4959 Limit scrolling to 100 screen lines.
4960 (redisplay_window): Even when falling back on "recentering",
4961 position point in the window according to scroll-conservatively,
4962 scroll-margin, and scroll-*-aggressively variables. (Bug#6671)
4963
4964 (try_scrolling): When point is above the window, allow searching
4965 as far as scroll_max, or one screenful, to compute vertical
4966 distance from PT to the scroll margin position. This prevents
4967 try_scrolling from unnecessarily failing when
4968 scroll-conservatively is set to a value slightly larger than the
4969 window height. Clean up the case of PT below the margin at bottom
4970 of window: scroll_max can no longer be INT_MAX. When aggressive
4971 scrolling is in use, don't let point enter the opposite scroll
4972 margin as result of the scroll.
4973 (syms_of_xdisp) <scroll-conservatively>: Document the
4974 threshold of 100 lines for never-recentering scrolling.
4975
4976 2011-03-31 Juanma Barranquero <lekktu@gmail.com>
4977
4978 * dispextern.h (move_it_by_lines):
4979 * xdisp.c (move_it_by_lines): Remove parameter `need_y_p', unused
4980 since 2000-12-29T14:24:09Z!gerd@gnu.org. All callers changed.
4981 (message_log_check_duplicate): Remove parameters `prev_bol' and
4982 `this_bol', unused since 1998-01-01T02:27:27Z!rms@gnu.org. All callers changed.
4983 (redisplay_internal): Remove parameter `preserve_echo_area',
4984 unused since 1999-07-21T21:43:52Z!gerd@gnu.org. All callers changed.
4985
4986 * indent.c (Fvertical_motion):
4987 * window.c (window_scroll_pixel_based, Frecenter):
4988 Don't pass `need_y_p' to `move_it_by_lines'.
4989
4990 2011-03-30 Stefan Monnier <monnier@iro.umontreal.ca>
4991
4992 * eval.c (struct backtrace): Don't cheat with negative numbers, but do
4993 steal a few bits to be more compact.
4994 (interactive_p, Fbacktrace, Fbacktrace_frame, mark_backtrace):
4995 Remove unneeded casts.
4996
4997 * bytecode.c (Fbyte_code): CAR and CDR can GC.
4998
4999 2011-03-30 Zachary Kanfer <zkanfer@gmail.com> (tiny change)
5000
5001 * keyboard.c (Fexecute_extended_command): Do log the "suggest key
5002 binding" message (bug#7967).
5003
5004 2011-03-30 Paul Eggert <eggert@cs.ucla.edu>
5005
5006 Fix more problems found by GCC 4.6.0's static checks.
5007
5008 * unexelf.c (unexec) [! (defined _SYSTYPE_SYSV || defined __sgi)]:
5009 Remove unused local var.
5010
5011 * editfns.c (Fmessage_box): Remove unused local var.
5012
5013 * xdisp.c (try_window_reusing_current_matrix, x_produce_glyphs):
5014 (note_mode_line_or_margin_highlight, note_mouse_highlight):
5015 Omit unused local vars.
5016 * window.c (shrink_windows): Omit unused local var.
5017 * menu.c (digest_single_submenu): Omit unused local var.
5018 * dispnew.c (update_window) [PERIODIC_PREEMPTION_CHECKING]:
5019 Omit unused local var.
5020
5021 * keyboard.c (parse_modifiers_uncached, parse_modifiers):
5022 Don't assume string length fits in int.
5023 (keyremap_step, read_key_sequence): Use size_t for sizes.
5024 (read_key_sequence): Don't check last_real_key_start redundantly.
5025
5026 * callproc.c (Fcall_process, Fcall_process_region): Use SAFE_ALLOCA
5027 instead of alloca (Bug#8344).
5028
5029 * eval.c (Fbacktrace): Don't assume nargs fits in int.
5030 (Fbacktrace_frame): Don't assume nframes fits in int.
5031
5032 * syntax.c (scan_sexps_forward): Avoid pointer wraparound.
5033
5034 * xterm.c (x_make_frame_visible, same_x_server): Redo to avoid overflow
5035 concerns.
5036
5037 * term.c (produce_glyphless_glyph): Remove unnecessary test.
5038
5039 * cm.c (calccost): Turn while-do into do-while, for clarity.
5040
5041 * keyboard.c (syms_of_keyboard): Use the same style as later
5042 in this function when indexing through an array. This also
5043 works around GCC bug 48267.
5044
5045 * image.c (tiff_load): Fix off-by-one image count (Bug#8336).
5046
5047 * xselect.c (x_check_property_data): Return correct size (Bug#8335).
5048
5049 * chartab.c (sub_char_table_ref_and_range): Redo for slight
5050 efficiency gain, and to bypass a gcc -Wstrict-overflow warning.
5051
5052 * keyboard.c, keyboard.h (num_input_events): Now size_t.
5053 This avoids undefined behavior on integer overflow, and is a bit
5054 more convenient anyway since it is compared to a size_t variable.
5055
5056 Variadic C functions now count arguments with size_t, not int.
5057 This avoids an unnecessary limitation on 64-bit machines, which
5058 caused (substring ...) to crash on large vectors (Bug#8344).
5059 * lisp.h (struct Lisp_Subr.function.aMANY): Now takes size_t, not int.
5060 (DEFUN_ARGS_MANY, internal_condition_case_n, safe_call): Likewise.
5061 All variadic functions and their callers changed accordingly.
5062 (struct gcpro.nvars): Now size_t, not int. All uses changed.
5063 * data.c (arith_driver, float_arith_driver): Likewise.
5064 * editfns.c (general_insert_function): Likewise.
5065 * eval.c (struct backtrace.nargs, interactive_p)
5066 (internal_condition_case_n, run_hook_with_args, apply_lambda)
5067 (funcall_lambda, mark_backtrace): Likewise.
5068 * fns.c (concat): Likewise.
5069 * frame.c (x_set_frame_parameters): Likewise.
5070 * fns.c (get_key_arg): Now accepts and returns size_t, and returns
5071 0 if not found, not -1. All callers changed.
5072
5073 * alloc.c (garbage_collect): Don't assume stack size fits in int.
5074 (stack_copy_size): Now size_t, not int.
5075 (stack_copy, stack_copy_size): Define only if MAX_SAVE_STACK > 0.
5076
5077 2011-03-28 Juanma Barranquero <lekktu@gmail.com>
5078
5079 * coding.c (encode_designation_at_bol): Remove parameter `charbuf_end',
5080 unused since 2002-03-01T01:17:24Z!handa@m17n.org and 2008-02-01T16:01:31Z!miles@gnu.org.
5081 All callers changed.
5082
5083 * lisp.h (multibyte_char_to_unibyte):
5084 * character.c (multibyte_char_to_unibyte): Remove parameter `rev_tbl',
5085 unused since 2002-03-01T01:16:34Z!handa@m17n.org and 2008-02-01T16:01:31Z!miles@gnu.org.
5086 * character.h (CHAR_TO_BYTE8):
5087 * cmds.c (internal_self_insert):
5088 * editfns.c (general_insert_function):
5089 * keymap.c (push_key_description):
5090 * search.c (Freplace_match):
5091 * xdisp.c (message_dolog, set_message_1): All callers changed.
5092
5093 2011-03-28 Stefan Monnier <monnier@iro.umontreal.ca>
5094
5095 * keyboard.c (safe_run_hook_funcall): New function.
5096 (safe_run_hooks_1, safe_run_hooks_error, safe_run_hooks): On error,
5097 don't set the hook to nil, but remove the offending function instead.
5098 (Qcommand_hook_internal): Remove, unused.
5099 (syms_of_keyboard): Don't initialize Qcommand_hook_internal nor define
5100 Vcommand_hook_internal.
5101
5102 * eval.c (enum run_hooks_condition): Remove.
5103 (funcall_nil, funcall_not): New functions.
5104 (run_hook_with_args): Call each function through a `funcall' argument.
5105 Remove `cond' argument, now redundant.
5106 (Frun_hooks, Frun_hook_with_args, Frun_hook_with_args_until_success)
5107 (Frun_hook_with_args_until_failure): Adjust accordingly.
5108 (run_hook_wrapped_funcall, Frun_hook_wrapped): New functions.
5109
5110 2011-03-28 Juanma Barranquero <lekktu@gmail.com>
5111
5112 * dispextern.h (string_buffer_position): Remove declaration.
5113
5114 * print.c (strout): Remove parameter `multibyte', unused since
5115 1999-08-21T19:30:21Z!gerd@gnu.org. All callers changed.
5116
5117 * search.c (boyer_moore): Remove parameters `len', `pos' and `lim',
5118 never used since function introduction in 1998-02-08T21:33:56Z!rms@gnu.org.
5119 All callers changed.
5120
5121 * w32.c (_wsa_errlist): Use braces for struct initializers.
5122
5123 * xdisp.c (string_buffer_position_lim): Remove parameter `w',
5124 never used since function introduction in 2001-03-09T18:41:50Z!gerd@gnu.org.
5125 All callers changed.
5126 (string_buffer_position): Likewise. Also, make static (it's never
5127 used outside xdisp.c).
5128 (cursor_row_p): Remove parameter `w', unused since
5129 2000-10-17T16:08:57Z!gerd@gnu.org. All callers changed.
5130 (decode_mode_spec): Remove parameter `precision', introduced during
5131 Gerd Moellmann's rewrite at 1999-07-21T21:43:52Z!gerd@gnu.org, but never used.
5132 All callers changed.
5133
5134 2011-03-27 Jan Djärv <jan.h.d@swipnet.se>
5135
5136 * nsterm.m (syms_of_nsterm): Use doc: for ns-auto-hide-menu-bar.
5137
5138 2011-03-27 Anders Lindgren <andlind@gmail.com>
5139
5140 * nsterm.m (ns_menu_bar_is_hidden): New variable.
5141 (ns_constrain_all_frames, ns_menu_bar_should_be_hidden)
5142 (ns_update_auto_hide_menu_bar): New functions.
5143 (ns_update_begin): Call ns_update_auto_hide_menu_bar.
5144 (applicationDidBecomeActive): Call ns_update_auto_hide_menu_bar and
5145 ns_constrain_all_frames.
5146 (constrainFrameRect): Return at once if ns_menu_bar_should_be_hidden.
5147 (syms_of_nsterm): DEFVAR ns-auto-hide-menu-bar, init to Qnil.
5148
5149 2011-03-27 Jan Djärv <jan.h.d@swipnet.se>
5150
5151 * nsmenu.m (runDialogAt): Remove argument to timer_check.
5152
5153 2011-03-27 Glenn Morris <rgm@gnu.org>
5154
5155 * syssignal.h: Replace RETSIGTYPE with void.
5156 * atimer.c, data.c, dispnew.c, emacs.c, floatfns.c, keyboard.c:
5157 * keyboard.h, lisp.h, process.c, sysdep.c, xterm.c:
5158 Replace SIGTYPE with void everywhere.
5159 * s/usg5-4-common.h (SIGTYPE): Remove definition.
5160 * s/template.h (SIGTYPE): Remove commented out definition.
5161
5162 2011-03-26 Eli Zaretskii <eliz@gnu.org>
5163
5164 * xdisp.c (redisplay_window): Don't check buffer's clip_changed
5165 flag as a prerequisite for invoking try_scrolling. (Bug#6671)
5166
5167 2011-03-26 Juanma Barranquero <lekktu@gmail.com>
5168
5169 * w32.c (read_unc_volume): Use parameter `henum', instead of
5170 global variable `wget_enum_handle'.
5171
5172 * keymap.c (describe_vector): Remove parameters `indices' and
5173 `char_table_depth', unused since 2002-03-01T01:43:26Z!handa@m17n.org.
5174 (describe_map, Fdescribe_vector): Adjust calls to `describe_vector'.
5175
5176 * keyboard.h (timer_check, show_help_echo): Remove unused parameters.
5177
5178 * keyboard.c (timer_check): Remove parameter `do_it_now',
5179 unused since 1996-04-12T06:01:29Z!rms@gnu.org.
5180 (show_help_echo): Remove parameter `ok_to_overwrite_keystroke_echo',
5181 unused since 2008-04-19T19:30:53Z!monnier@iro.umontreal.ca.
5182
5183 * keyboard.c (read_char):
5184 * w32menu.c (w32_menu_display_help):
5185 * xmenu.c (show_help_event, menu_help_callback):
5186 Adjust calls to `show_help_echo'.
5187
5188 * gtkutil.c (xg_maybe_add_timer):
5189 * keyboard.c (readable_events):
5190 * process.c (wait_reading_process_output):
5191 * xmenu.c (x_menu_wait_for_event): Adjust calls to `timer_check'.
5192
5193 * insdel.c (adjust_markers_gap_motion):
5194 Remove; no-op since 1998-01-02T21:29:48Z!rms@gnu.org.
5195 (gap_left, gap_right): Don't call it.
5196
5197 2011-03-25 Chong Yidong <cyd@stupidchicken.com>
5198
5199 * xdisp.c (handle_fontified_prop): Discard changes to clip_changed
5200 incurred during fontification.
5201
5202 2011-03-25 Juanma Barranquero <lekktu@gmail.com>
5203
5204 * buffer.c (defvar_per_buffer): Remove unused parameter `doc'.
5205 (DEFVAR_PER_BUFFER): Don't pass it.
5206
5207 * dispnew.c (row_equal_p, add_row_entry): Remove unused parameter `w'.
5208 (scrolling_window): Don't pass it.
5209
5210 2011-03-25 Juanma Barranquero <lekktu@gmail.com>
5211
5212 * dispextern.h (glyph_matric): Use #if GLYPH_DEBUG, not #ifdef.
5213
5214 * fileio.c (check_executable) [DOS_NT]: Remove unused variables `len'
5215 and `suffix'.
5216 (Fset_file_selinux_context) [HAVE_LIBSELINUX]: Move here declaration
5217 of variables specific to SELinux and computation of `encoded_absname'.
5218
5219 * image.c (XPutPixel): Remove unused variable `height'.
5220
5221 * keyboard.c (make_lispy_event): Remove unused variable `hpos'.
5222
5223 * unexw32.c (get_section_info): Remove unused variable `section'.
5224
5225 * w32.c (stat): Remove unused variables `drive_root' and `devtype'.
5226 (system_process_attributes): Remove unused variable `sess'.
5227 (sys_read): Remove unused variable `err'.
5228
5229 * w32fns.c (top): Wrap variables with #if GLYPH_DEBUG, not #ifdef.
5230 (w32_wnd_proc): Remove unused variable `isdead'.
5231 (unwind_create_frame): Use #if GLYPH_DEBUG, not #ifdef.
5232 (Fx_server_max_request_size): Remove unused variable `dpyinfo'.
5233 (x_create_tip_frame): Remove unused variable `tem'.
5234
5235 * w32inevt.c (w32_console_read_socket):
5236 Remove unused variable `no_events'.
5237
5238 * w32term.c (x_draw_composite_glyph_string_foreground):
5239 Remove unused variable `width'.
5240
5241 2011-03-24 Juanma Barranquero <lekktu@gmail.com>
5242
5243 * w32term.c (x_set_glyph_string_clipping):
5244 Don't pass uninitialized region to CombineRgn.
5245
5246 2011-03-23 Juanma Barranquero <lekktu@gmail.com>
5247
5248 * w32fns.c (x_set_menu_bar_lines): Remove unused variable `olines'.
5249 (w32_wnd_proc): Pass NULL to Windows API, not uninitialized buffer.
5250 (Fx_close_connection): Remove unused variable `i'.
5251
5252 * w32font.c (w32font_draw): Return number of glyphs.
5253 (w32font_open_internal): Remove unused variable `i'.
5254 (w32font_driver): Add missing initializer.
5255
5256 * w32menu.c (utf8to16): Remove unused variable `utf16'.
5257 (fill_in_menu): Remove unused variable `items_added'.
5258
5259 * w32term.c (last_mouse_press_frame): Remove static global variable.
5260 (w32_clip_to_row): Remove unused variable `f'.
5261 (x_delete_terminal): Remove unused variable `i'.
5262
5263 * w32uniscribe.c (uniscribe_shape): Remove unused variable `nclusters'.
5264 (NOTHING): Remove unused static global variable.
5265 (uniscribe_check_otf): Remove unused variable `table'.
5266 (uniscribe_font_driver): Add missing initializers.
5267
5268 2011-03-23 Julien Danjou <julien@danjou.info>
5269
5270 * term.c (Fsuspend_tty, Fresume_tty):
5271 * minibuf.c (read_minibuf, run_exit_minibuf_hook):
5272 * window.c (temp_output_buffer_show):
5273 * insdel.c (signal_before_change):
5274 * frame.c (Fhandle_switch_frame):
5275 * fileio.c (Fdo_auto_save):
5276 * emacs.c (Fkill_emacs):
5277 * editfns.c (save_excursion_restore):
5278 * cmds.c (internal_self_insert):
5279 * callint.c (Fcall_interactively):
5280 * buffer.c (Fkill_all_local_variables):
5281 * keyboard.c (Fcommand_execute, Fsuspend_emacs, safe_run_hooks_1):
5282 Use Frun_hooks.
5283 (command_loop_1): Use Frun_hooks. Call safe_run_hooks
5284 unconditionnaly since it does the check itself.
5285
5286 2011-03-23 Paul Eggert <eggert@cs.ucla.edu>
5287
5288 Fix more problems found by GCC 4.5.2's static checks.
5289
5290 * coding.c (encode_coding_raw_text): Avoid unnecessary test
5291 the first time through the loop, since we know p0 < p1 then.
5292 This also avoids a gcc -Wstrict-overflow warning.
5293
5294 * lisp.h (SAFE_ALLOCA, SAFE_ALLOCA_LISP): Avoid 'int' overflow
5295 leading to a memory leak, possible in functions like
5296 load_charset_map_from_file that can allocate an unbounded number
5297 of objects (Bug#8318).
5298
5299 * xmenu.c (set_frame_menubar): Use EMACS_UINT, not int, for indexes
5300 that could (at least in theory) be that large.
5301
5302 * xdisp.c (message_log_check_duplicate): Return unsigned long, not int.
5303 This is less likely to overflow, and avoids undefined behavior if
5304 overflow does occur. All callers changed. Use strtoul to scan
5305 for the unsigned long integer.
5306 (pint2hrstr): Simplify and tune code slightly.
5307 This also avoids a (bogus) GCC warning with gcc -Wstrict-overflow.
5308
5309 * scroll.c (do_scrolling): Work around GCC bug 48228.
5310 See <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48228>.
5311
5312 * frame.c (Fmodify_frame_parameters): Simplify loop counter.
5313 This also avoids a warning with gcc -Wstrict-overflow.
5314 (validate_x_resource_name): Simplify count usage.
5315 This also avoids a warning with gcc -Wstrict-overflow.
5316
5317 * fileio.c (Fcopy_file): Report error if fchown or fchmod
5318 fail (Bug#8306).
5319
5320 * emacs.c (Fdaemon_initialized): Do not ignore I/O errors (Bug#8303).
5321
5322 * process.c (Fmake_network_process): Use socklen_t, not int,
5323 where POSIX says socklen_t is required in portable programs.
5324 This fixes a porting bug on hosts like 64-bit HP-UX, where
5325 socklen_t is wider than int (Bug#8277).
5326 (Fmake_network_process, server_accept_connection):
5327 (wait_reading_process_output, read_process_output):
5328 Likewise.
5329
5330 * process.c: Rename or move locals to avoid shadowing.
5331 (list_processes_1, Fmake_network_process):
5332 (read_process_output_error_handler, exec_sentinel_error_handler):
5333 Rename or move locals.
5334 (Fmake_network_process): Define label "retry_connect" only if needed.
5335 (Fnetwork_interface_info): Fix pointer signedness.
5336 (process_send_signal): Add cast to avoid pointer signedness problem.
5337 (FIRST_PROC_DESC, IF_NON_BLOCKING_CONNECT): Remove unused macros.
5338 (create_process): Use 'volatile' to avoid vfork clobbering (Bug#8298).
5339
5340 Make tparam.h and terminfo.c consistent.
5341 * cm.c (tputs, tgoto, BC, UP): Remove extern decls.
5342 Include tparam.h instead, since it declares them.
5343 * cm.h (PC): Remove extern decl; tparam.h now does this.
5344 * deps.mk (cm.o, terminfo.o): Depend on tparam.h.
5345 * terminfo.c: Include tparam.h, to check interfaces.
5346 (tparm): Make 1st arg a const pointer in decl. Put it at top level.
5347 (tparam): Adjust signature to match interface in tparam.h;
5348 this removes some undefined behavior. Check that outstring and len
5349 are zero, which they always are with Emacs.
5350 * tparam.h (PC, BC, UP): New extern decls.
5351
5352 * xftfont.c (xftfont_shape): Now static, and defined only if needed.
5353 (xftfont_open): Rename locals to avoid shadowing.
5354
5355 * ftfont.c (ftfont_resolve_generic_family): Fix pointer signedness.
5356 (ftfont_otf_capability, ftfont_shape): Omit decls if not needed.
5357 (OTF_TAG_SYM): Omit macro if not needed.
5358 (ftfont_list): Remove unused local.
5359 (get_adstyle_property, ftfont_pattern_entity):
5360 (ftfont_lookup_cache, ftfont_open, ftfont_anchor_point):
5361 Rename locals to avoid shadowing.
5362
5363 * xfont.c (xfont_list_family): Mark var as initialized.
5364
5365 * xml.c (make_dom): Now static.
5366
5367 * composite.c (composition_compute_stop_pos): Rename local to
5368 avoid shadowing.
5369 (composition_reseat_it): Remove unused locals.
5370 (find_automatic_composition, composition_adjust_point): Likewise.
5371 (composition_update_it): Mark var as initialized.
5372 (find_automatic_composition): Mark vars as initialized,
5373 with a FIXME (Bug#8290).
5374
5375 character.h: Rename locals to avoid shadowing.
5376 * character.h (PREV_CHAR_BOUNDARY, FETCH_STRING_CHAR_ADVANCE):
5377 (FETCH_STRING_CHAR_AS_MULTIBYTE_ADVANCE, FETCH_CHAR_ADVANCE):
5378 (FETCH_CHAR_ADVANCE_NO_CHECK, INC_POS, DEC_POS, BUF_INC_POS):
5379 (BUF_DEC_POS): Be more systematic about renaming local temporaries
5380 to avoid shadowing.
5381
5382 * textprop.c (property_change_between_p): Remove; unused.
5383
5384 * intervals.c (interval_start_pos): Now static.
5385
5386 * intervals.h (CHECK_TOTAL_LENGTH): Avoid empty "else".
5387
5388 * atimer.c (start_atimer, append_atimer_lists, set_alarm):
5389 Rename locals to avoid shadowing.
5390
5391 * sound.c (wav_play, au_play, Fplay_sound_internal):
5392 Fix pointer signedness.
5393 (alsa_choose_format): Remove unused local var.
5394 (wav_play): Initialize a variable to 0, to prevent undefined
5395 behavior (Bug#8278).
5396
5397 * region-cache.c (insert_cache_boundary): Redo var to avoid shadowing.
5398
5399 * region-cache.h (pp_cache): New decl, for gcc -Wmissing-prototypes.
5400
5401 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork
5402 clobbering (Bug#8298).
5403 * sysdep.c (sys_subshell): Likewise.
5404 Previously, the sys_subshell 'volatile' was incorrectly IF_LINTted out.
5405
5406 * lisp.h (child_setup): Now NO_RETURN unless DOS_NT.
5407 This should get cleaned up, so that child_setup has the
5408 same signature on all platforms.
5409
5410 * callproc.c (call_process_cleanup): Now static.
5411 (relocate_fd): Rename locals to avoid shadowing.
5412
5413 2011-03-22 Chong Yidong <cyd@stupidchicken.com>
5414
5415 * xterm.c (x_clear_frame): Remove XClearWindow call. This appears
5416 not to be necessary, and produces flickering.
5417
5418 2011-03-20 Glenn Morris <rgm@gnu.org>
5419
5420 * config.in: Remove file.
5421
5422 2011-03-20 Juanma Barranquero <lekktu@gmail.com>
5423
5424 * minibuf.c (Vcompleting_read_function): Don't declare, global variables
5425 are now in src/globals.h.
5426 (syms_of_minibuf): Remove spurious & from previous change.
5427
5428 2011-03-20 Leo <sdl.web@gmail.com>
5429
5430 * minibuf.c (completing-read-function): New variable.
5431 (completing-read-default): Rename from completing-read.
5432 (completing-read): Call completing-read-function.
5433
5434 2011-03-19 Juanma Barranquero <lekktu@gmail.com>
5435
5436 * xfaces.c (Fx_load_color_file):
5437 Read color file from absolute filename (bug#8250).
5438
5439 2011-03-19 Juanma Barranquero <lekktu@gmail.com>
5440
5441 * makefile.w32-in: Update dependencies.
5442
5443 2011-03-17 Eli Zaretskii <eliz@gnu.org>
5444
5445 * makefile.w32-in ($(BLD)/unexw32.$(O)): Depend on $(SRC)/unexec.h.
5446
5447 2011-03-17 Paul Eggert <eggert@cs.ucla.edu>
5448
5449 Fix more problems found by GCC 4.5.2's static checks.
5450
5451 * process.c (make_serial_process_unwind, send_process_trap):
5452 (sigchld_handler): Now static.
5453
5454 * process.c (allocate_pty): Let PTY_ITERATION declare iteration vars.
5455 That way, the code declares only the vars that it needs.
5456 * s/aix4-2.h (PTY_ITERATION): Declare iteration vars.
5457 * s/cygwin.h (PTY_ITERATION): Likewise.
5458 * s/darwin.h (PTY_ITERATION): Likewise.
5459 * s/gnu-linux.h (PTY_ITERATION): Likewise.
5460
5461 * s/irix6-5.h (PTY_OPEN): Declare stb, to loosen coupling.
5462 * process.c (allocate_pty): Don't declare stb unless it's needed.
5463
5464 * bytecode.c (MAYBE_GC): Rewrite so as not to use empty "else".
5465 (CONSTANTLIM): Remove; unused.
5466 (METER_CODE, Bscan_buffer, Bread_char, Bset_mark):
5467 Define only if needed.
5468
5469 * unexelf.c (unexec): Name an expression,
5470 to avoid gcc -Wbad-function-cast warning.
5471 Use a different way to cause a compilation error if anyone uses
5472 n rather than nn, a way that does not involve shadowing.
5473 (ELF_BSS_SECTION_NAME, OLD_PROGRAM_H): Remove; unused.
5474
5475 * deps.mk (unexalpha.o): Remove; unused.
5476
5477 New file unexec.h, the (simple) interface for unexec (Bug#8267).
5478 * unexec.h: New file.
5479 * deps.mk (emacs.o, unexaix.o, unexcw.o, unexcoff.o, unexelf.o):
5480 (unexhp9k800.o, unexmacosx.o, unexsol.o, unexw32.o):
5481 Depend on unexec.h.
5482 * emacs.c [!defined CANNOT_DUMP]: Include unexec.h.
5483 * unexaix.c, unexcoff.c, unexcw.c, unexelf.c, unexhp9k800.c:
5484 * unexmacosx.c, unexsol.c, unexw32.c: Include unexec.h.
5485 Change as necessary to match prototype in unexec.h.
5486
5487 * syntax.c (Fforward_comment, scan_lists): Rename locals to avoid
5488 shadowing.
5489 (back_comment, skip_chars): Mark vars as initialized.
5490
5491 * character.h (FETCH_STRING_CHAR_ADVANCE_NO_CHECK, BUF_INC_POS):
5492 Rename locals to avoid shadowing.
5493
5494 * lread.c (read1): Rewrite so as not to use empty "else".
5495 (Fload, readevalloop, read1): Rename locals to avoid shadowing.
5496
5497 * print.c (Fredirect_debugging_output): Fix pointer signedess.
5498
5499 * lisp.h (debug_output_compilation_hack): Add decl here, to avoid
5500 warning when compiling print.c.
5501
5502 * font.c (font_unparse_fcname): Abort in an "impossible" situation
5503 instead of using an uninitialized var.
5504 (font_sort_entities): Mark var as initialized.
5505
5506 * character.h (FETCH_CHAR_ADVANCE): Rename locals to avoid shadowing.
5507
5508 * font.c (font_unparse_xlfd): Don't mix pointers to variables with
5509 pointers to constants.
5510 (font_parse_fcname): Remove unused vars.
5511 (font_delete_unmatched): Now static.
5512 (font_get_spec): Remove; unused.
5513 (font_style_to_value, font_prop_validate_style, font_unparse_fcname):
5514 (font_update_drivers, Ffont_get_glyphs, font_add_log):
5515 Rename or move locals to avoid shadowing.
5516
5517 * fns.c (require_nesting_list, require_unwind): Now static.
5518 (Ffillarray): Rename locals to avoid shadowing.
5519
5520 * floatfns.c (domain_error2): Define only if needed.
5521 (Ffrexp, Fldexp): Rename locals to avoid shadowing.
5522
5523 * alloc.c (mark_backtrace): Move decl from here ...
5524 * lisp.h: ... to here, so that it can be checked.
5525
5526 * eval.c (call_debugger, do_debug_on_call, grow_specpdl): Now static.
5527 (Fdefvar): Rewrite so as not to use empty "else".
5528 (lisp_indirect_variable): Name an expression,
5529 to avoid gcc -Wbad-function-cast warning.
5530 (Fdefvar): Rename locals to avoid shadowing.
5531
5532 * callint.c (quotify_arg, quotify_args): Now static.
5533 (Fcall_interactively): Rename locals to avoid shadowing.
5534 Use const pointer when appropriate.
5535
5536 * lisp.h (get_system_name, get_operating_system_release):
5537 Move decls here, to check interfaces.
5538 * process.c (get_operating_system_release): Move decl to lisp.h.
5539 * xrdb.c (get_system_name): Likewise.
5540 * editfns.c (init_editfns, Fuser_login_name, Fuser_uid):
5541 (Fuser_real_uid, Fuser_full_name): Remove unnecessary casts,
5542 some of which prompt warnings from gcc -Wbad-function-cast.
5543 (Fformat_time_string, Fencode_time, Finsert_char):
5544 (Ftranslate_region_internal, Fformat):
5545 Rename or remove local vars to avoid shadowing.
5546 (Ftranslate_region_internal): Mark var as initialized.
5547
5548 * doc.c (Fdocumentation, Fsnarf_documentation): Move locals to
5549 avoid shadowing.
5550
5551 * lisp.h (eassert): Check that the argument compiles, even if
5552 ENABLE_CHECKING is not defined.
5553
5554 * data.c (Findirect_variable): Name an expression, to avoid
5555 gcc -Wbad-function-cast warning.
5556 (default_value, arithcompare, arith_driver, arith_error): Now static.
5557 (store_symval_forwarding): Rename local to avoid shadowing.
5558 (Fmake_variable_buffer_local, Fmake_local_variable):
5559 Mark variables as initialized.
5560 (do_blv_forwarding, do_symval_forwarding): Remove; unused.
5561
5562 * alloc.c (check_cons_list): Do not define unless GC_CHECK_CONS_LIST.
5563 (Fmake_vector, Fvector, Fmake_byte_code, Fgarbage_collect):
5564 Rename locals to avoid shadowing.
5565 (mark_stack): Move local variables into the #ifdef region where
5566 they're used.
5567 (BLOCK_INPUT_ALLOC, UNBLOCK_INPUT_ALLOC): Define only if
5568 ! defined SYSTEM_MALLOC && ! defined SYNC_INPUT, as they are not
5569 needed otherwise.
5570 (CHECK_ALLOCATED): Define only if GC_CHECK_MARKED_OBJECTS.
5571 (GC_STRING_CHARS): Remove; not used.
5572 (Fmemory_limit): Cast sbrk's returned value to char *.
5573
5574 * lisp.h (check_cons_list): Declare if GC_CHECK_CONS_LIST; this
5575 avoids undefined behavior in theory.
5576
5577 * regex.c (IF_LINT): Add defn, for benefit of ../lib-src.
5578
5579 Use functions, not macros, for up- and down-casing (Bug#8254).
5580 * buffer.h (DOWNCASE_TABLE, UPCASE_TABLE, DOWNCASE, UPPERCASEP):
5581 (NOCASEP, LOWERCASEP, UPCASE, UPCASE1): Remove. All callers changed
5582 to use the following functions instead of these macros.
5583 (downcase): Adjust to lack of DOWNCASE_TABLE. Return int, not
5584 EMACS_INT, since callers assume the returned value fits in int.
5585 (upcase1): Likewise, for UPCASE_TABLE.
5586 (uppercasep, lowercasep, upcase): New static inline functions.
5587 * editfns.c (Fchar_equal): Remove no-longer-needed workaround for
5588 the race-condition problem in the old DOWNCASE.
5589
5590 * regex.c (CHARSET_LOOKUP_RANGE_TABLE_RAW, POP_FAILURE_REG_OR_COUNT):
5591 Rename locals to avoid shadowing.
5592 (regex_compile, re_match_2_internal): Move locals to avoid shadowing.
5593 (regex_compile, re_search_2, re_match_2_internal):
5594 Remove unused local vars.
5595 (FREE_VAR): Rewrite so as not to use empty "else",
5596 which gcc can warn about.
5597 (regex_compile, re_match_2_internal): Mark locals as initialized.
5598 (RETALLOC_IF): Define only if needed.
5599 (WORDCHAR_P): Likewise. This one is never needed, but is used
5600 only in a comment talking about a compiler bug, so put inside
5601 the #if 0 of that comment.
5602 (CHARSET_LOOKUP_BITMAP, FAIL_STACK_FULL, RESET_FAIL_STACK):
5603 (PUSH_FAILURE_ELT, BUF_PUSH_3, STOP_ADDR_VSTRING):
5604 Remove; unused.
5605
5606 * search.c (boyer_moore): Rename locals to avoid shadowing.
5607 * character.h (FETCH_STRING_CHAR_AS_MULTIBYTE_ADVANCE):
5608 (PREV_CHAR_BOUNDARY): Likewise.
5609
5610 * search.c (simple_search): Remove unused var.
5611
5612 * dired.c (compile_pattern): Move decl from here ...
5613 * lisp.h: ... to here, so that it can be checked.
5614 (struct re_registers): New forward decl.
5615
5616 * character.h (INC_POS, DEC_POS): Rename locals to avoid shadowing.
5617
5618 * indent.c (MULTIBYTE_BYTES_WIDTH): New args bytes, width.
5619 All uses changed.
5620 (MULTIBYTE_BYTES_WIDTH, scan_for_column, compute_motion):
5621 Rename locals to avoid shadowing.
5622 (Fvertical_motion): Mark locals as initialized.
5623
5624 * casefiddle.c (casify_object, casify_region): Now static.
5625 (casify_region): Mark local as initialized.
5626
5627 * cmds.c (internal_self_insert): Rename local to avoid shadowing.
5628
5629 * lisp.h (GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR, GCPRO5_VAR, GCPRO6_VAR):
5630 New macros, so that the caller can use some names other than
5631 gcpro1, gcpro2, etc.
5632 (GCPRO2, GCPRO3, GCPRO4, GCPRO5, GCPRO6): Reimplement in terms
5633 of the new macros.
5634 (GCPRO1_VAR, UNGCPRO_VAR): Change the meaning of the second
5635 argument, for consistency with GCPRO2_VAR, etc: it is now the
5636 prefix of the variable, not the variable itself. All uses
5637 changed.
5638 * dired.c (directory_files_internal, file_name_completion):
5639 Rename locals to avoid shadowing.
5640
5641 Fix a race condition diagnosed by gcc -Wsequence-point (Bug#8254).
5642 An expression of the form (DOWNCASE (x) == DOWNCASE (y)), found in
5643 dired.c's scmp function, had undefined behavior.
5644 * lisp.h (DOWNCASE_TABLE, UPCASE_TABLE, DOWNCASE, UPPERCASEP):
5645 (NOCASEP, LOWERCASEP, UPCASE, UPCASE1): Move from here ...
5646 * buffer.h: ... to here, because these macros use current_buffer,
5647 and the new implementation with inline functions needs to have
5648 current_buffer in scope now, rather than later when the macros
5649 are used.
5650 (downcase, upcase1): New static inline functions.
5651 (DOWNCASE, UPCASE1): Reimplement using these functions.
5652 This avoids undefined behavior in expressions like
5653 DOWNCASE (x) == DOWNCASE (y), which previously suffered
5654 from race conditions in accessing the global variables
5655 case_temp1 and case_temp2.
5656 * casetab.c (case_temp1, case_temp2): Remove; no longer needed.
5657 * lisp.h (case_temp1, case_temp2): Remove their decls.
5658 * character.h (ASCII_CHAR_P): Move from here ...
5659 * lisp.h: ... to here, so that the inline functions mentioned
5660 above can use them.
5661
5662 * dired.c (directory_files_internal_unwind): Now static.
5663
5664 * fileio.c (file_name_as_directory, directory_file_name):
5665 (barf_or_query_if_file_exists, auto_save_error, auto_save_1):
5666 Now static.
5667 (file_name_as_directory): Use const pointers when appropriate.
5668 (Fexpand_file_name): Likewise. In particular, newdir might
5669 point at constant storage, so make it a const pointer.
5670 (Fmake_directory_internal, Fread_file_name): Remove unused vars.
5671 (Ffile_selinux_context, Fset_file_selinux_context): Fix pointer
5672 signedness issues.
5673 (Fset_file_times, Finsert_file_contents, auto_save_error):
5674 Rename locals to avoid shadowing.
5675
5676 * minibuf.c (choose_minibuf_frame_1): Now static.
5677 (Ftry_completion, Fall_completions): Rename or remove locals
5678 to avoid shadowing.
5679
5680 * marker.c (bytepos_to_charpos): Remove; unused.
5681
5682 * lisp.h (verify_bytepos, count_markers): New decls,
5683 so that gcc does not warn that these functions aren't declared.
5684
5685 * insdel.c (check_markers, make_gap_larger, make_gap_smaller):
5686 (reset_var_on_error, Fcombine_after_change_execute_1): Now static.
5687 (CHECK_MARKERS): Redo to avoid gcc -Wempty-body diagnostic.
5688 (copy_text): Remove unused local var.
5689
5690 * filelock.c (within_one_second): Now static.
5691 (lock_file_1): Rename local to avoid shadowing.
5692
5693 * buffer.c (fix_overlays_before): Mark locals as initialized.
5694 (fix_start_end_in_overlays): Likewise. This function should be
5695 simplified by using pointers-to-pointers, but that's a different
5696 matter.
5697 (switch_to_buffer_1): Now static.
5698 (Fkill_buffer, record_buffer, Fbury_buffer, Fset_buffer_multibyte):
5699 (report_overlay_modification): Rename locals to avoid shadowing.
5700
5701 * sysdep.c (system_process_attributes): Rename vars to avoid shadowing.
5702 Fix pointer signedness issue.
5703 (sys_subshell): Mark local as volatile if checking for lint,
5704 to suppress a gcc -Wclobbered warning that does not seem to be right.
5705 (MAXPATHLEN): Define only if needed.
5706
5707 * process.c (serial_open, serial_configure): Move decls from here ...
5708 * systty.h: ... to here, so that they can be checked.
5709
5710 * fns.c (get_random, seed_random): Move extern decls from here ...
5711 * lisp.h: ... to here, so that they can be checked.
5712
5713 * sysdep.c (reset_io): Now static.
5714 (wait_for_termination_signal): Remove; unused.
5715
5716 * keymap.c (keymap_parent, keymap_memberp, map_keymap_internal):
5717 (copy_keymap_item, append_key, push_text_char_description):
5718 Now static.
5719 (Fwhere_is_internal): Don't test CONSP (sequences) unnecessarily.
5720 (DENSE_TABLE_SIZE): Remove; unused.
5721 (get_keymap, access_keymap, Fdefine_key, Fwhere_is_internal):
5722 (describe_map_tree):
5723 Rename locals to avoid shadowing.
5724
5725 * keyboard.c: Declare functions static if they are not used elsewhere.
5726 (echo_char, echo_dash, cmd_error, top_level_2):
5727 (poll_for_input, handle_async_input): Now static.
5728 (read_char, kbd_buffer_get_event, make_lispy_position):
5729 (make_lispy_event, make_lispy_movement, apply_modifiers):
5730 (decode_keyboard_code, tty_read_avail_input, menu_bar_items):
5731 (parse_tool_bar_item, read_key_sequence, Fread_key_sequence):
5732 (Fread_key_sequence_vector): Rename locals to avoid shadowing.
5733 (read_key_sequence, read_char): Mark locals as initialized.
5734 (Fexit_recursive_edit, Fabort_recursive_edit): Mark with NO_RETURN.
5735
5736 * keyboard.h (make_ctrl_char): New decl.
5737 (mark_kboards): Move decl here ...
5738 * alloc.c (mark_kboards): ... from here.
5739
5740 * lisp.h (force_auto_save_soon): New decl.
5741
5742 * emacs.c (init_cmdargs): Rename local to avoid shadowing.
5743 (DEFINE_DUMMY_FUNCTION): New macro.
5744 (__do_global_ctors, __do_global_ctors_aux, __do_global_dtors, __main):
5745 Use it.
5746 (main): Add casts to avoid warnings
5747 if GCC considers string literals to be constants.
5748
5749 * lisp.h (fatal_error_signal): Add decl, since it's exported.
5750
5751 * dbusbind.c: Pointer signedness fixes.
5752 (xd_signature, xd_append_arg, xd_initialize):
5753 (Fdbus_call_method, Fdbus_call_method_asynchronously):
5754 (Fdbus_method_return_internal, Fdbus_method_error_internal):
5755 (Fdbus_send_signal, xd_read_message_1, Fdbus_register_service):
5756 (Fdbus_register_signal): Use SSDATA when the context wants char *.
5757
5758 * dbusbind.c (Fdbus_init_bus): Add cast to avoid warning
5759 if GCC considers string literals to be constants.
5760 (Fdbus_register_service, Fdbus_register_method): Remove unused vars.
5761
5762 2011-03-16 Stefan Monnier <monnier@iro.umontreal.ca>
5763
5764 * print.c (PRINT_CIRCLE_CANDIDATE_P): New macro.
5765 (print_preprocess, print_object): New macro to fix last change.
5766
5767 * print.c (print_preprocess): Don't forget font objects.
5768
5769 2011-03-16 Juanma Barranquero <lekktu@gmail.com>
5770
5771 * emacs.c (USAGE3): Doc fixes.
5772
5773 2011-03-15 Andreas Schwab <schwab@linux-m68k.org>
5774
5775 * coding.c (detect_coding_iso_2022): Reorganize code to clarify
5776 structure.
5777
5778 2011-03-14 Juanma Barranquero <lekktu@gmail.com>
5779
5780 * lisp.h (VWindow_system, Qfile_name_history):
5781 * keyboard.h (lispy_function_keys) [WINDOWSNT]:
5782 * w32term.h (w32_system_caret_hwnd, w32_system_caret_height)
5783 (w32_system_caret_x, w32_system_caret_y): Declare extern.
5784
5785 * w32select.c: Don't #include "keyboard.h".
5786 (run_protected): Add extern declaration for waiting_for_input.
5787
5788 * w32.c (Qlocal, noninteractive1, inhibit_window_system):
5789 * w32console.c (detect_input_pending, read_input_pending)
5790 (encode_terminal_code):
5791 * w32fns.c (quit_char, lispy_function_keys, Qtooltip)
5792 (w32_system_caret_hwnd, w32_system_caret_height, w32_system_caret_x)
5793 (w32_system_caret_y, Qfile_name_history):
5794 * w32font.c (w32font_driver, QCantialias, QCotf, QClang):
5795 * w32inevt.c (reinvoke_input_signal, lispy_function_keys):
5796 * w32menu.c (Qmenu_bar, QCtoggle, QCradio, Qoverriding_local_map)
5797 (Qoverriding_terminal_local_map, Qmenu_bar_update_hook):
5798 * w32proc.c (Qlocal, report_file_error):
5799 * w32term.c (Vwindow_system, updating_frame):
5800 * w32uniscribe.c (initialized, uniscribe_font_driver):
5801 Remove unneeded extern declarations.
5802
5803 2011-03-14 Chong Yidong <cyd@stupidchicken.com>
5804
5805 * buffer.c (Fmake_indirect_buffer): Fix incorrect assertions.
5806
5807 2011-03-13 Chong Yidong <cyd@stupidchicken.com>
5808
5809 * buffer.h (BUF_BEGV, BUF_BEGV_BYTE, BUF_ZV, BUF_ZV_BYTE, BUF_PT)
5810 (BUF_PT_BYTE): Rewrite to handle indirect buffers (Bug#8219).
5811 These macros can no longer be used for assignment.
5812
5813 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer):
5814 Assign struct members directly, instead of using BUF_BEGV etc.
5815 (record_buffer_markers, fetch_buffer_markers): New functions for
5816 recording and fetching special buffer markers.
5817 (set_buffer_internal_1, set_buffer_temp): Use them.
5818
5819 * lread.c (unreadchar): Use SET_BUF_PT_BOTH.
5820
5821 * insdel.c (adjust_point): Use SET_BUF_PT_BOTH.
5822
5823 * intervals.c (temp_set_point_both): Use SET_BUF_PT_BOTH.
5824 (get_local_map): Use SET_BUF_BEGV_BOTH and SET_BUF_ZV_BOTH.
5825
5826 * xdisp.c (hscroll_window_tree):
5827 (reconsider_clip_changes): Use PT instead of BUF_PT.
5828
5829 2011-03-13 Eli Zaretskii <eliz@gnu.org>
5830
5831 * makefile.w32-in ($(BLD)/editfns.$(O)): Depend on
5832 $(EMACS_ROOT)/lib/intprops.h.
5833
5834 2011-03-13 Paul Eggert <eggert@cs.ucla.edu>
5835
5836 Fix more problems found by GCC 4.5.2's static checks.
5837
5838 * gtkutil.c (xg_get_pixbuf_from_pixmap): Add cast from char *
5839 to unsigned char * to avoid compiler diagnostic.
5840 (xg_free_frame_widgets): Make it clear that a local variable is
5841 needed only if USE_GTK_TOOLTIP.
5842 (gdk_window_get_screen): Make it clear that this macro is needed
5843 only if USE_GTK_TOOLTIP.
5844 (int_gtk_range_get_value): New function, which avoids a diagnostic
5845 from gcc -Wbad-function-cast.
5846 (xg_set_toolkit_scroll_bar_thumb): Use it.
5847 (xg_tool_bar_callback, xg_tool_item_stale_p): Rewrite to avoid
5848 diagnostic from gcc -Wbad-function-cast.
5849 (get_utf8_string, xg_get_file_with_chooser):
5850 Rename locals to avoid shadowing.
5851 (create_dialog): Move locals to avoid shadowing.
5852
5853 * xgselect.c (xg_select): Remove unused var.
5854
5855 * image.c (four_corners_best): Mark locals as initialized.
5856 (gif_load): Initialize transparent_p to zero (Bug#8238).
5857 Mark another local as initialized.
5858 (my_png_error, my_error_exit): Mark with NO_RETURN.
5859
5860 * image.c (clear_image_cache): Now static.
5861 (DIM, HAVE_STDLIB_H_1): Remove unused macros.
5862 (xpm_load): Redo to avoid "discards qualifiers" gcc warning.
5863 (x_edge_detection): Remove unnecessary cast that
5864 gcc -Wbad-function-cast diagnoses.
5865 (gif_load): Fix pointer signedness.
5866 (clear_image_cache, xbm_read_bitmap_data, x_detect_edges):
5867 (jpeg_load, gif_load): Rename locals to avoid shadowing.
5868
5869 2011-03-12 Paul Eggert <eggert@cs.ucla.edu>
5870
5871 Improve quality of tests for time stamp overflow.
5872 For example, without this patch (encode-time 0 0 0 1 1
5873 1152921504606846976) returns the obviously-bogus value (-948597
5874 62170) on my RHEL 5.5 x86-64 host. With the patch, it correctly
5875 reports time overflow. See
5876 <http://lists.gnu.org/archive/html/emacs-devel/2011-03/msg00470.html>.
5877 * deps.mk (editfns.o): Depend on ../lib/intprops.h.
5878 * editfns.c: Include limits.h and intprops.h.
5879 (TIME_T_MIN, TIME_T_MAX): New macros.
5880 (time_overflow): Move earlier, to before first use.
5881 (hi_time, lo_time): New functions, for an accurate test for
5882 out-of-range times.
5883 (Fcurrent_time, Fget_internal_run_time, make_time): Use them.
5884 (Fget_internal_run_time): Don't assume time_t fits in int.
5885 (make_time): Use list2 instead of Fcons twice.
5886 (Fdecode_time): More accurate test for out-of-range times.
5887 (check_tm_member): New function.
5888 (Fencode_time): Use it, to test for out-of-range times.
5889 (lisp_time_argument): Don't rely on undefined left-shift and
5890 right-shift behavior when checking for time stamp overflow.
5891
5892 * editfns.c (time_overflow): New function, refactoring common code.
5893 (Fformat_time_string, Fdecode_time, Fencode_time):
5894 (Fcurrent_time_string): Use it.
5895
5896 Move 'make_time' to be next to its inverse 'lisp_time_argument'.
5897 * dired.c (make_time): Move to ...
5898 * editfns.c (make_time): ... here.
5899 * systime.h: Note the move.
5900
5901 2011-03-12 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
5902
5903 * fringe.c (update_window_fringes): Remove unused variables.
5904
5905 * unexmacosx.c (copy_data_segment): Also copy __got section.
5906 (Bug#8223)
5907
5908 2011-03-12 Eli Zaretskii <eliz@gnu.org>
5909
5910 * termcap.c [MSDOS]: Include "msdos.h".
5911 (find_capability, tgetnum, tgetflag, tgetstr, tputs, tgetent):
5912 Constify `char *' arguments and their references according to
5913 prototypes in tparam.h.
5914
5915 * deps.mk (termcap.o): Depend on tparam.h and msdos.h.
5916
5917 * msdos.c (XMenuAddPane): 3rd argument is `const char *' now.
5918 Adapt all references accordingly.
5919
5920 * msdos.h (XMenuAddPane): 3rd argument is `const char *' now.
5921
5922 2011-03-11 Tom Tromey <tromey@redhat.com>
5923
5924 * buffer.c (syms_of_buffer): Remove obsolete comment.
5925
5926 2011-03-11 Eli Zaretskii <eliz@gnu.org>
5927
5928 * termhooks.h (encode_terminal_code): Declare prototype.
5929
5930 * msdos.c (encode_terminal_code): Don't declare prototype.
5931
5932 * term.c (encode_terminal_code): Now external again, used by
5933 w32console.c and msdos.c.
5934
5935 * makefile.w32-in ($(BLD)/term.$(O), ($(BLD)/tparam.$(O)):
5936 Depend on $(SRC)/tparam.h, see 2011-03-11T07:24:21Z!eggert@cs.ucla.edu.
5937
5938 2011-03-11 Paul Eggert <eggert@cs.ucla.edu>
5939
5940 Fix some minor problems found by GCC 4.5.2's static checks.
5941
5942 * fringe.c (update_window_fringes): Mark locals as initialized
5943 (Bug#8227).
5944 (destroy_fringe_bitmap, init_fringe_bitmap): Now static.
5945
5946 * alloc.c (mark_fringe_data): Move decl from here ...
5947 * lisp.h (mark_fringe_data) [HAVE_WINDOW_SYSTEM]: ... to here,
5948 to check its interface.
5949 (init_fringe_once): Do not declare unless HAVE_WINDOW_SYSTEM.
5950
5951 * fontset.c (free_realized_fontset): Now static.
5952 (Fset_fontset_font): Rename local to avoid shadowing.
5953 (fontset_font): Mark local as initialized.
5954 (FONTSET_SPEC, FONTSET_REPERTORY, RFONT_DEF_REPERTORY): Remove; unused.
5955
5956 * xrdb.c: Include "xterm.h", to check x_load_resources's interface.
5957
5958 * xselect.c (x_disown_buffer_selections): Remove; not used.
5959 (TRACE3) [!defined TRACE_SELECTION]: Remove; not used.
5960 (x_own_selection, Fx_disown_selection_internal): Rename locals
5961 to avoid shadowing.
5962 (x_handle_dnd_message): Remove local to avoid shadowing.
5963
5964 * lisp.h (GCPRO1_VAR, UNGCPRO_VAR): New macros,
5965 so that the caller can use some name other than gcpro1.
5966 (GCPRO1, UNGCPRO): Reimplement in terms of the new macros.
5967 * xfns.c (Fx_create_frame, x_create_tip_frame, Fx_show_tip):
5968 (Fx_backspace_delete_keys_p):
5969 Use them to avoid shadowing, and rename vars to avoid shadowing.
5970 (x_decode_color, x_set_name, x_window): Now static.
5971 (Fx_create_frame): Add braces to silence GCC warning.
5972 (Fx_file_dialog, Fx_select_font): Fix pointer signedness.
5973 (x_real_positions, xg_set_icon_from_xpm_data, x_create_tip_frame):
5974 Remove unused locals.
5975 (Fx_create_frame, x_create_tip_frame, Fx_show_tip):
5976 (Fx_backspace_delete_keys_p): Rename locals to avoid shadowing.
5977 Some of these renamings use the new GCPRO1_VAR and UNGCPRO_VAR
5978 macros.
5979
5980 * xterm.h (x_mouse_leave): New decl.
5981
5982 * xterm.c (x_copy_dpy_color, x_focus_on_frame, x_unfocus_frame):
5983 Remove unused functions.
5984 (x_shift_glyphs_for_insert, XTflash, XTring_bell):
5985 (x_calc_absolute_position): Now static.
5986 (XTread_socket): Don't define label "out" unless it's used.
5987 Don't declare local "event" unless it's used.
5988 (x_iconify_frame, x_free_frame_resources): Don't declare locals
5989 unless they are used.
5990 (XEMBED_VERSION, xembed_set_info): Don't define unless needed.
5991 (x_fatal_error_signal): Remove; not used.
5992 (x_draw_image_foreground, redo_mouse_highlight, XTmouse_position):
5993 (x_scroll_bar_report_motion, handle_one_xevent, x_draw_bar_cursor):
5994 (x_error_catcher, x_connection_closed, x_error_handler):
5995 (x_error_quitter, xembed_send_message, x_iconify_frame):
5996 (my_log_handler): Rename locals to avoid shadowing.
5997 (x_delete_glyphs, x_ins_del_lines): Mark with NO_RETURN.
5998 (x_connection_closed): Tell GCC not to suggest NO_RETURN.
5999
6000 * xfaces.c (clear_face_cache, Fx_list_fonts, Fface_font):
6001 Rename or move locals to avoid shadowing.
6002 (tty_defined_color, merge_face_heights): Now static.
6003 (free_realized_faces_for_fontset): Remove; not used.
6004 (Fx_list_fonts): Mark variable that gcc -Wuninitialized
6005 does not deduce is never used uninitialized.
6006 (STRDUPA, LSTRDUPA, FONT_POINT_SIZE_QUANTUM): Remove; not used.
6007 (LFACEP): Define only if XASSERTS, as it's not needed otherwise.
6008
6009 * terminal.c (store_terminal_param): Now static.
6010
6011 * xmenu.c (menu_highlight_callback): Now static.
6012 (set_frame_menubar): Remove unused local.
6013 (xmenu_show): Rename parameter to avoid shadowing.
6014 (xmenu_show, xdialog_show, xmenu_show): Make local pointers "const"
6015 since they might point to immutable storage.
6016 (next_menubar_widget_id): Declare only if USE_X_TOOLKIT,
6017 since it's unused otherwise.
6018
6019 * xdisp.c (produce_glyphless_glyph): Initialize lower_xoff.
6020 Add a FIXME, since the code still doesn't look right. (Bug#8215)
6021 (Fcurrent_bidi_paragraph_direction): Simplify slightly; this
6022 avoids a gcc -Wuninitialized diagnostic.
6023 (display_line, BUILD_COMPOSITE_GLYPH_STRING, draw_glyphs):
6024 (note_mouse_highlight): Mark variables that gcc -Wuninitialized
6025 does not deduce are never used uninitialized.
6026
6027 * lisp.h (IF_LINT): New macro, copied from ../lib-src/emacsclient.c.
6028
6029 * xdisp.c (redisplay_window): Rename local to avoid shadowing.
6030 * window.c (window_loop, size_window):
6031 (run_window_configuration_change_hook, enlarge_window): Likewise.
6032
6033 * window.c (display_buffer): Now static.
6034 (size_window): Mark variables that gcc -Wuninitialized
6035 does not deduce are never used uninitialized.
6036 * window.h (check_all_windows): New decl, to forestall
6037 gcc -Wmissing-prototypes diagnostic.
6038 * dispextern.h (bidi_dump_cached_states): Likewise.
6039
6040 * charset.h (CHECK_CHARSET_GET_CHARSET): Rename locals to avoid
6041 shadowing.
6042 * charset.c (map_charset_for_dump, Fchar_charset): Likewise.
6043 Include <limits.h>.
6044 (Fsort_charsets): Redo min/max calculation to shorten the code a bit
6045 and to avoid gcc -Wuninitialized warning.
6046 (load_charset_map): Mark variables that gcc -Wuninitialized
6047 does not deduce are never used uninitialized.
6048 (load_charset): Abort instead of using uninitialized var (Bug#8229).
6049
6050 * coding.c (coding_set_source, coding_set_destination):
6051 Use "else { /* comment */ }" rather than "else /* comment */;"
6052 for clarity, and to avoid gcc -Wempty-body warning.
6053 (Fdefine_coding_system_internal): Don't redeclare 'i' inside
6054 a block, when the outer 'i' will do.
6055 (decode_coding_utf_8, decode_coding_utf_16, detect_coding_emacs_mule):
6056 (emacs_mule_char, decode_coding_emacs_mule, detect_coding_iso_2022):
6057 (decode_coding_iso_2022, decode_coding_sjis, decode_coding_big5):
6058 (decode_coding_raw_text, decode_coding_charset, get_translation_table):
6059 (Fdecode_sjis_char, Fdefine_coding_system_internal):
6060 Rename locals to avoid shadowing.
6061 * character.h (FETCH_STRING_CHAR_ADVANCE): Likewise.
6062 * coding.c (emacs_mule_char, encode_invocation_designation):
6063 Now static, since they're not used elsewhere.
6064 (decode_coding_iso_2022): Add "default: abort ();" as a safety check.
6065 (decode_coding_object, encode_coding_object, detect_coding_system):
6066 (decode_coding_emacs_mule): Mark variables that gcc
6067 -Wuninitialized does not deduce are never used uninitialized.
6068 (detect_coding_iso_2022): Initialize a local variable that might
6069 be used uninitialized. Leave a FIXME because it's not clear that
6070 this initialization is needed. (Bug#8211)
6071 (ISO_CODE_LF, ISO_CODE_CR, CODING_ISO_FLAG_EUC_TW_SHIFT):
6072 (ONE_MORE_BYTE_NO_CHECK, UTF_BOM, UTF_16_INVALID_P):
6073 (SHIFT_OUT_OK, ENCODE_CONTROL_SEQUENCE_INTRODUCER):
6074 (ENCODE_DIRECTION_R2L, ENCODE_DIRECTION_L2R):
6075 Remove unused macros.
6076
6077 * category.c (hash_get_category_set): Remove unused local var.
6078 (copy_category_table): Now static, since it's not used elsewhere.
6079 * character.c (string_count_byte8): Likewise.
6080
6081 * ccl.c (CCL_WRITE_STRING, CCL_ENCODE_CHAR, Fccl_execute_on_string):
6082 (Fregister_code_conversion_map): Rename locals to avoid shadowing.
6083
6084 * chartab.c (copy_sub_char_table): Now static, since it's not used
6085 elsewhere.
6086 (sub_char_table_ref_and_range, char_table_ref_and_range):
6087 Rename locals to avoid shadowing.
6088 (ASET_RANGE, GET_SUB_CHAR_TABLE): Remove unused macros.
6089
6090 * bidi.c (bidi_check_type): Now static, since it's not used elsewhere.
6091 (BIDI_BOB): Remove unused macro.
6092
6093 * cm.c (cmgoto): Mark variables that gcc -Wuninitialized does not
6094 deduce are never used uninitialized.
6095 * term.c (encode_terminal_code): Likewise.
6096
6097 * term.c (encode_terminal_code): Now static. Remove unused local.
6098
6099 * tparam.h: New file.
6100 * term.c, tparam.h: Include it.
6101 * deps.mk (term.o, tparam.o): Depend on tparam.h.
6102 * term.c (tputs, tgetent, tgetflag, tgetnum, tparam, tgetstr):
6103 Move these decls to tparam.h, and make them agree with what
6104 is actually in tparam.c. The previous trick of using incompatible
6105 decls in different modules does not conform to the C standard.
6106 All callers of tparam changed to use tparam's actual API.
6107 * tparam.c (tparam1, tparam, tgoto):
6108 Use const pointers where appropriate.
6109
6110 * cm.c (calccost, cmgoto): Use const pointers where appropriate.
6111 * cm.h (struct cm): Likewise.
6112 * dispextern.h (do_line_insertion_deletion_costs): Likewise.
6113 * scroll.c (ins_del_costs, do_line_insertion_deletion_costs): Likewise.
6114 * term.c (tty_ins_del_lines, calculate_costs, struct fkey_table):
6115 (term_get_fkeys_1, append_glyphless_glyph, produce_glyphless_glyph):
6116 (turn_on_face, init_tty): Likewise.
6117 * termchar.h (struct tty_display_info): Likewise.
6118
6119 * term.c (term_mouse_position): Rename local to avoid shadowing.
6120
6121 * alloc.c (mark_ttys): Move decl from here ...
6122 * lisp.h (mark_ttys): ... to here, so that it's checked against defn.
6123
6124 2011-03-11 Andreas Schwab <schwab@linux-m68k.org>
6125
6126 * .gdbinit (pwinx, xbuffer): Fix access to buffer name.
6127
6128 2011-03-09 Juanma Barranquero <lekktu@gmail.com>
6129
6130 * search.c (compile_pattern_1): Remove argument regp, unused since
6131 revid:rms@gnu.org-19941211082627-3x1g1wyqkjmwloig.
6132 (compile_pattern): Don't pass it.
6133
6134 2011-03-08 Jan Djärv <jan.h.d@swipnet.se>
6135
6136 * xterm.h (DEFAULT_GDK_DISPLAY): New define.
6137 (GDK_WINDOW_XID, gtk_widget_get_preferred_size): New defines
6138 for ! HAVE_GTK3.
6139 (GTK_WIDGET_TO_X_WIN): Use GDK_WINDOW_XID.
6140
6141 * xmenu.c (menu_position_func): Call gtk_widget_get_preferred_size.
6142
6143 * gtkutil.c: Include gtkx.h if HAVE_GTK3. If ! HAVE_GTK3, define
6144 gdk_window_get_screen, gdk_window_get_geometry,
6145 gdk_x11_window_lookup_for_display and GDK_KEY_g.
6146 (xg_set_screen): Use DEFAULT_GDK_DISPLAY.
6147 (xg_get_pixbuf_from_pixmap): New function.
6148 (xg_get_pixbuf_from_pix_and_mask): Change parameters from GdkPixmap
6149 to Pixmap, take frame as parameter, remove GdkColormap parameter.
6150 Call xg_get_pixbuf_from_pixmap instead of
6151 gdk_pixbuf_get_from_drawable.
6152 (xg_get_image_for_pixmap): Do not make GdkPixmaps, call
6153 xg_get_pixbuf_from_pix_and_mask with Pixmap parameters instead.
6154 (xg_check_special_colors): Use GtkStyleContext and its functions
6155 for HAVE_GTK3.
6156 (xg_prepare_tooltip, xg_hide_tooltip): Call gdk_window_get_screen.
6157 (xg_prepare_tooltip, create_dialog, menubar_map_cb)
6158 (xg_update_frame_menubar, xg_tool_bar_detach_callback)
6159 (xg_tool_bar_attach_callback, xg_update_tool_bar_sizes):
6160 Call gtk_widget_get_preferred_size.
6161 (xg_frame_resized): gdk_window_get_geometry only takes 5
6162 parameters.
6163 (xg_win_to_widget, xg_event_is_for_menubar):
6164 Call gdk_x11_window_lookup_for_display.
6165 (xg_set_widget_bg): New function.
6166 (delete_cb): New function.
6167 (xg_create_frame_widgets): Connect delete-event to delete_cb.
6168 Call xg_set_widget_bg. Only set backgrund pixmap for ! HAVE_GTK3
6169 (xg_set_background_color): Call xg_set_widget_bg.
6170 (xg_set_frame_icon): Call xg_get_pixbuf_from_pix_and_mask.
6171 (xg_create_scroll_bar): vadj is a GtkAdjustment for HAVE_GTK3.
6172 Only call gtk_range_set_update_policy if ! HAVE_GTK3.
6173 (xg_make_tool_item): Only connect xg_tool_bar_item_expose_callback
6174 if ! HAVE_GTK3.
6175 (update_frame_tool_bar): Call gtk_widget_hide.
6176 (xg_initialize): Use GDK_KEY_g.
6177
6178 * xsmfns.c (gdk_set_sm_client_id): Define to gdk_set_sm_client_id
6179 if ! HAVE_GTK3
6180 (x_session_initialize): Call gdk_x11_set_sm_client_id.
6181
6182 * xterm.c (XFillRectangle): Use cairo routines for HAVE_GTK3.
6183 (x_term_init): Disable Xinput(2) with GDK_CORE_DEVICE_EVENTS.
6184 Load ~/emacs.d/gtkrc only for ! HAVE_GTK3.
6185
6186 2011-03-08 Juanma Barranquero <lekktu@gmail.com>
6187
6188 * w32xfns.c (select_palette): Check success of RealizePalette against
6189 GDI_ERROR, not zero.
6190
6191 See ChangeLog.11 for earlier changes.
6192
6193 ;; Local Variables:
6194 ;; coding: utf-8
6195 ;; End:
6196
6197 Copyright (C) 2011 Free Software Foundation, Inc.
6198
6199 This file is part of GNU Emacs.
6200
6201 GNU Emacs is free software: you can redistribute it and/or modify
6202 it under the terms of the GNU General Public License as published by
6203 the Free Software Foundation, either version 3 of the License, or
6204 (at your option) any later version.
6205
6206 GNU Emacs is distributed in the hope that it will be useful,
6207 but WITHOUT ANY WARRANTY; without even the implied warranty of
6208 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
6209 GNU General Public License for more details.
6210
6211 You should have received a copy of the GNU General Public License
6212 along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.