Fix last changes related to w32 and Cygwin.
[emacs/old-mirror.git] / src / ChangeLog
blob92b55e5146d41c3b4ceebac145dcca56e40ed3fb
1 2012-09-01  Eli Zaretskii  <eliz@gnu.org>
3         * image.c: Restore mistakenly removed inclusion of w32.h.  Without
4         it, GCC doesn't see prototypes of w32_delayed_load, and complains
5         about implicit conversions from integer to pointer.
7 2012-09-01  Daniel Colascione  <dancol@dancol.org>
9         * w32fns.c (x_display_info_for_name): Prevent crash if w32 window
10         system used too early.
12 2012-09-01  Paul Eggert  <eggert@cs.ucla.edu>
14         Better seed support for (random).
15         * emacs.c (main): Call init_random.
16         * fns.c (Frandom): Set the seed from a string argument, if given.
17         Remove long-obsolete Gentzel cruft.
18         * lisp.h, sysdep.c (seed_random): Now takes address and size, not long.
19         (init_random): New function.
21 2012-09-01  Daniel Colascione  <dancol@dancol.org>
23         * xterm.h: Add header guards.  Declare x_menubar_window_to_frame.
24         Remove x_set_frame_alpha, x_bitmap_icon, x_make_frame_visible,
25         x_make_frame_invisible, x_iconify_frame, x_free_frame_resources,
26         x_wm_set_size_hint, x_query_colors, x_real_positions,
27         x_set_menu_bar_lines, x_char_width, x_char_height, x_sync,
28         x_set_tool_bar_lines, x_activate_menubar, and free_frame_menubar,
29         all of which have been moved to common code.
31         * xfaces.c: Include TERM_HEADER instead of listing all possible
32         window-system headers.
34         * w32xfns.c (x_sync): Correct definition of x_sync (a no-op here)
35         to match header.
37         * w32term.h (FRAME_X_WINDOW): Use FRAME_W32_WINDOW instead of
38         directly accessing frame internals.
40         * w32font.h (w): Include font.h.  Define syms_of_w32font and
41         globals_of_w32font.
43         * process.c: Include TERM_HEADER instead of listing all possible
44         window-system headers.
46         * nsterm.h: Remove declarations now in frame.h.  Define
47         FRAME_X_SCREEN, FRAME_X_VISUAL.
49         * menu.c: Include TERM_HEADER instead of listing all possible
50         window-system headers.
52         * keyboard.h: Declare ignore_mouse_drag_p whenever we have a
53         window system.
55         * keyboard.c: Include TERM_HEADER instead of listing all possible
56         window-system headers.
58         * image.c: Include TERM_HEADER instead of listing all possible
59         window-system headers.  Declare Vlibrary_cache when compiling for
60         Windows.
62         * gtkutil.h (xg_list_node_): Include xterm.h to pick up needed
63         window system declarations.
65         * frame.h: Move common functions here: set_frame_menubar,
66         x_set_window_size, x_sync, x_get_focus_frame,
67         x_set_mouse_position, x_set_mouse_pixel_position,
68         x_make_frame_visible, x_make_frame_invisible, x_iconify_frame,
69         x_char_width, x_char_height, x_pixel_width, x_pixel_height,
70         x_set_frame_alpha, x_set_menu_bar_lines, x_set_tool_bar_lines,
71         x_activate_menubar, x_real_positions, x_bitmap_icon,
72         x_set_menu_bar_lines, free_frame_menubar, x_free_frame_resources,
73         and x_query_colors.
75         * frame.c: Include TERM_HEADER instead of listing all possible
76         window-system headers.
78         * font.c: Include TERM_HEADER instead of listing all possible
79         window-system headers.
81         * emacs.c: Include TERM_HEADER.
83         * dispnew.c (d): Include TERM_HEADER instead of listing all
84         possible window-system headers.
86         * ccl.h (c): Include character.h.
88         * Makefile.in: Define WINDOW_SYSTEM_OBJ to hold objects needed for
89         the current window system; include in list of objects to link into
90         Emacs.
91 >>>>>>> MERGE-SOURCE
93 2012-08-31  Dmitry Antipov  <dmantipov@yandex.ru>
95         Remove mark_ttys function and fix tty_display_info initialization.
96         * lisp.h (mark_ttys): Remove prototype.
97         * alloc.c (Fgarbage_collect): Remove redundant (and the only) call
98         to mark_ttys because all possible values of 'top_frame' slot are
99         the frames which are reachable from Vframe_list.
100         * term.c (mark_ttys): Remove.
101         (init_tty): Safely initialize 'top_frame' slot with Qnil.
103 2012-08-31  Dmitry Antipov  <dmantipov@yandex.ru>
105         Change struct frame bitfields from unsigned char to unsigned.
106         * frame.h (struct frame): Change type of 'display_preempted',
107         'visible', 'iconified', 'has_minibuffer', 'wants_modeline',
108         'auto_raise', 'auto_lower', 'no_split', 'explicit_name',
109         'window_sizes_changed', 'mouse_moved' and 'pointer_invisible'
110         bitfields from unsigned char to unsigned.
112 2012-08-31  Dmitry Antipov  <dmantipov@yandex.ru>
114         Remove unused member of struct x_output and struct w32_output.
115         * xterm.h (struct x_output): Remove unused field 'needs_exposure'.
116         * w32term.h (struct w32_output): Likewise.
118 2012-08-30  Jan Djärv  <jan.h.d@swipnet.se>
120         * gtkutil.c (x_wm_set_size_hint): Use 1 col for base_width so it
121         does not become zero (Bug#12234).
123 2012-08-30  Paul Eggert  <eggert@cs.ucla.edu>
125         * dispnew.c (update_frame_1): Pacify gcc -Wstrict-overflow
126         for GCC 4.7.1 x86-64.
128 2012-08-30  Glenn Morris  <rgm@gnu.org>
130         * lread.c (init_lread): For out-of-tree builds, only add the
131         source directory's site-lisp dir to the load-path if it exists,
132         consistent with in-tree builds.  (Bug#12302)
134 2012-08-28  Jan Djärv  <jan.h.d@swipnet.se>
136         * nsmenu.m (initWithContentRect:styleMask:backing:defer:): Initialize
137         button_values to NULL. Call setStykeMask so dialogs get a close button.
138         (windowShouldClose:): Set window_closed.
139         (dealloc): New member, free button_values.
140         (process_dialog:): Make member function. Remove window argument,
141         replace window with self. Count buttons and allocate and store values
142         in button_values.
143         (addButton:value:row:): value is int with the name tag.  Call setTag
144         with tag. Remove return self, declare return value as void.
145         (addString:row:): Remove return self, declare return value as void.
146         (addSplit): Remove return self, declare return value as void.
147         (clicked:): Remove return self, declare return value as void.
148         Set dialog_return to button_values[seltag]. Code formatting change.
149         (initFromContents:isQuestion:): Adjust call to process_dialog.
150         Code formatting change.
151         (timeout_handler:): Set timer_fired to YES.
152         (runDialogAt:): Set timer_fired to NO.
153         Handle click on close button as quit.
155         * nsterm.h (EmacsDialogPanel): Make timer_fired BOOL.
156         Add window_closed and button_values.  Add void as return value for
157         add(Button|String|Split).  addButton takes int instead of Lisp_Object.
158         Add process_dialog as new member.
160 2012-08-28  Eli Zaretskii  <eliz@gnu.org>
162         * ralloc.c (free_bloc): Don't dereference a 'heap' structure if it
163         is not one of the heaps we manage.  (Bug#12242)
165 2012-08-28  Glenn Morris  <rgm@gnu.org>
167         * eval.c (Fcalled_interactively_p): Doc fix.  (Bug#11747)
169 2012-08-28  Martin Rudalics  <rudalics@gmx.at>
171         * window.c (Fset_window_configuration): Remove handling of
172         auto-buffer-name window parameter.  Install revision of reverted
173         fix.
175 2012-08-28  Dmitry Antipov  <dmantipov@yandex.ru>
177         Do not allow to set major mode for a dead buffer.
178         * buffer.c (Fset_buffer_major_mode): Signal an error
179         if the buffer is dead.
180         (Fother_buffer, other_buffer_safely): Remove redundant
181         nested declaration.
183 2012-08-28  Dmitry Antipov  <dmantipov@yandex.ru>
185         Always use set_buffer_if_live to restore original buffer at unwind.
186         * buffer.h (record_unwind_current_buffer): New function.
187         * bytecode.c, dispnew.c, editfns.c, fileio.c, fns.c, insdel.c:
188         * keyboard.c, keymap.c, minibuf.c, print.c, process.c, textprop.c:
189         * undo.c, window.c: Adjust users.
190         * buffer.c (set_buffer_if_live): Fix comment.
192 2012-08-28  Dmitry Antipov  <dmantipov@yandex.ru>
194         Fix usage of set_buffer_internal.
195         * buffer.h (set_buffer_internal): Make it BUFFER_INLINE.
196         * buffer.c (set_buffer_if_live): Use set_buffer_internal.
197         * coding.c (decode_coding): Omit redundant test.
198         * fileio.c (decide_coding_unwind): Likewise.
199         * fns.c (secure_hash): Likewise.
200         * insdel.c (modify_region): Likewise.
201         * keyboard.c (command_loop_1): Likewise.
202         * print.c (PRINTFINISH): Likewise.
203         * xdisp.c (run_window_scroll_functions): Use set_buffer_internal.
205 2012-08-27  Paul Eggert  <eggert@cs.ucla.edu>
207         * dispnew.c: Use bool for boolean.
208         (frame_garbaged, display_completed, delayed_size_change)
209         (fonts_changed_p, add_window_display_history)
210         (add_frame_display_history, verify_row_hash)
211         (adjust_glyph_matrix, clear_window_matrices, glyph_row_slice_p)
212         (row_equal_p, realloc_glyph_pool)
213         (allocate_matrices_for_frame_redisplay)
214         (showing_window_margins_p)
215         (adjust_frame_glyphs_for_frame_redisplay)
216         (build_frame_matrix_from_leaf_window, make_current)
217         (mirrored_line_dance, mirror_line_dance, update_frame)
218         (update_window_tree, update_single_window)
219         (check_current_matrix_flags, update_window, update_text_area)
220         (update_window_line, set_window_update_flags, scrolling_window)
221         (update_frame_1, scrolling, buffer_posn_from_coords)
222         (do_pending_window_change, change_frame_size)
223         (change_frame_size_1, sit_for):
224         Use bool for boolean.
225         (clear_glyph_matrix_rows): Rename from enable_glyph_matrix_rows,
226         and remove last int (actually boolean) argument, which was always 0.
227         All callers changed.
228         * dispextern.h, frame.h, lisp.h: Reflect above API changes.
229         * dispextern.h (struct composition_it): Use bool for boolean.
230         (struct glyph_matrix): Don't assume buffer sizes can fit in 'int'.
231         (struct bidi_it): Use unsigned:1, not int, for boolean prev_was_pdf.
232         * dired.c (file_name_completion):
233         Use bool for boolean.  (This was missed in an earlier change.)
235 2012-08-27  Martin Rudalics  <rudalics@gmx.at>
237         * window.c (Fset_window_configuration): Revert first part of
238         last change.
240 2012-08-27  Jan Djärv  <jan.h.d@swipnet.se>
242         * nsterm.h (NSPanel): New class variable dialog_return.
244         * nsmenu.m (initWithContentRect:styleMask:backing:defer:): Initialize
245         dialog_return.
246         (windowShouldClose:): Use stop instead of stopModalWithCode.
247         (clicked:): Ditto, and also set dialog_return (Bug#12258).
248         (timeout_handler:): Use stop instead of abortModal.  Send a dummy
249         event.
250         (runDialogAt:): Make ret Lisp_Object.  Set it from dialog_return when
251         modal loop returns.
253 2012-08-27  Paul Eggert  <eggert@cs.ucla.edu>
255         * composite.c, data.c, dbusbind.c, dired.c: Use bool for booleans.
256         * composite.c (find_composition, composition_gstring_p)
257         (composition_reseat_it, find_automatic_composition):
258         * data.c (let_shadows_buffer_binding_p)
259         (let_shadows_global_binding_p, set_internal, make_blv)
260         (Fmake_variable_buffer_local, Fmake_local_variable)
261         (Fmake_variable_frame_local, arithcompare, cons_to_unsigned)
262         (cons_to_signed, arith_driver):
263         * dbusbind.c (xd_in_read_queued_messages):
264         * dired.c (directory_files_internal, file_name_completion):
265         Use bool for booleans.
266         * dired.c (file_name_completion):
267         * process.h (fd_callback):
268         Omit int (actually boolean) argument.  It wasn't being used.
269         All uses changed.
270         * composite.h, lisp.h: Reflect above API changes.
272         * cmds.c, coding.c: Use bool for booleans.
273         * cmds.c (move_point, Fself_insert_command):
274         * coding.h (struct composition status, struct coding_system):
275         * coding.c (detect_coding_utf_8, encode_coding_utf_8)
276         (detect_coding_utf_16, encode_coding_utf_16, detect_coding_emacs_mule)
277         (emacs_mule_char, decode_coding_emacs_mule)
278         (encode_coding_emacs_mule, detect_coding_iso_2022)
279         (decode_coding_iso_2022, encode_invocation_designation)
280         (encode_designation_at_bol, encode_coding_iso_2022)
281         (detect_coding_sjis, detect_coding_big5, decode_coding_sjis)
282         (decode_coding_big5, encode_coding_sjis, encode_coding_big5)
283         (detect_coding_ccl, encode_coding_ccl, decode_coding_raw_text)
284         (encode_coding_raw_text, detect_coding_charset)
285         (decode_coding_charset, encode_coding_charset, detect_eol)
286         (detect_coding, get_translation_table, produce_chars)
287         (consume_chars, reused_workbuf_in_use)
288         (make_conversion_work_buffer, code_conversion_save)
289         (decode_coding_object, encode_coding_object)
290         (detect_coding_system, char_encodable_p)
291         (Funencodable_char_position, code_convert_region)
292         (code_convert_string, code_convert_string_norecord)
293         (Fset_coding_system_priority):
294         * fileio.c (Finsert_file_contents):
295         Use bool for booleans.
296         * coding.h, lisp.h: Reflect above API changes.
297         * coding.c: Remove unnecessary static function decls.
298         (detect_coding): Use unsigned, not signed, to copy an unsigned field.
299         (decode_coding, encode_coding, decode_coding_gap): Return 'void',
300         not a boolean 'int', since callers never look at the return value.
301         (ALLOC_CONVERSION_WORK_AREA): Assume caller returns 'void', not 'int'.
302         * coding.h (decoding_buffer_size, encoding_buffer_size)
303         (emacs_mule_string_char): Remove unused extern decls.
304         (struct iso_2022_spec, struct coding_system):
305         Use 'unsigned int : 1' for boolean fields, since there's more than one.
306         (struct emacs_mule_spec): Remove unused field 'full_support'.
307         All initializations removed.
308         * cmds.c (internal_self_insert): Don't assume EMACS_INT fits in 'int'.
310 2012-08-27  Dmitry Antipov  <dmantipov@yandex.ru>
312         Fix spare memory change (Bug#12286).
313         * alloc.c (mark_maybe_pointer): Handle MEM_TYPE_SPARE.
314         (valid_lisp_object_p): Likewise.
316 2012-08-27  Martin Rudalics  <rudalics@gmx.at>
318         * window.c (Fset_window_configuration): Record any window's old
319         buffer if it's replaced (see Bug#8789).  If the new current
320         buffer doesn't appear in the selected window, go to its old
321         point (Bug#12208).
323 2012-08-27  Dmitry Antipov  <dmantipov@yandex.ru>
325         Special MEM_TYPE_SPARE to denote reserved memory.
326         * alloc.c (enum mem_type): New memory type.
327         (refill_memory_reserve): Use new type for spare memory.
328         This prevents live_cons_p and live_string_p from incorrect
329         detection of uninitialized objects from spare memory as live.
331 2012-08-26  Paul Eggert  <eggert@cs.ucla.edu>
333         Spelling fixes.
334         * Makefile.in (.PHONY): versioclean -> versionclean.
336         Remove unused external symbols.
337         * data.c (Qcons, Qfloat, Qmisc, Qstring, Qvector):
338         * window.c (Qwindow_valid_p, decode_valid_window):
339         Now static, not extern.
340         * data.c (Qinterval): Remove; unused.
341         (syms_of_data): Do not define 'interval'.
342         * lisp.h (Qinteger, Qstring, Qmisc, Qvector, Qfloat, Qcons):
343         * window.h (decode_valid_window):
344         Remove decls.
346         * character.c, charset.c, chartab.c: Use bool for booleans.
347         * character.c (lisp_string_width, string_count_byte8)
348         (string_escape_byte8):
349         * charset.c (charset_map_loaded, load_charset_map, read_hex):
350         (load_charset_map_from_file, map_charset_chars)
351         (Fdefine_charset_internal, define_charset_internal)
352         (Fdeclare_equiv_charset, find_charsets_in_text)
353         (Ffind_charset_region, char_charset, Fiso_charset):
354         * chartab.c (sub_char_table_ref, sub_char_table_ref_and_range)
355         (sub_char_table_set, sub_char_table_set_range)
356         (char_table_set_range, optimize_sub_char_table)
357         (map_sub_char_table):
358         Use bool for boolean.
359         * character.c (str_to_unibyte): Omit last boolean argument; it was
360         always 0.  All callers changed.
361         * character.h, charset.h: Adjust to match previous changes.
362         * character.h (char_printable_p): Remove decl of nonexistent function.
363         * charset.h (struct charset): Members code_linear_p, iso_chars_96,
364         ascii_compatible_p, supplementary_p, compact_codes_p, unified_p
365         are all boolean, so make them single-bit bitfields.
367         * lisp.h (ASET): Remove attempt to detect side effects.
368         It was meant to be temporary and it often doesn't work,
369         because when IDX has side effects the behavior of IDX==IDX
370         is undefined.  See Stefan Monnier in
371         <http://lists.gnu.org/archive/html/emacs-devel/2012-08/msg00762.html>.
373 2012-08-26  Barry OReilly  <gundaetiapo@gmail.com>  (tiny change)
375         * lisp.h (functionp): New function (extracted from Ffunctionp).
376         (FUNCTIONP): Use it.
377         * eval.c (Ffunctionp): Use it.
379 2012-08-25  Paul Eggert  <eggert@cs.ucla.edu>
381         * xgselect.c (xg_select): Use auto storage for the GPollFD buffer
382         as that's faster and simpler than static storage.  Don't bother
383         with the g_main_context_query overhead if g_main_context_pending
384         says no events are pending.
385         (gfds, gfds_size): Remove these static vars.
386         (xgselect_initialize): Remove; no longer needed.
387         All uses and decls removed.
389         * emacs.c (fatal_error_signal_hook): Remove.
390         All uses removed.  This leftover from old code was always 0.
392         * casefiddle.c, casetab.c, category.c: Use bool for boolean.
393         * casefiddle.c (casify_object, casify_region):
394         * casetab.c (set_case_table):
395         * category.c, category.h (word_boundary_p):
396         * category.h (CHAR_HAS_CATEGORY):
397         Use bool for booleans, instead of int.
399 2012-08-25  Eli Zaretskii  <eliz@gnu.org>
401         * makefile.w32-in ($(BLD)/alloc.$(O)): Depend on $(GNU_LIB)/execinfo.h.
403 2012-08-25  Paul Eggert  <eggert@cs.ucla.edu>
405         On assertion failure, print backtrace if available.
406         * alloc.c [ENABLE_CHECKING]: Include <execinfo.h>.
407         (die) [ENABLE_CHECKING]: Print a backtrace if available.
408         * Makefile.in (LIB_EXECINFO): New macro.
409         (LIBES): Use it.
411         * bytecode.c, callint.c, callproc.c: Use bool for boolean.
412         * bytecode.c (exec_byte_code):
413         * callint.c (check_mark, Fcall_interactively):
414         * callproc.c (Fcall_process, add_env, child_setup, getenv_internal_1)
415         (getenv_internal, sync_process_alive, call_process_exited):
416         * lisp.h (USE_SAFE_ALLOCA):
417         Use bool for booleans, instead of int.
418         * lisp.h, process.h: Adjust prototypes to match above changes.
419         * callint.c (Fcall_interactively): Don't assume the mark's
420         offset fits in 'int'.
422 2012-08-24  Paul Eggert  <eggert@cs.ucla.edu>
424         * buffer.c, buffer.h: Use bool for boolean.
425         * buffer.c (reset_buffer_local_variables)
426         (buffer_lisp_local_variables, Fset_buffer_modified_p)
427         (Frestore_buffer_modified_p, Fset_buffer_multibyte):
428         (overlays_at, overlays_in, mouse_face_overlay_overlaps)
429         (overlay_touches_p, overlay_strings, Foverlay_put)
430         (report_overlay_modification, call_overlay_mod_hooks):
431         (mmap_enlarge, mmap_set_vars):
432         * buffer.h (buffer_has_overlays, uppercasep, lowercasep):
433         Use bool for booleans, instead of int.
434         * buffer.c (compact_buffer, mmap_free_1): Return void, not int,
435         since the 1-or-0 return value is always ignored anyway.
436         (mmap_initialized_p):
437         * buffer.h (struct buffer_text.inhibit_shrinking): Now bool, not int.
438         * buffer.h, lisp.h: Adjust prototypes to match above changes.
440 2012-08-23  Paul Eggert  <eggert@cs.ucla.edu>
442         * bidi.c: Use bool for boolean.
443         This is a bit more readable, and makes the text segment of bidi.o
444         0.4% smaller on my platform (GCC 4.7.1 x86-64, Fedora 15).
445         Presumably it's faster too.
446         (bidi_initialized, bidi_ignore_explicit_marks_for_paragraph_level):
447         Now bool.
448         (bidi_cache_find_level_change, bidi_cache_iterator_state)
449         (bidi_unshelve_cache, bidi_init_it, bidi_count_bytes)
450         (bidi_char_at_pos, bidi_fetch_char, bidi_paragraph_init)
451         (bidi_explicit_dir_char, bidi_level_of_next_char)
452         (bidi_find_other_level_edge, bidi_move_to_visually_next):
453         Use bool for booleans, instead of int.
454         * dispextern.h (bidi_init_it, bidi_paragraph_init)
455         (bidi_unshelve_cache): Adjust decls to match code.
457 2012-08-23  Martin Rudalics  <rudalics@gmx.at>
459         * keyboard.c (Fposn_at_x_y): Do not allow internal window as
460         argument.
462 2012-08-23  Paul Eggert  <eggert@cs.ucla.edu>
464         * atimer.c, atimer.h (turn_on_atimers): Use bool for boolean.
465         * atimer.h: Include <stdbool.h>.
467 2012-08-22  Dan Nicolaescu  <dann@gnu.org>
469         * frame.h (FRAME_W32_P, FRAME_MSDOS_P, FRAME_NS_P): Change to
470         compile time tests instead of run time tests on systems that do
471         not use them.
472         (FRAME_MAC_P): Remove leftover from deleted code.
473         * frame.c (syms_of_frame): Remove leftover from deleted code.
475 2012-08-22  Jan Djärv  <jan.h.d@swipnet.se>
477         * nsterm.m (insertText:): Don't clear modifiers if code is space.
479 2012-08-22  Paul Eggert  <eggert@cs.ucla.edu>
481         * fontset.c (FONTSET_ADD): Return void, not Lisp_Object.
482         Otherwise, the compiler complains about (A?B:C) where B is void
483         and C is Lisp_Object.  This fixes an incompatibility with Sun C 5.12.
484         (fontset_add): Return void, for FONTSET_ADD.
486 2012-08-21  Paul Eggert  <eggert@cs.ucla.edu>
488         * alloc.c: Use bool for booleans.
489         (gc_in_progress, abort_on_gc)
490         (setjmp_tested_p) [!GC_SAVE_REGISTERS_ON_STACK && !GC_SETJMP_WORKS]:
491         (dont_register_blocks) [GC_MALLOC_CHECK]:
492         (suppress_checking) [ENABLE_CHECKING]: Now bool, not int.
493         (check_string_bytes, make_specified_string, memory_full)
494         (live_string_p, live_cons_p, live_symbol_p, live_float_p)
495         (live_misc_p, live_vector_p, live_buffer_p, mark_maybe_object)
496         (mark_stack, valid_pointer_p, make_pure_string)
497         (Fgarbage_collect, survives_gc_p, gc_sweep):
498         Use bool for booleans, instead of int.
499         (test_setjmp) [!GC_SAVE_REGISTERS_ON_STACK && !GC_SETJMP_WORKS]:
500         Remove unused local.
501         * alloc.c (PURE_POINTER_P):
502         * lisp.h (STRING_MULTIBYTE): Document that it returns a boolean.
503         * editfns.c (Fformat):
504         * fileio.c (Fexpand_file_name, Fsubstitute_in_file_name)
505         (Fdo_auto_save):
506         * fns.c (sweep_weak_table):
507         * lisp.h (suppress_checking, push_message, survives_gc_p)
508         (make_pure_string, gc_in_progress, abort_on_gc):
509         * lread.c (readchar, read1):
510         * print.c (Fprin1_to_string):
511         * xdisp.c (push_message):
512         Use bool for booleans affected directly or indirectly by
513         alloc.c's changes.
515         Make recently-introduced setters macros.
516         * fontset.c (set_fontset_id, set_fontset_name, set_fontset_ascii)
517         (set_fontset_base, set_fontset_frame, set_fontset_nofont_face)
518         (set_fontset_default, set_fontset_fallback): Rename from their
519         upper-case counterparts, and make them functions rather than macros.
520         This is more consistent with the other recently-introduced setters.
521         These don't need to be inline, since they're local.
523 2012-08-21  Jan Djärv  <jan.h.d@swipnet.se>
525         * nsterm.m (fd_handler:): Alloc and release a NSAutoreleasePool in
526         the loop (Bug#12247).
528 2012-08-21  Paul Eggert  <eggert@cs.ucla.edu>
530         * lisp.h (vcopy): Use memcpy rather than our own loop.
531         This fixes a performance regression introduced by the recent
532         addition of vcopy.  This means 'vcopy' will need to be modified
533         for a copying collector, but that's OK.  Also, tighten the
534         checking in the assertion.
536 2012-08-21  Eli Zaretskii  <eliz@gnu.org>
538         * w32uniscribe.c (uniscribe_shape): Fix producing gstring
539         components for RTL text (Bug#11860).  Adjust X-OFFSET of each
540         non-base glyph for the width of the base character, according to
541         what x_draw_composite_glyph_string_foreground expects.
542         Generate WADJUST value according to composition_gstring_width's
543         expectations, to produce correct width of the composed character.
544         Reverse the sign of the DU offset produced by ScriptPlace.
546 2012-08-21  Paul Eggert  <eggert@cs.ucla.edu>
548         * dbusbind.c (xd_remove_watch): Do not assume C99 comments.
550 2012-08-21  Dmitry Antipov  <dmantipov@yandex.ru>
552         Avoid direct writes to contents member of struct Lisp_Vector.
553         * lisp.h (vcopy): New function to copy data into vector.
554         * dispnew.c (Fframe_or_buffer_changed_p): Use AREF and ASET.
555         * fns.c (Ffillarray): Use ASET.
556         * keyboard.c (timer_check_2): Use AREF and ASET.
557         (append_tool_bar_item, Frecent_keys): Use vcopy.
558         * lread.c (read_vector): Use ASET.
559         * msdos.c (Frecent_doskeys): Use vcopy.
560         * xface.c (Finternal_copy_lisp_face): Use vcopy.
561         (Finternal_merge_in_global_face): Use ASET and vcopy.
562         * xfont.c (xfont_list_pattern): Likewise.
564 2012-08-21  Martin Rudalics  <rudalics@gmx.at>
566         * window.c (Fwindow_point): For the selected window always return
567         the position of its buffer's point.
568         (Fset_window_point): For the selected window always go in its
569         buffer to the specified position.
571 2012-08-21  Dmitry Antipov  <dmantipov@yandex.ru>
573         Setter macros for fontsets.
574         * fontset.c (SET_FONTSET_ID, SET_FONTSET_NAME, SET_FONTSET_ASCII)
575         (SET_FONTSET_BASE, SET_FONTSET_FRAME, SET_FONTSET_NOFONT_FACE)
576         (SET_FONTSET_DEFAULT, SET_FONTSET_FALLBACK): New macros.
577         Adjust users.
579 2012-08-20  Glenn Morris  <rgm@gnu.org>
581         * Makefile.in (emacs$(EXEEXT), bootstrap-emacs$(EXEEXT)):
582         Don't assume that `ln -f' works.
584 2012-08-20  Eli Zaretskii  <eliz@gnu.org>
586         * .gdbinit: Use "set $dummy = ..." to avoid warnings from GDB 7.5
587         and later about non-assignments with no effect.  See discussion at
588         http://sourceware.org/ml/gdb-patches/2012-08/msg00518.html for
589         details.
591 2012-08-20  Dmitry Antipov  <dmantipov@yandex.ru>
593         Inline setter functions for Lisp_Objects slots of struct specbinding.
594         * eval.c (set_specpdl_symbol, set_specpdl_old_value): New functions.
595         Adjust users.
597 2012-08-20  Martin Rudalics  <rudalics@gmx.at>
599         * window.c (select_window): Always make selected window's buffer
600         current.
602 2012-08-20  Dmitry Antipov  <dmantipov@yandex.ru>
604         Use AREF and ASET for docstrings of category tables.
605         * category.h (CATEGORY_DOCSTRING): Use AREF.
606         (SET_CATEGORY_DOCSTRING): Use ASET.
607         * category.c (Fdefine_category): Use SET_CATEGORY_DOCSTRING.
609 2012-08-20  Dmitry Antipov  <dmantipov@yandex.ru>
611         Inline setter functions for hash table members.
612         * lisp.h (set_hash_key, set_hash_value, set_hash_next)
613         (set_hash_hash, set_hash_index): Rename with _slot suffix.
614         (set_hash_key_and_value, set_hash_index, set_hash_next)
615         (set_hash_hash): New functions.
616         * charset.c, fns.c: Adjust users.
618 2012-08-20  Dmitry Antipov  <dmantipov@yandex.ru>
620         Inline getter and setter functions for per-buffer values.
621         * buffer.h (per_buffer_default, set_per_buffer_default)
622         (per_buffer_value, set_per_buffer_value): New functions.
623         (PER_BUFFER_VALUE, PER_BUFFER_DEFAULT): Remove.
624         * buffer.c, data.c: Adjust users.
626 2012-08-20  Juanma Barranquero  <lekktu@gmail.com>
628         * makefile.w32-in ($(BLD)/vm-limit.$(O)): Update dependencies.
630 2012-08-19  Paul Eggert  <eggert@cs.ucla.edu>
632         Rely on <config.h> + <unistd.h> to declare 'environ',
633         as gnulib does this if the system doesn't.
634         * callproc.c, editfns.c, process.c (environ) [!USE_CRT_DLL]:
635         Remove declaration.  MS-Windows declares it on stdlib.h which is
636         included by conf_post.h.
637         * emacs.c (environ) [DOUG_LEA_MALLOC]:
638         * vm-limit.c (environ) [ORDINARY_LINK]: Remove decl.
639         * vm-limit.c: Include <unistd.h>, for 'environ'.
641         * unexaix.c, unexcoff.c: Include "mem-limits.h".
642         (start_of_data): Remove decl; mem-limits.h provides it.
644         * xdisp.c (handle_invisible_prop): Make it a bit faster
645         and avoid a gcc -Wmaybe-uninitialized diagnostic.
647 2012-08-19  Chong Yidong  <cyd@gnu.org>
649         * xdisp.c (handle_invisible_prop): Fix ellipses at overlay string
650         ends (Bug#3874).
652 2012-08-19  Andreas Schwab  <schwab@linux-m68k.org>
654         * .gdbinit: Use call instead of set when calling a function in the
655         inferior.
657         * data.c (set_internal): Don't use set_blv_found.
658         (Fkill_local_variable): Likewise.
660 2012-08-18  Alp Aker  <alp.tekin.aker@gmail.com>
662         * nsfont.m (ns_ascii_average_width): Ensure the string
663         ascii_printable is initialized with a null-terminated character
664         array.  Otherwise, it can contain undesired extra characters.
666 2012-08-18  Paul Eggert  <eggert@cs.ucla.edu>
668         port new setting code to Sun C 5.8 2005/10/13
669         * chartab.c, lisp.h (char_table_set, char_table_set_range):
670         Return void, not Lisp_Object.  Otherwise, the compiler
671         complains about (A?B:C) where B is void and C is Lisp_Object
672         when compiling CHAR_TABLE_SET, due to the recent change to
673         the API of sub_char_table_set_contents.
675 2012-08-18  Chong Yidong  <cyd@gnu.org>
677         * xdisp.c (handle_invisible_prop): Obey TEXT_PROP_MEANS_INVISIBLE
678         for the string case (Bug#3874).
680 2012-08-18  Paul Eggert  <eggert@cs.ucla.edu>
682         * buffer.h (BSET): Remove (Bug#12215).
683         Replace all uses with calls to new setter functions.
684         (bset_bidi_paragraph_direction, bset_case_canon_table)
685         (bset_case_eqv_table, bset_directory, bset_display_count)
686         (bset_display_time, bset_downcase_table)
687         (bset_enable_multibyte_characters, bset_filename, bset_keymap)
688         (bset_last_selected_window, bset_local_var_alist)
689         (bset_mark_active, bset_point_before_scroll, bset_read_only)
690         (bset_truncate_lines, bset_undo_list, bset_upcase_table)
691         (bset_width_table):
692         * buffer.c (bset_abbrev_mode, bset_abbrev_table)
693         (bset_auto_fill_function, bset_auto_save_file_format)
694         (bset_auto_save_file_name, bset_backed_up, bset_begv_marker)
695         (bset_bidi_display_reordering, bset_buffer_file_coding_system)
696         (bset_cache_long_line_scans, bset_case_fold_search)
697         (bset_ctl_arrow, bset_cursor_in_non_selected_windows)
698         (bset_cursor_type, bset_display_table, bset_extra_line_spacing)
699         (bset_file_format, bset_file_truename, bset_fringe_cursor_alist)
700         (bset_fringe_indicator_alist, bset_fringes_outside_margins)
701         (bset_header_line_format, bset_indicate_buffer_boundaries)
702         (bset_indicate_empty_lines, bset_invisibility_spec)
703         (bset_left_fringe_width, bset_major_mode, bset_mark)
704         (bset_minor_modes, bset_mode_line_format, bset_mode_name)
705         (bset_name, bset_overwrite_mode, bset_pt_marker)
706         (bset_right_fringe_width, bset_save_length)
707         (bset_scroll_bar_width, bset_scroll_down_aggressively)
708         (bset_scroll_up_aggressively, bset_selective_display)
709         (bset_selective_display_ellipses, bset_vertical_scroll_bar_type)
710         (bset_word_wrap, bset_zv_marker):
711         * category.c (bset_category_table):
712         * syntax.c (bset_syntax_table):
713         New setter functions.
715         * process.h (PSET): Remove (Bug#12215).
716         Replace all uses with calls to new setter functions.
717         Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
718         (PROCESS_INLINE): New macro.
719         (pset_childp): New setter function.
720         (pset_gnutls_cred_type) [HAVE_GNUTLS]: New setter function.
721         * process.c (PROCESS_INLINE):
722         Define to EXTERN_INLINE, so that the corresponding functions
723         are compiled into code.
724         (pset_buffer, pset_command, pset_decode_coding_system)
725         (pset_decoding_buf, pset_encode_coding_system)
726         (pset_encoding_buf, pset_filter, pset_log, pset_mark, pset_name)
727         (pset_plist, pset_sentinel, pset_status, pset_tty_name)
728         (pset_type, pset_write_queue): New setter functions.
730         * window.h (WSET): Remove (Bug#12215).
731         Replace all uses with calls to new setter functions.
732         Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
733         (WINDOW_INLINE): New macro.
734         (wset_buffer, wset_frame, wset_left_col, wset_next, wset_prev)
735         (wset_redisplay_end_trigger, wset_top_line, wset_total_cols)
736         (wset_total_lines, wset_vertical_scroll_bar)
737         (wset_window_end_pos, wset_window_end_valid)
738         (wset_window_end_vpos): New setter functions.
739         * window.c (WINDOW_INLINE):
740         Define to EXTERN_INLINE, so that the corresponding functions
741         are compiled into code.
742         (wset_combination_limit, wset_dedicated, wset_display_table)
743         (wset_hchild, wset_left_fringe_width, wset_left_margin_cols)
744         (wset_new_normal, wset_new_total, wset_next_buffers)
745         (wset_normal_cols, wset_normal_lines, wset_parent, wset_pointm)
746         (wset_prev_buffers, wset_right_fringe_width)
747         (wset_right_margin_cols, wset_scroll_bar_width, wset_start)
748         (wset_temslot, wset_vchild, wset_vertical_scroll_bar_type)
749         (wset_window_parameters):
750         * xdisp.c (wset_base_line_number, wset_base_line_pos)
751         (wset_column_number_displayed, wset_region_showing):
752         New setter functions.
754         * termhooks.h (TSET): Remove (Bug#12215).
755         Replace all uses with calls to new setter functions.
756         Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
757         (TERMHOOKS_INLINE): New macro.
758         (tset_charset_list, tset_selection_alist): New setter functions.
759         * terminal.c (TERMHOOKS_INLINE):
760         Define to EXTERN_INLINE, so that the corresponding functions
761         are compiled into code.
762         (tset_param_alist): New setter function.
764 2012-08-17  Paul Eggert  <eggert@cs.ucla.edu>
766         * keyboard.h (KSET): Remove (Bug#12215).
767         Replace all uses with calls to new setter functions.
768         Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
769         (KEYBOARD_INLINE): New macro.
770         (kset_default_minibuffer_frame, kset_defining_kbd_macro)
771         (kset_input_decode_map, kset_last_command, kset_last_kbd_macro)
772         (kset_prefix_arg, kset_system_key_alist, kset_window_system):
773         New setter functions.
774         * keyboard.c (KEYBOARD_INLINE):
775         Define to EXTERN_INLINE, so that the corresponding functions
776         are compiled into code.
777         (kset_echo_string, kset_kbd_queue)
778         (kset_keyboard_translate_table, kset_last_prefix_arg)
779         (kset_last_repeatable_command, kset_local_function_key_map)
780         (kset_overriding_terminal_local_map, kset_real_last_command)
781         (kset_system_key_syms): New setter functions.
783         * frame.h (FSET): Remove (Bug#12215).
784         Replace all uses with calls to new setter functions.
785         Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
786         (FRAME_INLINE): New macro.
787         (fset_buffer_list, fset_buried_buffer_list, fset_condemned_scroll_bars)
788         (fset_current_tool_bar_string, fset_desired_tool_bar_string)
789         (fset_face_alist, fset_focus_frame, fset_icon_name, fset_menu_bar_items)
790         (fset_menu_bar_vector, fset_menu_bar_window, fset_name)
791         (fset_param_alist, fset_root_window, fset_scroll_bars)
792         (fset_selected_window, fset_title, fset_tool_bar_items)
793         (fset_tool_bar_position, fset_tool_bar_window): New functions.
794         * frame.c (FRAME_INLINE):
795         Define to EXTERN_INLINE, so that the corresponding functions
796         are compiled into code.
797         (fset_buffer_predicate, fset_minibuffer_window): New setter functions.
799         A few more naming-convention fixes for getters and setters.
800         * buffer.c (set_buffer_overlays_before): Move here from buffer.h,
801         and rename from buffer_overlays_set_before.
802         (set_buffer_overlays_after): Move here from buffer.h, and rename
803         from buffer_overlays_set_after.
804         * buffer.h (buffer_intervals): Rename from buffer_get_intervals.
805         All uses changed.
806         (set_buffer_intervals): Rename from buffer_set_intervals.
807         * intervals.c (set_interval_object): Move here from intervals.h,
808         and rename from interval_set_object.
809         (set_interval_left): Move here from intervals.h, and rename from
810         interval_set_left.
811         (set_interval_right): Move here from intervals.h, and rename from
812         interval_set_right.
813         (copy_interval_parent): Move here from intervals.h, and rename from
814         interval_copy_parent.
815         * intervals.h (set_interval_parent): Rename from interval_set_parent.
816         (set_interval_plist): Rename from interval_set_plist.
817         Return void, not Lisp_Object, since no caller uses the result.
818         * lisp.h (string_intervals): Rename from string_get_intervals.
819         (set_string_intervals): Rename from string_set_intervals.
821         * lisp.h (set_char_table_extras): Rename from char_table_set_extras.
822         (set_char_table_contents): Rename from char_table_set_contents.
823         (set_sub_char_table_contents): Rename from sub_char_table_set_contents.
824         All uses changed.  See the end of
825         <http://lists.gnu.org/archive/html/emacs-devel/2012-08/msg00549.html>.
827         * lisp.h (CSET): Remove (Bug#12215).
828         (set_char_table_ascii, set_char_table_defalt, set_char_table_parent)
829         (set_char_table_purpose): New functions,
830         replacing CSET.  All uses changed.  For example, replace
831         "CSET (XCHAR_TABLE (char_table), parent, parent);" with
832         "set_char_table_parent (char_table, parent);".
833         The old version was confusing because it used the same name
834         'parent' for two different things.
836 2012-08-17  Dmitry Antipov  <dmantipov@yandex.ru>
838         Functions to get and set Lisp_Object fields of buffer-local variables.
839         * lisp.h (blv_found, set_blv_found, blv_value, set_blv_value)
840         (set_blv_where, set_blv_defcell, set_blv_valcell): New functions.
841         (BLV_FOUND, SET_BLV_FOUND, BLV_VALUE, SET_BLV_VALUE): Remove.
842         * data.c, eval.c, frame.c: Adjust users.
844 2012-08-17  Chong Yidong  <cyd@gnu.org>
846         * xfaces.c (merge_face_vectors): If the target font specfies a
847         font spec, make the font's attributes take precedence over
848         directly-specified attributes.
849         (merge_face_ref): Recognize :font.
851 2012-08-17  Dmitry Antipov  <dmantipov@yandex.ru>
853         Do not use memcpy for copying intervals.
854         * intervals.c (reproduce_interval): New function.
855         (reproduce_tree, reproduce_tree_obj): Use it.
856         (reproduce_tree_obj): Remove prototype.
858 2012-08-17  Paul Eggert  <eggert@cs.ucla.edu>
860         * lisp.h (duration_to_sec_usec): Remove unused decl.
862 2012-08-17  Alp Aker  <alp.tekin.aker@gmail.com>
864         * nsfont.m (ns_ascii_average_width): Send initWithFormat selector
865         to an allocated instance of NSString, not to the class itself.
867 2012-08-17  Juanma Barranquero  <lekktu@gmail.com>
869         * makefile.w32-in (C_CTYPE_H): New macro.
870         (LISP_H, $(BLD)/ccl.$(O), $(BLD)/doc.$(O), $(BLD)/w32console.$(O)):
871         ($(BLD)/fontset.$(O), $(BLD)/frame.$(O), $(BLD)/composite.$(O)):
872         ($(BLD)/sysdep.$(O), $(BLD)/w32uniscribe.$(O)): Update dependencies.
874 2012-08-16  Paul Eggert  <eggert@cs.ucla.edu>
876         Use ASCII tests for character types.
877         * category.c, dispnew.c, doprnt.c, editfns.c, syntax.c, term.c:
878         * xfns.c, xterm.c:
879         Don't include <ctype.h>; was not needed.
880         * charset.c, doc.c, fileio.c, font.c, frame.c, gtkutil.c, image.c:
881         * sysdep.c, xfaces.c:
882         Include <c-ctype.h> instead of <ctype.h>.
883         * nsterm.m: Include <c-ctype.h>.
884         * charset.c (read_hex):
885         * doc.c (Fsnarf_documentation):
886         * fileio.c (IS_DRIVE) [WINDOWSNT]:
887         (DRIVE_LETTER) [DOS_NT]:
888         (Ffile_name_directory, Fexpand_file_name)
889         (Fsubstitute_in_file_name):
890         * font.c (font_parse_xlfd, font_parse_fcname):
891         * frame.c (x_set_font_backend):
892         * gtkutil.c (xg_get_font):
893         * image.c (xbm_scan, xpm_scan, pbm_scan_number):
894         * nsimage.m (hexchar):
895         * nsterm.m (ns_xlfd_to_fontname):
896         * sysdep.c (system_process_attributes):
897         * xfaces.c (hash_string_case_insensitive):
898         Use C-locale tests instead of locale-specific tests for character
899         types, since we want the ASCII interpretation here, not the
900         interpretation suitable for whatever happens to be the current locale.
902 2012-08-16  Martin Rudalics  <rudalics@gmx.at>
904         Consistently check windows for validity/liveness
905         (Bug#11984, Bug#12025, Bug#12026).
906         * lisp.h (CHECK_VALID_WINDOW): New macro.
907         * window.c (decode_window): Rename to decode_live_window.
908         (decode_valid_window, Fwindow_valid_p): New functions.
909         (Fwindow_frame, Fframe_root_window, Fwindow_minibuffer_p)
910         (Fframe_first_window, Fframe_selected_window, Fwindow_parent)
911         (Fwindow_top_child, Fwindow_left_child, Fwindow_next_sibling)
912         (Fwindow_prev_sibling, Fwindow_combination_limit)
913         (Fset_window_combination_limit, Fwindow_use_time)
914         (Fwindow_total_height, Fwindow_total_width, Fwindow_new_total)
915         (Fwindow_normal_size, Fwindow_new_normal, Fwindow_left_column)
916         (Fwindow_top_line, Fwindow_body_height, Fwindow_body_width)
917         (Fwindow_hscroll, Fset_window_hscroll)
918         (Fwindow_redisplay_end_trigger)
919         (Fset_window_redisplay_end_trigger, Fwindow_edges)
920         (Fwindow_pixel_edges, Fwindow_absolute_pixel_edges)
921         (Fwindow_inside_edges, Fwindow_inside_pixel_edges)
922         (Fcoordinates_in_window_p, Fwindow_point, Fwindow_start)
923         (Fwindow_end, Fset_window_point, Fset_window_start)
924         (Fpos_visible_in_window_p, Fwindow_line_height)
925         (Fwindow_dedicated_p, Fset_window_dedicated_p)
926         (Fwindow_prev_buffers, Fset_window_prev_buffers)
927         (Fwindow_next_buffers, Fwindow_parameters, Fwindow_parameter)
928         (Fset_window_parameter, Fwindow_display_table)
929         (Fset_window_display_table, Fdelete_other_windows_internal)
930         (Fset_window_buffer, Fset_window_new_total)
931         (Fset_window_new_normal, Fdelete_window_internal)
932         (Fwindow_text_height, Fset_window_margins, Fwindow_margins)
933         (Fset_window_fringes, Fwindow_fringes, Fset_window_scroll_bars)
934         (Fwindow_scroll_bars): Check whether argument window is a valid or
935         live window.  Update doc-strings.
936         (syms_of_window): New symbol Qwindow_valid_p.
937         * keyboard.c (Fposn_at_x_y): Check whether argument
938         frame_or_window denotes a valid window.
940 2012-08-16  Dmitry Antipov  <dmantipov@yandex.ru>
942         Fix previous char table change.
943         * lisp.h (CHAR_TABLE_SET): Use sub_char_table_set_contents.
944         * chartab.c (optimize_sub_char_table): Likewise.
946 2012-08-16  Chong Yidong  <cyd@gnu.org>
948         * gtkutil.c (xg_get_font): Demand an Xft font (Bug#3228).
950         * xfont.c (xfont_open):
951         * xftfont.c (xftfont_open): Set the font's max_width field.
953         * nsfont.m (nsfont_open): Similar to the Xft backend, set
954         min_width to space_width and average_width to the average over
955         printable ASCII characters.
956         (ns_char_width): Code cleanup.
957         (ns_ascii_average_width): New utility function.
959         * font.h (struct font): Update comments.
961 2012-08-16  Dmitry Antipov  <dmantipov@yandex.ru>
963         Simple interface to set Lisp_Object fields of character tables.
964         * lisp.h (CSET): New macro.
965         (char_table_set_extras, char_table_set_contents)
966         (sub_char_table_set_contents): New function.
967         * casetab.c, category.c, chartab.c, fns.c, fontset.c, search.c:
968         * syntax.c: Adjust users.
970 2012-08-16  Stefan Monnier  <monnier@iro.umontreal.ca>
972         * eval.c (eval_sub): Bind lexical-binding.
973         * lread.c (Qlexical_binding): Make non-static.
975 2012-08-15  Jan Djärv  <jan.h.d@swipnet.se>
977         * nsmenu.m (popupSession): Remove.
978         (pop_down_menu): Remove endModalSession.
979         (timeout_handler:): New method.
980         (runDialogAt:): Get next timeout.  Start a NSTimer with that timeout.
981         Call runModalForWindow.  Check timer_fired when it returns.
982         If not set, cancel timer and break out of loop.
983         Otherwise loop again, with a new timeout.
985         * nsterm.m: Include fcntl.h if present.
986         (fd_entry, t_readfds, inNsSelect): Remove.
987         (select_writefds, select_valid, select_timeout, selfds)
988         (select_mutex, apploopnr): Add.
989         (EV_TRAILER): Call kbd_buffer_store_event_hold only if q_event_ptr.
990         Otherwise call kbd_buffer_store_event.
991         (ns_send_appdefined): Remove release of fd_entry.
992         (ns_read_socket): Always send appdefined.  Remove inNsSelect check.
993         Increment and decrement apploopnr.
994         (ns_select): If no file descriptors, just do a NSTimer.
995         Otherwise copy read/write masks and start select thread (fd_handler).
996         Start main loop and wait for application defined event.
997         Inform select thread to stop selecting after main loop is exited.
998         (ns_term_init): Create selfds pipe and set non-blocking.
999         Initialize select_mutex. Start the select thread (fd_handler).
1000         (fd_handler:): Loop forever, wait for info from the main thread
1001         to either start or stop selecting.  When select returns, send
1002         and appdefined event.
1003         (sendScrollEventAtLoc:fromEvent:): Check if q_event_ptr is set.
1004         If not call kbd_buffer_store_event.
1006         * nsterm.h (EmacsApp): fd_handler takes id argument.
1007         (EmacsDialogPanel): Add timer_fired and timeout_handler.
1009         * gtkutil.c (xg_mark_data): Use FRAME_X_P.
1011 2012-08-15  Eli Zaretskii  <eliz@gnu.org>
1013         * region-cache.c (move_cache_gap): Update gap_len using the actual
1014         growth of the boundaries array.  Do not change cache_len.
1015         (Bug#12196)
1017 2012-08-15  Dmitry Antipov  <dmantipov@yandex.ru>
1019         Generalize and cleanup font subsystem checks.
1020         * font.h (FONT_DEBUG, font_assert): Remove.
1021         * font.c, fontset.c, w32font.c, xfont.c, xftfont.c:
1022         Change font_assert to eassert.  Use eassert where appropriate.
1024 2012-08-15  Dmitry Antipov  <dmantipov@yandex.ru>
1026         * gtkutil.c (xg_get_font): Use pango_units_to_double.
1028 2012-08-15  Chong Yidong  <cyd@gnu.org>
1030         * gtkutil.c (xg_get_font): Rename from xg_get_font_name.
1031         When using the new font chooser, use gtk_font_chooser_get_font_desc to
1032         extract the font descriptor instead of just the font name.
1033         In that case, return a font spec instead of a string.
1034         (x_last_font_name): Move to this file from xfns.c.
1036         * xfns.c (Fx_select_font): The return value can also be a font
1037         spec.  Move x_last_font_name management to gtkutil.c.
1039         * xfaces.c: Make font weight and style symbols non-static.
1041 2012-08-15  Stefan Monnier  <monnier@iro.umontreal.ca>
1043         * minibuf.c (read_minibuf): Ignore caller's inhibit-read-only
1044         (bug#12117).
1046 2012-08-14  Stefan Monnier  <monnier@iro.umontreal.ca>
1048         * alloc.c (Fgarbage_collect): Use plural form consistently.
1050 2012-08-14  Eli Zaretskii  <eliz@gnu.org>
1052         * keyboard.c (command_loop_1): Reset ignore_mouse_drag_p flag each
1053         iteration through the command loop.  Fixes a problem whereby mouse
1054         movements are ignored until the first mouse click.
1056 2012-08-14  Paul Eggert  <eggert@cs.ucla.edu>
1058         Use bool, not int, for Lisp booleans.
1059         This is more natural, and on my platform (GCC 4.7.1 x86-64) it
1060         makes Emacs a bit smaller and presumably a bit faster.
1061         * lisp.h: Include <stdbool.h>.
1062         (struct Lisp_Boolfwd, defvar_bool):
1063         * lread.c (defvar_bool): Use bool, not int, for Lisp booleans.
1064         * regex.c [!emacs]: Include <stdbool.h>.
1065         (false, true): Remove; <stdbool.h> does this for us now.
1067 2012-08-14  Chong Yidong  <cyd@gnu.org>
1069         * character.c (Fcharacterp): Doc fix (Bug#12076).
1071         * data.c (Findirect_variable): Doc fix (Bug#11040).
1073         * chartab.c (Fmap_char_table): Doc fix (Bug#12061).
1075         * editfns.c (Fformat): Doc fix (Bug#12059).
1076         (Fsave_current_buffer): Doc fix (Bug#11542).
1078 2012-08-14  Barry OReilly  <gundaetiapo@gmail.com>  (tiny change)
1080         * keyboard.c (access_keymap_keyremap): Accept anonymous functions
1081         (bug#12022).
1083 2012-08-14  Martin Rudalics  <rudalics@gmx.at>
1085         * frame.c (make_frame_without_minibuffer, make_minibuffer_frame)
1086         (delete_frame, Fmake_frame_invisible, Ficonify_frame):
1087         * minibuf.c (choose_minibuf_frame, read_minibuf):
1088         * w32fns.c (x_create_tip_frame):
1089         * xfns.c (x_create_tip_frame): Call set_window_buffer instead of
1090         Fset_window_buffer (Bug#11984, Bug#12025, Bug#12026).
1092 2012-08-14  Paul Eggert  <eggert@cs.ucla.edu>
1094         * intervals.c (offset_intervals): Remove obsolete comment.
1096 2012-08-14  Andreas Schwab  <schwab@linux-m68k.org>
1098         * gtkutil.c (find_rtl_image, update_frame_tool_bar): Use NILP.
1100 2012-08-14  Gergely Risko  <gergely@risko.hu>
1102         * coding.c (decode_coding): Record buffer modification before
1103         disabling undo_list (Bug#11773).
1105 2012-08-14  Dmitry Antipov  <dmantipov@yandex.ru>
1107         Revert and cleanup some recent overlay changes.
1108         * buffer.h (enum overlay_type): Remove.
1109         (buffer_get_overlays, buffer_set_overlays): Likewise.
1110         (buffer_set_overlays_before, buffer_set_overlays_after):
1111         New function.  Adjust users.
1112         (unchain_both): Add eassert.
1114 2012-08-14  Dmitry Antipov  <dmantipov@yandex.ru>
1116         * gtkutil.c (update_frame_tool_bar): Use EQ where appropriate.
1118 2012-08-14  Paul Eggert  <eggert@cs.ucla.edu>
1120         * gtkutil.c (xg_mark_data): Don't assume C99.
1122 2012-08-13  Jan Djärv  <jan.h.d@swipnet.se>
1124         * gtkutil.c (xg_frame_tb_info): New struct.
1125         (TB_INFO_KEY): New define.
1126         (xg_free_frame_widgets): Free xg_frame_tb_info for frame if present.
1127         (xg_mark_data): Mark Lisp_Objects in xg_frame_tb_info.
1128         (xg_create_tool_bar): Allocate and initialize a xg_frame_tb_info
1129         if not present.
1130         (update_frame_tool_bar): Return early if data in xg_frame_tb_info
1131         is up to date. Otherwise store new data.
1132         (free_frame_tool_bar): Free xg_frame_tb_info if present.
1134 2012-08-13  Dmitry Antipov  <dmantipov@yandex.ru>
1136         Use KSET for write access to Lisp_Object members of struct kboard.
1137         * keyboard.h (KSET): New macro.
1138         * callint.c, category.c, frame.c, keyboard.c, keyboard.h, macros.c:
1139         * msdos.c, nsfns.m, nsterm.m, term.c, w32fns.c, w32term.c, xfns.c:
1140         * xterm.c: Adjust users.
1142 2012-08-13  Dmitry Antipov  <dmantipov@yandex.ru>
1144         Use BSET for write access to Lisp_Object members of struct buffer.
1145         * buffer.h (BSET): New macro.
1146         * buffer.c, casetab.c, cmds.c, coding.c, data.c, editfns.c:
1147         * fileio.c, frame.c, indent.c, insdel.c, intervals.c, keymap.c:
1148         * minibuf.c, print.c, process.c, syntax.c, undo.c, w32fns.c:
1149         * window.c, xdisp.c, xfns.c: Adjust users.
1151 2012-08-11  BT Templeton  <bpt@hcoop.net>  (tiny change)
1153         * lread.c (syms_of_lread): Initialize Vlexical_binding.
1155 2012-08-11  Jan Djärv  <jan.h.d@swipnet.se>
1157         * nsterm.m (not_in_argv): New function.
1158         (application:openFile,  application:openTempFile:):
1159         (application:openFileWithoutUI:, application:openFiles:): Open file
1160         if not_in_argv returns non-zero (bug#12171).
1162         * gtkutil.c (gtk_font_chooser_dialog_new, GTK_FONT_CHOOSER)
1163         (gtk_font_chooser_set_font, gtk_font_chooser_get_font):
1164         Define for Gtk+ versions less than 3.2.
1165         (xg_get_font_name): Use those functions/macros here.
1166         Reported by Frans Oilinki <moilinki@gmail.com>.
1168 2012-08-11  YAMAMOTO Mitsuharu  <mituharu@math.s.chiba-u.ac.jp>
1170         * unexmacosx.c (copy_data_segment): Copy initialized data in
1171         statically linked libraries from input file rather than memory.
1173         * unexmacosx.c (print_load_command_name): Add cases LC_MAIN,
1174         LC_SOURCE_VERSION, and LC_DYLIB_CODE_SIGN_DRS.
1175         (dump_it) [LC_DYLIB_CODE_SIGN_DRS]: Call copy_linkedit_data.
1177 2012-08-10  Glenn Morris  <rgm@gnu.org>
1179         * conf_post.h (IF_LINT, lint_assume): Move here from lisp.h.
1180         * lisp.h (IF_LINT, lint_assume): Move to conf_post.h.
1182 2012-08-10  Dmitry Antipov  <dmantipov@yandex.ru>
1184         Fix last change to allow compilation with low optimization levels.
1185         * intervals.c (INTERVALS_INLINE): Define to EXTERN_INLINE.
1186         Reported by Jan Djärv <jan.h.d@swipnet.se>.
1188 2012-08-10  Dmitry Antipov  <dmantipov@yandex.ru>
1190         Use common inline syntax in intervals.h.
1191         * intervals.h (INTERVALS_INLINE): New macro.
1192         Change all users from LISP_INLINE.
1194 2012-08-10  Dmitry Antipov  <dmantipov@yandex.ru>
1196         Define Qnone once for all platforms.
1197         * frame.c (Qnone): Define here.
1198         (syms_of_frame): DEFSYM it.
1199         * lisp.h (Qnone): New declaration.
1200         * nsfns.m, nsterm.h, nsterm.m, w32fns.c, w32font.c:
1201         * xfns.c: Remove duplication.  Adjust users.
1203 2012-08-10  Dmitry Antipov  <dmantipov@yandex.ru>
1205         Remove unused macros from intervals.h.
1206         * intervals.h (MERGE_INSERTIONS, DISPLAY_INVISIBLE_GLYPH): Remove.
1207         * intervals.c: Adjust comment.
1209 2012-08-10  Eli Zaretskii  <eliz@gnu.org>
1211         * w32fns.c <w32_unicode_gui>: New static variable.
1212         (globals_of_w32fns): Initialize it according to os_subtype.
1213         (w32_init_class, w32_msg_pump, w32_wnd_proc): Use it instead of
1214         testing os_subtype.
1216 2012-08-10  Joakim Hårsman  <joakim.harsman@gmail.com>  (tiny change)
1217             Eli Zaretskii  <eliz@gnu.org>
1219         Fix bug #10299 with Unicode characters sent by customized
1220         keyboards created by MSKLC.
1221         * w32fns.c (INIT_WINDOW_CLASS): New macro.
1222         (w32_init_class): Use it to initialize the Emacs class with either
1223         ANSI or Unicode API calls.
1224         (w32_msg_pump): Call GetMessageW and DispatchMessageW on NT and
1225         later.
1226         (w32_wnd_proc): If the character code sent by WM_CHAR or
1227         WM_SYSCHAR is above 255, post a WM_UNICHAR message, not the
1228         original message.  Call DefWindowProcW on NT and later.
1230 2012-08-10  Glenn Morris  <rgm@gnu.org>
1232         * Makefile.in (config_h): Fix conf_post.h out-of-tree build location.
1234         * lisp.h (DIRECTORY_SEP): Let configure set it.
1236 2012-08-09  Dmitry Antipov  <dmantipov@yandex.ru>
1238         Use TSET for write access to Lisp_Object slots of struct terminal.
1239         * termhooks.h (TSET): New macro.
1240         * coding.c, terminal.c, xselect.c: Adjust users.
1242 2012-08-08  Stefan Monnier  <monnier@iro.umontreal.ca>
1244         * xdisp.c (safe_eval_handler): Remove prototype.  Receive args describing
1245         the failing expression, include them in the error message.
1246         * eval.c (internal_condition_case_n): Pass nargs and args to hfun.
1247         * lisp.h (internal_condition_case_n): Update declaration.
1249 2012-08-08  Dmitry Antipov  <dmantipov@yandex.ru>
1251         Inline functions to examine and change buffer overlays.
1252         * buffer.c (unchain_both): New function.
1253         * buffer.h (buffer_get_overlays, buffer_set_overlays):
1254         (buffer_has_overlays): New function.
1255         (enum overlay_type): New enum.
1256         * alloc.c, buffer.c, editfns.c, fileio.c, indent.c:
1257         * insdel.c, intervals.c, print.c, xdisp.c: Adjust users.
1259 2012-08-08  Dmitry Antipov  <dmantipov@yandex.ru>
1261         Inline functions to examine and change buffer intervals.
1262         * alloc.c (mark_interval_tree): Remove.
1263         (MARK_INTERVAL_TREE): Simplify.
1264         (UNMARK_BALANCE_INTERVALS): Remove.  Adjust users.
1265         * intervals.c (buffer_balance_intervals): New function.
1266         (graft_intervals_into_buffer): Adjust indentation.
1267         (set_intervals_multibyte): Simplify.
1268         * buffer.h (BUF_INTERVALS): Remove.
1269         (buffer_get_intervals, buffer_set_intervals): New function.
1270         * alloc.c, buffer.c, editfns.c, fileio.c, indent.c, insdel.c:
1271         * intervals.c, textprop.c: Adjust users.
1273 2012-08-08  Dmitry Antipov  <dmantipov@yandex.ru>
1275         Inline functions to examine and change string intervals.
1276         * lisp.h (STRING_INTERVALS, STRING_SET_INTERVALS): Remove.
1277         (string_get_intervals, string_set_intervals): New function.
1278         * alloc.c, buffer.c, editfns.c, fns.c, insdel.c, intervals.c:
1279         * lread.c, print.c, textprop.c: Adjust users.
1281 2012-08-08  Glenn Morris  <rgm@gnu.org>
1283         * lisp.mk (lisp): Remove language/persian.elc.
1285 2012-08-08  Dmitry Antipov  <dmantipov@yandex.ru>
1287         Cleanup intervals.
1288         * intervals.h (NULL_INTERVAL, DEFAULT_INTERVAL): Remove.
1289         (NULL_INTERVAL_P): Likewise.  Adjust users.
1290         (FRONT_STICKY_P, END_NONSTICKY_P, FRONT_NONSTICKY_P):
1291         Adjust comment.  Move under #if 0.
1292         * alloc.c, buffer.c, editfns.c, fns.c, insdel.c, intervals.c:
1293         * print.c, syntax.c, textprop.c, xdisp.c: Adjust users.
1295 2012-08-08  Dmitry Antipov  <dmantipov@yandex.ru>
1297         Check total length of intervals with eassert.
1298         * intervals.h (CHECK_TOTAL_LENGTH): Remove.
1299         * intervals.c: Change all users to eassert.
1301 2012-08-07  Eli Zaretskii  <eliz@gnu.org>
1303         * .gdbinit (xframe, xwindow, nextcons, xcar, xcdr, xlist):
1304         Rename fields to match removal of FGET and WGET and disuse of
1305         INTERNAL_FIELD in Lisp_Cons.
1307 2012-08-07  Dmitry Antipov  <dmantipov@yandex.ru>
1309         Revert and cleanup Lisp_Cons, Lisp_Misc and Lisp_Symbol things.
1310         * lisp.h (struct Lisp_Symbol): Change xname to meaningful
1311         name since all xname users are fixed long time ago.  Do not
1312         use INTERNAL_FIELD.
1313         (set_symbol_name, set_symbol_function, set_symbol_plist):
1314         (set_symbol_next, set_overlay_plist): New function.
1315         (struct Lisp_Cons): Do not use INTERNAL_FIELD.
1316         (struct Lisp_Overlay): Likewise.
1317         (CVAR, MVAR, SVAR): Remove.
1318         * alloc.c, buffer.c, buffer.h, bytecode.c, cmds.c, data.c:
1319         * doc.c, eval.c, fns.c, keyboard.c, lread.c, nsselect.m:
1320         * xterm.c: Adjust users.
1321         * .gdbinit: Change to use name field of struct Lisp_Symbol
1322         where appropriate.
1324 2012-08-07  Dmitry Antipov  <dmantipov@yandex.ru>
1326         Basic functions to set Lisp_Object and pointer slots of intervals.
1327         * intervals.h (interval_set_parent, interval_set_object):
1328         (interval_set_left, interval_set_right, interval_set_plist):
1329         (interval_copy_parent): New function.
1330         (SET_INTERVAL_OBJECT, SET_INTERVAL_PARENT, INTERVAL_PTR_SIZE): Remove.
1331         (RESET_INTERVAL, COPY_INTERVAL_CACHE, MERGE_INTERVAL_CACHE):
1332         Adjust indentation.
1333         (INTERVAL_SIZE): Remove.  Adjust users.
1334         * alloc.c, intervals.c, lread.c, textprop.c: Use new functions.
1336 2012-08-07  Dmitry Antipov  <dmantipov@yandex.ru>
1338         Drop PGET and revert read access to Lisp_Objects slots of Lisp_Process.
1339         * process.h (PGET): Remove.
1340         (struct Lisp_Process): Do not use INTERNAL_FIELD.
1341         * gnutls.c, print.c, process.c, sysdep.c, w32.c, xdisp.c: Adjust users.
1343 2012-08-07  Dmitry Antipov  <dmantipov@yandex.ru>
1345         Drop WGET and revert read access to Lisp_Objects slots of struct window.
1346         * window.h (WGET): Remove.
1347         (struct window): Do not use INTERNAL_FIELD.
1348         * alloc.c, buffer.c, composite.c, dispextern.h, dispnew.c, editfns.c:
1349         * fileio.c, font.c, fontset.c, frame.c, frame.h, fringe.c, indent.c:
1350         * insdel.c, keyboard.c, keymap.c, lisp.h, minibuf.c, msdos.c, nsfns.m:
1351         * nsmenu.m, nsterm.m, print.c, textprop.c, w32fns.c, w32menu.c:
1352         * w32term.c, window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c:
1353         Adjust users.
1355 2012-08-07  Chong Yidong  <cyd@gnu.org>
1357         * window.c (Fwindow_edges, Fwindow_pixel_edges)
1358         (Fwindow_absolute_pixel_edges, Fdelete_other_windows_internal)
1359         (Fdelete_window_internal): Signal an error if the window is not on
1360         a live frame (Bug#12025).
1362 2012-08-07  Dmitry Antipov  <dmantipov@yandex.ru>
1364         Drop FGET and revert read access to Lisp_Objects slots of struct frame.
1365         * frame.h (FGET): Remove.
1366         (struct frame): Do not use INTERNAL_FIELD.
1367         * buffer.c, data.c, dispnew.c, dosfns.c, eval.c, fontset.c, frame.c:
1368         * fringe.c, gtkutil.c, minibuf.c, msdos.c, nsfns.m, nsmenu.m, nsterm.m:
1369         * print.c, term.c, w32fns.c, w32menu.c, w32term.c, window.c, window.h:
1370         * xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Adjust users.
1372 2012-08-06  Juanma Barranquero  <lekktu@gmail.com>
1374         * w32.c: Silence compiler warnings.
1375         (map_w32_filename): Remove unused variable `is_fat'.
1376         (chase_symlinks): Add parentheses around expression.
1378 2012-08-06  Glenn Morris  <rgm@gnu.org>
1380         * sysdep.c: Respect BROKEN_GETWD.
1382         * dispnew.c (GNU_LIBRARY_PENDING_OUTPUT_COUNT, PENDING_OUTPUT_COUNT):
1383         Let configure handle it.
1384         (stdio_ext.h) [DISPNEW_NEEDS_STDIO_EXT]: Include it.
1386 2012-08-06  Dmitry Antipov  <dmantipov@yandex.ru>
1388         Use GCALIGNMENT where appropriate.
1389         * alloc.c (XMALLOC_HEADER_ALIGNMENT, roundup_size):
1390         (union aligned_Lisp_Symbol, union aligned_Lisp_Misc):
1391         (mark_maybe_pointer, pure_alloc): Change to use GCALIGNMENT.
1393 2012-08-06  Eli Zaretskii  <eliz@gnu.org>
1395         * w32menu.c (set_frame_menubar, initialize_frame_menubar):
1396         Don't use FRAME_MENU_BAR_ITEMS as an lvalue.
1398 2012-08-06  Stefan Monnier  <monnier@iro.umontreal.ca>
1400         * buffer.h (struct buffer): Revert `indirections' to a simple int;
1401         that should be sufficient for everyone.
1403 2012-08-06  Jan Djärv  <jan.h.d@swipnet.se>
1405         * keyboard.c (timer_check_2): Add break so timer_check returns next
1406         timeout.
1408 2012-08-06  Dmitry Antipov  <dmantipov@yandex.ru>
1410         Fix Windows build errors introduced after converting to WGET and WSET.
1411         * w32term.c (w32_set_vertical_scroll_bar): Change to use WSET.
1412         Reported by Andy Moreton <andrewjmoreton@gmail.com>.
1414 2012-08-06  Jan Djärv  <jan.h.d@swipnet.se>
1416         * nsterm.m (ns_frame_rehighlight): Use FSET.
1418         * nsmenu.m (ns_update_menubar): Use FSET.
1420 2012-08-06  Dmitry Antipov  <dmantipov@yandex.ru>
1422         Separate read and write access to Lisp_Object slots of Lisp_Process.
1423         * process.h (PGET, PSET): New macros similar to AREF and ASET.
1424         * gnutls.c, print.c, process.c, sysdep.c, w32.c, xdisp.c: Adjust users.
1426 2012-08-06  Dmitry Antipov  <dmantipov@yandex.ru>
1428         Separate read and write access to Lisp_Object slots of struct window.
1429         * window.h (WGET, WSET): New macros similar to AREF and ASET.
1430         * alloc.c, buffer.c, composite.c, dispextern.h, dispnew.c, editfns.c:
1431         * fileio.c, font.c, fontset.c, frame.c, frame.h, fringe.c, indent.c:
1432         * insdel.c, keyboard.c, keymap.c, lisp.h, minibuf.c, msdos.c, nsfns.m:
1433         * nsmenu.m, nsterm.m, print.c, textprop.c, w32fns.c, w32menu.c:
1434         * w32term.c, window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c:
1435         Adjust users.
1437 2012-08-06  Dmitry Antipov  <dmantipov@yandex.ru>
1439         Fix Windows build errors introduced after converting to FGET and FSET.
1440         * w32term.c (x_frame_rehighlight, x_scroll_bar_create):
1441         (w32_condemn_scroll_bars, w32_redeem_scroll_bar):
1442         (w32_judge_scroll_bars): Change to use FSET.
1443         Reported by Andy Moreton <andrewjmoreton@gmail.com>.
1445 2012-08-06  Dmitry Antipov  <dmantipov@yandex.ru>
1447         Fix replacement typo.
1448         * window.c (replace_window): Set root_window instead of
1449         selected_window.  This fixes a total window subsystem
1450         malfunction reported by Bastien Guerry <bzg@gnu.org>.
1452 2012-08-06  Glenn Morris  <rgm@gnu.org>
1454         * lisp.mk (lisp): Add language/persian.elc.
1456 2012-08-06  Dmitry Antipov  <dmantipov@yandex.ru>
1458         Separate read and write access to Lisp_Object slots of struct frame.
1459         * frame.h (FGET, FSET): New macros similar to AREF and ASET.
1460         * buffer.c, data.c, dispnew.c, dosfns.c, eval.c, fontset.c, frame.c:
1461         * fringe.c, gtkutil.c, minibuf.c, msdos.c, nsfns.m, nsmenu.m, nsterm.m:
1462         * print.c, term.c, w32fns.c, w32menu.c, w32term.c, window.c, window.h:
1463         * xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Adjust users.
1465 2012-08-05  Andreas Schwab  <schwab@linux-m68k.org>
1467         * emacs.c (decode_env_path): Only use defaulted if WINDOWSNT.
1469 2012-08-05  Dmitry Antipov  <dmantipov@yandex.ru>
1471         Generalize common compile-time constants.
1472         * lisp.h (header_size, bool_header_size, word_size): Now here.
1473         (struct Lisp_Vector): Add comment.
1474         (struct Lisp_Bool_Vector): Move up to define handy constants.
1475         (VECSIZE, PSEUDOVECSIZE): Simplify.
1476         (SAFE_ALLOCA_LISP): Use new constant.  Adjust indentation.
1477         * buffer.c, buffer.h, bytecode.c, callint.c, eval.c, fns.c:
1478         * font.c, fontset.c, keyboard.c, keymap.c, macros.c, menu.c:
1479         * msdos.c, w32menu.c, w32term.h, window.c, xdisp.c, xfaces.c:
1480         * xfont.c, xmenu.c: Use word_size where appropriate.
1482 2012-08-05  Lawrence Mitchell  <wence@gmx.li>
1484         * search.c (Freplace_match): Treat \? in the replacement text
1485         literally (Bug#8161).
1487 2012-08-05  Chong Yidong  <cyd@gnu.org>
1489         * term.c (Vsuspend_tty_functions, Vresume_tty_functions):
1490         * frame.c (Vdelete_frame_functions):
1491         * emacs.c (Vkill_emacs_hook): Doc fix.
1493 2012-08-04  Eli Zaretskii  <eliz@gnu.org>
1495         * xfns.c (x_set_menu_bar_lines): Fix compilation error in
1496         --with-x-toolkit=no builds.
1497         Reported by Carsten Mattner <carstenmattner@gmail.com>.
1499 2012-08-04  Chong Yidong  <cyd@gnu.org>
1501         * syntax.c (Fmodify_syntax_entry): Doc fix.
1503 2012-08-04  Eli Zaretskii  <eliz@gnu.org>
1505         Fix startup warnings about ../site-lisp on MS-Windows.  (Bug#11959)
1506         * w32.c (init_environment): Change the default values of many
1507         environment variables in dflt_envvars[] to NULL, to avoid pushing
1508         them into environment when they were not already defined.
1509         Remove the code that deletes site-lisp subdirectories from the default
1510         value of EMACSLOADPATH, as it is no longer needed.
1511         (check_windows_init_file): Now external, not static.
1512         Use Vload_path as is, without adding anything, as this function is now
1513         called when Vload_path is already set up.
1515         * w32.h (check_windows_init_file): Add prototype.
1517         * emacs.c (init_cmdargs) [WINDOWSNT]: When running from the build
1518         directory, ignore the /*/i386/ tail in Vinvocation_directory, for
1519         compatibility with Posix platforms.
1520         (main): Move the call to check_windows_init_file to here from
1521         w32.c.
1522         (decode_env_path) [WINDOWSNT]: Expand the %emacs_dir%/ prefix, if
1523         any, in the DEFALT argument into the root of the Emacs build or
1524         installation tree, as appropriate.
1526         * callproc.c (init_callproc_1): Call decode_env_path instead of
1527         doing its equivalent by hand.
1528         (init_callproc): Replace DOS_NT condition with MSDOS, thus letting
1529         the code that sets Vexec_path run on MS-Windows.
1531         * lread.c (init_lread): Add comments to #ifdef's.
1533         * msdos.c (dos_set_window_size, IT_update_begin)
1534         (IT_frame_up_to_date, IT_set_frame_parameters): Use FVAR and WVAR
1535         instead of direct references.
1537 2012-08-04  Paul Eggert  <eggert@cs.ucla.edu>
1539         Export DEFAULT_REHASH_* to GDB.
1540         * lisp.h (DEFAULT_REHASH_THRESHOLD, DEFAULT_REHASH_SIZE):
1541         Now constants, not macros.
1543 2012-08-03  Paul Eggert  <eggert@cs.ucla.edu>
1545         Remove unnecessary casts involving pointers.
1546         These casts are no longer needed now that we assume C89 or later,
1547         since they involve casting to or from void *.
1548         * alloc.c (make_pure_string, make_pure_c_string, pure_cons)
1549         (make_pure_float, make_pure_vector):
1550         * lisp.h (SAFE_ALLOCA, SAFE_ALLOCA_LISP):
1551         * macros.c (Fstart_kbd_macro):
1552         * menu.c (find_and_return_menu_selection):
1553         * minibuf.c (read_minibuf_noninteractive):
1554         * sysdep.c (closedir):
1555         * xdisp.c (x_produce_glyphs):
1556         * xfaces.c (compare_fonts_by_sort_order):
1557         * xfns.c (x_real_positions, select_visual):
1558         * xselect.c (x_stop_queuing_selection_requests)
1559         (x_get_window_property, x_get_window_property_as_lisp_data):
1560         * xterm.c (x_set_frame_alpha, x_find_modifier_meanings):
1561         Remove unnecessary pointer casts.
1562         * alloc.c (record_xmalloc): New function.
1563         * lisp.h (record_xmalloc): New decl.
1564         (SAFE_ALLOCA): Now takes just one arg -- the size -- and acts
1565         more like a function.  This is because the pointer cast is not
1566         needed.  All uses changed.
1567         * print.c (print_string, print_error_message): Avoid length recalc.
1569         Improve fix for macroexp crash with debugging (Bug#12118).
1570         * lisp.h (ASET) [ENABLE_CHECKING]: Pay attention to
1571         ARRAY_MARK_FLAG when checking subscripts, because ASET is
1572         not supposed to be invoked from the garbage collector.
1573         See Andreas Schwab in <http://bugs.gnu.org/12118#25>.
1574         (gc_aset): New function, which is like ASET but can be
1575         used in the garbage collector.
1576         (set_hash_key, set_hash_value, set_hash_next, set_hash_hash)
1577         (set_hash_index): Use it instead of ASET.
1579 2012-08-03  Eli Zaretskii  <eliz@gnu.org>
1581         Support symlinks on latest versions of MS-Windows.
1582         * w32.c: Include winioctl.h and aclapi.h.
1583         (is_symlink, chase_symlinks, enable_privilege, restore_privilege)
1584         (revert_to_self): Forward declarations of static functions.
1585         <static BOOL g_b_init_get_security_info>:
1586         <g_b_init_create_symbolic_link>: New static flags.
1587         (globals_of_w32): Initialize them to zero.
1588         (GetSecurityInfo_Proc, CreateSymbolicLink_Proc): New typedefs.
1589         (map_w32_filename): Improve commentary.  Simplify switch.
1590         (SYMBOLIC_LINK_FLAG_DIRECTORY): Define if not defined in system
1591         headers (most versions of MinGW w32api don't).
1592         (get_security_info, create_symbolic_link)
1593         (get_file_security_desc_by_handle, is_symlink, chase_symlinks):
1594         New functions.
1595         (sys_access, sys_chmod): Call 'chase_symlinks' to resolve symlinks
1596         in the argument file name.
1597         (sys_access): Call unc_volume_file_attributes only if
1598         GetFileAttributes fails with network-related error codes.
1599         (sys_rename): Diagnose renaming of a symlink when the user doesn't
1600         have the required privileges.
1601         (get_file_security_desc_by_name): Rename from
1602         get_file_security_desc.
1603         (stat_worker): New function, with most of the guts of 'stat', and
1604         with addition of handling of symlinks and support for 'lstat'.
1605         If possible, get file's attributes and security information by
1606         handle, not by name.  Produce S_IFLNK bit for symlinks, when
1607         called from 'lstat'.
1608         (stat, lstat): New functions, call 'stat_worker'.
1609         (symlink, readlink, careadlinkat): Rewritten to create and resolve
1610         symlinks when the underlying filesystem supports them.
1612 2012-08-02  Paul Eggert  <eggert@cs.ucla.edu>
1614         Fix macroexp crash on Windows with debugging (Bug#12118).
1615         * lisp.h (ASET) [ENABLE_CHECKING]: Ignore ARRAY_MARK_FLAG when
1616         checking subscripts; problem introduced with the recent
1617         "ASET (a, i, v)" rather than "AREF (a, i) = v" patch.
1618         (ARRAY_MARK_FLAG): Now a macro as well as a constant,
1619         since it's used in non-static inline functions now.
1621         * xfaces.c (face_at_buffer_position, face_for_overlay_string):
1622         Don't assume buffer size fits in 'int'.  Remove unused local.
1624         Use C99-style 'extern inline' if available.
1625         * buffer.h (BUFFER_INLINE):
1626         * category.h (CATEGORY_INLINE):
1627         * character.h (CHARACTER_INLINE):
1628         * charset.h (CHARSET_INLINE):
1629         * composite.h (COMPOSITE_INLINE):
1630         * dispextern.h (DISPEXTERN_INLINE):
1631         * lisp.h (LISP_INLINE):
1632         * systime.h (SYSTIME_INLINE):
1633         New macro, replacing 'static inline' in this header.
1634         * buffer.h, category.h, character.h, charset.h, composite.h:
1635         * dispextern.h, lisp.h, systime.h:
1636         Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
1637         * alloc.c (LISP_INLINE):
1638         * buffer.c (BUFFER_INLINE):
1639         * category.c (CATEGORY_INLINE):
1640         * character.c (CHARACTER_INLINE):
1641         * charset.c (CHARSET_INLINE):
1642         * composite.c (COMPOSITE_INLINE):
1643         * dispnew.c (DISPEXTERN_INLINE):
1644         * sysdep.c (SYSTIME_INLINE):
1645         Define to EXTERN_INLINE, so that the corresponding functions
1646         are compiled into code.
1647         * conf_post.h (INLINE, EXTERN_INLINE, INLINE_HEADER_BEGIN)
1648         (INLINE_HEADER_END): New macros.
1649         * lisp.h (PSEUDOVECTOR_FLAG): Now a macro as well as a constant,
1650         since it's used in non-static inline functions now.
1651         (VALMASK) [!USE_LSB_TAG]: Likewise.
1653 2012-08-02  Glenn Morris  <rgm@gnu.org>
1655         * s/: Remove empty directory.
1657         * s/ms-w32.h: Move to ../nt/inc.
1658         * makefile.w32-in (TAGS, TAGS-gmake, MS_W32_H):
1659         Update for new ms-w32.h location.
1661 2012-08-02  Paul Eggert  <eggert@cs.ucla.edu>
1663         Port to Solaris 8.
1664         * syswait.h (WRETCODE): Remove, consistently with ../configure.ac.
1666 2012-08-02  Glenn Morris  <rgm@gnu.org>
1668         * nsterm.m (ns_exec_path, ns_load_path): Use SEPCHAR rather than
1669         hard-coding the path separator.
1671 2012-08-01  Paul Eggert  <eggert@cs.ucla.edu>
1673         Use "ASET (a, i, v)" rather than "AREF (a, i) = v".
1674         This how ASET and AREF are supposed to work, and makes
1675         it easier to think about future improvements.  See
1676         <http://lists.gnu.org/archive/html/emacs-devel/2012-08/msg00026.html>.
1677         * charset.h (set_charset_attr): New function.
1678         All lvalue-style uses of CHARSET_DECODER etc. changed to use it.
1679         * lisp.h (ASET): Rewrite so as not to use AREF in an lvalue style.
1680         (aref_addr): New function.  All uses of &AREF(...) changed.
1681         (set_hash_key, set_hash_value, set_hash_next, set_hash_hash)
1682         (set_hash_index): New functions.  All lvalue-style uses of
1683         HASH_KEY etc. changed.
1684         * keyboard.c (set_prop): New function.  All lvalue-style uses
1685         of PROP changed.
1687 2012-08-01  Alp Aker  <alp.tekin.aker@gmail.com>
1689         * nsterm.m (ns_set_vertical_scroll_bar, ns_redeem_scroll_bar)
1690         (EmacsWindow-accessibilityAttributeValue, EmacsScroller-initFrame:)
1691         (EmacsScroller-dealloc):  Adjust to use WVAR.  (Bug#12114)
1692         * nsfns.m (ns_set_name_as_filename): Likewise.
1693         * nsmenu.m (ns_update_menubar): Likewise.
1694         * nsselect.m (symbol_to_nsstring): Adjust to use SVAR.
1696 2012-08-01  Eli Zaretskii  <eliz@gnu.org>
1698         * .gdbinit (xcar, xcdr, xlist, xwindow, nextcons, xprintsym):
1699         Adapt to latest changes in field names of the corresponding Lisp
1700         objects.
1702         * xdisp.c (try_window_id): Use WVAR in IF_DEBUG code.
1704 2012-08-01  Glenn Morris  <rgm@gnu.org>
1706         * s/msdos.h: Remove file.
1707         * conf_post.h [MSDOS]: New section, moved from s/msdos.h.
1708         * Makefile.in (S_FILE): Remove.
1709         (config_h): Remove S_FILE.
1711 2012-08-01  Juanma Barranquero  <lekktu@gmail.com>
1713         * s/ms-w32.h (DEVICE_SEP, IS_DIRECTORY_SEP, IS_ANY_SEP):
1714         Remove; moved to nt/config.nt.
1716 2012-08-01  Dmitry Antipov  <dmantipov@yandex.ru>
1718         Use INTERNAL_FIELD for conses and overlays.
1719         * lisp.h (struct Lisp_Cons): Use INTERNAL_FIELD.
1720         Remove obsolete comment.
1721         (MVAR): New macro.
1722         (struct Lisp_Overlay): Use INTERNAL_FIELD.
1723         * alloc.c, buffer.c, buffer.h, fns.c: Adjust users.
1725 2012-08-01  Dmitry Antipov  <dmantipov@yandex.ru>
1727         Use INTERNAL_FIELD for symbols.
1728         * lisp.h (SVAR): New macro.  Adjust users.
1729         * alloc.c, bytecode.c, cmds.c, data.c, doc.c, eval.c:
1730         * fns.c, keyboard.c, lread.c, xterm.c: Users changed.
1732 2012-08-01  Dmitry Antipov  <dmantipov@yandex.ru>
1734         Use INTERNAL_FIELD for processes.
1735         * process.h (PVAR): New macro.  Adjust style.
1736         (struct Lisp_Process): Change Lisp_Object members to INTERNAL_FIELD.
1737         * print.c, process.c, sysdep.c, w32.c, xdisp.c: Users changed.
1739 2012-08-01  Dmitry Antipov  <dmantipov@yandex.ru>
1741         Use INTERNAL_FIELD for windows.
1742         * window.h (WVAR): New macro.
1743         (struct window): Change Lisp_Object members to INTERNAL_FIELD.
1744         * alloc.c, buffer.c, composite.c, dispextern.h, dispnew.c, editfns.c:
1745         * fileio.c, font.c, fontset.c, frame.c, frame.h, fringe.c, indent.c:
1746         * insdel.c, keyboard.c, keymap.c, lisp.h, minibuf.c, nsterm.m, print.c:
1747         * textprop.c, w32fns.c, w32menu.c, w32term.c, window.c, xdisp.c:
1748         * xfaces.c, xfns.c, xmenu.c, xterm.c: Users changed.
1750 2012-08-01  Paul Eggert  <eggert@cs.ucla.edu>
1752         * coding.h (CODING_ATTR_FLUSHING): Remove; unused and wouldn't work.
1754 2012-08-01  Glenn Morris  <rgm@gnu.org>
1756         * lisp.h (IS_DIRECTORY_SEP, IS_DEVICE_SEP, IS_ANY_SEP):
1757         Move to configure.ac.
1759 2012-08-01  Juanma Barranquero  <lekktu@gmail.com>
1761         * makefile.w32-in (CONFIG_H): Update dependencies.
1762         (CONF_POST_H): New macro.
1764         * s/ms-w32.h (SEPCHAR, NULL_DEVICE): Remove; moved to nt/config.nt.
1766 2012-07-31  Glenn Morris  <rgm@gnu.org>
1768         * Makefile.in (S_FILE): No longer set by configure.
1770         * conf_post.h (config_opsysfile): Move earlier, so that WINDOWSNT
1771         is available.
1772         (alloca.h) [WINDOWSNT]: Don't include it on MS Windows.
1774         * process.h (NULL_DEVICE):
1775         * emacs.c (SEPCHAR):
1776         * editfns.c (USER_FULL_NAME): Let configure set them.
1778         * s/README, s/template.h: Remove files.
1780         * conf_post.h [HPUX]: Undefine HAVE_RANDOM and HAVE_RINT.
1782         * conf_post.h (AMPERSAND_FULL_NAME, subprocesses):
1783         Move to configure.ac.
1785 2012-07-31  Eli Zaretskii  <eliz@gnu.org>
1787         * .gdbinit (xframe): Adapt to introduction of FVAR and the
1788         resulting renaming of 'struct frame' members.
1790         * w32menu.c (w32_menu_show): Revert bogus introduction of FVAR.
1792         * fontset.c (dump_fontset): Fix compilation with ENABLE_CHECKING
1793         after introduction of FVAR.
1795 2012-07-31  Jan Djärv  <jan.h.d@swipnet.se>
1797         * nsmenu.m (update_frame_tool_bar): Change key from NSObject* to id.
1799         * nsterm.m (ns_draw_fringe_bitmap, ns_dumpglyphs_image): Use drawInRect
1800         instead of compositeToPoint.
1801         (applicationShouldTerminate): Pass NS String literal to NSRunAlertPanel.
1803         * nsfns.m, nsmenu.m, nsterm.m: Adopt to struct frame/FVAR changes.
1805 2012-07-31  Dmitry Antipov  <dmantipov@yandex.ru>
1807         Generalize INTERNAL_FIELD between buffers, keyboards and frames.
1808         * lisp.h (INTERNAL_FIELD): New macro.
1809         * buffer.h (BUFFER_INTERNAL_FIELD): Remove.
1810         (BVAR): Change to use INTERNAL_FIELD.
1811         * keyboard.h (KBOARD_INTERNAL_FIELD): Likewise.
1812         (KVAR): Change to use INTERNAL_FIELD.
1813         * frame.h (FVAR): New macro.
1814         (struct frame): Use INTERNAL_FIELD for all Lisp_Object fields.
1815         * alloc.c, buffer.c, data.c, dispnew.c, dosfns.c, eval.c, frame.c:
1816         * fringe.c, gtkutil.c, minibuf.c, nsfns.m, nsterm.m, print.c:
1817         * term.c, w32fns.c, w32menu.c, w32term.c, window.c, window.h:
1818         * xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Users changed.
1820 2012-07-31  Dmitry Antipov  <dmantipov@yandex.ru>
1822         Miscellaneous fixes for non-default X toolkits.
1823         * xfns.c (Fx_file_dialog): Change to SSDATA to avoid warnings.
1824         * xterm.c (x_frame_of_widget): Remove redundant prototype.
1825         Move under #ifdef USE_LUCID.
1826         (x_create_toolkit_scroll_bar): Adjust scroll_bar_name
1827         definition and usage to avoid warnings.
1829 2012-07-31  Jan Djärv  <jan.h.d@swipnet.se>
1831         * nsterm.m (openFiles): Fix previous checkin.
1833 2012-07-31  Paul Eggert  <eggert@cs.ucla.edu>
1835         * indent.c (compute_motion): Remove unused local.
1837 2012-07-31  Glenn Morris  <rgm@gnu.org>
1839         * s/usg5-4-common.h (wait3, WRETCODE): Let configure set them.
1841         * conf_post.h [USG5_4]:
1842         Move remaining contents of s/usg5-4-common.h here.
1843         * s/usg5-4-common.h: Remove file.
1845         * conf_post.h [IRIX6_5]: Move remaining contents of s/irix6-5.h here.
1846         * s/irix6-5.h: Remove file.
1848         * conf_post.h [DARWIN_OS]: Move remaining contents of s/darwin.h here.
1849         * s/darwin.h: Remove file.
1851         * conf_post.h [HPUX]: Move random, srandom here from s/hpux10-20.h.
1852         * s/hpux10-20.h: Remove file, which is now empty.
1854 2012-07-30  Glenn Morris  <rgm@gnu.org>
1856         * conf_post.h: New, split from configure.ac's AH_BOTTOM.
1857         * Makefile.in (config_h): Add conf_post.h.
1858         * makefile.w32-in (CONFIG_H): Add conf_post.h.
1860 2012-07-30  Jan Djärv  <jan.h.d@swipnet.se>
1862         * nsterm.m (ns_do_open_file): New variable.
1863         (ns_term_init): Set ns_do_open_file to YES after run returns.
1864         (openFile, openTempFile, openFileWithoutUI, openFiles):
1865         Open files only if ns_do_open_file.
1867 2012-07-30  Paul Eggert  <eggert@cs.ucla.edu>
1869         * lisp.h (SWITCH_ENUM_CAST): Remove.  All uses removed.
1870         This no-op macro hasn't been needed for many years.
1871         * src/regex.c (SWITCH_ENUM_CAST) [!emacs]: Likewise.
1873         Export DIRECTORY_SEP, TYPEMASK, VALMASK to GDB.
1874         * alloc.c (gdb_make_enums_visible) [USE_LSB_TAG]: Add lsb_bits.
1875         * lisp.h (enum lsb_bits) [USE_LSB_TAG]: New enum, for
1876         gdb_make_enums_visible.
1877         (TYPEMASK, VALMASK) [USE_LSB_TAGS]: Now enum constants, not macros.
1878         (DIRECTORY_SEP): Now a constant, not a macro.
1880 2012-07-30  Eli Zaretskii  <eliz@gnu.org>
1882         * w32fns.c (w32_wnd_proc): Pass w32_keyboard_codepage to
1883         w32_kbd_patch_key as the 2nd arg.  (Bug#12082)
1885         * w32term.c <w32_keyboard_codepage>: Renamed from
1886         keyboard_codepage and now external.  All users changed.
1888         * w32term.h: Add declaration of w32_keyboard_codepage.
1890         * w32inevt.c (w32_kbd_patch_key): Accept an additional argument --
1891         the codepage to translate keys to Unicode.  If this argument is
1892         -1, use the value returned by GetConsoleCP.  All callers changed.
1894 2012-07-30  Paul Eggert  <eggert@cs.ucla.edu>
1896         Update .PHONY listings in makefiles.
1897         * Makefile.in (.PHONY): Add all, mostlyclean, clean,
1898         bootstrap-clean, distclean, maintainer-clean, versioclean,
1899         extraclean, frc.
1901         * lisp.h (STRING_BYTES_BOUND): Cast entire result to ptrdiff_t.
1902         This is a bit clearer.  Fix some commentary typos.
1904 2012-07-30  Glenn Morris  <rgm@gnu.org>
1906         * s/netbsd.h: Let configure include signal.h if needed.
1907         Remove file, which is now empty.
1909         * s/usg5-4-common.h (_longjmp, _setjmp, TIOCSIGSEND):
1910         Let configure set them.
1911         * s/irix6-5.h (_longjmp, _setjmp, TIOCSIGSEND):
1912         No more need to undefine.
1914 2012-07-30  Andreas Schwab  <schwab@linux-m68k.org>
1916         * keymap.c (Fkey_description): Don't remove 0x80 bit from
1917         non-single-byte char when adding meta modifier.  (Bug#12090)
1919 2012-07-30  Dmitry Antipov  <dmantipov@yandex.ru>
1921         Convert safe_call to use variable number of arguments.
1922         * xdisp.c (safe_call): Convert to use varargs.  Adjust users.
1923         (safe_call2): Fix comment.
1924         * lisp.h (safe_call): Adjust prototype.
1925         * coding.c (encode_coding_object): Change to use safe_call2.
1926         * xfaces.c (merge_face_heights): Change to use safe_call1.
1928 2012-07-30  Glenn Morris  <rgm@gnu.org>
1930         * s/aix4-2.h (sigmask): No need to undefine it, since syssignal.h
1931         does that unconditionally.  Remove file, which is now empty.
1933         * s/freebsd.h, s/gnu-linux.h, s/sol2-6.h, s/unixware.h:
1934         Remove empty files.
1936 2012-07-30  Paul Eggert  <eggert@cs.ucla.edu>
1938         Export to GDB most of lisp.h's remaining object-like macros.
1939         * lisp.h (min, max): Move earlier, because they're used earlier now.
1940         (INTMASK, ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK)
1941         (CHAR_TABLE_STANDARD_SLOTS, CHARTAB_SIZE_BITS_0)
1942         (CHARTAB_SIZE_BITS_1, CHARTAB_SIZE_BITS_2, CHARTAB_SIZE_BITS_3)
1943         (DEFAULT_HASH_SIZE, COMPILED_ARGLIST, COMPILED_BYTECODE)
1944         (COMPILED_CONSTANTS, COMPILED_STACK_DEPTH, COMPILED_DOC_STRING)
1945         (COMPILED_INTERACTIVE, CHAR_ALT, CHAR_SUPER, CHAR_HYPER, CHAR_SHIFT)
1946         (CHAR_CTL, CHAR_META, CHAR_MODIFIER_MASK, CHARACTERBITS)
1947         (MANY, UNEVALLED, FLOAT_TO_STRING_BUFSIZE, MAX_ALLOCA):
1948         Now constants, for GDB.  They need not be macros.
1949         (MOST_POSITIVE_FIXNUM, MOST_NEGATIVE_FIXNUM, STRING_BYTES_BOUND):
1950         Now constants, for GDB, as well as macros, for static initializers.
1951         (CHAR_TABLE_STANDARD_SLOTS, CHAR_TABLE_EXTRA_SLOTS):
1952         Move to after the definition of struct Lisp_Char_Table,
1953         since the former now needs that type defined.
1954         (enum CHARTAB_SIZE_BITS, enum CHAR_TABLE_STANDARD_SLOTS)
1955         (enum DEFAULT_HASH_SIZE, enum Lisp_Compiled, enum char_bits)
1956         (enum maxargs, enum FLOAT_TO_STRING_BUFSIZE, enum MAX_ALLOCA):
1957         New enums, for gdb_make_enums_visible.
1958         (GLYPH_MODE_LINE_FACE): Remove; unused.
1959         * alloc.c (STRING_BYTES_MAX): Now a constant, not a macro.
1960         (gdb_make_enums_visible): Add enum CHARTAB_SIZE_BITS, enum
1961         CHAR_TABLE_STANDARD_SLOTS, enum char_bits, enum DEFAULT_HASH_SIZE,
1962         enum FLOAT_TO_STRING_BUFSIZE, enum Lisp_Bits, enum Lisp_Compiled,
1963         enum maxargs, enum MAX_ALLOCA.
1964         (ARRAY_MARK_FLAG_VAL, PSEUDOVECTOR_FLAG_VAL, VALMASK_VAL): Remove.
1965         (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Remove;
1966         no longer needed, now that they are done in lisp.h.
1968 2012-07-30  Dmitry Antipov  <dmantipov@yandex.ru>
1970         Cleanup string bytes checking.
1971         * alloc.c (GC_STRING_BYTES, CHECK_STRING_BYTES): Remove.  Convert
1972         all users to STRING_BYTES or string_bytes if GC_CHECK_STRING_BYTES.
1973         (check_string_bytes): Define to empty if not GC_CHECK_STRING_BYTES.
1974         (check_sblock, compact_small_strings): Simplify.
1976 2012-07-29  Paul Eggert  <eggert@cs.ucla.edu>
1978         * lisp.h (LISP_INT_TAG, LISP_INT1_TAG, LISP_STRING_TAG): Remove.
1979         These macros are confusing and no longer need to be defined, as
1980         the enum values now suffice.  All uses replaced with definiens.
1981         (Lisp_Int1, Lisp_String): Define directly; this is clearer.
1983 2012-07-29  Juanma Barranquero  <lekktu@gmail.com>
1985         * makefile.w32-in (LISP_H, $(BLD)/emacs.$(O), $(BLD)/w32inevt.$(O))
1986         ($(BLD)/w32console.$(O)): Update dependencies.
1988 2012-07-29  Dmitry Antipov  <dmantipov@yandex.ru>
1990         Remove HIDE_LISP_IMPLEMENTATION and cleanup cons free list check.
1991         * lisp.h (HIDE_LISP_IMPLEMENTATION): Remove as useless for a long
1992         time.  Adjust users.
1993         (CHECK_CONS_LIST): Remove.  Convert all users to check_cons_list.
1995 2012-07-29  Jan Djärv  <jan.h.d@swipnet.se>
1997         * lread.c (init_lread): Remove if-statement in ifdef HAVE_NS before
1998         setting sitelisp (Bug#12010).
2000 2012-07-29  Eli Zaretskii  <eliz@gnu.org>
2002         * w32heap.h (OS_9X): Rename from OS_WINDOWS_95.
2004         * w32heap.c (cache_system_info):
2005         * w32.c (sys_rename):
2006         * w32proc.c (find_child_console, sys_kill): All users changed.
2008 2012-07-29  Paul Eggert  <eggert@cs.ucla.edu>
2010         * alloc.c (Fgarbage_collect): Indent as per usual Emacs style.
2012 2012-07-29  Eli Zaretskii  <eliz@gnu.org>
2014         * makefile.w32-in (LISP_H): Add $(NT_INC)/stdalign.h.
2016 2012-07-29  Dmitry Antipov  <dmantipov@yandex.ru>
2018         Cleanup statistics calculation in Fgarbage_collect.
2019         * alloc.c (Fgarbage_collect): Rename t1 to meaningful start.
2020         Fix zombies percentage calculation.  Simplify elapsed time calculation.
2022 2012-07-29  Dmitry Antipov  <dmantipov@yandex.ru>
2024         Generalize marker debugging code under MARKER_DEBUG and use eassert.
2025         * insdel.c (CHECK_MARKERS, check_markers_debug_flag): Remove.
2026         (gap_left, gap_right, adjust_markers_for_delete, insert_1_both)
2027         (insert_from_string_1, insert_from_gap, insert_from_buffer_1)
2028         (replace_range, replace_range_2, del_range_2): Change to eassert.
2029         * marker.c (byte_char_debug_check): Adjust style.
2031 2012-07-29  Paul Eggert  <eggert@cs.ucla.edu>
2033         Don't use the abbreviation "win" to refer to Windows (Bug#10421).
2034         * regex.c (MAX_BUF_SIZE): Remove some incorrect and
2035         long-ago-commented-out code that talks about "WIN32".
2036         * w32heap.h (OS_WINDOWS_95): Rename from OS_WIN95.
2037         All uses changed.
2039 2012-07-28  Paul Eggert  <eggert@cs.ucla.edu>
2041         Use Gnulib stdalign module (Bug#9772, Bug#9960).
2042         * alloc.c (XMALLOC_BASE_ALIGNMENT, GC_POINTER_ALIGNMENT, pure_alloc):
2043         Simplify by using alignof.
2044         (pure_alloc) [! USE_LSB_TAG]: Don't over-align EMACS_INT values.
2045         * lisp.h: Include <stdalign.h>.
2046         (GCALIGNMENT): New macro and constant.
2047         (DECL_ALIGN): Remove.  All uses replaced by alignas (GCALIGNMENT).
2048         (USE_LSB_TAG): ifdef on alignas, not on DECL_ALIGN.
2049         (stdalign): New macro, if not already defined.
2051 2012-07-28  Eli Zaretskii  <eliz@gnu.org>
2053         Fix non-ASCII input in non-GUI frames on MS-Windows.  (Bug#12055)
2054         * w32inevt.c: Include w32inevt.h.
2055         (w32_read_console_input): New inline function, calls either
2056         ReadConsoleInputA or ReadConsoleInputW, depending on the value of
2057         w32_console_unicode_input.
2058         (fill_queue): Call w32_read_console_input instead of ReadConsoleInput.
2059         (w32_kbd_patch_key, key_event): Use the codepage returned by
2060         GetConsoleCP, rather than the ANSI codepage returned by GetLocaleInfo.
2061         (key_event): use uChar.UnicodeChar only if
2062         w32_console_unicode_input is non-zero.
2064         * w32console.c: Include w32heap.h.
2065         <w32_console_unicode_input>: New global variable.
2066         (initialize_w32_display): Set w32_console_unicode_input to 1 on NT
2067         family of Windows, zero otherwise.
2069         * w32inevt.h: Declare w32_console_unicode_input.
2071         * xdisp.c (init_iterator): Don't reference tip_frame in a build
2072         --without-x.  (Bug#11742)
2074 2012-07-27  Paul Eggert  <eggert@cs.ucla.edu>
2076         Adjust GDB to reflect pvec_type changes (Bug#12036).
2077         * .gdbinit (xvectype, xpr, xbacktrace): Adjust to reflect the
2078         2012-07-04 changes to pseudovector representation.
2079         Problem reported by Eli Zaretskii in <http://bugs.gnu.org/12036#30>.
2081 2012-07-27  Michael Albinus  <michael.albinus@gmx.de>
2083         * dbusbind.c (XD_DBUS_VALIDATE_BUS_ADDRESS): Canonicalize session
2084         bus address.
2085         (xd_close_bus, Fdbus_init_bus): Handle reference counter properly.
2087 2012-07-27  Eli Zaretskii  <eliz@gnu.org>
2089         * alloc.c (listn): Fix the order the arguments are consed onto the
2090         list.
2092         * lisp.h (enum constype): Use CONSTYPE_HEAP and CONSTYPE_PURE for
2093         enumeration constants, as PURE and HEAP are too general, and clash
2094         with other headers and sources, such as gmalloc.c and the
2095         MS-Windows system headers.  All users changed.
2097 2012-07-27  Dmitry Antipov  <dmantipov@yandex.ru>
2099         Revert last save_excursion_save and save_excursion_restore changes.
2100         * alloc.c, editfns.c, marker.c, lisp.h: Revert.
2101         Lots of crashes reported by Chong Yidong <cyd@gnu.org>.
2103 2012-07-27  Dmitry Antipov  <dmantipov@yandex.ru>
2105         Fix recently-introduced typos in Windows port.
2106         Reported by Martin Rudalics <rudalics@gmx.at>.
2107         * w32.c (init_environment): Replace comma with semicolon.
2108         * w32fns.c (syms_of_w32fns): Add missing parenthesis.
2110 2012-07-27  Paul Eggert  <eggert@cs.ucla.edu>
2112         Improve GDB symbol export (Bug#12036).
2113         * .gdbinit (xgetptr, xgetint, xgettype): Set $bugfix in different
2114         arms of an 'if', not using conditional expressions; otherwise GDB
2115         complains about the types in the unevaluated arm when the argument
2116         is an integer literal.
2117         (xgetint): Simplify expression.
2118         * alloc.c (gdb_make_enums_visible): New constant.  This ports to
2119         GCC 3.4.2 the export of symbols to GDB.  Problem reported by Eli
2120         Zaretskii in <http://bugs.gnu.org/12036#13>.
2121         * lisp.h (PUBLISH_TO_GDB): Remove.  All uses removed.  No longer
2122         needed now that we have gdb_make_enums_visible.
2123         (enum CHECK_LISP_OBJECT_TYPE, enum Lisp_Bits, enum More_Lisp_Bits)
2124         (enum enum_USE_LSB_TAG):
2125         New enum types, packaging up enums that need to be exported to GDB.
2127 2012-07-27  Dmitry Antipov  <dmantipov@yandex.ru>
2129         Utility function to make a list from specified amount of objects.
2130         * lisp.h (enum constype): New datatype.
2131         (listn): New prototype.
2132         * alloc.c (listn): New function.
2133         (Fmemory_use_count, syms_of_alloc): Use it.
2134         * buffer.c (syms_of_buffer): Likewise.
2135         * callint.c (syms_of_callint): Likewise.
2136         * charset.c (define_charset_internal): Likewise.
2137         * coding.c (syms_of_coding): Likewise.
2138         * keymap.c (syms_of_keymap): Likewise.
2139         * search.c (syms_of_search): Likewise.
2140         * syntax.c (syms_of_syntax): Likewise.
2141         * w32.c (init_environment): Likewise.
2142         * w32fns.c (Fw32_battery_status, syms_of_w32fns): Likewise.
2143         * xdisp.c (syms_of_xdisp): Likewise.
2144         * xfns.c (syms_of_xfns): Likewise.
2146 2012-07-27  Dmitry Antipov  <dmantipov@yandex.ru>
2148         Fast save_excursion_save and save_excursion_restore.
2149         * lisp.h (struct Lisp_Excursion): New data type.
2150         (PVEC_EXCURSION): New pseudovector type.
2151         (XEXCURSION, XSETEXCURSION, EXCURSIONP): Convenient macros
2152         to deal with it.  Adjust comments.
2153         (init_marker, attach_marker): New prototype.
2154         (unchain_marker): Adjust prototype.
2155         * marker.c (attach_marker): Change to global.
2156         (init_marker): New function.
2157         * alloc.c (Fmake_marker, build_marker): Use it.
2158         (build_marker): More easserts.
2159         (mark_object): Handle struct Lisp_Excursion.
2160         * editfns.c (save_excursion_save, save_excursion_restore):
2161         Reimplement to use struct Lisp_Excursion.  Add comments.
2163 2012-07-26  Paul Eggert  <eggert@cs.ucla.edu>
2165         Fix export of symbols to GDB (Bug#12036).
2166         * alloc.c (ARRAY_MARK_FLAG_VAL, PSEUDOVECTOR_FLAG_VAL, VALMASK_VAL)
2167         (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Move these here from
2168         emacs.c, as this is a more-suitable home.  Had this been done earlier
2169         the fix for 12036 would have avoided some of the problems noted in
2170         <http://bugs.gnu.org/12036#13> by Eli Zaretskii, as the scope problems
2171         would have been more obvious.
2172         * emacs.c: Do not include <verify.h>; no longer needed.
2173         (gdb_CHECK_LISP_OBJECT_TYPE, gdb_DATA_SEG_BITS)
2174         (gdb_GCTYPEBITS, gdb_USE_LSB_TAG)
2175         (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS, GCTYPEBITS, USE_LSB_TAG):
2176         Remove; now done in lisp.h.
2177         * lisp.h (PUBLISH_TO_GDB): New macro.
2178         (GCTYPEBITS, USE_LSB_TAG, CHECK_LISP_OBJECT_TYPE, enum pvec_type)
2179         (DATA_SEG_BITS): Use it.
2180         (GCTYPEBITS, USE_LSB_TAG): Now also an enum, for GDB.
2181         (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS): Now just an enum, for GDB.
2182         * mem-limits.h (EXCEEDS_LISP_PTR): Redo so that DATA_SEG_BITS need
2183         not be usable in #if.  This simplifies things.
2185 2012-07-26  Juanma Barranquero  <lekktu@gmail.com>
2187         * makefile.w32-in ($(BLD)/emacs.$(O)): Update dependencies.
2189 2012-07-26  Paul Eggert  <eggert@cs.ucla.edu>
2191         Simplify export of symbols to GDB (Bug#12036).
2192         * .gdbinit (xgetptr, xgetint, xgettype): Don't use "set $bugfix =
2193         $bugfix.i", as this doesn't work (with GDB 7.4.1, anyway).
2194         (xgetptr, xgetint, xgettype, xcoding, xcharset, xprintbytestr):
2195         Adjust to changes in lisp.h and emacs.c, by using
2196         CHECK_LISP_OBJECT_TYPE rather than gdb_use_struct, VALMASK instead
2197         of $valmask, DATA_SEG_BITS instead of gdb_data_seg_bits,
2198         INTTYPEBITS instead of gdb_gctypebits - 1, USE_LSB_TAG instead of
2199         gdb_use_lsb, (1 << GCTYPEBITS) - 1 instead of $tagmask, VALBITS
2200         instead of gdb_valbits.
2201         (xvectype, xvector, xpr, xprintstr, xbacktrace): Similarly, use
2202         PSEUDOVECTOR_FLAG instead of PVEC_FLAG, and ARRAY_MARK_FLAG
2203         instead of gdb_array_mark_flag.
2204         (xboolvector): Get size from $->size, not $->header.size.
2205         Use BOOL_VECTOR_BITS_PER_CHAR rather than mystery constants.
2206         (xreload, hook-run, hookpost-run): Remove.
2207         * emacs.c: Include <verify.h>.
2208         (gdb_use_lsb, gdb_use_struct, gdb_valbits, gdb_gctypebits)
2209         (gdb_data_seg_bits, PVEC_FLAG, gdb_array_mark_flag, gdb_pvec_type):
2210         Remove.
2211         (gdb_CHECK_LISP_OBJECT_TYPE, gdb_DATA_SEG_BITS, gdb_GCTYPEBITS)
2212         (gdb_USE_LSB_TAG): New enum constants.
2213         (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS, GCTYPEBITS, USE_LSB_TAG):
2214         Also define these as enum constants, so they're visible to GDB.
2215         (ARRAY_MARK_FLAG_VAL, PSEUDOVECTOR_FLAG_VAL, VALMASK_VAL): New macros.
2216         (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Also define these
2217         as constants, so they're visible to GDB.
2218         * lisp.h (VALBITS, INTTYPEBITS, FIXNUM_BITS, PSEUDOVECTOR_SIZE_BITS)
2219         (PSEUDOVECTOR_SIZE_MASK, PVEC_TYPE_MASK, BOOL_VECTOR_BITS_PER_CHAR):
2220         Now enum constants, not macros, so they're visible to GDB.
2221         (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS): Default to 0, as this is
2222         more convenient now.  All uses changed.
2223         (VALMASK) [USE_LSB_TAG]: Also define in this case.
2224         * mem-limits.h (EXCEEDS_LISP_PTR): Adjust to DATA_SEG_BITS change.
2226 2012-07-26  Dmitry Antipov  <dmantipov@yandex.ru>
2228         Explicitly free restriction data that are not needed anymore.
2229         * editfns.c (save_restriction_restore): Free restriction data.
2231 2012-07-26  Stefan Monnier  <monnier@iro.umontreal.ca>
2233         * eval.c (Fautoload_do_load): Rename from do_autoload, export to Lisp,
2234         add argument, tune behavior, and adjust all callers.
2236 2012-07-25  Paul Eggert  <eggert@cs.ucla.edu>
2238         Use typedef for EMACS_INT, EMACS_UINT.
2239         * lisp.h, s/ms-w32.h (EMACS_INT, EMACS_UINT): Use typedefs rather
2240         than macros.  This simplifies debugging in the usual case, since
2241         it lets GDB show addresses as 'EMACS_INT *' rather than 'long int *'
2242         and it allows expressions involving EMACS_INT casts.
2243         * .gdbinit (xreload): Simplify by using EMACS_INT cast.
2245 2012-07-25  Jan Djärv  <jan.h.d@swipnet.se>
2247         * nsterm.m (ns_read_socket): Return early if there is a modal
2248         window (Bug#12043).
2250 2012-07-25  Martin Rudalics  <rudalics@gmx.at>
2252         * frame.c (Fredirect_frame_focus): In doc-string don't mention
2253         that FOCUS-FRAME can be omitted.
2255 2012-07-25  Dmitry Antipov  <dmantipov@yandex.ru>
2257         Adjust buffer text indirection counters at the end of Fkill_buffer.
2258         * buffer.c (Fkill_buffer): Adjust indirection counters when the
2259         buffer is definitely dead.  This should really fix an issue reported
2260         by Christoph Scholtes again.  (Bug#12007).
2261         (init_buffer_once): Initialize indirection counters of
2262         buffer_defaults and buffer_local_symbols (for sanity and safety).
2264 2012-07-24  Eli Zaretskii  <eliz@gnu.org>
2266         * xdisp.c (init_iterator): Don't compute dimensions of truncation
2267         and continuation glyphs on tooltip frames, leave them at zero.
2268         Avoids continued lines in tooltips.  (Bug#11832)
2270 2012-07-24  Dmitry Antipov  <dmantipov@yandex.ru>
2272         Simplify copy_overlay.
2273         * buffer.c (copy_overlay): Simplify.  Use build_marker.
2274         * lisp.h (struct Lisp_Overlay): Restore comment with minor tweaks.
2276 2012-07-23  Eli Zaretskii  <eliz@gnu.org>
2278         * print.c (print_object): Don't crash when a frame's name is nil
2279         or invalid.  (Bug#12025)
2281         * window.c (decode_any_window): Disable CHECK_LIVE_FRAME test, as
2282         it signals an error when a tooltip frame is being created.
2284 2012-07-23  Dmitry Antipov  <dmantipov@yandex.ru>
2286         Cleanup miscellaneous objects allocation and initialization.
2287         * alloc.c (allocate_misc): Change to static.  Add argument to
2288         specify the subtype.  Adjust comment and users.
2289         (build_overlay): New function.
2290         * buffer.c (copy_overlays, Fmake_overlay): Use it.
2291         * lisp.h (struct Lisp_Overlay): Remove obsolete comment.
2292         (allocate_misc): Remove prototype.
2293         (build_overlay): Add prototype.
2295 2012-07-23  Dmitry Antipov  <dmantipov@yandex.ru>
2297         Swap buffer text indirection counters in Fbuffer_swap_text.
2298         * buffer.c (Fbuffer_swap_text): Swap indirections too.
2299         This avoids crash reported by Christoph Scholtes at
2300         http://lists.gnu.org/archive/html/bug-gnu-emacs/2012-07/msg00785.html.
2302 2012-07-22  Jan Djärv  <jan.h.d@swipnet.se>
2304         * nsmenu.m (Popdown_data): New struct.
2305         (pop_down_menu): p->pointer is Popdown_data.  Release the pool and
2306         free Popdown_data.
2307         (ns_popup_dialog): Use NSAutoreleasePool and pass it to pop_down_menu.
2308         (initWithContentRect): Make imgView and contentView non-static
2309         and autorelease them.  Also autorelease img and matrix (Bug#12005).
2310         (dealloc): Remove (Bug#12005).
2312 2012-07-22  Dmitry Antipov  <dmantipov@yandex.ru>
2314         Adjust consing_since_gc when objects are explicitly freed.
2315         * alloc.c (GC_DEFAULT_THRESHOLD): New macro.
2316         (Fgarbage_collect): Use it.  Change minimum to 1/10 of default.
2317         (free_cons, free_misc): Subtract object size from consing_since_gc.
2319 2012-07-22  Dmitry Antipov  <dmantipov@yandex.ru>
2321         Simplify and cleanup markers positioning code.
2322         * marker.c (attach_marker): More useful eassert.
2323         (live_buffer, set_marker_internal): New function.
2324         (Fset_marker, set_marker_restricted): Use set_marker_internal.
2325         (set_marker_both, set_marker_restricted_both): Use live_buffer.
2327 2012-07-22  Paul Eggert  <eggert@cs.ucla.edu>
2329         * buffer.h (struct buffer.indirections): Now ptrdiff_t, not int,
2330         as it's limited by the amount of memory, not by INT_MAX.
2332 2012-07-21  Eli Zaretskii  <eliz@gnu.org>
2334         * keyboard.c (keys_of_keyboard): Bind language-change to 'ignore'
2335         in special-event-map.  See the discussion at
2336         http://lists.gnu.org/archive/html/emacs-devel/2012-06/msg00417.html
2337         for the reasons.
2339         * w32menu.c (add_menu_item): Cast to ULONG_PTR when assigning
2340         info.dwItemData.  Fixes crashes on 64-bit Windows.
2341         Suggested by Fabrice Popineau <fabrice.popineau@supelec.fr>.
2343 2012-07-21  Jan Djärv  <jan.h.d@swipnet.se>
2345         * nsterm.m (accessibilityAttributeValue): New function. (Bug#11134).
2346         (conversationIdentifier): Return value is NSInteger.
2347         * nsterm.m (accessibilityAttributeValue): Surround with NS_IMPL_COCOA.
2349 2012-07-21  Chong Yidong  <cyd@gnu.org>
2351         * window.c (decode_any_window): Signal an error if the window is
2352         on a dead frame (Bug#11984).
2354 2012-07-20  Dmitry Antipov  <dmantipov@yandex.ru>
2356         Add indirection counting to speed up Fkill_buffer.
2357         * buffer.h (struct buffer): New member.
2358         * buffer.c (Fget_buffer_create): Set indirection counter to 0.
2359         (Fmake_indirect_buffer): Set indirection counter to -1, increment
2360         base buffer indirection counter.
2361         (compact_buffer): If ENABLE_CHECKING, verify indirection counters.
2362         (Fkill_buffer): Adjust indirection counters as needed, don't walk
2363         through buffer list if indirection counter is 0.
2365 2012-07-20  Dmitry Antipov  <dmantipov@yandex.ru>
2367         Extend the value returned by Fgarbage_collect with heap statistics.
2368         * alloc.c (Qheap): New symbol.
2369         (syms_of_alloc): DEFSYM it.
2370         (Fgarbage_collect): If DOUG_LEA_MALLOC, add mallinfo data.
2371         (Fmemory_free): Remove.
2372         (syms_of_alloc): Don't defsubr it.
2373         * buffer.c (Fcompact_buffer): Remove.
2374         (syms_of_buffer): Don't defsubr it.
2376 2012-07-20  Dmitry Antipov  <dmantipov@yandex.ru>
2378         Make maybe_gc inline.
2379         Verify that inlining is always possible (GCC 4.7.1, -O3 -Winline).
2380         * lisp.h (consing_since_gc, gc_relative_threshold)
2381         (memory_full_cons_threshold): Revert declaration.
2382         (maybe_gc): Remove prototype, define as inline.
2383         * alloc.c: Remove old commented-out code.
2384         (consing_since_gc, gc_relative_threshold)
2385         (memory_full_cons_threshold): Revert to global.
2386         (maybe_gc): Remove.
2388 2012-07-20  Dmitry Antipov  <dmantipov@yandex.ru>
2390         Simple wrapper for make_unibyte_string, adjust font_open_by_name.
2391         * lisp.h (build_unibyte_string): New function.
2392         * dosfns.c, fileio.c, fns.c, ftfont.c, process.c:
2393         * sysdep.c, w32fns.c, xfns.c: Use it.
2394         * font.c (font_open_by_name): Change 2nd and 3rd args to the only arg
2395         of type Lisp_Object to avoid redundant calls to make_unibyte_string.
2396         Adjust users accordingly.
2397         * font.h (font_open_by_name): Adjust prototype.
2399 2012-07-20  Dmitry Antipov  <dmantipov@yandex.ru>
2401         Cleanup calls to Fgarbage_collect.
2402         * lisp.h (maybe_gc): New prototype.
2403         (consing_since_gc, gc_relative_threshold, memory_full_cons_threshold):
2404         Remove declarations.
2405         * alloc.c (maybe_gc): New function.
2406         (consing_since_gc, gc_relative_threshold, memory_full_cons_threshold):
2407         Make them static.
2408         * bytecode.c (MAYBE_GC): Use maybe_gc.
2409         * eval.c (eval_sub, Ffuncall): Likewise.
2410         * keyboard.c (read_char): Likewise.  Adjust call to maybe_gc
2411         to avoid dependency from auto-save feature.
2413 2012-07-19  Paul Eggert  <eggert@cs.ucla.edu>
2415         * buffer.h (FOR_EACH_BUFFER): Rename from 'for_each_buffer'.
2416         (FOR_EACH_PER_BUFFER_OBJECT_AT): Rename from
2417         'for_each_per_buffer_object_at'.
2418         All uses changed.  It's better to use upper-case for macros that
2419         cannot be implemented as functions, to give the reader a clue
2420         that they're special.
2422 2012-07-19  Stefan Monnier  <monnier@iro.umontreal.ca>
2424         * alloc.c (Fgarbage_collect): Tweak docstring.
2426 2012-07-19  Dmitry Antipov  <dmantipov@yandex.ru>
2428         Tweak the value returned from Fgarbage_collect again.
2429         * alloc.c (Fgarbage_collect): New return value, as confirmed in
2430         http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00418.html.
2431         Adjust documentation.
2432         (total_vector_bytes): Rename to total_vector_slots, adjust
2433         accounting.
2434         (total_free_vector_bytes): Rename to total_free_vector_slots,
2435         adjust accounting.
2436         (Qstring_bytes, Qvector_slots): New symbols.
2437         (syms_of_alloc): DEFSYM them.
2439 2012-07-19  Dmitry Antipov  <dmantipov@yandex.ru>
2441         Buffer compaction primitive which may be used from Lisp.
2442         * buffer.c (compact_buffer, Fcompact_buffer): New function.
2443         (syms_of_buffer): Register Fcompact_buffer.
2444         * alloc.c (Fgarbage_collect): Use compact_buffer.
2445         * buffer.h (compact_buffer): New prototype.
2446         (struct buffer_text): New member.
2448 2012-07-19  Dmitry Antipov  <dmantipov@yandex.ru>
2450         New macro to iterate over all buffers, miscellaneous cleanups.
2451         * lisp.h (all_buffers): Remove declaration.
2452         * buffer.h (all_buffers): Add declaration, with comment.
2453         (for_each_buffer): New macro.
2454         * alloc.c (Fgarbage_collect, mark_object): Use it.
2455         * buffer.c (Fkill_buffer, Fbuffer_swap_text, Fset_buffer_multibyte)
2456         (init_buffer): Likewise.
2457         * data.c (Fset_default): Likewise.
2458         * coding.c (code_conversion_restore): Remove redundant check
2459         for dead buffer.
2460         * buffer.c (Fkill_buffer): Likewise.  Remove obsolete comment.
2462 2012-07-18  Andreas Schwab  <schwab@linux-m68k.org>
2464         Fix bug that created negative-length intervals.
2465         * intervals.c (merge_interval_right, merge_interval_left):
2466         Do not zero out this interval if it is absorbed by its children,
2467         as this interval's total length doesn't change in that case.  See
2468         <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00403.html>.
2470 2012-07-18  Paul Eggert  <eggert@cs.ucla.edu>
2472         * alloc.c (Fmake_bool_vector): Fix off-by-8 bug
2473         when invoking (make-bool-vector N t) and N is a positive
2474         multiple of 8 -- the last 8 bits were mistakenly cleared.
2476         Remove some struct layout assumptions in bool vectors.
2477         * alloc.c (bool_header_size): New constant.
2478         (header_size, word_size): Move earlier, as they're now used earlier.
2479         Use 'word_size' in a few more places, where it's appropriate.
2480         (Fmake_bool_vector, sweep_vectors): Don't assume that there is no
2481         padding before the data member of a bool vector.
2482         (sweep_vectors): Use PSEUDOVECTOR_TYPEP, in an eassert, rather
2483         than doing the check by hand with an abort ().
2485 2012-07-18  Stefan Monnier  <monnier@iro.umontreal.ca>
2487         * eval.c (Fdefvar): Don't check constants since we only set the var if
2488         it's not yet defined anyway (bug#11904).
2490         * lisp.h (last_undo_boundary): Declare new var.
2491         * keyboard.c (command_loop_1): Set it.
2492         * cmds.c (Fself_insert_command): Use it to only remove boundaries that
2493         were auto-added by the command loop (bug#11774).
2495 2012-07-18  Andreas Schwab  <schwab@linux-m68k.org>
2497         * w32font.c (Qsymbol): Remove local definition.
2498         (syms_of_w32font): Don't DEFSYM it.
2500 2012-07-18  Dmitry Antipov  <dmantipov@yandex.ru>
2502         Fix sweep_vectors to handle large bool vectors correctly.
2503         * alloc.c (sweep_vectors): Account total_vector_bytes for
2504         bool vectors larger than VBLOCK_BYTES_MAX.
2506 2012-07-18  Chong Yidong  <cyd@gnu.org>
2508         * frame.c (x_set_frame_parameters): Revert bogus change introduced
2509         in 2012-05-25 commit by Paul Eggert (Bug#11738).
2511 2012-07-18  Dmitry Antipov  <dmantipov@yandex.ru>
2513         Return more descriptive data from Fgarbage_collect.
2514         Suggested by Stefan Monnier in
2515         http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00369.html.
2516         * alloc.c (bounded_number): New function.
2517         (total_buffers, total_vectors): New variable.
2518         (total_string_size): Rename to total_string_bytes, adjust users.
2519         (total_vector_size): Rename to total_vector_bytes, adjust users.
2520         (sweep_vectors): Account total_vectors and total_vector_bytes.
2521         (Fgarbage_collect): New return value.  Adjust documentation.
2522         (gc_sweep): Account total_buffers.
2523         (Fmemory_free, Fmemory_use_counts): Use bounded_number.
2524         (VECTOR_SIZE): Remove.
2525         * data.c (Qfloat, Qvector, Qsymbol, Qstring, Qcons): Make global.
2526         (Qinterval, Qmisc): New symbols.
2527         (syms_of_data): Initialize them.
2528         * lisp.h (Qinterval, Qsymbol, Qstring, Qmisc, Qvector, Qfloat)
2529         (Qcons, Qbuffer): New declarations.
2531 2012-07-17  Paul Eggert  <eggert@cs.ucla.edu>
2533         * alloc.c (Fmemory_free): Account for memory-free's own storage.
2534         Round up, not down.  Improve doc.
2536 2012-07-17  Dmitry Antipov  <dmantipov@yandex.ru>
2538         Restore old code in allocate_string_data to avoid Faset breakage.
2539         Reported by Julien Danjou <julien@danjou.info> in
2540         http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00371.html.
2541         * alloc.c (allocate_string_data): Restore old code with minor
2542         adjustments, fix comment to explain this subtle issue.
2544 2012-07-17  Eli Zaretskii  <eliz@gnu.org>
2546         Remove FILE_SYSTEM_CASE.
2547         * s/msdos.h (FILE_SYSTEM_CASE): Don't define.
2549         * fileio.c (FILE_SYSTEM_CASE): Don't define.
2550         (Ffile_name_directory, Fexpand_file_name): Don't use FILE_SYSTEM_CASE.
2551         Fixes problems on MS-DOS with Vtemp_file_name_pattern when
2552         call-process-region passes it through expand-file-name.
2554         * dired.c (file_name_completion): Don't use FILE_SYSTEM_CASE.
2556 2012-07-17  Andreas Schwab  <schwab@linux-m68k.org>
2558         Fix crash when creating indirect buffer (Bug#11917)
2559         * buffer.c (buffer_lisp_local_variables): Add argument CLONE.
2560         Don't handle unbound variables specially if non-zero.
2561         (Fbuffer_local_variables): Pass zero.
2562         (clone_per_buffer_values): Pass non-zero.
2564 2012-07-17  Andreas Schwab  <schwab@linux-m68k.org>
2566         * gnutls.c (emacs_gnutls_handshake): Revert last change.  Add QUIT
2567         to make the loop interruptible.
2569 2012-07-17  Andreas Schwab  <schwab@linux-m68k.org>
2571         * gnutls.c (emacs_gnutls_handshake): Only retry if
2572         GNUTLS_E_INTERRUPTED.
2574 2012-07-17  Dmitry Antipov  <dmantipov@yandex.ru>
2576         Cleanup and convert miscellaneous checks to eassert.
2577         * alloc.c (mark_interval): Fix comment, partially rephrase
2578         old comment from intervals.h (see below).
2579         * intervals.c (find_interval, adjust_intervals_for_insertion)
2580         (delete_interval, adjust_intervals_for_deletion)
2581         (graft_intervals_into_buffer, temp_set_point_both, copy_intervals):
2582         Convert to eassert.
2583         (adjust_intervals_for_insertion, make_new_interval):
2584         Remove obsolete and unused code.
2585         * intervals.h (struct interval): Remove obsolete comment.
2586         * textprotp.c (erase_properties): Remove unused code.
2587         (Fadd_text_properties, set_text_properties_1, Fremove_text_properties)
2588         (Fremove_list_of_text_properties): Convert to eassert.
2590 2012-07-17  Chong Yidong  <cyd@gnu.org>
2592         * editfns.c (Finsert_char): Doc fix.
2594 2012-07-17  Dmitry Antipov  <dmantipov@yandex.ru>
2596         Fix previous change to make Fmemory_free always accurate.
2597         * alloc.c (make_interval): Update total_free_intervals.
2598         (make_float): Likewise for total_free_floats.
2599         (free_cons, Fcons): Likewise for total_free_conses.
2600         (SETUP_ON_FREE_LIST, allocate_vector_from_block):
2601         Likewise for total_free_vector_bytes.
2602         (Fmake_symbol): Likewise for total_free_symbols.
2603         (bytes_free): Remove.
2605 2012-07-17  Dmitry Antipov  <dmantipov@yandex.ru>
2607         Simple free memory accounting feature.
2608         * alloc.c (bytes_free, total_free_vector_bytes): New variable.
2609         (sweep_vectors): Accumulate size of free vectors.
2610         (Fgarbage_collect): Setup bytes_free.
2611         (Fmemory_free): New function.
2612         (syms_of_alloc): Register it.
2614 2012-07-17  Dmitry Antipov  <dmantipov@yandex.ru>
2616         Cleanup overlays checking.
2617         * buffer.h (OVERLAY_VALID): Remove as useless synonym of OVERLAYP.
2618         * buffer.c (overlay_touches_p, recenter_overlay_lists): Change to
2619         eassert and OVERLAYP.
2620         (sort_overlays): Change to use OVERLAYP.
2622 2012-07-16  René Kyllingstad  <Rene@Kyllingstad.com>  (tiny change)
2624         * editfns.c (Finsert_char): Make it interactive, and make the
2625         second arg optional.  Copy interactive spec and docstring from
2626         ucs-insert.
2628 2012-07-17  Paul Eggert  <eggert@cs.ucla.edu>
2630         * floatfns.c (Fabs): Do not wrap fabs inside IN_FLOAT (Bug#11913).
2631         Unlike the other wrapped functions, fabs has an unspecified
2632         effect on errno.
2634 2012-07-16  Jan Djärv  <jan.h.d@swipnet.se>
2636         * nsterm.m (keyDown): Interpret flags without left/right bits
2637         as the left key (Bug#11670).
2639 2012-07-16  Dmitry Antipov  <dmantipov@yandex.ru>
2641         Remove empty and useless init functions.
2642         * lisp.h (init_character_once, init_fns, init_image)
2643         (init_filelock, init_sound): Remove prototype.
2644         * character.c (init_character_once): Remove.
2645         * filelock.c (init_filelock): Likewise.
2646         * fns.c (init_fns): Likewise.
2647         * image.c (init_image): Likewise.
2648         * sound.c (init_sound): Likewise.
2649         * emacs.c (main): Adjust accordingly.
2651 2012-07-16  Dmitry Antipov  <dmantipov@yandex.ru>
2653         * gtkutil.h: Tiny cleanups.
2654         (use_old_gtk_file_dialog): Remove useless declaration.
2655         (xg_uses_old_file_dialog): Add suggested const attribute.
2657 2012-07-15  Eli Zaretskii  <eliz@gnu.org>
2659         * bidi.c (MAX_STRONG_CHAR_SEARCH): New macro.
2660         (bidi_paragraph_init): Use it to limit search forward for a strong
2661         directional character in abnormally large paragraphs full of
2662         neutral or weak characters.  (Bug#11943)
2664 2012-07-15  Stefano Facchini  <stefano.facchini@gmail.com>  (tiny change)
2666         * gtkutil.c (xg_create_tool_bar): Apply "primary-toolbar" style to
2667         the toolbar (Bug#9451).
2668         (xg_make_tool_item): Give the widget event box a transparent
2669         background.
2671 2012-07-15  Dmitry Antipov  <dmantipov@yandex.ru>
2673         Cleanup basic allocation variables and functions.
2674         * alloc.c (ignore_warnings, init_intervals, init_float)
2675         (init_cons, init_symbol, init_marker): Remove.
2676         (interval_block_index): Initialize to INTERVAL_BLOCK_SIZE.
2677         (float_block_index): Initialize to FLOAT_BLOCK_SIZE.
2678         (cons_block_index): Initialize to CONS_BLOCK_SIZE.
2679         (symbol_block_size): Initialize to SYMBOL_BLOCK_SIZE.
2680         (marker_block_index): Initialize to MARKER_BLOCK_SIZE.
2681         (staticidx, init_alloc_once, init_strings, free_ablock):
2682         Remove redundant initialization.
2683         * fns.c (init_weak_hash_tables): Remove.
2684         * lisp.h (init_weak_hash_tables): Remove prototype.
2686 2012-07-15  Dmitry Antipov  <dmantipov@yandex.ru>
2688         Use zero_vector where appropriate.
2689         * alloc.c (zero_vector): Define as Lisp_Object.  Adjust users
2690         accordingly.
2691         * lisp.h (zero_vector): New declaration.
2692         * font.c (null_vector): Remove.
2693         (syms_of_font): Remove initialization and staticpro.
2694         (font_list_entities, font_find_for_lface): Change to use zero_vector.
2695         * keymap.c (Faccessible_keymaps): Likewise.
2697 2012-07-15  Leo Liu  <sdl.web@gmail.com>
2699         * fringe.c: Fix typo in comments.
2701 2012-07-14  Leo Liu  <sdl.web@gmail.com>
2703         * fringe.c: Add a new bitmap exclamation-mark.
2705 2012-07-14  Eli Zaretskii  <eliz@gnu.org>
2707         * gmalloc.c (GMALLOC_INHIBIT_VALLOC): Don't reference.
2709         * s/msdos.h (BSD_SYSTEM, DATA_START, GC_SETJMP_WORKS, HAVE_MOUSE)
2710         (HAVE_MENUS): Don't define, defined by editing config.in with
2711         msdos/sed2v2.inp.
2712         (GMALLOC_INHIBIT_VALLOC): Don't define.
2713         (MODE_LINE_BINARY_TEXT): Remove, not used anymore.
2715 2012-07-14  Juanma Barranquero  <lekktu@gmail.com>
2717         * s/ms-w32.h (GC_SETJMP_WORKS, GC_MARK_STACK): Set in nt/config.nt.
2719 2012-07-14  Glenn Morris  <rgm@gnu.org>
2721         * s/aix4-2.h, s/freebsd.h, s/gnu-linux.h, s/hpux10-20.h:
2722         * s/irix6-5.h, s/netbsd.h, s/sol2-6.h, s/unixware.h:
2723         Let configure set GC_SETJMP_WORKS, GC_MARK_STACK.
2725 2012-07-13  Glenn Morris  <rgm@gnu.org>
2727         * s/gnu-linux.h (GC_MARK_SECONDARY_STACK): Let configure set it.
2729         * s/usg5-4-common.h (SETUP_SLAVE_PTY): Let configure set it.
2730         * s/irix6-5.h (SETUP_SLAVE_PTY): No more need to unset it.
2732 2012-07-13  Jan Djärv  <jan.h.d@swipnet.se>
2734         * nsterm.m (uRect): Only define if NS_IMPL_GNUSTEP.
2735         (x_free_frame_resources): Pass x_free_frame_resources to NSTRACE.
2736         (ns_lisp_to_color, ns_string_to_lispmod, ns_term_init)
2737         (ns_term_shutdown, requestService, initFrameFromEmacs): Use SSDATA
2738         where appropriate.
2739         (ns_exec_path, ns_load_path, changeFont): Put () around assignment used
2740         as boolean expression.
2741         (x_set_window_size): Remove unused variable toolbar.
2742         (ns_get_color_default, ns_mod_to_lisp): Remove.
2743         (ns_mouse_position): Remove unused variables xchar and ychar.
2744         (ns_compute_glyph_string_overhangs): Remove unused variable face.
2745         (ns_set_vertical_scroll_bar): Remove unused variable count.
2746         (ns_delete_terminal): Remove unused variable i.
2747         (ns_term_init): Remove unused variables r, g and b.
2748         (mouseDown): Remove unused variable window.
2749         (windowDidResize): Move definition of theWindow inside NS_IMPL_GNUSTEP.
2750         (initFrameFromEmacs): Remove unused variable vbextra.
2751         (mouseEntered): Remove unused variables p and dpyinfo.
2752         (mouseExited): Remove unused variables p and r.
2753         (ns_define_frame_cursor, ns_clear_frame_area)
2754         (ns_draw_window_cursor, ns_initialize_display_info): Make static.
2755         (menuDown): Assign [sender tag] to variable and cast the variable.
2757         * nsterm.h (menuDown): Add id as type to argument sender.
2758         (ns_display_info_for_name): Add Lisp_Object argument.
2759         (ns_term_init): Add Lisp_Object argument.
2760         (ns_map_event_to_object): Add void argument.
2761         (ns_string_from_pasteboard, ns_string_to_pasteboard): Add correct
2762         prototype with arguments and only declare if __OBJC__.
2763         (nxatoms_of_nsselect): Add void argument.
2764         (ns_lisp_to_cursor_type): Add Lisp_Object argument.
2765         (ns_alloc_autorelease_pool): Add void argument.
2766         (ns_release_autorelease_pool): Add void* argument.
2767         (ns_get_defaults_value): Add const char* argument.
2769         * nsmenu.m (ns_update_menubar, ns_menu_show, process_dialog)
2770         (initFromContents): Use SSDATA where appropriate.
2771         (ns_update_menubar): Add braces to ambigous if-else.
2772         (initWithTitle): Put () around assignment in if statement.
2773         (ns_menu_show): Remove unused variables window and keymap.
2774         (update_frame_tool_bar): Remove unused variable selected_p.
2775         (initWithContentRect): Remove unused variable this_cmd_name.
2777         * nsimage.m (ns_load_image, allocInitFromFile): Use SSDATA where
2778         appropriate.
2779         (setXBMColor): Remove unused variable len.
2780         (setPixmapData): Put () around assignment in loop statement.
2782         * nsfont.m (ns_get_family, ns_lang_to_script, ns_otf_to_script)
2783         (ns_registry_to_script, ns_get_req_script, nsfont_open): Use SSDATA
2784         where appropriate.
2785         (ns_get_covering_families, ns_findfonts, nsfont_list_family): Put ()
2786         around assignment in loop statement.
2787         (nsfont_open): Remove unused variable i.
2788         (nsfont_open): Remove unused variable len.
2789         (nsfont_draw): Remove unused variable cs.
2791         * nsfns.m (x_set_icon_name, ns_set_name_internal)
2792         (ns_set_name_as_filename, ns_implicitly_set_icon_type)
2793         (x_set_icon_type, ns_lisp_to_cursor_type, Fns_read_file_name)
2794         (Fns_get_resource, Fns_set_resource, Fx_open_connection)
2795         (Fns_font_name, Fns_perform_service)
2796         (Fns_convert_utf8_nfd_to_nfc, ns_do_applescript)
2797         (Fns_do_applescript, Fx_show_tip): Use SSDATA where appropriate.
2798         (ns_set_name): Remove unused variable view.
2799         (x_set_menu_bar_lines): Remove unused variable olines.
2800         (x_set_tool_bar_lines): Remove unused variable root_window.
2801         (Fns_list_colors): Put () around assignment in while statement.
2802         (Fns_perform_service): Remove unused variable len.
2803         (Fns_display_usable_bounds): Remove unused variable top.
2804         (syms_of_nsfns): Remove unused variable i.
2806         * nsmenu.m (ns_update_menubar): Exchange place of argument 2 and 3 to
2807         memcpy (Bug#11907).
2809 2012-07-13  Kalle Kankare  <kalle.kankare@iki.fi>  (tiny change)
2811         * image.c (Fimagemagick_types): Initialize ex with GetExceptionInfo
2812         and free it with DestroyExceptionInfo (Bug#11558).
2814 2012-07-13  Juanma Barranquero  <lekktu@gmail.com>
2816         * s/ms-w32.h (FIRST_PTY_LETTER, HAVE_SOCKETS): Move to nt/config.nt.
2817         (HAVE_ATTRIBUTE_ALIGNED, HAVE_C99_STRTOLD, HAVE___BUILTIN_UNWIND_INIT):
2818         Set here, not in nt/config.nt.
2820 2012-07-13  Eli Zaretskii  <eliz@gnu.org>
2822         * xdisp.c (move_it_in_display_line_to): On GUI terminals, allow
2823         cursor overflow into the last glyph on display line when the right
2824         fringe is off.  (Bug#11832)
2826 2012-07-13  Paul Eggert  <eggert@cs.ucla.edu>
2828         * xdisp.c (produce_special_glyphs): Now static.
2829         * dispextern.h (produce_special_glyphs): Remove decl.
2831 2012-07-13  Glenn Morris  <rgm@gnu.org>
2833         * s/bsd-common.h, s/cygwin.h: Remove empty files.
2834         * s/freebsd.h, s/netbsd.h: Do not include bsd-common.h.
2836         * s/usg5-4-common.h (USG, USG5):
2837         * s/template.h (USG5, USG, HPUX, BSD4_2, BSD_SYSTEM):
2838         * s/sol2-6.h (SOLARIS2):
2839         * s/irix6-5.h (IRIX6_5):
2840         * s/hpux10-20.h (USG, USG5, HPUX):
2841         * s/gnu-linux.h (USG, GNU_LINUX):
2842         * s/freebsd.h (BSD_SYSTEM):
2843         * s/darwin.h (BSD4_2, BSD_SYSTEM, DARWIN_OS):
2844         * s/cygwin.h (CYGWIN):
2845         * s/bsd-common.h (BSD_SYSTEM, BSD4_2):
2846         * s/aix4-2.h (USG, USG5, _AIX): Move "system type" macros to configure.
2848 2012-07-13  BT Templeton  <bpt@hcoop.net>  (tiny change)
2850         * nsfont.m (ns_charset_covers): Don't abort if no bitmap (Bug#11853).
2852 2012-07-13  Glenn Morris  <rgm@gnu.org>
2854         * s/usg5-4-common.h (NSIG_MINIMUM): Let configure set it.
2856         * s/gnu-linux.h, s/irix6-5.h: Let configure set ULIMIT_BREAK_VALUE.
2858         * process.c (init_process_emacs): Replace MIN_PTY_KERNEL_VERSION.
2859         * s/darwin.h (MIN_PTY_KERNEL_VERSION): Remove single-use macro.
2861 2012-07-12  Glenn Morris  <rgm@gnu.org>
2863         * s/darwin.h (SYSTEM_PURESIZE_EXTRA): Move to configure.
2865         * process.c (init_process_emacs): Rename from init_process.
2866         The old name is also the name of a Mach system call.
2867         * lisp.h, emacs.c: Update for this name change.
2868         * nsgui.h, sysselect.h, s/darwin.h: Remove workaround that is no
2869         longer needed.
2871 2012-07-12  Eli Zaretskii  <eliz@gnu.org>
2873         * xdisp.c (insert_left_trunc_glyphs): Fix incorrect size in
2874         memmove call that removes glyphs covered by the left truncation
2875         glyph.  Improve commentary.
2876         (display_line): Fix display of continuation glyphs on GUI frames
2877         when the right fringe is turned off and variable-size fonts are
2878         used in the window.  Move the code that appends a stretch glyph to
2879         produce_special_glyphs, so that it could be used for truncation
2880         and continuation glyphs alike.
2881         (produce_special_glyphs) [HAVE_WINDOW_SYSTEM]: Produce a stretch
2882         glyph of a suitably computed width, to align the special glyphs at
2883         the window margin.  Code moved from display_line.  (Bug#11832)
2885 2012-07-12  Glenn Morris  <rgm@gnu.org>
2887         * s/aix4-2.h, s/hpux10-20.h: Let configure set NO_EDITRES.
2889         * s/gnu-linux.h, s/hpux10-20.h:
2890         Do not unconditionally define HAVE_XRMSETDATABASE.
2892         * s/gnu-linux.h (UNIX98_PTYS): Let configure set it.
2894 2012-07-12  Paul Eggert  <eggert@cs.ucla.edu>
2896         Fix typos that broke OS X build.
2897         Reported by Randal L. Schwartz in
2898         <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00225.html>.
2899         * nsterm.m (ns_timeout): Add missing local decl.
2900         (ns_get_color): snprintf -> sprintf, to fix typo.
2902 2012-07-12  Glenn Morris  <rgm@gnu.org>
2904         * src/s/aix4-2.h, src/s/cygwin.h, src/s/darwin.h:
2905         * src/s/gnu-linux.h, src/s/hpux10-20.h, src/s/irix6-5.h:
2906         * src/s/sol2-6.h, src/s/unixware.h, src/s/usg5-4-common.h:
2907         Move PTY_NAME_SPRINTF, PTY_TTY_NAME_SPRINTF to configure.
2909         * s/cygwin.h, s/darwin.h, s/gnu-linux.h, s/irix6-5.h:
2910         Move PTY_OPEN to configure.
2912         * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
2913         * s/gnu-linux.h, s/hpux10-20.h, s/irix6-5.h, s/template.h:
2914         * s/usg5-4-common.h: Move FIRST_PTY_LETTER, PTY_ITERATION to configure.
2916 2012-07-12  Dmitry Antipov  <dmantipov@yandex.ru>
2918         Use empty_unibyte_string where applicable.
2919         * keyboard.c (parse_tool_bar_item): Use empty_unibyte_string.
2920         * lread.c (read1): Likewise.
2921         * xsettings.c (syms_of_xsettings): Likewise.
2923 2012-07-12  Glenn Morris  <rgm@gnu.org>
2925         * s/cygwin.h (G_SLICE_ALWAYS_MALLOC):
2926         * s/freebsd.h (BROKEN_PTY_READ_AFTER_EAGAIN):
2927         * s/irix6-5.h (SETPGRP_RELEASES_CTTY, PREFER_VSUSP):
2928         * s/hpux10-20.h (RUN_TIME_REMAP):
2929         * s/bsd-common.h (TABDLY): Move to configure.
2931         * s/hpux10-20.h, s/sol2-6.h: Move XOS_NEEDS_TIME_H to configure.
2933         * s/bsd-common.h, s/darwin.h: Move TAB3 to configure.
2935         * s/aix4-2.h (BROKEN_FIONREAD, BROKEN_SIGAIO, BROKEN_SIGPTY)
2936         (BROKEN_SIGPOLL, BROKEN_GET_CURRENT_DIR_NAME): Let configure set them.
2938         * s/darwin.h (NO_ABORT, NO_MATHERR): Let configure set them.
2940         * s/bsd-common.h, s/cygwin.h, s/gnu-linux.h, s/irix6-5.h:
2941         * s/template.h: Move NARROWPROTO to configure.
2943 2012-07-11  Glenn Morris  <rgm@gnu.org>
2945         * s/gnu-linux.h, s/sol2-6.h: No longer define POSIX,
2946         unused since 2011-01-17 change to systty.h.
2948         * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h, s/gnu-linux.h:
2949         * s/hpux10-20.h, s/template.h, s/usg5-4-common.h:
2950         Move HAVE_PTYS and HAVE_SOCKETS to configure.
2952 2012-07-11  Paul Eggert  <eggert@cs.ucla.edu>
2954         * s/sol2-6.h (HAVE_LIBKSTAT): Remove.  (Bug#11914)
2956 2012-07-11  Glenn Morris  <rgm@gnu.org>
2958         * s/darwin.h, s/gnu-linux.h, s/template.h:
2959         Move INTERRUPT_INPUT to configure.
2961 2012-07-11  Dmitry Antipov  <dmantipov@yandex.ru>
2963         Minor adjustments to interning code.
2964         * lisp.h (intern, intern_c_string): Redefine as static inline
2965         wrappers for intern_1 and intern_c_string_1, respectively.
2966         (intern_1, intern_c_string_1): Rename prototypes.
2967         * lread.c (intern_1, intern_c_string_1, oblookup):
2968         Simplify Vobarray checking.
2969         * font.c (font_intern_prop): Likewise.  Adjust comment.
2970         * w32font.c (intern_font_name): Likewise.
2972 2012-07-11  Andreas Schwab  <schwab@linux-m68k.org>
2974         * gnutls.c (Fgnutls_boot): Properly parse :keylist argument.
2976         * coding.c (Fdefine_coding_system_internal): Use XCAR/XCDR instead
2977         of Fcar/Fcdr if possible.
2978         * font.c (check_otf_features): Likewise.
2979         * fontset.c (Fnew_fontset): Likewise.
2980         * gnutls.c (Fgnutls_boot): Likewise.
2981         * minibuf.c (read_minibuf): Likewise.
2982         * msdos.c (IT_set_frame_parameters): Likewise.
2983         * xmenu.c (Fx_popup_dialog): Likewise.
2984         * w32menu.c (Fx_popup_dialog): Likewise.
2986 2012-07-11  Glenn Morris  <rgm@gnu.org>
2988         * s/bsd-common.h, s/cygwin.h: No need to undefine INTERRUPT_INPUT,
2989         since nothing has defined it on these platforms.
2991         * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/gnu-linux.h:
2992         * s/irix6-5.h: Move SIGNALS_VIA_CHARACTERS to configure.
2994         * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
2995         * s/gnu-linux.h, s/hpux10-20.h, s/template.h, s/usg5-4-common.h:
2996         Move CLASH_DETECTION to configure.
2998         * s/gnu.h: Remove file, which is now empty.
3000         * s/gnu.h, s/gnu-linux.h:
3001         Move GNU_LIBRARY_PENDING_OUTPUT_COUNT to configure.
3003 2012-07-11  John Wiegley  <johnw@newartisans.com>
3005         * alloc.c (mark_memory): Guard the "no_address_safety_analysis"
3006         function attribute, so we only use it if it exists in the
3007         compiler.
3009 2012-07-11  Dmitry Antipov  <dmantipov@yandex.ru>
3011         Avoid call to strlen in fast_c_string_match_ignore_case.
3012         * search.c (fast_c_string_match_ignore_case): Change to use
3013         length argument.  Adjust users accordingly.
3014         * lisp.h (fast_c_string_match_ignore_case): Adjust prototype.
3016 2012-07-11  Paul Eggert  <eggert@cs.ucla.edu>
3018         Assume mkdir, rmdir.
3019         * sysdep.c (mkdir) [!HAVE_MKDIR]: Remove.
3020         * sysdep.c (rmdir) [!HAVE_RMDIR]: Remove.
3022         Assume rename.
3023         * sysdep.c (rename) [!HAVE_RENAME]: Remove.
3025         Assume perror.
3026         * s/hpux10-20.h (HAVE_PERROR): Remove.
3027         * sysdep.c (perror) [HPUX && !HAVE_PERROR]:
3028         Remove dummy definition, as this problem was obsolete long ago.
3030         Assume strerror.
3031         * sysdep.c (strerror) [!HAVE_STRERROR && !WINDOWSNT]: Remove.
3033 2012-07-11  Dmitry Antipov  <dmantipov@yandex.ru>
3035         Avoid calls to strlen in font processing functions.
3036         * font.c (font_parse_name, font_parse_xlfd, font_parse_fcname)
3037         (font_open_by_name): Change to use length argument.
3038         Adjust users accordingly.
3039         * font.h (font_open_by_name, font_parse_xlfd, font_unparse_xlfd):
3040         Adjust prototypes.
3041         * xfont.c (xfont_decode_coding_xlfd, font_unparse_xlfd):
3042         Change to return ptrdiff_t.
3043         (xfont_list_pattern, xfont_match): Use length returned by
3044         xfont_decode_coding_xlfd.
3045         * xfns.c (x_default_font_parameter): Omit useless xstrdup.
3047 2012-07-11  Glenn Morris  <rgm@gnu.org>
3049         * s/darwin.h, s/freebsd.h, s/netbsd.h:
3050         Move DONT_REOPEN_PTY to configure.
3052         * sound.c (DEFAULT_SOUND_DEVICE) [!WINDOWSNT]:
3053         * s/netbsd.h (DEFAULT_SOUND_DEVICE): Let configure set it.
3055 2012-07-10  Paul Eggert  <eggert@cs.ucla.edu>
3057         Remove "#define unix" that is no longer needed (Bug#11905).
3058         * s/aix4-2.h (unix): Remove; no longer needed.
3060         EMACS_TIME simplification (Bug#11875).
3061         This replaces macros (which typically do not work in GDB)
3062         with functions, typedefs and enums, making the code easier to debug.
3063         The functional style also makes code easier to read and maintain.
3064         * systime.h: Include <sys/time.h> on all hosts, not just if
3065         WINDOWSNT, since 'struct timeval' is needed in general.
3066         (EMACS_TIME): Now a typedef, not a macro.
3067         (EMACS_TIME_RESOLUTION, LOG10_EMACS_TIME_RESOLUTION): Now constants,
3068         not macros.
3069         (EMACS_SECS, EMACS_NSECS, EMACS_TIME_SIGN, EMACS_TIME_VALID_P)
3070         (EMACS_TIME_FROM_DOUBLE, EMACS_TIME_TO_DOUBLE, EMACS_TIME_EQ)
3071         (EMACS_TIME_NE, EMACS_TIME_GT, EMACS_TIME_GE, EMACS_TIME_LT)
3072         (EMACS_TIME_LE): Now functions, not macros.
3073         (EMACS_SET_SECS, EMACS_SET_NSECS, EMACS_SET_SECS_NSECS)
3074         (EMACS_SET_USECS, EMACS_SET_SECS_USECS): Remove these macros,
3075         which are not functions.  All uses rewritten to use:
3076         (make_emacs_time): New function.
3077         (EMACS_SECS_ADDR, EMACS_SET_INVALID_TIME, EMACS_GET_TIME)
3078         (EMACS_ADD_TIME, EMACS_SUB_TIME): Remove these macros, which are
3079         not functions.  All uses rewritten to use the following, respectively:
3080         (emacs_secs_addr, invalid_emacs_time, get_emacs_time)
3081         (add_emacs_time, sub_emacs_time): New functions.
3082         * atimer.c: Don't include <sys/time.h>, as "systime.h" does this.
3083         * fileio.c (Fcopy_file):
3084         * xterm.c (XTflash): Get the current time closer to when it's used.
3085         * makefile.w32-in ($(BLD)/atimer.$(O)): Update dependencies.
3087         * bytecode.c (targets): Suppress -Woverride-init warnings.
3089         Simplify by avoiding confusing use of strncpy etc.
3090         * doc.c (Fsnarf_documentation):
3091         * fileio.c (Ffile_name_directory, Fsubstitute_in_file_name):
3092         * frame.c (Fmake_terminal_frame):
3093         * gtkutil.c (get_utf8_string):
3094         * lread.c (openp):
3095         * nsmenu.m (ns_update_menubar):
3096         * regex.c (regerror):
3097         Prefer memcpy to strncpy and strncat when either will do.
3098         * fileio.c (Fsubstitute_in_file_name):
3099         * keyboard.c (MULTI_LETTER_MOD, parse_modifiers_uncached)
3100         (menu_separator_name_p):
3101         * nsmenu.m (ns_update_menubar):
3102         Prefer memcmp to strncmp when either will do.
3103         * nsterm.m: Include <ftoastr.h>.
3104         (ns_get_color):
3105         * s/gnu-linux.h, s/sol2-6.h, s/unixware.h (PTY_TTY_NAME_SPRINTF):
3106         Prefer snprintf to strncpy.
3107         * nsterm.m (ns_term_init):
3108         * widget.c (set_frame_size) [0]: Prefer xstrdup to xmalloc + strncpy.
3109         * nsterm.m (ns_term_init):
3110         Avoid the need for strncpy, by using build_string or
3111         make_unibyte_string directly.  Use dtoastr, not snprintf.
3112         * process.c (Fmake_network_process): Diagnose service names that
3113         are too long, rather than silently truncating them or creating
3114         non-null-terminated names.
3115         (Fnetwork_interface_info): Likewise, for interface names.
3116         * sysdep.c (system_process_attributes) [GNU_LINUX]:
3117         Prefer sprintf to strncat.
3118         * xdisp.c (debug_method_add) [GLYPH_DEBUG]:
3119         Prefer vsnprintf to vsprintf + strncpy.
3121 2012-07-10  Glenn Morris  <rgm@gnu.org>
3123         * dispnew.c (PENDING_OUTPUT_COUNT) [!__GNU_LIBRARY__]:
3124         Clarify fallback case.
3126 2012-07-10  Dmitry Antipov  <dmantipov@yandex.ru>
3128         Use XCAR and XCDR instead of Fcar and Fcdr where possible.
3129         * callint.c, coding.c, doc.c, editfns.c, eval.c, font.c, fontset.c,
3130         * frame.c, gnutls.c, minibuf.c, msdos.c, textprop.c, w32fns.c,
3131         * w32menu.c, window.c, xmenu.c: Change to use XCAR and XCDR
3132         where argument type is known to be a Lisp_Cons.
3134 2012-07-10  Tom Tromey  <tromey@redhat.com>
3136         * bytecode.c (BYTE_CODE_THREADED): New macro.
3137         (BYTE_CODES): New macro.  Replaces all old byte-code defines.
3138         (enum byte_code_op): New type.
3139         (CASE, NEXT, FIRST, CASE_DEFAULT, CASE_ABORT): New macros.
3140         (exec_byte_code): Use them.  Use token threading when applicable.
3142 2012-07-10  Dmitry Antipov  <dmantipov@yandex.ru>
3144         Optimize pure C strings initialization.
3145         * lisp.h (make_pure_string): Fix prototype.
3146         (build_pure_c_string): New function, defined as static inline.  This
3147         provides a better opportunity to optimize away calls to strlen when
3148         the function is called with compile-time constant argument.
3149         * alloc.c (make_pure_c_string): Fix comment.  Change to add nchars
3150         argument, adjust users accordingly.  Use build_pure_c_string where
3151         appropriate.
3152         * buffer.c, coding.c, data.c, dbusbind.c, fileio.c, fontset.c, frame.c,
3153         * keyboard.c, keymap.c, lread.c, search.c, syntax.c, w32fns.c, xdisp.c,
3154         * xfaces.c, xfns.c, xterm.c: Use build_pure_c_string where appropriate.
3156 2012-07-10  Dmitry Antipov  <dmantipov@yandex.ru>
3158         Avoid calls to strlen in miscellaneous functions.
3159         * buffer.c (init_buffer): Use precalculated len, adjust if needed.
3160         * font.c (Ffont_xlfd_name): Likewise.  Change to call make_string.
3161         * lread.c (openp): Likewise.
3163 2012-07-10  Dmitry Antipov  <dmantipov@yandex.ru>
3165         Avoid calls to strlen in path processing functions.
3166         * fileio.c (file_name_as_directory): Add comment.  Change to add
3167         srclen argument and return the length of result.  Adjust users
3168         accordingly.
3169         (directory_file_name): Fix comment.  Change to add srclen argument,
3170         swap 1st and 2nd arguments to obey the common convention.
3171         Adjust users accordingly.
3172         * filelock.c (fill_in_lock_file_name): Avoid calls to strlen.
3174 2012-07-10  Glenn Morris  <rgm@gnu.org>
3176         * s/cygwin.h, s/darwin.h, s/freebsd.h, s/netbsd.h, s/unixware.h:
3177         Move PENDING_OUTPUT_COUNT definition to configure.
3179         * s/irix6-5.h (DATA_START, DATA_SEG_BITS):
3180         * s/hpux10-20.h (DATA_SEG_BITS, DATA_START):
3181         * s/gnu.h (DATA_START): Move definitions to configure.
3183         * s/irix6-5.h (SETUP_SLAVE_PTY, PTY_NAME_SPRINTF): Drop ifdef guards.
3184         We include usg5-4-common.h, which defines them both.
3186         * s/gnu.h: Don't include fcntl.h (every file in Emacs that uses
3187         O_RDONLY already includes it).
3189         Stop ns builds setting the EMACSLOADPATH environment variable.
3190         * nsterm.m (ns_load_path): Rename from ns_init_paths.
3191         Now it does not set EMACSLOADPATH, just returns the load-path string.
3192         * nsterm.h: Update accordingly.
3193         * lread.c [HAVE_NS]: Include nsterm.h.
3194         (init_lread) [HAVE_NS]: Use ns_load_path.
3195         * emacs.c (main) [HAVE_NS]: No longer call ns_init_paths.
3197 2012-07-09  Glenn Morris  <rgm@gnu.org>
3199         * s/gnu.h (SIGNALS_VIA_CHARACTERS): No need to define it here,
3200         since the included bsd-common.h does so.
3202         Stop ns builds setting the EMACSPATH environment variable.
3203         * nsterm.m (ns_exec_path): New function, split from ns_init_paths.
3204         (ns_init_paths): Do not set EMACSPATH.
3205         * nsterm.h (ns_exec_path): Add it.
3206         * callproc.c (init_callproc_1, init_callproc) [HAVE_NS]:
3207         Use ns_exec_path.
3209         * nsterm.m, nsterm.h (ns_etc_directory): Fix type, empty return.
3211 2012-07-09  Paul Eggert  <eggert@cs.ucla.edu>
3213         * process.c (wait_reading_process_output): 'waitchannels' was unset
3214         when read_kbd || !NILP (wait_for_cell); fix this.
3216         Add GCC-style 'const' attribute to functions that can use it.
3217         * character.h (char_resolve_modifier_mask):
3218         * keyboard.h (make_ctrl_char):
3219         * lisp.h (multibyte_char_to_unibyte, multibyte_char_to_unibyte_safe)
3220         (init_character_once, next_almost_prime, init_fns, init_image)
3221         (flush_pending_output, init_sound):
3222         * mem-limits.h (start_of_data):
3223         * menu.h (finish_menu_items):
3224         Add ATTRIBUTE_CONST.
3225         * emacs.c (DEFINE_DUMMY_FUNCTION):
3226         Declare the dummy function with ATTRIBUTE_CONST.
3227         * lisp.h (Fbyteorder, Fmax_char, Fidentity):
3228         Add decls with ATTRIBUTE_CONST.
3230         Minor improvements to make_formatted_string.
3231         * alloc.c (make_formatted_string): Prefer int to ptrdiff_t
3232         where int is good enough, as vsprintf returns an int.
3233         * lisp.h (make_formatted_string): Add ATTRIBUTE_FORMAT_PRINTF.
3235 2012-07-09  Dmitry Antipov  <dmantipov@yandex.ru>
3237         Use make_formatted_string to avoid double length calculation.
3238         * lisp.h (make_formatted_string): New prototype.
3239         * alloc.c (make_formatted_string): New function.
3240         * buffer.c (Fgenerate_new_buffer_name): Use it.
3241         * dbus.c (syms_of_dbusbind): Likewise.
3242         * editfns.c (Fcurrent_time_zone): Likewise.
3243         * filelock.c (get_boot_time): Likewise.
3244         * frame.c (make_terminal_frame, set_term_frame_name)
3245         (x_report_frame_params): Likewise.
3246         * image.c (gs_load): Likewise.
3247         * minibuf.c (get_minibuffer): Likewise.
3248         * msdos.c (dos_set_window_size): Likewise.
3249         * process.c (make_process): Likewise.
3250         * xdisp.c (ensure_echo_area_buffers): Likewise.
3251         * xsettings.c (apply_xft_settings): Likewise.
3253 2012-07-09  Glenn Morris  <rgm@gnu.org>
3255         Stop ns builds polluting the environment with EMACSDATA, EMACSDOC.
3256         * nsterm.m (ns_etc_directory): New function, split from ns_init_paths.
3257         (ns_init_paths): Do not set EMACSDATA, EMACSDOC.
3258         * nsterm.h (ns_etc_directory): Add it.
3259         * callproc.c [HAVE_NS]: Include nsterm.h.
3260         (init_callproc_1, init_callproc) [HAVE_NS]: Use ns_etc_directory.
3262 2012-07-09  Dmitry Antipov  <dmantipov@yandex.ru>
3264         Move marker debugging code under MARKER_DEBUG.
3265         * marker.c (MARKER_DEBUG): Move marker debugging code under
3266         #ifdef MARKER_DEBUG because byte_char_debug_check is too slow
3267         for bootstrap with --enable-checking (~3x slowdown reported
3268         by Juanma Barranquero <lekktu@gmail.com>).
3269         (verify_bytepos): Move under #ifdef MARKER_DEBUG.
3271 2012-07-08  Paul Eggert  <eggert@cs.ucla.edu>
3273         * systime.h (EMACS_SUB_TIME): Clarify behavior with unsigned time_t.
3274         See <http://bugs.gnu.org/11825#29>.
3276 2012-07-08  Eli Zaretskii  <eliz@gnu.org>
3278         * xdisp.c (fill_glyphless_glyph_string): If the face of the glyph
3279         has no font, use the frame's font.  (Bug#11813)
3280         (display_line): Add commentary about displaying truncation glyphs
3281         on GUI frames.
3282         (produce_special_glyphs): Move here from term.c.
3284         * term.c (produce_special_glyphs): Move to xdisp.c.
3286         * dispextern.h (produce_special_glyphs): Move prototype to xdisp.c
3287         section.
3289 2012-07-07  Andreas Schwab  <schwab@linux-m68k.org>
3291         * xdisp.c (display_line): Avoid warning about implicit declaration
3292         of FRAME_FONT.
3294         * frame.c (get_frame_param): Define only if HAVE_WINDOW_SYSTEM.
3296         * lisp.h: Remove empty conditional.
3298 2012-07-07  Paul Eggert  <eggert@cs.ucla.edu>
3300         * lread.c (load_path_check): Now static.
3302         Fix some minor --with-ns problems found by static checking.
3303         * frame.c (Ftool_bar_pixel_width) [!FRAME_TOOLBAR_WIDTH]:
3304         (x_set_font) [!HAVE_X_WINDOWS]:
3305         * image.c (xpm_load_image) [HAVE_NS]:
3306         (x_to_xcolors) [!HAVE_X_WINDOWS && !HAVE_NTGUI]:
3307         (x_disable_image) [!HAVE_NS && !HAVE_NTGUI]:
3308         Remove unused local.
3309         (Fx_parse_geometry) [HAVE_NS]: Don't return garbage.
3310         (xpm_load_image) [HAVE_NS && !HAVE_XPM]: Remove unused label.
3311         * image.c (x_create_bitmap_from_file) [HAVE_NS]:
3312         (xpm_load_image, xpm_load) [HAVE_NS && !HAVE_XPM]:
3313         * nsselect.m (symbol_to_nsstring, ns_string_to_pasteboard_internal):
3314         * xfaces.c (Fx_load_color_file) [!HAVE_X_WINDOWS]:
3315         Fix pointer signedness problem.
3316         * xfaces.c (FRAME_X_FONT_TABLE):
3317         * xterm.h (FRAME_X_FONT_TABLE): Remove unused, incompatible macros.
3319 2012-07-07  Glenn Morris  <rgm@gnu.org>
3321         * lread.c (load_path_check): New function, split from init_lread.
3322         (init_lread): Reorganize.  Motivation:
3323         If EMACSLOADPATH is set, check/warn about that rather than the
3324         defaults, which we are not going to use.  Hence we can remove
3325         the turn_off_warning and WINDOWSNT || HAVE_NS tests.
3326         Don't warn if site-lisp directories are missing.
3327         If not installed, start from a blank load-path, since
3328         PATH_LOADSEARCH refers to the eventual installation directories.
3330 2012-07-07  Eli Zaretskii  <eliz@gnu.org>
3332         Support truncation and continuation glyphs on GUI frames, when
3333         fringes are disabled.  (Bug#11832)
3334         * xdisp.c (init_iterator): Get dimensions of truncation and
3335         continuation glyphs even if on GUI frames.
3336         Adjust it->last_visible_x on GUI frames when the left or right fringes,
3337         or both, are absent.
3338         (start_display, move_it_in_display_line_to): Handle the case of a
3339         GUI frame without a fringe to display continuation or truncation
3340         glyphs.
3341         (insert_left_trunc_glyphs): Support GUI frames: make sure
3342         truncation glyphs overwrite enough glyphs from the current line to
3343         have sufficient space in pixels.
3344         (display_line): Support truncation and continuation glyphs on GUI
3345         frames.  If some spare pixels are left on the line after inserting
3346         the truncation glyphs, fill that space with a stretch glyph of a
3347         suitably computed width.
3349         * term.c (produce_special_glyphs): Call PRODUCE_GLYPHS, not
3350         produce_glyphs, to support GUI sessions.
3352 2012-07-07  Paul Eggert  <eggert@cs.ucla.edu>
3354         * sysdep.c (ULLONG_MAX): Define if not already defined (Bug#11781).
3356         * sysdep.c (list_system_processes): Port to NetBSD-current (Bug#11797).
3358         Do not require float-time's arg to fit in time_t (Bug#11825).
3359         This works better on hosts where time_t is unsigned, and where
3360         float-time is applied to the (negative) difference between two times.
3361         * editfns.c (decode_time_components): Last arg is now double *,
3362         not int *, and means to store all the result as a double, without
3363         worrying about whether the seconds part fits in time_t.
3364         All callers changed.
3365         (lisp_time_argument): Remove last int * arg, as it's no longer needed.
3366         All callers changed.
3367         (Ffloat_time): Do not fail merely because the specified time falls
3368         outside of time_t range.
3370 2012-07-07  Glenn Morris  <rgm@gnu.org>
3372         * s/darwin.h (HAVE_RES_INIT, HAVE_LIBRESOLV):
3373         * s/hpux10-20.h (HAVE_RINT, HAVE_RANDOM):
3374         * s/unixware.h (HAVE_GETWD): Move undefs to configure (effectively).
3376 2012-07-07  Juanma Barranquero  <lekktu@gmail.com>
3378         * makefile.w32-in (DISPEXTERN_H, $(BLD)/regex.$(O)):
3379         Update dependencies.
3381         * s/ms-w32.h [_MSC_VER]: Remove strcasecmp, strncasecmp.
3383 2012-07-06  Paul Eggert  <eggert@cs.ucla.edu>
3385         Use c_strcasecmp for ASCII case-insensitive comparison (Bug#11786).
3386         * dispextern.h, nsfns.m, nsterm.m: Include <c-strcase.h>.
3387         * dispextern.h (xstrcasecmp): Rewrite using c_strcasecmp.
3388         * nsfns.m (x_get_string_resource): Use c_strncasecmp, not strncasecmp.
3389         * nsterm.m (ns_default): Use c_strcasecmp, not strcasecmp.
3390         * xfaces.c (xstrcasecmp) [!HAVE_STRCASECMP]: Remove.
3392         * xfont.c (compare_font_names): Redo to omit the need for casts.
3394 2012-07-06  Andreas Schwab  <schwab@linux-m68k.org>
3396         * xfns.c (Fx_change_window_property): Doc fix.
3397         * w32fns.c (Fx_change_window_property): Doc fix.
3399         * w32fns.c (Fx_window_property): Accept the same arguments as the
3400         X Windows version.  Doc fix.
3401         * xfns.c (Fx_window_property): Doc fix.  (Bug#11870)
3403 2012-07-06  Juanma Barranquero  <lekktu@gmail.com>
3404             Eli Zaretskii  <eliz@gnu.org>
3406         * s/ms-w32.h: Settings not specific to Windows moved to nt/config.nt.
3407         Windows-specific code from nt/config.nt moved here.
3408         Obsolete settings removed.
3410 2012-07-06  Paul Eggert  <eggert@cs.ucla.edu>
3412         * process.c: Avoid unnecessary calls to gettime.
3413         (wait_reading_process_output): Don't get the time of day
3414         when gobbling data immediately and not waiting, as there's no need
3415         for it in that case.  This removes a FIXME.
3417 2012-07-06  Jan Djärv  <jan.h.d@swipnet.se>
3419         * gtkutil.c (xg_event_is_for_scrollbar): Assign gwin when HAVE_GTK3
3420         is defined (Bug#11768).
3422 2012-07-06  Dmitry Antipov  <dmantipov@yandex.ru>
3424         Fix marker debugging code.
3425         * marker.c (byte_char_debug_check): Do not perform the check
3426         if buffer is not multibyte.
3427         (buf_charpos_to_bytepos, buf_bytepos_to_charpos):
3428         Call byte_char_debug_check with correct arguments.
3430 2012-07-06  Dmitry Antipov  <dmantipov@yandex.ru>
3432         Compile marker debugging code only if ENABLE_CHECKING is defined.
3433         * marker.c (byte_char_debug_check, count_markers):
3434         Use only if ENABLE_CHECKING is defined.
3435         (byte_debug_flag): Remove.
3436         (CONSIDER, buf_charpos_to_bytepos, buf_bytepos_to_charpos):
3437         Always call byte_char_debug_check if ENABLE_CHECKING is defined.
3439 2012-07-06  Dmitry Antipov  <dmantipov@yandex.ru>
3441         Avoid code repetition in marker-related functions.
3442         * marker.c (attach_marker): New function.
3443         (Fset_marker, set_marker_restricted, set_marker_both)
3444         (set_marker_restricted_both): Use it.
3445         (Fset_marker, set_marker_restricted, Fbuffer_has_markers_at):
3446         Consistently rename charno to charpos.
3447         (marker_position): Add eassert.
3448         (marker_byte_position): Convert to eassert.
3450 2012-07-06  Dmitry Antipov  <dmantipov@yandex.ru>
3452         Simplify list operations in unchain_overlay and unchain_marker.
3453         * buffer.c (unchain_overlay): Simplify.  Add comment.
3454         * marker.c (unchain_marker): Simplify.  Fix comments.
3456 2012-07-06  Dmitry Antipov  <dmantipov@yandex.ru>
3458         Introduce fast path for the widely used marker operation.
3459         * alloc.c (build_marker): New function.
3460         * lisp.h (build_marker): New prototype.
3461         * buffer.c (clone_per_buffer_values, Fmake_indirect_buffer): Use it.
3462         * composite.c (autocmp_chars): Likewise.
3463         * editfns.c (buildmark): Remove.
3464         (Fpoint_marker, Fpoint_min_marker, Fpoint_max_marker)
3465         (save_restriction_save): Use build_marker.
3466         * marker.c (buf_charpos_to_bytepos, buf_bytepos_to_charpos): Likewise.
3467         * window.c (save_window_save): Likewise.
3469 2012-07-06  Dmitry Antipov  <dmantipov@yandex.ru>
3471         Do not use Fdelete_overlay in delete_all_overlays
3472         to avoid redundant calls to unchain_overlay.
3473         * buffer.c (drop_overlay): New function.
3474         (delete_all_overlays, Fdelete_overlay): Use it.
3475         * minibuf.c (get_minibuffer): Fix comment.
3477 2012-07-06  Paul Eggert  <eggert@cs.ucla.edu>
3479         Port to OpenBSD 5.1 amd64.
3480         * sysdep.c [BSD_SYSTEM]: Include <sys/param.h> before <sys/sysctl.h>.
3481         This is needed for OpenBSD, and should be harmless on all BSD systems.
3482         Also, include <sys/sysctl.h>, as it should be available on all
3483         BSD_SYSTEM hosts given that we're already calling sysctl in that case.
3484         (list_system_processes) [__OpenBSD__]: Use DARWIN_OS style mib, but
3485         use p_pid member, not kp_proc.pid.
3487 2012-07-06  Glenn Morris  <rgm@gnu.org>
3489         * Makefile.in (emacs$(EXEEXT)): Don't check for load-path shadows.
3491 2012-07-05  Paul Eggert  <eggert@cs.ucla.edu>
3493         More xmalloc and related cleanup.
3494         * alloc.c, bidi.c, buffer.c, buffer.h, bytecode.c, callint.c:
3495         * callproc.c, charset.c, coding.c, composite.c, data.c, dispnew.c:
3496         * doc.c, editfns.c, emacs.c, eval.c, fileio.c, filelock.c, fns.c:
3497         * font.c, fontset.c, frame.c, fringe.c, ftfont.c, ftxfont.c, gmalloc.c:
3498         * gtkutil.c, image.c, keyboard.c, keymap.c, lread.c, macros.c, menu.c:
3499         * nsfns.m, nsfont.m, nsmenu.m, nsterm.m, print.c, process.c, ralloc.c:
3500         * regex.c, region-cache.c, scroll.c, search.c, sound.c, syntax.c:
3501         * sysdep.c, term.c, termcap.c, unexmacosx.c, window.c, xdisp.c:
3502         * xfaces.c, xfns.c, xftfont.c, xgselect.c, xmenu.c, xrdb.c, xselect.c:
3503         * xterm.c:
3504         Omit needless casts involving void * pointers and allocation.
3505         Prefer "P = xmalloc (sizeof *P)" to "P = xmalloc (sizeof (TYPE_OF_P))",
3506         as the former is more robust if P's type is changed.
3507         Prefer xzalloc to xmalloc + memset 0.
3508         Simplify malloc-or-realloc to realloc.
3509         Don't worry about xmalloc returning a null pointer.
3510         Prefer xstrdup to xmalloc + strcpy.
3511         * editfns.c (Fmessage_box): Grow message_text by at least 80 when
3512         growing it.
3513         * keyboard.c (apply_modifiers_uncached): Prefer local array to
3514         alloca of a constant.
3516 2012-07-05  Eli Zaretskii  <eliz@gnu.org>
3518         * xdisp.c (display_line): Fix horizontal pixel coordinates when
3519         hscroll is larger than the line width.  Fixes long and futile
3520         looping inside extend_face_to_end_of_line (on a TTY) producing
3521         glyphs that are not needed and thrown away.
3523 2012-07-05  Dmitry Antipov  <dmantipov@yandex.ru>
3525         * marker.c (set_marker_restricted_both): Simplify by using
3526         clip_to_bounds.
3528 2012-07-05  Paul Eggert  <eggert@cs.ucla.edu>
3530         * editfns.c (region_limit): Simplify by using clip_to_bounds.
3532 2012-07-05  Jan Djärv  <jan.h.d@swipnet.se>
3534         * gtkutil.c (gtk_scrollbar_new, gtk_box_new): Define when HAVE_GTK3 is
3535         not defined (Bug#11768).
3536         (xg_create_frame_widgets): Use gtk_plug_new_for_display (Bug#11768).
3537         (xg_create_frame_widgets, create_dialog, xg_get_file_with_chooser)
3538         (make_widget_for_menu_item, xg_make_tool_item): Use gtk_box_new
3539         followed by gtk_box_set_homogeneous (Bug#11768).
3540         (xg_update_menu_item): Use GTK_IS_BOX (Bug#11768).
3541         (update_theme_scrollbar_width, xg_create_scroll_bar):
3542         Use gtk_scrollbar_new (Bug#11768).
3543         (xg_event_is_for_scrollbar): Use Gdk Device functions for HAVE_GTK3.
3544         (is_box_type): New function (Bug#11768).
3545         (xg_tool_item_stale_p): Call is_box_type.
3546         (xg_initialize): Get settings by calling gtk_settings_get_for_screen
3547         with default display (Bug#11768).
3549 2012-07-05  Eli Zaretskii  <eliz@gnu.org>
3551         * xdisp.c (window_hscroll_limited): New function.
3552         (pos_visible_p, init_iterator): Use it to avoid overflow of pixel
3553         coordinates when window's hscroll is set to insanely large
3554         values.  (Bug#11857)
3556 2012-07-05  Juanma Barranquero  <lekktu@gmail.com>
3558         * makefile.w32-in ($(BLD)/dired.$(O), $(BLD)/fileio.$(O)): Fix typo.
3559         ($(BLD)/terminal.$(O), $(BLD)/syntax.$(O)): Update dependencies.
3561 2012-07-05  Dmitry Antipov  <dmantipov@yandex.ru>
3563         Cleanup xmalloc.
3564         * lisp.h (xzalloc): New prototype.  Omit needless casts.
3565         * alloc.c (xzalloc): New function.  Omit needless casts.
3566         * charset.c: Omit needless casts.  Convert all calls to
3567         xmalloc with following memset to xzalloc.
3568         * dispnew.c: Likewise.
3569         * fringe.c: Likewise.
3570         * image.c: Likewise.
3571         * sound.c: Likewise.
3572         * term.c: Likewise.
3573         * w32fns.c: Likewise.
3574         * w32font.c: Likewise.
3575         * w32term.c: Likewise.
3576         * xfaces.c: Likewise.
3577         * xfns.c: Likewise.
3578         * xterm.c: Likewise.
3579         * atimer.c: Omit needless casts.
3580         * buffer.c: Likewise.
3581         * callproc.c: Likewise.
3582         * ccl.c: Likewise.
3583         * coding.c: Likewise.
3584         * composite.c: Likewise.
3585         * doc.c: Likewise.
3586         * doprnt.c: Likewise.
3587         * editfns.c: Likewise.
3588         * emacs.c: Likewise.
3589         * eval.c: Likewise.
3590         * filelock.c: Likewise.
3591         * fns.c: Likewise.
3592         * gtkutil.c: Likewise.
3593         * keyboard.c: Likewise.
3594         * lisp.h: Likewise.
3595         * lread.c: Likewise.
3596         * minibuf.c: Likewise.
3597         * msdos.c: Likewise.
3598         * print.c: Likewise.
3599         * process.c: Likewise.
3600         * region-cache.c: Likewise.
3601         * search.c: Likewise.
3602         * sysdep.c: Likewise.
3603         * termcap.c: Likewise.
3604         * terminal.c: Likewise.
3605         * tparam.c: Likewise.
3606         * w16select.c: Likewise.
3607         * w32.c: Likewise.
3608         * w32reg.c: Likewise.
3609         * w32select.c: Likewise.
3610         * w32uniscribe.c: Likewise.
3611         * widget.c: Likewise.
3612         * xdisp.c: Likewise.
3613         * xmenu.c: Likewise.
3614         * xrdb.c: Likewise.
3615         * xselect.c: Likewise.
3617 2012-07-05  Paul Eggert  <eggert@cs.ucla.edu>
3619         * fileio.c (time_error_value): Check the right error number.
3620         Problem reported by Troels Nielsen in
3621         <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00095.html>.
3623 2012-07-04  Paul Eggert  <eggert@cs.ucla.edu>
3625         * window.c (set_window_hscroll): Revert the 100000 hscroll limit.
3626         This should be fixed in a better way; see Eli Zaretskii in
3627         <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00088.html>.
3628         (HSCROLL_MAX): Remove; this is now internal to set_window_hscroll.
3630         * fileio.c (time_error_value): Rename from special_mtime.
3631         The old name's problems were noted by Eli Zaretskii in
3632         <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00087.html>.
3634         * emacs.c (gdb_pvec_type): Change it back to enum pvec_type.
3635         This variable's comment says Emacs needs at least one GDB-visible
3636         symbol of type enum pvec_type, to work around GDB problems.
3637         The symbol's value doesn't matter.
3639         * alloc.c (PSEUDOVECTOR_NBYTES): Remove stray ';'
3640         that causes compilation to fail on pre-C99 compilers.
3642 2012-07-04  Juanma Barranquero  <lekktu@gmail.com>
3644         * s/ms-w32.h (LISP_FLOAT_TYPE, HAVE_MEMCMP, HAVE_MEMCPY)
3645         (HAVE_MEMMOVE, HAVE_MEMSET): Don't set, obsolete.
3647 2012-07-04  Dmitry Antipov  <dmantipov@yandex.ru>
3649         * buffer.c (init_buffer_once): Fix initialization of
3650         headers for buffer_defaults and buffer_local_symbols.
3651         Reported by Juanma Barranquero <lekktu@gmail.com>.
3653 2012-07-04  Stefan Monnier  <monnier@iro.umontreal.ca>
3655         Turn VECTOR_FREE_LIST_FLAG into PVEC_FREE.
3656         * lisp.h (enum pvec_type): Use fewer bits.
3657         (PSEUDOVECTOR_SIZE_BITS): New constant.
3658         (PSEUDOVECTOR_SIZE_MASK, PVEC_TYPE_MASK): Use it.
3659         (XSETPVECTYPESIZE, XSETTYPED_PSEUDOVECTOR, DEFUN): Adapt code to
3660         change in pvec_type.
3661         (PSEUDOVECTOR_TYPEP): New macro.
3662         (TYPED_PSEUDOVECTORP): Use it.
3663         * fns.c (internal_equal): Adapt code to extract pvectype.
3664         * emacs.c (gdb_pvec_type): Update type.
3665         * alloc.c (PSEUDOVECTOR_NBYTES): New macro.
3666         (VECTOR_FREE_LIST_SIZE_MASK): Remove (=> PSEUDOVECTOR_SIZE_MASK).
3667         (VECTOR_FREE_LIST_FLAG): Remove (=> PVEC_FREE).
3668         (SETUP_ON_FREE_LIST): Use XSETPVECTYPESIZE.
3669         (sweep_vectors): Use it.  Use local var `total_bytes' instead of
3670         abusing vector->header.next.nbytes.
3671         (live_vector_p): Use PVEC_TYPE.
3672         (mark_object): Adapt code to extract pvectype.  Use switch.
3674 2012-07-04  Paul Eggert  <eggert@cs.ucla.edu>
3676         * doprnt.c (doprnt): Don't assume string length fits in 'int'.
3677         Tighten new eassert a bit.
3679 2012-07-04  Dmitry Antipov  <dmantipov@yandex.ru>
3681         Fix compilation with --enable-gcc-warnings and -O1
3682         optimization level.
3683         * doprnt.c (doprnt): Change type of tem to int, initialize
3684         to avoid compiler warning.  Add eassert.
3685         * search.c (simple_search): Initialize match_byte to avoid
3686         compiler warning.  Add eassert.
3688 2012-07-04  Paul Eggert  <eggert@cs.ucla.edu>
3690         Avoid weird behavior with large horizontal scrolls.
3691         Without this change, for example, large hscroll values would
3692         mess up Emacs's display on Fedora 15 x86, presumably due to
3693         overflows in int calculations in the display code.
3694         Also, if buffers had long lines, Emacs would freeze.
3695         * window.c (HSCROLL_MAX): Reduce to 100000, and make it visible to GDB.
3696         (set_window_hscroll): New function, containing the old guts of
3697         Fset_window_hscroll.  Return the clipped value.
3698         (Fset_window_hscroll, Fscroll_left, Fscroll_right): Use it.
3699         This avoids the need to check against PTRDIFF_MAX.
3701         * buffer.c (Fgenerate_new_buffer_name): Fix sprintf format mismatch.
3703 2012-07-04  Dmitry Antipov  <dmantipov@yandex.ru>
3705         * buffer.c (Fgenerate_new_buffer_name): Fix type mismatch.
3707 2012-07-04  Paul Eggert  <eggert@cs.ucla.edu>
3709         * regex.c: Suppress GCC warning on RHEL 6.  (Bug#11207)
3710         Conditionalize the pragmas on GCC 4.5 or later, not GCC 4.3 or later,
3711         since GCC 4.4.6 issues a bogus warning for them.
3713         Fix bugs in file timestamp newness comparisons.
3714         * fileio.c (Ffile_newer_than_file_p):
3715         * lread.c (Fload): Use full timestamp resolution of files,
3716         not just the 1-second resolution, so that files that are only
3717         slightly newer still count as newer.
3718         * fileio.c (Ffile_newer_than_file_p): Don't assume file
3719         timestamps fit in 'int'; this fixes a Y2038 bug on most hosts.
3721 2012-07-03  Paul Eggert  <eggert@cs.ucla.edu>
3723         * fileio.c: Improve handling of file time marker.  (Bug#11852)
3724         (special_mtime): New function.
3725         (Finsert_file_contents, Fverify_visited_file_modtime):
3726         Use it to set special mtime values consistently.
3728 2012-07-03  Andreas Schwab  <schwab@linux-m68k.org>
3730         * fileio.c (Finsert_file_contents): Properly handle st_mtime
3731         marker for non-existing file.  (Bug#11852)
3733 2012-07-03  Glenn Morris  <rgm@gnu.org>
3735         * lisp.h (Fread_file_name): Restore EXFUN (it's not a normal DEFUN
3736         and did not make it into globals.h).
3738 2012-07-03  Tom Tromey  <tromey@redhat.com>
3740         * window.c (Fset_window_margins, Fset_window_fringes)
3741         (Fset_window_scroll_bars, Fset_window_vscroll): No longer static.
3742         * textprop.c (Fprevious_property_change): No longer static.
3743         * syntax.c (Fsyntax_table_p): No longer static.
3744         * process.c (Fget_process, Fprocess_datagram_address): No longer
3745         static.
3746         * keymap.c (Flookup_key, Fcopy_keymap): No longer static.
3747         * keyboard.c (Fcommand_execute): No longer static.
3748         Remove EXFUN.
3749         * insdel.c (Fcombine_after_change_execute): No longer static.
3750         * image.c (Finit_image_library): No longer static.
3751         * fileio.c (Fmake_symbolic_link): No longer static.
3752         * eval.c (Ffetch_bytecode): No longer static.
3753         * editfns.c (Fuser_full_name): No longer static.
3754         * doc.c (Fdocumentation_property, Fsnarf_documentation):
3755         No longer static.
3756         * buffer.c (Fset_buffer_major_mode, Fdelete_overlay): No longer
3757         static.
3758         * dired.c (Ffile_attributes): No longer static.
3759         * composite.c (Fcomposition_get_gstring): No longer static.
3760         * callproc.c (Fgetenv_internal): No longer static.
3762         * ccl.h: Remove EXFUNs.
3763         * buffer.h: Remove EXFUNs.
3764         * dispextern.h: Remove EXFUNs.
3765         * intervals.h: Remove EXFUNs.
3766         * fontset.h: Remove EXFUN.
3767         * font.h: Remove EXFUNs.
3768         * dosfns.c (system_process_attributes): Remove EXFUN.
3769         * keymap.h: Remove EXFUNs.
3770         * lisp.h: Remove EXFUNs.
3771         * w32term.h: Remove EXFUNs.
3772         * window.h: Remove EXFUNs.
3773         * xsettings.h: Remove EXFUN.
3774         * xterm.h: Remove EXFUN.
3776 2012-07-03  Glenn Morris  <rgm@gnu.org>
3778         * lisp.h (Frandom): Make it visible to C.
3779         * buffer.c (Fgenerate_new_buffer_name): Speed up finding a new
3780         buffer for invisible buffers.  (Bug#1229)
3782 2012-07-03  Dmitry Antipov  <dmantipov@yandex.ru>
3784         Fix block vector allocation code to allow VECTOR_BLOCK_SIZE
3785         values which aren't power of 2.
3786         * alloc.c (VECTOR_FREE_LIST_SIZE_MASK): New macro.
3787         Verify it's value and the value of VECTOR_BLOCK_SIZE.  Adjust users
3788         accordingly.
3790 2012-07-03  Stefan Monnier  <monnier@iro.umontreal.ca>
3792         * lisp.h (Lisp_Misc, Lisp_Fwd): Move around to group better.
3794         * alloc.c (mark_object): Revert part of last patch to use `switch'.
3796 2012-07-03  Dmitry Antipov  <dmantipov@yandex.ru>
3798         * alloc.c (allocate_vector_block): Remove redundant
3799         calls to mallopt if DOUG_LEA_MALLOC is defined.
3800         (allocate_vectorlike): If DOUG_LEA_MALLOC is defined,
3801         avoid calls to mallopt if zero_vector is returned.
3803 2012-07-03  Dmitry Antipov  <dmantipov@yandex.ru>
3805         * alloc.c (check_string_bytes): If GC_CHECK_STRING_BYTES
3806         is enabled, avoid dereferencing NULL current_sblock if
3807         running undumped.
3809 2012-07-03  Dmitry Antipov  <dmantipov@yandex.ru>
3811         Cleanup basic buffer management.
3812         * buffer.h (struct buffer): Change layout to use generic vector
3813         marking code.  Fix some comments.  Change type of 'clip_changed'
3814         to bitfield.  Remove unused #ifndef old.
3815         (FIRST_FIELD_PER_BUFFER, LAST_FIELD_PER_BUFFER): Remove.
3816         (GET_OVERLAYS_AT): Fix indentation.
3817         (for_each_per_buffer_object_at): New macro.
3818         * buffer.c (clone_per_buffer_values, reset_buffer_local_variables)
3819         (Fbuffer_local_variables): Use it.
3820         (init_buffer_once, syms_of_buffer): Remove unused #ifndef old.
3821         * alloc.c (allocate_buffer): Adjust to match new layout of
3822         struct buffer.  Fix comment.
3823         (mark_overlay): New function.
3824         (mark_buffer): Use it.  Use mark_vectorlike to mark normal
3825         Lisp area of struct buffer.
3826         (mark_object): Use it.  Adjust marking of misc objects
3827         and related comments.
3829 2012-07-02  Paul Eggert  <eggert@cs.ucla.edu>
3831         * alloc.c (mark_object): Remove "#ifdef GC_CHECK_MARKED_OBJECTS"
3832         wrapper that is not needed because the wrapped code is a no-op (zero
3833         machine instructions) when GC_CHECK_MARKED_OBJECTS is not defined.
3834         This avoids a -Wunused-macros diagnostic with GCC 4.7.1 x86-64.
3836 2012-07-02  Dmitry Antipov  <dmantipov@yandex.ru>
3838         * alloc.c (mark_buffer): Simplify.  Remove prototype.
3839         (mark_object): Add comment.  Reorganize marking of vector-like
3840         objects.  Use CHECK_LIVE for all vector-like objects except buffers
3841         and subroutines when GC_CHECK_MARKED_OBJECTS is defined.
3842         Avoid redundant calls to mark_vectorlike for bool vectors.
3844 2012-06-30  Glenn Morris  <rgm@gnu.org>
3846         * nsterm.m (ns_init_paths): Ignore site-lisp if --no-site-lisp.
3848         * epaths.in (PATH_SITELOADSEARCH): New.
3849         * lread.c (init_lread): Use PATH_SITELOADSEARCH.
3850         This is rather than relying on --enable-locallisppath elements
3851         having "site-lisp" in their names.  (Bug#10208#25, 11658)
3853 2012-06-30  Eli Zaretskii  <eliz@gnu.org>
3855         * w32proc.c (sys_select): Accept and ignore one more argument.
3857         * w32.c (emacs_gnutls_pull): Call select with one more argument.
3859         * sysselect.h [DOS_NT]: Don't include sys/select.h.
3860         (pselect) [!MS_DOS]: Redirect to sys_select.
3862         * sysdep.c: Don't include dos.h and dosfns.h.
3864         * process.c (sys_select):
3865         * msdos.c (sys_select): Accept one more argument and ignore it.
3867         * msdos.c (event_timestamp, sys_select): Use gnulib's gettime;
3868         adapt data types and code to that.
3870         * dosfns.c:
3871         * msdos.c (gettime, settime): Define away the prototypes in dos.h,
3872         which clashes with the gnulib function of the same name.
3874 2012-06-30  Andreas Schwab  <schwab@linux-m68k.org>
3876         * font.c (font_style_to_value, font_style_symbolic)
3877         (font_prop_validate_style): Add type checks for values in
3878         font_style_table.
3880         * lisp.h (CHECK_RANGED_INTEGER): Make value to check the first
3881         argument.
3882         * character.c, charset.c, menu.c, process.c, window.c: Adjust all
3883         uses.
3885 2012-06-29  Eli Zaretskii  <eliz@gnu.org>
3887         * xdisp.c (try_window_id): Undo last change.
3889         * w32.c (getwd): Adjust commentary about startup_dir.
3890         (init_environment): Always call sys_access, even in non-MSVC
3891         builds.  Don't chdir to the directory of the Emacs executable.
3892         This undoes code from 1997 which was justified by the need to
3893         "avoid conflicts when removing and renaming directories".  But its
3894         downside was that every relative file name was being interpreted
3895         relative to the directory of the Emacs executable, which can never
3896         be TRT.  In particular, it broke sys_access when called with
3897         relative file names.
3898         (sys_access): Map GetLastError to errno.
3900 2012-06-29  Dmitry Antipov  <dmantipov@yandex.ru>
3902         * window.h (struct window): Change type of 'fringes_outside_margins'
3903         to bitfield.  Fix comment.  Adjust users accordingly.
3904         (struct window): Change type of 'window_end_bytepos' to ptrdiff_t.
3905         Adjust comment.
3906         * xdisp.c (try_window_id): Change type of 'first_vpos' and 'vpos'
3907         to ptrdiff_t.
3909 2012-06-29  Andreas Schwab  <schwab@linux-m68k.org>
3911         * gnutls.c (emacs_gnutls_handshake):
3912         Add QUIT to make the loop interruptible.
3914 2012-06-29  Glenn Morris  <rgm@gnu.org>
3916         * charset.c (init_charset): Make lack of etc/charsets fatal.
3918 2012-06-29  Dmitry Antipov  <dmantipov@yandex.ru>
3920         * editfns.c (region_limit): Fix type mismatch.
3922 2012-06-29  Dmitry Antipov  <dmantipov@yandex.ru>
3924         * nsfns.m: Fix GLYPH_DEBUG usage assuming that it may be
3925         undefined.  Convert from xassert to eassert.
3926         * nsmenu.m: Convert from xassert to eassert.
3927         * nsterm.m: Likewise.
3929 2012-06-28  Stefan Monnier  <monnier@iro.umontreal.ca>
3931         * editfns.c (region_limit): Clip to narrowing (bug#11770).
3933 2012-06-28  Paul Eggert  <eggert@cs.ucla.edu>
3935         Avoid integer overflow on scroll-left and scroll-right.
3936         * window.c (HSCROLL_MAX): New macro.
3937         (Fscroll_left, Fscroll_right): Avoid undefined behavior on integer
3938         overflow when requested scroll falls outside ptrdiff_t range.
3940 2012-06-28  Dmitry Antipov  <dmantipov@yandex.ru>
3942         * window.h (struct window): Change type of 'hscroll',
3943         'min_hscroll' and 'last_point' from Lisp_Object to ptrdiff_t,
3944         'last_modified' and 'last_overlay_modified' to EMACS_INT.
3945         Adjust users accordingly.
3946         * xdisp.c (try_cursor_movement): Replace type check with eassert.
3947         * window.c (Fscroll_left, Fscroll_right): Change type of 'hscroll'
3948         from EMACS_INT to ptrdiff_t.
3949         (make_window): Omit redundant initialization.
3951 2012-06-28  Juanma Barranquero  <lekktu@gmail.com>
3953         * makefile.w32-in ($(BLD)/regex.$(O)): Update dependencies.
3955 2012-06-28  Dmitry Antipov  <dmantipov@yandex.ru>
3957         * window.h (struct window): Change type of 'use_time' and
3958         'sequence_number' from Lisp_Object to int.
3959         * frame.c (make_frame): Adjust users accordingly.
3960         * print.c (print_object): Likewise.
3961         * window.c (select_window, Fwindow_use_time, make_parent_window)
3962         (make_window): Likewise.
3964 2012-06-28  Dmitry Antipov  <dmantipov@yandex.ru>
3966         * dispextern.h (GLYPH_DEBUG): Now defined in config.h if
3967         enabled with --enable-checking=[all,glyphs] configure option.
3968         Fix GLYPH_DEBUG usage assuming that it may be undefined,
3969         adjust comments accordingly.
3970         * dispnew.c: Fix GLYPH_DEBUG usage assuming that it may be
3971         undefined, adjust comments accordingly.
3972         * image.c: Likewise.
3973         * scroll.c: Likewise.
3974         * w32fns.c: Likewise.
3975         * w32term.c: Likewise.
3976         * xdisp.c: Likewise.
3977         * xfaces.c: Likewise.
3978         * xfns.c: Likewise.
3979         * xterm.c: Likewise.
3981 2012-06-28  Dmitry Antipov  <dmantipov@yandex.ru>
3983         Generalize run-time debugging checks.
3984         * dispextern.h (XASSERTS): Remove.
3985         * fontset.c (xassert): Remove.
3986         Convert from xassert to eassert.
3987         * alloc.c: Convert from xassert to eassert.
3988         * bidi.c: Likewise.
3989         * dispnew.c: Likewise.
3990         * fns.c: Likewise.
3991         * fringe.c: Likewise.
3992         * ftfont.c: Likewise.
3993         * gtkutil.c: Likewise.
3994         * image.c: Likewise.
3995         * keyboard.c: Likewise.
3996         * menu.c: Likewise.
3997         * process.c: Likewise.
3998         * scroll.c: Likewise.
3999         * sound.c: Likewise.
4000         * term.c: Likewise.
4001         * w32console.c: Likewise.
4002         * w32fns.c: Likewise.
4003         * w32term.c: Likewise.
4004         * window.c: Likewise.
4005         * xdisp.c: Likewise.
4006         * xfaces.c: Likewise.
4007         * xfns.c: Likewise.
4008         * xselect.c: Likewise.
4009         * xterm.c: Likewise.
4011 2012-06-27  Stefan Monnier  <monnier@iro.umontreal.ca>
4013         * fns.c (maybe_resize_hash_table): Output message when growing the
4014         purify-hashtable.
4016 2012-06-27  Dmitry Antipov  <dmantipov@yandex.ru>
4018         * alloc.c (allocate_string_data): Remove dead code.
4019         * xsettings.c (XSETTINGS_FONT_NAME): Move under HAVE_XFT to
4020         avoid GCC warning about unused macro.
4022 2012-06-27  Dmitry Antipov  <dmantipov@yandex.ru>
4024         * alloc.c (allocate_string): Omit intervals initialization.
4025         * alloc.c (make_uninit_multibyte_string): Initialize intervals
4026         as in make_pure_string and make_pure_c_string.
4028 2012-06-27  Dmitry Antipov  <dmantipov@yandex.ru>
4030         * alloc.c (allocate_string): Fix last change.
4032 2012-06-27  Dmitry Antipov  <dmantipov@yandex.ru>
4034         * alloc.c (allocate_string): Remove two redundant calls
4035         to memset, add explicit initialization where appropriate.
4037 2012-06-27  Glenn Morris  <rgm@gnu.org>
4039         * lisp.mk (lisp): Remove paths.elc.
4041 2012-06-27  Chong Yidong  <cyd@gnu.org>
4043         * doc.c (Fsubstitute_command_keys): Fix punctuation.
4045 2012-06-26  John Wiegley  <johnw@newartisans.com>
4047         * unexmacosx.c (copy_data_segment): Add two section names used
4048         on Mac OS X Lion: __mod_init_func and __mod_term_func.
4050         * alloc.c (mark_memory): Do not check with -faddress-sanitizer
4051         when building with Clang.
4053 2012-06-26  Stefan Monnier  <monnier@iro.umontreal.ca>
4055         * eval.c (Fapply): Allow calling it with a single argument.
4057 2012-06-26  Eli Zaretskii  <eliz@gnu.org>
4059         * s/ms-w32.h (strcasecmp, strncasecmp) [_MSC_VER]: Redirect to
4060         _stricmp and _strnicmp.
4061         (HAVE_STRCASECMP, HAVE_STRNCASECMP): Define to 1.
4063 2012-06-26  Dmitry Antipov  <dmantipov@yandex.ru>
4065         * alloc.c (allocate_window): Zero out non-Lisp part of newly
4066         allocated window.
4067         (allocate_process): Likewise for new process.
4068         (allocate_terminal): Change to use offsetof.
4069         (allocate_frame): Likewise.
4070         * frame.c (make_frame): Omit redundant initialization.
4071         * window.c (make_parent_window): Use memset.
4072         (make_window): Omit redundant initialization.
4073         * process.c (make_process): Omit redundant initialization.
4074         * terminal.c (create_terminal): Likewise.
4076 2012-06-26  Dmitry Antipov  <dmantipov@yandex.ru>
4078         * term.c (delete_tty): Remove redundant call to memset.
4080 2012-06-26  Dmitry Antipov  <dmantipov@yandex.ru>
4082         * alloc.c: Remove build_string.
4083         * lisp.h: Define build_string as static inline.  This provides
4084         a better opportunity to optimize away calls to strlen when the
4085         function is called with compile-time constant argument.
4086         * image.c (imagemagick_error): Convert to build_string.
4087         * w32proc.c (sys_spawnve): Likewise.
4088         * xterm.c (x_term_init): Likewise.
4090 2012-06-26  Paul Eggert  <eggert@cs.ucla.edu>
4092         Use sprintf return value instead of invoking strlen on result.
4093         In the old days this wasn't portable, since some sprintf
4094         implementations returned char *.  But they died out years ago and
4095         Emacs already assumes sprintf returns int.
4096         Similarly for float_to_string.
4097         This patch speeds up (number-to-string 1000) by 3% on Fedora 15 x86-64.
4098         * ccl.c (ccl_driver):
4099         * character.c (string_escape_byte8):
4100         * data.c (Fnumber_to_string):
4101         * doprnt.c (doprnt):
4102         * print.c (print_object):
4103         * xdisp.c (message_dolog):
4104         * xfns.c (syms_of_xfns):
4105         Use sprintf or float_to_string result to avoid need to call strlen.
4106         * data.c (Fnumber_to_string):
4107         Use make_unibyte_string, since the string must be ASCII.
4108         * lisp.h, print.c (float_to_string): Now returns int length.
4109         * term.c (produce_glyphless_glyph):
4110         Use sprintf result rather than recomputing it.
4112         Clean out last vestiges of the old HAVE_CONFIG_H stuff.
4113         * Makefile.in (ALL_CFLAGS):
4114         * makefile.w32-in (LOCAL_FLAGS): Remove -DHAVE_CONFIG_H.
4115         * gmalloc.c, regex.c: Include <config.h> unconditionally.
4117 2012-06-25  Dmitry Antipov  <dmantipov@yandex.ru>
4119         * dispextern.h (xstrcasecmp): Define to library function
4120         strcasecmp if available.
4121         * xfaces.c: Do not use xstrcasecmp if strcasecmp is available.
4123 2012-06-25  Andreas Schwab  <schwab@linux-m68k.org>
4125         * keyboard.c (menu_bar_items, menu_bar_item, read_key_sequence):
4126         Avoid comma operator.
4127         * menu.c (push_submenu_start, push_submenu_end)
4128         (push_left_right_boundary, push_menu_pane): Likewise.
4129         * msdos.c (dos_rawgetc): Likewise.
4131 2012-06-25  Dmitry Antipov  <dmantipov@yandex.ru>
4133         * xfns.c (xic_create_fontsetname): Remove redundant calls
4134         to memset.
4136 2012-06-25  Paul Eggert  <eggert@cs.ucla.edu>
4138         * gtkutil.c (get_utf8_string): Remove redundant assignment.
4139         sprintf already null-terminates its output.
4141         * xfns.c (x_window): Remove redundant cast.
4143 2012-06-25  Dmitry Antipov  <dmantipov@yandex.ru>
4145         * xmenu.c (xmenu_show, xdialog_show): Explicit cast from
4146         `const char *' to `char *' to avoid compiler warning.
4148 2012-06-24  Paul Eggert  <eggert@cs.ucla.edu>
4150         * xterm.c (x_term_init): Build proper-sized _XSETTINGS_Snnn string
4151         instead of truncating it to 63 (admittedly a generous limit).
4153         * process.c: Fix spelling and caps in comments.
4155 2012-06-24  Dan Nicolaescu  <dann@ics.uci.edu>
4157         * emacs.c (setpgrp): Remove definition, unused.
4158         * sysdep.c (setpgrp): Remove definition, not used in this file.
4160 2012-06-24  Juanma Barranquero  <lekktu@gmail.com>
4162         * makefile.w32-in: Update dependencies.
4164 2012-06-24  Eli Zaretskii  <eliz@gnu.org>
4166         * makefile.w32-in (TIMESPEC_H): Remove nt/inc/sys/time.h.
4167         (SYSTIME_H): Add nt/inc/sys/time.h.
4169         * systime.h [WINDOWSNT]: Include sys/time.h.
4171         * s/ms-w32.h (struct timespec): Definition moved from
4172         nt/inc/sys/time.h.  Suggested by Paul Eggert <eggert@cs.ucla.edu>.
4174 2012-06-24  Paul Eggert  <eggert@cs.ucla.edu>
4176         Switch from NO_RETURN to C11's _Noreturn (Bug#11750).
4177         * buffer.h (buffer_slot_type_mismatch):
4178         * data.c (arith_error) [!FORWARD_SIGNAL_TO_MAIN_THREAD]:
4179         * eval.c (unwind_to_catch):
4180         * image.c (my_png_error, my_error_exit):
4181         * keyboard.c (quit_throw_to_read_char, user_error)
4182         (Fexit_recursive_edit, Fabort_recursive_edit):
4183         * lisp.h (die, args_out_of_range, args_out_of_range_3)
4184         (wrong_type_argument, buffer_overflow, __executable_start)
4185         (memory_full, buffer_memory_full, string_overflow, Fthrow)
4186         (xsignal, xsignal0, xsignal1, xsignal2, xsignal3, signal_error)
4187         (error, verror, nsberror, report_file_error, Ftop_level, Fkill_emacs)
4188         (fatal):
4189         (child_setup) [!DOS_NT]:
4190         * lread.c (end_of_file_error, invalid_syntax):
4191         * process.c (send_process_trap) [!FORWARD_SIGNAL_TO_MAIN_THREAD]:
4192         * puresize.h (pure_write_error):
4193         * search.c (matcher_overflow):
4194         * sound.c (sound_perror, alsa_sound_perror):
4195         * sysdep.c, syssignal.h (croak):
4196         * term.c (maybe_fatal, vfatal):
4197         * textprop.c (text_read_only):
4198         * undo.c (user_error):
4199         * unexmacosx.c (unexec_error):
4200         * xterm.c (x_ins_del_lines, x_delete_glyphs):
4201         Use _Noreturn rather than NO_RETURN.
4202         No need for separate decl merely because of _Noreturn.
4203         * sound.c (sound_warning, parse_sound):
4204         Remove unnecessary forward decls.
4206 2012-06-24  Paul Eggert  <eggert@cs.ucla.edu>
4208         Fix bug when time_t is unsigned and as wide as intmax_t (Bug#9000).
4209         * lisp.h (WAIT_READING_MAX): New macro.
4210         * dispnew.c (Fsleep_for, sit_for):
4211         * keyboard.c (kbd_buffer_get_event):
4212         * process.c (Faccept_process_output):
4213         Use it to avoid bogus compiler warnings with obsolescent GCC versions.
4214         This improves on the previous patch, which introduced a bug
4215         when time_t is unsigned and as wide as intmax_t.
4216         See <http://bugs.gnu.org/9000#51>.
4218 2012-06-23  Eli Zaretskii  <eliz@gnu.org>
4220         * dispnew.c (sit_for, Fsleep_for):
4221         * keyboard.c (kbd_buffer_get_event):
4222         * process.c (Faccept_process_output): Avoid compiler warnings when
4223         comparing a 32-bit time_t with a 64-bit INTMAX_MAX.
4225 2012-06-23  Juanma Barranquero  <lekktu@gmail.com>
4227         * makefile.w32-in: Update dependencies.
4229         * w32.c (ltime): Add return type and declare static.
4230         (w32_get_internal_run_time): Remove usused variable `time_100ns'.
4232 2012-06-23  Paul Eggert  <eggert@cs.ucla.edu>
4234         * sysdep.c [__FreeBSD__]: Fix more recently-introduced typos.
4235         Privately reported by Herbert J. Skuhra.
4236         (make_lisp_timeval) [__FreeBSD__]: Rename from TIMELIST.
4237         All uses changed.
4238         (system_process_attributes) [__FreeBSD__]: Invoke make_lisp_time,
4239         not make_lisp_timeval, when the argument is of type EMACS_TIME.
4241 2012-06-23  Eli Zaretskii  <eliz@gnu.org>
4243         * w32proc.c (Fw32_get_locale_info): Fix an off-by-one error in
4244         last argument of make_unibyte_string.
4246         * keyboard.c (kbd_buffer_get_event): Include the codepage and the
4247         language ID in the event parameters.
4249         * w32term.c (w32_read_socket): Put the new keyboard codepage into
4250         event.code, not the obscure "character set ID".
4252 2012-06-23  Chong Yidong  <cyd@gnu.org>
4254         * xmenu.c (x_menu_wait_for_event): Adapt GTK3 to new xg_select.
4256 2012-06-23  Eli Zaretskii  <eliz@gnu.org>
4258         Fix the MS-Windows build broken by revno 108687.
4259         * w32.c (fdutimens): New function.
4261         * w32proc.c (sys_select): Adapt to change in the EMACS_TIME type.
4263         * s/ms-w32.h (pselect): Redirect to sys_select.
4265         * sysselect.h [WINDOWSNT]: Don't include sys/select.h.
4267         * ralloc.c (r_alloc_inhibit_buffer_relocation): Fix stupid thinko
4268         in the logic of incrementing and decrementing the value of
4269         use_relocatable_buffers.
4271 2012-06-23  Paul Eggert  <eggert@cs.ucla.edu>
4273         * sysdep.c [__FreeBSD__]: Fix recently-introduced typos.
4274         Privately reported by Herbert J. Skuhra.
4275         [__FreeBSD__]: Remove "*/" typo after "#include".
4276         (timeval_to_EMACS_TIME) [__FreeBSD__]: New static function.
4277         (TIMEVAL) [__FreeBSD__]: Now a static function rather than a macro.
4278         (TIMEVAL, system_process_attributes) [__FreeBSD__]:
4279         Don't assume EMACS_TIME and struct timeval are the same type.
4281 2012-06-22  Paul Eggert  <eggert@cs.ucla.edu>
4283         Support higher-resolution time stamps (Bug#9000).
4284         The time stamps are only nanosecond-resolution at the C level,
4285         since that's the best that any real-world system supports now.
4286         But they are picosecond-resolution at the Lisp level, as that's
4287         easy, and leaves room for future OS improvements.
4289         * Makefile.in (LIB_CLOCK_GETTIME): New macro.
4290         (LIBES): Use it.
4292         * alloc.c (Fgarbage_collect): Port to higher-res time stamps.
4293         Don't get current time unless it's needed.
4295         * atimer.c: Include <sys/time.h> unconditionally, since gnulib
4296         now provides it if it's absent.
4297         (start_atimer): Port to higher-res time stamps.
4298         Check for time stamp overflow.  Don't get current time more
4299         often than is needed.
4301         * buffer.h (struct buffer): Buffer modtime now has high resolution.
4302         Include systime.h, not time.h.
4303         (NONEXISTENT_MODTIME_NSECS, UNKNOWN_MODTIME_NSECS): New macros.
4305         * dired.c: Include stat-time.h.
4306         (Ffile-attributes): File times now have higher resolution.
4308         * dispextern.h [HAVE_WINDOW_SYSTEM]: Include systime.h.
4309         (struct image): Timestamp now has higher resolution.
4311         * dispnew.c (PERIODIC_PREEMPTION_CHECKING): Remove, as Emacs always
4312         has at least microseconds now.  All uses removed.
4313         (update_frame, update_single_window, update_window, update_frame_1)
4314         (Fsleep_for, sit_for): Port to higher-resolution time stamps.
4315         (duration_to_sec_usec): Remove; no longer needed.
4317         * editfns.c (time_overflow): Now extern.
4318         (Fcurrent_time, Fget_internal_run_time, make_time, lisp_time_argument)
4319         (float-time, Fformat_time_string, Fcurrent_time_string)
4320         (Fcurrent_time_zone): Accept and generate higher-resolution
4321         time stamps.
4322         (make_time_tail, make_lisp_time, dissassemble_lisp_time)
4323         (decode_time_components, lisp_seconds_argument): New functions.
4324         (make_time): Now static.
4325         (lisp_time_argument): Now returns EMACS_TIME.  New arg ppsec.
4326         Report an error if the time is invalid, rather than having the caller
4327         do that.
4329         * fileio.c: Include <stat-time.h>
4330         (Fcopy_file): Copy higher-resolution time stamps.
4331         Prefer to set the time stamp via a file descriptor if that works.
4332         (Fset_file_times, Finsert_file_contents, Fwrite_region)
4333         (Fverify_visited_file_modtime, Fclear_visited_file_modtime)
4334         (Fvisited_file_modtime, Fset_visited_file_modtime):
4335         Support higher-resolution time stamps.
4337         * fns.c (Frandom): Use nanoseconds, not microseconds, for seed.
4339         * gtkutil.c (xg_maybe_add_timer): Port to higher-res time stamps.
4341         * image.c (prepare_image_for_display, clear_image_cache)
4342         (lookup_image): Port to higer-resolution time stamps.
4344         * keyboard.c (start_polling, bind_polling_period):
4345         Check for time stamp overflow.
4346         (read_char, kbd_buffer_get_event, timer_start_idle)
4347         (timer_stop_idle, timer_resume_idle, timer_check_2, timer_check)
4348         (Fcurrent_idle_time, init_keyboard, set_waiting_for_input):
4349         Port to higher-resolution time stamps.  Do not assume time_t is signed.
4350         (decode_timer): New function.  Timers are now vectors of length 9,
4351         not 8, to accommodate the picosecond component.
4352         (timer_check_2): Use it.
4354         * nsterm.m (select_timeout, timeval_subtract): Remove.
4355         (ns_timeout): Use Emacs's facilities for time stamp arithmetic,
4356         as they're a bit more accurate and handle overflow better.
4357         (ns_select): Change prototype to be compatible with pselect.
4358         (ns_select, ns_term_shutdown): Port to ns-resolution time stamps.
4359         * nsterm.h (ns_select): Adjust prototype.
4361         * msdos.c (EMACS_TIME_ZERO_OR_NEG_P): Remove, as it assumes
4362         us-resolution time stamps.
4363         (sys_select): Use the new EMACS_TIME_SIGN macro instead.
4365         * lread.c (read_filtered_event): Port to ns-resolution time stamps.
4367         * lisp.h (time_overflow): New decl.
4368         (wait_reading_process_output): First arg is now intmax_t, not int,
4369         to accommodate larger waits.
4371         * process.h (struct Lisp_Process.read_output_delay):
4372         Now counts nanoseconds, not microseconds.
4373         * process.c (ADAPTIVE_READ_BUFFERING): Don't worry about
4374         EMACS_HAS_USECS.
4375         (READ_OUTPUT_DELAY_INCREMENT, Faccept_process_output)
4376         (wait_reading_process_output):
4377         Port to ns-resolution time stamps.
4378         (Faccept_process_output, wait_reading_process_output):
4379         Check for time stamp overflow.  Do not assume time_t is signed.
4380         (select_wrapper): Remove; we now use pselect.
4381         (Fprocess_attributes): Now generates ns-resolution time stamps.
4383         * sysdep.c: Include utimens.h.  Don't include utime.h
4384         or worry about struct utimbuf; gnulib does that for us now.
4385         (gettimeofday): Remove; gnulib provides a substitute.
4386         (make_timeval): New function.
4387         (set_file_times): Now sets ns-resolution time stamps.
4388         New arg FD; all uses changed.
4389         (time_from_jiffies, ltime_from_jiffies, get_up_time)
4390         (system_process_attributes):
4391         Now returns ns-resolution time stamp.  All uses changed.
4392         Check for time stamp overflow.
4394         * sysselect.h: Don't depend on HAVE_SYS_SELECT_H; gnulib
4395         provides a substitute now.
4397         * systime.h: Include timespec.h rather than sys/time.h and time.h,
4398         since it guarantees struct timespec.
4399         (EMACS_TIME): Now struct timespec, so that we can support
4400         ns-resolution time stamps.
4401         (EMACS_TIME_RESOLUTION, LOG10_EMACS_TIME_RESOLUTION): New macros.
4402         (EMACS_HAS_USECS): Remove; Emacs always has sub-second time stamps now.
4403         (EMACS_USECS): Remove.
4404         (EMACS_SET_USECS): The underlying time stamp now has ns resolution,
4405         so multiply the arg by 1000 before storing it.
4406         (EMACS_NSECS, EMACS_SECS_ADDR, EMACS_SET_NSECS, EMACS_SET_SECS_NSECS):
4407         New macros.
4408         (EMACS_GET_TIME, EMACS_ADD_TIME, EMACS_SUB_TIME):
4409         Port to ns-resolution time stamps.
4410         (EMACS_TIME_NEG_P): Remove; replaced by....
4411         (EMACS_TIME_SIGN): New macro.
4412         (EMACS_SET_INVALID_TIME, EMACS_TIME_VALID_P)
4413         (EMACS_TIME_FROM_DOUBLE, EMACS_TIME_TO_DOUBLE): New macros.
4414         (set_file_times, make_time, lisp_time_argument): Adjust signature.
4415         (make_timeval, make_lisp_time, decode_time_components): New decls.
4416         (EMACS_TIME_CMP): Remove; no longer used.  Plus, it was buggy, in
4417         that it mishandled time_t overflow.  You can't compare by subtracting!
4418         (EMACS_TIME_EQ, EMACS_TIME_NE, EMACS_TIME_GT, EMACS_TIME_GE)
4419         (EMACS_TIME_LT, EMACS_TIME_LE): Rewrite in terms of timespec_cmp.
4421         * term.c: Include <sys/time.h>.
4422         (timeval_to_Time): New function, for proper overflow wraparound.
4423         (term_mouse_position, term_mouse_click): Use it.
4425         * undo.c (record_first_change): Support higher-resolution time stamps
4426         in the undo buffer.
4427         (Fprimitive_undo): Use them when restoring time stamps.
4429         * w32.c (ltime, U64_TO_LISP_TIME, process_times, emacs_gnutls_pull)
4430         (w32_get_internal_run_time):
4431         Port to higher-resolution Emacs time stamps.
4432         (ltime): Now accepts single 64-bit integer, as that's more convenient
4433         for callers.
4435         * xdisp.c (start_hourglass): Port to ns-resolution time stamps.
4437         * xgselect.c, xgselect.h (xg_select): Add sigmask argument,
4438         for compatibility with pselect.  Support ns-resolution time stamps.
4440         * xmenu.c (x_menu_wait_for_event): Support ns-resolution time stamps.
4442         * xselect.c (wait_for_property_change, x_get_foreign_selection):
4443         Check for time stamp overflow, and support ns-resolution time stamps.
4445         * xterm.c: Don't include sys/time.h; gnulib does that for us now.
4446         Don't worry about whether HAVE_TIMEVAL and HAVE_SELECT are set.
4447         (timeval_subtract): Remove; no longer needed.
4448         (XTflash, XTring_bell, x_wait_for_event):
4449         Port to ns-resolution time stamps.  Don't assume time_t is signed.
4451 2012-06-22  Chong Yidong  <cyd@gnu.org>
4453         * xdisp.c (x_consider_frame_title): Revert last change.
4455 2012-06-22  Eli Zaretskii  <eliz@gnu.org>
4457         * alloc.c (NSTATICS): Enlarge to 0x650.  Otherwise, Emacs compiled
4458         with -DENABLE_CHECKING -DXASSERTS -DGLYPH_DEBUG=1 -DBYTE_CODE_METER
4459         aborts in staticpro during startup.  (Without -DBYTE_CODE_METER,
4460         staticidx goes up to 1597 out of 1600 = 0x640.)
4462 2012-06-20  Paul Eggert  <eggert@cs.ucla.edu>
4464         * fileio.c (Fdefault_file_modes): Block input while fiddling with umask.
4465         Otherwise, the umask might be mistakenly 0 while handling input signals.
4467 2012-06-19  Stefan Monnier  <monnier@iro.umontreal.ca>
4469         * minibuf.c (Fread_string): Bind minibuffer-completion-table.
4471 2012-06-19  Dmitry Antipov  <dmantipov@yandex.ru>
4473         * alloc.c, bytecode.c, ccl.c, coding.c, composite.c, data.c, dosfns.c:
4474         * font.c, image.c, keyboard.c, lread.c, menu.c, minibuf.c, msdos.c:
4475         * print.c, syntax.c, window.c, xmenu.c, xselect.c: Replace direct
4476         access to `contents' member of Lisp_Vector objects with AREF and ASET
4477         where appropriate.
4479 2012-06-19  Chong Yidong  <cyd@gnu.org>
4481         * frame.c (delete_frame): When selecting a frame on a different
4482         text terminal, do not alter the terminal's top-frame.
4484         * xdisp.c (format_mode_line_unwind_data): Record the target
4485         frame's selected window and its terminal's top-frame.
4486         (unwind_format_mode_line): Restore them.
4487         (x_consider_frame_title, display_mode_line, Fformat_mode_line):
4488         Callers changed.
4489         (x_consider_frame_title): Do not condition on HAVE_WINDOW_SYSTEM,
4490         since tty frames can be explicitly named.
4491         (prepare_menu_bars): Likewise.
4493         * term.c (Ftty_top_frame): New function.
4495 2012-06-18  Paul Eggert  <eggert@cs.ucla.edu>
4497         Port byte-code-meter to modern targets.
4498         * bytecode.c (METER_CODE) [BYTE_CODE_METER]: Don't assume
4499         !CHECK_LISP_OBJECT_TYPE && !USE_LSB_TAG.  Problem with
4500         CHECK_LISP_OBJECT_TYPE reported by Dmitry Antipov in
4501         <http://lists.gnu.org/archive/html/emacs-devel/2012-06/msg00282.html>.
4502         (METER_1, METER_2): Simplify.
4504 2012-06-18  Stefan Monnier  <monnier@iro.umontreal.ca>
4506         * data.c (Fdefalias): Return `symbol' (bug#11686).
4508 2012-06-18  Martin Rudalics  <rudalics@gmx.at>
4510         * buffer.c (Fkill_buffer): Don't throw an error when the buffer
4511         gets killed during executing of this function (Bug#11665).
4512         Try to always return Qt when the buffer has been actually killed.
4513         (Vkill_buffer_query_functions): In doc-string say that functions
4514         run by this hook should not change the current buffer.
4516 2012-06-18  Paul Eggert  <eggert@cs.ucla.edu>
4518         Fix recently-introduced process.c problems found by static checking.
4519         * process.c (write_queue_push, write_queue_pop, send_process):
4520         Use ptrdiff_t, not int or EMACS_INT, for buffer lengths and offsets.
4521         (write_queue_pop): Fix pointer signedness problem.
4522         (send_process): Remove unused local.
4524 2012-06-17  Chong Yidong  <cyd@gnu.org>
4526         * xdisp.c (redisplay_internal): No need to redisplay terminal
4527         frames that are not on top.
4529 2012-06-17  Troels Nielsen  <bn.troels@gmail.com>
4531         * process.c (make_process): Initialize write_queue.
4532         (write_queue_push, write_queue_pop): New functions.
4533         (send_process): Use them to maintain correct ordering of process
4534         writes (Bug#10815).
4536 2012-06-17  Paul Eggert  <eggert@cs.ucla.edu>
4538         * lisp.h (eassert): Assume C89 or later.
4539         This removes the need for CHECK.
4540         (CHECK): Remove.  Its comments about always evaluating its
4541         argument were confusing, as 'eassert' typically does not evaluate
4542         its argument.
4544         * coding.c (produce_chars): Use ptrdiff_t, not int.
4546         * xterm.c (x_draw_underwave): Check for integer overflow.
4547         This pacifies gcc 4.7.0 -Wunsafe-loop-optimizations on x86-64.
4549 2012-06-17  Jan Djärv  <jan.h.d@swipnet.se>
4551         * nsterm.m (x_free_frame_resources): Move xfree so freed memory isn't
4552         referenced (Bug#11583).
4554 2012-06-16  Aurelien Aptel  <aurelien.aptel@gmail.com>
4556         Implement wave-style variant of underlining.
4557         * dispextern.h (face_underline_type): New enum.
4558         (face): Add field for underline type.
4559         * nsterm.m (ns_draw_underwave): New function.
4560         (ns_draw_text_decoration): Use it.
4561         * w32term.c (w32_restore_glyph_string_clip, w32_draw_underwave):
4562         New functions.
4563         (x_draw_glyph_string): Use them.
4564         * xfaces.c (Qline, Qwave): New Lisp objects.
4565         (check_lface_attrs, merge_face_ref)
4566         (Finternal_set_lisp_face_attribute, realize_x_face):
4567         Handle wave-style underline face attributes.
4568         * xterm.c (x_draw_underwave): New function.
4569         (x_draw_glyph_string): Use it.
4571 2012-06-16  Juanma Barranquero  <lekktu@gmail.com>
4573         * makefile.w32-in ($(BLD)/emacs.$(O), $(BLD)/fringe.$(O))
4574         ($(BLD)/xml.$(O), $(BLD)/intervals.$(O), $(BLD)/macros.$(O))
4575         ($(BLD)/minibuf.$(O), $(BLD)/regex.$(O), $(BLD)/region-cache.$(O))
4576         ($(BLD)/textprop.$(O), $(BLD)/undo.$(O), $(BLD)/window.$(O))
4577         ($(BLD)/w32select.$(O)): Update dependencies.
4579 2012-06-16  Andreas Schwab  <schwab@linux-m68k.org>
4581         * buffer.h (FETCH_MULTIBYTE_CHAR): Define as inline.
4582         (BUF_FETCH_MULTIBYTE_CHAR): Likewise.
4583         * character.c (_fetch_multibyte_char_p): Remove.
4584         * alloc.c: Include "character.h" before "buffer.h".
4585         * bidi.c: Likewise.
4586         * buffer.c: Likewise.
4587         * bytecode.c: Likewise.
4588         * callint.c: Likewise.
4589         * callproc.c: Likewise.
4590         * casefiddle.c: Likewise.
4591         * casetab.c: Likewise.
4592         * category.c: Likewise.
4593         * cmds.c: Likewise.
4594         * coding.c: Likewise.
4595         * composite.c: Likewise.
4596         * dired.c: Likewise.
4597         * dispnew.c: Likewise.
4598         * doc.c: Likewise.
4599         * dosfns.c: Likewise.
4600         * editfns.c: Likewise.
4601         * emacs.c: Likewise.
4602         * fileio.c: Likewise.
4603         * filelock.c: Likewise.
4604         * font.c: Likewise.
4605         * fontset.c: Likewise.
4606         * fringe.c: Likewise.
4607         * indent.c: Likewise.
4608         * insdel.c: Likewise.
4609         * intervals.c: Likewise.
4610         * keyboard.c: Likewise.
4611         * keymap.c: Likewise.
4612         * lread.c: Likewise.
4613         * macros.c: Likewise.
4614         * marker.c: Likewise.
4615         * minibuf.c: Likewise.
4616         * nsfns.m: Likewise.
4617         * nsmenu.m: Likewise.
4618         * print.c: Likewise.
4619         * process.c: Likewise.
4620         * regex.c: Likewise.
4621         * region-cache.c: Likewise.
4622         * search.c: Likewise.
4623         * syntax.c: Likewise.
4624         * term.c: Likewise.
4625         * textprop.c: Likewise.
4626         * undo.c: Likewise.
4627         * unexsol.c: Likewise.
4628         * w16select.c: Likewise.
4629         * w32fns.c: Likewise.
4630         * w32menu.c: Likewise.
4631         * window.c: Likewise.
4632         * xdisp.c: Likewise.
4633         * xfns.c: Likewise.
4634         * xmenu.c: Likewise.
4635         * xml.c: Likewise.
4636         * xselect.c: Likewise.
4638 2012-06-16  Eli Zaretskii  <eliz@gnu.org>
4640         * xdisp.c (set_cursor_from_row): Don't dereference glyphs_end.
4641         If all the glyphs of the glyph row came from strings, and we have no
4642         cursor positioning clues, put the cursor on the first glyph of the
4643         row.
4644         (handle_face_prop): Use chunk-relative overlay string index when
4645         indexing into it->string_overlays array.  (Bug#11653)
4646         (set_cursor_from_row): Use the leftmost glyph as GLYPH_BEFORE, not
4647         the rightmost.  (Bug#11720)
4649 2012-06-16  Andreas Schwab  <schwab@linux-m68k.org>
4651         * category.h (CHAR_HAS_CATEGORY): Define as inline.
4652         (CATEGORY_MEMBER): Enforce 1/0 value.
4653         * category.c (_temp_category_set): Remove.
4655 2012-06-16  Eli Zaretskii  <eliz@gnu.org>
4657         * window.c (Fdelete_other_windows_internal)
4658         (Fdelete_window_internal): Don't access frame's mouse highlight
4659         info of the initial frame.  (Bug#11677)
4661 2012-06-14  Paul Eggert  <eggert@cs.ucla.edu>
4663         * .gdbinit (xgetint): Fix recently-introduced paren typo.
4664         Assume USE_2_TAGS_FOR_INTS.
4665         (xreload): Adjust $tagmask width to match recent lisp.h change.
4667         Simplify lisp.h in minor ways that should not affect code.
4668         * lisp.h (USE_2_TAGS_FOR_INTS): Remove, as it was always defined.
4669         (LISP_INT_TAG, case_Lisp_Int, LISP_STRING_TAG, LISP_INT_TAG_P)
4670         (LISP_INT1_TAG, enum Lisp_Type, XINT, XUINT, make_number):
4671         Simplify under the assumption that USE_2_TAGS_FOR_INTS is defined.
4672         (INTTYPEBITS): New macro, for clarity.
4673         (INTMASK, MOST_POSITIVE_FIXNUM): Use it.
4674         (LISP_INT1_TAG, LISP_STRING_TAG, LISP_INT_TAG_P):
4675         Simplify now that USE_LSB_TAG is always defined.
4676         (TYPEMASK, XINT) [USE_LSB_TAG]: Remove unnecessary cast.
4677         (make_number) [!USE_LSB_TAG]: Use INTMASK; that's simpler.
4679 2012-06-13  Juanma Barranquero  <lekktu@gmail.com>
4681         * makefile.w32-in ($(BLD)/data.$(O)): Update dependencies.
4683 2012-06-13  Glenn Morris  <rgm@gnu.org>
4685         * s/bsd-common.h (BSD4_3):
4686         * s/usg5-4-common.h (USG5_4): No longer define; unused.
4688 2012-06-13  Andreas Schwab  <schwab@linux-m68k.org>
4690         * lisp.h (Lisp_Object) [CHECK_LISP_OBJECT_TYPE]: Define as struct
4691         instead of union.
4692         (XLI, XIL): Define.
4693         (XHASH, XTYPE, XINT, XUINT, make_number, XSET, XPNTR, XUNTAG):
4694         Use them.
4695         * emacs.c (gdb_use_struct): Rename from gdb_use_union.
4696         * .gdbinit: Check gdb_use_struct instead of gdb_use_union.
4697         * alloc.c (widen_to_Lisp_Object): Remove.
4698         (mark_memory): Use XIL instead of widen_to_Lisp_Object.
4699         * frame.c (delete_frame): Remove outdated comment.
4700         * w32fns.c (Fw32_register_hot_key): Use XLI instead of checking
4701         USE_LISP_UNION_TYPE.
4702         (Fw32_unregister_hot_key): Likewise.
4703         (Fw32_toggle_lock_key): Likewise.
4704         * w32menu.c (add_menu_item): Likewise.
4705         (w32_menu_display_help): Use XIL instead of checking
4706         USE_LISP_UNION_TYPE.
4707         * w32heap.c (allocate_heap): Don't check USE_LISP_UNION_TYPE.
4708         (init_heap): Likewise.
4709         * w32term.c (w32_read_socket): Update comment.
4711 2012-06-13  Glenn Morris  <rgm@gnu.org>
4713         * s/usg5-4-common.h, src/s/unixware.h:
4714         Remove define/undef of HAVE_SYSV_SIGPAUSE (not used since 2010-05-04).
4716         * s/gnu.h (POSIX_SIGNALS): Remove (not used since 2010-05-04).
4718 2012-06-13  Paul Eggert  <eggert@cs.ucla.edu>
4720         USE_LISP_UNION_TYPE + USE_LSB_TAG cleanup (Bug#11604)
4721         * alloc.c (make_number) [!defined make_number]:
4722         Remove, as lisp.h always defines this now.
4723         (mark_maybe_pointer): Simplify since USE_LSB_TAG is always defined now.
4724         (roundup_size): Verify that it is a power of 2.
4725         * data.c (Fmake_variable_buffer_local, Fmake_local_variable):
4726         * ftfont.c (ftfont_driver): Use LISP_INITIALLY_ZERO.
4727         * lisp.h (USE_LSB_TAG): Allow the builder to compile with
4728         -DUSE_LSB_TAG=0, to override the automatically-selected default.
4729         USE_LSB_TAG now is always defined to be either 0 or 1.
4730         All uses changed.
4731         (union Lisp_Object): Don't worry about WORDS_BIGENDIAN; the
4732         code works fine either way, and efficiency is not a concern here,
4733         as the union type is for debugging, not for production.
4734         (LISP_MAKE_RVALUE, make_number) [USE_LISP_UNION_TYPE]:
4735         Use an inline function on all platforms when using the union type,
4736         since this is simpler and 'static inline' can be used portably
4737         within Emacs now.
4738         (LISP_INITIALLY_ZERO): New macro.
4739         (XFASTINT, XSETFASTINT) [USE_LISP_UNION_TYPE]: Remove.
4740         (XSET) [USE_LISP_UNION_TYPE]: Don't overparenthesize.
4742 2012-06-12  Glenn Morris  <rgm@gnu.org>
4744         * s/gnu-kfreebsd.h, s/hpux11.h, s/openbsd.h, s/sol2-10.h: Remove files.
4746         * s/gnu-linux.h (HAVE_PROCFS): Move to configure.
4748         * s/hpux10-20.h, s/openbsd.h, s/usg5-4-common.h:
4749         Move BROKEN_SIGIO to configure.
4751         * s/bsd-common.h, s/darwin.h, s/gnu-kfreebsd.h, s/hpux10-20.h:
4752         Move NO_TERMIO to configure.
4754 2012-06-12  Chong Yidong  <cyd@gnu.org>
4756         * image.c (imagemagick_load_image): Use MagickFlattenImage if
4757         MagickMergeImageLayers is undefined.  Use pixel pusher loop if
4758         MagickExportImagePixels is undefined.
4760 2012-06-12  Paul Eggert  <eggert@cs.ucla.edu>
4762         * image.c (imagemagick_load_image): Remove unused label.
4764 2012-06-11  Glenn Morris  <rgm@gnu.org>
4766         * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
4767         * s/gnu-kfreebsd.h, s/gnu-linux.h, s/gnu.h, s/hpux10-20.h:
4768         * s/irix6-5.h, s/ms-w32.h, s/msdos.h, s/template.h:
4769         * s/usg5-4-common.h: Move SYSTEM_TYPE to configure.
4771 2012-06-11  Stefan Monnier  <monnier@iro.umontreal.ca>
4773         * alloc.c (make_byte_code): New function.
4774         (Fmake_byte_code): Use it.  Don't purify here.
4775         * lread.c (read1): Use it as well to avoid extra allocation.
4777 2012-06-11  Chong Yidong  <cyd@gnu.org>
4779         * image.c (imagemagick_load_image): Implement transparency.
4781 2012-06-10  Andreas Schwab  <schwab@linux-m68k.org>
4783         * regex.c (at_begline_loc_p): Also recognize `(?N:' and correctly
4784         account for preceding backslashes.  (Bug#11663)
4786 2012-06-09  Chong Yidong  <cyd@gnu.org>
4788         * term.c: Support italics in capable terminals (Bug#9652).
4789         (no_color_bit): Replace unused NC_BLINK with NC_ITALIC.
4790         (turn_on_face): Output using TS_enter_italic_mode if available.
4791         Don't handle unused blinking and alt-charset cases.
4792         (turn_off_face): Handle italic case; discard unused tty_blinking_p
4793         and tty_alt_charset_p cases.
4794         (tty_capable_p, init_tty): Support italics.
4796         * termchar.h (struct tty_display_info): Add field for italics.
4797         Remove unused blink field.
4799         * xfaces.c (tty_supports_face_attributes_p, realize_tty_face):
4800         Handle slant.
4802         * dispextern.h: Replace unused TTY_CAP_BLINK with TTY_CAP_ITALIC.
4803         (struct face): Remove unused fields tty_dim_p, tty_blinking_p, and
4804         tty_alt_charset_p.  Add tty_italic_p.
4806 2012-06-09  Michael Albinus  <michael.albinus@gmx.de>
4808         * dbusbind.c (XD_BASIC_DBUS_TYPE): Use dbus_type_is_valid and
4809         dbus_type_is_basic if available.
4810         (xd_extract_signed, xd_extract_unsigned): Rename from
4811         extract_signed and extract_unsigned, respectively.  Adapt callers.
4813 2012-06-09  Chong Yidong  <cyd@gnu.org>
4815         * xfaces.c (face_for_overlay_string): Handle face remapping (Bug#2066).
4817         * fringe.c (Fset_fringe_bitmap_face): Handle the noninteractive
4818         case (Bug#9752).
4820 2012-06-08  Paul Eggert  <eggert@cs.ucla.edu>
4822         * xdisp.c (vmessage): Treat frame message as multibyte.
4823         Without this change, (let ((§ 1)) (make-variable-buffer-local '§))
4824         would generate the diagnostic "Making \302\247 buffer-local while
4825         let-bound!".
4827 2012-06-08  Eli Zaretskii  <eliz@gnu.org>
4829         * dispnew.c (showing_window_margins_p): Undo last change, which
4830         was done due to an inadvertent commit.
4831         (adjust_frame_glyphs_for_frame_redisplay): Do call
4832         showing_window_margins_p.
4834 2012-06-08  Stefan Monnier  <monnier@iro.umontreal.ca>
4836         * eval.c (Fmake_var_non_special): New primitive.
4837         (syms_of_eval): Defsubr it.
4838         * lread.c (syms_of_lread): Mark `values' as lexically scoped.
4840 2012-06-08  Juanma Barranquero  <lekktu@gmail.com>
4842         * dispnew.c (showing_window_margins_p): Wrap in #if 0 to prevent unused
4843         function warning (the only call is inside #if 0 since revno:108521).
4845 2012-06-08  Eli Zaretskii  <eliz@gnu.org>
4847         * alloc.c (allocate_vectorlike): Fix last change.
4849 2012-06-08  Dmitry Antipov  <dmantipov@yandex.ru>
4851         Block-based vector allocation of small vectors.
4852         * lisp.h (struct vectorlike_header): New field `nbytes',
4853         adjust comment accordingly.
4854         * alloc.c (enum mem_type): New type `MEM_TYPE_VECTOR_BLOCK'
4855         to denote vector blocks. Adjust users (live_vector_p,
4856         mark_maybe_pointer, valid_lisp_object_p) accordingly.
4857         (COMMON_MULTIPLE): Move outside #if USE_LSB_TAG.
4858         (VECTOR_BLOCK_SIZE, vroundup, VECTOR_BLOCK_BYTES),
4859         (VBLOCK_BYTES_MIN, VBLOCK_BYTES_MAX, VECTOR_MAX_FREE_LIST_INDEX),
4860         (VECTOR_FREE_LIST_FLAG, ADVANCE, VINDEX, SETUP_ON_FREE_LIST),
4861         (VECTOR_SIZE, VECTOR_IN_BLOCK): New macros.
4862         (roundup_size): New constant.
4863         (struct vector_block): New data type.
4864         (vector_blocks, vector_free_lists, zero_vector): New variables.
4865         (all_vectors): Rename to `large_vectors'.
4866         (allocate_vector_from_block, init_vectors, allocate_vector_from_block)
4867         (sweep_vectors): New functions.
4868         (allocate_vectorlike): Return `zero_vector' as the only vector of
4869         0 items. Allocate new vector from block if vector size is less than
4870         or equal to VBLOCK_BYTES_MAX.
4871         (Fgarbage_collect): Move all vector sweeping code to sweep_vectors.
4872         (init_alloc_once): Add call to init_vectors.
4874 2012-06-08  Stefan Monnier  <monnier@iro.umontreal.ca>
4876         * eval.c (Fmacroexpand): Stop if the macro returns the same form.
4878 2012-06-07  Paul Eggert  <eggert@cs.ucla.edu>
4880         * doprnt.c (doprnt): Truncate multibyte char correctly.
4881         Without this change, doprnt (buf, 2, "%s", FORMAT_END, AP)
4882         would mishandle a string argument "Xc" if X was a multibyte
4883         character of length 2: it would truncate after X's first byte
4884         rather than including all of X.
4886 2012-06-06  Chong Yidong  <cyd@gnu.org>
4888         * buffer.c (word_wrap): Doc fix.
4890 2012-06-04  Paul Eggert  <eggert@cs.ucla.edu>
4892         * xdisp.c (note_mode_line_or_margin_highlight): Pacify gcc -Wall.
4894 2012-06-03  Glenn Morris  <rgm@gnu.org>
4896         * xdisp.c (tool-bar-style): Doc fix.
4898 2012-06-03  Ulrich Müller  <ulm@gentoo.org>
4900         * Makefile.in (PAXCTL): Define.
4901         (temacs$(EXEEXT)): Disable memory randomization for the temacs
4902         binary via PaX flags if the paxctl utility is available.
4903         (emacs$(EXEEXT), bootstrap-emacs$(EXEEXT)):
4904         Restore PaX flags to their default.  (Bug#11398)
4906 2012-06-03  Chong Yidong  <cyd@gnu.org>
4908         * xdisp.c (decode_mode_spec_coding): Display a space for a unibyte
4909         buffer (Bug#11226).
4911 2012-06-03  Chong Yidong  <cyd@gnu.org>
4913         * xdisp.c (calc_pixel_width_or_height): Use Fbuffer_local_value.
4914         (note_mode_line_or_margin_highlight): If there is no help echo,
4915         use mode-line-default-help-echo.  Handle the case where the mouse
4916         position is past the end of the mode line string.
4918         * buffer.c (buffer_local_value_1): New function, split from
4919         Fbuffer_local_value; can return Qunbound.
4920         (Fbuffer_local_value): Use it.
4921         (Vmode_line_format): Docstring tweaks.
4923 2012-06-02  Paul Eggert  <eggert@cs.ucla.edu>
4925         * sysdep.c (system_process_attributes): Improve comment.
4927 2012-06-02  Stefan Monnier  <monnier@iro.umontreal.ca>
4929         * keyboard.c: Export real-this-command to Elisp.
4930         (syms_of_keyboard): Rename real_this_command to Vreal_this_command
4931         and DEFVAR it.  Update all users.
4933 2012-06-02  Paul Eggert  <eggert@cs.ucla.edu>
4935         * minibuf.c (Fassoc_string): Remove duplicate declaration.
4937         * sysdep.c (system_process_attributes) [SOLARIS2 && HAVE_PROCFS]:
4938         Convert pctcpu and pctmem to Lisp float properly.
4939         Let the compiler fold better, as 100.0/0x8000 is exact.
4941 2012-06-02  Andreas Schwab  <schwab@linux-m68k.org>
4943         * alloc.c (CONS_BLOCK_SIZE): Account for padding at the end of
4944         cons_block.
4946 2012-06-01  Paul Eggert  <eggert@cs.ucla.edu>
4948         * xfns.c (x_set_tool_bar_lines) [USE_GTK]: Adjust to bitfield change.
4950 2012-06-01  Dmitry Antipov  <dmantipov@yandex.ru>
4952         For a 'struct window', replace some Lisp_Object fields to
4953         bitfields where appropriate, remove unused fields.
4954         * window.h (struct window): Remove unused 'last_mark_x' and
4955         'last_mark_y' fields.  Rename 'mini_p' field to 'mini',
4956         change it's type from Lisp_Object to bitfield.
4957         Change type of 'force_start', 'optional_new_start',
4958         'last_had_star', 'update_mode_line' and 'start_at_line_beg'
4959         fields from Lisp_Object to bitfield. Adjust users accordingly.
4961 2012-05-31  Paul Eggert  <eggert@cs.ucla.edu>
4963         Pacify gcc -Wdouble-precision when using Xaw.
4964         * xterm.c (xaw_jump_callback, x_set_toolkit_scroll_bar_thumb)
4965         [HAVE_X_WINDOWS && USE_TOOLKIT_SCROLL_BARS && !USE_MOTIF && !USE_GTK]:
4966         Use 'float' consistently, rather than 'float' in most places
4967         and 'double' in a couple of places.
4969 2012-05-31  Eli Zaretskii  <eliz@gnu.org>
4971         * xdisp.c (handle_stop): Detect whether we have overlay strings
4972         loaded by testing it->current.overlay_string_index to be
4973         non-negative, instead of checking whether n_overlay_strings is
4974         positive.  (Bug#11587)
4976 2012-05-31  Chong Yidong  <cyd@gnu.org>
4978         * keymap.c (describe_map_tree): Revert 2011-07-07 change (Bug#1169).
4980         * doc.c (Fsubstitute_command_keys): Doc fix.
4982 2012-05-31  Eli Zaretskii  <eliz@gnu.org>
4984         * search.c (search_buffer): Remove calls to
4985         r_alloc_inhibit_buffer_relocation, as it is now called by
4986         maybe_unify_char, which was the cause of relocation of buffer text
4987         in bug#11519.
4989 2012-05-31  Eli Zaretskii  <eliz@gnu.org>
4991         * charset.c (maybe_unify_char): Inhibit relocation of buffer text
4992         for the duration of call to load_charset, to avoid problems with
4993         callers of maybe_unify_char that access buffer text through C
4994         pointers.
4996         * ralloc.c (r_alloc_inhibit_buffer_relocation): Increment and
4997         decrement the inhibition flag, instead of just setting or
4998         resetting it.
5000 2012-05-31  Paul Eggert  <eggert@cs.ucla.edu>
5002         Remove obsolete '#define static' cruft.
5003         * s/hpux10-20.h (_FILE_OFFSET_BITS): Don't #undef.
5004         This #undef was "temporary" in 2000; it is no longer needed
5005         now that '#define static' has gone away.
5006         * xfns.c, xterm.h (gray_bitmap_width, gray_bitmap_height)
5007         (gray_bitmap_bits): Remove; no longer needed.
5008         All uses replaced with definiens.
5009         * xterm.c: Include "bitmaps/gray.xbm".
5011 2012-05-30  Paul Eggert  <eggert@cs.ucla.edu>
5013         Clean up __executable_start, monstartup when --enable-profiling.
5014         The following changes affect the code only when profiling.
5015         * dispnew.c (__executable_start): Rename from safe_bcopy.
5016         Define only on platforms that need it.
5017         * emacs.c: Include <sys/gmon.h> when profiling.
5018         (_mcleanup): Remove decl, since <sys/gmon.h> does it now.
5019         (__executable_start): Remove decl, since lisp.h does it now.
5020         (safe_bcopy): Remove decl; no longer has that name.
5021         (main): Coalesce #if into single bit of code, for simplicity.
5022         Cast pointers to uintptr_t, since standard libraries want integers
5023         and not pointers.
5024         * lisp.h (__executable_start): New decl.
5026 2012-05-31  Glenn Morris  <rgm@gnu.org>
5028         * image.c (Fimagemagick_types): Doc fix.
5030 2012-05-30  Jim Meyering  <meyering@redhat.com>
5032         * callproc.c (Fcall_process_region): Include directory component
5033         in mkstemp error message (Bug#11586).
5035 2012-05-30  Paul Eggert  <eggert@cs.ucla.edu>
5037         * alloc.c, lisp.h (make_pure_vector): Now static.
5039 2012-05-30  Stefan Monnier  <monnier@iro.umontreal.ca>
5041         * eval.c (Fdefun, Fdefmacro, Vmacro_declaration_function):
5042         Move to byte-run.el.
5043         (Fautoload): Do the hash-doc more carefully.
5044         * data.c (Fdefalias): Purify definition, except for keymaps.
5045         (Qdefun): Move from eval.c.
5046         * lisp.h (Qdefun): Remove.
5047         * lread.c (read1): Tiny simplification.
5049 2012-05-29  Troels Nielsen  <bn.troels@gmail.com>
5051         Do not create empty overlays with the evaporate property (Bug#9642).
5052         * buffer.c (Fmove_overlay): Reinstate the earlier fix for
5053         Bug#9642, but explicitly check that the buffer the overlay would
5054         be moved to is live and rearrange lines to make sure that errors
5055         will not put the overlay in an inconsistent state.
5056         (Fdelete_overlay): Cosmetics.
5058 2012-05-28  Eli Zaretskii  <eliz@gnu.org>
5060         * w32term.c (my_bring_window_to_top): New function.
5061         (x_raise_frame): Use handle returned by DeferWindowPos, which
5062         could be different from the original one.
5063         Call my_bring_window_to_top instead of my_set_foreground_window.
5064         (Bug#11513)
5066         * w32fns.c (w32_wnd_proc): Accept and process WM_EMACS_BRINGTOTOP
5067         by calling BringWindowToTop.
5069         * w32term.h (WM_EMACS_BRINGTOTOP): New message.
5070         (WM_EMACS_END): Increase by one.
5072 2012-05-28  Paul Eggert  <eggert@cs.ucla.edu>
5074         * bidi.c (bidi_mirror_char): Put eassert before conversion to int.
5075         This avoids undefined behavior that might cause the eassert
5076         to not catch an out-of-range value.
5078 2012-05-28  Juanma Barranquero  <lekktu@gmail.com>
5080         * makefile.w32-in ($(BLD)/w32inevt.$(O), $(BLD)/w32console.$(O)):
5081         Update dependencies.
5083 2012-05-27  Eli Zaretskii  <eliz@gnu.org>
5085         * bidi.c (bidi_mirror_char): Fix last change.
5087 2012-05-27  Andreas Schwab  <schwab@linux-m68k.org>
5089         * unexmacosx.c (copy_data_segment): Truncate after 16 characters
5090         when referring to sectname field in printf format.
5092 2012-05-27  Paul Eggert  <eggert@cs.ucla.edu>
5094         * lisp.h [REL_ALLOC]: Omit duplicate prototypes.
5095         Only r_alloc_inhibit_buffer_relocation needed to be added;
5096         the others were already declared.
5098         * bidi.c (bidi_mirror_char): Don't possibly truncate the integer
5099         before checking whether it's out of range.  Put the check inside
5100         eassert.  See
5101         <http://lists.gnu.org/archive/html/emacs-devel/2012-05/msg00485.html>.
5103 2012-05-27  Ken Brown  <kbrown@cornell.edu>
5105         * callproc.c (Fcall_process): Restore a line that was accidentally
5106         commented out in the 2011-02-13 change (bug#11547).
5108 2012-05-27  Eli Zaretskii  <eliz@gnu.org>
5110         * lisp.h [REL_ALLOC]: Add prototypes for external functions
5111         defined on ralloc.c.
5113         * buffer.c [REL_ALLOC]: Remove prototypes of
5114         r_alloc_reset_variable, r_alloc, r_re_alloc, and r_alloc_free,
5115         they are now on lisp.h.
5117         * ralloc.c (r_alloc_inhibit_buffer_relocation): New function.
5119         * search.c (search_buffer): Use it to inhibit relocation of buffer
5120         text while re_search_2 is doing its job, because re_search_2 is
5121         passed C pointers to buffer text.  (Bug#11519)
5123         * msdos.c (internal_terminal_init) <Vwindow_system_version>:
5124         Update value to 24.
5126         * xdisp.c (move_it_to): Under MOVE_TO_Y, when restoring iterator
5127         state after an additional call to move_it_in_display_line_to, keep
5128         the values of it->max_ascent and it->max_descent found for the
5129         entire line.
5130         (pos_visible_p): Revert the comparison against bottom_y to what it
5131         was in revid eliz@gnu.org-20120513182235-4p6386j761ld0nwb.
5132         (Bug#11464)
5134 2012-05-26  Paul Eggert  <eggert@cs.ucla.edu>
5136         Fix coding-related core dumps with gcc -ftrapv.
5137         The code was computing A - B, where A and B are pointers, and B is
5138         random garbage.  This can lead to core dumps on platforms that
5139         have special pointer registers, and it also leads to core dumps on
5140         x86-64 when compiled with gcc -ftrapv.  The fix is to compute
5141         A - B only when B is initialized properly.
5142         * coding.c (coding_set_source, coding_set_destination): Return void.
5143         (coding_change_source, coding_change_destinations): New functions,
5144         with the old behaviors of coding_set_source and coding_set_destination.
5145         All callers that need an offset changed to use these new functions.
5147 2012-05-26  Glenn Morris  <rgm@gnu.org>
5149         * nsterm.m (ns_init_paths): Don't mess with INFOPATH.  (Bug#2791)
5151 2012-05-26  Eli Zaretskii  <eliz@gnu.org>
5153         Extend mouse support on W32 text-mode console.
5154         * xdisp.c (draw_row_with_mouse_face):
5155         Call tty_draw_row_with_mouse_face for WINDOWSNT as well.
5157         * w32console.c: Include window.h.
5158         (w32con_write_glyphs_with_face, tty_draw_row_with_mouse_face):
5159         New functions.
5160         (initialize_w32_display): Initialize mouse-highlight data.
5162         * w32inevt.c: Include termchar.h and window.h.
5163         (do_mouse_event): Support mouse-autoselect-window.  When the mouse
5164         moves, call note_mouse_highlight.  If help_echo changed, call
5165         gen_help_event to produce help-echo message in the echo area.
5166         Call clear_mouse_face if mouse_face_hidden is set in the mouse
5167         highlight info.
5169 2012-05-26  Paul Eggert  <eggert@cs.ucla.edu>
5171         * lread.c (read1): Simplify slightly to avoid an overflow warning
5172         with GCC 4.7.0 on x86-64.
5174 2012-05-26  Eli Zaretskii  <eliz@gnu.org>
5176         * bidi.c (bidi_mirror_char): Revert last change: an int is
5177         definitely wide enough here.
5179 2012-05-25  Paul Eggert  <eggert@cs.ucla.edu>
5181         Fix integer width and related bugs (Bug#9874).
5182         * alloc.c (pure_bytes_used_lisp, pure_bytes_used_non_lisp):
5183         (allocate_vectorlike, buffer_memory_full, struct sdata, SDATA_SIZE)
5184         (string_bytes, check_sblock, allocate_string_data):
5185         (compact_small_strings, Fmake_bool_vector, make_string)
5186         (make_unibyte_string, make_multibyte_string)
5187         (make_string_from_bytes, make_specified_string)
5188         (allocate_vectorlike, Fmake_vector, find_string_data_in_pure)
5189         (make_pure_string, make_pure_c_string, make_pure_vector, Fpurecopy)
5190         (mark_vectorlike):
5191         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5192         (allocate_pseudovector):
5193         Use int, not EMACS_INT, where int is wide enough.
5194         (inhibit_garbage_collection, Fgarbage_collect):
5195         Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5196         * bidi.c (bidi_mirror_char): Use EMACS_INT, not int, where
5197         int might not be wide enough.
5198         (bidi_cache_search, bidi_cache_find, bidi_init_it)
5199         (bidi_count_bytes, bidi_char_at_pos, bidi_fetch_char)
5200         (bidi_at_paragraph_end, bidi_find_paragraph_start)
5201         (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak)
5202         (bidi_level_of_next_char, bidi_move_to_visually_next):
5203         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5204         * buffer.c (copy_overlays, Fgenerate_new_buffer_name)
5205         (Fkill_buffer, Fset_buffer_major_mode)
5206         (advance_to_char_boundary, Fbuffer_swap_text)
5207         (Fset_buffer_multibyte, overlays_at, overlays_in)
5208         (overlay_touches_p, struct sortvec, record_overlay_string)
5209         (overlay_strings, recenter_overlay_lists)
5210         (adjust_overlays_for_insert, adjust_overlays_for_delete)
5211         (fix_start_end_in_overlays, fix_overlays_before, modify_overlay)
5212         (Fmove_overlay, Fnext_overlay_change, Fprevious_overlay_change)
5213         (Foverlay_recenter, last_overlay_modification_hooks_used)
5214         (report_overlay_modification, evaporate_overlays, enlarge_buffer_text):
5215         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5216         (validate_region): Omit unnecessary test for b <= e,
5217         since that's guaranteed by the previous test.
5218         (adjust_overlays_for_delete): Avoid pos + length overflow.
5219         (Fmove_overlay, Fdelete_overlay, add_overlay_mod_hooklist)
5220         (report_overlay_modification):
5221         Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5222         (Foverlays_at, Fnext_overlay_change, Fprevious_overlay_change):
5223         Omit pointer cast, which isn't needed anyway, and doesn't work
5224         after the EMACS_INT -> ptrdiff_t change.
5225         (Fmove_overlay): Clip BEG and END to ptrdiff_t to avoid overflow.
5226         * buffer.h: Adjust decls to match defn changes elsewhere.
5227         (struct buffer_text, struct buffer):
5228         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5229         Use EMACS_INT, not int, where int might not be wide enough.
5230         * bytecode.c (unmark_byte_stack, exec_byte_code): Use ptrdiff_t,
5231         not int, to avoid needless 32-bit limit on 64-bit hosts.
5232         (exec_byte_code): Use tighter memory-full test, one that checks
5233         for alloca overflow.  Don't compute the address of the object just
5234         before an array, as that's not portable.  Use EMACS_INT, not
5235         ptrdiff_t or int, where ptrdiff_t or int might not be wide enough.
5236         * callint.c (Fcall_interactively):
5237         Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5238         * callproc.c (call_process_kill, Fcall_process):
5239         Don't assume pid_t fits into an Emacs fixnum.
5240         (call_process_cleanup, Fcall_process, child_setup):
5241         Don't assume pid_t fits into int.
5242         (call_process_cleanup, Fcall_process, delete_temp_file)
5243         (Fcall_process_region):
5244         Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5245         (Fcall_process): Simplify handling of volatile integers.
5246         Use int, not EMACS_INT, where int will do.
5247         * casefiddle.c (casify_object, casify_region, operate_on_word)
5248         (Fupcase_word, Fdowncase_word, Fcapitalize_word):
5249         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5250         (casify_object): Avoid integer overflow when overallocating buffer.
5251         * casetab.c (set_identity, shuffle): Prefer int to unsigned when
5252         either works.  Use lint_assume to convince GCC 4.6.1 that it's OK.
5253         * category.c (Fchar_category_set): Don't assume fixnum fits in int.
5254         * category.h (CATEGORYP): Don't assume arg is nonnegative.
5255         * ccl.c (GET_CCL_INT): Remove; no longer needed, since the
5256         integers are now checked earlier.  All uses replaced with XINT.
5257         (ccl_driver):
5258         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5259         For CCL_MapSingle, check that content and value are in int range.
5260         (ccl_driver, Fregister_code_conversion_map):
5261         Check that Vcode_version_map_vector is a vector.
5262         (resolve_symbol_ccl_program): Check that vector header is in range.
5263         Always copy the vector, so that we can check its contents reliably
5264         now rather than having to recheck each instruction as it's being
5265         executed.  Check that vector words fit in 'int'.
5266         (ccl_get_compiled_code, Fregister_ccl_program)
5267         (Fregister_code_conversion_map): Use ptrdiff_t, not int, for
5268         program indexes, to avoid needless 32-bit limit on 64-bit hosts.
5269         (Fccl_execute, Fccl_execute_on_string): Check that initial reg
5270         contents are in range.
5271         (Fccl_execute_on_string): Check that status is in range.
5272         * ccl.h (struct ccl_program.idx): Now ptrdiff_t, not int.
5273         * character.c (char_resolve_modifier_mask, Fchar_resolve_modifiers):
5274         Accept and return EMACS_INT, not int, because callers can pass values
5275         out of 'int' range.
5276         (c_string_width, strwidth, lisp_string_width, chars_in_text)
5277         (multibyte_chars_in_text, parse_str_as_multibyte)
5278         (str_as_multibyte, count_size_as_multibyte, str_to_multibyte)
5279         (str_as_unibyte, str_to_unibyte, string_count_byte8)
5280         (string_escape_byte8, Fget_byte):
5281         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5282         (Funibyte_string): Use CHECK_RANGED_INTEGER, not CHECK_NATNUM, to
5283         avoid mishandling large integers.
5284         * character.h: Adjust decls to match defn changes elsewhere.
5285         * charset.c (load_charset_map_from_file, find_charsets_in_text)
5286         (Ffind_charset_region):
5287         Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5288         (load_charset_map_from_file): Redo idx calculation to avoid overflow.
5289         (load_charset_map_from_vector, Fdefine_charset_internal):
5290         Don't assume fixnum fits in int.
5291         (load_charset_map_from_vector, Fmap_charset_chars):
5292         Remove now-unnecessary CHECK_NATNUMs.
5293         (Fdefine_charset_internal): Check ranges here, more carefully.
5294         Don't rely on undefined behavior with signed left shift overflow.
5295         Don't assume unsigned int fits into fixnum, or that fixnum fits
5296         into unsigned int.  Don't require max_code to be a valid fixnum;
5297         that's not true for gb10830 4-byte on a 32-bit host.  Allow
5298         invalid_code to be a cons, for the same reason.  Require code_offset
5299         to be a character.  Avoid int overflow if max_char is close
5300         to INT_MAX.
5301         (CODE_POINT_TO_INDEX): On 32-bit hosts, return int, not unsigned;
5302         this is intended anyway and avoids some undefined behavior.
5303         (load_charset_map): Pass unsigned, not int, as 2nd arg of
5304         INDEX_TO_CODE_POINT, as that's what it expects.
5305         (Funify_charset, encode_char): Don't stuff unsigned vals into int vars.
5306         * charset.h (DECODE_CHAR): Return int, not unsigned;
5307         this is what was intended anyway, and it avoids undefined behavior.
5308         (CHARSET_OFFSET): Remove unused macro, instead of fixing its
5309         integer-overflow issues.
5310         (ENCODE_CHAR): Return unsigned on all hosts, not just on 32-bit hosts.
5311         Formerly, it returned EMACS_INT on 64-bit hosts in the common case
5312         where the argument is EMACS_INT, and this behavior is not intended.
5313         * chartab.c (Fmake_char_table, Fset_char_table_range)
5314         (uniprop_get_decoder, uniprop_get_encoder):
5315         Don't assume fixnum fits in int.
5316         * cmds.c (move_point): New function, that does the gist of
5317         Fforward_char and Fbackward_char, but does so while checking
5318         for integer overflow more accurately.
5319         (Fforward_char, Fbackward_char): Use it.
5320         (Fforward_line, Fend_of_line, internal_self_insert)
5321         (internal_self_insert):
5322         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5323         Fix a FIXME, by checking for integer overflow when calculating
5324         target_clm and actual_clm.
5325         * coding.c (detect_coding_XXX, encode_coding_XXX, CODING_DECODE_CHAR)
5326         (CODING_ENCODE_CHAR, CODING_CHAR_CHARSET, CODING_CHAR_CHARSET_P)
5327         (ASSURE_DESTINATION, coding_alloc_by_realloc)
5328         (coding_alloc_by_making_gap, alloc_destination)
5329         (detect_coding_utf_8, encode_coding_utf_8, decode_coding_utf_16)
5330         (encode_coding_utf_16, detect_coding_emacs_mule)
5331         (decode_coding_emacs_mule, encode_coding_emacs_mule)
5332         (detect_coding_iso_2022, decode_coding_iso_2022)
5333         (encode_invocation_designation, encode_designation_at_bol)
5334         (encode_coding_iso_2022, detect_coding_sjis, detect_coding_big5)
5335         (decode_coding_sjis, decode_coding_big5, encode_coding_sjis)
5336         (encode_coding_big5, detect_coding_ccl, decode_coding_ccl)
5337         (encode_coding_ccl, encode_coding_raw_text)
5338         (detect_coding_charset, decode_coding_charset)
5339         (encode_coding_charset, detect_eol, decode_eol, produce_chars)
5340         (produce_composition, produce_charset, produce_annotation)
5341         (decode_coding, handle_composition_annotation)
5342         (handle_charset_annotation, consume_chars, decode_coding_gap)
5343         (decode_coding_object, encode_coding_object, detect_coding_system)
5344         (Ffind_coding_systems_region_internal, Fcheck_coding_systems_region)
5345         (code_convert_region, code_convert_string)
5346         (Fdefine_coding_system_internal)
5347         (coding_set_source, coding_set_destination):
5348         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5349         (setup_iso_safe_charsets, consume_chars, Funencodable_char_position)
5350         (Fdefine_coding_system_internal):
5351         Don't assume fixnums fit in int.
5352         (decode_coding_gap, decode_coding_object, encode_coding_object)
5353         (Fread_coding_system, Fdetect_coding_region)
5354         (Funencodable_char_position, Fcheck_coding_systems_region)
5355         (get_translation, handle_composition_annotation, consume_chars):
5356         Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5357         (consume_chars): Rewrite to not calculate an address outside buffer.
5358         (Ffind_operation_coding_system): NATNUMP can eval its arg twice.
5359         Don't access memory outside of the args array.
5360         (Fdefine_coding_system_internal): Check for charset-id overflow.
5361         (ENCODE_ISO_CHARACTER): Use unsigned, not int, to store the unsigned
5362         result of ENCODE_CHAR.
5363         * coding.h: Adjust decls to match defn changes elsewhere.
5364         (struct coding_system):
5365         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5366         * composite.c (get_composition_id, find_composition)
5367         (run_composition_function, update_compositions)
5368         (compose_text, composition_gstring_put_cache)
5369         (composition_gstring_p, composition_gstring_width)
5370         (fill_gstring_header, fill_gstring_body, autocmp_chars)
5371         (composition_compute_stop_pos, composition_reseat_it)
5372         (composition_update_it, struct position_record)
5373         (find_automatic_composition, composition_adjust_point)
5374         (Fcomposition_get_gstring, Ffind_composition_internal):
5375         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5376         (update_compositions):
5377         Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5378         * composite.h: Adjust decls to match defn changes elsewhere.
5379         (struct composition):
5380         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5381         * data.c (let_shadows_buffer_binding_p, let_shadows_global_binding_p):
5382         Do not attempt to compute the address of the object just before a
5383         buffer; this is not portable.
5384         (Faref, Faset):
5385         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5386         (Faset): Use int, not EMACS_INT, where int is wide enough.
5387         (Fstring_to_number): Don't assume fixnums fit in int.
5388         (Frem): Don't assume arg is nonnegative.
5389         * dbusbind.c (xd_append_arg): Check for integers out of range.
5390         (Fdbus_call_method): Don't overflow the timeout int.
5391         (extract_signed, extract_unsigned): New functions.
5392         (XD_CHECK_DBUS_SERIAL): Remove; superseded by extract_unsigned.
5393         (xd_get_connection_references): Return ptrdiff_t, not int.
5394         All uses changed.
5395         (xd_signature, xd_append_arg, xd_retrieve_arg, Fdbus_message_internal)
5396         (xd_read_message_1):
5397         Use int, not unsigned, where the dbus API uses int.
5398         (Fdbus_message_internal): Don't overflow mtype.
5399         (syms_of_dbusbind): Allocate right-sized buffer for integers.
5400         * dired.c (directory_files_internal, file_name_completion, scmp)
5401         (file_name_completion_stat):
5402         Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5403         (file_name_completion): Don't overflow matchcount.
5404         (file_name_completion_stat): Use SAFE_ALLOCA, not alloca.
5405         * dispextern.h: Adjust decls to match defn changes elsewhere.
5406         (struct text_pos, struct glyph, struct bidi_saved_info)
5407         (struct bidi_string_data, struct bidi_it, struct composition_it)
5408         (struct it):
5409         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5410         (struct display_pos, struct composition_it, struct it):
5411         Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5412         * dispnew.c (increment_matrix_positions)
5413         (increment_row_positions, mode_line_string)
5414         (marginal_area_string):
5415         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5416         (change_frame_size_1, Fredisplay, Fframe_or_buffer_changed_p):
5417         Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5418         (duration_to_sec_usec): New function, to check for overflow better.
5419         (Fsleep_for, sit_for): Use it.
5420         * doc.c (get_doc_string, store_function_docstring):
5421         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5422         (get_doc_string, Fsnarf_documentation):
5423         Use int, not EMACS_INT, where int is wide enough.
5424         (get_doc_string):
5425         Use SAFE_ALLOCA, not alloca.
5426         Check for overflow when converting EMACS_INT to off_t.
5427         * doprnt.c (doprnt):
5428         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5429         * editfns.c (init_editfns, Fuser_uid, Fuser_real_uid):
5430         Don't assume uid_t fits into fixnum.
5431         (buildmark, Fgoto_char, overlays_around, find_field, Fdelete_field)
5432         (Ffield_string, Ffield_string_no_properties, Ffield_beginning)
5433         (Ffield_end, Fconstrain_to_field, Fline_beginning_position)
5434         (Fline_end_position, Fprevious_char, Fchar_after, Fchar_before)
5435         (general_insert_function)
5436         (Finsert_char, make_buffer_string, make_buffer_string_both)
5437         (update_buffer_properties, Fbuffer_substring)
5438         (Fbuffer_substring_no_properties, Fcompare_buffer_substrings)
5439         (Fsubst_char_in_region, check_translation)
5440         (Ftranslate_region_internal, save_restriction_restore, Fformat)
5441         (transpose_markers, Ftranspose_regions):
5442         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5443         (clip_to_bounds): Move to lisp.h as an inline function).
5444         (Fconstrain_to_field): Don't assume integers are nonnegative.
5445         (Fline_beginning_position, Fsave_excursion, Fsave_current_buffer):
5446         (Fsubst_char_in_region, Fsave_restriction):
5447         Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5448         (Femacs_pid): Don't assume pid_t fits into fixnum.
5449         (lo_time): Use int, not EMACS_INT, when int suffices.
5450         (lisp_time_argument): Check for usec out of range.
5451         (Fencode_time): Don't assume fixnum fits in int.
5452         (Fuser_login_name, Fuser_full_name): Signal an error
5453         if a uid argument is out of range, rather than relying on
5454         undefined behavior.
5455         (Fformat_time_string): Remove now-unnecessary check.
5456         lisp_time_argument checks for out-of-range usec now.
5457         Use ptrdiff_t, not size_t, where ptrdiff_t will do.
5458         * emacs.c (gdb_valbits, gdb_gctypebits): Now int, not EMACS_INT.
5459         (gdb_data_seg_bits): Now uintptr_t, not EMACS_INT.
5460         (PVEC_FLAG, gdb_array_mark_flag): Now ptrdiff_t, not EMACS_INT.
5461         (init_cmdargs, Fdump_emacs):
5462         Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5463         (Fkill_emacs): Don't assume fixnum fits in int; instead, take just
5464         the bottom (typically) 32 bits of the fixnum.
5465         * eval.c (specpdl_size, call_debugger):
5466         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5467         (when_entered_debugger, Fbacktrace_debug):
5468         Don't assume fixnum can fit in int.
5469         (Fdefvaralias, Fdefvar): Do not attempt to compute the address of
5470         the object just before a buffer; this is not portable.
5471         (FletX, Flet, Funwind_protect, do_autoload, Feval, funcall_lambda)
5472         (grow_specpdl, unbind_to):
5473         Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5474         (Fapply, apply_lambda): Don't assume ptrdiff_t can hold fixnum.
5475         (grow_specpdl): Simplify allocation by using xpalloc.
5476         (Fprog1, Fprog2): Don't assume list length fits in int.  Simplify.
5477         * fileio.c (Ffind_file_name_handler, Fcopy_file, Frename_file)
5478         (Finsert_file_contents, Fwrite_region, Fdo_auto_save):
5479         Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5480         (Ffind_file_name_handler, non_regular_inserted, Finsert_file_contents)
5481         (a_write, e_write):
5482         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5483         (Fcopy_file, non_regular_nbytes, read_non_regular)
5484         (Finsert_file_contents):
5485         Use int, not EMACS_INT, where int is wide enough.
5486         (READ_BUF_SIZE): Verify that it fits in int.
5487         (Finsert_file_contents): Check that counts are in proper range,
5488         rather than assuming fixnums fit into ptrdiff_t etc.
5489         Don't assume fixnums fit into int.
5490         * floatfns.c (Fexpt): Avoid undefined signed * signed overflow.
5491         * fns.c (Fcompare_strings, Fstring_lessp, struct textprop_rec, concat)
5492         (string_char_byte_cache_charpos, string_char_byte_cache_bytepos)
5493         (string_char_to_byte, string_byte_to_char)
5494         (string_make_multibyte, string_to_multibyte)
5495         (string_make_unibyte, Fstring_as_unibyte, Fstring_as_multibyte)
5496         (Fstring_to_unibyte, Fsubstring, Fsubstring_no_properties)
5497         (substring_both, Fdelete, internal_equal, Ffillarray)
5498         (Fclear_string, mapcar1)
5499         (Fbase64_encode_region, Fbase64_encode_string, base64_encode_1)
5500         (Fbase64_decode_region, Fbase64_decode_string, base64_decode_1)
5501         (larger_vector, make_hash_table, maybe_resize_hash_table)
5502         (hash_lookup, hash_remove_from_table, hash_clear, sweep_weak_table)
5503         (Fmaphash, secure_hash):
5504         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5505         (concat): Check for string index and length overflow.
5506         (Fmapconcat): Don't assume fixnums fit into ptrdiff_t.
5507         (Frequire):
5508         Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5509         (larger_vector): New API (vec, incr_min, size_max) replaces old
5510         one (vec, new_size, init).  This catches size overflow.
5511         INIT was removed because it was always Qnil.
5512         All callers changed.
5513         (INDEX_SIZE_BOUND): New macro, which calculates more precisely
5514         the upper bound on a hash table index size.
5515         (make_hash_table, maybe_resize_hash_table): Use it.
5516         (secure_hash): Computer start_byte and end_byte only after
5517         they're known to be in ptrdiff_t range.
5518         * font.c (font_intern_prop, font_at, font_range, Ffont_shape_gstring)
5519         (Ffont_get_glyphs, Ffont_at):
5520         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5521         (font_style_to_value, font_prop_validate_style, font_expand_wildcards)
5522         (Flist_fonts, Fopen_font):
5523         Don't assume fixnum can fit in int.
5524         (check_gstring): Don't assume index can fit in int.
5525         (font_match_p): Check that fixnum is a character, not a nonnegative
5526         fixnum, since the later code needs to stuff it into an int.
5527         (font_find_for_lface): Use SAFE_ALLOCA_LISP, not alloca.
5528         (font_fill_lglyph_metrics): Use unsigned, not EMACS_INT, to avoid
5529         conversion overflow issues.
5530         (Fopen_font): Check for integer out of  range.
5531         (Ffont_get_glyphs): Don't assume index can fit in int.
5532         * font.h: Adjust decls to match defn changes elsewhere.
5533         * fontset.c (reorder_font_vector): Redo score calculation to avoid
5534         integer overflow.
5535         (num_auto_fontsets, fontset_from_font): Use ptrdiff_t, not
5536         printmax_t, where ptrdiff_t is wide enough.
5537         (Finternal_char_font):
5538         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5539         * frame.c (Fset_mouse_position, Fset_mouse_pixel_position)
5540         (Fset_frame_height, Fset_frame_width, Fset_frame_size)
5541         (Fset_frame_position, x_set_frame_parameters)
5542         (x_set_line_spacing, x_set_border_width)
5543         (x_set_internal_border_width, x_set_alpha, x_figure_window_size):
5544         Check that fixnums are in proper range for system types.
5545         (frame_name_fnn_p, Fframe_parameter, Fmodify_frame_parameters):
5546         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5547         (Fmodify_frame_parameters): Don't assume fixnum fits in int.
5548         Use SAFE_ALLOCA_LISP, not alloca.
5549         * frame.h (struct frame): Use intptr_t, not EMACS_INT, where
5550         intptr_t is wide enough.
5551         * fringe.c (lookup_fringe_bitmap, get_logical_fringe_bitmap)
5552         (Fdefine_fringe_bitmap): Don't assume fixnum fits in int.
5553         (Ffringe_bitmaps_at_pos): Don't assume index fits in int.
5554         Check for fixnum out of range.
5555         * ftfont.c (ftfont_list): Don't assume index fits in int.
5556         Check that fixnums are in proper range for system types.
5557         (ftfont_shape_by_flt):
5558         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5559         * gnutls.c (emacs_gnutls_write, emacs_gnutls_read):
5560         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5561         (Fgnutls_error_fatalp, Fgnutls_error_string, Fgnutls_boot):
5562         Check that fixnums are in proper range for system types.
5563         * gnutls.h: Adjust decls to match defn changes elsewhere.
5564         * gtkutil.c (xg_dialog_run):
5565         Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5566         (update_frame_tool_bar):
5567         Check that fixnums are in proper range for system types.
5568         * image.c (parse_image_spec): Redo count calculation to avoid overflow.
5569         (lookup_image): Check that fixnums are in range for system types.
5570         * indent.c (last_known_column, last_known_column_point):
5571         (current_column_bol_cache):
5572         (skip_invisible, current_column, check_display_width):
5573         (check_display_width, scan_for_column, current_column_1)
5574         (Findent_to, Fcurrent_indentation, position_indentation)
5575         (indented_beyond_p, Fmove_to_column, compute_motion):
5576         (Fcompute_motion, Fvertical_motion):
5577         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5578         (last_known_column_modified): Use EMACS_INT, not int.
5579         (check_display_width):
5580         (Fcompute_motion):
5581         Check that fixnums and floats are in proper range for system types.
5582         (compute_motion): Don't assume index or fixnum fits in int.
5583         (compute_motion, Fcompute_motion):
5584         Use int, not EMACS_INT, when it is wide enough.
5585         (vmotion): Omit local var start_hpos that is always 0; that way
5586         we don't need to worry about overflow in expressions involving it.
5587         * indent.h: Adjust decls to match defn changes elsewhere.
5588         (struct position):
5589         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5590         Use int, not EMACS_INT, where int is wide enough.
5591         Remove unused members ovstring_chars_done and tab_offset;
5592         all uses removed.
5593         * insdel.c (move_gap, move_gap_both, gap_left, gap_right)
5594         (adjust_markers_for_delete, adjust_markers_for_insert, adjust_point)
5595         (adjust_markers_for_replace, make_gap_larger, make_gap_smaller)
5596         (make_gap, copy_text, insert, insert_and_inherit)
5597         (insert_before_markers, insert_before_markers_and_inherit)
5598         (insert_1, count_combining_before, count_combining_after)
5599         (insert_1_both, insert_from_string)
5600         (insert_from_string_before_markers, insert_from_string_1)
5601         (insert_from_gap, insert_from_buffer, insert_from_buffer_1)
5602         (adjust_after_replace, adjust_after_insert, replace_range)
5603         (replace_range_2, del_range, del_range_1, del_range_byte)
5604         (del_range_both, del_range_2, modify_region)
5605         (prepare_to_modify_buffer, signal_before_change)
5606         (signal_after_change, Fcombine_after_change_execute):
5607         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5608         * intervals.c (traverse_intervals, rotate_right, rotate_left)
5609         (balance_an_interval, split_interval_right, split_interval_left)
5610         (find_interval, next_interval, update_interval)
5611         (adjust_intervals_for_insertion, delete_node, delete_interval)
5612         (interval_deletion_adjustment, adjust_intervals_for_deletion)
5613         (static_offset_intervals, offset_intervals)
5614         (merge_interval_right, merge_interval_left, make_new_interval)
5615         (graft_intervals_into_buffer, temp_set_point_both)
5616         (temp_set_point, set_point, adjust_for_invis_intang)
5617         (set_point_both, move_if_not_intangible, get_property_and_range)
5618         (get_local_map, copy_intervals, copy_intervals_to_string)
5619         (compare_string_intervals, set_intervals_multibyte_1):
5620         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5621         * intervals.h: Adjust decls to match defn changes elsewhere.
5622         (struct interval):
5623         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5624         * keyboard.c (this_command_key_count, this_single_command_key_start)
5625         (before_command_key_count, before_command_echo_length, echo_now)
5626         (echo_length, recursive_edit_1, Frecursive_edit, Ftrack_mouse)
5627         (command_loop_1, safe_run_hooks, read_char, timer_check_2)
5628         (menu_item_eval_property, read_key_sequence, Fread_key_sequence)
5629         (Fread_key_sequence_vector, Fexecute_extended_command, Fsuspend_emacs):
5630         Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5631         (last_non_minibuf_size, last_point_position, echo_truncate)
5632         (command_loop_1, adjust_point_for_property, read_char, gen_help_event)
5633         (make_lispy_position, make_lispy_event, parse_modifiers_uncached)
5634         (parse_modifiers, modify_event_symbol, Fexecute_extended_command)
5635         (stuff_buffered_input):
5636         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5637         (last_auto_save, command_loop_1, read_char):
5638         Use EMACS_INT, not int, to avoid integer overflow.
5639         (record_char): Avoid overflow in total_keys computation.
5640         (parse_modifiers_uncached): Redo index calculation to avoid overflow.
5641         * keyboard.h: Adjust decls to match defn changes elsewhere.
5642         * keymap.c (Fdefine_key, Fcurrent_active_maps, accessible_keymaps_1)
5643         (Fkey_description, Fdescribe_vector, Flookup_key):
5644         Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5645         (click_position): New function, to check that positions are in range.
5646         (Fcurrent_active_maps):
5647         (describe_command):
5648         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5649         (Faccessible_keymaps, Fkey_description):
5650         (preferred_sequence_p):
5651         Don't assume fixnum can fit into int.
5652         (Fkey_description): Use SAFE_ALLOCA_LISP, not alloca.
5653         Check for integer overflow in size calculations.
5654         (Ftext_char_description): Use CHECK_CHARACTER, not CHECK_NUMBER, to
5655         avoid mishandling large integers.
5656         * lisp.h: Adjust decls to match defn changes elsewhere.
5657         (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, struct Lisp_String)
5658         (struct vectorlike_header, struct Lisp_Subr, struct Lisp_Hash_Table)
5659         (struct Lisp_Marker):
5660         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5661         (clip_to_bounds): Now an inline function, moved here from editfns.c.
5662         (GLYPH_CODE_P): Check for overflow in system types, subsuming the
5663         need for GLYPH_CODE_CHAR_VALID_P and doing proper checking ourselves.
5664         All callers changed.
5665         (GLYPH_CODE_CHAR, GLYPH_CODE_FACE):
5666         Assume the arg has valid form, since it always does.
5667         (TYPE_RANGED_INTEGERP): Avoid bug when checking against a wide
5668         unsigned integer system type.
5669         (CHECK_RANGED_INTEGER, CHECK_TYPE_RANGED_INTEGER): New macros.
5670         (struct catchtag, specpdl_size, SPECPDL_INDEX, USE_SAFE_ALLOCA):
5671         Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5672         (struct catchtag): Use EMACS_INT, not int, since it may be a fixnum.
5673         (duration_to_sec_usec): New decl.
5674         * lread.c (read_from_string_index, read_from_string_index_byte)
5675         (read_from_string_limit, readchar, unreadchar, openp)
5676         (read_internal_start, read1, oblookup):
5677         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5678         (Fload, readevalloop, Feval_buffer, Feval_region):
5679         Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5680         (openp): Check for out-of-range argument to 'access'.
5681         (read1): Use int, not EMACS_INT, where int is wide enough.
5682         Don't assume fixnum fits into int.
5683         Fix off-by-one error that can read outside a buffer.
5684         (read_filtered_event): Use duration_to_sec_usec
5685         to do proper overflow checking on durations.
5686         * macros.c (Fstart_kbd_macro): Use xpalloc to check for overflow
5687         in size calculation.
5688         (Fexecute_kbd_macro):
5689         Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5690         * marker.c (cached_charpos, cached_bytepos, CONSIDER)
5691         (byte_char_debug_check, buf_charpos_to_bytepos, verify_bytepos)
5692         (buf_bytepos_to_charpos, Fset_marker, set_marker_restricted)
5693         (set_marker_both, set_marker_restricted_both, marker_position)
5694         (marker_byte_position, Fbuffer_has_markers_at):
5695         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5696         (Fset_marker, set_marker_restricted): Don't assume fixnum fits in int.
5697         * menu.c (ensure_menu_items): Rename from grow_menu_items.
5698         It now merely ensures that the menu is large enough, without
5699         necessarily growing it, as this avoids some integer overflow issues.
5700         All callers changed.
5701         (keymap_panes, parse_single_submenu, Fx_popup_menu):
5702         Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5703         (parse_single_submenu, Fx_popup_menu): Don't assume fixnum fits in int.
5704         Use SAFE_ALLOCA_LISP, not alloca.
5705         (find_and_return_menu_selection): Avoid unnecessary casts of pointers
5706         to EMACS_INT.  Check that fixnums are in proper range for system types.
5707         * minibuf.c (minibuf_prompt_width, string_to_object)
5708         (Fminibuffer_contents, Fminibuffer_contents_no_properties)
5709         (Fminibuffer_completion_contents, Ftry_completion, Fall_completions):
5710         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5711         (get_minibuffer, read_minibuf_unwind):
5712         Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5713         (read_minibuf): Omit unnecessary arg BACKUP_N, which is always nil;
5714         this simplifies overflow checking.  All callers changed.
5715         (read_minibuf, Fread_buffer, Ftry_completion, Fall_completions)
5716         (Ftest_completion):
5717         Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5718         * nsfns.m (check_ns_display_info): Don't assume fixnum fits in long.
5719         (x_set_menu_bar_lines, x_set_tool_bar_lines, Fx_create_frame):
5720         Check that fixnums are in proper range for system types.
5721         (Fx_create_frame, Fx_show_tip):
5722         Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5723         * nsfont.m (ns_findfonts, nsfont_list_family):
5724         Don't assume fixnum fits in long.
5725         * nsmenu.m (ns_update_menubar, ns_menu_show, ns_popup_dialog):
5726         Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5727         (ns_update_menubar): Use intptr_t, not EMACS_INT, when intptr_t is
5728         wide enough.
5729         * nsselect.m (ns_get_local_selection, clean_local_selection_data):
5730         Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5731         * print.c (print_buffer_size, print_buffer_pos, print_buffer_pos_byte)
5732         (PRINTDECLARE, PRINTPREPARE):
5733         (strout, print_string):
5734         (print, print_preprocess, print_check_string_charset_prop)
5735         (print_object):
5736         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5737         (PRINTDECLARE):
5738         (temp_output_buffer_setup, Fprin1_to_string, print_object):
5739         Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5740         (PRINTPREPARE): Use int, not ptrdiff_t, where int is wide enough.
5741         (printchar, strout): Use xpalloc to catch size calculation overflow.
5742         (Fexternal_debugging_output): Don't overflow EMACS_INT->int conversion.
5743         (print_error_message): Use SAFE_ALLOCA, not alloca.
5744         (print_object): Use int, not EMACS_INT, where int is wide enough.
5745         (print_depth, new_backquote_output, print_number_index):
5746         Use ptrdiff_t, not int, where int might not be wide enough.
5747         * process.c (Fdelete_process): Don't assume pid fits into EMACS_INT.
5748         (Fset_process_window_size, Fformat_network_address)
5749         (get_lisp_to_sockaddr_size, set_socket_option, Fmake_network_process)
5750         (sigchld_handler):
5751         Check that fixnums are in proper range for system types.
5752         (Fsignal_process): Simplify by avoiding a goto.
5753         Check for process-ids out of pid_t range rather than relying on
5754         undefined behavior.
5755         (process_tick, update_tick): Use EMACS_INT, not int.
5756         (Fformat_network_address, read_process_output, send_process)
5757         (Fprocess_send_region, status_notify):
5758         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5759         (Fformat_network_address, Fmake_serial_process, Fmake_network_process)
5760         (wait_reading_process_output, read_process_output, exec_sentinel):
5761         Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5762         (conv_lisp_to_sockaddr): Don't assume fixnums fit into int.
5763         (Faccept_process_output): Use duration_to_sec_usec to do proper
5764         overflow checking on durations.
5765         (emacs_get_tty_pgrp, Fprocess_running_child_p, process_send_signal):
5766         Don't assume pid_t fits in int.
5767         * process.h (struct Lisp_Process): Members tick and update_tick
5768         are now of type EMACS_INT, not int.
5769         * puresize.h (PURESIZE_RATIO): Shrink this to 8/6 on 32-bit hosts
5770         configured --with-wide-int.
5771         * scroll.c (calculate_scrolling, calculate_direct_scrolling)
5772         (line_ins_del): Use int, not EMACS_INT, where int is wide enough.
5773         * search.c (looking_at_1, string_match_1):
5774         (fast_string_match, fast_c_string_match_ignore_case)
5775         (fast_string_match_ignore_case, fast_looking_at, scan_buffer)
5776         (scan_newline, find_before_next_newline, search_command)
5777         (trivial_regexp_p, search_buffer, simple_search, boyer_moore)
5778         (set_search_regs, wordify):
5779         (Freplace_match):
5780         (Fmatch_data):
5781         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5782         (string_match_1, search_buffer, set_search_regs):
5783         (Fmatch_data):
5784         Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5785         (wordify): Check for overflow in size calculation.
5786         (Freplace_match): Avoid potential buffer overflow in search_regs.start.
5787         (Fset_match_data): Don't assume fixnum fits in ptrdiff_t.
5788         Check that fixnums are in proper range for system types.
5789         * sound.c (struct sound_device)
5790         (wav_play, au_play, vox_write, alsa_period_size, alsa_write):
5791         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5792         (Fplay_sound_internal):
5793         Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5794         * syntax.c (struct lisp_parse_state, find_start_modiff)
5795         (Finternal_describe_syntax_value, scan_lists, scan_sexps_forward):
5796         (Fparse_partial_sexp):
5797         Don't assume fixnums can fit in int.
5798         (struct lisp_parse_state, find_start_pos, find_start_value)
5799         (find_start_value_byte, find_start_begv)
5800         (update_syntax_table, char_quoted, dec_bytepos)
5801         (find_defun_start, prev_char_comend_first, back_comment):
5802         (scan_words, skip_chars, skip_syntaxes, forw_comment, Fforward_comment)
5803         (scan_lists, Fbackward_prefix_chars, scan_sexps_forward):
5804         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5805         (Finternal_describe_syntax_value): Check that match_lisp is a
5806         character, not an integer, since the code stuffs it into int.
5807         (scan_words, scan_sexps_forward):
5808         Check that fixnums are in proper range for system types.
5809         (Fforward_word):
5810         Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5811         (scan_sexps_forward):
5812         Use CHARACTERP, not INTEGERP, since the value must fit into int.
5813         (Fparse_partial_sexp): Fix doc; element 8 is not ignored.
5814         * syntax.h: Adjust decls to match defn changes elsewhere.
5815         (struct gl_state_s):
5816         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5817         (SETUP_SYNTAX_TABLE_FOR_OBJECT): Use PTRDIFF_MAX, not
5818         MOST_POSITIVE_FIXNUM.
5819         * sysdep.c (wait_for_termination_1, wait_for_termination)
5820         (interruptible_wait_for_termination, mkdir):
5821         Don't assume pid_t fits in int; on 64-bit AIX pid_t is 64-bit.
5822         (emacs_read, emacs_write):
5823         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5824         (system_process_attributes): Don't assume uid_t, gid_t, EMACS_INT,
5825         and double all fit in int.
5826         * term.c (set_tty_color_mode):
5827         Check that fixnums are in proper range for system types.
5828         * termhooks.h (struct input_event):
5829         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5830         * textprop.c (validate_interval_range, interval_of)
5831         (Fadd_text_properties, set_text_properties_1)
5832         (Fremove_text_properties, Fremove_list_of_text_properties)
5833         (Ftext_property_any, Ftext_property_not_all)
5834         (copy_text_properties, text_property_list, extend_property_ranges)
5835         (verify_interval_modification):
5836         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5837         (Fnext_single_char_property_change)
5838         (Fprevious_single_char_property_change):
5839         Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5840         (copy_text_properties):
5841         Check for integer overflow in index calculation.
5842         * undo.c (last_boundary_position, record_point, record_insert)
5843         (record_delete, record_marker_adjustment, record_change)
5844         (record_property_change):
5845         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5846         (truncate_undo_list, Fprimitive_undo): Don't assume fixnum fits in int.
5847         Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5848         * w32fns.c (Fx_create_frame, x_create_tip_frame, Fx_show_tip)
5849         (Fx_hide_tip, Fx_file_dialog):
5850         * w32menu.c (set_frame_menubar):
5851         Use ptrdiff_t, not int, for consistency with rest of code.
5852         * window.c (window_scroll_preserve_hpos, window_scroll_preserve_vpos)
5853         (select_window, Fdelete_other_windows_internal)
5854         (window_scroll_pixel_based, window_scroll_line_based)
5855         (Frecenter, Fset_window_configuration):
5856         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5857         (Fset_window_hscroll, run_window_configuration_change_hook)
5858         (set_window_buffer, temp_output_buffer_show, scroll_command)
5859         (Fscroll_other_window, Frecenter):
5860         Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5861         (Fwindow_line_height, window_scroll, Fscroll_left, Fscroll_right):
5862         Don't assume fixnum fits in int.
5863         (Fset_window_scroll_bars):
5864         Check that fixnums are in proper range for system types.
5865         * xdisp.c (help_echo_pos, pos_visible_p, string_pos_nchars_ahead)
5866         (string_pos, c_string_pos, number_of_chars, init_iterator)
5867         (in_ellipses_for_invisible_text_p, init_from_display_pos)
5868         (compute_stop_pos, next_overlay_change, compute_display_string_pos)
5869         (compute_display_string_end, handle_face_prop)
5870         (face_before_or_after_it_pos, handle_invisible_prop)
5871         (handle_display_prop, handle_display_spec, handle_single_display_spec)
5872         (display_prop_intangible_p, string_buffer_position_lim)
5873         (string_buffer_position, handle_composition_prop, load_overlay_strings)
5874         (get_overlay_strings_1, get_overlay_strings)
5875         (iterate_out_of_display_property, forward_to_next_line_start)
5876         (back_to_previous_visible_line_start, reseat, reseat_to_string)
5877         (get_next_display_element, set_iterator_to_next)
5878         (get_visually_first_element, compute_stop_pos_backwards)
5879         (handle_stop_backwards, next_element_from_buffer)
5880         (move_it_in_display_line_to, move_it_in_display_line)
5881         (move_it_to, move_it_vertically_backward, move_it_by_lines)
5882         (add_to_log, message_dolog, message_log_check_duplicate)
5883         (message2, message2_nolog, message3, message3_nolog
5884         (with_echo_area_buffer, display_echo_area_1, resize_mini_window_1)
5885         (current_message_1, truncate_echo_area, truncate_message_1)
5886         (set_message, set_message_1, store_mode_line_noprop)
5887         (hscroll_window_tree, debug_delta, debug_delta_bytes, debug_end_vpos)
5888         (text_outside_line_unchanged_p, check_point_in_composition)
5889         (reconsider_clip_changes)
5890         (redisplay_internal, set_cursor_from_row, try_scrolling)
5891         (try_cursor_movement, set_vertical_scroll_bar, redisplay_window)
5892         (redisplay_window, find_last_unchanged_at_beg_row)
5893         (find_first_unchanged_at_end_row, row_containing_pos, try_window_id)
5894         (trailing_whitespace_p, find_row_edges, display_line)
5895         (RECORD_MAX_MIN_POS, Fcurrent_bidi_paragraph_direction)
5896         (display_mode_element, store_mode_line_string)
5897         (pint2str, pint2hrstr, decode_mode_spec)
5898         (display_count_lines, display_string, draw_glyphs)
5899         (x_produce_glyphs, x_insert_glyphs)
5900         (rows_from_pos_range, mouse_face_from_buffer_pos)
5901         (fast_find_string_pos, mouse_face_from_string_pos)
5902         (note_mode_line_or_margin_highlight, note_mouse_highlight):
5903         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5904         (safe_call, init_from_display_pos, handle_fontified_prop)
5905         (handle_single_display_spec, load_overlay_strings)
5906         (with_echo_area_buffer, setup_echo_area_for_printing)
5907         (display_echo_area, echo_area_display)
5908         (x_consider_frame_title, prepare_menu_bars, update_menu_bar)
5909         (update_tool_bar, hscroll_window_tree, redisplay_internal)
5910         (redisplay_window, dump_glyph_row, display_mode_line)
5911         (Fformat_mode_line, decode_mode_spec, on_hot_spot_p):
5912         (handle_display_spec, display_prop_string_p):
5913         Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5914         (handle_single_display_spec, build_desired_tool_bar_string)
5915         (redisplay_tool_bar, scroll_window_tree, Fdump_glyph_matrix)
5916         (get_specified_cursor_type):
5917         Check that fixnums are in proper range for system types.
5918         (struct overlay_entry, resize_mini_window, Fdump_glyph_row)
5919         (Flookup_image_map):
5920         Don't assume fixnums fit in int.
5921         (compare_overlay_entries):
5922         Avoid mishandling comparisons due to subtraction overflow.
5923         (load_overlay_strings): Use SAFE_NALLOCA, not alloca.
5924         (last_escape_glyph_face_id, last_glyphless_glyph_face_id):
5925         (handle_tool_bar_click):
5926         Use int, not unsigned, since we prefer signed and the signedness
5927         doesn't matter here.
5928         (get_next_display_element, next_element_from_display_vector):
5929         Use int, not EMACS_INT, when int is wide enough.
5930         (start_hourglass): Use duration_to_sec_usec to do proper
5931         overflow checking on durations.
5932         * xfaces.c (Fbitmap_spec_p):
5933         Check that fixnums are in proper range for system types.
5934         (compare_fonts_by_sort_order):
5935         Avoid mishandling comparisons due to subtraction overflow.
5936         (Fx_family_fonts, realize_basic_faces):
5937         Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5938         (Fx_family_fonts):
5939         Don't assume fixnum fits in int.
5940         Use SAFE_ALLOCA_LISP, not alloca.
5941         (merge_face_heights): Remove unnecessary cast to EMACS_INT.
5942         (Finternal_make_lisp_face): Don't allocate more than MAX_FACE_ID.
5943         (face_at_buffer_position, face_for_overlay_string)
5944         (face_at_string_position):
5945         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5946         (merge_faces): Use int, not EMACS_INT, where int is wide enough.
5947         * xfns.c (x_set_menu_bar_lines, x_set_tool_bar_lines, x_icon_verify)
5948         (Fx_show_tip):
5949         Check that fixnums are in proper range for system types.
5950         (Fx_create_frame, x_create_tip_frame, Fx_show_tip)
5951         (Fx_hide_tip, Fx_file_dialog, Fx_select_font):
5952         Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5953         (Fx_change_window_property): Don't assume fixnums fit in int.
5954         * xfont.c (xfont_chars_supported):
5955         Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5956         * xmenu.c (Fx_popup_dialog, set_frame_menubar)
5957         (create_and_show_popup_menu, create_and_show_dialog, xmenu_show):
5958         Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5959         * xml.c (parse_region):
5960         * xrdb.c (magic_file_p):
5961         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5962         * xselect.c (TRACE1): Don't assume pid_t promotes to int.
5963         (x_get_local_selection, x_reply_selection_request)
5964         (x_handle_selection_request, wait_for_property_change):
5965         Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5966         (selection_data_to_lisp_data): Use short, not EMACS_INT, where
5967         short is wide enough.
5968         (x_send_client_event): Don't assume fixnum fits in int.
5969         * xterm.c (x_x_to_emacs_modifiers):
5970         Don't assume EMACS_INT overflows nicely into int.
5971         (x_emacs_to_x_modifiers): Use EMACS_INT, not int, because values
5972         may come from Lisp.
5973         (handle_one_xevent): NATNUMP can eval its arg twice.
5974         (x_connection_closed):
5975         Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5976         * xterm.h: Adjust decls to match defn changes elsewhere.
5977         (struct scroll_bar): Use struct vectorlike_header
5978         rather than rolling our own approximation.
5979         (SCROLL_BAR_VEC_SIZE): Remove; not used.
5981 2012-05-25  Glenn Morris  <rgm@gnu.org>
5983         * lisp.mk (lisp): Update for more files being compiled now.
5985 2012-05-25  Stefan Monnier  <monnier@iro.umontreal.ca>
5987         * lread.c: Remove `read_pure' which makes no difference.
5988         (read_pure): Remove var.
5989         (unreadpure): Remove function.
5990         (readevalloop): Don't call read_list with -1 flag.
5991         (read1, read_vector): Don't test read_pure any more.
5992         (read_list): Simplify.
5994         * fileio.c, character.h: Minor style tweaks.
5996 2012-05-24  Dmitry Antipov  <dmantipov@yandex.ru>
5998         * window.h (clip_changed): Remove useless declaration.
6000 2012-05-22  Juanma Barranquero  <lekktu@gmail.com>
6002         * makefile.w32-in: Follow-up to revno:108341.
6003         (TAGS, TAGS-gmake, CONFIG_H): Remove further references to m/intel386.h.
6005 2012-05-22  Paul Eggert  <eggert@cs.ucla.edu>
6007         Remove src/m/*.
6008         This directory predates autoconf and is no longer needed nowadays.
6009         Move its few remaining bits of functionality to where they're needed.
6010         * m/README, m/alpha.h, m/amdx86-64.h, m/ia64.h, m/ibmrs6000.h:
6011         * m/ibms390x.h, m/intel386.h, m/m68k.h, m/macppc.h, m/sparc.h:
6012         * m/template.h: Remove.
6013         * Makefile.in (M_FILE): Remove.  All uses removed.
6014         * alloc.c (POINTERS_MIGHT_HIDE_IN_OBJECTS):
6015         * lisp.h (USE_LSB_TAG):
6016         * mem-limits.h (EXCEEDS_LISP_PTR):
6017         Use VAL_MAX, not VALBITS, in #if.
6018         * lisp.h (EMACS_INT_MAX): New macro, useful in #if.
6019         (EMACS_UINT): Define unconditionally now.
6020         (BITS_PER_CHAR, BITS_PER_SHORT, BITS_PER_INT, BITS_PER_LONG)
6021         (BITS_PER_EMACS_INT): New constants, replacing
6022         what used to be in config.h, but not useful in #if.
6023         (GCTYPEBITS, VALBITS): Define unconditionally, since m/* files don't
6024         define them any more.
6025         (VAL_MAX): New macro.
6026         (VALMASK): Use it.
6027         * puresize.h (PURESIZE_RATIO): Use EMACS_INT_MAX, not
6028         BITS_PER_EMACS_INT, in #if.
6029         * s/aix4-2.h (BROKEN_FIONREAD, BROKEN_SIGAIO, BROKEN_SIGPTY)
6030         (BROKEN_SIGPOLL): Move here from m/ibmrs6000.h, which was removed.
6031         * s/gnu-linux.h (ULIMIT_BREAK_VALUE) [__i386__]:
6032         * s/ms-w32.h (DATA_START):
6033         Move here from removed file m/intel386.h.
6034         * s/gnu.h (NLIST_STRUCT): Remove undef; 'configure' does this.
6035         * s/irix6-5.h (_LP64): Remove; lisp.h no longer needs this.
6037 2012-05-21  Paul Eggert  <eggert@cs.ucla.edu>
6039         Assume C89 or later.
6040         * alloc.c, buffer.c, lisp.h: Replace POINTER_TYPE with void.
6041         * alloc.c (overrun_check_malloc, overrun_check_realloc, xmalloc)
6042         (xrealloc):
6043         * buffer.c (mmap_free_1, mmap_enlarge): Omit needless casts.
6044         * editfns.c, fns.c, gmalloc.c, insdel.c, sysdep.c, termcap.c (NULL):
6045         * textprop.c, tparam.c (NULL): Remove.
6046         * ralloc.c, vm-limit.c (POINTER): Assume void * works.
6047         * regex.c (SIGN_EXTEND_CHAR): Assume signed char works.
6048         * regex.h (_RE_ARGS): Remove.  All uses rewritten to use prototypes.
6049         * unexelf.c (ElfBitsW): Assume c89 preprocessor or better.
6050         * xterm.c (input_signal_count): Assume volatile works.
6052 2012-05-21  Ken Brown  <kbrown@cornell.edu>
6054         * xgselect.c (xg_select): Fix first argument in call to 'select'
6055         (bug#11508).
6057 2012-05-20  Ken Brown  <kbrown@cornell.edu>
6059         * gmalloc.c (_free_internal_nolock, _realloc_internal_nolock)
6060         [CYGWIN]: Cast ptr to (char *) before comparing to _heapbase.
6062 2012-05-19  Ken Brown  <kbrown@cornell.edu>
6064         * xfns.c (x_in_use): Remove `static' qualifier.
6065         * xterm.h (x_in_use): Declare.
6066         * xgselect.c: Include xterm.h.
6067         (xg_select): Test `x_in_use' instead of `inhibit_window_system'
6068         and `display_arg' (bug#9754).
6070 2012-05-19  Paul Eggert  <eggert@cs.ucla.edu>
6072         * s/ms-w32.h (HAVE_GETDOMAINNAME): Remove; not needed.
6074         * m/vax.h: Remove; no longer needed since HAVE_FTIME is being removed.
6075         * s/ms-w32.h (HAVE_FTIME): Remove; not needed.
6077 2012-05-18  Eli Zaretskii  <eliz@gnu.org>
6079         Fix compilation with -DGLYPH_DEBUG=1 on MS-Windows.
6081         * w32term.c [GLYPH_DEBUG]: Add prototype for x_check_font.
6082         (x_check_font) [GLYPH_DEBUG]: New function, copied from xterm.c.
6084         * w32fns.c (unwind_create_frame) [GLYPH_DEBUG]: Fix broken
6085         reference to image_cache->refcount.
6086         (x_create_tip_frame): Fix broken use of FRAME_IMAGE_CACHE.
6088 2012-05-17  Juri Linkov  <juri@jurta.org>
6090         * search.c (Fword_search_regexp, Fword_search_backward)
6091         (Fword_search_forward, Fword_search_backward_lax)
6092         (Fword_search_forward_lax): Move functions to isearch.el
6093         (bug#10145, bug#11381).
6095 2012-05-16  Paul Eggert  <eggert@cs.ucla.edu>
6097         * xgselect.c (xg_select): Just invoke 'select' if -nw (Bug#9754).
6099 2012-05-15  Stefan Monnier  <monnier@iro.umontreal.ca>
6101         * lread.c (init_obarray): Declare Qt and Qnil as special.
6103 2012-05-14  Glenn Morris  <rgm@gnu.org>
6105         * nsterm.m (ns_init_paths): Fix typo ("libexec" not "lib-exec").
6106         Put "libexec" before "bin", for the sake of init_callproc_1.
6108 2012-05-14  Paul Eggert  <eggert@cs.ucla.edu>
6110         * keyboard.c (kbd_buffer_get_event) [!HAVE_DBUS]: Omit unused local.
6112         * unexaix.c: Port to more-recent AIX compilers.
6113         (report_error, report_error_1, make_hdr, copy_sym)
6114         (mark_x, adjust_lnnoptrs, unrelocate_symbols):
6115         Make arguments const char *, not char *, to avoid violations of C
6116         standard and to fix some AIX warnings reported by Gilles Pion.
6118 2012-05-14  Eli Zaretskii  <eliz@gnu.org>
6120         * xdisp.c (handle_stop): Don't call get_overlay_strings_1 if we
6121         already have overlays loaded.
6122         (handle_single_display_spec): Before returning without displaying
6123         fringe bitmap, synchronize the bidi iterator with the main display
6124         iterator, by calling iterate_out_of_display_property.
6125         (iterate_out_of_display_property): Detect buffer iteration by
6126         testing that it->string is a Lisp string.
6127         (get_next_display_element): When the current object is exhausted,
6128         and there's something on it->stack, call set_iterator_to_next to
6129         proceed with what's on the stack, instead of returning zero.
6130         (set_iterator_to_next): If called at the end of a Lisp string,
6131         proceed to consider_string_end without incrementing string
6132         position.  Don't increment display vector index past the end of
6133         the display vector.  (Bug#11417)
6134         (pos_visible_p): Don't report a position visible when move_it_to
6135         stopped at the last line of window, which happens to be scanned
6136         backwards by the bidi iteration.  (Bug#11464)
6138 2012-05-14  Eli Zaretskii  <eliz@gnu.org>
6140         * xdisp.c (handle_single_display_spec): Return 1 for left-margin
6141         and right-margin display specs even if the spec is invalid or we
6142         are on a TTY, and thus unable to display on the fringes.
6143         That's because the text with the property will not be displayed anyway,
6144         so we need to signal to the caller that this is a "replacing"
6145         display spec.  This fixes display when the spec is invalid or we
6146         are on a TTY.
6148 2012-05-14  Paul Eggert  <eggert@cs.ucla.edu>
6150         * unexaix.c (make_hdr): Fix typo in prototype.
6151         This bug broke the build on AIX.  Problem reported by Gilles Pion.
6153 2012-05-14  Michael Albinus  <michael.albinus@gmx.de>
6155         * keyboard.c (kbd_buffer_get_event): Read special events also in
6156         batch mode.  (Bug#11415)
6158 2012-05-12  Glenn Morris  <rgm@gnu.org>
6160         * ns.mk: Update for ns_appbindir no longer having trailing "/".
6162 2012-05-12  Eli Zaretskii  <eliz@gnu.org>
6164         * lisp.mk (lisp): Add newcomment.elc.
6166 2012-05-12  Glenn Morris  <rgm@gnu.org>
6168         * Makefile.in (MKDIR_P): New, set by configure.
6169         * ns.mk (${ns_appdir}, ${ns_appbindir}Emacs): Use $MKDIR_P.
6171 2012-05-11  Paul Eggert  <eggert@cs.ucla.edu>
6173         Remove unused function hourglass_started.
6174         * dispextern.h (hourglass_started):
6175         * w32fns.c (hourglass_started):
6176         * xdisp.c (hourglass_started): Remove.
6178 2012-05-10  Juanma Barranquero  <lekktu@gmail.com>
6180         * makefile.w32-in ($(BLD)/gmalloc.$(O), $(BLD)/w32menu.$(O)):
6181         Update dependencies.
6183 2012-05-10  Paul Eggert  <eggert@cs.ucla.edu>
6185         * xgselect.c (xg_select): Put maxfds+1 into a var.
6186         This is slightly clearer, and pacifies Ubuntu 12.04 gcc.
6188         * sound.c (DEFAULT_ALSA_SOUND_DEVICE): Define only if HAVE_ALSA.
6190 2012-05-10  Dave Abrahams  <dave@boostpro.com>
6192         * filelock.c (syms_of_filelock): New boolean create-lockfiles.
6193         (lock_file): If create_lockfiles is 0, do nothing.  (Bug#11227)
6195 2012-05-09  Michael Albinus  <michael.albinus@gmx.de>
6197         * dbusbind.c (xd_registered_buses): New internal Lisp object.
6198         Rename all occurences of Vdbus_registered_buses to xd_registered_buses.
6199         (syms_of_dbusbind): Remove declaration of Vdbus_registered_buses.
6200         Initialize xd_registered_buses.
6202 2012-05-09  Paul Eggert  <eggert@cs.ucla.edu>
6204         Untag more efficiently if USE_LSB_TAG.
6205         This is based on a proposal by YAMAMOTO Mitsuharu in
6206         <http://lists.gnu.org/archive/html/emacs-devel/2008-01/msg01876.html>.
6207         For an admittedly artificial (nth 8000 longlist) benchmark on
6208         Fedora 15 x86-64, this yields a 25% CPU speedup.  Also, it shrinks
6209         Emacs's overall text size by 1%.
6210         * lisp.h (XUNTAG): New macro.
6211         (XCONS, XVECTOR, XSTRING, XSYMBOL, XFLOAT, XMISC, XPROCESS, XWINDOW)
6212         (XTERMINAL, XSUBR, XBUFFER, XCHAR_TABLE, XSUB_CHAR_TABLE, XBOOL_VECTOR)
6213         (XSETTYPED_PSEUDOVECTOR, XHASH_TABLE, TYPED_PSEUDOVECTORP): Use it.
6214         * eval.c (Fautoload):
6215         * font.h (XFONT_SPEC, XFONT_ENTITY, XFONT_OBJECT):
6216         * frame.h (XFRAME): Use XUNTAG.
6218         Port recent dbusbind.c changes to 32-bit --with-wide-int.
6219         * dbusbind.c (xd_append_arg, xd_retrieve_arg, Fdbus_message_internal):
6220         Remove unportable assumptions about print widths of types like
6221         dbus_uint32_t.
6222         (xd_get_connection_address, Fdbus_init_bus): Cast Emacs integer to
6223         intptr_t when converting between pointer and integer, to avoid GCC
6224         warnings about wrong width.
6226 2012-05-09  Eli Zaretskii  <eliz@gnu.org>
6228         * w32proc.c (new_child): Force Windows to reserve only 64KB of
6229         stack for each reader_thread, instead of defaulting to 8MB
6230         determined by the linker.  This avoids failures in creating
6231         subprocesses on Windows 7, see the discussion in this thread:
6232         http://lists.gnu.org/archive/html/emacs-devel/2012-03/msg00119.html.
6234 2012-05-07  Jérémy Compostella  <jeremy.compostella@gmail.com>
6236         Fix up display of the *Minibuf-0* buffer in the mini window.
6237         * keyboard.c (read_char): Don't clear the echo area if there's no
6238         message to clear.
6239         * xdisp.c (redisplay_internal): Redisplay the mini window (with the
6240         contents of *Minibuf-0*) if there's no message displayed in its stead.
6242 2012-05-07  Michael Albinus  <michael.albinus@gmx.de>
6244         * dbusbind.c (XD_DEBUG_MESSAGE): Don't print message twice in
6245         batch mode.
6247 2012-05-06  Chong Yidong  <cyd@gnu.org>
6249         * lisp.mk (lisp): Update.
6251 2012-05-05  Jim Meyering  <meyering@redhat.com>
6253         * w32font.c (fill_in_logfont): NUL-terminate a string (Bug#11372).
6255 2012-05-04  Stefan Monnier  <monnier@iro.umontreal.ca>
6257         * data.c (PUT_ERROR): New macro.
6258         (syms_of_data): Use it.  Add new error type `user-error'.
6259         * undo.c (user_error): New function.
6260         (Fprimitive_undo): Use it.
6261         * print.c (print_error_message): Adjust print style for `user-error'.
6262         * keyboard.c (user_error): New function.
6263         (Fexit_recursive_edit, Fabort_recursive_edit): Use it.
6265 2012-05-03  Paul Eggert  <eggert@cs.ucla.edu>
6267         Do not limit current-time-string to years 1000..9999.
6268         * editfns.c (TM_YEAR_IN_ASCTIME_RANGE): Remove.
6269         (Fcurrent_time_string): Support any year that is supported by the
6270         underlying localtime representation.  Don't use asctime, as it
6271         has undefined behavior for years outside the range -999..9999.
6273 2012-05-02  Paul Eggert  <eggert@cs.ucla.edu>
6275         Fix race conditions involving setenv, gmtime, localtime, asctime.
6276         Without this fix, interrupts could mess up code that uses these
6277         nonreentrant functions, since setting TZ invalidates existing
6278         tm_zone or tzname values, and since most of these functions return
6279         pointers to static storage.
6280         * editfns.c (format_time_string, Fdecode_time, Fencode_time)
6281         (Fcurrent_time_string, Fcurrent_time_zone, Fset_time_zone_rule):
6282         Grow the critical sections to include not just invoking
6283         localtime/gmtime, but also accessing these functions' results
6284         including their tm_zone values if any, and any related TZ setting.
6285         (format_time_string): Last arg is now struct tm *, not struct tm **,
6286         so that the struct tm is saved in the critical section.
6287         All callers changed.  Simplify allocation of initial buffer, partly
6288         motivated by the fact that memory allocation needs to be outside
6289         the critical section.
6291 2012-05-02  Dmitry Antipov  <dmantipov@yandex.ru>
6293         * intervals.c (adjust_intervals_for_insertion): Initialize `newi'
6294         with RESET_INTERVAL.
6296         * buffer.c (Fget_buffer_create, Fmake_indirect_buffer):
6297         Remove duplicated buffer name initialization.
6299 2012-05-02  Jim Meyering  <jim@meyering.net>
6301         * xterm.c (x_term_init): Use memcpy instead of strncpy (Bug#11373).
6303         * xfns.c (x_window): Use xstrdup (Bug#11375).
6305 2012-05-02  Eli Zaretskii  <eliz@gnu.org>
6307         * xdisp.c (pos_visible_p): If already at a newline from the
6308         display string before the 'while' loop, don't walk back the glyphs
6309         from it3.glyph_row.  Solves assertion violation when the display
6310         string begins with a newline (egg.el).  (Bug#11367)
6312 2012-05-01  Stefan Monnier  <monnier@iro.umontreal.ca>
6314         * keyboard.c (Fexecute_extended_command, Vsuggest_key_bindings):
6315         Move to simple.el.
6317 2012-05-01  Glenn Morris  <rgm@gnu.org>
6319         * syssignal.h: Remove reference to BROKEN_SIGINFO (last used in
6320         s/ptx4.h), BROKEN_SIGTSTP (last used in m/ustation.h, m/dpx2.h),
6321         and BROKEN_SIGURG (was in s/gnu-linux.h prior to 2008-02-10).
6322         All were removed before 23.1.
6324         * dispnew.c: Remove HAVE_LIBNCURSES test;
6325         it is always true on relevant platforms.
6327         * Makefile.in (LD_SWITCH_X_SITE_RPATH):
6328         Rename from LD_SWITCH_X_SITE_AUX_RPATH.
6330         * Makefile.in (LD_SWITCH_X_SITE_AUX): Remove; no longer used.
6332 2012-04-30  Andreas Schwab  <schwab@linux-m68k.org>
6334         * .gdbinit (xpr): Remove checks for no longer existing misc types.
6335         (xintfwd, xboolfwd, xobjfwd, xbufobjfwd, xkbobjfwd, xbuflocal):
6336         Remove.
6338 2012-04-28  Paul Eggert  <eggert@cs.ucla.edu>
6340         Do not avoid creating empty evaporating overlays (Bug#9642).
6341         * buffer.c (Fmove_overlay): Revert the change of 2012-04-23.
6342         That is, do not delete an evaporating overlay if it becomes
6343         empty after its bounds are adjusted to fit within its buffer.
6344         This fix caused other problems, and I'm reverting it until we get
6345         to the bottom of them.
6347 2012-04-27  Chong Yidong  <cyd@gnu.org>
6349         * xselect.c (x_convert_selection): Initialize a pointer (Bug#11315).
6351 2012-04-27  Eli Zaretskii  <eliz@gnu.org>
6353         * xdisp.c (pos_visible_p): If the window start position is beyond
6354         ZV, start the display from buffer beginning.  Prevents assertion
6355         violation in init_iterator when the minibuffer window is scrolled
6356         via the scroll bar.
6358         * window.c (window_scroll_pixel_based): Likewise.
6360 2012-04-27  Chong Yidong  <cyd@gnu.org>
6362         * keymap.c (where_is_internal): Doc fix (Bug#10872).
6364 2012-04-27  Glenn Morris  <rgm@gnu.org>
6366         * fileio.c (Fcopy_file, Fset_file_selinux_context):
6367         Ignore ENOTSUP failures from setfilecon functions.  (Bug#11245)
6369 2012-04-27  Eli Zaretskii  <eliz@gnu.org>
6371         * dispnew.c (swap_glyph_pointers, copy_row_except_pointers):
6372         Don't overrun array limits of glyph row's used[] array.  (Bug#11288)
6374 2012-04-26  Eli Zaretskii  <eliz@gnu.org>
6376         * xdisp.c (IT_DISPLAYING_WHITESPACE): In addition to the loaded
6377         display element, check also the underlying string or buffer
6378         character.  (Bug#11341)
6380         * w32menu.c: Include w32heap.h.
6381         (add_menu_item): If the call to AppendMenuW (via
6382         unicode_append_menu) fails, disable Unicode menus only if we are
6383         running on Windows 9X/Me.
6385 2012-04-24  Andreas Schwab  <schwab@linux-m68k.org>
6387         * .gdbinit (xpr): Handle USE_2_TAGS_FOR_INTS.
6388         (xgetint): Add missing shift for LSB tags.
6390 2012-04-24  Martin Rudalics  <rudalics@gmx.at>
6392         * keyboard.c (read_char): Don't wipe echo area for select window
6393         events: These might get delayed via `mouse-autoselect-window'
6394         (Bug#11304).
6396 2012-04-24  Juanma Barranquero  <lekktu@gmail.com>
6398         * gnutls.c (init_gnutls_functions): Protect against (unlikely)
6399         manipulation of :loaded-from data.
6401 2012-04-23  Juanma Barranquero  <lekktu@gmail.com>
6403         * gnutls.c (init_gnutls_functions): The value of :loaded-from is
6404         now a cons (bug#11311).
6406 2012-04-23  Paul Eggert  <eggert@cs.ucla.edu>
6408         Do not create empty overlays with the evaporate property (Bug#9642).
6409         * buffer.c (Fmove_overlay): Delete an evaporating overlay
6410         if it becomes empty after its bounds are adjusted to fit within
6411         its buffer.  Without this fix, in a nonempty buffer (let ((o
6412         (make-overlay 1 2))) (overlay-put o 'evaporate t) (move-overlay o 0 1))
6413         yields an empty overlay that has the evaporate property, which is
6414         not supposed to happen.
6416         Fix minor GTK3 problems found by static checking.
6417         * emacsgtkfixed.c (EMACS_TYPE_FIXED, EMACS_FIXED, EmacsFixed)
6418         (EmacsFixedPrivate, EmacsFixedClass, struct _EmacsFixed)
6419         (struct _EmacsFixedClass, emacs_fixed_get_type):
6420         Move decls here from emacsgtkfixed.h, since they needn't be public.
6421         (emacs_fixed_get_type): Now static.
6422         (emacs_fixed_class_init): Omit unused local.
6423         (emacs_fixed_child_type): Remove; unused.
6424         * emacsgtkfixed.h (EMACS_TYPE_FIXED, EMACS_FIXED, EmacsFixed)
6425         (EmacsFixedPrivate, EmacsFixedClass, struct _EmacsFixed)
6426         (struct _EmacsFixedClass): Move to emacsgtkfixed.c.
6427         (EMACS_FIXED_CLASS, EMACS_IS_FIXED, EMACS_IS_FIXED_CLASS)
6428         (EMACS_FIXED_GET_CLASS): Remove; unused.
6429         * gtkutil.c (xg_create_frame_widgets) [!HAVE_GTK3]: Omit unused local.
6431         * keyboard.c (handle_async_input): Define only if SYNC_INPUT || SIGIO.
6432         Problem reported by Juanma Barranquero for Windows -Wunused-function.
6434 2012-04-22  Paul Eggert  <eggert@cs.ucla.edu>
6436         Modernize and clean up gmalloc.c to assume C89 (Bug#9119).
6437         * gmalloc.c (_MALLOC_INTERNAL, _MALLOC_H, _PP, __ptr_t)
6438         (__malloc_size_t, __malloc_ptrdiff_t):
6439         Remove.  All uses removed, replaced by the definiens if needed,
6440         since we can assume C89 or better now.
6441         Include <stdint.h>, for PTRDIFF_MAX, uintptr_t.
6442         (protect_malloc_state, align, get_contiguous_space)
6443         (malloc_atfork_handler_prepare, malloc_atfork_handler_parent)
6444         (malloc_atfork_handler_child, malloc_enable_thread)
6445         (malloc_initialize_1, __malloc_initialize, morecore_nolock)
6446         (_malloc_internal_nolock, _malloc_internal, malloc, _malloc)
6447         (_free, _realloc, _free_internal_nolock, _free_internal, free, cfree)
6448         (special_realloc, _realloc_internal_nolock, _realloc_internal)
6449         (realloc, calloc, __default_morecore, memalign, valloc, checkhdr)
6450         (freehook, mallochook, reallochook, mabort, mcheck, mprobe):
6451         Define using prototypes, not old style.
6452         (align, _malloc_internal_nolock, _free_internal_nolock, memalign):
6453         Don't assume ptrdiff_t and uintptr_t are no wider than unsigned long.
6454         (align): Don't assume that signed integer overflow wraps around.
6455         Omit unused local var.
6456         (malloc_initialize_1, morecore_nolock, _malloc_internal_nolock)
6457         (_free_internal_nolock, memalign, mallochook, reallochook):
6458         Omit no-longer-needed casts.
6459         (valloc): Use getpagesize, not __getpagesize.
6460         (MAGICWORD, MAGICFREE): Now randomish size_t values, not 32-bit.
6461         (struct hdr): The 'magic' member is now size_t, not unsigned long.
6463         * dbusbind.c (XD_DBUS_VALIDATE_OBJECT): Define only if needed.
6465 2012-04-22  Michael Albinus  <michael.albinus@gmx.de>
6467         Move functions from C to Lisp.  Make non-blocking method calls
6468         the default.  Implement further D-Bus standard interfaces.
6470         * dbusbind.c (DBUS_NUM_MESSAGE_TYPES): Declare.
6471         (QCdbus_request_name_allow_replacement)
6472         (QCdbus_request_name_replace_existing)
6473         (QCdbus_request_name_do_not_queue)
6474         (QCdbus_request_name_reply_primary_owner)
6475         (QCdbus_request_name_reply_in_queue)
6476         (QCdbus_request_name_reply_exists)
6477         (QCdbus_request_name_reply_already_owner): Move to dbus.el.
6478         (QCdbus_registered_serial, QCdbus_registered_method)
6479         (QCdbus_registered_signal): New Lisp objects.
6480         (XD_DEBUG_MESSAGE): Use sizeof.
6481         (XD_MESSAGE_TYPE_TO_STRING, XD_OBJECT_TO_STRING)
6482         (XD_DBUS_VALIDATE_BUS_ADDRESS, XD_DBUS_VALIDATE_OBJECT)
6483         (XD_DBUS_VALIDATE_BUS_NAME, XD_DBUS_VALIDATE_PATH)
6484         (XD_DBUS_VALIDATE_INTERFACE, XD_DBUS_VALIDATE_MEMBER): New macros.
6485         (XD_CHECK_DBUS_SERIAL): Rename from CHECK_DBUS_SERIAL_GET_SERIAL.
6486         (xd_signature, xd_append_arg): Allow float for integer types.
6487         (xd_get_connection_references): New function.
6488         (xd_get_connection_address): Rename from xd_initialize.
6489         Return cached address.
6490         (xd_remove_watch): Do not unset $DBUS_SESSION_BUS_ADDRESS.
6491         (xd_close_bus): Rename from Fdbus_close_bus.  Not needed on Lisp
6492         level.
6493         (Fdbus_init_bus): New optional arg PRIVATE.  Cache address.
6494         Return number of refcounts.
6495         (Fdbus_get_unique_name): Make stronger parameter check.
6496         (Fdbus_message_internal): New defun.
6497         (Fdbus_call_method, Fdbus_call_method_asynchronously)
6498         (Fdbus_method_return_internal, Fdbus_method_error_internal)
6499         (Fdbus_send_signal, Fdbus_register_service)
6500         (Fdbus_register_signal, Fdbus_register_method): Move to dbus.el.
6501         (xd_read_message_1): Obey new structure of Vdbus_registered_objects.
6502         (xd_read_queued_messages): Obey new structure of Vdbus_registered_buses.
6503         (Vdbus_compiled_version, Vdbus_runtime_version)
6504         (Vdbus_message_type_invalid, Vdbus_message_type_method_call)
6505         (Vdbus_message_type_method_return, Vdbus_message_type_error)
6506         (Vdbus_message_type_signal): New defvars.
6507         (Vdbus_registered_buses, Vdbus_registered_objects_table):
6508         Adapt docstring.
6510 2012-04-22  Paul Eggert  <eggert@cs.ucla.edu>
6512         Fix GC_MALLOC_CHECK debugging output on 64-bit hosts.
6513         * alloc.c (emacs_blocked_malloc) [GC_MALLOC_CHECK]:
6514         Do not assume ptrdiff_t is the same width as 'int'.
6516         * alloc.c: Handle unusual debugging option combinations.
6517         (GC_CHECK_MARKED_OBJECTS): Undef if ! GC_MARK_STACK,
6518         since the two debugging options are incompatible.
6519         (GC_MALLOC_CHECK): Similarly, undef if GC_CHECK_MARKED_OBJECTS
6520         is defined.
6521         (mem_init, mem_insert, mem_insert_fixup):
6522         Define if GC_MARK_STACK || GC_MALLOC_CHECK.
6523         (NEED_MEM_INSERT): Remove; no longer needed.
6525 2012-04-22  Leo Liu  <sdl.web@gmail.com>
6527         * sysdep.c (list_system_processes): Support Darwin (Bug#5725).
6529 2012-04-22  Paul Eggert  <eggert@cs.ucla.edu>
6531         * sysdep.c [__FreeBSD__]: Minor cleanups.
6532         (list_system_processes, system_process_attributes) [__FreeBSD__]:
6533         Use Emacs indenting style more consistently.  Avoid some casts.
6534         Use 'double' consistently rather than mixing 'float' and 'double'.
6536 2012-04-21  Eduard Wiebe  <usenet@pusto.de>
6538         * sysdep.c (list_system_processes, system_process_attributes):
6539         Add implementation for FreeBSD (Bug#5243).
6541 2012-04-21  Andreas Schwab  <schwab@linux-m68k.org>
6543         * lisp.mk (lisp): Update.
6545 2012-04-20  Paul Eggert  <eggert@cs.ucla.edu>
6547         * keyboard.c (process_pending_signals): Define only if SYNC_INPUT.
6548         It is never used otherwise.
6550 2012-04-20  Stefan Monnier  <monnier@iro.umontreal.ca>
6552         * print.c (print_preprocess): Only check print_depth if print-circle
6553         is nil.
6554         (print_object): Check for cycles even when print-circle is nil and
6555         print-gensym is t, but only check print_depth if print-circle is nil.
6557 2012-04-20  Chong Yidong  <cyd@gnu.org>
6559         * process.c (wait_reading_process_output): If EIO occurs on a pty,
6560         set the status to "failed" and ensure that sentinel is run.
6562 2012-04-20  Glenn Morris  <rgm@gnu.org>
6564         * process.c (Fset_process_inherit_coding_system_flag)
6565         (Fset_process_query_on_exit_flag): Doc fix (mention return value).
6566         (Fmake_network_process, Fmake_serial_process): Doc fix.
6568 2012-04-20  Eli Zaretskii  <eliz@gnu.org>
6570         * xdisp.c (string_buffer_position_lim): Limit starting position to
6571         BEGV.
6572         (set_cursor_from_row): If called for a mode-line or header-line
6573         row, return zero immediately.
6574         (try_cursor_movement): If inside continuation line, don't back up
6575         farther than the first row after the header line, if any.
6576         Don't consider the header-line row as "partially visible", even if
6577         MATRIX_ROW_PARTIALLY_VISIBLE_P returns non-zero.  (Bug#11261)
6579 2012-04-20  Atsuo Ohki  <ohki@gssm.otsuka.tsukuba.ac.jp>  (tiny change)
6581         * lread.c (lisp_file_lexically_bound_p): Fix hang at ";-*-\n"
6582         (bug#11238).
6584 2012-04-20  Teodor Zlatanov  <tzz@lifelogs.com>
6585 2012-04-18  Paul Eggert  <eggert@cs.ucla.edu>
6587         configure: new option --enable-gcc-warnings (Bug#11207)
6588         * Makefile.in (C_WARNINGS_SWITCH): Remove.
6589         (WARN_CFLAGS, WERROR_CFLAGS): New macros.
6590         (ALL_CFLAGS): Use new macros rather than old.
6591         * process.c: Ignore -Wstrict-overflow to work around GCC bug 52904.
6592         * regex.c: Ignore -Wstrict-overflow.  If !emacs, also ignore
6593         -Wunused-but-set-variable, -Wunused-function, -Wunused-macros,
6594         -Wunused-result, -Wunused-variable.  This should go away once
6595         the Emacs and Gnulib regex code is merged.
6596         (xmalloc, xrealloc): Now static.
6598 2012-04-17  Paul Eggert  <eggert@cs.ucla.edu>
6600         * dired.c (Fsystem_groups): Remove unused local.
6602 2012-04-17  Glenn Morris  <rgm@gnu.org>
6604         * dired.c (Fsystem_users): Doc fix.
6606 2012-04-17  Dmitry Antipov  <dmantipov@yandex.ru>
6608         * dired.c (Fsystem_users, Fsystem_groups): New functions.  (Bug#7900)
6609         (syms_of_dired): Add them.
6611 2012-04-16  Paul Eggert  <eggert@cs.ucla.edu>
6613         Fix minor alloc.c problems found by static checking.
6614         * alloc.c (_malloc_internal, _free_internal) [!DOUG_LEA_MALLOC]:
6615         New extern decls, to avoid calling undeclared functions.
6616         (dont_register_blocks): Define if ((!SYSTEM_MALLOC && !SYNC_INPUT)
6617         && GC_MALLOC_CHECK), not if ((GC_MARK_STACK || defined
6618         GC_MALLOC_CHECK) && GC_MALLOC_CHECK), to match when it's used.
6619         (NEED_MEM_INSERT): New macro.
6620         (mem_insert, mem_insert_fixup) [!NEED_MEM_INSERT]: Remove; unused.
6621         Remove one incorrect comment and fix another.
6623         Fix minor ralloc.c problems found by static checking.
6624         See http://lists.gnu.org/archive/html/emacs-devel/2011-12/msg00720.html
6625         * ralloc.c (ALIGNED, ROUND_TO_PAGE, HEAP_PTR_SIZE)
6626         (r_alloc_size_in_use, r_alloc_freeze, r_alloc_thaw): Remove; unused.
6627         (r_alloc_sbrk): Now static.
6629         Improve ralloc.c interface checking.
6630         See http://lists.gnu.org/archive/html/emacs-devel/2011-12/msg00720.html
6631         * buffer.c (ralloc_reset_variable, r_alloc, r_re_alloc)
6632         (r_alloc_free) [REL_ALLOC]: Move decls from here ...
6633         * lisp.h (r_alloc, r_alloc_free, r_re_alloc, r_alloc_reset_variable)
6634         [REL_ALLOC]: ... to here, to check interface.
6635         * m/ia64.h (r_alloc, r_alloc_free) [REL_ALLOC && !_MALLOC_INTERNAL]:
6636         Remove decls.  This fixes an "It stinks!".
6638         * alloc.c (which_symbols): Fix alignment issue / type clash.
6640 2012-04-15  Andreas Schwab  <schwab@linux-m68k.org>
6642         * lisp.h (struct Lisp_Symbol): Remove explicit padding.
6643         (struct Lisp_Misc_Any): Likewise.
6644         (struct Lisp_Free): Likewise.
6645         * alloc.c (union aligned_Lisp_Symbol): Define.
6646         (SYMBOL_BLOCK_SIZE, struct symbol_block): Use union
6647         aligned_Lisp_Symbol instead of struct Lisp_Symbol.
6648         (union aligned_Lisp_Misc): Define.
6649         (MARKER_BLOCK_SIZE, struct marker_block): Use union
6650         aligned_Lisp_Misc instead of union Lisp_Misc.
6651         (Fmake_symbol, allocate_misc, gc_sweep): Adjust.
6653 2012-04-14  Paul Eggert  <eggert@cs.ucla.edu>
6655         Make GC_MAKE_GCPROS_NOOPS the default (Bug#9926).
6656         * lisp.h (GC_MARK_STACK): Default to GC_MAKE_GCPROS_NOOPS.
6657         * s/cygwin.h, s/darwin.h, s/freebsd.h, s/gnu.h, s/irix6-5.h, s/msdos.h:
6658         * s/netbsd.h, s/sol2-6.h:
6659         Remove definition of GC_MARK_STACK, since the default now works.
6660         * s/aix4-2.h, s/hpux10-20.h, s/unixware.h:
6661         Define GC_MARK_STACK to GC_USE_GCPROS_AS_BEFORE, since that's
6662         no longer the default.
6663         * s/gnu-linux.h (GC_MARK_STACK): Adjust to change in default.
6665 2012-04-14  Atsuo Ohki  <ohki@gssm.otsuka.tsukuba.ac.jp>  (tiny change)
6667         * lread.c (lisp_file_lexically_bound_p):
6668         Fix hang at ";-*-\n" (bug#11238).
6670 2012-04-14  Eli Zaretskii  <eliz@gnu.org>
6672         * xdisp.c (find_last_unchanged_at_beg_row): Don't consider a row
6673         "unchanged" if its end.pos is beyond ZV.  (Bug#11199)
6675 2012-04-14  Jan Djärv  <jan.h.d@swipnet.se>
6677         * nsterm.m (constrainFrameRect): Always constrain when there is only
6678         one screen (Bug#10962).
6680 2012-04-13  Ken Brown  <kbrown@cornell.edu>
6682         * s/cygwin.h (PTY_OPEN): Don't try to close a bogus file descriptor.
6684 2012-04-13  Reuben Thomas  <rrt@sc3d.org>
6686         * indent.c (Fmove_to_column): Change interactive spec (Bug#739).
6688 2012-04-11  Daniel Colascione  <dancol@dancol.org>
6690         * s/cygwin.h: The vfork the #define in cygwin.h was protecting
6691         against is gone.  It's better to use vfork now so that when Cygwin
6692         gains a new, working vfork, we use it automatically (bug#10398).
6694 2012-04-11  Stefan Monnier  <monnier@iro.umontreal.ca>
6696         * window.c (save_window_save): Obey window-point-insertion-type.
6698 2012-04-11  Glenn Morris  <rgm@gnu.org>
6700         * Makefile.in (GNUSTEP_CFLAGS): Rename from C_SWITCH_X_SYSTEM.
6702 2012-04-11  Stefan Monnier  <monnier@iro.umontreal.ca>
6704         * alloc.c (lisp_align_malloc): Remove unneeded prototype.
6706 2012-04-10  Jason S. Cornez  <jcornez@ravenpack.com>  (tiny change)
6708         * keyboard.c: Override inhibit-quit after the third C-g (bug#6585).
6709         (force_quit_count): New var.
6710         (handle_interrupt): Use it.
6712 2012-04-10  Juanma Barranquero  <lekktu@gmail.com>
6714         * w32.c (w32_delayed_load): Record the full path of the library
6715         being loaded (bug#10424).
6717 2012-04-09  Glenn Morris  <rgm@gnu.org>
6719         * doc.c (Fsnarf_documentation): Check variables, functions are bound,
6720         not just in the obarray, before snarfing them.  (Bug#11036)
6722         * Makefile.in ($(leimdir)/leim-list.el):
6723         Pass EMACS rather than BUILT_EMACS.
6725 2012-04-09  Teodor Zlatanov  <tzz@lifelogs.com>
6727         * process.c (make_process):
6728         * process.h: Add integer `gnutls_handshakes_tried' member to
6729         process struct.
6731         * gnutls.h: Add `GNUTLS_EMACS_HANDSHAKES_LIMIT' upper limit.
6732         Add convenience `GNUTLS_LOG2i' macro.
6734         * gnutls.c (gnutls_log_function2i): Convenience log function.
6735         (emacs_gnutls_read): Use new log functions,
6736         `gnutls_handshakes_tried' process member, and
6737         `GNUTLS_EMACS_HANDSHAKES_LIMIT' to limit the number of handshake
6738         attempts per process (connection).
6740 2012-04-09  Chong Yidong  <cyd@gnu.org>
6742         * eval.c (Fuser_variable_p, user_variable_p_eh)
6743         (lisp_indirect_variable): Functions deleted.
6744         (Fdefvar): Caller changed.
6746         * callint.c (Finteractive, Fcall_interactively):
6747         * minibuf.c (Fread_variable): Callers changed.
6749 2012-04-09  Eli Zaretskii  <eliz@gnu.org>
6751         * xdisp.c (set_cursor_from_row): If the display string appears in
6752         the buffer at position that is closer to point than the position
6753         after the display string, display the cursor on the first glyph of
6754         the display string.  Fixes cursor display when a 'display' text
6755         property immediately follows invisible text.  (Bug#11094)
6757 2012-04-09  Paul Eggert  <eggert@cs.ucla.edu>
6759         composite.c: use 'double' consistently
6760         * composite.c (get_composition_id): Use 'double' consistently
6761         instead of converting 'float' to 'double' and vice versa; this is
6762         easier to understand and avoids a GCC warning.
6764 2012-04-09  Glenn Morris  <rgm@gnu.org>
6766         * Makefile.in: Generate leim-list with bootstrap-emacs, in
6767         preparation for dumping it with emacs.  (Bug#4789)
6768         (leimdir): New variable.
6769         ($(leimdir)/leim-list.el): New rule.
6770         (emacs$(EXEEXT)): Depend on leim-list.el.
6772         * buffer.c (Qucs_set_table_for_input): Remove.  (Bug#9821)
6773         (Fget_buffer_create): Don't call Qucs_set_table_for_input.
6774         (init_buffer_once, syms_of_buffer): Remove Qucs_set_table_for_input.
6776 2012-04-08  Andreas Schwab  <schwab@linux-m68k.org>
6778         * lisp.h (struct Lisp_Symbol): Add explicit padding to ensure
6779         proper alignment.
6781 2012-04-07  Juanma Barranquero  <lekktu@gmail.com>
6783         * xml.c (init_libxml2_functions) [WINDOWSNT]:
6784         Remove unused local variable.
6786 2012-04-07  Paul Eggert  <eggert@cs.ucla.edu>
6788         Avoid unnecessary pointer scanning in garbage collection (Bug#10780).
6789         * alloc.c (POINTERS_MIGHT_HIDE_IN_OBJECTS): New macro.
6790         (mark_memory): Mark Lisp_Objects only if pointers might hide in
6791         objects, as mark_maybe_pointer will catch them otherwise.
6792         (GC_LISP_OBJECT_ALIGNMENT): Remove; no longer needed.
6793         * s/gnu-linux.h (GC_LISP_OBJECT_ALIGNMENT) [__mc68000__]: Likewise.
6795 2012-04-07  Paul Eggert  <eggert@cs.ucla.edu>
6797         Fix typo that broke non-Windows builds.
6798         * xml.c (libxml2_loaded_p) [!!WINDOWSNT]: 'inine' -> 'inline'.
6800 2012-04-07  Eli Zaretskii  <eliz@gnu.org>
6802         Support building on MS-Windows with libxml2.
6804         * makefile.w32-in (OBJ2): Add xml.$(O).
6805         (GLOBAL_SOURCES): Add xml.c.
6806         ($(BLD)/xml.$(O)): New dependency list.
6808         * xml.c (DEF_XML2_FN, LOAD_XML2_FN) [WINDOWSNT]: New macros.
6809         (fn_htmlReadMemory, fn_xmlReadMemory, fn_xmlDocGetRootElement)
6810         (fn_xmlFreeDoc, fn_xmlCleanupParser, fn_xmlCheckVersion)
6811         [!WINDOWSNT]: New macros.
6812         (init_libxml2_functions, libxml2_loaded_p): New functions.
6813         (parse_region): Call fn_xmlCheckVersion instead of using the macro
6814         LIBXML_TEST_VERSION.  Call libxml2 functions via the fn_* macros.
6815         (xml_cleanup_parser): New function, export for fn_xmlCleanupParser.
6816         Calls xmlCleanupParser only if libxml2 was loaded (or statically
6817         linked in).
6818         (Flibxml_parse_html_region, Flibxml_parse_xml_region):
6819         Call init_libxml2_functions before calling libxml2 functions.
6820         (syms_of_xml) <Qlibxml2_dll>: DEFSYM it.
6822         * emacs.c: Don't include libxml/parser.h.
6823         (shut_down_emacs): Call xml_cleanup_parser, instead of calling
6824         xmlCleanupParser directly.
6826         * lisp.h [HAVE_LIBXML2]: Add prototype for xml_cleanup_parser.
6828 2012-04-07  Eli Zaretskii  <eliz@gnu.org>
6830         * indent.c (Fvertical_motion): If there is a display string at
6831         point, use it.vpos to compute how many lines to backtrack after
6832         move_it_to point.  (Bug#11133)
6834 2012-04-06  Eli Zaretskii  <eliz@gnu.org>
6836         * buffer.h (FETCH_CHAR, FETCH_MULTIBYTE_CHAR):
6837         * character.h (STRING_CHAR, STRING_CHAR_AND_LENGTH): Add comments
6838         about subtle differences between FETCH_CHAR* and STRING_CHAR*
6839         macros related to unification of CJK characters.  For the details,
6840         see the discussion following the message here:
6841         http://debbugs.gnu.org/cgi/bugreport.cgi?bug=11073#14.
6843 2012-04-04  Chong Yidong  <cyd@gnu.org>
6845         * keyboard.c (Vdelayed_warnings_list): Doc fix.
6847 2012-04-01  Eli Zaretskii  <eliz@gnu.org>
6849         * w32menu.c (simple_dialog_show, add_menu_item): Use SAFE_ALLOCA
6850         instead of alloca.  (Bug#11138)
6852 2012-04-01  Andreas Schwab  <schwab@linux-m68k.org>
6854         * w32menu.c (is_simple_dialog): Properly check lisp types.
6855         (Bug#11141)
6857 2012-03-31  Eli Zaretskii  <eliz@gnu.org>
6859         * xdisp.c (move_it_by_lines): When DVPOS is positive, and the
6860         position we get to after a call to move_it_to fails the
6861         IS_POS_VALID_AFTER_MOVE_P test, move to the next buffer position
6862         only if we wind up in a string from display property.  (Bug#11063)
6864         * window.c (Fdelete_other_windows_internal): Invalidate the row
6865         and column information about mouse highlight, so that redisplay
6866         restores it after reallocating the glyph matrices.  (Bug#7464)
6868         * xdisp.c (set_cursor_from_row): If `cursor' property on a display
6869         string comes from a `display' text property, use the buffer
6870         position of that property as if we actually saw that position in
6871         the row's glyphs.
6872         (move_it_by_lines): Remove the assertion that
6873         "it->current_x == 0 && it->hpos == 0" which can be legitimately
6874         violated when there's a before-string at the beginning of a line.
6875         (Bug#11063)
6877 2012-03-30  Eli Zaretskii  <eliz@gnu.org>
6879         * xdisp.c (append_space_for_newline): If the default face was
6880         remapped, use the remapped face for the appended newline.
6881         (extend_face_to_end_of_line): Use the remapped default face for
6882         extending the face to the end of the line.
6883         (display_line): Call extend_face_to_end_of_line when the default
6884         face was remapped.  (Bug#11068)
6886 2012-03-29  Eli Zaretskii  <eliz@gnu.org>
6888         * s/ms-w32.h: Discourage from defining HAVE_GETCWD.
6890 2012-03-28  Stefan Monnier  <monnier@iro.umontreal.ca>
6892         * keyboard.c (safe_run_hooks_error): Don't unquote strings.
6894 2012-03-27  Glenn Morris  <rgm@gnu.org>
6896         * search.c (Fword_search_backward_lax, Fword_search_forward_lax):
6897         Doc fixes.
6899 2012-03-26  Kenichi Handa  <handa@m17n.org>
6901         * dispextern.h (struct glyph): Fix previous change.  Change the
6902         bit length of glyphless.ch to 25 (Bug#11082).
6904 2012-03-26  Chong Yidong  <cyd@gnu.org>
6906         * keyboard.c (Vselection_inhibit_update_commands): New variable.
6907         (command_loop_1): Use it; inhibit selection update for
6908         handle-select-window too (Bug#8996).
6910 2012-03-25  Fabrice Popineau  <fabrice.popineau@supelec.fr>
6912         * w32heap.c (_heap_init, _heap_term): Remove dead MSVC-specific code.
6914 2012-03-25  Kenichi Handa  <handa@m17n.org>
6916         * dispextern.h (struct glyph): Change the bit length of
6917         glyphless.ch to 22 to make the member glyphless fit in 32 bits.
6919 2012-03-24  Eli Zaretskii  <eliz@gnu.org>
6921         * s/ms-w32.h (tzname): Include time.h before redirecting to
6922         _tzname.  Fixes the MSVC build.  (Bug#9960)
6924 2012-03-24  Andreas Schwab  <schwab@linux-m68k.org>
6926         * xdisp.c (produce_glyphless_glyph): Limit length of acronym to 6
6927         characters.
6929         * xterm.c (XTread_socket): Only modify handling_signal if
6930         !SYNC_INPUT.  (Bug#11080)
6932 2012-03-23  Eli Zaretskii  <eliz@gnu.org>
6934         * bidi.c (bidi_fetch_char): Use STRING_CHAR_AND_LENGTH instead of
6935         FETCH_MULTIBYTE_CHAR followed by CHAR_BYTES.  Prevents crashes
6936         when fetching a multibyte character consumes more bytes than
6937         CHAR_BYTES returns, due to unification of CJK characters in
6938         string_char.  (Bug#11073)
6940 2012-03-23  Troels Nielsen  <bn.troels@gmail.com>  (tiny change)
6942         * process.c (wait_reading_process_output): Handle pty disconnect
6943         by refraining from sending oneself a SIGCHLD (bug#10933).
6945 2012-03-22  Chong Yidong  <cyd@gnu.org>
6947         * dispextern.h (struct it): New member string_from_prefix_prop_p.
6949         * xdisp.c (push_prefix_prop): Rename from push_display_prop.
6950         Mark string as coming from a prefix property.
6951         (handle_face_prop): Use default face for prefix strings (Bug#4281).
6952         (pop_it, reseat_1): Save and restore string_from_prefix_prop_p.
6954 2012-03-21  Chong Yidong  <cyd@gnu.org>
6956         * xfaces.c (Vface_remapping_alist): Doc fix.
6958 2012-03-20  Eli Zaretskii  <eliz@gnu.org>
6960         * w32proc.c (Fw32_set_console_codepage)
6961         (Fw32_set_console_output_codepage, Fw32_get_codepage_charset):
6962         Doc fixes.
6964 2012-03-20  Chong Yidong  <cyd@gnu.org>
6966         * dispnew.c (Fredisplay, Vredisplay_preemption_period): Update doc
6967         to reflect default non-nil value of redisplay-dont-pause.
6969 2012-03-19  Kenichi Handa  <handa@m17n.org>
6971         * ftfont.c (ftfont_drive_otf): Mask bits of character code to make
6972         it fit in a valid range (Bug#11003).
6974 2012-03-18  Eli Zaretskii  <eliz@gnu.org>
6976         * xdisp.c (cursor_row_p): Even if the glyph row ends in a string
6977         that is not from display property, accept the row as a "cursor
6978         row" if one of the string's character has a non-nil `cursor'
6979         property.  Fixes cursor positioning when there are newlines in
6980         overlay strings, e.g. in icomplete.el.  (Bug#11035)
6982 2012-03-12  Paul Eggert  <eggert@cs.ucla.edu>
6984         * buffer.c (compare_overlays): Don't assume args differ (Bug#6830).
6986 2012-03-12  Chong Yidong  <cyd@gnu.org>
6988         * eval.c (inhibit_lisp_code): Rename from
6989         inhibit_window_configuration_change_hook; move from window.c.
6991         * xfns.c (unwind_create_frame_1, Fx_create_frame):
6992         * window.c (run_window_configuration_change_hook)
6993         (syms_of_window): Callers changed.
6995 2012-03-11  Chong Yidong  <cyd@gnu.org>
6997         * keymap.c (Fkey_description): Doc fix (Bug#9700).
6999         * editfns.c (Fconstrain_to_field): Doc fix (Bug#9452).
7001 2012-03-10  Chong Yidong  <cyd@gnu.org>
7003         * frame.c (other_visible_frames): Don't assume the selected frame
7004         is visible (Bug#10955).
7006 2012-03-09  Stefan Monnier  <monnier@iro.umontreal.ca>
7008         * buffer.c (compare_overlays): Avoid qsort's instability (bug#6830).
7010 2012-03-08  Jan Djärv  <jan.h.d@swipnet.se>
7012         * gtkutil.c (x_wm_set_size_hint): Use one row in call to
7013         FRAME_TEXT_LINES_TO_PIXEL_HEIGHT so base_height is greater than
7014         zero (Bug#10954).
7016 2012-03-03  Glenn Morris  <rgm@gnu.org>
7018         * alloc.c (Fgarbage_collect, misc-objects-consed): Doc fixes.
7020 2012-03-02  Eli Zaretskii  <eliz@gnu.org>
7022         * xdisp.c (try_window_reusing_current_matrix): Don't move cursor
7023         position past the first glyph_row that ends at ZV.  (Bug#10902)
7024         (redisplay_window, next_element_from_string): Fix typos in
7025         comments.
7026         (redisplay_window): Pass to move_it_vertically the margin in
7027         pixels, not in screen lines.
7029 2012-03-02  Glenn Morris  <rgm@gnu.org>
7031         * buffer.c (buffer-list-update-hook): Doc fix.
7033 2012-02-29  Eli Zaretskii  <eliz@gnu.org>
7035         * xdisp.c (get_overlay_strings_1): Under bidi redisplay, call
7036         push_it before setting up the iterator for the first overlay
7037         string, even if we have an empty string loaded.
7038         (next_overlay_string): If there's an empty string on the iterator
7039         stack, pop the stack.  (Bug#10903)
7041 2012-02-25  Paul Eggert  <eggert@cs.ucla.edu>
7043         Generalize fix for crash due to non-contiguous EMACS_INT (Bug#10780).
7044         Suggested by Stefan Monnier in
7045         <http://lists.gnu.org/archive/html/emacs-devel/2012-02/msg00692.html>.
7046         * alloc.c (widen_to_Lisp_Object): New static function.
7047         (mark_memory): Also mark Lisp_Objects by fetching pointer words
7048         and widening them to Lisp_Objects.  This would work even if
7049         USE_LSB_TAG is defined and wide integers are used, which might
7050         happen in a future version of Emacs.
7052 2012-02-25  Chong Yidong  <cyd@gnu.org>
7054         * fileio.c (Ffile_selinux_context, Fset_file_selinux_context):
7055         Doc fix.
7057         * xselect.c (Fx_selection_exists_p): Doc fix.
7058         (x_clipboard_manager_save_all): Print an informative message
7059         before saving to clipboard manager.
7061 2012-02-24  Chong Yidong  <cyd@gnu.org>
7063         * keyboard.c (process_special_events): Handle all X selection
7064         requests in kbd_buffer, not just the next one (Bug#8869).
7066 2012-02-23  Chong Yidong  <cyd@gnu.org>
7068         * xfns.c (Fx_create_frame): Avoid window-configuration-change-hook
7069         call when setting menu-bar-lines and tool-bar-lines parameters.
7070         (unwind_create_frame_1): New helper function.
7072         * window.c (inhibit_window_configuration_change_hook): New var.
7073         (run_window_configuration_change_hook): Obey it.
7074         (syms_of_window): Initialize it.
7076 2012-02-22  Chong Yidong  <cyd@gnu.org>
7078         * xterm.c (x_draw_image_relief): Add missing type check for
7079         Vtool_bar_button_margin (Bug#10743).
7081 2012-02-21  Chong Yidong  <cyd@gnu.org>
7083         * fileio.c (Vfile_name_handler_alist): Doc fix.
7085         * buffer.c (Fget_file_buffer): Protect against invalid file
7086         handler return value.
7088 2012-02-20  Paul Eggert  <eggert@cs.ucla.edu>
7090         * .gdbinit (xreload): Don't assume EMACS_INT fits in 'long'
7091         when computing $valmask.
7093         Fix crash due to non-contiguous EMACS_INT (Bug#10780).
7094         * lisp.h (VALBITS): Move definition up, so that USE_LSB_TAG can use it.
7095         (USE_LSB_TAG): Do not define if UINTPTR_MAX >> VALBITS == 0.
7096         It's useless in that case, and it can cause problems on hosts
7097         that allocate halves of EMACS_INT values separately.
7098         Reported by Dan Horák.  Diagnosed by Andreas Schwab in
7099         <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=10780#30>.
7100         * mem-limits.h (EXCEEDS_LISP_PTR): Define to 0 on hosts where
7101         UINTPTR_MAX >> VALBITS == 0.  This is required by the above change;
7102         it avoids undefined behavior on hosts where shifting right by more
7103         than the word width has undefined behavior.
7105 2012-02-19  Chong Yidong  <cyd@gnu.org>
7107         * fileio.c (Ffile_name_directory, Ffile_name_nondirectory)
7108         (Funhandled_file_name_directory, Ffile_name_as_directory)
7109         (Fdirectory_file_name, Fexpand_file_name)
7110         (Fsubstitute_in_file_name): Protect against invalid file handler
7111         return values (Bug#10845).
7113 2012-02-18  Eli Zaretskii  <eliz@gnu.org>
7115         * .gdbinit (pitx): Fix incorrect references to fields of the
7116         iterator stack.
7118 2012-02-17  Chong Yidong  <cyd@gnu.org>
7120         * syntax.c (Fscan_lists): Doc fix (Bug#10833).
7122 2012-02-15  Paul Eggert  <eggert@cs.ucla.edu>
7124         * image.c (MAX_IMAGE_SIZE): Increase from 6.0 to 10.0; see
7125         <http://lists.gnu.org/archive/html/emacs-devel/2012-02/msg00540.html>.
7127 2012-02-15  Chong Yidong  <cyd@gnu.org>
7129         * eval.c (Fdefvar, Fdefconst): Doc fix; note that the variable is
7130         marked as special.  Also, starting docstrings with * is obsolete.
7132 2012-02-13  Andreas Schwab  <schwab@linux-m68k.org>
7134         * gnutls.c (emacs_gnutls_write): Fix last change.
7136 2012-02-13  Lars Ingebrigtsen  <larsi@gnus.org>
7138         * gnutls.c (emacs_gnutls_write): Set errno appropriately for
7139         send_process.
7141 2012-02-13  Stefan Monnier  <monnier@iro.umontreal.ca>
7143         * keymap.c (Fsingle_key_description): Handle char ranges.
7145 2012-02-12  Chong Yidong  <cyd@gnu.org>
7147         * xdisp.c (handle_stop): Avoid assigning -1 to it->face_id here,
7148         as that creates a dangerous corner case.
7150         * window.c (Fdelete_window_internal): Invalidate the mouse
7151         highlight (Bug#9904).
7153 2012-02-12  Glenn Morris  <rgm@gnu.org>
7155         * xselect.c (Fx_own_selection_internal)
7156         (Fx_get_selection_internal, Fx_disown_selection_internal)
7157         (Fx_selection_owner_p, Fx_selection_exists_p): Doc fixes.
7158         * nsselect.m (Fx_own_selection_internal)
7159         (Fx_disown_selection_internal, Fx_selection_exists_p)
7160         (Fx_selection_owner_p, Fx_get_selection_internal):
7161         Sync docs and argument specs with the xselect.c versions.
7163 2012-02-11  Lars Ingebrigtsen  <larsi@gnus.org>
7165         * gnutls.c (emacs_gnutls_write): Don't infloop if sendto fails.
7167 2012-02-11  Eli Zaretskii  <eliz@gnu.org>
7169         * w32select.c (Fx_selection_exists_p): Sync doc string and
7170         argument list with xselect.c.  (Bug#10783)
7172         * w16select.c (Fx_selection_exists_p): Sync doc string and
7173         argument list with xselect.c.  (Bug#10783)
7175 2012-02-10  Glenn Morris  <rgm@gnu.org>
7177         * fns.c (Fsecure_hash): Doc fix.
7179 2012-02-09  Kenichi Handa  <handa@m17n.org>
7181         * coding.c (produce_chars): Fix updating of src_end (Bug#10701).
7183 2012-02-07  Chong Yidong  <cyd@gnu.org>
7185         * buffer.c (Fbuffer_local_variables)
7186         (buffer_lisp_local_variables): Handle unbound vars correctly;
7187         don't let Qunbound leak into Lisp.
7189 2012-02-07  Glenn Morris  <rgm@gnu.org>
7191         * image.c (Fimagemagick_types): Doc fix.
7193         * image.c (imagemagick-render-type): Change it from a lisp object
7194         to an integer.  Move the doc here from the lisp manual.
7195         Treat all values not equal to 0 the same.
7197 2012-02-06  Chong Yidong  <cyd@gnu.org>
7199         * doc.c (store_function_docstring): Avoid applying docstring of
7200         alias to base function (Bug#2603).
7202 2012-02-04  Andreas Schwab  <schwab@linux-m68k.org>
7204         * .gdbinit (pp1, pv1): Remove redundant defines.
7205         (pr): Use pp.
7207 2012-02-04  Chong Yidong  <cyd@gnu.org>
7209         * nsterm.m: Declare a global (Bug#10694).
7211 2012-02-04  Eli Zaretskii  <eliz@gnu.org>
7213         * w32.c (get_emacs_configuration_options):
7214         Include --enable-checking, if specified, in the return value.
7216 2012-02-04  Martin Rudalics  <rudalics@gmx.at>
7218         * dispnew.c (change_frame_size_1): Calculate new_frame_total_cols
7219         after rounding frame sizes.  (Bug#9723)
7221 2012-02-04  Eli Zaretskii  <eliz@gnu.org>
7223         * keyboard.c (adjust_point_for_property): Don't position point
7224         before BEGV.  (Bug#10696)
7226 2012-02-03  Paul Eggert  <eggert@cs.ucla.edu>
7228         Handle overflow when computing char display width (Bug#9496).
7229         * character.c (char_width): Return EMACS_INT, not int.
7230         (char_width, c_string_width): Check for overflow when
7231         computing the width; this is possible now that individual
7232         characters can have unbounded width.  Problem introduced
7233         by merge from Emacs 23 on 2012-01-19.
7235 2012-02-02  Michael Albinus  <michael.albinus@gmx.de>
7237         * dbusbind.c (Fdbus_register_method): Mention the return value
7238         :ignore in the docstring.
7240 2012-02-02  Glenn Morris  <rgm@gnu.org>
7242         * callproc.c (Fcall_process, Fcall_process_region): Doc fix.
7244         * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
7245         Unconditionally set to t.  (Bug#10673)
7246         * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
7247         * w32term.c (syms_of_w32term) <x-toolkit-scroll-bars>:
7248         * xterm.c (syms_of_xterm) <x-toolkit-scroll-bars>: Doc fix.
7250 2012-02-02  Kenichi Handa  <handa@m17n.org>
7252         (x_produce_glyphs): Cancel previous change.  If cmp->glyph_len is
7253         0, do not call append_composite_glyph.
7255 2012-02-02  Kenichi Handa  <handa@m17n.org>
7257         * xdisp.c (BUILD_COMPOSITE_GLYPH_STRING): Initialize first_s to
7258         NULL (Bug#6988).
7259         (x_produce_glyphs): If the component of a composition is a null
7260         string, set it->pixel_width to 1 to avoid zero-width glyph.
7262 2012-02-01  Eli Zaretskii  <eliz@gnu.org>
7264         * ralloc.c (resize_bloc, r_alloc_sbrk): Don't call memmove if its
7265         first 2 arguments are identical.  This makes inserting large
7266         output from a subprocess an order of magnitude faster on
7267         MS-Windows, where all sbrk'ed memory is always contiguous.
7269 2012-01-31  Glenn Morris  <rgm@gnu.org>
7271         * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
7272         * w32term.c (syms_of_w32term) <x-toolkit-scroll-bars>:
7273         * xterm.c (syms_of_xterm) <x-toolkit-scroll-bars>: Sync docs.
7275 2012-01-29  Glenn Morris  <rgm@gnu.org>
7277         * gnutls.c (syms_of_gnutls): More doc (from etc/NEWS).
7279 2012-01-28  Samuel Thibault  <sthibault@debian.org>  (tiny change)
7281         * s/gnu.h: Define POSIX_SIGNALS (Bug#10552).
7283 2012-01-28  Chong Yidong  <cyd@gnu.org>
7285         * minibuf.c (syms_of_minibuf): Doc fix (Bug#10550).
7287 2012-01-26  Chong Yidong  <cyd@gnu.org>
7289         * keyboard.c (Vecho_keystrokes): Document zero value (Bug#10503).
7291         * search.c (Fsearch_forward, Fsearch_backward): Document negative
7292         repeat counts (Bug#10507).
7294 2012-01-26  Glenn Morris  <rgm@gnu.org>
7296         * lread.c (syms_of_lread): Doc fix.
7298 2012-01-25  HIROSHI OOTA  <nil@mad.dog.cx>  (tiny change)
7300         * coding.c (encode_designation_at_bol): Change return value to
7301         EMACS_INT.
7303 2012-01-25  Chong Yidong  <cyd@gnu.org>
7305         * eval.c (Fuser_variable_p): Doc fix; mention custom-variable-p.
7307 2012-01-21  Chong Yidong  <cyd@gnu.org>
7309         * floatfns.c (Fcopysign): Make the second argument non-optional,
7310         since nil is not allowed anyway.
7312 2012-01-21  Andreas Schwab  <schwab@linux-m68k.org>
7314         * process.c (read_process_output): Use p instead of XPROCESS (proc).
7315         (send_process): Likewise.
7317 2012-01-19  Martin Rudalics  <rudalics@gmx.at>
7319         * window.c (save_window_save, Fcurrent_window_configuration)
7320         (Vwindow_persistent_parameters): Do not use Qstate.
7321         Rewrite doc-strings.
7323 2012-01-19  Kenichi Handa  <handa@m17n.org>
7325         * character.c (char_width): New function.
7326         (Fchar_width, c_string_width, lisp_string_width):
7327         Use char_width (Bug#9496).
7329 2012-01-16  Martin Rudalics  <rudalics@gmx.at>
7331         * window.c (Vwindow_persistent_parameters): New variable.
7332         (Fset_window_configuration, save_window_save): Handle persistent
7333         window parameters.
7335 2012-01-14  Eli Zaretskii  <eliz@gnu.org>
7337         * w32fns.c (signal_user_input): Don't do a QUIT, to avoid
7338         thrashing the stack of the thread.  (Bug#9087)
7340 2012-01-12  Paul Eggert  <eggert@cs.ucla.edu>
7342         * xdisp.c (rows_from_pos_range): Add parens as per gcc -Wparentheses.
7344 2012-01-11  Eli Zaretskii  <eliz@gnu.org>
7346         * xdisp.c (rows_from_pos_range): Handle the case where the
7347         highlight ends on a newline.  (Bug#10464)
7348         (mouse_face_from_buffer_pos): Fix off-by-one error in calculating
7349         he end column for display of highlight that ends on a newline
7350         before a R2L line.
7352 2012-01-11  Glenn Morris  <rgm@gnu.org>
7354         * lread.c (init_lread): If no-site-lisp, remove site-lisp dirs
7355         from load-path also when installation-directory is nil.  (Bug#10208)
7357 2012-01-10  Glenn Morris  <rgm@gnu.org>
7359         * emacs.c (syms_of_emacs) <installation-directory>: Doc fix.
7361         * epaths.in (PATH_LOADSEARCH, PATH_EXEC, PATH_DATA, PATH_DOC):
7362         Update template values to be closer to their typical values these days.
7364 2012-01-09  Eli Zaretskii  <eliz@gnu.org>
7366         * xdisp.c (rows_from_pos_range): Accept additional argument
7367         DISP_STRING, and accept any glyph in a row whose object is that
7368         string as eligible for mouse highlight.  Fixes mouse highlight of
7369         display strings from overlays.  (Bug#10464)
7371 2012-01-07  Paul Eggert  <eggert@cs.ucla.edu>
7373         emacs: fix an auto-save permissions race condition (Bug#10400)
7374         * fileio.c (auto_saving_dir_umask): New static var.
7375         (Fmake_directory_internal): Use it.
7376         (do_auto_save_make_dir): Set it, instead of invoking chmod after
7377         creating the directory.  The old code temporarily assigns
7378         too-generous permissions to the directory.
7379         (do_auto_save_eh): Clear it.
7380         (Fdo_auto_save): Catch all errors, not just file errors, so
7381         that the var is always cleared.
7383 2012-01-07  Eli Zaretskii  <eliz@gnu.org>
7385         * search.c (scan_buffer): Pass character positions to
7386         know_region_cache, not byte positions.  (Bug#6540)
7388 2012-01-07  LynX  <_LynX@bk.ru>  (tiny change)
7390         * w32.c (sys_rename): Report EXDEV when rename of a directory
7391         fails because the target is on another logical disk.  (Bug#10284)
7393 2012-01-07  David Benjamin  <davidben@mit.edu>  (tiny change)
7395         * xterm.c (x_embed_request_focus): New function.
7397         * xterm.h: Add prototype.
7399         * xfns.c (Fx_focus_frame): Use it for embedded frames (Bug#9977).
7401 2012-01-05  Glenn Morris  <rgm@gnu.org>
7403         * emacs.c (emacs_copyright): Update short copyright year to 2012.
7405 2012-01-01  Eli Zaretskii  <eliz@gnu.org>
7407         * gnutls.c (init_gnutls_functions): Load gnutls_check_version.
7408         Load gnutls_transport_set_lowat only if GnuTLS version is below
7409         2.11.1.
7410         (emacs_gnutls_handshake): Call gnutls_transport_set_lowat only for
7411         GnuTLS versions below 2.11.1.
7413 2011-12-31  Antoine Levitt  <antoine.levitt@gmail.com>
7415         * xdisp.c (syms_of_xdisp) <window-scroll-functions>: Add warning
7416         to the doc string advising against its use for altering the way
7417         windows are scrolled.
7419 2011-12-28  Kenichi Handa  <handa@m17n.org>
7421         * coding.c (Fdefine_coding_system_internal): Make an utf-8 base
7422         coding-system ASCII compatible only when it does not produce BOM
7423         on encoding (Bug#10383).
7425 2011-12-26  Jan Djärv  <jan.h.d@swipnet.se>
7427         * xmenu.c (x_menu_wait_for_event): Use xg_select for Gtk3 so menus
7428         can scroll.
7429         (create_and_show_popup_menu): Always use menu_position_func for
7430         Gtk3 (Bug#10361).
7432 2011-12-24  Andreas Schwab  <schwab@linux-m68k.org>
7434         * callint.c (Fcall_interactively): Don't truncate prompt string.
7436 2011-12-23  Eli Zaretskii  <eliz@gnu.org>
7438         * xdisp.c (handle_invisible_prop): Handle correctly an invisible
7439         property that ends at ZV, so that the bidi iteration could be
7440         resumed from there (after widening).  (Bug#10360)
7442 2011-12-22  Jan Djärv  <jan.h.d@swipnet.se>
7444         * nsfont.m (ns_spec_to_descriptor): Do not autorelease fdesc.
7446 2011-12-21  Jan Djärv  <jan.h.d@swipnet.se>
7448         * nsterm.m (x_free_frame_resources):
7449         Release f->output_data.ns->miniimage.
7450         (ns_index_color): Fix indentation.  Do not retain
7451         color_table->colors[i].
7453         * nsmenu.m (ns_update_menubar): Call free_menubar_widget_value_tree
7454         before returning.
7456         * nsfns.m (x_set_background_color): Assign return value from
7457         ns_index_color to face-background instead of NSColor*.
7458         (ns_implicitly_set_icon_type): Fix indentation.
7459         Change assignment in for loop to comparison.
7461         * emacs.c (ns_pool): New variable.
7462         (main): Assign ns_pool.
7463         (Fkill_emacs): Call ns_release_autorelease_pool.
7465         * nsfont.m (ns_spec_to_descriptor): Fix indentation,
7466         autorelease fdesc, release fdAttrs and tdict.
7467         (ns_get_covering_families): Release charset.
7468         (ns_findfonts): Release NSFontDescriptor created with new.
7469         (ns_uni_to_glyphs): Fix indentation.
7470         (setString): Release attrStr before assigning new value.
7472 2011-12-18  Jan Djärv  <jan.h.d@swipnet.se>
7474         * nsmenu.m (NSMenuDidBeginTrackingNotification): Declare if OSX < 10.5
7475         and NS_IMPL_COCOA.
7476         (trackingNotification): Surround with ifdef NS_IMPL_COCOA.
7477         (syms_of_nsmenu): Set trackingMenu to 1 if not NS_IMPL_COCOA.
7479 2011-12-18  David Reitter  <reitter@cmu.edu>
7481         * nsterm.m (ns_term_init): Subscribe for notifications
7482         NSMenuDidBeginTrackingNotification and NSMenuDidEndTrackingNotification
7483         to method trackingNotification in EmacsMenu.
7485         * nsmenu.m (trackingMenu): New variable.
7486         (trackingNotification): New method (from Aquamacs).
7487         (menuNeedsUpdate): Expand comment and return if trackingMenu is 0,
7488         from Aquamacs (Bug#7030).
7490 2011-12-18  Jan Djärv  <jan.h.d@swipnet.se>
7492         * nsselect.m (CUT_BUFFER_SUPPORT): Remove define.
7493         (symbol_to_nsstring): Fix indentation.
7494         (ns_symbol_to_pb): New function.
7495         (Fns_get_selection_internal): Rename from Fns_get_cut_buffer_internal.
7496         (Fns_rotate_cut_buffers_internal): Remove.
7497         (Fns_store_selection_internal): Rename from
7498         Fns_store_cut_buffer_internal.
7499         (ns_get_foreign_selection, Fx_own_selection_internal)
7500         (Fx_disown_selection_internal, Fx_selection_exists_p)
7501         (Fns_get_selection_internal, Fns_store_selection_internal):
7502         Use ns_symbol_to_pb and check if return value is nil.
7503         (syms_of_nsselect): Remove ifdef CUT_BUFFER_SUPPORT.  Remove defsubr
7504         Sns_rotate_cut_buffers_internal.  Sns_get_cut_buffer_internal
7505         renamed to Sns_get_selection_internal, Sns_store_cut_buffer_internal
7506         renamed to Sns_store_selection_internal.
7507         (ns_handle_selection_request): Move code to Fx_own_selection_internal
7508         and remove this function.
7509         (ns_handle_selection_clear): Remove, never used.
7510         (Fx_own_selection_internal): Move code from ns_handle_selection_request
7511         here.
7513 2011-12-17  Ken Brown  <kbrown@cornell.edu>
7515         * fileio.c (check_writable) [CYGWIN]: Return non-zero if UID or
7516         GID is unknown (Bug#10257).
7518 2011-12-17  Paul Eggert  <eggert@cs.ucla.edu>
7520         * s/gnu-linux.h: Fix mark_memory typo (Bug#10286).
7521         (GC_MARK_SECONDARY_STACK): Omit removed 3rd arg to mark_memory,
7522         which caused a build failure on GNU/Linux IA-64.  This problem was
7523         introduced by my 2011-10-07 patch.
7525 2011-12-15  Juri Linkov  <juri@jurta.org>
7527         * image.c (imagemagick_error): New function.  (Bug#10112)
7528         (imagemagick_load_image): Comment out `MagickSetResolution' call.
7529         Use `imagemagick_error' where ImageMagick functions return
7530         `MagickFalse'.
7531         (Fimagemagick_types): Add `Fnreverse' to return the list in the
7532         proper order.
7534 2011-12-15  YAMAMOTO Mitsuharu  <mituharu@math.s.chiba-u.ac.jp>
7536         * xftfont.c (xftfont_draw): Use the font metrics of s->font to
7537         fill background (Bug#8992).
7539 2011-12-13  Martin Rudalics  <rudalics@gmx.at>
7541         * window.c (Vwindow_combination_resize)
7542         (Vwindow_combination_limit): Use t instead of non-nil in
7543         doc-strings.
7544         (Vrecenter_redisplay): Add first sentence of doc-string on
7545         separate line.
7546         (Frecenter): Fix doc-string typo.
7548 2011-12-11  Kenichi Handa  <handa@m17n.org>
7550         * coding.c (Funencodable_char_position): Pay attention to the
7551         buffer text relocation (Bug#9389).
7553 2011-12-10  Jan Djärv  <jan.h.d@swipnet.se>
7555         * xterm.c (x_term_init): Move call to gdk_window_add_filter before
7556         gtk_init (Bug#10100).
7558 2011-12-10  Eli Zaretskii  <eliz@gnu.org>
7560         * xdisp.c (RECORD_MAX_MIN_POS): Use IT->cmp_it.charpos only if
7561         IT->string is nil.  (Bug#10263)
7563 2011-12-10  Jan Djärv  <jan.h.d@swipnet.se>
7565         * nsterm.h (x_free_frame_resources): Declare.
7567         * nsfns.m (ns_get_defaults_value): New function (Bug#10103).
7568         (Fns_get_resource, x_get_string_resource): Call ns_get_defaults_value.
7570         * nsterm.h (ns_get_defaults_value): Declare.
7572         * nsterm.m (ns_default): Call ns_get_defaults_value.
7574 2011-12-09  Eli Zaretskii  <eliz@gnu.org>
7576         * xdisp.c (try_scrolling): Don't set scroll_down_p if dy is zero.
7577         (Bug#10170)
7579 2011-12-09  YAMAMOTO Mitsuharu  <mituharu@math.s.chiba-u.ac.jp>
7581         * unexelf.c (unexec) [NS_IMPL_GNUSTEP]: Take account of the case
7582         that where the value of an _OBJC_* symbol points to is in the .bss
7583         section (Bug#10240).
7585 2011-12-08  Kazuhiro Ito  <kzhr@d1.dion.ne.jp>  (tiny change)
7587         * coding.c (encode_coding_ccl): Check (charbuf < charbuf_end)
7588         after the loop to call ccl_driver at least once (Bug#8619).
7590 2011-12-08  Kenichi Handa  <handa@m17n.org>
7592         * ftfont.c (get_adstyle_property): Fix previous change
7593         (Bug#10233).
7595 2011-12-07  Juanma Barranquero  <lekktu@gmail.com>
7597         * w32.c (init_environment): If no_site_lisp, remove site-lisp
7598         dirs from the default value of EMACSLOADPATH (bug#10208).
7600 2011-12-07  Glenn Morris  <rgm@gnu.org>
7602         * lread.c (init_lread): If no_site_lisp, exclude site-lisp/ in
7603         installation and source directories as well.  (Bug#10208)
7605 2011-12-06  Chong Yidong  <cyd@gnu.org>
7607         * minibuf.c (Fread_from_minibuffer): Doc fix (Bug#10228).
7609 2011-12-06  Glenn Morris  <rgm@gnu.org>
7611         * process.c (start_process_unwind): Treat any pid <= 0, except -2,
7612         as an error, not just -1.  (Bug#10217)
7614 2011-12-05  Chong Yidong  <cyd@gnu.org>
7616         * keyboard.c (process_special_events): New function.
7617         (swallow_events, Finput_pending_p): Use it (Bug#10195).
7619 2011-12-05  Paul Eggert  <eggert@cs.ucla.edu>
7621         * coding.c (encode_designation_at_bol): Don't use uninitialized
7622         local variable (Bug#9318).
7624 2011-12-05  Kenichi Handa  <handa@m17n.org>
7626         * ftfont.c (get_adstyle_property): If the font is not BDF nor PCF,
7627         return Qnil (Bug#8046, Bug#10193).
7629 2011-12-05  Kenichi Handa  <handa@m17n.org>
7631         * coding.c (encode_designation_at_bol): New args charbuf_end and
7632         dst.  Return the number of produced bytes.  Callers changed.
7633         (coding_set_source): Return how many bytes coding->source was
7634         relocated.
7635         (coding_set_destination): Return how many bytes
7636         coding->destination was relocated.
7637         (CODING_DECODE_CHAR, CODING_ENCODE_CHAR, CODING_CHAR_CHARSET)
7638         (CODING_CHAR_CHARSET_P): Adjust for the avove changes.
7640 2011-12-05  Kazuhiro Ito  <kzhr@d1.dion.ne.jp>  (tiny change)
7642         * coding.c (CODING_CHAR_CHARSET_P): New macro.
7643         (encode_coding_emacs_mule, encode_coding_iso_2022): Use the above
7644         macro (Bug#9318).
7646 2011-12-05  Andreas Schwab  <schwab@linux-m68k.org>
7648         The following changes are to fix Bug#9318.
7650         * coding.c (CODING_ENCODE_CHAR, CODING_CHAR_CHARSET): New macros.
7651         (encode_coding_emacs_mule, ENCODE_ISO_CHARACTER)
7652         (encode_coding_iso_2022, encode_coding_sjis)
7653         (encode_coding_big5, encode_coding_charset): Use the above macros.
7655 2011-12-05  Juanma Barranquero  <lekktu@gmail.com>
7657         * lisp.h (process_quit_flag): Fix external declaration.
7659 2011-12-04  Stefan Monnier  <monnier@iro.umontreal.ca>
7661         Don't macro-inline non-performance-critical code.
7662         * eval.c (process_quit_flag): New function.
7663         * lisp.h (QUIT): Use it.
7665 2011-12-04  Jan Djärv  <jan.h.d@swipnet.se>
7667         * nsfns.m (get_geometry_from_preferences): New function.
7668         (Fx_create_frame): Call get_geometry_from_preferences (Bug#10103).
7670 2011-12-04  Andreas Schwab  <schwab@linux-m68k.org>
7672         * emacs.c (Qkill_emacs): Define.
7673         (syms_of_emacs): Initialize it.
7674         * keyboard.c (interrupt_signal): Don't call Fkill_emacs here, set
7675         Qquit_flag to `kill-emacs' instead.
7676         (quit_throw_to_read_char): Add parameter `from_signal'.
7677         All callers changed.  Call Fkill_emacs if requested and safe.
7678         * lisp.h (QUIT): Call Fkill_emacs if requested.
7680 2011-12-03  Jan Djärv  <jan.h.d@swipnet.se>
7682         * widget.c (update_wm_hints): Return if wmshell is null.
7683         (widget_update_wm_size_hints): New function.
7685         * widget.h (widget_update_wm_size_hints): Declare.
7687         * xterm.c (x_wm_set_size_hint): If USE_X_TOOLKIT, call
7688         widget_update_wm_size_hints (Bug#10104).
7690 2011-12-03  Eli Zaretskii  <eliz@gnu.org>
7692         * xdisp.c (handle_invisible_prop): If the invisible text ends just
7693         before a newline, prepare the bidi iterator for consuming the
7694         newline, and keep the current paragraph direction.  (Bug#10183)
7695         (redisplay_window): Don't let `margin' become negative.  (Bug#10192)
7697 2011-12-02  Juri Linkov  <juri@jurta.org>
7699         * search.c (Fword_search_regexp): New Lisp function created from
7700         `wordify'.  Change type of arg `lax' from `int' to `Lisp_Object'.
7701         (Fword_search_backward, Fword_search_forward)
7702         (Fword_search_backward_lax, Fword_search_forward_lax):
7703         Use `Fword_search_regexp' instead of `wordify'.  Doc fix.
7704         (syms_of_search): Define `Sword_search_regexp'.  (Bug#10145)
7706 2011-12-01  Stefan Monnier  <monnier@iro.umontreal.ca>
7708         * fileio.c (Finsert_file_contents): Move after-change-function call
7709         to before the "handled:" label, since all "goto handled" appear in
7710         cases where the *-change-functions have already been properly called
7711         (bug#10117).
7713 2011-12-01  Andreas Schwab  <schwab@linux-m68k.org>
7715         * keyboard.c (interrupt_signal): Don't call kill-emacs when
7716         waiting for input.  (Bug#10169)
7718 2011-11-30  Eli Zaretskii  <eliz@gnu.org>
7720         * dispnew.c (adjust_glyph_matrix): Remove the assertion that
7721         verifies glyph row's hash code--we have just reallocated the
7722         glyphs, so their contents can be complete garbage.  (Bug#10164)
7724 2011-11-30  Juanma Barranquero  <lekktu@gmail.com>
7726         * dispnew.c (adjust_glyph_matrix) [XASSERTS]: Add missing check.
7728 2011-11-30  Eli Zaretskii  <eliz@gnu.org>
7730         * dispnew.c (adjust_glyph_matrix) [XASSERTS]: Ensure ROW's
7731         attributes are tested _before_ calling verify_row_hash, to protect
7732         against GCC re-ordering of the tests.  (Bug#10164)
7734 2011-11-29  Jan Djärv  <jan.h.d@swipnet.se>
7736         * xterm.h (struct x_output): net_wm_state_hidden_seen is new.
7738         * xterm.c (handle_one_xevent): Only set async_visible and friends
7739         if net_wm_state_hidden_seen is non-zero (Bug#10002)
7740         (get_current_wm_state): Set net_wm_state_hidden_seen to 1 if
7741         _NET_WM_STATE_HIDDEN is in NET_WM_STATE.
7743 2011-11-28  Paul Eggert  <eggert@cs.ucla.edu>
7745         Remove GCPRO-related macros that exist only to avoid shadowing locals.
7746         * lisp.h (GCPRO1_VAR, GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR, GCPRO5_VAR)
7747         (GCPRO6_VAR, UNGCPRO_VAR): Remove.  See
7748         <http://lists.gnu.org/archive/html/emacs-diffs/2011-11/msg00265.html>.
7749         All uses changed to use GCPRO1 etc.
7750         (GCPRO1, GCPRO2, GCPRO3, GCPRO4, GCPRO5, GCPRO6, UNGCPRO):
7751         Revert to old implementation (i.e., before 2011-03-11).
7753 2011-11-28  YAMAMOTO Mitsuharu  <mituharu@math.s.chiba-u.ac.jp>
7755         * dispnew.c (scrolling_window): Truncate overlaps in copy destination
7756         of scroll runs so as to avoid assigning disabled bogus rows and
7757         unnecessary graphics copy operations.
7759 2011-11-27  Eli Zaretskii  <eliz@gnu.org>
7761         * s/ms-w32.h (utimbuf) [_MSC_VER]: Don't define.
7762         (snprintf) [_MSC_VER]: Redirect to _snprintf.
7763         (strtoll) [_MSC_VER]: Redirect to _strtoi64.
7764         (malloc, free, realloc, calloc): Redirect to e_* only when
7765         compiling Emacs.
7767         * lisp.h (GCTYPEBITS): Move before first use.
7768         (ALIGN_GCTYPEBITS) [_MSC_VER]: Define.
7769         (DECL_ALIGN) [_MSC_VER]: Use it, as MSVC doesn't like bit ops in
7770         this macro definition.
7772         * s/ms-w32.h (tzname): Redirect to _tzname for all values of
7773         _MSC_VER.
7775 2011-11-27  Jan Djärv  <jan.h.d@swipnet.se>
7777         * gtkutil.c (xg_create_frame_widgets):
7778         Call gtk_window_set_has_resize_grip (FALSE) if that function is
7779         present with Gtk+ 2.0.
7781 2011-11-26  Paul Eggert  <eggert@cs.ucla.edu>
7783         * fileio.c (Finsert_file_contents): Undo previous change; see
7784         <http://lists.gnu.org/archive/html/emacs-diffs/2011-11/msg00265.html>.
7786 2011-11-26  Paul Eggert  <eggert@cs.ucla.edu>
7788         Rename locals to avoid shadowing.
7789         * fileio.c (Finsert_file_contents):
7790         Rename inner 'gcpro1' to 'inner_gcpro1' to avoid shadowing.
7791         * process.c (wait_reading_process_output):
7792         Rename inner 'proc' to 'p' to avoid shadowing.
7793         Indent for consistency with usual Emacs style.
7795 2011-11-25  Eli Zaretskii  <eliz@gnu.org>
7797         * xdisp.c (redisplay_window): If cursor row is not fully visible
7798         after recentering, and scroll-conservatively is set to a large
7799         number, scroll window by a few more lines to make the cursor fully
7800         visible and out of scroll-margin.  (Bug#10105)
7801         (start_display): Don't move to the next line if the display should
7802         start at a newline that is part of a display vector or an overlay
7803         string.  (Bug#10119)
7805 2011-11-24  Juri Linkov  <juri@jurta.org>
7807         * image.c (imagemagick_load_image): Move `MagickSetResolution' down
7808         after the `MagickPingImage' call.  (Bug#10112)
7810 2011-11-23  Chong Yidong  <cyd@gnu.org>
7812         * window.c (Fcoordinates_in_window_p): Accept only live windows.
7814 2011-11-23  Martin Rudalics  <rudalics@gmx.at>
7816         * buffer.c (Fkill_buffer): Run replace_buffer_in_windows before
7817         making another buffer current.  (Bug#10114)
7819 2011-11-23  Glenn Morris  <rgm@gnu.org>
7821         * font.c (font_find_for_lface) [HAVE_NS]: Ignore case.  (Bug#2526)
7823 2011-11-23  Chong Yidong  <cyd@gnu.org>
7825         * xdisp.c (compute_stop_pos): Check validity of end_charpos before
7826         using it (Bug#5984).
7828 2011-11-22  Eli Zaretskii  <eliz@gnu.org>
7830         * dispnew.c (adjust_glyph_matrix): Don't verify hash code of mode-
7831         and header-lines, as they don't have one computed for them.
7832         (Bug#10098)
7834         * .gdbinit (prow): Make displayed values more self-explaining.
7835         Add row's hash code.
7837 2011-11-21  Lars Magne Ingebrigtsen  <larsi@gnus.org>
7839         * process.c (wait_reading_process_output): Fix asynchrounous
7840         GnuTLS socket handling on some versions of the GnuTLS library.
7841         (wait_reading_process_output): Add comment and URL.
7843 2011-11-21  Jan Djärv  <jan.h.d@swipnet.se>
7845         * xterm.c (x_clear_frame): Reinstate the XClearWindow call.
7847 2011-11-21  Chong Yidong  <cyd@gnu.org>
7849         * window.c (Fnext_window, Fprevious_window): Doc fix.
7851 2011-11-20  Stefan Monnier  <monnier@iro.umontreal.ca>
7853         * window.c (get_phys_cursor_glyph): Fix Lisp_Object/int mixup.
7855 2011-11-20  Juanma Barranquero  <lekktu@gmail.com>
7857         * nsfont.m (syms_of_nsfont) <ns-reg-to-script>: Fix typo.
7859 2011-11-20  Martin Rudalics  <rudalics@gmx.at>
7861         * window.c (Fset_window_combination_limit): Rename argument
7862         STATUS to LIMIT.
7863         (Vwindow_combination_limit): Remove "status" from doc-string.
7865 2011-11-20  Andreas Schwab  <schwab@linux-m68k.org>
7867         * m/ibms390.h: Remove.
7868         * m/ibms390x.h: Don't include "ibms390.h".
7870 2011-11-20  Stefan Monnier  <monnier@iro.umontreal.ca>
7872         * fileio.c (Finsert_file_contents): Add missing gcpro1 variable.
7873         Suggested by Dmitry Antipov <dmantipov@yandex.ru>.
7875 2011-11-20  Juanma Barranquero  <lekktu@gmail.com>
7877         * casetab.c (Fset_case_table):
7878         * charset.c (Fcharset_after): Fix typos.
7880 2011-11-20  Paul Eggert  <eggert@cs.ucla.edu>
7882         Standardize on VIRT_ADDR_VARIES behavior (Bug#10042).
7883         Otherwise, valgrind does not work on some platforms.
7884         Problem reported by Andreas Schwab in
7885         <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00081.html>.
7886         * puresize.h (pure, PURE_P): Always behave as if VIRT_ADDR_VARIES
7887         is set, removing the need for VIRT_ADDRESS_VARIES.
7888         (PURE_P): Use a more-efficient implementation that needs just one
7889         comparison, not two: on x86-64 with GCC 4.6.2, this cut down the
7890         number of instructions from 6 (xorl, cmpq, jge, xorl, cmpq, setge)
7891         to 4 (xorl, subq, cmpq, setbe).
7892         * alloc.c (pure): Always extern now, since that's the
7893         VIRT_ADDR_VARIES behavior.
7894         (PURE_POINTER_P): Use a single comparison, not two, for
7895         consistency with the new puresize.h.
7896         * lisp.h (PNTR_COMPARISON_TYPE): Remove; no longer needed.
7897         * m/ibms390.h, m/intel386.h, m/template.h, s/cygwin.h, s/hpux10-20.h:
7898         Remove VIRT_ADDR_VARIES no longer needed.
7900 2011-11-19  Eli Zaretskii  <eliz@gnu.org>
7902         * xdisp.c (x_write_glyphs, draw_phys_cursor_glyph)
7903         (erase_phys_cursor, update_window_cursor, show_mouse_face)
7904         (cursor_in_mouse_face_p): If the cursor position is out of bounds,
7905         behave as if the cursor position were at the window margin.
7907         * window.c (get_phys_cursor_glyph): If the window is hscrolled,
7908         and the cursor position is out of bounds, behave as if the cursor
7909         position were at the window margin.  (Bug#10075)
7911 2011-11-18  Chong Yidong  <cyd@gnu.org>
7913         * window.c (Fwindow_combination_limit): Make first argument
7914         non-optional, since it is meaningless for live windows like the
7915         selected window.
7917 2011-11-18  Dmitry Antipov  <dmantipov@yandex.ru>
7919         * keymap.c (Fwhere_is_internal): Add missing RETURN_UNGCPROs.
7921 2011-11-18  Stefan Monnier  <monnier@iro.umontreal.ca>
7923         * intervals.c: Fix grafting over the whole buffer (bug#10071).
7924         (graft_intervals_into_buffer): Simplify.
7926 2011-11-18  Eli Zaretskii  <eliz@gnu.org>
7928         * dispnew.c (swap_glyph_pointers): Swap the used[] arrays and the
7929         hash values of the two rows.
7930         (copy_row_except_pointers): Preserve the used[] arrays and the
7931         hash values of the two rows.  (Bug#10035)
7932         (add_row_entry): Add xassert to verify that ROW's hash code is valid.
7934         * xdisp.c (row_hash): New function, body extracted from
7935         compute_line_metrics.
7936         (compute_line_metrics): Call row_hash, instead of computing the
7937         hash code inline.
7939         * dispnew.c (verify_row_hash): Call row_hash for computing the
7940         hash code of a row, instead of duplicating code from xdisp.c.
7942         * dispextern.h (row_hash): Add prototype.
7944 2011-11-18  Tassilo Horn  <tassilo@member.fsf.org>
7946         * frame.c (delete_frame): Don't delete the terminal when the last
7947         X frame is closed if emacs is built with GTK toolkit.
7949 2011-11-17  Juanma Barranquero  <lekktu@gmail.com>
7951         * window.c (syms_of_window) <window-combination-resize>: Fix typo.
7953 2011-11-17  Martin Rudalics  <rudalics@gmx.at>
7955         * window.c (Vwindow_splits): Rename to
7956         Vwindow_combination_resize.  Suggested by Juri Linkov.
7957         (Fsplit_window_internal): Use Vwindow_combination_resize instead
7958         of Vwindow_splits.
7960 2011-11-16  Juanma Barranquero  <lekktu@gmail.com>
7962         * nsfns.m (Fns_font_name):
7963         * window.c (syms_of_window) <window-combination-limit>: Fix typos.
7965 2011-11-16  Martin Rudalics  <rudalics@gmx.at>
7967         * window.h (window): Rename slot "nest" to "combination_limit".
7968         * window.c (Fwindow_nest): Rename to Fwindow_combination_limit.
7969         (Fset_window_nest): Rename to Fset_window_combination_limit.
7970         (Vwindow_nest): Rename to Vwindow_combination_limit.
7971         (recombine_windows, make_parent_window, make_window)
7972         (Fsplit_window_internal, saved_window)
7973         (Fset_window_configuration, save_window_save): Rename all
7974         occurrences of window_nest to window_combination_limit.
7976 2011-11-15  Juanma Barranquero  <lekktu@gmail.com>
7978         * image.c (imagemagick_load_image): Fix typo.
7980 2011-11-14  Eli Zaretskii  <eliz@gnu.org>
7982         * xdisp.c (display_line): Move the call to
7983         highlight_trailing_whitespace before the call to
7984         compute_line_metrics, since the latter needs to see the final
7985         faces of all the glyphs to compute ROW's hash value.
7986         Fixes assertion violations in row_equal_p.  (Bug#10035)
7988 2011-11-14  Juanma Barranquero  <lekktu@gmail.com>
7990         * w32proc.c (reader_thread): Don't check pending input if cp->fd < 0,
7991         just return (bug#10044).
7993 2011-11-12  Eli Zaretskii  <eliz@gnu.org>
7995         * makefile.w32-in (HEAPSIZE): New variable, allows to build temacs
7996         with user-defined heap size.  Bump the default size of the temacs
7997         heap to 27MB, to avoid memory warning when running temacs.
7998         ($(TEMACS)): Use HEAPSIZE instead of a hardcoded value.
8000         * dispnew.c (scrolling_window): Fix incorrect indices in accessing
8001         current_matrix and desired_matrix.  (Bug#9990)
8002         (verify_row_hash) [XASSERTS]: New function.
8003         (adjust_glyph_matrix, row_equal_p): Use it in xassert to verify
8004         that the hash value of glyph rows is correct.
8006 2011-11-12  Martin Rudalics  <rudalics@gmx.at>
8008         * window.h (window): Remove splits slot.
8009         * window.c (Fwindow_splits, Fset_window_splits): Remove.
8010         (Fdelete_other_windows_internal, make_parent_window)
8011         (make_window, Fsplit_window_internal, Fdelete_window_internal)
8012         (Fset_window_configuration, save_window_save): Don't deal with
8013         split status of windows.
8014         (saved_window): Remove splits slot.
8015         (Vwindow_splits): Rewrite doc-string.
8017 2011-11-11  Jan Djärv  <jan.h.d@swipnet.se>
8019         * xfns.c (unwind_create_frame):
8020         * nsfns.m (unwind_create_frame):
8021         * w32fns.c (unwind_create_frame): Use Fmemq to check if frame is in
8022         Vframe_list (Bug#9999).
8024 2011-11-11  Dmitry Antipov  <dmantipov@yandex.ru>
8026         * xdisp.c (syms_of_xdisp): Remove duplicated definition of Qtext.
8028 2011-11-11  Kenichi Handa  <handa@m17n.org>
8030         * callproc.c (Fcall_process): Set the member dst_multibyte of
8031         process_coding.
8033 2011-11-11  Johan Bockgård  <bojohan@gnu.org>
8035         * xdisp.c (fill_composite_glyph_string): Always set s->face, to
8036         avoid a crash (bug#9496).
8038 2011-11-09  Chong Yidong  <cyd@gnu.org>
8040         * window.c (Fwindow_inside_edges, Fwindow_inside_pixel_edges)
8041         (Fwindow_inside_absolute_pixel_edges): Only allow live windows.
8043 2011-11-08  Paul Eggert  <eggert@cs.ucla.edu>
8045         * s/gnu.h (GC_MARK_STACK): Define to GC_MAKE_GCPROS_NOOPS (Bug#9926).
8047 2011-11-08  Paul Eggert  <eggert@cs.ucla.edu>
8049         Avoid some portability problems by eschewing 'extern inline' functions.
8050         The trivial performance wins aren't worth the portability hassles; see
8051         <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00084.html>
8052         et seq.
8053         * dispextern.h (window_box, window_box_height, window_text_bottom_y)
8054         (window_box_width, window_box_left, window_box_left_offset)
8055         (window_box_right, window_box_right_offset): Undo previous change,
8056         by removing the "extern"s.
8057         * intervals.c (adjust_intervals_for_insertion)
8058         (adjust_intervals_for_deletion): Undo previous change,
8059         making these static again.
8060         (offset_intervals, temp_set_point_both, temp_set_point)
8061         (copy_intervals_to_string): No longer inline.
8062         * xdisp.c (window_text_bottom_y, window_box_width)
8063         (window_box_height, window_box_left_offset)
8064         (window_box_right_offset, window_box_left, window_box_right)
8065         (window_box): No longer inline.
8067 2011-11-08  Chong Yidong  <cyd@gnu.org>
8069         * window.c (Fwindow_left_column, Fwindow_top_line): Doc fix.
8070         (Fwindow_body_height, Fwindow_body_width): Move from Lisp.
8071         Signal an error if not a live window.
8072         (Fwindow_total_width, Fwindow_total_height): Move from Lisp.
8073         (Fwindow_total_size, Fwindow_body_size): Move to Lisp.
8075 2011-11-07  Juanma Barranquero  <lekktu@gmail.com>
8077         * lisp.h (syms_of_abbrev): Remove declaration.
8078         Reported by CHENG Gao <chenggao@royau.me>.
8080 2011-11-07  Eli Zaretskii  <eliz@gnu.org>
8082         * w32.c (check_windows_init_file): Don't look for term/w32-win.el
8083         if Vpurify_flag is non-nil.  Fixes a crash when running w32 build
8084         of temacs in GUI mode.
8086 2011-11-07  Martin Rudalics  <rudalics@gmx.at>
8088         * window.h: Declare delete_all_child_windows instead of
8089         delete_all_subwindows.
8090         * window.c (Fwindow_nest, Fset_window_nest)
8091         (Fset_window_new_total, Fset_window_new_normal)
8092         (Fwindow_resize_apply): Don't use term subwindow in doc-strings.
8093         (delete_all_subwindows): Rename to delete_all_child_windows.
8094         (Fdelete_other_windows_internal, Fset_window_configuration):
8095         Call delete_all_child_windows instead of delete_all_subwindows.
8096         * frame.c (delete_frame): Call delete_all_child_windows instead
8097         of delete_all_subwindows.
8099 2011-11-07  Paul Eggert  <eggert@cs.ucla.edu>
8101         * alloc.c (DEADP): New macro, for porting to GNU/Hurd (Bug#9926).
8102         This is also needed for porting to any host where GC_MARK_STACK is
8103         not GC_MAKE_GCPROS_NOOPS.
8104         (which_symbols): Use it.
8106 2011-11-07  Kenichi Handa  <handa@m17n.org>
8108         * coding.c (coding_set_destination): Check coding->src_pos only
8109         when coding->src_object is a buffer (bug#9910).
8111         * process.c (send_process): Set the member src_multibyte of coding
8112         to 0 (bug#9911) when sending a unibyte text.
8114         * callproc.c (Fcall_process): Set the member src_multibyte of
8115         process_coding to 0 (bug#9912).
8117 2011-11-06  YAMAMOTO Mitsuharu  <mituharu@math.s.chiba-u.ac.jp>
8119         * xmenu.c (cleanup_widget_value_tree): New function.
8120         (xmenu_show, xdialog_show): Use it in record_unwind_protect instead of
8121         calling free_menubar_widget_value_tree directly (Bug#9830).
8123 2011-11-06  Paul Eggert  <eggert@cs.ucla.edu>
8125         Fix some portability problems with 'inline'.
8126         * dispextern.h (window_box, window_box_height, window_text_bottom_y)
8127         (window_box_width, window_box_left, window_box_left_offset)
8128         (window_box_right, window_box_right_offset): Declare extern.
8129         Otherwise, these inline functions do not conform to C99 and
8130         are miscompiled by Microsoft compilers.  Reported by Eli Zaretskii in
8131         <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00084.html>.
8132         * intervals.c (adjust_intervals_for_insertion)
8133         (adjust_intervals_for_deletion): Now extern, because otherwise the
8134         extern inline functions 'offset_intervals' couldn't refer to it.
8135         (static_offset_intervals): Remove.
8136         (offset_intervals): Rewrite using the old contents of
8137         static_offset_intervals.  The old version didn't conform to C99
8138         because an extern inline function contained a reference to an
8139         identifier with static linkage.
8141 2011-11-06  Andreas Schwab  <schwab@linux-m68k.org>
8143         * keyboard.c (interrupt_signal): Don't call kill-emacs while in
8144         GC.
8146 2011-11-06  Eli Zaretskii  <eliz@gnu.org>
8148         * xdisp.c (init_iterator, reseat_to_string): Don't set the
8149         iterator's bidi_p flag if Vpurify_flag is non-nil.  (Bug#9963)
8150         (Fcurrent_bidi_paragraph_direction): If Vpurify_flag is non-nil,
8151         return Qleft_to_right.
8153 2011-11-06  Chong Yidong  <cyd@gnu.org>
8155         * window.c (Fwindow_live_p, Fwindow_frame, Fframe_root_window)
8156         (Fminibuffer_window, Fwindow_buffer, Fwindow_splits)
8157         (Fset_window_splits, Fwindow_nest, Fset_window_nest)
8158         (Fwindow_use_time, Fwindow_total_size, Fwindow_normal_size)
8159         (Fwindow_new_normal, Fwindow_left_column, Fwindow_top_line)
8160         (Fwindow_margins, Fwindow_fringes, Fwindow_scroll_bars)
8161         (Fwindow_vscroll): Doc fix.
8162         (Fwindow_top_child, Fwindow_left_child): Eliminate a nil default
8163         argument, since it makes no sense to pass a live window and for
8164         consistency with window-child.
8166 2011-11-05  Christoph Scholtes  <cschol2112@googlemail.com>
8168         * makefile.w32-in ($(TEMACS), (gl-stamp)): Use $(THISDIR) to
8169         support MSVC.
8171 2011-11-05  Jason Rumney  <jasonr@gnu.org>
8173         * w32font.c (font_matches_spec): Filter out non-Japanese kana fonts.
8174         (add_font_entity_to_list): Filter out non-Japanese Shift-JIS
8175         fonts (Bug#6029).
8176         (add_font_entity_to_list): Fix logic errors in mixed boolean and
8177         bitwise arithmetic preventing use of unicode-sip and non-truetype
8178         opentype fonts.
8180 2011-11-05  Eli Zaretskii  <eliz@gnu.org>
8182         * s/ms-w32.h (fstat, stat, utime): Move redirections to
8183         "emacs"-only part.
8185         * w32fns.c (x_create_tip_frame, Fx_create_frame): Rearrange
8186         initialization code to keep similarity to xfns.c after changes
8187         from 2011-11-05.
8189 2011-11-05  Jan Djärv  <jan.h.d@swipnet.se>
8191         * nsfns.m: Declare image_cache_refcount if GLYPH_DEBUG.
8192         (unwind_create_frame): New function (Bug#9943).
8193         (Fx_create_frame): Restructure code to be more similar to the one in
8194         xfns.c.  Call record_unwind_protect with unwind_create_frame (Bug#9943).
8195         Initialize image_cache_refcount if GLYPH_DEBUG (Bug#9943).
8196         Move terminal->reference_count++ just before making the frame official
8197         (Bug#9943).
8199         * nsterm.m (x_free_frame_resources): New function.
8200         (x_destroy_window): Move code to x_free_frame_resources.
8202         * xfns.c (unwind_create_frame): Fix comment.
8203         (Fx_create_frame, x_create_tip_frame):
8204         Move terminal->reference_count++ just before making the frame
8205         official.  Move initialization of image_cache_refcount and
8206         dpyinfo_refcount before calling init_frame_faces (Bug#9943).
8208 2011-11-05  Eli Zaretskii  <eliz@gnu.org>
8210         Support MSVC build with newer versions of Visual Studio.
8211         * makefile.w32-in (TAGS-gmake): Don't use $(patsubst ...), as
8212         Nmake barfs on that.  Use $(OBJ*_c) variables instead, defined on
8213         nt/gmake.defs.
8215         * lisp.h (ENUM_BF): New macro, for enumerated types in bitfields,
8216         which are not supported by MSVC.
8217         (Lisp_Symbol, Lisp_Misc_Any, Lisp_Marker, Lisp_Misc_Overlay)
8218         (Lisp_Save_Value, Lisp_Free): Use ENUM_BF for enumerated types in
8219         bitfields.
8220         (Lisp_Object) [USE_LISP_UNION_TYPE]: Use ENUM_BF for enumerated
8221         types in bitfields.
8222         (DEFUN) [_MSC_VER]: Define in a different way for MSVC.
8224         * w32fns.c [_MSC_VER]: DECLARE_HANDLE for any MSVC version.
8226 2011-11-05  Fabrice Popineau  <fabrice.popineau@supelec.fr>  (tiny change)
8228         Support MSVC build with newer versions of Visual Studio.
8229         * w32.c: Don't include w32api.h for MSVC.
8230         (init_environment) [_MSC_VER]: Call sys_access, not _access.
8232         * s/ms-w32.h <sigset_t, ssize_t> [_MSC_VER]: Typedefs for MSVC.
8233         [_MSC_VER]: Include sys/timeb.h, sys/stat.h, and signal.h.
8234         (fstat, stat, utime) [_MSC_VER]: Redirect to their sys_* cousins.
8235         (malloc, free, realloc, calloc) [_MSC_VER]: Always redirect to the
8236         e_* cousins.
8237         (alloca) [_MSC_VER]: Define to _alloca.
8239         * lisp.h (DECL_ALIGN) [_MSC_VER]: Define for MSVC.
8241         * regex.c <re_char> [_MSC_VER]: A separate definition for MSVC.
8243 2011-11-04  Eli Zaretskii  <eliz@gnu.org>
8245         * xdisp.c (note_mouse_highlight): If either of
8246         previous/next-single-property-change returns nil, treat that as
8247         the beginning or the end of the buffer.  (Bug#9955)
8249 2011-11-04  Jan Djärv  <jan.h.d@swipnet.se>
8251         * gtkutil.c (xg_make_tool_item): Add callbacks if one of wimage or
8252         label is not null (Bug#9951).
8253         (xg_tool_item_stale_p): Handle the fact that wimage and/or wlbl
8254         may be NULL.
8256 2011-11-04  Eli Zaretskii  <eliz@gnu.org>
8258         * window.c (Fwindow_body_size): Mention in the doc string that the
8259         return value is in frame's canonical units.  (Bug#9949)
8261 2011-11-03  Eli Zaretskii  <eliz@gnu.org>
8263         * xdisp.c (note_mouse_highlight): Initialize `area'.  (Bug#9947)
8265         * w32fns.c (unwind_create_frame): If needed, free the glyph
8266         matrices of the partially constructed frame.  (Bug#9943)
8267         * xfns.c (unwind_create_frame): Likewise.
8269 2011-11-01  Eli Zaretskii  <eliz@gnu.org>
8271         * xdisp.c (mouse_face_from_buffer_pos): Fix a typo in a comment.
8272         Don't stop backward scan on the continuation glyph, even though
8273         its CHARPOS is positive.
8274         (mouse_face_from_buffer_pos, note_mouse_highlight):
8275         Rename cover_string to disp_string.
8277 2011-11-01  Martin Rudalics  <rudalics@gmx.at>
8279         * window.c (temp_output_buffer_show): Don't use
8280         Vtemp_buffer_show_specifiers.
8281         (Vtemp_buffer_show_specifiers): Remove unused variable.
8283 2011-10-30  Eli Zaretskii  <eliz@gnu.org>
8285         * xdisp.c (try_cursor_movement): Make sure ROW isn't decremented
8286         past the beginning of the current glyph matrix.
8288 2011-10-30  Adam Sjøgren  <asjo@koldfront.dk>  (tiny change)
8290         * xterm.c: Include X11/Xproto.h if HAVE_GTK3.
8291         (x_error_handler): Ignore BadMatch for X_SetInputFocus for
8292         HAVE_GTK3 (Bug#9869).
8294         * gtkutil.c (xg_win_to_widget, xg_event_is_for_menubar): Initialize
8295         type to GDK_NOTHING so valgrind does not complain (Bug#9901).
8297         * xterm.h (x_display_info): Add Xatom_net_wm_state_hidden (Bug#9893).
8299         * xterm.c: Declare x_handle_net_wm_state to return int.
8300         (handle_one_xevent): Check if we are iconified but don't have
8301         _NET_WM_STATE_HIDDEN.  If do, treat as deiconify (Bug#9893).
8302         (get_current_wm_state): Return non-zero if not hidden,
8303         check for _NET_WM_STATE_HIDDEN (Bug#9893).
8304         (do_ewmh_fullscreen): Ignore return value from get_current_wm_state.
8305         (x_handle_net_wm_state): Return what get_current_wm_state returns.
8306         (x_term_init): Initialize dpyinfo->Xatom_net_wm_state_hidden.
8308 2011-10-29  Paul Eggert  <eggert@cs.ucla.edu>
8310         * alloc.c (which_symbols): Declare EXTERNALLY_VISIBLE,
8311         so that this new function doesn't get optimized away by a
8312         whole-program optimizer.  Make the 2nd arg EMACS_INT, not int.
8314 2011-10-29  Andreas Schwab  <schwab@linux-m68k.org>
8316         * frame.h (MOUSE_HL_INFO): Remove excess parens.
8318 2011-10-29  Eli Zaretskii  <eliz@gnu.org>
8320         Fix the `xbytecode' command.
8321         * .gdbinit (xprintbytestr): New command.
8322         (xwhichsymbols): Rename from `which'; all callers changed.
8323         (xbytecode): Print the byte-code string as well.
8325 2011-10-29  Kim Storm  <storm@cua.dk>
8327         * alloc.c (which_symbols): New function.
8329 2011-10-29  Andreas Schwab  <schwab@linux-m68k.org>
8331         * minibuf.c (read_minibuf_noninteractive): Allow reading empty
8332         line.  (Bug#9903)
8334 2011-10-29  Glenn Morris  <rgm@gnu.org>
8336         * process.c (wait_reading_process_output): Revert 2009-08-30 change.
8337         Not clear what it was for, and it causes various bugs.  (Bug#9839)
8339 2011-10-28  Eli Zaretskii  <eliz@gnu.org>
8341         * xdisp.c (note_mouse_highlight): Initialize `part', to avoid a
8342         possible random value that matches one of those tested as
8343         condition to clear the mouse face.
8345 2011-10-28  Chong Yidong  <cyd@gnu.org>
8347         * xdisp.c (note_mouse_highlight): Fix use of uninitialized var.
8349 2011-10-28  Dan Nicolaescu  <dann@ics.uci.edu>
8351         * window.c (make_window): Initialize phys_cursor_on_p.
8353 2011-10-28  Stefan Monnier  <monnier@iro.umontreal.ca>
8355         * lisp.h (struct Lisp_Symbol): Update comments.
8357 2011-10-28  Juanma Barranquero  <lekktu@gmail.com>
8359         * w32font.c (w32_load_unicows_or_gdi32): Add missing return.
8361 2011-10-28  Eli Zaretskii  <eliz@gnu.org>
8363         Fix Emacs on Windows 9X (bug#8562).  Thanks to oslsachem
8364         <oslsachem@gmail.com> for helping to debug this.
8366         * w32font.c (g_b_init_is_w9x, g_b_init_get_outline_metrics_w)
8367         (g_b_init_get_text_metrics_w, g_b_init_get_glyph_outline_w)
8368         (g_b_init_get_glyph_outline_w): New static variables.
8369         (GetOutlineTextMetricsW_Proc, GetTextMetricsW_Proc)
8370         (GetGlyphOutlineW_Proc): New typedefs.
8371         (w32_load_unicows_or_gdi32, get_outline_metrics_w)
8372         (get_text_metrics_w, get_glyph_outline_w, globals_of_w32font):
8373         New functions.
8374         (w32font_open_internal, compute_metrics):
8375         Call get_outline_metrics_w, get_text_metrics_w, and get_glyph_outline_w
8376         instead of calling the "wide" APIs directly.
8378         * emacs.c (main) [HAVE_NTGUI]: Call globals_of_w32font.
8380         * w32.h (syms_of_w32font): Add prototype.
8382 2011-10-27  Juanma Barranquero  <lekktu@gmail.com>
8384         * window.c (Fframe_root_window, Fframe_first_window, Fwindow_end)
8385         (Fframe_selected_window, Ftemp_output_buffer_show, Fnext_window)
8386         (Fdelete_window_internal, Fwindow_parameters): Fix typos in docstrings.
8387         (Fmove_to_window_line): Doc fix.
8389 2011-10-27  Chong Yidong  <cyd@gnu.org>
8391         * process.c (make_process): Set gnutls_state to NULL.
8393         * gnutls.c (emacs_gnutls_deinit): Deinit the gnutls_state if it is
8394         non-NULL, regardless of GNUTLS_INITSTAGE.
8395         (Fgnutls_boot): Cleanups.  Call emacs_gnutls_deinit if we signal
8396         an error.  Set process slots as soon as we allocate them.
8398         * gnutls.h (GNUTLS_LOG, GNUTLS_LOG2): Fix macros.
8400 2011-10-27  Chong Yidong  <cyd@gnu.org>
8402         * gnutls.c (emacs_gnutls_deinit): New function.
8403         Deallocate credentials structures as well as calling gnutls_deinit.
8404         (Fgnutls_deinit, Fgnutls_boot): Use it.
8406         * process.c (make_process): Initialize GnuTLS credentials to NULL.
8407         (deactivate_process): Call emacs_gnutls_deinit.
8409 2011-10-27  Juanma Barranquero  <lekktu@gmail.com>
8411         * image.c (x_create_x_image_and_pixmap):
8412         * w32.c (sys_rename, w32_delayed_load):
8413         * w32font.c (fill_in_logfont):
8414         * w32reg.c (x_get_string_resource): Silence compiler warnings.
8416 2011-10-26  Juanma Barranquero  <lekktu@gmail.com>
8418         * w32fns.c (w32_default_color_map): New function,
8419         extracted from Fw32_default_color_map.
8420         (Fw32_default_color_map, Fx_open_connection): Use it.  (Bug#9785)
8422 2011-10-25  Paul Eggert  <eggert@cs.ucla.edu>
8424         * dispextern.h (Fcontrolling_tty_p): New decl (Bug#6649 part 2).
8426 2011-10-25  Stefan Monnier  <monnier@iro.umontreal.ca>
8428         * keyboard.c (test_undefined): New function (bug#9751).
8429         (read_key_sequence): Use it to detect when a key is bound to `undefined'.
8431 2011-10-25  Enami Tsugutomo  <tsugutomo.enami@jp.sony.com>
8433         * sysdep.c (init_sys_modes): Fix the check for the controlling
8434         terminal (Bug#6649).
8436 2011-10-20  Eli Zaretskii  <eliz@gnu.org>
8438         * dispextern.h (struct bidi_it): New member next_en_type.
8440         * bidi.c (bidi_line_init): Initialize the next_en_type member.
8441         (bidi_resolve_explicit_1): When next_en_pos is valid for the
8442         current character, check also for next_en_type being WEAK_EN.
8443         (bidi_resolve_weak): Don't enter the expensive loop if the current
8444         position is before next_en_pos.  Record the bidi type of the first
8445         non-ET, non-BN character we find, in addition to its position.
8446         (bidi_level_of_next_char): Invalidate next_en_type when
8447         next_en_pos is over-stepped.
8449 2011-10-20  Paul Eggert  <eggert@cs.ucla.edu>
8451         Time zone name fixes for non-ASCII locales (Bug#641, Bug#9794)
8452         * editfns.c: Rewrite current-time-zone so that it invokes
8453         the equivalent of (format-time-string "%Z") to get the time zone name.
8454         This fixes a bug when the time zone name contains characters that
8455         need converting from the system time locale to Emacs internal format.
8456         This fixes a shortcoming that I introduced in my 1999-10-19 patch:
8457         that patch fixed format-time-string to do the conversion, but
8458         I forgot to fix current-time-zone.
8459         (format_time_string): New function, containing most of
8460         what Fformat_time_string used to contain.
8461         (Fformat_time_string): Rewrite in terms of format_time_string.
8462         This doesn't change this function's behavior.
8463         (current-time-zone): Rewrite to use format_time_string.
8464         This fixes the bug reported by Michael Schierl in
8465         <http://lists.gnu.org/archive/html/emacs-devel/2007-06/msg00334.html>.
8466         Jason Rumney's 2007-06-07 change worked around this bug, but
8467         didn't fix it.
8468         * systime.h (tzname, timezone): Remove no-longer-used declarations.
8470 2011-10-19  Eli Zaretskii  <eliz@gnu.org>
8472         * xdisp.c (start_display): If the character at POS is displayed
8473         via a display vector, reset IT->current.dpvec_index to zero.
8474         (try_window_reusing_current_matrix): If a line ends in a display
8475         vector or the next line starts in a display vector, continue
8476         redrawing the window even though the character position of
8477         start_row was reached.
8478         (Bug#9771, part 2)
8480 2011-10-18  Chong Yidong  <cyd@gnu.org>
8482         * xdisp.c (get_next_display_element): Handle U+2010 and U+2011
8483         with nobreak-char-display too.
8485 2011-10-18  Eli Zaretskii  <eliz@gnu.org>
8487         Fix part 3 of bug#9771.
8488         * bidi.c (bidi_line_init): Initialize next_en_pos to zero, not -1.
8489         (bidi_resolve_neutral): Don't enter the expensive loop looking for
8490         non-neutral characters if the current character is a paragraph
8491         separator (a.k.a. Newline).  This avoids running the same
8492         expensive loop twice, once when we consume the preceding newline
8493         and the other time when the line actually needs to be displayed.
8494         Avoid the loop when we see neutrals on the base embedding level
8495         following a character whose directionality is the same as the
8496         paragraph's.  This avoids running the expensive loop when a line
8497         ends in a long sequence of neutrals, like control characters.
8498         Add assertion against STRONG_AL type.  Slightly rearrange code
8499         that determines the type of a neutral given the first non-neutral
8500         that follows it.
8501         (bidi_level_of_next_char): Set next_en_pos to zero when
8502         invalidating its info.
8504 2011-10-17  Eli Zaretskii  <eliz@gnu.org>
8506         * xdisp.c (push_display_prop): Determine whether to record string
8507         or buffer position by IT->string, not by IT->method.  Allow
8508         GET_FROM_DISPLAY_VECTOR as IT->method on entry.  (Bug#9771, part 4)
8509         (move_it_vertically_backward): Don't look for character position
8510         immediately after the newline when in a continuation line.
8511         (Bug#9771, part 1)
8513 2011-10-15  Martin Rudalics  <rudalics@gmx.at>
8515         * window.c (coordinates_in_window): Rewrite and delabelize
8516         vertical border check.  (Bug#5357) (Bug#9618)
8518 2011-10-14  Stefan Monnier  <monnier@iro.umontreal.ca>
8520         * xterm.c (frame_highlight, frame_unhighlight): Ignore unexplained
8521         errors in XSetWindowBorder (bug#9310).
8523 2011-10-13  Dmitry Antipov  <dmantipov@yandex.ru>
8525         * editfns.c (Fset_time_zone_rule): Replace free with xfree to
8526         avoid crash when xmalloc overrun checking is enabled.
8528 2011-10-13  Eli Zaretskii  <eliz@gnu.org>
8530         * xdisp.c (Fcurrent_bidi_paragraph_direction): Initialize
8531         itb.paragraph_dir to NEUTRAL_DIR.  Fixes an occasional incorrect
8532         cursor motion with <left> and <right> arrow keys.
8534         * bidi.c (bidi_init_it): Don't initialize paragraph_dir here, as
8535         some callers set that themselves.
8537 2011-10-12  Eli Zaretskii  <eliz@gnu.org>
8539         * xdisp.c (find_row_edges): Handle the case where ROW comes from a
8540         display string and the previous row comes from the same string and
8541         is empty.  (Bug#9739)  (Bug#9738)
8543 2011-10-12  Stefan Monnier  <monnier@iro.umontreal.ca>
8545         * doc.c (get_doc_string): Encode file name (bug#9735).
8547 2011-10-12  Eli Zaretskii  <eliz@gnu.org>
8549         * bidi.c (bidi_level_of_next_char):
8550         * xdisp.c (get_visually_first_element): Remove old incorrect
8551         comments regarding the Unicode Line Separator character.
8553         * bidi.c (bidi_init_it): Initialize paragraph_dir to NEUTRAL_DIR.
8555 2011-10-12  Dmitry Antipov  <dmantipov@yandex.ru>
8557         * alloc.c (Fgc_status): Do not access beyond zombies array
8558         boundary if nzombies > MAX_ZOMBIES.
8559         * alloc.c (dump_zombies): Add missing format specifier.
8561 2011-10-12  Paul Eggert  <eggert@cs.ucla.edu>
8563         * xdisp.c (set_cursor_from_row): Simplify conditionals,
8564         to pacify GCC 4.6.1 x86-64 with -O2 -Wstrict-overflow.
8566         * lread.c (read_escape): Allow hex escapes as large as ?\xfffffff.
8567         Some packages use them to denote characters with modifiers.
8569 2011-10-11  Andreas Schwab  <schwab@linux-m68k.org>
8571         * lisp.h (GCPRO1_VAR, GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR)
8572         (GCPRO5_VAR, GCPRO6_VAR, UNGCPRO_VAR): Add whitespace to avoid
8573         matching a pp-number.  Rename parameter var to var1.
8575 2011-10-11  Stefan Monnier  <monnier@iro.umontreal.ca>
8577         * minibuf.c (Finternal_complete_buffer): Fix last change (bug#9709).
8579 2011-10-08  Glenn Morris  <rgm@gnu.org>
8581         * callint.c (Fcall_interactively): Give a more explicit error for the
8582         'c' case with a non-character input.  (Bug#8479)
8584 2011-10-08  Eli Zaretskii  <eliz@gnu.org>
8586         * xdisp.c (hscroll_window_tree): Support hscroll in right-to-left
8587         lines.
8588         (set_cursor_from_row): Fix cursor positioning in mixed L2R+R2L
8589         lines that are hscrolled on the left.
8591         * dispnew.c (buffer_posn_from_coords): Account for a possible
8592         presence of header-line.  (Bug#4426)
8594 2011-10-07  Stefan Monnier  <monnier@iro.umontreal.ca>
8596         * buffer.c (syms_of_buffer) <enable-multibyte-characters>:
8597         Don't advertise functionality which we discourage or doesn't work.
8599 2011-10-07  Paul Eggert  <eggert@cs.ucla.edu>
8601         * alloc.c (GC_LISP_OBJECT_ALIGNMENT): Use offsetof, not __alignof__
8602         or sizeof.  __alignof__ gives the wrong answer on Fedora x86-64
8603         with GCC 4.6.1 when configured with CC='gcc -m32' --with-wide-int;
8604         this makes Emacs dump core during garbage collection on rare
8605         occasions.  sizeof is obviously inferior to offsetof here, so
8606         stick with offsetof.
8607         (GC_POINTER_ALIGNMENT): New macro.
8608         (mark_memory): Omit 3rd (offset) arg; caller changed.
8609         Don't assume EMACS_INT alignment is the same as pointer alignment.
8611 2011-10-03  Stefan Monnier  <monnier@iro.umontreal.ca>
8613         * keyboard.c (read_key_sequence_remapped): New var.
8614         (read_key_sequence): Compute remapping in the right buffer.
8615         (command_loop_1): Use read_key_sequence's remapping directly.
8617 2011-10-02  Stefan Monnier  <monnier@iro.umontreal.ca>
8619         * dired.c (file_name_completion): Don't expand file name.
8620         (Ffile_name_completion, Ffile_name_all_completions): Expand file name
8621         before checking file name handler.
8623         * minibuf.c (Finternal_complete_buffer): Only show internal buffers if
8624         they've been requested explicitly (bug#9591).
8626 2011-10-01  Andreas Schwab  <schwab@linux-m68k.org>
8628         * keymap.c (Fsingle_key_description): Use make_specified_string
8629         instead of build_string to build string from push_key_description.
8630         (Bug#5193)
8632 2011-09-30  Paul Eggert  <eggert@cs.ucla.edu>
8634         * buffer.h (struct buffer): Use time_t, not int, for a time stamp.
8635         This fixes a Y2038 bug on 64-bit hosts.
8636         * buffer.c (reset_buffer):
8637         * fileio.c (Fdo_auto_save, Fset_buffer_auto_saved)
8638         (Fclear_buffer_auto_save_failure):
8639         Use 0, not -1, to represent an unset failure time, since time_t
8640         might not be signed.
8642         Remove dependency on glibc malloc internals.
8643         * alloc.c (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
8644         Move back here from lisp.h, but with their new implementations.
8645         (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
8646         (XMALLOC_OVERRUN_SIZE_SIZE): Move these new lisp.h macros here.
8647         * charset.c (charset_table_init): New static var.
8648         (syms_of_charset): Use it instead of xmalloc.  This removes a
8649         dependency on glibc malloc internals.  See Eli Zaretskii's comment in
8650         <http://lists.gnu.org/archive/html/emacs-devel/2011-09/msg00815.html>.
8651         * lisp.h (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
8652         Move back to alloc.c.
8653         (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
8654         (XMALLOC_OVERRUN_SIZE_SIZE): Move to alloc.c.
8656 2011-09-30  Jan Djärv  <jan.h.d@swipnet.se>
8658         * nsterm.m (windowDidResize): Call x_set_window_size only when
8659         ns_in_resize is true.  Otherwise set pixelwidth/height and
8660         call change_frame_size (Bug#9628).
8662 2011-09-30  Paul Eggert  <eggert@cs.ucla.edu>
8664         Port --enable-checking=all to Fedora 14 x86-64.
8665         * charset.c (syms_of_charset): Also account for glibc malloc's
8666         internal overhead when calculating the initial malloc maximum.
8668         Port --enable-checking=all to Fedora 14 x86.
8669         * alloc.c (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
8670         Move to lisp.h.
8671         (xmalloc_put_size, xmalloc_get_size, overrun_check_malloc)
8672         (overrun_check_realloc, overrun_check_free):
8673         Use XMALLOC_OVERRUN_SIZE_SIZE, not sizeof (size_t).
8674         That way, xmalloc returns a properly-aligned pointer even if
8675         XMALLOC_OVERRUN_CHECK is defined.  The old debugging code happened
8676         to align OK on typical 64-bit hosts, but not on Fedora 14 x86.
8677         * charset.c (syms_of_charset): Take XMALLOC_OVERRUN_CHECK_OVERHEAD
8678         into account when calculating the initial malloc maximum.
8679         * lisp.h (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
8680         Move here from alloc.c, so that charset.c can use it too.
8681         Properly align; the old code wasn't right for common 32-bit hosts
8682         when configured with --enable-checking=all.
8683         (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
8684         (XMALLOC_OVERRUN_SIZE_SIZE): New macros.
8686 2011-09-29  Eli Zaretskii  <eliz@gnu.org>
8688         * sysdep.c (snprintf) [!EOVERFLOW]: If EOVERFLOW is not defined,
8689         use EDOM.
8691 2011-09-28  Eli Zaretskii  <eliz@gnu.org>
8693         * xdisp.c (compute_display_string_end): If there's no display
8694         string at CHARPOS, return -1.
8696         * bidi.c (bidi_fetch_char): When compute_display_string_end
8697         returns a negative value, treat the character as a normal
8698         character not covered by a display string.  (Bug#9624)
8700 2011-09-28  Juanma Barranquero  <lekktu@gmail.com>
8702         * lread.c (Fread_from_string): Fix typo in docstring.
8704 2011-09-27  Eli Zaretskii  <eliz@gnu.org>
8706         * xdisp.c (handle_invisible_prop): If invisible text ends on a
8707         newline, reseat the iterator instead of bidi-iterating there one
8708         character at a time.  (Bug#9610)
8709         (BUFFER_POS_REACHED_P, move_it_in_display_line_to): Bail when past
8710         TO_CHARPOS if the bidi iterator is at base embedding level.
8712 2011-09-27  Andreas Schwab  <schwab@linux-m68k.org>
8714         * lread.c (readevalloop): Use correct code for NBSP.
8715         (read1): Likewise.  (Bug#9608)
8717 2011-09-25  Michael Albinus  <michael.albinus@gmx.de>
8719         * dbusbind.c (Fdbus_register_signal): When service is not
8720         registered, use nil in Vdbus_registered_objects_table.  (Bug#9581)
8722 2011-09-25  Glenn Morris  <rgm@gnu.org>
8724         * buffer.c (truncate-lines): Doc fix.
8726 2011-09-24  Chong Yidong  <cyd@stupidchicken.com>
8728         * window.c (Fwindow_prev_buffers, Fset_window_prev_buffers)
8729         (Fset_window_next_buffers): Doc fix.
8731 2011-09-24  Glenn Morris  <rgm@gnu.org>
8733         * minibuf.c (read_minibuf): Disable line truncation.  (Bug#5715)
8735 2011-09-24  Paul Eggert  <eggert@cs.ucla.edu>
8737         Fix minor problems found by static checking.
8738         * xdisp.c (string_from_display_spec): Don't assume vecsize fits in int.
8739         * indent.c (Fvertical_motion): Fix == vs = typo.
8741 2011-09-24  Eli Zaretskii  <eliz@gnu.org>
8743         * dispnew.c (syms_of_display) <redisplay-dont-pause>:
8744         Default value is now t.  Doc fix.
8746         * indent.c (Fvertical_motion): Compute and apply the overshoot
8747         logic when moving up, not only when moving down.  Fix the
8748         confusing name and values of the it_overshoot_expected variable;
8749         logic changes accordingly.  (Bug#9254) (Bug#9549)
8751         * xdisp.c (pos_visible_p): Produce correct pixel coordinates when
8752         CHARPOS is covered by a display string which includes newlines.
8753         (move_it_vertically_backward): Avoid inflooping when START_CHARPOS
8754         is covered by a display string with embedded newlines.
8756 2011-09-24  Michael Albinus  <michael.albinus@gmx.de>
8758         * dbusbind.c (Fdbus_register_signal): Add match rule to
8759         Vdbus_registered_objects_table.  (Bug#9581)
8760         (Fdbus_register_method, Vdbus_registered_objects_table):
8761         Fix docstring.
8763 2011-09-24  Jim Meyering  <meyering@redhat.com>
8765         do not ignore write error for any output size
8766         The previous change was incomplete.
8767         While it makes emacs --batch detect the vast majority of stdout
8768         write failures, errors were still ignored whenever the output size is
8769         k * (BUFSIZ+1) - 4.  E.g., on a system with BUFSIZ of 4096,
8770           $ emacs --batch --eval '(print (format "%4093d" 0))' > /dev/full \
8771               && echo FAIL: ignored write error
8772           FAIL: ignored write error
8773           $ emacs --batch --eval '(print (format "%20481d" 0))' > /dev/full \
8774               && echo FAIL: ignored write error
8775           FAIL: ignored write error
8776         * emacs.c (Fkill_emacs): Also test ferror.  (Bug#9574)
8778 2011-09-23  Andreas Schwab  <schwab@linux-m68k.org>
8780         * emacs.c (Fkill_emacs): In noninteractive mode exit
8781         non-successfully if a write error occurred on stdout.  (Bug#9574)
8783 2011-09-21  Eli Zaretskii  <eliz@gnu.org>
8785         * xdisp.c (pop_it): Allow it->object that is a cons cell to pass
8786         the xassert test.
8788         * dispextern.h (struct it): Update the comment documenting what
8789         can it->OBJECT be.
8791 2011-09-20  Eli Zaretskii  <eliz@gnu.org>
8793         * xdisp.c (set_cursor_from_row): If the row ends in a newline from
8794         a display string, extend search for cursor position to end of row.
8795         (find_row_edges): If the row ends in a newline from a display
8796         string, increment its MATRIX_ROW_END_CHARPOS by one.  (Bug#9549)
8797         Handle the case of a display string with multiple newlines.
8798         (Fcurrent_bidi_paragraph_direction): Fix search for previous
8799         non-empty line.  Fixes confusing cursor motion with arrow keys at
8800         the beginning of a line that starts with whitespace.
8802 2011-09-19  Lars Magne Ingebrigtsen  <larsi@gnus.org>
8804         * lread.c (Fread_from_string): Document what FINAL-STRING-INDEX is
8805         (bug#9493).
8807 2011-09-18  Chong Yidong  <cyd@stupidchicken.com>
8809         * xfns.c (Fx_create_frame): Handle the bitmapIcon resource as
8810         boolean (Bug#9154).
8812 2011-09-18  Eli Zaretskii  <eliz@gnu.org>
8814         * xdisp.c (display_line): Record maximum and minimum buffer
8815         positions even if no glyphs were produced (e.g., by a zero-width
8816         stretch).  Fixes bug#9530 on a TTY.  Under word-wrap, don't record
8817         buffer positions that will be removed from the glyph row because
8818         they don't fit.
8819         (produce_stretch_glyph): Fix a bug in :align-to on a TTY when the
8820         column is beyond frame width: don't subtract 1 "pixel" when
8821         computing width of the stretch.
8822         (reseat_at_next_visible_line_start): Undo the change made on
8823         2011-09-17 that saved paragraph information and restored it after
8824         the call to `reseat'.  (Bug#9545)
8826 2011-09-18  YAMAMOTO Mitsuharu  <mituharu@math.s.chiba-u.ac.jp>
8828         * xdisp.c (expose_window): Save original value of phys_cursor_on_p
8829         and turn window cursor on if cleared (Bug#9415).
8831 2011-09-18  Andreas Schwab  <schwab@linux-m68k.org>
8833         * search.c (boyer_moore): Take unibyte characters from pattern
8834         literally.  (Bug#9458)
8836 2011-09-18  Eli Zaretskii  <eliz@gnu.org>
8838         * xdisp.c (reseat_at_next_visible_line_start): Fix last change.
8840 2011-09-18  Paul Eggert  <eggert@cs.ucla.edu>
8842         Fix minor problem found by static checking.
8843         * xdisp.c (reseat_at_next_visible_line_start): Mark locals as
8844         initialized, to pacify gcc -Wuninitialized.
8846         * fileio.c: Report proper errno when syscall falls.
8847         (Finsert_file_contents): Save and restore errno,
8848         so that report_file_error outputs the correct diagnostic.
8849         (Fwrite_region) [CLASH_DETECTION]: Likewise.
8851 2011-09-18  Eli Zaretskii  <eliz@gnu.org>
8853         * .gdbinit (pgx): Fix references to fields of `struct glyph'.
8855 2011-09-17  Eli Zaretskii  <eliz@gnu.org>
8857         * xdisp.c (produce_stretch_glyph): Another fix for changes made on
8858         2011-08-30 (revision 105619).  (Bug#9530)
8860 2011-09-17  Eli Zaretskii  <eliz@gnu.org>
8862         * xdisp.c (reseat_at_next_visible_line_start): Keep information
8863         about the current paragraph and restore it after the call to reseat.
8865         * bidi.c (MAX_PARAGRAPH_SEARCH): New macro.
8866         (bidi_find_paragraph_start): Search back for paragraph beginning
8867         at most MAX_PARAGRAPH_SEARCH lines; if not found, return BEGV_BYTE.
8868         (bidi_move_to_visually_next): Only trigger paragraph-related
8869         computations when the last character is a newline or at EOB, not
8870         just any NEUTRAL_B.  (Bug#9470)
8872         * xdisp.c (set_cursor_from_row): Don't invoke special treatment of
8873         truncated lines if point is covered by a display string.  (Bug#9524)
8875 2011-09-16  Paul Eggert  <eggert@cs.ucla.edu>
8877         * xselect.c: Relax test for outgoing X longs (Bug#9498).
8878         (cons_to_x_long): New function.
8879         (lisp_data_to_selection_data): Use it.  Correct the test for
8880         short-versus-long data; it was negated.  Break out of vector
8881         loop, for efficiency, when a long datum is discovered.
8883 2011-09-16  Stefan Monnier  <monnier@iro.umontreal.ca>
8885         * eval.c (Fquote): Document its non-consing behavior (bug#9482).
8887 2011-09-16  Eli Zaretskii  <eliz@gnu.org>
8889         * image.c (tiff_handler): Work around a bug in MinGW GCC 3.x (see
8890         GCC PR/17406) by declaring this function with external scope.
8892 2011-09-15  Paul Eggert  <eggert@cs.ucla.edu>
8894         * editfns.c (Fformat): Fix bug in text-property fix (Bug#9514).
8895         Don't mishandle (length (format "%%")) and (format "%4000s%%" "").
8897 2011-09-15  Andreas Schwab  <schwab@linux-m68k.org>
8899         * editfns.c (Fformat): Correctly handle text properties on "%%".
8901 2011-09-15  Eli Zaretskii  <eliz@gnu.org>
8903         * xterm.c (x_draw_composite_glyph_string_foreground):
8904         * w32term.c (x_draw_composite_glyph_string_foreground):
8905         * term.c (encode_terminal_code):
8906         * composite.c (composition_update_it, get_composition_id):
8907         * xdisp.c (get_next_display_element)
8908         (fill_composite_glyph_string): Add comments about special meaning
8909         of TAB characters in a composition.
8911 2011-09-15  Paul Eggert  <eggert@cs.ucla.edu>
8913         * editfns.c (Fformat): Fix off-by-1 bug for "%%b" (Bug#9514).
8914         This occurs when processing a multibyte format.
8915         Problem reported by Wolfgang Jenker.
8917 2011-09-15  Johan Bockgård  <bojohan@gnu.org>
8919         * xdisp.c (try_cursor_movement): Only check for exact match if
8920         cursor hpos found by set_cursor_from_row is valid.  (Bug#9495)
8922 2011-09-14  Paul Eggert  <eggert@cs.ucla.edu>
8924         Remove unused external symbols.
8925         * dispextern.h (calc_pixel_width_or_height): Remove decl.
8926         * xdisp.c (calc_pixel_width_or_height): Now static.
8927         * doprnt.c (exprintf) [! (HAVE_X_WINDOWS && USE_X_TOOLKIT)]: Remove.
8928         * indent.c (check_display_width):
8929         * w32term.c: Fix comment to match code.
8930         * xterm.c, xterm.h (x_catching_errors): Remove.
8932 2011-09-14  Paul Eggert  <eggert@cs.ucla.edu>
8934         * xselect.c: Use signed conversions more consistently (Bug#9498).
8935         (selection_data_to_lisp_data): Assume incoming selection data are
8936         signed integers, not unsigned.  This is to be consistent with
8937         outgoing selection data, which was modified to use signed integers
8938         in as part of the fix to Bug#9196 in response to Jan D.'s comment
8939         in <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9196#32> that X11
8940         expects long, not unsigned long.
8942 2011-09-14  Eli Zaretskii  <eliz@gnu.org>
8944         * xdisp.c (try_window_reusing_current_matrix): Fix incorrect
8945         computation of loop end.  Reported by Johan Bockgård
8946         <bojohan@gnu.org>.
8948 2011-09-13  Chong Yidong  <cyd@stupidchicken.com>
8950         * frame.c (Fother_visible_frames_p): Function deleted.
8952 2011-09-12  Eli Zaretskii  <eliz@gnu.org>
8954         * indent.c (compute_motion): Process display vector front to back
8955         rather than the other way around.  (Bug#2496)
8957 2011-09-12  Stefan Monnier  <monnier@iro.umontreal.ca>
8959         * fileio.c (Finsert_file_contents): Don't assume beg_offset is 0.
8961 2011-09-11  Chong Yidong  <cyd@stupidchicken.com>
8963         * minibuf.c (Fread_from_minibuffer): Doc fix.
8965 2011-09-11  Eli Zaretskii  <eliz@gnu.org>
8967         * xdisp.c (produce_stretch_glyph): Fix a typo made in changes from
8968         2011-08-30 (revision 105619).  (Bug#9475)
8970 2011-09-11  Lars Magne Ingebrigtsen  <larsi@gnus.org>
8972         * fileio.c (Fvisited_file_modtime): Document `(-1 65535)' as a
8973         value for non-existent files.
8975 2011-09-11  Eli Zaretskii  <eliz@gnu.org>
8977         * fileio.c (Finsert_file_contents): If the file cannot be opened,
8978         set its "size" to -1.  This will set the modtime_size field of
8979         the corresponding buffer to -1, which is what
8980         verify-visited-file-modtime expects for files that do not exist.
8981         (Bug#9139)
8983 2011-09-11  Paul Eggert  <eggert@cs.ucla.edu>
8985         * keymap.h (KEY_DESCRIPTION_SIZE, push_key_description): Move decls
8986         here ...
8987         * lisp.h: ... from here.  push_key_description is no longer
8988         defined in keyboard.c, so its declaration should not be in
8989         lisp.h's "Defined in keyboard.c" section, and KEY_DESCRIPTION_SIZE
8990         logically belongs with push_key_description.
8992 2011-09-10  Paul Eggert  <eggert@cs.ucla.edu>
8994         * buffer.h: Include <sys/types.h> instead of <time.h>.
8995         Otherwise, off_t wasn't defined on FreeBSD 9.0-BETA2 i386.
8996         Problem reported by Herbert J. Skuhra.
8998 2011-09-10  Lars Magne Ingebrigtsen  <larsi@gnus.org>
9000         * xml.c (parse_region): Make the parsing work for
9001         non-comment-starting XML files again (bug#9144).
9003 2011-09-10  Andreas Schwab  <schwab@linux-m68k.org>
9005         * image.c (gif_load): Fix calculation of bottom and right corner.
9006         (Bug#9468)
9008 2011-09-10  Eli Zaretskii  <eliz@gnu.org>
9010         * xdisp.c (MAX_DISP_SCAN): Decrease to 250.  Prevents sluggish
9011         redisplay in small windows.
9013 2011-09-09  Eli Zaretskii  <eliz@gnu.org>
9015         * frame.c (x_report_frame_params): Cast to avoid compiler warnings.
9017 2011-09-08  Martin Rudalics  <rudalics@gmx.at>
9019         * window.c (Fset_window_prev_buffers, Fset_window_next_buffers):
9020         Operate on live windows only.
9022 2011-09-08  Juanma Barranquero  <lekktu@gmail.com>
9024         * emacs.c (my_heap_start): #ifdef to avoid warnings when unused.
9026 2011-09-07  Eli Zaretskii  <eliz@gnu.org>
9028         * xdisp.c (move_it_in_display_line_to): Call RESTORE_IT on ppos_it
9029         only under bidi iteration.
9031 2011-09-07  Jan Djärv  <jan.h.d@swipnet.se>
9033         * gtkutil.c (xg_make_tool_item): Insert comment about eventbox.
9035 2011-09-06  Paul Eggert  <eggert@cs.ucla.edu>
9037         isnan: Fix porting problem to Solaris 10 with bundled gcc.
9038         Without this fix, the command to link temacs failed due to an
9039         undefined symbol __builtin_isnan.  This is because
9040         /usr/include/iso/math_c99.h #defines isnan(x) to
9041         __builtin_isnan(x), but the bundled gcc, which identifies itself
9042         as gcc 3.4.3 (csl-sol210-3_4-branch+sol_rpath), does not have
9043         a __builtin_isnan.
9044         * floatfns.c (isnan): #undef, and then #define to a clone of
9045         what's in data.c.
9046         (Fisnan): Always define, since it's always available now.
9047         (syms_of_floatfns): Always define isnan at the Lisp level.
9049 2011-09-06  Paul Eggert  <eggert@cs.ucla.edu>
9051         * Makefile.in (gl-stamp): move-if-change now in build-aux (Bug#9169).
9053 2011-09-06  Paul Eggert  <eggert@cs.ucla.edu>
9055         * fileio.c: Fix bugs with large file offsets (Bug#9428).
9056         The previous code assumed that file offsets (off_t values) fit in
9057         EMACS_INT variables, which is not true on typical 32-bit hosts.
9058         The code messed up by falsely reporting buffer overflow in cases
9059         such as (insert-file-contents "big" nil 1 2) into an empty buffer
9060         when "big" contains more than 2**29 bytes, even though this
9061         inserts just one byte and does not overflow the buffer.
9062         (Finsert_file_contents): Store file offsets as off_t
9063         values, not as EMACS_INT values.  Check for overflow when
9064         converting between EMACS_INT and off_t.  When checking for
9065         buffer overflow or for overlap, take the offsets into account.
9066         Don't use EMACS_INT for small values where int suffices.
9067         When checking for overlap, fix a typo: ZV was used where
9068         ZV_BYTE was intended.
9069         (Fwrite_region): Don't assume off_t fits into 'long'.
9070         * buffer.h (struct buffer.modtime_size): Now off_t, not EMACS_INT.
9072 2011-09-05  Michael Albinus  <michael.albinus@gmx.de>
9074         * dbusbind.c (xd_signature_cat): Rename from signature_cat.
9076 2011-09-04  Paul Eggert  <eggert@cs.ucla.edu>
9078         sprintf-related integer and memory overflow issues (Bug#9412).
9080         * doprnt.c (doprnt): Support printing ptrdiff_t and intmax_t values.
9081         (esprintf, exprintf, evxprintf): New functions.
9082         * keyboard.c (command_loop_level): Now EMACS_INT, not int.
9083         (cmd_error): Kbd macro iterations count is now EMACS_INT, not int.
9084         (modify_event_symbol): Do not assume that the length of
9085         name_alist_or_stem is safe to alloca and fits in int.
9086         (Fexecute_extended_command): Likewise for function name and binding.
9087         (Frecursion_depth): Wrap around reliably on integer overflow.
9088         * keymap.c (push_key_description): First arg is now EMACS_INT, not int,
9089         since some callers pass EMACS_INT values.
9090         (Fsingle_key_description): Don't crash if symbol name contains more
9091         than MAX_ALLOCA bytes.
9092         * minibuf.c (minibuf_level): Now EMACS_INT, not int.
9093         (get_minibuffer): Arg is now EMACS_INT, not int.
9094         * lisp.h (get_minibuffer, push_key_description): Reflect API changes.
9095         (esprintf, exprintf, evxprintf): New decls.
9096         * window.h (command_loop_level, minibuf_level): Reflect API changes.
9098         * dbusbind.c (signature_cat): New function.
9099         (xd_signature, Fdbus_register_signal):
9100         Do not overrun buffer; instead, report string overflow.
9102         * dispnew.c (add_window_display_history): Don't overrun buffer.
9103         Truncate instead; this is OK since it's just a log.
9105         * editfns.c (Fcurrent_time_zone): Don't overrun buffer
9106         even if the time zone offset is outlandishly large.
9107         Don't mishandle offset == INT_MIN.
9109         * emacs.c (main) [NS_IMPL_COCOA]: Don't overrun buffer
9110         when creating daemon; the previous buffer-overflow check was incorrect.
9112         * eval.c (verror): Simplify by rewriting in terms of evxprintf,
9113         which has the guts of the old verror function.
9115         * filelock.c (lock_file_1, lock_file): Don't blindly alloca long name;
9116         use SAFE_ALLOCA instead.  Use esprintf to avoid int-overflow issues.
9118         * font.c: Include <float.h>, for DBL_MAX_10_EXP.
9119         (font_unparse_xlfd): Don't blindly alloca long strings.
9120         Don't assume XINT result fits in int, or that XFLOAT_DATA * 10
9121         fits in int, when using sprintf.  Use single snprintf to count
9122         length of string rather than counting it via multiple sprintfs;
9123         that's simpler and more reliable.
9124         (font_unparse_fcname): Use it to avoid sprintf buffer overrun.
9125         (generate_otf_features) [0 && HAVE_LIBOTF]: Use esprintf, not
9126         sprintf, in case result does not fit in int.
9128         * fontset.c (num_auto_fontsets): Now printmax_t, not int.
9129         (fontset_from_font): Print it.
9131         * frame.c (tty_frame_count): Now printmax_t, not int.
9132         (make_terminal_frame, set_term_frame_name): Print it.
9133         (x_report_frame_params): In X, window IDs are unsigned long,
9134         not signed long, so print them as unsigned.
9135         (validate_x_resource_name): Check for implausibly long names,
9136         and don't assume name length fits in 'int'.
9137         (x_get_resource_string): Don't blindly alloca invocation name;
9138         use SAFE_ALLOCA.  Use esprintf, not sprintf, in case result does
9139         not fit in int.
9141         * gtkutil.c: Include <float.h>, for DBL_MAX_10_EXP.
9142         (xg_check_special_colors, xg_set_geometry):
9143         Make sprintf buffers a bit bigger, to avoid potential buffer overrun.
9145         * lread.c (dir_warning): Don't blindly alloca buffer; use SAFE_ALLOCA.
9146         Use esprintf, not sprintf, in case result does not fit in int.
9148         * macros.c (executing_kbd_macro_iterations): Now EMACS_INT, not int.
9149         (Fend_kbd_macro): Don't mishandle MOST_NEGATIVE_FIXNUM by treating
9150         it as a large positive number.
9151         (Fexecute_kbd_macro): Don't assume repeat count fits in int.
9152         * macros.h (executing_kbd_macro_iterations): Now EMACS_INT, not int.
9154         * nsterm.m ((NSSize)windowWillResize): Use esprintf, not sprintf,
9155         in case result does not fit in int.
9157         * print.c (float_to_string): Detect width overflow more reliably.
9158         (print_object): Make sprintf buffer a bit bigger, to avoid potential
9159         buffer overrun.  Don't assume list length fits in 'int'.  Treat
9160         print length of 0 as 0, not as infinity; to be consistent with other
9161         uses of print length in this function.  Don't overflow print length
9162         index.  Don't assume hash table size fits in 'long', or that
9163         vectorlike size fits in 'unsigned long'.
9165         * process.c (make_process): Use printmax_t, not int, to format
9166         process-name gensyms.
9168         * sysdep.c (snprintf) [! HAVE_SNPRINTF]: New function.
9170         * term.c (produce_glyphless_glyph): Make sprintf buffer a bit bigger
9171         to avoid potential buffer overrun.
9173         * xfaces.c (x_update_menu_appearance): Don't overrun buffer
9174         if X resource line is longer than 512 bytes.
9176         * xfns.c (x_window): Make sprintf buffer a bit bigger
9177         to avoid potential buffer overrun.
9179         * xterm.c (x_io_error_quitter): Don't overrun sprintf buffer.
9181         * xterm.h (x_check_errors): Add ATTRIBUTE_FORMAT_PRINTF.
9183 2011-09-04  Paul Eggert  <eggert@cs.ucla.edu>
9185         Integer overflow fixes for scrolling, etc.
9186         Without these, Emacs silently mishandles large integers sometimes.
9187         For example, "C-u 4294967297 M-x recenter" was treated as if
9188         it were "C-u 1 M-x recenter" on a typical 64-bit host.
9190         * xdisp.c (try_window_id): Check Emacs fixnum range before
9191         converting to 'int'.
9193         * window.c (window_scroll_line_based, Frecenter):
9194         Check that an Emacs fixnum is in range before assigning it to 'int'.
9195         (Frecenter, Fmove_to_window_line): Use EMACS_INT, not int, for
9196         values converted from Emacs fixnums.
9197         (Frecenter): Don't wrap around a line count if it is out of 'int'
9198         range; instead, treat it as an extreme value.
9199         (Fset_window_configuration, compare_window_configurations):
9200         Use ptrdiff_t, not int, for index that might exceed 2 GiB.
9202         * search.c (Freplace_match): Use ptrdiff_t, not int, for indexes
9203         that can exceed INT_MAX.  Check that EMACS_INT value is in range
9204         before assigning it to the (possibly-narrower) index.
9205         (match_limit): Don't assume that a fixnum can fit in 'int'.
9207         * print.c (print_object): Use ptrdiff_t, not int, for index that can
9208         exceed INT_MAX.
9210         * indent.c (position_indentation): Now takes ptrdiff_t, not int.
9211         (Fvertical_motion): Don't wrap around LINES values that don't fit
9212         in 'int'.  Instead, treat them as extreme values.  This is good
9213         enough for windows, which can't have more than INT_MAX lines anyway.
9215 2011-09-03  Lars Magne Ingebrigtsen  <larsi@gnus.org>
9217         * Require libxml/parser.h to avoid compilation warning.
9219         * emacs.c (shut_down_emacs): Call xmlCleanupParser on shutdown.
9221         * xml.c (parse_region): Don't call xmlCleanupParser after parsing,
9222         since this reportedly can destroy thread storage.
9224 2011-08-30  Chong Yidong  <cyd@stupidchicken.com>
9226         * syntax.c (find_defun_start): Update all cache variables if
9227         exiting early (Bug#9401).
9229 2011-08-30  Eli Zaretskii  <eliz@gnu.org>
9231         * image.c (x_bitmap_pixmap): Cast to int to avoid compiler warnings.
9233         * xdisp.c (produce_stretch_glyph): No longer static, compiled also
9234         when HAVE_WINDOW_SYSTEM is not defined.  Support both GUI and TTY
9235         frames.  Call tty_append_glyph in the TTY case.  (Bug#9402)
9237         * term.c (tty_append_glyph): New function.
9238         (produce_stretch_glyph): Static function and its prototype deleted.
9240         * dispextern.h (produce_stretch_glyph, tty_append_glyph):
9241         Add prototypes.
9243 2011-08-29  Paul Eggert  <eggert@cs.ucla.edu>
9245         * image.c (parse_image_spec): Check for nonnegative, not for positive,
9246         when checking :margin (Bug#9390).
9247         (IMAGE_NON_NEGATIVE_INTEGER_VALUE_OR_PAIR):
9248         Rename from IMAGE_POSITIVE_INTEGER_VALUE_OR_PAIR,
9249         so that the name doesn't mislead.  All uses changed.
9251 2011-08-28  Johan Bockgård  <bojohan@gnu.org>
9253         * term.c (init_tty) [HAVE_GPM]: Move mouse settings after
9254         set_tty_hooks.
9256 2011-08-27  Eli Zaretskii  <eliz@gnu.org>
9258         * xdisp.c (move_it_to): Don't bail out early when reaching
9259         position beyond to_charpos, if we are scanning backwards.
9260         (move_it_vertically_backward): When DY == 0, make sure we get to
9261         the first character in the line after the newline.
9263 2011-08-27  Paul Eggert  <eggert@cs.ucla.edu>
9265         * ccl.c: Improve and simplify overflow checking (Bug#9196).
9266         (ccl_driver): Do not generate an out-of-range pointer.
9267         (Fccl_execute_on_string): Remove unnecessary check for
9268         integer overflow, noted by Stefan Monnier in
9269         <http://lists.gnu.org/archive/html/emacs-devel/2011-08/msg00979.html>.
9270         Remove a FIXME that didn't need fixing.
9271         Simplify the newly-introduced buffer reallocation code.
9273 2011-08-27  Juanma Barranquero  <lekktu@gmail.com>
9275         * makefile.w32-in ($(BLD)/alloc.$(O)): Depend on lib/verify.h.
9277 2011-08-26  Paul Eggert  <eggert@cs.ucla.edu>
9279         Integer and memory overflow issues (Bug#9196).
9281         * doc.c (get_doc_string): Rework so that
9282         get_doc_string_buffer_size is the actual buffer size, rather than
9283         being 1 less than the actual buffer size; this makes xpalloc more
9284         convenient.
9286         * image.c (x_allocate_bitmap_record, cache_image):
9287         * xselect.c (Fx_register_dnd_atom):
9288         Simplify previous changes by using xpalloc.
9290         * buffer.c (overlay_str_len): Now ptrdiff_t, not EMACS_INT,
9291         since either will do and ptrdiff_t is convenient with xpalloc.
9293         * charset.c (charset_table_size)
9294         (struct charset_sort_data.priority): Now ptrdiff_t.
9295         (charset_compare): Don't overflow if priorities differ greatly.
9296         (Fsort_charsets): Don't assume list length fits in int.
9297         Check for size-calculation overflow when allocating sort data.
9298         (syms_of_charset): Allocate an initial charset table that is
9299         just under 64 KiB, to avoid problems with glibc malloc and mmap.
9301         * cmds.c (internal_self_insert): Check for size-calculation overflow.
9303         * composite.h (struct composition.glyph_len): Now int, not unsigned.
9304         The actual value is always <= INT_MAX, and leaving it unsigned made
9305         overflow checking harder.
9307         * dispextern.h (struct glyph_matrix.rows_allocated)
9308         (struct face_cache.size): Now ptrdiff_t, for convenience in use
9309         with xpalloc.  The values are still always <= INT_MAX.
9311         * indent.c (compute_motion): Adjust to region_cache_forward sig change.
9313         * lisp.h (xnmalloc, xnrealloc, xpalloc): New decls.
9314         (SAFE_NALLOCA): New macro.
9316         * region-cache.c (struct boundary.pos, find_cache_boundary)
9317         (move_cache_gap, insert_cache_boundary, delete_cache_boundaries)
9318         (set_cache_region, invalidate_region_cache)
9319         (revalidate_region_cache, know_region_cache, region_cache_forward)
9320         (region_cache_backward, pp_cache):
9321         Use ptrdiff_t, not EMACS_INT, since either will do.  This is needed
9322         so that ptrdiff_t * can be passed to xpalloc.
9323         (struct region_cache): Similarly, for gap_start, gap_len, cache_len,
9324         beg_unchanged, end_unchanged, buffer_beg, buffer_end members.
9325         (pp_cache): Don't assume cache_len fits in int.
9326         * region-cache.h: Adjust extern decls to match.
9328         * search.c (scan_buffer, Freplace_match): Use ptrdiff_t, not
9329         EMACS_INT, since either will do, for xpalloc.
9331         * alloc.c: Include verify.h, and check that int fits in ptrdiff_t.
9332         (xnmalloc, xnrealloc, xpalloc): New functions.
9334         * bidi.c (bidi_shelve_header_size): New constant.
9335         (bidi_cache_ensure_space, bidi_shelve_cache): Use it.
9336         (bidi_cache_ensure_space): Avoid integer overflow when allocating.
9338         * bidi.c (bidi_cache_shrink):
9339         * buffer.c (overlays_at, overlays_in, record_overlay_string)
9340         (overlay_strings):
9341         Don't update size of array until after memory allocation succeeds,
9342         because xmalloc/xrealloc may not return.
9343         (struct sortstrlist.bytes): Now ptrdiff_t, as EMACS_INT doesn't help
9344         now that we have proper integer overflow checking.
9345         (record_overlay_string, overlay_strings): Catch overflows when
9346         calculating size of overlay_str_buf.
9348         * callproc.c (Fcall_process): Check for size overflow when
9349         calculating size of args2.
9350         (child_setup): Avoid overflow by using size_t rather than ptrdiff_t.
9351         Normally we prefer signed values, but sticking with ptrdiff_t would
9352         require adding more-complicated checks.
9354         * ccl.c (Fccl_execute_on_string): Check for memory overflow.
9355         Use ptrdiff_t rather than EMACS_INT where ptrdiff_t will do.
9356         Redo buffer-overflow calculations to avoid integer overflow.
9357         Add a FIXME comment where memory seems to be over-allocated.
9359         * character.c (Fstring): Check for size-calculation overflow.
9361         * coding.c (produce_chars): Redo buffer-overflow calculations to avoid
9362         unnecessary integer overflow.  Check for size overflow.
9363         (encode_coding_object): Don't update size until xmalloc succeeds.
9365         * composite.c (get_composition_id): Check for overflow in glyph
9366         length calculations.
9368         Integer and memory overflow fixes for display code.
9369         * dispextern.h (struct glyph_pool.nglyphs): Now ptrdiff_t, not int.
9370         * dispnew.c (adjust_glyph_matrix, realloc_glyph_pool)
9371         (scrolling_window): Check for overflow in size calculations.
9372         (line_draw_cost, realloc_glyph_pool, add_row_entry):
9373         Don't assume glyph table len fits in int.
9374         (struct row_entry.bucket, row_entry_pool_size, row_entry_idx)
9375         (row_table_size): Now ptrdiff_t, not int.
9376         (scrolling_window): Avoid overflow in size calculations.
9377         Don't update size until allocation succeeds.
9378         * fns.c (concat): Check for overflow in size calculations.
9379         (next_almost_prime): Verify NEXT_ALMOST_PRIME_LIMIT.
9380         * lisp.h (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): New macros.
9381         (NEXT_ALMOST_PRIME_LIMIT): New constant.
9383         * doc.c (get_doc_string_buffer_size): Now ptrdiff_t, not int.
9384         (get_doc_string): Check for size calculation overflow.
9385         Don't update size until allocation succeeds.
9386         (get_doc_string, Fsubstitute_command_keys): Use ptrdiff_t, not
9387         EMACS_INT, where ptrdiff_t will do.
9388         (Fsubstitute_command_keys): Check for string overflow.
9390         * editfns.c (set_time_zone_rule): Don't assume environment length
9391         fits in int.
9392         (message_length): Now ptrdiff_t, not int.
9393         (Fmessage_box): Don't update size until allocation succeeds.
9394         Don't assume message length fits in int.
9395         (Fformat): Use ptrdiff_t, not EMACS_INT, where ptrdiff_t will do.
9397         * emacs.c (main): Do not reallocate argv, since there is a null at
9398         the end that can be overwritten, and this way there's no need to
9399         worry about size-calculation overflow.
9400         (sort_args): Check for size-calculation overflow.
9402         * eval.c (init_eval_once, grow_specpdl): Don't update size until
9403         alloc succeeds.
9404         (call_debugger, grow_specpdl): Redo calculations to avoid overflow.
9406         * frame.c (set_menu_bar_lines, x_set_frame_parameters)
9407         (x_set_scroll_bar_width, x_figure_window_size):
9408         Check for integer overflow.
9409         (x_set_alpha): Do not assume XINT fits in int.
9411         * frame.h (struct frame): Use int, not EMACS_INT, where int works.
9412         This is for the members text_lines, text_cols, total_lines, total_cols,
9413         where the system imposes an 'int' limit.
9415         * fringe.c (Fdefine_fringe_bitmap):
9416         Don't update size until alloc works.
9418         * ftfont.c (ftfont_get_open_type_spec, setup_otf_gstring)
9419         (ftfont_shape_by_flt): Check for integer overflow in size calculations.
9421         * gtkutil.c (get_utf8_string, xg_store_widget_in_map):
9422         Check for size-calculation overflow.
9423         (get_utf8_string): Use ptrdiff_t, not size_t, where either will
9424         do, as we prefer signed integers.
9425         (id_to_widget.max_size, id_to_widget.used)
9426         (xg_store_widget_in_map, xg_remove_widget_from_map)
9427         (xg_get_widget_from_map, xg_get_scroll_id_for_window)
9428         (xg_remove_scroll_bar, xg_update_scrollbar_pos):
9429         Use and return ptrdiff_t, not int.
9430         (xg_gtk_scroll_destroy): Don't assume ptrdiff_t fits in int.
9431         * gtkutil.h: Change prototypes to match the above.
9433         * image.c (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): Remove; these
9434         are duplicate now that they've been promoted to lisp.h.
9435         (x_allocate_bitmap_record, x_alloc_image_color)
9436         (make_image_cache, cache_image, xpm_load):
9437         Don't update size until alloc is done.
9438         (xpm_load, lookup_rgb_color, lookup_pixel_color, x_to_xcolors)
9439         (x_detect_edges):
9440         Check for size calculation overflow.
9441         (ct_colors_allocated_max): New constant.
9442         (x_to_xcolors, x_detect_edges): Reorder multiplicands to avoid
9443         overflow.
9445         * keyboard.c (read_char, menu_bar_items, tool_bar_items)
9446         (read_char_x_menu_prompt, read_char_minibuf_menu_width)
9447         (read_char_minibuf_menu_prompt, follow_key, read_key_sequence):
9448         Use ptrdiff_t, not int, to count maps.
9449         (read_char_minibuf_menu_prompt): Check for overflow in size
9450         calculations.  Don't update size until allocation succeeds.
9451         Redo calculations to avoid overflow.
9452         * keyboard.h: Change prototypes to match the above.
9454         * keymap.c (cmm_size, current_minor_maps): Use ptrdiff_t, not int,
9455         to count maps.
9456         (current_minor_maps): Check for size calculation overflow.
9457         * keymap.h: Change prototypes to match the above.
9459         * lread.c (read1, init_obarray): Don't update size until alloc done.
9461         * macros.c (Fstart_kbd_macro): Don't update size until alloc done.
9462         (store_kbd_macro_char): Reorder multiplicands to avoid overflow.
9464         * nsterm.h (struct ns_color_table.size, struct ns_color_table.avail):
9465         Now ptrdiff_t, not int.
9466         * nsterm.m (ns_index_color): Use ptrdiff_t, not int, for table indexes.
9467         (ns_draw_fringe_bitmap): Rewrite to avoid overflow.
9469         * process.c (Fnetwork_interface_list): Check for overflow
9470         in size calculation.
9472         * region-cache.c (move_cache_gap): Check for size calculation overflow.
9474         * scroll.c (do_line_insertion_deletion_costs): Check for size calc
9475         overflow.  Don't bother calling xmalloc when xrealloc will do.
9477         * search.c (Freplace_match): Check for size calculation overflow.
9478         (Fset_match_data): Don't assume list lengths fit in 'int'.
9480         * sysdep.c (system_process_attributes): Use ptrdiff_t, not int,
9481         for command line length.  Do not attempt to address one before the
9482         beginning of an array, as that's not portable.
9484         * term.c (max_frame_lines): Remove; unused.
9485         (encode_terminal_src_size, encode_terminal_dst_size): Now ptrdiff_t,
9486         not int.
9487         (encode_terminal_code, calculate_costs): Check for size
9488         calculation overflow.
9489         (encode_terminal_code): Use ptrdiff_t, not int, to record glyph
9490         table lengths and related sizes.  Don't update size until alloc
9491         done.  Redo calculations to avoid overflow.
9492         (calculate_costs): Don't bother calling xmalloc when xrealloc will do.
9494         * termcap.c (tgetent): Use ptrdiff_t, not int, to record results of
9495         subtracting pointers.
9496         (gobble_line): Check for overflow more carefully.  Don't update size
9497         until alloc done.
9499         * tparam.c (tparam1): Use ptrdiff_t, not int, for sizes.
9500         Don't update size until alloc done.
9501         Redo size calculations to avoid overflow.
9502         Check for size calculation overflow.
9503         (main) [DEBUG]: Fix typo in invoking tparam1.
9505         * xdisp.c (store_mode_line_noprop_char, x_consider_frame_title):
9506         Use ptrdiff_t, not int, for sizes.
9507         (store_mode_line_noprop_char): Don't update size until alloc done.
9509         * xfaces.c (lface_id_to_name_size, Finternal_make_lisp_face):
9510         Use ptrdiff_t, not int, for sizes.
9511         (Finternal_make_lisp_face, cache_face):
9512         Check for size calculation overflow.
9513         (cache_face): Treat size calculation overflows as if they were
9514         memory exhaustion (the usual treatment), rather than aborting.
9516         * xfns.c (x_encode_text, x_set_name_internal)
9517         (Fx_change_window_property): Use ptrdiff_t, not int, to count
9518         sizes, since they can exceed INT_MAX in size.  Check for size
9519         calculation overflow.
9521         * xgselect.c (gfds_size): Now ptrdiff_t, for convenience with xpalloc.
9522         (xg_select): Check for size calculation overflow.
9523         Don't update size until alloc done.
9525         * xrdb.c (get_environ_db): Don't assume path length fits in int,
9526         as sprintf is limited to int lengths.
9528         * xselect.c (X_LONG_SIZE, X_SHRT_MAX, X_SHRT_MIN, X_LONG_MAX)
9529         (X_LONG_MIN): New macros.
9530         Use them to make the following changes clearer.
9531         (MAX_SELECTION_QUANTUM): Make the other bounds on this value clearer.
9532         This change doesn't affect the value now, but it may help remind
9533         future maintainers not to raise the value too much later.
9534         (SELECTION_QUANTUM): Remove, replacing with ...
9535         (selection_quantum): ... new function, which avoids overflow.
9536         All uses changed.
9537         (struct selection_data.size): Now ptrdiff_t, not int, to avoid
9538         assumption that selection length fits in 'int'.
9539         (x_reply_selection_request, x_handle_selection_request)
9540         (x_get_window_property, receive_incremental_selection)
9541         (x_get_window_property_as_lisp_data, selection_data_to_lisp_data)
9542         (lisp_data_to_selection_data, clean_local_selection_data):
9543         Use ptrdiff_t, not int, to record length of selection.
9544         (x_reply_selection_request, x_get_window_property)
9545         (receive_incremental_selection, x_property_data_to_lisp):
9546         Redo calculations to avoid overflow.
9547         (x_reply_selection_request): When sending hint, ceiling it at
9548         X_LONG_MAX rather than relying on wraparound overflow to send
9549         something.
9550         (x_get_window_property, receive_incremental_selection)
9551         (lisp_data_to_selection_data, x_property_data_to_lisp):
9552         Check for size-calculation overflow.
9553         (x_get_window_property, receive_incremental_selection)
9554         (lisp_data_to_selection_data, Fx_register_dnd_atom):
9555         Don't store size until memory allocation succeeds.
9556         (x_get_window_property): Plug memory leak on memory exhaustion.
9557         Don't double-block input; malloc is safe here.  Don't assume 2**34
9558         - 4 fits in unsigned long.  Add an xassert to check
9559         XGetWindowProperty overflow.  Be more careful about overflow
9560         calculations, and distinguish size from memory overflow better.
9561         (receive_incremental_selection): When tracing, don't assume
9562         unsigned int is less than INT_MAX.
9563         (x_selection_data_to_lisp_data): Remove unnecessary (and in theory
9564         harmful) conversions of unsigned short to int.
9565         (lisp_data_to_selection_data): Don't assume that integers
9566         in the range -65535 through -1 fit in an X unsigned short.
9567         Don't assume that ULONG_MAX == X_ULONG_MAX.  Don't store into
9568         result parameters unless successful.  Rely on cons_to_unsigned
9569         to report problems with elements; the old code wasn't right anyway.
9570         (x_check_property_data): Check for int overflow; we cannot use
9571         a wider type due to X limits.
9572         (x_handle_dnd_message): Use unsigned int, to avoid int overflow.
9574         * xsmfns.c (smc_save_yourself_CB): Check for size calc overflow.
9576         * xterm.c (x_color_cells, x_send_scrollbar_event, handle_one_xevent)
9577         (x_term_init): Check for size calculation overflow.
9578         (x_color_cells): Don't store size until memory allocation succeeds.
9579         (handle_one_xevent): Use ptrdiff_t, not int, for byte counts.
9580         Don't assume alloca size is less than MAX_ALLOCA.
9581         (x_term_init): Don't assume length fits in int (sprintf is limited
9582         to int size).
9584         Use ptrdiff_t for composition IDs.
9585         * character.c (lisp_string_width):
9586         * composite.c (composition_table_size, n_compositions)
9587         (get_composition_id, composition_gstring_from_id):
9588         * dispextern.h (struct glyph_string.cmp_id, struct composition_it.id):
9589         * xdisp.c (BUILD_COMPOSITE_GLYPH_STRING):
9590         * window.c (Frecenter):
9591         Use ptrdiff_t, not int, for composition IDs.
9592         * composite.c (get_composition_id): Check for integer overflow.
9593         * composite.h: Adjust prototypes to match the above changes.
9595         Use ptrdiff_t for hash table indexes.
9596         * category.c (hash_get_category_set):
9597         * ccl.c (ccl_driver):
9598         * charset.h (struct charset.hash_index, CHECK_CHARSET_GET_ID):
9599         * coding.c (coding_system_charset_list, detect_coding_system):
9600         * coding.h (struct coding_system.id):
9601         * composite.c (get_composition_id, gstring_lookup_cache):
9602         * fns.c (hash_lookup, hash_put, Fgethash, Fputhash):
9603         * image.c (xpm_get_color_table_h):
9604         * lisp.h (hash_lookup, hash_put):
9605         * minibuf.c (Ftest_completion):
9606         Use ptrdiff_t for hash table indexes, not int (which is too
9607         narrow, on 64-bit hosts) or EMACS_INT (which is too wide, on
9608         32-bit --with-wide-int hosts).
9610         * charset.c (Fdefine_charset_internal): Check for integer overflow.
9611         Add a FIXME comment about memory leaks.
9612         (syms_of_charset): Don't assume xmalloc returns.
9614         Don't assume that stated character widths fit in int.
9615         * character.c (Fchar_width, c_string_width, lisp_string_width):
9616         * character.h (CHAR_WIDTH):
9617         * indent.c (MULTIBYTE_BYTES_WIDTH):
9618         Use sanitize_char_width to avoid undefined and/or bad behavior
9619         with outlandish widths.
9620         * character.h (sanitize_tab_width): Rename from sanitize_width,
9621         now that we have two such functions.  All uses changed.
9622         (sanitize_char_width): New inline function.
9624         Don't assume that tab-width fits in int.
9625         * character.h (sanitize_width): New inline function.
9626         (SANE_TAB_WIDTH): New macro.
9627         (ASCII_CHAR_WIDTH): Use it.
9628         * indent.c (sane_tab_width): Remove.  All uses replaced by
9629         SANE_TAB_WIDTH (current_buffer).
9630         * xdisp.c (init_iterator): Use SANE_TAB_WIDTH.
9632         * fileio.c: Integer overflow issues with file modes.
9633         (Fset_file_modes, auto_save_1): Don't assume EMACS_INT fits in int.
9635         * charset.c (read_hex): New arg OVERFLOW.  All uses changed.
9636         Remove unreachable code.
9637         (read_hex, load_charset_map_from_file): Check for integer overflow.
9639         * xterm.c: Don't go over XClientMessageEvent limit.
9640         (scroll_bar_windows_size): Now ptrdiff_t, as we prefer signed.
9641         (x_send_scroll_bar_event): Likewise.  Check that the size does not
9642         exceed limits imposed by XClientMessageEvent, as well as the usual
9643         ptrdiff_t and size_t limits.
9645         * keyboard.c: Overflow, signedness and related fixes.
9646         (make_lispy_movement): Use same integer type in forward decl
9647         that is used in the definition.
9648         (read_key_sequence, keyremap_step):
9649         Change bufsize argument back to int, undoing my 2011-03-30 change.
9650         We prefer signed types, and int is wide enough here.
9651         (parse_tool_bar_item): Don't assume tool_bar_max_label_size is less
9652         than TYPE_MAXIMUM (EMACS_INT) / 2.  Don't let the label size grow
9653         larger than STRING_BYTES_BOUND.  Use ptrdiff_t for Emacs string
9654         length, not size_t.  Use ptrdiff_t for index, not int.
9655         (keyremap_step, read_key_sequence): Redo bufsize check to avoid
9656         possibility of integer overflow.
9658         Overflow, signedness and related fixes for images.
9660         * dispextern.h (struct it.stack[0].u.image.image_id)
9661         (struct_it.image_id, struct image.id, struct image_cache.size)
9662         (struct image_cache.used, struct image_cache.ref_count):
9663         * gtkutil.c (update_frame_tool_bar):
9664         * image.c (x_reference_bitmap, Fimage_size, Fimage_mask_p)
9665         (Fimage_metadata, free_image_cache, clear_image_cache, lookup_image)
9666         (cache_image, mark_image_cache, x_kill_gs_process, Flookup_image):
9667         * nsmenu.m (update_frame_tool_bar):
9668         * xdisp.c (calc_pixel_width_or_height):
9669         * xfns.c (image_cache_refcount):
9670         Image IDs are now ptrdiff_t, not int, to avoid arbitrary limits
9671         on typical 64-bit hosts.
9673         * image.c (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): New macros.
9674         (x_bitmap_pixmap, x_create_x_image_and_pixmap):
9675         Omit unnecessary casts to int.
9676         (parse_image_spec): Check that integers fall into 'int' range
9677         when the callers expect that.
9678         (image_ascent): Redo ascent calculation to avoid int overflow.
9679         (clear_image_cache): Avoid overflow when sqrt (INT_MAX) < nimages.
9680         (lookup_image): Remove unnecessary tests.
9681         (xbm_image_p): Locals are now of int, not EMACS_INT,
9682         since parse_image_check makes sure they fit into int.
9683         (png_load, gif_load, svg_load_image):
9684         Prefer int to unsigned where either will do.
9685         (tiff_handler): New function, combining the cores of the
9686         old tiff_error_handler and tiff_warning_handler.
9687         This function is rewritten to use vsnprintf and thereby avoid
9688         stack buffer overflows.  It uses only the features of vsnprintf
9689         that are common to both POSIX and native Microsoft.
9690         (tiff_error_handler, tiff_warning_handler): Use it.
9691         (tiff_load, gif_load, imagemagick_load_image):
9692         Don't assume :index value fits in 'int'.
9693         (gif_load): Omit unnecessary cast to double, and avoid double-rounding.
9694         (imagemagick_load_image): Check that crop parameters fit into
9695         the integer types that MagickCropImage accepts.  Don't assume
9696         Vimagemagick_render_type has a nonnegative value.  Don't assume
9697         size_t fits in 'long'.
9698         (gs_load): Use printmax_t to print the widest integers possible.
9699         Check for integer overflow when computing image height and width.
9701 2011-08-26  Eli Zaretskii  <eliz@gnu.org>
9703         * xdisp.c (redisplay_window): Don't force window start if point
9704         will be invisible in the resulting window.  (Bug#9324)
9706 2011-08-25  Eli Zaretskii  <eliz@gnu.org>
9708         * xdisp.c (compute_display_string_pos): Return 2 in DISP_PROP when
9709         the display spec is of the form `(space ...)'.
9710         (handle_display_spec): Return the value returned by
9711         handle_single_display_spec, not just 1 or zero.
9712         (handle_single_display_spec): If the display spec is of the form
9713         `(space ...)', and specifies display in the text area, return 2
9714         rather than 1.
9715         (try_cursor_movement): Check for the need to scroll more
9716         accurately, and prefer exact match for point under bidi.
9717         Don't advance `row' beyond the last row of the window.
9719         * dispextern.h (struct bidi_it): Rename the disp_prop_p member
9720         into disp_prop; all users changed.
9722         * bidi.c (bidi_fetch_char): If compute_display_string_pos returns
9723         DISP_PROP = 2, substitute the u+2029 PARAGRAPH SEPARATOR character
9724         for the text covered by the display property.
9726 2011-08-25  Chong Yidong  <cyd@stupidchicken.com>
9728         * buffer.c (Fbury_buffer_internal): Rename from Funrecord_buffer.
9729         Change return value to nil.
9730         (Frecord_buffer): Delete unused function.
9732 2011-08-24  Eli Zaretskii  <eliz@gnu.org>
9734         * xdisp.c (Fcurrent_bidi_paragraph_direction): For unibyte
9735         buffers, return left-to-right.
9736         (set_cursor_from_row): Consider candidate row a win if its glyph
9737         represents a newline and point is on that newline.  Fixes cursor
9738         positioning on the newline at EOL of R2L text within L2R
9739         paragraph, and vice versa.
9740         (try_cursor_movement): Check continued rows, in addition to
9741         continuation rows.  Fixes unwarranted scroll when point enters a
9742         continued line of R2L text within an L2R paragraph, or vice versa.
9743         (cursor_row_p): Consider the case of point being equal to
9744         MATRIX_ROW_END_CHARPOS.  Prevents cursor being stuck when moving
9745         from the end of a short line to the beginning of a continued line
9746         of R2L text within L2R paragraph.
9747         (RECORD_MAX_MIN_POS): For max_pos, use IT_CHARPOS even for
9748         composed characters.
9750         * bidi.c (bidi_check_type): Use xassert.
9751         (bidi_cache_iterator_state): Update the disp_pos and disp_prop_p
9752         members.
9754 2011-08-23  Eli Zaretskii  <eliz@gnu.org>
9756         * bidi.c (bidi_get_type): Abort if we get zero as the bidi type of
9757         a character.
9759 2011-08-23  Chong Yidong  <cyd@stupidchicken.com>
9761         * nsfont.m (ns_otf_to_script): Fix typo.
9763 2011-08-22  Kenichi Handa  <handa@m17n.org>
9765         * chartab.c (Fset_char_table_extra_slot): Do not inhibit setting a
9766         extra slot even if the purpose is char-code-property-table.
9768 2011-08-23  Eli Zaretskii  <eliz@gnu.org>
9770         * xdisp.c (redisplay_window): When computing centering_position,
9771         account for the height of the header line.  (Bug#8874)
9773         * dispnew.c (buffer_posn_from_coords): Use buf_charpos_to_bytepos
9774         instead of CHAR_TO_BYTE.  Fixes a crash when a completion
9775         candidate is selected by the mouse, and that candidate has a
9776         composed character under the mouse.
9778         * xdisp.c (x_produce_glyphs): Set it->nglyphs to 1.  Fixes pixel
9779         coordinates reported by pos-visible-in-window-p for a composed
9780         character in column zero.
9782 2011-08-23  Stefan Monnier  <monnier@iro.umontreal.ca>
9784         * cmds.c (Fself_insert_command): Mention post-self-insert-hook.
9786 2011-08-22  Eli Zaretskii  <eliz@gnu.org>
9788         * xdisp.c (BUFFER_POS_REACHED_P): If this is a composition,
9789         consider it a hit if to_charpos is anywhere in the range of the
9790         composed buffer positions.
9792 2011-08-22  Chong Yidong  <cyd@stupidchicken.com>
9794         * image.c (gif_load): Don't assume that each subimage has the same
9795         dimensions as the base image.  Handle disposal method that is
9796         "undefined" by the gif spec (Bug#9335).
9798 2011-08-20  Chong Yidong  <cyd@stupidchicken.com>
9800         * eval.c (Fsignal): Handle `debug' symbol in error handler (Bug#9329).
9801         (Fcondition_case): Document `debug' symbol in error handler.
9803 2011-08-19  Eli Zaretskii  <eliz@gnu.org>
9805         * xfaces.c (face_at_buffer_position): Avoid repeated evaluation of
9806         face ID by FACE_FROM_ID, and avoid a crash when mouse is moved
9807         from an Org mode buffer to a Speedbar frame.
9809         * xdisp.c (RECORD_MAX_MIN_POS): If the display element comes from
9810         a composition, take its buffer position from IT->cmp_it.charpos.
9811         Fixes cursor positioning at the beginning of a line that begins
9812         with a composed character.
9814 2011-08-18  Eli Zaretskii  <eliz@gnu.org>
9816         * bidi.c (bidi_get_type): If bidi_type_table reports zero as the
9817         character bidirectional type, use STRONG_L instead.  Fixes crashes
9818         in a buffer produced by `describe-categories'.
9820         * dispextern.h (struct bidi_it): Move disp_pos and disp_prop_p
9821         members before the level stack, so they would be saved and
9822         restored when copying iterator state.  Fixes incorrect reordering
9823         around TABs covered by display properties.
9825 2011-08-18  Andreas Schwab  <schwab@linux-m68k.org>
9827         * process.c (Fnetwork_interface_list): Correctly determine buffer size.
9829 2011-08-17  Chong Yidong  <cyd@stupidchicken.com>
9831         * eval.c (internal_condition_case, internal_condition_case_1)
9832         (internal_condition_case_2, internal_condition_case_n):
9833         Remove unnecessary aborts (Bug#9081).
9835 2011-08-17  Eli Zaretskii  <eliz@gnu.org>
9837         * lread.c (Fload) [DOS_NT]: If `openp' returns -2, but the file
9838         has no `load' handler, try opening the file locally.  (Bug#9311)
9840 2011-08-16  Ken Brown  <kbrown@cornell.edu>
9842         * gmalloc.c: Expand comment.
9844 2011-08-16  Eli Zaretskii  <eliz@gnu.org>
9846         * xdisp.c (set_cursor_from_row): Don't accept a previous candidate
9847         if it fails the cursor_row_p test.  Fixes cursor positioning at ZV.
9849 2011-08-16  Ken Brown  <kbrown@cornell.edu>
9851         Fix memory allocation problems in Cygwin build (Bug#9273).
9853         * unexcw.c ( __malloc_initialized): Declare external variable.
9854         (fixup_executable): Force the dumped emacs to reinitialize malloc.
9856         * gmalloc.c [CYGWIN] (bss_sbrk_heapbase, bss_sbrk_heapinfo):
9857         New variables.
9858         (malloc_initialize_1) [CYGWIN]: Prepare for reinitializing the
9859         dumped emacs.
9860         (_free_internal_nolock) [CYGWIN]: Ignore requests to free storage
9861         in the static heap.
9862         [CYGWIN] (special_realloc): New function.
9863         (_realloc_internal_nolock) [CYGWIN]: Use the new function on
9864         requests to realloc storage in the static heap.
9866 2011-08-15  Paul Eggert  <eggert@cs.ucla.edu>
9868         * bidi.c (bidi_initialize): Remove unused local.
9870 2011-08-15  Eli Zaretskii  <eliz@gnu.org>
9872         * bidimirror.h:
9873         * biditype.h: Remove file.
9874         * makefile.w32-in ($(BLD)/bidi.$(O)):
9875         * deps.mk (bidi.o): Remove biditype.h and bidimirror.h.
9877         * dispextern.h: Fix a typo in the comment to bidi_type_t.
9879         * chartab.c: Improve commentary for the uniprop_table API.
9881         * bidi.c (bidi_paragraph_init): Support zero value of
9882         bidi_ignore_explicit_marks_for_paragraph_level.
9883         (bidi_initialize): Use uniprop_table instead of including
9884         biditype.h and bidimirror.h.
9886         * xdisp.c (move_it_in_display_line_to): Don't reset pixel
9887         coordinates of the iterator when restoring from ppos_it.
9888         (Bug#9296)
9890 2011-08-14  Kenichi Handa  <handa@m17n.org>
9892         * process.c (create_process): Call setup_process_coding_systems
9893         after the pid of the process is set to -1 (Bug#8162).
9895 2011-08-14  Eli Zaretskii  <eliz@gnu.org>
9897         * xdisp.c (move_it_in_display_line_to): Don't invoke
9898         IT_RESET_X_ASCENT_DESCENT when iterator position was restored from
9899         ppos_it.  Fixes vertical cursor motion when line beginning is
9900         covered by an image.  (Bug#9296)
9902 2011-08-14  Jan Djärv  <jan.h.d@swipnet.se>
9904         * nsterm.h (ns_run_ascript): Declare.
9905         (NSAPP_DATA2_RUNASSCRIPT): Define.
9907         * nsfns.m (as_script, as_result, as_status): New static variables.
9908         (ns_run_ascript): New function.
9909         (Fns_do_applescript): Set variables as_*.  Make an NSApplicationDefined
9910         event with data2 set to NSAPP_DATA2_RUNASSCRIPT, post it and then start
9911         the event loop.  Get status from as_status (Bug#7276).
9913         * nsterm.m (sendEvent): If event is NSApplicationDefined and
9914         data2 is NSAPP_DATA2_RUNASSCRIPT, call ns_run_ascript and then exit
9915         the event loop (Bug#7276).
9917 2011-08-14  Andreas Schwab  <schwab@linux-m68k.org>
9919         * gnutls.c (QCgnutls_bootprop_priority)
9920         (QCgnutls_bootprop_trustfiles, QCgnutls_bootprop_keylist)
9921         (QCgnutls_bootprop_crlfiles, QCgnutls_bootprop_callbacks)
9922         (QCgnutls_bootprop_loglevel, QCgnutls_bootprop_hostname)
9923         (QCgnutls_bootprop_min_prime_bits, QCgnutls_bootprop_verify_flags)
9924         (QCgnutls_bootprop_verify_hostname_error)
9925         (QCgnutls_bootprop_callbacks_verify): Rename from
9926         Qgnutls_bootprop_..., all uses changed.
9928         * xfaces.c (QCignore_defface): Rename from Qignore_defface, all
9929         uses changed.
9931 2011-08-14  Paul Eggert  <eggert@cs.ucla.edu>
9933         * xfaces.c (Qframe_set_background_mode): Now static.
9934         * dispextern.h (Qframe_set_background_mode): Remove decl.
9936         * process.c (Fnetwork_interface_info): Declare local only if needed.
9938 2011-08-13  Jan Djärv  <jan.h.d@swipnet.se>
9940         * process.c: Include ifaddrs.h and net/if_dl.h if available (Bug#8477).
9941         (Fnetwork_interface_list): Allocate in increments of bytes instead
9942         of sizeof (struct ifreq).  Iterate over ifconf.ifc_req by counting
9943         bytes (Bug#8477).  Count bytes correctly when ifr_addr is a struct
9944         sockaddr.
9945         (struct ifflag_def): notrailers is smart on OSX.
9946         (Fnetwork_interface_info): Handle case when ifr_flags is negative.
9947         Get hardware address with getifaddrs if available.
9949 2011-08-12  Eli Zaretskii  <eliz@gnu.org>
9951         * xdisp.c (iterate_out_of_display_property): xassert that
9952         IT->position is set to within IT->object's boundaries.  Break from
9953         the loop as soon as EOB is reached; avoids infloops in redisplay
9954         when IT->position is set up wrongly due to some bug.
9955         Set IT->current to match the bidi iterator unconditionally.
9956         (push_display_prop): Allow GET_FROM_STRING as IT->method on
9957         entry.  Force push_it to save on the stack the current
9958         buffer/string position, to be restored by pop_it.  Fix flags in
9959         the iterator structure wrt the object coming from a display
9960         property, as `line-prefix' and `wrap-prefix' are not ``replacing''
9961         properties.  (Bug#9284)
9963 2011-08-09  Andreas Schwab  <schwab@linux-m68k.org>
9965         * fontset.c (fontset_get_font_group): Add proper type checks.
9966         (Bug#9172)
9968 2011-08-09  YAMAMOTO Mitsuharu  <mituharu@math.s.chiba-u.ac.jp>
9970         * unexmacosx.c (print_load_command_name): Add cases LC_FUNCTION_STARTS
9971         and LC_VERSION_MIN_MACOSX.
9972         (copy_linkedit_data) [LC_FUNCTION_STARTS]: New function.
9973         (dump_it) [LC_FUNCTION_STARTS]: Use it.
9975 2011-08-08  Eli Zaretskii  <eliz@gnu.org>
9977         * xdisp.c (forward_to_next_line_start): Allow to use the
9978         no-display-properties-and-no-overlays under bidi display.
9979         Set disp_pos in the bidi iterator to avoid searches for display
9980         properties and overlays.
9982 2011-08-08  Chong Yidong  <cyd@stupidchicken.com>
9984         * editfns.c (Fset_time_zone_rule): Document relationship with the
9985         setenv function.
9987         * ftfont.c (ftfont_pattern_entity): Copy the extras argument to
9988         the font entity extracted from the cache (Bug#8109).
9990 2011-08-07  Chong Yidong  <cyd@stupidchicken.com>
9992         * composite.c (autocmp_chars): Don't reset point.  That is done by
9993         restore_point_unwind (Bug#5984).
9995 2011-08-07  Juri Linkov  <juri@jurta.org>
9997         * editfns.c (Fformat_time_string): Doc fix, add tag `usage:'
9998         to show the arg `TIME' instead of `TIMEVAL'.
10000 2011-08-06  Eli Zaretskii  <eliz@gnu.org>
10002         * xdisp.c (set_cursor_from_row): Fix cursor positioning when a
10003         display property strides EOL and includes a newline, as in
10004         longlines-mode.  (Bug#9254)
10005         (move_it_in_display_line_to): Fix vertical-motion in a buffer with
10006         word-wrap under bidirectional display.  (Bug#9224)
10008         * bidi.c (bidi_unshelve_cache): Don't reset the cache if JUST_FREE
10009         is non-zero, even if the data buffer is NULL.  Fixes a crash in
10010         vertical-motion with longlines-mode.  (Bug#9254)
10012 2011-08-05  Eli Zaretskii  <eliz@gnu.org>
10014         * bidi.c <bidi_cache_total_alloc>: Now static.
10015         (bidi_initialize): Initialize bidi_cache_total_alloc.
10017         * xdisp.c (display_line): Release buffer allocated for shelved bidi
10018         cache.  (Bug#9221)
10020         * bidi.c (bidi_shelve_cache, bidi_unshelve_cache): Track total
10021         amount allocated this far in `bidi_cache_total_alloc'.
10022         (bidi_unshelve_cache): Accept an additional argument JUST_FREE; if
10023         non-zero, only free the data buffer without restoring the cache
10024         contents.  All callers changed.
10026         * dispextern.h (bidi_unshelve_cache): Update prototype.
10028         * xdisp.c (SAVE_IT, pos_visible_p, move_it_in_display_line_to)
10029         (move_it_in_display_line, move_it_to)
10030         (move_it_vertically_backward, move_it_by_lines): Replace the call
10031         to xfree to an equivalent call to bidi_unshelve_cache.
10032         (move_it_in_display_line_to): Fix logic of returning
10033         MOVE_POS_MATCH_OR_ZV in the bidi case.  (Bug#9224)
10035 2011-08-05  Eli Zaretskii  <eliz@gnu.org>
10037         * xdisp.c (set_cursor_from_row): Prefer the candidate glyph that
10038         came from a string character with a `cursor' property.  (Bug#9229)
10040 2011-08-04  Jan Djärv  <jan.h.d@swipnet.se>
10042         * Makefile.in (LIB_PTHREAD): New variable.
10043         (LIBES): Add LIB_PTHREAD (Bug#9216).
10045         * alloc.c, emacs.c, gmalloc.c, gtkutil.c, keyboard.c, syssignal.h:
10046         Rename HAVE_GTK_AND_PTHREAD to HAVE_PTHREAD (Bug#9216).
10048 2011-08-04  Andreas Schwab  <schwab@linux-m68k.org>
10050         * regex.c (re_iswctype): Remove some redundant boolean conversions.
10052 2011-08-04  Jan Djärv  <jan.h.d@swipnet.se>
10054         * xterm.c (x_find_topmost_parent): New function.
10055         (x_set_frame_alpha): Find topmost parent window with
10056         x_find_topmost_parent and set the property there also (bug#9181).
10057         (handle_one_xevent): Call x_set_frame_alpha on ReparentNotify.
10059 2011-08-04  Paul Eggert  <eggert@cs.ucla.edu>
10061         * callproc.c (Fcall_process): Avoid vfork clobbering
10062         the local vars buffer, coding_systems, current_dir.
10064 2011-08-03  Stefan Monnier  <monnier@iro.umontreal.ca>
10066         * keymap.c (Fmake_composed_keymap): Move to subr.el.
10068 2011-08-03  Paul Eggert  <eggert@cs.ucla.edu>
10070         * fontset.c (dump_fontset) [FONTSET_DEBUG]: Declare EXTERNALLY_VISIBLE
10071         so that it is not optimized away.
10073         * xdisp.c (compute_display_string_pos): Remove unused local.
10075 2011-08-02  Eli Zaretskii  <eliz@gnu.org>
10077         Fix slow cursor motion and scrolling in large buffers with
10078         selective display, like Org Mode buffers.  (Bug#9218)
10080         * dispextern.h (struct bidi_it): New member disp_prop_p.
10082         * xdisp.c: Remove one-slot cache of display string positions.
10083         (compute_display_string_pos): Accept an additional argument
10084         DISP_PROP_P; callers changed.  Scan at most 5K characters forward
10085         for a display string or property.  If found, set DISP_PROP_P
10086         non-zero.
10088         * bidi.c (bidi_fetch_char): Accept an additional argument
10089         DISP_PROP_P, and pass it to compute_display_string_pos.
10090         Only handle text covered by a display string if DISP_PROP_P is returned
10091         non-zero.  All callers of bidi_fetch_char changed.
10093 2011-08-02  Stefan Monnier  <monnier@iro.umontreal.ca>
10095         * keymap.c (Fdefine_key): Fix Lisp_Object/int mixup; apply some CSE.
10097 2010-12-03  Don March  <don@ohspite.net>
10099         * keymap.c (Fdefine_key): Fix non-prefix key error message when
10100         last character M-[char] is translated to ESC [char] (bug#7541).
10102 2011-08-02  Kenichi Handa  <handa@m17n.org>
10104         * lisp.h (uniprop_table): Extern it.
10106         * chartab.c (uniprop_table): Make it non-static.
10108 2011-08-01  Eli Zaretskii  <eliz@gnu.org>
10110         * xdisp.c (forward_to_next_line_start): Accept additional argument
10111         BIDI_IT_PREV, and store into it the state of the bidi iterator had
10112         on the newline.
10113         (reseat_at_next_visible_line_start): Use the bidi iterator state
10114         returned by forward_to_next_line_start to restore the state of
10115         it->bidi_it after backing up to previous newline.  (Bug#9212)
10117 2011-07-30  Andreas Schwab  <schwab@linux-m68k.org>
10119         * regex.c (re_comp): Protoize.
10120         (re_exec): Fix return type.
10121         (regexec): Fix type of `ret'.  (Bug#9203)
10123 2011-07-28  Paul Eggert  <eggert@cs.ucla.edu>
10125         * image.c (check_image_size): Use 1024x1024 if unknown frame (Bug#9189).
10126         This is needed if max-image-size is a floating-point number.
10128 2011-07-28  Andreas Schwab  <schwab@linux-m68k.org>
10130         * print.c (print_object): Print empty symbol as ##.
10132         * lread.c (read1): Read ## as empty symbol.
10134 2011-07-28  Alp Aker  <alp.tekin.aker@gmail.com>
10136         * nsfns.m (x_set_foreground_color): Set f->foreground_pixel when
10137         setting frame foreground color (Bug#9175).
10138         (x_set_background_color): Likewise.
10140         * nsmenu.m (-setText): Size tooltip dimensions precisely to
10141         contents (Bug#9176).
10142         (EmacsTooltip -init): Remove bezels and add shadows to
10143         tooltip windows.
10145         * nsterm.m (ns_dumpglyphs_stretch): Avoid overwriting left fringe
10146         or scroll bar (Bug#8470).
10148         * nsfont.m (nsfont_open): Remove assignment to voffset and
10149         unnecessary vars hshink, expand, hd, full_height, min_height.
10150         (nsfont_draw): Use s->ybase as baseline for glyph drawing (Bug#8913).
10152         * nsterm.h (nsfont_info): Remove voffset field.
10154 2011-07-28  Alp Aker  <alp.tekin.aker@gmail.com>
10156         Implement strike-through and overline on NextStep (Bug#8863).
10158         * nsfont.m (nsfont_open): Use underline position provided by font,
10159         instead of hard-coded value of 2.
10160         (nsfont_draw): Call ns_draw_text_decoration instead.
10162         * nsterm.h: Add declaration for ns_draw_text_decoration.
10164         * nsterm.m (ns_draw_text_decoration): New function for drawing
10165         underline, overline, and strike-through.
10166         (ns_dumpglyphs_image, ns_dumpglyphs_stretch): Add call to
10167         ns_draw_text_decoration.  Change treatment of cursor drawing to
10168         accommodate underlining, etc.
10170 2011-07-28  Eli Zaretskii  <eliz@gnu.org>
10172         * buffer.c (init_buffer_once): Set bidi-display-reordering to t by
10173         default.
10175 2011-07-28  Paul Eggert  <eggert@cs.ucla.edu>
10177         * alloc.c (memory_full) [!SYNC_INPUT]: Fix signal-related race.
10178         Without this fix, if a signal arrives just after memory fills up,
10179         'malloc' might be invoked reentrantly.
10181         * image.c (x_check_image_size) [!HAVE_X_WINDOWS]: Return 1.
10182         In other words, assume that every image size is allowed, on non-X
10183         hosts.  This assumption is probably wrong, but it lets Emacs compile.
10185 2011-07-28  Andreas Schwab  <schwab@linux-m68k.org>
10187         * regex.c (re_iswctype): Convert return values to boolean.
10189 2011-07-28  Eli Zaretskii  <eliz@fencepost.gnu.org>
10191         * xdisp.c (compute_display_string_pos): Don't use cached display
10192         string position if the buffer had its restriction changed.
10193         (Bug#9184)
10195 2011-07-28  Paul Eggert  <eggert@cs.ucla.edu>
10197         * callproc.c (Fcall_process): Use 'volatile' to avoid vfork clobbering.
10199 2011-07-28  Paul Eggert  <eggert@cs.ucla.edu>
10201         Integer signedness and overflow and related fixes.  (Bug#9079)
10203         * bidi.c: Integer size and overflow fixes.
10204         (bidi_cache_size, bidi_cache_idx, bidi_cache_last_idx)
10205         (bidi_cache_start, bidi_cache_fetch_state, bidi_cache_search)
10206         (bidi_cache_find_level_change, bidi_cache_ensure_space)
10207         (bidi_cache_iterator_state, bidi_cache_find, bidi_cache_start_stack)
10208         (bidi_find_other_level_edge):
10209         Use ptrdiff_t instead of EMACS_INT where either will do.
10210         This works better on 32-bit hosts configured --with-wide-int.
10211         (bidi_cache_ensure_space): Check for size-calculation overflow.
10212         Use % rather than repeated addition, for better worst-case speed.
10213         Don't set bidi_cache_size until after xrealloc returns, because it
10214         might not return.
10215         (bidi_dump_cached_states): Use ptrdiff_t, not int, to avoid overflow.
10216         (bidi_cache_ensure_space): Also check that the bidi cache size
10217         does not exceed that of the largest Lisp string or buffer.  See Eli
10218         Zaretskii in <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9079#29>.
10220         * alloc.c (__malloc_size_t): Remove.
10221         All uses replaced by size_t.  See Andreas Schwab's note
10222         <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9079#8>.
10224         * image.c: Improve checking for integer overflow.
10225         (check_image_size): Assume that f is nonnull, since
10226         it is always nonnull in practice.  This is one less thing to
10227         worry about when checking for integer overflow later.
10228         (x_check_image_size): New function, which checks for integer
10229         overflow issues inside X.
10230         (x_create_x_image_and_pixmap, xbm_read_bitmap_data): Use it.
10231         This removes the need for a memory_full check.
10232         (xbm_image_p): Rewrite to avoid integer multiplication overflow.
10233         (Create_Pixmap_From_Bitmap_Data, xbm_load): Use x_check_image_size.
10234         (xbm_read_bitmap_data): Change locals back to 'int', since
10235         their values must fit in 'int'.
10236         (xpm_load_image, png_load, tiff_load):
10237         Invoke x_create_x_image_and_pixmap earlier,
10238         to avoid much needless work if the image is too large.
10239         (tiff_load): Treat overly large images as if
10240         x_create_x_image_and_pixmap failed, not as malloc failures.
10241         (gs_load): Use x_check_image_size.
10243         * gtkutil.c: Omit integer casts.
10244         (xg_get_pixbuf_from_pixmap): Remove unnecessary cast.
10245         (xg_set_toolkit_scroll_bar_thumb): Rewrite to avoid need for cast.
10247         * image.c (png_load): Don't assume height * row_bytes fits in 'int'.
10249         * xfaces.c (Fbitmap_spec_p): Fix integer overflow bug.
10250         Without this fix, (bitmap-spec-p '(34359738368 1 "x"))
10251         would wrongly return t on a 64-bit host.
10253         * dispnew.c (init_display): Use *_RANGE_OVERFLOW macros.
10254         The plain *_OVERFLOW macros run afoul of GCC bug 49705
10255         <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49705>
10256         and therefore cause GCC to emit a bogus diagnostic in some cases.
10258         * image.c: Integer signedness and overflow and related fixes.
10259         This is not an exhaustive set of fixes, but it's time to
10260         record what I've got.
10261         (lookup_pixel_color, check_image_size): Remove redundant decls.
10262         (check_image_size): Don't assume that arbitrary EMACS_INT values
10263         fit in 'int', or that arbitrary 'double' values fit in 'int'.
10264         (x_alloc_image_color, x_create_x_image_and_pixmap, png_load)
10265         (tiff_load, imagemagick_load_image):
10266         Check for overflow in size calculations.
10267         (x_create_x_image_and_pixmap): Remove unnecessary test for
10268         xmalloc returning NULL; that can't happen.
10269         (xbm_read_bitmap_data): Don't assume sizes fit into 'int'.
10270         (xpm_color_bucket): Use better integer hashing function.
10271         (xpm_cache_color): Don't possibly over-allocate memory.
10272         (struct png_memory_storage, tiff_memory_source, tiff_seek_in_memory)
10273         (gif_memory_source):
10274         Use ptrdiff_t, not int or size_t, to record sizes.
10275         (png_load): Don't assume values greater than 2**31 fit in 'int'.
10276         (our_stdio_fill_input_buffer): Prefer ptrdiff_t to size_t when
10277         either works, as we prefer signed integers.
10278         (tiff_read_from_memory, tiff_write_from_memory):
10279         Return tsize_t, not size_t, since that's what the TIFF API wants.
10280         (tiff_read_from_memory): Don't fail simply because the read would
10281         go past EOF; instead, return a short read.
10282         (tiff_load): Omit no-longer-needed casts.
10283         (Fimagemagick_types): Don't assume size fits into 'int'.
10285         Improve hashing quality when configured --with-wide-int.
10286         * fns.c (hash_string): New function, taken from sxhash_string.
10287         Do not discard information about ASCII character case; this
10288         discarding is no longer needed.
10289         (sxhash-string): Use it.  Change sig to match it.  Caller changed.
10290         * lisp.h: Declare it.
10291         * lread.c (hash_string): Remove, since we now use fns.c's version.
10292         The fns.c version returns a wider integer if --with-wide-int is
10293         specified, so this should help the quality of the hashing a bit.
10295         * emacs.c: Integer overflow minor fix.
10296         (heap_bss_diff): Now uprintmax_t, not unsigned long.  All used changed.
10297         Define only if GNU_LINUX.
10298         (main, Fdump_emacs): Set and use heap_bss_diff only if GNU_LINUX.
10300         * dispnew.c: Integer signedness and overflow fixes.
10301         Remove unnecessary forward decls, that were a maintenance hassle.
10302         (history_tick): Now uprintmax_t, so it's more likely to avoid overflow.
10303         All uses changed.
10304         (adjust_glyph_matrix, realloc_glyph_pool, adjust_frame_message_buffer)
10305         (scrolling_window): Use ptrdiff_t, not int, for byte count.
10306         (prepare_desired_row, line_draw_cost):
10307         Use int, not unsigned, where either works.
10308         (save_current_matrix, restore_current_matrix):
10309         Use ptrdiff_t, not size_t, where either works.
10310         (init_display): Check for overflow more accurately, and without
10311         relying on undefined behavior.
10313         * editfns.c (pWIDE, pWIDElen, signed_wide, unsigned_wide):
10314         Remove, replacing with the new symbols in lisp.h.  All uses changed.
10315         * fileio.c (make_temp_name):
10316         * filelock.c (lock_file_1, lock_file):
10317         * xdisp.c (message_dolog):
10318         Don't assume PRIdMAX etc. works; this isn't portable to pre-C99 hosts.
10319         Use pMd etc. instead.
10320         * lisp.h (printmax_t, uprintmax_t, pMd, pMu): New types and macros,
10321         replacing the pWIDE etc. symbols removed from editfns.c.
10323         * keyboard.h (num_input_events): Now uintmax_t.
10324         This is (very slightly) less likely to mess up due to wraparound.
10325         All uses changed.
10327         * buffer.c: Integer signedness fixes.
10328         (alloc_buffer_text, enlarge_buffer_text):
10329         Use ptrdiff_t rather than size_t when either will do, as we prefer
10330         signed integers.
10332         * alloc.c: Integer signedness and overflow fixes.
10333         Do not impose an arbitrary 32-bit limit on malloc sizes when debugging.
10334         (__malloc_size_t): Default to size_t, not to int.
10335         (pure_size, pure_bytes_used_before_overflow, stack_copy_size)
10336         (Fgarbage_collect, mark_object_loop_halt, mark_object):
10337         Prefer ptrdiff_t to size_t when either would do, as we prefer
10338         signed integers.
10339         (XMALLOC_OVERRUN_CHECK_OVERHEAD): New macro.
10340         (xmalloc_overrun_check_header, xmalloc_overrun_check_trailer):
10341         Now const.  Initialize with values that are in range even if char
10342         is signed.
10343         (XMALLOC_PUT_SIZE, XMALLOC_GET_SIZE): Remove, replacing with ...
10344         (xmalloc_put_size, xmalloc_get_size): New functions.  All uses changed.
10345         These functions do the right thing with sizes > 2**32.
10346         (check_depth): Now ptrdiff_t, not int.
10347         (overrun_check_malloc, overrun_check_realloc, overrun_check_free):
10348         Adjust to new way of storing sizes.  Check for size overflow bugs
10349         in rest of code.
10350         (STRING_BYTES_MAX): Adjust to new overheads.  The old code was
10351         slightly wrong anyway, as it missed one instance of
10352         XMALLOC_OVERRUN_CHECK_OVERHEAD.
10353         (refill_memory_reserve): Omit needless cast to size_t.
10354         (mark_object_loop_halt): Mark as externally visible.
10356         * xselect.c: Integer signedness and overflow fixes.
10357         (Fx_register_dnd_atom, x_handle_dnd_message):
10358         Use ptrdiff_t, not size_t, since we prefer signed.
10359         (Fx_register_dnd_atom): Check for ptrdiff_t (and size_t) overflow.
10360         * xterm.h (struct x_display_info): Use ptrdiff_t, not size_t, for
10361         x_dnd_atoms_size and x_dnd_atoms_length.
10363         * doprnt.c: Prefer signed to unsigned when either works.
10364         * eval.c (verror):
10365         * doprnt.c (doprnt):
10366         * lisp.h (doprnt):
10367         * xdisp.c (vmessage):
10368         Use ptrdiff_t, not size_t, when using or implementing doprnt,
10369         since the sizes cannot exceed ptrdiff_t bounds anyway, and we
10370         prefer signed arithmetic to avoid comparison confusion.
10371         * doprnt.c (doprnt): Avoid a "+ 1" that can't overflow,
10372         but is a bit tricky.
10374         Assume freestanding C89 headers, string.h, stdlib.h.
10375         * data.c, doprnt.c, floatfns.c, print.c:
10376         Include float.h unconditionally.
10377         * gmalloc.c: Assume C89-at-least behavior for preprocessor,
10378         limits.h, stddef.h, string.h.  Use memset instead of 'flood'.
10379         * regex.c: Likewise for stddef.h, string.h.
10380         (ISASCII): Remove; can assume it returns 1 now.  All uses removed.
10381         * s/aix4-2.h (HAVE_STRING_H): Remove obsolete undef.
10382         * s/ms-w32.h (HAVE_LIMITS_H, HAVE_STRING_H, HAVE_STDLIB_H)
10383         (STDC_HEADERS): Remove obsolete defines.
10384         * sysdep.c: Include limits.h unconditionally.
10386         Assume support for memcmp, memcpy, memmove, memset.
10387         * lisp.h, sysdep.c (memcmp, memcpy, memmove, memset):
10388         * regex.c (memcmp, memcpy):
10389         Remove; we assume C89 now.
10391         * gmalloc.c (memcpy, memset, memmove): Remove; we assume C89 now.
10392         (__malloc_safe_bcopy): Remove; no longer needed.
10394         * lisp.h (struct vectorlike_header, struct Lisp_Subr): Signed sizes.
10395         Use EMACS_INT, not EMACS_UINT, for sizes.  The code works equally
10396         well either way, and we prefer signed to unsigned.
10398 2011-07-27  Lars Magne Ingebrigtsen  <larsi@gnus.org>
10400         * gnutls.c (emacs_gnutls_read): Don't message anything if the peer
10401         closes the connection while we're reading (bug#9182).
10403 2011-07-25  Jan Djärv  <jan.h.d@swipnet.se>
10405         * nsmenu.m (ns_popup_dialog): Add an "ok" button if no buttons
10406         are specified (Bug#9168).
10408 2011-07-25  Paul Eggert  <eggert@cs.ucla.edu>
10410         * bidi.c (bidi_dump_cached_states): Fix printf format mismatch.
10411         Found by GCC static checking and --with-wide-int on a 32-bit host.
10413 2011-07-25  Eli Zaretskii  <eliz@gnu.org>
10415         * xdisp.c (compute_display_string_pos): Fix logic of caching
10416         previous display string position.  Initialize cached_prev_pos to
10417         -1.  Fixes slow-down at the beginning of a buffer.
10419 2011-07-24  Eli Zaretskii  <eliz@gnu.org>
10421         * xfaces.c (check_lface_attrs) [HAVE_WINDOW_SYSTEM]: Allow `nil'
10422         for attrs[LFACE_FONTSET_INDEX].
10424 2011-07-23  Paul Eggert  <eggert@cs.ucla.edu>
10426         * xml.c (parse_region): Remove unused local
10427         that was recently introduced.
10429 2011-07-23  Eli Zaretskii  <eliz@gnu.org>
10431         * xfns.c (unwind_create_frame) [GLYPH_DEBUG]: Adapt to changes in
10432         revision 84777 on 2008-02-22.
10434         * xdisp.c (move_it_in_display_line_to): Record the best matching
10435         position for TO_CHARPOS while scanning the line, and restore it on
10436         exit if none of the characters scanned was an exact match.
10437         Fixes vertical-motion and pos-visible-in-window-p under bidi redisplay
10438         when exact match is impossible due to invisible text, and the
10439         lines are truncated.
10441 2011-07-23  Jan Djärv  <jan.h.d@swipnet.se>
10443         * nsterm.m (initFrameFromEmacs): Set NSTitledWindowMask in styleMask
10444         for OSX >= 10.7.
10446 2011-07-22  Eli Zaretskii  <eliz@gnu.org>
10448         Fix a significant slow-down of cursor motion with C-n, C-p,
10449         C-f/C-b, and C-v/M-v that couldn't keep up with keyboard
10450         auto-repeat under bidi redisplay in fontified buffers.
10451         * xdisp.c (compute_stop_pos_backwards): New function.
10452         (next_element_from_buffer): Call compute_stop_pos_backwards to
10453         find a suitable prev_stop when we find ourselves before
10454         base_level_stop.
10455         (reseat): Don't look for prev_stop, as that could mean a very long
10456         run.
10457         <cached_disp_pos, cached_disp_buffer, cached_disp_modiff>
10458         <cached_disp_overlay_modiff>: Cache for last found display string
10459         position.
10460         (compute_display_string_pos): Return the cached position if asked
10461         about the same buffer in the same area of character positions, and
10462         the buffer wasn't changed since the time the display string
10463         position was cached.
10465 2011-07-22  Eli Zaretskii  <eliz@gnu.org>
10467         * xdisp.c (rows_from_pos_range): Don't ignore glyphs whose object
10468         is an integer, which is important for empty lines.  (Bug#9149)
10470 2011-07-22  Chong Yidong  <cyd@stupidchicken.com>
10472         * frame.c (Fmodify_frame_parameters): In tty case, update the
10473         default face if necessary (Bug#4238).
10475 2011-07-21  Chong Yidong  <cyd@stupidchicken.com>
10477         * editfns.c (Fstring_to_char): No need to explain what a character
10478         is in the docstring (Bug#6576).
10480 2011-07-20  Lars Magne Ingebrigtsen  <larsi@gnus.org>
10482         * xml.c (parse_region): Make sure we always return a tree.
10484 2011-07-20  HAMANO Kiyoto  <khiker.mail@gmail.com>
10486         * xml.c (parse_region): If a document contains only comments,
10487         return that, too.
10489 2011-07-20  Lars Magne Ingebrigtsen  <larsi@gnus.org>
10491         * xml.c (make_dom): Return comments, too.
10493 2011-07-19  Paul Eggert  <eggert@cs.ucla.edu>
10495         Port to OpenBSD.
10496         See http://lists.gnu.org/archive/html/emacs-devel/2011-07/msg00688.html
10497         and the surrounding thread.
10498         * minibuf.c (read_minibuf_noninteractive): Rewrite to use getchar
10499         rather than fgets, and retry after EINTR.  Otherwise, 'emacs
10500         --batch -f byte-compile-file' fails on OpenBSD if an inactivity
10501         timer goes off.
10502         * s/openbsd.h (BROKEN_SIGIO): Define.
10503         * unexelf.c (unexec) [__OpenBSD__]:
10504         Don't update the .mdebug section of the Alpha COFF symbol table.
10506 2011-07-19  Lars Magne Ingebrigtsen  <larsi@gnus.org>
10508         * lread.c (syms_of_lread): Clarify when `lexical-binding' is used
10509         (bug#8460).
10511 2011-07-18  Paul Eggert  <eggert@cs.ucla.edu>
10513         * fileio.c (Fcopy_file) [!MSDOS]: Tighten created file's mask.
10514         This fixes some race conditions on the permissions of any newly
10515         created file.
10517         * alloc.c (valid_pointer_p): Use pipe, not open.
10518         This fixes some permissions issues when debugging.
10520         * fileio.c (Fcopy_file): Adjust mode if fchown fails.  (Bug#9002)
10521         If fchown fails to set both uid and gid, try to set just gid,
10522         as that is sometimes allowed.  Adjust the file's mode to eliminate
10523         setuid or setgid bits that are inappropriate if fchown fails.
10525 2011-07-18  Stefan Monnier  <monnier@iro.umontreal.ca>
10527         * xdisp.c (next_element_from_string, next_element_from_buffer): Use EQ
10528         to compare Lisp_Objects.
10529         * gnutls.c (syms_of_gnutls): Rename Vgnutls_log_level to
10530         global_gnutls_log_level, don't mistake it for a Lisp_Object.
10531         (init_gnutls_functions, emacs_gnutls_handle_error): Fix up uses.
10533 2011-07-17  Andreas Schwab  <schwab@linux-m68k.org>
10535         * lread.c (read_integer): Unread even EOF character.
10536         (read1): Likewise.  Properly record start position of symbol.
10538         * lread.c (read1): Read `#:' as empty uninterned symbol if no
10539         symbol character follows.
10541 2011-07-17  Paul Eggert  <eggert@cs.ucla.edu>
10543         * fileio.c (Fcopy_file): Pacify gcc re fchown.  (Bug#9002)
10544         This works around a problem with the previous change to Fcopy_file.
10545         Recent glibc declares fchown with __attribute__((warn_unused_result)),
10546         and without this change, GCC might complain about discarding
10547         fchown's return value.
10549 2011-07-16  Juanma Barranquero  <lekktu@gmail.com>
10551         * makefile.w32-in (GLOBAL_SOURCES): Add gnutls.c (followup to bug#9059).
10553 2011-07-16  Paul Eggert  <eggert@cs.ucla.edu>
10555         * fileio.c (Fcopy_file): Don't diagnose fchown failures.  (Bug#9002)
10557 2011-07-16  Lars Magne Ingebrigtsen  <larsi@gnus.org>
10559         * gnutls.c (syms_of_gnutls): Define `gnutls-log-level' here, since
10560         it's used from the C level.
10562         * process.c: Use the same condition for POLL_FOR_INPUT in both
10563         keyboard.c and process.c (bug#1858).
10565 2011-07-09  Lawrence Mitchell  <wence@gmx.li>
10567         * gnutls.c (Qgnutls_bootprop_min_prime_bits): New variable.
10568         (Fgnutls_boot): Use it.
10570 2011-07-15  Andreas Schwab  <schwab@linux-m68k.org>
10572         * doc.c (Fsubstitute_command_keys): Revert last change.
10574 2011-07-15  Lars Magne Ingebrigtsen  <larsi@gnus.org>
10576         * doc.c (Fsubstitute_command_keys): Clarify that \= really only
10577         quotes the next character, and doesn't affect other longer
10578         sequences (bug#8935).
10580         * lread.c (syms_of_lread): Clarify that is isn't only
10581         `eval-buffer' and `eval-defun' that's affected by
10582         `lexical-binding' (bug#8460).
10584 2011-07-15  Eli Zaretskii  <eliz@gnu.org>
10586         * xdisp.c (move_it_in_display_line_to): Fix vertical motion with
10587         bidi redisplay when a line includes both an image and is truncated.
10589 2011-07-14  Paul Eggert  <eggert@cs.ucla.edu>
10591         Fix minor problems found by static checking.
10592         * bidi.c (bidi_cache_size): Now EMACS_INT, not size_t.
10593         (elsz): Now a signed constant, not a size_t var.  We prefer signed
10594         types to unsigned, to avoid integer comparison confusion.  Without
10595         this change, GCC 4.6.1 with -Wunsafe-loop-optimizations complains
10596         "cannot optimize loop, the loop counter may overflow", a symptom
10597         of the confusion.
10598         * indent.c (Fvertical_motion): Mark locals as initialized.
10599         * xdisp.c (reseat_to_string): Fix pointer signedness issue.
10601 2011-07-14  Lars Magne Ingebrigtsen  <larsi@gnus.org>
10603         * search.c (Fre_search_backward): Mention `case-fold-search' in
10604         all the re_search_* functions (bug#8138).
10606         * keyboard.c (Fopen_dribble_file): Document when the file is
10607         closed (bug#8056).
10609 2011-07-14  Eli Zaretskii  <eliz@gnu.org>
10611         * bidi.c (bidi_dump_cached_states): Fix format of displaying
10612         bidi_cache_idx.
10614         Support bidi reordering of display and overlay strings.
10615         * xdisp.c (compute_display_string_pos)
10616         (compute_display_string_end): Accept additional argument STRING.
10617         (init_iterator, reseat_1): Initialize bidi_it->string.s to NULL.
10618         (reseat_to_string): Initialize bidi_it->string.s and
10619         bidi_it->string.schars.
10620         (Fcurrent_bidi_paragraph_direction): Initialize itb.string.s to
10621         NULL (avoids a crash in bidi_paragraph_init).
10622         Initialize itb.string.lstring.
10623         (init_iterator): Call bidi_init_it only of a valid
10624         buffer position was specified.  Initialize paragraph_embedding to
10625         L2R.
10626         (reseat_to_string): Initialize the bidi iterator.
10627         (display_string): If we need to ignore text properties of
10628         LISP_STRING, set IT->stop_charpos to IT->end_charpos.  (The
10629         original value of -1 will not work with bidi.)
10630         (compute_display_string_pos): First arg is now struct
10631         `text_pos *'; all callers changed.  Support display properties on
10632         Lisp strings.
10633         (compute_display_string_end): Support display properties on Lisp
10634         strings.
10635         (init_iterator, reseat_1, reseat_to_string): Initialize the
10636         string.bufpos member to 0 (zero, for compatibility with IT_CHARPOS
10637         when iterating on a string not from display properties).
10638         (compute_display_string_pos, compute_display_string_end):
10639         Fix calculation of the object to scan.  Fixes an error when using
10640         arrow keys.
10641         (next_element_from_buffer): Don't abort when IT_CHARPOS is before
10642         base_level_stop; instead, set base_level_stop to BEGV.
10643         Fixes crashes in vertical-motion.
10644         (next_element_from_buffer): Improve commentary for when
10645         the iterator is before prev_stop.
10646         (init_iterator): Initialize bidi_p from the default value of
10647         bidi-display-reordering, not from buffer-local value.  Use the
10648         buffer-local value only if initializing for buffer iteration.
10649         (handle_invisible_prop): Support invisible properties on strings
10650         that are being bidi-reordered.
10651         (set_iterator_to_next): Support bidi reordering of C strings and
10652         Lisp strings.
10653         (next_element_from_string): Support bidi reordering of Lisp
10654         strings.
10655         (handle_stop_backwards): Support Lisp strings as well.
10656         (display_string): Support display of R2L glyph rows.
10657         Use IT_STRING_CHARPOS when displaying from a Lisp string.
10658         (init_iterator): Don't initialize it->bidi_p for strings
10659         here.
10660         (reseat_to_string): Initialize it->bidi_p for strings here.
10661         (next_element_from_string, next_element_from_c_string)
10662         (next_element_from_buffer): Add xassert's for correspondence
10663         between IT's object being iterated and it->bidi_it.string
10664         structure.
10665         (face_before_or_after_it_pos): Support bidi iteration.
10666         (next_element_from_c_string): Handle the case of the first string
10667         character that is not the first one in the visual order.
10668         (get_visually_first_element): New function, refactored from common
10669         parts of next_element_from_buffer, next_element_from_string, and
10670         next_element_from_c_string.
10671         (tool_bar_lines_needed, redisplay_tool_bar)
10672         (display_menu_bar): Force left-to-right direction.  Add a FIXME
10673         comment for making that be controlled by a user option.
10674         (push_it, pop_it): Save and restore the state of the
10675         bidi iterator.  Save and restore the bidi_p flag.
10676         (pop_it): Iterate out of display property for string iteration as
10677         well.
10678         (iterate_out_of_display_property): Support iteration over strings.
10679         (handle_single_display_spec): Set up it->bidi_it for iteration
10680         over a display string, and call bidi_init_it.
10681         (handle_single_display_spec, next_overlay_string)
10682         (get_overlay_strings_1, push_display_prop): Set up the bidi
10683         iterator for displaying display or overlay strings.
10684         (forward_to_next_line_start): Don't use the shortcut if
10685         bidi-iterating.
10686         (back_to_previous_visible_line_start): If handle_display_prop
10687         pushed the iterator stack, restore the internal state of the bidi
10688         iterator by calling bidi_pop_it same number of times.
10689         (reseat_at_next_visible_line_start): If ON_NEWLINE_P is non-zero,
10690         and we are bidi-iterating, don't decrement the iterator position;
10691         instead, set the first_elt flag in the bidi iterator, to produce
10692         the same effect.
10693         (reseat_1): Remove redundant setting of string_from_display_prop_p.
10694         (push_display_prop): xassert that we are iterating a buffer.
10695         (push_it, pop_it): Save and restore paragraph_embedding member.
10696         (handle_single_display_spec, next_overlay_string)
10697         (get_overlay_strings_1, reseat_1, reseat_to_string)
10698         (push_display_prop): Set up the `unibyte' member of bidi_it.string
10699         correctly.  Don't assume unibyte strings are not bidi-reordered.
10700         (compute_display_string_pos)
10701         (compute_display_string_end): Fix handling the case of C string.
10702         (push_it, pop_it): Save and restore from_disp_prop_p.
10703         (handle_single_display_spec, push_display_prop): Set the
10704         from_disp_prop_p flag.
10705         (get_overlay_strings_1): Reset the from_disp_prop_p flag.
10706         (pop_it): Call iterate_out_of_display_property only if we are
10707         popping after iteration over a string that came from a display
10708         property.  Fix a typo in popping stretch info.  Add an assertion
10709         for verifying that the iterator position is in sync with the bidi
10710         iterator.
10711         (handle_single_display_spec, get_overlay_strings_1)
10712         (push_display_prop): Fix initialization of paragraph direction for
10713         string when that of the parent object is not yet determined.
10714         (reseat_1): Call bidi_init_it to resync the bidi
10715         iterator with IT's position.  (Bug#7616)
10716         (find_row_edges): If ROW->start.pos gives position
10717         smaller than min_pos, use it as ROW->minpos.  (Bug#7616)
10718         (handle_stop, back_to_previous_visible_line_start, reseat_1):
10719         Reset the from_disp_prop_p flag.
10720         (SAVE_IT, RESTORE_IT): New macros.
10721         (pos_visible_p, face_before_or_after_it_pos)
10722         (back_to_previous_visible_line_start)
10723         (move_it_in_display_line_to, move_it_in_display_line)
10724         (move_it_to, move_it_vertically_backward, move_it_by_lines)
10725         (try_scrolling, redisplay_window, display_line): Use them when
10726         saving a temporary copy of the iterator and restoring it back.
10727         (back_to_previous_visible_line_start, reseat_1)
10728         (init_iterator): Empty the bidi cache "stack".
10729         (move_it_in_display_line_to): If iterator ended up at
10730         EOL, but we never saw any buffer positions smaller than
10731         to_charpos, return MOVE_POS_MATCH_OR_ZV.  Fixes vertical cursor
10732         motion in bidi-reordered lines.
10733         (move_it_in_display_line_to): Record prev_method and prev_pos
10734         immediately before the call to set_iterator_to_next.  Fixes cursor
10735         motion in bidi-reordered lines with stretch glyphs and strings
10736         displayed in margins.  (Bug#8133) (Bug#8867)
10737         Return MOVE_POS_MATCH_OR_ZV only if iterator position is past
10738         TO_CHARPOS.
10739         (pos_visible_p): Support positions in bidi-reordered lines.
10740         Save and restore bidi cache.
10742         * bidi.c (bidi_level_of_next_char): clen should be EMACS_NT, not int.
10743         (bidi_paragraph_info): Delete unused struct.
10744         (bidi_cache_idx, bidi_cache_last_idx): Declare EMACS_INT.
10745         (bidi_cache_start): New variable.
10746         (bidi_cache_reset): Reset bidi_cache_idx to bidi_cache_start, not
10747         to zero.
10748         (bidi_cache_fetch_state, bidi_cache_search)
10749         (bidi_cache_find_level_change, bidi_cache_iterator_state)
10750         (bidi_cache_find, bidi_peek_at_next_level)
10751         (bidi_level_of_next_char, bidi_find_other_level_edge)
10752         (bidi_move_to_visually_next): Compare cache index with
10753         bidi_cache_start rather than with zero.
10754         (bidi_fetch_char): Accept new argument STRING; all callers
10755         changed.  Support iteration over a string.  Support strings with
10756         display properties.  Support unibyte strings.  Fix the type of
10757         `len' according to what STRING_CHAR_AND_LENGTH expects.
10758         (bidi_paragraph_init, bidi_resolve_explicit_1)
10759         (bidi_resolve_explicit, bidi_resolve_weak)
10760         (bidi_level_of_next_char, bidi_move_to_visually_next):
10761         Support iteration over a string.
10762         (bidi_set_sor_type, bidi_resolve_explicit_1)
10763         (bidi_resolve_explicit, bidi_type_of_next_char): ignore_bn_limit
10764         can now be zero (for strings); special values 0 and -1 were
10765         changed to -1 and -2, respectively.
10766         (bidi_char_at_pos): New function.
10767         (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak):
10768         Call it instead of FETCH_MULTIBYTE_CHAR.
10769         (bidi_move_to_visually_next): Abort if charpos or bytepos were not
10770         initialized to valid values.
10771         (bidi_init_it): Don't initialize charpos and bytepos with invalid
10772         values.
10773         (bidi_level_of_next_char): Allow the sentinel "position" to pass
10774         the test for valid cached positions.  Fix the logic for looking up
10775         the sentinel state in the cache.  GCPRO the Lisp string we are
10776         iterating.
10777         (bidi_push_it, bidi_pop_it): New functions.
10778         (bidi_initialize): Initialize the bidi cache start stack pointer.
10779         (bidi_cache_ensure_space): New function, refactored from part of
10780         bidi_cache_iterator_state.  Don't assume the required size is just
10781         one BIDI_CACHE_CHUNK away.
10782         (bidi_cache_start_stack, bidi_push_it): Use IT_STACK_SIZE.
10783         (bidi_count_bytes, bidi_char_at_pos): New functions.
10784         (bidi_cache_search): Don't assume bidi_cache_last_idx is
10785         always valid if bidi_cache_idx is valid.
10786         (bidi_cache_find_level_change): xassert that bidi_cache_last_idx
10787         is valid if it's going to be used.
10788         (bidi_shelve_cache, bidi_unshelve_cache): New functions.
10789         (bidi_cache_fetch_state, bidi_cache_search)
10790         (bidi_cache_find_level_change, bidi_cache_ensure_space)
10791         (bidi_cache_iterator_state, bidi_cache_find)
10792         (bidi_find_other_level_edge, bidi_cache_start_stack):
10793         All variables related to cache indices are now EMACS_INT.
10795         * dispextern.h (struct bidi_string_data): New structure.
10796         (struct bidi_it): New member `string'.  Make flag members be 1-bit
10797         fields, and put them last in the struct.
10798         (compute_display_string_pos, compute_display_string_end):
10799         Update prototypes.
10800         (bidi_push_it, bidi_pop_it): Add prototypes.
10801         (struct iterator_stack_entry): New members bidi_p,
10802         paragraph_embedding, and from_disp_prop_p.
10803         (struct it): Member bidi_p is now a bit field 1 bit wide.
10804         (bidi_shelve_cache, bidi_unshelve_cache):
10805         Declare prototypes.
10807         * .gdbinit (xvectype, xvector, xcompiled, xchartable, xboolvector)
10808         (xpr, xfont, xbacktrace): Use "header.size" when accessing vectors
10809         and vector-like objects.
10811         * dispnew.c (buffer_posn_from_coords): Save and restore the bidi
10812         cache around display iteration.
10814         * window.c (Fwindow_end, window_scroll_pixel_based)
10815         (displayed_window_lines, Frecenter): Save and restore the bidi
10816         cache around display iteration.
10818 2011-07-14  Lars Magne Ingebrigtsen  <larsi@gnus.org>
10820         * editfns.c (Fdelete_region): Clarify the use of the named
10821         parameters (bug#6788).
10823 2011-07-14  Martin Rudalics  <rudalics@gmx.at>
10825         * indent.c (Fvertical_motion): Set and restore w->pointm when
10826         saving and restoring the window's buffer (Bug#9006).
10828 2011-07-13  Lars Magne Ingebrigtsen  <larsi@gnus.org>
10830         * editfns.c (Fstring_to_char): Clarify just what is returned
10831         (bug#6576).  Text by Eli Zaretskii.
10833 2011-07-13  Juanma Barranquero  <lekktu@gmail.com>
10835         * gnutls.c (init_gnutls_functions): Honor gnutls_log_level (bug#9059).
10837 2011-07-13  Eli Zaretskii  <eliz@gnu.org>
10839         * buffer.c (mmap_find): Fix a typo.
10841 2011-07-13  Johan Bockgård  <bojohan@gnu.org>
10843         Fix execution of x selection hooks.
10844         * xselect.c (Qx_lost_selection_functions)
10845         (Qx_sent_selection_functions): New vars.
10846         (syms_of_xselect): DEFSYM them.
10847         (x_handle_selection_request): Pass Qx_sent_selection_functions
10848         rather than Vx_sent_selection_functions to Frun_hook_with_args.
10849         (x_handle_selection_clear,x_clear_frame_selections):
10850         Pass Qx_lost_selection_functions rather than
10851         Vx_lost_selection_functions to Frun_hook_with_args.
10853 2011-07-13  Paul Eggert  <eggert@cs.ucla.edu>
10855         * buffer.c (Fget_buffer_create): Initialize inhibit_shrinking.
10856         The old code sometimes used this field without initializing it.
10858         * alloc.c (gc_sweep): Don't read past end of array.
10859         In theory, the old code could also have corrupted Emacs internals,
10860         though it'd be very unlikely.
10862 2011-07-12  Andreas Schwab  <schwab@linux-m68k.org>
10864         * character.c (Fcharacterp): Don't advertise optional ignored
10865         argument.  (Bug#4026)
10867 2011-07-12  Lars Magne Ingebrigtsen  <larsi@gnus.org>
10869         * keymap.c (syms_of_keymap): Clarify that "modifier" is "modifier
10870         key" (bug#4257).
10872         * window.c (Fset_window_start): Doc fix (bug#4199).
10873         (Fset_window_hscroll): Ditto.
10875 2011-07-12  Paul Eggert  <eggert@cs.ucla.edu>
10877         Fix minor new problems caught by GCC 4.6.1.
10878         * term.c (init_tty): Remove unused local.
10879         * xsettings.c (store_monospaced_changed): Define this function only
10880         if (defined HAVE_GSETTINGS || defined HAVE_GCONF), as it's
10881         not used otherwise.
10883 2011-07-12  Chong Yidong  <cyd@stupidchicken.com>
10885         * xdisp.c (Vresize_mini_windows): Minor doc fix (Bug#3300).
10887 2011-07-11  Lars Magne Ingebrigtsen  <larsi@gnus.org>
10889         * xdisp.c (syms_of_xdisp): Make it explicit that the mini-windows
10890         are the mini-buffer and the echo area (bug#3320).
10892         * term.c (init_tty): Remove support for supdup, c10 and perq
10893         terminals, which are no longer supported (bug#1482).
10895 2011-07-10  Johan Bockgård  <bojohan@gnu.org>
10897         * xdisp.c (Ftool_bar_lines_needed): Fix WINDOWP check.
10899 2011-07-10  Jan Djärv  <jan.h.d@swipnet.se>
10901         * xmenu.c (menu_highlight_callback): Only pass frame to show_help_event
10902         for non-popups (Bug#3642).
10904 2011-07-10  Andreas Schwab  <schwab@linux-m68k.org>
10906         * alloc.c (reset_malloc_hooks): Protoize.
10907         * buffer.c (mmap_init, mmap_find, mmap_free_1, mmap_enlarge)
10908         (mmap_set_vars, mmap_alloc, mmap_free, mmap_realloc): Likewise.
10909         * cm.c (losecursor): Likewise.
10910         * data.c (fmod): Likewise.
10911         * dispnew.c (swap_glyphs_in_rows): Likewise.
10912         * emacs.c (memory_warning_signal): Likewise.
10913         * floatfns.c (float_error): Likewise.
10914         * font.c (check_gstring, check_otf_features, otf_tag_symbol)
10915         (otf_open, font_otf_capability, generate_otf_features)
10916         (font_otf_DeviceTable, font_otf_ValueRecord, font_otf_Anchor):
10917         Likewise.
10918         * image.c (pbm_read_file): Likewise.
10919         * indent.c (string_display_width): Likewise.
10920         * intervals.c (check_for_interval, search_for_interval)
10921         (inc_interval_count, count_intervals, root_interval)
10922         (adjust_intervals_for_insertion, make_new_interval): Likewise.
10923         * lread.c (defalias): Likewise.
10924         * ralloc.c (r_alloc_check): Likewise.
10925         * regex.c (set_image_of_range_1, set_image_of_range)
10926         (regex_grow_registers): Likewise.
10927         * sysdep.c (strerror): Likewise.
10928         * termcap.c (valid_filename_p, tprint, main): Likewise.
10929         * tparam.c (main): Likewise.
10930         * unexhp9k800.c (run_time_remap, save_data_space)
10931         (update_file_ptrs, read_header, write_header, calculate_checksum)
10932         (copy_file, copy_rest, display_header): Likewise.
10933         * widget.c (mark_shell_size_user_specified, create_frame_gcs):
10934         Likewise.
10935         * xdisp.c (check_it): Likewise.
10936         * xfaces.c (register_color, unregister_color, unregister_colors):
10937         Likewise.
10938         * xfns.c (print_fontset_result): Likewise.
10939         * xrdb.c (member, fatal, main): Likewise.
10941 2011-07-10  Paul Eggert  <eggert@cs.ucla.edu>
10943         Fix minor problems found by static checking (Bug#9031).
10944         * chartab.c (char_table_set_range, map_sub_char_table):
10945         Remove unused locals.
10946         (uniprop_table): Now static.
10947         * composite.c (_work_char): Remove unused static var.
10949 2011-07-09  Juanma Barranquero  <lekktu@gmail.com>
10951         * chartab.c (uniprop_table_uncompress): Remove unused local variable.
10953 2011-07-09  Jan Djärv  <jan.h.d@swipnet.se>
10955         * gtkutil.c (qttip_cb): Remove code without function.
10957 2011-07-09  Eli Zaretskii  <eliz@gnu.org>
10959         * w32.c (pthread_sigmask): New stub.
10961 2011-07-08  Paul Eggert  <eggert@cs.ucla.edu>
10963         Use pthread_sigmask, not sigprocmask (Bug#9010).
10964         sigprocmask is portable only for single-threaded applications, and
10965         Emacs can be multi-threaded when it uses GTK.
10966         * Makefile.in (LIB_PTHREAD_SIGMASK): New macro.
10967         (LIBES): Use it.
10968         * callproc.c (Fcall_process):
10969         * process.c (create_process):
10970         * sysdep.c (sys_sigblock, sys_sigunblock, sys_sigsetmask):
10971         Use pthread_sigmask, not sigprocmask.
10973 2011-07-08  Jan Djärv  <jan.h.d@swipnet.se>
10975         * gtkutil.c (qttip_cb): Set line wrap to FALSE for tooltip widget.
10976         (xg_prepare_tooltip): Revert text in x->ttip_lbl, margins was
10977         wrong (Bug#8591).
10979 2011-07-08  Jan Djärv  <jan.h.d@swipnet.se>
10981         * gtkutil.c (xg_prepare_tooltip): Fix indentation and comment.
10982         Put text in x->ttip_lbl instead of gtk_tooltip_set_text (Bug#8591).
10983         (xg_hide_tooltip): Fix comment.
10985         * nsterm.m (initFrameFromEmacs): Don't use ns_return_types
10986         in registerServicesMenuSendTypes.
10987         (validRequestorForSendType): Don't check ns_return_types.
10989         * nsfns.m (Fx_open_connection): Put NSStringPboardType into
10990         ns_return_type.
10992 2011-07-08  Jason Rumney  <jasonr@gnu.org>
10994         * w32term.c (x_make_frame_visible): Use SH_SHOWNORMAL rather than
10995         SH_SHOW for hidden windows (Bug#5482).
10997         * w32fns.c (w32_wnd_proc) [WM_TIMER, WM_SET_CURSOR]: Avoid using
10998         frame struct members of non-existent frames (Bug#6284).
11000 2011-07-08  Jan Djärv  <jan.h.d@swipnet.se>
11002         * nsterm.m (keyDown): Call to wantsToDelayTextChangeNotifications and
11003         variable firstTime not needed on OSX >= 10.6.
11004         (setPosition): setFloatValue:knobProportion: is deprecated on OSX
11005         >= 10.5.  Use setKnobProportion, setDoubleValue.
11007         * nsterm.h (MAC_OS_X_VERSION_10_3, MAC_OS_X_VERSION_10_4)
11008         (MAC_OS_X_VERSION_10_5): Define if not defined.
11009         (EmacsView, EmacsTooltip): Implements NSWindowDelegate on OSX >= 10.6.
11010         (EmacsMenu): Implements NSMenuDelegate on OSX >= 10.6.
11011         (EmacsToolbar): Implements NSToolbarDelegate on OSX >= 10.6.
11013         * nsselect.m (ns_string_from_pasteboard): Don't use deprecated methods
11014         cString and lossyCString on OSX >= 10.4.
11016         * nsmenu.m (fillWithWidgetValue): Don't use deprecated method
11017         sizeToFit on OSX >= 10.2.
11019         * nsimage.m (allocInitFromFile): Don't use deprecated method
11020         bestRepresentationForDevice on OSX >= 10.6.
11022         * nsfns.m (check_ns_display_info): Cast to long and use %ld in error
11023         to avoid warning.
11025         * emacs.c: Declare unexec_init_emacs_zone.
11027         * nsgui.h: Fix compiler warning about gnulib redefining verify.
11029         * nsselect.m (ns_get_local_selection): Change to extern (Bug#8842).
11031         * nsmenu.m (ns_update_menubar): Remove useless setDelegate call
11032         on svcsMenu (Bug#8842).
11034         * nsfns.m (Fx_open_connection): Remove NSStringPboardType from
11035         ns_return_types.
11036         (Fns_list_services): Just return Qnil on 10.6, code not working there.
11038         * nsterm.m (QUTF8_STRING): Declare.
11039         (initFrameFromEmacs): Call registerServicesMenuSendTypes.
11040         (validRequestorForSendType): Return type is (id).
11041         Change indexOfObjectIdenticalTo to indexOfObject.
11042         Check if we have local selection before returning self (Bug#8842).
11043         (writeSelectionToPasteboard): Put local selection into paste board
11044         if we have a local selection (Bug#8842).
11045         (syms_of_nsterm): DEFSYM QUTF8_STRING.
11047         * nsterm.h (MAC_OS_X_VERSION_10_6): Define here instead of nsterm.m.
11048         (ns_get_local_selection): Declare.
11050 2011-07-07  Lars Magne Ingebrigtsen  <larsi@gnus.org>
11052         * keymap.c (describe_map_tree): Don't insert a double newline at
11053         the end of the buffer (bug#1169) and return whether we inserted
11054         something.
11056         * callint.c (Fcall_interactively): Change "reading args" to
11057         "providing args" to try to clarify what it does (bug#1010).
11059 2011-07-07  Kenichi Handa  <handa@m17n.org>
11061         * composite.c (composition_compute_stop_pos): Ignore a static
11062         composition starting before CHARPOS (Bug#8915).
11064         * xdisp.c (handle_composition_prop): Likewise.
11066 2011-07-07  Eli Zaretskii  <eliz@gnu.org>
11068         * term.c (produce_glyphs) <xassert>: Allow IT_GLYPHLESS in it->what.
11069         (Bug#9015)
11071 2011-07-07  Kenichi Handa  <handa@m17n.org>
11073         * character.h (unicode_category_t): New enum type.
11075         * chartab.c (uniprop_decoder_t, uniprop_encoder_t): New types.
11076         (Qchar_code_property_table): New variable.
11077         (UNIPROP_TABLE_P, UNIPROP_GET_DECODER)
11078         (UNIPROP_COMPRESSED_FORM_P): New macros.
11079         (char_table_ascii): Uncompress the compressed values.
11080         (sub_char_table_ref): New arg is_uniprop.  Callers changed.
11081         Uncompress the compressed values.
11082         (sub_char_table_ref_and_range): Likewise.
11083         (char_table_ref_and_range): Uncompress the compressed values.
11084         (sub_char_table_set): New arg is_uniprop.  Callers changed.
11085         Uncompress the compressed values.
11086         (sub_char_table_set_range): Args changed.  Callers changed.
11087         (char_table_set_range): Adjuted for the above change.
11088         (map_sub_char_table): Delete args default_val and parent.  Add arg
11089         top.  Give decoded values to a Lisp function.
11090         (map_char_table): Adjust for the above change.  Give decoded
11091         values to a Lisp function.  Gcpro more variables.
11092         (uniprop_table_uncompress)
11093         (uniprop_decode_value_run_length): New functions.
11094         (uniprop_decoder, uniprop_decoder_count): New variables.
11095         (uniprop_get_decoder, uniprop_encode_value_character)
11096         (uniprop_encode_value_run_length, uniprop_encode_value_numeric):
11097         New functions.
11098         (uniprop_encoder, uniprop_encoder_count): New variables.
11099         (uniprop_get_encoder, uniprop_table)
11100         (Funicode_property_table_internal, Fget_unicode_property_internal)
11101         (Fput_unicode_property_internal): New functions.
11102         (syms_of_chartab): DEFSYM Qchar_code_property_table, defsubr
11103         Sunicode_property_table_internal, Sget_unicode_property_internal,
11104         and Sput_unicode_property_internal.  Defvar_lisp
11105         char-code-property-alist.
11107         * composite.c (CHAR_COMPOSABLE_P): Adjust for the change of
11108         Vunicode_category_table.
11110         * font.c (font_range): Adjust for the change of
11111         Vunicode_category_table.
11113 2011-07-07  Dan Nicolaescu  <dann@ics.uci.edu>
11115         * m/iris4d.h: Remove file, move contents ...
11116         * s/irix6-5.h: ... here.
11118 2011-07-06  Paul Eggert  <eggert@cs.ucla.edu>
11120         Remove unportable assumption about struct layout (Bug#8884).
11121         * alloc.c (mark_buffer):
11122         * buffer.c (reset_buffer_local_variables, Fbuffer_local_variables)
11123         (clone_per_buffer_values): Don't assume that
11124         sizeof (struct buffer) is a multiple of sizeof (Lisp_Object).
11125         This isn't true in general, and it's particularly not true
11126         if Emacs is configured with --with-wide-int.
11127         * buffer.h (FIRST_FIELD_PER_BUFFER, LAST_FIELD_PER_BUFFER):
11128         New macros, used in the buffer.c change.
11130 2011-07-05  Jan Djärv  <jan.h.d@swipnet.se>
11132         * xsettings.c: Use both GConf and GSettings if both are available.
11133         (store_config_changed_event): Add comment.
11134         (dpyinfo_valid, store_font_name_changed, map_tool_bar_style)
11135         (store_tool_bar_style_changed): New functions.
11136         (store_monospaced_changed): Add comment.  Call dpyinfo_valid.
11137         (struct xsettings): Move font inside HAVE_XFT.
11138         (GSETTINGS_TOOL_BAR_STYLE, GSETTINGS_FONT_NAME): New defines.
11139         (GSETTINGS_MONO_FONT): Rename from SYSTEM_MONO_FONT.
11140         Move inside HAVE_XFT.
11141         (something_changed_gsettingsCB): Rename from something_changedCB.
11142         Check for changes in GSETTINGS_TOOL_BAR_STYLE and GSETTINGS_FONT_NAME
11143         also.
11144         (GCONF_TOOL_BAR_STYLE, GCONF_FONT_NAME): New defines.
11145         (GCONF_MONO_FONT): Rename from SYSTEM_MONO_FONT.  Move inside HAVE_XFT.
11146         (something_changed_gconfCB): Rename from something_changedCB.
11147         Check for changes in GCONF_TOOL_BAR_STYLE and GCONF_FONT_NAME also.
11148         (parse_settings): Move check for font inside HAVE_XFT.
11149         (read_settings, apply_xft_settings): Add comment.
11150         (read_and_apply_settings): Add comment.  Call map_tool_bar_style and
11151         store_tool_bar_style_changed.  Move check for font inside HAVE_XFT and
11152         call store_font_name_changed.
11153         (xft_settings_event): Add comment.
11154         (init_gsettings): Add comment.  Get values for GSETTINGS_TOOL_BAR_STYLE
11155         and GSETTINGS_FONT_NAME.  Move check for fonts within HAVE_XFT.
11156         (init_gconf): Add comment.  Get values for GCONF_TOOL_BAR_STYLE
11157         and GCONF_FONT_NAME.  Move check for fonts within HAVE_XFT.
11158         (xsettings_initialize): Call init_gsettings last.
11159         (xsettings_get_system_font, xsettings_get_system_normal_font):
11160         Add comment.
11162 2011-07-05  Paul Eggert  <eggert@cs.ucla.edu>
11164         Random fixes.  E.g., (random) never returned negative values.
11165         * fns.c (Frandom): Use GET_EMACS_TIME for random seed, and add the
11166         subseconds part to the entropy, as that's a bit more random.
11167         Prefer signed to unsigned, since the signedness doesn't matter and
11168         in general we prefer signed.  When given a limit, use a
11169         denominator equal to INTMASK + 1, not to VALMASK + 1, because the
11170         latter isn't right if USE_2_TAGS_FOR_INTS.
11171         * sysdep.c (get_random): Return a value in the range 0..INTMASK,
11172         not 0..VALMASK.  Don't discard "excess" bits that random () returns.
11174 2011-07-04  Stefan Monnier  <monnier@iro.umontreal.ca>
11176         * textprop.c (text_property_stickiness):
11177         Obey Vtext_property_default_nonsticky.
11178         (syms_of_textprop): Add `display' to Vtext_property_default_nonsticky.
11179         * w32fns.c (syms_of_w32fns):
11180         * xfns.c (syms_of_xfns): Don't Add `display' since it's there by default.
11182 2011-07-04  Paul Eggert  <eggert@cs.ucla.edu>
11184         * fileio.c (barf_or_query_if_file_exists): Use S_ISDIR.
11185         This is more efficient than Ffile_directory_p and avoids a minor race.
11187 2011-07-04  Lars Magne Ingebrigtsen  <larsi@gnus.org>
11189         * buffer.c (Foverlay_put): Say what the return value is
11190         (bug#7835).
11192         * fileio.c (barf_or_query_if_file_exists): Check first if the file
11193         is a directory before asking whether to use the file name
11194         (bug#7564).
11195         (barf_or_query_if_file_exists): Make the "File is a directory"
11196         error be more correct.
11198         * fns.c (Frequire): Remove the mention of the .gz files, since
11199         that's installation-specific, but keep the mention of
11200         `get-load-suffixes'.
11202 2011-07-04  Paul Eggert  <eggert@cs.ucla.edu>
11204         * editfns.c (Fformat_time_string): Don't assume strlen fits in int.
11205         Report string overflow if the output is too long.
11207 2011-07-04  Juanma Barranquero  <lekktu@gmail.com>
11209         * gnutls.c (Fgnutls_boot): Don't mention :verify-error.
11210         (syms_of_gnutls): Remove duplicate DEFSYM for
11211         Qgnutls_bootprop_verify_hostname_error, an error for
11212         Qgnutls_bootprop_verify_error (which is no longer used).
11214         * eval.c (find_handler_clause): Remove parameters `sig' and `data',
11215         unused since revno:102982 (2011-01-26).  All callers changed.
11216         Also (re)move comments that are misplaced or no longer relevant.
11218 2011-07-03  Lars Magne Ingebrigtsen  <larsi@gnus.org>
11220         * callint.c (Finteractive): Clarify the meaning of "@" (bug#8813).
11222 2011-07-03  Chong Yidong  <cyd@stupidchicken.com>
11224         * xfaces.c (Finternal_merge_in_global_face): Modify the foreground
11225         and background color parameters if they have been changed.
11227 2011-07-03  Lars Magne Ingebrigtsen  <larsi@gnus.org>
11229         * editfns.c (Fformat): Clarify the - and 0 flags (bug#6659).
11231 2011-07-03  Paul Eggert  <eggert@cs.ucla.edu>
11233         * xsettings.c (SYSTEM_FONT): Define only when used.
11234         No need to define when HAVE_GSETTINGS || !HAVE_XFT.
11236         * keymap.c (access_keymap_1): Now static.
11238 2011-07-02  Chong Yidong  <cyd@stupidchicken.com>
11240         * keyboard.c (command_loop_1): If a down-mouse event is unbound,
11241         leave any prefix arg for the up event (Bug#1586).
11243 2011-07-02  Lars Magne Ingebrigtsen  <larsi@gnus.org>
11245         * lread.c (syms_of_lread): Mention single symbols defined by
11246         `defvar' or `defconst' (bug#7154).
11248         * fns.c (Frequire): Mention .el.gz files (bug#7314).
11249         (Frequire): Mention get-load-suffixes.
11251 2011-07-02  Martin Rudalics  <rudalics@gmx.at>
11253         * window.h (window): Remove clone_number slot.
11254         * window.c (Fwindow_clone_number, Fset_window_clone_number):
11255         Remove.
11256         (make_parent_window, make_window, saved_window)
11257         (Fset_window_configuration, save_window_save): Don't deal with
11258         clone numbers.
11259         * buffer.c (Qclone_number): Remove declaration.
11260         (sort_overlays, overlay_strings): Don't deal with clone numbers.
11262 2011-07-02  Stefan Monnier  <monnier@iro.umontreal.ca>
11264         Add multiple inheritance to keymaps.
11265         * keymap.c (Fmake_composed_keymap): New function.
11266         (Fset_keymap_parent): Simplify.
11267         (fix_submap_inheritance): Remove.
11268         (access_keymap_1): New function extracted from access_keymap to handle
11269         embedded parents and handle lists of maps.
11270         (access_keymap): Use it.
11271         (Fkeymap_prompt, map_keymap_internal, map_keymap, store_in_keymap)
11272         (Fcopy_keymap): Handle embedded parents.
11273         (Fcommand_remapping, define_as_prefix): Simplify.
11274         (Fkey_binding): Simplify.
11275         (syms_of_keymap): Move minibuffer-local-completion-map,
11276         minibuffer-local-filename-completion-map,
11277         minibuffer-local-must-match-map, and
11278         minibuffer-local-filename-must-match-map to Elisp.
11279         (syms_of_keymap): Defsubr make-composed-keymap.
11280         * keyboard.c (menu_bar_items): Use map_keymap_canonical.
11281         (parse_menu_item): Trivial simplification.
11283 2011-07-01  Glenn Morris  <rgm@gnu.org>
11285         * Makefile.in (SETTINGS_LIBS): Fix typo.
11287 2011-07-01  Kazuhiro Ito  <kzhr@d1.dion.ne.jp>  (tiny change)
11289         * coding.c (Fencode_coding_string): Record the last coding system
11290         used, as the function doc string says (bug#8738).
11292 2011-07-01  Jan Djärv  <jan.h.d@swipnet.se>
11294         * xsettings.c (store_monospaced_changed): Take new font as arg and
11295         check for change against current_mono_font.
11296         (EMACS_TYPE_SETTINGS): Remove this and related defines.
11297         (emacs_settings_constructor, emacs_settings_get_property)
11298         (emacs_settings_set_property, emacs_settings_class_init)
11299         (emacs_settings_init, gsettings_obj): Remove.
11300         (something_changedCB): New function for HAVE_GSETTINGS.
11301         (something_changedCB): HAVE_GCONF: Call store_monospaced_changed
11302         with value as argument.
11303         (init_gsettings): Check that GSETTINGS_SCHEMA exists before calling
11304         g_settings_new (Bug#8967).  Do not create gsettings_obj.
11305         Remove calls to g_settings_bind.  Connect something_changedCB to
11306         "changed".
11308         * xgselect.c: Add defined (HAVE_GSETTINGS).
11309         (xgselect_initialize): Ditto.
11311         * process.c: Add defined (HAVE_GSETTINGS) for xgselect.h
11312         (wait_reading_process_output): Add defined (HAVE_GSETTINGS) for
11313         xg_select.
11315 2011-07-01  Paul Eggert  <eggert@cs.ucla.edu>
11317         * eval.c (struct backtrace): Simplify and port the data structure.
11318         Do not assume that "int nargs : BITS_PER_INT - 2;" produces a
11319         signed bit field, as this assumption is not portable and it makes
11320         Emacs crash when compiled with Sun C 5.8 on sparc.  Do not use
11321         "char debug_on_exit : 1" as this is not portable either; instead,
11322         use the portable "unsigned int debug_on_exit : 1".  Remove unused
11323         member evalargs.  Remove obsolete comments about cc bombing out.
11325 2011-06-30  Jan Djärv  <jan.h.d@swipnet.se>
11327         * xsettings.c: Include glib-object.h, gio/gio.h if HAVE_GSETTINGS.
11328         Let HAVE_GSETTINGS override HAVE_GCONF.
11329         (store_monospaced_changed): New function.
11330         (EMACS_SETTINGS): A new type derived from GObject to handle
11331         GSettings notifications.
11332         (emacs_settings_constructor, emacs_settings_get_property)
11333         (emacs_settings_set_property, emacs_settings_class_init):
11334         New functions.
11335         (gsettings_client, gsettings_obj): New variables.
11336         (GSETTINGS_SCHEMA): New define.
11337         (something_changedCB): Call store_monospaced_changed.
11338         (init_gsettings): New function.
11339         (xsettings_initialize): Call init_gsettings.
11340         (syms_of_xsettings): Initialize gsettings_client, gsettings_obj
11341         to NULL.
11343         * Makefile.in (SETTINGS_CFLAGS, SETTINGS_LIBS): Rename from
11344         GCONF_CFLAGS/LIBS.
11346 2011-06-29  Martin Rudalics  <rudalics@gmx.at>
11348         * window.c (resize_root_window, grow_mini_window)
11349         (shrink_mini_window): Rename Qresize_root_window to
11350         Qwindow_resize_root_window and Qresize_root_window_vertically to
11351         Qwindow_resize_root_window_vertically.
11353 2011-06-28  Paul Eggert  <eggert@cs.ucla.edu>
11355         * gnutls.c (Qgnutls_bootprop_verify_error): Remove unused var.
11357 2011-06-27  Juanma Barranquero  <lekktu@gmail.com>
11359         * makefile.w32-in: Redesign dependencies so they reflect more
11360         clearly which files are directly included by each source file,
11361         and not through other includes.
11363 2011-06-27  Martin Rudalics  <rudalics@gmx.at>
11365         * buffer.c (Qclone_number): Declare static and DEFSYM it.
11366         (sort_overlays, overlay_strings): When an overlay's clone number
11367         matches the window's clone number process the overlay even if
11368         the overlay's window property doesn't match the current window.
11370         * window.c (Fwindow_vchild): Rename to Fwindow_top_child.
11371         (Fwindow_hchild): Rename to Fwindow_left_child.
11372         (Fwindow_next): Rename to Fwindow_next_sibling.
11373         (Fwindow_prev): Rename to Fwindow_prev_sibling.
11374         (resize_window_check): Rename to window_resize_check.
11375         (resize_window_apply): Rename to window_resize_apply.
11376         (Fresize_window_apply): Rename to Fwindow_resize_apply.
11377         (Fdelete_other_windows_internal, resize_frame_windows)
11378         (Fsplit_window_internal, Fdelete_window_internal)
11379         (grow_mini_window, shrink_mini_window)
11380         (Fresize_mini_window_internal): Fix callers accordingly.
11382 2011-06-26  Jan Djärv  <jan.h.d@swipnet.se>
11384         * emacsgtkfixed.h: State that this is only used with Gtk+3.
11385         (emacs_fixed_set_min_size): Remove.
11386         (emacs_fixed_new): Take frame as argument.
11388         * emacsgtkfixed.c: State that this is only used with Gtk+3.
11389         (_EmacsFixedPrivate): Remove minwidth/height.
11390         Add struct frame *f.
11391         (emacs_fixed_init): Initialize priv->f.
11392         (get_parent_class, emacs_fixed_set_min_size): Remove.
11393         (emacs_fixed_new): Set priv->f to argument.
11394         (emacs_fixed_get_preferred_width)
11395         (emacs_fixed_get_preferred_height): Use min_width/height from
11396         frames size_hint to set minimum and natural (Bug#8919).
11397         (XSetWMSizeHints, XSetWMNormalHints): Override these functions
11398         and use min_width/height from frames size_hint to set
11399         min_width/height (Bug#8919).
11401         * gtkutil.c (xg_create_frame_widgets): Pass f to emacs_fixed_new.
11402         (x_wm_set_size_hint): Remove call to emacs_fixed_set_min_size.
11403         Fix indentation.
11405 2011-06-26  Eli Zaretskii  <eliz@gnu.org>
11407         * bidi.c (bidi_paragraph_init): Test for ZV_BYTE before calling
11408         bidi_at_paragraph_end, since fast_looking_at doesn't like to be
11409         called at ZV.
11411 2011-06-26  Chong Yidong  <cyd@stupidchicken.com>
11413         * process.c (wait_reading_process_output): Bypass select if
11414         waiting for a cell while ignoring keyboard input, and input is
11415         pending.  Suggested by Jan Djärv (Bug#8869).
11417 2011-06-25  Paul Eggert  <eggert@cs.ucla.edu>
11419         Use gnulib's dup2 module instead of rolling our own.
11420         * sysdep.c (dup2) [!HAVE_DUP2]: Remove; gnulib now does this.
11422 2011-06-25  YAMAMOTO Mitsuharu  <mituharu@math.s.chiba-u.ac.jp>
11424         * dispnew.c (scrolling_window): Before scrolling, turn off a
11425         mouse-highlight in the window being scrolled.
11427 2011-06-24  Juanma Barranquero  <lekktu@gmail.com>
11429         Move DEFSYM to lisp.h and use everywhere.
11431         * character.h (DEFSYM): Move declaration...
11432         * lisp.h (DEFSYM): ...here.
11434         * gnutls.c:
11435         * minibuf.c:
11436         * w32menu.c:
11437         * w32proc.c:
11438         * w32select.c: Don't include character.h.
11440         * alloc.c (syms_of_alloc):
11441         * buffer.c (syms_of_buffer):
11442         * bytecode.c (syms_of_bytecode):
11443         * callint.c (syms_of_callint):
11444         * casefiddle.c (syms_of_casefiddle):
11445         * casetab.c (init_casetab_once):
11446         * category.c (init_category_once, syms_of_category):
11447         * ccl.c (syms_of_ccl):
11448         * cmds.c (syms_of_cmds):
11449         * composite.c (syms_of_composite):
11450         * dbusbind.c (syms_of_dbusbind):
11451         * dired.c (syms_of_dired):
11452         * dispnew.c (syms_of_display):
11453         * doc.c (syms_of_doc):
11454         * editfns.c (syms_of_editfns):
11455         * emacs.c (syms_of_emacs):
11456         * eval.c (syms_of_eval):
11457         * fileio.c (syms_of_fileio):
11458         * fns.c (syms_of_fns):
11459         * frame.c (syms_of_frame):
11460         * fringe.c (syms_of_fringe):
11461         * insdel.c (syms_of_insdel):
11462         * keymap.c (syms_of_keymap):
11463         * lread.c (init_obarray, syms_of_lread):
11464         * macros.c (syms_of_macros):
11465         * msdos.c (syms_of_msdos):
11466         * print.c (syms_of_print):
11467         * process.c (syms_of_process):
11468         * search.c (syms_of_search):
11469         * sound.c (syms_of_sound):
11470         * syntax.c (init_syntax_once, syms_of_syntax):
11471         * terminal.c (syms_of_terminal):
11472         * textprop.c (syms_of_textprop):
11473         * undo.c (syms_of_undo):
11474         * w32.c (globals_of_w32):
11475         * window.c (syms_of_window):
11476         * xdisp.c (syms_of_xdisp):
11477         * xfaces.c (syms_of_xfaces):
11478         * xfns.c (syms_of_xfns):
11479         * xmenu.c (syms_of_xmenu):
11480         * xsettings.c (syms_of_xsettings):
11481         * xterm.c (syms_of_xterm): Use DEFSYM.
11483 2011-06-24  Teodor Zlatanov  <tzz@lifelogs.com>
11485         * gnutls.c (syms_of_gnutls): Use the DEFSYM macro from character.h.
11487 2011-06-23  Paul Eggert  <eggert@cs.ucla.edu>
11489         Integer and buffer overflow fixes (Bug#8873).
11491         * print.c (printchar, strout): Check for string overflow.
11492         (PRINTPREPARE, printchar, strout):
11493         Don't set size unless allocation succeeds.
11495         * minibuf.c (read_minibuf_noninteractive): Use ptrdiff_t, not int,
11496         for sizes.  Check for string overflow more accurately.
11497         Simplify newline removal at end; this suppresses a GCC 4.6.0 warning.
11499         * macros.c: Integer and buffer overflow fixes.
11500         * keyboard.h (struct keyboard.kbd_macro_bufsize):
11501         * macros.c (Fstart_kbd_macro, store_kbd_macro_char):
11502         Use ptrdiff_t, not int, for sizes.
11503         Don't increment bufsize until after realloc succeeds.
11504         Check for size-calculation overflow.
11505         (Fstart_kbd_macro): Use EMACS_INT, not int, for XINT result.
11507         * lisp.h (DEFVAR_KBOARD): Use offsetof instead of char * finagling.
11509         * lread.c: Integer overflow fixes.
11510         (read_integer): Radix is now EMACS_INT, not int,
11511         to improve quality of diagnostics for out-of-range radices.
11512         Calculate buffer size correctly for out-of-range radices.
11513         (read1): Check for integer overflow in radices, and in
11514         read-circle numbers.
11515         (read_escape): Avoid int overflow.
11516         (Fload, openp, read_buffer_size, read1)
11517         (substitute_object_recurse, read_vector, read_list, map_obarray):
11518         Use ptrdiff_t, not int, for sizes.
11519         (read1): Use EMACS_INT, not int, for sizes.
11520         Check for size overflow.
11522         * image.c (cache_image): Check for size arithmetic overflow.
11524         * lread.c: Integer overflow issues.
11525         (saved_doc_string_size, saved_doc_string_length)
11526         (prev_saved_doc_string_size, prev_saved_doc_string_length):
11527         Now ptrdiff_t, not int.
11528         (read1): Don't assume doc string length fits in int.  Check for
11529         out-of-range doc string lengths.
11530         (read_list): Don't assume file position fits in int.
11531         (read_escape): Check for hex character overflow.
11533 2011-06-22  Leo Liu  <sdl.web@gmail.com>
11535         * minibuf.c (Fcompleting_read_default, Vcompleting_read_function):
11536         Move to minibuffer.el.
11538 2011-06-22  Paul Eggert  <eggert@cs.ucla.edu>
11540         Fixes for GLYPH_DEBUG found by GCC 4.6.0 static checking.
11541         The following patches are for when GLYPH_DEBUG && !XASSERT.
11542         * dispextern.h (trace_redisplay_p, dump_glyph_string):
11543         * dispnew.c (flush_stdout):
11544         * xdisp.c (dump_glyph_row, dump_glyph_matrix, dump_glyph):
11545         Mark as externally visible.
11546         * dispnew.c (check_window_matrix_pointers): Now static.
11547         * dispnew.c (window_to_frame_vpos):
11548         * xfns.c (unwind_create_frame):
11549         * xterm.c (x_check_font): Remove unused local.
11550         * scroll.c (CHECK_BOUNDS):
11551         * xfaces.c (cache_fache): Rename local to avoid shadowing.
11552         * xfns.c, w32fns.c (image_cache_refcount, dpyinfo_refcount): Now static.
11553         * xdisp.c (check_window_end): Now a no-op if !XASSERTS.
11554         (debug_first_unchanged_at_end_vpos, debug_last_unchanged_at_beg_vpos)
11555         (debug_dvpos, debug_dy, debug_delta, debug_delta_bytes, debug_end_vpos):
11556         Now static.
11557         (debug_method_add): Use va_list and vsprintf rather than relying
11558         on undefined behavior with wrong number of arguments.
11559         (dump_glyph, dump_glyph_row, Fdump_glyph_matrix):
11560         Don't assume ptrdiff_t and EMACS_INT are the same width as int.
11561         In this code, it's OK to assume C99 behavior for ptrdiff_t formats
11562         since we're not interested in debugging glyphs with old libraries.
11563         * xfaces.c (cache_face): Move debugging code earlier; this pacifies
11564         GCC 4.6.0's static checking.
11566 2011-06-22  Paul Eggert  <eggert@cs.ucla.edu>
11568         Integer overflow and signedness fixes (Bug#8873).
11569         A few related buffer overrun fixes, too.
11571         * font.c (font_score): Use EMACS_INT, not int, to store XINT value.
11573         * dispextern.h (struct face.stipple):
11574         * image.c (x_bitmap_height, x_bitmap_width, x_bitmap_pixmap)
11575         (x_bitmap_mask, x_allocate_bitmap_record)
11576         (x_create_bitmap_from_data, x_create_bitmap_from_file)
11577         (x_destroy_bitmap, x_destroy_all_bitmaps, x_create_bitmap_mask)
11578         (x_create_bitmap_from_xpm_data):
11579         * nsterm.h (struct ns_display_info.bitmaps_size, .bitmaps_last):
11580         * w32term.h (struct w32_display_info.icon_bitmap_id, .bitmaps_size)
11581         (.bitmaps_last):
11582         * xfaces.c (load_pixmap):
11583         * xterm.c (x_bitmap_icon, x_wm_set_icon_pixmap):
11584         * xterm.h (struct x_display_info.icon_bitmap_id, .bitmaps_size)
11585         (.bitmaps_last, struct x_output.icon_bitmap):
11586         Use ptrdiff_t, not int, for bitmap indexes.
11587         (x_allocate_bitmap_record): Check for size overflow.
11588         * dispextern.h, lisp.h: Adjust to API changes elsewhere.
11590         Use ptrdiff_t, not int, for overlay counts.
11591         * buffer.h (overlays_at, sort_overlays, GET_OVERLAYS_AT):
11592         * editfns.c (overlays_around, get_pos_property):
11593         * textprop.c (get_char_property_and_overlay):
11594         * xdisp.c (next_overlay_change, note_mouse_highlight):
11595         * xfaces.c (face_at_buffer_position):
11596         * buffer.c (OVERLAY_COUNT_MAX): New macro.
11597         (overlays_at, overlays_in, sort_overlays, Foverlays_at)
11598         (Fnext_overlay_change, Fprevious_overlay_change)
11599         (mouse_face_overlay_overlaps, Foverlays_in):
11600         Use ptrdiff_t, not int, for sizes.
11601         (overlays_at, overlays_in): Check for size-calculation overflow.
11603         * xterm.c (xim_initialize, same_x_server): Strlen may not fit in int.
11605         * xsmfns.c (smc_save_yourself_CB, x_session_initialize): Avoid strlen.
11606         (x_session_initialize): Do not assume string length fits in int.
11608         * xsettings.c (apply_xft_settings): Fix potential buffer overrun.
11609         This is unlikely, but can occur if DPI is outlandish.
11611         * xsettings.c (Ffont_get_system_normal_font, Ffont_get_system_font):
11612         * xselect.c (Fx_get_atom_name): Avoid need for strlen.
11614         * xrdb.c: Don't assume strlen fits in int; avoid some strlens.
11615         * xrdb.c (magic_file_p, search_magic_path):
11616         Omit last arg SUFFIX; it was always 0.  All callers changed.
11617         (magic_file_p): Use ptrdiff_t, not int.  Check for size overflow.
11619         * xfont.c (xfont_match): Avoid need for strlen.
11621         * xfns.c: Don't assume strlen fits in int.
11622         (xic_create_fontsetname, x_window): Use ptrdiff_t, not int.
11624         * xdisp.c (message_log_check_duplicate): Return intmax_t,
11625         not unsigned long, as we prefer signed integers.  All callers changed.
11626         Detect integer overflow in repeat count.
11627         (message_dolog): Don't assume print length fits in 39 bytes.
11628         (display_mode_element): Don't assume strlen fits in int.
11630         * termcap.c: Don't assume sizes fit in int and never overflow.
11631         (struct termcap_buffer, tgetent): Use ptrdiff_t, not int, for sizes.
11632         (gobble_line): Check for size-calculation overflow.
11634         * minibuf.c (Fread_buffer):
11635         * lread.c (intern, intern_c_string):
11636         * image.c (xpm_scan) [HAVE_NS && !HAVE_XPM]:
11637         Don't assume string length fits in int.
11639         * keyboard.c (parse_tool_bar_item):
11640         * gtkutil.c (style_changed_cb): Avoid need for strlen.
11642         * font.c: Don't assume string length fits in int.
11643         (font_parse_xlfd, font_parse_fcname, font_unparse_fcname):
11644         Use ptrdiff_t, not int.
11645         (font_intern_prop): Don't assume string length fits in int.
11646         Don't assume integer property fits in fixnum.
11647         * font.h (font_intern_prop): 2nd arg is now ptrdiff_t, not int.
11649         * filelock.c: Fix some buffer overrun and integer overflow issues.
11650         (get_boot_time): Don't assume gzip command string fits in 100 bytes.
11651         Reformulate so as not to need the command string.
11652         Invoke gzip -cd rather than gunzip, as it's more portable.
11653         (lock_info_type, lock_file_1, lock_file):
11654         Don't assume pid_t and time_t fit in unsigned long.
11655         (LOCK_PID_MAX): Remove; we now use more-reliable bounds.
11656         (current_lock_owner): Prefer signed type for sizes.
11657         Use memcpy, not strncpy, where memcpy is what is really wanted.
11658         Don't assume (via atoi) that time_t and pid_t fit in int.
11659         Check for time_t and/or pid_t out of range, e.g., via a network share.
11660         Don't alloca where an auto var works fine.
11662         * fileio.c: Fix some integer overflow issues.
11663         (file_name_as_directory, Fexpand_file_name, Fsubstitute_in_file_name):
11664         Don't assume string length fits in int.
11665         (directory_file_name): Don't assume string length fits in long.
11666         (make_temp_name): Don't assume pid fits in int, or that its print
11667         length is less than 20.
11669         * data.c (Fsubr_name): Rewrite to avoid a strlen call.
11671         * coding.c (make_subsidiaries): Don't assume string length fits in int.
11673         * callproc.c (child_setup): Rewrite to avoid two strlen calls.
11675         * process.c (Fformat_network_address): Use EMACS_INT, not EMACS_UINT.
11676         We prefer signed integers, even for size calculations.
11678         * emacs.c: Don't assume string length fits in 'int'.
11679         (DEFINE_DUMMY_FUNCTION, sort_args): Use ptrdiff_t, not int.
11680         (main): Don't invoke strlen when not needed.
11682         * dbusbind.c (XD_ERROR): Don't arbitrarily truncate string.
11683         (XD_DEBUG_MESSAGE): Don't waste a byte.
11685         * callproc.c (getenv_internal_1, getenv_internal)
11686         (Fgetenv_internal):
11687         * buffer.c (init_buffer): Don't assume string length fits in 'int'.
11689         * lread.c (invalid_syntax): Omit length argument.
11690         All uses changed.  This doesn't fix a bug, but it simplifies the
11691         code away from its former Hollerith-constant appearance, and it's
11692         one less 'int' to worry about when looking at integer-overflow issues.
11693         (string_to_number): Simplify 2011-04-26 change by invoking xsignal1.
11695         * lisp.h (DEFUN): Remove bogus use of sizeof (struct Lisp_Subr).
11696         This didn't break anything, but it didn't help either.
11697         It's confusing to put a bogus integer in a place where the actual
11698         value does not matter.
11699         (LIST_END_P): Remove unused macro and its bogus comment.
11700         (make_fixnum_or_float): Remove unnecessary cast to EMACS_INT.
11702         * lisp.h (union Lisp_Object.i): EMACS_INT, not EMACS_UINT.
11703         This is for consistency with the ordinary, non-USE_LISP_UNION_TYPE,
11704         implementation.
11705         (struct Lisp_Bool_Vector.size): EMACS_INT, not EMACS_UINT.
11706         We prefer signed types, and the value cannot exceed the EMACS_INT
11707         range anyway (because otherwise the length would not be representable).
11708         (XSET) [USE_LISP_UNION_TYPE]: Use uintptr_t and intptr_t,
11709         not EMACS_UINT and EMACS_INT, when converting pointer to integer.
11710         This avoids a GCC warning when WIDE_EMACS_INT.
11712         * indent.c (sane_tab_width): New function.
11713         (current_column, scan_for_column, Findent_to, position_indentation)
11714         (compute_motion): Use it.  This is just for clarity.
11715         (Fcompute_motion): Don't assume hscroll and tab offset fit in int.
11717         * image.c (xbm_image_p): Don't assume stated width, height fit in int.
11719         * lisp.h (lint_assume): New macro.
11720         * composite.c (composition_gstring_put_cache):
11721         * ftfont.c (ftfont_shape_by_flt): Use it to pacify GCC 4.6.0.
11723         * editfns.c, insdel.c:
11724         Omit unnecessary forward decls, to simplify future changes.
11726         * ftfont.c (ftfont_shape_by_flt): Use signed integers for lengths.
11728         * font.c (Ffont_shape_gstring): Don't assume glyph len fits in 'int'.
11730         * fns.c (Ffillarray): Don't assume bool vector size fits in 'int'.
11731         Use much-faster test for byte-length change.
11732         Don't assume string byte-length fits in 'int'.
11733         Check that character arg fits in 'int'.
11734         (mapcar1): Declare byte as byte, for clarity.
11736         * alloc.c (Fmake_bool_vector): Avoid unnecessary multiplication.
11738         * fns.c (concat): Catch string overflow earlier.
11739         Do not rely on integer wraparound.
11741         * dispextern.h (struct it.overlay_strings_charpos)
11742         (struct it.selective): Now EMACS_INT, not int.
11743         * xdisp.c (forward_to_next_line_start)
11744         (back_to_previous_visible_line_start)
11745         (reseat_at_next_visible_line_start, next_element_from_buffer):
11746         Don't arbitrarily truncate the value of 'selective' to int.
11748         * xdisp.c (init_iterator): Use XINT, not XFASTINT; it might be < 0.
11750         * composite.c: Don't truncate sizes to 'int'.
11751         (composition_gstring_p, composition_reseat_it)
11752         (composition_adjust_point): Use EMACS_INT, not int.
11753         (get_composition_id, composition_gstring_put_cache): Use EMACS_INT,
11754         not EMACS_UINT, for indexes.
11756         * category.h (CATEGORY_SET_P): Remove unnecessary cast to EMACS_INT.
11758         * buffer.c: Include <verify.h>.
11759         (struct sortvec.priority, struct sortstr.priority):
11760         Now EMACS_INT, not int.
11761         (compare_overlays, cmp_for_strings): Avoid subtraction overflow.
11762         (struct sortstr.size, record_overlay_string)
11763         (struct sortstrlist.size, struct sortlist.used):
11764         Don't truncate size to int.
11765         (record_overlay_string): Check for size-calculation overflow.
11766         (init_buffer_once): Check at compile-time, not run-time.
11768 2011-06-22  Jim Meyering  <meyering@redhat.com>
11770         Don't leak an XBM-image-sized buffer
11771         * image.c (xbm_load): Free the image buffer after using it.
11773 2011-06-21  Paul Eggert  <eggert@cs.ucla.edu>
11775         Port to Sun C.
11776         * composite.c (find_automatic_composition): Omit needless 'return 0;'
11777         that Sun C diagnosed.
11778         * fns.c (secure_hash): Fix pointer signedness issue.
11779         * intervals.c (static_offset_intervals): New function.
11780         (offset_intervals): Use it.
11782 2011-06-21  Leo Liu  <sdl.web@gmail.com>
11784         * deps.mk (fns.o):
11785         * makefile.w32-in ($(BLD)/fns.$(O)): Include sha256.h and
11786         sha512.h.
11788         * fns.c (secure_hash): Rename from crypto_hash_function and change
11789         the first arg to accept symbols.
11790         (Fsecure_hash): New primitive.
11791         (syms_of_fns): New symbols.
11793 2011-06-20  Deniz Dogan  <deniz@dogan.se>
11795         * process.c (Fset_process_buffer): Clarify return value in
11796         docstring.
11798 2011-06-18  Chong Yidong  <cyd@stupidchicken.com>
11800         * dispnew.c (add_window_display_history): Use BVAR.
11802         * xdisp.c (debug_method_add): Use BVAR.
11803         (check_window_end, dump_glyph_matrix, dump_glyph)
11804         (dump_glyph_row, dump_glyph_string): Convert arglist to ANSI C.
11806         * xfaces.c (check_lface_attrs, check_lface, dump_realized_face):
11807         Likewise.
11809         * xfns.c (Fx_create_frame, x_create_tip_frame): Delay image cache
11810         check till after the cache is created in init_frame_faces.
11812 2011-06-17  Stefan Monnier  <monnier@iro.umontreal.ca>
11814         * fns.c (Fsafe_length): Yet another int/Lisp_Object mixup.
11816 2011-06-16  Paul Eggert  <eggert@cs.ucla.edu>
11818         * lisp.h: Include <limits.h>, for INT_MAX, LONG_MAX, LLONG_MAX.
11819         Without this, prin1 mishandles Lisp_Misc_Save_Value printing on
11820         hosts with pre-C99 libraries, because pD is wrongly defined to "t".
11822         Improve buffer-overflow checking (Bug#8873).
11823         * fileio.c (Finsert_file_contents):
11824         * insdel.c (insert_from_buffer_1, replace_range, replace_range_2):
11825         Remove the old (too-loose) buffer overflow checks.
11826         They weren't needed, since make_gap checks for buffer overflow.
11827         * insdel.c (make_gap_larger): Catch buffer overflows that were missed.
11828         The old code merely checked for Emacs fixnum overflow, and relied
11829         on undefined (wraparound) behavior.  The new code avoids undefined
11830         behavior, and also checks for ptrdiff_t and/or size_t overflow.
11832         * editfns.c (Finsert_char): Don't dump core with very negative counts.
11833         Tune.  Don't use wider integers than needed.  Don't use alloca.
11834         Use a bigger 'string' buffer.  Rewrite to avoid 'n > 0' test.
11836         * insdel.c (replace_range): Fix buf overflow when insbytes < outgoing.
11838         * insdel.c, lisp.h (buffer_overflow): New function.
11839         (insert_from_buffer_1, replace_range, replace_range_2):
11840         * insdel.c (make_gap_larger):
11841         * editfns.c (Finsert_char):
11842         * fileio.c (Finsert_file_contents): Use it, to normalize wording.
11844         * buffer.h (BUF_BYTES_MAX): Cast to ptrdiff_t so that it's signed.
11846 2011-06-15  Paul Eggert  <eggert@cs.ucla.edu>
11848         Integer overflow and signedness fixes (Bug#8873, Bug#8828).
11850         * ccl.c (ASCENDING_ORDER): New macro, to work around GCC bug 43772.
11851         (GET_CCL_RANGE, IN_INT_RANGE): Use it.
11853         * fileio.c: Don't assume EMACS_INT fits in off_t.
11854         (emacs_lseek): New static function.
11855         (Finsert_file_contents, Fwrite_region): Use it.
11856         Use SEEK_SET, SEEK_CUR, SEEK_END as appropriate.
11858         * fns.c (Fload_average): Don't assume 100 * load average fits in int.
11860         * fns.c: Don't overflow int when computing a list length.
11861         * fns.c (QUIT_COUNT_HEURISTIC): New constant.
11862         (Flength, Fsafe_length): Use EMACS_INT, not int, to avoid unwanted
11863         truncation on 64-bit hosts.  Check for QUIT every
11864         QUIT_COUNT_HEURISTIC entries rather than every other entry; that's
11865         faster and is responsive enough.
11866         (Flength): Report an error instead of overflowing an integer.
11867         (Fsafe_length): Return a float if the value is not representable
11868         as a fixnum.  This shouldn't happen except in contrived situations.
11869         (Fnthcdr, Fsort): Don't assume list length fits in int.
11870         (Fcopy_sequence): Don't assume vector length fits in int.
11872         * alloc.c: Check that resized vectors' lengths fit in fixnums.
11873         (header_size, word_size): New constants.
11874         (allocate_vectorlike): Don't check size overflow here.
11875         (allocate_vector): Check it here instead, since this is the only
11876         caller of allocate_vectorlike that could cause overflow.
11877         Check that the new vector's length is representable as a fixnum.
11879         * fns.c (next_almost_prime): Don't return a multiple of 3 or 5.
11880         The previous code was bogus.  For example, next_almost_prime (32)
11881         returned 39, which is undesirable as it is a multiple of 3; and
11882         next_almost_prime (24) returned 25, which is a multiple of 5 so
11883         why was the code bothering to check for multiples of 7?
11885         * bytecode.c (exec_byte_code): Use ptrdiff_t, not int, for vector length.
11887         * eval.c, doprnt.c (SIZE_MAX): Remove; inttypes.h defines this now.
11889         Variadic C functions now count arguments with ptrdiff_t.
11890         This partly undoes my 2011-03-30 change, which replaced int with size_t.
11891         Back then I didn't know that the Emacs coding style prefers signed int.
11892         Also, in the meantime I found a few more instances where arguments
11893         were being counted with int, which may truncate counts on 64-bit
11894         machines, or EMACS_INT, which may be unnecessarily wide.
11895         * lisp.h (struct Lisp_Subr.function.aMANY)
11896         (DEFUN_ARGS_MANY, internal_condition_case_n, safe_call):
11897         Arg counts are now ptrdiff_t, not size_t.
11898         All variadic functions and their callers changed accordingly.
11899         (struct gcpro.nvars): Now size_t, not size_t.  All uses changed.
11900         * bytecode.c (exec_byte_code): Check maxdepth for overflow,
11901         to avoid potential buffer overrun.  Don't assume arg counts fit in 'int'.
11902         * callint.c (Fcall_interactively): Check arg count for overflow,
11903         to avoid potential buffer overrun.  Use signed char, not 'int',
11904         for 'varies' array, so that we needn't bother to check its size
11905         calculation for overflow.
11906         * editfns.c (Fformat): Use ptrdiff_t, not EMACS_INT, to count args.
11907         * eval.c (apply_lambda):
11908         * fns.c (Fmapconcat): Use XFASTINT, not XINT, to get args length.
11909         (struct textprop_rec.argnum): Now ptrdiff_t, not int.  All uses changed.
11910         (mapconcat): Use ptrdiff_t, not int and EMACS_INT, to count args.
11912         * callint.c (Fcall_interactively): Don't use index var as event count.
11914         * vm-limit.c (check_memory_limits): Fix incorrect extern function decls.
11915         * mem-limits.h (SIZE): Remove; no longer used.
11917         * xterm.c (x_alloc_nearest_color_1): Prefer int to long when int works.
11919         Remove unnecessary casts.
11920         * xterm.c (x_term_init):
11921         * xfns.c (x_set_border_pixel):
11922         * widget.c (create_frame_gcs): Remove casts to unsigned long etc.
11923         These aren't needed now that we assume ANSI C.
11925         * sound.c (Fplay_sound_internal): Remove cast to unsigned long.
11926         It's more likely to cause problems (due to unsigned overflow)
11927         than to cure them.
11929         * dired.c (Ffile_attributes): Don't use 32-bit hack on 64-bit hosts.
11931         * unexelf.c (unexec): Don't assume BSS addr fits in unsigned.
11933         * xterm.c (handle_one_xevent): Omit unnecessary casts to unsigned.
11935         * keyboard.c (modify_event_symbol): Don't limit alist len to UINT_MAX.
11937         * lisp.h (CHAR_TABLE_SET): Omit now-redundant test.
11939         * lread.c (Fload): Don't compare a possibly-garbage time_t value.
11941         GLYPH_CODE_FACE returns EMACS_INT, not int.
11942         * dispextern.h (merge_faces):
11943         * xfaces.c (merge_faces):
11944         * xdisp.c (get_next_display_element, next_element_from_display_vector):
11945         Don't assume EMACS_INT fits in int.
11947         * character.h (CHAR_VALID_P): Remove unused parameter.
11948         * fontset.c, lisp.h, xdisp.c: All uses changed.
11950         * editfns.c (Ftranslate_region_internal): Omit redundant test.
11952         * fns.c (concat): Minor tuning based on overflow analysis.
11953         This doesn't fix any bugs.  Use int to hold character, instead
11954         of constantly refetching from Emacs object.  Use XFASTINT, not
11955         XINT, for value known to be a character.  Don't bother comparing
11956         a single byte to 0400, as it's always less.
11958         * floatfns.c (Fexpt):
11959         * fileio.c (make_temp_name): Omit unnecessary cast to unsigned.
11961         * editfns.c (Ftranslate_region_internal): Use int, not EMACS_INT
11962         for characters.
11964         * doc.c (get_doc_string): Omit (unsigned)c that mishandled negatives.
11966         * data.c (Faset): If ARRAY is a string, check that NEWELT is a char.
11967         Without this fix, on a 64-bit host (aset S 0 4294967386) would
11968         incorrectly succeed when S was a string, because 4294967386 was
11969         truncated before it was used.
11971         * chartab.c (Fchar_table_range): Use CHARACTERP to check range.
11972         Otherwise, an out-of-range integer could cause undefined behavior
11973         on a 64-bit host.
11975         * composite.c: Use int, not EMACS_INT, for characters.
11976         (fill_gstring_body, composition_compute_stop_pos): Use int, not
11977         EMACS_INT, for values that are known to be in character range.
11978         This doesn't fix any bugs but is the usual style inside Emacs and
11979         may generate better code on 32-bit machines.
11981         Make sure a 64-bit char is never passed to ENCODE_CHAR.
11982         This is for reasons similar to the recent CHAR_STRING fix.
11983         * charset.c (Fencode_char): Check that character arg is actually
11984         a character.  Pass an int to ENCODE_CHAR.
11985         * charset.h (ENCODE_CHAR): Verify that the character argument is no
11986         wider than 'int', as a compile-time check to prevent future regressions
11987         in this area.
11989         * character.c (char_string): Remove unnecessary casts.
11991         Make sure a 64-bit char is never passed to CHAR_STRING.
11992         Otherwise, CHAR_STRING would do the wrong thing on a 64-bit platform,
11993         by silently ignoring the top 32 bits, allowing some values
11994         that were far too large to be valid characters.
11995         * character.h: Include <verify.h>.
11996         (CHAR_STRING, CHAR_STRING_ADVANCE): Verify that the character
11997         arguments are no wider than unsigned, as a compile-time check
11998         to prevent future regressions in this area.
11999         * data.c (Faset):
12000         * editfns.c (Fchar_to_string, general_insert_function, Finsert_char)
12001         (Fsubst_char_in_region):
12002         * fns.c (concat):
12003         * xdisp.c (decode_mode_spec_coding):
12004         Adjust to CHAR_STRING's new requirement.
12005         * editfns.c (Finsert_char, Fsubst_char_in_region):
12006         * fns.c (concat): Check that character args are actually
12007         characters.  Without this test, these functions did the wrong
12008         thing with wildly out-of-range values on 64-bit hosts.
12010         Remove incorrect casts to 'unsigned' that lose info on 64-bit hosts.
12011         These casts should not be needed on 32-bit hosts, either.
12012         * keyboard.c (read_char):
12013         * lread.c (Fload): Remove casts to unsigned.
12015         * lisp.h (UNSIGNED_CMP): New macro.
12016         This fixes comparison bugs on 64-bit hosts.
12017         (ASCII_CHAR_P): Use it.
12018         * casefiddle.c (casify_object):
12019         * character.h (ASCII_BYTE_P, CHAR_VALID_P)
12020         (SINGLE_BYTE_CHAR_P, CHAR_STRING):
12021         * composite.h (COMPOSITION_ENCODE_RULE_VALID):
12022         * dispextern.h (FACE_FROM_ID):
12023         * keyboard.c (read_char): Use UNSIGNED_CMP.
12025         * xmenu.c (dialog_selection_callback) [!USE_GTK]: Cast to intptr_t,
12026         not to EMACS_INT, to avoid GCC warning.
12028         * xfns.c (x_set_scroll_bar_default_width): Remove unused 'int' locals.
12030         * buffer.h (PTR_BYTE_POS, BUF_PTR_BYTE_POS): Remove harmful cast.
12031         The cast incorrectly truncated 64-bit byte offsets to 32 bits, and
12032         isn't needed on 32-bit machines.
12034         * buffer.c (Fgenerate_new_buffer_name):
12035         Use EMACS_INT for count, not int.
12036         (advance_to_char_boundary): Return EMACS_INT, not int.
12038         * data.c (Qcompiled_function): Now static.
12040         * window.c (window_body_lines): Now static.
12042         * image.c (gif_load): Rename local to avoid shadowing.
12044         * lisp.h (SAFE_ALLOCA_LISP): Check for integer overflow.
12045         (struct Lisp_Save_Value): Use ptrdiff_t, not int, for 'integer' member.
12046         * alloc.c (make_save_value): Integer argument is now of type
12047         ptrdiff_t, not int.
12048         (mark_object): Use ptrdiff_t, not int.
12049         * lisp.h (pD): New macro.
12050         * print.c (print_object): Use it.
12052         * alloc.c: Use EMACS_INT, not int, to count objects.
12053         (total_conses, total_markers, total_symbols, total_vector_size)
12054         (total_free_conses, total_free_markers, total_free_symbols)
12055         (total_free_floats, total_floats, total_free_intervals)
12056         (total_intervals, total_strings, total_free_strings):
12057         Now EMACS_INT, not int.  All uses changed.
12058         (Fgarbage_collect): Compute overall total using a double, so that
12059         integer overflow is less likely to be a problem.  Check for overflow
12060         when converting back to an integer.
12061         (n_interval_blocks, n_string_blocks, n_float_blocks, n_cons_blocks)
12062         (n_vectors, n_symbol_blocks, n_marker_blocks): Remove.
12063         These were 'int' variables that could overflow on 64-bit hosts;
12064         they were never used, so remove them instead of repairing them.
12065         (nzombies, ngcs, max_live, max_zombies): Now EMACS_INT, not 'int'.
12066         (inhibit_garbage_collection): Set gc_cons_threshold to max value.
12067         Previously, this ceilinged at INT_MAX, but that doesn't work on
12068         64-bit machines.
12069         (allocate_pseudovector): Don't use EMACS_INT when int would do.
12071         * alloc.c (Fmake_bool_vector): Don't assume vector size fits in int.
12072         (allocate_vectorlike): Check for ptrdiff_t overflow.
12073         (mark_vectorlike, mark_char_table, mark_object): Avoid EMACS_UINT
12074         when a (possibly-narrower) signed value would do just as well.
12075         We prefer using signed arithmetic, to avoid comparison confusion.
12077         * alloc.c: Catch some string size overflows that we were missing.
12078         (XMALLOC_OVERRUN_CHECK_SIZE) [!XMALLOC_OVERRUN_CHECK]: Define to 0,
12079         for convenience in STRING_BYTES_MAX.
12080         (STRING_BYTES_MAX): New macro, superseding the old one in lisp.h.
12081         The definition here is exact; the one in lisp.h was approximate.
12082         (allocate_string_data): Check for string overflow.  This catches
12083         some instances we weren't catching before.  Also, it catches
12084         size_t overflow on (unusual) hosts where SIZE_MAX <= min
12085         (PTRDIFF_MAX, MOST_POSITIVE_FIXNUM), e.g., when size_t is 32 bits
12086         and ptrdiff_t and EMACS_INT are both 64 bits.
12088         * character.c, coding.c, doprnt.c, editfns.c, eval.c:
12089         All uses of STRING_BYTES_MAX replaced by STRING_BYTES_BOUND.
12090         * lisp.h (STRING_BYTES_BOUND): Rename from STRING_BYTES_MAX.
12092         * character.c (string_escape_byte8): Fix nbytes/nchars typo.
12094         * alloc.c (Fmake_string): Check for out-of-range init.
12096 2011-06-15  Stefan Monnier  <monnier@iro.umontreal.ca>
12098         * eval.c (Fdefvaralias): Also mark the target as variable-special-p.
12100 2011-06-14  Jan Djärv  <jan.h.d@swipnet.se>
12102         * xfns.c (x_set_scroll_bar_default_width): Remove argument to
12103         xg_get_default_scrollbar_width.
12105         * gtkutil.c: Include emacsgtkfixed.h if HAVE_GTK3.
12106         (int_gtk_range_get_value): Move to the scroll bar part of the file.
12107         (style_changed_cb): Call update_theme_scrollbar_width and call
12108         x_set_scroll_bar_default_width and xg_frame_set_char_size for
12109         all frames (Bug#8505).
12110         (xg_create_frame_widgets): Call emacs_fixed_new if HAVE_GTK3 (Bug#8505).
12111         Call gtk_window_set_resizable if HAVE_GTK3.
12112         (x_wm_set_size_hint): Call emacs_fixed_set_min_size with min width
12113         and height if HAVE_GTK3 (Bug#8505).
12114         (scroll_bar_width_for_theme): New variable.
12115         (update_theme_scrollbar_width): New function.
12116         (xg_get_default_scrollbar_width): Move code to
12117         update_theme_scrollbar_width, just return scroll_bar_width_for_theme.
12118         (xg_initialize): Call update_theme_scrollbar_width.
12120         * gtkutil.h (xg_get_default_scrollbar_width): Remove argument.
12122         * emacsgtkfixed.c, emacsgtkfixed.h: New files.
12124 2011-06-12  Martin Rudalics  <rudalics@gmx.at>
12126         * frame.c (make_frame): Call other_buffer_safely instead of
12127         other_buffer.
12129         * window.c (temp_output_buffer_show): Call display_buffer with
12130         second argument Vtemp_buffer_show_specifiers and reset latter
12131         immediately after the call.
12132         (Vtemp_buffer_show_specifiers): New variable.
12133         (auto_window_vscroll_p, next_screen_context_lines)
12134         (Vscroll_preserve_screen_position): Remove leading asterisks from
12135         doc-strings.
12137 2011-06-12  Paul Eggert  <eggert@cs.ucla.edu>
12139         Fix minor problems found by GCC 4.6.0 static checking.
12140         * buffer.c (Qclone_number): Remove for now, as it's unused.
12141         (record_buffer, Funrecord_buffer): Rename local to avoid shadowing.
12142         (record_buffer): Remove unused local.
12143         * frame.c (other_visible_frames, frame_buffer_list): Now static.
12144         (set_frame_buffer_list): Remove; unused.
12145         * frame.h (other_visible_frames): Remove decl.
12146         * keyboard.h (menu_items_inuse): Declare only if USE_GTK || USE_MOTIF.
12147         * lisp.h (frame_buffer_list, set_frame_buffer_list): Remove decls.
12148         (add_gpm_wait_descriptor, delete_gpm_wait_descriptor): Declare only
12149         if HAVE_GPM.
12150         * menu.c (menu_items_inuse): Now static unless USE_GTK || USE_MOTIF.
12151         * process.c (add_gpm_wait_descriptor, delete_gpm_wait_descriptor):
12152         Define only if HAVE_GPM.
12153         * widget.c (EmacsFrameResize, emacsFrameClassRec): Now static.
12154         (update_hints_inhibit): Remove; never set.  All uses removed.
12155         * widgetprv.h (emacsFrameClassRec): Remove decl.
12156         * window.c (delete_deletable_window): Now returns void, since it
12157         wasn't returning anything.
12158         (compare_window_configurations): Remove unused locals.
12159         * xfns.c (x_set_scroll_bar_default_width): Remove unused locals.
12160         * xmenu.c (x_menu_set_in_use): Define only if USE_GTK || USE_MOTIF.
12161         (dialog_selection_callback) [!USE_GTK]: Prefer intptr_t for integers
12162         the same widths as pointers.  This follows up on the 2011-05-06 patch.
12163         * xterm.c (x_alloc_lighter_color_for_widget): Define only if USE_LUCID.
12164         * xterm.h: Likewise.
12165         (x_menu_set_in_use): Declare only if USE_GTK || USE_MOTIF.
12167 2011-06-12  Juanma Barranquero  <lekktu@gmail.com>
12169         * makefile.w32-in: Update dependencies.
12170         (LISP_H): Add lib/intprops.h.
12172 2011-06-11  Chong Yidong  <cyd@stupidchicken.com>
12174         * image.c (gif_load): Add animation frame delay to the metadata.
12175         (syms_of_image): Use DEFSYM.  New symbol `delay'.
12177 2011-06-11  Martin Rudalics  <rudalics@gmx.at>
12179         * window.c (delete_deletable_window): Re-add.
12180         (Fset_window_configuration): Rewrite to handle dead buffers and
12181         consequently deletable windows.
12182         (window_tree, Fwindow_tree): Remove.  Supply functionality in
12183         window.el.
12184         (compare_window_configurations): Simplify code.
12186 2011-06-11  Andreas Schwab  <schwab@linux-m68k.org>
12188         * image.c (imagemagick_load_image): Fix type mismatch.
12189         (Fimagemagick_types): Likewise.
12191         * window.h (replace_buffer_in_windows): Declare.
12193 2011-06-11  Martin Rudalics  <rudalics@gmx.at>
12195         * buffer.c: New Lisp objects Qbuffer_list_update_hook and
12196         Qclone_number.  Remove external declaration of Qdelete_window.
12197         (Fbuffer_list): Rewrite doc-string.  Minor restructuring of
12198         code.
12199         (Fget_buffer_create, Fmake_indirect_buffer, Frename_buffer):
12200         Run Qbuffer_list_update_hook if allowed.
12201         (Fother_buffer): Rewrite doc-string.  Major rewrite for new
12202         buffer list implementation.
12203         (other_buffer_safely): New function.
12204         (Fkill_buffer): Replace call to replace_buffer_in_all_windows by
12205         calls to replace_buffer_in_windows and
12206         replace_buffer_in_windows_safely.  Run Qbuffer_list_update_hook
12207         if allowed.
12208         (record_buffer): Inhibit quitting and rewrite using quittable
12209         functions.  Run Qbuffer_list_update_hook if allowed.
12210         (Frecord_buffer, Funrecord_buffer): New functions.
12211         (switch_to_buffer_1, Fswitch_to_buffer): Remove.
12212         Move switch-to-buffer to window.el.
12213         (bury-buffer): Move to window.el.
12214         (Vbuffer_list_update_hook): New variable.
12216         * lisp.h (other_buffer_safely): Add prototype in buffer.c
12217         section.
12219         * window.h (resize_frame_windows): Move up in code.
12220         (Fwindow_frame): Remove EXFUN.
12221         (replace_buffer_in_all_windows): Remove prototype.
12222         (replace_buffer_in_windows_safely): Add prototype.
12224         * window.c: Declare Qdelete_window static again.  Move down
12225         declaration of select_count.
12226         (Fnext_window, Fprevious_window): Rewrite doc-strings.
12227         (Fother_window): Move to window.el.
12228         (window_loop): Remove DELETE_BUFFER_WINDOWS and UNSHOW_BUFFER
12229         cases.  Add REPLACE_BUFFER_IN_WINDOWS_SAFELY case.
12230         (Fdelete_windows_on, Freplace_buffer_in_windows): Move to
12231         window.el.
12232         (replace_buffer_in_windows): Implement by calling
12233         Qreplace_buffer_in_windows.
12234         (replace_buffer_in_all_windows): Remove with some functionality
12235         moved into replace_buffer_in_windows_safely.
12236         (replace_buffer_in_windows_safely): New function.
12237         (select_window_norecord, select_frame_norecord): Move in front
12238         of run_window_configuration_change_hook.  Remove now obsolete
12239         declarations.
12240         (Fset_window_buffer): Rewrite doc-string.
12241         Call Qrecord_window_buffer.
12242         (keys_of_window): Move binding for other-window to window.el.
12244 2011-06-11  Chong Yidong  <cyd@stupidchicken.com>
12246         * dispextern.h (struct image): Replace data member, whose int_val
12247         and ptr_val fields were not used by anything, with a single
12248         lisp_val object.
12250         * image.c (Fimage_metadata, make_image, mark_image, tiff_load)
12251         (gif_clear_image, gif_load, imagemagick_load_image)
12252         (gs_clear_image, gs_load): Callers changed.
12254 2011-06-10  Paul Eggert  <eggert@cs.ucla.edu>
12256         * buffer.h: Include <time.h>, for time_t.
12257         Needed to build on FreeBSD 8.2.  Problem reported by Herbert J. Skuhra.
12259         Fix minor problems found by static checking.
12261         * image.c (PixelGetMagickColor): Declare if ImageMagick headers don't.
12263         Make identifiers static if they are not used in other modules.
12264         * data.c (Qcompiled_function, Qframe, Qvector):
12265         * image.c (QimageMagick, Qsvg):
12266         * minibuf.c (Qmetadata):
12267         * window.c (resize_window_check, resize_root_window): Now static.
12268         * window.h (resize_window_check, resize_root_window): Remove decls.
12270         * window.c (window_deletion_count, delete_deletable_window):
12271         Remove; unused.
12272         (window_body_lines): Now static.
12273         (Fdelete_other_windows_internal): Mark vars as initialized.
12274         Make sure 'resize_failed' is initialized.
12275         (run_window_configuration_change_hook): Rename local to avoid shadowing.
12276         (resize_window_apply): Remove unused local.
12277         * window.h (delete_deletable_window): Remove decl.
12279         * image.c (gif_load, svg_load_image): Rename locals to avoid shadowing.
12280         (imagemagick_load_image): Fix pointer signedness problem by changing
12281         last arg from unsigned char * to char *.  All uses changed.
12282         Also, fix a local for similar reasons.
12283         Remove unused locals.  Remove locals to avoid shadowing.
12284         (fn_rsvg_handle_free): Remove; unused.
12285         (svg_load, svg_load_image): Fix pointer signedness problem.
12286         (imagemagick_load_image): Don't use garbage pointer image_wand.
12288         * ftfont.c (ftfont_get_metrics, ftfont_drive_otf): Remove unused locals.
12290 2011-06-10  Chong Yidong  <cyd@stupidchicken.com>
12292         * image.c (gif_load): Fix omitted cast error introduced by
12293         2011-06-06 change.
12295 2011-06-10  Martin Rudalics  <rudalics@gmx.at>
12297         * window.h (resize_proportionally, orig_total_lines)
12298         (orig_top_line): Remove from window structure.
12299         (set_window_height, set_window_width, change_window_heights)
12300         (Fdelete_window): Remove prototypes.
12301         (resize_frame_windows): Remove duplicate declaration.
12303 2011-06-10  Eli Zaretskii  <eliz@gnu.org>
12305         * window.h (resize_frame_windows, resize_window_check)
12306         (delete_deletable_window, resize_root_window)
12307         (resize_frame_windows): Declare prototypes.
12309         * window.c (resize_window_apply): Make definition be "static" to
12310         match the prototype.
12312 2011-06-10  Martin Rudalics  <rudalics@gmx.at>
12314         * window.c: Remove declarations of Qwindow_size_fixed,
12315         window_min_size_1, window_min_size_2, window_min_size,
12316         size_window, window_fixed_size_p, enlarge_window, delete_window.
12317         Remove static from declaration of Qdelete_window, it's
12318         temporarily needed by Fbury_buffer.
12319         (replace_window): Don't assign orig_top_line and
12320         orig_total_lines.
12321         (Fdelete_window, delete_window): Remove.  Window deletion is
12322         handled by window.el.
12323         (window_loop): Remove DELETE_OTHER_WINDOWS case.
12324         Replace Fdelete_window calls with calls to Qdelete_window.
12325         (Fdelete_other_windows): Remove.  Deleting other windows is
12326         handled by window.el.
12327         (window_fixed_size_p): Remove.  Fixed-sizeness of windows is
12328         handled in window.el.
12329         (window_min_size_2, window_min_size_1, window_min_size): Remove.
12330         Window minimum sizes are handled in window.el.
12331         (shrink_windows, size_window, set_window_height)
12332         (set_window_width, change_window_heights, window_height)
12333         (window_width, CURBEG, CURSIZE, enlarge_window)
12334         (adjust_window_trailing_edge, Fadjust_window_trailing_edge)
12335         (Fenlarge_window, Fshrink_window): Remove.  Window resizing is
12336         handled in window.el.
12337         (make_dummy_parent): Rename to make_parent_window and give it a
12338         second argument horflag.
12339         (make_window): Don't set resize_proportionally any more.
12340         (Fsplit_window): Remove.  Windows are split in window.el.
12341         (save_restore_action, save_restore_orig_size)
12342         (shrink_window_lowest_first, save_restore_orig_size): Remove.
12343         Resize mini windows in window.el.
12344         (grow_mini_window, shrink_mini_window): Implement by calling
12345         Qresize_root_window_vertically, resize_window_check and
12346         resize_window_apply.
12347         (saved_window, Fset_window_configuration, save_window_save):
12348         Do not handle orig_top_line, orig_total_lines, and
12349         resize_proportionally.
12350         (window_min_height, window_min_width): Move to window.el.
12351         (keys_of_window): Move bindings for delete-other-windows,
12352         split-window, delete-window and enlarge-window to window.el.
12354         * buffer.c: Temporarily extern Qdelete_window.
12355         (Fbury_buffer): Temporarily call Qdelete_window instead of
12356         Fdelete_window (Fbury_buffer will move to window.el soon).
12358         * frame.c (set_menu_bar_lines_1): Remove code handling
12359         orig_top_line and orig_total_lines.
12361         * dispnew.c (adjust_frame_glyphs_initially): Don't use
12362         set_window_height but set heights directly.
12363         (change_frame_size_1): Use resize_frame_windows.
12365         * xdisp.c (init_xdisp): Don't use set_window_height but set
12366         heights directly.
12368         * xfns.c (x_set_menu_bar_lines, x_set_tool_bar_lines):
12369         Use resize_frame_windows instead of change_window_heights and run
12370         run_window_configuration_change_hook.
12372         * w32fns.c (x_set_tool_bar_lines): Use resize_frame_windows
12373         instead of change_window_heights and run
12374         run_window_configuration_change_hook.
12376 2011-06-09  Martin Rudalics  <rudalics@gmx.at>
12378         * window.c (replace_window): Rename second argument REPLACEMENT to
12379         NEW.  New third argument SETFLAG.  Rewrite.
12380         (delete_window, make_dummy_parent): Call replace_window with
12381         third argument 1.
12382         (window_list_1): Move down in code.
12383         (run_window_configuration_change_hook): Move set_buffer part
12384         before select_frame_norecord part in order to unwind correctly.
12385         Rename count1 to count.
12386         (recombine_windows, delete_deletable_window, resize_root_window)
12387         (Fdelete_other_windows_internal)
12388         (Frun_window_configuration_change_hook, make_parent_window)
12389         (resize_window_check, resize_window_apply, Fresize_window_apply)
12390         (resize_frame_windows, Fsplit_window_internal)
12391         (Fdelete_window_internal, Fresize_mini_window_internal):
12392         New functions.
12393         (syms_of_window): New variables Vwindow_splits and Vwindow_nest.
12395 2011-06-08  Martin Rudalics  <rudalics@gmx.at>
12397         * window.h (window): Add some new members to window structure -
12398         normal_lines, normal_cols, new_total, new_normal, clone_number,
12399         splits, nest, prev_buffers, next_buffers.
12400         (WINDOW_TOTAL_SIZE): Move here from window.c.
12401         (MIN_SAFE_WINDOW_WIDTH, MIN_SAFE_WINDOW_HEIGHT): Define here.
12403         * window.c (Fwindow_height, Fwindow_width, Fwindow_full_width_p):
12404         Remove.
12405         (make_dummy_parent): Set new members of windows structure.
12406         (make_window): Move down in code.  Handle new members of window
12407         structure.
12408         (Fwindow_clone_number, Fwindow_splits, Fset_window_splits)
12409         (Fwindow_nest, Fset_window_nest, Fwindow_new_total)
12410         (Fwindow_normal_size, Fwindow_new_normal, Fwindow_prev_buffers)
12411         (Fset_window_prev_buffers, Fwindow_next_buffers)
12412         (Fset_window_next_buffers, Fset_window_clone_number):
12413         New functions.
12414         (Fwindow_hscroll, Fwindow_at, Fwindow_point, Fwindow_start)
12415         (Fwindow_end, Fwindow_line_height, Fset_window_dedicated_p):
12416         Doc-string fixes.
12417         (Fwindow_parameters, Fwindow_parameter, Fset_window_parameter):
12418         Argument WINDOW can be now internal window too.
12419         (Fwindow_use_time): Move up in code.
12420         (Fget_buffer_window): Rename argument FRAME to ALL-FRAMES.
12421         Rewrite doc-string.
12422         (Fset_window_configuration, saved_window)
12423         (Fcurrent_window_configuration, save_window_save): Handle new
12424         members of window structure.
12425         (WINDOW_TOTAL_SIZE, MIN_SAFE_WINDOW_WIDTH)
12426         (MIN_SAFE_WINDOW_HEIGHT): Move to window.h.
12427         (syms_of_window): New Lisp objects Qrecord_window_buffer,
12428         Qwindow_deletable_p, Qdelete_window, Qreplace_buffer_in_windows,
12429         Qget_mru_window, Qresize_root_window,
12430         Qresize_root_window_vertically, Qsafe, Qabove, Qbelow,
12431         Qauto_buffer_name; staticpro them.
12433 2011-06-07  Martin Rudalics  <rudalics@gmx.at>
12435         * window.c (Fwindow_total_size, Fwindow_left_column)
12436         (Fwindow_top_line, window_body_lines, Fwindow_body_size)
12437         (Fwindow_list_1): New functions.
12438         (window_box_text_cols): Replace with window_body_cols.
12439         (Fwindow_width, Fscroll_left, Fscroll_right):
12440         Use window_body_cols instead of window_box_text_cols.
12441         (delete_window, Fset_window_configuration):
12442         Call delete_all_subwindows with window as argument.
12443         (delete_all_subwindows): Take a window as argument and not a
12444         structure.  Rewrite.
12445         (window_loop): Remove handling of GET_LRU_WINDOW and
12446         GET_LARGEST_WINDOW.
12447         (Fget_lru_window, Fget_largest_window): Move to window.el.
12449         * window.h: Extern window_body_cols instead of
12450         window_box_text_cols.  delete_all_subwindows now takes a
12451         Lisp_Object as argument.
12453         * indent.c (compute_motion, Fcompute_motion):
12454         Use window_body_cols instead of window_box_text_cols.
12456         * frame.c (delete_frame): Call delete_all_subwindows with root
12457         window as argument.
12459 2011-06-07  Daniel Colascione  <dan.colascione@gmail.com>
12461         * fns.c (Fputhash): Document return value.
12463 2011-06-06  Chong Yidong  <cyd@stupidchicken.com>
12465         * image.c (gif_load): Implement gif89a spec "no disposal" method.
12467 2011-06-06  Paul Eggert  <eggert@cs.ucla.edu>
12469         Cons<->int and similar integer overflow fixes (Bug#8794).
12471         Check for overflow when converting integer to cons and back.
12472         * charset.c (Fdefine_charset_internal, Fdecode_char):
12473         Use cons_to_unsigned to catch overflow.
12474         (Fencode_char): Use INTEGER_TO_CONS.
12475         * composite.h (LGLYPH_CODE): Use cons_to_unsigned.
12476         (LGLYPH_SET_CODE): Use INTEGER_TO_CONS.
12477         * data.c (long_to_cons, cons_to_long): Remove.
12478         (cons_to_unsigned, cons_to_signed): New functions.
12479         These signal an error for invalid or out-of-range values.
12480         * dired.c (Ffile_attributes): Use INTEGER_TO_CONS.
12481         * fileio.c (Fset_visited_file_modtime): Use CONS_TO_INTEGER.
12482         * font.c (Ffont_variation_glyphs):
12483         * fontset.c (Finternal_char_font): Use INTEGER_TO_CONS.
12484         * lisp.h: Include <intprops.h>.
12485         (INTEGER_TO_CONS, CONS_TO_INTEGER): New macros.
12486         (cons_to_signed, cons_to_unsigned): New decls.
12487         (long_to_cons, cons_to_long): Remove decls.
12488         * undo.c (record_first_change): Use INTEGER_TO_CONS.
12489         (Fprimitive_undo): Use CONS_TO_INTEGER.
12490         * xfns.c (Fx_window_property): Likewise.
12491         * xselect.c: Include <limits.h>.
12492         (x_own_selection, selection_data_to_lisp_data):
12493         Use INTEGER_TO_CONS.
12494         (x_handle_selection_request, x_handle_selection_clear)
12495         (x_get_foreign_selection, Fx_disown_selection_internal)
12496         (Fx_get_atom_name, x_send_client_event): Use CONS_TO_INTEGER.
12497         (lisp_data_to_selection_data): Use cons_to_unsigned.
12498         (x_fill_property_data): Use cons_to_signed.
12499         Report values out of range.
12501         Check for buffer and string overflow more precisely.
12502         * buffer.h (BUF_BYTES_MAX): New macro.
12503         * lisp.h (STRING_BYTES_MAX): New macro.
12504         * alloc.c (Fmake_string):
12505         * character.c (string_escape_byte8):
12506         * coding.c (coding_alloc_by_realloc):
12507         * doprnt.c (doprnt):
12508         * editfns.c (Fformat):
12509         * eval.c (verror):
12510         Use STRING_BYTES_MAX, not MOST_POSITIVE_FIXNUM,
12511         since they may not be the same number.
12512         * editfns.c (Finsert_char):
12513         * fileio.c (Finsert_file_contents):
12514         Likewise for BUF_BYTES_MAX.
12516         * image.c: Use ptrdiff_t, not int, for sizes.
12517         (slurp_file): Switch from int to ptrdiff_t.
12518         All uses changed.
12519         (slurp_file): Check that file size fits in both size_t (for
12520         malloc) and ptrdiff_t (for sanity and safety).
12522         * fileio.c (Fverify_visited_file_modtime): Avoid time overflow
12523         if b->modtime has its maximal value.
12525         * dired.c (Ffile_attributes): Don't assume EMACS_INT has >32 bits.
12527         Don't assume time_t can fit into int.
12528         * buffer.h (struct buffer.modtime): Now time_t, not int.
12529         * fileio.c (Fvisited_file_modtime): No need for time_t cast now.
12530         * undo.c (Fprimitive_undo): Use time_t, not int, for time_t value.
12532         Minor fixes for signed vs unsigned integers.
12533         * character.h (MAYBE_UNIFY_CHAR):
12534         * charset.c (maybe_unify_char):
12535         * keyboard.c (read_char, reorder_modifiers):
12536         XINT -> XFASTINT, since the integer must be nonnegative.
12537         * ftfont.c (ftfont_spec_pattern):
12538         * keymap.c (access_keymap, silly_event_symbol_error):
12539         XUINT -> XFASTINT, since the integer must be nonnegative.
12540         (Fsingle_key_description, preferred_sequence_p): XUINT -> XINT,
12541         since it makes no difference and we prefer signed.
12542         * keyboard.c (record_char): Use XUINT when all the neighbors do.
12543         (access_keymap): NATNUMP -> INTEGERP, since the integer must be
12544         nonnegative.
12546 2011-06-06  Stefan Monnier  <monnier@iro.umontreal.ca>
12548         * window.h (Fwindow_frame): Declare.
12550 2011-06-06  Paul Eggert  <eggert@cs.ucla.edu>
12552         * alloc.c: Simplify handling of large-request failures (Bug#8800).
12553         (SPARE_MEMORY): Always define.
12554         (LARGE_REQUEST): Remove.
12555         (memory_full): Use SPARE_MEMORY rather than LARGE_REQUEST.
12557 2011-06-06  Martin Rudalics  <rudalics@gmx.at>
12559         * lisp.h: Move EXFUNS for Fframe_root_window,
12560         Fframe_first_window and Fset_frame_selected_window to window.h.
12562         * window.h: Move EXFUNS for Fframe_root_window,
12563         Fframe_first_window and Fset_frame_selected_window here from
12564         lisp.h.
12566         * frame.c (Fwindow_frame, Fframe_first_window)
12567         (Fframe_root_window, Fframe_selected_window)
12568         (Fset_frame_selected_window): Move to window.c.
12569         (Factive_minibuffer_window): Move to minibuf.c.
12570         (Fother_visible_frames_p): New function.
12572         * minibuf.c (Factive_minibuffer_window): Move here from frame.c.
12574         * window.c (decode_window, decode_any_window): Move up in code.
12575         (Fwindowp, Fwindow_live_p): Rewrite doc-strings.
12576         (inhibit_frame_unsplittable): Remove unused variable.
12577         (Fwindow_buffer): Move up and rewrite doc-string.
12578         (Fwindow_parent, Fwindow_vchild, Fwindow_hchild, Fwindow_next)
12579         (Fwindow_prev): New functions.
12580         (Fwindow_frame): Move here from frame.c.  Accept any window as
12581         argument.
12582         (Fframe_root_window, Fframe_first_window)
12583         (Fframe_selected_window): Move here from frame.c.  Accept frame
12584         or arbitrary window as argument.  Update doc-strings.
12585         (Fminibuffer_window): Move up in code.
12586         (Fwindow_minibuffer_p): Move up in code and simplify.
12587         (Fset_frame_selected_window): Move here from frame.c.
12588         Marginal rewrite.
12589         (Fselected_window, select_window, Fselect_window): Move up in
12590         code.  Minor doc-string fixes.
12592 2011-06-06  Paul Eggert  <eggert@cs.ucla.edu>
12594         * alloc.c (memory_full) [SYSTEM_MALLOC]: Port to MacOS (Bug#8800).
12595         Do not assume that spare memory exists; that assumption is valid
12596         only if SYSTEM_MALLOC.
12597         (LARGE_REQUEST): New macro, so that the issue of large requests
12598         is separated from the issue of spare memory.
12600 2011-06-05  Andreas Schwab  <schwab@linux-m68k.org>
12602         * editfns.c (Fformat): Correctly handle zero flag with hexadecimal
12603         format.  (Bug#8806)
12605         * gtkutil.c (xg_get_default_scrollbar_width): Avoid warning.
12607         * xfns.c (x_set_scroll_bar_default_width): Move declarations
12608         before statements.
12610 2011-06-05  Jan Djärv  <jan.h.d@swipnet.se>
12612         * gtkutil.c (xg_get_default_scrollbar_width): New function.
12614         * gtkutil.h: Declare xg_get_default_scrollbar_width.
12616         * xfns.c (x_set_scroll_bar_default_width): If USE_GTK, get
12617         min width by calling x_set_scroll_bar_default_width (Bug#8505).
12619 2011-06-05  Juanma Barranquero  <lekktu@gmail.com>
12621         * xdisp.c (single_display_spec_intangible_p): Remove declaration.
12623 2011-06-04  Chong Yidong  <cyd@stupidchicken.com>
12625         * xselect.c (x_clipboard_manager_save): Remove redundant arg.
12626         (x_clipboard_manager_save): Add return value.
12627         (x_clipboard_manager_error_1, x_clipboard_manager_error_2):
12628         New error handlers.
12629         (x_clipboard_manager_save_frame, x_clipboard_manager_save_all):
12630         Obey Vx_select_enable_clipboard_manager.  Catch errors in
12631         x_clipboard_manager_save (Bug#8779).
12632         (Vx_select_enable_clipboard_manager): New variable.
12633         (x_get_foreign_selection): Reduce scope of x_catch_errors (Bug#8790).
12635 2011-06-04  Dan Nicolaescu  <dann@ics.uci.edu>
12637         * emacs.c (main): Warn when starting a GTK emacs in daemon mode.
12639 2011-06-04  YAMAMOTO Mitsuharu  <mituharu@math.s.chiba-u.ac.jp>
12641         * fringe.c (update_window_fringes): Don't update overlay arrow bitmap
12642         in the current matrix if keep_current_p is non-zero.
12644 2011-06-04  Eli Zaretskii  <eliz@gnu.org>
12646         * bidi.c (bidi_level_of_next_char): Fix last change.
12648 2011-06-03  Eli Zaretskii  <eliz@gnu.org>
12650         Support bidi reordering of text covered by display properties.
12652         * bidi.c (bidi_copy_it): Use offsetof instead of emulating it.
12653         (bidi_fetch_char, bidi_fetch_char_advance): New functions.
12654         (bidi_cache_search, bidi_cache_iterator_state)
12655         (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak)
12656         (bidi_level_of_next_char, bidi_move_to_visually_next):
12657         Support character positions inside a run of characters covered by a
12658         display string.
12659         (bidi_paragraph_init, bidi_resolve_explicit_1)
12660         (bidi_level_of_next_char): Call bidi_fetch_char and
12661         bidi_fetch_char_advance instead of FETCH_CHAR and
12662         FETCH_CHAR_ADVANCE.
12663         (bidi_init_it): Initialize new members.
12664         (LRE_CHAR, RLE_CHAR, PDF_CHAR, LRO_CHAR, RLO_CHAR): Remove macro
12665         definitions.
12666         (bidi_explicit_dir_char): Lookup character type in bidi_type_table,
12667         instead of using explicit *_CHAR codes.
12668         (bidi_resolve_explicit, bidi_resolve_weak):
12669         Use FETCH_MULTIBYTE_CHAR instead of FETCH_CHAR, as reordering of
12670         bidirectional text is supported only in multibyte buffers.
12671         (bidi_init_it): Accept additional argument FRAME_WINDOW_P and use
12672         it to initialize the frame_window_p member of struct bidi_it.
12673         (bidi_cache_iterator_state, bidi_resolve_explicit_1)
12674         (bidi_resolve_explicit, bidi_resolve_weak)
12675         (bidi_level_of_next_char, bidi_move_to_visually_next): Abort if
12676         bidi_it->nchars is non-positive.
12677         (bidi_level_of_next_char): Don't try to lookup the cache for the
12678         next/previous character if nothing is cached there yet, or if we
12679         were just reseat()'ed to a new position.
12681         * xdisp.c (set_cursor_from_row): Set start and stop points
12682         according to the row's direction when priming the loop that looks
12683         for the glyph on which to display cursor.
12684         (single_display_spec_intangible_p): Function deleted.
12685         (display_prop_intangible_p): Reimplement to call
12686         handle_display_spec instead of single_display_spec_intangible_p.
12687         Accept 3 additional arguments needed by handle_display_spec.
12688         This fixes incorrect cursor motion across display property with complex
12689         values: lists, `(when COND...)' forms, etc.
12690         (single_display_spec_string_p): Support property values that are
12691         lists with the argument STRING its top-level element.
12692         (display_prop_string_p): Fix the condition for processing a
12693         property that is a list to be consistent with handle_display_spec.
12694         (handle_display_spec): New function, refactored from the
12695         last portion of handle_display_prop.
12696         (compute_display_string_pos): Accept additional argument
12697         FRAME_WINDOW_P.  Call handle_display_spec to determine whether the
12698         value of a `display' property is a "replacing spec".
12699         (handle_single_display_spec): Accept 2 additional arguments BUFPOS
12700         and FRAME_WINDOW_P.  If IT is NULL, don't set up the iterator from
12701         the display property, but just return a value indicating whether
12702         the display property will replace the characters it covers.
12703         (Fcurrent_bidi_paragraph_direction): Initialize the nchars and
12704         frame_window_p members of struct bidi_it.
12705         (compute_display_string_pos, compute_display_string_end):
12706         New functions.
12707         (push_it): Accept second argument POSITION, where pop_it should
12708         jump to continue iteration.
12709         (reseat_1): Initialize bidi_it.disp_pos.
12711         * keyboard.c (adjust_point_for_property): Adjust the call to
12712         display_prop_intangible_p to its new signature.
12714         * dispextern.h (struct bidi_it): New member frame_window_p.
12715         (bidi_init_it): Update prototypes.
12716         (display_prop_intangible_p): Update prototype.
12717         (compute_display_string_pos, compute_display_string_end):
12718         Declare prototypes.
12719         (struct bidi_it): New members nchars and disp_pos.  ch_len is now
12720         EMACS_INT.
12722 2011-06-02  Paul Eggert  <eggert@cs.ucla.edu>
12724         Malloc failure behavior now depends on size of allocation.
12725         * alloc.c (buffer_memory_full, memory_full): New arg NBYTES.
12726         * lisp.h: Change signatures accordingly.
12727         * alloc.c, buffer.c, editfns.c, menu.c, minibuf.c, xterm.c:
12728         All callers changed.  (Bug#8762)
12730         * gnutls.c: Use Emacs's memory allocators.
12731         Without this change, the gnutls library would invoke malloc etc.
12732         directly, which causes problems on non-SYNC_INPUT hosts, and which
12733         runs afoul of improving memory_full behavior.  (Bug#8761)
12734         (fn_gnutls_global_set_mem_functions): New macro or function pointer.
12735         (emacs_gnutls_global_init): Use it to specify xmalloc, xrealloc,
12736         xfree instead of the default malloc, realloc, free.
12737         (Fgnutls_boot): No need to check for memory allocation failure,
12738         since xmalloc does that for us.
12740         Remove arbitrary limit of 2**31 entries in hash tables.  (Bug#8771)
12741         * category.c (hash_get_category_set):
12742         * ccl.c (ccl_driver):
12743         * charset.c (Fdefine_charset_internal):
12744         * charset.h (struct charset.hash_index):
12745         * composite.c (get_composition_id, gstring_lookup_cache)
12746         (composition_gstring_put_cache):
12747         * composite.h (struct composition.hash_index):
12748         * dispextern.h (struct image.hash):
12749         * fns.c (next_almost_prime, larger_vector, cmpfn_eql)
12750         (cmpfn_equal, cmpfn_user_defined, hashfn_eq, hashfn_eql)
12751         (hashfn_equal, hashfn_user_defined, make_hash_table)
12752         (maybe_resize_hash_table, hash_lookup, hash_put)
12753         (hash_remove_from_table, hash_clear, sweep_weak_table, SXHASH_COMBINE)
12754         (sxhash_string, sxhash_list, sxhash_vector, sxhash_bool_vector)
12755         (Fsxhash, Fgethash, Fputhash, Fmaphash):
12756         * image.c (make_image, search_image_cache, lookup_image)
12757         (xpm_put_color_table_h):
12758         * lisp.h (struct Lisp_Hash_Table):
12759         * minibuf.c (Ftry_completion, Fall_completions, Ftest_completion):
12760         * print.c (print): Use 'EMACS_UINT' and 'EMACS_INT'
12761         for hashes and hash indexes, instead of 'unsigned' and 'int'.
12762         * alloc.c (allocate_vectorlike):
12763         Check for overflow in vector size calculations.
12764         * ccl.c (ccl_driver):
12765         Check for overflow when converting EMACS_INT to int.
12766         * fns.c, image.c: Remove unnecessary static decls that would otherwise
12767         need to be updated by these changes.
12768         * fns.c (make_hash_table, maybe_resize_hash_table):
12769         Check for integer overflow with large hash tables.
12770         (make_hash_table, maybe_resize_hash_table, Fmake_hash_table):
12771         Prefer the faster XFLOAT_DATA to XFLOATINT where either will do.
12772         (SXHASH_REDUCE): New macro.
12773         (sxhash_string, sxhash_list, sxhash_vector, sxhash_bool_vector):
12774         Use it instead of discarding useful hash info with large hash values.
12775         (sxhash_float): New function.
12776         (sxhash): Use it.  No more need for "& INTMASK" due to above changes.
12777         * lisp.h (FIXNUM_BITS): New macro, useful for SXHASH_REDUCE etc.
12778         (MOST_NEGATIVE_FIXNUM, MOST_POSITIVE_FIXNUM, INTMASK):
12779         Rewrite to use FIXNUM_BITS, as this simplifies things.
12780         (next_almost_prime, larger_vector, sxhash, hash_lookup, hash_put):
12781         Adjust signatures to match updated version of code.
12782         (consing_since_gc): Now EMACS_INT, since a single hash table can
12783         use more than INT_MAX bytes.
12785 2011-06-01  Dan Nicolaescu  <dann@ics.uci.edu>
12787         Make it possible to build with GCC-4.6+ -O2 -flto.
12789         * emacs.c (__malloc_initialize_hook): Mark as EXTERNALLY_VISIBLE.
12791 2011-06-01  Stefan Monnier  <monnier@iro.umontreal.ca>
12793         * minibuf.c (get_minibuffer, read_minibuf_unwind):
12794         Call minibuffer-inactive-mode.
12796 2011-05-31  Juanma Barranquero  <lekktu@gmail.com>
12798         * makefile.w32-in ($(BLD)/data.$(O), $(BLD)/editfns.$(O)):
12799         Update dependencies.
12801 2011-05-31  Dan Nicolaescu  <dann@ics.uci.edu>
12803         * data.c (init_data): Remove code for UTS, this system is not
12804         supported anymore.
12806 2011-05-31  Dan Nicolaescu  <dann@ics.uci.edu>
12808         Don't force ./temacs to start in terminal mode.
12810         * frame.c (make_initial_frame): Initialize faces in all cases, not
12811         only when CANNOT_DUMP is defined.
12812         * dispnew.c (init_display): Remove CANNOT_DUMP condition.
12814 2011-05-31  Dan Nicolaescu  <dann@ics.uci.edu>
12816         * dispnew.c (add_window_display_history): Use const for the string
12817         pointer.  Remove declaration, not needed.
12819 2011-05-31  Paul Eggert  <eggert@cs.ucla.edu>
12821         Use 'inline', not 'INLINE'.
12822         <http://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00914.html>
12823         * alloc.c, fontset.c (INLINE): Remove.
12824         * alloc.c, bidi.c, charset.c, coding.c, dispnew.c, fns.c, image.c:
12825         * intervals.c, keyboard.c, process.c, syntax.c, textprop.c, w32term.c:
12826         * xdisp.c, xfaces.c, xterm.c: Replace all uses of INLINE with inline.
12827         * gmalloc.c (register_heapinfo): Use inline unconditionally.
12828         * lisp.h (LISP_MAKE_RVALUE): Use inline, not __inline__.
12830 2011-05-31  Dan Nicolaescu  <dann@ics.uci.edu>
12832         Make it possible to run ./temacs.
12834         * callproc.c (set_initial_environment): Remove CANNOT_DUMP code,
12835         syms_of_callproc does the same thing.  Remove test for
12836         "initialized", do it in the caller.
12837         * emacs.c (main): Avoid calling set_initial_environment when dumping.
12839 2011-05-31  Stefan Monnier  <monnier@iro.umontreal.ca>
12841         * minibuf.c (Finternal_complete_buffer): Return `category' metadata.
12842         (read_minibuf): Use get_minibuffer.
12843         (syms_of_minibuf): Use DEFSYM.
12844         (Qmetadata): New var.
12845         * data.c (Qbuffer): Don't make it static.
12846         (syms_of_data): Use DEFSYM.
12848 2011-05-31  Paul Eggert  <eggert@cs.ucla.edu>
12850         * ccl.c (CCL_CODE_RANGE): Allow negative numbers.  (Bug#8751)
12851         (CCL_CODE_MIN): New macro.
12853 2011-05-30  Paul Eggert  <eggert@cs.ucla.edu>
12855         * alloc.c (lisp_align_malloc): Omit unnecessary val==NULL tests.
12857         * eval.c (Qdebug): Now static.
12858         * lisp.h (Qdebug): Remove decl.  This reverts a part of the
12859         2011-04-26 change (bzr 104015) that inadvertently undid part of
12860         the 2011-04-14 change (bzr 103913).
12862 2011-05-29  Chong Yidong  <cyd@stupidchicken.com>
12864         * image.c: Various fixes to ImageMagick code comments.
12865         (Fimagemagick_types): Doc fix.
12867 2011-05-29  Paul Eggert  <eggert@cs.ucla.edu>
12869         Minor fixes prompted by GCC 4.6.0 warnings.
12871         * xselect.c (converted_selections, conversion_fail_tag): Now static.
12873         * emacs.c [HAVE_X_WINDOWS]: Include "xterm.h".
12874         (x_clipboard_manager_save_all): Move extern decl to ...
12875         * xterm.h: ... here, so that it can be checked for consistency.
12877 2011-05-29  Chong Yidong  <cyd@stupidchicken.com>
12879         * xselect.c (x_clipboard_manager_save_frame)
12880         (x_clipboard_manager_save_all): New functions.
12881         (Fx_clipboard_manager_save): Lisp function deleted.
12883         * emacs.c (Fkill_emacs): Call x_clipboard_manager_save_all.
12884         * frame.c (delete_frame): Call x_clipboard_manager_save_frame.
12886         * xterm.h: Update prototype.
12888 2011-05-28  William Xu  <william.xwl@gmail.com>
12890         * nsterm.m (ns_term_shutdown): Synchronize user defaults before
12891         exiting (Bug#8239).
12893 2011-05-28  Jim Meyering  <meyering@redhat.com>
12895         Avoid a sign-extension bug in crypto_hash_function.
12896         * fns.c (to_uchar): Define.
12897         (crypto_hash_function): Use it to convert some newly-signed
12898         variables to unsigned, to avoid sign-extension bugs.  For example,
12899         without this change, (md5 "truc") would evaluate to
12900         45723a2aff78ff4fff7fff1114760e62 rather than the expected
12901         45723a2af3788c4ff17f8d1114760e62.  Reported by Antoine Levitt in
12902         https://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00883.html.
12904 2011-05-27  Paul Eggert  <eggert@cs.ucla.edu>
12906         Integer overflow fixes.
12908         * dbusbind.c: Serial number integer overflow fixes.
12909         (CHECK_DBUS_SERIAL_GET_SERIAL): New macro.
12910         (Fdbus_call_method_asynchronously, xd_read_message_1): Use a float
12911         to hold a serial number that is too large for a fixnum.
12912         (Fdbus_method_return_internal, Fdbus_method_error_internal):
12913         Check for serial numbers out of range.  Decode any serial number
12914         that was so large that it became a float.  (Bug#8722)
12916         * dbusbind.c: Use XFASTINT rather than XUINT, and check for nonneg.
12917         (Fdbus_call_method, Fdbus_call_method_asynchronously):
12918         Use XFASTINT rather than XUINT when numbers are nonnegative.
12919         (xd_append_arg, Fdbus_method_return_internal):
12920         (Fdbus_method_error_internal): Likewise.  Also, for unsigned
12921         arguments, check that Lisp number is nonnegative, rather than
12922         silently wrapping negative numbers around.  (Bug#8722)
12923         (xd_read_message_1): Don't assume dbus_uint32_t can fit in int.
12924         (Bug#8722)
12926         * data.c (arith_driver, Flsh): Avoid unnecessary casts to EMACS_UINT.
12928         * ccl.c (ccl_driver): Redo slightly to avoid the need for 'unsigned'.
12930         ccl: Add integer overflow checks.
12931         * ccl.c (CCL_CODE_MAX, GET_CCL_RANGE, GET_CCL_CODE, GET_CCL_INT):
12932         (IN_INT_RANGE): New macros.
12933         (ccl_driver): Use them to check for integer overflow when
12934         decoding a CCL program.  Many of the new checks are whether XINT (x)
12935         fits in int; it doesn't always, on 64-bit hosts.  The new version
12936         doesn't catch all possible integer overflows, but it's an
12937         improvement.  (Bug#8719)
12939         * alloc.c (make_event_array): Use XINT, not XUINT.
12940         There's no need for unsigned here.
12942         * mem-limits.h (EXCEEDS_LISP_PTR) [!USE_LSB_TAG]: EMACS_UINT -> uintptr_t
12943         This follows up to the 2011-05-06 change that substituted uintptr_t
12944         for EMACS_INT.  This case wasn't caught back then.
12946         Rework Fformat to avoid integer overflow issues.
12947         * editfns.c: Include <float.h> unconditionally, as it's everywhere
12948         now (part of C89).  Include <verify.h>.
12949         (MAX_10_EXP, CONVERTED_BYTE_SIZE): Remove; no longer needed.
12950         (pWIDE, pWIDElen, signed_wide, unsigned_wide): New defns.
12951         (Fformat): Avoid the prepass trying to compute sizes; it was only
12952         approximate and thus did not catch overflow reliably.  Instead, walk
12953         through the format just once, formatting and computing sizes as we go,
12954         checking for integer overflow at every step, and allocating a larger
12955         buffer as needed.  Keep track separately whether the format is
12956         multibyte.  Keep only the most-recently calculated precision, rather
12957         than them all.  Record whether each argument has been converted to
12958         string.  Use EMACS_INT, not int, for byte and char and arg counts.
12959         Support field widths and precisions larger than INT_MAX.  Avoid
12960         sprintf's undefined behavior with conversion specifications such as %#d
12961         and %.0c.  Fix bug with strchr succeeding on '\0' when looking for
12962         flags.  Fix bug with (format "%c" 256.0).  Avoid integer overflow when
12963         formatting out-of-range floating point numbers with int
12964         formats.  (Bug#8668)
12966         * lisp.h (FIXNUM_OVERFLOW_P): Work even if arg is a NaN.
12968         * data.c: Avoid integer truncation in expressions involving floats.
12969         * data.c: Include <intprops.h>.
12970         (arith_driver): When there's an integer overflow in an expression
12971         involving floating point, convert the integers to floating point
12972         so that the resulting value does not suffer from catastrophic
12973         integer truncation.  For example, on a 64-bit host (* 4
12974         most-negative-fixnum 0.5) should yield about -4.6e+18, not zero.
12975         Do not rely on undefined behavior after integer overflow.
12977         merge count_size_as_multibyte, parse_str_to_multibyte
12978         * character.c, character.h (count_size_as_multibyte):
12979         Rename from parse_str_to_multibyte; all uses changed.
12980         Check for integer overflow.
12981         * insdel.c, lisp.h (count_size_as_multibyte): Remove,
12982         since it's now a duplicate of the other.  This is more of
12983         a character than a buffer op, so better that it's in character.c.
12984         * fns.c, print.c: Adjust to above changes.
12986 2011-05-27  Stefan Monnier  <monnier@iro.umontreal.ca>
12988         * xselect.c (x_convert_selection): Yet another int/Lisp_Object mixup.
12990 2011-05-27  Paul Eggert  <eggert@cs.ucla.edu>
12992         * xselect.c: Fix minor problems prompted by GCC 4.6.0 warnings.
12993         (x_handle_selection_request, frame_for_x_selection): Remove unused vars.
12994         (x_clipboard_manager_save): Now static.
12995         (Fx_clipboard_manager_save): Rename local to avoid shadowing.
12997         * fns.c: Fix minor problems prompted by GCC 4.6.0 warnings.
12998         (crypto_hash_function): Now static.
12999         Fix pointer signedness problems.  Avoid unnecessary initializations.
13001 2011-05-27  Chong Yidong  <cyd@stupidchicken.com>
13003         * termhooks.h (Vselection_alist): Make it terminal-local.
13005         * terminal.c (create_terminal): Initialize it.
13007         * xselect.c: Support for clipboard managers.
13008         (Vselection_alist): Move to termhooks.h as terminal-local var.
13009         (LOCAL_SELECTION): New macro.
13010         (x_atom_to_symbol): Handle x_display_info_for_display fail case.
13011         (symbol_to_x_atom): Remove gratuitous arg.
13012         (x_handle_selection_request, lisp_data_to_selection_data)
13013         (x_get_foreign_selection, Fx_register_dnd_atom): Callers changed.
13014         (x_own_selection, x_get_local_selection, x_convert_selection):
13015         New arg, specifying work frame.  Use terminal-local Vselection_alist.
13016         (some_frame_on_display): Delete unused function.
13017         (Fx_own_selection_internal, Fx_get_selection_internal)
13018         (Fx_disown_selection_internal, Fx_selection_owner_p)
13019         (Fx_selection_exists_p): New optional frame arg.
13020         (frame_for_x_selection, Fx_clipboard_manager_save): New functions.
13021         (x_handle_selection_clear): Don't treat other terminals with the
13022         same keyboard specially.  Use the terminal-local Vselection_alist.
13023         (x_clear_frame_selections): Use Frun_hook_with_args.
13025         * xterm.c (x_term_init): Intern ATOM and CLIPBOARD_MANAGER atoms.
13027         * xterm.h: Add support for those atoms.
13029 2011-05-26  Chong Yidong  <cyd@stupidchicken.com>
13031         * xselect.c: ICCCM-compliant handling of MULTIPLE targets.
13032         (converted_selections, conversion_fail_tag): New global variables.
13033         (x_selection_request_lisp_error): Free the above.
13034         (x_get_local_selection): Remove unnecessary code.
13035         (x_reply_selection_request): Args changed; handle arbitrary array
13036         of converted selections stored in converted_selections.
13037         Separate the XChangeProperty and SelectionNotify steps.
13038         (x_handle_selection_request): Rewrite to handle MULTIPLE target.
13039         (x_convert_selection): New function.
13040         (x_handle_selection_event): Simplify.
13041         (x_get_foreign_selection): Don't ignore incoming requests while
13042         waiting for an answer; this will fail when we implement
13043         SAVE_TARGETS, and seems unnecessary anyway.
13044         (selection_data_to_lisp_data): Recognize ATOM_PAIR type.
13045         (Vx_sent_selection_functions): Doc fix.
13047 2011-05-26  Leo Liu  <sdl.web@gmail.com>
13049         * editfns.c (Ftranspose_regions): Allow empty regions.  (Bug#8699)
13051 2011-05-25  YAMAMOTO Mitsuharu  <mituharu@math.s.chiba-u.ac.jp>
13053         * dispextern.h (struct glyph_row): New member fringe_bitmap_periodic_p.
13055         * dispnew.c (shift_glyph_matrix, scrolling_window): Mark scrolled row
13056         for fringe update if it has periodic bitmap.
13057         (row_equal_p): Also compare left_fringe_offset, right_fringe_offset,
13058         and fringe_bitmap_periodic_p.
13060         * fringe.c (get_fringe_bitmap_data): New function.
13061         (draw_fringe_bitmap_1, update_window_fringes): Use it.
13062         (update_window_fringes): Record periodicity of fringe bitmap in glyph
13063         row.  Mark glyph row for fringe update if periodicity changed.
13065         * xdisp.c (try_window_reusing_current_matrix): Don't mark scrolled row
13066         for fringe update unless it has periodic bitmap.
13068 2011-05-25  Kenichi Handa  <handa@m17n.org>
13070         * xdisp.c (get_next_display_element): Set correct it->face_id for
13071         a static composition.
13073 2011-05-24  Leo Liu  <sdl.web@gmail.com>
13075         * deps.mk (fns.o):
13076         * makefile.w32-in ($(BLD)/fns.$(O)): Include sha1.h.
13078         * fns.c (crypto_hash_function, Fsha1): New function.
13079         (Fmd5): Use crypto_hash_function.
13080         (syms_of_fns): Add Ssha1.
13082 2011-05-22  Paul Eggert  <eggert@cs.ucla.edu>
13084         * gnutls.c: Remove unused macros.
13085         (fn_gnutls_transport_set_lowat, fn_gnutls_transport_set_pull_function):
13086         (fn_gnutls_transport_set_push_function) [!WINDOWSNT]:
13087         Remove macros that are defined and never used.
13088         Caught by gcc -Wunused-macros (GCC 4.6.0, Fedora 14).
13090 2011-05-22  Chong Yidong  <cyd@stupidchicken.com>
13092         * xselect.c (syms_of_xselect): Remove unused symbol SAVE_TARGETS.
13093         (Fx_get_selection_internal): Minor cleanup.
13094         (Fx_own_selection_internal): Rename arguments for consistency with
13095         select.el.
13097 2011-05-22  Paul Eggert  <eggert@cs.ucla.edu>
13099         * xselect.c (QSAVE_TARGETS): New static var, to fix build failure.
13101 2011-05-22  Chong Yidong  <cyd@stupidchicken.com>
13103         * xselect.c (syms_of_xselect): Include character.h; use DEFSYM.
13105 2011-05-21  YAMAMOTO Mitsuharu  <mituharu@math.s.chiba-u.ac.jp>
13107         * dispnew.c (scrolling_window): Don't exclude the case that the
13108         last enabled row in the desired matrix touches the bottom boundary.
13110 2011-05-21  Glenn Morris  <rgm@gnu.org>
13112         * Makefile.in ($(etc)/DOC): Make second command line even shorter.
13113         (SOME_MACHINE_OBJECTS): Replace FONT_OBJ by its maximal expansion,
13114         and add some more files.
13116 2011-05-20  Eli Zaretskii  <eliz@gnu.org>
13118         * callproc.c (Fcall_process) [MSDOS]: Fix arguments to
13119         report_file_error introduced by the change from 2011-05-07.
13121 2011-05-20  Paul Eggert  <eggert@cs.ucla.edu>
13123         * systime.h (Time): Define only if emacs is defined.
13124         This is to allow ../lib-src/profile.c to be compiled on FreeBSD,
13125         where the include path doesn't have X11/X.h by default.  See
13126         <http://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00561.html>.
13128 2011-05-20  Kenichi Handa  <handa@m17n.org>
13130         * composite.c (find_automatic_composition): Fix previous change.
13132 2011-05-20  Glenn Morris  <rgm@gnu.org>
13134         * lisp.mk: New file, split from Makefile.in.
13135         * Makefile.in (lisp): Move to separate file, inserted by @lisp_frag@.
13136         (shortlisp): Remove.
13137         ($(etc)/DOC): Edit lisp.mk rather than using $shortlisp.
13139 2011-05-19  Glenn Morris  <rgm@gnu.org>
13141         * Makefile.in (MSDOS_SUPPORT_REAL, MSDOS_SUPPORT, NS_SUPPORT)
13142         (REAL_MOUSE_SUPPORT, GPM_MOUSE_SUPPORT, MOUSE_SUPPORT, TOOLTIP_SUPPORT)
13143         (BASE_WINDOW_SUPPORT, X_WINDOW_SUPPORT, WINDOW_SUPPORT): Remove.
13144         (lisp): Set the order to that of loadup.el.
13145         (shortlisp): Make it a copy of $lisp.
13146         (SOME_MACHINE_LISP): Remove.
13147         ($(etc)/DOC): Depend just on $lisp, not $SOME_MACHINE_LISP too.
13148         Use just $shortlisp, not $SOME_MACHINE_LISP too.
13150 2011-05-18  Kenichi Handa  <handa@m17n.org>
13152         * composite.c (CHAR_COMPOSABLE_P): Add more check for efficiency.
13153         (BACKWARD_CHAR): Wrap the arg STOP by parenthesis.
13154         (find_automatic_composition): Mostly rewrite for efficiency.
13156 2011-05-18  Juanma Barranquero  <lekktu@gmail.com>
13158         * makefile.w32-in: Update dependencies.
13160 2011-05-18  Christoph Scholtes  <cschol2112@googlemail.com>
13162         * menu.c: Include limits.h (fixes the MS-Windows build broken by
13163         revision 104625).
13165 2011-05-18  Paul Eggert  <eggert@cs.ucla.edu>
13167         Fix some integer overflow issues, such as string length overflow.
13169         * insdel.c (count_size_as_multibyte): Check for string overflow.
13171         * character.c (lisp_string_width): Check for string overflow.
13172         Use EMACS_INT, not int, for string indexes and lengths; in
13173         particular, 2nd arg is now EMACS_INT, not int.  Do not crash if
13174         the resulting string length overflows an EMACS_INT; instead,
13175         report a string overflow if no precision given.  When checking for
13176         precision exhaustion, use a check that cannot possibly have
13177         integer overflow.  (Bug#8675)
13178         * character.h (lisp_string_width): Adjust to new signature.
13180         * alloc.c (string_overflow): New function.
13181         (Fmake_string): Use it.  This doesn't change behavior, but saves
13182         a few bytes and will simplify future changes.
13183         * character.c (string_escape_byte8): Likewise.
13184         * lisp.h (string_overflow): New decl.
13186         Fixups, following up to the user-interface timestamp change.
13187         * nsterm.m (last_mouse_movement_time, ns_mouse_position): Use Time
13188         for UI timestamps, instead of unsigned long.
13189         * msdos.c (mouse_get_pos): Likewise.
13190         * w32inevt.c (movement_time, w32_console_mouse_position): Likewise.
13191         * w32gui.h (Time): Define by including "systime.h" rather than by
13192         declaring it ourselves.  (Bug#8664)
13194         * dispextern.h (struct image): Don't assume time_t <= unsigned long.
13195         * image.c (clear_image_cache): Likewise.
13197         * term.c (term_mouse_position): Don't assume time_t wraparound.
13199         Be more systematic about user-interface timestamps.
13200         Before, the code sometimes used 'Time', sometimes 'unsigned long',
13201         and sometimes 'EMACS_UINT', to represent these timestamps.
13202         This change causes it to use 'Time' uniformly, as that's what X uses.
13203         This makes the code easier to follow, and makes it easier to catch
13204         integer overflow bugs such as Bug#8664.
13205         * frame.c (Fmouse_position, Fmouse_pixel_position):
13206         Use Time, not unsigned long, for user-interface timestamps.
13207         * keyboard.c (last_event_timestamp, kbd_buffer_get_event): Likewise.
13208         (button_down_time, make_lispy_position, make_lispy_movement): Likewise.
13209         * keyboard.h (last_event_timestamp): Likewise.
13210         * menu.c (Fx_popup_menu) [!HAVE_X_WINDOWS]: Likewise.
13211         * menu.h (xmenu_show): Likewise.
13212         * term.c (term_mouse_position): Likewise.
13213         * termhooks.h (struct input_event.timestamp): Likewise.
13214         (struct terminal.mouse_position_hook): Likewise.
13215         * xmenu.c (create_and_show_popup_menu, xmenu_show): Likewise.
13216         * xterm.c (XTmouse_position, x_scroll_bar_report_motion): Likewise.
13217         * systime.h (Time): New decl.  Pull it in from <X11/X.h> if
13218         HAVE_X_WINDOWS, otherwise define it as unsigned long, which is
13219         what it was before.
13220         * menu.h, termhooks.h: Include "systime.h", for Time.
13222         * keyboard.c (make_lispy_event): Fix problem in integer overflow.
13223         Don't assume that the difference between two unsigned long values
13224         can fit into an integer.  At this point, we know button_down_time
13225         <= event->timestamp, so the difference must be nonnegative, so
13226         there's no need to cast the result if double-click-time is
13227         nonnegative, as it should be; check that it's nonnegative, just in
13228         case.  This bug is triggered when events are more than 2**31 ms
13229         apart (about 25 days).  (Bug#8664)
13231         * xselect.c (last_event_timestamp): Remove duplicate decl.
13232         (x_own_selection): Remove needless cast to unsigned long.
13234         * xmenu.c (set_frame_menubar): Use int, not EMACS_UINT, for indexes
13235         that always fit in int.  Use a sentinel instead of a counter, to
13236         avoid a temp and to allay GCC's concerns about possible int overflow.
13237         * frame.h (struct frame): Use int for menu_bar_items_used
13238         instead of EMACS_INT, since it always fits in int.
13240         * menu.c (grow_menu_items): Check for int overflow.
13242         * xmenu.c (set_frame_menubar): Don't mishandle vectors with no nils.
13244         * xterm.c: Use EMACS_INT for Emacs modifiers, and int for X modifiers.
13245         Before, the code was not consistent.  These values cannot exceed
13246         2**31 - 1 so there's no need to make them unsigned.
13247         (x_x_to_emacs_modifiers): Accept int and return EMACS_INT.
13248         (x_emacs_to_x_modifiers): Accept EMACS_INT and return int.
13249         (x_x_to_emacs_modifiers, x_emacs_to_x_modifiers): Reject non-integers
13250         as modifiers.
13251         * xterm.h (x_x_to_emacs_modifiers): Adjust to signature change.
13253         * lisp.h (XINT) [USE_LISP_UNION_TYPE]: Cast to EMACS_INT.
13254         (XUINT) [USE_LISP_UNION_TYPE]: Cast to EMACS_UINT.
13255         Otherwise, GCC 4.6.0 warns about printf (pI, XINT (...)),
13256         presumably because the widths might not match.
13258         * window.c (size_window): Avoid needless test at loop start.
13260 2011-05-18  Courtney Bane  <emacs-bugs-7626@cbane.org>  (tiny change)
13262         * term.c (Fresume_tty): Restore hooks before reinitializing (bug#8687).
13264 2011-05-12  Drew Adams  <drew.adams@oracle.com>
13266         * textprop.c (Fprevious_single_char_property_change): Doc fix (bug#8655).
13268 2011-05-12  YAMAMOTO Mitsuharu  <mituharu@math.s.chiba-u.ac.jp>
13270         * w32term.c (w32_draw_fringe_bitmap): Rename local vars `left' and
13271         `width' to `bar_area_x' and `bar_area_width', respectively.
13272         (x_scroll_run): Take account of fringe background extension.
13274         * xterm.c (x_draw_fringe_bitmap) [USE_TOOLKIT_SCROLL_BARS]:
13275         Rename local vars `left' and `width' to `bar_area_x' and
13276         `bar_area_width', respectively.
13277         (x_scroll_run) [USE_TOOLKIT_SCROLL_BARS]: Take account of fringe
13278         background extension.
13280 2011-05-10  Jim Meyering  <meyering@redhat.com>
13282         * xdisp.c (x_intersect_rectangles): Fix typo "the the -> the".
13284 2011-05-10  Juanma Barranquero  <lekktu@gmail.com>
13286         * image.c (Finit_image_library): Return t for built-in image types,
13287         like pbm and xbm.  (Bug#8640)
13289 2011-05-09  Andreas Schwab  <schwab@linux-m68k.org>
13291         * w32menu.c (set_frame_menubar): Fix submenu allocation.
13293 2011-05-07  Eli Zaretskii  <eliz@gnu.org>
13295         * w32console.c (Fset_screen_color): Doc fix.
13296         (Fget_screen_color): New function.
13297         (syms_of_ntterm): Defsubr it.
13299         * callproc.c (call_process_cleanup) [MSDOS]: Don't close and
13300         unlink the temporary file if Fcall_process didn't create it in the
13301         first place.
13302         (Fcall_process) [MSDOS]: Don't create tempfile if stdout of the
13303         child process will be redirected to a file specified with `:file'.
13304         Don't try to re-open tempfile in that case, and set fd[0] to -1 as
13305         cue to call_process_cleanup not to close that handle.
13307 2011-05-07  Ben Key  <bkey76@gmail.com>
13309         * makefile.w32-in: The bootstrap-temacs rule now makes use of
13310         one of two shell specific rules, either bootstrap-temacs-CMD or
13311         bootstrap-temacs-SH.  The bootstrap-temacs-SH rule is identical
13312         to the previous implementation of the bootstrap-temacs rule.
13313         The bootstrap-temacs-CMD rule is similar to the previous
13314         implementation of the bootstrap-temacs rule except that it
13315         makes use of the ESC_CFLAGS variable instead of the CFLAGS
13316         variable.
13318         These changes, along with some changes to nt/configure.bat,
13319         nt/gmake.defs, and nt/nmake.defs, are required to extend my
13320         earlier fix to add support for --cflags and --ldflags options
13321         that include quotes so that it works whether make uses cmd or
13322         sh as the shell.
13324 2011-05-06  Michael Albinus  <michael.albinus@gmx.de>
13326         * dbusbind.c (QCdbus_type_unix_fd): Declare static.
13327         (xd_remove_watch): Don't check QCdbus_type_unix_fd for SYMBOLP, it
13328         is a constant.
13329         (Fdbus_init_bus, xd_read_queued_messages): Bus can be a symbol or
13330         a string.  Handle both cases.
13331         (Fdbus_call_method_asynchronously, Fdbus_register_signal)
13332         (Fdbus_register_method): Use Qinvalid_function.
13334 2011-05-06  Juanma Barranquero  <lekktu@gmail.com>
13336         * makefile.w32-in: Update dependencies.
13337         (LISP_H): Add inttypes.h and stdin.h.
13338         (PROCESS_H): Add unistd.h.
13340 2011-05-06  Eli Zaretskii  <eliz@gnu.org>
13342         * lread.c: Include limits.h (fixes the MS-Windows build broken by
13343         revision 104134).
13345 2011-05-06  Paul Eggert  <eggert@cs.ucla.edu>
13347         * image.c (Finit_image_library) [!HAVE_NTGUI]: Omit unused local.
13349         * term.c (vfatal): Remove stray call to va_end.
13350         It's not needed and the C Standard doesn't allow it here anyway.
13352         Use C99's va_copy to avoid undefined behavior on x86-64 GNU/Linux.
13353         * eval.c (verror): doprnt a copy of ap, not the original.  (Bug#8545)
13355         * eval.c (verror): OK to create a string of up to MOST_POSITIVE_FIXNUM
13356         bytes.
13358         * term.c: Don't include <stdarg.h>, as <lisp.h> does that.
13360         * callproc.c (Fcall_process): Use 'volatile' to avoid vfork clobbering.
13362         * process.c (Fformat_network_address): Fix typo: args2 -> *args2.
13364         * xmenu.c (set_frame_menubar): Fix typo: int * -> int (3 times).
13366         * coding.c (detect_coding_charset): Fix typo: * 2 -> *4 (Bug#8601).
13368         * charset.h (struct charset.code_space): Now has 15 elements, not 16.
13369         * charset.c (Fdefine_charset_internal): Don't initialize
13370         charset.code_space[15].  The value was garbage, on hosts with
13371         32-bit int (Bug#8600).
13373         * lread.c (read_integer): Be more consistent with string-to-number.
13374         Use string_to_number to do the actual conversion; this avoids
13375         rounding errors and fixes some other screwups.  Without this fix,
13376         for example, #x1fffffffffffffff was misread as -2305843009213693952.
13377         (digit_to_number): Move earlier, for benefit of read_integer.
13378         Return -1 if the digit is out of range for the base, -2 if it is
13379         not a digit in any supported base.  (Bug#8602)
13381         * doprnt.c (doprnt): Support arbitrary pI values, such as "I64".
13383         * dispnew.c (scrolling_window): Return 1 if we scrolled,
13384         to match comment at start of function.  This also removes a
13385         GCC warning about overflow in a 32+64-bit port.
13387         * lisp.h (EMACS_INT, EMACS_UINT, BITS_PER_EMACS_INT, pI): Simplify.
13389         * dbusbind.c: Do not use XPNTR on a value that may be an integer.
13390         Reported by Stefan Monnier in
13391         <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00919.html>.
13392         (xd_remove_watch, Fdbus_init_bus, xd_read_queued_messages):
13393         Use SYMBOLP-guarded XSYMBOL, not XPNTR.
13395         * lisp.h (EMACS_INTPTR): Remove.  All uses changed to intptr_t.
13396         (EMACS_UINTPTR): Likewise, with uintptr_t.
13398         * lisp.h: Prefer 64-bit EMACS_INT if available.
13399         (EMACS_INT, EMACS_UINT, BITS_PER_EMACS_INT, pI): Define to 64-bit
13400         on 32-bit hosts that have 64-bit int, so that they can access
13401         large files.
13402         However, temporarily disable this change unless the temporary
13403         symbol WIDE_EMACS_INT is defined.
13405         * lread.c, process.c: Do not include <inttypes.h>; lisp.h does it now.
13407         Prefer intptr_t/uintptr_t for integers the same widths as pointers.
13408         This removes an assumption that EMACS_INT and long are the same
13409         width as pointers.  The assumption is true for Emacs porting targets
13410         now, but we want to make other targets possible.
13411         * lisp.h: Include <inttypes.h>, for INTPTR_MAX, UINTPTR_MAX.
13412         (EMACS_INTPTR, EMACS_UINTPTR): New macros.
13413         In the rest of the code, change types of integers that hold casted
13414         pointers to EMACS_INTPTR and EMACS_UINTPTR, systematically
13415         replacing EMACS_INT, long, EMACS_UINT, and unsigned long.
13416         (XTYPE): Don't cast arg to EMACS_UINT; normally is not needed.
13417         (XSET): Cast type of XTYPE arg to EMACS_INTPTR; it is needed here.
13418         No need to cast type when ORing.
13419         (XPNTR): Return a value of type EMACS_INTPTR or EMACS_UINTPTR.
13420         * alloc.c (lisp_align_malloc): Remove a no-longer-needed cast.
13421         * doc.c (store_function_docstring): Use EMACS_INTPTR, so as not to
13422         assume EMACS_INT is the same width as char *.
13423         * gtkutil.c (xg_gtk_scroll_destroy, xg_tool_bar_button_cb):
13424         (xg_tool_bar_callback, xg_tool_bar_help_callback, xg_make_tool_item):
13425         Remove no-longer-needed casts.
13426         (xg_create_scroll_bar, xg_tool_bar_button_cb, xg_tool_bar_callback):
13427         (xg_tool_bar_help_callback, xg_make_tool_item):
13428         Use EMACS_INTPTR to hold an integer
13429         that will be cast to void *; this can avoid a GCC warning
13430         if EMACS_INT is not the same width as void *.
13431         * menu.c (find_and_call_menu_selection): Remove no-longer-needed cast.
13432         * xdisp.c (display_echo_area_1, resize_mini_window_1):
13433         (current_message_1, set_message_1):
13434         Use a local to convert to proper width without a cast.
13435         * xmenu.c (dialog_selection_callback): Likewise.
13437         * sysdep.c (get_random): Don't assume EMACS_INT is no wider than long.
13438         Also, don't assume VALBITS / RAND_BITS is less than 5,
13439         and don't rely on undefined behavior when shifting a 1 left into
13440         the sign bit.
13441         * lisp.h (get_random): Change signature to match.
13443         * lread.c (hash_string): Use size_t, not int, for hash computation.
13444         Normally we prefer signed values; but hashing is special, because
13445         it's better to use unsigned division on hash table sizes so that
13446         the remainder is nonnegative.  Also, size_t is the natural width
13447         for hashing into memory.  The previous code used 'int', which doesn't
13448         retain enough info to hash well into very large tables.
13449         (oblookup, oblookup_last_bucket_number, Funintern): Likewise.
13451         * dbusbind.c: Don't possibly lose pointer info when converting.
13452         (xd_remove_watch, Fdbus_init_bus, xd_read_queued_messages):
13453         Use XPNTR rather than XHASH, so that the high-order bits of
13454         the pointer aren't lost when converting through void *.
13456         * eval.c (Fautoload): Don't double-shift a pointer.
13458         * fns.c (Frandom): Let EMACS_UINT be wider than unsigned long.
13460 2011-05-06  Juanma Barranquero  <lekktu@gmail.com>
13462         * gnutls.c (DEF_GNUTLS_FN):
13463         * image.c (DEF_IMGLIB_FN): Make function pointers static.
13465 2011-05-05  Andreas Schwab  <schwab@linux-m68k.org>
13467         * lread.c (lisp_file_lexically_bound_p): Stop scanning at end
13468         marker.  (Bug#8610)
13470 2011-05-05  Eli Zaretskii  <eliz@gnu.org>
13472         * w32heap.c (allocate_heap) [USE_LISP_UNION_TYPE || USE_LSB_TAG]:
13473         New version that can reserve upto 2GB of heap space.
13475 2011-05-05  Chong Yidong  <cyd@stupidchicken.com>
13477         * nsfns.m (Fns_read_file_name): Doc fix (Bug#8534).
13479 2011-05-05  Teodor Zlatanov  <tzz@lifelogs.com>
13481         * gnutls.c (fn_gnutls_certificate_set_x509_key_file): Add alias to
13482         `gnutls_certificate_set_x509_key_file'.
13484 2011-05-05  Juanma Barranquero  <lekktu@gmail.com>
13486         * makefile.w32-in ($(BLD)/image.$(O), $(BLD)/process.$(O)):
13487         Update dependencies.
13489 2011-05-04  Juanma Barranquero  <lekktu@gmail.com>
13491         * gnutls.h (emacs_gnutls_write, emacs_gnutls_read):
13492         * gnutls.c (emacs_gnutls_write, emacs_gnutls_read):
13493         Remove unused parameter `fildes'.
13494         * process.c (read_process_output, send_process): Don't pass it.
13496 2011-05-04  Juanma Barranquero  <lekktu@gmail.com>
13498         Fix previous change: the library cache is defined in w32.c.
13499         * image.c (CACHE_IMAGE_TYPE) [!HAVE_NTGUI]: Define to noop.
13500         (Finit_image_library): Wrap Vlibrary_cache on "#ifdef HAVE_NTGUI".
13502 2011-05-04  Juanma Barranquero  <lekktu@gmail.com>
13504         Implement dynamic loading of GnuTLS on Windows.
13506         * gnutls.h (GNUTLS_EMACS_ERROR_NOT_LOADED): New macro.
13507         (emacs_gnutls_write, emacs_gnutls_read): Mark as extern.
13508         (emacs_gnutls_record_check_pending, emacs_gnutls_transport_set_errno):
13509         Declare.
13511         * gnutls.c (Qgnutls_dll): Define.
13512         (DEF_GNUTLS_FN, LOAD_GNUTLS_FN): New macros.
13513         (gnutls_*): Declare function pointers.
13514         (init_gnutls_functions): New function to initialize function pointers.
13515         (emacs_gnutls_handshake, Fgnutls_error_string, Fgnutls_deinit)
13516         (emacs_gnutls_global_init, Fgnutls_bye): Use function pointers.
13517         (emacs_gnutls_record_check_pending, emacs_gnutls_transport_set_errno):
13518         Wrappers for gnutls_record_check_pending and gnutls_transport_set_errno.
13519         (emacs_gnutls_write, emacs_gnutls_read)
13520         (emacs_gnutls_handle_error, Fgnutls_error_fatalp)
13521         (Fgnutls_available_p): New function.
13522         (Fgnutls_boot): Call Fgnutls_available_p.  Use function pointers.
13523         (syms_of_gnutls) <Qgnutls_dll>: Initialize and staticpro it.
13524         (syms_of_gnutls) <Sgnutls_available_p>: defsubr it.
13526         * image.c: Include w32.h.
13527         (Vimage_type_cache): Delete.
13528         (syms_of_image) <Vimage_type_cache>: Don't initialize and staticpro it.
13529         (CACHE_IMAGE_TYPE, Finit_image_library): Use Vlibrary_cache instead.
13530         (w32_delayed_load): Move to w32.c.
13532         * w32.h (VlibraryCache, QCloaded_from, w32_delayed_load): Declare.
13534         * w32.c (QCloaded_from, Vlibrary_cache): Define.
13535         (w32_delayed_load): Move from image.c.  When loading a library, record
13536         its filename in the :loaded-from property of the library id.
13537         (globals_of_w32) <QCloaded_from, Vlibrary_cache>:
13538         Initialize and staticpro them.
13539         (emacs_gnutls_pull, emacs_gnutls_push): Call emacs_gnutls_* functions.
13541         * process.c: Include lisp.h before w32.h, not after.
13542         (wait_reading_process_output): Call emacs_gnutls_record_check_pending
13543         instead of gnutls_record_check_pending.
13545         * callproc.c, emacs.c: Include lisp.h before w32.h, not after.
13547 2011-05-04  Teodor Zlatanov  <tzz@lifelogs.com>
13549         * gnutls.c (Fgnutls_boot): Support :keylist and :crlfiles options
13550         instead of :keyfiles.  Give GnuTLS the keylist and the CRL lists
13551         as passed in.
13553 2011-05-03  Jan Djärv  <jan.h.d@swipnet.se>
13555         * xterm.c (x_set_frame_alpha): Do not set property on anything
13556         else than FRAME_X_OUTER_WINDOW (Bug#8608).
13558 2011-05-02  Juanma Barranquero  <lekktu@gmail.com>
13560         * sysdep.c (get_tty_size) [WINDOWSNT]: Implement.  (Bug#8596)
13562 2011-05-02  Juanma Barranquero  <lekktu@gmail.com>
13564         * gnutls.c (Qgnutls_log_level, Qgnutls_code, Qgnutls_anon)
13565         (Qgnutls_x509pki, Qgnutls_e_interrupted, Qgnutls_e_again)
13566         (Qgnutls_e_invalid_session, Qgnutls_e_not_ready_for_handshake)
13567         (gnutls_global_initialized, Qgnutls_bootprop_priority)
13568         (Qgnutls_bootprop_trustfiles, Qgnutls_bootprop_keyfiles)
13569         (Qgnutls_bootprop_callbacks, Qgnutls_bootprop_loglevel)
13570         (Qgnutls_bootprop_hostname, Qgnutls_bootprop_verify_flags)
13571         (Qgnutls_bootprop_verify_error, Qgnutls_bootprop_verify_hostname_error)
13572         (Qgnutls_bootprop_callbacks_verify): Make static.
13574 2011-05-01  Andreas Schwab  <schwab@linux-m68k.org>
13576         * callproc.c: Indentation fixup.
13578         * sysdep.c (wait_for_termination_1): Make static.
13579         (wait_for_termination, interruptible_wait_for_termination):
13580         Move after wait_for_termination_1.
13582 2011-05-01  Lars Magne Ingebrigtsen  <larsi@gnus.org>
13584         * sysdep.c (interruptible_wait_for_termination): New function
13585         which is like wait_for_termination, but allows keyboard
13586         interruptions.
13588         * callproc.c (Fcall_process): Add (:file "file") as an option for
13589         the STDOUT buffer.
13590         (Fcall_process_region): Ditto.
13592 2011-04-30  Eli Zaretskii  <eliz@gnu.org>
13594         * dosfns.c (Fint86, Fdos_memget, Fdos_memput): Use `ASIZE (FOO)'
13595         rather than `XVECTOR (FOO)->size'.
13597         * process.c: Remove HAVE_INTTYPES_H condition from inclusion of
13598         inttypes.h, as a gnulib replacement is used if it not available in
13599         system headers.
13601 2011-04-21  Eli Zaretskii  <eliz@gnu.org>
13603         Lift the MOST_POSITIVE_FIXNUM/4 limitation on visited files.
13604         * fileio.c (Finsert_file_contents): Don't limit file size to 1/4
13605         of MOST_POSITIVE_FIXNUM.  (Bug#8528)
13607         * coding.c (coding_alloc_by_realloc): Error out if destination
13608         will grow beyond MOST_POSITIVE_FIXNUM.
13609         (decode_coding_emacs_mule): Abort if there isn't enough place in
13610         charbuf for the composition carryover bytes.  Reserve an extra
13611         space for up to 2 characters produced in a loop.
13612         (decode_coding_iso_2022): Abort if there isn't enough place in
13613         charbuf for the composition carryover bytes.
13615 2011-04-21  Eli Zaretskii  <eliz@gnu.org>
13617         * doprnt.c (doprnt) [!HAVE_LONG_LONG_INT]: Error out instead of
13618         aborting when %lld or %lll format is passed.
13619         [!HAVE_UNSIGNED_LONG_LONG_INT]: Error out instead of aborting when
13620         %llo or %llx format is passed.  (Bug#8545)
13622         * window.c (window_scroll_line_based): Use a marker instead of
13623         simple variables to record original value of point.  (Bug#7952)
13625         * doprnt.c (doprnt): Fix the case where a multibyte sequence
13626         produced by %s or %c overflows available buffer space.  (Bug#8545)
13628 2011-04-28  Paul Eggert  <eggert@cs.ucla.edu>
13630         * doprnt.c (doprnt): Omit useless test; int overflow check (Bug#8545).
13631         (SIZE_MAX): Move defn after all includes, as they might #define it.
13633 2011-04-28  Juanma Barranquero  <lekktu@gmail.com>
13635         * w32.c (init_environment): Warn about defaulting HOME to C:\.
13637 2011-04-28  Juanma Barranquero  <lekktu@gmail.com>
13639         * keyboard.c (Qdelayed_warnings_hook): Define.
13640         (command_loop_1): Run `delayed-warnings-hook'
13641         if Vdelayed_warnings_list is non-nil.
13642         (syms_of_keyboard) <delayed-warnings-hook>: DEFSYM it.
13643         (syms_of_keyboard) <delayed-warnings-list>: DEFVAR_LISP it.
13645 2011-04-28  Eli Zaretskii  <eliz@gnu.org>
13647         * doprnt.c (doprnt): Don't return value smaller than the buffer
13648         size if the message was truncated.  (Bug#8545).
13650 2011-04-28  Juanma Barranquero  <lekktu@gmail.com>
13652         * w32fns.c (Fx_change_window_property, Fx_delete_window_property)
13653         (Fx_window_property): #if-0 the whole functions, not just the bodies.
13655 2011-04-27  Paul Eggert  <eggert@cs.ucla.edu>
13657         * doprnt.c (doprnt): Support "ll" length modifier, for long long.
13659 2011-04-27  Juanma Barranquero  <lekktu@gmail.com>
13661         * makefile.w32-in: Update dependencies.
13663 2011-04-27  Eli Zaretskii  <eliz@gnu.org>
13665         Improve `doprnt' and its usage.  (Bug#8545)
13666         * doprnt.c (doprnt): Make sure `format' is never accessed beyond
13667         `format_end'.  Remove support for %l as a conversion specifier.
13668         Don't use xrealloc.  Improve diagnostics when the %l size modifier
13669         is used.  Update the commentary.
13671         * eval.c (verror): Simplify calculation of size_t.
13673         * coding.c (Ffind_operation_coding_system): Fix diagnostic error
13674         messages.
13676 2011-04-27  Yoshiaki Kasahara  <kasahara@nc.kyushu-u.ac.jp>  (tiny change)
13678         * buffer.c (init_buffer) [USE_MMAP_FOR_BUFFERS]: Adjust to aliasing
13679         change.
13681 2011-04-27  Paul Eggert  <eggert@cs.ucla.edu>
13683         * nsmenu.m: Replace all uses of XVECTOR with ASIZE and AREF.
13684         This makes this file independent of the recent pseudovector change.
13686 2011-04-26  Paul Eggert  <eggert@cs.ucla.edu>
13688         * keyboard.c (handle_user_signal): Fix pointer signedness problem.
13690         * gnutls.c (emacs_gnutls_handle_error): Remove unused local.
13691         (Fgnutls_boot): gnutls_certificate_verify_peers2 wants unsigned *.
13692         Remove unused local.
13693         (emacs_gnutls_write): Don't use uninitialized rtnval if nbyte <= 0.
13695         * lisp.h: Fix a problem with aliasing and vector headers.  (Bug#8546)
13696         GCC 4.6.0 optimizes based on type-based alias analysis.
13697         For example, if b is of type struct buffer * and v of type struct
13698         Lisp_Vector *, then gcc -O2 was incorrectly assuming that &b->size
13699         != &v->size, and therefore "v->size = 1; b->size = 2; return
13700         v->size;" must therefore return 1.  This assumption is incorrect
13701         for Emacs, since it type-puns struct Lisp_Vector * with many other
13702         types.  To fix this problem, this patch adds a new type struct
13703         vectorlike_header that documents the constraints on layout of vectors
13704         and pseudovectors, and helps optimizing compilers not get fooled
13705         by Emacs's type punning.  It also adds the macros XSETTYPED_PVECTYPE
13706         XSETTYPED_PSEUDOVECTOR, TYPED_PSEUDOVECTORP, for similar reasons.
13707         * lisp.h (XSETTYPED_PVECTYPE): New macro, specifying the name of
13708         the size member.
13709         (XSETPVECTYPE): Rewrite in terms of new macro.
13710         (XSETPVECTYPESIZE): New macro, specifying both type and size.
13711         This is a bit clearer, and further avoids the possibility of
13712         undesirable aliasing.
13713         (XSETTYPED_PSEUDOVECTOR): New macro, specifying the size.
13714         (XSETPSEUDOVECTOR): Rewrite in terms of XSETTYPED_PSEUDOVECTOR.
13715         (XSETSUBR): Rewrite in terms of XSETTYPED_PSEUDOVECTOR and XSIZE,
13716         since Lisp_Subr is a special case (no "next" field).
13717         (ASIZE): Now uses header.size rather than size.
13718         All previous uses of XVECTOR (foo)->size replaced to use this macro,
13719         to avoid the hassle of writing XVECTOR (foo)->header.size.
13720         (struct vectorlike_header): New type.
13721         (TYPED_PSEUDOVECTORP): New macro, also specifying the C type of the
13722         object, to help avoid aliasing.
13723         (PSEUDOVECTORP): Rewrite in terms of TYPED_PSEUDOVECTORP.
13724         (SUBRP): Likewise, since Lisp_Subr is a special case.
13725         * lisp.h (struct Lisp_Vector, struct Lisp_Char_Table):
13726         (struct Lisp_Sub_Char_Table, struct Lisp_Bool_Vector):
13727         (struct Lisp_Hash_Table): Combine first two members into a single
13728         struct vectorlike_header member.  All uses of "size" and "next" members
13729         changed to be "header.size" and "header.next".
13730         * buffer.h (struct buffer): Likewise.
13731         * font.h (struct font_spec, struct font_entity, struct font): Likewise.
13732         * frame.h (struct frame): Likewise.
13733         * process.h (struct Lisp_Process): Likewise.
13734         * termhooks.h (struct terminal): Likewise.
13735         * window.c (struct save_window_data, struct saved_window): Likewise.
13736         * window.h (struct window): Likewise.
13737         * alloc.c (allocate_buffer, Fmake_bool_vector, allocate_pseudovector):
13738         Use XSETPVECTYPESIZE, not XSETPVECTYPE, to avoid aliasing problems.
13739         * buffer.c (init_buffer_once): Likewise.
13740         * lread.c (defsubr): Use XSETTYPED_PVECTYPE, since Lisp_Subr is a
13741         special case.
13742         * process.c (Fformat_network_address): Use local var for size,
13743         for brevity.
13745         * bytecode.c (exec_byte_code): Don't use XVECTOR before CHECK_VECTOR.
13747         Make the Lisp reader and string-to-float more consistent (Bug#8525)
13748         * data.c (atof): Remove decl; no longer used or needed.
13749         (digit_to_number): Move to lread.c.
13750         (Fstring_to_number): Use new string_to_number function, to be
13751         consistent with how the Lisp reader treats infinities and NaNs.
13752         Do not assume that floating-point numbers represent EMACS_INT
13753         without losing information; this is not true on most 64-bit hosts.
13754         Avoid double-rounding errors, by insisting on integers when
13755         parsing non-base-10 numbers, as the documentation specifies.
13756         * lisp.h (string_to_number): New decl, replacing ...
13757         (isfloat_string): Remove.
13758         * lread.c: Include <inttypes.h>, for uintmax_t and strtoumax.
13759         (read1): Do not accept +. and -. as integers; this
13760         appears to have been a coding error.  Similarly, do not accept
13761         strings like +-1e0 as floating point numbers.  Do not report
13762         overflow for integer overflows unless the base is not 10 which
13763         means we have no simple and reliable way to continue.
13764         Break out the floating-point parsing into a new
13765         function string_to_number, so that Fstring_to_number parses
13766         floating point numbers consistently with the Lisp reader.
13767         (digit_to_number): Move here from data.c.  Make it static inline.
13768         (E_CHAR, EXP_INT): Remove, replacing with ...
13769         (E_EXP): New macro, to solve the "1.0e+" problem mentioned below.
13770         (string_to_number): New function, replacing isfloat_string.
13771         This function checks for valid syntax and produces the resulting
13772         Lisp float number too.  Rework it so that string-to-number
13773         no longer mishandles examples like "1.0e+".  Use strtoumax,
13774         so that overflow for non-base-10 numbers is reported only when
13775         there's no portable and simple way to convert to floating point.
13777         * textprop.c (set_text_properties_1): Rewrite for clarity,
13778         and to avoid GCC warning about integer overflow.
13780         * intervals.h (struct interval): Use EMACS_INT for members
13781         where EMACS_UINT might cause problems.  See
13782         <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00514.html>.
13783         (CHECK_TOTAL_LENGTH): Remove cast to EMACS_INT; no longer needed.
13784         * intervals.c (interval_deletion_adjustment): Now returns EMACS_INT.
13785         All uses changed.
13786         (offset_intervals): Tell GCC not to worry about length overflow
13787         when negating a negative length.
13789         * alloc.c (overrun_check_malloc, overrun_check_realloc): Now static.
13790         (overrun_check_free): Likewise.
13792         * alloc.c (SDATA_SIZE) [!GC_CHECK_STRING_BYTES]: Avoid runtime check
13793         in the common case where SDATA_DATA_OFFSET is a multiple of Emacs
13794         word size.
13796         * gnutls.c: Fix problems found by GCC 4.6.0 on Ubuntu 10.10.
13797         (gnutls_make_error): Rename local to avoid shadowing.
13798         (gnutls_emacs_global_deinit): ifdef out; not used.
13799         (Fgnutls_boot): Use const for pointer to readonly storage.
13800         Comment out unused local.  Fix pointer signedness problems.
13802         * lread.c (openp): Don't stuff size_t into an 'int'.
13803         Use <= on length, not < on length + 1, to avoid GCC 4.6.0 warning
13804         about possible signed overflow.
13806         * gtkutil.c: Fix problems found by GCC 4.6.0 on Ubuntu 10.10.
13807         (GDK_KEY_g): Don't define if already defined.
13808         (xg_prepare_tooltip): Avoid pointer signedness problem.
13809         (xg_set_toolkit_scroll_bar_thumb): Redo to avoid two casts.
13811         * process.c (Fnetwork_interface_info): Avoid left-shift undefined
13812         behavior with 1 << 31.  GCC 4.6.0 warns about this on 32-bit hosts.
13814         * xfns.c (Fx_window_property): Simplify a bit,
13815         to make a bit faster and to avoid GCC 4.6.0 warning.
13816         * xselect.c (x_get_window_property, x_handle_dnd_message): Likewise.
13818         * fns.c (internal_equal): Don't assume size_t fits in int.
13820         * alloc.c (compact_small_strings): Tighten assertion a little.
13822         Replace pEd with more-general pI, and fix some printf arg casts.
13823         * lisp.h (pI): New macro, generalizing old pEd macro to other
13824         conversion specifiers.  For example, use "...%"pI"d..." rather
13825         than "...%"pEd"...".
13826         (pEd): Remove.  All uses replaced with similar uses of pI.
13827         * m/amdx86-64.h, m/ia64.h, m/ibms390x.h: Likewise.
13828         * alloc.c (check_pure_size): Don't overflow by converting size to int.
13829         * bidi.c (bidi_dump_cached_states): Use pI to avoid cast.
13830         * data.c (Fnumber_to_string): Use pI instead of if-then-else-abort.
13831         * dbusbind.c (xd_append_arg): Use pI to avoid cast.
13832         (Fdbus_method_return_internal, Fdbus_method_error_internal): Likewise.
13833         * font.c (font_unparse_xlfd): Avoid potential buffer overrun on
13834         64-bit hosts.
13835         (font_unparse_xlfd, font_unparse_fcname): Use pI to avoid casts.
13836         * keyboard.c (record_char, modify_event_symbol): Use pI to avoid casts.
13837         * print.c (safe_debug_print, print_object): Likewise.
13838         (print_object): Don't overflow by converting EMACS_INT or EMACS_UINT
13839         to int.
13840         Use pI instead of if-then-else-abort.  Use %p to avoid casts,
13841         avoiding the 0 flag, which is not portable.
13842         * process.c (Fmake_network_process): Use pI to avoid cast.
13843         * region-cache.c (pp_cache): Likewise.
13844         * xdisp.c (decode_mode_spec): Likewise.
13845         * xrdb.c (x_load_resources) [USE_MOTIF]: Use pI to avoid undefined
13846         behavior on 64-bit hosts with printf arg.
13847         * xselect.c (x_queue_event): Use %p to avoid casts, avoiding 0 flag.
13848         (x_stop_queuing_selection_requests): Likewise.
13849         (x_get_window_property): Don't truncate byte count to an 'int'
13850         when tracing.
13852         * frame.c (frame_name_fnn_p): Get rid of strtol, which isn't right
13853         here, since it parses constructs like leading '-' and spaces,
13854         which are not wanted; and it overflows with large numbers.
13855         Instead, simply match F[0-9]+, which is what is wanted anyway.
13857         * alloc.c: Remove unportable assumptions about struct layout.
13858         (SDATA_SELECTOR, SDATA_DATA_OFFSET): New macros.
13859         (SDATA_OF_STRING, SDATA_SIZE, allocate_string_data):
13860         (allocate_vectorlike, make_pure_vector): Use the new macros,
13861         plus offsetof, to remove unportable assumptions about struct layout.
13862         These assumptions hold on all porting targets that I know of, but
13863         they are not guaranteed, they're easy to remove, and removing them
13864         makes further changes easier.
13866         * alloc.c (BLOCK BYTES): Fix typo by changing "ablock" to "ablocks".
13867         This doesn't fix a bug but makes the code clearer.
13868         (string_overrun_cookie): Now const.  Use initializers that
13869         don't formally overflow signed char, to avoid warnings.
13870         (allocate_string_data) [GC_CHECK_STRING_OVERRUN]: Fix typo that
13871         can cause Emacs to crash when string overrun checking is enabled.
13872         (allocate_buffer): Don't assume sizeof (struct buffer) is a
13873         multiple of sizeof (EMACS_INT); it need not be, if
13874         alignof(EMACS_INT) < sizeof (EMACS_INT).
13875         (check_sblock, check_string_bytes, check_string_free_list): Protoize.
13877 2011-04-26  Juanma Barranquero  <lekktu@gmail.com>
13879         * keyboard.c (QCrtl): Rename from Qrtl.  All uses changed.
13881 2011-04-26  Teodor Zlatanov  <tzz@lifelogs.com>
13883         * gnutls.c (emacs_gnutls_handshake): Return an error if we're not
13884         supposed to be handshaking.  (Bug#8556)
13885         Reported by Paul Eggert <eggert@cs.ucla.edu>.
13887 2011-04-26  Daniel Colascione  <dan.colascione@gmail.com>
13889         * lisp.h (Qdebug): List symbol.
13890         * eval.c (Qdebug): Restore global linkage.
13891         * keyboard.c (debug-on-event): New variable.
13892         (handle_user_signal): Break into debugger when debug-on-event
13893         matches the current signal symbol.
13895 2011-04-25  Dan Nicolaescu  <dann@ics.uci.edu>
13897         * alloc.c (check_sblock, check_string_bytes)
13898         (check_string_free_list): Convert to standard C.
13900 2011-04-25  Teodor Zlatanov  <tzz@lifelogs.com>
13902         * w32.c (emacs_gnutls_push): Fix typo.
13904 2011-04-25  Eli Zaretskii  <eliz@gnu.org>
13906         * gnutls.c (emacs_gnutls_handshake): Avoid compiler warnings about
13907         "cast to pointer from integer of different size".
13909         Improve doprnt and its use in verror.  (Bug#8545)
13910         * doprnt.c (doprnt): Document the set of format control sequences
13911         supported by the function.  Use SAFE_ALLOCA instead of always
13912         using `alloca'.
13914         * eval.c (verror): Don't limit the buffer size at size_max-1, that
13915         is one byte too soon.  Don't use xrealloc; instead xfree and
13916         xmalloc anew.
13918 2011-04-24  Teodor Zlatanov  <tzz@lifelogs.com>
13920         * gnutls.h: Add GNUTLS_STAGE_CALLBACKS enum to denote we're in the
13921         callbacks stage.
13923         * gnutls.c: Renamed global_initialized to
13924         gnutls_global_initialized.  Added internals for the
13925         :verify-hostname-error, :verify-error, and :verify-flags
13926         parameters of `gnutls-boot' and documented those parameters in the
13927         docstring.  Start callback support.
13928         (emacs_gnutls_handshake): Add Woe32 support.  Retry handshake
13929         unless a fatal error occurred.  Call gnutls_alert_send_appropriate
13930         on error.  Return error code.
13931         (emacs_gnutls_write): Call emacs_gnutls_handle_error.
13932         (emacs_gnutls_read): Likewise.
13933         (Fgnutls_boot): Return handshake error code.
13934         (emacs_gnutls_handle_error): New function.
13935         (wsaerror_to_errno): Likewise.
13937         * w32.h (emacs_gnutls_pull): Add prototype.
13938         (emacs_gnutls_push): Likewise.
13940         * w32.c (emacs_gnutls_pull): New function for GnuTLS on Woe32.
13941         (emacs_gnutls_push): Likewise.
13943 2011-04-24  Claudio Bley  <claudio.bley@gmail.com>  (tiny change)
13945         * process.c (wait_reading_process_output): Check if GnuTLS
13946         buffered some data internally if no FDs are set for TLS
13947         connections.
13949         * makefile.w32-in (OBJ2): Add gnutls.$(O).
13950         (LIBS): Link to USER_LIBS.
13951         ($(BLD)/gnutls.$(0)): New target.
13953 2011-04-24  Eli Zaretskii  <eliz@gnu.org>
13955         * xdisp.c (handle_single_display_spec): Rename the
13956         display_replaced_before_p argument into display_replaced_p, to
13957         make it consistent with the commentary.  Fix typos in the
13958         commentary.
13960         * textprop.c (syms_of_textprop): Remove dead code.
13961         (copy_text_properties): Delete obsolete commentary about an
13962         interface that was deleted long ago.  Fix typos in the description
13963         of arguments.
13965         * msdos.c (XMenuActivate, XMenuAddSelection): Adjust argument list
13966         to changes in oldXMenu/XMenu.h from 2011-04-16.
13967         <menu_help_message, prev_menu_help_message>: Constify.
13968         (IT_menu_make_room): menu->help_text is now `const char **';
13969         adjust.
13971         * msdos.h (XMenuActivate, XMenuAddSelection): Adjust prototypes
13972         to changes in oldXMenu/XMenu.h from 2011-04-16.
13973         (struct XMenu): Declare `help_text' `const char **'.
13975         * xfaces.c <Qunspecified>: Make extern again.
13977         * syntax.c: Include sys/types.h before including regex.h, as
13978         required by POSIX.
13980         * doc.c (get_doc_string): Improve the format passed to `error'.
13982         * doprnt.c (doprnt): Improve commentary.
13984         * term.c (init_tty) [MSDOS]: Fix 1st argument to maybe_fatal.
13986         * Makefile.in (TAGS): Depend on $(M_FILE) and $(S_FILE), and scan
13987         them with etags.
13989         * makefile.w32-in (globals.h): Add a dummy recipe, to make any
13990         changes in globals.h immediately force recompilation.
13991         (TAGS): Depend on $(CURDIR)/m/intel386.h and
13992         $(CURDIR)/s/ms-w32.h.
13993         (TAGS-gmake): Scan $(CURDIR)/m/intel386.h and $(CURDIR)/s/ms-w32.h.
13995         * character.c (Fchar_direction): Function deleted.
13996         (syms_of_character): Don't defsubr it.
13997         <char-direction-table>: Deleted.
13999 2011-04-23  Eli Zaretskii  <eliz@gnu.org>
14001         Fix doprnt so it could be used again safely in `verror'.  (Bug#8435)
14002         * doprnt.c: Include limits.h.
14003         (SIZE_MAX): New macro.
14004         (doprnt): Return a size_t value.  2nd arg is now size_t.
14005         Many local variables are now size_t instead of int or unsigned.
14006         Improve overflow protection.  Support `l' modifier for integer
14007         conversions.  Support %l conversion.  Don't assume an EMACS_INT
14008         argument for integer conversions and for %c.
14010         * lisp.h (doprnt): Restore prototype.
14012         * makefile.w32-in ($(BLD)/callint.$(O)): Depend on
14013         $(SRC)/character.h.
14015         * Makefile.in (base_obj): Add back doprnt.o.
14017         * deps.mk (doprnt.o): Add back prerequisites.
14018         (callint.o): Depend on character.h.
14020         * eval.c (internal_lisp_condition_case): Include the handler
14021         representation in the error message.
14022         (verror): Call doprnt instead of vsnprintf.  Fix an off-by-one bug
14023         when breaking from the loop.
14025         * xdisp.c (vmessage): Call doprnt instead of vsnprintf.
14027         * callint.c (Fcall_interactively): When displaying error message
14028         about invalid control letter, pass the character's codepoint, not
14029         a pointer to its multibyte form.  Improve display of the character
14030         in octal and display also its hex code.
14032         * character.c (char_string): Use %x to display the (unsigned)
14033         codepoint of an invalid character, to avoid displaying a bogus
14034         negative value.
14036         * font.c (check_otf_features): Pass SDATA of SYMBOL_NAME to
14037         `error', not SYMBOL_NAME itself.
14039         * coding.c (Fencode_sjis_char, Fencode_big5_char): Use %c for
14040         character arguments to `error'.
14042         * charset.c (check_iso_charset_parameter): Fix incorrect argument
14043         to `error' in error message about FINAL_CHAR argument.  Make sure
14044         FINAL_CHAR is a character, and use %c when it is passed as
14045         argument to `error'.
14047 2011-04-23  Eli Zaretskii  <eliz@gnu.org>
14049         * s/ms-w32.h (localtime): Redirect to sys_localtime.
14051         * w32.c: Include <time.h>.
14052         (sys_localtime): New function.
14054 2011-04-23  Chong Yidong  <cyd@stupidchicken.com>
14056         * xdisp.c (init_xdisp): Initialize echo_area_window (Bug#6451).
14058         * buffer.c (syms_of_buffer): Doc fix (Bug#6902).
14060 2011-04-23  Samuel Thibault  <sthibault@debian.org>  (tiny change)
14062         * sysdep.c (wait_for_termination): On GNU Hurd, kill returns -1 on
14063         zombies (Bug#8467).
14065 2011-04-19  Eli Zaretskii  <eliz@gnu.org>
14067         * syntax.h (SETUP_SYNTAX_TABLE_FOR_OBJECT): Fix setting of
14068         gl_state.e_property when gl_state.object is Qt.
14070         * insdel.c (make_gap_larger): Remove limitation of buffer size
14071         to <= INT_MAX.
14073 2011-04-18  Chong Yidong  <cyd@stupidchicken.com>
14075         * xdisp.c (lookup_glyphless_char_display)
14076         (produce_glyphless_glyph): Handle cons cell entry in
14077         glyphless-char-display.
14078         (Vglyphless_char_display): Document it.
14080         * term.c (produce_glyphless_glyph): Handle cons cell entry in
14081         glyphless-char-display.
14083 2011-04-17  Chong Yidong  <cyd@stupidchicken.com>
14085         * xdisp.c (get_next_display_element): Remove unnecessary ifdefs.
14087         * termhooks.h (FRAME_WINDOW_P): Remove duplicated definitions.
14089         * dispextern.h (FACE_SUITABLE_FOR_ASCII_CHAR_P): Add missing
14090         definition for no-X builds.
14092 2011-04-16  Paul Eggert  <eggert@cs.ucla.edu>
14094         Static checks with GCC 4.6.0 and non-default toolkits.
14096         * s/sol2-6.h, s/unixware.h (PTY_TTY_NAME_SPRINTF): Protoize decl.
14098         * process.c (keyboard_bit_set): Define only if SIGIO.
14099         (send_process_trap): Mark it with NO_RETURN if it doesn't return.
14100         (send_process): Repair possible setjmp clobbering.
14102         * s/usg5-4-common.h (SETUP_SLAVE_PTY): Don't pass extra arg to 'fatal'.
14104         * eval.c: Include <stdio.h>, for vsnprintf on non-GNU/Linux hosts.
14106         * data.c (arith_error): Mark with NO_RETURN if it doesn't return.
14108         * alloc.c (bytes_used_when_full, SPARE_MEMORY, BYTES_USED):
14109         Define only if needed.
14111         * sysdep.c (_FILE_OFFSET_BITS): Make this hack even uglier
14112         by pacifying GCC about it.  Maybe it's time to retire it?
14113         * xfaces.c (USG, __TIMEVAL__): Likewise.
14115         * dispextern.h (struct redisplay_interface): Rename param
14116         to avoid shadowing.
14117         * termhooks.h (struct terminal): Likewise.
14118         * xterm.c (xembed_send_message): Likewise.
14120         * insdel.c (make_gap_smaller): Define only if
14121         USE_MMAP_FOR_BUFFERS || REL_ALLOC || DOUG_LEA_MALLOC.
14123         * keyboard.c (read_char): Make a var volatile so longjmp won't clobber
14124         it.
14126         * emacs.c (MAX_HEAP_BSS_DIFF, my_edata): Move to where they're used,
14127         so that we aren't warned about unused symbols.
14129         * xfns.c (Fx_file_dialog): Rename local to avoid shadowing.
14131         * xdisp.c (x_produce_glyphs): Mark var as initialized (Bug#8512).
14133         * xfns.c (x_real_positions): Mark locals as initialized.
14135         * xmenu.c (xmenu_show): Don't use uninitialized vars.
14137         * xterm.c: Fix problems found by static analysis with other toolkits.
14138         (toolkit_scroll_bar_interaction): Define and use only if USE_X_TOOLKIT.
14139         (x_dispatch_event): Declare static if USE_GTK, and
14140         define if USE_GTK || USE_X_TOOLKIT.
14141         (SET_SAVED_BUTTON_EVENT): Define only if USE_X_TOOLKIT || USE_GTK.
14142         * xterm.h (x_dispatch_event): Extern only if USE_X_TOOLKIT.
14143         * xterm.c, xterm.h (x_mouse_leave): Bring this function back, but only
14144         if defined HAVE_MENUS && !defined USE_X_TOOLKIT && !defined USE_GTK.
14146         * xmenu.c (menu_help_callback): Pointer type fixes.
14147         Use const pointers when pointing at readonly data.  Avoid pointer
14148         signedness clashes.
14149         (FALSE): Remove unused macro.
14150         (update_frame_menubar): Remove unused decl.
14152         * xfns.c (Fx_hide_tip): Move locals to avoid shadowing.
14154         * menu.c (push_submenu_start, push_submenu_end): Do not define unless
14155         USE_X_TOOLKIT || USE_GTK || HAVE_NS || defined HAVE_NTGUI.
14156         (single_menu_item): Rename local to avoid shadowing.
14158         * keyboard.c (make_lispy_event): Remove unused local var.
14160         * frame.c, frame.h (x_get_resource_string): Bring this back, but
14161         only if HAVE_X_WINDOWS && !USE_X_TOOLKIT.
14163         * bitmaps: Change bitmaps from unsigned char back to the X11
14164         compatible char.  Avoid the old compiler warnings about
14165         out-of-range initializers by using, for example, '\xab' rather
14166         than 0xab.
14168         * xgselect.c (xgselect_initialize): Check vs interface
14169         even if ! (defined (USE_GTK) || defined (HAVE_GCONF)).
14171         * xmenu.c (xmenu_show): Rename parm to avoid shadowing.
14173         * xterm.c (x_create_toolkit_scroll_bar): Use const * for pointers
14174         to read-only memory.
14176         * fns.c (vector): Remove; this old hack is no longer needed.
14178         * xsmfns.c (create_client_leader_window): Rename shadowing arg.
14179         Remove unused var.
14180         (gdk_x11_set_sm_client_id) [!USE_GTK]: Don't define.
14182         * xrdb.c (x_load_resources): Omit unused local.
14184         * xfns.c (free_frame_menubar, atof): Remove duplicate decls.
14185         (x_window): Rename locals to avoid shadowing.
14186         (USG): Use the kludged USG macro, to pacify gcc.
14188         * xterm.c (x_alloc_nearest_color_for_widget): Remove; unused.
14189         (x_term_init): Remove local to avoid shadowing.
14191         * xfns.c, xterm.c (_XEditResCheckMessages): Protoize decl.
14193         * xdisp.c, dispextern.h (set_vertical_scroll_bar): Now extern if
14194         USE_TOOLKIT_SCROLL_BARS && !USE_GTK, as xterm.c needs it then.
14196 2011-04-16  Eli Zaretskii  <eliz@gnu.org>
14198         * gnutls.c (Fgnutls_boot): Don't pass Lisp_Object to `error'.
14200         Fix regex.c, syntax.c and friends for buffers > 2GB.
14201         * syntax.h (struct gl_state_s): Declare character position members
14202         EMACS_INT.
14204         * syntax.c (update_syntax_table): Declare 2nd argument EMACS_INT.
14206         * textprop.c (verify_interval_modification, interval_of):
14207         Declare arguments EMACS_INT.
14209         * intervals.c (adjust_intervals_for_insertion): Declare arguments
14210         EMACS_INT.
14212         * intervals.h (CHECK_TOTAL_LENGTH): Cast to EMACS_INT, not `int'.
14214         * indent.c (Fvertical_motion): Local variable it_start is now
14215         EMACS_INT.
14217         * regex.c (re_match, re_match_2, re_match_2_internal)
14218         (bcmp_translate, regcomp, regexec, print_double_string)
14219         (group_in_compile_stack, re_search, re_search_2, regex_compile)
14220         (re_compile_pattern, re_exec): Declare arguments and local
14221         variables `size_t' and `ssize_t' and return values `regoff_t', as
14222         appropriate.
14223         (POP_FAILURE_REG_OR_COUNT) <pfreg>: Declare `long'.
14224         (CHECK_INFINITE_LOOP) <failure>: Declare `ssize_t'.
14225         <compile_stack_type>: `size' and `avail' are now `size_t'.
14227         * regex.h <regoff_t>: Use ssize_t, not int.
14228         (re_search, re_search_2, re_match, re_match_2): Arguments that
14229         specify buffer/string position and length are now ssize_t and
14230         size_t.  Return type is regoff_t.
14232 2011-04-16  Ben Key  <bkey76@gmail.com>
14234         * nsfont.m: Fixed bugs in ns_get_family and
14235         ns_descriptor_to_entity that were caused by using free to
14236         deallocate memory blocks that were allocated by xmalloc (via
14237         xstrdup).  This caused Emacs to crash when compiled with
14238         XMALLOC_OVERRUN_CHECK defined (when Emacs was configured with
14239         --enable-checking=xmallocoverrun).  xfree is now used to
14240         deallocate these memory blocks.
14242 2011-04-15  Paul Eggert  <eggert@cs.ucla.edu>
14244         * sysdep.c (emacs_read): Remove unnecessary check vs MAX_RW_COUNT.
14246         emacs_write: Accept and return EMACS_INT for sizes.
14247         See http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00514.html
14248         et seq.
14249         * gnutls.c, gnutls.h (emacs_gnutls_read, emacs_gnutls_write):
14250         Accept and return EMACS_INT.
14251         (emacs_gnutls_write): Return the number of bytes written on
14252         partial writes.
14253         * sysdep.c, lisp.h (emacs_read, emacs_write): Likewise.
14254         (emacs_read, emacs_write): Remove check for negative size, as the
14255         Emacs source code has been audited now.
14256         * sysdep.c (MAX_RW_COUNT): New macro, to work around kernel bugs.
14257         (emacs_read, emacs_write): Use it.
14258         * process.c (send_process): Adjust to the new signatures of
14259         emacs_write and emacs_gnutls_write.  Do not attempt to store
14260         a byte offset into an 'int'; it might overflow.
14261         See http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00483.html
14263         * sound.c: Don't assume sizes fit in 'int'.
14264         (struct sound_device.period_size, alsa_period_size):
14265         Return EMACS_INT, not int.
14266         (struct sound_device.write, vox_write, alsa_write):
14267         Accept EMACS_INT, not int.
14268         (wav_play, au_play): Use EMACS_INT to store sizes and to
14269         record read return values.
14271 2011-04-15  Ben Key  <bkey76@gmail.com>
14273         * keyboard.c (Qundefined): Don't declare static since it is used
14274         in nsfns.m.
14275         * xfaces.c (Qbold, Qexpanded, Qitalic, Qcondensed): Don't declare
14276         static since they are used in nsfont.m.
14278 2011-04-15  Stefan Monnier  <monnier@iro.umontreal.ca>
14280         * process.c (Qprocessp): Don't declare static.
14281         * lisp.h (Qprocessp): Declare again.
14283 2011-04-15  Juanma Barranquero  <lekktu@gmail.com>
14285         * font.c (Qopentype): Don't make static (used from w32uniscribe.c).
14287 2011-04-14  Paul Eggert  <eggert@cs.ucla.edu>
14289         Improve C-level modularity by making more things 'static'.
14291         Don't publish debugger-only interfaces to other modules.
14292         * lisp.h (safe_debug_print, debug_output_compilation_hack):
14293         (verify_bytepos, count_markers): Move decls to the only modules
14294         that need them.
14295         * region-cache.h (pp_cache): Likewise.
14296         * window.h (check_all_windows): Likewise.
14297         * marker.c, print.c, region-cache.c, window.c: Decls moved here.
14299         * sysdep.c (croak): Now static, if
14300         defined TIOCNOTTY || defined USG5 || defined CYGWIN.
14301         * syssignal.h (croak): Declare only if not static.
14303         * alloc.c (refill_memory_reserve): Now static if
14304         !defined REL_ALLOC || defined SYSTEM_MALLOC.
14305         * lisp.h (refill_memory_reserve): Declare only if not static.
14307         * xsettings.c, xsettings.h (xsettings_get_system_normal_font):
14308         Define only if USE_LUCID.
14310         * xrdb.c (x_customization_string, x_rm_string): Now static.
14312         * xmenu.c (x_menu_wait_for_event): Export only if USE_MOTIF.
14313         * xterm.h (x_menu_wait_for_event): Declare only if USE_MOTIF.
14315         * xdisp.c (draw_row_with_mouse_face): Now static.
14316         * dispextern.h (draw_row_with_mouse_fave): Remove decl.
14318         * window.h (check_all_windows): Mark externally visible.
14320         * window.c (window_deletion_count): Now static.
14322         * undo.c: Make symbols static if they're not exported.
14323         (last_undo_buffer, last_boundary_position, pending_boundary):
14324         Now static.
14326         * textprop.c (interval_insert_behind_hooks): Now static.
14327         (interval_insert_in_front_hooks): Likewise.
14329         * term.c: Make symbols static if they're not exported.
14330         (tty_turn_off_highlight, get_tty_terminal, max_frame_cols):
14331         (max_frame_lines, tty_set_terminal_modes):
14332         (tty_reset_terminal_modes, tty_turn_off_highlight):
14333         (get_tty_terminal): Now static.
14334         (term_mouse_moveto): Do not define if HAVE_WINDOW_SYSTEM.
14335         * termhooks.h (term_mouse_moveto): Do not declare if
14336         HAVE_WINDOW_SYSTEM.
14337         * dispextern.h (tty_set_terminal_modes, tty_reset_terminal_modes):
14338         (tty_turn_off_highlight, get_tty_terminal): Remove decls.
14340         * sysdep.c: Make symbols static if they're not exported.
14341         (emacs_get_tty, emacs_set_tty, old_fcntl_flags, old_fcntl_owner):
14342         Now static.
14343         (sigprocmask_set, full_mask): Remove; unused.
14344         (wait_debugging): Mark as visible.
14345         * syssignal.h (SIGFULLMASK, full_mask): Remove decls.
14346         * systty.h (emacs_get_tty, emacs_set_tty): Remove decls.
14348         * syntax.c (syntax_temp): Define only if !__GNUC__.
14350         * sound.c (current_sound_device, current_sound): Now static.
14352         * search.c (searchbufs, searchbuf_head): Now static.
14354         * scroll.c (scroll_cost): Remove; unused.
14355         * dispextern.h (scroll_cost): Remove decl.
14357         * region-cache.h (pp_cache): Mark as externally visible.
14359         * process.c: Make symbols static if they're not exported.
14360         (process_tick, update_tick, create_process, chan_process):
14361         (Vprocess_alist, proc_buffered_char, datagram_access):
14362         (fd_callback_data, send_process_frame, process_sent_to): Now static.
14363         (deactivate_process): Mark defn as static, as well as decl.
14364         * lisp.h (create_process): Remove decl.
14365         * process.h (chan_process, Vprocess_alist): Remove decls.
14367         * print.c: Make symbols static if they're not exported.
14368         (print_depth, new_backquote_output, being_printed, print_buffer):
14369         (print_buffer_size, print_buffer_pos, print_buffer_pos_byte):
14370         (print_interval, print_number_index, initial_stderr_stream):
14371         Now static.
14372         * lisp.h (Fprinc): Remove decl.
14373         (debug_output_compilation_hack): Mark as externally visible.
14375         * sysdep.c (croak): Move decl from here to syssignal.h.
14376         * syssignal.h (croak): Put it here, so the API can be checked when
14377         'croak' is called from dissociate_if_controlling_tty.
14379         * minibuf.c: Make symbols static if they're not exported.
14380         (minibuf_save_list, choose_minibuf_frame): Now static.
14381         * lisp.h (choose_minibuf_frame): Remove decl.
14383         * lisp.h (verify_bytepos, count_markers): Mark as externally visible.
14385         * lread.c: Make symbols static if they're not exported.
14386         (read_objects, initial_obarray, oblookup_last_bucket_number):
14387         Now static.
14388         (make_symbol): Remove; unused.
14389         * lisp.h (initial_obarray, make_symbol): Remove decls.
14391         * keyboard.c: Make symbols static if they're not exported.
14392         (single_kboard, recent_keys_index, total_keys, recent_keys):
14393         (this_command_key_count_reset, raw_keybuf, raw_keybuf_count):
14394         (this_single_command_key_start, echoing, last_auto_save):
14395         (read_key_sequence_cmd, dribble, recursive_edit_unwind):
14396         (command_loop, echo_now, keyboard_init_hook, help_char_p):
14397         (quit_throw_to_read_char, command_loop_2, top_level_1, poll_timer):
14398         (Vlispy_mouse_stem, double_click_count):
14399         Now static.
14400         (force_auto_save_soon): Define only if SIGDANGER.
14401         (ignore_mouse_drag_p): Now static if
14402         !defined HAVE_WINDOW_SYSTEM || defined USE_GTK || defined HAVE_NS.
14403         (print_help): Remove; unused.
14404         (stop_character, last_timer_event): Mark as externally visible.
14405         * keyboard.h (ignore_mouse_drag_p): Declare only if
14406         defined HAVE_WINDOW_SYSTEM && !defined USE_GTK && !defined HAVE_NS.
14407         (echo_now, help_char_p, quit_throw_to_read_char): Remove decls.
14408         * lisp.h (echoing): Remove decl.
14409         (force_auto_save_soon): Declare only if SIGDANGER.
14410         * xdisp.c (redisplay_window): Simplify code, to make it more
14411         obvious that ignore_mouse_drag_p is not accessed if !defined
14412         USE_GTK && !defined HAVE_NS.
14414         * intervals.c: Make symbols static if they're not exported.
14415         (merge_properties_sticky, merge_interval_right, delete_interval):
14416         Now static.
14417         * intervals.h (merge_interval_right, delete_interval): Remove decls.
14419         * insdel.c: Make symbols static if they're not exported.
14420         However, leave prepare_to_modify_buffer alone.  It's never
14421         called from outside this function, but that appears to be a bug.
14422         (combine_after_change_list, combine_after_change_buffer):
14423         (adjust_after_replace, signal_before_change): Now static.
14424         (adjust_after_replace_noundo): Remove; unused.
14425         * lisp.h (adjust_after_replace, adjust_after_replace_noundo):
14426         (signal_before_change): Remove decls.
14428         * indent.c (val_compute_motion, val_vmotion): Now static.
14430         * image.c: Make symbols static if they're not exported.
14431         * dispextern.h (x_create_bitmap_from_xpm_data): Do not declare
14432         if USE_GTK.
14433         * image.c (x_create_bitmap_from_xpm_data): Do not define if USE_GTK.
14434         (xpm_color_cache, ct_table, ct_colors_allocated): Now static.
14436         * fringe.c (standard_bitmaps): Now static.
14437         (max_used_fringe_bitmap): Now static, unless HAVE_NS.
14439         * frame.c: Make symbols static if they're not exported.
14440         (x_report_frame_params, make_terminal_frame): Now static.
14441         (get_frame_param): Now static, unless HAVE_NS.
14442         (x_fullscreen_adjust): Define if WINDOWSNT, not if HAVE_WINDOW_SYSTEM.
14443         (x_get_resource_string): Remove; not used.
14444         * frame.h (make_terminal_frame, x_report_frame_params):
14445         (x_get_resource_string); Remove decls.
14446         (x_fullscreen_adjust): Declare only if WINDOWSNT.
14447         * lisp.h (get_frame_param): Declare only if HAVE_NS.
14449         * font.c, fontset.c: Make symbols static if they're not exported.
14450         * dispextern.h (FACE_SUITABLE_FOR_ASCII_CHAR_P): New macro.
14451         (FACE_SUITABLE_FOR_CHAR_P): Use it.
14452         * font.c (font_close_object): Now static.
14453         * font.h (font_close_object): Remove.
14454         * fontset.c (FONTSET_OBJLIST): Remove.
14455         (free_realized_fontset) #if-0 the body, which does nothing.
14456         (face_suitable_for_char_p): #if-0, as it's never called.
14457         * fontset.h (face_suitable_for_char_p): Remove decl.
14458         * xfaces.c (face_at_string_position):
14459         Use FACE_SUITABLE_FOR_ASCII_CHAR_P, not FACE_SUITABLE_FOR_CHAR_P,
14460         since 0 is always ASCII.
14462         * fns.c (weak_hash_tables): Now static.
14464         * fileio.c: Make symbols static if they're not exported.
14465         (auto_saving, auto_save_mode_bits, auto_save_error_occurred):
14466         (Vwrite_region_annotation_buffers): Now static.
14468         * eval.c: Make symbols static if they're not exported.
14469         (backtrace_list, lisp_eval_depth, when_entered_debugger): Now static.
14470         * lisp.h (backtrace_list): Remove decl.
14472         * emacs.c: Make symbols static if they're not exported.
14473         (malloc_state_ptr, malloc_using_checking, syms_of_emacs):
14474         (fatal_error_code, fatal_error_signal_hook, standard_args):
14475         Now static.
14476         (fatal_error_signal): Now static, unless FLOAT_CATCH_SIGKILL.
14477         (DEFINE_DUMMY_FUNCTION): Mark function as externally visible.
14478         (__CTOR_LIST__, __DTOR_LIST__): Now externally visible.
14479         * lisp.h (fatal_error_signal_hook): Remove decl.
14480         (fatal_error_signal): Declare only if FLOAT_CATCH_SIGKILL.
14482         * editfns.c: Move a (normally-unused) function to its only use.
14483         * editfns.c, lisp.h (get_operating_system_release): Remove.
14484         * process.c (init_process) [DARWIN_OS]: Do it inline, as it is not
14485         worth the hassle of breaking this out.
14487         * xterm.c: Make symbols static if they're not exported.
14488         (x_raise_frame, x_lower_frame, x_wm_set_window_state):
14489         (x_wm_set_icon_pixmap, x_initialize, XTread_socket_fake_io_error):
14490         (x_destroy_window, x_delete_display):
14491         Now static.
14492         (x_dispatch_event): Now static if ! (USE_MOTIF || USE_X_TOOLKIT).
14493         (x_mouse_leave): Remove; unused.
14494         * xterm.h (x_display_info_for_name, x_raise_frame, x_lower_frame):
14495         (x_destroy_window, x_wm_set_window_state, x_wm_set_icon_pixmap):
14496         (x_delete_display, x_initialize, x_set_border_pixel, x_screen_planes):
14497         Remove decls.
14498         (x_mouse_leave): Declare only if WINDOWSNT.
14499         (x_dispatch_event): Declare only if USE_MOTIF or USE_X_TOOLKIT.
14500         (xic_create_fontsetname): Declare only if HAVE_X_WINDOWS &&
14501         USE_X_TOOLKIT.
14503         * ftxfont.c: Make symbols static if they're not exported.
14504         (ftxfont_driver): Export only if !defined HAVE_XFT && def8ined
14505         HAVE_FREETYPE.
14506         * font.h (ftxfont_driver): Likewise.
14508         * xfns.c: Make symbols static if they're not exported.
14509         (x_last_font_name, x_display_info_for_name):
14510         (x_set_foreground_color, x_set_background_color, x_set_mouse_color):
14511         (x_set_cursor_color, x_set_border_pixel, x_set_border_color):
14512         (x_set_cursor_type, x_set_icon_type, x_set_icon_name):
14513         (x_set_scroll_bar_foreground, x_set_scroll_bar_background):
14514         (x_explicitly_set_name, x_set_title, xic_defaut_fontset, tip_timer):
14515         (last_show_tip_args): Now static.
14516         (xic_defaut_fontset, xic_create_fontsetname): Define only if
14517         defined HAVE_X_WINDOWS && defined USE_X_TOOLKIT
14518         (x_screen_planes): Remove; unused.
14519         * dispextern.h (x_screen_planes): Remove decl.
14521         * dispnew.c: Make symbols static if they're not exported.
14522         * dispextern.h (redraw_garbaged_frames, scrolling):
14523         (increment_row_positions): Remove.
14524         * dispnew.c (new_glyph_matrix, increment_row_positions, scrolling):
14525         (delayed_size_change, glyph_matrix_count, glyph_pool_count):
14526         Now static.
14527         (redraw_garbaged_frames): Remove; unused.
14529         * xfaces.c: Make symbols static if they're not exported.
14530         * dispextern.h (ascii_face_of_lisp_face, free_realized_face):
14531         Remove decls.
14532         * xterm.h (defined_color): Remove decls.
14533         (x_free_dpy_colors): Declare only if USE_X_TOOLKIT.
14534         * xfaces.c (tty_suppress_bold_inverse_default_colors_p):
14535         (menu_face_changed_default, defined_color, free_realized_face):
14536         (x_free_dpy_colors): Define only if USE_X_TOOLKIT.
14537         (ascii_face_of_lisp_face): Remove; unused.
14539         * xdisp.c: Make symbols static if they're not exported.
14540         * dispextern.h (scratch_glyph_row, window_box_edges):
14541         (glyph_to_pixel_coords, set_cursor_from_row):
14542         (get_next_display_element, set_iterator_to_next):
14543         (highlight_trailing_whitespace, frame_to_window_pixel_xy):
14544         (show_mouse_face): Remove decls
14545         * frame.h (message_buf_print): Likewise.
14546         * lisp.h (pop_message, set_message, check_point_in_composition):
14547         Likewise.
14548         * xterm.h (set_vertical_scroll_bar): Likewise.
14549         * xdisp.c (list_of_error, Vmessage_stack, line_number_displayed):
14550         (message_buf_print, scratch_glyph_row, displayed_buffer):
14551         (set_iterator_to_next, pop_message, set_message, set_cursor_from_row):
14552         (get_next_display_element, show_mouse_face, window_box_edges):
14553         (frame_to_window_pixel_xy, check_point_in_composition):
14554         (set_vertical_scroll_bar, highlight_trailing_whitespace): Now static.
14555         (glyph_to_pixel_coords): Remove; unused.
14557         * dired.c (file_name_completion): Now static.
14559         * dbusbind.c (xd_in_read_queued_messages): Now static.
14561         * lisp.h (circular_list_error, FOREACH): Remove; unused.
14562         * data.c (circular_list_error): Remove.
14564         * commands.h (last_point_position, last_point_position_buffer):
14565         (last_point_position_window): Remove decls.
14566         * keyboard.c: Make these variables static.
14568         * coding.h (coding, code_convert_region, encode_coding_gap):
14569         Remove decls.
14570         * coding.c (Vsjis_coding_system, Vbig5_coding_system):
14571         (iso_code_class, detect_coding, code_convert_region): Now static.
14572         (encode_coding_gap): Remove; unused.
14574         * chartab.c (chartab_chars, chartab_bits): Now static.
14576         * charset.h (charset_iso_8859_1): Remove decl.
14577         * charset.c (charset_iso_8859_1, charset_emacs, map_charset_for_dump):
14578         Now static.
14580         * ccl.h (check_ccl_update, Vccl_program_table): Remove decls.
14581         * ccl.c (Vccl_program_table): Now static.
14582         (check_ccl_update): Remove; unused.
14584         * category.c (SET_CATEGORY_SET, set_category_set): Move here.
14585         * category.h: ... from here.
14586         * category.c (check_category_table, set_category_set): Now static.
14588         * casetab.c (Vascii_upcase_table, Vascii_eqv_table): Now static.
14589         * lisp.h: Remove these decls.
14591         * buffer.c (buffer_count): Remove unused var.
14593         * bidi.c (bidi_dump_cached_states): Mark as externally visible,
14594         so that it's not optimized away.
14595         (bidi_ignore_explicit_marks_for_paragraph_level): Likewise.
14596         * dispextern.h (bidi_dump_cached_states): Remove, since it's
14597         exported only to the debugger.
14599         * atimer.c (alarm_signal_handler, run_all_atimers): Now static.
14600         * atimer.h (run_all_atimers): Remove; not exported.
14602         font.c: Make copy_font_spec and merge_font_spec ordinary C functions.
14603         * font.c (copy_font_spec): Rename from Fcopy_font_spec, since it
14604         was inaccessible from Lisp.
14605         (merge_font_spec): Likewise, renaming from Fmerge_font_spec.
14606         * font.c, font.h, fontset.c, xfaces.c, xfont.c: Change all uses.
14608         alloc.c: Import and export fewer symbols, and remove unused items.
14609         * lisp.h (suppress_checking, die): Declare only if ENABLE_CHECKING
14610         is defined.
14611         (suppress_checking): Add EXTERNALLY_VISIBLE attribute, so that
14612         it's not optimized away by whole-program optimization.
14613         (message_enable_multibyte, free_misc): Remove.
14614         (catchlist, handlerlist, mark_backtrace):
14615         Declare only if BYTE_MARK_STACK.
14616         (mark_byte_stack): Likewise, fixing a ifdef-vs-if typo.
14617         * alloc.c (pure): Export only if VIRT_ADDR_VARIES is defined.
14618         (message_enable_multibyte): Remove decl.
14619         (free_misc, interval_free_list, float_block, float_block_index):
14620         (n_float_blocks, float_free_list, cons_block, cons_block_index):
14621         (cons_free_list, last_marked_index):
14622         Now static.
14623         (suppress_checking, die): Define only if ENABLE_CHECKING is defined.
14624         * eval.c (catchlist, handlerlist): Export only if BYTE_MARK_STACK.
14625         (mark_backtrace): Define only if BYTE_MARK_STACK.
14626         * xdisp.c (message_enable_multibyte): Now static.
14628         Declare Lisp_Object Q* variables to be 'static' if not exported.
14629         This makes it easier for human readers (and static analyzers)
14630         to see whether these variables are used from other modules.
14631         * alloc.c, buffer.c, bytecode.c, callint.c, casetab.c, category.c:
14632         * ccl.c, character.c, charset.c, cmds.c, coding.c, composite.c:
14633         * data.c, dbusbind.c, dired.c, editfns.c, eval.c, fileio.c, fns.c:
14634         * font.c, frame.c, fringe.c, ftfont.c, image.c, keyboard.c, keymap.c:
14635         * lread.c, macros.c, minibuf.c, print.c, process.c, search.c:
14636         * sound.c, syntax.c, textprop.c, window.c, xdisp.c, xfaces.c, xfns.c:
14637         * xmenu.c, xselect.c:
14638         Declare Q* vars static if they are not used in other modules.
14639         * ccl.h, character.h, charset.h, coding.h, composite.h, font.h:
14640         * frame.h, intervals.h, keyboard.h, lisp.h, process.h, syntax.h:
14641         Remove decls of unexported vars.
14642         * keyboard.h (EVENT_HEAD_UNMODIFIED): Remove now-unused macro.
14644         * lisp.h (DEFINE_FUNC): Make sname 'static'.
14646         Make Emacs functions such as Fatom 'static' by default.
14647         This makes it easier for human readers (and static analyzers)
14648         to see whether these functions can be called from other modules.
14649         DEFUN now defines a static function.  To make the function external
14650         so that it can be used in other C modules, use the new macro DEFUE.
14651         * lisp.h (Funibyte_char_to_multibyte, Fsyntax_table_p):
14652         (Finit_image_library):
14653         (Feval_region, Fbacktrace, Ffetch_bytecode, Fswitch_to_buffer):
14654         (Ffile_executable_p, Fmake_symbolic_link, Fcommand_execute):
14655         (Fget_process, Fdocumentation_property, Fbyte_code, Ffile_attributes):
14656         Remove decls, since these functions are now static.
14657         (Funintern, Fget_internal_run_time): New decls, since these functions
14658         were already external.
14660         * alloc.c, buffer.c, callint.c, callproc.c, casefiddle.c, casetab.c:
14661         * ccl.c, character.c, chartab.c, cmds.c, coding.c, data.c, dispnew.c:
14662         * doc.c, editfns.c, emacs.c, eval.c, fileio.c, filelock.c, floatfns.c:
14663         * fns.c, font.c, fontset.c, frame.c, image.c, indent.c:
14664         * keyboard.c, keymap.c, lread.c:
14665         * macros.c, marker.c, menu.c, minibuf.c, print.c, process.c, search.c:
14666         * syntax.c, term.c, terminal.c, textprop.c, undo.c:
14667         * window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xsettings.c:
14668         Mark functions with DEFUE instead of DEFUN,
14669         if they are used in other modules.
14670         * buffer.c (Fset_buffer_major_mode, Fdelete_overlay): New forward
14671         decls for now-static functions.
14672         * buffer.h (Fdelete_overlay): Remove decl.
14673         * callproc.c (Fgetenv_internal): Mark as internal.
14674         * composite.c (Fremove_list_of_text_properties): Remove decl.
14675         (Fcomposition_get_gstring): New forward static decl.
14676         * composite.h (Fcomposite_get_gstring): Remove decl.
14677         * dired.c (Ffile_attributes): New forward static decl.
14678         * doc.c (Fdocumntation_property): New forward static decl.
14679         * eval.c (Ffetch_bytecode): New forward static decl.
14680         (Funintern): Remove extern decl; now in .h file where it belongs.
14681         * fileio.c (Fmake_symbolic_link): New forward static decl.
14682         * image.c (Finit_image_library): New forward static decl.
14683         * insdel.c (Fcombine_after_change_execute): Make forward decl static.
14684         * intervals.h (Fprevious_property_change):
14685         (Fremove_list_of_text_properties): Remove decls.
14686         * keyboard.c (Fthis_command_keys): Remove decl.
14687         (Fcommand_execute): New forward static decl.
14688         * keymap.c (Flookup_key): New forward static decl.
14689         (Fcopy_keymap): Now static.
14690         * keymap.h (Flookup_key): Remove decl.
14691         * process.c (Fget_process): New forward static decl.
14692         (Fprocess_datagram_address): Mark as internal.
14693         * syntax.c (Fsyntax_table_p): New forward static decl.
14694         (skip_chars): Remove duplicate decl.
14695         * textprop.c (Fprevious_property_change): New forward static decl.
14696         * window.c (Fset_window_fringes, Fset_window_scroll_bars):
14697         Now internal.
14698         (Fset_window_margins, Fset_window_vscroll): New forward static decls.
14699         * window.h (Fset_window_vscroll, Fset_window_margins): Remove decls.
14701         * editfns.c (Fformat): Remove unreachable code.
14703 2011-04-14  Andreas Schwab  <schwab@linux-m68k.org>
14705         * fileio.c (Finsert_file_contents): Fix typo in 2005-05-13
14706         change.  (Bug#8496)
14708 2011-04-13  Eli Zaretskii  <eliz@gnu.org>
14710         * xdisp.c (handle_invisible_prop): Don't call bidi_paragraph_init
14711         when at ZV.  (Bug#8487)
14713 2011-04-12  Andreas Schwab  <schwab@linux-m68k.org>
14715         * charset.c (Fclear_charset_maps): Use xfree instead of free.
14716         (Bug#8437)
14717         * keyboard.c (parse_tool_bar_item): Likewise.
14718         * sound.c (sound_cleanup, alsa_close): Likewise.
14719         * termcap.c (tgetent): Likewise.
14720         * xfns.c (x_default_font_parameter): Likewise.
14721         * xsettings.c (read_and_apply_settings): Likewise.
14723         * alloc.c (overrun_check_malloc, overrun_check_realloc)
14724         (overrun_check_free): Protoize.
14726 2011-04-12  Paul Eggert  <eggert@cs.ucla.edu>
14728         * sysdep.c (emacs_read, emacs_write): Check for negative sizes
14729         since callers should never pass a negative size.
14730         Change the signature to match that of plain 'read' and 'write'; see
14731         <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00397.html>.
14732         * lisp.h: Update prototypes of emacs_write and emacs_read.
14734 2011-04-11  Eli Zaretskii  <eliz@gnu.org>
14736         * xdisp.c (redisplay_window): Don't try to determine the character
14737         position of the scroll margin if the window start point w->startp
14738         is outside the buffer's accessible region.  (Bug#8468)
14740 2011-04-10  Eli Zaretskii  <eliz@gnu.org>
14742         Fix write-region and its subroutines for buffers > 2GB.
14743         * fileio.c (a_write, e_write): Modify declaration of arguments and
14744         local variables to support buffers larger than 2GB.
14745         (Fcopy_file): Use EMACS_INT for return value of emacs_read.
14747         * sysdep.c (emacs_write, emacs_read): Use ssize_t for last
14748         argument, local variables, and return value.
14750         * lisp.h: Update prototypes of emacs_write and emacs_read.
14752         * sound.c (vox_write): Use ssize_t for return value of emacs_write.
14754 2011-04-10  Paul Eggert  <eggert@cs.ucla.edu>
14756         * xdisp.c (vmessage): Use memchr, not strnlen, which some hosts lack.
14758         Fix more problems found by GCC 4.6.0's static checks.
14760         * xdisp.c (vmessage): Use a better test for character truncation.
14762         * charset.c (load_charset_map): <, not <=, for optimization,
14763         and to avoid potential problems with integer overflow.
14764         * chartab.c (sub_char_table_set_range, char_table_set_range): Likewise.
14765         * casetab.c (set_identity, shuffle): Likewise.
14766         * editfns.c (Fformat): Likewise.
14767         * syntax.c (skip_chars): Likewise.
14769         * xmenu.c (set_frame_menubar): Allocate smaller local vectors.
14770         This also lets GCC 4.6.0 generate slightly better loop code.
14772         * callint.c (Fcall_interactively): <, not <=, for optimization.
14773         (Fcall_interactively): Count the number of arguments produced,
14774         not the number of arguments given.  This is simpler and lets GCC
14775         4.6.0 generate slightly better code.
14777         * ftfont.c: Distingish more carefully between FcChar8 and char.
14778         The previous code passed unsigned char * to a functions like
14779         strlen and xstrcasecmp that expect char *, which does not
14780         conform to the C standard.
14781         (get_adstyle_property, ftfont_pattern_entity): Use FcChar8 for
14782         arguments to FcPatternGetString, and explicitly cast FcChar8 * to
14783         char * when the C standard requires it.
14785         * keyboard.c (read_char): Remove unused var.
14787         * eval.c: Port to Windows vsnprintf (Bug#8435).
14788         Include <limits.h>.
14789         (SIZE_MAX): Define if the headers do not.
14790         (verror): Do not give up if vsnprintf returns a negative count.
14791         Instead, grow the buffer.  This ports to Windows vsnprintf, which
14792         does not conform to C99.  Problem reported by Eli Zaretskii.
14793         Also, simplify the allocation scheme, by avoiding the need for
14794         calling realloc, and removing the ALLOCATED variable.
14796         * eval.c (verror): Initial buffer size is 4000 (not 200) bytes.
14798         Remove invocations of doprnt, as Emacs now uses vsnprintf.
14799         But keep the doprint source code for now, as we might revamp it
14800         and use it again (Bug#8435).
14801         * lisp.h (doprnt): Remove.
14802         * Makefile.in (base_obj): Remove doprnt.o.
14803         * deps.mk (doprnt.o): Remove.
14805         error: Print 32- and 64-bit integers portably (Bug#8435).
14806         Without this change, on typical 64-bit hosts error ("...%d...", N)
14807         was used to print both 32- and 64-bit integers N, which relied on
14808         undefined behavior.
14809         * lisp.h, m/amdx86-64.h, m/ia64.h, m/ibms390x.h (pEd): New macro.
14810         * lisp.h (error, verror): Mark as printf-like functions.
14811         * eval.c (verror): Use vsnprintf, not doprnt, to do the real work.
14812         Report overflow in size calculations when allocating printf buffer.
14813         Do not truncate output string at its first null byte.
14814         * xdisp.c (vmessage): Use vsnprintf, not doprnt, to do the real work.
14815         Truncate the output at a character boundary, since vsnprintf does not
14816         do that.
14817         * charset.c (check_iso_charset_parameter): Convert internal
14818         character to string before calling 'error', since %c now has the
14819         printf meaning.
14820         * coding.c (Fdecode_sjis_char, Fdecode_big5_char): Avoid int
14821         overflow when computing char to be passed to 'error'.  Do not
14822         pass Lisp_Object to 'error'; pass the integer instead.
14823         * nsfns.m (Fns_do_applescript): Use int, not long, since it's
14824         formatted with plain %d.
14826         * eval.c (internal_lisp_condition_case): Don't pass spurious arg.
14828         * keyboard.c (access_keymap_keyremap): Print func name, not garbage.
14830         * coding.c (Fdecode_sjis_char): Don't assume CODE fits in int.
14832         * xterm.c (x_catch_errors): Remove duplicate declaration.
14834         * term.c (maybe_fatal): Mark its 3rd arg as a printf format, too.
14836         * xdisp.c, lisp.h (message_nolog): Remove; unused.
14838 2011-04-10  Jim Meyering  <meyering@redhat.com>
14840         use ssize_t and size_t for read- and write-like emacs_gnutls_* functions
14841         * gnutls.c (emacs_gnutls_read): Adjust signature to be more read-like:
14842         return ssize_t not "int", and use size_t as the buffer length.
14843         (emacs_gnutls_write): Likewise, and make the buffer pointer "const".
14844         * gnutls.h: Update declarations.
14845         * process.c (read_process_output): Use ssize_t, to match.
14846         (send_process): Likewise.
14848 2011-04-09  Chong Yidong  <cyd@stupidchicken.com>
14850         * image.c (Fimagemagick_types): Doc fix, and comment cleanup.
14852 2011-04-09  Chong Yidong  <cyd@stupidchicken.com>
14854         * ftfont.c (get_adstyle_property, ftfont_pattern_entity):
14855         Use unsigned char, to match FcChar8 type definition.
14857         * xterm.c (handle_one_xevent):
14858         * xmenu.c (create_and_show_popup_menu):
14859         * xselect.c (x_decline_selection_request)
14860         (x_reply_selection_request): Avoid type-punned deref of X events.
14862 2011-04-09  Eli Zaretskii  <eliz@gnu.org>
14864         Fix some uses of `int' instead of EMACS_INT.
14865         * search.c (string_match_1, fast_string_match)
14866         (fast_c_string_match_ignore_case, fast_string_match_ignore_case)
14867         (scan_buffer, find_next_newline_no_quit)
14868         (find_before_next_newline, search_command, Freplace_match)
14869         (Fmatch_data): Make some `int' variables be EMACS_INT.
14871         * xdisp.c (display_count_lines): 3rd argument and return value now
14872         EMACS_INT.  All callers changed.
14873         (pint2hrstr): Last argument is now EMACS_INT.
14875         * coding.c (detect_coding_utf_8, detect_coding_emacs_mule)
14876         (detect_coding_iso_2022, detect_coding_sjis, detect_coding_big5)
14877         (detect_coding_ccl, detect_coding_charset, decode_coding_utf_8)
14878         (decode_coding_utf_16, decode_coding_emacs_mule)
14879         (decode_coding_iso_2022, decode_coding_sjis, decode_coding_big5)
14880         (decode_coding_ccl, decode_coding_charset)
14881         <consumed_chars, consumed_chars_base>: Declare EMACS_INT.
14882         (decode_coding_iso_2022, decode_coding_emacs_mule)
14883         (decode_coding_sjis, decode_coding_big5, decode_coding_charset)
14884         <char_offset, last_offset>: Declare EMACS_INT.
14885         (encode_coding_utf_8, encode_coding_utf_16)
14886         (encode_coding_emacs_mule, encode_invocation_designation)
14887         (encode_designation_at_bol, encode_coding_iso_2022)
14888         (encode_coding_sjis, encode_coding_big5, encode_coding_ccl)
14889         (encode_coding_raw_text, encode_coding_charset) <produced_chars>:
14890         Declare EMACS_INT.
14891         (ASSURE_DESTINATION): Declare more_bytes EMACS_INT.
14892         (encode_invocation_designation): Last argument P_NCHARS is now
14893         EMACS_INT.
14894         (decode_eol): Declare pos_byte, pos, and pos_end EMACS_INT.
14895         (produce_chars): from_nchars and to_nchars are now EMACS_INT.
14897         * coding.h (struct coding_system) <head_ascii>: Declare EMACS_INT.
14898         All users changed.
14900         * ccl.c (Fccl_execute_on_string): Declare some variables
14901         EMACS_INT.
14903 2011-04-08  Samuel Thibault  <sthibault@debian.org>  (tiny change)
14905         * term.c (init_tty): Fix incorrect ifdef placement (Bug#8450).
14907 2011-03-19  Christoph Scholtes  <cschol2112@googlemail.com>
14909         * process.c (Fformat_network_address): Doc fix.
14911 2011-04-08  T.V. Raman  <tv.raman.tv@gmail.com>  (tiny change)
14913         * xml.c (parse_region): Avoid creating spurious whitespace nodes.
14915 2011-04-08  Chong Yidong  <cyd@stupidchicken.com>
14917         * keyboard.c (read_char): Call Lisp function help-form-show,
14918         instead of using internal_with_output_to_temp_buffer.
14919         (Qhelp_form_show): New var.
14920         (syms_of_keyboard): Use DEFSYM macro.
14922         * print.c (internal_with_output_to_temp_buffer): Function deleted.
14924         * lisp.h (internal_with_output_to_temp_buffer): Remove prototype.
14926 2011-04-06  Chong Yidong  <cyd@stupidchicken.com>
14928         * process.c (Flist_processes): Remove to Lisp.
14929         (list_processes_1): Delete.
14931 2011-04-06  Eli Zaretskii  <eliz@gnu.org>
14933         * msdos.c (careadlinkat, careadlinkatcwd): MS-DOS replacements.
14935         * w32.c (careadlinkat, careadlinkatcwd): New always-fail stubs.
14937 2011-04-06  Paul Eggert  <eggert@cs.ucla.edu>
14939         Fix more problems found by GCC 4.6.0's static checks.
14941         * xmenu.c (Fx_popup_dialog): Don't assume string is free of formats.
14943         * menu.c (Fx_popup_menu): Don't assume error_name lacks printf formats.
14945         * lisp.h (message, message_nolog, fatal): Mark as printf-like.
14947         * xdisp.c (vmessage): Mark as a printf-like function.
14949         * term.c (vfatal, maybe_fatal): Mark as printf-like functions.
14951         * sound.c (sound_warning): Don't crash if arg contains a printf format.
14953         * image.c (tiff_error_handler, tiff_warning_handler): Mark as
14954         printf-like functions.
14955         (tiff_load): Add casts to remove these marks before passing them
14956         to system-supplied API.
14958         * eval.c (Fsignal): Remove excess argument to 'fatal'.
14960         * coding.c (EMIT_ONE_BYTE, EMIT_TWO_BYTES): Use unsigned, not int.
14961         This avoids several warnings with gcc -Wstrict-overflow.
14962         (DECODE_COMPOSITION_RULE): If the rule is invalid, goto invalid_code
14963         directly, rather than having caller test rule sign.  This avoids
14964         some unnecessary tests.
14965         * composite.h (COMPOSITION_ENCODE_RULE_VALID): New macro.
14966         (COMPOSITION_ENCODE_RULE): Arguments now must be valid.  This
14967         affects only one use, in DECODE_COMPOSITION_RULE, which is changed.
14969         * xfont.c (xfont_text_extents): Remove var that was set but not used.
14970         (xfont_open): Avoid unnecessary tests.
14972         * composite.c (composition_gstring_put_cache): Use unsigned integer.
14974         * composite.h, composite.c (composition_gstring_put_cache):
14975         Use EMACS_INT, not int, for length.
14977         * composite.h (COMPOSITION_DECODE_REFS): New macro,
14978         breaking out part of COMPOSITION_DECODE_RULE.
14979         (COMPOSITION_DECODE_RULE): Use it.
14980         * composite.c (get_composition_id): Remove unused local vars,
14981         by using the new macro.
14983         * textprop.c (set_text_properties_1): Change while to do-while,
14984         since the condition is always true at first.
14986         * intervals.c (graft_intervals_into_buffer): Mark var as used.
14987         (interval_deletion_adjustment): Return unsigned value.
14988         All uses changed.
14990         * process.c (list_processes_1, create_pty, read_process_output):
14991         (exec_sentinel): Remove vars that were set but not used.
14992         (create_pty): Remove unnecessary "volatile"s.
14993         (Fnetwork_interface_info): Avoid possibility of int overflow.
14994         (read_process_output): Do adaptive read buffering even if carryover.
14995         (read_process_output): Simplify nbytes computation if buffered.
14997         * bytecode.c (exec_byte_code): Rename local to avoid shadowing.
14999         * syntax.c (scan_words): Remove var that was set but not used.
15000         (update_syntax_table): Use unsigned instead of int.
15002         * lread.c (lisp_file_lexically_bound_p): Use ints rather than endptrs.
15003         (lisp_file_lexically_bound_p, read1): Use unsigned instead of int.
15004         (safe_to_load_p): Make the end-of-loop test the inverse of the in-loop.
15006         * print.c (print_error_message): Avoid int overflow.
15008         * font.c (font_list_entities): Redo for clarity,
15009         so that reader need not know FONT_DPI_INDEX + 1 == FONT_SPACING_INDEX.
15011         * font.c (font_find_for_lface, Ffont_get_glyphs): Remove unused vars.
15012         (font_score): Avoid potential overflow in diff calculation.
15014         * fns.c (substring_both): Remove var that is set but not used.
15015         (sxhash): Redo loop for clarity and to avoid wraparound warning.
15017         * eval.c (funcall_lambda): Rename local to avoid shadowing.
15019         * alloc.c (mark_object_loop_halt, mark_object): Use size_t, not int.
15020         Otherwise, GCC 4.6.0 optimizes the loop check away since the check
15021         can always succeed if overflow has undefined behavior.
15023         * search.c (boyer_moore, wordify): Remove vars set but not used.
15024         (wordify): Omit three unnecessary tests.
15026         * indent.c (MULTIBYTE_BYTES_WIDTH): Don't compute wide_column.
15027         All callers changed.  This avoids the need for an unused var.
15029         * casefiddle.c (casify_region): Remove var that is set but not used.
15031         * dired.c (file_name_completion): Remove var that is set but not used.
15033         * fileio.c (Finsert_file_contents): Make EOF condition clearer.
15035         * fileio.c (Finsert_file_contents): Avoid signed integer overflow.
15036         (Finsert_file_contents): Remove unnecessary code checking fd.
15038         * minibuf.c (read_minibuf_noninteractive): Use size_t for sizes.
15039         Check for integer overflow on size calculations.
15041         * buffer.c (Fprevious_overlay_change): Remove var that is set
15042         but not used.
15044         * keyboard.c (menu_bar_items, read_char_minibuf_menu_prompt):
15045         Remove vars that are set but not used.
15046         (timer_check_2): Don't assume timer-list and idle-timer-list are lists.
15047         (timer_check_2): Mark vars as initialized.
15049         * gtkutil.c (xg_get_file_with_chooser): Mark var as initialized.
15051         * image.c (lookup_image): Remove var that is set but not used.
15052         (xbm_load): Use parse_p, for gcc -Werror=unused-but-set-variable.
15054         * fontset.c (Finternal_char_font, Ffontset_info): Remove vars
15055         that are set but not used.
15057         * xfns.c (make_invisible_cursor): Don't return garbage
15058         if XCreateBitmapFromData fails (Bug#8410).
15060         * xselect.c (x_get_local_selection, x_handle_property_notify):
15061         Remove vars that are set but not used.
15063         * xfns.c (x_create_tip_frame): Remove var that is set but not used.
15064         (make_invisible_cursor): Initialize a possibly-uninitialized variable.
15066         * xterm.c (x_scroll_bar_to_input_event) [!USE_GTK]:
15067         Remove var that is set but not used.
15068         (scroll_bar_windows_size): Now size_t, not int.
15069         (x_send_scroll_bar_event): Use size_t, not int, for sizes.
15070         Check for overflow.
15072         * xfaces.c (realize_named_face): Remove vars that are set but not used.
15073         (map_tty_color) [!defined MSDOS]: Likewise.
15075         * term.c (tty_write_glyphs): Use size_t; this avoids overflow warning.
15077         * coding.c: Remove vars that are set but not used.
15078         (DECODE_COMPOSITION_RULE): Remove 2nd arg, which is unused.
15079         All callers changed.
15080         (decode_coding_utf_8, decode_coding_utf_16 decode_coding_emacs_mule):
15081         (decode_coding_iso_2022, encode_coding_sjis, encode_coding_big5):
15082         (decode_coding_charset): Remove vars that are set but not used.
15084         * bytecode.c (Fbyte_code) [!defined BYTE_CODE_SAFE]: Remove var
15085         that is set but not used.
15087         * print.c (print_object): Remove var that is set but not used.
15089         Replace 2 copies of readlink code with 1 gnulib version (Bug#8401).
15090         The gnulib version avoids calling malloc in the usual case,
15091         and on 64-bit hosts doesn't have some arbitrary 32-bit limits.
15092         * fileio.c (Ffile_symlink_p): Use emacs_readlink.
15093         * filelock.c (current_lock_owner): Likewise.
15094         * lisp.h (READLINK_BUFSIZE, emacs_readlink): New function.
15095         * sysdep.c: Include allocator.h, careadlinkat.h.
15096         (emacs_no_realloc_allocator): New static constant.
15097         (emacs_readlink): New function.
15098         * deps.mk (sysdep.o): Depend on ../lib/allocator.h and on
15099         ../lib/careadlinkat.h.
15101 2011-04-04  Stefan Monnier  <monnier@iro.umontreal.ca>
15103         * keyboard.c (safe_run_hook_funcall): Fix last change (don't stop at the
15104         first non-nil return value).
15106 2011-04-03  Jan Djärv  <jan.h.d@swipnet.se>
15108         * nsterm.m (ns_update_auto_hide_menu_bar): Define MAC_OS_X_VERSION_10_6
15109         if not defined (Bug#8403).
15111 2011-04-02  Juanma Barranquero  <lekktu@gmail.com>
15113         * xdisp.c (display_count_lines): Remove parameter `start',
15114         unused since revno:20537 (1998-01-01).  All callers changed.
15115         (get_char_face_and_encoding): Remove parameter `multibyte_p',
15116         unused since revno:87605 (2008-05-14).  All callers changed.
15117         (fill_stretch_glyph_string): Remove parameters `row' and `area',
15118         unused at least since Kim's GUI unification at revno:50135 (2003-03-16)
15119         and thereabouts.  All callers changed.
15120         (get_per_char_metric): Remove parameter `f', unused since
15121         revno:87605 (2008-05-14).  All callers changed.
15123 2011-04-02  Jim Meyering  <meyering@redhat.com>
15125         do not dereference NULL upon failed strdup
15126         * nsfont.m (ns_descriptor_to_entity): Use xstrdup, not strdup.
15127         (ns_get_family): Likewise.
15129 2011-04-02  Juanma Barranquero  <lekktu@gmail.com>
15131         * eval.c (unwind_to_catch) [DEBUG_GCPRO]: Remove redundant assignment.
15133 2011-04-02  Jan Djärv  <jan.h.d@swipnet.se>
15135         * nsterm.m (ns_update_auto_hide_menu_bar): Only for OSX 10.6 or
15136         later (Bug#8403).
15138 2011-04-01  Stefan Monnier  <monnier@iro.umontreal.ca>
15140         Add lexical binding.
15142         * window.c (Ftemp_output_buffer_show): New fun.
15143         (Fsave_window_excursion):
15144         * print.c (Fwith_output_to_temp_buffer): Move to subr.el.
15146         * lread.c (lisp_file_lexically_bound_p): New function.
15147         (Fload): Bind Qlexical_binding.
15148         (readevalloop): Remove `evalfun' arg.
15149         Bind Qinternal_interpreter_environment.
15150         (Feval_buffer): Bind Qlexical_binding.
15151         (defvar_int, defvar_bool, defvar_lisp_nopro, defvar_kboard):
15152         Mark as dynamic.
15153         (syms_of_lread): Declare `lexical-binding'.
15155         * lisp.h (struct Lisp_Symbol): New field `declared_special'.
15157         * keyboard.c (eval_dyn): New fun.
15158         (menu_item_eval_property): Use it.
15160         * image.c (parse_image_spec): Use Ffunctionp.
15162         * fns.c (concat, mapcar1): Accept byte-code-functions.
15164         * eval.c (Fsetq): Handle lexical vars.
15165         (Fdefun, Fdefmacro, Ffunction): Make closures when needed.
15166         (Fdefconst, Fdefvaralias, Fdefvar): Mark as dynamic.
15167         (FletX, Flet): Obey lexical binding.
15168         (Fcommandp): Handle closures.
15169         (Feval): New `lexical' arg.
15170         (eval_sub): New function extracted from Feval.  Use it almost
15171         everywhere where Feval was used.  Look up vars in lexical env.
15172         Handle closures.
15173         (Ffunctionp): Move from subr.el.
15174         (Ffuncall): Handle closures.
15175         (apply_lambda): Remove `eval_flags'.
15176         (funcall_lambda): Handle closures and new byte-code-functions.
15177         (Fspecial_variable_p): New function.
15178         (syms_of_eval): Initialize the Vinternal_interpreter_environment var,
15179         but without exporting it to Lisp.
15181         * doc.c (Fdocumentation, store_function_docstring):
15182         * data.c (Finteractive_form): Handle closures.
15184         * callint.c (Fcall_interactively): Preserve lexical-binding mode for
15185         interactive spec.
15187         * bytecode.c (Bstack_ref, Bstack_set, Bstack_set2, BdiscardN):
15188         New byte-codes.
15189         (exec_byte_code): New function extracted from Fbyte_code to handle new
15190         calling convention for byte-code-functions.  Add new byte-codes.
15192         * buffer.c (defvar_per_buffer): Set new `declared_special' field.
15194         * alloc.c (Fmake_symbol): Init new `declared_special' field.
15196 2011-03-31  Juanma Barranquero  <lekktu@gmail.com>
15198         * xdisp.c (redisplay_internal): Fix prototype.
15200 2011-03-31  Eli Zaretskii  <eliz@gnu.org>
15202         * xdisp.c (SCROLL_LIMIT): New macro.
15203         (try_scrolling): Use it when setting scroll_limit.
15204         Limit scrolling to 100 screen lines.
15205         (redisplay_window): Even when falling back on "recentering",
15206         position point in the window according to scroll-conservatively,
15207         scroll-margin, and scroll-*-aggressively variables.  (Bug#6671)
15209         (try_scrolling): When point is above the window, allow searching
15210         as far as scroll_max, or one screenful, to compute vertical
15211         distance from PT to the scroll margin position.  This prevents
15212         try_scrolling from unnecessarily failing when
15213         scroll-conservatively is set to a value slightly larger than the
15214         window height.  Clean up the case of PT below the margin at bottom
15215         of window: scroll_max can no longer be INT_MAX.  When aggressive
15216         scrolling is in use, don't let point enter the opposite scroll
15217         margin as result of the scroll.
15218         (syms_of_xdisp) <scroll-conservatively>: Document the
15219         threshold of 100 lines for never-recentering scrolling.
15221 2011-03-31  Juanma Barranquero  <lekktu@gmail.com>
15223         * dispextern.h (move_it_by_lines):
15224         * xdisp.c (move_it_by_lines): Remove parameter `need_y_p', unused
15225         since revno:34925 (2000-12-29).  All callers changed.
15226         (message_log_check_duplicate): Remove parameters `prev_bol' and
15227         `this_bol', unused since revno:20537 (1998-01-01).  All callers changed.
15228         (redisplay_internal): Remove parameter `preserve_echo_area',
15229         unused since revno:25013 (1999-07-21).  All callers changed.
15231         * indent.c (Fvertical_motion):
15232         * window.c (window_scroll_pixel_based, Frecenter):
15233         Don't pass `need_y_p' to `move_it_by_lines'.
15235 2011-03-30  Stefan Monnier  <monnier@iro.umontreal.ca>
15237         * eval.c (struct backtrace): Don't cheat with negative numbers, but do
15238         steal a few bits to be more compact.
15239         (interactive_p, Fbacktrace, Fbacktrace_frame, mark_backtrace):
15240         Remove unneeded casts.
15242         * bytecode.c (Fbyte_code): CAR and CDR can GC.
15244 2011-03-30  Zachary Kanfer  <zkanfer@gmail.com>  (tiny change)
15246         * keyboard.c (Fexecute_extended_command): Do log the "suggest key
15247         binding" message (bug#7967).
15249 2011-03-30  Paul Eggert  <eggert@cs.ucla.edu>
15251         Fix more problems found by GCC 4.6.0's static checks.
15253         * unexelf.c (unexec) [! (defined _SYSTYPE_SYSV || defined __sgi)]:
15254         Remove unused local var.
15256         * editfns.c (Fmessage_box): Remove unused local var.
15258         * xdisp.c (try_window_reusing_current_matrix, x_produce_glyphs):
15259         (note_mode_line_or_margin_highlight, note_mouse_highlight):
15260         Omit unused local vars.
15261         * window.c (shrink_windows): Omit unused local var.
15262         * menu.c (digest_single_submenu): Omit unused local var.
15263         * dispnew.c (update_window) [PERIODIC_PREEMPTION_CHECKING]:
15264         Omit unused local var.
15266         * keyboard.c (parse_modifiers_uncached, parse_modifiers):
15267         Don't assume string length fits in int.
15268         (keyremap_step, read_key_sequence): Use size_t for sizes.
15269         (read_key_sequence): Don't check last_real_key_start redundantly.
15271         * callproc.c (Fcall_process, Fcall_process_region): Use SAFE_ALLOCA
15272         instead of alloca (Bug#8344).
15274         * eval.c (Fbacktrace): Don't assume nargs fits in int.
15275         (Fbacktrace_frame): Don't assume nframes fits in int.
15277         * syntax.c (scan_sexps_forward): Avoid pointer wraparound.
15279         * xterm.c (x_make_frame_visible, same_x_server): Redo to avoid overflow
15280         concerns.
15282         * term.c (produce_glyphless_glyph): Remove unnecessary test.
15284         * cm.c (calccost): Turn while-do into do-while, for clarity.
15286         * keyboard.c (syms_of_keyboard): Use the same style as later
15287         in this function when indexing through an array.  This also
15288         works around GCC bug 48267.
15290         * image.c (tiff_load): Fix off-by-one image count (Bug#8336).
15292         * xselect.c (x_check_property_data): Return correct size (Bug#8335).
15294         * chartab.c (sub_char_table_ref_and_range): Redo for slight
15295         efficiency gain, and to bypass a gcc -Wstrict-overflow warning.
15297         * keyboard.c, keyboard.h (num_input_events): Now size_t.
15298         This avoids undefined behavior on integer overflow, and is a bit
15299         more convenient anyway since it is compared to a size_t variable.
15301         Variadic C functions now count arguments with size_t, not int.
15302         This avoids an unnecessary limitation on 64-bit machines, which
15303         caused (substring ...) to crash on large vectors (Bug#8344).
15304         * lisp.h (struct Lisp_Subr.function.aMANY): Now takes size_t, not int.
15305         (DEFUN_ARGS_MANY, internal_condition_case_n, safe_call): Likewise.
15306         All variadic functions and their callers changed accordingly.
15307         (struct gcpro.nvars): Now size_t, not int.  All uses changed.
15308         * data.c (arith_driver, float_arith_driver): Likewise.
15309         * editfns.c (general_insert_function): Likewise.
15310         * eval.c (struct backtrace.nargs, interactive_p)
15311         (internal_condition_case_n, run_hook_with_args, apply_lambda)
15312         (funcall_lambda, mark_backtrace): Likewise.
15313         * fns.c (concat): Likewise.
15314         * frame.c (x_set_frame_parameters): Likewise.
15315         * fns.c (get_key_arg): Now accepts and returns size_t, and returns
15316         0 if not found, not -1.  All callers changed.
15318         * alloc.c (garbage_collect): Don't assume stack size fits in int.
15319         (stack_copy_size): Now size_t, not int.
15320         (stack_copy, stack_copy_size): Define only if MAX_SAVE_STACK > 0.
15322 2011-03-28  Juanma Barranquero  <lekktu@gmail.com>
15324         * coding.c (encode_designation_at_bol): Remove parameter `charbuf_end',
15325         unused since revno:43563.1.17 (2002-03-01) and revno:84043 (2008-02-1).
15326         All callers changed.
15328         * lisp.h (multibyte_char_to_unibyte):
15329         * character.c (multibyte_char_to_unibyte): Remove parameter `rev_tbl',
15330         unused since revno:43563.1.16 (2002-03-01) and revno:84043 (2008-02-1).
15331         * character.h (CHAR_TO_BYTE8):
15332         * cmds.c (internal_self_insert):
15333         * editfns.c (general_insert_function):
15334         * keymap.c (push_key_description):
15335         * search.c (Freplace_match):
15336         * xdisp.c (message_dolog, set_message_1): All callers changed.
15338 2011-03-28  Stefan Monnier  <monnier@iro.umontreal.ca>
15340         * keyboard.c (safe_run_hook_funcall): New function.
15341         (safe_run_hooks_1, safe_run_hooks_error, safe_run_hooks): On error,
15342         don't set the hook to nil, but remove the offending function instead.
15343         (Qcommand_hook_internal): Remove, unused.
15344         (syms_of_keyboard): Don't initialize Qcommand_hook_internal nor define
15345         Vcommand_hook_internal.
15347         * eval.c (enum run_hooks_condition): Remove.
15348         (funcall_nil, funcall_not): New functions.
15349         (run_hook_with_args): Call each function through a `funcall' argument.
15350         Remove `cond' argument, now redundant.
15351         (Frun_hooks, Frun_hook_with_args, Frun_hook_with_args_until_success)
15352         (Frun_hook_with_args_until_failure): Adjust accordingly.
15353         (run_hook_wrapped_funcall, Frun_hook_wrapped): New functions.
15355 2011-03-28  Juanma Barranquero  <lekktu@gmail.com>
15357         * dispextern.h (string_buffer_position): Remove declaration.
15359         * print.c (strout): Remove parameter `multibyte', unused since
15360         revno:25356 (1999-08-21).  All callers changed.
15362         * search.c (boyer_moore): Remove parameters `len', `pos' and `lim',
15363         never used since function introduction in revno:20870 (1998-02-08).
15364         All callers changed.
15366         * w32.c (_wsa_errlist): Use braces for struct initializers.
15368         * xdisp.c (string_buffer_position_lim): Remove parameter `w',
15369         never used since function introduction in revno:36704 (2001-03-09).
15370         All callers changed.
15371         (string_buffer_position): Likewise.  Also, make static (it's never
15372         used outside xdisp.c).
15373         (cursor_row_p): Remove parameter `w', unused since
15374         revno:32591 (2000-10-17).  All callers changed.
15375         (decode_mode_spec): Remove parameter `precision', introduced during
15376         Gerd Moellmann's rewrite at revno:25013 (1999-07-21), but never used.
15377         All callers changed.
15379 2011-03-27  Jan Djärv  <jan.h.d@swipnet.se>
15381         * nsterm.m (syms_of_nsterm): Use doc: for ns-auto-hide-menu-bar.
15383 2011-03-27  Anders Lindgren  <andlind@gmail.com>
15385         * nsterm.m (ns_menu_bar_is_hidden): New variable.
15386         (ns_constrain_all_frames, ns_menu_bar_should_be_hidden)
15387         (ns_update_auto_hide_menu_bar): New functions.
15388         (ns_update_begin): Call ns_update_auto_hide_menu_bar.
15389         (applicationDidBecomeActive): Call ns_update_auto_hide_menu_bar and
15390         ns_constrain_all_frames.
15391         (constrainFrameRect): Return at once if ns_menu_bar_should_be_hidden.
15392         (syms_of_nsterm): DEFVAR ns-auto-hide-menu-bar, init to Qnil.
15394 2011-03-27  Jan Djärv  <jan.h.d@swipnet.se>
15396         * nsmenu.m (runDialogAt): Remove argument to timer_check.
15398 2011-03-27  Glenn Morris  <rgm@gnu.org>
15400         * syssignal.h: Replace RETSIGTYPE with void.
15401         * atimer.c, data.c, dispnew.c, emacs.c, floatfns.c, keyboard.c:
15402         * keyboard.h, lisp.h, process.c, sysdep.c, xterm.c:
15403         Replace SIGTYPE with void everywhere.
15404         * s/usg5-4-common.h (SIGTYPE): Remove definition.
15405         * s/template.h (SIGTYPE): Remove commented out definition.
15407 2011-03-26  Eli Zaretskii  <eliz@gnu.org>
15409         * xdisp.c (redisplay_window): Don't check buffer's clip_changed
15410         flag as a prerequisite for invoking try_scrolling.  (Bug#6671)
15412 2011-03-26  Juanma Barranquero  <lekktu@gmail.com>
15414         * w32.c (read_unc_volume): Use parameter `henum', instead of
15415         global variable `wget_enum_handle'.
15417         * keymap.c (describe_vector): Remove parameters `indices' and
15418         `char_table_depth', unused since revno:43563.1.32 (2002-03-01).
15419         (describe_map, Fdescribe_vector): Adjust calls to `describe_vector'.
15421         * keyboard.h (timer_check, show_help_echo): Remove unused parameters.
15423         * keyboard.c (timer_check): Remove parameter `do_it_now',
15424         unused since revno:14998 (1996-04-12).
15425         (show_help_echo): Remove parameter `ok_to_overwrite_keystroke_echo',
15426         unused since revno:86854 (2008-04-19).
15428         * keyboard.c (read_char):
15429         * w32menu.c (w32_menu_display_help):
15430         * xmenu.c (show_help_event, menu_help_callback):
15431         Adjust calls to `show_help_echo'.
15433         * gtkutil.c (xg_maybe_add_timer):
15434         * keyboard.c (readable_events):
15435         * process.c (wait_reading_process_output):
15436         * xmenu.c (x_menu_wait_for_event): Adjust calls to `timer_check'.
15438         * insdel.c (adjust_markers_gap_motion):
15439         Remove; no-op since revno:20569 (1998-01-02).
15440         (gap_left, gap_right): Don't call it.
15442 2011-03-25  Chong Yidong  <cyd@stupidchicken.com>
15444         * xdisp.c (handle_fontified_prop): Discard changes to clip_changed
15445         incurred during fontification.
15447 2011-03-25  Juanma Barranquero  <lekktu@gmail.com>
15449         * buffer.c (defvar_per_buffer): Remove unused parameter `doc'.
15450         (DEFVAR_PER_BUFFER): Don't pass it.
15452         * dispnew.c (row_equal_p, add_row_entry): Remove unused parameter `w'.
15453         (scrolling_window): Don't pass it.
15455 2011-03-25  Juanma Barranquero  <lekktu@gmail.com>
15457         * dispextern.h (glyph_matric): Use #if GLYPH_DEBUG, not #ifdef.
15459         * fileio.c (check_executable) [DOS_NT]: Remove unused variables `len'
15460         and `suffix'.
15461         (Fset_file_selinux_context) [HAVE_LIBSELINUX]: Move here declaration
15462         of variables specific to SELinux and computation of `encoded_absname'.
15464         * image.c (XPutPixel): Remove unused variable `height'.
15466         * keyboard.c (make_lispy_event): Remove unused variable `hpos'.
15468         * unexw32.c (get_section_info): Remove unused variable `section'.
15470         * w32.c (stat): Remove unused variables `drive_root' and `devtype'.
15471         (system_process_attributes): Remove unused variable `sess'.
15472         (sys_read): Remove unused variable `err'.
15474         * w32fns.c (top): Wrap variables with #if GLYPH_DEBUG, not #ifdef.
15475         (w32_wnd_proc): Remove unused variable `isdead'.
15476         (unwind_create_frame): Use #if GLYPH_DEBUG, not #ifdef.
15477         (Fx_server_max_request_size): Remove unused variable `dpyinfo'.
15478         (x_create_tip_frame): Remove unused variable `tem'.
15480         * w32inevt.c (w32_console_read_socket):
15481         Remove unused variable `no_events'.
15483         * w32term.c (x_draw_composite_glyph_string_foreground):
15484         Remove unused variable `width'.
15486 2011-03-24  Juanma Barranquero  <lekktu@gmail.com>
15488         * w32term.c (x_set_glyph_string_clipping):
15489         Don't pass uninitialized region to CombineRgn.
15491 2011-03-23  Juanma Barranquero  <lekktu@gmail.com>
15493         * w32fns.c (x_set_menu_bar_lines): Remove unused variable `olines'.
15494         (w32_wnd_proc): Pass NULL to Windows API, not uninitialized buffer.
15495         (Fx_close_connection): Remove unused variable `i'.
15497         * w32font.c (w32font_draw): Return number of glyphs.
15498         (w32font_open_internal): Remove unused variable `i'.
15499         (w32font_driver): Add missing initializer.
15501         * w32menu.c (utf8to16): Remove unused variable `utf16'.
15502         (fill_in_menu): Remove unused variable `items_added'.
15504         * w32term.c (last_mouse_press_frame): Remove static global variable.
15505         (w32_clip_to_row): Remove unused variable `f'.
15506         (x_delete_terminal): Remove unused variable `i'.
15508         * w32uniscribe.c (uniscribe_shape): Remove unused variable `nclusters'.
15509         (NOTHING): Remove unused static global variable.
15510         (uniscribe_check_otf): Remove unused variable `table'.
15511         (uniscribe_font_driver): Add missing initializers.
15513 2011-03-23  Julien Danjou  <julien@danjou.info>
15515         * term.c (Fsuspend_tty, Fresume_tty):
15516         * minibuf.c (read_minibuf, run_exit_minibuf_hook):
15517         * window.c (temp_output_buffer_show):
15518         * insdel.c (signal_before_change):
15519         * frame.c (Fhandle_switch_frame):
15520         * fileio.c (Fdo_auto_save):
15521         * emacs.c (Fkill_emacs):
15522         * editfns.c (save_excursion_restore):
15523         * cmds.c (internal_self_insert):
15524         * callint.c (Fcall_interactively):
15525         * buffer.c (Fkill_all_local_variables):
15526         * keyboard.c (Fcommand_execute, Fsuspend_emacs, safe_run_hooks_1):
15527         Use Frun_hooks.
15528         (command_loop_1): Use Frun_hooks.  Call safe_run_hooks
15529         unconditionally since it does the check itself.
15531 2011-03-23  Paul Eggert  <eggert@cs.ucla.edu>
15533         Fix more problems found by GCC 4.5.2's static checks.
15535         * coding.c (encode_coding_raw_text): Avoid unnecessary test
15536         the first time through the loop, since we know p0 < p1 then.
15537         This also avoids a gcc -Wstrict-overflow warning.
15539         * lisp.h (SAFE_ALLOCA, SAFE_ALLOCA_LISP): Avoid 'int' overflow
15540         leading to a memory leak, possible in functions like
15541         load_charset_map_from_file that can allocate an unbounded number
15542         of objects (Bug#8318).
15544         * xmenu.c (set_frame_menubar): Use EMACS_UINT, not int, for indexes
15545         that could (at least in theory) be that large.
15547         * xdisp.c (message_log_check_duplicate): Return unsigned long, not int.
15548         This is less likely to overflow, and avoids undefined behavior if
15549         overflow does occur.  All callers changed.  Use strtoul to scan
15550         for the unsigned long integer.
15551         (pint2hrstr): Simplify and tune code slightly.
15552         This also avoids a (bogus) GCC warning with gcc -Wstrict-overflow.
15554         * scroll.c (do_scrolling): Work around GCC bug 48228.
15555         See <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48228>.
15557         * frame.c (Fmodify_frame_parameters): Simplify loop counter.
15558         This also avoids a warning with gcc -Wstrict-overflow.
15559         (validate_x_resource_name): Simplify count usage.
15560         This also avoids a warning with gcc -Wstrict-overflow.
15562         * fileio.c (Fcopy_file): Report error if fchown or fchmod
15563         fail (Bug#8306).
15565         * emacs.c (Fdaemon_initialized): Do not ignore I/O errors (Bug#8303).
15567         * process.c (Fmake_network_process): Use socklen_t, not int,
15568         where POSIX says socklen_t is required in portable programs.
15569         This fixes a porting bug on hosts like 64-bit HP-UX, where
15570         socklen_t is wider than int (Bug#8277).
15571         (Fmake_network_process, server_accept_connection):
15572         (wait_reading_process_output, read_process_output):
15573         Likewise.
15575         * process.c: Rename or move locals to avoid shadowing.
15576         (list_processes_1, Fmake_network_process):
15577         (read_process_output_error_handler, exec_sentinel_error_handler):
15578         Rename or move locals.
15579         (Fmake_network_process): Define label "retry_connect" only if needed.
15580         (Fnetwork_interface_info): Fix pointer signedness.
15581         (process_send_signal): Add cast to avoid pointer signedness problem.
15582         (FIRST_PROC_DESC, IF_NON_BLOCKING_CONNECT): Remove unused macros.
15583         (create_process): Use 'volatile' to avoid vfork clobbering (Bug#8298).
15585         Make tparam.h and terminfo.c consistent.
15586         * cm.c (tputs, tgoto, BC, UP): Remove extern decls.
15587         Include tparam.h instead, since it declares them.
15588         * cm.h (PC): Remove extern decl; tparam.h now does this.
15589         * deps.mk (cm.o, terminfo.o): Depend on tparam.h.
15590         * terminfo.c: Include tparam.h, to check interfaces.
15591         (tparm): Make 1st arg a const pointer in decl.  Put it at top level.
15592         (tparam): Adjust signature to match interface in tparam.h;
15593         this removes some undefined behavior.  Check that outstring and len
15594         are zero, which they always are with Emacs.
15595         * tparam.h (PC, BC, UP): New extern decls.
15597         * xftfont.c (xftfont_shape): Now static, and defined only if needed.
15598         (xftfont_open): Rename locals to avoid shadowing.
15600         * ftfont.c (ftfont_resolve_generic_family): Fix pointer signedness.
15601         (ftfont_otf_capability, ftfont_shape): Omit decls if not needed.
15602         (OTF_TAG_SYM): Omit macro if not needed.
15603         (ftfont_list): Remove unused local.
15604         (get_adstyle_property, ftfont_pattern_entity):
15605         (ftfont_lookup_cache, ftfont_open, ftfont_anchor_point):
15606         Rename locals to avoid shadowing.
15608         * xfont.c (xfont_list_family): Mark var as initialized.
15610         * xml.c (make_dom): Now static.
15612         * composite.c (composition_compute_stop_pos): Rename local to
15613         avoid shadowing.
15614         (composition_reseat_it): Remove unused locals.
15615         (find_automatic_composition, composition_adjust_point): Likewise.
15616         (composition_update_it): Mark var as initialized.
15617         (find_automatic_composition): Mark vars as initialized,
15618         with a FIXME (Bug#8290).
15620         character.h: Rename locals to avoid shadowing.
15621         * character.h (PREV_CHAR_BOUNDARY, FETCH_STRING_CHAR_ADVANCE):
15622         (FETCH_STRING_CHAR_AS_MULTIBYTE_ADVANCE, FETCH_CHAR_ADVANCE):
15623         (FETCH_CHAR_ADVANCE_NO_CHECK, INC_POS, DEC_POS, BUF_INC_POS):
15624         (BUF_DEC_POS): Be more systematic about renaming local temporaries
15625         to avoid shadowing.
15627         * textprop.c (property_change_between_p): Remove; unused.
15629         * intervals.c (interval_start_pos): Now static.
15631         * intervals.h (CHECK_TOTAL_LENGTH): Avoid empty "else".
15633         * atimer.c (start_atimer, append_atimer_lists, set_alarm):
15634         Rename locals to avoid shadowing.
15636         * sound.c (wav_play, au_play, Fplay_sound_internal):
15637         Fix pointer signedness.
15638         (alsa_choose_format): Remove unused local var.
15639         (wav_play): Initialize a variable to 0, to prevent undefined
15640         behavior (Bug#8278).
15642         * region-cache.c (insert_cache_boundary): Redo var to avoid shadowing.
15644         * region-cache.h (pp_cache): New decl, for gcc -Wmissing-prototypes.
15646         * callproc.c (Fcall_process): Use 'volatile' to avoid vfork
15647         clobbering (Bug#8298).
15648         * sysdep.c (sys_subshell): Likewise.
15649         Previously, the sys_subshell 'volatile' was incorrectly IF_LINTted out.
15651         * lisp.h (child_setup): Now NO_RETURN unless DOS_NT.
15652         This should get cleaned up, so that child_setup has the
15653         same signature on all platforms.
15655         * callproc.c (call_process_cleanup): Now static.
15656         (relocate_fd): Rename locals to avoid shadowing.
15658 2011-03-22  Chong Yidong  <cyd@stupidchicken.com>
15660         * xterm.c (x_clear_frame): Remove XClearWindow call.  This appears
15661         not to be necessary, and produces flickering.
15663 2011-03-20  Glenn Morris  <rgm@gnu.org>
15665         * config.in: Remove file.
15667 2011-03-20  Juanma Barranquero  <lekktu@gmail.com>
15669         * minibuf.c (Vcompleting_read_function): Don't declare, global variables
15670         are now in src/globals.h.
15671         (syms_of_minibuf): Remove spurious & from previous change.
15673 2011-03-20  Leo Liu  <sdl.web@gmail.com>
15675         * minibuf.c (completing-read-function): New variable.
15676         (completing-read-default): Rename from completing-read.
15677         (completing-read): Call completing-read-function.
15679 2011-03-19  Juanma Barranquero  <lekktu@gmail.com>
15681         * xfaces.c (Fx_load_color_file):
15682         Read color file from absolute filename (bug#8250).
15684 2011-03-19  Juanma Barranquero  <lekktu@gmail.com>
15686         * makefile.w32-in: Update dependencies.
15688 2011-03-17  Eli Zaretskii  <eliz@gnu.org>
15690         * makefile.w32-in ($(BLD)/unexw32.$(O)): Depend on $(SRC)/unexec.h.
15692 2011-03-17  Paul Eggert  <eggert@cs.ucla.edu>
15694         Fix more problems found by GCC 4.5.2's static checks.
15696         * process.c (make_serial_process_unwind, send_process_trap):
15697         (sigchld_handler): Now static.
15699         * process.c (allocate_pty): Let PTY_ITERATION declare iteration vars.
15700         That way, the code declares only the vars that it needs.
15701         * s/aix4-2.h (PTY_ITERATION): Declare iteration vars.
15702         * s/cygwin.h (PTY_ITERATION): Likewise.
15703         * s/darwin.h (PTY_ITERATION): Likewise.
15704         * s/gnu-linux.h (PTY_ITERATION): Likewise.
15706         * s/irix6-5.h (PTY_OPEN): Declare stb, to loosen coupling.
15707         * process.c (allocate_pty): Don't declare stb unless it's needed.
15709         * bytecode.c (MAYBE_GC): Rewrite so as not to use empty "else".
15710         (CONSTANTLIM): Remove; unused.
15711         (METER_CODE, Bscan_buffer, Bread_char, Bset_mark):
15712         Define only if needed.
15714         * unexelf.c (unexec): Name an expression,
15715         to avoid gcc -Wbad-function-cast warning.
15716         Use a different way to cause a compilation error if anyone uses
15717         n rather than nn, a way that does not involve shadowing.
15718         (ELF_BSS_SECTION_NAME, OLD_PROGRAM_H): Remove; unused.
15720         * deps.mk (unexalpha.o): Remove; unused.
15722         New file unexec.h, the (simple) interface for unexec (Bug#8267).
15723         * unexec.h: New file.
15724         * deps.mk (emacs.o, unexaix.o, unexcw.o, unexcoff.o, unexelf.o):
15725         (unexhp9k800.o, unexmacosx.o, unexsol.o, unexw32.o):
15726         Depend on unexec.h.
15727         * emacs.c [!defined CANNOT_DUMP]: Include unexec.h.
15728         * unexaix.c, unexcoff.c, unexcw.c, unexelf.c, unexhp9k800.c:
15729         * unexmacosx.c, unexsol.c, unexw32.c: Include unexec.h.
15730         Change as necessary to match prototype in unexec.h.
15732         * syntax.c (Fforward_comment, scan_lists): Rename locals to avoid
15733         shadowing.
15734         (back_comment, skip_chars): Mark vars as initialized.
15736         * character.h (FETCH_STRING_CHAR_ADVANCE_NO_CHECK, BUF_INC_POS):
15737         Rename locals to avoid shadowing.
15739         * lread.c (read1): Rewrite so as not to use empty "else".
15740         (Fload, readevalloop, read1): Rename locals to avoid shadowing.
15742         * print.c (Fredirect_debugging_output): Fix pointer signedess.
15744         * lisp.h (debug_output_compilation_hack): Add decl here, to avoid
15745         warning when compiling print.c.
15747         * font.c (font_unparse_fcname): Abort in an "impossible" situation
15748         instead of using an uninitialized var.
15749         (font_sort_entities): Mark var as initialized.
15751         * character.h (FETCH_CHAR_ADVANCE): Rename locals to avoid shadowing.
15753         * font.c (font_unparse_xlfd): Don't mix pointers to variables with
15754         pointers to constants.
15755         (font_parse_fcname): Remove unused vars.
15756         (font_delete_unmatched): Now static.
15757         (font_get_spec): Remove; unused.
15758         (font_style_to_value, font_prop_validate_style, font_unparse_fcname):
15759         (font_update_drivers, Ffont_get_glyphs, font_add_log):
15760         Rename or move locals to avoid shadowing.
15762         * fns.c (require_nesting_list, require_unwind): Now static.
15763         (Ffillarray): Rename locals to avoid shadowing.
15765         * floatfns.c (domain_error2): Define only if needed.
15766         (Ffrexp, Fldexp): Rename locals to avoid shadowing.
15768         * alloc.c (mark_backtrace): Move decl from here ...
15769         * lisp.h: ... to here, so that it can be checked.
15771         * eval.c (call_debugger, do_debug_on_call, grow_specpdl): Now static.
15772         (Fdefvar): Rewrite so as not to use empty "else".
15773         (lisp_indirect_variable): Name an expression,
15774         to avoid gcc -Wbad-function-cast warning.
15775         (Fdefvar): Rename locals to avoid shadowing.
15777         * callint.c (quotify_arg, quotify_args): Now static.
15778         (Fcall_interactively): Rename locals to avoid shadowing.
15779         Use const pointer when appropriate.
15781         * lisp.h (get_system_name, get_operating_system_release):
15782         Move decls here, to check interfaces.
15783         * process.c (get_operating_system_release): Move decl to lisp.h.
15784         * xrdb.c (get_system_name): Likewise.
15785         * editfns.c (init_editfns, Fuser_login_name, Fuser_uid):
15786         (Fuser_real_uid, Fuser_full_name): Remove unnecessary casts,
15787         some of which prompt warnings from gcc -Wbad-function-cast.
15788         (Fformat_time_string, Fencode_time, Finsert_char):
15789         (Ftranslate_region_internal, Fformat):
15790         Rename or remove local vars to avoid shadowing.
15791         (Ftranslate_region_internal): Mark var as initialized.
15793         * doc.c (Fdocumentation, Fsnarf_documentation): Move locals to
15794         avoid shadowing.
15796         * lisp.h (eassert): Check that the argument compiles, even if
15797         ENABLE_CHECKING is not defined.
15799         * data.c (Findirect_variable): Name an expression, to avoid
15800         gcc -Wbad-function-cast warning.
15801         (default_value, arithcompare, arith_driver, arith_error): Now static.
15802         (store_symval_forwarding): Rename local to avoid shadowing.
15803         (Fmake_variable_buffer_local, Fmake_local_variable):
15804         Mark variables as initialized.
15805         (do_blv_forwarding, do_symval_forwarding): Remove; unused.
15807         * alloc.c (check_cons_list): Do not define unless GC_CHECK_CONS_LIST.
15808         (Fmake_vector, Fvector, Fmake_byte_code, Fgarbage_collect):
15809         Rename locals to avoid shadowing.
15810         (mark_stack): Move local variables into the #ifdef region where
15811         they're used.
15812         (BLOCK_INPUT_ALLOC, UNBLOCK_INPUT_ALLOC): Define only if
15813         ! defined SYSTEM_MALLOC && ! defined SYNC_INPUT, as they are not
15814         needed otherwise.
15815         (CHECK_ALLOCATED): Define only if GC_CHECK_MARKED_OBJECTS.
15816         (GC_STRING_CHARS): Remove; not used.
15817         (Fmemory_limit): Cast sbrk's returned value to char *.
15819         * lisp.h (check_cons_list): Declare if GC_CHECK_CONS_LIST; this
15820         avoids undefined behavior in theory.
15822         * regex.c (IF_LINT): Add defn, for benefit of ../lib-src.
15824         Use functions, not macros, for up- and down-casing (Bug#8254).
15825         * buffer.h (DOWNCASE_TABLE, UPCASE_TABLE, DOWNCASE, UPPERCASEP):
15826         (NOCASEP, LOWERCASEP, UPCASE, UPCASE1): Remove.  All callers changed
15827         to use the following functions instead of these macros.
15828         (downcase): Adjust to lack of DOWNCASE_TABLE.  Return int, not
15829         EMACS_INT, since callers assume the returned value fits in int.
15830         (upcase1): Likewise, for UPCASE_TABLE.
15831         (uppercasep, lowercasep, upcase): New static inline functions.
15832         * editfns.c (Fchar_equal): Remove no-longer-needed workaround for
15833         the race-condition problem in the old DOWNCASE.
15835         * regex.c (CHARSET_LOOKUP_RANGE_TABLE_RAW, POP_FAILURE_REG_OR_COUNT):
15836         Rename locals to avoid shadowing.
15837         (regex_compile, re_match_2_internal): Move locals to avoid shadowing.
15838         (regex_compile, re_search_2, re_match_2_internal):
15839         Remove unused local vars.
15840         (FREE_VAR): Rewrite so as not to use empty "else",
15841         which gcc can warn about.
15842         (regex_compile, re_match_2_internal): Mark locals as initialized.
15843         (RETALLOC_IF): Define only if needed.
15844         (WORDCHAR_P): Likewise.  This one is never needed, but is used
15845         only in a comment talking about a compiler bug, so put inside
15846         the #if 0 of that comment.
15847         (CHARSET_LOOKUP_BITMAP, FAIL_STACK_FULL, RESET_FAIL_STACK):
15848         (PUSH_FAILURE_ELT, BUF_PUSH_3, STOP_ADDR_VSTRING):
15849         Remove; unused.
15851         * search.c (boyer_moore): Rename locals to avoid shadowing.
15852         * character.h (FETCH_STRING_CHAR_AS_MULTIBYTE_ADVANCE):
15853         (PREV_CHAR_BOUNDARY): Likewise.
15855         * search.c (simple_search): Remove unused var.
15857         * dired.c (compile_pattern): Move decl from here ...
15858         * lisp.h: ... to here, so that it can be checked.
15859         (struct re_registers): New forward decl.
15861         * character.h (INC_POS, DEC_POS): Rename locals to avoid shadowing.
15863         * indent.c (MULTIBYTE_BYTES_WIDTH): New args bytes, width.
15864         All uses changed.
15865         (MULTIBYTE_BYTES_WIDTH, scan_for_column, compute_motion):
15866         Rename locals to avoid shadowing.
15867         (Fvertical_motion): Mark locals as initialized.
15869         * casefiddle.c (casify_object, casify_region): Now static.
15870         (casify_region): Mark local as initialized.
15872         * cmds.c (internal_self_insert): Rename local to avoid shadowing.
15874         * lisp.h (GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR, GCPRO5_VAR, GCPRO6_VAR):
15875         New macros, so that the caller can use some names other than
15876         gcpro1, gcpro2, etc.
15877         (GCPRO2, GCPRO3, GCPRO4, GCPRO5, GCPRO6): Reimplement in terms
15878         of the new macros.
15879         (GCPRO1_VAR, UNGCPRO_VAR): Change the meaning of the second
15880         argument, for consistency with GCPRO2_VAR, etc: it is now the
15881         prefix of the variable, not the variable itself.  All uses
15882         changed.
15883         * dired.c (directory_files_internal, file_name_completion):
15884         Rename locals to avoid shadowing.
15886         Fix a race condition diagnosed by gcc -Wsequence-point (Bug#8254).
15887         An expression of the form (DOWNCASE (x) == DOWNCASE (y)), found in
15888         dired.c's scmp function, had undefined behavior.
15889         * lisp.h (DOWNCASE_TABLE, UPCASE_TABLE, DOWNCASE, UPPERCASEP):
15890         (NOCASEP, LOWERCASEP, UPCASE, UPCASE1): Move from here ...
15891         * buffer.h: ... to here, because these macros use current_buffer,
15892         and the new implementation with inline functions needs to have
15893         current_buffer in scope now, rather than later when the macros
15894         are used.
15895         (downcase, upcase1): New static inline functions.
15896         (DOWNCASE, UPCASE1): Reimplement using these functions.
15897         This avoids undefined behavior in expressions like
15898         DOWNCASE (x) == DOWNCASE (y), which previously suffered
15899         from race conditions in accessing the global variables
15900         case_temp1 and case_temp2.
15901         * casetab.c (case_temp1, case_temp2): Remove; no longer needed.
15902         * lisp.h (case_temp1, case_temp2): Remove their decls.
15903         * character.h (ASCII_CHAR_P): Move from here ...
15904         * lisp.h: ... to here, so that the inline functions mentioned
15905         above can use them.
15907         * dired.c (directory_files_internal_unwind): Now static.
15909         * fileio.c (file_name_as_directory, directory_file_name):
15910         (barf_or_query_if_file_exists, auto_save_error, auto_save_1):
15911         Now static.
15912         (file_name_as_directory): Use const pointers when appropriate.
15913         (Fexpand_file_name): Likewise.  In particular, newdir might
15914         point at constant storage, so make it a const pointer.
15915         (Fmake_directory_internal, Fread_file_name): Remove unused vars.
15916         (Ffile_selinux_context, Fset_file_selinux_context): Fix pointer
15917         signedness issues.
15918         (Fset_file_times, Finsert_file_contents, auto_save_error):
15919         Rename locals to avoid shadowing.
15921         * minibuf.c (choose_minibuf_frame_1): Now static.
15922         (Ftry_completion, Fall_completions): Rename or remove locals
15923         to avoid shadowing.
15925         * marker.c (bytepos_to_charpos): Remove; unused.
15927         * lisp.h (verify_bytepos, count_markers): New decls,
15928         so that gcc does not warn that these functions aren't declared.
15930         * insdel.c (check_markers, make_gap_larger, make_gap_smaller):
15931         (reset_var_on_error, Fcombine_after_change_execute_1): Now static.
15932         (CHECK_MARKERS): Redo to avoid gcc -Wempty-body diagnostic.
15933         (copy_text): Remove unused local var.
15935         * filelock.c (within_one_second): Now static.
15936         (lock_file_1): Rename local to avoid shadowing.
15938         * buffer.c (fix_overlays_before): Mark locals as initialized.
15939         (fix_start_end_in_overlays): Likewise.  This function should be
15940         simplified by using pointers-to-pointers, but that's a different
15941         matter.
15942         (switch_to_buffer_1): Now static.
15943         (Fkill_buffer, record_buffer, Fbury_buffer, Fset_buffer_multibyte):
15944         (report_overlay_modification): Rename locals to avoid shadowing.
15946         * sysdep.c (system_process_attributes): Rename vars to avoid shadowing.
15947         Fix pointer signedness issue.
15948         (sys_subshell): Mark local as volatile if checking for lint,
15949         to suppress a gcc -Wclobbered warning that does not seem to be right.
15950         (MAXPATHLEN): Define only if needed.
15952         * process.c (serial_open, serial_configure): Move decls from here ...
15953         * systty.h: ... to here, so that they can be checked.
15955         * fns.c (get_random, seed_random): Move extern decls from here ...
15956         * lisp.h: ... to here, so that they can be checked.
15958         * sysdep.c (reset_io): Now static.
15959         (wait_for_termination_signal): Remove; unused.
15961         * keymap.c (keymap_parent, keymap_memberp, map_keymap_internal):
15962         (copy_keymap_item, append_key, push_text_char_description):
15963         Now static.
15964         (Fwhere_is_internal): Don't test CONSP (sequences) unnecessarily.
15965         (DENSE_TABLE_SIZE): Remove; unused.
15966         (get_keymap, access_keymap, Fdefine_key, Fwhere_is_internal):
15967         (describe_map_tree):
15968         Rename locals to avoid shadowing.
15970         * keyboard.c: Declare functions static if they are not used elsewhere.
15971         (echo_char, echo_dash, cmd_error, top_level_2):
15972         (poll_for_input, handle_async_input): Now static.
15973         (read_char, kbd_buffer_get_event, make_lispy_position):
15974         (make_lispy_event, make_lispy_movement, apply_modifiers):
15975         (decode_keyboard_code, tty_read_avail_input, menu_bar_items):
15976         (parse_tool_bar_item, read_key_sequence, Fread_key_sequence):
15977         (Fread_key_sequence_vector): Rename locals to avoid shadowing.
15978         (read_key_sequence, read_char): Mark locals as initialized.
15979         (Fexit_recursive_edit, Fabort_recursive_edit): Mark with NO_RETURN.
15981         * keyboard.h (make_ctrl_char): New decl.
15982         (mark_kboards): Move decl here ...
15983         * alloc.c (mark_kboards): ... from here.
15985         * lisp.h (force_auto_save_soon): New decl.
15987         * emacs.c (init_cmdargs): Rename local to avoid shadowing.
15988         (DEFINE_DUMMY_FUNCTION): New macro.
15989         (__do_global_ctors, __do_global_ctors_aux, __do_global_dtors, __main):
15990         Use it.
15991         (main): Add casts to avoid warnings
15992         if GCC considers string literals to be constants.
15994         * lisp.h (fatal_error_signal): Add decl, since it's exported.
15996         * dbusbind.c: Pointer signedness fixes.
15997         (xd_signature, xd_append_arg, xd_initialize):
15998         (Fdbus_call_method, Fdbus_call_method_asynchronously):
15999         (Fdbus_method_return_internal, Fdbus_method_error_internal):
16000         (Fdbus_send_signal, xd_read_message_1, Fdbus_register_service):
16001         (Fdbus_register_signal): Use SSDATA when the context wants char *.
16003         * dbusbind.c (Fdbus_init_bus): Add cast to avoid warning
16004         if GCC considers string literals to be constants.
16005         (Fdbus_register_service, Fdbus_register_method): Remove unused vars.
16007 2011-03-16  Stefan Monnier  <monnier@iro.umontreal.ca>
16009         * print.c (PRINT_CIRCLE_CANDIDATE_P): New macro.
16010         (print_preprocess, print_object): New macro to fix last change.
16012         * print.c (print_preprocess): Don't forget font objects.
16014 2011-03-16  Juanma Barranquero  <lekktu@gmail.com>
16016         * emacs.c (USAGE3): Doc fixes.
16018 2011-03-15  Andreas Schwab  <schwab@linux-m68k.org>
16020         * coding.c (detect_coding_iso_2022): Reorganize code to clarify
16021         structure.
16023 2011-03-14  Juanma Barranquero  <lekktu@gmail.com>
16025         * lisp.h (VWindow_system, Qfile_name_history):
16026         * keyboard.h (lispy_function_keys) [WINDOWSNT]:
16027         * w32term.h (w32_system_caret_hwnd, w32_system_caret_height)
16028         (w32_system_caret_x, w32_system_caret_y): Declare extern.
16030         * w32select.c: Don't #include "keyboard.h".
16031         (run_protected): Add extern declaration for waiting_for_input.
16033         * w32.c (Qlocal, noninteractive1, inhibit_window_system):
16034         * w32console.c (detect_input_pending, read_input_pending)
16035         (encode_terminal_code):
16036         * w32fns.c (quit_char, lispy_function_keys, Qtooltip)
16037         (w32_system_caret_hwnd, w32_system_caret_height, w32_system_caret_x)
16038         (w32_system_caret_y, Qfile_name_history):
16039         * w32font.c (w32font_driver, QCantialias, QCotf, QClang):
16040         * w32inevt.c (reinvoke_input_signal, lispy_function_keys):
16041         * w32menu.c (Qmenu_bar, QCtoggle, QCradio, Qoverriding_local_map)
16042         (Qoverriding_terminal_local_map, Qmenu_bar_update_hook):
16043         * w32proc.c (Qlocal, report_file_error):
16044         * w32term.c (Vwindow_system, updating_frame):
16045         * w32uniscribe.c (initialized, uniscribe_font_driver):
16046         Remove unneeded extern declarations.
16048 2011-03-14  Chong Yidong  <cyd@stupidchicken.com>
16050         * buffer.c (Fmake_indirect_buffer): Fix incorrect assertions.
16052 2011-03-13  Chong Yidong  <cyd@stupidchicken.com>
16054         * buffer.h (BUF_BEGV, BUF_BEGV_BYTE, BUF_ZV, BUF_ZV_BYTE, BUF_PT)
16055         (BUF_PT_BYTE): Rewrite to handle indirect buffers (Bug#8219).
16056         These macros can no longer be used for assignment.
16058         * buffer.c (Fget_buffer_create, Fmake_indirect_buffer):
16059         Assign struct members directly, instead of using BUF_BEGV etc.
16060         (record_buffer_markers, fetch_buffer_markers): New functions for
16061         recording and fetching special buffer markers.
16062         (set_buffer_internal_1, set_buffer_temp): Use them.
16064         * lread.c (unreadchar): Use SET_BUF_PT_BOTH.
16066         * insdel.c (adjust_point): Use SET_BUF_PT_BOTH.
16068         * intervals.c (temp_set_point_both): Use SET_BUF_PT_BOTH.
16069         (get_local_map): Use SET_BUF_BEGV_BOTH and SET_BUF_ZV_BOTH.
16071         * xdisp.c (hscroll_window_tree):
16072         (reconsider_clip_changes): Use PT instead of BUF_PT.
16074 2011-03-13  Eli Zaretskii  <eliz@gnu.org>
16076         * makefile.w32-in ($(BLD)/editfns.$(O)): Depend on
16077         $(EMACS_ROOT)/lib/intprops.h.
16079 2011-03-13  Paul Eggert  <eggert@cs.ucla.edu>
16081         Fix more problems found by GCC 4.5.2's static checks.
16083         * gtkutil.c (xg_get_pixbuf_from_pixmap): Add cast from char *
16084         to unsigned char * to avoid compiler diagnostic.
16085         (xg_free_frame_widgets): Make it clear that a local variable is
16086         needed only if USE_GTK_TOOLTIP.
16087         (gdk_window_get_screen): Make it clear that this macro is needed
16088         only if USE_GTK_TOOLTIP.
16089         (int_gtk_range_get_value): New function, which avoids a diagnostic
16090         from gcc -Wbad-function-cast.
16091         (xg_set_toolkit_scroll_bar_thumb): Use it.
16092         (xg_tool_bar_callback, xg_tool_item_stale_p): Rewrite to avoid
16093         diagnostic from gcc -Wbad-function-cast.
16094         (get_utf8_string, xg_get_file_with_chooser):
16095         Rename locals to avoid shadowing.
16096         (create_dialog): Move locals to avoid shadowing.
16098         * xgselect.c (xg_select): Remove unused var.
16100         * image.c (four_corners_best): Mark locals as initialized.
16101         (gif_load): Initialize transparent_p to zero (Bug#8238).
16102         Mark another local as initialized.
16103         (my_png_error, my_error_exit): Mark with NO_RETURN.
16105         * image.c (clear_image_cache): Now static.
16106         (DIM, HAVE_STDLIB_H_1): Remove unused macros.
16107         (xpm_load): Redo to avoid "discards qualifiers" gcc warning.
16108         (x_edge_detection): Remove unnecessary cast that
16109         gcc -Wbad-function-cast diagnoses.
16110         (gif_load): Fix pointer signedness.
16111         (clear_image_cache, xbm_read_bitmap_data, x_detect_edges):
16112         (jpeg_load, gif_load): Rename locals to avoid shadowing.
16114 2011-03-12  Paul Eggert  <eggert@cs.ucla.edu>
16116         Improve quality of tests for time stamp overflow.
16117         For example, without this patch (encode-time 0 0 0 1 1
16118         1152921504606846976) returns the obviously-bogus value (-948597
16119         62170) on my RHEL 5.5 x86-64 host.  With the patch, it correctly
16120         reports time overflow.  See
16121         <http://lists.gnu.org/archive/html/emacs-devel/2011-03/msg00470.html>.
16122         * deps.mk (editfns.o): Depend on ../lib/intprops.h.
16123         * editfns.c: Include limits.h and intprops.h.
16124         (TIME_T_MIN, TIME_T_MAX): New macros.
16125         (time_overflow): Move earlier, to before first use.
16126         (hi_time, lo_time): New functions, for an accurate test for
16127         out-of-range times.
16128         (Fcurrent_time, Fget_internal_run_time, make_time): Use them.
16129         (Fget_internal_run_time): Don't assume time_t fits in int.
16130         (make_time): Use list2 instead of Fcons twice.
16131         (Fdecode_time): More accurate test for out-of-range times.
16132         (check_tm_member): New function.
16133         (Fencode_time): Use it, to test for out-of-range times.
16134         (lisp_time_argument): Don't rely on undefined left-shift and
16135         right-shift behavior when checking for time stamp overflow.
16137         * editfns.c (time_overflow): New function, refactoring common code.
16138         (Fformat_time_string, Fdecode_time, Fencode_time):
16139         (Fcurrent_time_string): Use it.
16141         Move 'make_time' to be next to its inverse 'lisp_time_argument'.
16142         * dired.c (make_time): Move to ...
16143         * editfns.c (make_time): ... here.
16144         * systime.h: Note the move.
16146 2011-03-12  YAMAMOTO Mitsuharu  <mituharu@math.s.chiba-u.ac.jp>
16148         * fringe.c (update_window_fringes): Remove unused variables.
16150         * unexmacosx.c (copy_data_segment): Also copy __got section.
16151         (Bug#8223)
16153 2011-03-12  Eli Zaretskii  <eliz@gnu.org>
16155         * termcap.c [MSDOS]: Include "msdos.h".
16156         (find_capability, tgetnum, tgetflag, tgetstr, tputs, tgetent):
16157         Constify `char *' arguments and their references according to
16158         prototypes in tparam.h.
16160         * deps.mk (termcap.o): Depend on tparam.h and msdos.h.
16162         * msdos.c (XMenuAddPane): 3rd argument is `const char *' now.
16163         Adapt all references accordingly.
16165         * msdos.h (XMenuAddPane): 3rd argument is `const char *' now.
16167 2011-03-11  Tom Tromey  <tromey@redhat.com>
16169         * buffer.c (syms_of_buffer): Remove obsolete comment.
16171 2011-03-11  Eli Zaretskii  <eliz@gnu.org>
16173         * termhooks.h (encode_terminal_code): Declare prototype.
16175         * msdos.c (encode_terminal_code): Don't declare prototype.
16177         * term.c (encode_terminal_code): Now external again, used by
16178         w32console.c and msdos.c.
16180         * makefile.w32-in ($(BLD)/term.$(O), ($(BLD)/tparam.$(O)):
16181         Depend on $(SRC)/tparam.h, see revno 103623.
16183 2011-03-11  Paul Eggert  <eggert@cs.ucla.edu>
16185         Fix some minor problems found by GCC 4.5.2's static checks.
16187         * fringe.c (update_window_fringes): Mark locals as initialized
16188         (Bug#8227).
16189         (destroy_fringe_bitmap, init_fringe_bitmap): Now static.
16191         * alloc.c (mark_fringe_data): Move decl from here ...
16192         * lisp.h (mark_fringe_data) [HAVE_WINDOW_SYSTEM]: ... to here,
16193         to check its interface.
16194         (init_fringe_once): Do not declare unless HAVE_WINDOW_SYSTEM.
16196         * fontset.c (free_realized_fontset): Now static.
16197         (Fset_fontset_font): Rename local to avoid shadowing.
16198         (fontset_font): Mark local as initialized.
16199         (FONTSET_SPEC, FONTSET_REPERTORY, RFONT_DEF_REPERTORY): Remove; unused.
16201         * xrdb.c: Include "xterm.h", to check x_load_resources's interface.
16203         * xselect.c (x_disown_buffer_selections): Remove; not used.
16204         (TRACE3) [!defined TRACE_SELECTION]: Remove; not used.
16205         (x_own_selection, Fx_disown_selection_internal): Rename locals
16206         to avoid shadowing.
16207         (x_handle_dnd_message): Remove local to avoid shadowing.
16209         * lisp.h (GCPRO1_VAR, UNGCPRO_VAR): New macros,
16210         so that the caller can use some name other than gcpro1.
16211         (GCPRO1, UNGCPRO): Reimplement in terms of the new macros.
16212         * xfns.c (Fx_create_frame, x_create_tip_frame, Fx_show_tip):
16213         (Fx_backspace_delete_keys_p):
16214         Use them to avoid shadowing, and rename vars to avoid shadowing.
16215         (x_decode_color, x_set_name, x_window): Now static.
16216         (Fx_create_frame): Add braces to silence GCC warning.
16217         (Fx_file_dialog, Fx_select_font): Fix pointer signedness.
16218         (x_real_positions, xg_set_icon_from_xpm_data, x_create_tip_frame):
16219         Remove unused locals.
16220         (Fx_create_frame, x_create_tip_frame, Fx_show_tip):
16221         (Fx_backspace_delete_keys_p): Rename locals to avoid shadowing.
16222         Some of these renamings use the new GCPRO1_VAR and UNGCPRO_VAR
16223         macros.
16225         * xterm.h (x_mouse_leave): New decl.
16227         * xterm.c (x_copy_dpy_color, x_focus_on_frame, x_unfocus_frame):
16228         Remove unused functions.
16229         (x_shift_glyphs_for_insert, XTflash, XTring_bell):
16230         (x_calc_absolute_position): Now static.
16231         (XTread_socket): Don't define label "out" unless it's used.
16232         Don't declare local "event" unless it's used.
16233         (x_iconify_frame, x_free_frame_resources): Don't declare locals
16234         unless they are used.
16235         (XEMBED_VERSION, xembed_set_info): Don't define unless needed.
16236         (x_fatal_error_signal): Remove; not used.
16237         (x_draw_image_foreground, redo_mouse_highlight, XTmouse_position):
16238         (x_scroll_bar_report_motion, handle_one_xevent, x_draw_bar_cursor):
16239         (x_error_catcher, x_connection_closed, x_error_handler):
16240         (x_error_quitter, xembed_send_message, x_iconify_frame):
16241         (my_log_handler): Rename locals to avoid shadowing.
16242         (x_delete_glyphs, x_ins_del_lines): Mark with NO_RETURN.
16243         (x_connection_closed): Tell GCC not to suggest NO_RETURN.
16245         * xfaces.c (clear_face_cache, Fx_list_fonts, Fface_font):
16246         Rename or move locals to avoid shadowing.
16247         (tty_defined_color, merge_face_heights): Now static.
16248         (free_realized_faces_for_fontset): Remove; not used.
16249         (Fx_list_fonts): Mark variable that gcc -Wuninitialized
16250         does not deduce is never used uninitialized.
16251         (STRDUPA, LSTRDUPA, FONT_POINT_SIZE_QUANTUM): Remove; not used.
16252         (LFACEP): Define only if XASSERTS, as it's not needed otherwise.
16254         * terminal.c (store_terminal_param): Now static.
16256         * xmenu.c (menu_highlight_callback): Now static.
16257         (set_frame_menubar): Remove unused local.
16258         (xmenu_show): Rename parameter to avoid shadowing.
16259         (xmenu_show, xdialog_show, xmenu_show): Make local pointers "const"
16260         since they might point to immutable storage.
16261         (next_menubar_widget_id): Declare only if USE_X_TOOLKIT,
16262         since it's unused otherwise.
16264         * xdisp.c (produce_glyphless_glyph): Initialize lower_xoff.
16265         Add a FIXME, since the code still doesn't look right.  (Bug#8215)
16266         (Fcurrent_bidi_paragraph_direction): Simplify slightly; this
16267         avoids a gcc -Wuninitialized diagnostic.
16268         (display_line, BUILD_COMPOSITE_GLYPH_STRING, draw_glyphs):
16269         (note_mouse_highlight): Mark variables that gcc -Wuninitialized
16270         does not deduce are never used uninitialized.
16272         * lisp.h (IF_LINT): New macro, copied from ../lib-src/emacsclient.c.
16274         * xdisp.c (redisplay_window): Rename local to avoid shadowing.
16275         * window.c (window_loop, size_window):
16276         (run_window_configuration_change_hook, enlarge_window): Likewise.
16278         * window.c (display_buffer): Now static.
16279         (size_window): Mark variables that gcc -Wuninitialized
16280         does not deduce are never used uninitialized.
16281         * window.h (check_all_windows): New decl, to forestall
16282         gcc -Wmissing-prototypes diagnostic.
16283         * dispextern.h (bidi_dump_cached_states): Likewise.
16285         * charset.h (CHECK_CHARSET_GET_CHARSET): Rename locals to avoid
16286         shadowing.
16287         * charset.c (map_charset_for_dump, Fchar_charset): Likewise.
16288         Include <limits.h>.
16289         (Fsort_charsets): Redo min/max calculation to shorten the code a bit
16290         and to avoid gcc -Wuninitialized warning.
16291         (load_charset_map): Mark variables that gcc -Wuninitialized
16292         does not deduce are never used uninitialized.
16293         (load_charset): Abort instead of using uninitialized var (Bug#8229).
16295         * coding.c (coding_set_source, coding_set_destination):
16296         Use "else { /* comment */ }" rather than "else /* comment */;"
16297         for clarity, and to avoid gcc -Wempty-body warning.
16298         (Fdefine_coding_system_internal): Don't redeclare 'i' inside
16299         a block, when the outer 'i' will do.
16300         (decode_coding_utf_8, decode_coding_utf_16, detect_coding_emacs_mule):
16301         (emacs_mule_char, decode_coding_emacs_mule, detect_coding_iso_2022):
16302         (decode_coding_iso_2022, decode_coding_sjis, decode_coding_big5):
16303         (decode_coding_raw_text, decode_coding_charset, get_translation_table):
16304         (Fdecode_sjis_char, Fdefine_coding_system_internal):
16305         Rename locals to avoid shadowing.
16306         * character.h (FETCH_STRING_CHAR_ADVANCE): Likewise.
16307         * coding.c (emacs_mule_char, encode_invocation_designation):
16308         Now static, since they're not used elsewhere.
16309         (decode_coding_iso_2022): Add "default: abort ();" as a safety check.
16310         (decode_coding_object, encode_coding_object, detect_coding_system):
16311         (decode_coding_emacs_mule): Mark variables that gcc
16312         -Wuninitialized does not deduce are never used uninitialized.
16313         (detect_coding_iso_2022): Initialize a local variable that might
16314         be used uninitialized.  Leave a FIXME because it's not clear that
16315         this initialization is needed.  (Bug#8211)
16316         (ISO_CODE_LF, ISO_CODE_CR, CODING_ISO_FLAG_EUC_TW_SHIFT):
16317         (ONE_MORE_BYTE_NO_CHECK, UTF_BOM, UTF_16_INVALID_P):
16318         (SHIFT_OUT_OK, ENCODE_CONTROL_SEQUENCE_INTRODUCER):
16319         (ENCODE_DIRECTION_R2L, ENCODE_DIRECTION_L2R):
16320         Remove unused macros.
16322         * category.c (hash_get_category_set): Remove unused local var.
16323         (copy_category_table): Now static, since it's not used elsewhere.
16324         * character.c (string_count_byte8): Likewise.
16326         * ccl.c (CCL_WRITE_STRING, CCL_ENCODE_CHAR, Fccl_execute_on_string):
16327         (Fregister_code_conversion_map): Rename locals to avoid shadowing.
16329         * chartab.c (copy_sub_char_table): Now static, since it's not used
16330         elsewhere.
16331         (sub_char_table_ref_and_range, char_table_ref_and_range):
16332         Rename locals to avoid shadowing.
16333         (ASET_RANGE, GET_SUB_CHAR_TABLE): Remove unused macros.
16335         * bidi.c (bidi_check_type): Now static, since it's not used elsewhere.
16336         (BIDI_BOB): Remove unused macro.
16338         * cm.c (cmgoto): Mark variables that gcc -Wuninitialized does not
16339         deduce are never used uninitialized.
16340         * term.c (encode_terminal_code): Likewise.
16342         * term.c (encode_terminal_code): Now static.  Remove unused local.
16344         * tparam.h: New file.
16345         * term.c, tparam.h: Include it.
16346         * deps.mk (term.o, tparam.o): Depend on tparam.h.
16347         * term.c (tputs, tgetent, tgetflag, tgetnum, tparam, tgetstr):
16348         Move these decls to tparam.h, and make them agree with what
16349         is actually in tparam.c.  The previous trick of using incompatible
16350         decls in different modules does not conform to the C standard.
16351         All callers of tparam changed to use tparam's actual API.
16352         * tparam.c (tparam1, tparam, tgoto):
16353         Use const pointers where appropriate.
16355         * cm.c (calccost, cmgoto): Use const pointers where appropriate.
16356         * cm.h (struct cm): Likewise.
16357         * dispextern.h (do_line_insertion_deletion_costs): Likewise.
16358         * scroll.c (ins_del_costs, do_line_insertion_deletion_costs): Likewise.
16359         * term.c (tty_ins_del_lines, calculate_costs, struct fkey_table):
16360         (term_get_fkeys_1, append_glyphless_glyph, produce_glyphless_glyph):
16361         (turn_on_face, init_tty): Likewise.
16362         * termchar.h (struct tty_display_info): Likewise.
16364         * term.c (term_mouse_position): Rename local to avoid shadowing.
16366         * alloc.c (mark_ttys): Move decl from here ...
16367         * lisp.h (mark_ttys): ... to here, so that it's checked against defn.
16369 2011-03-11  Andreas Schwab  <schwab@linux-m68k.org>
16371         * .gdbinit (pwinx, xbuffer): Fix access to buffer name.
16373 2011-03-09  Juanma Barranquero  <lekktu@gmail.com>
16375         * search.c (compile_pattern_1): Remove argument regp, unused since
16376         revid:rms@gnu.org-19941211082627-3x1g1wyqkjmwloig.
16377         (compile_pattern): Don't pass it.
16379 2011-03-08  Jan Djärv  <jan.h.d@swipnet.se>
16381         * xterm.h (DEFAULT_GDK_DISPLAY): New define.
16382         (GDK_WINDOW_XID, gtk_widget_get_preferred_size): New defines
16383         for ! HAVE_GTK3.
16384         (GTK_WIDGET_TO_X_WIN): Use GDK_WINDOW_XID.
16386         * xmenu.c (menu_position_func): Call gtk_widget_get_preferred_size.
16388         * gtkutil.c: Include gtkx.h if HAVE_GTK3.  If ! HAVE_GTK3, define
16389         gdk_window_get_screen, gdk_window_get_geometry,
16390         gdk_x11_window_lookup_for_display and GDK_KEY_g.
16391         (xg_set_screen): Use DEFAULT_GDK_DISPLAY.
16392         (xg_get_pixbuf_from_pixmap): New function.
16393         (xg_get_pixbuf_from_pix_and_mask): Change parameters from GdkPixmap
16394         to Pixmap, take frame as parameter, remove GdkColormap parameter.
16395         Call xg_get_pixbuf_from_pixmap instead of
16396         gdk_pixbuf_get_from_drawable.
16397         (xg_get_image_for_pixmap): Do not make GdkPixmaps, call
16398         xg_get_pixbuf_from_pix_and_mask with Pixmap parameters instead.
16399         (xg_check_special_colors): Use GtkStyleContext and its functions
16400         for HAVE_GTK3.
16401         (xg_prepare_tooltip, xg_hide_tooltip): Call gdk_window_get_screen.
16402         (xg_prepare_tooltip, create_dialog, menubar_map_cb)
16403         (xg_update_frame_menubar, xg_tool_bar_detach_callback)
16404         (xg_tool_bar_attach_callback, xg_update_tool_bar_sizes):
16405         Call gtk_widget_get_preferred_size.
16406         (xg_frame_resized): gdk_window_get_geometry only takes 5
16407         parameters.
16408         (xg_win_to_widget, xg_event_is_for_menubar):
16409         Call gdk_x11_window_lookup_for_display.
16410         (xg_set_widget_bg): New function.
16411         (delete_cb): New function.
16412         (xg_create_frame_widgets): Connect delete-event to delete_cb.
16413         Call xg_set_widget_bg.  Only set background pixmap for ! HAVE_GTK3
16414         (xg_set_background_color): Call xg_set_widget_bg.
16415         (xg_set_frame_icon): Call xg_get_pixbuf_from_pix_and_mask.
16416         (xg_create_scroll_bar): vadj is a GtkAdjustment for HAVE_GTK3.
16417         Only call gtk_range_set_update_policy if ! HAVE_GTK3.
16418         (xg_make_tool_item): Only connect xg_tool_bar_item_expose_callback
16419         if ! HAVE_GTK3.
16420         (update_frame_tool_bar): Call gtk_widget_hide.
16421         (xg_initialize): Use GDK_KEY_g.
16423         * xsmfns.c (gdk_set_sm_client_id): Define to gdk_set_sm_client_id
16424         if ! HAVE_GTK3
16425         (x_session_initialize): Call gdk_x11_set_sm_client_id.
16427         * xterm.c (XFillRectangle): Use cairo routines for HAVE_GTK3.
16428         (x_term_init): Disable Xinput(2) with GDK_CORE_DEVICE_EVENTS.
16429         Load ~/emacs.d/gtkrc only for ! HAVE_GTK3.
16431 2011-03-08  Juanma Barranquero  <lekktu@gmail.com>
16433         * w32xfns.c (select_palette): Check success of RealizePalette against
16434         GDI_ERROR, not zero.
16436 See ChangeLog.11 for earlier changes.
16438 ;; Local Variables:
16439 ;; coding: utf-8
16440 ;; End:
16442   Copyright (C) 2011-2012 Free Software Foundation, Inc.
16444   This file is part of GNU Emacs.
16446   GNU Emacs is free software: you can redistribute it and/or modify
16447   it under the terms of the GNU General Public License as published by
16448   the Free Software Foundation, either version 3 of the License, or
16449   (at your option) any later version.
16451   GNU Emacs is distributed in the hope that it will be useful,
16452   but WITHOUT ANY WARRANTY; without even the implied warranty of
16453   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16454   GNU General Public License for more details.
16456   You should have received a copy of the GNU General Public License
16457   along with GNU Emacs.  If not, see <http://www.gnu.org/licenses/>.