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